var mL=Object.defineProperty;var vL=(e,t,n)=>t in e?mL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var zS=(e,t,n)=>(vL(e,typeof t!="symbol"?t+"":t,n),n);function xP(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 l of i)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(i){const l={};return i.integrity&&(l.integrity=i.integrity),i.referrerpolicy&&(l.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?l.credentials="include":i.crossorigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(i){if(i.ep)return;i.ep=!0;const l=n(i);fetch(i.href,l)}})();var Us=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Iw(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var C={exports:{}},ir={};/** * @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 Fp=Symbol.for("react.element"),gL=Symbol.for("react.portal"),yL=Symbol.for("react.fragment"),xL=Symbol.for("react.strict_mode"),_L=Symbol.for("react.profiler"),bL=Symbol.for("react.provider"),wL=Symbol.for("react.context"),CL=Symbol.for("react.forward_ref"),SL=Symbol.for("react.suspense"),EL=Symbol.for("react.memo"),kL=Symbol.for("react.lazy"),FS=Symbol.iterator;function TL(e){return e===null||typeof e!="object"?null:(e=FS&&e[FS]||e["@@iterator"],typeof e=="function"?e:null)}var _P={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},bP=Object.assign,wP={};function nf(e,t,n){this.props=e,this.context=t,this.refs=wP,this.updater=n||_P}nf.prototype.isReactComponent={};nf.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")};nf.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function CP(){}CP.prototype=nf.prototype;function Mw(e,t,n){this.props=e,this.context=t,this.refs=wP,this.updater=n||_P}var Rw=Mw.prototype=new CP;Rw.constructor=Mw;bP(Rw,nf.prototype);Rw.isPureReactComponent=!0;var $S=Array.isArray,SP=Object.prototype.hasOwnProperty,Aw={current:null},EP={key:!0,ref:!0,__self:!0,__source:!0};function kP(e,t,n){var r,i={},l=null,c=null;if(t!=null)for(r in t.ref!==void 0&&(c=t.ref),t.key!==void 0&&(l=""+t.key),t)SP.call(t,r)&&!EP.hasOwnProperty(r)&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1>>1,ke=oe[Te];if(0>>1;Tei(Ne,Re))Lei(Ve,Ne)?(oe[Te]=Ve,oe[Le]=Re,Te=Le):(oe[Te]=Ne,oe[Me]=Re,Te=Me);else if(Lei(Ve,Re))oe[Te]=Ve,oe[Le]=Re,Te=Le;else break e}}return ye}function i(oe,ye){var Re=oe.sortIndex-ye.sortIndex;return Re!==0?Re:oe.id-ye.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var c=Date,o=c.now();e.unstable_now=function(){return c.now()-o}}var h=[],p=[],g=1,b=null,w=3,P=!1,I=!1,A=!1,O=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function N(oe){for(var ye=n(p);ye!==null;){if(ye.callback===null)r(p);else if(ye.startTime<=oe)r(p),ye.sortIndex=ye.expirationTime,t(h,ye);else break;ye=n(p)}}function z(oe){if(A=!1,N(oe),!I)if(n(h)!==null)I=!0,re(B);else{var ye=n(p);ye!==null&&de(z,ye.startTime-oe)}}function B(oe,ye){I=!1,A&&(A=!1,M(H),H=-1),P=!0;var Re=w;try{for(N(ye),b=n(h);b!==null&&(!(b.expirationTime>ye)||oe&&!le());){var Te=b.callback;if(typeof Te=="function"){b.callback=null,w=b.priorityLevel;var ke=Te(b.expirationTime<=ye);ye=e.unstable_now(),typeof ke=="function"?b.callback=ke:b===n(h)&&r(h),N(ye)}else r(h);b=n(h)}if(b!==null)var De=!0;else{var Me=n(p);Me!==null&&de(z,Me.startTime-ye),De=!1}return De}finally{b=null,w=Re,P=!1}}var U=!1,q=null,H=-1,te=5,Y=-1;function le(){return!(e.unstable_now()-Yoe||125Te?(oe.sortIndex=Re,t(p,oe),n(h)===null&&oe===n(p)&&(A?(M(H),H=-1):A=!0,de(z,Re-Te))):(oe.sortIndex=ke,t(h,oe),I||P||(I=!0,re(B))),oe},e.unstable_shouldYield=le,e.unstable_wrapCallback=function(oe){var ye=w;return function(){var Re=w;w=ye;try{return oe.apply(this,arguments)}finally{w=Re}}}})(PP);(function(e){e.exports=PP})(TP);/** * @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 IP=C.exports,Xo=TP.exports;function Kt(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"),Y_=Object.prototype.hasOwnProperty,AL=/^[: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]*$/,VS={},US={};function OL(e){return Y_.call(US,e)?!0:Y_.call(VS,e)?!1:AL.test(e)?US[e]=!0:(VS[e]=!0,!1)}function NL(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 DL(e,t,n,r){if(t===null||typeof t>"u"||NL(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 So(e,t,n,r,i,l,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=l,this.removeEmptyString=c}var Zi={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Zi[e]=new So(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Zi[t]=new So(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Zi[e]=new So(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Zi[e]=new So(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){Zi[e]=new So(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Zi[e]=new So(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Zi[e]=new So(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Zi[e]=new So(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Zi[e]=new So(e,5,!1,e.toLowerCase(),null,!1,!1)});var Nw=/[\-:]([a-z])/g;function Dw(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(Nw,Dw);Zi[t]=new So(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(Nw,Dw);Zi[t]=new So(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(Nw,Dw);Zi[t]=new So(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Zi[e]=new So(e,1,!1,e.toLowerCase(),null,!1,!1)});Zi.xlinkHref=new So("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Zi[e]=new So(e,1,!1,e.toLowerCase(),null,!0,!0)});function Lw(e,t,n,r){var i=Zi.hasOwnProperty(t)?Zi[t]:null;(i!==null?i.type!==0:r||!(2o||i[c]!==l[o]){var h=` `+i[c].replace(" at new "," at ");return e.displayName&&h.includes("")&&(h=h.replace("",e.displayName)),h}while(1<=c&&0<=o);break}}}finally{xx=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Nh(e):""}function LL(e){switch(e.tag){case 5:return Nh(e.type);case 16:return Nh("Lazy");case 13:return Nh("Suspense");case 19:return Nh("SuspenseList");case 0:case 2:case 15:return e=_x(e.type,!1),e;case 11:return e=_x(e.type.render,!1),e;case 1:return e=_x(e.type,!0),e;default:return""}}function tb(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 md:return"Fragment";case pd:return"Portal";case Q_:return"Profiler";case zw:return"StrictMode";case J_:return"Suspense";case eb:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case AP:return(e.displayName||"Context")+".Consumer";case RP:return(e._context.displayName||"Context")+".Provider";case Fw:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case $w:return t=e.displayName||null,t!==null?t:tb(e.type)||"Memo";case Al:t=e._payload,e=e._init;try{return tb(e(t))}catch{}}return null}function zL(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 tb(t);case 8:return t===zw?"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 ru(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function NP(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function FL(e){var t=NP(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,l=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(c){r=""+c,l.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=FL(e))}function DP(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=NP(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Lg(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 nb(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 KS(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ru(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 LP(e,t){t=t.checked,t!=null&&Lw(e,"checked",t,!1)}function rb(e,t){LP(e,t);var n=ru(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")?ib(e,t.type,n):t.hasOwnProperty("defaultValue")&&ib(e,t.type,ru(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function HS(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 ib(e,t,n){(t!=="number"||Lg(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Dh=Array.isArray;function Md(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=wv.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function up(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var jh={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},$L=["Webkit","ms","Moz","O"];Object.keys(jh).forEach(function(e){$L.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),jh[t]=jh[e]})});function BP(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||jh.hasOwnProperty(e)&&jh[e]?(""+t).trim():t+"px"}function VP(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=BP(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var BL=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 sb(e,t){if(t){if(BL[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Kt(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Kt(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Kt(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Kt(62))}}function lb(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 ub=null;function Bw(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var cb=null,Rd=null,Ad=null;function qS(e){if(e=Vp(e)){if(typeof cb!="function")throw Error(Kt(280));var t=e.stateNode;t&&(t=qy(t),cb(e.stateNode,e.type,t))}}function UP(e){Rd?Ad?Ad.push(e):Ad=[e]:Rd=e}function jP(){if(Rd){var e=Rd,t=Ad;if(Ad=Rd=null,qS(e),t)for(e=0;e>>=0,e===0?32:31-(YL(e)/QL|0)|0}var Cv=64,Sv=4194304;function Lh(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 Bg(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,l=e.pingedLanes,c=n&268435455;if(c!==0){var o=c&~i;o!==0?r=Lh(o):(l&=c,l!==0&&(r=Lh(l)))}else c=n&~i,c!==0?r=Lh(c):l!==0&&(r=Lh(l));if(r===0)return 0;if(t!==0&&t!==r&&(t&i)===0&&(i=r&-r,l=t&-t,i>=l||i===16&&(l&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 $p(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 nz(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=Hh),rE=String.fromCharCode(32),iE=!1;function u8(e,t){switch(e){case"keyup":return Mz.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function c8(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var vd=!1;function Az(e,t){switch(e){case"compositionend":return c8(t);case"keypress":return t.which!==32?null:(iE=!0,rE);case"textInput":return e=t.data,e===rE&&iE?null:e;default:return null}}function Oz(e,t){if(vd)return e==="compositionend"||!qw&&u8(e,t)?(e=s8(),dg=Hw=zl=null,vd=!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=lE(n)}}function p8(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?p8(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function m8(){for(var e=window,t=Lg();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Lg(e.document)}return t}function Zw(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 Uz(e){var t=m8(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&p8(n.ownerDocument.documentElement,n)){if(r!==null&&Zw(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,l=Math.min(r.start,i);r=r.end===void 0?l:Math.min(r.end,i),!e.extend&&l>r&&(i=r,r=l,l=i),i=uE(n,l);var c=uE(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(),l>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,gd=null,vb=null,Gh=null,gb=!1;function cE(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;gb||gd==null||gd!==Lg(r)||(r=gd,"selectionStart"in r&&Zw(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}),Gh&&mp(Gh,r)||(Gh=r,r=jg(vb,"onSelect"),0_d||(e.current=Cb[_d],Cb[_d]=null,_d--)}function $r(e,t){_d++,Cb[_d]=e.current,e.current=t}var iu={},ao=du(iu),Ao=du(!1),cc=iu;function Bd(e,t){var n=e.type.contextTypes;if(!n)return iu;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},l;for(l in n)i[l]=t[l];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Oo(e){return e=e.childContextTypes,e!=null}function Hg(){jr(Ao),jr(ao)}function gE(e,t,n){if(ao.current!==iu)throw Error(Kt(168));$r(ao,t),$r(Ao,n)}function S8(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(Kt(108,zL(e)||"Unknown",i));return ti({},n,r)}function Wg(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||iu,cc=ao.current,$r(ao,e),$r(Ao,Ao.current),!0}function yE(e,t,n){var r=e.stateNode;if(!r)throw Error(Kt(169));n?(e=S8(e,t,cc),r.__reactInternalMemoizedMergedChildContext=e,jr(Ao),jr(ao),$r(ao,e)):jr(Ao),$r(Ao,n)}var Fs=null,Zy=!1,Nx=!1;function E8(e){Fs===null?Fs=[e]:Fs.push(e)}function eF(e){Zy=!0,E8(e)}function fu(){if(!Nx&&Fs!==null){Nx=!0;var e=0,t=Cr;try{var n=Fs;for(Cr=1;e>=c,i-=c,js=1<<32-ja(t)+i|n<H?(te=q,q=null):te=q.sibling;var Y=w(M,q,N[H],z);if(Y===null){q===null&&(q=te);break}e&&q&&Y.alternate===null&&t(M,q),R=l(Y,R,H),U===null?B=Y:U.sibling=Y,U=Y,q=te}if(H===N.length)return n(M,q),Xr&&Gu(M,H),B;if(q===null){for(;HH?(te=q,q=null):te=q.sibling;var le=w(M,q,Y.value,z);if(le===null){q===null&&(q=te);break}e&&q&&le.alternate===null&&t(M,q),R=l(le,R,H),U===null?B=le:U.sibling=le,U=le,q=te}if(Y.done)return n(M,q),Xr&&Gu(M,H),B;if(q===null){for(;!Y.done;H++,Y=N.next())Y=b(M,Y.value,z),Y!==null&&(R=l(Y,R,H),U===null?B=Y:U.sibling=Y,U=Y);return Xr&&Gu(M,H),B}for(q=r(M,q);!Y.done;H++,Y=N.next())Y=P(q,M,H,Y.value,z),Y!==null&&(e&&Y.alternate!==null&&q.delete(Y.key===null?H:Y.key),R=l(Y,R,H),U===null?B=Y:U.sibling=Y,U=Y);return e&&q.forEach(function(J){return t(M,J)}),Xr&&Gu(M,H),B}function O(M,R,N,z){if(typeof N=="object"&&N!==null&&N.type===md&&N.key===null&&(N=N.props.children),typeof N=="object"&&N!==null){switch(N.$$typeof){case _v:e:{for(var B=N.key,U=R;U!==null;){if(U.key===B){if(B=N.type,B===md){if(U.tag===7){n(M,U.sibling),R=i(U,N.props.children),R.return=M,M=R;break e}}else if(U.elementType===B||typeof B=="object"&&B!==null&&B.$$typeof===Al&&EE(B)===U.type){n(M,U.sibling),R=i(U,N.props),R.ref=wh(M,U,N),R.return=M,M=R;break e}n(M,U);break}else t(M,U);U=U.sibling}N.type===md?(R=lc(N.props.children,M.mode,z,N.key),R.return=M,M=R):(z=xg(N.type,N.key,N.props,null,M.mode,z),z.ref=wh(M,R,N),z.return=M,M=z)}return c(M);case pd:e:{for(U=N.key;R!==null;){if(R.key===U)if(R.tag===4&&R.stateNode.containerInfo===N.containerInfo&&R.stateNode.implementation===N.implementation){n(M,R.sibling),R=i(R,N.children||[]),R.return=M,M=R;break e}else{n(M,R);break}else t(M,R);R=R.sibling}R=Ux(N,M.mode,z),R.return=M,M=R}return c(M);case Al:return U=N._init,O(M,R,U(N._payload),z)}if(Dh(N))return I(M,R,N,z);if(gh(N))return A(M,R,N,z);Rv(M,N)}return typeof N=="string"&&N!==""||typeof N=="number"?(N=""+N,R!==null&&R.tag===6?(n(M,R.sibling),R=i(R,N),R.return=M,M=R):(n(M,R),R=Vx(N,M.mode,z),R.return=M,M=R),c(M)):n(M,R)}return O}var Ud=O8(!0),N8=O8(!1),Up={},ds=du(Up),xp=du(Up),_p=du(Up);function nc(e){if(e===Up)throw Error(Kt(174));return e}function iC(e,t){switch($r(_p,t),$r(xp,e),$r(ds,Up),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ab(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=ab(t,e)}jr(ds),$r(ds,t)}function jd(){jr(ds),jr(xp),jr(_p)}function D8(e){nc(_p.current);var t=nc(ds.current),n=ab(t,e.type);t!==n&&($r(xp,e),$r(ds,n))}function oC(e){xp.current===e&&(jr(ds),jr(xp))}var Jr=du(0);function Qg(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 Dx=[];function aC(){for(var e=0;en?n:4,e(!0);var r=Lx.transition;Lx.transition={};try{e(!1),t()}finally{Cr=n,Lx.transition=r}}function Y8(){return wa().memoizedState}function iF(e,t,n){var r=Yl(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Q8(e))J8(t,n);else if(n=I8(e,t,n,r),n!==null){var i=_o();Ka(n,e,r,i),eI(n,t,r)}}function oF(e,t,n){var r=Yl(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Q8(e))J8(t,i);else{var l=e.alternate;if(e.lanes===0&&(l===null||l.lanes===0)&&(l=t.lastRenderedReducer,l!==null))try{var c=t.lastRenderedState,o=l(c,n);if(i.hasEagerState=!0,i.eagerState=o,Ha(o,c)){var h=t.interleaved;h===null?(i.next=i,nC(t)):(i.next=h.next,h.next=i),t.interleaved=i;return}}catch{}finally{}n=I8(e,t,i,r),n!==null&&(i=_o(),Ka(n,e,r,i),eI(n,t,r))}}function Q8(e){var t=e.alternate;return e===ei||t!==null&&t===ei}function J8(e,t){qh=Jg=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function eI(e,t,n){if((n&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Uw(e,n)}}var ey={readContext:ba,useCallback:no,useContext:no,useEffect:no,useImperativeHandle:no,useInsertionEffect:no,useLayoutEffect:no,useMemo:no,useReducer:no,useRef:no,useState:no,useDebugValue:no,useDeferredValue:no,useTransition:no,useMutableSource:no,useSyncExternalStore:no,useId:no,unstable_isNewReconciler:!1},aF={readContext:ba,useCallback:function(e,t){return os().memoizedState=[e,t===void 0?null:t],e},useContext:ba,useEffect:TE,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,mg(4194308,4,W8.bind(null,t,e),n)},useLayoutEffect:function(e,t){return mg(4194308,4,e,t)},useInsertionEffect:function(e,t){return mg(4,2,e,t)},useMemo:function(e,t){var n=os();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=os();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=iF.bind(null,ei,e),[r.memoizedState,e]},useRef:function(e){var t=os();return e={current:e},t.memoizedState=e},useState:kE,useDebugValue:dC,useDeferredValue:function(e){return os().memoizedState=e},useTransition:function(){var e=kE(!1),t=e[0];return e=rF.bind(null,e[1]),os().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ei,i=os();if(Xr){if(n===void 0)throw Error(Kt(407));n=n()}else{if(n=t(),Bi===null)throw Error(Kt(349));(fc&30)!==0||F8(r,t,n)}i.memoizedState=n;var l={value:n,getSnapshot:t};return i.queue=l,TE(B8.bind(null,r,l,e),[e]),r.flags|=2048,Cp(9,$8.bind(null,r,l,n,t),void 0,null),n},useId:function(){var e=os(),t=Bi.identifierPrefix;if(Xr){var n=Ks,r=js;n=(r&~(1<<32-ja(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=bp++,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[as]=t,e[yp]=r,uI(e,t,!1,!1),t.stateNode=e;e:{switch(c=lb(n,r),n){case"dialog":Vr("cancel",e),Vr("close",e),i=r;break;case"iframe":case"object":case"embed":Vr("load",e),i=r;break;case"video":case"audio":for(i=0;iHd&&(t.flags|=128,r=!0,Ch(l,!1),t.lanes=4194304)}else{if(!r)if(e=Qg(c),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ch(l,!0),l.tail===null&&l.tailMode==="hidden"&&!c.alternate&&!Xr)return ro(t),null}else 2*pi()-l.renderingStartTime>Hd&&n!==1073741824&&(t.flags|=128,r=!0,Ch(l,!1),t.lanes=4194304);l.isBackwards?(c.sibling=t.child,t.child=c):(n=l.last,n!==null?n.sibling=c:t.child=c,l.last=c)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=pi(),t.sibling=null,n=Jr.current,$r(Jr,r?n&1|2:n&1),t):(ro(t),null);case 22:case 23:return gC(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(Wo&1073741824)!==0&&(ro(t),t.subtreeFlags&6&&(t.flags|=8192)):ro(t),null;case 24:return null;case 25:return null}throw Error(Kt(156,t.tag))}function pF(e,t){switch(Yw(t),t.tag){case 1:return Oo(t.type)&&Hg(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return jd(),jr(Ao),jr(ao),aC(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return oC(t),null;case 13:if(jr(Jr),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Kt(340));Vd()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return jr(Jr),null;case 4:return jd(),null;case 10:return tC(t.type._context),null;case 22:case 23:return gC(),null;case 24:return null;default:return null}}var Ov=!1,io=!1,mF=typeof WeakSet=="function"?WeakSet:Set,xn=null;function Sd(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 Db(e,t,n){try{n()}catch(r){oi(e,t,r)}}var LE=!1;function vF(e,t){if(yb=Vg,e=m8(),Zw(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,l=r.focusNode;r=r.focusOffset;try{n.nodeType,l.nodeType}catch{n=null;break e}var c=0,o=-1,h=-1,p=0,g=0,b=e,w=null;t:for(;;){for(var P;b!==n||i!==0&&b.nodeType!==3||(o=c+i),b!==l||r!==0&&b.nodeType!==3||(h=c+r),b.nodeType===3&&(c+=b.nodeValue.length),(P=b.firstChild)!==null;)w=b,b=P;for(;;){if(b===e)break t;if(w===n&&++p===i&&(o=c),w===l&&++g===r&&(h=c),(P=b.nextSibling)!==null)break;b=w,w=b.parentNode}b=P}n=o===-1||h===-1?null:{start:o,end:h}}else n=null}n=n||{start:0,end:0}}else n=null;for(xb={focusedElem:e,selectionRange:n},Vg=!1,xn=t;xn!==null;)if(t=xn,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,xn=e;else for(;xn!==null;){t=xn;try{var I=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(I!==null){var A=I.memoizedProps,O=I.memoizedState,M=t.stateNode,R=M.getSnapshotBeforeUpdate(t.elementType===t.type?A:Fa(t.type,A),O);M.__reactInternalSnapshotBeforeUpdate=R}break;case 3:var N=t.stateNode.containerInfo;N.nodeType===1?N.textContent="":N.nodeType===9&&N.documentElement&&N.removeChild(N.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Kt(163))}}catch(z){oi(t,t.return,z)}if(e=t.sibling,e!==null){e.return=t.return,xn=e;break}xn=t.return}return I=LE,LE=!1,I}function Zh(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 l=i.destroy;i.destroy=void 0,l!==void 0&&Db(t,n,l)}i=i.next}while(i!==r)}}function Qy(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 Lb(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 fI(e){var t=e.alternate;t!==null&&(e.alternate=null,fI(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[as],delete t[yp],delete t[wb],delete t[Qz],delete t[Jz])),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 hI(e){return e.tag===5||e.tag===3||e.tag===4}function zE(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||hI(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 zb(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=Kg));else if(r!==4&&(e=e.child,e!==null))for(zb(e,t,n),e=e.sibling;e!==null;)zb(e,t,n),e=e.sibling}function Fb(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(Fb(e,t,n),e=e.sibling;e!==null;)Fb(e,t,n),e=e.sibling}var Wi=null,$a=!1;function kl(e,t,n){for(n=n.child;n!==null;)pI(e,t,n),n=n.sibling}function pI(e,t,n){if(cs&&typeof cs.onCommitFiberUnmount=="function")try{cs.onCommitFiberUnmount(Ky,n)}catch{}switch(n.tag){case 5:io||Sd(n,t);case 6:var r=Wi,i=$a;Wi=null,kl(e,t,n),Wi=r,$a=i,Wi!==null&&($a?(e=Wi,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Wi.removeChild(n.stateNode));break;case 18:Wi!==null&&($a?(e=Wi,n=n.stateNode,e.nodeType===8?Ox(e.parentNode,n):e.nodeType===1&&Ox(e,n),hp(e)):Ox(Wi,n.stateNode));break;case 4:r=Wi,i=$a,Wi=n.stateNode.containerInfo,$a=!0,kl(e,t,n),Wi=r,$a=i;break;case 0:case 11:case 14:case 15:if(!io&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var l=i,c=l.destroy;l=l.tag,c!==void 0&&((l&2)!==0||(l&4)!==0)&&Db(n,t,c),i=i.next}while(i!==r)}kl(e,t,n);break;case 1:if(!io&&(Sd(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)}kl(e,t,n);break;case 21:kl(e,t,n);break;case 22:n.mode&1?(io=(r=io)||n.memoizedState!==null,kl(e,t,n),io=r):kl(e,t,n);break;default:kl(e,t,n)}}function FE(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new mF),t.forEach(function(r){var i=EF.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&=~l}if(r=i,r=pi()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*yF(r/1960))-r,10e?16:e,Fl===null)var r=!1;else{if(e=Fl,Fl=null,ry=0,(hr&6)!==0)throw Error(Kt(331));var i=hr;for(hr|=4,xn=e.current;xn!==null;){var l=xn,c=l.child;if((xn.flags&16)!==0){var o=l.deletions;if(o!==null){for(var h=0;hpi()-mC?sc(e,0):pC|=n),No(e,t)}function wI(e,t){t===0&&((e.mode&1)===0?t=1:(t=Sv,Sv<<=1,(Sv&130023424)===0&&(Sv=4194304)));var n=_o();e=Ys(e,t),e!==null&&($p(e,t,n),No(e,n))}function SF(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),wI(e,n)}function EF(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(Kt(314))}r!==null&&r.delete(t),wI(e,n)}var CI;CI=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ao.current)Ro=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return Ro=!1,fF(e,t,n);Ro=(e.flags&131072)!==0}else Ro=!1,Xr&&(t.flags&1048576)!==0&&k8(t,qg,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;vg(e,t),e=t.pendingProps;var i=Bd(t,ao.current);Nd(t,n),i=lC(null,t,r,e,i,n);var l=uC();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,Oo(r)?(l=!0,Wg(t)):l=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,rC(t),i.updater=Xy,t.stateNode=i,i._reactInternals=t,Pb(t,r,e,n),t=Rb(null,t,r,!0,l,n)):(t.tag=0,Xr&&l&&Xw(t),yo(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(vg(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=TF(r),e=Fa(r,e),i){case 0:t=Mb(null,t,r,e,n);break e;case 1:t=OE(null,t,r,e,n);break e;case 11:t=RE(null,t,r,e,n);break e;case 14:t=AE(null,t,r,Fa(r.type,e),n);break e}throw Error(Kt(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Fa(r,i),Mb(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Fa(r,i),OE(e,t,r,i,n);case 3:e:{if(aI(t),e===null)throw Error(Kt(387));r=t.pendingProps,l=t.memoizedState,i=l.element,M8(e,t),Yg(t,r,null,n);var c=t.memoizedState;if(r=c.element,l.isDehydrated)if(l={element:r,isDehydrated:!1,cache:c.cache,pendingSuspenseBoundaries:c.pendingSuspenseBoundaries,transitions:c.transitions},t.updateQueue.baseState=l,t.memoizedState=l,t.flags&256){i=Kd(Error(Kt(423)),t),t=NE(e,t,r,n,i);break e}else if(r!==i){i=Kd(Error(Kt(424)),t),t=NE(e,t,r,n,i);break e}else for(Go=ql(t.stateNode.containerInfo.firstChild),Zo=t,Xr=!0,Va=null,n=N8(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Vd(),r===i){t=Qs(e,t,n);break e}yo(e,t,r,n)}t=t.child}return t;case 5:return D8(t),e===null&&Eb(t),r=t.type,i=t.pendingProps,l=e!==null?e.memoizedProps:null,c=i.children,_b(r,i)?c=null:l!==null&&_b(r,l)&&(t.flags|=32),oI(e,t),yo(e,t,c,n),t.child;case 6:return e===null&&Eb(t),null;case 13:return sI(e,t,n);case 4:return iC(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ud(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:Fa(r,i),RE(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,l=t.memoizedProps,c=i.value,$r(Zg,r._currentValue),r._currentValue=c,l!==null)if(Ha(l.value,c)){if(l.children===i.children&&!Ao.current){t=Qs(e,t,n);break e}}else for(l=t.child,l!==null&&(l.return=t);l!==null;){var o=l.dependencies;if(o!==null){c=l.child;for(var h=o.firstContext;h!==null;){if(h.context===r){if(l.tag===1){h=Ws(-1,n&-n),h.tag=2;var p=l.updateQueue;if(p!==null){p=p.shared;var g=p.pending;g===null?h.next=h:(h.next=g.next,g.next=h),p.pending=h}}l.lanes|=n,h=l.alternate,h!==null&&(h.lanes|=n),kb(l.return,n,t),o.lanes|=n;break}h=h.next}}else if(l.tag===10)c=l.type===t.type?null:l.child;else if(l.tag===18){if(c=l.return,c===null)throw Error(Kt(341));c.lanes|=n,o=c.alternate,o!==null&&(o.lanes|=n),kb(c,n,t),c=l.sibling}else c=l.child;if(c!==null)c.return=l;else for(c=l;c!==null;){if(c===t){c=null;break}if(l=c.sibling,l!==null){l.return=c.return,c=l;break}c=c.return}l=c}yo(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Nd(t,n),i=ba(i),r=r(i),t.flags|=1,yo(e,t,r,n),t.child;case 14:return r=t.type,i=Fa(r,t.pendingProps),i=Fa(r.type,i),AE(e,t,r,i,n);case 15:return rI(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Fa(r,i),vg(e,t),t.tag=1,Oo(r)?(e=!0,Wg(t)):e=!1,Nd(t,n),A8(t,r,i),Pb(t,r,i,n),Rb(null,t,r,!0,e,n);case 19:return lI(e,t,n);case 22:return iI(e,t,n)}throw Error(Kt(156,t.tag))};function SI(e,t){return XP(e,t)}function kF(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 xa(e,t,n,r){return new kF(e,t,n,r)}function xC(e){return e=e.prototype,!(!e||!e.isReactComponent)}function TF(e){if(typeof e=="function")return xC(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Fw)return 11;if(e===$w)return 14}return 2}function Ql(e,t){var n=e.alternate;return n===null?(n=xa(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 xg(e,t,n,r,i,l){var c=2;if(r=e,typeof e=="function")xC(e)&&(c=1);else if(typeof e=="string")c=5;else e:switch(e){case md:return lc(n.children,i,l,t);case zw:c=8,i|=8;break;case Q_:return e=xa(12,n,t,i|2),e.elementType=Q_,e.lanes=l,e;case J_:return e=xa(13,n,t,i),e.elementType=J_,e.lanes=l,e;case eb:return e=xa(19,n,t,i),e.elementType=eb,e.lanes=l,e;case OP:return e0(n,i,l,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case RP:c=10;break e;case AP:c=9;break e;case Fw:c=11;break e;case $w:c=14;break e;case Al:c=16,r=null;break e}throw Error(Kt(130,e==null?e:typeof e,""))}return t=xa(c,n,t,i),t.elementType=e,t.type=r,t.lanes=l,t}function lc(e,t,n,r){return e=xa(7,e,r,t),e.lanes=n,e}function e0(e,t,n,r){return e=xa(22,e,r,t),e.elementType=OP,e.lanes=n,e.stateNode={isHidden:!1},e}function Vx(e,t,n){return e=xa(6,e,null,t),e.lanes=n,e}function Ux(e,t,n){return t=xa(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function PF(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=wx(0),this.expirationTimes=wx(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wx(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function _C(e,t,n,r,i,l,c,o,h){return e=new PF(e,t,n,o,h),t===1?(t=1,l===!0&&(t|=8)):t=0,l=xa(3,null,null,t),e.current=l,l.stateNode=e,l.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},rC(l),e}function IF(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=ea})(uu);const mc=Iw(uu.exports),NF=xP({__proto__:null,default:mc},[uu.exports]);var WE=uu.exports;X_.createRoot=WE.createRoot,X_.hydrateRoot=WE.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 Ep(){return Ep=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function LF(){return Math.random().toString(36).substr(2,8)}function qE(e,t){return{usr:e.state,key:e.key,idx:t}}function jb(e,t,n,r){return n===void 0&&(n=null),Ep({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?af(t):t,{state:n,key:t&&t.key||r||LF()})}function ay(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 af(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 zF(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:l=!1}=r,c=i.history,o=$l.Pop,h=null,p=g();p==null&&(p=0,c.replaceState(Ep({},c.state,{idx:p}),""));function g(){return(c.state||{idx:null}).idx}function b(){o=$l.Pop;let O=g(),M=O==null?null:O-p;p=O,h&&h({action:o,location:A.location,delta:M})}function w(O,M){o=$l.Push;let R=jb(A.location,O,M);n&&n(R,O),p=g()+1;let N=qE(R,p),z=A.createHref(R);try{c.pushState(N,"",z)}catch{i.location.assign(z)}l&&h&&h({action:o,location:A.location,delta:1})}function P(O,M){o=$l.Replace;let R=jb(A.location,O,M);n&&n(R,O),p=g();let N=qE(R,p),z=A.createHref(R);c.replaceState(N,"",z),l&&h&&h({action:o,location:A.location,delta:0})}function I(O){let M=i.location.origin!=="null"?i.location.origin:i.location.href,R=typeof O=="string"?O:ay(O);return Si(M,"No window.location.(origin|href) available to create URL for href: "+R),new URL(R,M)}let A={get action(){return o},get location(){return e(i,c)},listen(O){if(h)throw new Error("A history only accepts one active listener");return i.addEventListener(GE,b),h=O,()=>{i.removeEventListener(GE,b),h=null}},createHref(O){return t(i,O)},createURL:I,encodeLocation(O){let M=I(O);return{pathname:M.pathname,search:M.search,hash:M.hash}},push:w,replace:P,go(O){return c.go(O)}};return A}var ZE;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(ZE||(ZE={}));function FF(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?af(t):t,i=MI(r.pathname||"/",n);if(i==null)return null;let l=PI(e);$F(l);let c=null;for(let o=0;c==null&&o{let h={relativePath:o===void 0?l.path||"":o,caseSensitive:l.caseSensitive===!0,childrenIndex:c,route:l};h.relativePath.startsWith("/")&&(Si(h.relativePath.startsWith(r),'Absolute route path "'+h.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),h.relativePath=h.relativePath.slice(r.length));let p=Jl([r,h.relativePath]),g=n.concat(h);l.children&&l.children.length>0&&(Si(l.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+p+'".')),PI(l.children,t,g,p)),!(l.path==null&&!l.index)&&t.push({path:p,score:WF(p,l.index),routesMeta:g})};return e.forEach((l,c)=>{var o;if(l.path===""||!((o=l.path)!=null&&o.includes("?")))i(l,c);else for(let h of II(l.path))i(l,c,h)}),t}function II(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),l=n.replace(/\?$/,"");if(r.length===0)return i?[l,""]:[l];let c=II(r.join("/")),o=[];return o.push(...c.map(h=>h===""?l:[l,h].join("/"))),i&&o.push(...c),o.map(h=>e.startsWith("/")&&h===""?"/":h)}function $F(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:GF(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const BF=/^:\w+$/,VF=3,UF=2,jF=1,KF=10,HF=-2,XE=e=>e==="*";function WF(e,t){let n=e.split("/"),r=n.length;return n.some(XE)&&(r+=HF),t&&(r+=UF),n.filter(i=>!XE(i)).reduce((i,l)=>i+(BF.test(l)?VF:l===""?jF:KF),r)}function GF(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 qF(e,t){let{routesMeta:n}=e,r={},i="/",l=[];for(let c=0;c{if(g==="*"){let w=o[b]||"";c=l.slice(0,l.length-w.length).replace(/(.)\/+$/,"$1")}return p[g]=QF(o[b]||"",g),p},{}),pathname:l,pathnameBase:c,pattern:e}}function XF(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),SC(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 YF(e){try{return decodeURI(e)}catch(t){return SC(!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 QF(e,t){try{return decodeURIComponent(e)}catch(n){return SC(!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 MI(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 SC(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function JF(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?af(e):e;return{pathname:n?n.startsWith("/")?n:e$(n,t):t,search:n$(r),hash:r$(i)}}function e$(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 jx(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 RI(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function AI(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=af(e):(i=Ep({},e),Si(!i.pathname||!i.pathname.includes("?"),jx("?","pathname","search",i)),Si(!i.pathname||!i.pathname.includes("#"),jx("#","pathname","hash",i)),Si(!i.search||!i.search.includes("#"),jx("#","search","hash",i)));let l=e===""||i.pathname==="",c=l?"/":i.pathname,o;if(r||c==null)o=n;else{let b=t.length-1;if(c.startsWith("..")){let w=c.split("/");for(;w[0]==="..";)w.shift(),b-=1;i.pathname=w.join("/")}o=b>=0?t[b]:"/"}let h=JF(i,o),p=c&&c!=="/"&&c.endsWith("/"),g=(l||c===".")&&n.endsWith("/");return!h.pathname.endsWith("/")&&(p||g)&&(h.pathname+="/"),h}const Jl=e=>e.join("/").replace(/\/\/+/g,"/"),t$=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),n$=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,r$=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function i$(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const o$=["post","put","patch","delete"];[...o$];var o0={exports:{}},a0={};/** * @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 a$=C.exports,s$=Symbol.for("react.element"),l$=Symbol.for("react.fragment"),u$=Object.prototype.hasOwnProperty,c$=a$.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,d$={key:!0,ref:!0,__self:!0,__source:!0};function OI(e,t,n){var r,i={},l=null,c=null;n!==void 0&&(l=""+n),t.key!==void 0&&(l=""+t.key),t.ref!==void 0&&(c=t.ref);for(r in t)u$.call(t,r)&&!d$.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:s$,type:e,key:l,ref:c,props:i,_owner:c$.current}}a0.Fragment=l$;a0.jsx=OI;a0.jsxs=OI;(function(e){e.exports=a0})(o0);const $n=o0.exports.Fragment,E=o0.exports.jsx,Qe=o0.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 Kb(){return Kb=Object.assign?Object.assign.bind():function(e){for(var t=1;t{i.value=r,i.getSnapshot=t,Kx(i)&&l({inst:i})},[e,r,t]),m$(()=>(Kx(i)&&l({inst:i}),e(()=>{Kx(i)&&l({inst:i})})),[e]),g$(r),r}function Kx(e){const t=e.getSnapshot,n=e.value;try{const r=t();return!h$(n,r)}catch{return!0}}function x$(e,t,n){return t()}const _$=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",b$=!_$,w$=b$?x$:y$;"useSyncExternalStore"in Dg&&(e=>e.useSyncExternalStore)(Dg);const NI=C.exports.createContext(null),EC=C.exports.createContext(null),s0=C.exports.createContext(null),l0=C.exports.createContext(null),sf=C.exports.createContext({outlet:null,matches:[]}),DI=C.exports.createContext(null);function C$(e,t){let{relative:n}=t===void 0?{}:t;lf()||Si(!1);let{basename:r,navigator:i}=C.exports.useContext(s0),{hash:l,pathname:c,search:o}=LI(e,{relative:n}),h=c;return r!=="/"&&(h=c==="/"?r:Jl([r,c])),i.createHref({pathname:h,search:o,hash:l})}function lf(){return C.exports.useContext(l0)!=null}function jp(){return lf()||Si(!1),C.exports.useContext(l0).location}function kC(){lf()||Si(!1);let{basename:e,navigator:t}=C.exports.useContext(s0),{matches:n}=C.exports.useContext(sf),{pathname:r}=jp(),i=JSON.stringify(RI(n).map(o=>o.pathnameBase)),l=C.exports.useRef(!1);return C.exports.useEffect(()=>{l.current=!0}),C.exports.useCallback(function(o,h){if(h===void 0&&(h={}),!l.current)return;if(typeof o=="number"){t.go(o);return}let p=AI(o,JSON.parse(i),r,h.relative==="path");e!=="/"&&(p.pathname=p.pathname==="/"?e:Jl([e,p.pathname])),(h.replace?t.replace:t.push)(p,h.state,h)},[e,t,i,r])}function LI(e,t){let{relative:n}=t===void 0?{}:t,{matches:r}=C.exports.useContext(sf),{pathname:i}=jp(),l=JSON.stringify(RI(r).map(c=>c.pathnameBase));return C.exports.useMemo(()=>AI(e,JSON.parse(l),i,n==="path"),[e,l,i,n])}function S$(e,t){lf()||Si(!1);let{navigator:n}=C.exports.useContext(s0),r=C.exports.useContext(EC),{matches:i}=C.exports.useContext(sf),l=i[i.length-1],c=l?l.params:{};l&&l.pathname;let o=l?l.pathnameBase:"/";l&&l.route;let h=jp(),p;if(t){var g;let A=typeof t=="string"?af(t):t;o==="/"||((g=A.pathname)==null?void 0:g.startsWith(o))||Si(!1),p=A}else p=h;let b=p.pathname||"/",w=o==="/"?b:b.slice(o.length)||"/",P=FF(e,{pathname:w}),I=P$(P&&P.map(A=>Object.assign({},A,{params:Object.assign({},c,A.params),pathname:Jl([o,n.encodeLocation?n.encodeLocation(A.pathname).pathname:A.pathname]),pathnameBase:A.pathnameBase==="/"?o:Jl([o,n.encodeLocation?n.encodeLocation(A.pathnameBase).pathname:A.pathnameBase])})),i,r||void 0);return t&&I?E(l0.Provider,{value:{location:Kb({pathname:"/",search:"",hash:"",state:null,key:"default"},p),navigationType:$l.Pop},children:I}):I}function E$(){let e=A$(),t=i$(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null;return Qe($n,{children:[E("h2",{children:"Unexpected Application Error!"}),E("h3",{style:{fontStyle:"italic"},children:t}),n?E("pre",{style:{padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},children:n}):null,null]})}class k$ 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?E(sf.Provider,{value:this.props.routeContext,children:E(DI.Provider,{value:this.state.error,children:this.props.component})}):this.props.children}}function T$(e){let{routeContext:t,match:n,children:r}=e,i=C.exports.useContext(NI);return i&&i.static&&i.staticContext&&n.route.errorElement&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),E(sf.Provider,{value:t,children:r})}function P$(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 l=r.findIndex(c=>c.route.id&&(i==null?void 0:i[c.route.id]));l>=0||Si(!1),r=r.slice(0,Math.min(r.length,l+1))}return r.reduceRight((l,c,o)=>{let h=c.route.id?i==null?void 0:i[c.route.id]:null,p=n?c.route.errorElement||E(E$,{}):null,g=t.concat(r.slice(0,o+1)),b=()=>E(T$,{match:c,routeContext:{outlet:l,matches:g},children:h?p:c.route.element!==void 0?c.route.element:l});return n&&(c.route.errorElement||o===0)?E(k$,{location:n.location,component:p,error:h,children:b(),routeContext:{outlet:null,matches:g}}):b()},null)}var YE;(function(e){e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator"})(YE||(YE={}));var sy;(function(e){e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator"})(sy||(sy={}));function I$(e){let t=C.exports.useContext(EC);return t||Si(!1),t}function M$(e){let t=C.exports.useContext(sf);return t||Si(!1),t}function R$(e){let t=M$(),n=t.matches[t.matches.length-1];return n.route.id||Si(!1),n.route.id}function A$(){var e;let t=C.exports.useContext(DI),n=I$(sy.UseRouteError),r=R$(sy.UseRouteError);return t||((e=n.errors)==null?void 0:e[r])}function u0(e){let{to:t,replace:n,state:r,relative:i}=e;lf()||Si(!1);let l=C.exports.useContext(EC),c=kC();return C.exports.useEffect(()=>{l&&l.navigation.state!=="idle"||c(t,{replace:n,state:r,relative:i})}),null}function Fh(e){Si(!1)}function O$(e){let{basename:t="/",children:n=null,location:r,navigationType:i=$l.Pop,navigator:l,static:c=!1}=e;lf()&&Si(!1);let o=t.replace(/^\/*/,"/"),h=C.exports.useMemo(()=>({basename:o,navigator:l,static:c}),[o,l,c]);typeof r=="string"&&(r=af(r));let{pathname:p="/",search:g="",hash:b="",state:w=null,key:P="default"}=r,I=C.exports.useMemo(()=>{let A=MI(p,o);return A==null?null:{pathname:A,search:g,hash:b,state:w,key:P}},[o,p,g,b,w,P]);return I==null?null:E(s0.Provider,{value:h,children:E(l0.Provider,{children:n,value:{location:I,navigationType:i}})})}function N$(e){let{children:t,location:n}=e,r=C.exports.useContext(NI),i=r&&!t?r.router.routes:Hb(t);return S$(i,n)}var QE;(function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"})(QE||(QE={}));new Promise(()=>{});function Hb(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,Hb(r.props.children,t));return}r.type!==Fh&&Si(!1),!r.props.index||!r.props.children||Si(!1);let l=[...t,i],c={id:r.props.id||l.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=Hb(r.props.children,l)),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 D$(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,l;for(l=0;l=0)&&(n[i]=e[i]);return n}function L$(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function z$(e,t){return e.button===0&&(!t||t==="_self")&&!L$(e)}function Wb(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 F$(e,t){let n=Wb(e);if(t)for(let r of t.keys())n.has(r)||t.getAll(r).forEach(i=>{n.append(r,i)});return n}const $$=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"];function B$(e){let{basename:t,children:n,window:r}=e,i=C.exports.useRef();i.current==null&&(i.current=DF({window:r,v5Compat:!0}));let l=i.current,[c,o]=C.exports.useState({action:l.action,location:l.location});return C.exports.useLayoutEffect(()=>l.listen(o),[l]),E(O$,{basename:t,children:n,location:c.location,navigationType:c.action,navigator:l})}const V$=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Gb=C.exports.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:l,replace:c,state:o,target:h,to:p,preventScrollReset:g}=t,b=D$(t,$$),w,P=!1;if(V$&&typeof p=="string"&&/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i.test(p)){w=p;let M=new URL(window.location.href),R=p.startsWith("//")?new URL(M.protocol+p):new URL(p);R.origin===M.origin?p=R.pathname+R.search+R.hash:P=!0}let I=C$(p,{relative:i}),A=U$(p,{replace:c,state:o,target:h,preventScrollReset:g,relative:i});function O(M){r&&r(M),M.defaultPrevented||A(M)}return E("a",{...b,href:w||I,onClick:P||l?r:O,ref:n,target:h})});var JE;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmitImpl="useSubmitImpl",e.UseFetcher="useFetcher"})(JE||(JE={}));var e6;(function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(e6||(e6={}));function U$(e,t){let{target:n,replace:r,state:i,preventScrollReset:l,relative:c}=t===void 0?{}:t,o=kC(),h=jp(),p=LI(e,{relative:c});return C.exports.useCallback(g=>{if(z$(g,n)){g.preventDefault();let b=r!==void 0?r:ay(h)===ay(p);o(e,{replace:b,state:i,preventScrollReset:l,relative:c})}},[h,o,p,r,i,n,e,l,c])}function j$(e){let t=C.exports.useRef(Wb(e)),n=C.exports.useRef(!1),r=jp(),i=C.exports.useMemo(()=>F$(r.search,n.current?null:t.current),[r.search]),l=kC(),c=C.exports.useCallback((o,h)=>{const p=Wb(typeof o=="function"?o(i):o);n.current=!0,l("?"+p,h)},[l,i]);return[i,c]}let Hx=0,t6=[];function K$(){return Hx+=1,()=>{if(Hx-=1,Hx===0){let e=t6;t6=[];for(let t of e)t()}}}let Lv=Symbol(),H$=(e,t,n,r)=>{let i={...e};i.set=(...c)=>{e[Lv]=t,e.set(...c),delete e[Lv]},e.setKey&&(i.setKey=(...c)=>{e[Lv]=t,e.setKey(...c),delete e[Lv]});let l=n(i,...r);if(l instanceof Promise){let c=K$();return l.finally(c)}return l},W$=(e,t,n)=>(...r)=>H$(e,t,n,r),go=[],uf=(e,t)=>{let n,r=[],i={lc:0,l:t||0,value:e,set(l){i.value=l,i.notify()},get(){return i.lc||i.listen(()=>{})(),i.value},notify(l){n=r;let c=!go.length;for(let o=0;o{r===n&&(r=r.slice());let o=r.indexOf(l);~o&&(r.splice(o,2),i.lc--)}},subscribe(l,c){let o=i.listen(l,c);return l(i.value),o},off(){}};return i};function G$(e,t,n){let r=new Set([...t,void 0]);return e.listen((i,l)=>{r.has(l)&&n(i,l)})}var c0={exports:{}},zI={};/** * @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 Wd=C.exports;function q$(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Z$=typeof Object.is=="function"?Object.is:q$,X$=Wd.useState,Y$=Wd.useEffect,Q$=Wd.useLayoutEffect,J$=Wd.useDebugValue;function eB(e,t){var n=t(),r=X$({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return Q$(function(){i.value=n,i.getSnapshot=t,Wx(i)&&l({inst:i})},[e,n,t]),Y$(function(){return Wx(i)&&l({inst:i}),e(function(){Wx(i)&&l({inst:i})})},[e]),J$(n),n}function Wx(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Z$(e,n)}catch{return!0}}function tB(e,t){return t()}var nB=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?tB:eB;zI.useSyncExternalStore=Wd.useSyncExternalStore!==void 0?Wd.useSyncExternalStore:nB;(function(e){e.exports=zI})(c0);function ou(e,t={}){let n=C.exports.useCallback(i=>t.keys?G$(e,t.keys,i):e.listen(i),[t.keys,e]),r=e.get.bind(e);return c0.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 On(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function oB(e,t){if(t&&(sn(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return On(e)}function ui(e){var t=iB();return function(){var r=ly(e),i;if(t){var l=ly(this).constructor;i=Reflect.construct(r,arguments,l)}else i=r.apply(this,arguments);return oB(this,i)}}var $I={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(Xi(r)):TC.exports.isFragment(r)&&r.props?n=n.concat(Xi(r.props.children,t)):n.push(r))}),n}var r6={};function dB(e,t){}function fB(e,t,n){!t&&!r6[n]&&(e(!1,n),r6[n]=!0)}function Nr(e,t){fB(dB,e,t)}function i6(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 ve(e){for(var t=1;t0},e.prototype.connect_=function(){!Zb||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),yB?(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(){!Zb||!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=gB.some(function(l){return!!~r.indexOf(l)});i&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),jI=function(e,t){for(var n=0,r=Object.keys(t);n"u"||!(Element instanceof Object))){if(!(t instanceof Gd(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new TB(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 Gd(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 PB(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}(),HI=typeof WeakMap<"u"?new WeakMap:new UI,WI=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=xB.getInstance(),r=new IB(t,n,this);HI.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){WI.prototype[e]=function(){var t;return(t=HI.get(this))[e].apply(t,arguments)}});var GI=function(){return typeof cy.ResizeObserver<"u"?cy.ResizeObserver:WI}(),Bl=new Map;function MB(e){e.forEach(function(t){var n,r=t.target;(n=Bl.get(r))===null||n===void 0||n.forEach(function(i){return i(r)})})}var qI=new GI(MB);function RB(e,t){Bl.has(e)||(Bl.set(e,new Set),qI.observe(e)),Bl.get(e).add(t)}function AB(e,t){Bl.has(e)&&(Bl.get(e).delete(t),Bl.get(e).size||(qI.unobserve(e),Bl.delete(e)))}var OB=function(e){li(n,e);var t=ui(n);function n(){return Kr(this,n),t.apply(this,arguments)}return Hr(n,[{key:"render",value:function(){return this.props.children}}]),n}(C.exports.Component),Xb=C.exports.createContext(null);function NB(e){var t=e.children,n=e.onBatchResize,r=C.exports.useRef(0),i=C.exports.useRef([]),l=C.exports.useContext(Xb),c=C.exports.useCallback(function(o,h,p){r.current+=1;var g=r.current;i.current.push({size:o,element:h,data:p}),Promise.resolve().then(function(){g===r.current&&(n==null||n(i.current),i.current=[])}),l==null||l(o,h,p)},[n,l]);return E(Xb.Provider,{value:c,children:t})}function DB(e,t){var n=e.children,r=e.disabled,i=C.exports.useRef(null),l=C.exports.useRef(null),c=C.exports.useContext(Xb),o=typeof n=="function",h=o?n(i):n,p=C.exports.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),g=!o&&C.exports.isValidElement(h)&&Sc(h),b=g?h.ref:null,w=C.exports.useMemo(function(){return Lo(b,i)},[b,i]),P=function(){return kp(i.current)||kp(l.current)};C.exports.useImperativeHandle(t,function(){return P()});var I=C.exports.useRef(e);I.current=e;var A=C.exports.useCallback(function(O){var M=I.current,R=M.onResize,N=M.data,z=O.getBoundingClientRect(),B=z.width,U=z.height,q=O.offsetWidth,H=O.offsetHeight,te=Math.floor(B),Y=Math.floor(U);if(p.current.width!==te||p.current.height!==Y||p.current.offsetWidth!==q||p.current.offsetHeight!==H){var le={width:te,height:Y,offsetWidth:q,offsetHeight:H};p.current=le;var J=q===Math.round(B)?B:q,Z=H===Math.round(U)?U:H,Q=ve(ve({},le),{},{offsetWidth:J,offsetHeight:Z});c==null||c(Q,O,N),R&&Promise.resolve().then(function(){R(Q,O)})}},[]);return C.exports.useEffect(function(){var O=P();return O&&!r&&RB(O,A),function(){return AB(O,A)}},[i.current,r]),E(OB,{ref:l,children:g?C.exports.cloneElement(h,{ref:w}):h})}var LB=C.exports.forwardRef(DB),zB="rc-observer-key";function FB(e,t){var n=e.children,r=typeof n=="function"?[n]:Xi(n);return r.map(function(i,l){var c=(i==null?void 0:i.key)||"".concat(zB,"-").concat(l);return C.exports.createElement(LB,{...e,key:c,ref:l===0?t:void 0},i)})}var ol=C.exports.forwardRef(FB);ol.Collection=NB;function mi(e,t){var n=ve({},e);return Array.isArray(t)&&t.forEach(function(r){delete n[r]}),n}var $B=C.exports.createContext({});const RC=$B;function BB(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,l;for(l=0;l=0)&&(n[i]=e[i]);return n}function In(e,t){if(e==null)return{};var n=BB(e,t),r,i;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&(!Object.prototype.propertyIsEnumerable.call(e,r)||(n[r]=e[r]))}return n}function Yb(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0;--re){var de=this.tryEntries[re],oe=de.completion;if(de.tryLoc==="root")return ge("end");if(de.tryLoc<=this.prev){var ye=n.call(de,"catchLoc"),Re=n.call(de,"finallyLoc");if(ye&&Re){if(this.prev=0;--ge){var re=this.tryEntries[ge];if(re.tryLoc<=this.prev&&n.call(re,"finallyLoc")&&this.prev=0;--Q){var ge=this.tryEntries[Q];if(ge.finallyLoc===Z)return this.complete(ge.completion,ge.afterLoc),H(ge),b}},catch:function(Z){for(var Q=this.tryEntries.length-1;Q>=0;--Q){var ge=this.tryEntries[Q];if(ge.tryLoc===Z){var re=ge.completion;if(re.type==="throw"){var de=re.arg;H(ge)}return de}}throw new Error("illegal catch attempt")},delegateYield:function(Z,Q,ge){return this.delegate={iterator:Y(Z),resultName:Q,nextLoc:ge},this.method==="next"&&(this.arg=void 0),b}},e}function a6(e,t,n,r,i,l,c){try{var o=e[l](c),h=o.value}catch(p){n(p);return}o.done?t(h):Promise.resolve(h).then(r,i)}function Ec(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var l=e.apply(t,n);function c(h){a6(l,r,i,c,o,"next",h)}function o(h){a6(l,r,i,c,o,"throw",h)}c(void 0)})}}function ic(){return ic=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 _g(e,t,n){return KB()?_g=Reflect.construct.bind():_g=function(i,l,c){var o=[null];o.push.apply(o,l);var h=Function.bind.apply(i,o),p=new h;return c&&Tp(p,c.prototype),p},_g.apply(null,arguments)}function HB(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function e2(e){var t=typeof Map=="function"?new Map:void 0;return e2=function(r){if(r===null||!HB(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 _g(r,arguments,Jb(this).constructor)}return i.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Tp(i,r)},e2(e)}var WB=/%[sdj%]/g,GB=function(){};typeof process<"u"&&process.env;function t2(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 qo(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=l)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 qB(e){return e==="string"||e==="url"||e==="hex"||e==="email"||e==="date"||e==="pattern"}function Ri(e,t){return!!(e==null||t==="array"&&Array.isArray(e)&&!e.length||qB(t)&&typeof e=="string"&&!e)}function ZB(e,t,n){var r=[],i=0,l=e.length;function c(o){r.push.apply(r,o||[]),i++,i===l&&n(r)}e.forEach(function(o){t(o,c)})}function s6(e,t,n){var r=0,i=e.length;function l(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},$h={integer:function(t){return $h.number(t)&&parseInt(t,10)===t},float:function(t){return $h.number(t)&&!$h.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"&&!$h.array(t)},method:function(t){return typeof t=="function"},email:function(t){return typeof t=="string"&&t.length<=320&&!!t.match(d6.email)},url:function(t){return typeof t=="string"&&t.length<=2048&&!!t.match(tV())},hex:function(t){return typeof t=="string"&&!!t.match(d6.hex)}},nV=function(t,n,r,i,l){if(t.required&&n===void 0){XI(t,n,r,i,l);return}var c=["integer","float","array","regexp","object","method","email","number","date","url","hex"],o=t.type;c.indexOf(o)>-1?$h[o](n)||i.push(qo(l.messages.types[o],t.fullField,t.type)):o&&typeof n!==t.type&&i.push(qo(l.messages.types[o],t.fullField,t.type))},rV=function(t,n,r,i,l){var c=typeof t.len=="number",o=typeof t.min=="number",h=typeof t.max=="number",p=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,g=n,b=null,w=typeof n=="number",P=typeof n=="string",I=Array.isArray(n);if(w?b="number":P?b="string":I&&(b="array"),!b)return!1;I&&(g=n.length),P&&(g=n.replace(p,"_").length),c?g!==t.len&&i.push(qo(l.messages[b].len,t.fullField,t.len)):o&&!h&&gt.max?i.push(qo(l.messages[b].max,t.fullField,t.max)):o&&h&&(gt.max)&&i.push(qo(l.messages[b].range,t.fullField,t.min,t.max))},ad="enum",iV=function(t,n,r,i,l){t[ad]=Array.isArray(t[ad])?t[ad]:[],t[ad].indexOf(n)===-1&&i.push(qo(l.messages[ad],t.fullField,t[ad].join(", ")))},oV=function(t,n,r,i,l){if(t.pattern){if(t.pattern instanceof RegExp)t.pattern.lastIndex=0,t.pattern.test(n)||i.push(qo(l.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(qo(l.messages.pattern.mismatch,t.fullField,n,t.pattern))}}},rr={required:XI,whitespace:eV,type:nV,range:rV,enum:iV,pattern:oV},aV=function(t,n,r,i,l){var c=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(Ri(n,"string")&&!t.required)return r();rr.required(t,n,i,c,l,"string"),Ri(n,"string")||(rr.type(t,n,i,c,l),rr.range(t,n,i,c,l),rr.pattern(t,n,i,c,l),t.whitespace===!0&&rr.whitespace(t,n,i,c,l))}r(c)},sV=function(t,n,r,i,l){var c=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(Ri(n)&&!t.required)return r();rr.required(t,n,i,c,l),n!==void 0&&rr.type(t,n,i,c,l)}r(c)},lV=function(t,n,r,i,l){var c=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(n===""&&(n=void 0),Ri(n)&&!t.required)return r();rr.required(t,n,i,c,l),n!==void 0&&(rr.type(t,n,i,c,l),rr.range(t,n,i,c,l))}r(c)},uV=function(t,n,r,i,l){var c=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(Ri(n)&&!t.required)return r();rr.required(t,n,i,c,l),n!==void 0&&rr.type(t,n,i,c,l)}r(c)},cV=function(t,n,r,i,l){var c=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(Ri(n)&&!t.required)return r();rr.required(t,n,i,c,l),Ri(n)||rr.type(t,n,i,c,l)}r(c)},dV=function(t,n,r,i,l){var c=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(Ri(n)&&!t.required)return r();rr.required(t,n,i,c,l),n!==void 0&&(rr.type(t,n,i,c,l),rr.range(t,n,i,c,l))}r(c)},fV=function(t,n,r,i,l){var c=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(Ri(n)&&!t.required)return r();rr.required(t,n,i,c,l),n!==void 0&&(rr.type(t,n,i,c,l),rr.range(t,n,i,c,l))}r(c)},hV=function(t,n,r,i,l){var c=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(n==null&&!t.required)return r();rr.required(t,n,i,c,l,"array"),n!=null&&(rr.type(t,n,i,c,l),rr.range(t,n,i,c,l))}r(c)},pV=function(t,n,r,i,l){var c=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(Ri(n)&&!t.required)return r();rr.required(t,n,i,c,l),n!==void 0&&rr.type(t,n,i,c,l)}r(c)},mV="enum",vV=function(t,n,r,i,l){var c=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(Ri(n)&&!t.required)return r();rr.required(t,n,i,c,l),n!==void 0&&rr[mV](t,n,i,c,l)}r(c)},gV=function(t,n,r,i,l){var c=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(Ri(n,"string")&&!t.required)return r();rr.required(t,n,i,c,l),Ri(n,"string")||rr.pattern(t,n,i,c,l)}r(c)},yV=function(t,n,r,i,l){var c=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(Ri(n,"date")&&!t.required)return r();if(rr.required(t,n,i,c,l),!Ri(n,"date")){var h;n instanceof Date?h=n:h=new Date(n),rr.type(t,h,i,c,l),h&&rr.range(t,h.getTime(),i,c,l)}}r(c)},xV=function(t,n,r,i,l){var c=[],o=Array.isArray(n)?"array":typeof n;rr.required(t,n,i,c,l,o),r(c)},Gx=function(t,n,r,i,l){var c=t.type,o=[],h=t.required||!t.required&&i.hasOwnProperty(t.field);if(h){if(Ri(n,c)&&!t.required)return r();rr.required(t,n,i,o,l,c),Ri(n,c)||rr.type(t,n,i,o,l)}r(o)},_V=function(t,n,r,i,l){var c=[],o=t.required||!t.required&&i.hasOwnProperty(t.field);if(o){if(Ri(n)&&!t.required)return r();rr.required(t,n,i,c,l)}r(c)},Qh={string:aV,method:sV,number:lV,boolean:uV,regexp:cV,integer:dV,float:fV,array:hV,object:pV,enum:vV,pattern:gV,date:yV,url:Gx,hex:Gx,email:Gx,required:xV,any:_V};function n2(){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 r2=n2(),Hp=function(){function e(n){this.rules=null,this._messages=r2,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(l){var c=r[l];i.rules[l]=Array.isArray(c)?c:[c]})},t.messages=function(r){return r&&(this._messages=c6(n2(),r)),this._messages},t.validate=function(r,i,l){var c=this;i===void 0&&(i={}),l===void 0&&(l=function(){});var o=r,h=i,p=l;if(typeof h=="function"&&(p=h,h={}),!this.rules||Object.keys(this.rules).length===0)return p&&p(null,o),Promise.resolve(o);function g(A){var O=[],M={};function R(z){if(Array.isArray(z)){var B;O=(B=O).concat.apply(B,z)}else O.push(z)}for(var N=0;N3&&arguments[3]!==void 0?arguments[3]:!1;return t.length&&r&&n===void 0&&!QI(e,t.slice(0,-1))?e:tM(e,t,n,r)}function w0(e){return Array.isArray(e)?CV(e):sn(e)==="object"&&e!==null?wV(e):e}function wV(e){if(Object.getPrototypeOf(e)===Object.prototype){var t={};for(var n in e)t[n]=w0(e[n]);return t}return e}function CV(e){return e.map(function(t){return w0(t)})}function hi(e){return Qb(e)}function Vl(e,t){var n=QI(e,t);return n}function Ml(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,i=bV(e,t,n,r);return i}function f6(e,t){var n={};return t.forEach(function(r){var i=Vl(e,r);n=Ml(n,r,i)}),n}function Jh(e,t){return e&&e.some(function(n){return rM(n,t)})}function h6(e){return sn(e)==="object"&&e!==null&&Object.getPrototypeOf(e)===Object.prototype}function nM(e,t){var n=Array.isArray(e)?wt(e):ve({},e);return t&&Object.keys(t).forEach(function(r){var i=n[r],l=t[r],c=h6(i)&&h6(l);n[r]=c?nM(i,l||{}):w0(l)}),n}function bg(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],l=t-n;return l>0?[].concat(wt(e.slice(0,n)),[i],wt(e.slice(n,t)),wt(e.slice(t+1,r))):l<0?[].concat(wt(e.slice(0,t)),wt(e.slice(t+1,n+1)),[i],wt(e.slice(n+1,r))):e}var kV=Hp;function TV(e,t){return e.replace(/\$\{\w+\}/g,function(n){var r=n.slice(2,-1);return t[r]})}var m6="CODE_LOGIC_ERROR";function i2(e,t,n,r,i){return o2.apply(this,arguments)}function o2(){return o2=Ec(bo().mark(function e(t,n,r,i,l){var c,o,h,p,g,b,w,P,I;return bo().wrap(function(O){for(;;)switch(O.prev=O.next){case 0:return c=ve({},r),delete c.ruleIndex,c.validator&&(o=c.validator,c.validator=function(){try{return o.apply(void 0,arguments)}catch(M){return console.error(M),Promise.reject(m6)}}),h=null,c&&c.type==="array"&&c.defaultField&&(h=c.defaultField,delete c.defaultField),p=new kV(se({},t,[c])),g=bg({},YI,i.validateMessages),p.messages(g),b=[],O.prev=9,O.next=12,Promise.resolve(p.validate(se({},t,n),ve({},i)));case 12:O.next=17;break;case 14:O.prev=14,O.t0=O.catch(9),O.t0.errors&&(b=O.t0.errors.map(function(M,R){var N=M.message,z=N===m6?g.default:N;return C.exports.isValidElement(z)?C.exports.cloneElement(z,{key:"error_".concat(R)}):z}));case 17:if(!(!b.length&&h)){O.next=22;break}return O.next=20,Promise.all(n.map(function(M,R){return i2("".concat(t,".").concat(R),M,h,i,l)}));case 20:return w=O.sent,O.abrupt("return",w.reduce(function(M,R){return[].concat(wt(M),wt(R))},[]));case 22:return P=ve(ve({},r),{},{name:t,enum:(r.enum||[]).join(", ")},l),I=b.map(function(M){return typeof M=="string"?TV(M,P):M}),O.abrupt("return",I);case 25:case"end":return O.stop()}},e,null,[[9,14]])})),o2.apply(this,arguments)}function PV(e,t,n,r,i,l){var c=e.join("."),o=n.map(function(g,b){var w=g.validator,P=ve(ve({},g),{},{ruleIndex:b});return w&&(P.validator=function(I,A,O){var M=!1,R=function(){for(var B=arguments.length,U=new Array(B),q=0;q0&&arguments[0]!==void 0?arguments[0]:ca;if(i.validatePromise===b){var B;i.validatePromise=null;var U=[],q=[];(B=z.forEach)===null||B===void 0||B.call(z,function(H){var te=H.rule.warningOnly,Y=H.errors,le=Y===void 0?ca:Y;te?q.push.apply(q,wt(le)):U.push.apply(U,wt(le))}),i.errors=U,i.warnings=q,i.triggerMetaEvent(),i.reRender()}}),N});return i.validatePromise=b,i.dirty=!0,i.errors=ca,i.warnings=ca,i.triggerMetaEvent(),i.reRender(),b},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 h=i.props.fieldContext,p=h.getInternalHooks(rc),g=p.getInitialValue;return g(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 h={touched:i.isFieldTouched(),validating:i.prevValidating,errors:i.errors,warnings:i.warnings,name:i.getNamePath()};return h},i.getOnlyChild=function(h){if(typeof h=="function"){var p=i.getMeta();return ve(ve({},i.getOnlyChild(h(i.getControlled(),p,i.props.fieldContext))),{},{isFunction:!0})}var g=Xi(h);return g.length!==1||!C.exports.isValidElement(g[0])?{child:g,isFunction:!1}:{child:g[0],isFunction:!1}},i.getValue=function(h){var p=i.props.fieldContext.getFieldsValue,g=i.getNamePath();return Vl(h||p(!0),g)},i.getControlled=function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},p=i.props,g=p.trigger,b=p.validateTrigger,w=p.getValueFromEvent,P=p.normalize,I=p.valuePropName,A=p.getValueProps,O=p.fieldContext,M=b!==void 0?b:O.validateTrigger,R=i.getNamePath(),N=O.getInternalHooks,z=O.getFieldsValue,B=N(rc),U=B.dispatch,q=i.getValue(),H=A||function(J){return se({},I,J)},te=h[g],Y=ve(ve({},h),H(q));Y[g]=function(){i.touched=!0,i.dirty=!0,i.triggerMetaEvent();for(var J,Z=arguments.length,Q=new Array(Z),ge=0;ge=0&&te<=Y.length?(p.keys=[].concat(wt(p.keys.slice(0,te)),[p.id],wt(p.keys.slice(te))),R([].concat(wt(Y.slice(0,te)),[H],wt(Y.slice(te))))):(p.keys=[].concat(wt(p.keys),[p.id]),R([].concat(wt(Y),[H]))),p.id+=1},remove:function(H){var te=z(),Y=new Set(Array.isArray(H)?H:[H]);Y.size<=0||(p.keys=p.keys.filter(function(le,J){return!Y.has(J)}),R(te.filter(function(le,J){return!Y.has(J)})))},move:function(H,te){if(H!==te){var Y=z();H<0||H>=Y.length||te<0||te>=Y.length||(p.keys=p6(p.keys,H,te),R(p6(Y,H,te)))}}},U=M||[];return Array.isArray(U)||(U=[]),i(U.map(function(q,H){var te=p.keys[H];return te===void 0&&(p.keys[H]=p.id,te=p.keys[H],p.id+=1),{name:H,key:te,isListField:!0}}),B,A)}})})})};function AV(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,l,c,o=[],h=!0,p=!1;try{if(l=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;h=!1}else for(;!(h=(r=l.call(n)).done)&&(o.push(r.value),o.length!==t);h=!0);}catch(g){p=!0,i=g}finally{try{if(!h&&n.return!=null&&(c=n.return(),Object(c)!==c))return}finally{if(p)throw i}}return o}}function ze(e,t){return JI(e)||AV(e,t)||AC(e,t)||eM()}function OV(e){var t=!1,n=e.length,r=[];return e.length?new Promise(function(i,l){e.forEach(function(c,o){c.catch(function(h){return t=!0,h}).then(function(h){n-=1,r[o]=h,!(n>0)&&(t&&l(r),i(r))})})}):Promise.resolve([])}var aM="__@field_split__";function qx(e){return e.map(function(t){return"".concat(sn(t),":").concat(t)}).join(aM)}var sd=function(){function e(){Kr(this,e),this.kvs=new Map}return Hr(e,[{key:"set",value:function(n,r){this.kvs.set(qx(n),r)}},{key:"get",value:function(n){return this.kvs.get(qx(n))}},{key:"update",value:function(n,r){var i=this.get(n),l=r(i);l?this.set(n,l):this.delete(n)}},{key:"delete",value:function(n){this.kvs.delete(qx(n))}},{key:"map",value:function(n){return wt(this.kvs.entries()).map(function(r){var i=ze(r,2),l=i[0],c=i[1],o=l.split(aM);return n({key:o.map(function(h){var p=h.match(/^([^:]*):(.*)$/),g=ze(p,3),b=g[1],w=g[2];return b==="number"?Number(w):w}),value:c})})}},{key:"toJSON",value:function(){var n={};return this.map(function(r){var i=r.key,l=r.value;return n[i.join(".")]=l,null}),n}}]),e}(),NV=["name","errors"],DV=Hr(function e(t){var n=this;Kr(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===rc?(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}):(Nr(!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 l,c=bg({},r,n.store);(l=n.prevWithoutPreserves)===null||l===void 0||l.map(function(o){var h=o.key;c=Ml(c,h,Vl(r,h))}),n.prevWithoutPreserves=null,n.updateStore(c)}},this.destroyForm=function(){var r=new sd;n.getFieldEntities(!0).forEach(function(i){n.isMergedPreserve(i.isPreserve())||r.set(i.getNamePath(),!0)}),n.prevWithoutPreserves=r},this.getInitialValue=function(r){var i=Vl(n.initialValues,r);return r.length?w0(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(l){l(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 sd;return n.getFieldEntities(r).forEach(function(l){var c=l.getNamePath();i.set(c,l)}),i},this.getFieldEntitiesForNamePathList=function(r){if(!r)return n.getFieldEntities(!0);var i=n.getFieldsMap(!0);return r.map(function(l){var c=hi(l);return i.get(c)||{INVALIDATE_NAME_PATH:hi(l)}})},this.getFieldsValue=function(r,i){if(n.warningUnhooked(),r===!0&&!i)return n.store;var l=n.getFieldEntitiesForNamePathList(Array.isArray(r)?r:null),c=[];return l.forEach(function(o){var h,p="INVALIDATE_NAME_PATH"in o?o.INVALIDATE_NAME_PATH:o.getNamePath();if(!(!r&&((h=o.isListField)===null||h===void 0?void 0:h.call(o))))if(!i)c.push(p);else{var g="getMeta"in o?o.getMeta():null;i(g)&&c.push(p)}}),f6(n.store,c.map(hi))},this.getFieldValue=function(r){n.warningUnhooked();var i=hi(r);return Vl(n.store,i)},this.getFieldsError=function(r){n.warningUnhooked();var i=n.getFieldEntitiesForNamePathList(r);return i.map(function(l,c){return l&&!("INVALIDATE_NAME_PATH"in l)?{name:l.getNamePath(),errors:l.getErrors(),warnings:l.getWarnings()}:{name:hi(r[c]),errors:[],warnings:[]}})},this.getFieldError=function(r){n.warningUnhooked();var i=hi(r),l=n.getFieldsError([i])[0];return l.errors},this.getFieldWarning=function(r){n.warningUnhooked();var i=hi(r),l=n.getFieldsError([i])[0];return l.warnings},this.isFieldsTouched=function(){n.warningUnhooked();for(var r=arguments.length,i=new Array(r),l=0;l0&&arguments[0]!==void 0?arguments[0]:{},i=new sd,l=n.getFieldEntities(!0);l.forEach(function(h){var p=h.props.initialValue,g=h.getNamePath();if(p!==void 0){var b=i.get(g)||new Set;b.add({entity:h,value:p}),i.set(g,b)}});var c=function(p){p.forEach(function(g){var b=g.props.initialValue;if(b!==void 0){var w=g.getNamePath(),P=n.getInitialValue(w);if(P!==void 0)Nr(!1,"Form already set 'initialValues' with path '".concat(w.join("."),"'. Field can not overwrite it."));else{var I=i.get(w);if(I&&I.size>1)Nr(!1,"Multiple Field with path '".concat(w.join("."),"' set 'initialValue'. Can not decide which one to pick."));else if(I){var A=n.getFieldValue(w);(!r.skipExist||A===void 0)&&n.updateStore(Ml(n.store,w,wt(I)[0].value))}}}})},o;r.entities?o=r.entities:r.namePathList?(o=[],r.namePathList.forEach(function(h){var p=i.get(h);if(p){var g;(g=o).push.apply(g,wt(wt(p).map(function(b){return b.entity})))}})):o=l,c(o)},this.resetFields=function(r){n.warningUnhooked();var i=n.store;if(!r){n.updateStore(bg({},n.initialValues)),n.resetWithFieldInitialValue(),n.notifyObservers(i,null,{type:"reset"}),n.notifyWatch();return}var l=r.map(hi);l.forEach(function(c){var o=n.getInitialValue(c);n.updateStore(Ml(n.store,c,o))}),n.resetWithFieldInitialValue({namePathList:l}),n.notifyObservers(i,l,{type:"reset"}),n.notifyWatch(l)},this.setFields=function(r){n.warningUnhooked();var i=n.store,l=[];r.forEach(function(c){var o=c.name;c.errors;var h=In(c,NV),p=hi(o);l.push(p),"value"in h&&n.updateStore(Ml(n.store,p,h.value)),n.notifyObservers(i,[p],{type:"setField",data:c})}),n.notifyWatch(l)},this.getFields=function(){var r=n.getFieldEntities(!0),i=r.map(function(l){var c=l.getNamePath(),o=l.getMeta(),h=ve(ve({},o),{},{name:c,value:n.getFieldValue(c)});return Object.defineProperty(h,"originRCField",{value:!0}),h});return i},this.initEntityValue=function(r){var i=r.props.initialValue;if(i!==void 0){var l=r.getNamePath(),c=Vl(n.store,l);c===void 0&&n.updateStore(Ml(n.store,l,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 l=n.store;n.resetWithFieldInitialValue({entities:[r],skipExist:!0}),n.notifyObservers(l,[r.getNamePath()],{type:"valueUpdate",source:"internal"})}return function(c,o){var h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(n.fieldEntities=n.fieldEntities.filter(function(b){return b!==r}),!n.isMergedPreserve(o)&&(!c||h.length>1)){var p=c?void 0:n.getInitialValue(i);if(i.length&&n.getFieldValue(i)!==p&&n.fieldEntities.every(function(b){return!rM(b.getNamePath(),i)})){var g=n.store;n.updateStore(Ml(g,i,p,!0)),n.notifyObservers(g,[i],{type:"remove"}),n.triggerDependenciesUpdate(g,i)}}n.notifyWatch([i])}},this.dispatch=function(r){switch(r.type){case"updateValue":{var i=r.namePath,l=r.value;n.updateValue(i,l);break}case"validateField":{var c=r.namePath,o=r.triggerName;n.validateFields([c],{triggerName:o});break}}},this.notifyObservers=function(r,i,l){if(n.subscribable){var c=ve(ve({},l),{},{store:n.getFieldsValue(!0)});n.getFieldEntities().forEach(function(o){var h=o.onStoreChange;h(r,i,c)})}else n.forceRootUpdate()},this.triggerDependenciesUpdate=function(r,i){var l=n.getDependencyChildrenFields(i);return l.length&&n.validateFields(l),n.notifyObservers(r,l,{type:"dependenciesUpdate",relatedFields:[i].concat(wt(l))}),l},this.updateValue=function(r,i){var l=hi(r),c=n.store;n.updateStore(Ml(n.store,l,i)),n.notifyObservers(c,[l],{type:"valueUpdate",source:"internal"}),n.notifyWatch([l]);var o=n.triggerDependenciesUpdate(c,l),h=n.callbacks.onValuesChange;if(h){var p=f6(n.store,[l]);h(p,n.getFieldsValue())}n.triggerOnFieldsChange([l].concat(wt(o)))},this.setFieldsValue=function(r){n.warningUnhooked();var i=n.store;if(r){var l=bg(n.store,r);n.updateStore(l)}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,l=[],c=new sd;n.getFieldEntities().forEach(function(h){var p=h.props.dependencies;(p||[]).forEach(function(g){var b=hi(g);c.update(b,function(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Set;return w.add(h),w})})});var o=function h(p){var g=c.get(p)||new Set;g.forEach(function(b){if(!i.has(b)){i.add(b);var w=b.getNamePath();b.isFieldDirty()&&w.length&&(l.push(w),h(w))}})};return o(r),l},this.triggerOnFieldsChange=function(r,i){var l=n.callbacks.onFieldsChange;if(l){var c=n.getFields();if(i){var o=new sd;i.forEach(function(p){var g=p.name,b=p.errors;o.set(g,b)}),c.forEach(function(p){p.errors=o.get(p.name)||p.errors})}var h=c.filter(function(p){var g=p.name;return Jh(r,g)});l(h,c)}},this.validateFields=function(r,i){n.warningUnhooked();var l=!!r,c=l?r.map(hi):[],o=[];n.getFieldEntities(!0).forEach(function(g){if(l||c.push(g.getNamePath()),(i==null?void 0:i.recursive)&&l){var b=g.getNamePath();b.every(function(I,A){return r[A]===I||r[A]===void 0})&&c.push(b)}if(!(!g.props.rules||!g.props.rules.length)){var w=g.getNamePath();if(!l||Jh(c,w)){var P=g.validateRules(ve({validateMessages:ve(ve({},YI),n.validateMessages)},i));o.push(P.then(function(){return{name:w,errors:[],warnings:[]}}).catch(function(I){var A,O=[],M=[];return(A=I.forEach)===null||A===void 0||A.call(I,function(R){var N=R.rule.warningOnly,z=R.errors;N?M.push.apply(M,wt(z)):O.push.apply(O,wt(z))}),O.length?Promise.reject({name:w,errors:O,warnings:M}):{name:w,errors:O,warnings:M}}))}}});var h=OV(o);n.lastValidatePromise=h,h.catch(function(g){return g}).then(function(g){var b=g.map(function(w){var P=w.name;return P});n.notifyObservers(n.store,b,{type:"validateFinish"}),n.triggerOnFieldsChange(b,g)});var p=h.then(function(){return n.lastValidatePromise===h?Promise.resolve(n.getFieldsValue(c)):Promise.reject([])}).catch(function(g){var b=g.filter(function(w){return w&&w.errors.length});return Promise.reject({values:n.getFieldsValue(c),errorFields:b,outOfDate:n.lastValidatePromise!==h})});return p.catch(function(g){return g}),p},this.submit=function(){n.warningUnhooked(),n.validateFields().then(function(r){var i=n.callbacks.onFinish;if(i)try{i(r)}catch(l){console.error(l)}}).catch(function(r){var i=n.callbacks.onFinishFailed;i&&i(r)})},this.forceRootUpdate=t});function LC(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 l=function(){i({})},c=new DV(l);t.current=c.getForm()}return[t.current]}var l2=C.exports.createContext({triggerFormChange:function(){},triggerFormFinish:function(){},registerForm:function(){},unregisterForm:function(){}}),zC=function(t){var n=t.validateMessages,r=t.onFormChange,i=t.onFormFinish,l=t.children,c=C.exports.useContext(l2),o=C.exports.useRef({});return E(l2.Provider,{value:ve(ve({},c),{},{validateMessages:ve(ve({},c.validateMessages),n),triggerFormChange:function(p,g){r&&r(p,{changedFields:g,forms:o.current}),c.triggerFormChange(p,g)},triggerFormFinish:function(p,g){i&&i(p,{values:g,forms:o.current}),c.triggerFormFinish(p,g)},registerForm:function(p,g){p&&(o.current=ve(ve({},o.current),{},se({},p,g))),c.registerForm(p,g)},unregisterForm:function(p){var g=ve({},o.current);delete g[p],o.current=g,c.unregisterForm(p)}}),children:l})},LV=["name","initialValues","fields","form","preserve","children","component","validateMessages","validateTrigger","onValuesChange","onFieldsChange","onFinish","onFinishFailed"],zV=function(t,n){var r=t.name,i=t.initialValues,l=t.fields,c=t.form,o=t.preserve,h=t.children,p=t.component,g=p===void 0?"form":p,b=t.validateMessages,w=t.validateTrigger,P=w===void 0?"onChange":w,I=t.onValuesChange,A=t.onFieldsChange,O=t.onFinish,M=t.onFinishFailed,R=In(t,LV),N=C.exports.useContext(l2),z=LC(c),B=ze(z,1),U=B[0],q=U.getInternalHooks(rc),H=q.useSubscribe,te=q.setInitialValues,Y=q.setCallbacks,le=q.setValidateMessages,J=q.setPreserve,Z=q.destroyForm;C.exports.useImperativeHandle(n,function(){return U}),C.exports.useEffect(function(){return N.registerForm(r,U),function(){N.unregisterForm(r)}},[N,U,r]),le(ve(ve({},N.validateMessages),b)),Y({onValuesChange:I,onFieldsChange:function(ke){if(N.triggerFormChange(r,ke),A){for(var De=arguments.length,Me=new Array(De>1?De-1:0),Ne=1;Ne1)&&(e=1),e}function $v(e){return e<=1?"".concat(Number(e)*100,"%"):e}function oc(e){return e.length===1?"0"+e:String(e)}function QV(e,t,n){return{r:qi(e,255)*255,g:qi(t,255)*255,b:qi(n,255)*255}}function _6(e,t,n){e=qi(e,255),t=qi(t,255),n=qi(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),l=0,c=0,o=(r+i)/2;if(r===i)c=0,l=0;else{var h=r-i;switch(c=o>.5?h/(2-r-i):h/(r+i),r){case e:l=(t-n)/h+(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 JV(e,t,n){var r,i,l;if(e=qi(e,360),t=qi(t,100),n=qi(n,100),t===0)i=n,l=n,r=n;else{var c=n<.5?n*(1+t):n+t-n*t,o=2*n-c;r=Zx(o,c,e+1/3),i=Zx(o,c,e),l=Zx(o,c,e-1/3)}return{r:r*255,g:i*255,b:l*255}}function fy(e,t,n){e=qi(e,255),t=qi(t,255),n=qi(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),l=0,c=r,o=r-i,h=r===0?0:o/r;if(r===i)l=0;else{switch(r){case e:l=(t-n)/o+(t>16,g:(e&65280)>>8,b:e&255}}var u2={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,l=null,c=!1,o=!1;return typeof e=="string"&&(e=aU(e)),typeof e=="object"&&(Ns(e.r)&&Ns(e.g)&&Ns(e.b)?(t=QV(e.r,e.g,e.b),c=!0,o=String(e.r).substr(-1)==="%"?"prgb":"rgb"):Ns(e.h)&&Ns(e.s)&&Ns(e.v)?(r=$v(e.s),i=$v(e.v),t=eU(e.h,r,i),c=!0,o="hsv"):Ns(e.h)&&Ns(e.s)&&Ns(e.l)&&(r=$v(e.s),l=$v(e.l),t=JV(e.h,r,l),c=!0,o="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=fM(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+%?",oU="[-\\+]?\\d*\\.\\d+%?",Ul="(?:".concat(oU,")|(?:").concat(iU,")"),Xx="[\\s|\\(]+(".concat(Ul,")[,|\\s]+(").concat(Ul,")[,|\\s]+(").concat(Ul,")\\s*\\)?"),Yx="[\\s|\\(]+(".concat(Ul,")[,|\\s]+(").concat(Ul,")[,|\\s]+(").concat(Ul,")[,|\\s]+(").concat(Ul,")\\s*\\)?"),za={CSS_UNIT:new RegExp(Ul),rgb:new RegExp("rgb"+Xx),rgba:new RegExp("rgba"+Yx),hsl:new RegExp("hsl"+Xx),hsla:new RegExp("hsla"+Yx),hsv:new RegExp("hsv"+Xx),hsva:new RegExp("hsva"+Yx),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 aU(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;var t=!1;if(u2[e])e=u2[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:Ho(n[1]),g:Ho(n[2]),b:Ho(n[3]),a:b6(n[4]),format:t?"name":"hex8"}:(n=za.hex6.exec(e),n?{r:Ho(n[1]),g:Ho(n[2]),b:Ho(n[3]),format:t?"name":"hex"}:(n=za.hex4.exec(e),n?{r:Ho(n[1]+n[1]),g:Ho(n[2]+n[2]),b:Ho(n[3]+n[3]),a:b6(n[4]+n[4]),format:t?"name":"hex8"}:(n=za.hex3.exec(e),n?{r:Ho(n[1]+n[1]),g:Ho(n[2]+n[2]),b:Ho(n[3]+n[3]),format:t?"name":"hex"}:!1)))))))))}function Ns(e){return Boolean(za.CSS_UNIT.exec(String(e)))}var Qx=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=rU(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,l=t.r/255,c=t.g/255,o=t.b/255;return l<=.03928?n=l/12.92:n=Math.pow((l+.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=fM(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=fy(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=fy(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=_6(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=_6(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),hy(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),tU(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(qi(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(qi(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="#"+hy(this.r,this.g,this.b,!1),n=0,r=Object.entries(u2);n=0,l=!n&&i&&(t.startsWith("hex")||t==="name");return l?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=Fv(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=Fv(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=Fv(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=Fv(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(),l=n/100,c={r:(i.r-r.r)*l+r.r,g:(i.g-r.g)*l+r.g,b:(i.b-r.b)*l+r.b,a:(i.a-r.a)*l+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,l=[this];for(r.h=(r.h-(i*t>>1)+720)%360;--t;)r.h=(r.h+i)%360,l.push(new e(r));return l},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,l=n.v,c=[],o=1/t;t--;)c.push(new e({h:r,s:i,v:l})),l=(l+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],l=360/t,c=1;c=60&&Math.round(e.h)<=240?r=n?Math.round(e.h)-Bv*t:Math.round(e.h)+Bv*t:r=n?Math.round(e.h)+Bv*t:Math.round(e.h)-Bv*t,r<0?r+=360:r>=360&&(r-=360),r}function E6(e,t,n){if(e.h===0&&e.s===0)return e.s;var r;return n?r=e.s-w6*t:t===pM?r=e.s+w6:r=e.s+sU*t,r>1&&(r=1),n&&t===hM&&r>.1&&(r=.1),r<.06&&(r=.06),Number(r.toFixed(2))}function k6(e,t,n){var r;return n?r=e.v+lU*t:r=e.v-uU*t,r>1&&(r=1),Number(r.toFixed(2))}function Pp(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=[],r=Ua(e),i=hM;i>0;i-=1){var l=C6(r),c=Vv(Ua({h:S6(l,i,!0),s:E6(l,i,!0),v:k6(l,i,!0)}));n.push(c)}n.push(Vv(r));for(var o=1;o<=pM;o+=1){var h=C6(r),p=Vv(Ua({h:S6(h,o),s:E6(h,o),v:k6(h,o)}));n.push(p)}return t.theme==="dark"?cU.map(function(g){var b=g.index,w=g.opacity,P=Vv(dU(Ua(t.backgroundColor||"#141414"),Ua(n[b]),w*100));return P}):n}var Jx={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"},e_={},t_={};Object.keys(Jx).forEach(function(e){e_[e]=Pp(Jx[e]),e_[e].primary=e_[e][5],t_[e]=Pp(Jx[e],{theme:"dark",backgroundColor:"#141414"}),t_[e].primary=t_[e][5]});function wo(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function uc(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 T6="data-rc-order",fU="rc-util-key",c2=new Map;function mM(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.mark;return t?t.startsWith("data-")?t:"data-".concat(t):fU}function C0(e){if(e.attachTo)return e.attachTo;var t=document.querySelector("head");return t||document.body}function hU(e){return e==="queue"?"prependQueue":e?"prepend":"append"}function vM(e){return Array.from((c2.get(e)||e).children).filter(function(t){return t.tagName==="STYLE"})}function gM(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(T6,hU(r)),n!=null&&n.nonce&&(i.nonce=n==null?void 0:n.nonce),i.innerHTML=e;var l=C0(t),c=l.firstChild;if(r){if(r==="queue"){var o=vM(l).filter(function(h){return["prepend","prependQueue"].includes(h.getAttribute(T6))});if(o.length)return l.insertBefore(i,o[o.length-1].nextSibling),i}l.insertBefore(i,c)}else l.appendChild(i);return i}function yM(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=C0(t);return vM(n).find(function(r){return r.getAttribute(mM(t))===e})}function P6(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=yM(e,t);if(n){var r=C0(t);r.removeChild(n)}}function pU(e,t){var n=c2.get(e);if(!n||!uc(document,n)){var r=gM("",t),i=r.parentNode;c2.set(e,i),e.removeChild(r)}}function Gp(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=C0(n);pU(r,n);var i=yM(t,n);if(i){var l,c;if((l=n.csp)!==null&&l!==void 0&&l.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 h=gM(e,n);return h.setAttribute(mM(n),t),h}function mU(e,t){Nr(e,"[@ant-design/icons] ".concat(t))}function I6(e){return sn(e)==="object"&&typeof e.name=="string"&&typeof e.theme=="string"&&(sn(e.icon)==="object"||typeof e.icon=="function")}function M6(){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 d2(e,t,n){return n?tr.createElement(e.tag,ve(ve({key:t},M6(e.attrs)),n),(e.children||[]).map(function(r,i){return d2(r,"".concat(t,"-").concat(e.tag,"-").concat(i))})):tr.createElement(e.tag,ve({key:t},M6(e.attrs)),(e.children||[]).map(function(r,i){return d2(r,"".concat(t,"-").concat(e.tag,"-").concat(i))}))}function xM(e){return Pp(e)[0]}function _M(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); } } `,gU=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:vU,n=C.exports.useContext(RC),r=n.csp;C.exports.useEffect(function(){Gp(t,"@ant-design-icons",{prepend:!0,csp:r})},[])},yU=["icon","className","onClick","style","primaryColor","secondaryColor"],ep={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function xU(e){var t=e.primaryColor,n=e.secondaryColor;ep.primaryColor=t,ep.secondaryColor=n||xM(t),ep.calculated=!!n}function _U(){return ve({},ep)}var S0=function(t){var n=t.icon,r=t.className,i=t.onClick,l=t.style,c=t.primaryColor,o=t.secondaryColor,h=In(t,yU),p=ep;if(c&&(p={primaryColor:c,secondaryColor:o||xM(c)}),gU(),mU(I6(n),"icon should be icon definiton, but got ".concat(n)),!I6(n))return null;var g=n;return g&&typeof g.icon=="function"&&(g=ve(ve({},g),{},{icon:g.icon(p.primaryColor,p.secondaryColor)})),d2(g.icon,"svg-".concat(g.name),ve({className:r,onClick:i,style:l,"data-icon":g.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},h))};S0.displayName="IconReact";S0.getTwoToneColors=_U;S0.setTwoToneColors=xU;const $C=S0;function bM(e){var t=_M(e),n=ze(t,2),r=n[0],i=n[1];return $C.setTwoToneColors({primaryColor:r,secondaryColor:i})}function bU(){var e=$C.getTwoToneColors();return e.calculated?[e.primaryColor,e.secondaryColor]:e.primaryColor}var wU=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];bM("#1890ff");var E0=C.exports.forwardRef(function(e,t){var n,r=e.className,i=e.icon,l=e.spin,c=e.rotate,o=e.tabIndex,h=e.onClick,p=e.twoToneColor,g=In(e,wU),b=C.exports.useContext(RC),w=b.prefixCls,P=w===void 0?"anticon":w,I=b.rootClassName,A=Ye(I,P,(n={},se(n,"".concat(P,"-").concat(i.name),!!i.name),se(n,"".concat(P,"-spin"),!!l||i.name==="loading"),n),r),O=o;O===void 0&&h&&(O=-1);var M=c?{msTransform:"rotate(".concat(c,"deg)"),transform:"rotate(".concat(c,"deg)")}:void 0,R=_M(p),N=ze(R,2),z=N[0],B=N[1];return E("span",{...ve(ve({role:"img","aria-label":i.name},g),{},{ref:t,tabIndex:O,onClick:h,className:A}),children:E($C,{icon:i,primaryColor:z,secondaryColor:B,style:M})})});E0.displayName="AntdIcon";E0.getTwoToneColor=bU;E0.setTwoToneColor=bM;const lr=E0;var wM=function(t,n){return E(lr,{...ve(ve({},t),{},{ref:n,icon:ZV})})};wM.displayName="CheckCircleFilled";const k0=C.exports.forwardRef(wM);var CU={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 SU=CU;var CM=function(t,n){return E(lr,{...ve(ve({},t),{},{ref:n,icon:SU})})};CM.displayName="CloseCircleFilled";const kc=C.exports.forwardRef(CM);var EU={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 kU=EU;var SM=function(t,n){return E(lr,{...ve(ve({},t),{},{ref:n,icon:kU})})};SM.displayName="ExclamationCircleFilled";const T0=C.exports.forwardRef(SM);var TU={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 PU=TU;var EM=function(t,n){return E(lr,{...ve(ve({},t),{},{ref:n,icon:PU})})};EM.displayName="InfoCircleFilled";const kM=C.exports.forwardRef(EM);var IU={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 MU=IU;var TM=function(t,n){return E(lr,{...ve(ve({},t),{},{ref:n,icon:MU})})};TM.displayName="LoadingOutlined";const qd=C.exports.forwardRef(TM);var qp=ve({},NF),RU=qp.version,AU=qp.render,OU=qp.unmountComponentAtNode,P0;try{var NU=Number((RU||"").split(".")[0]);NU>=18&&(P0=qp.createRoot)}catch{}function R6(e){var t=qp.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;t&&sn(t)==="object"&&(t.usingClientEntryPoint=e)}var py="__rc_react_root__";function DU(e,t){R6(!0);var n=t[py]||P0(t);R6(!1),n.render(e),t[py]=n}function LU(e,t){AU(e,t)}function PM(e,t){if(P0){DU(e,t);return}LU(e,t)}function zU(e){return f2.apply(this,arguments)}function f2(){return f2=Ec(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[py])===null||i===void 0||i.unmount(),delete t[py]}));case 1:case"end":return r.stop()}},e)})),f2.apply(this,arguments)}function FU(e){OU(e)}function IM(e){return h2.apply(this,arguments)}function h2(){return h2=Ec(bo().mark(function e(t){return bo().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(P0===void 0){r.next=2;break}return r.abrupt("return",zU(t));case 2:FU(t);case 3:case"end":return r.stop()}},e)})),h2.apply(this,arguments)}function A6(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 $U(e,t){var n={animationend:A6("Animation","AnimationEnd"),transitionend:A6("Transition","TransitionEnd")};return e&&("AnimationEvent"in t||delete n.animationend.animation,"TransitionEvent"in t||delete n.transitionend.transition),n}var BU=$U(wo(),typeof window<"u"?window:{}),MM={};if(wo()){var VU=document.createElement("div");MM=VU.style}var Uv={};function RM(e){if(Uv[e])return Uv[e];var t=BU[e];if(t)for(var n=Object.keys(t),r=n.length,i=0;i1&&arguments[1]!==void 0?arguments[1]:1;z6+=1;var r=z6;function i(l){if(l===0)zM(r),t();else{var c=DM(function(){i(l-1)});VC.set(r,c)}}return i(n),r};nr.cancel=function(e){var t=VC.get(e);return zM(t),LM(t)};const UU=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 l=nr(function(){i<=1?r({isCanceled:function(){return l!==e.current}}):n(r,i-1)});e.current=l}return C.exports.useEffect(function(){return function(){t()}},[]),[n,t]};var FM=wo()?C.exports.useLayoutEffect:C.exports.useEffect,F6=[$s,kd,Td,BC],$M=!1,jU=!0;function BM(e){return e===Td||e===BC}const KU=function(e,t){var n=fs(L6),r=ze(n,2),i=r[0],l=r[1],c=UU(),o=ze(c,2),h=o[0],p=o[1];function g(){l($s,!0)}return FM(function(){if(i!==L6&&i!==BC){var b=F6.indexOf(i),w=F6[b+1],P=t(i);P===$M?l(w,!0):h(function(I){function A(){I.isCanceled()||l(w,!0)}P===!0?A():Promise.resolve(P).then(A)})}},[e,i]),C.exports.useEffect(function(){return function(){p()}},[]),[g,i]},HU=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(N6,r),c.removeEventListener(O6,r))}function l(c){t.current&&t.current!==c&&i(t.current),c&&c!==t.current&&(c.addEventListener(N6,r),c.addEventListener(O6,r),t.current=c)}return C.exports.useEffect(function(){return function(){i(t.current)}},[]),[l,i]};function WU(e,t,n,r){var i=r.motionEnter,l=i===void 0?!0:i,c=r.motionAppear,o=c===void 0?!0:c,h=r.motionLeave,p=h===void 0?!0:h,g=r.motionDeadline,b=r.motionLeaveImmediately,w=r.onAppearPrepare,P=r.onEnterPrepare,I=r.onLeavePrepare,A=r.onAppearStart,O=r.onEnterStart,M=r.onLeaveStart,R=r.onAppearActive,N=r.onEnterActive,z=r.onLeaveActive,B=r.onAppearEnd,U=r.onEnterEnd,q=r.onLeaveEnd,H=r.onVisibleChanged,te=fs(),Y=ze(te,2),le=Y[0],J=Y[1],Z=fs(fd),Q=ze(Z,2),ge=Q[0],re=Q[1],de=fs(null),oe=ze(de,2),ye=oe[0],Re=oe[1],Te=C.exports.useRef(!1),ke=C.exports.useRef(null);function De(){return n()}var Me=C.exports.useRef(!1);function Ne(Ct){var Lt=De();if(!(Ct&&!Ct.deadline&&Ct.target!==Lt)){var lt=Me.current,dt;ge===jv&<?dt=B==null?void 0:B(Lt,Ct):ge===Kv&<?dt=U==null?void 0:U(Lt,Ct):ge===Hv&<&&(dt=q==null?void 0:q(Lt,Ct)),ge!==fd&<&&dt!==!1&&(re(fd,!0),Re(null,!0))}}var Le=HU(Ne),Ve=ze(Le,1),qe=Ve[0],Ue=C.exports.useMemo(function(){var Ct,Lt,lt;switch(ge){case jv:return Ct={},se(Ct,$s,w),se(Ct,kd,A),se(Ct,Td,R),Ct;case Kv:return Lt={},se(Lt,$s,P),se(Lt,kd,O),se(Lt,Td,N),Lt;case Hv:return lt={},se(lt,$s,I),se(lt,kd,M),se(lt,Td,z),lt;default:return{}}},[ge]),ct=KU(ge,function(Ct){if(Ct===$s){var Lt=Ue[$s];return Lt?Lt(De()):$M}if(Xe in Ue){var lt;Re(((lt=Ue[Xe])===null||lt===void 0?void 0:lt.call(Ue,De(),null))||null)}return Xe===Td&&(qe(De()),g>0&&(clearTimeout(ke.current),ke.current=setTimeout(function(){Ne({deadline:!0})},g))),jU}),pt=ze(ct,2),Tt=pt[0],Xe=pt[1],Pt=BM(Xe);Me.current=Pt,FM(function(){J(t);var Ct=Te.current;if(Te.current=!0,!!e){var Lt;!Ct&&t&&o&&(Lt=jv),Ct&&t&&l&&(Lt=Kv),(Ct&&!t&&p||!Ct&&b&&!t&&p)&&(Lt=Hv),Lt&&(re(Lt),Tt())}},[t]),C.exports.useEffect(function(){(ge===jv&&!o||ge===Kv&&!l||ge===Hv&&!p)&&re(fd)},[o,l,p]),C.exports.useEffect(function(){return function(){Te.current=!1,clearTimeout(ke.current)}},[]);var mt=C.exports.useRef(!1);C.exports.useEffect(function(){le&&(mt.current=!0),le!==void 0&&ge===fd&&((mt.current||le)&&(H==null||H(le)),mt.current=!0)},[le,ge]);var Mt=ye;return Ue[$s]&&Xe===kd&&(Mt=ve({transition:"none"},Mt)),[ge,Xe,Mt,le!=null?le:t]}var GU=function(e){li(n,e);var t=ui(n);function n(){return Kr(this,n),t.apply(this,arguments)}return Hr(n,[{key:"render",value:function(){return this.props.children}}]),n}(C.exports.Component);function qU(e){var t=e;sn(e)==="object"&&(t=e.transitionSupport);function n(i){return!!(i.motionName&&t)}var r=C.exports.forwardRef(function(i,l){var c=i.visible,o=c===void 0?!0:c,h=i.removeOnLeave,p=h===void 0?!0:h,g=i.forceRender,b=i.children,w=i.motionName,P=i.leavedClassName,I=i.eventProps,A=n(i),O=C.exports.useRef(),M=C.exports.useRef();function R(){try{return O.current instanceof HTMLElement?O.current:kp(M.current)}catch{return null}}var N=WU(A,o,R,i),z=ze(N,4),B=z[0],U=z[1],q=z[2],H=z[3],te=C.exports.useRef(H);H&&(te.current=!0);var Y=C.exports.useCallback(function(de){O.current=de,uy(l,de)},[l]),le,J=ve(ve({},I),{},{visible:o});if(!b)le=null;else if(B===fd||!n(i))H?le=b(ve({},J),Y):!p&&te.current&&P?le=b(ve(ve({},J),{},{className:P}),Y):g||!p&&!P?le=b(ve(ve({},J),{},{style:{display:"none"}}),Y):le=null;else{var Z,Q;U===$s?Q="prepare":BM(U)?Q="active":U===kd&&(Q="start"),le=b(ve(ve({},J),{},{className:Ye(D6(w,B),(Z={},se(Z,D6(w,"".concat(B,"-").concat(Q)),Q),se(Z,w,typeof w=="string"),Z)),style:q}),Y)}if(C.exports.isValidElement(le)&&Sc(le)){var ge=le,re=ge.ref;re||(le=C.exports.cloneElement(le,{ref:Y}))}return E(GU,{ref:M,children:le})});return r.displayName="CSSMotion",r}const Ca=qU(NM);var p2="add",m2="keep",v2="remove",n_="removed";function ZU(e){var t;return e&&sn(e)==="object"&&"key"in e?t=e:t={key:e},ve(ve({},t),{},{key:String(t.key)})}function g2(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return e.map(ZU)}function XU(){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,l=g2(e),c=g2(t);l.forEach(function(p){for(var g=!1,b=r;b1});return h.forEach(function(p){n=n.filter(function(g){var b=g.key,w=g.status;return b!==p||w!==v2}),n.forEach(function(g){g.key===p&&(g.status=m2)})}),n}var YU=["component","children","onVisibleChanged","onAllRemoved"],QU=["status"],JU=["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]:Ca,n=function(r){li(l,r);var i=ui(l);function l(){var c;Kr(this,l);for(var o=arguments.length,h=new Array(o),p=0;p=w&&(b.key=O[0].notice.key,b.updateMark=B6(),b.userPassKey=g,O.shift()),O.push({notice:b,holderCallback:h})),{notices:O}})},r.remove=function(o){r.setState(function(h){var p=h.notices;return{notices:p.filter(function(g){var b=g.notice,w=b.key,P=b.userPassKey,I=P!=null?P:w;return I!==o})}})},r.noticePropsMap={},r}return Hr(n,[{key:"getTransitionName",value:function(){var i=this.props,l=i.prefixCls,c=i.animation,o=this.props.transitionName;return!o&&c&&(o="".concat(l,"-").concat(c)),o}},{key:"render",value:function(){var i=this,l=this.state.notices,c=this.props,o=c.prefixCls,h=c.className,p=c.closeIcon,g=c.style,b=[];return l.forEach(function(w,P){var I=w.notice,A=w.holderCallback,O=P===l.length-1?I.updateMark:void 0,M=I.key,R=I.userPassKey,N=ve(ve(ve({prefixCls:o,closeIcon:p},I),I.props),{},{key:M,noticeKey:R||M,updateMark:O,onClose:function(B){var U;i.remove(B),(U=I.onClose)===null||U===void 0||U.call(I)},onClick:I.onClick,children:I.content});b.push(M),i.noticePropsMap[M]={props:N,holderCallback:A}}),E("div",{className:Ye(o,h),style:g,children:E(VM,{keys:b,motionName:this.getTransitionName(),onVisibleChanged:function(P,I){var A=I.key;P||delete i.noticePropsMap[A]},children:function(w){var P=w.key,I=w.className,A=w.style,O=w.visible,M=i.noticePropsMap[P],R=M.props,N=M.holderCallback;return N?E("div",{className:Ye(I,"".concat(o,"-hook-holder")),style:ve({},A),ref:function(B){typeof P>"u"||(B?(i.hookRefs.set(P,B),N(B,R)):i.hookRefs.delete(P))}},P):E(UC,{...R,className:Ye(I,R==null?void 0:R.className),style:ve(ve({},A),R==null?void 0:R.style),visible:O})}})})}}]),n}(C.exports.Component);Zd.newInstance=void 0;Zd.defaultProps={prefixCls:"rc-notification",animation:"fade",style:{top:65,left:"50%"}};Zd.newInstance=function(t,n){var r=t||{},i=r.getContainer,l=In(r,tj),c=document.createElement("div");if(i){var o=i();o.appendChild(c)}else document.body.appendChild(c);var h=!1;function p(g){h||(h=!0,n({notice:function(w){g.add(w)},removeNotice:function(w){g.remove(w)},component:g,destroy:function(){IM(c),c.parentNode&&c.parentNode.removeChild(c)},useNotification:function(){return jC(g)}}))}PM(E(Zd,{...l,ref:p}),c)};function rj(e,t){var n=function(){var i,l,c=null,o={add:function(A,O){c==null||c.component.add(A,O)}},h=jC(o),p=ze(h,2),g=p[0],b=p[1];function w(I){var A=I.prefixCls,O=i("message",A),M=i(),R=I.key||ZM(),N=new Promise(function(B){var U=function(){return typeof I.onClose=="function"&&I.onClose(),B(!0)};e(tt(tt({},I),{prefixCls:O,rootPrefixCls:M,getPopupContainer:l}),function(q){var H=q.prefixCls,te=q.instance;c=te,g(t(tt(tt({},I),{key:R,onClose:U}),H))})}),z=function(){c&&c.removeNotice(R)};return z.then=function(B,U){return N.then(B,U)},z.promise=N,z}var P=C.exports.useRef({});return P.current.open=w,QM.forEach(function(I){return eR(P.current,I)}),[P.current,E(hu,{children:function(I){return i=I.getPrefixCls,l=I.getPopupContainer,b}},"holder")]};return n}var xo,UM=3,jM,ij=1,KM="",y2="move-up",HM=!1,WM,GM,qM=!1;function ZM(){return ij++}function oj(e){e.top!==void 0&&(jM=e.top,xo=null),e.duration!==void 0&&(UM=e.duration),e.prefixCls!==void 0&&(KM=e.prefixCls),e.getContainer!==void 0&&(WM=e.getContainer,xo=null),e.transitionName!==void 0&&(y2=e.transitionName,xo=null,HM=!0),e.maxCount!==void 0&&(GM=e.maxCount,xo=null),e.rtl!==void 0&&(qM=e.rtl)}function XM(e,t){var n=e.prefixCls,r=e.getPopupContainer,i=GC(),l=i.getPrefixCls,c=i.getRootPrefixCls,o=i.getIconPrefixCls,h=l("message",n||KM),p=c(e.rootPrefixCls,h),g=o();if(xo){t({prefixCls:h,rootPrefixCls:p,iconPrefixCls:g,instance:xo});return}var b={prefixCls:h,transitionName:HM?y2:"".concat(p,"-").concat(y2),style:{top:jM},getContainer:WM||r,maxCount:GM};Zd.newInstance(b,function(w){if(xo){t({prefixCls:h,rootPrefixCls:p,iconPrefixCls:g,instance:xo});return}xo=w,t({prefixCls:h,rootPrefixCls:p,iconPrefixCls:g,instance:w})})}var YM={info:kM,success:k0,error:kc,warning:T0,loading:qd},QM=Object.keys(YM);function JM(e,t,n){var r,i=e.duration!==void 0?e.duration:UM,l=YM[e.type],c=Ye("".concat(t,"-custom-content"),(r={},se(r,"".concat(t,"-").concat(e.type),e.type),se(r,"".concat(t,"-rtl"),qM===!0),r));return{key:e.key,duration:i,style:e.style||{},className:e.className,content:E(df,{iconPrefixCls:n,children:Qe("div",{className:c,children:[e.icon||l&&E(l,{}),E("span",{children:e.content})]})}),onClose:e.onClose,onClick:e.onClick}}function aj(e){var t=e.key||ZM(),n=new Promise(function(i){var l=function(){return typeof e.onClose=="function"&&e.onClose(),i(!0)};XM(e,function(c){var o=c.prefixCls,h=c.iconPrefixCls,p=c.instance;p.notice(JM(tt(tt({},e),{key:t,onClose:l}),o,h))})}),r=function(){var l;xo&&(xo.removeNotice(t),(l=e.onClose)===null||l===void 0||l.call(e))};return r.then=function(i,l){return n.then(i,l)},r.promise=n,r}function sj(e){return Object.prototype.toString.call(e)==="[object Object]"&&!!e.content}var Ip={open:aj,config:oj,destroy:function(t){if(xo)if(t){var n=xo,r=n.removeNotice;r(t)}else{var i=xo,l=i.destroy;l(),xo=null}}};function eR(e,t){e[t]=function(n,r,i){return sj(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}))}}QM.forEach(function(e){return eR(Ip,e)});Ip.warn=Ip.warning;Ip.useMessage=rj(XM,JM);const lj=Ip;var uj={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 cj=uj;var tR=function(t,n){return E(lr,{...ve(ve({},t),{},{ref:n,icon:cj})})};tR.displayName="CheckCircleOutlined";const KC=C.exports.forwardRef(tR);var dj={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 fj=dj;var nR=function(t,n){return E(lr,{...ve(ve({},t),{},{ref:n,icon:fj})})};nR.displayName="CloseCircleOutlined";const HC=C.exports.forwardRef(nR);var hj={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 pj=hj;var rR=function(t,n){return E(lr,{...ve(ve({},t),{},{ref:n,icon:pj})})};rR.displayName="CloseOutlined";const I0=C.exports.forwardRef(rR);var mj={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=mj;var iR=function(t,n){return E(lr,{...ve(ve({},t),{},{ref:n,icon:vj})})};iR.displayName="ExclamationCircleOutlined";const M0=C.exports.forwardRef(iR);var gj={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 yj=gj;var oR=function(t,n){return E(lr,{...ve(ve({},t),{},{ref:n,icon:yj})})};oR.displayName="InfoCircleOutlined";const WC=C.exports.forwardRef(oR);function xj(e,t){var n=function(){var i,l=null,c={add:function(I,A){l==null||l.component.add(I,A)}},o=jC(c),h=ze(o,2),p=h[0],g=h[1];function b(P){var I=P.prefixCls,A=i("notification",I);e(tt(tt({},P),{prefixCls:A}),function(O){var M=O.prefixCls,R=O.instance;l=R,p(t(P,M))})}var w=C.exports.useRef({});return w.current.open=b,["success","info","warning","error"].forEach(function(P){w.current[P]=function(I){return w.current.open(tt(tt({},I),{type:P}))}}),[w.current,E(hu,{children:function(P){return i=P.getPrefixCls,g}},"holder")]};return n}globalThis&&globalThis.__awaiter;var Ju={},aR=4.5,sR=24,lR=24,uR="",x2="topRight",cR,dR,fR=!1,hR;function _j(e){var t=e.duration,n=e.placement,r=e.bottom,i=e.top,l=e.getContainer,c=e.closeIcon,o=e.prefixCls;o!==void 0&&(uR=o),t!==void 0&&(aR=t),n!==void 0?x2=n:e.rtl&&(x2="topLeft"),r!==void 0&&(lR=r),i!==void 0&&(sR=i),l!==void 0&&(cR=l),c!==void 0&&(dR=c),e.rtl!==void 0&&(fR=e.rtl),e.maxCount!==void 0&&(hR=e.maxCount)}function bj(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:sR,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:lR,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 pR(e,t){var n=e.placement,r=n===void 0?x2:n,i=e.top,l=e.bottom,c=e.getContainer,o=c===void 0?cR:c,h=e.prefixCls,p=GC(),g=p.getPrefixCls,b=p.getIconPrefixCls,w=g("notification",h||uR),P=b(),I="".concat(w,"-").concat(r),A=Ju[I];if(A){Promise.resolve(A).then(function(M){t({prefixCls:"".concat(w,"-notice"),iconPrefixCls:P,instance:M})});return}var O=Ye("".concat(w,"-").concat(r),se({},"".concat(w,"-rtl"),fR===!0));Ju[I]=new Promise(function(M){Zd.newInstance({prefixCls:w,className:O,style:bj(r,i,l),getContainer:o,maxCount:hR},function(R){M(R),t({prefixCls:"".concat(w,"-notice"),iconPrefixCls:P,instance:R})})})}var wj={success:KC,info:WC,error:HC,warning:M0};function mR(e,t,n){var r=e.duration,i=e.icon,l=e.type,c=e.description,o=e.message,h=e.btn,p=e.onClose,g=e.onClick,b=e.key,w=e.style,P=e.className,I=e.closeIcon,A=I===void 0?dR:I,O=e.props,M=r===void 0?aR:r,R=null;i?R=E("span",{className:"".concat(t,"-icon"),children:e.icon}):l&&(R=C.exports.createElement(wj[l]||null,{className:"".concat(t,"-icon ").concat(t,"-icon-").concat(l)}));var N=E("span",{className:"".concat(t,"-close-x"),children:A||E(I0,{className:"".concat(t,"-close-icon")})}),z=!c&&R?E("span",{className:"".concat(t,"-message-single-line-auto-margin")}):null;return{content:E(df,{iconPrefixCls:n,children:Qe("div",{className:R?"".concat(t,"-with-icon"):"",role:"alert",children:[R,Qe("div",{className:"".concat(t,"-message"),children:[z,o]}),E("div",{className:"".concat(t,"-description"),children:c}),h?E("span",{className:"".concat(t,"-btn"),children:h}):null]})}),duration:M,closable:!0,closeIcon:N,onClose:p,onClick:g,key:b,style:w||{},className:Ye(P,se({},"".concat(t,"-").concat(l),!!l)),props:O}}function Cj(e){pR(e,function(t){var n=t.prefixCls,r=t.iconPrefixCls,i=t.instance;i.notice(mR(e,n,r))})}var Xd={open:Cj,close:function(t){Object.keys(Ju).forEach(function(n){return Promise.resolve(Ju[n]).then(function(r){r.removeNotice(t)})})},config:_j,destroy:function(){Object.keys(Ju).forEach(function(t){Promise.resolve(Ju[t]).then(function(n){n.destroy()}),delete Ju[t]})}};["success","info","warning","error"].forEach(function(e){Xd[e]=function(t){return Xd.open(tt(tt({},t),{type:e}))}});Xd.warn=Xd.warning;Xd.useNotification=xj(pR,mR);const Sj=Xd;var Ej=function(t,n){return n||(t?"ant-".concat(t):"ant")},Nn=C.exports.createContext({getPrefixCls:Ej}),hu=Nn.Consumer,kj="-ant-".concat(Date.now(),"-").concat(Math.random());function Tj(e,t){var n={},r=function(g,b){var w=g.clone();return w=(b==null?void 0:b(w))||w,w.toRgbString()},i=function(g,b){var w=new Qx(g),P=Pp(w.toRgbString());n["".concat(b,"-color")]=r(w),n["".concat(b,"-color-disabled")]=P[1],n["".concat(b,"-color-hover")]=P[4],n["".concat(b,"-color-active")]=P[6],n["".concat(b,"-color-outline")]=w.clone().setAlpha(.2).toRgbString(),n["".concat(b,"-color-deprecated-bg")]=P[0],n["".concat(b,"-color-deprecated-border")]=P[2]};if(t.primaryColor){i(t.primaryColor,"primary");var l=new Qx(t.primaryColor),c=Pp(l.toRgbString());c.forEach(function(p,g){n["primary-".concat(g+1)]=p}),n["primary-color-deprecated-l-35"]=r(l,function(p){return p.lighten(35)}),n["primary-color-deprecated-l-20"]=r(l,function(p){return p.lighten(20)}),n["primary-color-deprecated-t-20"]=r(l,function(p){return p.tint(20)}),n["primary-color-deprecated-t-50"]=r(l,function(p){return p.tint(50)}),n["primary-color-deprecated-f-12"]=r(l,function(p){return p.setAlpha(p.getAlpha()*.12)});var o=new Qx(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 h=Object.keys(n).map(function(p){return"--".concat(e,"-").concat(p,": ").concat(n[p],";")});return` :root { `.concat(h.join(` `),` } `).trim()}function Pj(e,t){var n=Tj(e,t);wo()&&Gp(n,"".concat(kj,"-dynamic-theme"))}var _2=C.exports.createContext(!1),vR=function(t){var n=t.children,r=t.disabled,i=C.exports.useContext(_2);return E(_2.Provider,{value:r!=null?r:i,children:n})};const pu=_2;var b2=C.exports.createContext(void 0),gR=function(t){var n=t.children,r=t.size;return E(b2.Consumer,{children:function(i){return E(b2.Provider,{value:r||i,children:n})}})};const ms=b2;var Ij=["getTargetContainer","getPopupContainer","renderEmpty","pageHeader","input","pagination","form"],Mj="ant",Rj="anticon",my,yR;function Cg(){return my||Mj}function Aj(){return yR||Rj}var Oj=function(t){var n=t.prefixCls,r=t.iconPrefixCls,i=t.theme;n!==void 0&&(my=n),r!==void 0&&(yR=r),i&&Pj(Cg(),i)},GC=function(){return{getPrefixCls:function(n,r){return r||(n?"".concat(Cg(),"-").concat(n):Cg())},getIconPrefixCls:Aj,getRootPrefixCls:function(n,r){return n||my||(r&&r.includes("-")?r.replace(/^(.*)-[^-]*$/,"$1"):Cg())}}},Nj=function(t){var n,r,i=t.children,l=t.csp,c=t.autoInsertSpaceInButton,o=t.form,h=t.locale,p=t.componentSize,g=t.direction,b=t.space,w=t.virtual,P=t.dropdownMatchSelectWidth,I=t.legacyLocale,A=t.parentContext,O=t.iconPrefixCls,M=t.componentDisabled,R=C.exports.useCallback(function(H,te){var Y=t.prefixCls;if(te)return te;var le=Y||A.getPrefixCls("");return H?"".concat(le,"-").concat(H):le},[A.getPrefixCls,t.prefixCls]),N=tt(tt({},A),{csp:l,autoInsertSpaceInButton:c,locale:h||I,direction:g,space:b,virtual:w,dropdownMatchSelectWidth:P,getPrefixCls:R});Ij.forEach(function(H){var te=t[H];te&&(N[H]=te)});var z=Kp(function(){return N},N,function(H,te){var Y=Object.keys(H),le=Object.keys(te);return Y.length!==le.length||Y.some(function(J){return H[J]!==te[J]})}),B=C.exports.useMemo(function(){return{prefixCls:O,csp:l}},[O,l]),U=i,q={};return h&&(q=((n=h.Form)===null||n===void 0?void 0:n.defaultValidateMessages)||((r=Js.Form)===null||r===void 0?void 0:r.defaultValidateMessages)||{}),o&&o.validateMessages&&(q=tt(tt({},q),o.validateMessages)),Object.keys(q).length>0&&(U=E(zC,{validateMessages:q,children:i})),h&&(U=E(WV,{locale:h,_ANT_MARK__:KV,children:U})),(O||l)&&(U=E(RC.Provider,{value:B,children:U})),p&&(U=E(gR,{size:p,children:U})),M!==void 0&&(U=E(vR,{disabled:M,children:U})),E(Nn.Provider,{value:z,children:U})},df=function(t){return C.exports.useEffect(function(){t.direction&&(lj.config({rtl:t.direction==="rtl"}),Sj.config({rtl:t.direction==="rtl"}))},[t.direction]),E(Wp,{children:function(n,r,i){return E(hu,{children:function(l){return E(Nj,{parentContext:l,legacyLocale:i,...t})}})}})};df.ConfigContext=Nn;df.SizeContext=ms;df.config=Oj;function Hs(e,t,n,r){var i=mc.unstable_batchedUpdates?function(c){mc.unstable_batchedUpdates(n,c)}:n;return e.addEventListener&&e.addEventListener(t,i,r),{remove:function(){e.removeEventListener&&e.removeEventListener(t,i,r)}}}function xR(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 Do=C.exports.isValidElement;function _R(e){return e&&Do(e)&&e.type===C.exports.Fragment}function bR(e,t,n){return Do(e)?C.exports.cloneElement(e,typeof n=="function"?n(e.props||{}):n):t}function Ei(e,t){return bR(e,e,t)}var Dj=function(e){li(n,e);var t=ui(n);function n(){var r;return Kr(this,n),r=t.apply(this,arguments),r.state={error:void 0,info:{componentStack:""}},r}return Hr(n,[{key:"componentDidCatch",value:function(i,l){this.setState({error:i,info:l})}},{key:"render",value:function(){var i=this.props,l=i.message,c=i.description,o=i.children,h=this.state,p=h.error,g=h.info,b=g&&g.componentStack?g.componentStack:null,w=typeof l>"u"?(p||"").toString():l,P=typeof c>"u"?b:c;return p?E(R0,{type:"error",message:w,description:E("pre",{children:P})}):o}}]),n}(C.exports.Component);const Lj=Dj;var zj=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",l=0;return w2(e)?l=e[t?"pageYOffset":"pageXOffset"]:e instanceof Document?l=e.documentElement[i]:(e instanceof HTMLElement||e)&&(l=e[i]),e&&!w2(e)&&typeof l!="number"&&(l=(r=((n=e.ownerDocument)!==null&&n!==void 0?n:e).documentElement)===null||r===void 0?void 0:r[i]),l}function jj(e,t,n,r){var i=n-t;return e/=r/2,e<1?i/2*e*e*e+t:i/2*((e-=2)*e*e+2)+t}function Kj(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.getContainer,r=n===void 0?function(){return window}:n,i=t.callback,l=t.duration,c=l===void 0?450:l,o=r(),h=Uj(o,!0),p=Date.now(),g=function b(){var w=Date.now(),P=w-p,I=jj(P>c?c:P,h,e,c);w2(o)?o.scrollTo(window.pageXOffset,I):o instanceof Document||o.constructor.name==="HTMLDocument"?o.documentElement.scrollTop=I:o.scrollTop=I,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 Et={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(t){var n=t.keyCode;if(t.altKey&&!t.ctrlKey||t.metaKey||n>=Et.F1&&n<=Et.F12)return!1;switch(n){case Et.ALT:case Et.CAPS_LOCK:case Et.CONTEXT_MENU:case Et.CTRL:case Et.DOWN:case Et.END:case Et.ESC:case Et.HOME:case Et.INSERT:case Et.LEFT:case Et.MAC_FF_META:case Et.META:case Et.NUMLOCK:case Et.NUM_CENTER:case Et.PAGE_DOWN:case Et.PAGE_UP:case Et.PAUSE:case Et.PRINT_SCREEN:case Et.RIGHT:case Et.SHIFT:case Et.UP:case Et.WIN_KEY:case Et.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(t){if(t>=Et.ZERO&&t<=Et.NINE||t>=Et.NUM_ZERO&&t<=Et.NUM_MULTIPLY||t>=Et.A&&t<=Et.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&t===0)return!0;switch(t){case Et.SPACE:case Et.QUESTION_MARK:case Et.NUM_PLUS:case Et.NUM_MINUS:case Et.NUM_PERIOD:case Et.NUM_DIVISION:case Et.SEMICOLON:case Et.DASH:case Et.EQUALS:case Et.COMMA:case Et.PERIOD:case Et.SLASH:case Et.APOSTROPHE:case Et.SINGLE_QUOTE:case Et.OPEN_SQUARE_BRACKET:case Et.BACKSLASH:case Et.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},SR=C.exports.createContext(null);function ER(){return C.exports.useContext(SR)}function Hj(){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],l=C.exports.useRef(null),c=function(){window.clearTimeout(l.current)};C.exports.useEffect(function(){return c},[]);var o=function(p,g){c(),l.current=window.setTimeout(function(){i(p),g&&g()},e)};return[r,o,c]}function kR(){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 Wj(e,t,n,r){var i=C.exports.useRef(null);i.current={open:t,triggerOpen:n,customizedTrigger:r},C.exports.useEffect(function(){function l(c){var o;if(!((o=i.current)!==null&&o!==void 0&&o.customizedTrigger)){var h=c.target;h.shadowRoot&&c.composed&&(h=c.composedPath()[0]||h),i.current.open&&e().filter(function(p){return p}).every(function(p){return!p.contains(h)&&p!==h})&&i.current.triggerOpen(!1)}}return window.addEventListener("mousedown",l),function(){return window.removeEventListener("mousedown",l)}},[])}var Gj=`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`,qj=`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`,Zj="".concat(Gj," ").concat(qj).split(/[\s\n]+/),Xj="aria-",Yj="data-";function U6(e,t){return e.indexOf(t)===0}function au(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=ve({},t);var r={};return Object.keys(e).forEach(function(i){(n.aria&&(i==="role"||U6(i,Xj))||n.data&&U6(i,Yj)||n.attr&&Zj.includes(i))&&(r[i]=e[i])}),r}var Qj=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],ld=void 0;function Jj(e,t){var n=e.prefixCls,r=e.invalidate,i=e.item,l=e.renderItem,c=e.responsive,o=e.responsiveDisabled,h=e.registerSize,p=e.itemKey,g=e.className,b=e.style,w=e.children,P=e.display,I=e.order,A=e.component,O=A===void 0?"div":A,M=In(e,Qj),R=c&&!P;function N(H){h(p,H)}C.exports.useEffect(function(){return function(){N(null)}},[]);var z=l&&i!==ld?l(i):w,B;r||(B={opacity:R?0:1,height:R?0:ld,overflowY:R?"hidden":ld,order:c?I:ld,pointerEvents:R?"none":ld,position:R?"absolute":ld});var U={};R&&(U["aria-hidden"]=!0);var q=E(O,{className:Ye(!r&&n,g),style:ve(ve({},B),b),...U,...M,ref:t,children:z});return c&&(q=E(ol,{onResize:function(te){var Y=te.offsetWidth;N(Y)},disabled:o,children:q})),q}var tp=C.exports.forwardRef(Jj);tp.displayName="Item";function eK(){var e=fs({}),t=ze(e,2),n=t[1],r=C.exports.useRef([]),i=0,l=0;function c(o){var h=i;i+=1,r.current.lengthI,Ge=C.exports.useMemo(function(){var ot=l;return Ut?le===null&&H?ot=l:ot=l.slice(0,Math.min(l.length,Z/g)):typeof I=="number"&&(ot=l.slice(0,I)),ot},[l,g,le,I,Ut]),Xt=C.exports.useMemo(function(){return Ut?l.slice(Lt+1):l.slice(Ge.length)},[l,Ge,Ut,Lt]),dn=C.exports.useCallback(function(ot,ht){var At;return typeof h=="function"?h(ot):(At=h&&(ot==null?void 0:ot[h]))!==null&&At!==void 0?At:ht},[h]),Vt=C.exports.useCallback(c||function(ot){return ot},[c]);function jt(ot,ht,At){Mt===ot&&(ht===void 0||ht===Tt)||(Ct(ot),At||(it(otZ){jt($t-1,ot-cn-qe+Me);break}}M&&Gt(0)+qe>Z&&Xe(null)}},[Z,re,Me,qe,dn,Ge]);var an=ut&&!!Xt.length,Fn={};Tt!==null&&Ut&&(Fn={position:"absolute",left:Tt,top:0});var kn={prefixCls:ft,responsive:Ut,component:z,invalidate:Qt},zt=o?function(ot,ht){var At=dn(ot,ht);return E(vy.Provider,{value:ve(ve({},kn),{},{order:ht,item:ot,itemKey:At,registerSize:_n,display:ht<=Lt}),children:o(ot,ht)},At)}:function(ot,ht){var At=dn(ot,ht);return C.exports.createElement(tp,{...kn,order:ht,key:At,item:ot,renderItem:Vt,itemKey:At,registerSize:_n,display:ht<=Lt})},Tn,Cn={order:an?Lt:Number.MAX_SAFE_INTEGER,className:"".concat(ft,"-rest"),registerSize:An,display:an};if(O)O&&(Tn=E(vy.Provider,{value:ve(ve({},kn),Cn),children:O(Xt)}));else{var hn=A||aK;Tn=E(tp,{...kn,...Cn,children:typeof hn=="function"?hn(Xt):hn})}var Nt=Qe(N,{className:Ye(!Qt&&r,P),style:w,ref:t,...U,children:[Ge.map(zt),Fe?Tn:null,M&&E(tp,{...kn,responsive:Wt,responsiveDisabled:!Ut,order:Lt,className:"".concat(ft,"-suffix"),registerSize:_t,display:!0,style:Fn,children:M})]});return Wt&&(Nt=E(ol,{onResize:nn,disabled:!Ut,children:Nt})),Nt}var hs=C.exports.forwardRef(sK);hs.displayName="Overflow";hs.Item=TR;hs.RESPONSIVE=PR;hs.INVALIDATE=IR;var gy=function(t){var n=t.className,r=t.customizeIcon,i=t.customizeIconProps,l=t.onMouseDown,c=t.onClick,o=t.children,h;return typeof r=="function"?h=r(i):h=r,E("span",{className:n,onMouseDown:function(g){g.preventDefault(),l&&l(g)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:c,"aria-hidden":!0,children:h!==void 0?h:E("span",{className:Ye(n.split(/\s+/).map(function(p){return"".concat(p,"-icon")})),children:o})})},lK=function(t,n){var r,i,l=t.prefixCls,c=t.id,o=t.inputElement,h=t.disabled,p=t.tabIndex,g=t.autoFocus,b=t.autoComplete,w=t.editable,P=t.activeDescendantId,I=t.value,A=t.maxLength,O=t.onKeyDown,M=t.onMouseDown,R=t.onChange,N=t.onPaste,z=t.onCompositionStart,B=t.onCompositionEnd,U=t.open,q=t.attrs,H=o||E("input",{}),te=H,Y=te.ref,le=te.props,J=le.onKeyDown,Z=le.onChange,Q=le.onMouseDown,ge=le.onCompositionStart,re=le.onCompositionEnd,de=le.style;return"maxLength"in H.props,H=C.exports.cloneElement(H,ve(ve(ve({type:"search"},le),{},{id:c,ref:Lo(n,Y),disabled:h,tabIndex:p,autoComplete:b||"off",autoFocus:g,className:Ye("".concat(l,"-selection-search-input"),(r=H)===null||r===void 0||(i=r.props)===null||i===void 0?void 0:i.className),role:"combobox","aria-expanded":U,"aria-haspopup":"listbox","aria-owns":"".concat(c,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(c,"_list"),"aria-activedescendant":P},q),{},{value:w?I:"",maxLength:A,readOnly:!w,unselectable:w?null:"on",style:ve(ve({},de),{},{opacity:w?null:0}),onKeyDown:function(ye){O(ye),J&&J(ye)},onMouseDown:function(ye){M(ye),Q&&Q(ye)},onChange:function(ye){R(ye),Z&&Z(ye)},onCompositionStart:function(ye){z(ye),ge&&ge(ye)},onCompositionEnd:function(ye){B(ye),re&&re(ye)},onPaste:N})),H},qC=C.exports.forwardRef(lK);qC.displayName="Input";function MR(e){return Array.isArray(e)?e:e!==void 0?[e]:[]}var uK=typeof window<"u"&&window.document&&window.document.documentElement,cK=uK;function dK(e){return e!=null}function j6(e){return["string","number"].includes(sn(e))}function RR(e){var t=void 0;return e&&(j6(e.title)?t=e.title.toString():j6(e.label)&&(t=e.label.toString())),t}function fK(e,t){cK?C.exports.useLayoutEffect(e,t):C.exports.useEffect(e,t)}function hK(e){var t;return(t=e.key)!==null&&t!==void 0?t:e.value}var K6=function(t){t.preventDefault(),t.stopPropagation()},pK=function(t){var n=t.id,r=t.prefixCls,i=t.values,l=t.open,c=t.searchValue,o=t.autoClearSearchValue,h=t.inputRef,p=t.placeholder,g=t.disabled,b=t.mode,w=t.showSearch,P=t.autoFocus,I=t.autoComplete,A=t.activeDescendantId,O=t.tabIndex,M=t.removeIcon,R=t.maxTagCount,N=t.maxTagTextLength,z=t.maxTagPlaceholder,B=z===void 0?function(Xe){return"+ ".concat(Xe.length," ...")}:z,U=t.tagRender,q=t.onToggleOpen,H=t.onRemove,te=t.onInputChange,Y=t.onInputPaste,le=t.onInputKeyDown,J=t.onInputMouseDown,Z=t.onInputCompositionStart,Q=t.onInputCompositionEnd,ge=C.exports.useRef(null),re=C.exports.useState(0),de=ze(re,2),oe=de[0],ye=de[1],Re=C.exports.useState(!1),Te=ze(Re,2),ke=Te[0],De=Te[1],Me="".concat(r,"-selection"),Ne=l||b==="multiple"&&o===!1||b==="tags"?c:"",Le=b==="tags"||b==="multiple"&&o===!1||w&&(l||ke);fK(function(){ye(ge.current.scrollWidth)},[Ne]);function Ve(Xe,Pt,mt,Mt,Ct){return Qe("span",{className:Ye("".concat(Me,"-item"),se({},"".concat(Me,"-item-disabled"),mt)),title:RR(Xe),children:[E("span",{className:"".concat(Me,"-item-content"),children:Pt}),Mt&&E(gy,{className:"".concat(Me,"-item-remove"),onMouseDown:K6,onClick:Ct,customizeIcon:M,children:"\xD7"})]})}function qe(Xe,Pt,mt,Mt,Ct){var Lt=function(dt){K6(dt),q(!l)};return E("span",{onMouseDown:Lt,children:U({label:Pt,value:Xe,disabled:mt,closable:Mt,onClose:Ct})})}function Ue(Xe){var Pt=Xe.disabled,mt=Xe.label,Mt=Xe.value,Ct=!g&&!Pt,Lt=mt;if(typeof N=="number"&&(typeof mt=="string"||typeof mt=="number")){var lt=String(Lt);lt.length>N&&(Lt="".concat(lt.slice(0,N),"..."))}var dt=function(it){it&&it.stopPropagation(),H(Xe)};return typeof U=="function"?qe(Mt,Lt,Pt,Ct,dt):Ve(Xe,Lt,Pt,Ct,dt)}function ct(Xe){var Pt=typeof B=="function"?B(Xe):B;return Ve({title:Pt},Pt,!1)}var pt=Qe("div",{className:"".concat(Me,"-search"),style:{width:oe},onFocus:function(){De(!0)},onBlur:function(){De(!1)},children:[E(qC,{ref:h,open:l,prefixCls:r,id:n,inputElement:null,disabled:g,autoFocus:P,autoComplete:I,editable:Le,activeDescendantId:A,value:Ne,onKeyDown:le,onMouseDown:J,onChange:te,onPaste:Y,onCompositionStart:Z,onCompositionEnd:Q,tabIndex:O,attrs:au(t,!0)}),Qe("span",{ref:ge,className:"".concat(Me,"-search-mirror"),"aria-hidden":!0,children:[Ne,"\xA0"]})]}),Tt=E(hs,{prefixCls:"".concat(Me,"-overflow"),data:i,renderItem:Ue,renderRest:ct,suffix:pt,itemKey:hK,maxCount:R});return Qe($n,{children:[Tt,!i.length&&!Ne&&E("span",{className:"".concat(Me,"-placeholder"),children:p})]})},mK=function(t){var n=t.inputElement,r=t.prefixCls,i=t.id,l=t.inputRef,c=t.disabled,o=t.autoFocus,h=t.autoComplete,p=t.activeDescendantId,g=t.mode,b=t.open,w=t.values,P=t.placeholder,I=t.tabIndex,A=t.showSearch,O=t.searchValue,M=t.activeValue,R=t.maxLength,N=t.onInputKeyDown,z=t.onInputMouseDown,B=t.onInputChange,U=t.onInputPaste,q=t.onInputCompositionStart,H=t.onInputCompositionEnd,te=C.exports.useState(!1),Y=ze(te,2),le=Y[0],J=Y[1],Z=g==="combobox",Q=Z||A,ge=w[0],re=O||"";Z&&M&&!le&&(re=M),C.exports.useEffect(function(){Z&&J(!1)},[Z,M]);var de=g!=="combobox"&&!b&&!A?!1:!!re,oe=RR(ge),ye=function(){if(ge)return null;var Te=de?{visibility:"hidden"}:void 0;return E("span",{className:"".concat(r,"-selection-placeholder"),style:Te,children:P})};return Qe($n,{children:[E("span",{className:"".concat(r,"-selection-search"),children:E(qC,{ref:l,prefixCls:r,id:i,open:b,inputElement:n,disabled:c,autoFocus:o,autoComplete:h,editable:Q,activeDescendantId:p,value:re,onKeyDown:N,onMouseDown:z,onChange:function(Te){J(!0),B(Te)},onPaste:U,onCompositionStart:q,onCompositionEnd:H,tabIndex:I,attrs:au(t,!0),maxLength:Z?R:void 0})}),!Z&&ge&&!de&&E("span",{className:"".concat(r,"-selection-item"),title:oe,children:ge.label}),ye()]})};function vK(e){return![Et.ESC,Et.SHIFT,Et.BACKSPACE,Et.TAB,Et.WIN_KEY,Et.ALT,Et.META,Et.WIN_KEY_RIGHT,Et.CTRL,Et.SEMICOLON,Et.EQUALS,Et.CAPS_LOCK,Et.CONTEXT_MENU,Et.F1,Et.F2,Et.F3,Et.F4,Et.F5,Et.F6,Et.F7,Et.F8,Et.F9,Et.F10,Et.F11,Et.F12].includes(e)}var gK=function(t,n){var r=C.exports.useRef(null),i=C.exports.useRef(!1),l=t.prefixCls,c=t.open,o=t.mode,h=t.showSearch,p=t.tokenWithEnter,g=t.autoClearSearchValue,b=t.onSearch,w=t.onSearchSubmit,P=t.onToggleOpen,I=t.onInputKeyDown,A=t.domRef;C.exports.useImperativeHandle(n,function(){return{focus:function(){r.current.focus()},blur:function(){r.current.blur()}}});var O=kR(0),M=ze(O,2),R=M[0],N=M[1],z=function(de){var oe=de.which;(oe===Et.UP||oe===Et.DOWN)&&de.preventDefault(),I&&I(de),oe===Et.ENTER&&o==="tags"&&!i.current&&!c&&(w==null||w(de.target.value)),vK(oe)&&P(!0)},B=function(){N(!0)},U=C.exports.useRef(null),q=function(de){b(de,!0,i.current)!==!1&&P(!0)},H=function(){i.current=!0},te=function(de){i.current=!1,o!=="combobox"&&q(de.target.value)},Y=function(de){var oe=de.target.value;if(p&&U.current&&/[\r\n]/.test(U.current)){var ye=U.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");oe=oe.replace(ye,U.current)}U.current=null,q(oe)},le=function(de){var oe=de.clipboardData,ye=oe.getData("text");U.current=ye},J=function(de){var oe=de.target;if(oe!==r.current){var ye=document.body.style.msTouchAction!==void 0;ye?setTimeout(function(){r.current.focus()}):r.current.focus()}},Z=function(de){var oe=R();de.target!==r.current&&!oe&&o!=="combobox"&&de.preventDefault(),(o!=="combobox"&&(!h||!oe)||!c)&&(c&&g!==!1&&b("",!0,!1),P())},Q={inputRef:r,onInputKeyDown:z,onInputMouseDown:B,onInputChange:Y,onInputPaste:le,onInputCompositionStart:H,onInputCompositionEnd:te},ge=o==="multiple"||o==="tags"?E(pK,{...t,...Q}):E(mK,{...t,...Q});return E("div",{ref:A,className:"".concat(l,"-selector"),onClick:J,onMouseDown:Z,children:ge})},AR=C.exports.forwardRef(gK);AR.displayName="Selector";var yK=C.exports.forwardRef(function(e,t){var n=e.didUpdate,r=e.getContainer,i=e.children,l=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(),l.current=c.current.parentNode,o.current=!0),C.exports.useEffect(function(){n==null||n(e)}),C.exports.useEffect(function(){return c.current.parentNode===null&&l.current!==null&&l.current.appendChild(c.current),function(){var h,p;(h=c.current)===null||h===void 0||(p=h.parentNode)===null||p===void 0||p.removeChild(c.current)}},[]),c.current?mc.createPortal(i,c.current):null});function xK(e,t,n){return n?e[0]===t[0]:e[0]===t[0]&&e[1]===t[1]}function _K(e,t,n){var r=e[t]||{};return ve(ve({},r),n)}function bK(e,t,n,r){for(var i=n.points,l=Object.keys(e),c=0;c=0&&n.left>=0&&n.bottom>n.top&&n.right>n.left?n:null}function HK(e,t,n,r){var i=Kn.clone(e),l={width:t.width,height:t.height};return r.adjustX&&i.left=n.left&&i.left+l.width>n.right&&(l.width-=i.left+l.width-n.right),r.adjustX&&i.left+l.width>n.right&&(i.left=Math.max(n.right-l.width,n.left)),r.adjustY&&i.top=n.top&&i.top+l.height>n.bottom&&(l.height-=i.top+l.height-n.bottom),r.adjustY&&i.top+l.height>n.bottom&&(i.top=Math.max(n.bottom-l.height,n.top)),Kn.mix(i,l)}function QC(e){var t,n,r;if(!Kn.isWindow(e)&&e.nodeType!==9)t=Kn.offset(e),n=Kn.outerWidth(e),r=Kn.outerHeight(e);else{var i=Kn.getWindow(e);t={left:Kn.getWindowScrollLeft(i),top:Kn.getWindowScrollTop(i)},n=Kn.viewportWidth(i),r=Kn.viewportHeight(i)}return t.width=n,t.height=r,t}function e5(e,t){var n=t.charAt(0),r=t.charAt(1),i=e.width,l=e.height,c=e.left,o=e.top;return n==="c"?o+=l/2:n==="b"&&(o+=l),r==="c"?c+=i/2:r==="r"&&(c+=i),{left:c,top:o}}function Gv(e,t,n,r,i){var l=e5(t,n[1]),c=e5(e,n[0]),o=[c.left-l.left,c.top-l.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 t5(e,t,n){return e.leftn.right}function n5(e,t,n){return e.topn.bottom}function WK(e,t,n){return e.left>n.right||e.left+t.widthn.bottom||e.top+t.height=n.right||r.top>=n.bottom}function JC(e,t,n){var r=n.target||t,i=QC(r),l=!qK(r,n.overflow&&n.overflow.alwaysByViewport);return VR(e,i,n,l)}JC.__getOffsetParent=k2;JC.__getVisibleRectForElement=YC;function ZK(e,t,n){var r,i,l=Kn.getDocument(e),c=l.defaultView||l.parentWindow,o=Kn.getWindowScrollLeft(c),h=Kn.getWindowScrollTop(c),p=Kn.viewportWidth(c),g=Kn.viewportHeight(c);"pageX"in t?r=t.pageX:r=o+t.clientX,"pageY"in t?i=t.pageY:i=h+t.clientY;var b={left:r,top:i,width:0,height:0},w=r>=0&&r<=o+p&&i>=0&&i<=h+g,P=[n.points[0],"cc"];return VR(e,b,W6(W6({},n),{},{points:P}),w)}function e4(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=new Set;function i(l,c){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,h=r.has(l);if(Nr(!h,"Warning: There may be circular references"),h)return!1;if(l===c)return!0;if(n&&o>1)return!1;r.add(l);var p=o+1;if(Array.isArray(l)){if(!Array.isArray(c)||l.length!==c.length)return!1;for(var g=0;g1&&(Tt=E("div",{className:"".concat(r,"-content"),children:c})),E(Ca,{visible:n,ref:U,leavedClassName:"".concat(r,"-hidden"),...qe,onAppearPrepare:Ue,onEnterPrepare:Ue,removeOnLeave:p,forceRender:g,children:function(Xe,Pt){var mt=Xe.className,Mt=Xe.style,Ct=Ye(r,i,te,mt);return E(UR,{target:Ne(),ref:B,monitorWindowResize:!0,disabled:pt,align:b,onAlign:Ve,children:E("div",{ref:Pt,className:Ct,onMouseEnter:O,onMouseLeave:M,onMouseDownCapture:R,onTouchStartCapture:N,onClick:z,style:ve(ve({},Mt),ct),children:Tt})},"popup")}})});jR.displayName="PopupInner";var KR=C.exports.forwardRef(function(e,t){var n=e.prefixCls,r=e.visible,i=e.zIndex,l=e.children,c=e.mobile;c=c===void 0?{}:c;var o=c.popupClassName,h=c.popupStyle,p=c.popupMotion,g=p===void 0?{}:p,b=c.popupRender,w=e.onClick,P=C.exports.useRef();C.exports.useImperativeHandle(t,function(){return{forceAlign:function(){},getElement:function(){return P.current}}});var I=ve({zIndex:i},h),A=l;return C.exports.Children.count(l)>1&&(A=E("div",{className:"".concat(n,"-content"),children:l})),b&&(A=b(A)),E(Ca,{visible:r,ref:P,removeOnLeave:!0,...g,children:function(O,M){var R=O.className,N=O.style,z=Ye(n,o,R);return E("div",{ref:M,className:z,onClick:w,style:ve(ve({},N),I),children:A})}})});KR.displayName="MobilePopupInner";var nH=["visible","mobile"],HR=C.exports.forwardRef(function(e,t){var n=e.visible,r=e.mobile,i=In(e,nH),l=C.exports.useState(n),c=ze(l,2),o=c[0],h=c[1],p=C.exports.useState(!1),g=ze(p,2),b=g[0],w=g[1],P=ve(ve({},i),{},{visible:o});C.exports.useEffect(function(){h(n),n&&r&&w(CR())},[n,r]);var I=b?E(KR,{...P,mobile:r,ref:t}):E(jR,{...P,ref:t});return Qe("div",{children:[E(wK,{...P}),I]})});HR.displayName="Popup";var u5=C.exports.createContext(null);function l_(){}function rH(){return""}function iH(e){return e?e.ownerDocument:window.document}var oH=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function aH(e){var t=function(n){li(i,n);var r=ui(i);function i(l){var c;Kr(this,i),c=r.call(this,l),se(On(c),"popupRef",C.exports.createRef()),se(On(c),"triggerRef",C.exports.createRef()),se(On(c),"portalContainer",void 0),se(On(c),"attachId",void 0),se(On(c),"clickOutsideHandler",void 0),se(On(c),"touchOutsideHandler",void 0),se(On(c),"contextMenuOutsideHandler1",void 0),se(On(c),"contextMenuOutsideHandler2",void 0),se(On(c),"mouseDownTimeout",void 0),se(On(c),"focusTime",void 0),se(On(c),"preClickTime",void 0),se(On(c),"preTouchTime",void 0),se(On(c),"delayTimer",void 0),se(On(c),"hasPopupMouseDown",void 0),se(On(c),"onMouseEnter",function(h){var p=c.props.mouseEnterDelay;c.fireEvents("onMouseEnter",h),c.delaySetPopupVisible(!0,p,p?null:h)}),se(On(c),"onMouseMove",function(h){c.fireEvents("onMouseMove",h),c.setPoint(h)}),se(On(c),"onMouseLeave",function(h){c.fireEvents("onMouseLeave",h),c.delaySetPopupVisible(!1,c.props.mouseLeaveDelay)}),se(On(c),"onPopupMouseEnter",function(){c.clearDelayTimer()}),se(On(c),"onPopupMouseLeave",function(h){var p;h.relatedTarget&&!h.relatedTarget.setTimeout&&uc((p=c.popupRef.current)===null||p===void 0?void 0:p.getElement(),h.relatedTarget)||c.delaySetPopupVisible(!1,c.props.mouseLeaveDelay)}),se(On(c),"onFocus",function(h){c.fireEvents("onFocus",h),c.clearDelayTimer(),c.isFocusToShow()&&(c.focusTime=Date.now(),c.delaySetPopupVisible(!0,c.props.focusDelay))}),se(On(c),"onMouseDown",function(h){c.fireEvents("onMouseDown",h),c.preClickTime=Date.now()}),se(On(c),"onTouchStart",function(h){c.fireEvents("onTouchStart",h),c.preTouchTime=Date.now()}),se(On(c),"onBlur",function(h){c.fireEvents("onBlur",h),c.clearDelayTimer(),c.isBlurToHide()&&c.delaySetPopupVisible(!1,c.props.blurDelay)}),se(On(c),"onContextMenu",function(h){h.preventDefault(),c.fireEvents("onContextMenu",h),c.setPopupVisible(!0,h)}),se(On(c),"onContextMenuClose",function(){c.isContextMenuToShow()&&c.close()}),se(On(c),"onClick",function(h){if(c.fireEvents("onClick",h),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())&&h&&h.preventDefault&&h.preventDefault();var g=!c.state.popupVisible;(c.isClickToHide()&&!g||g&&c.isClickToShow())&&c.setPopupVisible(!c.state.popupVisible,h)}),se(On(c),"onPopupMouseDown",function(){if(c.hasPopupMouseDown=!0,clearTimeout(c.mouseDownTimeout),c.mouseDownTimeout=window.setTimeout(function(){c.hasPopupMouseDown=!1},0),c.context){var h;(h=c.context).onPopupMouseDown.apply(h,arguments)}}),se(On(c),"onDocumentClick",function(h){if(!(c.props.mask&&!c.props.maskClosable)){var p=h.target,g=c.getRootDomNode(),b=c.getPopupDomNode();(!uc(g,p)||c.isContextMenuOnly())&&!uc(b,p)&&!c.hasPopupMouseDown&&c.close()}}),se(On(c),"getRootDomNode",function(){var h=c.props.getTriggerDOMNode;if(h)return h(c.triggerRef.current);try{var p=kp(c.triggerRef.current);if(p)return p}catch{}return mc.findDOMNode(On(c))}),se(On(c),"getPopupClassNameFromAlign",function(h){var p=[],g=c.props,b=g.popupPlacement,w=g.builtinPlacements,P=g.prefixCls,I=g.alignPoint,A=g.getPopupClassNameFromAlign;return b&&w&&p.push(bK(w,P,h,I)),A&&p.push(A(h)),p.join(" ")}),se(On(c),"getComponent",function(){var h=c.props,p=h.prefixCls,g=h.destroyPopupOnHide,b=h.popupClassName,w=h.onPopupAlign,P=h.popupMotion,I=h.popupAnimation,A=h.popupTransitionName,O=h.popupStyle,M=h.mask,R=h.maskAnimation,N=h.maskTransitionName,z=h.maskMotion,B=h.zIndex,U=h.popup,q=h.stretch,H=h.alignPoint,te=h.mobile,Y=h.forceRender,le=h.onPopupClick,J=c.state,Z=J.popupVisible,Q=J.point,ge=c.getPopupAlign(),re={};return c.isMouseEnterToShow()&&(re.onMouseEnter=c.onPopupMouseEnter),c.isMouseLeaveToHide()&&(re.onMouseLeave=c.onPopupMouseLeave),re.onMouseDown=c.onPopupMouseDown,re.onTouchStart=c.onPopupMouseDown,E(HR,{prefixCls:p,destroyPopupOnHide:g,visible:Z,point:H&&Q,className:b,align:ge,onAlign:w,animation:I,getClassNameFromAlign:c.getPopupClassNameFromAlign,...re,stretch:q,getRootDomNode:c.getRootDomNode,style:O,mask:M,zIndex:B,transitionName:A,maskAnimation:R,maskTransitionName:N,maskMotion:z,ref:c.popupRef,motion:P,mobile:te,forceRender:Y,onClick:le,children:typeof U=="function"?U():U})}),se(On(c),"attachParent",function(h){nr.cancel(c.attachId);var p=c.props,g=p.getPopupContainer,b=p.getDocument,w=c.getRootDomNode(),P;g?(w||g.length===0)&&(P=g(w)):P=b(c.getRootDomNode()).body,P?P.appendChild(h):c.attachId=nr(function(){c.attachParent(h)})}),se(On(c),"getContainer",function(){if(!c.portalContainer){var h=c.props.getDocument,p=h(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}),se(On(c),"setPoint",function(h){var p=c.props.alignPoint;!p||!h||c.setState({point:{pageX:h.pageX,pageY:h.pageY}})}),se(On(c),"handlePortalUpdate",function(){c.state.prevPopupVisible!==c.state.popupVisible&&c.props.afterPopupVisibleChange(c.state.popupVisible)}),se(On(c),"triggerContextValue",{onPopupMouseDown:c.onPopupMouseDown});var o;return"popupVisible"in l?o=!!l.popupVisible:o=!!l.defaultPopupVisible,c.state={prevPopupVisible:o,popupVisible:o},oH.forEach(function(h){c["fire".concat(h)]=function(p){c.fireEvents(h,p)}}),c}return Hr(i,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var c=this.props,o=this.state;if(o.popupVisible){var h;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(h=c.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Hs(h,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(h=h||c.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Hs(h,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(h=h||c.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Hs(h,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Hs(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,h=c.popupAlign,p=c.builtinPlacements;return o&&p?_K(p,o,h):h}},{key:"setPopupVisible",value:function(c,o){var h=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)),h&&o&&c&&this.setPoint(o)}},{key:"delaySetPopupVisible",value:function(c,o,h){var p=this,g=o*1e3;if(this.clearDelayTimer(),g){var b=h?{pageX:h.pageX,pageY:h.pageY}:null;this.delayTimer=window.setTimeout(function(){p.setPopupVisible(c,b),p.clearDelayTimer()},g)}else this.setPopupVisible(c,h)}},{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,h=this.props;return o[c]&&h[c]?this["fire".concat(c)]:o[c]||h[c]}},{key:"isClickToShow",value:function(){var c=this.props,o=c.action,h=c.showAction;return o.indexOf("click")!==-1||h.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,h=c.showAction;return o.indexOf("contextMenu")!==-1||h.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var c=this.props,o=c.action,h=c.hideAction;return o.indexOf("click")!==-1||h.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var c=this.props,o=c.action,h=c.showAction;return o.indexOf("hover")!==-1||h.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var c=this.props,o=c.action,h=c.hideAction;return o.indexOf("hover")!==-1||h.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var c=this.props,o=c.action,h=c.showAction;return o.indexOf("focus")!==-1||h.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var c=this.props,o=c.action,h=c.hideAction;return o.indexOf("focus")!==-1||h.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 h=this.props.children.props[c];h&&h(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,h=o.children,p=o.forceRender,g=o.alignPoint,b=o.className,w=o.autoDestroy,P=C.exports.Children.only(h),I={key:"trigger"};this.isContextMenuToShow()?I.onContextMenu=this.onContextMenu:I.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(I.onClick=this.onClick,I.onMouseDown=this.onMouseDown,I.onTouchStart=this.onTouchStart):(I.onClick=this.createTwoChains("onClick"),I.onMouseDown=this.createTwoChains("onMouseDown"),I.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(I.onMouseEnter=this.onMouseEnter,g&&(I.onMouseMove=this.onMouseMove)):I.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?I.onMouseLeave=this.onMouseLeave:I.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(I.onFocus=this.onFocus,I.onBlur=this.onBlur):(I.onFocus=this.createTwoChains("onFocus"),I.onBlur=this.createTwoChains("onBlur"));var A=Ye(P&&P.props&&P.props.className,b);A&&(I.className=A);var O=ve({},I);Sc(P)&&(O.ref=Lo(this.triggerRef,P.ref));var M=C.exports.cloneElement(P,O),R;return(c||this.popupRef.current||p)&&(R=E(e,{getContainer:this.getContainer,didUpdate:this.handlePortalUpdate,children:this.getComponent()},"portal")),!c&&w&&(R=null),Qe(u5.Provider,{value:this.triggerContextValue,children:[M,R]})}}],[{key:"getDerivedStateFromProps",value:function(c,o){var h=c.popupVisible,p={};return h!==void 0&&o.popupVisible!==h&&(p.popupVisible=h,p.prevPopupVisible=o.popupVisible),p}}]),i}(C.exports.Component);return se(t,"contextType",u5),se(t,"defaultProps",{prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:rH,getDocument:iH,onPopupVisibleChange:l_,afterPopupVisibleChange:l_,onPopupAlign:l_,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 O0=aH(yK);var sH=["prefixCls","disabled","visible","children","popupElement","containerWidth","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],lH=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}}}},uH=function(t,n){var r=t.prefixCls;t.disabled;var i=t.visible,l=t.children,c=t.popupElement,o=t.containerWidth,h=t.animation,p=t.transitionName,g=t.dropdownStyle,b=t.dropdownClassName,w=t.direction,P=w===void 0?"ltr":w,I=t.placement,A=t.dropdownMatchSelectWidth,O=t.dropdownRender,M=t.dropdownAlign,R=t.getPopupContainer,N=t.empty,z=t.getTriggerDOMNode,B=t.onPopupVisibleChange,U=t.onPopupMouseEnter,q=In(t,sH),H="".concat(r,"-dropdown"),te=c;O&&(te=O(c));var Y=C.exports.useMemo(function(){return lH(A)},[A]),le=h?"".concat(H,"-").concat(h):p,J=C.exports.useRef(null);C.exports.useImperativeHandle(n,function(){return{getPopupElement:function(){return J.current}}});var Z=ve({minWidth:o},g);return typeof A=="number"?Z.width=A:A&&(Z.width=o),E(O0,{...q,showAction:B?["click"]:[],hideAction:B?["click"]:[],popupPlacement:I||(P==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:Y,prefixCls:H,popupTransitionName:le,popup:E("div",{ref:J,onMouseEnter:U,children:te}),popupAlign:M,popupVisible:i,getPopupContainer:R,popupClassName:Ye(b,se({},"".concat(H,"-empty"),N)),popupStyle:Z,getTriggerDOMNode:z,onPopupVisibleChange:B,children:l})},WR=C.exports.forwardRef(uH);WR.displayName="SelectTrigger";function c5(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 GR(e,t){var n=e||{},r=n.label,i=n.value,l=n.options;return{label:r||(t?"children":"label"),value:i||"value",options:l||"options"}}function cH(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.fieldNames,r=t.childrenAsData,i=[],l=GR(n,!1),c=l.label,o=l.value,h=l.options;function p(g,b){g.forEach(function(w){var P=w[c];if(b||!(h in w)){var I=w[o];i.push({key:c5(w,i.length),groupOption:b,data:w,label:P,value:I})}else{var A=P;A===void 0&&r&&(A=w.label),i.push({key:c5(w,i.length),group:!0,data:w,label:A}),p(w[h],!0)}})}return p(e,!1),i}function T2(e){var t=ve({},e);return"props"in t||Object.defineProperty(t,"props",{get:function(){return Nr(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),t}}),t}function dH(e,t){if(!t||!t.length)return null;var n=!1;function r(l,c){var o=OC(c),h=o[0],p=o.slice(1);if(!h)return[l];var g=l.split(h);return n=n||g.length>1,g.reduce(function(b,w){return[].concat(wt(b),wt(r(w,p)))},[]).filter(function(b){return b})}var i=r(e,t);return n?i:null}var fH=["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"],hH=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"];function P2(e){return e==="tags"||e==="multiple"}var qR=C.exports.forwardRef(function(e,t){var n,r,i=e.id,l=e.prefixCls,c=e.className,o=e.showSearch,h=e.tagRender,p=e.direction,g=e.omitDomProps,b=e.displayValues,w=e.onDisplayValuesChange,P=e.emptyOptions,I=e.notFoundContent,A=I===void 0?"Not Found":I,O=e.onClear,M=e.mode,R=e.disabled,N=e.loading,z=e.getInputElement,B=e.getRawInputElement,U=e.open,q=e.defaultOpen,H=e.onDropdownVisibleChange,te=e.activeValue,Y=e.onActiveValueChange,le=e.activeDescendantId,J=e.searchValue,Z=e.autoClearSearchValue,Q=e.onSearch,ge=e.onSearchSplit,re=e.tokenSeparators,de=e.allowClear,oe=e.showArrow,ye=e.inputIcon,Re=e.clearIcon,Te=e.OptionList,ke=e.animation,De=e.transitionName,Me=e.dropdownStyle,Ne=e.dropdownClassName,Le=e.dropdownMatchSelectWidth,Ve=e.dropdownRender,qe=e.dropdownAlign,Ue=e.placement,ct=e.getPopupContainer,pt=e.showAction,Tt=pt===void 0?[]:pt,Xe=e.onFocus,Pt=e.onBlur,mt=e.onKeyUp,Mt=e.onKeyDown,Ct=e.onMouseDown,Lt=In(e,fH),lt=P2(M),dt=(o!==void 0?o:lt)||M==="combobox",ut=ve({},Lt);hH.forEach(function(Pn){delete ut[Pn]}),g==null||g.forEach(function(Pn){delete ut[Pn]});var it=C.exports.useState(!1),ft=ze(it,2),xt=ft[0],Wt=ft[1];C.exports.useEffect(function(){Wt(CR())},[]);var Ut=C.exports.useRef(null),Qt=C.exports.useRef(null),Fe=C.exports.useRef(null),Ge=C.exports.useRef(null),Xt=C.exports.useRef(null),dn=Hj(),Vt=ze(dn,3),jt=Vt[0],nn=Vt[1],_n=Vt[2];C.exports.useImperativeHandle(t,function(){var Pn,Sn;return{focus:(Pn=Ge.current)===null||Pn===void 0?void 0:Pn.focus,blur:(Sn=Ge.current)===null||Sn===void 0?void 0:Sn.blur,scrollTo:function(Wr){var vr;return(vr=Xt.current)===null||vr===void 0?void 0:vr.scrollTo(Wr)}}});var An=C.exports.useMemo(function(){var Pn;if(M!=="combobox")return J;var Sn=(Pn=b[0])===null||Pn===void 0?void 0:Pn.value;return typeof Sn=="string"||typeof Sn=="number"?String(Sn):""},[J,M,b]),_t=M==="combobox"&&typeof z=="function"&&z()||null,Gt=typeof B=="function"&&B(),an=VI(Qt,Gt==null||(n=Gt.props)===null||n===void 0?void 0:n.ref),Fn=Vi(void 0,{defaultValue:q,value:U}),kn=ze(Fn,2),zt=kn[0],Tn=kn[1],Cn=zt,hn=!A&&P;(R||hn&&Cn&&M==="combobox")&&(Cn=!1);var Nt=hn?!1:Cn,ot=C.exports.useCallback(function(Pn){var Sn=Pn!==void 0?Pn:!Cn;R||(Tn(Sn),Cn!==Sn&&(H==null||H(Sn)))},[R,Cn,Tn,H]),ht=C.exports.useMemo(function(){return(re||[]).some(function(Pn){return[` `,`\r `].includes(Pn)})},[re]),At=function(Sn,Rn,Wr){var vr=!0,jn=Sn;Y==null||Y(null);var Ln=Wr?null:dH(Sn,re);return M!=="combobox"&&Ln&&(jn="",ge==null||ge(Ln),ot(!1),vr=!1),Q&&An!==jn&&Q(jn,{source:Rn?"typing":"effect"}),vr},$t=function(Sn){!Sn||!Sn.trim()||Q(Sn,{source:"submit"})};C.exports.useEffect(function(){!Cn&&!lt&&M!=="combobox"&&At("",!1,!1)},[Cn]),C.exports.useEffect(function(){zt&&R&&Tn(!1),R&&nn(!1)},[R]);var cn=kR(),Mn=ze(cn,2),Gn=Mn[0],qn=Mn[1],me=function(Sn){var Rn=Gn(),Wr=Sn.which;if(Wr===Et.ENTER&&(M!=="combobox"&&Sn.preventDefault(),Cn||ot(!0)),qn(!!An),Wr===Et.BACKSPACE&&!Rn&<&&!An&&b.length){for(var vr=wt(b),jn=null,Ln=vr.length-1;Ln>=0;Ln-=1){var Yn=vr[Ln];if(!Yn.disabled){vr.splice(Ln,1),jn=Yn;break}}jn&&w(vr,{type:"remove",values:[jn]})}for(var xr=arguments.length,br=new Array(xr>1?xr-1:0),Lr=1;Lr1?Rn-1:0),vr=1;vr1?Ln-1:0),xr=1;xr1&&arguments[1]!==void 0?arguments[1]:!1;return Xi(e).map(function(n,r){if(!C.exports.isValidElement(n)||!n.type)return null;var i=n,l=i.type.isSelectOptGroup,c=i.key,o=i.props,h=o.children,p=In(o,xH);return t||!l?_H(n):ve(ve({key:"__RC_SELECT_GRP__".concat(c===null?r:c,"__"),label:c},p),{},{options:XR(h)})}).filter(function(n){return n})}function bH(e,t,n,r,i){return C.exports.useMemo(function(){var l=e,c=!e;c&&(l=XR(t));var o=new Map,h=new Map,p=function(w,P,I){I&&typeof I=="string"&&w.set(P[I],P)};function g(b){for(var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,P=0;Ph},r}return Hr(n,[{key:"componentDidMount",value:function(){this.scrollbarRef.current.addEventListener("touchstart",this.onScrollbarTouchStart),this.thumbRef.current.addEventListener("touchstart",this.onMouseDown)}},{key:"componentDidUpdate",value:function(i){i.scrollTop!==this.props.scrollTop&&this.delayHidden()}},{key:"componentWillUnmount",value:function(){this.removeEvents(),clearTimeout(this.visibleTimeout)}},{key:"render",value:function(){var i=this.state,l=i.dragging,c=i.visible,o=this.props.prefixCls,h=this.getSpinHeight(),p=this.getTop(),g=this.showScroll(),b=g&&c;return E("div",{ref:this.scrollbarRef,className:Ye("".concat(o,"-scrollbar"),se({},"".concat(o,"-scrollbar-show"),g)),style:{width:8,top:0,bottom:0,right:0,position:"absolute",display:b?null:"none"},onMouseDown:this.onContainerMouseDown,onMouseMove:this.delayHidden,children:E("div",{ref:this.thumbRef,className:Ye("".concat(o,"-scrollbar-thumb"),se({},"".concat(o,"-scrollbar-thumb-moving"),l)),style:{width:"100%",height:h,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 SH(e){var t=e.children,n=e.setRef,r=C.exports.useCallback(function(i){n(i)},[]);return C.exports.cloneElement(t,{ref:r})}function EH(e,t,n,r,i,l){var c=l.getKey;return e.slice(t,n+1).map(function(o,h){var p=t+h,g=i(o,p,{}),b=c(o);return E(SH,{setRef:function(P){return r(o,P)},children:g},b)})}var kH=function(){function e(){Kr(this,e),this.maps=void 0,this.maps=Object.create(null)}return Hr(e,[{key:"set",value:function(n,r){this.maps[n]=r}},{key:"get",value:function(n){return this.maps[n]}}]),e}();function TH(e,t,n){var r=C.exports.useState(0),i=ze(r,2),l=i[0],c=i[1],o=C.exports.useRef(new Map),h=C.exports.useRef(new kH),p=C.exports.useRef();function g(){nr.cancel(p.current)}function b(){g(),p.current=nr(function(){o.current.forEach(function(P,I){if(P&&P.offsetParent){var A=kp(P),O=A.offsetHeight;h.current.get(I)!==O&&h.current.set(I,A.offsetHeight)}}),c(function(P){return P+1})})}function w(P,I){var A=e(P),O=o.current.get(A);I?(o.current.set(A,I),b()):o.current.delete(A),!O!=!I&&(I?t==null||t(P):n==null||n(P))}return C.exports.useEffect(function(){return g},[]),[w,b,h.current,l]}function PH(e,t,n,r,i,l,c,o){var h=C.exports.useRef();return function(p){if(p==null){o();return}if(nr.cancel(h.current),typeof p=="number")c(p);else if(p&&sn(p)==="object"){var g,b=p.align;"index"in p?g=p.index:g=t.findIndex(function(A){return i(A)===p.key});var w=p.offset,P=w===void 0?0:w,I=function A(O,M){if(!(O<0||!e.current)){var R=e.current.clientHeight,N=!1,z=M;if(R){for(var B=M||b,U=0,q=0,H=0,te=Math.min(t.length,g),Y=0;Y<=te;Y+=1){var le=i(t[Y]);q=U;var J=n.get(le);H=q+(J===void 0?r:J),U=H,Y===g&&J===void 0&&(N=!0)}var Z=null;switch(B){case"top":Z=q-P;break;case"bottom":Z=H-R+P;break;default:{var Q=e.current.scrollTop,ge=Q+R;qge&&(z="bottom")}}Z!==null&&Z!==e.current.scrollTop&&c(Z)}h.current=nr(function(){N&&l(),A(O-1,z)},2)}};I(3)}}}function IH(e,t,n){var r=e.length,i=t.length,l,c;if(r===0&&i===0)return null;r"u"?"undefined":sn(navigator))==="object"&&/Firefox/i.test(navigator.userAgent);const QR=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 l=C.exports.useRef({top:e,bottom:t});return l.current.top=e,l.current.bottom=t,function(c){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,h=c<0&&l.current.top||c>0&&l.current.bottom;return o&&h?(clearTimeout(r.current),n.current=!1):(!h||n.current)&&i(),!n.current&&h}};function AH(e,t,n,r){var i=C.exports.useRef(0),l=C.exports.useRef(null),c=C.exports.useRef(null),o=C.exports.useRef(!1),h=QR(t,n);function p(b){if(!!e){nr.cancel(l.current);var w=b.deltaY;i.current+=w,c.current=w,!h(w)&&(RH||b.preventDefault(),l.current=nr(function(){var P=o.current?10:1;r(i.current*P),i.current=0}))}}function g(b){!e||(o.current=b.detail===c.current)}return[p,g]}var OH=14/15;function NH(e,t,n){var r=C.exports.useRef(!1),i=C.exports.useRef(0),l=C.exports.useRef(null),c=C.exports.useRef(null),o,h=function(w){if(r.current){var P=Math.ceil(w.touches[0].pageY),I=i.current-P;i.current=P,n(I)&&w.preventDefault(),clearInterval(c.current),c.current=setInterval(function(){I*=OH,(!n(I,!0)||Math.abs(I)<=.1)&&clearInterval(c.current)},16)}},p=function(){r.current=!1,o()},g=function(w){o(),w.touches.length===1&&!r.current&&(r.current=!0,i.current=Math.ceil(w.touches[0].pageY),l.current=w.target,l.current.addEventListener("touchmove",h),l.current.addEventListener("touchend",p))};o=function(){l.current&&(l.current.removeEventListener("touchmove",h),l.current.removeEventListener("touchend",p))},si(function(){return e&&t.current.addEventListener("touchstart",g),function(){var b;(b=t.current)===null||b===void 0||b.removeEventListener("touchstart",g),o(),clearInterval(c.current)}},[e])}var DH=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","component","onScroll","onVisibleChange","innerProps"],LH=[],zH={overflowY:"auto",overflowAnchor:"none"};function FH(e,t){var n=e.prefixCls,r=n===void 0?"rc-virtual-list":n,i=e.className,l=e.height,c=e.itemHeight,o=e.fullHeight,h=o===void 0?!0:o,p=e.style,g=e.data,b=e.children,w=e.itemKey,P=e.virtual,I=e.component,A=I===void 0?"div":I,O=e.onScroll,M=e.onVisibleChange,R=e.innerProps,N=In(e,DH),z=!!(P!==!1&&l&&c),B=z&&g&&c*g.length>l,U=C.exports.useState(0),q=ze(U,2),H=q[0],te=q[1],Y=C.exports.useState(!1),le=ze(Y,2),J=le[0],Z=le[1],Q=Ye(r,i),ge=g||LH,re=C.exports.useRef(),de=C.exports.useRef(),oe=C.exports.useRef(),ye=C.exports.useCallback(function(jt){return typeof w=="function"?w(jt):jt==null?void 0:jt[w]},[w]),Re={getKey:ye};function Te(jt){te(function(nn){var _n;typeof jt=="function"?_n=jt(nn):_n=jt;var An=dt(_n);return re.current.scrollTop=An,An})}var ke=C.exports.useRef({start:0,end:ge.length}),De=C.exports.useRef(),Me=MH(ge,ye),Ne=ze(Me,1),Le=Ne[0];De.current=Le;var Ve=TH(ye,null,null),qe=ze(Ve,4),Ue=qe[0],ct=qe[1],pt=qe[2],Tt=qe[3],Xe=C.exports.useMemo(function(){if(!z)return{scrollHeight:void 0,start:0,end:ge.length-1,offset:void 0};if(!B){var jt;return{scrollHeight:((jt=de.current)===null||jt===void 0?void 0:jt.offsetHeight)||0,start:0,end:ge.length-1,offset:void 0}}for(var nn=0,_n,An,_t,Gt=ge.length,an=0;an=H&&_n===void 0&&(_n=an,An=nn),Tn>H+l&&_t===void 0&&(_t=an),nn=Tn}return _n===void 0&&(_n=0,An=0,_t=Math.ceil(l/c)),_t===void 0&&(_t=ge.length-1),_t=Math.min(_t+1,ge.length),{scrollHeight:nn,start:_n,end:_t,offset:An}},[B,z,H,ge,Tt,l]),Pt=Xe.scrollHeight,mt=Xe.start,Mt=Xe.end,Ct=Xe.offset;ke.current.start=mt,ke.current.end=Mt;var Lt=Pt-l,lt=C.exports.useRef(Lt);lt.current=Lt;function dt(jt){var nn=jt;return Number.isNaN(lt.current)||(nn=Math.min(nn,lt.current)),nn=Math.max(nn,0),nn}var ut=H<=0,it=H>=Lt,ft=QR(ut,it);function xt(jt){var nn=jt;Te(nn)}function Wt(jt){var nn=jt.currentTarget.scrollTop;nn!==H&&Te(nn),O==null||O(jt)}var Ut=AH(z,ut,it,function(jt){Te(function(nn){var _n=nn+jt;return _n})}),Qt=ze(Ut,2),Fe=Qt[0],Ge=Qt[1];NH(z,re,function(jt,nn){return ft(jt,nn)?!1:(Fe({preventDefault:function(){},deltaY:jt}),!0)}),si(function(){function jt(nn){z&&nn.preventDefault()}return re.current.addEventListener("wheel",Fe),re.current.addEventListener("DOMMouseScroll",Ge),re.current.addEventListener("MozMousePixelScroll",jt),function(){re.current&&(re.current.removeEventListener("wheel",Fe),re.current.removeEventListener("DOMMouseScroll",Ge),re.current.removeEventListener("MozMousePixelScroll",jt))}},[z]);var Xt=PH(re,ge,pt,c,ye,ct,Te,function(){var jt;(jt=oe.current)===null||jt===void 0||jt.delayHidden()});C.exports.useImperativeHandle(t,function(){return{scrollTo:Xt}}),si(function(){if(M){var jt=ge.slice(mt,Mt+1);M(jt,ge)}},[mt,Mt,ge]);var dn=EH(ge,mt,Mt,Ue,b,Re),Vt=null;return l&&(Vt=ve(se({},h?"height":"maxHeight",l),zH),z&&(Vt.overflowY="hidden",J&&(Vt.pointerEvents="none"))),Qe("div",{style:ve(ve({},p),{},{position:"relative"}),className:Q,...N,children:[E(A,{className:"".concat(r,"-holder"),style:Vt,ref:re,onScroll:Wt,children:E(YR,{prefixCls:r,height:Pt,offset:Ct,onInnerResize:ct,ref:de,innerProps:R,children:dn})}),z&&E(CH,{ref:oe,prefixCls:r,scrollTop:H,height:l,scrollHeight:Pt,count:ge.length,onScroll:xt,onStartMove:function(){Z(!0)},onStopMove:function(){Z(!1)}})]})}var i4=C.exports.forwardRef(FH);i4.displayName="List";function $H(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var JR=C.exports.createContext(null),BH=["disabled","title","children","style","className"];function p5(e){return typeof e=="string"||typeof e=="number"}var VH=function(t,n){var r=ER(),i=r.prefixCls,l=r.id,c=r.open,o=r.multiple,h=r.mode,p=r.searchValue,g=r.toggleOpen,b=r.notFoundContent,w=r.onPopupScroll,P=C.exports.useContext(JR),I=P.flattenOptions,A=P.onActiveValue,O=P.defaultActiveFirstOption,M=P.onSelect,R=P.menuItemSelectedIcon,N=P.rawValues,z=P.fieldNames,B=P.virtual,U=P.listHeight,q=P.listItemHeight,H="".concat(i,"-item"),te=Kp(function(){return I},[c,I],function(Me,Ne){return Ne[0]&&Me[1]!==Ne[1]}),Y=C.exports.useRef(null),le=function(Ne){Ne.preventDefault()},J=function(Ne){Y.current&&Y.current.scrollTo(typeof Ne=="number"?{index:Ne}:Ne)},Z=function(Ne){for(var Le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Ve=te.length,qe=0;qe1&&arguments[1]!==void 0?arguments[1]:!1;de(Ne);var Ve={source:Le?"keyboard":"mouse"},qe=te[Ne];if(!qe){A(null,-1,Ve);return}A(qe.value,Ne,Ve)};C.exports.useEffect(function(){oe(O!==!1?Z(0):-1)},[te.length,p]);var ye=C.exports.useCallback(function(Me){return N.has(Me)&&h!=="combobox"},[h,wt(N).toString(),N.size]);C.exports.useEffect(function(){var Me=setTimeout(function(){if(!o&&c&&N.size===1){var Le=Array.from(N)[0],Ve=te.findIndex(function(qe){var Ue=qe.data;return Ue.value===Le});Ve!==-1&&(oe(Ve),J(Ve))}});if(c){var Ne;(Ne=Y.current)===null||Ne===void 0||Ne.scrollTo(void 0)}return function(){return clearTimeout(Me)}},[c,p]);var Re=function(Ne){Ne!==void 0&&M(Ne,{selected:!N.has(Ne)}),o||g(!1)};if(C.exports.useImperativeHandle(n,function(){return{onKeyDown:function(Ne){var Le=Ne.which,Ve=Ne.ctrlKey;switch(Le){case Et.N:case Et.P:case Et.UP:case Et.DOWN:{var qe=0;if(Le===Et.UP?qe=-1:Le===Et.DOWN?qe=1:$H()&&Ve&&(Le===Et.N?qe=1:Le===Et.P&&(qe=-1)),qe!==0){var Ue=Z(re+qe,qe);J(Ue),oe(Ue,!0)}break}case Et.ENTER:{var ct=te[re];ct&&!ct.data.disabled?Re(ct.value):Re(void 0),c&&Ne.preventDefault();break}case Et.ESC:g(!1),c&&Ne.stopPropagation()}},onKeyUp:function(){},scrollTo:function(Ne){J(Ne)}}}),te.length===0)return E("div",{role:"listbox",id:"".concat(l,"_list"),className:"".concat(H,"-empty"),onMouseDown:le,children:b});var Te=Object.keys(z).map(function(Me){return z[Me]}),ke=function(Ne){return Ne.label},De=function(Ne){var Le=te[Ne];if(!Le)return null;var Ve=Le.data||{},qe=Ve.value,Ue=Le.group,ct=au(Ve,!0),pt=ke(Le);return Le?C.exports.createElement("div",{"aria-label":typeof pt=="string"&&!Ue?pt:null,...ct,key:Ne,role:Ue?"presentation":"option",id:"".concat(l,"_list_").concat(Ne),"aria-selected":ye(qe)},qe):null};return Qe($n,{children:[Qe("div",{role:"listbox",id:"".concat(l,"_list"),style:{height:0,width:0,overflow:"hidden"},children:[De(re-1),De(re),De(re+1)]}),E(i4,{itemKey:"key",ref:Y,data:te,height:U,itemHeight:q,fullHeight:!1,onMouseDown:le,onScroll:w,virtual:B,children:function(Me,Ne){var Le,Ve=Me.group,qe=Me.groupOption,Ue=Me.data,ct=Me.label,pt=Me.value,Tt=Ue.key;if(Ve){var Xe,Pt=(Xe=Ue.title)!==null&&Xe!==void 0?Xe:p5(ct)?ct.toString():void 0;return E("div",{className:Ye(H,"".concat(H,"-group")),title:Pt,children:ct!==void 0?ct:Tt})}var mt=Ue.disabled,Mt=Ue.title;Ue.children;var Ct=Ue.style,Lt=Ue.className,lt=In(Ue,BH),dt=mi(lt,Te),ut=ye(pt),it="".concat(H,"-option"),ft=Ye(H,it,Lt,(Le={},se(Le,"".concat(it,"-grouped"),qe),se(Le,"".concat(it,"-active"),re===Ne&&!mt),se(Le,"".concat(it,"-disabled"),mt),se(Le,"".concat(it,"-selected"),ut),Le)),xt=ke(Me),Wt=!R||typeof R=="function"||ut,Ut=typeof xt=="number"?xt:xt||pt,Qt=p5(Ut)?Ut.toString():void 0;return Mt!==void 0&&(Qt=Mt),Qe("div",{...au(dt),"aria-selected":ut,className:ft,title:Qt,onMouseMove:function(){re===Ne||mt||oe(Ne)},onClick:function(){mt||Re(pt)},style:Ct,children:[E("div",{className:"".concat(it,"-content"),children:Ut}),C.exports.isValidElement(R)||ut,Wt&&E(gy,{className:"".concat(H,"-option-state"),customizeIcon:R,customizeIconProps:{isSelected:ut},children:ut?"\u2713":null})]})}})]})},e7=C.exports.forwardRef(VH);e7.displayName="OptionList";var UH=["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"],jH=["inputValue"];function KH(e){return!e||sn(e)!=="object"}var HH=C.exports.forwardRef(function(e,t){var n=e.id,r=e.mode,i=e.prefixCls,l=i===void 0?"rc-select":i,c=e.backfill,o=e.fieldNames,h=e.inputValue,p=e.searchValue,g=e.onSearch,b=e.autoClearSearchValue,w=b===void 0?!0:b,P=e.onSelect,I=e.onDeselect,A=e.dropdownMatchSelectWidth,O=A===void 0?!0:A,M=e.filterOption,R=e.filterSort,N=e.optionFilterProp,z=e.optionLabelProp,B=e.options,U=e.children,q=e.defaultActiveFirstOption,H=e.menuItemSelectedIcon,te=e.virtual,Y=e.listHeight,le=Y===void 0?200:Y,J=e.listItemHeight,Z=J===void 0?20:J,Q=e.value,ge=e.defaultValue,re=e.labelInValue,de=e.onChange,oe=In(e,UH),ye=ZR(n),Re=P2(r),Te=!!(!B&&U),ke=C.exports.useMemo(function(){return M===void 0&&r==="combobox"?!1:M},[M,r]),De=C.exports.useMemo(function(){return GR(o,Te)},[JSON.stringify(o),Te]),Me=Vi("",{value:p!==void 0?p:h,postState:function(ht){return ht||""}}),Ne=ze(Me,2),Le=Ne[0],Ve=Ne[1],qe=bH(B,U,De,N,z),Ue=qe.valueOptions,ct=qe.labelOptions,pt=qe.options,Tt=C.exports.useCallback(function(ot){var ht=MR(ot);return ht.map(function(At){var $t,cn,Mn,Gn,qn;if(KH(At))$t=At;else{var me;Mn=At.key,cn=At.label,$t=(me=At.value)!==null&&me!==void 0?me:Mn}var K=Ue.get($t);if(K){var G;cn===void 0&&(cn=K==null?void 0:K[z||De.label]),Mn===void 0&&(Mn=(G=K==null?void 0:K.key)!==null&&G!==void 0?G:$t),Gn=K==null?void 0:K.disabled,qn=K==null?void 0:K.title}return{label:cn,value:$t,key:Mn,disabled:Gn,title:qn}})},[De,z,Ue]),Xe=Vi(ge,{value:Q}),Pt=ze(Xe,2),mt=Pt[0],Mt=Pt[1],Ct=C.exports.useMemo(function(){var ot,ht=Tt(mt);return r==="combobox"&&!((ot=ht[0])!==null&&ot!==void 0&&ot.value)?[]:ht},[mt,Tt,r]),Lt=pH(Ct,Ue),lt=ze(Lt,2),dt=lt[0],ut=lt[1],it=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(ht){var At;return ve(ve({},ht),{},{label:(At=ht.label)!==null&&At!==void 0?At:ht.value})})},[r,dt]),ft=C.exports.useMemo(function(){return new Set(dt.map(function(ot){return ot.value}))},[dt]);C.exports.useEffect(function(){if(r==="combobox"){var ot,ht=(ot=dt[0])===null||ot===void 0?void 0:ot.value;Ve(dK(ht)?String(ht):"")}},[dt]);var xt=f5(function(ot,ht){var At,$t=ht!=null?ht:ot;return At={},se(At,De.value,ot),se(At,De.label,$t),At}),Wt=C.exports.useMemo(function(){if(r!=="tags")return pt;var ot=wt(pt),ht=function($t){return Ue.has($t)};return wt(dt).sort(function(At,$t){return At.value<$t.value?-1:1}).forEach(function(At){var $t=At.value;ht($t)||ot.push(xt($t,At.label))}),ot},[xt,pt,Ue,dt,r]),Ut=mH(Wt,De,Le,ke,N),Qt=C.exports.useMemo(function(){return r!=="tags"||!Le||Ut.some(function(ot){return ot[N||"value"]===Le})?Ut:[xt(Le)].concat(wt(Ut))},[xt,N,r,Ut,Le]),Fe=C.exports.useMemo(function(){return R?wt(Qt).sort(function(ot,ht){return R(ot,ht)}):Qt},[Qt,R]),Ge=C.exports.useMemo(function(){return cH(Fe,{fieldNames:De,childrenAsData:Te})},[Fe,De,Te]),Xt=function(ht){var At=Tt(ht);if(Mt(At),de&&(At.length!==dt.length||At.some(function(Mn,Gn){var qn;return((qn=dt[Gn])===null||qn===void 0?void 0:qn.value)!==(Mn==null?void 0:Mn.value)}))){var $t=re?At:At.map(function(Mn){return Mn.value}),cn=At.map(function(Mn){return T2(ut(Mn.value))});de(Re?$t:$t[0],Re?cn:cn[0])}},dn=C.exports.useState(null),Vt=ze(dn,2),jt=Vt[0],nn=Vt[1],_n=C.exports.useState(0),An=ze(_n,2),_t=An[0],Gt=An[1],an=q!==void 0?q:r!=="combobox",Fn=C.exports.useCallback(function(ot,ht){var At=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},$t=At.source,cn=$t===void 0?"keyboard":$t;Gt(ht),c&&r==="combobox"&&ot!==null&&cn==="keyboard"&&nn(String(ot))},[c,r]),kn=function(ht,At,$t){var cn=function(){var Ee,be=ut(ht);return[re?{label:be==null?void 0:be[De.label],value:ht,key:(Ee=be==null?void 0:be.key)!==null&&Ee!==void 0?Ee:ht}:ht,T2(be)]};if(At&&P){var Mn=cn(),Gn=ze(Mn,2),qn=Gn[0],me=Gn[1];P(qn,me)}else if(!At&&I&&$t!=="clear"){var K=cn(),G=ze(K,2),ce=G[0],ae=G[1];I(ce,ae)}},zt=f5(function(ot,ht){var At,$t=Re?ht.selected:!0;$t?At=Re?[].concat(wt(dt),[ot]):[ot]:At=dt.filter(function(cn){return cn.value!==ot}),Xt(At),kn(ot,$t),r==="combobox"?nn(""):(!P2||w)&&(Ve(""),nn(""))}),Tn=function(ht,At){Xt(ht);var $t=At.type,cn=At.values;($t==="remove"||$t==="clear")&&cn.forEach(function(Mn){kn(Mn.value,!1,$t)})},Cn=function(ht,At){if(Ve(ht),nn(null),At.source==="submit"){var $t=(ht||"").trim();if($t){var cn=Array.from(new Set([].concat(wt(ft),[$t])));Xt(cn),kn($t,!0),Ve("")}return}At.source!=="blur"&&(r==="combobox"&&Xt(ht),g==null||g(ht))},hn=function(ht){var At=ht;r!=="tags"&&(At=ht.map(function(cn){var Mn=ct.get(cn);return Mn==null?void 0:Mn.value}).filter(function(cn){return cn!==void 0}));var $t=Array.from(new Set([].concat(wt(ft),wt(At))));Xt($t),$t.forEach(function(cn){kn(cn,!0)})},Nt=C.exports.useMemo(function(){var ot=te!==!1&&O!==!1;return ve(ve({},qe),{},{flattenOptions:Ge,onActiveValue:Fn,defaultActiveFirstOption:an,onSelect:zt,menuItemSelectedIcon:H,rawValues:ft,fieldNames:De,virtual:ot,listHeight:le,listItemHeight:Z,childrenAsData:Te})},[qe,Ge,Fn,an,zt,H,ft,De,te,O,le,Z,Te]);return E(JR.Provider,{value:Nt,children:E(qR,{...oe,id:ye,prefixCls:l,ref:t,omitDomProps:jH,mode:r,displayValues:it,onDisplayValuesChange:Tn,searchValue:Le,onSearch:Cn,autoClearSearchValue:w,onSearchSplit:hn,dropdownMatchSelectWidth:O,OptionList:e7,emptyOptions:!Ge.length,activeValue:jt,activeDescendantId:"".concat(ye,"_list_").concat(_t)})})}),o4=HH;o4.Option=r4;o4.OptGroup=n4;var WH=function(){var t=C.exports.useContext(Nn),n=t.getPrefixCls,r=n("empty-img-default");return E("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:[E("ellipse",{className:"".concat(r,"-ellipse"),cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),E("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"}),E("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)"}),E("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"}),E("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"})]}),E("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:[E("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),E("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"})]})]})})};const GH=WH;var qH=function(){var t=C.exports.useContext(Nn),n=t.getPrefixCls,r=n("empty-img-simple");return E("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:[E("ellipse",{className:"".concat(r,"-ellipse"),cx:"32",cy:"33",rx:"32",ry:"7"}),Qe("g",{className:"".concat(r,"-g"),fillRule:"nonzero",children:[E("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"}),E("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 ZH=qH;var XH=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 Wu.size||this.register(),f_+=1,Wu.set(f_,t),t(Yv),f_},unsubscribe:function(t){Wu.delete(t),Wu.size||this.unregister()},unregister:function(){var t=this;Object.keys(Xv).forEach(function(n){var r=Xv[n],i=t.matchHandlers[r];i==null||i.mql.removeListener(i==null?void 0:i.listener)}),Wu.clear()},register:function(){var t=this;Object.keys(Xv).forEach(function(n){var r=Xv[n],i=function(o){var h=o.matches;t.dispatch(tt(tt({},Yv),se({},n,h)))},l=window.matchMedia(r);l.addListener(i),t.matchHandlers[r]={mql:l,listener:i},i(l)})}};const by=hW;function v7(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=C.exports.useRef({}),n=m7();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 da={adjustX:1,adjustY:1},fa=[0,0],g7={left:{points:["cr","cl"],overflow:da,offset:[-4,0],targetOffset:fa},right:{points:["cl","cr"],overflow:da,offset:[4,0],targetOffset:fa},top:{points:["bc","tc"],overflow:da,offset:[0,-4],targetOffset:fa},bottom:{points:["tc","bc"],overflow:da,offset:[0,4],targetOffset:fa},topLeft:{points:["bl","tl"],overflow:da,offset:[0,-4],targetOffset:fa},leftTop:{points:["tr","tl"],overflow:da,offset:[-4,0],targetOffset:fa},topRight:{points:["br","tr"],overflow:da,offset:[0,-4],targetOffset:fa},rightTop:{points:["tl","tr"],overflow:da,offset:[4,0],targetOffset:fa},bottomRight:{points:["tr","br"],overflow:da,offset:[0,4],targetOffset:fa},rightBottom:{points:["bl","br"],overflow:da,offset:[4,0],targetOffset:fa},bottomLeft:{points:["tl","bl"],overflow:da,offset:[0,4],targetOffset:fa},leftBottom:{points:["br","bl"],overflow:da,offset:[-4,0],targetOffset:fa}};function pW(e){var t=e.showArrow,n=e.arrowContent,r=e.children,i=e.prefixCls,l=e.id,c=e.overlayInnerStyle,o=e.className,h=e.style;return Qe("div",{className:Ye("".concat(i,"-content"),o),style:h,children:[t!==!1&&E("div",{className:"".concat(i,"-arrow"),children:n},"arrow"),E("div",{className:"".concat(i,"-inner"),id:l,role:"tooltip",style:c,children:typeof r=="function"?r():r})]})}var mW=function(t,n){var r=t.overlayClassName,i=t.trigger,l=i===void 0?["hover"]:i,c=t.mouseEnterDelay,o=c===void 0?0:c,h=t.mouseLeaveDelay,p=h===void 0?.1:h,g=t.overlayStyle,b=t.prefixCls,w=b===void 0?"rc-tooltip":b,P=t.children,I=t.onVisibleChange,A=t.afterVisibleChange,O=t.transitionName,M=t.animation,R=t.motion,N=t.placement,z=N===void 0?"right":N,B=t.align,U=B===void 0?{}:B,q=t.destroyTooltipOnHide,H=q===void 0?!1:q,te=t.defaultVisible,Y=t.getTooltipContainer,le=t.overlayInnerStyle,J=t.arrowContent,Z=t.overlay,Q=t.id,ge=t.showArrow,re=In(t,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow"]),de=C.exports.useRef(null);C.exports.useImperativeHandle(n,function(){return de.current});var oe=ve({},re);"visible"in t&&(oe.popupVisible=t.visible);var ye=function(){return E(pW,{showArrow:ge,arrowContent:J,prefixCls:w,id:Q,overlayInnerStyle:le,children:Z},"content")},Re=!1,Te=!1;if(typeof H=="boolean")Re=H;else if(H&&sn(H)==="object"){var ke=H.keepParent;Re=ke===!0,Te=ke===!1}return E(O0,{popupClassName:r,prefixCls:w,popup:ye,action:l,builtinPlacements:g7,popupPlacement:z,ref:de,popupAlign:U,getPopupContainer:Y,onPopupVisibleChange:I,afterPopupVisibleChange:A,popupTransitionName:O,popupAnimation:M,popupMotion:R,defaultPopupVisible:te,destroyPopupOnHide:Re,autoDestroy:Te,mouseLeaveDelay:p,popupStyle:g,mouseEnterDelay:o,...oe,children:P})};const vW=C.exports.forwardRef(mW);ra("success","processing","error","default","warning");var gW=ra("pink","red","yellow","orange","cyan","green","blue","purple","geekblue","magenta","volcano","gold","lime"),yW={adjustX:1,adjustY:1},g5={adjustX:0,adjustY:0},xW=[0,0];function y5(e){return typeof e=="boolean"?e?yW:g5:tt(tt({},g5),e)}function y7(e){var t=e.arrowWidth,n=t===void 0?4:t,r=e.horizontalArrowShift,i=r===void 0?16:r,l=e.verticalArrowShift,c=l===void 0?8:l,o=e.autoAdjustOverflow,h=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(g){p[g]=h?tt(tt({},p[g]),{overflow:y5(o),targetOffset:xW}):tt(tt({},g7[g]),{overflow:y5(o)}),p[g].ignoreShake=!0}),p}var _W=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(t4(e)){var n=e.nodeName.toLowerCase(),r=["input","select","textarea","button"].includes(n)||e.isContentEditable||n==="a"&&!!e.getAttribute("href"),i=e.getAttribute("tabindex"),l=Number(i),c=null;return i&&!Number.isNaN(l)?c=l:r&&c===null&&(c=0),r&&e.disabled&&(c=null),c!==null&&(c>=0||t&&c<0)}return!1}function T7(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=wt(e.querySelectorAll("*")).filter(function(r){return b5(r,t)});return b5(e,t)&&n.unshift(e),n}var R2=Et.LEFT,A2=Et.RIGHT,O2=Et.UP,Sg=Et.DOWN,Eg=Et.ENTER,P7=Et.ESC,kh=Et.HOME,Th=Et.END,w5=[O2,Sg,R2,A2];function AW(e,t,n,r){var i,l,c,o,h="prev",p="next",g="children",b="parent";if(e==="inline"&&r===Eg)return{inlineTrigger:!0};var w=(i={},se(i,O2,h),se(i,Sg,p),i),P=(l={},se(l,R2,n?p:h),se(l,A2,n?h:p),se(l,Sg,g),se(l,Eg,g),l),I=(c={},se(c,O2,h),se(c,Sg,p),se(c,Eg,g),se(c,P7,b),se(c,R2,n?g:b),se(c,A2,n?b:g),c),A={inline:w,horizontal:P,vertical:I,inlineSub:w,horizontalSub:I,verticalSub:I},O=(o=A["".concat(e).concat(t?"":"Sub")])===null||o===void 0?void 0:o[r];switch(O){case h:return{offset:-1,sibling:!0};case p:return{offset:1,sibling:!0};case b:return{offset:-1,sibling:!1};case g:return{offset:1,sibling:!1};default:return null}}function OW(e){for(var t=e;t;){if(t.getAttribute("data-menu-list"))return t;t=t.parentElement}return null}function NW(e,t){for(var n=e||document.activeElement;n;){if(t.has(n))return n;n=n.parentElement}return null}function I7(e,t){var n=T7(e,!0);return n.filter(function(r){return t.has(r)})}function C5(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!e)return null;var i=I7(e,t),l=i.length,c=i.findIndex(function(o){return n===o});return r<0?c===-1?c=l-1:c-=1:r>0&&(c+=1),c=(c+l)%l,i[c]}function DW(e,t,n,r,i,l,c,o,h,p){var g=C.exports.useRef(),b=C.exports.useRef();b.current=t;var w=function(){nr.cancel(g.current)};return C.exports.useEffect(function(){return function(){w()}},[]),function(P){var I=P.which;if([].concat(w5,[Eg,P7,kh,Th]).includes(I)){var A,O,M,R=function(){A=new Set,O=new Map,M=new Map;var ge=l();return ge.forEach(function(re){var de=document.querySelector("[data-menu-id='".concat(c4(r,re),"']"));de&&(A.add(de),M.set(de,re),O.set(re,de))}),A};R();var N=O.get(t),z=NW(N,A),B=M.get(z),U=AW(e,c(B,!0).length===1,n,I);if(!U&&I!==kh&&I!==Th)return;(w5.includes(I)||[kh,Th].includes(I))&&P.preventDefault();var q=function(ge){if(ge){var re=ge,de=ge.querySelector("a");de!=null&&de.getAttribute("href")&&(re=de);var oe=M.get(ge);o(oe),w(),g.current=nr(function(){b.current===oe&&re.focus()})}};if([kh,Th].includes(I)||U.sibling||!z){var H;!z||e==="inline"?H=i.current:H=OW(z);var te,Y=I7(H,A);I===kh?te=Y[0]:I===Th?te=Y[Y.length-1]:te=C5(H,A,z,U.offset),q(te)}else if(U.inlineTrigger)h(B);else if(U.offset>0)h(B,!0),w(),g.current=nr(function(){R();var Q=z.getAttribute("aria-controls"),ge=document.getElementById(Q),re=C5(ge,A);q(re)},5);else if(U.offset<0){var le=c(B,!0),J=le[le.length-2],Z=O.get(J);h(J,!1),q(Z)}}p==null||p(P)}}function LW(e){Promise.resolve().then(e)}var f4="__RC_UTIL_PATH_SPLIT__",S5=function(t){return t.join(f4)},zW=function(t){return t.split(f4)},N2="rc-menu-more";function FW(){var e=C.exports.useState({}),t=ze(e,2),n=t[1],r=C.exports.useRef(new Map),i=C.exports.useRef(new Map),l=C.exports.useState([]),c=ze(l,2),o=c[0],h=c[1],p=C.exports.useRef(0),g=C.exports.useRef(!1),b=function(){g.current||n({})},w=C.exports.useCallback(function(N,z){var B=S5(z);i.current.set(B,N),r.current.set(N,B),p.current+=1;var U=p.current;LW(function(){U===p.current&&b()})},[]),P=C.exports.useCallback(function(N,z){var B=S5(z);i.current.delete(B),r.current.delete(N)},[]),I=C.exports.useCallback(function(N){h(N)},[]),A=C.exports.useCallback(function(N,z){var B=r.current.get(N)||"",U=zW(B);return z&&o.includes(U[0])&&U.unshift(N2),U},[o]),O=C.exports.useCallback(function(N,z){return N.some(function(B){var U=A(B,!0);return U.includes(z)})},[A]),M=function(){var z=wt(r.current.keys());return o.length&&z.push(N2),z},R=C.exports.useCallback(function(N){var z="".concat(r.current.get(N)).concat(f4),B=new Set;return wt(i.current.keys()).forEach(function(U){U.startsWith(z)&&B.add(i.current.get(U))}),B},[]);return C.exports.useEffect(function(){return function(){g.current=!0}},[]),{registerPath:w,unregisterPath:P,refreshOverflowKeys:I,isSubPathKey:O,getKeyPath:A,getKeys:M,getSubPathKeys:R}}function hd(e){var t=C.exports.useRef(e);t.current=e;var n=C.exports.useCallback(function(){for(var r,i=arguments.length,l=new Array(i),c=0;c1&&(R.motionAppear=!1);var N=R.onVisibleChanged;return R.onVisibleChanged=function(z){return!w.current&&!z&&O(!0),N==null?void 0:N(z)},A?null:E(Op,{mode:l,locked:!w.current,children:E(Ca,{visible:M,...R,forceRender:h,removeOnLeave:!1,leavedClassName:"".concat(o,"-hidden"),children:function(z){var B=z.className,U=z.style;return E(h4,{id:t,className:B,style:U,children:i})}})})}var nG=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],rG=["active"],iG=function(t){var n,r=t.style,i=t.className,l=t.title,c=t.eventKey;t.warnKey;var o=t.disabled,h=t.internalPopupClose,p=t.children,g=t.itemIcon,b=t.expandIcon,w=t.popupClassName,P=t.popupOffset,I=t.onClick,A=t.onMouseEnter,O=t.onMouseLeave,M=t.onTitleClick,R=t.onTitleMouseEnter,N=t.onTitleMouseLeave,z=In(t,nG),B=C7(c),U=C.exports.useContext(Wa),q=U.prefixCls,H=U.mode,te=U.openKeys,Y=U.disabled,le=U.overflowDisabled,J=U.activeKey,Z=U.selectedKeys,Q=U.itemIcon,ge=U.expandIcon,re=U.onItemClick,de=U.onOpenChange,oe=U.onActive,ye=C.exports.useContext(d4),Re=ye._internalRenderSubMenuItem,Te=C.exports.useContext(k7),ke=Te.isSubPathKey,De=hf(),Me="".concat(q,"-submenu"),Ne=Y||o,Le=C.exports.useRef(),Ve=C.exports.useRef(),qe=g||Q,Ue=b||ge,ct=te.includes(c),pt=!le&&ct,Tt=ke(Z,c),Xe=M7(c,Ne,R,N),Pt=Xe.active,mt=In(Xe,rG),Mt=C.exports.useState(!1),Ct=ze(Mt,2),Lt=Ct[0],lt=Ct[1],dt=function(_n){Ne||lt(_n)},ut=function(_n){dt(!0),A==null||A({key:c,domEvent:_n})},it=function(_n){dt(!1),O==null||O({key:c,domEvent:_n})},ft=C.exports.useMemo(function(){return Pt||(H!=="inline"?Lt||ke([J],c):!1)},[H,Pt,J,Lt,c,ke]),xt=A7(De.length),Wt=function(_n){Ne||(M==null||M({key:c,domEvent:_n}),H==="inline"&&de(c,!ct))},Ut=hd(function(nn){I==null||I(wy(nn)),re(nn)}),Qt=function(_n){H!=="inline"&&de(c,_n)},Fe=function(){oe(c)},Ge=B&&"".concat(B,"-popup"),Xt=Qe("div",{role:"menuitem",style:xt,className:"".concat(Me,"-title"),tabIndex:Ne?null:-1,ref:Le,title:typeof l=="string"?l:null,"data-menu-id":le&&B?null:B,"aria-expanded":pt,"aria-haspopup":!0,"aria-controls":Ge,"aria-disabled":Ne,onClick:Wt,onFocus:Fe,...mt,children:[l,E(R7,{icon:H!=="horizontal"?Ue:null,props:ve(ve({},t),{},{isOpen:pt,isSubMenu:!0}),children:E("i",{className:"".concat(Me,"-arrow")})})]}),dn=C.exports.useRef(H);if(H!=="inline"&&De.length>1?dn.current="vertical":dn.current=H,!le){var Vt=dn.current;Xt=E(eG,{mode:Vt,prefixCls:Me,visible:!h&&pt&&H!=="inline",popupClassName:w,popupOffset:P,popup:E(Op,{mode:Vt==="horizontal"?"vertical":Vt,children:E(h4,{id:Ge,ref:Ve,children:p})}),disabled:Ne,onVisibleChange:Qt,children:Xt})}var jt=Qe(hs.Item,{role:"none",...z,component:"li",style:r,className:Ye(Me,"".concat(Me,"-").concat(H),i,(n={},se(n,"".concat(Me,"-open"),pt),se(n,"".concat(Me,"-active"),ft),se(n,"".concat(Me,"-selected"),Tt),se(n,"".concat(Me,"-disabled"),Ne),n)),onMouseEnter:ut,onMouseLeave:it,children:[Xt,!le&&E(tG,{id:Ge,open:pt,keyPath:De,children:p})]});return Re&&(jt=Re(jt,t,{selected:Tt,active:ft,open:pt,disabled:Ne})),E(Op,{onItemClick:Ut,mode:H==="horizontal"?"vertical":H,itemIcon:qe,expandIcon:Ue,children:jt})};function F0(e){var t=e.eventKey,n=e.children,r=hf(t),i=p4(n,r),l=L0();C.exports.useEffect(function(){if(l)return l.registerPath(t,r),function(){l.unregisterPath(t,r)}},[r]);var c;return l?c=i:c=E(iG,{...e,children:i}),E(E7.Provider,{value:r,children:c})}var oG=["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"],ud=[],aG=C.exports.forwardRef(function(e,t){var n,r,i=e,l=i.prefixCls,c=l===void 0?"rc-menu":l,o=i.rootClassName,h=i.style,p=i.className,g=i.tabIndex,b=g===void 0?0:g,w=i.items,P=i.children,I=i.direction,A=i.id,O=i.mode,M=O===void 0?"vertical":O,R=i.inlineCollapsed,N=i.disabled,z=i.disabledOverflow,B=i.subMenuOpenDelay,U=B===void 0?.1:B,q=i.subMenuCloseDelay,H=q===void 0?.1:q,te=i.forceSubMenuRender,Y=i.defaultOpenKeys,le=i.openKeys,J=i.activeKey,Z=i.defaultActiveFirst,Q=i.selectable,ge=Q===void 0?!0:Q,re=i.multiple,de=re===void 0?!1:re,oe=i.defaultSelectedKeys,ye=i.selectedKeys,Re=i.onSelect,Te=i.onDeselect,ke=i.inlineIndent,De=ke===void 0?24:ke,Me=i.motion,Ne=i.defaultMotions,Le=i.triggerSubMenuAction,Ve=Le===void 0?"hover":Le,qe=i.builtinPlacements,Ue=i.itemIcon,ct=i.expandIcon,pt=i.overflowedIndicator,Tt=pt===void 0?"...":pt,Xe=i.overflowedIndicatorPopupClassName,Pt=i.getPopupContainer,mt=i.onClick,Mt=i.onOpenChange,Ct=i.onKeyDown;i.openAnimation,i.openTransitionName;var Lt=i._internalRenderMenuItem,lt=i._internalRenderSubMenuItem,dt=In(i,oG),ut=C.exports.useMemo(function(){return XW(P,w,ud)},[P,w]),it=C.exports.useState(!1),ft=ze(it,2),xt=ft[0],Wt=ft[1],Ut=C.exports.useRef(),Qt=BW(A),Fe=I==="rtl",Ge=Vi(Y,{value:le,postState:function(Ln){return Ln||ud}}),Xt=ze(Ge,2),dn=Xt[0],Vt=Xt[1],jt=function(Ln){var Yn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function xr(){Vt(Ln),Mt==null||Mt(Ln)}Yn?uu.exports.flushSync(xr):xr()},nn=C.exports.useState(dn),_n=ze(nn,2),An=_n[0],_t=_n[1],Gt=C.exports.useRef(!1),an=C.exports.useMemo(function(){return(M==="inline"||M==="vertical")&&R?["vertical",R]:[M,!1]},[M,R]),Fn=ze(an,2),kn=Fn[0],zt=Fn[1],Tn=kn==="inline",Cn=C.exports.useState(kn),hn=ze(Cn,2),Nt=hn[0],ot=hn[1],ht=C.exports.useState(zt),At=ze(ht,2),$t=At[0],cn=At[1];C.exports.useEffect(function(){ot(kn),cn(zt),Gt.current&&(Tn?Vt(An):jt(ud))},[kn,zt]);var Mn=C.exports.useState(0),Gn=ze(Mn,2),qn=Gn[0],me=Gn[1],K=qn>=ut.length-1||Nt!=="horizontal"||z;C.exports.useEffect(function(){Tn&&_t(dn)},[dn]),C.exports.useEffect(function(){return Gt.current=!0,function(){Gt.current=!1}},[]);var G=FW(),ce=G.registerPath,ae=G.unregisterPath,xe=G.refreshOverflowKeys,Ee=G.isSubPathKey,be=G.getKeyPath,Ce=G.getKeys,Oe=G.getSubPathKeys,He=C.exports.useMemo(function(){return{registerPath:ce,unregisterPath:ae}},[ce,ae]),We=C.exports.useMemo(function(){return{isSubPathKey:Ee}},[Ee]);C.exports.useEffect(function(){xe(K?ud:ut.slice(qn+1).map(function(jn){return jn.key}))},[qn,K]);var Be=Vi(J||Z&&((n=ut[0])===null||n===void 0?void 0:n.key),{value:J}),Ot=ze(Be,2),bt=Ot[0],Je=Ot[1],Rt=hd(function(jn){Je(jn)}),Bt=hd(function(){Je(void 0)});C.exports.useImperativeHandle(t,function(){return{list:Ut.current,focus:function(Ln){var Yn,xr=bt!=null?bt:(Yn=ut.find(function(cl){return!cl.props.disabled}))===null||Yn===void 0?void 0:Yn.key;if(xr){var br,Lr,so;(br=Ut.current)===null||br===void 0||(Lr=br.querySelector("li[data-menu-id='".concat(c4(Qt,xr),"']")))===null||Lr===void 0||(so=Lr.focus)===null||so===void 0||so.call(Lr,Ln)}}}});var gn=Vi(oe||[],{value:ye,postState:function(Ln){return Array.isArray(Ln)?Ln:Ln==null?ud:[Ln]}}),on=ze(gn,2),yn=on[0],Bn=on[1],Jn=function(Ln){if(ge){var Yn=Ln.key,xr=yn.includes(Yn),br;de?xr?br=yn.filter(function(so){return so!==Yn}):br=[].concat(wt(yn),[Yn]):br=[Yn],Bn(br);var Lr=ve(ve({},Ln),{},{selectedKeys:br});xr?Te==null||Te(Lr):Re==null||Re(Lr)}!de&&dn.length&&Nt!=="inline"&&jt(ud)},Dr=hd(function(jn){mt==null||mt(wy(jn)),Jn(jn)}),or=hd(function(jn,Ln){var Yn=dn.filter(function(br){return br!==jn});if(Ln)Yn.push(jn);else if(Nt!=="inline"){var xr=Oe(jn);Yn=Yn.filter(function(br){return!xr.has(br)})}e4(dn,Yn,!0)||jt(Yn,!0)}),Pr=hd(Pt),Pn=function(Ln,Yn){var xr=Yn!=null?Yn:!dn.includes(Ln);or(Ln,xr)},Sn=DW(Nt,bt,Fe,Qt,Ut,Ce,be,Je,Pn,Ct);C.exports.useEffect(function(){Wt(!0)},[]);var Rn=C.exports.useMemo(function(){return{_internalRenderMenuItem:Lt,_internalRenderSubMenuItem:lt}},[Lt,lt]),Wr=Nt!=="horizontal"||z?ut:ut.map(function(jn,Ln){return E(Op,{overflowDisabled:Ln>qn,children:jn},jn.key)}),vr=E(hs,{id:A,ref:Ut,prefixCls:"".concat(c,"-overflow"),component:"ul",itemComponent:z0,className:Ye(c,"".concat(c,"-root"),"".concat(c,"-").concat(Nt),p,(r={},se(r,"".concat(c,"-inline-collapsed"),$t),se(r,"".concat(c,"-rtl"),Fe),r),o),dir:I,style:h,role:"menu",tabIndex:b,data:Wr,renderRawItem:function(Ln){return Ln},renderRawRest:function(Ln){var Yn=Ln.length,xr=Yn?ut.slice(-Yn):null;return E(F0,{eventKey:N2,title:Tt,disabled:K,internalPopupClose:Yn===0,popupClassName:Xe,children:xr})},maxCount:Nt!=="horizontal"||z?hs.INVALIDATE:hs.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(Ln){me(Ln)},onKeyDown:Sn,...dt});return E(d4.Provider,{value:Rn,children:E(w7.Provider,{value:Qt,children:Qe(Op,{prefixCls:c,rootClassName:o,mode:Nt,openKeys:dn,rtl:Fe,disabled:N,motion:xt?Me:null,defaultMotions:xt?Ne:null,activeKey:bt,onActive:Rt,onInactive:Bt,selectedKeys:yn,inlineIndent:De,subMenuOpenDelay:U,subMenuCloseDelay:H,forceSubMenuRender:te,builtinPlacements:qe,triggerSubMenuAction:Ve,getPopupContainer:Pr,itemIcon:Ue,expandIcon:ct,onItemClick:Dr,onOpenChange:or,children:[E(k7.Provider,{value:We,children:vr}),E("div",{style:{display:"none"},"aria-hidden":!0,children:E(S7.Provider,{value:He,children:ut})})]})})})}),sG=["className","title","eventKey","children"],lG=["children"],uG=function(t){var n=t.className,r=t.title;t.eventKey;var i=t.children,l=In(t,sG),c=C.exports.useContext(Wa),o=c.prefixCls,h="".concat(o,"-item-group");return Qe("li",{role:"presentation",...l,onClick:function(g){return g.stopPropagation()},className:Ye(h,n),children:[E("div",{role:"presentation",className:"".concat(h,"-title"),title:typeof r=="string"?r:void 0,children:r}),E("ul",{role:"group",className:"".concat(h,"-list"),children:i})]})};function $0(e){var t=e.children,n=In(e,lG),r=hf(n.eventKey),i=p4(t,r),l=L0();return l?i:E(uG,{...mi(n,["warnKey"]),children:i})}function m4(e){var t=e.className,n=e.style,r=C.exports.useContext(Wa),i=r.prefixCls,l=L0();return l?null:E("li",{className:Ye("".concat(i,"-item-divider"),t),style:n})}var Yp=aG;Yp.Item=z0;Yp.SubMenu=F0;Yp.ItemGroup=$0;Yp.Divider=m4;var cG={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 dG=cG;var N7=function(t,n){return E(lr,{...ve(ve({},t),{},{ref:n,icon:dG})})};N7.displayName="LeftOutlined";const fG=C.exports.forwardRef(N7);var hG={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 pG=hG;var D7=function(t,n){return E(lr,{...ve(ve({},t),{},{ref:n,icon:pG})})};D7.displayName="RightOutlined";const v4=C.exports.forwardRef(D7);globalThis&&globalThis.__rest;var L7=C.exports.createContext({}),mG=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"?U=g?O:"":R===!1&&(U="");var q={title:U};!c&&!b&&(q.title=null,q.open=!1);var H=Xi(O).length,te=Qe(z0,{...B,className:Ye((l={},se(l,"".concat(p,"-item-danger"),z),se(l,"".concat(p,"-item-only-child"),(N?H+1:H)===1),l),A),title:typeof R=="string"?R:void 0,children:[Ei(N,{className:Ye(Do(N)?(o=N.props)===null||o===void 0?void 0:o.className:"","".concat(p,"-item-icon"))}),r.renderItemChildren(b)]});return P||(te=E(oo,{...q,placement:w==="rtl"?"left":"right",overlayClassName:"".concat(p,"-inline-collapsed-tooltip"),children:te})),te},r}return Hr(n,[{key:"renderItemChildren",value:function(i){var l=this.context,c=l.prefixCls,o=l.firstLevel,h=this.props,p=h.icon,g=h.children,b=E("span",{className:"".concat(c,"-title-content"),children:g});return(!p||Do(g)&&g.type==="span")&&g&&i&&o&&typeof g=="string"?E("div",{className:"".concat(c,"-inline-collapsed-noicon"),children:g.charAt(0)}):b}},{key:"render",value:function(){return E(L7.Consumer,{children:this.renderItem})}}]),n}(C.exports.Component);g4.contextType=Cy;function F7(e){var t,n=e.popupClassName,r=e.icon,i=e.title,l=e.theme,c=C.exports.useContext(Cy),o=c.prefixCls,h=c.inlineCollapsed,p=c.antdMenuTheme,g=hf(),b;if(!r)b=h&&!g.length&&i&&typeof i=="string"?E("div",{className:"".concat(o,"-inline-collapsed-noicon"),children:i.charAt(0)}):E("span",{className:"".concat(o,"-title-content"),children:i});else{var w=Do(i)&&i.type==="span";b=Qe($n,{children:[Ei(r,{className:Ye(Do(r)?(t=r.props)===null||t===void 0?void 0:t.className:"","".concat(o,"-item-icon"))}),w?i:E("span",{className:"".concat(o,"-title-content"),children:i})]})}var P=C.exports.useMemo(function(){return tt(tt({},c),{firstLevel:!1})},[c]);return E(Cy.Provider,{value:P,children:E(F0,{...mi(e,["icon"]),title:b,popupClassName:Ye(o,"".concat(o,"-").concat(l||p),n)})})}var xG=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=RG++,r=t;function i(){r-=1,r<=0?(e(),delete zd[n]):zd[n]=nr(i)}return zd[n]=nr(i),n}Ey.cancel=function(t){t!==void 0&&(nr.cancel(zd[t]),delete zd[t])};Ey.ids=zd;var h_;function k5(e){return!e||e.offsetParent===null||e.hidden}function AG(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 OG(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 V7=function(e){li(n,e);var t=ui(n);function n(){var r;return Kr(this,n),r=t.apply(this,arguments),r.containerRef=C.exports.createRef(),r.animationStart=!1,r.destroyed=!1,r.onClick=function(i,l){var c,o,h=r.props,p=h.insertExtraNode,g=h.disabled;if(!(g||!i||k5(i)||i.className.includes("-leave"))){r.extraNode=document.createElement("div");var b=On(r),w=b.extraNode,P=r.context.getPrefixCls;w.className="".concat(P(""),"-click-animating-node");var I=r.getAttributeName();if(i.setAttribute(I,"true"),l&&l!=="#fff"&&l!=="#ffffff"&&l!=="rgb(255, 255, 255)"&&l!=="rgba(255, 255, 255, 1)"&&OG(l)&&!/rgba\((?:\d*, ){3}0\)/.test(l)&&l!=="transparent"){w.style.borderColor=l;var A=((c=i.getRootNode)===null||c===void 0?void 0:c.call(i))||i.ownerDocument,O=(o=AG(A))!==null&&o!==void 0?o:A;h_=Gp(` [`.concat(P(""),"-click-animating-without-extra-node='true']::after, .").concat(P(""),`-click-animating-node { --antd-wave-shadow-color: `).concat(l,`; }`),"antd-wave",{csp:r.csp,attachTo:O})}p&&i.appendChild(w),["transition","animation"].forEach(function(M){i.addEventListener("".concat(M,"start"),r.onTransitionStart),i.addEventListener("".concat(M,"end"),r.onTransitionEnd)})}},r.onTransitionStart=function(i){if(!r.destroyed){var l=r.containerRef.current;!i||i.target!==l||r.animationStart||r.resetEffect(l)}},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 l=function(o){if(!(o.target.tagName==="INPUT"||k5(o.target))){r.resetEffect(i);var h=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,h)},0),Ey.cancel(r.animationStartId),r.animationStart=!0,r.animationStartId=Ey(function(){r.animationStart=!1},10)}};return i.addEventListener("click",l,!0),{cancel:function(){i.removeEventListener("click",l,!0)}}}},r.renderWave=function(i){var l=i.csp,c=r.props.children;if(r.csp=l,!C.exports.isValidElement(c))return c;var o=r.containerRef;return Sc(c)&&(o=Lo(c.ref,r.containerRef)),Ei(c,{ref:o})},r}return Hr(n,[{key:"componentDidMount",value:function(){this.destroyed=!1;var i=this.containerRef.current;!i||i.nodeType!==1||(this.instance=this.bindAnimationEvent(i))}},{key:"componentWillUnmount",value:function(){this.instance&&this.instance.cancel(),this.clickWaveTimeoutId&&clearTimeout(this.clickWaveTimeoutId),this.destroyed=!0}},{key:"getAttributeName",value:function(){var i=this.context.getPrefixCls,l=this.props.insertExtraNode;return l?"".concat(i(""),"-click-animating"):"".concat(i(""),"-click-animating-without-extra-node")}},{key:"resetEffect",value:function(i){var l=this;if(!(!i||i===this.extraNode||!(i instanceof Element))){var c=this.props.insertExtraNode,o=this.getAttributeName();i.setAttribute(o,"false"),h_&&(h_.innerHTML=""),c&&this.extraNode&&i.contains(this.extraNode)&&i.removeChild(this.extraNode),["transition","animation"].forEach(function(h){i.removeEventListener("".concat(h,"start"),l.onTransitionStart),i.removeEventListener("".concat(h,"end"),l.onTransitionEnd)})}}},{key:"render",value:function(){return E(hu,{children:this.renderWave})}}]),n}(C.exports.Component);V7.contextType=Nn;const NG=V7;var DG=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(re){return typeof re=="string"||typeof re=="number"?E(ky,{prefixCls:le,disabled:R,value:re,checked:p===re,children:re},re.toString()):E(ky,{prefixCls:le,disabled:re.disabled||R,value:re.value,checked:p===re.value,style:re.style,children:re.label},"radio-group-value-options-".concat(re.value))}));var Q=z||c,ge=Ye(J,"".concat(J,"-").concat(M),(n={},se(n,"".concat(J,"-").concat(Q),Q),se(n,"".concat(J,"-rtl"),l==="rtl"),n),I);return E("div",{...xR(e),className:ge,style:B,onMouseEnter:q,onMouseLeave:H,onFocus:te,onBlur:Y,id:U,ref:t,children:E(Uq,{value:{onChange:b,value:p,disabled:e.disabled,name:e.name,optionType:e.optionType},children:Z})})});const qq=C.exports.memo(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=t||q<0||b&&H>=l}function M(){var U=g_();if(O(U))return R(U);o=setTimeout(M,A(U))}function R(U){return o=void 0,w&&r?P(U):(r=i=void 0,c)}function N(){o!==void 0&&clearTimeout(o),p=0,r=h=i=o=void 0}function z(){return o===void 0?c:R(g_())}function B(){var U=g_(),q=O(U);if(r=arguments,i=this,h=U,q){if(o===void 0)return I(h);if(b)return clearTimeout(o),o=setTimeout(M,t),P(h)}return o===void 0&&(o=setTimeout(M,t)),c}return B.cancel=N,B.flush=z,B}var aZ=oZ;function nA(e,t){var n=new Set;return e.forEach(function(r){t.has(r)||n.add(r)}),n}function sZ(e){var t=e||{},n=t.disabled,r=t.disableCheckbox,i=t.checkable;return!!(n||r)||i===!1}function lZ(e,t,n,r){for(var i=new Set(e),l=new Set,c=0;c<=n;c+=1){var o=t.get(c)||new Set;o.forEach(function(b){var w=b.key,P=b.node,I=b.children,A=I===void 0?[]:I;i.has(w)&&!r(P)&&A.filter(function(O){return!r(O.node)}).forEach(function(O){i.add(O.key)})})}for(var h=new Set,p=n;p>=0;p-=1){var g=t.get(p)||new Set;g.forEach(function(b){var w=b.parent,P=b.node;if(!(r(P)||!b.parent||h.has(b.parent.key))){if(r(b.parent.node)){h.add(w.key);return}var I=!0,A=!1;(w.children||[]).filter(function(O){return!r(O.node)}).forEach(function(O){var M=O.key,R=i.has(M);I&&!R&&(I=!1),!A&&(R||l.has(M))&&(A=!0)}),I&&i.add(w.key),A&&l.add(w.key),h.add(w.key)}})}return{checkedKeys:Array.from(i),halfCheckedKeys:Array.from(nA(l,i))}}function uZ(e,t,n,r,i){for(var l=new Set(e),c=new Set(t),o=0;o<=r;o+=1){var h=n.get(o)||new Set;h.forEach(function(w){var P=w.key,I=w.node,A=w.children,O=A===void 0?[]:A;!l.has(P)&&!c.has(P)&&!i(I)&&O.filter(function(M){return!i(M.node)}).forEach(function(M){l.delete(M.key)})})}c=new Set;for(var p=new Set,g=r;g>=0;g-=1){var b=n.get(g)||new Set;b.forEach(function(w){var P=w.parent,I=w.node;if(!(i(I)||!w.parent||p.has(w.parent.key))){if(i(w.parent.node)){p.add(P.key);return}var A=!0,O=!1;(P.children||[]).filter(function(M){return!i(M.node)}).forEach(function(M){var R=M.key,N=l.has(R);A&&!N&&(A=!1),!O&&(N||c.has(R))&&(O=!0)}),A||l.delete(P.key),O&&c.add(P.key),p.add(P.key)}})}return{checkedKeys:Array.from(l),halfCheckedKeys:Array.from(nA(c,l))}}function Gs(e,t,n,r){var i=[],l;r?l=r:l=sZ;var c=new Set(e.filter(function(g){var b=!!n[g];return b||i.push(g),b})),o=new Map,h=0;Object.keys(n).forEach(function(g){var b=n[g],w=b.level,P=o.get(w);P||(P=new Set,o.set(w,P)),P.add(b),h=Math.max(h,w)}),Nr(!i.length,"Tree missing follow keys: ".concat(i.slice(0,100).map(function(g){return"'".concat(g,"'")}).join(", ")));var p;return t===!0?p=lZ(c,o,h,l):p=uZ(c,t.halfCheckedKeys,o,h,l),p}var S4=C.exports.createContext(null),cZ=function(t){for(var n=t.prefixCls,r=t.level,i=t.isStart,l=t.isEnd,c="".concat(n,"-indent-unit"),o=[],h=0;h=0&&n.splice(r,1),n}function Ds(e,t){var n=(e||[]).slice();return n.indexOf(t)===-1&&n.push(t),n}function E4(e){return e.split("-")}function rA(e,t){return"".concat(e,"-").concat(t)}function mZ(e){return e&&e.type&&e.type.isTreeNode}function vZ(e,t){var n=[],r=t[e];function i(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];l.forEach(function(c){var o=c.key,h=c.children;n.push(o),i(h)})}return i(r.children),n}function gZ(e){if(e.parent){var t=E4(e.pos);return Number(t[t.length-1])===e.parent.children.length-1}return!1}function yZ(e){var t=E4(e.pos);return Number(t[t.length-1])===0}function L5(e,t,n,r,i,l,c,o,h,p){var g,b=e.clientX,w=e.clientY,P=e.target.getBoundingClientRect(),I=P.top,A=P.height,O=(p==="rtl"?-1:1)*(((i==null?void 0:i.x)||0)-b),M=(O-12)/r,R=o[n.props.eventKey];if(w-1.5?l({dragNode:J,dropNode:Z,dropPosition:1})?te=1:Q=!1:l({dragNode:J,dropNode:Z,dropPosition:0})?te=0:l({dragNode:J,dropNode:Z,dropPosition:1})?te=1:Q=!1:l({dragNode:J,dropNode:Z,dropPosition:1})?te=1:Q=!1,{dropPosition:te,dropLevelOffset:Y,dropTargetKey:R.key,dropTargetPos:R.pos,dragOverNodeKey:H,dropContainerKey:te===0?null:((g=R.parent)===null||g===void 0?void 0:g.key)||null,dropAllowed:Q}}function z5(e,t){if(!!e){var n=t.multiple;return n?e.slice():e.length?[e[0]]:e}}function y_(e){if(!e)return null;var t;if(Array.isArray(e))t={checkedKeys:e,halfCheckedKeys:void 0};else if(sn(e)==="object")t={checkedKeys:e.checked||void 0,halfCheckedKeys:e.halfChecked||void 0};else return Nr(!1,"`checkedKeys` is not an array or an object"),null;return t}function $2(e,t){var n=new Set;function r(i){if(!n.has(i)){var l=t[i];if(!!l){n.add(i);var c=l.parent,o=l.node;o.disabled||c&&r(c.key)}}}return(e||[]).forEach(function(i){r(i)}),wt(n)}var xZ=["children"];function tm(e,t){return e!=null?e:t}function Ty(e){var t=e||{},n=t.title,r=t._title,i=t.key,l=t.children,c=n||"title";return{title:c,_title:r||[c],key:i||"key",children:l||"children"}}function iA(e){function t(n){var r=Xi(n);return r.map(function(i){if(!mZ(i))return Nr(!i,"Tree/TreeNode can only accept TreeNode as children."),null;var l=i.key,c=i.props,o=c.children,h=In(c,xZ),p=ve({key:l},h),g=t(o);return g.length&&(p.children=g),p}).filter(function(i){return i})}return t(e)}function x_(e,t,n){var r=Ty(n),i=r._title,l=r.key,c=r.children,o=new Set(t===!0?[]:t),h=[];function p(g){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return g.map(function(w,P){for(var I=rA(b?b.pos:"0",P),A=tm(w[l],I),O,M=0;M1&&arguments[1]!==void 0?arguments[1]:{},n=t.initWrapper,r=t.processEntity,i=t.onProcessFinished,l=t.externalGetKey,c=t.childrenPropName,o=t.fieldNames,h=arguments.length>2?arguments[2]:void 0,p=l||h,g={},b={},w={posEntities:g,keyEntities:b};return n&&(w=n(w)||w),_Z(e,function(P){var I=P.node,A=P.index,O=P.pos,M=P.key,R=P.parentPos,N=P.level,z=P.nodes,B={node:I,nodes:z,index:A,key:M,pos:O,level:N},U=tm(M,O);g[O]=B,b[U]=B,B.parent=g[R],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 np(e,t){var n=t.expandedKeys,r=t.selectedKeys,i=t.loadedKeys,l=t.loadingKeys,c=t.checkedKeys,o=t.halfCheckedKeys,h=t.dragOverNodeKey,p=t.dropPosition,g=t.keyEntities,b=g[e],w={eventKey:e,expanded:n.indexOf(e)!==-1,selected:r.indexOf(e)!==-1,loaded:i.indexOf(e)!==-1,loading:l.indexOf(e)!==-1,checked:c.indexOf(e)!==-1,halfChecked:o.indexOf(e)!==-1,pos:String(b?b.pos:""),dragOver:h===e&&p===0,dragOverGapTop:h===e&&p===-1,dragOverGapBottom:h===e&&p===1};return w}function wi(e){var t=e.data,n=e.expanded,r=e.selected,i=e.checked,l=e.loaded,c=e.loading,o=e.halfChecked,h=e.dragOver,p=e.dragOverGapTop,g=e.dragOverGapBottom,b=e.pos,w=e.active,P=e.eventKey,I=ve(ve({},t),{},{expanded:n,selected:r,checked:i,loaded:l,loading:c,halfChecked:o,dragOver:h,dragOverGapTop:p,dragOverGapBottom:g,pos:b,active:w,key:P});return"props"in I||Object.defineProperty(I,"props",{get:function(){return Nr(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),e}}),I}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);i0&&(i=q().map(function(re){return E(aA,{prefixCls:le,disabled:"disabled"in re?re.disabled:b.disabled,value:re.value,checked:M.includes(re.value),onChange:re.onChange,className:"".concat(J,"-item"),style:re.style,children:re.label},re.value.toString())}));var Q={toggleOption:Y,value:M,disabled:b.disabled,name:b.name,registerValue:te,cancelValue:H},ge=Ye(J,se({},"".concat(J,"-rtl"),I==="rtl"),h);return E("div",{className:ge,style:p,...Z,ref:n,children:E(oA.Provider,{value:Q,children:i})})},CZ=C.exports.forwardRef(wZ);const SZ=C.exports.memo(CZ);var EZ=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 te=o[0]/2;H.paddingLeft=te,H.paddingRight=te}if(o&&o[1]>0&&!p){var Y=o[1]/2;H.paddingTop=Y,H.paddingBottom=Y}return R&&(H.flex=MZ(R),h===!1&&!H.minWidth&&(H.minWidth=0)),E("div",{...z,style:tt(tt({},H),N),className:q,ref:t,children:M})});const Py=AZ;var OZ=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?Q[0]/-2:void 0,oe=Q[1]!=null&&Q[1]>0?Q[1]/-2:void 0;if(de&&(re.marginLeft=de,re.marginRight=de),Y){var ye=ze(Q,2);re.rowGap=ye[1]}else oe&&(re.marginTop=oe,re.marginBottom=oe);var Re=ze(Q,2),Te=Re[0],ke=Re[1],De=C.exports.useMemo(function(){return{gutter:[Te,ke],wrap:b,supportFlexGap:Y}},[Te,ke,b,Y]);return E(sA.Provider,{value:De,children:E("div",{...w,className:ge,style:tt(tt({},re),o),ref:t,children:h})})});const lA=NZ;var uA=C.exports.forwardRef(function(e,t){var n,r=e.prefixCls,i=e.forceRender,l=e.className,c=e.style,o=e.children,h=e.isActive,p=e.role,g=C.exports.useState(h||i),b=ze(g,2),w=b[0],P=b[1];return C.exports.useEffect(function(){(i||h)&&P(!0)},[i,h]),w?E("div",{ref:t,className:Ye("".concat(r,"-content"),(n={},se(n,"".concat(r,"-content-active"),h),se(n,"".concat(r,"-content-inactive"),!h),n),l),style:c,role:p,children:E("div",{className:"".concat(r,"-content-box"),children:o})}):null});uA.displayName="PanelContent";var DZ=["className","id","style","prefixCls","headerClass","children","isActive","destroyInactivePanel","accordion","forceRender","openMotion","extra","collapsible"],cA=function(e){li(n,e);var t=ui(n);function n(){var r;Kr(this,n);for(var i=arguments.length,l=new Array(i),c=0;c-1;b?p.splice(g,1):p.push(h)}i.setActiveKey(p)},i.getNewChild=function(h,p){if(!h)return null;var g=i.state.activeKey,b=i.props,w=b.prefixCls,P=b.openMotion,I=b.accordion,A=b.destroyInactivePanel,O=b.expandIcon,M=b.collapsible,R=h.key||String(p),N=h.props,z=N.header,B=N.headerClass,U=N.destroyInactivePanel,q=N.collapsible,H=!1;I?H=g[0]===R:H=g.indexOf(R)>-1;var te=q!=null?q:M,Y={key:R,panelKey:R,header:z,headerClass:B,isActive:H,prefixCls:w,destroyInactivePanel:U!=null?U:A,openMotion:P,accordion:I,children:h.props.children,onItemClick:te==="disabled"?null:i.onClickItem,expandIcon:O,collapsible:te};return typeof h.type=="string"?h:(Object.keys(Y).forEach(function(le){typeof Y[le]>"u"&&delete Y[le]}),C.exports.cloneElement(h,Y))},i.getItems=function(){var h=i.props.children;return Xi(h).map(i.getNewChild)},i.setActiveKey=function(h){"activeKey"in i.props||i.setState({activeKey:h}),i.props.onChange(i.props.accordion?h[0]:h)};var l=r.activeKey,c=r.defaultActiveKey,o=c;return"activeKey"in r&&(o=l),i.state={activeKey:$5(o)},i}return Hr(n,[{key:"shouldComponentUpdate",value:function(i,l){return!gc(this.props,i)||!gc(this.state,l)}},{key:"render",value:function(){var i,l=this.props,c=l.prefixCls,o=l.className,h=l.style,p=l.accordion,g=Ye((i={},se(i,c,!0),se(i,o,!!o),i));return E("div",{className:g,style:h,role:p?"tablist":null,children:this.getItems()})}}],[{key:"getDerivedStateFromProps",value:function(i){var l={};return"activeKey"in i&&(l.activeKey=$5(i.activeKey)),l}}]),n}(C.exports.Component);nm.defaultProps={prefixCls:"rc-collapse",onChange:function(){},accordion:!1,destroyInactivePanel:!1};nm.Panel=cA;nm.Panel;var LZ=function(t){var n=C.exports.useContext(Nn),r=n.getPrefixCls,i=t.prefixCls,l=t.className,c=l===void 0?"":l,o=t.showArrow,h=o===void 0?!0:o,p=r("collapse",i),g=Ye(se({},"".concat(p,"-no-arrow"),!h),c);return E(nm.Panel,{...t,prefixCls:p,className:g})};const zZ=LZ;var dA=function(t){var n,r=C.exports.useContext(Nn),i=r.getPrefixCls,l=r.direction,c=t.prefixCls,o=t.className,h=o===void 0?"":o,p=t.bordered,g=p===void 0?!0:p,b=t.ghost,w=t.expandIconPosition,P=w===void 0?"start":w,I=i("collapse",c),A=C.exports.useMemo(function(){return P==="left"?"start":P==="right"?"end":P},[P]),O=function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},U=t.expandIcon,q=U?U(B):E(v4,{rotate:B.isActive?90:void 0});return Ei(q,function(){return{className:Ye(q.props.className,"".concat(I,"-arrow"))}})},M=Ye("".concat(I,"-icon-position-").concat(A),(n={},se(n,"".concat(I,"-borderless"),!g),se(n,"".concat(I,"-rtl"),l==="rtl"),se(n,"".concat(I,"-ghost"),!!b),n),h),R=tt(tt({},Ap),{motionAppear:!1,leavedClassName:"".concat(I,"-content-hidden")}),N=function(){var B=t.children;return Xi(B).map(function(U,q){var H;if(!((H=U.props)===null||H===void 0)&&H.disabled){var te=U.key||String(q),Y=U.props,le=Y.disabled,J=Y.collapsible,Z=tt(tt({},mi(U.props,["disabled"])),{key:te,collapsible:J!=null?J:le?"disabled":void 0});return Ei(U,Z)}return U})};return E(nm,{openMotion:R,...t,expandIcon:O,prefixCls:I,className:M,children:N()})};dA.Panel=zZ;const B5=dA;var fA=C.exports.createContext(null),V5=[];function FZ(e,t){var n=C.exports.useState(function(){if(!wo())return null;var I=document.createElement("div");return I}),r=ze(n,1),i=r[0],l=C.exports.useRef(!1),c=C.exports.useContext(fA),o=C.exports.useState(V5),h=ze(o,2),p=h[0],g=h[1],b=c||(l.current?void 0:function(I){g(function(A){var O=[I].concat(wt(A));return O})});function w(){i.parentElement||document.body.appendChild(i),l.current=!0}function P(){var I;(I=i.parentElement)===null||I===void 0||I.removeChild(i),l.current=!1}return si(function(){return e?c?c(w):w():P(),P},[e]),si(function(){p.length&&(p.forEach(function(I){return I()}),g(V5))},[p]),[i,b]}var __;function Iy(e){if(typeof document>"u")return 0;if(e||__===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 l=t.offsetWidth;i===l&&(l=n.clientWidth),document.body.removeChild(n),__=i-l}return __}function U5(e){var t=e.match(/^(.*)px$/),n=Number(t==null?void 0:t[1]);return Number.isNaN(n)?Iy():n}function j5(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:U5(n),height:U5(r)}}function $Z(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}var BZ="rc-util-locker-".concat(Date.now()),K5=0;function VZ(e){var t=!!e,n=C.exports.useState(function(){return K5+=1,"".concat(BZ,"_").concat(K5)}),r=ze(n,1),i=r[0];si(function(){if(t){var l=Iy(),c=$Z();Gp(` html body { overflow-y: hidden; `.concat(c?"width: calc(100% - ".concat(l,"px);"):"",` }`),i)}else P6(i);return function(){P6(i)}},[t,i])}var H5=!1;function UZ(e){return typeof e=="boolean"&&(H5=e),H5}var W5=function(t){return t===!1?!1:!wo()||!t?null:typeof t=="string"?document.querySelector(t):typeof t=="function"?t():t},jZ=C.exports.forwardRef(function(e,t){var n=e.open,r=e.autoLock,i=e.getContainer;e.debug;var l=e.autoDestroy,c=l===void 0?!0:l,o=e.children,h=C.exports.useState(n),p=ze(h,2),g=p[0],b=p[1],w=g||n;C.exports.useEffect(function(){(c||n)&&b(n)},[n,c]);var P=C.exports.useState(function(){return W5(i)}),I=ze(P,2),A=I[0],O=I[1];C.exports.useEffect(function(){var le=W5(i);O(le!=null?le:null)});var M=FZ(w&&!A),R=ze(M,2),N=R[0],z=R[1],B=A!=null?A:N;VZ(r&&n&&wo()&&(B===N||B===document.body));var U=null;if(o&&Sc(o)&&t){var q=o;U=q.ref}var H=VI(U,t);if(!w||!wo()||A===void 0)return null;var te=B===!1||UZ(),Y=o;return t&&(Y=C.exports.cloneElement(o,{ref:H})),E(fA.Provider,{value:z,children:te?Y:uu.exports.createPortal(Y,B)})});function My(e){var t=C.exports.useState(e),n=ze(t,2),r=n[0],i=n[1];return C.exports.useEffect(function(){var l=setTimeout(function(){i(e)},e.length?0:10);return function(){clearTimeout(l)}},[e]),r}var G5=[];function b_(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 hA(e){var t=e.help,n=e.helpStatus,r=e.errors,i=r===void 0?G5:r,l=e.warnings,c=l===void 0?G5:l,o=e.className,h=e.fieldId,p=e.onVisibleChanged,g=C.exports.useContext(l4),b=g.prefixCls,w=C.exports.useContext(Nn),P=w.getPrefixCls,I="".concat(b,"-item-explain"),A=P(),O=My(i),M=My(c),R=C.exports.useMemo(function(){return t!=null?[b_(t,n,"help")]:[].concat(wt(O.map(function(z,B){return b_(z,"error","error",B)})),wt(M.map(function(z,B){return b_(z,"warning","warning",B)})))},[t,n,O,M]),N={};return h&&(N.id="".concat(h,"_help")),E(Ca,{motionDeadline:Ap.motionDeadline,motionName:"".concat(A,"-show-help"),visible:!!R.length,onVisibleChanged:p,children:function(z){var B=z.className,U=z.style;return E("div",{...N,className:Ye(I,B,o),style:U,role:"alert",children:E(VM,{keys:R,...Ap,motionName:"".concat(A,"-show-help-item"),component:!1,children:function(q){var H=q.key,te=q.error,Y=q.errorStatus,le=q.className,J=q.style;return E("div",{className:Ye(le,se({},"".concat(I,"-").concat(Y),Y)),style:J,children:te},H)}})})}})}function q5(e){return typeof e=="object"&&e!=null&&e.nodeType===1}function Z5(e,t){return(!t||e!=="hidden")&&e!=="visible"&&e!=="clip"}function w_(e,t){if(e.clientHeightt||l>e&&c=t&&o>=n?l-e-r:c>t&&on?c-t+i:0}var X5=function(e,t){var n=window,r=t.scrollMode,i=t.block,l=t.inline,c=t.boundary,o=t.skipOverflowHiddenElements,h=typeof c=="function"?c:function(Pt){return Pt!==c};if(!q5(e))throw new TypeError("Invalid target");for(var p,g,b=document.scrollingElement||document.documentElement,w=[],P=e;q5(P)&&h(P);){if((P=(g=(p=P).parentElement)==null?p.getRootNode().host||null:g)===b){w.push(P);break}P!=null&&P===document.body&&w_(P)&&!w_(document.documentElement)||P!=null&&w_(P,o)&&w.push(P)}for(var I=n.visualViewport?n.visualViewport.width:innerWidth,A=n.visualViewport?n.visualViewport.height:innerHeight,O=window.scrollX||pageXOffset,M=window.scrollY||pageYOffset,R=e.getBoundingClientRect(),N=R.height,z=R.width,B=R.top,U=R.right,q=R.bottom,H=R.left,te=i==="start"||i==="nearest"?B:i==="end"?q:B+N/2,Y=l==="center"?H+z/2:l==="end"?U:H,le=[],J=0;J=0&&H>=0&&q<=A&&U<=I&&B>=de&&q<=ye&&H>=Re&&U<=oe)return le;var Te=getComputedStyle(Z),ke=parseInt(Te.borderLeftWidth,10),De=parseInt(Te.borderTopWidth,10),Me=parseInt(Te.borderRightWidth,10),Ne=parseInt(Te.borderBottomWidth,10),Le=0,Ve=0,qe="offsetWidth"in Z?Z.offsetWidth-Z.clientWidth-ke-Me:0,Ue="offsetHeight"in Z?Z.offsetHeight-Z.clientHeight-De-Ne:0,ct="offsetWidth"in Z?Z.offsetWidth===0?0:re/Z.offsetWidth:0,pt="offsetHeight"in Z?Z.offsetHeight===0?0:ge/Z.offsetHeight:0;if(b===Z)Le=i==="start"?te:i==="end"?te-A:i==="nearest"?Jv(M,M+A,A,De,Ne,M+te,M+te+N,N):te-A/2,Ve=l==="start"?Y:l==="center"?Y-I/2:l==="end"?Y-I:Jv(O,O+I,I,ke,Me,O+Y,O+Y+z,z),Le=Math.max(0,Le+M),Ve=Math.max(0,Ve+O);else{Le=i==="start"?te-de-De:i==="end"?te-ye+Ne+Ue:i==="nearest"?Jv(de,ye,ge,De,Ne+Ue,te,te+N,N):te-(de+ge/2)+Ue/2,Ve=l==="start"?Y-Re-ke:l==="center"?Y-(Re+re/2)+qe/2:l==="end"?Y-oe+Me+qe:Jv(Re,oe,re,ke,Me+qe,Y,Y+z,z);var Tt=Z.scrollLeft,Xe=Z.scrollTop;te+=Xe-(Le=Math.max(0,Math.min(Xe+Le/pt,Z.scrollHeight-ge/pt+Ue))),Y+=Tt-(Ve=Math.max(0,Math.min(Tt+Ve/ct,Z.scrollWidth-re/ct+qe)))}le.push({el:Z,top:Le,left:Ve})}return le};function pA(e){return e===Object(e)&&Object.keys(e).length!==0}function KZ(e,t){t===void 0&&(t="auto");var n="scrollBehavior"in document.body.style;e.forEach(function(r){var i=r.el,l=r.top,c=r.left;i.scroll&&n?i.scroll({top:l,left:c,behavior:t}):(i.scrollTop=l,i.scrollLeft=c)})}function HZ(e){return e===!1?{block:"end",inline:"nearest"}:pA(e)?e:{block:"start",inline:"nearest"}}function WZ(e,t){var n=e.isConnected||e.ownerDocument.documentElement.contains(e);if(pA(t)&&typeof t.behavior=="function")return t.behavior(n?X5(e,t):[]);if(!!n){var r=HZ(t);return KZ(X5(e,r),r.behavior)}}var GZ=["parentNode"],qZ="form_item";function rp(e){return e===void 0||e===!1?[]:Array.isArray(e)?e:[e]}function mA(e,t){if(!!e.length){var n=e.join("_");if(t)return"".concat(t,"_").concat(n);var r=GZ.includes(n);return r?"".concat(qZ,"_").concat(n):n}}function Y5(e){var t=rp(e);return t.join("_")}function vA(e){var t=LC(),n=ze(t,1),r=n[0],i=C.exports.useRef({}),l=C.exports.useMemo(function(){return e!=null?e:tt(tt({},r),{__INTERNAL__:{itemRef:function(o){return function(h){var p=Y5(o);h?i.current[p]=h:delete i.current[p]}}},scrollToField:function(o){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},p=rp(o),g=mA(p,l.__INTERNAL__.name),b=g?document.getElementById(g):null;b&&WZ(b,tt({scrollMode:"if-needed",block:"nearest"},h))},getFieldInstance:function(o){var h=Y5(o);return i.current[h]}})},[e,r]);return[l]}var ZZ=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||Ne.length>0||e.extra){var Lt=[];(e.help||Me.length>0)&&Lt.push("".concat(Xe,"_help")),e.extra&&Lt.push("".concat(Xe,"_extra")),Ct["aria-describedby"]=Lt.join(" ")}Me.length>0&&(Ct["aria-invalid"]="true"),Pt&&(Ct["aria-required"]="true"),Sc(o)&&(Ct.ref=Le(Tt,o));var lt=new Set([].concat(wt(rp(w)),wt(rp(q))));lt.forEach(function(ut){Ct[ut]=function(){for(var it,ft,xt,Wt,Ut,Qt=arguments.length,Fe=new Array(Qt),Ge=0;Ge"u"||e===null?"":String(e)}var zX=function(t){var n=t.inputElement,r=t.prefixCls,i=t.prefix,l=t.suffix,c=t.addonBefore,o=t.addonAfter,h=t.className,p=t.style,g=t.affixWrapperClassName,b=t.groupClassName,w=t.wrapperClassName,P=t.disabled,I=t.readOnly,A=t.focused,O=t.triggerFocus,M=t.allowClear,R=t.value,N=t.handleReset,z=t.hidden,B=C.exports.useRef(null),U=function(oe){var ye;(ye=B.current)!==null&&ye!==void 0&&ye.contains(oe.target)&&(O==null||O())},q=function(){var oe;if(!M)return null;var ye=!P&&!I&&R,Re="".concat(r,"-clear-icon"),Te=sn(M)==="object"&&M!==null&&M!==void 0&&M.clearIcon?M.clearIcon:"\u2716";return E("span",{onClick:N,onMouseDown:function(De){return De.preventDefault()},className:Ye(Re,(oe={},se(oe,"".concat(Re,"-hidden"),!ye),se(oe,"".concat(Re,"-has-suffix"),!!l),oe)),role:"button",tabIndex:-1,children:Te})},H=C.exports.cloneElement(n,{value:R,hidden:z});if(wA(t)){var te,Y="".concat(r,"-affix-wrapper"),le=Ye(Y,(te={},se(te,"".concat(Y,"-disabled"),P),se(te,"".concat(Y,"-focused"),A),se(te,"".concat(Y,"-readonly"),I),se(te,"".concat(Y,"-input-with-clear-btn"),l&&M&&R),te),!kg(t)&&h,g),J=(l||M)&&Qe("span",{className:"".concat(r,"-suffix"),children:[q(),l]});H=Qe("span",{className:le,style:p,hidden:!kg(t)&&z,onClick:U,ref:B,children:[i&&E("span",{className:"".concat(r,"-prefix"),children:i}),C.exports.cloneElement(n,{style:null,value:R,hidden:null}),J]})}if(kg(t)){var Z="".concat(r,"-group"),Q="".concat(Z,"-addon"),ge=Ye("".concat(r,"-wrapper"),Z,w),re=Ye("".concat(r,"-group-wrapper"),h,b);return E("span",{className:re,style:p,hidden:z,children:Qe("span",{className:ge,children:[c&&E("span",{className:Q,children:c}),C.exports.cloneElement(H,{style:null,hidden:null}),o&&E("span",{className:Q,children:o})]})})}return H},FX=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","type","inputClassName"],$X=C.exports.forwardRef(function(e,t){var n=e.autoComplete,r=e.onChange,i=e.onFocus,l=e.onBlur,c=e.onPressEnter,o=e.onKeyDown,h=e.prefixCls,p=h===void 0?"rc-input":h,g=e.disabled,b=e.htmlSize,w=e.className,P=e.maxLength,I=e.suffix,A=e.showCount,O=e.type,M=O===void 0?"text":O,R=e.inputClassName,N=In(e,FX),z=Vi(e.defaultValue,{value:e.value}),B=ze(z,2),U=B[0],q=B[1],H=C.exports.useState(!1),te=ze(H,2),Y=te[0],le=te[1],J=C.exports.useRef(null),Z=function(ke){J.current&&LX(J.current,ke)};C.exports.useImperativeHandle(t,function(){return{focus:Z,blur:function(){var ke;(ke=J.current)===null||ke===void 0||ke.blur()},setSelectionRange:function(ke,De,Me){var Ne;(Ne=J.current)===null||Ne===void 0||Ne.setSelectionRange(ke,De,Me)},select:function(){var ke;(ke=J.current)===null||ke===void 0||ke.select()},input:J.current}}),C.exports.useEffect(function(){le(function(Te){return Te&&g?!1:Te})},[g]);var Q=function(ke){e.value===void 0&&q(ke.target.value),J.current&&ik(J.current,ke,r)},ge=function(ke){c&&ke.key==="Enter"&&c(ke),o==null||o(ke)},re=function(ke){le(!0),i==null||i(ke)},de=function(ke){le(!1),l==null||l(ke)},oe=function(ke){q(""),Z(),J.current&&ik(J.current,ke,r)},ye=function(){var ke=mi(e,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","affixWrapperClassName","groupClassName","inputClassName","wrapperClassName","htmlSize"]);return E("input",{autoComplete:n,...ke,onChange:Q,onFocus:re,onBlur:de,onKeyDown:ge,className:Ye(p,se({},"".concat(p,"-disabled"),g),R,!kg(e)&&!wA(e)&&w),ref:J,size:b,type:M})},Re=function(){var ke=Number(P)>0;if(I||A){var De=ok(U),Me=wt(De).length,Ne=sn(A)==="object"?A.formatter({value:De,count:Me,maxLength:P}):"".concat(Me).concat(ke?" / ".concat(P):"");return Qe($n,{children:[!!A&&E("span",{className:Ye("".concat(p,"-show-count-suffix"),se({},"".concat(p,"-show-count-has-suffix"),!!I)),children:Ne}),I]})}return null};return E(zX,{...N,prefixCls:p,className:w,inputElement:ye(),handleReset:oe,value:ok(U),focused:Y,triggerFocus:Z,suffix:Re(),disabled:g})});function CA(e,t){var n=C.exports.useRef([]),r=function(){n.current.push(setTimeout(function(){var l,c,o,h;((l=e.current)===null||l===void 0?void 0:l.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"))&&((h=e.current)===null||h===void 0||h.input.removeAttribute("value"))}))};return C.exports.useEffect(function(){return t&&r(),function(){return n.current.forEach(function(i){i&&clearTimeout(i)})}},[]),r}function BX(e){return!!(e.prefix||e.suffix||e.allowClear)}var VX=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 C_(e,t,n,r){if(!!n){var i=t;if(t.type==="click"){var l=e.cloneNode(!0);i=Object.create(t,{target:{value:l},currentTarget:{value:l}}),l.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 jX(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 KX=C.exports.forwardRef(function(e,t){var n,r,i,l=e.prefixCls,c=e.bordered,o=c===void 0?!0:c,h=e.status,p=e.size,g=e.disabled,b=e.onBlur,w=e.onFocus,P=e.suffix,I=e.allowClear,A=e.addonAfter,O=e.addonBefore,M=e.className,R=e.onChange,N=VX(e,["prefixCls","bordered","status","size","disabled","onBlur","onFocus","suffix","allowClear","addonAfter","addonBefore","className","onChange"]),z=tr.useContext(Nn),B=z.getPrefixCls,U=z.direction,q=z.input,H=B("input",l),te=C.exports.useRef(null),Y=ff(H,U),le=Y.compactSize,J=Y.compactItemClassnames,Z=tr.useContext(ms),Q=le||p||Z,ge=tr.useContext(pu),re=g!=null?g:ge,de=C.exports.useContext(Yo),oe=de.status,ye=de.hasFeedback,Re=de.feedbackIcon,Te=Xp(oe,h),ke=BX(e)||!!ye,De=C.exports.useRef(ke);C.exports.useEffect(function(){ke&&De.current,De.current=ke},[ke]);var Me=CA(te,!0),Ne=function(pt){Me(),b==null||b(pt)},Le=function(pt){Me(),w==null||w(pt)},Ve=function(pt){Me(),R==null||R(pt)},qe=(ye||P)&&Qe($n,{children:[P,ye&&Re]}),Ue;return sn(I)==="object"&&(I==null?void 0:I.clearIcon)?Ue=I:I&&(Ue={clearIcon:E(kc,{})}),E($X,{ref:Lo(t,te),prefixCls:H,autoComplete:q==null?void 0:q.autoComplete,...N,disabled:re||void 0,onBlur:Ne,onFocus:Le,suffix:qe,allowClear:Ue,className:Ye(M,J),onChange:Ve,addonAfter:A&&E(xy,{children:E(I2,{override:!0,status:!0,children:A})}),addonBefore:O&&E(xy,{children:E(I2,{override:!0,status:!0,children:O})}),inputClassName:Ye((n={},se(n,"".concat(H,"-sm"),Q==="small"),se(n,"".concat(H,"-lg"),Q==="large"),se(n,"".concat(H,"-rtl"),U==="rtl"),se(n,"".concat(H,"-borderless"),!o),n),!ke&&eu(H,Te)),affixWrapperClassName:Ye((r={},se(r,"".concat(H,"-affix-wrapper-sm"),Q==="small"),se(r,"".concat(H,"-affix-wrapper-lg"),Q==="large"),se(r,"".concat(H,"-affix-wrapper-rtl"),U==="rtl"),se(r,"".concat(H,"-affix-wrapper-borderless"),!o),r),eu("".concat(H,"-affix-wrapper"),Te,ye)),wrapperClassName:Ye(se({},"".concat(H,"-group-rtl"),U==="rtl")),groupClassName:Ye((i={},se(i,"".concat(H,"-group-wrapper-sm"),Q==="small"),se(i,"".concat(H,"-group-wrapper-lg"),Q==="large"),se(i,"".concat(H,"-group-wrapper-rtl"),U==="rtl"),i),eu("".concat(H,"-group-wrapper"),Te,ye))})});const T4=KX;var HX={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 WX=HX;var SA=function(t,n){return E(lr,{...ve(ve({},t),{},{ref:n,icon:WX})})};SA.displayName="EyeInvisibleOutlined";const GX=C.exports.forwardRef(SA);var qX=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&&S_[n])return S_[n];var r=window.getComputedStyle(e),i=r.getPropertyValue("box-sizing")||r.getPropertyValue("-moz-box-sizing")||r.getPropertyValue("-webkit-box-sizing"),l=parseFloat(r.getPropertyValue("padding-bottom"))+parseFloat(r.getPropertyValue("padding-top")),c=parseFloat(r.getPropertyValue("border-bottom-width"))+parseFloat(r.getPropertyValue("border-top-width")),o=rY.map(function(p){return"".concat(p,":").concat(r.getPropertyValue(p))}).join(";"),h={sizingStyle:o,paddingSize:l,borderSize:c,boxSizing:i};return t&&n&&(S_[n]=h),h}function oY(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;ha||(ha=document.createElement("textarea"),ha.setAttribute("tab-index","-1"),ha.setAttribute("aria-hidden","true"),document.body.appendChild(ha)),e.getAttribute("wrap")?ha.setAttribute("wrap",e.getAttribute("wrap")):ha.removeAttribute("wrap");var i=iY(e,t),l=i.paddingSize,c=i.borderSize,o=i.boxSizing,h=i.sizingStyle;ha.setAttribute("style","".concat(h,";").concat(nY)),ha.value=e.value||e.placeholder||"";var p=void 0,g=void 0,b,w=ha.scrollHeight;if(o==="border-box"?w+=c:o==="content-box"&&(w-=l),n!==null||r!==null){ha.value=" ";var P=ha.scrollHeight-l;n!==null&&(p=P*n,o==="border-box"&&(p=p+l+c),w=Math.max(p,w)),r!==null&&(g=P*r,o==="border-box"&&(g=g+l+c),b=w>g?"":"hidden",w=Math.min(g,w))}var I={height:w,overflowY:b,resize:"none"};return p&&(I.minHeight=p),g&&(I.maxHeight=g),I}var aY=["prefixCls","onPressEnter","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],E_=0,k_=1,T_=2,sY=C.exports.forwardRef(function(e,t){var n=e.prefixCls,r=n===void 0?"rc-textarea":n;e.onPressEnter;var i=e.defaultValue,l=e.value,c=e.autoSize,o=e.onResize,h=e.className,p=e.style,g=e.disabled,b=e.onChange;e.onInternalAutoSize;var w=In(e,aY),P=Vi(i,{value:l,postState:function(Me){return Me!=null?Me:""}}),I=ze(P,2),A=I[0],O=I[1],M=function(Me){O(Me.target.value),b==null||b(Me)},R=C.exports.useRef();C.exports.useImperativeHandle(t,function(){return{textArea:R.current}});var N=C.exports.useMemo(function(){return c&&sn(c)==="object"?[c.minRows,c.maxRows]:[]},[c]),z=ze(N,2),B=z[0],U=z[1],q=!!c,H=function(){try{if(document.activeElement===R.current){var Me=R.current,Ne=Me.selectionStart,Le=Me.selectionEnd,Ve=Me.scrollTop;R.current.setSelectionRange(Ne,Le),R.current.scrollTop=Ve}}catch{}},te=C.exports.useState(T_),Y=ze(te,2),le=Y[0],J=Y[1],Z=C.exports.useState(),Q=ze(Z,2),ge=Q[0],re=Q[1],de=function(){J(E_)};si(function(){q&&de()},[l,B,U,q]),si(function(){if(le===E_)J(k_);else if(le===k_){var De=oY(R.current,!1,B,U);J(T_),re(De)}else H()},[le]);var oe=C.exports.useRef(),ye=function(){nr.cancel(oe.current)},Re=function(Me){le===T_&&(o==null||o(Me),c&&(ye(),oe.current=nr(function(){de()})))};C.exports.useEffect(function(){return ye},[]);var Te=q?ge:null,ke=ve(ve({},p),Te);return(le===E_||le===k_)&&(ke.overflowY="hidden",ke.overflowX="hidden"),E(ol,{onResize:Re,disabled:!(c||o),children:E("textarea",{...w,ref:R,style:ke,className:Ye(r,h,se({},"".concat(r,"-disabled"),g)),disabled:g,value:A,onChange:M})})}),lY=function(e){li(n,e);var t=ui(n);function n(r){var i;Kr(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,h=o.onPressEnter,p=o.onKeyDown;c.keyCode===13&&h&&h(c),p&&p(c)};var l=typeof r.value>"u"||r.value===null?r.defaultValue:r.value;return i.state={value:l},i}return Hr(n,[{key:"setValue",value:function(i,l){"value"in this.props||this.setState({value:i},l)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return E(sY,{...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),uY=ra("text","input");function cY(e){return!!(e.addonBefore||e.addonAfter)}var dY=function(e){li(n,e);var t=ui(n);function n(){return Kr(this,n),t.apply(this,arguments)}return Hr(n,[{key:"renderClearIcon",value:function(i){var l,c=this.props,o=c.value,h=c.disabled,p=c.readOnly,g=c.handleReset,b=c.suffix,w=!h&&!p&&o,P="".concat(i,"-clear-icon");return E(kc,{onClick:g,onMouseDown:function(A){return A.preventDefault()},className:Ye((l={},se(l,"".concat(P,"-hidden"),!w),se(l,"".concat(P,"-has-suffix"),!!b),l),P),role:"button"})}},{key:"renderTextAreaWithClearIcon",value:function(i,l,c){var o,h=this.props,p=h.value,g=h.allowClear,b=h.className,w=h.style,P=h.direction,I=h.bordered,A=h.hidden,O=h.status,M=c.status,R=c.hasFeedback;if(!g)return Ei(l,{value:p});var N=Ye("".concat(i,"-affix-wrapper"),"".concat(i,"-affix-wrapper-textarea-with-clear-btn"),eu("".concat(i,"-affix-wrapper"),Xp(M,O),R),(o={},se(o,"".concat(i,"-affix-wrapper-rtl"),P==="rtl"),se(o,"".concat(i,"-affix-wrapper-borderless"),!I),se(o,"".concat(b),!cY(this.props)&&b),o));return Qe("span",{className:N,style:w,hidden:A,children:[Ei(l,{style:null,value:p}),this.renderClearIcon(i)]})}},{key:"render",value:function(){var i=this;return E(Yo.Consumer,{children:function(l){var c=i.props,o=c.prefixCls,h=c.inputType,p=c.element;if(h===uY[0])return i.renderTextAreaWithClearIcon(o,p,l)}})}}]),n}(C.exports.Component);const fY=dY;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);ir&&(i=t),i}var pY=C.exports.forwardRef(function(e,t){var n,r=e.prefixCls,i=e.bordered,l=i===void 0?!0:i,c=e.showCount,o=c===void 0?!1:c,h=e.maxLength,p=e.className,g=e.style,b=e.size,w=e.disabled,P=e.onCompositionStart,I=e.onCompositionEnd,A=e.onChange,O=e.status,M=hY(e,["prefixCls","bordered","showCount","maxLength","className","style","size","disabled","onCompositionStart","onCompositionEnd","onChange","status"]),R=C.exports.useContext(Nn),N=R.getPrefixCls,z=R.direction,B=C.exports.useContext(ms),U=C.exports.useContext(pu),q=w!=null?w:U,H=C.exports.useContext(Yo),te=H.status,Y=H.hasFeedback,le=H.isFormItemInput,J=H.feedbackIcon,Z=Xp(te,O),Q=C.exports.useRef(null),ge=C.exports.useRef(null),re=C.exports.useState(!1),de=ze(re,2),oe=de[0],ye=de[1],Re=C.exports.useRef(),Te=C.exports.useRef(0),ke=Vi(M.defaultValue,{value:M.value}),De=ze(ke,2),Me=De[0],Ne=De[1],Le=M.hidden,Ve=function(ut,it){M.value===void 0&&(Ne(ut),it==null||it())},qe=Number(h)>0,Ue=function(ut){ye(!0),Re.current=Me,Te.current=ut.currentTarget.selectionStart,P==null||P(ut)},ct=function(ut){var it;ye(!1);var ft=ut.currentTarget.value;if(qe){var xt=Te.current>=h+1||Te.current===((it=Re.current)===null||it===void 0?void 0:it.length);ft=ak(xt,Re.current,ft,h)}ft!==Me&&(Ve(ft),C_(ut.currentTarget,ut,A,ft)),I==null||I(ut)},pt=function(ut){var it=ut.target.value;if(!oe&&qe){var ft=ut.target.selectionStart>=h+1||ut.target.selectionStart===it.length||!ut.target.selectionStart;it=ak(ft,Me,it,h)}Ve(it),C_(ut.currentTarget,ut,A,it)},Tt=function(ut){var it,ft,xt;Ve(""),(it=Q.current)===null||it===void 0||it.focus(),C_((xt=(ft=Q.current)===null||ft===void 0?void 0:ft.resizableTextArea)===null||xt===void 0?void 0:xt.textArea,ut,A)},Xe=N("input",r);C.exports.useImperativeHandle(t,function(){var dt;return{resizableTextArea:(dt=Q.current)===null||dt===void 0?void 0:dt.resizableTextArea,focus:function(it){var ft,xt;jX((xt=(ft=Q.current)===null||ft===void 0?void 0:ft.resizableTextArea)===null||xt===void 0?void 0:xt.textArea,it)},blur:function(){var it;return(it=Q.current)===null||it===void 0?void 0:it.blur()}}});var Pt=E(lY,{...mi(M,["allowClear"]),disabled:q,className:Ye((n={},se(n,"".concat(Xe,"-borderless"),!l),se(n,p,p&&!o),se(n,"".concat(Xe,"-sm"),B==="small"||b==="small"),se(n,"".concat(Xe,"-lg"),B==="large"||b==="large"),n),eu(Xe,Z)),style:o?{resize:g==null?void 0:g.resize}:g,prefixCls:Xe,onCompositionStart:Ue,onChange:pt,onCompositionEnd:ct,ref:Q}),mt=UX(Me);!oe&&qe&&(M.value===null||M.value===void 0)&&(mt=EA(mt,h));var Mt=E(fY,{disabled:q,...M,prefixCls:Xe,direction:z,inputType:"text",value:mt,element:Pt,handleReset:Tt,ref:ge,bordered:l,status:O,style:o?void 0:g});if(o||Y){var Ct,Lt=wt(mt).length,lt="";return sn(o)==="object"?lt=o.formatter({value:mt,count:Lt,maxLength:h}):lt="".concat(Lt).concat(qe?" / ".concat(h):""),Qe("div",{hidden:Le,className:Ye("".concat(Xe,"-textarea"),(Ct={},se(Ct,"".concat(Xe,"-textarea-rtl"),z==="rtl"),se(Ct,"".concat(Xe,"-textarea-show-count"),o),se(Ct,"".concat(Xe,"-textarea-in-form-item"),le),Ct),eu("".concat(Xe,"-textarea"),Z,Y),p),style:g,"data-count":lt,children:[Mt,Y&&E("span",{className:"".concat(Xe,"-textarea-suffix"),children:J})]})}return Mt});const kA=pY;var rm=T4;rm.Group=DX;rm.Search=tY;rm.TextArea=kA;rm.Password=QX;const Kl=rm;var mY={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 vY=mY;var TA=function(t,n){return E(lr,{...ve(ve({},t),{},{ref:n,icon:vY})})};TA.displayName="DoubleLeftOutlined";const gY=C.exports.forwardRef(TA);var yY={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 xY=yY;var PA=function(t,n){return E(lr,{...ve(ve({},t),{},{ref:n,icon:xY})})};PA.displayName="DoubleRightOutlined";const _Y=C.exports.forwardRef(PA);var Ih=function(t){var n,r="".concat(t.rootPrefixCls,"-item"),i=Ye(r,"".concat(r,"-").concat(t.page),(n={},se(n,"".concat(r,"-active"),t.active),se(n,"".concat(r,"-disabled"),!t.page),se(n,t.className,!!t.className),n)),l=function(){t.onClick(t.page)},c=function(h){t.onKeyPress(h,t.onClick,t.page)};return E("li",{title:t.showTitle?t.page:null,className:i,onClick:l,onKeyPress:c,tabIndex:"0",children:t.itemRender(t.page,"page",E("a",{rel:"nofollow",children:t.page}))})};const Zu={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40};var IA=function(e){li(n,e);var t=ui(n);function n(){var r;Kr(this,n);for(var i=arguments.length,l=new Array(i),c=0;c=0||o.relatedTarget.className.indexOf("".concat(b,"-item"))>=0))&&g(r.getValidValue()))},r.go=function(o){var h=r.state.goInputText;h!==""&&(o.keyCode===Zu.ENTER||o.type==="click")&&(r.setState({goInputText:""}),r.props.quickGo(r.getValidValue()))},r}return Hr(n,[{key:"getValidValue",value:function(){var i=this.state.goInputText;return!i||isNaN(i)?void 0:Number(i)}},{key:"getPageSizeOptions",value:function(){var i=this.props,l=i.pageSize,c=i.pageSizeOptions;return c.some(function(o){return o.toString()===l.toString()})?c:c.concat([l.toString()]).sort(function(o,h){var p=isNaN(Number(o))?0:Number(o),g=isNaN(Number(h))?0:Number(h);return p-g})}},{key:"render",value:function(){var i=this,l=this.props,c=l.pageSize,o=l.locale,h=l.rootPrefixCls,p=l.changeSize,g=l.quickGo,b=l.goButton,w=l.selectComponentClass,P=l.buildOptionText,I=l.selectPrefixCls,A=l.disabled,O=this.state.goInputText,M="".concat(h,"-options"),R=w,N=null,z=null,B=null;if(!p&&!g)return null;var U=this.getPageSizeOptions();if(p&&R){var q=U.map(function(H,te){return E(R.Option,{value:H.toString(),children:(P||i.buildOptionText)(H)},te)});N=E(R,{disabled:A,prefixCls:I,showSearch:!1,className:"".concat(M,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(c||U[0]).toString(),onChange:this.changeSize,getPopupContainer:function(te){return te.parentNode},"aria-label":o.page_size,defaultOpen:!1,children:q})}return g&&(b&&(B=typeof b=="boolean"?E("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:A,className:"".concat(M,"-quick-jumper-button"),children:o.jump_to_confirm}):E("span",{onClick:this.go,onKeyUp:this.go,children:b})),z=Qe("div",{className:"".concat(M,"-quick-jumper"),children:[o.jump_to,E("input",{disabled:A,type:"text",value:O,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur,"aria-label":o.page}),o.page,B]})),Qe("li",{className:"".concat(M),children:[N,z]})}}]),n}(tr.Component);IA.defaultProps={pageSizeOptions:["10","20","50","100"]};const bY={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 B2(){}function sk(e){var t=Number(e);return typeof t=="number"&&!isNaN(t)&&isFinite(t)&&Math.floor(t)===t}function wY(e,t,n){return n}function Tl(e,t,n){var r=typeof e>"u"?t.pageSize:e;return Math.floor((n.total-1)/r)+1}var MA=function(e){li(n,e);var t=ui(n);function n(r){var i;Kr(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(Tl(void 0,i.state,i.props),i.state.current+(i.props.showLessItems?3:5))},i.getItemIcon=function(p,g){var b=i.props.prefixCls,w=p||E("button",{type:"button","aria-label":g,className:"".concat(b,"-item-link")});return typeof p=="function"&&(w=tr.createElement(p,ve({},i.props))),w},i.savePaginationNode=function(p){i.paginationNode=p},i.isValid=function(p){var g=i.props.total;return sk(p)&&p!==i.state.current&&sk(g)&&g>0},i.shouldDisplayQuickJumper=function(){var p=i.props,g=p.showQuickJumper,b=p.total,w=i.state.pageSize;return b<=w?!1:g},i.handleKeyDown=function(p){(p.keyCode===Zu.ARROW_UP||p.keyCode===Zu.ARROW_DOWN)&&p.preventDefault()},i.handleKeyUp=function(p){var g=i.getValidValue(p),b=i.state.currentInputValue;g!==b&&i.setState({currentInputValue:g}),p.keyCode===Zu.ENTER?i.handleChange(g):p.keyCode===Zu.ARROW_UP?i.handleChange(g-1):p.keyCode===Zu.ARROW_DOWN&&i.handleChange(g+1)},i.handleBlur=function(p){var g=i.getValidValue(p);i.handleChange(g)},i.changePageSize=function(p){var g=i.state.current,b=Tl(p,i.state,i.props);g=g>b?b:g,b===0&&(g=i.state.current),typeof p=="number"&&("pageSize"in i.props||i.setState({pageSize:p}),"current"in i.props||i.setState({current:g,currentInputValue:g})),i.props.onShowSizeChange(g,p),"onChange"in i.props&&i.props.onChange&&i.props.onChange(g,p)},i.handleChange=function(p){var g=i.props,b=g.disabled,w=g.onChange,P=i.state,I=P.pageSize,A=P.current,O=P.currentInputValue;if(i.isValid(p)&&!b){var M=Tl(void 0,i.state,i.props),R=p;return p>M?R=M:p<1&&(R=1),"current"in i.props||i.setState({current:R}),R!==O&&i.setState({currentInputValue:R}),w(R,I),R}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?b-2:0),P=2;P=c?h=c:h=Number(l),h}},{key:"getShowSizeChanger",value:function(){var i=this.props,l=i.showSizeChanger,c=i.total,o=i.totalBoundaryShowSizeChanger;return typeof l<"u"?l:c>o}},{key:"renderPrev",value:function(i){var l=this.props,c=l.prevIcon,o=l.itemRender,h=o(i,"prev",this.getItemIcon(c,"prev page")),p=!this.hasPrev();return C.exports.isValidElement(h)?C.exports.cloneElement(h,{disabled:p}):h}},{key:"renderNext",value:function(i){var l=this.props,c=l.nextIcon,o=l.itemRender,h=o(i,"next",this.getItemIcon(c,"next page")),p=!this.hasNext();return C.exports.isValidElement(h)?C.exports.cloneElement(h,{disabled:p}):h}},{key:"render",value:function(){var i=this,l=this.props,c=l.prefixCls,o=l.className,h=l.style,p=l.disabled,g=l.hideOnSinglePage,b=l.total,w=l.locale,P=l.showQuickJumper,I=l.showLessItems,A=l.showTitle,O=l.showTotal,M=l.simple,R=l.itemRender,N=l.showPrevNextJumpers,z=l.jumpPrevIcon,B=l.jumpNextIcon,U=l.selectComponentClass,q=l.selectPrefixCls,H=l.pageSizeOptions,te=this.state,Y=te.current,le=te.pageSize,J=te.currentInputValue;if(g===!0&&b<=le)return null;var Z=Tl(void 0,this.state,this.props),Q=[],ge=null,re=null,de=null,oe=null,ye=null,Re=P&&P.goButton,Te=I?1:2,ke=Y-1>0?Y-1:0,De=Y+1b?b:Y*le])});if(M)return Re&&(typeof Re=="boolean"?ye=E("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO,children:w.jump_to_confirm}):ye=E("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO,children:Re}),ye=E("li",{title:A?"".concat(w.jump_to).concat(Y,"/").concat(Z):null,className:"".concat(c,"-simple-pager"),children:ye})),Qe("ul",{className:Ye(c,"".concat(c,"-simple"),se({},"".concat(c,"-disabled"),p),o),style:h,ref:this.savePaginationNode,...Me,children:[Ne,E("li",{title:A?w.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:Ye("".concat(c,"-prev"),se({},"".concat(c,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev(),children:this.renderPrev(ke)}),Qe("li",{title:A?"".concat(Y,"/").concat(Z):null,className:"".concat(c,"-simple-pager"),children:[E("input",{type:"text",value:J,disabled:p,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,onBlur:this.handleBlur,size:"3"}),E("span",{className:"".concat(c,"-slash"),children:"/"}),Z]}),E("li",{title:A?w.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:Ye("".concat(c,"-next"),se({},"".concat(c,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext(),children:this.renderNext(De)}),ye]});if(Z<=3+Te*2){var Le={locale:w,rootPrefixCls:c,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:A,itemRender:R};Z||Q.push(C.exports.createElement(Ih,{...Le,key:"noPager",page:1,className:"".concat(c,"-item-disabled")}));for(var Ve=1;Ve<=Z;Ve+=1){var qe=Y===Ve;Q.push(C.exports.createElement(Ih,{...Le,key:Ve,page:Ve,active:qe}))}}else{var Ue=I?w.prev_3:w.prev_5,ct=I?w.next_3:w.next_5;N&&(ge=E("li",{title:A?Ue:null,onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:Ye("".concat(c,"-jump-prev"),se({},"".concat(c,"-jump-prev-custom-icon"),!!z)),children:R(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(z,"prev page"))},"prev"),re=E("li",{title:A?ct:null,tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:Ye("".concat(c,"-jump-next"),se({},"".concat(c,"-jump-next-custom-icon"),!!B)),children:R(this.getJumpNextPage(),"jump-next",this.getItemIcon(B,"next page"))},"next")),oe=E(Ih,{locale:w,last:!0,rootPrefixCls:c,onClick:this.handleChange,onKeyPress:this.runIfEnter,page:Z,active:!1,showTitle:A,itemRender:R},Z),de=E(Ih,{locale:w,rootPrefixCls:c,onClick:this.handleChange,onKeyPress:this.runIfEnter,page:1,active:!1,showTitle:A,itemRender:R},1);var pt=Math.max(1,Y-Te),Tt=Math.min(Y+Te,Z);Y-1<=Te&&(Tt=1+Te*2),Z-Y<=Te&&(pt=Z-Te*2);for(var Xe=pt;Xe<=Tt;Xe+=1){var Pt=Y===Xe;Q.push(E(Ih,{locale:w,rootPrefixCls:c,onClick:this.handleChange,onKeyPress:this.runIfEnter,page:Xe,active:Pt,showTitle:A,itemRender:R},Xe))}Y-1>=Te*2&&Y!==1+2&&(Q[0]=C.exports.cloneElement(Q[0],{className:"".concat(c,"-item-after-jump-prev")}),Q.unshift(ge)),Z-Y>=Te*2&&Y!==Z-2&&(Q[Q.length-1]=C.exports.cloneElement(Q[Q.length-1],{className:"".concat(c,"-item-before-jump-next")}),Q.push(re)),pt!==1&&Q.unshift(de),Tt!==Z&&Q.push(oe)}var mt=!this.hasPrev()||!Z,Mt=!this.hasNext()||!Z;return Qe("ul",{className:Ye(c,o,se({},"".concat(c,"-disabled"),p)),style:h,ref:this.savePaginationNode,...Me,children:[Ne,E("li",{title:A?w.prev_page:null,onClick:this.prev,tabIndex:mt?null:0,onKeyPress:this.runIfEnterPrev,className:Ye("".concat(c,"-prev"),se({},"".concat(c,"-disabled"),mt)),"aria-disabled":mt,children:this.renderPrev(ke)}),Q,E("li",{title:A?w.next_page:null,onClick:this.next,tabIndex:Mt?null:0,onKeyPress:this.runIfEnterNext,className:Ye("".concat(c,"-next"),se({},"".concat(c,"-disabled"),Mt)),"aria-disabled":Mt,children:this.renderNext(De)}),E(IA,{disabled:p,locale:w,rootPrefixCls:c,selectComponentClass:U,selectPrefixCls:q,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:Y,pageSize:le,pageSizeOptions:H,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Re})]})}}],[{key:"getDerivedStateFromProps",value:function(i,l){var c={};if("current"in i&&(c.current=i.current,i.current!==l.current&&(c.currentInputValue=c.current)),"pageSize"in i&&i.pageSize!==l.pageSize){var o=l.current,h=Tl(i.pageSize,l,i);o=o>h?h:o,"current"in i||(c.current=o,c.currentInputValue=o),c.pageSize=i.pageSize}return c}}]),n}(tr.Component);MA.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:B2,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:B2,locale:bY,style:{},itemRender:wY,totalBoundaryShowSizeChanger:50};var RA=function(t){return E(tl,{...t,size:"small"})},AA=function(t){return E(tl,{...t,size:"middle"})};RA.Option=tl.Option;AA.Option=tl.Option;var CY=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 R,N=I[O],z=N+A,B=[];r.forEach(function(Y){B.push(Y.value)}),B.push(e,t),B.push(o(N));var U=A>0?1:-1;M==="unit"?B.push(o(N+U*n)):B.push(o(z)),B=B.filter(function(Y){return Y!==null}).filter(function(Y){return A<0?Y<=N:Y>=N}),M==="unit"&&(B=B.filter(function(Y){return Y!==N}));var q=M==="unit"?N:z;R=B[0];var H=Math.abs(R-q);if(B.forEach(function(Y){var le=Math.abs(Y-q);le1){var te=wt(I);return te[O]=R,P(te,A-U,O,M)}return R}else{if(A==="min")return e;if(A==="max")return t}},g=function(I,A,O){var M=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"unit",R=I[O],N=p(I,A,O,M);return{value:N,changed:N!==R}},b=function(I){return l===null&&I===0||typeof l=="number"&&I3&&arguments[3]!==void 0?arguments[3]:"unit",R=I.map(h),N=R[O],z=p(R,A,O,M);if(R[O]=z,i===!1){var B=l||0;O>0&&R[O-1]!==N&&(R[O]=Math.max(R[O],R[O-1]+B)),O0;te-=1)for(var Y=!0;b(R[te]-R[te-1])&&Y;){var le=g(R,-1,te-1);R[te-1]=le.value,Y=le.changed}for(var J=R.length-1;J>0;J-=1)for(var Z=!0;b(R[J]-R[J-1])&&Z;){var Q=g(R,-1,J-1);R[J-1]=Q.value,Z=Q.changed}for(var ge=0;ge=0?J:!1},[J,Ct]),lt=C.exports.useMemo(function(){var me=Object.keys(Me||{});return me.map(function(K){var G=Me[K],ce={value:Number(K)};return G&&sn(G)==="object"&&!C.exports.isValidElement(G)&&("label"in G||"style"in G)?(ce.style=G.style,ce.label=G.label):ce.label=G,ce}).filter(function(K){var G=K.label;return G||typeof G=="number"}).sort(function(K,G){return K.value-G.value})},[Me]),dt=bQ(mt,Mt,Ct,lt,Y,Lt),ut=ze(dt,2),it=ut[0],ft=ut[1],xt=Vi(N,{value:R}),Wt=ze(xt,2),Ut=Wt[0],Qt=Wt[1],Fe=C.exports.useMemo(function(){var me=Ut==null?[]:Array.isArray(Ut)?Ut:[Ut],K=ze(me,1),G=K[0],ce=G===void 0?mt:G,ae=Ut===null?[]:[ce];if(z){if(ae=wt(me),B||Ut===void 0){var xe=B>=0?B+1:2;for(ae=ae.slice(0,xe);ae.length=0&&Tt.current.focus(me)}_t(null)},[An]);var an=C.exports.useMemo(function(){return Z&&Ct===null?!1:Z},[Z,Ct]),Fn=function(){H==null||H(Xt(Ge.current))},kn=pQ(Xe,Pt,Fe,mt,Mt,it,dn,Fn,ft),zt=ze(kn,4),Tn=zt[0],Cn=zt[1],hn=zt[2],Nt=zt[3],ot=function(K,G){Nt(K,G),q==null||q(Xt(Ge.current))},ht=Tn!==-1;C.exports.useEffect(function(){if(!ht){var me=Fe.lastIndexOf(Cn);Tt.current.focus(me)}},[ht]);var At=C.exports.useMemo(function(){return wt(hn).sort(function(me,K){return me-K})},[hn]),$t=C.exports.useMemo(function(){return z?[At[0],At[At.length-1]]:[mt,At[0]]},[At,z,mt]),cn=ze($t,2),Mn=cn[0],Gn=cn[1];C.exports.useImperativeHandle(t,function(){return{focus:function(){Tt.current.focus(0)},blur:function(){var K=document,G=K.activeElement;Xe.current.contains(G)&&(G==null||G.blur())}}}),C.exports.useEffect(function(){p&&Tt.current.focus(0)},[]);var qn=C.exports.useMemo(function(){return{min:mt,max:Mt,direction:Pt,disabled:h,step:Ct,included:de,includedStart:Mn,includedEnd:Gn,range:z,tabIndex:qe,ariaLabelForHandle:Ue,ariaLabelledByForHandle:ct,ariaValueTextFormatterForHandle:pt}},[mt,Mt,Pt,h,Ct,de,Mn,Gn,z,qe,Ue,ct,pt]);return E(Tc.Provider,{value:qn,children:Qe("div",{ref:Xe,className:Ye(i,l,(n={},se(n,"".concat(i,"-disabled"),h),se(n,"".concat(i,"-vertical"),ge),se(n,"".concat(i,"-horizontal"),!ge),se(n,"".concat(i,"-with-marks"),lt.length),n)),style:c,onMouseDown:jt,children:[E("div",{className:"".concat(i,"-rail"),style:Te}),E(vQ,{prefixCls:i,style:ye,values:At,startPoint:oe,onStartMove:an?ot:null}),E(_Q,{prefixCls:i,marks:lt,dots:Ne,style:ke,activeStyle:De}),E(hQ,{ref:Tt,prefixCls:i,style:Re,values:hn,draggingIndex:Tn,onStartMove:ot,onOffsetChange:Gt,onFocus:g,onBlur:b,handleRender:Le}),E(yQ,{prefixCls:i,marks:lt,onClick:Vt})]})})}),CQ=C.exports.forwardRef(function(e,t){var n=e.open,r=C.exports.useRef(null),i=C.exports.useRef(null);function l(){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():l(),l},[n,e.title]),E(oo,{ref:Lo(r,t),...e})});const SQ=CQ;var EQ=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 DQ(e){return e&&sn(e)==="object"&&!Array.isArray(e)&&!C.exports.isValidElement(e)}function LQ(e){return typeof e=="string"?!0:Sc(e)}var zQ=function(t){var n=t.ellipsis,r=t.rowType,i=t.children,l,c=n===!0?{showTitle:!0}:n;return c&&(c.showTitle||r==="header")&&(typeof i=="string"||typeof i=="number"?l=i.toString():C.exports.isValidElement(i)&&typeof i.props.children=="string"&&(l=i.props.children)),l};function FQ(e,t){var n,r,i,l=e.prefixCls,c=e.className,o=e.record,h=e.index,p=e.renderIndex,g=e.dataIndex,b=e.render,w=e.children,P=e.component,I=P===void 0?"td":P,A=e.colSpan,O=e.rowSpan,M=e.fixLeft,R=e.fixRight,N=e.firstFixLeft,z=e.lastFixLeft,B=e.firstFixRight,U=e.lastFixRight,q=e.appendNode,H=e.additionalProps,te=H===void 0?{}:H,Y=e.ellipsis,le=e.align,J=e.rowType,Z=e.isSticky,Q=e.hovering,ge=e.onHover,re="".concat(l,"-cell"),de=C.exports.useContext(qA),oe=C.exports.useContext(WA),ye=C.exports.useContext(H0),Re=ye.allColumnsFixedLeft,Te=C.exports.useMemo(function(){if(j2(w))return[w];var it=HA(o,g),ft=it,xt=void 0;if(b){var Wt=b(it,o,p);DQ(Wt)?(ft=Wt.children,xt=Wt.props,de.renderWithProps=!0):ft=Wt}return[ft,xt]},[de.renderWithProps?Math.random():0,w,g,de,o,b,p]),ke=ze(Te,2),De=ke[0],Me=ke[1],Ne=De;sn(Ne)==="object"&&!Array.isArray(Ne)&&!C.exports.isValidElement(Ne)&&(Ne=null),Y&&(z||B)&&(Ne=E("span",{className:"".concat(re,"-content"),children:Ne}));var Le=Me||{},Ve=Le.colSpan,qe=Le.rowSpan,Ue=Le.style,ct=Le.className,pt=In(Le,OQ),Tt=(n=Ve!==void 0?Ve:A)!==null&&n!==void 0?n:1,Xe=(r=qe!==void 0?qe:O)!==null&&r!==void 0?r:1;if(Tt===0||Xe===0)return null;var Pt={},mt=typeof M=="number"&&oe,Mt=typeof R=="number"&&oe;mt&&(Pt.position="sticky",Pt.left=M),Mt&&(Pt.position="sticky",Pt.right=R);var Ct={};le&&(Ct.textAlign=le);var Lt=function(ft){var xt;o&&ge(h,h+Xe-1),te==null||(xt=te.onMouseEnter)===null||xt===void 0||xt.call(te,ft)},lt=function(ft){var xt;o&&ge(-1,-1),te==null||(xt=te.onMouseLeave)===null||xt===void 0||xt.call(te,ft)},dt=zQ({rowType:J,ellipsis:Y,children:De}),ut=ve(ve(ve({title:dt},pt),te),{},{colSpan:Tt!==1?Tt:null,rowSpan:Xe!==1?Xe:null,className:Ye(re,c,(i={},se(i,"".concat(re,"-fix-left"),mt&&oe),se(i,"".concat(re,"-fix-left-first"),N&&oe),se(i,"".concat(re,"-fix-left-last"),z&&oe),se(i,"".concat(re,"-fix-left-all"),z&&Re&&oe),se(i,"".concat(re,"-fix-right"),Mt&&oe),se(i,"".concat(re,"-fix-right-first"),B&&oe),se(i,"".concat(re,"-fix-right-last"),U&&oe),se(i,"".concat(re,"-ellipsis"),Y),se(i,"".concat(re,"-with-append"),q),se(i,"".concat(re,"-fix-sticky"),(mt||Mt)&&Z&&oe),se(i,"".concat(re,"-row-hover"),!Me&&Q),i),te.className,ct),style:ve(ve(ve(ve({},te.style),Ct),Pt),Ue),onMouseEnter:Lt,onMouseLeave:lt,ref:LQ(I)?t:null});return Qe(I,{...ut,children:[q,Ne]})}var ZA=C.exports.forwardRef(FQ);ZA.displayName="Cell";var $Q=["expanded","className","hovering"],BQ=C.exports.memo(ZA,function(e,t){return t.shouldCellUpdate?$Q.every(function(n){return e[n]===t[n]})&&!t.shouldCellUpdate(t.record,e.record):gc(e,t)}),am=C.exports.forwardRef(function(e,t){var n=e.index,r=e.additionalProps,i=r===void 0?{}:r,l=e.colSpan,c=e.rowSpan,o=i.colSpan,h=i.rowSpan,p=l!=null?l:o,g=c!=null?c:h,b=AQ(GA,function(I){var A=NQ(n,g||1,I==null?void 0:I.startRow,I==null?void 0:I.endRow);return{onHover:I==null?void 0:I.onHover,hovering:A}}),w=b.onHover,P=b.hovering;return E(BQ,{...e,colSpan:p,rowSpan:g,hovering:P,ref:t,onHover:w})});am.displayName="WrappedCell";var ys=C.exports.createContext(null);function M4(e,t,n,r,i){var l=n[e]||{},c=n[t]||{},o,h;l.fixed==="left"?o=r.left[e]:c.fixed==="right"&&(h=r.right[t]);var p=!1,g=!1,b=!1,w=!1,P=n[t+1],I=n[e-1];if(i==="rtl"){if(o!==void 0){var A=I&&I.fixed==="left";w=!A}else if(h!==void 0){var O=P&&P.fixed==="right";b=!O}}else if(o!==void 0){var M=P&&P.fixed==="left";p=!M}else if(h!==void 0){var R=I&&I.fixed==="right";g=!R}return{fixLeft:o,fixRight:h,lastFixLeft:p,firstFixRight:g,lastFixRight:b,firstFixLeft:w,isSticky:r.isSticky}}function XA(e){var t=e.cells,n=e.stickyOffsets,r=e.flattenColumns,i=e.rowComponent,l=e.cellComponent,c=e.onHeaderRow,o=e.index,h=C.exports.useContext(ys),p=h.prefixCls,g=h.direction,b;c&&(b=c(t.map(function(P){return P.column}),o));var w=K0(t.map(function(P){return P.column}));return E(i,{...b,children:t.map(function(P,I){var A=P.column,O=M4(P.colStart,P.colEnd,r,n,g),M;return A&&A.onHeaderCell&&(M=P.column.onHeaderCell(A)),C.exports.createElement(am,{...P,ellipsis:A.ellipsis,align:A.align,component:l,prefixCls:p,key:w[I],...O,additionalProps:M,rowType:"header"})})})}XA.displayName="HeaderRow";function VQ(e){var t=[];function n(c,o){var h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;t[h]=t[h]||[];var p=o,g=c.filter(Boolean).map(function(b){var w={key:b.key,className:b.className||"",children:b.title,column:b,colStart:p},P=1,I=b.children;return I&&I.length>0&&(P=n(I,p,h+1).reduce(function(A,O){return A+O},0),w.hasSubColumns=!0),"colSpan"in b&&(P=b.colSpan),"rowSpan"in b&&(w.rowSpan=b.rowSpan),w.colSpan=P,w.colEnd=w.colStart+P-1,t[h].push(w),p+=P,P});return g}n(e,0);for(var r=t.length,i=function(o){t[o].forEach(function(h){!("rowSpan"in h)&&!h.hasSubColumns&&(h.rowSpan=r-o)})},l=0;l1?mt-1:0),Ct=1;Ct0?[].concat(wt(t),wt(K2(l).map(function(c){return ve({fixed:i},c)}))):[].concat(wt(t),[ve(ve({},n),{},{fixed:i})])},[])}function XQ(e){return e.map(function(t){var n=t.fixed,r=In(t,ZQ),i=n;return n==="left"?i="right":n==="right"&&(i="left"),ve({fixed:i},r)})}function YQ(e,t){var n=e.prefixCls,r=e.columns,i=e.children,l=e.expandable,c=e.expandedKeys,o=e.columnTitle,h=e.getRowKey,p=e.onTriggerExpand,g=e.expandIcon,b=e.rowExpandable,w=e.expandIconColumnIndex,P=e.direction,I=e.expandRowByClick,A=e.columnWidth,O=e.fixed,M=C.exports.useMemo(function(){return r||R4(i)},[r,i]),R=C.exports.useMemo(function(){if(l){var B,U=M.slice();if(!U.includes(Xu)){var q=w||0;q>=0&&U.splice(q,0,Xu)}var H=U.indexOf(Xu);U=U.filter(function(J,Z){return J!==Xu||Z===H});var te=M[H],Y;(O==="left"||O)&&!w?Y="left":(O==="right"||O)&&w===M.length?Y="right":Y=te?te.fixed:null;var le=(B={},se(B,ip,{className:"".concat(n,"-expand-icon-col"),columnType:"EXPAND_COLUMN"}),se(B,"title",o),se(B,"fixed",Y),se(B,"className","".concat(n,"-row-expand-icon-cell")),se(B,"width",A),se(B,"render",function(Z,Q,ge){var re=h(Q,ge),de=c.has(re),oe=b?b(Q):!0,ye=g({prefixCls:n,expanded:de,expandable:oe,record:Q,onExpand:p});return I?E("span",{onClick:function(Te){return Te.stopPropagation()},children:ye}):ye}),B);return U.map(function(J){return J===Xu?le:J})}return M.filter(function(J){return J!==Xu})},[l,M,h,c,g,P]),N=C.exports.useMemo(function(){var B=R;return t&&(B=t(B)),B.length||(B=[{render:function(){return null}}]),B},[t,R,P]),z=C.exports.useMemo(function(){return P==="rtl"?XQ(K2(N)):K2(N)},[N,P]);return[N,z]}function rO(e){var t=C.exports.useRef(e),n=C.exports.useState({}),r=ze(n,2),i=r[1],l=C.exports.useRef(null),c=C.exports.useRef([]);function o(h){c.current.push(h);var p=Promise.resolve();l.current=p,p.then(function(){if(l.current===p){var g=c.current,b=t.current;c.current=[],g.forEach(function(w){t.current=w(t.current)}),l.current=null,b!==t.current&&i({})}})}return C.exports.useEffect(function(){return function(){l.current=null}},[]),[t.current,o]}function QQ(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 l(){return t.current}return C.exports.useEffect(function(){return r},[]),[i,l]}function JQ(e,t,n){var r=C.exports.useMemo(function(){for(var i=[],l=[],c=0,o=0,h=0;h=0;o-=1){var h=t[o],p=n&&n[o],g=p&&p[ip];if(h||g||c){var b=g||{};b.columnType;var w=In(b,eJ);i.unshift(E("col",{style:{width:h},...w},o)),c=!0}}return E("colgroup",{children:i})}function pk(e){var t=e.className,n=e.children;return E("div",{className:t,children:n})}var oO=C.exports.createContext({});function tJ(e){var t=e.className,n=e.index,r=e.children,i=e.colSpan,l=i===void 0?1:i,c=e.rowSpan,o=e.align,h=C.exports.useContext(ys),p=h.prefixCls,g=h.direction,b=C.exports.useContext(oO),w=b.scrollColumnIndex,P=b.stickyOffsets,I=b.flattenColumns,A=n+l-1,O=A+1===w?l+1:l,M=M4(n,n+O-1,I,P,g);return E(am,{className:t,index:n,component:"td",prefixCls:p,record:null,dataIndex:null,align:o,colSpan:O,rowSpan:c,render:function(){return r},...M})}var nJ=["children"];function rJ(e){var t=e.children,n=In(e,nJ);return E("tr",{...n,children:t})}function W0(e){var t=e.children;return t}W0.Row=rJ;W0.Cell=tJ;function eg(e){var t=e.children,n=e.stickyOffsets,r=e.flattenColumns,i=C.exports.useContext(ys),l=i.prefixCls,c=r.length-1,o=r[c],h=C.exports.useMemo(function(){return{stickyOffsets:n,flattenColumns:r,scrollColumnIndex:o!=null&&o.scrollbar?c:null}},[o,r,c,n]);return E(oO.Provider,{value:h,children:E("tfoot",{className:"".concat(l,"-summary"),children:t})})}var aO=W0;function iJ(e){var t,n=e.prefixCls,r=e.record,i=e.onExpand,l=e.expanded,c=e.expandable,o="".concat(n,"-row-expand-icon");if(!c)return E("span",{className:Ye(o,"".concat(n,"-row-spaced"))});var h=function(g){i(r,g),g.stopPropagation()};return E("span",{className:Ye(o,(t={},se(t,"".concat(n,"-row-expanded"),l),se(t,"".concat(n,"-row-collapsed"),!l),t)),onClick:h})}function oJ(e,t,n){var r=[];function i(l){(l||[]).forEach(function(c,o){r.push(t(c,o)),i(c[n])})}return i(e),r}var aJ=function(t,n){var r,i,l=t.scrollBodyRef,c=t.onScroll,o=t.offsetScroll,h=t.container,p=C.exports.useContext(ys),g=p.prefixCls,b=((r=l.current)===null||r===void 0?void 0:r.scrollWidth)||0,w=((i=l.current)===null||i===void 0?void 0:i.clientWidth)||0,P=b&&w*(w/b),I=C.exports.useRef(),A=rO({scrollLeft:0,isHiddenScrollBar:!1}),O=ze(A,2),M=O[0],R=O[1],N=C.exports.useRef({delta:0,x:0}),z=C.exports.useState(!1),B=ze(z,2),U=B[0],q=B[1],H=function(){q(!1)},te=function(Q){Q.persist(),N.current.delta=Q.pageX-M.scrollLeft,N.current.x=0,q(!0),Q.preventDefault()},Y=function(Q){var ge,re=Q||((ge=window)===null||ge===void 0?void 0:ge.event),de=re.buttons;if(!U||de===0){U&&q(!1);return}var oe=N.current.x+Q.pageX-N.current.x-N.current.delta;oe<=0&&(oe=0),oe+P>=w&&(oe=w-P),c({scrollLeft:oe/w*(b+2)}),N.current.x=Q.pageX},le=function(){if(!!l.current){var Q=J5(l.current).top,ge=Q+l.current.offsetHeight,re=h===window?document.documentElement.scrollTop+window.innerHeight:J5(h).top+h.clientHeight;ge-Iy()<=re||Q>=re-o?R(function(de){return ve(ve({},de),{},{isHiddenScrollBar:!0})}):R(function(de){return ve(ve({},de),{},{isHiddenScrollBar:!1})})}},J=function(Q){R(function(ge){return ve(ve({},ge),{},{scrollLeft:Q/b*w||0})})};return C.exports.useImperativeHandle(n,function(){return{setScrollLeft:J}}),C.exports.useEffect(function(){var Z=Hs(document.body,"mouseup",H,!1),Q=Hs(document.body,"mousemove",Y,!1);return le(),function(){Z.remove(),Q.remove()}},[P,U]),C.exports.useEffect(function(){var Z=Hs(h,"scroll",le,!1),Q=Hs(window,"resize",le,!1);return function(){Z.remove(),Q.remove()}},[h]),C.exports.useEffect(function(){M.isHiddenScrollBar||R(function(Z){var Q=l.current;return Q?ve(ve({},Z),{},{scrollLeft:Q.scrollLeft/Q.scrollWidth*Q.clientWidth}):Z})},[M.isHiddenScrollBar]),b<=w||!P||M.isHiddenScrollBar?null:E("div",{style:{height:Iy(),width:w,bottom:o},className:"".concat(g,"-sticky-scroll"),children:E("div",{onMouseDown:te,ref:I,className:Ye("".concat(g,"-sticky-scroll-bar"),se({},"".concat(g,"-sticky-scroll-bar-active"),U)),style:{width:"".concat(P,"px"),transform:"translate3d(".concat(M.scrollLeft,"px, 0, 0)")}})})};const sJ=C.exports.forwardRef(aJ);var mk=wo()?window:null;function lJ(e,t){var n=sn(e)==="object"?e:{},r=n.offsetHeader,i=r===void 0?0:r,l=n.offsetSummary,c=l===void 0?0:l,o=n.offsetScroll,h=o===void 0?0:o,p=n.getContainer,g=p===void 0?function(){return mk}:p,b=g()||mk;return C.exports.useMemo(function(){var w=!!e;return{isSticky:w,stickyClassName:w?"".concat(t,"-sticky-holder"):"",offsetHeader:i,offsetSummary:c,offsetScroll:h,container:b}},[h,i,c,t,b])}var uJ=["className","noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","stickyTopOffset","stickyBottomOffset","stickyClassName","onScroll","maxContentScroll","children"];function cJ(e,t){return C.exports.useMemo(function(){for(var n=[],r=0;r=0})},[l]),Y=l[l.length-1],le={fixed:Y?Y.fixed:null,scrollbar:!0,onHeaderCell:function(){return{className:"".concat(N,"-cell-scrollbar")}}},J=C.exports.useMemo(function(){return U?[].concat(wt(i),[le]):i},[U,i]),Z=C.exports.useMemo(function(){return U?[].concat(wt(l),[le]):l},[U,l]),Q=C.exports.useMemo(function(){var re=h.right,de=h.left;return ve(ve({},h),{},{left:p==="rtl"?[].concat(wt(de.map(function(oe){return oe+U})),[0]):de,right:p==="rtl"?re:[].concat(wt(re.map(function(oe){return oe+U})),[0]),isSticky:B})},[U,h,B]),ge=cJ(c,o);return E("div",{style:ve({overflow:"hidden"},B?{top:b,bottom:w}:{}),ref:H,className:Ye(n,se({},P,!!P)),children:Qe("table",{style:{tableLayout:"fixed",visibility:r||ge?null:"hidden"},children:[(!r||!A||te)&&E(iO,{colWidths:ge?[].concat(wt(ge),[U]):[],columCount:o+1,columns:Z}),O(ve(ve({},M),{},{stickyOffsets:Q,columns:J,flattenColumns:Z}))]})})});H2.displayName="FixedHolder";var dJ=[],fJ={},Pg="rc-table-internal-hook",hJ=C.exports.memo(function(e){var t=e.children;return t},function(e,t){return gc(e.props,t.props)?e.pingLeft!==t.pingLeft||e.pingRight!==t.pingRight:!1});function Pc(e){var t,n=e.prefixCls,r=e.className,i=e.rowClassName,l=e.style,c=e.data,o=e.rowKey,h=e.scroll,p=e.tableLayout,g=e.direction,b=e.title,w=e.footer,P=e.summary,I=e.id,A=e.showHeader,O=e.components,M=e.emptyText,R=e.onRow,N=e.onHeaderRow,z=e.internalHooks,B=e.transformColumns,U=e.internalRefs,q=e.sticky,H=c||dJ,te=!!H.length,Y=C.exports.useCallback(function(zn,Zn){return HA(O||{},zn)||Zn},[O]),le=C.exports.useMemo(function(){return typeof o=="function"?o:function(zn){var Zn=zn&&zn[o];return Zn}},[o]),J=GQ(e),Z=J.expandIcon,Q=J.expandedRowKeys,ge=J.defaultExpandedRowKeys,re=J.defaultExpandAllRows,de=J.expandedRowRender,oe=J.columnTitle,ye=J.onExpand,Re=J.onExpandedRowsChange,Te=J.expandRowByClick,ke=J.rowExpandable,De=J.expandIconColumnIndex,Me=J.expandedRowClassName,Ne=J.childrenColumnName,Le=J.indentSize,Ve=Z||iJ,qe=Ne||"children",Ue=C.exports.useMemo(function(){return de?"row":e.expandable&&z===Pg&&e.expandable.__PARENT_RENDER_ICON__||H.some(function(zn){return zn&&sn(zn)==="object"&&zn[qe]})?"nest":!1},[!!de,H]),ct=C.exports.useState(function(){return ge||(re?oJ(H,le,qe):[])}),pt=ze(ct,2),Tt=pt[0],Xe=pt[1],Pt=C.exports.useMemo(function(){return new Set(Q||Tt||[])},[Q,Tt]),mt=C.exports.useCallback(function(zn){var Zn=le(zn,H.indexOf(zn)),Ir,ki=Pt.has(Zn);ki?(Pt.delete(Zn),Ir=wt(Pt)):Ir=[].concat(wt(Pt),[Zn]),Xe(Ir),ye&&ye(!ki,zn),Re&&Re(Ir)},[le,Pt,H,ye,Re]),Mt=C.exports.useState(0),Ct=ze(Mt,2),Lt=Ct[0],lt=Ct[1],dt=YQ(ve(ve(ve({},e),J),{},{expandable:!!de,columnTitle:oe,expandedKeys:Pt,getRowKey:le,onTriggerExpand:mt,expandIcon:Ve,expandIconColumnIndex:De,direction:g}),z===Pg?B:null),ut=ze(dt,2),it=ut[0],ft=ut[1],xt=C.exports.useMemo(function(){return{columns:it,flattenColumns:ft}},[it,ft]),Wt=C.exports.useRef(),Ut=C.exports.useRef(),Qt=C.exports.useRef(),Fe=C.exports.useRef(),Ge=C.exports.useRef(),Xt=C.exports.useState(!1),dn=ze(Xt,2),Vt=dn[0],jt=dn[1],nn=C.exports.useState(!1),_n=ze(nn,2),An=_n[0],_t=_n[1],Gt=rO(new Map),an=ze(Gt,2),Fn=an[0],kn=an[1],zt=K0(ft),Tn=zt.map(function(zn){return Fn.get(zn)}),Cn=C.exports.useMemo(function(){return Tn},[Tn.join("_")]),hn=JQ(Cn,ft.length,g),Nt=h&&j2(h.y),ot=h&&j2(h.x)||Boolean(J.fixed),ht=ot&&ft.some(function(zn){var Zn=zn.fixed;return Zn}),At=C.exports.useRef(),$t=lJ(q,n),cn=$t.isSticky,Mn=$t.offsetHeader,Gn=$t.offsetSummary,qn=$t.offsetScroll,me=$t.stickyClassName,K=$t.container,G=P==null?void 0:P(H),ce=(Nt||cn)&&C.exports.isValidElement(G)&&G.type===W0&&G.props.fixed,ae,xe,Ee;Nt&&(xe={overflowY:"scroll",maxHeight:h.y}),ot&&(ae={overflowX:"auto"},Nt||(xe={overflowY:"hidden"}),Ee={width:(h==null?void 0:h.x)===!0?"auto":h==null?void 0:h.x,minWidth:"100%"});var be=C.exports.useCallback(function(zn,Zn){t4(Wt.current)&&kn(function(Ir){if(Ir.get(zn)!==Zn){var ki=new Map(Ir);return ki.set(zn,Zn),ki}return Ir})},[]),Ce=QQ(null),Oe=ze(Ce,2),He=Oe[0],We=Oe[1];function Be(zn,Zn){!Zn||(typeof Zn=="function"?Zn(zn):Zn.scrollLeft!==zn&&(Zn.scrollLeft=zn))}var Ot=function(Zn){var Ir=Zn.currentTarget,ki=Zn.scrollLeft,Ga=g==="rtl",Eo=typeof ki=="number"?ki:Ir.scrollLeft,_s=Ir||fJ;if(!We()||We()===_s){var ka;He(_s),Be(Eo,Ut.current),Be(Eo,Qt.current),Be(Eo,Ge.current),Be(Eo,(ka=At.current)===null||ka===void 0?void 0:ka.setScrollLeft)}if(Ir){var gr=Ir.scrollWidth,Ta=Ir.clientWidth;if(gr===Ta){jt(!1),_t(!1);return}Ga?(jt(-Eo0)):(jt(Eo>0),_t(Eo-1}var LJ=DJ,zJ=Z0;function FJ(e,t){var n=this.__data__,r=zJ(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var $J=FJ,BJ=wJ,VJ=MJ,UJ=OJ,jJ=LJ,KJ=$J;function pf(e){var t=-1,n=e==null?0:e.length;for(this.clear();++to))return!1;var p=l.get(e),g=l.get(t);if(p&&g)return p==t&&g==e;var b=-1,w=!0,P=n&cne?new ane:void 0;for(l.set(e,t),l.set(t,e);++b-1&&e%1==0&&e-1&&e%1==0&&e<=yre}var pO=xre,_re=Jp,bre=pO,wre=em,Cre="[object Arguments]",Sre="[object Array]",Ere="[object Boolean]",kre="[object Date]",Tre="[object Error]",Pre="[object Function]",Ire="[object Map]",Mre="[object Number]",Rre="[object Object]",Are="[object RegExp]",Ore="[object Set]",Nre="[object String]",Dre="[object WeakMap]",Lre="[object ArrayBuffer]",zre="[object DataView]",Fre="[object Float32Array]",$re="[object Float64Array]",Bre="[object Int8Array]",Vre="[object Int16Array]",Ure="[object Int32Array]",jre="[object Uint8Array]",Kre="[object Uint8ClampedArray]",Hre="[object Uint16Array]",Wre="[object Uint32Array]",Ur={};Ur[Fre]=Ur[$re]=Ur[Bre]=Ur[Vre]=Ur[Ure]=Ur[jre]=Ur[Kre]=Ur[Hre]=Ur[Wre]=!0;Ur[Cre]=Ur[Sre]=Ur[Lre]=Ur[Ere]=Ur[zre]=Ur[kre]=Ur[Tre]=Ur[Pre]=Ur[Ire]=Ur[Mre]=Ur[Rre]=Ur[Are]=Ur[Ore]=Ur[Nre]=Ur[Dre]=!1;function Gre(e){return wre(e)&&bre(e.length)&&!!Ur[_re(e)]}var qre=Gre;function Zre(e){return function(t){return e(t)}}var Xre=Zre,W2={exports:{}};(function(e,t){var n=Y7,r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,l=i&&i.exports===r,c=l&&n.process,o=function(){try{var h=i&&i.require&&i.require("util").types;return h||c&&c.binding&&c.binding("util")}catch{}}();e.exports=o})(W2,W2.exports);var Yre=qre,Qre=Xre,Sk=W2.exports,Ek=Sk&&Sk.isTypedArray,Jre=Ek?Qre(Ek):Yre,mO=Jre,eie=tre,tie=dre,nie=w4,rie=Ay.exports,iie=gre,oie=mO,aie=Object.prototype,sie=aie.hasOwnProperty;function lie(e,t){var n=nie(e),r=!n&&tie(e),i=!n&&!r&&rie(e),l=!n&&!r&&!i&&oie(e),c=n||r||i||l,o=c?eie(e.length,String):[],h=o.length;for(var p in e)(t||sie.call(e,p))&&!(c&&(p=="length"||i&&(p=="offset"||p=="parent")||l&&(p=="buffer"||p=="byteLength"||p=="byteOffset")||iie(p,h)))&&o.push(p);return o}var uie=lie,cie=Object.prototype;function die(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||cie;return e===n}var fie=die;function hie(e,t){return function(n){return e(t(n))}}var pie=hie,mie=pie,vie=mie(Object.keys,Object),gie=vie,yie=fie,xie=gie,_ie=Object.prototype,bie=_ie.hasOwnProperty;function wie(e){if(!yie(e))return xie(e);var t=[];for(var n in Object(e))bie.call(e,n)&&n!="constructor"&&t.push(n);return t}var Cie=wie,Sie=uO,Eie=pO;function kie(e){return e!=null&&Eie(e.length)&&!Sie(e)}var Tie=kie,Pie=uie,Iie=Cie,Mie=Tie;function Rie(e){return Mie(e)?Pie(e):Iie(e)}var Aie=Rie,Oie=jne,Nie=Jne,Die=Aie;function Lie(e){return Oie(e,Die,Nie)}var zie=Lie,kk=zie,Fie=1,$ie=Object.prototype,Bie=$ie.hasOwnProperty;function Vie(e,t,n,r,i,l){var c=n&Fie,o=kk(e),h=o.length,p=kk(t),g=p.length;if(h!=g&&!c)return!1;for(var b=h;b--;){var w=o[b];if(!(c?w in t:Bie.call(t,w)))return!1}var P=l.get(e),I=l.get(t);if(P&&I)return P==t&&I==e;var A=!0;l.set(e,t),l.set(t,e);for(var O=c;++b0&&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(l,c){var o=new Map;l.forEach(function(p){o.set(p,!0)});var h=c.filter(function(p){return!o.has(p)});return h.length===1?h[0]:null}return n ").concat(t);return t}var bO=C.exports.forwardRef(function(e,t){var n=e.prefixCls,r=e.data;e.selectable,e.checkable;var i=e.expandedKeys,l=e.selectedKeys,c=e.checkedKeys,o=e.loadedKeys,h=e.loadingKeys,p=e.halfCheckedKeys,g=e.keyEntities,b=e.disabled,w=e.dragging,P=e.dragOverNodeKey,I=e.dropPosition,A=e.motion,O=e.height,M=e.itemHeight,R=e.virtual,N=e.focusable,z=e.activeItem,B=e.focused,U=e.tabIndex,q=e.onKeyDown,H=e.onFocus,te=e.onBlur,Y=e.onActiveChange,le=e.onListChangeStart,J=e.onListChangeEnd,Z=In(e,Toe),Q=C.exports.useRef(null),ge=C.exports.useRef(null);C.exports.useImperativeHandle(t,function(){return{scrollTo:function(ut){Q.current.scrollTo(ut)},getIndentWidth:function(){return ge.current.offsetWidth}}});var re=C.exports.useState(i),de=ze(re,2),oe=de[0],ye=de[1],Re=C.exports.useState(r),Te=ze(Re,2),ke=Te[0],De=Te[1],Me=C.exports.useState(r),Ne=ze(Me,2),Le=Ne[0],Ve=Ne[1],qe=C.exports.useState([]),Ue=ze(qe,2),ct=Ue[0],pt=Ue[1],Tt=C.exports.useState(null),Xe=ze(Tt,2),Pt=Xe[0],mt=Xe[1],Mt=C.exports.useRef(r);Mt.current=r;function Ct(){var dt=Mt.current;De(dt),Ve(dt),pt([]),mt(null),J()}C.exports.useEffect(function(){ye(i);var dt=koe(oe,i);if(dt.key!==null)if(dt.add){var ut=ke.findIndex(function(Qt){var Fe=Qt.key;return Fe===dt.key}),it=jk(Bk(ke,r,dt.key),R,O,M),ft=ke.slice();ft.splice(ut+1,0,Uk),Ve(ft),pt(it),mt("show")}else{var xt=r.findIndex(function(Qt){var Fe=Qt.key;return Fe===dt.key}),Wt=jk(Bk(r,ke,dt.key),R,O,M),Ut=r.slice();Ut.splice(xt+1,0,Uk),Ve(Ut),pt(Wt),mt("hide")}else ke!==r&&(De(r),Ve(r))},[i,r]),C.exports.useEffect(function(){w||Ct()},[w]);var Lt=A?Le:r,lt={expandedKeys:i,selectedKeys:l,loadedKeys:o,loadingKeys:h,checkedKeys:c,halfCheckedKeys:p,dragOverNodeKey:P,dropPosition:I,keyEntities:g};return Qe($n,{children:[B&&z&&E("span",{style:Vk,"aria-live":"assertive",children:Ioe(z)}),E("div",{children:E("input",{style:Vk,disabled:N===!1||b,tabIndex:N!==!1?U:null,onKeyDown:q,onFocus:H,onBlur:te,value:"",onChange:Poe,"aria-label":"for screen reader"})}),E("div",{className:"".concat(n,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0},children:E("div",{className:"".concat(n,"-indent"),children:E("div",{ref:ge,className:"".concat(n,"-indent-unit")})})}),E(i4,{...Z,data:Lt,itemKey:Kk,height:O,fullHeight:!1,virtual:R,itemHeight:M,prefixCls:"".concat(n,"-list"),ref:Q,onVisibleChange:function(ut,it){var ft=new Set(ut),xt=it.filter(function(Wt){return!ft.has(Wt)});xt.some(function(Wt){return Kk(Wt)===_c})&&Ct()},children:function(dt){var ut=dt.pos,it=tt({},(yO(dt.data),dt.data)),ft=dt.title,xt=dt.key,Wt=dt.isStart,Ut=dt.isEnd,Qt=tm(xt,ut);delete it.key,delete it.children;var Fe=np(Qt,lt);return E(Eoe,{...it,...Fe,title:ft,active:!!z&&xt===z.key,pos:ut,data:dt.data,isStart:Wt,isEnd:Ut,motion:A,motionNodes:xt===_c?ct:null,motionType:Pt,onMotionStart:le,onMotionEnd:Ct,treeNodeRequiredProps:lt,onMouseMove:function(){Y(null)}})}})]})});bO.displayName="NodeList";function Moe(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 E("div",{style:i})}var Roe=10,J0=function(e){li(n,e);var t=ui(n);function n(){var r;Kr(this,n);for(var i=arguments.length,l=new Array(i),c=0;c2&&arguments[2]!==void 0?arguments[2]:!1,b=r.state,w=b.dragChildrenKeys,P=b.dropPosition,I=b.dropTargetKey,A=b.dropTargetPos,O=b.dropAllowed;if(!!O){var M=r.props.onDrop;if(r.setState({dragOverNodeKey:null}),r.cleanDragState(),I!==null){var R=ve(ve({},np(I,r.getTreeNodeRequiredProps())),{},{active:((p=r.getActiveItem())===null||p===void 0?void 0:p.key)===I,data:r.state.keyEntities[I].node}),N=w.indexOf(I)!==-1;Nr(!N,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var z=E4(A),B={event:o,node:wi(R),dragNode:r.dragNode?wi(r.dragNode.props):null,dragNodesKeys:[r.dragNode.props.eventKey].concat(w),dropToGap:P!==0,dropPosition:P+Number(z[z.length-1])};g||M==null||M(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,h){var p=r.state,g=p.expandedKeys,b=p.flattenNodes,w=h.expanded,P=h.key,I=h.isLeaf;if(!(I||o.shiftKey||o.metaKey||o.ctrlKey)){var A=b.filter(function(M){return M.key===P})[0],O=wi(ve(ve({},np(P,r.getTreeNodeRequiredProps())),{},{data:A.data}));r.setExpandedKeys(w?is(g,P):Ds(g,P)),r.onNodeExpand(o,O)}},r.onNodeClick=function(o,h){var p=r.props,g=p.onClick,b=p.expandAction;b==="click"&&r.triggerExpandActionExpand(o,h),g==null||g(o,h)},r.onNodeDoubleClick=function(o,h){var p=r.props,g=p.onDoubleClick,b=p.expandAction;b==="doubleClick"&&r.triggerExpandActionExpand(o,h),g==null||g(o,h)},r.onNodeSelect=function(o,h){var p=r.state.selectedKeys,g=r.state,b=g.keyEntities,w=g.fieldNames,P=r.props,I=P.onSelect,A=P.multiple,O=h.selected,M=h[w.key],R=!O;R?A?p=Ds(p,M):p=[M]:p=is(p,M);var N=p.map(function(z){var B=b[z];return B?B.node:null}).filter(function(z){return z});r.setUncontrolledState({selectedKeys:p}),I==null||I(p,{event:"select",selected:R,node:h,selectedNodes:N,nativeEvent:o.nativeEvent})},r.onNodeCheck=function(o,h,p){var g=r.state,b=g.keyEntities,w=g.checkedKeys,P=g.halfCheckedKeys,I=r.props,A=I.checkStrictly,O=I.onCheck,M=h.key,R,N={event:"check",node:h,checked:p,nativeEvent:o.nativeEvent};if(A){var z=p?Ds(w,M):is(w,M),B=is(P,M);R={checked:z,halfChecked:B},N.checkedNodes=z.map(function(le){return b[le]}).filter(function(le){return le}).map(function(le){return le.node}),r.setUncontrolledState({checkedKeys:z})}else{var U=Gs([].concat(wt(w),[M]),!0,b),q=U.checkedKeys,H=U.halfCheckedKeys;if(!p){var te=new Set(q);te.delete(M);var Y=Gs(Array.from(te),{checked:!1,halfCheckedKeys:H},b);q=Y.checkedKeys,H=Y.halfCheckedKeys}R=q,N.checkedNodes=[],N.checkedNodesPositions=[],N.halfCheckedKeys=H,q.forEach(function(le){var J=b[le];if(!!J){var Z=J.node,Q=J.pos;N.checkedNodes.push(Z),N.checkedNodesPositions.push({node:Z,pos:Q})}}),r.setUncontrolledState({checkedKeys:q},!1,{halfCheckedKeys:H})}O==null||O(R,N)},r.onNodeLoad=function(o){var h=o.key,p=new Promise(function(g,b){r.setState(function(w){var P=w.loadedKeys,I=P===void 0?[]:P,A=w.loadingKeys,O=A===void 0?[]:A,M=r.props,R=M.loadData,N=M.onLoad;if(!R||I.indexOf(h)!==-1||O.indexOf(h)!==-1)return null;var z=R(o);return z.then(function(){var B=r.state.loadedKeys,U=Ds(B,h);N==null||N(U,{event:"load",node:o}),r.setUncontrolledState({loadedKeys:U}),r.setState(function(q){return{loadingKeys:is(q.loadingKeys,h)}}),g()}).catch(function(B){if(r.setState(function(q){return{loadingKeys:is(q.loadingKeys,h)}}),r.loadingRetryTimes[h]=(r.loadingRetryTimes[h]||0)+1,r.loadingRetryTimes[h]>=Roe){var U=r.state.loadedKeys;Nr(!1,"Retry for `loadData` many times but still failed. No more retry."),r.setUncontrolledState({loadedKeys:Ds(U,h)}),g()}b(B)}),{loadingKeys:Ds(O,h)}})});return p.catch(function(){}),p},r.onNodeMouseEnter=function(o,h){var p=r.props.onMouseEnter;p==null||p({event:o,node:h})},r.onNodeMouseLeave=function(o,h){var p=r.props.onMouseLeave;p==null||p({event:o,node:h})},r.onNodeContextMenu=function(o,h){var p=r.props.onRightClick;p&&(o.preventDefault(),p({event:o,node:h}))},r.onFocus=function(){var o=r.props.onFocus;r.setState({focused:!0});for(var h=arguments.length,p=new Array(h),g=0;g1&&arguments[1]!==void 0?arguments[1]:!1,p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!r.destroyed){var g=!1,b=!0,w={};Object.keys(o).forEach(function(P){if(P in r.props){b=!1;return}g=!0,w[P]=o[P]}),g&&(!h||b)&&r.setState(ve(ve({},w),p))}},r.scrollTo=function(o){r.listRef.current.scrollTo(o)},r}return Hr(n,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var i=this.props.activeKey;i!==void 0&&i!==this.state.activeKey&&(this.setState({activeKey:i}),i!==null&&this.scrollTo({key:i}))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("dragend",this.onWindowDragEnd),this.destroyed=!0}},{key:"resetDragState",value:function(){this.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})}},{key:"render",value:function(){var i,l=this.state,c=l.focused,o=l.flattenNodes,h=l.keyEntities,p=l.draggingNodeKey,g=l.activeKey,b=l.dropLevelOffset,w=l.dropContainerKey,P=l.dropTargetKey,I=l.dropPosition,A=l.dragOverNodeKey,O=l.indent,M=this.props,R=M.prefixCls,N=M.className,z=M.style,B=M.showLine,U=M.focusable,q=M.tabIndex,H=q===void 0?0:q,te=M.selectable,Y=M.showIcon,le=M.icon,J=M.switcherIcon,Z=M.draggable,Q=M.checkable,ge=M.checkStrictly,re=M.disabled,de=M.motion,oe=M.loadData,ye=M.filterTreeNode,Re=M.height,Te=M.itemHeight,ke=M.virtual,De=M.titleRender,Me=M.dropIndicatorRender,Ne=M.onContextMenu,Le=M.onScroll,Ve=M.direction,qe=M.rootClassName,Ue=M.rootStyle,ct=au(this.props,{aria:!0,data:!0}),pt;return Z&&(sn(Z)==="object"?pt=Z:typeof Z=="function"?pt={nodeDraggable:Z}:pt={}),E(S4.Provider,{value:{prefixCls:R,selectable:te,showIcon:Y,icon:le,switcherIcon:J,draggable:pt,draggingNodeKey:p,checkable:Q,checkStrictly:ge,disabled:re,keyEntities:h,dropLevelOffset:b,dropContainerKey:w,dropTargetKey:P,dropPosition:I,dragOverNodeKey:A,indent:O,direction:Ve,dropIndicatorRender:Me,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:E("div",{role:"tree",className:Ye(R,N,qe,(i={},se(i,"".concat(R,"-show-line"),B),se(i,"".concat(R,"-focused"),c),se(i,"".concat(R,"-active-focused"),g!==null),i)),style:Ue,children:E(bO,{ref:this.listRef,prefixCls:R,style:z,data:o,disabled:re,selectable:te,checkable:!!Q,motion:de,dragging:p!==null,height:Re,itemHeight:Te,virtual:ke,focusable:U,focused:c,tabIndex:H,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:Ne,onScroll:Le,...this.getTreeNodeRequiredProps(),...ct})})})}}],[{key:"getDerivedStateFromProps",value:function(i,l){var c=l.prevProps,o={prevProps:i};function h(U){return!c&&U in i||c&&c[U]!==i[U]}var p,g=l.fieldNames;if(h("fieldNames")&&(g=Ty(i.fieldNames),o.fieldNames=g),h("treeData")?p=i.treeData:h("children")&&(Nr(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),p=iA(i.children)),p){o.treeData=p;var b=U0(p,{fieldNames:g});o.keyEntities=ve(se({},_c,_O),b.keyEntities)}var w=o.keyEntities||l.keyEntities;if(h("expandedKeys")||c&&h("autoExpandParent"))o.expandedKeys=i.autoExpandParent||!c&&i.defaultExpandParent?$2(i.expandedKeys,w):i.expandedKeys;else if(!c&&i.defaultExpandAll){var P=ve({},w);delete P[_c],o.expandedKeys=Object.keys(P).map(function(U){return P[U].key})}else!c&&i.defaultExpandedKeys&&(o.expandedKeys=i.autoExpandParent||i.defaultExpandParent?$2(i.defaultExpandedKeys,w):i.defaultExpandedKeys);if(o.expandedKeys||delete o.expandedKeys,p||o.expandedKeys){var I=x_(p||l.treeData,o.expandedKeys||l.expandedKeys,g);o.flattenNodes=I}if(i.selectable&&(h("selectedKeys")?o.selectedKeys=z5(i.selectedKeys,i):!c&&i.defaultSelectedKeys&&(o.selectedKeys=z5(i.defaultSelectedKeys,i))),i.checkable){var A;if(h("checkedKeys")?A=y_(i.checkedKeys)||{}:!c&&i.defaultCheckedKeys?A=y_(i.defaultCheckedKeys)||{}:p&&(A=y_(i.checkedKeys)||{checkedKeys:l.checkedKeys,halfCheckedKeys:l.halfCheckedKeys}),A){var O=A,M=O.checkedKeys,R=M===void 0?[]:M,N=O.halfCheckedKeys,z=N===void 0?[]:N;if(!i.checkStrictly){var B=Gs(R,!0,w);R=B.checkedKeys,z=B.halfCheckedKeys}o.checkedKeys=R,o.halfCheckedKeys=z}}return h("loadedKeys")&&(o.loadedKeys=i.loadedKeys),o}}]),n}(C.exports.Component);J0.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:Moe,allowDrop:function(){return!0},expandAction:!1};J0.TreeNode=yc;var Aoe={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 Ooe=Aoe;var wO=function(t,n){return E(lr,{...ve(ve({},t),{},{ref:n,icon:Ooe})})};wO.displayName="HolderOutlined";const Noe=C.exports.forwardRef(wO);var Hk=4;function Doe(e){var t,n=e.dropPosition,r=e.dropLevelOffset,i=e.prefixCls,l=e.indent,c=e.direction,o=c===void 0?"ltr":c,h=o==="ltr"?"left":"right",p=o==="ltr"?"right":"left",g=(t={},se(t,h,-r*l+Hk),se(t,p,0),t);switch(n){case-1:g.top=-3;break;case 1:g.bottom=-3;break;default:g.bottom=-3,g[h]=l+Hk;break}return E("div",{style:g,className:"".concat(i,"-drop-indicator")})}var Loe={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 zoe=Loe;var CO=function(t,n){return E(lr,{...ve(ve({},t),{},{ref:n,icon:zoe})})};CO.displayName="CaretDownFilled";const Foe=C.exports.forwardRef(CO);var $oe={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 Boe=$oe;var SO=function(t,n){return E(lr,{...ve(ve({},t),{},{ref:n,icon:Boe})})};SO.displayName="FileOutlined";const EO=C.exports.forwardRef(SO);var Voe={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 Uoe=Voe;var kO=function(t,n){return E(lr,{...ve(ve({},t),{},{ref:n,icon:Uoe})})};kO.displayName="MinusSquareOutlined";const joe=C.exports.forwardRef(kO);var Koe={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 Hoe=Koe;var TO=function(t,n){return E(lr,{...ve(ve({},t),{},{ref:n,icon:Hoe})})};TO.displayName="PlusSquareOutlined";const Woe=C.exports.forwardRef(TO);function PO(e,t,n,r){var i=r.isLeaf,l=r.expanded,c=r.loading;if(c)return E(qd,{className:"".concat(e,"-switcher-loading-icon")});var o;if(n&&sn(n)==="object"&&(o=n.showLeafIcon),i){if(!n)return null;if(typeof o!="boolean"&&!!o){var h=typeof o=="function"?o(r):o,p="".concat(e,"-switcher-line-custom-icon");return Do(h)?Ei(h,{className:Ye(h.props.className||"",p)}):h}return o?E(EO,{className:"".concat(e,"-switcher-line-icon")}):E("span",{className:"".concat(e,"-switcher-leaf-line")})}var g="".concat(e,"-switcher-icon"),b=typeof t=="function"?t(r):t;return Do(b)?Ei(b,{className:Ye(b.props.className||"",g)}):b||(n?l?E(joe,{className:"".concat(e,"-switcher-line-icon")}):E(Woe,{className:"".concat(e,"-switcher-line-icon")}):E(Foe,{className:g}))}var Goe=C.exports.forwardRef(function(e,t){var n,r=C.exports.useContext(Nn),i=r.getPrefixCls,l=r.direction,c=r.virtual,o=e.prefixCls,h=e.className,p=e.showIcon,g=p===void 0?!1:p,b=e.showLine,w=e.switcherIcon,P=e.blockNode,I=P===void 0?!1:P,A=e.children,O=e.checkable,M=O===void 0?!1:O,R=e.selectable,N=R===void 0?!0:R,z=e.draggable,B=e.motion,U=B===void 0?tt(tt({},Ap),{motionAppear:!1}):B,q=i("tree",o),H=tt(tt({},e),{checkable:M,selectable:N,showIcon:g,motion:U,blockNode:I,showLine:Boolean(b),dropIndicatorRender:Doe}),te=C.exports.useMemo(function(){if(!z)return!1;var Y={};switch(sn(z)){case"function":Y.nodeDraggable=z;break;case"object":Y=tt({},z);break}return Y.icon!==!1&&(Y.icon=Y.icon||E(Noe,{})),Y},[z]);return E(J0,{itemHeight:20,ref:t,virtual:c,...H,prefixCls:q,className:Ye((n={},se(n,"".concat(q,"-icon-hide"),!g),se(n,"".concat(q,"-block-node"),I),se(n,"".concat(q,"-unselectable"),!N),se(n,"".concat(q,"-rtl"),l==="rtl"),n),h),direction:l,checkable:M&&E("span",{className:"".concat(q,"-checkbox-inner")}),selectable:N,switcherIcon:function(le){return PO(q,w,b,le)},draggable:te,children:A})});const IO=Goe;var qoe={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 Zoe=qoe;var MO=function(t,n){return E(lr,{...ve(ve({},t),{},{ref:n,icon:Zoe})})};MO.displayName="FolderOpenOutlined";const Xoe=C.exports.forwardRef(MO);var Yoe={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 Qoe=Yoe;var RO=function(t,n){return E(lr,{...ve(ve({},t),{},{ref:n,icon:Qoe})})};RO.displayName="FolderOutlined";const Joe=C.exports.forwardRef(RO);var zs;(function(e){e[e.None=0]="None",e[e.Start=1]="Start",e[e.End=2]="End"})(zs||(zs={}));function O4(e,t){function n(r){var i=r.key,l=r.children;t(i,r)!==!1&&O4(l||[],t)}e.forEach(n)}function eae(e){var t=e.treeData,n=e.expandedKeys,r=e.startKey,i=e.endKey,l=[],c=zs.None;if(r&&r===i)return[r];if(!r||!i)return[];function o(h){return h===r||h===i}return O4(t,function(h){if(c===zs.End)return!1;if(o(h)){if(l.push(h),c===zs.None)c=zs.Start;else if(c===zs.Start)return c=zs.End,!1}else c===zs.Start&&l.push(h);return n.includes(h)}),l}function R_(e,t){var n=wt(t),r=[];return O4(e,function(i,l){var c=n.indexOf(i);return c!==-1&&(r.push(l),n.splice(c,1)),!!n.length}),r}var Wk=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},Xt=Ge.confirm,dn=Ge.closeDropdown;Xt&&pt([]),dn&&J(!1),Ue(""),oe(B?(U||[]).map(function(Vt){return String(Vt)}):[])},Pt=function(){var Ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{closeDropdown:!0},Xt=Ge.closeDropdown;Xt&&J(!1),pt(de())},mt=function(Ge){Ge&&Q!==void 0&&oe(Q||[]),J(Ge),!Ge&&!i.filterDropdown&&Tt()},Mt=Ye(se({},"".concat(l,"-menu-without-submenu"),!cae(i.filters||[]))),Ct=function(Ge){if(Ge.target.checked){var Xt=Fd(i==null?void 0:i.filters).map(function(dn){return String(dn)});oe(Xt)}else oe([])},Lt=function Fe(Ge){var Xt=Ge.filters;return(Xt||[]).map(function(dn,Vt){var jt=String(dn.value),nn={title:dn.text,key:dn.value!==void 0?jt:Vt};return dn.children&&(nn.children=Fe({filters:dn.children})),nn})},lt=function Fe(Ge){var Xt;return tt(tt({},Ge),{text:Ge.title,value:Ge.key,children:((Xt=Ge.children)===null||Xt===void 0?void 0:Xt.map(function(dn){return Fe(dn)}))||[]})},dt;if(typeof i.filterDropdown=="function")dt=i.filterDropdown({prefixCls:"".concat(l,"-custom"),setSelectedKeys:function(Ge){return ye({selectedKeys:Ge})},selectedKeys:de(),confirm:Pt,clearFilters:Xe,filters:i.filters,visible:Z,close:function(){J(!1)}});else if(i.filterDropdown)dt=i.filterDropdown;else{var ut=de()||[],it=function(){return(i.filters||[]).length===0?E(ss,{image:ss.PRESENTED_IMAGE_SIMPLE,description:I.filterEmptyText,imageStyle:{height:24},style:{margin:0,padding:"16px 0"}}):p==="tree"?Qe($n,{children:[E(qk,{filterSearch:b,value:qe,onChange:ct,tablePrefixCls:n,locale:I}),Qe("div",{className:"".concat(n,"-filter-dropdown-tree"),children:[o?E(xc,{checked:ut.length===Fd(i.filters).length,indeterminate:ut.length>0&&ut.length0?l:e}),w=Math.ceil((l||e)/b.pageSize);b.current>w&&(b.current=w||1);var P=function(O,M){g({current:O!=null?O:1,pageSize:M||b.pageSize})},I=function(O,M){var R;t&&((R=t.onChange)===null||R===void 0||R.call(t,O,M)),P(O,M),n(O,M||(b==null?void 0:b.pageSize))};return t===!1?[{},function(){}]:[tt(tt({},b),{onChange:I}),P]}var Rl={},ew="SELECT_ALL",tw="SELECT_INVERT",nw="SELECT_NONE",Yk=[];function LO(e,t){var n=[];return(e||[]).forEach(function(r){n.push(r),r&&sn(r)==="object"&&t in r&&(n=[].concat(wt(n),wt(LO(r[t],t))))}),n}function yae(e,t){var n=e||{},r=n.preserveSelectedRowKeys,i=n.selectedRowKeys,l=n.defaultSelectedRowKeys,c=n.getCheckboxProps,o=n.onChange,h=n.onSelect,p=n.onSelectAll,g=n.onSelectInvert,b=n.onSelectNone,w=n.onSelectMultiple,P=n.columnWidth,I=n.type,A=n.selections,O=n.fixed,M=n.renderCell,R=n.hideSelectAll,N=n.checkStrictly,z=N===void 0?!0:N,B=t.prefixCls,U=t.data,q=t.pageData,H=t.getRecordByKey,te=t.getRowKey,Y=t.expandType,le=t.childrenColumnName,J=t.locale,Z=t.getPopupContainer,Q=Vi(i||l||Yk,{value:i}),ge=ze(Q,2),re=ge[0],de=ge[1],oe=C.exports.useRef(new Map),ye=C.exports.useCallback(function(lt){if(r){var dt=new Map;lt.forEach(function(ut){var it=H(ut);!it&&oe.current.has(ut)&&(it=oe.current.get(ut)),dt.set(ut,it)}),oe.current=dt}},[H,r]);C.exports.useEffect(function(){ye(re)},[re]);var Re=C.exports.useMemo(function(){return z?{keyEntities:null}:U0(U,{externalGetKey:te,childrenPropName:le})},[U,te,z,le]),Te=Re.keyEntities,ke=C.exports.useMemo(function(){return LO(q,le)},[q,le]),De=C.exports.useMemo(function(){var lt=new Map;return ke.forEach(function(dt,ut){var it=te(dt,ut),ft=(c?c(dt):null)||{};lt.set(it,ft)}),lt},[ke,te,c]),Me=C.exports.useCallback(function(lt){var dt;return!!(!((dt=De.get(te(lt)))===null||dt===void 0)&&dt.disabled)},[De,te]),Ne=C.exports.useMemo(function(){if(z)return[re||[],[]];var lt=Gs(re,!0,Te,Me),dt=lt.checkedKeys,ut=lt.halfCheckedKeys;return[dt||[],ut]},[re,z,Te,Me]),Le=ze(Ne,2),Ve=Le[0],qe=Le[1],Ue=C.exports.useMemo(function(){var lt=I==="radio"?Ve.slice(0,1):Ve;return new Set(lt)},[Ve,I]),ct=C.exports.useMemo(function(){return I==="radio"?new Set:new Set(qe)},[qe,I]),pt=C.exports.useState(null),Tt=ze(pt,2),Xe=Tt[0],Pt=Tt[1];C.exports.useEffect(function(){e||de(Yk)},[!!e]);var mt=C.exports.useCallback(function(lt,dt){var ut,it;ye(lt),r?(ut=lt,it=lt.map(function(ft){return oe.current.get(ft)})):(ut=[],it=[],lt.forEach(function(ft){var xt=H(ft);xt!==void 0&&(ut.push(ft),it.push(xt))})),de(ut),o==null||o(ut,it,{type:dt})},[de,H,o,r]),Mt=C.exports.useCallback(function(lt,dt,ut,it){if(h){var ft=ut.map(function(xt){return H(xt)});h(H(lt),dt,ft,it)}mt(ut,"single")},[h,H,mt]),Ct=C.exports.useMemo(function(){if(!A||R)return null;var lt=A===!0?[ew,tw,nw]:A;return lt.map(function(dt){return dt===ew?{key:"all",text:J.selectionAll,onSelect:function(){mt(U.map(function(it,ft){return te(it,ft)}).filter(function(it){var ft=De.get(it);return!(ft!=null&&ft.disabled)||Ue.has(it)}),"all")}}:dt===tw?{key:"invert",text:J.selectInvert,onSelect:function(){var it=new Set(Ue);q.forEach(function(xt,Wt){var Ut=te(xt,Wt),Qt=De.get(Ut);Qt!=null&&Qt.disabled||(it.has(Ut)?it.delete(Ut):it.add(Ut))});var ft=Array.from(it);g&&g(ft),mt(ft,"invert")}}:dt===nw?{key:"none",text:J.selectNone,onSelect:function(){b==null||b(),mt(Array.from(Ue).filter(function(it){var ft=De.get(it);return ft==null?void 0:ft.disabled}),"none")}}:dt}).map(function(dt){return tt(tt({},dt),{onSelect:function(){for(var it,ft,xt=arguments.length,Wt=new Array(xt),Ut=0;Ut2&&arguments[2]!==void 0?arguments[2]:!1,Je=tt(tt({},it),Be);bt&&(it.resetPagination(),Je.pagination.current&&(Je.pagination.current=1),g&&g.onChange&&g.onChange(1,Je.pagination.pageSize)),Y&&Y.scrollToFirstRowOnChange!==!1&&Ct.body.current&&Kj(0,{getContainer:function(){return Ct.body.current}}),R==null||R(Je.pagination,Je.filters,Je.sorter,{currentDataSource:Xk(iw(qe,Je.sorterStates,mt),Je.filterStates),action:Ot})},xt=function(Be,Ot){ft({sorter:Be,sorterStates:Ot},"sort",!1)},Wt=kae({prefixCls:pt,mergedColumns:oe,onSorterChange:xt,sortDirections:le||["ascend","descend"],tableLocale:Ve,showSorterTooltip:Q}),Ut=ze(Wt,4),Qt=Ut[0],Fe=Ut[1],Ge=Ut[2],Xt=Ut[3],dn=C.exports.useMemo(function(){return iw(qe,Fe,mt)},[qe,Fe]);it.sorter=Xt(),it.sorterStates=Fe;var Vt=function(Be,Ot){ft({filters:Be,filterStates:Ot},"filter",!0)},jt=fae({prefixCls:pt,locale:Ve,dropdownPrefixCls:Tt,mergedColumns:oe,onFilterChange:Vt,getPopupContainer:N}),nn=ze(jt,3),_n=nn[0],An=nn[1],_t=nn[2],Gt=Xk(dn,An);it.filters=_t,it.filterStates=An;var an=C.exports.useMemo(function(){var We={};return Object.keys(_t).forEach(function(Be){_t[Be]!==null&&(We[Be]=_t[Be])}),tt(tt({},Ge),{filters:We})},[Ge,_t]),Fn=Tae(an),kn=ze(Fn,1),zt=kn[0],Tn=function(Be,Ot){ft({pagination:tt(tt({},it.pagination),{current:Be,pageSize:Ot})},"paginate")},Cn=gae(Gt.length,g,Tn),hn=ze(Cn,2),Nt=hn[0],ot=hn[1];it.pagination=g===!1?{}:mae(g,Nt),it.resetPagination=ot;var ht=C.exports.useMemo(function(){if(g===!1||!Nt.pageSize)return Gt;var We=Nt.current,Be=We===void 0?1:We,Ot=Nt.total,bt=Nt.pageSize,Je=bt===void 0?DO:bt;return Gt.lengthJe?Gt.slice((Be-1)*Je,Be*Je):Gt:Gt.slice((Be-1)*Je,Be*Je)},[!!g,Gt,Nt&&Nt.current,Nt&&Nt.pageSize,Nt&&Nt.total]),At=yae(b,{prefixCls:pt,data:Gt,pageData:ht,getRowKey:Lt,getRecordByKey:ut,expandType:Mt,childrenColumnName:mt,locale:Ve,getPopupContainer:N}),$t=ze(At,2),cn=$t[0],Mn=$t[1],Gn=function(Be,Ot,bt){var Je;return typeof I=="function"?Je=Ye(I(Be,Ot,bt)):Je=Ye(I),Ye(se({},"".concat(pt,"-row-selected"),Mn.has(Lt(Be,Ot))),Je)};Xe.__PARENT_RENDER_ICON__=Xe.expandIcon,Xe.expandIcon=Xe.expandIcon||B||vJ(Ve),Mt==="nest"&&Xe.expandIconColumnIndex===void 0?Xe.expandIconColumnIndex=b?1:0:Xe.expandIconColumnIndex>0&&b&&(Xe.expandIconColumnIndex-=1),typeof Xe.indentSize!="number"&&(Xe.indentSize=typeof te=="number"?te:15);var qn=C.exports.useCallback(function(We){return zt(cn(_n(Qt(We))))},[Qt,_n,cn]),me,K;if(g!==!1&&(Nt==null?void 0:Nt.total)){var G;Nt.size?G=Nt.size:G=Le==="small"||Le==="middle"?"small":void 0;var ce=function(Be){return E(EY,{...Nt,className:Ye("".concat(pt,"-pagination ").concat(pt,"-pagination-").concat(Be),Nt.className),size:G})},ae=Ne==="rtl"?"left":"right",xe=Nt.position;if(xe!==null&&Array.isArray(xe)){var Ee=xe.find(function(We){return We.includes("top")}),be=xe.find(function(We){return We.includes("bottom")}),Ce=xe.every(function(We){return"".concat(We)==="none"});!Ee&&!be&&!Ce&&(K=ce(ae)),Ee&&(me=ce(Ee.toLowerCase().replace("top",""))),be&&(K=ce(be.toLowerCase().replace("bottom","")))}else K=ce(ae)}var Oe;typeof z=="boolean"?Oe={spinning:z}:sn(z)==="object"&&(Oe=tt({spinning:!0},z));var He=Ye("".concat(pt,"-wrapper"),se({},"".concat(pt,"-wrapper-rtl"),Ne==="rtl"),i);return E("div",{ref:t,className:He,style:l,children:Qe(P4,{spinning:!1,...Oe,children:[me,E(Pc,{...ye,columns:oe,direction:Ne,expandable:Xe,prefixCls:pt,className:Ye((n={},se(n,"".concat(pt,"-middle"),Le==="middle"),se(n,"".concat(pt,"-small"),Le==="small"),se(n,"".concat(pt,"-bordered"),o),se(n,"".concat(pt,"-empty"),qe.length===0),n)),data:ht,rowKey:Lt,rowClassName:Gn,emptyText:J&&J.emptyText||(Me||s4)("Table"),internalHooks:Pg,internalRefs:Ct,transformColumns:qn}),K]})})}var Mae=C.exports.forwardRef(Iae),sl=Mae;sl.SELECTION_COLUMN=Rl;sl.EXPAND_COLUMN=Pc.EXPAND_COLUMN;sl.SELECTION_ALL=ew;sl.SELECTION_INVERT=tw;sl.SELECTION_NONE=nw;sl.Column=pJ;sl.ColumnGroup=mJ;sl.Summary=aO;const Rae=sl;var VO=C.exports.createContext(null),UO=C.exports.createContext(null);function Aae(e){return Array.isArray(e)?e:e!==void 0?[e]:[]}function Oae(e){var t=e||{},n=t.label,r=t.value,i=t.children,l=r||"value";return{_title:n?[n]:["title","label"],value:l,key:l,children:i||"children"}}function ow(e){return!e||e.disabled||e.disableCheckbox||e.checkable===!1}function Nae(e,t){var n=[];function r(i){i.forEach(function(l){var c=l[t.children];c&&(n.push(l[t.value]),r(c))})}return r(e),n}function tT(e){return e==null}var Dae={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},Lae=function(t,n){var r=ER(),i=r.prefixCls,l=r.multiple,c=r.searchValue,o=r.toggleOpen,h=r.open,p=r.notFoundContent,g=C.exports.useContext(UO),b=g.virtual,w=g.listHeight,P=g.listItemHeight,I=g.treeData,A=g.fieldNames,O=g.onSelect,M=g.dropdownMatchSelectWidth,R=g.treeExpandAction,N=C.exports.useContext(VO),z=N.checkable,B=N.checkedKeys,U=N.halfCheckedKeys,q=N.treeExpandedKeys,H=N.treeDefaultExpandAll,te=N.treeDefaultExpandedKeys,Y=N.onTreeExpand,le=N.treeIcon,J=N.showTreeIcon,Z=N.switcherIcon,Q=N.treeLine,ge=N.treeNodeFilterProp,re=N.loadData,de=N.treeLoadedKeys,oe=N.treeMotion,ye=N.onTreeLoad,Re=N.keyEntities,Te=C.exports.useRef(),ke=Kp(function(){return I},[h,I],function(xt,Wt){return Wt[0]&&xt[1]!==Wt[1]}),De=C.exports.useMemo(function(){return z?{checked:B,halfChecked:U}:null},[z,B,U]);C.exports.useEffect(function(){if(h&&!l&&B.length){var xt;(xt=Te.current)===null||xt===void 0||xt.scrollTo({key:B[0]})}},[h]);var Me=String(c).toLowerCase(),Ne=function(Wt){return Me?String(Wt[ge]).toLowerCase().includes(Me):!1},Le=C.exports.useState(te),Ve=ze(Le,2),qe=Ve[0],Ue=Ve[1],ct=C.exports.useState(null),pt=ze(ct,2),Tt=pt[0],Xe=pt[1],Pt=C.exports.useMemo(function(){return q?wt(q):c?Tt:qe},[qe,Tt,q,c]);C.exports.useEffect(function(){c&&Xe(Nae(I,A))},[c]);var mt=function(Wt){Ue(Wt),Xe(Wt),Y&&Y(Wt)},Mt=function(Wt){Wt.preventDefault()},Ct=function(Wt,Ut){var Qt=Ut.node;z&&ow(Qt)||(O(Qt.key,{selected:!B.includes(Qt.key)}),l||o(!1))},Lt=C.exports.useState(null),lt=ze(Lt,2),dt=lt[0],ut=lt[1],it=Re[dt];if(C.exports.useImperativeHandle(n,function(){var xt;return{scrollTo:(xt=Te.current)===null||xt===void 0?void 0:xt.scrollTo,onKeyDown:function(Ut){var Qt,Fe=Ut.which;switch(Fe){case Et.UP:case Et.DOWN:case Et.LEFT:case Et.RIGHT:(Qt=Te.current)===null||Qt===void 0||Qt.onKeyDown(Ut);break;case Et.ENTER:{if(it){var Ge=(it==null?void 0:it.node)||{},Xt=Ge.selectable,dn=Ge.value;Xt!==!1&&Ct(null,{node:{key:dt},selected:!B.includes(dn)})}break}case Et.ESC:o(!1)}},onKeyUp:function(){}}}),ke.length===0)return E("div",{role:"listbox",className:"".concat(i,"-empty"),onMouseDown:Mt,children:p});var ft={fieldNames:A};return de&&(ft.loadedKeys=de),Pt&&(ft.expandedKeys=Pt),Qe("div",{onMouseDown:Mt,children:[it&&h&&E("span",{style:Dae,"aria-live":"assertive",children:it.node.value}),E(J0,{ref:Te,focusable:!1,prefixCls:"".concat(i,"-tree"),treeData:ke,height:w,itemHeight:P,virtual:b!==!1&&M!==!1,multiple:l,icon:le,showIcon:J,switcherIcon:Z,showLine:Q,loadData:c?null:re,motion:oe,activeKey:dt,checkable:z,checkStrictly:!0,checkedKeys:De,selectedKeys:z?[]:B,defaultExpandAll:H,...ft,onActiveChange:ut,onSelect:Ct,onCheck:Ct,onExpand:mt,onLoad:ye,filterTreeNode:Ne,expandAction:R})]})},jO=C.exports.forwardRef(Lae);jO.displayName="OptionList";var D4=function(){return null},KO="SHOW_ALL",L4="SHOW_PARENT",e1="SHOW_CHILD";function nT(e,t,n,r){var i=new Set(e);return t===e1?e.filter(function(l){var c=n[l];return!(c&&c.children&&c.children.some(function(o){var h=o.node;return i.has(h[r.value])})&&c.children.every(function(o){var h=o.node;return ow(h)||i.has(h[r.value])}))}):t===L4?e.filter(function(l){var c=n[l],o=c?c.parent:null;return!(o&&!ow(o.node)&&i.has(o.key))}):e}var zae=["children","value"];function HO(e){return Xi(e).map(function(t){if(!C.exports.isValidElement(t)||!t.type)return null;var n=t,r=n.key,i=n.props,l=i.children,c=i.value,o=In(i,zae),h=ve({key:r,value:c},o),p=HO(l);return p.length&&(h.children=p),h}).filter(function(t){return t})}function aw(e){if(!e)return e;var t=ve({},e);return"props"in t||Object.defineProperty(t,"props",{get:function(){return Nr(!1,"New `rc-tree-select` not support return node instance as argument anymore. Please consider to remove `props` access."),t}}),t}function Fae(e,t,n,r,i,l){var c=null,o=null;function h(){function p(g){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"0",w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return g.map(function(P,I){var A="".concat(b,"-").concat(I),O=P[l.value],M=n.includes(O),R=p(P[l.children]||[],A,M),N=E(D4,{...P,children:R.map(function(B){return B.node})});if(t===O&&(c=N),M){var z={pos:A,node:N,children:R};return w||o.push(z),z}return null}).filter(function(P){return P})}o||(o=[],p(r),o.sort(function(g,b){var w=g.node.props.value,P=b.node.props.value,I=n.indexOf(w),A=n.indexOf(P);return I-A}))}Object.defineProperty(e,"triggerNode",{get:function(){return Nr(!1,"`triggerNode` is deprecated. Please consider decoupling data with node."),h(),c}}),Object.defineProperty(e,"allCheckedNodes",{get:function(){return Nr(!1,"`allCheckedNodes` is deprecated. Please consider decoupling data with node."),h(),i?o:o.map(function(g){var b=g.node;return b})}})}function $ae(e,t){var n=t.id,r=t.pId,i=t.rootPId,l={},c=[],o=e.map(function(h){var p=ve({},h),g=p[n];return l[g]=p,p.key=p.key||g,p});return o.forEach(function(h){var p=h[r],g=l[p];g&&(g.children=g.children||[],g.children.push(h)),(p===i||!g&&i===null)&&c.push(h)}),c}function Bae(e,t,n){return C.exports.useMemo(function(){return e?n?$ae(e,ve({id:"id",pId:"pId",rootPId:null},n!==!0?n:{})):e:HO(t)},[t,n,e])}const Vae=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(l){var c,o=l.value,h=(c=l.label)!==null&&c!==void 0?c:n.get(o);return r.set(o,h),ve(ve({},l),{},{label:h})});return t.current.valueLabels=r,[i]},[e])};function rT(e){var t=C.exports.useRef();t.current=e;var n=C.exports.useCallback(function(){return t.current.apply(t,arguments)},[]);return n}const Uae=function(e,t){return C.exports.useMemo(function(){var n=U0(e,{fieldNames:t,initWrapper:function(i){return ve(ve({},i),{},{valueEntities:new Map})},processEntity:function(i,l){var c=i.node[t.value];l.valueEntities.set(c,i)}});return n},[e,t])},jae=function(e,t,n,r){return C.exports.useMemo(function(){var i=e.map(function(h){var p=h.value;return p}),l=t.map(function(h){var p=h.value;return p}),c=i.filter(function(h){return!r[h]});if(n){var o=Gs(i,!0,r);i=o.checkedKeys,l=o.halfCheckedKeys}return[Array.from(new Set([].concat(wt(c),wt(i)))),l]},[e,t,n,r])},Kae=function(e,t,n){var r=n.treeNodeFilterProp,i=n.filterTreeNode,l=n.fieldNames,c=l.children;return C.exports.useMemo(function(){if(!t||i===!1)return e;var o;if(typeof i=="function")o=i;else{var h=t.toUpperCase();o=function(b,w){var P=w[r];return String(P).toUpperCase().includes(h)}}function p(g){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return g.map(function(w){var P=w[c],I=b||o(t,aw(w)),A=p(P||[],I);return I||A.length?ve(ve({},w),{},se({isLeaf:void 0},c,A)):null}).filter(function(w){return w})}return p(e)},[e,t,c,r,i])};var Hae=["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 Wae(e){return!e||sn(e)!=="object"}var Gae=C.exports.forwardRef(function(e,t){var n=e.id,r=e.prefixCls,i=r===void 0?"rc-tree-select":r,l=e.value,c=e.defaultValue,o=e.onChange,h=e.onSelect,p=e.onDeselect,g=e.searchValue,b=e.inputValue,w=e.onSearch,P=e.autoClearSearchValue,I=P===void 0?!0:P,A=e.filterTreeNode,O=e.treeNodeFilterProp,M=O===void 0?"value":O,R=e.showCheckedStrategy,N=R===void 0?e1:R,z=e.treeNodeLabelProp,B=e.multiple,U=e.treeCheckable,q=e.treeCheckStrictly,H=e.labelInValue,te=e.fieldNames,Y=e.treeDataSimpleMode,le=e.treeData,J=e.children,Z=e.loadData,Q=e.treeLoadedKeys,ge=e.onTreeLoad,re=e.treeDefaultExpandAll,de=e.treeExpandedKeys,oe=e.treeDefaultExpandedKeys,ye=e.onTreeExpand,Re=e.treeExpandAction,Te=e.virtual,ke=e.listHeight,De=ke===void 0?200:ke,Me=e.listItemHeight,Ne=Me===void 0?20:Me,Le=e.onDropdownVisibleChange,Ve=e.dropdownMatchSelectWidth,qe=Ve===void 0?!0:Ve,Ue=e.treeLine,ct=e.treeIcon,pt=e.showTreeIcon,Tt=e.switcherIcon,Xe=e.treeMotion,Pt=In(e,Hae),mt=ZR(n),Mt=U&&!q,Ct=U||q,Lt=q||H,lt=Ct||B,dt=Vi(c,{value:l}),ut=ze(dt,2),it=ut[0],ft=ut[1],xt=C.exports.useMemo(function(){return Oae(te)},[JSON.stringify(te)]),Wt=Vi("",{value:g!==void 0?g:b,postState:function(xe){return xe||""}}),Ut=ze(Wt,2),Qt=Ut[0],Fe=Ut[1],Ge=function(xe){Fe(xe),w==null||w(xe)},Xt=Bae(le,J,Y),dn=Uae(Xt,xt),Vt=dn.keyEntities,jt=dn.valueEntities,nn=C.exports.useCallback(function(ae){var xe=[],Ee=[];return ae.forEach(function(be){jt.has(be)?Ee.push(be):xe.push(be)}),{missingRawValues:xe,existRawValues:Ee}},[jt]),_n=Kae(Xt,Qt,{fieldNames:xt,treeNodeFilterProp:M,filterTreeNode:A}),An=C.exports.useCallback(function(ae){if(ae){if(z)return ae[z];for(var xe=xt._title,Ee=0;Ee"u"){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var b=iT[t.format]||iT.default;window.clipboardData.setData(b,e)}else g.clipboardData.clearData(),g.clipboardData.setData(t.format,e);t.onCopy&&(g.preventDefault(),t.onCopy(g.clipboardData))}),document.body.appendChild(o),l.selectNodeContents(o),c.addRange(l);var p=document.execCommand("copy");if(!p)throw new Error("copy command was unsuccessful");h=!0}catch(g){n&&console.error("unable to copy using execCommand: ",g),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),h=!0}catch(b){n&&console.error("unable to copy using clipboardData: ",b),n&&console.error("falling back to prompt"),r=ase("message"in t?t.message:ose),window.prompt(r,e)}}finally{c&&(typeof c.removeRange=="function"?c.removeRange(l):c.removeAllRanges()),o&&document.body.removeChild(o),i()}return h}var lse=sse,use={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 cse=use;var ZO=function(t,n){return E(lr,{...ve(ve({},t),{},{ref:n,icon:cse})})};ZO.displayName="EnterOutlined";const dse=C.exports.forwardRef(ZO);var fse=function(t){var n=t.prefixCls,r=t["aria-label"],i=t.className,l=t.style,c=t.direction,o=t.maxLength,h=t.autoSize,p=h===void 0?!0:h,g=t.value,b=t.onSave,w=t.onCancel,P=t.onEnd,I=t.component,A=t.enterIcon,O=A===void 0?E(dse,{}):A,M=C.exports.useRef(null),R=C.exports.useRef(!1),N=C.exports.useRef(),z=C.exports.useState(g),B=ze(z,2),U=B[0],q=B[1];C.exports.useEffect(function(){q(g)},[g]),C.exports.useEffect(function(){if(M.current&&M.current.resizableTextArea){var de=M.current.resizableTextArea.textArea;de.focus();var oe=de.value.length;de.setSelectionRange(oe,oe)}},[]);var H=function(oe){var ye=oe.target;q(ye.value.replace(/[\n\r]/g,""))},te=function(){R.current=!0},Y=function(){R.current=!1},le=function(oe){var ye=oe.keyCode;R.current||(N.current=ye)},J=function(){b(U.trim())},Z=function(oe){var ye=oe.keyCode,Re=oe.ctrlKey,Te=oe.altKey,ke=oe.metaKey,De=oe.shiftKey;N.current===ye&&!R.current&&!Re&&!Te&&!ke&&!De&&(ye===Et.ENTER?(J(),P==null||P()):ye===Et.ESC&&w())},Q=function(){J()},ge=I?"".concat(n,"-").concat(I):"",re=Ye(n,"".concat(n,"-edit-content"),se({},"".concat(n,"-rtl"),c==="rtl"),i,ge);return Qe("div",{className:re,style:l,children:[E(kA,{ref:M,maxLength:o,value:U,onChange:H,onKeyDown:le,onKeyUp:Z,onCompositionStart:te,onCompositionEnd:Y,onBlur:Q,"aria-label":r,rows:1,autoSize:p}),O!==null?Ei(O,{className:"".concat(n,"-edit-content-confirm")}):null]})};const hse=fse;function O_(e,t){return C.exports.useMemo(function(){var n=!!e;return[n,tt(tt({},t),n&&sn(e)==="object"?e:null)]},[e])}var pse=function(t,n){var r=C.exports.useRef(!1);C.exports.useEffect(function(){r.current?t():r.current=!0},n)};const mse=pse;var vse=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(l).slice(0,p)),r}r.push(l),n=h}return e}var xse=0,ng=1,aT=2,N_=3,sT=4,_se=function(t){var n=t.enabledMeasure,r=t.children,i=t.text,l=t.width,c=t.fontSize,o=t.rows,h=t.onEllipsis,p=C.exports.useState([0,0,0]),g=ze(p,2),b=ze(g[0],3),w=b[0],P=b[1],I=b[2],A=g[1],O=C.exports.useState(xse),M=ze(O,2),R=M[0],N=M[1],z=C.exports.useState(0),B=ze(z,2),U=B[0],q=B[1],H=C.exports.useRef(null),te=C.exports.useRef(null),Y=C.exports.useMemo(function(){return Xi(i)},[i]),le=C.exports.useMemo(function(){return yse(Y)},[Y]),J=C.exports.useMemo(function(){return!n||R!==N_?r(Y,!1):r(oT(Y,P),P1&&ot,cn=function(Je){var Rt;Ut(!0),(Rt=zt.onExpand)===null||Rt===void 0||Rt.call(zt,Je)},Mn=C.exports.useState(0),Gn=ze(Mn,2),qn=Gn[0],me=Gn[1],K=C.exports.useState(0),G=ze(K,2),ce=G[0],ae=G[1],xe=function(Je,Rt){var Bt=Je.offsetWidth,gn;me(Bt),ae(parseInt((gn=window.getComputedStyle)===null||gn===void 0?void 0:gn.call(window,Rt).fontSize,10)||0)},Ee=function(Je){var Rt;Xt(Je),Ge!==Je&&((Rt=zt.onEllipsis)===null||Rt===void 0||Rt.call(zt,Je))};C.exports.useEffect(function(){var bt=B.current;if(kn&&ot&&bt){var Je=$t?bt.offsetHeight"u"||!bt||!ot||!Tn)){var Je=new IntersectionObserver(function(){Gt(!!bt.offsetParent)});return Je.observe(bt),function(){Je.disconnect()}}},[ot,Tn]);var be={};zt.tooltip===!0?be={title:(n=J.text)!==null&&n!==void 0?n:g}:C.exports.isValidElement(zt.tooltip)?be={title:zt.tooltip}:sn(zt.tooltip)==="object"?be=tt({title:(r=J.text)!==null&&r!==void 0?r:g},zt.tooltip):be={title:zt.tooltip};var Ce=C.exports.useMemo(function(){var bt=function(Rt){return["string","number"].includes(sn(Rt))};if(!(!kn||ot)){if(bt(J.text))return J.text;if(bt(g))return g;if(bt(A))return A;if(bt(be.title))return be.title}},[kn,ot,A,be.title,ht]);if(ge)return E(hse,{value:(i=J.text)!==null&&i!==void 0?i:typeof g=="string"?g:"",onSave:Te,onCancel:ke,onEnd:J.onEnd,prefixCls:q,className:c,style:o,direction:N,component:I,maxLength:J.maxLength,autoSize:J.autoSize,enterIcon:J.enterIcon});var Oe=function(){var Je=zt.expandable,Rt=zt.symbol;if(!Je)return null;var Bt;return Rt?Bt=Rt:Bt=z.expand,E("a",{className:"".concat(q,"-expand"),onClick:cn,"aria-label":z.expand,children:Bt},"expand")},He=function(){if(!!le){var Je=J.icon,Rt=J.tooltip,Bt=Xi(Rt)[0]||z.edit,gn=typeof Bt=="string"?Bt:"";return oe.includes("icon")?E(oo,{title:Rt===!1?"":Bt,children:E(dk,{ref:U,className:"".concat(q,"-edit"),onClick:Re,"aria-label":gn,children:Je||E(nse,{role:"button"})})},"edit"):null}},We=function(){if(!!Ne){var Je=Le.tooltips,Rt=Le.icon,Bt=lT(Je),gn=lT(Rt),on=Ue?rg(Bt[1],z.copied):rg(Bt[0],z.copy),yn=Ue?z.copied:z.copy,Bn=typeof on=="string"?on:yn;return E(oo,{title:on,children:E(dk,{className:Ye("".concat(q,"-copy"),Ue&&"".concat(q,"-copy-success")),onClick:Pt,"aria-label":Bn,children:Ue?rg(gn[1],E(a7,{}),!0):rg(gn[0],E(Jae,{}),!0)})},"copy")}},Be=function(Je){return[Je&&Oe(),He(),We()]},Ot=function(Je){return[Je&&E("span",{"aria-hidden":!0,children:kse},"ellipsis"),zt.suffix,Be(Je)]};return E(ol,{onResize:xe,disabled:!Tn||ot,children:function(bt){var Je;return E(Cse,{tooltipProps:be,enabledEllipsis:Tn,isEllipsis:ht,children:E(XO,{className:Ye((Je={},se(Je,"".concat(q,"-").concat(h),h),se(Je,"".concat(q,"-disabled"),p),se(Je,"".concat(q,"-ellipsis"),kn),se(Je,"".concat(q,"-single-line"),Tn&&hn===1),se(Je,"".concat(q,"-ellipsis-single-line"),At),se(Je,"".concat(q,"-ellipsis-multiple-line"),$t),Je),c),prefixCls:l,style:tt(tt({},o),{WebkitLineClamp:$t?hn:void 0}),component:I,ref:Lo(bt,B,t),direction:N,onClick:oe.includes("text")?Re:void 0,"aria-label":Ce==null?void 0:Ce.toString(),title:A,...H,children:E(bse,{enabledMeasure:Tn&&!ot,text:g,rows:hn,width:qn,fontSize:ce,onEllipsis:Ee,children:function(Rt,Bt){var gn=Rt;Rt.length&&Bt&&Ce&&(gn=E("span",{"aria-hidden":!0,children:gn},"show-content"));var on=Ese(e,Qe($n,{children:[gn,Ot(Bt)]}));return on}})})})}})});const t1=Tse;var Pse=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)-ig*t:Math.round(e.h)+ig*t:r=n?Math.round(e.h)+ig*t:Math.round(e.h)-ig*t,r<0?r+=360:r>=360&&(r-=360),r}function fT(e,t,n){if(e.h===0&&e.s===0)return e.s;var r;return n?r=e.s-uT*t:t===eN?r=e.s+uT:r=e.s+jse*t,r>1&&(r=1),n&&t===JO&&r>.1&&(r=.1),r<.06&&(r=.06),Number(r.toFixed(2))}function hT(e,t,n){var r;return n?r=e.v+Kse*t:r=e.v-Hse*t,r>1&&(r=1),Number(r.toFixed(2))}function sw(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=[],r=Ua(e),i=JO;i>0;i-=1){var l=cT(r),c=og(Ua({h:dT(l,i,!0),s:fT(l,i,!0),v:hT(l,i,!0)}));n.push(c)}n.push(og(r));for(var o=1;o<=eN;o+=1){var h=cT(r),p=og(Ua({h:dT(h,o),s:fT(h,o),v:hT(h,o)}));n.push(p)}return t.theme==="dark"?Wse.map(function(g){var b=g.index,w=g.opacity,P=og(Gse(Ua(t.backgroundColor||"#141414"),Ua(n[b]),w*100));return P}):n}var D_={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"},L_={},z_={};Object.keys(D_).forEach(function(e){L_[e]=sw(D_[e]),L_[e].primary=L_[e][5],z_[e]=sw(D_[e],{theme:"dark",backgroundColor:"#141414"}),z_[e].primary=z_[e][5]});function qse(e,t){Nr(e,"[@ant-design/icons] ".concat(t))}function pT(e){return sn(e)==="object"&&typeof e.name=="string"&&typeof e.theme=="string"&&(sn(e.icon)==="object"||typeof e.icon=="function")}function mT(){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 lw(e,t,n){return n?tr.createElement(e.tag,ve(ve({key:t},mT(e.attrs)),n),(e.children||[]).map(function(r,i){return lw(r,"".concat(t,"-").concat(e.tag,"-").concat(i))})):tr.createElement(e.tag,ve({key:t},mT(e.attrs)),(e.children||[]).map(function(r,i){return lw(r,"".concat(t,"-").concat(e.tag,"-").concat(i))}))}function tN(e){return sw(e)[0]}function nN(e){return e?Array.isArray(e)?e:[e]:[]}var Zse=` .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); } } `,Xse=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Zse,n=C.exports.useContext(QO),r=n.csp,i=n.prefixCls,l=t;i&&(l=l.replace(/anticon/g,i)),C.exports.useEffect(function(){Gp(l,"@ant-design-icons",{prepend:!0,csp:r})},[])},Yse=["icon","className","onClick","style","primaryColor","secondaryColor"],op={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function Qse(e){var t=e.primaryColor,n=e.secondaryColor;op.primaryColor=t,op.secondaryColor=n||tN(t),op.calculated=!!n}function Jse(){return ve({},op)}var n1=function(t){var n=t.icon,r=t.className,i=t.onClick,l=t.style,c=t.primaryColor,o=t.secondaryColor,h=In(t,Yse),p=op;if(c&&(p={primaryColor:c,secondaryColor:o||tN(c)}),Xse(),qse(pT(n),"icon should be icon definiton, but got ".concat(n)),!pT(n))return null;var g=n;return g&&typeof g.icon=="function"&&(g=ve(ve({},g),{},{icon:g.icon(p.primaryColor,p.secondaryColor)})),lw(g.icon,"svg-".concat(g.name),ve({className:r,onClick:i,style:l,"data-icon":g.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},h))};n1.displayName="IconReact";n1.getTwoToneColors=Jse;n1.setTwoToneColors=Qse;const F4=n1;function rN(e){var t=nN(e),n=ze(t,2),r=n[0],i=n[1];return F4.setTwoToneColors({primaryColor:r,secondaryColor:i})}function ele(){var e=F4.getTwoToneColors();return e.calculated?[e.primaryColor,e.secondaryColor]:e.primaryColor}var tle=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];rN("#1890ff");var r1=C.exports.forwardRef(function(e,t){var n,r=e.className,i=e.icon,l=e.spin,c=e.rotate,o=e.tabIndex,h=e.onClick,p=e.twoToneColor,g=In(e,tle),b=C.exports.useContext(QO),w=b.prefixCls,P=w===void 0?"anticon":w,I=b.rootClassName,A=Ye(I,P,(n={},se(n,"".concat(P,"-").concat(i.name),!!i.name),se(n,"".concat(P,"-spin"),!!l||i.name==="loading"),n),r),O=o;O===void 0&&h&&(O=-1);var M=c?{msTransform:"rotate(".concat(c,"deg)"),transform:"rotate(".concat(c,"deg)")}:void 0,R=nN(p),N=ze(R,2),z=N[0],B=N[1];return E("span",{...ve(ve({role:"img","aria-label":i.name},g),{},{ref:t,tabIndex:O,onClick:h,className:A}),children:E(F4,{icon:i,primaryColor:z,secondaryColor:B,style:M})})});r1.displayName="AntdIcon";r1.getTwoToneColor=ele;r1.setTwoToneColor=rN;const ll=r1;var iN=function(t,n){return E(ll,{...ve(ve({},t),{},{ref:n,icon:WY})})};iN.displayName="ArrowRightOutlined";const oN=C.exports.forwardRef(iN);var aN=function(t,n){return E(ll,{...ve(ve({},t),{},{ref:n,icon:Vse})})};aN.displayName="DownloadOutlined";const nle=C.exports.forwardRef(aN);var rle={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 ile=rle;var sN=function(t,n){return E(ll,{...ve(ve({},t),{},{ref:n,icon:ile})})};sN.displayName="FullscreenExitOutlined";const ole=C.exports.forwardRef(sN);var ale={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 sle=ale;var lN=function(t,n){return E(ll,{...ve(ve({},t),{},{ref:n,icon:sle})})};lN.displayName="FullscreenOutlined";const lle=C.exports.forwardRef(lN);var ule={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 cle=ule;var uN=function(t,n){return E(ll,{...ve(ve({},t),{},{ref:n,icon:cle})})};uN.displayName="LockOutlined";const uw=C.exports.forwardRef(uN);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 fle=dle;var cN=function(t,n){return E(ll,{...ve(ve({},t),{},{ref:n,icon:fle})})};cN.displayName="LogoutOutlined";const hle=C.exports.forwardRef(cN);var ple={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 110.8V792H136V270.8l-27.6-21.5 39.3-50.5 42.8 33.3h643.1l42.8-33.3 39.3 50.5-27.7 21.5zM833.6 232L512 482 190.4 232l-42.8-33.3-39.3 50.5 27.6 21.5 341.6 265.6a55.99 55.99 0 0068.7 0L888 270.8l27.6-21.5-39.3-50.5-42.7 33.2z"}}]},name:"mail",theme:"outlined"};const mle=ple;var dN=function(t,n){return E(ll,{...ve(ve({},t),{},{ref:n,icon:mle})})};dN.displayName="MailOutlined";const vle=C.exports.forwardRef(dN);var fN=function(t,n){return E(ll,{...ve(ve({},t),{},{ref:n,icon:u7})})};fN.displayName="SearchOutlined";const gle=C.exports.forwardRef(fN);var yle={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 xle=yle;var hN=function(t,n){return E(ll,{...ve(ve({},t),{},{ref:n,icon:xle})})};hN.displayName="UserOutlined";const pN=C.exports.forwardRef(hN);function mN(e,t){return function(){return e.apply(t,arguments)}}const{toString:vN}=Object.prototype,{getPrototypeOf:$4}=Object,B4=(e=>t=>{const n=vN.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),ul=e=>(e=e.toLowerCase(),t=>B4(t)===e),i1=e=>t=>typeof t===e,{isArray:_f}=Array,Np=i1("undefined");function _le(e){return e!==null&&!Np(e)&&e.constructor!==null&&!Np(e.constructor)&&lu(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const gN=ul("ArrayBuffer");function ble(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&gN(e.buffer),t}const wle=i1("string"),lu=i1("function"),yN=i1("number"),V4=e=>e!==null&&typeof e=="object",Cle=e=>e===!0||e===!1,Mg=e=>{if(B4(e)!=="object")return!1;const t=$4(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Sle=ul("Date"),Ele=ul("File"),kle=ul("Blob"),Tle=ul("FileList"),Ple=e=>V4(e)&&lu(e.pipe),Ile=e=>{const t="[object FormData]";return e&&(typeof FormData=="function"&&e instanceof FormData||vN.call(e)===t||lu(e.toString)&&e.toString()===t)},Mle=ul("URLSearchParams"),Rle=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function cm(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),_f(e))for(r=0,i=e.length;r0;)if(i=n[r],t===i.toLowerCase())return i;return null}const _N=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),bN=e=>!Np(e)&&e!==_N;function cw(){const{caseless:e}=bN(this)&&this||{},t={},n=(r,i)=>{const l=e&&xN(t,i)||i;Mg(t[l])&&Mg(r)?t[l]=cw(t[l],r):Mg(r)?t[l]=cw({},r):_f(r)?t[l]=r.slice():t[l]=r};for(let r=0,i=arguments.length;r(cm(t,(i,l)=>{n&&lu(i)?e[l]=mN(i,n):e[l]=i},{allOwnKeys:r}),e),Ole=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Nle=(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)},Dle=(e,t,n,r)=>{let i,l,c;const o={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),l=i.length;l-- >0;)c=i[l],(!r||r(c,e,t))&&!o[c]&&(t[c]=e[c],o[c]=!0);e=n!==!1&&$4(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Lle=(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},zle=e=>{if(!e)return null;if(_f(e))return e;let t=e.length;if(!yN(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Fle=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&$4(Uint8Array)),$le=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=r.next())&&!i.done;){const l=i.value;t.call(e,l[0],l[1])}},Ble=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Vle=ul("HTMLFormElement"),Ule=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),vT=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),jle=ul("RegExp"),wN=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};cm(n,(i,l)=>{t(i,l,e)!==!1&&(r[l]=i)}),Object.defineProperties(e,r)},Kle=e=>{wN(e,(t,n)=>{if(lu(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(!!lu(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+"'")})}})},Hle=(e,t)=>{const n={},r=i=>{i.forEach(l=>{n[l]=!0})};return _f(e)?r(e):r(String(e).split(t)),n},Wle=()=>{},Gle=(e,t)=>(e=+e,Number.isFinite(e)?e:t),F_="abcdefghijklmnopqrstuvwxyz",gT="0123456789",CN={DIGIT:gT,ALPHA:F_,ALPHA_DIGIT:F_+F_.toUpperCase()+gT},qle=(e=16,t=CN.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function Zle(e){return!!(e&&lu(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const Xle=e=>{const t=new Array(10),n=(r,i)=>{if(V4(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[i]=r;const l=_f(r)?[]:{};return cm(r,(c,o)=>{const h=n(c,i+1);!Np(h)&&(l[o]=h)}),t[i]=void 0,l}}return r};return n(e,0)},It={isArray:_f,isArrayBuffer:gN,isBuffer:_le,isFormData:Ile,isArrayBufferView:ble,isString:wle,isNumber:yN,isBoolean:Cle,isObject:V4,isPlainObject:Mg,isUndefined:Np,isDate:Sle,isFile:Ele,isBlob:kle,isRegExp:jle,isFunction:lu,isStream:Ple,isURLSearchParams:Mle,isTypedArray:Fle,isFileList:Tle,forEach:cm,merge:cw,extend:Ale,trim:Rle,stripBOM:Ole,inherits:Nle,toFlatObject:Dle,kindOf:B4,kindOfTest:ul,endsWith:Lle,toArray:zle,forEachEntry:$le,matchAll:Ble,isHTMLForm:Vle,hasOwnProperty:vT,hasOwnProp:vT,reduceDescriptors:wN,freezeMethods:Kle,toObjectSet:Hle,toCamelCase:Ule,noop:Wle,toFiniteNumber:Gle,findKey:xN,global:_N,isContextDefined:bN,ALPHABET:CN,generateString:qle,isSpecCompliantForm:Zle,toJSONObject:Xle};function fr(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)}It.inherits(fr,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:It.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const SN=fr.prototype,EN={};["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=>{EN[e]={value:e}});Object.defineProperties(fr,EN);Object.defineProperty(SN,"isAxiosError",{value:!0});fr.from=(e,t,n,r,i,l)=>{const c=Object.create(SN);return It.toFlatObject(e,c,function(h){return h!==Error.prototype},o=>o!=="isAxiosError"),fr.call(c,e.message,t,n,r,i),c.cause=e,c.name=e.name,l&&Object.assign(c,l),c};const Yle=null;function dw(e){return It.isPlainObject(e)||It.isArray(e)}function kN(e){return It.endsWith(e,"[]")?e.slice(0,-2):e}function yT(e,t,n){return e?e.concat(t).map(function(i,l){return i=kN(i),!n&&l?"["+i+"]":i}).join(n?".":""):t}function Qle(e){return It.isArray(e)&&!e.some(dw)}const Jle=It.toFlatObject(It,{},null,function(t){return/^is[A-Z]/.test(t)});function o1(e,t,n){if(!It.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=It.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(A,O){return!It.isUndefined(O[A])});const r=n.metaTokens,i=n.visitor||g,l=n.dots,c=n.indexes,h=(n.Blob||typeof Blob<"u"&&Blob)&&It.isSpecCompliantForm(t);if(!It.isFunction(i))throw new TypeError("visitor must be a function");function p(I){if(I===null)return"";if(It.isDate(I))return I.toISOString();if(!h&&It.isBlob(I))throw new fr("Blob is not supported. Use a Buffer instead.");return It.isArrayBuffer(I)||It.isTypedArray(I)?h&&typeof Blob=="function"?new Blob([I]):Buffer.from(I):I}function g(I,A,O){let M=I;if(I&&!O&&typeof I=="object"){if(It.endsWith(A,"{}"))A=r?A:A.slice(0,-2),I=JSON.stringify(I);else if(It.isArray(I)&&Qle(I)||(It.isFileList(I)||It.endsWith(A,"[]"))&&(M=It.toArray(I)))return A=kN(A),M.forEach(function(N,z){!(It.isUndefined(N)||N===null)&&t.append(c===!0?yT([A],z,l):c===null?A:A+"[]",p(N))}),!1}return dw(I)?!0:(t.append(yT(O,A,l),p(I)),!1)}const b=[],w=Object.assign(Jle,{defaultVisitor:g,convertValue:p,isVisitable:dw});function P(I,A){if(!It.isUndefined(I)){if(b.indexOf(I)!==-1)throw Error("Circular reference detected in "+A.join("."));b.push(I),It.forEach(I,function(M,R){(!(It.isUndefined(M)||M===null)&&i.call(t,M,It.isString(R)?R.trim():R,A,w))===!0&&P(M,A?A.concat(R):[R])}),b.pop()}}if(!It.isObject(e))throw new TypeError("data must be an object");return P(e),t}function xT(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function U4(e,t){this._pairs=[],e&&o1(e,this,t)}const TN=U4.prototype;TN.append=function(t,n){this._pairs.push([t,n])};TN.toString=function(t){const n=t?function(r){return t.call(this,r,xT)}:xT;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function eue(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function PN(e,t,n){if(!t)return e;const r=n&&n.encode||eue,i=n&&n.serialize;let l;if(i?l=i(t,n):l=It.isURLSearchParams(t)?t.toString():new U4(t,n).toString(r),l){const c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+l}return e}class tue{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){It.forEach(this.handlers,function(r){r!==null&&t(r)})}}const _T=tue,IN={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},nue=typeof URLSearchParams<"u"?URLSearchParams:U4,rue=typeof FormData<"u"?FormData:null,iue=(()=>{let e;return typeof navigator<"u"&&((e=navigator.product)==="ReactNative"||e==="NativeScript"||e==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),oue=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),us={isBrowser:!0,classes:{URLSearchParams:nue,FormData:rue,Blob},isStandardBrowserEnv:iue,isStandardBrowserWebWorkerEnv:oue,protocols:["http","https","file","blob","url","data"]};function aue(e,t){return o1(e,new us.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,l){return us.isNode&&It.isBuffer(n)?(this.append(r,n.toString("base64")),!1):l.defaultVisitor.apply(this,arguments)}},t))}function sue(e){return It.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function lue(e){const t={},n=Object.keys(e);let r;const i=n.length;let l;for(r=0;r=n.length;return c=!c&&It.isArray(i)?i.length:c,h?(It.hasOwnProp(i,c)?i[c]=[i[c],r]:i[c]=r,!o):((!i[c]||!It.isObject(i[c]))&&(i[c]=[]),t(n,r,i[c],l)&&It.isArray(i[c])&&(i[c]=lue(i[c])),!o)}if(It.isFormData(e)&&It.isFunction(e.entries)){const n={};return It.forEachEntry(e,(r,i)=>{t(sue(r),i,n,0)}),n}return null}const uue={"Content-Type":void 0};function cue(e,t,n){if(It.isString(e))try{return(t||JSON.parse)(e),It.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const a1={transitional:IN,adapter:["xhr","http"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,l=It.isObject(t);if(l&&It.isHTMLForm(t)&&(t=new FormData(t)),It.isFormData(t))return i&&i?JSON.stringify(MN(t)):t;if(It.isArrayBuffer(t)||It.isBuffer(t)||It.isStream(t)||It.isFile(t)||It.isBlob(t))return t;if(It.isArrayBufferView(t))return t.buffer;if(It.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let o;if(l){if(r.indexOf("application/x-www-form-urlencoded")>-1)return aue(t,this.formSerializer).toString();if((o=It.isFileList(t))||r.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return o1(o?{"files[]":t}:t,h&&new h,this.formSerializer)}}return l||i?(n.setContentType("application/json",!1),cue(t)):t}],transformResponse:[function(t){const n=this.transitional||a1.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(t&&It.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"?fr.from(o,fr.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:us.classes.FormData,Blob:us.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};It.forEach(["delete","get","head"],function(t){a1.headers[t]={}});It.forEach(["post","put","patch"],function(t){a1.headers[t]=It.merge(uue)});const j4=a1,due=It.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"]),fue=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]&&due[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},bT=Symbol("internals");function Mh(e){return e&&String(e).trim().toLowerCase()}function Rg(e){return e===!1||e==null?e:It.isArray(e)?e.map(Rg):String(e)}function hue(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 pue(e){return/^[-_a-zA-Z]+$/.test(e.trim())}function $_(e,t,n,r,i){if(It.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!It.isString(t)){if(It.isString(r))return t.indexOf(r)!==-1;if(It.isRegExp(r))return r.test(t)}}function mue(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function vue(e,t){const n=It.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(i,l,c){return this[r].call(this,t,i,l,c)},configurable:!0})})}class s1{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function l(o,h,p){const g=Mh(h);if(!g)throw new Error("header name must be a non-empty string");const b=It.findKey(i,g);(!b||i[b]===void 0||p===!0||p===void 0&&i[b]!==!1)&&(i[b||h]=Rg(o))}const c=(o,h)=>It.forEach(o,(p,g)=>l(p,g,h));return It.isPlainObject(t)||t instanceof this.constructor?c(t,n):It.isString(t)&&(t=t.trim())&&!pue(t)?c(fue(t),n):t!=null&&l(n,t,r),this}get(t,n){if(t=Mh(t),t){const r=It.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return hue(i);if(It.isFunction(n))return n.call(this,i,r);if(It.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Mh(t),t){const r=It.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||$_(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function l(c){if(c=Mh(c),c){const o=It.findKey(r,c);o&&(!n||$_(r,r[o],o,n))&&(delete r[o],i=!0)}}return It.isArray(t)?t.forEach(l):l(t),i}clear(t){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const l=n[r];(!t||$_(this,this[l],l,t,!0))&&(delete this[l],i=!0)}return i}normalize(t){const n=this,r={};return It.forEach(this,(i,l)=>{const c=It.findKey(r,l);if(c){n[c]=Rg(i),delete n[l];return}const o=t?mue(l):String(l).trim();o!==l&&delete n[l],n[o]=Rg(i),r[o]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return It.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&It.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[bT]=this[bT]={accessors:{}}).accessors,i=this.prototype;function l(c){const o=Mh(c);r[o]||(vue(i,c),r[o]=!0)}return It.isArray(t)?t.forEach(l):l(t),this}}s1.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);It.freezeMethods(s1.prototype);It.freezeMethods(s1);const qs=s1;function B_(e,t){const n=this||j4,r=t||n,i=qs.from(r.headers);let l=r.data;return It.forEach(e,function(o){l=o.call(n,l,i.normalize(),t?t.status:void 0)}),i.normalize(),l}function RN(e){return!!(e&&e.__CANCEL__)}function dm(e,t,n){fr.call(this,e==null?"canceled":e,fr.ERR_CANCELED,t,n),this.name="CanceledError"}It.inherits(dm,fr,{__CANCEL__:!0});function gue(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new fr("Request failed with status code "+n.status,[fr.ERR_BAD_REQUEST,fr.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const yue=us.isStandardBrowserEnv?function(){return{write:function(n,r,i,l,c,o){const h=[];h.push(n+"="+encodeURIComponent(r)),It.isNumber(i)&&h.push("expires="+new Date(i).toGMTString()),It.isString(l)&&h.push("path="+l),It.isString(c)&&h.push("domain="+c),o===!0&&h.push("secure"),document.cookie=h.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 xue(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function _ue(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function AN(e,t){return e&&!xue(t)?_ue(e,t):t}const bue=us.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function i(l){let c=l;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=It.isString(c)?i(c):c;return o.protocol===r.protocol&&o.host===r.host}}():function(){return function(){return!0}}();function wue(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Cue(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,l=0,c;return t=t!==void 0?t:1e3,function(h){const p=Date.now(),g=r[l];c||(c=p),n[i]=h,r[i]=p;let b=l,w=0;for(;b!==i;)w+=n[b++],b=b%e;if(i=(i+1)%e,i===l&&(l=(l+1)%e),p-c{const l=i.loaded,c=i.lengthComputable?i.total:void 0,o=l-n,h=r(o),p=l<=c;n=l;const g={loaded:l,total:c,progress:c?l/c:void 0,bytes:o,rate:h||void 0,estimated:h&&c&&p?(c-l)/h:void 0,event:i};g[t?"download":"upload"]=!0,e(g)}}const Sue=typeof XMLHttpRequest<"u",Eue=Sue&&function(e){return new Promise(function(n,r){let i=e.data;const l=qs.from(e.headers).normalize(),c=e.responseType;let o;function h(){e.cancelToken&&e.cancelToken.unsubscribe(o),e.signal&&e.signal.removeEventListener("abort",o)}It.isFormData(i)&&(us.isStandardBrowserEnv||us.isStandardBrowserWebWorkerEnv)&&l.setContentType(!1);let p=new XMLHttpRequest;if(e.auth){const P=e.auth.username||"",I=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";l.set("Authorization","Basic "+btoa(P+":"+I))}const g=AN(e.baseURL,e.url);p.open(e.method.toUpperCase(),PN(g,e.params,e.paramsSerializer),!0),p.timeout=e.timeout;function b(){if(!p)return;const P=qs.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};gue(function(M){n(M),h()},function(M){r(M),h()},A),p=null}if("onloadend"in p?p.onloadend=b:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(b)},p.onabort=function(){!p||(r(new fr("Request aborted",fr.ECONNABORTED,e,p)),p=null)},p.onerror=function(){r(new fr("Network Error",fr.ERR_NETWORK,e,p)),p=null},p.ontimeout=function(){let I=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const A=e.transitional||IN;e.timeoutErrorMessage&&(I=e.timeoutErrorMessage),r(new fr(I,A.clarifyTimeoutError?fr.ETIMEDOUT:fr.ECONNABORTED,e,p)),p=null},us.isStandardBrowserEnv){const P=(e.withCredentials||bue(g))&&e.xsrfCookieName&&yue.read(e.xsrfCookieName);P&&l.set(e.xsrfHeaderName,P)}i===void 0&&l.setContentType(null),"setRequestHeader"in p&&It.forEach(l.toJSON(),function(I,A){p.setRequestHeader(A,I)}),It.isUndefined(e.withCredentials)||(p.withCredentials=!!e.withCredentials),c&&c!=="json"&&(p.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&p.addEventListener("progress",wT(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&p.upload&&p.upload.addEventListener("progress",wT(e.onUploadProgress)),(e.cancelToken||e.signal)&&(o=P=>{!p||(r(!P||P.type?new dm(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=wue(g);if(w&&us.protocols.indexOf(w)===-1){r(new fr("Unsupported protocol "+w+":",fr.ERR_BAD_REQUEST,e));return}p.send(i||null)})},Ag={http:Yle,xhr:Eue};It.forEach(Ag,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const kue={getAdapter:e=>{e=It.isArray(e)?e:[e];const{length:t}=e;let n,r;for(let i=0;ie instanceof qs?e.toJSON():e;function Qd(e,t){t=t||{};const n={};function r(p,g,b){return It.isPlainObject(p)&&It.isPlainObject(g)?It.merge.call({caseless:b},p,g):It.isPlainObject(g)?It.merge({},g):It.isArray(g)?g.slice():g}function i(p,g,b){if(It.isUndefined(g)){if(!It.isUndefined(p))return r(void 0,p,b)}else return r(p,g,b)}function l(p,g){if(!It.isUndefined(g))return r(void 0,g)}function c(p,g){if(It.isUndefined(g)){if(!It.isUndefined(p))return r(void 0,p)}else return r(void 0,g)}function o(p,g,b){if(b in t)return r(p,g);if(b in e)return r(void 0,p)}const h={url:l,method:l,data:l,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,g)=>i(ST(p),ST(g),!0)};return It.forEach(Object.keys(e).concat(Object.keys(t)),function(g){const b=h[g]||i,w=b(e[g],t[g],g);It.isUndefined(w)&&b!==o||(n[g]=w)}),n}const ON="1.3.3",K4={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{K4[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const ET={};K4.transitional=function(t,n,r){function i(l,c){return"[Axios v"+ON+"] Transitional option '"+l+"'"+c+(r?". "+r:"")}return(l,c,o)=>{if(t===!1)throw new fr(i(c," has been removed"+(n?" in "+n:"")),fr.ERR_DEPRECATED);return n&&!ET[c]&&(ET[c]=!0,console.warn(i(c," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(l,c,o):!0}};function Tue(e,t,n){if(typeof e!="object")throw new fr("options must be an object",fr.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const l=r[i],c=t[l];if(c){const o=e[l],h=o===void 0||c(o,l,e);if(h!==!0)throw new fr("option "+l+" must be "+h,fr.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new fr("Unknown option "+l,fr.ERR_BAD_OPTION)}}const fw={assertOptions:Tue,validators:K4},Pl=fw.validators;class Ny{constructor(t){this.defaults=t,this.interceptors={request:new _T,response:new _T}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Qd(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:l}=n;r!==void 0&&fw.assertOptions(r,{silentJSONParsing:Pl.transitional(Pl.boolean),forcedJSONParsing:Pl.transitional(Pl.boolean),clarifyTimeoutError:Pl.transitional(Pl.boolean)},!1),i!==void 0&&fw.assertOptions(i,{encode:Pl.function,serialize:Pl.function},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let c;c=l&&It.merge(l.common,l[n.method]),c&&It.forEach(["delete","get","head","post","put","patch","common"],I=>{delete l[I]}),n.headers=qs.concat(c,l);const o=[];let h=!0;this.interceptors.request.forEach(function(A){typeof A.runWhen=="function"&&A.runWhen(n)===!1||(h=h&&A.synchronous,o.unshift(A.fulfilled,A.rejected))});const p=[];this.interceptors.response.forEach(function(A){p.push(A.fulfilled,A.rejected)});let g,b=0,w;if(!h){const I=[CT.bind(this),void 0];for(I.unshift.apply(I,o),I.push.apply(I,p),w=I.length,g=Promise.resolve(n);b{if(!r._listeners)return;let l=r._listeners.length;for(;l-- >0;)r._listeners[l](i);r._listeners=null}),this.promise.then=i=>{let l;const c=new Promise(o=>{r.subscribe(o),l=o}).then(i);return c.cancel=function(){r.unsubscribe(l)},c},t(function(l,c,o){r.reason||(r.reason=new dm(l,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 H4(function(i){t=i}),cancel:t}}}const Pue=H4;function Iue(e){return function(n){return e.apply(null,n)}}function Mue(e){return It.isObject(e)&&e.isAxiosError===!0}const hw={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(hw).forEach(([e,t])=>{hw[t]=e});const Rue=hw;function NN(e){const t=new Og(e),n=mN(Og.prototype.request,t);return It.extend(n,Og.prototype,t,{allOwnKeys:!0}),It.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return NN(Qd(e,i))},n}const Ai=NN(j4);Ai.Axios=Og;Ai.CanceledError=dm;Ai.CancelToken=Pue;Ai.isCancel=RN;Ai.VERSION=ON;Ai.toFormData=o1;Ai.AxiosError=fr;Ai.Cancel=Ai.CanceledError;Ai.all=function(t){return Promise.all(t)};Ai.spread=Iue;Ai.isAxiosError=Mue;Ai.mergeConfig=Qd;Ai.AxiosHeaders=qs;Ai.formToJSON=e=>MN(It.isHTMLForm(e)?new FormData(e):e);Ai.HttpStatusCode=Rue;Ai.default=Ai;const Aue=Ai;class bf{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 Dp=typeof window>"u"||"Deno"in window;function pa(){}function Oue(e,t){return typeof e=="function"?e(t):e}function pw(e){return typeof e=="number"&&e>=0&&e!==1/0}function DN(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Vh(e,t,n){return fm(e)?typeof t=="function"?{...n,queryKey:e,queryFn:t}:{...t,queryKey:e}:e}function Nue(e,t,n){return fm(e)?typeof t=="function"?{...n,mutationKey:e,mutationFn:t}:{...t,mutationKey:e}:typeof e=="function"?{...t,mutationFn:e}:{...e}}function Nl(e,t,n){return fm(e)?[{...t,queryKey:e},n]:[e||{},t]}function kT(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:l,queryKey:c,stale:o}=e;if(fm(c)){if(r){if(t.queryHash!==W4(c,t.options))return!1}else if(!Dy(t.queryKey,c))return!1}if(n!=="all"){const h=t.isActive();if(n==="active"&&!h||n==="inactive"&&h)return!1}return!(typeof o=="boolean"&&t.isStale()!==o||typeof i<"u"&&i!==t.state.fetchStatus||l&&!l(t))}function TT(e,t){const{exact:n,fetching:r,predicate:i,mutationKey:l}=e;if(fm(l)){if(!t.options.mutationKey)return!1;if(n){if(ac(t.options.mutationKey)!==ac(l))return!1}else if(!Dy(t.options.mutationKey,l))return!1}return!(typeof r=="boolean"&&t.state.status==="loading"!==r||i&&!i(t))}function W4(e,t){return((t==null?void 0:t.queryKeyHashFn)||ac)(e)}function ac(e){return JSON.stringify(e,(t,n)=>vw(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Dy(e,t){return LN(e,t)}function LN(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!LN(e[n],t[n])):!1}function zN(e,t){if(e===t)return e;const n=PT(e)&&PT(t);if(n||vw(e)&&vw(t)){const r=n?e.length:Object.keys(e).length,i=n?t:Object.keys(t),l=i.length,c=n?[]:{};let o=0;for(let h=0;h"u")return!0;const n=t.prototype;return!(!IT(n)||!n.hasOwnProperty("isPrototypeOf"))}function IT(e){return Object.prototype.toString.call(e)==="[object Object]"}function fm(e){return Array.isArray(e)}function FN(e){return new Promise(t=>{setTimeout(t,e)})}function MT(e){FN(0).then(e)}function Due(){if(typeof AbortController=="function")return new AbortController}function gw(e,t,n){return n.isDataEqual!=null&&n.isDataEqual(e,t)?e:typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?zN(e,t):t}class Lue extends bf{constructor(){super(),this.setup=t=>{if(!Dp&&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 Ly=new Lue;class zue extends bf{constructor(){super(),this.setup=t=>{if(!Dp&&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 zy=new zue;function Fue(e){return Math.min(1e3*2**e,3e4)}function l1(e){return(e!=null?e:"online")==="online"?zy.isOnline():!0}class $N{constructor(t){this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}}function Ng(e){return e instanceof $N}function BN(e){let t=!1,n=0,r=!1,i,l,c;const o=new Promise((O,M)=>{l=O,c=M}),h=O=>{r||(P(new $N(O)),e.abort==null||e.abort())},p=()=>{t=!0},g=()=>{t=!1},b=()=>!Ly.isFocused()||e.networkMode!=="always"&&!zy.isOnline(),w=O=>{r||(r=!0,e.onSuccess==null||e.onSuccess(O),i==null||i(),l(O))},P=O=>{r||(r=!0,e.onError==null||e.onError(O),i==null||i(),c(O))},I=()=>new Promise(O=>{i=M=>{const R=r||!b();return R&&O(M),R},e.onPause==null||e.onPause()}).then(()=>{i=void 0,r||e.onContinue==null||e.onContinue()}),A=()=>{if(r)return;let O;try{O=e.fn()}catch(M){O=Promise.reject(M)}Promise.resolve(O).then(w).catch(M=>{var R,N;if(r)return;const z=(R=e.retry)!=null?R:3,B=(N=e.retryDelay)!=null?N:Fue,U=typeof B=="function"?B(n,M):B,q=z===!0||typeof z=="number"&&n{if(b())return I()}).then(()=>{t?P(M):A()})})};return l1(e.networkMode)?A():I().then(A),{promise:o,cancel:h,continue:()=>(i==null?void 0:i())?o:Promise.resolve(),cancelRetry:p,continueRetry:g}}const G4=console;function $ue(){let e=[],t=0,n=g=>{g()},r=g=>{g()};const i=g=>{let b;t++;try{b=g()}finally{t--,t||o()}return b},l=g=>{t?e.push(g):MT(()=>{n(g)})},c=g=>(...b)=>{l(()=>{g(...b)})},o=()=>{const g=e;e=[],g.length&&MT(()=>{r(()=>{g.forEach(b=>{n(b)})})})};return{batch:i,batchCalls:c,schedule:l,setNotifyFunction:g=>{n=g},setBatchNotifyFunction:g=>{r=g}}}const ai=$ue();class VN{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),pw(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(t){this.cacheTime=Math.max(this.cacheTime||0,t!=null?t:Dp?1/0:5*60*1e3)}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class Bue extends VN{constructor(t){super(),this.abortSignalConsumed=!1,this.defaultOptions=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.cache=t.cache,this.logger=t.logger||G4,this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.initialState=t.state||Vue(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=gw(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(pa).catch(pa):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||!DN(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 l;return(l=this.retryer)==null||l.continueRetry(),this.promise}}if(t&&this.setOptions(t),!this.options.queryFn){const P=this.observers.find(I=>I.options.queryFn);P&&this.setOptions(P.options)}Array.isArray(this.options.queryKey);const c=Due(),o={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},h=P=>{Object.defineProperty(P,"signal",{enumerable:!0,get:()=>{if(c)return this.abortSignalConsumed=!0,c.signal}})};h(o);const p=()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(o)):Promise.reject("Missing queryFn"),g={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:p};if(h(g),(r=this.options.behavior)==null||r.onFetch(g),this.revertState=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==((i=g.fetchOptions)==null?void 0:i.meta)){var b;this.dispatch({type:"fetch",meta:(b=g.fetchOptions)==null?void 0:b.meta})}const w=P=>{if(Ng(P)&&P.silent||this.dispatch({type:"error",error:P}),!Ng(P)){var I,A;(I=(A=this.cache.config).onError)==null||I.call(A,P,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=BN({fn:g.fetchFn,abort:c==null?void 0:c.abort.bind(c),onSuccess:P=>{var I,A;if(typeof P>"u"){w(new Error("undefined"));return}this.setData(P),(I=(A=this.cache.config).onSuccess)==null||I.call(A,P,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:w,onFail:(P,I)=>{this.dispatch({type:"failed",failureCount:P,error:I})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:g.options.retry,retryDelay:g.options.retryDelay,networkMode:g.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(t){const n=r=>{var i,l;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:l1(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:(l=t.dataUpdatedAt)!=null?l:Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const c=t.error;return Ng(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 Vue(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 Uue extends bf{constructor(t){super(),this.config=t||{},this.queries=[],this.queriesMap={}}build(t,n,r){var i;const l=n.queryKey,c=(i=n.queryHash)!=null?i:W4(l,n);let o=this.get(c);return o||(o=new Bue({cache:this,logger:t.getLogger(),queryKey:l,queryHash:c,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(l)}),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]=Nl(t,n);return typeof r.exact>"u"&&(r.exact=!0),this.queries.find(i=>kT(r,i))}findAll(t,n){const[r]=Nl(t,n);return Object.keys(r).length>0?this.queries.filter(i=>kT(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 jue extends VN{constructor(t){super(),this.options={...t.defaultOptions,...t.options},this.mutationId=t.mutationId,this.mutationCache=t.mutationCache,this.logger=t.logger||G4,this.observers=[],this.state=t.state||UN(),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 N;return this.retryer=BN({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:(N=this.options.retry)!=null?N:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise},n=this.state.status==="loading";try{var r,i,l,c,o,h;if(!n){var p,g,b,w;this.dispatch({type:"loading",variables:this.options.variables}),await((p=(g=this.mutationCache.config).onMutate)==null?void 0:p.call(g,this.state.variables,this));const z=await((b=(w=this.options).onMutate)==null?void 0:b.call(w,this.state.variables));z!==this.state.context&&this.dispatch({type:"loading",context:z,variables:this.state.variables})}const N=await t();return await((r=(i=this.mutationCache.config).onSuccess)==null?void 0:r.call(i,N,this.state.variables,this.state.context,this)),await((l=(c=this.options).onSuccess)==null?void 0:l.call(c,N,this.state.variables,this.state.context)),await((o=(h=this.options).onSettled)==null?void 0:o.call(h,N,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:N}),N}catch(N){try{var P,I,A,O,M,R;throw await((P=(I=this.mutationCache.config).onError)==null?void 0:P.call(I,N,this.state.variables,this.state.context,this)),await((A=(O=this.options).onError)==null?void 0:A.call(O,N,this.state.variables,this.state.context)),await((M=(R=this.options).onSettled)==null?void 0:M.call(R,void 0,N,this.state.variables,this.state.context)),N}finally{this.dispatch({type:"error",error:N})}}}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:!l1(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 UN(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}class Kue extends bf{constructor(t){super(),this.config=t||{},this.mutations=[],this.mutationId=0}build(t,n,r){const i=new jue({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=>TT(t,n))}findAll(t){return this.mutations.filter(n=>TT(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(pa)),Promise.resolve()))}).then(()=>{this.resuming=void 0}),this.resuming}}function Hue(){return{onFetch:e=>{e.fetchFn=()=>{var t,n,r,i,l,c;const o=(t=e.fetchOptions)==null||(n=t.meta)==null?void 0:n.refetchPage,h=(r=e.fetchOptions)==null||(i=r.meta)==null?void 0:i.fetchMore,p=h==null?void 0:h.pageParam,g=(h==null?void 0:h.direction)==="forward",b=(h==null?void 0:h.direction)==="backward",w=((l=e.state.data)==null?void 0:l.pages)||[],P=((c=e.state.data)==null?void 0:c.pageParams)||[];let I=P,A=!1;const O=U=>{Object.defineProperty(U,"signal",{enumerable:!0,get:()=>{var q;if((q=e.signal)!=null&&q.aborted)A=!0;else{var H;(H=e.signal)==null||H.addEventListener("abort",()=>{A=!0})}return e.signal}})},M=e.options.queryFn||(()=>Promise.reject("Missing queryFn")),R=(U,q,H,te)=>(I=te?[q,...I]:[...I,q],te?[H,...U]:[...U,H]),N=(U,q,H,te)=>{if(A)return Promise.reject("Cancelled");if(typeof H>"u"&&!q&&U.length)return Promise.resolve(U);const Y={queryKey:e.queryKey,pageParam:H,meta:e.options.meta};O(Y);const le=M(Y);return Promise.resolve(le).then(Z=>R(U,H,Z,te))};let z;if(!w.length)z=N([]);else if(g){const U=typeof p<"u",q=U?p:RT(e.options,w);z=N(w,U,q)}else if(b){const U=typeof p<"u",q=U?p:Wue(e.options,w);z=N(w,U,q,!0)}else{I=[];const U=typeof e.options.getNextPageParam>"u";z=(o&&w[0]?o(w[0],0,w):!0)?N([],U,P[0]):Promise.resolve(R([],P[0],w[0]));for(let H=1;H{if(o&&w[H]?o(w[H],H,w):!0){const le=U?P[H]:RT(e.options,te);return N(te,U,le)}return Promise.resolve(R(te,P[H],w[H]))})}return z.then(U=>({pages:U,pageParams:I}))}}}}function RT(e,t){return e.getNextPageParam==null?void 0:e.getNextPageParam(t[t.length-1],t)}function Wue(e,t){return e.getPreviousPageParam==null?void 0:e.getPreviousPageParam(t[0],t)}class Gue{constructor(t={}){this.queryCache=t.queryCache||new Uue,this.mutationCache=t.mutationCache||new Kue,this.logger=t.logger||G4,this.defaultOptions=t.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0}mount(){this.mountCount++,this.mountCount===1&&(this.unsubscribeFocus=Ly.subscribe(()=>{Ly.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=zy.subscribe(()=>{zy.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]=Nl(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=Vh(t,n,r),l=this.getQueryData(i.queryKey);return l?Promise.resolve(l):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),l=i==null?void 0:i.state.data,c=Oue(n,l);if(typeof c>"u")return;const o=Vh(t),h=this.defaultQueryOptions(o);return this.queryCache.build(this,h).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]=Nl(t,n),i=this.queryCache;ai.batch(()=>{i.findAll(r).forEach(l=>{i.remove(l)})})}resetQueries(t,n,r){const[i,l]=Nl(t,n,r),c=this.queryCache,o={type:"active",...i};return ai.batch(()=>(c.findAll(i).forEach(h=>{h.reset()}),this.refetchQueries(o,l)))}cancelQueries(t,n,r){const[i,l={}]=Nl(t,n,r);typeof l.revert>"u"&&(l.revert=!0);const c=ai.batch(()=>this.queryCache.findAll(i).map(o=>o.cancel(l)));return Promise.all(c).then(pa).catch(pa)}invalidateQueries(t,n,r){const[i,l]=Nl(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 h={...i,type:(c=(o=i.refetchType)!=null?o:i.type)!=null?c:"active"};return this.refetchQueries(h,l)})}refetchQueries(t,n,r){const[i,l]=Nl(t,n,r),c=ai.batch(()=>this.queryCache.findAll(i).filter(h=>!h.isDisabled()).map(h=>{var p;return h.fetch(void 0,{...l,cancelRefetch:(p=l==null?void 0:l.cancelRefetch)!=null?p:!0,meta:{refetchPage:i.refetchPage}})}));let o=Promise.all(c).then(pa);return l!=null&&l.throwOnError||(o=o.catch(pa)),o}fetchQuery(t,n,r){const i=Vh(t,n,r),l=this.defaultQueryOptions(i);typeof l.retry>"u"&&(l.retry=!1);const c=this.queryCache.build(this,l);return c.isStaleByTime(l.staleTime)?c.fetch(l):Promise.resolve(c.state.data)}prefetchQuery(t,n,r){return this.fetchQuery(t,n,r).then(pa).catch(pa)}fetchInfiniteQuery(t,n,r){const i=Vh(t,n,r);return i.behavior=Hue(),this.fetchQuery(i)}prefetchInfiniteQuery(t,n,r){return this.fetchInfiniteQuery(t,n,r).then(pa).catch(pa)}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=>ac(t)===ac(i.queryKey));r?r.defaultOptions=n:this.queryDefaults.push({queryKey:t,defaultOptions:n})}getQueryDefaults(t){if(!t)return;const n=this.queryDefaults.find(r=>Dy(t,r.queryKey));return n==null?void 0:n.defaultOptions}setMutationDefaults(t,n){const r=this.mutationDefaults.find(i=>ac(t)===ac(i.mutationKey));r?r.defaultOptions=n:this.mutationDefaults.push({mutationKey:t,defaultOptions:n})}getMutationDefaults(t){if(!t)return;const n=this.mutationDefaults.find(r=>Dy(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=W4(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 que extends bf{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),AT(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.listeners.length||this.destroy()}shouldFetchOnReconnect(){return yw(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return yw(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),mw(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 l=this.hasListeners();l&&OT(this.currentQuery,i,this.options,r)&&this.executeFetch(),this.updateResult(n),l&&(this.currentQuery!==i||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&this.updateStaleTimeout();const c=this.computeRefetchInterval();l&&(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(pa)),n}updateStaleTimeout(){if(this.clearStaleTimeout(),Dp||this.currentResult.isStale||!pw(this.options.staleTime))return;const n=DN(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,!(Dp||this.options.enabled===!1||!pw(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||Ly.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,l=this.currentResult,c=this.currentResultState,o=this.currentResultOptions,h=t!==r,p=h?t.state:this.currentQueryInitialState,g=h?this.currentResult:this.previousQueryResult,{state:b}=t;let{dataUpdatedAt:w,error:P,errorUpdatedAt:I,fetchStatus:A,status:O}=b,M=!1,R=!1,N;if(n._optimisticResults){const H=this.hasListeners(),te=!H&&AT(t,n),Y=H&&OT(t,r,n,i);(te||Y)&&(A=l1(t.options.networkMode)?"fetching":"paused",w||(O="loading")),n._optimisticResults==="isRestoring"&&(A="idle")}if(n.keepPreviousData&&!b.dataUpdatedAt&&g!=null&&g.isSuccess&&O!=="error")N=g.data,w=g.dataUpdatedAt,O=g.status,M=!0;else if(n.select&&typeof b.data<"u")if(l&&b.data===(c==null?void 0:c.data)&&n.select===this.selectFn)N=this.selectResult;else try{this.selectFn=n.select,N=n.select(b.data),N=gw(l==null?void 0:l.data,N,n),this.selectResult=N,this.selectError=null}catch(H){this.selectError=H}else N=b.data;if(typeof n.placeholderData<"u"&&typeof N>"u"&&O==="loading"){let H;if(l!=null&&l.isPlaceholderData&&n.placeholderData===(o==null?void 0:o.placeholderData))H=l.data;else if(H=typeof n.placeholderData=="function"?n.placeholderData():n.placeholderData,n.select&&typeof H<"u")try{H=n.select(H),this.selectError=null}catch(te){this.selectError=te}typeof H<"u"&&(O="success",N=gw(l==null?void 0:l.data,H,n),R=!0)}this.selectError&&(P=this.selectError,N=this.selectResult,I=Date.now(),O="error");const z=A==="fetching",B=O==="loading",U=O==="error";return{status:O,fetchStatus:A,isLoading:B,isSuccess:O==="success",isError:U,isInitialLoading:B&&z,data:N,dataUpdatedAt:w,error:P,errorUpdatedAt:I,failureCount:b.fetchFailureCount,failureReason:b.fetchFailureReason,errorUpdateCount:b.errorUpdateCount,isFetched:b.dataUpdateCount>0||b.errorUpdateCount>0,isFetchedAfterMount:b.dataUpdateCount>p.dataUpdateCount||b.errorUpdateCount>p.errorUpdateCount,isFetching:z,isRefetching:z&&!B,isLoadingError:U&&b.dataUpdatedAt===0,isPaused:A==="paused",isPlaceholderData:R,isPreviousData:M,isRefetchError:U&&b.dataUpdatedAt!==0,isStale:q4(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,mw(r,n))return;this.currentResult=r;const i={cache:!0},l=()=>{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(h=>{const p=h;return this.currentResult[p]!==n[p]&&o.has(p)})};(t==null?void 0:t.listeners)!==!1&&l()&&(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"&&!Ng(t.error)&&(n.onError=!0),this.updateResult(n),this.hasListeners()&&this.updateTimers()}notify(t){ai.batch(()=>{if(t.onSuccess){var n,r,i,l;(n=(r=this.options).onSuccess)==null||n.call(r,this.currentResult.data),(i=(l=this.options).onSettled)==null||i.call(l,this.currentResult.data,null)}else if(t.onError){var c,o,h,p;(c=(o=this.options).onError)==null||c.call(o,this.currentResult.error),(h=(p=this.options).onSettled)==null||h.call(p,void 0,this.currentResult.error)}t.listeners&&this.listeners.forEach(g=>{g(this.currentResult)}),t.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function Zue(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function AT(e,t){return Zue(e,t)||e.state.dataUpdatedAt>0&&yw(e,t,t.refetchOnMount)}function yw(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&q4(e,t)}return!1}function OT(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&q4(e,n)}function q4(e,t){return e.isStaleByTime(t.staleTime)}class Xue extends bf{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),mw(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:UN(),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,l;(n=(r=this.mutateOptions).onSuccess)==null||n.call(r,this.currentResult.data,this.currentResult.variables,this.currentResult.context),(i=(l=this.mutateOptions).onSettled)==null||i.call(l,this.currentResult.data,null,this.currentResult.variables,this.currentResult.context)}else if(t.onError){var c,o,h,p;(c=(o=this.mutateOptions).onError)==null||c.call(o,this.currentResult.error,this.currentResult.variables,this.currentResult.context),(h=(p=this.mutateOptions).onSettled)==null||h.call(p,void 0,this.currentResult.error,this.currentResult.variables,this.currentResult.context)}}t.listeners&&this.listeners.forEach(g=>{g(this.currentResult)})})}}const jN=c0.exports.useSyncExternalStore,NT=C.exports.createContext(void 0),KN=C.exports.createContext(!1);function HN(e,t){return e||(t&&typeof window<"u"?(window.ReactQueryClientContext||(window.ReactQueryClientContext=NT),window.ReactQueryClientContext):NT)}const hm=({context:e}={})=>{const t=C.exports.useContext(HN(e,C.exports.useContext(KN)));if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Yue=({client:e,children:t,context:n,contextSharing:r=!1})=>{C.exports.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]);const i=HN(n,r);return E(KN.Provider,{value:!n&&r,children:E(i.Provider,{value:e,children:t})})},WN=C.exports.createContext(!1),Que=()=>C.exports.useContext(WN);WN.Provider;function Jue(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const ece=C.exports.createContext(Jue()),tce=()=>C.exports.useContext(ece);function GN(e,t){return typeof e=="function"?e(...t):!!e}const nce=(e,t)=>{(e.suspense||e.useErrorBoundary)&&(t.isReset()||(e.retryOnMount=!1))},rce=e=>{C.exports.useEffect(()=>{e.clearReset()},[e])},ice=({result:e,errorResetBoundary:t,useErrorBoundary:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&GN(n,[e.error,r]),oce=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},ace=(e,t)=>e.isLoading&&e.isFetching&&!t,sce=(e,t,n)=>(e==null?void 0:e.suspense)&&ace(t,n),lce=(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 uce(e,t){const n=hm({context:e.context}),r=Que(),i=tce(),l=n.defaultQueryOptions(e);l._optimisticResults=r?"isRestoring":"optimistic",l.onError&&(l.onError=ai.batchCalls(l.onError)),l.onSuccess&&(l.onSuccess=ai.batchCalls(l.onSuccess)),l.onSettled&&(l.onSettled=ai.batchCalls(l.onSettled)),oce(l),nce(l,i),rce(i);const[c]=C.exports.useState(()=>new t(n,l)),o=c.getOptimisticResult(l);if(jN(C.exports.useCallback(h=>r?()=>{}:c.subscribe(ai.batchCalls(h)),[c,r]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),C.exports.useEffect(()=>{c.setOptions(l,{listeners:!1})},[l,c]),sce(l,o,r))throw lce(l,c,i);if(ice({result:o,errorResetBoundary:i,useErrorBoundary:l.useErrorBoundary,query:c.getCurrentQuery()}))throw o.error;return l.notifyOnChangeProps?o:c.trackResult(o)}function Sa(e,t,n){const r=Vh(e,t,n);return uce(r,que)}function cce(e,t,n){const r=Nue(e,t,n),i=hm({context:r.context}),[l]=C.exports.useState(()=>new Xue(i,r));C.exports.useEffect(()=>{l.setOptions(r)},[l,r]);const c=jN(C.exports.useCallback(h=>l.subscribe(ai.batchCalls(h)),[l]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),o=C.exports.useCallback((h,p)=>{l.mutate(h,p).catch(dce)},[l]);if(c.error&&GN(l.options.useErrorBoundary,[c.error]))throw c.error;return{...c,mutate:o,mutateAsync:c.mutate}}function dce(){}const mr={initial:"initial","initial-match":"initial-match-points","initial-unmatch":"initial-unmatch-points",approve:"approve-points",working:"working-points",cancelled:"cancelled-points",atd:"atd"},Fr={initial:"\u041A \u0440\u0430\u0441\u0441\u043C\u043E\u0442\u0440\u0435\u043D\u0438\u044E",approve:"\u0421\u043E\u0433\u043B\u0430\u0441\u043E\u0432\u0430\u043D\u0438\u0435-\u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0430",working:"\u0420\u0430\u0431\u043E\u0442\u0430\u0435\u0442"},qN={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"},fce="\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",Yr={INITIAL:"INITIAL",APPROVE_WORKING:"APPROVE_WORKING",WORKING:"WORKING"},hce={[Yr.INITIAL]:[Fr.initial],[Yr.APPROVE_WORKING]:[Fr.approve,Fr.working],[Yr.WORKING]:[Fr.working]},pce={[Yr.INITIAL]:{visible:[mr.initial],invisible:[mr.approve,mr.working]},[Yr.APPROVE_WORKING]:{visible:[mr.approve,mr.working],invisible:[mr.initial]},[Yr.WORKING]:{visible:[mr.working],invisible:[mr.initial,mr.approve]}},DT=e=>{let t;const n=new Set,r=(h,p)=>{const g=typeof h=="function"?h(t):h;if(!Object.is(g,t)){const b=t;t=(p!=null?p:typeof g!="object")?g:Object.assign({},t,g),n.forEach(w=>w(t,b))}},i=()=>t,o={setState:r,getState:i,subscribe:h=>(n.add(h),()=>n.delete(h)),destroy:()=>{var h;((h={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0})==null?void 0:h.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},mce=e=>e?DT(e):DT;var ZN={exports:{}},XN={};/** * @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 u1=C.exports,vce=c0.exports;function gce(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var yce=typeof Object.is=="function"?Object.is:gce,xce=vce.useSyncExternalStore,_ce=u1.useRef,bce=u1.useEffect,wce=u1.useMemo,Cce=u1.useDebugValue;XN.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var l=_ce(null);if(l.current===null){var c={hasValue:!1,value:null};l.current=c}else c=l.current;l=wce(function(){function h(P){if(!p){if(p=!0,g=P,P=r(P),i!==void 0&&c.hasValue){var I=c.value;if(i(I,P))return b=I}return b=P}if(I=b,yce(g,P))return I;var A=r(P);return i!==void 0&&i(I,A)?I:(g=P,b=A)}var p=!1,g,b,w=n===void 0?null:n;return[function(){return h(t())},w===null?void 0:function(){return h(w())}]},[t,n,r,i]);var o=xce(e,l[0],l[1]);return bce(function(){c.hasValue=!0,c.value=o},[o]),Cce(o),o};(function(e){e.exports=XN})(ZN);const Sce=Iw(ZN.exports),{useSyncExternalStoreWithSelector:Ece}=Sce;function kce(e,t=e.getState,n){const r=Ece(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return C.exports.useDebugValue(r),r}const LT=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"?mce(e):e,r=(i,l)=>kce(n,i,l);return Object.assign(r,n),r},mu=e=>e?LT(e):LT;function ga(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:Z4(e)?2:X4(e)?3:0}function xw(e,t){return wf(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Tce(e,t){return wf(e)===2?e.get(t):e[t]}function YN(e,t,n){var r=wf(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function Pce(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function Z4(e){return Nce&&e instanceof Map}function X4(e){return Dce&&e instanceof Set}function Fi(e){return e.o||e.t}function Y4(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=zce(e);delete t[_r];for(var n=t3(t),r=0;r1&&(e.set=e.add=e.clear=e.delete=Ice),Object.freeze(e),t&&ef(e,function(n,r){return Q4(r,!0)},!0)),e}function Ice(){ga(2)}function J4(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function ps(e){var t=bw[e];return t||ga(18,e),t}function Mce(e,t){bw[e]||(bw[e]=t)}function Fy(){return zp}function U_(e,t){t&&(ps("Patches"),e.u=[],e.s=[],e.v=t)}function $y(e){_w(e),e.p.forEach(Rce),e.p=null}function _w(e){e===zp&&(zp=e.l)}function zT(e){return zp={p:[],l:zp,h:e,m:!0,_:0}}function Rce(e){var t=e[_r];t.i===0||t.i===1?t.j():t.O=!0}function j_(e,t){t._=t.p.length;var n=t.p[0],r=e!==void 0&&e!==n;return t.h.g||ps("ES5").S(t,e,r),r?(n[_r].P&&($y(t),ga(4)),nl(e)&&(e=By(t,e),t.l||Vy(t,e)),t.u&&ps("Patches").M(n[_r].t,e,t.u,t.s)):e=By(t,n,[]),$y(t),t.u&&t.v(t.u,t.s),e!==QN?e:void 0}function By(e,t,n){if(J4(t))return t;var r=t[_r];if(!r)return ef(t,function(o,h){return FT(e,r,t,o,h,n)},!0),t;if(r.A!==e)return t;if(!r.P)return Vy(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var i=r.i===4||r.i===5?r.o=Y4(r.k):r.o,l=i,c=!1;r.i===3&&(l=new Set(i),i.clear(),c=!0),ef(l,function(o,h){return FT(e,r,i,o,h,n,c)}),Vy(e,i,!1),n&&e.u&&ps("Patches").N(r,n,e.u,e.s)}return r.o}function FT(e,t,n,r,i,l,c){if(Jd(i)){var o=By(e,i,l&&t&&t.i!==3&&!xw(t.R,r)?l.concat(r):void 0);if(YN(n,r,o),!Jd(o))return;e.m=!1}else c&&n.add(i);if(nl(i)&&!J4(i)){if(!e.h.D&&e._<1)return;By(e,i),t&&t.A.l||Vy(e,i)}}function Vy(e,t,n){n===void 0&&(n=!1),!e.l&&e.h.D&&e.m&&Q4(t,n)}function K_(e,t){var n=e[_r];return(n?Fi(n):e)[t]}function $T(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 Bs(e){e.P||(e.P=!0,e.l&&Bs(e.l))}function H_(e){e.o||(e.o=Y4(e.t))}function Lp(e,t,n){var r=Z4(t)?ps("MapSet").F(t,n):X4(t)?ps("MapSet").T(t,n):e.g?function(i,l){var c=Array.isArray(i),o={i:c?1:0,A:l?l.A:Fy(),P:!1,I:!1,R:{},l,t:i,k:null,o:null,j:null,C:!1},h=o,p=ww;c&&(h=[o],p=Uh);var g=Proxy.revocable(h,p),b=g.revoke,w=g.proxy;return o.k=w,o.j=b,w}(t,n):ps("ES5").J(t,n);return(n?n.A:Fy()).p.push(r),r}function Ace(e){return Jd(e)||ga(22,e),function t(n){if(!nl(n))return n;var r,i=n[_r],l=wf(n);if(i){if(!i.P&&(i.i<4||!ps("ES5").K(i)))return i.t;i.I=!0,r=BT(n,l),i.I=!1}else r=BT(n,l);return ef(r,function(c,o){i&&Tce(i.t,c)===o||YN(r,c,t(o))}),l===3?new Set(r):r}(e)}function BT(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return Y4(e)}function Oce(){function e(o,h){function p(){this.constructor=o}i(o,h),o.prototype=(p.prototype=h.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(h){if(nl(h)){var p=Lp(o.A.h,h,o);o.p.set(h,p),o.o.add(p)}else o.o.add(h)}))}function r(o){o.O&&ga(3,JSON.stringify(Fi(o)))}var i=function(o,h){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,g){p.__proto__=g}||function(p,g){for(var b in g)g.hasOwnProperty(b)&&(p[b]=g[b])})(o,h)},l=function(){function o(p,g){return this[_r]={i:2,l:g,A:g?g.A:Fy(),P:!1,I:!1,o:void 0,R:void 0,t:p,k:this,C:!1,O:!1},this}e(o,Map);var h=o.prototype;return Object.defineProperty(h,"size",{get:function(){return Fi(this[_r]).size}}),h.has=function(p){return Fi(this[_r]).has(p)},h.set=function(p,g){var b=this[_r];return r(b),Fi(b).has(p)&&Fi(b).get(p)===g||(t(b),Bs(b),b.R.set(p,!0),b.o.set(p,g),b.R.set(p,!0)),this},h.delete=function(p){if(!this.has(p))return!1;var g=this[_r];return r(g),t(g),Bs(g),g.t.has(p)?g.R.set(p,!1):g.R.delete(p),g.o.delete(p),!0},h.clear=function(){var p=this[_r];r(p),Fi(p).size&&(t(p),Bs(p),p.R=new Map,ef(p.t,function(g){p.R.set(g,!1)}),p.o.clear())},h.forEach=function(p,g){var b=this;Fi(this[_r]).forEach(function(w,P){p.call(g,b.get(P),P,b)})},h.get=function(p){var g=this[_r];r(g);var b=Fi(g).get(p);if(g.I||!nl(b)||b!==g.t.get(p))return b;var w=Lp(g.A.h,b,g);return t(g),g.o.set(p,w),w},h.keys=function(){return Fi(this[_r]).keys()},h.values=function(){var p,g=this,b=this.keys();return(p={})[ag]=function(){return g.values()},p.next=function(){var w=b.next();return w.done?w:{done:!1,value:g.get(w.value)}},p},h.entries=function(){var p,g=this,b=this.keys();return(p={})[ag]=function(){return g.entries()},p.next=function(){var w=b.next();if(w.done)return w;var P=g.get(w.value);return{done:!1,value:[w.value,P]}},p},h[ag]=function(){return this.entries()},o}(),c=function(){function o(p,g){return this[_r]={i:3,l:g,A:g?g.A:Fy(),P:!1,I:!1,o:void 0,t:p,k:this,p:new Map,O:!1,C:!1},this}e(o,Set);var h=o.prototype;return Object.defineProperty(h,"size",{get:function(){return Fi(this[_r]).size}}),h.has=function(p){var g=this[_r];return r(g),g.o?!!g.o.has(p)||!(!g.p.has(p)||!g.o.has(g.p.get(p))):g.t.has(p)},h.add=function(p){var g=this[_r];return r(g),this.has(p)||(n(g),Bs(g),g.o.add(p)),this},h.delete=function(p){if(!this.has(p))return!1;var g=this[_r];return r(g),n(g),Bs(g),g.o.delete(p)||!!g.p.has(p)&&g.o.delete(g.p.get(p))},h.clear=function(){var p=this[_r];r(p),Fi(p).size&&(n(p),Bs(p),p.o.clear())},h.values=function(){var p=this[_r];return r(p),n(p),p.o.values()},h.entries=function(){var p=this[_r];return r(p),n(p),p.o.entries()},h.keys=function(){return this.values()},h[ag]=function(){return this.values()},h.forEach=function(p,g){for(var b=this.values(),w=b.next();!w.done;)p.call(g,w.value,w.value,this),w=b.next()},o}();Mce("MapSet",{F:function(o,h){return new l(o,h)},T:function(o,h){return new c(o,h)}})}var VT,zp,e3=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",Nce=typeof Map<"u",Dce=typeof Set<"u",UT=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",QN=e3?Symbol.for("immer-nothing"):((VT={})["immer-nothing"]=!0,VT),jT=e3?Symbol.for("immer-draftable"):"__$immer_draftable",_r=e3?Symbol.for("immer-state"):"__$immer_state",ag=typeof Symbol<"u"&&Symbol.iterator||"@@iterator",Lce=""+Object.prototype.constructor,t3=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,zce=Object.getOwnPropertyDescriptors||function(e){var t={};return t3(e).forEach(function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)}),t},bw={},ww={get:function(e,t){if(t===_r)return e;var n=Fi(e);if(!xw(n,t))return function(i,l,c){var o,h=$T(l,c);return h?"value"in h?h.value:(o=h.get)===null||o===void 0?void 0:o.call(i.k):void 0}(e,n,t);var r=n[t];return e.I||!nl(r)?r:r===K_(e.t,t)?(H_(e),e.o[t]=Lp(e.A.h,r,e)):r},has:function(e,t){return t in Fi(e)},ownKeys:function(e){return Reflect.ownKeys(Fi(e))},set:function(e,t,n){var r=$T(Fi(e),t);if(r!=null&&r.set)return r.set.call(e.k,n),!0;if(!e.P){var i=K_(Fi(e),t),l=i==null?void 0:i[_r];if(l&&l.t===n)return e.o[t]=n,e.R[t]=!1,!0;if(Pce(n,i)&&(n!==void 0||xw(e.t,t)))return!0;H_(e),Bs(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 K_(e.t,t)!==void 0||t in e.t?(e.R[t]=!1,H_(e),Bs(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=Fi(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty:function(){ga(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){ga(12)}},Uh={};ef(ww,function(e,t){Uh[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Uh.deleteProperty=function(e,t){return Uh.set.call(this,e,t,void 0)},Uh.set=function(e,t,n){return ww.set.call(this,e[0],t,n,e[0])};var Fce=function(){function e(n){var r=this;this.g=UT,this.D=!0,this.produce=function(i,l,c){if(typeof i=="function"&&typeof l!="function"){var o=l;l=i;var h=r;return function(A){var O=this;A===void 0&&(A=o);for(var M=arguments.length,R=Array(M>1?M-1:0),N=1;N1?g-1:0),w=1;w=0;i--){var l=r[i];if(l.path.length===0&&l.op==="replace"){n=l.value;break}}i>-1&&(r=r.slice(i+1));var c=ps("Patches").$;return Jd(n)?c(n,r):this.produce(n,function(o){return c(o,r)})},e}(),Qo=new Fce,$ce=Qo.produce;Qo.produceWithPatches.bind(Qo);Qo.setAutoFreeze.bind(Qo);Qo.setUseProxies.bind(Qo);Qo.applyPatches.bind(Qo);Qo.createDraft.bind(Qo);Qo.finishDraft.bind(Qo);const Bce=e=>(t,n,r)=>(r.setState=(i,l,...c)=>{const o=typeof i=="function"?$ce(i):i;return t(o,l,...c)},e(r.setState,n,r)),vu=Bce,rl={prediction:[0,0],categories:[],region:null,status:[Fr.initial],deltaTraffic:[-1e3,1e3],factTraffic:[0,0],age:[0,0]},Vce=e=>({filters:rl,setPrediction:t=>{e(n=>{n.filters.prediction=t})},setDeltaTraffic:t=>{e(n=>{n.filters.deltaTraffic=t})},setFactTraffic:t=>{e(n=>{n.filters.factTraffic=t})},setAge:t=>{e(n=>{n.filters.age=t})},setCategories:t=>e(n=>{n.filters.categories=t}),setRegion:t=>e(n=>{n.filters.region=t}),setStatus:t=>e(n=>{n.filters.status=t})}),Oi=mu(vu(Vce)),Uce={included:new Set([]),excluded:new Set([])},jce=e=>({selection:Uce,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()})}),xs=mu(vu(jce)),Kce=()=>{const{selection:e}=xs();return C.exports.useMemo(()=>e.included.size||e.excluded.size,[e])},Uy="https://postnet-dev.selftech.ru",Jo=Aue.create({baseURL:`${Uy}/`,withCredentials:!0,xsrfHeaderName:"X-CSRFToken",xsrfCookieName:"csrftoken"}),JN=(e,t)=>{const n=e||new URLSearchParams;return t&&(t.type==="ao"&&n.append("ao[]",t.id),t.type==="rayon"&&n.append("rayon[]",t.id)),n},pm=async(e,t)=>{const n=JN(e,t),{data:r}=await Jo.get(`/api/placement_points?${n.toString()}`);return r},n3=async(e,t)=>{const n=JN(e,t),{data:r}=await Jo.get(`/api/placement_points/to_excel?${n.toString()}`,{responseType:"arraybuffer"});return r},Hce=()=>Sa(["all-initial-count"],async()=>{const e=new URLSearchParams({page:1,page_size:1,"status[]":[Fr.initial]});return await pm(e)},{select:e=>e.count}),Wce=()=>{const{filters:e}=Oi(),{prediction:t,categories:n,region:r}=e,{selection:{included:i}}=xs(),l=[...i];return Sa(["filtered-points",e,l],async()=>{const c=new URLSearchParams({page:1,page_size:1,"prediction_current[]":t,"status[]":[Fr.initial],"categories[]":n,"included[]":l});return await pm(c,r)},{select:c=>c.count,keepPreviousData:!0})},e9=uf(!0),c1=uf(!1),r3=W$(c1,"setAuth",(e,t)=>{e.set(t)});async function Gce(){try{await Jo.get("/accounts/profile/"),r3(!0)}catch{console.log("Not authorized")}finally{e9.set(!1)}}Gce();class t9 extends Error{constructor(n){super("");zS(this,"errors");this.name="DjangoValidationError";const r=[];for(const i in n)r.push({name:i,errors:n[i]});this.errors=r}}const Cw=uf(!1),Sw=uf(""),qce="\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 Zce(e){var n,r,i,l;Cw.set(!0),Sw.set("");try{const{data:c}=await Jo.post("accounts/login/",e);return r3(!0),c}catch(c){var t=qce;throw(r=(n=c.response)==null?void 0:n.data)!=null&&r.detail&&(t=(l=(i=c.response)==null?void 0:i.data)==null?void 0:l.detail,Sw.set(t)),new t9(c.response.data)}finally{Cw.set(!1)}}const Ew=uf(!1),n9=uf("");async function Xce(e){var t;Ew.set(!0);try{const{data:n}=await Jo.post("accounts/register/",e);return n}catch(n){throw(t=n.response.data)!=null&&t.non_field_errors&&n9.set(n.response.data.non_field_errors.join(" ")),new t9(n.response.data)}finally{Ew.set(!1)}}function Yce(){const e=ou(Sw),t=ou(Cw),n=r=>{Zce(r)};return Qe(x4,{direction:"vertical",style:{width:"320px"},children:[e.length>0?E(R0,{type:"error",showIcon:!0,closable:!0,description:e}):null,E(z4.Title,{level:4,children:"\u0412\u0445\u043E\u0434"}),Qe(Ba,{disabled:t,name:"basic",layout:"vertical",onFinish:n,autoComplete:"off",children:[E(Ba.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:E(Kl,{prefix:E(pN,{className:"site-form-item-icon"}),placeholder:"\u043B\u043E\u0433\u0438\u043D"})}),E(Ba.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:E(Kl,{prefix:E(uw,{className:"site-form-item-icon"}),type:"password",placeholder:"\u043F\u0430\u0440\u043E\u043B\u044C"})}),E(Ba.Item,{children:E(Br,{block:!0,type:"primary",htmlType:"submit",children:"\u0412\u043E\u0439\u0442\u0438"})}),E("div",{style:{textAlign:"center"},children:E(Gb,{to:"/register",children:"\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044F"})})]})]})}function Qce(){return ou(c1)?E(u0,{to:"/",replace:!0}):E("main",{className:"w-screen h-screen flex items-center justify-center",children:E(Yce,{})})}const Jce=e=>{const t=C.exports.useRef(e),n=C.exports.useRef(),r=C.exports.useRef(!1),i=C.exports.useRef(!1),[,l]=C.exports.useState(0);r.current&&(i.current=!0),C.exports.useEffect(()=>(r.current||(n.current=t.current(),r.current=!0),l(c=>c+1),()=>{!i.current||n.current&&n.current()}),[])};function ede(){const[e]=j$(),[t,n]=C.exports.useState(!1);return Jce(()=>{async function r(){try{await Jo.post("accounts/verify-registration/",{user_id:e.get("user_id"),timestamp:e.get("timestamp"),signature:e.get("signature")})}finally{n(!0)}}r()}),t?E(u0,{to:"/"}):E("div",{children:"Verifying..."})}function tde(e){var t=typeof e;return t==="function"||t==="object"&&!!e}function nde(){const[e]=Ba.useForm(),[t,n]=C.exports.useState(""),r=ou(n9),i=ou(Ew),l=c=>{Xce(c).then(()=>{n(`\u041F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C \u0443\u0441\u043F\u0435\u0448\u043D\u043E \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043E\u0432\u0430\u043D. \u041F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 \u043F\u043E\u0447\u0442\u0443 ${c.email} \u0434\u043B\u044F \u0430\u043A\u0442\u0438\u0432\u0430\u0446\u0438\u0438 \u0430\u043A\u043A\u0430\u0443\u043D\u0442\u0430.`)}).catch(o=>{tde(o.errors)&&e.setFields(o.errors)})};return t?E(uQ,{title:t,status:"success",extra:E(Gb,{to:"/",children:"\u041D\u0430 \u0433\u043B\u0430\u0432\u043D\u0443\u044E"})}):Qe(x4,{direction:"vertical",style:{width:"320px"},children:[r.length>0?E(R0,{type:"error",showIcon:!0,closable:!0,description:r}):null,E(z4.Title,{level:4,children:"\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044F"}),Qe(Ba,{form:e,disabled:i,name:"basic",layout:"vertical",onFinish:l,children:[E(Ba.Item,{name:"username",label:"\u041B\u043E\u0433\u0438\u043D",rules:[{required:!0,message:"\u041E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u043E\u0435 \u043F\u043E\u043B\u0435"}],children:E(Kl,{prefix:E(pN,{className:"site-form-item-icon"}),placeholder:""})}),E(Ba.Item,{name:"email",label:"Email",rules:[{required:!0,type:"email",message:"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043A\u043E\u0440\u0440\u0435\u043A\u0442\u043D\u044B\u0439 email"}],children:E(Kl,{type:"email",autoComplete:"email",prefix:E(vle,{className:"site-form-item-icon"}),placeholder:""})}),E(Ba.Item,{name:"password",label:"\u041F\u0430\u0440\u043E\u043B\u044C",rules:[{required:!0,message:"\u041E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u043E\u0435 \u043F\u043E\u043B\u0435"}],children:E(Kl,{prefix:E(uw,{className:"site-form-item-icon"}),type:"password",autoComplete:"new-password",placeholder:""})}),E(Ba.Item,{name:"password_confirm",label:"\u041F\u0430\u0440\u043E\u043B\u044C \u0435\u0449\u0435 \u0440\u0430\u0437",rules:[{required:!0,message:"\u041E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u043E\u0435 \u043F\u043E\u043B\u0435"},({getFieldValue:c})=>({validator(o,h){return!h||c("password")===h?Promise.resolve():Promise.reject(new Error("\u041F\u0430\u0440\u043E\u043B\u0438 \u043D\u0435 \u0441\u043E\u0432\u043F\u0430\u0434\u0430\u044E\u0442"))}})],children:E(Kl,{autoComplete:"re-password",prefix:E(uw,{className:"site-form-item-icon"}),type:"password",placeholder:""})}),E(Ba.Item,{children:E(Br,{block:!0,type:"primary",htmlType:"submit",children:"\u0417\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043E\u0432\u0430\u0442\u044C\u0441\u044F"})}),E("div",{style:{textAlign:"center"},children:E(Gb,{to:"/",children:"\u0423\u0436\u0435 \u0435\u0441\u0442\u044C \u0430\u043A\u043A\u0430\u0443\u043D\u0442"})})]})]})}function rde(){return ou(c1)?E(u0,{to:"/",replace:!0}):E("main",{className:"h-screen w-screen flex items-center justify-center",children:E(nde,{})})}function ide(e){const t=ou(c1);return ou(e9)?E(P4,{className:"user-info-loader"}):t?E($n,{children:e.children}):E(u0,{to:"/signin",replace:!0})}var r9={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Us,function(){var n,r,i;function l(o,h){if(!n)n=h;else if(!r)r=h;else{var p="var sharedChunk = {}; ("+n+")(sharedChunk); ("+r+")(sharedChunk);",g={};n(g),i=h(g),typeof window<"u"&&(i.workerUrl=window.URL.createObjectURL(new Blob([p],{type:"text/javascript"})))}}l(["exports"],function(o){var h=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 g(u,a,d,m){const x=new h(u,a,d,m);return function(S){return x.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 x=this.sampleCurveX(d)-u;if(Math.abs(x)x?T=d:L=d,d=.5*(L-T)+T;return d},solve:function(u,a){return this.sampleCurveY(this.solveCurveX(u,a))}};const b=g(.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,x=((u-a)%m+m)%m+a;return x===a?d:x}function I(u,...a){for(const d of a)for(const m in d)u[m]=d[m];return u}let A=1;function O(u,a){u.forEach(d=>{a[d]&&(a[d]=a[d].bind(a))})}function M(u,a,d){const m={};for(const x in u)m[x]=a.call(d||this,u[x],x,u);return m}function R(u,a,d){const m={};for(const x in u)a.call(d||this,u[x],x,u)&&(m[x]=u[x]);return m}function N(u){return Array.isArray(u)?u.map(N):typeof u=="object"&&u?M(u,N):u}const z={};function B(u){z[u]||(typeof console<"u"&&console.warn(u),z[u]=!0)}function U(u,a,d){return(d.y-u.y)*(a.x-u.x)>(a.y-u.y)*(d.x-u.x)}function q(u){let a=0;for(let d,m,x=0,S=u.length,T=S-1;x@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(d,m,x,S)=>{const T=x||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,le,J=null;function Z(u){if(J==null){const a=u.navigator?u.navigator.userAgent:null;J=!!u.safari||!(!a||!(/\b(iPad|iPhone|iPod)\b/.test(a)||a.match("Safari")&&!a.match("Chrome")))}return J}function Q(u){return typeof ImageBitmap<"u"&&u instanceof ImageBitmap}const ge={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&&(le==null&&(le=matchMedia("(prefers-reduced-motion: reduce)")),le.matches)}};var re=de;function de(u,a){this.x=u,this.y=a}de.prototype={clone:function(){return new de(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),x=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=x,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},de.convert=function(u){return u instanceof de?u:Array.isArray(u)?new de(u[0],u[1]):u};const oe={MAX_PARALLEL_IMAGE_REQUESTS:16,REGISTERED_PROTOCOLS:{}},ye="mapbox-tiles";let Re,Te,ke=500,De=50;function Me(){typeof caches>"u"||Re||(Re=caches.open(ye))}let Ne=1/0;const Le={supported:!1,testSupport:function(u){!Ue&&qe&&(ct?pt(u):Ve=u)}};let Ve,qe,Ue=!1,ct=!1;function pt(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,qe),u.isContextLost())return;Le.supported=!0}catch{}u.deleteTexture(a),Ue=!0}typeof document<"u"&&(qe=document.createElement("img"),qe.onload=function(){Ve&&pt(Ve),Ve=null,ct=!0},qe.onerror=function(){Ue=!0,Ve=null},qe.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const Tt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(Tt);class Xe extends Error{constructor(a,d,m,x){super(`AJAXError: ${d} (${a}): ${m}`),this.status=a,this.statusText=d,this.url=m,this.body=x}}const Pt=H()?()=>self.worker&&self.worker.referrer:()=>(window.location.protocol==="blob:"?window.parent:window).location.href;function mt(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 x=!1,S=!1;return u.type==="json"&&m.headers.set("Accept","application/json"),((T,L,F)=>{if(S)return;const j=Date.now();fetch(m).then(X=>X.ok?((ne,ue,he)=>{(u.type==="arrayBuffer"?ne.arrayBuffer():u.type==="json"?ne.json():ne.text()).then(pe=>{S||(ue&&he&&function(Ae,Ie,Ze){if(Me(),!Re)return;const st={status:Ie.status,statusText:Ie.statusText,headers:new Headers};Ie.headers.forEach((rt,kt)=>st.headers.set(kt,rt));const Ke=te(Ie.headers.get("Cache-Control")||"");Ke["no-store"]||(Ke["max-age"]&&st.headers.set("Expires",new Date(Ze+1e3*Ke["max-age"]).toUTCString()),new Date(st.headers.get("Expires")).getTime()-Ze<42e4||function(rt,kt){if(Te===void 0)try{new Response(new ReadableStream),Te=!0}catch{Te=!1}Te?kt(rt.body):rt.blob().then(kt)}(Ie,rt=>{const kt=new Response(rt,st);Me(),Re&&Re.then(St=>St.put(function(un){const pn=un.indexOf("?");return pn<0?un:un.slice(0,pn)}(Ae.url),kt)).catch(St=>B(St.message))}))}(m,ue,he),x=!0,a(null,pe,ne.headers.get("Cache-Control"),ne.headers.get("Expires")))}).catch(pe=>{S||a(new Error(pe.message))})})(X,null,j):X.blob().then(ne=>a(new Xe(X.status,X.statusText,u.url,ne)))).catch(X=>{X.code!==20&&a(new Error(X.message))})})(),{cancel:()=>{S=!0,x||d.abort()}}}const Mt=function(u,a){if(/:\/\//.test(u.url)&&!/^https?:|^file:/.test(u.url)){if(H()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",u,a);if(!H()){const m=u.url.substring(0,u.url.indexOf("://"));return(oe.REGISTERED_PROTOCOLS[m]||mt)(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 mt(u,a);if(H()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",u,a,void 0,!0)}var d;return function(m,x){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=()=>{x(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 x(L)}x(null,T,S.getResponseHeader("Cache-Control"),S.getResponseHeader("Expires"))}else{const T=new Blob([S.response],{type:S.getResponseHeader("Content-Type")});x(new Xe(S.status,S.statusText,m.url,T))}},S.send(m.body),{cancel:()=>S.abort()}}(u,a)},Ct=function(u,a){return Mt(I(u,{type:"arrayBuffer"}),a)};function Lt(u){const a=window.document.createElement("a");return a.href=u,a.protocol===window.document.location.protocol&&a.host===window.document.location.host}const lt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let dt,ut;dt=[],ut=0;const it=function(u,a){if(Le.supported&&(u.headers||(u.headers={}),u.headers.accept="image/webp,*/*"),ut>=oe.MAX_PARALLEL_IMAGE_REQUESTS){const S={requestParameters:u,callback:a,cancelled:!1,cancel(){this.cancelled=!0}};return dt.push(S),S}ut++;let d=!1;const m=()=>{if(!d)for(d=!0,ut--;dt.length&&ut{m(),S?a(S):T&&function(j,X){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.`))})}(j,X):function(ne,ue){const he=new Image;he.onload=()=>{ue(null,he),URL.revokeObjectURL(he.src),he.onload=null,window.requestAnimationFrame(()=>{he.src=lt})},he.onerror=()=>ue(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const pe=new Blob([new Uint8Array(ne)],{type:"image/png"});he.src=ne.byteLength?URL.createObjectURL(pe):lt}(j,X)}(T,(j,X)=>{j!=null?a(j):X!=null&&a(null,X,{cacheControl:L,expires:F})})});return{cancel:()=>{x.cancel(),m()}}};function ft(u,a,d){d[u]&&d[u].indexOf(a)!==-1||(d[u]=d[u]||[],d[u].push(a))}function xt(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={}){I(this,d),this.type=a}}class Ut extends Wt{constructor(a,d={}){super("error",I({error:a},d))}}class Qt{on(a,d){return this._listeners=this._listeners||{},ft(a,d,this._listeners),this}off(a,d){return xt(a,d,this._listeners),xt(a,d,this._oneTimeListeners),this}once(a,d){return this._oneTimeListeners=this._oneTimeListeners||{},ft(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 x=this._listeners&&this._listeners[m]?this._listeners[m].slice():[];for(const L of x)L.call(this,a);const S=this._oneTimeListeners&&this._oneTimeListeners[m]?this._oneTimeListeners[m].slice():[];for(const L of S)xt(m,L,this._oneTimeListeners),L.call(this,a);const T=this._eventedParent;T&&(I(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,x){this.message=(a?`${a}: `:"")+m,x&&(this.identifier=x),d!=null&&d.__line__&&(this.line=d.__line__)}}function Xt(u){const a=u.value;return a?[new Ge(u.key,a,"constants have been deprecated as of v8")]:[]}function dn(u,...a){for(const d of a)for(const m in d)u[m]=d[m];return u}function Vt(u){return u instanceof Number||u instanceof String||u instanceof Boolean?u.valueOf():u}function jt(u){if(Array.isArray(u))return u.map(jt);if(u instanceof Object&&!(u instanceof Number||u instanceof String||u instanceof Boolean)){const a={};for(const d in u)a[d]=jt(u[d]);return a}return Vt(u)}class nn extends Error{constructor(a,d){super(d),this.message=d,this.key=a}}class _n{constructor(a,d=[]){this.parent=a,this.bindings={};for(const[m,x]of d)this.bindings[m]=x}concat(a){return new _n(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 An={kind:"null"},_t={kind:"number"},Gt={kind:"string"},an={kind:"boolean"},Fn={kind:"color"},kn={kind:"object"},zt={kind:"value"},Tn={kind:"collator"},Cn={kind:"formatted"},hn={kind:"padding"},Nt={kind:"resolvedImage"};function ot(u,a){return{kind:"array",itemType:u,N:a}}function ht(u){if(u.kind==="array"){const a=ht(u.itemType);return typeof u.N=="number"?`array<${a}, ${u.N}>`:u.itemType.kind==="value"?"array":`array<${a}>`}return u.kind}const At=[An,_t,Gt,an,Fn,Cn,kn,ot(zt),hn,Nt];function $t(u,a){if(a.kind==="error")return null;if(u.kind==="array"){if(a.kind==="array"&&(a.N===0&&a.itemType.kind==="value"||!$t(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 At)if(!$t(d,a))return null}}return`Expected ${ht(u)} but found ${ht(a)} instead.`}function cn(u,a){return a.some(d=>d.kind===u.kind)}function Mn(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 Gn,qn={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 K(u){return me(u[u.length-1]==="%"?parseFloat(u)/100*255:parseInt(u))}function G(u){return(a=u[u.length-1]==="%"?parseFloat(u)/100:parseFloat(u))<0?0:a>1?1:a;var a}function ce(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{Gn={}.parseCSSColor=function(u){var a,d=u.replace(/ /g,"").toLowerCase();if(d in qn)return qn[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("("),x=d.indexOf(")");if(m!==-1&&x+1===d.length){var S=d.substr(0,m),T=d.substr(m+1,x-(m+1)).split(","),L=1;switch(S){case"rgba":if(T.length!==4)return null;L=G(T.pop());case"rgb":return T.length!==3?null:[K(T[0]),K(T[1]),K(T[2]),L];case"hsla":if(T.length!==4)return null;L=G(T.pop());case"hsl":if(T.length!==3)return null;var F=(parseFloat(T[0])%360+360)%360/360,j=G(T[1]),X=G(T[2]),ne=X<=.5?X*(j+1):X+j-X*j,ue=2*X-ne;return[me(255*ce(ue,ne,F+1/3)),me(255*ce(ue,ne,F)),me(255*ce(ue,ne,F-1/3)),L];default:return null}}return null}}catch{}class ae{constructor(a,d,m,x=1){this.r=a,this.g=d,this.b=m,this.a=x}static parse(a){if(!a)return;if(a instanceof ae)return a;if(typeof a!="string")return;const d=Gn(a);return d?new ae(d[0]/255*d[3],d[1]/255*d[3],d[2]/255*d[3],d[3]):void 0}toString(){const[a,d,m,x]=this.toArray();return`rgba(${Math.round(a)},${Math.round(d)},${Math.round(m)},${x})`}toArray(){const{r:a,g:d,b:m,a:x}=this;return x===0?[0,0,0,0]:[255*a/x,255*d/x,255*m/x,x]}}ae.black=new ae(0,0,0,1),ae.white=new ae(1,1,1,1),ae.transparent=new ae(0,0,0,0),ae.red=new ae(1,0,0,1);class xe{constructor(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,x,S){this.text=a,this.image=d,this.scale=m,this.fontStack=x,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 Oe{constructor(a){this.name=a.name,this.available=a.available}toString(){return this.name}static fromString(a){return a?new Oe({name:a,available:!1}):null}}function He(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 We(u){if(u===null||typeof u=="string"||typeof u=="boolean"||typeof u=="number"||u instanceof ae||u instanceof xe||u instanceof be||u instanceof Ce||u instanceof Oe)return!0;if(Array.isArray(u)){for(const a of u)if(!We(a))return!1;return!0}if(typeof u=="object"){for(const a in u)if(!We(u[a]))return!1;return!0}return!1}function Be(u){if(u===null)return An;if(typeof u=="string")return Gt;if(typeof u=="boolean")return an;if(typeof u=="number")return _t;if(u instanceof ae)return Fn;if(u instanceof xe)return Tn;if(u instanceof be)return Cn;if(u instanceof Ce)return hn;if(u instanceof Oe)return Nt;if(Array.isArray(u)){const a=u.length;let d;for(const m of u){const x=Be(m);if(d){if(d===x)continue;d=zt;break}d=x}return ot(d||zt,a)}return kn}function Ot(u){const a=typeof u;return u===null?"":a==="string"||a==="number"||a==="boolean"?String(u):u instanceof ae||u instanceof be||u instanceof Ce||u instanceof Oe?u.toString():JSON.stringify(u)}class bt{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(!We(a[1]))return d.error("invalid value");const m=a[1];let x=Be(m);const S=d.expectedType;return x.kind!=="array"||x.N!==0||!S||S.kind!=="array"||typeof S.N=="number"&&S.N!==0||(x=S),new bt(x,m)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class Je{constructor(a){this.name="ExpressionEvaluationError",this.message=a}toJSON(){return this.message}}const Rt={string:Gt,number:_t,boolean:an,object:kn};class Bt{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,x=1;const S=a[0];if(S==="array"){let L,F;if(a.length>2){const j=a[1];if(typeof j!="string"||!(j in Rt)||j==="object")return d.error('The item type argument of "array" must be one of string, number, boolean',1);L=Rt[j],x++}else L=zt;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],x++}m=ot(L,F)}else{if(!Rt[S])throw new Error(`Types doesn't contain name = ${S}`);m=Rt[S]}const T=[];for(;xa.outputDefined())}}const gn={"to-boolean":an,"to-color":Fn,"to-number":_t,"to-string":Gt};class on{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(!gn[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 x=gn[m],S=[];for(let T=1;T4?`Invalid rbga value ${JSON.stringify(d)}: expected an array containing either three or four numeric values.`:He(d[0],d[1],d[2],d[3]),!m))return new ae(d[0]/255,d[1]/255,d[2]/255,d[3])}throw new Je(m||`Could not parse color from value '${typeof d=="string"?d:JSON.stringify(d)}'`)}if(this.type.kind==="padding"){let d;for(const m of this.args){d=m.evaluate(a);const x=Ce.parse(d);if(x)return x}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 x=Number(d);if(!isNaN(x))return x}throw new Je(`Could not convert ${JSON.stringify(d)} to number.`)}return this.type.kind==="formatted"?be.fromString(Ot(this.args[0].evaluate(a))):this.type.kind==="resolvedImage"?Oe.fromString(Ot(this.args[0].evaluate(a))):Ot(this.args[0].evaluate(a))}eachChild(a){this.args.forEach(a)}outputDefined(){return this.args.every(a=>a.outputDefined())}}const yn=["Unknown","Point","LineString","Polygon"];class Bn{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"?yn[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]=ae.parse(a)),d}}class Jn{constructor(a,d,m,x){this.name=a,this.type=d,this._evaluate=m,this.args=x}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],x=Jn.definitions[m];if(!x)return d.error(`Unknown expression "${m}". If you wanted a literal array, use ["literal", [...]].`,0);const S=Array.isArray(x)?x[0]:x.type,T=Array.isArray(x)?[[x[1],x[2]]]:x.overloads,L=T.filter(([j])=>!Array.isArray(j)||j.length===a.length-1);let F=null;for(const[j,X]of L){F=new Ga(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(ht).join(", ")})`:`(${ht(ue.type)}...)`;var ue}).join(" | "),X=[];for(let ne=1;ne=a[2]||u[1]<=a[1]||u[3]>=a[3])}function Sn(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,x=Math.pow(2,a.z);return[Math.round(d*x*or),Math.round(m*x*or)]}function Rn(u,a,d){const m=u[0]-a[0],x=u[1]-a[1],S=u[0]-d[0],T=u[1]-d[1];return m*T-S*x==0&&m*S<=0&&x*T<=0}function Wr(u,a){let d=!1;for(let T=0,L=a.length;T(m=u)[1]!=(S=F[j+1])[1]>m[1]&&m[0]<(S[0]-x[0])*(m[1]-x[1])/(S[1]-x[1])+x[0]&&(d=!d)}}var m,x,S;return d}function vr(u,a){for(let d=0;d0&&L<0||T<0&&L>0}function Ln(u,a,d){for(const j of d)for(let X=0;Xd[2]){const x=.5*m;let S=u[0]-d[0]>x?-m:d[0]-u[0]>x?m:0;S===0&&(S=u[0]-d[2]>x?-m:d[2]-u[0]>x?m:0),u[0]+=S}Pr(a,u)}function cl(u,a,d,m){const x=Math.pow(2,m.z)*or,S=[m.x*or,m.y*or],T=[];for(const L of u)for(const F of L){const j=[F.x+S[0],F.y+S[1]];so(j,a,d,x),T.push(j)}return T}function Ac(u,a,d,m){const x=Math.pow(2,m.z)*or,S=[m.x*or,m.y*or],T=[];for(const F of u){const j=[];for(const X of F){const ne=[X.x+S[0],X.y+S[1]];Pr(a,ne),j.push(ne)}T.push(j)}if(a[2]-a[0]<=x/2){(L=a)[0]=L[1]=1/0,L[2]=L[3]=-1/0;for(const F of T)for(const j of F)so(j,a,d,x)}var L;return T}class Ea{constructor(a,d){this.type=an,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(We(a[1])){const m=a[1];if(m.type==="FeatureCollection")for(let x=0;x{a&&!zn(d)&&(a=!1)}),a}function Zn(u){if(u instanceof Jn&&u.name==="feature-state")return!1;let a=!0;return u.eachChild(d=>{a&&!Zn(d)&&(a=!1)}),a}function Ir(u,a){if(u instanceof Jn&&a.indexOf(u.name)>=0)return!1;let d=!0;return u.eachChild(m=>{d&&!Ir(m,a)&&(d=!1)}),d}class ki{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 ki(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 Ga{constructor(a,d=[],m,x=new _n,S=[]){this.registry=a,this.path=d,this.key=d.map(T=>`[${T}]`).join(""),this.scope=x,this.errors=S,this.expectedType=m}parse(a,d,m,x,S={}){return d?this.concat(d,m,x)._parse(a,S):this._parse(a,S)}_parse(a,d){function m(x,S,T){return T==="assert"?new Bt(S,[x]):T==="coerce"?new on(S,[x]):x}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 x=a[0];if(typeof x!="string")return this.error(`Expression name must be a string, but found ${typeof x} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const S=this.registry[x];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 bt)&&T.type.kind!=="resolvedImage"&&Eo(T)){const L=new Bn;try{T=new bt(T.type,T.evaluate(L))}catch(F){return this.error(F.message),null}}return T}return this.error(`Unknown expression "${x}". 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 x=typeof a=="number"?this.path.concat(a):this.path,S=m?this.scope.concat(m):this.scope;return new Ga(this.registry,x,d||null,S,this.errors)}error(a,...d){const m=`${this.key}${d.map(x=>`[${x}]`).join("")}`;this.errors.push(new nn(m,a))}checkSubtype(a,d){const m=$t(a,d);return m&&this.error(m),m}}function Eo(u){if(u instanceof ki)return Eo(u.boundExpression);if(u instanceof Jn&&u.name==="error"||u instanceof Dr||u instanceof Ea)return!1;const a=u instanceof on||u instanceof Bt;let d=!0;return u.eachChild(m=>{d=a?d&&Eo(m):d&&m instanceof bt}),!!d&&zn(u)&&Ir(u,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function _s(u,a){const d=u.length-1;let m,x,S=0,T=d,L=0;for(;S<=T;)if(L=Math.floor((S+T)/2),m=u[L],x=u[L+1],m<=a){if(L===d||aa))throw new Je("Input is not a number.");T=L-1}return 0}class ka{constructor(a,d,m){this.type=a,this.input=d,this.labels=[],this.outputs=[];for(const[x,S]of m)this.labels.push(x),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,_t);if(!m)return null;const x=[];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.',j);const ne=d.parse(F,X,S);if(!ne)return null;S=S||ne.type,x.push([L,ne])}return new ka(S,m,x)}evaluate(a){const d=this.labels,m=this.outputs;if(d.length===1)return m[0].evaluate(a);const x=this.input.evaluate(a);if(x<=d[0])return m[0].evaluate(a);const S=d.length;return x>=d[S-1]?m[S-1].evaluate(a):m[_s(d,x)].evaluate(a)}eachChild(a){a(this.input);for(const d of this.outputs)a(d)}outputDefined(){return this.outputs.every(a=>a.outputDefined())}}function gr(u,a,d){return u*(1-d)+a*d}var Ta=Object.freeze({__proto__:null,number:gr,color:function(u,a,d){return new ae(gr(u.r,a.r,d),gr(u.g,a.g,d),gr(u.b,a.b,d),gr(u.a,a.a,d))},array:function(u,a,d){return u.map((m,x)=>gr(m,a[x],d))},padding:function(u,a,d){const m=u.values,x=a.values;return new Ce([gr(m[0],x[0],d),gr(m[1],x[1],d),gr(m[2],x[2],d),gr(m[3],x[3],d)])}});const gm=.95047,ym=1.08883,Ef=4/29,Oc=6/29,xm=3*Oc*Oc,p1=Math.PI/180,m1=180/Math.PI;function kf(u){return u>.008856451679035631?Math.pow(u,1/3):u/xm+Ef}function Tf(u){return u>Oc?u*u*u:xm*(u-Ef)}function Pf(u){return 255*(u<=.0031308?12.92*u:1.055*Math.pow(u,1/2.4)-.055)}function If(u){return(u/=255)<=.04045?u/12.92:Math.pow((u+.055)/1.055,2.4)}function ar(u){const a=If(u.r),d=If(u.g),m=If(u.b),x=kf((.4124564*a+.3575761*d+.1804375*m)/gm),S=kf((.2126729*a+.7151522*d+.072175*m)/1);return{l:116*S-16,a:500*(x-S),b:200*(S-kf((.0193339*a+.119192*d+.9503041*m)/ym)),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*Tf(a),d=gm*Tf(d),m=ym*Tf(m),new ae(Pf(3.2404542*d-1.5371385*a-.4985314*m),Pf(-.969266*d+1.8760108*a+.041556*m),Pf(.0556434*d-.2040259*a+1.0572252*m),u.alpha)}function v1(u,a,d){const m=a-u;return u+d*(m>180||m<-180?m-360*Math.round(m/360):m)}const _u={forward:ar,reverse:_m,interpolate:function(u,a,d){return{l:gr(u.l,a.l,d),a:gr(u.a,a.a,d),b:gr(u.b,a.b,d),alpha:gr(u.alpha,a.alpha,d)}}},bu={forward:function(u){const{l:a,a:d,b:m}=ar(u),x=Math.atan2(m,d)*m1;return{h:x<0?x+360:x,c:Math.sqrt(d*d+m*m),l:a,alpha:u.a}},reverse:function(u){const a=u.h*p1,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:v1(u.h,a.h,d),c:gr(u.c,a.c,d),l:gr(u.l,a.l,d),alpha:gr(u.alpha,a.alpha,d)}}};var bm=Object.freeze({__proto__:null,lab:_u,hcl:bu});class lo{constructor(a,d,m,x,S){this.type=a,this.operator=d,this.interpolation=m,this.input=x,this.labels=[],this.outputs=[];for(const[T,L]of S)this.labels.push(T),this.outputs.push(L)}static interpolationFactor(a,d,m,x){let S=0;if(a.name==="exponential")S=Mf(d,a.base,m,x);else if(a.name==="linear")S=Mf(d,1,m,x);else if(a.name==="cubic-bezier"){const T=a.controlPoints;S=new h(T[0],T[1],T[2],T[3]).solve(Mf(d,1,m,x))}return S}static parse(a,d){let[m,x,S,...T]=a;if(!Array.isArray(x)||x.length===0)return d.error("Expected an interpolation type expression.",1);if(x[0]==="linear")x={name:"linear"};else if(x[0]==="exponential"){const j=x[1];if(typeof j!="number")return d.error("Exponential interpolation requires a numeric base.",1,1);x={name:"exponential",base:j}}else{if(x[0]!=="cubic-bezier")return d.error(`Unknown interpolation type ${String(x[0])}`,1,0);{const j=x.slice(1);if(j.length!==4||j.some(X=>typeof X!="number"||X<0||X>1))return d.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);x={name:"cubic-bezier",controlPoints:j}}}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,_t),!S)return null;const L=[];let F=null;m==="interpolate-hcl"||m==="interpolate-lab"?F=Fn:d.expectedType&&d.expectedType.kind!=="value"&&(F=d.expectedType);for(let j=0;j=X)return d.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',ue);const pe=d.parse(ne,he,F);if(!pe)return null;F=F||pe.type,L.push([X,pe])}return F.kind==="number"||F.kind==="color"||F.kind==="padding"||F.kind==="array"&&F.itemType.kind==="number"&&typeof F.N=="number"?new lo(F,m,x,S,L):d.error(`Type ${ht(F)} is not interpolatable.`)}evaluate(a){const d=this.labels,m=this.outputs;if(d.length===1)return m[0].evaluate(a);const x=this.input.evaluate(a);if(x<=d[0])return m[0].evaluate(a);const S=d.length;if(x>=d[S-1])return m[S-1].evaluate(a);const T=_s(d,x),L=lo.interpolationFactor(this.interpolation,x,d[T],d[T+1]),F=m[T].evaluate(a),j=m[T+1].evaluate(a);return this.operator==="interpolate"?Ta[this.type.kind.toLowerCase()](F,j,L):this.operator==="interpolate-hcl"?bu.reverse(bu.interpolate(bu.forward(F),bu.forward(j),L)):_u.reverse(_u.interpolate(_u.forward(F),_u.forward(j),L))}eachChild(a){a(this.input);for(const d of this.outputs)a(d)}outputDefined(){return this.outputs.every(a=>a.outputDefined())}}function Mf(u,a,d,m){const x=m-d,S=u-d;return x===0?0:a===1?S/x:(Math.pow(a,S)-1)/(Math.pow(a,x)-1)}class Nc{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 x=d.expectedType;x&&x.kind!=="value"&&(m=x);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=x&&S.some(L=>$t(x,L.type));return new Nc(T?zt:m,S)}evaluate(a){let d,m=null,x=0;for(const S of this.args)if(x++,m=S.evaluate(a),m&&m instanceof Oe&&!m.available&&(d||(d=m.name),m=null,x===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 Dc{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 Af{constructor(a,d){this.type=an,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,zt),x=d.parse(a[2],2,zt);return m&&x?cn(m.type,[an,Gt,_t,An,zt])?new Af(m,x):d.error(`Expected first argument to be of type boolean, string, number or null, but found ${ht(m.type)} instead`):null}evaluate(a){const d=this.needle.evaluate(a),m=this.haystack.evaluate(a);if(!m)return!1;if(!Mn(d,["boolean","string","number","null"]))throw new Je(`Expected first argument to be of type boolean, string, number or null, but found ${ht(Be(d))} instead.`);if(!Mn(m,["string","array"]))throw new Je(`Expected second argument to be of type array or string, but found ${ht(Be(m))} instead.`);return m.indexOf(d)>=0}eachChild(a){a(this.needle),a(this.haystack)}outputDefined(){return!0}}class Lc{constructor(a,d,m){this.type=_t,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,zt),x=d.parse(a[2],2,zt);if(!m||!x)return null;if(!cn(m.type,[an,Gt,_t,An,zt]))return d.error(`Expected first argument to be of type boolean, string, number or null, but found ${ht(m.type)} instead`);if(a.length===4){const S=d.parse(a[3],3,_t);return S?new Lc(m,x,S):null}return new Lc(m,x)}evaluate(a){const d=this.needle.evaluate(a),m=this.haystack.evaluate(a);if(!Mn(d,["boolean","string","number","null"]))throw new Je(`Expected first argument to be of type boolean, string, number or null, but found ${ht(Be(d))} instead.`);if(!Mn(m,["string","array"]))throw new Je(`Expected second argument to be of type array or string, but found ${ht(Be(m))} instead.`);if(this.fromIndex){const x=this.fromIndex.evaluate(a);return m.indexOf(d,x)}return m.indexOf(d)}eachChild(a){a(this.needle),a(this.haystack),this.fromIndex&&a(this.fromIndex)}outputDefined(){return!1}}class Of{constructor(a,d,m,x,S,T){this.inputType=a,this.type=d,this.input=m,this.cases=x,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,x;d.expectedType&&d.expectedType.kind!=="value"&&(x=d.expectedType);const S={},T=[];for(let j=2;jNumber.MAX_SAFE_INTEGER)return ue.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof pe=="number"&&Math.floor(pe)!==pe)return ue.error("Numeric branch labels must be integer values.");if(m){if(ue.checkSubtype(m,Be(pe)))return null}else m=Be(pe);if(S[String(pe)]!==void 0)return ue.error("Branch labels must be unique.");S[String(pe)]=T.length}const he=d.parse(ne,j,x);if(!he)return null;x=x||he.type,T.push(he)}const L=d.parse(a[1],1,zt);if(!L)return null;const F=d.parse(a[a.length-1],a.length-1,x);return F?L.type.kind!=="value"&&d.concat(1).checkSubtype(m,L.type)?null:new Of(m,x,L,S,T,F):null}evaluate(a){const d=this.input.evaluate(a);return(Be(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 Nf{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 x=[];for(let T=1;Td.outputDefined())&&this.otherwise.outputDefined()}}class zc{constructor(a,d,m,x){this.type=a,this.input=d,this.beginIndex=m,this.endIndex=x}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,zt),x=d.parse(a[2],2,_t);if(!m||!x)return null;if(!cn(m.type,[ot(zt),Gt,zt]))return d.error(`Expected first argument to be of type array or string, but found ${ht(m.type)} instead`);if(a.length===4){const S=d.parse(a[3],3,_t);return S?new zc(m.type,m,x,S):null}return new zc(m.type,m,x)}evaluate(a){const d=this.input.evaluate(a),m=this.beginIndex.evaluate(a);if(!Mn(d,["string","array"]))throw new Je(`Expected first argument to be of type array or string, but found ${ht(Be(d))} instead.`);if(this.endIndex){const x=this.endIndex.evaluate(a);return d.slice(m,x)}return d.slice(m)}eachChild(a){a(this.input),a(this.beginIndex),this.endIndex&&a(this.endIndex)}outputDefined(){return!1}}function wm(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 Cm(u,a,d,m){return m.compare(a,d)===0}function dl(u,a,d){const m=u!=="=="&&u!=="!=";return class i9{constructor(S,T,L){this.type=an,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,zt);if(!F)return null;if(!wm(L,F.type))return T.concat(1).error(`"${L}" comparisons are not supported for type '${ht(F.type)}'.`);let j=T.parse(S[2],2,zt);if(!j)return null;if(!wm(L,j.type))return T.concat(2).error(`"${L}" comparisons are not supported for type '${ht(j.type)}'.`);if(F.type.kind!==j.type.kind&&F.type.kind!=="value"&&j.type.kind!=="value")return T.error(`Cannot compare types '${ht(F.type)}' and '${ht(j.type)}'.`);m&&(F.type.kind==="value"&&j.type.kind!=="value"?F=new Bt(j.type,[F]):F.type.kind!=="value"&&j.type.kind==="value"&&(j=new Bt(F.type,[j])));let X=null;if(S.length===4){if(F.type.kind!=="string"&&j.type.kind!=="string"&&F.type.kind!=="value"&&j.type.kind!=="value")return T.error("Cannot use collator to compare non-string types.");if(X=T.parse(S[3],3,Tn),!X)return null}return new i9(F,j,X)}evaluate(S){const T=this.lhs.evaluate(S),L=this.rhs.evaluate(S);if(m&&this.hasUntypedArgument){const F=Be(T),j=Be(L);if(F.kind!==j.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}, ${j.kind}) instead.`)}if(this.collator&&!m&&this.hasUntypedArgument){const F=Be(T),j=Be(L);if(F.kind!=="string"||j.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 g1=dl("==",function(u,a,d){return a===d},Cm),y1=dl("!=",function(u,a,d){return a!==d},function(u,a,d,m){return!Cm(0,a,d,m)}),x1=dl("<",function(u,a,d){return a",function(u,a,d){return a>d},function(u,a,d,m){return m.compare(a,d)>0}),b1=dl("<=",function(u,a,d){return a<=d},function(u,a,d,m){return m.compare(a,d)<=0}),w1=dl(">=",function(u,a,d){return a>=d},function(u,a,d,m){return m.compare(a,d)>=0});class Df{constructor(a,d,m,x,S){this.type=Gt,this.number=a,this.locale=d,this.currency=m,this.minFractionDigits=x,this.maxFractionDigits=S}static parse(a,d){if(a.length!==3)return d.error("Expected two arguments.");const m=d.parse(a[1],1,_t);if(!m)return null;const x=a[2];if(typeof x!="object"||Array.isArray(x))return d.error("NumberFormat options argument must be an object.");let S=null;if(x.locale&&(S=d.parse(x.locale,1,Gt),!S))return null;let T=null;if(x.currency&&(T=d.parse(x.currency,1,Gt),!T))return null;let L=null;if(x["min-fraction-digits"]&&(L=d.parse(x["min-fraction-digits"],1,_t),!L))return null;let F=null;return x["max-fraction-digits"]&&(F=d.parse(x["max-fraction-digits"],1,_t),!F)?null:new Df(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 Fc{constructor(a){this.type=Cn,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 x=[];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,_t),!F))return null;let j=null;if(L["text-font"]&&(j=d.parse(L["text-font"],1,ot(Gt)),!j))return null;let X=null;if(L["text-color"]&&(X=d.parse(L["text-color"],1,Fn),!X))return null;const ne=x[x.length-1];ne.scale=F,ne.font=j,ne.textColor=X}else{const F=d.parse(a[T],1,zt);if(!F)return null;const j=F.type.kind;if(j!=="string"&&j!=="value"&&j!=="null"&&j!=="resolvedImage")return d.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");S=!0,x.push({content:F,scale:null,font:null,textColor:null})}}return new Fc(x)}evaluate(a){return new be(this.sections.map(d=>{const m=d.content.evaluate(a);return Be(m)===Nt?new Ee("",m,null,null,null):new Ee(Ot(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 Lf{constructor(a){this.type=Nt,this.input=a}static parse(a,d){if(a.length!==2)return d.error("Expected two arguments.");const m=d.parse(a[1],1,Gt);return m?new Lf(m):d.error("No image name provided.")}evaluate(a){const d=this.input.evaluate(a),m=Oe.fromString(d);return m&&a.availableImages&&(m.available=a.availableImages.indexOf(d)>-1),m}eachChild(a){a(this.input)}outputDefined(){return!1}}class zf{constructor(a){this.type=_t,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 ${ht(m.type)} instead.`):new zf(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 ${ht(Be(d))} instead.`)}eachChild(a){a(this.input)}outputDefined(){return!1}}const fl={"==":g1,"!=":y1,">":_1,"<":x1,">=":w1,"<=":b1,array:Bt,at:Rf,boolean:Bt,case:Nf,coalesce:Nc,collator:Dr,format:Fc,image:Lf,in:Af,"index-of":Lc,interpolate:lo,"interpolate-hcl":lo,"interpolate-lab":lo,length:zf,let:Dc,literal:bt,match:Of,number:Bt,"number-format":Df,object:Bt,slice:zc,step:ka,string:Bt,"to-boolean":on,"to-color":on,"to-number":on,"to-string":on,var:ki,within:Ea};function Sm(u,[a,d,m,x]){a=a.evaluate(u),d=d.evaluate(u),m=m.evaluate(u);const S=x?x.evaluate(u):1,T=He(a,d,m,S);if(T)throw new Je(T);return new ae(a/255*S,d/255*S,m/255*S,S)}function Em(u,a){return u in a}function $c(u,a){const d=a[u];return d===void 0?null:d}function bs(u){return{type:u}}function km(u){return{result:"success",value:u}}function hl(u){return{result:"error",value:u}}function Er(u){return u["property-type"]==="data-driven"||u["property-type"]==="cross-faded-data-driven"}function Tm(u){return!!u.expression&&u.expression.parameters.indexOf("zoom")>-1}function Xn(u){return!!u.expression&&u.expression.interpolated}function sr(u){return u instanceof Number?"number":u instanceof String?"string":u instanceof Boolean?"boolean":Array.isArray(u)?"array":u===null?"null":typeof u}function wr(u){return typeof u=="object"&&u!==null&&!Array.isArray(u)}function Mr(u){return u}function wu(u,a){const d=a.type==="color",m=u.stops&&typeof u.stops[0][0]=="object",x=m||!(m||u.property!==void 0),S=u.type||(Xn(a)?"exponential":"interval");if(d||a.type==="padding"){const j=d?ae.parse:Ce.parse;(u=dn({},u)).stops&&(u.stops=u.stops.map(X=>[X[0],j(X[1])])),u.default=j(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=Pm;else if(S==="interval")T=S1;else if(S==="categorical"){T=C1,L=Object.create(null);for(const j of u.stops)L[j[0]]=j[1];F=typeof u.stops[0][0]}else{if(S!=="identity")throw new Error(`Unknown function type "${S}"`);T=E1}if(m){const j={},X=[];for(let he=0;hehe[0]),evaluate:({zoom:he},pe)=>Pm({stops:ne,base:u.base},a,he).evaluate(he,pe)}}if(x){const j=S==="exponential"?{name:"exponential",base:u.base!==void 0?u.base:1}:null;return{kind:"camera",interpolationType:j,interpolationFactor:lo.interpolationFactor.bind(void 0,j),zoomStops:u.stops.map(X=>X[0]),evaluate:({zoom:X})=>T(u,a,X,L,F)}}return{kind:"source",evaluate(j,X){const ne=X&&X.properties?X.properties[u.property]:void 0;return ne===void 0?pl(u.default,a.default):T(u,a,ne,L,F)}}}function pl(u,a,d){return u!==void 0?u:a!==void 0?a:d!==void 0?d:void 0}function C1(u,a,d,m,x){return pl(typeof d===x?m[d]:void 0,u.default,a.default)}function S1(u,a,d){if(sr(d)!=="number")return pl(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 x=_s(u.stops.map(S=>S[0]),d);return u.stops[x][1]}function Pm(u,a,d){const m=u.base!==void 0?u.base:1;if(sr(d)!=="number")return pl(u.default,a.default);const x=u.stops.length;if(x===1||d<=u.stops[0][0])return u.stops[0][1];if(d>=u.stops[x-1][0])return u.stops[x-1][1];const S=_s(u.stops.map(X=>X[0]),d),T=function(X,ne,ue,he){const pe=he-ue,Ae=X-ue;return pe===0?0:ne===1?Ae/pe:(Math.pow(ne,Ae)-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 j=Ta[a.type]||Mr;if(u.colorSpace&&u.colorSpace!=="rgb"){const X=bm[u.colorSpace];j=(ne,ue)=>X.reverse(X.interpolate(X.forward(ne),X.forward(ue),T))}return typeof L.evaluate=="function"?{evaluate(...X){const ne=L.evaluate.apply(void 0,X),ue=F.evaluate.apply(void 0,X);if(ne!==void 0&&ue!==void 0)return j(ne,ue,T)}}:j(L,F,T)}function E1(u,a,d){switch(a.type){case"color":d=ae.parse(d);break;case"formatted":d=be.fromString(d.toString());break;case"resolvedImage":d=Oe.fromString(d.toString());break;case"padding":d=Ce.parse(d);break;default:sr(d)===a.type||a.type==="enum"&&a.values[d]||(d=void 0)}return pl(d,u.default,a.default)}Jn.register(fl,{error:[{kind:"error"},[Gt],(u,[a])=>{throw new Je(a.evaluate(u))}],typeof:[Gt,[zt],(u,[a])=>ht(Be(a.evaluate(u)))],"to-rgba":[ot(_t,4),[Fn],(u,[a])=>a.evaluate(u).toArray()],rgb:[Fn,[_t,_t,_t],Sm],rgba:[Fn,[_t,_t,_t,_t],Sm],has:{type:an,overloads:[[[Gt],(u,[a])=>Em(a.evaluate(u),u.properties())],[[Gt,kn],(u,[a,d])=>Em(a.evaluate(u),d.evaluate(u))]]},get:{type:zt,overloads:[[[Gt],(u,[a])=>$c(a.evaluate(u),u.properties())],[[Gt,kn],(u,[a,d])=>$c(a.evaluate(u),d.evaluate(u))]]},"feature-state":[zt,[Gt],(u,[a])=>$c(a.evaluate(u),u.featureState||{})],properties:[kn,[],u=>u.properties()],"geometry-type":[Gt,[],u=>u.geometryType()],id:[zt,[],u=>u.id()],zoom:[_t,[],u=>u.globals.zoom],"heatmap-density":[_t,[],u=>u.globals.heatmapDensity||0],"line-progress":[_t,[],u=>u.globals.lineProgress||0],accumulated:[zt,[],u=>u.globals.accumulated===void 0?null:u.globals.accumulated],"+":[_t,bs(_t),(u,a)=>{let d=0;for(const m of a)d+=m.evaluate(u);return d}],"*":[_t,bs(_t),(u,a)=>{let d=1;for(const m of a)d*=m.evaluate(u);return d}],"-":{type:_t,overloads:[[[_t,_t],(u,[a,d])=>a.evaluate(u)-d.evaluate(u)],[[_t],(u,[a])=>-a.evaluate(u)]]},"/":[_t,[_t,_t],(u,[a,d])=>a.evaluate(u)/d.evaluate(u)],"%":[_t,[_t,_t],(u,[a,d])=>a.evaluate(u)%d.evaluate(u)],ln2:[_t,[],()=>Math.LN2],pi:[_t,[],()=>Math.PI],e:[_t,[],()=>Math.E],"^":[_t,[_t,_t],(u,[a,d])=>Math.pow(a.evaluate(u),d.evaluate(u))],sqrt:[_t,[_t],(u,[a])=>Math.sqrt(a.evaluate(u))],log10:[_t,[_t],(u,[a])=>Math.log(a.evaluate(u))/Math.LN10],ln:[_t,[_t],(u,[a])=>Math.log(a.evaluate(u))],log2:[_t,[_t],(u,[a])=>Math.log(a.evaluate(u))/Math.LN2],sin:[_t,[_t],(u,[a])=>Math.sin(a.evaluate(u))],cos:[_t,[_t],(u,[a])=>Math.cos(a.evaluate(u))],tan:[_t,[_t],(u,[a])=>Math.tan(a.evaluate(u))],asin:[_t,[_t],(u,[a])=>Math.asin(a.evaluate(u))],acos:[_t,[_t],(u,[a])=>Math.acos(a.evaluate(u))],atan:[_t,[_t],(u,[a])=>Math.atan(a.evaluate(u))],min:[_t,bs(_t),(u,a)=>Math.min(...a.map(d=>d.evaluate(u)))],max:[_t,bs(_t),(u,a)=>Math.max(...a.map(d=>d.evaluate(u)))],abs:[_t,[_t],(u,[a])=>Math.abs(a.evaluate(u))],round:[_t,[_t],(u,[a])=>{const d=a.evaluate(u);return d<0?-Math.round(-d):Math.round(d)}],floor:[_t,[_t],(u,[a])=>Math.floor(a.evaluate(u))],ceil:[_t,[_t],(u,[a])=>Math.ceil(a.evaluate(u))],"filter-==":[an,[Gt,zt],(u,[a,d])=>u.properties()[a.value]===d.value],"filter-id-==":[an,[zt],(u,[a])=>u.id()===a.value],"filter-type-==":[an,[Gt],(u,[a])=>u.geometryType()===a.value],"filter-<":[an,[Gt,zt],(u,[a,d])=>{const m=u.properties()[a.value],x=d.value;return typeof m==typeof x&&m{const d=u.id(),m=a.value;return typeof d==typeof m&&d":[an,[Gt,zt],(u,[a,d])=>{const m=u.properties()[a.value],x=d.value;return typeof m==typeof x&&m>x}],"filter-id->":[an,[zt],(u,[a])=>{const d=u.id(),m=a.value;return typeof d==typeof m&&d>m}],"filter-<=":[an,[Gt,zt],(u,[a,d])=>{const m=u.properties()[a.value],x=d.value;return typeof m==typeof x&&m<=x}],"filter-id-<=":[an,[zt],(u,[a])=>{const d=u.id(),m=a.value;return typeof d==typeof m&&d<=m}],"filter->=":[an,[Gt,zt],(u,[a,d])=>{const m=u.properties()[a.value],x=d.value;return typeof m==typeof x&&m>=x}],"filter-id->=":[an,[zt],(u,[a])=>{const d=u.id(),m=a.value;return typeof d==typeof m&&d>=m}],"filter-has":[an,[zt],(u,[a])=>a.value in u.properties()],"filter-has-id":[an,[],u=>u.id()!==null&&u.id()!==void 0],"filter-type-in":[an,[ot(Gt)],(u,[a])=>a.value.indexOf(u.geometryType())>=0],"filter-id-in":[an,[ot(zt)],(u,[a])=>a.value.indexOf(u.id())>=0],"filter-in-small":[an,[Gt,ot(zt)],(u,[a,d])=>d.value.indexOf(u.properties()[a.value])>=0],"filter-in-large":[an,[Gt,ot(zt)],(u,[a,d])=>function(m,x,S,T){for(;S<=T;){const L=S+T>>1;if(x[L]===m)return!0;x[L]>m?T=L-1:S=L+1}return!1}(u.properties()[a.value],d.value,0,d.value.length-1)],all:{type:an,overloads:[[[an,an],(u,[a,d])=>a.evaluate(u)&&d.evaluate(u)],[bs(an),(u,a)=>{for(const d of a)if(!d.evaluate(u))return!1;return!0}]]},any:{type:an,overloads:[[[an,an],(u,[a,d])=>a.evaluate(u)||d.evaluate(u)],[bs(an),(u,a)=>{for(const d of a)if(d.evaluate(u))return!0;return!1}]]},"!":[an,[an],(u,[a])=>!a.evaluate(u)],"is-supported-script":[an,[Gt],(u,[a])=>{const d=u.globals&&u.globals.isSupportedScript;return!d||d(a.evaluate(u))}],upcase:[Gt,[Gt],(u,[a])=>a.evaluate(u).toUpperCase()],downcase:[Gt,[Gt],(u,[a])=>a.evaluate(u).toLowerCase()],concat:[Gt,bs(zt),(u,a)=>a.map(d=>Ot(d.evaluate(u))).join("")],"resolved-locale":[Gt,[Tn],(u,[a])=>a.evaluate(u).resolvedLocale()]});class Bc{constructor(a,d){this.expression=a,this._warningHistory={},this._evaluator=new Bn,this._defaultValue=d?function(m){return m.type==="color"&&wr(m.default)?new ae(0,0,0,0):m.type==="color"?ae.parse(m.default)||null:m.type==="padding"?Ce.parse(m.default)||null:m.default===void 0?null:m.default}(d):null,this._enumValues=d&&d.type==="enum"?d.values:null}evaluateWithoutErrorHandling(a,d,m,x,S,T){return this._evaluator.globals=a,this._evaluator.feature=d,this._evaluator.featureState=m,this._evaluator.canonical=x,this._evaluator.availableImages=S||null,this._evaluator.formattedSection=T,this.expression.evaluate(this._evaluator)}evaluate(a,d,m,x,S,T){this._evaluator.globals=a,this._evaluator.feature=d||null,this._evaluator.featureState=m||null,this._evaluator.canonical=x,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 Cu(u){return Array.isArray(u)&&u.length>0&&typeof u[0]=="string"&&u[0]in fl}function Su(u,a){const d=new Ga(fl,[],a?function(x){const S={color:Fn,string:Gt,number:_t,enum:Gt,boolean:an,formatted:Cn,padding:hn,resolvedImage:Nt};return x.type==="array"?ot(S[x.value]||zt,x.length):S[x.type]}(a):void 0),m=d.parse(u,void 0,void 0,void 0,a&&a.type==="string"?{typeAnnotation:"coerce"}:void 0);return m?km(new Bc(m,a)):hl(d.errors)}class Eu{constructor(a,d){this.kind=a,this._styleExpression=d,this.isStateDependent=a!=="constant"&&!Zn(d.expression)}evaluateWithoutErrorHandling(a,d,m,x,S,T){return this._styleExpression.evaluateWithoutErrorHandling(a,d,m,x,S,T)}evaluate(a,d,m,x,S,T){return this._styleExpression.evaluate(a,d,m,x,S,T)}}class Ff{constructor(a,d,m,x){this.kind=a,this.zoomStops=m,this._styleExpression=d,this.isStateDependent=a!=="camera"&&!Zn(d.expression),this.interpolationType=x}evaluateWithoutErrorHandling(a,d,m,x,S,T){return this._styleExpression.evaluateWithoutErrorHandling(a,d,m,x,S,T)}evaluate(a,d,m,x,S,T){return this._styleExpression.evaluate(a,d,m,x,S,T)}interpolationFactor(a,d,m){return this.interpolationType?lo.interpolationFactor(this.interpolationType,a,d,m):0}}function Im(u,a){const d=Su(u,a);if(d.result==="error")return d;const m=d.value.expression,x=zn(m);if(!x&&!Er(a))return hl([new nn("","data expressions not supported")]);const S=Ir(m,["zoom"]);if(!S&&!Tm(a))return hl([new nn("","zoom expressions not supported")]);const T=Uc(m);return T||S?T instanceof nn?hl([T]):T instanceof lo&&!Xn(a)?hl([new nn("",'"interpolate" expressions cannot be used with this property')]):km(T?new Ff(x?"camera":"composite",d.value,T.labels,T instanceof lo?T.interpolation:void 0):new Eu(x?"constant":"source",d.value)):hl([new nn("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Vc{constructor(a,d){this._parameters=a,this._specification=d,dn(this,wu(this._parameters,this._specification))}static deserialize(a){return new Vc(a._parameters,a._specification)}static serialize(a){return{_parameters:a._parameters,_specification:a._specification}}}function Uc(u){let a=null;if(u instanceof Dc)a=Uc(u.result);else if(u instanceof Nc){for(const d of u.args)if(a=Uc(d),a)break}else(u instanceof ka||u instanceof lo)&&u.input instanceof Jn&&u.input.name==="zoom"&&(a=u);return a instanceof nn||u.eachChild(d=>{const m=Uc(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 zo(u){const a=u.key,d=u.value,m=u.valueSpec||{},x=u.objectElementValidators||{},S=u.style,T=u.styleSpec;let L=[];const F=sr(d);if(F!=="object")return[new Ge(a,d,`object expected, ${F} found`)];for(const j in d){const X=j.split(".")[0],ne=m[X]||m["*"];let ue;if(x[X])ue=x[X];else if(m[X])ue=co;else if(x["*"])ue=x["*"];else{if(!m["*"]){L.push(new Ge(a,d[j],`unknown property "${j}"`));continue}ue=co}L=L.concat(ue({key:(a&&`${a}.`)+j,value:d[j],valueSpec:ne,style:S,styleSpec:T,object:d,objectKey:j},d))}for(const j in m)x[j]||m[j].required&&m[j].default===void 0&&d[j]===void 0&&L.push(new Ge(a,d,`missing required property "${j}"`));return L}function Mm(u){const a=u.value,d=u.valueSpec,m=u.style,x=u.styleSpec,S=u.key,T=u.arrayElementValidator||co;if(sr(a)!=="array")return[new Ge(S,a,`array expected, ${sr(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 Rm(u){const a=u.valueSpec,d=Vt(u.value.type);let m,x,S,T={};const L=d!=="categorical"&&u.value.property===void 0,F=!L,j=sr(u.value.stops)==="array"&&sr(u.value.stops[0])==="array"&&sr(u.value.stops[0][0])==="object",X=zo({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 Ae=he.value;return pe=pe.concat(Mm({key:he.key,value:Ae,valueSpec:he.valueSpec,style:he.style,styleSpec:he.styleSpec,arrayElementValidator:ne})),sr(Ae)==="array"&&Ae.length===0&&pe.push(new Ge(he.key,Ae,"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&&X.push(new Ge(u.key,u.value,'missing required property "property"')),d==="identity"||u.value.stops||X.push(new Ge(u.key,u.value,'missing required property "stops"')),d==="exponential"&&u.valueSpec.expression&&!Xn(u.valueSpec)&&X.push(new Ge(u.key,u.value,"exponential functions not supported")),u.styleSpec.$version>=8&&(F&&!Er(u.valueSpec)?X.push(new Ge(u.key,u.value,"property functions not supported")):L&&!Tm(u.valueSpec)&&X.push(new Ge(u.key,u.value,"zoom functions not supported"))),d!=="categorical"&&!j||u.value.property!==void 0||X.push(new Ge(u.key,u.value,'"property" property is required')),X;function ne(he){let pe=[];const Ae=he.value,Ie=he.key;if(sr(Ae)!=="array")return[new Ge(Ie,Ae,`array expected, ${sr(Ae)} found`)];if(Ae.length!==2)return[new Ge(Ie,Ae,`array length 2 expected, length ${Ae.length} found`)];if(j){if(sr(Ae[0])!=="object")return[new Ge(Ie,Ae,`object expected, ${sr(Ae[0])} found`)];if(Ae[0].zoom===void 0)return[new Ge(Ie,Ae,"object stop key must have zoom")];if(Ae[0].value===void 0)return[new Ge(Ie,Ae,"object stop key must have value")];if(S&&S>Vt(Ae[0].zoom))return[new Ge(Ie,Ae[0].zoom,"stop zoom values must appear in ascending order")];Vt(Ae[0].zoom)!==S&&(S=Vt(Ae[0].zoom),x=void 0,T={}),pe=pe.concat(zo({key:`${Ie}[0]`,value:Ae[0],valueSpec:{zoom:{}},style:he.style,styleSpec:he.styleSpec,objectElementValidators:{zoom:$f,value:ue}}))}else pe=pe.concat(ue({key:`${Ie}[0]`,value:Ae[0],valueSpec:{},style:he.style,styleSpec:he.styleSpec},Ae));return Cu(jt(Ae[1]))?pe.concat([new Ge(`${Ie}[1]`,Ae[1],"expressions are not allowed in function stops.")]):pe.concat(co({key:`${Ie}[1]`,value:Ae[1],valueSpec:a,style:he.style,styleSpec:he.styleSpec}))}function ue(he,pe){const Ae=sr(he.value),Ie=Vt(he.value),Ze=he.value!==null?he.value:pe;if(m){if(Ae!==m)return[new Ge(he.key,Ze,`${Ae} stop domain type must match previous stop domain type ${m}`)]}else m=Ae;if(Ae!=="number"&&Ae!=="string"&&Ae!=="boolean")return[new Ge(he.key,Ze,"stop domain value must be a number, string, or boolean")];if(Ae!=="number"&&d!=="categorical"){let st=`number expected, ${Ae} found`;return Er(a)&&d===void 0&&(st+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Ge(he.key,Ze,st)]}return d!=="categorical"||Ae!=="number"||isFinite(Ie)&&Math.floor(Ie)===Ie?d!=="categorical"&&Ae==="number"&&x!==void 0&&Ienew 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"&&!Zn(d))return[new Ge(u.key,u.value,'"feature-state" data expressions are not supported with layout properties.')];if(u.expressionContext==="filter"&&!Zn(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(!Ir(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"&&!zn(d))return[new Ge(u.key,u.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function ku(u){const a=u.key,d=u.value,m=u.valueSpec,x=[];return Array.isArray(m.values)?m.values.indexOf(Vt(d))===-1&&x.push(new Ge(a,d,`expected one of [${m.values.join(", ")}], ${JSON.stringify(d)} found`)):Object.keys(m.values).indexOf(Vt(d))===-1&&x.push(new Ge(a,d,`expected one of [${Object.keys(m.values).join(", ")}], ${JSON.stringify(d)} found`)),x}function ml(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(!ml(a)&&typeof a!="boolean")return!1;return!0;default:return!0}}const k1={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function jc(u){if(u==null)return{filter:()=>!0,needGeometry:!1};ml(u)||(u=Tu(u));const a=Su(u,k1);if(a.result==="error")throw new Error(a.value.map(d=>`${d.key}: ${d.message}`).join(", "));return{filter:(d,m,x)=>a.value.evaluate(d,m,{},x),needGeometry:Om(u)}}function Am(u,a){return ua?1:0}function Om(u){if(!Array.isArray(u))return!1;if(u[0]==="within")return!0;for(let a=1;a"||a==="<="||a===">="?Bf(u[1],u[2],a):a==="any"?(d=u.slice(1),["any"].concat(d.map(Tu))):a==="all"?["all"].concat(u.slice(1).map(Tu)):a==="none"?["all"].concat(u.slice(1).map(Tu).map(vl)):a==="in"?Kc(u[1],u.slice(2)):a==="!in"?vl(Kc(u[1],u.slice(2))):a==="has"?Pu(u[1]):a==="!has"?vl(Pu(u[1])):a!=="within"||u;var d}function Bf(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 Kc(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(Am)]]:["filter-in-small",u,["literal",a]]}}function Pu(u){switch(u){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",u]}}function vl(u){return["!",u]}function Iu(u){return ml(jt(u.value))?ws(dn({},u,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Nm(u)}function Nm(u){const a=u.value,d=u.key;if(sr(a)!=="array")return[new Ge(d,a,`array expected, ${sr(a)} found`)];const m=u.styleSpec;let x,S=[];if(a.length<1)return[new Ge(d,a,"filter array must have at least 1 element")];switch(S=S.concat(ku({key:`${d}[0]`,value:a[0],valueSpec:m.filter_operator,style:u.style,styleSpec:u.styleSpec})),Vt(a[0])){case"<":case"<=":case">":case">=":a.length>=2&&Vt(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&&(x=sr(a[1]),x!=="string"&&S.push(new Ge(`${d}[1]`,a[1],`string expected, ${x} found`)));for(let T=2;T{j in d&&a.push(new Ge(m,d[j],`"${j}" is prohibited for ref layers`))}),x.layers.forEach(j=>{Vt(j.id)===L&&(F=j)}),F?F.ref?a.push(new Ge(m,d.ref,"ref cannot reference another ref layer")):T=Vt(F.type):a.push(new Ge(m,d.ref,`ref layer "${L}" not found`))}else if(T!=="background")if(d.source){const F=x.sources&&x.sources[d.source],j=F&&Vt(F.type);F?j==="vector"&&T==="raster"?a.push(new Ge(m,d.source,`layer "${d.id}" requires a raster source`)):j==="raster"&&T!=="raster"?a.push(new Ge(m,d.source,`layer "${d.id}" requires a vector source`)):j!=="vector"||d["source-layer"]?j==="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"]||j==="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(zo({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:Iu,layout:F=>zo({layer:d,key:F.key,value:F.value,style:F.style,styleSpec:F.styleSpec,objectElementValidators:{"*":j=>Lm(dn({layerType:T},j))}}),paint:F=>zo({layer:d,key:F.key,value:F.value,style:F.style,styleSpec:F.styleSpec,objectElementValidators:{"*":j=>Dm(dn({layerType:T},j))}})}})),a}function gl(u){const a=u.value,d=u.key,m=sr(a);return m!=="string"?[new Ge(d,a,`string expected, ${m} found`)]:[]}const Fm={promoteId:function({key:u,value:a}){if(sr(a)==="string")return gl({key:u,value:a});{const d=[];for(const m in a)d.push(...gl({key:`${u}.${m}`,value:a[m]}));return d}}};function Ru(u){const a=u.value,d=u.key,m=u.styleSpec,x=u.style;if(!a.type)return[new Ge(d,a,'"type" is required')];const S=Vt(a.type);let T;switch(S){case"vector":case"raster":case"raster-dem":return T=zo({key:d,value:a,valueSpec:m[`source_${S.replace("-","_")}`],style:u.style,styleSpec:m,objectElementValidators:Fm}),T;case"geojson":if(T=zo({key:d,value:a,valueSpec:m.source_geojson,style:x,styleSpec:m,objectElementValidators:Fm}),a.cluster)for(const L in a.clusterProperties){const[F,j]=a.clusterProperties[L],X=typeof F=="string"?[F,["accumulated"],["get",L]]:F;T.push(...ws({key:`${d}.${L}.map`,value:j,expressionContext:"cluster-map"})),T.push(...ws({key:`${d}.${L}.reduce`,value:X,expressionContext:"cluster-reduce"}))}return T;case"video":return zo({key:d,value:a,valueSpec:m.source_video,style:x,styleSpec:m});case"image":return zo({key:d,value:a,valueSpec:m.source_image,style:x,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 ku({key:`${d}.type`,value:a.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:x,styleSpec:m})}}function Au(u){const a=u.value,d=u.styleSpec,m=d.light,x=u.style;let S=[];const T=sr(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:x,styleSpec:d}):m[L]?co({key:L,value:a[L],valueSpec:m[L],style:x,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,x=u.style;let S=[];const T=sr(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:x,styleSpec:d}):[new Ge(L,a[L],`unknown property "${L}"`)]);return S}const Ou={"*":()=>[],array:Mm,boolean:function(u){const a=u.value,d=u.key,m=sr(a);return m!=="boolean"?[new Ge(d,a,`boolean expected, ${m} found`)]:[]},number:$f,color:function(u){const a=u.key,d=u.value,m=sr(d);return m!=="string"?[new Ge(a,d,`color expected, ${m} found`)]:Gn(d)===null?[new Ge(a,d,`color expected, "${d}" found`)]:[]},constants:Xt,enum:ku,filter:Iu,function:Rm,layer:zm,object:zo,source:Ru,light:Au,terrain:uo,string:gl,formatted:function(u){return gl(u).length===0?[]:ws(u)},resolvedImage:function(u){return gl(u).length===0?[]:ws(u)},padding:function(u){const a=u.key,d=u.value;if(sr(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 x=[];for(let S=0;S[]}})),u.constants&&(d=d.concat(Xt({key:"constants",value:u.constants,style:u,styleSpec:a}))),$m(d)}function $m(u){return[].concat(u).sort((a,d)=>a.line-d.line)}function Pa(u){return function(...a){return $m(u.apply(this,a))}}qa.source=Pa(Ru),qa.light=Pa(Au),qa.terrain=Pa(uo),qa.layer=Pa(zm),qa.filter=Pa(Iu),qa.paintProperty=Pa(Dm),qa.layoutProperty=Pa(Lm);const Nu=qa,Vf=Nu.light,P1=Nu.paintProperty,I1=Nu.layoutProperty;function Hc(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 Du{constructor(a,d,m){const x=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]&&x>=ne[pe+1])?(L[he]=!0,T.push(X[he])):L[he]=!1}}}}_forEachCell(a,d,m,x,S,T,L,F){const j=this._convertToCellCoord(a),X=this._convertToCellCoord(d),ne=this._convertToCellCoord(m),ue=this._convertToCellCoord(x);for(let he=j;he<=ne;he++)for(let pe=X;pe<=ue;pe++){const Ae=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,x,Ae,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];x[S]=Ia[m].shallow.indexOf(S)>=0?T:Cs(T,a)}u instanceof Error&&(x.message=u.message)}if(x.$name)throw new Error("$name property is reserved for worker serialization logic.");return m!=="Object"&&(x.$name=m),x}throw new Error("can't serialize object of type "+typeof u)}function Za(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||Bm(u)||Q(u)||ArrayBuffer.isView(u)||u instanceof ImageData)return u;if(Array.isArray(u))return u.map(Za);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 x of Object.keys(u)){if(x==="$name")continue;const S=u[x];m[x]=Ia[a].shallow.indexOf(x)>=0?S:Za(S)}return m}throw new Error("can't deserialize object of type "+typeof u)}class Uf{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 Wc(u){for(const a of u)if(Kf(a.charCodeAt(0)))return!0;return!1}function M1(u){for(const a of u)if(!jf(a.charCodeAt(0)))return!1;return!0}function jf(u){return!(Jt.Arabic(u)||Jt["Arabic Supplement"](u)||Jt["Arabic Extended-A"](u)||Jt["Arabic Presentation Forms-A"](u)||Jt["Arabic Presentation Forms-B"](u))}function Kf(u){return!(u!==746&&u!==747&&(u<4352||!(Jt["Bopomofo Extended"](u)||Jt.Bopomofo(u)||Jt["CJK Compatibility Forms"](u)&&!(u>=65097&&u<=65103)||Jt["CJK Compatibility Ideographs"](u)||Jt["CJK Compatibility"](u)||Jt["CJK Radicals Supplement"](u)||Jt["CJK Strokes"](u)||!(!Jt["CJK Symbols and Punctuation"](u)||u>=12296&&u<=12305||u>=12308&&u<=12319||u===12336)||Jt["CJK Unified Ideographs Extension A"](u)||Jt["CJK Unified Ideographs"](u)||Jt["Enclosed CJK Letters and Months"](u)||Jt["Hangul Compatibility Jamo"](u)||Jt["Hangul Jamo Extended-A"](u)||Jt["Hangul Jamo Extended-B"](u)||Jt["Hangul Jamo"](u)||Jt["Hangul Syllables"](u)||Jt.Hiragana(u)||Jt["Ideographic Description Characters"](u)||Jt.Kanbun(u)||Jt["Kangxi Radicals"](u)||Jt["Katakana Phonetic Extensions"](u)||Jt.Katakana(u)&&u!==12540||!(!Jt["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)||!(!Jt["Small Form Variants"](u)||u>=65112&&u<=65118||u>=65123&&u<=65126)||Jt["Unified Canadian Aboriginal Syllabics"](u)||Jt["Unified Canadian Aboriginal Syllabics Extended"](u)||Jt["Vertical Forms"](u)||Jt["Yijing Hexagram Symbols"](u)||Jt["Yi Syllables"](u)||Jt["Yi Radicals"](u))))}function Vm(u){return!(Kf(u)||function(a){return!!(Jt["Latin-1 Supplement"](a)&&(a===167||a===169||a===174||a===177||a===188||a===189||a===190||a===215||a===247)||Jt["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)||Jt["Letterlike Symbols"](a)||Jt["Number Forms"](a)||Jt["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)||Jt["Control Pictures"](a)&&a!==9251||Jt["Optical Character Recognition"](a)||Jt["Enclosed Alphanumerics"](a)||Jt["Geometric Shapes"](a)||Jt["Miscellaneous Symbols"](a)&&!(a>=9754&&a<=9759)||Jt["Miscellaneous Symbols and Arrows"](a)&&(a>=11026&&a<=11055||a>=11088&&a<=11097||a>=11192&&a<=11243)||Jt["CJK Symbols and Punctuation"](a)||Jt.Katakana(a)||Jt["Private Use Area"](a)||Jt["CJK Compatibility Forms"](a)||Jt["Small Form Variants"](a)||Jt["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 Um(u){return u>=1424&&u<=2303||Jt["Arabic Presentation Forms-A"](u)||Jt["Arabic Presentation Forms-B"](u)}function R1(u,a){return!(!a&&Um(u)||u>=2304&&u<=3583||u>=3840&&u<=4255||Jt.Khmer(u))}function jm(u){for(const a of u)if(Um(a.charCodeAt(0)))return!0;return!1}const Hf="deferred",Wf="loading",Gf="loaded";let qf=null,Yi="unavailable",Xa=null;const Km=function(u){u&&typeof u=="string"&&u.indexOf("NetworkError")>-1&&(Yi="error"),qf&&qf(u)};function yl(){Zf.fire(new Wt("pluginStateChange",{pluginStatus:Yi,pluginURL:Xa}))}const Zf=new Qt,Lu=function(){return Yi},Hm=function(){if(Yi!==Hf||!Xa)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Yi=Wf,yl(),Xa&&Ct({url:Xa},u=>{u?Km(u):(Yi=Gf,yl())})},ko={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>Yi===Gf||ko.applyArabicShaping!=null,isLoading:()=>Yi===Wf,setState(u){if(!H())throw new Error("Cannot set the state of the rtl-text-plugin when not in the web-worker context");Yi=u.pluginStatus,Xa=u.pluginURL},isParsed(){if(!H())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(!H())throw new Error("rtl-text-plugin url can only be queried from the worker threads");return Xa}};class Rr{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 Uf,this.transition={})}isSupportedScript(a){return function(d,m){for(const x of d)if(!R1(x.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 zu{constructor(a,d){this.property=a,this.value=d,this.expression=function(m,x){if(wr(m))return new Vc(m,x);if(Cu(m)){const S=Im(m,x);if(S.result==="error")throw new Error(S.value.map(T=>`${T.key}: ${T.message}`).join(", "));return S.value}{let S=m;return x.type==="color"&&typeof m=="string"?S=ae.parse(m):x.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 Gc{constructor(a){this.property=a,this.value=new zu(a,void 0)}transitioned(a,d){return new Gm(this.property,this.value,d,I({},a.transition,this.transition),a.now)}untransitioned(){return new Gm(this.property,this.value,null,{},0)}}class Wm{constructor(a){this._properties=a,this._values=Object.create(a.defaultTransitionablePropertyValues)}getValue(a){return N(this._values[a].value.value)}setValue(a,d){Object.prototype.hasOwnProperty.call(this._values,a)||(this._values[a]=new Gc(this._values[a].property)),this._values[a].value=new zu(this._values[a].property,d===null?void 0:N(d))}getTransition(a){return N(this._values[a].transition)}setTransition(a,d){Object.prototype.hasOwnProperty.call(this._values,a)||(this._values[a]=new Gc(this._values[a].property)),this._values[a].transition=N(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 x=this.getTransition(d);x!==void 0&&(a[`${d}-transition`]=x)}return a}transitioned(a,d){const m=new qm(this._properties);for(const x of Object.keys(this._values))m._values[x]=this._values[x].transitioned(a,d._values[x]);return m}untransitioned(){const a=new qm(this._properties);for(const d of Object.keys(this._values))a._values[d]=this._values[d].untransitioned();return a}}class Gm{constructor(a,d,m,x,S){this.property=a,this.value=d,this.begin=S+x.delay||0,this.end=this.begin+x.duration||0,a.specification.transition&&(x.delay||x.duration)&&(this.prior=m)}possiblyEvaluate(a,d,m){const x=a.now||0,S=this.value.possiblyEvaluate(a,d,m),T=this.prior;if(T){if(x>this.end)return this.prior=null,S;if(this.value.isDataDriven())return this.prior=null,S;if(x=1)return 1;const j=F*F,X=j*F;return 4*(F<.5?X:3*(F-j)+X-.75)}(L))}}return S}}class qm{constructor(a){this._properties=a,this._values=Object.create(a.defaultTransitioningPropertyValues)}possiblyEvaluate(a,d,m){const x=new Fu(this._properties);for(const S of Object.keys(this._values))x._values[S]=this._values[S].possiblyEvaluate(a,d,m);return x}hasTransition(){for(const a of Object.keys(this._values))if(this._values[a].prior)return!0;return!1}}class A1{constructor(a){this._properties=a,this._values=Object.create(a.defaultPropertyValues)}getValue(a){return N(this._values[a].value)}setValue(a,d){this._values[a]=new zu(this._values[a].property,d===null?void 0:N(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 x=new Fu(this._properties);for(const S of Object.keys(this._values))x._values[S]=this._values[S].possiblyEvaluate(a,d,m);return x}}class ia{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,x){return this.property.evaluate(this.value,this.parameters,a,d,m,x)}}class Fu{constructor(a){this._properties=a,this._values=Object.create(a.defaultPossiblyEvaluatedValues)}get(a){return this._values[a]}}class mn{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 x=Ta[this.specification.type];return x?x(a,d,m):a}}class En{constructor(a,d){this.specification=a,this.overrides=d}possiblyEvaluate(a,d,m,x){return new ia(this,a.expression.kind==="constant"||a.expression.kind==="camera"?{kind:"constant",value:a.expression.evaluate(d,null,{},m,x)}: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 ia(this,{kind:"constant",value:void 0},a.parameters);const x=Ta[this.specification.type];return x?new ia(this,{kind:"constant",value:x(a.value.value,d.value.value,m)},a.parameters):a}evaluate(a,d,m,x,S,T){return a.kind==="constant"?a.value:a.evaluate(d,m,x,S,T)}}class xl extends En{possiblyEvaluate(a,d,m,x){if(a.value===void 0)return new ia(this,{kind:"constant",value:void 0},d);if(a.expression.kind==="constant"){const S=a.expression.evaluate(d,null,{},m,x),T=a.property.specification.type==="resolvedImage"&&typeof S!="string"?S.name:S,L=this._calculate(T,T,T,d);return new ia(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 ia(this,{kind:"constant",value:S},d)}return new ia(this,a.expression,d)}evaluate(a,d,m,x,S,T){if(a.kind==="source"){const L=a.evaluate(d,m,x,S,T);return this._calculate(L,L,L,d)}return a.kind==="composite"?this._calculate(a.evaluate({zoom:Math.floor(d.zoom)-1},m,x),a.evaluate({zoom:Math.floor(d.zoom)},m,x),a.evaluate({zoom:Math.floor(d.zoom)+1},m,x),d):a.value}_calculate(a,d,m,x){return x.zoom>x.zoomHistory.lastIntegerZoom?{from:a,to:d}:{from:m,to:d}}interpolate(a){return a}}class Xf{constructor(a){this.specification=a}possiblyEvaluate(a,d,m,x){if(a.value!==void 0){if(a.expression.kind==="constant"){const S=a.expression.evaluate(d,null,{},m,x);return this._calculate(S,S,S,d)}return this._calculate(a.expression.evaluate(new Rr(Math.floor(d.zoom-1),d)),a.expression.evaluate(new Rr(Math.floor(d.zoom),d)),a.expression.evaluate(new Rr(Math.floor(d.zoom+1),d)),d)}}_calculate(a,d,m,x){return x.zoom>x.zoomHistory.lastIntegerZoom?{from:a,to:d}:{from:m,to:d}}interpolate(a){return a}}class Ya{constructor(a){this.specification=a}possiblyEvaluate(a,d,m,x){return!!a.expression.evaluate(d,null,{},m,x)}interpolate(){return!1}}class Ti{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 x=this.defaultPropertyValues[d]=new zu(m,void 0),S=this.defaultTransitionablePropertyValues[d]=new Gc(m);this.defaultTransitioningPropertyValues[d]=S.untransitioned(),this.defaultPossiblyEvaluatedValues[d]=x.possiblyEvaluate({})}}}fn("DataDrivenProperty",En),fn("DataConstantProperty",mn),fn("CrossFadedDataDrivenProperty",xl),fn("CrossFadedProperty",Xf),fn("ColorRampProperty",Ya);const Qa="-transition";class oa extends Qt{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 A1(d.layout)),d.paint)){this._transitionablePaint=new Wm(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 Fu(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(I1,`layers.${this.id}.layout.${a}`,a,d,m)||(a!=="visibility"?this._unevaluatedLayout.setValue(a,d):this.visibility=d)}getPaintProperty(a){return a.endsWith(Qa)?this._transitionablePaint.getTransition(a.slice(0,-Qa.length)):this._transitionablePaint.getValue(a)}setPaintProperty(a,d,m={}){if(d!=null&&this._validate(P1,`layers.${this.id}.paint.${a}`,a,d,m))return!1;if(a.endsWith(Qa))return this._transitionablePaint.setTransition(a.slice(0,-Qa.length),d||void 0),!1;{const x=this._transitionablePaint._values[a],S=x.property.specification["property-type"]==="cross-faded-data-driven",T=x.value.isDataDriven(),L=x.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),R(a,(d,m)=>!(d===void 0||m==="layout"&&!Object.keys(d).length||m==="paint"&&!Object.keys(d).length))}_validate(a,d,m,x,S={}){return(!S||S.validate!==!1)&&Hc(this,a.call(Nu,{key:d,layerType:this.type,objectKey:m,value:x,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 ia&&Er(d.property.specification)&&(d.value.kind==="source"||d.value.kind==="composite")&&d.value.isStateDependent)return!0}return!1}}const Zm={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Ja{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 Gr{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(x=>{const S=Zm[x.type].BYTES_PER_ELEMENT,T=d=Yf(d,Math.max(a,S)),L=x.components||1;return m=Math.max(m,S),d+=S*L,{name:x.name,type:x.type,components:L,offset:T}}),size:Yf(d,Math.max(m,a)),alignment:a}}function Yf(u,a){return Math.ceil(u/a)*a}class Ss extends Gr{_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 x=2*a;return this.int16[x+0]=d,this.int16[x+1]=m,a}}Ss.prototype.bytesPerElement=4,fn("StructArrayLayout2i4",Ss);class y extends Gr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(a,d,m,x){const S=this.length;return this.resize(S+1),this.emplace(S,a,d,m,x)}emplace(a,d,m,x,S){const T=4*a;return this.int16[T+0]=d,this.int16[T+1]=m,this.int16[T+2]=x,this.int16[T+3]=S,a}}y.prototype.bytesPerElement=8,fn("StructArrayLayout4i8",y);class s extends Gr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(a,d,m,x,S,T){const L=this.length;return this.resize(L+1),this.emplace(L,a,d,m,x,S,T)}emplace(a,d,m,x,S,T,L){const F=6*a;return this.int16[F+0]=d,this.int16[F+1]=m,this.int16[F+2]=x,this.int16[F+3]=S,this.int16[F+4]=T,this.int16[F+5]=L,a}}s.prototype.bytesPerElement=12,fn("StructArrayLayout2i4i12",s);class f extends Gr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(a,d,m,x,S,T){const L=this.length;return this.resize(L+1),this.emplace(L,a,d,m,x,S,T)}emplace(a,d,m,x,S,T,L){const F=4*a,j=8*a;return this.int16[F+0]=d,this.int16[F+1]=m,this.uint8[j+4]=x,this.uint8[j+5]=S,this.uint8[j+6]=T,this.uint8[j+7]=L,a}}f.prototype.bytesPerElement=8,fn("StructArrayLayout2i4ub8",f);class v extends Gr{_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 x=2*a;return this.float32[x+0]=d,this.float32[x+1]=m,a}}v.prototype.bytesPerElement=8,fn("StructArrayLayout2f8",v);class _ extends Gr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(a,d,m,x,S,T,L,F,j,X){const ne=this.length;return this.resize(ne+1),this.emplace(ne,a,d,m,x,S,T,L,F,j,X)}emplace(a,d,m,x,S,T,L,F,j,X,ne){const ue=10*a;return this.uint16[ue+0]=d,this.uint16[ue+1]=m,this.uint16[ue+2]=x,this.uint16[ue+3]=S,this.uint16[ue+4]=T,this.uint16[ue+5]=L,this.uint16[ue+6]=F,this.uint16[ue+7]=j,this.uint16[ue+8]=X,this.uint16[ue+9]=ne,a}}_.prototype.bytesPerElement=20,fn("StructArrayLayout10ui20",_);class k extends Gr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(a,d,m,x,S,T,L,F,j,X,ne,ue){const he=this.length;return this.resize(he+1),this.emplace(he,a,d,m,x,S,T,L,F,j,X,ne,ue)}emplace(a,d,m,x,S,T,L,F,j,X,ne,ue,he){const pe=12*a;return this.int16[pe+0]=d,this.int16[pe+1]=m,this.int16[pe+2]=x,this.int16[pe+3]=S,this.uint16[pe+4]=T,this.uint16[pe+5]=L,this.uint16[pe+6]=F,this.uint16[pe+7]=j,this.int16[pe+8]=X,this.int16[pe+9]=ne,this.int16[pe+10]=ue,this.int16[pe+11]=he,a}}k.prototype.bytesPerElement=24,fn("StructArrayLayout4i4ui4i24",k);class D extends Gr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(a,d,m){const x=this.length;return this.resize(x+1),this.emplace(x,a,d,m)}emplace(a,d,m,x){const S=3*a;return this.float32[S+0]=d,this.float32[S+1]=m,this.float32[S+2]=x,a}}D.prototype.bytesPerElement=12,fn("StructArrayLayout3f12",D);class $ extends Gr{_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,fn("StructArrayLayout1ul4",$);class V extends Gr{_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,x,S,T,L,F,j){const X=this.length;return this.resize(X+1),this.emplace(X,a,d,m,x,S,T,L,F,j)}emplace(a,d,m,x,S,T,L,F,j,X){const ne=10*a,ue=5*a;return this.int16[ne+0]=d,this.int16[ne+1]=m,this.int16[ne+2]=x,this.int16[ne+3]=S,this.int16[ne+4]=T,this.int16[ne+5]=L,this.uint32[ue+3]=F,this.uint16[ne+8]=j,this.uint16[ne+9]=X,a}}V.prototype.bytesPerElement=20,fn("StructArrayLayout6i1ul2ui20",V);class W extends Gr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(a,d,m,x,S,T){const L=this.length;return this.resize(L+1),this.emplace(L,a,d,m,x,S,T)}emplace(a,d,m,x,S,T,L){const F=6*a;return this.int16[F+0]=d,this.int16[F+1]=m,this.int16[F+2]=x,this.int16[F+3]=S,this.int16[F+4]=T,this.int16[F+5]=L,a}}W.prototype.bytesPerElement=12,fn("StructArrayLayout2i2i2i12",W);class ee extends Gr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(a,d,m,x,S){const T=this.length;return this.resize(T+1),this.emplace(T,a,d,m,x,S)}emplace(a,d,m,x,S,T){const L=4*a,F=8*a;return this.float32[L+0]=d,this.float32[L+1]=m,this.float32[L+2]=x,this.int16[F+6]=S,this.int16[F+7]=T,a}}ee.prototype.bytesPerElement=16,fn("StructArrayLayout2f1f2i16",ee);class ie extends Gr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(a,d,m,x){const S=this.length;return this.resize(S+1),this.emplace(S,a,d,m,x)}emplace(a,d,m,x,S){const T=12*a,L=3*a;return this.uint8[T+0]=d,this.uint8[T+1]=m,this.float32[L+1]=x,this.float32[L+2]=S,a}}ie.prototype.bytesPerElement=12,fn("StructArrayLayout2ub2f12",ie);class fe extends Gr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(a,d,m){const x=this.length;return this.resize(x+1),this.emplace(x,a,d,m)}emplace(a,d,m,x){const S=3*a;return this.uint16[S+0]=d,this.uint16[S+1]=m,this.uint16[S+2]=x,a}}fe.prototype.bytesPerElement=6,fn("StructArrayLayout3ui6",fe);class Se extends Gr{_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,x,S,T,L,F,j,X,ne,ue,he,pe,Ae,Ie,Ze){const st=this.length;return this.resize(st+1),this.emplace(st,a,d,m,x,S,T,L,F,j,X,ne,ue,he,pe,Ae,Ie,Ze)}emplace(a,d,m,x,S,T,L,F,j,X,ne,ue,he,pe,Ae,Ie,Ze,st){const Ke=24*a,rt=12*a,kt=48*a;return this.int16[Ke+0]=d,this.int16[Ke+1]=m,this.uint16[Ke+2]=x,this.uint16[Ke+3]=S,this.uint32[rt+2]=T,this.uint32[rt+3]=L,this.uint32[rt+4]=F,this.uint16[Ke+10]=j,this.uint16[Ke+11]=X,this.uint16[Ke+12]=ne,this.float32[rt+7]=ue,this.float32[rt+8]=he,this.uint8[kt+36]=pe,this.uint8[kt+37]=Ae,this.uint8[kt+38]=Ie,this.uint32[rt+10]=Ze,this.int16[Ke+22]=st,a}}Se.prototype.bytesPerElement=48,fn("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Se);class _e extends Gr{_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,x,S,T,L,F,j,X,ne,ue,he,pe,Ae,Ie,Ze,st,Ke,rt,kt,St,un,pn,en,Zt,Ht,tn){const Yt=this.length;return this.resize(Yt+1),this.emplace(Yt,a,d,m,x,S,T,L,F,j,X,ne,ue,he,pe,Ae,Ie,Ze,st,Ke,rt,kt,St,un,pn,en,Zt,Ht,tn)}emplace(a,d,m,x,S,T,L,F,j,X,ne,ue,he,pe,Ae,Ie,Ze,st,Ke,rt,kt,St,un,pn,en,Zt,Ht,tn,Yt){const Ft=34*a,wn=17*a;return this.int16[Ft+0]=d,this.int16[Ft+1]=m,this.int16[Ft+2]=x,this.int16[Ft+3]=S,this.int16[Ft+4]=T,this.int16[Ft+5]=L,this.int16[Ft+6]=F,this.int16[Ft+7]=j,this.uint16[Ft+8]=X,this.uint16[Ft+9]=ne,this.uint16[Ft+10]=ue,this.uint16[Ft+11]=he,this.uint16[Ft+12]=pe,this.uint16[Ft+13]=Ae,this.uint16[Ft+14]=Ie,this.uint16[Ft+15]=Ze,this.uint16[Ft+16]=st,this.uint16[Ft+17]=Ke,this.uint16[Ft+18]=rt,this.uint16[Ft+19]=kt,this.uint16[Ft+20]=St,this.uint16[Ft+21]=un,this.uint16[Ft+22]=pn,this.uint32[wn+12]=en,this.float32[wn+13]=Zt,this.float32[wn+14]=Ht,this.float32[wn+15]=tn,this.float32[wn+16]=Yt,a}}_e.prototype.bytesPerElement=68,fn("StructArrayLayout8i15ui1ul4f68",_e);class we extends Gr{_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,fn("StructArrayLayout1f4",we);class $e extends Gr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(a,d,m){const x=this.length;return this.resize(x+1),this.emplace(x,a,d,m)}emplace(a,d,m,x){const S=3*a;return this.int16[S+0]=d,this.int16[S+1]=m,this.int16[S+2]=x,a}}$e.prototype.bytesPerElement=6,fn("StructArrayLayout3i6",$e);class je extends Gr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(a,d,m){const x=this.length;return this.resize(x+1),this.emplace(x,a,d,m)}emplace(a,d,m,x){const S=4*a;return this.uint32[2*a+0]=d,this.uint16[S+2]=m,this.uint16[S+3]=x,a}}je.prototype.bytesPerElement=8,fn("StructArrayLayout1ul2ui8",je);class et extends Gr{_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 x=2*a;return this.uint16[x+0]=d,this.uint16[x+1]=m,a}}et.prototype.bytesPerElement=4,fn("StructArrayLayout2ui4",et);class Pe extends Gr{_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}}Pe.prototype.bytesPerElement=2,fn("StructArrayLayout1ui2",Pe);class at extends Gr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(a,d,m,x){const S=this.length;return this.resize(S+1),this.emplace(S,a,d,m,x)}emplace(a,d,m,x,S){const T=4*a;return this.float32[T+0]=d,this.float32[T+1]=m,this.float32[T+2]=x,this.float32[T+3]=S,a}}at.prototype.bytesPerElement=16,fn("StructArrayLayout4f16",at);class nt extends Ja{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new re(this.anchorPointX,this.anchorPointY)}}nt.prototype.size=20;class gt extends V{get(a){return new nt(this,a)}}fn("CollisionBoxArray",gt);class yt extends Ja{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]}}yt.prototype.size=48;class Dt extends Se{get(a){return new yt(this,a)}}fn("PlacedSymbolArray",Dt);class vt extends Ja{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 rn extends _e{get(a){return new vt(this,a)}}fn("SymbolInstanceArray",rn);class qt extends we{getoffsetX(a){return this.float32[1*a+0]}}fn("GlyphOffsetArray",qt);class ln extends $e{getx(a){return this.int16[3*a+0]}gety(a){return this.int16[3*a+1]}gettileUnitDistanceFromAnchor(a){return this.int16[3*a+2]}}fn("SymbolLineVertexArray",ln);class Dn extends Ja{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]}}Dn.prototype.size=8;class Vn extends je{get(a){return new Dn(this,a)}}fn("FeatureIndexArray",Vn);class bn extends Ss{}class cr extends Ss{}class dr extends Ss{}class Qn extends s{}class er extends f{}class pr extends v{}class vi extends _{}class aa extends k{}class Fo extends D{}class sa extends ${}class es extends W{}class To extends ie{}class Qi extends fe{}class Ma extends et{}const qc=ni([{name:"a_pos",components:2,type:"Int16"}],4),{members:ci}=qc;class Hn{constructor(a=[]){this.segments=a}prepareSegment(a,d,m,x){let S=this.segments[this.segments.length-1];return a>Hn.MAX_VERTEX_ARRAY_LENGTH&&B(`Max vertices per segment is ${Hn.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${a}`),(!S||S.vertexLength+a>Hn.MAX_VERTEX_ARRAY_LENGTH||S.sortKey!==x)&&(S={vertexOffset:d.length,primitiveOffset:m.length,vertexLength:0,primitiveLength:0},x!==void 0&&(S.sortKey=x),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,x){return new Hn([{vertexOffset:a,primitiveOffset:d,vertexLength:m,primitiveLength:x,vaos:{},sortKey:0}])}}function ur(u,a){return 256*(u=w(Math.floor(u),0,255))+w(Math.floor(a),0,255)}Hn.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,fn("SegmentVector",Hn);const gi=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 yi={exports:{}},Ar={exports:{}};Ar.exports=function(u,a){var d,m,x,S,T,L,F,j;for(m=u.length-(d=3&u.length),x=a,T=3432918353,L=461845907,j=0;j>>16)*T&65535)<<16)&4294967295)<<15|F>>>17))*L+(((F>>>16)*L&65535)<<16)&4294967295)<<13|x>>>19))+((5*(x>>>16)&65535)<<16)&4294967295))+((58964+(S>>>16)&65535)<<16);switch(F=0,d){case 3:F^=(255&u.charCodeAt(j+2))<<16;case 2:F^=(255&u.charCodeAt(j+1))<<8;case 1:x^=F=(65535&(F=(F=(65535&(F^=255&u.charCodeAt(j)))*T+(((F>>>16)*T&65535)<<16)&4294967295)<<15|F>>>17))*L+(((F>>>16)*L&65535)<<16)&4294967295}return x^=u.length,x=2246822507*(65535&(x^=x>>>16))+((2246822507*(x>>>16)&65535)<<16)&4294967295,x=3266489909*(65535&(x^=x>>>13))+((3266489909*(x>>>16)&65535)<<16)&4294967295,(x^=x>>>16)>>>0};var Po={exports:{}};Po.exports=function(u,a){for(var d,m=u.length,x=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),x=1540483477*(65535&x)+((1540483477*(x>>>16)&65535)<<16)^(d=1540483477*(65535&(d^=d>>>24))+((1540483477*(d>>>16)&65535)<<16)),m-=4,++S;switch(m){case 3:x^=(255&u.charCodeAt(S+2))<<16;case 2:x^=(255&u.charCodeAt(S+1))<<8;case 1:x=1540483477*(65535&(x^=255&u.charCodeAt(S)))+((1540483477*(x>>>16)&65535)<<16)}return x=1540483477*(65535&(x^=x>>>13))+((1540483477*(x>>>16)&65535)<<16),(x^=x>>>15)>>>0};var Es=Ar.exports,Qf=Po.exports;yi.exports=Es,yi.exports.murmur3=Es,yi.exports.murmur2=Qf;class _l{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(a,d,m,x){this.ids.push(Xm(a)),this.positions.push(d,m,x)}getPositions(a){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const d=Xm(a);let m=0,x=this.ids.length-1;for(;m>1;this.ids[T]>=d?x=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),x=new Uint32Array(a.positions);return Jf(m,x,0,m.length-1),d&&d.push(m.buffer,x.buffer),{ids:m,positions:x}}static deserialize(a){const d=new _l;return d.ids=a.ids,d.positions=a.positions,d.indexed=!0,d}}function Xm(u){const a=+u;return!isNaN(a)&&a<=Number.MAX_SAFE_INTEGER?a:yi.exports(String(u))}function Jf(u,a,d,m){for(;d>1];let S=d-1,T=m+1;for(;;){do S++;while(u[S]x);if(S>=T)break;ts(u,S,T),ts(a,3*S,3*T),ts(a,3*S+1,3*T+1),ts(a,3*S+2,3*T+2)}T-d`u_${x}`),this.type=m}setUniform(a,d,m){a.set(m.constantOr(this.value))}getBinding(a,d,m){return this.type==="color"?new m3(a,d):new Ts(a,d)}}class Xc{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,x){const S=x==="u_pattern_to"?this.patternTo:x==="u_pattern_from"?this.patternFrom:x==="u_pixel_ratio_to"?this.pixelRatioTo:x==="u_pixel_ratio_from"?this.pixelRatioFrom:null;S&&a.set(S)}getBinding(a,d,m){return m.substr(0,9)==="u_pattern"?new Zc(a,d):new Ts(a,d)}}class Ps{constructor(a,d,m,x){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 x}populatePaintArray(a,d,m,x,S){const T=this.paintVertexArray.length,L=this.expression.evaluate(new Rr(0),d,{},x,[],S);this.paintVertexArray.resize(a),this._setPaintValue(T,a,L)}updatePaintArray(a,d,m,x){const S=this.expression.evaluate({zoom:0},m,x);this._setPaintValue(a,d,S)}_setPaintValue(a,d,m){if(this.type==="color"){const x=O1(m);for(let S=a;S`u_${L}_t`),this.type=m,this.useIntegerZoom=x,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,x,S){const T=this.expression.evaluate(new Rr(this.zoom),d,{},x,[],S),L=this.expression.evaluate(new Rr(this.zoom+1),d,{},x,[],S),F=this.paintVertexArray.length;this.paintVertexArray.resize(a),this._setPaintValue(F,a,T,L)}updatePaintArray(a,d,m,x){const S=this.expression.evaluate({zoom:this.zoom},m,x),T=this.expression.evaluate({zoom:this.zoom+1},m,x);this._setPaintValue(a,d,S,T)}_setPaintValue(a,d,m,x){if(this.type==="color"){const S=O1(m),T=O1(x);for(let L=a;L`#define HAS_UNIFORM_${x}`))}return a}getBinderAttributes(){const a=[];for(const d in this.binders){const m=this.binders[d];if(m instanceof Ps||m instanceof Ra)for(let x=0;x!0){this.programConfigurations={};for(const x of a)this.programConfigurations[x.id]=new v3(x,d,m);this.needsUpload=!1,this._featureMap=new _l,this._bufferOffset=0}populatePaintArrays(a,d,m,x,S,T){for(const L in this.programConfigurations)this.programConfigurations[L].populatePaintArrays(a,d,x,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,x){for(const S of m)this.needsUpload=this.programConfigurations[S.id].updatePaintArrays(a,this._featureMap,d,S,x)||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 P9(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 g3(u,a,d){const m={color:{source:v,composite:at},number:{source:we,composite:v}},x=function(S){return{"line-pattern":{source:vi,composite:vi},"fill-pattern":{source:vi,composite:vi},"fill-extrusion-pattern":{source:vi,composite:vi}}[S]}(u);return x&&x[d]||m[a][d]}fn("ConstantBinder",eh),fn("CrossFadedConstantBinder",Xc),fn("SourceExpressionBinder",Ps),fn("CrossFadedCompositeBinder",bl),fn("CompositeExpressionBinder",Ra),fn("ProgramConfiguration",v3,{omit:["_buffers"]}),fn("ProgramConfigurationSet",$u);var di=8192;const N1=Math.pow(2,14)-1,y3=-N1-1;function Bu(u){const a=di/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 Vu(u,a){return{type:u.type,id:u.id,properties:u.properties,geometry:a?Bu(u):[]}}function Ym(u,a,d,m,x){u.emplaceBack(2*a+(m+1)/2,2*d+(x+1)/2)}class D1{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 cr,this.indexArray=new Qi,this.segments=new Hn,this.programConfigurations=new $u(a.layers,a.zoom),this.stateDependentLayerIds=this.layers.filter(d=>d.isStateDependent()).map(d=>d.id)}populate(a,d,m){const x=this.layers[0],S=[];let T=null,L=!1;x.type==="circle"&&(T=x.layout.get("circle-sort-key"),L=!T.isConstant());for(const{feature:F,id:j,index:X,sourceLayerIndex:ne}of a){const ue=this.layers[0]._featureFilter.needGeometry,he=Vu(F,ue);if(!this.layers[0]._featureFilter.filter(new Rr(this.zoom),he,m))continue;const pe=L?T.evaluate(he,{},m):void 0,Ae={id:j,properties:F.properties,type:F.type,sourceLayerIndex:ne,index:X,geometry:ue?he.geometry:Bu(F),patterns:{},sortKey:pe};S.push(Ae)}L&&S.sort((F,j)=>F.sortKey-j.sortKey);for(const F of S){const{geometry:j,index:X,sourceLayerIndex:ne}=F,ue=a[X].feature;this.addFeature(F,j,X,m),d.featureIndex.insert(ue,j,X,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,ci),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,x){for(const S of d)for(const T of S){const L=T.x,F=T.y;if(L<0||L>=di||F<0||F>=di)continue;const j=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,a.sortKey),X=j.vertexLength;Ym(this.layoutVertexArray,L,F,-1,-1),Ym(this.layoutVertexArray,L,F,1,-1),Ym(this.layoutVertexArray,L,F,1,1),Ym(this.layoutVertexArray,L,F,-1,1),this.indexArray.emplaceBack(X,X+1,X+2),this.indexArray.emplaceBack(X,X+3,X+2),j.vertexLength+=4,j.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,a,m,{},x)}}function x3(u,a){for(let d=0;d1){if(L1(u,a))return!0;for(let m=0;m1?d:d.sub(a)._mult(x)._add(a))}function w3(u,a){let d,m,x,S=!1;for(let T=0;Ta.y!=x.y>a.y&&a.x<(x.x-m.x)*(a.y-m.y)/(x.y-m.y)+m.x&&(S=!S)}return S}function Yc(u,a){let d=!1;for(let m=0,x=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 A9(u,a,d){const m=d[0],x=d[2];if(u.xx.x&&a.x>x.x||u.yx.y&&a.y>x.y)return!1;const S=U(u,a,d[0]);return S!==U(u,a,d[1])||S!==U(u,a,d[2])||S!==U(u,a,d[3])}function th(u,a,d){const m=a.paint.get(u).value;return m.kind==="constant"?m.value:d.programConfigurations.get(a.id).getMaxValue(u)}function Qm(u){return Math.sqrt(u[0]*u[0]+u[1]*u[1])}function Jm(u,a,d,m,x){if(!a[0]&&!a[1])return u;const S=re.convert(a)._mult(x);d==="viewport"&&S._rotate(-m);const T=[];for(let L=0;Lu.width||x.height>u.height||d.x>u.width-x.width||d.y>u.height-x.height)throw new RangeError("out of range source coordinates for image copy");if(x.width>a.width||x.height>a.height||m.x>a.width-x.width||m.y>a.height-x.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{a[u.evaluationKey]=F;const j=u.expression.evaluate(a);x.data[T+L+0]=Math.floor(255*j.r/j.a),x.data[T+L+1]=Math.floor(255*j.g/j.a),x.data[T+L+2]=Math.floor(255*j.b/j.a),x.data[T+L+3]=Math.floor(255*j.a)};if(u.clips)for(let T=0,L=0;T80*d){m=S=u[0],x=T=u[1];for(var pe=d;peS&&(S=L),F>T&&(T=F);j=(j=Math.max(S-m,T-x))!==0?32767/j:0}return ih(ue,he,d,m,x,j,0),he}function A3(u,a,d,m,x){var S,T;if(x===j1(u,a,d,m)>0)for(S=a;S=a;S-=m)T=D3(S,u[S],u[S+1],T);return T&&rv(T,T.next)&&(ah(T),T=T.next),T}function Uu(u,a){if(!u)return u;a||(a=u);var d,m=u;do if(d=!1,m.steiner||!rv(m,m.next)&&Qr(m.prev,m,m.next)!==0)m=m.next;else{if(ah(m),(m=a=m.prev)===m.next)break;d=!0}while(d||m!==a);return a}function ih(u,a,d,m,x,S,T){if(u){!T&&S&&function(X,ne,ue,he){var pe=X;do pe.z===0&&(pe.z=V1(pe.x,pe.y,ne,ue,he)),pe.prevZ=pe.prev,pe.nextZ=pe.next,pe=pe.next;while(pe!==X);pe.prevZ.nextZ=null,pe.prevZ=null,function(Ae){var Ie,Ze,st,Ke,rt,kt,St,un,pn=1;do{for(Ze=Ae,Ae=null,rt=null,kt=0;Ze;){for(kt++,st=Ze,St=0,Ie=0;Ie0||un>0&&st;)St!==0&&(un===0||!st||Ze.z<=st.z)?(Ke=Ze,Ze=Ze.nextZ,St--):(Ke=st,st=st.nextZ,un--),rt?rt.nextZ=Ke:Ae=Ke,Ke.prevZ=rt,rt=Ke;Ze=st}rt.nextZ=null,pn*=2}while(kt>1)}(pe)}(u,m,x,S);for(var L,F,j=u;u.prev!==u.next;)if(L=u.prev,F=u.next,S?V9(u,m,x,S):B9(u))a.push(L.i/d|0),a.push(u.i/d|0),a.push(F.i/d|0),ah(u),u=F.next,j=F.next;else if((u=F)===j){T?T===1?ih(u=U9(Uu(u),a,d),a,d,m,x,S,2):T===2&&j9(u,a,d,m,x,S):ih(Uu(u),a,d,m,x,S,1);break}}}function B9(u){var a=u.prev,d=u,m=u.next;if(Qr(a,d,m)>=0)return!1;for(var x=a.x,S=d.x,T=m.x,L=a.y,F=d.y,j=m.y,X=xS?x>T?x:T:S>T?S:T,he=L>F?L>j?L:j:F>j?F:j,pe=m.next;pe!==a;){if(pe.x>=X&&pe.x<=ue&&pe.y>=ne&&pe.y<=he&&Qc(x,L,S,F,T,j,pe.x,pe.y)&&Qr(pe.prev,pe,pe.next)>=0)return!1;pe=pe.next}return!0}function V9(u,a,d,m){var x=u.prev,S=u,T=u.next;if(Qr(x,S,T)>=0)return!1;for(var L=x.x,F=S.x,j=T.x,X=x.y,ne=S.y,ue=T.y,he=LF?L>j?L:j:F>j?F:j,Ie=X>ne?X>ue?X:ue:ne>ue?ne:ue,Ze=V1(he,pe,a,d,m),st=V1(Ae,Ie,a,d,m),Ke=u.prevZ,rt=u.nextZ;Ke&&Ke.z>=Ze&&rt&&rt.z<=st;){if(Ke.x>=he&&Ke.x<=Ae&&Ke.y>=pe&&Ke.y<=Ie&&Ke!==x&&Ke!==T&&Qc(L,X,F,ne,j,ue,Ke.x,Ke.y)&&Qr(Ke.prev,Ke,Ke.next)>=0||(Ke=Ke.prevZ,rt.x>=he&&rt.x<=Ae&&rt.y>=pe&&rt.y<=Ie&&rt!==x&&rt!==T&&Qc(L,X,F,ne,j,ue,rt.x,rt.y)&&Qr(rt.prev,rt,rt.next)>=0))return!1;rt=rt.nextZ}for(;Ke&&Ke.z>=Ze;){if(Ke.x>=he&&Ke.x<=Ae&&Ke.y>=pe&&Ke.y<=Ie&&Ke!==x&&Ke!==T&&Qc(L,X,F,ne,j,ue,Ke.x,Ke.y)&&Qr(Ke.prev,Ke,Ke.next)>=0)return!1;Ke=Ke.prevZ}for(;rt&&rt.z<=st;){if(rt.x>=he&&rt.x<=Ae&&rt.y>=pe&&rt.y<=Ie&&rt!==x&&rt!==T&&Qc(L,X,F,ne,j,ue,rt.x,rt.y)&&Qr(rt.prev,rt,rt.next)>=0)return!1;rt=rt.nextZ}return!0}function U9(u,a,d){var m=u;do{var x=m.prev,S=m.next.next;!rv(x,S)&&O3(x,m,m.next,S)&&oh(x,S)&&oh(S,x)&&(a.push(x.i/d|0),a.push(m.i/d|0),a.push(S.i/d|0),ah(m),ah(m.next),m=u=S),m=m.next}while(m!==u);return Uu(m)}function j9(u,a,d,m,x,S){var T=u;do{for(var L=T.next.next;L!==T.prev;){if(T.i!==L.i&&q9(T,L)){var F=N3(T,L);return T=Uu(T,T.next),F=Uu(F,F.next),ih(T,a,d,m,x,S,0),void ih(F,a,d,m,x,S,0)}L=L.next}T=T.next}while(T!==u)}function K9(u,a){return u.x-a.x}function H9(u,a){var d=function(x,S){var T,L=S,F=x.x,j=x.y,X=-1/0;do{if(j<=L.y&&j>=L.next.y&&L.next.y!==L.y){var ne=L.x+(j-L.y)*(L.next.x-L.x)/(L.next.y-L.y);if(ne<=F&&ne>X&&(X=ne,T=L.x=L.x&&L.x>=pe&&F!==L.x&&Qc(jT.x||L.x===T.x&&W9(T,L)))&&(T=L,Ie=ue)),L=L.next;while(L!==he);return T}(u,a);if(!d)return a;var m=N3(d,u);return Uu(m,m.next),Uu(d,d.next)}function W9(u,a){return Qr(u.prev,u,a.prev)<0&&Qr(a.next,u,u.next)<0}function V1(u,a,d,m,x){return(u=1431655765&((u=858993459&((u=252645135&((u=16711935&((u=(u-d)*x|0)|u<<8))|u<<4))|u<<2))|u<<1))|(a=1431655765&((a=858993459&((a=252645135&((a=16711935&((a=(a-m)*x|0)|a<<8))|a<<4))|a<<2))|a<<1))<<1}function G9(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)>=(x-T)*(m-L)}function q9(u,a){return u.next.i!==a.i&&u.prev.i!==a.i&&!function(d,m){var x=d;do{if(x.i!==d.i&&x.next.i!==d.i&&x.i!==m.i&&x.next.i!==m.i&&O3(x,x.next,d,m))return!0;x=x.next}while(x!==d);return!1}(u,a)&&(oh(u,a)&&oh(a,u)&&function(d,m){var x=d,S=!1,T=(d.x+m.x)/2,L=(d.y+m.y)/2;do x.y>L!=x.next.y>L&&x.next.y!==x.y&&T<(x.next.x-x.x)*(L-x.y)/(x.next.y-x.y)+x.x&&(S=!S),x=x.next;while(x!==d);return S}(u,a)&&(Qr(u.prev,u,a.prev)||Qr(u,a.prev,a))||rv(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 rv(u,a){return u.x===a.x&&u.y===a.y}function O3(u,a,d,m){var x=ov(Qr(u,a,d)),S=ov(Qr(u,a,m)),T=ov(Qr(d,m,u)),L=ov(Qr(d,m,a));return x!==S&&T!==L||!(x!==0||!iv(u,d,a))||!(S!==0||!iv(u,m,a))||!(T!==0||!iv(d,u,m))||!(L!==0||!iv(d,a,m))}function iv(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 ov(u){return u>0?1:u<0?-1:0}function oh(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 N3(u,a){var d=new U1(u.i,u.x,u.y),m=new U1(a.i,a.x,a.y),x=u.next,S=a.prev;return u.next=a,a.prev=u,d.next=x,x.prev=d,m.next=d,d.prev=m,S.next=m,m.prev=S,m}function D3(u,a,d,m){var x=new U1(u,a,d);return m?(x.next=m.next,x.prev=m,m.next.prev=x,m.next=x):(x.prev=x,x.next=x),x}function ah(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 U1(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 j1(u,a,d,m){for(var x=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),j=.5*Math.sqrt(L*F*(S-F)/S)*(T-S/2<0?-1:1);L3(u,a,Math.max(d,Math.floor(a-T*F/S+j)),Math.min(m,Math.floor(a+(S-T)*F/S+j)),x)}var X=u[a],ne=d,ue=m;for(sh(u,d,a),x(u[m],X)>0&&sh(u,d,m);ne0;)ue--}x(u[d],X)===0?sh(u,d,ue):sh(u,++ue,m),ue<=a&&(d=ue+1),a<=ue&&(m=ue-1)}}function sh(u,a,d){var m=u[a];u[a]=u[d],u[d]=m}function X9(u,a){return ua?1:0}function K1(u,a){const d=u.length;if(d<=1)return[u];const m=[];let x,S;for(let T=0;T1)for(let T=0;T0&&d.holes.push(m+=u[x-1].length)}return d};class G1{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 dr,this.indexArray=new Qi,this.indexArray2=new Ma,this.programConfigurations=new $u(a.layers,a.zoom),this.segments=new Hn,this.segments2=new Hn,this.stateDependentLayerIds=this.layers.filter(d=>d.isStateDependent()).map(d=>d.id)}populate(a,d,m){this.hasPattern=H1("fill",this.layers,d);const x=this.layers[0].layout.get("fill-sort-key"),S=!x.isConstant(),T=[];for(const{feature:L,id:F,index:j,sourceLayerIndex:X}of a){const ne=this.layers[0]._featureFilter.needGeometry,ue=Vu(L,ne);if(!this.layers[0]._featureFilter.filter(new Rr(this.zoom),ue,m))continue;const he=S?x.evaluate(ue,{},m,d.availableImages):void 0,pe={id:F,properties:L.properties,type:L.type,sourceLayerIndex:X,index:j,geometry:ne?ue.geometry:Bu(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:j,sourceLayerIndex:X}=L;if(this.hasPattern){const ne=W1("fill",this.layers,L,this.zoom,d);this.patternFeatures.push(ne)}else this.addFeature(L,F,j,m,{});d.featureIndex.insert(a[j].feature,F,j,X,this.index)}}update(a,d,m){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(a,d,this.stateDependentLayers,m)}addFeatures(a,d,m){for(const x of this.patternFeatures)this.addFeature(x,x.geometry,x.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,$9),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,x,S){for(const T of K1(d,500)){let L=0;for(const he of T)L+=he.length;const F=this.segments.prepareSegment(L,this.layoutVertexArray,this.indexArray),j=F.vertexLength,X=[],ne=[];for(const he of T){if(he.length===0)continue;he!==T[0]&&ne.push(X.length/2);const pe=this.segments2.prepareSegment(he.length,this.layoutVertexArray,this.indexArray2),Ae=pe.vertexLength;this.layoutVertexArray.emplaceBack(he[0].x,he[0].y),this.indexArray2.emplaceBack(Ae+he.length-1,Ae),X.push(he[0].x),X.push(he[0].y);for(let Ie=1;Ie>3}if(x--,m===1||m===2)S+=u.readSVarint(),T+=u.readSVarint(),m===1&&(a&&L.push(a),a=[]),a.push(new rD(S,T));else{if(m!==7)throw new Error("unknown command "+m);a&&a.push(a[0].clone())}}return a&&L.push(a),L},Jc.prototype.bbox=function(){var u=this._pbf;u.pos=this._geometry;for(var a=u.readVarint()+u.pos,d=1,m=0,x=0,S=0,T=1/0,L=-1/0,F=1/0,j=-1/0;u.pos>3}if(m--,d===1||d===2)(x+=u.readSVarint())L&&(L=x),(S+=u.readSVarint())j&&(j=S);else if(d!==7)throw new Error("unknown command "+d)}return[T,F,L,j]},Jc.prototype.toGeoJSON=function(u,a,d){var m,x,S=this.extent*Math.pow(2,d),T=this.extent*u,L=this.extent*a,F=this.loadGeometry(),j=Jc.types[this.type];function X(he){for(var pe=0;pe>3;x=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 x}(d))}$3.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 aD(this._pbf,a,this.extent,this._keys,this._values)};var lD=F3;function uD(u,a,d){if(u===3){var m=new lD(d,d.readVarint()+d.pos);m.length&&(a[m.name]=m)}}wl.VectorTile=function(u,a){this.layers=u.readFields(uD,{},a)},wl.VectorTileFeature=z3,wl.VectorTileLayer=F3;const cD=wl.VectorTileFeature.types,q1=Math.pow(2,13);function lh(u,a,d,m,x,S,T,L){u.emplaceBack(a,d,2*Math.floor(m*q1)+T,x*q1*2,S*q1*2,Math.round(L))}class Z1{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 Qn,this.centroidVertexArray=new bn,this.indexArray=new Qi,this.programConfigurations=new $u(a.layers,a.zoom),this.segments=new Hn,this.stateDependentLayerIds=this.layers.filter(d=>d.isStateDependent()).map(d=>d.id)}populate(a,d,m){this.features=[],this.hasPattern=H1("fill-extrusion",this.layers,d);for(const{feature:x,id:S,index:T,sourceLayerIndex:L}of a){const F=this.layers[0]._featureFilter.needGeometry,j=Vu(x,F);if(!this.layers[0]._featureFilter.filter(new Rr(this.zoom),j,m))continue;const X={id:S,sourceLayerIndex:L,index:T,geometry:F?j.geometry:Bu(x),properties:x.properties,type:x.type,patterns:{}};this.hasPattern?this.features.push(W1("fill-extrusion",this.layers,X,this.zoom,d)):this.addFeature(X,X.geometry,T,m,{}),d.featureIndex.insert(x,X.geometry,T,L,this.index,!0)}}addFeatures(a,d,m){for(const x of this.features){const{geometry:S}=x;this.addFeature(x,S,x.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,nD),this.centroidVertexBuffer=a.createVertexBuffer(this.centroidVertexArray,tD.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,x,S){const T={x:0,y:0,vertexCount:0};for(const L of K1(d,500)){let F=0;for(const pe of L)F+=pe.length;let j=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const pe of L){if(pe.length===0||fD(pe))continue;let Ae=0;for(let Ie=0;Ie=1){const st=pe[Ie-1];if(!dD(Ze,st)){j.vertexLength+4>Hn.MAX_VERTEX_ARRAY_LENGTH&&(j=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const Ke=Ze.sub(st)._perp()._unit(),rt=st.dist(Ze);Ae+rt>32768&&(Ae=0),lh(this.layoutVertexArray,Ze.x,Ze.y,Ke.x,Ke.y,0,0,Ae),lh(this.layoutVertexArray,Ze.x,Ze.y,Ke.x,Ke.y,0,1,Ae),T.x+=2*Ze.x,T.y+=2*Ze.y,T.vertexCount+=2,Ae+=rt,lh(this.layoutVertexArray,st.x,st.y,Ke.x,Ke.y,0,0,Ae),lh(this.layoutVertexArray,st.x,st.y,Ke.x,Ke.y,0,1,Ae),T.x+=2*st.x,T.y+=2*st.y,T.vertexCount+=2;const kt=j.vertexLength;this.indexArray.emplaceBack(kt,kt+2,kt+1),this.indexArray.emplaceBack(kt+1,kt+2,kt+3),j.vertexLength+=4,j.primitiveLength+=2}}}}if(j.vertexLength+F>Hn.MAX_VERTEX_ARRAY_LENGTH&&(j=this.segments.prepareSegment(F,this.layoutVertexArray,this.indexArray)),cD[a.type]!=="Polygon")continue;const X=[],ne=[],ue=j.vertexLength;for(const pe of L)if(pe.length!==0){pe!==L[0]&&ne.push(X.length/2);for(let Ae=0;Aedi)||u.y===a.y&&(u.y<0||u.y>di)}function fD(u){return u.every(a=>a.x<0)||u.every(a=>a.x>di)||u.every(a=>a.y<0)||u.every(a=>a.y>di)}fn("FillExtrusionBucket",Z1,{omit:["layers","features"]});var hD={paint:new Ti({"fill-extrusion-opacity":new mn(Fe["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new En(Fe["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new mn(Fe["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new mn(Fe["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new xl(Fe["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new En(Fe["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new En(Fe["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new mn(Fe["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})};function uh(u,a){return u.x*a.x+u.y*a.y}function B3(u,a){if(u.length===1){let d=0;const m=a[d++];let x;for(;!x||m.equals(x);)if(x=a[d++],!x)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 er,this.layoutVertexArray2=new pr,this.indexArray=new Qi,this.programConfigurations=new $u(a.layers,a.zoom),this.segments=new Hn,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(d=>d.isStateDependent()).map(d=>d.id)}populate(a,d,m){this.hasPattern=H1("line",this.layers,d);const x=this.layers[0].layout.get("line-sort-key"),S=!x.isConstant(),T=[];for(const{feature:L,id:F,index:j,sourceLayerIndex:X}of a){const ne=this.layers[0]._featureFilter.needGeometry,ue=Vu(L,ne);if(!this.layers[0]._featureFilter.filter(new Rr(this.zoom),ue,m))continue;const he=S?x.evaluate(ue,{},m):void 0,pe={id:F,properties:L.properties,type:L.type,sourceLayerIndex:X,index:j,geometry:ne?ue.geometry:Bu(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:j,sourceLayerIndex:X}=L;if(this.hasPattern){const ne=W1("line",this.layers,L,this.zoom,d);this.patternFeatures.push(ne)}else this.addFeature(L,F,j,m,{});d.featureIndex.insert(a[j].feature,F,j,X,this.index)}}update(a,d,m){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(a,d,this.stateDependentLayers,m)}addFeatures(a,d,m){for(const x of this.patternFeatures)this.addFeature(x,x.geometry,x.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,gD)),this.layoutVertexBuffer=a.createVertexBuffer(this.layoutVertexArray,mD),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,x,S){const T=this.layers[0].layout,L=T.get("line-join").evaluate(a,{}),F=T.get("line-cap"),j=T.get("line-miter-limit"),X=T.get("line-round-limit");this.lineClips=this.lineFeatureClips(a);for(const ne of d)this.addLine(ne,a,L,F,j,X);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,a,m,S,x)}addLine(a,d,m,x,S,T){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let Ze=0;Ze=2&&a[F-1].equals(a[F-2]);)F--;let j=0;for(;j0;if(un&&Ze>j){const Ht=ue.dist(he);if(Ht>2*X){const tn=ue.sub(ue.sub(he)._mult(X/Ht)._round());this.updateDistance(he,tn),this.addCurrentVertex(tn,Ae,0,0,ne),he=tn}}const en=he&&pe;let Zt=en?m:L?"butt":x;if(en&&Zt==="round"&&(ktS&&(Zt="bevel"),Zt==="bevel"&&(kt>2&&(Zt="flipbevel"),kt100)st=Ie.mult(-1);else{const Ht=kt*Ae.add(Ie).mag()/Ae.sub(Ie).mag();st._perp()._mult(Ht*(pn?-1:1))}this.addCurrentVertex(ue,st,0,0,ne),this.addCurrentVertex(ue,st.mult(-1),0,0,ne)}else if(Zt==="bevel"||Zt==="fakeround"){const Ht=-Math.sqrt(kt*kt-1),tn=pn?Ht:0,Yt=pn?0:Ht;if(he&&this.addCurrentVertex(ue,Ae,tn,Yt,ne),Zt==="fakeround"){const Ft=Math.round(180*St/Math.PI/20);for(let wn=1;wn2*X){const tn=ue.add(pe.sub(ue)._mult(X/Ht)._round());this.updateDistance(ue,tn),this.addCurrentVertex(tn,Ie,0,0,ne),ue=tn}}}}addCurrentVertex(a,d,m,x,S,T=!1){const L=d.y*x-d.x,F=-d.y-d.x*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,-x,S),this.distance>V3/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(a,d,m,x,S,T))}addHalfVertex({x:a,y:d},m,x,S,T,L,F){const j=.5*(this.lineClips?this.scaledDistance*(V3-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((a<<1)+(S?1:0),(d<<1)+(T?1:0),Math.round(63*m)+128,Math.round(63*x)+128,1+(L===0?0:L<0?-1:1)|(63&j)<<2,j>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const X=F.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,X),F.primitiveLength++),T?this.e2=X:this.e1=X}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(a,d){this.distance+=a.dist(d),this.updateScaledDistance()}}fn("LineBucket",X1,{omit:["layers","patternFeatures"]});const _D=new Ti({"line-cap":new mn(Fe.layout_line["line-cap"]),"line-join":new En(Fe.layout_line["line-join"]),"line-miter-limit":new mn(Fe.layout_line["line-miter-limit"]),"line-round-limit":new mn(Fe.layout_line["line-round-limit"]),"line-sort-key":new En(Fe.layout_line["line-sort-key"])});var U3={paint:new Ti({"line-opacity":new En(Fe.paint_line["line-opacity"]),"line-color":new En(Fe.paint_line["line-color"]),"line-translate":new mn(Fe.paint_line["line-translate"]),"line-translate-anchor":new mn(Fe.paint_line["line-translate-anchor"]),"line-width":new En(Fe.paint_line["line-width"]),"line-gap-width":new En(Fe.paint_line["line-gap-width"]),"line-offset":new En(Fe.paint_line["line-offset"]),"line-blur":new En(Fe.paint_line["line-blur"]),"line-dasharray":new Xf(Fe.paint_line["line-dasharray"]),"line-pattern":new xl(Fe.paint_line["line-pattern"]),"line-gradient":new Ya(Fe.paint_line["line-gradient"])}),layout:_D};const j3=new class extends En{possiblyEvaluate(u,a){return a=new Rr(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=I({},a,{zoom:Math.floor(a.zoom)}),super.evaluate(u,a,d,m)}}(U3.paint.properties["line-width"].specification);function K3(u,a){return a>0?a+2*u:u}j3.useIntegerZoom=!0;const bD=ni([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),wD=ni([{name:"a_projected_pos",components:3,type:"Float32"}],4);ni([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const CD=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 H3=ni([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),SD=ni([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function ED(u,a,d){return u.sections.forEach(m=>{m.text=function(x,S,T){const L=S.layout.get("text-transform").evaluate(T,{});return L==="uppercase"?x=x.toLocaleUpperCase():L==="lowercase"&&(x=x.toLocaleLowerCase()),ko.applyArabicShaping&&(x=ko.applyArabicShaping(x)),x}(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 Pi=24,Y1=yr,W3=function(u,a,d,m,x){var S,T,L=8*x-m-1,F=(1<>1,X=-7,ne=d?x-1:0,ue=d?-1:1,he=u[a+ne];for(ne+=ue,S=he&(1<<-X)-1,he>>=-X,X+=L;X>0;S=256*S+u[a+ne],ne+=ue,X-=8);for(T=S&(1<<-X)-1,S>>=-X,X+=m;X>0;T=256*T+u[a+ne],ne+=ue,X-=8);if(S===0)S=1-j;else{if(S===F)return T?NaN:1/0*(he?-1:1);T+=Math.pow(2,m),S-=j}return(he?-1:1)*T*Math.pow(2,S-m)},G3=function(u,a,d,m,x,S){var T,L,F,j=8*S-x-1,X=(1<>1,ue=x===23?Math.pow(2,-24)-Math.pow(2,-77):0,he=m?0:S-1,pe=m?1:-1,Ae=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=X):(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>=X?(L=0,T=X):T+ne>=1?(L=(a*F-1)*Math.pow(2,x),T+=ne):(L=a*Math.pow(2,ne-1)*Math.pow(2,x),T=0));x>=8;u[d+he]=255&L,he+=pe,L/=256,x-=8);for(T=T<0;u[d+he]=255&T,he+=pe,T/=256,j-=8);u[d+he-pe]|=128*Ae};function yr(u){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(u)?u:new Uint8Array(u||0),this.pos=0,this.type=0,this.length=this.buf.length}yr.Varint=0,yr.Fixed64=1,yr.Bytes=2,yr.Fixed32=5;var Cl,Q1=4294967296,q3=1/Q1,Z3=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function Is(u){return u.type===yr.Bytes?u.readVarint()+u.pos:u.pos+1}function ed(u,a,d){return d?4294967296*a+(u>>>0):4294967296*(a>>>0)+(u>>>0)}function X3(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 x=d.pos-1;x>=u;x--)d.buf[x+m]=d.buf[x]}function kD(u,a){for(var d=0;d>>8,u[d+2]=a>>>16,u[d+3]=a>>>24}function Y3(u,a){return(u[a]|u[a+1]<<8|u[a+2]<<16)+(u[a+3]<<24)}function DD(u,a,d){u===1&&d.readMessage(LD,a)}function LD(u,a,d){if(u===3){const{id:m,bitmap:x,width:S,height:T,left:L,top:F,advance:j}=d.readMessage(zD,{});a.push({id:m,bitmap:new rh({width:S+6,height:T+6},x),metrics:{width:S,height:T,left:L,top:F,advance:j}})}}function zD(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 Q3(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 x=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),x=Math.max(x,T.x+T.w),T.w===F.w&&T.h===F.h){const j=m.pop();L>3,S=this.pos;this.type=7&m,u(x,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=av(this.buf,this.pos);return this.pos+=4,u},readSFixed32:function(){var u=Y3(this.buf,this.pos);return this.pos+=4,u},readFixed64:function(){var u=av(this.buf,this.pos)+av(this.buf,this.pos+4)*Q1;return this.pos+=8,u},readSFixed64:function(){var u=av(this.buf,this.pos)+Y3(this.buf,this.pos+4)*Q1;return this.pos+=8,u},readFloat:function(){var u=W3(this.buf,this.pos,!0,23,4);return this.pos+=4,u},readDouble:function(){var u=W3(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(x,S,T){var L,F,j=T.buf;if(L=(112&(F=j[T.pos++]))>>4,F<128||(L|=(127&(F=j[T.pos++]))<<3,F<128)||(L|=(127&(F=j[T.pos++]))<<10,F<128)||(L|=(127&(F=j[T.pos++]))<<17,F<128)||(L|=(127&(F=j[T.pos++]))<<24,F<128)||(L|=(1&(F=j[T.pos++]))<<31,F<128))return ed(x,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&&Z3?function(d,m,x){return Z3.decode(d.subarray(m,x))}(this.buf,a,u):function(d,m,x){for(var S="",T=m;T239?4:X>223?3:X>191?2:1;if(T+ue>x)break;ue===1?X<128&&(ne=X):ue===2?(192&(L=d[T+1]))==128&&(ne=(31&X)<<6|63&L)<=127&&(ne=null):ue===3?(F=d[T+2],(192&(L=d[T+1]))==128&&(192&F)==128&&((ne=(15&X)<<12|(63&L)<<6|63&F)<=2047||ne>=55296&&ne<=57343)&&(ne=null)):ue===4&&(F=d[T+2],j=d[T+3],(192&(L=d[T+1]))==128&&(192&F)==128&&(192&j)==128&&((ne=(15&X)<<18|(63&L)<<12|(63&F)<<6|63&j)<=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!==yr.Bytes)return u.push(this.readVarint(a));var d=Is(this);for(u=u||[];this.pos127;);else if(a===yr.Bytes)this.pos=this.readVarint()+this.pos;else if(a===yr.Fixed32)this.pos+=4;else{if(a!==yr.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,x;if(a>=0?(m=a%4294967296|0,x=a/4294967296|0):(x=~(-a/4294967296),4294967295^(m=~(-a%4294967296))?m=m+1|0:(m=0,x=x+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)))))}(x,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,x,S){for(var T,L,F=0;F55295&&T<57344){if(!L){T>56319||F+1===x.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&&X3(a,d,this),this.pos=a-1,this.writeVarint(d),this.pos+=d},writeFloat:function(u){this.realloc(4),G3(this.buf,u,this.pos,!0,23,4),this.pos+=4},writeDouble:function(u){this.realloc(8),G3(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&&X3(d,m,this),this.pos=d-1,this.writeVarint(m),this.pos+=m},writeMessage:function(u,a,d){this.writeTag(u,yr.Bytes),this.writeRawMessage(a,d)},writePackedVarint:function(u,a){a.length&&this.writeMessage(u,kD,a)},writePackedSVarint:function(u,a){a.length&&this.writeMessage(u,TD,a)},writePackedBoolean:function(u,a){a.length&&this.writeMessage(u,MD,a)},writePackedFloat:function(u,a){a.length&&this.writeMessage(u,PD,a)},writePackedDouble:function(u,a){a.length&&this.writeMessage(u,ID,a)},writePackedFixed32:function(u,a){a.length&&this.writeMessage(u,RD,a)},writePackedSFixed32:function(u,a){a.length&&this.writeMessage(u,AD,a)},writePackedFixed64:function(u,a){a.length&&this.writeMessage(u,OD,a)},writePackedSFixed64:function(u,a){a.length&&this.writeMessage(u,ND,a)},writeBytesField:function(u,a){this.writeTag(u,yr.Bytes),this.writeBytes(a)},writeFixed32Field:function(u,a){this.writeTag(u,yr.Fixed32),this.writeFixed32(a)},writeSFixed32Field:function(u,a){this.writeTag(u,yr.Fixed32),this.writeSFixed32(a)},writeFixed64Field:function(u,a){this.writeTag(u,yr.Fixed64),this.writeFixed64(a)},writeSFixed64Field:function(u,a){this.writeTag(u,yr.Fixed64),this.writeSFixed64(a)},writeVarintField:function(u,a){this.writeTag(u,yr.Varint),this.writeVarint(a)},writeSVarintField:function(u,a){this.writeTag(u,yr.Varint),this.writeSVarint(a)},writeStringField:function(u,a){this.writeTag(u,yr.Bytes),this.writeString(a)},writeFloatField:function(u,a){this.writeTag(u,yr.Fixed32),this.writeFloat(a)},writeDoubleField:function(u,a){this.writeTag(u,yr.Fixed64),this.writeDouble(a)},writeBooleanField:function(u,a){this.writeVarintField(u,Boolean(a))}};class J1{constructor(a,{pixelRatio:d,version:m,stretchX:x,stretchY:S,content:T}){this.paddedRect=a,this.pixelRatio=d,this.stretchX=x,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 J3{constructor(a,d){const m={},x={};this.haveRenderCallbacks=[];const S=[];this.addImages(a,m,S),this.addImages(d,x,S);const{w:T,h:L}=Q3(S),F=new $o({width:T||1,height:L||1});for(const j in a){const X=a[j],ne=m[j].paddedRect;$o.copy(X.data,F,{x:0,y:0},{x:ne.x+1,y:ne.y+1},X.data)}for(const j in d){const X=d[j],ne=x[j].paddedRect,ue=ne.x+1,he=ne.y+1,pe=X.data.width,Ae=X.data.height;$o.copy(X.data,F,{x:0,y:0},{x:ue,y:he},X.data),$o.copy(X.data,F,{x:0,y:Ae-1},{x:ue,y:he-1},{width:pe,height:1}),$o.copy(X.data,F,{x:0,y:0},{x:ue,y:he+Ae},{width:pe,height:1}),$o.copy(X.data,F,{x:pe-1,y:0},{x:ue-1,y:he},{width:1,height:Ae}),$o.copy(X.data,F,{x:0,y:0},{x:ue+pe,y:he},{width:1,height:Ae})}this.image=F,this.iconPositions=m,this.patternPositions=x}addImages(a,d,m){for(const x in a){const S=a[x],T={x:0,y:0,w:S.data.width+2,h:S.data.height+2};m.push(T),d[x]=new J1(T,S),S.hasRenderCallback&&this.haveRenderCallbacks.push(x)}}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[x,S]=a.tl;m.update(d.data,void 0,{x,y:S})}}fn("ImagePosition",J1),fn("ImageAtlas",J3),o.WritingMode=void 0,(Cl=o.WritingMode||(o.WritingMode={}))[Cl.none=0]="none",Cl[Cl.horizontal=1]="horizontal",Cl[Cl.vertical=2]="vertical",Cl[Cl.horizontalOnly=3]="horizontalOnly";const sv=-17;class dh{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(a,d){const m=new dh;return m.scale=a||1,m.fontStack=d,m}static forImage(a){const d=new dh;return d.imageName=a,d}}class nd{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(a,d){const m=new nd;for(let x=0;x=0&&m>=a&&uv[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 nd;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(dh.forText(a.scale,a.fontStack||d));const m=this.sections.length-1;for(let x=0;x=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function lv(u,a,d,m,x,S,T,L,F,j,X,ne,ue,he,pe,Ae){const Ie=nd.fromFeature(u,x);let Ze;ne===o.WritingMode.vertical&&Ie.verticalizePunctuation();const{processBidirectionalText:st,processStyledBidirectionalText:Ke}=ko;if(st&&Ie.sections.length===1){Ze=[];const St=st(Ie.toString(),ex(Ie,j,S,a,m,he,pe));for(const un of St){const pn=new nd;pn.text=un,pn.sections=Ie.sections;for(let en=0;en0&&As>po&&(po=As)}else{const Uo=pn[Wn.fontStack],mo=Uo&&Uo[zi];if(mo&&mo.rect)Aa=mo.rect,la=mo.metrics;else{const As=un[Wn.fontStack],ph=As&&As[zi];if(!ph)continue;la=ph.metrics}Hi=(Li-Wn.scale)*Pi}ua?(St.verticalizable=!0,ho.push({glyph:zi,imageName:Oa,x:kr,y:Or+Hi,vertical:ua,scale:Wn.scale,fontStack:Wn.fontStack,sectionIndex:Io,metrics:la,rect:Aa}),kr+=Rs*Wn.scale+wn):(ho.push({glyph:zi,imageName:Oa,x:kr,y:Or+Hi,vertical:ua,scale:Wn.scale,fontStack:Wn.fontStack,sectionIndex:Io,metrics:la,rect:Aa}),kr+=la.advance*Wn.scale+wn)}ho.length!==0&&(fi=Math.max(kr-wn,fi),BD(ho,0,ho.length-1,Ni,po)),kr=0;const zr=Ht*Li+po;to.lineOffset=Math.max(po,Ki),Or+=zr,Vo=Math.max(zr,Vo),++ri}var xi;const Di=Or-sv,{horizontalAlign:ji,verticalAlign:fo}=tx(tn);(function(ii,Li,Ki,to,ho,po,zr,_i,Wn){const Io=(Li-Ki)*ho;let zi=0;zi=po!==zr?-_i*to-sv:(-to*Wn+.5)*zr;for(const Hi of ii)for(const la of Hi.positionedGlyphs)la.x+=Io,la.y+=zi})(St.positionedLines,Ni,ji,fo,fi,Vo,Ht,Di,Zt.length),St.top+=-fo*Di,St.bottom=St.top+Di,St.left+=-ji*fi,St.right=St.left+fi}(kt,a,d,m,Ze,T,L,F,ne,j,ue,Ae),!function(St){for(const un of St)if(un.positionedGlyphs.length!==0)return!1;return!0}(rt)&&kt}const uv={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},FD={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 eS(u,a,d,m,x,S){if(a.imageName){const T=m[a.imageName];return T?T.displaySize[0]*a.scale*Pi/S+x:0}{const T=d[a.fontStack],L=T&&T[u];return L?L.metrics.advance*a.scale+x:0}}function tS(u,a,d,m){const x=Math.pow(u-a,2);return m?u=0;let X=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 j=0;for(;Lm;)j-=F.shift().angleDelta;if(j>x)return!1;T++,L+=X.dist(ne)}return!0}function sS(u){let a=0;for(let d=0;dj){const pe=(j-F)/he,Ae=gr(ne.x,ue.x,pe),Ie=gr(ne.y,ue.y,pe),Ze=new Sl(Ae,Ie,ue.angleTo(ne),X);return Ze._round(),!T||aS(u,Ze,L,T,a)?Ze:void 0}F+=he}}function jD(u,a,d,m,x,S,T,L,F){const j=lS(m,S,T),X=uS(m,x),ne=X*T,ue=u[0].x===0||u[0].x===F||u[0].y===0||u[0].y===F;return a-ne=0&&rt=0&&kt=0&&ue+j<=X){const St=new Sl(rt,kt,st,pe);St._round(),m&&!aS(u,St,S,m,x)||he.push(St)}}ne+=Ze}return L||he.length||T||(he=cS(u,ne/2,d,m,x,S,T,!0,F)),he}function dS(u,a,d,m,x){const S=[];for(let T=0;T=m&&ne.x>=m||(X.x>=m?X=new re(m,X.y+(m-X.x)/(ne.x-X.x)*(ne.y-X.y))._round():ne.x>=m&&(ne=new re(m,X.y+(m-X.x)/(ne.x-X.x)*(ne.y-X.y))._round()),X.y>=x&&ne.y>=x||(X.y>=x?X=new re(X.x+(x-X.y)/(ne.y-X.y)*(ne.x-X.x),x)._round():ne.y>=x&&(ne=new re(X.x+(x-X.y)/(ne.y-X.y)*(ne.x-X.x),x)._round()),F&&X.equals(F[F.length-1])||(F=[X],S.push(F)),F.push(ne)))))}}return S}function fS(u,a,d,m){const x=[],S=u.image,T=S.pixelRatio,L=S.paddedRect.w-2,F=S.paddedRect.h-2,j=u.right-u.left,X=u.bottom-u.top,ne=S.stretchX||[[0,L]],ue=S.stretchY||[[0,F]],he=(Ht,tn)=>Ht+tn[1]-tn[0],pe=ne.reduce(he,0),Ae=ue.reduce(he,0),Ie=L-pe,Ze=F-Ae;let st=0,Ke=pe,rt=0,kt=Ae,St=0,un=Ie,pn=0,en=Ze;if(S.content&&m){const Ht=S.content;st=cv(ne,0,Ht[0]),rt=cv(ue,0,Ht[1]),Ke=cv(ne,Ht[0],Ht[2]),kt=cv(ue,Ht[1],Ht[3]),St=Ht[0]-st,pn=Ht[1]-rt,un=Ht[2]-Ht[0]-Ke,en=Ht[3]-Ht[1]-kt}const Zt=(Ht,tn,Yt,Ft)=>{const wn=dv(Ht.stretch-st,Ke,j,u.left),vn=fv(Ht.fixed-St,un,Ht.stretch,pe),Un=dv(tn.stretch-rt,kt,X,u.top),kr=fv(tn.fixed-pn,en,tn.stretch,Ae),Or=dv(Yt.stretch-st,Ke,j,u.left),fi=fv(Yt.fixed-St,un,Yt.stretch,pe),Vo=dv(Ft.stretch-rt,kt,X,u.top),Ni=fv(Ft.fixed-pn,en,Ft.stretch,Ae),ri=new re(wn,Un),xi=new re(Or,Un),Di=new re(Or,Vo),ji=new re(wn,Vo),fo=new re(vn/T,kr/T),ii=new re(fi/T,Ni/T),Li=a*Math.PI/180;if(Li){const ho=Math.sin(Li),po=Math.cos(Li),zr=[po,-ho,ho,po];ri._matMult(zr),xi._matMult(zr),ji._matMult(zr),Di._matMult(zr)}const Ki=Ht.stretch+Ht.fixed,to=tn.stretch+tn.fixed;return{tl:ri,tr:xi,bl:ji,br:Di,tex:{x:S.paddedRect.x+1+Ki,y:S.paddedRect.y+1+to,w:Yt.stretch+Yt.fixed-Ki,h:Ft.stretch+Ft.fixed-to},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:fo,pixelOffsetBR:ii,minFontScaleX:un/T/j,minFontScaleY:en/T/X,isSDF:d}};if(m&&(S.stretchX||S.stretchY)){const Ht=hS(ne,Ie,pe),tn=hS(ue,Ze,Ae);for(let Yt=0;Yt0&&(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 Ae=T.collisionPadding;if(Ae&&(he-=Ae[0]*L,ne-=Ae[1]*L,pe+=Ae[2]*L,ue+=Ae[3]*L),X){const Ie=new re(he,ne),Ze=new re(pe,ne),st=new re(he,ue),Ke=new re(pe,ue),rt=X*Math.PI/180;Ie._rotate(rt),Ze._rotate(rt),st._rotate(rt),Ke._rotate(rt),he=Math.min(Ie.x,Ze.x,st.x,Ke.x),pe=Math.max(Ie.x,Ze.x,st.x,Ke.x),ne=Math.min(Ie.y,Ze.y,st.y,Ke.y),ue=Math.max(Ie.y,Ze.y,st.y,Ke.y)}a.emplaceBack(d.x,d.y,he,ne,pe,ue,m,x,S)}this.boxEndIndex=a.length}}class KD{constructor(a=[],d=HD){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,x=d[a];for(;a>0;){const S=a-1>>1,T=d[S];if(m(x,T)>=0)break;d[a]=T,a=S}d[a]=x}_down(a){const{data:d,compare:m}=this,x=this.length>>1,S=d[a];for(;a=0)break;d[a]=L,a=T}d[a]=S}}function HD(u,a){return ua?1:0}function WD(u,a=1,d=!1){let m=1/0,x=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-x);let j=F/2;const X=new KD([],GD);if(F===0)return new re(m,x);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||(j=he.h/2,X.push(new rd(he.p.x-j,he.p.y-j,j,u)),X.push(new rd(he.p.x+j,he.p.y-j,j,u)),X.push(new rd(he.p.x-j,he.p.y+j,j,u)),X.push(new rd(he.p.x+j,he.p.y+j,j,u)),ue+=4)}return d&&(console.log(`num probes: ${ue}`),console.log(`best distance: ${ne.d}`)),ne.p}function GD(u,a){return a.max-u.max}function rd(u,a,d,m){this.p=new re(u,a),this.h=d,this.d=function(x,S){let T=!1,L=1/0;for(let F=0;Fx.y!=pe.y>x.y&&x.x<(pe.x-he.x)*(x.y-he.y)/(pe.y-he.y)+he.x&&(T=!T),L=Math.min(L,b3(x,he,pe))}}return(T?1:-1)*Math.sqrt(L)}(this.p,m),this.max=this.d+this.h*Math.SQRT2}const nx=Number.POSITIVE_INFINITY;function pS(u,a){return a[1]!==nx?function(d,m,x){let S=0,T=0;switch(m=Math.abs(m),x=Math.abs(x),d){case"top-right":case"top-left":case"top":T=x-7;break;case"bottom-right":case"bottom-left":case"bottom":T=7-x}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 x=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":x=-T;break;case"top-left":case"bottom-left":x=T;break;case"left":x=m;break;case"right":x=-m}return[x,S]}(u,a[0])}function rx(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 qD(u,a,d,m,x,S,T,L,F,j,X){let ne=S.textMaxSize.evaluate(a,{});ne===void 0&&(ne=T);const ue=u.layers[0].layout,he=ue.get("icon-offset").evaluate(a,{},X),pe=vS(d.horizontal),Ae=T/24,Ie=u.tilePixelRatio*Ae,Ze=u.tilePixelRatio*ne/24,st=u.tilePixelRatio*L,Ke=u.tilePixelRatio*ue.get("symbol-spacing"),rt=ue.get("text-padding")*u.tilePixelRatio,kt=function(Ft,wn,vn,Un=1){const kr=Ft.get("icon-padding").evaluate(wn,{},vn),Or=kr&&kr.values;return[Or[0]*Un,Or[1]*Un,Or[2]*Un,Or[3]*Un]}(ue,a,X,u.tilePixelRatio),St=ue.get("text-max-angle")/180*Math.PI,un=ue.get("text-rotation-alignment")!=="viewport"&&ue.get("symbol-placement")!=="point",pn=ue.get("icon-rotation-alignment")==="map"&&ue.get("symbol-placement")!=="point",en=ue.get("symbol-placement"),Zt=Ke/2,Ht=ue.get("icon-text-fit");let tn;m&&Ht!=="none"&&(u.allowVerticalPlacement&&d.vertical&&(tn=iS(m,d.vertical,Ht,ue.get("icon-text-fit-padding"),he,Ae)),pe&&(m=iS(m,pe,Ht,ue.get("icon-text-fit-padding"),he,Ae)));const Yt=(Ft,wn)=>{wn.x<0||wn.x>=di||wn.y<0||wn.y>=di||function(vn,Un,kr,Or,fi,Vo,Ni,ri,xi,Di,ji,fo,ii,Li,Ki,to,ho,po,zr,_i,Wn,Io,zi,Hi,la){const Aa=vn.addToLineVertexArray(Un,kr);let Oa,Rs,ua,Uo,mo=0,As=0,ph=0,AS=0,hx=-1,px=-1;const Os={};let OS=yi.exports(""),mx=0,vx=0;if(ri._unevaluatedLayout.getValue("text-radial-offset")===void 0?[mx,vx]=ri.layout.get("text-offset").evaluate(Wn,{},Hi).map(vo=>vo*Pi):(mx=ri.layout.get("text-radial-offset").evaluate(Wn,{},Hi)*Pi,vx=nx),vn.allowVerticalPlacement&&Or.vertical){const vo=ri.layout.get("text-rotate").evaluate(Wn,{},Hi)+90;ua=new hv(xi,Un,Di,ji,fo,Or.vertical,ii,Li,Ki,vo),Ni&&(Uo=new hv(xi,Un,Di,ji,fo,Ni,ho,po,Ki,vo))}if(fi){const vo=ri.layout.get("icon-rotate").evaluate(Wn,{}),ns=ri.layout.get("icon-text-fit")!=="none",mh=fS(fi,vo,zi,ns),vh=Ni?fS(Ni,vo,zi,ns):void 0;Rs=new hv(xi,Un,Di,ji,fo,fi,ho,po,!1,vo),mo=4*mh.length;const LS=vn.iconSizeData;let Ku=null;LS.kind==="source"?(Ku=[Ms*ri.layout.get("icon-size").evaluate(Wn,{})],Ku[0]>El&&B(`${vn.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):LS.kind==="composite"&&(Ku=[Ms*Io.compositeIconSizes[0].evaluate(Wn,{},Hi),Ms*Io.compositeIconSizes[1].evaluate(Wn,{},Hi)],(Ku[0]>El||Ku[1]>El)&&B(`${vn.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),vn.addSymbols(vn.icon,mh,Ku,_i,zr,Wn,o.WritingMode.none,Un,Aa.lineStartIndex,Aa.lineLength,-1,Hi),hx=vn.icon.placedSymbolArray.length-1,vh&&(As=4*vh.length,vn.addSymbols(vn.icon,vh,Ku,_i,zr,Wn,o.WritingMode.vertical,Un,Aa.lineStartIndex,Aa.lineLength,-1,Hi),px=vn.icon.placedSymbolArray.length-1)}const NS=Object.keys(Or.horizontal);for(const vo of NS){const ns=Or.horizontal[vo];if(!Oa){OS=yi.exports(ns.text);const vh=ri.layout.get("text-rotate").evaluate(Wn,{},Hi);Oa=new hv(xi,Un,Di,ji,fo,ns,ii,Li,Ki,vh)}const mh=ns.positionedLines.length===1;if(ph+=mS(vn,Un,ns,Vo,ri,Ki,Wn,to,Aa,Or.vertical?o.WritingMode.horizontal:o.WritingMode.horizontalOnly,mh?NS:[vo],Os,hx,Io,Hi),mh)break}Or.vertical&&(AS+=mS(vn,Un,Or.vertical,Vo,ri,Ki,Wn,to,Aa,o.WritingMode.vertical,["vertical"],Os,px,Io,Hi));const sL=Oa?Oa.boxStartIndex:vn.collisionBoxArray.length,lL=Oa?Oa.boxEndIndex:vn.collisionBoxArray.length,uL=ua?ua.boxStartIndex:vn.collisionBoxArray.length,cL=ua?ua.boxEndIndex:vn.collisionBoxArray.length,dL=Rs?Rs.boxStartIndex:vn.collisionBoxArray.length,fL=Rs?Rs.boxEndIndex:vn.collisionBoxArray.length,hL=Uo?Uo.boxStartIndex:vn.collisionBoxArray.length,pL=Uo?Uo.boxEndIndex:vn.collisionBoxArray.length;let Na=-1;const yv=(vo,ns)=>vo&&vo.circleDiameter?Math.max(vo.circleDiameter,ns):ns;Na=yv(Oa,Na),Na=yv(ua,Na),Na=yv(Rs,Na),Na=yv(Uo,Na);const DS=Na>-1?1:0;DS&&(Na*=la/Pi),vn.glyphOffsetArray.length>=id.MAX_GLYPHS&&B("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Wn.sortKey!==void 0&&vn.addToSortKeyRanges(vn.symbolInstances.length,Wn.sortKey),vn.symbolInstances.emplaceBack(Un.x,Un.y,Os.right>=0?Os.right:-1,Os.center>=0?Os.center:-1,Os.left>=0?Os.left:-1,Os.vertical||-1,hx,px,OS,sL,lL,uL,cL,dL,fL,hL,pL,Di,ph,AS,mo,As,DS,0,ii,mx,vx,Na)}(u,wn,Ft,d,m,x,tn,u.layers[0],u.collisionBoxArray,a.index,a.sourceLayerIndex,u.index,Ie,[rt,rt,rt,rt],un,F,st,kt,pn,he,a,S,j,X,T)};if(en==="line")for(const Ft of dS(a.geometry,0,0,di,di)){const wn=jD(Ft,Ke,St,d.vertical||pe,m,24,Ze,u.overscaling,di);for(const vn of wn){const Un=pe;Un&&ZD(u,Un.text,Zt,vn)||Yt(Ft,vn)}}else if(en==="line-center"){for(const Ft of a.geometry)if(Ft.length>1){const wn=UD(Ft,St,d.vertical||pe,m,24,Ze);wn&&Yt(Ft,wn)}}else if(a.type==="Polygon")for(const Ft of K1(a.geometry,0)){const wn=WD(Ft,16);Yt(Ft[0],new Sl(wn.x,wn.y,0))}else if(a.type==="LineString")for(const Ft of a.geometry)Yt(Ft,new Sl(Ft[0].x,Ft[0].y,0));else if(a.type==="Point")for(const Ft of a.geometry)for(const wn of Ft)Yt([wn],new Sl(wn.x,wn.y,0))}const El=32640;function mS(u,a,d,m,x,S,T,L,F,j,X,ne,ue,he,pe){const Ae=function(st,Ke,rt,kt,St,un,pn,en){const Zt=kt.layout.get("text-rotate").evaluate(un,{})*Math.PI/180,Ht=[];for(const tn of Ke.positionedLines)for(const Yt of tn.positionedGlyphs){if(!Yt.rect)continue;const Ft=Yt.rect||{};let wn=4,vn=!0,Un=1,kr=0;const Or=(St||en)&&Yt.vertical,fi=Yt.metrics.advance*Yt.scale/2;if(en&&Ke.verticalizable){const zr=(Yt.scale-1)*Pi,_i=(Pi-Yt.metrics.width*Yt.scale)/2;kr=tn.lineOffset/2-(Yt.imageName?-_i:zr)}if(Yt.imageName){const zr=pn[Yt.imageName];vn=zr.sdf,Un=zr.pixelRatio,wn=1/Un}const Vo=St?[Yt.x+fi,Yt.y]:[0,0];let Ni=St?[0,0]:[Yt.x+fi+rt[0],Yt.y+rt[1]-kr],ri=[0,0];Or&&(ri=Ni,Ni=[0,0]);const xi=(Yt.metrics.left-wn)*Yt.scale-fi+Ni[0],Di=(-Yt.metrics.top-wn)*Yt.scale+Ni[1],ji=xi+Ft.w*Yt.scale/Un,fo=Di+Ft.h*Yt.scale/Un,ii=new re(xi,Di),Li=new re(ji,Di),Ki=new re(xi,fo),to=new re(ji,fo);if(Or){const zr=new re(-fi,fi-sv),_i=-Math.PI/2,Wn=12-fi,Io=new re(22-Wn,-(Yt.imageName?Wn:0)),zi=new re(...ri);ii._rotateAround(_i,zr)._add(Io)._add(zi),Li._rotateAround(_i,zr)._add(Io)._add(zi),Ki._rotateAround(_i,zr)._add(Io)._add(zi),to._rotateAround(_i,zr)._add(Io)._add(zi)}if(Zt){const zr=Math.sin(Zt),_i=Math.cos(Zt),Wn=[_i,-zr,zr,_i];ii._matMult(Wn),Li._matMult(Wn),Ki._matMult(Wn),to._matMult(Wn)}const ho=new re(0,0),po=new re(0,0);Ht.push({tl:ii,tr:Li,bl:Ki,br:to,tex:Ft,writingMode:Ke.writingMode,glyphOffset:Vo,sectionIndex:Yt.sectionIndex,isSDF:vn,pixelOffsetTL:ho,pixelOffsetBR:po,minFontScaleX:0,minFontScaleY:0})}return Ht}(0,d,L,x,S,T,m,u.allowVerticalPlacement),Ie=u.textSizeData;let Ze=null;Ie.kind==="source"?(Ze=[Ms*x.layout.get("text-size").evaluate(T,{})],Ze[0]>El&&B(`${u.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):Ie.kind==="composite"&&(Ze=[Ms*he.compositeTextSizes[0].evaluate(T,{},pe),Ms*he.compositeTextSizes[1].evaluate(T,{},pe)],(Ze[0]>El||Ze[1]>El)&&B(`${u.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),u.addSymbols(u.text,Ae,Ze,L,S,T,j,a,F.lineStartIndex,F.lineLength,ue,pe);for(const st of X)ne[st]=u.text.placedSymbolArray.length-1;return 4*Ae.length}function vS(u){for(const a in u)return u[a];return null}function ZD(u,a,d,m){const x=u.compareText;if(a in x){const S=x[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=F1([]),this.placementViewportMatrix=F1([]);const d=this.layers[0]._unevaluatedLayout._values;this.textSizeData=oS(this.zoom,d["text-size"]),this.iconSizeData=oS(this.zoom,d["icon-size"]);const m=this.layers[0].layout,x=m.get("symbol-sort-key"),S=m.get("symbol-z-order");this.canOverlap=lx(m,"text-overlap","text-allow-overlap")!=="never"||lx(m,"icon-overlap","icon-allow-overlap")!=="never"||m.get("text-ignore-placement")||m.get("icon-ignore-placement"),this.sortFeaturesByKey=S!=="viewport-y"&&!x.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 ox(new $u(this.layers,this.zoom,a=>/^text/.test(a))),this.icon=new ox(new $u(this.layers,this.zoom,a=>/^icon/.test(a))),this.glyphOffsetArray=new qt,this.lineVertexArray=new ln,this.symbolInstances=new rn}calculateGlyphDependencies(a,d,m,x,S){for(let T=0;T0)&&(T.value.kind!=="constant"||T.value.value.length>0),X=F.value.kind!=="constant"||!!F.value.value||Object.keys(F.parameters).length>0,ne=S.get("symbol-sort-key");if(this.features=[],!j&&!X)return;const ue=d.iconDependencies,he=d.glyphDependencies,pe=d.availableImages,Ae=new Rr(this.zoom);for(const{feature:Ie,id:Ze,index:st,sourceLayerIndex:Ke}of a){const rt=x._featureFilter.needGeometry,kt=Vu(Ie,rt);if(!x._featureFilter.filter(Ae,kt,m))continue;let St,un;if(rt||(kt.geometry=Bu(Ie)),j){const en=x.getValueAndResolveTokens("text-field",kt,m,pe),Zt=be.factory(en);QD(Zt)&&(this.hasRTLText=!0),(!this.hasRTLText||Lu()==="unavailable"||this.hasRTLText&&ko.isParsed())&&(St=ED(Zt,x,kt))}if(X){const en=x.getValueAndResolveTokens("icon-image",kt,m,pe);un=en instanceof Oe?en:Oe.fromString(en)}if(!St&&!un)continue;const pn=this.sortFeaturesByKey?ne.evaluate(kt,{},m):void 0;if(this.features.push({id:Ze,text:St,icon:un,index:st,sourceLayerIndex:Ke,geometry:kt.geometry,properties:Ie.properties,type:XD[Ie.type],sortKey:pn}),un&&(ue[un.name]=!0),St){const en=T.evaluate(kt,{},m).join(","),Zt=S.get("text-rotation-alignment")!=="viewport"&&S.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(o.WritingMode.vertical)>=0;for(const Ht of St.sections)if(Ht.image)ue[Ht.image.name]=!0;else{const tn=Wc(St.toString()),Yt=Ht.fontStack||en,Ft=he[Yt]=he[Yt]||{};this.calculateGlyphDependencies(Ht.text,Ft,Zt,this.allowVerticalPlacement,tn)}}}S.get("symbol-placement")==="line"&&(this.features=function(Ie){const Ze={},st={},Ke=[];let rt=0;function kt(en){Ke.push(Ie[en]),rt++}function St(en,Zt,Ht){const tn=st[en];return delete st[en],st[Zt]=tn,Ke[tn].geometry[0].pop(),Ke[tn].geometry[0]=Ke[tn].geometry[0].concat(Ht[0]),tn}function un(en,Zt,Ht){const tn=Ze[Zt];return delete Ze[Zt],Ze[en]=tn,Ke[tn].geometry[0].shift(),Ke[tn].geometry[0]=Ht[0].concat(Ke[tn].geometry[0]),tn}function pn(en,Zt,Ht){const tn=Ht?Zt[0][Zt[0].length-1]:Zt[0][0];return`${en}:${tn.x}:${tn.y}`}for(let en=0;enen.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((Ie,Ze)=>Ie.sortKey-Ze.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 x=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),x=m.vertexStartIndex+4*m.numGlyphs;for(let S=m.vertexStartIndex;Sx[L]-x[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((x,S,T)=>{x>=0&&T.indexOf(x)===S&&this.addIndicesForPlacedSymbol(this.text,x)}),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)}}}fn("SymbolBucket",id,{omit:["layers","collisionBoxArray","features","compareText"]}),id.MAX_GLYPHS=65535,id.addDynamicAttributes=ix;const JD=new Ti({"symbol-placement":new mn(Fe.layout_symbol["symbol-placement"]),"symbol-spacing":new mn(Fe.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new mn(Fe.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new En(Fe.layout_symbol["symbol-sort-key"]),"symbol-z-order":new mn(Fe.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new mn(Fe.layout_symbol["icon-allow-overlap"]),"icon-overlap":new mn(Fe.layout_symbol["icon-overlap"]),"icon-ignore-placement":new mn(Fe.layout_symbol["icon-ignore-placement"]),"icon-optional":new mn(Fe.layout_symbol["icon-optional"]),"icon-rotation-alignment":new mn(Fe.layout_symbol["icon-rotation-alignment"]),"icon-size":new En(Fe.layout_symbol["icon-size"]),"icon-text-fit":new mn(Fe.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new mn(Fe.layout_symbol["icon-text-fit-padding"]),"icon-image":new En(Fe.layout_symbol["icon-image"]),"icon-rotate":new En(Fe.layout_symbol["icon-rotate"]),"icon-padding":new En(Fe.layout_symbol["icon-padding"]),"icon-keep-upright":new mn(Fe.layout_symbol["icon-keep-upright"]),"icon-offset":new En(Fe.layout_symbol["icon-offset"]),"icon-anchor":new En(Fe.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new mn(Fe.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new mn(Fe.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new mn(Fe.layout_symbol["text-rotation-alignment"]),"text-field":new En(Fe.layout_symbol["text-field"]),"text-font":new En(Fe.layout_symbol["text-font"]),"text-size":new En(Fe.layout_symbol["text-size"]),"text-max-width":new En(Fe.layout_symbol["text-max-width"]),"text-line-height":new mn(Fe.layout_symbol["text-line-height"]),"text-letter-spacing":new En(Fe.layout_symbol["text-letter-spacing"]),"text-justify":new En(Fe.layout_symbol["text-justify"]),"text-radial-offset":new En(Fe.layout_symbol["text-radial-offset"]),"text-variable-anchor":new mn(Fe.layout_symbol["text-variable-anchor"]),"text-anchor":new En(Fe.layout_symbol["text-anchor"]),"text-max-angle":new mn(Fe.layout_symbol["text-max-angle"]),"text-writing-mode":new mn(Fe.layout_symbol["text-writing-mode"]),"text-rotate":new En(Fe.layout_symbol["text-rotate"]),"text-padding":new mn(Fe.layout_symbol["text-padding"]),"text-keep-upright":new mn(Fe.layout_symbol["text-keep-upright"]),"text-transform":new En(Fe.layout_symbol["text-transform"]),"text-offset":new En(Fe.layout_symbol["text-offset"]),"text-allow-overlap":new mn(Fe.layout_symbol["text-allow-overlap"]),"text-overlap":new mn(Fe.layout_symbol["text-overlap"]),"text-ignore-placement":new mn(Fe.layout_symbol["text-ignore-placement"]),"text-optional":new mn(Fe.layout_symbol["text-optional"])});var sx={paint:new Ti({"icon-opacity":new En(Fe.paint_symbol["icon-opacity"]),"icon-color":new En(Fe.paint_symbol["icon-color"]),"icon-halo-color":new En(Fe.paint_symbol["icon-halo-color"]),"icon-halo-width":new En(Fe.paint_symbol["icon-halo-width"]),"icon-halo-blur":new En(Fe.paint_symbol["icon-halo-blur"]),"icon-translate":new mn(Fe.paint_symbol["icon-translate"]),"icon-translate-anchor":new mn(Fe.paint_symbol["icon-translate-anchor"]),"text-opacity":new En(Fe.paint_symbol["text-opacity"]),"text-color":new En(Fe.paint_symbol["text-color"],{runtimeType:Fn,getOverride:u=>u.textColor,hasOverride:u=>!!u.textColor}),"text-halo-color":new En(Fe.paint_symbol["text-halo-color"]),"text-halo-width":new En(Fe.paint_symbol["text-halo-width"]),"text-halo-blur":new En(Fe.paint_symbol["text-halo-blur"]),"text-translate":new mn(Fe.paint_symbol["text-translate"]),"text-translate-anchor":new mn(Fe.paint_symbol["text-translate-anchor"])}),layout:JD};class gS{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:An,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}}fn("FormatSectionOverride",gS,{omit:["defaultValue"]});class mv extends oa{constructor(a){super(a,sx)}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 x=[];for(const S of m)x.indexOf(S)<0&&x.push(S);this.layout._values["text-writing-mode"]=x}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(a,d,m,x){const S=this.layout.get(a).evaluate(d,{},m,x),T=this._unevaluatedLayout._values[a];return T.isDataDriven()||Cu(T.value)||!S?S:function(L,F){return F.replace(/{([^{}]+)}/g,(j,X)=>X in L?String(L[X]):"")}(d.properties,S)}createBucket(a){return new id(a)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const a of sx.paint.overridableProperties){if(!mv.hasPaintOverride(this.layout,a))continue;const d=this.paint.get(a),m=new gS(d),x=new Bc(m,d.property.specification);let S=null;S=d.value.kind==="constant"||d.value.kind==="source"?new Eu("source",x):new Ff("composite",x,d.value.zoomStops),this.paint._values[a]=new ia(d.property,S,d.parameters)}}_handleOverridablePaintPropertyUpdate(a,d,m){return!(!this.layout||d.isDataDriven()||m.isDataDriven())&&mv.hasPaintOverride(this.layout,a)}static hasPaintOverride(a,d){const m=a.get("text-field"),x=sx.paint.properties[d];let S=!1;const T=L=>{for(const F of L)if(x.overrides&&x.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=j=>{S||(j instanceof bt&&Be(j.value)===Cn?T(j.value.sections):j instanceof Fc?T(j.sections):j.eachChild(L))},F=m.value;F._styleExpression&&L(F._styleExpression.expression)}return S}}function lx(u,a,d){let m="never";const x=u.get(a);return x?m=x:u.get(d)&&(m="always"),m}var eL={paint:new Ti({"background-color":new mn(Fe.paint_background["background-color"]),"background-pattern":new Xf(Fe.paint_background["background-pattern"]),"background-opacity":new mn(Fe.paint_background["background-opacity"])})},tL={paint:new Ti({"raster-opacity":new mn(Fe.paint_raster["raster-opacity"]),"raster-hue-rotate":new mn(Fe.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new mn(Fe.paint_raster["raster-brightness-min"]),"raster-brightness-max":new mn(Fe.paint_raster["raster-brightness-max"]),"raster-saturation":new mn(Fe.paint_raster["raster-saturation"]),"raster-contrast":new mn(Fe.paint_raster["raster-contrast"]),"raster-resampling":new mn(Fe.paint_raster["raster-resampling"]),"raster-fade-duration":new mn(Fe.paint_raster["raster-fade-duration"])})};class nL extends oa{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 rL={circle:class extends oa{constructor(u){super(u,N9)}createBucket(u){return new D1(u)}queryRadius(u){const a=u;return th("circle-radius",this,a)+th("circle-stroke-width",this,a)+Qm(this.paint.get("circle-translate"))}queryIntersectsFeature(u,a,d,m,x,S,T,L){const F=Jm(u,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),S.angle,T),j=this.paint.get("circle-radius").evaluate(a,d)+this.paint.get("circle-stroke-width").evaluate(a,d),X=this.paint.get("circle-pitch-alignment")==="map",ne=X?F:function(he,pe){return he.map(Ae=>P3(Ae,pe))}(F,L),ue=X?j*T:j;for(const he of m)for(const pe of he){const Ae=X?pe:P3(pe,L);let Ie=ue;const Ze=ev([],[pe.x,pe.y,0,1],L);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?Ie*=Ze[3]/S.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(Ie*=S.cameraToCenterDistance/Ze[3]),I9(ne,Ae,Ie))return!0}return!1}},heatmap:class extends oa{constructor(u){super(u,L9),this._updateColorRamp()}createBucket(u){return new I3(u)}_handleSpecialPaintPropertyUpdate(u){u==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=R3({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 oa{constructor(u){super(u,z9)}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}},fill:class extends oa{constructor(u){super(u,J9)}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 G1(u)}queryRadius(){return Qm(this.paint.get("fill-translate"))}queryIntersectsFeature(u,a,d,m,x,S,T){return _3(Jm(u,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),S.angle,T),m)}isTileClipped(){return!0}},"fill-extrusion":class extends oa{constructor(u){super(u,hD)}createBucket(u){return new Z1(u)}queryRadius(){return Qm(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(u,a,d,m,x,S,T,L){const F=Jm(u,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),S.angle,T),j=this.paint.get("fill-extrusion-height").evaluate(a,d),X=this.paint.get("fill-extrusion-base").evaluate(a,d),ne=function(he,pe,Ae,Ie){const Ze=[];for(const st of he){const Ke=[st.x,st.y,0,1];ev(Ke,Ke,pe),Ze.push(new re(Ke[0]/Ke[3],Ke[1]/Ke[3]))}return Ze}(F,L),ue=function(he,pe,Ae,Ie){const Ze=[],st=[],Ke=Ie[8]*pe,rt=Ie[9]*pe,kt=Ie[10]*pe,St=Ie[11]*pe,un=Ie[8]*Ae,pn=Ie[9]*Ae,en=Ie[10]*Ae,Zt=Ie[11]*Ae;for(const Ht of he){const tn=[],Yt=[];for(const Ft of Ht){const wn=Ft.x,vn=Ft.y,Un=Ie[0]*wn+Ie[4]*vn+Ie[12],kr=Ie[1]*wn+Ie[5]*vn+Ie[13],Or=Ie[2]*wn+Ie[6]*vn+Ie[14],fi=Ie[3]*wn+Ie[7]*vn+Ie[15],Vo=Or+kt,Ni=fi+St,ri=Un+un,xi=kr+pn,Di=Or+en,ji=fi+Zt,fo=new re((Un+Ke)/Ni,(kr+rt)/Ni);fo.z=Vo/Ni,tn.push(fo);const ii=new re(ri/ji,xi/ji);ii.z=Di/ji,Yt.push(ii)}Ze.push(tn),st.push(Yt)}return[Ze,st]}(m,X,j,L);return function(he,pe,Ae){let Ie=1/0;_3(Ae,pe)&&(Ie=B3(Ae,pe[0]));for(let Ze=0;Ze=3){for(let Ae=0;Ae{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 yS=63710088e-1;class qr{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 qr(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,x=a.lat*d,S=Math.sin(m)*Math.sin(x)+Math.cos(m)*Math.cos(x)*Math.cos((a.lng-this.lng)*d);return yS*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 ju(new qr(this.lng-m,this.lat-d),new qr(this.lng+m,this.lat+d))}static convert(a){if(a instanceof qr)return a;if(Array.isArray(a)&&(a.length===2||a.length===3))return new qr(Number(a[0]),Number(a[1]));if(!Array.isArray(a)&&typeof a=="object"&&a!==null)return new qr(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 ju{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 qr?new qr(a.lng,a.lat):qr.convert(a),this}setSouthWest(a){return this._sw=a instanceof qr?new qr(a.lng,a.lat):qr.convert(a),this}extend(a){const d=this._sw,m=this._ne;let x,S;if(a instanceof qr)x=a,S=a;else{if(!(a instanceof ju))return Array.isArray(a)?a.length===4||a.every(Array.isArray)?this.extend(ju.convert(a)):this.extend(qr.convert(a)):this;if(x=a._sw,S=a._ne,!x||!S)return this}return d||m?(d.lng=Math.min(x.lng,d.lng),d.lat=Math.min(x.lat,d.lat),m.lng=Math.max(S.lng,m.lng),m.lat=Math.max(S.lat,m.lat)):(this._sw=new qr(x.lng,x.lat),this._ne=new qr(S.lng,S.lat)),this}getCenter(){return new qr((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 qr(this.getWest(),this.getNorth())}getSouthEast(){return new qr(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}=qr.convert(a);let x=this._sw.lng<=d&&d<=this._ne.lng;return this._sw.lng>this._ne.lng&&(x=this._sw.lng>=d&&d>=this._ne.lng),this._sw.lat<=m&&m<=this._ne.lat&&x}static convert(a){return a instanceof ju?a:a&&new ju(a)}}const xS=2*Math.PI*yS;function _S(u){return xS*Math.cos(u*Math.PI/180)}function bS(u){return(180+u)/360}function wS(u){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+u*Math.PI/360)))/360}function CS(u,a){return u/_S(a)}function ux(u){return 360/Math.PI*Math.atan(Math.exp((180-360*u)*Math.PI/180))-90}class vv{constructor(a,d,m=0){this.x=+a,this.y=+d,this.z=+m}static fromLngLat(a,d=0){const m=qr.convert(a);return new vv(bS(m.lng),wS(m.lat),CS(d,m.lat))}toLngLat(){return new qr(360*this.x-180,ux(this.y))}toAltitude(){return this.z*_S(ux(this.y))}meterInMercatorCoordinateUnits(){return 1/xS*(a=ux(this.y),1/Math.cos(a*Math.PI/180));var a}}function SS(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 cx{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=fh(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 x=(T=this.y,L=this.z,F=SS(256*(S=this.x),256*(T=Math.pow(2,L)-T-1),L),j=SS(256*(S+1),256*(T+1),L),F[0]+","+F[1]+","+j[0]+","+j[1]);var S,T,L,F,j;const X=function(ne,ue,he){let pe,Ae="";for(let Ie=ne;Ie>0;Ie--)pe=1<1?"@2x":"").replace(/{quadkey}/g,X).replace(/{bbox-epsg-3857}/g,x)}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 re((a.x*d-this.x)*di,(a.y*d-this.y)*di)}toString(){return`${this.z}/${this.x}/${this.y}`}}class ES{constructor(a,d){this.wrap=a,this.canonical=d,this.key=fh(a,d.z,d.z,d.x,d.y)}}class Bo{constructor(a,d,m,x,S){if(a= z; overscaledZ = ${a}; z = ${m}`);this.overscaledZ=a,this.wrap=d,this.canonical=new cx(m,+x,+S),this.key=fh(d,a,m,x,S)}clone(){return new Bo(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 Bo(a,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Bo(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?fh(this.wrap*+d,a,this.canonical.z,this.canonical.x,this.canonical.y):fh(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 Bo(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,x=2*this.canonical.y;return[new Bo(d,this.wrap,d,m,x),new Bo(d,this.wrap,d,m+1,x),new Bo(d,this.wrap,d,m,x+1),new Bo(d,this.wrap,d,m+1,x+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 $o({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 x=d*this.dim,S=d*this.dim+this.dim,T=m*this.dim,L=m*this.dim+this.dim;switch(d){case-1:x=S-1;break;case 1:S=x+1}switch(m){case-1:T=L-1;break;case 1:L=T+1}const F=-d*this.dim,j=-m*this.dim;for(let X=T;X=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 PS{constructor(a,d,m,x,S){this.type="Feature",this._vectorTileFeature=a,a._z=d,a._x=m,a._y=x,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 IS{constructor(a,d){this.tileID=a,this.x=a.canonical.x,this.y=a.canonical.y,this.z=a.canonical.z,this.grid=new Du(di,16,0),this.grid3D=new Du(di,16,0),this.featureIndexArray=new Vn,this.promoteId=d}insert(a,d,m,x,S,T){const L=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(m,x,S);const F=T?this.grid3D:this.grid;for(let j=0;j=0&&ne[3]>=0&&F.insert(L,ne[0],ne[1],ne[2],ne[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new wl.VectorTile(new Y1(this.rawTileData)).layers,this.sourceLayerCoder=new TS(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(a,d,m,x){this.loadVTLayers();const S=a.params||{},T=di/a.tileSize/a.scale,L=jc(S.filter),F=a.queryGeometry,j=a.queryPadding*T,X=RS(F),ne=this.grid.query(X.minX-j,X.minY-j,X.maxX+j,X.maxY+j),ue=RS(a.cameraQueryGeometry),he=this.grid3D.query(ue.minX-j,ue.minY-j,ue.maxX+j,ue.maxY+j,(Ie,Ze,st,Ke)=>function(rt,kt,St,un,pn){for(const Zt of rt)if(kt<=Zt.x&&St<=Zt.y&&un>=Zt.x&&pn>=Zt.y)return!0;const en=[new re(kt,St),new re(kt,pn),new re(un,pn),new re(un,St)];if(rt.length>2){for(const Zt of en)if(Yc(rt,Zt))return!0}for(let Zt=0;Zt(Ke||(Ke=Bu(rt)),kt.queryIntersectsFeature(F,rt,St,Ke,this.z,a.transform,T,a.pixelPosMatrix)))}return pe}loadMatchingFeature(a,d,m,x,S,T,L,F,j,X,ne){const ue=this.bucketLayerIDs[d];if(T&&!function(Ie,Ze){for(let st=0;st=0)return!0;return!1}(T,ue))return;const he=this.sourceLayerCoder.decode(m),pe=this.vtLayers[he].feature(x);if(S.needGeometry){const Ie=Vu(pe,!0);if(!S.filter(new Rr(this.tileID.overscaledZ),Ie,this.tileID.canonical))return}else if(!S.filter(new Rr(this.tileID.overscaledZ),pe))return;const Ae=this.getId(pe,he);for(let Ie=0;Ie{const L=a instanceof Fu?a.get(T):null;return L&&L.evaluate?L.evaluate(d,m,x):L})}function RS(u){let a=1/0,d=1/0,m=-1/0,x=-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),x=Math.max(x,S.y);return{minX:a,minY:d,maxX:m,maxY:x}}function oL(u,a){return a-u}var dx;fn("FeatureIndex",IS,{omit:["rawTileData","sourceLayerCoder"]}),o.PerformanceMarkers=void 0,(dx=o.PerformanceMarkers||(o.PerformanceMarkers={})).create="create",dx.load="load",dx.fullLoad="fullLoad";let gv=null,hh=[];const fx=1e3/30,aL={mark(u){performance.mark(u)},frame(u){const a=u;gv!=null&&hh.push(a-gv),gv=a},clearMetrics(){gv=null,hh=[],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=hh.length,m=1/(hh.reduce((S,T)=>S+T,0)/d/1e3),x=hh.filter(S=>S>fx).reduce((S,T)=>S+(T-fx)/fx,0);return{loadTime:u,fullLoadTime:a,fps:m,percentDroppedFrames:x/(d+x)*100}}};o.AJAXError=Xe,o.ARRAY_TYPE=eo,o.Actor=class{constructor(u,a,d){this.target=u,this.parent=a,this.mapId=d,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},O(["receive","process"],this),this.invoker=new iL(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=H()?u:window}send(u,a,d,m,x=!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:x,sourceMapId:this.mapId,data:Cs(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 H()||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(Za(a.error)):d(null,Za(a.data)))}else{let d=!1;const m=Z(this.globalScope)?void 0:[],x=a.hasCallback?(L,F)=>{d=!0,delete this.cancelCallbacks[u],this.target.postMessage({id:u,type:"",sourceMapId:this.mapId,error:L?Cs(L):null,data:Cs(F,m)},m)}:L=>{d=!0};let S=null;const T=Za(a.data);if(this.parent[a.type])S=this.parent[a.type](a.sourceMapId,T,x);else if(this.parent.getWorkerSource){const L=a.type.split(".");S=this.parent.getWorkerSource(a.sourceMapId,L[0],T.source)[L[1]](T,x)}else x(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=rh,o.CanonicalTileID=cx,o.CollisionBoxArray=gt,o.CollisionCircleLayoutArray=class extends ee{},o.Color=ae,o.DEMData=kS,o.DataConstantProperty=mn,o.DictionaryCoder=TS,o.EXTENT=di,o.ErrorEvent=Ut,o.EvaluationParameters=Rr,o.Event=Wt,o.Evented=Qt,o.FeatureIndex=IS,o.FillBucket=G1,o.FillExtrusionBucket=Z1,o.GeoJSONFeature=PS,o.ImageAtlas=J3,o.ImagePosition=J1,o.LineBucket=X1,o.LineStripIndexArray=class extends Pe{},o.LngLat=qr,o.LngLatBounds=ju,o.MercatorCoordinate=vv,o.ONE_EM=Pi,o.OverscaledTileID=Bo,o.PerformanceUtils=aL,o.PosArray=bn,o.Properties=Ti,o.QuadTriangleArray=class extends fe{},o.RGBAImage=$o,o.RasterBoundsArray=class extends y{},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=Tt,o.SegmentVector=Hn,o.SymbolBucket=id,o.Transitionable=Wm,o.TriangleIndexArray=Qi,o.Uniform1f=Ts,o.Uniform1i=class extends ks{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 ks{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 ks{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=Zc,o.UniformColor=m3,o.UniformMatrix4f=class extends ks{constructor(u,a){super(u,a),this.current=T9}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=ES,o.ValidationError=Ge,o.ZoomHistory=Uf,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=ix,o.asyncAll=function(u,a,d){if(!u.length)return d(null,[]);let m=u.length;const x=new Array(u.length);let S=null;u.forEach((T,L)=>{a(T,(F,j)=>{F&&(S=F),x[L]=j,--m==0&&d(S,x)})})},o.bezier=g,o.bindAll=O,o.cacheEntryPossiblyAdded=function(u){Ne++,Ne>De&&(u.getActor().send("enforceCacheSizeLimit",ke),Ne=0)},o.clamp=w,o.clearTileCache=function(u){const a=caches.delete(ye);u&&a.catch(u).then(()=>u())},o.clipLine=dS,o.clone=function(u){var a=new eo(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=N,o.clone$2=function(u){var a=new eo(3);return a[0]=u[0],a[1]=u[1],a[2]=u[2],a},o.collisionCircleLayout=SD,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 eo(16);return eo!=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=C3,o.createExpression=Su,o.createFilter=jc,o.createLayout=ni,o.createStyleLayer=function(u){return u.type==="custom"?new nL(u):new rL[u.type](u)},o.cross=function(u,a,d){var m=a[0],x=a[1],S=a[2],T=d[0],L=d[1],F=d[2];return u[0]=x*F-S*L,u[1]=S*T-m*F,u[2]=m*L-x*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=b,o.emitValidationErrors=Hc,o.enforceCacheSizeLimit=function(u){Me(),Re&&Re.then(a=>{a.keys().then(d=>{for(let m=0;m{}}},o.identity=F1,o.invert=function(u,a){var d=a[0],m=a[1],x=a[2],S=a[3],T=a[4],L=a[5],F=a[6],j=a[7],X=a[8],ne=a[9],ue=a[10],he=a[11],pe=a[12],Ae=a[13],Ie=a[14],Ze=a[15],st=d*L-m*T,Ke=d*F-x*T,rt=d*j-S*T,kt=m*F-x*L,St=m*j-S*L,un=x*j-S*F,pn=X*Ae-ne*pe,en=X*Ie-ue*pe,Zt=X*Ze-he*pe,Ht=ne*Ie-ue*Ae,tn=ne*Ze-he*Ae,Yt=ue*Ze-he*Ie,Ft=st*Yt-Ke*tn+rt*Ht+kt*Zt-St*en+un*pn;return Ft?(u[0]=(L*Yt-F*tn+j*Ht)*(Ft=1/Ft),u[1]=(x*tn-m*Yt-S*Ht)*Ft,u[2]=(Ae*un-Ie*St+Ze*kt)*Ft,u[3]=(ue*St-ne*un-he*kt)*Ft,u[4]=(F*Zt-T*Yt-j*en)*Ft,u[5]=(d*Yt-x*Zt+S*en)*Ft,u[6]=(Ie*rt-pe*un-Ze*Ke)*Ft,u[7]=(X*un-ue*rt+he*Ke)*Ft,u[8]=(T*tn-L*Zt+j*pn)*Ft,u[9]=(m*Zt-d*tn-S*pn)*Ft,u[10]=(pe*St-Ae*rt+Ze*st)*Ft,u[11]=(ne*rt-X*St-he*st)*Ft,u[12]=(L*en-T*Ht-F*pn)*Ft,u[13]=(d*Ht-m*en+x*pn)*Ft,u[14]=(Ae*Ke-pe*kt-Ie*st)*Ft,u[15]=(X*kt-ne*Ke+ue*st)*Ft,u):null},o.isImageBitmap=Q,o.isSafari=Z,o.isWorker=H,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()||Lu()!=="deferred"||Hm()},o.makeRequest=Mt,o.mapObject=M,o.mercatorXfromLng=bS,o.mercatorYfromLat=wS,o.mercatorZfromAltitude=CS,o.mul=D9,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=S3,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],x=a[2],S=d*d+m*m+x*x;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=gr,o.ortho=function(u,a,d,m,x,S,T){var L=1/(a-d),F=1/(m-x),j=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*j,u[11]=0,u[12]=(a+d)*L,u[13]=(x+m)*F,u[14]=(T+S)*j,u[15]=1,u},o.parseCacheControl=te,o.parseGlyphPbf=function(u){return new Y1(u).readFields(DD,[])},o.pbf=Y1,o.performSymbolLayout=function(u){u.bucket.createArrays(),u.bucket.tilePixelRatio=di/(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 Rr(u.bucket.zoom+1),u.canonical),layoutTextSize:d["text-size"].possiblyEvaluate(new Rr(u.bucket.zoom+1),u.canonical),textMaxSize:d["text-size"].possiblyEvaluate(new Rr(18))};if(u.bucket.textSizeData.kind==="composite"){const{minZoom:F,maxZoom:j}=u.bucket.textSizeData;m.compositeTextSizes=[d["text-size"].possiblyEvaluate(new Rr(F),u.canonical),d["text-size"].possiblyEvaluate(new Rr(j),u.canonical)]}if(u.bucket.iconSizeData.kind==="composite"){const{minZoom:F,maxZoom:j}=u.bucket.iconSizeData;m.compositeIconSizes=[d["icon-size"].possiblyEvaluate(new Rr(F),u.canonical),d["icon-size"].possiblyEvaluate(new Rr(j),u.canonical)]}const x=a.get("text-line-height")*Pi,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 j=a.get("text-font").evaluate(F,{},u.canonical).join(","),X=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 Ae,Ie=[0,0];if(pe){const Ke=pe.toString(),rt=a.get("text-letter-spacing").evaluate(F,{},u.canonical)*Pi,kt=M1(Ke)?rt:0,St=a.get("text-anchor").evaluate(F,{},u.canonical),un=a.get("text-variable-anchor");if(!un){const tn=a.get("text-radial-offset").evaluate(F,{},u.canonical);Ie=tn?pS(St,[tn*Pi,nx]):a.get("text-offset").evaluate(F,{},u.canonical).map(Yt=>Yt*Pi)}let pn=S?"center":a.get("text-justify").evaluate(F,{},u.canonical);const en=a.get("symbol-placement"),Zt=en==="point"?a.get("text-max-width").evaluate(F,{},u.canonical)*Pi:0,Ht=()=>{u.bucket.allowVerticalPlacement&&Wc(Ke)&&(he.vertical=lv(pe,u.glyphMap,u.glyphPositions,u.imagePositions,j,Zt,x,St,"left",kt,Ie,o.WritingMode.vertical,!0,en,ne,X))};if(!S&&un){const tn=pn==="auto"?un.map(Ft=>rx(Ft)):[pn];let Yt=!1;for(let Ft=0;Ftthis._layers[We.id]),Ee=xe[0];if(Ee.visibility==="none")continue;const be=Ee.source||"";let Ce=this.familiesBySource[be];Ce||(Ce=this.familiesBySource[be]={});const Oe=Ee.sourceLayer||"_geojsonTileLayer";let He=Ce[Oe];He||(He=Ce[Oe]=[]),He.push(xe)}}}class b{constructor(K){const G={},ce=[];for(const be in K){const Ce=K[be],Oe=G[be]={};for(const He in Ce){const We=Ce[+He];if(!We||We.bitmap.width===0||We.bitmap.height===0)continue;const Be={x:0,y:0,w:We.bitmap.width+2,h:We.bitmap.height+2};ce.push(Be),Oe[He]={rect:Be,metrics:We.metrics}}}const{w:ae,h:xe}=o.potpack(ce),Ee=new o.AlphaImage({width:ae||1,height:xe||1});for(const be in K){const Ce=K[be];for(const Oe in Ce){const He=Ce[+Oe];if(!He||He.bitmap.width===0||He.bitmap.height===0)continue;const We=G[be][Oe].rect;o.AlphaImage.copy(He.bitmap,Ee,{x:0,y:0},{x:We.x+1,y:We.y+1},He.bitmap)}}this.image=Ee,this.positions=G}}o.register("GlyphAtlas",b);class w{constructor(K){this.tileID=new o.OverscaledTileID(K.tileID.overscaledZ,K.tileID.wrap,K.tileID.canonical.z,K.tileID.canonical.x,K.tileID.canonical.y),this.uid=K.uid,this.zoom=K.zoom,this.pixelRatio=K.pixelRatio,this.tileSize=K.tileSize,this.source=K.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=K.showCollisionBoxes,this.collectResourceTiming=!!K.collectResourceTiming,this.returnDependencies=!!K.returnDependencies,this.promoteId=K.promoteId}parse(K,G,ce,ae,xe){this.status="parsing",this.data=K,this.collisionBoxArray=new o.CollisionBoxArray;const Ee=new o.DictionaryCoder(Object.keys(K.layers).sort()),be=new o.FeatureIndex(this.tileID,this.promoteId);be.bucketLayerIDs=[];const Ce={},Oe={featureIndex:be,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:ce},He=G.familiesBySource[this.source];for(const on in He){const yn=K.layers[on];if(!yn)continue;yn.version===1&&o.warnOnce(`Vector tile source "${this.source}" layer "${on}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const Bn=Ee.encode(on),Jn=[];for(let Dr=0;Dr=or.maxzoom||or.visibility!=="none"&&(P(Dr,this.zoom,ce),(Ce[or.id]=or.createBucket({index:be.bucketLayerIDs.length,layers:Dr,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Bn,sourceID:this.source})).populate(Jn,Oe,this.tileID.canonical),be.bucketLayerIDs.push(Dr.map(Pr=>Pr.id)))}}let We,Be,Ot,bt;const Je=o.mapObject(Oe.glyphDependencies,on=>Object.keys(on).map(Number));Object.keys(Je).length?ae.send("getGlyphs",{uid:this.uid,stacks:Je},(on,yn)=>{We||(We=on,Be=yn,gn.call(this))}):Be={};const Rt=Object.keys(Oe.iconDependencies);Rt.length?ae.send("getImages",{icons:Rt,source:this.source,tileID:this.tileID,type:"icons"},(on,yn)=>{We||(We=on,Ot=yn,gn.call(this))}):Ot={};const Bt=Object.keys(Oe.patternDependencies);function gn(){if(We)return xe(We);if(Be&&Ot&&bt){const on=new b(Be),yn=new o.ImageAtlas(Ot,bt);for(const Bn in Ce){const Jn=Ce[Bn];Jn instanceof o.SymbolBucket?(P(Jn.layers,this.zoom,ce),o.performSymbolLayout({bucket:Jn,glyphMap:Be,glyphPositions:on.positions,imageMap:Ot,imagePositions:yn.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):Jn.hasPattern&&(Jn instanceof o.LineBucket||Jn instanceof o.FillBucket||Jn instanceof o.FillExtrusionBucket)&&(P(Jn.layers,this.zoom,ce),Jn.addFeatures(Oe,this.tileID.canonical,yn.patternPositions))}this.status="done",xe(null,{buckets:Object.values(Ce).filter(Bn=>!Bn.isEmpty()),featureIndex:be,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:on.image,imageAtlas:yn,glyphMap:this.returnDependencies?Be:null,iconMap:this.returnDependencies?Ot:null,glyphPositions:this.returnDependencies?on.positions:null})}}Bt.length?ae.send("getImages",{icons:Bt,source:this.source,tileID:this.tileID,type:"patterns"},(on,yn)=>{We||(We=on,bt=yn,gn.call(this))}):bt={},gn.call(this)}}function P(me,K,G){const ce=new o.EvaluationParameters(K);for(const ae of me)ae.recalculate(ce,G)}function I(me,K){const G=o.getArrayBuffer(me.request,(ce,ae,xe,Ee)=>{ce?K(ce):ae&&K(null,{vectorTile:new o.vectorTile.VectorTile(new o.pbf(ae)),rawData:ae,cacheControl:xe,expires:Ee})});return()=>{G.cancel(),K()}}class A{constructor(K,G,ce,ae){this.actor=K,this.layerIndex=G,this.availableImages=ce,this.loadVectorData=ae||I,this.loading={},this.loaded={}}loadTile(K,G){const ce=K.uid;this.loading||(this.loading={});const ae=!!(K&&K.request&&K.request.collectResourceTiming)&&new o.RequestPerformance(K.request),xe=this.loading[ce]=new w(K);xe.abort=this.loadVectorData(K,(Ee,be)=>{if(delete this.loading[ce],Ee||!be)return xe.status="done",this.loaded[ce]=xe,G(Ee);const Ce=be.rawData,Oe={};be.expires&&(Oe.expires=be.expires),be.cacheControl&&(Oe.cacheControl=be.cacheControl);const He={};if(ae){const We=ae.finish();We&&(He.resourceTiming=JSON.parse(JSON.stringify(We)))}xe.vectorTile=be.vectorTile,xe.parse(be.vectorTile,this.layerIndex,this.availableImages,this.actor,(We,Be)=>{if(We||!Be)return G(We);G(null,o.extend({rawTileData:Ce.slice(0)},Be,Oe,He))}),this.loaded=this.loaded||{},this.loaded[ce]=xe})}reloadTile(K,G){const ce=this.loaded,ae=K.uid,xe=this;if(ce&&ce[ae]){const Ee=ce[ae];Ee.showCollisionBoxes=K.showCollisionBoxes;const be=(Ce,Oe)=>{const He=Ee.reloadCallback;He&&(delete Ee.reloadCallback,Ee.parse(Ee.vectorTile,xe.layerIndex,this.availableImages,xe.actor,He)),G(Ce,Oe)};Ee.status==="parsing"?Ee.reloadCallback=be:Ee.status==="done"&&(Ee.vectorTile?Ee.parse(Ee.vectorTile,this.layerIndex,this.availableImages,this.actor,be):be())}}abortTile(K,G){const ce=this.loading,ae=K.uid;ce&&ce[ae]&&ce[ae].abort&&(ce[ae].abort(),delete ce[ae]),G()}removeTile(K,G){const ce=this.loaded,ae=K.uid;ce&&ce[ae]&&delete ce[ae],G()}}class O{constructor(){this.loaded={}}loadTile(K,G){const{uid:ce,encoding:ae,rawImageData:xe}=K,Ee=o.isImageBitmap(xe)?this.getImageData(xe):xe,be=new o.DEMData(ce,Ee,ae);this.loaded=this.loaded||{},this.loaded[ce]=be,G(null,be)}getImageData(K){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(K.width,K.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=K.width,this.offscreenCanvas.height=K.height,this.offscreenCanvasContext.drawImage(K,0,0,K.width,K.height);const G=this.offscreenCanvasContext.getImageData(-1,-1,K.width+2,K.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new o.RGBAImage({width:G.width,height:G.height},G.data)}removeTile(K){const G=this.loaded,ce=K.uid;G&&G[ce]&&delete G[ce]}}var M=function me(K,G){var ce,ae=K&&K.type;if(ae==="FeatureCollection")for(ce=0;ce=Math.abs(be)?G-Ce+be:be-Ce+G,G=Ce}G+ce>=0!=!!K&&me.reverse()}const z=o.vectorTile.VectorTileFeature.prototype.toGeoJSON;class B{constructor(K){this._feature=K,this.extent=o.EXTENT,this.type=K.type,this.properties=K.tags,"id"in K&&!isNaN(K.id)&&(this.id=parseInt(K.id,10))}loadGeometry(){if(this._feature.type===1){const K=[];for(const G of this._feature.geometry)K.push([new o.pointGeometry(G[0],G[1])]);return K}{const K=[];for(const G of this._feature.geometry){const ce=[];for(const ae of G)ce.push(new o.pointGeometry(ae[0],ae[1]));K.push(ce)}return K}}toGeoJSON(K,G,ce){return z.call(this,K,G,ce)}}class U{constructor(K){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=o.EXTENT,this.length=K.length,this._features=K}feature(K){return new B(this._features[K])}}var q={exports:{}},H=o.pointGeometry,te=o.vectorTile.VectorTileFeature,Y=le;function le(me,K){this.options=K||{},this.features=me,this.length=me.length}function J(me,K){this.id=typeof me.id=="number"?me.id:void 0,this.type=me.type,this.rawGeometry=me.type===1?[me.geometry]:me.geometry,this.properties=me.tags,this.extent=K||4096}le.prototype.feature=function(me){return new J(this.features[me],this.options.extent)},J.prototype.loadGeometry=function(){var me=this.rawGeometry;this.geometry=[];for(var K=0;K>31}function Te(me,K){for(var G=me.loadGeometry(),ce=me.type,ae=0,xe=0,Ee=G.length,be=0;be>1;Me(me,K,Ee,ce,ae,xe%2),De(me,K,G,ce,Ee-1,xe+1),De(me,K,G,Ee+1,ae,xe+1)}function Me(me,K,G,ce,ae,xe){for(;ae>ce;){if(ae-ce>600){const Oe=ae-ce+1,He=G-ce+1,We=Math.log(Oe),Be=.5*Math.exp(2*We/3),Ot=.5*Math.sqrt(We*Be*(Oe-Be)/Oe)*(He-Oe/2<0?-1:1);Me(me,K,G,Math.max(ce,Math.floor(G-He*Be/Oe+Ot)),Math.min(ae,Math.floor(G+(Oe-He)*Be/Oe+Ot)),xe)}const Ee=K[2*G+xe];let be=ce,Ce=ae;for(Ne(me,K,ce,G),K[2*ae+xe]>Ee&&Ne(me,K,ce,ae);beEe;)Ce--}K[2*ce+xe]===Ee?Ne(me,K,ce,Ce):(Ce++,Ne(me,K,Ce,ae)),Ce<=G&&(ce=Ce+1),G<=Ce&&(ae=Ce-1)}}function Ne(me,K,G,ce){Le(me,G,ce),Le(K,2*G,2*ce),Le(K,2*G+1,2*ce+1)}function Le(me,K,G){const ce=me[K];me[K]=me[G],me[G]=ce}function Ve(me,K,G,ce){const ae=me-G,xe=K-ce;return ae*ae+xe*xe}q.exports=ge,q.exports.fromVectorTileJs=ge,q.exports.fromGeojsonVt=function(me,K){K=K||{};var G={};for(var ce in me)G[ce]=new Q(me[ce].features,K),G[ce].name=ce,G[ce].version=K.version,G[ce].extent=K.extent;return ge({layers:G})},q.exports.GeoJSONWrapper=Q;const qe=me=>me[0],Ue=me=>me[1];class ct{constructor(K,G=qe,ce=Ue,ae=64,xe=Float64Array){this.nodeSize=ae,this.points=K;const Ee=K.length<65536?Uint16Array:Uint32Array,be=this.ids=new Ee(K.length),Ce=this.coords=new xe(2*K.length);for(let Oe=0;Oe=be&&bt<=Oe&&Je>=Ce&&Je<=He&&Ot.push(xe[Bn]);continue}const on=Math.floor((gn+Bt)/2);bt=Ee[2*on],Je=Ee[2*on+1],bt>=be&&bt<=Oe&&Je>=Ce&&Je<=He&&Ot.push(xe[on]);const yn=(Rt+1)%2;(Rt===0?be<=bt:Ce<=Je)&&(Be.push(gn),Be.push(on-1),Be.push(yn)),(Rt===0?Oe>=bt:He>=Je)&&(Be.push(on+1),Be.push(Bt),Be.push(yn))}return Ot}(this.ids,this.coords,K,G,ce,ae,this.nodeSize)}within(K,G,ce){return function(ae,xe,Ee,be,Ce,Oe){const He=[0,ae.length-1,0],We=[],Be=Ce*Ce;for(;He.length;){const Ot=He.pop(),bt=He.pop(),Je=He.pop();if(bt-Je<=Oe){for(let yn=Je;yn<=bt;yn++)Ve(xe[2*yn],xe[2*yn+1],Ee,be)<=Be&&We.push(ae[yn]);continue}const Rt=Math.floor((Je+bt)/2),Bt=xe[2*Rt],gn=xe[2*Rt+1];Ve(Bt,gn,Ee,be)<=Be&&We.push(ae[Rt]);const on=(Ot+1)%2;(Ot===0?Ee-Ce<=Bt:be-Ce<=gn)&&(He.push(Je),He.push(Rt-1),He.push(on)),(Ot===0?Ee+Ce>=Bt:be+Ce>=gn)&&(He.push(Rt+1),He.push(bt),He.push(on))}return We}(this.ids,this.coords,K,G,ce,this.nodeSize)}}const pt={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:me=>me},Tt=Math.fround||(Xe=new Float32Array(1),me=>(Xe[0]=+me,Xe[0]));var Xe;class Pt{constructor(K){this.options=it(Object.create(pt),K),this.trees=new Array(this.options.maxZoom+1)}load(K){const{log:G,minZoom:ce,maxZoom:ae,nodeSize:xe}=this.options;G&&console.time("total time");const Ee=`prepare ${K.length} points`;G&&console.time(Ee),this.points=K;let be=[];for(let Ce=0;Ce=ce;Ce--){const Oe=+Date.now();be=this._cluster(be,Ce),this.trees[Ce]=new ct(be,ft,xt,xe,Float32Array),G&&console.log("z%d: %d clusters in %dms",Ce,be.length,+Date.now()-Oe)}return G&&console.timeEnd("total time"),this}getClusters(K,G){let ce=((K[0]+180)%360+360)%360-180;const ae=Math.max(-90,Math.min(90,K[1]));let xe=K[2]===180?180:((K[2]+180)%360+360)%360-180;const Ee=Math.max(-90,Math.min(90,K[3]));if(K[2]-K[0]>=360)ce=-180,xe=180;else if(ce>xe){const He=this.getClusters([ce,ae,180,Ee],G),We=this.getClusters([-180,ae,xe,Ee],G);return He.concat(We)}const be=this.trees[this._limitZoom(G)],Ce=be.range(lt(ce),dt(Ee),lt(xe),dt(ae)),Oe=[];for(const He of Ce){const We=be.points[He];Oe.push(We.numPoints?Ct(We):this.points[We.index])}return Oe}getChildren(K){const G=this._getOriginId(K),ce=this._getOriginZoom(K),ae="No cluster with the specified id.",xe=this.trees[ce];if(!xe)throw new Error(ae);const Ee=xe.points[G];if(!Ee)throw new Error(ae);const be=this.options.radius/(this.options.extent*Math.pow(2,ce-1)),Ce=xe.within(Ee.x,Ee.y,be),Oe=[];for(const He of Ce){const We=xe.points[He];We.parentId===K&&Oe.push(We.numPoints?Ct(We):this.points[We.index])}if(Oe.length===0)throw new Error(ae);return Oe}getLeaves(K,G,ce){const ae=[];return this._appendLeaves(ae,K,G=G||10,ce=ce||0,0),ae}getTile(K,G,ce){const ae=this.trees[this._limitZoom(K)],xe=Math.pow(2,K),{extent:Ee,radius:be}=this.options,Ce=be/Ee,Oe=(ce-Ce)/xe,He=(ce+1+Ce)/xe,We={features:[]};return this._addTileFeatures(ae.range((G-Ce)/xe,Oe,(G+1+Ce)/xe,He),ae.points,G,ce,xe,We),G===0&&this._addTileFeatures(ae.range(1-Ce/xe,Oe,1,He),ae.points,xe,ce,xe,We),G===xe-1&&this._addTileFeatures(ae.range(0,Oe,Ce/xe,He),ae.points,-1,ce,xe,We),We.features.length?We:null}getClusterExpansionZoom(K){let G=this._getOriginZoom(K)-1;for(;G<=this.options.maxZoom;){const ce=this.getChildren(K);if(G++,ce.length!==1)break;K=ce[0].properties.cluster_id}return G}_appendLeaves(K,G,ce,ae,xe){const Ee=this.getChildren(G);for(const be of Ee){const Ce=be.properties;if(Ce&&Ce.cluster?xe+Ce.point_count<=ae?xe+=Ce.point_count:xe=this._appendLeaves(K,Ce.cluster_id,ce,ae,xe):xeG&&(bt+=Rt.numPoints||1)}if(bt>Ot&&bt>=be){let Je=He.x*Ot,Rt=He.y*Ot,Bt=Ee&&Ot>1?this._map(He,!0):null;const gn=(Oe<<5)+(G+1)+this.points.length;for(const on of Be){const yn=We.points[on];if(yn.zoom<=G)continue;yn.zoom=G;const Bn=yn.numPoints||1;Je+=yn.x*Bn,Rt+=yn.y*Bn,yn.parentId=gn,Ee&&(Bt||(Bt=this._map(He,!0)),Ee(Bt,this._map(yn)))}He.parentId=gn,ce.push(mt(Je/bt,Rt/bt,gn,bt,Bt))}else if(ce.push(He),bt>1)for(const Je of Be){const Rt=We.points[Je];Rt.zoom<=G||(Rt.zoom=G,ce.push(Rt))}}return ce}_getOriginId(K){return K-this.points.length>>5}_getOriginZoom(K){return(K-this.points.length)%32}_map(K,G){if(K.numPoints)return G?it({},K.properties):K.properties;const ce=this.points[K.index].properties,ae=this.options.map(ce);return G&&ae===ce?it({},ae):ae}}function mt(me,K,G,ce,ae){return{x:Tt(me),y:Tt(K),zoom:1/0,id:G,parentId:-1,numPoints:ce,properties:ae}}function Mt(me,K){const[G,ce]=me.geometry.coordinates;return{x:Tt(lt(G)),y:Tt(dt(ce)),zoom:1/0,index:K,parentId:-1}}function Ct(me){return{type:"Feature",id:me.id,properties:Lt(me),geometry:{type:"Point",coordinates:[(K=me.x,360*(K-.5)),ut(me.y)]}};var K}function Lt(me){const K=me.numPoints,G=K>=1e4?`${Math.round(K/1e3)}k`:K>=1e3?Math.round(K/100)/10+"k":K;return it(it({},me.properties),{cluster:!0,cluster_id:me.id,point_count:K,point_count_abbreviated:G})}function lt(me){return me/360+.5}function dt(me){const K=Math.sin(me*Math.PI/180),G=.5-.25*Math.log((1+K)/(1-K))/Math.PI;return G<0?0:G>1?1:G}function ut(me){const K=(180-360*me)*Math.PI/180;return 360*Math.atan(Math.exp(K))/Math.PI-90}function it(me,K){for(const G in K)me[G]=K[G];return me}function ft(me){return me.x}function xt(me){return me.y}function Wt(me,K,G,ce){for(var ae,xe=ce,Ee=G-K>>1,be=G-K,Ce=me[K],Oe=me[K+1],He=me[G],We=me[G+1],Be=K+3;Bexe)ae=Be,xe=Ot;else if(Ot===xe){var bt=Math.abs(Be-Ee);btce&&(ae-K>3&&Wt(me,K,ae,ce),me[ae+2]=xe,G-ae>3&&Wt(me,ae,G,ce))}function Ut(me,K,G,ce,ae,xe){var Ee=ae-G,be=xe-ce;if(Ee!==0||be!==0){var Ce=((me-G)*Ee+(K-ce)*be)/(Ee*Ee+be*be);Ce>1?(G=ae,ce=xe):Ce>0&&(G+=Ee*Ce,ce+=be*Ce)}return(Ee=me-G)*Ee+(be=K-ce)*be}function Qt(me,K,G,ce){var ae={id:me===void 0?null:me,type:K,geometry:G,tags:ce,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(xe){var Ee=xe.geometry,be=xe.type;if(be==="Point"||be==="MultiPoint"||be==="LineString")Fe(xe,Ee);else if(be==="Polygon"||be==="MultiLineString")for(var Ce=0;Ce0&&(Ee+=ce?(ae*Oe-Ce*xe)/2:Math.sqrt(Math.pow(Ce-ae,2)+Math.pow(Oe-xe,2))),ae=Ce,xe=Oe}var He=K.length-3;K[2]=1,Wt(K,0,He,G),K[He+2]=1,K.size=Math.abs(Ee),K.start=0,K.end=K.size}function Vt(me,K,G,ce){for(var ae=0;ae1?1:G}function _n(me,K,G,ce,ae,xe,Ee,be){if(ce/=K,xe>=(G/=K)&&Ee=ce)return null;for(var Ce=[],Oe=0;Oe=G&&bt=ce)){var Je=[];if(Be==="Point"||Be==="MultiPoint")An(We,Je,G,ce,ae);else if(Be==="LineString")_t(We,Je,G,ce,ae,!1,be.lineMetrics);else if(Be==="MultiLineString")an(We,Je,G,ce,ae,!1);else if(Be==="Polygon")an(We,Je,G,ce,ae,!0);else if(Be==="MultiPolygon")for(var Rt=0;Rt=G&&Ee<=ce&&(K.push(me[xe]),K.push(me[xe+1]),K.push(me[xe+2]))}}function _t(me,K,G,ce,ae,xe,Ee){for(var be,Ce,Oe=Gt(me),He=ae===0?kn:zt,We=me.start,Be=0;BeG&&(Ce=He(Oe,Ot,bt,Rt,Bt,G),Ee&&(Oe.start=We+be*Ce)):gn>ce?on=G&&(Ce=He(Oe,Ot,bt,Rt,Bt,G),yn=!0),on>ce&&gn<=ce&&(Ce=He(Oe,Ot,bt,Rt,Bt,ce),yn=!0),!xe&&yn&&(Ee&&(Oe.end=We+be*Ce),K.push(Oe),Oe=Gt(me)),Ee&&(We+=be)}var Bn=me.length-3;Ot=me[Bn],bt=me[Bn+1],Je=me[Bn+2],(gn=ae===0?Ot:bt)>=G&&gn<=ce&&Fn(Oe,Ot,bt,Je),Bn=Oe.length-3,xe&&Bn>=3&&(Oe[Bn]!==Oe[0]||Oe[Bn+1]!==Oe[1])&&Fn(Oe,Oe[0],Oe[1],Oe[2]),Oe.length&&K.push(Oe)}function Gt(me){var K=[];return K.size=me.size,K.start=me.start,K.end=me.end,K}function an(me,K,G,ce,ae,xe){for(var Ee=0;EeEe.maxX&&(Ee.maxX=He),We>Ee.maxY&&(Ee.maxY=We)}return Ee}function ht(me,K,G,ce){var ae=K.geometry,xe=K.type,Ee=[];if(xe==="Point"||xe==="MultiPoint")for(var be=0;be0&&K.size<(ae?Ee:ce))G.numPoints+=K.length/3;else{for(var be=[],Ce=0;CeEe)&&(G.numSimplified++,be.push(K[Ce]),be.push(K[Ce+1])),G.numPoints++;ae&&function(Oe,He){for(var We=0,Be=0,Ot=Oe.length,bt=Ot-2;Be0===He)for(Be=0,Ot=Oe.length;Be24)throw new Error("maxZoom should be in the 0-24 range");if(K.promoteId&&K.generateId)throw new Error("promoteId and generateId cannot be used together.");var ce=function(ae,xe){var Ee=[];if(ae.type==="FeatureCollection")for(var be=0;be1&&console.time("creation"),Be=this.tiles[We]=ot(me,K,G,ce,Ce),this.tileCoords.push({z:K,x:G,y:ce}),Oe)){Oe>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",K,G,ce,Be.numFeatures,Be.numPoints,Be.numSimplified),console.timeEnd("creation"));var Ot="z"+K;this.stats[Ot]=(this.stats[Ot]||0)+1,this.total++}if(Be.source=me,ae){if(K===Ce.maxZoom||K===ae)continue;var bt=1<1&&console.time("clipping");var Je,Rt,Bt,gn,on,yn,Bn=.5*Ce.buffer/Ce.extent,Jn=.5-Bn,Dr=.5+Bn,or=1+Bn;Je=Rt=Bt=gn=null,on=_n(me,He,G-Bn,G+Dr,0,Be.minX,Be.maxX,Ce),yn=_n(me,He,G+Jn,G+or,0,Be.minX,Be.maxX,Ce),me=null,on&&(Je=_n(on,He,ce-Bn,ce+Dr,1,Be.minY,Be.maxY,Ce),Rt=_n(on,He,ce+Jn,ce+or,1,Be.minY,Be.maxY,Ce),on=null),yn&&(Bt=_n(yn,He,ce-Bn,ce+Dr,1,Be.minY,Be.maxY,Ce),gn=_n(yn,He,ce+Jn,ce+or,1,Be.minY,Be.maxY,Ce),yn=null),Oe>1&&console.timeEnd("clipping"),be.push(Je||[],K+1,2*G,2*ce),be.push(Rt||[],K+1,2*G,2*ce+1),be.push(Bt||[],K+1,2*G+1,2*ce),be.push(gn||[],K+1,2*G+1,2*ce+1)}}},$t.prototype.getTile=function(me,K,G){var ce=this.options,ae=ce.extent,xe=ce.debug;if(me<0||me>24)return null;var Ee=1<1&&console.log("drilling down to z%d-%d-%d",me,K,G);for(var Ce,Oe=me,He=K,We=G;!Ce&&Oe>0;)Oe--,He=Math.floor(He/2),We=Math.floor(We/2),Ce=this.tiles[cn(Oe,He,We)];return Ce&&Ce.source?(xe>1&&console.log("found parent tile z%d-%d-%d",Oe,He,We),xe>1&&console.time("drilling down"),this.splitTile(Ce.source,Oe,He,We,me,K,G),xe>1&&console.timeEnd("drilling down"),this.tiles[be]?hn(this.tiles[be],ae):null):null};class Gn extends A{constructor(K,G,ce,ae){super(K,G,ce,Mn),ae&&(this.loadGeoJSON=ae)}loadData(K,G){var ce;(ce=this._pendingRequest)===null||ce===void 0||ce.cancel(),this._pendingCallback&&this._pendingCallback(null,{abandoned:!0});const ae=!!(K&&K.request&&K.request.collectResourceTiming)&&new o.RequestPerformance(K.request);this._pendingCallback=G,this._pendingRequest=this.loadGeoJSON(K,(xe,Ee)=>{if(delete this._pendingCallback,delete this._pendingRequest,xe||!Ee)return G(xe);if(typeof Ee!="object")return G(new Error(`Input data given to '${K.source}' is not a valid GeoJSON object.`));{M(Ee,!0);try{if(K.filter){const Ce=o.createExpression(K.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(Ce.result==="error")throw new Error(Ce.value.map(He=>`${He.key}: ${He.message}`).join(", "));Ee={type:"FeatureCollection",features:Ee.features.filter(He=>Ce.value.evaluate({zoom:0},He))}}this._geoJSONIndex=K.cluster?new Pt(function({superclusterOptions:Ce,clusterProperties:Oe}){if(!Oe||!Ce)return Ce;const He={},We={},Be={accumulated:null,zoom:0},Ot={properties:null},bt=Object.keys(Oe);for(const Je of bt){const[Rt,Bt]=Oe[Je],gn=o.createExpression(Bt),on=o.createExpression(typeof Rt=="string"?[Rt,["accumulated"],["get",Je]]:Rt);He[Je]=gn.value,We[Je]=on.value}return Ce.map=Je=>{Ot.properties=Je;const Rt={};for(const Bt of bt)Rt[Bt]=He[Bt].evaluate(Be,Ot);return Rt},Ce.reduce=(Je,Rt)=>{Ot.properties=Rt;for(const Bt of bt)Be.accumulated=Je[Bt],Je[Bt]=We[Bt].evaluate(Be,Ot)},Ce}(K)).load(Ee.features):function(Ce,Oe){return new $t(Ce,Oe)}(Ee,K.geojsonVtOptions)}catch(Ce){return G(Ce)}this.loaded={};const be={};if(ae){const Ce=ae.finish();Ce&&(be.resourceTiming={},be.resourceTiming[K.source]=JSON.parse(JSON.stringify(Ce)))}G(null,be)}})}reloadTile(K,G){const ce=this.loaded;return ce&&ce[K.uid]?super.reloadTile(K,G):this.loadTile(K,G)}loadGeoJSON(K,G){if(K.request)return o.getJSON(K.request,G);if(typeof K.data=="string")try{G(null,JSON.parse(K.data))}catch{G(new Error(`Input data given to '${K.source}' is not a valid GeoJSON object.`))}else G(new Error(`Input data given to '${K.source}' is not a valid GeoJSON object.`));return{cancel:()=>{}}}removeSource(K,G){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),G()}getClusterExpansionZoom(K,G){try{G(null,this._geoJSONIndex.getClusterExpansionZoom(K.clusterId))}catch(ce){G(ce)}}getClusterChildren(K,G){try{G(null,this._geoJSONIndex.getChildren(K.clusterId))}catch(ce){G(ce)}}getClusterLeaves(K,G){try{G(null,this._geoJSONIndex.getLeaves(K.clusterId,K.limit,K.offset))}catch(ce){G(ce)}}}class qn{constructor(K){this.self=K,this.actor=new o.Actor(K,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:A,geojson:Gn},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(G,ce)=>{if(this.workerSourceTypes[G])throw new Error(`Worker source with name "${G}" already registered.`);this.workerSourceTypes[G]=ce},this.self.registerRTLTextPlugin=G=>{if(o.plugin.isParsed())throw new Error("RTL text plugin already registered.");o.plugin.applyArabicShaping=G.applyArabicShaping,o.plugin.processBidirectionalText=G.processBidirectionalText,o.plugin.processStyledBidirectionalText=G.processStyledBidirectionalText}}setReferrer(K,G){this.referrer=G}setImages(K,G,ce){this.availableImages[K]=G;for(const ae in this.workerSources[K]){const xe=this.workerSources[K][ae];for(const Ee in xe)xe[Ee].availableImages=G}ce()}setLayers(K,G,ce){this.getLayerIndex(K).replace(G),ce()}updateLayers(K,G,ce){this.getLayerIndex(K).update(G.layers,G.removedIds),ce()}loadTile(K,G,ce){this.getWorkerSource(K,G.type,G.source).loadTile(G,ce)}loadDEMTile(K,G,ce){this.getDEMWorkerSource(K,G.source).loadTile(G,ce)}reloadTile(K,G,ce){this.getWorkerSource(K,G.type,G.source).reloadTile(G,ce)}abortTile(K,G,ce){this.getWorkerSource(K,G.type,G.source).abortTile(G,ce)}removeTile(K,G,ce){this.getWorkerSource(K,G.type,G.source).removeTile(G,ce)}removeDEMTile(K,G){this.getDEMWorkerSource(K,G.source).removeTile(G)}removeSource(K,G,ce){if(!this.workerSources[K]||!this.workerSources[K][G.type]||!this.workerSources[K][G.type][G.source])return;const ae=this.workerSources[K][G.type][G.source];delete this.workerSources[K][G.type][G.source],ae.removeSource!==void 0?ae.removeSource(G,ce):ce()}loadWorkerSource(K,G,ce){try{this.self.importScripts(G.url),ce()}catch(ae){ce(ae.toString())}}syncRTLPluginState(K,G,ce){try{o.plugin.setState(G);const ae=o.plugin.getPluginURL();if(o.plugin.isLoaded()&&!o.plugin.isParsed()&&ae!=null){this.self.importScripts(ae);const xe=o.plugin.isParsed();ce(xe?void 0:new Error(`RTL Text Plugin failed to import scripts from ${ae}`),xe)}}catch(ae){ce(ae.toString())}}getAvailableImages(K){let G=this.availableImages[K];return G||(G=[]),G}getLayerIndex(K){let G=this.layerIndexes[K];return G||(G=this.layerIndexes[K]=new g),G}getWorkerSource(K,G,ce){if(this.workerSources[K]||(this.workerSources[K]={}),this.workerSources[K][G]||(this.workerSources[K][G]={}),!this.workerSources[K][G][ce]){const ae={send:(xe,Ee,be)=>{this.actor.send(xe,Ee,be,K)}};this.workerSources[K][G][ce]=new this.workerSourceTypes[G](ae,this.getLayerIndex(K),this.getAvailableImages(K))}return this.workerSources[K][G][ce]}getDEMWorkerSource(K,G){return this.demWorkerSources[K]||(this.demWorkerSources[K]={}),this.demWorkerSources[K][G]||(this.demWorkerSources[K][G]=new O),this.demWorkerSources[K][G]}enforceCacheSizeLimit(K,G){o.enforceCacheSizeLimit(G)}}return o.isWorker()&&(self.worker=new qn(self)),qn}),l(["./shared"],function(o){var h=p;function p(y){return!function(s){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 v,_,k=new Blob([""],{type:"text/javascript"}),D=URL.createObjectURL(k);try{_=new Worker(D),v=!0}catch{v=!1}return _&&_.terminate(),URL.revokeObjectURL(D),v}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var v=document.createElement("canvas");v.width=v.height=1;var _=v.getContext("2d");if(!_)return!1;var k=_.getImageData(0,0,1,1);return k&&k.width===v.width}()?(g[f=s&&s.failIfMajorPerformanceCaveat]===void 0&&(g[f]=function(v){var _,k=function(D){var $=document.createElement("canvas"),V=Object.create(p.webGLContextAttributes);return V.failIfMajorPerformanceCaveat=D,$.getContext("webgl",V)||$.getContext("experimental-webgl",V)}(v);if(!k)return!1;try{_=k.createShader(k.VERTEX_SHADER)}catch{return!1}return!(!_||k.isContextLost())&&(k.shaderSource(_,"void main() {}"),k.compileShader(_),k.getShaderParameter(_,k.COMPILE_STATUS)===!0)}(f)),g[f]?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 f}(y)}var g={};function b(y,s){if(Array.isArray(y)){if(!Array.isArray(s)||y.length!==s.length)return!1;for(let f=0;f{window.removeEventListener("click",w.suppressClickInternal,!0)},0)}static mousePos(s,f){const v=s.getBoundingClientRect();return new o.pointGeometry(f.clientX-v.left-s.clientLeft,f.clientY-v.top-s.clientTop)}static touchPos(s,f){const v=s.getBoundingClientRect(),_=[];for(let k=0;k-1);V++,k[V]=$,D[V]=W,D[V+1]=R}for(let $=0,V=0;${let $=this.entries[_];$||($=this.entries[_]={glyphs:{},requests:{},ranges:{}});let V=$.glyphs[k];if(V!==void 0)return void D(null,{stack:_,id:k,glyph:V});if(V=this._tinySDF($,_,k),V)return $.glyphs[k]=V,void D(null,{stack:_,id:k,glyph:V});const W=Math.floor(k/256);if(256*W>65535)return void D(new Error("glyphs > 65535 not supported"));if($.ranges[W])return void D(null,{stack:_,id:k,glyph:V});let ee=$.requests[W];ee||(ee=$.requests[W]=[],B.loadGlyphRange(_,W,this.url,this.requestManager,(ie,fe)=>{if(fe){for(const Se in fe)this._doesCharSupportLocalGlyph(+Se)||($.glyphs[+Se]=fe[+Se]);$.ranges[W]=!0}for(const Se of ee)Se(ie,fe);delete $.requests[W]})),ee.push((ie,fe)=>{ie?D(ie):fe&&D(null,{stack:_,id:k,glyph:fe[k]||null})})},(_,k)=>{if(_)f(_);else if(k){const D={};for(const{stack:$,id:V,glyph:W}of k)(D[$]||(D[$]={}))[V]=W&&{id:W.id,bitmap:W.bitmap.clone(),metrics:W.metrics};f(null,D)}})}_doesCharSupportLocalGlyph(s){return!!this.localIdeographFontFamily&&(o.unicodeBlockLookup["CJK Unified Ideographs"](s)||o.unicodeBlockLookup["Hangul Syllables"](s)||o.unicodeBlockLookup.Hiragana(s)||o.unicodeBlockLookup.Katakana(s))}_tinySDF(s,f,v){const _=this.localIdeographFontFamily;if(!_||!this._doesCharSupportLocalGlyph(v))return;let k=s.tinySDF;if(!k){let $="400";/bold/i.test(f)?$="900":/medium/i.test(f)?$="500":/light/i.test(f)&&($="200"),k=s.tinySDF=new B.TinySDF({fontSize:24,buffer:3,radius:8,cutoff:.25,fontFamily:_,fontWeight:$})}const D=k.draw(String.fromCharCode(v));return{id:v,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(y,s,f,v,_){const k=256*s,D=k+255,$=v.transformRequest(f.replace("{fontstack}",y).replace("{range}",`${k}-${D}`),o.ResourceType.Glyphs);o.getArrayBuffer($,(V,W)=>{if(V)_(V);else if(W){const ee={};for(const ie of o.parseGlyphPbf(W))ee[ie.id]=ie;_(null,ee)}})},B.TinySDF=class{constructor({fontSize:y=24,buffer:s=3,radius:f=8,cutoff:v=.25,fontFamily:_="sans-serif",fontWeight:k="normal",fontStyle:D="normal"}={}){this.buffer=s,this.cutoff=v,this.radius=f;const $=this.size=y+4*s,V=this._createCanvas($),W=this.ctx=V.getContext("2d",{willReadFrequently:!0});W.font=`${D} ${k} ${y}px ${_}`,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(y){const s=document.createElement("canvas");return s.width=s.height=y,s}draw(y){const{width:s,actualBoundingBoxAscent:f,actualBoundingBoxDescent:v,actualBoundingBoxLeft:_,actualBoundingBoxRight:k}=this.ctx.measureText(y),D=Math.ceil(f),$=Math.min(this.size-this.buffer,Math.ceil(k-_)),V=Math.min(this.size-this.buffer,D+Math.ceil(v)),W=$+2*this.buffer,ee=V+2*this.buffer,ie=Math.max(W*ee,0),fe=new Uint8ClampedArray(ie),Se={data:fe,width:W,height:ee,glyphWidth:$,glyphHeight:V,glyphTop:D,glyphLeft:0,glyphAdvance:s};if($===0||V===0)return Se;const{ctx:_e,buffer:we,gridInner:$e,gridOuter:je}=this;_e.clearRect(we,we,$,V),_e.fillText(y,we,we+D);const et=_e.getImageData(we,we,$,V);je.fill(R,0,ie),$e.fill(0,0,ie);for(let Pe=0;Pe0?yt*yt:0,$e[gt]=yt<0?yt*yt:0}}N(je,0,0,W,ee,W,this.f,this.v,this.z),N($e,we,we,$,V,W,this.f,this.v,this.z);for(let Pe=0;Pe1&&(V=s[++$]);const ee=Math.abs(W-V.left),ie=Math.abs(W-V.right),fe=Math.min(ee,ie);let Se;const _e=k/v*(_+1);if(V.isDash){const we=_-Math.abs(_e);Se=Math.sqrt(fe*fe+we*we)}else Se=_-Math.sqrt(fe*fe+_e*_e);this.data[D+W]=Math.max(0,Math.min(255,Se+128))}}}addRegularDash(s){for(let $=s.length-1;$>=0;--$){const V=s[$],W=s[$+1];V.zeroLength?s.splice($,1):W&&W.isDash===V.isDash&&(W.left=V.left,s.splice($,1))}const f=s[0],v=s[s.length-1];f.isDash===v.isDash&&(f.left=v.left-this.width,v.right=f.right+this.width);const _=this.width*this.nextRow;let k=0,D=s[k];for(let $=0;$1&&(D=s[++k]);const V=Math.abs($-D.left),W=Math.abs($-D.right),ee=Math.min(V,W);this.data[_+$]=Math.max(0,Math.min(255,(D.isDash?ee:-ee)+128))}}addDash(s,f){const v=f?7:0,_=2*v+1;if(this.nextRow+_>this.height)return o.warnOnce("LineAtlas out of space"),null;let k=0;for(let $=0;${_.send(s,f,k)},v=v||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach(s=>{s.remove()}),this.actors=[],this.workerPool.release(this.id)}}function le(y,s,f){const v=function(_,k){if(_)return f(_);if(k){const D=o.pick(o.extend(k,y),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);k.vector_layers&&(D.vectorLayers=k.vector_layers,D.vectorLayerIds=D.vectorLayers.map($=>$.id)),f(null,D)}};return y.url?o.getJSON(s.transformRequest(y.url,o.ResourceType.Source),v):o.exported.frame(()=>v(null,y))}Y.Actor=o.Actor;class J{constructor(s,f,v){this.bounds=o.LngLatBounds.convert(this.validateBounds(s)),this.minzoom=f||0,this.maxzoom=v||24}validateBounds(s){return Array.isArray(s)&&s.length===4?[Math.max(-180,s[0]),Math.max(-90,s[1]),Math.min(180,s[2]),Math.min(90,s[3])]:[-180,-90,180,90]}contains(s){const f=Math.pow(2,s.z),v=Math.floor(o.mercatorXfromLng(this.bounds.getWest())*f),_=Math.floor(o.mercatorYfromLat(this.bounds.getNorth())*f),k=Math.ceil(o.mercatorXfromLng(this.bounds.getEast())*f),D=Math.ceil(o.mercatorYfromLat(this.bounds.getSouth())*f);return s.x>=v&&s.x=_&&s.y{this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),s?this.fire(new o.ErrorEvent(s)):f&&(o.extend(this,f),f.bounds&&(this.tileBounds=new J(f.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(s){return!this.tileBounds||this.tileBounds.contains(s.canonical)}onAdd(s){this.map=s,this.load()}setSourceProperty(s){this._tileJSONRequest&&this._tileJSONRequest.cancel(),s(),this.load()}setTiles(s){return this.setSourceProperty(()=>{this._options.tiles=s}),this}setUrl(s){return this.setSourceProperty(()=>{this.url=s,this._options.url=s}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return o.extend({},this._options)}loadTile(s,f){const v=s.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),_={request:this.map._requestManager.transformRequest(v,o.ResourceType.Tile),uid:s.uid,tileID:s.tileID,zoom:s.tileID.overscaledZ,tileSize:this.tileSize*s.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function k(D,$){return delete s.request,s.aborted?f(null):D&&D.status!==404?f(D):($&&$.resourceTiming&&(s.resourceTiming=$.resourceTiming),this.map._refreshExpiredTiles&&$&&s.setExpiryData($),s.loadVectorData($,this.map.painter),o.cacheEntryPossiblyAdded(this.dispatcher),f(null),void(s.reloadCallback&&(this.loadTile(s,s.reloadCallback),s.reloadCallback=null)))}_.request.collectResourceTiming=this._collectResourceTiming,s.actor&&s.state!=="expired"?s.state==="loading"?s.reloadCallback=f:s.request=s.actor.send("reloadTile",_,k.bind(this)):(s.actor=this.dispatcher.getActor(),s.request=s.actor.send("loadTile",_,k.bind(this)))}abortTile(s){s.request&&(s.request.cancel(),delete s.request),s.actor&&s.actor.send("abortTile",{uid:s.uid,type:this.type,source:this.id},void 0)}unloadTile(s){s.unloadVectorData(),s.actor&&s.actor.send("removeTile",{uid:s.uid,type:this.type,source:this.id},void 0)}hasTransition(){return!1}}class Q extends o.Evented{constructor(s,f,v,_){super(),this.id=s,this.dispatcher=v,this.setEventedParent(_),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"},f),o.extend(this,o.pick(f,["url","scheme","tileSize"]))}load(){this._loaded=!1,this.fire(new o.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=le(this._options,this.map._requestManager,(s,f)=>{this._tileJSONRequest=null,this._loaded=!0,s?this.fire(new o.ErrorEvent(s)):f&&(o.extend(this,f),f.bounds&&(this.tileBounds=new J(f.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(s){this.map=s,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return o.extend({},this._options)}hasTile(s){return!this.tileBounds||this.tileBounds.contains(s.canonical)}loadTile(s,f){const v=s.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);s.request=o.getImage(this.map._requestManager.transformRequest(v,o.ResourceType.Tile),(_,k,D)=>{if(delete s.request,s.aborted)s.state="unloaded",f(null);else if(_)s.state="errored",f(_);else if(k){this.map._refreshExpiredTiles&&s.setExpiryData(D);const $=this.map.painter.context,V=$.gl;s.texture=this.map.painter.getTileTexture(k.width),s.texture?s.texture.update(k,{useMipmap:!0}):(s.texture=new A($,k,V.RGBA,{useMipmap:!0}),s.texture.bind(V.LINEAR,V.CLAMP_TO_EDGE,V.LINEAR_MIPMAP_NEAREST),$.extTextureFilterAnisotropic&&V.texParameterf(V.TEXTURE_2D,$.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,$.extTextureFilterAnisotropicMax)),s.state="loaded",o.cacheEntryPossiblyAdded(this.dispatcher),f(null)}})}abortTile(s,f){s.request&&(s.request.cancel(),delete s.request),f()}unloadTile(s,f){s.texture&&this.map.painter.saveTileTexture(s.texture),f()}hasTransition(){return!1}}let ge;class re extends Q{constructor(s,f,v,_){super(s,f,v,_),this.type="raster-dem",this.maxzoom=22,this._options=o.extend({type:"raster-dem"},f),this.encoding=f.encoding||"mapbox"}serialize(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}}loadTile(s,f){const v=s.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);function _(k,D){k&&(s.state="errored",f(k)),D&&(s.dem=D,s.needsHillshadePrepare=!0,s.needsTerrainPrepare=!0,s.state="loaded",f(null))}s.request=o.getImage(this.map._requestManager.transformRequest(v,o.ResourceType.Tile),function(k,D){if(delete s.request,s.aborted)s.state="unloaded",f(null);else if(k)s.state="errored",f(k);else if(D){this.map._refreshExpiredTiles&&s.setExpiryData(D),delete D.cacheControl,delete D.expires;const $=o.isImageBitmap(D)&&(ge==null&&(ge=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),ge)?D:o.exported.getImageData(D,1),V={uid:s.uid,coord:s.tileID,source:this.id,rawImageData:$,encoding:this.encoding};s.actor&&s.state!=="expired"||(s.actor=this.dispatcher.getActor(),s.actor.send("loadDEMTile",V,_.bind(this)))}}.bind(this)),s.neighboringTiles=this._getNeighboringTiles(s.tileID)}_getNeighboringTiles(s){const f=s.canonical,v=Math.pow(2,f.z),_=(f.x-1+v)%v,k=f.x===0?s.wrap-1:s.wrap,D=(f.x+1+v)%v,$=f.x+1===v?s.wrap+1:s.wrap,V={};return V[new o.OverscaledTileID(s.overscaledZ,k,f.z,_,f.y).key]={backfilled:!1},V[new o.OverscaledTileID(s.overscaledZ,$,f.z,D,f.y).key]={backfilled:!1},f.y>0&&(V[new o.OverscaledTileID(s.overscaledZ,k,f.z,_,f.y-1).key]={backfilled:!1},V[new o.OverscaledTileID(s.overscaledZ,s.wrap,f.z,f.x,f.y-1).key]={backfilled:!1},V[new o.OverscaledTileID(s.overscaledZ,$,f.z,D,f.y-1).key]={backfilled:!1}),f.y+1{if(this._pendingLoads--,this._removed||k&&k.abandoned)return void this.fire(new o.Event("dataabort",{dataType:"source",sourceDataType:s}));let D=null;if(k&&k.resourceTiming&&k.resourceTiming[this.id]&&(D=k.resourceTiming[this.id].slice(0)),_)return void this.fire(new o.ErrorEvent(_));const $={dataType:"source",sourceDataType:s};this._collectResourceTiming&&D&&D.length>0&&o.extend($,{resourceTiming:D}),this.fire(new o.Event("data",$))})}loaded(){return this._pendingLoads===0}loadTile(s,f){const v=s.actor?"reloadTile":"loadTile";s.actor=this.actor;const _={type:this.type,uid:s.uid,tileID:s.tileID,zoom:s.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};s.request=this.actor.send(v,_,(k,D)=>(delete s.request,s.unloadVectorData(),s.aborted?f(null):k?f(k):(s.loadVectorData(D,this.map.painter,v==="reloadTile"),f(null))))}abortTile(s){s.request&&(s.request.cancel(),delete s.request),s.aborted=!0}unloadTile(s){s.unloadVectorData(),this.actor.send("removeTile",{uid:s.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(s,f,v,_){super(),this.id=s,this.dispatcher=v,this.coordinates=f.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(_),this.options=f}load(s,f){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),(v,_)=>{this._loaded=!0,v?this.fire(new o.ErrorEvent(v)):_&&(this.image=_,s&&(this.coordinates=s),f&&f(),this._finishLoading())})}loaded(){return this._loaded}updateImage(s){return this.image&&s.url?(this.options.url=s.url,this.load(s.coordinates,()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new o.Event("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(s){this.map=s,this.load()}setCoordinates(s){this.coordinates=s;const f=s.map(o.MercatorCoordinate.fromLngLat);this.tileID=function(_){let k=1/0,D=1/0,$=-1/0,V=-1/0;for(const fe of _)k=Math.min(k,fe.x),D=Math.min(D,fe.y),$=Math.max($,fe.x),V=Math.max(V,fe.y);const W=Math.max($-k,V-D),ee=Math.max(0,Math.floor(-Math.log(W)/Math.LN2)),ie=Math.pow(2,ee);return new o.CanonicalTileID(ee,Math.floor((k+$)/2*ie),Math.floor((D+V)/2*ie))}(f),this.minzoom=this.maxzoom=this.tileID.z;const v=f.map(_=>this.tileID.getTilePoint(_)._round());return this._boundsArray=new o.RasterBoundsArray,this._boundsArray.emplaceBack(v[0].x,v[0].y,0,0),this._boundsArray.emplaceBack(v[1].x,v[1].y,o.EXTENT,0),this._boundsArray.emplaceBack(v[3].x,v[3].y,0,o.EXTENT),this._boundsArray.emplaceBack(v[2].x,v[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 s=this.map.painter.context,f=s.gl;this.boundsBuffer||(this.boundsBuffer=s.createVertexBuffer(this._boundsArray,oe.members)),this.boundsSegments||(this.boundsSegments=o.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new A(s,this.image,f.RGBA),this.texture.bind(f.LINEAR,f.CLAMP_TO_EDGE));for(const v in this.tiles){const _=this.tiles[v];_.state!=="loaded"&&(_.state="loaded",_.texture=this.texture)}}loadTile(s,f){this.tileID&&this.tileID.equals(s.tileID.canonical)?(this.tiles[String(s.tileID.wrap)]=s,s.buckets={},f(null)):(s.state="errored",f(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class Re extends ye{constructor(s,f,v,_){super(s,f,v,_),this.roundZoom=!0,this.type="video",this.options=f}load(){this._loaded=!1;const s=this.options;this.urls=[];for(const f of s.urls)this.urls.push(this.map._requestManager.transformRequest(f,o.ResourceType.Source).url);o.getVideo(this.urls,(f,v)=>{this._loaded=!0,f?this.fire(new o.ErrorEvent(f)):v&&(this.video=v,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(s){if(this.video){const f=this.video.seekable;sf.end(0)?this.fire(new o.ErrorEvent(new o.ValidationError(`sources.${this.id}`,null,`Playback for this video can be set only between the ${f.start(0)} and ${f.end(0)}-second mark.`))):this.video.currentTime=s}}getVideo(){return this.video}onAdd(s){this.map||(this.map=s,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 s=this.map.painter.context,f=s.gl;this.boundsBuffer||(this.boundsBuffer=s.createVertexBuffer(this._boundsArray,oe.members)),this.boundsSegments||(this.boundsSegments=o.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(f.LINEAR,f.CLAMP_TO_EDGE),f.texSubImage2D(f.TEXTURE_2D,0,0,0,f.RGBA,f.UNSIGNED_BYTE,this.video)):(this.texture=new A(s,this.video,f.RGBA),this.texture.bind(f.LINEAR,f.CLAMP_TO_EDGE));for(const v in this.tiles){const _=this.tiles[v];_.state!=="loaded"&&(_.state="loaded",_.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(s,f,v,_){super(s,f,v,_),f.coordinates?Array.isArray(f.coordinates)&&f.coordinates.length===4&&!f.coordinates.some(k=>!Array.isArray(k)||k.length!==2||k.some(D=>typeof D!="number"))||this.fire(new o.ErrorEvent(new o.ValidationError(`sources.${s}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new o.ErrorEvent(new o.ValidationError(`sources.${s}`,null,'missing required property "coordinates"'))),f.animate&&typeof f.animate!="boolean"&&this.fire(new o.ErrorEvent(new o.ValidationError(`sources.${s}`,null,'optional "animate" property must be a boolean value'))),f.canvas?typeof f.canvas=="string"||f.canvas instanceof HTMLCanvasElement||this.fire(new o.ErrorEvent(new o.ValidationError(`sources.${s}`,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.${s}`,null,'missing required property "canvas"'))),this.options=f,this.animate=f.animate===void 0||f.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(s){this.map=s,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let s=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,s=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,s=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const f=this.map.painter.context,v=f.gl;this.boundsBuffer||(this.boundsBuffer=f.createVertexBuffer(this._boundsArray,oe.members)),this.boundsSegments||(this.boundsSegments=o.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(s||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new A(f,this.canvas,v.RGBA,{premultiply:!0});for(const _ in this.tiles){const k=this.tiles[_];k.state!=="loaded"&&(k.state="loaded",k.texture=this.texture)}}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const s of[this.canvas.width,this.canvas.height])if(isNaN(s)||s<=0)return!0;return!1}}const ke={vector:Z,raster:Q,"raster-dem":re,geojson:de,video:Re,image:ye,canvas:Te};function De(y,s){const f=o.create();return o.translate(f,f,[1,1,0]),o.scale(f,f,[.5*y.width,.5*y.height,1]),o.multiply(f,f,y.calculatePosMatrix(s.toUnwrapped()))}function Me(y,s,f,v,_,k){const D=function(ie,fe,Se){if(ie)for(const _e of ie){const we=fe[_e];if(we&&we.source===Se&&we.type==="fill-extrusion")return!0}else for(const _e in fe){const we=fe[_e];if(we.source===Se&&we.type==="fill-extrusion")return!0}return!1}(_&&_.layers,s,y.id),$=k.maxPitchScaleFactor(),V=y.tilesIn(v,$,D);V.sort(Ne);const W=[];for(const ie of V)W.push({wrappedTileID:ie.tileID.wrapped().key,queryResults:ie.tile.queryRenderedFeatures(s,f,y._state,ie.queryGeometry,ie.cameraQueryGeometry,ie.scale,_,k,$,De(y.transform,ie.tileID))});const ee=function(ie){const fe={},Se={};for(const _e of ie){const we=_e.queryResults,$e=_e.wrappedTileID,je=Se[$e]=Se[$e]||{};for(const et in we){const Pe=we[et],at=je[et]=je[et]||{},nt=fe[et]=fe[et]||[];for(const gt of Pe)at[gt.featureIndex]||(at[gt.featureIndex]=!0,nt.push(gt))}}return fe}(W);for(const ie in ee)ee[ie].forEach(fe=>{const Se=fe.feature,_e=y.getFeatureState(Se.layer["source-layer"],Se.id);Se.source=Se.layer.source,Se.layer["source-layer"]&&(Se.sourceLayer=Se.layer["source-layer"]),Se.state=_e});return ee}function Ne(y,s){const f=y.tileID,v=s.tileID;return f.overscaledZ-v.overscaledZ||f.canonical.y-v.canonical.y||f.wrap-v.wrap||f.canonical.x-v.canonical.x}class Le{constructor(s,f){this.tileID=s,this.uid=o.uniqueId(),this.uses=0,this.tileSize=f,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(s){const f=s+this.timeAdded;fs.saveTileTexture(f)),this.demTexture=null,this.textures=[],this.textureCoords={}}loadVectorData(s,f,v){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",s){s.featureIndex&&(this.latestFeatureIndex=s.featureIndex,s.rawTileData?(this.latestRawTileData=s.rawTileData,this.latestFeatureIndex.rawTileData=s.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=s.collisionBoxArray,this.buckets=function(_,k){const D={};if(!k)return D;for(const $ of _){const V=$.layerIds.map(W=>k.getLayer(W)).filter(Boolean);if(V.length!==0){$.layers=V,$.stateDependentLayerIds&&($.stateDependentLayers=$.stateDependentLayerIds.map(W=>V.filter(ee=>ee.id===W)[0]));for(const W of V)D[W.id]=$}}return D}(s.buckets,f.style),this.hasSymbolBuckets=!1;for(const _ in this.buckets){const k=this.buckets[_];if(k instanceof o.SymbolBucket){if(this.hasSymbolBuckets=!0,!v)break;k.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const _ in this.buckets){const k=this.buckets[_];if(k instanceof o.SymbolBucket&&k.hasRTLText){this.hasRTLText=!0,o.lazyLoadRTLTextPlugin();break}}this.queryPadding=0;for(const _ in this.buckets){const k=this.buckets[_];this.queryPadding=Math.max(this.queryPadding,f.style.getLayer(_).queryRadius(k))}s.imageAtlas&&(this.imageAtlas=s.imageAtlas),s.glyphAtlasImage&&(this.glyphAtlasImage=s.glyphAtlasImage)}else this.collisionBoxArray=new o.CollisionBoxArray}unloadVectorData(){for(const s in this.buckets)this.buckets[s].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(s){return this.buckets[s.id]}upload(s){for(const v in this.buckets){const _=this.buckets[v];_.uploadPending()&&_.upload(s)}const f=s.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new A(s,this.imageAtlas.image,f.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new A(s,this.glyphAtlasImage,f.ALPHA),this.glyphAtlasImage=null)}prepare(s){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(s,this.imageAtlasTexture)}queryRenderedFeatures(s,f,v,_,k,D,$,V,W,ee){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:_,cameraQueryGeometry:k,scale:D,tileSize:this.tileSize,pixelPosMatrix:ee,transform:V,params:$,queryPadding:this.queryPadding*W},s,f,v):{}}querySourceFeatures(s,f){const v=this.latestFeatureIndex;if(!v||!v.rawTileData)return;const _=v.loadVTLayers(),k=f?f.sourceLayer:"",D=_._geojsonTileLayer||_[k];if(!D)return;const $=o.createFilter(f&&f.filter),{z:V,x:W,y:ee}=this.tileID.canonical,ie={z:V,x:W,y:ee};for(let fe=0;fev)_=!1;else if(f)if(this.expirationTime{this.remove(s,k)},v)),this.data[_].push(k),this.order.push(_),this.order.length>this.max){const D=this._getAndRemoveByKey(this.order[0]);D&&this.onRemove(D)}return this}has(s){return s.wrapped().key in this.data}getAndRemove(s){return this.has(s)?this._getAndRemoveByKey(s.wrapped().key):null}_getAndRemoveByKey(s){const f=this.data[s].shift();return f.timeout&&clearTimeout(f.timeout),this.data[s].length===0&&delete this.data[s],this.order.splice(this.order.indexOf(s),1),f.value}getByKey(s){const f=this.data[s];return f?f[0].value:null}get(s){return this.has(s)?this.data[s.wrapped().key][0].value:null}remove(s,f){if(!this.has(s))return this;const v=s.wrapped().key,_=f===void 0?0:this.data[v].indexOf(f),k=this.data[v][_];return this.data[v].splice(_,1),k.timeout&&clearTimeout(k.timeout),this.data[v].length===0&&delete this.data[v],this.onRemove(k.value),this.order.splice(this.order.indexOf(v),1),this}setMaxSize(s){for(this.max=s;this.order.length>this.max;){const f=this._getAndRemoveByKey(this.order[0]);f&&this.onRemove(f)}return this}filter(s){const f=[];for(const v in this.data)for(const _ of this.data[v])s(_.value)||f.push(_);for(const v of f)this.remove(v.value.tileID,v)}}class qe{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(s,f,v){const _=String(f);if(this.stateChanges[s]=this.stateChanges[s]||{},this.stateChanges[s][_]=this.stateChanges[s][_]||{},o.extend(this.stateChanges[s][_],v),this.deletedStates[s]===null){this.deletedStates[s]={};for(const k in this.state[s])k!==_&&(this.deletedStates[s][k]=null)}else if(this.deletedStates[s]&&this.deletedStates[s][_]===null){this.deletedStates[s][_]={};for(const k in this.state[s][_])v[k]||(this.deletedStates[s][_][k]=null)}else for(const k in v)this.deletedStates[s]&&this.deletedStates[s][_]&&this.deletedStates[s][_][k]===null&&delete this.deletedStates[s][_][k]}removeFeatureState(s,f,v){if(this.deletedStates[s]===null)return;const _=String(f);if(this.deletedStates[s]=this.deletedStates[s]||{},v&&f!==void 0)this.deletedStates[s][_]!==null&&(this.deletedStates[s][_]=this.deletedStates[s][_]||{},this.deletedStates[s][_][v]=null);else if(f!==void 0)if(this.stateChanges[s]&&this.stateChanges[s][_])for(v in this.deletedStates[s][_]={},this.stateChanges[s][_])this.deletedStates[s][_][v]=null;else this.deletedStates[s][_]=null;else this.deletedStates[s]=null}getState(s,f){const v=String(f),_=o.extend({},(this.state[s]||{})[v],(this.stateChanges[s]||{})[v]);if(this.deletedStates[s]===null)return{};if(this.deletedStates[s]){const k=this.deletedStates[s][f];if(k===null)return{};for(const D in k)delete _[D]}return _}initializeTileState(s,f){s.setFeatureState(this.state,f)}coalesceChanges(s,f){const v={};for(const _ in this.stateChanges){this.state[_]=this.state[_]||{};const k={};for(const D in this.stateChanges[_])this.state[_][D]||(this.state[_][D]={}),o.extend(this.state[_][D],this.stateChanges[_][D]),k[D]=this.state[_][D];v[_]=k}for(const _ in this.deletedStates){this.state[_]=this.state[_]||{};const k={};if(this.deletedStates[_]===null)for(const D in this.state[_])k[D]={},this.state[_][D]={};else for(const D in this.deletedStates[_]){if(this.deletedStates[_][D]===null)this.state[_][D]={};else for(const $ of Object.keys(this.deletedStates[_][D]))delete this.state[_][D][$];k[D]=this.state[_][D]}v[_]=v[_]||{},o.extend(v[_],k)}if(this.stateChanges={},this.deletedStates={},Object.keys(v).length!==0)for(const _ in s)s[_].setFeatureState(v,f)}}class Ue extends o.Evented{constructor(s,f,v){super(),this.id=s,this.dispatcher=v,this.on("data",_=>{_.dataType==="source"&&_.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&_.dataType==="source"&&_.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(_,k,D,$){const V=new ke[k.type](_,k,D,$);if(V.id!==_)throw new Error(`Expected Source id to be ${_} instead of ${V.id}`);return o.bindAll(["load","abort","unload","serialize","prepare"],V),V}(s,f,v,this),this._tiles={},this._cache=new Ve(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new qe}onAdd(s){this.map=s,this._maxTileCacheSize=s?s._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(s)}onRemove(s){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(s)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(const s in this._tiles){const f=this._tiles[s];if(f.state!=="loaded"&&f.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const s=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,s&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(s,f){return this._source.loadTile(s,f)}_unloadTile(s){if(this._source.unloadTile)return this._source.unloadTile(s,()=>{})}_abortTile(s){this._source.abortTile&&this._source.abortTile(s,()=>{}),this._source.fire(new o.Event("dataabort",{tile:s,coord:s.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(s){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const f in this._tiles){const v=this._tiles[f];v.upload(s),v.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(s=>s.tileID).sort(ct).map(s=>s.key)}getRenderableIds(s){const f=[];for(const v in this._tiles)this._isIdRenderable(v,s)&&f.push(this._tiles[v]);return s?f.sort((v,_)=>{const k=v.tileID,D=_.tileID,$=new o.pointGeometry(k.canonical.x,k.canonical.y)._rotate(this.transform.angle),V=new o.pointGeometry(D.canonical.x,D.canonical.y)._rotate(this.transform.angle);return k.overscaledZ-D.overscaledZ||V.y-$.y||V.x-$.x}).map(v=>v.tileID.key):f.map(v=>v.tileID).sort(ct).map(v=>v.key)}hasRenderableParent(s){const f=this.findLoadedParent(s,0);return!!f&&this._isIdRenderable(f.tileID.key)}_isIdRenderable(s,f){return this._tiles[s]&&this._tiles[s].hasData()&&!this._coveredTiles[s]&&(f||!this._tiles[s].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const s in this._tiles)this._tiles[s].state!=="errored"&&this._reloadTile(s,"reloading")}}_reloadTile(s,f){const v=this._tiles[s];v&&(v.state!=="loading"&&(v.state=f),this._loadTile(v,this._tileLoaded.bind(this,v,s,f)))}_tileLoaded(s,f,v,_){if(_)return s.state="errored",void(_.status!==404?this._source.fire(new o.ErrorEvent(_,{tile:s})):this.update(this.transform,this.terrain));s.timeAdded=o.exported.now(),v==="expired"&&(s.refreshedUponExpiration=!0),this._setTileReloadTimer(f,s),this.getSource().type==="raster-dem"&&s.dem&&this._backfillDEM(s),this._state.initializeTileState(s,this.map?this.map.painter:null),s.aborted||this._source.fire(new o.Event("data",{dataType:"source",tile:s,coord:s.tileID}))}_backfillDEM(s){const f=this.getRenderableIds();for(let _=0;_1||(Math.abs(D)>1&&(Math.abs(D+V)===1?D+=V:Math.abs(D-V)===1&&(D-=V)),k.dem&&_.dem&&(_.dem.backfillBorder(k.dem,D,$),_.neighboringTiles&&_.neighboringTiles[W]&&(_.neighboringTiles[W].backfilled=!0)))}}getTile(s){return this.getTileByID(s.key)}getTileByID(s){return this._tiles[s]}_retainLoadedChildren(s,f,v,_){for(const k in this._tiles){let D=this._tiles[k];if(_[k]||!D.hasData()||D.tileID.overscaledZ<=f||D.tileID.overscaledZ>v)continue;let $=D.tileID;for(;D&&D.tileID.overscaledZ>f+1;){const W=D.tileID.scaledTo(D.tileID.overscaledZ-1);D=this._tiles[W.key],D&&D.hasData()&&($=W)}let V=$;for(;V.overscaledZ>f;)if(V=V.scaledTo(V.overscaledZ-1),s[V.key]){_[$.key]=$;break}}}findLoadedParent(s,f){if(s.key in this._loadedParentTiles){const v=this._loadedParentTiles[s.key];return v&&v.tileID.overscaledZ>=f?v:null}for(let v=s.overscaledZ-1;v>=f;v--){const _=s.scaledTo(v),k=this._getLoadedTile(_);if(k)return k}}_getLoadedTile(s){const f=this._tiles[s.key];return f&&f.hasData()?f:this._cache.getByKey(s.wrapped().key)}updateCacheSize(s){const f=Math.ceil(s.width/this._source.tileSize)+1,v=Math.ceil(s.height/this._source.tileSize)+1,_=Math.floor(f*v*5),k=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,_):_;this._cache.setMaxSize(k)}handleWrapJump(s){const f=Math.round((s-(this._prevLng===void 0?s:this._prevLng))/360);if(this._prevLng=s,f){const v={};for(const _ in this._tiles){const k=this._tiles[_];k.tileID=k.tileID.unwrapTo(k.tileID.wrap+f),v[k.tileID.key]=k}this._tiles=v;for(const _ in this._timers)clearTimeout(this._timers[_]),delete this._timers[_];for(const _ in this._tiles)this._setTileReloadTimer(_,this._tiles[_])}}update(s,f){if(this.transform=s,this.terrain=f,!this._sourceLoaded||this._paused)return;let v;this.updateCacheSize(s),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?v=s.getVisibleUnwrappedCoordinates(this._source.tileID).map(W=>new o.OverscaledTileID(W.canonical.z,W.wrap,W.canonical.z,W.canonical.x,W.canonical.y)):(v=s.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:f}),this._source.hasTile&&(v=v.filter(W=>this._source.hasTile(W)))):v=[];const _=s.coveringZoomLevel(this._source),k=Math.max(_-Ue.maxOverzooming,this._source.minzoom),D=Math.max(_+Ue.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const W={};for(const ee of v)if(ee.canonical.z>this._source.minzoom){const ie=ee.scaledTo(ee.canonical.z-1);W[ie.key]=ie;const fe=ee.scaledTo(Math.max(this._source.minzoom,Math.min(ee.canonical.z,5)));W[fe.key]=fe}v=v.concat(Object.values(W))}const $=this._updateRetainedTiles(v,_);if(pt(this._source.type)){const W={},ee={},ie=Object.keys($);for(const fe of ie){const Se=$[fe],_e=this._tiles[fe];if(!_e||_e.fadeEndTime&&_e.fadeEndTime<=o.exported.now())continue;const we=this.findLoadedParent(Se,k);we&&(this._addTile(we.tileID),W[we.tileID.key]=we.tileID),ee[fe]=Se}this._retainLoadedChildren(ee,_,D,$);for(const fe in W)$[fe]||(this._coveredTiles[fe]=!0,$[fe]=W[fe]);if(f){const fe={},Se={};for(const _e of v)this._tiles[_e.key].hasData()?fe[_e.key]=_e:Se[_e.key]=_e;for(const _e in Se){const we=Se[_e].children(this._source.maxzoom);this._tiles[we[0].key]&&this._tiles[we[1].key]&&this._tiles[we[2].key]&&this._tiles[we[3].key]&&(fe[we[0].key]=$[we[0].key]=we[0],fe[we[1].key]=$[we[1].key]=we[1],fe[we[2].key]=$[we[2].key]=we[2],fe[we[3].key]=$[we[3].key]=we[3],delete Se[_e])}for(const _e in Se){const we=this.findLoadedParent(Se[_e],this._source.minzoom);if(we){fe[we.tileID.key]=$[we.tileID.key]=we.tileID;for(const $e in fe)fe[$e].isChildOf(we.tileID)&&delete fe[$e]}}for(const _e in this._tiles)fe[_e]||(this._coveredTiles[_e]=!0)}}for(const W in $)this._tiles[W].clearFadeHold();const V=o.keysDifference(this._tiles,$);for(const W of V){const ee=this._tiles[W];ee.hasSymbolBuckets&&!ee.holdingForFade()?ee.setHoldDuration(this.map._fadeDuration):ee.hasSymbolBuckets&&!ee.symbolFadeFinished()||this._removeTile(W)}this._updateLoadedParentTileCache()}releaseSymbolFadeTiles(){for(const s in this._tiles)this._tiles[s].holdingForFade()&&this._removeTile(s)}_updateRetainedTiles(s,f){const v={},_={},k=Math.max(f-Ue.maxOverzooming,this._source.minzoom),D=Math.max(f+Ue.maxUnderzooming,this._source.minzoom),$={};for(const V of s){const W=this._addTile(V);v[V.key]=V,W.hasData()||fthis._source.maxzoom){const ie=V.children(this._source.maxzoom)[0],fe=this.getTile(ie);if(fe&&fe.hasData()){v[ie.key]=ie;continue}}else{const ie=V.children(this._source.maxzoom);if(v[ie[0].key]&&v[ie[1].key]&&v[ie[2].key]&&v[ie[3].key])continue}let ee=W.wasRequested();for(let ie=V.overscaledZ-1;ie>=k;--ie){const fe=V.scaledTo(ie);if(_[fe.key]||(_[fe.key]=!0,W=this.getTile(fe),!W&&ee&&(W=this._addTile(fe)),W&&(v[fe.key]=fe,ee=W.wasRequested(),W.hasData())))break}}return v}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const s in this._tiles){const f=[];let v,_=this._tiles[s].tileID;for(;_.overscaledZ>0;){if(_.key in this._loadedParentTiles){v=this._loadedParentTiles[_.key];break}f.push(_.key);const k=_.scaledTo(_.overscaledZ-1);if(v=this._getLoadedTile(k),v)break;_=k}for(const k of f)this._loadedParentTiles[k]=v}}_addTile(s){let f=this._tiles[s.key];if(f)return f;f=this._cache.getAndRemove(s),f&&(this._setTileReloadTimer(s.key,f),f.tileID=s,this._state.initializeTileState(f,this.map?this.map.painter:null),this._cacheTimers[s.key]&&(clearTimeout(this._cacheTimers[s.key]),delete this._cacheTimers[s.key],this._setTileReloadTimer(s.key,f)));const v=f;return f||(f=new Le(s,this._source.tileSize*s.overscaleFactor()),this._loadTile(f,this._tileLoaded.bind(this,f,s.key,f.state))),f.uses++,this._tiles[s.key]=f,v||this._source.fire(new o.Event("dataloading",{tile:f,coord:f.tileID,dataType:"source"})),f}_setTileReloadTimer(s,f){s in this._timers&&(clearTimeout(this._timers[s]),delete this._timers[s]);const v=f.getExpiryTimeout();v&&(this._timers[s]=setTimeout(()=>{this._reloadTile(s,"expired"),delete this._timers[s]},v))}_removeTile(s){const f=this._tiles[s];f&&(f.uses--,delete this._tiles[s],this._timers[s]&&(clearTimeout(this._timers[s]),delete this._timers[s]),f.uses>0||(f.hasData()&&f.state!=="reloading"?this._cache.add(f.tileID,f,f.getExpiryTimeout()):(f.aborted=!0,this._abortTile(f),this._unloadTile(f))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const s in this._tiles)this._removeTile(s);this._cache.reset()}tilesIn(s,f,v){const _=[],k=this.transform;if(!k)return _;const D=v?k.getCameraQueryGeometry(s):s,$=s.map(_e=>k.pointCoordinate(_e,this.terrain)),V=D.map(_e=>k.pointCoordinate(_e,this.terrain)),W=this.getIds();let ee=1/0,ie=1/0,fe=-1/0,Se=-1/0;for(const _e of V)ee=Math.min(ee,_e.x),ie=Math.min(ie,_e.y),fe=Math.max(fe,_e.x),Se=Math.max(Se,_e.y);for(let _e=0;_e=0&&Pe[1].y+et>=0){const at=$.map(gt=>$e.getTilePoint(gt)),nt=V.map(gt=>$e.getTilePoint(gt));_.push({tile:we,tileID:$e,queryGeometry:at,cameraQueryGeometry:nt,scale:je})}}return _}getVisibleCoordinates(s){const f=this.getRenderableIds(s).map(v=>this._tiles[v].tileID);for(const v of f)v.posMatrix=this.transform.calculatePosMatrix(v.toUnwrapped());return f}hasTransition(){if(this._source.hasTransition())return!0;if(pt(this._source.type))for(const s in this._tiles){const f=this._tiles[s];if(f.fadeEndTime!==void 0&&f.fadeEndTime>=o.exported.now())return!0}return!1}setFeatureState(s,f,v){this._state.updateState(s=s||"_geojsonTileLayer",f,v)}removeFeatureState(s,f,v){this._state.removeFeatureState(s=s||"_geojsonTileLayer",f,v)}getFeatureState(s,f){return this._state.getState(s=s||"_geojsonTileLayer",f)}setDependencies(s,f,v){const _=this._tiles[s];_&&_.setDependencies(f,v)}reloadTilesForDependencies(s,f){for(const v in this._tiles)this._tiles[v].hasDependency(s,f)&&this._reloadTile(v,"reloading");this._cache.filter(v=>!v.hasDependency(s,f))}}function ct(y,s){const f=Math.abs(2*y.wrap)-+(y.wrap<0),v=Math.abs(2*s.wrap)-+(s.wrap<0);return y.overscaledZ-s.overscaledZ||v-f||s.canonical.y-y.canonical.y||s.canonical.x-y.canonical.x}function pt(y){return y==="raster"||y==="image"||y==="video"}Ue.maxOverzooming=10,Ue.maxUnderzooming=3;const Tt="mapboxgl_preloaded_worker_pool";class Xe{constructor(){this.active={}}acquire(s){if(!this.workers)for(this.workers=[];this.workers.length{f.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[Tt]}numActive(){return Object.keys(this.active).length}}const Pt=Math.floor(o.exported.hardwareConcurrency/2);let mt;function Mt(){return mt||(mt=new Xe),mt}function Ct(y,s){const f={};for(const v in y)v!=="ref"&&(f[v]=y[v]);return o.refProperties.forEach(v=>{v in s&&(f[v]=s[v])}),f}function Lt(y){y=y.slice();const s=Object.create(null);for(let f=0;f0?(_-D)/$:0;return this.points[k].mult(1-V).add(this.points[f].mult(V))}}function Fe(y,s){let f=!0;return y==="always"||y!=="never"&&s!=="never"||(f=!1),f}class Ge{constructor(s,f,v){const _=this.boxCells=[],k=this.circleCells=[];this.xCellCount=Math.ceil(s/v),this.yCellCount=Math.ceil(f/v);for(let D=0;Dthis.width||_<0||f>this.height)return[];const V=[];if(s<=0&&f<=0&&this.width<=v&&this.height<=_){if(k)return[{key:null,x1:s,y1:f,x2:v,y2:_}];for(let W=0;W0}hitTestCircle(s,f,v,_,k){const D=s-v,$=s+v,V=f-v,W=f+v;if($<0||D>this.width||W<0||V>this.height)return!1;const ee=[];return this._forEachCell(D,V,$,W,this._queryCellCircle,ee,{hitTest:!0,overlapMode:_,circle:{x:s,y:f,radius:v},seenUids:{box:{},circle:{}}},k),ee.length>0}_queryCell(s,f,v,_,k,D,$,V){const{seenUids:W,hitTest:ee,overlapMode:ie}=$,fe=this.boxCells[k];if(fe!==null){const _e=this.bboxes;for(const we of fe)if(!W.box[we]){W.box[we]=!0;const $e=4*we,je=this.boxKeys[we];if(s<=_e[$e+2]&&f<=_e[$e+3]&&v>=_e[$e+0]&&_>=_e[$e+1]&&(!V||V(je))&&(!ee||!Fe(ie,je.overlapMode))&&(D.push({key:je,x1:_e[$e],y1:_e[$e+1],x2:_e[$e+2],y2:_e[$e+3]}),ee))return!0}}const Se=this.circleCells[k];if(Se!==null){const _e=this.circles;for(const we of Se)if(!W.circle[we]){W.circle[we]=!0;const $e=3*we,je=this.circleKeys[we];if(this._circleAndRectCollide(_e[$e],_e[$e+1],_e[$e+2],s,f,v,_)&&(!V||V(je))&&(!ee||!Fe(ie,je.overlapMode))){const et=_e[$e],Pe=_e[$e+1],at=_e[$e+2];if(D.push({key:je,x1:et-at,y1:Pe-at,x2:et+at,y2:Pe+at}),ee)return!0}}}return!1}_queryCellCircle(s,f,v,_,k,D,$,V){const{circle:W,seenUids:ee,overlapMode:ie}=$,fe=this.boxCells[k];if(fe!==null){const _e=this.bboxes;for(const we of fe)if(!ee.box[we]){ee.box[we]=!0;const $e=4*we,je=this.boxKeys[we];if(this._circleAndRectCollide(W.x,W.y,W.radius,_e[$e+0],_e[$e+1],_e[$e+2],_e[$e+3])&&(!V||V(je))&&!Fe(ie,je.overlapMode))return D.push(!0),!0}}const Se=this.circleCells[k];if(Se!==null){const _e=this.circles;for(const we of Se)if(!ee.circle[we]){ee.circle[we]=!0;const $e=3*we,je=this.circleKeys[we];if(this._circlesCollide(_e[$e],_e[$e+1],_e[$e+2],W.x,W.y,W.radius)&&(!V||V(je))&&!Fe(ie,je.overlapMode))return D.push(!0),!0}}}_forEachCell(s,f,v,_,k,D,$,V){const W=this._convertToXCellCoord(s),ee=this._convertToYCellCoord(f),ie=this._convertToXCellCoord(v),fe=this._convertToYCellCoord(_);for(let Se=W;Se<=ie;Se++)for(let _e=ee;_e<=fe;_e++)if(k.call(this,s,f,v,_,this.xCellCount*_e+Se,D,$,V))return}_convertToXCellCoord(s){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(s*this.xScale)))}_convertToYCellCoord(s){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(s*this.yScale)))}_circlesCollide(s,f,v,_,k,D){const $=_-s,V=k-f,W=v+D;return W*W>$*$+V*V}_circleAndRectCollide(s,f,v,_,k,D,$){const V=(D-_)/2,W=Math.abs(s-(_+V));if(W>V+v)return!1;const ee=($-k)/2,ie=Math.abs(f-(k+ee));if(ie>ee+v)return!1;if(W<=V||ie<=ee)return!0;const fe=W-V,Se=ie-ee;return fe*fe+Se*Se<=v*v}}function Xt(y,s,f,v,_){const k=o.create();return s?(o.scale(k,k,[1/_,1/_,1]),f||o.rotateZ(k,k,v.angle)):o.multiply(k,v.labelPlaneMatrix,y),k}function dn(y,s,f,v,_){if(s){const k=o.clone(y);return o.scale(k,k,[_,_,1]),f||o.rotateZ(k,k,-v.angle),k}return v.glCoordMatrix}function Vt(y,s,f){let v;f?(v=[y.x,y.y,f(y.x,y.y),1],o.transformMat4(v,v,s)):(v=[y.x,y.y,0,1],Tn(v,v,s));const _=v[3];return{point:new o.pointGeometry(v[0]/_,v[1]/_),signedDistanceFromCamera:_}}function jt(y,s){return .5+y/s*.5}function nn(y,s){const f=y[0]/y[3],v=y[1]/y[3];return f>=-s[0]&&f<=s[0]&&v>=-s[1]&&v<=s[1]}function _n(y,s,f,v,_,k,D,$,V,W){const ee=v?y.textSizeData:y.iconSizeData,ie=o.evaluateSizeForZoom(ee,f.transform.zoom),fe=[256/f.width*2+1,256/f.height*2+1],Se=v?y.text.dynamicLayoutVertexArray:y.icon.dynamicLayoutVertexArray;Se.clear();const _e=y.lineVertexArray,we=v?y.text.placedSymbolArray:y.icon.placedSymbolArray,$e=f.transform.width/f.transform.height;let je=!1;for(let et=0;etMath.abs(f.x-s.x)*v?{useVertical:!0}:(y===o.WritingMode.vertical?s.yf.x)?{needsFlipping:!0}:null}function Gt(y,s,f,v,_,k,D,$,V,W,ee,ie,fe,Se,_e,we){const $e=s/24,je=y.lineOffsetX*$e,et=y.lineOffsetY*$e;let Pe;if(y.numGlyphs>1){const at=y.glyphStartIndex+y.numGlyphs,nt=y.lineStartIndex,gt=y.lineStartIndex+y.lineLength,yt=An($e,$,je,et,f,ee,ie,y,V,k,fe,_e,we);if(!yt)return{notEnoughRoom:!0};const Dt=Vt(yt.first.point,D,we).point,vt=Vt(yt.last.point,D,we).point;if(v&&!f){const rn=_t(y.writingMode,Dt,vt,Se);if(rn)return rn}Pe=[yt.first];for(let rn=y.glyphStartIndex+1;rn0?Dt.point:an(ie,yt,nt,1,_,we),rn=_t(y.writingMode,nt,vt,Se);if(rn)return rn}const at=Fn($e*$.getoffsetX(y.glyphStartIndex),je,et,f,ee,ie,y.segment,y.lineStartIndex,y.lineStartIndex+y.lineLength,V,k,fe,_e,we);if(!at)return{notEnoughRoom:!0};Pe=[at]}for(const at of Pe)o.addDynamicAttributes(W,at.point,at.angle);return{}}function an(y,s,f,v,_,k){const D=Vt(y.add(y.sub(s)._unit()),_,k).point,$=f.sub(D);return f.add($._mult(v/$.mag()))}function Fn(y,s,f,v,_,k,D,$,V,W,ee,ie,fe,Se){const _e=v?y-s:y+s;let we=_e>0?1:-1,$e=0;v&&(we*=-1,$e=Math.PI),we<0&&($e+=Math.PI);let je=we>0?$+D:$+D+1,et=_,Pe=_,at=0,nt=0;const gt=Math.abs(_e),yt=[];for(;at+nt<=gt;){if(je+=we,je<$||je>=V)return null;if(Pe=et,yt.push(et),et=ie[je],et===void 0){const ln=new o.pointGeometry(W.getx(je),W.gety(je)),Dn=Vt(ln,ee,Se);if(Dn.signedDistanceFromCamera>0)et=ie[je]=Dn.point;else{const Vn=je-we;et=an(at===0?k:new o.pointGeometry(W.getx(Vn),W.gety(Vn)),ln,Pe,gt-at+1,ee,Se)}}at+=nt,nt=Pe.dist(et)}const Dt=(gt-at)/nt,vt=et.sub(Pe),rn=vt.mult(Dt)._add(Pe);rn._add(vt._unit()._perp()._mult(f*we));const qt=$e+Math.atan2(et.y-Pe.y,et.x-Pe.x);return yt.push(rn),{point:rn,angle:fe?qt:0,path:yt}}const kn=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function zt(y,s){for(let f=0;f=1;Qn--)bn.push(Dn.path[Qn]);for(let Qn=1;QnVt(er,V,_e));bn=Qn.some(er=>er.signedDistanceFromCamera<=0)?[]:Qn.map(er=>er.point)}let dr=[];if(bn.length>0){const Qn=bn[0].clone(),er=bn[0].clone();for(let pr=1;pr=rn.x&&er.x<=qt.x&&Qn.y>=rn.y&&er.y<=qt.y?[bn]:er.xqt.x||er.yqt.y?[]:o.clipLine([bn],rn.x,rn.y,qt.x,qt.y)}for(const Qn of dr){ln.reset(Qn,.25*vt);let er=0;er=ln.length<=.5*vt?1:Math.ceil(ln.paddedLength/cr)+1;for(let pr=0;pr=this.screenRightBoundary||_this.screenBottomBoundary}isInsideGrid(s,f,v,_){return v>=0&&s=0&&fv.collisionGroupID===f}}return this.collisionGroups[s]}}function Gn(y,s,f,v,_){const{horizontalAlign:k,verticalAlign:D}=o.getAnchorAlignment(y),$=-(k-.5)*s,V=-(D-.5)*f,W=o.evaluateVariableOffset(y,v);return new o.pointGeometry($+W[0]*_,V+W[1]*_)}function qn(y,s,f,v,_,k){const{x1:D,x2:$,y1:V,y2:W,anchorPointX:ee,anchorPointY:ie}=y,fe=new o.pointGeometry(s,f);return v&&fe._rotate(_?k:-k),{x1:D+fe.x,y1:V+fe.y,x2:$+fe.x,y2:W+fe.y,anchorPointX:ee,anchorPointY:ie}}class me{constructor(s,f,v,_,k){this.transform=s.clone(),this.terrain=f,this.collisionIndex=new hn(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=v,this.retainedQueryData={},this.collisionGroups=new Mn(_),this.collisionCircleArrays={},this.prevPlacement=k,k&&(k.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(s,f,v,_){const k=v.getBucket(f),D=v.latestFeatureIndex;if(!k||!D||f.id!==k.layerIds[0])return;const $=v.collisionBoxArray,V=k.layers[0].layout,W=Math.pow(2,this.transform.zoom-v.tileID.overscaledZ),ee=v.tileSize/o.EXTENT,ie=this.transform.calculatePosMatrix(v.tileID.toUnwrapped()),fe=V.get("text-pitch-alignment")==="map",Se=V.get("text-rotation-alignment")==="map",_e=Nt(v,1,this.transform.zoom),we=Xt(ie,fe,Se,this.transform,_e);let $e=null;if(fe){const et=dn(ie,fe,Se,this.transform,_e);$e=o.multiply([],this.transform.labelPlaneMatrix,et)}this.retainedQueryData[k.bucketInstanceId]=new cn(k.bucketInstanceId,D,k.sourceLayerIndex,k.index,v.tileID);const je={bucket:k,layout:V,posMatrix:ie,textLabelPlaneMatrix:we,labelToScreenMatrix:$e,scale:W,textPixelRatio:ee,holdingForFade:v.holdingForFade(),collisionBoxArray:$,partiallyEvaluatedTextSize:o.evaluateSizeForZoom(k.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(k.sourceID)};if(_)for(const et of k.sortKeyRanges){const{sortKey:Pe,symbolInstanceStart:at,symbolInstanceEnd:nt}=et;s.push({sortKey:Pe,symbolInstanceStart:at,symbolInstanceEnd:nt,parameters:je})}else s.push({symbolInstanceStart:0,symbolInstanceEnd:k.symbolInstances.length,parameters:je})}attemptAnchorPlacement(s,f,v,_,k,D,$,V,W,ee,ie,fe,Se,_e,we,$e){const je=[fe.textOffset0,fe.textOffset1],et=Gn(s,v,_,je,k),Pe=this.collisionIndex.placeCollisionBox(qn(f,et.x,et.y,D,$,this.transform.angle),ie,V,W,ee.predicate,$e);if((!we||this.collisionIndex.placeCollisionBox(qn(we,et.x,et.y,D,$,this.transform.angle),ie,V,W,ee.predicate,$e).box.length!==0)&&Pe.box.length>0){let at;if(this.prevPlacement&&this.prevPlacement.variableOffsets[fe.crossTileID]&&this.prevPlacement.placements[fe.crossTileID]&&this.prevPlacement.placements[fe.crossTileID].text&&(at=this.prevPlacement.variableOffsets[fe.crossTileID].anchor),fe.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[fe.crossTileID]={textOffset:je,width:v,height:_,anchor:s,textBoxScale:k,prevAnchor:at},this.markUsedJustification(Se,s,fe,_e),Se.allowVerticalPlacement&&(this.markUsedOrientation(Se,_e,fe),this.placedOrientations[fe.crossTileID]=_e),{shift:et,placedGlyphBoxes:Pe}}}placeLayerBucketPart(s,f,v){const{bucket:_,layout:k,posMatrix:D,textLabelPlaneMatrix:$,labelToScreenMatrix:V,textPixelRatio:W,holdingForFade:ee,collisionBoxArray:ie,partiallyEvaluatedTextSize:fe,collisionGroup:Se}=s.parameters,_e=k.get("text-optional"),we=k.get("icon-optional"),$e=o.getOverlapMode(k,"text-overlap","text-allow-overlap"),je=$e==="always",et=o.getOverlapMode(k,"icon-overlap","icon-allow-overlap"),Pe=et==="always",at=k.get("text-rotation-alignment")==="map",nt=k.get("text-pitch-alignment")==="map",gt=k.get("icon-text-fit")!=="none",yt=k.get("symbol-z-order")==="viewport-y",Dt=je&&(Pe||!_.hasIconData()||we),vt=Pe&&(je||!_.hasTextData()||_e);!_.collisionArrays&&ie&&_.deserializeCollisionBoxes(ie);const rn=(qt,ln)=>{if(f[qt.crossTileID])return;if(ee)return void(this.placements[qt.crossTileID]=new At(!1,!1,!1));let Dn=!1,Vn=!1,bn=!0,cr=null,dr={box:null,offscreen:null},Qn={box:null,offscreen:null},er=null,pr=null,vi=null,aa=0,Fo=0,sa=0;ln.textFeatureIndex?aa=ln.textFeatureIndex:qt.useRuntimeCollisionCircles&&(aa=qt.featureIndex),ln.verticalTextFeatureIndex&&(Fo=ln.verticalTextFeatureIndex);const es=this.retainedQueryData[_.bucketInstanceId].tileID,To=this.terrain?(ci,Hn)=>this.terrain.getElevation(es,ci,Hn):null;for(const ci of["textBox","verticalTextBox","iconBox","verticalIconBox"]){const Hn=ln[ci];Hn&&(Hn.elevation=To?To(Hn.anchorPointX,Hn.anchorPointY):0)}const Qi=ln.textBox;if(Qi){const ci=ur=>{let gi=o.WritingMode.horizontal;if(_.allowVerticalPlacement&&!ur&&this.prevPlacement){const yi=this.prevPlacement.placedOrientations[qt.crossTileID];yi&&(this.placedOrientations[qt.crossTileID]=yi,gi=yi,this.markUsedOrientation(_,gi,qt))}return gi},Hn=(ur,gi)=>{if(_.allowVerticalPlacement&&qt.numVerticalGlyphVertices>0&&ln.verticalTextBox){for(const yi of _.writingModes)if(yi===o.WritingMode.vertical?(dr=gi(),Qn=dr):dr=ur(),dr&&dr.box&&dr.box.length)break}else dr=ur()};if(k.get("text-variable-anchor")){let ur=k.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[qt.crossTileID]){const Ar=this.prevPlacement.variableOffsets[qt.crossTileID];ur.indexOf(Ar.anchor)>0&&(ur=ur.filter(Po=>Po!==Ar.anchor),ur.unshift(Ar.anchor))}const gi=(Ar,Po,Es)=>{const Qf=Ar.x2-Ar.x1,_l=Ar.y2-Ar.y1,Xm=qt.textBoxScale,Jf=gt&&et==="never"?Po:null;let ts={box:[],offscreen:!1};const ks=$e!=="never"?2*ur.length:ur.length;for(let Ts=0;Ts=ur.length?$e:"never",qt,_,Es,Jf,To);if(Zc&&(ts=Zc.placedGlyphBoxes,ts&&ts.box&&ts.box.length)){Dn=!0,cr=Zc.shift;break}}return ts};Hn(()=>gi(Qi,ln.iconBox,o.WritingMode.horizontal),()=>{const Ar=ln.verticalTextBox;return _.allowVerticalPlacement&&!(dr&&dr.box&&dr.box.length)&&qt.numVerticalGlyphVertices>0&&Ar?gi(Ar,ln.verticalIconBox,o.WritingMode.vertical):{box:null,offscreen:null}}),dr&&(Dn=dr.box,bn=dr.offscreen);const yi=ci(dr&&dr.box);if(!Dn&&this.prevPlacement){const Ar=this.prevPlacement.variableOffsets[qt.crossTileID];Ar&&(this.variableOffsets[qt.crossTileID]=Ar,this.markUsedJustification(_,Ar.anchor,qt,yi))}}else{const ur=(gi,yi)=>{const Ar=this.collisionIndex.placeCollisionBox(gi,$e,W,D,Se.predicate,To);return Ar&&Ar.box&&Ar.box.length&&(this.markUsedOrientation(_,yi,qt),this.placedOrientations[qt.crossTileID]=yi),Ar};Hn(()=>ur(Qi,o.WritingMode.horizontal),()=>{const gi=ln.verticalTextBox;return _.allowVerticalPlacement&&qt.numVerticalGlyphVertices>0&&gi?ur(gi,o.WritingMode.vertical):{box:null,offscreen:null}}),ci(dr&&dr.box&&dr.box.length)}}if(er=dr,Dn=er&&er.box&&er.box.length>0,bn=er&&er.offscreen,qt.useRuntimeCollisionCircles){const ci=_.text.placedSymbolArray.get(qt.centerJustifiedTextSymbolIndex),Hn=o.evaluateSizeForFeature(_.textSizeData,fe,ci),ur=k.get("text-padding");pr=this.collisionIndex.placeCollisionCircles($e,ci,_.lineVertexArray,_.glyphOffsetArray,Hn,D,$,V,v,nt,Se.predicate,qt.collisionCircleDiameter,ur,To),pr.circles.length&&pr.collisionDetected&&!v&&o.warnOnce("Collisions detected, but collision boxes are not shown"),Dn=je||pr.circles.length>0&&!pr.collisionDetected,bn=bn&&pr.offscreen}if(ln.iconFeatureIndex&&(sa=ln.iconFeatureIndex),ln.iconBox){const ci=Hn=>{const ur=gt&&cr?qn(Hn,cr.x,cr.y,at,nt,this.transform.angle):Hn;return this.collisionIndex.placeCollisionBox(ur,et,W,D,Se.predicate,To)};Qn&&Qn.box&&Qn.box.length&&ln.verticalIconBox?(vi=ci(ln.verticalIconBox),Vn=vi.box.length>0):(vi=ci(ln.iconBox),Vn=vi.box.length>0),bn=bn&&vi.offscreen}const Ma=_e||qt.numHorizontalGlyphVertices===0&&qt.numVerticalGlyphVertices===0,qc=we||qt.numIconVertices===0;if(Ma||qc?qc?Ma||(Vn=Vn&&Dn):Dn=Vn&&Dn:Vn=Dn=Vn&&Dn,Dn&&er&&er.box&&this.collisionIndex.insertCollisionBox(er.box,$e,k.get("text-ignore-placement"),_.bucketInstanceId,Qn&&Qn.box&&Fo?Fo:aa,Se.ID),Vn&&vi&&this.collisionIndex.insertCollisionBox(vi.box,et,k.get("icon-ignore-placement"),_.bucketInstanceId,sa,Se.ID),pr&&(Dn&&this.collisionIndex.insertCollisionCircles(pr.circles,$e,k.get("text-ignore-placement"),_.bucketInstanceId,aa,Se.ID),v)){const ci=_.bucketInstanceId;let Hn=this.collisionCircleArrays[ci];Hn===void 0&&(Hn=this.collisionCircleArrays[ci]=new $t);for(let ur=0;ur=0;--ln){const Dn=qt[ln];rn(_.symbolInstances.get(Dn),_.collisionArrays[Dn])}}else for(let qt=s.symbolInstanceStart;qt=0&&(s.text.placedSymbolArray.get($).crossTileID=k>=0&&$!==k?0:v.crossTileID)}markUsedOrientation(s,f,v){const _=f===o.WritingMode.horizontal||f===o.WritingMode.horizontalOnly?f:0,k=f===o.WritingMode.vertical?f:0,D=[v.leftJustifiedTextSymbolIndex,v.centerJustifiedTextSymbolIndex,v.rightJustifiedTextSymbolIndex];for(const $ of D)s.text.placedSymbolArray.get($).placedOrientation=_;v.verticalPlacedTextSymbolIndex&&(s.text.placedSymbolArray.get(v.verticalPlacedTextSymbolIndex).placedOrientation=k)}commit(s){this.commitTime=s,this.zoomAtLastRecencyCheck=this.transform.zoom;const f=this.prevPlacement;let v=!1;this.prevZoomAdjustment=f?f.zoomAdjustment(this.transform.zoom):0;const _=f?f.symbolFadeChange(s):1,k=f?f.opacities:{},D=f?f.variableOffsets:{},$=f?f.placedOrientations:{};for(const V in this.placements){const W=this.placements[V],ee=k[V];ee?(this.opacities[V]=new ht(ee,_,W.text,W.icon),v=v||W.text!==ee.text.placed||W.icon!==ee.icon.placed):(this.opacities[V]=new ht(null,_,W.text,W.icon,W.skipFade),v=v||W.text||W.icon)}for(const V in k){const W=k[V];if(!this.opacities[V]){const ee=new ht(W,_,!1,!1);ee.isHidden()||(this.opacities[V]=ee,v=v||W.text.placed||W.icon.placed)}}for(const V in D)this.variableOffsets[V]||!this.opacities[V]||this.opacities[V].isHidden()||(this.variableOffsets[V]=D[V]);for(const V in $)this.placedOrientations[V]||!this.opacities[V]||this.opacities[V].isHidden()||(this.placedOrientations[V]=$[V]);if(f&&f.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");v?this.lastPlacementChangeTime=s:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=f?f.lastPlacementChangeTime:s)}updateLayerOpacities(s,f){const v={};for(const _ of f){const k=_.getBucket(s);k&&_.latestFeatureIndex&&s.id===k.layerIds[0]&&this.updateBucketOpacities(k,v,_.collisionBoxArray)}}updateBucketOpacities(s,f,v){s.hasTextData()&&s.text.opacityVertexArray.clear(),s.hasIconData()&&s.icon.opacityVertexArray.clear(),s.hasIconCollisionBoxData()&&s.iconCollisionBox.collisionVertexArray.clear(),s.hasTextCollisionBoxData()&&s.textCollisionBox.collisionVertexArray.clear();const _=s.layers[0].layout,k=new ht(null,0,!1,!1,!0),D=_.get("text-allow-overlap"),$=_.get("icon-allow-overlap"),V=_.get("text-variable-anchor"),W=_.get("text-rotation-alignment")==="map",ee=_.get("text-pitch-alignment")==="map",ie=_.get("icon-text-fit")!=="none",fe=new ht(null,0,D&&($||!s.hasIconData()||_.get("icon-optional")),$&&(D||!s.hasTextData()||_.get("text-optional")),!0);!s.collisionArrays&&v&&(s.hasIconCollisionBoxData()||s.hasTextCollisionBoxData())&&s.deserializeCollisionBoxes(v);const Se=(_e,we,$e)=>{for(let je=0;je0,nt=this.placedOrientations[we.crossTileID],gt=nt===o.WritingMode.vertical,yt=nt===o.WritingMode.horizontal||nt===o.WritingMode.horizontalOnly;if($e>0||je>0){const Dt=Oe(Pe.text);Se(s.text,$e,gt?He:Dt),Se(s.text,je,yt?He:Dt);const vt=Pe.text.isHidden();[we.rightJustifiedTextSymbolIndex,we.centerJustifiedTextSymbolIndex,we.leftJustifiedTextSymbolIndex].forEach(ln=>{ln>=0&&(s.text.placedSymbolArray.get(ln).hidden=vt||gt?1:0)}),we.verticalPlacedTextSymbolIndex>=0&&(s.text.placedSymbolArray.get(we.verticalPlacedTextSymbolIndex).hidden=vt||yt?1:0);const rn=this.variableOffsets[we.crossTileID];rn&&this.markUsedJustification(s,rn.anchor,we,nt);const qt=this.placedOrientations[we.crossTileID];qt&&(this.markUsedJustification(s,"left",we,qt),this.markUsedOrientation(s,qt,we))}if(at){const Dt=Oe(Pe.icon),vt=!(ie&&we.verticalPlacedIconSymbolIndex&>);we.placedIconSymbolIndex>=0&&(Se(s.icon,we.numIconVertices,vt?Dt:He),s.icon.placedSymbolArray.get(we.placedIconSymbolIndex).hidden=Pe.icon.isHidden()),we.verticalPlacedIconSymbolIndex>=0&&(Se(s.icon,we.numVerticalIconVertices,vt?He:Dt),s.icon.placedSymbolArray.get(we.verticalPlacedIconSymbolIndex).hidden=Pe.icon.isHidden())}if(s.hasIconCollisionBoxData()||s.hasTextCollisionBoxData()){const Dt=s.collisionArrays[_e];if(Dt){let vt=new o.pointGeometry(0,0);if(Dt.textBox||Dt.verticalTextBox){let qt=!0;if(V){const ln=this.variableOffsets[et];ln?(vt=Gn(ln.anchor,ln.width,ln.height,ln.textOffset,ln.textBoxScale),W&&vt._rotate(ee?this.transform.angle:-this.transform.angle)):qt=!1}Dt.textBox&&K(s.textCollisionBox.collisionVertexArray,Pe.text.placed,!qt||gt,vt.x,vt.y),Dt.verticalTextBox&&K(s.textCollisionBox.collisionVertexArray,Pe.text.placed,!qt||yt,vt.x,vt.y)}const rn=Boolean(!yt&&Dt.verticalIconBox);Dt.iconBox&&K(s.iconCollisionBox.collisionVertexArray,Pe.icon.placed,rn,ie?vt.x:0,ie?vt.y:0),Dt.verticalIconBox&&K(s.iconCollisionBox.collisionVertexArray,Pe.icon.placed,!rn,ie?vt.x:0,ie?vt.y:0)}}}if(s.sortFeatures(this.transform.angle),this.retainedQueryData[s.bucketInstanceId]&&(this.retainedQueryData[s.bucketInstanceId].featureSortOrder=s.featureSortOrder),s.hasTextData()&&s.text.opacityVertexBuffer&&s.text.opacityVertexBuffer.updateData(s.text.opacityVertexArray),s.hasIconData()&&s.icon.opacityVertexBuffer&&s.icon.opacityVertexBuffer.updateData(s.icon.opacityVertexArray),s.hasIconCollisionBoxData()&&s.iconCollisionBox.collisionVertexBuffer&&s.iconCollisionBox.collisionVertexBuffer.updateData(s.iconCollisionBox.collisionVertexArray),s.hasTextCollisionBoxData()&&s.textCollisionBox.collisionVertexBuffer&&s.textCollisionBox.collisionVertexBuffer.updateData(s.textCollisionBox.collisionVertexArray),s.text.opacityVertexArray.length!==s.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${s.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${s.text.layoutVertexArray.length}) / 4`);if(s.icon.opacityVertexArray.length!==s.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${s.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${s.icon.layoutVertexArray.length}) / 4`);if(s.bucketInstanceId in this.collisionCircleArrays){const _e=this.collisionCircleArrays[s.bucketInstanceId];s.placementInvProjMatrix=_e.invProjMatrix,s.placementViewportMatrix=_e.viewportMatrix,s.collisionCircleArray=_e.circles,delete this.collisionCircleArrays[s.bucketInstanceId]}}symbolFadeChange(s){return this.fadeDuration===0?1:(s-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(s){return Math.max(0,(this.transform.zoom-s)/1.5)}hasTransitions(s){return this.stale||s-this.lastPlacementChangeTimes}setStale(){this.stale=!0}}function K(y,s,f,v,_){y.emplaceBack(s?1:0,f?1:0,v||0,_||0),y.emplaceBack(s?1:0,f?1:0,v||0,_||0),y.emplaceBack(s?1:0,f?1:0,v||0,_||0),y.emplaceBack(s?1:0,f?1:0,v||0,_||0)}const G=Math.pow(2,25),ce=Math.pow(2,24),ae=Math.pow(2,17),xe=Math.pow(2,16),Ee=Math.pow(2,9),be=Math.pow(2,8),Ce=Math.pow(2,1);function Oe(y){if(y.opacity===0&&!y.placed)return 0;if(y.opacity===1&&y.placed)return 4294967295;const s=y.placed?1:0,f=Math.floor(127*y.opacity);return f*G+s*ce+f*ae+s*xe+f*Ee+s*be+f*Ce+s}const He=0;class We{constructor(s){this._sortAcrossTiles=s.layout.get("symbol-z-order")!=="viewport-y"&&!s.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(s,f,v,_,k){const D=this._bucketParts;for(;this._currentTileIndex$.sortKey-V.sortKey));this._currentPartIndex{const D=o.exported.now()-_;return!this._forceFullPlacement&&D>2};for(;this._currentPlacementIndex>=0;){const D=f[s[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 We(D)),this._inProgressLayer.continuePlacement(v[D.source],this.placement,this._showCollisionBoxes,D,k))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(s){return this.placement.commit(s),this.placement}}const Ot=512/o.EXTENT/2;class bt{constructor(s,f,v){this.tileID=s,this.indexedSymbolInstances={},this.bucketInstanceId=v;for(let _=0;_s.overscaledZ)for(const $ in D){const V=D[$];V.tileID.isChildOf(s)&&V.findMatches(f.symbolInstances,s,_)}else{const $=D[s.scaledTo(Number(k)).key];$&&$.findMatches(f.symbolInstances,s,_)}}for(let k=0;k{f[v]=!0});for(const v in this.layerIndexes)f[v]||delete this.layerIndexes[v]}}var gn=o.createLayout([{name:"a_pos",type:"Int16",components:2}]);class on extends o.Evented{constructor(s){super(),this.sourceCache=s,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.renderHistory=[],this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,this.renderHistorySize=s._cache.max,s.usedForTerrain=!0,s.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null;for(const s in this._tiles){const f=this._tiles[s];f.textures.forEach(v=>v.destroy()),f.textures=[]}}update(s,f){this.sourceCache.update(s,f),this._renderableTilesKeys=[];for(const v of s.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:f}))this._renderableTilesKeys.push(v.key),this._tiles[v.key]||(v.posMatrix=new Float64Array(16),o.ortho(v.posMatrix,0,o.EXTENT,0,o.EXTENT,0,1),this._tiles[v.key]=new Le(v,this.tileSize))}removeOutdated(s){const f={};this.renderHistory=this.renderHistory.filter((v,_)=>this.renderHistory.indexOf(v)===_).slice(0,this.renderHistorySize);for(const v of this._renderableTilesKeys)f[v]=!0;for(const v of this.renderHistory)f[v]=!0;for(const v in this._tiles)f[v]||(this._tiles[v].clearTextures(s),delete this._tiles[v])}getRenderableTiles(){return this._renderableTilesKeys.map(s=>this.getTileByID(s))}getTileByID(s){return this._tiles[s]}getTerrainCoords(s){const f={};for(const v of this._renderableTilesKeys){const _=this._tiles[v].tileID;if(_.canonical.equals(s.canonical)){const k=s.clone();k.posMatrix=new Float64Array(16),o.ortho(k.posMatrix,0,o.EXTENT,0,o.EXTENT,0,1),f[v]=k}else if(_.canonical.isChildOf(s.canonical)){const k=s.clone();k.posMatrix=new Float64Array(16);const D=_.canonical.z-s.canonical.z,$=_.canonical.x-(_.canonical.x>>D<>D<>D;o.ortho(k.posMatrix,0,W,0,W,0,1),o.translate(k.posMatrix,k.posMatrix,[-$*W,-V*W,0]),f[v]=k}else if(s.canonical.isChildOf(_.canonical)){const k=s.clone();k.posMatrix=new Float64Array(16);const D=s.canonical.z-_.canonical.z,$=s.canonical.x-(s.canonical.x>>D<>D<>D;o.ortho(k.posMatrix,0,o.EXTENT,0,o.EXTENT,0,1),o.translate(k.posMatrix,k.posMatrix,[$*W,V*W,0]),o.scale(k.posMatrix,k.posMatrix,[1/2**D,1/2**D,0]),f[v]=k}}return f}getSourceTile(s,f){const v=this.sourceCache._source;let _=s.overscaledZ-this.deltaZoom;if(_>v.maxzoom&&(_=v.maxzoom),_=v.minzoom&&(!k||!k.dem);)k=this.sourceCache.getTileByID(s.scaledTo(_--).key);return k}tilesAfterTime(s=Date.now()){return Object.values(this._tiles).filter(f=>f.timeLoaded>=s)}}class yn{constructor(s,f,v){this.style=s,this.sourceCache=new on(f),this.options=v,this.exaggeration=typeof v.exaggeration=="number"?v.exaggeration:1,this.elevationOffset=typeof v.elevationOffset=="number"?v.elevationOffset:450,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024,this.clearRerenderCache()}getDEMElevation(s,f,v,_=o.EXTENT){if(!(f>=0&&f<_&&v>=0&&v<_))return this.elevationOffset;let k=0;const D=this.getTerrainData(s);if(D.tile&&D.tile.dem){const $=o.transformMat4$1([],[f/_*o.EXTENT,v/_*o.EXTENT],D.u_terrain_matrix),V=[$[0]*D.tile.dem.dim,$[1]*D.tile.dem.dim],W=[Math.floor(V[0]),Math.floor(V[1])],ee=D.tile.dem.get(W[0],W[1]),ie=D.tile.dem.get(W[0],W[1]+1),fe=D.tile.dem.get(W[0]+1,W[1]),Se=D.tile.dem.get(W[0]+1,W[1]+1);k=o.number(o.number(ee,ie,V[0]-W[0]),o.number(fe,Se,V[0]-W[0]),V[1]-W[1])}return k}rememberForRerender(s,f){for(const v in this.sourceCache._tiles){const _=this.sourceCache._tiles[v];(_.tileID.equals(f)||_.tileID.isChildOf(f))&&(s===this.sourceCache.sourceCache.id&&(_.timeLoaded=Date.now()),this._rerender[s]=this._rerender[s]||{},this._rerender[s][_.tileID.key]=!0)}}needsRerender(s,f){return this._rerender[s]&&this._rerender[s][f.key]}clearRerenderCache(){this._rerender={}}getElevation(s,f,v,_=o.EXTENT){return(this.getDEMElevation(s,f,v,_)+this.elevationOffset)*this.exaggeration}getTerrainData(s){if(!this._emptyDemTexture){const _=this.style.map.painter.context,k=new o.RGBAImage({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new A(_,k,_.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new A(_,new o.RGBAImage({width:1,height:1}),_.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(_.gl.NEAREST,_.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=o.identity([])}const f=this.sourceCache.getSourceTile(s,!0);if(f&&f.dem&&(!f.demTexture||f.needsTerrainPrepare)){const _=this.style.map.painter.context;f.demTexture=this.style.map.painter.getTileTexture(f.dem.stride),f.demTexture?f.demTexture.update(f.dem.getPixels(),{premultiply:!1}):f.demTexture=new A(_,f.dem.getPixels(),_.gl.RGBA,{premultiply:!1}),f.demTexture.bind(_.gl.NEAREST,_.gl.CLAMP_TO_EDGE),f.needsTerrainPrepare=!1}const v=f&&f+f.tileID.key+s.key;if(v&&!this._demMatrixCache[v]){const _=this.sourceCache.sourceCache._source.maxzoom;let k=s.canonical.z-f.tileID.canonical.z;s.overscaledZ>s.canonical.z&&(s.canonical.z>=_?k=s.canonical.z-_:o.warnOnce("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const D=s.canonical.x-(s.canonical.x>>k<>k<>8<<4|k>>8,f[D+3]=0;const v=new o.RGBAImage({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(f.buffer)),_=new A(s,v,s.gl.RGBA,{premultiply:!1});return _.bind(s.gl.NEAREST,s.gl.CLAMP_TO_EDGE),this._coordsTexture=_,_}pointCoordinate(s){const f=new Uint8Array(4),v=this.style.map.painter,_=v.context,k=_.gl;_.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),k.readPixels(s.x,v.height/devicePixelRatio-s.y-1,1,1,k.RGBA,k.UNSIGNED_BYTE,f),_.bindFramebuffer.set(null);const D=f[0]+(f[2]>>4<<8),$=f[1]+((15&f[2])<<8),V=this.coordsIndex[255-f[3]],W=V&&this.sourceCache.getTileByID(V);if(!W)return null;const ee=this._coordsTextureSize,ie=(1<o.emitValidationErrors(y,s&&s.filter(f=>f.identifier!=="source.canvas")),Jn=o.pick(lt,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),Dr=o.pick(lt,["setCenter","setZoom","setBearing","setPitch"]),or=function(){const y={},s=o.spec.$version;for(const f in o.spec.$root){const v=o.spec.$root[f];if(v.required){let _=null;_=f==="version"?s:v.type==="array"?[]:{},_!=null&&(y[f]=_)}}return y}();class Pr extends o.Evented{constructor(s,f={}){super(),this.map=s,this.dispatcher=new Y(Mt(),this),this.imageManager=new M,this.imageManager.setEventedParent(this),this.glyphManager=new B(s._requestManager,f.localIdeographFontFamily),this.lineAtlas=new te(256,512),this.crossTileSymbolIndex=new Bt,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new o.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",o.getReferrer());const v=this;this._rtlTextPluginCallback=Pr.registerForPluginStateChange(_=>{v.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:_.pluginStatus,pluginURL:_.pluginURL},(k,D)=>{if(o.triggerPluginCompletionEvent(k),D&&D.every($=>$))for(const $ in v.sourceCaches)v.sourceCaches[$].reload()})}),this.on("data",_=>{if(_.dataType!=="source"||_.sourceDataType!=="metadata")return;const k=this.sourceCaches[_.sourceId];if(!k)return;const D=k.getSource();if(D&&D.vectorLayerIds)for(const $ in this._layers){const V=this._layers[$];V.source===D.id&&this._validateLayer(V)}})}loadURL(s,f={}){this.fire(new o.Event("dataloading",{dataType:"style"}));const v=typeof f.validate!="boolean"||f.validate,_=this.map._requestManager.transformRequest(s,o.ResourceType.Style);this._request=o.getJSON(_,(k,D)=>{this._request=null,k?this.fire(new o.ErrorEvent(k)):D&&this._load(D,v)})}loadJSON(s,f={}){this.fire(new o.Event("dataloading",{dataType:"style"})),this._request=o.exported.frame(()=>{this._request=null,this._load(s,f.validate!==!1)})}loadEmpty(){this.fire(new o.Event("dataloading",{dataType:"style"})),this._load(or,!1)}_load(s,f){if(f&&Bn(this,o.validateStyle(s)))return;this._loaded=!0,this.stylesheet=s;for(const _ in s.sources)this.addSource(_,s.sources[_],{validate:!1});s.sprite?this._loadSprite(s.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(s.glyphs);const v=Lt(this.stylesheet.layers);this._order=v.map(_=>_.id),this._layers={},this._serializedLayers={};for(let _ of v)_=o.createStyleLayer(_),_.setEventedParent(this,{layer:{id:_.id}}),this._layers[_.id]=_,this._serializedLayers[_.id]=_.serialize();this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new H(this.stylesheet.light),this.setTerrain(this.stylesheet.terrain),this.fire(new o.Event("data",{dataType:"style"})),this.fire(new o.Event("style.load"))}_loadSprite(s){this._spriteRequest=function(f,v,_,k){let D,$,V;const W=_>1?"@2x":"";let ee=o.getJSON(v.transformRequest(v.normalizeSpriteURL(f,W,".json"),o.ResourceType.SpriteJSON),(Se,_e)=>{ee=null,V||(V=Se,D=_e,fe())}),ie=o.getImage(v.transformRequest(v.normalizeSpriteURL(f,W,".png"),o.ResourceType.SpriteImage),(Se,_e)=>{ie=null,V||(V=Se,$=_e,fe())});function fe(){if(V)k(V);else if(D&&$){const Se=o.exported.getImageData($),_e={};for(const we in D){const{width:$e,height:je,x:et,y:Pe,sdf:at,pixelRatio:nt,stretchX:gt,stretchY:yt,content:Dt}=D[we],vt=new o.RGBAImage({width:$e,height:je});o.RGBAImage.copy(Se,vt,{x:et,y:Pe},{x:0,y:0},{width:$e,height:je}),_e[we]={data:vt,pixelRatio:nt,sdf:at,stretchX:gt,stretchY:yt,content:Dt}}k(null,_e)}}return{cancel(){ee&&(ee.cancel(),ee=null),ie&&(ie.cancel(),ie=null)}}}(s,this.map._requestManager,this.map.getPixelRatio(),(f,v)=>{if(this._spriteRequest=null,f)this.fire(new o.ErrorEvent(f));else if(v)for(const _ in v)this.imageManager.addImage(_,v[_]);this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new o.Event("data",{dataType:"style"}))})}_validateLayer(s){const f=this.sourceCaches[s.source];if(!f)return;const v=s.sourceLayer;if(!v)return;const _=f.getSource();(_.type==="geojson"||_.vectorLayerIds&&_.vectorLayerIds.indexOf(v)===-1)&&this.fire(new o.ErrorEvent(new Error(`Source layer "${v}" does not exist on source "${_.id}" as specified by style layer "${s.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const s in this.sourceCaches)if(!this.sourceCaches[s].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeLayers(s){const f=[];for(const v of s){const _=this._layers[v];_.type!=="custom"&&f.push(_.serialize())}return f}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;for(const s in this.sourceCaches)if(this.sourceCaches[s].hasTransition())return!0;for(const s in this._layers)if(this._layers[s].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(s){if(!this._loaded)return;const f=this._changed;if(this._changed){const _=Object.keys(this._updatedLayers),k=Object.keys(this._removedLayers);(_.length||k.length)&&this._updateWorkerLayers(_,k);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(s);this.light.updateTransitions(s),this._resetUpdates()}const v={};for(const _ in this.sourceCaches){const k=this.sourceCaches[_];v[_]=k.used,k.used=!1}for(const _ of this._order){const k=this._layers[_];k.recalculate(s,this._availableImages),!k.isHidden(s.zoom)&&k.source&&(this.sourceCaches[k.source].used=!0)}for(const _ in v){const k=this.sourceCaches[_];v[_]!==k.used&&k.fire(new o.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:_}))}this.light.recalculate(s),this.z=s.zoom,f&&this.fire(new o.Event("data",{dataType:"style"}))}_updateTilesForChangedImages(){const s=Object.keys(this._changedImages);if(s.length){for(const f in this.sourceCaches)this.sourceCaches[f].reloadTilesForDependencies(["icons","patterns"],s);this._changedImages={}}}_updateWorkerLayers(s,f){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(s),removedIds:f})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}}setTerrain(s){if(this._checkLoaded(),this._terrainDataCallback&&this.off("data",this._terrainDataCallback),this._terrainfreezeElevationCallback&&this.map.off("freezeElevation",this._terrainfreezeElevationCallback),s){const f=this.sourceCaches[s.source];if(!f)throw new Error(`cannot load terrain, because there exists no source with ID: ${s.source}`);this.terrain=new yn(this,f,s),this.map.transform.updateElevation(this.terrain),this._terrainfreezeElevationCallback=v=>{v.freeze?this.map.transform.freezeElevation=!0:(this.map.transform.freezeElevation=!1,this.map.transform.recalculateZoom(this.terrain))},this._terrainDataCallback=v=>{v.tile&&(v.sourceId===s.source?(this.map.transform.updateElevation(this.terrain),this.terrain.rememberForRerender(v.sourceId,v.tile.tileID)):v.source.type==="geojson"&&this.terrain.rememberForRerender(v.sourceId,v.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:s}))}setState(s){if(this._checkLoaded(),Bn(this,o.validateStyle(s)))return!1;(s=o.clone$1(s)).layers=Lt(s.layers);const f=function(_,k){if(!_)return[{command:lt.setStyle,args:[k]}];let D=[];try{if(!b(_.version,k.version))return[{command:lt.setStyle,args:[k]}];b(_.center,k.center)||D.push({command:lt.setCenter,args:[k.center]}),b(_.zoom,k.zoom)||D.push({command:lt.setZoom,args:[k.zoom]}),b(_.bearing,k.bearing)||D.push({command:lt.setBearing,args:[k.bearing]}),b(_.pitch,k.pitch)||D.push({command:lt.setPitch,args:[k.pitch]}),b(_.sprite,k.sprite)||D.push({command:lt.setSprite,args:[k.sprite]}),b(_.glyphs,k.glyphs)||D.push({command:lt.setGlyphs,args:[k.glyphs]}),b(_.transition,k.transition)||D.push({command:lt.setTransition,args:[k.transition]}),b(_.light,k.light)||D.push({command:lt.setLight,args:[k.light]});const $={},V=[];(function(ee,ie,fe,Se){let _e;for(_e in ie=ie||{},ee=ee||{})Object.prototype.hasOwnProperty.call(ee,_e)&&(Object.prototype.hasOwnProperty.call(ie,_e)||ut(_e,fe,Se));for(_e in ie)Object.prototype.hasOwnProperty.call(ie,_e)&&(Object.prototype.hasOwnProperty.call(ee,_e)?b(ee[_e],ie[_e])||(ee[_e].type==="geojson"&&ie[_e].type==="geojson"&&ft(ee,ie,_e)?fe.push({command:lt.setGeoJSONSourceData,args:[_e,ie[_e].data]}):it(_e,ie,fe,Se)):dt(_e,ie,fe))})(_.sources,k.sources,V,$);const W=[];_.layers&&_.layers.forEach(ee=>{$[ee.source]?D.push({command:lt.removeLayer,args:[ee.id]}):W.push(ee)}),D=D.concat(V),function(ee,ie,fe){ie=ie||[];const Se=(ee=ee||[]).map(Wt),_e=ie.map(Wt),we=ee.reduce(Ut,{}),$e=ie.reduce(Ut,{}),je=Se.slice(),et=Object.create(null);let Pe,at,nt,gt,yt,Dt,vt;for(Pe=0,at=0;Pe!(_.command in Dr));if(f.length===0)return!1;const v=f.filter(_=>!(_.command in Jn));if(v.length>0)throw new Error(`Unimplemented: ${v.map(_=>_.command).join(", ")}.`);return f.forEach(_=>{_.command!=="setTransition"&&this[_.command].apply(this,_.args)}),this.stylesheet=s,!0}addImage(s,f){if(this.getImage(s))return this.fire(new o.ErrorEvent(new Error(`An image named "${s}" already exists.`)));this.imageManager.addImage(s,f),this._afterImageUpdated(s)}updateImage(s,f){this.imageManager.updateImage(s,f)}getImage(s){return this.imageManager.getImage(s)}removeImage(s){if(!this.getImage(s))return this.fire(new o.ErrorEvent(new Error(`An image named "${s}" does not exist.`)));this.imageManager.removeImage(s),this._afterImageUpdated(s)}_afterImageUpdated(s){this._availableImages=this.imageManager.listImages(),this._changedImages[s]=!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(s,f,v={}){if(this._checkLoaded(),this.sourceCaches[s]!==void 0)throw new Error(`Source "${s}" already exists.`);if(!f.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(f).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(f.type)>=0&&this._validate(o.validateStyle.source,`sources.${s}`,f,null,v))return;this.map&&this.map._collectResourceTiming&&(f.collectResourceTiming=!0);const _=this.sourceCaches[s]=new Ue(s,f,this.dispatcher);_.style=this,_.setEventedParent(this,()=>({isSourceLoaded:this.loaded(),source:_.serialize(),sourceId:s})),_.onAdd(this.map),this._changed=!0}removeSource(s){if(this._checkLoaded(),this.sourceCaches[s]===void 0)throw new Error("There is no source with this ID");for(const v in this._layers)if(this._layers[v].source===s)return this.fire(new o.ErrorEvent(new Error(`Source "${s}" cannot be removed while layer "${v}" is using it.`)));const f=this.sourceCaches[s];delete this.sourceCaches[s],delete this._updatedSources[s],f.fire(new o.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:s})),f.setEventedParent(null),f.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(s,f){if(this._checkLoaded(),this.sourceCaches[s]===void 0)throw new Error(`There is no source with this ID=${s}`);const v=this.sourceCaches[s].getSource();if(v.type!=="geojson")throw new Error(`geojsonSource.type is ${v.type}, which is !== 'geojson`);v.setData(f),this._changed=!0}getSource(s){return this.sourceCaches[s]&&this.sourceCaches[s].getSource()}addLayer(s,f,v={}){this._checkLoaded();const _=s.id;if(this.getLayer(_))return void this.fire(new o.ErrorEvent(new Error(`Layer "${_}" already exists on this map.`)));let k;if(s.type==="custom"){if(Bn(this,o.validateCustomStyleLayer(s)))return;k=o.createStyleLayer(s)}else{if(typeof s.source=="object"&&(this.addSource(_,s.source),s=o.clone$1(s),s=o.extend(s,{source:_})),this._validate(o.validateStyle.layer,`layers.${_}`,s,{arrayIndex:-1},v))return;k=o.createStyleLayer(s),this._validateLayer(k),k.setEventedParent(this,{layer:{id:_}}),this._serializedLayers[k.id]=k.serialize()}const D=f?this._order.indexOf(f):this._order.length;if(f&&D===-1)this.fire(new o.ErrorEvent(new Error(`Cannot add layer "${_}" before non-existing layer "${f}".`)));else{if(this._order.splice(D,0,_),this._layerOrderChanged=!0,this._layers[_]=k,this._removedLayers[_]&&k.source&&k.type!=="custom"){const $=this._removedLayers[_];delete this._removedLayers[_],$.type!==k.type?this._updatedSources[k.source]="clear":(this._updatedSources[k.source]="reload",this.sourceCaches[k.source].pause())}this._updateLayer(k),k.onAdd&&k.onAdd(this.map)}}moveLayer(s,f){if(this._checkLoaded(),this._changed=!0,!this._layers[s])return void this.fire(new o.ErrorEvent(new Error(`The layer '${s}' does not exist in the map's style and cannot be moved.`)));if(s===f)return;const v=this._order.indexOf(s);this._order.splice(v,1);const _=f?this._order.indexOf(f):this._order.length;f&&_===-1?this.fire(new o.ErrorEvent(new Error(`Cannot move layer "${s}" before non-existing layer "${f}".`))):(this._order.splice(_,0,s),this._layerOrderChanged=!0)}removeLayer(s){this._checkLoaded();const f=this._layers[s];if(!f)return void this.fire(new o.ErrorEvent(new Error(`Cannot remove non-existing layer "${s}".`)));f.setEventedParent(null);const v=this._order.indexOf(s);this._order.splice(v,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[s]=f,delete this._layers[s],delete this._serializedLayers[s],delete this._updatedLayers[s],delete this._updatedPaintProps[s],f.onRemove&&f.onRemove(this.map)}getLayer(s){return this._layers[s]}hasLayer(s){return s in this._layers}setLayerZoomRange(s,f,v){this._checkLoaded();const _=this.getLayer(s);_?_.minzoom===f&&_.maxzoom===v||(f!=null&&(_.minzoom=f),v!=null&&(_.maxzoom=v),this._updateLayer(_)):this.fire(new o.ErrorEvent(new Error(`Cannot set the zoom range of non-existing layer "${s}".`)))}setFilter(s,f,v={}){this._checkLoaded();const _=this.getLayer(s);if(_){if(!b(_.filter,f))return f==null?(_.filter=void 0,void this._updateLayer(_)):void(this._validate(o.validateStyle.filter,`layers.${_.id}.filter`,f,null,v)||(_.filter=o.clone$1(f),this._updateLayer(_)))}else this.fire(new o.ErrorEvent(new Error(`Cannot filter non-existing layer "${s}".`)))}getFilter(s){return o.clone$1(this.getLayer(s).filter)}setLayoutProperty(s,f,v,_={}){this._checkLoaded();const k=this.getLayer(s);k?b(k.getLayoutProperty(f),v)||(k.setLayoutProperty(f,v,_),this._updateLayer(k)):this.fire(new o.ErrorEvent(new Error(`Cannot style non-existing layer "${s}".`)))}getLayoutProperty(s,f){const v=this.getLayer(s);if(v)return v.getLayoutProperty(f);this.fire(new o.ErrorEvent(new Error(`Cannot get style of non-existing layer "${s}".`)))}setPaintProperty(s,f,v,_={}){this._checkLoaded();const k=this.getLayer(s);k?b(k.getPaintProperty(f),v)||(k.setPaintProperty(f,v,_)&&this._updateLayer(k),this._changed=!0,this._updatedPaintProps[s]=!0):this.fire(new o.ErrorEvent(new Error(`Cannot style non-existing layer "${s}".`)))}getPaintProperty(s,f){return this.getLayer(s).getPaintProperty(f)}setFeatureState(s,f){this._checkLoaded();const v=s.source,_=s.sourceLayer,k=this.sourceCaches[v];if(k===void 0)return void this.fire(new o.ErrorEvent(new Error(`The source '${v}' does not exist in the map's style.`)));const D=k.getSource().type;D==="geojson"&&_?this.fire(new o.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):D!=="vector"||_?(s.id===void 0&&this.fire(new o.ErrorEvent(new Error("The feature id parameter must be provided."))),k.setFeatureState(_,s.id,f)):this.fire(new o.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(s,f){this._checkLoaded();const v=s.source,_=this.sourceCaches[v];if(_===void 0)return void this.fire(new o.ErrorEvent(new Error(`The source '${v}' does not exist in the map's style.`)));const k=_.getSource().type,D=k==="vector"?s.sourceLayer:void 0;k!=="vector"||D?f&&typeof s.id!="string"&&typeof s.id!="number"?this.fire(new o.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):_.removeFeatureState(D,s.id,f):this.fire(new o.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(s){this._checkLoaded();const f=s.source,v=s.sourceLayer,_=this.sourceCaches[f];if(_!==void 0)return _.getSource().type!=="vector"||v?(s.id===void 0&&this.fire(new o.ErrorEvent(new Error("The feature id parameter must be provided."))),_.getFeatureState(v,s.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 '${f}' 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,s=>s.serialize()),layers:this._serializeLayers(this._order)},s=>s!==void 0)}_updateLayer(s){this._updatedLayers[s.id]=!0,s.source&&!this._updatedSources[s.source]&&this.sourceCaches[s.source].getSource().type!=="raster"&&(this._updatedSources[s.source]="reload",this.sourceCaches[s.source].pause()),this._changed=!0}_flattenAndSortRenderedFeatures(s){const f=D=>this._layers[D].type==="fill-extrusion",v={},_=[];for(let D=this._order.length-1;D>=0;D--){const $=this._order[D];if(f($)){v[$]=D;for(const V of s){const W=V[$];if(W)for(const ee of W)_.push(ee)}}}_.sort((D,$)=>$.intersectionZ-D.intersectionZ);const k=[];for(let D=this._order.length-1;D>=0;D--){const $=this._order[D];if(f($))for(let V=_.length-1;V>=0;V--){const W=_[V].feature;if(v[W.layer.id]{const yt=$e.featureSortOrder;if(yt){const Dt=yt.indexOf(nt.featureIndex);return yt.indexOf(gt.featureIndex)-Dt}return gt.featureIndex-nt.featureIndex});for(const nt of at)Pe.push(nt)}}for(const $e in Se)Se[$e].forEach(je=>{const et=je.feature,Pe=V[D[$e].source].getFeatureState(et.layer["source-layer"],et.id);et.source=et.layer.source,et.layer["source-layer"]&&(et.sourceLayer=et.layer["source-layer"]),et.state=Pe});return Se}(this._layers,this._serializedLayers,this.sourceCaches,s,f,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(k)}querySourceFeatures(s,f){f&&f.filter&&this._validate(o.validateStyle.filter,"querySourceFeatures.filter",f.filter,null,f);const v=this.sourceCaches[s];return v?function(_,k){const D=_.getRenderableIds().map(W=>_.getTileByID(W)),$=[],V={};for(let W=0;Wfe.getTileByID(Se)).sort((Se,_e)=>_e.tileID.overscaledZ-Se.tileID.overscaledZ||(Se.tileID.isLessThan(_e.tileID)?-1:1))}const ie=this.crossTileSymbolIndex.addLayer(ee,V[ee.source],s.center.lng);D=D||ie}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((k=k||this._layerOrderChanged||v===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(o.exported.now(),s.zoom))&&(this.pauseablePlacement=new Be(s,this.terrain,this._order,k,f,v,_,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,V),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(o.exported.now()),$=!0),D&&this.pauseablePlacement.placement.setStale()),$||D)for(const W of this._order){const ee=this._layers[W];ee.type==="symbol"&&this.placement.updateLayerOpacities(ee,V[ee.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(o.exported.now())}_releaseSymbolFadeTiles(){for(const s in this.sourceCaches)this.sourceCaches[s].releaseSymbolFadeTiles()}getImages(s,f,v){this.imageManager.getImages(f.icons,v),this._updateTilesForChangedImages();const _=this.sourceCaches[f.source];_&&_.setDependencies(f.tileID.key,f.type,f.icons)}getGlyphs(s,f,v){this.glyphManager.getGlyphs(f.stacks,v)}getResource(s,f,v){return o.makeRequest(f,v)}}Pr.getSourceType=function(y){return ke[y]},Pr.setSourceType=function(y,s){ke[y]=s},Pr.registerForPluginStateChange=o.registerForPluginStateChange;var Pn="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 Sn={prelude:Rn(`#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:Rn(`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:Rn(`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:Rn(`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:Rn("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:Rn(`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:Rn(`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:Rn("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:Rn("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:Rn("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:Rn(`#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:Rn(`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:Rn(`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:Rn(`#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:Rn(`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:Rn(`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:Rn(`#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:Rn(`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:Rn(`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:Rn(`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:Rn(`#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:Rn(`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:Rn(`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:Rn(`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:Rn(`#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:Rn(`#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:Rn("uniform sampler2D u_texture;varying vec2 v_texture_pos;void main() {gl_FragColor=texture2D(u_texture,v_texture_pos);}",Pn),terrainDepth:Rn("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);}",Pn),terrainCoords:Rn("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);}",Pn)};function Rn(y,s){const f=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,v=s.match(/attribute ([\w]+) ([\w]+)/g),_=y.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),k=s.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),D=k?k.concat(_):_,$={};return{fragmentSource:y=y.replace(f,(V,W,ee,ie,fe)=>($[fe]=!0,W==="define"?` #ifndef HAS_UNIFORM_u_${fe} varying ${ee} ${ie} ${fe}; #else uniform ${ee} ${ie} u_${fe}; #endif `:` #ifdef HAS_UNIFORM_u_${fe} ${ee} ${ie} ${fe} = u_${fe}; #endif `)),vertexSource:s=s.replace(f,(V,W,ee,ie,fe)=>{const Se=ie==="float"?"vec2":"vec4",_e=fe.match(/color/)?"color":Se;return $[fe]?W==="define"?` #ifndef HAS_UNIFORM_u_${fe} uniform lowp float u_${fe}_t; attribute ${ee} ${Se} a_${fe}; varying ${ee} ${ie} ${fe}; #else uniform ${ee} ${ie} u_${fe}; #endif `:_e==="vec4"?` #ifndef HAS_UNIFORM_u_${fe} ${fe} = a_${fe}; #else ${ee} ${ie} ${fe} = u_${fe}; #endif `:` #ifndef HAS_UNIFORM_u_${fe} ${fe} = unpack_mix_${_e}(a_${fe}, u_${fe}_t); #else ${ee} ${ie} ${fe} = u_${fe}; #endif `:W==="define"?` #ifndef HAS_UNIFORM_u_${fe} uniform lowp float u_${fe}_t; attribute ${ee} ${Se} a_${fe}; #else uniform ${ee} ${ie} u_${fe}; #endif `:_e==="vec4"?` #ifndef HAS_UNIFORM_u_${fe} ${ee} ${ie} ${fe} = a_${fe}; #else ${ee} ${ie} ${fe} = u_${fe}; #endif `:` #ifndef HAS_UNIFORM_u_${fe} ${ee} ${ie} ${fe} = unpack_mix_${_e}(a_${fe}, u_${fe}_t); #else ${ee} ${ie} ${fe} = u_${fe}; #endif `}),staticAttributes:v,staticUniforms:D}}class Wr{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(s,f,v,_,k,D,$,V,W){this.context=s;let ee=this.boundPaintVertexBuffers.length!==_.length;for(let ie=0;!ee&&ie<_.length;ie++)this.boundPaintVertexBuffers[ie]!==_[ie]&&(ee=!0);s.extVertexArrayObject&&this.vao&&this.boundProgram===f&&this.boundLayoutVertexBuffer===v&&!ee&&this.boundIndexBuffer===k&&this.boundVertexOffset===D&&this.boundDynamicVertexBuffer===$&&this.boundDynamicVertexBuffer2===V&&this.boundDynamicVertexBuffer3===W?(s.bindVertexArrayOES.set(this.vao),$&&$.bind(),k&&k.dynamicDraw&&k.bind(),V&&V.bind(),W&&W.bind()):this.freshBind(f,v,_,k,D,$,V,W)}freshBind(s,f,v,_,k,D,$,V){let W;const ee=s.numAttributes,ie=this.context,fe=ie.gl;if(ie.extVertexArrayObject)this.vao&&this.destroy(),this.vao=ie.extVertexArrayObject.createVertexArrayOES(),ie.bindVertexArrayOES.set(this.vao),W=0,this.boundProgram=s,this.boundLayoutVertexBuffer=f,this.boundPaintVertexBuffers=v,this.boundIndexBuffer=_,this.boundVertexOffset=k,this.boundDynamicVertexBuffer=D,this.boundDynamicVertexBuffer2=$,this.boundDynamicVertexBuffer3=V;else{W=ie.currentNumAttributes||0;for(let Se=ee;Se({u_depth:new o.Uniform1i(yt,Dt.u_depth),u_terrain:new o.Uniform1i(yt,Dt.u_terrain),u_terrain_dim:new o.Uniform1f(yt,Dt.u_terrain_dim),u_terrain_matrix:new o.UniformMatrix4f(yt,Dt.u_terrain_matrix),u_terrain_unpack:new o.Uniform4f(yt,Dt.u_terrain_unpack),u_terrain_offset:new o.Uniform1f(yt,Dt.u_terrain_offset),u_terrain_exaggeration:new o.Uniform1f(yt,Dt.u_terrain_exaggeration)}))(s,gt),this.binderUniforms=_?_.getUniforms(s,gt):[]}draw(s,f,v,_,k,D,$,V,W,ee,ie,fe,Se,_e,we,$e,je,et){const Pe=s.gl;if(this.failedToCreate)return;if(s.program.set(this.program),s.setDepthMode(v),s.setStencilMode(_),s.setColorMode(k),s.setCullFace(D),V){s.activeTexture.set(Pe.TEXTURE2),Pe.bindTexture(Pe.TEXTURE_2D,V.depthTexture),s.activeTexture.set(Pe.TEXTURE3),Pe.bindTexture(Pe.TEXTURE_2D,V.texture);for(const nt in this.terrainUniforms)this.terrainUniforms[nt].set(V[nt])}for(const nt in this.fixedUniforms)this.fixedUniforms[nt].set($[nt]);we&&we.setUniforms(s,this.binderUniforms,Se,{zoom:_e});let at=0;switch(f){case Pe.LINES:at=2;break;case Pe.TRIANGLES:at=3;break;case Pe.LINE_STRIP:at=1}for(const nt of fe.get()){const gt=nt.vaos||(nt.vaos={});(gt[W]||(gt[W]=new Wr)).bind(s,this,ee,we?we.getPaintVertexBuffers():[],ie,nt.vertexOffset,$e,je,et),Pe.drawElements(f,nt.primitiveLength*at,Pe.UNSIGNED_SHORT,nt.primitiveOffset*at*2)}}}function Ln(y,s,f){const v=1/Nt(f,1,s.transform.tileZoom),_=Math.pow(2,f.tileID.overscaledZ),k=f.tileSize*Math.pow(2,s.transform.tileZoom)/_,D=k*(f.tileID.canonical.x+f.tileID.wrap*_),$=k*f.tileID.canonical.y;return{u_image:0,u_texsize:f.imageAtlasTexture.size,u_scale:[v,y.fromScale,y.toScale],u_fade:y.t,u_pixel_coord_upper:[D>>16,$>>16],u_pixel_coord_lower:[65535&D,65535&$]}}const Yn=(y,s,f,v)=>{const _=s.style.light,k=_.properties.get("position"),D=[k.x,k.y,k.z],$=o.create$1();_.properties.get("anchor")==="viewport"&&o.fromRotation($,-s.transform.angle),o.transformMat3(D,D,$);const V=_.properties.get("color");return{u_matrix:y,u_lightpos:D,u_lightintensity:_.properties.get("intensity"),u_lightcolor:[V.r,V.g,V.b],u_vertical_gradient:+f,u_opacity:v}},xr=(y,s,f,v,_,k,D)=>o.extend(Yn(y,s,f,v),Ln(k,s,D),{u_height_factor:-Math.pow(2,_.overscaledZ)/D.tileSize/8}),br=y=>({u_matrix:y}),Lr=(y,s,f,v)=>o.extend(br(y),Ln(f,s,v)),so=(y,s)=>({u_matrix:y,u_world:s}),cl=(y,s,f,v,_)=>o.extend(Lr(y,s,f,v),{u_world:_}),Ac=(y,s,f,v)=>{const _=y.transform;let k,D;if(v.paint.get("circle-pitch-alignment")==="map"){const $=Nt(f,1,_.zoom);k=!0,D=[$,$]}else k=!1,D=_.pixelsToGLUnits;return{u_camera_to_center_distance:_.cameraToCenterDistance,u_scale_with_map:+(v.paint.get("circle-pitch-scale")==="map"),u_matrix:y.translatePosMatrix(s.posMatrix,f,v.paint.get("circle-translate"),v.paint.get("circle-translate-anchor")),u_pitch_with_map:+k,u_device_pixel_ratio:y.pixelRatio,u_extrude_scale:D}},Ea=(y,s,f)=>{const v=Nt(f,1,s.zoom),_=Math.pow(2,s.zoom-f.tileID.overscaledZ),k=f.tileID.overscaleFactor();return{u_matrix:y,u_camera_to_center_distance:s.cameraToCenterDistance,u_pixels_to_tile_units:v,u_extrude_scale:[s.pixelsToGLUnits[0]/(v*_),s.pixelsToGLUnits[1]/(v*_)],u_overscale_factor:k}},zn=(y,s,f=1)=>({u_matrix:y,u_color:s,u_overlay:0,u_overlay_scale:f}),Zn=y=>({u_matrix:y}),Ir=(y,s,f,v)=>({u_matrix:y,u_extrude_scale:Nt(s,1,f),u_intensity:v});function ki(y,s){const f=Math.pow(2,s.canonical.z),v=s.canonical.y;return[new o.MercatorCoordinate(0,v/f).toLngLat().lat,new o.MercatorCoordinate(0,(v+1)/f).toLngLat().lat]}const Ga=(y,s,f,v)=>{const _=y.transform;return{u_matrix:Ta(y,s,f,v),u_ratio:1/Nt(s,1,_.zoom),u_device_pixel_ratio:y.pixelRatio,u_units_to_pixels:[1/_.pixelsToGLUnits[0],1/_.pixelsToGLUnits[1]]}},Eo=(y,s,f,v,_)=>o.extend(Ga(y,s,f,_),{u_image:0,u_image_height:v}),_s=(y,s,f,v,_)=>{const k=y.transform,D=gr(s,k);return{u_matrix:Ta(y,s,f,_),u_texsize:s.imageAtlasTexture.size,u_ratio:1/Nt(s,1,k.zoom),u_device_pixel_ratio:y.pixelRatio,u_image:0,u_scale:[D,v.fromScale,v.toScale],u_fade:v.t,u_units_to_pixels:[1/k.pixelsToGLUnits[0],1/k.pixelsToGLUnits[1]]}},ka=(y,s,f,v,_,k)=>{const D=y.lineAtlas,$=gr(s,y.transform),V=f.layout.get("line-cap")==="round",W=D.getDash(v.from,V),ee=D.getDash(v.to,V),ie=W.width*_.fromScale,fe=ee.width*_.toScale;return o.extend(Ga(y,s,f,k),{u_patternscale_a:[$/ie,-W.height/2],u_patternscale_b:[$/fe,-ee.height/2],u_sdfgamma:D.width/(256*Math.min(ie,fe)*y.pixelRatio)/2,u_image:0,u_tex_y_a:W.y,u_tex_y_b:ee.y,u_mix:_.t})};function gr(y,s){return 1/Nt(y,1,s.tileZoom)}function Ta(y,s,f,v){return y.translatePosMatrix(v?v.posMatrix:s.tileID.posMatrix,s,f.paint.get("line-translate"),f.paint.get("line-translate-anchor"))}const gm=(y,s,f,v,_)=>{return{u_matrix:y,u_tl_parent:s,u_scale_parent:f,u_buffer_scale:1,u_fade_t:v.mix,u_opacity:v.opacity*_.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:_.paint.get("raster-brightness-min"),u_brightness_high:_.paint.get("raster-brightness-max"),u_saturation_factor:(D=_.paint.get("raster-saturation"),D>0?1-1/(1.001-D):-D),u_contrast_factor:(k=_.paint.get("raster-contrast"),k>0?1/(1-k):1+k),u_spin_weights:ym(_.paint.get("raster-hue-rotate"))};var k,D};function ym(y){y*=Math.PI/180;const s=Math.sin(y),f=Math.cos(y);return[(2*f+1)/3,(-Math.sqrt(3)*s-f+1)/3,(Math.sqrt(3)*s-f+1)/3]}const Ef=(y,s,f,v,_,k,D,$,V,W)=>{const ee=_.transform;return{u_is_size_zoom_constant:+(y==="constant"||y==="source"),u_is_size_feature_constant:+(y==="constant"||y==="camera"),u_size_t:s?s.uSizeT:0,u_size:s?s.uSize:0,u_camera_to_center_distance:ee.cameraToCenterDistance,u_pitch:ee.pitch/360*2*Math.PI,u_rotate_symbol:+f,u_aspect_ratio:ee.width/ee.height,u_fade_change:_.options.fadeDuration?_.symbolFadeChange:1,u_matrix:k,u_label_plane_matrix:D,u_coord_matrix:$,u_is_text:+V,u_pitch_with_map:+v,u_texsize:W,u_texture:0}},Oc=(y,s,f,v,_,k,D,$,V,W,ee)=>{const ie=_.transform;return o.extend(Ef(y,s,f,v,_,k,D,$,V,W),{u_gamma_scale:v?Math.cos(ie._pitch)*ie.cameraToCenterDistance:1,u_device_pixel_ratio:_.pixelRatio,u_is_halo:+ee})},xm=(y,s,f,v,_,k,D,$,V,W)=>o.extend(Oc(y,s,f,v,_,k,D,$,!0,V,!0),{u_texsize_icon:W,u_texture_icon:1}),p1=(y,s,f)=>({u_matrix:y,u_opacity:s,u_color:f}),m1=(y,s,f,v,_,k)=>o.extend(function(D,$,V,W){const ee=V.imageManager.getPattern(D.from.toString()),ie=V.imageManager.getPattern(D.to.toString()),{width:fe,height:Se}=V.imageManager.getPixelSize(),_e=Math.pow(2,W.tileID.overscaledZ),we=W.tileSize*Math.pow(2,V.transform.tileZoom)/_e,$e=we*(W.tileID.canonical.x+W.tileID.wrap*_e),je=we*W.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:ee.tl,u_pattern_br_a:ee.br,u_pattern_tl_b:ie.tl,u_pattern_br_b:ie.br,u_texsize:[fe,Se],u_mix:$.t,u_pattern_size_a:ee.displaySize,u_pattern_size_b:ie.displaySize,u_scale_a:$.fromScale,u_scale_b:$.toScale,u_tile_units_to_pixels:1/Nt(W,1,V.transform.tileZoom),u_pixel_coord_upper:[$e>>16,je>>16],u_pixel_coord_lower:[65535&$e,65535&je]}}(v,k,f,_),{u_matrix:y,u_opacity:s}),kf={fillExtrusion:(y,s)=>({u_matrix:new o.UniformMatrix4f(y,s.u_matrix),u_lightpos:new o.Uniform3f(y,s.u_lightpos),u_lightintensity:new o.Uniform1f(y,s.u_lightintensity),u_lightcolor:new o.Uniform3f(y,s.u_lightcolor),u_vertical_gradient:new o.Uniform1f(y,s.u_vertical_gradient),u_opacity:new o.Uniform1f(y,s.u_opacity)}),fillExtrusionPattern:(y,s)=>({u_matrix:new o.UniformMatrix4f(y,s.u_matrix),u_lightpos:new o.Uniform3f(y,s.u_lightpos),u_lightintensity:new o.Uniform1f(y,s.u_lightintensity),u_lightcolor:new o.Uniform3f(y,s.u_lightcolor),u_vertical_gradient:new o.Uniform1f(y,s.u_vertical_gradient),u_height_factor:new o.Uniform1f(y,s.u_height_factor),u_image:new o.Uniform1i(y,s.u_image),u_texsize:new o.Uniform2f(y,s.u_texsize),u_pixel_coord_upper:new o.Uniform2f(y,s.u_pixel_coord_upper),u_pixel_coord_lower:new o.Uniform2f(y,s.u_pixel_coord_lower),u_scale:new o.Uniform3f(y,s.u_scale),u_fade:new o.Uniform1f(y,s.u_fade),u_opacity:new o.Uniform1f(y,s.u_opacity)}),fill:(y,s)=>({u_matrix:new o.UniformMatrix4f(y,s.u_matrix)}),fillPattern:(y,s)=>({u_matrix:new o.UniformMatrix4f(y,s.u_matrix),u_image:new o.Uniform1i(y,s.u_image),u_texsize:new o.Uniform2f(y,s.u_texsize),u_pixel_coord_upper:new o.Uniform2f(y,s.u_pixel_coord_upper),u_pixel_coord_lower:new o.Uniform2f(y,s.u_pixel_coord_lower),u_scale:new o.Uniform3f(y,s.u_scale),u_fade:new o.Uniform1f(y,s.u_fade)}),fillOutline:(y,s)=>({u_matrix:new o.UniformMatrix4f(y,s.u_matrix),u_world:new o.Uniform2f(y,s.u_world)}),fillOutlinePattern:(y,s)=>({u_matrix:new o.UniformMatrix4f(y,s.u_matrix),u_world:new o.Uniform2f(y,s.u_world),u_image:new o.Uniform1i(y,s.u_image),u_texsize:new o.Uniform2f(y,s.u_texsize),u_pixel_coord_upper:new o.Uniform2f(y,s.u_pixel_coord_upper),u_pixel_coord_lower:new o.Uniform2f(y,s.u_pixel_coord_lower),u_scale:new o.Uniform3f(y,s.u_scale),u_fade:new o.Uniform1f(y,s.u_fade)}),circle:(y,s)=>({u_camera_to_center_distance:new o.Uniform1f(y,s.u_camera_to_center_distance),u_scale_with_map:new o.Uniform1i(y,s.u_scale_with_map),u_pitch_with_map:new o.Uniform1i(y,s.u_pitch_with_map),u_extrude_scale:new o.Uniform2f(y,s.u_extrude_scale),u_device_pixel_ratio:new o.Uniform1f(y,s.u_device_pixel_ratio),u_matrix:new o.UniformMatrix4f(y,s.u_matrix)}),collisionBox:(y,s)=>({u_matrix:new o.UniformMatrix4f(y,s.u_matrix),u_camera_to_center_distance:new o.Uniform1f(y,s.u_camera_to_center_distance),u_pixels_to_tile_units:new o.Uniform1f(y,s.u_pixels_to_tile_units),u_extrude_scale:new o.Uniform2f(y,s.u_extrude_scale),u_overscale_factor:new o.Uniform1f(y,s.u_overscale_factor)}),collisionCircle:(y,s)=>({u_matrix:new o.UniformMatrix4f(y,s.u_matrix),u_inv_matrix:new o.UniformMatrix4f(y,s.u_inv_matrix),u_camera_to_center_distance:new o.Uniform1f(y,s.u_camera_to_center_distance),u_viewport_size:new o.Uniform2f(y,s.u_viewport_size)}),debug:(y,s)=>({u_color:new o.UniformColor(y,s.u_color),u_matrix:new o.UniformMatrix4f(y,s.u_matrix),u_overlay:new o.Uniform1i(y,s.u_overlay),u_overlay_scale:new o.Uniform1f(y,s.u_overlay_scale)}),clippingMask:(y,s)=>({u_matrix:new o.UniformMatrix4f(y,s.u_matrix)}),heatmap:(y,s)=>({u_extrude_scale:new o.Uniform1f(y,s.u_extrude_scale),u_intensity:new o.Uniform1f(y,s.u_intensity),u_matrix:new o.UniformMatrix4f(y,s.u_matrix)}),heatmapTexture:(y,s)=>({u_matrix:new o.UniformMatrix4f(y,s.u_matrix),u_world:new o.Uniform2f(y,s.u_world),u_image:new o.Uniform1i(y,s.u_image),u_color_ramp:new o.Uniform1i(y,s.u_color_ramp),u_opacity:new o.Uniform1f(y,s.u_opacity)}),hillshade:(y,s)=>({u_matrix:new o.UniformMatrix4f(y,s.u_matrix),u_image:new o.Uniform1i(y,s.u_image),u_latrange:new o.Uniform2f(y,s.u_latrange),u_light:new o.Uniform2f(y,s.u_light),u_shadow:new o.UniformColor(y,s.u_shadow),u_highlight:new o.UniformColor(y,s.u_highlight),u_accent:new o.UniformColor(y,s.u_accent)}),hillshadePrepare:(y,s)=>({u_matrix:new o.UniformMatrix4f(y,s.u_matrix),u_image:new o.Uniform1i(y,s.u_image),u_dimension:new o.Uniform2f(y,s.u_dimension),u_zoom:new o.Uniform1f(y,s.u_zoom),u_unpack:new o.Uniform4f(y,s.u_unpack)}),line:(y,s)=>({u_matrix:new o.UniformMatrix4f(y,s.u_matrix),u_ratio:new o.Uniform1f(y,s.u_ratio),u_device_pixel_ratio:new o.Uniform1f(y,s.u_device_pixel_ratio),u_units_to_pixels:new o.Uniform2f(y,s.u_units_to_pixels)}),lineGradient:(y,s)=>({u_matrix:new o.UniformMatrix4f(y,s.u_matrix),u_ratio:new o.Uniform1f(y,s.u_ratio),u_device_pixel_ratio:new o.Uniform1f(y,s.u_device_pixel_ratio),u_units_to_pixels:new o.Uniform2f(y,s.u_units_to_pixels),u_image:new o.Uniform1i(y,s.u_image),u_image_height:new o.Uniform1f(y,s.u_image_height)}),linePattern:(y,s)=>({u_matrix:new o.UniformMatrix4f(y,s.u_matrix),u_texsize:new o.Uniform2f(y,s.u_texsize),u_ratio:new o.Uniform1f(y,s.u_ratio),u_device_pixel_ratio:new o.Uniform1f(y,s.u_device_pixel_ratio),u_image:new o.Uniform1i(y,s.u_image),u_units_to_pixels:new o.Uniform2f(y,s.u_units_to_pixels),u_scale:new o.Uniform3f(y,s.u_scale),u_fade:new o.Uniform1f(y,s.u_fade)}),lineSDF:(y,s)=>({u_matrix:new o.UniformMatrix4f(y,s.u_matrix),u_ratio:new o.Uniform1f(y,s.u_ratio),u_device_pixel_ratio:new o.Uniform1f(y,s.u_device_pixel_ratio),u_units_to_pixels:new o.Uniform2f(y,s.u_units_to_pixels),u_patternscale_a:new o.Uniform2f(y,s.u_patternscale_a),u_patternscale_b:new o.Uniform2f(y,s.u_patternscale_b),u_sdfgamma:new o.Uniform1f(y,s.u_sdfgamma),u_image:new o.Uniform1i(y,s.u_image),u_tex_y_a:new o.Uniform1f(y,s.u_tex_y_a),u_tex_y_b:new o.Uniform1f(y,s.u_tex_y_b),u_mix:new o.Uniform1f(y,s.u_mix)}),raster:(y,s)=>({u_matrix:new o.UniformMatrix4f(y,s.u_matrix),u_tl_parent:new o.Uniform2f(y,s.u_tl_parent),u_scale_parent:new o.Uniform1f(y,s.u_scale_parent),u_buffer_scale:new o.Uniform1f(y,s.u_buffer_scale),u_fade_t:new o.Uniform1f(y,s.u_fade_t),u_opacity:new o.Uniform1f(y,s.u_opacity),u_image0:new o.Uniform1i(y,s.u_image0),u_image1:new o.Uniform1i(y,s.u_image1),u_brightness_low:new o.Uniform1f(y,s.u_brightness_low),u_brightness_high:new o.Uniform1f(y,s.u_brightness_high),u_saturation_factor:new o.Uniform1f(y,s.u_saturation_factor),u_contrast_factor:new o.Uniform1f(y,s.u_contrast_factor),u_spin_weights:new o.Uniform3f(y,s.u_spin_weights)}),symbolIcon:(y,s)=>({u_is_size_zoom_constant:new o.Uniform1i(y,s.u_is_size_zoom_constant),u_is_size_feature_constant:new o.Uniform1i(y,s.u_is_size_feature_constant),u_size_t:new o.Uniform1f(y,s.u_size_t),u_size:new o.Uniform1f(y,s.u_size),u_camera_to_center_distance:new o.Uniform1f(y,s.u_camera_to_center_distance),u_pitch:new o.Uniform1f(y,s.u_pitch),u_rotate_symbol:new o.Uniform1i(y,s.u_rotate_symbol),u_aspect_ratio:new o.Uniform1f(y,s.u_aspect_ratio),u_fade_change:new o.Uniform1f(y,s.u_fade_change),u_matrix:new o.UniformMatrix4f(y,s.u_matrix),u_label_plane_matrix:new o.UniformMatrix4f(y,s.u_label_plane_matrix),u_coord_matrix:new o.UniformMatrix4f(y,s.u_coord_matrix),u_is_text:new o.Uniform1i(y,s.u_is_text),u_pitch_with_map:new o.Uniform1i(y,s.u_pitch_with_map),u_texsize:new o.Uniform2f(y,s.u_texsize),u_texture:new o.Uniform1i(y,s.u_texture)}),symbolSDF:(y,s)=>({u_is_size_zoom_constant:new o.Uniform1i(y,s.u_is_size_zoom_constant),u_is_size_feature_constant:new o.Uniform1i(y,s.u_is_size_feature_constant),u_size_t:new o.Uniform1f(y,s.u_size_t),u_size:new o.Uniform1f(y,s.u_size),u_camera_to_center_distance:new o.Uniform1f(y,s.u_camera_to_center_distance),u_pitch:new o.Uniform1f(y,s.u_pitch),u_rotate_symbol:new o.Uniform1i(y,s.u_rotate_symbol),u_aspect_ratio:new o.Uniform1f(y,s.u_aspect_ratio),u_fade_change:new o.Uniform1f(y,s.u_fade_change),u_matrix:new o.UniformMatrix4f(y,s.u_matrix),u_label_plane_matrix:new o.UniformMatrix4f(y,s.u_label_plane_matrix),u_coord_matrix:new o.UniformMatrix4f(y,s.u_coord_matrix),u_is_text:new o.Uniform1i(y,s.u_is_text),u_pitch_with_map:new o.Uniform1i(y,s.u_pitch_with_map),u_texsize:new o.Uniform2f(y,s.u_texsize),u_texture:new o.Uniform1i(y,s.u_texture),u_gamma_scale:new o.Uniform1f(y,s.u_gamma_scale),u_device_pixel_ratio:new o.Uniform1f(y,s.u_device_pixel_ratio),u_is_halo:new o.Uniform1i(y,s.u_is_halo)}),symbolTextAndIcon:(y,s)=>({u_is_size_zoom_constant:new o.Uniform1i(y,s.u_is_size_zoom_constant),u_is_size_feature_constant:new o.Uniform1i(y,s.u_is_size_feature_constant),u_size_t:new o.Uniform1f(y,s.u_size_t),u_size:new o.Uniform1f(y,s.u_size),u_camera_to_center_distance:new o.Uniform1f(y,s.u_camera_to_center_distance),u_pitch:new o.Uniform1f(y,s.u_pitch),u_rotate_symbol:new o.Uniform1i(y,s.u_rotate_symbol),u_aspect_ratio:new o.Uniform1f(y,s.u_aspect_ratio),u_fade_change:new o.Uniform1f(y,s.u_fade_change),u_matrix:new o.UniformMatrix4f(y,s.u_matrix),u_label_plane_matrix:new o.UniformMatrix4f(y,s.u_label_plane_matrix),u_coord_matrix:new o.UniformMatrix4f(y,s.u_coord_matrix),u_is_text:new o.Uniform1i(y,s.u_is_text),u_pitch_with_map:new o.Uniform1i(y,s.u_pitch_with_map),u_texsize:new o.Uniform2f(y,s.u_texsize),u_texsize_icon:new o.Uniform2f(y,s.u_texsize_icon),u_texture:new o.Uniform1i(y,s.u_texture),u_texture_icon:new o.Uniform1i(y,s.u_texture_icon),u_gamma_scale:new o.Uniform1f(y,s.u_gamma_scale),u_device_pixel_ratio:new o.Uniform1f(y,s.u_device_pixel_ratio),u_is_halo:new o.Uniform1i(y,s.u_is_halo)}),background:(y,s)=>({u_matrix:new o.UniformMatrix4f(y,s.u_matrix),u_opacity:new o.Uniform1f(y,s.u_opacity),u_color:new o.UniformColor(y,s.u_color)}),backgroundPattern:(y,s)=>({u_matrix:new o.UniformMatrix4f(y,s.u_matrix),u_opacity:new o.Uniform1f(y,s.u_opacity),u_image:new o.Uniform1i(y,s.u_image),u_pattern_tl_a:new o.Uniform2f(y,s.u_pattern_tl_a),u_pattern_br_a:new o.Uniform2f(y,s.u_pattern_br_a),u_pattern_tl_b:new o.Uniform2f(y,s.u_pattern_tl_b),u_pattern_br_b:new o.Uniform2f(y,s.u_pattern_br_b),u_texsize:new o.Uniform2f(y,s.u_texsize),u_mix:new o.Uniform1f(y,s.u_mix),u_pattern_size_a:new o.Uniform2f(y,s.u_pattern_size_a),u_pattern_size_b:new o.Uniform2f(y,s.u_pattern_size_b),u_scale_a:new o.Uniform1f(y,s.u_scale_a),u_scale_b:new o.Uniform1f(y,s.u_scale_b),u_pixel_coord_upper:new o.Uniform2f(y,s.u_pixel_coord_upper),u_pixel_coord_lower:new o.Uniform2f(y,s.u_pixel_coord_lower),u_tile_units_to_pixels:new o.Uniform1f(y,s.u_tile_units_to_pixels)}),terrain:(y,s)=>({u_matrix:new o.UniformMatrix4f(y,s.u_matrix),u_texture:new o.Uniform1i(y,s.u_texture)}),terrainDepth:(y,s)=>({u_matrix:new o.UniformMatrix4f(y,s.u_matrix)}),terrainCoords:(y,s)=>({u_matrix:new o.UniformMatrix4f(y,s.u_matrix),u_texture:new o.Uniform1i(y,s.u_texture),u_terrain_coords_id:new o.Uniform1f(y,s.u_terrain_coords_id)})};class Tf{constructor(s,f,v){this.context=s;const _=s.gl;this.buffer=_.createBuffer(),this.dynamicDraw=Boolean(v),this.context.unbindVAO(),s.bindElementBuffer.set(this.buffer),_.bufferData(_.ELEMENT_ARRAY_BUFFER,f.arrayBuffer,this.dynamicDraw?_.DYNAMIC_DRAW:_.STATIC_DRAW),this.dynamicDraw||delete f.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(s){const f=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),f.bufferSubData(f.ELEMENT_ARRAY_BUFFER,0,s.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const Pf={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class If{constructor(s,f,v,_){this.length=f.length,this.attributes=v,this.itemSize=f.bytesPerElement,this.dynamicDraw=_,this.context=s;const k=s.gl;this.buffer=k.createBuffer(),s.bindVertexBuffer.set(this.buffer),k.bufferData(k.ARRAY_BUFFER,f.arrayBuffer,this.dynamicDraw?k.DYNAMIC_DRAW:k.STATIC_DRAW),this.dynamicDraw||delete f.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(s){if(s.length!==this.length)throw new Error(`Length of new data is ${s.length}, which doesn't match current length of ${this.length}`);const f=this.context.gl;this.bind(),f.bufferSubData(f.ARRAY_BUFFER,0,s.arrayBuffer)}enableAttributes(s,f){for(let v=0;v0){const rn=o.create(),qt=yt;o.mul(rn,gt.placementInvProjMatrix,y.transform.glCoordMatrix),o.mul(rn,rn,gt.placementViewportMatrix),ee.push({circleArray:vt,circleOffset:fe,transform:qt,invTransform:rn,coord:at}),ie+=vt.length/4,fe=ie}Dt&&W.draw($,V.LINES,Xn.disabled,wr.disabled,y.colorModeForRenderPass(),Mr.disabled,Ea(yt,y.transform,nt),y.style.terrain&&y.style.terrain.getTerrainData(at),f.id,Dt.layoutVertexBuffer,Dt.indexBuffer,Dt.segments,null,y.transform.zoom,null,null,Dt.collisionVertexBuffer)}if(!D||!ee.length)return;const Se=y.useProgram("collisionCircle"),_e=new o.CollisionCircleLayoutArray;_e.resize(4*ie),_e._trim();let we=0;for(const Pe of ee)for(let at=0;at=0&&(_e[$e.associatedIconIndex]={shiftedAnchor:Dn,angle:Vn})}else zt($e.numGlyphs,fe)}if(W){Se.clear();const we=y.icon.placedSymbolArray;for(let $e=0;$ey.style.terrain.getElevation(Dt,Qf,_l):null,Es=f.layout.get("text-rotation-alignment")==="map";_n(rn,Dt.posMatrix,y,_,To,Qi,$e,W,Es,Po)}const ci=y.translatePosMatrix(Dt.posMatrix,vt,k,D),Hn=je||_&>||qc?C1:To,ur=y.translatePosMatrix(Qi,vt,k,D,!0),gi=Dn&&f.paint.get(_?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let yi;yi=Dn?rn.iconsInText?xm(Vn.kind,dr,et,$e,y,ci,Hn,ur,er,Fo):Oc(Vn.kind,dr,et,$e,y,ci,Hn,ur,_,er,!0):Ef(Vn.kind,dr,et,$e,y,ci,Hn,ur,_,er);const Ar={program:cr,buffers:qt,uniformValues:yi,atlasTexture:pr,atlasTextureIcon:sa,atlasInterpolation:vi,atlasInterpolationIcon:aa,isSDF:Dn,hasHalo:gi};if(Pe&&rn.canOverlap){at=!0;const Po=qt.segments.get();for(const Es of Po)yt.push({segments:new o.SegmentVector([Es]),sortKey:Es.sortKey,state:Ar,terrainData:Qn})}else yt.push({segments:qt.segments,sortKey:0,state:Ar,terrainData:Qn})}at&&yt.sort((Dt,vt)=>Dt.sortKey-vt.sortKey);for(const Dt of yt){const vt=Dt.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 rn=vt.uniformValues;vt.hasHalo&&(rn.u_is_halo=1,Cu(vt.buffers,Dt.segments,f,y,vt.program,nt,ee,ie,rn,Dt.terrainData)),rn.u_is_halo=0}Cu(vt.buffers,Dt.segments,f,y,vt.program,nt,ee,ie,vt.uniformValues,Dt.terrainData)}}function Cu(y,s,f,v,_,k,D,$,V,W){const ee=v.context;_.draw(ee,ee.gl.TRIANGLES,k,D,$,Mr.disabled,V,W,f.id,y.layoutVertexBuffer,y.indexBuffer,s,f.paint,v.transform.zoom,y.programConfigurations.get(f.id),y.dynamicLayoutVertexBuffer,y.opacityVertexBuffer)}function Su(y,s,f,v,_,k,D){const $=y.context.gl,V=f.paint.get("fill-pattern"),W=V&&V.constantOr(1),ee=f.getCrossfadeParameters();let ie,fe,Se,_e,we;D?(fe=W&&!f.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",ie=$.LINES):(fe=W?"fillPattern":"fill",ie=$.TRIANGLES);for(const $e of v){const je=s.getTile($e);if(W&&!je.patternsLoaded())continue;const et=je.getBucket(f);if(!et)continue;const Pe=et.programConfigurations.get(f.id),at=y.useProgram(fe,Pe),nt=y.style.terrain&&y.style.terrain.getTerrainData($e);W&&(y.context.activeTexture.set($.TEXTURE0),je.imageAtlasTexture.bind($.LINEAR,$.CLAMP_TO_EDGE),Pe.updatePaintBuffers(ee));const gt=V.constantOr(null);if(gt&&je.imageAtlas){const vt=je.imageAtlas,rn=vt.patternPositions[gt.to.toString()],qt=vt.patternPositions[gt.from.toString()];rn&&qt&&Pe.setConstantPatternPositions(rn,qt)}const yt=nt?$e:null,Dt=y.translatePosMatrix(yt?yt.posMatrix:$e.posMatrix,je,f.paint.get("fill-translate"),f.paint.get("fill-translate-anchor"));if(D){_e=et.indexBuffer2,we=et.segments2;const vt=[$.drawingBufferWidth,$.drawingBufferHeight];Se=fe==="fillOutlinePattern"&&W?cl(Dt,y,ee,je,vt):so(Dt,vt)}else _e=et.indexBuffer,we=et.segments,Se=W?Lr(Dt,y,ee,je):br(Dt);at.draw(y.context,ie,_,y.stencilModeForClipping($e),k,Mr.disabled,Se,nt,f.id,et.layoutVertexBuffer,_e,we,f.paint,y.transform.zoom,Pe)}}function Eu(y,s,f,v,_,k,D){const $=y.context,V=$.gl,W=f.paint.get("fill-extrusion-pattern"),ee=W.constantOr(1),ie=f.getCrossfadeParameters(),fe=f.paint.get("fill-extrusion-opacity");for(const Se of v){const _e=s.getTile(Se),we=_e.getBucket(f);if(!we)continue;const $e=y.style.terrain&&y.style.terrain.getTerrainData(Se),je=we.programConfigurations.get(f.id),et=y.useProgram(ee?"fillExtrusionPattern":"fillExtrusion",je);ee&&(y.context.activeTexture.set(V.TEXTURE0),_e.imageAtlasTexture.bind(V.LINEAR,V.CLAMP_TO_EDGE),je.updatePaintBuffers(ie));const Pe=W.constantOr(null);if(Pe&&_e.imageAtlas){const yt=_e.imageAtlas,Dt=yt.patternPositions[Pe.to.toString()],vt=yt.patternPositions[Pe.from.toString()];Dt&&vt&&je.setConstantPatternPositions(Dt,vt)}const at=y.translatePosMatrix(Se.posMatrix,_e,f.paint.get("fill-extrusion-translate"),f.paint.get("fill-extrusion-translate-anchor")),nt=f.paint.get("fill-extrusion-vertical-gradient"),gt=ee?xr(at,y,nt,fe,Se,ie,_e):Yn(at,y,nt,fe);et.draw($,$.gl.TRIANGLES,_,k,D,Mr.backCCW,gt,$e,f.id,we.layoutVertexBuffer,we.indexBuffer,we.segments,f.paint,y.transform.zoom,je,y.style.terrain&&we.centroidVertexBuffer)}}function Ff(y,s,f,v,_,k,D){const $=y.context,V=$.gl,W=f.fbo;if(!W)return;const ee=y.useProgram("hillshade"),ie=y.style.terrain&&y.style.terrain.getTerrainData(s);$.activeTexture.set(V.TEXTURE0),V.bindTexture(V.TEXTURE_2D,W.colorAttachment.get()),ee.draw($,V.TRIANGLES,_,k,D,Mr.disabled,((fe,Se,_e,we)=>{const $e=_e.paint.get("hillshade-shadow-color"),je=_e.paint.get("hillshade-highlight-color"),et=_e.paint.get("hillshade-accent-color");let Pe=_e.paint.get("hillshade-illumination-direction")*(Math.PI/180);_e.paint.get("hillshade-illumination-anchor")==="viewport"&&(Pe-=fe.transform.angle);const at=!fe.options.moving;return{u_matrix:we?we.posMatrix:fe.transform.calculatePosMatrix(Se.tileID.toUnwrapped(),at),u_image:0,u_latrange:ki(0,Se.tileID),u_light:[_e.paint.get("hillshade-exaggeration"),Pe],u_shadow:$e,u_highlight:je,u_accent:et}})(y,f,v,ie?s:null),ie,v.id,y.rasterBoundsBuffer,y.quadTriangleIndexBuffer,y.rasterBoundsSegments)}function Im(y,s,f,v,_,k){const D=y.context,$=D.gl,V=s.dem;if(V&&V.data){const W=V.dim,ee=V.stride,ie=V.getPixels();if(D.activeTexture.set($.TEXTURE1),D.pixelStoreUnpackPremultiplyAlpha.set(!1),s.demTexture=s.demTexture||y.getTileTexture(ee),s.demTexture){const Se=s.demTexture;Se.update(ie,{premultiply:!1}),Se.bind($.NEAREST,$.CLAMP_TO_EDGE)}else s.demTexture=new A(D,ie,$.RGBA,{premultiply:!1}),s.demTexture.bind($.NEAREST,$.CLAMP_TO_EDGE);D.activeTexture.set($.TEXTURE0);let fe=s.fbo;if(!fe){const Se=new A(D,{width:W,height:W,data:null},$.RGBA);Se.bind($.LINEAR,$.CLAMP_TO_EDGE),fe=s.fbo=D.createFramebuffer(W,W,!0),fe.colorAttachment.set(Se.texture)}D.bindFramebuffer.set(fe.framebuffer),D.viewport.set([0,0,W,W]),y.useProgram("hillshadePrepare").draw(D,$.TRIANGLES,v,_,k,Mr.disabled,((Se,_e)=>{const we=_e.stride,$e=o.create();return o.ortho($e,0,o.EXTENT,-o.EXTENT,0,0,1),o.translate($e,$e,[0,-o.EXTENT,0]),{u_matrix:$e,u_image:1,u_dimension:[we,we],u_zoom:Se.overscaledZ,u_unpack:_e.getUnpackVector()}})(s.tileID,V),null,f.id,y.rasterBoundsBuffer,y.quadTriangleIndexBuffer,y.rasterBoundsSegments),s.needsHillshadePrepare=!1}}function Vc(y,s,f,v,_,k){const D=v.paint.get("raster-fade-duration");if(!k&&D>0){const $=o.exported.now(),V=($-y.timeAdded)/D,W=s?($-s.timeAdded)/D:-1,ee=f.getSource(),ie=_.coveringZoomLevel({tileSize:ee.tileSize,roundZoom:ee.roundZoom}),fe=!s||Math.abs(s.tileID.overscaledZ-ie)>Math.abs(y.tileID.overscaledZ-ie),Se=fe&&y.refreshedUponExpiration?1:o.clamp(fe?V:1-W,0,1);return y.refreshedUponExpiration&&V>=1&&(y.refreshedUponExpiration=!1),s?{opacity:1,mix:1-Se}:{opacity:Se,mix:0}}return{opacity:1,mix:0}}const Uc=new o.Color(1,0,0,1),zo=new o.Color(0,1,0,1),Mm=new o.Color(0,0,1,1),$f=new o.Color(1,0,1,1),Rm=new o.Color(0,1,1,1);function ws(y,s,f,v){ml(y,0,s+f/2,y.transform.width,f,v)}function ku(y,s,f,v){ml(y,s-f/2,0,f,y.transform.height,v)}function ml(y,s,f,v,_,k){const D=y.context,$=D.gl;$.enable($.SCISSOR_TEST),$.scissor(s*y.pixelRatio,f*y.pixelRatio,v*y.pixelRatio,_*y.pixelRatio),D.clear({color:k}),$.disable($.SCISSOR_TEST)}function k1(y,s,f){const v=y.context,_=v.gl,k=f.posMatrix,D=y.useProgram("debug"),$=Xn.disabled,V=wr.disabled,W=y.colorModeForRenderPass(),ee="$debug",ie=y.style.terrain&&y.style.terrain.getTerrainData(f);v.activeTexture.set(_.TEXTURE0),y.emptyTexture.bind(_.LINEAR,_.CLAMP_TO_EDGE);const fe=s.getTileByID(f.key).latestRawTileData,Se=Math.floor((fe&&fe.byteLength||0)/1024),_e=s.getTile(f).tileSize,we=512/Math.min(_e,512)*(f.overscaledZ/y.transform.zoom)*.5;let $e=f.canonical.toString();f.overscaledZ!==f.canonical.z&&($e+=` => ${f.overscaledZ}`),function(je,et){je.initDebugOverlayCanvas();const Pe=je.debugOverlayCanvas,at=je.context.gl,nt=je.debugOverlayCanvas.getContext("2d");nt.clearRect(0,0,Pe.width,Pe.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(Pe),je.debugOverlayTexture.bind(at.LINEAR,at.CLAMP_TO_EDGE)}(y,`${$e} ${Se}kB`),D.draw(v,_.TRIANGLES,$,V,Er.alphaBlended,Mr.disabled,zn(k,o.Color.transparent,we),null,ee,y.debugBuffer,y.quadTriangleIndexBuffer,y.debugSegments),D.draw(v,_.LINE_STRIP,$,V,W,Mr.disabled,zn(k,o.Color.red),ie,ee,y.debugBuffer,y.tileBorderIndexBuffer,y.debugSegments)}function jc(y,s,f){const v=y.context,_=v.gl,k=y.colorModeForRenderPass(),D=new Xn(_.LEQUAL,Xn.ReadWrite,y.depthRangeFor3D),$=y.useProgram("terrain"),V=s.getTerrainMesh(),W=s.getTerrainData(f.tileID);v.bindFramebuffer.set(null),v.viewport.set([0,0,y.width,y.height]),v.activeTexture.set(_.TEXTURE0),_.bindTexture(_.TEXTURE_2D,s.getRTTFramebuffer().colorAttachment.get());const ee=y.transform.calculatePosMatrix(f.tileID.toUnwrapped());$.draw(v,_.TRIANGLES,D,wr.disabled,k,Mr.backCCW,{u_matrix:ee,u_texture:0},W,"terrain",V.vertexBuffer,V.indexBuffer,V.segments)}function Am(y,s,f,v){const _=y.context,k=f.tileSize*s.qualityFactor;f.textures[v]||(f.textures[v]=y.getTileTexture(k)||new A(_,{width:k,height:k,data:null},_.gl.RGBA),f.textures[v].bind(_.gl.LINEAR,_.gl.CLAMP_TO_EDGE),v===0&&s.sourceCache.renderHistory.unshift(f.tileID.key));const D=s.getRTTFramebuffer();D.colorAttachment.set(f.textures[v].texture),_.bindFramebuffer.set(D.framebuffer),_.viewport.set([0,0,k,k])}class Om{constructor(s){this._coordsDescendingInv={},this._coordsDescendingInvStr={},this.painter=s,this._renderToTexture={background:!0,fill:!0,line:!0,raster:!0},this._coordsDescendingInv={},this._coordsDescendingInvStr={},this._stacks=[],this._prevType=null,this._rerender={},this._renderableTiles=s.style.terrain.sourceCache.getRenderableTiles(),this._init()}_init(){const s=this.painter.style,f=s.terrain;for(const v in s.sourceCaches){this._coordsDescendingInv[v]={};const _=s.sourceCaches[v].getVisibleCoordinates();for(const k of _){const D=f.sourceCache.getTerrainCoords(k);for(const $ in D)this._coordsDescendingInv[v][$]||(this._coordsDescendingInv[v][$]=[]),this._coordsDescendingInv[v][$].push(D[$])}}for(const v of s._order){const _=s._layers[v],k=_.source;if(this._renderToTexture[_.type]&&!this._coordsDescendingInvStr[k]){this._coordsDescendingInvStr[k]={};for(const D in this._coordsDescendingInv[k])this._coordsDescendingInvStr[k][D]=this._coordsDescendingInv[k][D].map($=>$.key).sort().join()}}return this._renderableTiles.forEach(v=>{for(const _ in this._coordsDescendingInvStr){const k=this._coordsDescendingInvStr[_][v.tileID.key];k&&k!==v.textureCoords[_]&&v.clearTextures(this.painter),f.needsRerender(_,v.tileID)&&v.clearTextures(this.painter)}this._rerender[v.tileID.key]=!v.textures.length}),f.clearRerenderCache(),f.sourceCache.removeOutdated(this.painter),this}renderLayer(s){const f=s.type,v=this.painter,_=v.style._order,k=v.currentLayer,D=k+1===_.length;if(this._renderToTexture[f]&&(this._prevType&&this._renderToTexture[this._prevType]||this._stacks.push([]),this._prevType=f,this._stacks[this._stacks.length-1].push(_[k]),!D))return!0;if(this._renderToTexture[this._prevType]||f==="hillshade"||this._renderToTexture[f]&&D){this._prevType=f;const $=this._stacks.length-1,V=this._stacks[$]||[];for(const W of this._renderableTiles){if(Am(v,v.style.terrain,W,$),this._rerender[W.tileID.key]){v.context.clear({color:o.Color.transparent});for(let ee=0;eeV.style.terrain.getElevation(je,vt,rn):null)}}}(v,y,f,s,f.layout.get("text-rotation-alignment"),f.layout.get("text-pitch-alignment"),_),f.paint.get("icon-opacity").constantOr(1)!==0&&Bc(y,s,f,v,!1,f.paint.get("icon-translate"),f.paint.get("icon-translate-anchor"),f.layout.get("icon-rotation-alignment"),f.layout.get("icon-pitch-alignment"),f.layout.get("icon-keep-upright"),k,D),f.paint.get("text-opacity").constantOr(1)!==0&&Bc(y,s,f,v,!0,f.paint.get("text-translate"),f.paint.get("text-translate-anchor"),f.layout.get("text-rotation-alignment"),f.layout.get("text-pitch-alignment"),f.layout.get("text-keep-upright"),k,D),s.map.showCollisionBoxes&&(pl(y,s,f,v,f.paint.get("text-translate"),f.paint.get("text-translate-anchor"),!0),pl(y,s,f,v,f.paint.get("icon-translate"),f.paint.get("icon-translate-anchor"),!1))},circle:function(y,s,f,v){if(y.renderPass!=="translucent")return;const _=f.paint.get("circle-opacity"),k=f.paint.get("circle-stroke-width"),D=f.paint.get("circle-stroke-opacity"),$=!f.layout.get("circle-sort-key").isConstant();if(_.constantOr(1)===0&&(k.constantOr(1)===0||D.constantOr(1)===0))return;const V=y.context,W=V.gl,ee=y.depthModeForSublayer(0,Xn.ReadOnly),ie=wr.disabled,fe=y.colorModeForRenderPass(),Se=[];for(let _e=0;_e_e.sortKey-we.sortKey);for(const _e of Se){const{programConfiguration:we,program:$e,layoutVertexBuffer:je,indexBuffer:et,uniformValues:Pe,terrainData:at}=_e.state;$e.draw(V,W.TRIANGLES,ee,ie,fe,Mr.disabled,Pe,at,f.id,je,et,_e.segments,f.paint,y.transform.zoom,we)}},heatmap:function(y,s,f,v){if(f.paint.get("heatmap-opacity")!==0)if(y.renderPass==="offscreen"){const _=y.context,k=_.gl,D=wr.disabled,$=new Er([k.ONE,k.ONE],o.Color.transparent,[!0,!0,!0,!0]);(function(V,W,ee){const ie=V.gl;V.activeTexture.set(ie.TEXTURE1),V.viewport.set([0,0,W.width/4,W.height/4]);let fe=ee.heatmapFbo;if(fe)ie.bindTexture(ie.TEXTURE_2D,fe.colorAttachment.get()),V.bindFramebuffer.set(fe.framebuffer);else{const Se=ie.createTexture();ie.bindTexture(ie.TEXTURE_2D,Se),ie.texParameteri(ie.TEXTURE_2D,ie.TEXTURE_WRAP_S,ie.CLAMP_TO_EDGE),ie.texParameteri(ie.TEXTURE_2D,ie.TEXTURE_WRAP_T,ie.CLAMP_TO_EDGE),ie.texParameteri(ie.TEXTURE_2D,ie.TEXTURE_MIN_FILTER,ie.LINEAR),ie.texParameteri(ie.TEXTURE_2D,ie.TEXTURE_MAG_FILTER,ie.LINEAR),fe=ee.heatmapFbo=V.createFramebuffer(W.width/4,W.height/4,!1),function(_e,we,$e,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($e)}(V,W,Se,fe)}})(_,y,f),_.clear({color:o.Color.transparent});for(let V=0;V{const _e=o.create();o.ortho(_e,0,ee.width,ee.height,0,0,1);const we=ee.context.gl;return{u_matrix:_e,u_world:[we.drawingBufferWidth,we.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:ie.paint.get("heatmap-opacity")}})(_,k),null,k.id,_.viewportBuffer,_.quadTriangleIndexBuffer,_.viewportSegments,k.paint,_.transform.zoom)}(y,f))},line:function(y,s,f,v){if(y.renderPass!=="translucent")return;const _=f.paint.get("line-opacity"),k=f.paint.get("line-width");if(_.constantOr(1)===0||k.constantOr(1)===0)return;const D=y.depthModeForSublayer(0,Xn.ReadOnly),$=y.colorModeForRenderPass(),V=f.paint.get("line-dasharray"),W=f.paint.get("line-pattern"),ee=W.constantOr(1),ie=f.paint.get("line-gradient"),fe=f.getCrossfadeParameters(),Se=ee?"linePattern":V?"lineSDF":ie?"lineGradient":"line",_e=y.context,we=_e.gl;let $e=!0;for(const je of v){const et=s.getTile(je);if(ee&&!et.patternsLoaded())continue;const Pe=et.getBucket(f);if(!Pe)continue;const at=Pe.programConfigurations.get(f.id),nt=y.context.program.get(),gt=y.useProgram(Se,at),yt=$e||gt.program!==nt,Dt=y.style.terrain&&y.style.terrain.getTerrainData(je),vt=W.constantOr(null);if(vt&&et.imageAtlas){const ln=et.imageAtlas,Dn=ln.patternPositions[vt.to.toString()],Vn=ln.patternPositions[vt.from.toString()];Dn&&Vn&&at.setConstantPatternPositions(Dn,Vn)}const rn=Dt?je:null,qt=ee?_s(y,et,f,fe,rn):V?ka(y,et,f,V,fe,rn):ie?Eo(y,et,f,Pe.lineClipsArray.length,rn):Ga(y,et,f,rn);if(ee)_e.activeTexture.set(we.TEXTURE0),et.imageAtlasTexture.bind(we.LINEAR,we.CLAMP_TO_EDGE),at.updatePaintBuffers(fe);else if(V&&(yt||y.lineAtlas.dirty))_e.activeTexture.set(we.TEXTURE0),y.lineAtlas.bind(_e);else if(ie){const ln=Pe.gradients[f.id];let Dn=ln.texture;if(f.gradientVersion!==ln.version){let Vn=256;if(f.stepInterpolant){const bn=s.getSource().maxzoom,cr=je.canonical.z===bn?Math.ceil(1<256&&this.clearStencil(),v.setColorMode(Er.disabled),v.setDepthMode(Xn.disabled);const k=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const D of f){const $=this._tileClippingMaskIDs[D.key]=this.nextStencilID++,V=this.style.terrain&&this.style.terrain.getTerrainData(D);k.draw(v,_.TRIANGLES,Xn.disabled,new wr({func:_.ALWAYS,mask:0},$,255,_.KEEP,_.KEEP,_.REPLACE),Er.disabled,Mr.disabled,Zn(D.posMatrix),V,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const s=this.nextStencilID++,f=this.context.gl;return new wr({func:f.NOTEQUAL,mask:255},s,255,f.KEEP,f.KEEP,f.REPLACE)}stencilModeForClipping(s){const f=this.context.gl;return new wr({func:f.EQUAL,mask:255},this._tileClippingMaskIDs[s.key],0,f.KEEP,f.KEEP,f.REPLACE)}stencilConfigForOverlap(s){const f=this.context.gl,v=s.sort((D,$)=>$.overscaledZ-D.overscaledZ),_=v[v.length-1].overscaledZ,k=v[0].overscaledZ-_+1;if(k>1){this.currentStencilSource=void 0,this.nextStencilID+k>256&&this.clearStencil();const D={};for(let $=0;$=0;this.currentLayer--){const W=this.style._layers[v[this.currentLayer]],ee=_[W.source],ie=D[W.source];this._renderTileClippingMasks(W,ie),this.renderLayer(this,ee,W,ie)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer{ie.source&&!ie.isHidden(this.transform.zoom)&&(ie.source!==(ee&&ee.id)&&(ee=this.style.sourceCaches[ie.source]),(!W||W.getSource().maxzoom0?f.pop():null}isPatternMissing(s){if(!s)return!1;if(!s.from||!s.to)return!0;const f=this.imageManager.getPattern(s.from.toString()),v=this.imageManager.getPattern(s.to.toString());return!f||!v}useProgram(s,f){this.cache=this.cache||{};const v=s+(f?f.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.terrain?"/terrain":"");return this.cache[v]||(this.cache[v]=new jn(this.context,s,Sn[s],f,kf[s],this._showOverdrawInspector,this.style.terrain)),this.cache[v]}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 s=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(s.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 Kc{constructor(s,f){this.points=s,this.planes=f}static fromInvProjectionMatrix(s,f,v){const _=Math.pow(2,v),k=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map($=>{const V=1/($=o.transformMat4([],$,s))[3]/f*_;return o.mul$1($,$,[V,V,1/$[3],V])}),D=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map($=>{const V=o.sub([],k[$[0]],k[$[1]]),W=o.sub([],k[$[2]],k[$[1]]),ee=o.normalize([],o.cross([],V,W)),ie=-o.dot(ee,k[$[1]]);return ee.concat(ie)});return new Kc(k,D)}}class Pu{constructor(s,f){this.min=s,this.max=f,this.center=o.scale$1([],o.add([],this.min,this.max),.5)}quadrant(s){const f=[s%2==0,s<2],v=o.clone$2(this.min),_=o.clone$2(this.max);for(let k=0;k=0&&D++;if(D===0)return 0;D!==f.length&&(v=!1)}if(v)return 2;for(let _=0;_<3;_++){let k=Number.MAX_VALUE,D=-Number.MAX_VALUE;for(let $=0;$this.max[_]-this.min[_])return 0}return 1}}class vl{constructor(s=0,f=0,v=0,_=0){if(isNaN(s)||s<0||isNaN(f)||f<0||isNaN(v)||v<0||isNaN(_)||_<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=s,this.bottom=f,this.left=v,this.right=_}interpolate(s,f,v){return f.top!=null&&s.top!=null&&(this.top=o.number(s.top,f.top,v)),f.bottom!=null&&s.bottom!=null&&(this.bottom=o.number(s.bottom,f.bottom,v)),f.left!=null&&s.left!=null&&(this.left=o.number(s.left,f.left,v)),f.right!=null&&s.right!=null&&(this.right=o.number(s.right,f.right,v)),this}getCenter(s,f){const v=o.clamp((this.left+s-this.right)/2,0,s),_=o.clamp((this.top+f-this.bottom)/2,0,f);return new o.pointGeometry(v,_)}equals(s){return this.top===s.top&&this.bottom===s.bottom&&this.left===s.left&&this.right===s.right}clone(){return new vl(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}class Iu{constructor(s,f,v,_,k){this.tileSize=512,this.maxValidLatitude=85.051129,this.freezeElevation=!1,this._renderWorldCopies=k===void 0||!!k,this._minZoom=s||0,this._maxZoom=f||22,this._minPitch=v==null?0:v,this._maxPitch=_==null?60:_,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 vl,this._posMatrixCache={},this._alignedPosMatrixCache={}}clone(){const s=new Iu(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return s.tileSize=this.tileSize,s.latRange=this.latRange,s.width=this.width,s.height=this.height,s._center=this._center,s._elevation=this._elevation,s.zoom=this.zoom,s.angle=this.angle,s._fov=this._fov,s._pitch=this._pitch,s._unmodified=this._unmodified,s._edgeInsets=this._edgeInsets.clone(),s._calcMatrices(),s}get minZoom(){return this._minZoom}set minZoom(s){this._minZoom!==s&&(this._minZoom=s,this.zoom=Math.max(this.zoom,s))}get maxZoom(){return this._maxZoom}set maxZoom(s){this._maxZoom!==s&&(this._maxZoom=s,this.zoom=Math.min(this.zoom,s))}get minPitch(){return this._minPitch}set minPitch(s){this._minPitch!==s&&(this._minPitch=s,this.pitch=Math.max(this.pitch,s))}get maxPitch(){return this._maxPitch}set maxPitch(s){this._maxPitch!==s&&(this._maxPitch=s,this.pitch=Math.min(this.pitch,s))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(s){s===void 0?s=!0:s===null&&(s=!1),this._renderWorldCopies=s}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(s){const f=-o.wrap(s,-180,180)*Math.PI/180;var v;this.angle!==f&&(this._unmodified=!1,this.angle=f,this._calcMatrices(),this.rotationMatrix=(v=new o.ARRAY_TYPE(4),o.ARRAY_TYPE!=Float32Array&&(v[1]=0,v[2]=0),v[0]=1,v[3]=1,v),function(_,k,D){var $=k[0],V=k[1],W=k[2],ee=k[3],ie=Math.sin(D),fe=Math.cos(D);_[0]=$*fe+W*ie,_[1]=V*fe+ee*ie,_[2]=$*-ie+W*fe,_[3]=V*-ie+ee*fe}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(s){const f=o.clamp(s,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==f&&(this._unmodified=!1,this._pitch=f,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(s){s=Math.max(.01,Math.min(60,s)),this._fov!==s&&(this._unmodified=!1,this._fov=s/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(s){const f=Math.min(Math.max(s,this.minZoom),this.maxZoom);this._zoom!==f&&(this._unmodified=!1,this._zoom=f,this.scale=this.zoomScale(f),this.tileZoom=Math.floor(f),this.zoomFraction=f-this.tileZoom,this._constrain(),this._calcMatrices())}get center(){return this._center}set center(s){s.lat===this._center.lat&&s.lng===this._center.lng||(this._unmodified=!1,this._center=s,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(s){s!==this._elevation&&(this._elevation=s,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(s){this._edgeInsets.equals(s)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,s,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(s){return this._edgeInsets.equals(s)}interpolatePadding(s,f,v){this._unmodified=!1,this._edgeInsets.interpolate(s,f,v),this._constrain(),this._calcMatrices()}coveringZoomLevel(s){const f=(s.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/s.tileSize));return Math.max(0,f)}getVisibleUnwrappedCoordinates(s){const f=[new o.UnwrappedTileID(0,s)];if(this._renderWorldCopies){const v=this.pointCoordinate(new o.pointGeometry(0,0)),_=this.pointCoordinate(new o.pointGeometry(this.width,0)),k=this.pointCoordinate(new o.pointGeometry(this.width,this.height)),D=this.pointCoordinate(new o.pointGeometry(0,this.height)),$=Math.floor(Math.min(v.x,_.x,k.x,D.x)),V=Math.floor(Math.max(v.x,_.x,k.x,D.x)),W=1;for(let ee=$-W;ee<=V+W;ee++)ee!==0&&f.push(new o.UnwrappedTileID(ee,s))}return f}coveringTiles(s){var f,v;let _=this.coveringZoomLevel(s);const k=_;if(s.minzoom!==void 0&&_s.maxzoom&&(_=s.maxzoom);const D=this.pointCoordinate(this.getCameraPoint()),$=o.MercatorCoordinate.fromLngLat(this.center),V=Math.pow(2,_),W=[V*D.x,V*D.y,0],ee=[V*$.x,V*$.y,0],ie=Kc.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,_);let fe=s.minzoom||0;!s.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(fe=_);const Se=s.terrain?2/Math.min(this.tileSize,s.tileSize)*this.tileSize:3,_e=Pe=>({aabb:new Pu([Pe*V,0,0],[(Pe+1)*V,V,0]),zoom:0,x:0,y:0,wrap:Pe,fullyVisible:!1}),we=[],$e=[],je=_,et=s.reparseOverscaled?k:_;if(this._renderWorldCopies)for(let Pe=1;Pe<=3;Pe++)we.push(_e(-Pe)),we.push(_e(Pe));for(we.push(_e(0));we.length>0;){const Pe=we.pop(),at=Pe.x,nt=Pe.y;let gt=Pe.fullyVisible;if(!gt){const ln=Pe.aabb.intersects(ie);if(ln===0)continue;gt=ln===2}const yt=s.terrain?W:ee,Dt=Pe.aabb.distanceX(yt),vt=Pe.aabb.distanceY(yt),rn=Math.max(Math.abs(Dt),Math.abs(vt)),qt=Se+(1<qt&&Pe.zoom>=fe){const ln=je-Pe.zoom,Dn=W[0]-.5-(at<>1),bn=Pe.zoom+1;let cr=Pe.aabb.quadrant(ln);if(s.terrain){const dr=new o.OverscaledTileID(bn,Pe.wrap,bn,Dn,Vn),Qn=s.terrain.getMinMaxElevation(dr),er=(f=Qn.minElevation)!==null&&f!==void 0?f:this.elevation,pr=(v=Qn.maxElevation)!==null&&v!==void 0?v:this.elevation;cr=new Pu([cr.min[0],cr.min[1],er],[cr.max[0],cr.max[1],pr])}we.push({aabb:cr,zoom:bn,x:Dn,y:Vn,wrap:Pe.wrap,fullyVisible:gt})}}return $e.sort((Pe,at)=>Pe.distanceSq-at.distanceSq).map(Pe=>Pe.tileID)}resize(s,f){this.width=s,this.height=f,this.pixelsToGLUnits=[2/s,-2/f],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(s){return Math.pow(2,s)}scaleZoom(s){return Math.log(s)/Math.LN2}project(s){const f=o.clamp(s.lat,-this.maxValidLatitude,this.maxValidLatitude);return new o.pointGeometry(o.mercatorXfromLng(s.lng)*this.worldSize,o.mercatorYfromLat(f)*this.worldSize)}unproject(s){return new o.MercatorCoordinate(s.x/this.worldSize,s.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}updateElevation(s){this.freezeElevation||(this.elevation=s?this.getElevation(this._center,s):0)}getElevation(s,f){const v=o.MercatorCoordinate.fromLngLat(s),_=(1<D&&(_=D-_e)}if(this.lngRange){const Se=($+V)/2,_e=o.wrap(ie.x,Se-this.worldSize/2,Se+this.worldSize/2),we=W.x/2;_e-we<$&&(v=$+we),_e+we>V&&(v=V-we)}v===void 0&&_===void 0||(this.center=this.unproject(new o.pointGeometry(v!==void 0?v:ie.x,_!==void 0?_:ie.y)).wrap()),this._unmodified=ee,this._constraining=!1}_calcMatrices(){if(!this.height)return;const s=this.centerOffset,f=this.point.x,v=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=o.mercatorZfromAltitude(1,this.center.lat)*this.worldSize;let _=o.identity(new Float64Array(16));o.scale(_,_,[this.width/2,-this.height/2,1]),o.translate(_,_,[1,-1,0]),this.labelPlaneMatrix=_,_=o.identity(new Float64Array(16)),o.scale(_,_,[1,-1,1]),o.translate(_,_,[-1,-1,0]),o.scale(_,_,[2/this.width,2/this.height,1]),this.glCoordMatrix=_,this.cameraToSeaLevelDistance=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch);const k=Math.PI/2+this._pitch,D=this._fov*(.5+s.y/this.height),$=Math.sin(D)*this.cameraToSeaLevelDistance/Math.sin(o.clamp(Math.PI-k-D,.01,Math.PI-.01)),V=this.getHorizon(),W=2*Math.atan(V/this.cameraToCenterDistance)*(.5+s.y/(2*V)),ee=Math.sin(W)*this.cameraToSeaLevelDistance/Math.sin(o.clamp(Math.PI-k-W,.01,Math.PI-.01)),ie=Math.cos(Math.PI/2-this._pitch)*$+this.cameraToSeaLevelDistance,fe=Math.cos(Math.PI/2-this._pitch)*ee+this.cameraToSeaLevelDistance,Se=1.01*Math.min(ie,fe),_e=this.height/50;_=new Float64Array(16),o.perspective(_,this._fov,this.width/this.height,_e,Se),_[8]=2*-s.x/this.width,_[9]=2*s.y/this.height,o.scale(_,_,[1,-1,1]),o.translate(_,_,[0,0,-this.cameraToCenterDistance]),o.rotateX(_,_,this._pitch),o.rotateZ(_,_,this.angle),o.translate(_,_,[-f,-v,0]),this.mercatorMatrix=o.scale([],_,[this.worldSize,this.worldSize,this.worldSize]),o.scale(_,_,[1,1,this._pixelPerMeter]),this.pixelMatrix=o.multiply(new Float64Array(16),this.labelPlaneMatrix,_),o.translate(_,_,[0,0,-this.elevation]),this.projMatrix=_,this.invProjMatrix=o.invert([],_),this.pixelMatrix3D=o.multiply(new Float64Array(16),this.labelPlaneMatrix,_);const we=this.width%2/2,$e=this.height%2/2,je=Math.cos(this.angle),et=Math.sin(this.angle),Pe=f-Math.round(f)+je*we+et*$e,at=v-Math.round(v)+je*$e+et*we,nt=new Float64Array(_);if(o.translate(nt,nt,[Pe>.5?Pe-1:Pe,at>.5?at-1:at,0]),this.alignedProjMatrix=nt,_=o.invert(new Float64Array(16),this.pixelMatrix),!_)throw new Error("failed to invert matrix");this.pixelMatrixInverse=_,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const s=this.pointCoordinate(new o.pointGeometry(0,0)),f=[s.x*this.worldSize,s.y*this.worldSize,0,1];return o.transformMat4(f,f,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const s=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new o.pointGeometry(0,s))}getCameraQueryGeometry(s){const f=this.getCameraPoint();if(s.length===1)return[s[0],f];{let v=f.x,_=f.y,k=f.x,D=f.y;for(const $ of s)v=Math.min(v,$.x),_=Math.min(_,$.y),k=Math.max(k,$.x),D=Math.max(D,$.y);return[new o.pointGeometry(v,_),new o.pointGeometry(k,_),new o.pointGeometry(k,D),new o.pointGeometry(v,D),new o.pointGeometry(v,_)]}}}class Nm{constructor(s){this._hashName=s&&encodeURIComponent(s),o.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=function(f,v){let _=!1,k=null;const D=()=>{k=null,_&&(f(),k=setTimeout(D,300),_=!1)};return()=>(_=!0,k||D(),k)}(this._updateHashUnthrottled.bind(this))}addTo(s){return this._map=s,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(s){const f=this._map.getCenter(),v=Math.round(100*this._map.getZoom())/100,_=Math.ceil((v*Math.LN2+Math.log(512/360/.5))/Math.LN10),k=Math.pow(10,_),D=Math.round(f.lng*k)/k,$=Math.round(f.lat*k)/k,V=this._map.getBearing(),W=this._map.getPitch();let ee="";if(ee+=s?`/${D}/${$}/${v}`:`${v}/${$}/${D}`,(V||W)&&(ee+="/"+Math.round(10*V)/10),W&&(ee+=`/${Math.round(W)}`),this._hashName){const ie=this._hashName;let fe=!1;const Se=window.location.hash.slice(1).split("&").map(_e=>{const we=_e.split("=")[0];return we===ie?(fe=!0,`${we}=${ee}`):_e}).filter(_e=>_e);return fe||Se.push(`${ie}=${ee}`),`#${Se.join("&")}`}return`#${ee}`}_getCurrentHash(){const s=window.location.hash.replace("#","");if(this._hashName){let f;return s.split("&").map(v=>v.split("=")).forEach(v=>{v[0]===this._hashName&&(f=v)}),(f&&f[1]||"").split("/")}return s.split("/")}_onHashChange(){const s=this._getCurrentHash();if(s.length>=3&&!s.some(f=>isNaN(f))){const f=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(s[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+s[2],+s[1]],zoom:+s[0],bearing:f,pitch:+(s[4]||0)}),!0}return!1}_updateHashUnthrottled(){const s=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,s)}catch{}}}const Mu={linearity:.3,easing:o.bezier(0,0,.3,1)},Dm=o.extend({deceleration:2500,maxSpeed:1400},Mu),Lm=o.extend({deceleration:20,maxSpeed:1400},Mu),zm=o.extend({deceleration:1e3,maxSpeed:360},Mu),gl=o.extend({deceleration:1e3,maxSpeed:90},Mu);class Fm{constructor(s){this._map=s,this.clear()}clear(){this._inertiaBuffer=[]}record(s){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:o.exported.now(),settings:s})}_drainInertiaBuffer(){const s=this._inertiaBuffer,f=o.exported.now();for(;s.length>0&&f-s[0].time>160;)s.shift()}_onMoveEnd(s){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const f={zoom:0,bearing:0,pitch:0,pan:new o.pointGeometry(0,0),pinchAround:void 0,around:void 0};for(const{settings:k}of this._inertiaBuffer)f.zoom+=k.zoomDelta||0,f.bearing+=k.bearingDelta||0,f.pitch+=k.pitchDelta||0,k.panDelta&&f.pan._add(k.panDelta),k.around&&(f.around=k.around),k.pinchAround&&(f.pinchAround=k.pinchAround);const v=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,_={};if(f.pan.mag()){const k=Au(f.pan.mag(),v,o.extend({},Dm,s||{}));_.offset=f.pan.mult(k.amount/f.pan.mag()),_.center=this._map.transform.center,Ru(_,k)}if(f.zoom){const k=Au(f.zoom,v,Lm);_.zoom=this._map.transform.zoom+k.amount,Ru(_,k)}if(f.bearing){const k=Au(f.bearing,v,zm);_.bearing=this._map.transform.bearing+o.clamp(k.amount,-179,179),Ru(_,k)}if(f.pitch){const k=Au(f.pitch,v,gl);_.pitch=this._map.transform.pitch+k.amount,Ru(_,k)}if(_.zoom||_.bearing){const k=f.pinchAround===void 0?f.around:f.pinchAround;_.around=k?this._map.unproject(k):this._map.getCenter()}return this.clear(),o.extend(_,{noMoveStart:!0})}}function Ru(y,s){(!y.duration||y.durationf.unproject(V)),$=k.reduce((V,W,ee,ie)=>V.add(W.div(ie.length)),new o.pointGeometry(0,0));super(s,{points:k,point:$,lngLats:D,lngLat:f.unproject($),originalEvent:v}),this._defaultPrevented=!1}preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}}class co extends o.Event{constructor(s,f,v){super(s,{originalEvent:v}),this._defaultPrevented=!1}preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}}class T1{constructor(s,f){this._map=s,this._clickTolerance=f.clickTolerance}reset(){delete this._mousedownPos}wheel(s){return this._firePreventable(new co(s.type,this._map,s))}mousedown(s,f){return this._mousedownPos=f,this._firePreventable(new uo(s.type,this._map,s))}mouseup(s){this._map.fire(new uo(s.type,this._map,s))}click(s,f){this._mousedownPos&&this._mousedownPos.dist(f)>=this._clickTolerance||this._map.fire(new uo(s.type,this._map,s))}dblclick(s){return this._firePreventable(new uo(s.type,this._map,s))}mouseover(s){this._map.fire(new uo(s.type,this._map,s))}mouseout(s){this._map.fire(new uo(s.type,this._map,s))}touchstart(s){return this._firePreventable(new Ou(s.type,this._map,s))}touchmove(s){this._map.fire(new Ou(s.type,this._map,s))}touchend(s){this._map.fire(new Ou(s.type,this._map,s))}touchcancel(s){this._map.fire(new Ou(s.type,this._map,s))}_firePreventable(s){if(this._map.fire(s),s.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class qa{constructor(s){this._map=s}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(s){this._map.fire(new uo(s.type,this._map,s))}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(s){this._delayContextMenu?this._contextMenuEvent=s:this._ignoreContextMenu||this._map.fire(new uo(s.type,this._map,s)),this._map.listens("contextmenu")&&s.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class $m{constructor(s,f){this._map=s,this._el=s.getCanvasContainer(),this._container=s.getContainer(),this._clickTolerance=f.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(s,f){this.isEnabled()&&s.shiftKey&&s.button===0&&(w.disableDrag(),this._startPos=this._lastPos=f,this._active=!0)}mousemoveWindow(s,f){if(!this._active)return;const v=f;if(this._lastPos.equals(v)||!this._box&&v.dist(this._startPos)k.fitScreenCoordinates(v,_,this._map.getBearing(),{linear:!0})};this._fireEvent("boxzoomcancel",s)}keydown(s){this._active&&s.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",s))}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(s,f){return this._map.fire(new o.Event(s,{originalEvent:f}))}}function Pa(y,s){if(y.length!==s.length)throw new Error(`The number of touches and points are not equal - touches ${y.length}, points ${s.length}`);const f={};for(let v=0;vthis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=s.timeStamp),v.length===this.numTouches&&(this.centroid=function(_){const k=new o.pointGeometry(0,0);for(const D of _)k._add(D);return k.div(_.length)}(f),this.touches=Pa(v,f)))}touchmove(s,f,v){if(this.aborted||!this.centroid)return;const _=Pa(v,f);for(const k in this.touches){const D=this.touches[k],$=_[k];(!$||$.dist(D)>30)&&(this.aborted=!0)}}touchend(s,f,v){if((!this.centroid||s.timeStamp-this.startTime>500)&&(this.aborted=!0),v.length===0){const _=!this.aborted&&this.centroid;if(this.reset(),_)return _}}}class Vf{constructor(s){this.singleTap=new Nu(s),this.numTaps=s.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(s,f,v){this.singleTap.touchstart(s,f,v)}touchmove(s,f,v){this.singleTap.touchmove(s,f,v)}touchend(s,f,v){const _=this.singleTap.touchend(s,f,v);if(_){const k=s.timeStamp-this.lastTime<500,D=!this.lastTap||this.lastTap.dist(_)<30;if(k&&D||this.reset(),this.count++,this.lastTime=s.timeStamp,this.lastTap=_,this.count===this.numTaps)return this.reset(),_}}}class P1{constructor(){this._zoomIn=new Vf({numTouches:1,numTaps:2}),this._zoomOut=new Vf({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(s,f,v){this._zoomIn.touchstart(s,f,v),this._zoomOut.touchstart(s,f,v)}touchmove(s,f,v){this._zoomIn.touchmove(s,f,v),this._zoomOut.touchmove(s,f,v)}touchend(s,f,v){const _=this._zoomIn.touchend(s,f,v),k=this._zoomOut.touchend(s,f,v);return _?(this._active=!0,s.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:D=>D.easeTo({duration:300,zoom:D.getZoom()+1,around:D.unproject(_)},{originalEvent:s})}):k?(this._active=!0,s.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:D=>D.easeTo({duration:300,zoom:D.getZoom()-1,around:D.unproject(k)},{originalEvent:s})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}const I1={0:1,2:2};class Hc{constructor(s){this.reset(),this._clickTolerance=s.clickTolerance||1}reset(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton}_correctButton(s,f){return!1}_move(s,f){return{}}mousedown(s,f){if(this._lastPoint)return;const v=w.mouseButton(s);this._correctButton(s,v)&&(this._lastPoint=f,this._eventButton=v)}mousemoveWindow(s,f){const v=this._lastPoint;if(v){if(s.preventDefault(),function(_,k){const D=I1[k];return _.buttons===void 0||(_.buttons&D)!==D}(s,this._eventButton))this.reset();else if(this._moved||!(f.dist(v){this._cancelCooperativeMessage=!1},200)}touchstart(s,f,v){return this._calculateTransform(s,f,v)}touchmove(s,f,v){if(this._map._cooperativeGestures&&(this._minTouches===2&&v.length<2&&!this._cancelCooperativeMessage?this._map._onCooperativeGesture(s,!1,v.length):this._cancelCooperativeMessage||(this._cancelCooperativeMessage=!0)),this._active&&!(v.length0&&(this._active=!0);const _=Pa(v,f),k=new o.pointGeometry(0,0),D=new o.pointGeometry(0,0);let $=0;for(const W in _){const ee=_[W],ie=this._touches[W];ie&&(k._add(ee),D._add(ee.sub(ie)),$++,_[W]=ee)}if(this._touches=_,$Math.abs(y.x)}class Kf extends Cs{constructor(s){super(),this._map=s}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(s,f,v){super.touchstart(s,f,v),this._currentTouchCount=v.length}_start(s){this._lastPoints=s,jf(s[0].sub(s[1]))&&(this._valid=!1)}_move(s,f,v){if(this._map._cooperativeGestures&&this._currentTouchCount<3)return;const _=s[0].sub(this._lastPoints[0]),k=s[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(_,k,v.timeStamp),this._valid?(this._lastPoints=s,this._active=!0,{pitchDelta:(_.y+k.y)/2*-.5}):void 0}gestureBeginsVertically(s,f,v){if(this._valid!==void 0)return this._valid;const _=s.mag()>=2,k=f.mag()>=2;if(!_&&!k)return;if(!_||!k)return this._firstMove===void 0&&(this._firstMove=v),v-this._firstMove<100&&void 0;const D=s.y>0==f.y>0;return jf(s)&&jf(f)&&D}}const Vm={panStep:100,bearingStep:15,pitchStep:10};class Um{constructor(){const s=Vm;this._panStep=s.panStep,this._bearingStep=s.bearingStep,this._pitchStep=s.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(s){if(s.altKey||s.ctrlKey||s.metaKey)return;let f=0,v=0,_=0,k=0,D=0;switch(s.keyCode){case 61:case 107:case 171:case 187:f=1;break;case 189:case 109:case 173:f=-1;break;case 37:s.shiftKey?v=-1:(s.preventDefault(),k=-1);break;case 39:s.shiftKey?v=1:(s.preventDefault(),k=1);break;case 38:s.shiftKey?_=1:(s.preventDefault(),D=-1);break;case 40:s.shiftKey?_=-1:(s.preventDefault(),D=1);break;default:return}return this._rotationDisabled&&(v=0,_=0),{cameraAnimation:$=>{const V=$.getZoom();$.easeTo({duration:300,easeId:"keyboardHandler",easing:R1,zoom:f?Math.round(V)+f*(s.shiftKey?2:1):V,bearing:$.getBearing()+v*this._bearingStep,pitch:$.getPitch()+_*this._pitchStep,offset:[-k*this._panStep,-D*this._panStep],center:$.getCenter()},{originalEvent:s})}}}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 R1(y){return y*(2-y)}const jm=4.000244140625;class Hf{constructor(s,f){this._map=s,this._el=s.getCanvasContainer(),this._handler=f,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,o.bindAll(["_onTimeout"],this)}setZoomRate(s){this._defaultZoomRate=s}setWheelZoomRate(s){this._wheelZoomRate=s}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(s){this.isEnabled()||(this._enabled=!0,this._aroundCenter=s&&s.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}wheel(s){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!this._map._metaPress)return;s.preventDefault()}let f=s.deltaMode===WheelEvent.DOM_DELTA_LINE?40*s.deltaY:s.deltaY;const v=o.exported.now(),_=v-(this._lastWheelEventTime||0);this._lastWheelEventTime=v,f!==0&&f%jm==0?this._type="wheel":f!==0&&Math.abs(f)<4?this._type="trackpad":_>400?(this._type=null,this._lastValue=f,this._timeout=setTimeout(this._onTimeout,40,s)):this._type||(this._type=Math.abs(_*f)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,f+=this._lastValue)),s.shiftKey&&f&&(f/=4),this._type&&(this._lastWheelEvent=s,this._delta-=f,this._active||this._start(s)),s.preventDefault()}_onTimeout(s){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(s)}_start(s){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 f=w.mousePos(this._el,s);this._around=o.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(f)),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 s=this._map.transform;if(this._delta!==0){const $=this._type==="wheel"&&Math.abs(this._delta)>jm?this._wheelZoomRate:this._defaultZoomRate;let V=2/(1+Math.exp(-Math.abs(this._delta*$)));this._delta<0&&V!==0&&(V=1/V);const W=typeof this._targetZoom=="number"?s.zoomScale(this._targetZoom):s.scale;this._targetZoom=Math.min(s.maxZoom,Math.max(s.minZoom,s.scaleZoom(W*V))),this._type==="wheel"&&(this._startZoom=s.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const f=typeof this._targetZoom=="number"?this._targetZoom:s.zoom,v=this._startZoom,_=this._easing;let k,D=!1;if(this._type==="wheel"&&v&&_){const $=Math.min((o.exported.now()-this._lastWheelEventTime)/200,1),V=_($);k=o.number(v,f,V),$<1?this._frameId||(this._frameId=!0):D=!0}else k=f,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:k-s.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(s){let f=o.ease;if(this._prevEase){const v=this._prevEase,_=(o.exported.now()-v.start)/v.duration,k=v.easing(_+.01)-v.easing(_),D=.27/Math.sqrt(k*k+1e-4)*.01,$=Math.sqrt(.0729-D*D);f=o.bezier(D,$,.25,1)}return this._prevEase={start:o.exported.now(),duration:s,easing:f},f}reset(){this._active=!1}}class Wf{constructor(s,f){this._clickZoom=s,this._tapZoom=f}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 Gf{constructor(){this.reset()}reset(){this._active=!1}dblclick(s,f){return s.preventDefault(),{cameraAnimation:v=>{v.easeTo({duration:300,zoom:v.getZoom()+(s.shiftKey?-1:1),around:v.unproject(f)},{originalEvent:s})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class qf{constructor(){this._tap=new Vf({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()}touchstart(s,f,v){this._swipePoint||(this._tapTime&&s.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?v.length>0&&(this._swipePoint=f[0],this._swipeTouch=v[0].identifier):this._tap.touchstart(s,f,v))}touchmove(s,f,v){if(this._tapTime){if(this._swipePoint){if(v[0].identifier!==this._swipeTouch)return;const _=f[0],k=_.y-this._swipePoint.y;return this._swipePoint=_,s.preventDefault(),this._active=!0,{zoomDelta:k/128}}}else this._tap.touchmove(s,f,v)}touchend(s,f,v){this._tapTime?this._swipePoint&&v.length===0&&this.reset():this._tap.touchend(s,f,v)&&(this._tapTime=s.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Yi{constructor(s,f,v){this._el=s,this._mousePan=f,this._touchPan=v}enable(s){this._inertiaOptions=s||{},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 Xa{constructor(s,f,v){this._pitchWithRotate=s.pitchWithRotate,this._mouseRotate=f,this._mousePitch=v}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 Km{constructor(s,f,v,_){this._el=s,this._touchZoom=f,this._touchRotate=v,this._tapDragZoom=_,this._rotationDisabled=!1,this._enabled=!0}enable(s){this._touchZoom.enable(s),this._rotationDisabled||this._touchRotate.enable(s),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 yl=y=>y.zoom||y.drag||y.pitch||y.rotate;class Zf extends o.Event{}function Lu(y){return y.panDelta&&y.panDelta.mag()||y.zoomDelta||y.bearingDelta||y.pitchDelta}class Hm{constructor(s,f){this._map=s,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Fm(s),this._bearingSnap=f.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(f),o.bindAll(["handleEvent","handleWindowEvent"],this);const v=this._el;this._listeners=[[v,"touchstart",{passive:!0}],[v,"touchmove",{passive:!1}],[v,"touchend",void 0],[v,"touchcancel",void 0],[v,"mousedown",void 0],[v,"mousemove",void 0],[v,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[v,"mouseover",void 0],[v,"mouseout",void 0],[v,"dblclick",void 0],[v,"click",void 0],[v,"keydown",{capture:!1}],[v,"keyup",void 0],[v,"wheel",{passive:!1}],[v,"contextmenu",void 0],[window,"blur",void 0]];for(const[_,k,D]of this._listeners)w.addEventListener(_,k,_===document?this.handleWindowEvent:this.handleEvent,D)}destroy(){for(const[s,f,v]of this._listeners)w.removeEventListener(s,f,s===document?this.handleWindowEvent:this.handleEvent,v)}_addDefaultHandlers(s){const f=this._map,v=f.getCanvasContainer();this._add("mapEvent",new T1(f,s));const _=f.boxZoom=new $m(f,s);this._add("boxZoom",_);const k=new P1,D=new Gf;f.doubleClickZoom=new Wf(D,k),this._add("tapZoom",k),this._add("clickZoom",D);const $=new qf;this._add("tapDragZoom",$);const V=f.touchPitch=new Kf(f);this._add("touchPitch",V);const W=new Ia(s),ee=new fn(s);f.dragRotate=new Xa(s,W,ee),this._add("mouseRotate",W,["mousePitch"]),this._add("mousePitch",ee,["mouseRotate"]);const ie=new Du(s),fe=new Bm(s,f);f.dragPan=new Yi(v,ie,fe),this._add("mousePan",ie),this._add("touchPan",fe,["touchZoom","touchRotate"]);const Se=new M1,_e=new Jt;f.touchZoomRotate=new Km(v,_e,Se,$),this._add("touchRotate",Se,["touchPan","touchZoom"]),this._add("touchZoom",_e,["touchPan","touchRotate"]);const we=f.scrollZoom=new Hf(f,this);this._add("scrollZoom",we,["mousePan"]);const $e=f.keyboard=new Um;this._add("keyboard",$e),this._add("blockableMapEvent",new qa(f));for(const je of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])s.interactive&&s[je]&&f[je].enable(s[je])}_add(s,f,v){this._handlers.push({handlerName:s,handler:f,allowed:v}),this._handlersById[s]=f}stop(s){if(!this._updatingCamera){for(const{handler:f}of this._handlers)f.reset();this._inertia.clear(),this._fireEvents({},{},s),this._changes=[]}}isActive(){for(const{handler:s}of this._handlers)if(s.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return Boolean(yl(this._eventsInProgress))||this.isZooming()}_blockedByActive(s,f,v){for(const _ in s)if(_!==v&&(!f||f.indexOf(_)<0))return!0;return!1}handleWindowEvent(s){this.handleEvent(s,`${s.type}Window`)}_getMapTouches(s){const f=[];for(const v of s)this._el.contains(v.target)&&f.push(v);return f}handleEvent(s,f){if(s.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const v=s.type==="renderFrame"?void 0:s,_={needsRenderFrame:!1},k={},D={},$=s.touches,V=$?this._getMapTouches($):void 0,W=V?w.touchPos(this._el,V):w.mousePos(this._el,s);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[f||s.type]&&(we=Se[f||s.type](s,W,V),this.mergeHandlerResult(_,k,we,fe,v),we&&we.needsRenderFrame&&this._triggerRenderFrame()),(we||Se.isActive())&&(D[fe]=Se)}const ee={};for(const fe in this._previousActiveHandlers)D[fe]||(ee[fe]=v);this._previousActiveHandlers=D,(Object.keys(ee).length||Lu(_))&&(this._changes.push([_,k,ee]),this._triggerRenderFrame()),(Object.keys(D).length||Lu(_))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:ie}=_;ie&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],ie(this._map))}mergeHandlerResult(s,f,v,_,k){if(!v)return;o.extend(s,v);const D={handlerName:_,originalEvent:v.originalEvent||k};v.zoomDelta!==void 0&&(f.zoom=D),v.panDelta!==void 0&&(f.drag=D),v.pitchDelta!==void 0&&(f.pitch=D),v.bearingDelta!==void 0&&(f.rotate=D)}_applyChanges(){const s={},f={},v={};for(const[_,k,D]of this._changes)_.panDelta&&(s.panDelta=(s.panDelta||new o.pointGeometry(0,0))._add(_.panDelta)),_.zoomDelta&&(s.zoomDelta=(s.zoomDelta||0)+_.zoomDelta),_.bearingDelta&&(s.bearingDelta=(s.bearingDelta||0)+_.bearingDelta),_.pitchDelta&&(s.pitchDelta=(s.pitchDelta||0)+_.pitchDelta),_.around!==void 0&&(s.around=_.around),_.pinchAround!==void 0&&(s.pinchAround=_.pinchAround),_.noInertia&&(s.noInertia=_.noInertia),o.extend(f,k),o.extend(v,D);this._updateMapTransform(s,f,v),this._changes=[]}_updateMapTransform(s,f,v){const _=this._map,k=_.transform,D=_.style&&_.style.terrain;if(!(Lu(s)||D&&this._drag))return this._fireEvents(f,v,!0);let{panDelta:$,zoomDelta:V,bearingDelta:W,pitchDelta:ee,around:ie,pinchAround:fe}=s;fe!==void 0&&(ie=fe),_._stop(!0),ie=ie||_.transform.centerPoint;const Se=k.pointLocation($?ie.sub($):ie);W&&(k.bearing+=W),ee&&(k.pitch+=ee),V&&(k.zoom+=V),D?f.drag&&!this._drag?(this._drag={center:k.centerPoint,lngLat:k.pointLocation(ie),point:ie,handlerName:f.drag.handlerName},_.fire(new o.Event("freezeElevation",{freeze:!0}))):this._drag&&v[this._drag.handlerName]?(_.fire(new o.Event("freezeElevation",{freeze:!1})),this._drag=null):f.drag&&this._drag&&(k.center=k.pointLocation(k.centerPoint.sub($))):k.setLocationAtPoint(Se,ie),this._map._update(),s.noInertia||this._inertia.record(s),this._fireEvents(f,v,!0)}_fireEvents(s,f,v){const _=yl(this._eventsInProgress),k=yl(s),D={};for(const ee in s){const{originalEvent:ie}=s[ee];this._eventsInProgress[ee]||(D[`${ee}start`]=ie),this._eventsInProgress[ee]=s[ee]}!_&&k&&this._fireEvent("movestart",k.originalEvent);for(const ee in D)this._fireEvent(ee,D[ee]);k&&this._fireEvent("move",k.originalEvent);for(const ee in s){const{originalEvent:ie}=s[ee];this._fireEvent(ee,ie)}const $={};let V;for(const ee in this._eventsInProgress){const{handlerName:ie,originalEvent:fe}=this._eventsInProgress[ee];this._handlersById[ie].isActive()||(delete this._eventsInProgress[ee],V=f[ie]||fe,$[`${ee}end`]=V)}for(const ee in $)this._fireEvent(ee,$[ee]);const W=yl(this._eventsInProgress);if(v&&(_||k)&&!W){this._updatingCamera=!0;const ee=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),ie=fe=>fe!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new Zf("renderFrame",{timeStamp:s})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}const ko={extend:(y,...s)=>o.extend(y,...s),run(y){y()},logToElement(y,s=!1,f="log"){const v=window.document.getElementById(f);v&&(s&&(v.innerHTML=""),v.innerHTML+=`
${y}`)}};class Rr extends o.Evented{constructor(s,f){super(),this._moving=!1,this._zooming=!1,this.transform=s,this._bearingSnap=f.bearingSnap,o.bindAll(["_renderFrameCallback"],this)}getCenter(){return new o.LngLat(this.transform.center.lng,this.transform.center.lat)}setCenter(s,f){return this.jumpTo({center:s},f)}panBy(s,f,v){return s=o.pointGeometry.convert(s).mult(-1),this.panTo(this.transform.center,o.extend({offset:s},f),v)}panTo(s,f,v){return this.easeTo(o.extend({center:s},f),v)}getZoom(){return this.transform.zoom}setZoom(s,f){return this.jumpTo({zoom:s},f),this}zoomTo(s,f,v){return this.easeTo(o.extend({zoom:s},f),v)}zoomIn(s,f){return this.zoomTo(this.getZoom()+1,s,f),this}zoomOut(s,f){return this.zoomTo(this.getZoom()-1,s,f),this}getBearing(){return this.transform.bearing}setBearing(s,f){return this.jumpTo({bearing:s},f),this}getPadding(){return this.transform.padding}setPadding(s,f){return this.jumpTo({padding:s},f),this}rotateTo(s,f,v){return this.easeTo(o.extend({bearing:s},f),v)}resetNorth(s,f){return this.rotateTo(0,o.extend({duration:1e3},s),f),this}resetNorthPitch(s,f){return this.easeTo(o.extend({bearing:0,pitch:0,duration:1e3},s),f),this}snapToNorth(s,f){return Math.abs(this.getBearing()){if(this._zooming&&(v.zoom=o.number(_,V,gt)),this._rotating&&(v.bearing=o.number(k,W,gt)),this._pitching&&(v.pitch=o.number(D,ee,gt)),this._padding&&(v.interpolatePadding($,ie,gt),Se=v.centerPoint.add(fe)),Pe)v.setLocationAtPoint(Pe,at);else{const yt=v.zoomScale(v.zoom-_),Dt=V>_?Math.min(2,et):Math.max(.5,et),vt=Math.pow(Dt,1-gt),rn=v.unproject($e.add(je.mult(gt*vt)).mult(yt));v.setLocationAtPoint(v.renderWorldCopies?rn.wrap():rn,Se)}this._fireMoveEvents(f)},gt=>{this._afterEase(f,gt)},s),this}_prepareEase(s,f,v={}){this._moving=!0,this.fire(new o.Event("freezeElevation",{freeze:!0})),f||v.moving||this.fire(new o.Event("movestart",s)),this._zooming&&!v.zooming&&this.fire(new o.Event("zoomstart",s)),this._rotating&&!v.rotating&&this.fire(new o.Event("rotatestart",s)),this._pitching&&!v.pitching&&this.fire(new o.Event("pitchstart",s))}_fireMoveEvents(s){this.fire(new o.Event("move",s)),this._zooming&&this.fire(new o.Event("zoom",s)),this._rotating&&this.fire(new o.Event("rotate",s)),this._pitching&&this.fire(new o.Event("pitch",s))}_afterEase(s,f){if(this._easeId&&f&&this._easeId===f)return;delete this._easeId,this.fire(new o.Event("freezeElevation",{freeze:!1}));const v=this._zooming,_=this._rotating,k=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,v&&this.fire(new o.Event("zoomend",s)),_&&this.fire(new o.Event("rotateend",s)),k&&this.fire(new o.Event("pitchend",s)),this.fire(new o.Event("moveend",s))}flyTo(s,f){if(!s.essential&&o.exported.prefersReducedMotion){const bn=o.pick(s,["center","zoom","bearing","pitch","around"]);return this.jumpTo(bn,f)}this.stop(),s=o.extend({offset:[0,0],speed:1.2,curve:1.42,easing:o.ease},s);const v=this.transform,_=this.getZoom(),k=this.getBearing(),D=this.getPitch(),$=this.getPadding(),V="zoom"in s?o.clamp(+s.zoom,v.minZoom,v.maxZoom):_,W="bearing"in s?this._normalizeBearing(s.bearing,k):k,ee="pitch"in s?+s.pitch:D,ie="padding"in s?s.padding:v.padding,fe=v.zoomScale(V-_),Se=o.pointGeometry.convert(s.offset);let _e=v.centerPoint.add(Se);const we=v.pointLocation(_e),$e=o.LngLat.convert(s.center||we);this._normalizeCenter($e);const je=v.project(we),et=v.project($e).sub(je);let Pe=s.curve;const at=Math.max(v.width,v.height),nt=at/fe,gt=et.mag();if("minZoom"in s){const bn=o.clamp(Math.min(s.minZoom,_,V),v.minZoom,v.maxZoom),cr=at/v.zoomScale(bn-_);Pe=Math.sqrt(cr/gt*2)}const yt=Pe*Pe;function Dt(bn){const cr=(nt*nt-at*at+(bn?-1:1)*yt*yt*gt*gt)/(2*(bn?nt:at)*yt*gt);return Math.log(Math.sqrt(cr*cr+1)-cr)}function vt(bn){return(Math.exp(bn)-Math.exp(-bn))/2}function rn(bn){return(Math.exp(bn)+Math.exp(-bn))/2}const qt=Dt(0);let ln=function(bn){return rn(qt)/rn(qt+Pe*bn)},Dn=function(bn){return at*((rn(qt)*(vt(cr=qt+Pe*bn)/rn(cr))-vt(qt))/yt)/gt;var cr},Vn=(Dt(1)-qt)/Pe;if(Math.abs(gt)<1e-6||!isFinite(Vn)){if(Math.abs(at-nt)<1e-6)return this.easeTo(s,f);const bn=nts.maxDuration&&(s.duration=0),this._zooming=!0,this._rotating=k!==W,this._pitching=ee!==D,this._padding=!v.isPaddingEqual(ie),this._prepareEase(f,!1),this._ease(bn=>{const cr=bn*Vn,dr=1/ln(cr);v.zoom=bn===1?V:_+v.scaleZoom(dr),this._rotating&&(v.bearing=o.number(k,W,bn)),this._pitching&&(v.pitch=o.number(D,ee,bn)),this._padding&&(v.interpolatePadding($,ie,bn),_e=v.centerPoint.add(Se));const Qn=bn===1?$e:v.unproject(je.add(et.mult(Dn(cr))).mult(dr));v.setLocationAtPoint(v.renderWorldCopies?Qn.wrap():Qn,_e),this._fireMoveEvents(f)},()=>this._afterEase(f),s),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(s,f){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const v=this._onEaseEnd;delete this._onEaseEnd,v.call(this,f)}if(!s){const v=this.handlers;v&&v.stop(!1)}return this}_ease(s,f,v){v.animate===!1||v.duration===0?(s(1),f()):(this._easeStart=o.exported.now(),this._easeOptions=v,this._onEaseFrame=s,this._onEaseEnd=f,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const s=Math.min((o.exported.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(s)),s<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(s,f){s=o.wrap(s,-180,180);const v=Math.abs(s-f);return Math.abs(s-360-f)180?-360:v<-180?360:0}}class zu{constructor(s={}){this.options=s,o.bindAll(["_toggleAttribution","_updateData","_updateCompact","_updateCompactMinimize"],this)}getDefaultPosition(){return"bottom-right"}onAdd(s){return this._map=s,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(s,f){const v=this._map._getUIString(`AttributionControl.${f}`);s.title=v,s.setAttribute("aria-label",v)}_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(s){!s||s.sourceDataType!=="metadata"&&s.sourceDataType!=="visibility"&&s.dataType!=="style"&&s.type!=="terrain"||this._updateAttributions()}_updateAttributions(){if(!this._map.style)return;let s=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?s=s.concat(this.options.customAttribution.map(_=>typeof _!="string"?"":_)):typeof this.options.customAttribution=="string"&&s.push(this.options.customAttribution)),this._map.style.stylesheet){const _=this._map.style.stylesheet;this.styleOwner=_.owner,this.styleId=_.id}const f=this._map.style.sourceCaches;for(const _ in f){const k=f[_];if(k.used||k.usedForTerrain){const D=k.getSource();D.attribution&&s.indexOf(D.attribution)<0&&s.push(D.attribution)}}s=s.filter(_=>String(_).trim()),s.sort((_,k)=>_.length-k.length),s=s.filter((_,k)=>{for(let D=k+1;D=0)return!1;return!0});const v=s.join(" | ");v!==this._attribHTML&&(this._attribHTML=v,s.length?(this._innerContainer.innerHTML=v,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 Gc{constructor(s={}){this.options=s,o.bindAll(["_updateCompact"],this)}getDefaultPosition(){return"bottom-left"}onAdd(s){this._map=s,this._compact=this.options&&this.options.compact,this._container=w.create("div","maplibregl-ctrl mapboxgl-ctrl");const f=w.create("a","maplibregl-ctrl-logo mapboxgl-ctrl-logo");return f.target="_blank",f.rel="noopener nofollow",f.href="https://maplibre.org/",f.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),f.setAttribute("rel","noopener nofollow"),this._container.appendChild(f),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 s=this._container.children;if(s.length){const f=s[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&f.classList.add("maplibregl-compact","mapboxgl-compact"):f.classList.remove("maplibregl-compact","mapboxgl-compact")}}}class Wm{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(s){const f=++this._id;return this._queue.push({callback:s,id:f,cancelled:!1}),f}remove(s){const f=this._currentlyRunning,v=f?this._queue.concat(f):this._queue;for(const _ of v)if(_.id===s)return void(_.cancelled=!0)}run(s=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const f=this._currentlyRunning=this._queue;this._queue=[];for(const v of f)if(!v.cancelled&&(v.callback(s),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}const Gm={"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"},qm={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},A1={showCompass:!0,showZoom:!0,visualizePitch:!1};class ia{constructor(s,f,v=!1){this._clickTolerance=10,this.element=f,this.mouseRotate=new Ia({clickTolerance:s.dragRotate._mouseRotate._clickTolerance}),this.map=s,v&&(this.mousePitch=new fn({clickTolerance:s.dragRotate._mousePitch._clickTolerance})),o.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),w.addEventListener(f,"mousedown",this.mousedown),w.addEventListener(f,"touchstart",this.touchstart,{passive:!1}),w.addEventListener(f,"touchmove",this.touchmove),w.addEventListener(f,"touchend",this.touchend),w.addEventListener(f,"touchcancel",this.reset)}down(s,f){this.mouseRotate.mousedown(s,f),this.mousePitch&&this.mousePitch.mousedown(s,f),w.disableDrag()}move(s,f){const v=this.map,_=this.mouseRotate.mousemoveWindow(s,f);if(_&&_.bearingDelta&&v.setBearing(v.getBearing()+_.bearingDelta),this.mousePitch){const k=this.mousePitch.mousemoveWindow(s,f);k&&k.pitchDelta&&v.setPitch(v.getPitch()+k.pitchDelta)}}off(){const s=this.element;w.removeEventListener(s,"mousedown",this.mousedown),w.removeEventListener(s,"touchstart",this.touchstart,{passive:!1}),w.removeEventListener(s,"touchmove",this.touchmove),w.removeEventListener(s,"touchend",this.touchend),w.removeEventListener(s,"touchcancel",this.reset),this.offTemp()}offTemp(){w.enableDrag(),w.removeEventListener(window,"mousemove",this.mousemove),w.removeEventListener(window,"mouseup",this.mouseup)}mousedown(s){this.down(o.extend({},s,{ctrlKey:!0,preventDefault:()=>s.preventDefault()}),w.mousePos(this.element,s)),w.addEventListener(window,"mousemove",this.mousemove),w.addEventListener(window,"mouseup",this.mouseup)}mousemove(s){this.move(s,w.mousePos(this.element,s))}mouseup(s){this.mouseRotate.mouseupWindow(s),this.mousePitch&&this.mousePitch.mouseupWindow(s),this.offTemp()}touchstart(s){s.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=w.touchPos(this.element,s.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>s.preventDefault()},this._startPos))}touchmove(s){s.targetTouches.length!==1?this.reset():(this._lastPos=w.touchPos(this.element,s.targetTouches)[0],this.move({preventDefault:()=>s.preventDefault()},this._lastPos))}touchend(s){s.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)180;){const v=f.locationPoint(y);if(v.x>=0&&v.y>=0&&v.x<=f.width&&v.y<=f.height)break;y.lng>f.center.lng?y.lng-=360:y.lng+=360}return y}const mn={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 En(y,s,f){const v=y.classList;for(const _ in mn)v.remove(`maplibregl-${f}-anchor-${_}`,`mapboxgl-${f}-anchor-${_}`);v.add(`maplibregl-${f}-anchor-${s}`,`mapboxgl-${f}-anchor-${s}`)}class xl extends o.Evented{constructor(s,f){if(super(),(s instanceof HTMLElement||f)&&(s=o.extend({element:s},f)),o.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=s&&s.anchor||"center",this._color=s&&s.color||"#3FB1CE",this._scale=s&&s.scale||1,this._draggable=s&&s.draggable||!1,this._clickTolerance=s&&s.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=s&&s.rotation||0,this._rotationAlignment=s&&s.rotationAlignment||"auto",this._pitchAlignment=s&&s.pitchAlignment&&s.pitchAlignment!=="auto"?s.pitchAlignment:this._rotationAlignment,s&&s.element)this._element=s.element,this._offset=o.pointGeometry.convert(s&&s.offset||[0,0]);else{this._defaultMarker=!0,this._element=w.create("div"),this._element.setAttribute("aria-label","Map marker");const v=w.createNS("http://www.w3.org/2000/svg","svg"),_=41,k=27;v.setAttributeNS(null,"display","block"),v.setAttributeNS(null,"height",`${_}px`),v.setAttributeNS(null,"width",`${k}px`),v.setAttributeNS(null,"viewBox",`0 0 ${k} ${_}`);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 V=w.createNS("http://www.w3.org/2000/svg","g");V.setAttributeNS(null,"transform","translate(3.0, 29.0)"),V.setAttributeNS(null,"fill","#000000");const W=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const et of W){const Pe=w.createNS("http://www.w3.org/2000/svg","ellipse");Pe.setAttributeNS(null,"opacity","0.04"),Pe.setAttributeNS(null,"cx","10.5"),Pe.setAttributeNS(null,"cy","5.80029008"),Pe.setAttributeNS(null,"rx",et.rx),Pe.setAttributeNS(null,"ry",et.ry),V.appendChild(Pe)}const ee=w.createNS("http://www.w3.org/2000/svg","g");ee.setAttributeNS(null,"fill",this._color);const ie=w.createNS("http://www.w3.org/2000/svg","path");ie.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),ee.appendChild(ie);const fe=w.createNS("http://www.w3.org/2000/svg","g");fe.setAttributeNS(null,"opacity","0.25"),fe.setAttributeNS(null,"fill","#000000");const Se=w.createNS("http://www.w3.org/2000/svg","path");Se.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),fe.appendChild(Se);const _e=w.createNS("http://www.w3.org/2000/svg","g");_e.setAttributeNS(null,"transform","translate(6.0, 7.0)"),_e.setAttributeNS(null,"fill","#FFFFFF");const we=w.createNS("http://www.w3.org/2000/svg","g");we.setAttributeNS(null,"transform","translate(8.0, 8.0)");const $e=w.createNS("http://www.w3.org/2000/svg","circle");$e.setAttributeNS(null,"fill","#000000"),$e.setAttributeNS(null,"opacity","0.25"),$e.setAttributeNS(null,"cx","5.5"),$e.setAttributeNS(null,"cy","5.5"),$e.setAttributeNS(null,"r","5.4999962");const 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($e),we.appendChild(je),$.appendChild(V),$.appendChild(ee),$.appendChild(fe),$.appendChild(_e),$.appendChild(we),v.appendChild($),v.setAttributeNS(null,"height",_*this._scale+"px"),v.setAttributeNS(null,"width",k*this._scale+"px"),this._element.appendChild(v),this._offset=o.pointGeometry.convert(s&&s.offset||[0,-14])}this._element.classList.add("maplibregl-marker","mapboxgl-marker"),this._element.addEventListener("dragstart",v=>{v.preventDefault()}),this._element.addEventListener("mousedown",v=>{v.preventDefault()}),En(this._element,this._anchor,"marker"),this._popup=null}addTo(s){return this.remove(),this._map=s,s.getCanvasContainer().appendChild(this._element),s.on("move",this._update),s.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(s){return this._lngLat=o.LngLat.convert(s),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(s){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),s){if(!("offset"in s.options)){const _=Math.sqrt(Math.pow(13.5,2)/2);s.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[_,-1*(38.1-13.5+_)],"bottom-right":[-_,-1*(38.1-13.5+_)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=s,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(s){const f=s.code,v=s.charCode||s.keyCode;f!=="Space"&&f!=="Enter"&&v!==32&&v!==13||this.togglePopup()}_onMapClick(s){const f=s.originalEvent.target,v=this._element;this._popup&&(f===v||v.contains(f))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const s=this._popup;return s?(s.isOpen()?s.remove():s.addTo(this._map),this):this}_update(s){if(!this._map)return;this._map.transform.renderWorldCopies&&(this._lngLat=Fu(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);let f="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?f=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(f=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let v="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?v="rotateX(0deg)":this._pitchAlignment==="map"&&(v=`rotateX(${this._map.getPitch()}deg)`),s&&s.type!=="moveend"||(this._pos=this._pos.round()),w.setTransform(this._element,`${mn[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${v} ${f}`),this._map.style&&this._map.style.terrain&&!this._opacityTimeout&&(this._opacityTimeout=setTimeout(()=>{const _=this._map.unproject(this._pos),k=40075016686e-3*Math.abs(Math.cos(this._lngLat.lat*Math.PI/180))/Math.pow(2,this._map.transform.tileZoom+8);this._element.style.opacity=_.distanceTo(this._lngLat)>20*k?"0.2":"1.0",this._opacityTimeout=null},100))}getOffset(){return this._offset}setOffset(s){return this._offset=o.pointGeometry.convert(s),this._update(),this}_onMove(s){if(!this._isDragging){const f=this._clickTolerance||this._map._clickTolerance;this._isDragging=s.point.dist(this._pointerdownPos)>=f}this._isDragging&&(this._pos=s.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(s){this._element.contains(s.originalEvent.target)&&(s.preventDefault(),this._positionDelta=s.point.sub(this._pos).add(this._offset),this._pointerdownPos=s.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(s){return this._draggable=!!s,this._map&&(s?(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(s){return this._rotation=s||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(s){return this._rotationAlignment=s||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(s){return this._pitchAlignment=s&&s!=="auto"?s:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}}const Xf={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let Ya,Ti=0,Qa=!1;const oa={maxWidth:100,unit:"metric"};function Zm(y,s,f){const v=f&&f.maxWidth||100,_=y._container.clientHeight/2,k=y.unproject([0,_]),D=y.unproject([v,_]),$=k.distanceTo(D);if(f&&f.unit==="imperial"){const V=3.2808*$;V>5280?Ja(s,v,V/5280,y._getUIString("ScaleControl.Miles")):Ja(s,v,V,y._getUIString("ScaleControl.Feet"))}else f&&f.unit==="nautical"?Ja(s,v,$/1852,y._getUIString("ScaleControl.NauticalMiles")):$>=1e3?Ja(s,v,$/1e3,y._getUIString("ScaleControl.Kilometers")):Ja(s,v,$,y._getUIString("ScaleControl.Meters"))}function Ja(y,s,f,v){const _=function(k){const D=Math.pow(10,`${Math.floor(k)}`.length-1);let $=k/D;return $=$>=10?10:$>=5?5:$>=3?3:$>=2?2:$>=1?1:function(V){const W=Math.pow(10,Math.ceil(-Math.log(V)/Math.LN10));return Math.round(V*W)/W}($),D*$}(f);y.style.width=s*(_/f)+"px",y.innerHTML=`${_} ${v}`}const Gr={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 Yf(y){if(y){if(typeof y=="number"){const s=Math.round(Math.sqrt(.5*Math.pow(y,2)));return{center:new o.pointGeometry(0,0),top:new o.pointGeometry(0,y),"top-left":new o.pointGeometry(s,s),"top-right":new o.pointGeometry(-s,s),bottom:new o.pointGeometry(0,-y),"bottom-left":new o.pointGeometry(s,-s),"bottom-right":new o.pointGeometry(-s,-s),left:new o.pointGeometry(y,0),right:new o.pointGeometry(-y,0)}}if(y instanceof o.pointGeometry||Array.isArray(y)){const s=o.pointGeometry.convert(y);return{center:s,top:s,"top-left":s,"top-right":s,bottom:s,"bottom-left":s,"bottom-right":s,left:s,right:s}}return{center:o.pointGeometry.convert(y.center||[0,0]),top:o.pointGeometry.convert(y.top||[0,0]),"top-left":o.pointGeometry.convert(y["top-left"]||[0,0]),"top-right":o.pointGeometry.convert(y["top-right"]||[0,0]),bottom:o.pointGeometry.convert(y.bottom||[0,0]),"bottom-left":o.pointGeometry.convert(y["bottom-left"]||[0,0]),"bottom-right":o.pointGeometry.convert(y["bottom-right"]||[0,0]),left:o.pointGeometry.convert(y.left||[0,0]),right:o.pointGeometry.convert(y.right||[0,0])}}return Yf(new o.pointGeometry(0,0))}const Ss={supported:h,setRTLTextPlugin:o.setRTLTextPlugin,getRTLTextPluginStatus:o.getRTLTextPluginStatus,Map:class extends Rr{constructor(y){var s;if(o.PerformanceUtils.mark(o.PerformanceMarkers.create),(y=o.extend({},qm,y)).minZoom!=null&&y.maxZoom!=null&&y.minZoom>y.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(y.minPitch!=null&&y.maxPitch!=null&&y.minPitch>y.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(y.minPitch!=null&&y.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(y.maxPitch!=null&&y.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new Iu(y.minZoom,y.maxZoom,y.minPitch,y.maxPitch,y.renderWorldCopies),{bearingSnap:y.bearingSnap}),this._interactive=y.interactive,this._cooperativeGestures=y.cooperativeGestures,this._maxTileCacheSize=y.maxTileCacheSize,this._failIfMajorPerformanceCaveat=y.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=y.preserveDrawingBuffer,this._antialias=y.antialias,this._trackResize=y.trackResize,this._bearingSnap=y.bearingSnap,this._refreshExpiredTiles=y.refreshExpiredTiles,this._fadeDuration=y.fadeDuration,this._crossSourceCollisions=y.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=y.collectResourceTiming,this._renderTaskQueue=new Wm,this._controls=[],this._mapId=o.uniqueId(),this._locale=o.extend({},Gm,y.locale),this._clickTolerance=y.clickTolerance,this._pixelRatio=(s=y.pixelRatio)!==null&&s!==void 0?s:devicePixelRatio,this._requestManager=new P(y.transformRequest),typeof y.container=="string"){if(this._container=document.getElementById(y.container),!this._container)throw new Error(`Container '${y.container}' not found.`)}else{if(!(y.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=y.container}if(y.maxBounds&&this.setMaxBounds(y.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 Hm(this,y),this._cooperativeGestures&&this._setupCooperativeGestures(),this._hash=y.hash&&new Nm(typeof y.hash=="string"&&y.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:y.center,zoom:y.zoom,bearing:y.bearing,pitch:y.pitch}),y.bounds&&(this.resize(),this.fitBounds(y.bounds,o.extend({},y.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=y.localIdeographFontFamily,y.style&&this.setStyle(y.style,{localIdeographFontFamily:y.localIdeographFontFamily}),y.attributionControl&&this.addControl(new zu({customAttribution:y.customAttribution})),y.maplibreLogo&&this.addControl(new Gc,y.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",f=>{this._update(f.dataType==="style"),this.fire(new o.Event(`${f.dataType}data`,f))}),this.on("dataloading",f=>{this.fire(new o.Event(`${f.dataType}dataloading`,f))}),this.on("dataabort",f=>{this.fire(new o.Event("sourcedataabort",f))})}_getMapId(){return this._mapId}addControl(y,s){if(s===void 0&&(s=y.getDefaultPosition?y.getDefaultPosition():"top-right"),!y||!y.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 f=y.onAdd(this);this._controls.push(y);const v=this._controlPositions[s];return s.indexOf("bottom")!==-1?v.insertBefore(f,v.firstChild):v.appendChild(f),this}removeControl(y){if(!y||!y.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 s=this._controls.indexOf(y);return s>-1&&this._controls.splice(s,1),y.onRemove(this),this}hasControl(y){return this._controls.indexOf(y)>-1}calculateCameraOptionsFromTo(y,s,f,v){return v==null&&this.style.terrain&&(v=this.transform.getElevation(f,this.style.terrain)),super.calculateCameraOptionsFromTo(y,s,f,v)}resize(y){const s=this._containerDimensions(),f=s[0],v=s[1];this._resizeCanvas(f,v,this.getPixelRatio()),this.transform.resize(f,v),this.painter.resize(f,v,this.getPixelRatio());const _=!this._moving;return _&&(this.stop(),this.fire(new o.Event("movestart",y)).fire(new o.Event("move",y))),this.fire(new o.Event("resize",y)),_&&this.fire(new o.Event("moveend",y)),this}getPixelRatio(){return this._pixelRatio}setPixelRatio(y){const[s,f]=this._containerDimensions();this._pixelRatio=y,this._resizeCanvas(s,f,y),this.painter.resize(s,f,y)}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(y){return this.transform.setMaxBounds(o.LngLatBounds.convert(y)),this._update()}setMinZoom(y){if((y=y==null?-2:y)>=-2&&y<=this.transform.maxZoom)return this.transform.minZoom=y,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=y,this._update(),this.getZoom()>y&&this.setZoom(y),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(y){if((y=y==null?0:y)<0)throw new Error("minPitch must be greater than or equal to 0");if(y>=0&&y<=this.transform.maxPitch)return this.transform.minPitch=y,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(y>=this.transform.minPitch)return this.transform.maxPitch=y,this._update(),this.getPitch()>y&&this.setPitch(y),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(y){return this.transform.renderWorldCopies=y,this._update()}project(y){return this.transform.locationPoint(o.LngLat.convert(y),this.style&&this.style.terrain)}unproject(y){return this.transform.pointLocation(o.pointGeometry.convert(y),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(y,s,f){if(y==="mouseenter"||y==="mouseover"){let v=!1;return{layer:s,listener:f,delegates:{mousemove:k=>{const D=this.getLayer(s)?this.queryRenderedFeatures(k.point,{layers:[s]}):[];D.length?v||(v=!0,f.call(this,new uo(y,this,k.originalEvent,{features:D}))):v=!1},mouseout:()=>{v=!1}}}}if(y==="mouseleave"||y==="mouseout"){let v=!1;return{layer:s,listener:f,delegates:{mousemove:D=>{(this.getLayer(s)?this.queryRenderedFeatures(D.point,{layers:[s]}):[]).length?v=!0:v&&(v=!1,f.call(this,new uo(y,this,D.originalEvent)))},mouseout:D=>{v&&(v=!1,f.call(this,new uo(y,this,D.originalEvent)))}}}}{const v=_=>{const k=this.getLayer(s)?this.queryRenderedFeatures(_.point,{layers:[s]}):[];k.length&&(_.features=k,f.call(this,_),delete _.features)};return{layer:s,listener:f,delegates:{[y]:v}}}}on(y,s,f){if(f===void 0)return super.on(y,s);const v=this._createDelegatedListener(y,s,f);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[y]=this._delegatedListeners[y]||[],this._delegatedListeners[y].push(v);for(const _ in v.delegates)this.on(_,v.delegates[_]);return this}once(y,s,f){if(f===void 0)return super.once(y,s);const v=this._createDelegatedListener(y,s,f);for(const _ in v.delegates)this.once(_,v.delegates[_]);return this}off(y,s,f){return f===void 0?super.off(y,s):(this._delegatedListeners&&this._delegatedListeners[y]&&(v=>{const _=this._delegatedListeners[y];for(let k=0;k<_.length;k++){const D=_[k];if(D.layer===s&&D.listener===f){for(const $ in D.delegates)this.off($,D.delegates[$]);return _.splice(k,1),this}}})(),this)}queryRenderedFeatures(y,s){if(!this.style)return[];let f;if(s!==void 0||y===void 0||y instanceof o.pointGeometry||Array.isArray(y)||(s=y,y=void 0),s=s||{},(y=y||[[0,0],[this.transform.width,this.transform.height]])instanceof o.pointGeometry||typeof y[0]=="number")f=[o.pointGeometry.convert(y)];else{const v=o.pointGeometry.convert(y[0]),_=o.pointGeometry.convert(y[1]);f=[v,new o.pointGeometry(_.x,v.y),_,new o.pointGeometry(v.x,_.y),v]}return this.style.queryRenderedFeatures(f,s,this.transform)}querySourceFeatures(y,s){return this.style.querySourceFeatures(y,s)}setStyle(y,s){return(s=o.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},s)).diff!==!1&&s.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&y?(this._diffStyle(y,s),this):(this._localIdeographFontFamily=s.localIdeographFontFamily,this._updateStyle(y,s))}setTransformRequest(y){return this._requestManager.setTransformRequest(y),this}_getUIString(y){const s=this._locale[y];if(s==null)throw new Error(`Missing UI string '${y}'`);return s}_updateStyle(y,s){return this.style&&(this.style.setEventedParent(null),this.style._remove()),y?(this.style=new Pr(this,s||{}),this.style.setEventedParent(this,{style:this.style}),typeof y=="string"?this.style.loadURL(y):this.style.loadJSON(y),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Pr(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(y,s){if(typeof y=="string"){const f=this._requestManager.transformRequest(y,o.ResourceType.Style);o.getJSON(f,(v,_)=>{v?this.fire(new o.ErrorEvent(v)):_&&this._updateDiff(_,s)})}else typeof y=="object"&&this._updateDiff(y,s)}_updateDiff(y,s){try{this.style.setState(y)&&this._update(!0)}catch(f){o.warnOnce(`Unable to perform style diff: ${f.message||f.error||f}. Rebuilding the style from scratch.`),this._updateStyle(y,s)}}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(y,s){return this._lazyInitEmptyStyle(),this.style.addSource(y,s),this._update(!0)}isSourceLoaded(y){const s=this.style&&this.style.sourceCaches[y];if(s!==void 0)return s.loaded();this.fire(new o.ErrorEvent(new Error(`There is no source with ID '${y}'`)))}setTerrain(y){return this.style.setTerrain(y),this}getTerrain(){return this.style.terrain&&this.style.terrain.options}areTilesLoaded(){const y=this.style&&this.style.sourceCaches;for(const s in y){const f=y[s]._tiles;for(const v in f){const _=f[v];if(_.state!=="loaded"&&_.state!=="errored")return!1}}return!0}addSourceType(y,s,f){return this._lazyInitEmptyStyle(),this.style.addSourceType(y,s,f)}removeSource(y){return this.style.removeSource(y),this._update(!0)}getSource(y){return this.style.getSource(y)}addImage(y,s,{pixelRatio:f=1,sdf:v=!1,stretchX:_,stretchY:k,content:D}={}){if(this._lazyInitEmptyStyle(),s instanceof HTMLImageElement||o.isImageBitmap(s)){const{width:$,height:V,data:W}=o.exported.getImageData(s);this.style.addImage(y,{data:new o.RGBAImage({width:$,height:V},W),pixelRatio:f,stretchX:_,stretchY:k,content:D,sdf:v,version:0})}else{if(s.width===void 0||s.height===void 0)return this.fire(new o.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:$,height:V,data:W}=s,ee=s;this.style.addImage(y,{data:new o.RGBAImage({width:$,height:V},new Uint8Array(W)),pixelRatio:f,stretchX:_,stretchY:k,content:D,sdf:v,version:0,userImage:ee}),ee.onAdd&&ee.onAdd(this,y)}}}updateImage(y,s){const f=this.style.getImage(y);if(!f)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 v=s instanceof HTMLImageElement||o.isImageBitmap(s)?o.exported.getImageData(s):s,{width:_,height:k,data:D}=v;if(_===void 0||k===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(_!==f.data.width||k!==f.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 $=!(s instanceof HTMLImageElement||o.isImageBitmap(s));f.data.replace(D,$),this.style.updateImage(y,f)}hasImage(y){return y?!!this.style.getImage(y):(this.fire(new o.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(y){this.style.removeImage(y)}loadImage(y,s){o.getImage(this._requestManager.transformRequest(y,o.ResourceType.Image),s)}listImages(){return this.style.listImages()}addLayer(y,s){return this._lazyInitEmptyStyle(),this.style.addLayer(y,s),this._update(!0)}moveLayer(y,s){return this.style.moveLayer(y,s),this._update(!0)}removeLayer(y){return this.style.removeLayer(y),this._update(!0)}getLayer(y){return this.style.getLayer(y)}setLayerZoomRange(y,s,f){return this.style.setLayerZoomRange(y,s,f),this._update(!0)}setFilter(y,s,f={}){return this.style.setFilter(y,s,f),this._update(!0)}getFilter(y){return this.style.getFilter(y)}setPaintProperty(y,s,f,v={}){return this.style.setPaintProperty(y,s,f,v),this._update(!0)}getPaintProperty(y,s){return this.style.getPaintProperty(y,s)}setLayoutProperty(y,s,f,v={}){return this.style.setLayoutProperty(y,s,f,v),this._update(!0)}getLayoutProperty(y,s){return this.style.getLayoutProperty(y,s)}setLight(y,s={}){return this._lazyInitEmptyStyle(),this.style.setLight(y,s),this._update(!0)}getLight(){return this.style.getLight()}setFeatureState(y,s){return this.style.setFeatureState(y,s),this._update()}removeFeatureState(y,s){return this.style.removeFeatureState(y,s),this._update()}getFeatureState(y){return this.style.getFeatureState(y)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let y=0,s=0;return this._container&&(y=this._container.clientWidth||400,s=this._container.clientHeight||300),[y,s]}_setupContainer(){const y=this._container;y.classList.add("maplibregl-map","mapboxgl-map");const s=this._canvasContainer=w.create("div","maplibregl-canvas-container mapboxgl-canvas-container",y);this._interactive&&s.classList.add("maplibregl-interactive","mapboxgl-interactive"),this._canvas=w.create("canvas","maplibregl-canvas mapboxgl-canvas",s),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 f=this._containerDimensions();this._resizeCanvas(f[0],f[1],this.getPixelRatio());const v=this._controlContainer=w.create("div","maplibregl-control-container mapboxgl-control-container",y),_=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(k=>{_[k]=w.create("div",`maplibregl-ctrl-${k} mapboxgl-ctrl-${k}`,v)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_setupCooperativeGestures(){const y=this._container;this._metaPress=!1,this._cooperativeGesturesScreen=w.create("div","maplibregl-cooperative-gesture-screen",y);let s="Control",f=typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.windowsHelpText?this._cooperativeGestures.windowsHelpText:"Use Ctrl + scroll to zoom the map";navigator.platform.indexOf("Mac")===0&&(f=typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.macHelpText?this._cooperativeGestures.macHelpText:"Use \u2318 + scroll to zoom the map",s="Meta"),this._cooperativeGesturesScreen.innerHTML=`
${f}
${typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.mobileHelpText?this._cooperativeGestures.mobileHelpText:"Use two fingers to move the map"}
`,document.addEventListener("keydown",v=>{v.key===s&&(this._metaPress=!0)}),document.addEventListener("keyup",v=>{v.key===s&&(this._metaPress=!1)}),this._canvasContainer.addEventListener("wheel",v=>{this._onCooperativeGesture(v,this._metaPress,1)},!1),this._canvasContainer.classList.remove("mapboxgl-touch-drag-pan","maplibregl-touch-drag-pan")}_resizeCanvas(y,s,f){this._canvas.width=f*y,this._canvas.height=f*s,this._canvas.style.width=`${y}px`,this._canvas.style.height=`${s}px`}_setupPainter(){const y=o.extend({},h.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),s=this._canvas.getContext("webgl",y)||this._canvas.getContext("experimental-webgl",y);s?(this.painter=new Bf(s,this.transform),o.exported$1.testSupport(s)):this.fire(new o.ErrorEvent(new Error("Failed to initialize WebGL")))}_contextLost(y){y.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new o.Event("webglcontextlost",{originalEvent:y}))}_contextRestored(y){this._setupPainter(),this.resize(),this._update(),this.fire(new o.Event("webglcontextrestored",{originalEvent:y}))}_onMapScroll(y){if(y.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}_onCooperativeGesture(y,s,f){return!s&&f<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(y){return this.style?(this._styleDirty=this._styleDirty||y,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(y){return this._update(),this._renderTaskQueue.add(y)}_cancelRenderFrame(y){this._renderTaskQueue.remove(y)}_render(y){let s,f=0;const v=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(s=v.createQueryEXT(),v.beginQueryEXT(v.TIME_ELAPSED_EXT,s),f=o.exported.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(y),this._removed)return;let _=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const D=this.transform.zoom,$=o.exported.now();this.style.zoomHistory.update(D,$);const V=new o.EvaluationParameters(D,{now:$,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),W=V.crossFadingFactor();W===1&&W===this._crossFadingFactor||(_=!0,this._crossFadingFactor=W),this.style.update(V)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.style.terrain&&this.style.terrain.sourceCache.update(this.transform,this.style.terrain),this.transform.updateElevation(this.style.terrain),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer")}),this.fire(new o.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,o.PerformanceUtils.mark(o.PerformanceMarkers.load),this.fire(new o.Event("load"))),this.style&&(this.style.hasTransitions()||_)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){const D=o.exported.now()-f;v.endQueryEXT(v.TIME_ELAPSED_EXT,s),setTimeout(()=>{const $=v.getQueryObjectEXT(s,v.QUERY_RESULT_EXT)/1e6;v.deleteQueryEXT(s),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 k=this._sourcesDirty||this._styleDirty||this._placementDirty;return k||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new o.Event("idle")),!this._loaded||this._fullyLoaded||k||(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 s of this._controls)s.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 y=this.painter.context.gl.getExtension("WEBGL_lose_context");y&&y.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(y=>{o.PerformanceUtils.frame(y),this._frame=null,this._render(y)}))}_onWindowOnline(){this._update()}_onWindowResize(y){this._trackResize&&this.resize({originalEvent:y})._update()}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(y){this._showTileBoundaries!==y&&(this._showTileBoundaries=y,this._update())}get showPadding(){return!!this._showPadding}set showPadding(y){this._showPadding!==y&&(this._showPadding=y,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(y){this._showCollisionBoxes!==y&&(this._showCollisionBoxes=y,y?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(y){this._showOverdrawInspector!==y&&(this._showOverdrawInspector=y,this._update())}get repaint(){return!!this._repaint}set repaint(y){this._repaint!==y&&(this._repaint=y,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(y){this._vertices=y,this._update()}_setCacheLimits(y,s){o.setCacheLimits(y,s)}get version(){return"2.4.0"}},NavigationControl:class{constructor(y){this.options=o.extend({},A1,y),this._container=w.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",s=>s.preventDefault()),this.options.showZoom&&(o.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in mapboxgl-ctrl-zoom-in",s=>this._map.zoomIn({},{originalEvent:s})),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",s=>this._map.zoomOut({},{originalEvent:s})),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",s=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:s}):this._map.resetNorth({},{originalEvent:s})}),this._compassIcon=w.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const y=this._map.getZoom(),s=y===this._map.getMaxZoom(),f=y===this._map.getMinZoom();this._zoomInButton.disabled=s,this._zoomOutButton.disabled=f,this._zoomInButton.setAttribute("aria-disabled",s.toString()),this._zoomOutButton.setAttribute("aria-disabled",f.toString())}_rotateCompassArrow(){const y=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=y}onAdd(y){return this._map=y,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 ia(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(y,s){const f=w.create("button",y,this._container);return f.type="button",f.addEventListener("click",s),f}_setButtonTitle(y,s){const f=this._map._getUIString(`NavigationControl.${s}`);y.title=f,y.setAttribute("aria-label",f)}},GeolocateControl:class extends o.Evented{constructor(y){super(),this.options=o.extend({},Xf,y),o.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}onAdd(y){var s;return this._map=y,this._container=w.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),s=this._setupUI,Ya!==void 0?s(Ya):window.navigator.permissions!==void 0?window.navigator.permissions.query({name:"geolocation"}).then(f=>{Ya=f.state!=="denied",s(Ya)}):(Ya=!!window.navigator.geolocation,s(Ya)),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,Ti=0,Qa=!1}_isOutOfMapMaxBounds(y){const s=this._map.getMaxBounds(),f=y.coords;return s&&(f.longitudes.getEast()||f.latitudes.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(y){if(this._map){if(this._isOutOfMapMaxBounds(y))return this._setErrorState(),this.fire(new o.Event("outofmaxbounds",y)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=y,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(y),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(y),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale","mapboxgl-user-location-dot-stale"),this.fire(new o.Event("geolocate",y)),this._finish()}}_updateCamera(y){const s=new o.LngLat(y.coords.longitude,y.coords.latitude),f=y.coords.accuracy,v=this._map.getBearing(),_=o.extend({bearing:v},this.options.fitBoundsOptions);this._map.fitBounds(s.toBounds(f),_,{geolocateSource:!0})}_updateMarker(y){if(y){const s=new o.LngLat(y.coords.longitude,y.coords.latitude);this._accuracyCircleMarker.setLngLat(s).addTo(this._map),this._userLocationDotMarker.setLngLat(s).addTo(this._map),this._accuracy=y.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const y=this._map._container.clientHeight/2,s=this._map.unproject([0,y]),f=this._map.unproject([1,y]),v=s.distanceTo(f),_=Math.ceil(2*this._accuracy/v);this._circleElement.style.width=`${_}px`,this._circleElement.style.height=`${_}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_onError(y){if(this._map){if(this.options.trackUserLocation)if(y.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 s=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=s,this._geolocateButton.setAttribute("aria-label",s),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(y.code===3&&Qa)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",y)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(y){if(this._container.addEventListener("contextmenu",s=>s.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",y===!1){o.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");const s=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=s,this._geolocateButton.setAttribute("aria-label",s)}else{const s=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=s,this._geolocateButton.setAttribute("aria-label",s)}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 xl(this._dotElement),this._circleElement=w.create("div","maplibregl-user-location-accuracy-circle mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new xl({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",s=>{s.geolocateSource||this._watchState!=="ACTIVE_LOCK"||s.originalEvent&&s.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":Ti--,Qa=!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 y;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Ti++,Ti>1?(y={maximumAge:6e5,timeout:0},Qa=!0):(y=this.options.positionOptions,Qa=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,y)}}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:zu,LogoControl:Gc,ScaleControl:class{constructor(y){this.options=o.extend({},oa,y),o.bindAll(["_onMove","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_onMove(){Zm(this._map,this._container,this.options)}onAdd(y){return this._map=y,this._container=w.create("div","maplibregl-ctrl maplibregl-ctrl-scale mapboxgl-ctrl mapboxgl-ctrl-scale",y.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(y){this.options.unit=y,Zm(this._map,this._container,this.options)}},FullscreenControl:class{constructor(y){this._fullscreen=!1,y&&y.container&&(y.container instanceof HTMLElement?this._container=y.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(y){return this._map=y,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 y=this._fullscreenButton=w.create("button","maplibregl-ctrl-fullscreen mapboxgl-ctrl-fullscreen",this._controlContainer);w.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",y).setAttribute("aria-hidden","true"),y.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const y=this._getTitle();this._fullscreenButton.setAttribute("aria-label",y),this._fullscreenButton.title=y}_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(y){this.options=y,o.bindAll(["_toggleTerrain","_updateTerrainIcon"],this)}onAdd(y){return this._map=y,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(y){super(),this.options=o.extend(Object.create(Gr),y),o.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}addTo(y){return this._map&&this.remove(),this._map=y,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(y){return this._lngLat=o.LngLat.convert(y),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(y){return this.setDOMContent(document.createTextNode(y))}setHTML(y){const s=document.createDocumentFragment(),f=document.createElement("body");let v;for(f.innerHTML=y;v=f.firstChild,v;)s.appendChild(v);return this.setDOMContent(s)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(y){return this.options.maxWidth=y,this._update(),this}setDOMContent(y){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(y),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(y){this._container&&this._container.classList.add(y)}removeClassName(y){this._container&&this._container.classList.remove(y)}setOffset(y){return this.options.offset=y,this._update(),this}toggleClassName(y){if(this._container)return this._container.classList.toggle(y)}_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(y){this._update(y.point)}_onMouseMove(y){this._update(y.point)}_onDrag(y){this._update(y.point)}_update(y){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(k=>this._container.classList.add(k)),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=Fu(this._lngLat,this._pos,this._map.transform)),this._trackPointer&&!y))return;const s=this._pos=this._trackPointer&&y?y:this._map.project(this._lngLat);let f=this.options.anchor;const v=Yf(this.options.offset);if(!f){const k=this._container.offsetWidth,D=this._container.offsetHeight;let $;$=s.y+v.bottom.ythis._map.transform.height-D?["bottom"]:[],s.xthis._map.transform.width-k/2&&$.push("right"),f=$.length===0?"bottom":$.join("-")}const _=s.add(v[f]).round();w.setTransform(this._container,`${mn[f]} translate(${_.x}px,${_.y}px)`),En(this._container,f,"popup")}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const y=this._container.querySelector(ni);y&&y.focus()}_onClose(){this.remove()}},Marker:xl,Style:Pr,LngLat:o.LngLat,LngLatBounds:o.LngLatBounds,Point:o.pointGeometry,MercatorCoordinate:o.MercatorCoordinate,Evented:o.Evented,AJAXError:o.AJAXError,config:o.config,CanvasSource:Te,GeoJSONSource:de,ImageSource:ye,RasterDEMTileSource:re,RasterTileSource:Q,VectorTileSource:Z,VideoSource:Re,prewarm:function(){Mt().acquire(Tt)},clearPrewarmedResources:function(){const y=mt;y&&(y.isPreloaded()&&y.numActive()===1?(y.release(Tt),mt=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get version(){return"2.4.0"},get workerCount(){return Xe.workerCount},set workerCount(y){Xe.workerCount=y},get maxParallelImageRequests(){return o.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(y){o.config.MAX_PARALLEL_IMAGE_REQUESTS=y},clearStorage(y){o.clearTileCache(y)},workerUrl:"",addProtocol(y,s){o.config.REGISTERED_PROTOCOLS[y]=s},removeProtocol(y){delete o.config.REGISTERED_PROTOCOLS[y]}};return ko.extend(Ss,{isSafari:o.isSafari,getPerformanceMetrics:o.PerformanceUtils.getPerformanceMetrics}),Ss});var c=i;return c})})(r9);const ode=r9.exports,ade="modulepreload",sde=function(e){return"/"+e},KT={},lde=function(t,n,r){if(!n||n.length===0)return t();const i=document.getElementsByTagName("link");return Promise.all(n.map(l=>{if(l=sde(l),l in KT)return;KT[l]=!0;const c=l.endsWith(".css"),o=c?'[rel="stylesheet"]':"";if(!!r)for(let g=i.length-1;g>=0;g--){const b=i[g];if(b.href===l&&(!c||b.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${l}"]${o}`))return;const p=document.createElement("link");if(p.rel=c?"stylesheet":ade,c||(p.as="script",p.crossOrigin=""),p.href=l,document.head.appendChild(p),c)return new Promise((g,b)=>{p.addEventListener("load",g),p.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${l}`)))})})).then(()=>t())},i3=C.exports.createContext(null),ude=e=>{const[t,n]=C.exports.useState({}),r=C.exports.useCallback((l,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]:l}})},[]),i=C.exports.useCallback((l="default")=>{n(c=>{if(c[l]){const o={...c};return delete o[l],o}return c})},[]);return E(i3.Provider,{value:{maps:t,onMapMount:r,onMapUnmount:i},children:e.children})};function o3(){var e;const t=(e=C.exports.useContext(i3))===null||e===void 0?void 0:e.maps,n=C.exports.useContext(Ic);return C.exports.useMemo(()=>({...t,current:n==null?void 0:n.map}),[t,n])}function cde(e){const t=e.clone();return t.pixelsToGLUnits=e.pixelsToGLUnits,t}function HT(e){return{longitude:e.center.lng,latitude:e.center.lat,zoom:e.zoom,pitch:e.pitch,bearing:e.bearing,padding:e.padding}}function WT(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 dde=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function GT(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 l=null;if("interactive"in r&&(l={...r},delete l.interactive),i){l=l||{...r},delete l.ref;for(const c of dde)c in i&&(l[c]=i[c])}return l||r});return{...e,layers:n}}function fde(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,l=Array.isArray(t)?t[1]:t?t.y:0;return n===i&&r===l}function ya(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 l=this.props[ZT[i.type]];l&&l(i)},this._onPointerEvent=i=>{(i.type==="mousemove"||i.type==="mouseout")&&this._updateHover(i);const l=this.props[qT[i.type]];if(l){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}l(i),delete i.features}},this._onCameraEvent=i=>{if(!this._internalUpdate){const l=this.props[W_[i.type]];l&&l(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),l=this._updateViewState(t,!0);this._updateStyle(t,n),this._updateStyleComponents(t,n),this._updateHandlers(t,n),(r||i||l&&!this._map.isMoving())&&this.redraw()}static reuse(t,n){const r=tf.savedMaps.pop();if(!r)return null;const i=r.map,l=i.getContainer();for(n.className=l.className;l.childNodes.length>0;)n.appendChild(l.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||mde()||null,container:t,style:GT(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 l=new this._MapClass(r);i.padding&&l.setPadding(i.padding),n.cursor&&(l.getCanvas().style.cursor=n.cursor),this._createShadowTransform(l);const c=l._render;l._render=p=>{this._inRender=!0,c.call(l,p),this._inRender=!1};const o=l._renderTaskQueue.run;l._renderTaskQueue.run=p=>{o.call(l._renderTaskQueue,p),this._onBeforeRepaint()},l.on("render",()=>this._onAfterRepaint());const h=l.fire;l.fire=this._fireEvent.bind(this,h),l.on("resize",()=>{this._renderTransform.resize(l.transform.width,l.transform.height)}),l.on("styledata",()=>this._updateStyleComponents(this.props,{})),l.on("sourcedata",()=>this._updateStyleComponents(this.props,{}));for(const p in qT)l.on(p,this._onPointerEvent);for(const p in W_)l.on(p,this._onCameraEvent);for(const p in ZT)l.on(p,this._onEvent);this._map=l}recycle(){const n=this.map.getContainer().querySelector("[mapboxgl-children]");n==null||n.remove(),tf.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=cde(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:l,pitch:c,bearing:o}=i,h=r.isMoving();h&&(i.cameraElevationReference="sea");const p=WT(i,{...HT(r.transform),...t});if(h&&(i.cameraElevationReference="ground"),p&&n){const g=this._deferredEvents;g.move=!0,g.zoom||(g.zoom=l!==i.zoom),g.rotate||(g.rotate=o!==i.bearing),g.pitch||(g.pitch=c!==i.pitch)}return h||WT(r.transform,t),p}_updateSettings(t,n){const r=this._map;let i=!1;for(const l of hde)l in t&&!ya(t[l],n[l])&&(i=!0,r[`set${l[0].toUpperCase()}${l.slice(1)}`](t[l]));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(GT(t.mapStyle),r),!0}return!1}_updateStyleComponents(t,n){const r=this._map;let i=!1;return r.style.loaded()&&("light"in t&&!ya(t.light,n.light)&&(i=!0,r.setLight(t.light)),"fog"in t&&!ya(t.fog,n.fog)&&(i=!0,r.setFog(t.fog)),"terrain"in t&&!ya(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 l of pde){const c=t[l];ya(c,n[l])||(i=!0,c?r[l].enable(c):r[l].disable())}return i}_updateHover(t){var n;const{props:r}=this;if(r.interactiveLayerIds&&(r.onMouseMove||r.onMouseEnter||r.onMouseLeave)){const l=t.type,c=((n=this._hoveredFeatures)===null||n===void 0?void 0:n.length)>0;let o;if(l==="mousemove")try{o=this._map.queryRenderedFeatures(t.point,{layers:r.interactiveLayerIds})}catch{o=[]}else o=[];const h=o.length>0;!h&&c&&(t.type="mouseleave",this._onPointerEvent(t)),this._hoveredFeatures=o,h&&!c&&(t.type="mouseenter",this._onPointerEvent(t)),t.type=l}else this._hoveredFeatures=null}_fireEvent(t,n,r){const i=this._map,l=i.transform,c=typeof n=="string"?n:n.type;return c==="move"&&this._updateViewState(this.props,!1),c in W_&&(typeof n=="object"&&(n.viewState=HT(l)),this._map.isMoving())?(i.transform=this._renderTransform,t.call(i,n,r),i.transform=l,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}}}tf.savedMaps=[];function mde(){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 vde=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function gde(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,l)=>{const c=n.transform;n.transform=e.transform;const o=n.queryTerrainElevation(i,l);return n.transform=c,o}};for(const i of yde(n))!(i in r)&&!vde.includes(i)&&(r[i]=n[i].bind(n));return r}function yde(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 xde=typeof document<"u"?C.exports.useLayoutEffect:C.exports.useEffect,_de=["baseApiUrl","maxParallelImageRequests","workerClass","workerCount","workerUrl"];function bde(e,t){for(const n of _de)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 Ic=C.exports.createContext(null),wde={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"},a3=C.exports.forwardRef((e,t)=>{const n=C.exports.useContext(i3),[r,i]=C.exports.useState(null),l=C.exports.useRef(),{current:c}=C.exports.useRef({mapLib:null,map:null});C.exports.useEffect(()=>{const h=e.mapLib;let p=!0,g;return Promise.resolve(h||lde(()=>import("./index.764e1a39.js").then(b=>b.i),[])).then(b=>{if(!!p){if(b.Map||(b=b.default),!b||!b.Map)throw new Error("Invalid mapLib");if(b.supported(e))bde(b,e),e.reuseMaps&&(g=tf.reuse(e,l.current)),g||(g=new tf(b.Map,e,l.current)),c.map=gde(g,b),c.mapLib=b,i(g),n==null||n.onMapMount(c.map,e.id);else throw new Error("Map is not supported by this browser")}}).catch(b=>{e.onError({type:"error",target:null,originalEvent:null,error:b})}),()=>{p=!1,g&&(n==null||n.onMapUnmount(e.id),e.reuseMaps?g.recycle():g.destroy())}},[]),xde(()=>{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 E("div",{id:e.id,ref:l,style:o,children:r&&E(Ic.Provider,{value:c,children:E("div",{"mapboxgl-children":"",children:e.children})})})});a3.displayName="Map";a3.defaultProps=wde;const Cde=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function Mc(e,t){if(!e||!t)return;const n=e.style;for(const r in t){const i=t[r];Number.isFinite(i)&&!Cde.test(r)?n[r]=`${i}px`:n[r]=i}}const Sde={draggable:!1,popup:null,rotation:0,rotationAlignment:"auto",pitchAlignment:"auto"};function o9(e){const{map:t,mapLib:n}=C.exports.useContext(Ic),r=C.exports.useRef({props:e});r.current.props=e;const i=C.exports.useMemo(()=>{let l=!1;C.exports.Children.forEach(e.children,h=>{h&&(l=!0)});const c={...e,element:l?document.createElement("div"):null},o=new n.Marker(c).setLngLat([e.longitude,e.latitude]);return o.getElement().addEventListener("click",h=>{var p,g;(g=(p=r.current.props).onClick)===null||g===void 0||g.call(p,{type:"click",target:o,originalEvent:h})}),o.on("dragstart",h=>{var p,g;const b=h;b.lngLat=i.getLngLat(),(g=(p=r.current.props).onDragStart)===null||g===void 0||g.call(p,b)}),o.on("drag",h=>{var p,g;const b=h;b.lngLat=i.getLngLat(),(g=(p=r.current.props).onDrag)===null||g===void 0||g.call(p,b)}),o.on("dragend",h=>{var p,g;const b=h;b.lngLat=i.getLngLat(),(g=(p=r.current.props).onDragEnd)===null||g===void 0||g.call(p,b)}),o},[]);return C.exports.useEffect(()=>(i.addTo(t.getMap()),()=>{i.remove()}),[]),C.exports.useEffect(()=>{Mc(i.getElement(),e.style)},[e.style]),(i.getLngLat().lng!==e.longitude||i.getLngLat().lat!==e.latitude)&&i.setLngLat([e.longitude,e.latitude]),e.offset&&!fde(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),uu.exports.createPortal(e.children,i.getElement())}o9.defaultProps=Sde;C.exports.memo(o9);function XT(e){return new Set(e?e.trim().split(/\s+/):[])}function Ede(e){const{map:t,mapLib:n}=C.exports.useContext(Ic),r=C.exports.useMemo(()=>document.createElement("div"),[]),i=C.exports.useRef({props:e});i.current.props=e;const l=C.exports.useMemo(()=>{const c={...e},o=new n.Popup(c).setLngLat([e.longitude,e.latitude]);return o.once("open",h=>{var p,g;(g=(p=i.current.props).onOpen)===null||g===void 0||g.call(p,h)}),o},[]);if(C.exports.useEffect(()=>{const c=o=>{var h,p;(p=(h=i.current.props).onClose)===null||p===void 0||p.call(h,o)};return l.on("close",c),l.setDOMContent(r).addTo(t.getMap()),()=>{l.off("close",c),l.isOpen()&&l.remove()}},[]),C.exports.useEffect(()=>{Mc(l.getElement(),e.style)},[e.style]),l.isOpen()&&((l.getLngLat().lng!==e.longitude||l.getLngLat().lat!==e.latitude)&&l.setLngLat([e.longitude,e.latitude]),e.offset&&!ya(l.options.offset,e.offset)&&l.setOffset(e.offset),(l.options.anchor!==e.anchor||l.options.maxWidth!==e.maxWidth)&&(l.options.anchor=e.anchor,l.setMaxWidth(e.maxWidth)),l.options.className!==e.className)){const c=XT(l.options.className),o=XT(e.className);for(const h of c)o.has(h)||l.removeClassName(h);for(const h of o)c.has(h)||l.addClassName(h);l.options.className=e.className}return uu.exports.createPortal(e.children,r)}const kde=C.exports.memo(Ede);function mm(e,t,n,r){const i=C.exports.useContext(Ic),l=C.exports.useMemo(()=>e(i),[]);return C.exports.useEffect(()=>{const c=r||n||t,o=typeof t=="function"&&typeof n=="function"?t:null,h=typeof n=="function"?n:typeof t=="function"?t:null,{map:p}=i;return p.hasControl(l)||(p.addControl(l,c==null?void 0:c.position),o&&o(i)),()=>{h&&h(i),p.hasControl(l)&&p.removeControl(l)}},[]),l}function Tde(e){const t=mm(({mapLib:n})=>new n.AttributionControl(e),{position:e.position});return C.exports.useEffect(()=>{Mc(t._container,e.style)},[e.style]),null}C.exports.memo(Tde);function Pde(e){const t=mm(({mapLib:n})=>new n.FullscreenControl({container:e.containerId&&document.getElementById(e.containerId)}),{position:e.position});return C.exports.useEffect(()=>{Mc(t._controlContainer,e.style)},[e.style]),null}C.exports.memo(Pde);const a9=C.exports.forwardRef((e,t)=>{const n=C.exports.useRef({props:e}),r=mm(({mapLib:i})=>{const l=new i.GeolocateControl(e),c=l._setupUI;return l._setupUI=o=>{l._container.hasChildNodes()||c(o)},l.on("geolocate",o=>{var h,p;(p=(h=n.current.props).onGeolocate)===null||p===void 0||p.call(h,o)}),l.on("error",o=>{var h,p;(p=(h=n.current.props).onError)===null||p===void 0||p.call(h,o)}),l.on("outofmaxbounds",o=>{var h,p;(p=(h=n.current.props).onOutOfMaxBounds)===null||p===void 0||p.call(h,o)}),l.on("trackuserlocationstart",o=>{var h,p;(p=(h=n.current.props).onTrackUserLocationStart)===null||p===void 0||p.call(h,o)}),l.on("trackuserlocationend",o=>{var h,p;(p=(h=n.current.props).onTrackUserLocationEnd)===null||p===void 0||p.call(h,o)}),l},{position:e.position});return n.current.props=e,C.exports.useImperativeHandle(t,()=>({trigger:()=>r.trigger()}),[]),C.exports.useEffect(()=>{Mc(r._container,e.style)},[e.style]),null});a9.displayName="GeolocateControl";C.exports.memo(a9);function Ide(e){const t=mm(({mapLib:n})=>new n.NavigationControl(e),{position:e.position});return C.exports.useEffect(()=>{Mc(t._container,e.style)},[e.style]),null}C.exports.memo(Ide);const Mde={unit:"metric",maxWidth:100};function s9(e){const t=mm(({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(()=>{Mc(t._container,e.style)},[e.style]),null}s9.defaultProps=Mde;C.exports.memo(s9);function jy(e,t){if(!e)throw new Error(t)}let Rde=0;function Ade(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 Ode(e,t,n){jy(t.id===n.id,"source id changed"),jy(t.type===n.type,"source type changed");let r="",i=0;for(const c in t)c!=="children"&&c!=="id"&&!ya(n[c],t[c])&&(r=c,i++);if(!i)return;const l=t.type;if(l==="geojson")e.setData(t.data);else if(l==="image")e.updateImage({url:t.url,coordinates:t.coordinates});else if((l==="canvas"||l==="video")&&i===1&&r==="coordinates")e.setCoordinates(t.coordinates);else if(l==="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 ap(e){const t=C.exports.useContext(Ic).map.getMap(),n=C.exports.useRef(e),[,r]=C.exports.useState(0),i=C.exports.useMemo(()=>e.id||`jsx-source-${Rde++}`,[]);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 h=(o=t.getStyle())===null||o===void 0?void 0:o.layers;if(h)for(const p of h)p.source===i&&t.removeLayer(p.id);t.removeSource(i)}}}},[t]);let l=t&&t.style&&t.getSource(i);return l?Ode(l,e,n.current):l=Ade(t,i,e),n.current=e,l&&C.exports.Children.map(e.children,c=>c&&C.exports.cloneElement(c,{source:i}))||null}function Nde(e,t,n,r){if(jy(n.id===r.id,"layer id changed"),jy(n.type===r.type,"layer type changed"),n.type==="custom"||r.type==="custom")return;const{layout:i={},paint:l={},filter:c,minzoom:o,maxzoom:h,beforeId:p}=n;if(p!==r.beforeId&&e.moveLayer(t,p),i!==r.layout){const g=r.layout||{};for(const b in i)ya(i[b],g[b])||e.setLayoutProperty(t,b,i[b]);for(const b in g)i.hasOwnProperty(b)||e.setLayoutProperty(t,b,void 0)}if(l!==r.paint){const g=r.paint||{};for(const b in l)ya(l[b],g[b])||e.setPaintProperty(t,b,l[b]);for(const b in g)l.hasOwnProperty(b)||e.setPaintProperty(t,b,void 0)}ya(c,r.filter)||e.setFilter(t,c),(o!==r.minzoom||h!==r.maxzoom)&&e.setLayerZoomRange(t,o,h)}function Dde(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 Lde=0;function tu(e){const t=C.exports.useContext(Ic).map.getMap(),n=C.exports.useRef(e),[,r]=C.exports.useState(0),i=C.exports.useMemo(()=>e.id||`jsx-layer-${Lde++}`,[]);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{Nde(t,i,e,n.current)}catch(c){console.warn(c)}else Dde(t,i,e);return n.current=e,null}const zde=e=>({updateCounter:-1,toggleUpdateCounter:()=>{e(t=>{t.updateCounter=t.updateCounter===-1?1:-1})}}),l9=mu(vu(zde)),s3=({onSuccess:e})=>{const{toggleUpdateCounter:t}=l9();return cce({mutationFn:n=>Jo.put(`/api/placement_points/update_status?${n.toString()}`),onSuccess:()=>{t(),e()}})},Fde=()=>{const{filters:e}=Oi(),{prediction:t,categories:n,region:r}=e,{selection:i}=xs(),l=hm(),[c,o]=C.exports.useState(!1),{mutate:h}=s3({onSuccess:()=>{l.invalidateQueries(["table",1,e]),o(!0)}});return Qe($n,{children:[Qe(Br,{type:"primary",block:!0,className:"mt-2",onClick:()=>{const g=new URLSearchParams({status:Fr.approve,"prediction_current[]":t,"categories[]":n,"included[]":[...i.included],"excluded[]":[...i.excluded]});r&&(r.type==="ao"&&g.append("ao[]",r.id),r.type==="rayon"&&g.append("rayon[]",r.id)),h(g)},children:[E("span",{className:"mr-1",children:" \u0412\u0437\u044F\u0442\u044C \u0432 \u0440\u0430\u0431\u043E\u0442\u0443"}),E(oN,{})]}),E(KY,{title:" ",centered:!0,open:c,footer:[E(Br,{type:"primary",onClick:()=>o(!1),children:"\u0425\u043E\u0440\u043E\u0448\u043E"},"ok-button")],children:E(R0,{message:"\u0423\u0441\u043F\u0435\u0448\u043D\u043E",description:"\u0412\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u0442\u043E\u0447\u043A\u0438 \u043E\u0442\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u044B \u043D\u0430 \u0441\u043E\u0433\u043B\u0430\u0441\u043E\u0432\u0430\u043D\u0438\u0435. \u041F\u043E\u0441\u043C\u043E\u0442\u0440\u0435\u0442\u044C \u043D\u0430 \u043D\u0438\u0445 \u043C\u043E\u0436\u043D\u043E \u0432\u043E \u0432\u0442\u043E\u0440\u043E\u0439 \u0432\u043A\u043B\u0430\u0434\u043A\u0435",type:"success",showIcon:!0})})]})};function $de(){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 d9="!";function Wde(e){var t=e.separator||":";return function(r){for(var i=0,l=[],c=0,o=0;oE("div",{className:bc("mb-1",t),children:E(dfe,{type:"secondary",className:bc("uppercase text-xs",n),children:e})});function ffe(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 hfe(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?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),{}):{},mfe=({disabled:e})=>{const{map:t}=o3(),{filters:{region:n},setRegion:r}=Oi(),[i,l]=C.exports.useState([]),c=C.exports.useMemo(()=>pfe(i),[i]),[o,h]=C.exports.useState(!1);C.exports.useEffect(()=>{(async()=>{h(!0);try{const w=await Jo.get("/api/ao_rayons");l(w.data)}catch(w){console.error(w)}finally{h(!1)}})()},[]);const p=b=>{if(!b)return;const w=c[b],P=Cf.exports(w.polygon),I=hfe(P.coordinates[0]),A=Tw(I);r({id:b,geometry:I,type:w.type}),t.fitBounds([[A[0],A[1]],[A[2],A[3]]],{padding:20})},g=()=>r(null);return Qe("div",{children:[E(gu,{text:"\u0410\u041E / \u0440\u0430\u0439\u043E\u043D"}),E(WO,{showSearch:!0,style:{width:"100%"},value:n==null?void 0:n.id,dropdownStyle:{maxHeight:400,overflow:"auto"},placeholder:"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0410\u041E \u0438\u043B\u0438 \u0440\u0430\u0439\u043E\u043D",allowClear:!0,treeDefaultExpandAll:!1,onChange:p,loading:o,treeNodeFilterProp:"title",onClear:g,notFoundContent:E(ss,{image:ss.PRESENTED_IMAGE_SIMPLE,description:"\u041D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E"}),disabled:e,children:i==null?void 0:i.map(b=>{var w;return E(nP,{value:b.id,title:b.name,children:(w=b.rayons)==null?void 0:w.map(P=>E(nP,{value:P.id,title:P.name},P.id))},b.id)})})]})},vfe=Object.entries(qN).map(([e,t])=>({value:t,label:t})),gfe=({disabled:e})=>{const{filters:t,setCategories:n}=Oi();return Qe("div",{children:[E(gu,{text:"\u041A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u0438"}),E(tl,{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:vfe,allowClear:!0,value:t.categories,disabled:e})]})},Vs=({value:e})=>E("span",{className:"text-grey text-xs",children:e}),rP=(e,t)=>{if(Array.isArray(t)){const[n,r]=t;return{...e,[n]:E(Vs,{value:n}),[r]:E(Vs,{value:r})}}else return{...e,[t]:E(Vs,{value:t})}},d1=({title:e,value:t,onChange:n,onAfterChange:r,min:i=0,max:l=100,range:c=!1,step:o=1,disabled:h=!1,onMouseEnter:p,onMouseLeave:g,showZeroMark:b=!1})=>{const w={[i]:E(Vs,{value:i}),[l]:E(Vs,{value:l})},[P,I]=C.exports.useState(t),[A,O]=C.exports.useState(rP(w,t));C.exports.useEffect(()=>{I(t),O(rP(w,t))},[t]);const M=z=>{if(Array.isArray(z)){const[B,U]=z;O({...w,[B]:E(Vs,{value:B}),[U]:E(Vs,{value:U})})}else O({...w,[z]:E(Vs,{value:z})});r==null||r(z)},R=z=>{I(z),n==null||n(z)},N=b?{...A,0:E(Vs,{value:0})}:A;return Qe("div",{onMouseEnter:p,onMouseLeave:g,children:[E(gu,{text:e}),E(TQ,{range:c,value:P,marks:N,onChange:R,onAfterChange:M,min:i,max:l,step:o,disabled:h})]})},yfe=({disabled:e,fullRange:t})=>{const{filters:{prediction:n},setPrediction:r}=Oi(),i=l=>r(l);return C.exports.useEffect(()=>{if(!t)return;const l=t.prediction_current[0],c=t.prediction_current[1];n[0]===rl.prediction[0]&&n[1]===rl.prediction[1]&&r([l,c])},[t]),E(d1,{title:"\u041F\u0440\u043E\u0433\u043D\u043E\u0437\u043D\u044B\u0439 \u0442\u0440\u0430\u0444\u0438\u043A",value:n,onAfterChange:i,min:t==null?void 0:t.prediction_current[0],max:t==null?void 0:t.prediction_current[1],range:!0,disabled:e})},xfe=e=>({mode:Yr.INITIAL,setMode:t=>{e(n=>{n.mode=t})}}),yu=mu(vu(xfe)),_fe=({fullRange:e})=>{const{filters:{deltaTraffic:t},setDeltaTraffic:n}=Oi(),r=i=>n(i);return C.exports.useEffect(()=>{if(!e)return;const i=e.delta_current[0],l=e.delta_current[1];t[0]===rl.deltaTraffic[0]&&t[1]===rl.deltaTraffic[1]&&n([i,l])},[e,t]),E(d1,{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==null?void 0:e.delta_current[0],max:e==null?void 0:e.delta_current[1],range:!0,showZeroMark:!0})},bfe=({fullRange:e})=>{const{filters:{factTraffic:t},setFactTraffic:n}=Oi(),r=i=>n(i);return C.exports.useEffect(()=>{if(!e)return;const i=e.fact[0],l=e.fact[1];t[0]===rl.factTraffic[0]&&t[1]===rl.factTraffic[1]&&n([i,l])},[e,t]),E(d1,{title:"\u0424\u0430\u043A\u0442\u0438\u0447\u0435\u0441\u043A\u0438\u0439 \u0442\u0440\u0430\u0444\u0438\u043A",value:t,onAfterChange:r,min:e==null?void 0:e.fact[0],max:e==null?void 0:e.fact[1],range:!0})},wfe=({fullRange:e})=>{const{filters:{age:t},setAge:n}=Oi(),r=i=>n(i);return C.exports.useEffect(()=>{if(!e)return;const i=e.age_day[0],l=e.age_day[1];t[0]===rl.age[0]&&t[1]===rl.age[1]&&n([i,l])},[e,t]),E(d1,{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==null?void 0:e.age_day[0],max:e==null?void 0:e.age_day[1],range:!0})},Cfe=({disabled:e})=>{const[t,n]=C.exports.useState(!1),{mode:r}=yu();C.exports.useEffect(()=>{const o=setTimeout(()=>n(!1),1500);return()=>clearTimeout(o)},[t]);const{data:i}=Sa(["max-min"],async()=>{const{data:o}=await Jo.get("/api/placement_points/filters/");return o});return E(oo,{title:fce,placement:"right",open:e&&t,onMouseEnter:()=>{n(!0)},onMouseLeave:()=>{n(!1)},children:Qe("div",{className:"space-y-5",children:[E(mfe,{disabled:e}),r===Yr.INITIAL&&Qe($n,{children:[E(gfe,{disabled:e}),E(yfe,{disabled:e,fullRange:i})]}),r===Yr.WORKING&&Qe("div",{className:"space-y-12",children:[E(_fe,{fullRange:i}),E(bfe,{fullRange:i}),E(wfe,{fullRange:i})]})]})})},g9=({width:e=40,height:t=40})=>E("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:t,children:Qe("g",{children:[E("polygon",{style:{fill:"#3B555E"},points:"19.6,24 21.4,24 22.5,23.9 23,23.8 23.5,23.4 23.8,22.9 24,22.3 24,20.4 24,1.9 23.9,1.4 23.6,0.8 23.3,0.4 22.9,0.1 22.3,0 14.2,0 8.9,0 11.2,4.6 19.5,4.5 19.6,4.5 "}),E("polygon",{style:{fill:"#E63941"},points:"13.6,6.4 17.7,6.4 16.2,9.4 14.1,14.2 12.3,18.4 11.7,18.4 9.8,14.5 6.8,8.8 4.5,4.5 4.7,23.9 1.7,24 1,23.8 0.5,23.2 0.2,22.7 0,22.1 0,1.8 0.1,1.3 0.4,0.8 0.8,0.4 1.1,0.2 1.4,0.1 2,0.1 7,0.1 11.9,10.6 "})]})}),Sfe=({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:[E("polygon",{className:"ai-st0",points:"11.4,3.1 11.4,4.6 11.4,17.8 11.1,18.6 10.9,19.2 10.4,19.8 9.9,20.1 9.2,20.3 8.6,20.3 8.2,20.3 7.6,20.3 7,19.8 6.6,19.3 6.2,18.7 5.4,18.7 4.9,18.4 4.4,18 4.1,17.6 3.9,17.1 3.9,16 3.4,15.4 3,14.9 2,13.4 1.8,12.6 1.4,11.8 1.4,9.9 1.4,9 1.9,8.3 2.5,7.7 3,7.3 2.9,6.5 2.8,5.7 3,5.1 3.4,4.7 4.1,4.3 5,4.1 5.6,4 5.6,3.3 5.8,2.7 6.4,1.9 7,1.3 7.6,1.1 8.4,0.9 8.9,0.9 9.4,1.1 10.1,1.5 10.8,2.1 "}),E("polyline",{className:"ai-st0",points:"17.4,3 16.1,4.7 11.5,4.6 "}),E("polyline",{className:"ai-st0",points:"11.2,8.7 16,8.6 19.8,12.3 "}),E("line",{className:"ai-st0",x1:"11.2",y1:"12.2",x2:"13.4",y2:"12.2"}),E("polyline",{className:"ai-st0",points:"11.4,16.6 14.8,16.6 16.4,18.2 "}),Qe("g",{children:[E("circle",{className:"ai-st1",cx:"18.1",cy:"2",r:"1.9"}),E("circle",{className:"ai-st2",cx:"18.1",cy:"1.9",r:"1.1"})]}),Qe("g",{children:[E("circle",{className:"ai-st1",cx:"18.5",cy:"6.5",r:"1.9"}),E("circle",{className:"ai-st2",cx:"18.5",cy:"6.4",r:"1.1"})]}),Qe("g",{children:[E("circle",{className:"ai-st1",cx:"20.8",cy:"13.3",r:"1.9"}),E("circle",{className:"ai-st2",cx:"20.9",cy:"13.3",r:"1.1"})]}),Qe("g",{children:[E("circle",{className:"ai-st1",cx:"15",cy:"12.2",r:"1.9"}),E("circle",{className:"ai-st2",cx:"15",cy:"12.1",r:"1.1"})]}),Qe("g",{children:[E("circle",{className:"ai-st1",cx:"17.4",cy:"19.2",r:"1.9"}),E("circle",{className:"ai-st2",cx:"17.4",cy:"19.2",r:"1.1"})]}),Qe("g",{children:[E("circle",{className:"ai-st1",cx:"13",cy:"22",r:"1.9"}),E("circle",{className:"ai-st2",cx:"13.1",cy:"22",r:"1.1"})]}),E("polyline",{className:"ai-st0",points:"5.9,8.1 4.5,9.5 4.4,11.2 4.8,12.4 6.5,14.8 "})]});const Efe=({width:e=24,height:t=24})=>Qe("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"-293 385 24 24",width:e,height:t,className:"ml-[2px] mt-[2px]",children:[E("polyline",{className:"approve-st0",points:"-273.7,390.2 -273.7,388.3 -274,387.5 -274.7,387 -275.8,387 -290.4,387 -291.1,387.2 -291.8,387.6 -292.2,388.3 -292.3,403.6 -292.2,404.4 -291.9,404.9 -291.3,405.2 -290.8,405.3 -275.9,405.3 -275.1,405.2 -274.3,404.9 -273.8,404.3 -273.8,402.3 "}),E("path",{className:"approve-st1",d:"M-287.2,397h-1.2c-0.4,0-0.7-0.3-0.7-0.7v-1.2c0-0.4,0.3-0.7,0.7-0.7h1.2c0.4,0,0.7,0.3,0.7,0.7v1.2 C-286.6,396.7-286.9,397-287.2,397z"}),E("path",{className:"approve-st1",d:"M-287.2,400.5h-1.2c-0.4,0-0.7-0.3-0.7-0.7v-1.2c0-0.4,0.3-0.7,0.7-0.7h1.2c0.4,0,0.7,0.3,0.7,0.7v1.2 C-286.5,400.2-286.8,400.5-287.2,400.5z"}),E("polygon",{className:"approve-st2",points:"-288.7,390.7 -288.3,391.2 -288.2,391.3 -288,391.3 -287.6,391.2 -287.2,390.7 -286.7,390.3 -286.5,390.3 -286.2,390.3 -286,390.5 -285.9,390.9 -286,391.1 -286.4,391.6 -287.9,392.9 -288.1,392.9 -288.3,392.9 -288.6,392.6 -289.6,391.6 -289.8,391.4 -289.8,391 -289.6,390.7 -289.4,390.6 -289.1,390.5 -288.9,390.5 "}),E("polygon",{className:"approve-st3",points:"-283.9,390.9 -279.1,390.9 -278.8,391.1 -278.7,391.3 -278.6,391.8 -278.7,392 -279,392.4 -279.2,392.5 -279.6,392.5 -284,392.5 -284.2,392.5 -284.5,392.3 -284.7,391.9 -284.7,391.7 -284.6,391.5 -284.3,391.1 -284.1,390.9 "}),E("polygon",{className:"approve-st3",points:"-284,394.4 -280,394.4 -279.8,394.6 -279.7,394.8 -279.6,395.2 -279.7,395.5 -279.9,395.9 -280.1,396 -280.4,396 -284.1,396 -284.3,395.9 -284.5,395.7 -284.7,395.4 -284.7,395.2 -284.6,394.9 -284.4,394.6 -284.2,394.4 "}),E("polygon",{className:"approve-st3",points:"-284.1,397.9 -280.9,397.9 -280.7,398.1 -280.6,398.3 -280.6,398.7 -280.6,399 -280.8,399.4 -280.9,399.5 -281.2,399.5 -284.2,399.5 -284.3,399.4 -284.5,399.2 -284.7,398.9 -284.7,398.7 -284.6,398.4 -284.4,398.1 -284.3,397.9 "}),E("polygon",{className:"approve-st2",points:"-274.2,391.7 -273.4,391.6 -273.1,391.7 -273,392.7 -272.6,392.8 -272.1,393 -271.6,393.2 -271.1,392.6 -270.7,392.8 -270.4,393.1 -270.1,393.5 -270,393.7 -270.6,394.2 -270.5,394.6 -270.4,394.9 -270.3,395.4 -269.5,395.4 -269.4,395.7 -269.4,396.2 -269.4,396.4 -269.6,396.7 -269.6,396.9 -270.4,396.8 -270.5,397.3 -270.6,397.7 -270.8,397.9 -270.1,398.6 -270.3,398.9 -270.6,399.2 -271.1,399.5 -271.2,399.6 -271.7,399 -271.7,398.9 -272.1,399 -272.4,399.1 -272.8,399.2 -273,399.3 -273,400 -273.2,400.2 -274.2,400.2 -274.4,400 -274.4,399.3 -274.4,399.1 -275,398.9 -275.5,398.7 -275.9,399.4 -276.2,399.5 -276.5,399.3 -277.1,398.8 -277,398.5 -276.4,397.9 -276.8,397.5 -276.9,397.2 -277.1,396.8 -277.9,396.8 -278,396.3 -278,395.6 -277.8,395.3 -277,395.3 -276.7,394.6 -276.6,394.2 -276.9,393.9 -277.1,393.6 -277.2,393.5 -277.1,393.2 -276.7,392.7 -276.5,392.6 -276.2,392.7 -275.4,393.2 -275.1,392.9 -274.7,392.8 -274.5,392.7 -274.5,391.8 "}),E("circle",{className:"approve-st4",cx:"-273.8",cy:"396",r:"1.8"})]}),kfe=({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:[E("path",{className:"working-st0",d:"M-279.1,402.7"}),E("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 "}),E("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 "}),E("circle",{className:"working-st3",cx:"-277",cy:"397.6",r:"4.6"}),E("circle",{className:"working-st4",cx:"-277.1",cy:"397.5",r:"2.9"}),E("polygon",{className:"working-st3",points:"-270.9,405.7 -269,403.8 -273.5,399.6 -275.4,401 "})]}),y9=()=>{const{mode:e,setMode:t}=yu(),n=i=>{t(i)},r=i=>i===e?"primary":"default";return Qe($n,{children:[E(oo,{title:"\u041E\u0442\u0431\u043E\u0440 \u043B\u043E\u043A\u0430\u0446\u0438\u0439 \u0434\u043B\u044F \u0440\u0430\u0431\u043E\u0442\u044B",children:E(Br,{icon:E(Sfe,{}),type:r(Yr.INITIAL),onClick:()=>n(Yr.INITIAL),className:"flex items-center justify-center",size:"large"})}),E(oo,{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:E(Br,{icon:E(Efe,{}),type:r(Yr.APPROVE_WORKING),onClick:()=>n(Yr.APPROVE_WORKING),className:"flex items-center justify-center",size:"large"})}),E(oo,{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:E(Br,{icon:E(kfe,{}),type:r(Yr.WORKING),onClick:()=>n(Yr.WORKING),className:"flex items-center justify-center",size:"large"})})]})},Tfe=()=>Qe("div",{className:"mb-4 flex items-center justify-between",children:[E(g9,{}),E("div",{className:"flex items-center gap-x-3",children:E(y9,{})})]}),Pfe=()=>{const{data:e,isInitialLoading:t}=Hce(),{data:n,isInitialLoading:r}=Wce(),i=t||r,{selection:{excluded:l}}=xs();return Qe("div",{className:"flex items-center justify-between",children:[E("span",{children:"\u041E\u0442\u043E\u0431\u0440\u0430\u043D\u043E \u043B\u043E\u043A\u0430\u0446\u0438\u0439"}),i?E(P4,{}):E("span",{children:`${n-l.size} / ${e}`})]})},Ife={[mr.initial]:!0,[mr.approve]:!1,[mr.working]:!1},Mfe=e=>({isVisible:Ife,toggleVisibility:t=>e(n=>{n.isVisible[t]=!n.isVisible[t]}),setLayersVisibility:t=>e(n=>{t.visible.forEach(r=>{n.isVisible[r]=!0}),t.invisible.forEach(r=>{n.isVisible[r]=!1})})}),Sf=mu(vu(Mfe)),Rfe=C.exports.forwardRef(({isCollapsed:e},t)=>{const n=Kce(),{mode:r}=yu(),{reset:i}=xs(),{isVisible:l,toggleVisibility:c}=Sf();return Qe("div",{className:bc("h-screen p-3 overflow-y-auto shrink-0 border-solid border-border border-0 border-r-[1px] flex flex-col transition-all",e?"basis-0 p-0 -translate-x-[320px]":"basis-[320px] p-3"),ref:t,children:[E(Tfe,{}),Qe("div",{className:"space-y-5 flex flex-col justify-between flex-1",children:[Qe("div",{children:[E(Cfe,{disabled:n}),r===Yr.APPROVE_WORKING&&Qe("div",{className:"mt-4",children:[E(gu,{text:"\u0421\u0442\u0430\u0442\u0443\u0441\u044B"}),Qe("div",{className:"space-y-2",children:[E(xc,{onChange:()=>c(mr.approve),checked:l[mr.approve],children:"\u0421\u043E\u0433\u043B\u0430\u0441\u043E\u0432\u0430\u043D\u0438\u0435-\u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0430"}),E(xc,{className:"!ml-0",onChange:()=>c(mr.working),checked:l[mr.working],children:"\u0420\u0430\u0431\u043E\u0442\u0430\u0435\u0442"})]})]}),r===Yr.INITIAL&&n?E(Br,{block:!0,className:"mt-2",onClick:i,children:"\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C \u0440\u0443\u0447\u043D\u043E\u0435 \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435"}):null]}),E("div",{children:r===Yr.INITIAL&&Qe($n,{children:[E(Pfe,{}),E(Fde,{})]})})]})]})}),Afe=5,Ofe=3,Nfe="#CC2222",Dfe="#CC2222",x9="#ff7d00",_9="#006e01",Lfe="#b4b4b4",iP={type:"circle",paint:{"circle-stroke-width":.4,"circle-stroke-color":"#fff","circle-opacity":.8}},vm=(e=Nfe,t=Afe)=>({...iP,paint:{...iP.paint,"circle-color":e,"circle-radius":t}}),Oh=vm(),zfe=vm(Lfe,Ofe),Ffe=vm(x9),$fe=vm(_9);vm(Dfe);const b9="#676767",oP={id:"ao",type:"line",source:"ao","source-layer":"public.service_ao",layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":b9,"line-width":1.5,"line-opacity":.8}},aP={id:"rayon",type:"line",source:"rayon","source-layer":"public.service_rayon",layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":b9,"line-width":.5,"line-opacity":.8}},sP={id:"selected-region",type:"line",source:"selected-region",layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":"#CC2222","line-width":4}},Bfe={ao:"okrug_id",rayon:"rayon_id"},u3=()=>{const{filters:{region:e}}=Oi();return C.exports.useMemo(()=>e?["==",["get",Bfe[e.type]],e.id]:null,[e])},lP=["==",["get","status"],Fr.initial],Vfe=()=>{const{filters:e}=Oi(),{prediction:t,categories:n,region:r}=e,{selection:i}=xs(),l=[...i.included],c=[...i.excluded],o=u3(),h=["in",["get","location_id"],["literal",l]],p=["in",["get","location_id"],["literal",c]],g=[[">=",["get","prediction_current"],t[0]],["<=",["get","prediction_current"],t[1]]],b=n.length>0?["in",["get","category"],["literal",n]]:!0,w=["all",lP,["!",p],["any",r?["all",...g,b,o]:["all",...g,b],h]],P=["all",lP,["!",h],["any",["!",r?["all",...g,b,o]:["all",...g,b]],p]];return{match:w,unmatch:P}},Ufe=()=>{const{isVisible:e}=Sf(),{match:t,unmatch:n}=Vfe();return Qe($n,{children:[E(tu,{...Oh,id:mr["initial-unmatch"],source:"points","source-layer":"public.service_placementpoint",layout:{...Oh.layout,visibility:e[mr.initial]?"visible":"none"},filter:n,paint:zfe.paint}),E(tu,{...Oh,id:mr["initial-match"],source:"points","source-layer":"public.service_placementpoint",layout:{...Oh.layout,visibility:e[mr.initial]?"visible":"none"},filter:t,paint:Oh.paint})]})},uP=["==",["get","status"],Fr.approve],jfe=()=>{const{isVisible:e}=Sf(),t=u3(),n=t?["all",uP,t]:uP;return E($n,{children:E(tu,{...Ffe,id:mr.approve,source:"points","source-layer":"public.service_placementpoint",layout:{visibility:e[mr.approve]?"visible":"none"},filter:n})})},cP=["==",["get","status"],Fr.working],Kfe=()=>{const{isVisible:e}=Sf(),t=u3(),{filters:{deltaTraffic:n,factTraffic:r,age:i}}=Oi(),l=[[">=",["get","delta_current"],n[0]],["<=",["get","delta_current"],n[1]]],c=[[">=",["get","fact"],r[0]],["<=",["get","fact"],r[1]]],o=[[">=",["get","age_day"],i[0]],["<=",["get","age_day"],i[1]]],h=t?["all",cP,...l,...c,...o,t]:["all",cP,...l,...c,...o];return E($n,{children:E(tu,{...$fe,id:mr.working,source:"points","source-layer":"public.service_placementpoint",layout:{visibility:e[mr.working]?"visible":"none"},filter:h})})},Hfe=()=>{const{updateCounter:e}=l9();return E($n,{children:Qe(ap,{id:"points",type:"vector",tiles:[`${Uy}/martin/public.service_placementpoint/{z}/{x}/{y}.pbf`],children:[E(Ufe,{}),E(jfe,{}),E(Kfe,{})]},`points-${e}`)})},Wfe=()=>{const{filters:{prediction:e,region:t}}=Oi();return Qe($n,{children:[E(ap,{id:"ao",type:"vector",tiles:[`${Uy}/martin/public.service_ao/{z}/{x}/{y}.pbf`],children:E(tu,{...oP,layout:{...oP.layout}})}),E(ap,{id:"rayon",type:"vector",tiles:[`${Uy}/martin/public.service_rayon/{z}/{x}/{y}.pbf`],children:E(tu,{...aP,layout:{...aP.layout}})}),t&&t.geometry&&E(ap,{id:"selected-region",type:"geojson",data:t.geometry,children:E(tu,{...sP,layout:{...sP.layout,visibility:t?"visible":"none"}})}),E(Hfe,{prediction:e})]})},Gfe=({lat:e,lng:t,onClose:n,children:r})=>E(kde,{longitude:t,latitude:e,onClose:n,closeOnClick:!1,style:{minWidth:"300px"},children:r}),qfe=e=>({clickedPointConfig:null,setClickedPointConfig:(t,n=!0)=>{e(r=>{if(t===null)return r.clickedPointConfig=null,r;r.clickedPointConfig={id:t,shouldSelect:n}})}}),xu=mu(vu(qfe)),Zfe=[{name:"Id",field:"location_id"},{name:"\u0410\u0434\u0440\u0435\u0441",field:"address"},{name:"\u0420\u0430\u0439\u043E\u043D",field:"rayon_id"},{name:"\u041E\u043A\u0440\u0443\u0433",field:"okrug_id"},{name:"\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435",field:"name"},{name:"\u041A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044F",field:"category"},{name:"\u0421\u0442\u0430\u0442\u0443\u0441",field:"status"},{name:"\u041F\u0440\u043E\u0433\u043D\u043E\u0437\u043D\u044B\u0439 \u0442\u0440\u0430\u0444\u0438\u043A",field:"prediction_current"}],Xfe=[{name:"Id",field:"location_id"},{name:"\u0410\u0434\u0440\u0435\u0441",field:"address"},{name:"\u0420\u0430\u0439\u043E\u043D",field:"rayon_id"},{name:"\u041E\u043A\u0440\u0443\u0433",field:"okrug_id"},{name:"\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435",field:"name"},{name:"\u041A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044F",field:"category"},{name:"\u0421\u0442\u0430\u0442\u0443\u0441",field:"status"},{name:"\u041F\u0440\u043E\u0433\u043D\u043E\u0437\u043D\u044B\u0439 \u0442\u0440\u0430\u0444\u0438\u043A",field:"prediction_current"},{name:"\u041A\u043E\u043B-\u0432\u043E \u043A\u0432\u0430\u0440\u0442\u0438\u0440",field:"flat_cnt"},{name:"\u0413\u043E\u0434 \u043F\u043E\u0441\u0442\u0440\u043E\u0439\u043A\u0438",field:"year_bld"},{name:"\u041A\u043E\u043B-\u0432\u043E \u044D\u0442\u0430\u0436\u0435\u0439",field:"levels"},{name:"\u041C\u0430\u0442\u0435\u0440\u0438\u0430\u043B \u0441\u0442\u0435\u043D",field:"mat_nes"}],Yfe=[{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"}],c3=({feature:e,dynamicStatus:t})=>{const n=e.properties.category===qN.residential,r=e.properties.status===Fr.working,i=n?Xfe:Zfe,l=r?[...i,...Yfe]:i;return E("div",{children:l.map(({field:c,name:o})=>{const h=t&&c==="status"?t:e.properties[c];return Qe(lA,{className:bc("p-1"),children:[E(Py,{className:"font-semibold",span:12,children:o}),E(Py,{span:12,children:h})]},c)})})},Qfe=({feature:e})=>{const{include:t,selection:n,exclude:r}=xs(),{setClickedPointConfig:i}=xu(),l=e.layer.id===mr["initial-match"],c=e.properties.location_id;C.exports.useEffect(()=>i(c,l),[e]);const o=(l||n.included.has(c))&&!n.excluded.has(c);return Qe($n,{children:[E(c3,{feature:e}),E(Br,{type:"primary",className:"mt-2 mx-auto",block:!0,onClick:()=>{o?r(c):t(c)},children:o?"\u0418\u0441\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u0438\u0437 \u0432\u044B\u0431\u043E\u0440\u043A\u0438":"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0432 \u0432\u044B\u0431\u043E\u0440\u043A\u0443"})]})};let dP=e=>typeof e=="object"&&e!=null&&e.nodeType===1,fP=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",q_=(e,t)=>{if(e.clientHeight{let i=(l=>{if(!l.ownerDocument||!l.ownerDocument.defaultView)return null;try{return l.ownerDocument.defaultView.frameElement}catch{return null}})(r);return!!i&&(i.clientHeightlt||l>e&&c=t&&o>=n?l-e-r:c>t&&on?c-t+i:0,Jfe=e=>{let t=e.parentElement;return t==null?e.getRootNode().host||null:t},hP=(e,t)=>{var n,r,i,l;if(typeof document>"u")return[];let{scrollMode:c,block:o,inline:h,boundary:p,skipOverflowHiddenElements:g}=t,b=typeof p=="function"?p:J=>J!==p;if(!dP(e))throw new TypeError("Invalid target");let w=document.scrollingElement||document.documentElement,P=[],I=e;for(;dP(I)&&b(I);){if(I=Jfe(I),I===w){P.push(I);break}I!=null&&I===document.body&&q_(I)&&!q_(document.documentElement)||I!=null&&q_(I,g)&&P.push(I)}let A=(r=(n=window.visualViewport)==null?void 0:n.width)!=null?r:innerWidth,O=(l=(i=window.visualViewport)==null?void 0:i.height)!=null?l:innerHeight,{scrollX:M,scrollY:R}=window,{height:N,width:z,top:B,right:U,bottom:q,left:H}=e.getBoundingClientRect(),te=o==="start"||o==="nearest"?B:o==="end"?q:B+N/2,Y=h==="center"?H+z/2:h==="end"?U:H,le=[];for(let J=0;J=0&&H>=0&&q<=O&&U<=A&&B>=re&&q<=oe&&H>=ye&&U<=de)return le;let Re=getComputedStyle(Z),Te=parseInt(Re.borderLeftWidth,10),ke=parseInt(Re.borderTopWidth,10),De=parseInt(Re.borderRightWidth,10),Me=parseInt(Re.borderBottomWidth,10),Ne=0,Le=0,Ve="offsetWidth"in Z?Z.offsetWidth-Z.clientWidth-Te-De:0,qe="offsetHeight"in Z?Z.offsetHeight-Z.clientHeight-ke-Me:0,Ue="offsetWidth"in Z?Z.offsetWidth===0?0:ge/Z.offsetWidth:0,ct="offsetHeight"in Z?Z.offsetHeight===0?0:Q/Z.offsetHeight:0;if(w===Z)Ne=o==="start"?te:o==="end"?te-O:o==="nearest"?sg(R,R+O,O,ke,Me,R+te,R+te+N,N):te-O/2,Le=h==="start"?Y:h==="center"?Y-A/2:h==="end"?Y-A:sg(M,M+A,A,Te,De,M+Y,M+Y+z,z),Ne=Math.max(0,Ne+R),Le=Math.max(0,Le+M);else{Ne=o==="start"?te-re-ke:o==="end"?te-oe+Me+qe:o==="nearest"?sg(re,oe,Q,ke,Me+qe,te,te+N,N):te-(re+Q/2)+qe/2,Le=h==="start"?Y-ye-Te:h==="center"?Y-(ye+ge/2)+Ve/2:h==="end"?Y-de+De+Ve:sg(ye,de,ge,Te,De+Ve,Y,Y+z,z);let{scrollLeft:pt,scrollTop:Tt}=Z;Ne=Math.max(0,Math.min(Tt+Ne/ct,Z.scrollHeight-Q/ct+qe)),Le=Math.max(0,Math.min(pt+Le/Ue,Z.scrollWidth-ge/Ue+Ve)),te+=Tt-Ne,Y+=pt-Le}le.push({el:Z,top:Ne,left:Le})}return le},ehe=e=>typeof e=="object"&&typeof e.behavior=="function",the=e=>e===!1?{block:"end",inline:"nearest"}:(t=>t===Object(t)&&Object.keys(t).length!==0)(e)?e:{block:"start",inline:"nearest"};function nhe(e,t){if(!e.isConnected||!e.ownerDocument.documentElement.contains(e))return;if(ehe(t))return t.behavior(hP(e,t));let n=typeof t=="boolean"||t==null?void 0:t.behavior;for(let{el:r,top:i,left:l}of hP(e,the(t)))r.scroll({top:i,left:l,behavior:n})}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 d3=e=>{rhe("postamates.xlsx",e)},ihe=({provider:e})=>{const[t,n]=C.exports.useState(!1);return e(t,()=>n(!1)),E(oo,{title:"\u0421\u043A\u0430\u0447\u0430\u0442\u044C \u0434\u0430\u043D\u043D\u044B\u0435",children:E(Br,{onClick:i=>{i.stopPropagation(),n(!0)},loading:t,disabled:t,children:E(nle,{})})})},ohe={isOpened:!1,fullScreen:!1},ahe=e=>({tableState:ohe,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})}}),f3=mu(vu(ahe)),she=()=>{const{tableState:{fullScreen:e},toggleFullScreen:t}=f3();return E(oo,{title:"\u0420\u0430\u0441\u043A\u0440\u044B\u0442\u044C \u043D\u0430 \u043F\u043E\u043B\u043D\u044B\u0439 \u044D\u043A\u0440\u0430\u043D",placement:"topRight",children:E(Br,{onClick:r=>{r.stopPropagation(),t()},children:e?E(ole,{}):E(lle,{})})})},f1=({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:[E("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&&E(ihe,{provider:n}),E(she,{})]})]})]}),h3=tr.memo(({rowSelection:e,data:t,pageSize:n,isClickedPointLoading:r,page:i,onPageChange:l,columns:c,header:o,fullWidth:h,loading:p})=>{const{clickedPointConfig:g}=xu(),{map:b}=o3(),{tableState:w,toggleOpened:P}=f3(),I={y:w.fullScreen?"calc(100vh - 136px)":"200px",x:"max-content"};return C.exports.useEffect(()=>{if(g===null||r)return;const A=document.querySelector(".scroll-row");A&&nhe(A,{behavior:"smooth"})},[g,t]),E(B5,{bordered:!1,onChange:P,defaultActiveKey:w.isOpened?"opened":null,children:E(B5.Panel,{header:o||E(f1,{}),children:E(Rae,{size:"small",locale:{emptyText:E(ss,{description:"\u041D\u0435\u0442 \u0434\u0430\u043D\u043D\u044B\u0445"})},pagination:{pageSize:n,current:i,onChange:l,total:t==null?void 0:t.count,showSizeChanger:!1,position:"bottomCenter"},dataSource:t==null?void 0:t.results,columns:c,rowKey:"location_id",scroll:I,sticky:!0,onRow:A=>({onClick:()=>{const O=Cf.exports(A.geometry);b.flyTo({center:[O.coordinates[0],O.coordinates[1]],zoom:13,essential:!0})}}),rowSelection:e,rowClassName:A=>bc("cursor-pointer",A.location_id===(g==null?void 0:g.id)&&"scroll-row"),"data-fullwidth":h,loading:p})},"opened")})}),w9=[{title:"\u0410\u0434\u0440\u0435\u0441",dataIndex:"address",key:"address",width:200},{title:"\u0420\u0430\u0439\u043E\u043D",dataIndex:"rayon",key:"rayon",width:"120px",ellipsis:!0},{title:"\u041E\u043A\u0440\u0443\u0433",dataIndex:"okrug",key:"okrug",width:"120px",ellipsis:!0},{title:"\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435",dataIndex:"name",key:"name",width:"120px",ellipsis:!0},{title:"\u041A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044F",dataIndex:"category",key:"category",width:"120px",ellipsis:!0},{title:"\u0421\u0442\u0430\u0442\u0443\u0441",dataIndex:"status",key:"status",width:"120px",ellipsis:!0},{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}],h1=30,lhe=(e,t)=>{const{clickedPointConfig:n}=xu(),{data:r,isInitialLoading:i,isFetching:l}=Sa(["clicked-point",n==null?void 0:n.id],async()=>{const c=new URLSearchParams({"location_ids[]":[n.id]}),{data:o}=await Jo.get(`/api/placement_points?${c.toString()}`);return o},{enabled:e,onSuccess:t});return{data:r,isLoading:i||l}},p3=(e,t)=>{const[n,r]=C.exports.useState(),[i,l]=C.exports.useState(!1),{data:c,isLoading:o}=lhe(i,()=>l(!1)),{clickedPointConfig:h}=xu();return C.exports.useEffect(()=>{!e||r(e)},[e]),C.exports.useEffect(()=>{!e||h===null||e.results.find(g=>g.location_id===h.id)||l(!0)},[e,h]),C.exports.useEffect(()=>{!c||(t(p=>p+1),r(p=>{if(p)return{...p,count:p.count+1,results:[c.results[0],...p.results]}}))},[c]),C.exports.useEffect(()=>{h===null&&(t(h1),r(e))},[h,e]),{data:n,isClickedPointLoading:o}},uhe=(e,t)=>{const{filters:{region:n}}=Oi();return Sa(["export-approve-working",n],async()=>{const r=new URLSearchParams({"status[]":[Fr.approve,Fr.working]});return await n3(r,n)},{enabled:e,onSuccess:d3,onSettled:t})},che=e=>({popup:null,setPopup:t=>{e(n=>{if(!t)return n.popup=null,n;n.popup=t})}}),C9=mu(vu(che)),dhe=[{label:Fr.approve,value:Fr.approve},{label:Fr.working,value:Fr.working},{label:Fr.initial,value:Fr.initial}],S9=({value:e,onChange:t,disabled:n})=>E(tl,{style:{width:250},value:e,onChange:l=>{t(l)},options:dhe,disabled:n,placeholder:"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0441\u0442\u0430\u0442\u0443\u0441",onClick:l=>l.stopPropagation()}),fhe=({selectedIds:e,selectedStatus:t})=>{const n=hm(),{setPopup:r}=C9(),{mutate:i}=s3({onSuccess:()=>{n.invalidateQueries(["approve-working-points"]),r(null)}});return E(Br,{type:"primary",onClick:c=>{c.stopPropagation();const o=new URLSearchParams({status:t,"location_ids[]":e});i(o)},children:"\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u0441\u0442\u0430\u0442\u0443\u0441"})},hhe=({selectedIds:e,onClearSelected:t})=>{const[n,r]=C.exports.useState(Fr.approve),i=l=>{l.stopPropagation(),t()};return E(f1,{leftColumn:e.length>0&&Qe($n,{children:[E(S9,{value:n,onChange:r}),E(fhe,{selectedIds:e,selectedStatus:n})]}),rightColumn:e.length>0&&E(Br,{onClick:i,children:"\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C \u0432\u0441\u0435"}),classes:{leftColumn:"flex items-center gap-x-4",rightColumn:"flex item-center gap-x-4"},exportProvider:uhe})},phe=({fullWidth:e})=>{const[t,n]=C.exports.useState(h1),[r,i]=C.exports.useState(1),[l,c]=C.exports.useState([]),{filters:{region:o}}=Oi(),h=()=>c([]),{data:p,isInitialLoading:g}=Sa(["approve-working-points",r,o],async()=>{const A=new URLSearchParams({page:r,page_size:t,"status[]":[Fr.approve,Fr.working]});return await pm(A,o)},{keepPreviousData:!0}),{data:b,isClickedPointLoading:w}=p3(p,n),P=C.exports.useCallback(A=>i(A),[]);return E(h3,{header:E(hhe,{selectedIds:l,onClearSelected:h}),rowSelection:{selectedRowKeys:l,onChange:A=>c(A),hideSelectAll:!0},data:b,onPageChange:P,page:r,pageSize:t,isClickedPointLoading:w,columns:w9,fullWidth:e,loading:g})},mhe=({feature:e})=>{const t=e.properties.location_id,{setClickedPointConfig:n}=xu(),[r,i]=C.exports.useState(e.properties.status);C.exports.useEffect(()=>n(t,!1),[e]);const l=hm(),{mutate:c}=s3({onSuccess:()=>{l.invalidateQueries(["approve-working-points"])}});return Qe($n,{children:[E(c3,{feature:e,dynamicStatus:r}),E("div",{className:"flex justify-center mt-4",children:Qe("div",{className:"flex flex-col items-center",children:[E(gu,{text:"\u0418\u0437\u043C\u0435\u043D\u0438\u0442\u044C \u0441\u0442\u0430\u0442\u0443\u0441"}),E(S9,{value:r,onChange:h=>{i(h);const p=new URLSearchParams({status:h,"location_ids[]":[t]});c(p)}})]})})]})},vhe=({feature:e})=>{const t=e.properties.location_id,{setClickedPointConfig:n}=xu();return C.exports.useEffect(()=>n(t,!1),[e]),E(c3,{feature:e,dynamicStatus:status})},pP=({feature:e})=>{const{mode:t}=yu();return t===Yr.APPROVE_WORKING?E(mhe,{feature:e}):t===Yr.WORKING?E(vhe,{feature:e}):E(Qfe,{feature:e})},ghe=({features:e,onSelect:t})=>E("div",{className:"space-y-2 p-1",children:e.map(n=>Qe(Br,{type:n.layer.id===mr["initial-match"]?"primary":"",className:"flex items-center gap-x-1",block:!0,onClick:()=>t(n),children:[E("span",{children:n.properties.location_id}),E("span",{children:n.properties.category})]},n.properties.location_id))}),yhe=({features:e,lat:t,lng:n,onClose:r})=>{const[i,l]=C.exports.useState(null);return E(Gfe,{lat:t,lng:n,onClose:r,children:(()=>e.length===1?E(pP,{feature:e[0]}):i?E(pP,{feature:i}):E(ghe,{features:e,onSelect:l}))()})},xhe="https://api.mapbox.com/styles/v1/ghermant/cla2nwk5f00el14nxvtjlsi6z/tiles/256/{z}/{x}/{y}@2x?access_token=pk.eyJ1IjoiZ2hlcm1hbnQiLCJhIjoiY2xhMm5zZ3ZrMDF4MDN2bzc5Yjd0ZjZ1dCJ9.fqnvrEqKKBoguR7R6DR7Yw",_he=()=>E(ap,{type:"raster",id:"basemap",tiles:[xhe],tileSize:256,children:E(tu,{type:"raster",source:"basemap",id:"basemap-layer",paint:{}})});function bhe(){const e=async()=>{await Jo.post("accounts/logout/"),r3(!1)},{data:t}=Sa(["profile"],async()=>{const{data:n}=await Jo.get("/accounts/profile");return n});return E("div",{className:"absolute top-[20px] right-[20px]",children:E(x7,{content:Qe($n,{children:[E(gu,{text:t==null?void 0:t.email,classNameText:"lowercase"}),Qe(Br,{type:"primary",block:!0,onClick:e,children:[E("span",{className:"mr-1",children:"\u0412\u044B\u0439\u0442\u0438"}),E(oN,{})]})]}),trigger:"click",placement:"bottomRight",children:E(oo,{title:"\u0412\u044B\u0439\u0442\u0438",placement:"left",children:E(Br,{icon:E(hle,{}),type:"primary",size:"large"})})})})}var whe="Expected a function",mP=0/0,Che="[object Symbol]",She=/^\s+|\s+$/g,Ehe=/^[-+]0x[0-9a-f]+$/i,khe=/^0b[01]+$/i,The=/^0o[0-7]+$/i,Phe=parseInt,Ihe=typeof Us=="object"&&Us&&Us.Object===Object&&Us,Mhe=typeof self=="object"&&self&&self.Object===Object&&self,Rhe=Ihe||Mhe||Function("return this")(),Ahe=Object.prototype,Ohe=Ahe.toString,Nhe=Math.max,Dhe=Math.min,Z_=function(){return Rhe.Date.now()};function Lhe(e,t,n){var r,i,l,c,o,h,p=0,g=!1,b=!1,w=!0;if(typeof e!="function")throw new TypeError(whe);t=vP(t)||0,Pw(n)&&(g=!!n.leading,b="maxWait"in n,l=b?Nhe(vP(n.maxWait)||0,t):l,w="trailing"in n?!!n.trailing:w);function P(U){var q=r,H=i;return r=i=void 0,p=U,c=e.apply(H,q),c}function I(U){return p=U,o=setTimeout(M,t),g?P(U):c}function A(U){var q=U-h,H=U-p,te=t-q;return b?Dhe(te,l-H):te}function O(U){var q=U-h,H=U-p;return h===void 0||q>=t||q<0||b&&H>=l}function M(){var U=Z_();if(O(U))return R(U);o=setTimeout(M,A(U))}function R(U){return o=void 0,w&&r?P(U):(r=i=void 0,c)}function N(){o!==void 0&&clearTimeout(o),p=0,r=h=i=o=void 0}function z(){return o===void 0?c:R(Z_())}function B(){var U=Z_(),q=O(U);if(r=arguments,i=this,h=U,q){if(o===void 0)return I(h);if(b)return o=setTimeout(M,t),P(h)}return o===void 0&&(o=setTimeout(M,t)),c}return B.cancel=N,B.flush=z,B}function Pw(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function zhe(e){return!!e&&typeof e=="object"}function Fhe(e){return typeof e=="symbol"||zhe(e)&&Ohe.call(e)==Che}function vP(e){if(typeof e=="number")return e;if(Fhe(e))return mP;if(Pw(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Pw(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(She,"");var n=khe.test(e);return n||The.test(e)?Phe(e.slice(2),n?2:8):Ehe.test(e)?mP:+e}var $he=Lhe;const gP=({color:e,name:t})=>Qe("div",{className:"flex gap-2 items-center",children:[E("span",{className:"rounded-xl w-3 h-3 inline-block",style:{backgroundColor:e}}),E("span",{children:t})]});function Bhe(){const{mode:e}=yu();return E("div",{className:"absolute bottom-[20px] left-[20px] text-xs text-grey z-10 bg-white-background rounded-xl p-3",children:(()=>e===Yr.APPROVE_WORKING?Qe($n,{children:[E(gu,{text:"\u0421\u0442\u0430\u0442\u0443\u0441 \u043B\u043E\u043A\u0430\u0446\u0438\u0438",className:"text-center"}),Qe("div",{className:"space-y-2",children:[E(gP,{name:"\u0421\u043E\u0433\u043B\u0430\u0441\u043E\u0432\u0430\u043D\u0438\u0435-\u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0430",color:x9}),E(gP,{name:"\u0420\u0430\u0431\u043E\u0442\u0430\u0435\u0442",color:_9})]})]}):null)()})}const Vhe=(e,t)=>{const[n,r]=C.exports.useState(h1),{filters:i}=Oi(),{prediction:l,categories:c,region:o}=i,{selection:{included:h}}=xs(),p=[...h],{data:g,isInitialLoading:b}=Sa(["table",e,i,p],async()=>{const I=new URLSearchParams({page:e,page_size:n,"prediction_current[]":l,"status[]":[Fr.initial],"categories[]":c,"included[]":p});return await pm(I,o)},{keepPreviousData:!0,onError:I=>{I.response.data.detail==="\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430\u044F \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430"&&t()}}),{data:w,isClickedPointLoading:P}=p3(g,r);return{data:w,pageSize:n,isClickedPointLoading:P,isDataLoading:b}},Uhe=(e,t)=>{const{filters:n}=Oi(),{prediction:r,status:i,categories:l,region:c}=n,{selection:o}=xs();return Sa(["export-initial",n,o],async()=>{const h=new URLSearchParams({"prediction_current[]":r,"status[]":i,"categories[]":l,"included[]":[...o.included],"excluded[]":[...o.excluded]});return await n3(h,c)},{enabled:e,onSuccess:d3,onSettled:t})},jhe=({fullWidth:e})=>{const{selection:t,include:n,exclude:r}=xs(),{clickedPointConfig:i}=xu(),[l,c]=C.exports.useState(1),{data:o,pageSize:h,isClickedPointLoading:p,isDataLoading:g}=Vhe(l,()=>c(1)),w={selectedRowKeys:C.exports.useCallback(()=>{var R;const I=(R=o==null?void 0:o.results.map(N=>N.location_id))!=null?R:[],A=o==null?void 0:o.results.find(N=>N.location_id===(i==null?void 0:i.id)),O=N=>t.excluded.has(N),M=N=>N===(A==null?void 0:A.id)&&(i==null?void 0:i.shouldSelect)===!1;return[...I.filter(N=>!O(N)&&!M(N)),...t.included]},[o,i,t])(),onSelect:(I,A)=>{const{location_id:O}=I;A?n(O):r(O)},hideSelectAll:!0},P=C.exports.useCallback(I=>c(I),[]);return E(h3,{rowSelection:w,data:o,onPageChange:P,page:l,pageSize:h,isClickedPointLoading:p,columns:w9,fullWidth:e,header:E(f1,{exportProvider:Uhe}),loading:g})},Khe=(e,t)=>{const{filters:{region:n,deltaTraffic:r,factTraffic:i,age:l}}=Oi();return Sa(["export-working",n,r,i,l],async()=>{const c=new URLSearchParams({"status[]":[Fr.working],"delta_current[]":r,"fact[]":i,"age_day[]":l});return await n3(c,n)},{enabled:e,onSuccess:d3,onSettled:t})},Hhe=[{title:"\u0410\u0434\u0440\u0435\u0441",dataIndex:"address",key:"address",width:200},{title:"\u0420\u0430\u0439\u043E\u043D",dataIndex:"rayon",key:"rayon",width:"120px",ellipsis:!0},{title:"\u041E\u043A\u0440\u0443\u0433",dataIndex:"okrug",key:"okrug",width:"120px",ellipsis:!0},{title:"\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435",dataIndex:"name",key:"name",width:"120px",ellipsis:!0},{title:"\u041A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044F",dataIndex:"category",key:"category",width:"120px",ellipsis:!0},{title:"\u0424\u0430\u043A\u0442",dataIndex:"fact",key:"fact",width:"120px",ellipsis:!0},{title:"\u0420\u0430\u0441\u0445\u043E\u0436\u0434\u0435\u043D\u0438\u0435 \u0441 \u043F\u0440\u043E\u0433\u043D\u043E\u0437\u043E\u043C",dataIndex:"delta_current",key:"delta_current",width:"120px",ellipsis:!0},{title:"\u0417\u0440\u0435\u043B\u043E\u0441\u0442\u044C",dataIndex:"age_day",key:"age_day",width:"120px",ellipsis:!0}],Whe=({fullWidth:e})=>{const[t,n]=C.exports.useState(h1),[r,i]=C.exports.useState(1),{filters:{region:l,deltaTraffic:c,factTraffic:o,age:h}}=Oi(),{data:p,isInitialLoading:g}=Sa(["working-points",r,l,c,o,h],async()=>{const I=new URLSearchParams({page:r,page_size:t,"status[]":[Fr.working],"delta_current[]":c,"fact[]":o,"age_day[]":h});return await pm(I,l)},{keepPreviousData:!0}),{data:b,isClickedPointLoading:w}=p3(p,n),P=C.exports.useCallback(I=>i(I),[]);return E(h3,{data:b,onPageChange:P,page:r,pageSize:t,isClickedPointLoading:w,columns:Hhe,fullWidth:e,header:E(f1,{exportProvider:Khe}),loading:g})},Ghe=({fullWidth:e})=>{const{mode:t}=yu();return t===Yr.APPROVE_WORKING?E(phe,{fullWidth:e}):t===Yr.WORKING?E(Whe,{fullWidth:e}):E(jhe,{fullWidth:e})},qhe=({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:[E("polygon",{points:"23.7,4.1 23.7,6.1 0.1,6.2 0.1,4.1 "}),Qe("g",{children:[E("circle",{cx:"6.3",cy:"5.2",r:"3.1"}),E("circle",{fill:"#fff",cx:"6.3",cy:"5.2",r:"1.4"})]}),E("polygon",{points:"23.6,11.1 23.7,13.1 0,13.1 0,11 "}),Qe("g",{children:[E("circle",{cx:"18.6",cy:"12.1",r:"3.1"}),E("circle",{fill:"#fff",cx:"18.6",cy:"12.1",r:"1.4"})]}),E("polygon",{points:"23.8,18.2 23.9,20.1 0.2,20.2 0.2,18.2 "}),Qe("g",{children:[E("circle",{cx:"10.2",cy:"19.1",r:"3.1"}),E("circle",{fill:"#fff",cx:"10.2",cy:"19.1",r:"1.4"})]})]}),Zhe=({toggleCollapse:e})=>E(Br,{icon:E(qhe,{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 E9={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},yP=tr.createContext&&tr.createContext(E9),nu=globalThis&&globalThis.__assign||function(){return nu=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{const{toggleVisibility:e,isVisible:t}=Sf(),{mode:n}=yu();return Qe("div",{children:[E(gu,{text:"\u0421\u043B\u043E\u0438",className:"mb-1"}),E("div",{className:"space-y-1 flex flex-col",children:n===Yr.WORKING&&E($n,{children:E(xc,{className:"!ml-0",onChange:()=>e(mr.working),checked:t[mr.working],children:"\u0420\u0430\u0431\u043E\u0442\u0430\u0435\u0442"})})})]})},tpe=()=>E(x7,{content:E(epe,{}),trigger:"click",placement:"leftBottom",children:E(oo,{title:"\u0421\u043B\u043E\u0438",children:E(Br,{className:"absolute bottom-[20px] right-[20px] flex items-center justify-center p-3",children:E(Jhe,{className:"w-4 h-4"})})})});function npe(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 rpe=()=>{const{map:e}=o3(),[t,n]=C.exports.useState(""),r=npe(t),{data:i}=Sa(["address",r],async()=>(await Jo.get(`/api/placement_points/search_address?page_size=100&address=${r}`)).data),l=C.exports.useMemo(()=>i?i.results.map(h=>({label:h.address,value:`${h.address}$${h.location_id}`,item:h})):[],[i]);return E("div",{children:E(fW,{options:l,style:{width:300},value:t,onChange:h=>{n(h&&h.split("$")[0])},onSelect:(h,p)=>{const g=Cf.exports(p.item.geometry);e.flyTo({center:[g.coordinates[0],g.coordinates[1]],zoom:15,speed:5})},allowClear:!0,onClear:()=>n(""),children:E(Kl,{prefix:E(gle,{}),placeholder:"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0430\u0434\u0440\u0435\u0441 \u0442\u043E\u0447\u043A\u0438",className:"text-ellipsis"})})})},ipe=({isSidebarCollapsed:e})=>Qe("div",{className:"absolute top-[20px] left-[30px] flex items-center gap-x-10",children:[Qe("div",{className:bc("hidden",e&&"flex items-center gap-x-3 "),children:[E(g9,{}),E(y9,{})]}),E(rpe,{})]}),ope=()=>{const e=C.exports.useRef(null),t=C.exports.useRef(null),n=C.exports.useRef(null),{popup:r,setPopup:i}=C9(),{setClickedPointConfig:l}=xu(),{setLayersVisibility:c}=Sf(),{setStatus:o}=Oi(),{mode:h}=yu(),{tableState:p,openTable:g}=f3();C.exports.useEffect(()=>{o(hce[h]),c(pce[h]),i(null),l(null)},[h]);const b=M=>{if(!M.features){i(null),l(null);return}const R=M.features[0];if(!R){i(null),l(null);return}const{lng:N}=M.lngLat;if(R.geometry.type==="Point"){const z=R.geometry.coordinates.slice();for(;Math.abs(N-z[0])>180;)z[0]+=N>z[0]?360:-360;i({features:M.features,coordinates:z})}},w=M=>{!M.features[0]||(e.current.getCanvas().style.cursor="pointer")},P=M=>{!M.features[0]||(e.current.getCanvas().style.cursor="")};C.exports.useEffect(()=>{const M=new ResizeObserver($he(()=>{var R;(R=e==null?void 0:e.current)==null||R.resize()},16));return t.current&&M.observe(t.current),()=>{M.disconnect()}},[t.current]),C.exports.useEffect(()=>{p.fullScreen&&!p.isOpened&&g()},[p.fullScreen]);const[I,A]=C.exports.useState(!1),O=()=>A(M=>!M);return Qe(ude,{children:[E(Rfe,{isCollapsed:I,ref:n}),Qe("div",{className:"flex-1 h-screen flex flex-col ",children:[E("div",{ref:t,className:bc(p.fullScreen?"":"flex-1"),children:Qe(a3,{mapLib:ode,initialViewState:{latitude:55.7558,longitude:37.6173,zoom:9},dragRotate:!1,ref:e,interactiveLayerIds:[mr["initial-match"],mr["initial-unmatch"],mr.approve,mr.working],onClick:b,onMouseEnter:w,onMouseLeave:P,id:"map",children:[r&&E(yhe,{lat:r.coordinates[1],lng:r.coordinates[0],features:r.features,onClose:()=>{i(null),l(null)}}),E(ipe,{isSidebarCollapsed:I}),E(Zhe,{toggleCollapse:O}),E(_he,{}),E(Wfe,{}),E(Bhe,{}),E(bhe,{}),E(tpe,{})]})}),E("div",{className:"w-full border-solid border-border border-0 border-t-[1px]",children:E(Ghe,{fullWidth:I})})]})]})};function ape(){return E(ide,{children:E(ope,{})})}const spe=new Gue;Oce();function lpe(){return E(Yue,{client:spe,children:E(B$,{basename:"/",children:Qe(N$,{children:[E(Fh,{path:"/",element:E(ape,{})}),E(Fh,{path:"/signin",element:E(Qce,{})}),E(Fh,{path:"/verify-user",element:E(ede,{})}),E(Fh,{path:"/register",element:E(rde,{})})]})})})}X_.createRoot(document.getElementById("root")).render(E(tr.StrictMode,{children:E(lpe,{})}));