diff --git a/dist/assets/index-BuvbEsT3.js b/dist/assets/index-BuvbEsT3.js new file mode 100644 index 0000000..e94e9c0 --- /dev/null +++ b/dist/assets/index-BuvbEsT3.js @@ -0,0 +1,1690 @@ +var xI=Object.defineProperty;var iE=t=>{throw TypeError(t)};var MI=(t,e,n)=>e in t?xI(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var O=(t,e,n)=>MI(t,typeof e!="symbol"?e+"":e,n),Sv=(t,e,n)=>e.has(t)||iE("Cannot "+n);var G=(t,e,n)=>(Sv(t,e,"read from private field"),n?n.call(t):e.get(t)),St=(t,e,n)=>e.has(t)?iE("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Xe=(t,e,n,r)=>(Sv(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Wt=(t,e,n)=>(Sv(t,e,"access private method"),n);var sh=(t,e,n,r)=>({set _(i){Xe(t,e,i,n)},get _(){return G(t,e,r)}});function OI(t,e){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();function By(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var wv={exports:{}},Uu={};/** + * @license React + * react-jsx-runtime.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var sE;function PI(){if(sE)return Uu;sE=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,i,s){var l=null;if(s!==void 0&&(l=""+s),i.key!==void 0&&(l=""+i.key),"key"in i){s={};for(var c in i)c!=="key"&&(s[c]=i[c])}else s=i;return i=s.ref,{$$typeof:t,type:r,key:l,ref:i!==void 0?i:null,props:s}}return Uu.Fragment=e,Uu.jsx=n,Uu.jsxs=n,Uu}var aE;function NI(){return aE||(aE=1,wv.exports=PI()),wv.exports}var ar=NI(),jf=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Vo=typeof window>"u"||"Deno"in globalThis;function Mi(){}function II(t,e){return typeof t=="function"?t(e):t}function P0(t){return typeof t=="number"&&t>=0&&t!==1/0}function dR(t,e){return Math.max(t+(e||0)-Date.now(),0)}function nc(t,e){return typeof t=="function"?t(e):t}function Ki(t,e){return typeof t=="function"?t(e):t}function oE(t,e){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:l,stale:c}=t;if(l){if(r){if(e.queryHash!==Uy(l,e.options))return!1}else if(!_f(e.queryKey,l))return!1}if(n!=="all"){const f=e.isActive();if(n==="active"&&!f||n==="inactive"&&f)return!1}return!(typeof c=="boolean"&&e.isStale()!==c||i&&i!==e.state.fetchStatus||s&&!s(e))}function lE(t,e){const{exact:n,status:r,predicate:i,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(n){if(vf(e.options.mutationKey)!==vf(s))return!1}else if(!_f(e.options.mutationKey,s))return!1}return!(r&&e.state.status!==r||i&&!i(e))}function Uy(t,e){return((e==null?void 0:e.queryKeyHashFn)||vf)(t)}function vf(t){return JSON.stringify(t,(e,n)=>I0(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function _f(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(n=>!_f(t[n],e[n])):!1}function hR(t,e){if(t===e)return t;const n=cE(t)&&cE(e);if(n||I0(t)&&I0(e)){const r=n?t:Object.keys(t),i=r.length,s=n?e:Object.keys(e),l=s.length,c=n?[]:{};let f=0;for(let d=0;d{setTimeout(e,t)})}function D0(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?hR(t,e):e}function FI(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function kI(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var Ly=Symbol();function gR(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===Ly?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var Co,Ca,cc,nR,BI=(nR=class extends jf{constructor(){super();St(this,Co);St(this,Ca);St(this,cc);Xe(this,cc,e=>{if(!Vo&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){G(this,Ca)||this.setEventListener(G(this,cc))}onUnsubscribe(){var e;this.hasListeners()||((e=G(this,Ca))==null||e.call(this),Xe(this,Ca,void 0))}setEventListener(e){var n;Xe(this,cc,e),(n=G(this,Ca))==null||n.call(this),Xe(this,Ca,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){G(this,Co)!==e&&(Xe(this,Co,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof G(this,Co)=="boolean"?G(this,Co):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Co=new WeakMap,Ca=new WeakMap,cc=new WeakMap,nR),zy=new BI,uc,Ra,fc,rR,UI=(rR=class extends jf{constructor(){super();St(this,uc,!0);St(this,Ra);St(this,fc);Xe(this,fc,e=>{if(!Vo&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){G(this,Ra)||this.setEventListener(G(this,fc))}onUnsubscribe(){var e;this.hasListeners()||((e=G(this,Ra))==null||e.call(this),Xe(this,Ra,void 0))}setEventListener(e){var n;Xe(this,fc,e),(n=G(this,Ra))==null||n.call(this),Xe(this,Ra,e(this.setOnline.bind(this)))}setOnline(e){G(this,uc)!==e&&(Xe(this,uc,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return G(this,uc)}},uc=new WeakMap,Ra=new WeakMap,fc=new WeakMap,rR),Yh=new UI;function F0(){let t,e;const n=new Promise((i,s)=>{t=i,e=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),t(i)},n.reject=i=>{r({status:"rejected",reason:i}),e(i)},n}function LI(t){return Math.min(1e3*2**t,3e4)}function pR(t){return(t??"online")==="online"?Yh.isOnline():!0}var mR=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function Ev(t){return t instanceof mR}function vR(t){let e=!1,n=0,r=!1,i;const s=F0(),l=w=>{var b;r||(v(new mR(w)),(b=t.abort)==null||b.call(t))},c=()=>{e=!0},f=()=>{e=!1},d=()=>zy.isFocused()&&(t.networkMode==="always"||Yh.isOnline())&&t.canRun(),g=()=>pR(t.networkMode)&&t.canRun(),m=w=>{var b;r||(r=!0,(b=t.onSuccess)==null||b.call(t,w),i==null||i(),s.resolve(w))},v=w=>{var b;r||(r=!0,(b=t.onError)==null||b.call(t,w),i==null||i(),s.reject(w))},S=()=>new Promise(w=>{var b;i=A=>{(r||d())&&w(A)},(b=t.onPause)==null||b.call(t)}).then(()=>{var w;i=void 0,r||(w=t.onContinue)==null||w.call(t)}),E=()=>{if(r)return;let w;const b=n===0?t.initialPromise:void 0;try{w=b??t.fn()}catch(A){w=Promise.reject(A)}Promise.resolve(w).then(m).catch(A=>{var N;if(r)return;const T=t.retry??(Vo?0:3),C=t.retryDelay??LI,M=typeof C=="function"?C(n,A):C,x=T===!0||typeof T=="number"&&nd()?void 0:S()).then(()=>{e?v(A):E()})})};return{promise:s,cancel:l,continue:()=>(i==null||i(),s),cancelRetry:c,continueRetry:f,canStart:g,start:()=>(g()?E():S().then(E),s)}}function zI(){let t=[],e=0,n=c=>{c()},r=c=>{c()},i=c=>setTimeout(c,0);const s=c=>{e?t.push(c):i(()=>{n(c)})},l=()=>{const c=t;t=[],c.length&&i(()=>{r(()=>{c.forEach(f=>{n(f)})})})};return{batch:c=>{let f;e++;try{f=c()}finally{e--,e||l()}return f},batchCalls:c=>(...f)=>{s(()=>{c(...f)})},schedule:s,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{i=c}}}var Mr=zI(),Ro,iR,_R=(iR=class{constructor(){St(this,Ro)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),P0(this.gcTime)&&Xe(this,Ro,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Vo?1/0:5*60*1e3))}clearGcTimeout(){G(this,Ro)&&(clearTimeout(G(this,Ro)),Xe(this,Ro,void 0))}},Ro=new WeakMap,iR),dc,hc,xi,xo,kr,zf,Mo,Wi,$s,sR,$I=(sR=class extends _R{constructor(e){super();St(this,Wi);St(this,dc);St(this,hc);St(this,xi);St(this,xo);St(this,kr);St(this,zf);St(this,Mo);Xe(this,Mo,!1),Xe(this,zf,e.defaultOptions),this.setOptions(e.options),this.observers=[],Xe(this,xo,e.client),Xe(this,xi,G(this,xo).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Xe(this,dc,VI(this.options)),this.state=e.state??G(this,dc),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=G(this,kr))==null?void 0:e.promise}setOptions(e){this.options={...G(this,zf),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&G(this,xi).remove(this)}setData(e,n){const r=D0(this.state.data,e,this.options);return Wt(this,Wi,$s).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){Wt(this,Wi,$s).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var r,i;const n=(r=G(this,kr))==null?void 0:r.promise;return(i=G(this,kr))==null||i.cancel(e),n?n.then(Mi).catch(Mi):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(G(this,dc))}isActive(){return this.observers.some(e=>Ki(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ly||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!dR(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=G(this,kr))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=G(this,kr))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),G(this,xi).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(G(this,kr)&&(G(this,Mo)?G(this,kr).cancel({revert:!0}):G(this,kr).cancelRetry()),this.scheduleGc()),G(this,xi).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Wt(this,Wi,$s).call(this,{type:"invalidate"})}fetch(e,n){var f,d,g;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(G(this,kr))return G(this,kr).continueRetry(),G(this,kr).promise}if(e&&this.setOptions(e),!this.options.queryFn){const m=this.observers.find(v=>v.options.queryFn);m&&this.setOptions(m.options)}const r=new AbortController,i=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(Xe(this,Mo,!0),r.signal)})},s=()=>{const m=gR(this.options,n),v={client:G(this,xo),queryKey:this.queryKey,meta:this.meta};return i(v),Xe(this,Mo,!1),this.options.persister?this.options.persister(m,v,this):m(v)},l={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:G(this,xo),state:this.state,fetchFn:s};i(l),(f=this.options.behavior)==null||f.onFetch(l,this),Xe(this,hc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=l.fetchOptions)==null?void 0:d.meta))&&Wt(this,Wi,$s).call(this,{type:"fetch",meta:(g=l.fetchOptions)==null?void 0:g.meta});const c=m=>{var v,S,E,w;Ev(m)&&m.silent||Wt(this,Wi,$s).call(this,{type:"error",error:m}),Ev(m)||((S=(v=G(this,xi).config).onError)==null||S.call(v,m,this),(w=(E=G(this,xi).config).onSettled)==null||w.call(E,this.state.data,m,this)),this.scheduleGc()};return Xe(this,kr,vR({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,abort:r.abort.bind(r),onSuccess:m=>{var v,S,E,w;if(m===void 0){c(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(m)}catch(b){c(b);return}(S=(v=G(this,xi).config).onSuccess)==null||S.call(v,m,this),(w=(E=G(this,xi).config).onSettled)==null||w.call(E,m,this.state.error,this),this.scheduleGc()},onError:c,onFail:(m,v)=>{Wt(this,Wi,$s).call(this,{type:"failed",failureCount:m,error:v})},onPause:()=>{Wt(this,Wi,$s).call(this,{type:"pause"})},onContinue:()=>{Wt(this,Wi,$s).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0})),G(this,kr).start()}},dc=new WeakMap,hc=new WeakMap,xi=new WeakMap,xo=new WeakMap,kr=new WeakMap,zf=new WeakMap,Mo=new WeakMap,Wi=new WeakSet,$s=function(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...yR(r.data,this.options),fetchMeta:e.meta??null};case"success":return{...r,data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=e.error;return Ev(i)&&i.revert&&G(this,hc)?{...G(this,hc),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),Mr.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),G(this,xi).notify({query:this,type:"updated",action:e})})},sR);function yR(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:pR(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function VI(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var ds,aR,HI=(aR=class extends jf{constructor(e={}){super();St(this,ds);this.config=e,Xe(this,ds,new Map)}build(e,n,r){const i=n.queryKey,s=n.queryHash??Uy(i,n);let l=this.get(s);return l||(l=new $I({client:e,queryKey:i,queryHash:s,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(l)),l}add(e){G(this,ds).has(e.queryHash)||(G(this,ds).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=G(this,ds).get(e.queryHash);n&&(e.destroy(),n===e&&G(this,ds).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Mr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return G(this,ds).get(e)}getAll(){return[...G(this,ds).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>oE(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>oE(e,r)):n}notify(e){Mr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Mr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Mr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},ds=new WeakMap,aR),hs,Vr,Oo,gs,Sa,oR,jI=(oR=class extends _R{constructor(e){super();St(this,gs);St(this,hs);St(this,Vr);St(this,Oo);this.mutationId=e.mutationId,Xe(this,Vr,e.mutationCache),Xe(this,hs,[]),this.state=e.state||WI(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){G(this,hs).includes(e)||(G(this,hs).push(e),this.clearGcTimeout(),G(this,Vr).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Xe(this,hs,G(this,hs).filter(n=>n!==e)),this.scheduleGc(),G(this,Vr).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){G(this,hs).length||(this.state.status==="pending"?this.scheduleGc():G(this,Vr).remove(this))}continue(){var e;return((e=G(this,Oo))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var i,s,l,c,f,d,g,m,v,S,E,w,b,A,T,C,M,x,N,F;Xe(this,Oo,vR({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(L,I)=>{Wt(this,gs,Sa).call(this,{type:"failed",failureCount:L,error:I})},onPause:()=>{Wt(this,gs,Sa).call(this,{type:"pause"})},onContinue:()=>{Wt(this,gs,Sa).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>G(this,Vr).canRun(this)}));const n=this.state.status==="pending",r=!G(this,Oo).canStart();try{if(!n){Wt(this,gs,Sa).call(this,{type:"pending",variables:e,isPaused:r}),await((s=(i=G(this,Vr).config).onMutate)==null?void 0:s.call(i,e,this));const I=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,e));I!==this.state.context&&Wt(this,gs,Sa).call(this,{type:"pending",context:I,variables:e,isPaused:r})}const L=await G(this,Oo).start();return await((d=(f=G(this,Vr).config).onSuccess)==null?void 0:d.call(f,L,e,this.state.context,this)),await((m=(g=this.options).onSuccess)==null?void 0:m.call(g,L,e,this.state.context)),await((S=(v=G(this,Vr).config).onSettled)==null?void 0:S.call(v,L,null,this.state.variables,this.state.context,this)),await((w=(E=this.options).onSettled)==null?void 0:w.call(E,L,null,e,this.state.context)),Wt(this,gs,Sa).call(this,{type:"success",data:L}),L}catch(L){try{throw await((A=(b=G(this,Vr).config).onError)==null?void 0:A.call(b,L,e,this.state.context,this)),await((C=(T=this.options).onError)==null?void 0:C.call(T,L,e,this.state.context)),await((x=(M=G(this,Vr).config).onSettled)==null?void 0:x.call(M,void 0,L,this.state.variables,this.state.context,this)),await((F=(N=this.options).onSettled)==null?void 0:F.call(N,void 0,L,e,this.state.context)),L}finally{Wt(this,gs,Sa).call(this,{type:"error",error:L})}}finally{G(this,Vr).runNext(this)}}},hs=new WeakMap,Vr=new WeakMap,Oo=new WeakMap,gs=new WeakSet,Sa=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Mr.batch(()=>{G(this,hs).forEach(r=>{r.onMutationUpdate(e)}),G(this,Vr).notify({mutation:this,type:"updated",action:e})})},oR);function WI(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Vs,Xi,$f,lR,XI=(lR=class extends jf{constructor(e={}){super();St(this,Vs);St(this,Xi);St(this,$f);this.config=e,Xe(this,Vs,new Set),Xe(this,Xi,new Map),Xe(this,$f,0)}build(e,n,r){const i=new jI({mutationCache:this,mutationId:++sh(this,$f)._,options:e.defaultMutationOptions(n),state:r});return this.add(i),i}add(e){G(this,Vs).add(e);const n=ah(e);if(typeof n=="string"){const r=G(this,Xi).get(n);r?r.push(e):G(this,Xi).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(G(this,Vs).delete(e)){const n=ah(e);if(typeof n=="string"){const r=G(this,Xi).get(n);if(r)if(r.length>1){const i=r.indexOf(e);i!==-1&&r.splice(i,1)}else r[0]===e&&G(this,Xi).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=ah(e);if(typeof n=="string"){const r=G(this,Xi).get(n),i=r==null?void 0:r.find(s=>s.state.status==="pending");return!i||i===e}else return!0}runNext(e){var r;const n=ah(e);if(typeof n=="string"){const i=(r=G(this,Xi).get(n))==null?void 0:r.find(s=>s!==e&&s.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Mr.batch(()=>{G(this,Vs).forEach(e=>{this.notify({type:"removed",mutation:e})}),G(this,Vs).clear(),G(this,Xi).clear()})}getAll(){return Array.from(G(this,Vs))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>lE(n,r))}findAll(e={}){return this.getAll().filter(n=>lE(e,n))}notify(e){Mr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Mr.batch(()=>Promise.all(e.map(n=>n.continue().catch(Mi))))}},Vs=new WeakMap,Xi=new WeakMap,$f=new WeakMap,lR);function ah(t){var e;return(e=t.options.scope)==null?void 0:e.id}function fE(t){return{onFetch:(e,n)=>{var g,m,v,S,E;const r=e.options,i=(v=(m=(g=e.fetchOptions)==null?void 0:g.meta)==null?void 0:m.fetchMore)==null?void 0:v.direction,s=((S=e.state.data)==null?void 0:S.pages)||[],l=((E=e.state.data)==null?void 0:E.pageParams)||[];let c={pages:[],pageParams:[]},f=0;const d=async()=>{let w=!1;const b=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(e.signal.aborted?w=!0:e.signal.addEventListener("abort",()=>{w=!0}),e.signal)})},A=gR(e.options,e.fetchOptions),T=async(C,M,x)=>{if(w)return Promise.reject();if(M==null&&C.pages.length)return Promise.resolve(C);const N={client:e.client,queryKey:e.queryKey,pageParam:M,direction:x?"backward":"forward",meta:e.options.meta};b(N);const F=await A(N),{maxPages:L}=e.options,I=x?kI:FI;return{pages:I(C.pages,F,L),pageParams:I(C.pageParams,M,L)}};if(i&&s.length){const C=i==="backward",M=C?qI:dE,x={pages:s,pageParams:l},N=M(r,x);c=await T(x,N,C)}else{const C=t??s.length;do{const M=f===0?l[0]??r.initialPageParam:dE(r,c);if(f>0&&M==null)break;c=await T(c,M),f++}while(f{var w,b;return(b=(w=e.options).persister)==null?void 0:b.call(w,d,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=d}}}function dE(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function qI(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}var Yn,xa,Ma,gc,pc,Oa,mc,vc,cR,YI=(cR=class{constructor(t={}){St(this,Yn);St(this,xa);St(this,Ma);St(this,gc);St(this,pc);St(this,Oa);St(this,mc);St(this,vc);Xe(this,Yn,t.queryCache||new HI),Xe(this,xa,t.mutationCache||new XI),Xe(this,Ma,t.defaultOptions||{}),Xe(this,gc,new Map),Xe(this,pc,new Map),Xe(this,Oa,0)}mount(){sh(this,Oa)._++,G(this,Oa)===1&&(Xe(this,mc,zy.subscribe(async t=>{t&&(await this.resumePausedMutations(),G(this,Yn).onFocus())})),Xe(this,vc,Yh.subscribe(async t=>{t&&(await this.resumePausedMutations(),G(this,Yn).onOnline())})))}unmount(){var t,e;sh(this,Oa)._--,G(this,Oa)===0&&((t=G(this,mc))==null||t.call(this),Xe(this,mc,void 0),(e=G(this,vc))==null||e.call(this),Xe(this,vc,void 0))}isFetching(t){return G(this,Yn).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return G(this,xa).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=G(this,Yn).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=G(this,Yn).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(nc(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return G(this,Yn).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),i=G(this,Yn).get(r.queryHash),s=i==null?void 0:i.state.data,l=II(e,s);if(l!==void 0)return G(this,Yn).build(this,r).setData(l,{...n,manual:!0})}setQueriesData(t,e,n){return Mr.batch(()=>G(this,Yn).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=G(this,Yn).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=G(this,Yn);Mr.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=G(this,Yn),r={type:"active",...t};return Mr.batch(()=>(n.findAll(t).forEach(i=>{i.reset()}),this.refetchQueries(r,e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=Mr.batch(()=>G(this,Yn).findAll(t).map(i=>i.cancel(n)));return Promise.all(r).then(Mi).catch(Mi)}invalidateQueries(t,e={}){return Mr.batch(()=>{if(G(this,Yn).findAll(t).forEach(r=>{r.invalidate()}),(t==null?void 0:t.refetchType)==="none")return Promise.resolve();const n={...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"};return this.refetchQueries(n,e)})}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=Mr.batch(()=>G(this,Yn).findAll(t).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(Mi)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Mi)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=G(this,Yn).build(this,e);return n.isStaleByTime(nc(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Mi).catch(Mi)}fetchInfiniteQuery(t){return t.behavior=fE(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Mi).catch(Mi)}ensureInfiniteQueryData(t){return t.behavior=fE(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Yh.isOnline()?G(this,xa).resumePausedMutations():Promise.resolve()}getQueryCache(){return G(this,Yn)}getMutationCache(){return G(this,xa)}getDefaultOptions(){return G(this,Ma)}setDefaultOptions(t){Xe(this,Ma,t)}setQueryDefaults(t,e){G(this,gc).set(vf(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...G(this,gc).values()],n={};return e.forEach(r=>{_f(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){G(this,pc).set(vf(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...G(this,pc).values()];let n={};return e.forEach(r=>{_f(t,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...G(this,Ma).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=Uy(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===Ly&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...G(this,Ma).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){G(this,Yn).clear(),G(this,xa).clear()}},Yn=new WeakMap,xa=new WeakMap,Ma=new WeakMap,gc=new WeakMap,pc=new WeakMap,Oa=new WeakMap,mc=new WeakMap,vc=new WeakMap,cR),Kr,Xt,Vf,Hr,Po,_c,Pa,ps,Hf,yc,bc,No,Io,Na,Sc,on,Ku,k0,B0,U0,L0,z0,$0,V0,bR,uR,KI=(uR=class extends jf{constructor(e,n){super();St(this,on);St(this,Kr);St(this,Xt);St(this,Vf);St(this,Hr);St(this,Po);St(this,_c);St(this,Pa);St(this,ps);St(this,Hf);St(this,yc);St(this,bc);St(this,No);St(this,Io);St(this,Na);St(this,Sc,new Set);this.options=n,Xe(this,Kr,e),Xe(this,ps,null),Xe(this,Pa,F0()),this.options.experimental_prefetchInRender||G(this,Pa).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(G(this,Xt).addObserver(this),hE(G(this,Xt),this.options)?Wt(this,on,Ku).call(this):this.updateResult(),Wt(this,on,L0).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return H0(G(this,Xt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return H0(G(this,Xt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Wt(this,on,z0).call(this),Wt(this,on,$0).call(this),G(this,Xt).removeObserver(this)}setOptions(e,n){const r=this.options,i=G(this,Xt);if(this.options=G(this,Kr).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ki(this.options.enabled,G(this,Xt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Wt(this,on,V0).call(this),G(this,Xt).setOptions(this.options),r._defaulted&&!N0(this.options,r)&&G(this,Kr).getQueryCache().notify({type:"observerOptionsUpdated",query:G(this,Xt),observer:this});const s=this.hasListeners();s&&gE(G(this,Xt),i,this.options,r)&&Wt(this,on,Ku).call(this),this.updateResult(n),s&&(G(this,Xt)!==i||Ki(this.options.enabled,G(this,Xt))!==Ki(r.enabled,G(this,Xt))||nc(this.options.staleTime,G(this,Xt))!==nc(r.staleTime,G(this,Xt)))&&Wt(this,on,k0).call(this);const l=Wt(this,on,B0).call(this);s&&(G(this,Xt)!==i||Ki(this.options.enabled,G(this,Xt))!==Ki(r.enabled,G(this,Xt))||l!==G(this,Na))&&Wt(this,on,U0).call(this,l)}getOptimisticResult(e){const n=G(this,Kr).getQueryCache().build(G(this,Kr),e),r=this.createResult(n,e);return QI(this,r)&&(Xe(this,Hr,r),Xe(this,_c,this.options),Xe(this,Po,G(this,Xt).state)),r}getCurrentResult(){return G(this,Hr)}trackResult(e,n){const r={};return Object.keys(e).forEach(i=>{Object.defineProperty(r,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),n==null||n(i),e[i])})}),r}trackProp(e){G(this,Sc).add(e)}getCurrentQuery(){return G(this,Xt)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=G(this,Kr).defaultQueryOptions(e),r=G(this,Kr).getQueryCache().build(G(this,Kr),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(e){return Wt(this,on,Ku).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),G(this,Hr)))}createResult(e,n){var L;const r=G(this,Xt),i=this.options,s=G(this,Hr),l=G(this,Po),c=G(this,_c),d=e!==r?e.state:G(this,Vf),{state:g}=e;let m={...g},v=!1,S;if(n._optimisticResults){const I=this.hasListeners(),V=!I&&hE(e,n),B=I&&gE(e,r,n,i);(V||B)&&(m={...m,...yR(g.data,e.options)}),n._optimisticResults==="isRestoring"&&(m.fetchStatus="idle")}let{error:E,errorUpdatedAt:w,status:b}=m;if(n.select&&m.data!==void 0)if(s&&m.data===(l==null?void 0:l.data)&&n.select===G(this,Hf))S=G(this,yc);else try{Xe(this,Hf,n.select),S=n.select(m.data),S=D0(s==null?void 0:s.data,S,n),Xe(this,yc,S),Xe(this,ps,null)}catch(I){Xe(this,ps,I)}else S=m.data;if(n.placeholderData!==void 0&&S===void 0&&b==="pending"){let I;if(s!=null&&s.isPlaceholderData&&n.placeholderData===(c==null?void 0:c.placeholderData))I=s.data;else if(I=typeof n.placeholderData=="function"?n.placeholderData((L=G(this,bc))==null?void 0:L.state.data,G(this,bc)):n.placeholderData,n.select&&I!==void 0)try{I=n.select(I),Xe(this,ps,null)}catch(V){Xe(this,ps,V)}I!==void 0&&(b="success",S=D0(s==null?void 0:s.data,I,n),v=!0)}G(this,ps)&&(E=G(this,ps),S=G(this,yc),w=Date.now(),b="error");const A=m.fetchStatus==="fetching",T=b==="pending",C=b==="error",M=T&&A,x=S!==void 0,F={status:b,fetchStatus:m.fetchStatus,isPending:T,isSuccess:b==="success",isError:C,isInitialLoading:M,isLoading:M,data:S,dataUpdatedAt:m.dataUpdatedAt,error:E,errorUpdatedAt:w,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:m.dataUpdateCount>0||m.errorUpdateCount>0,isFetchedAfterMount:m.dataUpdateCount>d.dataUpdateCount||m.errorUpdateCount>d.errorUpdateCount,isFetching:A,isRefetching:A&&!T,isLoadingError:C&&!x,isPaused:m.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:C&&x,isStale:$y(e,n),refetch:this.refetch,promise:G(this,Pa)};if(this.options.experimental_prefetchInRender){const I=j=>{F.status==="error"?j.reject(F.error):F.data!==void 0&&j.resolve(F.data)},V=()=>{const j=Xe(this,Pa,F.promise=F0());I(j)},B=G(this,Pa);switch(B.status){case"pending":e.queryHash===r.queryHash&&I(B);break;case"fulfilled":(F.status==="error"||F.data!==B.value)&&V();break;case"rejected":(F.status!=="error"||F.error!==B.reason)&&V();break}}return F}updateResult(e){const n=G(this,Hr),r=this.createResult(G(this,Xt),this.options);if(Xe(this,Po,G(this,Xt).state),Xe(this,_c,this.options),G(this,Po).data!==void 0&&Xe(this,bc,G(this,Xt)),N0(r,n))return;Xe(this,Hr,r);const i={},s=()=>{if(!n)return!0;const{notifyOnChangeProps:l}=this.options,c=typeof l=="function"?l():l;if(c==="all"||!c&&!G(this,Sc).size)return!0;const f=new Set(c??G(this,Sc));return this.options.throwOnError&&f.add("error"),Object.keys(G(this,Hr)).some(d=>{const g=d;return G(this,Hr)[g]!==n[g]&&f.has(g)})};(e==null?void 0:e.listeners)!==!1&&s()&&(i.listeners=!0),Wt(this,on,bR).call(this,{...i,...e})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Wt(this,on,L0).call(this)}},Kr=new WeakMap,Xt=new WeakMap,Vf=new WeakMap,Hr=new WeakMap,Po=new WeakMap,_c=new WeakMap,Pa=new WeakMap,ps=new WeakMap,Hf=new WeakMap,yc=new WeakMap,bc=new WeakMap,No=new WeakMap,Io=new WeakMap,Na=new WeakMap,Sc=new WeakMap,on=new WeakSet,Ku=function(e){Wt(this,on,V0).call(this);let n=G(this,Xt).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(Mi)),n},k0=function(){Wt(this,on,z0).call(this);const e=nc(this.options.staleTime,G(this,Xt));if(Vo||G(this,Hr).isStale||!P0(e))return;const r=dR(G(this,Hr).dataUpdatedAt,e)+1;Xe(this,No,setTimeout(()=>{G(this,Hr).isStale||this.updateResult()},r))},B0=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(G(this,Xt)):this.options.refetchInterval)??!1},U0=function(e){Wt(this,on,$0).call(this),Xe(this,Na,e),!(Vo||Ki(this.options.enabled,G(this,Xt))===!1||!P0(G(this,Na))||G(this,Na)===0)&&Xe(this,Io,setInterval(()=>{(this.options.refetchIntervalInBackground||zy.isFocused())&&Wt(this,on,Ku).call(this)},G(this,Na)))},L0=function(){Wt(this,on,k0).call(this),Wt(this,on,U0).call(this,Wt(this,on,B0).call(this))},z0=function(){G(this,No)&&(clearTimeout(G(this,No)),Xe(this,No,void 0))},$0=function(){G(this,Io)&&(clearInterval(G(this,Io)),Xe(this,Io,void 0))},V0=function(){const e=G(this,Kr).getQueryCache().build(G(this,Kr),this.options);if(e===G(this,Xt))return;const n=G(this,Xt);Xe(this,Xt,e),Xe(this,Vf,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},bR=function(e){Mr.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(G(this,Hr))}),G(this,Kr).getQueryCache().notify({query:G(this,Xt),type:"observerResultsUpdated"})})},uR);function ZI(t,e){return Ki(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function hE(t,e){return ZI(t,e)||t.state.data!==void 0&&H0(t,e,e.refetchOnMount)}function H0(t,e,n){if(Ki(e.enabled,t)!==!1){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&$y(t,e)}return!1}function gE(t,e,n,r){return(t!==e||Ki(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&$y(t,n)}function $y(t,e){return Ki(e.enabled,t)!==!1&&t.isStaleByTime(nc(e.staleTime,t))}function QI(t,e){return!N0(t.getCurrentResult(),e)}var Tv={exports:{}},Ct={};/** + * @license React + * react.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var pE;function GI(){if(pE)return Ct;pE=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),m=Symbol.iterator;function v(P){return P===null||typeof P!="object"?null:(P=m&&P[m]||P["@@iterator"],typeof P=="function"?P:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,w={};function b(P,$,ie){this.props=P,this.context=$,this.refs=w,this.updater=ie||S}b.prototype.isReactComponent={},b.prototype.setState=function(P,$){if(typeof P!="object"&&typeof P!="function"&&P!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,P,$,"setState")},b.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function A(){}A.prototype=b.prototype;function T(P,$,ie){this.props=P,this.context=$,this.refs=w,this.updater=ie||S}var C=T.prototype=new A;C.constructor=T,E(C,b.prototype),C.isPureReactComponent=!0;var M=Array.isArray,x={H:null,A:null,T:null,S:null},N=Object.prototype.hasOwnProperty;function F(P,$,ie,se,q,ce){return ie=ce.ref,{$$typeof:t,type:P,key:$,ref:ie!==void 0?ie:null,props:ce}}function L(P,$){return F(P.type,$,void 0,void 0,void 0,P.props)}function I(P){return typeof P=="object"&&P!==null&&P.$$typeof===t}function V(P){var $={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(ie){return $[ie]})}var B=/\/+/g;function j(P,$){return typeof P=="object"&&P!==null&&P.key!=null?V(""+P.key):$.toString(36)}function X(){}function Y(P){switch(P.status){case"fulfilled":return P.value;case"rejected":throw P.reason;default:switch(typeof P.status=="string"?P.then(X,X):(P.status="pending",P.then(function($){P.status==="pending"&&(P.status="fulfilled",P.value=$)},function($){P.status==="pending"&&(P.status="rejected",P.reason=$)})),P.status){case"fulfilled":return P.value;case"rejected":throw P.reason}}throw P}function ae(P,$,ie,se,q){var ce=typeof P;(ce==="undefined"||ce==="boolean")&&(P=null);var fe=!1;if(P===null)fe=!0;else switch(ce){case"bigint":case"string":case"number":fe=!0;break;case"object":switch(P.$$typeof){case t:case e:fe=!0;break;case g:return fe=P._init,ae(fe(P._payload),$,ie,se,q)}}if(fe)return q=q(P),fe=se===""?"."+j(P,0):se,M(q)?(ie="",fe!=null&&(ie=fe.replace(B,"$&/")+"/"),ae(q,$,ie,"",function(Ae){return Ae})):q!=null&&(I(q)&&(q=L(q,ie+(q.key==null||P&&P.key===q.key?"":(""+q.key).replace(B,"$&/")+"/")+fe)),$.push(q)),1;fe=0;var ye=se===""?".":se+":";if(M(P))for(var we=0;we{const e=_.useContext(SR);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},e6=({client:t,children:e})=>(_.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),ar.jsx(SR.Provider,{value:t,children:e})),wR=_.createContext(!1),t6=()=>_.useContext(wR);wR.Provider;function n6(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var r6=_.createContext(n6()),i6=()=>_.useContext(r6);function s6(t,e){return typeof t=="function"?t(...e):!!t}function vE(){}var a6=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},o6=t=>{_.useEffect(()=>{t.clearReset()},[t])},l6=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:i})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(i&&t.data===void 0||s6(n,[t.error,r])),c6=t=>{const e=t.staleTime;t.suspense&&(t.staleTime=typeof e=="function"?(...n)=>Math.max(e(...n),1e3):Math.max(e??1e3,1e3),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3)))},u6=(t,e)=>t.isLoading&&t.isFetching&&!e,f6=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,_E=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function d6(t,e,n){var m,v,S,E,w;const r=JI(),i=t6(),s=i6(),l=r.defaultQueryOptions(t);(v=(m=r.getDefaultOptions().queries)==null?void 0:m._experimental_beforeQuery)==null||v.call(m,l),l._optimisticResults=i?"isRestoring":"optimistic",c6(l),a6(l,s),o6(s);const c=!r.getQueryCache().get(l.queryHash),[f]=_.useState(()=>new e(r,l)),d=f.getOptimisticResult(l),g=!i&&t.subscribed!==!1;if(_.useSyncExternalStore(_.useCallback(b=>{const A=g?f.subscribe(Mr.batchCalls(b)):vE;return f.updateResult(),A},[f,g]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),_.useEffect(()=>{f.setOptions(l,{listeners:!1})},[l,f]),f6(l,d))throw _E(l,f,s);if(l6({result:d,errorResetBoundary:s,throwOnError:l.throwOnError,query:r.getQueryCache().get(l.queryHash),suspense:l.suspense}))throw d.error;if((E=(S=r.getDefaultOptions().queries)==null?void 0:S._experimental_afterQuery)==null||E.call(S,l,d),l.experimental_prefetchInRender&&!Vo&&u6(d,i)){const b=c?_E(l,f,s):(w=r.getQueryCache().get(l.queryHash))==null?void 0:w.promise;b==null||b.catch(vE).finally(()=>{f.updateResult()})}return l.notifyOnChangeProps?d:f.trackResult(d)}function h6(t,e){return d6(t,KI)}const g6="modulepreload",p6=function(t){return"/"+t},yE={},m6=function(e,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),c=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));i=Promise.allSettled(n.map(f=>{if(f=p6(f),f in yE)return;yE[f]=!0;const d=f.endsWith(".css"),g=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${g}`))return;const m=document.createElement("link");if(m.rel=d?"stylesheet":g6,d||(m.as="script"),m.crossOrigin="",m.href=f,c&&m.setAttribute("nonce",c),document.head.appendChild(m),d)return new Promise((v,S)=>{m.addEventListener("load",v),m.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${f}`)))})}))}function s(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return i.then(l=>{for(const c of l||[])c.status==="rejected"&&s(c.reason);return e().catch(s)})};var v6=function(){return null},Av={exports:{}},Lu={},Cv={exports:{}},Rv={};/** + * @license React + * scheduler.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var bE;function _6(){return bE||(bE=1,function(t){function e(U,z){var W=U.length;U.push(z);e:for(;0>>1,P=U[Z];if(0>>1;Z<$;){var ie=2*(Z+1)-1,se=U[ie],q=ie+1,ce=U[q];if(0>i(se,W))qi(ce,se)?(U[Z]=ce,U[q]=W,Z=q):(U[Z]=se,U[ie]=W,Z=ie);else if(qi(ce,W))U[Z]=ce,U[q]=W,Z=q;else break e}}return z}function i(U,z){var W=U.sortIndex-z.sortIndex;return W!==0?W:U.id-z.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var l=Date,c=l.now();t.unstable_now=function(){return l.now()-c}}var f=[],d=[],g=1,m=null,v=3,S=!1,E=!1,w=!1,b=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function C(U){for(var z=n(d);z!==null;){if(z.callback===null)r(d);else if(z.startTime<=U)r(d),z.sortIndex=z.expirationTime,e(f,z);else break;z=n(d)}}function M(U){if(w=!1,C(U),!E)if(n(f)!==null)E=!0,Y();else{var z=n(d);z!==null&&ae(M,z.startTime-U)}}var x=!1,N=-1,F=5,L=-1;function I(){return!(t.unstable_now()-LU&&I());){var Z=m.callback;if(typeof Z=="function"){m.callback=null,v=m.priorityLevel;var P=Z(m.expirationTime<=U);if(U=t.unstable_now(),typeof P=="function"){m.callback=P,C(U),z=!0;break t}m===n(f)&&r(f),C(U)}else r(f);m=n(f)}if(m!==null)z=!0;else{var $=n(d);$!==null&&ae(M,$.startTime-U),z=!1}}break e}finally{m=null,v=W,S=!1}z=void 0}}finally{z?B():x=!1}}}var B;if(typeof T=="function")B=function(){T(V)};else if(typeof MessageChannel<"u"){var j=new MessageChannel,X=j.port2;j.port1.onmessage=V,B=function(){X.postMessage(null)}}else B=function(){b(V,0)};function Y(){x||(x=!0,B())}function ae(U,z){N=b(function(){U(t.unstable_now())},z)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(U){U.callback=null},t.unstable_continueExecution=function(){E||S||(E=!0,Y())},t.unstable_forceFrameRate=function(U){0>U||125Z?(U.sortIndex=W,e(d,U),n(f)===null&&U===n(d)&&(w?(A(N),N=-1):w=!0,ae(M,W-Z))):(U.sortIndex=P,e(f,U),E||S||(E=!0,Y())),U},t.unstable_shouldYield=I,t.unstable_wrapCallback=function(U){var z=v;return function(){var W=v;v=z;try{return U.apply(this,arguments)}finally{v=W}}}}(Rv)),Rv}var SE;function y6(){return SE||(SE=1,Cv.exports=_6()),Cv.exports}var xv={exports:{}},Dr={};/** + * @license React + * react-dom.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var wE;function b6(){if(wE)return Dr;wE=1;var t=Vy();function e(f){var d="https://react.dev/errors/"+f;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),xv.exports=b6(),xv.exports}/** + * @license React + * react-dom-client.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var TE;function S6(){if(TE)return Lu;TE=1;var t=y6(),e=Vy(),n=ER();function r(a){var o="https://react.dev/errors/"+a;if(1)":-1p||H[h]!==ee[p]){var pe=` +`+H[h].replace(" at new "," at ");return a.displayName&&pe.includes("")&&(pe=pe.replace("",a.displayName)),pe}while(1<=h&&0<=p);break}}}finally{Y=!1,Error.prepareStackTrace=u}return(u=a?a.displayName||a.name:"")?X(u):""}function U(a){switch(a.tag){case 26:case 27:case 5:return X(a.type);case 16:return X("Lazy");case 13:return X("Suspense");case 19:return X("SuspenseList");case 0:case 15:return a=ae(a.type,!1),a;case 11:return a=ae(a.type.render,!1),a;case 1:return a=ae(a.type,!0),a;default:return""}}function z(a){try{var o="";do o+=U(a),a=a.return;while(a);return o}catch(u){return` +Error generating stack: `+u.message+` +`+u.stack}}function W(a){var o=a,u=a;if(a.alternate)for(;o.return;)o=o.return;else{a=o;do o=a,o.flags&4098&&(u=o.return),a=o.return;while(a)}return o.tag===3?u:null}function Z(a){if(a.tag===13){var o=a.memoizedState;if(o===null&&(a=a.alternate,a!==null&&(o=a.memoizedState)),o!==null)return o.dehydrated}return null}function P(a){if(W(a)!==a)throw Error(r(188))}function $(a){var o=a.alternate;if(!o){if(o=W(a),o===null)throw Error(r(188));return o!==a?null:a}for(var u=a,h=o;;){var p=u.return;if(p===null)break;var y=p.alternate;if(y===null){if(h=p.return,h!==null){u=h;continue}break}if(p.child===y.child){for(y=p.child;y;){if(y===u)return P(p),a;if(y===h)return P(p),o;y=y.sibling}throw Error(r(188))}if(u.return!==h.return)u=p,h=y;else{for(var R=!1,D=p.child;D;){if(D===u){R=!0,u=p,h=y;break}if(D===h){R=!0,h=p,u=y;break}D=D.sibling}if(!R){for(D=y.child;D;){if(D===u){R=!0,u=y,h=p;break}if(D===h){R=!0,h=y,u=p;break}D=D.sibling}if(!R)throw Error(r(189))}}if(u.alternate!==h)throw Error(r(190))}if(u.tag!==3)throw Error(r(188));return u.stateNode.current===u?a:o}function ie(a){var o=a.tag;if(o===5||o===26||o===27||o===6)return a;for(a=a.child;a!==null;){if(o=ie(a),o!==null)return o;a=a.sibling}return null}var se=Array.isArray,q=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce={pending:!1,data:null,method:null,action:null},fe=[],ye=-1;function we(a){return{current:a}}function Ae(a){0>ye||(a.current=fe[ye],fe[ye]=null,ye--)}function Te(a,o){ye++,fe[ye]=a.current,a.current=o}var ve=we(null),ge=we(null),_e=we(null),Ie=we(null);function Ee(a,o){switch(Te(_e,o),Te(ge,a),Te(ve,null),a=o.nodeType,a){case 9:case 11:o=(o=o.documentElement)&&(o=o.namespaceURI)?Iw(o):0;break;default:if(a=a===8?o.parentNode:o,o=a.tagName,a=a.namespaceURI)a=Iw(a),o=Dw(a,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}Ae(ve),Te(ve,o)}function xe(){Ae(ve),Ae(ge),Ae(_e)}function Ve(a){a.memoizedState!==null&&Te(Ie,a);var o=ve.current,u=Dw(o,a.type);o!==u&&(Te(ge,a),Te(ve,u))}function Fe(a){ge.current===a&&(Ae(ve),Ae(ge)),Ie.current===a&&(Ae(Ie),Iu._currentValue=ce)}var Be=Object.prototype.hasOwnProperty,nt=t.unstable_scheduleCallback,He=t.unstable_cancelCallback,Ge=t.unstable_shouldYield,Pe=t.unstable_requestPaint,Me=t.unstable_now,dt=t.unstable_getCurrentPriorityLevel,rt=t.unstable_ImmediatePriority,it=t.unstable_UserBlockingPriority,st=t.unstable_NormalPriority,at=t.unstable_LowPriority,Je=t.unstable_IdlePriority,lt=t.log,ft=t.unstable_setDisableYieldValue,ct=null,mt=null;function xt(a){if(mt&&typeof mt.onCommitFiberRoot=="function")try{mt.onCommitFiberRoot(ct,a,void 0,(a.current.flags&128)===128)}catch{}}function Bt(a){if(typeof lt=="function"&&ft(a),mt&&typeof mt.setStrictMode=="function")try{mt.setStrictMode(ct,a)}catch{}}var ht=Math.clz32?Math.clz32:En,Vt=Math.log,qt=Math.LN2;function En(a){return a>>>=0,a===0?32:31-(Vt(a)/qt|0)|0}var Mn=128,Ut=4194304;function It(a){var o=a&42;if(o!==0)return o;switch(a&-a){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:return 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 a&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function Lt(a,o){var u=a.pendingLanes;if(u===0)return 0;var h=0,p=a.suspendedLanes,y=a.pingedLanes,R=a.warmLanes;a=a.finishedLanes!==0;var D=u&134217727;return D!==0?(u=D&~p,u!==0?h=It(u):(y&=D,y!==0?h=It(y):a||(R=D&~R,R!==0&&(h=It(R))))):(D=u&~p,D!==0?h=It(D):y!==0?h=It(y):a||(R=u&~R,R!==0&&(h=It(R)))),h===0?0:o!==0&&o!==h&&!(o&p)&&(p=h&-h,R=o&-o,p>=R||p===32&&(R&4194176)!==0)?o:h}function Jt(a,o){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&o)===0}function Mt(a,o){switch(a){case 1:case 2:case 4:case 8:return o+250;case 16:case 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 o+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function qe(){var a=Mn;return Mn<<=1,!(Mn&4194176)&&(Mn=128),a}function ke(){var a=Ut;return Ut<<=1,!(Ut&62914560)&&(Ut=4194304),a}function Ne(a){for(var o=[],u=0;31>u;u++)o.push(a);return o}function wt(a,o){a.pendingLanes|=o,o!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function en(a,o,u,h,p,y){var R=a.pendingLanes;a.pendingLanes=u,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=u,a.entangledLanes&=u,a.errorRecoveryDisabledLanes&=u,a.shellSuspendCounter=0;var D=a.entanglements,H=a.expirationTimes,ee=a.hiddenUpdates;for(u=R&~u;0"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vn=RegExp("^[: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]*$"),Pn={},Bn={};function Nr(a){return Be.call(Bn,a)?!0:Be.call(Pn,a)?!1:Vn.test(a)?Bn[a]=!0:(Pn[a]=!0,!1)}function er(a,o,u){if(Nr(o))if(u===null)a.removeAttribute(o);else{switch(typeof u){case"undefined":case"function":case"symbol":a.removeAttribute(o);return;case"boolean":var h=o.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){a.removeAttribute(o);return}}a.setAttribute(o,""+u)}}function Un(a,o,u){if(u===null)a.removeAttribute(o);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(o);return}a.setAttribute(o,""+u)}}function Tn(a,o,u,h){if(h===null)a.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(u);return}a.setAttributeNS(o,u,""+h)}}function Qn(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function Di(a){var o=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function Wr(a){var o=Di(a)?"checked":"value",u=Object.getOwnPropertyDescriptor(a.constructor.prototype,o),h=""+a[o];if(!a.hasOwnProperty(o)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var p=u.get,y=u.set;return Object.defineProperty(a,o,{configurable:!0,get:function(){return p.call(this)},set:function(R){h=""+R,y.call(this,R)}}),Object.defineProperty(a,o,{enumerable:u.enumerable}),{getValue:function(){return h},setValue:function(R){h=""+R},stopTracking:function(){a._valueTracker=null,delete a[o]}}}}function Fi(a){a._valueTracker||(a._valueTracker=Wr(a))}function ki(a){if(!a)return!1;var o=a._valueTracker;if(!o)return!0;var u=o.getValue(),h="";return a&&(h=Di(a)?a.checked?"true":"false":a.value),a=h,a!==u?(o.setValue(a),!0):!1}function Tt(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var yt=/[\n"\\]/g;function nn(a){return a.replace(yt,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function Hn(a,o,u,h,p,y,R,D){a.name="",R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?a.type=R:a.removeAttribute("type"),o!=null?R==="number"?(o===0&&a.value===""||a.value!=o)&&(a.value=""+Qn(o)):a.value!==""+Qn(o)&&(a.value=""+Qn(o)):R!=="submit"&&R!=="reset"||a.removeAttribute("value"),o!=null?Nn(a,R,Qn(o)):u!=null?Nn(a,R,Qn(u)):h!=null&&a.removeAttribute("value"),p==null&&y!=null&&(a.defaultChecked=!!y),p!=null&&(a.checked=p&&typeof p!="function"&&typeof p!="symbol"),D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?a.name=""+Qn(D):a.removeAttribute("name")}function An(a,o,u,h,p,y,R,D){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(a.type=y),o!=null||u!=null){if(!(y!=="submit"&&y!=="reset"||o!=null))return;u=u!=null?""+Qn(u):"",o=o!=null?""+Qn(o):u,D||o===a.value||(a.value=o),a.defaultValue=o}h=h??p,h=typeof h!="function"&&typeof h!="symbol"&&!!h,a.checked=D?a.checked:!!h,a.defaultChecked=!!h,R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"&&(a.name=R)}function Nn(a,o,u){o==="number"&&Tt(a.ownerDocument)===a||a.defaultValue===""+u||(a.defaultValue=""+u)}function tr(a,o,u,h){if(a=a.options,o){o={};for(var p=0;p=Qc),Qb=" ",Gb=!1;function Jb(a,o){switch(a){case"keyup":return GP.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function e1(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var al=!1;function eN(a,o){switch(a){case"compositionend":return e1(o);case"keypress":return o.which!==32?null:(Gb=!0,Qb);case"textInput":return a=o.data,a===Qb&&Gb?null:a;default:return null}}function tN(a,o){if(al)return a==="compositionend"||!Pp&&Jb(a,o)?(a=sl(),Ts=Cn=fn=null,al=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1=o)return{node:u,offset:o-a};a=h}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=l1(u)}}function u1(a,o){return a&&o?a===o?!0:a&&a.nodeType===3?!1:o&&o.nodeType===3?u1(a,o.parentNode):"contains"in a?a.contains(o):a.compareDocumentPosition?!!(a.compareDocumentPosition(o)&16):!1:!1}function f1(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var o=Tt(a.document);o instanceof a.HTMLIFrameElement;){try{var u=typeof o.contentWindow.location.href=="string"}catch{u=!1}if(u)a=o.contentWindow;else break;o=Tt(a.document)}return o}function Dp(a){var o=a&&a.nodeName&&a.nodeName.toLowerCase();return o&&(o==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||o==="textarea"||a.contentEditable==="true")}function cN(a,o){var u=f1(o);o=a.focusedElem;var h=a.selectionRange;if(u!==o&&o&&o.ownerDocument&&u1(o.ownerDocument.documentElement,o)){if(h!==null&&Dp(o)){if(a=h.start,u=h.end,u===void 0&&(u=a),"selectionStart"in o)o.selectionStart=a,o.selectionEnd=Math.min(u,o.value.length);else if(u=(a=o.ownerDocument||document)&&a.defaultView||window,u.getSelection){u=u.getSelection();var p=o.textContent.length,y=Math.min(h.start,p);h=h.end===void 0?y:Math.min(h.end,p),!u.extend&&y>h&&(p=h,h=y,y=p),p=c1(o,y);var R=c1(o,h);p&&R&&(u.rangeCount!==1||u.anchorNode!==p.node||u.anchorOffset!==p.offset||u.focusNode!==R.node||u.focusOffset!==R.offset)&&(a=a.createRange(),a.setStart(p.node,p.offset),u.removeAllRanges(),y>h?(u.addRange(a),u.extend(R.node,R.offset)):(a.setEnd(R.node,R.offset),u.addRange(a)))}}for(a=[],u=o;u=u.parentNode;)u.nodeType===1&&a.push({element:u,left:u.scrollLeft,top:u.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o=document.documentMode,ol=null,Fp=null,tu=null,kp=!1;function d1(a,o,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;kp||ol==null||ol!==Tt(h)||(h=ol,"selectionStart"in h&&Dp(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),tu&&eu(tu,h)||(tu=h,h=jd(Fp,"onSelect"),0>=R,p-=R,Cs=1<<32-ht(o)+p|u<vt?(_r=ot,ot=null):_r=ot.sibling;var Gt=ue(re,ot,le[vt],me);if(Gt===null){ot===null&&(ot=_r);break}a&&ot&&Gt.alternate===null&&o(re,ot),Q=y(Gt,Q,vt),Dt===null?Ke=Gt:Dt.sibling=Gt,Dt=Gt,ot=_r}if(vt===le.length)return u(re,ot),Qt&&Za(re,vt),Ke;if(ot===null){for(;vtvt?(_r=ot,ot=null):_r=ot.sibling;var pa=ue(re,ot,Gt.value,me);if(pa===null){ot===null&&(ot=_r);break}a&&ot&&pa.alternate===null&&o(re,ot),Q=y(pa,Q,vt),Dt===null?Ke=pa:Dt.sibling=pa,Dt=pa,ot=_r}if(Gt.done)return u(re,ot),Qt&&Za(re,vt),Ke;if(ot===null){for(;!Gt.done;vt++,Gt=le.next())Gt=Se(re,Gt.value,me),Gt!==null&&(Q=y(Gt,Q,vt),Dt===null?Ke=Gt:Dt.sibling=Gt,Dt=Gt);return Qt&&Za(re,vt),Ke}for(ot=h(ot);!Gt.done;vt++,Gt=le.next())Gt=he(ot,re,vt,Gt.value,me),Gt!==null&&(a&&Gt.alternate!==null&&ot.delete(Gt.key===null?vt:Gt.key),Q=y(Gt,Q,vt),Dt===null?Ke=Gt:Dt.sibling=Gt,Dt=Gt);return a&&ot.forEach(function(RI){return o(re,RI)}),Qt&&Za(re,vt),Ke}function Xn(re,Q,le,me){if(typeof le=="object"&&le!==null&&le.type===f&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case l:e:{for(var Ke=le.key;Q!==null;){if(Q.key===Ke){if(Ke=le.type,Ke===f){if(Q.tag===7){u(re,Q.sibling),me=p(Q,le.props.children),me.return=re,re=me;break e}}else if(Q.elementType===Ke||typeof Ke=="object"&&Ke!==null&&Ke.$$typeof===T&&M1(Ke)===Q.type){u(re,Q.sibling),me=p(Q,le.props),lu(me,le),me.return=re,re=me;break e}u(re,Q);break}else o(re,Q);Q=Q.sibling}le.type===f?(me=oo(le.props.children,re.mode,me,le.key),me.return=re,re=me):(me=Dd(le.type,le.key,le.props,null,re.mode,me),lu(me,le),me.return=re,re=me)}return R(re);case c:e:{for(Ke=le.key;Q!==null;){if(Q.key===Ke)if(Q.tag===4&&Q.stateNode.containerInfo===le.containerInfo&&Q.stateNode.implementation===le.implementation){u(re,Q.sibling),me=p(Q,le.children||[]),me.return=re,re=me;break e}else{u(re,Q);break}else o(re,Q);Q=Q.sibling}me=Um(le,re.mode,me),me.return=re,re=me}return R(re);case T:return Ke=le._init,le=Ke(le._payload),Xn(re,Q,le,me)}if(se(le))return tt(re,Q,le,me);if(N(le)){if(Ke=N(le),typeof Ke!="function")throw Error(r(150));return le=Ke.call(le),Et(re,Q,le,me)}if(typeof le.then=="function")return Xn(re,Q,pd(le),me);if(le.$$typeof===S)return Xn(re,Q,Pd(re,le),me);md(re,le)}return typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint"?(le=""+le,Q!==null&&Q.tag===6?(u(re,Q.sibling),me=p(Q,le),me.return=re,re=me):(u(re,Q),me=Bm(le,re.mode,me),me.return=re,re=me),R(re)):u(re,Q)}return function(re,Q,le,me){try{ou=0;var Ke=Xn(re,Q,le,me);return hl=null,Ke}catch(ot){if(ot===su)throw ot;var Dt=wi(29,ot,null,re.mode);return Dt.lanes=me,Dt.return=re,Dt}finally{}}}var Ga=O1(!0),P1=O1(!1),gl=we(null),vd=we(0);function N1(a,o){a=Us,Te(vd,a),Te(gl,o),Us=a|o.baseLanes}function jp(){Te(vd,Us),Te(gl,gl.current)}function Wp(){Us=vd.current,Ae(gl),Ae(vd)}var yi=we(null),is=null;function Qs(a){var o=a.alternate;Te(cr,cr.current&1),Te(yi,a),is===null&&(o===null||gl.current!==null||o.memoizedState!==null)&&(is=a)}function I1(a){if(a.tag===22){if(Te(cr,cr.current),Te(yi,a),is===null){var o=a.alternate;o!==null&&o.memoizedState!==null&&(is=a)}}else Gs()}function Gs(){Te(cr,cr.current),Te(yi,yi.current)}function xs(a){Ae(yi),is===a&&(is=null),Ae(cr)}var cr=we(0);function _d(a){for(var o=a;o!==null;){if(o.tag===13){var u=o.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||u.data==="$?"||u.data==="$!"))return o}else if(o.tag===19&&o.memoizedProps.revealOrder!==void 0){if(o.flags&128)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===a)break;for(;o.sibling===null;){if(o.return===null||o.return===a)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var gN=typeof AbortController<"u"?AbortController:function(){var a=[],o=this.signal={aborted:!1,addEventListener:function(u,h){a.push(h)}};this.abort=function(){o.aborted=!0,a.forEach(function(u){return u()})}},pN=t.unstable_scheduleCallback,mN=t.unstable_NormalPriority,ur={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Xp(){return{controller:new gN,data:new Map,refCount:0}}function cu(a){a.refCount--,a.refCount===0&&pN(mN,function(){a.controller.abort()})}var uu=null,qp=0,pl=0,ml=null;function vN(a,o){if(uu===null){var u=uu=[];qp=0,pl=Jm(),ml={status:"pending",value:void 0,then:function(h){u.push(h)}}}return qp++,o.then(D1,D1),o}function D1(){if(--qp===0&&uu!==null){ml!==null&&(ml.status="fulfilled");var a=uu;uu=null,pl=0,ml=null;for(var o=0;oy?y:8;var R=I.T,D={};I.T=D,um(a,!1,o,u);try{var H=p(),ee=I.S;if(ee!==null&&ee(D,H),H!==null&&typeof H=="object"&&typeof H.then=="function"){var pe=_N(H,h);hu(a,o,pe,ii(a))}else hu(a,o,h,ii(a))}catch(Se){hu(a,o,{then:function(){},status:"rejected",reason:Se},ii())}finally{q.p=y,I.T=R}}function EN(){}function lm(a,o,u,h){if(a.tag!==5)throw Error(r(476));var p=fS(a).queue;uS(a,p,o,ce,u===null?EN:function(){return dS(a),u(h)})}function fS(a){var o=a.memoizedState;if(o!==null)return o;o={memoizedState:ce,baseState:ce,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ms,lastRenderedState:ce},next:null};var u={};return o.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ms,lastRenderedState:u},next:null},a.memoizedState=o,a=a.alternate,a!==null&&(a.memoizedState=o),o}function dS(a){var o=fS(a).next.queue;hu(a,o,{},ii())}function cm(){return Ir(Iu)}function hS(){return rr().memoizedState}function gS(){return rr().memoizedState}function TN(a){for(var o=a.return;o!==null;){switch(o.tag){case 24:case 3:var u=ii();a=ra(u);var h=ia(o,a,u);h!==null&&($r(h,o,u),mu(h,o,u)),o={cache:Xp()},a.payload=o;return}o=o.return}}function AN(a,o,u){var h=ii();u={lane:h,revertLane:0,action:u,hasEagerState:!1,eagerState:null,next:null},Rd(a)?mS(o,u):(u=Lp(a,o,u,h),u!==null&&($r(u,a,h),vS(u,o,h)))}function pS(a,o,u){var h=ii();hu(a,o,u,h)}function hu(a,o,u,h){var p={lane:h,revertLane:0,action:u,hasEagerState:!1,eagerState:null,next:null};if(Rd(a))mS(o,p);else{var y=a.alternate;if(a.lanes===0&&(y===null||y.lanes===0)&&(y=o.lastRenderedReducer,y!==null))try{var R=o.lastRenderedState,D=y(R,u);if(p.hasEagerState=!0,p.eagerState=D,ei(D,R))return ud(a,o,p,0),Rn===null&&cd(),!1}catch{}finally{}if(u=Lp(a,o,p,h),u!==null)return $r(u,a,h),vS(u,o,h),!0}return!1}function um(a,o,u,h){if(h={lane:2,revertLane:Jm(),action:h,hasEagerState:!1,eagerState:null,next:null},Rd(a)){if(o)throw Error(r(479))}else o=Lp(a,u,h,2),o!==null&&$r(o,a,2)}function Rd(a){var o=a.alternate;return a===Pt||o!==null&&o===Pt}function mS(a,o){vl=bd=!0;var u=a.pending;u===null?o.next=o:(o.next=u.next,u.next=o),a.pending=o}function vS(a,o,u){if(u&4194176){var h=o.lanes;h&=a.pendingLanes,u|=h,o.lanes=u,Oe(a,u)}}var ss={readContext:Ir,use:Ed,useCallback:Gn,useContext:Gn,useEffect:Gn,useImperativeHandle:Gn,useLayoutEffect:Gn,useInsertionEffect:Gn,useMemo:Gn,useReducer:Gn,useRef:Gn,useState:Gn,useDebugValue:Gn,useDeferredValue:Gn,useTransition:Gn,useSyncExternalStore:Gn,useId:Gn};ss.useCacheRefresh=Gn,ss.useMemoCache=Gn,ss.useHostTransitionStatus=Gn,ss.useFormState=Gn,ss.useActionState=Gn,ss.useOptimistic=Gn;var to={readContext:Ir,use:Ed,useCallback:function(a,o){return Yr().memoizedState=[a,o===void 0?null:o],a},useContext:Ir,useEffect:nS,useImperativeHandle:function(a,o,u){u=u!=null?u.concat([a]):null,Ad(4194308,4,sS.bind(null,o,a),u)},useLayoutEffect:function(a,o){return Ad(4194308,4,a,o)},useInsertionEffect:function(a,o){Ad(4,2,a,o)},useMemo:function(a,o){var u=Yr();o=o===void 0?null:o;var h=a();if(eo){Bt(!0);try{a()}finally{Bt(!1)}}return u.memoizedState=[h,o],h},useReducer:function(a,o,u){var h=Yr();if(u!==void 0){var p=u(o);if(eo){Bt(!0);try{u(o)}finally{Bt(!1)}}}else p=o;return h.memoizedState=h.baseState=p,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:p},h.queue=a,a=a.dispatch=AN.bind(null,Pt,a),[h.memoizedState,a]},useRef:function(a){var o=Yr();return a={current:a},o.memoizedState=a},useState:function(a){a=rm(a);var o=a.queue,u=pS.bind(null,Pt,o);return o.dispatch=u,[a.memoizedState,u]},useDebugValue:am,useDeferredValue:function(a,o){var u=Yr();return om(u,a,o)},useTransition:function(){var a=rm(!1);return a=uS.bind(null,Pt,a.queue,!0,!1),Yr().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,o,u){var h=Pt,p=Yr();if(Qt){if(u===void 0)throw Error(r(407));u=u()}else{if(u=o(),Rn===null)throw Error(r(349));Kt&60||z1(h,o,u)}p.memoizedState=u;var y={value:u,getSnapshot:o};return p.queue=y,nS(V1.bind(null,h,y,a),[a]),h.flags|=2048,yl(9,$1.bind(null,h,y,u,o),{destroy:void 0},null),u},useId:function(){var a=Yr(),o=Rn.identifierPrefix;if(Qt){var u=Rs,h=Cs;u=(h&~(1<<32-ht(h)-1)).toString(32)+u,o=":"+o+"R"+u,u=Sd++,0 title"))),Ar(y,h,u),y[bt]=a,be(y),h=y;break e;case"link":var R=jw("link","href",p).get(h+(u.href||""));if(R){for(var D=0;D<\/script>",a=a.removeChild(a.firstChild);break;case"select":a=typeof h.is=="string"?p.createElement("select",{is:h.is}):p.createElement("select"),h.multiple?a.multiple=!0:h.size&&(a.size=h.size);break;default:a=typeof h.is=="string"?p.createElement(u,{is:h.is}):p.createElement(u)}}a[bt]=o,a[_t]=h;e:for(p=o.child;p!==null;){if(p.tag===5||p.tag===6)a.appendChild(p.stateNode);else if(p.tag!==4&&p.tag!==27&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===o)break e;for(;p.sibling===null;){if(p.return===null||p.return===o)break e;p=p.return}p.sibling.return=p.return,p=p.sibling}o.stateNode=a;e:switch(Ar(a,u,h),u){case"button":case"input":case"select":case"textarea":a=!!h.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&ks(o)}}return Ln(o),o.flags&=-16777217,null;case 6:if(a&&o.stateNode!=null)a.memoizedProps!==h&&ks(o);else{if(typeof h!="string"&&o.stateNode===null)throw Error(r(166));if(a=_e.current,nu(o)){if(a=o.stateNode,u=o.memoizedProps,h=null,p=zr,p!==null)switch(p.tag){case 27:case 5:h=p.memoizedProps}a[bt]=o,a=!!(a.nodeValue===u||h!==null&&h.suppressHydrationWarning===!0||Nw(a.nodeValue,u)),a||Qa(o)}else a=Xd(a).createTextNode(h),a[bt]=o,o.stateNode=a}return Ln(o),null;case 13:if(h=o.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(p=nu(o),h!==null&&h.dehydrated!==null){if(a===null){if(!p)throw Error(r(318));if(p=o.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(r(317));p[bt]=o}else ru(),!(o.flags&128)&&(o.memoizedState=null),o.flags|=4;Ln(o),p=!1}else zi!==null&&(Xm(zi),zi=null),p=!0;if(!p)return o.flags&256?(xs(o),o):(xs(o),null)}if(xs(o),o.flags&128)return o.lanes=u,o;if(u=h!==null,a=a!==null&&a.memoizedState!==null,u){h=o.child,p=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(p=h.alternate.memoizedState.cachePool.pool);var y=null;h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(y=h.memoizedState.cachePool.pool),y!==p&&(h.flags|=2048)}return u!==a&&u&&(o.child.flags|=8192),Fd(o,o.updateQueue),Ln(o),null;case 4:return xe(),a===null&&rv(o.stateNode.containerInfo),Ln(o),null;case 10:return Ns(o.type),Ln(o),null;case 19:if(Ae(cr),p=o.memoizedState,p===null)return Ln(o),null;if(h=(o.flags&128)!==0,y=p.rendering,y===null)if(h)Eu(p,!1);else{if(Wn!==0||a!==null&&a.flags&128)for(a=o.child;a!==null;){if(y=_d(a),y!==null){for(o.flags|=128,Eu(p,!1),a=y.updateQueue,o.updateQueue=a,Fd(o,a),o.subtreeFlags=0,a=u,u=o.child;u!==null;)aw(u,a),u=u.sibling;return Te(cr,cr.current&1|2),o.child}a=a.sibling}p.tail!==null&&Me()>kd&&(o.flags|=128,h=!0,Eu(p,!1),o.lanes=4194304)}else{if(!h)if(a=_d(y),a!==null){if(o.flags|=128,h=!0,a=a.updateQueue,o.updateQueue=a,Fd(o,a),Eu(p,!0),p.tail===null&&p.tailMode==="hidden"&&!y.alternate&&!Qt)return Ln(o),null}else 2*Me()-p.renderingStartTime>kd&&u!==536870912&&(o.flags|=128,h=!0,Eu(p,!1),o.lanes=4194304);p.isBackwards?(y.sibling=o.child,o.child=y):(a=p.last,a!==null?a.sibling=y:o.child=y,p.last=y)}return p.tail!==null?(o=p.tail,p.rendering=o,p.tail=o.sibling,p.renderingStartTime=Me(),o.sibling=null,a=cr.current,Te(cr,h?a&1|2:a&1),o):(Ln(o),null);case 22:case 23:return xs(o),Wp(),h=o.memoizedState!==null,a!==null?a.memoizedState!==null!==h&&(o.flags|=8192):h&&(o.flags|=8192),h?u&536870912&&!(o.flags&128)&&(Ln(o),o.subtreeFlags&6&&(o.flags|=8192)):Ln(o),u=o.updateQueue,u!==null&&Fd(o,u.retryQueue),u=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),h=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),h!==u&&(o.flags|=2048),a!==null&&Ae(Ja),null;case 24:return u=null,a!==null&&(u=a.memoizedState.cache),o.memoizedState.cache!==u&&(o.flags|=2048),Ns(ur),Ln(o),null;case 25:return null}throw Error(r(156,o.tag))}function NN(a,o){switch($p(o),o.tag){case 1:return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 3:return Ns(ur),xe(),a=o.flags,a&65536&&!(a&128)?(o.flags=a&-65537|128,o):null;case 26:case 27:case 5:return Fe(o),null;case 13:if(xs(o),a=o.memoizedState,a!==null&&a.dehydrated!==null){if(o.alternate===null)throw Error(r(340));ru()}return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 19:return Ae(cr),null;case 4:return xe(),null;case 10:return Ns(o.type),null;case 22:case 23:return xs(o),Wp(),a!==null&&Ae(Ja),a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 24:return Ns(ur),null;case 25:return null;default:return null}}function cw(a,o){switch($p(o),o.tag){case 3:Ns(ur),xe();break;case 26:case 27:case 5:Fe(o);break;case 4:xe();break;case 13:xs(o);break;case 19:Ae(cr);break;case 10:Ns(o.type);break;case 22:case 23:xs(o),Wp(),a!==null&&Ae(Ja);break;case 24:Ns(ur)}}var IN={getCacheForType:function(a){var o=Ir(ur),u=o.data.get(a);return u===void 0&&(u=a(),o.data.set(a,u)),u}},DN=typeof WeakMap=="function"?WeakMap:Map,zn=0,Rn=null,$t=null,Kt=0,xn=0,ri=null,Bs=!1,El=!1,Lm=!1,Us=0,Wn=0,ca=0,lo=0,zm=0,Ei=0,Tl=0,Tu=null,as=null,$m=!1,Vm=0,kd=1/0,Bd=null,ua=null,Ud=!1,co=null,Au=0,Hm=0,jm=null,Cu=0,Wm=null;function ii(){if(zn&2&&Kt!==0)return Kt&-Kt;if(I.T!==null){var a=pl;return a!==0?a:Jm()}return Ye()}function uw(){Ei===0&&(Ei=!(Kt&536870912)||Qt?qe():536870912);var a=yi.current;return a!==null&&(a.flags|=32),Ei}function $r(a,o,u){(a===Rn&&xn===2||a.cancelPendingCommit!==null)&&(Al(a,0),Ls(a,Kt,Ei,!1)),wt(a,u),(!(zn&2)||a!==Rn)&&(a===Rn&&(!(zn&2)&&(lo|=u),Wn===4&&Ls(a,Kt,Ei,!1)),os(a))}function fw(a,o,u){if(zn&6)throw Error(r(327));var h=!u&&(o&60)===0&&(o&a.expiredLanes)===0||Jt(a,o),p=h?BN(a,o):Km(a,o,!0),y=h;do{if(p===0){El&&!h&&Ls(a,o,0,!1);break}else if(p===6)Ls(a,o,0,!Bs);else{if(u=a.current.alternate,y&&!FN(u)){p=Km(a,o,!1),y=!1;continue}if(p===2){if(y=o,a.errorRecoveryDisabledLanes&y)var R=0;else R=a.pendingLanes&-536870913,R=R!==0?R:R&536870912?536870912:0;if(R!==0){o=R;e:{var D=a;p=Tu;var H=D.current.memoizedState.isDehydrated;if(H&&(Al(D,R).flags|=256),R=Km(D,R,!1),R!==2){if(Lm&&!H){D.errorRecoveryDisabledLanes|=y,lo|=y,p=4;break e}y=as,as=p,y!==null&&Xm(y)}p=R}if(y=!1,p!==2)continue}}if(p===1){Al(a,0),Ls(a,o,0,!0);break}e:{switch(h=a,p){case 0:case 1:throw Error(r(345));case 4:if((o&4194176)===o){Ls(h,o,Ei,!Bs);break e}break;case 2:as=null;break;case 3:case 5:break;default:throw Error(r(329))}if(h.finishedWork=u,h.finishedLanes=o,(o&62914560)===o&&(y=Vm+300-Me(),10u?32:u,I.T=null,co===null)var y=!1;else{u=jm,jm=null;var R=co,D=Au;if(co=null,Au=0,zn&6)throw Error(r(331));var H=zn;if(zn|=4,iw(R.current),tw(R,R.current,D,u),zn=H,Ru(0,!1),mt&&typeof mt.onPostCommitFiberRoot=="function")try{mt.onPostCommitFiberRoot(ct,R)}catch{}y=!0}return y}finally{q.p=p,I.T=h,bw(a,o)}}return!1}function Sw(a,o,u){o=mi(u,o),o=hm(a.stateNode,o,2),a=ia(a,o,2),a!==null&&(wt(a,2),os(a))}function yn(a,o,u){if(a.tag===3)Sw(a,a,u);else for(;o!==null;){if(o.tag===3){Sw(o,a,u);break}else if(o.tag===1){var h=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(ua===null||!ua.has(h))){a=mi(u,a),u=TS(2),h=ia(o,u,2),h!==null&&(AS(u,h,o,a),wt(h,2),os(h));break}}o=o.return}}function Zm(a,o,u){var h=a.pingCache;if(h===null){h=a.pingCache=new DN;var p=new Set;h.set(o,p)}else p=h.get(o),p===void 0&&(p=new Set,h.set(o,p));p.has(u)||(Lm=!0,p.add(u),a=zN.bind(null,a,o,u),o.then(a,a))}function zN(a,o,u){var h=a.pingCache;h!==null&&h.delete(o),a.pingedLanes|=a.suspendedLanes&u,a.warmLanes&=~u,Rn===a&&(Kt&u)===u&&(Wn===4||Wn===3&&(Kt&62914560)===Kt&&300>Me()-Vm?!(zn&2)&&Al(a,0):zm|=u,Tl===Kt&&(Tl=0)),os(a)}function ww(a,o){o===0&&(o=ke()),a=Zs(a,o),a!==null&&(wt(a,o),os(a))}function $N(a){var o=a.memoizedState,u=0;o!==null&&(u=o.retryLane),ww(a,u)}function VN(a,o){var u=0;switch(a.tag){case 13:var h=a.stateNode,p=a.memoizedState;p!==null&&(u=p.retryLane);break;case 19:h=a.stateNode;break;case 22:h=a.stateNode._retryCache;break;default:throw Error(r(314))}h!==null&&h.delete(o),ww(a,u)}function HN(a,o){return nt(a,o)}var $d=null,xl=null,Qm=!1,Vd=!1,Gm=!1,uo=0;function os(a){a!==xl&&a.next===null&&(xl===null?$d=xl=a:xl=xl.next=a),Vd=!0,Qm||(Qm=!0,WN(jN))}function Ru(a,o){if(!Gm&&Vd){Gm=!0;do for(var u=!1,h=$d;h!==null;){if(a!==0){var p=h.pendingLanes;if(p===0)var y=0;else{var R=h.suspendedLanes,D=h.pingedLanes;y=(1<<31-ht(42|a)+1)-1,y&=p&~(R&~D),y=y&201326677?y&201326677|1:y?y|2:0}y!==0&&(u=!0,Aw(h,y))}else y=Kt,y=Lt(h,h===Rn?y:0),!(y&3)||Jt(h,y)||(u=!0,Aw(h,y));h=h.next}while(u);Gm=!1}}function jN(){Vd=Qm=!1;var a=0;uo!==0&&(JN()&&(a=uo),uo=0);for(var o=Me(),u=null,h=$d;h!==null;){var p=h.next,y=Ew(h,o);y===0?(h.next=null,u===null?$d=p:u.next=p,p===null&&(xl=u)):(u=h,(a!==0||y&3)&&(Vd=!0)),h=p}Ru(a)}function Ew(a,o){for(var u=a.suspendedLanes,h=a.pingedLanes,p=a.expirationTimes,y=a.pendingLanes&-62914561;0"u"?null:document;function zw(a,o,u){var h=Ol;if(h&&typeof o=="string"&&o){var p=nn(o);p='link[rel="'+a+'"][href="'+p+'"]',typeof u=="string"&&(p+='[crossorigin="'+u+'"]'),Lw.has(p)||(Lw.add(p),a={rel:a,crossOrigin:u,href:o},h.querySelector(p)===null&&(o=h.createElement("link"),Ar(o,"link",a),be(o),h.head.appendChild(o)))}}function oI(a){zs.D(a),zw("dns-prefetch",a,null)}function lI(a,o){zs.C(a,o),zw("preconnect",a,o)}function cI(a,o,u){zs.L(a,o,u);var h=Ol;if(h&&a&&o){var p='link[rel="preload"][as="'+nn(o)+'"]';o==="image"&&u&&u.imageSrcSet?(p+='[imagesrcset="'+nn(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(p+='[imagesizes="'+nn(u.imageSizes)+'"]')):p+='[href="'+nn(a)+'"]';var y=p;switch(o){case"style":y=Pl(a);break;case"script":y=Nl(a)}Ti.has(y)||(a=V({rel:"preload",href:o==="image"&&u&&u.imageSrcSet?void 0:a,as:o},u),Ti.set(y,a),h.querySelector(p)!==null||o==="style"&&h.querySelector(Ou(y))||o==="script"&&h.querySelector(Pu(y))||(o=h.createElement("link"),Ar(o,"link",a),be(o),h.head.appendChild(o)))}}function uI(a,o){zs.m(a,o);var u=Ol;if(u&&a){var h=o&&typeof o.as=="string"?o.as:"script",p='link[rel="modulepreload"][as="'+nn(h)+'"][href="'+nn(a)+'"]',y=p;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=Nl(a)}if(!Ti.has(y)&&(a=V({rel:"modulepreload",href:a},o),Ti.set(y,a),u.querySelector(p)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Pu(y)))return}h=u.createElement("link"),Ar(h,"link",a),be(h),u.head.appendChild(h)}}}function fI(a,o,u){zs.S(a,o,u);var h=Ol;if(h&&a){var p=De(h).hoistableStyles,y=Pl(a);o=o||"default";var R=p.get(y);if(!R){var D={loading:0,preload:null};if(R=h.querySelector(Ou(y)))D.loading=5;else{a=V({rel:"stylesheet",href:a,"data-precedence":o},u),(u=Ti.get(y))&&dv(a,u);var H=R=h.createElement("link");be(H),Ar(H,"link",a),H._p=new Promise(function(ee,pe){H.onload=ee,H.onerror=pe}),H.addEventListener("load",function(){D.loading|=1}),H.addEventListener("error",function(){D.loading|=2}),D.loading|=4,Yd(R,o,h)}R={type:"stylesheet",instance:R,count:1,state:D},p.set(y,R)}}}function dI(a,o){zs.X(a,o);var u=Ol;if(u&&a){var h=De(u).hoistableScripts,p=Nl(a),y=h.get(p);y||(y=u.querySelector(Pu(p)),y||(a=V({src:a,async:!0},o),(o=Ti.get(p))&&hv(a,o),y=u.createElement("script"),be(y),Ar(y,"link",a),u.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},h.set(p,y))}}function hI(a,o){zs.M(a,o);var u=Ol;if(u&&a){var h=De(u).hoistableScripts,p=Nl(a),y=h.get(p);y||(y=u.querySelector(Pu(p)),y||(a=V({src:a,async:!0,type:"module"},o),(o=Ti.get(p))&&hv(a,o),y=u.createElement("script"),be(y),Ar(y,"link",a),u.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},h.set(p,y))}}function $w(a,o,u,h){var p=(p=_e.current)?qd(p):null;if(!p)throw Error(r(446));switch(a){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(o=Pl(u.href),u=De(p).hoistableStyles,h=u.get(o),h||(h={type:"style",instance:null,count:0,state:null},u.set(o,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){a=Pl(u.href);var y=De(p).hoistableStyles,R=y.get(a);if(R||(p=p.ownerDocument||p,R={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(a,R),(y=p.querySelector(Ou(a)))&&!y._p&&(R.instance=y,R.state.loading=5),Ti.has(a)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},Ti.set(a,u),y||gI(p,a,u,R.state))),o&&h===null)throw Error(r(528,""));return R}if(o&&h!==null)throw Error(r(529,""));return null;case"script":return o=u.async,u=u.src,typeof u=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=Nl(u),u=De(p).hoistableScripts,h=u.get(o),h||(h={type:"script",instance:null,count:0,state:null},u.set(o,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,a))}}function Pl(a){return'href="'+nn(a)+'"'}function Ou(a){return'link[rel="stylesheet"]['+a+"]"}function Vw(a){return V({},a,{"data-precedence":a.precedence,precedence:null})}function gI(a,o,u,h){a.querySelector('link[rel="preload"][as="style"]['+o+"]")?h.loading=1:(o=a.createElement("link"),h.preload=o,o.addEventListener("load",function(){return h.loading|=1}),o.addEventListener("error",function(){return h.loading|=2}),Ar(o,"link",u),be(o),a.head.appendChild(o))}function Nl(a){return'[src="'+nn(a)+'"]'}function Pu(a){return"script[async]"+a}function Hw(a,o,u){if(o.count++,o.instance===null)switch(o.type){case"style":var h=a.querySelector('style[data-href~="'+nn(u.href)+'"]');if(h)return o.instance=h,be(h),h;var p=V({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return h=(a.ownerDocument||a).createElement("style"),be(h),Ar(h,"style",p),Yd(h,u.precedence,a),o.instance=h;case"stylesheet":p=Pl(u.href);var y=a.querySelector(Ou(p));if(y)return o.state.loading|=4,o.instance=y,be(y),y;h=Vw(u),(p=Ti.get(p))&&dv(h,p),y=(a.ownerDocument||a).createElement("link"),be(y);var R=y;return R._p=new Promise(function(D,H){R.onload=D,R.onerror=H}),Ar(y,"link",h),o.state.loading|=4,Yd(y,u.precedence,a),o.instance=y;case"script":return y=Nl(u.src),(p=a.querySelector(Pu(y)))?(o.instance=p,be(p),p):(h=u,(p=Ti.get(y))&&(h=V({},u),hv(h,p)),a=a.ownerDocument||a,p=a.createElement("script"),be(p),Ar(p,"link",h),a.head.appendChild(p),o.instance=p);case"void":return null;default:throw Error(r(443,o.type))}else o.type==="stylesheet"&&!(o.state.loading&4)&&(h=o.instance,o.state.loading|=4,Yd(h,u.precedence,a));return o.instance}function Yd(a,o,u){for(var h=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=h.length?h[h.length-1]:null,y=p,R=0;R title"):null)}function pI(a,o,u){if(u===1||o.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;switch(o.rel){case"stylesheet":return a=o.disabled,typeof o.precedence=="string"&&a==null;default:return!0}case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function Xw(a){return!(a.type==="stylesheet"&&!(a.state.loading&3))}var Nu=null;function mI(){}function vI(a,o,u){if(Nu===null)throw Error(r(475));var h=Nu;if(o.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&!(o.state.loading&4)){if(o.instance===null){var p=Pl(u.href),y=a.querySelector(Ou(p));if(y){a=y._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(h.count++,h=Zd.bind(h),a.then(h,h)),o.state.loading|=4,o.instance=y,be(y);return}y=a.ownerDocument||a,u=Vw(u),(p=Ti.get(p))&&dv(u,p),y=y.createElement("link"),be(y);var R=y;R._p=new Promise(function(D,H){R.onload=D,R.onerror=H}),Ar(y,"link",u),o.instance=y}h.stylesheets===null&&(h.stylesheets=new Map),h.stylesheets.set(o,a),(a=o.state.preload)&&!(o.state.loading&3)&&(h.count++,o=Zd.bind(h),a.addEventListener("load",o),a.addEventListener("error",o))}}function _I(){if(Nu===null)throw Error(r(475));var a=Nu;return a.stylesheets&&a.count===0&&gv(a,a.stylesheets),0"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Av.exports=S6(),Av.exports}var E6=w6();function Kh(t,e){if(!t)throw new Error(e||"loader assertion failed.")}const Hy=!!(typeof process!="object"||String(process)!=="[object process]"||process.browser),CE=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);CE&&parseFloat(CE[1]);const oh=globalThis,Il=globalThis.process||{},T6=globalThis.navigator||{};function TR(t){var r,i;if(typeof window<"u"&&((r=window.process)==null?void 0:r.type)==="renderer"||typeof process<"u"&&((i=process.versions)!=null&&i.electron))return!0;const n=typeof navigator<"u"&&navigator.userAgent;return!!(n&&n.indexOf("Electron")>=0)}function qo(){return!(typeof process=="object"&&String(process)==="[object process]"&&!(process!=null&&process.browser))||TR()}function A6(t){return qo()?TR()?"Electron":(T6.userAgent||"").indexOf("Edge")>-1?"Edge":globalThis.chrome?"Chrome":globalThis.safari?"Safari":globalThis.mozInnerScreenX?"Firefox":"Unknown":"Node"}const AR="4.1.0";function C6(t){try{const e=window[t],n="__storage_test__";return e.setItem(n,n),e.removeItem(n),e}catch{return null}}class R6{constructor(e,n,r="sessionStorage"){this.storage=C6(r),this.id=e,this.config=n,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){if(Object.assign(this.config,e),this.storage){const n=JSON.stringify(this.config);this.storage.setItem(this.id,n)}}_loadConfiguration(){let e={};if(this.storage){const n=this.storage.getItem(this.id);e=n?JSON.parse(n):{}}return Object.assign(this.config,e),this}}function x6(t){let e;return t<10?e=`${t.toFixed(2)}ms`:t<100?e=`${t.toFixed(1)}ms`:t<1e3?e=`${t.toFixed(0)}ms`:e=`${(t/1e3).toFixed(2)}s`,e}function M6(t,e=8){const n=Math.max(e-t.length,0);return`${" ".repeat(n)}${t}`}var Zh;(function(t){t[t.BLACK=30]="BLACK",t[t.RED=31]="RED",t[t.GREEN=32]="GREEN",t[t.YELLOW=33]="YELLOW",t[t.BLUE=34]="BLUE",t[t.MAGENTA=35]="MAGENTA",t[t.CYAN=36]="CYAN",t[t.WHITE=37]="WHITE",t[t.BRIGHT_BLACK=90]="BRIGHT_BLACK",t[t.BRIGHT_RED=91]="BRIGHT_RED",t[t.BRIGHT_GREEN=92]="BRIGHT_GREEN",t[t.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",t[t.BRIGHT_BLUE=94]="BRIGHT_BLUE",t[t.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",t[t.BRIGHT_CYAN=96]="BRIGHT_CYAN",t[t.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(Zh||(Zh={}));const O6=10;function RE(t){return typeof t!="string"?t:(t=t.toUpperCase(),Zh[t]||Zh.WHITE)}function P6(t,e,n){return!qo&&typeof t=="string"&&(e&&(t=`\x1B[${RE(e)}m${t}\x1B[39m`),n&&(t=`\x1B[${RE(n)+O6}m${t}\x1B[49m`)),t}function N6(t,e=["constructor"]){const n=Object.getPrototypeOf(t),r=Object.getOwnPropertyNames(n),i=t;for(const s of r){const l=i[s];typeof l=="function"&&(e.find(c=>s===c)||(i[s]=l.bind(t)))}}function jy(t,e){if(!t)throw new Error("Assertion failed")}function Dl(){var e,n,r;let t;if(qo()&&oh.performance)t=(n=(e=oh==null?void 0:oh.performance)==null?void 0:e.now)==null?void 0:n.call(e);else if("hrtime"in Il){const i=(r=Il==null?void 0:Il.hrtime)==null?void 0:r.call(Il);t=i[0]*1e3+i[1]/1e6}else t=Date.now();return t}const Fl={debug:qo()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},I6={enabled:!0,level:0};function kl(){}const xE={},ME={once:!0};class Wf{constructor({id:e}={id:""}){this.VERSION=AR,this._startTs=Dl(),this._deltaTs=Dl(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new R6(`__probe-${this.id}__`,I6),this.timeStamp(`${this.id} started`),N6(this),Object.seal(this)}set level(e){this.setLevel(e)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((Dl()-this._startTs).toPrecision(10))}getDelta(){return Number((Dl()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(e=!0){return this._storage.setConfiguration({enabled:e}),this}setLevel(e){return this._storage.setConfiguration({level:e}),this}get(e){return this._storage.config[e]}set(e,n){this._storage.setConfiguration({[e]:n})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(e,n){if(!e)throw new Error(n||"Assertion failed")}warn(e){return this._getLogFunction(0,e,Fl.warn,arguments,ME)}error(e){return this._getLogFunction(0,e,Fl.error,arguments)}deprecated(e,n){return this.warn(`\`${e}\` is deprecated and will be removed in a later version. Use \`${n}\` instead`)}removed(e,n){return this.error(`\`${e}\` has been removed. Use \`${n}\` instead`)}probe(e,n){return this._getLogFunction(e,n,Fl.log,arguments,{time:!0,once:!0})}log(e,n){return this._getLogFunction(e,n,Fl.debug,arguments)}info(e,n){return this._getLogFunction(e,n,console.info,arguments)}once(e,n){return this._getLogFunction(e,n,Fl.debug||Fl.info,arguments,ME)}table(e,n,r){return n?this._getLogFunction(e,n,console.table||kl,r&&[r],{tag:F6(n)}):kl}time(e,n){return this._getLogFunction(e,n,console.time?console.time:console.info)}timeEnd(e,n){return this._getLogFunction(e,n,console.timeEnd?console.timeEnd:console.info)}timeStamp(e,n){return this._getLogFunction(e,n,console.timeStamp||kl)}group(e,n,r={collapsed:!1}){const i=OE({logLevel:e,message:n,opts:r}),{collapsed:s}=r;return i.method=(s?console.groupCollapsed:console.group)||console.info,this._getLogFunction(i)}groupCollapsed(e,n,r={}){return this.group(e,n,Object.assign({},r,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||kl)}withGroup(e,n,r){this.group(e,n)();try{r()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=CR(e)}_getLogFunction(e,n,r,i,s){if(this._shouldLog(e)){s=OE({logLevel:e,message:n,args:i,opts:s}),r=r||s.method,jy(r),s.total=this.getTotal(),s.delta=this.getDelta(),this._deltaTs=Dl();const l=s.tag||s.message;if(s.once&&l)if(!xE[l])xE[l]=Dl();else return kl;return n=D6(this.id,s.message,s),r.bind(console,n,...s.args)}return kl}}Wf.VERSION=AR;function CR(t){if(!t)return 0;let e;switch(typeof t){case"number":e=t;break;case"object":e=t.logLevel||t.priority||0;break;default:return 0}return jy(Number.isFinite(e)&&e>=0),e}function OE(t){const{logLevel:e,message:n}=t;t.logLevel=CR(e);const r=t.args?Array.from(t.args):[];for(;r.length&&r.shift()!==n;);switch(typeof e){case"string":case"function":n!==void 0&&r.unshift(n),t.message=e;break;case"object":Object.assign(t,e);break}typeof t.message=="function"&&(t.message=t.message());const i=typeof t.message;return jy(i==="string"||i==="object"),Object.assign(t,{args:r},t.opts)}function D6(t,e,n){if(typeof e=="string"){const r=n.time?M6(x6(n.total)):"";e=n.time?`${t}: ${r} ${e}`:`${t}: ${e}`,e=P6(e,n.color,n.background)}return e}function F6(t){for(const e in t)for(const n in t[e])return n||"untitled";return"empty"}const Mv="4.3.2",k6=Mv[0]>="0"&&Mv[0]<="9"?`v${Mv}`:"";function B6(){const t=new Wf({id:"loaders.gl"});return globalThis.loaders=globalThis.loaders||{},globalThis.loaders.log=t,globalThis.loaders.version=k6,globalThis.probe=globalThis.probe||{},globalThis.probe.loaders=t,t}const U6=B6();function L6(t,e){return RR(t||{},e)}function RR(t,e,n=0){if(n>3)return e;const r={...t};for(const[i,s]of Object.entries(e))s&&typeof s=="object"&&!Array.isArray(s)?r[i]=RR(r[i]||{},e[i],n+1):r[i]=e[i];return r}const z6="latest";function $6(){var t;return(t=globalThis._loadersgl_)!=null&&t.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.3.2"),globalThis._loadersgl_.version}const V6=$6();function za(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}const Do=typeof process!="object"||String(process)!=="[object process]"||process.browser,H6=typeof window<"u"&&typeof window.orientation<"u",PE=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);PE&&parseFloat(PE[1]);class j6{constructor(e,n){O(this,"name");O(this,"workerThread");O(this,"isRunning",!0);O(this,"result");O(this,"_resolve",()=>{});O(this,"_reject",()=>{});this.name=e,this.workerThread=n,this.result=new Promise((r,i)=>{this._resolve=r,this._reject=i})}postMessage(e,n){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:n})}done(e){za(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){za(this.isRunning),this.isRunning=!1,this._reject(e)}}class Ov{terminate(){}}const Pv=new Map;function W6(t){za(t.source&&!t.url||!t.source&&t.url);let e=Pv.get(t.source||t.url);return e||(t.url&&(e=X6(t.url),Pv.set(t.url,e)),t.source&&(e=xR(t.source),Pv.set(t.source,e))),za(e),e}function X6(t){if(!t.startsWith("http"))return t;const e=q6(t);return xR(e)}function xR(t){const e=new Blob([t],{type:"application/javascript"});return URL.createObjectURL(e)}function q6(t){return`try { + importScripts('${t}'); +} catch (error) { + console.error(error); + throw error; +}`}function MR(t,e=!0,n){const r=n||new Set;if(t){if(NE(t))r.add(t);else if(NE(t.buffer))r.add(t.buffer);else if(!ArrayBuffer.isView(t)){if(e&&typeof t=="object")for(const i in t)MR(t[i],e,r)}}return n===void 0?Array.from(r):[]}function NE(t){return t?t instanceof ArrayBuffer||typeof MessagePort<"u"&&t instanceof MessagePort||typeof ImageBitmap<"u"&&t instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas:!1}const Nv=()=>{};class j0{constructor(e){O(this,"name");O(this,"source");O(this,"url");O(this,"terminated",!1);O(this,"worker");O(this,"onMessage");O(this,"onError");O(this,"_loadableURL","");const{name:n,source:r,url:i}=e;za(r||i),this.name=n,this.source=r,this.url=i,this.onMessage=Nv,this.onError=s=>console.log(s),this.worker=Do?this._createBrowserWorker():this._createNodeWorker()}static isSupported(){return typeof Worker<"u"&&Do||typeof Ov<"u"&&!Do}destroy(){this.onMessage=Nv,this.onError=Nv,this.worker.terminate(),this.terminated=!0}get isRunning(){return!!this.onMessage}postMessage(e,n){n=n||MR(e),this.worker.postMessage(e,n)}_getErrorFromErrorEvent(e){let n="Failed to load ";return n+=`worker ${this.name} from ${this.url}. `,e.message&&(n+=`${e.message} in `),e.lineno&&(n+=`:${e.lineno}:${e.colno}`),new Error(n)}_createBrowserWorker(){this._loadableURL=W6({source:this.source,url:this.url});const e=new Worker(this._loadableURL,{name:this.name});return e.onmessage=n=>{n.data?this.onMessage(n.data):this.onError(new Error("No data received"))},e.onerror=n=>{this.onError(this._getErrorFromErrorEvent(n)),this.terminated=!0},e.onmessageerror=n=>console.error(n),e}_createNodeWorker(){let e;if(this.url){const r=this.url.includes(":/")||this.url.startsWith("/")?this.url:`./${this.url}`;e=new Ov(r,{eval:!1})}else if(this.source)e=new Ov(this.source,{eval:!0});else throw new Error("no worker");return e.on("message",n=>{this.onMessage(n)}),e.on("error",n=>{this.onError(n)}),e.on("exit",n=>{}),e}}class Y6{constructor(e){O(this,"name","unnamed");O(this,"source");O(this,"url");O(this,"maxConcurrency",1);O(this,"maxMobileConcurrency",1);O(this,"onDebug",()=>{});O(this,"reuseWorkers",!0);O(this,"props",{});O(this,"jobQueue",[]);O(this,"idleQueue",[]);O(this,"count",0);O(this,"isDestroyed",!1);this.source=e.source,this.url=e.url,this.setProps(e)}static isSupported(){return j0.isSupported()}destroy(){this.idleQueue.forEach(e=>e.destroy()),this.isDestroyed=!0}setProps(e){this.props={...this.props,...e},e.name!==void 0&&(this.name=e.name),e.maxConcurrency!==void 0&&(this.maxConcurrency=e.maxConcurrency),e.maxMobileConcurrency!==void 0&&(this.maxMobileConcurrency=e.maxMobileConcurrency),e.reuseWorkers!==void 0&&(this.reuseWorkers=e.reuseWorkers),e.onDebug!==void 0&&(this.onDebug=e.onDebug)}async startJob(e,n=(i,s,l)=>i.done(l),r=(i,s)=>i.error(s)){const i=new Promise(s=>(this.jobQueue.push({name:e,onMessage:n,onError:r,onStart:s}),this));return this._startQueuedJob(),await i}async _startQueuedJob(){if(!this.jobQueue.length)return;const e=this._getAvailableWorker();if(!e)return;const n=this.jobQueue.shift();if(n){this.onDebug({message:"Starting job",name:n.name,workerThread:e,backlog:this.jobQueue.length});const r=new j6(n.name,e);e.onMessage=i=>n.onMessage(r,i.type,i.payload),e.onError=i=>n.onError(r,i),n.onStart(r);try{await r.result}catch(i){console.error(`Worker exception: ${i}`)}finally{this.returnWorkerToQueue(e)}}}returnWorkerToQueue(e){!Do||this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count{}},Ta=class Ta{constructor(e){O(this,"props");O(this,"workerPools",new Map);this.props={...K6},this.setProps(e),this.workerPools=new Map}static isSupported(){return j0.isSupported()}static getWorkerFarm(e={}){return Ta._workerFarm=Ta._workerFarm||new Ta({}),Ta._workerFarm.setProps(e),Ta._workerFarm}destroy(){for(const e of this.workerPools.values())e.destroy();this.workerPools=new Map}setProps(e){this.props={...this.props,...e};for(const n of this.workerPools.values())n.setProps(this._getWorkerPoolProps())}getWorkerPool(e){const{name:n,source:r,url:i}=e;let s=this.workerPools.get(n);return s||(s=new Y6({name:n,source:r,url:i}),s.setProps(this._getWorkerPoolProps()),this.workerPools.set(n,s)),s}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}};O(Ta,"_workerFarm");let Qh=Ta;function Z6(t,e={}){const n=e[t.id]||{},r=Do?`${t.id}-worker.js`:`${t.id}-worker-node.js`;let i=n.workerUrl;if(!i&&t.id==="compression"&&(i=e.workerUrl),e._workerType==="test"&&(Do?i=`modules/${t.module}/dist/${r}`:i=`modules/${t.module}/src/workers/${t.id}-worker-node.ts`),!i){let s=t.version;s==="latest"&&(s=z6);const l=s?`@${s}`:"";i=`https://unpkg.com/@loaders.gl/${t.module}${l}/dist/${r}`}return za(i),i}function Q6(t,e=V6){za(t,"no worker provided");const n=t.version;return!(!e||!n)}function G6(t,e){return!Qh.isSupported()||!Do&&!(e!=null&&e._nodeWorkers)?!1:t.worker&&(e==null?void 0:e.worker)}async function J6(t,e,n,r,i){const s=t.id,l=Z6(t,n),f=Qh.getWorkerFarm(n).getWorkerPool({name:s,url:l});n=JSON.parse(JSON.stringify(n)),r=JSON.parse(JSON.stringify(r||{}));const d=await f.startJob("process-on-worker",eD.bind(null,i));return d.postMessage("process",{input:e,options:n,context:r}),await(await d.result).result}async function eD(t,e,n,r){switch(n){case"done":e.done(r);break;case"error":e.error(new Error(r.error));break;case"process":const{id:i,input:s,options:l}=r;try{const c=await t(s,l);e.postMessage("done",{id:i,result:c})}catch(c){const f=c instanceof Error?c.message:"unknown error";e.postMessage("error",{id:i,error:f})}break;default:console.warn(`parse-with-worker unknown message ${n}`)}}function tD(t,e,n){if(n=n||t.byteLength,t.byteLengths instanceof ArrayBuffer?new Uint8Array(s):s),n=e.reduce((s,l)=>s+l.byteLength,0),r=new Uint8Array(n);let i=0;for(const s of e)r.set(s,i),i+=s.byteLength;return r.buffer}async function iD(t){const e=[];for await(const n of t)e.push(n);return nD(...e)}function IE(){let t;if(typeof window<"u"&&window.performance)t=window.performance.now();else if(typeof process<"u"&&process.hrtime){const e=process.hrtime();t=e[0]*1e3+e[1]/1e6}else t=Date.now();return t}class DE{constructor(e,n){this.sampleSize=1,this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this.name=e,this.type=n,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(e){return this.sampleSize=e,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(e){return this._count+=e,this._samples++,this._checkSampling(),this}subtractCount(e){return this._count-=e,this._samples++,this._checkSampling(),this}addTime(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=IE(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(IE()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}class ip{constructor(e){this.stats={},this.id=e.id,this.stats={},this._initializeStats(e.stats),Object.seal(this)}get(e,n="count"){return this._getOrCreate({name:e,type:n})}get size(){return Object.keys(this.stats).length}reset(){for(const e of Object.values(this.stats))e.reset();return this}forEach(e){for(const n of Object.values(this.stats))e(n)}getTable(){const e={};return this.forEach(n=>{e[n.name]={time:n.time||0,count:n.count||0,average:n.getAverageTime()||0,hz:n.getHz()||0}}),e}_initializeStats(e=[]){e.forEach(n=>this._getOrCreate(n))}_getOrCreate(e){const{name:n,type:r}=e;let i=this.stats[n];return i||(e instanceof DE?i=e:i=new DE(n,r),this.stats[n]=i),i}}let sD="";const FE={};function aD(t){for(const e in FE)if(t.startsWith(e)){const n=FE[e];t=t.replace(e,n)}return!t.startsWith("http://")&&!t.startsWith("https://")&&(t=`${sD}${t}`),t}function oD(t){return t&&typeof t=="object"&&t.isBuffer}function OR(t){if(oD(t))return t;if(t instanceof ArrayBuffer)return t;if(ArrayBuffer.isView(t))return t.byteOffset===0&&t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);if(typeof t=="string"){const e=t;return new TextEncoder().encode(e).buffer}if(t&&typeof t=="object"&&t._toArrayBuffer)return t._toArrayBuffer();throw new Error("toArrayBuffer")}function PR(t){const e=t?t.lastIndexOf("/"):-1;return e>=0?t.substr(e+1):""}function lD(t){const e=t?t.lastIndexOf("/"):-1;return e>=0?t.substr(0,e):""}const cD=t=>typeof t=="boolean",nf=t=>typeof t=="function",Xf=t=>t!==null&&typeof t=="object",kE=t=>Xf(t)&&t.constructor==={}.constructor,uD=t=>!!t&&typeof t[Symbol.iterator]=="function",fD=t=>t&&typeof t[Symbol.asyncIterator]=="function",Yo=t=>typeof Response<"u"&&t instanceof Response||t&&t.arrayBuffer&&t.text&&t.json,Ko=t=>typeof Blob<"u"&&t instanceof Blob,dD=t=>t&&typeof t=="object"&&t.isBuffer,hD=t=>typeof ReadableStream<"u"&&t instanceof ReadableStream||Xf(t)&&nf(t.tee)&&nf(t.cancel)&&nf(t.getReader),gD=t=>Xf(t)&&nf(t.read)&&nf(t.pipe)&&cD(t.readable),NR=t=>hD(t)||gD(t);class pD extends Error{constructor(n,r){super(n);O(this,"reason");O(this,"url");O(this,"response");this.reason=r.reason,this.url=r.url,this.response=r.response}}const mD=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,vD=/^([-\w.]+\/[-\w.+]+)/;function BE(t,e){return t.toLowerCase()===e.toLowerCase()}function _D(t){const e=vD.exec(t);return e?e[1]:t}function UE(t){const e=mD.exec(t);return e?e[1]:""}const IR=/\?.*/;function yD(t){const e=t.match(IR);return e&&e[0]}function Wy(t){return t.replace(IR,"")}function bD(t){if(t.length<50)return t;const e=t.slice(t.length-15);return`${t.substr(0,32)}...${e}`}function sp(t){return Yo(t)?t.url:Ko(t)?t.name||"":typeof t=="string"?t:""}function Xy(t){if(Yo(t)){const e=t,n=e.headers.get("content-type")||"",r=Wy(e.url);return _D(n)||UE(r)}return Ko(t)?t.type||"":typeof t=="string"?UE(t):""}function SD(t){return Yo(t)?t.headers["content-length"]||-1:Ko(t)?t.size:typeof t=="string"?t.length:t instanceof ArrayBuffer||ArrayBuffer.isView(t)?t.byteLength:-1}async function DR(t){if(Yo(t))return t;const e={},n=SD(t);n>=0&&(e["content-length"]=String(n));const r=sp(t),i=Xy(t);i&&(e["content-type"]=i);const s=await TD(t);s&&(e["x-first-bytes"]=s),typeof t=="string"&&(t=new TextEncoder().encode(t));const l=new Response(t,{headers:e});return Object.defineProperty(l,"url",{value:r}),l}async function wD(t){if(!t.ok)throw await ED(t)}async function ED(t){const e=bD(t.url);let n=`Failed to fetch resource (${t.status}) ${t.statusText}: ${e}`;n=n.length>100?`${n.slice(0,100)}...`:n;const r={reason:t.statusText,url:t.url,response:t};try{const i=t.headers.get("Content-Type");r.reason=!t.bodyUsed&&(i!=null&&i.includes("application/json"))?await t.json():await t.text()}catch{}return new pD(n,r)}async function TD(t){if(typeof t=="string")return`data:,${t.slice(0,5)}`;if(t instanceof Blob){const n=t.slice(0,5);return await new Promise(r=>{const i=new FileReader;i.onload=s=>{var l;return r((l=s==null?void 0:s.target)==null?void 0:l.result)},i.readAsDataURL(n)})}if(t instanceof ArrayBuffer){const n=t.slice(0,5);return`data:base64,${AD(n)}`}return null}function AD(t){let e="";const n=new Uint8Array(t);for(let r=0;r{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}class OD{constructor(){O(this,"console");this.console=console}log(...e){return this.console.log.bind(this.console,...e)}info(...e){return this.console.info.bind(this.console,...e)}warn(...e){return this.console.warn.bind(this.console,...e)}error(...e){return this.console.error.bind(this.console,...e)}}const FR={fetch:null,mimeType:void 0,nothrow:!1,log:new OD,useLocalLibraries:!1,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:Hy,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},PD={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function kR(){globalThis.loaders=globalThis.loaders||{};const{loaders:t}=globalThis;return t._state||(t._state={}),t._state}function BR(){const t=kR();return t.globalOptions=t.globalOptions||{...FR},t.globalOptions}function ND(t,e,n,r){return n=n||[],n=Array.isArray(n)?n:[n],ID(t,n),FD(e,t,r)}function ID(t,e){$E(t,null,FR,PD,e);for(const n of e){const r=t&&t[n.id]||{},i=n.options&&n.options[n.id]||{},s=n.deprecatedOptions&&n.deprecatedOptions[n.id]||{};$E(r,n.id,i,s,e)}}function $E(t,e,n,r,i){const s=e||"Top level",l=e?`${e}.`:"";for(const c in t){const f=!e&&Xf(t[c]),d=c==="baseUri"&&!e,g=c==="workerUrl"&&e;if(!(c in n)&&!d&&!g){if(c in r)zE.warn(`${s} loader option '${l}${c}' no longer supported, use '${r[c]}'`)();else if(!f){const m=DD(c,i);zE.warn(`${s} loader option '${l}${c}' not recognized. ${m}`)()}}}}function DD(t,e){const n=t.toLowerCase();let r="";for(const i of e)for(const s in i.options){if(t===s)return`Did you mean '${i.id}.${s}'?`;const l=s.toLowerCase();(n.startsWith(l)||l.startsWith(n))&&(r=r||`Did you mean '${i.id}.${s}'?`)}return r}function FD(t,e,n){const i={...t.options||{}};return kD(i,n),i.log===null&&(i.log=new MD),VE(i,BR()),VE(i,e),i}function VE(t,e){for(const n in e)if(n in e){const r=e[n];kE(r)&&kE(t[n])?t[n]={...t[n],...e[n]}:t[n]=e[n]}}function kD(t,e){e&&!("baseUri"in t)&&(t.baseUri=e)}function qy(t){return t?(Array.isArray(t)&&(t=t[0]),Array.isArray(t==null?void 0:t.extensions)):!1}function Yy(t){Kh(t,"null loader"),Kh(qy(t),"invalid loader");let e;return Array.isArray(t)&&(e=t[1],t=t[0],t={...t,options:{...t.options,...e}}),(t!=null&&t.parseTextSync||t!=null&&t.parseText)&&(t.text=!0),t.text||(t.binary=!0),t}const UR=()=>{const t=kR();return t.loaderRegistry=t.loaderRegistry||[],t.loaderRegistry};function BD(t){const e=UR();t=Array.isArray(t)?t:[t];for(const n of t){const r=Yy(n);e.find(i=>r===i)||e.unshift(r)}}function UD(){return UR()}const LD=/\.([^.]+)$/;async function zD(t,e=[],n,r){if(!LR(t))return null;let i=HE(t,e,{...n,nothrow:!0},r);if(i)return i;if(Ko(t)&&(t=await t.slice(0,10).arrayBuffer(),i=HE(t,e,n,r)),!i&&!(n!=null&&n.nothrow))throw new Error(zR(t));return i}function HE(t,e=[],n,r){if(!LR(t))return null;if(e&&!Array.isArray(e))return Yy(e);let i=[];e&&(i=i.concat(e)),n!=null&&n.ignoreRegisteredLoaders||i.push(...UD()),VD(i);const s=$D(t,i,n,r);if(!s&&!(n!=null&&n.nothrow))throw new Error(zR(t));return s}function $D(t,e,n,r){const i=sp(t),s=Xy(t),l=Wy(i)||(r==null?void 0:r.url);let c=null,f="";return n!=null&&n.mimeType&&(c=Iv(e,n==null?void 0:n.mimeType),f=`match forced by supplied MIME type ${n==null?void 0:n.mimeType}`),c=c||HD(e,l),f=f||(c?`matched url ${l}`:""),c=c||Iv(e,s),f=f||(c?`matched MIME type ${s}`:""),c=c||WD(e,t),f=f||(c?`matched initial data ${$R(t)}`:""),n!=null&&n.fallbackMimeType&&(c=c||Iv(e,n==null?void 0:n.fallbackMimeType),f=f||(c?`matched fallback MIME type ${s}`:"")),f&&U6.log(1,`selectLoader selected ${c==null?void 0:c.name}: ${f}.`),c}function LR(t){return!(t instanceof Response&&t.status===204)}function zR(t){const e=sp(t),n=Xy(t);let r="No valid loader found (";r+=e?`${PR(e)}, `:"no url provided, ",r+=`MIME type: ${n?`"${n}"`:"not provided"}, `;const i=t?$R(t):"";return r+=i?` first bytes: "${i}"`:"first bytes: not available",r+=")",r}function VD(t){for(const e of t)Yy(e)}function HD(t,e){const n=e&&LD.exec(e),r=n&&n[1];return r?jD(t,r):null}function jD(t,e){e=e.toLowerCase();for(const n of t)for(const r of n.extensions)if(r.toLowerCase()===e)return n;return null}function Iv(t,e){var n;for(const r of t)if((n=r.mimeTypes)!=null&&n.some(i=>BE(e,i))||BE(e,`application/x.${r.id}`))return r;return null}function WD(t,e){if(!e)return null;for(const n of t)if(typeof e=="string"){if(XD(e,n))return n}else if(ArrayBuffer.isView(e)){if(jE(e.buffer,e.byteOffset,n))return n}else if(e instanceof ArrayBuffer&&jE(e,0,n))return n;return null}function XD(t,e){return e.testText?e.testText(t):(Array.isArray(e.tests)?e.tests:[e.tests]).some(r=>t.startsWith(r))}function jE(t,e,n){return(Array.isArray(n.tests)?n.tests:[n.tests]).some(i=>qD(t,e,n,i))}function qD(t,e,n,r){if(r instanceof ArrayBuffer)return tD(r,t,r.byteLength);switch(typeof r){case"function":return r(t);case"string":const i=W0(t,e,r.length);return r===i;default:return!1}}function $R(t,e=5){return typeof t=="string"?t.slice(0,e):ArrayBuffer.isView(t)?W0(t.buffer,t.byteOffset,e):t instanceof ArrayBuffer?W0(t,0,e):""}function W0(t,e,n){if(t.byteLengthLE(i,r.fetch):e!=null&&e.fetch?e==null?void 0:e.fetch:LE}function s4(t,e,n){if(n)return n;const r={fetch:HR(e,t),...t};if(r.url){const i=Wy(r.url);r.baseUrl=i,r.queryString=yD(r.url),r.filename=PR(i),r.baseUrl=lD(i)}return Array.isArray(r.loaders)||(r.loaders=null),r}function a4(t,e){if(t&&!Array.isArray(t))return t;let n;if(t&&(n=Array.isArray(t)?t:[t]),e&&e.loaders){const r=Array.isArray(e.loaders)?e.loaders:[e.loaders];n=n?[...n,...r]:r}return n&&n.length?n:void 0}async function Gh(t,e,n,r){e&&!Array.isArray(e)&&!qy(e)&&(r=void 0,n=e,e=void 0),t=await t,n=n||{};const i=sp(t),l=a4(e,r),c=await zD(t,l,n);return c?(n=ND(n,c,l,i),r=s4({url:i,_parse:Gh,loaders:l},n,r||null),await o4(c,t,n,r)):null}async function o4(t,e,n,r){if(Q6(t),n=L6(t.options,n),Yo(e)){const s=e,{ok:l,redirected:c,status:f,statusText:d,type:g,url:m}=s,v=Object.fromEntries(s.headers.entries());r.response={headers:v,ok:l,redirected:c,status:f,statusText:d,type:g,url:m}}e=await i4(e,t,n);const i=t;if(i.parseTextSync&&typeof e=="string")return i.parseTextSync(e,n,r);if(G6(t,n))return await J6(t,e,n,r,Gh);if(i.parseText&&typeof e=="string")return await i.parseText(e,n,r);if(i.parse)return await i.parse(e,n,r);throw za(!i.parseSync),new Error(`${t.id} loader - no parser found and worker is disabled`)}const XE=100;class l4{constructor(e,n){O(this,"schema");O(this,"options");O(this,"shape");O(this,"length",0);O(this,"rows",null);O(this,"cursor",0);O(this,"_headers",[]);if(this.options=n,this.schema=e,!Array.isArray(e)){this._headers=[];for(const r in e)this._headers[e[r].index]=e[r].name}}rowCount(){return this.length}addArrayRow(e,n){Number.isFinite(n)&&(this.cursor=n),this.shape="array-row-table",this.rows=this.rows||new Array(XE),this.rows[this.length]=e,this.length++}addObjectRow(e,n){Number.isFinite(n)&&(this.cursor=n),this.shape="object-row-table",this.rows=this.rows||new Array(XE),this.rows[this.length]=e,this.length++}getBatch(){let e=this.rows;return e?(e=e.slice(0,this.length),this.rows=null,{shape:this.shape||"array-row-table",batchType:"data",data:e,length:this.length,schema:this.schema,cursor:this.cursor}):null}}function jR(t,e){if(!t)throw new Error("null row");const n={};if(e)for(let r=0;r0?this.allocated*=2:d4,this.columns={};for(const e in this.schema){const n=this.schema[e],r=n.type||Float32Array,i=this.columns[n.index];if(i&&ArrayBuffer.isView(i)){const s=new r(this.allocated);s.set(i),this.columns[n.index]=s}else i?(i.length=this.allocated,this.columns[n.index]=i):this.columns[n.index]=new r(this.allocated)}}}_pruneColumns(){for(const[e,n]of Object.entries(this.columns))this.columns[e]=n.slice(0,this.length)}}const g4={shape:void 0,batchSize:"auto",batchDebounceMs:0,limit:0,_limitMB:0},p4="TableBatchBuilder",gf=class gf{constructor(e,n){O(this,"schema");O(this,"options");O(this,"aggregator",null);O(this,"batchCount",0);O(this,"bytesUsed",0);O(this,"isChunkComplete",!1);O(this,"lastBatchEmittedMs",Date.now());O(this,"totalLength",0);O(this,"totalBytes",0);O(this,"rowBytes",0);this.schema=e,this.options={...g4,...n}}limitReached(){var e,n;return!!((e=this.options)!=null&&e.limit&&this.totalLength>=this.options.limit||(n=this.options)!=null&&n._limitMB&&this.totalBytes/1e6>=this.options._limitMB)}addRow(e){this.limitReached()||(this.totalLength++,this.rowBytes=this.rowBytes||this._estimateRowMB(e),this.totalBytes+=this.rowBytes,Array.isArray(e)?this.addArrayRow(e):this.addObjectRow(e))}addArrayRow(e){if(!this.aggregator){const n=this._getTableBatchType();this.aggregator=new n(this.schema,this.options)}this.aggregator.addArrayRow(e)}addObjectRow(e){if(!this.aggregator){const n=this._getTableBatchType();this.aggregator=new n(this.schema,this.options)}this.aggregator.addObjectRow(e)}chunkComplete(e){e instanceof ArrayBuffer&&(this.bytesUsed+=e.byteLength),typeof e=="string"&&(this.bytesUsed+=e.length),this.isChunkComplete=!0}getFullBatch(e){return this._isFull()?this._getBatch(e):null}getFinalBatch(e){return this._getBatch(e)}_estimateRowMB(e){return Array.isArray(e)?e.length*8:Object.keys(e).length*8}_isFull(){if(!this.aggregator||this.aggregator.rowCount()===0)return!1;if(this.options.batchSize==="auto"){if(!this.isChunkComplete)return!1}else if(this.options.batchSize>this.aggregator.rowCount())return!1;return this.options.batchDebounceMs>Date.now()-this.lastBatchEmittedMs?!1:(this.isChunkComplete=!1,this.lastBatchEmittedMs=Date.now(),!0)}_getBatch(e){if(!this.aggregator)return null;e!=null&&e.bytesUsed&&(this.bytesUsed=e.bytesUsed);const n=this.aggregator.getBatch();return n.count=this.batchCount,n.bytesUsed=this.bytesUsed,Object.assign(n,e),this.batchCount++,this.aggregator=null,n}_getTableBatchType(){switch(this.options.shape){case"array-row-table":case"object-row-table":return f4;case"columnar-table":return h4;case"arrow-table":if(!gf.ArrowBatch)throw new Error(p4);return gf.ArrowBatch;default:return l4}}};O(gf,"ArrowBatch");let X0=gf;class YE extends Array{enqueue(e){return this.push(e)}dequeue(){return this.shift()}}class m4{constructor(){O(this,"_values");O(this,"_settlers");O(this,"_closed");this._values=new YE,this._settlers=new YE,this._closed=!1}close(){for(;this._settlers.length>0;)this._settlers.dequeue().resolve({done:!0});this._closed=!0}[Symbol.asyncIterator](){return this}enqueue(e){if(this._closed)throw new Error("Closed");if(this._settlers.length>0){if(this._values.length>0)throw new Error("Illegal internal state");const n=this._settlers.dequeue();e instanceof Error?n.reject(e):n.resolve({value:e})}else this._values.enqueue(e)}next(){if(this._values.length>0){const e=this._values.dequeue();return e instanceof Error?Promise.reject(e):Promise.resolve({value:e})}if(this._closed){if(this._settlers.length>0)throw new Error("Illegal internal state");return Promise.resolve({done:!0})}return new Promise((e,n)=>{this._settlers.enqueue({resolve:e,reject:n})})}}async function Jh(t,e,n,r){let i,s;!Array.isArray(e)&&!qy(e)?(i=[],s=e):(i=e,s=n);const l=HR(s);let c=t;return typeof t=="string"&&(c=await l(t)),Ko(t)&&(c=await l(t)),Array.isArray(i)?await Gh(c,i,s):await Gh(c,i,s)}/* @license +Papa Parse +v5.0.0-beta.0 +https://github.com/mholt/PapaParse +License: MIT +*/const KE="\uFEFF";function v4(t,e={},n=y4){e=e||{};var r=e.dynamicTyping||!1;Qi(r)&&(e.dynamicTypingFunction=r,r={}),e.dynamicTyping=r,e.transform=Qi(e.transform)?e.transform:!1;var i=new n(e);return i.stream(t)}function _4(t,e){var n=!1,r=!0,i=",",s=`\r +`,l='"',c=l+l,f=!1,d=null;m();var g=new RegExp(yf(l),"g");if(typeof t=="string"&&(t=JSON.parse(t)),Array.isArray(t)){if(!t.length||Array.isArray(t[0]))return v(null,t,f);if(typeof t[0]=="object")return v(d||Object.keys(t[0]),t,f)}else if(typeof t=="object")return typeof t.data=="string"&&(t.data=JSON.parse(t.data)),Array.isArray(t.data)&&(t.fields||(t.fields=t.meta&&t.meta.fields),t.fields||(t.fields=Array.isArray(t.data[0])?t.fields:Object.keys(t.data[0])),!Array.isArray(t.data[0])&&typeof t.data[0]!="object"&&(t.data=[t.data])),v(t.fields||[],t.data||[],f);throw new Error("Unable to serialize unrecognized input");function m(){if(typeof e=="object"){if(typeof e.delimiter=="string"&&!Oi.BAD_DELIMITERS.filter(function(w){return e.delimiter.indexOf(w)!==-1}).length&&(i=e.delimiter),(typeof e.quotes=="boolean"||Array.isArray(e.quotes))&&(n=e.quotes),(typeof e.skipEmptyLines=="boolean"||typeof e.skipEmptyLines=="string")&&(f=e.skipEmptyLines),typeof e.newline=="string"&&(s=e.newline),typeof e.quoteChar=="string"&&(l=e.quoteChar),typeof e.header=="boolean"&&(r=e.header),Array.isArray(e.columns)){if(e.columns.length===0)throw new Error("Option columns is empty");d=e.columns}e.escapeChar!==void 0&&(c=e.escapeChar+l)}}function v(w,b,A){var T="";typeof w=="string"&&(w=JSON.parse(w)),typeof b=="string"&&(b=JSON.parse(b));var C=Array.isArray(w)&&w.length>0,M=!Array.isArray(b[0]);if(C&&r){for(var x=0;x0&&(T+=i),T+=S(w[x],x);b.length>0&&(T+=s)}for(var N=0;N0&&!I&&(T+=i);var Y=C&&M?w[X]:X;T+=S(b[N][Y],X)}N0&&!I)&&(T+=s)}}return T}function S(w,b){if(typeof w>"u"||w===null)return"";if(w.constructor===Date)return JSON.stringify(w).slice(1,25);w=w.toString().replace(g,c);var A=typeof n=="boolean"&&n||Array.isArray(n)&&n[b]||E(w,Oi.BAD_DELIMITERS)||w.indexOf(i)>-1||w.charAt(0)===" "||w.charAt(w.length-1)===" ";return A?l+w+l:w}function E(w,b){for(var A=0;A-1)return!0;return!1}}let XR=class{constructor(e){O(this,"_handle");O(this,"_config");O(this,"_finished",!1);O(this,"_completed",!1);O(this,"_input",null);O(this,"_baseIndex",0);O(this,"_partialLine","");O(this,"_rowCount",0);O(this,"_start",0);O(this,"isFirstChunk",!0);O(this,"_completeResults",{data:[],errors:[],meta:{}});var n={...e};n.chunkSize=parseInt(n.chunkSize),!e.step&&!e.chunk&&(n.chunkSize=null),this._handle=new qR(n),this._handle.streamer=this,this._config=n}parseChunk(e,n){if(this.isFirstChunk&&Qi(this._config.beforeFirstChunk)){var r=this._config.beforeFirstChunk(e);r!==void 0&&(e=r)}this.isFirstChunk=!1;var i=this._partialLine+e;this._partialLine="";var s=this._handle.parse(i,this._baseIndex,!this._finished);if(!(this._handle.paused()||this._handle.aborted())){var l=s.meta.cursor;this._finished||(this._partialLine=i.substring(l-this._baseIndex),this._baseIndex=l),s&&s.data&&(this._rowCount+=s.data.length);var c=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(Qi(this._config.chunk)&&!n){if(this._config.chunk(s,this._handle),this._handle.paused()||this._handle.aborted())return;s=void 0,this._completeResults=void 0}return!this._config.step&&!this._config.chunk&&(this._completeResults.data=this._completeResults.data.concat(s.data),this._completeResults.errors=this._completeResults.errors.concat(s.errors),this._completeResults.meta=s.meta),!this._completed&&c&&Qi(this._config.complete)&&(!s||!s.meta.aborted)&&(this._config.complete(this._completeResults,this._input),this._completed=!0),s}}_sendError(e){Qi(this._config.error)&&this._config.error(e)}};class y4 extends XR{constructor(n={}){super(n);O(this,"remaining")}stream(n){return this.remaining=n,this._nextChunk()}_nextChunk(){if(!this._finished){var n=this._config.chunkSize,r=n?this.remaining.substr(0,n):this.remaining;return this.remaining=n?this.remaining.substr(n):"",this._finished=!this.remaining,this.parseChunk(r)}}}const b4=/^\s*-?(\d*\.?\d+|\d+\.?\d*)(e[-+]?\d+)?\s*$/i,S4=/(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/;class qR{constructor(e){O(this,"_config");O(this,"_stepCounter",0);O(this,"_rowCounter",0);O(this,"_input");O(this,"_parser");O(this,"_paused",!1);O(this,"_aborted",!1);O(this,"_delimiterError",!1);O(this,"_fields",[]);O(this,"_results",{data:[],errors:[],meta:{}});if(Qi(e.step)){var n=e.step;e.step=r=>{if(this._results=r,this.needsHeaderRow())this.processResults();else{if(this.processResults(),!this._results.data||this._results.data.length===0)return;this._stepCounter+=r.data.length,e.preview&&this._stepCounter>e.preview?this._parser.abort():n(this._results,this)}}}this._config=e}parse(e,n,r){var i=this._config.quoteChar||'"';if(this._config.newline||(this._config.newline=w4(e,i)),this._delimiterError=!1,this._config.delimiter)Qi(this._config.delimiter)&&(this._config.delimiter=this._config.delimiter(e),this._results.meta.delimiter=this._config.delimiter);else{var s=this.guessDelimiter(e,this._config.newline,this._config.skipEmptyLines,this._config.comments,this._config.delimitersToGuess);s.successful?this._config.delimiter=s.bestDelimiter:(this._delimiterError=!0,this._config.delimiter=Oi.DefaultDelimiter),this._results.meta.delimiter=this._config.delimiter}var l=YR(this._config);return this._config.preview&&this._config.header&&l.preview++,this._input=e,this._parser=new q0(l),this._results=this._parser.parse(this._input,n,r),this.processResults(),this._paused?{meta:{paused:!0}}:this._results||{meta:{paused:!1}}}paused(){return this._paused}pause(){this._paused=!0,this._parser.abort(),this._input=this._input.substr(this._parser.getCharIndex())}resume(){this._paused=!1,this.streamer.parseChunk(this._input,!0)}aborted(){return this._aborted}abort(){this._aborted=!0,this._parser.abort(),this._results.meta.aborted=!0,Qi(this._config.complete)&&this._config.complete(this._results),this._input=""}testEmptyLine(e){return this._config.skipEmptyLines==="greedy"?e.join("").trim()==="":e.length===1&&e[0].length===0}processResults(){if(this._results&&this._delimiterError&&(this.addError("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+Oi.DefaultDelimiter+"'"),this._delimiterError=!1),this._config.skipEmptyLines)for(var e=0;e{Qi(this._config.transformHeader)&&(r=this._config.transformHeader(r)),this._fields.push(r)};if(Array.isArray(this._results.data[0])){for(var n=0;this.needsHeaderRow()&&n=this._fields.length?"__parsed_extra":this._fields[i]),this._config.transform&&(l=this._config.transform(l,s)),l=this.parseDynamic(s,l),s==="__parsed_extra"?(r[s]=r[s]||[],r[s].push(l)):r[s]=l}return this._config.header&&(i>this._fields.length?this.addError("FieldMismatch","TooManyFields","Too many fields: expected "+this._fields.length+" fields but parsed "+i,this._rowCounter+n):i"u"){f=0;continue}else b>1&&(m+=Math.abs(b-f),f=b)}E.data.length>0&&(v/=E.data.length-S),(typeof c>"u"||m>c)&&v>1.99&&(c=m,l=g)}return this._config.delimiter=l,{successful:!!l,bestDelimiter:l}}addError(e,n,r,i){this._results.errors.push({type:e,code:n,message:r,row:i})}}function w4(t,e){t=t.substr(0,1024*1024);var n=new RegExp(yf(e)+"([^]*?)"+yf(e),"gm");t=t.replace(n,"");var r=t.split("\r"),i=t.split(` +`),s=i.length>1&&i[0].length=r.length/2?`\r +`:"\r"}function yf(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function q0(t){t=t||{};var e=t.delimiter,n=t.newline,r=t.comments,i=t.step,s=t.preview,l=t.fastMode,c;t.quoteChar===void 0?c='"':c=t.quoteChar;var f=c;if(t.escapeChar!==void 0&&(f=t.escapeChar),(typeof e!="string"||Oi.BAD_DELIMITERS.indexOf(e)>-1)&&(e=","),r===e)throw new Error("Comment character same as delimiter");r===!0?r="#":(typeof r!="string"||Oi.BAD_DELIMITERS.indexOf(r)>-1)&&(r=!1),n!==` +`&&n!=="\r"&&n!==`\r +`&&(n=` +`);var d=0,g=!1;this.parse=function(m,v,S){if(typeof m!="string")throw new Error("Input must be a string");var E=m.length,w=e.length,b=n.length,A=r.length,T=Qi(i);d=0;var C=[],M=[],x=[],N=0;if(!m)return $();if(l||l!==!1&&m.indexOf(c)===-1){for(var F=m.split(n),L=0;L=s)return C=C.slice(0,s),$(!0)}}return $()}for(var I=m.indexOf(e,d),V=m.indexOf(n,d),B=new RegExp(yf(f)+yf(c),"g"),j;;){if(m[d]===c){for(j=d,d++;;){if(j=m.indexOf(c,j+1),j===-1)return S||M.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:C.length,index:d}),Z();if(j===E-1){var X=m.substring(d,j).replace(B,c);return Z(X)}if(c===f&&m[j+1]===f){j++;continue}if(!(c!==f&&j!==0&&m[j-1]===f)){var Y=V===-1?I:Math.min(I,V),ae=W(Y);if(m[j+1+ae]===e){if(x.push(m.substring(d,j).replace(B,c)),d=j+1+ae+w,I=m.indexOf(e,d),V=m.indexOf(n,d),T&&(ie(),g))return $();if(s&&C.length>=s)return $(!0);break}var U=W(V);if(m.substr(j+1+U,b)===n){if(x.push(m.substring(d,j).replace(B,c)),P(j+1+U+b),I=m.indexOf(e,d),T&&(ie(),g))return $();if(s&&C.length>=s)return $(!0);break}M.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:C.length,index:d}),j++}}if(T&&(ie(),g))return $();if(s&&C.length>=s)return $(!0);continue}if(r&&x.length===0&&m.substr(d,A)===r){if(V===-1)return $();d=V+b,V=m.indexOf(n,d),I=m.indexOf(e,d);continue}if(I!==-1&&(I=s)return $(!0);continue}break}return Z();function z(se){C.push(se),N=d}function W(se){var q=0;if(se!==-1){var ce=m.substring(j+1,se);ce&&ce.trim()===""&&(q=ce.length)}return q}function Z(se){return S||(typeof se>"u"&&(se=m.substr(d)),x.push(se),d=E,z(x),T&&ie()),$()}function P(se){d=se,z(x),x=[],V=m.indexOf(n,d)}function $(se,q){var ce=q||!1;return{data:ce?C[0]:C,errors:M,meta:{delimiter:e,linebreak:n,aborted:g,truncated:!!se,cursor:N+(v||0)}}}function ie(){i($(void 0,!0)),C=[],M=[]}},this.abort=function(){g=!0},this.getCharIndex=function(){return d}}function YR(t){if(typeof t!="object"||t===null)return t;var e=Array.isArray(t)?[]:{};for(var n in t)e[n]=YR(t[n]);return e}function Qi(t){return typeof t=="function"}const Oi={parse:v4,unparse:_4,RECORD_SEP:"",UNIT_SEP:"",BYTE_ORDER_MARK:KE,BAD_DELIMITERS:["\r",` +`,'"',KE],WORKERS_SUPPORTED:!1,NODE_STREAM_INPUT:1,LocalChunkSize:1024*1024*10,RemoteChunkSize:1024*1024*5,DefaultDelimiter:",",Parser:q0,ParserHandle:qR,ChunkStreamer:XR},{ChunkStreamer:E4}=Oi;class T4 extends E4{constructor(n={}){super(n);O(this,"textDecoder",new TextDecoder(this._config.encoding))}async stream(n){this._input=n;try{for await(const r of n)this.parseChunk(this.getStringChunk(r));this._finished=!0,this.parseChunk("")}catch(r){this._sendError(r)}}_nextChunk(){}getStringChunk(n){return typeof n=="string"?n:this.textDecoder.decode(n,{stream:!0})}}const A4="4.3.2",Ky="object-row-table",Zy={dataType:null,batchType:null,id:"csv",module:"csv",name:"CSV",version:A4,extensions:["csv","tsv","dsv"],mimeTypes:["text/csv","text/tab-separated-values","text/dsv"],category:"table",parse:async(t,e)=>ZE(new TextDecoder().decode(t),e),parseText:(t,e)=>ZE(t,e),parseInBatches:C4,options:{csv:{shape:Ky,optimizeMemoryUsage:!1,header:"auto",columnPrefix:"column",quoteChar:'"',escapeChar:'"',dynamicTyping:!0,comments:!1,skipEmptyLines:!0,delimitersToGuess:[","," ","|",";"]}}};async function ZE(t,e){const n={...Zy.options.csv,...e==null?void 0:e.csv},r=R4(t),s=n.header==="auto"?KR(r):!!n.header,l={...n,header:s,download:!1,transformHeader:s?ZR():void 0,error:m=>{throw new Error(m)}},c=Oi.parse(t,l),f=c.data,d=c.meta.fields||QR(n.columnPrefix,r.length),g=n.shape||Ky;switch(g){case"object-row-table":return{shape:"object-row-table",data:f.map(m=>Array.isArray(m)?jR(m,d):m)};case"array-row-table":return{shape:"array-row-table",data:f.map(m=>Array.isArray(m)?m:WR(m,d))};default:throw new Error(g)}}function C4(t,e){e={...e},e.batchSize==="auto"&&(e.batchSize=4e3);const n={...Zy.options.csv,...e==null?void 0:e.csv},r=new m4;let i=!0,s=null,l=null,c=null;const f={...n,header:!1,download:!1,chunkSize:1024*1024*5,skipEmptyLines:!1,step(d){let g=d.data;if(n.skipEmptyLines&&g.flat().join("").trim()==="")return;const m=d.meta.cursor;if(i&&!s&&(n.header==="auto"?KR(g):!!n.header)){s=g.map(ZR());return}i&&(i=!1,s||(s=QR(n.columnPrefix,g.length)),c=x4(g,s)),n.optimizeMemoryUsage&&(g=JSON.parse(JSON.stringify(g)));const v=n.shape||Ky;l=l||new X0(c,{shape:v,...e});try{l.addRow(g);const S=l&&l.getFullBatch({bytesUsed:m});S&&r.enqueue(S)}catch(S){r.enqueue(S)}},complete(d){try{const g=d.meta.cursor,m=l&&l.getFinalBatch({bytesUsed:g});m&&r.enqueue(m)}catch(g){r.enqueue(g)}r.close()}};return Oi.parse(t,f,T4),r}function KR(t){return t&&t.every(e=>typeof e=="string")}function R4(t){return Oi.parse(t,{dynamicTyping:!0,preview:1}).data[0]}function ZR(){const t=new Set;return e=>{let n=e,r=1;for(;t.has(n);)n=`${e}.${r}`,r++;return t.add(n),n}}function QR(t,e=0){const n=[];for(let r=0;r1&&arguments[1]!==void 0?arguments[1]:{},n=[];return Ft.Children.forEach(t,function(r){r==null&&!e.keepEmpty||(Array.isArray(r)?n=n.concat(Ho(r)):GR(r)&&r.props?n=n.concat(Ho(r.props.children,e)):n.push(r))}),n}var Y0={},D4=function(e){};function F4(t,e){}function k4(t,e){}function B4(){Y0={}}function JR(t,e,n){!e&&!Y0[n]&&(t(!1,n),Y0[n]=!0)}function Ur(t,e){JR(F4,t,e)}function U4(t,e){JR(k4,t,e)}Ur.preMessage=D4;Ur.resetWarned=B4;Ur.noteOnce=U4;function L4(t,e){if(pt(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(pt(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function e3(t){var e=L4(t,"string");return pt(e)=="symbol"?e:e+""}function K(t,e,n){return(e=e3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function GE(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function J(t){for(var e=1;e=19)return!0;var i=kv.isMemo(e)?e.type.type:e.type;return!(typeof i=="function"&&!((n=i.prototype)!==null&&n!==void 0&&n.render)&&i.$$typeof!==kv.ForwardRef||typeof e=="function"&&!((r=e.prototype)!==null&&r!==void 0&&r.render)&&e.$$typeof!==kv.ForwardRef)};function t3(t){return _.isValidElement(t)&&!GR(t)}var Gy=function(e){if(e&&t3(e)){var n=e;return n.props.propertyIsEnumerable("ref")?n.props.ref:n.ref}return null},K0=_.createContext(null);function j4(t){var e=t.children,n=t.onBatchResize,r=_.useRef(0),i=_.useRef([]),s=_.useContext(K0),l=_.useCallback(function(c,f,d){r.current+=1;var g=r.current;i.current.push({size:c,element:f,data:d}),Promise.resolve().then(function(){g===r.current&&(n==null||n(i.current),i.current=[])}),s==null||s(c,f,d)},[n,s]);return _.createElement(K0.Provider,{value:l},e)}var n3=function(){if(typeof Map<"u")return Map;function t(e,n){var r=-1;return e.some(function(i,s){return i[0]===n?(r=s,!0):!1}),r}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(n){var r=t(this.__entries__,n),i=this.__entries__[r];return i&&i[1]},e.prototype.set=function(n,r){var i=t(this.__entries__,n);~i?this.__entries__[i][1]=r:this.__entries__.push([n,r])},e.prototype.delete=function(n){var r=this.__entries__,i=t(r,n);~i&&r.splice(i,1)},e.prototype.has=function(n){return!!~t(this.__entries__,n)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var i=0,s=this.__entries__;i0},t.prototype.connect_=function(){!Z0||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Z4?(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)},t.prototype.disconnect_=function(){!Z0||!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)},t.prototype.onTransitionEnd_=function(e){var n=e.propertyName,r=n===void 0?"":n,i=K4.some(function(s){return!!~r.indexOf(s)});i&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),r3=function(t,e){for(var n=0,r=Object.keys(e);n"u"||!(Element instanceof Object))){if(!(e instanceof wc(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(e)||(n.set(e,new s5(e)),this.controller_.addObserver(this),this.controller_.refresh())}},t.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof wc(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(e)&&(n.delete(e),n.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&e.activeObservations_.push(n)})},t.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new a5(r.target,r.broadcastRect())});this.callback_.call(e,n,e),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),s3=typeof WeakMap<"u"?new WeakMap:new n3,a3=function(){function t(e){if(!(this instanceof t))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=Q4.getInstance(),r=new o5(e,n,this);s3.set(this,r)}return t}();["observe","unobserve","disconnect"].forEach(function(t){a3.prototype[t]=function(){var e;return(e=s3.get(this))[t].apply(e,arguments)}});var l5=function(){return typeof eg.ResizeObserver<"u"?eg.ResizeObserver:a3}(),Ia=new Map;function c5(t){t.forEach(function(e){var n,r=e.target;(n=Ia.get(r))===null||n===void 0||n.forEach(function(i){return i(r)})})}var o3=new l5(c5);function u5(t,e){Ia.has(t)||(Ia.set(t,new Set),o3.observe(t)),Ia.get(t).add(e)}function f5(t,e){Ia.has(t)&&(Ia.get(t).delete(e),Ia.get(t).size||(o3.unobserve(t),Ia.delete(t)))}function Or(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function rT(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=Array(e);n1&&arguments[1]!==void 0?arguments[1]:1;iT+=1;var r=iT;function i(s){if(s===0)f3(r),e();else{var l=c3(function(){i(s-1)});tb.set(r,l)}}return i(n),r};hr.cancel=function(t){var e=tb.get(t);return f3(t),u3(e)};function d3(t){if(Array.isArray(t))return t}function b5(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,s,l,c=[],f=!0,d=!1;try{if(s=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;f=!1}else for(;!(f=(r=s.call(n)).done)&&(c.push(r.value),c.length!==e);f=!0);}catch(g){d=!0,i=g}finally{try{if(!f&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(d)throw i}}return c}}function h3(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function de(t,e){return d3(t)||b5(t,e)||eb(t,e)||h3()}function Ef(t){for(var e=0,n,r=0,i=t.length;i>=4;++r,i-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(i){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}function Qr(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function S5(t,e){if(!t)return!1;if(t.contains)return t.contains(e);for(var n=e;n;){if(n===t)return!0;n=n.parentNode}return!1}var sT="data-rc-order",aT="data-rc-priority",w5="rc-util-key",G0=new Map;function g3(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.mark;return e?e.startsWith("data-")?e:"data-".concat(e):w5}function fp(t){if(t.attachTo)return t.attachTo;var e=document.querySelector("head");return e||document.body}function E5(t){return t==="queue"?"prependQueue":t?"prepend":"append"}function nb(t){return Array.from((G0.get(t)||t).children).filter(function(e){return e.tagName==="STYLE"})}function p3(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Qr())return null;var n=e.csp,r=e.prepend,i=e.priority,s=i===void 0?0:i,l=E5(r),c=l==="prependQueue",f=document.createElement("style");f.setAttribute(sT,l),c&&s&&f.setAttribute(aT,"".concat(s)),n!=null&&n.nonce&&(f.nonce=n==null?void 0:n.nonce),f.innerHTML=t;var d=fp(e),g=d.firstChild;if(r){if(c){var m=(e.styles||nb(d)).filter(function(v){if(!["prepend","prependQueue"].includes(v.getAttribute(sT)))return!1;var S=Number(v.getAttribute(aT)||0);return s>=S});if(m.length)return d.insertBefore(f,m[m.length-1].nextSibling),f}d.insertBefore(f,g)}else d.appendChild(f);return f}function m3(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=fp(e);return(e.styles||nb(n)).find(function(r){return r.getAttribute(g3(e))===t})}function Tf(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=m3(t,e);if(n){var r=fp(e);r.removeChild(n)}}function T5(t,e){var n=G0.get(t);if(!n||!S5(document,n)){var r=p3("",e),i=r.parentNode;G0.set(t,i),t.removeChild(r)}}function js(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=fp(n),i=nb(r),s=J(J({},n),{},{styles:i});T5(r,s);var l=m3(e,s);if(l){var c,f;if((c=s.csp)!==null&&c!==void 0&&c.nonce&&l.nonce!==((f=s.csp)===null||f===void 0?void 0:f.nonce)){var d;l.nonce=(d=s.csp)===null||d===void 0?void 0:d.nonce}return l.innerHTML!==t&&(l.innerHTML=t),l}var g=p3(t,s);return g.setAttribute(g3(s),e),g}function A5(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}function Fn(t,e){if(t==null)return{};var n,r,i=A5(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(r=0;r2&&arguments[2]!==void 0?arguments[2]:!1,r=new Set;function i(s,l){var c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,f=r.has(s);if(Ur(!f,"Warning: There may be circular references"),f)return!1;if(s===l)return!0;if(n&&c>1)return!1;r.add(s);var d=c+1;if(Array.isArray(s)){if(!Array.isArray(l)||s.length!==l.length)return!1;for(var g=0;g1&&arguments[1]!==void 0?arguments[1]:!1,l={map:this.cache};return n.forEach(function(c){if(!l)l=void 0;else{var f;l=(f=l)===null||f===void 0||(f=f.map)===null||f===void 0?void 0:f.get(c)}}),(r=l)!==null&&r!==void 0&&r.value&&s&&(l.value[1]=this.cacheCallTimes++),(i=l)===null||i===void 0?void 0:i.value}},{key:"get",value:function(n){var r;return(r=this.internalGet(n,!0))===null||r===void 0?void 0:r[0]}},{key:"has",value:function(n){return!!this.internalGet(n)}},{key:"set",value:function(n,r){var i=this;if(!this.has(n)){if(this.size()+1>t.MAX_CACHE_SIZE+t.MAX_CACHE_OFFSET){var s=this.keys.reduce(function(d,g){var m=de(d,2),v=m[1];return i.internalGet(g)[1]0,void 0),oT+=1}return Pr(t,[{key:"getDerivativeToken",value:function(n){return this.derivatives.reduce(function(r,i){return i(n,r)},void 0)}}]),t}(),Bv=new rb;function e_(t){var e=Array.isArray(t)?t:[t];return Bv.has(e)||Bv.set(e,new v3(e)),Bv.get(e)}var O5=new WeakMap,Uv={};function P5(t,e){for(var n=O5,r=0;r3&&arguments[3]!==void 0?arguments[3]:{},s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(s)return t;var l=J(J({},i),{},(r={},K(r,Ec,e),K(r,es,n),r)),c=Object.keys(l).map(function(f){var d=l[f];return d?"".concat(f,'="').concat(d,'"'):null}).filter(function(f){return f}).join(" ");return"")}var Fh=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return"--".concat(n?"".concat(n,"-"):"").concat(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z0-9]+)/g,"$1-$2").replace(/([a-z])([A-Z0-9])/g,"$1-$2").toLowerCase()},N5=function(e,n,r){return Object.keys(e).length?".".concat(n).concat(r!=null&&r.scope?".".concat(r.scope):"","{").concat(Object.entries(e).map(function(i){var s=de(i,2),l=s[0],c=s[1];return"".concat(l,":").concat(c,";")}).join(""),"}"):""},_3=function(e,n,r){var i={},s={};return Object.entries(e).forEach(function(l){var c,f,d=de(l,2),g=d[0],m=d[1];if(r!=null&&(c=r.preserve)!==null&&c!==void 0&&c[g])s[g]=m;else if((typeof m=="string"||typeof m=="number")&&!(r!=null&&(f=r.ignore)!==null&&f!==void 0&&f[g])){var v,S=Fh(g,r==null?void 0:r.prefix);i[S]=typeof m=="number"&&!(r!=null&&(v=r.unitless)!==null&&v!==void 0&&v[g])?"".concat(m,"px"):String(m),s[g]="var(".concat(S,")")}}),[s,N5(i,n,{scope:r==null?void 0:r.scope})]},uT=Qr()?_.useLayoutEffect:_.useEffect,Dn=function(e,n){var r=_.useRef(!0);uT(function(){return e(r.current)},n),uT(function(){return r.current=!1,function(){r.current=!0}},[])},fT=function(e,n){Dn(function(r){if(!r)return e()},n)},I5=J({},rp),dT=I5.useInsertionEffect,D5=function(e,n,r){_.useMemo(e,r),Dn(function(){return n(!0)},r)},F5=dT?function(t,e,n){return dT(function(){return t(),e()},n)}:D5,k5=J({},rp),B5=k5.useInsertionEffect,U5=function(e){var n=[],r=!1;function i(s){r||n.push(s)}return _.useEffect(function(){return r=!1,function(){r=!0,n.length&&n.forEach(function(s){return s()})}},e),i},L5=function(){return function(e){e()}},z5=typeof B5<"u"?U5:L5;function ib(t,e,n,r,i){var s=_.useContext(qf),l=s.cache,c=[t].concat(ze(e)),f=J0(c),d=z5([f]),g=function(E){l.opUpdate(f,function(w){var b=w||[void 0,void 0],A=de(b,2),T=A[0],C=T===void 0?0:T,M=A[1],x=M,N=x||n(),F=[C,N];return E?E(F):F})};_.useMemo(function(){g()},[f]);var m=l.opGet(f),v=m[1];return F5(function(){i==null||i(v)},function(S){return g(function(E){var w=de(E,2),b=w[0],A=w[1];return S&&b===0&&(i==null||i(v)),[b+1,A]}),function(){l.opUpdate(f,function(E){var w=E||[],b=de(w,2),A=b[0],T=A===void 0?0:A,C=b[1],M=T-1;return M===0?(d(function(){(S||!l.opGet(f))&&(r==null||r(C,!1))}),null):[T-1,C]})}},[f]),v}var $5={},V5="css",vo=new Map;function H5(t){vo.set(t,(vo.get(t)||0)+1)}function j5(t,e){if(typeof document<"u"){var n=document.querySelectorAll("style[".concat(Ec,'="').concat(t,'"]'));n.forEach(function(r){if(r[Da]===e){var i;(i=r.parentNode)===null||i===void 0||i.removeChild(r)}})}}var W5=0;function X5(t,e){vo.set(t,(vo.get(t)||0)-1);var n=Array.from(vo.keys()),r=n.filter(function(i){var s=vo.get(i)||0;return s<=0});n.length-r.length>W5&&r.forEach(function(i){j5(i,e),vo.delete(i)})}var q5=function(e,n,r,i){var s=r.getDerivativeToken(e),l=J(J({},s),n);return i&&(l=i(l)),l},y3="token";function Y5(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=_.useContext(qf),i=r.cache.instanceId,s=r.container,l=n.salt,c=l===void 0?"":l,f=n.override,d=f===void 0?$5:f,g=n.formatToken,m=n.getComputedToken,v=n.cssVar,S=P5(function(){return Object.assign.apply(Object,[{}].concat(ze(e)))},e),E=sf(S),w=sf(d),b=v?sf(v):"",A=ib(y3,[c,t.id,E,w,b],function(){var T,C=m?m(S,d,t):q5(S,d,t,g),M=J({},C),x="";if(v){var N=_3(C,v.key,{prefix:v.prefix,ignore:v.ignore,unitless:v.unitless,preserve:v.preserve}),F=de(N,2);C=F[0],x=F[1]}var L=cT(C,c);C._tokenKey=L,M._tokenKey=cT(M,c);var I=(T=v==null?void 0:v.key)!==null&&T!==void 0?T:L;C._themeKey=I,H5(I);var V="".concat(V5,"-").concat(Ef(L));return C._hashId=V,[C,V,M,x,(v==null?void 0:v.key)||""]},function(T){X5(T[0]._themeKey,i)},function(T){var C=de(T,4),M=C[0],x=C[3];if(v&&x){var N=js(x,Ef("css-variables-".concat(M._themeKey)),{mark:es,prepend:"queue",attachTo:s,priority:-999});N[Da]=i,N.setAttribute(Ec,M._themeKey)}});return A}var K5=function(e,n,r){var i=de(e,5),s=i[2],l=i[3],c=i[4],f=r||{},d=f.plain;if(!l)return null;var g=s._tokenKey,m=-999,v={"data-rc-order":"prependQueue","data-rc-priority":"".concat(m)},S=rg(l,c,g,v,d);return[m,g,S]},Z5={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},b3="comm",S3="rule",w3="decl",Q5="@import",G5="@namespace",J5="@keyframes",eF="@layer",E3=Math.abs,sb=String.fromCharCode;function T3(t){return t.trim()}function kh(t,e,n){return t.replace(e,n)}function tF(t,e,n){return t.indexOf(e,n)}function rc(t,e){return t.charCodeAt(e)|0}function Tc(t,e,n){return t.slice(e,n)}function fs(t){return t.length}function nF(t){return t.length}function lh(t,e){return e.push(t),t}var dp=1,Ac=1,A3=0,Ii=0,or=0,$c="";function ab(t,e,n,r,i,s,l,c){return{value:t,root:e,parent:n,type:r,props:i,children:s,line:dp,column:Ac,length:l,return:"",siblings:c}}function rF(){return or}function iF(){return or=Ii>0?rc($c,--Ii):0,Ac--,or===10&&(Ac=1,dp--),or}function ts(){return or=Ii2||Af(or)>3?"":" "}function lF(t,e){for(;--e&&ts()&&!(or<48||or>102||or>57&&or<65||or>70&&or<97););return hp(t,Bh()+(e<6&&Fa()==32&&ts()==32))}function n_(t){for(;ts();)switch(or){case t:return Ii;case 34:case 39:t!==34&&t!==39&&n_(or);break;case 40:t===41&&n_(t);break;case 92:ts();break}return Ii}function cF(t,e){for(;ts()&&t+or!==57;)if(t+or===84&&Fa()===47)break;return"/*"+hp(e,Ii-1)+"*"+sb(t===47?t:ts())}function uF(t){for(;!Af(Fa());)ts();return hp(t,Ii)}function fF(t){return aF(Uh("",null,null,null,[""],t=sF(t),0,[0],t))}function Uh(t,e,n,r,i,s,l,c,f){for(var d=0,g=0,m=l,v=0,S=0,E=0,w=1,b=1,A=1,T=0,C="",M=i,x=s,N=r,F=C;b;)switch(E=T,T=ts()){case 40:if(E!=108&&rc(F,m-1)==58){tF(F+=kh(Lv(T),"&","&\f"),"&\f",E3(d?c[d-1]:0))!=-1&&(A=-1);break}case 34:case 39:case 91:F+=Lv(T);break;case 9:case 10:case 13:case 32:F+=oF(E);break;case 92:F+=lF(Bh()-1,7);continue;case 47:switch(Fa()){case 42:case 47:lh(dF(cF(ts(),Bh()),e,n,f),f),(Af(E||1)==5||Af(Fa()||1)==5)&&fs(F)&&Tc(F,-1,void 0)!==" "&&(F+=" ");break;default:F+="/"}break;case 123*w:c[d++]=fs(F)*A;case 125*w:case 59:case 0:switch(T){case 0:case 125:b=0;case 59+g:A==-1&&(F=kh(F,/\f/g,"")),S>0&&(fs(F)-m||w===0&&E===47)&&lh(S>32?gT(F+";",r,n,m-1,f):gT(kh(F," ","")+";",r,n,m-2,f),f);break;case 59:F+=";";default:if(lh(N=hT(F,e,n,d,g,i,c,C,M=[],x=[],m,s),s),T===123)if(g===0)Uh(F,e,N,N,M,s,m,c,x);else{switch(v){case 99:if(rc(F,3)===110)break;case 108:if(rc(F,2)===97)break;default:g=0;case 100:case 109:case 115:}g?Uh(t,N,N,r&&lh(hT(t,N,N,0,0,i,c,C,i,M=[],m,x),x),i,x,m,c,r?M:x):Uh(F,N,N,N,[""],x,0,c,x)}}d=g=S=0,w=A=1,C=F="",m=l;break;case 58:m=1+fs(F),S=E;default:if(w<1){if(T==123)--w;else if(T==125&&w++==0&&iF()==125)continue}switch(F+=sb(T),T*w){case 38:A=g>0?1:(F+="\f",-1);break;case 44:c[d++]=(fs(F)-1)*A,A=1;break;case 64:Fa()===45&&(F+=Lv(ts())),v=Fa(),g=m=fs(C=F+=uF(Bh())),T++;break;case 45:E===45&&fs(F)==2&&(w=0)}}return s}function hT(t,e,n,r,i,s,l,c,f,d,g,m){for(var v=i-1,S=i===0?s:[""],E=nF(S),w=0,b=0,A=0;w0?S[T]+" "+C:kh(C,/&\f/g,S[T])))&&(f[A++]=M);return ab(t,e,n,i===0?S3:c,f,d,g,m)}function dF(t,e,n,r){return ab(t,e,n,b3,sb(rF()),Tc(t,2,-2),0,r)}function gT(t,e,n,r,i){return ab(t,e,n,w3,Tc(t,0,r),Tc(t,r+1,-1),r,i)}function r_(t,e){for(var n="",r=0;r1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{root:!0,parentSelectors:[]},i=r.root,s=r.injectHash,l=r.parentSelectors,c=n.hashId,f=n.layer;n.path;var d=n.hashPriority,g=n.transformers,m=g===void 0?[]:g;n.linters;var v="",S={};function E(A){var T=A.getName(c);if(!S[T]){var C=t(A.style,n,{root:!1,parentSelectors:l}),M=de(C,1),x=M[0];S[T]="@keyframes ".concat(A.getName(c)).concat(x)}}function w(A){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return A.forEach(function(C){Array.isArray(C)?w(C,T):C&&T.push(C)}),T}var b=w(Array.isArray(e)?e:[e]);return b.forEach(function(A){var T=typeof A=="string"&&!i?{}:A;if(typeof T=="string")v+="".concat(T,` +`);else if(T._keyframe)E(T);else{var C=m.reduce(function(M,x){var N;return(x==null||(N=x.visit)===null||N===void 0?void 0:N.call(x,M))||M},T);Object.keys(C).forEach(function(M){var x=C[M];if(pt(x)==="object"&&x&&(M!=="animationName"||!x._keyframe)&&!_F(x)){var N=!1,F=M.trim(),L=!1;(i||s)&&c?F.startsWith("@")?N=!0:F==="&"?F=mT("",c,d):F=mT(M,c,d):i&&!c&&(F==="&"||F==="")&&(F="",L=!0);var I=t(x,n,{root:L,injectHash:N,parentSelectors:[].concat(ze(l),[F])}),V=de(I,2),B=V[0],j=V[1];S=J(J({},S),j),v+="".concat(F).concat(B)}else{let ae=function(U,z){var W=U.replace(/[A-Z]/g,function(P){return"-".concat(P.toLowerCase())}),Z=z;!Z5[U]&&typeof Z=="number"&&Z!==0&&(Z="".concat(Z,"px")),U==="animationName"&&z!==null&&z!==void 0&&z._keyframe&&(E(z),Z=z.getName(c)),v+="".concat(W,":").concat(Z,";")};var X,Y=(X=x==null?void 0:x.value)!==null&&X!==void 0?X:x;pt(x)==="object"&&x!==null&&x!==void 0&&x[x3]&&Array.isArray(Y)?Y.forEach(function(U){ae(M,U)}):ae(M,Y)}})}}),i?f&&(v&&(v="@layer ".concat(f.name," {").concat(v,"}")),f.dependencies&&(S["@layer ".concat(f.name)]=f.dependencies.map(function(A){return"@layer ".concat(A,", ").concat(f.name,";")}).join(` +`))):v="{".concat(v,"}"),[v,S]};function M3(t,e){return Ef("".concat(t.join("%")).concat(e))}function bF(){return null}var O3="style";function i_(t,e){var n=t.token,r=t.path,i=t.hashId,s=t.layer,l=t.nonce,c=t.clientOnly,f=t.order,d=f===void 0?0:f,g=_.useContext(qf),m=g.autoClear;g.mock;var v=g.defaultCache,S=g.hashPriority,E=g.container,w=g.ssrInline,b=g.transformers,A=g.linters,T=g.cache,C=g.layer,M=n._tokenKey,x=[M];C&&x.push("layer"),x.push.apply(x,ze(r));var N=t_,F=ib(O3,x,function(){var j=x.join("|");if(pF(j)){var X=mF(j),Y=de(X,2),ae=Y[0],U=Y[1];if(ae)return[ae,M,U,{},c,d]}var z=e(),W=yF(z,{hashId:i,hashPriority:S,layer:C?s:void 0,path:r.join("-"),transformers:b,linters:A}),Z=de(W,2),P=Z[0],$=Z[1],ie=Lh(P),se=M3(x,ie);return[ie,M,se,$,c,d]},function(j,X){var Y=de(j,3),ae=Y[2];(X||m)&&t_&&Tf(ae,{mark:es})},function(j){var X=de(j,4),Y=X[0];X[1];var ae=X[2],U=X[3];if(N&&Y!==C3){var z={mark:es,prepend:C?!1:"queue",attachTo:E,priority:d},W=typeof l=="function"?l():l;W&&(z.csp={nonce:W});var Z=[],P=[];Object.keys(U).forEach(function(ie){ie.startsWith("@layer")?Z.push(ie):P.push(ie)}),Z.forEach(function(ie){js(Lh(U[ie]),"_layer-".concat(ie),J(J({},z),{},{prepend:!0}))});var $=js(Y,ae,z);$[Da]=T.instanceId,$.setAttribute(Ec,M),P.forEach(function(ie){js(Lh(U[ie]),"_effect-".concat(ie),z)})}}),L=de(F,3),I=L[0],V=L[1],B=L[2];return function(j){var X;if(!w||N||!v)X=_.createElement(bF,null);else{var Y;X=_.createElement("style",kt({},(Y={},K(Y,Ec,V),K(Y,es,B),Y),{dangerouslySetInnerHTML:{__html:I}}))}return _.createElement(_.Fragment,null,X,j)}}var SF=function(e,n,r){var i=de(e,6),s=i[0],l=i[1],c=i[2],f=i[3],d=i[4],g=i[5],m=r||{},v=m.plain;if(d)return null;var S=s,E={"data-rc-order":"prependQueue","data-rc-priority":"".concat(g)};return S=rg(s,l,c,E,v),f&&Object.keys(f).forEach(function(w){if(!n[w]){n[w]=!0;var b=Lh(f[w]),A=rg(b,l,"_effect-".concat(w),E,v);w.startsWith("@layer")?S=A+S:S+=A}}),[g,c,S]},P3="cssVar",wF=function(e,n){var r=e.key,i=e.prefix,s=e.unitless,l=e.ignore,c=e.token,f=e.scope,d=f===void 0?"":f,g=_.useContext(qf),m=g.cache.instanceId,v=g.container,S=c._tokenKey,E=[].concat(ze(e.path),[r,d,S]),w=ib(P3,E,function(){var b=n(),A=_3(b,r,{prefix:i,unitless:s,ignore:l,scope:d}),T=de(A,2),C=T[0],M=T[1],x=M3(E,M);return[C,M,x,r]},function(b){var A=de(b,3),T=A[2];t_&&Tf(T,{mark:es})},function(b){var A=de(b,3),T=A[1],C=A[2];if(T){var M=js(T,C,{mark:es,prepend:"queue",attachTo:v,priority:-999});M[Da]=m,M.setAttribute(Ec,r)}});return w},EF=function(e,n,r){var i=de(e,4),s=i[1],l=i[2],c=i[3],f=r||{},d=f.plain;if(!s)return null;var g=-999,m={"data-rc-order":"prependQueue","data-rc-priority":"".concat(g)},v=rg(s,c,l,m,d);return[g,l,v]},zu;zu={},K(zu,O3,SF),K(zu,y3,K5),K(zu,P3,EF);var ln=function(){function t(e,n){Or(this,t),K(this,"name",void 0),K(this,"style",void 0),K(this,"_keyframe",!0),this.name=e,this.style=n}return Pr(t,[{key:"getName",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return n?"".concat(n,"-").concat(this.name):this.name}}]),t}();function Bl(t){return t.notSplit=!0,t}Bl(["borderTop","borderBottom"]),Bl(["borderTop"]),Bl(["borderBottom"]),Bl(["borderLeft","borderRight"]),Bl(["borderLeft"]),Bl(["borderRight"]);var ob=_.createContext({});function N3(t){return d3(t)||l3(t)||eb(t)||h3()}function _s(t,e){for(var n=t,r=0;r3&&arguments[3]!==void 0?arguments[3]:!1;return e.length&&r&&n===void 0&&!_s(t,e.slice(0,-1))?t:I3(t,e,n,r)}function TF(t){return pt(t)==="object"&&t!==null&&Object.getPrototypeOf(t)===Object.prototype}function vT(t){return Array.isArray(t)?[]:{}}var AF=typeof Reflect>"u"?Object.keys:Reflect.ownKeys;function ql(){for(var t=arguments.length,e=new Array(t),n=0;n{const t=()=>{};return t.deprecated=CF,t},xF=_.createContext(void 0);var MF={items_per_page:"/ page",jump_to:"Go to",jump_to_confirm:"confirm",page:"Page",prev_page:"Previous Page",next_page:"Next Page",prev_5:"Previous 5 Pages",next_5:"Next 5 Pages",prev_3:"Previous 3 Pages",next_3:"Next 3 Pages",page_size:"Page Size"},OF={yearFormat:"YYYY",dayFormat:"D",cellMeridiemFormat:"A",monthBeforeYear:!0},PF=J(J({},OF),{},{locale:"en_US",today:"Today",now:"Now",backToToday:"Back to today",ok:"OK",clear:"Clear",week:"Week",month:"Month",year:"Year",timeSelect:"select time",dateSelect:"select date",weekSelect:"Choose a week",monthSelect:"Choose a month",yearSelect:"Choose a year",decadeSelect:"Choose a decade",dateFormat:"M/D/YYYY",dateTimeFormat:"M/D/YYYY HH:mm:ss",previousMonth:"Previous month (PageUp)",nextMonth:"Next month (PageDown)",previousYear:"Last year (Control + left)",nextYear:"Next year (Control + right)",previousDecade:"Last decade",nextDecade:"Next decade",previousCentury:"Last century",nextCentury:"Next century"});const F3={placeholder:"Select time",rangePlaceholder:["Start time","End time"]},_T={lang:Object.assign({placeholder:"Select date",yearPlaceholder:"Select year",quarterPlaceholder:"Select quarter",monthPlaceholder:"Select month",weekPlaceholder:"Select week",rangePlaceholder:["Start date","End date"],rangeYearPlaceholder:["Start year","End year"],rangeQuarterPlaceholder:["Start quarter","End quarter"],rangeMonthPlaceholder:["Start month","End month"],rangeWeekPlaceholder:["Start week","End week"]},PF),timePickerLocale:Object.assign({},F3)},si="${label} is not a valid ${type}",Cc={locale:"en",Pagination:MF,DatePicker:_T,TimePicker:F3,Calendar:_T,global:{placeholder:"Please select"},Table:{filterTitle:"Filter menu",filterConfirm:"OK",filterReset:"Reset",filterEmptyText:"No filters",filterCheckAll:"Select all items",filterSearchPlaceholder:"Search in filters",emptyText:"No data",selectAll:"Select current page",selectInvert:"Invert current page",selectNone:"Clear all data",selectionAll:"Select all data",sortTitle:"Sort",expand:"Expand row",collapse:"Collapse row",triggerDesc:"Click to sort descending",triggerAsc:"Click to sort ascending",cancelSort:"Click to cancel sorting"},Tour:{Next:"Next",Previous:"Previous",Finish:"Finish"},Modal:{okText:"OK",cancelText:"Cancel",justOkText:"OK"},Popconfirm:{okText:"OK",cancelText:"Cancel"},Transfer:{titles:["",""],searchPlaceholder:"Search here",itemUnit:"item",itemsUnit:"items",remove:"Remove",selectCurrent:"Select current page",removeCurrent:"Remove current page",selectAll:"Select all data",deselectAll:"Deselect all data",removeAll:"Remove all data",selectInvert:"Invert current page"},Upload:{uploading:"Uploading...",removeFile:"Remove file",uploadError:"Upload error",previewFile:"Preview file",downloadFile:"Download file"},Empty:{description:"No data"},Icon:{icon:"icon"},Text:{edit:"Edit",copy:"Copy",copied:"Copied",expand:"Expand",collapse:"Collapse"},Form:{optional:"(optional)",defaultValidateMessages:{default:"Field validation error for ${label}",required:"Please enter ${label}",enum:"${label} must be one of [${enum}]",whitespace:"${label} cannot be a blank character",date:{format:"${label} date format is invalid",parse:"${label} cannot be converted to a date",invalid:"${label} is an invalid date"},types:{string:si,method:si,array:si,object:si,number:si,date:si,boolean:si,integer:si,float:si,regexp:si,email:si,url:si,hex:si},string:{len:"${label} must be ${len} characters",min:"${label} must be at least ${min} characters",max:"${label} must be up to ${max} characters",range:"${label} must be between ${min}-${max} characters"},number:{len:"${label} must be equal to ${len}",min:"${label} must be minimum ${min}",max:"${label} must be maximum ${max}",range:"${label} must be between ${min}-${max}"},array:{len:"Must be ${len} ${label}",min:"At least ${min} ${label}",max:"At most ${max} ${label}",range:"The amount of ${label} must be between ${min}-${max}"},pattern:{mismatch:"${label} does not match the pattern ${pattern}"}}},Image:{preview:"Preview"},QRCode:{expired:"QR code expired",refresh:"Refresh",scanned:"Scanned"},ColorPicker:{presetEmpty:"Empty",transparent:"Transparent",singleColor:"Single",gradientColor:"Gradient"}};Object.assign({},Cc.Modal);let zh=[];const yT=()=>zh.reduce((t,e)=>Object.assign(Object.assign({},t),e),Cc.Modal);function NF(t){if(t){const e=Object.assign({},t);return zh.push(e),yT(),()=>{zh=zh.filter(n=>n!==e),yT()}}Object.assign({},Cc.Modal)}const lb=_.createContext(void 0),cb=(t,e)=>{const n=_.useContext(lb),r=_.useMemo(()=>{var s;const l=Cc[t],c=(s=n==null?void 0:n[t])!==null&&s!==void 0?s:{};return Object.assign(Object.assign({},typeof l=="function"?l():l),c||{})},[t,e,n]),i=_.useMemo(()=>{const s=n==null?void 0:n.locale;return n!=null&&n.exist&&!s?Cc.locale:s},[n]);return[r,i]},IF="internalMark",DF=t=>{const{locale:e={},children:n,_ANT_MARK__:r}=t;_.useEffect(()=>NF(e==null?void 0:e.Modal),[e]);const i=_.useMemo(()=>Object.assign(Object.assign({},e),{exist:!0}),[e]);return _.createElement(lb.Provider,{value:i},n)},k3={blue:"#1677FF",purple:"#722ED1",cyan:"#13C2C2",green:"#52C41A",magenta:"#EB2F96",pink:"#EB2F96",red:"#F5222D",orange:"#FA8C16",yellow:"#FADB14",volcano:"#FA541C",geekblue:"#2F54EB",gold:"#FAAD14",lime:"#A0D911"},Cf=Object.assign(Object.assign({},k3),{colorPrimary:"#1677ff",colorSuccess:"#52c41a",colorWarning:"#faad14",colorError:"#ff4d4f",colorInfo:"#1677ff",colorLink:"",colorTextBase:"",colorBgBase:"",fontFamily:`-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, +'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', +'Noto Color Emoji'`,fontFamilyCode:"'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace",fontSize:14,lineWidth:1,lineType:"solid",motionUnit:.1,motionBase:0,motionEaseOutCirc:"cubic-bezier(0.08, 0.82, 0.17, 1)",motionEaseInOutCirc:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",motionEaseOut:"cubic-bezier(0.215, 0.61, 0.355, 1)",motionEaseInOut:"cubic-bezier(0.645, 0.045, 0.355, 1)",motionEaseOutBack:"cubic-bezier(0.12, 0.4, 0.29, 1.46)",motionEaseInBack:"cubic-bezier(0.71, -0.46, 0.88, 0.6)",motionEaseInQuint:"cubic-bezier(0.755, 0.05, 0.855, 0.06)",motionEaseOutQuint:"cubic-bezier(0.23, 1, 0.32, 1)",borderRadius:6,sizeUnit:4,sizeStep:4,sizePopupArrow:16,controlHeight:32,zIndexBase:0,zIndexPopupBase:1e3,opacityImage:1,wireframe:!1,motion:!0}),yr=Math.round;function zv(t,e){const n=t.replace(/^[^(]*\((.*)/,"$1").replace(/\).*/,"").match(/\d*\.?\d+%?/g)||[],r=n.map(i=>parseFloat(i));for(let i=0;i<3;i+=1)r[i]=e(r[i]||0,n[i]||"",i);return n[3]?r[3]=n[3].includes("%")?r[3]/100:r[3]:r[3]=1,r}const bT=(t,e,n)=>n===0?t:t/100;function $u(t,e){const n=e||255;return t>n?n:t<0?0:t}class wn{constructor(e){K(this,"isValid",!0),K(this,"r",0),K(this,"g",0),K(this,"b",0),K(this,"a",1),K(this,"_h",void 0),K(this,"_s",void 0),K(this,"_l",void 0),K(this,"_v",void 0),K(this,"_max",void 0),K(this,"_min",void 0),K(this,"_brightness",void 0);function n(r){return r[0]in e&&r[1]in e&&r[2]in e}if(e)if(typeof e=="string"){let i=function(s){return r.startsWith(s)};const r=e.trim();/^#?[A-F\d]{3,8}$/i.test(r)?this.fromHexString(r):i("rgb")?this.fromRgbString(r):i("hsl")?this.fromHslString(r):(i("hsv")||i("hsb"))&&this.fromHsvString(r)}else if(e instanceof wn)this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this._h=e._h,this._s=e._s,this._l=e._l,this._v=e._v;else if(n("rgb"))this.r=$u(e.r),this.g=$u(e.g),this.b=$u(e.b),this.a=typeof e.a=="number"?$u(e.a,1):1;else if(n("hsl"))this.fromHsl(e);else if(n("hsv"))this.fromHsv(e);else throw new Error("@ant-design/fast-color: unsupported input "+JSON.stringify(e))}setR(e){return this._sc("r",e)}setG(e){return this._sc("g",e)}setB(e){return this._sc("b",e)}setA(e){return this._sc("a",e,1)}setHue(e){const n=this.toHsv();return n.h=e,this._c(n)}getLuminance(){function e(s){const l=s/255;return l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4)}const n=e(this.r),r=e(this.g),i=e(this.b);return .2126*n+.7152*r+.0722*i}getHue(){if(typeof this._h>"u"){const e=this.getMax()-this.getMin();e===0?this._h=0:this._h=yr(60*(this.r===this.getMax()?(this.g-this.b)/e+(this.g"u"){const e=this.getMax()-this.getMin();e===0?this._s=0:this._s=e/this.getMax()}return this._s}getLightness(){return typeof this._l>"u"&&(this._l=(this.getMax()+this.getMin())/510),this._l}getValue(){return typeof this._v>"u"&&(this._v=this.getMax()/255),this._v}getBrightness(){return typeof this._brightness>"u"&&(this._brightness=(this.r*299+this.g*587+this.b*114)/1e3),this._brightness}darken(e=10){const n=this.getHue(),r=this.getSaturation();let i=this.getLightness()-e/100;return i<0&&(i=0),this._c({h:n,s:r,l:i,a:this.a})}lighten(e=10){const n=this.getHue(),r=this.getSaturation();let i=this.getLightness()+e/100;return i>1&&(i=1),this._c({h:n,s:r,l:i,a:this.a})}mix(e,n=50){const r=this._c(e),i=n/100,s=c=>(r[c]-this[c])*i+this[c],l={r:yr(s("r")),g:yr(s("g")),b:yr(s("b")),a:yr(s("a")*100)/100};return this._c(l)}tint(e=10){return this.mix({r:255,g:255,b:255,a:1},e)}shade(e=10){return this.mix({r:0,g:0,b:0,a:1},e)}onBackground(e){const n=this._c(e),r=this.a+n.a*(1-this.a),i=s=>yr((this[s]*this.a+n[s]*n.a*(1-this.a))/r);return this._c({r:i("r"),g:i("g"),b:i("b"),a:r})}isDark(){return this.getBrightness()<128}isLight(){return this.getBrightness()>=128}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}clone(){return this._c(this)}toHexString(){let e="#";const n=(this.r||0).toString(16);e+=n.length===2?n:"0"+n;const r=(this.g||0).toString(16);e+=r.length===2?r:"0"+r;const i=(this.b||0).toString(16);if(e+=i.length===2?i:"0"+i,typeof this.a=="number"&&this.a>=0&&this.a<1){const s=yr(this.a*255).toString(16);e+=s.length===2?s:"0"+s}return e}toHsl(){return{h:this.getHue(),s:this.getSaturation(),l:this.getLightness(),a:this.a}}toHslString(){const e=this.getHue(),n=yr(this.getSaturation()*100),r=yr(this.getLightness()*100);return this.a!==1?`hsla(${e},${n}%,${r}%,${this.a})`:`hsl(${e},${n}%,${r}%)`}toHsv(){return{h:this.getHue(),s:this.getSaturation(),v:this.getValue(),a:this.a}}toRgb(){return{r:this.r,g:this.g,b:this.b,a:this.a}}toRgbString(){return this.a!==1?`rgba(${this.r},${this.g},${this.b},${this.a})`:`rgb(${this.r},${this.g},${this.b})`}toString(){return this.toRgbString()}_sc(e,n,r){const i=this.clone();return i[e]=$u(n,r),i}_c(e){return new this.constructor(e)}getMax(){return typeof this._max>"u"&&(this._max=Math.max(this.r,this.g,this.b)),this._max}getMin(){return typeof this._min>"u"&&(this._min=Math.min(this.r,this.g,this.b)),this._min}fromHexString(e){const n=e.replace("#","");function r(i,s){return parseInt(n[i]+n[s||i],16)}n.length<6?(this.r=r(0),this.g=r(1),this.b=r(2),this.a=n[3]?r(3)/255:1):(this.r=r(0,1),this.g=r(2,3),this.b=r(4,5),this.a=n[6]?r(6,7)/255:1)}fromHsl({h:e,s:n,l:r,a:i}){if(this._h=e%360,this._s=n,this._l=r,this.a=typeof i=="number"?i:1,n<=0){const v=yr(r*255);this.r=v,this.g=v,this.b=v}let s=0,l=0,c=0;const f=e/60,d=(1-Math.abs(2*r-1))*n,g=d*(1-Math.abs(f%2-1));f>=0&&f<1?(s=d,l=g):f>=1&&f<2?(s=g,l=d):f>=2&&f<3?(l=d,c=g):f>=3&&f<4?(l=g,c=d):f>=4&&f<5?(s=g,c=d):f>=5&&f<6&&(s=d,c=g);const m=r-d/2;this.r=yr((s+m)*255),this.g=yr((l+m)*255),this.b=yr((c+m)*255)}fromHsv({h:e,s:n,v:r,a:i}){this._h=e%360,this._s=n,this._v=r,this.a=typeof i=="number"?i:1;const s=yr(r*255);if(this.r=s,this.g=s,this.b=s,n<=0)return;const l=e/60,c=Math.floor(l),f=l-c,d=yr(r*(1-n)*255),g=yr(r*(1-n*f)*255),m=yr(r*(1-n*(1-f))*255);switch(c){case 0:this.g=m,this.b=d;break;case 1:this.r=g,this.b=d;break;case 2:this.r=d,this.b=m;break;case 3:this.r=d,this.g=g;break;case 4:this.r=m,this.g=d;break;case 5:default:this.g=d,this.b=g;break}}fromHsvString(e){const n=zv(e,bT);this.fromHsv({h:n[0],s:n[1],v:n[2],a:n[3]})}fromHslString(e){const n=zv(e,bT);this.fromHsl({h:n[0],s:n[1],l:n[2],a:n[3]})}fromRgbString(e){const n=zv(e,(r,i)=>i.includes("%")?yr(r/100*255):r);this.r=n[0],this.g=n[1],this.b=n[2],this.a=n[3]}}var ch=2,ST=.16,FF=.05,kF=.05,BF=.15,B3=5,U3=4,UF=[{index:7,amount:15},{index:6,amount:25},{index:5,amount:30},{index:5,amount:45},{index:5,amount:65},{index:5,amount:85},{index:4,amount:90},{index:3,amount:95},{index:2,amount:97},{index:1,amount:98}];function wT(t,e,n){var r;return Math.round(t.h)>=60&&Math.round(t.h)<=240?r=n?Math.round(t.h)-ch*e:Math.round(t.h)+ch*e:r=n?Math.round(t.h)+ch*e:Math.round(t.h)-ch*e,r<0?r+=360:r>=360&&(r-=360),r}function ET(t,e,n){if(t.h===0&&t.s===0)return t.s;var r;return n?r=t.s-ST*e:e===U3?r=t.s+ST:r=t.s+FF*e,r>1&&(r=1),n&&e===B3&&r>.1&&(r=.1),r<.06&&(r=.06),Math.round(r*100)/100}function TT(t,e,n){var r;return n?r=t.v+kF*e:r=t.v-BF*e,r=Math.max(0,Math.min(1,r)),Math.round(r*100)/100}function Rf(t){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=[],r=new wn(t),i=r.toHsv(),s=B3;s>0;s-=1){var l=new wn({h:wT(i,s,!0),s:ET(i,s,!0),v:TT(i,s,!0)});n.push(l)}n.push(r);for(var c=1;c<=U3;c+=1){var f=new wn({h:wT(i,c),s:ET(i,c),v:TT(i,c)});n.push(f)}return e.theme==="dark"?UF.map(function(d){var g=d.index,m=d.amount;return new wn(e.backgroundColor||"#141414").mix(n[g],m).toHexString()}):n.map(function(d){return d.toHexString()})}var $v={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"},s_=["#fff1f0","#ffccc7","#ffa39e","#ff7875","#ff4d4f","#f5222d","#cf1322","#a8071a","#820014","#5c0011"];s_.primary=s_[5];var a_=["#fff2e8","#ffd8bf","#ffbb96","#ff9c6e","#ff7a45","#fa541c","#d4380d","#ad2102","#871400","#610b00"];a_.primary=a_[5];var o_=["#fff7e6","#ffe7ba","#ffd591","#ffc069","#ffa940","#fa8c16","#d46b08","#ad4e00","#873800","#612500"];o_.primary=o_[5];var l_=["#fffbe6","#fff1b8","#ffe58f","#ffd666","#ffc53d","#faad14","#d48806","#ad6800","#874d00","#613400"];l_.primary=l_[5];var c_=["#feffe6","#ffffb8","#fffb8f","#fff566","#ffec3d","#fadb14","#d4b106","#ad8b00","#876800","#614700"];c_.primary=c_[5];var u_=["#fcffe6","#f4ffb8","#eaff8f","#d3f261","#bae637","#a0d911","#7cb305","#5b8c00","#3f6600","#254000"];u_.primary=u_[5];var f_=["#f6ffed","#d9f7be","#b7eb8f","#95de64","#73d13d","#52c41a","#389e0d","#237804","#135200","#092b00"];f_.primary=f_[5];var d_=["#e6fffb","#b5f5ec","#87e8de","#5cdbd3","#36cfc9","#13c2c2","#08979c","#006d75","#00474f","#002329"];d_.primary=d_[5];var ig=["#e6f4ff","#bae0ff","#91caff","#69b1ff","#4096ff","#1677ff","#0958d9","#003eb3","#002c8c","#001d66"];ig.primary=ig[5];var h_=["#f0f5ff","#d6e4ff","#adc6ff","#85a5ff","#597ef7","#2f54eb","#1d39c4","#10239e","#061178","#030852"];h_.primary=h_[5];var g_=["#f9f0ff","#efdbff","#d3adf7","#b37feb","#9254de","#722ed1","#531dab","#391085","#22075e","#120338"];g_.primary=g_[5];var p_=["#fff0f6","#ffd6e7","#ffadd2","#ff85c0","#f759ab","#eb2f96","#c41d7f","#9e1068","#780650","#520339"];p_.primary=p_[5];var m_=["#a6a6a6","#999999","#8c8c8c","#808080","#737373","#666666","#404040","#1a1a1a","#000000","#000000"];m_.primary=m_[5];var Vv={red:s_,volcano:a_,orange:o_,gold:l_,yellow:c_,lime:u_,green:f_,cyan:d_,blue:ig,geekblue:h_,purple:g_,magenta:p_,grey:m_};function LF(t,e){let{generateColorPalettes:n,generateNeutralColorPalettes:r}=e;const{colorSuccess:i,colorWarning:s,colorError:l,colorInfo:c,colorPrimary:f,colorBgBase:d,colorTextBase:g}=t,m=n(f),v=n(i),S=n(s),E=n(l),w=n(c),b=r(d,g),A=t.colorLink||t.colorInfo,T=n(A),C=new wn(E[1]).mix(new wn(E[3]),50).toHexString();return Object.assign(Object.assign({},b),{colorPrimaryBg:m[1],colorPrimaryBgHover:m[2],colorPrimaryBorder:m[3],colorPrimaryBorderHover:m[4],colorPrimaryHover:m[5],colorPrimary:m[6],colorPrimaryActive:m[7],colorPrimaryTextHover:m[8],colorPrimaryText:m[9],colorPrimaryTextActive:m[10],colorSuccessBg:v[1],colorSuccessBgHover:v[2],colorSuccessBorder:v[3],colorSuccessBorderHover:v[4],colorSuccessHover:v[4],colorSuccess:v[6],colorSuccessActive:v[7],colorSuccessTextHover:v[8],colorSuccessText:v[9],colorSuccessTextActive:v[10],colorErrorBg:E[1],colorErrorBgHover:E[2],colorErrorBgFilledHover:C,colorErrorBgActive:E[3],colorErrorBorder:E[3],colorErrorBorderHover:E[4],colorErrorHover:E[5],colorError:E[6],colorErrorActive:E[7],colorErrorTextHover:E[8],colorErrorText:E[9],colorErrorTextActive:E[10],colorWarningBg:S[1],colorWarningBgHover:S[2],colorWarningBorder:S[3],colorWarningBorderHover:S[4],colorWarningHover:S[4],colorWarning:S[6],colorWarningActive:S[7],colorWarningTextHover:S[8],colorWarningText:S[9],colorWarningTextActive:S[10],colorInfoBg:w[1],colorInfoBgHover:w[2],colorInfoBorder:w[3],colorInfoBorderHover:w[4],colorInfoHover:w[4],colorInfo:w[6],colorInfoActive:w[7],colorInfoTextHover:w[8],colorInfoText:w[9],colorInfoTextActive:w[10],colorLinkHover:T[4],colorLink:T[6],colorLinkActive:T[7],colorBgMask:new wn("#000").setA(.45).toRgbString(),colorWhite:"#fff"})}const zF=t=>{let e=t,n=t,r=t,i=t;return t<6&&t>=5?e=t+1:t<16&&t>=6?e=t+2:t>=16&&(e=16),t<7&&t>=5?n=4:t<8&&t>=7?n=5:t<14&&t>=8?n=6:t<16&&t>=14?n=7:t>=16&&(n=8),t<6&&t>=2?r=1:t>=6&&(r=2),t>4&&t<8?i=4:t>=8&&(i=6),{borderRadius:t,borderRadiusXS:r,borderRadiusSM:n,borderRadiusLG:e,borderRadiusOuter:i}};function $F(t){const{motionUnit:e,motionBase:n,borderRadius:r,lineWidth:i}=t;return Object.assign({motionDurationFast:`${(n+e).toFixed(1)}s`,motionDurationMid:`${(n+e*2).toFixed(1)}s`,motionDurationSlow:`${(n+e*3).toFixed(1)}s`,lineWidthBold:i+1},zF(r))}const VF=t=>{const{controlHeight:e}=t;return{controlHeightSM:e*.75,controlHeightXS:e*.5,controlHeightLG:e*1.25}};function HF(t){return(t+8)/t}function jF(t){const e=new Array(10).fill(null).map((n,r)=>{const i=r-1,s=t*Math.pow(Math.E,i/5),l=r>1?Math.floor(s):Math.ceil(s);return Math.floor(l/2)*2});return e[1]=t,e.map(n=>({size:n,lineHeight:HF(n)}))}const WF=t=>{const e=jF(t),n=e.map(g=>g.size),r=e.map(g=>g.lineHeight),i=n[1],s=n[0],l=n[2],c=r[1],f=r[0],d=r[2];return{fontSizeSM:s,fontSize:i,fontSizeLG:l,fontSizeXL:n[3],fontSizeHeading1:n[6],fontSizeHeading2:n[5],fontSizeHeading3:n[4],fontSizeHeading4:n[3],fontSizeHeading5:n[2],lineHeight:c,lineHeightLG:d,lineHeightSM:f,fontHeight:Math.round(c*i),fontHeightLG:Math.round(d*l),fontHeightSM:Math.round(f*s),lineHeightHeading1:r[6],lineHeightHeading2:r[5],lineHeightHeading3:r[4],lineHeightHeading4:r[3],lineHeightHeading5:r[2]}};function XF(t){const{sizeUnit:e,sizeStep:n}=t;return{sizeXXL:e*(n+8),sizeXL:e*(n+4),sizeLG:e*(n+2),sizeMD:e*(n+1),sizeMS:e*n,size:e*n,sizeSM:e*(n-1),sizeXS:e*(n-2),sizeXXS:e*(n-3)}}const Ai=(t,e)=>new wn(t).setA(e).toRgbString(),Vu=(t,e)=>new wn(t).darken(e).toHexString(),qF=t=>{const e=Rf(t);return{1:e[0],2:e[1],3:e[2],4:e[3],5:e[4],6:e[5],7:e[6],8:e[4],9:e[5],10:e[6]}},YF=(t,e)=>{const n=t||"#fff",r=e||"#000";return{colorBgBase:n,colorTextBase:r,colorText:Ai(r,.88),colorTextSecondary:Ai(r,.65),colorTextTertiary:Ai(r,.45),colorTextQuaternary:Ai(r,.25),colorFill:Ai(r,.15),colorFillSecondary:Ai(r,.06),colorFillTertiary:Ai(r,.04),colorFillQuaternary:Ai(r,.02),colorBgSolid:Ai(r,1),colorBgSolidHover:Ai(r,.75),colorBgSolidActive:Ai(r,.95),colorBgLayout:Vu(n,4),colorBgContainer:Vu(n,0),colorBgElevated:Vu(n,0),colorBgSpotlight:Ai(r,.85),colorBgBlur:"transparent",colorBorder:Vu(n,15),colorBorderSecondary:Vu(n,6)}};function KF(t){$v.pink=$v.magenta,Vv.pink=Vv.magenta;const e=Object.keys(k3).map(n=>{const r=t[n]===$v[n]?Vv[n]:Rf(t[n]);return new Array(10).fill(1).reduce((i,s,l)=>(i[`${n}-${l+1}`]=r[l],i[`${n}${l+1}`]=r[l],i),{})}).reduce((n,r)=>(n=Object.assign(Object.assign({},n),r),n),{});return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},t),e),LF(t,{generateColorPalettes:qF,generateNeutralColorPalettes:YF})),WF(t.fontSize)),XF(t)),VF(t)),$F(t))}const L3=e_(KF),v_={token:Cf,override:{override:Cf},hashed:!0},z3=Ft.createContext(v_),__="ant",ub="anticon",ZF=["outlined","borderless","filled","underlined"],QF=(t,e)=>e||(t?`${__}-${t}`:__),ui=_.createContext({getPrefixCls:QF,iconPrefixCls:ub}),{Consumer:IJ}=ui,AT={};function Vc(t){const e=_.useContext(ui),{getPrefixCls:n,direction:r,getPopupContainer:i}=e,s=e[t];return Object.assign(Object.assign({classNames:AT,styles:AT},s),{getPrefixCls:n,direction:r,getPopupContainer:i})}const GF=`-ant-${Date.now()}-${Math.random()}`;function JF(t,e){const n={},r=(l,c)=>{let f=l.clone();return f=(c==null?void 0:c(f))||f,f.toRgbString()},i=(l,c)=>{const f=new wn(l),d=Rf(f.toRgbString());n[`${c}-color`]=r(f),n[`${c}-color-disabled`]=d[1],n[`${c}-color-hover`]=d[4],n[`${c}-color-active`]=d[6],n[`${c}-color-outline`]=f.clone().setA(.2).toRgbString(),n[`${c}-color-deprecated-bg`]=d[0],n[`${c}-color-deprecated-border`]=d[2]};if(e.primaryColor){i(e.primaryColor,"primary");const l=new wn(e.primaryColor),c=Rf(l.toRgbString());c.forEach((d,g)=>{n[`primary-${g+1}`]=d}),n["primary-color-deprecated-l-35"]=r(l,d=>d.lighten(35)),n["primary-color-deprecated-l-20"]=r(l,d=>d.lighten(20)),n["primary-color-deprecated-t-20"]=r(l,d=>d.tint(20)),n["primary-color-deprecated-t-50"]=r(l,d=>d.tint(50)),n["primary-color-deprecated-f-12"]=r(l,d=>d.setA(d.a*.12));const f=new wn(c[0]);n["primary-color-active-deprecated-f-30"]=r(f,d=>d.setA(d.a*.3)),n["primary-color-active-deprecated-d-02"]=r(f,d=>d.darken(2))}return e.successColor&&i(e.successColor,"success"),e.warningColor&&i(e.warningColor,"warning"),e.errorColor&&i(e.errorColor,"error"),e.infoColor&&i(e.infoColor,"info"),` + :root { + ${Object.keys(n).map(l=>`--${t}-${l}: ${n[l]};`).join(` +`)} + } + `.trim()}function e8(t,e){const n=JF(t,e);Qr()&&js(n,`${GF}-dynamic-theme`)}const xf=_.createContext(!1),t8=t=>{let{children:e,disabled:n}=t;const r=_.useContext(xf);return _.createElement(xf.Provider,{value:n??r},e)},Rc=_.createContext(void 0),n8=t=>{let{children:e,size:n}=t;const r=_.useContext(Rc);return _.createElement(Rc.Provider,{value:n||r},e)};function r8(){const t=_.useContext(xf),e=_.useContext(Rc);return{componentDisabled:t,componentSize:e}}var $3=Pr(function t(){Or(this,t)}),V3="CALC_UNIT",i8=new RegExp(V3,"g");function Hv(t){return typeof t=="number"?"".concat(t).concat(V3):t}var s8=function(t){Zo(n,t);var e=Qo(n);function n(r,i){var s;Or(this,n),s=e.call(this),K(Nt(s),"result",""),K(Nt(s),"unitlessCssVar",void 0),K(Nt(s),"lowPriority",void 0);var l=pt(r);return s.unitlessCssVar=i,r instanceof n?s.result="(".concat(r.result,")"):l==="number"?s.result=Hv(r):l==="string"&&(s.result=r),s}return Pr(n,[{key:"add",value:function(i){return i instanceof n?this.result="".concat(this.result," + ").concat(i.getResult()):(typeof i=="number"||typeof i=="string")&&(this.result="".concat(this.result," + ").concat(Hv(i))),this.lowPriority=!0,this}},{key:"sub",value:function(i){return i instanceof n?this.result="".concat(this.result," - ").concat(i.getResult()):(typeof i=="number"||typeof i=="string")&&(this.result="".concat(this.result," - ").concat(Hv(i))),this.lowPriority=!0,this}},{key:"mul",value:function(i){return this.lowPriority&&(this.result="(".concat(this.result,")")),i instanceof n?this.result="".concat(this.result," * ").concat(i.getResult(!0)):(typeof i=="number"||typeof i=="string")&&(this.result="".concat(this.result," * ").concat(i)),this.lowPriority=!1,this}},{key:"div",value:function(i){return this.lowPriority&&(this.result="(".concat(this.result,")")),i instanceof n?this.result="".concat(this.result," / ").concat(i.getResult(!0)):(typeof i=="number"||typeof i=="string")&&(this.result="".concat(this.result," / ").concat(i)),this.lowPriority=!1,this}},{key:"getResult",value:function(i){return this.lowPriority||i?"(".concat(this.result,")"):this.result}},{key:"equal",value:function(i){var s=this,l=i||{},c=l.unit,f=!0;return typeof c=="boolean"?f=c:Array.from(this.unitlessCssVar).some(function(d){return s.result.includes(d)})&&(f=!1),this.result=this.result.replace(i8,f?"px":""),typeof this.lowPriority<"u"?"calc(".concat(this.result,")"):this.result}}]),n}($3),a8=function(t){Zo(n,t);var e=Qo(n);function n(r){var i;return Or(this,n),i=e.call(this),K(Nt(i),"result",0),r instanceof n?i.result=r.result:typeof r=="number"&&(i.result=r),i}return Pr(n,[{key:"add",value:function(i){return i instanceof n?this.result+=i.result:typeof i=="number"&&(this.result+=i),this}},{key:"sub",value:function(i){return i instanceof n?this.result-=i.result:typeof i=="number"&&(this.result-=i),this}},{key:"mul",value:function(i){return i instanceof n?this.result*=i.result:typeof i=="number"&&(this.result*=i),this}},{key:"div",value:function(i){return i instanceof n?this.result/=i.result:typeof i=="number"&&(this.result/=i),this}},{key:"equal",value:function(){return this.result}}]),n}($3),o8=function(e,n){var r=e==="css"?s8:a8;return function(i){return new r(i,n)}},CT=function(e,n){return"".concat([n,e.replace(/([A-Z]+)([A-Z][a-z]+)/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2")].filter(Boolean).join("-"))};function dr(t){var e=_.useRef();e.current=t;var n=_.useCallback(function(){for(var r,i=arguments.length,s=new Array(i),l=0;l1e4){var r=Date.now();this.lastAccessBeat.forEach(function(i,s){r-i>f8&&(n.map.delete(s),n.lastAccessBeat.delete(s))}),this.accessBeat=0}}}]),t}(),OT=new d8;function h8(t,e){return Ft.useMemo(function(){var n=OT.get(e);if(n)return n;var r=t();return OT.set(e,r),r},e)}var g8=function(){return{}};function p8(t){var e=t.useCSP,n=e===void 0?g8:e,r=t.useToken,i=t.usePrefix,s=t.getResetStyles,l=t.getCommonStyle,c=t.getCompUnitless;function f(v,S,E,w){var b=Array.isArray(v)?v[0]:v;function A(L){return"".concat(String(b)).concat(L.slice(0,1).toUpperCase()).concat(L.slice(1))}var T=(w==null?void 0:w.unitless)||{},C=typeof c=="function"?c(v):{},M=J(J({},C),{},K({},A("zIndexPopup"),!0));Object.keys(T).forEach(function(L){M[A(L)]=T[L]});var x=J(J({},w),{},{unitless:M,prefixToken:A}),N=g(v,S,E,x),F=d(b,E,x);return function(L){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:L,V=N(L,I),B=de(V,2),j=B[1],X=F(I),Y=de(X,2),ae=Y[0],U=Y[1];return[ae,j,U]}}function d(v,S,E){var w=E.unitless,b=E.injectStyle,A=b===void 0?!0:b,T=E.prefixToken,C=E.ignore,M=function(F){var L=F.rootCls,I=F.cssVar,V=I===void 0?{}:I,B=r(),j=B.realToken;return wF({path:[v],prefix:V.prefix,key:V.key,unitless:w,ignore:C,token:j,scope:L},function(){var X=MT(v,j,S),Y=RT(v,j,X,{deprecatedTokens:E==null?void 0:E.deprecatedTokens});return Object.keys(X).forEach(function(ae){Y[T(ae)]=Y[ae],delete Y[ae]}),Y}),null},x=function(F){var L=r(),I=L.cssVar;return[function(V){return A&&I?Ft.createElement(Ft.Fragment,null,Ft.createElement(M,{rootCls:F,cssVar:I,component:v}),V):V},I==null?void 0:I.key]};return x}function g(v,S,E){var w=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},b=Array.isArray(v)?v:[v,v],A=de(b,1),T=A[0],C=b.join("-"),M=t.layer||{name:"antd"};return function(x){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:x,F=r(),L=F.theme,I=F.realToken,V=F.hashId,B=F.token,j=F.cssVar,X=i(),Y=X.rootPrefixCls,ae=X.iconPrefixCls,U=n(),z=j?"css":"js",W=h8(function(){var q=new Set;return j&&Object.keys(w.unitless||{}).forEach(function(ce){q.add(Fh(ce,j.prefix)),q.add(Fh(ce,CT(T,j.prefix)))}),o8(z,q)},[z,T,j==null?void 0:j.prefix]),Z=u8(z),P=Z.max,$=Z.min,ie={theme:L,token:B,hashId:V,nonce:function(){return U.nonce},clientOnly:w.clientOnly,layer:M,order:w.order||-999};typeof s=="function"&&i_(J(J({},ie),{},{clientOnly:!1,path:["Shared",Y]}),function(){return s(B,{prefix:{rootPrefixCls:Y,iconPrefixCls:ae},csp:U})});var se=i_(J(J({},ie),{},{path:[C,x,ae]}),function(){if(w.injectStyle===!1)return[];var q=c8(B),ce=q.token,fe=q.flush,ye=MT(T,I,E),we=".".concat(x),Ae=RT(T,I,ye,{deprecatedTokens:w.deprecatedTokens});j&&ye&&pt(ye)==="object"&&Object.keys(ye).forEach(function(_e){ye[_e]="var(".concat(Fh(_e,CT(T,j.prefix)),")")});var Te=fi(ce,{componentCls:we,prefixCls:x,iconCls:".".concat(ae),antCls:".".concat(Y),calc:W,max:P,min:$},j?ye:Ae),ve=S(Te,{hashId:V,prefixCls:x,rootPrefixCls:Y,iconPrefixCls:ae});fe(T,Ae);var ge=typeof l=="function"?l(Te,x,N,w.resetFont):null;return[w.resetStyle===!1?null:ge,ve]});return[se,V]}}function m(v,S,E){var w=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},b=g(v,S,E,J({resetStyle:!1,order:-998},w)),A=function(C){var M=C.prefixCls,x=C.rootCls,N=x===void 0?M:x;return b(M,N),null};return A}return{genStyleHooks:f,genSubStyleComponent:m,genComponentStyleHook:g}}const sg=["blue","purple","cyan","green","magenta","pink","red","orange","yellow","volcano","geekblue","lime","gold"],m8="5.24.0";function Wv(t){return t>=0&&t<=255}function uh(t,e){const{r:n,g:r,b:i,a:s}=new wn(t).toRgb();if(s<1)return t;const{r:l,g:c,b:f}=new wn(e).toRgb();for(let d=.01;d<=1;d+=.01){const g=Math.round((n-l*(1-d))/d),m=Math.round((r-c*(1-d))/d),v=Math.round((i-f*(1-d))/d);if(Wv(g)&&Wv(m)&&Wv(v))return new wn({r:g,g:m,b:v,a:Math.round(d*100)/100}).toRgbString()}return new wn({r:n,g:r,b:i,a:1}).toRgbString()}var v8=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{delete r[v]});const i=Object.assign(Object.assign({},n),r),s=480,l=576,c=768,f=992,d=1200,g=1600;if(i.motion===!1){const v="0s";i.motionDurationFast=v,i.motionDurationMid=v,i.motionDurationSlow=v}return Object.assign(Object.assign(Object.assign({},i),{colorFillContent:i.colorFillSecondary,colorFillContentHover:i.colorFill,colorFillAlter:i.colorFillQuaternary,colorBgContainerDisabled:i.colorFillTertiary,colorBorderBg:i.colorBgContainer,colorSplit:uh(i.colorBorderSecondary,i.colorBgContainer),colorTextPlaceholder:i.colorTextQuaternary,colorTextDisabled:i.colorTextQuaternary,colorTextHeading:i.colorText,colorTextLabel:i.colorTextSecondary,colorTextDescription:i.colorTextTertiary,colorTextLightSolid:i.colorWhite,colorHighlight:i.colorError,colorBgTextHover:i.colorFillSecondary,colorBgTextActive:i.colorFill,colorIcon:i.colorTextTertiary,colorIconHover:i.colorText,colorErrorOutline:uh(i.colorErrorBg,i.colorBgContainer),colorWarningOutline:uh(i.colorWarningBg,i.colorBgContainer),fontSizeIcon:i.fontSizeSM,lineWidthFocus:i.lineWidth*3,lineWidth:i.lineWidth,controlOutlineWidth:i.lineWidth*2,controlInteractiveSize:i.controlHeight/2,controlItemBgHover:i.colorFillTertiary,controlItemBgActive:i.colorPrimaryBg,controlItemBgActiveHover:i.colorPrimaryBgHover,controlItemBgActiveDisabled:i.colorFill,controlTmpOutline:i.colorFillQuaternary,controlOutline:uh(i.colorPrimaryBg,i.colorBgContainer),lineType:i.lineType,borderRadius:i.borderRadius,borderRadiusXS:i.borderRadiusXS,borderRadiusSM:i.borderRadiusSM,borderRadiusLG:i.borderRadiusLG,fontWeightStrong:600,opacityLoading:.65,linkDecoration:"none",linkHoverDecoration:"none",linkFocusDecoration:"none",controlPaddingHorizontal:12,controlPaddingHorizontalSM:8,paddingXXS:i.sizeXXS,paddingXS:i.sizeXS,paddingSM:i.sizeSM,padding:i.size,paddingMD:i.sizeMD,paddingLG:i.sizeLG,paddingXL:i.sizeXL,paddingContentHorizontalLG:i.sizeLG,paddingContentVerticalLG:i.sizeMS,paddingContentHorizontal:i.sizeMS,paddingContentVertical:i.sizeSM,paddingContentHorizontalSM:i.size,paddingContentVerticalSM:i.sizeXS,marginXXS:i.sizeXXS,marginXS:i.sizeXS,marginSM:i.sizeSM,margin:i.size,marginMD:i.sizeMD,marginLG:i.sizeLG,marginXL:i.sizeXL,marginXXL:i.sizeXXL,boxShadow:` + 0 6px 16px 0 rgba(0, 0, 0, 0.08), + 0 3px 6px -4px rgba(0, 0, 0, 0.12), + 0 9px 28px 8px rgba(0, 0, 0, 0.05) + `,boxShadowSecondary:` + 0 6px 16px 0 rgba(0, 0, 0, 0.08), + 0 3px 6px -4px rgba(0, 0, 0, 0.12), + 0 9px 28px 8px rgba(0, 0, 0, 0.05) + `,boxShadowTertiary:` + 0 1px 2px 0 rgba(0, 0, 0, 0.03), + 0 1px 6px -1px rgba(0, 0, 0, 0.02), + 0 2px 4px 0 rgba(0, 0, 0, 0.02) + `,screenXS:s,screenXSMin:s,screenXSMax:l-1,screenSM:l,screenSMMin:l,screenSMMax:c-1,screenMD:c,screenMDMin:c,screenMDMax:f-1,screenLG:f,screenLGMin:f,screenLGMax:d-1,screenXL:d,screenXLMin:d,screenXLMax:g-1,screenXXL:g,screenXXLMin:g,boxShadowPopoverArrow:"2px 2px 5px rgba(0, 0, 0, 0.05)",boxShadowCard:` + 0 1px 2px -2px ${new wn("rgba(0, 0, 0, 0.16)").toRgbString()}, + 0 3px 6px 0 ${new wn("rgba(0, 0, 0, 0.12)").toRgbString()}, + 0 5px 12px 4px ${new wn("rgba(0, 0, 0, 0.09)").toRgbString()} + `,boxShadowDrawerRight:` + -6px 0 16px 0 rgba(0, 0, 0, 0.08), + -3px 0 6px -4px rgba(0, 0, 0, 0.12), + -9px 0 28px 8px rgba(0, 0, 0, 0.05) + `,boxShadowDrawerLeft:` + 6px 0 16px 0 rgba(0, 0, 0, 0.08), + 3px 0 6px -4px rgba(0, 0, 0, 0.12), + 9px 0 28px 8px rgba(0, 0, 0, 0.05) + `,boxShadowDrawerUp:` + 0 6px 16px 0 rgba(0, 0, 0, 0.08), + 0 3px 6px -4px rgba(0, 0, 0, 0.12), + 0 9px 28px 8px rgba(0, 0, 0, 0.05) + `,boxShadowDrawerDown:` + 0 -6px 16px 0 rgba(0, 0, 0, 0.08), + 0 -3px 6px -4px rgba(0, 0, 0, 0.12), + 0 -9px 28px 8px rgba(0, 0, 0, 0.05) + `,boxShadowTabsOverflowLeft:"inset 10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowRight:"inset -10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowTop:"inset 0 10px 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowBottom:"inset 0 -10px 8px -8px rgba(0, 0, 0, 0.08)"}),r)}var PT=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{const r=n.getDerivativeToken(t),{override:i}=e,s=PT(e,["override"]);let l=Object.assign(Object.assign({},r),{override:i});return l=j3(l),s&&Object.entries(s).forEach(c=>{let[f,d]=c;const{theme:g}=d,m=PT(d,["theme"]);let v=m;g&&(v=X3(Object.assign(Object.assign({},l),m),{override:m},g)),l[f]=v}),l};function Xs(){const{token:t,hashed:e,theme:n,override:r,cssVar:i}=Ft.useContext(z3),s=`${m8}-${e||""}`,l=n||L3,[c,f,d]=Y5(l,[Cf,t],{salt:s,override:r,getComputedToken:X3,formatToken:j3,cssVar:i&&{prefix:i.prefix,key:i.key,unitless:W3,ignore:_8,preserve:y8}});return[l,d,e?f:"",c,i]}const b_={overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},Hc=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return{boxSizing:"border-box",margin:0,padding:0,color:t.colorText,fontSize:t.fontSize,lineHeight:t.lineHeight,listStyle:"none",fontFamily:e?"inherit":t.fontFamily}},fb=()=>({display:"inline-flex",alignItems:"center",color:"inherit",fontStyle:"normal",lineHeight:0,textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizeLegibility","-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale","> *":{lineHeight:1},svg:{display:"inline-block"}}),b8=t=>({a:{color:t.colorLink,textDecoration:t.linkDecoration,backgroundColor:"transparent",outline:"none",cursor:"pointer",transition:`color ${t.motionDurationSlow}`,"-webkit-text-decoration-skip":"objects","&:hover":{color:t.colorLinkHover},"&:active":{color:t.colorLinkActive},"&:active, &:hover":{textDecoration:t.linkHoverDecoration,outline:0},"&:focus":{textDecoration:t.linkFocusDecoration,outline:0},"&[disabled]":{color:t.colorTextDisabled,cursor:"not-allowed"}}}),S8=(t,e,n,r)=>{const i=`[class^="${e}"], [class*=" ${e}"]`,s=n?`.${n}`:i,l={boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"}};let c={};return r!==!1&&(c={fontFamily:t.fontFamily,fontSize:t.fontSize}),{[s]:Object.assign(Object.assign(Object.assign({},c),l),{[i]:l})}},q3=t=>({[`.${t}`]:Object.assign(Object.assign({},fb()),{[`.${t} .${t}-icon`]:{display:"block"}})}),{genStyleHooks:jc}=p8({usePrefix:()=>{const{getPrefixCls:t,iconPrefixCls:e}=_.useContext(ui);return{rootPrefixCls:t(),iconPrefixCls:e}},useToken:()=>{const[t,e,n,r,i]=Xs();return{theme:t,realToken:e,hashId:n,token:r,cssVar:i}},useCSP:()=>{const{csp:t}=_.useContext(ui);return t??{}},getResetStyles:(t,e)=>{var n;return[{"&":b8(t)},q3((n=e==null?void 0:e.prefix.iconPrefixCls)!==null&&n!==void 0?n:ub)]},getCommonStyle:S8,getCompUnitless:()=>W3});function w8(t,e){return sg.reduce((n,r)=>{const i=t[`${r}1`],s=t[`${r}3`],l=t[`${r}6`],c=t[`${r}7`];return Object.assign(Object.assign({},n),e(r,{lightColor:i,lightBorderColor:s,darkColor:l,textColor:c}))},{})}const E8=(t,e)=>{const[n,r]=Xs();return i_({token:r,hashId:"",path:["ant-design-icons",t],nonce:()=>e==null?void 0:e.nonce,layer:{name:"antd"}},()=>[q3(t)])},T8=Object.assign({},rp),{useId:NT}=T8,A8=()=>"",C8=typeof NT>"u"?A8:NT;function R8(t,e,n){var r;D3();const i=t||{},s=i.inherit===!1||!e?Object.assign(Object.assign({},v_),{hashed:(r=e==null?void 0:e.hashed)!==null&&r!==void 0?r:v_.hashed,cssVar:e==null?void 0:e.cssVar}):e,l=C8();return ap(()=>{var c,f;if(!t)return e;const d=Object.assign({},s.components);Object.keys(t.components||{}).forEach(v=>{d[v]=Object.assign(Object.assign({},d[v]),t.components[v])});const g=`css-var-${l.replace(/:/g,"")}`,m=((c=i.cssVar)!==null&&c!==void 0?c:s.cssVar)&&Object.assign(Object.assign(Object.assign({prefix:n==null?void 0:n.prefixCls},typeof s.cssVar=="object"?s.cssVar:{}),typeof i.cssVar=="object"?i.cssVar:{}),{key:typeof i.cssVar=="object"&&((f=i.cssVar)===null||f===void 0?void 0:f.key)||g});return Object.assign(Object.assign(Object.assign({},s),i),{token:Object.assign(Object.assign({},s.token),i.token),components:d,cssVar:m})},[i,s],(c,f)=>c.some((d,g)=>{const m=f[g];return!ng(d,m,!0)}))}var x8=["children"],Y3=_.createContext({});function M8(t){var e=t.children,n=Fn(t,x8);return _.createElement(Y3.Provider,{value:n},e)}var O8=function(t){Zo(n,t);var e=Qo(n);function n(){return Or(this,n),e.apply(this,arguments)}return Pr(n,[{key:"render",value:function(){return this.props.children}}]),n}(_.Component);function P8(t){var e=_.useReducer(function(c){return c+1},0),n=de(e,2),r=n[1],i=_.useRef(t),s=dr(function(){return i.current}),l=dr(function(c){i.current=typeof c=="function"?c(i.current):c,r()});return[s,l]}var wa="none",fh="appear",dh="enter",hh="leave",IT="none",Yi="prepare",Yl="start",Kl="active",db="end",K3="prepared";function DT(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit".concat(t)]="webkit".concat(e),n["Moz".concat(t)]="moz".concat(e),n["ms".concat(t)]="MS".concat(e),n["O".concat(t)]="o".concat(e.toLowerCase()),n}function N8(t,e){var n={animationend:DT("Animation","AnimationEnd"),transitionend:DT("Transition","TransitionEnd")};return t&&("AnimationEvent"in e||delete n.animationend.animation,"TransitionEvent"in e||delete n.transitionend.transition),n}var I8=N8(Qr(),typeof window<"u"?window:{}),Z3={};if(Qr()){var D8=document.createElement("div");Z3=D8.style}var gh={};function Q3(t){if(gh[t])return gh[t];var e=I8[t];if(e)for(var n=Object.keys(e),r=n.length,i=0;i1&&arguments[1]!==void 0?arguments[1]:2;e();var s=hr(function(){i<=1?r({isCanceled:function(){return s!==t.current}}):n(r,i-1)});t.current=s}return _.useEffect(function(){return function(){e()}},[]),[n,e]};var B8=[Yi,Yl,Kl,db],U8=[Yi,K3],nx=!1,L8=!0;function rx(t){return t===Kl||t===db}const z8=function(t,e,n){var r=Mf(IT),i=de(r,2),s=i[0],l=i[1],c=k8(),f=de(c,2),d=f[0],g=f[1];function m(){l(Yi,!0)}var v=e?U8:B8;return tx(function(){if(s!==IT&&s!==db){var S=v.indexOf(s),E=v[S+1],w=n(s);w===nx?l(E,!0):E&&d(function(b){function A(){b.isCanceled()||l(E,!0)}w===!0?A():Promise.resolve(w).then(A)})}},[t,s]),_.useEffect(function(){return function(){g()}},[]),[m,s]};function $8(t,e,n,r){var i=r.motionEnter,s=i===void 0?!0:i,l=r.motionAppear,c=l===void 0?!0:l,f=r.motionLeave,d=f===void 0?!0:f,g=r.motionDeadline,m=r.motionLeaveImmediately,v=r.onAppearPrepare,S=r.onEnterPrepare,E=r.onLeavePrepare,w=r.onAppearStart,b=r.onEnterStart,A=r.onLeaveStart,T=r.onAppearActive,C=r.onEnterActive,M=r.onLeaveActive,x=r.onAppearEnd,N=r.onEnterEnd,F=r.onLeaveEnd,L=r.onVisibleChanged,I=Mf(),V=de(I,2),B=V[0],j=V[1],X=P8(wa),Y=de(X,2),ae=Y[0],U=Y[1],z=Mf(null),W=de(z,2),Z=W[0],P=W[1],$=ae(),ie=_.useRef(!1),se=_.useRef(null);function q(){return n()}var ce=_.useRef(!1);function fe(){U(wa),P(null,!0)}var ye=dr(function(He){var Ge=ae();if(Ge!==wa){var Pe=q();if(!(He&&!He.deadline&&He.target!==Pe)){var Me=ce.current,dt;Ge===fh&&Me?dt=x==null?void 0:x(Pe,He):Ge===dh&&Me?dt=N==null?void 0:N(Pe,He):Ge===hh&&Me&&(dt=F==null?void 0:F(Pe,He)),Me&&dt!==!1&&fe()}}}),we=F8(ye),Ae=de(we,1),Te=Ae[0],ve=function(Ge){switch(Ge){case fh:return K(K(K({},Yi,v),Yl,w),Kl,T);case dh:return K(K(K({},Yi,S),Yl,b),Kl,C);case hh:return K(K(K({},Yi,E),Yl,A),Kl,M);default:return{}}},ge=_.useMemo(function(){return ve($)},[$]),_e=z8($,!t,function(He){if(He===Yi){var Ge=ge[Yi];return Ge?Ge(q()):nx}if(xe in ge){var Pe;P(((Pe=ge[xe])===null||Pe===void 0?void 0:Pe.call(ge,q(),null))||null)}return xe===Kl&&$!==wa&&(Te(q()),g>0&&(clearTimeout(se.current),se.current=setTimeout(function(){ye({deadline:!0})},g))),xe===K3&&fe(),L8}),Ie=de(_e,2),Ee=Ie[0],xe=Ie[1],Ve=rx(xe);ce.current=Ve;var Fe=_.useRef(null);tx(function(){if(!(ie.current&&Fe.current===e)){j(e);var He=ie.current;ie.current=!0;var Ge;!He&&e&&c&&(Ge=fh),He&&e&&s&&(Ge=dh),(He&&!e&&d||!He&&m&&!e&&d)&&(Ge=hh);var Pe=ve(Ge);Ge&&(t||Pe[Yi])?(U(Ge),Ee()):U(wa),Fe.current=e}},[e]),_.useEffect(function(){($===fh&&!c||$===dh&&!s||$===hh&&!d)&&U(wa)},[c,s,d]),_.useEffect(function(){return function(){ie.current=!1,clearTimeout(se.current)}},[]);var Be=_.useRef(!1);_.useEffect(function(){B&&(Be.current=!0),B!==void 0&&$===wa&&((Be.current||B)&&(L==null||L(B)),Be.current=!0)},[B,$]);var nt=Z;return ge[Yi]&&xe===Yl&&(nt=J({transition:"none"},nt)),[$,xe,nt,B??e]}function V8(t){var e=t;pt(t)==="object"&&(e=t.transitionSupport);function n(i,s){return!!(i.motionName&&e&&s!==!1)}var r=_.forwardRef(function(i,s){var l=i.visible,c=l===void 0?!0:l,f=i.removeOnLeave,d=f===void 0?!0:f,g=i.forceRender,m=i.children,v=i.motionName,S=i.leavedClassName,E=i.eventProps,w=_.useContext(Y3),b=w.motion,A=n(i,b),T=_.useRef(),C=_.useRef();function M(){try{return T.current instanceof HTMLElement?T.current:rf(C.current)}catch{return null}}var x=$8(A,c,M,i),N=de(x,4),F=N[0],L=N[1],I=N[2],V=N[3],B=_.useRef(V);V&&(B.current=!0);var j=_.useCallback(function(W){T.current=W,Qy(s,W)},[s]),X,Y=J(J({},E),{},{visible:c});if(!m)X=null;else if(F===wa)V?X=m(J({},Y),j):!d&&B.current&&S?X=m(J(J({},Y),{},{className:S}),j):g||!d&&!S?X=m(J(J({},Y),{},{style:{display:"none"}}),j):X=null;else{var ae;L===Yi?ae="prepare":rx(L)?ae="active":L===Yl&&(ae="start");var U=BT(v,"".concat(F,"-").concat(ae));X=m(J(J({},Y),{},{className:Ze(BT(v,F),K(K({},U,U&&ae),v,typeof v=="string")),style:I}),j)}if(_.isValidElement(X)&&cp(X)){var z=Gy(X);z||(X=_.cloneElement(X,{ref:j}))}return _.createElement(O8,{ref:C},X)});return r.displayName="CSSMotion",r}const hb=V8(ex);var S_="add",w_="keep",E_="remove",Xv="removed";function H8(t){var e;return t&&pt(t)==="object"&&"key"in t?e=t:e={key:t},J(J({},e),{},{key:String(e.key)})}function T_(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return t.map(H8)}function j8(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=[],r=0,i=e.length,s=T_(t),l=T_(e);s.forEach(function(d){for(var g=!1,m=r;m1});return f.forEach(function(d){n=n.filter(function(g){var m=g.key,v=g.status;return m!==d||v!==E_}),n.forEach(function(g){g.key===d&&(g.status=w_)})}),n}var W8=["component","children","onVisibleChanged","onAllRemoved"],X8=["status"],q8=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearPrepare","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function Y8(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:hb,n=function(r){Zo(s,r);var i=Qo(s);function s(){var l;Or(this,s);for(var c=arguments.length,f=new Array(c),d=0;dnull;var Q8=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);ie.endsWith("Color"))}const tk=t=>{const{prefixCls:e,iconPrefixCls:n,theme:r,holderRender:i}=t;e!==void 0&&(ix=e),r&&ek(r)&&e8(J8(),r)},nk=t=>{const{children:e,csp:n,autoInsertSpaceInButton:r,alert:i,anchor:s,form:l,locale:c,componentSize:f,direction:d,space:g,splitter:m,virtual:v,dropdownMatchSelectWidth:S,popupMatchSelectWidth:E,popupOverflow:w,legacyLocale:b,parentContext:A,iconPrefixCls:T,theme:C,componentDisabled:M,segmented:x,statistic:N,spin:F,calendar:L,carousel:I,cascader:V,collapse:B,typography:j,checkbox:X,descriptions:Y,divider:ae,drawer:U,skeleton:z,steps:W,image:Z,layout:P,list:$,mentions:ie,modal:se,progress:q,result:ce,slider:fe,breadcrumb:ye,menu:we,pagination:Ae,input:Te,textArea:ve,empty:ge,badge:_e,radio:Ie,rate:Ee,switch:xe,transfer:Ve,avatar:Fe,message:Be,tag:nt,table:He,card:Ge,tabs:Pe,timeline:Me,timePicker:dt,upload:rt,notification:it,tree:st,colorPicker:at,datePicker:Je,rangePicker:lt,flex:ft,wave:ct,dropdown:mt,warning:xt,tour:Bt,tooltip:ht,popover:Vt,popconfirm:qt,floatButtonGroup:En,variant:Mn,inputNumber:Ut,treeSelect:It}=t,Lt=_.useCallback((We,Qe)=>{const{prefixCls:bt}=t;if(Qe)return Qe;const _t=bt||A.getPrefixCls("");return We?`${_t}-${We}`:_t},[A.getPrefixCls,t.prefixCls]),Jt=T||A.iconPrefixCls||ub,Mt=n||A.csp;E8(Jt,Mt);const qe=R8(C,A.theme,{prefixCls:Lt("")}),ke={csp:Mt,autoInsertSpaceInButton:r,alert:i,anchor:s,locale:c||b,direction:d,space:g,splitter:m,virtual:v,popupMatchSelectWidth:E??S,popupOverflow:w,getPrefixCls:Lt,iconPrefixCls:Jt,theme:qe,segmented:x,statistic:N,spin:F,calendar:L,carousel:I,cascader:V,collapse:B,typography:j,checkbox:X,descriptions:Y,divider:ae,drawer:U,skeleton:z,steps:W,image:Z,input:Te,textArea:ve,layout:P,list:$,mentions:ie,modal:se,progress:q,result:ce,slider:fe,breadcrumb:ye,menu:we,pagination:Ae,empty:ge,badge:_e,radio:Ie,rate:Ee,switch:xe,transfer:Ve,avatar:Fe,message:Be,tag:nt,table:He,card:Ge,tabs:Pe,timeline:Me,timePicker:dt,upload:rt,notification:it,tree:st,colorPicker:at,datePicker:Je,rangePicker:lt,flex:ft,wave:ct,dropdown:mt,warning:xt,tour:Bt,tooltip:ht,popover:Vt,popconfirm:qt,floatButtonGroup:En,variant:Mn,inputNumber:Ut,treeSelect:It},Ne=Object.assign({},A);Object.keys(ke).forEach(We=>{ke[We]!==void 0&&(Ne[We]=ke[We])}),G8.forEach(We=>{const Qe=t[We];Qe&&(Ne[We]=Qe)}),typeof r<"u"&&(Ne.button=Object.assign({autoInsertSpace:r},Ne.button));const wt=ap(()=>Ne,Ne,(We,Qe)=>{const bt=Object.keys(We),_t=Object.keys(Qe);return bt.length!==_t.length||bt.some(Zt=>We[Zt]!==Qe[Zt])}),{layer:en}=_.useContext(qf),Ue=_.useMemo(()=>({prefixCls:Jt,csp:Mt,layer:en?"antd":void 0}),[Jt,Mt,en]);let Oe=_.createElement(_.Fragment,null,_.createElement(Z8,{dropdownMatchSelectWidth:S}),e);const je=_.useMemo(()=>{var We,Qe,bt,_t;return ql(((We=Cc.Form)===null||We===void 0?void 0:We.defaultValidateMessages)||{},((bt=(Qe=wt.locale)===null||Qe===void 0?void 0:Qe.Form)===null||bt===void 0?void 0:bt.defaultValidateMessages)||{},((_t=wt.form)===null||_t===void 0?void 0:_t.validateMessages)||{},(l==null?void 0:l.validateMessages)||{})},[wt,l==null?void 0:l.validateMessages]);Object.keys(je).length>0&&(Oe=_.createElement(xF.Provider,{value:je},Oe)),c&&(Oe=_.createElement(DF,{locale:c,_ANT_MARK__:IF},Oe)),Oe=_.createElement(ob.Provider,{value:Ue},Oe),f&&(Oe=_.createElement(n8,{size:f},Oe)),Oe=_.createElement(K8,null,Oe);const Ye=_.useMemo(()=>{const We=qe||{},{algorithm:Qe,token:bt,components:_t,cssVar:Zt}=We,Yt=Q8(We,["algorithm","token","components","cssVar"]),vn=Qe&&(!Array.isArray(Qe)||Qe.length>0)?e_(Qe):L3,On={};Object.entries(_t||{}).forEach(Zn=>{let[un,rn]=Zn;const Ce=Object.assign({},rn);"algorithm"in Ce&&(Ce.algorithm===!0?Ce.theme=vn:(Array.isArray(Ce.algorithm)||typeof Ce.algorithm=="function")&&(Ce.theme=e_(Ce.algorithm)),delete Ce.algorithm),On[un]=Ce});const _n=Object.assign(Object.assign({},Cf),bt);return Object.assign(Object.assign({},Yt),{theme:vn,token:_n,components:On,override:Object.assign({override:_n},On),cssVar:Zt})},[qe]);return C&&(Oe=_.createElement(z3.Provider,{value:Ye},Oe)),wt.warning&&(Oe=_.createElement(RF.Provider,{value:wt.warning},Oe)),M!==void 0&&(Oe=_.createElement(t8,{disabled:M},Oe)),_.createElement(ui.Provider,{value:wt},Oe)},Wc=t=>{const e=_.useContext(ui),n=_.useContext(lb);return _.createElement(nk,Object.assign({parentContext:e,legacyLocale:n},t))};Wc.ConfigContext=ui;Wc.SizeContext=Rc;Wc.config=tk;Wc.useConfig=r8;Object.defineProperty(Wc,"SizeContext",{get:()=>Rc});function sx(t){var e;return t==null||(e=t.getRootNode)===null||e===void 0?void 0:e.call(t)}function rk(t){return sx(t)instanceof ShadowRoot}function ag(t){return rk(t)?sx(t):null}function ik(t){return t.replace(/-(.)/g,function(e,n){return n.toUpperCase()})}function sk(t,e){Ur(t,"[@ant-design/icons] ".concat(e))}function UT(t){return pt(t)==="object"&&typeof t.name=="string"&&typeof t.theme=="string"&&(pt(t.icon)==="object"||typeof t.icon=="function")}function LT(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Object.keys(t).reduce(function(e,n){var r=t[n];switch(n){case"class":e.className=r,delete e.class;break;default:delete e[n],e[ik(n)]=r}return e},{})}function A_(t,e,n){return n?Ft.createElement(t.tag,J(J({key:e},LT(t.attrs)),n),(t.children||[]).map(function(r,i){return A_(r,"".concat(e,"-").concat(t.tag,"-").concat(i))})):Ft.createElement(t.tag,J({key:e},LT(t.attrs)),(t.children||[]).map(function(r,i){return A_(r,"".concat(e,"-").concat(t.tag,"-").concat(i))}))}function ax(t){return Rf(t)[0]}function ox(t){return t?Array.isArray(t)?t:[t]:[]}var ak=` +.anticon { + display: inline-flex; + align-items: center; + 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); + } +} +`,ok=function(e){var n=_.useContext(ob),r=n.csp,i=n.prefixCls,s=n.layer,l=ak;i&&(l=l.replace(/anticon/g,i)),s&&(l="@layer ".concat(s,` { +`).concat(l,` +}`)),_.useEffect(function(){var c=e.current,f=ag(c);js(l,"@ant-design-icons",{prepend:!s,csp:r,attachTo:f})},[])},lk=["icon","className","onClick","style","primaryColor","secondaryColor"],af={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function ck(t){var e=t.primaryColor,n=t.secondaryColor;af.primaryColor=e,af.secondaryColor=n||ax(e),af.calculated=!!n}function uk(){return J({},af)}var Xc=function(e){var n=e.icon,r=e.className,i=e.onClick,s=e.style,l=e.primaryColor,c=e.secondaryColor,f=Fn(e,lk),d=_.useRef(),g=af;if(l&&(g={primaryColor:l,secondaryColor:c||ax(l)}),ok(d),sk(UT(n),"icon should be icon definiton, but got ".concat(n)),!UT(n))return null;var m=n;return m&&typeof m.icon=="function"&&(m=J(J({},m),{},{icon:m.icon(g.primaryColor,g.secondaryColor)})),A_(m.icon,"svg-".concat(m.name),J(J({className:r,onClick:i,style:s,"data-icon":m.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},f),{},{ref:d}))};Xc.displayName="IconReact";Xc.getTwoToneColors=uk;Xc.setTwoToneColors=ck;function lx(t){var e=ox(t),n=de(e,2),r=n[0],i=n[1];return Xc.setTwoToneColors({primaryColor:r,secondaryColor:i})}function fk(){var t=Xc.getTwoToneColors();return t.calculated?[t.primaryColor,t.secondaryColor]:t.primaryColor}var dk=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];lx(ig.primary);var qs=_.forwardRef(function(t,e){var n=t.className,r=t.icon,i=t.spin,s=t.rotate,l=t.tabIndex,c=t.onClick,f=t.twoToneColor,d=Fn(t,dk),g=_.useContext(ob),m=g.prefixCls,v=m===void 0?"anticon":m,S=g.rootClassName,E=Ze(S,v,K(K({},"".concat(v,"-").concat(r.name),!!r.name),"".concat(v,"-spin"),!!i||r.name==="loading"),n),w=l;w===void 0&&c&&(w=-1);var b=s?{msTransform:"rotate(".concat(s,"deg)"),transform:"rotate(".concat(s,"deg)")}:void 0,A=ox(f),T=de(A,2),C=T[0],M=T[1];return _.createElement("span",kt({role:"img","aria-label":r.name},d,{ref:e,tabIndex:w,onClick:c,className:E}),_.createElement(Xc,{icon:r,primaryColor:C,secondaryColor:M,style:b}))});qs.displayName="AntdIcon";qs.getTwoToneColor=fk;qs.setTwoToneColor=lx;var hk={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"}}]},name:"close-circle",theme:"filled"},gk=function(e,n){return _.createElement(qs,kt({},e,{ref:n,icon:hk}))},pk=_.forwardRef(gk),mk={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z"}}]},name:"close",theme:"outlined"},vk=function(e,n){return _.createElement(qs,kt({},e,{ref:n,icon:mk}))},_k=_.forwardRef(vk),yk=`accept acceptCharset accessKey action allowFullScreen allowTransparency + alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge + charSet checked classID className colSpan cols content contentEditable contextMenu + controls coords crossOrigin data dateTime default defer dir disabled download draggable + encType form formAction formEncType formMethod formNoValidate formTarget frameBorder + headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity + is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media + mediaGroup method min minLength multiple muted name noValidate nonce open + optimum pattern placeholder poster preload radioGroup readOnly rel required + reversed role rowSpan rows sandbox scope scoped scrolling seamless selected + shape size sizes span spellCheck src srcDoc srcLang srcSet start step style + summary tabIndex target title type useMap value width wmode wrap`,bk=`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`,Sk="".concat(yk," ").concat(bk).split(/[\s\n]+/),wk="aria-",Ek="data-";function zT(t,e){return t.indexOf(e)===0}function og(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n;e===!1?n={aria:!0,data:!0,attr:!0}:e===!0?n={aria:!0}:n=J({},e);var r={};return Object.keys(t).forEach(function(i){(n.aria&&(i==="role"||zT(i,wk))||n.data&&zT(i,Ek)||n.attr&&Sk.includes(i))&&(r[i]=t[i])}),r}function Tk(t){return t&&Ft.isValidElement(t)&&t.type===Ft.Fragment}const Ak=(t,e,n)=>Ft.isValidElement(t)?Ft.cloneElement(t,typeof n=="function"?n(t.props||{}):n):e;function cx(t,e){return Ak(t,t,e)}const Ck=t=>{const[,,,,e]=Xs();return e?`${t}-css-var`:""};var et={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,CAPS_LOCK:20,ESC:27,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46,N:78,P:80,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,SEMICOLON:186,EQUALS:187,WIN_KEY:224},Rk={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"},xk=function(e,n){return _.createElement(qs,kt({},e,{ref:n,icon:Rk}))},Mk=_.forwardRef(xk);const ux=Ft.createContext(void 0),fo=100,fx={Modal:fo,Drawer:fo,Popover:fo,Popconfirm:fo,Tooltip:fo,Tour:fo,FloatButton:fo},Ok={SelectLike:50,Dropdown:50,DatePicker:50,Menu:50,ImagePreview:1};function Pk(t){return t in fx}const dx=(t,e)=>{const[,n]=Xs(),r=Ft.useContext(ux),i=Pk(t);let s;if(e!==void 0)s=[e,e];else{let l=r??0;i?l+=(r?0:n.zIndexPopupBase)+fx[t]:l+=Ok[t],s=[r===void 0?e:l,l]}return s};function ns(){ns=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(U,z,W){U[z]=W.value},s=typeof Symbol=="function"?Symbol:{},l=s.iterator||"@@iterator",c=s.asyncIterator||"@@asyncIterator",f=s.toStringTag||"@@toStringTag";function d(U,z,W){return Object.defineProperty(U,z,{value:W,enumerable:!0,configurable:!0,writable:!0}),U[z]}try{d({},"")}catch{d=function(W,Z,P){return W[Z]=P}}function g(U,z,W,Z){var P=z&&z.prototype instanceof A?z:A,$=Object.create(P.prototype),ie=new Y(Z||[]);return i($,"_invoke",{value:V(U,W,ie)}),$}function m(U,z,W){try{return{type:"normal",arg:U.call(z,W)}}catch(Z){return{type:"throw",arg:Z}}}e.wrap=g;var v="suspendedStart",S="suspendedYield",E="executing",w="completed",b={};function A(){}function T(){}function C(){}var M={};d(M,l,function(){return this});var x=Object.getPrototypeOf,N=x&&x(x(ae([])));N&&N!==n&&r.call(N,l)&&(M=N);var F=C.prototype=A.prototype=Object.create(M);function L(U){["next","throw","return"].forEach(function(z){d(U,z,function(W){return this._invoke(z,W)})})}function I(U,z){function W(P,$,ie,se){var q=m(U[P],U,$);if(q.type!=="throw"){var ce=q.arg,fe=ce.value;return fe&&pt(fe)=="object"&&r.call(fe,"__await")?z.resolve(fe.__await).then(function(ye){W("next",ye,ie,se)},function(ye){W("throw",ye,ie,se)}):z.resolve(fe).then(function(ye){ce.value=ye,ie(ce)},function(ye){return W("throw",ye,ie,se)})}se(q.arg)}var Z;i(this,"_invoke",{value:function($,ie){function se(){return new z(function(q,ce){W($,ie,q,ce)})}return Z=Z?Z.then(se,se):se()}})}function V(U,z,W){var Z=v;return function(P,$){if(Z===E)throw Error("Generator is already running");if(Z===w){if(P==="throw")throw $;return{value:t,done:!0}}for(W.method=P,W.arg=$;;){var ie=W.delegate;if(ie){var se=B(ie,W);if(se){if(se===b)continue;return se}}if(W.method==="next")W.sent=W._sent=W.arg;else if(W.method==="throw"){if(Z===v)throw Z=w,W.arg;W.dispatchException(W.arg)}else W.method==="return"&&W.abrupt("return",W.arg);Z=E;var q=m(U,z,W);if(q.type==="normal"){if(Z=W.done?w:S,q.arg===b)continue;return{value:q.arg,done:W.done}}q.type==="throw"&&(Z=w,W.method="throw",W.arg=q.arg)}}}function B(U,z){var W=z.method,Z=U.iterator[W];if(Z===t)return z.delegate=null,W==="throw"&&U.iterator.return&&(z.method="return",z.arg=t,B(U,z),z.method==="throw")||W!=="return"&&(z.method="throw",z.arg=new TypeError("The iterator does not provide a '"+W+"' method")),b;var P=m(Z,U.iterator,z.arg);if(P.type==="throw")return z.method="throw",z.arg=P.arg,z.delegate=null,b;var $=P.arg;return $?$.done?(z[U.resultName]=$.value,z.next=U.nextLoc,z.method!=="return"&&(z.method="next",z.arg=t),z.delegate=null,b):$:(z.method="throw",z.arg=new TypeError("iterator result is not an object"),z.delegate=null,b)}function j(U){var z={tryLoc:U[0]};1 in U&&(z.catchLoc=U[1]),2 in U&&(z.finallyLoc=U[2],z.afterLoc=U[3]),this.tryEntries.push(z)}function X(U){var z=U.completion||{};z.type="normal",delete z.arg,U.completion=z}function Y(U){this.tryEntries=[{tryLoc:"root"}],U.forEach(j,this),this.reset(!0)}function ae(U){if(U||U===""){var z=U[l];if(z)return z.call(U);if(typeof U.next=="function")return U;if(!isNaN(U.length)){var W=-1,Z=function P(){for(;++W=0;--P){var $=this.tryEntries[P],ie=$.completion;if($.tryLoc==="root")return Z("end");if($.tryLoc<=this.prev){var se=r.call($,"catchLoc"),q=r.call($,"finallyLoc");if(se&&q){if(this.prev<$.catchLoc)return Z($.catchLoc,!0);if(this.prev<$.finallyLoc)return Z($.finallyLoc)}else if(se){if(this.prev<$.catchLoc)return Z($.catchLoc,!0)}else{if(!q)throw Error("try statement without catch or finally");if(this.prev<$.finallyLoc)return Z($.finallyLoc)}}}},abrupt:function(z,W){for(var Z=this.tryEntries.length-1;Z>=0;--Z){var P=this.tryEntries[Z];if(P.tryLoc<=this.prev&&r.call(P,"finallyLoc")&&this.prev=0;--W){var Z=this.tryEntries[W];if(Z.finallyLoc===z)return this.complete(Z.completion,Z.afterLoc),X(Z),b}},catch:function(z){for(var W=this.tryEntries.length-1;W>=0;--W){var Z=this.tryEntries[W];if(Z.tryLoc===z){var P=Z.completion;if(P.type==="throw"){var $=P.arg;X(Z)}return $}}throw Error("illegal catch attempt")},delegateYield:function(z,W,Z){return this.delegate={iterator:ae(z),resultName:W,nextLoc:Z},this.method==="next"&&(this.arg=t),b}},e}function $T(t,e,n,r,i,s,l){try{var c=t[s](l),f=c.value}catch(d){return void n(d)}c.done?e(f):Promise.resolve(f).then(r,i)}function Yf(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var s=t.apply(e,n);function l(f){$T(s,r,i,l,c,"next",f)}function c(f){$T(s,r,i,l,c,"throw",f)}l(void 0)})}}const hx=(t,e,n)=>n!==void 0?n:`${t}-${e}`;function gx(t,e){var n=Object.assign({},t);return Array.isArray(e)&&e.forEach(function(r){delete n[r]}),n}const Nk=function(t){if(!t)return!1;if(t instanceof Element){if(t.offsetParent)return!0;if(t.getBBox){var e=t.getBBox(),n=e.width,r=e.height;if(n||r)return!0}if(t.getBoundingClientRect){var i=t.getBoundingClientRect(),s=i.width,l=i.height;if(s||l)return!0}}return!1},px=t=>{const e=Ft.useContext(Rc);return Ft.useMemo(()=>t?typeof t=="string"?t??e:t instanceof Function?t(e):e:e,[t,e])},Ik=t=>{const{componentCls:e}=t;return{[e]:{"&-block":{display:"flex",width:"100%"},"&-vertical":{flexDirection:"column"}}}},Dk=t=>{const{componentCls:e,antCls:n}=t;return{[e]:{display:"inline-flex","&-rtl":{direction:"rtl"},"&-vertical":{flexDirection:"column"},"&-align":{flexDirection:"column","&-center":{alignItems:"center"},"&-start":{alignItems:"flex-start"},"&-end":{alignItems:"flex-end"},"&-baseline":{alignItems:"baseline"}},[`${e}-item:empty`]:{display:"none"},[`${e}-item > ${n}-badge-not-a-wrapper:only-child`]:{display:"block"}}}},Fk=t=>{const{componentCls:e}=t;return{[e]:{"&-gap-row-small":{rowGap:t.spaceGapSmallSize},"&-gap-row-middle":{rowGap:t.spaceGapMiddleSize},"&-gap-row-large":{rowGap:t.spaceGapLargeSize},"&-gap-col-small":{columnGap:t.spaceGapSmallSize},"&-gap-col-middle":{columnGap:t.spaceGapMiddleSize},"&-gap-col-large":{columnGap:t.spaceGapLargeSize}}}},mx=jc("Space",t=>{const e=fi(t,{spaceGapSmallSize:t.paddingXS,spaceGapMiddleSize:t.padding,spaceGapLargeSize:t.paddingLG});return[Dk(e),Fk(e),Ik(e)]},()=>({}),{resetStyle:!1});var vx=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{const n=_.useContext(gp),r=_.useMemo(()=>{if(!n)return"";const{compactDirection:i,isFirstItem:s,isLastItem:l}=n,c=i==="vertical"?"-vertical-":"-";return Ze(`${t}-compact${c}item`,{[`${t}-compact${c}first-item`]:s,[`${t}-compact${c}last-item`]:l,[`${t}-compact${c}item-rtl`]:e==="rtl"})},[t,e,n]);return{compactSize:n==null?void 0:n.compactSize,compactDirection:n==null?void 0:n.compactDirection,compactItemClassnames:r}},Bk=t=>{const{children:e}=t;return _.createElement(gp.Provider,{value:null},e)},Uk=t=>{const{children:e}=t,n=vx(t,["children"]);return _.createElement(gp.Provider,{value:_.useMemo(()=>n,[n])},e)},Lk=t=>{const{getPrefixCls:e,direction:n}=_.useContext(ui),{size:r,direction:i,block:s,prefixCls:l,className:c,rootClassName:f,children:d}=t,g=vx(t,["size","direction","block","prefixCls","className","rootClassName","children"]),m=px(C=>r??C),v=e("space-compact",l),[S,E]=mx(v),w=Ze(v,E,{[`${v}-rtl`]:n==="rtl",[`${v}-block`]:s,[`${v}-vertical`]:i==="vertical"},c,f),b=_.useContext(gp),A=Ho(d),T=_.useMemo(()=>A.map((C,M)=>{const x=(C==null?void 0:C.key)||`${v}-item-${M}`;return _.createElement(Uk,{key:x,compactSize:m,compactDirection:i,isFirstItem:M===0&&(!b||(b==null?void 0:b.isFirstItem)),isLastItem:M===A.length-1&&(!b||(b==null?void 0:b.isLastItem))},C)}),[r,A,b]);return A.length===0?null:S(_.createElement("div",Object.assign({className:w},g),T))},zk=t=>({animationDuration:t,animationFillMode:"both"}),$k=t=>({animationDuration:t,animationFillMode:"both"}),gb=function(t,e,n,r){const s=(arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1)?"&":"";return{[` + ${s}${t}-enter, + ${s}${t}-appear + `]:Object.assign(Object.assign({},zk(r)),{animationPlayState:"paused"}),[`${s}${t}-leave`]:Object.assign(Object.assign({},$k(r)),{animationPlayState:"paused"}),[` + ${s}${t}-enter${t}-enter-active, + ${s}${t}-appear${t}-appear-active + `]:{animationName:e,animationPlayState:"running"},[`${s}${t}-leave${t}-leave-active`]:{animationName:n,animationPlayState:"running",pointerEvents:"none"}}},Vk=new ln("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),Hk=new ln("antMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}}),jk=new ln("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),Wk=new ln("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),Xk=new ln("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),qk=new ln("antMoveRightOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),Yk=new ln("antMoveUpIn",{"0%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),Kk=new ln("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}}),Zk={"move-up":{inKeyframes:Yk,outKeyframes:Kk},"move-down":{inKeyframes:Vk,outKeyframes:Hk},"move-left":{inKeyframes:jk,outKeyframes:Wk},"move-right":{inKeyframes:Xk,outKeyframes:qk}},VT=(t,e)=>{const{antCls:n}=t,r=`${n}-${e}`,{inKeyframes:i,outKeyframes:s}=Zk[e];return[gb(r,i,s,t.motionDurationMid),{[` + ${r}-enter, + ${r}-appear + `]:{opacity:0,animationTimingFunction:t.motionEaseOutCirc},[`${r}-leave`]:{animationTimingFunction:t.motionEaseInOutCirc}}]},_x=new ln("antSlideUpIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1}}),yx=new ln("antSlideUpOut",{"0%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}}),bx=new ln("antSlideDownIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1}}),Sx=new ln("antSlideDownOut",{"0%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0}}),Qk=new ln("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),Gk=new ln("antSlideLeftOut",{"0%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0}}),Jk=new ln("antSlideRightIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1}}),eB=new ln("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}}),tB={"slide-up":{inKeyframes:_x,outKeyframes:yx},"slide-down":{inKeyframes:bx,outKeyframes:Sx},"slide-left":{inKeyframes:Qk,outKeyframes:Gk},"slide-right":{inKeyframes:Jk,outKeyframes:eB}},HT=(t,e)=>{const{antCls:n}=t,r=`${n}-${e}`,{inKeyframes:i,outKeyframes:s}=tB[e];return[gb(r,i,s,t.motionDurationMid),{[` + ${r}-enter, + ${r}-appear + `]:{transform:"scale(0)",transformOrigin:"0% 0%",opacity:0,animationTimingFunction:t.motionEaseOutQuint,"&-prepare":{transform:"scale(1)"}},[`${r}-leave`]:{animationTimingFunction:t.motionEaseInQuint}}]},nB=new ln("antZoomIn",{"0%":{transform:"scale(0.2)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),rB=new ln("antZoomOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.2)",opacity:0}}),jT=new ln("antZoomBigIn",{"0%":{transform:"scale(0.8)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),WT=new ln("antZoomBigOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.8)",opacity:0}}),iB=new ln("antZoomUpIn",{"0%":{transform:"scale(0.8)",transformOrigin:"50% 0%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"50% 0%"}}),sB=new ln("antZoomUpOut",{"0%":{transform:"scale(1)",transformOrigin:"50% 0%"},"100%":{transform:"scale(0.8)",transformOrigin:"50% 0%",opacity:0}}),aB=new ln("antZoomLeftIn",{"0%":{transform:"scale(0.8)",transformOrigin:"0% 50%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"0% 50%"}}),oB=new ln("antZoomLeftOut",{"0%":{transform:"scale(1)",transformOrigin:"0% 50%"},"100%":{transform:"scale(0.8)",transformOrigin:"0% 50%",opacity:0}}),lB=new ln("antZoomRightIn",{"0%":{transform:"scale(0.8)",transformOrigin:"100% 50%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"100% 50%"}}),cB=new ln("antZoomRightOut",{"0%":{transform:"scale(1)",transformOrigin:"100% 50%"},"100%":{transform:"scale(0.8)",transformOrigin:"100% 50%",opacity:0}}),uB=new ln("antZoomDownIn",{"0%":{transform:"scale(0.8)",transformOrigin:"50% 100%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"50% 100%"}}),fB=new ln("antZoomDownOut",{"0%":{transform:"scale(1)",transformOrigin:"50% 100%"},"100%":{transform:"scale(0.8)",transformOrigin:"50% 100%",opacity:0}}),dB={zoom:{inKeyframes:nB,outKeyframes:rB},"zoom-big":{inKeyframes:jT,outKeyframes:WT},"zoom-big-fast":{inKeyframes:jT,outKeyframes:WT},"zoom-left":{inKeyframes:aB,outKeyframes:oB},"zoom-right":{inKeyframes:lB,outKeyframes:cB},"zoom-up":{inKeyframes:iB,outKeyframes:sB},"zoom-down":{inKeyframes:uB,outKeyframes:fB}},hB=(t,e)=>{const{antCls:n}=t,r=`${n}-${e}`,{inKeyframes:i,outKeyframes:s}=dB[e];return[gb(r,i,s,t.motionDurationFast),{[` + ${r}-enter, + ${r}-appear + `]:{transform:"scale(0)",opacity:0,animationTimingFunction:t.motionEaseOutCirc,"&-prepare":{transform:"none"}},[`${r}-leave`]:{animationTimingFunction:t.motionEaseInOutCirc}}]};function gB(t,e,n){const{focusElCls:r,focus:i,borderElCls:s}=n,l=s?"> *":"",c=["hover",i?"focus":null,"active"].filter(Boolean).map(f=>`&:${f} ${l}`).join(",");return{[`&-item:not(${e}-last-item)`]:{marginInlineEnd:t.calc(t.lineWidth).mul(-1).equal()},"&-item":Object.assign(Object.assign({[c]:{zIndex:2}},r?{[`&${r}`]:{zIndex:2}}:{}),{[`&[disabled] ${l}`]:{zIndex:0}})}}function pB(t,e,n){const{borderElCls:r}=n,i=r?`> ${r}`:"";return{[`&-item:not(${e}-first-item):not(${e}-last-item) ${i}`]:{borderRadius:0},[`&-item:not(${e}-last-item)${e}-first-item`]:{[`& ${i}, &${t}-sm ${i}, &${t}-lg ${i}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&-item:not(${e}-first-item)${e}-last-item`]:{[`& ${i}, &${t}-sm ${i}, &${t}-lg ${i}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}}function mB(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{focus:!0};const{componentCls:n}=t,r=`${n}-compact`;return{[r]:Object.assign(Object.assign({},gB(t,r,e)),pB(n,r,e))}}var wx=_.createContext(null),XT=[];function vB(t,e){var n=_.useState(function(){if(!Qr())return null;var E=document.createElement("div");return E}),r=de(n,1),i=r[0],s=_.useRef(!1),l=_.useContext(wx),c=_.useState(XT),f=de(c,2),d=f[0],g=f[1],m=l||(s.current?void 0:function(E){g(function(w){var b=[E].concat(ze(w));return b})});function v(){i.parentElement||document.body.appendChild(i),s.current=!0}function S(){var E;(E=i.parentElement)===null||E===void 0||E.removeChild(i),s.current=!1}return Dn(function(){return t?l?l(v):v():S(),S},[t]),Dn(function(){d.length&&(d.forEach(function(E){return E()}),g(XT))},[d]),[i,m]}function _B(t){var e="rc-scrollbar-measure-".concat(Math.random().toString(36).substring(7)),n=document.createElement("div");n.id=e;var r=n.style;r.position="absolute",r.left="0",r.top="0",r.width="100px",r.height="100px",r.overflow="scroll";var i,s;if(t){var l=getComputedStyle(t);r.scrollbarColor=l.scrollbarColor,r.scrollbarWidth=l.scrollbarWidth;var c=getComputedStyle(t,"::-webkit-scrollbar"),f=parseInt(c.width,10),d=parseInt(c.height,10);try{var g=f?"width: ".concat(c.width,";"):"",m=d?"height: ".concat(c.height,";"):"";js(` +#`.concat(e,`::-webkit-scrollbar { +`).concat(g,` +`).concat(m,` +}`),e)}catch(E){console.error(E),i=f,s=d}}document.body.appendChild(n);var v=t&&i&&!isNaN(i)?i:n.offsetWidth-n.clientWidth,S=t&&s&&!isNaN(s)?s:n.offsetHeight-n.clientHeight;return document.body.removeChild(n),Tf(e),{width:v,height:S}}function yB(t){return typeof document>"u"||!t||!(t instanceof Element)?{width:0,height:0}:_B(t)}function bB(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}var SB="rc-util-locker-".concat(Date.now()),qT=0;function wB(t){var e=!!t,n=_.useState(function(){return qT+=1,"".concat(SB,"_").concat(qT)}),r=de(n,1),i=r[0];Dn(function(){if(e){var s=yB(document.body).width,l=bB();js(` +html body { + overflow-y: hidden; + `.concat(l?"width: calc(100% - ".concat(s,"px);"):"",` +}`),i)}else Tf(i);return function(){Tf(i)}},[e,i])}var EB=!1;function TB(t){return EB}var YT=function(e){return e===!1?!1:!Qr()||!e?null:typeof e=="string"?document.querySelector(e):typeof e=="function"?e():e},Ex=_.forwardRef(function(t,e){var n=t.open,r=t.autoLock,i=t.getContainer;t.debug;var s=t.autoDestroy,l=s===void 0?!0:s,c=t.children,f=_.useState(n),d=de(f,2),g=d[0],m=d[1],v=g||n;_.useEffect(function(){(l||n)&&m(n)},[n,l]);var S=_.useState(function(){return YT(i)}),E=de(S,2),w=E[0],b=E[1];_.useEffect(function(){var B=YT(i);b(B??null)});var A=vB(v&&!w),T=de(A,2),C=T[0],M=T[1],x=w??C;wB(r&&n&&Qr()&&(x===C||x===document.body));var N=null;if(c&&cp(c)&&e){var F=c;N=F.ref}var L=lp(N,e);if(!v||!Qr()||w===void 0)return null;var I=x===!1||TB(),V=c;return e&&(V=_.cloneElement(c,{ref:L})),_.createElement(wx.Provider,{value:M},I?V:$a.createPortal(V,x))});function AB(){var t=J({},rp);return t.useId}var KT=0,ZT=AB();const Tx=ZT?function(e){var n=ZT();return e||n}:function(e){var n=_.useState("ssr-id"),r=de(n,2),i=r[0],s=r[1];return _.useEffect(function(){var l=KT;KT+=1,s("rc_unique_".concat(l))},[]),e||i};var Eo="RC_FORM_INTERNAL_HOOKS",gn=function(){Ur(!1,"Can not find FormContext. Please make sure you wrap Field under Form.")},Mc=_.createContext({getFieldValue:gn,getFieldsValue:gn,getFieldError:gn,getFieldWarning:gn,getFieldsError:gn,isFieldsTouched:gn,isFieldTouched:gn,isFieldValidating:gn,isFieldsValidating:gn,resetFields:gn,setFields:gn,setFieldValue:gn,setFieldsValue:gn,validateFields:gn,submit:gn,getInternalHooks:function(){return gn(),{dispatch:gn,initEntityValue:gn,registerField:gn,useSubscribe:gn,setInitialValues:gn,destroyForm:gn,setCallbacks:gn,registerWatch:gn,getFields:gn,setValidateMessages:gn,setPreserve:gn,getInitialValue:gn}}}),lg=_.createContext(null);function C_(t){return t==null?[]:Array.isArray(t)?t:[t]}function CB(t){return t&&!!t._init}function R_(){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 e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}var x_=R_();function RB(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}function xB(t,e,n){if(Jy())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var i=new(t.bind.apply(t,r));return n&&Sf(i,n.prototype),i}function M_(t){var e=typeof Map=="function"?new Map:void 0;return M_=function(r){if(r===null||!RB(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(e!==void 0){if(e.has(r))return e.get(r);e.set(r,i)}function i(){return xB(r,arguments,wf(this).constructor)}return i.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Sf(i,r)},M_(t)}var MB=/%[sdj%]/g,OB=function(){};function O_(t){if(!t||!t.length)return null;var e={};return t.forEach(function(n){var r=n.field;e[r]=e[r]||[],e[r].push(n)}),e}function ci(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r=s)return c;switch(c){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 c}});return l}return t}function PB(t){return t==="string"||t==="url"||t==="hex"||t==="email"||t==="date"||t==="pattern"}function gr(t,e){return!!(t==null||e==="array"&&Array.isArray(t)&&!t.length||PB(e)&&typeof t=="string"&&!t)}function NB(t,e,n){var r=[],i=0,s=t.length;function l(c){r.push.apply(r,ze(c||[])),i++,i===s&&n(r)}t.forEach(function(c){e(c,l)})}function QT(t,e,n){var r=0,i=t.length;function s(l){if(l&&l.length){n(l);return}var c=r;r=r+1,ce.max?i.push(ci(s.messages[m].max,e.fullField,e.max)):c&&f&&(ge.max)&&i.push(ci(s.messages[m].range,e.fullField,e.min,e.max))},Ax=function(e,n,r,i,s,l){e.required&&(!r.hasOwnProperty(e.field)||gr(n,l||e.type))&&i.push(ci(s.messages.required,e.fullField))},ph;const zB=function(){if(ph)return ph;var t="[a-fA-F\\d:]",e=function(N){return N&&N.includeBoundaries?"(?:(?<=\\s|^)(?=".concat(t,")|(?<=").concat(t,")(?=\\s|$))"):""},n="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",r="[a-fA-F\\d]{1,4}",i=["(?:".concat(r,":){7}(?:").concat(r,"|:)"),"(?:".concat(r,":){6}(?:").concat(n,"|:").concat(r,"|:)"),"(?:".concat(r,":){5}(?::").concat(n,"|(?::").concat(r,"){1,2}|:)"),"(?:".concat(r,":){4}(?:(?::").concat(r,"){0,1}:").concat(n,"|(?::").concat(r,"){1,3}|:)"),"(?:".concat(r,":){3}(?:(?::").concat(r,"){0,2}:").concat(n,"|(?::").concat(r,"){1,4}|:)"),"(?:".concat(r,":){2}(?:(?::").concat(r,"){0,3}:").concat(n,"|(?::").concat(r,"){1,5}|:)"),"(?:".concat(r,":){1}(?:(?::").concat(r,"){0,4}:").concat(n,"|(?::").concat(r,"){1,6}|:)"),"(?::(?:(?::".concat(r,"){0,5}:").concat(n,"|(?::").concat(r,"){1,7}|:))")],s="(?:%[0-9a-zA-Z]{1,})?",l="(?:".concat(i.join("|"),")").concat(s),c=new RegExp("(?:^".concat(n,"$)|(?:^").concat(l,"$)")),f=new RegExp("^".concat(n,"$")),d=new RegExp("^".concat(l,"$")),g=function(N){return N&&N.exact?c:new RegExp("(?:".concat(e(N)).concat(n).concat(e(N),")|(?:").concat(e(N)).concat(l).concat(e(N),")"),"g")};g.v4=function(x){return x&&x.exact?f:new RegExp("".concat(e(x)).concat(n).concat(e(x)),"g")},g.v6=function(x){return x&&x.exact?d:new RegExp("".concat(e(x)).concat(l).concat(e(x)),"g")};var m="(?:(?:[a-z]+:)?//)",v="(?:\\S+(?::\\S*)?@)?",S=g.v4().source,E=g.v6().source,w="(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)",b="(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*",A="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))",T="(?::\\d{2,5})?",C='(?:[/?#][^\\s"]*)?',M="(?:".concat(m,"|www\\.)").concat(v,"(?:localhost|").concat(S,"|").concat(E,"|").concat(w).concat(b).concat(A,")").concat(T).concat(C);return ph=new RegExp("(?:^".concat(M,"$)"),"i"),ph};var t2={email:/^(([^<>()\[\]\\.,;:\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},Zu={integer:function(e){return Zu.number(e)&&parseInt(e,10)===e},float:function(e){return Zu.number(e)&&!Zu.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch{return!1}},date:function(e){return typeof e.getTime=="function"&&typeof e.getMonth=="function"&&typeof e.getYear=="function"&&!isNaN(e.getTime())},number:function(e){return isNaN(e)?!1:typeof e=="number"},object:function(e){return pt(e)==="object"&&!Zu.array(e)},method:function(e){return typeof e=="function"},email:function(e){return typeof e=="string"&&e.length<=320&&!!e.match(t2.email)},url:function(e){return typeof e=="string"&&e.length<=2048&&!!e.match(zB())},hex:function(e){return typeof e=="string"&&!!e.match(t2.hex)}},$B=function(e,n,r,i,s){if(e.required&&n===void 0){Ax(e,n,r,i,s);return}var l=["integer","float","array","regexp","object","method","email","number","date","url","hex"],c=e.type;l.indexOf(c)>-1?Zu[c](n)||i.push(ci(s.messages.types[c],e.fullField,e.type)):c&&pt(n)!==e.type&&i.push(ci(s.messages.types[c],e.fullField,e.type))},VB=function(e,n,r,i,s){(/^\s+$/.test(n)||n==="")&&i.push(ci(s.messages.whitespace,e.fullField))};const Ht={required:Ax,whitespace:VB,type:$B,range:LB,enum:BB,pattern:UB};var HB=function(e,n,r,i,s){var l=[],c=e.required||!e.required&&i.hasOwnProperty(e.field);if(c){if(gr(n)&&!e.required)return r();Ht.required(e,n,i,l,s)}r(l)},jB=function(e,n,r,i,s){var l=[],c=e.required||!e.required&&i.hasOwnProperty(e.field);if(c){if(n==null&&!e.required)return r();Ht.required(e,n,i,l,s,"array"),n!=null&&(Ht.type(e,n,i,l,s),Ht.range(e,n,i,l,s))}r(l)},WB=function(e,n,r,i,s){var l=[],c=e.required||!e.required&&i.hasOwnProperty(e.field);if(c){if(gr(n)&&!e.required)return r();Ht.required(e,n,i,l,s),n!==void 0&&Ht.type(e,n,i,l,s)}r(l)},XB=function(e,n,r,i,s){var l=[],c=e.required||!e.required&&i.hasOwnProperty(e.field);if(c){if(gr(n,"date")&&!e.required)return r();if(Ht.required(e,n,i,l,s),!gr(n,"date")){var f;n instanceof Date?f=n:f=new Date(n),Ht.type(e,f,i,l,s),f&&Ht.range(e,f.getTime(),i,l,s)}}r(l)},qB="enum",YB=function(e,n,r,i,s){var l=[],c=e.required||!e.required&&i.hasOwnProperty(e.field);if(c){if(gr(n)&&!e.required)return r();Ht.required(e,n,i,l,s),n!==void 0&&Ht[qB](e,n,i,l,s)}r(l)},KB=function(e,n,r,i,s){var l=[],c=e.required||!e.required&&i.hasOwnProperty(e.field);if(c){if(gr(n)&&!e.required)return r();Ht.required(e,n,i,l,s),n!==void 0&&(Ht.type(e,n,i,l,s),Ht.range(e,n,i,l,s))}r(l)},ZB=function(e,n,r,i,s){var l=[],c=e.required||!e.required&&i.hasOwnProperty(e.field);if(c){if(gr(n)&&!e.required)return r();Ht.required(e,n,i,l,s),n!==void 0&&(Ht.type(e,n,i,l,s),Ht.range(e,n,i,l,s))}r(l)},QB=function(e,n,r,i,s){var l=[],c=e.required||!e.required&&i.hasOwnProperty(e.field);if(c){if(gr(n)&&!e.required)return r();Ht.required(e,n,i,l,s),n!==void 0&&Ht.type(e,n,i,l,s)}r(l)},GB=function(e,n,r,i,s){var l=[],c=e.required||!e.required&&i.hasOwnProperty(e.field);if(c){if(n===""&&(n=void 0),gr(n)&&!e.required)return r();Ht.required(e,n,i,l,s),n!==void 0&&(Ht.type(e,n,i,l,s),Ht.range(e,n,i,l,s))}r(l)},JB=function(e,n,r,i,s){var l=[],c=e.required||!e.required&&i.hasOwnProperty(e.field);if(c){if(gr(n)&&!e.required)return r();Ht.required(e,n,i,l,s),n!==void 0&&Ht.type(e,n,i,l,s)}r(l)},eU=function(e,n,r,i,s){var l=[],c=e.required||!e.required&&i.hasOwnProperty(e.field);if(c){if(gr(n,"string")&&!e.required)return r();Ht.required(e,n,i,l,s),gr(n,"string")||Ht.pattern(e,n,i,l,s)}r(l)},tU=function(e,n,r,i,s){var l=[],c=e.required||!e.required&&i.hasOwnProperty(e.field);if(c){if(gr(n)&&!e.required)return r();Ht.required(e,n,i,l,s),gr(n)||Ht.type(e,n,i,l,s)}r(l)},nU=function(e,n,r,i,s){var l=[],c=Array.isArray(n)?"array":pt(n);Ht.required(e,n,i,l,s,c),r(l)},rU=function(e,n,r,i,s){var l=[],c=e.required||!e.required&&i.hasOwnProperty(e.field);if(c){if(gr(n,"string")&&!e.required)return r();Ht.required(e,n,i,l,s,"string"),gr(n,"string")||(Ht.type(e,n,i,l,s),Ht.range(e,n,i,l,s),Ht.pattern(e,n,i,l,s),e.whitespace===!0&&Ht.whitespace(e,n,i,l,s))}r(l)},qv=function(e,n,r,i,s){var l=e.type,c=[],f=e.required||!e.required&&i.hasOwnProperty(e.field);if(f){if(gr(n,l)&&!e.required)return r();Ht.required(e,n,i,c,s,l),gr(n,l)||Ht.type(e,n,i,c,s)}r(c)};const of={string:rU,method:QB,number:GB,boolean:WB,regexp:tU,integer:ZB,float:KB,array:jB,object:JB,enum:YB,pattern:eU,date:XB,url:qv,hex:qv,email:qv,required:nU,any:HB};var Kf=function(){function t(e){Or(this,t),K(this,"rules",null),K(this,"_messages",x_),this.define(e)}return Pr(t,[{key:"define",value:function(n){var r=this;if(!n)throw new Error("Cannot configure a schema with no rules");if(pt(n)!=="object"||Array.isArray(n))throw new Error("Rules must be an object");this.rules={},Object.keys(n).forEach(function(i){var s=n[i];r.rules[i]=Array.isArray(s)?s:[s]})}},{key:"messages",value:function(n){return n&&(this._messages=e2(R_(),n)),this._messages}},{key:"validate",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},l=n,c=i,f=s;if(typeof c=="function"&&(f=c,c={}),!this.rules||Object.keys(this.rules).length===0)return f&&f(null,l),Promise.resolve(l);function d(E){var w=[],b={};function A(C){if(Array.isArray(C)){var M;w=(M=w).concat.apply(M,ze(C))}else w.push(C)}for(var T=0;T0&&arguments[0]!==void 0?arguments[0]:[],L=Array.isArray(F)?F:[F];!c.suppressWarning&&L.length&&t.warning("async-validator:",L),L.length&&b.message!==void 0&&(L=[].concat(b.message));var I=L.map(JT(b,l));if(c.first&&I.length)return S[b.field]=1,w(I);if(!A)w(I);else{if(b.required&&!E.value)return b.message!==void 0?I=[].concat(b.message).map(JT(b,l)):c.error&&(I=[c.error(b,ci(c.messages.required,b.field))]),w(I);var V={};b.defaultField&&Object.keys(E.value).map(function(X){V[X]=b.defaultField}),V=J(J({},V),E.rule.fields);var B={};Object.keys(V).forEach(function(X){var Y=V[X],ae=Array.isArray(Y)?Y:[Y];B[X]=ae.map(T.bind(null,X))});var j=new t(B);j.messages(c.messages),E.rule.options&&(E.rule.options.messages=c.messages,E.rule.options.error=c.error),j.validate(E.value,E.rule.options||c,function(X){var Y=[];I&&I.length&&Y.push.apply(Y,ze(I)),X&&X.length&&Y.push.apply(Y,ze(X)),w(Y.length?Y:null)})}}var M;if(b.asyncValidator)M=b.asyncValidator(b,E.value,C,E.source,c);else if(b.validator){try{M=b.validator(b,E.value,C,E.source,c)}catch(F){var x,N;(x=(N=console).error)===null||x===void 0||x.call(N,F),c.suppressValidatorError||setTimeout(function(){throw F},0),C(F.message)}M===!0?C():M===!1?C(typeof b.message=="function"?b.message(b.fullField||b.field):b.message||"".concat(b.fullField||b.field," fails")):M instanceof Array?C(M):M instanceof Error&&C(M.message)}M&&M.then&&M.then(function(){return C()},function(F){return C(F)})},function(E){d(E)},l)}},{key:"getType",value:function(n){if(n.type===void 0&&n.pattern instanceof RegExp&&(n.type="pattern"),typeof n.validator!="function"&&n.type&&!of.hasOwnProperty(n.type))throw new Error(ci("Unknown rule type %s",n.type));return n.type||"string"}},{key:"getValidationMethod",value:function(n){if(typeof n.validator=="function")return n.validator;var r=Object.keys(n),i=r.indexOf("message");return i!==-1&&r.splice(i,1),r.length===1&&r[0]==="required"?of.required:of[this.getType(n)]||void 0}}]),t}();K(Kf,"register",function(e,n){if(typeof n!="function")throw new Error("Cannot register a validator by type, validator is not a function");of[e]=n});K(Kf,"warning",OB);K(Kf,"messages",x_);K(Kf,"validators",of);var ai="'${name}' is not a valid ${type}",Cx={default:"Validation error on field '${name}'",required:"'${name}' is required",enum:"'${name}' must be one of [${enum}]",whitespace:"'${name}' cannot be empty",date:{format:"'${name}' is invalid for format date",parse:"'${name}' could not be parsed as date",invalid:"'${name}' is invalid date"},types:{string:ai,method:ai,array:ai,object:ai,number:ai,date:ai,boolean:ai,integer:ai,float:ai,regexp:ai,email:ai,url:ai,hex:ai},string:{len:"'${name}' must be exactly ${len} characters",min:"'${name}' must be at least ${min} characters",max:"'${name}' cannot be longer than ${max} characters",range:"'${name}' must be between ${min} and ${max} characters"},number:{len:"'${name}' must equal ${len}",min:"'${name}' cannot be less than ${min}",max:"'${name}' cannot be greater than ${max}",range:"'${name}' must be between ${min} and ${max}"},array:{len:"'${name}' must be exactly ${len} in length",min:"'${name}' cannot be less than ${min} in length",max:"'${name}' cannot be greater than ${max} in length",range:"'${name}' must be between ${min} and ${max} in length"},pattern:{mismatch:"'${name}' does not match pattern ${pattern}"}},n2=Kf;function iU(t,e){return t.replace(/\\?\$\{\w+\}/g,function(n){if(n.startsWith("\\"))return n.slice(1);var r=n.slice(2,-1);return e[r]})}var r2="CODE_LOGIC_ERROR";function P_(t,e,n,r,i){return N_.apply(this,arguments)}function N_(){return N_=Yf(ns().mark(function t(e,n,r,i,s){var l,c,f,d,g,m,v,S,E;return ns().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return l=J({},r),delete l.ruleIndex,n2.warning=function(){},l.validator&&(c=l.validator,l.validator=function(){try{return c.apply(void 0,arguments)}catch(A){return console.error(A),Promise.reject(r2)}}),f=null,l&&l.type==="array"&&l.defaultField&&(f=l.defaultField,delete l.defaultField),d=new n2(K({},e,[l])),g=ql(Cx,i.validateMessages),d.messages(g),m=[],b.prev=10,b.next=13,Promise.resolve(d.validate(K({},e,n),J({},i)));case 13:b.next=18;break;case 15:b.prev=15,b.t0=b.catch(10),b.t0.errors&&(m=b.t0.errors.map(function(A,T){var C=A.message,M=C===r2?g.default:C;return _.isValidElement(M)?_.cloneElement(M,{key:"error_".concat(T)}):M}));case 18:if(!(!m.length&&f)){b.next=23;break}return b.next=21,Promise.all(n.map(function(A,T){return P_("".concat(e,".").concat(T),A,f,i,s)}));case 21:return v=b.sent,b.abrupt("return",v.reduce(function(A,T){return[].concat(ze(A),ze(T))},[]));case 23:return S=J(J({},r),{},{name:e,enum:(r.enum||[]).join(", ")},s),E=m.map(function(A){return typeof A=="string"?iU(A,S):A}),b.abrupt("return",E);case 26:case"end":return b.stop()}},t,null,[[10,15]])})),N_.apply(this,arguments)}function sU(t,e,n,r,i,s){var l=t.join("."),c=n.map(function(g,m){var v=g.validator,S=J(J({},g),{},{ruleIndex:m});return v&&(S.validator=function(E,w,b){var A=!1,T=function(){for(var x=arguments.length,N=new Array(x),F=0;F2&&arguments[2]!==void 0?arguments[2]:!1;return t&&t.some(function(r){return Rx(e,r,n)})}function Rx(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return!t||!e||!n&&t.length!==e.length?!1:e.every(function(r,i){return t[i]===r})}function lU(t,e){if(t===e)return!0;if(!t&&e||t&&!e||!t||!e||pt(t)!=="object"||pt(e)!=="object")return!1;var n=Object.keys(t),r=Object.keys(e),i=new Set([].concat(n,r));return ze(i).every(function(s){var l=t[s],c=e[s];return typeof l=="function"&&typeof c=="function"?!0:l===c})}function cU(t){var e=arguments.length<=1?void 0:arguments[1];return e&&e.target&&pt(e.target)==="object"&&t in e.target?e.target[t]:e}function s2(t,e,n){var r=t.length;if(e<0||e>=r||n<0||n>=r)return t;var i=t[e],s=e-n;return s>0?[].concat(ze(t.slice(0,n)),[i],ze(t.slice(n,e)),ze(t.slice(e+1,r))):s<0?[].concat(ze(t.slice(0,e)),ze(t.slice(e+1,n+1)),[i],ze(t.slice(n+1,r))):t}var uU=["name"],Ci=[];function Yv(t,e,n,r,i,s){return typeof t=="function"?t(e,n,"source"in s?{source:s.source}:{}):r!==i}var pb=function(t){Zo(n,t);var e=Qo(n);function n(r){var i;if(Or(this,n),i=e.call(this,r),K(Nt(i),"state",{resetCount:0}),K(Nt(i),"cancelRegisterFunc",null),K(Nt(i),"mounted",!1),K(Nt(i),"touched",!1),K(Nt(i),"dirty",!1),K(Nt(i),"validatePromise",void 0),K(Nt(i),"prevValidating",void 0),K(Nt(i),"errors",Ci),K(Nt(i),"warnings",Ci),K(Nt(i),"cancelRegister",function(){var f=i.props,d=f.preserve,g=f.isListField,m=f.name;i.cancelRegisterFunc&&i.cancelRegisterFunc(g,d,Jn(m)),i.cancelRegisterFunc=null}),K(Nt(i),"getNamePath",function(){var f=i.props,d=f.name,g=f.fieldContext,m=g.prefixName,v=m===void 0?[]:m;return d!==void 0?[].concat(ze(v),ze(d)):[]}),K(Nt(i),"getRules",function(){var f=i.props,d=f.rules,g=d===void 0?[]:d,m=f.fieldContext;return g.map(function(v){return typeof v=="function"?v(m):v})}),K(Nt(i),"refresh",function(){i.mounted&&i.setState(function(f){var d=f.resetCount;return{resetCount:d+1}})}),K(Nt(i),"metaCache",null),K(Nt(i),"triggerMetaEvent",function(f){var d=i.props.onMetaChange;if(d){var g=J(J({},i.getMeta()),{},{destroy:f});ng(i.metaCache,g)||d(g),i.metaCache=g}else i.metaCache=null}),K(Nt(i),"onStoreChange",function(f,d,g){var m=i.props,v=m.shouldUpdate,S=m.dependencies,E=S===void 0?[]:S,w=m.onReset,b=g.store,A=i.getNamePath(),T=i.getValue(f),C=i.getValue(b),M=d&&ic(d,A);switch(g.type==="valueUpdate"&&g.source==="external"&&!ng(T,C)&&(i.touched=!0,i.dirty=!0,i.validatePromise=null,i.errors=Ci,i.warnings=Ci,i.triggerMetaEvent()),g.type){case"reset":if(!d||M){i.touched=!1,i.dirty=!1,i.validatePromise=void 0,i.errors=Ci,i.warnings=Ci,i.triggerMetaEvent(),w==null||w(),i.refresh();return}break;case"remove":{if(v&&Yv(v,f,b,T,C,g)){i.reRender();return}break}case"setField":{var x=g.data;if(M){"touched"in x&&(i.touched=x.touched),"validating"in x&&!("originRCField"in x)&&(i.validatePromise=x.validating?Promise.resolve([]):null),"errors"in x&&(i.errors=x.errors||Ci),"warnings"in x&&(i.warnings=x.warnings||Ci),i.dirty=!0,i.triggerMetaEvent(),i.reRender();return}else if("value"in x&&ic(d,A,!0)){i.reRender();return}if(v&&!A.length&&Yv(v,f,b,T,C,g)){i.reRender();return}break}case"dependenciesUpdate":{var N=E.map(Jn);if(N.some(function(F){return ic(g.relatedFields,F)})){i.reRender();return}break}default:if(M||(!E.length||A.length||v)&&Yv(v,f,b,T,C,g)){i.reRender();return}break}v===!0&&i.reRender()}),K(Nt(i),"validateRules",function(f){var d=i.getNamePath(),g=i.getValue(),m=f||{},v=m.triggerName,S=m.validateOnly,E=S===void 0?!1:S,w=Promise.resolve().then(Yf(ns().mark(function b(){var A,T,C,M,x,N,F;return ns().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:if(i.mounted){I.next=2;break}return I.abrupt("return",[]);case 2:if(A=i.props,T=A.validateFirst,C=T===void 0?!1:T,M=A.messageVariables,x=A.validateDebounce,N=i.getRules(),v&&(N=N.filter(function(V){return V}).filter(function(V){var B=V.validateTrigger;if(!B)return!0;var j=C_(B);return j.includes(v)})),!(x&&v)){I.next=10;break}return I.next=8,new Promise(function(V){setTimeout(V,x)});case 8:if(i.validatePromise===w){I.next=10;break}return I.abrupt("return",[]);case 10:return F=sU(d,g,N,f,C,M),F.catch(function(V){return V}).then(function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ci;if(i.validatePromise===w){var B;i.validatePromise=null;var j=[],X=[];(B=V.forEach)===null||B===void 0||B.call(V,function(Y){var ae=Y.rule.warningOnly,U=Y.errors,z=U===void 0?Ci:U;ae?X.push.apply(X,ze(z)):j.push.apply(j,ze(z))}),i.errors=j,i.warnings=X,i.triggerMetaEvent(),i.reRender()}}),I.abrupt("return",F);case 13:case"end":return I.stop()}},b)})));return E||(i.validatePromise=w,i.dirty=!0,i.errors=Ci,i.warnings=Ci,i.triggerMetaEvent(),i.reRender()),w}),K(Nt(i),"isFieldValidating",function(){return!!i.validatePromise}),K(Nt(i),"isFieldTouched",function(){return i.touched}),K(Nt(i),"isFieldDirty",function(){if(i.dirty||i.props.initialValue!==void 0)return!0;var f=i.props.fieldContext,d=f.getInternalHooks(Eo),g=d.getInitialValue;return g(i.getNamePath())!==void 0}),K(Nt(i),"getErrors",function(){return i.errors}),K(Nt(i),"getWarnings",function(){return i.warnings}),K(Nt(i),"isListField",function(){return i.props.isListField}),K(Nt(i),"isList",function(){return i.props.isList}),K(Nt(i),"isPreserve",function(){return i.props.preserve}),K(Nt(i),"getMeta",function(){i.prevValidating=i.isFieldValidating();var f={touched:i.isFieldTouched(),validating:i.prevValidating,errors:i.errors,warnings:i.warnings,name:i.getNamePath(),validated:i.validatePromise===null};return f}),K(Nt(i),"getOnlyChild",function(f){if(typeof f=="function"){var d=i.getMeta();return J(J({},i.getOnlyChild(f(i.getControlled(),d,i.props.fieldContext))),{},{isFunction:!0})}var g=Ho(f);return g.length!==1||!_.isValidElement(g[0])?{child:g,isFunction:!1}:{child:g[0],isFunction:!1}}),K(Nt(i),"getValue",function(f){var d=i.props.fieldContext.getFieldsValue,g=i.getNamePath();return _s(f||d(!0),g)}),K(Nt(i),"getControlled",function(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},d=i.props,g=d.name,m=d.trigger,v=d.validateTrigger,S=d.getValueFromEvent,E=d.normalize,w=d.valuePropName,b=d.getValueProps,A=d.fieldContext,T=v!==void 0?v:A.validateTrigger,C=i.getNamePath(),M=A.getInternalHooks,x=A.getFieldsValue,N=M(Eo),F=N.dispatch,L=i.getValue(),I=b||function(Y){return K({},w,Y)},V=f[m],B=g!==void 0?I(L):{},j=J(J({},f),B);j[m]=function(){i.touched=!0,i.dirty=!0,i.triggerMetaEvent();for(var Y,ae=arguments.length,U=new Array(ae),z=0;z=0&&V<=B.length?(g.keys=[].concat(ze(g.keys.slice(0,V)),[g.id],ze(g.keys.slice(V))),C([].concat(ze(B.slice(0,V)),[I],ze(B.slice(V))))):(g.keys=[].concat(ze(g.keys),[g.id]),C([].concat(ze(B),[I]))),g.id+=1},remove:function(I){var V=x(),B=new Set(Array.isArray(I)?I:[I]);B.size<=0||(g.keys=g.keys.filter(function(j,X){return!B.has(X)}),C(V.filter(function(j,X){return!B.has(X)})))},move:function(I,V){if(I!==V){var B=x();I<0||I>=B.length||V<0||V>=B.length||(g.keys=s2(g.keys,I,V),C(s2(B,I,V)))}}},F=T||[];return Array.isArray(F)||(F=[]),r(F.map(function(L,I){var V=g.keys[I];return V===void 0&&(g.keys[I]=g.id,V=g.keys[I],g.id+=1),{name:I,key:V,isListField:!0}}),N,b)})))}function dU(t){var e=!1,n=t.length,r=[];return t.length?new Promise(function(i,s){t.forEach(function(l,c){l.catch(function(f){return e=!0,f}).then(function(f){n-=1,r[c]=f,!(n>0)&&(e&&s(r),i(r))})})}):Promise.resolve([])}var Mx="__@field_split__";function Kv(t){return t.map(function(e){return"".concat(pt(e),":").concat(e)}).join(Mx)}var Ll=function(){function t(){Or(this,t),K(this,"kvs",new Map)}return Pr(t,[{key:"set",value:function(n,r){this.kvs.set(Kv(n),r)}},{key:"get",value:function(n){return this.kvs.get(Kv(n))}},{key:"update",value:function(n,r){var i=this.get(n),s=r(i);s?this.set(n,s):this.delete(n)}},{key:"delete",value:function(n){this.kvs.delete(Kv(n))}},{key:"map",value:function(n){return ze(this.kvs.entries()).map(function(r){var i=de(r,2),s=i[0],l=i[1],c=s.split(Mx);return n({key:c.map(function(f){var d=f.match(/^([^:]*):(.*)$/),g=de(d,3),m=g[1],v=g[2];return m==="number"?Number(v):v}),value:l})})}},{key:"toJSON",value:function(){var n={};return this.map(function(r){var i=r.key,s=r.value;return n[i.join(".")]=s,null}),n}}]),t}(),hU=["name"],gU=Pr(function t(e){var n=this;Or(this,t),K(this,"formHooked",!1),K(this,"forceRootUpdate",void 0),K(this,"subscribable",!0),K(this,"store",{}),K(this,"fieldEntities",[]),K(this,"initialValues",{}),K(this,"callbacks",{}),K(this,"validateMessages",null),K(this,"preserve",null),K(this,"lastValidatePromise",null),K(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}}),K(this,"getInternalHooks",function(r){return r===Eo?(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}):(Ur(!1,"`getInternalHooks` is internal usage. Should not call directly."),null)}),K(this,"useSubscribe",function(r){n.subscribable=r}),K(this,"prevWithoutPreserves",null),K(this,"setInitialValues",function(r,i){if(n.initialValues=r||{},i){var s,l=ql(r,n.store);(s=n.prevWithoutPreserves)===null||s===void 0||s.map(function(c){var f=c.key;l=qi(l,f,_s(r,f))}),n.prevWithoutPreserves=null,n.updateStore(l)}}),K(this,"destroyForm",function(r){if(r)n.updateStore({});else{var i=new Ll;n.getFieldEntities(!0).forEach(function(s){n.isMergedPreserve(s.isPreserve())||i.set(s.getNamePath(),!0)}),n.prevWithoutPreserves=i}}),K(this,"getInitialValue",function(r){var i=_s(n.initialValues,r);return r.length?ql(i):i}),K(this,"setCallbacks",function(r){n.callbacks=r}),K(this,"setValidateMessages",function(r){n.validateMessages=r}),K(this,"setPreserve",function(r){n.preserve=r}),K(this,"watchList",[]),K(this,"registerWatch",function(r){return n.watchList.push(r),function(){n.watchList=n.watchList.filter(function(i){return i!==r})}}),K(this,"notifyWatch",function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(n.watchList.length){var i=n.getFieldsValue(),s=n.getFieldsValue(!0);n.watchList.forEach(function(l){l(i,s,r)})}}),K(this,"timeoutId",null),K(this,"warningUnhooked",function(){}),K(this,"updateStore",function(r){n.store=r}),K(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}),K(this,"getFieldsMap",function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=new Ll;return n.getFieldEntities(r).forEach(function(s){var l=s.getNamePath();i.set(l,s)}),i}),K(this,"getFieldEntitiesForNamePathList",function(r){if(!r)return n.getFieldEntities(!0);var i=n.getFieldsMap(!0);return r.map(function(s){var l=Jn(s);return i.get(l)||{INVALIDATE_NAME_PATH:Jn(s)}})}),K(this,"getFieldsValue",function(r,i){n.warningUnhooked();var s,l,c;if(r===!0||Array.isArray(r)?(s=r,l=i):r&&pt(r)==="object"&&(c=r.strict,l=r.filter),s===!0&&!l)return n.store;var f=n.getFieldEntitiesForNamePathList(Array.isArray(s)?s:null),d=[];return f.forEach(function(g){var m,v,S="INVALIDATE_NAME_PATH"in g?g.INVALIDATE_NAME_PATH:g.getNamePath();if(c){var E,w;if((E=(w=g).isList)!==null&&E!==void 0&&E.call(w))return}else if(!s&&(m=(v=g).isListField)!==null&&m!==void 0&&m.call(v))return;if(!l)d.push(S);else{var b="getMeta"in g?g.getMeta():null;l(b)&&d.push(S)}}),i2(n.store,d.map(Jn))}),K(this,"getFieldValue",function(r){n.warningUnhooked();var i=Jn(r);return _s(n.store,i)}),K(this,"getFieldsError",function(r){n.warningUnhooked();var i=n.getFieldEntitiesForNamePathList(r);return i.map(function(s,l){return s&&!("INVALIDATE_NAME_PATH"in s)?{name:s.getNamePath(),errors:s.getErrors(),warnings:s.getWarnings()}:{name:Jn(r[l]),errors:[],warnings:[]}})}),K(this,"getFieldError",function(r){n.warningUnhooked();var i=Jn(r),s=n.getFieldsError([i])[0];return s.errors}),K(this,"getFieldWarning",function(r){n.warningUnhooked();var i=Jn(r),s=n.getFieldsError([i])[0];return s.warnings}),K(this,"isFieldsTouched",function(){n.warningUnhooked();for(var r=arguments.length,i=new Array(r),s=0;s0&&arguments[0]!==void 0?arguments[0]:{},i=new Ll,s=n.getFieldEntities(!0);s.forEach(function(f){var d=f.props.initialValue,g=f.getNamePath();if(d!==void 0){var m=i.get(g)||new Set;m.add({entity:f,value:d}),i.set(g,m)}});var l=function(d){d.forEach(function(g){var m=g.props.initialValue;if(m!==void 0){var v=g.getNamePath(),S=n.getInitialValue(v);if(S!==void 0)Ur(!1,"Form already set 'initialValues' with path '".concat(v.join("."),"'. Field can not overwrite it."));else{var E=i.get(v);if(E&&E.size>1)Ur(!1,"Multiple Field with path '".concat(v.join("."),"' set 'initialValue'. Can not decide which one to pick."));else if(E){var w=n.getFieldValue(v),b=g.isListField();!b&&(!r.skipExist||w===void 0)&&n.updateStore(qi(n.store,v,ze(E)[0].value))}}}})},c;r.entities?c=r.entities:r.namePathList?(c=[],r.namePathList.forEach(function(f){var d=i.get(f);if(d){var g;(g=c).push.apply(g,ze(ze(d).map(function(m){return m.entity})))}})):c=s,l(c)}),K(this,"resetFields",function(r){n.warningUnhooked();var i=n.store;if(!r){n.updateStore(ql(n.initialValues)),n.resetWithFieldInitialValue(),n.notifyObservers(i,null,{type:"reset"}),n.notifyWatch();return}var s=r.map(Jn);s.forEach(function(l){var c=n.getInitialValue(l);n.updateStore(qi(n.store,l,c))}),n.resetWithFieldInitialValue({namePathList:s}),n.notifyObservers(i,s,{type:"reset"}),n.notifyWatch(s)}),K(this,"setFields",function(r){n.warningUnhooked();var i=n.store,s=[];r.forEach(function(l){var c=l.name,f=Fn(l,hU),d=Jn(c);s.push(d),"value"in f&&n.updateStore(qi(n.store,d,f.value)),n.notifyObservers(i,[d],{type:"setField",data:l})}),n.notifyWatch(s)}),K(this,"getFields",function(){var r=n.getFieldEntities(!0),i=r.map(function(s){var l=s.getNamePath(),c=s.getMeta(),f=J(J({},c),{},{name:l,value:n.getFieldValue(l)});return Object.defineProperty(f,"originRCField",{value:!0}),f});return i}),K(this,"initEntityValue",function(r){var i=r.props.initialValue;if(i!==void 0){var s=r.getNamePath(),l=_s(n.store,s);l===void 0&&n.updateStore(qi(n.store,s,i))}}),K(this,"isMergedPreserve",function(r){var i=r!==void 0?r:n.preserve;return i??!0}),K(this,"registerField",function(r){n.fieldEntities.push(r);var i=r.getNamePath();if(n.notifyWatch([i]),r.props.initialValue!==void 0){var s=n.store;n.resetWithFieldInitialValue({entities:[r],skipExist:!0}),n.notifyObservers(s,[r.getNamePath()],{type:"valueUpdate",source:"internal"})}return function(l,c){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(n.fieldEntities=n.fieldEntities.filter(function(m){return m!==r}),!n.isMergedPreserve(c)&&(!l||f.length>1)){var d=l?void 0:n.getInitialValue(i);if(i.length&&n.getFieldValue(i)!==d&&n.fieldEntities.every(function(m){return!Rx(m.getNamePath(),i)})){var g=n.store;n.updateStore(qi(g,i,d,!0)),n.notifyObservers(g,[i],{type:"remove"}),n.triggerDependenciesUpdate(g,i)}}n.notifyWatch([i])}}),K(this,"dispatch",function(r){switch(r.type){case"updateValue":{var i=r.namePath,s=r.value;n.updateValue(i,s);break}case"validateField":{var l=r.namePath,c=r.triggerName;n.validateFields([l],{triggerName:c});break}}}),K(this,"notifyObservers",function(r,i,s){if(n.subscribable){var l=J(J({},s),{},{store:n.getFieldsValue(!0)});n.getFieldEntities().forEach(function(c){var f=c.onStoreChange;f(r,i,l)})}else n.forceRootUpdate()}),K(this,"triggerDependenciesUpdate",function(r,i){var s=n.getDependencyChildrenFields(i);return s.length&&n.validateFields(s),n.notifyObservers(r,s,{type:"dependenciesUpdate",relatedFields:[i].concat(ze(s))}),s}),K(this,"updateValue",function(r,i){var s=Jn(r),l=n.store;n.updateStore(qi(n.store,s,i)),n.notifyObservers(l,[s],{type:"valueUpdate",source:"internal"}),n.notifyWatch([s]);var c=n.triggerDependenciesUpdate(l,s),f=n.callbacks.onValuesChange;if(f){var d=i2(n.store,[s]);f(d,n.getFieldsValue())}n.triggerOnFieldsChange([s].concat(ze(c)))}),K(this,"setFieldsValue",function(r){n.warningUnhooked();var i=n.store;if(r){var s=ql(n.store,r);n.updateStore(s)}n.notifyObservers(i,null,{type:"valueUpdate",source:"external"}),n.notifyWatch()}),K(this,"setFieldValue",function(r,i){n.setFields([{name:r,value:i,errors:[],warnings:[]}])}),K(this,"getDependencyChildrenFields",function(r){var i=new Set,s=[],l=new Ll;n.getFieldEntities().forEach(function(f){var d=f.props.dependencies;(d||[]).forEach(function(g){var m=Jn(g);l.update(m,function(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Set;return v.add(f),v})})});var c=function f(d){var g=l.get(d)||new Set;g.forEach(function(m){if(!i.has(m)){i.add(m);var v=m.getNamePath();m.isFieldDirty()&&v.length&&(s.push(v),f(v))}})};return c(r),s}),K(this,"triggerOnFieldsChange",function(r,i){var s=n.callbacks.onFieldsChange;if(s){var l=n.getFields();if(i){var c=new Ll;i.forEach(function(d){var g=d.name,m=d.errors;c.set(g,m)}),l.forEach(function(d){d.errors=c.get(d.name)||d.errors})}var f=l.filter(function(d){var g=d.name;return ic(r,g)});f.length&&s(f,l)}}),K(this,"validateFields",function(r,i){n.warningUnhooked();var s,l;Array.isArray(r)||typeof r=="string"||typeof i=="string"?(s=r,l=i):l=r;var c=!!s,f=c?s.map(Jn):[],d=[],g=String(Date.now()),m=new Set,v=l||{},S=v.recursive,E=v.dirty;n.getFieldEntities(!0).forEach(function(T){if(c||f.push(T.getNamePath()),!(!T.props.rules||!T.props.rules.length)&&!(E&&!T.isFieldDirty())){var C=T.getNamePath();if(m.add(C.join(g)),!c||ic(f,C,S)){var M=T.validateRules(J({validateMessages:J(J({},Cx),n.validateMessages)},l));d.push(M.then(function(){return{name:C,errors:[],warnings:[]}}).catch(function(x){var N,F=[],L=[];return(N=x.forEach)===null||N===void 0||N.call(x,function(I){var V=I.rule.warningOnly,B=I.errors;V?L.push.apply(L,ze(B)):F.push.apply(F,ze(B))}),F.length?Promise.reject({name:C,errors:F,warnings:L}):{name:C,errors:F,warnings:L}}))}}});var w=dU(d);n.lastValidatePromise=w,w.catch(function(T){return T}).then(function(T){var C=T.map(function(M){var x=M.name;return x});n.notifyObservers(n.store,C,{type:"validateFinish"}),n.triggerOnFieldsChange(C,T)});var b=w.then(function(){return n.lastValidatePromise===w?Promise.resolve(n.getFieldsValue(f)):Promise.reject([])}).catch(function(T){var C=T.filter(function(M){return M&&M.errors.length});return Promise.reject({values:n.getFieldsValue(f),errorFields:C,outOfDate:n.lastValidatePromise!==w})});b.catch(function(T){return T});var A=f.filter(function(T){return m.has(T.join(g))});return n.triggerOnFieldsChange(A),b}),K(this,"submit",function(){n.warningUnhooked(),n.validateFields().then(function(r){var i=n.callbacks.onFinish;if(i)try{i(r)}catch(s){console.error(s)}}).catch(function(r){var i=n.callbacks.onFinishFailed;i&&i(r)})}),this.forceRootUpdate=e});function Ox(t){var e=_.useRef(),n=_.useState({}),r=de(n,2),i=r[1];if(!e.current)if(t)e.current=t;else{var s=function(){i({})},l=new gU(s);e.current=l.getForm()}return[e.current]}var F_=_.createContext({triggerFormChange:function(){},triggerFormFinish:function(){},registerForm:function(){},unregisterForm:function(){}}),pU=function(e){var n=e.validateMessages,r=e.onFormChange,i=e.onFormFinish,s=e.children,l=_.useContext(F_),c=_.useRef({});return _.createElement(F_.Provider,{value:J(J({},l),{},{validateMessages:J(J({},l.validateMessages),n),triggerFormChange:function(d,g){r&&r(d,{changedFields:g,forms:c.current}),l.triggerFormChange(d,g)},triggerFormFinish:function(d,g){i&&i(d,{values:g,forms:c.current}),l.triggerFormFinish(d,g)},registerForm:function(d,g){d&&(c.current=J(J({},c.current),{},K({},d,g))),l.registerForm(d,g)},unregisterForm:function(d){var g=J({},c.current);delete g[d],c.current=g,l.unregisterForm(d)}})},s)},mU=["name","initialValues","fields","form","preserve","children","component","validateMessages","validateTrigger","onValuesChange","onFieldsChange","onFinish","onFinishFailed","clearOnDestroy"],vU=function(e,n){var r=e.name,i=e.initialValues,s=e.fields,l=e.form,c=e.preserve,f=e.children,d=e.component,g=d===void 0?"form":d,m=e.validateMessages,v=e.validateTrigger,S=v===void 0?"onChange":v,E=e.onValuesChange,w=e.onFieldsChange,b=e.onFinish,A=e.onFinishFailed,T=e.clearOnDestroy,C=Fn(e,mU),M=_.useRef(null),x=_.useContext(F_),N=Ox(l),F=de(N,1),L=F[0],I=L.getInternalHooks(Eo),V=I.useSubscribe,B=I.setInitialValues,j=I.setCallbacks,X=I.setValidateMessages,Y=I.setPreserve,ae=I.destroyForm;_.useImperativeHandle(n,function(){return J(J({},L),{},{nativeElement:M.current})}),_.useEffect(function(){return x.registerForm(r,L),function(){x.unregisterForm(r)}},[x,L,r]),X(J(J({},x.validateMessages),m)),j({onValuesChange:E,onFieldsChange:function(q){if(x.triggerFormChange(r,q),w){for(var ce=arguments.length,fe=new Array(ce>1?ce-1:0),ye=1;ye{let{children:e,status:n,override:r}=t;const i=_.useContext(k_),s=_.useMemo(()=>{const l=Object.assign({},i);return r&&delete l.isFormItemInput,n&&(delete l.status,delete l.hasFeedback,delete l.feedbackIcon),l},[n,r,i]);return _.createElement(k_.Provider,{value:s},e)},SU=_.createContext(void 0),wU=t=>{const{space:e,form:n,children:r}=t;if(r==null)return null;let i=r;return n&&(i=Ft.createElement(bU,{override:!0,status:!0},i)),e&&(i=Ft.createElement(Bk,null,i)),i};function EU(t){return e=>_.createElement(Wc,{theme:{token:{motion:!1,zIndexPopupBase:0}}},_.createElement(t,Object.assign({},e)))}const TU=(t,e,n,r,i)=>EU(l=>{const{prefixCls:c,style:f}=l,d=_.useRef(null),[g,m]=_.useState(0),[v,S]=_.useState(0),[E,w]=xc(!1,{value:l.open}),{getPrefixCls:b}=_.useContext(ui),A=b("select",c);_.useEffect(()=>{if(w(!0),typeof ResizeObserver<"u"){const M=new ResizeObserver(N=>{const F=N[0].target;m(F.offsetHeight+8),S(F.offsetWidth)}),x=setInterval(()=>{var N;const F=`.${A}-dropdown`,L=(N=d.current)===null||N===void 0?void 0:N.querySelector(F);L&&(clearInterval(x),M.observe(L))},10);return()=>{clearInterval(x),M.disconnect()}}},[]);let T=Object.assign(Object.assign({},l),{style:Object.assign(Object.assign({},f),{margin:0}),open:E,visible:E,getPopupContainer:()=>d.current});Object.assign(T,{[e]:{overflow:{adjustX:!1,adjustY:!1}}});const C={paddingBottom:g,position:"relative",minWidth:v};return _.createElement("div",{ref:d,style:C},_.createElement(t,Object.assign({},T)))}),Px=function(){if(typeof navigator>"u"||typeof window>"u")return!1;var t=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(t)||/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(t==null?void 0:t.substr(0,4))};var pp=function(e){var n=e.className,r=e.customizeIcon,i=e.customizeIconProps,s=e.children,l=e.onMouseDown,c=e.onClick,f=typeof r=="function"?r(i):r;return _.createElement("span",{className:n,onMouseDown:function(g){g.preventDefault(),l==null||l(g)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:c,"aria-hidden":!0},f!==void 0?f:_.createElement("span",{className:Ze(n.split(/\s+/).map(function(d){return"".concat(d,"-icon")}))},s))},AU=function(e,n,r,i,s){var l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,c=arguments.length>6?arguments[6]:void 0,f=arguments.length>7?arguments[7]:void 0,d=Ft.useMemo(function(){if(pt(i)==="object")return i.clearIcon;if(s)return s},[i,s]),g=Ft.useMemo(function(){return!!(!l&&i&&(r.length||c)&&!(f==="combobox"&&c===""))},[i,l,r.length,c,f]);return{allowClear:g,clearIcon:Ft.createElement(pp,{className:"".concat(e,"-clear"),onMouseDown:n,customizeIcon:d},"×")}},Nx=_.createContext(null);function CU(){return _.useContext(Nx)}function RU(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,e=_.useState(!1),n=de(e,2),r=n[0],i=n[1],s=_.useRef(null),l=function(){window.clearTimeout(s.current)};_.useEffect(function(){return l},[]);var c=function(d,g){l(),s.current=window.setTimeout(function(){i(d),g&&g()},t)};return[r,c,l]}function Ix(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,e=_.useRef(null),n=_.useRef(null);_.useEffect(function(){return function(){window.clearTimeout(n.current)}},[]);function r(i){(i||e.current===null)&&(e.current=i),window.clearTimeout(n.current),n.current=window.setTimeout(function(){e.current=null},t)}return[function(){return e.current},r]}function xU(t,e,n,r){var i=_.useRef(null);i.current={open:e,triggerOpen:n,customizedTrigger:r},_.useEffect(function(){function s(l){var c;if(!((c=i.current)!==null&&c!==void 0&&c.customizedTrigger)){var f=l.target;f.shadowRoot&&l.composed&&(f=l.composedPath()[0]||f),i.current.open&&t().filter(function(d){return d}).every(function(d){return!d.contains(f)&&d!==f})&&i.current.triggerOpen(!1)}}return window.addEventListener("mousedown",s),function(){return window.removeEventListener("mousedown",s)}},[])}function MU(t){return t&&![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(t)}var OU=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],zl=void 0;function PU(t,e){var n=t.prefixCls,r=t.invalidate,i=t.item,s=t.renderItem,l=t.responsive,c=t.responsiveDisabled,f=t.registerSize,d=t.itemKey,g=t.className,m=t.style,v=t.children,S=t.display,E=t.order,w=t.component,b=w===void 0?"div":w,A=Fn(t,OU),T=l&&!S;function C(L){f(d,L)}_.useEffect(function(){return function(){C(null)}},[]);var M=s&&i!==zl?s(i,{index:E}):v,x;r||(x={opacity:T?0:1,height:T?0:zl,overflowY:T?"hidden":zl,order:l?E:zl,pointerEvents:T?"none":zl,position:T?"absolute":zl});var N={};T&&(N["aria-hidden"]=!0);var F=_.createElement(b,kt({className:Ze(!r&&n,g),style:J(J({},x),m)},N,A,{ref:e}),M);return l&&(F=_.createElement(Go,{onResize:function(I){var V=I.offsetWidth;C(V)},disabled:c},F)),F}var lf=_.forwardRef(PU);lf.displayName="Item";function NU(t){if(typeof MessageChannel>"u")hr(t);else{var e=new MessageChannel;e.port1.onmessage=function(){return t()},e.port2.postMessage(void 0)}}function IU(){var t=_.useRef(null),e=function(r){t.current||(t.current=[],NU(function(){$a.unstable_batchedUpdates(function(){t.current.forEach(function(i){i()}),t.current=null})})),t.current.push(r)};return e}function Hu(t,e){var n=_.useState(e),r=de(n,2),i=r[0],s=r[1],l=dr(function(c){t(function(){s(c)})});return[i,l]}var cg=Ft.createContext(null),DU=["component"],FU=["className"],kU=["className"],BU=function(e,n){var r=_.useContext(cg);if(!r){var i=e.component,s=i===void 0?"div":i,l=Fn(e,DU);return _.createElement(s,kt({},l,{ref:n}))}var c=r.className,f=Fn(r,FU),d=e.className,g=Fn(e,kU);return _.createElement(cg.Provider,{value:null},_.createElement(lf,kt({ref:n,className:Ze(c,d)},f,g)))},Dx=_.forwardRef(BU);Dx.displayName="RawItem";var UU=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],Fx="responsive",kx="invalidate";function LU(t){return"+ ".concat(t.length," ...")}function zU(t,e){var n=t.prefixCls,r=n===void 0?"rc-overflow":n,i=t.data,s=i===void 0?[]:i,l=t.renderItem,c=t.renderRawItem,f=t.itemKey,d=t.itemWidth,g=d===void 0?10:d,m=t.ssr,v=t.style,S=t.className,E=t.maxCount,w=t.renderRest,b=t.renderRawRest,A=t.suffix,T=t.component,C=T===void 0?"div":T,M=t.itemComponent,x=t.onVisibleChange,N=Fn(t,UU),F=m==="full",L=IU(),I=Hu(L,null),V=de(I,2),B=V[0],j=V[1],X=B||0,Y=Hu(L,new Map),ae=de(Y,2),U=ae[0],z=ae[1],W=Hu(L,0),Z=de(W,2),P=Z[0],$=Z[1],ie=Hu(L,0),se=de(ie,2),q=se[0],ce=se[1],fe=Hu(L,0),ye=de(fe,2),we=ye[0],Ae=ye[1],Te=_.useState(null),ve=de(Te,2),ge=ve[0],_e=ve[1],Ie=_.useState(null),Ee=de(Ie,2),xe=Ee[0],Ve=Ee[1],Fe=_.useMemo(function(){return xe===null&&F?Number.MAX_SAFE_INTEGER:xe||0},[xe,B]),Be=_.useState(!1),nt=de(Be,2),He=nt[0],Ge=nt[1],Pe="".concat(r,"-item"),Me=Math.max(P,q),dt=E===Fx,rt=s.length&&dt,it=E===kx,st=rt||typeof E=="number"&&s.length>E,at=_.useMemo(function(){var qe=s;return rt?B===null&&F?qe=s:qe=s.slice(0,Math.min(s.length,X/g)):typeof E=="number"&&(qe=s.slice(0,E)),qe},[s,g,B,E,rt]),Je=_.useMemo(function(){return rt?s.slice(Fe+1):s.slice(at.length)},[s,at,rt,Fe]),lt=_.useCallback(function(qe,ke){var Ne;return typeof f=="function"?f(qe):(Ne=f&&(qe==null?void 0:qe[f]))!==null&&Ne!==void 0?Ne:ke},[f]),ft=_.useCallback(l||function(qe){return qe},[l]);function ct(qe,ke,Ne){xe===qe&&(ke===void 0||ke===ge)||(Ve(qe),Ne||(Ge(qeX){ct(wt-1,qe-en-we+q);break}}A&&Vt(0)+we>X&&_e(null)}},[X,U,q,we,lt,at]);var qt=He&&!!Je.length,En={};ge!==null&&rt&&(En={position:"absolute",left:ge,top:0});var Mn={prefixCls:Pe,responsive:rt,component:M,invalidate:it},Ut=c?function(qe,ke){var Ne=lt(qe,ke);return _.createElement(cg.Provider,{key:Ne,value:J(J({},Mn),{},{order:ke,item:qe,itemKey:Ne,registerSize:xt,display:ke<=Fe})},c(qe,ke))}:function(qe,ke){var Ne=lt(qe,ke);return _.createElement(lf,kt({},Mn,{order:ke,key:Ne,item:qe,renderItem:ft,itemKey:Ne,registerSize:xt,display:ke<=Fe}))},It={order:qt?Fe:Number.MAX_SAFE_INTEGER,className:"".concat(Pe,"-rest"),registerSize:Bt,display:qt},Lt=w||LU,Jt=b?_.createElement(cg.Provider,{value:J(J({},Mn),It)},b(Je)):_.createElement(lf,kt({},Mn,It),typeof Lt=="function"?Lt(Je):Lt),Mt=_.createElement(C,kt({className:Ze(!it&&r,S),style:v,ref:e},N),at.map(Ut),st?Jt:null,A&&_.createElement(lf,kt({},Mn,{responsive:dt,responsiveDisabled:!rt,order:Fe,className:"".concat(Pe,"-suffix"),registerSize:ht,display:!0,style:En}),A));return dt?_.createElement(Go,{onResize:mt,disabled:!rt},Mt):Mt}var Qf=_.forwardRef(zU);Qf.displayName="Overflow";Qf.Item=Dx;Qf.RESPONSIVE=Fx;Qf.INVALIDATE=kx;var $U=function(e,n){var r,i=e.prefixCls,s=e.id,l=e.inputElement,c=e.disabled,f=e.tabIndex,d=e.autoFocus,g=e.autoComplete,m=e.editable,v=e.activeDescendantId,S=e.value,E=e.maxLength,w=e.onKeyDown,b=e.onMouseDown,A=e.onChange,T=e.onPaste,C=e.onCompositionStart,M=e.onCompositionEnd,x=e.onBlur,N=e.open,F=e.attrs,L=l||_.createElement("input",null),I=L,V=I.ref,B=I.props,j=B.onKeyDown,X=B.onChange,Y=B.onMouseDown,ae=B.onCompositionStart,U=B.onCompositionEnd,z=B.onBlur,W=B.style;return"maxLength"in L.props,L=_.cloneElement(L,J(J(J({type:"search"},B),{},{id:s,ref:op(n,V),disabled:c,tabIndex:f,autoComplete:g||"off",autoFocus:d,className:Ze("".concat(i,"-selection-search-input"),(r=L)===null||r===void 0||(r=r.props)===null||r===void 0?void 0:r.className),role:"combobox","aria-expanded":N||!1,"aria-haspopup":"listbox","aria-owns":"".concat(s,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(s,"_list"),"aria-activedescendant":N?v:void 0},F),{},{value:m?S:"",maxLength:E,readOnly:!m,unselectable:m?null:"on",style:J(J({},W),{},{opacity:m?null:0}),onKeyDown:function(P){w(P),j&&j(P)},onMouseDown:function(P){b(P),Y&&Y(P)},onChange:function(P){A(P),X&&X(P)},onCompositionStart:function(P){C(P),ae&&ae(P)},onCompositionEnd:function(P){M(P),U&&U(P)},onPaste:T,onBlur:function(P){x(P),z&&z(P)}})),L},Bx=_.forwardRef($U);function Ux(t){return Array.isArray(t)?t:t!==void 0?[t]:[]}var VU=typeof window<"u"&&window.document&&window.document.documentElement,HU=VU;function jU(t){return t!=null}function WU(t){return!t&&t!==0}function o2(t){return["string","number"].includes(pt(t))}function Lx(t){var e=void 0;return t&&(o2(t.title)?e=t.title.toString():o2(t.label)&&(e=t.label.toString())),e}function XU(t,e){HU?_.useLayoutEffect(t,e):_.useEffect(t,e)}function qU(t){var e;return(e=t.key)!==null&&e!==void 0?e:t.value}var l2=function(e){e.preventDefault(),e.stopPropagation()},YU=function(e){var n=e.id,r=e.prefixCls,i=e.values,s=e.open,l=e.searchValue,c=e.autoClearSearchValue,f=e.inputRef,d=e.placeholder,g=e.disabled,m=e.mode,v=e.showSearch,S=e.autoFocus,E=e.autoComplete,w=e.activeDescendantId,b=e.tabIndex,A=e.removeIcon,T=e.maxTagCount,C=e.maxTagTextLength,M=e.maxTagPlaceholder,x=M===void 0?function(Ie){return"+ ".concat(Ie.length," ...")}:M,N=e.tagRender,F=e.onToggleOpen,L=e.onRemove,I=e.onInputChange,V=e.onInputPaste,B=e.onInputKeyDown,j=e.onInputMouseDown,X=e.onInputCompositionStart,Y=e.onInputCompositionEnd,ae=e.onInputBlur,U=_.useRef(null),z=_.useState(0),W=de(z,2),Z=W[0],P=W[1],$=_.useState(!1),ie=de($,2),se=ie[0],q=ie[1],ce="".concat(r,"-selection"),fe=s||m==="multiple"&&c===!1||m==="tags"?l:"",ye=m==="tags"||m==="multiple"&&c===!1||v&&(s||se);XU(function(){P(U.current.scrollWidth)},[fe]);var we=function(Ee,xe,Ve,Fe,Be){return _.createElement("span",{title:Lx(Ee),className:Ze("".concat(ce,"-item"),K({},"".concat(ce,"-item-disabled"),Ve))},_.createElement("span",{className:"".concat(ce,"-item-content")},xe),Fe&&_.createElement(pp,{className:"".concat(ce,"-item-remove"),onMouseDown:l2,onClick:Be,customizeIcon:A},"×"))},Ae=function(Ee,xe,Ve,Fe,Be,nt){var He=function(Pe){l2(Pe),F(!s)};return _.createElement("span",{onMouseDown:He},N({label:xe,value:Ee,disabled:Ve,closable:Fe,onClose:Be,isMaxTag:!!nt}))},Te=function(Ee){var xe=Ee.disabled,Ve=Ee.label,Fe=Ee.value,Be=!g&&!xe,nt=Ve;if(typeof C=="number"&&(typeof Ve=="string"||typeof Ve=="number")){var He=String(nt);He.length>C&&(nt="".concat(He.slice(0,C),"..."))}var Ge=function(Me){Me&&Me.stopPropagation(),L(Ee)};return typeof N=="function"?Ae(Fe,nt,xe,Be,Ge):we(Ee,nt,xe,Be,Ge)},ve=function(Ee){if(!i.length)return null;var xe=typeof x=="function"?x(Ee):x;return typeof N=="function"?Ae(void 0,xe,!1,!1,void 0,!0):we({title:xe},xe,!1)},ge=_.createElement("div",{className:"".concat(ce,"-search"),style:{width:Z},onFocus:function(){q(!0)},onBlur:function(){q(!1)}},_.createElement(Bx,{ref:f,open:s,prefixCls:r,id:n,inputElement:null,disabled:g,autoFocus:S,autoComplete:E,editable:ye,activeDescendantId:w,value:fe,onKeyDown:B,onMouseDown:j,onChange:I,onPaste:V,onCompositionStart:X,onCompositionEnd:Y,onBlur:ae,tabIndex:b,attrs:og(e,!0)}),_.createElement("span",{ref:U,className:"".concat(ce,"-search-mirror"),"aria-hidden":!0},fe," ")),_e=_.createElement(Qf,{prefixCls:"".concat(ce,"-overflow"),data:i,renderItem:Te,renderRest:ve,suffix:ge,itemKey:qU,maxCount:T});return _.createElement("span",{className:"".concat(ce,"-wrap")},_e,!i.length&&!fe&&_.createElement("span",{className:"".concat(ce,"-placeholder")},d))},KU=function(e){var n=e.inputElement,r=e.prefixCls,i=e.id,s=e.inputRef,l=e.disabled,c=e.autoFocus,f=e.autoComplete,d=e.activeDescendantId,g=e.mode,m=e.open,v=e.values,S=e.placeholder,E=e.tabIndex,w=e.showSearch,b=e.searchValue,A=e.activeValue,T=e.maxLength,C=e.onInputKeyDown,M=e.onInputMouseDown,x=e.onInputChange,N=e.onInputPaste,F=e.onInputCompositionStart,L=e.onInputCompositionEnd,I=e.onInputBlur,V=e.title,B=_.useState(!1),j=de(B,2),X=j[0],Y=j[1],ae=g==="combobox",U=ae||w,z=v[0],W=b||"";ae&&A&&!X&&(W=A),_.useEffect(function(){ae&&Y(!1)},[ae,A]);var Z=g!=="combobox"&&!m&&!w?!1:!!W,P=V===void 0?Lx(z):V,$=_.useMemo(function(){return z?null:_.createElement("span",{className:"".concat(r,"-selection-placeholder"),style:Z?{visibility:"hidden"}:void 0},S)},[z,Z,S,r]);return _.createElement("span",{className:"".concat(r,"-selection-wrap")},_.createElement("span",{className:"".concat(r,"-selection-search")},_.createElement(Bx,{ref:s,prefixCls:r,id:i,open:m,inputElement:n,disabled:l,autoFocus:c,autoComplete:f,editable:U,activeDescendantId:d,value:W,onKeyDown:C,onMouseDown:M,onChange:function(se){Y(!0),x(se)},onPaste:N,onCompositionStart:F,onCompositionEnd:L,onBlur:I,tabIndex:E,attrs:og(e,!0),maxLength:ae?T:void 0})),!ae&&z?_.createElement("span",{className:"".concat(r,"-selection-item"),title:P,style:Z?{visibility:"hidden"}:void 0},z.label):null,$)},ZU=function(e,n){var r=_.useRef(null),i=_.useRef(!1),s=e.prefixCls,l=e.open,c=e.mode,f=e.showSearch,d=e.tokenWithEnter,g=e.disabled,m=e.prefix,v=e.autoClearSearchValue,S=e.onSearch,E=e.onSearchSubmit,w=e.onToggleOpen,b=e.onInputKeyDown,A=e.onInputBlur,T=e.domRef;_.useImperativeHandle(n,function(){return{focus:function(P){r.current.focus(P)},blur:function(){r.current.blur()}}});var C=Ix(0),M=de(C,2),x=M[0],N=M[1],F=function(P){var $=P.which,ie=r.current instanceof HTMLTextAreaElement;!ie&&l&&($===et.UP||$===et.DOWN)&&P.preventDefault(),b&&b(P),$===et.ENTER&&c==="tags"&&!i.current&&!l&&(E==null||E(P.target.value)),!(ie&&!l&&~[et.UP,et.DOWN,et.LEFT,et.RIGHT].indexOf($))&&MU($)&&w(!0)},L=function(){N(!0)},I=_.useRef(null),V=function(P){S(P,!0,i.current)!==!1&&w(!0)},B=function(){i.current=!0},j=function(P){i.current=!1,c!=="combobox"&&V(P.target.value)},X=function(P){var $=P.target.value;if(d&&I.current&&/[\r\n]/.test(I.current)){var ie=I.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");$=$.replace(ie,I.current)}I.current=null,V($)},Y=function(P){var $=P.clipboardData,ie=$==null?void 0:$.getData("text");I.current=ie||""},ae=function(P){var $=P.target;if($!==r.current){var ie=document.body.style.msTouchAction!==void 0;ie?setTimeout(function(){r.current.focus()}):r.current.focus()}},U=function(P){var $=x();P.target!==r.current&&!$&&!(c==="combobox"&&g)&&P.preventDefault(),(c!=="combobox"&&(!f||!$)||!l)&&(l&&v!==!1&&S("",!0,!1),w())},z={inputRef:r,onInputKeyDown:F,onInputMouseDown:L,onInputChange:X,onInputPaste:Y,onInputCompositionStart:B,onInputCompositionEnd:j,onInputBlur:A},W=c==="multiple"||c==="tags"?_.createElement(YU,kt({},e,z)):_.createElement(KU,kt({},e,z));return _.createElement("div",{ref:T,className:"".concat(s,"-selector"),onClick:ae,onMouseDown:U},m&&_.createElement("div",{className:"".concat(s,"-prefix")},m),W)},QU=_.forwardRef(ZU);function GU(t){var e=t.prefixCls,n=t.align,r=t.arrow,i=t.arrowPos,s=r||{},l=s.className,c=s.content,f=i.x,d=f===void 0?0:f,g=i.y,m=g===void 0?0:g,v=_.useRef();if(!n||!n.points)return null;var S={position:"absolute"};if(n.autoArrow!==!1){var E=n.points[0],w=n.points[1],b=E[0],A=E[1],T=w[0],C=w[1];b===T||!["t","b"].includes(b)?S.top=m:b==="t"?S.top=0:S.bottom=0,A===C||!["l","r"].includes(A)?S.left=d:A==="l"?S.left=0:S.right=0}return _.createElement("div",{ref:v,className:Ze("".concat(e,"-arrow"),l),style:S},c)}function JU(t){var e=t.prefixCls,n=t.open,r=t.zIndex,i=t.mask,s=t.motion;return i?_.createElement(hb,kt({},s,{motionAppear:!0,visible:n,removeOnLeave:!0}),function(l){var c=l.className;return _.createElement("div",{style:{zIndex:r},className:Ze("".concat(e,"-mask"),c)})}):null}var eL=_.memo(function(t){var e=t.children;return e},function(t,e){return e.cache}),tL=_.forwardRef(function(t,e){var n=t.popup,r=t.className,i=t.prefixCls,s=t.style,l=t.target,c=t.onVisibleChanged,f=t.open,d=t.keepDom,g=t.fresh,m=t.onClick,v=t.mask,S=t.arrow,E=t.arrowPos,w=t.align,b=t.motion,A=t.maskMotion,T=t.forceRender,C=t.getPopupContainer,M=t.autoDestroy,x=t.portal,N=t.zIndex,F=t.onMouseEnter,L=t.onMouseLeave,I=t.onPointerEnter,V=t.onPointerDownCapture,B=t.ready,j=t.offsetX,X=t.offsetY,Y=t.offsetR,ae=t.offsetB,U=t.onAlign,z=t.onPrepare,W=t.stretch,Z=t.targetWidth,P=t.targetHeight,$=typeof n=="function"?n():n,ie=f||d,se=(C==null?void 0:C.length)>0,q=_.useState(!C||!se),ce=de(q,2),fe=ce[0],ye=ce[1];if(Dn(function(){!fe&&se&&l&&ye(!0)},[fe,se,l]),!fe)return null;var we="auto",Ae={left:"-1000vw",top:"-1000vh",right:we,bottom:we};if(B||!f){var Te,ve=w.points,ge=w.dynamicInset||((Te=w._experimental)===null||Te===void 0?void 0:Te.dynamicInset),_e=ge&&ve[0][1]==="r",Ie=ge&&ve[0][0]==="b";_e?(Ae.right=Y,Ae.left=we):(Ae.left=j,Ae.right=we),Ie?(Ae.bottom=ae,Ae.top=we):(Ae.top=X,Ae.bottom=we)}var Ee={};return W&&(W.includes("height")&&P?Ee.height=P:W.includes("minHeight")&&P&&(Ee.minHeight=P),W.includes("width")&&Z?Ee.width=Z:W.includes("minWidth")&&Z&&(Ee.minWidth=Z)),f||(Ee.pointerEvents="none"),_.createElement(x,{open:T||ie,getContainer:C&&function(){return C(l)},autoDestroy:M},_.createElement(JU,{prefixCls:i,open:f,zIndex:N,mask:v,motion:A}),_.createElement(Go,{onResize:U,disabled:!f},function(xe){return _.createElement(hb,kt({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:T,leavedClassName:"".concat(i,"-hidden")},b,{onAppearPrepare:z,onEnterPrepare:z,visible:f,onVisibleChanged:function(Fe){var Be;b==null||(Be=b.onVisibleChanged)===null||Be===void 0||Be.call(b,Fe),c(Fe)}}),function(Ve,Fe){var Be=Ve.className,nt=Ve.style,He=Ze(i,Be,r);return _.createElement("div",{ref:op(xe,e,Fe),className:He,style:J(J(J(J({"--arrow-x":"".concat(E.x||0,"px"),"--arrow-y":"".concat(E.y||0,"px")},Ae),Ee),nt),{},{boxSizing:"border-box",zIndex:N},s),onMouseEnter:F,onMouseLeave:L,onPointerEnter:I,onClick:m,onPointerDownCapture:V},S&&_.createElement(GU,{prefixCls:i,arrow:S,arrowPos:E,align:w}),_.createElement(eL,{cache:!f&&!g},$))})}))}),nL=_.forwardRef(function(t,e){var n=t.children,r=t.getTriggerDOMNode,i=cp(n),s=_.useCallback(function(c){Qy(e,r?r(c):c)},[r]),l=lp(s,Gy(n));return i?_.cloneElement(n,{ref:l}):n}),c2=_.createContext(null);function u2(t){return t?Array.isArray(t)?t:[t]:[]}function rL(t,e,n,r){return _.useMemo(function(){var i=u2(n??e),s=u2(r??e),l=new Set(i),c=new Set(s);return t&&(l.has("hover")&&(l.delete("hover"),l.add("click")),c.has("hover")&&(c.delete("hover"),c.add("click"))),[l,c]},[t,e,n,r])}function iL(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;return n?t[0]===e[0]:t[0]===e[0]&&t[1]===e[1]}function sL(t,e,n,r){for(var i=n.points,s=Object.keys(t),l=0;l1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(t)?e:t}function ju(t){return Of(parseFloat(t),0)}function d2(t,e){var n=J({},t);return(e||[]).forEach(function(r){if(!(r instanceof HTMLBodyElement||r instanceof HTMLHtmlElement)){var i=Gf(r).getComputedStyle(r),s=i.overflow,l=i.overflowClipMargin,c=i.borderTopWidth,f=i.borderBottomWidth,d=i.borderLeftWidth,g=i.borderRightWidth,m=r.getBoundingClientRect(),v=r.offsetHeight,S=r.clientHeight,E=r.offsetWidth,w=r.clientWidth,b=ju(c),A=ju(f),T=ju(d),C=ju(g),M=Of(Math.round(m.width/E*1e3)/1e3),x=Of(Math.round(m.height/v*1e3)/1e3),N=(E-w-T-C)*M,F=(v-S-b-A)*x,L=b*x,I=A*x,V=T*M,B=C*M,j=0,X=0;if(s==="clip"){var Y=ju(l);j=Y*M,X=Y*x}var ae=m.x+V-j,U=m.y+L-X,z=ae+m.width+2*j-V-B-N,W=U+m.height+2*X-L-I-F;n.left=Math.max(n.left,ae),n.top=Math.max(n.top,U),n.right=Math.min(n.right,z),n.bottom=Math.min(n.bottom,W)}}),n}function h2(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n="".concat(e),r=n.match(/^(.*)\%$/);return r?t*(parseFloat(r[1])/100):parseFloat(n)}function g2(t,e){var n=e||[],r=de(n,2),i=r[0],s=r[1];return[h2(t.width,i),h2(t.height,s)]}function p2(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[t[0],t[1]]}function $l(t,e){var n=e[0],r=e[1],i,s;return n==="t"?s=t.y:n==="b"?s=t.y+t.height:s=t.y+t.height/2,r==="l"?i=t.x:r==="r"?i=t.x+t.width:i=t.x+t.width/2,{x:i,y:s}}function ma(t,e){var n={t:"b",b:"t",l:"r",r:"l"};return t.map(function(r,i){return i===e?n[r]||"c":r}).join("")}function aL(t,e,n,r,i,s,l){var c=_.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:i[r]||{}}),f=de(c,2),d=f[0],g=f[1],m=_.useRef(0),v=_.useMemo(function(){return e?B_(e):[]},[e]),S=_.useRef({}),E=function(){S.current={}};t||E();var w=dr(function(){if(e&&n&&t){let Xr=function(Bi,di){var hi=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Me,gi=q.x+Bi,Ui=q.y+di,rl=gi+_e,ja=Ui+ge,il=Math.max(gi,hi.left),$e=Math.max(Ui,hi.top),gt=Math.min(rl,hi.right),sn=Math.min(ja,hi.bottom);return Math.max(0,(gt-il)*(sn-$e))},nl=function(){vn=q.y+Ne,On=vn+ge,_n=q.x+ke,Zn=_n+_e};var T,C,M,x,N=e,F=N.ownerDocument,L=Gf(N),I=L.getComputedStyle(N),V=I.width,B=I.height,j=I.position,X=N.style.left,Y=N.style.top,ae=N.style.right,U=N.style.bottom,z=N.style.overflow,W=J(J({},i[r]),s),Z=F.createElement("div");(T=N.parentElement)===null||T===void 0||T.appendChild(Z),Z.style.left="".concat(N.offsetLeft,"px"),Z.style.top="".concat(N.offsetTop,"px"),Z.style.position=j,Z.style.height="".concat(N.offsetHeight,"px"),Z.style.width="".concat(N.offsetWidth,"px"),N.style.left="0",N.style.top="0",N.style.right="auto",N.style.bottom="auto",N.style.overflow="hidden";var P;if(Array.isArray(n))P={x:n[0],y:n[1],width:0,height:0};else{var $,ie,se=n.getBoundingClientRect();se.x=($=se.x)!==null&&$!==void 0?$:se.left,se.y=(ie=se.y)!==null&&ie!==void 0?ie:se.top,P={x:se.x,y:se.y,width:se.width,height:se.height}}var q=N.getBoundingClientRect();q.x=(C=q.x)!==null&&C!==void 0?C:q.left,q.y=(M=q.y)!==null&&M!==void 0?M:q.top;var ce=F.documentElement,fe=ce.clientWidth,ye=ce.clientHeight,we=ce.scrollWidth,Ae=ce.scrollHeight,Te=ce.scrollTop,ve=ce.scrollLeft,ge=q.height,_e=q.width,Ie=P.height,Ee=P.width,xe={left:0,top:0,right:fe,bottom:ye},Ve={left:-ve,top:-Te,right:we-ve,bottom:Ae-Te},Fe=W.htmlRegion,Be="visible",nt="visibleFirst";Fe!=="scroll"&&Fe!==nt&&(Fe=Be);var He=Fe===nt,Ge=d2(Ve,v),Pe=d2(xe,v),Me=Fe===Be?Pe:Ge,dt=He?Pe:Me;N.style.left="auto",N.style.top="auto",N.style.right="0",N.style.bottom="0";var rt=N.getBoundingClientRect();N.style.left=X,N.style.top=Y,N.style.right=ae,N.style.bottom=U,N.style.overflow=z,(x=N.parentElement)===null||x===void 0||x.removeChild(Z);var it=Of(Math.round(_e/parseFloat(V)*1e3)/1e3),st=Of(Math.round(ge/parseFloat(B)*1e3)/1e3);if(it===0||st===0||bf(n)&&!Nk(n))return;var at=W.offset,Je=W.targetOffset,lt=g2(q,at),ft=de(lt,2),ct=ft[0],mt=ft[1],xt=g2(P,Je),Bt=de(xt,2),ht=Bt[0],Vt=Bt[1];P.x-=ht,P.y-=Vt;var qt=W.points||[],En=de(qt,2),Mn=En[0],Ut=En[1],It=p2(Ut),Lt=p2(Mn),Jt=$l(P,It),Mt=$l(q,Lt),qe=J({},W),ke=Jt.x-Mt.x+ct,Ne=Jt.y-Mt.y+mt,wt=Xr(ke,Ne),en=Xr(ke,Ne,Pe),Ue=$l(P,["t","l"]),Oe=$l(q,["t","l"]),je=$l(P,["b","r"]),Ye=$l(q,["b","r"]),We=W.overflow||{},Qe=We.adjustX,bt=We.adjustY,_t=We.shiftX,Zt=We.shiftY,Yt=function(di){return typeof di=="boolean"?di:di>=0},vn,On,_n,Zn;nl();var un=Yt(bt),rn=Lt[0]===It[0];if(un&&Lt[0]==="t"&&(On>dt.bottom||S.current.bt)){var Ce=Ne;rn?Ce-=ge-Ie:Ce=Ue.y-Ye.y-mt;var Le=Xr(ke,Ce),De=Xr(ke,Ce,Pe);Le>wt||Le===wt&&(!He||De>=en)?(S.current.bt=!0,Ne=Ce,mt=-mt,qe.points=[ma(Lt,0),ma(It,0)]):S.current.bt=!1}if(un&&Lt[0]==="b"&&(vnwt||ut===wt&&(!He||zt>=en)?(S.current.tb=!0,Ne=be,mt=-mt,qe.points=[ma(Lt,0),ma(It,0)]):S.current.tb=!1}var Ot=Yt(Qe),In=Lt[1]===It[1];if(Ot&&Lt[1]==="l"&&(Zn>dt.right||S.current.rl)){var tn=ke;In?tn-=_e-Ee:tn=Ue.x-Ye.x-ct;var Vn=Xr(tn,Ne),Pn=Xr(tn,Ne,Pe);Vn>wt||Vn===wt&&(!He||Pn>=en)?(S.current.rl=!0,ke=tn,ct=-ct,qe.points=[ma(Lt,1),ma(It,1)]):S.current.rl=!1}if(Ot&&Lt[1]==="r"&&(_nwt||Nr===wt&&(!He||er>=en)?(S.current.lr=!0,ke=Bn,ct=-ct,qe.points=[ma(Lt,1),ma(It,1)]):S.current.lr=!1}nl();var Un=_t===!0?0:_t;typeof Un=="number"&&(_nPe.right&&(ke-=Zn-Pe.right-ct,P.x>Pe.right-Un&&(ke+=P.x-Pe.right+Un)));var Tn=Zt===!0?0:Zt;typeof Tn=="number"&&(vnPe.bottom&&(Ne-=On-Pe.bottom-mt,P.y>Pe.bottom-Tn&&(Ne+=P.y-Pe.bottom+Tn)));var Qn=q.x+ke,Di=Qn+_e,Wr=q.y+Ne,Fi=Wr+ge,ki=P.x,Tt=ki+Ee,yt=P.y,nn=yt+Ie,Hn=Math.max(Qn,ki),An=Math.min(Di,Tt),Nn=(Hn+An)/2,tr=Nn-Qn,Sr=Math.max(Wr,yt),Lr=Math.min(Fi,nn),wr=(Sr+Lr)/2,Gr=wr-Wr;l==null||l(e,qe);var Jr=rt.right-q.x-(ke+q.width),pr=rt.bottom-q.y-(Ne+q.height);it===1&&(ke=Math.round(ke),Jr=Math.round(Jr)),st===1&&(Ne=Math.round(Ne),pr=Math.round(pr));var Ha={ready:!0,offsetX:ke/it,offsetY:Ne/st,offsetR:Jr/it,offsetB:pr/st,arrowX:tr/it,arrowY:Gr/st,scaleX:it,scaleY:st,align:qe};g(Ha)}}),b=function(){m.current+=1;var C=m.current;Promise.resolve().then(function(){m.current===C&&w()})},A=function(){g(function(C){return J(J({},C),{},{ready:!1})})};return Dn(A,[r]),Dn(function(){t||A()},[t]),[d.ready,d.offsetX,d.offsetY,d.offsetR,d.offsetB,d.arrowX,d.arrowY,d.scaleX,d.scaleY,d.align,b]}function oL(t,e,n,r,i){Dn(function(){if(t&&e&&n){let m=function(){r(),i()};var s=e,l=n,c=B_(s),f=B_(l),d=Gf(l),g=new Set([d].concat(ze(c),ze(f)));return g.forEach(function(v){v.addEventListener("scroll",m,{passive:!0})}),d.addEventListener("resize",m,{passive:!0}),r(),function(){g.forEach(function(v){v.removeEventListener("scroll",m),d.removeEventListener("resize",m)})}}},[t,e,n])}function lL(t,e,n,r,i,s,l,c){var f=_.useRef(t);f.current=t;var d=_.useRef(!1);_.useEffect(function(){if(e&&r&&(!i||s)){var m=function(){d.current=!1},v=function(b){var A;f.current&&!l(((A=b.composedPath)===null||A===void 0||(A=A.call(b))===null||A===void 0?void 0:A[0])||b.target)&&!d.current&&c(!1)},S=Gf(r);S.addEventListener("pointerdown",m,!0),S.addEventListener("mousedown",v,!0),S.addEventListener("contextmenu",v,!0);var E=ag(n);return E&&(E.addEventListener("mousedown",v,!0),E.addEventListener("contextmenu",v,!0)),function(){S.removeEventListener("pointerdown",m,!0),S.removeEventListener("mousedown",v,!0),S.removeEventListener("contextmenu",v,!0),E&&(E.removeEventListener("mousedown",v,!0),E.removeEventListener("contextmenu",v,!0))}}},[e,n,r,i,s]);function g(){d.current=!0}return g}var cL=["prefixCls","children","action","showAction","hideAction","popupVisible","defaultPopupVisible","onPopupVisibleChange","afterPopupVisibleChange","mouseEnterDelay","mouseLeaveDelay","focusDelay","blurDelay","mask","maskClosable","getPopupContainer","forceRender","autoDestroy","destroyPopupOnHide","popup","popupClassName","popupStyle","popupPlacement","builtinPlacements","popupAlign","zIndex","stretch","getPopupClassNameFromAlign","fresh","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode"];function uL(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ex,e=_.forwardRef(function(n,r){var i=n.prefixCls,s=i===void 0?"rc-trigger-popup":i,l=n.children,c=n.action,f=c===void 0?"hover":c,d=n.showAction,g=n.hideAction,m=n.popupVisible,v=n.defaultPopupVisible,S=n.onPopupVisibleChange,E=n.afterPopupVisibleChange,w=n.mouseEnterDelay,b=n.mouseLeaveDelay,A=b===void 0?.1:b,T=n.focusDelay,C=n.blurDelay,M=n.mask,x=n.maskClosable,N=x===void 0?!0:x,F=n.getPopupContainer,L=n.forceRender,I=n.autoDestroy,V=n.destroyPopupOnHide,B=n.popup,j=n.popupClassName,X=n.popupStyle,Y=n.popupPlacement,ae=n.builtinPlacements,U=ae===void 0?{}:ae,z=n.popupAlign,W=n.zIndex,Z=n.stretch,P=n.getPopupClassNameFromAlign,$=n.fresh,ie=n.alignPoint,se=n.onPopupClick,q=n.onPopupAlign,ce=n.arrow,fe=n.popupMotion,ye=n.maskMotion,we=n.popupTransitionName,Ae=n.popupAnimation,Te=n.maskTransitionName,ve=n.maskAnimation,ge=n.className,_e=n.getTriggerDOMNode,Ie=Fn(n,cL),Ee=I||V||!1,xe=_.useState(!1),Ve=de(xe,2),Fe=Ve[0],Be=Ve[1];Dn(function(){Be(Px())},[]);var nt=_.useRef({}),He=_.useContext(c2),Ge=_.useMemo(function(){return{registerSubPopup:function(gt,sn){nt.current[gt]=sn,He==null||He.registerSubPopup(gt,sn)}}},[He]),Pe=Tx(),Me=_.useState(null),dt=de(Me,2),rt=dt[0],it=dt[1],st=_.useRef(null),at=dr(function($e){st.current=$e,bf($e)&&rt!==$e&&it($e),He==null||He.registerSubPopup(Pe,$e)}),Je=_.useState(null),lt=de(Je,2),ft=lt[0],ct=lt[1],mt=_.useRef(null),xt=dr(function($e){bf($e)&&ft!==$e&&(ct($e),mt.current=$e)}),Bt=_.Children.only(l),ht=(Bt==null?void 0:Bt.props)||{},Vt={},qt=dr(function($e){var gt,sn,fn=ft;return(fn==null?void 0:fn.contains($e))||((gt=ag(fn))===null||gt===void 0?void 0:gt.host)===$e||$e===fn||(rt==null?void 0:rt.contains($e))||((sn=ag(rt))===null||sn===void 0?void 0:sn.host)===$e||$e===rt||Object.values(nt.current).some(function(Cn){return(Cn==null?void 0:Cn.contains($e))||$e===Cn})}),En=f2(s,fe,Ae,we),Mn=f2(s,ye,ve,Te),Ut=_.useState(v||!1),It=de(Ut,2),Lt=It[0],Jt=It[1],Mt=m??Lt,qe=dr(function($e){m===void 0&&Jt($e)});Dn(function(){Jt(m||!1)},[m]);var ke=_.useRef(Mt);ke.current=Mt;var Ne=_.useRef([]);Ne.current=[];var wt=dr(function($e){var gt;qe($e),((gt=Ne.current[Ne.current.length-1])!==null&>!==void 0?gt:Mt)!==$e&&(Ne.current.push($e),S==null||S($e))}),en=_.useRef(),Ue=function(){clearTimeout(en.current)},Oe=function(gt){var sn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;Ue(),sn===0?wt(gt):en.current=setTimeout(function(){wt(gt)},sn*1e3)};_.useEffect(function(){return Ue},[]);var je=_.useState(!1),Ye=de(je,2),We=Ye[0],Qe=Ye[1];Dn(function($e){(!$e||Mt)&&Qe(!0)},[Mt]);var bt=_.useState(null),_t=de(bt,2),Zt=_t[0],Yt=_t[1],vn=_.useState(null),On=de(vn,2),_n=On[0],Zn=On[1],un=function(gt){Zn([gt.clientX,gt.clientY])},rn=aL(Mt,rt,ie&&_n!==null?_n:ft,Y,U,z,q),Ce=de(rn,11),Le=Ce[0],De=Ce[1],be=Ce[2],ut=Ce[3],zt=Ce[4],Ot=Ce[5],In=Ce[6],tn=Ce[7],Vn=Ce[8],Pn=Ce[9],Bn=Ce[10],Nr=rL(Fe,f,d,g),er=de(Nr,2),Un=er[0],Tn=er[1],Qn=Un.has("click"),Di=Tn.has("click")||Tn.has("contextMenu"),Wr=dr(function(){We||Bn()}),Fi=function(){ke.current&&ie&&Di&&Oe(!1)};oL(Mt,ft,rt,Wr,Fi),Dn(function(){Wr()},[_n,Y]),Dn(function(){Mt&&!(U!=null&&U[Y])&&Wr()},[JSON.stringify(z)]);var ki=_.useMemo(function(){var $e=sL(U,s,Pn,ie);return Ze($e,P==null?void 0:P(Pn))},[Pn,P,U,s,ie]);_.useImperativeHandle(r,function(){return{nativeElement:mt.current,popupElement:st.current,forceAlign:Wr}});var Tt=_.useState(0),yt=de(Tt,2),nn=yt[0],Hn=yt[1],An=_.useState(0),Nn=de(An,2),tr=Nn[0],Sr=Nn[1],Lr=function(){if(Z&&ft){var gt=ft.getBoundingClientRect();Hn(gt.width),Sr(gt.height)}},wr=function(){Lr(),Wr()},Gr=function(gt){Qe(!1),Bn(),E==null||E(gt)},Jr=function(){return new Promise(function(gt){Lr(),Yt(function(){return gt})})};Dn(function(){Zt&&(Bn(),Zt(),Yt(null))},[Zt]);function pr($e,gt,sn,fn){Vt[$e]=function(Cn){var Ts;fn==null||fn(Cn),Oe(gt,sn);for(var sl=arguments.length,Wa=new Array(sl>1?sl-1:0),As=1;As1?sn-1:0),Cn=1;Cn1?sn-1:0),Cn=1;Cn1&&arguments[1]!==void 0?arguments[1]:{},n=e.fieldNames,r=e.childrenAsData,i=[],s=$x(n,!1),l=s.label,c=s.value,f=s.options,d=s.groupLabel;function g(m,v){Array.isArray(m)&&m.forEach(function(S){if(v||!(f in S)){var E=S[c];i.push({key:m2(S,i.length),groupOption:v,data:S,label:S[l],value:E})}else{var w=S[d];w===void 0&&r&&(w=S.label),i.push({key:m2(S,i.length),group:!0,data:S,label:w}),g(S[f],!0)}})}return g(t,!1),i}function L_(t){var e=J({},t);return"props"in e||Object.defineProperty(e,"props",{get:function(){return Ur(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),e}}),e}var mL=function(e,n,r){if(!n||!n.length)return null;var i=!1,s=function c(f,d){var g=N3(d),m=g[0],v=g.slice(1);if(!m)return[f];var S=f.split(m);return i=i||S.length>1,S.reduce(function(E,w){return[].concat(ze(E),ze(c(w,v)))},[]).filter(Boolean)},l=s(e,n);return i?typeof r<"u"?l.slice(0,r):l:null},mb=_.createContext(null);function vL(t){var e=t.visible,n=t.values;if(!e)return null;var r=50;return _.createElement("span",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},"".concat(n.slice(0,r).map(function(i){var s=i.label,l=i.value;return["number","string"].includes(pt(s))?s:l}).join(", ")),n.length>r?", ...":null)}var _L=["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","prefix","suffixIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],yL=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"],z_=function(e){return e==="tags"||e==="multiple"},bL=_.forwardRef(function(t,e){var n,r=t.id,i=t.prefixCls,s=t.className,l=t.showSearch,c=t.tagRender,f=t.direction,d=t.omitDomProps,g=t.displayValues,m=t.onDisplayValuesChange,v=t.emptyOptions,S=t.notFoundContent,E=S===void 0?"Not Found":S,w=t.onClear,b=t.mode,A=t.disabled,T=t.loading,C=t.getInputElement,M=t.getRawInputElement,x=t.open,N=t.defaultOpen,F=t.onDropdownVisibleChange,L=t.activeValue,I=t.onActiveValueChange,V=t.activeDescendantId,B=t.searchValue,j=t.autoClearSearchValue,X=t.onSearch,Y=t.onSearchSplit,ae=t.tokenSeparators,U=t.allowClear,z=t.prefix,W=t.suffixIcon,Z=t.clearIcon,P=t.OptionList,$=t.animation,ie=t.transitionName,se=t.dropdownStyle,q=t.dropdownClassName,ce=t.dropdownMatchSelectWidth,fe=t.dropdownRender,ye=t.dropdownAlign,we=t.placement,Ae=t.builtinPlacements,Te=t.getPopupContainer,ve=t.showAction,ge=ve===void 0?[]:ve,_e=t.onFocus,Ie=t.onBlur,Ee=t.onKeyUp,xe=t.onKeyDown,Ve=t.onMouseDown,Fe=Fn(t,_L),Be=z_(b),nt=(l!==void 0?l:Be)||b==="combobox",He=J({},Fe);yL.forEach(function(Tt){delete He[Tt]}),d==null||d.forEach(function(Tt){delete He[Tt]});var Ge=_.useState(!1),Pe=de(Ge,2),Me=Pe[0],dt=Pe[1];_.useEffect(function(){dt(Px())},[]);var rt=_.useRef(null),it=_.useRef(null),st=_.useRef(null),at=_.useRef(null),Je=_.useRef(null),lt=_.useRef(!1),ft=RU(),ct=de(ft,3),mt=ct[0],xt=ct[1],Bt=ct[2];_.useImperativeHandle(e,function(){var Tt,yt;return{focus:(Tt=at.current)===null||Tt===void 0?void 0:Tt.focus,blur:(yt=at.current)===null||yt===void 0?void 0:yt.blur,scrollTo:function(Hn){var An;return(An=Je.current)===null||An===void 0?void 0:An.scrollTo(Hn)},nativeElement:rt.current||it.current}});var ht=_.useMemo(function(){var Tt;if(b!=="combobox")return B;var yt=(Tt=g[0])===null||Tt===void 0?void 0:Tt.value;return typeof yt=="string"||typeof yt=="number"?String(yt):""},[B,b,g]),Vt=b==="combobox"&&typeof C=="function"&&C()||null,qt=typeof M=="function"&&M(),En=lp(it,qt==null||(n=qt.props)===null||n===void 0?void 0:n.ref),Mn=_.useState(!1),Ut=de(Mn,2),It=Ut[0],Lt=Ut[1];Dn(function(){Lt(!0)},[]);var Jt=xc(!1,{defaultValue:N,value:x}),Mt=de(Jt,2),qe=Mt[0],ke=Mt[1],Ne=It?qe:!1,wt=!E&&v;(A||wt&&Ne&&b==="combobox")&&(Ne=!1);var en=wt?!1:Ne,Ue=_.useCallback(function(Tt){var yt=Tt!==void 0?Tt:!Ne;A||(ke(yt),Ne!==yt&&(F==null||F(yt)))},[A,Ne,ke,F]),Oe=_.useMemo(function(){return(ae||[]).some(function(Tt){return[` +`,`\r +`].includes(Tt)})},[ae]),je=_.useContext(mb)||{},Ye=je.maxCount,We=je.rawValues,Qe=function(yt,nn,Hn){if(!(Be&&U_(Ye)&&(We==null?void 0:We.size)>=Ye)){var An=!0,Nn=yt;I==null||I(null);var tr=mL(yt,ae,U_(Ye)?Ye-We.size:void 0),Sr=Hn?null:tr;return b!=="combobox"&&Sr&&(Nn="",Y==null||Y(Sr),Ue(!1),An=!1),X&&ht!==Nn&&X(Nn,{source:nn?"typing":"effect"}),An}},bt=function(yt){!yt||!yt.trim()||X(yt,{source:"submit"})};_.useEffect(function(){!Ne&&!Be&&b!=="combobox"&&Qe("",!1,!1)},[Ne]),_.useEffect(function(){qe&&A&&ke(!1),A&&!lt.current&&xt(!1)},[A]);var _t=Ix(),Zt=de(_t,2),Yt=Zt[0],vn=Zt[1],On=_.useRef(!1),_n=function(yt){var nn=Yt(),Hn=yt.key,An=Hn==="Enter";if(An&&(b!=="combobox"&&yt.preventDefault(),Ne||Ue(!0)),vn(!!ht),Hn==="Backspace"&&!nn&&Be&&!ht&&g.length){for(var Nn=ze(g),tr=null,Sr=Nn.length-1;Sr>=0;Sr-=1){var Lr=Nn[Sr];if(!Lr.disabled){Nn.splice(Sr,1),tr=Lr;break}}tr&&m(Nn,{type:"remove",values:[tr]})}for(var wr=arguments.length,Gr=new Array(wr>1?wr-1:0),Jr=1;Jr1?nn-1:0),An=1;An1?tr-1:0),Lr=1;Lr"u"?"undefined":pt(navigator))==="object"&&/Firefox/i.test(navigator.userAgent);const Hx=function(t,e,n,r){var i=_.useRef(!1),s=_.useRef(null);function l(){clearTimeout(s.current),i.current=!0,s.current=setTimeout(function(){i.current=!1},50)}var c=_.useRef({top:t,bottom:e,left:n,right:r});return c.current.top=t,c.current.bottom=e,c.current.left=n,c.current.right=r,function(f,d){var g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,m=f?d<0&&c.current.left||d>0&&c.current.right:d<0&&c.current.top||d>0&&c.current.bottom;return g&&m?(clearTimeout(s.current),i.current=!1):(!m||i.current)&&l(),!i.current&&m}};function AL(t,e,n,r,i,s,l){var c=_.useRef(0),f=_.useRef(null),d=_.useRef(null),g=_.useRef(!1),m=Hx(e,n,r,i);function v(T,C){if(hr.cancel(f.current),!m(!1,C)){var M=T;if(!M._virtualHandled)M._virtualHandled=!0;else return;c.current+=C,d.current=C,v2||M.preventDefault(),f.current=hr(function(){var x=g.current?10:1;l(c.current*x,!1),c.current=0})}}function S(T,C){l(C,!0),v2||T.preventDefault()}var E=_.useRef(null),w=_.useRef(null);function b(T){if(t){hr.cancel(w.current),w.current=hr(function(){E.current=null},2);var C=T.deltaX,M=T.deltaY,x=T.shiftKey,N=C,F=M;(E.current==="sx"||!E.current&&x&&M&&!C)&&(N=M,F=0,E.current="sx");var L=Math.abs(N),I=Math.abs(F);E.current===null&&(E.current=s&&L>I?"x":"y"),E.current==="y"?v(T,F):S(T,N)}}function A(T){t&&(g.current=T.detail===d.current)}return[b,A]}function CL(t,e,n,r){var i=_.useMemo(function(){return[new Map,[]]},[t,n.id,r]),s=de(i,2),l=s[0],c=s[1],f=function(g){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:g,v=l.get(g),S=l.get(m);if(v===void 0||S===void 0)for(var E=t.length,w=c.length;w0&&arguments[0]!==void 0?arguments[0]:!1;g();var E=function(){var A=!1;c.current.forEach(function(T,C){if(T&&T.offsetParent){var M=rf(T),x=M.offsetHeight,N=getComputedStyle(M),F=N.marginTop,L=N.marginBottom,I=_2(F),V=_2(L),B=x+I+V;f.current.get(C)!==B&&(f.current.set(C,B),A=!0)}}),A&&l(function(T){return T+1})};if(S)E();else{d.current+=1;var w=d.current;Promise.resolve().then(function(){w===d.current&&E()})}}function v(S,E){var w=t(S);c.current.get(w),E?(c.current.set(w,E),m()):c.current.delete(w)}return _.useEffect(function(){return g},[]),[v,m,f.current,s]}var y2=14/15;function ML(t,e,n){var r=_.useRef(!1),i=_.useRef(0),s=_.useRef(0),l=_.useRef(null),c=_.useRef(null),f,d=function(S){if(r.current){var E=Math.ceil(S.touches[0].pageX),w=Math.ceil(S.touches[0].pageY),b=i.current-E,A=s.current-w,T=Math.abs(b)>Math.abs(A);T?i.current=E:s.current=w;var C=n(T,T?b:A,!1,S);C&&S.preventDefault(),clearInterval(c.current),C&&(c.current=setInterval(function(){T?b*=y2:A*=y2;var M=Math.floor(T?b:A);(!n(T,M,!0)||Math.abs(M)<=.1)&&clearInterval(c.current)},16))}},g=function(){r.current=!1,f()},m=function(S){f(),S.touches.length===1&&!r.current&&(r.current=!0,i.current=Math.ceil(S.touches[0].pageX),s.current=Math.ceil(S.touches[0].pageY),l.current=S.target,l.current.addEventListener("touchmove",d,{passive:!1}),l.current.addEventListener("touchend",g,{passive:!0}))};f=function(){l.current&&(l.current.removeEventListener("touchmove",d),l.current.removeEventListener("touchend",g))},Dn(function(){return t&&e.current.addEventListener("touchstart",m,{passive:!0}),function(){var v;(v=e.current)===null||v===void 0||v.removeEventListener("touchstart",m),f(),clearInterval(c.current)}},[t])}function b2(t){return Math.floor(Math.pow(t,.5))}function $_(t,e){var n="touches"in t?t.touches[0]:t;return n[e?"pageX":"pageY"]-window[e?"scrollX":"scrollY"]}function OL(t,e,n){_.useEffect(function(){var r=e.current;if(t&&r){var i=!1,s,l,c=function(){hr.cancel(s)},f=function v(){c(),s=hr(function(){n(l),v()})},d=function(S){if(!S.target.draggable){var E=S;E._virtualHandled||(E._virtualHandled=!0,i=!0)}},g=function(){i=!1,c()},m=function(S){if(i){var E=$_(S,!1),w=r.getBoundingClientRect(),b=w.top,A=w.bottom;if(E<=b){var T=b-E;l=-b2(T),f()}else if(E>=A){var C=E-A;l=b2(C),f()}else c()}};return r.addEventListener("mousedown",d),r.ownerDocument.addEventListener("mouseup",g),r.ownerDocument.addEventListener("mousemove",m),function(){r.removeEventListener("mousedown",d),r.ownerDocument.removeEventListener("mouseup",g),r.ownerDocument.removeEventListener("mousemove",m),c()}}},[t])}var PL=10;function NL(t,e,n,r,i,s,l,c){var f=_.useRef(),d=_.useState(null),g=de(d,2),m=g[0],v=g[1];return Dn(function(){if(m&&m.times=0;Y-=1){var ae=i(e[Y]),U=n.get(ae);if(U===void 0){T=!0;break}if(X-=U,X<=0)break}switch(x){case"top":M=F-b;break;case"bottom":M=L-A+b;break;default:{var z=t.current.scrollTop,W=z+A;FW&&(C="bottom")}}M!==null&&l(M),M!==m.lastTop&&(T=!0)}T&&v(J(J({},m),{},{times:m.times+1,targetAlign:C,lastTop:M}))}},[m,t.current]),function(S){if(S==null){c();return}if(hr.cancel(f.current),typeof S=="number")l(S);else if(S&&pt(S)==="object"){var E,w=S.align;"index"in S?E=S.index:E=e.findIndex(function(T){return i(T)===S.key});var b=S.offset,A=b===void 0?0:b;v({times:0,index:E,offset:A,originAlign:w})}}}var S2=_.forwardRef(function(t,e){var n=t.prefixCls,r=t.rtl,i=t.scrollOffset,s=t.scrollRange,l=t.onStartMove,c=t.onStopMove,f=t.onScroll,d=t.horizontal,g=t.spinSize,m=t.containerSize,v=t.style,S=t.thumbStyle,E=t.showScrollBar,w=_.useState(!1),b=de(w,2),A=b[0],T=b[1],C=_.useState(null),M=de(C,2),x=M[0],N=M[1],F=_.useState(null),L=de(F,2),I=L[0],V=L[1],B=!r,j=_.useRef(),X=_.useRef(),Y=_.useState(E),ae=de(Y,2),U=ae[0],z=ae[1],W=_.useRef(),Z=function(){E===!0||E===!1||(clearTimeout(W.current),z(!0),W.current=setTimeout(function(){z(!1)},3e3))},P=s-m||0,$=m-g||0,ie=_.useMemo(function(){if(i===0||P===0)return 0;var ve=i/P;return ve*$},[i,P,$]),se=function(ge){ge.stopPropagation(),ge.preventDefault()},q=_.useRef({top:ie,dragging:A,pageY:x,startTop:I});q.current={top:ie,dragging:A,pageY:x,startTop:I};var ce=function(ge){T(!0),N($_(ge,d)),V(q.current.top),l(),ge.stopPropagation(),ge.preventDefault()};_.useEffect(function(){var ve=function(Ee){Ee.preventDefault()},ge=j.current,_e=X.current;return ge.addEventListener("touchstart",ve,{passive:!1}),_e.addEventListener("touchstart",ce,{passive:!1}),function(){ge.removeEventListener("touchstart",ve),_e.removeEventListener("touchstart",ce)}},[]);var fe=_.useRef();fe.current=P;var ye=_.useRef();ye.current=$,_.useEffect(function(){if(A){var ve,ge=function(Ee){var xe=q.current,Ve=xe.dragging,Fe=xe.pageY,Be=xe.startTop;hr.cancel(ve);var nt=j.current.getBoundingClientRect(),He=m/(d?nt.width:nt.height);if(Ve){var Ge=($_(Ee,d)-Fe)*He,Pe=Be;!B&&d?Pe-=Ge:Pe+=Ge;var Me=fe.current,dt=ye.current,rt=dt?Pe/dt:0,it=Math.ceil(rt*Me);it=Math.max(it,0),it=Math.min(it,Me),ve=hr(function(){f(it,d)})}},_e=function(){T(!1),c()};return window.addEventListener("mousemove",ge,{passive:!0}),window.addEventListener("touchmove",ge,{passive:!0}),window.addEventListener("mouseup",_e,{passive:!0}),window.addEventListener("touchend",_e,{passive:!0}),function(){window.removeEventListener("mousemove",ge),window.removeEventListener("touchmove",ge),window.removeEventListener("mouseup",_e),window.removeEventListener("touchend",_e),hr.cancel(ve)}}},[A]),_.useEffect(function(){return Z(),function(){clearTimeout(W.current)}},[i]),_.useImperativeHandle(e,function(){return{delayHidden:Z}});var we="".concat(n,"-scrollbar"),Ae={position:"absolute",visibility:U?null:"hidden"},Te={position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"};return d?(Ae.height=8,Ae.left=0,Ae.right=0,Ae.bottom=0,Te.height="100%",Te.width=g,B?Te.left=ie:Te.right=ie):(Ae.width=8,Ae.top=0,Ae.bottom=0,B?Ae.right=0:Ae.left=0,Te.width="100%",Te.height=g,Te.top=ie),_.createElement("div",{ref:j,className:Ze(we,K(K(K({},"".concat(we,"-horizontal"),d),"".concat(we,"-vertical"),!d),"".concat(we,"-visible"),U)),style:J(J({},Ae),v),onMouseDown:se,onMouseMove:Z},_.createElement("div",{ref:X,className:Ze("".concat(we,"-thumb"),K({},"".concat(we,"-thumb-moving"),A)),style:J(J({},Te),S),onMouseDown:ce}))}),IL=20;function w2(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=t/e*t;return isNaN(n)&&(n=0),n=Math.max(n,IL),Math.floor(n)}var DL=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],FL=[],kL={overflowY:"auto",overflowAnchor:"none"};function BL(t,e){var n=t.prefixCls,r=n===void 0?"rc-virtual-list":n,i=t.className,s=t.height,l=t.itemHeight,c=t.fullHeight,f=c===void 0?!0:c,d=t.style,g=t.data,m=t.children,v=t.itemKey,S=t.virtual,E=t.direction,w=t.scrollWidth,b=t.component,A=b===void 0?"div":b,T=t.onScroll,C=t.onVirtualScroll,M=t.onVisibleChange,x=t.innerProps,N=t.extraRender,F=t.styles,L=t.showScrollBar,I=L===void 0?"optional":L,V=Fn(t,DL),B=_.useCallback(function(Ce){return typeof v=="function"?v(Ce):Ce==null?void 0:Ce[v]},[v]),j=xL(B),X=de(j,4),Y=X[0],ae=X[1],U=X[2],z=X[3],W=!!(S!==!1&&s&&l),Z=_.useMemo(function(){return Object.values(U.maps).reduce(function(Ce,Le){return Ce+Le},0)},[U.id,U.maps]),P=W&&g&&(Math.max(l*g.length,Z)>s||!!w),$=E==="rtl",ie=Ze(r,K({},"".concat(r,"-rtl"),$),i),se=g||FL,q=_.useRef(),ce=_.useRef(),fe=_.useRef(),ye=_.useState(0),we=de(ye,2),Ae=we[0],Te=we[1],ve=_.useState(0),ge=de(ve,2),_e=ge[0],Ie=ge[1],Ee=_.useState(!1),xe=de(Ee,2),Ve=xe[0],Fe=xe[1],Be=function(){Fe(!0)},nt=function(){Fe(!1)},He={getKey:B};function Ge(Ce){Te(function(Le){var De;typeof Ce=="function"?De=Ce(Le):De=Ce;var be=Lt(De);return q.current.scrollTop=be,be})}var Pe=_.useRef({start:0,end:se.length}),Me=_.useRef(),dt=TL(se,B),rt=de(dt,1),it=rt[0];Me.current=it;var st=_.useMemo(function(){if(!W)return{scrollHeight:void 0,start:0,end:se.length-1,offset:void 0};if(!P){var Ce;return{scrollHeight:((Ce=ce.current)===null||Ce===void 0?void 0:Ce.offsetHeight)||0,start:0,end:se.length-1,offset:void 0}}for(var Le=0,De,be,ut,zt=se.length,Ot=0;Ot=Ae&&De===void 0&&(De=Ot,be=Le),Pn>Ae+s&&ut===void 0&&(ut=Ot),Le=Pn}return De===void 0&&(De=0,be=0,ut=Math.ceil(s/l)),ut===void 0&&(ut=se.length-1),ut=Math.min(ut+1,se.length-1),{scrollHeight:Le,start:De,end:ut,offset:be}},[P,W,Ae,se,z,s]),at=st.scrollHeight,Je=st.start,lt=st.end,ft=st.offset;Pe.current.start=Je,Pe.current.end=lt,_.useLayoutEffect(function(){var Ce=U.getRecord();if(Ce.size===1){var Le=Array.from(Ce)[0],De=B(se[Je]);if(De===Le){var be=U.get(Le),ut=be-l;Ge(function(zt){return zt+ut})}}U.resetRecord()},[at]);var ct=_.useState({width:0,height:s}),mt=de(ct,2),xt=mt[0],Bt=mt[1],ht=function(Le){Bt({width:Le.offsetWidth,height:Le.offsetHeight})},Vt=_.useRef(),qt=_.useRef(),En=_.useMemo(function(){return w2(xt.width,w)},[xt.width,w]),Mn=_.useMemo(function(){return w2(xt.height,at)},[xt.height,at]),Ut=at-s,It=_.useRef(Ut);It.current=Ut;function Lt(Ce){var Le=Ce;return Number.isNaN(It.current)||(Le=Math.min(Le,It.current)),Le=Math.max(Le,0),Le}var Jt=Ae<=0,Mt=Ae>=Ut,qe=_e<=0,ke=_e>=w,Ne=Hx(Jt,Mt,qe,ke),wt=function(){return{x:$?-_e:_e,y:Ae}},en=_.useRef(wt()),Ue=dr(function(Ce){if(C){var Le=J(J({},wt()),Ce);(en.current.x!==Le.x||en.current.y!==Le.y)&&(C(Le),en.current=Le)}});function Oe(Ce,Le){var De=Ce;Le?($a.flushSync(function(){Ie(De)}),Ue()):Ge(De)}function je(Ce){var Le=Ce.currentTarget.scrollTop;Le!==Ae&&Ge(Le),T==null||T(Ce),Ue()}var Ye=function(Le){var De=Le,be=w?w-xt.width:0;return De=Math.max(De,0),De=Math.min(De,be),De},We=dr(function(Ce,Le){Le?($a.flushSync(function(){Ie(function(De){var be=De+($?-Ce:Ce);return Ye(be)})}),Ue()):Ge(function(De){var be=De+Ce;return be})}),Qe=AL(W,Jt,Mt,qe,ke,!!w,We),bt=de(Qe,2),_t=bt[0],Zt=bt[1];ML(W,q,function(Ce,Le,De,be){var ut=be;return Ne(Ce,Le,De)?!1:!ut||!ut._virtualHandled?(ut&&(ut._virtualHandled=!0),_t({preventDefault:function(){},deltaX:Ce?Le:0,deltaY:Ce?0:Le}),!0):!1}),OL(P,q,function(Ce){Ge(function(Le){return Le+Ce})}),Dn(function(){function Ce(De){var be=Jt&&De.detail<0,ut=Mt&&De.detail>0;W&&!be&&!ut&&De.preventDefault()}var Le=q.current;return Le.addEventListener("wheel",_t,{passive:!1}),Le.addEventListener("DOMMouseScroll",Zt,{passive:!0}),Le.addEventListener("MozMousePixelScroll",Ce,{passive:!1}),function(){Le.removeEventListener("wheel",_t),Le.removeEventListener("DOMMouseScroll",Zt),Le.removeEventListener("MozMousePixelScroll",Ce)}},[W,Jt,Mt]),Dn(function(){if(w){var Ce=Ye(_e);Ie(Ce),Ue({x:Ce})}},[xt.width,w]);var Yt=function(){var Le,De;(Le=Vt.current)===null||Le===void 0||Le.delayHidden(),(De=qt.current)===null||De===void 0||De.delayHidden()},vn=NL(q,se,U,l,B,function(){return ae(!0)},Ge,Yt);_.useImperativeHandle(e,function(){return{nativeElement:fe.current,getScrollInfo:wt,scrollTo:function(Le){function De(be){return be&&pt(be)==="object"&&("left"in be||"top"in be)}De(Le)?(Le.left!==void 0&&Ie(Ye(Le.left)),vn(Le.top)):vn(Le)}}}),Dn(function(){if(M){var Ce=se.slice(Je,lt+1);M(Ce,se)}},[Je,lt,se]);var On=CL(se,B,U,l),_n=N==null?void 0:N({start:Je,end:lt,virtual:P,offsetX:_e,offsetY:ft,rtl:$,getSize:On}),Zn=wL(se,Je,lt,w,_e,Y,m,He),un=null;s&&(un=J(K({},f?"height":"maxHeight",s),kL),W&&(un.overflowY="hidden",w&&(un.overflowX="hidden"),Ve&&(un.pointerEvents="none")));var rn={};return $&&(rn.dir="rtl"),_.createElement("div",kt({ref:fe,style:J(J({},d),{},{position:"relative"}),className:ie},rn,V),_.createElement(Go,{onResize:ht},_.createElement(A,{className:"".concat(r,"-holder"),style:un,ref:q,onScroll:je,onMouseEnter:Yt},_.createElement(Vx,{prefixCls:r,height:at,offsetX:_e,offsetY:ft,scrollWidth:w,onInnerResize:ae,ref:ce,innerProps:x,rtl:$,extra:_n},Zn))),P&&at>s&&_.createElement(S2,{ref:Vt,prefixCls:r,scrollOffset:Ae,scrollRange:at,rtl:$,onScroll:Oe,onStartMove:Be,onStopMove:nt,spinSize:Mn,containerSize:xt.height,style:F==null?void 0:F.verticalScrollBar,thumbStyle:F==null?void 0:F.verticalScrollBarThumb,showScrollBar:I}),P&&w>xt.width&&_.createElement(S2,{ref:qt,prefixCls:r,scrollOffset:_e,scrollRange:w,rtl:$,onScroll:Oe,onStartMove:Be,onStopMove:nt,spinSize:En,containerSize:xt.width,horizontal:!0,style:F==null?void 0:F.horizontalScrollBar,thumbStyle:F==null?void 0:F.horizontalScrollBarThumb,showScrollBar:I}))}var jx=_.forwardRef(BL);jx.displayName="List";function UL(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var LL=["disabled","title","children","style","className"];function E2(t){return typeof t=="string"||typeof t=="number"}var zL=function(e,n){var r=CU(),i=r.prefixCls,s=r.id,l=r.open,c=r.multiple,f=r.mode,d=r.searchValue,g=r.toggleOpen,m=r.notFoundContent,v=r.onPopupScroll,S=_.useContext(mb),E=S.maxCount,w=S.flattenOptions,b=S.onActiveValue,A=S.defaultActiveFirstOption,T=S.onSelect,C=S.menuItemSelectedIcon,M=S.rawValues,x=S.fieldNames,N=S.virtual,F=S.direction,L=S.listHeight,I=S.listItemHeight,V=S.optionRender,B="".concat(i,"-item"),j=ap(function(){return w},[l,w],function(ve,ge){return ge[0]&&ve[1]!==ge[1]}),X=_.useRef(null),Y=_.useMemo(function(){return c&&U_(E)&&(M==null?void 0:M.size)>=E},[c,E,M==null?void 0:M.size]),ae=function(ge){ge.preventDefault()},U=function(ge){var _e;(_e=X.current)===null||_e===void 0||_e.scrollTo(typeof ge=="number"?{index:ge}:ge)},z=_.useCallback(function(ve){return f==="combobox"?!1:M.has(ve)},[f,ze(M).toString(),M.size]),W=function(ge){for(var _e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Ie=j.length,Ee=0;Ee1&&arguments[1]!==void 0?arguments[1]:!1;ie(ge);var Ie={source:_e?"keyboard":"mouse"},Ee=j[ge];if(!Ee){b(null,-1,Ie);return}b(Ee.value,ge,Ie)};_.useEffect(function(){se(A!==!1?W(0):-1)},[j.length,d]);var q=_.useCallback(function(ve){return f==="combobox"?String(ve).toLowerCase()===d.toLowerCase():M.has(ve)},[f,d,ze(M).toString(),M.size]);_.useEffect(function(){var ve=setTimeout(function(){if(!c&&l&&M.size===1){var _e=Array.from(M)[0],Ie=j.findIndex(function(Ee){var xe=Ee.data;return xe.value===_e});Ie!==-1&&(se(Ie),U(Ie))}});if(l){var ge;(ge=X.current)===null||ge===void 0||ge.scrollTo(void 0)}return function(){return clearTimeout(ve)}},[l,d]);var ce=function(ge){ge!==void 0&&T(ge,{selected:!M.has(ge)}),c||g(!1)};if(_.useImperativeHandle(n,function(){return{onKeyDown:function(ge){var _e=ge.which,Ie=ge.ctrlKey;switch(_e){case et.N:case et.P:case et.UP:case et.DOWN:{var Ee=0;if(_e===et.UP?Ee=-1:_e===et.DOWN?Ee=1:UL()&&Ie&&(_e===et.N?Ee=1:_e===et.P&&(Ee=-1)),Ee!==0){var xe=W($+Ee,Ee);U(xe),se(xe,!0)}break}case et.TAB:case et.ENTER:{var Ve,Fe=j[$];Fe&&!(Fe!=null&&(Ve=Fe.data)!==null&&Ve!==void 0&&Ve.disabled)&&!Y?ce(Fe.value):ce(void 0),l&&ge.preventDefault();break}case et.ESC:g(!1),l&&ge.stopPropagation()}},onKeyUp:function(){},scrollTo:function(ge){U(ge)}}}),j.length===0)return _.createElement("div",{role:"listbox",id:"".concat(s,"_list"),className:"".concat(B,"-empty"),onMouseDown:ae},m);var fe=Object.keys(x).map(function(ve){return x[ve]}),ye=function(ge){return ge.label};function we(ve,ge){var _e=ve.group;return{role:_e?"presentation":"option",id:"".concat(s,"_list_").concat(ge)}}var Ae=function(ge){var _e=j[ge];if(!_e)return null;var Ie=_e.data||{},Ee=Ie.value,xe=_e.group,Ve=og(Ie,!0),Fe=ye(_e);return _e?_.createElement("div",kt({"aria-label":typeof Fe=="string"&&!xe?Fe:null},Ve,{key:ge},we(_e,ge),{"aria-selected":q(Ee)}),Ee):null},Te={role:"listbox",id:"".concat(s,"_list")};return _.createElement(_.Fragment,null,N&&_.createElement("div",kt({},Te,{style:{height:0,width:0,overflow:"hidden"}}),Ae($-1),Ae($),Ae($+1)),_.createElement(jx,{itemKey:"key",ref:X,data:j,height:L,itemHeight:I,fullHeight:!1,onMouseDown:ae,onScroll:v,virtual:N,direction:F,innerProps:N?null:Te},function(ve,ge){var _e=ve.group,Ie=ve.groupOption,Ee=ve.data,xe=ve.label,Ve=ve.value,Fe=Ee.key;if(_e){var Be,nt=(Be=Ee.title)!==null&&Be!==void 0?Be:E2(xe)?xe.toString():void 0;return _.createElement("div",{className:Ze(B,"".concat(B,"-group"),Ee.className),title:nt},xe!==void 0?xe:Fe)}var He=Ee.disabled,Ge=Ee.title;Ee.children;var Pe=Ee.style,Me=Ee.className,dt=Fn(Ee,LL),rt=gx(dt,fe),it=z(Ve),st=He||!it&&Y,at="".concat(B,"-option"),Je=Ze(B,at,Me,K(K(K(K({},"".concat(at,"-grouped"),Ie),"".concat(at,"-active"),$===ge&&!st),"".concat(at,"-disabled"),st),"".concat(at,"-selected"),it)),lt=ye(ve),ft=!C||typeof C=="function"||it,ct=typeof lt=="number"?lt:lt||Ve,mt=E2(ct)?ct.toString():void 0;return Ge!==void 0&&(mt=Ge),_.createElement("div",kt({},og(rt),N?{}:we(ve,ge),{"aria-selected":q(Ve),className:Je,title:mt,onMouseMove:function(){$===ge||st||se(ge)},onClick:function(){st||ce(Ve)},style:Pe}),_.createElement("div",{className:"".concat(at,"-content")},typeof V=="function"?V(ve,{index:ge}):ct),_.isValidElement(C)||it,ft&&_.createElement(pp,{className:"".concat(B,"-option-state"),customizeIcon:C,customizeIconProps:{value:Ve,disabled:st,isSelected:it}},it?"✓":null))}))},$L=_.forwardRef(zL);const VL=function(t,e){var n=_.useRef({values:new Map,options:new Map}),r=_.useMemo(function(){var s=n.current,l=s.values,c=s.options,f=t.map(function(m){if(m.label===void 0){var v;return J(J({},m),{},{label:(v=l.get(m.value))===null||v===void 0?void 0:v.label})}return m}),d=new Map,g=new Map;return f.forEach(function(m){d.set(m.value,m),g.set(m.value,e.get(m.value)||c.get(m.value))}),n.current.values=d,n.current.options=g,f},[t,e]),i=_.useCallback(function(s){return e.get(s)||n.current.options.get(s)},[e]);return[r,i]};function Zv(t,e){return Ux(t).join("").toUpperCase().includes(e)}const HL=function(t,e,n,r,i){return _.useMemo(function(){if(!n||r===!1)return t;var s=e.options,l=e.label,c=e.value,f=[],d=typeof r=="function",g=n.toUpperCase(),m=d?r:function(S,E){return i?Zv(E[i],g):E[s]?Zv(E[l!=="children"?l:"label"],g):Zv(E[c],g)},v=d?function(S){return L_(S)}:function(S){return S};return t.forEach(function(S){if(S[s]){var E=m(n,v(S));if(E)f.push(S);else{var w=S[s].filter(function(b){return m(n,v(b))});w.length&&f.push(J(J({},S),{},K({},s,w)))}return}m(n,v(S))&&f.push(S)}),f},[t,r,i,n,e])};var T2=0,jL=Qr();function WL(){var t;return jL?(t=T2,T2+=1):t="TEST_OR_SSR",t}function XL(t){var e=_.useState(),n=de(e,2),r=n[0],i=n[1];return _.useEffect(function(){i("rc_select_".concat(WL()))},[]),t||r}var qL=["children","value"],YL=["children"];function KL(t){var e=t,n=e.key,r=e.props,i=r.children,s=r.value,l=Fn(r,qL);return J({key:n,value:s!==void 0?s:n,children:i},l)}function Wx(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Ho(t).map(function(n,r){if(!_.isValidElement(n)||!n.type)return null;var i=n,s=i.type.isSelectOptGroup,l=i.key,c=i.props,f=c.children,d=Fn(c,YL);return e||!s?KL(n):J(J({key:"__RC_SELECT_GRP__".concat(l===null?r:l,"__"),label:l},d),{},{options:Wx(f)})}).filter(function(n){return n})}var ZL=function(e,n,r,i,s){return _.useMemo(function(){var l=e,c=!e;c&&(l=Wx(n));var f=new Map,d=new Map,g=function(S,E,w){w&&typeof w=="string"&&S.set(E[w],E)},m=function v(S){for(var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,w=0;w0?Ue(Ye.options):Ye.options}):Ye})},ct=_.useMemo(function(){return T?ft(lt):lt},[lt,T,Te]),mt=_.useMemo(function(){return pL(ct,{fieldNames:ye,childrenAsData:ce})},[ct,ye,ce]),xt=function(Oe){var je=xe(Oe);if(nt(je),P&&(je.length!==Me.length||je.some(function(Qe,bt){var _t;return((_t=Me[bt])===null||_t===void 0?void 0:_t.value)!==(Qe==null?void 0:Qe.value)}))){var Ye=Z?je:je.map(function(Qe){return Qe.value}),We=je.map(function(Qe){return L_(dt(Qe.value))});P(q?Ye:Ye[0],q?We:We[0])}},Bt=_.useState(null),ht=de(Bt,2),Vt=ht[0],qt=ht[1],En=_.useState(0),Mn=de(En,2),Ut=Mn[0],It=Mn[1],Lt=L!==void 0?L:r!=="combobox",Jt=_.useCallback(function(Ue,Oe){var je=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Ye=je.source,We=Ye===void 0?"keyboard":Ye;It(Oe),l&&r==="combobox"&&Ue!==null&&We==="keyboard"&&qt(String(Ue))},[l,r]),Mt=function(Oe,je,Ye){var We=function(){var un,rn=dt(Oe);return[Z?{label:rn==null?void 0:rn[ye.label],value:Oe,key:(un=rn==null?void 0:rn.key)!==null&&un!==void 0?un:Oe}:Oe,L_(rn)]};if(je&&S){var Qe=We(),bt=de(Qe,2),_t=bt[0],Zt=bt[1];S(_t,Zt)}else if(!je&&E&&Ye!=="clear"){var Yt=We(),vn=de(Yt,2),On=vn[0],_n=vn[1];E(On,_n)}},qe=A2(function(Ue,Oe){var je,Ye=q?Oe.selected:!0;Ye?je=q?[].concat(ze(Me),[Ue]):[Ue]:je=Me.filter(function(We){return We.value!==Ue}),xt(je),Mt(Ue,Ye),r==="combobox"?qt(""):(!z_||v)&&(ve(""),qt(""))}),ke=function(Oe,je){xt(Oe);var Ye=je.type,We=je.values;(Ye==="remove"||Ye==="clear")&&We.forEach(function(Qe){Mt(Qe.value,!1,Ye)})},Ne=function(Oe,je){if(ve(Oe),qt(null),je.source==="submit"){var Ye=(Oe||"").trim();if(Ye){var We=Array.from(new Set([].concat(ze(it),[Ye])));xt(We),Mt(Ye,!0),ve("")}return}je.source!=="blur"&&(r==="combobox"&&xt(Oe),g==null||g(Oe))},wt=function(Oe){var je=Oe;r!=="tags"&&(je=Oe.map(function(We){var Qe=Ie.get(We);return Qe==null?void 0:Qe.value}).filter(function(We){return We!==void 0}));var Ye=Array.from(new Set([].concat(ze(it),ze(je))));xt(Ye),Ye.forEach(function(We){Mt(We,!0)})},en=_.useMemo(function(){var Ue=V!==!1&&b!==!1;return J(J({},ge),{},{flattenOptions:mt,onActiveValue:Jt,defaultActiveFirstOption:Lt,onSelect:qe,menuItemSelectedIcon:I,rawValues:it,fieldNames:ye,virtual:Ue,direction:B,listHeight:X,listItemHeight:ae,childrenAsData:ce,maxCount:$,optionRender:N})},[$,ge,mt,Jt,Lt,qe,I,it,ye,V,b,B,X,ae,ce,N]);return _.createElement(mb.Provider,{value:en},_.createElement(bL,kt({},ie,{id:se,prefixCls:s,ref:e,omitDomProps:GL,mode:r,displayValues:rt,onDisplayValuesChange:ke,direction:B,searchValue:Te,onSearch:Ne,autoClearSearchValue:v,onSearchSplit:wt,dropdownMatchSelectWidth:b,OptionList:$L,emptyOptions:!mt.length,activeValue:Vt,activeDescendantId:"".concat(se,"_list_").concat(Ut)})))}),yb=e7;yb.Option=_b;yb.OptGroup=vb;function t7(t,e,n){return Ze({[`${t}-status-success`]:e==="success",[`${t}-status-warning`]:e==="warning",[`${t}-status-error`]:e==="error",[`${t}-status-validating`]:e==="validating",[`${t}-has-feedback`]:n})}const n7=(t,e)=>e||t,r7=()=>{const[,t]=Xs(),[e]=cb("Empty"),r=new wn(t.colorBgBase).toHsl().l<.5?{opacity:.65}:{};return _.createElement("svg",{style:r,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg"},_.createElement("title",null,(e==null?void 0:e.description)||"Empty"),_.createElement("g",{fill:"none",fillRule:"evenodd"},_.createElement("g",{transform:"translate(24 31.67)"},_.createElement("ellipse",{fillOpacity:".8",fill:"#F5F5F7",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),_.createElement("path",{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",fill:"#AEB8C2"}),_.createElement("path",{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",fill:"url(#linearGradient-1)",transform:"translate(13.56)"}),_.createElement("path",{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",fill:"#F5F5F7"}),_.createElement("path",{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",fill:"#DCE0E6"})),_.createElement("path",{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",fill:"#DCE0E6"}),_.createElement("g",{transform:"translate(149.65 15.383)",fill:"#FFF"},_.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),_.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"}))))},i7=()=>{const[,t]=Xs(),[e]=cb("Empty"),{colorFill:n,colorFillTertiary:r,colorFillQuaternary:i,colorBgContainer:s}=t,{borderColor:l,shadowColor:c,contentColor:f}=_.useMemo(()=>({borderColor:new wn(n).onBackground(s).toHexString(),shadowColor:new wn(r).onBackground(s).toHexString(),contentColor:new wn(i).onBackground(s).toHexString()}),[n,r,i,s]);return _.createElement("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},_.createElement("title",null,(e==null?void 0:e.description)||"Empty"),_.createElement("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd"},_.createElement("ellipse",{fill:c,cx:"32",cy:"33",rx:"32",ry:"7"}),_.createElement("g",{fillRule:"nonzero",stroke:l},_.createElement("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"}),_.createElement("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",fill:f}))))},s7=t=>{const{componentCls:e,margin:n,marginXS:r,marginXL:i,fontSize:s,lineHeight:l}=t;return{[e]:{marginInline:r,fontSize:s,lineHeight:l,textAlign:"center",[`${e}-image`]:{height:t.emptyImgHeight,marginBottom:r,opacity:t.opacityImage,img:{height:"100%"},svg:{maxWidth:"100%",height:"100%",margin:"auto"}},[`${e}-description`]:{color:t.colorTextDescription},[`${e}-footer`]:{marginTop:n},"&-normal":{marginBlock:i,color:t.colorTextDescription,[`${e}-description`]:{color:t.colorTextDescription},[`${e}-image`]:{height:t.emptyImgHeightMD}},"&-small":{marginBlock:r,color:t.colorTextDescription,[`${e}-image`]:{height:t.emptyImgHeightSM}}}}},a7=jc("Empty",t=>{const{componentCls:e,controlHeightLG:n,calc:r}=t,i=fi(t,{emptyImgCls:`${e}-img`,emptyImgHeight:r(n).mul(2.5).equal(),emptyImgHeightMD:n,emptyImgHeightSM:r(n).mul(.875).equal()});return[s7(i)]});var o7=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{const{className:e,rootClassName:n,prefixCls:r,image:i=Xx,description:s,children:l,imageStyle:c,style:f,classNames:d,styles:g}=t,m=o7(t,["className","rootClassName","prefixCls","image","description","children","imageStyle","style","classNames","styles"]),{getPrefixCls:v,direction:S,className:E,style:w,classNames:b,styles:A}=Vc("empty"),T=v("empty",r),[C,M,x]=a7(T),[N]=cb("Empty"),F=typeof s<"u"?s:N==null?void 0:N.description,L=typeof F=="string"?F:"empty";let I=null;return typeof i=="string"?I=_.createElement("img",{alt:L,src:i}):I=i,C(_.createElement("div",Object.assign({className:Ze(M,x,T,E,{[`${T}-normal`]:i===qx,[`${T}-rtl`]:S==="rtl"},e,n,b.root,d==null?void 0:d.root),style:Object.assign(Object.assign(Object.assign(Object.assign({},A.root),w),g==null?void 0:g.root),f)},m),_.createElement("div",{className:Ze(`${T}-image`,b.image,d==null?void 0:d.image),style:Object.assign(Object.assign(Object.assign({},c),A.image),g==null?void 0:g.image)},I),F&&_.createElement("div",{className:Ze(`${T}-description`,b.description,d==null?void 0:d.description),style:Object.assign(Object.assign({},A.description),g==null?void 0:g.description)},F),l&&_.createElement("div",{className:Ze(`${T}-footer`,b.footer,d==null?void 0:d.footer),style:Object.assign(Object.assign({},A.footer),g==null?void 0:g.footer)},l)))};_o.PRESENTED_IMAGE_DEFAULT=Xx;_o.PRESENTED_IMAGE_SIMPLE=qx;const l7=t=>{const{componentName:e}=t,{getPrefixCls:n}=_.useContext(ui),r=n("empty");switch(e){case"Table":case"List":return Ft.createElement(_o,{image:_o.PRESENTED_IMAGE_SIMPLE});case"Select":case"TreeSelect":case"Cascader":case"Transfer":case"Mentions":return Ft.createElement(_o,{image:_o.PRESENTED_IMAGE_SIMPLE,className:`${r}-small`});case"Table.filter":return null;default:return Ft.createElement(_o,null)}},c7=function(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;var r,i;const{variant:s,[t]:l}=_.useContext(ui),c=_.useContext(SU),f=l==null?void 0:l.variant;let d;typeof e<"u"?d=e:n===!1?d="borderless":d=(i=(r=c??f)!==null&&r!==void 0?r:s)!==null&&i!==void 0?i:"outlined";const g=ZF.includes(d);return[d,g]},u7=t=>{const n={overflow:{adjustX:!0,adjustY:!0,shiftY:!0},htmlRegion:t==="scroll"?"scroll":"visible",dynamicInset:!0};return{bottomLeft:Object.assign(Object.assign({},n),{points:["tl","bl"],offset:[0,4]}),bottomRight:Object.assign(Object.assign({},n),{points:["tr","br"],offset:[0,4]}),topLeft:Object.assign(Object.assign({},n),{points:["bl","tl"],offset:[0,-4]}),topRight:Object.assign(Object.assign({},n),{points:["br","tr"],offset:[0,-4]})}};function f7(t,e){return t||u7(e)}const C2=t=>{const{optionHeight:e,optionFontSize:n,optionLineHeight:r,optionPadding:i}=t;return{position:"relative",display:"block",minHeight:e,padding:i,color:t.colorText,fontWeight:"normal",fontSize:n,lineHeight:r,boxSizing:"border-box"}},d7=t=>{const{antCls:e,componentCls:n}=t,r=`${n}-item`,i=`&${e}-slide-up-enter${e}-slide-up-enter-active`,s=`&${e}-slide-up-appear${e}-slide-up-appear-active`,l=`&${e}-slide-up-leave${e}-slide-up-leave-active`,c=`${n}-dropdown-placement-`,f=`${r}-option-selected`;return[{[`${n}-dropdown`]:Object.assign(Object.assign({},Hc(t)),{position:"absolute",top:-9999,zIndex:t.zIndexPopup,boxSizing:"border-box",padding:t.paddingXXS,overflow:"hidden",fontSize:t.fontSize,fontVariant:"initial",backgroundColor:t.colorBgElevated,borderRadius:t.borderRadiusLG,outline:"none",boxShadow:t.boxShadowSecondary,[` + ${i}${c}bottomLeft, + ${s}${c}bottomLeft + `]:{animationName:_x},[` + ${i}${c}topLeft, + ${s}${c}topLeft, + ${i}${c}topRight, + ${s}${c}topRight + `]:{animationName:bx},[`${l}${c}bottomLeft`]:{animationName:yx},[` + ${l}${c}topLeft, + ${l}${c}topRight + `]:{animationName:Sx},"&-hidden":{display:"none"},[r]:Object.assign(Object.assign({},C2(t)),{cursor:"pointer",transition:`background ${t.motionDurationSlow} ease`,borderRadius:t.borderRadiusSM,"&-group":{color:t.colorTextDescription,fontSize:t.fontSizeSM,cursor:"default"},"&-option":{display:"flex","&-content":Object.assign({flex:"auto"},b_),"&-state":{flex:"none",display:"flex",alignItems:"center"},[`&-active:not(${r}-option-disabled)`]:{backgroundColor:t.optionActiveBg},[`&-selected:not(${r}-option-disabled)`]:{color:t.optionSelectedColor,fontWeight:t.optionSelectedFontWeight,backgroundColor:t.optionSelectedBg,[`${r}-option-state`]:{color:t.colorPrimary}},"&-disabled":{[`&${r}-option-selected`]:{backgroundColor:t.colorBgContainerDisabled},color:t.colorTextDisabled,cursor:"not-allowed"},"&-grouped":{paddingInlineStart:t.calc(t.controlPaddingHorizontal).mul(2).equal()}},"&-empty":Object.assign(Object.assign({},C2(t)),{color:t.colorTextDisabled})}),[`${f}:has(+ ${f})`]:{borderEndStartRadius:0,borderEndEndRadius:0,[`& + ${f}`]:{borderStartStartRadius:0,borderStartEndRadius:0}},"&-rtl":{direction:"rtl"}})},HT(t,"slide-up"),HT(t,"slide-down"),VT(t,"move-up"),VT(t,"move-down")]},h7=t=>{const{multipleSelectItemHeight:e,paddingXXS:n,lineWidth:r,INTERNAL_FIXED_ITEM_MARGIN:i}=t,s=t.max(t.calc(n).sub(r).equal(),0),l=t.max(t.calc(s).sub(i).equal(),0);return{basePadding:s,containerPadding:l,itemHeight:Rt(e),itemLineHeight:Rt(t.calc(e).sub(t.calc(t.lineWidth).mul(2)).equal())}},g7=t=>{const{multipleSelectItemHeight:e,selectHeight:n,lineWidth:r}=t;return t.calc(n).sub(e).div(2).sub(r).equal()},p7=t=>{const{componentCls:e,iconCls:n,borderRadiusSM:r,motionDurationSlow:i,paddingXS:s,multipleItemColorDisabled:l,multipleItemBorderColorDisabled:c,colorIcon:f,colorIconHover:d,INTERNAL_FIXED_ITEM_MARGIN:g}=t;return{[`${e}-selection-overflow`]:{position:"relative",display:"flex",flex:"auto",flexWrap:"wrap",maxWidth:"100%","&-item":{flex:"none",alignSelf:"center",maxWidth:"100%",display:"inline-flex"},[`${e}-selection-item`]:{display:"flex",alignSelf:"center",flex:"none",boxSizing:"border-box",maxWidth:"100%",marginBlock:g,borderRadius:r,cursor:"default",transition:`font-size ${i}, line-height ${i}, height ${i}`,marginInlineEnd:t.calc(g).mul(2).equal(),paddingInlineStart:s,paddingInlineEnd:t.calc(s).div(2).equal(),[`${e}-disabled&`]:{color:l,borderColor:c,cursor:"not-allowed"},"&-content":{display:"inline-block",marginInlineEnd:t.calc(s).div(2).equal(),overflow:"hidden",whiteSpace:"pre",textOverflow:"ellipsis"},"&-remove":Object.assign(Object.assign({},fb()),{display:"inline-flex",alignItems:"center",color:f,fontWeight:"bold",fontSize:10,lineHeight:"inherit",cursor:"pointer",[`> ${n}`]:{verticalAlign:"-0.2em"},"&:hover":{color:d}})}}}},m7=(t,e)=>{const{componentCls:n,INTERNAL_FIXED_ITEM_MARGIN:r}=t,i=`${n}-selection-overflow`,s=t.multipleSelectItemHeight,l=g7(t),c=e?`${n}-${e}`:"",f=h7(t);return{[`${n}-multiple${c}`]:Object.assign(Object.assign({},p7(t)),{[`${n}-selector`]:{display:"flex",alignItems:"center",width:"100%",height:"100%",paddingInline:f.basePadding,paddingBlock:f.containerPadding,borderRadius:t.borderRadius,[`${n}-disabled&`]:{background:t.multipleSelectorBgDisabled,cursor:"not-allowed"},"&:after":{display:"inline-block",width:0,margin:`${Rt(r)} 0`,lineHeight:Rt(s),visibility:"hidden",content:'"\\a0"'}},[`${n}-selection-item`]:{height:f.itemHeight,lineHeight:Rt(f.itemLineHeight)},[`${n}-selection-wrap`]:{alignSelf:"flex-start","&:after":{lineHeight:Rt(s),marginBlock:r}},[`${n}-prefix`]:{marginInlineStart:t.calc(t.inputPaddingHorizontalBase).sub(f.basePadding).equal()},[`${i}-item + ${i}-item, + ${n}-prefix + ${n}-selection-wrap + `]:{[`${n}-selection-search`]:{marginInlineStart:0},[`${n}-selection-placeholder`]:{insetInlineStart:0}},[`${i}-item-suffix`]:{minHeight:f.itemHeight,marginBlock:r},[`${n}-selection-search`]:{display:"inline-flex",position:"relative",maxWidth:"100%",marginInlineStart:t.calc(t.inputPaddingHorizontalBase).sub(l).equal(),"\n &-input,\n &-mirror\n ":{height:s,fontFamily:t.fontFamily,lineHeight:Rt(s),transition:`all ${t.motionDurationSlow}`},"&-input":{width:"100%",minWidth:4.1},"&-mirror":{position:"absolute",top:0,insetInlineStart:0,insetInlineEnd:"auto",zIndex:999,whiteSpace:"pre",visibility:"hidden"}},[`${n}-selection-placeholder`]:{position:"absolute",top:"50%",insetInlineStart:t.calc(t.inputPaddingHorizontalBase).sub(f.basePadding).equal(),insetInlineEnd:t.inputPaddingHorizontalBase,transform:"translateY(-50%)",transition:`all ${t.motionDurationSlow}`}})}};function Qv(t,e){const{componentCls:n}=t,r=e?`${n}-${e}`:"",i={[`${n}-multiple${r}`]:{fontSize:t.fontSize,[`${n}-selector`]:{[`${n}-show-search&`]:{cursor:"text"}},[` + &${n}-show-arrow ${n}-selector, + &${n}-allow-clear ${n}-selector + `]:{paddingInlineEnd:t.calc(t.fontSizeIcon).add(t.controlPaddingHorizontal).equal()}}};return[m7(t,e),i]}const v7=t=>{const{componentCls:e}=t,n=fi(t,{selectHeight:t.controlHeightSM,multipleSelectItemHeight:t.multipleItemHeightSM,borderRadius:t.borderRadiusSM,borderRadiusSM:t.borderRadiusXS}),r=fi(t,{fontSize:t.fontSizeLG,selectHeight:t.controlHeightLG,multipleSelectItemHeight:t.multipleItemHeightLG,borderRadius:t.borderRadiusLG,borderRadiusSM:t.borderRadius});return[Qv(t),Qv(n,"sm"),{[`${e}-multiple${e}-sm`]:{[`${e}-selection-placeholder`]:{insetInline:t.calc(t.controlPaddingHorizontalSM).sub(t.lineWidth).equal()},[`${e}-selection-search`]:{marginInlineStart:2}}},Qv(r,"lg")]};function Gv(t,e){const{componentCls:n,inputPaddingHorizontalBase:r,borderRadius:i}=t,s=t.calc(t.controlHeight).sub(t.calc(t.lineWidth).mul(2)).equal(),l=e?`${n}-${e}`:"";return{[`${n}-single${l}`]:{fontSize:t.fontSize,height:t.controlHeight,[`${n}-selector`]:Object.assign(Object.assign({},Hc(t,!0)),{display:"flex",borderRadius:i,flex:"1 1 auto",[`${n}-selection-search`]:{position:"absolute",inset:0,width:"100%","&-input":{width:"100%",WebkitAppearance:"textfield"}},[` + ${n}-selection-item, + ${n}-selection-placeholder + `]:{display:"block",padding:0,lineHeight:Rt(s),transition:`all ${t.motionDurationSlow}, visibility 0s`,alignSelf:"center"},[`${n}-selection-placeholder`]:{transition:"none",pointerEvents:"none"},[["&:after",`${n}-selection-item:empty:after`,`${n}-selection-placeholder:empty:after`].join(",")]:{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'}}),[` + &${n}-show-arrow ${n}-selection-item, + &${n}-show-arrow ${n}-selection-search, + &${n}-show-arrow ${n}-selection-placeholder + `]:{paddingInlineEnd:t.showArrowPaddingInlineEnd},[`&${n}-open ${n}-selection-item`]:{color:t.colorTextPlaceholder},[`&:not(${n}-customize-input)`]:{[`${n}-selector`]:{width:"100%",height:"100%",alignItems:"center",padding:`0 ${Rt(r)}`,[`${n}-selection-search-input`]:{height:s},"&:after":{lineHeight:Rt(s)}}},[`&${n}-customize-input`]:{[`${n}-selector`]:{"&:after":{display:"none"},[`${n}-selection-search`]:{position:"static",width:"100%"},[`${n}-selection-placeholder`]:{position:"absolute",insetInlineStart:0,insetInlineEnd:0,padding:`0 ${Rt(r)}`,"&:after":{display:"none"}}}}}}}function _7(t){const{componentCls:e}=t,n=t.calc(t.controlPaddingHorizontalSM).sub(t.lineWidth).equal();return[Gv(t),Gv(fi(t,{controlHeight:t.controlHeightSM,borderRadius:t.borderRadiusSM}),"sm"),{[`${e}-single${e}-sm`]:{[`&:not(${e}-customize-input)`]:{[`${e}-selector`]:{padding:`0 ${Rt(n)}`},[`&${e}-show-arrow ${e}-selection-search`]:{insetInlineEnd:t.calc(n).add(t.calc(t.fontSize).mul(1.5)).equal()},[` + &${e}-show-arrow ${e}-selection-item, + &${e}-show-arrow ${e}-selection-placeholder + `]:{paddingInlineEnd:t.calc(t.fontSize).mul(1.5).equal()}}}},Gv(fi(t,{controlHeight:t.singleItemHeightLG,fontSize:t.fontSizeLG,borderRadius:t.borderRadiusLG}),"lg")]}const y7=t=>{const{fontSize:e,lineHeight:n,lineWidth:r,controlHeight:i,controlHeightSM:s,controlHeightLG:l,paddingXXS:c,controlPaddingHorizontal:f,zIndexPopupBase:d,colorText:g,fontWeightStrong:m,controlItemBgActive:v,controlItemBgHover:S,colorBgContainer:E,colorFillSecondary:w,colorBgContainerDisabled:b,colorTextDisabled:A,colorPrimaryHover:T,colorPrimary:C,controlOutline:M}=t,x=c*2,N=r*2,F=Math.min(i-x,i-N),L=Math.min(s-x,s-N),I=Math.min(l-x,l-N);return{INTERNAL_FIXED_ITEM_MARGIN:Math.floor(c/2),zIndexPopup:d+50,optionSelectedColor:g,optionSelectedFontWeight:m,optionSelectedBg:v,optionActiveBg:S,optionPadding:`${(i-e*n)/2}px ${f}px`,optionFontSize:e,optionLineHeight:n,optionHeight:i,selectorBg:E,clearBg:E,singleItemHeightLG:l,multipleItemBg:w,multipleItemBorderColor:"transparent",multipleItemHeight:F,multipleItemHeightSM:L,multipleItemHeightLG:I,multipleSelectorBgDisabled:b,multipleItemColorDisabled:A,multipleItemBorderColorDisabled:"transparent",showArrowPaddingInlineEnd:Math.ceil(t.fontSize*1.25),hoverBorderColor:T,activeBorderColor:C,activeOutlineColor:M,selectAffixPadding:c}},Yx=(t,e)=>{const{componentCls:n,antCls:r,controlOutlineWidth:i}=t;return{[`&:not(${n}-customize-input) ${n}-selector`]:{border:`${Rt(t.lineWidth)} ${t.lineType} ${e.borderColor}`,background:t.selectorBg},[`&:not(${n}-disabled):not(${n}-customize-input):not(${r}-pagination-size-changer)`]:{[`&:hover ${n}-selector`]:{borderColor:e.hoverBorderHover},[`${n}-focused& ${n}-selector`]:{borderColor:e.activeBorderColor,boxShadow:`0 0 0 ${Rt(i)} ${e.activeOutlineColor}`,outline:0},[`${n}-prefix`]:{color:e.color}}}},R2=(t,e)=>({[`&${t.componentCls}-status-${e.status}`]:Object.assign({},Yx(t,e))}),b7=t=>({"&-outlined":Object.assign(Object.assign(Object.assign(Object.assign({},Yx(t,{borderColor:t.colorBorder,hoverBorderHover:t.hoverBorderColor,activeBorderColor:t.activeBorderColor,activeOutlineColor:t.activeOutlineColor,color:t.colorText})),R2(t,{status:"error",borderColor:t.colorError,hoverBorderHover:t.colorErrorHover,activeBorderColor:t.colorError,activeOutlineColor:t.colorErrorOutline,color:t.colorError})),R2(t,{status:"warning",borderColor:t.colorWarning,hoverBorderHover:t.colorWarningHover,activeBorderColor:t.colorWarning,activeOutlineColor:t.colorWarningOutline,color:t.colorWarning})),{[`&${t.componentCls}-disabled`]:{[`&:not(${t.componentCls}-customize-input) ${t.componentCls}-selector`]:{background:t.colorBgContainerDisabled,color:t.colorTextDisabled}},[`&${t.componentCls}-multiple ${t.componentCls}-selection-item`]:{background:t.multipleItemBg,border:`${Rt(t.lineWidth)} ${t.lineType} ${t.multipleItemBorderColor}`}})}),Kx=(t,e)=>{const{componentCls:n,antCls:r}=t;return{[`&:not(${n}-customize-input) ${n}-selector`]:{background:e.bg,border:`${Rt(t.lineWidth)} ${t.lineType} transparent`,color:e.color},[`&:not(${n}-disabled):not(${n}-customize-input):not(${r}-pagination-size-changer)`]:{[`&:hover ${n}-selector`]:{background:e.hoverBg},[`${n}-focused& ${n}-selector`]:{background:t.selectorBg,borderColor:e.activeBorderColor,outline:0}}}},x2=(t,e)=>({[`&${t.componentCls}-status-${e.status}`]:Object.assign({},Kx(t,e))}),S7=t=>({"&-filled":Object.assign(Object.assign(Object.assign(Object.assign({},Kx(t,{bg:t.colorFillTertiary,hoverBg:t.colorFillSecondary,activeBorderColor:t.activeBorderColor,color:t.colorText})),x2(t,{status:"error",bg:t.colorErrorBg,hoverBg:t.colorErrorBgHover,activeBorderColor:t.colorError,color:t.colorError})),x2(t,{status:"warning",bg:t.colorWarningBg,hoverBg:t.colorWarningBgHover,activeBorderColor:t.colorWarning,color:t.colorWarning})),{[`&${t.componentCls}-disabled`]:{[`&:not(${t.componentCls}-customize-input) ${t.componentCls}-selector`]:{borderColor:t.colorBorder,background:t.colorBgContainerDisabled,color:t.colorTextDisabled}},[`&${t.componentCls}-multiple ${t.componentCls}-selection-item`]:{background:t.colorBgContainer,border:`${Rt(t.lineWidth)} ${t.lineType} ${t.colorSplit}`}})}),w7=t=>({"&-borderless":{[`${t.componentCls}-selector`]:{background:"transparent",border:`${Rt(t.lineWidth)} ${t.lineType} transparent`},[`&${t.componentCls}-disabled`]:{[`&:not(${t.componentCls}-customize-input) ${t.componentCls}-selector`]:{color:t.colorTextDisabled}},[`&${t.componentCls}-multiple ${t.componentCls}-selection-item`]:{background:t.multipleItemBg,border:`${Rt(t.lineWidth)} ${t.lineType} ${t.multipleItemBorderColor}`},[`&${t.componentCls}-status-error`]:{[`${t.componentCls}-prefix, ${t.componentCls}-selection-item`]:{color:t.colorError}},[`&${t.componentCls}-status-warning`]:{[`${t.componentCls}-prefix, ${t.componentCls}-selection-item`]:{color:t.colorWarning}}}}),Zx=(t,e)=>{const{componentCls:n,antCls:r}=t;return{[`&:not(${n}-customize-input) ${n}-selector`]:{borderWidth:`0 0 ${Rt(t.lineWidth)} 0`,borderStyle:`none none ${t.lineType} none`,borderColor:e.borderColor,background:t.selectorBg,borderRadius:0},[`&:not(${n}-disabled):not(${n}-customize-input):not(${r}-pagination-size-changer)`]:{[`&:hover ${n}-selector`]:{borderColor:e.hoverBorderHover},[`${n}-focused& ${n}-selector`]:{borderColor:e.activeBorderColor,outline:0},[`${n}-prefix`]:{color:e.color}}}},M2=(t,e)=>({[`&${t.componentCls}-status-${e.status}`]:Object.assign({},Zx(t,e))}),E7=t=>({"&-underlined":Object.assign(Object.assign(Object.assign(Object.assign({},Zx(t,{borderColor:t.colorBorder,hoverBorderHover:t.hoverBorderColor,activeBorderColor:t.activeBorderColor,activeOutlineColor:t.activeOutlineColor,color:t.colorText})),M2(t,{status:"error",borderColor:t.colorError,hoverBorderHover:t.colorErrorHover,activeBorderColor:t.colorError,activeOutlineColor:t.colorErrorOutline,color:t.colorError})),M2(t,{status:"warning",borderColor:t.colorWarning,hoverBorderHover:t.colorWarningHover,activeBorderColor:t.colorWarning,activeOutlineColor:t.colorWarningOutline,color:t.colorWarning})),{[`&${t.componentCls}-disabled`]:{[`&:not(${t.componentCls}-customize-input) ${t.componentCls}-selector`]:{color:t.colorTextDisabled}},[`&${t.componentCls}-multiple ${t.componentCls}-selection-item`]:{background:t.multipleItemBg,border:`${Rt(t.lineWidth)} ${t.lineType} ${t.multipleItemBorderColor}`}})}),T7=t=>({[t.componentCls]:Object.assign(Object.assign(Object.assign(Object.assign({},b7(t)),S7(t)),w7(t)),E7(t))}),A7=t=>{const{componentCls:e}=t;return{position:"relative",transition:`all ${t.motionDurationMid} ${t.motionEaseInOut}`,input:{cursor:"pointer"},[`${e}-show-search&`]:{cursor:"text",input:{cursor:"auto",color:"inherit",height:"100%"}},[`${e}-disabled&`]:{cursor:"not-allowed",input:{cursor:"not-allowed"}}}},C7=t=>{const{componentCls:e}=t;return{[`${e}-selection-search-input`]:{margin:0,padding:0,background:"transparent",border:"none",outline:"none",appearance:"none",fontFamily:"inherit","&::-webkit-search-cancel-button":{display:"none","-webkit-appearance":"none"}}}},R7=t=>{const{antCls:e,componentCls:n,inputPaddingHorizontalBase:r,iconCls:i}=t;return{[n]:Object.assign(Object.assign({},Hc(t)),{position:"relative",display:"inline-flex",cursor:"pointer",[`&:not(${n}-customize-input) ${n}-selector`]:Object.assign(Object.assign({},A7(t)),C7(t)),[`${n}-selection-item`]:Object.assign(Object.assign({flex:1,fontWeight:"normal",position:"relative",userSelect:"none"},b_),{[`> ${e}-typography`]:{display:"inline"}}),[`${n}-selection-placeholder`]:Object.assign(Object.assign({},b_),{flex:1,color:t.colorTextPlaceholder,pointerEvents:"none"}),[`${n}-arrow`]:Object.assign(Object.assign({},fb()),{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:r,height:t.fontSizeIcon,marginTop:t.calc(t.fontSizeIcon).mul(-1).div(2).equal(),color:t.colorTextQuaternary,fontSize:t.fontSizeIcon,lineHeight:1,textAlign:"center",pointerEvents:"none",display:"flex",alignItems:"center",transition:`opacity ${t.motionDurationSlow} ease`,[i]:{verticalAlign:"top",transition:`transform ${t.motionDurationSlow}`,"> svg":{verticalAlign:"top"},[`&:not(${n}-suffix)`]:{pointerEvents:"auto"}},[`${n}-disabled &`]:{cursor:"not-allowed"},"> *:not(:last-child)":{marginInlineEnd:8}}),[`${n}-selection-wrap`]:{display:"flex",width:"100%",position:"relative",minWidth:0,"&:after":{content:'"\\a0"',width:0,overflow:"hidden"}},[`${n}-prefix`]:{flex:"none",marginInlineEnd:t.selectAffixPadding},[`${n}-clear`]:{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:r,zIndex:1,display:"inline-block",width:t.fontSizeIcon,height:t.fontSizeIcon,marginTop:t.calc(t.fontSizeIcon).mul(-1).div(2).equal(),color:t.colorTextQuaternary,fontSize:t.fontSizeIcon,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",cursor:"pointer",opacity:0,transition:`color ${t.motionDurationMid} ease, opacity ${t.motionDurationSlow} ease`,textRendering:"auto","&:before":{display:"block"},"&:hover":{color:t.colorTextTertiary}},[`&:hover ${n}-clear`]:{opacity:1,background:t.colorBgBase,borderRadius:"50%"}}),[`${n}-status`]:{"&-error, &-warning, &-success, &-validating":{[`&${n}-has-feedback`]:{[`${n}-clear`]:{insetInlineEnd:t.calc(r).add(t.fontSize).add(t.paddingXS).equal()}}}}}},x7=t=>{const{componentCls:e}=t;return[{[e]:{[`&${e}-in-form-item`]:{width:"100%"}}},R7(t),_7(t),v7(t),d7(t),{[`${e}-rtl`]:{direction:"rtl"}},mB(t,{borderElCls:`${e}-selector`,focusElCls:`${e}-focused`})]},M7=jc("Select",(t,e)=>{let{rootPrefixCls:n}=e;const r=fi(t,{rootPrefixCls:n,inputPaddingHorizontalBase:t.calc(t.paddingSM).sub(1).equal(),multipleSelectItemHeight:t.multipleItemHeight,selectHeight:t.controlHeight});return[x7(r),T7(r)]},y7,{unitless:{optionLineHeight:!0,optionSelectedFontWeight:!0}});var O7={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"}}]},name:"check",theme:"outlined"},P7=function(e,n){return _.createElement(qs,kt({},e,{ref:n,icon:O7}))},N7=_.forwardRef(P7),I7={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"},D7=function(e,n){return _.createElement(qs,kt({},e,{ref:n,icon:I7}))},F7=_.forwardRef(D7),k7={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"}}]},name:"search",theme:"outlined"},B7=function(e,n){return _.createElement(qs,kt({},e,{ref:n,icon:k7}))},U7=_.forwardRef(B7);function L7(t){let{suffixIcon:e,clearIcon:n,menuItemSelectedIcon:r,removeIcon:i,loading:s,multiple:l,hasFeedback:c,prefixCls:f,showSuffixIcon:d,feedbackIcon:g,showArrow:m,componentName:v}=t;const S=n??_.createElement(pk,null),E=T=>e===null&&!c&&!m?null:_.createElement(_.Fragment,null,d!==!1&&T,c&&g);let w=null;if(e!==void 0)w=E(e);else if(s)w=E(_.createElement(Mk,{spin:!0}));else{const T=`${f}-suffix`;w=C=>{let{open:M,showSearch:x}=C;return E(M&&x?_.createElement(U7,{className:T}):_.createElement(F7,{className:T}))}}let b=null;r!==void 0?b=r:l?b=_.createElement(N7,null):b=null;let A=null;return i!==void 0?A=i:A=_.createElement(_k,null),{clearIcon:S,suffixIcon:w,itemIcon:b,removeIcon:A}}function z7(t,e){return e!==void 0?e:t!==null}var $7=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{var n;const{prefixCls:r,bordered:i,className:s,rootClassName:l,getPopupContainer:c,popupClassName:f,dropdownClassName:d,listHeight:g=256,placement:m,listItemHeight:v,size:S,disabled:E,notFoundContent:w,status:b,builtinPlacements:A,dropdownMatchSelectWidth:T,popupMatchSelectWidth:C,direction:M,style:x,allowClear:N,variant:F,dropdownStyle:L,transitionName:I,tagRender:V,maxCount:B,prefix:j}=t,X=$7(t,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","builtinPlacements","dropdownMatchSelectWidth","popupMatchSelectWidth","direction","style","allowClear","variant","dropdownStyle","transitionName","tagRender","maxCount","prefix"]),{getPopupContainer:Y,getPrefixCls:ae,renderEmpty:U,direction:z,virtual:W,popupMatchSelectWidth:Z,popupOverflow:P}=_.useContext(ui),$=Vc("select"),[,ie]=Xs(),se=v??(ie==null?void 0:ie.controlHeight),q=ae("select",r),ce=ae(),fe=M??z,{compactSize:ye,compactItemClassnames:we}=kk(q,fe),[Ae,Te]=c7("select",F,i),ve=Ck(q),[ge,_e,Ie]=M7(q,ve),Ee=_.useMemo(()=>{const{mode:Vt}=t;if(Vt!=="combobox")return Vt===Qx?"combobox":Vt},[t.mode]),xe=Ee==="multiple"||Ee==="tags",Ve=z7(t.suffixIcon,t.showArrow),Fe=(n=C??T)!==null&&n!==void 0?n:Z,{status:Be,hasFeedback:nt,isFormItemInput:He,feedbackIcon:Ge}=_.useContext(k_),Pe=n7(Be,b);let Me;w!==void 0?Me=w:Ee==="combobox"?Me=null:Me=(U==null?void 0:U("Select"))||_.createElement(l7,{componentName:"Select"});const{suffixIcon:dt,itemIcon:rt,removeIcon:it,clearIcon:st}=L7(Object.assign(Object.assign({},X),{multiple:xe,hasFeedback:nt,feedbackIcon:Ge,showSuffixIcon:Ve,prefixCls:q,componentName:"Select"})),at=N===!0?{clearIcon:st}:N,Je=gx(X,["suffixIcon","itemIcon"]),lt=Ze(f||d,{[`${q}-dropdown-${fe}`]:fe==="rtl"},l,Ie,ve,_e),ft=px(Vt=>{var qt;return(qt=S??ye)!==null&&qt!==void 0?qt:Vt}),ct=_.useContext(xf),mt=E??ct,xt=Ze({[`${q}-lg`]:ft==="large",[`${q}-sm`]:ft==="small",[`${q}-rtl`]:fe==="rtl",[`${q}-${Ae}`]:Te,[`${q}-in-form-item`]:He},t7(q,Pe,nt),we,$.className,s,l,Ie,ve,_e),Bt=_.useMemo(()=>m!==void 0?m:fe==="rtl"?"bottomRight":"bottomLeft",[m,fe]),[ht]=dx("SelectLike",L==null?void 0:L.zIndex);return ge(_.createElement(yb,Object.assign({ref:e,virtual:W,showSearch:$.showSearch},Je,{style:Object.assign(Object.assign({},$.style),x),dropdownMatchSelectWidth:Fe,transitionName:hx(ce,"slide-up",I),builtinPlacements:f7(A,P),listHeight:g,listItemHeight:se,mode:Ee,prefixCls:q,placement:Bt,direction:fe,prefix:j,suffixIcon:dt,menuItemSelectedIcon:rt,removeIcon:it,allowClear:at,notFoundContent:Me,className:xt,getPopupContainer:c||Y,dropdownClassName:lt,disabled:mt,dropdownStyle:Object.assign(Object.assign({},L),{zIndex:ht}),maxCount:xe?B:void 0,tagRender:xe?V:void 0})))},qc=_.forwardRef(V7),H7=TU(qc,"dropdownAlign");qc.SECRET_COMBOBOX_MODE_DO_NOT_USE=Qx;qc.Option=_b;qc.OptGroup=vb;qc._InternalPanelDoNotUseOrYouWillBeFired=H7;function Gx(t){var e=t.children,n=t.prefixCls,r=t.id,i=t.overlayInnerStyle,s=t.bodyClassName,l=t.className,c=t.style;return _.createElement("div",{className:Ze("".concat(n,"-content"),l),style:c},_.createElement("div",{className:Ze("".concat(n,"-inner"),s),id:r,role:"tooltip",style:i},typeof e=="function"?e():e))}var Vl={shiftX:64,adjustY:1},Hl={adjustX:1,shiftY:!0},Ri=[0,0],j7={left:{points:["cr","cl"],overflow:Hl,offset:[-4,0],targetOffset:Ri},right:{points:["cl","cr"],overflow:Hl,offset:[4,0],targetOffset:Ri},top:{points:["bc","tc"],overflow:Vl,offset:[0,-4],targetOffset:Ri},bottom:{points:["tc","bc"],overflow:Vl,offset:[0,4],targetOffset:Ri},topLeft:{points:["bl","tl"],overflow:Vl,offset:[0,-4],targetOffset:Ri},leftTop:{points:["tr","tl"],overflow:Hl,offset:[-4,0],targetOffset:Ri},topRight:{points:["br","tr"],overflow:Vl,offset:[0,-4],targetOffset:Ri},rightTop:{points:["tl","tr"],overflow:Hl,offset:[4,0],targetOffset:Ri},bottomRight:{points:["tr","br"],overflow:Vl,offset:[0,4],targetOffset:Ri},rightBottom:{points:["bl","br"],overflow:Hl,offset:[4,0],targetOffset:Ri},bottomLeft:{points:["tl","bl"],overflow:Vl,offset:[0,4],targetOffset:Ri},leftBottom:{points:["br","bl"],overflow:Hl,offset:[-4,0],targetOffset:Ri}},W7=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow","classNames","styles"],X7=function(e,n){var r=e.overlayClassName,i=e.trigger,s=i===void 0?["hover"]:i,l=e.mouseEnterDelay,c=l===void 0?0:l,f=e.mouseLeaveDelay,d=f===void 0?.1:f,g=e.overlayStyle,m=e.prefixCls,v=m===void 0?"rc-tooltip":m,S=e.children,E=e.onVisibleChange,w=e.afterVisibleChange,b=e.transitionName,A=e.animation,T=e.motion,C=e.placement,M=C===void 0?"right":C,x=e.align,N=x===void 0?{}:x,F=e.destroyTooltipOnHide,L=F===void 0?!1:F,I=e.defaultVisible,V=e.getTooltipContainer,B=e.overlayInnerStyle;e.arrowContent;var j=e.overlay,X=e.id,Y=e.showArrow,ae=Y===void 0?!0:Y,U=e.classNames,z=e.styles,W=Fn(e,W7),Z=Tx(X),P=_.useRef(null);_.useImperativeHandle(n,function(){return P.current});var $=J({},W);"visible"in e&&($.popupVisible=e.visible);var ie=function(){return _.createElement(Gx,{key:"content",prefixCls:v,id:Z,bodyClassName:U==null?void 0:U.body,overlayInnerStyle:J(J({},B),z==null?void 0:z.body)},j)},se=function(){var ce=_.Children.only(S),fe=(ce==null?void 0:ce.props)||{},ye=J(J({},fe),{},{"aria-describedby":j?Z:null});return _.cloneElement(S,ye)};return _.createElement(zx,kt({popupClassName:Ze(r,U==null?void 0:U.root),prefixCls:v,popup:ie,action:s,builtinPlacements:j7,popupPlacement:M,ref:P,popupAlign:N,getPopupContainer:V,onPopupVisibleChange:E,afterPopupVisibleChange:w,popupTransitionName:b,popupAnimation:A,popupMotion:T,defaultPopupVisible:I,autoDestroy:L,mouseLeaveDelay:d,popupStyle:J(J({},g),z==null?void 0:z.root),mouseEnterDelay:c,arrow:ae},$),se())};const q7=_.forwardRef(X7);function Y7(t){const{sizePopupArrow:e,borderRadiusXS:n,borderRadiusOuter:r}=t,i=e/2,s=0,l=i,c=r*1/Math.sqrt(2),f=i-r*(1-1/Math.sqrt(2)),d=i-n*(1/Math.sqrt(2)),g=r*(Math.sqrt(2)-1)+n*(1/Math.sqrt(2)),m=2*i-d,v=g,S=2*i-c,E=f,w=2*i-s,b=l,A=i*Math.sqrt(2)+r*(Math.sqrt(2)-2),T=r*(Math.sqrt(2)-1),C=`polygon(${T}px 100%, 50% ${T}px, ${2*i-T}px 100%, ${T}px 100%)`,M=`path('M ${s} ${l} A ${r} ${r} 0 0 0 ${c} ${f} L ${d} ${g} A ${n} ${n} 0 0 1 ${m} ${v} L ${S} ${E} A ${r} ${r} 0 0 0 ${w} ${b} Z')`;return{arrowShadowWidth:A,arrowPath:M,arrowPolygon:C}}const K7=(t,e,n)=>{const{sizePopupArrow:r,arrowPolygon:i,arrowPath:s,arrowShadowWidth:l,borderRadiusXS:c,calc:f}=t;return{pointerEvents:"none",width:r,height:r,overflow:"hidden","&::before":{position:"absolute",bottom:0,insetInlineStart:0,width:r,height:f(r).div(2).equal(),background:e,clipPath:{_multi_value_:!0,value:[i,s]},content:'""'},"&::after":{content:'""',position:"absolute",width:l,height:l,bottom:0,insetInline:0,margin:"auto",borderRadius:{_skip_check_:!0,value:`0 0 ${Rt(c)} 0`},transform:"translateY(50%) rotate(-135deg)",boxShadow:n,zIndex:0,background:"transparent"}}},Jx=8;function eM(t){const{contentRadius:e,limitVerticalRadius:n}=t,r=e>12?e+2:12;return{arrowOffsetHorizontal:r,arrowOffsetVertical:n?Jx:r}}function mh(t,e){return t?e:{}}function Z7(t,e,n){const{componentCls:r,boxShadowPopoverArrow:i,arrowOffsetVertical:s,arrowOffsetHorizontal:l}=t,{arrowDistance:c=0,arrowPlacement:f={left:!0,right:!0,top:!0,bottom:!0}}={};return{[r]:Object.assign(Object.assign(Object.assign(Object.assign({[`${r}-arrow`]:[Object.assign(Object.assign({position:"absolute",zIndex:1,display:"block"},K7(t,e,i)),{"&:before":{background:e}})]},mh(!!f.top,{[[`&-placement-top > ${r}-arrow`,`&-placement-topLeft > ${r}-arrow`,`&-placement-topRight > ${r}-arrow`].join(",")]:{bottom:c,transform:"translateY(100%) rotate(180deg)"},[`&-placement-top > ${r}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},"&-placement-topLeft":{"--arrow-offset-horizontal":l,[`> ${r}-arrow`]:{left:{_skip_check_:!0,value:l}}},"&-placement-topRight":{"--arrow-offset-horizontal":`calc(100% - ${Rt(l)})`,[`> ${r}-arrow`]:{right:{_skip_check_:!0,value:l}}}})),mh(!!f.bottom,{[[`&-placement-bottom > ${r}-arrow`,`&-placement-bottomLeft > ${r}-arrow`,`&-placement-bottomRight > ${r}-arrow`].join(",")]:{top:c,transform:"translateY(-100%)"},[`&-placement-bottom > ${r}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},"&-placement-bottomLeft":{"--arrow-offset-horizontal":l,[`> ${r}-arrow`]:{left:{_skip_check_:!0,value:l}}},"&-placement-bottomRight":{"--arrow-offset-horizontal":`calc(100% - ${Rt(l)})`,[`> ${r}-arrow`]:{right:{_skip_check_:!0,value:l}}}})),mh(!!f.left,{[[`&-placement-left > ${r}-arrow`,`&-placement-leftTop > ${r}-arrow`,`&-placement-leftBottom > ${r}-arrow`].join(",")]:{right:{_skip_check_:!0,value:c},transform:"translateX(100%) rotate(90deg)"},[`&-placement-left > ${r}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(100%) rotate(90deg)"},[`&-placement-leftTop > ${r}-arrow`]:{top:s},[`&-placement-leftBottom > ${r}-arrow`]:{bottom:s}})),mh(!!f.right,{[[`&-placement-right > ${r}-arrow`,`&-placement-rightTop > ${r}-arrow`,`&-placement-rightBottom > ${r}-arrow`].join(",")]:{left:{_skip_check_:!0,value:c},transform:"translateX(-100%) rotate(-90deg)"},[`&-placement-right > ${r}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(-100%) rotate(-90deg)"},[`&-placement-rightTop > ${r}-arrow`]:{top:s},[`&-placement-rightBottom > ${r}-arrow`]:{bottom:s}}))}}function Q7(t,e,n,r){if(r===!1)return{adjustX:!1,adjustY:!1};const i=r&&typeof r=="object"?r:{},s={};switch(t){case"top":case"bottom":s.shiftX=e.arrowOffsetHorizontal*2+n,s.shiftY=!0,s.adjustY=!0;break;case"left":case"right":s.shiftY=e.arrowOffsetVertical*2+n,s.shiftX=!0,s.adjustX=!0;break}const l=Object.assign(Object.assign({},s),i);return l.shiftX||(l.adjustX=!0),l.shiftY||(l.adjustY=!0),l}const O2={left:{points:["cr","cl"]},right:{points:["cl","cr"]},top:{points:["bc","tc"]},bottom:{points:["tc","bc"]},topLeft:{points:["bl","tl"]},leftTop:{points:["tr","tl"]},topRight:{points:["br","tr"]},rightTop:{points:["tl","tr"]},bottomRight:{points:["tr","br"]},rightBottom:{points:["bl","br"]},bottomLeft:{points:["tl","bl"]},leftBottom:{points:["br","bl"]}},G7={topLeft:{points:["bl","tc"]},leftTop:{points:["tr","cl"]},topRight:{points:["br","tc"]},rightTop:{points:["tl","cr"]},bottomRight:{points:["tr","bc"]},rightBottom:{points:["bl","cr"]},bottomLeft:{points:["tl","bc"]},leftBottom:{points:["br","cl"]}},J7=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function e9(t){const{arrowWidth:e,autoAdjustOverflow:n,arrowPointAtCenter:r,offset:i,borderRadius:s}=t,l=e/2,c={};return Object.keys(O2).forEach(f=>{const d=r&&G7[f]||O2[f],g=Object.assign(Object.assign({},d),{offset:[0,0],dynamicInset:!0});switch(c[f]=g,J7.has(f)&&(g.autoArrow=!1),f){case"top":case"topLeft":case"topRight":g.offset[1]=-l-i;break;case"bottom":case"bottomLeft":case"bottomRight":g.offset[1]=l+i;break;case"left":case"leftTop":case"leftBottom":g.offset[0]=-l-i;break;case"right":case"rightTop":case"rightBottom":g.offset[0]=l+i;break}const m=eM({contentRadius:s,limitVerticalRadius:!0});if(r)switch(f){case"topLeft":case"bottomLeft":g.offset[0]=-m.arrowOffsetHorizontal-l;break;case"topRight":case"bottomRight":g.offset[0]=m.arrowOffsetHorizontal+l;break;case"leftTop":case"rightTop":g.offset[1]=-m.arrowOffsetHorizontal*2+l;break;case"leftBottom":case"rightBottom":g.offset[1]=m.arrowOffsetHorizontal*2-l;break}g.overflow=Q7(f,m,e,n),g.htmlRegion="visibleFirst"}),c}const t9=t=>{const{calc:e,componentCls:n,tooltipMaxWidth:r,tooltipColor:i,tooltipBg:s,tooltipBorderRadius:l,zIndexPopup:c,controlHeight:f,boxShadowSecondary:d,paddingSM:g,paddingXS:m,arrowOffsetHorizontal:v,sizePopupArrow:S}=t,E=e(l).add(S).add(v).equal(),w=e(l).mul(2).add(S).equal();return[{[n]:Object.assign(Object.assign(Object.assign(Object.assign({},Hc(t)),{position:"absolute",zIndex:c,display:"block",width:"max-content",maxWidth:r,visibility:"visible","--valid-offset-x":"var(--arrow-offset-horizontal, var(--arrow-x))",transformOrigin:["var(--valid-offset-x, 50%)","var(--arrow-y, 50%)"].join(" "),"&-hidden":{display:"none"},"--antd-arrow-background-color":s,[`${n}-inner`]:{minWidth:w,minHeight:f,padding:`${Rt(t.calc(g).div(2).equal())} ${Rt(m)}`,color:i,textAlign:"start",textDecoration:"none",wordWrap:"break-word",backgroundColor:s,borderRadius:l,boxShadow:d,boxSizing:"border-box"},[["&-placement-topLeft","&-placement-topRight","&-placement-bottomLeft","&-placement-bottomRight"].join(",")]:{minWidth:E},[["&-placement-left","&-placement-leftTop","&-placement-leftBottom","&-placement-right","&-placement-rightTop","&-placement-rightBottom"].join(",")]:{[`${n}-inner`]:{borderRadius:t.min(l,Jx)}},[`${n}-content`]:{position:"relative"}}),w8(t,(b,A)=>{let{darkColor:T}=A;return{[`&${n}-${b}`]:{[`${n}-inner`]:{backgroundColor:T},[`${n}-arrow`]:{"--antd-arrow-background-color":T}}}})),{"&-rtl":{direction:"rtl"}})},Z7(t,"var(--antd-arrow-background-color)"),{[`${n}-pure`]:{position:"relative",maxWidth:"none",margin:t.sizePopupArrow}}]},n9=t=>Object.assign(Object.assign({zIndexPopup:t.zIndexPopupBase+70},eM({contentRadius:t.borderRadius,limitVerticalRadius:!0})),Y7(fi(t,{borderRadiusOuter:Math.min(t.borderRadiusOuter,4)}))),tM=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return jc("Tooltip",r=>{const{borderRadius:i,colorTextLightSolid:s,colorBgSpotlight:l}=r,c=fi(r,{tooltipMaxWidth:250,tooltipColor:s,tooltipBorderRadius:i,tooltipBg:l});return[t9(c),hB(r,"zoom-big-fast")]},n9,{resetStyle:!1,injectStyle:e})(t)},r9=sg.map(t=>`${t}-inverse`);function i9(t){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)?[].concat(ze(r9),ze(sg)).includes(t):sg.includes(t)}function nM(t,e){const n=i9(e),r=Ze({[`${t}-${e}`]:e&&n}),i={},s={};return e&&!n&&(i.background=e,s["--antd-arrow-background-color"]=e),{className:r,overlayStyle:i,arrowStyle:s}}const s9=t=>{const{prefixCls:e,className:n,placement:r="top",title:i,color:s,overlayInnerStyle:l}=t,{getPrefixCls:c}=_.useContext(ui),f=c("tooltip",e),[d,g,m]=tM(f),v=nM(f,s),S=v.arrowStyle,E=Object.assign(Object.assign({},l),v.overlayStyle),w=Ze(g,m,f,`${f}-pure`,`${f}-placement-${r}`,n,v.className);return d(_.createElement("div",{className:w,style:S},_.createElement("div",{className:`${f}-arrow`}),_.createElement(Gx,Object.assign({},t,{className:g,prefixCls:f,overlayInnerStyle:E}),i)))};var a9=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{var n,r;const{prefixCls:i,openClassName:s,getTooltipContainer:l,color:c,overlayInnerStyle:f,children:d,afterOpenChange:g,afterVisibleChange:m,destroyTooltipOnHide:v,arrow:S=!0,title:E,overlay:w,builtinPlacements:b,arrowPointAtCenter:A=!1,autoAdjustOverflow:T=!0,motion:C,getPopupContainer:M,placement:x="top",mouseEnterDelay:N=.1,mouseLeaveDelay:F=.1,overlayStyle:L,rootClassName:I,overlayClassName:V,styles:B,classNames:j}=t,X=a9(t,["prefixCls","openClassName","getTooltipContainer","color","overlayInnerStyle","children","afterOpenChange","afterVisibleChange","destroyTooltipOnHide","arrow","title","overlay","builtinPlacements","arrowPointAtCenter","autoAdjustOverflow","motion","getPopupContainer","placement","mouseEnterDelay","mouseLeaveDelay","overlayStyle","rootClassName","overlayClassName","styles","classNames"]),Y=!!S,[,ae]=Xs(),{getPopupContainer:U,getPrefixCls:z,direction:W,className:Z,style:P,classNames:$,styles:ie}=Vc("tooltip"),se=D3(),q=_.useRef(null),ce=()=>{var Je;(Je=q.current)===null||Je===void 0||Je.forceAlign()};_.useImperativeHandle(e,()=>{var Je,lt;return{forceAlign:ce,forcePopupAlign:()=>{se.deprecated(!1,"forcePopupAlign","forceAlign"),ce()},nativeElement:(Je=q.current)===null||Je===void 0?void 0:Je.nativeElement,popupElement:(lt=q.current)===null||lt===void 0?void 0:lt.popupElement}});const[fe,ye]=xc(!1,{value:(n=t.open)!==null&&n!==void 0?n:t.visible,defaultValue:(r=t.defaultOpen)!==null&&r!==void 0?r:t.defaultVisible}),we=!E&&!w&&E!==0,Ae=Je=>{var lt,ft;ye(we?!1:Je),we||((lt=t.onOpenChange)===null||lt===void 0||lt.call(t,Je),(ft=t.onVisibleChange)===null||ft===void 0||ft.call(t,Je))},Te=_.useMemo(()=>{var Je,lt;let ft=A;return typeof S=="object"&&(ft=(lt=(Je=S.pointAtCenter)!==null&&Je!==void 0?Je:S.arrowPointAtCenter)!==null&<!==void 0?lt:A),b||e9({arrowPointAtCenter:ft,autoAdjustOverflow:T,arrowWidth:Y?ae.sizePopupArrow:0,borderRadius:ae.borderRadius,offset:ae.marginXXS})},[A,S,b,ae]),ve=_.useMemo(()=>E===0?E:w||E||"",[w,E]),ge=_.createElement(wU,{space:!0},typeof ve=="function"?ve():ve),_e=z("tooltip",i),Ie=z(),Ee=t["data-popover-inject"];let xe=fe;!("open"in t)&&!("visible"in t)&&we&&(xe=!1);const Ve=_.isValidElement(d)&&!Tk(d)?d:_.createElement("span",null,d),Fe=Ve.props,Be=!Fe.className||typeof Fe.className=="string"?Ze(Fe.className,s||`${_e}-open`):Fe.className,[nt,He,Ge]=tM(_e,!Ee),Pe=nM(_e,c),Me=Pe.arrowStyle,dt=Ze(V,{[`${_e}-rtl`]:W==="rtl"},Pe.className,I,He,Ge,Z,$.root,j==null?void 0:j.root),rt=Ze($.body,j==null?void 0:j.body),[it,st]=dx("Tooltip",X.zIndex),at=_.createElement(q7,Object.assign({},X,{zIndex:it,showArrow:Y,placement:x,mouseEnterDelay:N,mouseLeaveDelay:F,prefixCls:_e,classNames:{root:dt,body:rt},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Me),ie.root),P),L),B==null?void 0:B.root),body:Object.assign(Object.assign(Object.assign(Object.assign({},ie.body),f),B==null?void 0:B.body),Pe.overlayStyle)},getTooltipContainer:M||l||U,ref:q,builtinPlacements:Te,overlay:ge,visible:xe,onVisibleChange:Ae,afterVisibleChange:g??m,arrowContent:_.createElement("span",{className:`${_e}-arrow-content`}),motion:{motionName:hx(Ie,"zoom-big-fast",t.transitionName),motionDeadline:1e3},destroyTooltipOnHide:!!v}),xe?cx(Ve,{className:Be}):Ve);return nt(_.createElement(ux.Provider,{value:st},at))}),rM=o9;rM._InternalPanelDoNotUseOrYouWillBeFired=s9;function l9(t,e,n){var r=n||{},i=r.noTrailing,s=i===void 0?!1:i,l=r.noLeading,c=l===void 0?!1:l,f=r.debounceMode,d=f===void 0?void 0:f,g,m=!1,v=0;function S(){g&&clearTimeout(g)}function E(b){var A=b||{},T=A.upcomingOnly,C=T===void 0?!1:T;S(),m=!C}function w(){for(var b=arguments.length,A=new Array(b),T=0;Tt?c?(v=Date.now(),s||(g=setTimeout(d?N:x,t))):x():s!==!0&&(g=setTimeout(d?N:x,d===void 0?t-M:t))}return w.cancel=E,w}function c9(t,e,n){var r={},i=r.atBegin,s=i===void 0?!1:i;return l9(t,e,{debounceMode:s!==!1})}function V_(t,e,n){return(t-e)/(n-e)}function bb(t,e,n,r){var i=V_(e,n,r),s={};switch(t){case"rtl":s.right="".concat(i*100,"%"),s.transform="translateX(50%)";break;case"btt":s.bottom="".concat(i*100,"%"),s.transform="translateY(50%)";break;case"ttb":s.top="".concat(i*100,"%"),s.transform="translateY(-50%)";break;default:s.left="".concat(i*100,"%"),s.transform="translateX(-50%)";break}return s}function yo(t,e){return Array.isArray(t)?t[e]:t}var Jo=_.createContext({min:0,max:0,direction:"ltr",step:1,includedStart:0,includedEnd:0,tabIndex:0,keyboard:!0,styles:{},classNames:{}}),u9=_.createContext({}),f9=["prefixCls","value","valueIndex","onStartMove","onDelete","style","render","dragging","draggingDelete","onOffsetChange","onChangeComplete","onFocus","onMouseEnter"],P2=_.forwardRef(function(t,e){var n=t.prefixCls,r=t.value,i=t.valueIndex,s=t.onStartMove,l=t.onDelete,c=t.style,f=t.render,d=t.dragging,g=t.draggingDelete,m=t.onOffsetChange,v=t.onChangeComplete,S=t.onFocus,E=t.onMouseEnter,w=Fn(t,f9),b=_.useContext(Jo),A=b.min,T=b.max,C=b.direction,M=b.disabled,x=b.keyboard,N=b.range,F=b.tabIndex,L=b.ariaLabelForHandle,I=b.ariaLabelledByForHandle,V=b.ariaRequired,B=b.ariaValueTextFormatterForHandle,j=b.styles,X=b.classNames,Y="".concat(n,"-handle"),ae=function(ce){M||s(ce,i)},U=function(ce){S==null||S(ce,i)},z=function(ce){E(ce,i)},W=function(ce){if(!M&&x){var fe=null;switch(ce.which||ce.keyCode){case et.LEFT:fe=C==="ltr"||C==="btt"?-1:1;break;case et.RIGHT:fe=C==="ltr"||C==="btt"?1:-1;break;case et.UP:fe=C!=="ttb"?1:-1;break;case et.DOWN:fe=C!=="ttb"?-1:1;break;case et.HOME:fe="min";break;case et.END:fe="max";break;case et.PAGE_UP:fe=2;break;case et.PAGE_DOWN:fe=-2;break;case et.BACKSPACE:case et.DELETE:l(i);break}fe!==null&&(ce.preventDefault(),m(fe,i))}},Z=function(ce){switch(ce.which||ce.keyCode){case et.LEFT:case et.RIGHT:case et.UP:case et.DOWN:case et.HOME:case et.END:case et.PAGE_UP:case et.PAGE_DOWN:v==null||v();break}},P=bb(C,r,A,T),$={};if(i!==null){var ie;$={tabIndex:M?null:yo(F,i),role:"slider","aria-valuemin":A,"aria-valuemax":T,"aria-valuenow":r,"aria-disabled":M,"aria-label":yo(L,i),"aria-labelledby":yo(I,i),"aria-required":yo(V,i),"aria-valuetext":(ie=yo(B,i))===null||ie===void 0?void 0:ie(r),"aria-orientation":C==="ltr"||C==="rtl"?"horizontal":"vertical",onMouseDown:ae,onTouchStart:ae,onFocus:U,onMouseEnter:z,onKeyDown:W,onKeyUp:Z}}var se=_.createElement("div",kt({ref:e,className:Ze(Y,K(K(K({},"".concat(Y,"-").concat(i+1),i!==null&&N),"".concat(Y,"-dragging"),d),"".concat(Y,"-dragging-delete"),g),X.handle),style:J(J(J({},P),c),j.handle)},$,w));return f&&(se=f(se,{index:i,prefixCls:n,value:r,dragging:d,draggingDelete:g})),se}),d9=["prefixCls","style","onStartMove","onOffsetChange","values","handleRender","activeHandleRender","draggingIndex","draggingDelete","onFocus"],h9=_.forwardRef(function(t,e){var n=t.prefixCls,r=t.style,i=t.onStartMove,s=t.onOffsetChange,l=t.values,c=t.handleRender,f=t.activeHandleRender,d=t.draggingIndex,g=t.draggingDelete,m=t.onFocus,v=Fn(t,d9),S=_.useRef({}),E=_.useState(!1),w=de(E,2),b=w[0],A=w[1],T=_.useState(-1),C=de(T,2),M=C[0],x=C[1],N=function(B){x(B),A(!0)},F=function(B,j){N(j),m==null||m(B)},L=function(B,j){N(j)};_.useImperativeHandle(e,function(){return{focus:function(B){var j;(j=S.current[B])===null||j===void 0||j.focus()},hideHelp:function(){$a.flushSync(function(){A(!1)})}}});var I=J({prefixCls:n,onStartMove:i,onOffsetChange:s,render:c,onFocus:F,onMouseEnter:L},v);return _.createElement(_.Fragment,null,l.map(function(V,B){var j=d===B;return _.createElement(P2,kt({ref:function(Y){Y?S.current[B]=Y:delete S.current[B]},dragging:j,draggingDelete:j&&g,style:yo(r,B),key:B,value:V,valueIndex:B},I))}),f&&b&&_.createElement(P2,kt({key:"a11y"},I,{value:l[M],valueIndex:null,dragging:d!==-1,draggingDelete:g,render:f,style:{pointerEvents:"none"},tabIndex:null,"aria-hidden":!0})))}),g9=function(e){var n=e.prefixCls,r=e.style,i=e.children,s=e.value,l=e.onClick,c=_.useContext(Jo),f=c.min,d=c.max,g=c.direction,m=c.includedStart,v=c.includedEnd,S=c.included,E="".concat(n,"-text"),w=bb(g,s,f,d);return _.createElement("span",{className:Ze(E,K({},"".concat(E,"-active"),S&&m<=s&&s<=v)),style:J(J({},w),r),onMouseDown:function(A){A.stopPropagation()},onClick:function(){l(s)}},i)},p9=function(e){var n=e.prefixCls,r=e.marks,i=e.onClick,s="".concat(n,"-mark");return r.length?_.createElement("div",{className:s},r.map(function(l){var c=l.value,f=l.style,d=l.label;return _.createElement(g9,{key:c,prefixCls:s,style:f,value:c,onClick:i},d)})):null},m9=function(e){var n=e.prefixCls,r=e.value,i=e.style,s=e.activeStyle,l=_.useContext(Jo),c=l.min,f=l.max,d=l.direction,g=l.included,m=l.includedStart,v=l.includedEnd,S="".concat(n,"-dot"),E=g&&m<=r&&r<=v,w=J(J({},bb(d,r,c,f)),typeof i=="function"?i(r):i);return E&&(w=J(J({},w),typeof s=="function"?s(r):s)),_.createElement("span",{className:Ze(S,K({},"".concat(S,"-active"),E)),style:w})},v9=function(e){var n=e.prefixCls,r=e.marks,i=e.dots,s=e.style,l=e.activeStyle,c=_.useContext(Jo),f=c.min,d=c.max,g=c.step,m=_.useMemo(function(){var v=new Set;if(r.forEach(function(E){v.add(E.value)}),i&&g!==null)for(var S=f;S<=d;)v.add(S),S+=g;return Array.from(v)},[f,d,g,i,r]);return _.createElement("div",{className:"".concat(n,"-step")},m.map(function(v){return _.createElement(m9,{prefixCls:n,key:v,value:v,style:s,activeStyle:l})}))},N2=function(e){var n=e.prefixCls,r=e.style,i=e.start,s=e.end,l=e.index,c=e.onStartMove,f=e.replaceCls,d=_.useContext(Jo),g=d.direction,m=d.min,v=d.max,S=d.disabled,E=d.range,w=d.classNames,b="".concat(n,"-track"),A=V_(i,m,v),T=V_(s,m,v),C=function(F){!S&&c&&c(F,-1)},M={};switch(g){case"rtl":M.right="".concat(A*100,"%"),M.width="".concat(T*100-A*100,"%");break;case"btt":M.bottom="".concat(A*100,"%"),M.height="".concat(T*100-A*100,"%");break;case"ttb":M.top="".concat(A*100,"%"),M.height="".concat(T*100-A*100,"%");break;default:M.left="".concat(A*100,"%"),M.width="".concat(T*100-A*100,"%")}var x=f||Ze(b,K(K({},"".concat(b,"-").concat(l+1),l!==null&&E),"".concat(n,"-track-draggable"),c),w.track);return _.createElement("div",{className:x,style:J(J({},M),r),onMouseDown:C,onTouchStart:C})},_9=function(e){var n=e.prefixCls,r=e.style,i=e.values,s=e.startPoint,l=e.onStartMove,c=_.useContext(Jo),f=c.included,d=c.range,g=c.min,m=c.styles,v=c.classNames,S=_.useMemo(function(){if(!d){if(i.length===0)return[];var w=s??g,b=i[0];return[{start:Math.min(w,b),end:Math.max(w,b)}]}for(var A=[],T=0;Ty9&&g3&&arguments[3]!==void 0?arguments[3]:"unit";if(typeof w=="number"){var T,C=E[b],M=C+w,x=[];r.forEach(function(V){x.push(V.value)}),x.push(t,e),x.push(c(C));var N=w>0?1:-1;A==="unit"?x.push(c(C+N*n)):x.push(c(M)),x=x.filter(function(V){return V!==null}).filter(function(V){return w<0?V<=C:V>=C}),A==="unit"&&(x=x.filter(function(V){return V!==C}));var F=A==="unit"?C:M;T=x[0];var L=Math.abs(T-F);if(x.forEach(function(V){var B=Math.abs(V-F);B1){var I=ze(E);return I[b]=T,S(I,w-N,b,A)}return T}else{if(w==="min")return t;if(w==="max")return e}},g=function(E,w,b){var A=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"unit",T=E[b],C=d(E,w,b,A);return{value:C,changed:C!==T}},m=function(E){return s===null&&E===0||typeof s=="number"&&E3&&arguments[3]!==void 0?arguments[3]:"unit",T=E.map(f),C=T[b],M=d(T,w,b,A);if(T[b]=M,i===!1){var x=s||0;b>0&&T[b-1]!==C&&(T[b]=Math.max(T[b],T[b-1]+x)),b0;I-=1)for(var V=!0;m(T[I]-T[I-1])&&V;){var B=g(T,-1,I-1);T[I-1]=B.value,V=B.changed}for(var j=T.length-1;j>0;j-=1)for(var X=!0;m(T[j]-T[j-1])&&X;){var Y=g(T,-1,j-1);T[j-1]=Y.value,X=Y.changed}for(var ae=0;ae=0?z:!1},[z,lt]),ct=_.useMemo(function(){return Object.keys(we||{}).map(function(De){var be=we[De],ut={value:Number(De)};return be&&pt(be)==="object"&&!_.isValidElement(be)&&("label"in be||"style"in be)?(ut.style=be.style,ut.label=be.label):ut.label=be,ut}).filter(function(De){var be=De.label;return be||typeof be=="number"}).sort(function(De,be){return De.value-be.value})},[we]),mt=S9(at,Je,lt,ct,ae,ft),xt=de(mt,2),Bt=xt[0],ht=xt[1],Vt=xc(F,{value:N}),qt=de(Vt,2),En=qt[0],Mn=qt[1],Ut=_.useMemo(function(){var De=En==null?[]:Array.isArray(En)?En:[En],be=de(De,1),ut=be[0],zt=ut===void 0?at:ut,Ot=En===null?[]:[zt];if(Me){if(Ot=ze(De),I||En===void 0){var In=I>=0?I+1:2;for(Ot=Ot.slice(0,In);Ot.length=0&&Be.current.focus(De)}_t(null)},[bt]);var Yt=_.useMemo(function(){return rt&<===null?!1:rt},[rt,lt]),vn=dr(function(De,be){Oe(De,be),B==null||B(It(Ut))}),On=Ne!==-1;_.useEffect(function(){if(!On){var De=Ut.lastIndexOf(wt);Be.current.focus(De)}},[On]);var _n=_.useMemo(function(){return ze(Ue).sort(function(De,be){return De-be})},[Ue]),Zn=_.useMemo(function(){return Me?[_n[0],_n[_n.length-1]]:[at,_n[0]]},[_n,Me,at]),un=de(Zn,2),rn=un[0],Ce=un[1];_.useImperativeHandle(e,function(){return{focus:function(){Be.current.focus(0)},blur:function(){var be,ut=document,zt=ut.activeElement;(be=nt.current)!==null&&be!==void 0&&be.contains(zt)&&(zt==null||zt.blur())}}}),_.useEffect(function(){S&&Be.current.focus(0)},[]);var Le=_.useMemo(function(){return{min:at,max:Je,direction:He,disabled:g,keyboard:v,step:lt,included:$,includedStart:rn,includedEnd:Ce,range:Me,tabIndex:Ie,ariaLabelForHandle:Ee,ariaLabelledByForHandle:xe,ariaRequired:Ve,ariaValueTextFormatterForHandle:Fe,styles:c||{},classNames:l||{}}},[at,Je,He,g,v,lt,$,rn,Ce,Me,Ie,Ee,xe,Ve,Fe,c,l]);return _.createElement(Jo.Provider,{value:Le},_.createElement("div",{ref:nt,className:Ze(r,i,K(K(K(K({},"".concat(r,"-disabled"),g),"".concat(r,"-vertical"),Z),"".concat(r,"-horizontal"),!Z),"".concat(r,"-with-marks"),ct.length)),style:s,onMouseDown:Ye,id:f},_.createElement("div",{className:Ze("".concat(r,"-rail"),l==null?void 0:l.rail),style:J(J({},ce),c==null?void 0:c.rail)}),ge!==!1&&_.createElement(_9,{prefixCls:r,style:se,values:Ut,startPoint:ie,onStartMove:Yt?vn:void 0}),_.createElement(v9,{prefixCls:r,marks:ct,dots:Ae,style:fe,activeStyle:ye}),_.createElement(h9,{ref:Be,prefixCls:r,style:q,values:Ue,draggingIndex:Ne,draggingDelete:en,onStartMove:vn,onOffsetChange:Zt,onFocus:E,onBlur:w,handleRender:Te,activeHandleRender:ve,onChangeComplete:Jt,onDelete:dt?Mt:void 0}),_.createElement(p9,{prefixCls:r,marks:ct,onClick:je})))});const T9=_.createContext({}),D2=_.forwardRef((t,e)=>{const{open:n,draggingDelete:r}=t,i=_.useRef(null),s=n&&!r,l=_.useRef(null);function c(){hr.cancel(l.current),l.current=null}function f(){l.current=hr(()=>{var d;(d=i.current)===null||d===void 0||d.forceAlign(),l.current=null})}return _.useEffect(()=>(s?f():c(),c),[s,t.title]),_.createElement(rM,Object.assign({ref:op(i,e)},t,{open:s}))}),A9=t=>{const{componentCls:e,antCls:n,controlSize:r,dotSize:i,marginFull:s,marginPart:l,colorFillContentHover:c,handleColorDisabled:f,calc:d,handleSize:g,handleSizeHover:m,handleActiveColor:v,handleActiveOutlineColor:S,handleLineWidth:E,handleLineWidthHover:w,motionDurationMid:b}=t;return{[e]:Object.assign(Object.assign({},Hc(t)),{position:"relative",height:r,margin:`${Rt(l)} ${Rt(s)}`,padding:0,cursor:"pointer",touchAction:"none","&-vertical":{margin:`${Rt(s)} ${Rt(l)}`},[`${e}-rail`]:{position:"absolute",backgroundColor:t.railBg,borderRadius:t.borderRadiusXS,transition:`background-color ${b}`},[`${e}-track,${e}-tracks`]:{position:"absolute",transition:`background-color ${b}`},[`${e}-track`]:{backgroundColor:t.trackBg,borderRadius:t.borderRadiusXS},[`${e}-track-draggable`]:{boxSizing:"content-box",backgroundClip:"content-box",border:"solid rgba(0,0,0,0)"},"&:hover":{[`${e}-rail`]:{backgroundColor:t.railHoverBg},[`${e}-track`]:{backgroundColor:t.trackHoverBg},[`${e}-dot`]:{borderColor:c},[`${e}-handle::after`]:{boxShadow:`0 0 0 ${Rt(E)} ${t.colorPrimaryBorderHover}`},[`${e}-dot-active`]:{borderColor:t.dotActiveBorderColor}},[`${e}-handle`]:{position:"absolute",width:g,height:g,outline:"none",userSelect:"none","&-dragging-delete":{opacity:0},"&::before":{content:'""',position:"absolute",insetInlineStart:d(E).mul(-1).equal(),insetBlockStart:d(E).mul(-1).equal(),width:d(g).add(d(E).mul(2)).equal(),height:d(g).add(d(E).mul(2)).equal(),backgroundColor:"transparent"},"&::after":{content:'""',position:"absolute",insetBlockStart:0,insetInlineStart:0,width:g,height:g,backgroundColor:t.colorBgElevated,boxShadow:`0 0 0 ${Rt(E)} ${t.handleColor}`,outline:"0px solid transparent",borderRadius:"50%",cursor:"pointer",transition:` + inset-inline-start ${b}, + inset-block-start ${b}, + width ${b}, + height ${b}, + box-shadow ${b}, + outline ${b} + `},"&:hover, &:active, &:focus":{"&::before":{insetInlineStart:d(m).sub(g).div(2).add(w).mul(-1).equal(),insetBlockStart:d(m).sub(g).div(2).add(w).mul(-1).equal(),width:d(m).add(d(w).mul(2)).equal(),height:d(m).add(d(w).mul(2)).equal()},"&::after":{boxShadow:`0 0 0 ${Rt(w)} ${v}`,outline:`6px solid ${S}`,width:m,height:m,insetInlineStart:t.calc(g).sub(m).div(2).equal(),insetBlockStart:t.calc(g).sub(m).div(2).equal()}}},[`&-lock ${e}-handle`]:{"&::before, &::after":{transition:"none"}},[`${e}-mark`]:{position:"absolute",fontSize:t.fontSize},[`${e}-mark-text`]:{position:"absolute",display:"inline-block",color:t.colorTextDescription,textAlign:"center",wordBreak:"keep-all",cursor:"pointer",userSelect:"none","&-active":{color:t.colorText}},[`${e}-step`]:{position:"absolute",background:"transparent",pointerEvents:"none"},[`${e}-dot`]:{position:"absolute",width:i,height:i,backgroundColor:t.colorBgElevated,border:`${Rt(E)} solid ${t.dotBorderColor}`,borderRadius:"50%",cursor:"pointer",transition:`border-color ${t.motionDurationSlow}`,pointerEvents:"auto","&-active":{borderColor:t.dotActiveBorderColor}},[`&${e}-disabled`]:{cursor:"not-allowed",[`${e}-rail`]:{backgroundColor:`${t.railBg} !important`},[`${e}-track`]:{backgroundColor:`${t.trackBgDisabled} !important`},[` + ${e}-dot + `]:{backgroundColor:t.colorBgElevated,borderColor:t.trackBgDisabled,boxShadow:"none",cursor:"not-allowed"},[`${e}-handle::after`]:{backgroundColor:t.colorBgElevated,cursor:"not-allowed",width:g,height:g,boxShadow:`0 0 0 ${Rt(E)} ${f}`,insetInlineStart:0,insetBlockStart:0},[` + ${e}-mark-text, + ${e}-dot + `]:{cursor:"not-allowed !important"}},[`&-tooltip ${n}-tooltip-inner`]:{minWidth:"unset"}})}},iM=(t,e)=>{const{componentCls:n,railSize:r,handleSize:i,dotSize:s,marginFull:l,calc:c}=t,f=e?"paddingBlock":"paddingInline",d=e?"width":"height",g=e?"height":"width",m=e?"insetBlockStart":"insetInlineStart",v=e?"top":"insetInlineStart",S=c(r).mul(3).sub(i).div(2).equal(),E=c(i).sub(r).div(2).equal(),w=e?{borderWidth:`${Rt(E)} 0`,transform:`translateY(${Rt(c(E).mul(-1).equal())})`}:{borderWidth:`0 ${Rt(E)}`,transform:`translateX(${Rt(t.calc(E).mul(-1).equal())})`};return{[f]:r,[g]:c(r).mul(3).equal(),[`${n}-rail`]:{[d]:"100%",[g]:r},[`${n}-track,${n}-tracks`]:{[g]:r},[`${n}-track-draggable`]:Object.assign({},w),[`${n}-handle`]:{[m]:S},[`${n}-mark`]:{insetInlineStart:0,top:0,[v]:c(r).mul(3).add(e?0:l).equal(),[d]:"100%"},[`${n}-step`]:{insetInlineStart:0,top:0,[v]:r,[d]:"100%",[g]:r},[`${n}-dot`]:{position:"absolute",[m]:c(r).sub(s).div(2).equal()}}},C9=t=>{const{componentCls:e,marginPartWithMark:n}=t;return{[`${e}-horizontal`]:Object.assign(Object.assign({},iM(t,!0)),{[`&${e}-with-marks`]:{marginBottom:n}})}},R9=t=>{const{componentCls:e}=t;return{[`${e}-vertical`]:Object.assign(Object.assign({},iM(t,!1)),{height:"100%"})}},x9=t=>{const n=t.controlHeightLG/4,r=t.controlHeightSM/2,i=t.lineWidth+1,s=t.lineWidth+1*1.5,l=t.colorPrimary,c=new wn(l).setA(.2).toRgbString();return{controlSize:n,railSize:4,handleSize:n,handleSizeHover:r,dotSize:8,handleLineWidth:i,handleLineWidthHover:s,railBg:t.colorFillTertiary,railHoverBg:t.colorFillSecondary,trackBg:t.colorPrimaryBorder,trackHoverBg:t.colorPrimaryBorderHover,handleColor:t.colorPrimaryBorder,handleActiveColor:l,handleActiveOutlineColor:c,handleColorDisabled:new wn(t.colorTextDisabled).onBackground(t.colorBgContainer).toHexString(),dotBorderColor:t.colorBorderSecondary,dotActiveBorderColor:t.colorPrimaryBorder,trackBgDisabled:t.colorBgContainerDisabled}},M9=jc("Slider",t=>{const e=fi(t,{marginPart:t.calc(t.controlHeight).sub(t.controlSize).div(2).equal(),marginFull:t.calc(t.controlSize).div(2).equal(),marginPartWithMark:t.calc(t.controlHeightLG).sub(t.controlSize).equal()});return[A9(e),C9(e),R9(e)]},x9);function Jv(){const[t,e]=_.useState(!1),n=_.useRef(null),r=()=>{hr.cancel(n.current)},i=s=>{r(),s?e(s):n.current=hr(()=>{e(s)})};return _.useEffect(()=>r,[]),[t,i]}var O9=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);itypeof n=="number"?n.toString():""}const N9=Ft.forwardRef((t,e)=>{const{prefixCls:n,range:r,className:i,rootClassName:s,style:l,disabled:c,tooltipPrefixCls:f,tipFormatter:d,tooltipVisible:g,getTooltipPopupContainer:m,tooltipPlacement:v,tooltip:S={},onChangeComplete:E,classNames:w,styles:b}=t,A=O9(t,["prefixCls","range","className","rootClassName","style","disabled","tooltipPrefixCls","tipFormatter","tooltipVisible","getTooltipPopupContainer","tooltipPlacement","tooltip","onChangeComplete","classNames","styles"]),{vertical:T}=t,{getPrefixCls:C,direction:M,className:x,style:N,classNames:F,styles:L,getPopupContainer:I}=Vc("slider"),V=Ft.useContext(xf),B=c??V,{handleRender:j,direction:X}=Ft.useContext(T9),ae=(X||M)==="rtl",[U,z]=Jv(),[W,Z]=Jv(),P=Object.assign({},S),{open:$,placement:ie,getPopupContainer:se,prefixCls:q,formatter:ce}=P,fe=$??g,ye=(U||W)&&fe!==!1,we=P9(ce,d),[Ae,Te]=Jv(),ve=Me=>{E==null||E(Me),Te(!1)},ge=(Me,dt)=>Me||(dt?ae?"left":"right":"top"),_e=C("slider",n),[Ie,Ee,xe]=M9(_e),Ve=Ze(i,x,F.root,w==null?void 0:w.root,s,{[`${_e}-rtl`]:ae,[`${_e}-lock`]:Ae},Ee,xe);ae&&!A.vertical&&(A.reverse=!A.reverse),Ft.useEffect(()=>{const Me=()=>{hr(()=>{Z(!1)},1)};return document.addEventListener("mouseup",Me),()=>{document.removeEventListener("mouseup",Me)}},[]);const Fe=r&&!fe,Be=j||((Me,dt)=>{const{index:rt}=dt,it=Me.props;function st(ft,ct,mt){var xt,Bt,ht,Vt;mt&&((Bt=(xt=A)[ft])===null||Bt===void 0||Bt.call(xt,ct)),(Vt=(ht=it)[ft])===null||Vt===void 0||Vt.call(ht,ct)}const at=Object.assign(Object.assign({},it),{onMouseEnter:ft=>{z(!0),st("onMouseEnter",ft)},onMouseLeave:ft=>{z(!1),st("onMouseLeave",ft)},onMouseDown:ft=>{Z(!0),Te(!0),st("onMouseDown",ft)},onFocus:ft=>{var ct;Z(!0),(ct=A.onFocus)===null||ct===void 0||ct.call(A,ft),st("onFocus",ft,!0)},onBlur:ft=>{var ct;Z(!1),(ct=A.onBlur)===null||ct===void 0||ct.call(A,ft),st("onBlur",ft,!0)}}),Je=Ft.cloneElement(Me,at),lt=(!!fe||ye)&&we!==null;return Fe?Je:Ft.createElement(D2,Object.assign({},P,{prefixCls:C("tooltip",q??f),title:we?we(dt.value):"",open:lt,placement:ge(ie??v,T),key:rt,classNames:{root:`${_e}-tooltip`},getPopupContainer:se||m||I}),Je)}),nt=Fe?(Me,dt)=>{const rt=Ft.cloneElement(Me,{style:Object.assign(Object.assign({},Me.props.style),{visibility:"hidden"})});return Ft.createElement(D2,Object.assign({},P,{prefixCls:C("tooltip",q??f),title:we?we(dt.value):"",open:we!==null&&ye,placement:ge(ie??v,T),key:"tooltip",classNames:{root:`${_e}-tooltip`},getPopupContainer:se||m||I,draggingDelete:dt.draggingDelete}),rt)}:void 0,He=Object.assign(Object.assign(Object.assign(Object.assign({},L.root),N),b==null?void 0:b.root),l),Ge=Object.assign(Object.assign({},L.tracks),b==null?void 0:b.tracks),Pe=Ze(F.tracks,w==null?void 0:w.tracks);return Ie(Ft.createElement(E9,Object.assign({},A,{classNames:Object.assign({handle:Ze(F.handle,w==null?void 0:w.handle),rail:Ze(F.rail,w==null?void 0:w.rail),track:Ze(F.track,w==null?void 0:w.track)},Pe?{tracks:Pe}:{}),styles:Object.assign({handle:Object.assign(Object.assign({},L.handle),b==null?void 0:b.handle),rail:Object.assign(Object.assign({},L.rail),b==null?void 0:b.rail),track:Object.assign(Object.assign({},L.track),b==null?void 0:b.track)},Object.keys(Ge).length?{tracks:Ge}:{}),step:A.step,range:r,className:Ve,style:He,disabled:B,ref:e,prefixCls:_e,handleRender:Be,activeHandleRender:nt,onChangeComplete:ve})))});function F2(t){return["small","middle","large"].includes(t)}function k2(t){return t?typeof t=="number"&&!Number.isNaN(t):!1}const sM=Ft.createContext({latestIndex:0}),I9=sM.Provider,D9=t=>{let{className:e,index:n,children:r,split:i,style:s}=t;const{latestIndex:l}=_.useContext(sM);return r==null?null:_.createElement(_.Fragment,null,_.createElement("div",{className:e,style:s},r),n{var n;const{getPrefixCls:r,direction:i,size:s,className:l,style:c,classNames:f,styles:d}=Vc("space"),{size:g=s??"small",align:m,className:v,rootClassName:S,children:E,direction:w="horizontal",prefixCls:b,split:A,style:T,wrap:C=!1,classNames:M,styles:x}=t,N=F9(t,["size","align","className","rootClassName","children","direction","prefixCls","split","style","wrap","classNames","styles"]),[F,L]=Array.isArray(g)?g:[g,g],I=F2(L),V=F2(F),B=k2(L),j=k2(F),X=Ho(E,{keepEmpty:!0}),Y=m===void 0&&w==="horizontal"?"center":m,ae=r("space",b),[U,z,W]=mx(ae),Z=Ze(ae,l,z,`${ae}-${w}`,{[`${ae}-rtl`]:i==="rtl",[`${ae}-align-${Y}`]:Y,[`${ae}-gap-row-${L}`]:I,[`${ae}-gap-col-${F}`]:V},v,S,W),P=Ze(`${ae}-item`,(n=M==null?void 0:M.item)!==null&&n!==void 0?n:f.item);let $=0;const ie=X.map((ce,fe)=>{var ye;ce!=null&&($=fe);const we=(ce==null?void 0:ce.key)||`${P}-${fe}`;return _.createElement(D9,{className:P,key:we,index:fe,split:A,style:(ye=x==null?void 0:x.item)!==null&&ye!==void 0?ye:d.item},ce)}),se=_.useMemo(()=>({latestIndex:$}),[$]);if(X.length===0)return null;const q={};return C&&(q.flexWrap="wrap"),!V&&j&&(q.columnGap=F),!I&&B&&(q.rowGap=L),U(_.createElement("div",Object.assign({ref:e,className:Z,style:Object.assign(Object.assign(Object.assign({},q),c),T)},N),_.createElement(I9,{value:se},ie)))}),aM=k9;aM.Compact=Lk;const ug=100,oM=ug/5,lM=ug/2-oM/2,e0=lM*2*Math.PI,B2=50,U2=t=>{const{dotClassName:e,style:n,hasCircleCls:r}=t;return _.createElement("circle",{className:Ze(`${e}-circle`,{[`${e}-circle-bg`]:r}),r:lM,cx:B2,cy:B2,strokeWidth:oM,style:n})},B9=t=>{let{percent:e,prefixCls:n}=t;const r=`${n}-dot`,i=`${r}-holder`,s=`${i}-hidden`,[l,c]=_.useState(!1);Dn(()=>{e!==0&&c(!0)},[e!==0]);const f=Math.max(Math.min(e,100),0);if(!l)return null;const d={strokeDashoffset:`${e0/4}`,strokeDasharray:`${e0*f/100} ${e0*(100-f)/100}`};return _.createElement("span",{className:Ze(i,`${r}-progress`,f<=0&&s)},_.createElement("svg",{viewBox:`0 0 ${ug} ${ug}`,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":f},_.createElement(U2,{dotClassName:r,hasCircleCls:!0}),_.createElement(U2,{dotClassName:r,style:d})))};function U9(t){const{prefixCls:e,percent:n=0}=t,r=`${e}-dot`,i=`${r}-holder`,s=`${i}-hidden`;return _.createElement(_.Fragment,null,_.createElement("span",{className:Ze(i,n>0&&s)},_.createElement("span",{className:Ze(r,`${e}-dot-spin`)},[1,2,3,4].map(l=>_.createElement("i",{className:`${e}-dot-item`,key:l})))),_.createElement(B9,{prefixCls:e,percent:n}))}function L9(t){const{prefixCls:e,indicator:n,percent:r}=t,i=`${e}-dot`;return n&&_.isValidElement(n)?cx(n,{className:Ze(n.props.className,i),percent:r}):_.createElement(U9,{prefixCls:e,percent:r})}const z9=new ln("antSpinMove",{to:{opacity:1}}),$9=new ln("antRotate",{to:{transform:"rotate(405deg)"}}),V9=t=>{const{componentCls:e,calc:n}=t;return{[e]:Object.assign(Object.assign({},Hc(t)),{position:"absolute",display:"none",color:t.colorPrimary,fontSize:0,textAlign:"center",verticalAlign:"middle",opacity:0,transition:`transform ${t.motionDurationSlow} ${t.motionEaseInOutCirc}`,"&-spinning":{position:"relative",display:"inline-block",opacity:1},[`${e}-text`]:{fontSize:t.fontSize,paddingTop:n(n(t.dotSize).sub(t.fontSize)).div(2).add(2).equal()},"&-fullscreen":{position:"fixed",width:"100vw",height:"100vh",backgroundColor:t.colorBgMask,zIndex:t.zIndexPopupBase,inset:0,display:"flex",alignItems:"center",flexDirection:"column",justifyContent:"center",opacity:0,visibility:"hidden",transition:`all ${t.motionDurationMid}`,"&-show":{opacity:1,visibility:"visible"},[e]:{[`${e}-dot-holder`]:{color:t.colorWhite},[`${e}-text`]:{color:t.colorTextLightSolid}}},"&-nested-loading":{position:"relative",[`> div > ${e}`]:{position:"absolute",top:0,insetInlineStart:0,zIndex:4,display:"block",width:"100%",height:"100%",maxHeight:t.contentHeight,[`${e}-dot`]:{position:"absolute",top:"50%",insetInlineStart:"50%",margin:n(t.dotSize).mul(-1).div(2).equal()},[`${e}-text`]:{position:"absolute",top:"50%",width:"100%",textShadow:`0 1px 2px ${t.colorBgContainer}`},[`&${e}-show-text ${e}-dot`]:{marginTop:n(t.dotSize).div(2).mul(-1).sub(10).equal()},"&-sm":{[`${e}-dot`]:{margin:n(t.dotSizeSM).mul(-1).div(2).equal()},[`${e}-text`]:{paddingTop:n(n(t.dotSizeSM).sub(t.fontSize)).div(2).add(2).equal()},[`&${e}-show-text ${e}-dot`]:{marginTop:n(t.dotSizeSM).div(2).mul(-1).sub(10).equal()}},"&-lg":{[`${e}-dot`]:{margin:n(t.dotSizeLG).mul(-1).div(2).equal()},[`${e}-text`]:{paddingTop:n(n(t.dotSizeLG).sub(t.fontSize)).div(2).add(2).equal()},[`&${e}-show-text ${e}-dot`]:{marginTop:n(t.dotSizeLG).div(2).mul(-1).sub(10).equal()}}},[`${e}-container`]:{position:"relative",transition:`opacity ${t.motionDurationSlow}`,"&::after":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,zIndex:10,width:"100%",height:"100%",background:t.colorBgContainer,opacity:0,transition:`all ${t.motionDurationSlow}`,content:'""',pointerEvents:"none"}},[`${e}-blur`]:{clear:"both",opacity:.5,userSelect:"none",pointerEvents:"none","&::after":{opacity:.4,pointerEvents:"auto"}}},"&-tip":{color:t.spinDotDefault},[`${e}-dot-holder`]:{width:"1em",height:"1em",fontSize:t.dotSize,display:"inline-block",transition:`transform ${t.motionDurationSlow} ease, opacity ${t.motionDurationSlow} ease`,transformOrigin:"50% 50%",lineHeight:1,color:t.colorPrimary,"&-hidden":{transform:"scale(0.3)",opacity:0}},[`${e}-dot-progress`]:{position:"absolute",inset:0},[`${e}-dot`]:{position:"relative",display:"inline-block",fontSize:t.dotSize,width:"1em",height:"1em","&-item":{position:"absolute",display:"block",width:n(t.dotSize).sub(n(t.marginXXS).div(2)).div(2).equal(),height:n(t.dotSize).sub(n(t.marginXXS).div(2)).div(2).equal(),background:"currentColor",borderRadius:"100%",transform:"scale(0.75)",transformOrigin:"50% 50%",opacity:.3,animationName:z9,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"alternate","&:nth-child(1)":{top:0,insetInlineStart:0,animationDelay:"0s"},"&:nth-child(2)":{top:0,insetInlineEnd:0,animationDelay:"0.4s"},"&:nth-child(3)":{insetInlineEnd:0,bottom:0,animationDelay:"0.8s"},"&:nth-child(4)":{bottom:0,insetInlineStart:0,animationDelay:"1.2s"}},"&-spin":{transform:"rotate(45deg)",animationName:$9,animationDuration:"1.2s",animationIterationCount:"infinite",animationTimingFunction:"linear"},"&-circle":{strokeLinecap:"round",transition:["stroke-dashoffset","stroke-dasharray","stroke","stroke-width","opacity"].map(r=>`${r} ${t.motionDurationSlow} ease`).join(","),fillOpacity:0,stroke:"currentcolor"},"&-circle-bg":{stroke:t.colorFillSecondary}},[`&-sm ${e}-dot`]:{"&, &-holder":{fontSize:t.dotSizeSM}},[`&-sm ${e}-dot-holder`]:{i:{width:n(n(t.dotSizeSM).sub(n(t.marginXXS).div(2))).div(2).equal(),height:n(n(t.dotSizeSM).sub(n(t.marginXXS).div(2))).div(2).equal()}},[`&-lg ${e}-dot`]:{"&, &-holder":{fontSize:t.dotSizeLG}},[`&-lg ${e}-dot-holder`]:{i:{width:n(n(t.dotSizeLG).sub(t.marginXXS)).div(2).equal(),height:n(n(t.dotSizeLG).sub(t.marginXXS)).div(2).equal()}},[`&${e}-show-text ${e}-text`]:{display:"block"}})}},H9=t=>{const{controlHeightLG:e,controlHeight:n}=t;return{contentHeight:400,dotSize:e/2,dotSizeSM:e*.35,dotSizeLG:n}},j9=jc("Spin",t=>{const e=fi(t,{spinDotDefault:t.colorTextDescription});return[V9(e)]},H9),W9=200,L2=[[30,.05],[70,.03],[96,.01]];function X9(t,e){const[n,r]=_.useState(0),i=_.useRef(null),s=e==="auto";return _.useEffect(()=>(s&&t&&(r(0),i.current=setInterval(()=>{r(l=>{const c=100-l;for(let f=0;f{clearInterval(i.current)}),[s,t]),s?n:e}var q9=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{var e;const{prefixCls:n,spinning:r=!0,delay:i=0,className:s,rootClassName:l,size:c="default",tip:f,wrapperClassName:d,style:g,children:m,fullscreen:v=!1,indicator:S,percent:E}=t,w=q9(t,["prefixCls","spinning","delay","className","rootClassName","size","tip","wrapperClassName","style","children","fullscreen","indicator","percent"]),{getPrefixCls:b,direction:A,className:T,style:C,indicator:M}=Vc("spin"),x=b("spin",n),[N,F,L]=j9(x),[I,V]=_.useState(()=>r&&!Y9(r,i)),B=X9(I,E);_.useEffect(()=>{if(r){const W=c9(i,()=>{V(!0)});return W(),()=>{var Z;(Z=W==null?void 0:W.cancel)===null||Z===void 0||Z.call(W)}}V(!1)},[i,r]);const j=_.useMemo(()=>typeof m<"u"&&!v,[m,v]),X=Ze(x,T,{[`${x}-sm`]:c==="small",[`${x}-lg`]:c==="large",[`${x}-spinning`]:I,[`${x}-show-text`]:!!f,[`${x}-rtl`]:A==="rtl"},s,!v&&l,F,L),Y=Ze(`${x}-container`,{[`${x}-blur`]:I}),ae=(e=S??M)!==null&&e!==void 0?e:cM,U=Object.assign(Object.assign({},C),g),z=_.createElement("div",Object.assign({},w,{style:U,className:X,"aria-live":"polite","aria-busy":I}),_.createElement(L9,{prefixCls:x,indicator:ae,percent:B}),f&&(j||v)?_.createElement("div",{className:`${x}-text`},f):null);return N(j?_.createElement("div",Object.assign({},w,{className:Ze(`${x}-nested-loading`,d,F,L)}),I&&_.createElement("div",{key:"loading"},z),_.createElement("div",{className:Y,key:"container"},m)):v?_.createElement("div",{className:Ze(`${x}-fullscreen`,{[`${x}-fullscreen-show`]:I},l,F,L)},z):z)};uM.setDefaultIndicator=t=>{cM=t};function $h(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function K9(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function fM(t){let e,n,r;t.length!==2?(e=$h,n=(c,f)=>$h(t(c),f),r=(c,f)=>t(c)-f):(e=t===$h||t===K9?t:Z9,n=t,r=t);function i(c,f,d=0,g=c.length){if(d>>1;n(c[m],f)<0?d=m+1:g=m}while(d>>1;n(c[m],f)<=0?d=m+1:g=m}while(dd&&r(c[m-1],f)>-r(c[m],f)?m-1:m}return{left:i,center:l,right:s}}function Z9(){return 0}function Q9(t){return t===null?NaN:+t}const G9=fM($h),J9=G9.right;fM(Q9).center;const ez=Math.sqrt(50),tz=Math.sqrt(10),nz=Math.sqrt(2);function fg(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),s=r/Math.pow(10,i),l=s>=ez?10:s>=tz?5:s>=nz?2:1;let c,f,d;return i<0?(d=Math.pow(10,-i)/l,c=Math.round(t*d),f=Math.round(e*d),c/de&&--f,d=-d):(d=Math.pow(10,i)*l,c=Math.round(t/d),f=Math.round(e/d),c*de&&--f),f0))return[];if(t===e)return[t];const r=e=i))return[];const c=s-i+1,f=new Array(c);if(r)if(l<0)for(let d=0;d>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?vh(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?vh(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=oz.exec(t))?new Zr(e[1],e[2],e[3],1):(e=lz.exec(t))?new Zr(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=cz.exec(t))?vh(e[1],e[2],e[3],e[4]):(e=uz.exec(t))?vh(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=fz.exec(t))?X2(e[1],e[2]/100,e[3]/100,1):(e=dz.exec(t))?X2(e[1],e[2]/100,e[3]/100,e[4]):z2.hasOwnProperty(t)?H2(z2[t]):t==="transparent"?new Zr(NaN,NaN,NaN,0):null}function H2(t){return new Zr(t>>16&255,t>>8&255,t&255,1)}function vh(t,e,n,r){return r<=0&&(t=e=n=NaN),new Zr(t,e,n,r)}function pz(t){return t instanceof Jf||(t=If(t)),t?(t=t.rgb(),new Zr(t.r,t.g,t.b,t.opacity)):new Zr}function j_(t,e,n,r){return arguments.length===1?pz(t):new Zr(t,e,n,r??1)}function Zr(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}Sb(Zr,j_,dM(Jf,{brighter(t){return t=t==null?dg:Math.pow(dg,t),new Zr(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Pf:Math.pow(Pf,t),new Zr(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Zr(ko(this.r),ko(this.g),ko(this.b),hg(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:j2,formatHex:j2,formatHex8:mz,formatRgb:W2,toString:W2}));function j2(){return`#${To(this.r)}${To(this.g)}${To(this.b)}`}function mz(){return`#${To(this.r)}${To(this.g)}${To(this.b)}${To((isNaN(this.opacity)?1:this.opacity)*255)}`}function W2(){const t=hg(this.opacity);return`${t===1?"rgb(":"rgba("}${ko(this.r)}, ${ko(this.g)}, ${ko(this.b)}${t===1?")":`, ${t})`}`}function hg(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function ko(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function To(t){return t=ko(t),(t<16?"0":"")+t.toString(16)}function X2(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Zi(t,e,n,r)}function hM(t){if(t instanceof Zi)return new Zi(t.h,t.s,t.l,t.opacity);if(t instanceof Jf||(t=If(t)),!t)return new Zi;if(t instanceof Zi)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),s=Math.max(e,n,r),l=NaN,c=s-i,f=(s+i)/2;return c?(e===s?l=(n-r)/c+(n0&&f<1?0:l,new Zi(l,c,f,t.opacity)}function vz(t,e,n,r){return arguments.length===1?hM(t):new Zi(t,e,n,r??1)}function Zi(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}Sb(Zi,vz,dM(Jf,{brighter(t){return t=t==null?dg:Math.pow(dg,t),new Zi(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Pf:Math.pow(Pf,t),new Zi(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Zr(t0(t>=240?t-240:t+120,i,r),t0(t,i,r),t0(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new Zi(q2(this.h),_h(this.s),_h(this.l),hg(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=hg(this.opacity);return`${t===1?"hsl(":"hsla("}${q2(this.h)}, ${_h(this.s)*100}%, ${_h(this.l)*100}%${t===1?")":`, ${t})`}`}}));function q2(t){return t=(t||0)%360,t<0?t+360:t}function _h(t){return Math.max(0,Math.min(1,t||0))}function t0(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const wb=t=>()=>t;function _z(t,e){return function(n){return t+n*e}}function yz(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function bz(t){return(t=+t)==1?gM:function(e,n){return n-e?yz(e,n,t):wb(isNaN(e)?n:e)}}function gM(t,e){var n=e-t;return n?_z(t,n):wb(isNaN(t)?e:t)}const Y2=function t(e){var n=bz(e);function r(i,s){var l=n((i=j_(i)).r,(s=j_(s)).r),c=n(i.g,s.g),f=n(i.b,s.b),d=gM(i.opacity,s.opacity);return function(g){return i.r=l(g),i.g=c(g),i.b=f(g),i.opacity=d(g),i+""}}return r.gamma=t,r}(1);function Sz(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),i;return function(s){for(i=0;in&&(s=e.slice(n,s),c[l]?c[l]+=s:c[++l]=s),(r=r[0])===(i=i[0])?c[l]?c[l]+=i:c[++l]=i:(c[++l]=null,f.push({i:l,x:gg(r,i)})),n=n0.lastIndex;return ne&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function Iz(t,e,n){var r=t[0],i=t[1],s=e[0],l=e[1];return i2?Dz:Iz,f=d=null,m}function m(v){return v==null||isNaN(v=+v)?s:(f||(f=c(t.map(r),e,n)))(r(l(v)))}return m.invert=function(v){return l(i((d||(d=c(e,t.map(r),gg)))(v)))},m.domain=function(v){return arguments.length?(t=Array.from(v,Pz),g()):t.slice()},m.range=function(v){return arguments.length?(e=Array.from(v),g()):e.slice()},m.rangeRound=function(v){return e=Array.from(v),n=Mz,g()},m.clamp=function(v){return arguments.length?(l=v?!0:Zl,g()):l!==Zl},m.interpolate=function(v){return arguments.length?(n=v,g()):n},m.unknown=function(v){return arguments.length?(s=v,m):s},function(v,S){return r=v,i=S,g()}}function Bz(){return kz()(Zl,Zl)}function Uz(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function pg(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function Oc(t){return t=pg(Math.abs(t)),t?t[1]:NaN}function Lz(t,e){return function(n,r){for(var i=n.length,s=[],l=0,c=t[0],f=0;i>0&&c>0&&(f+c+1>r&&(c=Math.max(1,r-f)),s.push(n.substring(i-=c,i+c)),!((f+=c+1)>r));)c=t[l=(l+1)%t.length];return s.reverse().join(e)}}function zz(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var $z=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function mg(t){if(!(e=$z.exec(t)))throw new Error("invalid format: "+t);var e;return new Tb({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}mg.prototype=Tb.prototype;function Tb(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}Tb.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Vz(t){e:for(var e=t.length,n=1,r=-1,i;n0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(i+1):t}var pM;function Hz(t,e){var n=pg(t,e);if(!n)return t+"";var r=n[0],i=n[1],s=i-(pM=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,l=r.length;return s===l?r:s>l?r+new Array(s-l+1).join("0"):s>0?r.slice(0,s)+"."+r.slice(s):"0."+new Array(1-s).join("0")+pg(t,Math.max(0,e+s-1))[0]}function Z2(t,e){var n=pg(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const Q2={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:Uz,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Z2(t*100,e),r:Z2,s:Hz,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function G2(t){return t}var J2=Array.prototype.map,eA=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function jz(t){var e=t.grouping===void 0||t.thousands===void 0?G2:Lz(J2.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",s=t.numerals===void 0?G2:zz(J2.call(t.numerals,String)),l=t.percent===void 0?"%":t.percent+"",c=t.minus===void 0?"−":t.minus+"",f=t.nan===void 0?"NaN":t.nan+"";function d(m){m=mg(m);var v=m.fill,S=m.align,E=m.sign,w=m.symbol,b=m.zero,A=m.width,T=m.comma,C=m.precision,M=m.trim,x=m.type;x==="n"?(T=!0,x="g"):Q2[x]||(C===void 0&&(C=12),M=!0,x="g"),(b||v==="0"&&S==="=")&&(b=!0,v="0",S="=");var N=w==="$"?n:w==="#"&&/[boxX]/.test(x)?"0"+x.toLowerCase():"",F=w==="$"?r:/[%p]/.test(x)?l:"",L=Q2[x],I=/[defgprs%]/.test(x);C=C===void 0?6:/[gprs]/.test(x)?Math.max(1,Math.min(21,C)):Math.max(0,Math.min(20,C));function V(B){var j=N,X=F,Y,ae,U;if(x==="c")X=L(B)+X,B="";else{B=+B;var z=B<0||1/B<0;if(B=isNaN(B)?f:L(Math.abs(B),C),M&&(B=Vz(B)),z&&+B==0&&E!=="+"&&(z=!1),j=(z?E==="("?E:c:E==="-"||E==="("?"":E)+j,X=(x==="s"?eA[8+pM/3]:"")+X+(z&&E==="("?")":""),I){for(Y=-1,ae=B.length;++YU||U>57){X=(U===46?i+B.slice(Y+1):B.slice(Y))+X,B=B.slice(0,Y);break}}}T&&!b&&(B=e(B,1/0));var W=j.length+B.length+X.length,Z=W>1)+j+B+X+Z.slice(W);break;default:B=Z+j+B+X;break}return s(B)}return V.toString=function(){return m+""},V}function g(m,v){var S=d((m=mg(m),m.type="f",m)),E=Math.max(-8,Math.min(8,Math.floor(Oc(v)/3)))*3,w=Math.pow(10,-E),b=eA[8+E/3];return function(A){return S(w*A)+b}}return{format:d,formatPrefix:g}}var yh,mM,vM;Wz({thousands:",",grouping:[3],currency:["$",""]});function Wz(t){return yh=jz(t),mM=yh.format,vM=yh.formatPrefix,yh}function Xz(t){return Math.max(0,-Oc(Math.abs(t)))}function qz(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Oc(e)/3)))*3-Oc(Math.abs(t)))}function Yz(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Oc(e)-Oc(t))+1}function Kz(t,e,n,r){var i=iz(t,e,n),s;switch(r=mg(r??",f"),r.type){case"s":{var l=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(s=qz(i,l))&&(r.precision=s),vM(r,l)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=Yz(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=Xz(i))&&(r.precision=s-(r.type==="%")*2);break}}return mM(r)}function Zz(t){var e=t.domain;return t.ticks=function(n){var r=e();return rz(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return Kz(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,s=r.length-1,l=r[i],c=r[s],f,d,g=10;for(c0;){if(d=H_(l,c,n),d===f)return r[i]=l,r[s]=c,e(r);if(d>0)l=Math.floor(l/d)*d,c=Math.ceil(c/d)*d;else if(d<0)l=Math.ceil(l*d)/d,c=Math.floor(c*d)/d;else break;f=d}return t},t}function mp(){var t=Bz();return t.copy=function(){return Fz(t,mp())},sz.apply(t,arguments),Zz(t)}function vp(t){for(var e=t.length/6|0,n=new Array(e),r=0;r{try{n.onload=()=>r(n),n.onerror=s=>{const l=s instanceof Error?s.message:"error";i(new Error(l))}}catch(s){i(s)}})}const c$={};let tA=!0;async function u$(t,e,n){let r;Ab(n)?r=await yM(t,e,n):r=_M(t,n);const i=e&&e.imagebitmap;return await f$(r,i)}async function f$(t,e=null){if((d$(e)||!tA)&&(e=null),e)try{return await createImageBitmap(t,e)}catch(n){console.warn(n),tA=!1}return await createImageBitmap(t)}function d$(t){for(const e in t||c$)return!1;return!0}function h$(t){return!v$(t,"ftyp",4)||!(t[8]&96)?null:g$(t)}function g$(t){switch(p$(t,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function p$(t,e,n){return String.fromCharCode(...t.slice(e,n))}function m$(t){return[...t].map(e=>e.charCodeAt(0))}function v$(t,e,n=0){const r=m$(e);for(let i=0;i=24&&e.getUint32(0,vs)===2303741511?{mimeType:"image/png",width:e.getUint32(16,vs),height:e.getUint32(20,vs)}:null}function b$(t){const e=ed(t);return e.byteLength>=10&&e.getUint32(0,vs)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,cf),height:e.getUint16(8,cf)}:null}function S$(t){const e=ed(t);return e.byteLength>=14&&e.getUint16(0,vs)===16973&&e.getUint32(2,cf)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,cf),height:e.getUint32(22,cf)}:null}function w$(t){const e=ed(t);if(!(e.byteLength>=3&&e.getUint16(0,vs)===65496&&e.getUint8(2)===255))return null;const{tableMarkers:r,sofMarkers:i}=E$();let s=2;for(;s+9!!bM(new DataView(t))],options:M$},Sn=new Wf({id:"deck"});let Z_={};function P$(t){Z_=t}function jr(t,e,n,r){Sn.level>0&&Z_[t]&&Z_[t].call(null,e,n,r)}function N$(t){const e=t[0],n=t[t.length-1];return e==="{"&&n==="}"||e==="["&&n==="]"}const I$={dataType:null,batchType:null,id:"JSON",name:"JSON",module:"",version:"",options:{},extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:N$,parseTextSync:JSON.parse};function D$(){const t="9.1.1",e=globalThis.deck&&globalThis.deck.VERSION;if(e&&e!==t)throw new Error(`deck.gl - multiple versions detected: ${e} vs ${t}`);return e||(Sn.log(1,`deck.gl ${t}`)(),globalThis.deck={...globalThis.deck,VERSION:t,version:t,log:Sn,_registerLoggers:P$},BD([I$,[O$,{imagebitmap:{premultiplyAlpha:"none"}}]])),t}const F$=D$();function Cb(t,e){if(!t)throw new Error(e||"shadertools: assertion failed.")}const r0={number:{type:"number",validate(t,e){return Number.isFinite(t)&&typeof e=="object"&&(e.max===void 0||t<=e.max)&&(e.min===void 0||t>=e.min)}},array:{type:"array",validate(t,e){return Array.isArray(t)||ArrayBuffer.isView(t)}}};function k$(t){const e={};for(const[n,r]of Object.entries(t))e[n]=B$(r);return e}function B$(t){let e=nA(t);if(e!=="object")return{value:t,...r0[e],type:e};if(typeof t=="object")return t?t.type!==void 0?{...t,...r0[t.type],type:t.type}:t.value===void 0?{type:"object",value:t}:(e=nA(t.value),{...t,...r0[e],type:e}):{type:"object",value:null};throw new Error("props")}function nA(t){return Array.isArray(t)||ArrayBuffer.isView(t)?"array":typeof t}const U$=`#ifdef MODULE_LOGDEPTH + logdepth_adjustPosition(gl_Position); +#endif +`,L$=`#ifdef MODULE_MATERIAL + fragColor = material_filterColor(fragColor); +#endif + +#ifdef MODULE_LIGHTING + fragColor = lighting_filterColor(fragColor); +#endif + +#ifdef MODULE_FOG + fragColor = fog_filterColor(fragColor); +#endif + +#ifdef MODULE_PICKING + fragColor = picking_filterHighlightColor(fragColor); + fragColor = picking_filterPickingColor(fragColor); +#endif + +#ifdef MODULE_LOGDEPTH + logdepth_setFragDepth(); +#endif +`,z$={vertex:U$,fragment:L$},rA=/void\s+main\s*\([^)]*\)\s*\{\n?/,iA=/}\n?[^{}]*$/,i0=[],Vh="__LUMA_INJECT_DECLARATIONS__";function $$(t){const e={vertex:{},fragment:{}};for(const n in t){let r=t[n];const i=V$(n);typeof r=="string"&&(r={order:0,injection:r}),e[i][n]=r}return e}function V$(t){const e=t.slice(0,2);switch(e){case"vs":return"vertex";case"fs":return"fragment";default:throw new Error(e)}}function _g(t,e,n,r=!1){const i=e==="vertex";for(const s in n){const l=n[s];l.sort((f,d)=>f.order-d.order),i0.length=l.length;for(let f=0,d=l.length;ff+c));break;case"vs:#main-end":i&&(t=t.replace(iA,f=>c+f));break;case"fs:#decl":i||(t=t.replace(Vh,c));break;case"fs:#main-start":i||(t=t.replace(rA,f=>f+c));break;case"fs:#main-end":i||(t=t.replace(iA,f=>c+f));break;default:t=t.replace(s,f=>f+c)}}return t=t.replace(Vh,""),r&&(t=t.replace(/\}\s*$/,s=>s+z$[e])),t}function yg(t){t.map(e=>H$(e))}function H$(t){if(t.instance)return;yg(t.dependencies||[]);const{propTypes:e={},deprecations:n=[],inject:r={}}=t,i={normalizedInjections:$$(r),parsedDeprecations:j$(n)};e&&(i.propValidators=k$(e)),t.instance=i;let s={};e&&(s=Object.entries(e).reduce((l,[c,f])=>{const d=f==null?void 0:f.value;return d&&(l[c]=d),l},{})),t.defaultUniforms={...t.defaultUniforms,...s}}function SM(t,e,n){var r;(r=t.deprecations)==null||r.forEach(i=>{var s;(s=i.regex)!=null&&s.test(e)&&(i.deprecated?n.deprecated(i.old,i.new)():n.removed(i.old,i.new)())})}function j$(t){return t.forEach(e=>{switch(e.type){case"function":e.regex=new RegExp(`\\b${e.old}\\(`);break;default:e.regex=new RegExp(`${e.type} ${e.old};`)}}),t}function Rb(t){yg(t);const e={},n={};wM({modules:t,level:0,moduleMap:e,moduleDepth:n});const r=Object.keys(n).sort((i,s)=>n[s]-n[i]).map(i=>e[i]);return yg(r),r}function wM(t){const{modules:e,level:n,moduleMap:r,moduleDepth:i}=t;if(n>=5)throw new Error("Possible loop in shader dependency graph");for(const s of e)r[s.name]=s,(i[s.name]===void 0||i[s.name]l.order-c.order);for(const l of s)n+=` ${l.injection} +`}i.footer&&(n+=` ${i.footer}`),n+=`} +`}return n}function AM(t){const e={vertex:{},fragment:{}};for(const n of t){let r,i;typeof n!="string"?(r=n,i=r.hook):(r={},i=n),i=i.trim();const[s,l]=i.split(":"),c=i.replace(/\(.+/,""),f=Object.assign(r,{signature:l});switch(s){case"vs":e.vertex[c]=f;break;case"fs":e.fragment[c]=f;break;default:throw new Error(s)}}return e}function K$(t,e){return{name:Z$(t,e),language:"glsl",version:Q$(t)}}function Z$(t,e="unnamed"){const r=/#define[^\S\r\n]*SHADER_NAME[^\S\r\n]*([A-Za-z0-9_-]+)\s*/.exec(t);return r?r[1]:e}function Q$(t){let e=100;const n=t.match(/[^\s]+/g);if(n&&n.length>=2&&n[0]==="#version"){const r=parseInt(n[1],10);Number.isFinite(r)&&(e=r)}if(e!==100&&e!==300)throw new Error(`Invalid GLSL version ${e}`);return e}const CM=` + +${Vh} +`,G$=`precision highp float; +`;function J$(t){const e=Rb(t.modules||[]);return{source:tV(t.platformInfo,{...t,source:t.source,stage:"vertex",modules:e}),getUniforms:RM(e)}}function eV(t){const{vs:e,fs:n}=t,r=Rb(t.modules||[]);return{vs:aA(t.platformInfo,{...t,source:e,stage:"vertex",modules:r}),fs:aA(t.platformInfo,{...t,source:n,stage:"fragment",modules:r}),getUniforms:RM(r)}}function tV(t,e){var w;const{source:n,stage:r,modules:i,hookFunctions:s=[],inject:l={},log:c}=e;Cb(typeof n=="string","shader source must be a string");const f=n;let d="";const g=AM(s),m={},v={},S={};for(const b in l){const A=typeof l[b]=="string"?{injection:l[b],order:0}:l[b],T=/^(v|f)s:(#)?([\w-]+)$/.exec(b);if(T){const C=T[2],M=T[3];C?M==="decl"?v[b]=[A]:S[b]=[A]:m[b]=[A]}else S[b]=[A]}const E=i;for(const b of E){c&&SM(b,f,c);const A=xM(b,"wgsl");d+=A;const T=((w=b.injections)==null?void 0:w[r])||{};for(const C in T){const M=/^(v|f)s:#([\w-]+)$/.exec(C);if(M){const N=M[2]==="decl"?v:S;N[C]=N[C]||[],N[C].push(T[C])}else m[C]=m[C]||[],m[C].push(T[C])}}return d+=CM,d=_g(d,r,v),d+=TM(g[r],m),d+=f,d=_g(d,r,S),d}function aA(t,e){var F;const{id:n,source:r,stage:i,language:s="glsl",modules:l,defines:c={},hookFunctions:f=[],inject:d={},prologue:g=!0,log:m}=e;Cb(typeof r=="string","shader source must be a string");const v=s==="glsl"?K$(r).version:-1,S=t.shaderLanguageVersion,E=v===100?"#version 100":"#version 300 es",b=r.split(` +`).slice(1).join(` +`),A={};l.forEach(L=>{Object.assign(A,L.defines)}),Object.assign(A,c);let T="";switch(s){case"wgsl":break;case"glsl":T=g?`${E} + +// ----- PROLOGUE ------------------------- +${nV({id:n,source:r,stage:i})} +${`#define SHADER_TYPE_${i.toUpperCase()}`} + +${W$(t)} +${i==="fragment"?G$:""} + +// ----- APPLICATION DEFINES ------------------------- + +${rV(A)} + +`:`${E} +`;break}const C=AM(f),M={},x={},N={};for(const L in d){const I=typeof d[L]=="string"?{injection:d[L],order:0}:d[L],V=/^(v|f)s:(#)?([\w-]+)$/.exec(L);if(V){const B=V[2],j=V[3];B?j==="decl"?x[L]=[I]:N[L]=[I]:M[L]=[I]}else N[L]=[I]}for(const L of l){m&&SM(L,b,m);const I=xM(L,i);T+=I;const V=((F=L.instance)==null?void 0:F.normalizedInjections[i])||{};for(const B in V){const j=/^(v|f)s:#([\w-]+)$/.exec(B);if(j){const Y=j[2]==="decl"?x:N;Y[B]=Y[B]||[],Y[B].push(V[B])}else M[B]=M[B]||[],M[B].push(V[B])}}return T+="// ----- MAIN SHADER SOURCE -------------------------",T+=CM,T=_g(T,i,x),T+=TM(C[i],M),T+=b,T=_g(T,i,N),s==="glsl"&&v!==S&&(T=X$(T,i)),T.trim()}function RM(t){return function(n){var i;const r={};for(const s of t){const l=(i=s.getUniforms)==null?void 0:i.call(s,n,r);Object.assign(r,l)}return r}}function nV(t){const{id:e,source:n,stage:r}=t;return e&&n.indexOf("SHADER_NAME")===-1?` +#define SHADER_NAME ${e}_${r}`:""}function rV(t={}){let e="";for(const n in t){const r=t[n];(r||Number.isFinite(r))&&(e+=`#define ${n.toUpperCase()} ${t[n]} +`)}return e}function xM(t,e){let n;switch(e){case"vertex":n=t.vs||"";break;case"fragment":n=t.fs||"";break;case"wgsl":n=t.source||"";break;default:Cb(!1)}if(!t.name)throw new Error("Shader module must have a name");const r=t.name.toUpperCase().replace(/[^0-9a-z]/gi,"_");let i=`// ----- MODULE ${t.name} --------------- + +`;return e!=="wgsl"&&(i+=`#define MODULE_${r} +`),i+=`${n} +`,i}const iV=/^\s*\#\s*ifdef\s*([a-zA-Z_]+)\s*$/,sV=/^\s*\#\s*endif\s*$/;function aV(t,e){var l;const n=t.split(` +`),r=[];let i=!0,s=null;for(const c of n){const f=c.match(iV),d=c.match(sV);f?(s=f[1],i=!!((l=e==null?void 0:e.defines)!=null&&l[s])):d?i=!0:i&&r.push(c)}return r.join(` +`)}const wo=class wo{constructor(){O(this,"_hookFunctions",[]);O(this,"_defaultModules",[])}static getDefaultShaderAssembler(){return wo.defaultShaderAssembler=wo.defaultShaderAssembler||new wo,wo.defaultShaderAssembler}addDefaultModule(e){this._defaultModules.find(n=>n.name===(typeof e=="string"?e:e.name))||this._defaultModules.push(e)}removeDefaultModule(e){const n=typeof e=="string"?e:e.name;this._defaultModules=this._defaultModules.filter(r=>r.name!==n)}addShaderHook(e,n){n&&(e=Object.assign(n,{hook:e})),this._hookFunctions.push(e)}assembleWGSLShader(e){const n=this._getModuleList(e.modules),r=this._hookFunctions,{source:i,getUniforms:s}=J$({...e,source:e.source,modules:n,hookFunctions:r});return{source:e.platformInfo.shaderLanguage==="wgsl"?aV(i):i,getUniforms:s,modules:n}}assembleGLSLShaderPair(e){const n=this._getModuleList(e.modules),r=this._hookFunctions;return{...eV({...e,vs:e.vs,fs:e.fs,modules:n,hookFunctions:r}),modules:n}}_getModuleList(e=[]){const n=new Array(this._defaultModules.length+e.length),r={};let i=0;for(let s=0,l=this._defaultModules.length;st.startsWith(e))}function xb(t){let e=SV(t);if(NM(t)){e.channels="rgb",e.components=3,e.bytesPerPixel=1,e.srgb=!1,e.compressed=!0;const r=wV(t);r&&(e.blockWidth=r.blockWidth,e.blockHeight=r.blockHeight)}const n=bV.exec(t);if(n){const[,r,i,s,l,c]=n,f=`${s}${i}`,d=OM(f),g=d.byteLength*8,m=r.length,v=[g,m>=2?g:0,m>=3?g:0,m>=4?g:0];e={format:t,attachment:e.attachment,dataType:d.dataType,components:m,channels:r,integer:d.integer,signed:d.signed,normalized:d.normalized,bitsPerChannel:v,bytesPerPixel:d.byteLength*r.length,packed:e.packed,srgb:e.srgb},c==="-webgl"&&(e.webgl=!0),l==="-srgb"&&(e.srgb=!0)}return t.endsWith("-webgl")&&(e.webgl=!0),t.endsWith("-srgb")&&(e.srgb=!0),e}function SV(t){var s;const e=PM(t),n=e.bytesPerPixel||1,r=e.bitsPerChannel||[8,8,8,8];return delete e.bitsPerChannel,delete e.bytesPerPixel,delete e.f,delete e.render,delete e.filter,delete e.blend,delete e.store,{...e,format:t,attachment:e.attachment||"color",channels:e.channels||"r",components:e.components||((s=e.channels)==null?void 0:s.length)||1,bytesPerPixel:n,bitsPerChannel:r,dataType:e.dataType||"uint8",srgb:e.srgb??!1,packed:e.packed??!1,webgl:e.webgl??!1,integer:e.integer??!1,signed:e.signed??!1,normalized:e.normalized??!1,compressed:e.compressed??!1}}function wV(t){const n=/.*-(\d+)x(\d+)-.*/.exec(t);if(n){const[,r,i]=n;return{blockWidth:Number(r),blockHeight:Number(i)}}return null}function EV(t){const e=PM(t),n={format:t,create:e.f??!0,render:e.render??!0,filter:e.filter??!0,blend:e.blend??!0,store:e.store??!0},r=xb(t),i=t.startsWith("depth")||t.startsWith("stencil"),s=r==null?void 0:r.signed,l=r==null?void 0:r.integer,c=r==null?void 0:r.webgl;return n.render&&(n.render=!s),n.filter&&(n.filter=!i&&!s&&!l&&!c),n}class TV{}class AV{constructor(e=[],n){O(this,"features");O(this,"disabledFeatures");this.features=new Set(e),this.disabledFeatures=n||{}}*[Symbol.iterator](){yield*this.features}has(e){var n;return!((n=this.disabledFeatures)!=null&&n[e])&&this.features.has(e)}}const Vg=class Vg{constructor(e){O(this,"id");O(this,"props");O(this,"userData",{});O(this,"statsManager",MM);O(this,"timestamp",0);O(this,"_reused",!1);O(this,"_lumaData",{});this.props={...Vg.defaultProps,...e},this.id=this.props.id||yp(this[Symbol.toStringTag].toLowerCase())}get[Symbol.toStringTag](){return"Device"}getTextureFormatCapabilities(e){const n=EV(e),r=l=>(typeof l=="string"?this.features.has(l):l)??!0,i=r(n.create),s={format:e,create:i,render:i&&r(n.render),filter:i&&r(n.filter),blend:i&&r(n.blend),store:i&&r(n.store)};return this._getDeviceSpecificTextureFormatCapabilities(s)}isTextureFormatSupported(e,n){return this.getTextureFormatCapabilities(e).create}isTextureFormatFilterable(e){return this.getTextureFormatCapabilities(e).filter}isTextureFormatRenderable(e){return this.getTextureFormatCapabilities(e).render}isTextureFormatCompressed(e){return NM(e)}loseDevice(){return!1}reportError(e){this.props.onError(e)}getDefaultCanvasContext(){if(!this.canvasContext)throw new Error("Device has no default CanvasContext. See props.createCanvasContext");return this.canvasContext}createCommandEncoder(e={}){throw new Error("not implemented")}incrementTimestamp(){return this.timestamp++}onError(e){this.props.onError(e)}getCanvasContext(){return this.getDefaultCanvasContext()}readPixelsToArrayWebGL(e,n){throw new Error("not implemented")}readPixelsToBufferWebGL(e,n){throw new Error("not implemented")}setParametersWebGL(e){throw new Error("not implemented")}getParametersWebGL(e){throw new Error("not implemented")}withParametersWebGL(e,n){throw new Error("not implemented")}clearWebGL(e){throw new Error("not implemented")}resetWebGL(){throw new Error("not implemented")}static _getCanvasContextProps(e){return e.createCanvasContext===!0?{}:e.createCanvasContext}_normalizeBufferProps(e){(e instanceof ArrayBuffer||ArrayBuffer.isView(e))&&(e={data:e});const n={...e};return(e.usage||0)&$n.INDEX&&!e.indexType&&(e.data instanceof Uint32Array?n.indexType="uint32":e.data instanceof Uint16Array?n.indexType="uint16":Re.warn("indices buffer content must be of integer type")()),n}};O(Vg,"defaultProps",{id:null,powerPreference:"high-performance",failIfMajorPerformanceCaveat:!1,createCanvasContext:void 0,onError:e=>Re.error(e.message)(),_reuseDevices:!1,_requestMaxLimits:!0,_factoryDestroyPolicy:"unused",_initializeFeatures:!0,_disabledFeatures:{"compilation-status-async-webgl":!0},_resourceDefaults:{},webgl:{},debug:Re.get("debug")||void 0,debugShaders:Re.get("debug-shaders")||void 0,debugFramebuffers:!!Re.get("debug-framebuffers"),debugWebGL:!!Re.get("debug-webgl"),debugSpectorJS:void 0,debugSpectorJSUrl:void 0,_handle:void 0});let La=Vg;const CV=qo()&&typeof document<"u",RV=()=>CV&&document.readyState==="complete",xV="set luma.log.level=1 (or higher) to trace rendering",cA="No matching device found. Ensure `@luma.gl/webgl` and/or `@luma.gl/webgpu` modules are imported.",Aa=class Aa{constructor(){O(this,"stats",MM);O(this,"log",Re);O(this,"VERSION","9.1.2");O(this,"spector");O(this,"preregisteredAdapters",new Map);if(globalThis.luma){if(globalThis.luma.VERSION!==this.VERSION)throw Re.error(`Found luma.gl ${globalThis.luma.VERSION} while initialzing ${this.VERSION}`)(),Re.error("'yarn why @luma.gl/core' can help identify the source of the conflict")(),new Error("luma.gl - multiple versions detected: see console log");Re.error("This version of luma.gl has already been initialized")()}Re.log(1,`${this.VERSION} - ${xV}`)(),globalThis.luma=this}registerAdapters(e){for(const n of e)this.preregisteredAdapters.set(n.type,n)}getSupportedAdapters(e=[]){const n=this.getAdapterMap(e);return Array.from(n).map(([,r])=>r).filter(r=>{var i;return(i=r.isSupported)==null?void 0:i.call(r)}).map(r=>r.type)}getBestAvailableAdapter(e=[]){var r,i,s,l;const n=this.getAdapterMap(e);return(i=(r=n.get("webgpu"))==null?void 0:r.isSupported)!=null&&i.call(r)?"webgpu":(l=(s=n.get("webgl"))==null?void 0:s.isSupported)!=null&&l.call(s)?"webgl":null}setDefaultDeviceProps(e){Object.assign(Aa.defaultProps,e)}async createDevice(e={}){var c;e={...Aa.defaultProps,...e},e.waitForPageLoad&&await Aa.pageLoaded;const n=this.getAdapterMap(e.adapters);let r=e.type||"";r==="best-available"&&(r=this.getBestAvailableAdapter(e.adapters)||r);const s=(this.getAdapterMap(e.adapters)||n).get(r),l=await((c=s==null?void 0:s.create)==null?void 0:c.call(s,e));if(l)return l;throw new Error(cA)}async attachDevice(e){var l;const n=this.getAdapterMap(e.adapters);let r="";e.handle instanceof WebGL2RenderingContext&&(r="webgl"),e.createCanvasContext&&await Aa.pageLoaded,e.handle===null&&(r="unknown");const i=n.get(r),s=await((l=i==null?void 0:i.attach)==null?void 0:l.call(i,null));if(s)return s;throw new Error(cA)}enforceWebGL2(e=!0,n=[]){var s;const i=this.getAdapterMap(n).get("webgl");i||Re.warn("enforceWebGL2: webgl adapter not found")(),(s=i==null?void 0:i.enforceWebGL2)==null||s.call(i,e)}getAdapterMap(e=[]){const n=new Map(this.preregisteredAdapters);for(const r of e)n.set(r.type,r);return n}registerDevices(e){Re.warn("luma.registerDevices() is deprecated, use luma.registerAdapters() instead");for(const n of e){const r=n.adapter;r&&this.preregisteredAdapters.set(r.type,r)}}};O(Aa,"defaultProps",{...La.defaultProps,type:"best-available",adapters:void 0,waitForPageLoad:!0}),O(Aa,"pageLoaded",MV().then(()=>{Re.probe(2,"DOM is loaded")()}));let G_=Aa;const J_=new G_;function MV(){return RV()||typeof window>"u"?Promise.resolve():new Promise(t=>{window.addEventListener("load",()=>t())})}class OV{}const Hg=class Hg{constructor(e){O(this,"id");O(this,"props");O(this,"canvas");O(this,"htmlCanvas");O(this,"offscreenCanvas");O(this,"type");O(this,"width",1);O(this,"height",1);O(this,"resizeObserver");O(this,"_canvasSizeInfo",{clientWidth:0,clientHeight:0,devicePixelRatio:1});if(this.props={...Hg.defaultProps,...e},e=this.props,!qo()){this.id="node-canvas-context",this.type="node",this.width=this.props.width,this.height=this.props.height,this.canvas=null;return}if(e.canvas)typeof e.canvas=="string"?this.canvas=NV(e.canvas):this.canvas=e.canvas;else{const n=IV(e),r=PV((e==null?void 0:e.container)||null);r.insertBefore(n,r.firstChild),this.canvas=n,e!=null&&e.visible||(this.canvas.style.visibility="hidden")}this.canvas instanceof HTMLCanvasElement?(this.id=this.canvas.id,this.type="html-canvas",this.htmlCanvas=this.canvas):(this.id="offscreen-canvas",this.type="offscreen-canvas",this.offscreenCanvas=this.canvas),this.canvas instanceof HTMLCanvasElement&&e.autoResize&&(this.resizeObserver=new ResizeObserver(n=>{for(const r of n)r.target===this.canvas&&this.update()}),this.resizeObserver.observe(this.canvas))}toString(){return`${this[Symbol.toStringTag]}(${this.id})`}getDevicePixelRatio(e){return typeof OffscreenCanvas<"u"&&this.canvas instanceof OffscreenCanvas||(e=e===void 0?this.props.useDevicePixels:e,!e||e<=0)?1:e===!0?typeof window<"u"&&window.devicePixelRatio||1:e}getPixelSize(){switch(this.type){case"node":return[this.width,this.height];case"offscreen-canvas":return[this.canvas.width,this.canvas.height];case"html-canvas":const e=this.getDevicePixelRatio(),n=this.canvas;return n.parentElement?[n.clientWidth*e,n.clientHeight*e]:[this.canvas.width,this.canvas.height];default:throw new Error(this.type)}}getAspect(){const[e,n]=this.getPixelSize();return e/n}cssToDeviceRatio(){var e;try{const[n]=this.getDrawingBufferSize(),r=this._canvasSizeInfo.clientWidth||((e=this.htmlCanvas)==null?void 0:e.clientWidth);return r?n/r:1}catch{return 1}}cssToDevicePixels(e,n=!0){const r=this.cssToDeviceRatio(),[i,s]=this.getDrawingBufferSize();return DV(e,r,i,s,n)}setDevicePixelRatio(e,n={}){if(!this.htmlCanvas)return;let r="width"in n?n.width:this.htmlCanvas.clientWidth,i="height"in n?n.height:this.htmlCanvas.clientHeight;(!r||!i)&&(Re.log(1,"Canvas clientWidth/clientHeight is 0")(),e=1,r=this.htmlCanvas.width||1,i=this.htmlCanvas.height||1);const s=this._canvasSizeInfo;if(s.clientWidth!==r||s.clientHeight!==i||s.devicePixelRatio!==e){let l=e;const c=Math.floor(r*l),f=Math.floor(i*l);if(this.htmlCanvas.width=c,this.htmlCanvas.height=f,this.device.gl){const[g,m]=this.getDrawingBufferSize();(g!==c||m!==f)&&(l=Math.min(g/r,m/i),this.htmlCanvas.width=Math.floor(r*l),this.htmlCanvas.height=Math.floor(i*l),Re.warn("Device pixel ratio clamped")()),this._canvasSizeInfo.clientWidth=r,this._canvasSizeInfo.clientHeight=i,this._canvasSizeInfo.devicePixelRatio=e}}}getDrawingBufferSize(){const e=this.device.gl;if(!e)throw new Error("canvas size");return[e.drawingBufferWidth,e.drawingBufferHeight]}_setAutoCreatedCanvasId(e){var n;((n=this.htmlCanvas)==null?void 0:n.id)==="lumagl-auto-created-canvas"&&(this.htmlCanvas.id=e)}};O(Hg,"defaultProps",{canvas:null,width:800,height:600,useDevicePixels:!0,autoResize:!0,container:null,visible:!0,alphaMode:"opaque",colorSpace:"srgb"});let ey=Hg;function PV(t){if(typeof t=="string"){const e=document.getElementById(t);if(!e)throw new Error(`${t} is not an HTML element`);return e}else if(t)return t;return document.body}function NV(t){const e=document.getElementById(t);if(!(e instanceof HTMLCanvasElement))throw new Error("Object is not a canvas element");return e}function IV(t){const{width:e,height:n}=t,r=document.createElement("canvas");return r.id=yp("lumagl-auto-created-canvas"),r.width=e||1,r.height=n||1,r.style.width=Number.isFinite(e)?`${e}px`:"100%",r.style.height=Number.isFinite(n)?`${n}px`:"100%",r}function DV(t,e,n,r,i){const s=t,l=uA(s[0],e,n);let c=fA(s[1],e,r,i),f=uA(s[0]+1,e,n);const d=f===n-1?f:f-1;f=fA(s[1]+1,e,r,i);let g;return i?(f=f===0?f:f+1,g=c,c=f):g=f===r-1?f:f-1,{x:l,y:c,width:Math.max(d-l+1,1),height:Math.max(g-c+1,1)}}function uA(t,e,n){return Math.min(Math.round(t*e),n-1)}function fA(t,e,n,r){return r?Math.max(0,n-1-Math.round(t*e)):Math.min(Math.round(t*e),n-1)}const xr=class xr extends mn{constructor(n,r){r=xr.normalizeProps(n,r);super(n,r,xr.defaultProps);O(this,"dimension");O(this,"format");O(this,"width");O(this,"height");O(this,"depth");O(this,"mipLevels");O(this,"updateTimestamp");if(this.dimension=this.props.dimension,this.format=this.props.format,this.width=this.props.width,this.height=this.props.height,this.depth=this.props.depth,this.props.width===void 0||this.props.height===void 0){const i=xr.getTextureDataSize(this.props.data);this.width=(i==null?void 0:i.width)||1,this.height=(i==null?void 0:i.height)||1}this.props.mipmaps&&this.props.mipLevels===void 0&&(this.props.mipLevels="pyramid"),this.mipLevels=this.props.mipLevels==="pyramid"?xr.getMipLevelCount(this.width,this.height):this.props.mipLevels||1,this.updateTimestamp=n.incrementTimestamp()}get[Symbol.toStringTag](){return"Texture"}toString(){return`Texture(${this.id},${this.format},${this.width}x${this.height})`}clone(n){return this.device.createTexture({...this.props,...n})}static isExternalImage(n){return typeof ImageData<"u"&&n instanceof ImageData||typeof ImageBitmap<"u"&&n instanceof ImageBitmap||typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement||typeof HTMLVideoElement<"u"&&n instanceof HTMLVideoElement||typeof VideoFrame<"u"&&n instanceof VideoFrame||typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas}static getExternalImageSize(n){if(typeof ImageData<"u"&&n instanceof ImageData||typeof ImageBitmap<"u"&&n instanceof ImageBitmap||typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas)return{width:n.width,height:n.height};if(typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement)return{width:n.naturalWidth,height:n.naturalHeight};if(typeof HTMLVideoElement<"u"&&n instanceof HTMLVideoElement)return{width:n.videoWidth,height:n.videoHeight};if(typeof VideoFrame<"u"&&n instanceof VideoFrame)return{width:n.displayWidth,height:n.displayHeight};throw new Error("Unknown image type")}static isTextureLevelData(n){const r=n==null?void 0:n.data;return ArrayBuffer.isView(r)}static getTextureDataSize(n){if(!n||ArrayBuffer.isView(n))return null;if(Array.isArray(n))return xr.getTextureDataSize(n[0]);if(xr.isExternalImage(n))return xr.getExternalImageSize(n);if(n&&typeof n=="object"&&n.constructor===Object){const i=Object.values(n)[0];return{width:i.width,height:i.height}}throw new Error("texture size deduction failed")}static normalizeTextureData(n,r){let i;return ArrayBuffer.isView(n)?i=[{data:n,width:r.width,height:r.height}]:Array.isArray(n)?i=n:i=[n],i}static getMipLevelCount(n,r){return Math.floor(Math.log2(Math.max(n,r)))+1}static getCubeFaceDepth(n){switch(n){case"+X":return 0;case"-X":return 1;case"+Y":return 2;case"-Y":return 3;case"+Z":return 4;case"-Z":return 5;default:throw new Error(n)}}static normalizeProps(n,r){var f,d;const i={...r},s=((d=(f=n==null?void 0:n.props)==null?void 0:f._resourceDefaults)==null?void 0:d.texture)||{};Object.assign(i,s);const{width:l,height:c}=i;return typeof l=="number"&&(i.width=Math.max(1,Math.ceil(l))),typeof c=="number"&&(i.height=Math.max(1,Math.ceil(c))),i}};O(xr,"COPY_SRC",1),O(xr,"COPY_DST",2),O(xr,"TEXTURE",4),O(xr,"STORAGE",8),O(xr,"RENDER_ATTACHMENT",16),O(xr,"CubeFaces",["+X","-X","+Y","-Y","+Z","-Z"]),O(xr,"defaultProps",{...mn.defaultProps,data:null,dimension:"2d",format:"rgba8unorm",width:void 0,height:void 0,depth:1,mipmaps:!1,compressed:!1,usage:0,mipLevels:void 0,samples:void 0,sampler:{},view:void 0,flipY:void 0}),O(xr,"defaultCopyExternalImageOptions",{image:void 0,sourceX:0,sourceY:0,width:void 0,height:void 0,depth:1,mipLevel:0,x:0,y:0,z:0,aspect:"all",colorSpace:"srgb",premultipliedAlpha:!1,flipY:!1});let Kn=xr;const jg=class jg extends mn{get[Symbol.toStringTag](){return"TextureView"}constructor(e,n){super(e,n,jg.defaultProps)}};O(jg,"defaultProps",{...mn.defaultProps,format:void 0,dimension:void 0,aspect:"all",baseMipLevel:0,mipLevelCount:void 0,baseArrayLayer:0,arrayLayerCount:void 0});let Sg=jg;function FV(t,e,n){let r="";const i=e.split(/\r?\n/),s=t.slice().sort((l,c)=>l.lineNum-c.lineNum);switch((n==null?void 0:n.showSourceCode)||"no"){case"all":let l=0;for(let c=1;c<=i.length;c++)for(r+=IM(i[c-1],c,n);s.length>l&&s[l].lineNum===c;){const f=s[l++];r+=dA(f,i,f.lineNum,{...n,inlineSource:!1})}return r;case"issues":case"no":for(const c of t)r+=dA(c,i,c.lineNum,{inlineSource:(n==null?void 0:n.showSourceCode)!=="no"});return r}}function dA(t,e,n,r){if(r!=null&&r.inlineSource){const s=kV(e,n),l=t.linePos>0?`${" ".repeat(t.linePos+5)}^^^ +`:"";return` +${s}${l}${t.type.toUpperCase()}: ${t.message} + +`}const i=t.type==="error"?"red":"#8B4000";return r!=null&&r.html?`
${t.type.toUpperCase()}: ${t.message}
`:`${t.type.toUpperCase()}: ${t.message}`}function kV(t,e,n){let r="";for(let i=e-2;i<=e;i++){const s=t[i-1];s!==void 0&&(r+=IM(s,e,n))}return r}function IM(t,e,n){const r=n!=null&&n.html?UV(t):t;return`${BV(String(e),4)}: ${r}${n!=null&&n.html?"
":` +`}`}function BV(t,e){let n="";for(let r=t.length;r",">").replaceAll('"',""").replaceAll("'","'")}const Wg=class Wg extends mn{constructor(n,r){r={...r,debugShaders:r.debugShaders||n.props.debugShaders||"errors"};super(n,{id:LV(r),...r},Wg.defaultProps);O(this,"stage");O(this,"source");O(this,"compilationStatus","pending");this.stage=this.props.stage,this.source=this.props.source}get[Symbol.toStringTag](){return"Shader"}getCompilationInfoSync(){return null}getTranslatedSource(){return null}async debugShader(){const n=this.props.debugShaders;switch(n){case"never":return;case"errors":if(this.compilationStatus==="success")return;break}const r=await this.getCompilationInfo();n==="warnings"&&(r==null?void 0:r.length)===0||this._displayShaderLog(r)}_displayShaderLog(n){var d;if(typeof document>"u"||!(document!=null&&document.createElement))return;const r=DM(this.source),i=`${this.stage} ${r}`;let s=FV(n,this.source,{showSourceCode:"all",html:!0});const l=this.getTranslatedSource();l&&(s+=`

Translated Source



${l}
`);const c=document.createElement("Button");c.innerHTML=` +

Shader Compilation Error in ${i}



+
+${s}
+
`,c.style.top="10px",c.style.left="10px",c.style.position="absolute",c.style.zIndex="9999",c.style.width="100%",c.style.textAlign="left",document.body.appendChild(c),(d=document.getElementsByClassName("luma-compiler-log-error")[0])==null||d.scrollIntoView(),c.onclick=()=>{const g=`data:text/plain,${encodeURIComponent(this.source)}`;navigator.clipboard.writeText(g)}}};O(Wg,"defaultProps",{...mn.defaultProps,language:"auto",stage:void 0,source:"",sourceMap:null,entryPoint:"main",debugShaders:void 0});let wg=Wg;function LV(t){return DM(t.source)||t.id||yp(`unnamed ${t.stage}-shader`)}function DM(t,e="unnamed"){const r=/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/.exec(t);return r?r[1]:e}const pf=class pf extends mn{get[Symbol.toStringTag](){return"Sampler"}constructor(e,n){n=pf.normalizeProps(e,n),super(e,n,pf.defaultProps)}static normalizeProps(e,n){var s,l;const r=((l=(s=e==null?void 0:e.props)==null?void 0:s._resourceDefaults)==null?void 0:l.sampler)||{};return{...n,...r}}};O(pf,"defaultProps",{...mn.defaultProps,type:"color-sampler",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge",addressModeW:"clamp-to-edge",magFilter:"nearest",minFilter:"nearest",mipmapFilter:"none",lodMinClamp:0,lodMaxClamp:32,compare:"less-equal",maxAnisotropy:1});let Eg=pf;const Xg=class Xg extends mn{constructor(n,r={}){super(n,r,Xg.defaultProps);O(this,"width");O(this,"height");this.width=this.props.width,this.height=this.props.height}get[Symbol.toStringTag](){return"Framebuffer"}clone(n){const r=this.colorAttachments.map(s=>s.texture.clone(n)),i=this.depthStencilAttachment&&this.depthStencilAttachment.texture.clone(n);return this.device.createFramebuffer({...this.props,colorAttachments:r,depthStencilAttachment:i})}resize(n){let r=!n;if(n){const[i,s]=Array.isArray(n)?n:[n.width,n.height];r=r||s!==this.height||i!==this.width,this.width=i,this.height=s}r&&(Re.log(2,`Resizing framebuffer ${this.id} to ${this.width}x${this.height}`)(),this.resizeAttachments(this.width,this.height))}autoCreateAttachmentTextures(){if(this.props.colorAttachments.length===0&&!this.props.depthStencilAttachment)throw new Error("Framebuffer has noattachments");this.colorAttachments=this.props.colorAttachments.map((r,i)=>{if(typeof r=="string"){const s=this.createColorTexture(r,i);return this.attachResource(s),s.view}return r instanceof Kn?r.view:r});const n=this.props.depthStencilAttachment;if(n)if(typeof n=="string"){const r=this.createDepthStencilTexture(n);this.attachResource(r),this.depthStencilAttachment=r.view}else n instanceof Kn?this.depthStencilAttachment=n.view:this.depthStencilAttachment=n}createColorTexture(n,r){return this.device.createTexture({id:`${this.id}-color-attachment-${r}`,usage:Kn.RENDER_ATTACHMENT,format:n,width:this.width,height:this.height,sampler:{magFilter:"linear",minFilter:"linear"}})}createDepthStencilTexture(n){return this.device.createTexture({id:`${this.id}-depth-stencil-attachment`,usage:Kn.RENDER_ATTACHMENT,format:n,width:this.width,height:this.height,mipmaps:!1})}resizeAttachments(n,r){for(let i=0;i":["f32",2],"vec3":["f32",3],"vec4":["f32",4],f16:["f16",1],"vec2":["f16",2],"vec3":["f16",3],"vec4":["f16",4],i32:["i32",1],"vec2":["i32",2],"vec3":["i32",3],"vec4":["i32",4],u32:["u32",1],"vec2":["u32",2],"vec3":["u32",3],"vec4":["u32",4]},HV={f32:4,f16:2,i32:4,u32:4};function FM(t){let e;t.endsWith("-webgl")&&(t.replace("-webgl",""),e=!0);const[n,r]=t.split("x"),i=n,s=r?parseInt(r):1,l=OM(i),c={type:i,components:s,byteLength:l.byteLength*s,integer:l.integer,signed:l.signed,normalized:l.normalized};return e&&(c.webglOnly=!0),c}function kM(t,e){const n={};for(const r of t.attributes){const i=WV(t,e,r.name);i&&(n[r.name]=i)}return n}function jV(t,e,n=16){const r=kM(t,e),i=new Array(n).fill(null);for(const s of Object.values(r))i[s.location]=s;return i}function WV(t,e,n){const r=XV(t,n),i=qV(e,n);if(!r)return null;const s=zV(r.type),l=(i==null?void 0:i.vertexFormat)||s.defaultVertexFormat,c=FM(l);return{attributeName:(i==null?void 0:i.attributeName)||r.name,bufferName:(i==null?void 0:i.bufferName)||r.name,location:r.location,shaderType:r.type,shaderDataType:s.dataType,shaderComponents:s.components,vertexFormat:l,bufferDataType:c.type,bufferComponents:c.components,normalized:c.normalized,integer:s.integer,stepMode:(i==null?void 0:i.stepMode)||r.stepMode||"vertex",byteOffset:(i==null?void 0:i.byteOffset)||0,byteStride:(i==null?void 0:i.byteStride)||0}}function XV(t,e){const n=t.attributes.find(r=>r.name===e);return n||Re.warn(`shader layout attribute "${e}" not present in shader`),n||null}function qV(t,e){YV(t);let n=KV(t,e);return n||(n=ZV(t,e),n)?n:(Re.warn(`layout for attribute "${e}" not present in buffer layout`),null)}function YV(t){for(const e of t)(e.attributes&&e.format||!e.attributes&&!e.format)&&Re.warn(`BufferLayout ${name} must have either 'attributes' or 'format' field`)}function KV(t,e){for(const n of t)if(n.format&&n.name===e)return{attributeName:n.name,bufferName:e,stepMode:n.stepMode,vertexFormat:n.format,byteOffset:0,byteStride:n.byteStride||0};return null}function ZV(t,e){var n;for(const r of t){let i=r.byteStride;if(typeof r.byteStride!="number")for(const l of r.attributes||[]){const c=FM(l.format);i+=c.byteLength}const s=(n=r.attributes)==null?void 0:n.find(l=>l.attribute===e);if(s)return{attributeName:s.attribute,bufferName:r.name,stepMode:r.stepMode,vertexFormat:s.format,byteOffset:s.byteOffset,byteStride:i}}return null}const Qg=class Qg extends mn{constructor(n,r){super(n,r,Qg.defaultProps);O(this,"maxVertexAttributes");O(this,"attributeInfos");O(this,"indexBuffer",null);O(this,"attributes");this.maxVertexAttributes=n.limits.maxVertexAttributes,this.attributes=new Array(this.maxVertexAttributes).fill(null);const{shaderLayout:i,bufferLayout:s}=r.renderPipeline||{};if(!i||!s)throw new Error("VertexArray");this.attributeInfos=jV(i,s,this.maxVertexAttributes)}get[Symbol.toStringTag](){return"VertexArray"}setConstantWebGL(n,r){throw new Error("constant attributes not supported")}};O(Qg,"defaultProps",{...mn.defaultProps,renderPipeline:null});let iy=Qg;const Gg=class Gg extends mn{get[Symbol.toStringTag](){return"TransformFeedback"}constructor(e,n){super(e,n,Gg.defaultProps)}};O(Gg,"defaultProps",{...mn.defaultProps,layout:void 0,buffers:{}});let sy=Gg;const Jg=class Jg extends mn{get[Symbol.toStringTag](){return"QuerySet"}constructor(e,n){super(e,n,Jg.defaultProps)}};O(Jg,"defaultProps",{...mn.defaultProps,type:void 0,count:void 0});let ay=Jg;const QV={f32:{type:"f32",components:1},i32:{type:"i32",components:1},u32:{type:"u32",components:1},"vec2":{type:"f32",components:2},"vec3":{type:"f32",components:3},"vec4":{type:"f32",components:4},"vec2":{type:"i32",components:2},"vec3":{type:"i32",components:3},"vec4":{type:"i32",components:4},"vec2":{type:"u32",components:2},"vec3":{type:"u32",components:3},"vec4":{type:"u32",components:4},"mat2x2":{type:"f32",components:4},"mat2x3":{type:"f32",components:6},"mat2x4":{type:"f32",components:8},"mat3x2":{type:"f32",components:6},"mat3x3":{type:"f32",components:9},"mat3x4":{type:"f32",components:12},"mat4x2":{type:"f32",components:8},"mat4x3":{type:"f32",components:12},"mat4x4":{type:"f32",components:16}};function GV(t){return QV[t]}function JV(t,e){switch(e){case 1:return t;case 2:return t+t%2;default:return t+(4-t%4)%4}}let Eh;function BM(t){return(!Eh||Eh.byteLengths.type==="uniform"&&s.name===(e==null?void 0:e.name));if(!r)throw new Error(e==null?void 0:e.name);const i=r;for(const s of i.uniforms||[])this.bindingLayout[s.name]=s}}setUniforms(e){for(const[n,r]of Object.entries(e))this._setUniform(n,r),this.needsRedraw||this.setNeedsRedraw(`${this.name}.${n}=${r}`)}setNeedsRedraw(e){this.needsRedraw=this.needsRedraw||e}getAllUniforms(){return this.modifiedUniforms={},this.needsRedraw=!1,this.uniforms||{}}_setUniform(e,n){rH(this.uniforms[e],n)||(this.uniforms[e]=iH(n),this.modifiedUniforms[e]=!0,this.modified=!0)}}class aH{constructor(e){O(this,"uniformBlocks",new Map);O(this,"uniformBufferLayouts",new Map);O(this,"uniformBuffers",new Map);for(const[n,r]of Object.entries(e)){const i=n,s=new nH(r.uniformTypes||{});this.uniformBufferLayouts.set(i,s);const l=new sH({name:n});l.setUniforms(r.defaultUniforms||{}),this.uniformBlocks.set(i,l)}}destroy(){for(const e of this.uniformBuffers.values())e.destroy()}setUniforms(e){var n;for(const[r,i]of Object.entries(e))(n=this.uniformBlocks.get(r))==null||n.setUniforms(i);this.updateUniformBuffers()}getUniformBufferByteLength(e){var n;return((n=this.uniformBufferLayouts.get(e))==null?void 0:n.byteLength)||0}getUniformBufferData(e){var r,i;const n=((r=this.uniformBlocks.get(e))==null?void 0:r.getAllUniforms())||{};return(i=this.uniformBufferLayouts.get(e))==null?void 0:i.getData(n)}createUniformBuffer(e,n,r){r&&this.setUniforms(r);const i=this.getUniformBufferByteLength(n),s=e.createBuffer({usage:$n.UNIFORM|$n.COPY_DST,byteLength:i}),l=this.getUniformBufferData(n);return s.write(l),s}getManagedUniformBuffer(e,n){if(!this.uniformBuffers.get(n)){const r=this.getUniformBufferByteLength(n),i=e.createBuffer({usage:$n.UNIFORM|$n.COPY_DST,byteLength:r});this.uniformBuffers.set(n,i)}return this.uniformBuffers.get(n)}updateUniformBuffers(){let e=!1;for(const n of this.uniformBlocks.keys()){const r=this.updateUniformBuffer(n);e||(e=r)}return e&&Re.log(3,`UniformStore.updateUniformBuffers(): ${e}`)(),e}updateUniformBuffer(e){var s;const n=this.uniformBlocks.get(e);let r=this.uniformBuffers.get(e),i=!1;if(r&&(n!=null&&n.needsRedraw)){i||(i=n.needsRedraw);const l=this.getUniformBufferData(e);r=this.uniformBuffers.get(e),r==null||r.write(l);const c=(s=this.uniformBlocks.get(e))==null?void 0:s.getAllUniforms();Re.log(4,`Writing to uniform buffer ${String(e)}`,l,c)()}return i}}function UM(t){const e=ArrayBuffer.isView(t)?t.constructor:t;switch(e){case Float32Array:return"float32";case Uint16Array:return"uint16";case Uint32Array:return"uint32";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int8Array:return"sint8";case Int16Array:return"sint16";case Int32Array:return"sint32";default:throw new Error(e.constructor.name)}}function LM(t){switch(t){case"float32":return Float32Array;case"uint32":return Uint32Array;case"sint32":return Int32Array;case"uint16":case"unorm16":return Uint16Array;case"sint16":case"snorm16":return Int16Array;case"uint8":case"unorm8":return Uint8Array;case"sint8":case"snorm8":return Int8Array;default:throw new Error(t)}}function oH(t,e,n){if(!e||e>4)throw new Error(`size ${e}`);const r=e;let i=UM(t);if(i==="uint8"&&n&&r===1)return"unorm8-webgl";if(i==="uint8"&&n&&r===3)return"unorm8x3-webgl";if(i==="uint8"||i==="sint8"){if(r===1||r===3)throw new Error(`size: ${e}`);return n&&(i=i.replace("int","norm")),`${i}x${r}`}if(i==="uint16"||i==="sint16"){if(r===1||r===3)throw new Error(`size: ${e}`);return n&&(i=i.replace("int","norm")),`${i}x${r}`}return r===1?i:`${i}x${r}`}class u0{constructor(e){O(this,"bufferLayouts");this.bufferLayouts=e}getBufferLayout(e){return this.bufferLayouts.find(n=>n.name===e)||null}getAttributeNamesForBuffer(e){var n;return e.attributes?(n=e.attributes)==null?void 0:n.map(r=>r.attribute):[e.name]}mergeBufferLayouts(e,n){const r=[...e];for(const i of n){const s=r.findIndex(l=>l.name===i.name);s<0?r.push(i):r[s]=i}return r}}class lH{constructor(){this.constants=new Map,this.aliases=new Map,this.structs=new Map}}class Ys{constructor(){}get isAstNode(){return!0}get astNodeType(){return""}evaluate(e){throw new Error("Cannot evaluate node")}evaluateString(e){return this.evaluate(e).toString()}search(e){}searchBlock(e,n){if(e){n(Rg.instance);for(const r of e)r instanceof Array?this.searchBlock(r,n):r.search(n);n(xg.instance)}}}class Rg extends Ys{}Rg.instance=new Rg;class xg extends Ys{}xg.instance=new xg;class kn extends Ys{constructor(){super()}}let oy=class extends kn{constructor(e,n,r,i,s,l){super(),this.calls=new Set,this.name=e,this.args=n,this.returnType=r,this.body=i,this.startLine=s,this.endLine=l}get astNodeType(){return"function"}search(e){this.searchBlock(this.body,e)}};class cH extends kn{constructor(e){super(),this.expression=e}get astNodeType(){return"staticAssert"}search(e){this.expression.search(e)}}class uH extends kn{constructor(e,n){super(),this.condition=e,this.body=n}get astNodeType(){return"while"}search(e){this.condition.search(e),this.searchBlock(this.body,e)}}class fH extends kn{constructor(e){super(),this.body=e}get astNodeType(){return"continuing"}search(e){this.searchBlock(this.body,e)}}class dH extends kn{constructor(e,n,r,i){super(),this.init=e,this.condition=n,this.increment=r,this.body=i}get astNodeType(){return"for"}search(e){var n,r,i;(n=this.init)===null||n===void 0||n.search(e),(r=this.condition)===null||r===void 0||r.search(e),(i=this.increment)===null||i===void 0||i.search(e),this.searchBlock(this.body,e)}}class bo extends kn{constructor(e,n,r,i,s){super(),this.name=e,this.type=n,this.storage=r,this.access=i,this.value=s}get astNodeType(){return"var"}search(e){var n;e(this),(n=this.value)===null||n===void 0||n.search(e)}}class zM extends kn{constructor(e,n,r){super(),this.name=e,this.type=n,this.value=r}get astNodeType(){return"override"}search(e){var n;(n=this.value)===null||n===void 0||n.search(e)}}class ly extends kn{constructor(e,n,r,i,s){super(),this.name=e,this.type=n,this.storage=r,this.access=i,this.value=s}get astNodeType(){return"let"}search(e){var n;e(this),(n=this.value)===null||n===void 0||n.search(e)}}class gA extends kn{constructor(e,n,r,i,s){super(),this.name=e,this.type=n,this.storage=r,this.access=i,this.value=s}get astNodeType(){return"const"}evaluate(e){return this.value.evaluate(e)}search(e){var n;e(this),(n=this.value)===null||n===void 0||n.search(e)}}var Nc;(function(t){t.increment="++",t.decrement="--"})(Nc||(Nc={}));(function(t){function e(n){const r=n;if(r=="parse")throw new Error("Invalid value for IncrementOperator");return t[r]}t.parse=e})(Nc||(Nc={}));class hH extends kn{constructor(e,n){super(),this.operator=e,this.variable=n}get astNodeType(){return"increment"}search(e){this.variable.search(e)}}var Df;(function(t){t.assign="=",t.addAssign="+=",t.subtractAssin="-=",t.multiplyAssign="*=",t.divideAssign="/=",t.moduloAssign="%=",t.andAssign="&=",t.orAssign="|=",t.xorAssign="^=",t.shiftLeftAssign="<<=",t.shiftRightAssign=">>="})(Df||(Df={}));(function(t){function e(n){const r=n;if(r=="parse")throw new Error("Invalid value for AssignOperator");return r}t.parse=e})(Df||(Df={}));class gH extends kn{constructor(e,n,r){super(),this.operator=e,this.variable=n,this.value=r}get astNodeType(){return"assign"}search(e){this.variable.search(e),this.value.search(e)}}class $M extends kn{constructor(e,n){super(),this.name=e,this.args=n}get astNodeType(){return"call"}search(e){for(const n of this.args)n.search(e);e(this)}}class pH extends kn{constructor(e,n){super(),this.body=e,this.continuing=n}get astNodeType(){return"loop"}}class mH extends kn{constructor(e,n){super(),this.condition=e,this.body=n}get astNodeType(){return"body"}}class vH extends kn{constructor(e,n,r,i){super(),this.condition=e,this.body=n,this.elseif=r,this.else=i}get astNodeType(){return"if"}search(e){this.condition.search(e),this.searchBlock(this.body,e),this.searchBlock(this.elseif,e),this.searchBlock(this.else,e)}}class _H extends kn{constructor(e){super(),this.value=e}get astNodeType(){return"return"}search(e){var n;(n=this.value)===null||n===void 0||n.search(e)}}class yH extends kn{constructor(e){super(),this.name=e}get astNodeType(){return"enable"}}class bH extends kn{constructor(e){super(),this.extensions=e}get astNodeType(){return"requires"}}class SH extends kn{constructor(e,n){super(),this.severity=e,this.rule=n}get astNodeType(){return"diagnostic"}}class VM extends kn{constructor(e,n){super(),this.name=e,this.type=n}get astNodeType(){return"alias"}}class wH extends kn{constructor(){super()}get astNodeType(){return"discard"}}class EH extends kn{constructor(){super()}get astNodeType(){return"break"}}class TH extends kn{constructor(){super()}get astNodeType(){return"continue"}}class el extends kn{constructor(e){super(),this.name=e}get astNodeType(){return"type"}get isStruct(){return!1}get isArray(){return!1}}class mo extends el{constructor(e,n,r,i){super(e),this.members=n,this.startLine=r,this.endLine=i}get astNodeType(){return"struct"}get isStruct(){return!0}getMemberIndex(e){for(let n=0;n":return this.left.evaluate(e)>this.right.evaluate(e)?1:0;case"<=":return this.left.evaluate(e)<=this.right.evaluate(e)?1:0;case">=":return this.left.evaluate(e)>=this.right.evaluate(e)?1:0;case"&&":return this.left.evaluate(e)&&this.right.evaluate(e)?1:0;case"||":return this.left.evaluate(e)||this.right.evaluate(e)?1:0;default:throw new Error(`Unknown operator ${this.operator}`)}}search(e){this.left.search(e),this.right.search(e)}}class qM extends Ys{constructor(){super()}}class OH extends qM{constructor(e,n){super(),this.selector=e,this.body=n}get astNodeType(){return"case"}search(e){this.searchBlock(this.body,e)}}class PH extends qM{constructor(e){super(),this.body=e}get astNodeType(){return"default"}search(e){this.searchBlock(this.body,e)}}class NH extends Ys{constructor(e,n,r){super(),this.name=e,this.type=n,this.attributes=r}get astNodeType(){return"argument"}}class IH extends Ys{constructor(e,n){super(),this.condition=e,this.body=n}get astNodeType(){return"elseif"}search(e){this.condition.search(e),this.searchBlock(this.body,e)}}class DH extends Ys{constructor(e,n,r){super(),this.name=e,this.type=n,this.attributes=r}get astNodeType(){return"member"}}let FH=class extends Ys{constructor(e,n){super(),this.name=e,this.value=n}get astNodeType(){return"attribute"}};var oe,te;(function(t){t[t.token=0]="token",t[t.keyword=1]="keyword",t[t.reserved=2]="reserved"})(te||(te={}));class ne{constructor(e,n,r){this.name=e,this.type=n,this.rule=r}toString(){return this.name}}class k{}oe=k;k.none=new ne("",te.reserved,"");k.eof=new ne("EOF",te.token,"");k.reserved={asm:new ne("asm",te.reserved,"asm"),bf16:new ne("bf16",te.reserved,"bf16"),do:new ne("do",te.reserved,"do"),enum:new ne("enum",te.reserved,"enum"),f16:new ne("f16",te.reserved,"f16"),f64:new ne("f64",te.reserved,"f64"),handle:new ne("handle",te.reserved,"handle"),i8:new ne("i8",te.reserved,"i8"),i16:new ne("i16",te.reserved,"i16"),i64:new ne("i64",te.reserved,"i64"),mat:new ne("mat",te.reserved,"mat"),premerge:new ne("premerge",te.reserved,"premerge"),regardless:new ne("regardless",te.reserved,"regardless"),typedef:new ne("typedef",te.reserved,"typedef"),u8:new ne("u8",te.reserved,"u8"),u16:new ne("u16",te.reserved,"u16"),u64:new ne("u64",te.reserved,"u64"),unless:new ne("unless",te.reserved,"unless"),using:new ne("using",te.reserved,"using"),vec:new ne("vec",te.reserved,"vec"),void:new ne("void",te.reserved,"void")};k.keywords={array:new ne("array",te.keyword,"array"),atomic:new ne("atomic",te.keyword,"atomic"),bool:new ne("bool",te.keyword,"bool"),f32:new ne("f32",te.keyword,"f32"),i32:new ne("i32",te.keyword,"i32"),mat2x2:new ne("mat2x2",te.keyword,"mat2x2"),mat2x3:new ne("mat2x3",te.keyword,"mat2x3"),mat2x4:new ne("mat2x4",te.keyword,"mat2x4"),mat3x2:new ne("mat3x2",te.keyword,"mat3x2"),mat3x3:new ne("mat3x3",te.keyword,"mat3x3"),mat3x4:new ne("mat3x4",te.keyword,"mat3x4"),mat4x2:new ne("mat4x2",te.keyword,"mat4x2"),mat4x3:new ne("mat4x3",te.keyword,"mat4x3"),mat4x4:new ne("mat4x4",te.keyword,"mat4x4"),ptr:new ne("ptr",te.keyword,"ptr"),sampler:new ne("sampler",te.keyword,"sampler"),sampler_comparison:new ne("sampler_comparison",te.keyword,"sampler_comparison"),struct:new ne("struct",te.keyword,"struct"),texture_1d:new ne("texture_1d",te.keyword,"texture_1d"),texture_2d:new ne("texture_2d",te.keyword,"texture_2d"),texture_2d_array:new ne("texture_2d_array",te.keyword,"texture_2d_array"),texture_3d:new ne("texture_3d",te.keyword,"texture_3d"),texture_cube:new ne("texture_cube",te.keyword,"texture_cube"),texture_cube_array:new ne("texture_cube_array",te.keyword,"texture_cube_array"),texture_multisampled_2d:new ne("texture_multisampled_2d",te.keyword,"texture_multisampled_2d"),texture_storage_1d:new ne("texture_storage_1d",te.keyword,"texture_storage_1d"),texture_storage_2d:new ne("texture_storage_2d",te.keyword,"texture_storage_2d"),texture_storage_2d_array:new ne("texture_storage_2d_array",te.keyword,"texture_storage_2d_array"),texture_storage_3d:new ne("texture_storage_3d",te.keyword,"texture_storage_3d"),texture_depth_2d:new ne("texture_depth_2d",te.keyword,"texture_depth_2d"),texture_depth_2d_array:new ne("texture_depth_2d_array",te.keyword,"texture_depth_2d_array"),texture_depth_cube:new ne("texture_depth_cube",te.keyword,"texture_depth_cube"),texture_depth_cube_array:new ne("texture_depth_cube_array",te.keyword,"texture_depth_cube_array"),texture_depth_multisampled_2d:new ne("texture_depth_multisampled_2d",te.keyword,"texture_depth_multisampled_2d"),texture_external:new ne("texture_external",te.keyword,"texture_external"),u32:new ne("u32",te.keyword,"u32"),vec2:new ne("vec2",te.keyword,"vec2"),vec3:new ne("vec3",te.keyword,"vec3"),vec4:new ne("vec4",te.keyword,"vec4"),bitcast:new ne("bitcast",te.keyword,"bitcast"),block:new ne("block",te.keyword,"block"),break:new ne("break",te.keyword,"break"),case:new ne("case",te.keyword,"case"),continue:new ne("continue",te.keyword,"continue"),continuing:new ne("continuing",te.keyword,"continuing"),default:new ne("default",te.keyword,"default"),diagnostic:new ne("diagnostic",te.keyword,"diagnostic"),discard:new ne("discard",te.keyword,"discard"),else:new ne("else",te.keyword,"else"),enable:new ne("enable",te.keyword,"enable"),fallthrough:new ne("fallthrough",te.keyword,"fallthrough"),false:new ne("false",te.keyword,"false"),fn:new ne("fn",te.keyword,"fn"),for:new ne("for",te.keyword,"for"),function:new ne("function",te.keyword,"function"),if:new ne("if",te.keyword,"if"),let:new ne("let",te.keyword,"let"),const:new ne("const",te.keyword,"const"),loop:new ne("loop",te.keyword,"loop"),while:new ne("while",te.keyword,"while"),private:new ne("private",te.keyword,"private"),read:new ne("read",te.keyword,"read"),read_write:new ne("read_write",te.keyword,"read_write"),return:new ne("return",te.keyword,"return"),requires:new ne("requires",te.keyword,"requires"),storage:new ne("storage",te.keyword,"storage"),switch:new ne("switch",te.keyword,"switch"),true:new ne("true",te.keyword,"true"),alias:new ne("alias",te.keyword,"alias"),type:new ne("type",te.keyword,"type"),uniform:new ne("uniform",te.keyword,"uniform"),var:new ne("var",te.keyword,"var"),override:new ne("override",te.keyword,"override"),workgroup:new ne("workgroup",te.keyword,"workgroup"),write:new ne("write",te.keyword,"write"),r8unorm:new ne("r8unorm",te.keyword,"r8unorm"),r8snorm:new ne("r8snorm",te.keyword,"r8snorm"),r8uint:new ne("r8uint",te.keyword,"r8uint"),r8sint:new ne("r8sint",te.keyword,"r8sint"),r16uint:new ne("r16uint",te.keyword,"r16uint"),r16sint:new ne("r16sint",te.keyword,"r16sint"),r16float:new ne("r16float",te.keyword,"r16float"),rg8unorm:new ne("rg8unorm",te.keyword,"rg8unorm"),rg8snorm:new ne("rg8snorm",te.keyword,"rg8snorm"),rg8uint:new ne("rg8uint",te.keyword,"rg8uint"),rg8sint:new ne("rg8sint",te.keyword,"rg8sint"),r32uint:new ne("r32uint",te.keyword,"r32uint"),r32sint:new ne("r32sint",te.keyword,"r32sint"),r32float:new ne("r32float",te.keyword,"r32float"),rg16uint:new ne("rg16uint",te.keyword,"rg16uint"),rg16sint:new ne("rg16sint",te.keyword,"rg16sint"),rg16float:new ne("rg16float",te.keyword,"rg16float"),rgba8unorm:new ne("rgba8unorm",te.keyword,"rgba8unorm"),rgba8unorm_srgb:new ne("rgba8unorm_srgb",te.keyword,"rgba8unorm_srgb"),rgba8snorm:new ne("rgba8snorm",te.keyword,"rgba8snorm"),rgba8uint:new ne("rgba8uint",te.keyword,"rgba8uint"),rgba8sint:new ne("rgba8sint",te.keyword,"rgba8sint"),bgra8unorm:new ne("bgra8unorm",te.keyword,"bgra8unorm"),bgra8unorm_srgb:new ne("bgra8unorm_srgb",te.keyword,"bgra8unorm_srgb"),rgb10a2unorm:new ne("rgb10a2unorm",te.keyword,"rgb10a2unorm"),rg11b10float:new ne("rg11b10float",te.keyword,"rg11b10float"),rg32uint:new ne("rg32uint",te.keyword,"rg32uint"),rg32sint:new ne("rg32sint",te.keyword,"rg32sint"),rg32float:new ne("rg32float",te.keyword,"rg32float"),rgba16uint:new ne("rgba16uint",te.keyword,"rgba16uint"),rgba16sint:new ne("rgba16sint",te.keyword,"rgba16sint"),rgba16float:new ne("rgba16float",te.keyword,"rgba16float"),rgba32uint:new ne("rgba32uint",te.keyword,"rgba32uint"),rgba32sint:new ne("rgba32sint",te.keyword,"rgba32sint"),rgba32float:new ne("rgba32float",te.keyword,"rgba32float"),static_assert:new ne("static_assert",te.keyword,"static_assert")};k.tokens={decimal_float_literal:new ne("decimal_float_literal",te.token,/((-?[0-9]*\.[0-9]+|-?[0-9]+\.[0-9]*)((e|E)(\+|-)?[0-9]+)?f?)|(-?[0-9]+(e|E)(\+|-)?[0-9]+f?)|(-?[0-9]+f)/),hex_float_literal:new ne("hex_float_literal",te.token,/-?0x((([0-9a-fA-F]*\.[0-9a-fA-F]+|[0-9a-fA-F]+\.[0-9a-fA-F]*)((p|P)(\+|-)?[0-9]+f?)?)|([0-9a-fA-F]+(p|P)(\+|-)?[0-9]+f?))/),int_literal:new ne("int_literal",te.token,/-?0x[0-9a-fA-F]+|0i?|-?[1-9][0-9]*i?/),uint_literal:new ne("uint_literal",te.token,/0x[0-9a-fA-F]+u|0u|[1-9][0-9]*u/),ident:new ne("ident",te.token,/[_a-zA-Z][0-9a-zA-Z_]*/),and:new ne("and",te.token,"&"),and_and:new ne("and_and",te.token,"&&"),arrow:new ne("arrow ",te.token,"->"),attr:new ne("attr",te.token,"@"),forward_slash:new ne("forward_slash",te.token,"/"),bang:new ne("bang",te.token,"!"),bracket_left:new ne("bracket_left",te.token,"["),bracket_right:new ne("bracket_right",te.token,"]"),brace_left:new ne("brace_left",te.token,"{"),brace_right:new ne("brace_right",te.token,"}"),colon:new ne("colon",te.token,":"),comma:new ne("comma",te.token,","),equal:new ne("equal",te.token,"="),equal_equal:new ne("equal_equal",te.token,"=="),not_equal:new ne("not_equal",te.token,"!="),greater_than:new ne("greater_than",te.token,">"),greater_than_equal:new ne("greater_than_equal",te.token,">="),shift_right:new ne("shift_right",te.token,">>"),less_than:new ne("less_than",te.token,"<"),less_than_equal:new ne("less_than_equal",te.token,"<="),shift_left:new ne("shift_left",te.token,"<<"),modulo:new ne("modulo",te.token,"%"),minus:new ne("minus",te.token,"-"),minus_minus:new ne("minus_minus",te.token,"--"),period:new ne("period",te.token,"."),plus:new ne("plus",te.token,"+"),plus_plus:new ne("plus_plus",te.token,"++"),or:new ne("or",te.token,"|"),or_or:new ne("or_or",te.token,"||"),paren_left:new ne("paren_left",te.token,"("),paren_right:new ne("paren_right",te.token,")"),semicolon:new ne("semicolon",te.token,";"),star:new ne("star",te.token,"*"),tilde:new ne("tilde",te.token,"~"),underscore:new ne("underscore",te.token,"_"),xor:new ne("xor",te.token,"^"),plus_equal:new ne("plus_equal",te.token,"+="),minus_equal:new ne("minus_equal",te.token,"-="),times_equal:new ne("times_equal",te.token,"*="),division_equal:new ne("division_equal",te.token,"/="),modulo_equal:new ne("modulo_equal",te.token,"%="),and_equal:new ne("and_equal",te.token,"&="),or_equal:new ne("or_equal",te.token,"|="),xor_equal:new ne("xor_equal",te.token,"^="),shift_right_equal:new ne("shift_right_equal",te.token,">>="),shift_left_equal:new ne("shift_left_equal",te.token,"<<=")};k.simpleTokens={"@":oe.tokens.attr,"{":oe.tokens.brace_left,"}":oe.tokens.brace_right,":":oe.tokens.colon,",":oe.tokens.comma,"(":oe.tokens.paren_left,")":oe.tokens.paren_right,";":oe.tokens.semicolon};k.literalTokens={"&":oe.tokens.and,"&&":oe.tokens.and_and,"->":oe.tokens.arrow,"/":oe.tokens.forward_slash,"!":oe.tokens.bang,"[":oe.tokens.bracket_left,"]":oe.tokens.bracket_right,"=":oe.tokens.equal,"==":oe.tokens.equal_equal,"!=":oe.tokens.not_equal,">":oe.tokens.greater_than,">=":oe.tokens.greater_than_equal,">>":oe.tokens.shift_right,"<":oe.tokens.less_than,"<=":oe.tokens.less_than_equal,"<<":oe.tokens.shift_left,"%":oe.tokens.modulo,"-":oe.tokens.minus,"--":oe.tokens.minus_minus,".":oe.tokens.period,"+":oe.tokens.plus,"++":oe.tokens.plus_plus,"|":oe.tokens.or,"||":oe.tokens.or_or,"*":oe.tokens.star,"~":oe.tokens.tilde,_:oe.tokens.underscore,"^":oe.tokens.xor,"+=":oe.tokens.plus_equal,"-=":oe.tokens.minus_equal,"*=":oe.tokens.times_equal,"/=":oe.tokens.division_equal,"%=":oe.tokens.modulo_equal,"&=":oe.tokens.and_equal,"|=":oe.tokens.or_equal,"^=":oe.tokens.xor_equal,">>=":oe.tokens.shift_right_equal,"<<=":oe.tokens.shift_left_equal};k.regexTokens={decimal_float_literal:oe.tokens.decimal_float_literal,hex_float_literal:oe.tokens.hex_float_literal,int_literal:oe.tokens.int_literal,uint_literal:oe.tokens.uint_literal,ident:oe.tokens.ident};k.storage_class=[oe.keywords.function,oe.keywords.private,oe.keywords.workgroup,oe.keywords.uniform,oe.keywords.storage];k.access_mode=[oe.keywords.read,oe.keywords.write,oe.keywords.read_write];k.sampler_type=[oe.keywords.sampler,oe.keywords.sampler_comparison];k.sampled_texture_type=[oe.keywords.texture_1d,oe.keywords.texture_2d,oe.keywords.texture_2d_array,oe.keywords.texture_3d,oe.keywords.texture_cube,oe.keywords.texture_cube_array];k.multisampled_texture_type=[oe.keywords.texture_multisampled_2d];k.storage_texture_type=[oe.keywords.texture_storage_1d,oe.keywords.texture_storage_2d,oe.keywords.texture_storage_2d_array,oe.keywords.texture_storage_3d];k.depth_texture_type=[oe.keywords.texture_depth_2d,oe.keywords.texture_depth_2d_array,oe.keywords.texture_depth_cube,oe.keywords.texture_depth_cube_array,oe.keywords.texture_depth_multisampled_2d];k.texture_external_type=[oe.keywords.texture_external];k.any_texture_type=[...oe.sampled_texture_type,...oe.multisampled_texture_type,...oe.storage_texture_type,...oe.depth_texture_type,...oe.texture_external_type];k.texel_format=[oe.keywords.r8unorm,oe.keywords.r8snorm,oe.keywords.r8uint,oe.keywords.r8sint,oe.keywords.r16uint,oe.keywords.r16sint,oe.keywords.r16float,oe.keywords.rg8unorm,oe.keywords.rg8snorm,oe.keywords.rg8uint,oe.keywords.rg8sint,oe.keywords.r32uint,oe.keywords.r32sint,oe.keywords.r32float,oe.keywords.rg16uint,oe.keywords.rg16sint,oe.keywords.rg16float,oe.keywords.rgba8unorm,oe.keywords.rgba8unorm_srgb,oe.keywords.rgba8snorm,oe.keywords.rgba8uint,oe.keywords.rgba8sint,oe.keywords.bgra8unorm,oe.keywords.bgra8unorm_srgb,oe.keywords.rgb10a2unorm,oe.keywords.rg11b10float,oe.keywords.rg32uint,oe.keywords.rg32sint,oe.keywords.rg32float,oe.keywords.rgba16uint,oe.keywords.rgba16sint,oe.keywords.rgba16float,oe.keywords.rgba32uint,oe.keywords.rgba32sint,oe.keywords.rgba32float];k.const_literal=[oe.tokens.int_literal,oe.tokens.uint_literal,oe.tokens.decimal_float_literal,oe.tokens.hex_float_literal,oe.keywords.true,oe.keywords.false];k.literal_or_ident=[oe.tokens.ident,oe.tokens.int_literal,oe.tokens.uint_literal,oe.tokens.decimal_float_literal,oe.tokens.hex_float_literal];k.element_count_expression=[oe.tokens.int_literal,oe.tokens.uint_literal,oe.tokens.ident];k.template_types=[oe.keywords.vec2,oe.keywords.vec3,oe.keywords.vec4,oe.keywords.mat2x2,oe.keywords.mat2x3,oe.keywords.mat2x4,oe.keywords.mat3x2,oe.keywords.mat3x3,oe.keywords.mat3x4,oe.keywords.mat4x2,oe.keywords.mat4x3,oe.keywords.mat4x4,oe.keywords.atomic,oe.keywords.bitcast,...oe.any_texture_type];k.attribute_name=[oe.tokens.ident,oe.keywords.block,oe.keywords.diagnostic];k.assignment_operators=[oe.tokens.equal,oe.tokens.plus_equal,oe.tokens.minus_equal,oe.tokens.times_equal,oe.tokens.division_equal,oe.tokens.modulo_equal,oe.tokens.and_equal,oe.tokens.or_equal,oe.tokens.xor_equal,oe.tokens.shift_right_equal,oe.tokens.shift_left_equal];k.increment_operators=[oe.tokens.plus_plus,oe.tokens.minus_minus];class _A{constructor(e,n,r){this.type=e,this.lexeme=n,this.line=r}toString(){return this.lexeme}isTemplateType(){return k.template_types.indexOf(this.type)!=-1}isArrayType(){return this.type==k.keywords.array}isArrayOrTemplateType(){return this.isArrayType()||this.isTemplateType()}}class kH{constructor(e){this._tokens=[],this._start=0,this._current=0,this._line=1,this._source=e??""}scanTokens(){for(;!this._isAtEnd();)if(this._start=this._current,!this.scanToken())throw`Invalid syntax at line ${this._line}`;return this._tokens.push(new _A(k.eof,"",this._line)),this._tokens}scanToken(){let e=this._advance();if(e==` +`)return this._line++,!0;if(this._isWhitespace(e))return!0;if(e=="/"){if(this._peekAhead()=="/"){for(;e!=` +`;){if(this._isAtEnd())return!0;e=this._advance()}return this._line++,!0}else if(this._peekAhead()=="*"){this._advance();let l=1;for(;l>0;){if(this._isAtEnd())return!0;if(e=this._advance(),e==` +`)this._line++;else if(e=="*"){if(this._peekAhead()=="/"&&(this._advance(),l--,l==0))return!0}else e=="/"&&this._peekAhead()=="*"&&(this._advance(),l++)}return!0}}const n=k.simpleTokens[e];if(n)return this._addToken(n),!0;let r=k.none;const i=this._isAlpha(e),s=e==="_";if(this._isAlphaNumeric(e)){let l=this._peekAhead();for(;this._isAlphaNumeric(l);)e+=this._advance(),l=this._peekAhead()}if(i){const l=k.keywords[e];if(l)return this._addToken(l),!0}if(i||s)return this._addToken(k.tokens.ident),!0;for(;;){let l=this._findType(e);const c=this._peekAhead();if(e=="-"&&this._tokens.length>0){if(c=="=")return this._current++,e+=c,this._addToken(k.tokens.minus_equal),!0;if(c=="-")return this._current++,e+=c,this._addToken(k.tokens.minus_minus),!0;const f=this._tokens.length-1;if((k.literal_or_ident.indexOf(this._tokens[f].type)!=-1||this._tokens[f].type==k.tokens.paren_right)&&c!=">")return this._addToken(l),!0}if(e==">"&&(c==">"||c=="=")){let f=!1,d=this._tokens.length-1;for(let g=0;g<5&&d>=0&&k.assignment_operators.indexOf(this._tokens[d].type)===-1;++g,--d)if(this._tokens[d].type===k.tokens.less_than){d>0&&this._tokens[d-1].isArrayOrTemplateType()&&(f=!0);break}if(f)return this._addToken(l),!0}if(l===k.none){let f=e,d=0;const g=2;for(let m=0;m=this._source.length}_isAlpha(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"}_isAlphaNumeric(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||e=="_"||e>="0"&&e<="9"}_isWhitespace(e){return e==" "||e==" "||e=="\r"}_advance(e=0){let n=this._source[this._current];return e=e||0,e++,this._current+=e,n}_peekAhead(e=0){return e=e||0,this._current+e>=this._source.length?"\0":this._source[this._current+e]}_addToken(e){const n=this._source.substring(this._start,this._current);this._tokens.push(new _A(e,n,this._line))}}class BH{constructor(){this._tokens=[],this._current=0,this._currentLine=0,this._context=new lH,this._deferArrayCountEval=[]}parse(e){this._initialize(e),this._deferArrayCountEval.length=0;const n=[];for(;!this._isAtEnd();){const r=this._global_decl_or_directive();if(!r)break;n.push(r)}if(this._deferArrayCountEval.length>0){for(const r of this._deferArrayCountEval){const i=r.arrayType,s=r.countNode;if(s instanceof cy){const c=s.name,f=this._context.constants.get(c);if(f)try{const d=f.evaluate(this._context);i.count=d}catch{}}}this._deferArrayCountEval.length=0}return n}_initialize(e){if(e)if(typeof e=="string"){const n=new kH(e);this._tokens=n.scanTokens()}else this._tokens=e;else this._tokens=[];this._current=0}_error(e,n){return{token:e,message:n,toString:function(){return`${n}`}}}_isAtEnd(){return this._current>=this._tokens.length||this._peek().type==k.eof}_match(e){if(e instanceof ne)return this._check(e)?(this._advance(),!0):!1;for(let n=0,r=e.length;n'.");const i=this._paren_expression();return new RH(r,i)}const e=this._type_decl(),n=this._argument_expression_list();return new Ql(e,n)}_argument_expression_list(){if(!this._match(k.tokens.paren_left))return null;const e=[];do{if(this._check(k.tokens.paren_right))break;const n=this._short_circuit_or_expression();e.push(n)}while(this._match(k.tokens.comma));return this._consume(k.tokens.paren_right,"Expected ')' for agument list"),e}_optional_paren_expression(){this._match(k.tokens.paren_left);const e=this._short_circuit_or_expression();return this._match(k.tokens.paren_right),new vA([e])}_paren_expression(){this._consume(k.tokens.paren_left,"Expected '('.");const e=this._short_circuit_or_expression();return this._consume(k.tokens.paren_right,"Expected ')'."),new vA([e])}_struct_decl(){if(!this._match(k.keywords.struct))return null;const e=this._currentLine,n=this._consume(k.tokens.ident,"Expected name for struct.").toString();this._consume(k.tokens.brace_left,"Expected '{' for struct body.");const r=[];for(;!this._check(k.tokens.brace_right);){const l=this._attribute(),c=this._consume(k.tokens.ident,"Expected variable name.").toString();this._consume(k.tokens.colon,"Expected ':' for struct member type.");const f=this._attribute(),d=this._type_decl();d!=null&&(d.attributes=f),this._check(k.tokens.brace_right)?this._match(k.tokens.comma):this._consume(k.tokens.comma,"Expected ',' for struct member."),r.push(new DH(c,d,l))}this._consume(k.tokens.brace_right,"Expected '}' after struct body.");const i=this._currentLine,s=new mo(n,r,e,i);return this._context.structs.set(n,s),s}_global_variable_decl(){const e=this._variable_decl();return e&&this._match(k.tokens.equal)&&(e.value=this._const_expression()),e}_override_variable_decl(){const e=this._override_decl();return e&&this._match(k.tokens.equal)&&(e.value=this._const_expression()),e}_global_const_decl(){if(!this._match(k.keywords.const))return null;const e=this._consume(k.tokens.ident,"Expected variable name");let n=null;if(this._match(k.tokens.colon)){const s=this._attribute();n=this._type_decl(),n!=null&&(n.attributes=s)}let r=null;if(this._match(k.tokens.equal)){const s=this._short_circuit_or_expression();if(s instanceof Ql)r=s;else if(s instanceof pA&&s.initializer instanceof Ql)r=s.initializer;else try{const l=s.evaluate(this._context);r=new mA(l)}catch{r=s}}const i=new gA(e.toString(),n,"","",r);return this._context.constants.set(i.name,i),i}_global_let_decl(){if(!this._match(k.keywords.let))return null;const e=this._consume(k.tokens.ident,"Expected variable name");let n=null;if(this._match(k.tokens.colon)){const i=this._attribute();n=this._type_decl(),n!=null&&(n.attributes=i)}let r=null;return this._match(k.tokens.equal)&&(r=this._const_expression()),new ly(e.toString(),n,"","",r)}_const_expression(){return this._short_circuit_or_expression()}_variable_decl(){if(!this._match(k.keywords.var))return null;let e="",n="";this._match(k.tokens.less_than)&&(e=this._consume(k.storage_class,"Expected storage_class.").toString(),this._match(k.tokens.comma)&&(n=this._consume(k.access_mode,"Expected access_mode.").toString()),this._consume(k.tokens.greater_than,"Expected '>'."));const r=this._consume(k.tokens.ident,"Expected variable name");let i=null;if(this._match(k.tokens.colon)){const s=this._attribute();i=this._type_decl(),i!=null&&(i.attributes=s)}return new bo(r.toString(),i,e,n,null)}_override_decl(){if(!this._match(k.keywords.override))return null;const e=this._consume(k.tokens.ident,"Expected variable name");let n=null;if(this._match(k.tokens.colon)){const r=this._attribute();n=this._type_decl(),n!=null&&(n.attributes=r)}return new zM(e.toString(),n,null)}_diagnostic(){this._consume(k.tokens.paren_left,"Expected '('");const e=this._consume(k.tokens.ident,"Expected severity control name.");this._consume(k.tokens.comma,"Expected ','");const n=this._consume(k.tokens.ident,"Expected diagnostic rule name.");return this._consume(k.tokens.paren_right,"Expected ')'"),new SH(e.toString(),n.toString())}_enable_directive(){const e=this._consume(k.tokens.ident,"identity expected.");return new yH(e.toString())}_requires_directive(){const e=[this._consume(k.tokens.ident,"identity expected.").toString()];for(;this._match(k.tokens.comma);){const n=this._consume(k.tokens.ident,"identity expected.");e.push(n.toString())}return new bH(e)}_type_alias(){const e=this._consume(k.tokens.ident,"identity expected.");this._consume(k.tokens.equal,"Expected '=' for type alias.");let n=this._type_decl();if(n===null)throw this._error(this._peek(),"Expected Type for Alias.");this._context.aliases.has(n.name)&&(n=this._context.aliases.get(n.name).type);const r=new VM(e.toString(),n);return this._context.aliases.set(r.name,r),r}_type_decl(){if(this._check([k.tokens.ident,...k.texel_format,k.keywords.bool,k.keywords.f32,k.keywords.i32,k.keywords.u32])){const r=this._advance(),i=r.toString();return this._context.structs.has(i)?this._context.structs.get(i):this._context.aliases.has(i)?this._context.aliases.get(i).type:new el(r.toString())}let e=this._texture_sampler_types();if(e)return e;if(this._check(k.template_types)){let r=this._advance().toString(),i=null,s=null;return this._match(k.tokens.less_than)&&(i=this._type_decl(),s=null,this._match(k.tokens.comma)&&(s=this._consume(k.access_mode,"Expected access_mode for pointer").toString()),this._consume(k.tokens.greater_than,"Expected '>' for type.")),new HM(r,i,s)}if(this._match(k.keywords.ptr)){let r=this._previous().toString();this._consume(k.tokens.less_than,"Expected '<' for pointer.");const i=this._consume(k.storage_class,"Expected storage_class for pointer");this._consume(k.tokens.comma,"Expected ',' for pointer.");const s=this._type_decl();let l=null;return this._match(k.tokens.comma)&&(l=this._consume(k.access_mode,"Expected access_mode for pointer").toString()),this._consume(k.tokens.greater_than,"Expected '>' for pointer."),new AH(r,i.toString(),s,l)}const n=this._attribute();if(this._match(k.keywords.array)){let r=null,i=-1;const s=this._previous();let l=null;if(this._match(k.tokens.less_than)){r=this._type_decl(),this._context.aliases.has(r.name)&&(r=this._context.aliases.get(r.name).type);let f="";if(this._match(k.tokens.comma)){l=this._shift_expression();try{f=l.evaluate(this._context).toString(),l=null}catch{f="1"}}this._consume(k.tokens.greater_than,"Expected '>' for array."),i=f?parseInt(f):0}const c=new jM(s.toString(),n,r,i);return l&&this._deferArrayCountEval.push({arrayType:c,countNode:l}),c}return null}_texture_sampler_types(){if(this._match(k.sampler_type))return new Qu(this._previous().toString(),null,null);if(this._match(k.depth_texture_type))return new Qu(this._previous().toString(),null,null);if(this._match(k.sampled_texture_type)||this._match(k.multisampled_texture_type)){const e=this._previous();this._consume(k.tokens.less_than,"Expected '<' for sampler type.");const n=this._type_decl();return this._consume(k.tokens.greater_than,"Expected '>' for sampler type."),new Qu(e.toString(),n,null)}if(this._match(k.storage_texture_type)){const e=this._previous();this._consume(k.tokens.less_than,"Expected '<' for sampler type.");const n=this._consume(k.texel_format,"Invalid texel format.").toString();this._consume(k.tokens.comma,"Expected ',' after texel format.");const r=this._consume(k.access_mode,"Expected access mode for storage texture type.").toString();return this._consume(k.tokens.greater_than,"Expected '>' for sampler type."),new Qu(e.toString(),n,r)}return null}_attribute(){let e=[];for(;this._match(k.tokens.attr);){const n=this._consume(k.attribute_name,"Expected attribute name"),r=new FH(n.toString(),null);if(this._match(k.tokens.paren_left)){if(r.value=this._consume(k.literal_or_ident,"Expected attribute value").toString(),this._check(k.tokens.comma)){this._advance();do{const i=this._consume(k.literal_or_ident,"Expected attribute value").toString();r.value instanceof Array||(r.value=[r.value]),r.value.push(i)}while(this._match(k.tokens.comma))}this._consume(k.tokens.paren_right,"Expected ')'")}e.push(r)}return e.length==0?null:e}}class ac{constructor(e,n){this.name=e,this.attributes=n,this.size=0}get isArray(){return!1}get isStruct(){return!1}get isTemplate(){return!1}}class yA{constructor(e,n,r){this.name=e,this.type=n,this.attributes=r,this.offset=0,this.size=0}get isArray(){return this.type.isArray}get isStruct(){return this.type.isStruct}get isTemplate(){return this.type.isTemplate}get align(){return this.type.isStruct?this.type.align:0}get members(){return this.type.isStruct?this.type.members:null}get format(){return this.type.isArray?this.type.format:this.type.isTemplate?this.type.format:null}get count(){return this.type.isArray?this.type.count:0}get stride(){return this.type.isArray?this.type.stride:this.size}}class Th extends ac{constructor(e,n){super(e,n),this.members=[],this.align=0,this.startLine=-1,this.endLine=-1,this.inUse=!1}get isStruct(){return!0}}class f0 extends ac{constructor(e,n){super(e,n),this.count=0,this.stride=0}get isArray(){return!0}}class bA extends ac{constructor(e,n,r,i){super(e,r),this.format=n,this.access=i}get isTemplate(){return!0}}var Ea;(function(t){t[t.Uniform=0]="Uniform",t[t.Storage=1]="Storage",t[t.Texture=2]="Texture",t[t.Sampler=3]="Sampler",t[t.StorageTexture=4]="StorageTexture"})(Ea||(Ea={}));class Ah{constructor(e,n,r,i,s,l,c){this.name=e,this.type=n,this.group=r,this.binding=i,this.attributes=s,this.resourceType=l,this.access=c}get isArray(){return this.type.isArray}get isStruct(){return this.type.isStruct}get isTemplate(){return this.type.isTemplate}get size(){return this.type.size}get align(){return this.type.isStruct?this.type.align:0}get members(){return this.type.isStruct?this.type.members:null}get format(){return this.type.isArray?this.type.format:this.type.isTemplate?this.type.format:null}get count(){return this.type.isArray?this.type.count:0}get stride(){return this.type.isArray?this.type.stride:this.size}}class UH{constructor(e,n){this.name=e,this.type=n}}class Ch{constructor(e,n){this.align=e,this.size=n}}class LH{constructor(e,n,r,i){this.name=e,this.type=n,this.locationType=r,this.location=i,this.interpolation=null}}class SA{constructor(e,n,r,i){this.name=e,this.type=n,this.locationType=r,this.location=i}}class zH{constructor(e,n,r,i){this.name=e,this.type=n,this.attributes=r,this.id=i}}class $H{constructor(e,n){this.name=e,this.type=n}}class VH{constructor(e,n=null){this.stage=null,this.inputs=[],this.outputs=[],this.arguments=[],this.returnType=null,this.resources=[],this.overrides=[],this.startLine=-1,this.endLine=-1,this.inUse=!1,this.calls=new Set,this.name=e,this.stage=n}}class HH{constructor(){this.vertex=[],this.fragment=[],this.compute=[]}}class jH{constructor(e){this.resources=null,this.inUse=!1,this.info=null,this.node=e}}class Hs{constructor(e){this.uniforms=[],this.storage=[],this.textures=[],this.samplers=[],this.aliases=[],this.overrides=[],this.structs=[],this.entry=new HH,this.functions=[],this._types=new Map,this._functions=new Map,e&&this.update(e)}_isStorageTexture(e){return e.name=="texture_storage_1d"||e.name=="texture_storage_2d"||e.name=="texture_storage_2d_array"||e.name=="texture_storage_3d"}update(e){const r=new BH().parse(e);for(const i of r)i instanceof oy&&this._functions.set(i.name,new jH(i));for(const i of r)if(i instanceof mo){const s=this._getTypeInfo(i,null);s instanceof Th&&this.structs.push(s)}for(const i of r){if(i instanceof VM){this.aliases.push(this._getAliasInfo(i));continue}if(i instanceof zM){const s=i,l=this._getAttributeNum(s.attributes,"id",0),c=s.type!=null?this._getTypeInfo(s.type,s.attributes):null;this.overrides.push(new zH(s.name,c,s.attributes,l));continue}if(this._isUniformVar(i)){const s=i,l=this._getAttributeNum(s.attributes,"group",0),c=this._getAttributeNum(s.attributes,"binding",0),f=this._getTypeInfo(s.type,s.attributes),d=new Ah(s.name,f,l,c,s.attributes,Ea.Uniform,s.access);this.uniforms.push(d);continue}if(this._isStorageVar(i)){const s=i,l=this._getAttributeNum(s.attributes,"group",0),c=this._getAttributeNum(s.attributes,"binding",0),f=this._getTypeInfo(s.type,s.attributes),d=this._isStorageTexture(f),g=new Ah(s.name,f,l,c,s.attributes,d?Ea.StorageTexture:Ea.Storage,s.access);this.storage.push(g);continue}if(this._isTextureVar(i)){const s=i,l=this._getAttributeNum(s.attributes,"group",0),c=this._getAttributeNum(s.attributes,"binding",0),f=this._getTypeInfo(s.type,s.attributes),d=this._isStorageTexture(f),g=new Ah(s.name,f,l,c,s.attributes,d?Ea.StorageTexture:Ea.Texture,s.access);d?this.storage.push(g):this.textures.push(g);continue}if(this._isSamplerVar(i)){const s=i,l=this._getAttributeNum(s.attributes,"group",0),c=this._getAttributeNum(s.attributes,"binding",0),f=this._getTypeInfo(s.type,s.attributes),d=new Ah(s.name,f,l,c,s.attributes,Ea.Sampler,s.access);this.samplers.push(d);continue}if(i instanceof oy){const s=this._getAttribute(i,"vertex"),l=this._getAttribute(i,"fragment"),c=this._getAttribute(i,"compute"),f=s||l||c,d=new VH(i.name,f==null?void 0:f.name);d.startLine=i.startLine,d.endLine=i.endLine,this.functions.push(d),this._functions.get(i.name).info=d,f&&(this._functions.get(i.name).inUse=!0,d.inUse=!0,d.resources=this._findResources(i,!!f),d.inputs=this._getInputs(i.args),d.outputs=this._getOutputs(i.returnType),this.entry[f.name].push(d)),d.arguments=i.args.map(g=>new $H(g.name,this._getTypeInfo(g.type,g.attributes))),d.returnType=i.returnType?this._getTypeInfo(i.returnType,i.attributes):null;continue}}for(const i of this._functions.values())i.info&&(i.info.inUse=i.inUse,this._addCalls(i.node,i.info.calls));for(const i of this._functions.values())i.node.search(s=>{var l;if(s.astNodeType==="varExpr"){const c=s;for(const f of this.overrides)c.name==f.name&&((l=i.info)===null||l===void 0||l.overrides.push(f))}});for(const i of this.uniforms)this._markStructsInUse(i.type);for(const i of this.storage)this._markStructsInUse(i.type)}_markStructsInUse(e){if(e)if(e.isStruct){if(e.inUse=!0,e.members)for(const n of e.members)this._markStructsInUse(n.type)}else if(e.isArray)this._markStructsInUse(e.format);else if(e.isTemplate)e.format&&this._markStructsInUse(e.format);else{const n=this._getAlias(e.name);n&&this._markStructsInUse(n)}}_addCalls(e,n){var r;for(const i of e.calls){const s=(r=this._functions.get(i.name))===null||r===void 0?void 0:r.info;s&&n.add(s)}}findResource(e,n){for(const r of this.uniforms)if(r.group==e&&r.binding==n)return r;for(const r of this.storage)if(r.group==e&&r.binding==n)return r;for(const r of this.textures)if(r.group==e&&r.binding==n)return r;for(const r of this.samplers)if(r.group==e&&r.binding==n)return r;return null}_findResource(e){for(const n of this.uniforms)if(n.name==e)return n;for(const n of this.storage)if(n.name==e)return n;for(const n of this.textures)if(n.name==e)return n;for(const n of this.samplers)if(n.name==e)return n;return null}_markStructsFromAST(e){const n=this._getTypeInfo(e,null);this._markStructsInUse(n)}_findResources(e,n){const r=[],i=this,s=[];return e.search(l=>{if(l instanceof Rg)s.push({});else if(l instanceof xg)s.pop();else if(l instanceof bo){const c=l;n&&c.type!==null&&this._markStructsFromAST(c.type),s.length>0&&(s[s.length-1][c.name]=c)}else if(l instanceof Ql){const c=l;n&&c.type!==null&&this._markStructsFromAST(c.type)}else if(l instanceof ly){const c=l;n&&c.type!==null&&this._markStructsFromAST(c.type),s.length>0&&(s[s.length-1][c.name]=c)}else if(l instanceof cy){const c=l;if(s.length>0&&s[s.length-1][c.name])return;const f=i._findResource(c.name);f&&r.push(f)}else if(l instanceof WM){const c=l,f=i._functions.get(c.name);f&&(n&&(f.inUse=!0),e.calls.add(f.node),f.resources===null&&(f.resources=i._findResources(f.node,n)),r.push(...f.resources))}else if(l instanceof $M){const c=l,f=i._functions.get(c.name);f&&(n&&(f.inUse=!0),e.calls.add(f.node),f.resources===null&&(f.resources=i._findResources(f.node,n)),r.push(...f.resources))}}),[...new Map(r.map(l=>[l.name,l])).values()]}getBindGroups(){const e=[];function n(r,i){r>=e.length&&(e.length=r+1),e[r]===void 0&&(e[r]=[]),i>=e[r].length&&(e[r].length=i+1)}for(const r of this.uniforms){n(r.group,r.binding);const i=e[r.group];i[r.binding]=r}for(const r of this.storage){n(r.group,r.binding);const i=e[r.group];i[r.binding]=r}for(const r of this.textures){n(r.group,r.binding);const i=e[r.group];i[r.binding]=r}for(const r of this.samplers){n(r.group,r.binding);const i=e[r.group];i[r.binding]=r}return e}_getOutputs(e,n=void 0){if(n===void 0&&(n=[]),e instanceof mo)this._getStructOutputs(e,n);else{const r=this._getOutputInfo(e);r!==null&&n.push(r)}return n}_getStructOutputs(e,n){for(const r of e.members)if(r.type instanceof mo)this._getStructOutputs(r.type,n);else{const i=this._getAttribute(r,"location")||this._getAttribute(r,"builtin");if(i!==null){const s=this._getTypeInfo(r.type,r.type.attributes),l=this._parseInt(i.value),c=new SA(r.name,s,i.name,l);n.push(c)}}}_getOutputInfo(e){const n=this._getAttribute(e,"location")||this._getAttribute(e,"builtin");if(n!==null){const r=this._getTypeInfo(e,e.attributes),i=this._parseInt(n.value);return new SA("",r,n.name,i)}return null}_getInputs(e,n=void 0){n===void 0&&(n=[]);for(const r of e)if(r.type instanceof mo)this._getStructInputs(r.type,n);else{const i=this._getInputInfo(r);i!==null&&n.push(i)}return n}_getStructInputs(e,n){for(const r of e.members)if(r.type instanceof mo)this._getStructInputs(r.type,n);else{const i=this._getInputInfo(r);i!==null&&n.push(i)}}_getInputInfo(e){const n=this._getAttribute(e,"location")||this._getAttribute(e,"builtin");if(n!==null){const r=this._getAttribute(e,"interpolation"),i=this._getTypeInfo(e.type,e.attributes),s=this._parseInt(n.value),l=new LH(e.name,i,n.name,s);return r!==null&&(l.interpolation=this._parseString(r.value)),l}return null}_parseString(e){return e instanceof Array&&(e=e[0]),e}_parseInt(e){e instanceof Array&&(e=e[0]);const n=parseInt(e);return isNaN(n)?e:n}_getAlias(e){for(const n of this.aliases)if(n.name==e)return n.type;return null}_getAliasInfo(e){return new UH(e.name,this._getTypeInfo(e.type,null))}_getTypeInfo(e,n){if(this._types.has(e))return this._types.get(e);if(e instanceof jM){const i=e,s=i.format?this._getTypeInfo(i.format,i.attributes):null,l=new f0(i.name,n);return l.format=s,l.count=i.count,this._types.set(e,l),this._updateTypeInfo(l),l}if(e instanceof mo){const i=e,s=new Th(i.name,n);s.startLine=i.startLine,s.endLine=i.endLine;for(const l of i.members){const c=this._getTypeInfo(l.type,l.attributes);s.members.push(new yA(l.name,c,l.attributes))}return this._types.set(e,s),this._updateTypeInfo(s),s}if(e instanceof Qu){const i=e,s=i.format instanceof el,l=i.format?s?this._getTypeInfo(i.format,null):new ac(i.format,null):null,c=new bA(i.name,l,n,i.access);return this._types.set(e,c),this._updateTypeInfo(c),c}if(e instanceof HM){const i=e,s=i.format?this._getTypeInfo(i.format,null):null,l=new bA(i.name,s,n,i.access);return this._types.set(e,l),this._updateTypeInfo(l),l}const r=new ac(e.name,n);return this._types.set(e,r),this._updateTypeInfo(r),r}_updateTypeInfo(e){var n,r;const i=this._getTypeSize(e);if(e.size=(n=i==null?void 0:i.size)!==null&&n!==void 0?n:0,e instanceof f0&&e.format){const s=this._getTypeSize(e.format);e.stride=(r=s==null?void 0:s.size)!==null&&r!==void 0?r:0,this._updateTypeInfo(e.format)}e instanceof Th&&this._updateStructInfo(e)}_updateStructInfo(e){var n;let r=0,i=0,s=0,l=0;for(let c=0,f=e.members.length;ct.name);Hs._samplerTypes=k.sampler_type.map(t=>t.name);function WH(t){var s;const e={attributes:[],bindings:[]};let n;try{n=XH(t)}catch(l){return Re.error(l.message)(),e}for(const l of n.uniforms){const c=[];for(const f of((s=l.type)==null?void 0:s.members)||[])c.push({name:f.name,type:wA(f.type)});e.bindings.push({type:"uniform",name:l.name,group:l.group,location:l.binding,members:c})}for(const l of n.textures)e.bindings.push({type:"texture",name:l.name,group:l.group,location:l.binding});for(const l of n.samplers)e.bindings.push({type:"sampler",name:l.name,group:l.group,location:l.binding});const r=n.entry.vertex[0],i=(r==null?void 0:r.inputs.length)||0;for(let l=0;l`:t.name}function XH(t){try{return new Hs(t)}catch(e){if(e instanceof Error)throw e;let n="WGSL parse error";throw typeof e=="object"&&(e!=null&&e.message)&&(n+=`: ${e.message} `),typeof e=="object"&&(e!=null&&e.token)&&(n+=e.token.line||""),new Error(n,{cause:e})}}const qH={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...qH}};const Pi=globalThis.mathgl.config;function YH(t,{precision:e=Pi.precision}={}){return t=KH(t),`${parseFloat(t.toPrecision(e))}`}function Ic(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function ka(t,e,n){return QH(t,r=>Math.max(e,Math.min(n,r)))}function Mg(t,e,n){return Ic(t)?t.map((r,i)=>Mg(r,e[i],n)):n*e+(1-n)*t}function Ff(t,e,n){const r=Pi.EPSILON;try{if(t===e)return!0;if(Ic(t)&&Ic(e)){if(t.length!==e.length)return!1;for(let i=0;i0?", ":"")+YH(this[r],e);return`${e.printTypes?this.constructor.name:""}[${n}]`}equals(e){if(!e||this.length!==e.length)return!1;for(let n=0;n=0&&e=0&&eMath.PI*2)throw Error("expected radians")}function Bj(t,e,n,r,i,s){const l=2*s/(n-e),c=2*s/(i-r),f=(n+e)/(n-e),d=(i+r)/(i-r),g=-1,m=-1,v=-2*s;return t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=f,t[9]=d,t[10]=g,t[11]=m,t[12]=0,t[13]=0,t[14]=v,t[15]=0,t}function eO(t,e=[],n=0){const r=Math.fround(t),i=t-r;return e[n]=r,e[n+1]=i,e}function Uj(t){return t-Math.fround(t)}function Lj(t){const e=new Float32Array(32);for(let n=0;n<4;++n)for(let r=0;r<4;++r){const i=n*4+r;eO(t[r*4+n],e,i*2)}return e}const zj=`#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND + +// All these functions are for substituting tan() function from Intel GPU only +const float TWO_PI = 6.2831854820251465; +const float PI_2 = 1.5707963705062866; +const float PI_16 = 0.1963495463132858; + +const float SIN_TABLE_0 = 0.19509032368659973; +const float SIN_TABLE_1 = 0.3826834261417389; +const float SIN_TABLE_2 = 0.5555702447891235; +const float SIN_TABLE_3 = 0.7071067690849304; + +const float COS_TABLE_0 = 0.9807852506637573; +const float COS_TABLE_1 = 0.9238795042037964; +const float COS_TABLE_2 = 0.8314695954322815; +const float COS_TABLE_3 = 0.7071067690849304; + +const float INVERSE_FACTORIAL_3 = 1.666666716337204e-01; // 1/3! +const float INVERSE_FACTORIAL_5 = 8.333333767950535e-03; // 1/5! +const float INVERSE_FACTORIAL_7 = 1.9841270113829523e-04; // 1/7! +const float INVERSE_FACTORIAL_9 = 2.75573188446287533e-06; // 1/9! + +float sin_taylor_fp32(float a) { + float r, s, t, x; + + if (a == 0.0) { + return 0.0; + } + + x = -a * a; + s = a; + r = a; + + r = r * x; + t = r * INVERSE_FACTORIAL_3; + s = s + t; + + r = r * x; + t = r * INVERSE_FACTORIAL_5; + s = s + t; + + r = r * x; + t = r * INVERSE_FACTORIAL_7; + s = s + t; + + r = r * x; + t = r * INVERSE_FACTORIAL_9; + s = s + t; + + return s; +} + +void sincos_taylor_fp32(float a, out float sin_t, out float cos_t) { + if (a == 0.0) { + sin_t = 0.0; + cos_t = 1.0; + } + sin_t = sin_taylor_fp32(a); + cos_t = sqrt(1.0 - sin_t * sin_t); +} + +float tan_taylor_fp32(float a) { + float sin_a; + float cos_a; + + if (a == 0.0) { + return 0.0; + } + + // 2pi range reduction + float z = floor(a / TWO_PI); + float r = a - TWO_PI * z; + + float t; + float q = floor(r / PI_2 + 0.5); + int j = int(q); + + if (j < -2 || j > 2) { + return 1.0 / 0.0; + } + + t = r - PI_2 * q; + + q = floor(t / PI_16 + 0.5); + int k = int(q); + int abs_k = int(abs(float(k))); + + if (abs_k > 4) { + return 1.0 / 0.0; + } else { + t = t - PI_16 * q; + } + + float u = 0.0; + float v = 0.0; + + float sin_t, cos_t; + float s, c; + sincos_taylor_fp32(t, sin_t, cos_t); + + if (k == 0) { + s = sin_t; + c = cos_t; + } else { + if (abs(float(abs_k) - 1.0) < 0.5) { + u = COS_TABLE_0; + v = SIN_TABLE_0; + } else if (abs(float(abs_k) - 2.0) < 0.5) { + u = COS_TABLE_1; + v = SIN_TABLE_1; + } else if (abs(float(abs_k) - 3.0) < 0.5) { + u = COS_TABLE_2; + v = SIN_TABLE_2; + } else if (abs(float(abs_k) - 4.0) < 0.5) { + u = COS_TABLE_3; + v = SIN_TABLE_3; + } + if (k > 0) { + s = u * sin_t + v * cos_t; + c = u * cos_t - v * sin_t; + } else { + s = u * sin_t - v * cos_t; + c = u * cos_t + v * sin_t; + } + } + + if (j == 0) { + sin_a = s; + cos_a = c; + } else if (j == 1) { + sin_a = c; + cos_a = -s; + } else if (j == -1) { + sin_a = -c; + cos_a = s; + } else { + sin_a = -s; + cos_a = -c; + } + return sin_a / cos_a; +} +#endif + +float tan_fp32(float a) { +#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND + return tan_taylor_fp32(a); +#else + return tan(a); +#endif +} +`,$j={name:"fp32",vs:zj},Vj=` +uniform fp64arithmeticUniforms { + uniform float ONE; +} fp64; + +/* +About LUMA_FP64_CODE_ELIMINATION_WORKAROUND + +The purpose of this workaround is to prevent shader compilers from +optimizing away necessary arithmetic operations by swapping their sequences +or transform the equation to some 'equivalent' form. + +The method is to multiply an artifical variable, ONE, which will be known to +the compiler to be 1 only at runtime. The whole expression is then represented +as a polynomial with respective to ONE. In the coefficients of all terms, only one a +and one b should appear + +err = (a + b) * ONE^6 - a * ONE^5 - (a + b) * ONE^4 + a * ONE^3 - b - (a + b) * ONE^2 + a * ONE +*/ + +// Divide float number to high and low floats to extend fraction bits +vec2 split(float a) { + const float SPLIT = 4097.0; + float t = a * SPLIT; +#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND) + float a_hi = t * fp64.ONE - (t - a); + float a_lo = a * fp64.ONE - a_hi; +#else + float a_hi = t - (t - a); + float a_lo = a - a_hi; +#endif + return vec2(a_hi, a_lo); +} + +// Divide float number again when high float uses too many fraction bits +vec2 split2(vec2 a) { + vec2 b = split(a.x); + b.y += a.y; + return b; +} + +// Special sum operation when a > b +vec2 quickTwoSum(float a, float b) { +#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND) + float sum = (a + b) * fp64.ONE; + float err = b - (sum - a) * fp64.ONE; +#else + float sum = a + b; + float err = b - (sum - a); +#endif + return vec2(sum, err); +} + +// General sum operation +vec2 twoSum(float a, float b) { + float s = (a + b); +#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND) + float v = (s * fp64.ONE - a) * fp64.ONE; + float err = (a - (s - v) * fp64.ONE) * fp64.ONE * fp64.ONE * fp64.ONE + (b - v); +#else + float v = s - a; + float err = (a - (s - v)) + (b - v); +#endif + return vec2(s, err); +} + +vec2 twoSub(float a, float b) { + float s = (a - b); +#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND) + float v = (s * fp64.ONE - a) * fp64.ONE; + float err = (a - (s - v) * fp64.ONE) * fp64.ONE * fp64.ONE * fp64.ONE - (b + v); +#else + float v = s - a; + float err = (a - (s - v)) - (b + v); +#endif + return vec2(s, err); +} + +vec2 twoSqr(float a) { + float prod = a * a; + vec2 a_fp64 = split(a); +#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND) + float err = ((a_fp64.x * a_fp64.x - prod) * fp64.ONE + 2.0 * a_fp64.x * + a_fp64.y * fp64.ONE * fp64.ONE) + a_fp64.y * a_fp64.y * fp64.ONE * fp64.ONE * fp64.ONE; +#else + float err = ((a_fp64.x * a_fp64.x - prod) + 2.0 * a_fp64.x * a_fp64.y) + a_fp64.y * a_fp64.y; +#endif + return vec2(prod, err); +} + +vec2 twoProd(float a, float b) { + float prod = a * b; + vec2 a_fp64 = split(a); + vec2 b_fp64 = split(b); + float err = ((a_fp64.x * b_fp64.x - prod) + a_fp64.x * b_fp64.y + + a_fp64.y * b_fp64.x) + a_fp64.y * b_fp64.y; + return vec2(prod, err); +} + +vec2 sum_fp64(vec2 a, vec2 b) { + vec2 s, t; + s = twoSum(a.x, b.x); + t = twoSum(a.y, b.y); + s.y += t.x; + s = quickTwoSum(s.x, s.y); + s.y += t.y; + s = quickTwoSum(s.x, s.y); + return s; +} + +vec2 sub_fp64(vec2 a, vec2 b) { + vec2 s, t; + s = twoSub(a.x, b.x); + t = twoSub(a.y, b.y); + s.y += t.x; + s = quickTwoSum(s.x, s.y); + s.y += t.y; + s = quickTwoSum(s.x, s.y); + return s; +} + +vec2 mul_fp64(vec2 a, vec2 b) { + vec2 prod = twoProd(a.x, b.x); + // y component is for the error + prod.y += a.x * b.y; +#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND) + prod = split2(prod); +#endif + prod = quickTwoSum(prod.x, prod.y); + prod.y += a.y * b.x; +#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND) + prod = split2(prod); +#endif + prod = quickTwoSum(prod.x, prod.y); + return prod; +} + +vec2 div_fp64(vec2 a, vec2 b) { + float xn = 1.0 / b.x; +#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND) + vec2 yn = mul_fp64(a, vec2(xn, 0)); +#else + vec2 yn = a * xn; +#endif + float diff = (sub_fp64(a, mul_fp64(b, yn))).x; + vec2 prod = twoProd(xn, diff); + return sum_fp64(yn, prod); +} + +vec2 sqrt_fp64(vec2 a) { + if (a.x == 0.0 && a.y == 0.0) return vec2(0.0, 0.0); + if (a.x < 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0); + + float x = 1.0 / sqrt(a.x); + float yn = a.x * x; +#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND) + vec2 yn_sqr = twoSqr(yn) * fp64.ONE; +#else + vec2 yn_sqr = twoSqr(yn); +#endif + float diff = sub_fp64(a, yn_sqr).x; + vec2 prod = twoProd(x * 0.5, diff); +#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND) + return sum_fp64(split(yn), prod); +#else + return sum_fp64(vec2(yn, 0.0), prod); +#endif +} +`,Hj={ONE:1},jj={name:"fp64arithmetic",vs:Vj,defaultUniforms:Hj,uniformTypes:{ONE:"f32"},fp64ify:eO,fp64LowPart:Uj,fp64ifyMatrix4:Lj},Wj=[0,1,1,1],Xj=`uniform pickingUniforms { + float isActive; + float isAttribute; + float isHighlightActive; + float useFloatColors; + vec3 highlightedObjectColor; + vec4 highlightColor; +} picking; + +out vec4 picking_vRGBcolor_Avalid; + +// Normalize unsigned byte color to 0-1 range +vec3 picking_normalizeColor(vec3 color) { + return picking.useFloatColors > 0.5 ? color : color / 255.0; +} + +// Normalize unsigned byte color to 0-1 range +vec4 picking_normalizeColor(vec4 color) { + return picking.useFloatColors > 0.5 ? color : color / 255.0; +} + +bool picking_isColorZero(vec3 color) { + return dot(color, vec3(1.0)) < 0.00001; +} + +bool picking_isColorValid(vec3 color) { + return dot(color, vec3(1.0)) > 0.00001; +} + +// Check if this vertex is highlighted +bool isVertexHighlighted(vec3 vertexColor) { + vec3 highlightedObjectColor = picking_normalizeColor(picking.highlightedObjectColor); + return + bool(picking.isHighlightActive) && picking_isColorZero(abs(vertexColor - highlightedObjectColor)); +} + +// Set the current picking color +void picking_setPickingColor(vec3 pickingColor) { + pickingColor = picking_normalizeColor(pickingColor); + + if (bool(picking.isActive)) { + // Use alpha as the validity flag. If pickingColor is [0, 0, 0] fragment is non-pickable + picking_vRGBcolor_Avalid.a = float(picking_isColorValid(pickingColor)); + + if (!bool(picking.isAttribute)) { + // Stores the picking color so that the fragment shader can render it during picking + picking_vRGBcolor_Avalid.rgb = pickingColor; + } + } else { + // Do the comparison with selected item color in vertex shader as it should mean fewer compares + picking_vRGBcolor_Avalid.a = float(isVertexHighlighted(pickingColor)); + } +} + +void picking_setPickingAttribute(float value) { + if (bool(picking.isAttribute)) { + picking_vRGBcolor_Avalid.r = value; + } +} + +void picking_setPickingAttribute(vec2 value) { + if (bool(picking.isAttribute)) { + picking_vRGBcolor_Avalid.rg = value; + } +} + +void picking_setPickingAttribute(vec3 value) { + if (bool(picking.isAttribute)) { + picking_vRGBcolor_Avalid.rgb = value; + } +} +`,qj=`uniform pickingUniforms { + float isActive; + float isAttribute; + float isHighlightActive; + float useFloatColors; + vec3 highlightedObjectColor; + vec4 highlightColor; +} picking; + +in vec4 picking_vRGBcolor_Avalid; + +/* + * Returns highlight color if this item is selected. + */ +vec4 picking_filterHighlightColor(vec4 color) { + // If we are still picking, we don't highlight + if (picking.isActive > 0.5) { + return color; + } + + bool selected = bool(picking_vRGBcolor_Avalid.a); + + if (selected) { + // Blend in highlight color based on its alpha value + float highLightAlpha = picking.highlightColor.a; + float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha); + float highLightRatio = highLightAlpha / blendedAlpha; + + vec3 blendedRGB = mix(color.rgb, picking.highlightColor.rgb, highLightRatio); + return vec4(blendedRGB, blendedAlpha); + } else { + return color; + } +} + +/* + * Returns picking color if picking enabled else unmodified argument. + */ +vec4 picking_filterPickingColor(vec4 color) { + if (bool(picking.isActive)) { + if (picking_vRGBcolor_Avalid.a == 0.0) { + discard; + } + return picking_vRGBcolor_Avalid; + } + return color; +} + +/* + * Returns picking color if picking is enabled if not + * highlight color if this item is selected, otherwise unmodified argument. + */ +vec4 picking_filterColor(vec4 color) { + vec4 highlightColor = picking_filterHighlightColor(color); + return picking_filterPickingColor(highlightColor); +} +`,CA={props:{},uniforms:{},name:"picking",uniformTypes:{isActive:"f32",isAttribute:"f32",isHighlightActive:"f32",useFloatColors:"f32",highlightedObjectColor:"vec3",highlightColor:"vec4"},defaultUniforms:{isActive:!1,isAttribute:!1,isHighlightActive:!1,useFloatColors:!0,highlightedObjectColor:[0,0,0],highlightColor:Wj},vs:Xj,fs:qj,getUniforms:Yj};function Yj(t={},e){const n={};if(t.highlightedObjectColor!==void 0)if(t.highlightedObjectColor===null)n.isHighlightActive=!1;else{n.isHighlightActive=!0;const r=t.highlightedObjectColor.slice(0,3);n.highlightedObjectColor=r}if(t.highlightColor){const r=Array.from(t.highlightColor,i=>i/255);Number.isFinite(r[3])||(r[3]=1),n.highlightColor=r}return t.isActive!==void 0&&(n.isActive=!!t.isActive,n.isAttribute=!!t.isAttribute),t.useFloatColors!==void 0&&(n.useFloatColors=!!t.useFloatColors),n}const RA=`precision highp int; + +// #if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX)) +struct AmbientLight { + vec3 color; +}; + +struct PointLight { + vec3 color; + vec3 position; + vec3 attenuation; // 2nd order x:Constant-y:Linear-z:Exponential +}; + +struct DirectionalLight { + vec3 color; + vec3 direction; +}; + +uniform lightingUniforms { + int enabled; + int lightType; + + int directionalLightCount; + int pointLightCount; + + vec3 ambientColor; + + vec3 lightColor0; + vec3 lightPosition0; + vec3 lightDirection0; + vec3 lightAttenuation0; + + vec3 lightColor1; + vec3 lightPosition1; + vec3 lightDirection1; + vec3 lightAttenuation1; + + vec3 lightColor2; + vec3 lightPosition2; + vec3 lightDirection2; + vec3 lightAttenuation2; +} lighting; + +PointLight lighting_getPointLight(int index) { + switch (index) { + case 0: + return PointLight(lighting.lightColor0, lighting.lightPosition0, lighting.lightAttenuation0); + case 1: + return PointLight(lighting.lightColor1, lighting.lightPosition1, lighting.lightAttenuation1); + case 2: + default: + return PointLight(lighting.lightColor2, lighting.lightPosition2, lighting.lightAttenuation2); + } +} + +DirectionalLight lighting_getDirectionalLight(int index) { + switch (index) { + case 0: + return DirectionalLight(lighting.lightColor0, lighting.lightDirection0); + case 1: + return DirectionalLight(lighting.lightColor1, lighting.lightDirection1); + case 2: + default: + return DirectionalLight(lighting.lightColor2, lighting.lightDirection2); + } +} + +float getPointLightAttenuation(PointLight pointLight, float distance) { + return pointLight.attenuation.x + + pointLight.attenuation.y * distance + + pointLight.attenuation.z * distance * distance; +} + +// #endif +`,Kj=`// #if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX)) +struct AmbientLight { + color: vec3, +}; + +struct PointLight { + color: vec3, + position: vec3, + attenuation: vec3, // 2nd order x:Constant-y:Linear-z:Exponential +}; + +struct DirectionalLight { + color: vec3, + direction: vec3, +}; + +struct lightingUniforms { + enabled: i32, + poightCount: i32, + directionalLightCount: i32, + + ambientColor: vec3, + + // TODO - support multiple lights by uncommenting arrays below + lightType: i32, + lightColor: vec3, + lightDirection: vec3, + lightPosition: vec3, + lightAttenuation: vec3, + + // AmbientLight ambientLight; + // PointLight pointLight[MAX_LIGHTS]; + // DirectionalLight directionalLight[MAX_LIGHTS]; +}; + +// Binding 0:1 is reserved for lighting (Note: could go into separate bind group as it is stable across draw calls) +@binding(1) @group(0) var lighting : lightingUniforms; + +fn lighting_getPointLight(index: i32) -> PointLight { + return PointLight(lighting.lightColor, lighting.lightPosition, lighting.lightAttenuation); +} + +fn lighting_getDirectionalLight(index: i32) -> DirectionalLight { + return DirectionalLight(lighting.lightColor, lighting.lightDirection); +} + +fn getPointLightAttenuation(pointLight: PointLight, distance: f32) -> f32 { + return pointLight.attenuation.x + + pointLight.attenuation.y * distance + + pointLight.attenuation.z * distance * distance; +} +`,tO=3,Zj=255;var kf;(function(t){t[t.POINT=0]="POINT",t[t.DIRECTIONAL=1]="DIRECTIONAL"})(kf||(kf={}));const uf={props:{},uniforms:{},name:"lighting",defines:{MAX_LIGHTS:tO},uniformTypes:{enabled:"i32",lightType:"i32",directionalLightCount:"i32",pointLightCount:"i32",ambientLightColor:"vec3",lightColor0:"vec3",lightPosition0:"vec3",lightDirection0:"vec3",lightAttenuation0:"vec3",lightColor1:"vec3",lightPosition1:"vec3",lightDirection1:"vec3",lightAttenuation1:"vec3",lightColor2:"vec3",lightPosition2:"vec3",lightDirection2:"vec3",lightAttenuation2:"vec3"},defaultUniforms:{enabled:1,lightType:kf.POINT,directionalLightCount:0,pointLightCount:0,ambientLightColor:[.1,.1,.1],lightColor0:[1,1,1],lightPosition0:[1,1,2],lightDirection0:[1,1,1],lightAttenuation0:[1,0,0],lightColor1:[1,1,1],lightPosition1:[1,1,2],lightDirection1:[1,1,1],lightAttenuation1:[1,0,0],lightColor2:[1,1,1],lightPosition2:[1,1,2],lightDirection2:[1,1,1],lightAttenuation2:[1,0,0]},source:Kj,vs:RA,fs:RA,getUniforms:Qj};function Qj(t,e={}){if(t=t&&{...t},!t)return{...uf.defaultUniforms};t.lights&&(t={...t,...Jj(t.lights),lights:void 0});const{ambientLight:n,pointLights:r,directionalLights:i}=t||{};if(!(n||r&&r.length>0||i&&i.length>0))return{...uf.defaultUniforms,enabled:0};const l={...uf.defaultUniforms,...e,...Gj({ambientLight:n,pointLights:r,directionalLights:i})};return t.enabled!==void 0&&(l.enabled=t.enabled?1:0),l}function Gj({ambientLight:t,pointLights:e=[],directionalLights:n=[]}){const r={};r.ambientLightColor=m0(t);let i=0;for(const s of e){r.lightType=kf.POINT;const l=i;r[`lightColor${l}`]=m0(s),r[`lightPosition${l}`]=s.position,r[`lightAttenuation${l}`]=s.attenuation||[1,0,0],i++}for(const s of n){r.lightType=kf.DIRECTIONAL;const l=i;r[`lightColor${l}`]=m0(s),r[`lightDirection${l}`]=s.direction,i++}return i>tO&&Re.warn("MAX_LIGHTS exceeded")(),r.directionalLightCount=n.length,r.pointLightCount=e.length,r}function Jj(t){var n,r;const e={pointLights:[],directionalLights:[]};for(const i of t||[])switch(i.type){case"ambient":e.ambientLight=i;break;case"directional":(n=e.directionalLights)==null||n.push(i);break;case"point":(r=e.pointLights)==null||r.push(i);break}return e}function m0(t={}){const{color:e=[0,0,0],intensity:n=1}=t;return e.map(r=>r*n/Zj)}const nO=`uniform phongMaterialUniforms { + uniform float ambient; + uniform float diffuse; + uniform float shininess; + uniform vec3 specularColor; +} material; +`,rO=`uniform phongMaterialUniforms { + uniform float ambient; + uniform float diffuse; + uniform float shininess; + uniform vec3 specularColor; +} material; + +vec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) { + vec3 halfway_direction = normalize(light_direction + view_direction); + float lambertian = dot(light_direction, normal_worldspace); + float specular = 0.0; + if (lambertian > 0.0) { + float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0); + specular = pow(specular_angle, material.shininess); + } + lambertian = max(lambertian, 0.0); + return (lambertian * material.diffuse * surfaceColor + specular * material.specularColor) * color; +} + +vec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) { + vec3 lightColor = surfaceColor; + + if (lighting.enabled == 0) { + return lightColor; + } + + vec3 view_direction = normalize(cameraPosition - position_worldspace); + lightColor = material.ambient * surfaceColor * lighting.ambientColor; + + for (int i = 0; i < lighting.pointLightCount; i++) { + PointLight pointLight = lighting_getPointLight(i); + vec3 light_position_worldspace = pointLight.position; + vec3 light_direction = normalize(light_position_worldspace - position_worldspace); + float light_attenuation = getPointLightAttenuation(pointLight, distance(light_position_worldspace, position_worldspace)); + lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color / light_attenuation); + } + + int totalLights = min(MAX_LIGHTS, lighting.pointLightCount + lighting.directionalLightCount); + for (int i = lighting.pointLightCount; i < totalLights; i++) { + DirectionalLight directionalLight = lighting_getDirectionalLight(i); + lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color); + } + + return lightColor; +} +`,iO={props:{},name:"gouraudMaterial",vs:rO.replace("phongMaterial","gouraudMaterial"),fs:nO.replace("phongMaterial","gouraudMaterial"),defines:{LIGHTING_VERTEX:1},dependencies:[uf],uniformTypes:{ambient:"f32",diffuse:"f32",shininess:"f32",specularColor:"vec3"},defaultUniforms:{ambient:.35,diffuse:.6,shininess:32,specularColor:[.15,.15,.15]},getUniforms(t){const e={...t};return e.specularColor&&(e.specularColor=e.specularColor.map(n=>n/255)),{...iO.defaultUniforms,...e}}},eW=`struct phongMaterialUniforms { + ambient: f32, + diffuse: f32, + shininess: f32, + specularColor: vec3, +}; + +@binding(2) @group(0) var material : phongMaterialUniforms; + +fn lighting_getLightColor(surfaceColor: vec3, light_direction: vec3, view_direction: vec3, normal_worldspace: vec3, color: vec3) -> vec3 { + let halfway_direction: vec3 = normalize(light_direction + view_direction); + var lambertian: f32 = dot(light_direction, normal_worldspace); + var specular: f32 = 0.0; + if (lambertian > 0.0) { + let specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0); + specular = pow(specular_angle, material.shininess); + } + lambertian = max(lambertian, 0.0); + return (lambertian * material.diffuse * surfaceColor + specular * material.specularColor) * color; +} + +fn lighting_getLightColor2(surfaceColor: vec3, cameraPosition: vec3, position_worldspace: vec3, normal_worldspace: vec3) -> vec3 { + var lightColor: vec3 = surfaceColor; + + if (lighting.enabled == 0) { + return lightColor; + } + + let view_direction: vec3 = normalize(cameraPosition - position_worldspace); + lightColor = material.ambient * surfaceColor * lighting.ambientColor; + + if (lighting.lightType == 0) { + let pointLight: PointLight = lighting_getPointLight(0); + let light_position_worldspace: vec3 = pointLight.position; + let light_direction: vec3 = normalize(light_position_worldspace - position_worldspace); + lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color); + } else if (lighting.lightType == 1) { + var directionalLight: DirectionalLight = lighting_getDirectionalLight(0); + lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color); + } + + return lightColor; + /* + for (int i = 0; i < MAX_LIGHTS; i++) { + if (i >= lighting.pointLightCount) { + break; + } + PointLight pointLight = lighting.pointLight[i]; + vec3 light_position_worldspace = pointLight.position; + vec3 light_direction = normalize(light_position_worldspace - position_worldspace); + lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color); + } + + for (int i = 0; i < MAX_LIGHTS; i++) { + if (i >= lighting.directionalLightCount) { + break; + } + DirectionalLight directionalLight = lighting.directionalLight[i]; + lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color); + } + */ +} + +fn lighting_getSpecularLightColor(cameraPosition: vec3, position_worldspace: vec3, normal_worldspace: vec3) -> vec3{ + var lightColor = vec3(0, 0, 0); + let surfaceColor = vec3(0, 0, 0); + + if (lighting.enabled == 0) { + let view_direction = normalize(cameraPosition - position_worldspace); + + switch (lighting.lightType) { + case 0, default: { + let pointLight: PointLight = lighting_getPointLight(0); + let light_position_worldspace: vec3 = pointLight.position; + let light_direction: vec3 = normalize(light_position_worldspace - position_worldspace); + lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color); + } + case 1: { + let directionalLight: DirectionalLight = lighting_getDirectionalLight(0); + lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color); + } + } + } + return lightColor; +} +`,sO={name:"phongMaterial",dependencies:[uf],source:eW,vs:nO,fs:rO,defines:{LIGHTING_FRAGMENT:1},uniformTypes:{ambient:"f32",diffuse:"f32",shininess:"f32",specularColor:"vec3"},defaultUniforms:{ambient:.35,diffuse:.6,shininess:32,specularColor:[.15,.15,.15]},getUniforms(t){const e={...t};return e.specularColor&&(e.specularColor=e.specularColor.map(n=>n/255)),{...sO.defaultUniforms,...e}}},xA=`uniform layerUniforms { + uniform float opacity; +} layer; +`,tW={name:"layer",vs:xA,fs:xA,getUniforms:t=>({opacity:Math.pow(t.opacity,1/2.2)}),uniformTypes:{opacity:"f32"}},aO="#define SMOOTH_EDGE_RADIUS 0.5",nW=` +${aO} + +struct VertexGeometry { + vec4 position; + vec3 worldPosition; + vec3 worldPositionAlt; + vec3 normal; + vec2 uv; + vec3 pickingColor; +} geometry = VertexGeometry( + vec4(0.0, 0.0, 1.0, 0.0), + vec3(0.0), + vec3(0.0), + vec3(0.0), + vec2(0.0), + vec3(0.0) +); +`,rW=` +${aO} + +struct FragmentGeometry { + vec2 uv; +} geometry; + +float smoothedge(float edge, float x) { + return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x); +} +`,oO={name:"geometry",vs:nW,fs:rW},iW=25;var lr;(function(t){t[t.Start=1]="Start",t[t.Move=2]="Move",t[t.End=4]="End",t[t.Cancel=8]="Cancel"})(lr||(lr={}));var fr;(function(t){t[t.None=0]="None",t[t.Left=1]="Left",t[t.Right=2]="Right",t[t.Up=4]="Up",t[t.Down=8]="Down",t[t.Horizontal=3]="Horizontal",t[t.Vertical=12]="Vertical",t[t.All=15]="All"})(fr||(fr={}));var At;(function(t){t[t.Possible=1]="Possible",t[t.Began=2]="Began",t[t.Changed=4]="Changed",t[t.Ended=8]="Ended",t[t.Recognized=8]="Recognized",t[t.Cancelled=16]="Cancelled",t[t.Failed=32]="Failed"})(At||(At={}));const sW="compute",aW="auto",dy="manipulation",jh="none",hy="pan-x",gy="pan-y";function oW(t){if(t.includes(jh))return jh;const e=t.includes(hy),n=t.includes(gy);return e&&n?jh:e||n?e?hy:gy:t.includes(dy)?dy:aW}class lW{constructor(e,n){this.actions="",this.manager=e,this.set(n)}set(e){e===sW&&(e=this.compute()),this.manager.element&&(this.manager.element.style.touchAction=e,this.actions=e)}update(){this.set(this.manager.options.touchAction)}compute(){let e=[];for(const n of this.manager.recognizers)n.options.enable&&(e=e.concat(n.getTouchAction()));return oW(e.join(" "))}}function Pg(t){return t.trim().split(/\s+/g)}function v0(t,e,n){if(t)for(const r of Pg(e))t.addEventListener(r,n,!1)}function _0(t,e,n){if(t)for(const r of Pg(e))t.removeEventListener(r,n,!1)}function MA(t){return(t.ownerDocument||t).defaultView}function cW(t,e){let n=t;for(;n;){if(n===e)return!0;n=n.parentNode}return!1}function lO(t){const e=t.length;if(e===1)return{x:Math.round(t[0].clientX),y:Math.round(t[0].clientY)};let n=0,r=0,i=0;for(;i=Math.abs(e)?t<0?fr.Left:fr.Right:e<0?fr.Up:fr.Down}function fW(t,e){const n=e.center;let r=t.offsetDelta,i=t.prevDelta;const s=t.prevInput;return(e.eventType===lr.Start||(s==null?void 0:s.eventType)===lr.End)&&(i=t.prevDelta={x:(s==null?void 0:s.deltaX)||0,y:(s==null?void 0:s.deltaY)||0},r=t.offsetDelta={x:n.x,y:n.y}),{deltaX:i.x+(n.x-r.x),deltaY:i.y+(n.y-r.y)}}function fO(t,e,n){return{x:e/t||0,y:n/t||0}}function dW(t,e){return PA(e[0],e[1])/PA(t[0],t[1])}function hW(t,e){return NA(e[1],e[0])-NA(t[1],t[0])}function gW(t,e){const n=t.lastInterval||e,r=e.timeStamp-n.timeStamp;let i,s,l,c;if(e.eventType!==lr.Cancel&&(r>iW||n.velocity===void 0)){const f=e.deltaX-n.deltaX,d=e.deltaY-n.deltaY,g=fO(r,f,d);s=g.x,l=g.y,i=Math.abs(g.x)>Math.abs(g.y)?g.x:g.y,c=uO(f,d),t.lastInterval=e}else i=n.velocity,s=n.velocityX,l=n.velocityY,c=n.direction;e.velocity=i,e.velocityX=s,e.velocityY=l,e.direction=c}function pW(t,e){const{session:n}=t,{pointers:r}=e,{length:i}=r;n.firstInput||(n.firstInput=OA(e)),i>1&&!n.firstMultiple?n.firstMultiple=OA(e):i===1&&(n.firstMultiple=!1);const{firstInput:s,firstMultiple:l}=n,c=l?l.center:s.center,f=e.center=lO(r);e.timeStamp=Date.now(),e.deltaTime=e.timeStamp-s.timeStamp,e.angle=uW(c,f),e.distance=cO(c,f);const{deltaX:d,deltaY:g}=fW(n,e);e.deltaX=d,e.deltaY=g,e.offsetDirection=uO(e.deltaX,e.deltaY);const m=fO(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=m.x,e.overallVelocityY=m.y,e.overallVelocity=Math.abs(m.x)>Math.abs(m.y)?m.x:m.y,e.scale=l?dW(l.pointers,r):1,e.rotation=l?hW(l.pointers,r):0,e.maxPointers=n.prevInput?e.pointers.length>n.prevInput.maxPointers?e.pointers.length:n.prevInput.maxPointers:e.pointers.length;let v=t.element;return cW(e.srcEvent.target,v)&&(v=e.srcEvent.target),e.target=v,gW(n,e),e}function mW(t,e,n){const r=n.pointers.length,i=n.changedPointers.length,s=e&lr.Start&&r-i===0,l=e&(lr.End|lr.Cancel)&&r-i===0;n.isFirst=!!s,n.isFinal=!!l,s&&(t.session={}),n.eventType=e;const c=pW(t,n);t.emit("hammer.input",c),t.recognize(c),t.session.prevInput=c}let vW=class{constructor(e){this.evEl="",this.evWin="",this.evTarget="",this.domHandler=n=>{this.manager.options.enable&&this.handler(n)},this.manager=e,this.element=e.element,this.target=e.options.inputTarget||e.element}callback(e,n){mW(this.manager,e,n)}init(){v0(this.element,this.evEl,this.domHandler),v0(this.target,this.evTarget,this.domHandler),v0(MA(this.element),this.evWin,this.domHandler)}destroy(){_0(this.element,this.evEl,this.domHandler),_0(this.target,this.evTarget,this.domHandler),_0(MA(this.element),this.evWin,this.domHandler)}};const _W={pointerdown:lr.Start,pointermove:lr.Move,pointerup:lr.End,pointercancel:lr.Cancel,pointerout:lr.Cancel},yW="pointerdown",bW="pointermove pointerup pointercancel";class SW extends vW{constructor(e){super(e),this.evEl=yW,this.evWin=bW,this.store=this.manager.session.pointerEvents=[],this.init()}handler(e){const{store:n}=this;let r=!1;const i=_W[e.type],s=e.pointerType,l=s==="touch";let c=n.findIndex(f=>f.pointerId===e.pointerId);i&lr.Start&&(e.buttons||l)?c<0&&(n.push(e),c=n.length-1):i&(lr.End|lr.Cancel)&&(r=!0),!(c<0)&&(n[c]=e,this.callback(i,{pointers:n,changedPointers:[e],eventType:i,pointerType:s,srcEvent:e}),r&&n.splice(c,1))}}const wW=["","webkit","Moz","MS","ms","o"];function EW(t,e){const n=e[0].toUpperCase()+e.slice(1);for(const r of wW){const i=r?r+n:e;if(i in t)return i}}const TW=1,IA=2,DA={touchAction:"compute",enable:!0,inputTarget:null,cssProps:{userSelect:"none",userDrag:"none",touchCallout:"none",tapHighlightColor:"rgba(0,0,0,0)"}};class AW{constructor(e,n){this.options={...DA,...n,cssProps:{...DA.cssProps,...n.cssProps},inputTarget:n.inputTarget||e},this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=new SW(this),this.touchAction=new lW(this,this.options.touchAction),this.toggleCssProps(!0)}set(e){return Object.assign(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this}stop(e){this.session.stopped=e?IA:TW}recognize(e){const{session:n}=this;if(n.stopped)return;this.session.prevented&&e.srcEvent.preventDefault();let r;const{recognizers:i}=this;let{curRecognizer:s}=n;(!s||s&&s.state&At.Recognized)&&(s=n.curRecognizer=null);let l=0;for(;l-1&&this.requireFail.splice(r,1)}return this}hasRequireFailures(){return!!this.requireFail.find(e=>e.options.enable)}canRecognizeWith(e){return!!this.simultaneous[e.id]}emit(e){if(!e)return;const{state:n}=this;n=At.Ended&&this.manager.emit(this.options.event+FA(n),e)}tryEmit(e){this.canEmit()?this.emit(e):this.state=At.Failed}canEmit(){let e=0;for(;e{this.state=At.Recognized,this.tryEmit(this._input)},n.interval),At.Began):At.Recognized}return At.Failed}failTimeout(){return this._timer=setTimeout(()=>{this.state=At.Failed},this.options.interval),At.Failed}reset(){clearTimeout(this._timer)}emit(e){this.state===At.Recognized&&(e.tapCount=this.count,this.manager.emit(this.options.event,e))}}const xW=["","start","move","end","cancel","up","down","left","right"];class BA extends hO{constructor(e={}){super({enable:!0,pointers:1,event:"pan",threshold:10,direction:fr.All,...e}),this.pX=null,this.pY=null}getTouchAction(){const{options:{direction:e}}=this,n=[];return e&fr.Horizontal&&n.push(gy),e&fr.Vertical&&n.push(hy),n}getEventNames(){return xW.map(e=>this.options.event+e)}directionTest(e){const{options:n}=this;let r=!0,{distance:i}=e,{direction:s}=e;const l=e.deltaX,c=e.deltaY;return s&n.direction||(n.direction&fr.Horizontal?(s=l===0?fr.None:l<0?fr.Left:fr.Right,r=l!==this.pX,i=Math.abs(e.deltaX)):(s=c===0?fr.None:c<0?fr.Up:fr.Down,r=c!==this.pY,i=Math.abs(e.deltaY))),e.direction=s,r&&i>n.threshold&&!!(s&n.direction)}attrTest(e){return super.attrTest(e)&&(!!(this.state&At.Began)||!(this.state&At.Began)&&this.directionTest(e))}emit(e){this.pX=e.deltaX,this.pY=e.deltaY;const n=fr[e.direction].toLowerCase();n&&(e.additionalEvent=this.options.event+n),super.emit(e)}}const MW=["","start","move","end","cancel","in","out"];class OW extends hO{constructor(e={}){super({enable:!0,event:"pinch",threshold:0,pointers:2,...e})}getTouchAction(){return[jh]}getEventNames(){return MW.map(e=>this.options.event+e)}attrTest(e){return super.attrTest(e)&&(Math.abs(e.scale-1)>this.options.threshold||!!(this.state&At.Began))}emit(e){if(e.scale!==1){const n=e.scale<1?"in":"out";e.additionalEvent=this.options.event+n}super.emit(e)}}class bp{constructor(e,n,r){this.element=e,this.callback=n,this.options=r}}const PW=typeof navigator<"u"&&navigator.userAgent?navigator.userAgent.toLowerCase():"",NW=PW.indexOf("firefox")!==-1,UA=4.000244140625,IW=40,DW=.25;class FW extends bp{constructor(e,n,r){super(e,n,{enable:!0,...r}),this.handleEvent=i=>{if(!this.options.enable)return;let s=i.deltaY;globalThis.WheelEvent&&(NW&&i.deltaMode===globalThis.WheelEvent.DOM_DELTA_PIXEL&&(s/=globalThis.devicePixelRatio),i.deltaMode===globalThis.WheelEvent.DOM_DELTA_LINE&&(s*=IW)),s!==0&&s%UA===0&&(s=Math.floor(s/UA)),i.shiftKey&&s&&(s=s*DW),this.callback({type:"wheel",center:{x:i.clientX,y:i.clientY},delta:-s,srcEvent:i,pointerType:"mouse",target:i.target})},e.addEventListener("wheel",this.handleEvent,{passive:!1})}destroy(){this.element.removeEventListener("wheel",this.handleEvent)}enableEventType(e,n){e==="wheel"&&(this.options.enable=n)}}const LA=["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"];class kW extends bp{constructor(e,n,r){super(e,n,{enable:!0,...r}),this.handleEvent=s=>{this.handleOverEvent(s),this.handleOutEvent(s),this.handleEnterEvent(s),this.handleLeaveEvent(s),this.handleMoveEvent(s)},this.pressed=!1;const{enable:i}=this.options;this.enableMoveEvent=i,this.enableLeaveEvent=i,this.enableEnterEvent=i,this.enableOutEvent=i,this.enableOverEvent=i,LA.forEach(s=>e.addEventListener(s,this.handleEvent))}destroy(){LA.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,n){switch(e){case"pointermove":this.enableMoveEvent=n;break;case"pointerover":this.enableOverEvent=n;break;case"pointerout":this.enableOutEvent=n;break;case"pointerenter":this.enableEnterEvent=n;break;case"pointerleave":this.enableLeaveEvent=n;break}}handleOverEvent(e){this.enableOverEvent&&e.type==="mouseover"&&this._emit("pointerover",e)}handleOutEvent(e){this.enableOutEvent&&e.type==="mouseout"&&this._emit("pointerout",e)}handleEnterEvent(e){this.enableEnterEvent&&e.type==="mouseenter"&&this._emit("pointerenter",e)}handleLeaveEvent(e){this.enableLeaveEvent&&e.type==="mouseleave"&&this._emit("pointerleave",e)}handleMoveEvent(e){if(this.enableMoveEvent)switch(e.type){case"mousedown":e.button>=0&&(this.pressed=!0);break;case"mousemove":e.buttons===0&&(this.pressed=!1),this.pressed||this._emit("pointermove",e);break;case"mouseup":this.pressed=!1;break}}_emit(e,n){this.callback({type:e,center:{x:n.clientX,y:n.clientY},srcEvent:n,pointerType:"mouse",target:n.target})}}const zA=["keydown","keyup"];class BW extends bp{constructor(e,n,r){super(e,n,{enable:!0,tabIndex:0,...r}),this.handleEvent=i=>{const s=i.target||i.srcElement;s.tagName==="INPUT"&&s.type==="text"||s.tagName==="TEXTAREA"||(this.enableDownEvent&&i.type==="keydown"&&this.callback({type:"keydown",srcEvent:i,key:i.key,target:i.target}),this.enableUpEvent&&i.type==="keyup"&&this.callback({type:"keyup",srcEvent:i,key:i.key,target:i.target}))},this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,e.tabIndex=this.options.tabIndex,e.style.outline="none",zA.forEach(i=>e.addEventListener(i,this.handleEvent))}destroy(){zA.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,n){e==="keydown"&&(this.enableDownEvent=n),e==="keyup"&&(this.enableUpEvent=n)}}class UW extends bp{constructor(e,n,r){super(e,n,r),this.handleEvent=i=>{this.options.enable&&this.callback({type:"contextmenu",center:{x:i.clientX,y:i.clientY},srcEvent:i,pointerType:"mouse",target:i.target})},e.addEventListener("contextmenu",this.handleEvent)}destroy(){this.element.removeEventListener("contextmenu",this.handleEvent)}enableEventType(e,n){e==="contextmenu"&&(this.options.enable=n)}}const $A=1,py=2,VA=4,LW={pointerdown:$A,pointermove:py,pointerup:VA,mousedown:$A,mousemove:py,mouseup:VA},zW=0,$W=1,VW=2,HW=1,jW=2,WW=4;function XW(t){const e=LW[t.srcEvent.type];if(!e)return null;const{buttons:n,button:r}=t.srcEvent;let i=!1,s=!1,l=!1;return e===py?(i=!!(n&HW),s=!!(n&WW),l=!!(n&jW)):(i=r===zW,s=r===$W,l=r===VW),{leftButton:i,middleButton:s,rightButton:l}}function qW(t,e){const n=t.center;if(!n)return null;const r=e.getBoundingClientRect(),i=r.width/e.offsetWidth||1,s=r.height/e.offsetHeight||1,l={x:(n.x-r.left-e.clientLeft)/i,y:(n.y-r.top-e.clientTop)/s};return{center:n,offsetCenter:l}}const YW={srcElement:"root",priority:0};class KW{constructor(e,n){this.handleEvent=r=>{if(this.isEmpty())return;const i=this._normalizeEvent(r);let s=r.srcEvent.target;for(;s&&s!==i.rootElement;){if(this._emit(i,s),i.handled)return;s=s.parentNode}this._emit(i,"root")},this.eventManager=e,this.recognizerName=n,this.handlers=[],this.handlersByElement=new Map,this._active=!1}isEmpty(){return!this._active}add(e,n,r,i=!1,s=!1){const{handlers:l,handlersByElement:c}=this,f={...YW,...r};let d=c.get(f.srcElement);d||(d=[],c.set(f.srcElement,d));const g={type:e,handler:n,srcElement:f.srcElement,priority:f.priority};i&&(g.once=!0),s&&(g.passive=!0),l.push(g),this._active=this._active||!g.passive;let m=d.length-1;for(;m>=0&&!(d[m].priority>=g.priority);)m--;d.splice(m+1,0,g)}remove(e,n){const{handlers:r,handlersByElement:i}=this;for(let s=r.length-1;s>=0;s--){const l=r[s];if(l.type===e&&l.handler===n){r.splice(s,1);const c=i.get(l.srcElement);c.splice(c.indexOf(l),1),c.length===0&&i.delete(l.srcElement)}}this._active=r.some(s=>!s.passive)}_emit(e,n){const r=this.handlersByElement.get(n);if(r){let i=!1;const s=()=>{e.handled=!0},l=()=>{e.handled=!0,i=!0},c=[];for(let f=0;f{e.srcEvent.preventDefault()},stopImmediatePropagation:null,stopPropagation:null,handled:!1,rootElement:n}}}function ZW(t){if("recognizer"in t)return t;let e;const n=Array.isArray(t)?[...t]:[t];if(typeof n[0]=="function"){const r=n.shift(),i=n.shift()||{};e=new r(i)}else e=n.shift();return{recognizer:e,recognizeWith:typeof n[0]=="string"?[n[0]]:n[0],requireFailure:typeof n[1]=="string"?[n[1]]:n[1]}}class QW{constructor(e=null,n={}){if(this._onBasicInput=r=>{this.manager.emit(r.srcEvent.type,r)},this._onOtherEvent=r=>{this.manager.emit(r.type,r)},this.options={recognizers:[],events:{},touchAction:"compute",tabIndex:0,cssProps:{},...n},this.events=new Map,this.element=e,!!e){this.manager=new AW(e,this.options);for(const r of this.options.recognizers){const{recognizer:i,recognizeWith:s,requireFailure:l}=ZW(r);this.manager.add(i),s&&i.recognizeWith(s),l&&i.requireFailure(l)}this.manager.on("hammer.input",this._onBasicInput),this.wheelInput=new FW(e,this._onOtherEvent,{enable:!1}),this.moveInput=new kW(e,this._onOtherEvent,{enable:!1}),this.keyInput=new BW(e,this._onOtherEvent,{enable:!1,tabIndex:n.tabIndex}),this.contextmenuInput=new UW(e,this._onOtherEvent,{enable:!1}),this.on(this.options.events)}}getElement(){return this.element}destroy(){this.element&&(this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy())}on(e,n,r){this._addEventHandler(e,n,r,!1)}once(e,n,r){this._addEventHandler(e,n,r,!0)}watch(e,n,r){this._addEventHandler(e,n,r,!1,!0)}off(e,n){this._removeEventHandler(e,n)}_toggleRecognizer(e,n){var s,l,c,f;const{manager:r}=this;if(!r)return;const i=r.get(e);i&&(i.set({enable:n}),r.touchAction.update()),(s=this.wheelInput)==null||s.enableEventType(e,n),(l=this.moveInput)==null||l.enableEventType(e,n),(c=this.keyInput)==null||c.enableEventType(e,n),(f=this.contextmenuInput)==null||f.enableEventType(e,n)}_addEventHandler(e,n,r,i,s){if(typeof e!="string"){r=n;for(const[d,g]of Object.entries(e))this._addEventHandler(d,g,r,i,s);return}const{manager:l,events:c}=this;if(!l)return;let f=c.get(e);if(!f){const d=this._getRecognizerName(e)||e;f=new KW(this,d),c.set(e,f),l&&l.on(e,f.handleEvent)}f.add(e,n,r,i,s),f.isEmpty()||this._toggleRecognizer(f.recognizerName,!0)}_removeEventHandler(e,n){if(typeof e!="string"){for(const[s,l]of Object.entries(e))this._removeEventHandler(s,l);return}const{events:r}=this,i=r.get(e);if(i&&(i.remove(e,n),i.isEmpty())){const{recognizerName:s}=i;let l=!1;for(const c of r.values())if(c.recognizerName===s&&!c.isEmpty()){l=!0;break}l||this._toggleRecognizer(s,!1)}}_getRecognizerName(e){var n;return(n=this.manager.recognizers.find(r=>r.getEventNames().includes(e)))==null?void 0:n.options.event}}const cn={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(cn,"IDENTITY",{get:()=>(Sn.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")(),0)});const ys={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},jo={common:0,meters:1,pixels:2},my={click:"onClick",panstart:"onDragStart",panmove:"onDrag",panend:"onDragEnd"},HA={multipan:[BA,{threshold:10,direction:fr.Vertical,pointers:2}],pinch:[OW,{},null,["multipan"]],pan:[BA,{threshold:1},["pinch"],["multipan"]],dblclick:[kA,{event:"dblclick",taps:2}],click:[kA,{event:"click"},null,["dblclick"]]},GW=Object.keys(cn).map(t=>`const int COORDINATE_SYSTEM_${t} = ${cn[t]};`).join(""),JW=Object.keys(ys).map(t=>`const int PROJECTION_MODE_${t} = ${ys[t]};`).join(""),eX=Object.keys(jo).map(t=>`const int UNIT_${t.toUpperCase()} = ${jo[t]};`).join(""),tX=`${GW} +${JW} +${eX} +uniform projectUniforms { +bool wrapLongitude; +int coordinateSystem; +vec3 commonUnitsPerMeter; +int projectionMode; +float scale; +vec3 commonUnitsPerWorldUnit; +vec3 commonUnitsPerWorldUnit2; +vec4 center; +mat4 modelMatrix; +mat4 viewProjectionMatrix; +vec2 viewportSize; +float devicePixelRatio; +float focalDistance; +vec3 cameraPosition; +vec3 coordinateOrigin; +vec3 commonOrigin; +bool pseudoMeters; +} project; +const float TILE_SIZE = 512.0; +const float PI = 3.1415926536; +const float WORLD_SCALE = TILE_SIZE / (PI * 2.0); +const vec3 ZERO_64_LOW = vec3(0.0); +const float EARTH_RADIUS = 6370972.0; +const float GLOBE_RADIUS = 256.0; +float project_size_at_latitude(float lat) { +float y = clamp(lat, -89.9, 89.9); +return 1.0 / cos(radians(y)); +} +float project_size() { +if (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR && +project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT && +project.pseudoMeters == false) { +if (geometry.position.w == 0.0) { +return project_size_at_latitude(geometry.worldPosition.y); +} +float y = geometry.position.y / TILE_SIZE * 2.0 - 1.0; +float y2 = y * y; +float y4 = y2 * y2; +float y6 = y4 * y2; +return 1.0 + 4.9348 * y2 + 4.0587 * y4 + 1.5642 * y6; +} +return 1.0; +} +float project_size_at_latitude(float meters, float lat) { +return meters * project.commonUnitsPerMeter.z * project_size_at_latitude(lat); +} +float project_size(float meters) { +return meters * project.commonUnitsPerMeter.z * project_size(); +} +vec2 project_size(vec2 meters) { +return meters * project.commonUnitsPerMeter.xy * project_size(); +} +vec3 project_size(vec3 meters) { +return meters * project.commonUnitsPerMeter * project_size(); +} +vec4 project_size(vec4 meters) { +return vec4(meters.xyz * project.commonUnitsPerMeter, meters.w); +} +mat3 project_get_orientation_matrix(vec3 up) { +vec3 uz = normalize(up); +vec3 ux = abs(uz.z) == 1.0 ? vec3(1.0, 0.0, 0.0) : normalize(vec3(uz.y, -uz.x, 0)); +vec3 uy = cross(uz, ux); +return mat3(ux, uy, uz); +} +bool project_needs_rotation(vec3 commonPosition, out mat3 transform) { +if (project.projectionMode == PROJECTION_MODE_GLOBE) { +transform = project_get_orientation_matrix(commonPosition); +return true; +} +return false; +} +vec3 project_normal(vec3 vector) { +vec4 normal_modelspace = project.modelMatrix * vec4(vector, 0.0); +vec3 n = normalize(normal_modelspace.xyz * project.commonUnitsPerMeter); +mat3 rotation; +if (project_needs_rotation(geometry.position.xyz, rotation)) { +n = rotation * n; +} +return n; +} +vec4 project_offset_(vec4 offset) { +float dy = offset.y; +vec3 commonUnitsPerWorldUnit = project.commonUnitsPerWorldUnit + project.commonUnitsPerWorldUnit2 * dy; +return vec4(offset.xyz * commonUnitsPerWorldUnit, offset.w); +} +vec2 project_mercator_(vec2 lnglat) { +float x = lnglat.x; +if (project.wrapLongitude) { +x = mod(x + 180., 360.0) - 180.; +} +float y = clamp(lnglat.y, -89.9, 89.9); +return vec2( +radians(x) + PI, +PI + log(tan_fp32(PI * 0.25 + radians(y) * 0.5)) +) * WORLD_SCALE; +} +vec3 project_globe_(vec3 lnglatz) { +float lambda = radians(lnglatz.x); +float phi = radians(lnglatz.y); +float cosPhi = cos(phi); +float D = (lnglatz.z / EARTH_RADIUS + 1.0) * GLOBE_RADIUS; +return vec3( +sin(lambda) * cosPhi, +-cos(lambda) * cosPhi, +sin(phi) +) * D; +} +vec4 project_position(vec4 position, vec3 position64Low) { +vec4 position_world = project.modelMatrix * position; +if (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR) { +if (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT) { +return vec4( +project_mercator_(position_world.xy), +project_size_at_latitude(position_world.z, position_world.y), +position_world.w +); +} +if (project.coordinateSystem == COORDINATE_SYSTEM_CARTESIAN) { +position_world.xyz += project.coordinateOrigin; +} +} +if (project.projectionMode == PROJECTION_MODE_GLOBE) { +if (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT) { +return vec4( +project_globe_(position_world.xyz), +position_world.w +); +} +} +if (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) { +if (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT) { +if (abs(position_world.y - project.coordinateOrigin.y) > 0.25) { +return vec4( +project_mercator_(position_world.xy) - project.commonOrigin.xy, +project_size(position_world.z), +position_world.w +); +} +} +} +if (project.projectionMode == PROJECTION_MODE_IDENTITY || +(project.projectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET && +(project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT || +project.coordinateSystem == COORDINATE_SYSTEM_CARTESIAN))) { +position_world.xyz -= project.coordinateOrigin; +} +return project_offset_(position_world) + project_offset_(project.modelMatrix * vec4(position64Low, 0.0)); +} +vec4 project_position(vec4 position) { +return project_position(position, ZERO_64_LOW); +} +vec3 project_position(vec3 position, vec3 position64Low) { +vec4 projected_position = project_position(vec4(position, 1.0), position64Low); +return projected_position.xyz; +} +vec3 project_position(vec3 position) { +vec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_LOW); +return projected_position.xyz; +} +vec2 project_position(vec2 position) { +vec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_LOW); +return projected_position.xy; +} +vec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) { +return viewProjectionMatrix * position + center; +} +vec4 project_common_position_to_clipspace(vec4 position) { +return project_common_position_to_clipspace(position, project.viewProjectionMatrix, project.center); +} +vec2 project_pixel_size_to_clipspace(vec2 pixels) { +vec2 offset = pixels / project.viewportSize * project.devicePixelRatio * 2.0; +return offset * project.focalDistance; +} +float project_size_to_pixel(float meters) { +return project_size(meters) * project.scale; +} +float project_size_to_pixel(float size, int unit) { +if (unit == UNIT_METERS) return project_size_to_pixel(size); +if (unit == UNIT_COMMON) return size * project.scale; +return size; +} +float project_pixel_size(float pixels) { +return pixels / project.scale; +} +vec2 project_pixel_size(vec2 pixels) { +return pixels / project.scale; +} +`;function nX(t,e){if(t===e)return!0;if(Array.isArray(t)){const n=t.length;if(!e||e.length!==n)return!1;for(let r=0;r{for(const i in r)if(!nX(r[i],e[i])){n=t(r),e=r;break}return n}}const jA=[0,0,0,0],rX=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],gO=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],iX=[0,0,0],pO=[0,0,0],sX=nd(lX);function mO(t,e,n=pO){n.length<3&&(n=[n[0],n[1],0]);let r=n,i,s=!0;switch(e===cn.LNGLAT_OFFSETS||e===cn.METER_OFFSETS?i=n:i=t.isGeospatial?[Math.fround(t.longitude),Math.fround(t.latitude),0]:null,t.projectionMode){case ys.WEB_MERCATOR:(e===cn.LNGLAT||e===cn.CARTESIAN)&&(i=[0,0,0],s=!1);break;case ys.WEB_MERCATOR_AUTO_OFFSET:e===cn.LNGLAT?r=i:e===cn.CARTESIAN&&(r=[Math.fround(t.center[0]),Math.fround(t.center[1]),0],i=t.unprojectPosition(r),r[0]-=n[0],r[1]-=n[1],r[2]-=n[2]);break;case ys.IDENTITY:r=t.position.map(Math.fround),r[2]=r[2]||0;break;case ys.GLOBE:s=!1,i=null;break;default:s=!1}return{geospatialOrigin:i,shaderCoordinateOrigin:r,offsetMode:s}}function aX(t,e,n){const{viewMatrixUncentered:r,projectionMatrix:i}=t;let{viewMatrix:s,viewProjectionMatrix:l}=t,c=jA,f=jA,d=t.cameraPosition;const{geospatialOrigin:g,shaderCoordinateOrigin:m,offsetMode:v}=mO(t,e,n);return v&&(f=t.projectPosition(g||m),d=[d[0]-f[0],d[1]-f[1],d[2]-f[2]],f[3]=1,c=td([],f,l),s=r||s,l=Bo([],i,s),l=Bo([],l,rX)),{viewMatrix:s,viewProjectionMatrix:l,projectionCenter:c,originCommon:f,cameraPosCommon:d,shaderCoordinateOrigin:m,geospatialOrigin:g}}function oX({viewport:t,devicePixelRatio:e=1,modelMatrix:n=null,coordinateSystem:r=cn.DEFAULT,coordinateOrigin:i=pO,autoWrapLongitude:s=!1}){r===cn.DEFAULT&&(r=t.isGeospatial?cn.LNGLAT:cn.CARTESIAN);const l=sX({viewport:t,devicePixelRatio:e,coordinateSystem:r,coordinateOrigin:i});return l.wrapLongitude=s,l.modelMatrix=n||gO,l}function lX({viewport:t,devicePixelRatio:e,coordinateSystem:n,coordinateOrigin:r}){const{projectionCenter:i,viewProjectionMatrix:s,originCommon:l,cameraPosCommon:c,shaderCoordinateOrigin:f,geospatialOrigin:d}=aX(t,n,r),g=t.getDistanceScales(),m=[t.width*e,t.height*e],v=td([],[0,0,-t.focalDistance,1],t.projectionMatrix)[3]||1,S={coordinateSystem:n,projectionMode:t.projectionMode,coordinateOrigin:f,commonOrigin:l.slice(0,3),center:i,pseudoMeters:!!t._pseudoMeters,viewportSize:m,devicePixelRatio:e,focalDistance:v,commonUnitsPerMeter:g.unitsPerMeter,commonUnitsPerWorldUnit:g.unitsPerMeter,commonUnitsPerWorldUnit2:iX,scale:t.scale,wrapLongitude:!1,viewProjectionMatrix:s,modelMatrix:gO,cameraPosition:c};if(d){const E=t.getDistanceScales(d);switch(n){case cn.METER_OFFSETS:S.commonUnitsPerWorldUnit=E.unitsPerMeter,S.commonUnitsPerWorldUnit2=E.unitsPerMeter2;break;case cn.LNGLAT:case cn.LNGLAT_OFFSETS:t._pseudoMeters||(S.commonUnitsPerMeter=E.unitsPerMeter),S.commonUnitsPerWorldUnit=E.unitsPerDegree,S.commonUnitsPerWorldUnit2=E.unitsPerDegree2;break;case cn.CARTESIAN:S.commonUnitsPerWorldUnit=[1,1,E.unitsPerMeter[2]],S.commonUnitsPerWorldUnit2=[0,0,E.unitsPerMeter2[2]];break}}return S}const cX={};function uX(t=cX){return"viewport"in t?oX(t):{}}const Ob={name:"project",dependencies:[$j,oO],vs:tX,getUniforms:uX,uniformTypes:{wrapLongitude:"f32",coordinateSystem:"i32",commonUnitsPerMeter:"vec3",projectionMode:"i32",scale:"f32",commonUnitsPerWorldUnit:"vec3",commonUnitsPerWorldUnit2:"vec3",center:"vec4",modelMatrix:"mat4x4",viewProjectionMatrix:"mat4x4",viewportSize:"vec2",devicePixelRatio:"f32",focalDistance:"f32",cameraPosition:"vec3",coordinateOrigin:"vec3",commonOrigin:"vec3",pseudoMeters:"f32"}},fX=` +vec4 project_position_to_clipspace( + vec3 position, vec3 position64Low, vec3 offset, out vec4 commonPosition +) { + vec3 projectedPosition = project_position(position, position64Low); + mat3 rotation; + if (project_needs_rotation(projectedPosition, rotation)) { + // offset is specified as ENU + // when in globe projection, rotate offset so that the ground alighs with the surface of the globe + offset = rotation * offset; + } + commonPosition = vec4(projectedPosition + offset, 1.0); + return project_common_position_to_clipspace(commonPosition); +} + +vec4 project_position_to_clipspace( + vec3 position, vec3 position64Low, vec3 offset +) { + vec4 commonPosition; + return project_position_to_clipspace(position, position64Low, offset, commonPosition); +} +`,vO={name:"project32",dependencies:[Ob],vs:fX};function dX(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function oc(t,e){const n=td([],e,t);return Pj(n,n,1/n[3]),n}function WA(t,e){const n=t%e;return n<0?e+n:n}function vy(t,e,n){return tn?n:t}function hX(t){return Math.log(t)*Math.LOG2E}const Pb=Math.log2||hX;function Ws(t,e){if(!t)throw new Error(e||"@math.gl/web-mercator: assertion failed.")}const Gi=Math.PI,_O=Gi/4,Ni=Gi/180,_y=180/Gi,Fc=512,Ng=4003e4,XA=85.051129,gX=1.5;function pX(t){return Pb(t)}function Ig(t){const[e,n]=t;Ws(Number.isFinite(e)),Ws(Number.isFinite(n)&&n>=-90&&n<=90,"invalid latitude");const r=e*Ni,i=n*Ni,s=Fc*(r+Gi)/(2*Gi),l=Fc*(Gi+Math.log(Math.tan(_O+i*.5)))/(2*Gi);return[s,l]}function kc(t){const[e,n]=t,r=e/Fc*(2*Gi)-Gi,i=2*(Math.atan(Math.exp(n/Fc*(2*Gi)-Gi))-_O);return[r*_y,i*_y]}function mX(t){const{latitude:e}=t;Ws(Number.isFinite(e));const n=Math.cos(e*Ni);return pX(Ng*n)-9}function y0(t){const e=Math.cos(t*Ni);return Fc/Ng/e}function yy(t){const{latitude:e,longitude:n,highPrecision:r=!1}=t;Ws(Number.isFinite(e)&&Number.isFinite(n));const i=Fc,s=Math.cos(e*Ni),l=i/360,c=l/s,f=i/Ng/s,d={unitsPerMeter:[f,f,f],metersPerUnit:[1/f,1/f,1/f],unitsPerDegree:[l,c,f],degreesPerUnit:[1/l,1/c,1/f]};if(r){const g=Ni*Math.tan(e*Ni)/s,m=l*g/2,v=i/Ng*g,S=v/c*f;d.unitsPerDegree2=[0,m,v],d.unitsPerMeter2=[S,0,S]}return d}function yO(t,e){const[n,r,i]=t,[s,l,c]=e,{unitsPerMeter:f,unitsPerMeter2:d}=yy({longitude:n,latitude:r,highPrecision:!0}),g=Ig(t);g[0]+=s*(f[0]+d[0]*l),g[1]+=l*(f[1]+d[1]*l);const m=kc(g),v=(i||0)+(c||0);return Number.isFinite(i)||Number.isFinite(c)?[m[0],m[1],v]:m}function vX(t){const{height:e,pitch:n,bearing:r,altitude:i,scale:s,center:l}=t,c=dX();Og(c,c,[0,0,-i]),GM(c,c,-n*Ni),JM(c,c,r*Ni);const f=s/e;return Mb(c,c,[f,f,f]),l&&Og(c,c,oj([],l)),c}function _X(t){const{width:e,height:n,altitude:r,pitch:i=0,offset:s,center:l,scale:c,nearZMultiplier:f=1,farZMultiplier:d=1}=t;let{fovy:g=Dg(gX)}=t;r!==void 0&&(g=Dg(r));const m=g*Ni,v=i*Ni,S=bO(g);let E=S;l&&(E+=l[2]*c/Math.cos(v)/n);const w=m*(.5+(s?s[1]:0)/n),b=Math.sin(w)*E/Math.sin(vy(Math.PI/2-v-w,.01,Math.PI-.01)),A=Math.sin(v)*b+E,T=E*10,C=Math.min(A*d,T);return{fov:m,aspect:e/n,focalDistance:S,near:f,far:C}}function Dg(t){return 2*Math.atan(.5/t)*_y}function bO(t){return .5/Math.tan(.5*t*Ni)}function SO(t,e){const[n,r,i=0]=t;return Ws(Number.isFinite(n)&&Number.isFinite(r)&&Number.isFinite(i)),oc(e,[n,r,i,1])}function Nb(t,e,n=0){const[r,i,s]=t;if(Ws(Number.isFinite(r)&&Number.isFinite(i),"invalid pixel coordinate"),Number.isFinite(s))return oc(e,[r,i,s,1]);const l=oc(e,[r,i,0,1]),c=oc(e,[r,i,1,1]),f=l[2],d=c[2],g=f===d?0:((n||0)-f)/(d-f);return KM([],l,c,g)}function yX(t){const{width:e,height:n,bounds:r,minExtent:i=0,maxZoom:s=24,offset:l=[0,0]}=t,[[c,f],[d,g]]=r,m=bX(t.padding),v=Ig([c,vy(g,-85.051129,XA)]),S=Ig([d,vy(f,-85.051129,XA)]),E=[Math.max(Math.abs(S[0]-v[0]),i),Math.max(Math.abs(S[1]-v[1]),i)],w=[e-m.left-m.right-Math.abs(l[0])*2,n-m.top-m.bottom-Math.abs(l[1])*2];Ws(w[0]>0&&w[1]>0);const b=w[0]/E[0],A=w[1]/E[1],T=(m.right-m.left)/2/b,C=(m.top-m.bottom)/2/A,M=[(S[0]+v[0])/2+T,(S[1]+v[1])/2+C],x=kc(M),N=Math.min(s,Pb(Math.abs(Math.min(b,A))));return Ws(Number.isFinite(N)),{longitude:x[0],latitude:x[1],zoom:N}}function bX(t=0){return typeof t=="number"?{top:t,bottom:t,left:t,right:t}:(Ws(Number.isFinite(t.top)&&Number.isFinite(t.bottom)&&Number.isFinite(t.left)&&Number.isFinite(t.right)),t)}const qA=Math.PI/180;function SX(t,e=0){const{width:n,height:r,unproject:i}=t,s={targetZ:e},l=i([0,r],s),c=i([n,r],s);let f,d;const g=t.fovy?.5*t.fovy*qA:Math.atan(.5/t.altitude),m=(90-t.pitch)*qA;return g>m-.01?(f=YA(t,0,e),d=YA(t,n,e)):(f=i([0,0],s),d=i([n,0],s)),[l,c,d,f]}function YA(t,e,n){const{pixelUnprojectionMatrix:r}=t,i=oc(r,[e,0,1,1]),s=oc(r,[e,t.height,1,1]),c=(n*t.distanceScales.unitsPerMeter[2]-i[2])/(s[2]-i[2]),f=KM([],i,s,c),d=kc(f);return d.push(n),d}const KA=512;function wX(t){const{width:e,height:n,pitch:r=0}=t;let{longitude:i,latitude:s,zoom:l,bearing:c=0}=t;(i<-180||i>180)&&(i=WA(i+180,360)-180),(c<-180||c>180)&&(c=WA(c+180,360)-180);const f=Pb(n/KA);if(l<=f)l=f,s=0;else{const d=n/2/Math.pow(2,l),g=kc([0,d])[1];if(sm&&(s=m)}}return{width:e,height:n,longitude:i,latitude:s,zoom:l,pitch:r,bearing:c}}const wO=` +uniform shadowUniforms { + bool drawShadowMap; + bool useShadowMap; + vec4 color; + highp int lightId; + float lightCount; + mat4 viewProjectionMatrix0; + mat4 viewProjectionMatrix1; + vec4 projectCenter0; + vec4 projectCenter1; +} shadow; +`,EX=` +const int max_lights = 2; + +out vec3 shadow_vPosition[max_lights]; + +vec4 shadow_setVertexPosition(vec4 position_commonspace) { + mat4 viewProjectionMatrices[max_lights]; + viewProjectionMatrices[0] = shadow.viewProjectionMatrix0; + viewProjectionMatrices[1] = shadow.viewProjectionMatrix1; + vec4 projectCenters[max_lights]; + projectCenters[0] = shadow.projectCenter0; + projectCenters[1] = shadow.projectCenter1; + + if (shadow.drawShadowMap) { + return project_common_position_to_clipspace(position_commonspace, viewProjectionMatrices[shadow.lightId], projectCenters[shadow.lightId]); + } + if (shadow.useShadowMap) { + for (int i = 0; i < max_lights; i++) { + if(i < int(shadow.lightCount)) { + vec4 shadowMap_position = project_common_position_to_clipspace(position_commonspace, viewProjectionMatrices[i], projectCenters[i]); + shadow_vPosition[i] = (shadowMap_position.xyz / shadowMap_position.w + 1.0) / 2.0; + } + } + } + return gl_Position; +} +`,TX=` +${wO} +${EX} +`,AX=` +const int max_lights = 2; +uniform sampler2D shadow_uShadowMap0; +uniform sampler2D shadow_uShadowMap1; + +in vec3 shadow_vPosition[max_lights]; + +const vec4 bitPackShift = vec4(1.0, 255.0, 65025.0, 16581375.0); +const vec4 bitUnpackShift = 1.0 / bitPackShift; +const vec4 bitMask = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0); + +float shadow_getShadowWeight(vec3 position, sampler2D shadowMap) { + vec4 rgbaDepth = texture(shadowMap, position.xy); + + float z = dot(rgbaDepth, bitUnpackShift); + return smoothstep(0.001, 0.01, position.z - z); +} + +vec4 shadow_filterShadowColor(vec4 color) { + if (shadow.drawShadowMap) { + vec4 rgbaDepth = fract(gl_FragCoord.z * bitPackShift); + rgbaDepth -= rgbaDepth.gbaa * bitMask; + return rgbaDepth; + } + if (shadow.useShadowMap) { + float shadowAlpha = 0.0; + shadowAlpha += shadow_getShadowWeight(shadow_vPosition[0], shadow_uShadowMap0); + if(shadow.lightCount > 1.0) { + shadowAlpha += shadow_getShadowWeight(shadow_vPosition[1], shadow_uShadowMap1); + } + shadowAlpha *= shadow.color.a / shadow.lightCount; + float blendedAlpha = shadowAlpha + color.a * (1.0 - shadowAlpha); + + return vec4( + mix(color.rgb, shadow.color.rgb, shadowAlpha / blendedAlpha), + blendedAlpha + ); + } + return color; +} +`,CX=` +${wO} +${AX} +`,RX=nd(NX),xX=nd(IX),MX=[0,0,0,1],OX=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0];function PX(t,e){const[n,r,i]=t,s=Nb([n,r,i],e);return Number.isFinite(i)?s:[s[0],s[1],0]}function NX({viewport:t,center:e}){return new ws(t.viewProjectionMatrix).invert().transform(e)}function IX({viewport:t,shadowMatrices:e}){const n=[],r=t.pixelUnprojectionMatrix,i=t.isGeospatial?void 0:1,s=[[0,0,i],[t.width,0,i],[0,t.height,i],[t.width,t.height,i],[0,0,-1],[t.width,0,-1],[0,t.height,-1],[t.width,t.height,-1]].map(l=>PX(l,r));for(const l of e){const c=l.clone().translate(new Ss(t.center).negate()),f=s.map(g=>c.transform(g)),d=new ws().ortho({left:Math.min(...f.map(g=>g[0])),right:Math.max(...f.map(g=>g[0])),bottom:Math.min(...f.map(g=>g[1])),top:Math.max(...f.map(g=>g[1])),near:Math.min(...f.map(g=>-g[2])),far:Math.max(...f.map(g=>-g[2]))});n.push(d.multiplyRight(l))}return n}function DX(t){const{shadowEnabled:e=!0,project:n}=t;if(!e||!n||!t.shadowMatrices||!t.shadowMatrices.length)return{drawShadowMap:!1,useShadowMap:!1,shadow_uShadowMap0:t.dummyShadowMap,shadow_uShadowMap1:t.dummyShadowMap};const r=Ob.getUniforms(n),i=RX({viewport:n.viewport,center:r.center}),s=[],l=xX({shadowMatrices:t.shadowMatrices,viewport:n.viewport}).slice();for(let f=0;f0:!1,color:t.shadowColor||MX,lightId:t.shadowLightId||0,lightCount:t.shadowMatrices.length,shadow_uShadowMap0:t.dummyShadowMap,shadow_uShadowMap1:t.dummyShadowMap};for(let f=0;f",lightId:"i32",lightCount:"f32",viewProjectionMatrix0:"mat4x4",viewProjectionMatrix1:"mat4x4",projectCenter0:"vec4",projectCenter1:"vec4"}},EO={...CA,defaultUniforms:{...CA.defaultUniforms,useFloatColors:!1},inject:{"vs:DECKGL_FILTER_GL_POSITION":` + // for picking depth values + picking_setPickingAttribute(position.z / position.w); + `,"vs:DECKGL_FILTER_COLOR":` + picking_setPickingColor(geometry.pickingColor); + `,"fs:DECKGL_FILTER_COLOR":{order:99,injection:` + // use highlight color if this fragment belongs to the selected object. + color = picking_filterHighlightColor(color); + + // use picking color if rendering to picking FBO. + color = picking_filterPickingColor(color); + `}}},FX=[oO],kX=["vs:DECKGL_FILTER_SIZE(inout vec3 size, VertexGeometry geometry)","vs:DECKGL_FILTER_GL_POSITION(inout vec4 position, VertexGeometry geometry)","vs:DECKGL_FILTER_COLOR(inout vec4 color, VertexGeometry geometry)","fs:DECKGL_FILTER_COLOR(inout vec4 color, FragmentGeometry geometry)"];function BX(){const t=bg.getDefaultShaderAssembler();for(const e of FX)t.addDefaultModule(e);for(const e of kX)t.addShaderHook(e);return t}const UX=[255,255,255],LX=1;let zX=0;class $X{constructor(e={}){this.type="ambient";const{color:n=UX}=e,{intensity:r=LX}=e;this.id=e.id||`ambient-${zX++}`,this.color=n,this.intensity=r}}const VX=[255,255,255],HX=1,jX=[0,0,-1];let WX=0;class QA{constructor(e={}){this.type="directional";const{color:n=VX}=e,{intensity:r=HX}=e,{direction:i=jX}=e,{_shadow:s=!1}=e;this.id=e.id||`directional-${WX++}`,this.color=n,this.intensity=r,this.type="directional",this.direction=new Ss(i).normalize().toArray(),this.shadow=s}getProjectedLight(e){return this}}class XX{constructor(e,n={id:"pass"}){const{id:r}=n;this.id=r,this.device=e,this.props={...n}}setProps(e){Object.assign(this.props,e)}render(e){}cleanup(){}}class Ib extends XX{constructor(){super(...arguments),this._lastRenderIndex=-1}render(e){const[n,r]=this.device.canvasContext.getDrawingBufferSize(),i=e.clearCanvas??!0,s=e.clearColor??(i?[0,0,0,0]:!1),l=i?1:!1,c=i?0:!1,f=e.colorMask??15,d={viewport:[0,0,n,r]};e.colorMask&&(d.colorMask=f),e.scissorRect&&(d.scissorRect=e.scissorRect);const g=this.device.beginRenderPass({framebuffer:e.target,parameters:d,clearColor:s,clearDepth:l,clearStencil:c});try{return this._drawLayers(g,e)}finally{g.end()}}_drawLayers(e,n){const{target:r,shaderModuleProps:i,viewports:s,views:l,onViewportActive:c,clearStack:f=!0}=n;n.pass=n.pass||"unknown",f&&(this._lastRenderIndex=-1);const d=[];for(const g of s){const m=l&&l[g.id];c==null||c(g);const v=this._getDrawLayerParams(g,n),S=g.subViewports||[g];for(const E of S){const w=this._drawLayersInViewport(e,{target:r,shaderModuleProps:i,viewport:E,view:m,pass:n.pass,layers:n.layers},v);d.push(w)}}return d}_getDrawLayerParams(e,{layers:n,pass:r,isPicking:i=!1,layerFilter:s,cullRect:l,effects:c,shaderModuleProps:f},d=!1){var E;const g=[],m=TO(this._lastRenderIndex+1),v={layer:n[0],viewport:e,isPicking:i,renderPass:r,cullRect:l},S={};for(let w=0;w{const l=i.props._offset,c=i.id,f=i.parent&&i.parent.id;let d;if(f&&!(f in e)&&r(i.parent,!1),f in n){const g=n[f]=n[f]||TO(e[f],e);d=g(i,s),n[c]=g}else Number.isFinite(l)?(d=l+(e[f]||0),n[c]=null):d=t;return s&&d>=t&&(t=d+1),e[c]=d,d};return r}function qX(t,{shaderModuleProps:e,target:n,viewport:r}){var f;const i=((f=e==null?void 0:e.project)==null?void 0:f.devicePixelRatio)??t.canvasContext.cssToDeviceRatio(),[,s]=t.canvasContext.getDrawingBufferSize(),l=n?n.height:s,c=r;return[c.x*i,l-(c.y+c.height)*i,c.width*i,c.height*i]}function GA(t,...e){for(const n of e)if(n)for(const r in n)t[r]?Object.assign(t[r],n[r]):t[r]=n[r];return t}class YX extends Ib{constructor(e,n){super(e,n);const r=e.createTexture({format:"rgba8unorm",width:1,height:1,sampler:{minFilter:"linear",magFilter:"linear",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"},mipmaps:!0}),i=e.createTexture({format:"depth16unorm",width:1,height:1,mipmaps:!1});this.fbo=e.createFramebuffer({id:"shadowmap",width:1,height:1,colorAttachments:[r],depthStencilAttachment:i})}delete(){this.fbo&&(this.fbo.destroy(),this.fbo=null)}getShadowMap(){return this.fbo.colorAttachments[0].texture}render(e){const n=this.fbo,r=this.device.canvasContext.cssToDeviceRatio(),i=e.viewports[0],s=i.width*r,l=i.height*r,c=[1,1,1,1];(s!==n.width||l!==n.height)&&n.resize({width:s,height:l}),super.render({...e,clearColor:c,target:n,pass:"shadow"})}getLayerParameters(e,n,r){return{...e.props.parameters,blend:!1,depthWriteEnabled:!0,depthCompare:"less-equal"}}shouldDrawLayer(e){return e.props.shadowEnabled!==!1}getShaderModuleProps(e,n,r){return{shadow:{project:r.project,drawToShadowMap:!0}}}}const KX={color:[255,255,255],intensity:1},JA=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],ZX=[0,0,0,200/255];class AO{constructor(e={}){this.id="lighting-effect",this.shadowColor=ZX,this.shadow=!1,this.directionalLights=[],this.pointLights=[],this.shadowPasses=[],this.dummyShadowMap=null,this.setProps(e)}setup(e){this.context=e;const{device:n,deck:r}=e;this.shadow&&!this.dummyShadowMap&&(this._createShadowPasses(n),r._addDefaultShaderModule(ZA),this.dummyShadowMap=n.createTexture({width:1,height:1}))}setProps(e){this.ambientLight=void 0,this.directionalLights=[],this.pointLights=[];for(const n in e){const r=e[n];switch(r.type){case"ambient":this.ambientLight=r;break;case"directional":this.directionalLights.push(r);break;case"point":this.pointLights.push(r);break}}this._applyDefaultLights(),this.shadow=this.directionalLights.some(n=>n.shadow),this.context&&this.setup(this.context),this.props=e}preRender({layers:e,layerFilter:n,viewports:r,onViewportActive:i,views:s}){if(this.shadow){this.shadowMatrices=this._calculateMatrices();for(let l=0;ll.getShadowMap()),dummyShadowMap:this.dummyShadowMap,shadowColor:this.shadowColor,shadowMatrices:this.shadowMatrices}:{},i={enabled:!0,ambientLight:this.ambientLight,directionalLights:this.directionalLights.map(l=>l.getProjectedLight({layer:e})),pointLights:this.pointLights.map(l=>l.getProjectedLight({layer:e}))},s=e.props.material;return{shadow:r,lighting:i,phongMaterial:s,gouraudMaterial:s}}cleanup(e){for(const n of this.shadowPasses)n.delete();this.shadowPasses.length=0,this.dummyShadowMap&&(this.dummyShadowMap.destroy(),this.dummyShadowMap=null,e.deck._removeDefaultShaderModule(ZA))}_calculateMatrices(){const e=[];for(const n of this.directionalLights){const r=new ws().lookAt({eye:new Ss(n.direction).negate()});e.push(r)}return e}_createShadowPasses(e){for(let n=0;ni&&(s=i);const l=this._pool,c=e.BYTES_PER_ELEMENT*s,f=l.findIndex(d=>d.byteLength>=c);if(f>=0){const d=new e(l.splice(f,1)[0],0,s);return r&&d.fill(0),d}return new e(s)}_release(e){if(!ArrayBuffer.isView(e))return;const n=this._pool,{buffer:r}=e,{byteLength:i}=r,s=n.findIndex(l=>l.byteLength>=i);s<0?n.push(r):(s>0||n.lengththis.opts.poolSize&&n.shift()}}const Bf=new QX;function Gu(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function GX(t){return[t[12],t[13],t[14]]}function JX(t){return{left:jl(t[3]+t[0],t[7]+t[4],t[11]+t[8],t[15]+t[12]),right:jl(t[3]-t[0],t[7]-t[4],t[11]-t[8],t[15]-t[12]),bottom:jl(t[3]+t[1],t[7]+t[5],t[11]+t[9],t[15]+t[13]),top:jl(t[3]-t[1],t[7]-t[5],t[11]-t[9],t[15]-t[13]),near:jl(t[3]+t[2],t[7]+t[6],t[11]+t[10],t[15]+t[14]),far:jl(t[3]-t[2],t[7]-t[6],t[11]-t[10],t[15]-t[14])}}const eC=new Ss;function jl(t,e,n,r){eC.set(t,e,n);const i=eC.len();return{distance:r/i,normal:new Ss(-t/i,-e/i,-n/i)}}function eq(t){return t-Math.fround(t)}let Xu;function b0(t,e){const{size:n=1,startIndex:r=0}=e,i=e.endIndex!==void 0?e.endIndex:t.length,s=(i-r)/n;Xu=Bf.allocate(Xu,s,{type:Float32Array,size:n*2});let l=r,c=0;for(;l=n.delay+n.duration*n.repeat}getTime(e){if(e===void 0)return this.time;const n=this.channels.get(e);return n===void 0?-1:n.time}setTime(e){this.time=Math.max(0,e);const n=this.channels.values();for(const i of n)this._setChannelTime(i,this.time);const r=this.animations.values();for(const i of r){const{animation:s,channel:l}=i;s.setTime(this.getTime(l))}}play(){this.playing=!0}pause(){this.playing=!1,this.lastEngineTime=-1}reset(){this.setTime(0)}attachAnimation(e,n){const r=cq++;return this.animations.set(r,{animation:e,channel:n}),e.setTime(this.getTime(n)),r}detachAnimation(e){this.animations.delete(e)}update(e){this.playing&&(this.lastEngineTime===-1&&(this.lastEngineTime=e),this.setTime(this.time+(e-this.lastEngineTime)),this.lastEngineTime=e)}_setChannelTime(e,n){const r=n-e.delay,i=e.duration*e.repeat;r>=i?e.time=e.duration*e.rate:(e.time=Math.max(0,r)%e.duration,e.time*=e.rate)}}function uq(t){return typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame(t):setTimeout(t,1e3/60)}function fq(t){return typeof window<"u"&&window.cancelAnimationFrame?window.cancelAnimationFrame(t):clearTimeout(t)}let dq=0;const hq={device:null,onAddHTML:()=>"",onInitialize:async()=>null,onRender:()=>{},onFinalize:()=>{},onError:t=>console.error(t),stats:J_.stats.get(`animation-loop-${dq++}`),useDevicePixels:!0,autoResizeViewport:!1,autoResizeDrawingBuffer:!1};class gq{constructor(e){O(this,"device",null);O(this,"canvas",null);O(this,"props");O(this,"animationProps",null);O(this,"timeline",null);O(this,"stats");O(this,"cpuTime");O(this,"gpuTime");O(this,"frameRate");O(this,"display");O(this,"needsRedraw","initialized");O(this,"_initialized",!1);O(this,"_running",!1);O(this,"_animationFrameId",null);O(this,"_nextFramePromise",null);O(this,"_resolveNextFrame",null);O(this,"_cpuStartTime",0);O(this,"_error",null);if(this.props={...hq,...e},e=this.props,!e.device)throw new Error("No device provided");const{useDevicePixels:n=!0}=this.props;this.stats=e.stats||new ip({id:"animation-loop-stats"}),this.cpuTime=this.stats.get("CPU Time"),this.gpuTime=this.stats.get("GPU Time"),this.frameRate=this.stats.get("Frame Rate"),this.setProps({autoResizeViewport:e.autoResizeViewport,autoResizeDrawingBuffer:e.autoResizeDrawingBuffer,useDevicePixels:n}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}destroy(){this.stop(),this._setDisplay(null)}delete(){this.destroy()}setError(e){var r,i;if(this.props.onError(e),this._error=Error(),((i=(r=this.device)==null?void 0:r.canvasContext)==null?void 0:i.canvas)instanceof HTMLCanvasElement){const s=document.createElement("h1");s.innerHTML=e.message,s.style.position="absolute",s.style.top="20%",s.style.left="10px",s.style.color="black",s.style.backgroundColor="red",document.body.appendChild(s)}}setNeedsRedraw(e){return this.needsRedraw=this.needsRedraw||e,this}setProps(e){return"autoResizeViewport"in e&&(this.props.autoResizeViewport=e.autoResizeViewport||!1),"autoResizeDrawingBuffer"in e&&(this.props.autoResizeDrawingBuffer=e.autoResizeDrawingBuffer||!1),"useDevicePixels"in e&&(this.props.useDevicePixels=e.useDevicePixels||!1),this}async start(){if(this._running)return this;this._running=!0;try{let e;return this._initialized||(this._initialized=!0,await this._initDevice(),this._initialize(),await this.props.onInitialize(this._getAnimationProps())),this._running?(e!==!1&&(this._cancelAnimationFrame(),this._requestAnimationFrame()),this):null}catch(e){const n=e instanceof Error?e:new Error("Unknown error");throw this.props.onError(n),n}}stop(){return this._running&&(this.animationProps&&!this._error&&this.props.onFinalize(this.animationProps),this._cancelAnimationFrame(),this._nextFramePromise=null,this._resolveNextFrame=null,this._running=!1),this}redraw(){var e;return(e=this.device)!=null&&e.isLost||this._error?this:(this._beginFrameTimers(),this._setupFrame(),this._updateAnimationProps(),this._renderFrame(this._getAnimationProps()),this._clearNeedsRedraw(),this._resolveNextFrame&&(this._resolveNextFrame(this),this._nextFramePromise=null,this._resolveNextFrame=null),this._endFrameTimers(),this)}attachTimeline(e){return this.timeline=e,this.timeline}detachTimeline(){this.timeline=null}waitForRender(){return this.setNeedsRedraw("waitForRender"),this._nextFramePromise||(this._nextFramePromise=new Promise(e=>{this._resolveNextFrame=e})),this._nextFramePromise}async toDataURL(){if(this.setNeedsRedraw("toDataURL"),await this.waitForRender(),this.canvas instanceof HTMLCanvasElement)return this.canvas.toDataURL();throw new Error("OffscreenCanvas")}_initialize(){this._startEventHandling(),this._initializeAnimationProps(),this._updateAnimationProps(),this._resizeCanvasDrawingBuffer(),this._resizeViewport()}_setDisplay(e){this.display&&(this.display.destroy(),this.display.animationLoop=null),e&&(e.animationLoop=this),this.display=e}_requestAnimationFrame(){this._running&&(this._animationFrameId=uq(this._animationFrame.bind(this)))}_cancelAnimationFrame(){this._animationFrameId!==null&&(fq(this._animationFrameId),this._animationFrameId=null)}_animationFrame(){this._running&&(this.redraw(),this._requestAnimationFrame())}_renderFrame(e){var n;if(this.display){this.display._renderFrame(e);return}this.props.onRender(this._getAnimationProps()),(n=this.device)==null||n.submit()}_clearNeedsRedraw(){this.needsRedraw=!1}_setupFrame(){this._resizeCanvasDrawingBuffer(),this._resizeViewport()}_initializeAnimationProps(){var n,r;const e=(r=(n=this.device)==null?void 0:n.canvasContext)==null?void 0:r.canvas;if(!this.device||!e)throw new Error("loop");this.animationProps={animationLoop:this,device:this.device,canvas:e,timeline:this.timeline,useDevicePixels:this.props.useDevicePixels,needsRedraw:!1,width:1,height:1,aspect:1,time:0,startTime:Date.now(),engineTime:0,tick:0,tock:0,_mousePosition:null}}_getAnimationProps(){if(!this.animationProps)throw new Error("animationProps");return this.animationProps}_updateAnimationProps(){if(!this.animationProps)return;const{width:e,height:n,aspect:r}=this._getSizeAndAspect();(e!==this.animationProps.width||n!==this.animationProps.height)&&this.setNeedsRedraw("drawing buffer resized"),r!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=e,this.animationProps.height=n,this.animationProps.aspect=r,this.animationProps.needsRedraw=this.needsRedraw,this.animationProps.engineTime=Date.now()-this.animationProps.startTime,this.timeline&&this.timeline.update(this.animationProps.engineTime),this.animationProps.tick=Math.floor(this.animationProps.time/1e3*60),this.animationProps.tock++,this.animationProps.time=this.timeline?this.timeline.getTime():this.animationProps.engineTime}async _initDevice(){var e;if(this.device=await this.props.device,!this.device)throw new Error("No device provided");this.canvas=((e=this.device.canvasContext)==null?void 0:e.canvas)||null}_createInfoDiv(){if(this.canvas&&this.props.onAddHTML){const e=document.createElement("div");document.body.appendChild(e),e.style.position="relative";const n=document.createElement("div");n.style.position="absolute",n.style.left="10px",n.style.bottom="10px",n.style.width="300px",n.style.background="white",this.canvas instanceof HTMLCanvasElement&&e.appendChild(this.canvas),e.appendChild(n);const r=this.props.onAddHTML(n);r&&(n.innerHTML=r)}}_getSizeAndAspect(){var s,l,c,f;if(!this.device)return{width:1,height:1,aspect:1};const[e,n]=((l=(s=this.device)==null?void 0:s.canvasContext)==null?void 0:l.getPixelSize())||[1,1];let r=1;const i=(f=(c=this.device)==null?void 0:c.canvasContext)==null?void 0:f.canvas;return i&&i.clientHeight?r=i.clientWidth/i.clientHeight:e>0&&n>0&&(r=e/n),{width:e,height:n,aspect:r}}_resizeViewport(){this.props.autoResizeViewport&&this.device.gl&&this.device.gl.viewport(0,0,this.device.gl.drawingBufferWidth,this.device.gl.drawingBufferHeight)}_resizeCanvasDrawingBuffer(){var e,n;this.props.autoResizeDrawingBuffer&&((n=(e=this.device)==null?void 0:e.canvasContext)==null||n.resize({useDevicePixels:this.props.useDevicePixels}))}_beginFrameTimers(){this.frameRate.timeEnd(),this.frameRate.timeStart(),this.cpuTime.timeStart()}_endFrameTimers(){this.cpuTime.timeEnd()}_startEventHandling(){this.canvas&&(this.canvas.addEventListener("mousemove",this._onMousemove.bind(this)),this.canvas.addEventListener("mouseleave",this._onMouseleave.bind(this)))}_onMousemove(e){e instanceof MouseEvent&&(this._getAnimationProps()._mousePosition=[e.offsetX,e.offsetY])}_onMouseleave(e){this._getAnimationProps()._mousePosition=null}}const w0={};function id(t="id"){w0[t]=w0[t]||1;const e=w0[t]++;return`${t}-${e}`}class rC{constructor(e){O(this,"id");O(this,"userData",{});O(this,"topology");O(this,"bufferLayout",[]);O(this,"vertexCount");O(this,"indices");O(this,"attributes");if(this.id=e.id||id("geometry"),this.topology=e.topology,this.indices=e.indices||null,this.attributes=e.attributes,this.vertexCount=e.vertexCount,this.bufferLayout=e.bufferLayout||[],this.indices&&!(this.indices.usage&$n.INDEX))throw new Error("Index buffer must have INDEX usage")}destroy(){var e;(e=this.indices)==null||e.destroy();for(const n of Object.values(this.attributes))n.destroy()}getVertexCount(){return this.vertexCount}getAttributes(){return this.attributes}getIndexes(){return this.indices||null}_calculateVertexCount(e){return e.byteLength/12}}function pq(t,e){if(e instanceof rC)return e;const n=mq(t,e),{attributes:r,bufferLayout:i}=vq(t,e);return new rC({topology:e.topology||"triangle-list",bufferLayout:i,vertexCount:e.vertexCount,indices:n,attributes:r})}function mq(t,e){if(!e.indices)return;const n=e.indices.value;return t.createBuffer({usage:$n.INDEX,data:n})}function vq(t,e){const n=[],r={};for(const[s,l]of Object.entries(e.attributes)){let c=s;switch(s){case"POSITION":c="positions";break;case"NORMAL":c="normals";break;case"TEXCOORD_0":c="texCoords";break;case"COLOR_0":c="colors";break}if(l){r[c]=t.createBuffer({data:l.value,id:`${s}-buffer`});const{value:f,size:d,normalized:g}=l;n.push({name:c,format:oH(f,d,g)})}}const i=e._calculateVertexCount(e.attributes,e.indices);return{attributes:r,bufferLayout:n,vertexCount:i}}const ep=class ep{constructor(e){O(this,"device");O(this,"destroyPolicy");O(this,"_hashCounter",0);O(this,"_hashes",{});O(this,"_renderPipelineCache",{});O(this,"_computePipelineCache",{});this.device=e,this.destroyPolicy=e.props._factoryDestroyPolicy}static getDefaultPipelineFactory(e){return e._lumaData.defaultPipelineFactory=e._lumaData.defaultPipelineFactory||new ep(e),e._lumaData.defaultPipelineFactory}createRenderPipeline(e){const n={...Pc.defaultProps,...e},r=this._hashRenderPipeline(n);if(!this._renderPipelineCache[r]){const i=this.device.createRenderPipeline({...n,id:n.id?`${n.id}-cached`:void 0});i.hash=r,this._renderPipelineCache[r]={pipeline:i,useCount:0}}return this._renderPipelineCache[r].useCount++,this._renderPipelineCache[r].pipeline}createComputePipeline(e){const n={...Ag.defaultProps,...e},r=this._hashComputePipeline(n);if(!this._computePipelineCache[r]){const i=this.device.createComputePipeline({...n,id:n.id?`${n.id}-cached`:void 0});i.hash=r,this._computePipelineCache[r]={pipeline:i,useCount:0}}return this._computePipelineCache[r].useCount++,this._computePipelineCache[r].pipeline}release(e){const n=e.hash,r=e instanceof Ag?this._computePipelineCache:this._renderPipelineCache;r[n].useCount--,r[n].useCount===0&&this.destroyPolicy==="unused"&&(r[n].pipeline.destroy(),delete r[n])}_hashComputePipeline(e){return`${this._getHash(e.shader.source)}`}_hashRenderPipeline(e){const n=e.vs?this._getHash(e.vs.source):0,r=e.fs?this._getHash(e.fs.source):0,i="-",s=this._getHash(JSON.stringify(e.bufferLayout));switch(this.device.type){case"webgl":return`${n}/${r}V${i}BL${s}`;default:const l=this._getHash(JSON.stringify(e.parameters));return`${n}/${r}V${i}T${e.topology}P${l}BL${s}`}}_getHash(e){return this._hashes[e]===void 0&&(this._hashes[e]=this._hashCounter++),this._hashes[e]}};O(ep,"defaultProps",{...Pc.defaultProps});let by=ep;const tp=class tp{constructor(e){O(this,"device");O(this,"destroyPolicy");O(this,"_cache",{});this.device=e,this.destroyPolicy=e.props._factoryDestroyPolicy}static getDefaultShaderFactory(e){var n;return(n=e._lumaData).defaultShaderFactory||(n.defaultShaderFactory=new tp(e)),e._lumaData.defaultShaderFactory}createShader(e){const n=this._hashShader(e);let r=this._cache[n];if(!r){const i=this.device.createShader({...e,id:e.id?`${e.id}-cached`:void 0});this._cache[n]=r={shader:i,useCount:0}}return r.useCount++,r.shader}release(e){const n=this._hashShader(e),r=this._cache[n];r&&(r.useCount--,r.useCount===0&&this.destroyPolicy==="unused"&&(delete this._cache[n],r.shader.destroy()))}_hashShader(e){return`${e.stage}:${e.source}`}};O(tp,"defaultProps",{...wg.defaultProps});let Sy=tp;function _q(t,e){var i;const n={},r="Values";if(t.attributes.length===0&&!((i=t.varyings)!=null&&i.length))return{"No attributes or varyings":{[r]:"N/A"}};for(const s of t.attributes)if(s){const l=`${s.location} ${s.name}: ${s.type}`;n[`in ${l}`]={[r]:s.stepMode||"vertex"}}for(const s of t.varyings||[]){const l=`${s.location} ${s.name}`;n[`out ${l}`]={[r]:JSON.stringify(s)}}return n}let br=null,ho=null;function yq(t,{id:e,minimap:n,opaque:r,top:i="0",left:s="0",rgbaScale:l=1}){br||(br=document.createElement("canvas"),br.id=e,br.title=e,br.style.zIndex="100",br.style.position="absolute",br.style.top=i,br.style.left=s,br.style.border="blue 5px solid",br.style.transform="scaleY(-1)",document.body.appendChild(br),ho=br.getContext("2d")),(br.width!==t.width||br.height!==t.height)&&(br.width=t.width/2,br.height=t.height/2,br.style.width="400px",br.style.height="400px");const c=t.device.readPixelsToArrayWebGL(t),f=ho==null?void 0:ho.createImageData(t.width,t.height);if(f){for(let g=0;g{const r=t[n];wq(r)?e.uniforms[n]=r:e.bindings[n]=r}),e}class Eq{constructor(e,n){O(this,"options",{disableWarnings:!1});O(this,"modules");O(this,"moduleUniforms");O(this,"moduleBindings");Object.assign(this.options,n);const r=Rb(Object.values(e).filter(i=>i.dependencies));for(const i of r)e[i.name]=i;Re.log(1,"Creating ShaderInputs with modules",Object.keys(e))(),this.modules=e,this.moduleUniforms={},this.moduleBindings={};for(const[i,s]of Object.entries(e))this._addModule(s),s.name&&i!==s.name&&!this.options.disableWarnings&&Re.warn(`Module name: ${i} vs ${s.name}`)()}destroy(){}setProps(e){var n;for(const r of Object.keys(e)){const i=r,s=e[i]||{},l=this.modules[i];if(!l){this.options.disableWarnings||Re.warn(`Module ${r} not found`)();continue}const c=this.moduleUniforms[i],f=this.moduleBindings[i],d=((n=l.getUniforms)==null?void 0:n.call(l,s,c))||s,{uniforms:g,bindings:m}=MO(d);this.moduleUniforms[i]={...c,...g},this.moduleBindings[i]={...f,...m}}}getModules(){return Object.values(this.modules)}getUniformValues(){return this.moduleUniforms}getBindingValues(){const e={};for(const n of Object.values(this.moduleBindings))Object.assign(e,n);return e}getDebugTable(){var n;const e={};for(const[r,i]of Object.entries(this.moduleUniforms))for(const[s,l]of Object.entries(i))e[`${r}.${s}`]={type:(n=this.modules[r].uniformTypes)==null?void 0:n[s],value:String(l)};return e}_addModule(e){const n=e.name;this.moduleUniforms[n]=e.defaultUniforms||{},this.moduleBindings[n]={}}}let Tq="";async function Aq(t,e){const n=new Image;return n.crossOrigin="anonymous",n.src=t.startsWith("http")?t:Tq+t,await n.decode(),e?await createImageBitmap(n,e):await createImageBitmap(n)}class E0{constructor(e,n){O(this,"device");O(this,"id");O(this,"texture");O(this,"sampler");O(this,"view");O(this,"ready");O(this,"isReady",!1);O(this,"destroyed",!1);O(this,"resolveReady",()=>{});O(this,"rejectReady",()=>{});this.device=e,this.id=n.id||id("async-texture"),typeof(n==null?void 0:n.data)=="string"&&n.dimension==="2d"&&(n={...n,data:Aq(n.data)}),this.ready=new Promise((r,i)=>{this.resolveReady=()=>{this.isReady=!0,r()},this.rejectReady=i}),this.initAsync(n)}get[Symbol.toStringTag](){return"AsyncTexture"}toString(){return`AsyncTexture:"${this.id}"(${this.isReady?"ready":"loading"})`}async initAsync(e){let n,r;const i=e.data,s=await OO(i).then(n,r);if(this.destroyed)return;const l={...e,data:s};this.texture=this.device.createTexture(l),this.sampler=this.texture.sampler,this.view=this.texture.view,this.isReady=!0}destroy(){this.texture&&(this.texture.destroy(),this.texture=null),this.destroyed=!0}resize(e){if(!this.isReady)throw new Error("Cannot resize texture before it is ready");if(e.width===this.texture.width&&e.height===this.texture.height)return!1;if(this.texture){const n=this.texture;this.texture=n.clone(e),n.destroy()}return!0}}async function OO(t){if(t=await t,Array.isArray(t))return await Promise.all(t.map(OO));if(t&&typeof t=="object"&&t.constructor===Object){const e=t,n=await Promise.all(Object.values(e)),r=Object.keys(e),i={};for(let s=0;s[v.name,v]))||[]),i=n.shaderInputs||new Eq(r,{disableWarnings:this.props.disableWarnings});this.setShaderInputs(i);const s=xq(e),l=(((d=this.props.modules)==null?void 0:d.length)>0?this.props.modules:(g=this.shaderInputs)==null?void 0:g.getModules())||[];if(this.device.type==="webgpu"&&this.props.source){(m=this.props).shaderLayout||(m.shaderLayout=WH(this.props.source));const{source:v,getUniforms:S}=this.props.shaderAssembler.assembleWGSLShader({platformInfo:s,...this.props,modules:l});this.source=v,this._getModuleUniforms=S}else{const{vs:v,fs:S,getUniforms:E}=this.props.shaderAssembler.assembleGLSLShaderPair({platformInfo:s,...this.props,modules:l});this.vs=v,this.fs=S,this._getModuleUniforms=E}this.vertexCount=this.props.vertexCount,this.instanceCount=this.props.instanceCount,this.topology=this.props.topology,this.bufferLayout=this.props.bufferLayout,this.parameters=this.props.parameters,n.geometry&&this.setGeometry(n.geometry),this.pipelineFactory=n.pipelineFactory||by.getDefaultPipelineFactory(this.device),this.shaderFactory=n.shaderFactory||Sy.getDefaultShaderFactory(this.device),this.pipeline=this._updatePipeline(),this.vertexArray=e.createVertexArray({renderPipeline:this.pipeline}),this._gpuGeometry&&this._setGeometryAttributes(this._gpuGeometry),"isInstanced"in n&&(this.isInstanced=n.isInstanced),n.instanceCount&&this.setInstanceCount(n.instanceCount),n.vertexCount&&this.setVertexCount(n.vertexCount),n.indexBuffer&&this.setIndexBuffer(n.indexBuffer),n.attributes&&this.setAttributes(n.attributes),n.constantAttributes&&this.setConstantAttributes(n.constantAttributes),n.bindings&&this.setBindings(n.bindings),n.uniforms&&this.setUniformsWebGL(n.uniforms),n.moduleSettings&&this.updateModuleSettingsWebGL(n.moduleSettings),n.transformFeedback&&(this.transformFeedback=n.transformFeedback),Object.seal(this)}get[Symbol.toStringTag](){return"Model"}toString(){return`Model(${this.id})`}destroy(){var e;this._destroyed||(this.pipelineFactory.release(this.pipeline),this.shaderFactory.release(this.pipeline.vs),this.pipeline.fs&&this.shaderFactory.release(this.pipeline.fs),this._uniformStore.destroy(),(e=this._gpuGeometry)==null||e.destroy(),this._destroyed=!0)}needsRedraw(){this._getBindingsUpdateTimestamp()>this._lastDrawTimestamp&&this.setNeedsRedraw("contents of bound textures or buffers updated");const e=this._needsRedraw;return this._needsRedraw=!1,e}setNeedsRedraw(e){this._needsRedraw||(this._needsRedraw=e)}predraw(){this.updateShaderInputs(),this.pipeline=this._updatePipeline()}draw(e){const n=this._areBindingsLoading();if(n)return Re.info(go,`>>> DRAWING ABORTED ${this.id}: ${n} not loaded`)(),!1;try{e.pushDebugGroup(`${this}.predraw(${e})`),this.predraw()}finally{e.popDebugGroup()}let r;try{e.pushDebugGroup(`${this}.draw(${e})`),this._logDrawCallStart(),this.pipeline=this._updatePipeline();const i=this._getBindings();this.pipeline.setBindings(i,{disableWarnings:this.props.disableWarnings}),Ey(this.uniforms)||this.pipeline.setUniformsWebGL(this.uniforms);const{indexBuffer:s}=this.vertexArray,l=s?s.byteLength/(s.indexType==="uint32"?4:2):void 0;r=this.pipeline.draw({renderPass:e,vertexArray:this.vertexArray,isInstanced:this.isInstanced,vertexCount:this.vertexCount,instanceCount:this.instanceCount,indexCount:l,transformFeedback:this.transformFeedback||void 0,parameters:this.parameters,topology:this.topology})}finally{e.popDebugGroup(),this._logDrawCallEnd()}return this._logFramebuffer(e),r?(this._lastDrawTimestamp=this.device.timestamp,this._needsRedraw=!1):this._needsRedraw="waiting for resource initialization",r}setGeometry(e){var r;(r=this._gpuGeometry)==null||r.destroy();const n=e&&pq(this.device,e);if(n){this.setTopology(n.topology||"triangle-list");const i=new u0(this.bufferLayout);this.bufferLayout=i.mergeBufferLayouts(n.bufferLayout,this.bufferLayout),this.vertexArray&&this._setGeometryAttributes(n)}this._gpuGeometry=n}setTopology(e){e!==this.topology&&(this.topology=e,this._setPipelineNeedsUpdate("topology"))}setBufferLayout(e){const n=new u0(this.bufferLayout);this.bufferLayout=this._gpuGeometry?n.mergeBufferLayouts(e,this._gpuGeometry.bufferLayout):e,this._setPipelineNeedsUpdate("bufferLayout"),this.pipeline=this._updatePipeline(),this.vertexArray=this.device.createVertexArray({renderPipeline:this.pipeline}),this._gpuGeometry&&this._setGeometryAttributes(this._gpuGeometry)}setParameters(e){wy(e,this.parameters,2)||(this.parameters=e,this._setPipelineNeedsUpdate("parameters"))}setInstanceCount(e){this.instanceCount=e,this.isInstanced===void 0&&e>0&&(this.isInstanced=!0),this.setNeedsRedraw("instanceCount")}setVertexCount(e){this.vertexCount=e,this.setNeedsRedraw("vertexCount")}setShaderInputs(e){this.shaderInputs=e,this._uniformStore=new aH(this.shaderInputs.modules);for(const[n,r]of Object.entries(this.shaderInputs.modules))if(Rq(r)){const i=this._uniformStore.getManagedUniformBuffer(this.device,n);this.bindings[`${n}Uniforms`]=i}this.setNeedsRedraw("shaderInputs")}updateShaderInputs(){this._uniformStore.setUniforms(this.shaderInputs.getUniformValues()),this.setBindings(this.shaderInputs.getBindingValues()),this.setNeedsRedraw("shaderInputs")}setBindings(e){Object.assign(this.bindings,e),this.setNeedsRedraw("bindings")}setTransformFeedback(e){this.transformFeedback=e,this.setNeedsRedraw("transformFeedback")}setIndexBuffer(e){this.vertexArray.setIndexBuffer(e),this.setNeedsRedraw("indexBuffer")}setAttributes(e,n){const r=(n==null?void 0:n.disableWarnings)??this.props.disableWarnings;e.indices&&Re.warn(`Model:${this.id} setAttributes() - indexBuffer should be set using setIndexBuffer()`)();const i=new u0(this.bufferLayout);for(const[s,l]of Object.entries(e)){const c=i.getBufferLayout(s);if(!c){r||Re.warn(`Model(${this.id}): Missing layout for buffer "${s}".`)();continue}const f=i.getAttributeNamesForBuffer(c);let d=!1;for(const g of f){const m=this._attributeInfos[g];m&&(this.vertexArray.setBuffer(m.location,l),d=!0)}!d&&!r&&Re.warn(`Model(${this.id}): Ignoring buffer "${l.id}" for unknown attribute "${s}"`)()}this.setNeedsRedraw("attributes")}setConstantAttributes(e,n){for(const[r,i]of Object.entries(e)){const s=this._attributeInfos[r];s?this.vertexArray.setConstantWebGL(s.location,i):((n==null?void 0:n.disableWarnings)??this.props.disableWarnings)||Re.warn(`Model "${this.id}: Ignoring constant supplied for unknown attribute "${r}"`)()}this.setNeedsRedraw("constants")}setUniforms(e){this.setUniformsWebGL(e)}setUniformsWebGL(e){Ey(e)||(this.pipeline.setUniformsWebGL(e),Object.assign(this.uniforms,e)),this.setNeedsRedraw("uniforms")}updateModuleSettingsWebGL(e){const{bindings:n,uniforms:r}=MO(this._getModuleUniforms(e));Object.assign(this.bindings,n),Object.assign(this.uniforms,r),this.setNeedsRedraw("moduleSettings")}_areBindingsLoading(){for(const e of Object.values(this.bindings))if(e instanceof E0&&!e.isReady)return e.id;return!1}_getBindings(){const e={};for(const[n,r]of Object.entries(this.bindings))r instanceof E0?r.isReady&&(e[n]=r.texture):e[n]=r;return e}_getBindingsUpdateTimestamp(){let e=0;for(const n of Object.values(this.bindings))n instanceof Sg?e=Math.max(e,n.texture.updateTimestamp):n instanceof $n||n instanceof Kn?e=Math.max(e,n.updateTimestamp):n instanceof E0?e=n.texture?Math.max(e,n.texture.updateTimestamp):1/0:n instanceof Eg||(e=Math.max(e,n.buffer.updateTimestamp));return e}_setGeometryAttributes(e){const n={...e.attributes};for(const[r]of Object.entries(n))!this.pipeline.shaderLayout.attributes.find(i=>i.name===r)&&r!=="positions"&&delete n[r];this.vertexCount=e.vertexCount,this.setIndexBuffer(e.indices||null),this.setAttributes(e.attributes,{disableWarnings:!0}),this.setAttributes(n,{disableWarnings:this.props.disableWarnings}),this.setNeedsRedraw("geometry attributes")}_setPipelineNeedsUpdate(e){this._pipelineNeedsUpdate||(this._pipelineNeedsUpdate=e),this.setNeedsRedraw(e)}_updatePipeline(){if(this._pipelineNeedsUpdate){let e=null,n=null;this.pipeline&&(Re.log(1,`Model ${this.id}: Recreating pipeline because "${this._pipelineNeedsUpdate}".`)(),e=this.pipeline.vs,n=this.pipeline.fs),this._pipelineNeedsUpdate=!1;const r=this.shaderFactory.createShader({id:`${this.id}-vertex`,stage:"vertex",source:this.source||this.vs,debugShaders:this.props.debugShaders});let i=null;this.source?i=r:this.fs&&(i=this.shaderFactory.createShader({id:`${this.id}-fragment`,stage:"fragment",source:this.source||this.fs,debugShaders:this.props.debugShaders})),this.pipeline=this.pipelineFactory.createRenderPipeline({...this.props,bufferLayout:this.bufferLayout,topology:this.topology,parameters:this.parameters,bindings:this._getBindings(),vs:r,fs:i}),this._attributeInfos=kM(this.pipeline.shaderLayout,this.bufferLayout),e&&this.shaderFactory.release(e),n&&this.shaderFactory.release(n)}return this.pipeline}_logDrawCallStart(){const e=Re.level>3?0:Cq;Re.level<2||Date.now()-this._lastLogTime>> DRAWING MODEL ${this.id}`,{collapsed:Re.level<=2})())}_logDrawCallEnd(){if(this._logOpen){const e=_q(this.pipeline.shaderLayout,this.id);Re.table(go,e)();const n=this.shaderInputs.getDebugTable();for(const[i,s]of Object.entries(this.uniforms))n[i]={value:s};Re.table(go,n)();const r=this._getAttributeDebugTable();Re.table(go,this._attributeInfos)(),Re.table(go,r)(),Re.groupEnd(go)(),this._logOpen=!1}}_logFramebuffer(e){const n=this.device.props.debugFramebuffers;if(this._drawCount++,!n)return;const r=e.props.framebuffer;r&&yq(r,{id:r.id,minimap:!0})}_getAttributeDebugTable(){const e={};for(const[n,r]of Object.entries(this._attributeInfos)){const i=this.vertexArray.attributes[r.location];e[r.location]={name:n,type:r.shaderType,values:i?this._getBufferOrConstantValues(i,r.bufferDataType):"null"}}if(this.vertexArray.indexBuffer){const{indexBuffer:n}=this.vertexArray,r=n.indexType==="uint32"?new Uint32Array(n.debugData):new Uint16Array(n.debugData);e.indices={name:"indices",type:n.indexType,values:r.toString()}}return e}_getBufferOrConstantValues(e,n){const r=LM(n);return(e instanceof $n?new r(e.debugData):e).toString()}};O(np,"defaultProps",{...Pc.defaultProps,source:void 0,vs:null,fs:null,id:"unnamed",handle:void 0,userData:{},defines:{},modules:[],moduleSettings:void 0,geometry:null,indexBuffer:null,attributes:{},constantAttributes:{},varyings:[],isInstanced:void 0,instanceCount:0,vertexCount:0,shaderInputs:void 0,pipelineFactory:void 0,shaderFactory:void 0,transformFeedback:void 0,shaderAssembler:bg.getDefaultShaderAssembler(),debugShaders:void 0,disableWarnings:void 0});let Wo=np;function Rq(t){return!!(t.uniformTypes&&!Ey(t.uniformTypes))}function xq(t){return{type:t.type,shaderLanguage:t.info.shadingLanguage,shaderLanguageVersion:t.info.shadingLanguageVersion,gpu:t.info.gpu,features:t.features}}function Ey(t){for(const e in t)return!1;return!0}const mf=class mf{constructor(e,n=mf.defaultProps){O(this,"device");O(this,"model");O(this,"transformFeedback");if(!mf.isSupported(e))throw new Error("BufferTransform not yet implemented on WebGPU");this.device=e,this.model=new Wo(this.device,{id:n.id||"buffer-transform-model",fs:n.fs||cV(),topology:n.topology||"point-list",varyings:n.outputs||n.varyings,...n}),this.transformFeedback=this.device.createTransformFeedback({layout:this.model.pipeline.shaderLayout,buffers:n.feedbackBuffers}),this.model.setTransformFeedback(this.transformFeedback),Object.seal(this)}static isSupported(e){var n;return((n=e==null?void 0:e.info)==null?void 0:n.type)==="webgl"}destroy(){this.model&&this.model.destroy()}delete(){this.destroy()}run(e){e!=null&&e.inputBuffers&&this.model.setAttributes(e.inputBuffers),e!=null&&e.outputBuffers&&this.transformFeedback.setBuffers(e.outputBuffers);const n=this.device.beginRenderPass(e);this.model.draw(n),n.end()}getBuffer(e){return this.transformFeedback.getBuffer(e)}readAsync(e){const n=this.getBuffer(e);if(!n)throw new Error("BufferTransform#getBuffer");if(n instanceof $n)return n.readAsync();const{buffer:r,byteOffset:i=0,byteLength:s=r.byteLength}=n;return r.readAsync(i,s)}};O(mf,"defaultProps",{...Wo.defaultProps,outputs:void 0,feedbackBuffers:void 0});let Uf=mf;class Db{constructor(e){O(this,"id");O(this,"topology");O(this,"vertexCount");O(this,"indices");O(this,"attributes");O(this,"userData",{});const{attributes:n={},indices:r=null,vertexCount:i=null}=e;this.id=e.id||id("geometry"),this.topology=e.topology,r&&(this.indices=ArrayBuffer.isView(r)?{value:r,size:1}:r),this.attributes={};for(const[s,l]of Object.entries(n)){const c=ArrayBuffer.isView(l)?{value:l}:l;if(!ArrayBuffer.isView(c.value))throw new Error(`${this._print(s)}: must be typed array or object with value as typed array`);if((s==="POSITION"||s==="positions")&&!c.size&&(c.size=3),s==="indices"){if(this.indices)throw new Error("Multiple indices detected");this.indices=c}else this.attributes[s]=c}this.indices&&this.indices.isIndexed!==void 0&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this.vertexCount=i||this._calculateVertexCount(this.attributes,this.indices)}getVertexCount(){return this.vertexCount}getAttributes(){return this.indices?{indices:this.indices,...this.attributes}:this.attributes}_print(e){return`Geometry ${this.id} attribute ${e}`}_setAttributes(e,n){return this}_calculateVertexCount(e,n){if(n)return n.value.length;let r=1/0;for(const i of Object.values(e)){const{value:s,size:l,constant:c}=i;!c&&s&&l!==void 0&&l>=1&&(r=Math.min(r,s.length/l))}return r}}class Mq extends Db{constructor(e={}){const{id:n=id("cube-geometry"),indices:r=!0}=e;super(r?{...e,id:n,topology:"triangle-list",indices:{size:1,value:Oq},attributes:{...Bq,...e.attributes}}:{...e,id:n,topology:"triangle-list",indices:void 0,attributes:{...Uq,...e.attributes}})}}const Oq=new Uint16Array([0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]),Pq=new Float32Array([-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,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,-1,1,-1,1,1,-1,1,-1]),Nq=new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0]),Iq=new Float32Array([0,0,1,0,1,1,0,1,1,0,1,1,0,1,0,0,0,1,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,0,0,0,1,0,1,1,0,1]),Dq=new Float32Array([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,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,-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,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1]),Fq=new Float32Array([1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,1,0,0]),kq=new Float32Array([1,0,1,1,0,0,1,1,0,0,0,1,1,0,0,1,1,0,1,1,0,0,0,1,1,1,1,1,1,0,1,1,1,0,0,1,1,1,0,1,1,1,1,1,1,0,0,1,0,1,1,1,1,1,1,1,1,1,0,1,0,1,0,1,0,1,1,1,1,1,0,1,0,0,1,1,0,1,1,1,0,1,0,1,0,0,0,1,0,0,1,1,0,1,0,1,1,1,1,1,0,1,1,1,0,0,1,1,0,0,1,1,1,0,1,1,1,1,1,1,1,0,0,1,0,0,0,1,0,1,0,1,1,1,0,1,1,0,0,1,0,1,0,1]),Bq={POSITION:{size:3,value:Pq},NORMAL:{size:3,value:Nq},TEXCOORD_0:{size:2,value:Iq}},Uq={POSITION:{size:3,value:Dq},TEXCOORD_0:{size:2,value:Fq},COLOR_0:{size:3,value:kq}},Lq={blendColorOperation:"add",blendColorSrcFactor:"one",blendColorDstFactor:"zero",blendAlphaOperation:"add",blendAlphaSrcFactor:"constant-alpha",blendAlphaDstFactor:"zero"};class PO extends Ib{constructor(){super(...arguments),this._colorEncoderState=null}render(e){return"pickingFBO"in e?this._drawPickingBuffer(e):super.render(e)}_drawPickingBuffer({layers:e,layerFilter:n,views:r,viewports:i,onViewportActive:s,pickingFBO:l,deviceRect:{x:c,y:f,width:d,height:g},cullRect:m,effects:v,pass:S="picking",pickZ:E,shaderModuleProps:w}){this.pickZ=E;const b=this._resetColorEncoder(E),A=[c,f,d,g],T=super.render({target:l,layers:e,layerFilter:n,views:r,viewports:i,onViewportActive:s,cullRect:m,effects:v==null?void 0:v.filter(M=>M.useInPicking),pass:S,isPicking:!0,shaderModuleProps:w,clearColor:[0,0,0,0],colorMask:15,scissorRect:A});return this._colorEncoderState=null,{decodePickingColor:b&&$q.bind(null,b),stats:T}}shouldDrawLayer(e){const{pickable:n,operation:r}=e.props;return n&&r.includes("draw")||r.includes("terrain")||r.includes("mask")}getShaderModuleProps(e,n,r){return{picking:{isActive:1,isAttribute:this.pickZ},lighting:{enabled:!1}}}getLayerParameters(e,n,r){const i={...e.props.parameters},{pickable:s,operation:l}=e.props;return!this._colorEncoderState||l.includes("terrain")?i.blend=!1:s&&l.includes("draw")&&(Object.assign(i,Lq),i.blend=!0,i.blendColor=zq(this._colorEncoderState,e,r)),i}_resetColorEncoder(e){return this._colorEncoderState=e?null:{byLayer:new Map,byAlpha:[]},this._colorEncoderState}}function zq(t,e,n){const{byLayer:r,byAlpha:i}=t;let s,l=r.get(e);return l?(l.viewports.push(n),s=l.a):(s=r.size+1,s<=255?(l={a:s,layer:e,viewports:[n]},r.set(e,l),i[s]=l):(Sn.warn("Too many pickable layers, only picking the first 255")(),s=0)),[0,0,0,s/255]}function $q(t,e){const n=t.byAlpha[e[3]];return n&&{pickedLayer:n.layer,pickedViewports:n.viewports,pickedObjectIndex:n.layer.decodePickingColor(e)}}const Xl={NO_STATE:"Awaiting state",MATCHED:"Matched. State transferred from previous layer",INITIALIZED:"Initialized",AWAITING_GC:"Discarded. Awaiting garbage collection",AWAITING_FINALIZATION:"No longer matched. Awaiting garbage collection",FINALIZED:"Finalized! Awaiting garbage collection"},Fg=Symbol.for("component"),Uo=Symbol.for("propTypes"),T0=Symbol.for("deprecatedProps"),lc=Symbol.for("asyncPropDefaults"),Xo=Symbol.for("asyncPropOriginal"),Ba=Symbol.for("asyncPropResolved");function NO(t,e=()=>!0){return Array.isArray(t)?IO(t,e,[]):e(t)?[t]:[]}function IO(t,e,n){let r=-1;for(;++r0}delete(){}getData(){return this.isLoaded?this._error?Promise.reject(this._error):this._content:this._loader.then(()=>this.getData())}setData(e,n){if(e===this._data&&!n)return;this._data=e;const r=++this._loadCount;let i=e;typeof e=="string"&&(i=Jh(e)),i instanceof Promise?(this.isLoaded=!1,this._loader=i.then(s=>{this._loadCount===r&&(this.isLoaded=!0,this._error=void 0,this._content=s)}).catch(s=>{this._loadCount===r&&(this.isLoaded=!0,this._error=s||!0)})):(this.isLoaded=!0,this._error=void 0,this._content=e);for(const s of this._subscribers)s.onChange(this.getData())}}class jq{constructor(e){var n;this.protocol=e.protocol||"resource://",this._context={device:e.device,gl:(n=e.device)==null?void 0:n.gl,resourceManager:this},this._resources={},this._consumers={},this._pruneRequest=null}contains(e){return e.startsWith(this.protocol)?!0:e in this._resources}add({resourceId:e,data:n,forceUpdate:r=!1,persistent:i=!0}){let s=this._resources[e];s?s.setData(n,r):(s=new Hq(e,n,this._context),this._resources[e]=s),s.persistent=i}remove(e){const n=this._resources[e];n&&(n.delete(),delete this._resources[e])}unsubscribe({consumerId:e}){const n=this._consumers[e];if(n){for(const r in n){const i=n[r],s=this._resources[i.resourceId];s&&s.unsubscribe(i)}delete this._consumers[e],this.prune()}}subscribe({resourceId:e,onChange:n,consumerId:r,requestId:i="default"}){const{_resources:s,protocol:l}=this;e.startsWith(l)&&(e=e.replace(l,""),s[e]||this.add({resourceId:e,data:null,persistent:!1}));const c=s[e];if(this._track(r,i,c,n),c)return c.getData()}prune(){this._pruneRequest||(this._pruneRequest=setTimeout(()=>this._prune(),0))}finalize(){for(const e in this._resources)this._resources[e].delete()}_track(e,n,r,i){const s=this._consumers,l=s[e]=s[e]||{};let c=l[n];const f=c&&c.resourceId&&this._resources[c.resourceId];f&&(f.unsubscribe(c),this.prune()),r&&(c?(c.onChange=i,c.resourceId=r.id):c={onChange:i,resourceId:r.id},l[n]=c,r.subscribe(c))}_prune(){this._pruneRequest=null;for(const e of Object.keys(this._resources)){const n=this._resources[e];!n.persistent&&!n.inUse()&&(n.delete(),delete this._resources[e])}}}const Wq="layerManager.setLayers",Xq="layerManager.activateViewport";class qq{constructor(e,n){this._lastRenderedLayers=[],this._needsRedraw=!1,this._needsUpdate=!1,this._nextLayers=null,this._debug=!1,this._defaultShaderModulesChanged=!1,this.activateViewport=c=>{jr(Xq,this,c),c&&(this.context.viewport=c)};const{deck:r,stats:i,viewport:s,timeline:l}=n||{};this.layers=[],this.resourceManager=new jq({device:e,protocol:"deck://"}),this.context={mousePosition:null,userData:{},layerManager:this,device:e,gl:e==null?void 0:e.gl,deck:r,shaderAssembler:BX(),defaultShaderModules:[tW],renderPass:void 0,stats:i||new ip({id:"deck.gl"}),viewport:s||new rd({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:l||new RO,resourceManager:this.resourceManager,onError:void 0},Object.seal(this)}finalize(){this.resourceManager.finalize();for(const e of this.layers)this._finalizeLayer(e)}needsRedraw(e={clearRedrawFlags:!1}){let n=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);for(const r of this.layers){const i=r.getNeedsRedraw(e);n=n||i}return n}needsUpdate(){return this._nextLayers&&this._nextLayers!==this._lastRenderedLayers?"layers changed":this._defaultShaderModulesChanged?"shader modules changed":this._needsUpdate}setNeedsRedraw(e){this._needsRedraw=this._needsRedraw||e}setNeedsUpdate(e){this._needsUpdate=this._needsUpdate||e}getLayers({layerIds:e}={}){return e?this.layers.filter(n=>e.find(r=>n.id.indexOf(r)===0)):this.layers}setProps(e){"debug"in e&&(this._debug=e.debug),"userData"in e&&(this.context.userData=e.userData),"layers"in e&&(this._nextLayers=e.layers),"onError"in e&&(this.context.onError=e.onError)}setLayers(e,n){jr(Wq,this,n,e),this._lastRenderedLayers=e;const r=NO(e,Boolean);for(const i of r)i.context=this.context;this._updateLayers(this.layers,r)}updateLayers(){const e=this.needsUpdate();e&&(this.setNeedsRedraw(`updating layers: ${e}`),this.setLayers(this._nextLayers||this._lastRenderedLayers,e)),this._nextLayers=null}addDefaultShaderModule(e){const{defaultShaderModules:n}=this.context;n.find(r=>r.name===e.name)||(n.push(e),this._defaultShaderModulesChanged=!0)}removeDefaultShaderModule(e){const{defaultShaderModules:n}=this.context,r=n.findIndex(i=>i.name===e.name);r>=0&&(n.splice(r,1),this._defaultShaderModulesChanged=!0)}_handleError(e,n,r){r.raiseError(n,`${e} of ${r}`)}_updateLayers(e,n){const r={};for(const l of e)r[l.id]?Sn.warn(`Multiple old layers with same id ${l.id}`)():r[l.id]=l;if(this._defaultShaderModulesChanged){for(const l of e)l.setNeedsUpdate(),l.setChangeFlags({extensionsChanged:!0});this._defaultShaderModulesChanged=!1}const i=[];this._updateSublayersRecursively(n,r,i),this._finalizeOldLayers(r);let s=!1;for(const l of i)if(l.hasUniformTransition()){s=`Uniform transition in ${l}`;break}this._needsUpdate=s,this.layers=i}_updateSublayersRecursively(e,n,r){for(const i of e){i.context=this.context;const s=n[i.id];s===null&&Sn.warn(`Multiple new layers with same id ${i.id}`)(),n[i.id]=null;let l=null;try{this._debug&&s!==i&&i.validateProps(),s?(this._transferLayerState(s,i),this._updateLayer(i)):this._initializeLayer(i),r.push(i),l=i.isComposite?i.getSubLayers():null}catch(c){this._handleError("matching",c,i)}l&&this._updateSublayersRecursively(l,n,r)}}_finalizeOldLayers(e){for(const n in e){const r=e[n];r&&this._finalizeLayer(r)}}_initializeLayer(e){try{e._initialize(),e.lifecycle=Xl.INITIALIZED}catch(n){this._handleError("initialization",n,e)}}_transferLayerState(e,n){n._transferState(e),n.lifecycle=Xl.MATCHED,n!==e&&(e.lifecycle=Xl.AWAITING_GC)}_updateLayer(e){try{e._update()}catch(n){this._handleError("update",n,e)}}_finalizeLayer(e){this._needsRedraw=this._needsRedraw||`finalized ${e}`,e.lifecycle=Xl.AWAITING_FINALIZATION;try{e._finalize(),e.lifecycle=Xl.FINALIZED}catch(n){this._handleError("finalization",n,e)}}}function Ji(t,e,n){if(t===e)return!0;if(!n||!t||!e)return!1;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let r=0;rn.containsPixel(e)):this._viewports}getViews(){const e={};return this.views.forEach(n=>{e[n.id]=n}),e}getView(e){return this.views.find(n=>n.id===e)}getViewState(e){const n=typeof e=="string"?this.getView(e):e,r=n&&this.viewState[n.getViewStateId()]||this.viewState;return n?n.filterViewState(r):r}getViewport(e){return this._viewportMap[e]}unproject(e,n){const r=this.getViewports(),i={x:e[0],y:e[1]};for(let s=r.length-1;s>=0;--s){const l=r[s];if(l.containsPixel(i)){const c=e.slice();return c[0]-=l.x,c[1]-=l.y,l.unproject(c,n)}}return null}setProps(e){e.views&&this._setViews(e.views),e.viewState&&this._setViewState(e.viewState),("width"in e||"height"in e)&&this._setSize(e.width,e.height),this._isUpdating||this._update()}_update(){this._isUpdating=!0,this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._isUpdating=!1}_setSize(e,n){(e!==this.width||n!==this.height)&&(this.width=e,this.height=n,this.setNeedsUpdate("Size changed"))}_setViews(e){e=NO(e,Boolean),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}_setViewState(e){e?(!Ji(e,this.viewState,3)&&this.setNeedsUpdate("viewState changed"),this.viewState=e):Sn.warn("missing `viewState` or `initialViewState`")()}_createController(e,n){const r=n.type;return new r({timeline:this.timeline,eventManager:this._eventManager,onViewStateChange:this._eventCallbacks.onViewStateChange,onStateChange:this._eventCallbacks.onInteractionStateChange,makeViewport:s=>{var l;return(l=this.getView(e.id))==null?void 0:l.makeViewport({viewState:s,width:this.width,height:this.height})}})}_updateController(e,n,r,i){const s=e.controller;if(s&&r){const l={...n,...s,id:e.id,x:r.x,y:r.y,width:r.width,height:r.height};return(!i||i.constructor!==s.type)&&(i=this._createController(e,l)),i&&i.setProps(l),i}return null}_rebuildViewports(){const{views:e}=this,n=this.controllers;this._viewports=[],this.controllers={};let r=!1;for(let i=e.length;i--;){const s=e[i],l=this.getViewState(s),c=s.makeViewport({viewState:l,width:this.width,height:this.height});let f=n[s.id];const d=!!s.controller;d&&!f&&(r=!0),(r||!d)&&f&&(f.finalize(),f=null),this.controllers[s.id]=this._updateController(s,l,c,f),c&&this._viewports.unshift(c)}for(const i in n){const s=n[i];s&&!this.controllers[i]&&s.finalize()}this._buildViewportMap()}_buildViewportMap(){this._viewportMap={},this._viewports.forEach(e=>{e.id&&(this._viewportMap[e.id]=this._viewportMap[e.id]||e)})}_diffViews(e,n){return e.length!==n.length?!0:e.some((r,i)=>!e[i].equals(n[i]))}}const Kq=/([0-9]+\.?[0-9]*)(%|px)/;function va(t){switch(typeof t){case"number":return{position:t,relative:!1};case"string":const e=Kq.exec(t);if(e&&e.length>=3){const n=e[2]==="%",r=parseFloat(e[1]);return{position:n?r/100:r,relative:n}}default:throw new Error(`Could not parse position string ${t}`)}}function _a(t,e){return t.relative?Math.round(t.position*e):t.position}class Uc{constructor(e){const{id:n,x:r=0,y:i=0,width:s="100%",height:l="100%",padding:c=null}=e;this.id=n||this.constructor.displayName||"view",this.props={...e,id:this.id},this._x=va(r),this._y=va(i),this._width=va(s),this._height=va(l),this._padding=c&&{left:va(c.left||0),right:va(c.right||0),top:va(c.top||0),bottom:va(c.bottom||0)},this.equals=this.equals.bind(this),Object.seal(this)}equals(e){return this===e?!0:this.constructor===e.constructor&&Ji(this.props,e.props,2)}makeViewport({width:e,height:n,viewState:r}){r=this.filterViewState(r);const i=this.getDimensions({width:e,height:n});if(!i.height||!i.width)return null;const s=this.getViewportType(r);return new s({...r,...this.props,...i})}getViewStateId(){const{viewState:e}=this.props;return typeof e=="string"?e:(e==null?void 0:e.id)||this.id}filterViewState(e){if(this.props.viewState&&typeof this.props.viewState=="object"){if(!this.props.viewState.id)return this.props.viewState;const n={...e};for(const r in this.props.viewState)r!=="id"&&(n[r]=this.props.viewState[r]);return n}return e}getDimensions({width:e,height:n}){const r={x:_a(this._x,e),y:_a(this._y,n),width:_a(this._width,e),height:_a(this._height,n)};return this._padding&&(r.padding={left:_a(this._padding.left,e),top:_a(this._padding.top,n),right:_a(this._padding.right,e),bottom:_a(this._padding.bottom,n)}),r}get controller(){const e=this.props.controller;return e?e===!0?{type:this.ControllerType}:typeof e=="function"?{type:e}:{type:this.ControllerType,...e}:null}}class Sp{constructor(e){this._inProgress=!1,this._handle=null,this.time=0,this.settings={duration:0},this._timeline=e}get inProgress(){return this._inProgress}start(e){var n,r;this.cancel(),this.settings=e,this._inProgress=!0,(r=(n=this.settings).onStart)==null||r.call(n,this)}end(){var e,n;this._inProgress&&(this._timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1,(n=(e=this.settings).onEnd)==null||n.call(e,this))}cancel(){var e,n;this._inProgress&&((n=(e=this.settings).onInterrupt)==null||n.call(e,this),this._timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1)}update(){var e,n;if(!this._inProgress)return!1;if(this._handle===null){const{_timeline:r,settings:i}=this;this._handle=r.addChannel({delay:r.getTime(),duration:i.duration})}return this.time=this._timeline.getTime(this._handle),this._onUpdate(),(n=(e=this.settings).onUpdate)==null||n.call(e,this),this._timeline.isFinished(this._handle)&&this.end(),!0}_onUpdate(){}}const iC=()=>{},Ty={BREAK:1,SNAP_TO_END:2,IGNORE:3},Zq=t=>t,Qq=Ty.BREAK;class Gq{constructor(e){this._onTransitionUpdate=n=>{const{time:r,settings:{interpolator:i,startProps:s,endProps:l,duration:c,easing:f}}=n,d=f(r/c),g=i.interpolateProps(s,l,d);this.propsInTransition=this.getControllerState({...this.props,...g}).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})},this.getControllerState=e.getControllerState,this.propsInTransition=null,this.transition=new Sp(e.timeline),this.onViewStateChange=e.onViewStateChange||iC,this.onStateChange=e.onStateChange||iC}finalize(){this.transition.cancel()}getViewportInTransition(){return this.propsInTransition}processViewStateChange(e){let n=!1;const r=this.props;if(this.props=e,!r||this._shouldIgnoreViewportChange(r,e))return!1;if(this._isTransitionEnabled(e)){let i=r;if(this.transition.inProgress){const{interruption:s,endProps:l}=this.transition.settings;i={...r,...s===Ty.SNAP_TO_END?l:this.propsInTransition||r}}this._triggerTransition(i,e),n=!0}else this.transition.cancel();return n}updateTransition(){this.transition.update()}_isTransitionEnabled(e){const{transitionDuration:n,transitionInterpolator:r}=e;return(n>0||n==="auto")&&!!r}_isUpdateDueToCurrentTransition(e){return this.transition.inProgress&&this.propsInTransition?this.transition.settings.interpolator.arePropsEqual(e,this.propsInTransition):!1}_shouldIgnoreViewportChange(e,n){return this.transition.inProgress?this.transition.settings.interruption===Ty.IGNORE||this._isUpdateDueToCurrentTransition(n):this._isTransitionEnabled(n)?n.transitionInterpolator.arePropsEqual(e,n):!0}_triggerTransition(e,n){const r=this.getControllerState(e),i=this.getControllerState(n).shortestPathFrom(r),s=n.transitionInterpolator,l=s.getDuration?s.getDuration(e,n):n.transitionDuration;if(l===0)return;const c=s.initializeProps(e,i);this.propsInTransition={};const f={duration:l,easing:n.transitionEasing||Zq,interpolator:s,interruption:n.transitionInterruption||Qq,startProps:c.start,endProps:c.end,onStart:n.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(n.onTransitionInterrupt),onEnd:this._onTransitionEnd(n.onTransitionEnd)};this.transition.start(f),this.onStateChange({inTransition:!0}),this.updateTransition()}_onTransitionEnd(e){return n=>{this.propsInTransition=null,this.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1}),e==null||e(n)}}}function Br(t,e){if(!t)throw new Error(e||"deck.gl: assertion failed.")}class Jq{constructor(e){const{compare:n,extract:r,required:i}=e;this._propsToCompare=n,this._propsToExtract=r||n,this._requiredProps=i}arePropsEqual(e,n){for(const r of this._propsToCompare)if(!(r in e)||!(r in n)||!Ff(e[r],n[r]))return!1;return!0}initializeProps(e,n){const r={},i={};for(const s of this._propsToExtract)(s in e||s in n)&&(r[s]=e[s],i[s]=n[s]);return this._checkRequiredProps(r),this._checkRequiredProps(i),{start:r,end:i}}getDuration(e,n){return n.transitionDuration}_checkRequiredProps(e){this._requiredProps&&this._requiredProps.forEach(n=>{const r=e[n];Br(Number.isFinite(r)||Array.isArray(r),`${n} is required for transition`)})}}const eY=["longitude","latitude","zoom","bearing","pitch"],tY=["longitude","latitude","zoom"];class DO extends Jq{constructor(e={}){const n=Array.isArray(e)?e:e.transitionProps,r=Array.isArray(e)?{}:e;r.transitionProps=Array.isArray(n)?{compare:n,required:n}:n||{compare:eY,required:tY},super(r.transitionProps),this.opts=r}initializeProps(e,n){const r=super.initializeProps(e,n),{makeViewport:i,around:s}=this.opts;if(i&&s){const l=i(e),c=i(n),f=l.unproject(s);r.start.around=s,Object.assign(r.end,{around:c.project(f),aroundPosition:f,width:n.width,height:n.height})}return r}interpolateProps(e,n,r){const i={};for(const s of this._propsToExtract)i[s]=Mg(e[s]||0,n[s]||0,r);if(n.aroundPosition&&this.opts.makeViewport){const s=this.opts.makeViewport({...n,...i});Object.assign(i,s.panByPosition(n.aroundPosition,Mg(e.around,n.around,r)))}return i}}const ya={transitionDuration:0},nY=300,Oh=t=>1-(1-t)*(1-t),Wl={WHEEL:["wheel"],PAN:["panstart","panmove","panend"],PINCH:["pinchstart","pinchmove","pinchend"],MULTI_PAN:["multipanstart","multipanmove","multipanend"],DOUBLE_CLICK:["dblclick"],KEYBOARD:["keydown"]},po={};class rY{constructor(e){this.state={},this._events={},this._interactionState={isDragging:!1},this._customEvents=[],this._eventStartBlocked=null,this._panMove=!1,this.invertPan=!1,this.dragMode="rotate",this.inertia=0,this.scrollZoom=!0,this.dragPan=!0,this.dragRotate=!0,this.doubleClickZoom=!0,this.touchZoom=!0,this.touchRotate=!1,this.keyboard=!0,this.transitionManager=new Gq({...e,getControllerState:n=>new this.ControllerState(n),onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}),this.handleEvent=this.handleEvent.bind(this),this.eventManager=e.eventManager,this.onViewStateChange=e.onViewStateChange||(()=>{}),this.onStateChange=e.onStateChange||(()=>{}),this.makeViewport=e.makeViewport}set events(e){this.toggleEvents(this._customEvents,!1),this.toggleEvents(e,!0),this._customEvents=e,this.props&&this.setProps(this.props)}finalize(){var e;for(const n in this._events)this._events[n]&&((e=this.eventManager)==null||e.off(n,this.handleEvent));this.transitionManager.finalize()}handleEvent(e){this._controllerState=void 0;const n=this._eventStartBlocked;switch(e.type){case"panstart":return n?!1:this._onPanStart(e);case"panmove":return this._onPan(e);case"panend":return this._onPanEnd(e);case"pinchstart":return n?!1:this._onPinchStart(e);case"pinchmove":return this._onPinch(e);case"pinchend":return this._onPinchEnd(e);case"multipanstart":return n?!1:this._onMultiPanStart(e);case"multipanmove":return this._onMultiPan(e);case"multipanend":return this._onMultiPanEnd(e);case"dblclick":return this._onDoubleClick(e);case"wheel":return this._onWheel(e);case"keydown":return this._onKeyDown(e);default:return!1}}get controllerState(){return this._controllerState=this._controllerState||new this.ControllerState({makeViewport:this.makeViewport,...this.props,...this.state}),this._controllerState}getCenter(e){const{x:n,y:r}=this.props,{offsetCenter:i}=e;return[i.x-n,i.y-r]}isPointInBounds(e,n){const{width:r,height:i}=this.props;if(n&&n.handled)return!1;const s=e[0]>=0&&e[0]<=r&&e[1]>=0&&e[1]<=i;return s&&n&&n.stopPropagation(),s}isFunctionKeyPressed(e){const{srcEvent:n}=e;return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}isDragging(){return this._interactionState.isDragging||!1}blockEvents(e){const n=setTimeout(()=>{this._eventStartBlocked===n&&(this._eventStartBlocked=null)},e);this._eventStartBlocked=n}setProps(e){e.dragMode&&(this.dragMode=e.dragMode),this.props=e,"transitionInterpolator"in e||(e.transitionInterpolator=this._getTransitionProps().transitionInterpolator),this.transitionManager.processViewStateChange(e);const{inertia:n}=e;this.inertia=Number.isFinite(n)?n:n===!0?nY:0;const{scrollZoom:r=!0,dragPan:i=!0,dragRotate:s=!0,doubleClickZoom:l=!0,touchZoom:c=!0,touchRotate:f=!1,keyboard:d=!0}=e,g=!!this.onViewStateChange;this.toggleEvents(Wl.WHEEL,g&&r),this.toggleEvents(Wl.PAN,g),this.toggleEvents(Wl.PINCH,g&&(c||f)),this.toggleEvents(Wl.MULTI_PAN,g&&f),this.toggleEvents(Wl.DOUBLE_CLICK,g&&l),this.toggleEvents(Wl.KEYBOARD,g&&d),this.scrollZoom=r,this.dragPan=i,this.dragRotate=s,this.doubleClickZoom=l,this.touchZoom=c,this.touchRotate=f,this.keyboard=d}updateTransition(){this.transitionManager.updateTransition()}toggleEvents(e,n){this.eventManager&&e.forEach(r=>{this._events[r]!==n&&(this._events[r]=n,n?this.eventManager.on(r,this.handleEvent):this.eventManager.off(r,this.handleEvent))})}updateViewport(e,n=null,r={}){const i={...e.getViewportProps(),...n},s=this.controllerState!==e;if(this.state=e.getState(),this._setInteractionState(r),s){const l=this.controllerState&&this.controllerState.getViewportProps();this.onViewStateChange&&this.onViewStateChange({viewState:i,interactionState:this._interactionState,oldViewState:l,viewId:this.props.id})}}_onTransition(e){this.onViewStateChange({...e,interactionState:this._interactionState,viewId:this.props.id})}_setInteractionState(e){Object.assign(this._interactionState,e),this.onStateChange(this._interactionState)}_onPanStart(e){const n=this.getCenter(e);if(!this.isPointInBounds(n,e))return!1;let r=this.isFunctionKeyPressed(e)||e.rightButton||!1;(this.invertPan||this.dragMode==="pan")&&(r=!r);const i=this.controllerState[r?"panStart":"rotateStart"]({pos:n});return this._panMove=r,this.updateViewport(i,ya,{isDragging:!0}),!0}_onPan(e){return this.isDragging()?this._panMove?this._onPanMove(e):this._onPanRotate(e):!1}_onPanEnd(e){return this.isDragging()?this._panMove?this._onPanMoveEnd(e):this._onPanRotateEnd(e):!1}_onPanMove(e){if(!this.dragPan)return!1;const n=this.getCenter(e),r=this.controllerState.pan({pos:n});return this.updateViewport(r,ya,{isDragging:!0,isPanning:!0}),!0}_onPanMoveEnd(e){const{inertia:n}=this;if(this.dragPan&&n&&e.velocity){const r=this.getCenter(e),i=[r[0]+e.velocityX*n/2,r[1]+e.velocityY*n/2],s=this.controllerState.pan({pos:i}).panEnd();this.updateViewport(s,{...this._getTransitionProps(),transitionDuration:n,transitionEasing:Oh},{isDragging:!1,isPanning:!0})}else{const r=this.controllerState.panEnd();this.updateViewport(r,null,{isDragging:!1,isPanning:!1})}return!0}_onPanRotate(e){if(!this.dragRotate)return!1;const n=this.getCenter(e),r=this.controllerState.rotate({pos:n});return this.updateViewport(r,ya,{isDragging:!0,isRotating:!0}),!0}_onPanRotateEnd(e){const{inertia:n}=this;if(this.dragRotate&&n&&e.velocity){const r=this.getCenter(e),i=[r[0]+e.velocityX*n/2,r[1]+e.velocityY*n/2],s=this.controllerState.rotate({pos:i}).rotateEnd();this.updateViewport(s,{...this._getTransitionProps(),transitionDuration:n,transitionEasing:Oh},{isDragging:!1,isRotating:!0})}else{const r=this.controllerState.rotateEnd();this.updateViewport(r,null,{isDragging:!1,isRotating:!1})}return!0}_onWheel(e){if(!this.scrollZoom)return!1;const n=this.getCenter(e);if(!this.isPointInBounds(n,e))return!1;e.srcEvent.preventDefault();const{speed:r=.01,smooth:i=!1}=this.scrollZoom===!0?{}:this.scrollZoom,{delta:s}=e;let l=2/(1+Math.exp(-Math.abs(s*r)));s<0&&l!==0&&(l=1/l);const c=this.controllerState.zoom({pos:n,scale:l});return this.updateViewport(c,{...this._getTransitionProps({around:n}),transitionDuration:i?250:1},{isZooming:!0,isPanning:!0}),!0}_onMultiPanStart(e){const n=this.getCenter(e);if(!this.isPointInBounds(n,e))return!1;const r=this.controllerState.rotateStart({pos:n});return this.updateViewport(r,ya,{isDragging:!0}),!0}_onMultiPan(e){if(!this.touchRotate||!this.isDragging())return!1;const n=this.getCenter(e);n[0]-=e.deltaX;const r=this.controllerState.rotate({pos:n});return this.updateViewport(r,ya,{isDragging:!0,isRotating:!0}),!0}_onMultiPanEnd(e){if(!this.isDragging())return!1;const{inertia:n}=this;if(this.touchRotate&&n&&e.velocityY){const r=this.getCenter(e),i=[r[0],r[1]+=e.velocityY*n/2],s=this.controllerState.rotate({pos:i});this.updateViewport(s,{...this._getTransitionProps(),transitionDuration:n,transitionEasing:Oh},{isDragging:!1,isRotating:!0}),this.blockEvents(n)}else{const r=this.controllerState.rotateEnd();this.updateViewport(r,null,{isDragging:!1,isRotating:!1})}return!0}_onPinchStart(e){const n=this.getCenter(e);if(!this.isPointInBounds(n,e))return!1;const r=this.controllerState.zoomStart({pos:n}).rotateStart({pos:n});return po._startPinchRotation=e.rotation,po._lastPinchEvent=e,this.updateViewport(r,ya,{isDragging:!0}),!0}_onPinch(e){if(!this.touchZoom&&!this.touchRotate||!this.isDragging())return!1;let n=this.controllerState;if(this.touchZoom){const{scale:r}=e,i=this.getCenter(e);n=n.zoom({pos:i,scale:r})}if(this.touchRotate){const{rotation:r}=e;n=n.rotate({deltaAngleX:po._startPinchRotation-r})}return this.updateViewport(n,ya,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),po._lastPinchEvent=e,!0}_onPinchEnd(e){if(!this.isDragging())return!1;const{inertia:n}=this,{_lastPinchEvent:r}=po;if(this.touchZoom&&n&&r&&e.scale!==r.scale){const i=this.getCenter(e);let s=this.controllerState.rotateEnd();const l=Math.log2(e.scale),c=(l-Math.log2(r.scale))/(e.deltaTime-r.deltaTime),f=Math.pow(2,l+c*n/2);s=s.zoom({pos:i,scale:f}).zoomEnd(),this.updateViewport(s,{...this._getTransitionProps({around:i}),transitionDuration:n,transitionEasing:Oh},{isDragging:!1,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:!1}),this.blockEvents(n)}else{const i=this.controllerState.zoomEnd().rotateEnd();this.updateViewport(i,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1})}return po._startPinchRotation=null,po._lastPinchEvent=null,!0}_onDoubleClick(e){if(!this.doubleClickZoom)return!1;const n=this.getCenter(e);if(!this.isPointInBounds(n,e))return!1;const r=this.isFunctionKeyPressed(e),i=this.controllerState.zoom({pos:n,scale:r?.5:2});return this.updateViewport(i,this._getTransitionProps({around:n}),{isZooming:!0,isPanning:!0}),this.blockEvents(100),!0}_onKeyDown(e){if(!this.keyboard)return!1;const n=this.isFunctionKeyPressed(e),{zoomSpeed:r,moveSpeed:i,rotateSpeedX:s,rotateSpeedY:l}=this.keyboard===!0?{}:this.keyboard,{controllerState:c}=this;let f;const d={};switch(e.srcEvent.code){case"Minus":f=n?c.zoomOut(r).zoomOut(r):c.zoomOut(r),d.isZooming=!0;break;case"Equal":f=n?c.zoomIn(r).zoomIn(r):c.zoomIn(r),d.isZooming=!0;break;case"ArrowLeft":n?(f=c.rotateLeft(s),d.isRotating=!0):(f=c.moveLeft(i),d.isPanning=!0);break;case"ArrowRight":n?(f=c.rotateRight(s),d.isRotating=!0):(f=c.moveRight(i),d.isPanning=!0);break;case"ArrowUp":n?(f=c.rotateUp(l),d.isRotating=!0):(f=c.moveUp(i),d.isPanning=!0);break;case"ArrowDown":n?(f=c.rotateDown(l),d.isRotating=!0):(f=c.moveDown(i),d.isPanning=!0);break;default:return!1}return this.updateViewport(f,this._getTransitionProps(),d),!0}_getTransitionProps(e){const{transition:n}=this;return!n||!n.transitionInterpolator?ya:e?{...n,transitionInterpolator:new DO({...e,...n.transitionInterpolator.opts,makeViewport:this.controllerState.makeViewport})}:n}}class iY{constructor(e,n){this._viewportProps=this.applyConstraints(e),this._state=n}getViewportProps(){return this._viewportProps}getState(){return this._state}}const sC=5,sY=1.2;class aY extends iY{constructor(e){const{width:n,height:r,latitude:i,longitude:s,zoom:l,bearing:c=0,pitch:f=0,altitude:d=1.5,position:g=[0,0,0],maxZoom:m=20,minZoom:v=0,maxPitch:S=60,minPitch:E=0,startPanLngLat:w,startZoomLngLat:b,startRotatePos:A,startBearing:T,startPitch:C,startZoom:M,normalize:x=!0}=e;Br(Number.isFinite(s)),Br(Number.isFinite(i)),Br(Number.isFinite(l)),super({width:n,height:r,latitude:i,longitude:s,zoom:l,bearing:c,pitch:f,altitude:d,maxZoom:m,minZoom:v,maxPitch:S,minPitch:E,normalize:x,position:g},{startPanLngLat:w,startZoomLngLat:b,startRotatePos:A,startBearing:T,startPitch:C,startZoom:M}),this.makeViewport=e.makeViewport}panStart({pos:e}){return this._getUpdatedState({startPanLngLat:this._unproject(e)})}pan({pos:e,startPos:n}){const r=this.getState().startPanLngLat||this._unproject(n);if(!r)return this;const s=this.makeViewport(this.getViewportProps()).panByPosition(r,e);return this._getUpdatedState(s)}panEnd(){return this._getUpdatedState({startPanLngLat:null})}rotateStart({pos:e}){return this._getUpdatedState({startRotatePos:e,startBearing:this.getViewportProps().bearing,startPitch:this.getViewportProps().pitch})}rotate({pos:e,deltaAngleX:n=0,deltaAngleY:r=0}){const{startRotatePos:i,startBearing:s,startPitch:l}=this.getState();if(!i||s===void 0||l===void 0)return this;let c;return e?c=this._getNewRotation(e,i,l,s):c={bearing:s+n,pitch:l+r},this._getUpdatedState(c)}rotateEnd(){return this._getUpdatedState({startBearing:null,startPitch:null})}zoomStart({pos:e}){return this._getUpdatedState({startZoomLngLat:this._unproject(e),startZoom:this.getViewportProps().zoom})}zoom({pos:e,startPos:n,scale:r}){let{startZoom:i,startZoomLngLat:s}=this.getState();if(s||(i=this.getViewportProps().zoom,s=this._unproject(n)||this._unproject(e)),!s)return this;const{maxZoom:l,minZoom:c}=this.getViewportProps();let f=i+Math.log2(r);f=ka(f,c,l);const d=this.makeViewport({...this.getViewportProps(),zoom:f});return this._getUpdatedState({zoom:f,...d.panByPosition(s,e)})}zoomEnd(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}zoomIn(e=2){return this._zoomFromCenter(e)}zoomOut(e=2){return this._zoomFromCenter(1/e)}moveLeft(e=100){return this._panFromCenter([e,0])}moveRight(e=100){return this._panFromCenter([-e,0])}moveUp(e=100){return this._panFromCenter([0,e])}moveDown(e=100){return this._panFromCenter([0,-e])}rotateLeft(e=15){return this._getUpdatedState({bearing:this.getViewportProps().bearing-e})}rotateRight(e=15){return this._getUpdatedState({bearing:this.getViewportProps().bearing+e})}rotateUp(e=10){return this._getUpdatedState({pitch:this.getViewportProps().pitch+e})}rotateDown(e=10){return this._getUpdatedState({pitch:this.getViewportProps().pitch-e})}shortestPathFrom(e){const n=e.getViewportProps(),r={...this.getViewportProps()},{bearing:i,longitude:s}=r;return Math.abs(i-n.bearing)>180&&(r.bearing=i<0?i+360:i-360),Math.abs(s-n.longitude)>180&&(r.longitude=s<0?s+360:s-360),r}applyConstraints(e){const{maxZoom:n,minZoom:r,zoom:i}=e;e.zoom=ka(i,r,n);const{maxPitch:s,minPitch:l,pitch:c}=e;e.pitch=ka(c,l,s);const{normalize:f=!0}=e;return f&&Object.assign(e,wX(e)),e}_zoomFromCenter(e){const{width:n,height:r}=this.getViewportProps();return this.zoom({pos:[n/2,r/2],scale:e})}_panFromCenter(e){const{width:n,height:r}=this.getViewportProps();return this.pan({startPos:[n/2,r/2],pos:[n/2+e[0],r/2+e[1]]})}_getUpdatedState(e){return new this.constructor({makeViewport:this.makeViewport,...this.getViewportProps(),...this.getState(),...e})}_unproject(e){const n=this.makeViewport(this.getViewportProps());return e&&n.unproject(e)}_getNewRotation(e,n,r,i){const s=e[0]-n[0],l=e[1]-n[1],c=e[1],f=n[1],{width:d,height:g}=this.getViewportProps(),m=s/d;let v=0;l>0?Math.abs(g-f)>sC&&(v=l/(f-g)*sY):l<0&&f>sC&&(v=1-c/f),v=ka(v,-1,1);const{minPitch:S,maxPitch:E}=this.getViewportProps(),w=i+180*m;let b=r;return v>0?b=r+v*(E-r):v<0&&(b=r-v*(S-r)),{pitch:b,bearing:w}}}class oY extends rY{constructor(){super(...arguments),this.ControllerState=aY,this.transition={transitionDuration:300,transitionInterpolator:new DO({transitionProps:{compare:["longitude","latitude","zoom","bearing","pitch","position"],required:["longitude","latitude","zoom"]}})},this.dragMode="pan"}setProps(e){e.position=e.position||[0,0,0];const n=this.props;super.setProps(e),(!n||n.height!==e.height)&&this.updateViewport(new this.ControllerState({makeViewport:this.makeViewport,...e,...this.state}))}}class FO extends Uc{constructor(e={}){super(e)}getViewportType(){return Bc}get ControllerType(){return oY}}FO.displayName="MapView";const lY=new AO;function cY(t,e){const n=t.order??1/0,r=e.order??1/0;return n-r}class uY{constructor(e){this._resolvedEffects=[],this._defaultEffects=[],this.effects=[],this._context=e,this._needsRedraw="Initial render",this._setEffects([])}addDefaultEffect(e){const n=this._defaultEffects;if(!n.find(r=>r.id===e.id)){const r=n.findIndex(i=>cY(i,e)>0);r<0?n.push(e):n.splice(r,0,e),e.setup(this._context),this._setEffects(this.effects)}}setProps(e){"effects"in e&&(Ji(e.effects,this.effects,1)||this._setEffects(e.effects))}needsRedraw(e={clearRedrawFlags:!1}){const n=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),n}getEffects(){return this._resolvedEffects}_setEffects(e){const n={};for(const i of this.effects)n[i.id]=i;const r=[];for(const i of e){const s=n[i.id];let l=i;s&&s!==i?s.setProps?(s.setProps(i.props),l=s):s.cleanup(this._context):s||i.setup(this._context),r.push(l),delete n[i.id]}for(const i in n)n[i].cleanup(this._context);this.effects=r,this._resolvedEffects=r.concat(this._defaultEffects),e.some(i=>i instanceof AO)||this._resolvedEffects.push(lY),this._needsRedraw="effects changed"}finalize(){for(const e of this._resolvedEffects)e.cleanup(this._context);this.effects.length=0,this._resolvedEffects.length=0,this._defaultEffects.length=0}}class fY extends Ib{shouldDrawLayer(e){const{operation:n}=e.props;return n.includes("draw")||n.includes("terrain")}}const dY="deckRenderer.renderLayers";class hY{constructor(e){this.device=e,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new fY(e),this.pickLayersPass=new PO(e),this.renderCount=0,this._needsRedraw="Initial render",this.renderBuffers=[],this.lastPostProcessEffect=null}setProps(e){this.layerFilter!==e.layerFilter&&(this.layerFilter=e.layerFilter,this._needsRedraw="layerFilter changed"),this.drawPickingColors!==e.drawPickingColors&&(this.drawPickingColors=e.drawPickingColors,this._needsRedraw="drawPickingColors changed")}renderLayers(e){if(!e.viewports.length)return;const n=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass,r={layerFilter:this.layerFilter,isPicking:this.drawPickingColors,...e};r.effects&&this._preRender(r.effects,r);const i=this.lastPostProcessEffect?this.renderBuffers[0]:r.target;this.lastPostProcessEffect&&(r.clearColor=[0,0,0,0],r.clearCanvas=!0);const s=n.render({...r,target:i});r.effects&&this._postRender(r.effects,r),this.renderCount++,jr(dY,this,s,e)}needsRedraw(e={clearRedrawFlags:!1}){const n=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),n}finalize(){const{renderBuffers:e}=this;for(const n of e)n.delete();e.length=0}_preRender(e,n){this.lastPostProcessEffect=null,n.preRenderStats=n.preRenderStats||{};for(const r of e)n.preRenderStats[r.id]=r.preRender(n),r.postRender&&(this.lastPostProcessEffect=r.id);this.lastPostProcessEffect&&this._resizeRenderBuffers()}_resizeRenderBuffers(){const{renderBuffers:e}=this,n=this.device.canvasContext.getDrawingBufferSize();e.length===0&&[0,1].map(r=>{const i=this.device.createTexture({sampler:{minFilter:"linear",magFilter:"linear"}});e.push(this.device.createFramebuffer({id:`deck-renderbuffer-${r}`,colorAttachments:[i]}))});for(const r of e)r.resize(n)}_postRender(e,n){const{renderBuffers:r}=this,i={...n,inputBuffer:r[0],swapBuffer:r[1]};for(const s of e)if(s.postRender){i.target=s.id===this.lastPostProcessEffect?n.target:void 0;const l=s.postRender(i);i.inputBuffer=l,i.swapBuffer=l===r[0]?r[1]:r[0]}}}const gY={pickedColor:null,pickedObjectIndex:-1};function pY({pickedColors:t,decodePickingColor:e,deviceX:n,deviceY:r,deviceRadius:i,deviceRect:s}){const{x:l,y:c,width:f,height:d}=s;let g=i*i,m=-1,v=0;for(let S=0;Sg)v+=4*f;else for(let b=0;b=0){const T=b+l-n,C=T*T+w;C<=g&&(g=C,m=v)}v+=4}}if(m>=0){const S=t.slice(m,m+4),E=e(S);if(E){const w=Math.floor(m/4/f),b=m/4-w*f;return{...E,pickedColor:S,pickedX:l+b,pickedY:c+w}}Sn.error("Picked non-existent layer. Is picking buffer corrupt?")()}return gY}function mY({pickedColors:t,decodePickingColor:e}){const n=new Map;if(t){for(let r=0;r=0){const s=t.slice(r,r+4),l=s.join(",");if(!n.has(l)){const c=e(s);c?n.set(l,{...c,color:s}):Sn.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(n.values())}function kO({pickInfo:t,viewports:e,pixelRatio:n,x:r,y:i,z:s}){let l=e[0];e.length>1&&(l=_Y((t==null?void 0:t.pickedViewports)||e,{x:r,y:i}));let c;if(l){const f=[r-l.x,i-l.y];s!==void 0&&(f[2]=s),c=l.unproject(f)}return{color:null,layer:null,viewport:l,index:-1,picked:!1,x:r,y:i,pixel:[r,i],coordinate:c,devicePixel:t&&"pickedX"in t?[t.pickedX,t.pickedY]:void 0,pixelRatio:n}}function vY(t){const{pickInfo:e,lastPickedInfo:n,mode:r,layers:i}=t,{pickedColor:s,pickedLayer:l,pickedObjectIndex:c}=e,f=l?[l]:[];if(r==="hover"){const m=n.index,v=n.layerId,S=l?l.props.id:null;if(S!==v||c!==m){if(S!==v){const E=i.find(w=>w.props.id===v);E&&f.unshift(E)}n.layerId=S,n.index=c,n.info=null}}const d=kO(t),g=new Map;return g.set(null,d),f.forEach(m=>{let v={...d};m===l&&(v.color=s,v.index=c,v.picked=!0),v=BO({layer:m,info:v,mode:r});const S=v.layer;m===l&&r==="hover"&&(n.info=v),g.set(S.id,v),r==="hover"&&S.updateAutoHighlight(v)}),g}function BO({layer:t,info:e,mode:n}){for(;t&&e;){const r=e.layer||null;e.sourceLayer=r,e.layer=t,e=t.getPickingInfo({info:e,mode:n,sourceLayer:r}),t=t.parent}return e}function _Y(t,e){for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.containsPixel(e))return r}return t[0]}class yY{constructor(e){this._pickable=!0,this.device=e,this.pickLayersPass=new PO(e),this.lastPickedInfo={index:-1,layerId:null,info:null}}setProps(e){"layerFilter"in e&&(this.layerFilter=e.layerFilter),"_pickable"in e&&(this._pickable=e._pickable)}finalize(){this.pickingFBO&&this.pickingFBO.destroy(),this.depthFBO&&this.depthFBO.destroy()}pickObject(e){return this._pickClosestObject(e)}pickObjects(e){return this._pickVisibleObjects(e)}getLastPickedObject({x:e,y:n,layers:r,viewports:i},s=this.lastPickedInfo.info){const l=s&&s.layer&&s.layer.id,c=s&&s.viewport&&s.viewport.id,f=l?r.find(v=>v.id===l):null,d=c&&i.find(v=>v.id===c)||i[0],g=d&&d.unproject([e-d.x,n-d.y]);return{...s,...{x:e,y:n,viewport:d,coordinate:g,layer:f}}}_resizeBuffer(){var n,r;if(!this.pickingFBO&&(this.pickingFBO=this.device.createFramebuffer({colorAttachments:["rgba8unorm"],depthStencilAttachment:"depth16unorm"}),this.device.isTextureFormatRenderable("rgba32float"))){const i=this.device.createFramebuffer({colorAttachments:["rgba32float"],depthStencilAttachment:"depth16unorm"});this.depthFBO=i}const{canvas:e}=this.device.getDefaultCanvasContext();(n=this.pickingFBO)==null||n.resize({width:e.width,height:e.height}),(r=this.depthFBO)==null||r.resize({width:e.width,height:e.height})}_getPickable(e){if(this._pickable===!1)return null;const n=e.filter(r=>this.pickLayersPass.shouldDrawLayer(r)&&!r.isComposite);return n.length?n:null}_pickClosestObject({layers:e,views:n,viewports:r,x:i,y:s,radius:l=0,depth:c=1,mode:f="query",unproject3D:d,onViewportActive:g,effects:m}){const v=this.device.canvasContext.cssToDeviceRatio(),S=this._getPickable(e);if(!S||r.length===0)return{result:[],emptyInfo:kO({viewports:r,x:i,y:s,pixelRatio:v})};this._resizeBuffer();const E=this.device.canvasContext.cssToDevicePixels([i,s],!0),w=[E.x+Math.floor(E.width/2),E.y+Math.floor(E.height/2)],b=Math.round(l*v),{width:A,height:T}=this.pickingFBO,C=this._getPickingRect({deviceX:w[0],deviceY:w[1],deviceRadius:b,deviceWidth:A,deviceHeight:T}),M={x:i-l,y:s-l,width:l*2+1,height:l*2+1};let x;const N=[],F=new Set;for(let L=0;L=d);V++){const B=N[V];let j={color:B.pickedColor,layer:null,index:B.pickedObjectIndex,picked:!0,x:i,y:s,pixelRatio:S};j=BO({layer:B.pickedLayer,info:j,mode:f});const X=j.layer.id;F.has(X)||F.set(X,new Set);const Y=F.get(X),ae=j.object??j.index;Y.has(ae)||(Y.add(ae),L.push(j))}return L}_drawAndSample({layers:e,views:n,viewports:r,onViewportActive:i,deviceRect:s,cullRect:l,effects:c,pass:f},d=!1){const g=d?this.depthFBO:this.pickingFBO,m={layers:e,layerFilter:this.layerFilter,views:n,viewports:r,onViewportActive:i,pickingFBO:g,deviceRect:s,cullRect:l,effects:c,pass:f,pickZ:d,preRenderStats:{},isPicking:!0};for(const T of c)T.useInPicking&&(m.preRenderStats[T.id]=T.preRender(m));const{decodePickingColor:v}=this.pickLayersPass.render(m),{x:S,y:E,width:w,height:b}=s,A=new(d?Float32Array:Uint8Array)(w*b*4);return this.device.readPixelsToArrayWebGL(g,{sourceX:S,sourceY:E,sourceWidth:w,sourceHeight:b,target:A}),{pickedColors:A,decodePickingColor:v}}_getPickingRect({deviceX:e,deviceY:n,deviceRadius:r,deviceWidth:i,deviceHeight:s}){const l=Math.max(0,e-r),c=Math.max(0,n-r),f=Math.min(i,e+r+1)-l,d=Math.min(s,n+r+1)-c;return f<=0||d<=0?null:{x:l,y:c,width:f,height:d}}}const bY={"top-left":{top:0,left:0},"top-right":{top:0,right:0},"bottom-left":{bottom:0,left:0},"bottom-right":{bottom:0,right:0},fill:{top:0,left:0,bottom:0,right:0}},SY="top-left",aC="__root";class wY{constructor({deck:e,parentElement:n}){this.defaultWidgets=[],this.widgets=[],this.resolvedWidgets=[],this.containers={},this.lastViewports={},this.deck=e,this.parentElement=n}getWidgets(){return this.resolvedWidgets}setProps(e){e.widgets&&!Ji(e.widgets,this.widgets,1)&&this._setWidgets(e.widgets)}finalize(){for(const e of this.getWidgets())this._remove(e);this.defaultWidgets.length=0,this.resolvedWidgets.length=0;for(const e in this.containers)this.containers[e].remove()}addDefault(e){this.defaultWidgets.find(n=>n.id===e.id)||(this._add(e),this.defaultWidgets.push(e),this._setWidgets(this.widgets))}_setWidgets(e){const n={};for(const r of this.resolvedWidgets)n[r.id]=r;this.resolvedWidgets.length=0;for(const r of this.defaultWidgets)n[r.id]=null,this.resolvedWidgets.push(r);for(let r of e){const i=n[r.id];i?i.viewId!==r.viewId||i.placement!==r.placement?(this._remove(i),this._add(r)):r!==i&&(i.setProps(r.props),r=i):this._add(r),n[r.id]=null,this.resolvedWidgets.push(r)}for(const r in n){const i=n[r];i&&this._remove(i)}this.widgets=e}_add(e){const{viewId:n=null,placement:r=SY}=e,i=e.onAdd({deck:this.deck,viewId:n});i&&this._getContainer(n,r).append(i),e._element=i}_remove(e){var n;(n=e.onRemove)==null||n.call(e),e._element&&e._element.remove(),e._element=void 0}_getContainer(e,n){var l;const r=e||aC;let i=this.containers[r];i||(i=document.createElement("div"),i.style.pointerEvents="none",i.style.position="absolute",i.style.overflow="hidden",(l=this.parentElement)==null||l.append(i),this.containers[r]=i);let s=i.querySelector(`.${n}`);return s||(s=document.createElement("div"),s.className=n,s.style.position="absolute",s.style.zIndex="2",Object.assign(s.style,bY[n]),i.append(s)),s}_updateContainers(){const e=this.deck.width,n=this.deck.height;for(const r in this.containers){const i=this.lastViewports[r]||null,s=r===aC||i,l=this.containers[r];s?(l.style.display="block",l.style.left=`${i?i.x:0}px`,l.style.top=`${i?i.y:0}px`,l.style.width=`${i?i.width:e}px`,l.style.height=`${i?i.height:n}px`):l.style.display="none"}}onRedraw({viewports:e,layers:n}){var i,s;const r=e.reduce((l,c)=>(l[c.id]=c,l),{});for(const l of this.getWidgets()){const{viewId:c}=l;if(c){const f=r[c];f&&(l.onViewportChange&&l.onViewportChange(f),(i=l.onRedraw)==null||i.call(l,{viewports:[f],layers:n}))}else{if(l.onViewportChange)for(const f of e)l.onViewportChange(f);(s=l.onRedraw)==null||s.call(l,{viewports:e,layers:n})}}this.lastViewports=r,this._updateContainers()}onHover(e,n){var r,i;for(const s of this.getWidgets()){const{viewId:l}=s;(!l||l===((r=e.viewport)==null?void 0:r.id))&&((i=s.onHover)==null||i.call(s,e,n))}}onEvent(e,n){var i,s;const r=my[n.type];if(r)for(const l of this.getWidgets()){const{viewId:c}=l;(!c||c===((i=e.viewport)==null?void 0:i.id))&&((s=l[r])==null||s.call(l,e,n))}}}const EY={zIndex:"1",position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:"0",left:"0",display:"none"};class TY{constructor(){this.id="default-tooltip",this.placement="fill",this.props={},this.isVisible=!1}onAdd({deck:e}){const n=document.createElement("div");return n.className="deck-tooltip",Object.assign(n.style,EY),this.deck=e,this.element=n,n}onRemove(){this.deck=void 0,this.element=void 0}setProps(){}onViewportChange(e){var n;this.isVisible&&e.id===((n=this.lastViewport)==null?void 0:n.id)&&e!==this.lastViewport&&this.setTooltip(null)}onHover(e){const{deck:n}=this,r=n&&n.props.getTooltip;if(!r)return;const i=r(e);this.lastViewport=e.viewport,this.setTooltip(i,e.x,e.y)}setTooltip(e,n,r){const i=this.element;if(i){if(typeof e=="string")i.innerText=e;else if(e)e.text&&(i.innerText=e.text),e.html&&(i.innerHTML=e.html),e.className&&(i.className=e.className);else{this.isVisible=!1,i.style.display="none";return}this.isVisible=!0,i.style.display="block",i.style.transform=`translate(${n}px, ${r}px)`,e&&typeof e=="object"&&"style"in e&&Object.assign(i.style,e.style)}}}var Gl;(function(t){t[t.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",t[t.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",t[t.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN",t[t.ZERO=0]="ZERO",t[t.ONE=1]="ONE",t[t.SRC_COLOR=768]="SRC_COLOR",t[t.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",t[t.SRC_ALPHA=770]="SRC_ALPHA",t[t.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",t[t.DST_ALPHA=772]="DST_ALPHA",t[t.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",t[t.DST_COLOR=774]="DST_COLOR",t[t.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",t[t.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",t[t.CONSTANT_COLOR=32769]="CONSTANT_COLOR",t[t.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",t[t.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",t[t.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",t[t.FUNC_ADD=32774]="FUNC_ADD",t[t.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",t[t.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",t[t.BLEND_EQUATION=32777]="BLEND_EQUATION",t[t.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",t[t.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",t[t.BLEND_DST_RGB=32968]="BLEND_DST_RGB",t[t.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",t[t.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",t[t.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",t[t.BLEND_COLOR=32773]="BLEND_COLOR",t[t.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",t[t.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",t[t.LINE_WIDTH=2849]="LINE_WIDTH",t[t.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",t[t.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",t[t.CULL_FACE_MODE=2885]="CULL_FACE_MODE",t[t.FRONT_FACE=2886]="FRONT_FACE",t[t.DEPTH_RANGE=2928]="DEPTH_RANGE",t[t.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",t[t.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",t[t.DEPTH_FUNC=2932]="DEPTH_FUNC",t[t.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",t[t.STENCIL_FUNC=2962]="STENCIL_FUNC",t[t.STENCIL_FAIL=2964]="STENCIL_FAIL",t[t.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",t[t.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",t[t.STENCIL_REF=2967]="STENCIL_REF",t[t.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",t[t.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",t[t.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",t[t.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",t[t.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",t[t.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",t[t.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",t[t.VIEWPORT=2978]="VIEWPORT",t[t.SCISSOR_BOX=3088]="SCISSOR_BOX",t[t.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",t[t.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",t[t.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",t[t.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",t[t.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",t[t.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",t[t.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",t[t.RED_BITS=3410]="RED_BITS",t[t.GREEN_BITS=3411]="GREEN_BITS",t[t.BLUE_BITS=3412]="BLUE_BITS",t[t.ALPHA_BITS=3413]="ALPHA_BITS",t[t.DEPTH_BITS=3414]="DEPTH_BITS",t[t.STENCIL_BITS=3415]="STENCIL_BITS",t[t.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",t[t.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",t[t.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",t[t.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",t[t.SAMPLES=32937]="SAMPLES",t[t.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",t[t.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",t[t.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",t[t.VENDOR=7936]="VENDOR",t[t.RENDERER=7937]="RENDERER",t[t.VERSION=7938]="VERSION",t[t.IMPLEMENTATION_COLOR_READ_TYPE=35738]="IMPLEMENTATION_COLOR_READ_TYPE",t[t.IMPLEMENTATION_COLOR_READ_FORMAT=35739]="IMPLEMENTATION_COLOR_READ_FORMAT",t[t.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL",t[t.STATIC_DRAW=35044]="STATIC_DRAW",t[t.STREAM_DRAW=35040]="STREAM_DRAW",t[t.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.BUFFER_SIZE=34660]="BUFFER_SIZE",t[t.BUFFER_USAGE=34661]="BUFFER_USAGE",t[t.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",t[t.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",t[t.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",t[t.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",t[t.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",t[t.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",t[t.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",t[t.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",t[t.CULL_FACE=2884]="CULL_FACE",t[t.FRONT=1028]="FRONT",t[t.BACK=1029]="BACK",t[t.FRONT_AND_BACK=1032]="FRONT_AND_BACK",t[t.BLEND=3042]="BLEND",t[t.DEPTH_TEST=2929]="DEPTH_TEST",t[t.DITHER=3024]="DITHER",t[t.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",t[t.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",t[t.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",t[t.SCISSOR_TEST=3089]="SCISSOR_TEST",t[t.STENCIL_TEST=2960]="STENCIL_TEST",t[t.NO_ERROR=0]="NO_ERROR",t[t.INVALID_ENUM=1280]="INVALID_ENUM",t[t.INVALID_VALUE=1281]="INVALID_VALUE",t[t.INVALID_OPERATION=1282]="INVALID_OPERATION",t[t.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",t[t.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",t[t.CW=2304]="CW",t[t.CCW=2305]="CCW",t[t.DONT_CARE=4352]="DONT_CARE",t[t.FASTEST=4353]="FASTEST",t[t.NICEST=4354]="NICEST",t[t.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",t[t.BYTE=5120]="BYTE",t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.SHORT=5122]="SHORT",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.INT=5124]="INT",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.FLOAT=5126]="FLOAT",t[t.DOUBLE=5130]="DOUBLE",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.ALPHA=6406]="ALPHA",t[t.RGB=6407]="RGB",t[t.RGBA=6408]="RGBA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",t[t.VERTEX_SHADER=35633]="VERTEX_SHADER",t[t.COMPILE_STATUS=35713]="COMPILE_STATUS",t[t.DELETE_STATUS=35712]="DELETE_STATUS",t[t.LINK_STATUS=35714]="LINK_STATUS",t[t.VALIDATE_STATUS=35715]="VALIDATE_STATUS",t[t.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",t[t.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",t[t.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",t[t.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",t[t.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",t[t.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",t[t.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",t[t.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",t[t.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",t[t.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",t[t.SHADER_TYPE=35663]="SHADER_TYPE",t[t.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",t[t.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",t[t.NEVER=512]="NEVER",t[t.LESS=513]="LESS",t[t.EQUAL=514]="EQUAL",t[t.LEQUAL=515]="LEQUAL",t[t.GREATER=516]="GREATER",t[t.NOTEQUAL=517]="NOTEQUAL",t[t.GEQUAL=518]="GEQUAL",t[t.ALWAYS=519]="ALWAYS",t[t.KEEP=7680]="KEEP",t[t.REPLACE=7681]="REPLACE",t[t.INCR=7682]="INCR",t[t.DECR=7683]="DECR",t[t.INVERT=5386]="INVERT",t[t.INCR_WRAP=34055]="INCR_WRAP",t[t.DECR_WRAP=34056]="DECR_WRAP",t[t.NEAREST=9728]="NEAREST",t[t.LINEAR=9729]="LINEAR",t[t.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",t[t.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",t[t.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",t[t.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",t[t.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",t[t.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",t[t.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",t[t.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE=5890]="TEXTURE",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t[t.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",t[t.TEXTURE0=33984]="TEXTURE0",t[t.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",t[t.REPEAT=10497]="REPEAT",t[t.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",t[t.TEXTURE_WIDTH=4096]="TEXTURE_WIDTH",t[t.TEXTURE_HEIGHT=4097]="TEXTURE_HEIGHT",t[t.FLOAT_VEC2=35664]="FLOAT_VEC2",t[t.FLOAT_VEC3=35665]="FLOAT_VEC3",t[t.FLOAT_VEC4=35666]="FLOAT_VEC4",t[t.INT_VEC2=35667]="INT_VEC2",t[t.INT_VEC3=35668]="INT_VEC3",t[t.INT_VEC4=35669]="INT_VEC4",t[t.BOOL=35670]="BOOL",t[t.BOOL_VEC2=35671]="BOOL_VEC2",t[t.BOOL_VEC3=35672]="BOOL_VEC3",t[t.BOOL_VEC4=35673]="BOOL_VEC4",t[t.FLOAT_MAT2=35674]="FLOAT_MAT2",t[t.FLOAT_MAT3=35675]="FLOAT_MAT3",t[t.FLOAT_MAT4=35676]="FLOAT_MAT4",t[t.SAMPLER_2D=35678]="SAMPLER_2D",t[t.SAMPLER_CUBE=35680]="SAMPLER_CUBE",t[t.LOW_FLOAT=36336]="LOW_FLOAT",t[t.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",t[t.HIGH_FLOAT=36338]="HIGH_FLOAT",t[t.LOW_INT=36339]="LOW_INT",t[t.MEDIUM_INT=36340]="MEDIUM_INT",t[t.HIGH_INT=36341]="HIGH_INT",t[t.FRAMEBUFFER=36160]="FRAMEBUFFER",t[t.RENDERBUFFER=36161]="RENDERBUFFER",t[t.RGBA4=32854]="RGBA4",t[t.RGB5_A1=32855]="RGB5_A1",t[t.RGB565=36194]="RGB565",t[t.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",t[t.STENCIL_INDEX=6401]="STENCIL_INDEX",t[t.STENCIL_INDEX8=36168]="STENCIL_INDEX8",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t[t.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",t[t.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",t[t.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",t[t.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",t[t.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",t[t.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",t[t.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",t[t.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",t[t.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",t[t.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",t[t.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",t[t.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",t[t.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",t[t.NONE=0]="NONE",t[t.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",t[t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",t[t.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",t[t.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",t[t.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",t[t.READ_FRAMEBUFFER=36008]="READ_FRAMEBUFFER",t[t.DRAW_FRAMEBUFFER=36009]="DRAW_FRAMEBUFFER",t[t.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",t[t.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",t[t.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",t[t.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",t[t.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",t[t.READ_BUFFER=3074]="READ_BUFFER",t[t.UNPACK_ROW_LENGTH=3314]="UNPACK_ROW_LENGTH",t[t.UNPACK_SKIP_ROWS=3315]="UNPACK_SKIP_ROWS",t[t.UNPACK_SKIP_PIXELS=3316]="UNPACK_SKIP_PIXELS",t[t.PACK_ROW_LENGTH=3330]="PACK_ROW_LENGTH",t[t.PACK_SKIP_ROWS=3331]="PACK_SKIP_ROWS",t[t.PACK_SKIP_PIXELS=3332]="PACK_SKIP_PIXELS",t[t.TEXTURE_BINDING_3D=32874]="TEXTURE_BINDING_3D",t[t.UNPACK_SKIP_IMAGES=32877]="UNPACK_SKIP_IMAGES",t[t.UNPACK_IMAGE_HEIGHT=32878]="UNPACK_IMAGE_HEIGHT",t[t.MAX_3D_TEXTURE_SIZE=32883]="MAX_3D_TEXTURE_SIZE",t[t.MAX_ELEMENTS_VERTICES=33e3]="MAX_ELEMENTS_VERTICES",t[t.MAX_ELEMENTS_INDICES=33001]="MAX_ELEMENTS_INDICES",t[t.MAX_TEXTURE_LOD_BIAS=34045]="MAX_TEXTURE_LOD_BIAS",t[t.MAX_FRAGMENT_UNIFORM_COMPONENTS=35657]="MAX_FRAGMENT_UNIFORM_COMPONENTS",t[t.MAX_VERTEX_UNIFORM_COMPONENTS=35658]="MAX_VERTEX_UNIFORM_COMPONENTS",t[t.MAX_ARRAY_TEXTURE_LAYERS=35071]="MAX_ARRAY_TEXTURE_LAYERS",t[t.MIN_PROGRAM_TEXEL_OFFSET=35076]="MIN_PROGRAM_TEXEL_OFFSET",t[t.MAX_PROGRAM_TEXEL_OFFSET=35077]="MAX_PROGRAM_TEXEL_OFFSET",t[t.MAX_VARYING_COMPONENTS=35659]="MAX_VARYING_COMPONENTS",t[t.FRAGMENT_SHADER_DERIVATIVE_HINT=35723]="FRAGMENT_SHADER_DERIVATIVE_HINT",t[t.RASTERIZER_DISCARD=35977]="RASTERIZER_DISCARD",t[t.VERTEX_ARRAY_BINDING=34229]="VERTEX_ARRAY_BINDING",t[t.MAX_VERTEX_OUTPUT_COMPONENTS=37154]="MAX_VERTEX_OUTPUT_COMPONENTS",t[t.MAX_FRAGMENT_INPUT_COMPONENTS=37157]="MAX_FRAGMENT_INPUT_COMPONENTS",t[t.MAX_SERVER_WAIT_TIMEOUT=37137]="MAX_SERVER_WAIT_TIMEOUT",t[t.MAX_ELEMENT_INDEX=36203]="MAX_ELEMENT_INDEX",t[t.RED=6403]="RED",t[t.RGB8=32849]="RGB8",t[t.RGBA8=32856]="RGBA8",t[t.RGB10_A2=32857]="RGB10_A2",t[t.TEXTURE_3D=32879]="TEXTURE_3D",t[t.TEXTURE_WRAP_R=32882]="TEXTURE_WRAP_R",t[t.TEXTURE_MIN_LOD=33082]="TEXTURE_MIN_LOD",t[t.TEXTURE_MAX_LOD=33083]="TEXTURE_MAX_LOD",t[t.TEXTURE_BASE_LEVEL=33084]="TEXTURE_BASE_LEVEL",t[t.TEXTURE_MAX_LEVEL=33085]="TEXTURE_MAX_LEVEL",t[t.TEXTURE_COMPARE_MODE=34892]="TEXTURE_COMPARE_MODE",t[t.TEXTURE_COMPARE_FUNC=34893]="TEXTURE_COMPARE_FUNC",t[t.SRGB=35904]="SRGB",t[t.SRGB8=35905]="SRGB8",t[t.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8",t[t.COMPARE_REF_TO_TEXTURE=34894]="COMPARE_REF_TO_TEXTURE",t[t.RGBA32F=34836]="RGBA32F",t[t.RGB32F=34837]="RGB32F",t[t.RGBA16F=34842]="RGBA16F",t[t.RGB16F=34843]="RGB16F",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_BINDING_2D_ARRAY=35869]="TEXTURE_BINDING_2D_ARRAY",t[t.R11F_G11F_B10F=35898]="R11F_G11F_B10F",t[t.RGB9_E5=35901]="RGB9_E5",t[t.RGBA32UI=36208]="RGBA32UI",t[t.RGB32UI=36209]="RGB32UI",t[t.RGBA16UI=36214]="RGBA16UI",t[t.RGB16UI=36215]="RGB16UI",t[t.RGBA8UI=36220]="RGBA8UI",t[t.RGB8UI=36221]="RGB8UI",t[t.RGBA32I=36226]="RGBA32I",t[t.RGB32I=36227]="RGB32I",t[t.RGBA16I=36232]="RGBA16I",t[t.RGB16I=36233]="RGB16I",t[t.RGBA8I=36238]="RGBA8I",t[t.RGB8I=36239]="RGB8I",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.R8=33321]="R8",t[t.RG8=33323]="RG8",t[t.R16F=33325]="R16F",t[t.R32F=33326]="R32F",t[t.RG16F=33327]="RG16F",t[t.RG32F=33328]="RG32F",t[t.R8I=33329]="R8I",t[t.R8UI=33330]="R8UI",t[t.R16I=33331]="R16I",t[t.R16UI=33332]="R16UI",t[t.R32I=33333]="R32I",t[t.R32UI=33334]="R32UI",t[t.RG8I=33335]="RG8I",t[t.RG8UI=33336]="RG8UI",t[t.RG16I=33337]="RG16I",t[t.RG16UI=33338]="RG16UI",t[t.RG32I=33339]="RG32I",t[t.RG32UI=33340]="RG32UI",t[t.R8_SNORM=36756]="R8_SNORM",t[t.RG8_SNORM=36757]="RG8_SNORM",t[t.RGB8_SNORM=36758]="RGB8_SNORM",t[t.RGBA8_SNORM=36759]="RGBA8_SNORM",t[t.RGB10_A2UI=36975]="RGB10_A2UI",t[t.TEXTURE_IMMUTABLE_FORMAT=37167]="TEXTURE_IMMUTABLE_FORMAT",t[t.TEXTURE_IMMUTABLE_LEVELS=33503]="TEXTURE_IMMUTABLE_LEVELS",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.HALF_FLOAT=5131]="HALF_FLOAT",t[t.RG=33319]="RG",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.INT_2_10_10_10_REV=36255]="INT_2_10_10_10_REV",t[t.CURRENT_QUERY=34917]="CURRENT_QUERY",t[t.QUERY_RESULT=34918]="QUERY_RESULT",t[t.QUERY_RESULT_AVAILABLE=34919]="QUERY_RESULT_AVAILABLE",t[t.ANY_SAMPLES_PASSED=35887]="ANY_SAMPLES_PASSED",t[t.ANY_SAMPLES_PASSED_CONSERVATIVE=36202]="ANY_SAMPLES_PASSED_CONSERVATIVE",t[t.MAX_DRAW_BUFFERS=34852]="MAX_DRAW_BUFFERS",t[t.DRAW_BUFFER0=34853]="DRAW_BUFFER0",t[t.DRAW_BUFFER1=34854]="DRAW_BUFFER1",t[t.DRAW_BUFFER2=34855]="DRAW_BUFFER2",t[t.DRAW_BUFFER3=34856]="DRAW_BUFFER3",t[t.DRAW_BUFFER4=34857]="DRAW_BUFFER4",t[t.DRAW_BUFFER5=34858]="DRAW_BUFFER5",t[t.DRAW_BUFFER6=34859]="DRAW_BUFFER6",t[t.DRAW_BUFFER7=34860]="DRAW_BUFFER7",t[t.DRAW_BUFFER8=34861]="DRAW_BUFFER8",t[t.DRAW_BUFFER9=34862]="DRAW_BUFFER9",t[t.DRAW_BUFFER10=34863]="DRAW_BUFFER10",t[t.DRAW_BUFFER11=34864]="DRAW_BUFFER11",t[t.DRAW_BUFFER12=34865]="DRAW_BUFFER12",t[t.DRAW_BUFFER13=34866]="DRAW_BUFFER13",t[t.DRAW_BUFFER14=34867]="DRAW_BUFFER14",t[t.DRAW_BUFFER15=34868]="DRAW_BUFFER15",t[t.MAX_COLOR_ATTACHMENTS=36063]="MAX_COLOR_ATTACHMENTS",t[t.COLOR_ATTACHMENT1=36065]="COLOR_ATTACHMENT1",t[t.COLOR_ATTACHMENT2=36066]="COLOR_ATTACHMENT2",t[t.COLOR_ATTACHMENT3=36067]="COLOR_ATTACHMENT3",t[t.COLOR_ATTACHMENT4=36068]="COLOR_ATTACHMENT4",t[t.COLOR_ATTACHMENT5=36069]="COLOR_ATTACHMENT5",t[t.COLOR_ATTACHMENT6=36070]="COLOR_ATTACHMENT6",t[t.COLOR_ATTACHMENT7=36071]="COLOR_ATTACHMENT7",t[t.COLOR_ATTACHMENT8=36072]="COLOR_ATTACHMENT8",t[t.COLOR_ATTACHMENT9=36073]="COLOR_ATTACHMENT9",t[t.COLOR_ATTACHMENT10=36074]="COLOR_ATTACHMENT10",t[t.COLOR_ATTACHMENT11=36075]="COLOR_ATTACHMENT11",t[t.COLOR_ATTACHMENT12=36076]="COLOR_ATTACHMENT12",t[t.COLOR_ATTACHMENT13=36077]="COLOR_ATTACHMENT13",t[t.COLOR_ATTACHMENT14=36078]="COLOR_ATTACHMENT14",t[t.COLOR_ATTACHMENT15=36079]="COLOR_ATTACHMENT15",t[t.SAMPLER_3D=35679]="SAMPLER_3D",t[t.SAMPLER_2D_SHADOW=35682]="SAMPLER_2D_SHADOW",t[t.SAMPLER_2D_ARRAY=36289]="SAMPLER_2D_ARRAY",t[t.SAMPLER_2D_ARRAY_SHADOW=36292]="SAMPLER_2D_ARRAY_SHADOW",t[t.SAMPLER_CUBE_SHADOW=36293]="SAMPLER_CUBE_SHADOW",t[t.INT_SAMPLER_2D=36298]="INT_SAMPLER_2D",t[t.INT_SAMPLER_3D=36299]="INT_SAMPLER_3D",t[t.INT_SAMPLER_CUBE=36300]="INT_SAMPLER_CUBE",t[t.INT_SAMPLER_2D_ARRAY=36303]="INT_SAMPLER_2D_ARRAY",t[t.UNSIGNED_INT_SAMPLER_2D=36306]="UNSIGNED_INT_SAMPLER_2D",t[t.UNSIGNED_INT_SAMPLER_3D=36307]="UNSIGNED_INT_SAMPLER_3D",t[t.UNSIGNED_INT_SAMPLER_CUBE=36308]="UNSIGNED_INT_SAMPLER_CUBE",t[t.UNSIGNED_INT_SAMPLER_2D_ARRAY=36311]="UNSIGNED_INT_SAMPLER_2D_ARRAY",t[t.MAX_SAMPLES=36183]="MAX_SAMPLES",t[t.SAMPLER_BINDING=35097]="SAMPLER_BINDING",t[t.PIXEL_PACK_BUFFER=35051]="PIXEL_PACK_BUFFER",t[t.PIXEL_UNPACK_BUFFER=35052]="PIXEL_UNPACK_BUFFER",t[t.PIXEL_PACK_BUFFER_BINDING=35053]="PIXEL_PACK_BUFFER_BINDING",t[t.PIXEL_UNPACK_BUFFER_BINDING=35055]="PIXEL_UNPACK_BUFFER_BINDING",t[t.COPY_READ_BUFFER=36662]="COPY_READ_BUFFER",t[t.COPY_WRITE_BUFFER=36663]="COPY_WRITE_BUFFER",t[t.COPY_READ_BUFFER_BINDING=36662]="COPY_READ_BUFFER_BINDING",t[t.COPY_WRITE_BUFFER_BINDING=36663]="COPY_WRITE_BUFFER_BINDING",t[t.FLOAT_MAT2x3=35685]="FLOAT_MAT2x3",t[t.FLOAT_MAT2x4=35686]="FLOAT_MAT2x4",t[t.FLOAT_MAT3x2=35687]="FLOAT_MAT3x2",t[t.FLOAT_MAT3x4=35688]="FLOAT_MAT3x4",t[t.FLOAT_MAT4x2=35689]="FLOAT_MAT4x2",t[t.FLOAT_MAT4x3=35690]="FLOAT_MAT4x3",t[t.UNSIGNED_INT_VEC2=36294]="UNSIGNED_INT_VEC2",t[t.UNSIGNED_INT_VEC3=36295]="UNSIGNED_INT_VEC3",t[t.UNSIGNED_INT_VEC4=36296]="UNSIGNED_INT_VEC4",t[t.UNSIGNED_NORMALIZED=35863]="UNSIGNED_NORMALIZED",t[t.SIGNED_NORMALIZED=36764]="SIGNED_NORMALIZED",t[t.VERTEX_ATTRIB_ARRAY_INTEGER=35069]="VERTEX_ATTRIB_ARRAY_INTEGER",t[t.VERTEX_ATTRIB_ARRAY_DIVISOR=35070]="VERTEX_ATTRIB_ARRAY_DIVISOR",t[t.TRANSFORM_FEEDBACK_BUFFER_MODE=35967]="TRANSFORM_FEEDBACK_BUFFER_MODE",t[t.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS=35968]="MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS",t[t.TRANSFORM_FEEDBACK_VARYINGS=35971]="TRANSFORM_FEEDBACK_VARYINGS",t[t.TRANSFORM_FEEDBACK_BUFFER_START=35972]="TRANSFORM_FEEDBACK_BUFFER_START",t[t.TRANSFORM_FEEDBACK_BUFFER_SIZE=35973]="TRANSFORM_FEEDBACK_BUFFER_SIZE",t[t.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN=35976]="TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN",t[t.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS=35978]="MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS",t[t.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS=35979]="MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS",t[t.INTERLEAVED_ATTRIBS=35980]="INTERLEAVED_ATTRIBS",t[t.SEPARATE_ATTRIBS=35981]="SEPARATE_ATTRIBS",t[t.TRANSFORM_FEEDBACK_BUFFER=35982]="TRANSFORM_FEEDBACK_BUFFER",t[t.TRANSFORM_FEEDBACK_BUFFER_BINDING=35983]="TRANSFORM_FEEDBACK_BUFFER_BINDING",t[t.TRANSFORM_FEEDBACK=36386]="TRANSFORM_FEEDBACK",t[t.TRANSFORM_FEEDBACK_PAUSED=36387]="TRANSFORM_FEEDBACK_PAUSED",t[t.TRANSFORM_FEEDBACK_ACTIVE=36388]="TRANSFORM_FEEDBACK_ACTIVE",t[t.TRANSFORM_FEEDBACK_BINDING=36389]="TRANSFORM_FEEDBACK_BINDING",t[t.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING=33296]="FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING",t[t.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE=33297]="FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE",t[t.FRAMEBUFFER_ATTACHMENT_RED_SIZE=33298]="FRAMEBUFFER_ATTACHMENT_RED_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE=33299]="FRAMEBUFFER_ATTACHMENT_GREEN_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE=33300]="FRAMEBUFFER_ATTACHMENT_BLUE_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE=33301]="FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE=33302]="FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE=33303]="FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE",t[t.FRAMEBUFFER_DEFAULT=33304]="FRAMEBUFFER_DEFAULT",t[t.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8",t[t.DRAW_FRAMEBUFFER_BINDING=36006]="DRAW_FRAMEBUFFER_BINDING",t[t.READ_FRAMEBUFFER_BINDING=36010]="READ_FRAMEBUFFER_BINDING",t[t.RENDERBUFFER_SAMPLES=36011]="RENDERBUFFER_SAMPLES",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER=36052]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER",t[t.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE=36182]="FRAMEBUFFER_INCOMPLETE_MULTISAMPLE",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t[t.UNIFORM_BUFFER_BINDING=35368]="UNIFORM_BUFFER_BINDING",t[t.UNIFORM_BUFFER_START=35369]="UNIFORM_BUFFER_START",t[t.UNIFORM_BUFFER_SIZE=35370]="UNIFORM_BUFFER_SIZE",t[t.MAX_VERTEX_UNIFORM_BLOCKS=35371]="MAX_VERTEX_UNIFORM_BLOCKS",t[t.MAX_FRAGMENT_UNIFORM_BLOCKS=35373]="MAX_FRAGMENT_UNIFORM_BLOCKS",t[t.MAX_COMBINED_UNIFORM_BLOCKS=35374]="MAX_COMBINED_UNIFORM_BLOCKS",t[t.MAX_UNIFORM_BUFFER_BINDINGS=35375]="MAX_UNIFORM_BUFFER_BINDINGS",t[t.MAX_UNIFORM_BLOCK_SIZE=35376]="MAX_UNIFORM_BLOCK_SIZE",t[t.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS=35377]="MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS",t[t.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS=35379]="MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS",t[t.UNIFORM_BUFFER_OFFSET_ALIGNMENT=35380]="UNIFORM_BUFFER_OFFSET_ALIGNMENT",t[t.ACTIVE_UNIFORM_BLOCKS=35382]="ACTIVE_UNIFORM_BLOCKS",t[t.UNIFORM_TYPE=35383]="UNIFORM_TYPE",t[t.UNIFORM_SIZE=35384]="UNIFORM_SIZE",t[t.UNIFORM_BLOCK_INDEX=35386]="UNIFORM_BLOCK_INDEX",t[t.UNIFORM_OFFSET=35387]="UNIFORM_OFFSET",t[t.UNIFORM_ARRAY_STRIDE=35388]="UNIFORM_ARRAY_STRIDE",t[t.UNIFORM_MATRIX_STRIDE=35389]="UNIFORM_MATRIX_STRIDE",t[t.UNIFORM_IS_ROW_MAJOR=35390]="UNIFORM_IS_ROW_MAJOR",t[t.UNIFORM_BLOCK_BINDING=35391]="UNIFORM_BLOCK_BINDING",t[t.UNIFORM_BLOCK_DATA_SIZE=35392]="UNIFORM_BLOCK_DATA_SIZE",t[t.UNIFORM_BLOCK_ACTIVE_UNIFORMS=35394]="UNIFORM_BLOCK_ACTIVE_UNIFORMS",t[t.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES=35395]="UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES",t[t.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER=35396]="UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER",t[t.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER=35398]="UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER",t[t.OBJECT_TYPE=37138]="OBJECT_TYPE",t[t.SYNC_CONDITION=37139]="SYNC_CONDITION",t[t.SYNC_STATUS=37140]="SYNC_STATUS",t[t.SYNC_FLAGS=37141]="SYNC_FLAGS",t[t.SYNC_FENCE=37142]="SYNC_FENCE",t[t.SYNC_GPU_COMMANDS_COMPLETE=37143]="SYNC_GPU_COMMANDS_COMPLETE",t[t.UNSIGNALED=37144]="UNSIGNALED",t[t.SIGNALED=37145]="SIGNALED",t[t.ALREADY_SIGNALED=37146]="ALREADY_SIGNALED",t[t.TIMEOUT_EXPIRED=37147]="TIMEOUT_EXPIRED",t[t.CONDITION_SATISFIED=37148]="CONDITION_SATISFIED",t[t.WAIT_FAILED=37149]="WAIT_FAILED",t[t.SYNC_FLUSH_COMMANDS_BIT=1]="SYNC_FLUSH_COMMANDS_BIT",t[t.COLOR=6144]="COLOR",t[t.DEPTH=6145]="DEPTH",t[t.STENCIL=6146]="STENCIL",t[t.MIN=32775]="MIN",t[t.MAX=32776]="MAX",t[t.DEPTH_COMPONENT24=33190]="DEPTH_COMPONENT24",t[t.STREAM_READ=35041]="STREAM_READ",t[t.STREAM_COPY=35042]="STREAM_COPY",t[t.STATIC_READ=35045]="STATIC_READ",t[t.STATIC_COPY=35046]="STATIC_COPY",t[t.DYNAMIC_READ=35049]="DYNAMIC_READ",t[t.DYNAMIC_COPY=35050]="DYNAMIC_COPY",t[t.DEPTH_COMPONENT32F=36012]="DEPTH_COMPONENT32F",t[t.DEPTH32F_STENCIL8=36013]="DEPTH32F_STENCIL8",t[t.INVALID_INDEX=4294967295]="INVALID_INDEX",t[t.TIMEOUT_IGNORED=-1]="TIMEOUT_IGNORED",t[t.MAX_CLIENT_WAIT_TIMEOUT_WEBGL=37447]="MAX_CLIENT_WAIT_TIMEOUT_WEBGL",t[t.UNMASKED_VENDOR_WEBGL=37445]="UNMASKED_VENDOR_WEBGL",t[t.UNMASKED_RENDERER_WEBGL=37446]="UNMASKED_RENDERER_WEBGL",t[t.MAX_TEXTURE_MAX_ANISOTROPY_EXT=34047]="MAX_TEXTURE_MAX_ANISOTROPY_EXT",t[t.TEXTURE_MAX_ANISOTROPY_EXT=34046]="TEXTURE_MAX_ANISOTROPY_EXT",t[t.R16_EXT=33322]="R16_EXT",t[t.RG16_EXT=33324]="RG16_EXT",t[t.RGB16_EXT=32852]="RGB16_EXT",t[t.RGBA16_EXT=32859]="RGBA16_EXT",t[t.R16_SNORM_EXT=36760]="R16_SNORM_EXT",t[t.RG16_SNORM_EXT=36761]="RG16_SNORM_EXT",t[t.RGB16_SNORM_EXT=36762]="RGB16_SNORM_EXT",t[t.RGBA16_SNORM_EXT=36763]="RGBA16_SNORM_EXT",t[t.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",t[t.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",t[t.COMPRESSED_RED_RGTC1_EXT=36283]="COMPRESSED_RED_RGTC1_EXT",t[t.COMPRESSED_SIGNED_RED_RGTC1_EXT=36284]="COMPRESSED_SIGNED_RED_RGTC1_EXT",t[t.COMPRESSED_RED_GREEN_RGTC2_EXT=36285]="COMPRESSED_RED_GREEN_RGTC2_EXT",t[t.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT=36286]="COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT",t[t.COMPRESSED_RGBA_BPTC_UNORM_EXT=36492]="COMPRESSED_RGBA_BPTC_UNORM_EXT",t[t.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=36493]="COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT",t[t.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT=36494]="COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT",t[t.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT=36495]="COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT",t[t.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",t[t.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",t[t.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",t[t.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",t[t.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",t[t.COMPRESSED_RGBA8_ETC2_EAC=37493]="COMPRESSED_RGBA8_ETC2_EAC",t[t.COMPRESSED_SRGB8_ETC2=37494]="COMPRESSED_SRGB8_ETC2",t[t.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37495]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",t[t.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37496]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37497]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",t[t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",t[t.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",t[t.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",t[t.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35986]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",t[t.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",t[t.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR",t[t.COMPRESSED_RGBA_ASTC_5x4_KHR=37809]="COMPRESSED_RGBA_ASTC_5x4_KHR",t[t.COMPRESSED_RGBA_ASTC_5x5_KHR=37810]="COMPRESSED_RGBA_ASTC_5x5_KHR",t[t.COMPRESSED_RGBA_ASTC_6x5_KHR=37811]="COMPRESSED_RGBA_ASTC_6x5_KHR",t[t.COMPRESSED_RGBA_ASTC_6x6_KHR=37812]="COMPRESSED_RGBA_ASTC_6x6_KHR",t[t.COMPRESSED_RGBA_ASTC_8x5_KHR=37813]="COMPRESSED_RGBA_ASTC_8x5_KHR",t[t.COMPRESSED_RGBA_ASTC_8x6_KHR=37814]="COMPRESSED_RGBA_ASTC_8x6_KHR",t[t.COMPRESSED_RGBA_ASTC_8x8_KHR=37815]="COMPRESSED_RGBA_ASTC_8x8_KHR",t[t.COMPRESSED_RGBA_ASTC_10x5_KHR=37816]="COMPRESSED_RGBA_ASTC_10x5_KHR",t[t.COMPRESSED_RGBA_ASTC_10x6_KHR=37817]="COMPRESSED_RGBA_ASTC_10x6_KHR",t[t.COMPRESSED_RGBA_ASTC_10x8_KHR=37818]="COMPRESSED_RGBA_ASTC_10x8_KHR",t[t.COMPRESSED_RGBA_ASTC_10x10_KHR=37819]="COMPRESSED_RGBA_ASTC_10x10_KHR",t[t.COMPRESSED_RGBA_ASTC_12x10_KHR=37820]="COMPRESSED_RGBA_ASTC_12x10_KHR",t[t.COMPRESSED_RGBA_ASTC_12x12_KHR=37821]="COMPRESSED_RGBA_ASTC_12x12_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR=37840]="COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR=37841]="COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR=37842]="COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR=37843]="COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR=37844]="COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR=37845]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR=37846]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR=37847]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR=37848]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR=37849]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR=37850]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR=37851]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR=37852]="COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR=37853]="COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR",t[t.QUERY_COUNTER_BITS_EXT=34916]="QUERY_COUNTER_BITS_EXT",t[t.CURRENT_QUERY_EXT=34917]="CURRENT_QUERY_EXT",t[t.QUERY_RESULT_EXT=34918]="QUERY_RESULT_EXT",t[t.QUERY_RESULT_AVAILABLE_EXT=34919]="QUERY_RESULT_AVAILABLE_EXT",t[t.TIME_ELAPSED_EXT=35007]="TIME_ELAPSED_EXT",t[t.TIMESTAMP_EXT=36392]="TIMESTAMP_EXT",t[t.GPU_DISJOINT_EXT=36795]="GPU_DISJOINT_EXT",t[t.COMPLETION_STATUS_KHR=37297]="COMPLETION_STATUS_KHR",t[t.DEPTH_CLAMP_EXT=34383]="DEPTH_CLAMP_EXT",t[t.FIRST_VERTEX_CONVENTION_WEBGL=36429]="FIRST_VERTEX_CONVENTION_WEBGL",t[t.LAST_VERTEX_CONVENTION_WEBGL=36430]="LAST_VERTEX_CONVENTION_WEBGL",t[t.PROVOKING_VERTEX_WEBL=36431]="PROVOKING_VERTEX_WEBL",t[t.POLYGON_MODE_WEBGL=2880]="POLYGON_MODE_WEBGL",t[t.POLYGON_OFFSET_LINE_WEBGL=10754]="POLYGON_OFFSET_LINE_WEBGL",t[t.LINE_WEBGL=6913]="LINE_WEBGL",t[t.FILL_WEBGL=6914]="FILL_WEBGL",t[t.MAX_CLIP_DISTANCES_WEBGL=3378]="MAX_CLIP_DISTANCES_WEBGL",t[t.MAX_CULL_DISTANCES_WEBGL=33529]="MAX_CULL_DISTANCES_WEBGL",t[t.MAX_COMBINED_CLIP_AND_CULL_DISTANCES_WEBGL=33530]="MAX_COMBINED_CLIP_AND_CULL_DISTANCES_WEBGL",t[t.CLIP_DISTANCE0_WEBGL=12288]="CLIP_DISTANCE0_WEBGL",t[t.CLIP_DISTANCE1_WEBGL=12289]="CLIP_DISTANCE1_WEBGL",t[t.CLIP_DISTANCE2_WEBGL=12290]="CLIP_DISTANCE2_WEBGL",t[t.CLIP_DISTANCE3_WEBGL=12291]="CLIP_DISTANCE3_WEBGL",t[t.CLIP_DISTANCE4_WEBGL=12292]="CLIP_DISTANCE4_WEBGL",t[t.CLIP_DISTANCE5_WEBGL=12293]="CLIP_DISTANCE5_WEBGL",t[t.CLIP_DISTANCE6_WEBGL=12294]="CLIP_DISTANCE6_WEBGL",t[t.CLIP_DISTANCE7_WEBGL=12295]="CLIP_DISTANCE7_WEBGL",t[t.POLYGON_OFFSET_CLAMP_EXT=36379]="POLYGON_OFFSET_CLAMP_EXT",t[t.LOWER_LEFT_EXT=36001]="LOWER_LEFT_EXT",t[t.UPPER_LEFT_EXT=36002]="UPPER_LEFT_EXT",t[t.NEGATIVE_ONE_TO_ONE_EXT=37726]="NEGATIVE_ONE_TO_ONE_EXT",t[t.ZERO_TO_ONE_EXT=37727]="ZERO_TO_ONE_EXT",t[t.CLIP_ORIGIN_EXT=37724]="CLIP_ORIGIN_EXT",t[t.CLIP_DEPTH_MODE_EXT=37725]="CLIP_DEPTH_MODE_EXT",t[t.SRC1_COLOR_WEBGL=35065]="SRC1_COLOR_WEBGL",t[t.SRC1_ALPHA_WEBGL=34185]="SRC1_ALPHA_WEBGL",t[t.ONE_MINUS_SRC1_COLOR_WEBGL=35066]="ONE_MINUS_SRC1_COLOR_WEBGL",t[t.ONE_MINUS_SRC1_ALPHA_WEBGL=35067]="ONE_MINUS_SRC1_ALPHA_WEBGL",t[t.MAX_DUAL_SOURCE_DRAW_BUFFERS_WEBGL=35068]="MAX_DUAL_SOURCE_DRAW_BUFFERS_WEBGL",t[t.MIRROR_CLAMP_TO_EDGE_EXT=34627]="MIRROR_CLAMP_TO_EDGE_EXT"})(Gl||(Gl={}));const Fb={3042:!1,32773:new Float32Array([0,0,0,0]),32777:32774,34877:32774,32969:1,32968:0,32971:1,32970:0,3106:new Float32Array([0,0,0,0]),3107:[!0,!0,!0,!0],2884:!1,2885:1029,2929:!1,2931:1,2932:513,2928:new Float32Array([0,1]),2930:!0,3024:!0,35725:null,36006:null,36007:null,34229:null,34964:null,2886:2305,33170:4352,2849:1,32823:!1,32824:0,10752:0,32926:!1,32928:!1,32938:1,32939:!1,3089:!1,3088:new Int32Array([0,0,1024,1024]),2960:!1,2961:0,2968:4294967295,36005:4294967295,2962:519,2967:0,2963:4294967295,34816:519,36003:0,36004:4294967295,2964:7680,2965:7680,2966:7680,34817:7680,34818:7680,34819:7680,2978:[0,0,1024,1024],36389:null,36662:null,36663:null,35053:null,35055:null,35723:4352,36010:null,35977:!1,3333:4,3317:4,37440:!1,37441:!1,37443:37444,3330:0,3332:0,3331:0,3314:0,32878:0,3316:0,3315:0,32877:0},sr=(t,e,n)=>e?t.enable(n):t.disable(n),oC=(t,e,n)=>t.hint(n,e),oi=(t,e,n)=>t.pixelStorei(n,e),lC=(t,e,n)=>{const r=n===36006?36009:36008;return t.bindFramebuffer(r,e)},qu=(t,e,n)=>{const i={34964:34962,36662:36662,36663:36663,35053:35051,35055:35052}[n];t.bindBuffer(i,e)};function A0(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}const AY={3042:sr,32773:(t,e)=>t.blendColor(...e),32777:"blendEquation",34877:"blendEquation",32969:"blendFunc",32968:"blendFunc",32971:"blendFunc",32970:"blendFunc",3106:(t,e)=>t.clearColor(...e),3107:(t,e)=>t.colorMask(...e),2884:sr,2885:(t,e)=>t.cullFace(e),2929:sr,2931:(t,e)=>t.clearDepth(e),2932:(t,e)=>t.depthFunc(e),2928:(t,e)=>t.depthRange(...e),2930:(t,e)=>t.depthMask(e),3024:sr,35723:oC,35725:(t,e)=>t.useProgram(e),36007:(t,e)=>t.bindRenderbuffer(36161,e),36389:(t,e)=>{var n;return(n=t.bindTransformFeedback)==null?void 0:n.call(t,36386,e)},34229:(t,e)=>t.bindVertexArray(e),36006:lC,36010:lC,34964:qu,36662:qu,36663:qu,35053:qu,35055:qu,2886:(t,e)=>t.frontFace(e),33170:oC,2849:(t,e)=>t.lineWidth(e),32823:sr,32824:"polygonOffset",10752:"polygonOffset",35977:sr,32926:sr,32928:sr,32938:"sampleCoverage",32939:"sampleCoverage",3089:sr,3088:(t,e)=>t.scissor(...e),2960:sr,2961:(t,e)=>t.clearStencil(e),2968:(t,e)=>t.stencilMaskSeparate(1028,e),36005:(t,e)=>t.stencilMaskSeparate(1029,e),2962:"stencilFuncFront",2967:"stencilFuncFront",2963:"stencilFuncFront",34816:"stencilFuncBack",36003:"stencilFuncBack",36004:"stencilFuncBack",2964:"stencilOpFront",2965:"stencilOpFront",2966:"stencilOpFront",34817:"stencilOpBack",34818:"stencilOpBack",34819:"stencilOpBack",2978:(t,e)=>t.viewport(...e),34383:sr,10754:sr,12288:sr,12289:sr,12290:sr,12291:sr,12292:sr,12293:sr,12294:sr,12295:sr,3333:oi,3317:oi,37440:oi,37441:oi,37443:oi,3330:oi,3332:oi,3331:oi,3314:oi,32878:oi,3316:oi,3315:oi,32877:oi,framebuffer:(t,e)=>{const n=e&&"handle"in e?e.handle:e;return t.bindFramebuffer(36160,n)},blend:(t,e)=>e?t.enable(3042):t.disable(3042),blendColor:(t,e)=>t.blendColor(...e),blendEquation:(t,e)=>{const n=typeof e=="number"?[e,e]:e;t.blendEquationSeparate(...n)},blendFunc:(t,e)=>{const n=(e==null?void 0:e.length)===2?[...e,...e]:e;t.blendFuncSeparate(...n)},clearColor:(t,e)=>t.clearColor(...e),clearDepth:(t,e)=>t.clearDepth(e),clearStencil:(t,e)=>t.clearStencil(e),colorMask:(t,e)=>t.colorMask(...e),cull:(t,e)=>e?t.enable(2884):t.disable(2884),cullFace:(t,e)=>t.cullFace(e),depthTest:(t,e)=>e?t.enable(2929):t.disable(2929),depthFunc:(t,e)=>t.depthFunc(e),depthMask:(t,e)=>t.depthMask(e),depthRange:(t,e)=>t.depthRange(...e),dither:(t,e)=>e?t.enable(3024):t.disable(3024),derivativeHint:(t,e)=>{t.hint(35723,e)},frontFace:(t,e)=>t.frontFace(e),mipmapHint:(t,e)=>t.hint(33170,e),lineWidth:(t,e)=>t.lineWidth(e),polygonOffsetFill:(t,e)=>e?t.enable(32823):t.disable(32823),polygonOffset:(t,e)=>t.polygonOffset(...e),sampleCoverage:(t,e)=>t.sampleCoverage(e[0],e[1]||!1),scissorTest:(t,e)=>e?t.enable(3089):t.disable(3089),scissor:(t,e)=>t.scissor(...e),stencilTest:(t,e)=>e?t.enable(2960):t.disable(2960),stencilMask:(t,e)=>{e=A0(e)?e:[e,e];const[n,r]=e;t.stencilMaskSeparate(1028,n),t.stencilMaskSeparate(1029,r)},stencilFunc:(t,e)=>{e=A0(e)&&e.length===3?[...e,...e]:e;const[n,r,i,s,l,c]=e;t.stencilFuncSeparate(1028,n,r,i),t.stencilFuncSeparate(1029,s,l,c)},stencilOp:(t,e)=>{e=A0(e)&&e.length===3?[...e,...e]:e;const[n,r,i,s,l,c]=e;t.stencilOpSeparate(1028,n,r,i),t.stencilOpSeparate(1029,s,l,c)},viewport:(t,e)=>t.viewport(...e)};function qn(t,e,n){return e[t]!==void 0?e[t]:n[t]}const CY={blendEquation:(t,e,n)=>t.blendEquationSeparate(qn(32777,e,n),qn(34877,e,n)),blendFunc:(t,e,n)=>t.blendFuncSeparate(qn(32969,e,n),qn(32968,e,n),qn(32971,e,n),qn(32970,e,n)),polygonOffset:(t,e,n)=>t.polygonOffset(qn(32824,e,n),qn(10752,e,n)),sampleCoverage:(t,e,n)=>t.sampleCoverage(qn(32938,e,n),qn(32939,e,n)),stencilFuncFront:(t,e,n)=>t.stencilFuncSeparate(1028,qn(2962,e,n),qn(2967,e,n),qn(2963,e,n)),stencilFuncBack:(t,e,n)=>t.stencilFuncSeparate(1029,qn(34816,e,n),qn(36003,e,n),qn(36004,e,n)),stencilOpFront:(t,e,n)=>t.stencilOpSeparate(1028,qn(2964,e,n),qn(2965,e,n),qn(2966,e,n)),stencilOpBack:(t,e,n)=>t.stencilOpSeparate(1029,qn(34817,e,n),qn(34818,e,n),qn(34819,e,n))},cC={enable:(t,e)=>t({[e]:!0}),disable:(t,e)=>t({[e]:!1}),pixelStorei:(t,e,n)=>t({[e]:n}),hint:(t,e,n)=>t({[e]:n}),useProgram:(t,e)=>t({35725:e}),bindRenderbuffer:(t,e,n)=>t({36007:n}),bindTransformFeedback:(t,e,n)=>t({36389:n}),bindVertexArray:(t,e)=>t({34229:e}),bindFramebuffer:(t,e,n)=>{switch(e){case 36160:return t({36006:n,36010:n});case 36009:return t({36006:n});case 36008:return t({36010:n});default:return null}},bindBuffer:(t,e,n)=>{const r={34962:[34964],36662:[36662],36663:[36663],35051:[35053],35052:[35055]}[e];return r?t({[r]:n}):{valueChanged:!0}},blendColor:(t,e,n,r,i)=>t({32773:new Float32Array([e,n,r,i])}),blendEquation:(t,e)=>t({32777:e,34877:e}),blendEquationSeparate:(t,e,n)=>t({32777:e,34877:n}),blendFunc:(t,e,n)=>t({32969:e,32968:n,32971:e,32970:n}),blendFuncSeparate:(t,e,n,r,i)=>t({32969:e,32968:n,32971:r,32970:i}),clearColor:(t,e,n,r,i)=>t({3106:new Float32Array([e,n,r,i])}),clearDepth:(t,e)=>t({2931:e}),clearStencil:(t,e)=>t({2961:e}),colorMask:(t,e,n,r,i)=>t({3107:[e,n,r,i]}),cullFace:(t,e)=>t({2885:e}),depthFunc:(t,e)=>t({2932:e}),depthRange:(t,e,n)=>t({2928:new Float32Array([e,n])}),depthMask:(t,e)=>t({2930:e}),frontFace:(t,e)=>t({2886:e}),lineWidth:(t,e)=>t({2849:e}),polygonOffset:(t,e,n)=>t({32824:e,10752:n}),sampleCoverage:(t,e,n)=>t({32938:e,32939:n}),scissor:(t,e,n,r,i)=>t({3088:new Int32Array([e,n,r,i])}),stencilMask:(t,e)=>t({2968:e,36005:e}),stencilMaskSeparate:(t,e,n)=>t({[e===1028?2968:36005]:n}),stencilFunc:(t,e,n,r)=>t({2962:e,2967:n,2963:r,34816:e,36003:n,36004:r}),stencilFuncSeparate:(t,e,n,r,i)=>t({[e===1028?2962:34816]:n,[e===1028?2967:36003]:r,[e===1028?2963:36004]:i}),stencilOp:(t,e,n,r)=>t({2964:e,2965:n,2966:r,34817:e,34818:n,34819:r}),stencilOpSeparate:(t,e,n,r,i)=>t({[e===1028?2964:34817]:n,[e===1028?2965:34818]:r,[e===1028?2966:34819]:i}),viewport:(t,e,n,r,i)=>t({2978:[e,n,r,i]})},us=(t,e)=>t.isEnabled(e),uC={3042:us,2884:us,2929:us,3024:us,32823:us,32926:us,32928:us,3089:us,2960:us,35977:us},RY=new Set([34016,36388,36387,35983,35368,34965,35739,35738,3074,34853,34854,34855,34856,34857,34858,34859,34860,34861,34862,34863,34864,34865,34866,34867,34868,35097,32873,35869,32874,34068]);function Yc(t,e){if(MY(e))return;const n={};for(const i in e){const s=Number(i),l=AY[i];l&&(typeof l=="string"?n[l]=!0:l(t,e[i],s))}const r=t.state&&t.state.cache;if(r)for(const i in n){const s=CY[i];s(t,e,r)}}function UO(t,e=Fb){if(typeof e=="number"){const i=e,s=uC[i];return s?s(t,i):t.getParameter(i)}const n=Array.isArray(e)?e:Object.keys(e),r={};for(const i of n){const s=uC[i];r[i]=s?s(t,Number(i)):t.getParameter(Number(i))}return r}function xY(t){Yc(t,Fb)}function MY(t){for(const e in t)return!1;return!0}function OY(t,e){if(t===e)return!0;const n=Array.isArray(t)||ArrayBuffer.isView(t),r=Array.isArray(e)||ArrayBuffer.isView(e);if(n&&r&&t.length===e.length){for(let i=0;i{}),this._updateCache=this._updateCache.bind(this),Object.seal(this)}static get(e){return e.state}push(e={}){this.stateStack.push({})}pop(){const e=this.stateStack[this.stateStack.length-1];Yc(this.gl,e),this.stateStack.pop()}trackState(e,n){if(this.cache=n.copyState?UO(e):Object.assign({},Fb),this.initialized)throw new Error("WebGLStateTracker");this.initialized=!0,this.gl.state=this,NY(e);for(const r in cC){const i=cC[r];PY(e,r,i)}fC(e,"getParameter"),fC(e,"isEnabled")}_updateCache(e){let n=!1,r;const i=this.stateStack.length>0?this.stateStack[this.stateStack.length-1]:null;for(const s in e){const l=e[s],c=this.cache[s];OY(l,c)||(n=!0,r=c,i&&!(s in i)&&(i[s]=c),this.cache[s]=l)}return{valueChanged:n,oldValue:r}}}function fC(t,e){const n=t[e].bind(t);t[e]=function(i){if(i===void 0||RY.has(i))return n(i);const s=Lo.get(t);return i in s.cache||(s.cache[i]=n(i)),s.enable?s.cache[i]:n(i)},Object.defineProperty(t[e],"name",{value:`${e}-from-cache`,configurable:!1})}function PY(t,e,n){if(!t[e])return;const r=t[e].bind(t);t[e]=function(...s){const l=Lo.get(t),{valueChanged:c,oldValue:f}=n(l._updateCache,...s);return c&&r(...s),f},Object.defineProperty(t[e],"name",{value:`${e}-to-cache`,configurable:!1})}function NY(t){const e=t.useProgram.bind(t);t.useProgram=function(r){const i=Lo.get(t);i.program!==r&&(e(r),i.program=r)}}function IY(t,e,n){let r="";const i={preserveDrawingBuffer:!0,...n};let s=null;if(s||(s=t.getContext("webgl2",i)),i.failIfMajorPerformanceCaveat&&(r||(r="Only software GPU is available. Set `failIfMajorPerformanceCaveat: false` to allow.")),!s&&!n.failIfMajorPerformanceCaveat&&(i.failIfMajorPerformanceCaveat=!1,s=t.getContext("webgl2",i),s.luma||(s.luma={}),s.luma.softwareRenderer=!0),s||(s=t.getContext("webgl",{}),s&&(s=null,r||(r="Your browser only supports WebGL1"))),!s)throw r||(r="Your browser does not support WebGL"),new Error(`Failed to create WebGL context: ${r}`);const{onContextLost:l,onContextRestored:c}=e;return t.addEventListener("webglcontextlost",f=>l(f),!1),t.addEventListener("webglcontextrestored",f=>c(f),!1),s.luma||(s.luma={}),s}function Lc(t,e,n){return n[e]===void 0&&(n[e]=t.getExtension(e)||null),n[e]}function DY(t,e){const n=t.getParameter(7936),r=t.getParameter(7937);Lc(t,"WEBGL_debug_renderer_info",e);const i=e.WEBGL_debug_renderer_info,s=t.getParameter(i?i.UNMASKED_VENDOR_WEBGL:7936),l=t.getParameter(i?i.UNMASKED_RENDERER_WEBGL:7937),c=s||n,f=l||r,d=t.getParameter(7938),g=LO(c,f),m=FY(c,f),v=kY(c,f);return{type:"webgl",gpu:g,gpuType:v,gpuBackend:m,vendor:c,renderer:f,version:d,shadingLanguage:"glsl",shadingLanguageVersion:300}}function LO(t,e){return/NVIDIA/i.exec(t)||/NVIDIA/i.exec(e)?"nvidia":/INTEL/i.exec(t)||/INTEL/i.exec(e)?"intel":/Apple/i.exec(t)||/Apple/i.exec(e)?"apple":/AMD/i.exec(t)||/AMD/i.exec(e)||/ATI/i.exec(t)||/ATI/i.exec(e)?"amd":/SwiftShader/i.exec(t)||/SwiftShader/i.exec(e)?"software":"unknown"}function FY(t,e){return/Metal/i.exec(t)||/Metal/i.exec(e)?"metal":/ANGLE/i.exec(t)||/ANGLE/i.exec(e)?"opengl":"unknown"}function kY(t,e){if(/SwiftShader/i.exec(t)||/SwiftShader/i.exec(e))return"cpu";switch(LO(t,e)){case"intel":return"integrated";case"software":return"cpu";case"unknown":return"unknown";default:return"discrete"}}function zO(t){switch(t){case"uint8":return 5121;case"sint8":return 5120;case"unorm8":return 5121;case"snorm8":return 5120;case"uint16":return 5123;case"sint16":return 5122;case"unorm16":return 5123;case"snorm16":return 5122;case"uint32":return 5125;case"sint32":return 5124;case"float16":return 5131;case"float32":return 5126}throw new Error(String(t))}const Ju="WEBGL_compressed_texture_s3tc",ef="WEBGL_compressed_texture_s3tc_srgb",Jl="EXT_texture_compression_rgtc",ec="EXT_texture_compression_bptc",BY="WEBGL_compressed_texture_etc",UY="WEBGL_compressed_texture_astc",LY="WEBGL_compressed_texture_etc1",zY="WEBGL_compressed_texture_pvrtc",$Y="WEBGL_compressed_texture_atc",dC="EXT_texture_norm16",hC="EXT_render_snorm",VY="EXT_color_buffer_float",kb={"float32-renderable-webgl":["EXT_color_buffer_float"],"float16-renderable-webgl":["EXT_color_buffer_half_float"],"rgb9e5ufloat-renderable-webgl":["WEBGL_render_shared_exponent"],"snorm8-renderable-webgl":[hC],"norm16-renderable-webgl":[dC],"snorm16-renderable-webgl":[dC,hC],"float32-filterable":["OES_texture_float_linear"],"float16-filterable-webgl":["OES_texture_half_float_linear"],"texture-filterable-anisotropic-webgl":["EXT_texture_filter_anisotropic"],"texture-blend-float-webgl":["EXT_float_blend"],"texture-compression-bc":[Ju,ef,Jl,ec],"texture-compression-bc5-webgl":[Jl],"texture-compression-bc7-webgl":[ec],"texture-compression-etc2":[BY],"texture-compression-astc":[UY],"texture-compression-etc1-webgl":[LY],"texture-compression-pvrtc-webgl":[zY],"texture-compression-atc-webgl":[$Y]};function HY(t){return t in kb}function jY(t,e,n){return(kb[e]||[]).every(i=>Lc(t,i,n))}const Bb={r8unorm:{gl:33321,rb:!0},r8snorm:{gl:36756},r8uint:{gl:33330,rb:!0},r8sint:{gl:33329,rb:!0},rg8unorm:{gl:33323,rb:!0},rg8snorm:{gl:36757},rg8uint:{gl:33336,rb:!0},rg8sint:{gl:33335,rb:!0},r16uint:{gl:33332,rb:!0},r16sint:{gl:33331,rb:!0},r16float:{gl:33325,rb:!0},"r16unorm-webgl":{gl:33322,rb:!0},"r16snorm-webgl":{gl:36760},"rgba4unorm-webgl":{gl:32854,rb:!0},"rgb565unorm-webgl":{gl:36194,rb:!0},"rgb5a1unorm-webgl":{gl:32855,rb:!0},"rgb8unorm-webgl":{gl:32849},"rgb8snorm-webgl":{gl:36758},rgba8unorm:{gl:32856},"rgba8unorm-srgb":{gl:35907},rgba8snorm:{gl:36759},rgba8uint:{gl:36220},rgba8sint:{gl:36238},bgra8unorm:{},"bgra8unorm-srgb":{},rg16uint:{gl:33338},rg16sint:{gl:33337},rg16float:{gl:33327,rb:!0},"rg16unorm-webgl":{gl:33324},"rg16snorm-webgl":{gl:36761},r32uint:{gl:33334,rb:!0},r32sint:{gl:33333,rb:!0},r32float:{gl:33326},rgb9e5ufloat:{gl:35901},rg11b10ufloat:{gl:35898,rb:!0},rgb10a2unorm:{gl:32857,rb:!0},"rgb10a2uint-webgl":{gl:36975,rb:!0},"rgb16unorm-webgl":{gl:32852},"rgb16snorm-webgl":{gl:36762},rg32uint:{gl:33340,rb:!0},rg32sint:{gl:33339,rb:!0},rg32float:{gl:33328,rb:!0},rgba16uint:{gl:36214,rb:!0},rgba16sint:{gl:36232,rb:!0},rgba16float:{gl:34842},"rgba16unorm-webgl":{gl:32859,rb:!0},"rgba16snorm-webgl":{gl:36763},"rgb32float-webgl":{gl:34837,x:VY,dataFormat:6407,types:[5126]},rgba32uint:{gl:36208,rb:!0},rgba32sint:{gl:36226,rb:!0},rgba32float:{gl:34836,rb:!0},stencil8:{gl:36168,rb:!0},depth16unorm:{gl:33189,dataFormat:6402,types:[5123],rb:!0},depth24plus:{gl:33190,dataFormat:6402,types:[5125]},depth32float:{gl:36012,dataFormat:6402,types:[5126],rb:!0},"depth24plus-stencil8":{gl:35056,rb:!0,depthTexture:!0,dataFormat:34041,types:[34042]},"depth32float-stencil8":{gl:36013,dataFormat:34041,types:[36269],rb:!0},"bc1-rgb-unorm-webgl":{gl:33776,x:Ju},"bc1-rgb-unorm-srgb-webgl":{gl:35916,x:ef},"bc1-rgba-unorm":{gl:33777,x:Ju},"bc1-rgba-unorm-srgb":{gl:35916,x:ef},"bc2-rgba-unorm":{gl:33778,x:Ju},"bc2-rgba-unorm-srgb":{gl:35918,x:ef},"bc3-rgba-unorm":{gl:33779,x:Ju},"bc3-rgba-unorm-srgb":{gl:35919,x:ef},"bc4-r-unorm":{gl:36283,x:Jl},"bc4-r-snorm":{gl:36284,x:Jl},"bc5-rg-unorm":{gl:36285,x:Jl},"bc5-rg-snorm":{gl:36286,x:Jl},"bc6h-rgb-ufloat":{gl:36495,x:ec},"bc6h-rgb-float":{gl:36494,x:ec},"bc7-rgba-unorm":{gl:36492,x:ec},"bc7-rgba-unorm-srgb":{gl:36493,x:ec},"etc2-rgb8unorm":{gl:37492},"etc2-rgb8unorm-srgb":{gl:37494},"etc2-rgb8a1unorm":{gl:37496},"etc2-rgb8a1unorm-srgb":{gl:37497},"etc2-rgba8unorm":{gl:37493},"etc2-rgba8unorm-srgb":{gl:37495},"eac-r11unorm":{gl:37488},"eac-r11snorm":{gl:37489},"eac-rg11unorm":{gl:37490},"eac-rg11snorm":{gl:37491},"astc-4x4-unorm":{gl:37808},"astc-4x4-unorm-srgb":{gl:37840},"astc-5x4-unorm":{gl:37809},"astc-5x4-unorm-srgb":{gl:37841},"astc-5x5-unorm":{gl:37810},"astc-5x5-unorm-srgb":{gl:37842},"astc-6x5-unorm":{gl:37811},"astc-6x5-unorm-srgb":{gl:37843},"astc-6x6-unorm":{gl:37812},"astc-6x6-unorm-srgb":{gl:37844},"astc-8x5-unorm":{gl:37813},"astc-8x5-unorm-srgb":{gl:37845},"astc-8x6-unorm":{gl:37814},"astc-8x6-unorm-srgb":{gl:37846},"astc-8x8-unorm":{gl:37815},"astc-8x8-unorm-srgb":{gl:37847},"astc-10x5-unorm":{gl:37819},"astc-10x5-unorm-srgb":{gl:37851},"astc-10x6-unorm":{gl:37817},"astc-10x6-unorm-srgb":{gl:37849},"astc-10x8-unorm":{gl:37818},"astc-10x8-unorm-srgb":{gl:37850},"astc-10x10-unorm":{gl:37819},"astc-10x10-unorm-srgb":{gl:37851},"astc-12x10-unorm":{gl:37820},"astc-12x10-unorm-srgb":{gl:37852},"astc-12x12-unorm":{gl:37821},"astc-12x12-unorm-srgb":{gl:37853},"pvrtc-rgb4unorm-webgl":{gl:35840},"pvrtc-rgba4unorm-webgl":{gl:35842},"pvrtc-rbg2unorm-webgl":{gl:35841},"pvrtc-rgba2unorm-webgl":{gl:35843},"etc1-rbg-unorm-webgl":{gl:36196},"atc-rgb-unorm-webgl":{gl:35986},"atc-rgba-unorm-webgl":{gl:35986},"atc-rgbai-unorm-webgl":{gl:34798}};function WY(t,e,n){let r=e.create;const i=Bb[e.format];return(i==null?void 0:i.gl)===void 0&&(r=!1),i!=null&&i.x&&(r=r&&!!Lc(t,i.x,n)),{format:e.format,create:r&&e.create,render:r&&e.render,filter:r&&e.filter,blend:r&&e.blend,store:r&&e.store}}function $O(t){var i;const e=Bb[t],n=YY(t),r=xb(t);return{internalFormat:n,format:(e==null?void 0:e.dataFormat)||qY(r.channels,r.integer,r.normalized,n),type:r.dataType?zO(r.dataType):((i=e==null?void 0:e.types)==null?void 0:i[0])||5121,compressed:r.compressed||!1}}function XY(t){switch(xb(t).attachment){case"depth":return 36096;case"stencil":return 36128;case"depth-stencil":return 33306;default:throw new Error(`Not a depth stencil format: ${t}`)}}function qY(t,e,n,r){if(r===6408||r===6407)return r;switch(t){case"r":return e&&!n?36244:6403;case"rg":return e&&!n?33320:33319;case"rgb":return e&&!n?36248:6407;case"rgba":return e&&!n?36249:6408;case"bgra":throw new Error("bgra pixels not supported by WebGL");default:return 6408}}function YY(t){const e=Bb[t],n=e==null?void 0:e.gl;if(n===void 0)throw new Error(`Unsupported texture format ${t}`);return n}const gC={"depth-clip-control":"EXT_depth_clamp","timer-query-webgl":"EXT_disjoint_timer_query_webgl2","compilation-status-async-webgl":"KHR_parallel_shader_compile","polygon-mode-webgl":"WEBGL_polygon_mode","provoking-vertex-webgl":"WEBGL_provoking_vertex","shader-clip-cull-distance-webgl":"WEBGL_clip_cull_distance","shader-noperspective-interpolation-webgl":"NV_shader_noperspective_interpolation","shader-conservative-depth-webgl":"EXT_conservative_depth"};class KY extends AV{constructor(n,r,i){super([],i);O(this,"gl");O(this,"extensions");O(this,"testedFeatures",new Set);this.gl=n,this.extensions=r,Lc(n,"EXT_color_buffer_float",r)}*[Symbol.iterator](){const n=this.getFeatures();for(const r of n)this.has(r)&&(yield r);return[]}has(n){var r;return(r=this.disabledFeatures)!=null&&r[n]?!1:(this.testedFeatures.has(n)||(this.testedFeatures.add(n),HY(n)&&jY(this.gl,n,this.extensions)&&this.features.add(n),this.getWebGLFeature(n)&&this.features.add(n)),this.features.has(n))}initializeFeatures(){const n=this.getFeatures().filter(r=>r!=="polygon-mode-webgl");for(const r of n)this.has(r)}getFeatures(){return[...Object.keys(gC),...Object.keys(kb)]}getWebGLFeature(n){const r=gC[n];return typeof r=="string"?!!Lc(this.gl,r,this.extensions):!!r}}class ZY extends TV{constructor(n){super();O(this,"gl");O(this,"limits",{});this.gl=n}get maxTextureDimension1D(){return 0}get maxTextureDimension2D(){return this.getParameter(3379)}get maxTextureDimension3D(){return this.getParameter(32883)}get maxTextureArrayLayers(){return this.getParameter(35071)}get maxBindGroups(){return 0}get maxDynamicUniformBuffersPerPipelineLayout(){return 0}get maxDynamicStorageBuffersPerPipelineLayout(){return 0}get maxSampledTexturesPerShaderStage(){return this.getParameter(35660)}get maxSamplersPerShaderStage(){return this.getParameter(35661)}get maxStorageBuffersPerShaderStage(){return 0}get maxStorageTexturesPerShaderStage(){return 0}get maxUniformBuffersPerShaderStage(){return this.getParameter(35375)}get maxUniformBufferBindingSize(){return this.getParameter(35376)}get maxStorageBufferBindingSize(){return 0}get minUniformBufferOffsetAlignment(){return this.getParameter(35380)}get minStorageBufferOffsetAlignment(){return 0}get maxVertexBuffers(){return 16}get maxVertexAttributes(){return this.getParameter(34921)}get maxVertexBufferArrayStride(){return 2048}get maxInterStageShaderComponents(){return this.getParameter(35659)}get maxComputeWorkgroupStorageSize(){return 0}get maxComputeInvocationsPerWorkgroup(){return 0}get maxComputeWorkgroupSizeX(){return 0}get maxComputeWorkgroupSizeY(){return 0}get maxComputeWorkgroupSizeZ(){return 0}get maxComputeWorkgroupsPerDimension(){return 0}getParameter(n){return this.limits[n]===void 0&&(this.limits[n]=this.gl.getParameter(n)),this.limits[n]||0}}class ff extends Tg{constructor(n,r){super(n,r);O(this,"device");O(this,"gl");O(this,"handle");O(this,"colorAttachments",[]);O(this,"depthStencilAttachment",null);const i=r.handle===null;this.device=n,this.gl=n.gl,this.handle=this.props.handle||i?this.props.handle:this.gl.createFramebuffer(),i||(n.setSpectorMetadata(this.handle,{id:this.props.id,props:this.props}),this.autoCreateAttachmentTextures(),this.updateAttachments())}destroy(){super.destroy(),!this.destroyed&&this.handle!==null&&this.gl.deleteFramebuffer(this.handle)}updateAttachments(){const n=this.gl.bindFramebuffer(36160,this.handle);for(let r=0;r{r.onload=i,r.onerror=l=>s(new Error(`Unable to load script '${t}': ${l}`)),n.appendChild(r)})}const eK=1;let bn=null,pC=!1;const Ub={debugSpectorJS:Re.get("debug-spectorjs"),debugSpectorJSUrl:"https://cdn.jsdelivr.net/npm/spectorjs@0.9.30/dist/spector.bundle.js",gl:void 0};async function tK(t){if(!globalThis.SPECTOR)try{await VO(t.debugSpectorJSUrl||Ub.debugSpectorJSUrl)}catch(e){Re.warn(String(e))}}function nK(t){var e;if(t={...Ub,...t},!t.debugSpectorJS)return null;if(!bn&&globalThis.SPECTOR&&!((e=globalThis.luma)!=null&&e.spector)){Re.probe(eK,"SPECTOR found and initialized. Start with `luma.spector.displayUI()`")();const{Spector:n}=globalThis.SPECTOR;bn=new n,globalThis.luma&&(globalThis.luma.spector=bn)}if(!bn)return null;if(pC||(pC=!0,bn.spyCanvases(),bn==null||bn.onCaptureStarted.add(n=>Re.info("Spector capture started:",n)()),bn==null||bn.onCapture.add(n=>{Re.info("Spector capture complete:",n)(),bn==null||bn.getResultUI(),bn==null||bn.resultView.display(),bn==null||bn.resultView.addCapture(n)})),t.gl){const n=t.gl,r=n.device;bn==null||bn.startCapture(t.gl,500),n.device=r,new Promise(i=>setTimeout(i,2e3)).then(i=>{Re.info("Spector capture stopped after 2 seconds")(),bn==null||bn.stopCapture()})}return bn}const rK="https://unpkg.com/webgl-debug@2.0.1/index.js";function HO(t){return t.luma=t.luma||{},t.luma}async function iK(){qo()&&!globalThis.WebGLDebugUtils&&(globalThis.global=globalThis.global||globalThis,globalThis.global.module={},await VO(rK))}function sK(t,e={}){return e.debugWebGL||e.traceWebGL?oK(t,e):aK(t)}function aK(t){const e=HO(t);return e.realContext?e.realContext:t}function oK(t,e){if(!globalThis.WebGLDebugUtils)return Re.warn("webgl-debug not loaded")(),t;const n=HO(t);if(n.debugContext)return n.debugContext;globalThis.WebGLDebugUtils.init({...Gl,...t});const r=globalThis.WebGLDebugUtils.makeDebugContext(t,lK.bind(null,e),cK.bind(null,e));for(const l in Gl)!(l in r)&&typeof Gl[l]=="number"&&(r[l]=Gl[l]);class i{}Object.setPrototypeOf(r,Object.getPrototypeOf(t)),Object.setPrototypeOf(i,r);const s=Object.create(i);return n.realContext=t,n.debugContext=s,s.debug=!0,s}function mC(t,e){e=Array.from(e).map(r=>r===void 0?"undefined":r);let n=globalThis.WebGLDebugUtils.glFunctionArgsToString(t,e);return n=`${n.slice(0,100)}${n.length>100?"...":""}`,`gl.${t}(${n})`}function lK(t,e,n,r){r=Array.from(r).map(c=>c===void 0?"undefined":c);const i=globalThis.WebGLDebugUtils.glEnumToString(e),s=globalThis.WebGLDebugUtils.glFunctionArgsToString(n,r),l=`${i} in gl.${n}(${s})`;Re.error(l)();debugger}function cK(t,e,n){let r="";Re.level>=1&&(r=mC(e,n),t.traceWebGL&&Re.log(1,r)());for(const i of n)if(i===void 0){r=r||mC(e,n);debugger}}const C0={};function uK(t="id"){C0[t]=C0[t]||1;const e=C0[t]++;return`${t}-${e}`}class df extends $n{constructor(n,r={}){super(n,r);O(this,"device");O(this,"gl");O(this,"handle");O(this,"glTarget");O(this,"glUsage");O(this,"glIndexType",5123);O(this,"byteLength");O(this,"bytesUsed");this.device=n,this.gl=this.device.gl;const i=typeof r=="object"?r.handle:void 0;this.handle=i||this.gl.createBuffer(),n.setSpectorMetadata(this.handle,{...this.props,data:typeof this.props.data}),this.glTarget=fK(this.props.usage),this.glUsage=dK(this.props.usage),this.glIndexType=this.props.indexType==="uint32"?5125:5123,r.data?this._initWithData(r.data,r.byteOffset,r.byteLength):this._initWithByteLength(r.byteLength||0)}_initWithData(n,r=0,i=n.byteLength+r){const s=this.glTarget;this.gl.bindBuffer(s,this.handle),this.gl.bufferData(s,i,this.glUsage),this.gl.bufferSubData(s,r,n),this.gl.bindBuffer(s,null),this.bytesUsed=i,this.byteLength=i,this._setDebugData(n,r,i),this.trackAllocatedMemory(i)}_initWithByteLength(n){let r=n;n===0&&(r=new Float32Array(0));const i=this.glTarget;return this.gl.bindBuffer(i,this.handle),this.gl.bufferData(i,r,this.glUsage),this.gl.bindBuffer(i,null),this.bytesUsed=n,this.byteLength=n,this._setDebugData(null,0,n),this.trackAllocatedMemory(n),this}destroy(){!this.destroyed&&this.handle&&(this.removeStats(),this.trackDeallocatedMemory(),this.gl.deleteBuffer(this.handle),this.destroyed=!0,this.handle=null)}write(n,r=0){this.gl.bindBuffer(36663,this.handle),this.gl.bufferSubData(36663,r,n),this.gl.bindBuffer(36663,null),this._setDebugData(n,r,n.byteLength)}async readAsync(n=0,r){return this.readSyncWebGL(n,r)}readSyncWebGL(n=0,r){r=r??this.byteLength-n;const i=new Uint8Array(r),s=0;return this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,n,i,s,r),this.gl.bindBuffer(36662,null),this._setDebugData(i,n,r),i}}function fK(t){return t&$n.INDEX?34963:t&$n.VERTEX?34962:t&$n.UNIFORM?35345:34962}function dK(t){return t&$n.INDEX||t&$n.VERTEX?35044:t&$n.UNIFORM?35048:35044}function hK(t){const e=t.split(/\r?\n/),n=[];for(const r of e){if(r.length<=1)continue;const i=r.split(":");if(i.length===2){const[m,v]=i;n.push({message:v.trim(),type:vC(m),lineNum:0,linePos:0});continue}const[s,l,c,...f]=i;let d=parseInt(c,10);isNaN(d)&&(d=0);let g=parseInt(l,10);isNaN(g)&&(g=0),n.push({message:f.join(":").trim(),type:vC(s),lineNum:d,linePos:g})}return n}function vC(t){const e=["warning","error","info"],n=t.toLowerCase();return e.includes(n)?n:"info"}class gK extends wg{constructor(n,r){super(n,r);O(this,"device");O(this,"handle");switch(this.device=n,this.props.stage){case"vertex":this.handle=this.props.handle||this.device.gl.createShader(35633);break;case"fragment":this.handle=this.props.handle||this.device.gl.createShader(35632);break;default:throw new Error(this.props.stage)}this._compile(this.source)}destroy(){this.handle&&(this.removeStats(),this.device.gl.deleteShader(this.handle),this.destroyed=!0)}get asyncCompilationStatus(){return this._waitForCompilationComplete().then(()=>this.compilationStatus)}async getCompilationInfo(){return await this._waitForCompilationComplete(),this.getCompilationInfoSync()}getCompilationInfoSync(){const n=this.device.gl.getShaderInfoLog(this.handle);return n?hK(n):[]}getTranslatedSource(){const r=this.device.getExtension("WEBGL_debug_shaders").WEBGL_debug_shaders;return(r==null?void 0:r.getTranslatedShaderSource(this.handle))||null}async _compile(n){n=n.startsWith("#version ")?n:`#version 300 es +${n}`;const{gl:r}=this.device;if(r.shaderSource(this.handle,n),r.compileShader(this.handle),!this.device.props.debug){this.compilationStatus="pending";return}if(!this.device.features.has("compilation-status-async-webgl")){if(this._getCompilationStatus(),this.debugShader(),this.compilationStatus==="error")throw new Error(`GLSL compilation errors in ${this.props.stage} shader ${this.props.id}`);return}Re.once(1,"Shader compilation is asynchronous")(),await this._waitForCompilationComplete(),Re.info(2,`Shader ${this.id} - async compilation complete: ${this.compilationStatus}`)(),this._getCompilationStatus(),this.debugShader()}async _waitForCompilationComplete(){const n=async s=>await new Promise(l=>setTimeout(l,s));if(!this.device.features.has("compilation-status-async-webgl")){await n(10);return}const{gl:i}=this.device;for(;;){if(i.getShaderParameter(this.handle,37297))return;await n(10)}}_getCompilationStatus(){this.compilationStatus=this.device.gl.getShaderParameter(this.handle,35713)?"success":"error"}}function pK(t,e,n,r){if(yK(e))return r(t);const i=t;i.pushState();try{return mK(t,e),Yc(i.gl,n),r(t)}finally{i.popState()}}function mK(t,e){const n=t,{gl:r}=n;if(e.cullMode)switch(e.cullMode){case"none":r.disable(2884);break;case"front":r.enable(2884),r.cullFace(1028);break;case"back":r.enable(2884),r.cullFace(1029);break}if(e.frontFace&&r.frontFace(zo("frontFace",e.frontFace,{ccw:2305,cw:2304})),e.unclippedDepth&&t.features.has("depth-clip-control")&&r.enable(34383),e.depthBias!==void 0&&(r.enable(32823),r.polygonOffset(e.depthBias,e.depthBiasSlopeScale||0)),e.provokingVertex&&t.features.has("provoking-vertex-webgl")){const s=n.getExtension("WEBGL_provoking_vertex").WEBGL_provoking_vertex,l=zo("provokingVertex",e.provokingVertex,{first:36429,last:36430});s==null||s.provokingVertexWEBGL(l)}if((e.polygonMode||e.polygonOffsetLine)&&t.features.has("polygon-mode-webgl")){if(e.polygonMode){const s=n.getExtension("WEBGL_polygon_mode").WEBGL_polygon_mode,l=zo("polygonMode",e.polygonMode,{fill:6914,line:6913});s==null||s.polygonModeWEBGL(1028,l),s==null||s.polygonModeWEBGL(1029,l)}e.polygonOffsetLine&&r.enable(10754)}if(t.features.has("shader-clip-cull-distance-webgl")&&(e.clipDistance0&&r.enable(12288),e.clipDistance1&&r.enable(12289),e.clipDistance2&&r.enable(12290),e.clipDistance3&&r.enable(12291),e.clipDistance4&&r.enable(12292),e.clipDistance5&&r.enable(12293),e.clipDistance6&&r.enable(12294),e.clipDistance7&&r.enable(12295)),e.depthWriteEnabled!==void 0&&r.depthMask(_K("depthWriteEnabled",e.depthWriteEnabled)),e.depthCompare&&(e.depthCompare!=="always"?r.enable(2929):r.disable(2929),r.depthFunc(Ay("depthCompare",e.depthCompare))),e.stencilWriteMask){const i=e.stencilWriteMask;r.stencilMaskSeparate(1028,i),r.stencilMaskSeparate(1029,i)}if(e.stencilReadMask&&Re.warn("stencilReadMask not supported under WebGL"),e.stencilCompare){const i=e.stencilReadMask||4294967295,s=Ay("depthCompare",e.stencilCompare);e.stencilCompare!=="always"?r.enable(2960):r.disable(2960),r.stencilFuncSeparate(1028,s,0,i),r.stencilFuncSeparate(1029,s,0,i)}if(e.stencilPassOperation&&e.stencilFailOperation&&e.stencilDepthFailOperation){const i=R0("stencilPassOperation",e.stencilPassOperation),s=R0("stencilFailOperation",e.stencilFailOperation),l=R0("stencilDepthFailOperation",e.stencilDepthFailOperation);r.stencilOpSeparate(1028,s,l,i),r.stencilOpSeparate(1029,s,l,i)}switch(e.blend){case!0:r.enable(3042);break;case!1:r.disable(3042);break}if(e.blendColorOperation||e.blendAlphaOperation){const i=_C("blendColorOperation",e.blendColorOperation||"add"),s=_C("blendAlphaOperation",e.blendAlphaOperation||"add");r.blendEquationSeparate(i,s);const l=Ph("blendColorSrcFactor",e.blendColorSrcFactor||"one"),c=Ph("blendColorDstFactor",e.blendColorDstFactor||"zero"),f=Ph("blendAlphaSrcFactor",e.blendAlphaSrcFactor||"one"),d=Ph("blendAlphaDstFactor",e.blendAlphaDstFactor||"zero");r.blendFuncSeparate(l,c,f,d)}}function Ay(t,e){return zo(t,e,{never:512,less:513,equal:514,"less-equal":515,greater:516,"not-equal":517,"greater-equal":518,always:519})}function R0(t,e){return zo(t,e,{keep:7680,zero:0,replace:7681,invert:5386,"increment-clamp":7682,"decrement-clamp":7683,"increment-wrap":34055,"decrement-wrap":34056})}function _C(t,e){return zo(t,e,{add:32774,subtract:32778,"reverse-subtract":32779,min:32775,max:32776})}function Ph(t,e){return zo(t,e,{one:1,zero:0,"src-color":768,"one-minus-src-color":769,"dst-color":774,"one-minus-dst-color":775,"src-alpha":770,"one-minus-src-alpha":771,"dst-alpha":772,"one-minus-dst-alpha":773,"src-alpha-saturated":776,"constant-color":32769,"one-minus-constant-color":32770,"constant-alpha":32771,"one-minus-constant-alpha":32772})}function vK(t,e){return`Illegal parameter ${e} for ${t}`}function zo(t,e,n){if(!(e in n))throw new Error(vK(t,e));return n[e]}function _K(t,e){return e}function yK(t){let e=!0;for(const n in t){e=!1;break}return e}function jO(t){const e={};return t.addressModeU&&(e[10242]=x0(t.addressModeU)),t.addressModeV&&(e[10243]=x0(t.addressModeV)),t.addressModeW&&(e[32882]=x0(t.addressModeW)),t.magFilter&&(e[10240]=Cy(t.magFilter)),(t.minFilter||t.mipmapFilter)&&(e[10241]=bK(t.minFilter||"linear",t.mipmapFilter)),t.lodMinClamp!==void 0&&(e[33082]=t.lodMinClamp),t.lodMaxClamp!==void 0&&(e[33083]=t.lodMaxClamp),t.type==="comparison-sampler"&&(e[34892]=34894),t.compare&&(e[34893]=Ay("compare",t.compare)),t.maxAnisotropy&&(e[34046]=t.maxAnisotropy),e}function x0(t){switch(t){case"clamp-to-edge":return 33071;case"repeat":return 10497;case"mirror-repeat":return 33648}}function Cy(t){switch(t){case"nearest":return 9728;case"linear":return 9729}}function bK(t,e="none"){if(!e)return Cy(t);switch(e){case"none":return Cy(t);case"nearest":return t==="nearest"?9984:9986;case"linear":return t==="nearest"?9985:9987}}class Ry extends Eg{constructor(n,r){super(n,r);O(this,"device");O(this,"handle");O(this,"parameters");this.device=n,this.parameters=jO(r),this.handle=this.handle||this.device.gl.createSampler(),this._setSamplerParameters(this.parameters)}destroy(){this.handle&&(this.device.gl.deleteSampler(this.handle),this.handle=void 0)}toString(){return`Sampler(${this.id},${JSON.stringify(this.props)})`}_setSamplerParameters(n){for(const[r,i]of Object.entries(n)){const s=Number(r);switch(s){case 33082:case 33083:this.device.gl.samplerParameterf(this.handle,s,i);break;default:this.device.gl.samplerParameteri(this.handle,s,i);break}}}}class tc extends Sg{constructor(n,r){super(n,{...Kn.defaultProps,...r});O(this,"device");O(this,"gl");O(this,"handle");O(this,"texture");this.device=n,this.gl=this.device.gl,this.handle=null,this.texture=r.texture}}const SK="Failed to deduce GL constant from typed array";function wK(t){switch(ArrayBuffer.isView(t)?t.constructor:t){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:return 5121;case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error(SK)}}function EK(t,e){const{clamped:n=!0}=e||{};switch(t){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return n?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}function WO(t){switch(t){case 6406:case 33326:case 6403:case 36244:return 1;case 33339:case 33340:case 33328:case 33320:case 33319:return 2;case 6407:case 36248:case 34837:return 3;case 6408:case 36249:case 34836:return 4;default:return 0}}function TK(t){switch(t){case 5121:return 1;case 33635:case 32819:case 32820:return 2;case 5126:return 4;default:return 0}}function kg(t,e,n){if(AK(e))return n(t);const{nocatch:r=!0}=e,i=Lo.get(t);i.push(),Yc(t,e);let s;if(r)s=n(t),i.pop();else try{s=n(t)}finally{i.pop()}return s}function AK(t){for(const e in t)return!1;return!0}function CK(t,e,n){const{dimension:r,width:i,height:s,depth:l=0}=n,{glInternalFormat:c}=n,f=n.glTarget;switch(r){case"2d-array":case"3d":t.texStorage3D(f,e,c,i,s,l);break;default:t.texStorage2D(f,e,c,i,s)}}function yC(t,e,n,r){const{width:i,height:s}=r,{dimension:l,depth:c=0,mipLevel:f=0}=r,{x:d=0,y:g=0,z:m=0}=r,{glFormat:v,glType:S}=r,E=XO(r.glTarget,l,c),w=r.flipY?{37440:!0}:{};kg(t,w,()=>{switch(l){case"2d-array":case"3d":t.bindTexture(E,e),t.texSubImage3D(E,f,d,g,m,i,s,c,v,S,n),t.bindTexture(E,null);break;case"2d":case"cube":t.bindTexture(E,e),t.texSubImage2D(E,f,d,g,i,s,v,S,n),t.bindTexture(E,null);break;default:throw new Error(l)}})}function bC(t,e,n){const{dimension:r,width:i,height:s,depth:l=0,mipLevel:c=0,byteOffset:f=0}=n,{x:d=0,y:g=0,z:m=0}=n,{glFormat:v,glType:S,compressed:E}=n,w=XO(n.glTarget,r,l);switch(r){case"2d-array":case"3d":E?t.compressedTexSubImage3D(w,c,d,g,m,i,s,l,v,e,f):t.texSubImage3D(w,c,d,g,m,i,s,l,v,S,e,f);break;case"2d":case"cube":E?t.compressedTexSubImage2D(w,c,d,g,i,s,v,e,f):t.texSubImage2D(w,c,d,g,i,s,v,S,e,f);break;default:throw new Error(r)}}function RK(t){switch(t){case"1d":break;case"2d":return 3553;case"3d":return 32879;case"cube":return 34067;case"2d-array":return 35866}throw new Error(t)}function XO(t,e,n){return e==="cube"?34069+n:t}function xK(t,e){var A;const{sourceX:n=0,sourceY:r=0,sourceAttachment:i=0}=e||{};let{target:s=null,sourceWidth:l,sourceHeight:c,sourceDepth:f,sourceFormat:d,sourceType:g}=e||{};const{framebuffer:m,deleteFramebuffer:v}=qO(t),{gl:S,handle:E}=m;l||(l=m.width),c||(c=m.height);const w=(A=m.colorAttachments[i])==null?void 0:A.texture;if(!w)throw new Error(`Invalid framebuffer attachment ${i}`);f=(w==null?void 0:w.depth)||1,d||(d=(w==null?void 0:w.glFormat)||6408),g||(g=(w==null?void 0:w.glType)||5121),s=PK(s,g,d,l,c),g=g||wK(s);const b=S.bindFramebuffer(36160,E);return S.readBuffer(36064+i),S.readPixels(n,r,l,c,d,g,s),S.readBuffer(36064),S.bindFramebuffer(36160,b||null),v&&m.destroy(),s}function MK(t,e){const{target:n,sourceX:r=0,sourceY:i=0,sourceFormat:s=6408,targetByteOffset:l=0}=e||{};let{sourceWidth:c,sourceHeight:f,sourceType:d}=e||{};const{framebuffer:g,deleteFramebuffer:m}=qO(t);c=c||g.width,f=f||g.height;const v=g;d=d||5121;let S=n;if(!S){const w=WO(s),b=TK(d),A=l+c*f*w*b;S=v.device.createBuffer({byteLength:A})}const E=t.device.createCommandEncoder();return E.copyTextureToBuffer({sourceTexture:t,width:c,height:f,origin:[r,i],destinationBuffer:S,byteOffset:l}),E.destroy(),m&&g.destroy(),S}function qO(t){return t instanceof Tg?{framebuffer:t,deleteFramebuffer:!1}:{framebuffer:OK(t),deleteFramebuffer:!0}}function OK(t,e){const{device:n,width:r,height:i,id:s}=t;return n.createFramebuffer({...e,id:`framebuffer-for-${s}`,width:r,height:i,colorAttachments:[t]})}function PK(t,e,n,r,i,s){if(t)return t;e||(e=5121);const l=EK(e,{clamped:!1}),c=WO(n);return new l(r*i*c)}class hf extends Kn{constructor(n,r){super(n,r);O(this,"device");O(this,"gl");O(this,"handle");O(this,"sampler");O(this,"view");O(this,"mipmaps");O(this,"compressed");O(this,"glTarget");O(this,"glFormat");O(this,"glType");O(this,"glInternalFormat");O(this,"textureUnit",0);const i={...this.props};i.data=r.data,this.device=n,this.gl=this.device.gl,this.glTarget=RK(this.props.dimension);const s=$O(this.props.format);this.glInternalFormat=s.internalFormat,this.glFormat=s.format,this.glType=s.type,this.compressed=s.compressed,this.mipmaps=!!this.props.mipmaps,this._initialize(i),Object.seal(this)}_initialize(n){this.handle=this.props.handle||this.gl.createTexture(),this.device.setSpectorMetadata(this.handle,{...this.props,data:n.data});let{width:r,height:i}=n;if(!r||!i){const s=Kn.getTextureDataSize(n.data);r=(s==null?void 0:s.width)||1,i=(s==null?void 0:s.height)||1}if(this.width=r,this.height=i,this.depth=n.depth,this.setSampler(n.sampler),this.view=new tc(this.device,{...this.props,texture:this}),this.bind(),CK(this.gl,this.mipLevels,this),n.data)switch(n.dimension){case"1d":this.setTexture1DData(n.data);break;case"2d":this.setTexture2DData(n.data);break;case"3d":this.setTexture3DData(n.data);break;case"cube":this.setTextureCubeData(n.data);break;case"2d-array":this.setTextureArrayData(n.data);break;case"cube-array":this.setTextureCubeArrayData(n.data);break;default:throw new Error(n.dimension)}this.mipmaps&&this.generateMipmap()}destroy(){this.handle&&(this.gl.deleteTexture(this.handle),this.removeStats(),this.trackDeallocatedMemory("Texture"),this.destroyed=!0)}createView(n){return new tc(this.device,{...n,texture:this})}setSampler(n={}){let r;n instanceof Ry?(this.sampler=n,r=n.props):(this.sampler=new Ry(this.device,n),r=n);const i=jO(r);this._setSamplerParameters(i)}generateMipmap(n){if(!(!(this.device.isTextureFormatRenderable(this.props.format)&&this.device.isTextureFormatFilterable(this.props.format))&&(Re.warn(`${this} is not renderable or filterable, may not be able to generate mipmaps`)(),!(n!=null&&n.force))))try{this.gl.bindTexture(this.glTarget,this.handle),this.gl.generateMipmap(this.glTarget)}catch(i){Re.warn(`Error generating mipmap for ${this}: ${i.message}`)()}finally{this.gl.bindTexture(this.glTarget,null)}}copyExternalImage(n){const r=Kn.getExternalImageSize(n.image),i={...Kn.defaultCopyExternalImageOptions,...r,...n},{image:s,depth:l,mipLevel:c,x:f,y:d,z:g,flipY:m}=i;let{width:v,height:S}=i;const{dimension:E,glTarget:w,glFormat:b,glInternalFormat:A,glType:T}=this;if(v=Math.min(v,this.width-f),S=Math.min(S,this.height-d),n.sourceX||n.sourceY)throw new Error("WebGL does not support sourceX/sourceY)");return yC(this.device.gl,this.handle,s,{dimension:E,mipLevel:c,x:f,y:d,z:g,width:v,height:S,depth:l,glFormat:b,glType:T,glTarget:w,flipY:m}),{width:i.width,height:i.height}}setTexture1DData(n){throw new Error("setTexture1DData not supported in WebGL.")}setTexture2DData(n,r=0){this.bind();const i=Kn.normalizeTextureData(n,this);i.length>1&&this.props.mipmaps!==!1&&Re.warn(`Texture ${this.id} mipmap and multiple LODs.`)();for(let s=0;s1&&this.props.mipmaps!==!1&&Re.warn(`${this.id} has mipmap and multiple LODs.`)();const s=Kn.CubeFaces.indexOf(r);this.setTexture2DData(n,s)}update(){throw new Error("Texture.update() not implemented. Use ExternalTexture")}setImageDataForFace(n){const{face:r,width:i,height:s,pixels:l,data:c,format:f=6408,type:d=5121}=n,{gl:g}=this,m=l||c;this.bind(),m instanceof Promise?m.then(v=>this.setImageDataForFace(Object.assign({},n,{face:r,data:v,pixels:v}))):this.width||this.height?g.texImage2D(r,0,f,i,s,0,f,d,m):g.texImage2D(r,0,f,f,d,m)}_getImageDataMap(n){for(let r=0;r36064+f);this.device.gl.drawBuffers(l)}else this.device.gl.drawBuffers([1029]);this.clear()}end(){this.device.popState()}pushDebugGroup(n){}popDebugGroup(){}insertDebugMarker(n){}setParameters(n={}){const r={...this.glParameters};r.framebuffer=this.props.framebuffer||null,this.props.depthReadOnly&&(r.depthMask=!this.props.depthReadOnly),r.stencilMask=this.props.stencilReadOnly?0:1,r[35977]=this.props.discard,n.viewport&&(n.viewport.length>=6?(r.viewport=n.viewport.slice(0,4),r.depthRange=[n.viewport[4],n.viewport[5]]):r.viewport=n.viewport),n.scissorRect&&(r.scissorTest=!0,r.scissor=n.scissorRect),n.blendConstant&&(r.blendColor=n.blendConstant),n.stencilReference&&(console.warn("RenderPassParameters.stencilReference not yet implemented in WebGL"),n[2967]=n.stencilReference),n.colorMask&&(r.colorMask=NK.map(i=>!!(i&n.colorMask))),this.glParameters=r,Yc(this.device.gl,r)}beginOcclusionQuery(n){const r=this.props.occlusionQuerySet;r==null||r.beginOcclusionQuery()}endOcclusionQuery(){const n=this.props.occlusionQuerySet;n==null||n.endOcclusionQuery()}clear(){const n={...this.glParameters};let r=0;this.props.clearColors&&this.props.clearColors.forEach((i,s)=>{i&&this.clearColorBuffer(s,i)}),this.props.clearColor!==!1&&this.props.clearColors===void 0&&(r|=16384,n.clearColor=this.props.clearColor),this.props.clearDepth!==!1&&(r|=256,n.clearDepth=this.props.clearDepth),this.props.clearStencil!==!1&&(r|=1024,n.clearStencil=this.props.clearStencil),r!==0&&kg(this.device.gl,n,()=>{this.device.gl.clear(r)})}clearColorBuffer(n=0,r=[0,0,0,0]){kg(this.device.gl,{framebuffer:this.props.framebuffer},()=>{switch(r.constructor){case Int8Array:case Int16Array:case Int32Array:this.device.gl.clearBufferiv(6144,n,r);break;case Uint8Array:case Uint8ClampedArray:case Uint16Array:case Uint32Array:this.device.gl.clearBufferuiv(6144,n,r);break;case Float32Array:this.device.gl.clearBufferfv(6144,n,r);break;default:throw new Error("clearColorBuffer: color must be typed array")}})}}function DK(t){return FK.includes(t)}const FK=[35678,35680,35679,35682,36289,36292,36293,36298,36299,36300,36303,36306,36307,36308,36311],YO={5126:[5126,1,"float","f32","float32"],35664:[5126,2,"vec2","vec2","float32x2"],35665:[5126,3,"vec3","vec3","float32x3"],35666:[5126,4,"vec4","vec4","float32x4"],5124:[5124,1,"int","i32","sint32"],35667:[5124,2,"ivec2","vec2","sint32x2"],35668:[5124,3,"ivec3","vec3","sint32x3"],35669:[5124,4,"ivec4","vec4","sint32x4"],5125:[5125,1,"uint","u32","uint32"],36294:[5125,2,"uvec2","vec2","uint32x2"],36295:[5125,3,"uvec3","vec3","uint32x3"],36296:[5125,4,"uvec4","vec4","uint32x4"],35670:[5126,1,"bool","f32","float32"],35671:[5126,2,"bvec2","vec2","float32x2"],35672:[5126,3,"bvec3","vec3","float32x3"],35673:[5126,4,"bvec4","vec4","float32x4"],35674:[5126,8,"mat2","mat2x2"],35685:[5126,8,"mat2x3","mat2x3"],35686:[5126,8,"mat2x4","mat2x4"],35687:[5126,12,"mat3x2","mat3x2"],35675:[5126,12,"mat3","mat3x3"],35688:[5126,12,"mat3x4","mat3x4"],35689:[5126,16,"mat4x2","mat4x2"],35690:[5126,16,"mat4x3","mat4x3"],35676:[5126,16,"mat4","mat4x4"]};function KO(t){const e=YO[t];if(!e)throw new Error("uniform");const[n,r,,i]=e;return{format:i,components:r,glType:n}}function kK(t){const e=YO[t];if(!e)throw new Error("attribute");const[,n,,r,i]=e;return{attributeType:r,vertexFormat:i,components:n}}function BK(t,e){const n={attributes:[],bindings:[]};n.attributes=UK(t,e);const r=$K(t,e);for(const c of r){const f=c.uniforms.map(d=>({name:d.name,format:d.format,byteOffset:d.byteOffset,byteStride:d.byteStride,arrayLength:d.arrayLength}));n.bindings.push({type:"uniform",name:c.name,group:0,location:c.location,visibility:(c.vertex?1:0)&(c.fragment?2:0),minBindingSize:c.byteLength,uniforms:f})}const i=zK(t,e);let s=0;for(const c of i)if(DK(c.type)){const{viewDimension:f,sampleType:d}=HK(c.type);n.bindings.push({type:"texture",name:c.name,group:0,location:s,viewDimension:f,sampleType:d}),c.textureUnit=s,s+=1}i.length&&(n.uniforms=i);const l=LK(t,e);return l!=null&&l.length&&(n.varyings=l),n}function UK(t,e){const n=[],r=t.getProgramParameter(e,35721);for(let i=0;i=0){const{attributeType:d}=kK(c),g=/instance/i.test(l)?"instance":"vertex";n.push({name:l,location:f,stepMode:g,type:d})}}return n.sort((i,s)=>i.location-s.location),n}function LK(t,e){const n=[],r=t.getProgramParameter(e,35971);for(let i=0;ii.location-s.location),n}function zK(t,e){const n=[],r=t.getProgramParameter(e,35718);for(let i=0;i1)for(let S=0;St.getActiveUniformBlockParameter(e,s,l),r=[],i=t.getProgramParameter(e,35382);for(let s=0;ss.location-l.location),r}const VK={35678:["2d","float"],35680:["cube","float"],35679:["3d","float"],35682:["3d","depth"],36289:["2d-array","float"],36292:["2d-array","depth"],36293:["cube","float"],36298:["2d","sint"],36299:["3d","sint"],36300:["cube","sint"],36303:["2d-array","uint"],36306:["2d","uint"],36307:["3d","uint"],36308:["cube","uint"],36311:["2d-array","uint"]};function HK(t){const e=VK[t];if(!e)throw new Error("sampler");const[n,r]=e;return{viewDimension:n,sampleType:r}}function jK(t){if(t[t.length-1]!=="]")return{name:t,length:1,isArray:!1};const n=/([^[]*)(\[[0-9]+\])?/.exec(t);if(!n||n.length<2)throw new Error(`Failed to parse GLSL uniform name ${t}`);return{name:n[1],length:n[2]?1:0,isArray:!!n[2]}}function WK(t,e,n,r){const i=t;let s=r;s===!0&&(s=1),s===!1&&(s=0);const l=typeof s=="number"?[s]:s;switch(n){case 35678:case 35680:case 35679:case 35682:case 36289:case 36292:case 36293:case 36298:case 36299:case 36300:case 36303:case 36306:case 36307:case 36308:case 36311:if(typeof r!="number")throw new Error("samplers must be set to integers");return t.uniform1i(e,r);case 5126:return t.uniform1fv(e,l);case 35664:return t.uniform2fv(e,l);case 35665:return t.uniform3fv(e,l);case 35666:return t.uniform4fv(e,l);case 5124:return t.uniform1iv(e,l);case 35667:return t.uniform2iv(e,l);case 35668:return t.uniform3iv(e,l);case 35669:return t.uniform4iv(e,l);case 35670:return t.uniform1iv(e,l);case 35671:return t.uniform2iv(e,l);case 35672:return t.uniform3iv(e,l);case 35673:return t.uniform4iv(e,l);case 5125:return i.uniform1uiv(e,l,1);case 36294:return i.uniform2uiv(e,l,2);case 36295:return i.uniform3uiv(e,l,3);case 36296:return i.uniform4uiv(e,l,4);case 35674:return t.uniformMatrix2fv(e,!1,l);case 35675:return t.uniformMatrix3fv(e,!1,l);case 35676:return t.uniformMatrix4fv(e,!1,l);case 35685:return i.uniformMatrix2x3fv(e,!1,l);case 35686:return i.uniformMatrix2x4fv(e,!1,l);case 35687:return i.uniformMatrix3x2fv(e,!1,l);case 35688:return i.uniformMatrix3x4fv(e,!1,l);case 35689:return i.uniformMatrix4x2fv(e,!1,l);case 35690:return i.uniformMatrix4x3fv(e,!1,l)}throw new Error("Illegal uniform")}function XK(t){return xO(t)!==null||typeof t=="number"||typeof t=="boolean"}function qK(t){const e={bindings:{},uniforms:{}};return Object.keys(t).forEach(n=>{const r=t[n];XK(r)?e.uniforms[n]=r:e.bindings[n]=r}),e}function YK(t){switch(t){case"point-list":return 0;case"line-list":return 1;case"line-strip":return 3;case"triangle-list":return 4;case"triangle-strip":return 5;default:throw new Error(t)}}function KK(t){switch(t){case"point-list":return 0;case"line-list":return 1;case"line-strip":return 1;case"triangle-list":return 4;case"triangle-strip":return 4;default:throw new Error(t)}}const SC=4;class ZK extends Pc{constructor(n,r){super(n,r);O(this,"device");O(this,"handle");O(this,"vs");O(this,"fs");O(this,"introspectedLayout");O(this,"uniforms",{});O(this,"bindings",{});O(this,"varyings",null);O(this,"_uniformCount",0);O(this,"_uniformSetters",{});this.device=n,this.handle=this.props.handle||this.device.gl.createProgram(),this.device.setSpectorMetadata(this.handle,{id:this.props.id}),this.vs=r.vs,this.fs=r.fs;const{varyings:i,bufferMode:s=35981}=r;i&&i.length>0&&(this.varyings=i,this.device.gl.transformFeedbackVaryings(this.handle,i,s)),this._linkShaders(),Re.time(1,`RenderPipeline ${this.id} - shaderLayout introspection`)(),this.introspectedLayout=BK(this.device.gl,this.handle),Re.timeEnd(1,`RenderPipeline ${this.id} - shaderLayout introspection`)(),this.shaderLayout=QK(this.introspectedLayout,r.shaderLayout)}destroy(){this.handle&&(this.device.gl.deleteProgram(this.handle),this.destroyed=!0)}setBindings(n,r){for(const[i,s]of Object.entries(n)){const l=this.shaderLayout.bindings.find(c=>c.name===i)||this.shaderLayout.bindings.find(c=>c.name===`${i}Uniforms`);if(!l){const c=this.shaderLayout.bindings.map(f=>`"${f.name}"`).join(", ");r!=null&&r.disableWarnings||Re.warn(`No binding "${i}" in render pipeline "${this.id}", expected one of ${c}`,s)();continue}switch(s||Re.warn(`Unsetting binding "${i}" in render pipeline "${this.id}"`)(),l.type){case"uniform":if(!(s instanceof df)&&!(s.buffer instanceof df))throw new Error("buffer value");break;case"texture":if(!(s instanceof tc||s instanceof hf||s instanceof ff))throw new Error("texture value");break;case"sampler":Re.warn(`Ignoring sampler ${i}`)();break;default:throw new Error(l.type)}this.bindings[i]=s}}draw(n){var b;const{renderPass:r,parameters:i=this.props.parameters,topology:s=this.props.topology,vertexArray:l,vertexCount:c,instanceCount:f,isInstanced:d=!1,firstVertex:g=0,transformFeedback:m}=n,v=YK(s),S=!!l.indexBuffer,E=(b=l.indexBuffer)==null?void 0:b.glIndexType;if(this.linkStatus!=="success")return Re.info(2,`RenderPipeline:${this.id}.draw() aborted - waiting for shader linking`)(),!1;if(!this._areTexturesRenderable())return Re.info(2,`RenderPipeline:${this.id}.draw() aborted - textures not yet loaded`)(),!1;this.device.gl.useProgram(this.handle),l.bindBeforeRender(r),m&&m.begin(this.props.topology),this._applyBindings(),this._applyUniforms();const w=r;return pK(this.device,i,w.glParameters,()=>{S&&d?this.device.gl.drawElementsInstanced(v,c||0,E,g,f||0):S?this.device.gl.drawElements(v,c||0,E,g):d?this.device.gl.drawArraysInstanced(v,g,c||0,f||0):this.device.gl.drawArrays(v,g,c||0),m&&m.end()}),l.unbindAfterRender(r),!0}setUniformsWebGL(n){const{bindings:r}=qK(n);Object.keys(r).forEach(i=>{Re.warn(`Unsupported value "${JSON.stringify(r[i])}" used in setUniforms() for key ${i}. Use setBindings() instead?`)()}),Object.assign(this.uniforms,n)}async _linkShaders(){const{gl:n}=this.device;if(n.attachShader(this.handle,this.vs.handle),n.attachShader(this.handle,this.fs.handle),Re.time(SC,`linkProgram for ${this.id}`)(),n.linkProgram(this.handle),Re.timeEnd(SC,`linkProgram for ${this.id}`)(),Re.level,!this.device.features.has("compilation-status-async-webgl")){const i=this._getLinkStatus();this._reportLinkStatus(i);return}Re.once(1,"RenderPipeline linking is asynchronous")(),await this._waitForLinkComplete(),Re.info(2,`RenderPipeline ${this.id} - async linking complete: ${this.linkStatus}`)();const r=this._getLinkStatus();this._reportLinkStatus(r)}async _reportLinkStatus(n){var r;switch(n){case"success":return;default:switch(this.vs.compilationStatus){case"error":throw this.vs.debugShader(),new Error(`Error during compilation of shader ${this.vs.id}`);case"pending":this.vs.asyncCompilationStatus.then(()=>this.vs.debugShader());break}switch((r=this.fs)==null?void 0:r.compilationStatus){case"error":throw this.fs.debugShader(),new Error(`Error during compilation of shader ${this.fs.id}`);case"pending":this.fs.asyncCompilationStatus.then(()=>this.fs.debugShader());break}const i=this.device.gl.getProgramInfoLog(this.handle);throw new Error(`Error during ${n}: ${i}`)}}_getLinkStatus(){const{gl:n}=this.device;return n.getProgramParameter(this.handle,35714)?(n.validateProgram(this.handle),n.getProgramParameter(this.handle,35715)?(this.linkStatus="success","success"):(this.linkStatus="error","validation")):(this.linkStatus="error","linking")}async _waitForLinkComplete(){const n=async s=>await new Promise(l=>setTimeout(l,s));if(!this.device.features.has("compilation-status-async-webgl")){await n(10);return}const{gl:i}=this.device;for(;;){if(i.getProgramParameter(this.handle,37297))return;await n(10)}}_areTexturesRenderable(){let n=!0;for(const r of this.shaderLayout.bindings)!this.bindings[r.name]&&!this.bindings[r.name.replace(/Uniforms$/,"")]&&(Re.warn(`Binding ${r.name} not found in ${this.id}`)(),n=!1);return n}_applyBindings(){if(this.linkStatus!=="success")return;const{gl:n}=this.device;n.useProgram(this.handle);let r=0,i=0;for(const s of this.shaderLayout.bindings){const l=this.bindings[s.name]||this.bindings[s.name.replace(/Uniforms$/,"")];if(!l)throw new Error(`No value for binding ${s.name} in ${this.id}`);switch(s.type){case"uniform":const{name:c}=s,f=n.getUniformBlockIndex(this.handle,c);if(f===4294967295)throw new Error(`Invalid uniform block name ${c}`);n.uniformBlockBinding(this.handle,i,f),l instanceof df?n.bindBufferBase(35345,i,l.handle):n.bindBufferRange(35345,i,l.buffer.handle,l.offset||0,l.size||l.buffer.byteLength-l.offset),i+=1;break;case"texture":if(!(l instanceof tc||l instanceof hf||l instanceof ff))throw new Error("texture");let d;if(l instanceof tc)d=l.texture;else if(l instanceof hf)d=l;else if(l instanceof ff&&l.colorAttachments[0]instanceof tc)Re.warn("Passing framebuffer in texture binding may be deprecated. Use fbo.colorAttachments[0] instead")(),d=l.colorAttachments[0].texture;else throw new Error("No texture");n.activeTexture(33984+r),n.bindTexture(d.glTarget,d.handle),r+=1;break;case"sampler":break;case"storage":case"read-only-storage":throw new Error(`binding type '${s.type}' not supported in WebGL`)}}}_applyUniforms(){for(const n of this.shaderLayout.uniforms||[]){const{name:r,location:i,type:s,textureUnit:l}=n,c=this.uniforms[r]??l;c!==void 0&&WK(this.device.gl,i,s,c)}}}function QK(t,e){const n={...t,attributes:t.attributes.map(r=>({...r}))};for(const r of(e==null?void 0:e.attributes)||[]){const i=n.attributes.find(s=>s.name===r.name);i?(i.type=r.type||i.type,i.stepMode=r.stepMode||i.stepMode):Re.warn(`shader layout attribute ${r.name} not present in shader`)}return n}class GK extends ry{constructor(n){super(n,{});O(this,"device");O(this,"commands",[]);this.device=n}submitCommands(n=this.commands){for(const r of n)switch(r.name){case"copy-buffer-to-buffer":JK(this.device,r.options);break;case"copy-buffer-to-texture":eZ(this.device,r.options);break;case"copy-texture-to-buffer":tZ(this.device,r.options);break;case"copy-texture-to-texture":nZ(this.device,r.options);break;default:throw new Error(r.name)}}}function JK(t,e){const n=e.sourceBuffer,r=e.destinationBuffer;t.gl.bindBuffer(36662,n.handle),t.gl.bindBuffer(36663,r.handle),t.gl.copyBufferSubData(36662,36663,e.sourceOffset??0,e.destinationOffset??0,e.size),t.gl.bindBuffer(36662,null),t.gl.bindBuffer(36663,null)}function eZ(t,e){throw new Error("Not implemented")}function tZ(t,e){const{sourceTexture:n,mipLevel:r=0,aspect:i="all",width:s=e.sourceTexture.width,height:l=e.sourceTexture.height,depthOrArrayLayers:c=0,origin:f=[0,0],destinationBuffer:d,byteOffset:g=0,bytesPerRow:m,rowsPerImage:v}=e;if(i!=="all")throw new Error("aspect not supported in WebGL");if(r!==0||c!==0||m||v)throw new Error("not implemented");const{framebuffer:S,destroyFramebuffer:E}=ZO(n);let w;try{const b=d,A=s||S.width,T=l||S.height,C=$O(S.colorAttachments[0].texture.props.format),M=C.format,x=C.type;t.gl.bindBuffer(35051,b.handle),w=t.gl.bindFramebuffer(36160,S.handle),t.gl.readPixels(f[0],f[1],A,T,M,x,g)}finally{t.gl.bindBuffer(35051,null),w!==void 0&&t.gl.bindFramebuffer(36160,w),E&&S.destroy()}}function nZ(t,e){const{sourceTexture:n,destinationMipLevel:r=0,origin:i=[0,0],destinationOrigin:s=[0,0],destinationTexture:l}=e;let{width:c=e.destinationTexture.width,height:f=e.destinationTexture.height}=e;const{framebuffer:d,destroyFramebuffer:g}=ZO(n),[m,v]=i,[S,E,w]=s,b=t.gl.bindFramebuffer(36160,d.handle);let A=null,T;if(l instanceof hf)A=l,c=Number.isFinite(c)?c:A.width,f=Number.isFinite(f)?f:A.height,A.bind(0),T=A.glTarget;else throw new Error("invalid destination");switch(T){case 3553:case 34067:t.gl.copyTexSubImage2D(T,r,S,E,m,v,c,f);break;case 35866:case 32879:t.gl.copyTexSubImage3D(T,r,S,E,w,m,v,c,f);break}A&&A.unbind(),t.gl.bindFramebuffer(36160,b),g&&d.destroy()}function ZO(t){if(t instanceof Kn){const{width:e,height:n,id:r}=t;return{framebuffer:t.device.createFramebuffer({id:`framebuffer-for-${r}`,width:e,height:n,colorAttachments:[t]}),destroyFramebuffer:!0}}return{framebuffer:t,destroyFramebuffer:!1}}class rZ extends ny{constructor(n,r){super(n,r);O(this,"device");O(this,"commandBuffer");this.device=n,this.commandBuffer=new GK(n)}destroy(){}finish(){this.commandBuffer.submitCommands()}copyBufferToBuffer(n){this.commandBuffer.commands.push({name:"copy-buffer-to-buffer",options:n})}copyBufferToTexture(n){this.commandBuffer.commands.push({name:"copy-buffer-to-texture",options:n})}copyTextureToBuffer(n){this.commandBuffer.commands.push({name:"copy-texture-to-buffer",options:n})}copyTextureToTexture(n){this.commandBuffer.commands.push({name:"copy-texture-to-texture",options:n})}pushDebugGroup(n){}popDebugGroup(){}insertDebugMarker(n){}resolveQuerySet(n,r,i){}}function iZ(t){const{target:e,source:n,start:r=0,count:i=1}=t,s=n.length,l=i*s;let c=0;for(let f=r;c{for(const r in n)this.setBuffer(r,n[r])})}setBuffer(n,r){const i=this._getVaryingIndex(n),{buffer:s,byteLength:l,byteOffset:c}=this._getBufferRange(r);if(i<0){this.unusedBuffers[n]=s,Re.warn(`${this.id} unusedBuffers varying buffer ${n}`)();return}this.buffers[i]={buffer:s,byteLength:l,byteOffset:c},this.bindOnUse||this._bindBuffer(i,s,c,l)}getBuffer(n){if(wC(n))return this.buffers[n]||null;const r=this._getVaryingIndex(n);return r>=0?this.buffers[r]:null}bind(n=this.handle){if(typeof n!="function")return this.gl.bindTransformFeedback(36386,n),this;let r;return this._bound?r=n():(this.gl.bindTransformFeedback(36386,this.handle),this._bound=!0,r=n(),this._bound=!1,this.gl.bindTransformFeedback(36386,null)),r}unbind(){this.bind(null)}_getBufferRange(n){if(n instanceof df)return{buffer:n,byteOffset:0,byteLength:n.byteLength};const{buffer:r,byteOffset:i=0,byteLength:s=n.buffer.byteLength}=n;return{buffer:r,byteOffset:i,byteLength:s}}_getVaryingIndex(n){if(wC(n))return Number(n);for(const r of this.layout.varyings)if(n===r.name)return r.location;return-1}_bindBuffers(){for(const n in this.buffers){const{buffer:r,byteLength:i,byteOffset:s}=this._getBufferRange(this.buffers[n]);this._bindBuffer(Number(n),r,s,i)}}_unbindBuffers(){for(const n in this.buffers)this.gl.bindBufferBase(35982,Number(n),null)}_bindBuffer(n,r,i=0,s){const l=r&&r.handle;!l||s===void 0?this.gl.bindBufferBase(35982,n,l):this.gl.bindBufferRange(35982,n,l,i,s)}}function wC(t){return typeof t=="number"?Number.isInteger(t):/^\d+$/.test(t)}class lZ extends ay{constructor(n,r){super(n,r);O(this,"device");O(this,"handle");O(this,"target",null);O(this,"_queryPending",!1);O(this,"_pollingPromise",null);if(this.device=n,r.count>1)throw new Error("WebGL QuerySet can only have one value");this.handle=this.device.gl.createQuery(),Object.seal(this)}get[Symbol.toStringTag](){return"Query"}destroy(){this.device.gl.deleteQuery(this.handle)}beginTimestampQuery(){return this._begin(35007)}endTimestampQuery(){this._end()}beginOcclusionQuery(n){return this._begin(n!=null&&n.conservative?36202:35887)}endOcclusionQuery(){this._end()}beginTransformFeedbackQuery(){return this._begin(35976)}endTransformFeedbackQuery(){this._end()}async resolveQuery(){return[await this.pollQuery()]}_begin(n){this._queryPending||(this.target=n,this.device.gl.beginQuery(this.target,this.handle))}_end(){this._queryPending||this.target&&(this.device.gl.endQuery(this.target),this.target=null,this._queryPending=!0)}isResultAvailable(){if(!this._queryPending)return!1;const n=this.device.gl.getQueryParameter(this.handle,34919);return n&&(this._queryPending=!1),n}isTimerDisjoint(){return this.device.gl.getParameter(36795)}getResult(){return this.device.gl.getQueryParameter(this.handle,34918)}getTimerMilliseconds(){return this.getResult()/1e6}pollQuery(n=Number.POSITIVE_INFINITY){if(this._pollingPromise)return this._pollingPromise;let r=0;return this._pollingPromise=new Promise((i,s)=>{const l=()=>{this.isResultAvailable()?(i(this.getResult()),this._pollingPromise=null):r++>n?(s("Timed out"),this._pollingPromise=null):requestAnimationFrame(l)};requestAnimationFrame(l)}),this._pollingPromise}}class Ua extends La{constructor(n){var m,v;super({...n,id:n.id||uK("webgl-device")});O(this,"type","webgl");O(this,"handle");O(this,"features");O(this,"limits");O(this,"info");O(this,"canvasContext");O(this,"lost");O(this,"_resolveContextLost");O(this,"gl");O(this,"debug",!1);O(this,"_canvasSizeInfo",{clientWidth:0,clientHeight:0,devicePixelRatio:1});O(this,"_extensions",{});O(this,"_polyfilled",!1);O(this,"spectorJS");O(this,"renderPass",null);O(this,"_constants");const r=La._getCanvasContextProps(n);if(!r)throw new Error("WebGLDevice requires props.createCanvasContext to be set");let i=(v=(m=r.canvas)==null?void 0:m.gl)==null?void 0:v.device;if(i)throw new Error(`WebGL context already attached to device ${i.id}`);this.canvasContext=new JY(this,r),this.lost=new Promise(S=>{this._resolveContextLost=S});const s={...n.webgl};r.alphaMode==="premultiplied"&&(s.premultipliedAlpha=!0),n.powerPreference!==void 0&&(s.powerPreference=n.powerPreference);const c=this.props._handle||IY(this.canvasContext.canvas,{onContextLost:S=>{var E;return(E=this._resolveContextLost)==null?void 0:E.call(this,{reason:"destroyed",message:"Entered sleep mode, or too many apps or browser tabs are using the GPU."})},onContextRestored:S=>console.log("WebGL context restored")},s);if(!c)throw new Error("WebGL context creation failed");if(i=c.device,i){if(n._reuseDevices)return Re.log(1,`Not creating a new Device, instead returning a reference to Device ${i.id} already attached to WebGL context`,i)(),i._reused=!0,i;throw new Error(`WebGL context already attached to device ${i.id}`)}this.handle=c,this.gl=c,this.spectorJS=nK({...this.props,gl:this.handle}),this.gl.device=this,this.gl._version=2,this.info=DY(this.gl,this._extensions),this.limits=new ZY(this.gl),this.features=new KY(this.gl,this._extensions,this.props._disabledFeatures),this.props._initializeFeatures&&this.features.initializeFeatures(),r.autoResize!==!1&&this.canvasContext.resize(),new Lo(this.gl,{log:(...S)=>Re.log(1,...S)()}).trackState(this.gl,{copyState:!1});const d=n.debugWebGL||n.debug,g=n.debugWebGL;d&&(this.gl=sK(this.gl,{debugWebGL:d,traceWebGL:g}),Re.warn("WebGL debug mode activated. Performance reduced.")(),n.debugWebGL&&(Re.level=Math.max(Re.level,1)))}destroy(){!this.props._reuseDevices&&!this._reused&&delete this.gl.device}get isLost(){return this.gl.isContextLost()}createCanvasContext(n){throw new Error("WebGL only supports a single canvas")}createBuffer(n){const r=this._normalizeBufferProps(n);return new df(this,r)}createTexture(n){return new hf(this,n)}createExternalTexture(n){throw new Error("createExternalTexture() not implemented")}createSampler(n){return new Ry(this,n)}createShader(n){return new gK(this,n)}createFramebuffer(n){return new ff(this,n)}createVertexArray(n){return new Lb(this,n)}createTransformFeedback(n){return new oZ(this,n)}createQuerySet(n){return new lZ(this,n)}createRenderPipeline(n){return new ZK(this,n)}beginRenderPass(n){return new IK(this,n)}createComputePipeline(n){throw new Error("ComputePipeline not supported in WebGL")}beginComputePass(n){throw new Error("ComputePass not supported in WebGL")}createCommandEncoder(n={}){return new rZ(this,n)}submit(){var n;(n=this.renderPass)==null||n.end(),this.renderPass=null}readPixelsToArrayWebGL(n,r){return xK(n,r)}readPixelsToBufferWebGL(n,r){return MK(n,r)}setParametersWebGL(n){Yc(this.gl,n)}getParametersWebGL(n){return UO(this.gl,n)}withParametersWebGL(n,r){return kg(this.gl,n,r)}resetWebGL(){Re.warn("WebGLDevice.resetWebGL is deprecated, use only for debugging")(),xY(this.gl)}_getDeviceSpecificTextureFormatCapabilities(n){return WY(this.gl,n,this._extensions)}loseDevice(){var s;let n=!1;const i=this.getExtension("WEBGL_lose_context").WEBGL_lose_context;return i&&(n=!0,i.loseContext()),(s=this._resolveContextLost)==null||s.call(this,{reason:"destroyed",message:"Application triggered context loss"}),n}pushState(){Lo.get(this.gl).push()}popState(){Lo.get(this.gl).pop()}setSpectorMetadata(n,r){n.__SPECTOR_Metadata=r}getGLKey(n,r){const i=Number(n);for(const s in this.gl)if(this.gl[s]===i)return`GL.${s}`;return r!=null&&r.emptyIfUnknown?"":String(n)}getGLKeys(n){const r={emptyIfUnknown:!0};return Object.entries(n).reduce((i,[s,l])=>(i[`${s}:${this.getGLKey(s,r)}`]=`${l}:${this.getGLKey(l,r)}`,i),{})}setConstantAttributeWebGL(n,r){const i=this.limits.maxVertexAttributes;this._constants=this._constants||new Array(i).fill(null);const s=this._constants[n];switch(s&&dZ(s,r)&&Re.info(1,`setConstantAttributeWebGL(${n}) could have been skipped, value unchanged`)(),this._constants[n]=r,r.constructor){case Float32Array:cZ(this,n,r);break;case Int32Array:uZ(this,n,r);break;case Uint32Array:fZ(this,n,r);break;default:throw new Error("constant")}}getExtension(n){return Lc(this.gl,n,this._extensions),this._extensions}}function cZ(t,e,n){switch(n.length){case 1:t.gl.vertexAttrib1fv(e,n);break;case 2:t.gl.vertexAttrib2fv(e,n);break;case 3:t.gl.vertexAttrib3fv(e,n);break;case 4:t.gl.vertexAttrib4fv(e,n);break}}function uZ(t,e,n){t.gl.vertexAttribI4iv(e,n)}function fZ(t,e,n){t.gl.vertexAttribI4uiv(e,n)}function dZ(t,e){if(!t||!e||t.length!==e.length||t.constructor!==e.constructor)return!1;for(let n=0;n({drawBuffersWEBGL(e){return t.drawBuffers(e)},COLOR_ATTACHMENT0_WEBGL:36064,COLOR_ATTACHMENT1_WEBGL:36065,COLOR_ATTACHMENT2_WEBGL:36066,COLOR_ATTACHMENT3_WEBGL:36067}),pZ=t=>({VERTEX_ARRAY_BINDING_OES:34229,createVertexArrayOES(){return t.createVertexArray()},deleteVertexArrayOES(e){return t.deleteVertexArray(e)},isVertexArrayOES(e){return t.isVertexArray(e)},bindVertexArrayOES(e){return t.bindVertexArray(e)}}),mZ=t=>({VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE:35070,drawArraysInstancedANGLE(...e){return t.drawArraysInstanced(...e)},drawElementsInstancedANGLE(...e){return t.drawElementsInstanced(...e)},vertexAttribDivisorANGLE(...e){return t.vertexAttribDivisor(...e)}});function vZ(t=!0){const e=HTMLCanvasElement.prototype;if(!t&&e.originalGetContext){e.getContext=e.originalGetContext,e.originalGetContext=void 0;return}e.originalGetContext=e.getContext,e.getContext=function(n,r){if(n==="webgl"||n==="experimental-webgl"){const i=this.originalGetContext("webgl2",r);return i instanceof HTMLElement&&_Z(i),i}return this.originalGetContext(n,r)}}function _Z(t){t.getExtension("EXT_color_buffer_float");const e={...hZ,WEBGL_disjoint_timer_query:t.getExtension("EXT_disjoint_timer_query_webgl2"),WEBGL_draw_buffers:gZ(t),OES_vertex_array_object:pZ(t),ANGLE_instanced_arrays:mZ(t)},n=t.getExtension;t.getExtension=function(i){const s=n.call(t,i);return s||(i in e?e[i]:null)};const r=t.getSupportedExtensions;t.getSupportedExtensions=function(){const i=r.apply(t)||[];return i==null?void 0:i.concat(Object.keys(e))}}const Nh=1;class yZ extends OV{constructor(){super();O(this,"type","webgl");La.defaultProps={...La.defaultProps,...Ub},Ua.adapter=this}isSupported(){return typeof WebGL2RenderingContext<"u"}enforceWebGL2(n){vZ(n)}async attach(n){if(n instanceof Ua)return n;if((n==null?void 0:n.device)instanceof La)return n.device;if(!bZ(n))throw new Error("Invalid WebGL2RenderingContext");return new Ua({_handle:n,createCanvasContext:{canvas:n.canvas,autoResize:!1}})}async create(n={}){Re.groupCollapsed(Nh,"WebGLDevice created")();const r=[];(n.debugWebGL||n.debug)&&r.push(iK()),n.debugSpectorJS&&r.push(tK(n));const i=await Promise.allSettled(r);for(const c of i)c.status==="rejected"&&Re.error(`Failed to initialize debug libraries ${c.reason}`)();const s=new Ua(n),l=`${s._reused?"Reusing":"Created"} device with WebGL2 ${s.debug?"debug ":""}context: ${s.info.vendor}, ${s.info.renderer} for canvas: ${s.canvasContext.id}`;return Re.probe(Nh,l)(),Re.table(Nh,s.info)(),Re.groupEnd(Nh)(),s}}function bZ(t){return typeof WebGL2RenderingContext<"u"&&t instanceof WebGL2RenderingContext?!0:!!(t&&Number.isFinite(t._version))}const EC=new yZ;function ba(){}const SZ=({isDragging:t})=>t?"grabbing":"grab",QO={id:"",width:"100%",height:"100%",style:null,viewState:null,initialViewState:null,pickingRadius:0,layerFilter:null,parameters:{},parent:null,device:null,deviceProps:{type:"webgl"},gl:null,canvas:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,touchAction:"none",eventRecognizerOptions:{},_framebuffer:null,_animate:!1,_pickable:!0,_typedArrayManagerProps:{},_customRender:null,widgets:[],onDeviceInitialized:ba,onWebGLInitialized:ba,onResize:ba,onViewStateChange:ba,onInteractionStateChange:ba,onBeforeRender:ba,onAfterRender:ba,onLoad:ba,onError:t=>Sn.error(t.message,t.cause)(),onHover:null,onClick:null,onDragStart:null,onDrag:null,onDragEnd:null,_onMetrics:null,getCursor:SZ,getTooltip:null,debug:!1,drawPickingColors:!1};class zb{constructor(e){this.width=0,this.height=0,this.userData={},this.device=null,this.canvas=null,this.viewManager=null,this.layerManager=null,this.effectManager=null,this.deckRenderer=null,this.deckPicker=null,this.eventManager=null,this.widgetManager=null,this.tooltip=null,this.animationLoop=null,this.cursorState={isHovering:!1,isDragging:!1},this.stats=new ip({id:"deck.gl"}),this.metrics={fps:0,setPropsTime:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this._needsRedraw="Initial render",this._pickRequest={mode:"hover",x:-1,y:-1,radius:0,event:null},this._lastPointerDownInfo=null,this._onPointerMove=r=>{const{_pickRequest:i}=this;if(r.type==="pointerleave")i.x=-1,i.y=-1,i.radius=0;else{if(r.leftButton||r.rightButton)return;{const s=r.offsetCenter;if(!s)return;i.x=s.x,i.y=s.y,i.radius=this.props.pickingRadius}}this.layerManager&&(this.layerManager.context.mousePosition={x:i.x,y:i.y}),i.event=r},this._onEvent=r=>{const i=my[r.type],s=r.offsetCenter;if(!i||!s||!this.layerManager)return;const l=this.layerManager.getLayers(),c=this.deckPicker.getLastPickedObject({x:s.x,y:s.y,layers:l,viewports:this.getViewports(s)},this._lastPointerDownInfo),{layer:f}=c,d=f&&(f[i]||f.props[i]),g=this.props[i];let m=!1;d&&(m=d.call(f,c,r)),m||(g==null||g(c,r),this.widgetManager.onEvent(c,r))},this._onPointerDown=r=>{const i=r.offsetCenter,s=this._pick("pickObject","pickObject Time",{x:i.x,y:i.y,radius:this.props.pickingRadius});this._lastPointerDownInfo=s.result[0]||s.emptyInfo},this.props={...QO,...e},e=this.props,e.viewState&&e.initialViewState&&Sn.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),this.viewState=this.props.initialViewState,e.device&&(this.device=e.device);let n=this.device;!n&&e.gl&&(e.gl instanceof WebGLRenderingContext&&Sn.error("WebGL1 context not supported.")(),n=EC.attach(e.gl)),n||(n=J_.createDevice({type:"best-available",_reuseDevices:!0,adapters:[EC],...e.deviceProps,createCanvasContext:{canvas:this._createCanvas(e),useDevicePixels:this.props.useDevicePixels,autoResize:!1}})),this.animationLoop=this._createAnimationLoop(n,e),this.setProps(e),e._typedArrayManagerProps&&Bf.setOptions(e._typedArrayManagerProps),this.animationLoop.start()}finalize(){var e,n,r,i,s,l,c,f,d,g;(e=this.animationLoop)==null||e.stop(),(n=this.animationLoop)==null||n.destroy(),this.animationLoop=null,this._lastPointerDownInfo=null,(r=this.layerManager)==null||r.finalize(),this.layerManager=null,(i=this.viewManager)==null||i.finalize(),this.viewManager=null,(s=this.effectManager)==null||s.finalize(),this.effectManager=null,(l=this.deckRenderer)==null||l.finalize(),this.deckRenderer=null,(c=this.deckPicker)==null||c.finalize(),this.deckPicker=null,(f=this.eventManager)==null||f.destroy(),this.eventManager=null,(d=this.widgetManager)==null||d.finalize(),this.widgetManager=null,!this.props.canvas&&!this.props.device&&!this.props.gl&&this.canvas&&((g=this.canvas.parentElement)==null||g.removeChild(this.canvas),this.canvas=null)}setProps(e){var r;this.stats.get("setProps Time").timeStart(),"onLayerHover"in e&&Sn.removed("onLayerHover","onHover")(),"onLayerClick"in e&&Sn.removed("onLayerClick","onClick")(),e.initialViewState&&!Ji(this.props.initialViewState,e.initialViewState,3)&&(this.viewState=e.initialViewState),Object.assign(this.props,e),this._setCanvasSize(this.props);const n=Object.create(this.props);Object.assign(n,{views:this._getViews(),width:this.width,height:this.height,viewState:this._getViewState()}),(r=this.animationLoop)==null||r.setProps(n),this.layerManager&&(this.viewManager.setProps(n),this.layerManager.activateViewport(this.getViewports()[0]),this.layerManager.setProps(n),this.effectManager.setProps(n),this.deckRenderer.setProps(n),this.deckPicker.setProps(n),this.widgetManager.setProps(n)),this.stats.get("setProps Time").timeEnd()}needsRedraw(e={clearRedrawFlags:!1}){if(!this.layerManager)return!1;if(this.props._animate)return"Deck._animate";let n=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);const r=this.viewManager.needsRedraw(e),i=this.layerManager.needsRedraw(e),s=this.effectManager.needsRedraw(e),l=this.deckRenderer.needsRedraw(e);return n=n||r||i||s||l,n}redraw(e){if(!this.layerManager)return;let n=this.needsRedraw({clearRedrawFlags:!0});n=e||n,n&&(this.stats.get("Redraw Count").incrementCount(),this.props._customRender?this.props._customRender(n):this._drawLayers(n))}get isInitialized(){return this.viewManager!==null}getViews(){return Br(this.viewManager),this.viewManager.views}getViewports(e){return Br(this.viewManager),this.viewManager.getViewports(e)}getCanvas(){return this.canvas}pickObject(e){const n=this._pick("pickObject","pickObject Time",e).result;return n.length?n[0]:null}pickMultipleObjects(e){return e.depth=e.depth||10,this._pick("pickObject","pickMultipleObjects Time",e).result}pickObjects(e){return this._pick("pickObjects","pickObjects Time",e)}_addResources(e,n=!1){for(const r in e)this.layerManager.resourceManager.add({resourceId:r,data:e[r],forceUpdate:n})}_removeResources(e){for(const n of e)this.layerManager.resourceManager.remove(n)}_addDefaultEffect(e){this.effectManager.addDefaultEffect(e)}_addDefaultShaderModule(e){this.layerManager.addDefaultShaderModule(e)}_removeDefaultShaderModule(e){var n;(n=this.layerManager)==null||n.removeDefaultShaderModule(e)}_pick(e,n,r){Br(this.deckPicker);const{stats:i}=this;i.get("Pick Count").incrementCount(),i.get(n).timeStart();const s=this.deckPicker[e]({layers:this.layerManager.getLayers(r),views:this.viewManager.getViews(),viewports:this.getViewports(r),onViewportActive:this.layerManager.activateViewport,effects:this.effectManager.getEffects(),...r});return i.get(n).timeEnd(),s}_createCanvas(e){let n=e.canvas;return typeof n=="string"&&(n=document.getElementById(n),Br(n)),n||(n=document.createElement("canvas"),n.id=e.id||"deckgl-overlay",(e.parent||document.body).appendChild(n)),Object.assign(n.style,e.style),n}_setCanvasSize(e){var i;if(!this.canvas)return;const{width:n,height:r}=e;if(n||n===0){const s=Number.isFinite(n)?`${n}px`:n;this.canvas.style.width=s}if(r||r===0){const s=Number.isFinite(r)?`${r}px`:r;this.canvas.style.position=((i=e.style)==null?void 0:i.position)||"absolute",this.canvas.style.height=s}}_updateCanvasSize(){var i,s;const{canvas:e}=this;if(!e)return;const n=e.clientWidth??e.width,r=e.clientHeight??e.height;(n!==this.width||r!==this.height)&&(this.width=n,this.height=r,(i=this.viewManager)==null||i.setProps({width:n,height:r}),(s=this.layerManager)==null||s.activateViewport(this.getViewports()[0]),this.props.onResize({width:n,height:r}))}_createAnimationLoop(e,n){const{gl:r,onError:i,useDevicePixels:s}=n;return new gq({device:e,useDevicePixels:s,autoResizeDrawingBuffer:!r,autoResizeViewport:!1,onInitialize:l=>this._setDevice(l.device),onRender:this._onRenderFrame.bind(this),onError:i})}_getViewState(){return this.props.viewState||this.viewState}_getViews(){const{views:e}=this.props,n=Array.isArray(e)?e:e?[e]:[new FO({id:"default-view"})];return n.length&&this.props.controller&&(n[0].props.controller=this.props.controller),n}_onContextLost(){const{onError:e}=this.props;this.animationLoop&&e&&e(new Error("WebGL context is lost"))}_pickAndCallback(){var n,r,i;const{_pickRequest:e}=this;if(e.event){const{result:s,emptyInfo:l}=this._pick("pickObject","pickObject Time",e);this.cursorState.isHovering=s.length>0;let c=l,f=!1;for(const d of s)c=d,f=((n=d.layer)==null?void 0:n.onHover(d,e.event))||f;f||((i=(r=this.props).onHover)==null||i.call(r,c,e.event),this.widgetManager.onHover(c,e.event)),e.event=null}}_updateCursor(){const e=this.props.parent||this.canvas;e&&(e.style.cursor=this.props.getCursor(this.cursorState))}_setDevice(e){var i,s;if(this.device=e,!this.animationLoop)return;this.canvas||(this.canvas=(i=this.device.canvasContext)==null?void 0:i.canvas),this.device instanceof Ua&&this.device.setParametersWebGL({blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onDeviceInitialized(this.device),this.device instanceof Ua&&this.props.onWebGLInitialized(this.device.gl);const n=new RO;n.play(),this.animationLoop.attachTimeline(n),this.eventManager=new QW(this.props.parent||this.canvas,{touchAction:this.props.touchAction,recognizers:Object.keys(HA).map(l=>{var S;const[c,f,d,g]=HA[l],m=(S=this.props.eventRecognizerOptions)==null?void 0:S[l],v={...f,...m,event:l};return{recognizer:new c(v),recognizeWith:d,requestFailure:g}}),events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerMove}});for(const l in my)this.eventManager.on(l,this._onEvent);this.viewManager=new Yq({timeline:n,eventManager:this.eventManager,onViewStateChange:this._onViewStateChange.bind(this),onInteractionStateChange:this._onInteractionStateChange.bind(this),views:this._getViews(),viewState:this._getViewState(),width:this.width,height:this.height});const r=this.viewManager.getViewports()[0];this.layerManager=new qq(this.device,{deck:this,stats:this.stats,viewport:r,timeline:n}),this.effectManager=new uY({deck:this,device:this.device}),this.deckRenderer=new hY(this.device),this.deckPicker=new yY(this.device),this.widgetManager=new wY({deck:this,parentElement:(s=this.canvas)==null?void 0:s.parentElement}),this.widgetManager.addDefault(new TY),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}_drawLayers(e,n){var l;const{device:r,gl:i}=this.layerManager.context;this.props.onBeforeRender({device:r,gl:i});const s={target:this.props._framebuffer,layers:this.layerManager.getLayers(),viewports:this.viewManager.getViewports(),onViewportActive:this.layerManager.activateViewport,views:this.viewManager.getViews(),pass:"screen",effects:this.effectManager.getEffects(),...n};(l=this.deckRenderer)==null||l.renderLayers(s),s.pass==="screen"&&this.widgetManager.onRedraw({viewports:s.viewports,layers:s.layers}),this.props.onAfterRender({device:r,gl:i})}_onRenderFrame(){this._getFrameStats(),this._metricsCounter++%60===0&&(this._getMetrics(),this.stats.reset(),Sn.table(4,this.metrics)(),this.props._onMetrics&&this.props._onMetrics(this.metrics)),this._updateCanvasSize(),this._updateCursor(),this.layerManager.updateLayers(),this._pickAndCallback(),this.redraw(),this.viewManager&&this.viewManager.updateViewStates()}_onViewStateChange(e){const n=this.props.onViewStateChange(e)||e.viewState;this.viewState&&(this.viewState={...this.viewState,[e.viewId]:n},this.props.viewState||this.viewManager&&this.viewManager.setProps({viewState:this.viewState}))}_onInteractionStateChange(e){this.cursorState.isDragging=e.isDragging||!1,this.props.onInteractionStateChange(e)}_getFrameStats(){const{stats:e}=this;e.get("frameRate").timeEnd(),e.get("frameRate").timeStart();const n=this.animationLoop.stats;e.get("GPU Time").addTime(n.get("GPU Time").lastTiming),e.get("CPU Time").addTime(n.get("CPU Time").lastTiming)}_getMetrics(){const{metrics:e,stats:n}=this;e.fps=n.get("frameRate").getHz(),e.setPropsTime=n.get("setProps Time").time,e.updateAttributesTime=n.get("Update Attributes").time,e.framesRedrawn=n.get("Redraw Count").count,e.pickTime=n.get("pickObject Time").time+n.get("pickMultipleObjects Time").time+n.get("pickObjects Time").time,e.pickCount=n.get("Pick Count").count,e.gpuTime=n.get("GPU Time").time,e.cpuTime=n.get("CPU Time").time,e.gpuTimePerFrame=n.get("GPU Time").getAverageTime(),e.cpuTimePerFrame=n.get("CPU Time").getAverageTime();const r=J_.stats.get("Memory Usage");e.bufferMemory=r.get("Buffer Memory").count,e.textureMemory=r.get("Texture Memory").count,e.renderbufferMemory=r.get("Renderbuffer Memory").count,e.gpuMemory=r.get("GPU Memory").count}}zb.defaultProps=QO;zb.VERSION=F$;function wZ(t){switch(t){case"float64":return Float64Array;case"uint8":case"unorm8":return Uint8ClampedArray;default:return LM(t)}}const EZ=UM;function Ih(t,e){return{attribute:t,format:e.size>1?`${e.type}x${e.size}`:e.type,byteOffset:e.offset||0}}function Ao(t){return t.stride||t.size*t.bytesPerElement}function TZ(t,e){return t.type===e.type&&t.size===e.size&&Ao(t)===Ao(e)&&(t.offset||0)===(e.offset||0)}function xy(t,e){e.offset&&Sn.removed("shaderAttribute.offset","vertexOffset, elementOffset")();const n=Ao(t),r=e.vertexOffset!==void 0?e.vertexOffset:t.vertexOffset||0,i=e.elementOffset||0,s=r*n+i*t.bytesPerElement+(t.offset||0);return{...e,offset:s,stride:n}}function AZ(t,e){const n=xy(t,e);return{high:n,low:{...n,offset:n.offset+t.size*4}}}class CZ{constructor(e,n,r){this._buffer=null,this.device=e,this.id=n.id||"",this.size=n.size||1;const i=n.logicalType||n.type,s=i==="float64";let{defaultValue:l}=n;l=Number.isFinite(l)?[l]:l||new Array(this.size).fill(0);let c;s?c="float32":!i&&n.isIndexed?c="uint32":c=i||"float32";let f=wZ(i||c);this.doublePrecision=s,s&&n.fp64===!1&&(f=Float32Array),this.value=null,this.settings={...n,defaultType:f,defaultValue:l,logicalType:i,type:c,normalized:c.includes("norm"),size:this.size,bytesPerElement:f.BYTES_PER_ELEMENT},this.state={...r,externalBuffer:null,bufferAccessor:this.settings,allocatedValue:null,numInstances:0,bounds:null,constant:!1}}get isConstant(){return this.state.constant}get buffer(){return this._buffer}get byteOffset(){const e=this.getAccessor();return e.vertexOffset?e.vertexOffset*Ao(e):0}get numInstances(){return this.state.numInstances}set numInstances(e){this.state.numInstances=e}delete(){this._buffer&&(this._buffer.delete(),this._buffer=null),Bf.release(this.state.allocatedValue)}getBuffer(){return this.state.constant?null:this.state.externalBuffer||this._buffer}getValue(e=this.id,n=null){const r={};if(this.state.constant){const i=this.value;if(n){const s=xy(this.getAccessor(),n),l=s.offset/i.BYTES_PER_ELEMENT,c=s.size||this.size;r[e]=i.subarray(l,l+c)}else r[e]=i}else r[e]=this.getBuffer();return this.doublePrecision&&(this.value instanceof Float64Array?r[`${e}64Low`]=r[e]:r[`${e}64Low`]=new Float32Array(this.size)),r}_getBufferLayout(e=this.id,n=null){const r=this.getAccessor(),i=[],s={name:this.id,byteStride:Ao(r),attributes:i};if(this.doublePrecision){const l=AZ(r,n||{});i.push(Ih(e,{...r,...l.high}),Ih(`${e}64Low`,{...r,...l.low}))}else if(n){const l=xy(r,n);i.push(Ih(e,{...r,...l}))}else i.push(Ih(e,r));return s}setAccessor(e){this.state.bufferAccessor=e}getAccessor(){return this.state.bufferAccessor}getBounds(){if(this.state.bounds)return this.state.bounds;let e=null;if(this.state.constant&&this.value){const n=Array.from(this.value);e=[n,n]}else{const{value:n,numInstances:r,size:i}=this,s=r*i;if(n&&s&&n.length>=s){const l=new Array(i).fill(1/0),c=new Array(i).fill(-1/0);for(let f=0;fc[d]&&(c[d]=g)}e=[l,c]}}return this.state.bounds=e,e}setData(e){const{state:n}=this;let r;ArrayBuffer.isView(e)?r={value:e}:e instanceof $n?r={buffer:e}:r=e;const i={...this.settings,...r};if(ArrayBuffer.isView(r.value)){if(!r.type)if(this.doublePrecision&&r.value instanceof Float64Array)i.type="float32";else{const l=EZ(r.value);i.type=i.normalized?l.replace("int","norm"):l}i.bytesPerElement=r.value.BYTES_PER_ELEMENT,i.stride=Ao(i)}if(n.bounds=null,r.constant){let s=r.value;if(s=this._normalizeValue(s,[],0),this.settings.normalized&&(s=this.normalizeConstant(s)),!(!n.constant||!this._areValuesEqual(s,this.value)))return!1;n.externalBuffer=null,n.constant=!0,this.value=ArrayBuffer.isView(s)?s:new Float32Array(s)}else if(r.buffer){const s=r.buffer;n.externalBuffer=s,n.constant=!1,this.value=r.value||null}else if(r.value){this._checkExternalBuffer(r);let s=r.value;n.externalBuffer=null,n.constant=!1,this.value=s;let{buffer:l}=this;const c=Ao(i),f=(i.vertexOffset||0)*c;if(this.doublePrecision&&s instanceof Float64Array&&(s=b0(s,i)),this.settings.isIndexed){const g=this.settings.defaultType;s.constructor!==g&&(s=new g(s))}const d=s.byteLength+f+c*2;(!l||l.byteLength(n+128)/255*2-1);case"snorm16":return new Float32Array(e).map(n=>(n+32768)/65535*2-1);case"unorm8":return new Float32Array(e).map(n=>n/255);case"unorm16":return new Float32Array(e).map(n=>n/65535);default:return e}}_normalizeValue(e,n,r){const{defaultValue:i,size:s}=this.settings;if(Number.isFinite(e))return n[r]=e,n;if(!e){let l=s;for(;--l>=0;)n[r+l]=i[l];return n}switch(s){case 4:n[r+3]=Number.isFinite(e[3])?e[3]:i[3];case 3:n[r+2]=Number.isFinite(e[2])?e[2]:i[2];case 2:n[r+1]=Number.isFinite(e[1])?e[1]:i[1];case 1:n[r+0]=Number.isFinite(e[0])?e[0]:i[0];break;default:let l=s;for(;--l>=0;)n[r+l]=Number.isFinite(e[l])?e[l]:i[l]}return n}_areValuesEqual(e,n){if(!e||!n)return!1;const{size:r}=this;for(let i=0;i0&&(AC.length=t.length,r=AC):r=TC,(e>0||Number.isFinite(n))&&(r=(Array.isArray(r)?r:Array.from(r)).slice(e,n),i.index=e-1),{iterable:r,objectInfo:i}}function GO(t){return t&&t[Symbol.asyncIterator]}function xZ(t,e){const{size:n,stride:r,offset:i,startIndices:s,nested:l}=e,c=t.BYTES_PER_ELEMENT,f=r?r/c:n,d=i?i/c:0,g=Math.floor((t.length-d)/f);return(m,{index:v,target:S})=>{if(!s){const A=v*f+d;for(let T=0;T=e[1]))return t;const n=[],r=t.length;let i=0;for(let s=0;se[1]?n.push(l):e=[Math.min(l[0],e[0]),Math.max(l[1],e[1])]}return n.splice(i,0,e),n}const PZ={interpolation:{duration:0,easing:t=>t},spring:{stiffness:.05,damping:.5}};function JO(t,e){if(!t)return null;Number.isFinite(t)&&(t={type:"interpolation",duration:t});const n=t.type||"interpolation";return{...PZ[n],...e,...t,type:n}}class eP extends CZ{constructor(e,n){super(e,n,{startIndices:null,lastExternalBuffer:null,binaryValue:null,binaryAccessor:null,needsUpdate:!0,needsRedraw:!1,layoutChanged:!1,updateRanges:Wh}),this.constant=!1,this.settings.update=n.update||(n.accessor?this._autoUpdater:void 0),Object.seal(this.settings),Object.seal(this.state),this._validateAttributeUpdaters()}get startIndices(){return this.state.startIndices}set startIndices(e){this.state.startIndices=e}needsUpdate(){return this.state.needsUpdate}needsRedraw({clearChangedFlags:e=!1}={}){const n=this.state.needsRedraw;return this.state.needsRedraw=n&&!e,n}layoutChanged(){return this.state.layoutChanged}setAccessor(e){var n;(n=this.state).layoutChanged||(n.layoutChanged=!TZ(e,this.getAccessor())),super.setAccessor(e)}getUpdateTriggers(){const{accessor:e}=this.settings;return[this.id].concat(typeof e!="function"&&e||[])}supportsTransition(){return!!this.settings.transition}getTransitionSetting(e){if(!e||!this.supportsTransition())return null;const{accessor:n}=this.settings,r=this.settings.transition,i=Array.isArray(n)?e[n.find(s=>e[s])]:e[n];return JO(i,r)}setNeedsUpdate(e=this.id,n){if(this.state.needsUpdate=this.state.needsUpdate||e,this.setNeedsRedraw(e),n){const{startRow:r=0,endRow:i=1/0}=n;this.state.updateRanges=OZ(this.state.updateRanges,[r,i])}else this.state.updateRanges=Wh}clearNeedsUpdate(){this.state.needsUpdate=!1,this.state.updateRanges=MZ}setNeedsRedraw(e=this.id){this.state.needsRedraw=this.state.needsRedraw||e}allocate(e){const{state:n,settings:r}=this;return r.noAlloc?!1:r.update?(super.allocate(e,n.updateRanges!==Wh),!0):!1}updateBuffer({numInstances:e,data:n,props:r,context:i}){if(!this.needsUpdate())return!1;const{state:{updateRanges:s},settings:{update:l,noAlloc:c}}=this;let f=!0;if(l){for(const[d,g]of s)l.call(i,this,{data:n,startRow:d,endRow:g,props:r,numInstances:e});if(this.value)if(this.constant||!this.buffer||this.buffer.byteLengthg?d.set(C,w):(e._normalizeValue(C,A.target,0),Vq({target:d,source:A.target,start:w,count:M}));w+=M*g}else e._normalizeValue(C,d,w),w+=g}}_validateAttributeUpdaters(){const{settings:e}=this;if(!(e.noAlloc||typeof e.update=="function"))throw new Error(`Attribute ${this.id} missing update or accessor`)}_checkAttributeArray(){const{value:e}=this,n=Math.min(4,this.size);if(e&&e.length>=n){let r=!0;switch(n){case 4:r=r&&Number.isFinite(e[3]);case 3:r=r&&Number.isFinite(e[2]);case 2:r=r&&Number.isFinite(e[1]);case 1:r=r&&Number.isFinite(e[0]);break;default:r=!1}if(!r)throw new Error(`Illegal attribute generated for ${this.id}`)}}}function M0(t){const{source:e,target:n,start:r=0,size:i,getData:s}=t,l=t.end||n.length,c=e.length,f=l-r;if(c>f){n.set(e.subarray(0,f),r);return}if(n.set(e,r),!s)return;let d=c;for(;dr(g+c,m)),d=Math.min(i.length,s.length);for(let g=1;gc}){const c=n.doublePrecision&&n.value instanceof Float64Array?2:1,f=n.size*c,d=n.byteOffset,g=n.settings.bytesPerElement<4?d/n.settings.bytesPerElement*4:d,m=n.startIndices,v=s&&m,S=n.isConstant;if(!v&&e&&r>=i)return e;const E=n.value instanceof Float64Array?Float32Array:n.value.constructor,w=S?n.value:new E(n.getBuffer().readSyncWebGL(d,i*E.BYTES_PER_ELEMENT).buffer);if(n.settings.normalized&&!S){const C=l;l=(M,x)=>n.normalizeConstant(C(M,x))}const b=S?(C,M)=>l(w,M):(C,M)=>l(w.subarray(C+d,C+d+f),M),A=e?new Float32Array(e.readSyncWebGL(g,r*4).buffer):new Float32Array(0),T=new Float32Array(i);return NZ({source:A,target:T,sourceStartIndices:s,targetStartIndices:m,size:f,getData:b}),(!e||e.byteLength0||i.end()}delete(){super.delete(),this.transform.destroy(),this.texture.destroy(),this.framebuffer.destroy()}}const $Z=`uniform springUniforms { + float damping; + float stiffness; +} spring; +`,VZ={name:"spring",vs:$Z,uniformTypes:{damping:"f32",stiffness:"f32"}},HZ=`#version 300 es +#define SHADER_NAME spring-transition-vertex-shader + +#define EPSILON 0.00001 + +in ATTRIBUTE_TYPE aPrev; +in ATTRIBUTE_TYPE aCur; +in ATTRIBUTE_TYPE aTo; +out ATTRIBUTE_TYPE vNext; +out float vIsTransitioningFlag; + +ATTRIBUTE_TYPE getNextValue(ATTRIBUTE_TYPE cur, ATTRIBUTE_TYPE prev, ATTRIBUTE_TYPE dest) { + ATTRIBUTE_TYPE velocity = cur - prev; + ATTRIBUTE_TYPE delta = dest - cur; + ATTRIBUTE_TYPE force = delta * spring.stiffness; + ATTRIBUTE_TYPE resistance = velocity * spring.damping; + return force - resistance + velocity + cur; +} + +void main(void) { + bool isTransitioning = length(aCur - aPrev) > EPSILON || length(aTo - aCur) > EPSILON; + vIsTransitioningFlag = isTransitioning ? 1.0 : 0.0; + + vNext = getNextValue(aCur, aPrev, aTo); + gl_Position = vec4(0, 0, 0, 1); + gl_PointSize = 100.0; +} +`,jZ=`#version 300 es +#define SHADER_NAME spring-transition-is-transitioning-fragment-shader + +in float vIsTransitioningFlag; + +out vec4 fragColor; + +void main(void) { + if (vIsTransitioningFlag == 0.0) { + discard; + } + fragColor = vec4(1.0); +}`;function WZ(t,e){const n=tP(e.size),r=nP(e.size);return new Uf(t,{vs:HZ,fs:jZ,bufferLayout:[{name:"aPrev",format:r},{name:"aCur",format:r},{name:"aTo",format:e.getBufferLayout().attributes[0].format}],varyings:["vNext"],modules:[VZ],defines:{ATTRIBUTE_TYPE:n},parameters:{depthCompare:"always",blendColorOperation:"max",blendColorSrcFactor:"one",blendColorDstFactor:"one",blendAlphaOperation:"max",blendAlphaSrcFactor:"one",blendAlphaDstFactor:"one"}})}function XZ(t){return t.createTexture({data:new Uint8Array(4),format:"rgba8unorm",mipmaps:!1,width:1,height:1})}function qZ(t,e){return t.createFramebuffer({id:"spring-transition-is-transitioning-framebuffer",width:1,height:1,colorAttachments:[e]})}const YZ={interpolation:FZ,spring:zZ};class KZ{constructor(e,{id:n,timeline:r}){if(!e)throw new Error("AttributeTransitionManager is constructed without device");this.id=n,this.device=e,this.timeline=r,this.transitions={},this.needsRedraw=!1,this.numInstances=1}finalize(){for(const e in this.transitions)this._removeTransition(e)}update({attributes:e,transitions:n,numInstances:r}){this.numInstances=r||1;for(const i in e){const s=e[i],l=s.getTransitionSetting(n);l&&this._updateAttribute(i,s,l)}for(const i in this.transitions){const s=e[i];(!s||!s.getTransitionSetting(n))&&this._removeTransition(i)}}hasAttribute(e){const n=this.transitions[e];return n&&n.inProgress}getAttributes(){const e={};for(const n in this.transitions){const r=this.transitions[n];r.inProgress&&(e[n]=r.attributeInTransition)}return e}run(){if(this.numInstances===0)return!1;for(const n in this.transitions)this.transitions[n].update()&&(this.needsRedraw=!0);const e=this.needsRedraw;return this.needsRedraw=!1,e}_removeTransition(e){this.transitions[e].delete(),delete this.transitions[e]}_updateAttribute(e,n,r){const i=this.transitions[e];let s=!i||i.type!==r.type;if(s){i&&this._removeTransition(e);const l=YZ[r.type];l?this.transitions[e]=new l({attribute:n,timeline:this.timeline,device:this.device}):(Sn.error(`unsupported transition type '${r.type}'`)(),s=!1)}(s||n.needsRedraw())&&(this.needsRedraw=!0,this.transitions[e].start(r,this.numInstances))}}const RC="attributeManager.invalidate",ZZ="attributeManager.updateStart",QZ="attributeManager.updateEnd",GZ="attribute.updateStart",JZ="attribute.allocate",eQ="attribute.updateEnd";class tQ{constructor(e,{id:n="attribute-manager",stats:r,timeline:i}={}){this.mergeBoundsMemoized=nd(tq),this.id=n,this.device=e,this.attributes={},this.updateTriggers={},this.needsRedraw=!0,this.userData={},this.stats=r,this.attributeTransitionManager=new KZ(e,{id:`${n}-transitions`,timeline:i}),Object.seal(this)}finalize(){for(const e in this.attributes)this.attributes[e].delete();this.attributeTransitionManager.finalize()}getNeedsRedraw(e={clearRedrawFlags:!1}){const n=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!e.clearRedrawFlags,n&&this.id}setNeedsRedraw(){this.needsRedraw=!0}add(e){this._add(e)}addInstanced(e){this._add(e,{stepMode:"instance"})}remove(e){for(const n of e)this.attributes[n]!==void 0&&(this.attributes[n].delete(),delete this.attributes[n])}invalidate(e,n){const r=this._invalidateTrigger(e,n);jr(RC,this,e,r)}invalidateAll(e){for(const n in this.attributes)this.attributes[n].setNeedsUpdate(n,e);jr(RC,this,"all")}update({data:e,numInstances:n,startIndices:r=null,transitions:i,props:s={},buffers:l={},context:c={}}){let f=!1;jr(ZZ,this),this.stats&&this.stats.get("Update Attributes").timeStart();for(const d in this.attributes){const g=this.attributes[d],m=g.settings.accessor;g.startIndices=r,g.numInstances=n,s[d]&&Sn.removed(`props.${d}`,`data.attributes.${d}`)(),g.setExternalBuffer(l[d])||g.setBinaryValue(typeof m=="string"?l[m]:void 0,e.startIndices)||typeof m=="string"&&!l[m]&&g.setConstantValue(s[m])||g.needsUpdate()&&(f=!0,this._updateAttribute({attribute:g,numInstances:n,data:e,props:s,context:c})),this.needsRedraw=this.needsRedraw||g.needsRedraw()}f&&jr(QZ,this,n),this.stats&&this.stats.get("Update Attributes").timeEnd(),this.attributeTransitionManager.update({attributes:this.attributes,numInstances:n,transitions:i})}updateTransition(){const{attributeTransitionManager:e}=this,n=e.run();return this.needsRedraw=this.needsRedraw||n,n}getAttributes(){return{...this.attributes,...this.attributeTransitionManager.getAttributes()}}getBounds(e){const n=e.map(r=>{var i;return(i=this.attributes[r])==null?void 0:i.getBounds()});return this.mergeBoundsMemoized(n)}getChangedAttributes(e={clearChangedFlags:!1}){const{attributes:n,attributeTransitionManager:r}=this,i={...r.getAttributes()};for(const s in n){const l=n[s];l.needsRedraw(e)&&!r.hasAttribute(s)&&(i[s]=l)}return i}getBufferLayouts(e){return Object.values(this.getAttributes()).map(n=>n.getBufferLayout(e))}_add(e,n){for(const r in e){const i=e[r],s={...i,id:r,size:i.isIndexed&&1||i.size||1,...n};this.attributes[r]=new eP(this.device,s)}this._mapUpdateTriggersToAttributes()}_mapUpdateTriggersToAttributes(){const e={};for(const n in this.attributes)this.attributes[n].getUpdateTriggers().forEach(i=>{e[i]||(e[i]=[]),e[i].push(n)});this.updateTriggers=e}_invalidateTrigger(e,n){const{attributes:r,updateTriggers:i}=this,s=i[e];return s&&s.forEach(l=>{const c=r[l];c&&c.setNeedsUpdate(c.id,n)}),s}_updateAttribute(e){const{attribute:n,numInstances:r}=e;if(jr(GZ,n),n.constant){n.setConstantValue(n.value);return}n.allocate(r)&&jr(JZ,n,r),n.updateBuffer(e)&&(this.needsRedraw=!0,jr(eQ,n,r))}}class nQ extends Sp{get value(){return this._value}_onUpdate(){const{time:e,settings:{fromValue:n,toValue:r,duration:i,easing:s}}=this,l=s(e/i);this._value=Mg(n,r,l)}}const xC=1e-5;function MC(t,e,n,r,i){const s=e-t,c=(n-e)*i,f=-s*r;return c+f+s+e}function rQ(t,e,n,r,i){if(Array.isArray(n)){const s=[];for(let l=0;l0}add(e,n,r,i){const{transitions:s}=this;if(s.has(e)){const f=s.get(e),{value:d=f.settings.fromValue}=f;n=d,this.remove(e)}if(i=JO(i),!i)return;const l=sQ[i.type];if(!l){Sn.error(`unsupported transition type '${i.type}'`)();return}const c=new l(this.timeline);c.start({...i,fromValue:n,toValue:r}),s.set(e,c)}remove(e){const{transitions:n}=this;n.has(e)&&(n.get(e).cancel(),n.delete(e))}update(){const e={};for(const[n,r]of this.transitions)r.update(),e[n]=r.value,r.inProgress||this.remove(n);return e}clear(){for(const e of this.transitions.keys())this.remove(e)}}function oQ(t){const e=t[Uo];for(const n in e){const r=e[n],{validate:i}=r;if(i&&!i(t[n],r))throw new Error(`Invalid prop ${n}: ${t[n]}`)}}function lQ(t,e){const n=lP({newProps:t,oldProps:e,propTypes:t[Uo],ignoreProps:{data:null,updateTriggers:null,extensions:null,transitions:null}}),r=uQ(t,e);let i=!1;return r||(i=fQ(t,e)),{dataChanged:r,propsChanged:n,updateTriggersChanged:i,extensionsChanged:dQ(t,e),transitionsChanged:cQ(t,e)}}function cQ(t,e){if(!t.transitions)return!1;const n={},r=t[Uo];let i=!1;for(const s in t.transitions){const l=r[s],c=l&&l.type;(c==="number"||c==="color"||c==="array")&&My(t[s],e[s],l)&&(n[s]=!0,i=!0)}return i?n:!1}function lP({newProps:t,oldProps:e,ignoreProps:n={},propTypes:r={},triggerName:i="props"}){if(e===t)return!1;if(typeof t!="object"||t===null)return`${i} changed shallowly`;if(typeof e!="object"||e===null)return`${i} changed shallowly`;for(const s of Object.keys(t))if(!(s in n)){if(!(s in e))return`${i}.${s} added`;const l=My(t[s],e[s],r[s]);if(l)return`${i}.${s} ${l}`}for(const s of Object.keys(e))if(!(s in n)){if(!(s in t))return`${i}.${s} dropped`;if(!Object.hasOwnProperty.call(t,s)){const l=My(t[s],e[s],r[s]);if(l)return`${i}.${s} ${l}`}}return!1}function My(t,e,n){let r=n&&n.equal;return r&&!r(t,e,n)||!r&&(r=t&&e&&t.equals,r&&!r.call(t,e))?"changed deeply":!r&&e!==t?"changed shallowly":null}function uQ(t,e){if(e===null)return"oldProps is null, initial diff";let n=!1;const{dataComparator:r,_dataDiff:i}=t;return r?r(t.data,e.data)||(n="Data comparator detected a change"):t.data!==e.data&&(n="A new data container was supplied"),n&&i&&(n=i(t.data,e.data)||n),n}function fQ(t,e){if(e===null)return{all:!0};if("all"in t.updateTriggers&&PC(t,e,"all"))return{all:!0};const n={};let r=!1;for(const i in t.updateTriggers)i!=="all"&&PC(t,e,i)&&(n[i]=!0,r=!0);return r?n:!1}function dQ(t,e){if(e===null)return!0;const n=e.extensions,{extensions:r}=t;if(r===n)return!1;if(!n||!r||r.length!==n.length)return!0;for(let i=0;ir.name==="project64"))){const r=n.modules.findIndex(i=>i.name==="project32");r>=0&&n.modules.splice(r,1)}if("inject"in e)if(!t.inject)n.inject=e.inject;else{const r={...t.inject};for(const i in e.inject)r[i]=(r[i]||"")+e.inject[i];n.inject=r}return n}const _Q={minFilter:"linear",mipmapFilter:"linear",magFilter:"linear",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"},Oy={};function yQ(t,e,n,r){if(n instanceof Kn)return n;n.constructor&&n.constructor.name!=="Object"&&(n={data:n});let i=null;n.compressed&&(i={minFilter:"linear",mipmapFilter:n.data.length>1?"nearest":"linear"});const s=e.createTexture({...n,sampler:{..._Q,...i,...r},mipmaps:!0});return Oy[s.id]=t,s}function bQ(t,e){!e||!(e instanceof Kn)||Oy[e.id]===t&&(e.delete(),delete Oy[e.id])}const SQ={boolean:{validate(t,e){return!0},equal(t,e,n){return!!t==!!e}},number:{validate(t,e){return Number.isFinite(t)&&(!("max"in e)||t<=e.max)&&(!("min"in e)||t>=e.min)}},color:{validate(t,e){return e.optional&&!t||Py(t)&&(t.length===3||t.length===4)},equal(t,e,n){return Ji(t,e,1)}},accessor:{validate(t,e){const n=Bg(t);return n==="function"||n===Bg(e.value)},equal(t,e,n){return typeof e=="function"?!0:Ji(t,e,1)}},array:{validate(t,e){return e.optional&&!t||Py(t)},equal(t,e,n){const{compare:r}=n,i=Number.isInteger(r)?r:r?1:0;return r?Ji(t,e,i):t===e}},object:{equal(t,e,n){if(n.ignore)return!0;const{compare:r}=n,i=Number.isInteger(r)?r:r?1:0;return r?Ji(t,e,i):t===e}},function:{validate(t,e){return e.optional&&!t||typeof t=="function"},equal(t,e,n){return!n.compare&&n.ignore!==!1||t===e}},data:{transform:(t,e,n)=>{if(!t)return t;const{dataTransform:r}=n.props;return r?r(t):typeof t.shape=="string"&&t.shape.endsWith("-table")&&Array.isArray(t.data)?t.data:t}},image:{transform:(t,e,n)=>{const r=n.context;return!r||!r.device?null:yQ(n.id,r.device,t,{...e.parameters,...n.props.textureParameters})},release:(t,e,n)=>{bQ(n.id,t)}}};function wQ(t){const e={},n={},r={};for(const[i,s]of Object.entries(t)){const l=s==null?void 0:s.deprecatedFor;if(l)r[i]=Array.isArray(l)?l:[l];else{const c=EQ(i,s);e[i]=c,n[i]=c.value}}return{propTypes:e,defaultProps:n,deprecatedProps:r}}function EQ(t,e){switch(Bg(e)){case"object":return Yu(t,e);case"array":return Yu(t,{type:"array",value:e,compare:!1});case"boolean":return Yu(t,{type:"boolean",value:e});case"number":return Yu(t,{type:"number",value:e});case"function":return Yu(t,{type:"function",value:e,compare:!0});default:return{name:t,type:"unknown",value:e}}}function Yu(t,e){return"type"in e?{name:t,...SQ[e.type],...e}:"value"in e?{name:t,type:Bg(e.value),...e}:{name:t,type:"object",value:e}}function Py(t){return Array.isArray(t)||ArrayBuffer.isView(t)}function Bg(t){return Py(t)?"array":t===null?"null":typeof t}function TQ(t,e){let n;for(let s=e.length-1;s>=0;s--){const l=e[s];"extensions"in l&&(n=l.extensions)}const r=Ny(t.constructor,n),i=Object.create(r);i[Fg]=t,i[Xo]={},i[Ba]={};for(let s=0;s{},this.oldProps=null,this.oldAsyncProps=null}finalize(){for(const e in this.asyncProps){const n=this.asyncProps[e];n&&n.type&&n.type.release&&n.type.release(n.resolvedValue,n.type,this.component)}this.asyncProps={},this.component=null,this.resetOldProps()}getOldProps(){return this.oldAsyncProps||this.oldProps||IQ}resetOldProps(){this.oldAsyncProps=null,this.oldProps=this.component?this.component.props:null}hasAsyncProp(e){return e in this.asyncProps}getAsyncProp(e){const n=this.asyncProps[e];return n&&n.resolvedValue}isAsyncPropLoading(e){if(e){const n=this.asyncProps[e];return!!(n&&n.pendingLoadCount>0&&n.pendingLoadCount!==n.resolvedLoadCount)}for(const n in this.asyncProps)if(this.isAsyncPropLoading(n))return!0;return!1}reloadAsyncProp(e,n){this._watchPromise(e,Promise.resolve(n))}setAsyncProps(e){this.component=e[Fg]||this.component;const n=e[Ba]||{},r=e[Xo]||e,i=e[lc]||{};for(const s in n){const l=n[s];this._createAsyncPropData(s,i[s]),this._updateAsyncProp(s,l),n[s]=this.getAsyncProp(s)}for(const s in r){const l=r[s];this._createAsyncPropData(s,i[s]),this._updateAsyncProp(s,l)}}_fetch(e,n){return null}_onResolve(e,n){}_onError(e,n){}_updateAsyncProp(e,n){if(this._didAsyncInputValueChange(e,n)){if(typeof n=="string"&&(n=this._fetch(e,n)),n instanceof Promise){this._watchPromise(e,n);return}if(GO(n)){this._resolveAsyncIterable(e,n);return}this._setPropValue(e,n)}}_freezeAsyncOldProps(){if(!this.oldAsyncProps&&this.oldProps){this.oldAsyncProps=Object.create(this.oldProps);for(const e in this.asyncProps)Object.defineProperty(this.oldAsyncProps,e,{enumerable:!0,value:this.oldProps[e]})}}_didAsyncInputValueChange(e,n){const r=this.asyncProps[e];return n===r.resolvedValue||n===r.lastValue?!1:(r.lastValue=n,!0)}_setPropValue(e,n){this._freezeAsyncOldProps();const r=this.asyncProps[e];r&&(n=this._postProcessValue(r,n),r.resolvedValue=n,r.pendingLoadCount++,r.resolvedLoadCount=r.pendingLoadCount)}_setAsyncPropValue(e,n,r){const i=this.asyncProps[e];i&&r>=i.resolvedLoadCount&&n!==void 0&&(this._freezeAsyncOldProps(),i.resolvedValue=n,i.resolvedLoadCount=r,this.onAsyncPropUpdated(e,n))}_watchPromise(e,n){const r=this.asyncProps[e];if(r){r.pendingLoadCount++;const i=r.pendingLoadCount;n.then(s=>{this.component&&(s=this._postProcessValue(r,s),this._setAsyncPropValue(e,s,i),this._onResolve(e,s))}).catch(s=>{this._onError(e,s)})}}async _resolveAsyncIterable(e,n){if(e!=="data"){this._setPropValue(e,n);return}const r=this.asyncProps[e];if(!r)return;r.pendingLoadCount++;const i=r.pendingLoadCount;let s=[],l=0;for await(const c of n){if(!this.component)return;const{dataTransform:f}=this.component.props;f?s=f(c,s):s=s.concat(c),Object.defineProperty(s,"__diff",{enumerable:!1,value:[{startRow:l,endRow:s.length}]}),l=s.length,this._setAsyncPropValue(e,s,i)}this._onResolve(e,s)}_postProcessValue(e,n){const r=e.type;return r&&this.component&&(r.release&&r.release(e.resolvedValue,r,this.component),r.transform)?r.transform(n,r,this.component):n}_createAsyncPropData(e,n){if(!this.asyncProps[e]){const i=this.component&&this.component.props[Uo];this.asyncProps[e]={type:i&&i[e],lastValue:null,resolvedValue:n,pendingLoadCount:0,resolvedLoadCount:0}}}}class FQ extends DQ{constructor({attributeManager:e,layer:n}){super(n),this.attributeManager=e,this.needsRedraw=!0,this.needsUpdate=!0,this.subLayers=null,this.usesPickingColorCache=!1}get layer(){return this.component}_fetch(e,n){const r=this.layer,i=r==null?void 0:r.props.fetch;return i?i(n,{propName:e,layer:r}):super._fetch(e,n)}_onResolve(e,n){const r=this.layer;if(r){const i=r.props.onDataLoad;e==="data"&&i&&i(n,{propName:e,layer:r})}}_onError(e,n){const r=this.layer;r&&r.raiseError(n,`loading ${e} of ${this.layer}`)}}const kQ="layer.changeFlag",BQ="layer.initialize",UQ="layer.update",LQ="layer.finalize",zQ="layer.matched",IC=2**24-1,$Q=Object.freeze([]),VQ=nd(({oldViewport:t,viewport:e})=>t.equals(e));let Hi=new Uint8ClampedArray(0);const HQ={data:{type:"data",value:$Q,async:!0},dataComparator:{type:"function",value:null,optional:!0},_dataDiff:{type:"function",value:t=>t&&t.__diff,optional:!0},dataTransform:{type:"function",value:null,optional:!0},onDataLoad:{type:"function",value:null,optional:!0},onError:{type:"function",value:null,optional:!0},fetch:{type:"function",value:(t,{propName:e,layer:n,loaders:r,loadOptions:i,signal:s})=>{const{resourceManager:l}=n.context;i=i||n.getLoadOptions(),r=r||n.props.loaders,s&&(i={...i,fetch:{...i==null?void 0:i.fetch,signal:s}});let c=l.contains(t);return!c&&!i&&(l.add({resourceId:t,data:Jh(t,r),persistent:!1}),c=!0),c?l.subscribe({resourceId:t,onChange:f=>{var d;return(d=n.internalState)==null?void 0:d.reloadAsyncProp(e,f)},consumerId:n.id,requestId:e}):Jh(t,r,i)}},updateTriggers:{},visible:!0,pickable:!1,opacity:{type:"number",min:0,max:1,value:1},operation:"draw",onHover:{type:"function",value:null,optional:!0},onClick:{type:"function",value:null,optional:!0},onDragStart:{type:"function",value:null,optional:!0},onDrag:{type:"function",value:null,optional:!0},onDragEnd:{type:"function",value:null,optional:!0},coordinateSystem:cn.DEFAULT,coordinateOrigin:{type:"array",value:[0,0,0],compare:!0},modelMatrix:{type:"array",value:null,compare:!0,optional:!0},wrapLongitude:!1,positionFormat:"XYZ",colorFormat:"RGBA",parameters:{type:"object",value:{},optional:!0,compare:2},loadOptions:{type:"object",value:null,optional:!0,ignore:!0},transitions:null,extensions:[],loaders:{type:"array",value:[],optional:!0,ignore:!0},getPolygonOffset:{type:"function",value:({layerIndex:t})=>[0,-t*100]},highlightedObjectIndex:null,autoHighlight:!1,highlightColor:{type:"accessor",value:[0,0,128,128]}};class sd extends wp{constructor(){super(...arguments),this.internalState=null,this.lifecycle=Xl.NO_STATE,this.parent=null}static get componentName(){return Object.prototype.hasOwnProperty.call(this,"layerName")?this.layerName:""}get root(){let e=this;for(;e.parent;)e=e.parent;return e}toString(){return`${this.constructor.layerName||this.constructor.name}({id: '${this.props.id}'})`}project(e){Br(this.internalState);const n=this.internalState.viewport||this.context.viewport,r=CO(e,{viewport:n,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),[i,s,l]=SO(r,n.pixelProjectionMatrix);return e.length===2?[i,s]:[i,s,l]}unproject(e){return Br(this.internalState),(this.internalState.viewport||this.context.viewport).unproject(e)}projectPosition(e,n){Br(this.internalState);const r=this.internalState.viewport||this.context.viewport;return oq(e,{viewport:r,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem,...n})}get isComposite(){return!1}get isDrawable(){return!0}setState(e){this.setChangeFlags({stateChanged:!0}),Object.assign(this.state,e),this.setNeedsRedraw()}setNeedsRedraw(){this.internalState&&(this.internalState.needsRedraw=!0)}setNeedsUpdate(){this.internalState&&(this.context.layerManager.setNeedsUpdate(String(this)),this.internalState.needsUpdate=!0)}get isLoaded(){return this.internalState?!this.internalState.isAsyncPropLoading():!1}get wrapLongitude(){return this.props.wrapLongitude}isPickable(){return this.props.pickable&&this.props.visible}getModels(){const e=this.state;return e&&(e.models||e.model&&[e.model])||[]}setShaderModuleProps(...e){for(const n of this.getModels())n.shaderInputs.setProps(...e)}getAttributeManager(){return this.internalState&&this.internalState.attributeManager}getCurrentLayer(){return this.internalState&&this.internalState.layer}getLoadOptions(){return this.props.loadOptions}use64bitPositions(){const{coordinateSystem:e}=this.props;return e===cn.DEFAULT||e===cn.LNGLAT||e===cn.CARTESIAN}onHover(e,n){return this.props.onHover&&this.props.onHover(e,n)||!1}onClick(e,n){return this.props.onClick&&this.props.onClick(e,n)||!1}nullPickingColor(){return[0,0,0]}encodePickingColor(e,n=[]){return n[0]=e+1&255,n[1]=e+1>>8&255,n[2]=e+1>>8>>8&255,n}decodePickingColor(e){Br(e instanceof Uint8Array);const[n,r,i]=e;return n+r*256+i*65536-1}getNumInstances(){return Number.isFinite(this.props.numInstances)?this.props.numInstances:this.state&&this.state.numInstances!==void 0?this.state.numInstances:pQ(this.props.data)}getStartIndices(){return this.props.startIndices?this.props.startIndices:this.state&&this.state.startIndices?this.state.startIndices:null}getBounds(){var e;return(e=this.getAttributeManager())==null?void 0:e.getBounds(["positions","instancePositions"])}getShaders(e){e=NC(e,{disableWarnings:!0,modules:this.context.defaultShaderModules});for(const n of this.props.extensions)e=NC(e,n.getShaders.call(this,n));return e}shouldUpdateState(e){return e.changeFlags.propsOrDataChanged}updateState(e){const n=this.getAttributeManager(),{dataChanged:r}=e.changeFlags;if(r&&n)if(Array.isArray(r))for(const i of r)n.invalidateAll(i);else n.invalidateAll();if(n){const{props:i}=e,s=this.internalState.hasPickingBuffer,l=Number.isInteger(i.highlightedObjectIndex)||i.pickable||i.extensions.some(c=>c.getNeedsPickingBuffer.call(this,c));if(s!==l){this.internalState.hasPickingBuffer=l;const{pickingColors:c,instancePickingColors:f}=n.attributes,d=c||f;d&&(l&&d.constant&&(d.constant=!1,n.invalidate(d.id)),!d.value&&!l&&(d.constant=!0,d.value=[0,0,0]))}}}finalizeState(e){for(const r of this.getModels())r.destroy();const n=this.getAttributeManager();n&&n.finalize(),this.context&&this.context.resourceManager.unsubscribe({consumerId:this.id}),this.internalState&&(this.internalState.uniformTransitions.clear(),this.internalState.finalize())}draw(e){for(const n of this.getModels())n.draw(e.renderPass)}getPickingInfo({info:e,mode:n,sourceLayer:r}){const{index:i}=e;return i>=0&&Array.isArray(this.props.data)&&(e.object=this.props.data[i]),e}raiseError(e,n){var r,i,s,l;n&&(e=new Error(`${n}: ${e.message}`,{cause:e})),(i=(r=this.props).onError)!=null&&i.call(r,e)||(l=(s=this.context)==null?void 0:s.onError)==null||l.call(s,e,this)}getNeedsRedraw(e={clearRedrawFlags:!1}){return this._getNeedsRedraw(e)}needsUpdate(){return this.internalState?this.internalState.needsUpdate||this.hasUniformTransition()||this.shouldUpdateState(this._getUpdateParams()):!1}hasUniformTransition(){var e;return((e=this.internalState)==null?void 0:e.uniformTransitions.active)||!1}activateViewport(e){if(!this.internalState)return;const n=this.internalState.viewport;this.internalState.viewport=e,(!n||!VQ({oldViewport:n,viewport:e}))&&(this.setChangeFlags({viewportChanged:!0}),this.isComposite?this.needsUpdate()&&this.setNeedsUpdate():this._update())}invalidateAttribute(e="all"){const n=this.getAttributeManager();n&&(e==="all"?n.invalidateAll():n.invalidate(e))}updateAttributes(e){let n=!1;for(const r in e)e[r].layoutChanged()&&(n=!0);for(const r of this.getModels())this._setModelAttributes(r,e,n)}_updateAttributes(){const e=this.getAttributeManager();if(!e)return;const n=this.props,r=this.getNumInstances(),i=this.getStartIndices();e.update({data:n.data,numInstances:r,startIndices:i,props:n,transitions:n.transitions,buffers:n.data.attributes,context:this});const s=e.getChangedAttributes({clearChangedFlags:!0});this.updateAttributes(s)}_updateAttributeTransition(){const e=this.getAttributeManager();e&&e.updateTransition()}_updateUniformTransition(){const{uniformTransitions:e}=this.internalState;if(e.active){const n=e.update(),r=Object.create(this.props);for(const i in n)Object.defineProperty(r,i,{value:n[i]});return r}return this.props}calculateInstancePickingColors(e,{numInstances:n}){if(e.constant)return;const r=Math.floor(Hi.length/4);if(this.internalState.usesPickingColorCache=!0,rIC&&Sn.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),Hi=Bf.allocate(Hi,n,{size:4,copy:!0,maxCount:Math.max(n,IC)});const i=Math.floor(Hi.length/4),s=[0,0,0];for(let l=r;l(Sn.deprecated("layer.state.attributeManager","layer.getAttributeManager()")(),e)}),this.internalState.uniformTransitions=new aQ(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props),this.initializeState(this.context);for(const n of this.props.extensions)n.initializeState.call(this,this.context,n);this.setChangeFlags({dataChanged:"init",propsChanged:"init",viewportChanged:!0,extensionsChanged:!0}),this._update()}_transferState(e){jr(zQ,this,this===e);const{state:n,internalState:r}=e;this!==e&&(this.internalState=r,this.state=n,this.internalState.setAsyncProps(this.props),this._diffProps(this.props,this.internalState.getOldProps()))}_update(){const e=this.needsUpdate();if(jr(UQ,this,e),!e)return;const n=this.props,r=this.context,i=this.internalState,s=r.viewport,l=this._updateUniformTransition();i.propsInTransition=l,r.viewport=i.viewport||s,this.props=l;try{const c=this._getUpdateParams(),f=this.getModels();if(r.device)this.updateState(c);else try{this.updateState(c)}catch{}for(const g of this.props.extensions)g.updateState.call(this,c,g);this.setNeedsRedraw(),this._updateAttributes();const d=this.getModels()[0]!==f[0];this._postUpdate(c,d)}finally{r.viewport=s,this.props=n,this._clearChangeFlags(),i.needsUpdate=!1,i.resetOldProps()}}_finalize(){jr(LQ,this),this.finalizeState(this.context);for(const e of this.props.extensions)e.finalizeState.call(this,this.context,e)}_drawLayer({renderPass:e,shaderModuleProps:n=null,uniforms:r={},parameters:i={}}){this._updateAttributeTransition();const s=this.props,l=this.context;this.props=this.internalState.propsInTransition||s;try{n&&this.setShaderModuleProps(n);const{getPolygonOffset:c}=this.props,f=c&&c(r)||[0,0];l.device instanceof Ua&&l.device.setParametersWebGL({polygonOffset:f});for(const d of this.getModels())d.setParameters(i);if(l.device instanceof Ua)l.device.withParametersWebGL(i,()=>{const d={renderPass:e,shaderModuleProps:n,uniforms:r,parameters:i,context:l};for(const g of this.props.extensions)g.draw.call(this,d,g);this.draw(d)});else{const d={renderPass:e,shaderModuleProps:n,uniforms:r,parameters:i,context:l};for(const g of this.props.extensions)g.draw.call(this,d,g);this.draw(d)}}finally{this.props=s}}getChangeFlags(){var e;return(e=this.internalState)==null?void 0:e.changeFlags}setChangeFlags(e){if(!this.internalState)return;const{changeFlags:n}=this.internalState;for(const i in e)if(e[i]){let s=!1;switch(i){case"dataChanged":const l=e[i],c=n[i];l&&Array.isArray(c)&&(n.dataChanged=Array.isArray(l)?c.concat(l):l,s=!0);default:n[i]||(n[i]=e[i],s=!0)}s&&jr(kQ,this,i,e)}const r=!!(n.dataChanged||n.updateTriggersChanged||n.propsChanged||n.extensionsChanged);n.propsOrDataChanged=r,n.somethingChanged=r||n.viewportChanged||n.stateChanged}_clearChangeFlags(){this.internalState.changeFlags={dataChanged:!1,propsChanged:!1,updateTriggersChanged:!1,viewportChanged:!1,stateChanged:!1,extensionsChanged:!1,propsOrDataChanged:!1,somethingChanged:!1}}_diffProps(e,n){var i;const r=lQ(e,n);if(r.updateTriggersChanged)for(const s in r.updateTriggersChanged)r.updateTriggersChanged[s]&&this.invalidateAttribute(s);if(r.transitionsChanged)for(const s in r.transitionsChanged)this.internalState.uniformTransitions.add(s,n[s],e[s],(i=e.transitions)==null?void 0:i[s]);return this.setChangeFlags(r)}validateProps(){oQ(this.props)}updateAutoHighlight(e){this.props.autoHighlight&&!Number.isInteger(this.props.highlightedObjectIndex)&&this._updateAutoHighlight(e)}_updateAutoHighlight(e){const n={highlightedObjectColor:e.picked?e.color:null},{highlightColor:r}=this.props;e.picked&&typeof r=="function"&&(n.highlightColor=r(e)),this.setShaderModuleProps({picking:n}),this.setNeedsRedraw()}_getAttributeManager(){const e=this.context;return new tQ(e.device,{id:this.props.id,stats:e.stats,timeline:e.timeline})}_postUpdate(e,n){const{props:r,oldProps:i}=e,s=this.state.model;s!=null&&s.isInstanced&&s.setInstanceCount(this.getNumInstances());const{autoHighlight:l,highlightedObjectIndex:c,highlightColor:f}=r;if(n||i.autoHighlight!==l||i.highlightedObjectIndex!==c||i.highlightColor!==f){const d={};Array.isArray(f)&&(d.highlightColor=f),(n||i.autoHighlight!==l||c!==i.highlightedObjectIndex)&&(d.highlightedObjectColor=Number.isFinite(c)&&c>=0?this.encodePickingColor(c):null),this.setShaderModuleProps({picking:d})}}_getUpdateParams(){return{props:this.props,oldProps:this.internalState.getOldProps(),context:this.context,changeFlags:this.internalState.changeFlags}}_getNeedsRedraw(e){if(!this.internalState)return!1;let n=!1;n=n||this.internalState.needsRedraw&&this.id;const r=this.getAttributeManager(),i=r?r.getNeedsRedraw(e):!1;if(n=n||i,n)for(const s of this.props.extensions)s.onNeedsRedraw.call(this,s);return this.internalState.needsRedraw=this.internalState.needsRedraw&&!e.clearRedrawFlags,n}_onAsyncPropUpdated(){this._diffProps(this.props,this.internalState.getOldProps()),this.setNeedsUpdate()}}sd.defaultProps=HQ;sd.layerName="Layer";const DC=`uniform scatterplotUniforms { + float radiusScale; + float radiusMinPixels; + float radiusMaxPixels; + float lineWidthScale; + float lineWidthMinPixels; + float lineWidthMaxPixels; + float stroked; + bool filled; + bool antialiasing; + bool billboard; + highp int radiusUnits; + highp int lineWidthUnits; +} scatterplot; +`,jQ={name:"scatterplot",vs:DC,fs:DC,uniformTypes:{radiusScale:"f32",radiusMinPixels:"f32",radiusMaxPixels:"f32",lineWidthScale:"f32",lineWidthMinPixels:"f32",lineWidthMaxPixels:"f32",stroked:"f32",filled:"f32",antialiasing:"f32",billboard:"f32",radiusUnits:"i32",lineWidthUnits:"i32"}},WQ=`#version 300 es +#define SHADER_NAME scatterplot-layer-vertex-shader +in vec3 positions; +in vec3 instancePositions; +in vec3 instancePositions64Low; +in float instanceRadius; +in float instanceLineWidths; +in vec4 instanceFillColors; +in vec4 instanceLineColors; +in vec3 instancePickingColors; +out vec4 vFillColor; +out vec4 vLineColor; +out vec2 unitPosition; +out float innerUnitRadius; +out float outerRadiusPixels; +void main(void) { +geometry.worldPosition = instancePositions; +outerRadiusPixels = clamp( +project_size_to_pixel(scatterplot.radiusScale * instanceRadius, scatterplot.radiusUnits), +scatterplot.radiusMinPixels, scatterplot.radiusMaxPixels +); +float lineWidthPixels = clamp( +project_size_to_pixel(scatterplot.lineWidthScale * instanceLineWidths, scatterplot.lineWidthUnits), +scatterplot.lineWidthMinPixels, scatterplot.lineWidthMaxPixels +); +outerRadiusPixels += scatterplot.stroked * lineWidthPixels / 2.0; +float edgePadding = scatterplot.antialiasing ? (outerRadiusPixels + SMOOTH_EDGE_RADIUS) / outerRadiusPixels : 1.0; +unitPosition = edgePadding * positions.xy; +geometry.uv = unitPosition; +geometry.pickingColor = instancePickingColors; +innerUnitRadius = 1.0 - scatterplot.stroked * lineWidthPixels / outerRadiusPixels; +if (scatterplot.billboard) { +gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position); +DECKGL_FILTER_GL_POSITION(gl_Position, geometry); +vec3 offset = edgePadding * positions * outerRadiusPixels; +DECKGL_FILTER_SIZE(offset, geometry); +gl_Position.xy += project_pixel_size_to_clipspace(offset.xy); +} else { +vec3 offset = edgePadding * positions * project_pixel_size(outerRadiusPixels); +DECKGL_FILTER_SIZE(offset, geometry); +gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset, geometry.position); +DECKGL_FILTER_GL_POSITION(gl_Position, geometry); +} +vFillColor = vec4(instanceFillColors.rgb, instanceFillColors.a * layer.opacity); +DECKGL_FILTER_COLOR(vFillColor, geometry); +vLineColor = vec4(instanceLineColors.rgb, instanceLineColors.a * layer.opacity); +DECKGL_FILTER_COLOR(vLineColor, geometry); +} +`,XQ=`#version 300 es +#define SHADER_NAME scatterplot-layer-fragment-shader +precision highp float; +in vec4 vFillColor; +in vec4 vLineColor; +in vec2 unitPosition; +in float innerUnitRadius; +in float outerRadiusPixels; +out vec4 fragColor; +void main(void) { +geometry.uv = unitPosition; +float distToCenter = length(unitPosition) * outerRadiusPixels; +float inCircle = scatterplot.antialiasing ? +smoothedge(distToCenter, outerRadiusPixels) : +step(distToCenter, outerRadiusPixels); +if (inCircle == 0.0) { +discard; +} +if (scatterplot.stroked > 0.5) { +float isLine = scatterplot.antialiasing ? +smoothedge(innerUnitRadius * outerRadiusPixels, distToCenter) : +step(innerUnitRadius * outerRadiusPixels, distToCenter); +if (scatterplot.filled) { +fragColor = mix(vFillColor, vLineColor, isLine); +} else { +if (isLine == 0.0) { +discard; +} +fragColor = vec4(vLineColor.rgb, vLineColor.a * isLine); +} +} else if (scatterplot.filled == false) { +discard; +} else { +fragColor = vFillColor; +} +fragColor.a *= inCircle; +DECKGL_FILTER_COLOR(fragColor, geometry); +} +`,FC=[0,0,0,255],qQ={radiusUnits:"meters",radiusScale:{type:"number",min:0,value:1},radiusMinPixels:{type:"number",min:0,value:0},radiusMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},lineWidthUnits:"meters",lineWidthScale:{type:"number",min:0,value:1},lineWidthMinPixels:{type:"number",min:0,value:0},lineWidthMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},stroked:!1,filled:!0,billboard:!1,antialiasing:!0,getPosition:{type:"accessor",value:t=>t.position},getRadius:{type:"accessor",value:1},getFillColor:{type:"accessor",value:FC},getLineColor:{type:"accessor",value:FC},getLineWidth:{type:"accessor",value:1},strokeWidth:{deprecatedFor:"getLineWidth"},outline:{deprecatedFor:"stroked"},getColor:{deprecatedFor:["getFillColor","getLineColor"]}};class Vb extends sd{getShaders(){return super.getShaders({vs:WQ,fs:XQ,modules:[vO,EO,jQ]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:"float64",fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceRadius:{size:1,transition:!0,accessor:"getRadius",defaultValue:1},instanceFillColors:{size:this.props.colorFormat.length,transition:!0,type:"unorm8",accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:this.props.colorFormat.length,transition:!0,type:"unorm8",accessor:"getLineColor",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:"getLineWidth",defaultValue:1}})}updateState(e){var n;super.updateState(e),e.changeFlags.extensionsChanged&&((n=this.state.model)==null||n.destroy(),this.state.model=this._getModel(),this.getAttributeManager().invalidateAll())}draw({uniforms:e}){const{radiusUnits:n,radiusScale:r,radiusMinPixels:i,radiusMaxPixels:s,stroked:l,filled:c,billboard:f,antialiasing:d,lineWidthUnits:g,lineWidthScale:m,lineWidthMinPixels:v,lineWidthMaxPixels:S}=this.props,E={stroked:l,filled:c,billboard:f,antialiasing:d,radiusUnits:jo[n],radiusScale:r,radiusMinPixels:i,radiusMaxPixels:s,lineWidthUnits:jo[g],lineWidthScale:m,lineWidthMinPixels:v,lineWidthMaxPixels:S},w=this.state.model;w.shaderInputs.setProps({scatterplot:E}),w.draw(this.context.renderPass)}_getModel(){const e=[-1,-1,0,1,-1,0,-1,1,0,1,1,0];return new Wo(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),geometry:new Db({topology:"triangle-strip",attributes:{positions:{size:3,value:new Float32Array(e)}}}),isInstanced:!0})}}Vb.defaultProps=qQ;Vb.layerName="ScatterplotLayer";const YQ={COUNTER_CLOCKWISE:-1};function KQ(t,e,n={}){return ZQ(t,n)!==e?(GQ(t,n),!0):!1}function ZQ(t,e={}){return Math.sign(QQ(t,e))}const kC={x:0,y:1,z:2};function QQ(t,e={}){const{start:n=0,end:r=t.length,plane:i="xy"}=e,s=e.size||2;let l=0;const c=kC[i[0]],f=kC[i[1]];for(let d=n,g=r-s;d=r),i=i.flatMap(S=>[S[0],S[1]]),KQ(i,YQ.COUNTER_CLOCKWISE));const s=n>0,l=r+1,c=s?l*3+1:r,f=Math.PI*2/r,d=new Uint16Array(s?r*3*2:0),g=new Float32Array(c*3),m=new Float32Array(c*3);let v=0;if(s){for(let S=0;S",extruded:"f32",stroked:"f32",isStroke:"f32",coverage:"f32",elevationScale:"f32",edgeDistance:"f32",widthScale:"f32",widthMinPixels:"f32",widthMaxPixels:"f32",radiusUnits:"i32",widthUnits:"i32"}},nG=`#version 300 es +#define SHADER_NAME column-layer-vertex-shader +in vec3 positions; +in vec3 normals; +in vec3 instancePositions; +in float instanceElevations; +in vec3 instancePositions64Low; +in vec4 instanceFillColors; +in vec4 instanceLineColors; +in float instanceStrokeWidths; +in vec3 instancePickingColors; +out vec4 vColor; +#ifdef FLAT_SHADING +out vec3 cameraPosition; +out vec4 position_commonspace; +#endif +void main(void) { +geometry.worldPosition = instancePositions; +vec4 color = column.isStroke ? instanceLineColors : instanceFillColors; +mat2 rotationMatrix = mat2(cos(column.angle), sin(column.angle), -sin(column.angle), cos(column.angle)); +float elevation = 0.0; +float strokeOffsetRatio = 1.0; +if (column.extruded) { +elevation = instanceElevations * (positions.z + 1.0) / 2.0 * column.elevationScale; +} else if (column.stroked) { +float widthPixels = clamp( +project_size_to_pixel(instanceStrokeWidths * column.widthScale, column.widthUnits), +column.widthMinPixels, column.widthMaxPixels) / 2.0; +float halfOffset = project_pixel_size(widthPixels) / project_size(column.edgeDistance * column.coverage * column.radius); +if (column.isStroke) { +strokeOffsetRatio -= sign(positions.z) * halfOffset; +} else { +strokeOffsetRatio -= halfOffset; +} +} +float shouldRender = float(color.a > 0.0 && instanceElevations >= 0.0); +float dotRadius = column.radius * column.coverage * shouldRender; +geometry.pickingColor = instancePickingColors; +vec3 centroidPosition = vec3(instancePositions.xy, instancePositions.z + elevation); +vec3 centroidPosition64Low = instancePositions64Low; +vec2 offset = (rotationMatrix * positions.xy * strokeOffsetRatio + column.offset) * dotRadius; +if (column.radiusUnits == UNIT_METERS) { +offset = project_size(offset); +} +vec3 pos = vec3(offset, 0.); +DECKGL_FILTER_SIZE(pos, geometry); +gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64Low, pos, geometry.position); +geometry.normal = project_normal(vec3(rotationMatrix * normals.xy, normals.z)); +DECKGL_FILTER_GL_POSITION(gl_Position, geometry); +if (column.extruded && !column.isStroke) { +#ifdef FLAT_SHADING +cameraPosition = project.cameraPosition; +position_commonspace = geometry.position; +vColor = vec4(color.rgb, color.a * layer.opacity); +#else +vec3 lightColor = lighting_getLightColor(color.rgb, project.cameraPosition, geometry.position.xyz, geometry.normal); +vColor = vec4(lightColor, color.a * layer.opacity); +#endif +} else { +vColor = vec4(color.rgb, color.a * layer.opacity); +} +DECKGL_FILTER_COLOR(vColor, geometry); +} +`,rG=`#version 300 es +#define SHADER_NAME column-layer-fragment-shader +precision highp float; +out vec4 fragColor; +in vec4 vColor; +#ifdef FLAT_SHADING +in vec3 cameraPosition; +in vec4 position_commonspace; +#endif +void main(void) { +fragColor = vColor; +geometry.uv = vec2(0.); +#ifdef FLAT_SHADING +if (column.extruded && !column.isStroke && !bool(picking.isActive)) { +vec3 normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz))); +fragColor.rgb = lighting_getLightColor(vColor.rgb, cameraPosition, position_commonspace.xyz, normal); +} +#endif +DECKGL_FILTER_COLOR(fragColor, geometry); +} +`,Ug=[0,0,0,255],iG={diskResolution:{type:"number",min:4,value:20},vertices:null,radius:{type:"number",min:0,value:1e3},angle:{type:"number",value:0},offset:{type:"array",value:[0,0]},coverage:{type:"number",min:0,max:1,value:1},elevationScale:{type:"number",min:0,value:1},radiusUnits:"meters",lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,extruded:!0,wireframe:!1,filled:!0,stroked:!1,flatShading:!1,getPosition:{type:"accessor",value:t=>t.position},getFillColor:{type:"accessor",value:Ug},getLineColor:{type:"accessor",value:Ug},getLineWidth:{type:"accessor",value:1},getElevation:{type:"accessor",value:1e3},material:!0,getColor:{deprecatedFor:["getFillColor","getLineColor"]}};class Hb extends sd{getShaders(){const e={},{flatShading:n}=this.props;return n&&(e.FLAT_SHADING=1),super.getShaders({vs:nG,fs:rG,defines:e,modules:[vO,n?sO:iO,EO,tG]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:"float64",fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceElevations:{size:1,transition:!0,accessor:"getElevation"},instanceFillColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getFillColor",defaultValue:Ug},instanceLineColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getLineColor",defaultValue:Ug},instanceStrokeWidths:{size:1,accessor:"getLineWidth",transition:!0}})}updateState(e){var c;super.updateState(e);const{props:n,oldProps:r,changeFlags:i}=e,s=i.extensionsChanged||n.flatShading!==r.flatShading;s&&((c=this.state.models)==null||c.forEach(f=>f.destroy()),this.setState(this._getModels()),this.getAttributeManager().invalidateAll());const l=this.getNumInstances();this.state.fillModel.setInstanceCount(l),this.state.wireframeModel.setInstanceCount(l),(s||n.diskResolution!==r.diskResolution||n.vertices!==r.vertices||(n.extruded||n.stroked)!==(r.extruded||r.stroked))&&this._updateGeometry(n)}getGeometry(e,n,r){const i=new JQ({radius:1,height:r?2:0,vertices:n,nradial:e});let s=0;if(n)for(let l=0;luP(n,e));if(Ep(t)){if(lG(t))return e.style=oG,_.cloneElement(t,e);if(cG(t))return _.cloneElement(t,e)}return t}function Ep(t){return t&&typeof t=="object"&&"type"in t||!1}function lG(t){var e;return(e=t.props)==null?void 0:e.mapStyle}function cG(t){const e=t.type;return e&&e.deckGLViewProps}function Iy(t){if(typeof t=="function")return _.createElement(Uc,{},t);if(Array.isArray(t))return t.map(Iy);if(Ep(t)){if(t.type===_.Fragment)return Iy(t.props.children);if(Lg(t.type,Uc))return t}return t}function uG({children:t,layers:e=[],views:n=null}){const r=[],i=[],s={};return _.Children.forEach(Iy(t),l=>{if(Ep(l)){const c=l.type;if(Lg(c,sd)){const f=fG(c,l.props);i.push(f)}else r.push(l);if(Lg(c,Uc)&&c!==Uc&&l.props.id){const f=new c(l.props);s[f.id]=f}}else l&&r.push(l)}),Object.keys(s).length>0&&(Array.isArray(n)?n.forEach(l=>{s[l.id]=l}):n&&(s[n.id]=n),n=Object.values(s)),e=i.length>0?[...i,...e]:e,{layers:e,children:r,views:n}}function fG(t,e){const n={},r=t.defaultProps||{};for(const i in e)r[i]!==e[i]&&(n[i]=e[i]);return new t(n)}const dG=_.createContext();function hG({children:t,deck:e,ContextProvider:n=dG.Provider}){const{viewManager:r}=e||{};if(!r||!r.views.length)return[];const i={},s=r.views[0].id;for(const l of t){let c=s,f=l;Ep(l)&&Lg(l.type,Uc)&&(c=l.props.id||s,f=l.props.children);const d=r.getViewport(c),g=r.getViewState(c);if(d){g.padding=d.padding;const{x:m,y:v,width:S,height:E}=d;f=uP(f,{x:m,y:v,width:S,height:E,viewport:d,viewState:g}),i[c]||(i[c]={viewport:d,children:[]}),i[c].children.push(f)}}return Object.keys(i).map(l=>{const{viewport:c,children:f}=i[l],{x:d,y:g,width:m,height:v}=c,S={position:"absolute",left:d,top:g,width:m,height:v},E=`view-${l}`,w=_.createElement("div",{key:E,id:E,style:S},...f),b={deck:e,viewport:c,container:e.canvas.offsetParent,eventManager:e.eventManager,onViewStateChange:T=>{T.viewId=l,e._onViewStateChange(T)},widgets:[]},A=`view-${l}-context`;return _.createElement(n,{key:A,value:b},w)})}const gG={mixBlendMode:null};function pG({width:t,height:e,style:n}){const r={position:"absolute",zIndex:0,left:0,top:0,width:t,height:e},i={left:0,top:0};if(n)for(const s in n)s in gG?i[s]=n[s]:r[s]=n[s];return{containerStyle:r,canvasStyle:i}}function mG(t){return{get deck(){return t.deck},pickObject:e=>t.deck.pickObject(e),pickMultipleObjects:e=>t.deck.pickMultipleObjects(e),pickObjects:e=>t.deck.pickObjects(e)}}function fP(t){t.redrawReason&&(t.deck._drawLayers(t.redrawReason),t.redrawReason=null)}function vG(t,e,n){const r=new e({...n,_customRender:i=>{t.redrawReason=i;const s=r.getViewports();t.lastRenderedViewports!==s?t.forceUpdate():fP(t)}});return r}function _G(t,e){const[n,r]=_.useState(0),s=_.useRef({control:null,version:n,forceUpdate:()=>r(x=>x+1)}).current,l=_.useRef(null),c=_.useRef(null),f=_.useMemo(()=>uG(t),[t.layers,t.views,t.children]);let d=!0;const g=x=>{var N;return d&&t.viewState?(s.viewStateUpdateRequested=x,null):(s.viewStateUpdateRequested=null,(N=t.onViewStateChange)==null?void 0:N.call(t,x))},m=x=>{var N;d?s.interactionStateUpdateRequested=x:(s.interactionStateUpdateRequested=null,(N=t.onInteractionStateChange)==null||N.call(t,x))},v=_.useMemo(()=>{const x={widgets:[],...t,style:null,width:"100%",height:"100%",parent:l.current,canvas:c.current,layers:f.layers,views:f.views,onViewStateChange:g,onInteractionStateChange:m};return delete x._customRender,s.deck&&s.deck.setProps(x),x},[t]);_.useEffect(()=>{const x=t.Deck||zb;return s.deck=vG(s,x,{...v,parent:l.current,canvas:c.current}),()=>{var N;return(N=s.deck)==null?void 0:N.finalize()}},[]),aG(()=>{fP(s);const{viewStateUpdateRequested:x,interactionStateUpdateRequested:N}=s;x&&g(x),N&&m(N)}),_.useImperativeHandle(e,()=>mG(s),[]);const S=s.deck&&s.deck.isInitialized?s.deck.getViewports():void 0,{ContextProvider:E,width:w="100%",height:b="100%",id:A,style:T}=t,{containerStyle:C,canvasStyle:M}=_.useMemo(()=>pG({width:w,height:b,style:T}),[w,b,T]);if(!s.viewStateUpdateRequested&&s.lastRenderedViewports===S||s.version!==n){s.lastRenderedViewports=S,s.version=n;const x=hG({children:f.children,deck:s.deck,ContextProvider:E}),N=_.createElement("canvas",{key:"canvas",id:A||"deckgl-overlay",ref:c,style:M});s.control=_.createElement("div",{id:`${A||"deckgl"}-wrapper`,ref:l,style:C},[N,x])}return d=!1,s.control}const dP=_.forwardRef(_G),yG=_.createContext(null);function bG(t,e){const n=Array.isArray(t)?t[0]:t?t.x:0,r=Array.isArray(t)?t[1]:t?t.y:0,i=Array.isArray(e)?e[0]:e?e.x:0,s=Array.isArray(e)?e[1]:e?e.y:0;return n===i&&r===s}function ms(t,e){if(t===e)return!0;if(!t||!e)return!1;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let n=0;n{let i=null;"interactive"in r&&(i=Object.assign({},r),delete i.interactive);const s=e[r.ref];if(s){i=i||Object.assign({},r),delete i.ref;for(const l of SG)l in s&&(i[l]=s[l])}return i||r});return{...t,layers:n}}const $C={version:8,sources:{},layers:[]},VC={mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",click:"onClick",dblclick:"onDblClick",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mouseout:"onMouseOut",contextmenu:"onContextMenu",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",touchcancel:"onTouchCancel"},HC={movestart:"onMoveStart",move:"onMove",moveend:"onMoveEnd",dragstart:"onDragStart",drag:"onDrag",dragend:"onDragEnd",zoomstart:"onZoomStart",zoom:"onZoom",zoomend:"onZoomEnd",rotatestart:"onRotateStart",rotate:"onRotate",rotateend:"onRotateEnd",pitchstart:"onPitchStart",pitch:"onPitch",pitchend:"onPitchEnd"},jC={wheel:"onWheel",boxzoomstart:"onBoxZoomStart",boxzoomend:"onBoxZoomEnd",boxzoomcancel:"onBoxZoomCancel",resize:"onResize",load:"onLoad",render:"onRender",idle:"onIdle",remove:"onRemove",data:"onData",styledata:"onStyleData",sourcedata:"onSourceData",error:"onError"},wG=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],EG=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"];class zc{constructor(e,n,r){this._map=null,this._internalUpdate=!1,this._hoveredFeatures=null,this._propsedCameraUpdate=null,this._styleComponents={},this._onEvent=i=>{const s=this.props[jC[i.type]];s?s(i):i.type==="error"&&console.error(i.error)},this._onCameraEvent=i=>{if(this._internalUpdate)return;i.viewState=this._propsedCameraUpdate||UC(this._map.transform);const s=this.props[HC[i.type]];s&&s(i)},this._onCameraUpdate=i=>this._internalUpdate?i:(this._propsedCameraUpdate=UC(i),LC(i,this.props)),this._onPointerEvent=i=>{(i.type==="mousemove"||i.type==="mouseout")&&this._updateHover(i);const s=this.props[VC[i.type]];s&&(this.props.interactiveLayerIds&&i.type!=="mouseover"&&i.type!=="mouseout"&&(i.features=this._hoveredFeatures||this._queryRenderedFeatures(i.point)),s(i),delete i.features)},this._MapClass=e,this.props=n,this._initialize(r)}get map(){return this._map}setProps(e){const n=this.props;this.props=e;const r=this._updateSettings(e,n),i=this._updateSize(e),s=this._updateViewState(e);this._updateStyle(e,n),this._updateStyleComponents(e),this._updateHandlers(e,n),(r||i||s&&!this._map.isMoving())&&this.redraw()}static reuse(e,n){const r=zc.savedMaps.pop();if(!r)return null;const i=r.map,s=i.getContainer();for(n.className=s.className;s.childNodes.length>0;)n.appendChild(s.childNodes[0]);i._container=n;const l=i._resizeObserver;l&&(l.disconnect(),l.observe(n)),r.setProps({...e,styleDiffing:!1}),i.resize();const{initialViewState:c}=e;return c&&(c.bounds?i.fitBounds(c.bounds,{...c.fitBoundsOptions,duration:0}):r._updateViewState(c)),i.isStyleLoaded()?i.fire("load"):i.once("style.load",()=>i.fire("load")),i._update(),r}_initialize(e){const{props:n}=this,{mapStyle:r=$C}=n,i={...n,...n.initialViewState,container:e,style:zC(r)},s=i.initialViewState||i.viewState||i;if(Object.assign(i,{center:[s.longitude||0,s.latitude||0],zoom:s.zoom||0,pitch:s.pitch||0,bearing:s.bearing||0}),n.gl){const c=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=c,n.gl)}const l=new this._MapClass(i);s.padding&&l.setPadding(s.padding),n.cursor&&(l.getCanvas().style.cursor=n.cursor),l.transformCameraUpdate=this._onCameraUpdate,l.on("style.load",()=>{var c;this._styleComponents={light:l.getLight(),sky:l.getSky(),projection:(c=l.getProjection)==null?void 0:c.call(l),terrain:l.getTerrain()},this._updateStyleComponents(this.props)}),l.on("sourcedata",()=>{this._updateStyleComponents(this.props)});for(const c in VC)l.on(c,this._onPointerEvent);for(const c in HC)l.on(c,this._onCameraEvent);for(const c in jC)l.on(c,this._onEvent);this._map=l}recycle(){const n=this.map.getContainer().querySelector("[mapboxgl-children]");n==null||n.remove(),zc.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){const e=this._map;e.style&&(e._frame&&(e._frame.cancel(),e._frame=null),e._render())}_updateSize(e){const{viewState:n}=e;if(n){const r=this._map;if(n.width!==r.transform.width||n.height!==r.transform.height)return r.resize(),!0}return!1}_updateViewState(e){const n=this._map,r=n.transform;if(!n.isMoving()){const s=LC(r,e);if(Object.keys(s).length>0)return this._internalUpdate=!0,n.jumpTo(s),this._internalUpdate=!1,!0}return!1}_updateSettings(e,n){const r=this._map;let i=!1;for(const s of wG)if(s in e&&!ms(e[s],n[s])){i=!0;const l=r[`set${s[0].toUpperCase()}${s.slice(1)}`];l==null||l.call(r,e[s])}return i}_updateStyle(e,n){if(e.cursor!==n.cursor&&(this._map.getCanvas().style.cursor=e.cursor||""),e.mapStyle!==n.mapStyle){const{mapStyle:r=$C,styleDiffing:i=!0}=e,s={diff:i};"localIdeographFontFamily"in e&&(s.localIdeographFontFamily=e.localIdeographFontFamily),this._map.setStyle(zC(r),s)}}_updateStyleComponents({light:e,projection:n,sky:r,terrain:i}){var c,f;const s=this._map,l=this._styleComponents;s.style._loaded&&(e&&!ms(e,l.light)&&(l.light=e,s.setLight(e)),n&&!ms(n,l.projection)&&n!==((c=l.projection)==null?void 0:c.type)&&(l.projection=typeof n=="string"?{type:n}:n,(f=s.setProjection)==null||f.call(s,l.projection)),r&&!ms(r,l.sky)&&(l.sky=r,s.setSky(r)),i!==void 0&&!ms(i,l.terrain)&&(!i||s.getSource(i.source))&&(l.terrain=i,s.setTerrain(i)))}_updateHandlers(e,n){const r=this._map;for(const i of EG){const s=e[i]??!0,l=n[i]??!0;ms(s,l)||(s?r[i].enable(s):r[i].disable())}}_queryRenderedFeatures(e){const n=this._map,{interactiveLayerIds:r=[]}=this.props;try{return n.queryRenderedFeatures(e,{layers:r.filter(n.getLayer.bind(n))})}catch{return[]}}_updateHover(e){var i;const{props:n}=this;if(n.interactiveLayerIds&&(n.onMouseMove||n.onMouseEnter||n.onMouseLeave)){const s=e.type,l=((i=this._hoveredFeatures)==null?void 0:i.length)>0,c=this._queryRenderedFeatures(e.point),f=c.length>0;!f&&l&&(e.type="mouseleave",this._onPointerEvent(e)),this._hoveredFeatures=c,f&&!l&&(e.type="mouseenter",this._onPointerEvent(e)),e.type=s}else this._hoveredFeatures=null}}zc.savedMaps=[];const TG=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function AG(t){if(!t)return null;const e=t.map,n={getMap:()=>e};for(const r of CG(e))!(r in n)&&!TG.includes(r)&&(n[r]=e[r].bind(e));return n}function CG(t){const e=new Set;let n=t;for(;n;){for(const r of Object.getOwnPropertyNames(n))r[0]!=="_"&&typeof t[r]=="function"&&r!=="fire"&&r!=="setEventedParent"&&e.add(r);n=Object.getPrototypeOf(n)}return Array.from(e)}const RG=typeof document<"u"?_.useLayoutEffect:_.useEffect;function xG(t,e){const{RTLTextPlugin:n,maxParallelImageRequests:r,workerCount:i,workerUrl:s}=e;if(n&&t.getRTLTextPluginStatus&&t.getRTLTextPluginStatus()==="unavailable"){const{pluginUrl:l,lazy:c=!0}=typeof n=="string"?{pluginUrl:n}:n;t.setRTLTextPlugin(l,f=>{f&&console.error(f)},c)}r!==void 0&&t.setMaxParallelImageRequests(r),i!==void 0&&t.setWorkerCount(i),s!==void 0&&t.setWorkerUrl(s)}const Tp=_.createContext(null);function MG(t,e){const n=_.useContext(yG),[r,i]=_.useState(null),s=_.useRef(),{current:l}=_.useRef({mapLib:null,map:null});_.useEffect(()=>{const d=t.mapLib;let g=!0,m;return Promise.resolve(d||m6(()=>import("./maplibre-gl-C_BhQy4_.js").then(v=>v.m),[])).then(v=>{if(!g)return;if(!v)throw new Error("Invalid mapLib");const S="Map"in v?v:v.default;if(!S.Map)throw new Error("Invalid mapLib");if(xG(S,t),!S.supported||S.supported(t))t.reuseMaps&&(m=zc.reuse(t,s.current)),m||(m=new zc(S.Map,t,s.current)),l.map=AG(m),l.mapLib=S,i(m),n==null||n.onMapMount(l.map,t.id);else throw new Error("Map is not supported by this browser")}).catch(v=>{const{onError:S}=t;S?S({type:"error",target:null,originalEvent:null,error:v}):console.error(v)}),()=>{g=!1,m&&(n==null||n.onMapUnmount(t.id),t.reuseMaps?m.recycle():m.destroy())}},[]),RG(()=>{r&&r.setProps(t)}),_.useImperativeHandle(e,()=>l.map,[r]);const c=_.useMemo(()=>({position:"relative",width:"100%",height:"100%",...t.style}),[t.style]),f={height:"100%"};return _.createElement("div",{id:t.id,ref:s,style:c},r&&_.createElement(Tp.Provider,{value:l},_.createElement("div",{"mapboxgl-children":"",style:f},t.children)))}const hP=_.forwardRef(MG),OG=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function Ks(t,e){if(!t||!e)return;const n=t.style;for(const r in e){const i=e[r];Number.isFinite(i)&&!OG.test(r)?n[r]=`${i}px`:n[r]=i}}_.memo(_.forwardRef((t,e)=>{const{map:n,mapLib:r}=_.useContext(Tp),i=_.useRef({props:t});i.current.props=t;const s=_.useMemo(()=>{let w=!1;_.Children.forEach(t.children,T=>{T&&(w=!0)});const b={...t,element:w?document.createElement("div"):null},A=new r.Marker(b);return A.setLngLat([t.longitude,t.latitude]),A.getElement().addEventListener("click",T=>{var C,M;(M=(C=i.current.props).onClick)==null||M.call(C,{type:"click",target:A,originalEvent:T})}),A.on("dragstart",T=>{var M,x;const C=T;C.lngLat=s.getLngLat(),(x=(M=i.current.props).onDragStart)==null||x.call(M,C)}),A.on("drag",T=>{var M,x;const C=T;C.lngLat=s.getLngLat(),(x=(M=i.current.props).onDrag)==null||x.call(M,C)}),A.on("dragend",T=>{var M,x;const C=T;C.lngLat=s.getLngLat(),(x=(M=i.current.props).onDragEnd)==null||x.call(M,C)}),A},[]);_.useEffect(()=>(s.addTo(n.getMap()),()=>{s.remove()}),[]);const{longitude:l,latitude:c,offset:f,style:d,draggable:g=!1,popup:m=null,rotation:v=0,rotationAlignment:S="auto",pitchAlignment:E="auto"}=t;return _.useEffect(()=>{Ks(s.getElement(),d)},[d]),_.useImperativeHandle(e,()=>s,[]),(s.getLngLat().lng!==l||s.getLngLat().lat!==c)&&s.setLngLat([l,c]),f&&!bG(s.getOffset(),f)&&s.setOffset(f),s.isDraggable()!==g&&s.setDraggable(g),s.getRotation()!==v&&s.setRotation(v),s.getRotationAlignment()!==S&&s.setRotationAlignment(S),s.getPitchAlignment()!==E&&s.setPitchAlignment(E),s.getPopup()!==m&&s.setPopup(m),$a.createPortal(t.children,s.getElement())}));function WC(t){return new Set(t?t.trim().split(/\s+/):[])}_.memo(_.forwardRef((t,e)=>{const{map:n,mapLib:r}=_.useContext(Tp),i=_.useMemo(()=>document.createElement("div"),[]),s=_.useRef({props:t});s.current.props=t;const l=_.useMemo(()=>{const c={...t},f=new r.Popup(c);return f.setLngLat([t.longitude,t.latitude]),f.once("open",d=>{var g,m;(m=(g=s.current.props).onOpen)==null||m.call(g,d)}),f},[]);if(_.useEffect(()=>{const c=f=>{var d,g;(g=(d=s.current.props).onClose)==null||g.call(d,f)};return l.on("close",c),l.setDOMContent(i).addTo(n.getMap()),()=>{l.off("close",c),l.isOpen()&&l.remove()}},[]),_.useEffect(()=>{Ks(l.getElement(),t.style)},[t.style]),_.useImperativeHandle(e,()=>l,[]),l.isOpen()&&((l.getLngLat().lng!==t.longitude||l.getLngLat().lat!==t.latitude)&&l.setLngLat([t.longitude,t.latitude]),t.offset&&!ms(l.options.offset,t.offset)&&l.setOffset(t.offset),(l.options.anchor!==t.anchor||l.options.maxWidth!==t.maxWidth)&&(l.options.anchor=t.anchor,l.setMaxWidth(t.maxWidth)),l.options.className!==t.className)){const c=WC(l.options.className),f=WC(t.className);for(const d of c)f.has(d)||l.removeClassName(d);for(const d of f)c.has(d)||l.addClassName(d);l.options.className=t.className}return $a.createPortal(t.children,i)}));function tl(t,e,n,r){const i=_.useContext(Tp),s=_.useMemo(()=>t(i),[]);return _.useEffect(()=>{const l=e,c=null,f=typeof e=="function"?e:null,{map:d}=i;return d.hasControl(s)||(d.addControl(s,l==null?void 0:l.position),c&&c(i)),()=>{f&&f(i),d.hasControl(s)&&d.removeControl(s)}},[]),s}function PG(t){const e=tl(({mapLib:n})=>new n.AttributionControl(t),{position:t.position});return _.useEffect(()=>{Ks(e._container,t.style)},[t.style]),null}_.memo(PG);function NG(t){const e=tl(({mapLib:n})=>new n.FullscreenControl({container:t.containerId&&document.getElementById(t.containerId)}),{position:t.position});return _.useEffect(()=>{Ks(e._controlContainer,t.style)},[t.style]),null}_.memo(NG);function IG(t,e){const n=_.useRef({props:t}),r=tl(({mapLib:i})=>{const s=new i.GeolocateControl(t),l=s._setupUI;return s._setupUI=()=>{s._container.hasChildNodes()||l()},s.on("geolocate",c=>{var f,d;(d=(f=n.current.props).onGeolocate)==null||d.call(f,c)}),s.on("error",c=>{var f,d;(d=(f=n.current.props).onError)==null||d.call(f,c)}),s.on("outofmaxbounds",c=>{var f,d;(d=(f=n.current.props).onOutOfMaxBounds)==null||d.call(f,c)}),s.on("trackuserlocationstart",c=>{var f,d;(d=(f=n.current.props).onTrackUserLocationStart)==null||d.call(f,c)}),s.on("trackuserlocationend",c=>{var f,d;(d=(f=n.current.props).onTrackUserLocationEnd)==null||d.call(f,c)}),s},{position:t.position});return n.current.props=t,_.useImperativeHandle(e,()=>r,[]),_.useEffect(()=>{Ks(r._container,t.style)},[t.style]),null}_.memo(_.forwardRef(IG));function DG(t){const e=tl(({mapLib:n})=>new n.NavigationControl(t),{position:t.position});return _.useEffect(()=>{Ks(e._container,t.style)},[t.style]),null}_.memo(DG);function FG(t){const e=tl(({mapLib:s})=>new s.ScaleControl(t),{position:t.position}),n=_.useRef(t),r=n.current;n.current=t;const{style:i}=t;return t.maxWidth!==void 0&&t.maxWidth!==r.maxWidth&&(e.options.maxWidth=t.maxWidth),t.unit!==void 0&&t.unit!==r.unit&&e.setUnit(t.unit),_.useEffect(()=>{Ks(e._container,i)},[i]),null}_.memo(FG);function kG(t){const e=tl(({mapLib:n})=>new n.TerrainControl(t),{position:t.position});return _.useEffect(()=>{Ks(e._container,t.style)},[t.style]),null}_.memo(kG);function BG(t){const e=tl(({mapLib:n})=>new n.LogoControl(t),{position:t.position});return _.useEffect(()=>{Ks(e._container,t.style)},[t.style]),null}_.memo(BG);const XC=mp().domain([0,1e4]).range([vg(0),vg(1)]),UG=mp().domain([0,12e3]).range([50,250]);function LG(){const[t,e]=_.useState(0),[n,r]=_.useState("00:00:00"),[i,s]=_.useState("2023-12-01"),{isPending:l,error:c,data:f}=h6({queryKey:[i],queryFn:()=>Jh(`./${i}.csv`,Zy,{csv:{}})});c&&console.log(c);const d=l?[]:[new Lf({id:"deckgl-grid",data:f.data,getPosition:g=>[g.x,g.y],getFillColor:g=>XC(g[n]).slice(4,-1).split(", ").map(Number),cellSize:505,extruded:!1,updateTriggers:{getFillColor:[n]}}),new Vb({id:"deckgl-circle2",getPosition:g=>[g.x,g.y],getFillColor:g=>XC(g[n]).slice(4,-1).split(", ").map(Number),getRadius:g=>UG(g[n]),updateTriggers:{getFillColor:[n],getRadius:[n]}})];return ar.jsxs(ar.Fragment,{children:[ar.jsx(dP,{initialViewState:{longitude:37.028,latitude:55.778,zoom:7},controller:!0,layers:d,children:ar.jsx(hP,{mapStyle:"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",hash:!0})}),ar.jsxs(aM,{style:{position:"absolute",zIndex:1,justifyContent:"center",padding:30},direction:"vertical",children:[ar.jsx(uM,{spinning:l}),ar.jsx(qc,{onChange:s,options:[{value:"2023-12-01"},{value:"2023-12-02"}],value:i}),ar.jsx(N9,{value:t,min:0,max:47,onChange:g=>e(g),onChangeComplete:g=>{const m=Math.floor(g/2).toString().padStart(2,"0"),v=(g%2*30).toString().padStart(2,"0"),S=m+":"+v+":00";r(S)}}),ar.jsx("p",{id:"time",children:n}),ar.jsx("button",{onClick:()=>{e(t+1);const g=parseInt(t),m=Math.floor(g/2).toString().padStart(2,"0"),v=(g%2*30).toString().padStart(2,"0"),S=m+":"+v+":00";r(S)},children:"Плюс"})]})]})}const qC=["BOOLEAN","INT32","INT64","INT96","FLOAT","DOUBLE","BYTE_ARRAY","FIXED_LEN_BYTE_ARRAY"],So=["PLAIN",void 0,"PLAIN_DICTIONARY","RLE","BIT_PACKED","DELTA_BINARY_PACKED","DELTA_LENGTH_BYTE_ARRAY","DELTA_BYTE_ARRAY","RLE_DICTIONARY","BYTE_STREAM_SPLIT"],zG=["REQUIRED","OPTIONAL","REPEATED"],$G=["UTF8","MAP","MAP_KEY_VALUE","LIST","ENUM","DECIMAL","DATE","TIME_MILLIS","TIME_MICROS","TIMESTAMP_MILLIS","TIMESTAMP_MICROS","UINT_8","UINT_16","UINT_32","UINT_64","INT_8","INT_16","INT_32","INT_64","JSON","BSON","INTERVAL"],VG=["UNCOMPRESSED","SNAPPY","GZIP","LZO","BROTLI","LZ4","ZSTD","LZ4_RAW"],gP=["DATA_PAGE","INDEX_PAGE","DICTIONARY_PAGE","DATA_PAGE_V2"],pP=864e5;function YC(t,e,n,r,i=!0){if(e&&r.endsWith("_DICTIONARY")){e=KC(e,n,i);let s=t;t instanceof Uint8Array&&!(e instanceof Uint8Array)&&(s=new e.constructor(t.length));for(let l=0;lJSON.parse(l.decode(c)))}if(r==="BSON")throw new Error("parquet bson not supported");if(r==="INTERVAL")throw new Error("parquet interval not supported");if(r==="UTF8"||n&&e.type==="BYTE_ARRAY"){const l=new TextDecoder,c=new Array(t.length);for(let f=0;f=2**(n-1)&&(e-=2**n),e}function HG(t){const e=Number((t>>64n)-2440588n),n=Number((t&0xffffffffffffffffn)/1000000n),r=e*pP+n;return new Date(r)}function vP(t){if(!t)return;const e=t[1]<<8|t[0],n=e>>15?-1:1,r=e>>10&31,i=e&1023;return r===0?n*2**-14*(i/1024):r===31?i?NaN:n*(1/0):n*2**(r-15)*(1+i/1024)}function _P(t,e,n){const r=t[e],i=[];let s=1;if(r.num_children)for(;i.lengthl.element.name===i);if(!s)throw new Error(`parquet schema element not found: ${e}`);r.push(s),n=s}return r}function yP(t){let e=0;for(const{element:n}of t)n.repetition_type==="REPEATED"&&e++;return e}function zg(t){let e=0;for(const{element:n}of t.slice(1))n.repetition_type!=="REQUIRED"&&e++;return e}function jG(t){if(!t||t.element.converted_type!=="LIST"||t.children.length>1)return!1;const e=t.children[0];return!(e.children.length>1||e.element.repetition_type!=="REPEATED")}function WG(t){if(!t||t.element.converted_type!=="MAP"||t.children.length>1)return!1;const e=t.children[0];if(e.children.length!==2||e.element.repetition_type!=="REPEATED")return!1;const n=e.children.find(i=>i.element.name==="key");if((n==null?void 0:n.element.repetition_type)==="REPEATED")return!1;const r=e.children.find(i=>i.element.name==="value");return(r==null?void 0:r.element.repetition_type)!=="REPEATED"}const Cr={STOP:0,TRUE:1,FALSE:2,BYTE:3,I16:4,I32:5,I64:6,DOUBLE:7,BINARY:8,LIST:9,STRUCT:12,UUID:13};function bP(t){let e=0;const n={};for(;t.offset>>1^-(e&1)}function Dy(t){const e=XG(t);return e>>BigInt(1)^-(e&BigInt(1))}function SP(t){return t&15}function wP(t,e){const n=t.view.getUint8(t.offset++);if((n&15)===Cr.STOP)return[0,0,e];const r=n>>4;let i;if(r)i=e+r;else throw new Error("non-delta field id not supported");return[SP(n),i,i]}function YG(t){const e=t.view.getUint8(t.offset++),n=e>>4,r=SP(e);if(n===15){const i=$o(t);return[r,i]}return[r,n]}async function KG(t,e=1<<19){if(!t)throw new Error("parquet file is required");if(!(t.byteLength>=0))throw new Error("parquet file byteLength is required");const n=Math.max(0,t.byteLength-e),r=await t.slice(n,t.byteLength),i=new DataView(r);if(i.getUint32(r.byteLength-4,!0)!==827474256)throw new Error("parquet file invalid (footer != PAR1)");const s=i.getUint32(r.byteLength-8,!0);if(s>t.byteLength-8)throw new Error(`parquet metadata length ${s} exceeds available buffer ${t.byteLength-8}`);if(s+8>e){const l=t.byteLength-s-8,c=await t.slice(l,n),f=new ArrayBuffer(s+8),d=new Uint8Array(f);return d.set(new Uint8Array(c)),d.set(new Uint8Array(r),n-l),QC(f)}else return QC(r)}function QC(t){var b;if(!t)throw new Error("parquet file is required");const e=new DataView(t);if(e.byteLength<8)throw new Error("parquet file is too short");if(e.getUint32(e.byteLength-4,!0)!==827474256)throw new Error("parquet file invalid (footer != PAR1)");const n=e.byteLength-8,r=e.getUint32(n,!0);if(r>e.byteLength-8)throw new Error(`parquet metadata length ${r} exceeds available buffer ${e.byteLength-8}`);const i=n-r,l=bP({view:e,offset:i}),c=new TextDecoder;function f(A){return A&&c.decode(A)}const d=l.field_1,g=l.field_2.map(A=>({type:qC[A.field_1],type_length:A.field_2,repetition_type:zG[A.field_3],name:f(A.field_4),num_children:A.field_5,converted_type:$G[A.field_6],scale:A.field_7,precision:A.field_8,field_id:A.field_9,logical_type:ZG(A.field_10)})),m=g.filter(A=>A.type),v=l.field_3,S=l.field_4.map(A=>{var T;return{columns:A.field_1.map((C,M)=>{var x,N;return{file_path:f(C.field_1),file_offset:C.field_2,meta_data:C.field_3&&{type:qC[C.field_3.field_1],encodings:(x=C.field_3.field_2)==null?void 0:x.map(F=>So[F]),path_in_schema:C.field_3.field_3.map(f),codec:VG[C.field_3.field_4],num_values:C.field_3.field_5,total_uncompressed_size:C.field_3.field_6,total_compressed_size:C.field_3.field_7,key_value_metadata:C.field_3.field_8,data_page_offset:C.field_3.field_9,index_page_offset:C.field_3.field_10,dictionary_page_offset:C.field_3.field_11,statistics:QG(C.field_3.field_12,m[M]),encoding_stats:(N=C.field_3.field_13)==null?void 0:N.map(F=>({page_type:gP[F.field_1],encoding:So[F.field_2],count:F.field_3})),bloom_filter_offset:C.field_3.field_14,bloom_filter_length:C.field_3.field_15,size_statistics:C.field_3.field_16&&{unencoded_byte_array_data_bytes:C.field_3.field_16.field_1,repetition_level_histogram:C.field_3.field_16.field_2,definition_level_histogram:C.field_3.field_16.field_3}},offset_index_offset:C.field_4,offset_index_length:C.field_5,column_index_offset:C.field_6,column_index_length:C.field_7,crypto_metadata:C.field_7,encrypted_column_metadata:C.field_8}}),total_byte_size:A.field_2,num_rows:A.field_3,sorting_columns:(T=A.field_4)==null?void 0:T.map(C=>({column_idx:C.field_1,descending:C.field_2,nulls_first:C.field_3})),file_offset:A.field_5,total_compressed_size:A.field_6,ordinal:A.field_7}}),E=(b=l.field_5)==null?void 0:b.map(A=>({key:f(A.field_1),value:f(A.field_2)})),w=f(l.field_6);return{version:d,schema:g,num_rows:v,row_groups:S,key_value_metadata:E,created_by:w,metadata_length:r}}function ZG(t){return t!=null&&t.field_1?{type:"STRING"}:t!=null&&t.field_2?{type:"MAP"}:t!=null&&t.field_3?{type:"LIST"}:t!=null&&t.field_4?{type:"ENUM"}:t!=null&&t.field_5?{type:"DECIMAL",scale:t.field_5.field_1,precision:t.field_5.field_2}:t!=null&&t.field_6?{type:"DATE"}:t!=null&&t.field_7?{type:"TIME",isAdjustedToUTC:t.field_7.field_1,unit:GC(t.field_7.field_2)}:t!=null&&t.field_8?{type:"TIMESTAMP",isAdjustedToUTC:t.field_8.field_1,unit:GC(t.field_8.field_2)}:t!=null&&t.field_10?{type:"INTEGER",bitWidth:t.field_10.field_1,isSigned:t.field_10.field_2}:t!=null&&t.field_11?{type:"NULL"}:t!=null&&t.field_12?{type:"JSON"}:t!=null&&t.field_13?{type:"BSON"}:t!=null&&t.field_14?{type:"UUID"}:t!=null&&t.field_15?{type:"FLOAT16"}:t}function GC(t){if(t.field_1)return"MILLIS";if(t.field_2)return"MICROS";if(t.field_3)return"NANOS";throw new Error("parquet time unit required")}function QG(t,e){return t&&{max:Dh(t.field_1,e),min:Dh(t.field_2,e),null_count:t.field_3,distinct_count:t.field_4,max_value:Dh(t.field_5,e),min_value:Dh(t.field_6,e),is_max_value_exact:t.field_7,is_min_value_exact:t.field_8}}function Dh(t,e){const{type:n,converted_type:r,logical_type:i}=e;if(t===void 0)return t;if(n==="BOOLEAN")return t[0]===1;if(n==="BYTE_ARRAY")return new TextDecoder().decode(t);const s=new DataView(t.buffer,t.byteOffset,t.byteLength);return n==="FLOAT"&&s.byteLength===4?s.getFloat32(0,!0):n==="DOUBLE"&&s.byteLength===8?s.getFloat64(0,!0):n==="INT32"&&r==="DATE"?new Date(s.getInt32(0,!0)*864e5):n==="INT64"&&r==="TIMESTAMP_MICROS"?new Date(Number(s.getBigInt64(0,!0)/1000n)):n==="INT64"&&r==="TIMESTAMP_MILLIS"?new Date(Number(s.getBigInt64(0,!0))):n==="INT64"&&(i==null?void 0:i.type)==="TIMESTAMP"&&(i==null?void 0:i.unit)==="NANOS"?new Date(Number(s.getBigInt64(0,!0)/1000000n)):n==="INT64"&&(i==null?void 0:i.type)==="TIMESTAMP"&&(i==null?void 0:i.unit)==="MICROS"?new Date(Number(s.getBigInt64(0,!0)/1000n)):n==="INT64"&&(i==null?void 0:i.type)==="TIMESTAMP"?new Date(Number(s.getBigInt64(0,!0))):n==="INT32"&&s.byteLength===4?s.getInt32(0,!0):n==="INT64"&&s.byteLength===8?s.getBigInt64(0,!0):r==="DECIMAL"?mP(t)*10**-(e.scale||0):(i==null?void 0:i.type)==="FLOAT16"?vP(t):t}function JC(t,e,n,r,i,s){const l=(e==null?void 0:e.length)||n.length;let c=0;const f=[t];let d=t,g=0,m=0,v=0;if(n[0])for(;g>S&w;for(S+=v;S>=8;)S-=8n,t.offset++,S&&(b|=BigInt(t.view.getUint8(t.offset))<>>1;eJ(t,l,e,r,i),i+=l}}}function eJ(t,e,n,r,i){const s=n+7>>3;let l=0;for(let c=0;c>1<<3;const l=(1<8?(d-=8,f-=8,c>>>=8):f-d>d&l),s--,d+=n);return i}function AP(t,e,n,r){const i=nJ(n,r),s=new Uint8Array(e*i);for(let l=0;l=n)throw new Error("invalid snappy length header");for(;i=n)throw new Error("missing eof marker");if(l&3){let f=0;switch(l&3){case 1:c=(l>>>2&7)+4,f=t[i]+(l>>>5<<8),i++;break;case 2:if(n<=i+1)throw new Error("snappy error end of input");c=(l>>>2)+1,f=t[i]+(t[i+1]<<8),i+=2;break;case 3:if(n<=i+3)throw new Error("snappy error end of input");c=(l>>>2)+1,f=t[i]+(t[i+1]<<8)+(t[i+2]<<16)+(t[i+3]<<24),i+=4;break}if(f===0||isNaN(f))throw new Error(`invalid offset ${f} pos ${i} inputLength ${n}`);if(f>s)throw new Error("cannot copy from before start of buffer");hJ(e,s,f,c),s+=c}else{let f=(l>>>2)+1;if(f>60){if(i+3>=n)throw new Error("snappy error literal pos + 3 >= inputLength");const d=f-60;f=t[i]+(t[i+1]<<8)+(t[i+2]<<16)+(t[i+3]<<24),f=(f&fJ[d])+1,i+=d}if(i+f>n)throw new Error("snappy error literal exceeds input length");dJ(t,i,e,s,f),i+=f,s+=f}}if(s!==r)throw new Error("premature end of input")}function pJ(t,e,n,{type:r}){const i=new DataView(t.buffer,t.byteOffset,t.byteLength),s={view:i,offset:0};let l;const c=vJ(s,e,n),{definitionLevels:f,numNulls:d}=_J(s,e,n),g=e.num_values-d;if(e.encoding==="PLAIN"){const{type_length:m}=n[n.length-1].element;l=jb(s,r,g,m)}else if(e.encoding==="PLAIN_DICTIONARY"||e.encoding==="RLE_DICTIONARY"||e.encoding==="RLE"){const m=r==="BOOLEAN"?1:i.getUint8(s.offset++);m?(l=new Array(g),r==="BOOLEAN"?(Va(s,m,0,l),l=l.map(v=>!!v)):Va(s,m,i.byteLength-s.offset,l)):l=new Uint8Array(g)}else if(e.encoding==="BYTE_STREAM_SPLIT"){const{type_length:m}=n[n.length-1].element;l=AP(s,g,r,m)}else throw new Error(`parquet unsupported encoding: ${e.encoding}`);return{definitionLevels:f,repetitionLevels:c,dataPage:l}}function mJ(t,e,n,r){const s={view:new DataView(t.buffer,t.byteOffset,t.byteLength),offset:0};return jb(s,n.type,e.num_values,r)}function vJ(t,e,n){if(n.length>1){const r=yP(n);if(r){const i=new Array(e.num_values);return Va(t,Ap(r),0,i),i}}return[]}function _J(t,e,n){const r=zg(n);if(!r)return{definitionLevels:[],numNulls:0};const i=new Array(e.num_values);Va(t,Ap(r),0,i);let s=e.num_values;for(const l of i)l===r&&s--;return s===0&&(i.length=0),{definitionLevels:i,numNulls:s}}function Fy(t,e,n,r){let i;const s=r==null?void 0:r[n];if(n==="UNCOMPRESSED")i=t;else if(s)i=s(t,e);else if(n==="SNAPPY")i=new Uint8Array(e),gJ(t,i);else throw new Error(`parquet unsupported compression codec: ${n}`);if((i==null?void 0:i.length)!==e)throw new Error(`parquet decompressed page length ${i==null?void 0:i.length} does not match header ${e}`);return i}function yJ(t,e,n,r,i){const l={view:new DataView(t.buffer,t.byteOffset,t.byteLength),offset:0},{codec:c,type:f}=r,d=e.data_page_header_v2;if(!d)throw new Error("parquet data page header v2 is undefined");const g=bJ(l,d,n);l.offset=d.repetition_levels_byte_length;const m=SJ(l,d,n),v=e.uncompressed_page_size-d.definition_levels_byte_length-d.repetition_levels_byte_length;let S=t.subarray(l.offset);d.is_compressed!==!1&&(S=Fy(S,v,c,i));const E=new DataView(S.buffer,S.byteOffset,S.byteLength),w={view:E,offset:0};let b;const A=d.num_values-d.num_nulls;if(d.encoding==="PLAIN"){const{type_length:T}=n[n.length-1].element;b=jb(w,f,A,T)}else if(d.encoding==="RLE")b=new Array(A),Va(w,1,0,b),b=b.map(T=>!!T);else if(d.encoding==="PLAIN_DICTIONARY"||d.encoding==="RLE_DICTIONARY"){const T=E.getUint8(w.offset++);b=new Array(A),Va(w,T,v-1,b)}else if(d.encoding==="DELTA_BINARY_PACKED")b=f==="INT32"?new Int32Array(A):new BigInt64Array(A),$g(w,A,b);else if(d.encoding==="DELTA_LENGTH_BYTE_ARRAY")b=new Array(A),GG(w,A,b);else if(d.encoding==="DELTA_BYTE_ARRAY")b=new Array(A),JG(w,A,b);else if(d.encoding==="BYTE_STREAM_SPLIT"){const{type_length:T}=n[n.length-1].element;b=AP(l,A,f,T)}else throw new Error(`parquet unsupported encoding: ${d.encoding}`);return{definitionLevels:m,repetitionLevels:g,dataPage:b}}function bJ(t,e,n){const r=yP(n);if(!r)return[];const i=new Array(e.num_values);return Va(t,Ap(r),e.repetition_levels_byte_length,i),i}function SJ(t,e,n){const r=zg(n);if(r){const i=new Array(e.num_values);return Va(t,Ap(r),e.definition_levels_byte_length,i),i}}function ky(t,e){for(let r=0;r{if(!n.ok)throw new Error(`fetch head failed ${n.status}`);const r=n.headers.get("Content-Length");if(!r)throw new Error("missing content length");return parseInt(r)})}async function EJ({url:t,byteLength:e,requestInit:n}){e||(e=await wJ(t,n));let r;const i=n||{};return{byteLength:e,async slice(s,l){if(r)return r.then(g=>g.slice(s,l));const c=new Headers(i.headers),f=l===void 0?"":l-1;c.set("Range",`bytes=${s}-${f}`);const d=await fetch(t,{...i,headers:c});if(!d.ok||!d.body)throw new Error(`fetch failed ${d.status}`);if(d.status===200)return r=d.arrayBuffer(),r.then(g=>g.slice(s,l));if(d.status===206)return d.arrayBuffer();throw new Error(`fetch received unexpected status code ${d.status}`)}}}function TJ(t,e,n,r,{compressors:i,utf8:s}){const{element:l}=r[r.length-1];let c;const f=[],d=e!==void 0&&e>=0&&isFinite(e);for(;(!d||f.length=t.view.byteLength-1);){const g=AJ(t),m=new Uint8Array(t.view.buffer,t.view.byteOffset+t.offset,g.compressed_page_size);let v;if(g.type==="DATA_PAGE"){const S=g.data_page_header;if(!S)throw new Error("parquet data page header is undefined");const E=Fy(m,Number(g.uncompressed_page_size),n.codec,i),{definitionLevels:w,repetitionLevels:b,dataPage:A}=pJ(E,S,r,n);if(v=YC(A,c,l,S.encoding,s),b.length||w!=null&&w.length){const T=zg(r),C=r.map(({element:M})=>M.repetition_type);JC(f,w,b,v,C,T)}else{for(let T=2;T[C]));ky(f,v)}}else if(g.type==="DATA_PAGE_V2"){const S=g.data_page_header_v2;if(!S)throw new Error("parquet data page header v2 is undefined");const{definitionLevels:E,repetitionLevels:w,dataPage:b}=yJ(m,g,r,n,i);if(v=YC(b,c,l,S.encoding,s),w.length||E!=null&&E.length){const A=zg(r),T=r.map(({element:C})=>C.repetition_type);JC(f,E,w,v,T,A)}else ky(f,v)}else if(g.type==="DICTIONARY_PAGE"){const S=g.dictionary_page_header;if(!S)throw new Error("parquet dictionary page header is undefined");const E=Fy(m,Number(g.uncompressed_page_size),n.codec,i);c=mJ(E,S,n,l.type_length)}else throw new Error(`parquet unsupported page type: ${g.type}`);t.offset+=g.compressed_page_size}if(d){if(f.lengthe&&(f.length=e)}return f}function eR({dictionary_page_offset:t,data_page_offset:e,total_compressed_size:n}){let r=t;return(!r||e=i&&(r===void 0||le.num_rows)&&(r=Number(e.num_rows));let[c,f]=[i.byteLength,0];if(e.columns.forEach(({meta_data:E})=>{if(!E)throw new Error("parquet column metadata is undefined");if(l&&!l.includes(E.path_in_schema[0]))return;const[w,b]=eR(E).map(Number);c=Math.min(c,w),f=Math.max(f,b)}),c>=f&&(l!=null&&l.length))throw new Error(`parquet columns not found: ${l.join(", ")}`);let d;f-c<=1<<25&&(d=await i.slice(c,f));const g=[],{children:m}=ZC(s.schema,[])[0],v=new Map(m.map(E=>[E.element.name,CP(E)])),S=new Map;for(let E=0;E1<<30){console.warn(`parquet skipping huge column "${w.path_in_schema}" ${C.toLocaleString()} bytes`);continue}let M,x=0;d?(M=Promise.resolve(d),x=A-c):M=Promise.resolve(i.slice(A,T)),g.push(M.then(N=>{var j;const F=ZC(s.schema,w.path_in_schema),L={view:new DataView(N),offset:x};let I=TJ(L,r,w,F,t);const V=w.path_in_schema.join(".");S.set(V,I),I=void 0;const B=v.get(b);if(B!=null&&B.every(X=>S.has(X))&&(tf(S,F[1]),I=S.get(b),!I))throw new Error(`parquet column data not assembled: ${b}`);I&&((j=t.onChunk)==null||j.call(t,{columnName:b,columnData:I,rowStart:n,rowEnd:n+I.length}))}))}if(await Promise.all(g),t.onComplete){const E=new Array(r),w=m.map(T=>T.element.name).filter(T=>!l||l.includes(T)),b=l||w,A=b.map(T=>w.includes(T)?S.get(T):void 0);for(let T=0;T{var N;C[M]=(N=A[x])==null?void 0:N[T]}),E[T]=C}else E[T]=A.map(C=>C==null?void 0:C[T]);return E}return[]}function CP(t,e=[]){if(t.children.length)for(const n of t.children)CP(n,e);else e.push(t.path.join("."));return e}let Wb;await CJ({file:await EJ({url:"./f.parquet"}),onComplete:t=>Wb=t});const tR=Wb.map(t=>({id:t[0],x:t[1],y:t[2]})),xJ=mp().domain([0,10]).range([vg(0),vg(1)]);function MJ(){const[t,e]=_.useState(null),n=t&&Wb.find(s=>s[0]===t.object.id),r=t&&n[3].map((s,l)=>({...tR.find(c=>c.id===s),value:n[4][l]})),i=[new Lf({id:"deckgl-grid",data:tR,getPosition:s=>[s.x,s.y],getFillColor:[100,100,100,100],cellSize:505,extruded:!1,pickable:!0,autoHighlight:!0,highlightColor:[0,255,0],onClick:s=>e(s)}),new Lf({id:"clicked-grid",data:r,getPosition:s=>[s.x,s.y],getFillColor:s=>xJ(Number(s.value)).slice(4,-1).split(", ").map(Number),cellSize:505,extruded:!1})];return ar.jsx(ar.Fragment,{children:ar.jsx(dP,{initialViewState:{longitude:37.028,latitude:55.778,zoom:7},controller:!0,layers:i,getCursor:()=>"crosshair",children:ar.jsx(hP,{mapStyle:"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",hash:!0})})})}const OJ=new YI,RP=new URL(window.location.href);console.log(RP.searchParams.get("page"));E6.createRoot(document.getElementById("root")).render(ar.jsx(_.StrictMode,{children:ar.jsxs(e6,{client:OJ,children:[RP.searchParams.get("page")=="2"?ar.jsx(MJ,{}):ar.jsx(LG,{}),ar.jsx(v6,{initialIsOpen:!1})]})}));export{By as g}; diff --git a/dist/assets/index-CNEkaNgL.js b/dist/assets/index-CNEkaNgL.js deleted file mode 100644 index 44f7ede..0000000 --- a/dist/assets/index-CNEkaNgL.js +++ /dev/null @@ -1,1690 +0,0 @@ -var zN=Object.defineProperty;var zE=t=>{throw TypeError(t)};var $N=(t,e,n)=>e in t?zN(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var M=(t,e,n)=>$N(t,typeof e!="symbol"?e+"":e,n),av=(t,e,n)=>e.has(t)||zE("Cannot "+n);var G=(t,e,n)=>(av(t,e,"read from private field"),n?n.call(t):e.get(t)),St=(t,e,n)=>e.has(t)?zE("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Xe=(t,e,n,r)=>(av(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Wt=(t,e,n)=>(av(t,e,"access private method"),n);var Jd=(t,e,n,r)=>({set _(i){Xe(t,e,i,n)},get _(){return G(t,e,r)}});function VN(t,e){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();function yy(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ov={exports:{}},Du={};/** - * @license React - * react-jsx-runtime.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var $E;function HN(){if($E)return Du;$E=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,i,a){var l=null;if(a!==void 0&&(l=""+a),i.key!==void 0&&(l=""+i.key),"key"in i){a={};for(var u in i)u!=="key"&&(a[u]=i[u])}else a=i;return i=a.ref,{$$typeof:t,type:r,key:l,ref:i!==void 0?i:null,props:a}}return Du.Fragment=e,Du.jsx=n,Du.jsxs=n,Du}var VE;function jN(){return VE||(VE=1,ov.exports=HN()),ov.exports}var Vr=jN(),Uf=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Uo=typeof window>"u"||"Deno"in globalThis;function xi(){}function WN(t,e){return typeof t=="function"?t(e):t}function m0(t){return typeof t=="number"&&t>=0&&t!==1/0}function zA(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Gl(t,e){return typeof t=="function"?t(e):t}function Yi(t,e){return typeof t=="function"?t(e):t}function HE(t,e){const{type:n="all",exact:r,fetchStatus:i,predicate:a,queryKey:l,stale:u}=t;if(l){if(r){if(e.queryHash!==by(l,e.options))return!1}else if(!hf(e.queryKey,l))return!1}if(n!=="all"){const f=e.isActive();if(n==="active"&&!f||n==="inactive"&&f)return!1}return!(typeof u=="boolean"&&e.isStale()!==u||i&&i!==e.state.fetchStatus||a&&!a(e))}function jE(t,e){const{exact:n,status:r,predicate:i,mutationKey:a}=t;if(a){if(!e.options.mutationKey)return!1;if(n){if(df(e.options.mutationKey)!==df(a))return!1}else if(!hf(e.options.mutationKey,a))return!1}return!(r&&e.state.status!==r||i&&!i(e))}function by(t,e){return((e==null?void 0:e.queryKeyHashFn)||df)(t)}function df(t){return JSON.stringify(t,(e,n)=>_0(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function hf(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(n=>!hf(t[n],e[n])):!1}function $A(t,e){if(t===e)return t;const n=WE(t)&&WE(e);if(n||_0(t)&&_0(e)){const r=n?t:Object.keys(t),i=r.length,a=n?e:Object.keys(e),l=a.length,u=n?[]:{};let f=0;for(let h=0;h{setTimeout(e,t)})}function y0(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?$A(t,e):e}function qN(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function YN(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var Sy=Symbol();function VA(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===Sy?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var wo,Ca,sc,OA,KN=(OA=class extends Uf{constructor(){super();St(this,wo);St(this,Ca);St(this,sc);Xe(this,sc,e=>{if(!Uo&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){G(this,Ca)||this.setEventListener(G(this,sc))}onUnsubscribe(){var e;this.hasListeners()||((e=G(this,Ca))==null||e.call(this),Xe(this,Ca,void 0))}setEventListener(e){var n;Xe(this,sc,e),(n=G(this,Ca))==null||n.call(this),Xe(this,Ca,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){G(this,wo)!==e&&(Xe(this,wo,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof G(this,wo)=="boolean"?G(this,wo):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},wo=new WeakMap,Ca=new WeakMap,sc=new WeakMap,OA),Ey=new KN,ac,Aa,oc,PA,ZN=(PA=class extends Uf{constructor(){super();St(this,ac,!0);St(this,Aa);St(this,oc);Xe(this,oc,e=>{if(!Uo&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){G(this,Aa)||this.setEventListener(G(this,oc))}onUnsubscribe(){var e;this.hasListeners()||((e=G(this,Aa))==null||e.call(this),Xe(this,Aa,void 0))}setEventListener(e){var n;Xe(this,oc,e),(n=G(this,Aa))==null||n.call(this),Xe(this,Aa,e(this.setOnline.bind(this)))}setOnline(e){G(this,ac)!==e&&(Xe(this,ac,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return G(this,ac)}},ac=new WeakMap,Aa=new WeakMap,oc=new WeakMap,PA),Lh=new ZN;function b0(){let t,e;const n=new Promise((i,a)=>{t=i,e=a});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),t(i)},n.reject=i=>{r({status:"rejected",reason:i}),e(i)},n}function QN(t){return Math.min(1e3*2**t,3e4)}function HA(t){return(t??"online")==="online"?Lh.isOnline():!0}var jA=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function lv(t){return t instanceof jA}function WA(t){let e=!1,n=0,r=!1,i;const a=b0(),l=E=>{var b;r||(v(new jA(E)),(b=t.abort)==null||b.call(t))},u=()=>{e=!0},f=()=>{e=!1},h=()=>Ey.isFocused()&&(t.networkMode==="always"||Lh.isOnline())&&t.canRun(),g=()=>HA(t.networkMode)&&t.canRun(),m=E=>{var b;r||(r=!0,(b=t.onSuccess)==null||b.call(t,E),i==null||i(),a.resolve(E))},v=E=>{var b;r||(r=!0,(b=t.onError)==null||b.call(t,E),i==null||i(),a.reject(E))},S=()=>new Promise(E=>{var b;i=C=>{(r||h())&&E(C)},(b=t.onPause)==null||b.call(t)}).then(()=>{var E;i=void 0,r||(E=t.onContinue)==null||E.call(t)}),w=()=>{if(r)return;let E;const b=n===0?t.initialPromise:void 0;try{E=b??t.fn()}catch(C){E=Promise.reject(C)}Promise.resolve(E).then(m).catch(C=>{var N;if(r)return;const T=t.retry??(Uo?0:3),A=t.retryDelay??QN,O=typeof A=="function"?A(n,C):A,x=T===!0||typeof T=="number"&&nh()?void 0:S()).then(()=>{e?v(C):w()})})};return{promise:a,cancel:l,continue:()=>(i==null||i(),a),cancelRetry:u,continueRetry:f,canStart:g,start:()=>(g()?w():S().then(w),a)}}function GN(){let t=[],e=0,n=u=>{u()},r=u=>{u()},i=u=>setTimeout(u,0);const a=u=>{e?t.push(u):i(()=>{n(u)})},l=()=>{const u=t;t=[],u.length&&i(()=>{r(()=>{u.forEach(f=>{n(f)})})})};return{batch:u=>{let f;e++;try{f=u()}finally{e--,e||l()}return f},batchCalls:u=>(...f)=>{a(()=>{u(...f)})},schedule:a,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{r=u},setScheduler:u=>{i=u}}}var Rr=GN(),To,NA,XA=(NA=class{constructor(){St(this,To)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),m0(this.gcTime)&&Xe(this,To,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Uo?1/0:5*60*1e3))}clearGcTimeout(){G(this,To)&&(clearTimeout(G(this,To)),Xe(this,To,void 0))}},To=new WeakMap,NA),lc,cc,Ri,Co,Dr,Df,Ao,ji,zs,IA,JN=(IA=class extends XA{constructor(e){super();St(this,ji);St(this,lc);St(this,cc);St(this,Ri);St(this,Co);St(this,Dr);St(this,Df);St(this,Ao);Xe(this,Ao,!1),Xe(this,Df,e.defaultOptions),this.setOptions(e.options),this.observers=[],Xe(this,Co,e.client),Xe(this,Ri,G(this,Co).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Xe(this,lc,eI(this.options)),this.state=e.state??G(this,lc),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=G(this,Dr))==null?void 0:e.promise}setOptions(e){this.options={...G(this,Df),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&G(this,Ri).remove(this)}setData(e,n){const r=y0(this.state.data,e,this.options);return Wt(this,ji,zs).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){Wt(this,ji,zs).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var r,i;const n=(r=G(this,Dr))==null?void 0:r.promise;return(i=G(this,Dr))==null||i.cancel(e),n?n.then(xi).catch(xi):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(G(this,lc))}isActive(){return this.observers.some(e=>Yi(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Sy||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!zA(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=G(this,Dr))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=G(this,Dr))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),G(this,Ri).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(G(this,Dr)&&(G(this,Ao)?G(this,Dr).cancel({revert:!0}):G(this,Dr).cancelRetry()),this.scheduleGc()),G(this,Ri).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Wt(this,ji,zs).call(this,{type:"invalidate"})}fetch(e,n){var f,h,g;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(G(this,Dr))return G(this,Dr).continueRetry(),G(this,Dr).promise}if(e&&this.setOptions(e),!this.options.queryFn){const m=this.observers.find(v=>v.options.queryFn);m&&this.setOptions(m.options)}const r=new AbortController,i=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(Xe(this,Ao,!0),r.signal)})},a=()=>{const m=VA(this.options,n),v={client:G(this,Co),queryKey:this.queryKey,meta:this.meta};return i(v),Xe(this,Ao,!1),this.options.persister?this.options.persister(m,v,this):m(v)},l={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:G(this,Co),state:this.state,fetchFn:a};i(l),(f=this.options.behavior)==null||f.onFetch(l,this),Xe(this,cc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=l.fetchOptions)==null?void 0:h.meta))&&Wt(this,ji,zs).call(this,{type:"fetch",meta:(g=l.fetchOptions)==null?void 0:g.meta});const u=m=>{var v,S,w,E;lv(m)&&m.silent||Wt(this,ji,zs).call(this,{type:"error",error:m}),lv(m)||((S=(v=G(this,Ri).config).onError)==null||S.call(v,m,this),(E=(w=G(this,Ri).config).onSettled)==null||E.call(w,this.state.data,m,this)),this.scheduleGc()};return Xe(this,Dr,WA({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,abort:r.abort.bind(r),onSuccess:m=>{var v,S,w,E;if(m===void 0){u(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(m)}catch(b){u(b);return}(S=(v=G(this,Ri).config).onSuccess)==null||S.call(v,m,this),(E=(w=G(this,Ri).config).onSettled)==null||E.call(w,m,this.state.error,this),this.scheduleGc()},onError:u,onFail:(m,v)=>{Wt(this,ji,zs).call(this,{type:"failed",failureCount:m,error:v})},onPause:()=>{Wt(this,ji,zs).call(this,{type:"pause"})},onContinue:()=>{Wt(this,ji,zs).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0})),G(this,Dr).start()}},lc=new WeakMap,cc=new WeakMap,Ri=new WeakMap,Co=new WeakMap,Dr=new WeakMap,Df=new WeakMap,Ao=new WeakMap,ji=new WeakSet,zs=function(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...qA(r.data,this.options),fetchMeta:e.meta??null};case"success":return{...r,data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=e.error;return lv(i)&&i.revert&&G(this,cc)?{...G(this,cc),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),Rr.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),G(this,Ri).notify({query:this,type:"updated",action:e})})},IA);function qA(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:HA(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function eI(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var fs,DA,tI=(DA=class extends Uf{constructor(e={}){super();St(this,fs);this.config=e,Xe(this,fs,new Map)}build(e,n,r){const i=n.queryKey,a=n.queryHash??by(i,n);let l=this.get(a);return l||(l=new JN({client:e,queryKey:i,queryHash:a,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(l)),l}add(e){G(this,fs).has(e.queryHash)||(G(this,fs).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=G(this,fs).get(e.queryHash);n&&(e.destroy(),n===e&&G(this,fs).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Rr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return G(this,fs).get(e)}getAll(){return[...G(this,fs).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>HE(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>HE(e,r)):n}notify(e){Rr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Rr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Rr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},fs=new WeakMap,DA),ds,zr,Ro,hs,ba,FA,nI=(FA=class extends XA{constructor(e){super();St(this,hs);St(this,ds);St(this,zr);St(this,Ro);this.mutationId=e.mutationId,Xe(this,zr,e.mutationCache),Xe(this,ds,[]),this.state=e.state||rI(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){G(this,ds).includes(e)||(G(this,ds).push(e),this.clearGcTimeout(),G(this,zr).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Xe(this,ds,G(this,ds).filter(n=>n!==e)),this.scheduleGc(),G(this,zr).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){G(this,ds).length||(this.state.status==="pending"?this.scheduleGc():G(this,zr).remove(this))}continue(){var e;return((e=G(this,Ro))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var i,a,l,u,f,h,g,m,v,S,w,E,b,C,T,A,O,x,N,F;Xe(this,Ro,WA({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(L,D)=>{Wt(this,hs,ba).call(this,{type:"failed",failureCount:L,error:D})},onPause:()=>{Wt(this,hs,ba).call(this,{type:"pause"})},onContinue:()=>{Wt(this,hs,ba).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>G(this,zr).canRun(this)}));const n=this.state.status==="pending",r=!G(this,Ro).canStart();try{if(!n){Wt(this,hs,ba).call(this,{type:"pending",variables:e,isPaused:r}),await((a=(i=G(this,zr).config).onMutate)==null?void 0:a.call(i,e,this));const D=await((u=(l=this.options).onMutate)==null?void 0:u.call(l,e));D!==this.state.context&&Wt(this,hs,ba).call(this,{type:"pending",context:D,variables:e,isPaused:r})}const L=await G(this,Ro).start();return await((h=(f=G(this,zr).config).onSuccess)==null?void 0:h.call(f,L,e,this.state.context,this)),await((m=(g=this.options).onSuccess)==null?void 0:m.call(g,L,e,this.state.context)),await((S=(v=G(this,zr).config).onSettled)==null?void 0:S.call(v,L,null,this.state.variables,this.state.context,this)),await((E=(w=this.options).onSettled)==null?void 0:E.call(w,L,null,e,this.state.context)),Wt(this,hs,ba).call(this,{type:"success",data:L}),L}catch(L){try{throw await((C=(b=G(this,zr).config).onError)==null?void 0:C.call(b,L,e,this.state.context,this)),await((A=(T=this.options).onError)==null?void 0:A.call(T,L,e,this.state.context)),await((x=(O=G(this,zr).config).onSettled)==null?void 0:x.call(O,void 0,L,this.state.variables,this.state.context,this)),await((F=(N=this.options).onSettled)==null?void 0:F.call(N,void 0,L,e,this.state.context)),L}finally{Wt(this,hs,ba).call(this,{type:"error",error:L})}}finally{G(this,zr).runNext(this)}}},ds=new WeakMap,zr=new WeakMap,Ro=new WeakMap,hs=new WeakSet,ba=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Rr.batch(()=>{G(this,ds).forEach(r=>{r.onMutationUpdate(e)}),G(this,zr).notify({mutation:this,type:"updated",action:e})})},FA);function rI(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var $s,Wi,Ff,kA,iI=(kA=class extends Uf{constructor(e={}){super();St(this,$s);St(this,Wi);St(this,Ff);this.config=e,Xe(this,$s,new Set),Xe(this,Wi,new Map),Xe(this,Ff,0)}build(e,n,r){const i=new nI({mutationCache:this,mutationId:++Jd(this,Ff)._,options:e.defaultMutationOptions(n),state:r});return this.add(i),i}add(e){G(this,$s).add(e);const n=eh(e);if(typeof n=="string"){const r=G(this,Wi).get(n);r?r.push(e):G(this,Wi).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(G(this,$s).delete(e)){const n=eh(e);if(typeof n=="string"){const r=G(this,Wi).get(n);if(r)if(r.length>1){const i=r.indexOf(e);i!==-1&&r.splice(i,1)}else r[0]===e&&G(this,Wi).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=eh(e);if(typeof n=="string"){const r=G(this,Wi).get(n),i=r==null?void 0:r.find(a=>a.state.status==="pending");return!i||i===e}else return!0}runNext(e){var r;const n=eh(e);if(typeof n=="string"){const i=(r=G(this,Wi).get(n))==null?void 0:r.find(a=>a!==e&&a.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Rr.batch(()=>{G(this,$s).forEach(e=>{this.notify({type:"removed",mutation:e})}),G(this,$s).clear(),G(this,Wi).clear()})}getAll(){return Array.from(G(this,$s))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>jE(n,r))}findAll(e={}){return this.getAll().filter(n=>jE(e,n))}notify(e){Rr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Rr.batch(()=>Promise.all(e.map(n=>n.continue().catch(xi))))}},$s=new WeakMap,Wi=new WeakMap,Ff=new WeakMap,kA);function eh(t){var e;return(e=t.options.scope)==null?void 0:e.id}function qE(t){return{onFetch:(e,n)=>{var g,m,v,S,w;const r=e.options,i=(v=(m=(g=e.fetchOptions)==null?void 0:g.meta)==null?void 0:m.fetchMore)==null?void 0:v.direction,a=((S=e.state.data)==null?void 0:S.pages)||[],l=((w=e.state.data)==null?void 0:w.pageParams)||[];let u={pages:[],pageParams:[]},f=0;const h=async()=>{let E=!1;const b=A=>{Object.defineProperty(A,"signal",{enumerable:!0,get:()=>(e.signal.aborted?E=!0:e.signal.addEventListener("abort",()=>{E=!0}),e.signal)})},C=VA(e.options,e.fetchOptions),T=async(A,O,x)=>{if(E)return Promise.reject();if(O==null&&A.pages.length)return Promise.resolve(A);const N={client:e.client,queryKey:e.queryKey,pageParam:O,direction:x?"backward":"forward",meta:e.options.meta};b(N);const F=await C(N),{maxPages:L}=e.options,D=x?YN:qN;return{pages:D(A.pages,F,L),pageParams:D(A.pageParams,O,L)}};if(i&&a.length){const A=i==="backward",O=A?sI:YE,x={pages:a,pageParams:l},N=O(r,x);u=await T(x,N,A)}else{const A=t??a.length;do{const O=f===0?l[0]??r.initialPageParam:YE(r,u);if(f>0&&O==null)break;u=await T(u,O),f++}while(f{var E,b;return(b=(E=e.options).persister)==null?void 0:b.call(E,h,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=h}}}function YE(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function sI(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}var Yn,Ra,xa,uc,fc,Ma,dc,hc,BA,aI=(BA=class{constructor(t={}){St(this,Yn);St(this,Ra);St(this,xa);St(this,uc);St(this,fc);St(this,Ma);St(this,dc);St(this,hc);Xe(this,Yn,t.queryCache||new tI),Xe(this,Ra,t.mutationCache||new iI),Xe(this,xa,t.defaultOptions||{}),Xe(this,uc,new Map),Xe(this,fc,new Map),Xe(this,Ma,0)}mount(){Jd(this,Ma)._++,G(this,Ma)===1&&(Xe(this,dc,Ey.subscribe(async t=>{t&&(await this.resumePausedMutations(),G(this,Yn).onFocus())})),Xe(this,hc,Lh.subscribe(async t=>{t&&(await this.resumePausedMutations(),G(this,Yn).onOnline())})))}unmount(){var t,e;Jd(this,Ma)._--,G(this,Ma)===0&&((t=G(this,dc))==null||t.call(this),Xe(this,dc,void 0),(e=G(this,hc))==null||e.call(this),Xe(this,hc,void 0))}isFetching(t){return G(this,Yn).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return G(this,Ra).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=G(this,Yn).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=G(this,Yn).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(Gl(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return G(this,Yn).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),i=G(this,Yn).get(r.queryHash),a=i==null?void 0:i.state.data,l=WN(e,a);if(l!==void 0)return G(this,Yn).build(this,r).setData(l,{...n,manual:!0})}setQueriesData(t,e,n){return Rr.batch(()=>G(this,Yn).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=G(this,Yn).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=G(this,Yn);Rr.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=G(this,Yn),r={type:"active",...t};return Rr.batch(()=>(n.findAll(t).forEach(i=>{i.reset()}),this.refetchQueries(r,e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=Rr.batch(()=>G(this,Yn).findAll(t).map(i=>i.cancel(n)));return Promise.all(r).then(xi).catch(xi)}invalidateQueries(t,e={}){return Rr.batch(()=>{if(G(this,Yn).findAll(t).forEach(r=>{r.invalidate()}),(t==null?void 0:t.refetchType)==="none")return Promise.resolve();const n={...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"};return this.refetchQueries(n,e)})}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=Rr.batch(()=>G(this,Yn).findAll(t).filter(i=>!i.isDisabled()).map(i=>{let a=i.fetch(void 0,n);return n.throwOnError||(a=a.catch(xi)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(xi)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=G(this,Yn).build(this,e);return n.isStaleByTime(Gl(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(xi).catch(xi)}fetchInfiniteQuery(t){return t.behavior=qE(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(xi).catch(xi)}ensureInfiniteQueryData(t){return t.behavior=qE(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Lh.isOnline()?G(this,Ra).resumePausedMutations():Promise.resolve()}getQueryCache(){return G(this,Yn)}getMutationCache(){return G(this,Ra)}getDefaultOptions(){return G(this,xa)}setDefaultOptions(t){Xe(this,xa,t)}setQueryDefaults(t,e){G(this,uc).set(df(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...G(this,uc).values()],n={};return e.forEach(r=>{hf(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){G(this,fc).set(df(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...G(this,fc).values()];let n={};return e.forEach(r=>{hf(t,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...G(this,xa).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=by(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===Sy&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...G(this,xa).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){G(this,Yn).clear(),G(this,Ra).clear()}},Yn=new WeakMap,Ra=new WeakMap,xa=new WeakMap,uc=new WeakMap,fc=new WeakMap,Ma=new WeakMap,dc=new WeakMap,hc=new WeakMap,BA),Yr,Xt,kf,$r,xo,gc,Oa,gs,Bf,pc,mc,Mo,Oo,Pa,vc,on,Wu,S0,E0,w0,T0,C0,A0,R0,YA,UA,oI=(UA=class extends Uf{constructor(e,n){super();St(this,on);St(this,Yr);St(this,Xt);St(this,kf);St(this,$r);St(this,xo);St(this,gc);St(this,Oa);St(this,gs);St(this,Bf);St(this,pc);St(this,mc);St(this,Mo);St(this,Oo);St(this,Pa);St(this,vc,new Set);this.options=n,Xe(this,Yr,e),Xe(this,gs,null),Xe(this,Oa,b0()),this.options.experimental_prefetchInRender||G(this,Oa).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(G(this,Xt).addObserver(this),KE(G(this,Xt),this.options)?Wt(this,on,Wu).call(this):this.updateResult(),Wt(this,on,T0).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return x0(G(this,Xt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return x0(G(this,Xt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Wt(this,on,C0).call(this),Wt(this,on,A0).call(this),G(this,Xt).removeObserver(this)}setOptions(e,n){const r=this.options,i=G(this,Xt);if(this.options=G(this,Yr).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Yi(this.options.enabled,G(this,Xt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Wt(this,on,R0).call(this),G(this,Xt).setOptions(this.options),r._defaulted&&!v0(this.options,r)&&G(this,Yr).getQueryCache().notify({type:"observerOptionsUpdated",query:G(this,Xt),observer:this});const a=this.hasListeners();a&&ZE(G(this,Xt),i,this.options,r)&&Wt(this,on,Wu).call(this),this.updateResult(n),a&&(G(this,Xt)!==i||Yi(this.options.enabled,G(this,Xt))!==Yi(r.enabled,G(this,Xt))||Gl(this.options.staleTime,G(this,Xt))!==Gl(r.staleTime,G(this,Xt)))&&Wt(this,on,S0).call(this);const l=Wt(this,on,E0).call(this);a&&(G(this,Xt)!==i||Yi(this.options.enabled,G(this,Xt))!==Yi(r.enabled,G(this,Xt))||l!==G(this,Pa))&&Wt(this,on,w0).call(this,l)}getOptimisticResult(e){const n=G(this,Yr).getQueryCache().build(G(this,Yr),e),r=this.createResult(n,e);return cI(this,r)&&(Xe(this,$r,r),Xe(this,gc,this.options),Xe(this,xo,G(this,Xt).state)),r}getCurrentResult(){return G(this,$r)}trackResult(e,n){const r={};return Object.keys(e).forEach(i=>{Object.defineProperty(r,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),n==null||n(i),e[i])})}),r}trackProp(e){G(this,vc).add(e)}getCurrentQuery(){return G(this,Xt)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=G(this,Yr).defaultQueryOptions(e),r=G(this,Yr).getQueryCache().build(G(this,Yr),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(e){return Wt(this,on,Wu).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),G(this,$r)))}createResult(e,n){var L;const r=G(this,Xt),i=this.options,a=G(this,$r),l=G(this,xo),u=G(this,gc),h=e!==r?e.state:G(this,kf),{state:g}=e;let m={...g},v=!1,S;if(n._optimisticResults){const D=this.hasListeners(),V=!D&&KE(e,n),B=D&&ZE(e,r,n,i);(V||B)&&(m={...m,...qA(g.data,e.options)}),n._optimisticResults==="isRestoring"&&(m.fetchStatus="idle")}let{error:w,errorUpdatedAt:E,status:b}=m;if(n.select&&m.data!==void 0)if(a&&m.data===(l==null?void 0:l.data)&&n.select===G(this,Bf))S=G(this,pc);else try{Xe(this,Bf,n.select),S=n.select(m.data),S=y0(a==null?void 0:a.data,S,n),Xe(this,pc,S),Xe(this,gs,null)}catch(D){Xe(this,gs,D)}else S=m.data;if(n.placeholderData!==void 0&&S===void 0&&b==="pending"){let D;if(a!=null&&a.isPlaceholderData&&n.placeholderData===(u==null?void 0:u.placeholderData))D=a.data;else if(D=typeof n.placeholderData=="function"?n.placeholderData((L=G(this,mc))==null?void 0:L.state.data,G(this,mc)):n.placeholderData,n.select&&D!==void 0)try{D=n.select(D),Xe(this,gs,null)}catch(V){Xe(this,gs,V)}D!==void 0&&(b="success",S=y0(a==null?void 0:a.data,D,n),v=!0)}G(this,gs)&&(w=G(this,gs),S=G(this,pc),E=Date.now(),b="error");const C=m.fetchStatus==="fetching",T=b==="pending",A=b==="error",O=T&&C,x=S!==void 0,F={status:b,fetchStatus:m.fetchStatus,isPending:T,isSuccess:b==="success",isError:A,isInitialLoading:O,isLoading:O,data:S,dataUpdatedAt:m.dataUpdatedAt,error:w,errorUpdatedAt:E,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:m.dataUpdateCount>0||m.errorUpdateCount>0,isFetchedAfterMount:m.dataUpdateCount>h.dataUpdateCount||m.errorUpdateCount>h.errorUpdateCount,isFetching:C,isRefetching:C&&!T,isLoadingError:A&&!x,isPaused:m.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:A&&x,isStale:wy(e,n),refetch:this.refetch,promise:G(this,Oa)};if(this.options.experimental_prefetchInRender){const D=W=>{F.status==="error"?W.reject(F.error):F.data!==void 0&&W.resolve(F.data)},V=()=>{const W=Xe(this,Oa,F.promise=b0());D(W)},B=G(this,Oa);switch(B.status){case"pending":e.queryHash===r.queryHash&&D(B);break;case"fulfilled":(F.status==="error"||F.data!==B.value)&&V();break;case"rejected":(F.status!=="error"||F.error!==B.reason)&&V();break}}return F}updateResult(e){const n=G(this,$r),r=this.createResult(G(this,Xt),this.options);if(Xe(this,xo,G(this,Xt).state),Xe(this,gc,this.options),G(this,xo).data!==void 0&&Xe(this,mc,G(this,Xt)),v0(r,n))return;Xe(this,$r,r);const i={},a=()=>{if(!n)return!0;const{notifyOnChangeProps:l}=this.options,u=typeof l=="function"?l():l;if(u==="all"||!u&&!G(this,vc).size)return!0;const f=new Set(u??G(this,vc));return this.options.throwOnError&&f.add("error"),Object.keys(G(this,$r)).some(h=>{const g=h;return G(this,$r)[g]!==n[g]&&f.has(g)})};(e==null?void 0:e.listeners)!==!1&&a()&&(i.listeners=!0),Wt(this,on,YA).call(this,{...i,...e})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Wt(this,on,T0).call(this)}},Yr=new WeakMap,Xt=new WeakMap,kf=new WeakMap,$r=new WeakMap,xo=new WeakMap,gc=new WeakMap,Oa=new WeakMap,gs=new WeakMap,Bf=new WeakMap,pc=new WeakMap,mc=new WeakMap,Mo=new WeakMap,Oo=new WeakMap,Pa=new WeakMap,vc=new WeakMap,on=new WeakSet,Wu=function(e){Wt(this,on,R0).call(this);let n=G(this,Xt).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(xi)),n},S0=function(){Wt(this,on,C0).call(this);const e=Gl(this.options.staleTime,G(this,Xt));if(Uo||G(this,$r).isStale||!m0(e))return;const r=zA(G(this,$r).dataUpdatedAt,e)+1;Xe(this,Mo,setTimeout(()=>{G(this,$r).isStale||this.updateResult()},r))},E0=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(G(this,Xt)):this.options.refetchInterval)??!1},w0=function(e){Wt(this,on,A0).call(this),Xe(this,Pa,e),!(Uo||Yi(this.options.enabled,G(this,Xt))===!1||!m0(G(this,Pa))||G(this,Pa)===0)&&Xe(this,Oo,setInterval(()=>{(this.options.refetchIntervalInBackground||Ey.isFocused())&&Wt(this,on,Wu).call(this)},G(this,Pa)))},T0=function(){Wt(this,on,S0).call(this),Wt(this,on,w0).call(this,Wt(this,on,E0).call(this))},C0=function(){G(this,Mo)&&(clearTimeout(G(this,Mo)),Xe(this,Mo,void 0))},A0=function(){G(this,Oo)&&(clearInterval(G(this,Oo)),Xe(this,Oo,void 0))},R0=function(){const e=G(this,Yr).getQueryCache().build(G(this,Yr),this.options);if(e===G(this,Xt))return;const n=G(this,Xt);Xe(this,Xt,e),Xe(this,kf,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},YA=function(e){Rr.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(G(this,$r))}),G(this,Yr).getQueryCache().notify({query:G(this,Xt),type:"observerResultsUpdated"})})},UA);function lI(t,e){return Yi(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function KE(t,e){return lI(t,e)||t.state.data!==void 0&&x0(t,e,e.refetchOnMount)}function x0(t,e,n){if(Yi(e.enabled,t)!==!1){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&wy(t,e)}return!1}function ZE(t,e,n,r){return(t!==e||Yi(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&wy(t,n)}function wy(t,e){return Yi(e.enabled,t)!==!1&&t.isStaleByTime(Gl(e.staleTime,t))}function cI(t,e){return!v0(t.getCurrentResult(),e)}var cv={exports:{}},At={};/** - * @license React - * react.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var QE;function uI(){if(QE)return At;QE=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),m=Symbol.iterator;function v(P){return P===null||typeof P!="object"?null:(P=m&&P[m]||P["@@iterator"],typeof P=="function"?P:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,E={};function b(P,$,ie){this.props=P,this.context=$,this.refs=E,this.updater=ie||S}b.prototype.isReactComponent={},b.prototype.setState=function(P,$){if(typeof P!="object"&&typeof P!="function"&&P!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,P,$,"setState")},b.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function C(){}C.prototype=b.prototype;function T(P,$,ie){this.props=P,this.context=$,this.refs=E,this.updater=ie||S}var A=T.prototype=new C;A.constructor=T,w(A,b.prototype),A.isPureReactComponent=!0;var O=Array.isArray,x={H:null,A:null,T:null,S:null},N=Object.prototype.hasOwnProperty;function F(P,$,ie,se,q,ce){return ie=ce.ref,{$$typeof:t,type:P,key:$,ref:ie!==void 0?ie:null,props:ce}}function L(P,$){return F(P.type,$,void 0,void 0,void 0,P.props)}function D(P){return typeof P=="object"&&P!==null&&P.$$typeof===t}function V(P){var $={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(ie){return $[ie]})}var B=/\/+/g;function W(P,$){return typeof P=="object"&&P!==null&&P.key!=null?V(""+P.key):$.toString(36)}function X(){}function Y(P){switch(P.status){case"fulfilled":return P.value;case"rejected":throw P.reason;default:switch(typeof P.status=="string"?P.then(X,X):(P.status="pending",P.then(function($){P.status==="pending"&&(P.status="fulfilled",P.value=$)},function($){P.status==="pending"&&(P.status="rejected",P.reason=$)})),P.status){case"fulfilled":return P.value;case"rejected":throw P.reason}}throw P}function ae(P,$,ie,se,q){var ce=typeof P;(ce==="undefined"||ce==="boolean")&&(P=null);var fe=!1;if(P===null)fe=!0;else switch(ce){case"bigint":case"string":case"number":fe=!0;break;case"object":switch(P.$$typeof){case t:case e:fe=!0;break;case g:return fe=P._init,ae(fe(P._payload),$,ie,se,q)}}if(fe)return q=q(P),fe=se===""?"."+W(P,0):se,O(q)?(ie="",fe!=null&&(ie=fe.replace(B,"$&/")+"/"),ae(q,$,ie,"",function(Ce){return Ce})):q!=null&&(D(q)&&(q=L(q,ie+(q.key==null||P&&P.key===q.key?"":(""+q.key).replace(B,"$&/")+"/")+fe)),$.push(q)),1;fe=0;var ye=se===""?".":se+":";if(O(P))for(var Ee=0;Ee{const e=_.useContext(KA);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},dI=({client:t,children:e})=>(_.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),Vr.jsx(KA.Provider,{value:t,children:e})),ZA=_.createContext(!1),hI=()=>_.useContext(ZA);ZA.Provider;function gI(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var pI=_.createContext(gI()),mI=()=>_.useContext(pI);function vI(t,e){return typeof t=="function"?t(...e):!!t}function JE(){}var _I=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},yI=t=>{_.useEffect(()=>{t.clearReset()},[t])},bI=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:i})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(i&&t.data===void 0||vI(n,[t.error,r])),SI=t=>{const e=t.staleTime;t.suspense&&(t.staleTime=typeof e=="function"?(...n)=>Math.max(e(...n),1e3):Math.max(e??1e3,1e3),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3)))},EI=(t,e)=>t.isLoading&&t.isFetching&&!e,wI=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,ew=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function TI(t,e,n){var m,v,S,w,E;const r=fI(),i=hI(),a=mI(),l=r.defaultQueryOptions(t);(v=(m=r.getDefaultOptions().queries)==null?void 0:m._experimental_beforeQuery)==null||v.call(m,l),l._optimisticResults=i?"isRestoring":"optimistic",SI(l),_I(l,a),yI(a);const u=!r.getQueryCache().get(l.queryHash),[f]=_.useState(()=>new e(r,l)),h=f.getOptimisticResult(l),g=!i&&t.subscribed!==!1;if(_.useSyncExternalStore(_.useCallback(b=>{const C=g?f.subscribe(Rr.batchCalls(b)):JE;return f.updateResult(),C},[f,g]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),_.useEffect(()=>{f.setOptions(l,{listeners:!1})},[l,f]),wI(l,h))throw ew(l,f,a);if(bI({result:h,errorResetBoundary:a,throwOnError:l.throwOnError,query:r.getQueryCache().get(l.queryHash),suspense:l.suspense}))throw h.error;if((w=(S=r.getDefaultOptions().queries)==null?void 0:S._experimental_afterQuery)==null||w.call(S,l,h),l.experimental_prefetchInRender&&!Uo&&EI(h,i)){const b=u?ew(l,f,a):(E=r.getQueryCache().get(l.queryHash))==null?void 0:E.promise;b==null||b.catch(JE).finally(()=>{f.updateResult()})}return l.notifyOnChangeProps?h:f.trackResult(h)}function CI(t,e){return TI(t,oI)}const AI="modulepreload",RI=function(t){return"/"+t},tw={},xI=function(e,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),u=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));i=Promise.allSettled(n.map(f=>{if(f=RI(f),f in tw)return;tw[f]=!0;const h=f.endsWith(".css"),g=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${g}`))return;const m=document.createElement("link");if(m.rel=h?"stylesheet":AI,h||(m.as="script"),m.crossOrigin="",m.href=f,u&&m.setAttribute("nonce",u),document.head.appendChild(m),h)return new Promise((v,S)=>{m.addEventListener("load",v),m.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${f}`)))})}))}function a(l){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=l,window.dispatchEvent(u),!u.defaultPrevented)throw l}return i.then(l=>{for(const u of l||[])u.status==="rejected"&&a(u.reason);return e().catch(a)})};var MI=function(){return null},uv={exports:{}},Fu={},fv={exports:{}},dv={};/** - * @license React - * scheduler.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var nw;function OI(){return nw||(nw=1,function(t){function e(U,z){var j=U.length;U.push(z);e:for(;0>>1,P=U[Z];if(0>>1;Z<$;){var ie=2*(Z+1)-1,se=U[ie],q=ie+1,ce=U[q];if(0>i(se,j))qi(ce,se)?(U[Z]=ce,U[q]=j,Z=q):(U[Z]=se,U[ie]=j,Z=ie);else if(qi(ce,j))U[Z]=ce,U[q]=j,Z=q;else break e}}return z}function i(U,z){var j=U.sortIndex-z.sortIndex;return j!==0?j:U.id-z.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;t.unstable_now=function(){return a.now()}}else{var l=Date,u=l.now();t.unstable_now=function(){return l.now()-u}}var f=[],h=[],g=1,m=null,v=3,S=!1,w=!1,E=!1,b=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function A(U){for(var z=n(h);z!==null;){if(z.callback===null)r(h);else if(z.startTime<=U)r(h),z.sortIndex=z.expirationTime,e(f,z);else break;z=n(h)}}function O(U){if(E=!1,A(U),!w)if(n(f)!==null)w=!0,Y();else{var z=n(h);z!==null&&ae(O,z.startTime-U)}}var x=!1,N=-1,F=5,L=-1;function D(){return!(t.unstable_now()-LU&&D());){var Z=m.callback;if(typeof Z=="function"){m.callback=null,v=m.priorityLevel;var P=Z(m.expirationTime<=U);if(U=t.unstable_now(),typeof P=="function"){m.callback=P,A(U),z=!0;break t}m===n(f)&&r(f),A(U)}else r(f);m=n(f)}if(m!==null)z=!0;else{var $=n(h);$!==null&&ae(O,$.startTime-U),z=!1}}break e}finally{m=null,v=j,S=!1}z=void 0}}finally{z?B():x=!1}}}var B;if(typeof T=="function")B=function(){T(V)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,X=W.port2;W.port1.onmessage=V,B=function(){X.postMessage(null)}}else B=function(){b(V,0)};function Y(){x||(x=!0,B())}function ae(U,z){N=b(function(){U(t.unstable_now())},z)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(U){U.callback=null},t.unstable_continueExecution=function(){w||S||(w=!0,Y())},t.unstable_forceFrameRate=function(U){0>U||125Z?(U.sortIndex=j,e(h,U),n(f)===null&&U===n(h)&&(E?(C(N),N=-1):E=!0,ae(O,j-Z))):(U.sortIndex=P,e(f,U),w||S||(w=!0,Y())),U},t.unstable_shouldYield=D,t.unstable_wrapCallback=function(U){var z=v;return function(){var j=v;v=z;try{return U.apply(this,arguments)}finally{v=j}}}}(dv)),dv}var rw;function PI(){return rw||(rw=1,fv.exports=OI()),fv.exports}var hv={exports:{}},Nr={};/** - * @license React - * react-dom.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var iw;function NI(){if(iw)return Nr;iw=1;var t=Ty();function e(f){var h="https://react.dev/errors/"+f;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),hv.exports=NI(),hv.exports}/** - * @license React - * react-dom-client.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var aw;function II(){if(aw)return Fu;aw=1;var t=PI(),e=Ty(),n=QA();function r(s){var o="https://react.dev/errors/"+s;if(1)":-1p||H[d]!==ee[p]){var pe=` -`+H[d].replace(" at new "," at ");return s.displayName&&pe.includes("")&&(pe=pe.replace("",s.displayName)),pe}while(1<=d&&0<=p);break}}}finally{Y=!1,Error.prepareStackTrace=c}return(c=s?s.displayName||s.name:"")?X(c):""}function U(s){switch(s.tag){case 26:case 27:case 5:return X(s.type);case 16:return X("Lazy");case 13:return X("Suspense");case 19:return X("SuspenseList");case 0:case 15:return s=ae(s.type,!1),s;case 11:return s=ae(s.type.render,!1),s;case 1:return s=ae(s.type,!0),s;default:return""}}function z(s){try{var o="";do o+=U(s),s=s.return;while(s);return o}catch(c){return` -Error generating stack: `+c.message+` -`+c.stack}}function j(s){var o=s,c=s;if(s.alternate)for(;o.return;)o=o.return;else{s=o;do o=s,o.flags&4098&&(c=o.return),s=o.return;while(s)}return o.tag===3?c:null}function Z(s){if(s.tag===13){var o=s.memoizedState;if(o===null&&(s=s.alternate,s!==null&&(o=s.memoizedState)),o!==null)return o.dehydrated}return null}function P(s){if(j(s)!==s)throw Error(r(188))}function $(s){var o=s.alternate;if(!o){if(o=j(s),o===null)throw Error(r(188));return o!==s?null:s}for(var c=s,d=o;;){var p=c.return;if(p===null)break;var y=p.alternate;if(y===null){if(d=p.return,d!==null){c=d;continue}break}if(p.child===y.child){for(y=p.child;y;){if(y===c)return P(p),s;if(y===d)return P(p),o;y=y.sibling}throw Error(r(188))}if(c.return!==d.return)c=p,d=y;else{for(var R=!1,I=p.child;I;){if(I===c){R=!0,c=p,d=y;break}if(I===d){R=!0,d=p,c=y;break}I=I.sibling}if(!R){for(I=y.child;I;){if(I===c){R=!0,c=y,d=p;break}if(I===d){R=!0,d=y,c=p;break}I=I.sibling}if(!R)throw Error(r(189))}}if(c.alternate!==d)throw Error(r(190))}if(c.tag!==3)throw Error(r(188));return c.stateNode.current===c?s:o}function ie(s){var o=s.tag;if(o===5||o===26||o===27||o===6)return s;for(s=s.child;s!==null;){if(o=ie(s),o!==null)return o;s=s.sibling}return null}var se=Array.isArray,q=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce={pending:!1,data:null,method:null,action:null},fe=[],ye=-1;function Ee(s){return{current:s}}function Ce(s){0>ye||(s.current=fe[ye],fe[ye]=null,ye--)}function Te(s,o){ye++,fe[ye]=s.current,s.current=o}var ve=Ee(null),ge=Ee(null),_e=Ee(null),Ie=Ee(null);function we(s,o){switch(Te(_e,o),Te(ge,s),Te(ve,null),s=o.nodeType,s){case 9:case 11:o=(o=o.documentElement)&&(o=o.namespaceURI)?pE(o):0;break;default:if(s=s===8?o.parentNode:o,o=s.tagName,s=s.namespaceURI)s=pE(s),o=mE(s,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}Ce(ve),Te(ve,o)}function xe(){Ce(ve),Ce(ge),Ce(_e)}function Ve(s){s.memoizedState!==null&&Te(Ie,s);var o=ve.current,c=mE(o,s.type);o!==c&&(Te(ge,s),Te(ve,c))}function Fe(s){ge.current===s&&(Ce(ve),Ce(ge)),Ie.current===s&&(Ce(Ie),Mu._currentValue=ce)}var Be=Object.prototype.hasOwnProperty,nt=t.unstable_scheduleCallback,He=t.unstable_cancelCallback,Ge=t.unstable_shouldYield,Pe=t.unstable_requestPaint,Me=t.unstable_now,dt=t.unstable_getCurrentPriorityLevel,rt=t.unstable_ImmediatePriority,it=t.unstable_UserBlockingPriority,st=t.unstable_NormalPriority,at=t.unstable_LowPriority,Je=t.unstable_IdlePriority,lt=t.log,ft=t.unstable_setDisableYieldValue,ct=null,mt=null;function xt(s){if(mt&&typeof mt.onCommitFiberRoot=="function")try{mt.onCommitFiberRoot(ct,s,void 0,(s.current.flags&128)===128)}catch{}}function Bt(s){if(typeof lt=="function"&&ft(s),mt&&typeof mt.setStrictMode=="function")try{mt.setStrictMode(ct,s)}catch{}}var ht=Math.clz32?Math.clz32:wn,Vt=Math.log,qt=Math.LN2;function wn(s){return s>>>=0,s===0?32:31-(Vt(s)/qt|0)|0}var Mn=128,Ut=4194304;function It(s){var o=s&42;if(o!==0)return o;switch(s&-s){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:return 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 s&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function Lt(s,o){var c=s.pendingLanes;if(c===0)return 0;var d=0,p=s.suspendedLanes,y=s.pingedLanes,R=s.warmLanes;s=s.finishedLanes!==0;var I=c&134217727;return I!==0?(c=I&~p,c!==0?d=It(c):(y&=I,y!==0?d=It(y):s||(R=I&~R,R!==0&&(d=It(R))))):(I=c&~p,I!==0?d=It(I):y!==0?d=It(y):s||(R=c&~R,R!==0&&(d=It(R)))),d===0?0:o!==0&&o!==d&&!(o&p)&&(p=d&-d,R=o&-o,p>=R||p===32&&(R&4194176)!==0)?o:d}function Jt(s,o){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&o)===0}function Mt(s,o){switch(s){case 1:case 2:case 4:case 8:return o+250;case 16:case 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 o+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function qe(){var s=Mn;return Mn<<=1,!(Mn&4194176)&&(Mn=128),s}function ke(){var s=Ut;return Ut<<=1,!(Ut&62914560)&&(Ut=4194304),s}function Ne(s){for(var o=[],c=0;31>c;c++)o.push(s);return o}function Et(s,o){s.pendingLanes|=o,o!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function en(s,o,c,d,p,y){var R=s.pendingLanes;s.pendingLanes=c,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=c,s.entangledLanes&=c,s.errorRecoveryDisabledLanes&=c,s.shellSuspendCounter=0;var I=s.entanglements,H=s.expirationTimes,ee=s.hiddenUpdates;for(c=R&~c;0"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vn=RegExp("^[: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]*$"),Pn={},Bn={};function Or(s){return Be.call(Bn,s)?!0:Be.call(Pn,s)?!1:Vn.test(s)?Bn[s]=!0:(Pn[s]=!0,!1)}function er(s,o,c){if(Or(o))if(c===null)s.removeAttribute(o);else{switch(typeof c){case"undefined":case"function":case"symbol":s.removeAttribute(o);return;case"boolean":var d=o.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){s.removeAttribute(o);return}}s.setAttribute(o,""+c)}}function Un(s,o,c){if(c===null)s.removeAttribute(o);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(o);return}s.setAttribute(o,""+c)}}function Tn(s,o,c,d){if(d===null)s.removeAttribute(c);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(c);return}s.setAttributeNS(o,c,""+d)}}function Qn(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function Ii(s){var o=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function jr(s){var o=Ii(s)?"checked":"value",c=Object.getOwnPropertyDescriptor(s.constructor.prototype,o),d=""+s[o];if(!s.hasOwnProperty(o)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var p=c.get,y=c.set;return Object.defineProperty(s,o,{configurable:!0,get:function(){return p.call(this)},set:function(R){d=""+R,y.call(this,R)}}),Object.defineProperty(s,o,{enumerable:c.enumerable}),{getValue:function(){return d},setValue:function(R){d=""+R},stopTracking:function(){s._valueTracker=null,delete s[o]}}}}function Di(s){s._valueTracker||(s._valueTracker=jr(s))}function Fi(s){if(!s)return!1;var o=s._valueTracker;if(!o)return!0;var c=o.getValue(),d="";return s&&(d=Ii(s)?s.checked?"true":"false":s.value),s=d,s!==c?(o.setValue(s),!0):!1}function Tt(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var yt=/[\n"\\]/g;function nn(s){return s.replace(yt,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function Hn(s,o,c,d,p,y,R,I){s.name="",R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?s.type=R:s.removeAttribute("type"),o!=null?R==="number"?(o===0&&s.value===""||s.value!=o)&&(s.value=""+Qn(o)):s.value!==""+Qn(o)&&(s.value=""+Qn(o)):R!=="submit"&&R!=="reset"||s.removeAttribute("value"),o!=null?Nn(s,R,Qn(o)):c!=null?Nn(s,R,Qn(c)):d!=null&&s.removeAttribute("value"),p==null&&y!=null&&(s.defaultChecked=!!y),p!=null&&(s.checked=p&&typeof p!="function"&&typeof p!="symbol"),I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"?s.name=""+Qn(I):s.removeAttribute("name")}function Cn(s,o,c,d,p,y,R,I){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(s.type=y),o!=null||c!=null){if(!(y!=="submit"&&y!=="reset"||o!=null))return;c=c!=null?""+Qn(c):"",o=o!=null?""+Qn(o):c,I||o===s.value||(s.value=o),s.defaultValue=o}d=d??p,d=typeof d!="function"&&typeof d!="symbol"&&!!d,s.checked=I?s.checked:!!d,s.defaultChecked=!!d,R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"&&(s.name=R)}function Nn(s,o,c){o==="number"&&Tt(s.ownerDocument)===s||s.defaultValue===""+c||(s.defaultValue=""+c)}function tr(s,o,c,d){if(s=s.options,o){o={};for(var p=0;p=qc),Ib=" ",Db=!1;function Fb(s,o){switch(s){case"keyup":return uP.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function kb(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var nl=!1;function dP(s,o){switch(s){case"compositionend":return kb(o);case"keypress":return o.which!==32?null:(Db=!0,Ib);case"textInput":return s=o.data,s===Ib&&Db?null:s;default:return null}}function hP(s,o){if(nl)return s==="compositionend"||!mp&&Fb(s,o)?(s=tl(),ws=An=fn=null,nl=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1=o)return{node:c,offset:o-s};s=d}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=jb(c)}}function Xb(s,o){return s&&o?s===o?!0:s&&s.nodeType===3?!1:o&&o.nodeType===3?Xb(s,o.parentNode):"contains"in s?s.contains(o):s.compareDocumentPosition?!!(s.compareDocumentPosition(o)&16):!1:!1}function qb(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var o=Tt(s.document);o instanceof s.HTMLIFrameElement;){try{var c=typeof o.contentWindow.location.href=="string"}catch{c=!1}if(c)s=o.contentWindow;else break;o=Tt(s.document)}return o}function yp(s){var o=s&&s.nodeName&&s.nodeName.toLowerCase();return o&&(o==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||o==="textarea"||s.contentEditable==="true")}function SP(s,o){var c=qb(o);o=s.focusedElem;var d=s.selectionRange;if(c!==o&&o&&o.ownerDocument&&Xb(o.ownerDocument.documentElement,o)){if(d!==null&&yp(o)){if(s=d.start,c=d.end,c===void 0&&(c=s),"selectionStart"in o)o.selectionStart=s,o.selectionEnd=Math.min(c,o.value.length);else if(c=(s=o.ownerDocument||document)&&s.defaultView||window,c.getSelection){c=c.getSelection();var p=o.textContent.length,y=Math.min(d.start,p);d=d.end===void 0?y:Math.min(d.end,p),!c.extend&&y>d&&(p=d,d=y,y=p),p=Wb(o,y);var R=Wb(o,d);p&&R&&(c.rangeCount!==1||c.anchorNode!==p.node||c.anchorOffset!==p.offset||c.focusNode!==R.node||c.focusOffset!==R.offset)&&(s=s.createRange(),s.setStart(p.node,p.offset),c.removeAllRanges(),y>d?(c.addRange(s),c.extend(R.node,R.offset)):(s.setEnd(R.node,R.offset),c.addRange(s)))}}for(s=[],c=o;c=c.parentNode;)c.nodeType===1&&s.push({element:c,left:c.scrollLeft,top:c.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o=document.documentMode,rl=null,bp=null,Qc=null,Sp=!1;function Yb(s,o,c){var d=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;Sp||rl==null||rl!==Tt(d)||(d=rl,"selectionStart"in d&&yp(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Qc&&Zc(Qc,d)||(Qc=d,d=Ud(bp,"onSelect"),0>=R,p-=R,Cs=1<<32-ht(o)+p|c<vt?(vr=ot,ot=null):vr=ot.sibling;var Gt=ue(re,ot,le[vt],me);if(Gt===null){ot===null&&(ot=vr);break}s&&ot&&Gt.alternate===null&&o(re,ot),Q=y(Gt,Q,vt),Dt===null?Ke=Gt:Dt.sibling=Gt,Dt=Gt,ot=vr}if(vt===le.length)return c(re,ot),Qt&&Ya(re,vt),Ke;if(ot===null){for(;vtvt?(vr=ot,ot=null):vr=ot.sibling;var ga=ue(re,ot,Gt.value,me);if(ga===null){ot===null&&(ot=vr);break}s&&ot&&ga.alternate===null&&o(re,ot),Q=y(ga,Q,vt),Dt===null?Ke=ga:Dt.sibling=ga,Dt=ga,ot=vr}if(Gt.done)return c(re,ot),Qt&&Ya(re,vt),Ke;if(ot===null){for(;!Gt.done;vt++,Gt=le.next())Gt=Se(re,Gt.value,me),Gt!==null&&(Q=y(Gt,Q,vt),Dt===null?Ke=Gt:Dt.sibling=Gt,Dt=Gt);return Qt&&Ya(re,vt),Ke}for(ot=d(ot);!Gt.done;vt++,Gt=le.next())Gt=he(ot,re,vt,Gt.value,me),Gt!==null&&(s&&Gt.alternate!==null&&ot.delete(Gt.key===null?vt:Gt.key),Q=y(Gt,Q,vt),Dt===null?Ke=Gt:Dt.sibling=Gt,Dt=Gt);return s&&ot.forEach(function(LN){return o(re,LN)}),Qt&&Ya(re,vt),Ke}function Xn(re,Q,le,me){if(typeof le=="object"&&le!==null&&le.type===f&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case l:e:{for(var Ke=le.key;Q!==null;){if(Q.key===Ke){if(Ke=le.type,Ke===f){if(Q.tag===7){c(re,Q.sibling),me=p(Q,le.props.children),me.return=re,re=me;break e}}else if(Q.elementType===Ke||typeof Ke=="object"&&Ke!==null&&Ke.$$typeof===T&&f1(Ke)===Q.type){c(re,Q.sibling),me=p(Q,le.props),iu(me,le),me.return=re,re=me;break e}c(re,Q);break}else o(re,Q);Q=Q.sibling}le.type===f?(me=so(le.props.children,re.mode,me,le.key),me.return=re,re=me):(me=xd(le.type,le.key,le.props,null,re.mode,me),iu(me,le),me.return=re,re=me)}return R(re);case u:e:{for(Ke=le.key;Q!==null;){if(Q.key===Ke)if(Q.tag===4&&Q.stateNode.containerInfo===le.containerInfo&&Q.stateNode.implementation===le.implementation){c(re,Q.sibling),me=p(Q,le.children||[]),me.return=re,re=me;break e}else{c(re,Q);break}else o(re,Q);Q=Q.sibling}me=wm(le,re.mode,me),me.return=re,re=me}return R(re);case T:return Ke=le._init,le=Ke(le._payload),Xn(re,Q,le,me)}if(se(le))return tt(re,Q,le,me);if(N(le)){if(Ke=N(le),typeof Ke!="function")throw Error(r(150));return le=Ke.call(le),wt(re,Q,le,me)}if(typeof le.then=="function")return Xn(re,Q,cd(le),me);if(le.$$typeof===S)return Xn(re,Q,Cd(re,le),me);ud(re,le)}return typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint"?(le=""+le,Q!==null&&Q.tag===6?(c(re,Q.sibling),me=p(Q,le),me.return=re,re=me):(c(re,Q),me=Em(le,re.mode,me),me.return=re,re=me),R(re)):c(re,Q)}return function(re,Q,le,me){try{ru=0;var Ke=Xn(re,Q,le,me);return cl=null,Ke}catch(ot){if(ot===tu)throw ot;var Dt=Si(29,ot,null,re.mode);return Dt.lanes=me,Dt.return=re,Dt}finally{}}}var Za=d1(!0),h1=d1(!1),ul=Ee(null),fd=Ee(0);function g1(s,o){s=Bs,Te(fd,s),Te(ul,o),Bs=s|o.baseLanes}function Mp(){Te(fd,Bs),Te(ul,ul.current)}function Op(){Bs=fd.current,Ce(ul),Ce(fd)}var _i=Ee(null),rs=null;function Zs(s){var o=s.alternate;Te(lr,lr.current&1),Te(_i,s),rs===null&&(o===null||ul.current!==null||o.memoizedState!==null)&&(rs=s)}function p1(s){if(s.tag===22){if(Te(lr,lr.current),Te(_i,s),rs===null){var o=s.alternate;o!==null&&o.memoizedState!==null&&(rs=s)}}else Qs()}function Qs(){Te(lr,lr.current),Te(_i,_i.current)}function Rs(s){Ce(_i),rs===s&&(rs=null),Ce(lr)}var lr=Ee(0);function dd(s){for(var o=s;o!==null;){if(o.tag===13){var c=o.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||c.data==="$?"||c.data==="$!"))return o}else if(o.tag===19&&o.memoizedProps.revealOrder!==void 0){if(o.flags&128)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===s)break;for(;o.sibling===null;){if(o.return===null||o.return===s)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var AP=typeof AbortController<"u"?AbortController:function(){var s=[],o=this.signal={aborted:!1,addEventListener:function(c,d){s.push(d)}};this.abort=function(){o.aborted=!0,s.forEach(function(c){return c()})}},RP=t.unstable_scheduleCallback,xP=t.unstable_NormalPriority,cr={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Pp(){return{controller:new AP,data:new Map,refCount:0}}function su(s){s.refCount--,s.refCount===0&&RP(xP,function(){s.controller.abort()})}var au=null,Np=0,fl=0,dl=null;function MP(s,o){if(au===null){var c=au=[];Np=0,fl=Um(),dl={status:"pending",value:void 0,then:function(d){c.push(d)}}}return Np++,o.then(m1,m1),o}function m1(){if(--Np===0&&au!==null){dl!==null&&(dl.status="fulfilled");var s=au;au=null,fl=0,dl=null;for(var o=0;oy?y:8;var R=D.T,I={};D.T=I,Kp(s,!1,o,c);try{var H=p(),ee=D.S;if(ee!==null&&ee(I,H),H!==null&&typeof H=="object"&&typeof H.then=="function"){var pe=OP(H,d);cu(s,o,pe,ri(s))}else cu(s,o,d,ri(s))}catch(Se){cu(s,o,{then:function(){},status:"rejected",reason:Se},ri())}finally{q.p=y,D.T=R}}function FP(){}function qp(s,o,c,d){if(s.tag!==5)throw Error(r(476));var p=q1(s).queue;X1(s,p,o,ce,c===null?FP:function(){return Y1(s),c(d)})}function q1(s){var o=s.memoizedState;if(o!==null)return o;o={memoizedState:ce,baseState:ce,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xs,lastRenderedState:ce},next:null};var c={};return o.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xs,lastRenderedState:c},next:null},s.memoizedState=o,s=s.alternate,s!==null&&(s.memoizedState=o),o}function Y1(s){var o=q1(s).next.queue;cu(s,o,{},ri())}function Yp(){return Pr(Mu)}function K1(){return rr().memoizedState}function Z1(){return rr().memoizedState}function kP(s){for(var o=s.return;o!==null;){switch(o.tag){case 24:case 3:var c=ri();s=na(c);var d=ra(o,s,c);d!==null&&(Lr(d,o,c),du(d,o,c)),o={cache:Pp()},s.payload=o;return}o=o.return}}function BP(s,o,c){var d=ri();c={lane:d,revertLane:0,action:c,hasEagerState:!1,eagerState:null,next:null},Sd(s)?G1(o,c):(c=Tp(s,o,c,d),c!==null&&(Lr(c,s,d),J1(c,o,d)))}function Q1(s,o,c){var d=ri();cu(s,o,c,d)}function cu(s,o,c,d){var p={lane:d,revertLane:0,action:c,hasEagerState:!1,eagerState:null,next:null};if(Sd(s))G1(o,p);else{var y=s.alternate;if(s.lanes===0&&(y===null||y.lanes===0)&&(y=o.lastRenderedReducer,y!==null))try{var R=o.lastRenderedState,I=y(R,c);if(p.hasEagerState=!0,p.eagerState=I,Jr(I,R))return id(s,o,p,0),Rn===null&&rd(),!1}catch{}finally{}if(c=Tp(s,o,p,d),c!==null)return Lr(c,s,d),J1(c,o,d),!0}return!1}function Kp(s,o,c,d){if(d={lane:2,revertLane:Um(),action:d,hasEagerState:!1,eagerState:null,next:null},Sd(s)){if(o)throw Error(r(479))}else o=Tp(s,c,d,2),o!==null&&Lr(o,s,2)}function Sd(s){var o=s.alternate;return s===Pt||o!==null&&o===Pt}function G1(s,o){hl=gd=!0;var c=s.pending;c===null?o.next=o:(o.next=c.next,c.next=o),s.pending=o}function J1(s,o,c){if(c&4194176){var d=o.lanes;d&=s.pendingLanes,c|=d,o.lanes=c,Oe(s,c)}}var is={readContext:Pr,use:vd,useCallback:Gn,useContext:Gn,useEffect:Gn,useImperativeHandle:Gn,useLayoutEffect:Gn,useInsertionEffect:Gn,useMemo:Gn,useReducer:Gn,useRef:Gn,useState:Gn,useDebugValue:Gn,useDeferredValue:Gn,useTransition:Gn,useSyncExternalStore:Gn,useId:Gn};is.useCacheRefresh=Gn,is.useMemoCache=Gn,is.useHostTransitionStatus=Gn,is.useFormState=Gn,is.useActionState=Gn,is.useOptimistic=Gn;var Ja={readContext:Pr,use:vd,useCallback:function(s,o){return qr().memoizedState=[s,o===void 0?null:o],s},useContext:Pr,useEffect:U1,useImperativeHandle:function(s,o,c){c=c!=null?c.concat([s]):null,yd(4194308,4,$1.bind(null,o,s),c)},useLayoutEffect:function(s,o){return yd(4194308,4,s,o)},useInsertionEffect:function(s,o){yd(4,2,s,o)},useMemo:function(s,o){var c=qr();o=o===void 0?null:o;var d=s();if(Ga){Bt(!0);try{s()}finally{Bt(!1)}}return c.memoizedState=[d,o],d},useReducer:function(s,o,c){var d=qr();if(c!==void 0){var p=c(o);if(Ga){Bt(!0);try{c(o)}finally{Bt(!1)}}}else p=o;return d.memoizedState=d.baseState=p,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:p},d.queue=s,s=s.dispatch=BP.bind(null,Pt,s),[d.memoizedState,s]},useRef:function(s){var o=qr();return s={current:s},o.memoizedState=s},useState:function(s){s=Vp(s);var o=s.queue,c=Q1.bind(null,Pt,o);return o.dispatch=c,[s.memoizedState,c]},useDebugValue:Wp,useDeferredValue:function(s,o){var c=qr();return Xp(c,s,o)},useTransition:function(){var s=Vp(!1);return s=X1.bind(null,Pt,s.queue,!0,!1),qr().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,o,c){var d=Pt,p=qr();if(Qt){if(c===void 0)throw Error(r(407));c=c()}else{if(c=o(),Rn===null)throw Error(r(349));Kt&60||E1(d,o,c)}p.memoizedState=c;var y={value:c,getSnapshot:o};return p.queue=y,U1(T1.bind(null,d,y,s),[s]),d.flags|=2048,pl(9,w1.bind(null,d,y,c,o),{destroy:void 0},null),c},useId:function(){var s=qr(),o=Rn.identifierPrefix;if(Qt){var c=As,d=Cs;c=(d&~(1<<32-ht(d)-1)).toString(32)+c,o=":"+o+"R"+c,c=pd++,0 title"))),Tr(y,d,c),y[bt]=s,be(y),d=y;break e;case"link":var R=AE("link","href",p).get(d+(c.href||""));if(R){for(var I=0;I<\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof d.is=="string"?p.createElement("select",{is:d.is}):p.createElement("select"),d.multiple?s.multiple=!0:d.size&&(s.size=d.size);break;default:s=typeof d.is=="string"?p.createElement(c,{is:d.is}):p.createElement(c)}}s[bt]=o,s[_t]=d;e:for(p=o.child;p!==null;){if(p.tag===5||p.tag===6)s.appendChild(p.stateNode);else if(p.tag!==4&&p.tag!==27&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===o)break e;for(;p.sibling===null;){if(p.return===null||p.return===o)break e;p=p.return}p.sibling.return=p.return,p=p.sibling}o.stateNode=s;e:switch(Tr(s,c,d),c){case"button":case"input":case"select":case"textarea":s=!!d.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Fs(o)}}return Ln(o),o.flags&=-16777217,null;case 6:if(s&&o.stateNode!=null)s.memoizedProps!==d&&Fs(o);else{if(typeof d!="string"&&o.stateNode===null)throw Error(r(166));if(s=_e.current,Gc(o)){if(s=o.stateNode,c=o.memoizedProps,d=null,p=Ur,p!==null)switch(p.tag){case 27:case 5:d=p.memoizedProps}s[bt]=o,s=!!(s.nodeValue===c||d!==null&&d.suppressHydrationWarning===!0||gE(s.nodeValue,c)),s||Ka(o)}else s=zd(s).createTextNode(d),s[bt]=o,o.stateNode=s}return Ln(o),null;case 13:if(d=o.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(p=Gc(o),d!==null&&d.dehydrated!==null){if(s===null){if(!p)throw Error(r(318));if(p=o.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(r(317));p[bt]=o}else Jc(),!(o.flags&128)&&(o.memoizedState=null),o.flags|=4;Ln(o),p=!1}else Li!==null&&(Pm(Li),Li=null),p=!0;if(!p)return o.flags&256?(Rs(o),o):(Rs(o),null)}if(Rs(o),o.flags&128)return o.lanes=c,o;if(c=d!==null,s=s!==null&&s.memoizedState!==null,c){d=o.child,p=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(p=d.alternate.memoizedState.cachePool.pool);var y=null;d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(y=d.memoizedState.cachePool.pool),y!==p&&(d.flags|=2048)}return c!==s&&c&&(o.child.flags|=8192),Md(o,o.updateQueue),Ln(o),null;case 4:return xe(),s===null&&Vm(o.stateNode.containerInfo),Ln(o),null;case 10:return Ps(o.type),Ln(o),null;case 19:if(Ce(lr),p=o.memoizedState,p===null)return Ln(o),null;if(d=(o.flags&128)!==0,y=p.rendering,y===null)if(d)yu(p,!1);else{if(Wn!==0||s!==null&&s.flags&128)for(s=o.child;s!==null;){if(y=dd(s),y!==null){for(o.flags|=128,yu(p,!1),s=y.updateQueue,o.updateQueue=s,Md(o,s),o.subtreeFlags=0,s=c,c=o.child;c!==null;)VS(c,s),c=c.sibling;return Te(lr,lr.current&1|2),o.child}s=s.sibling}p.tail!==null&&Me()>Od&&(o.flags|=128,d=!0,yu(p,!1),o.lanes=4194304)}else{if(!d)if(s=dd(y),s!==null){if(o.flags|=128,d=!0,s=s.updateQueue,o.updateQueue=s,Md(o,s),yu(p,!0),p.tail===null&&p.tailMode==="hidden"&&!y.alternate&&!Qt)return Ln(o),null}else 2*Me()-p.renderingStartTime>Od&&c!==536870912&&(o.flags|=128,d=!0,yu(p,!1),o.lanes=4194304);p.isBackwards?(y.sibling=o.child,o.child=y):(s=p.last,s!==null?s.sibling=y:o.child=y,p.last=y)}return p.tail!==null?(o=p.tail,p.rendering=o,p.tail=o.sibling,p.renderingStartTime=Me(),o.sibling=null,s=lr.current,Te(lr,d?s&1|2:s&1),o):(Ln(o),null);case 22:case 23:return Rs(o),Op(),d=o.memoizedState!==null,s!==null?s.memoizedState!==null!==d&&(o.flags|=8192):d&&(o.flags|=8192),d?c&536870912&&!(o.flags&128)&&(Ln(o),o.subtreeFlags&6&&(o.flags|=8192)):Ln(o),c=o.updateQueue,c!==null&&Md(o,c.retryQueue),c=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(c=s.memoizedState.cachePool.pool),d=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(d=o.memoizedState.cachePool.pool),d!==c&&(o.flags|=2048),s!==null&&Ce(Qa),null;case 24:return c=null,s!==null&&(c=s.memoizedState.cache),o.memoizedState.cache!==c&&(o.flags|=2048),Ps(cr),Ln(o),null;case 25:return null}throw Error(r(156,o.tag))}function jP(s,o){switch(Ap(o),o.tag){case 1:return s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 3:return Ps(cr),xe(),s=o.flags,s&65536&&!(s&128)?(o.flags=s&-65537|128,o):null;case 26:case 27:case 5:return Fe(o),null;case 13:if(Rs(o),s=o.memoizedState,s!==null&&s.dehydrated!==null){if(o.alternate===null)throw Error(r(340));Jc()}return s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 19:return Ce(lr),null;case 4:return xe(),null;case 10:return Ps(o.type),null;case 22:case 23:return Rs(o),Op(),s!==null&&Ce(Qa),s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 24:return Ps(cr),null;case 25:return null;default:return null}}function WS(s,o){switch(Ap(o),o.tag){case 3:Ps(cr),xe();break;case 26:case 27:case 5:Fe(o);break;case 4:xe();break;case 13:Rs(o);break;case 19:Ce(lr);break;case 10:Ps(o.type);break;case 22:case 23:Rs(o),Op(),s!==null&&Ce(Qa);break;case 24:Ps(cr)}}var WP={getCacheForType:function(s){var o=Pr(cr),c=o.data.get(s);return c===void 0&&(c=s(),o.data.set(s,c)),c}},XP=typeof WeakMap=="function"?WeakMap:Map,zn=0,Rn=null,$t=null,Kt=0,xn=0,ni=null,ks=!1,yl=!1,Tm=!1,Bs=0,Wn=0,la=0,ao=0,Cm=0,Ei=0,bl=0,bu=null,ss=null,Am=!1,Rm=0,Od=1/0,Pd=null,ca=null,Nd=!1,oo=null,Su=0,xm=0,Mm=null,Eu=0,Om=null;function ri(){if(zn&2&&Kt!==0)return Kt&-Kt;if(D.T!==null){var s=fl;return s!==0?s:Um()}return Ye()}function XS(){Ei===0&&(Ei=!(Kt&536870912)||Qt?qe():536870912);var s=_i.current;return s!==null&&(s.flags|=32),Ei}function Lr(s,o,c){(s===Rn&&xn===2||s.cancelPendingCommit!==null)&&(Sl(s,0),Us(s,Kt,Ei,!1)),Et(s,c),(!(zn&2)||s!==Rn)&&(s===Rn&&(!(zn&2)&&(ao|=c),Wn===4&&Us(s,Kt,Ei,!1)),as(s))}function qS(s,o,c){if(zn&6)throw Error(r(327));var d=!c&&(o&60)===0&&(o&s.expiredLanes)===0||Jt(s,o),p=d?KP(s,o):Dm(s,o,!0),y=d;do{if(p===0){yl&&!d&&Us(s,o,0,!1);break}else if(p===6)Us(s,o,0,!ks);else{if(c=s.current.alternate,y&&!qP(c)){p=Dm(s,o,!1),y=!1;continue}if(p===2){if(y=o,s.errorRecoveryDisabledLanes&y)var R=0;else R=s.pendingLanes&-536870913,R=R!==0?R:R&536870912?536870912:0;if(R!==0){o=R;e:{var I=s;p=bu;var H=I.current.memoizedState.isDehydrated;if(H&&(Sl(I,R).flags|=256),R=Dm(I,R,!1),R!==2){if(Tm&&!H){I.errorRecoveryDisabledLanes|=y,ao|=y,p=4;break e}y=ss,ss=p,y!==null&&Pm(y)}p=R}if(y=!1,p!==2)continue}}if(p===1){Sl(s,0),Us(s,o,0,!0);break}e:{switch(d=s,p){case 0:case 1:throw Error(r(345));case 4:if((o&4194176)===o){Us(d,o,Ei,!ks);break e}break;case 2:ss=null;break;case 3:case 5:break;default:throw Error(r(329))}if(d.finishedWork=c,d.finishedLanes=o,(o&62914560)===o&&(y=Rm+300-Me(),10c?32:c,D.T=null,oo===null)var y=!1;else{c=Mm,Mm=null;var R=oo,I=Su;if(oo=null,Su=0,zn&6)throw Error(r(331));var H=zn;if(zn|=4,zS(R.current),BS(R,R.current,I,c),zn=H,wu(0,!1),mt&&typeof mt.onPostCommitFiberRoot=="function")try{mt.onPostCommitFiberRoot(ct,R)}catch{}y=!0}return y}finally{q.p=p,D.T=d,nE(s,o)}}return!1}function rE(s,o,c){o=pi(c,o),o=Gp(s.stateNode,o,2),s=ra(s,o,2),s!==null&&(Et(s,2),as(s))}function yn(s,o,c){if(s.tag===3)rE(s,s,c);else for(;o!==null;){if(o.tag===3){rE(o,s,c);break}else if(o.tag===1){var d=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(ca===null||!ca.has(d))){s=pi(c,s),c=aS(2),d=ra(o,c,2),d!==null&&(oS(c,d,o,s),Et(d,2),as(d));break}}o=o.return}}function Fm(s,o,c){var d=s.pingCache;if(d===null){d=s.pingCache=new XP;var p=new Set;d.set(o,p)}else p=d.get(o),p===void 0&&(p=new Set,d.set(o,p));p.has(c)||(Tm=!0,p.add(c),s=GP.bind(null,s,o,c),o.then(s,s))}function GP(s,o,c){var d=s.pingCache;d!==null&&d.delete(o),s.pingedLanes|=s.suspendedLanes&c,s.warmLanes&=~c,Rn===s&&(Kt&c)===c&&(Wn===4||Wn===3&&(Kt&62914560)===Kt&&300>Me()-Rm?!(zn&2)&&Sl(s,0):Cm|=c,bl===Kt&&(bl=0)),as(s)}function iE(s,o){o===0&&(o=ke()),s=Ks(s,o),s!==null&&(Et(s,o),as(s))}function JP(s){var o=s.memoizedState,c=0;o!==null&&(c=o.retryLane),iE(s,c)}function eN(s,o){var c=0;switch(s.tag){case 13:var d=s.stateNode,p=s.memoizedState;p!==null&&(c=p.retryLane);break;case 19:d=s.stateNode;break;case 22:d=s.stateNode._retryCache;break;default:throw Error(r(314))}d!==null&&d.delete(o),iE(s,c)}function tN(s,o){return nt(s,o)}var Fd=null,Tl=null,km=!1,kd=!1,Bm=!1,lo=0;function as(s){s!==Tl&&s.next===null&&(Tl===null?Fd=Tl=s:Tl=Tl.next=s),kd=!0,km||(km=!0,rN(nN))}function wu(s,o){if(!Bm&&kd){Bm=!0;do for(var c=!1,d=Fd;d!==null;){if(s!==0){var p=d.pendingLanes;if(p===0)var y=0;else{var R=d.suspendedLanes,I=d.pingedLanes;y=(1<<31-ht(42|s)+1)-1,y&=p&~(R&~I),y=y&201326677?y&201326677|1:y?y|2:0}y!==0&&(c=!0,oE(d,y))}else y=Kt,y=Lt(d,d===Rn?y:0),!(y&3)||Jt(d,y)||(c=!0,oE(d,y));d=d.next}while(c);Bm=!1}}function nN(){kd=km=!1;var s=0;lo!==0&&(fN()&&(s=lo),lo=0);for(var o=Me(),c=null,d=Fd;d!==null;){var p=d.next,y=sE(d,o);y===0?(d.next=null,c===null?Fd=p:c.next=p,p===null&&(Tl=c)):(c=d,(s!==0||y&3)&&(kd=!0)),d=p}wu(s)}function sE(s,o){for(var c=s.suspendedLanes,d=s.pingedLanes,p=s.expirationTimes,y=s.pendingLanes&-62914561;0"u"?null:document;function EE(s,o,c){var d=Al;if(d&&typeof o=="string"&&o){var p=nn(o);p='link[rel="'+s+'"][href="'+p+'"]',typeof c=="string"&&(p+='[crossorigin="'+c+'"]'),SE.has(p)||(SE.add(p),s={rel:s,crossOrigin:c,href:o},d.querySelector(p)===null&&(o=d.createElement("link"),Tr(o,"link",s),be(o),d.head.appendChild(o)))}}function yN(s){Ls.D(s),EE("dns-prefetch",s,null)}function bN(s,o){Ls.C(s,o),EE("preconnect",s,o)}function SN(s,o,c){Ls.L(s,o,c);var d=Al;if(d&&s&&o){var p='link[rel="preload"][as="'+nn(o)+'"]';o==="image"&&c&&c.imageSrcSet?(p+='[imagesrcset="'+nn(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(p+='[imagesizes="'+nn(c.imageSizes)+'"]')):p+='[href="'+nn(s)+'"]';var y=p;switch(o){case"style":y=Rl(s);break;case"script":y=xl(s)}wi.has(y)||(s=V({rel:"preload",href:o==="image"&&c&&c.imageSrcSet?void 0:s,as:o},c),wi.set(y,s),d.querySelector(p)!==null||o==="style"&&d.querySelector(Au(y))||o==="script"&&d.querySelector(Ru(y))||(o=d.createElement("link"),Tr(o,"link",s),be(o),d.head.appendChild(o)))}}function EN(s,o){Ls.m(s,o);var c=Al;if(c&&s){var d=o&&typeof o.as=="string"?o.as:"script",p='link[rel="modulepreload"][as="'+nn(d)+'"][href="'+nn(s)+'"]',y=p;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=xl(s)}if(!wi.has(y)&&(s=V({rel:"modulepreload",href:s},o),wi.set(y,s),c.querySelector(p)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(Ru(y)))return}d=c.createElement("link"),Tr(d,"link",s),be(d),c.head.appendChild(d)}}}function wN(s,o,c){Ls.S(s,o,c);var d=Al;if(d&&s){var p=De(d).hoistableStyles,y=Rl(s);o=o||"default";var R=p.get(y);if(!R){var I={loading:0,preload:null};if(R=d.querySelector(Au(y)))I.loading=5;else{s=V({rel:"stylesheet",href:s,"data-precedence":o},c),(c=wi.get(y))&&Qm(s,c);var H=R=d.createElement("link");be(H),Tr(H,"link",s),H._p=new Promise(function(ee,pe){H.onload=ee,H.onerror=pe}),H.addEventListener("load",function(){I.loading|=1}),H.addEventListener("error",function(){I.loading|=2}),I.loading|=4,Vd(R,o,d)}R={type:"stylesheet",instance:R,count:1,state:I},p.set(y,R)}}}function TN(s,o){Ls.X(s,o);var c=Al;if(c&&s){var d=De(c).hoistableScripts,p=xl(s),y=d.get(p);y||(y=c.querySelector(Ru(p)),y||(s=V({src:s,async:!0},o),(o=wi.get(p))&&Gm(s,o),y=c.createElement("script"),be(y),Tr(y,"link",s),c.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},d.set(p,y))}}function CN(s,o){Ls.M(s,o);var c=Al;if(c&&s){var d=De(c).hoistableScripts,p=xl(s),y=d.get(p);y||(y=c.querySelector(Ru(p)),y||(s=V({src:s,async:!0,type:"module"},o),(o=wi.get(p))&&Gm(s,o),y=c.createElement("script"),be(y),Tr(y,"link",s),c.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},d.set(p,y))}}function wE(s,o,c,d){var p=(p=_e.current)?$d(p):null;if(!p)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(o=Rl(c.href),c=De(p).hoistableStyles,d=c.get(o),d||(d={type:"style",instance:null,count:0,state:null},c.set(o,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){s=Rl(c.href);var y=De(p).hoistableStyles,R=y.get(s);if(R||(p=p.ownerDocument||p,R={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(s,R),(y=p.querySelector(Au(s)))&&!y._p&&(R.instance=y,R.state.loading=5),wi.has(s)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},wi.set(s,c),y||AN(p,s,c,R.state))),o&&d===null)throw Error(r(528,""));return R}if(o&&d!==null)throw Error(r(529,""));return null;case"script":return o=c.async,c=c.src,typeof c=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=xl(c),c=De(p).hoistableScripts,d=c.get(o),d||(d={type:"script",instance:null,count:0,state:null},c.set(o,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function Rl(s){return'href="'+nn(s)+'"'}function Au(s){return'link[rel="stylesheet"]['+s+"]"}function TE(s){return V({},s,{"data-precedence":s.precedence,precedence:null})}function AN(s,o,c,d){s.querySelector('link[rel="preload"][as="style"]['+o+"]")?d.loading=1:(o=s.createElement("link"),d.preload=o,o.addEventListener("load",function(){return d.loading|=1}),o.addEventListener("error",function(){return d.loading|=2}),Tr(o,"link",c),be(o),s.head.appendChild(o))}function xl(s){return'[src="'+nn(s)+'"]'}function Ru(s){return"script[async]"+s}function CE(s,o,c){if(o.count++,o.instance===null)switch(o.type){case"style":var d=s.querySelector('style[data-href~="'+nn(c.href)+'"]');if(d)return o.instance=d,be(d),d;var p=V({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return d=(s.ownerDocument||s).createElement("style"),be(d),Tr(d,"style",p),Vd(d,c.precedence,s),o.instance=d;case"stylesheet":p=Rl(c.href);var y=s.querySelector(Au(p));if(y)return o.state.loading|=4,o.instance=y,be(y),y;d=TE(c),(p=wi.get(p))&&Qm(d,p),y=(s.ownerDocument||s).createElement("link"),be(y);var R=y;return R._p=new Promise(function(I,H){R.onload=I,R.onerror=H}),Tr(y,"link",d),o.state.loading|=4,Vd(y,c.precedence,s),o.instance=y;case"script":return y=xl(c.src),(p=s.querySelector(Ru(y)))?(o.instance=p,be(p),p):(d=c,(p=wi.get(y))&&(d=V({},c),Gm(d,p)),s=s.ownerDocument||s,p=s.createElement("script"),be(p),Tr(p,"link",d),s.head.appendChild(p),o.instance=p);case"void":return null;default:throw Error(r(443,o.type))}else o.type==="stylesheet"&&!(o.state.loading&4)&&(d=o.instance,o.state.loading|=4,Vd(d,c.precedence,s));return o.instance}function Vd(s,o,c){for(var d=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=d.length?d[d.length-1]:null,y=p,R=0;R title"):null)}function RN(s,o,c){if(c===1||o.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;switch(o.rel){case"stylesheet":return s=o.disabled,typeof o.precedence=="string"&&s==null;default:return!0}case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function xE(s){return!(s.type==="stylesheet"&&!(s.state.loading&3))}var xu=null;function xN(){}function MN(s,o,c){if(xu===null)throw Error(r(475));var d=xu;if(o.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&!(o.state.loading&4)){if(o.instance===null){var p=Rl(c.href),y=s.querySelector(Au(p));if(y){s=y._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(d.count++,d=jd.bind(d),s.then(d,d)),o.state.loading|=4,o.instance=y,be(y);return}y=s.ownerDocument||s,c=TE(c),(p=wi.get(p))&&Qm(c,p),y=y.createElement("link"),be(y);var R=y;R._p=new Promise(function(I,H){R.onload=I,R.onerror=H}),Tr(y,"link",c),o.instance=y}d.stylesheets===null&&(d.stylesheets=new Map),d.stylesheets.set(o,s),(s=o.state.preload)&&!(o.state.loading&3)&&(d.count++,o=jd.bind(d),s.addEventListener("load",o),s.addEventListener("error",o))}}function ON(){if(xu===null)throw Error(r(475));var s=xu;return s.stylesheets&&s.count===0&&Jm(s,s.stylesheets),0"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),uv.exports=II(),uv.exports}var FI=DI();function zh(t,e){if(!t)throw new Error(e||"loader assertion failed.")}const Cy=!!(typeof process!="object"||String(process)!=="[object process]"||process.browser),lw=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);lw&&parseFloat(lw[1]);const th=globalThis,Ml=globalThis.process||{},kI=globalThis.navigator||{};function GA(t){var r,i;if(typeof window<"u"&&((r=window.process)==null?void 0:r.type)==="renderer"||typeof process<"u"&&((i=process.versions)!=null&&i.electron))return!0;const n=typeof navigator<"u"&&navigator.userAgent;return!!(n&&n.indexOf("Electron")>=0)}function Ho(){return!(typeof process=="object"&&String(process)==="[object process]"&&!(process!=null&&process.browser))||GA()}function BI(t){return Ho()?GA()?"Electron":(kI.userAgent||"").indexOf("Edge")>-1?"Edge":globalThis.chrome?"Chrome":globalThis.safari?"Safari":globalThis.mozInnerScreenX?"Firefox":"Unknown":"Node"}const JA="4.1.0";function UI(t){try{const e=window[t],n="__storage_test__";return e.setItem(n,n),e.removeItem(n),e}catch{return null}}class LI{constructor(e,n,r="sessionStorage"){this.storage=UI(r),this.id=e,this.config=n,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){if(Object.assign(this.config,e),this.storage){const n=JSON.stringify(this.config);this.storage.setItem(this.id,n)}}_loadConfiguration(){let e={};if(this.storage){const n=this.storage.getItem(this.id);e=n?JSON.parse(n):{}}return Object.assign(this.config,e),this}}function zI(t){let e;return t<10?e=`${t.toFixed(2)}ms`:t<100?e=`${t.toFixed(1)}ms`:t<1e3?e=`${t.toFixed(0)}ms`:e=`${(t/1e3).toFixed(2)}s`,e}function $I(t,e=8){const n=Math.max(e-t.length,0);return`${" ".repeat(n)}${t}`}var $h;(function(t){t[t.BLACK=30]="BLACK",t[t.RED=31]="RED",t[t.GREEN=32]="GREEN",t[t.YELLOW=33]="YELLOW",t[t.BLUE=34]="BLUE",t[t.MAGENTA=35]="MAGENTA",t[t.CYAN=36]="CYAN",t[t.WHITE=37]="WHITE",t[t.BRIGHT_BLACK=90]="BRIGHT_BLACK",t[t.BRIGHT_RED=91]="BRIGHT_RED",t[t.BRIGHT_GREEN=92]="BRIGHT_GREEN",t[t.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",t[t.BRIGHT_BLUE=94]="BRIGHT_BLUE",t[t.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",t[t.BRIGHT_CYAN=96]="BRIGHT_CYAN",t[t.BRIGHT_WHITE=97]="BRIGHT_WHITE"})($h||($h={}));const VI=10;function cw(t){return typeof t!="string"?t:(t=t.toUpperCase(),$h[t]||$h.WHITE)}function HI(t,e,n){return!Ho&&typeof t=="string"&&(e&&(t=`\x1B[${cw(e)}m${t}\x1B[39m`),n&&(t=`\x1B[${cw(n)+VI}m${t}\x1B[49m`)),t}function jI(t,e=["constructor"]){const n=Object.getPrototypeOf(t),r=Object.getOwnPropertyNames(n),i=t;for(const a of r){const l=i[a];typeof l=="function"&&(e.find(u=>a===u)||(i[a]=l.bind(t)))}}function Ay(t,e){if(!t)throw new Error("Assertion failed")}function Ol(){var e,n,r;let t;if(Ho()&&th.performance)t=(n=(e=th==null?void 0:th.performance)==null?void 0:e.now)==null?void 0:n.call(e);else if("hrtime"in Ml){const i=(r=Ml==null?void 0:Ml.hrtime)==null?void 0:r.call(Ml);t=i[0]*1e3+i[1]/1e6}else t=Date.now();return t}const Pl={debug:Ho()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},WI={enabled:!0,level:0};function Nl(){}const uw={},fw={once:!0};class Lf{constructor({id:e}={id:""}){this.VERSION=JA,this._startTs=Ol(),this._deltaTs=Ol(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new LI(`__probe-${this.id}__`,WI),this.timeStamp(`${this.id} started`),jI(this),Object.seal(this)}set level(e){this.setLevel(e)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((Ol()-this._startTs).toPrecision(10))}getDelta(){return Number((Ol()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(e=!0){return this._storage.setConfiguration({enabled:e}),this}setLevel(e){return this._storage.setConfiguration({level:e}),this}get(e){return this._storage.config[e]}set(e,n){this._storage.setConfiguration({[e]:n})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(e,n){if(!e)throw new Error(n||"Assertion failed")}warn(e){return this._getLogFunction(0,e,Pl.warn,arguments,fw)}error(e){return this._getLogFunction(0,e,Pl.error,arguments)}deprecated(e,n){return this.warn(`\`${e}\` is deprecated and will be removed in a later version. Use \`${n}\` instead`)}removed(e,n){return this.error(`\`${e}\` has been removed. Use \`${n}\` instead`)}probe(e,n){return this._getLogFunction(e,n,Pl.log,arguments,{time:!0,once:!0})}log(e,n){return this._getLogFunction(e,n,Pl.debug,arguments)}info(e,n){return this._getLogFunction(e,n,console.info,arguments)}once(e,n){return this._getLogFunction(e,n,Pl.debug||Pl.info,arguments,fw)}table(e,n,r){return n?this._getLogFunction(e,n,console.table||Nl,r&&[r],{tag:qI(n)}):Nl}time(e,n){return this._getLogFunction(e,n,console.time?console.time:console.info)}timeEnd(e,n){return this._getLogFunction(e,n,console.timeEnd?console.timeEnd:console.info)}timeStamp(e,n){return this._getLogFunction(e,n,console.timeStamp||Nl)}group(e,n,r={collapsed:!1}){const i=dw({logLevel:e,message:n,opts:r}),{collapsed:a}=r;return i.method=(a?console.groupCollapsed:console.group)||console.info,this._getLogFunction(i)}groupCollapsed(e,n,r={}){return this.group(e,n,Object.assign({},r,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||Nl)}withGroup(e,n,r){this.group(e,n)();try{r()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=eR(e)}_getLogFunction(e,n,r,i,a){if(this._shouldLog(e)){a=dw({logLevel:e,message:n,args:i,opts:a}),r=r||a.method,Ay(r),a.total=this.getTotal(),a.delta=this.getDelta(),this._deltaTs=Ol();const l=a.tag||a.message;if(a.once&&l)if(!uw[l])uw[l]=Ol();else return Nl;return n=XI(this.id,a.message,a),r.bind(console,n,...a.args)}return Nl}}Lf.VERSION=JA;function eR(t){if(!t)return 0;let e;switch(typeof t){case"number":e=t;break;case"object":e=t.logLevel||t.priority||0;break;default:return 0}return Ay(Number.isFinite(e)&&e>=0),e}function dw(t){const{logLevel:e,message:n}=t;t.logLevel=eR(e);const r=t.args?Array.from(t.args):[];for(;r.length&&r.shift()!==n;);switch(typeof e){case"string":case"function":n!==void 0&&r.unshift(n),t.message=e;break;case"object":Object.assign(t,e);break}typeof t.message=="function"&&(t.message=t.message());const i=typeof t.message;return Ay(i==="string"||i==="object"),Object.assign(t,{args:r},t.opts)}function XI(t,e,n){if(typeof e=="string"){const r=n.time?$I(zI(n.total)):"";e=n.time?`${t}: ${r} ${e}`:`${t}: ${e}`,e=HI(e,n.color,n.background)}return e}function qI(t){for(const e in t)for(const n in t[e])return n||"untitled";return"empty"}const gv="4.3.2",YI=gv[0]>="0"&&gv[0]<="9"?`v${gv}`:"";function KI(){const t=new Lf({id:"loaders.gl"});return globalThis.loaders=globalThis.loaders||{},globalThis.loaders.log=t,globalThis.loaders.version=YI,globalThis.probe=globalThis.probe||{},globalThis.probe.loaders=t,t}const ZI=KI();function QI(t,e){return tR(t||{},e)}function tR(t,e,n=0){if(n>3)return e;const r={...t};for(const[i,a]of Object.entries(e))a&&typeof a=="object"&&!Array.isArray(a)?r[i]=tR(r[i]||{},e[i],n+1):r[i]=e[i];return r}const GI="latest";function JI(){var t;return(t=globalThis._loadersgl_)!=null&&t.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.3.2"),globalThis._loadersgl_.version}const e6=JI();function La(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}const Po=typeof process!="object"||String(process)!=="[object process]"||process.browser,t6=typeof window<"u"&&typeof window.orientation<"u",hw=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);hw&&parseFloat(hw[1]);class n6{constructor(e,n){M(this,"name");M(this,"workerThread");M(this,"isRunning",!0);M(this,"result");M(this,"_resolve",()=>{});M(this,"_reject",()=>{});this.name=e,this.workerThread=n,this.result=new Promise((r,i)=>{this._resolve=r,this._reject=i})}postMessage(e,n){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:n})}done(e){La(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){La(this.isRunning),this.isRunning=!1,this._reject(e)}}class pv{terminate(){}}const mv=new Map;function r6(t){La(t.source&&!t.url||!t.source&&t.url);let e=mv.get(t.source||t.url);return e||(t.url&&(e=i6(t.url),mv.set(t.url,e)),t.source&&(e=nR(t.source),mv.set(t.source,e))),La(e),e}function i6(t){if(!t.startsWith("http"))return t;const e=s6(t);return nR(e)}function nR(t){const e=new Blob([t],{type:"application/javascript"});return URL.createObjectURL(e)}function s6(t){return`try { - importScripts('${t}'); -} catch (error) { - console.error(error); - throw error; -}`}function rR(t,e=!0,n){const r=n||new Set;if(t){if(gw(t))r.add(t);else if(gw(t.buffer))r.add(t.buffer);else if(!ArrayBuffer.isView(t)){if(e&&typeof t=="object")for(const i in t)rR(t[i],e,r)}}return n===void 0?Array.from(r):[]}function gw(t){return t?t instanceof ArrayBuffer||typeof MessagePort<"u"&&t instanceof MessagePort||typeof ImageBitmap<"u"&&t instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas:!1}const vv=()=>{};class M0{constructor(e){M(this,"name");M(this,"source");M(this,"url");M(this,"terminated",!1);M(this,"worker");M(this,"onMessage");M(this,"onError");M(this,"_loadableURL","");const{name:n,source:r,url:i}=e;La(r||i),this.name=n,this.source=r,this.url=i,this.onMessage=vv,this.onError=a=>console.log(a),this.worker=Po?this._createBrowserWorker():this._createNodeWorker()}static isSupported(){return typeof Worker<"u"&&Po||typeof pv<"u"&&!Po}destroy(){this.onMessage=vv,this.onError=vv,this.worker.terminate(),this.terminated=!0}get isRunning(){return!!this.onMessage}postMessage(e,n){n=n||rR(e),this.worker.postMessage(e,n)}_getErrorFromErrorEvent(e){let n="Failed to load ";return n+=`worker ${this.name} from ${this.url}. `,e.message&&(n+=`${e.message} in `),e.lineno&&(n+=`:${e.lineno}:${e.colno}`),new Error(n)}_createBrowserWorker(){this._loadableURL=r6({source:this.source,url:this.url});const e=new Worker(this._loadableURL,{name:this.name});return e.onmessage=n=>{n.data?this.onMessage(n.data):this.onError(new Error("No data received"))},e.onerror=n=>{this.onError(this._getErrorFromErrorEvent(n)),this.terminated=!0},e.onmessageerror=n=>console.error(n),e}_createNodeWorker(){let e;if(this.url){const r=this.url.includes(":/")||this.url.startsWith("/")?this.url:`./${this.url}`;e=new pv(r,{eval:!1})}else if(this.source)e=new pv(this.source,{eval:!0});else throw new Error("no worker");return e.on("message",n=>{this.onMessage(n)}),e.on("error",n=>{this.onError(n)}),e.on("exit",n=>{}),e}}class a6{constructor(e){M(this,"name","unnamed");M(this,"source");M(this,"url");M(this,"maxConcurrency",1);M(this,"maxMobileConcurrency",1);M(this,"onDebug",()=>{});M(this,"reuseWorkers",!0);M(this,"props",{});M(this,"jobQueue",[]);M(this,"idleQueue",[]);M(this,"count",0);M(this,"isDestroyed",!1);this.source=e.source,this.url=e.url,this.setProps(e)}static isSupported(){return M0.isSupported()}destroy(){this.idleQueue.forEach(e=>e.destroy()),this.isDestroyed=!0}setProps(e){this.props={...this.props,...e},e.name!==void 0&&(this.name=e.name),e.maxConcurrency!==void 0&&(this.maxConcurrency=e.maxConcurrency),e.maxMobileConcurrency!==void 0&&(this.maxMobileConcurrency=e.maxMobileConcurrency),e.reuseWorkers!==void 0&&(this.reuseWorkers=e.reuseWorkers),e.onDebug!==void 0&&(this.onDebug=e.onDebug)}async startJob(e,n=(i,a,l)=>i.done(l),r=(i,a)=>i.error(a)){const i=new Promise(a=>(this.jobQueue.push({name:e,onMessage:n,onError:r,onStart:a}),this));return this._startQueuedJob(),await i}async _startQueuedJob(){if(!this.jobQueue.length)return;const e=this._getAvailableWorker();if(!e)return;const n=this.jobQueue.shift();if(n){this.onDebug({message:"Starting job",name:n.name,workerThread:e,backlog:this.jobQueue.length});const r=new n6(n.name,e);e.onMessage=i=>n.onMessage(r,i.type,i.payload),e.onError=i=>n.onError(r,i),n.onStart(r);try{await r.result}catch(i){console.error(`Worker exception: ${i}`)}finally{this.returnWorkerToQueue(e)}}}returnWorkerToQueue(e){!Po||this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count{}},wa=class wa{constructor(e){M(this,"props");M(this,"workerPools",new Map);this.props={...o6},this.setProps(e),this.workerPools=new Map}static isSupported(){return M0.isSupported()}static getWorkerFarm(e={}){return wa._workerFarm=wa._workerFarm||new wa({}),wa._workerFarm.setProps(e),wa._workerFarm}destroy(){for(const e of this.workerPools.values())e.destroy();this.workerPools=new Map}setProps(e){this.props={...this.props,...e};for(const n of this.workerPools.values())n.setProps(this._getWorkerPoolProps())}getWorkerPool(e){const{name:n,source:r,url:i}=e;let a=this.workerPools.get(n);return a||(a=new a6({name:n,source:r,url:i}),a.setProps(this._getWorkerPoolProps()),this.workerPools.set(n,a)),a}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}};M(wa,"_workerFarm");let Vh=wa;function l6(t,e={}){const n=e[t.id]||{},r=Po?`${t.id}-worker.js`:`${t.id}-worker-node.js`;let i=n.workerUrl;if(!i&&t.id==="compression"&&(i=e.workerUrl),e._workerType==="test"&&(Po?i=`modules/${t.module}/dist/${r}`:i=`modules/${t.module}/src/workers/${t.id}-worker-node.ts`),!i){let a=t.version;a==="latest"&&(a=GI);const l=a?`@${a}`:"";i=`https://unpkg.com/@loaders.gl/${t.module}${l}/dist/${r}`}return La(i),i}function c6(t,e=e6){La(t,"no worker provided");const n=t.version;return!(!e||!n)}function u6(t,e){return!Vh.isSupported()||!Po&&!(e!=null&&e._nodeWorkers)?!1:t.worker&&(e==null?void 0:e.worker)}async function f6(t,e,n,r,i){const a=t.id,l=l6(t,n),f=Vh.getWorkerFarm(n).getWorkerPool({name:a,url:l});n=JSON.parse(JSON.stringify(n)),r=JSON.parse(JSON.stringify(r||{}));const h=await f.startJob("process-on-worker",d6.bind(null,i));return h.postMessage("process",{input:e,options:n,context:r}),await(await h.result).result}async function d6(t,e,n,r){switch(n){case"done":e.done(r);break;case"error":e.error(new Error(r.error));break;case"process":const{id:i,input:a,options:l}=r;try{const u=await t(a,l);e.postMessage("done",{id:i,result:u})}catch(u){const f=u instanceof Error?u.message:"unknown error";e.postMessage("error",{id:i,error:f})}break;default:console.warn(`parse-with-worker unknown message ${n}`)}}function h6(t,e,n){if(n=n||t.byteLength,t.byteLengtha instanceof ArrayBuffer?new Uint8Array(a):a),n=e.reduce((a,l)=>a+l.byteLength,0),r=new Uint8Array(n);let i=0;for(const a of e)r.set(a,i),i+=a.byteLength;return r.buffer}async function m6(t){const e=[];for await(const n of t)e.push(n);return g6(...e)}function pw(){let t;if(typeof window<"u"&&window.performance)t=window.performance.now();else if(typeof process<"u"&&process.hrtime){const e=process.hrtime();t=e[0]*1e3+e[1]/1e6}else t=Date.now();return t}class mw{constructor(e,n){this.sampleSize=1,this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this.name=e,this.type=n,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(e){return this.sampleSize=e,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(e){return this._count+=e,this._samples++,this._checkSampling(),this}subtractCount(e){return this._count-=e,this._samples++,this._checkSampling(),this}addTime(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=pw(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(pw()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}class Xg{constructor(e){this.stats={},this.id=e.id,this.stats={},this._initializeStats(e.stats),Object.seal(this)}get(e,n="count"){return this._getOrCreate({name:e,type:n})}get size(){return Object.keys(this.stats).length}reset(){for(const e of Object.values(this.stats))e.reset();return this}forEach(e){for(const n of Object.values(this.stats))e(n)}getTable(){const e={};return this.forEach(n=>{e[n.name]={time:n.time||0,count:n.count||0,average:n.getAverageTime()||0,hz:n.getHz()||0}}),e}_initializeStats(e=[]){e.forEach(n=>this._getOrCreate(n))}_getOrCreate(e){const{name:n,type:r}=e;let i=this.stats[n];return i||(e instanceof mw?i=e:i=new mw(n,r),this.stats[n]=i),i}}let v6="";const vw={};function _6(t){for(const e in vw)if(t.startsWith(e)){const n=vw[e];t=t.replace(e,n)}return!t.startsWith("http://")&&!t.startsWith("https://")&&(t=`${v6}${t}`),t}function y6(t){return t&&typeof t=="object"&&t.isBuffer}function iR(t){if(y6(t))return t;if(t instanceof ArrayBuffer)return t;if(ArrayBuffer.isView(t))return t.byteOffset===0&&t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);if(typeof t=="string"){const e=t;return new TextEncoder().encode(e).buffer}if(t&&typeof t=="object"&&t._toArrayBuffer)return t._toArrayBuffer();throw new Error("toArrayBuffer")}function sR(t){const e=t?t.lastIndexOf("/"):-1;return e>=0?t.substr(e+1):""}function b6(t){const e=t?t.lastIndexOf("/"):-1;return e>=0?t.substr(0,e):""}const S6=t=>typeof t=="boolean",Qu=t=>typeof t=="function",zf=t=>t!==null&&typeof t=="object",_w=t=>zf(t)&&t.constructor==={}.constructor,E6=t=>!!t&&typeof t[Symbol.iterator]=="function",w6=t=>t&&typeof t[Symbol.asyncIterator]=="function",jo=t=>typeof Response<"u"&&t instanceof Response||t&&t.arrayBuffer&&t.text&&t.json,Wo=t=>typeof Blob<"u"&&t instanceof Blob,T6=t=>t&&typeof t=="object"&&t.isBuffer,C6=t=>typeof ReadableStream<"u"&&t instanceof ReadableStream||zf(t)&&Qu(t.tee)&&Qu(t.cancel)&&Qu(t.getReader),A6=t=>zf(t)&&Qu(t.read)&&Qu(t.pipe)&&S6(t.readable),aR=t=>C6(t)||A6(t);class R6 extends Error{constructor(n,r){super(n);M(this,"reason");M(this,"url");M(this,"response");this.reason=r.reason,this.url=r.url,this.response=r.response}}const x6=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,M6=/^([-\w.]+\/[-\w.+]+)/;function yw(t,e){return t.toLowerCase()===e.toLowerCase()}function O6(t){const e=M6.exec(t);return e?e[1]:t}function bw(t){const e=x6.exec(t);return e?e[1]:""}const oR=/\?.*/;function P6(t){const e=t.match(oR);return e&&e[0]}function Ry(t){return t.replace(oR,"")}function N6(t){if(t.length<50)return t;const e=t.slice(t.length-15);return`${t.substr(0,32)}...${e}`}function qg(t){return jo(t)?t.url:Wo(t)?t.name||"":typeof t=="string"?t:""}function xy(t){if(jo(t)){const e=t,n=e.headers.get("content-type")||"",r=Ry(e.url);return O6(n)||bw(r)}return Wo(t)?t.type||"":typeof t=="string"?bw(t):""}function I6(t){return jo(t)?t.headers["content-length"]||-1:Wo(t)?t.size:typeof t=="string"?t.length:t instanceof ArrayBuffer||ArrayBuffer.isView(t)?t.byteLength:-1}async function lR(t){if(jo(t))return t;const e={},n=I6(t);n>=0&&(e["content-length"]=String(n));const r=qg(t),i=xy(t);i&&(e["content-type"]=i);const a=await k6(t);a&&(e["x-first-bytes"]=a),typeof t=="string"&&(t=new TextEncoder().encode(t));const l=new Response(t,{headers:e});return Object.defineProperty(l,"url",{value:r}),l}async function D6(t){if(!t.ok)throw await F6(t)}async function F6(t){const e=N6(t.url);let n=`Failed to fetch resource (${t.status}) ${t.statusText}: ${e}`;n=n.length>100?`${n.slice(0,100)}...`:n;const r={reason:t.statusText,url:t.url,response:t};try{const i=t.headers.get("Content-Type");r.reason=!t.bodyUsed&&(i!=null&&i.includes("application/json"))?await t.json():await t.text()}catch{}return new R6(n,r)}async function k6(t){if(typeof t=="string")return`data:,${t.slice(0,5)}`;if(t instanceof Blob){const n=t.slice(0,5);return await new Promise(r=>{const i=new FileReader;i.onload=a=>{var l;return r((l=a==null?void 0:a.target)==null?void 0:l.result)},i.readAsDataURL(n)})}if(t instanceof ArrayBuffer){const n=t.slice(0,5);return`data:base64,${B6(n)}`}return null}function B6(t){let e="";const n=new Uint8Array(t);for(let r=0;r{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}class V6{constructor(){M(this,"console");this.console=console}log(...e){return this.console.log.bind(this.console,...e)}info(...e){return this.console.info.bind(this.console,...e)}warn(...e){return this.console.warn.bind(this.console,...e)}error(...e){return this.console.error.bind(this.console,...e)}}const cR={fetch:null,mimeType:void 0,nothrow:!1,log:new V6,useLocalLibraries:!1,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:Cy,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},H6={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function uR(){globalThis.loaders=globalThis.loaders||{};const{loaders:t}=globalThis;return t._state||(t._state={}),t._state}function fR(){const t=uR();return t.globalOptions=t.globalOptions||{...cR},t.globalOptions}function j6(t,e,n,r){return n=n||[],n=Array.isArray(n)?n:[n],W6(t,n),q6(e,t,r)}function W6(t,e){ww(t,null,cR,H6,e);for(const n of e){const r=t&&t[n.id]||{},i=n.options&&n.options[n.id]||{},a=n.deprecatedOptions&&n.deprecatedOptions[n.id]||{};ww(r,n.id,i,a,e)}}function ww(t,e,n,r,i){const a=e||"Top level",l=e?`${e}.`:"";for(const u in t){const f=!e&&zf(t[u]),h=u==="baseUri"&&!e,g=u==="workerUrl"&&e;if(!(u in n)&&!h&&!g){if(u in r)Ew.warn(`${a} loader option '${l}${u}' no longer supported, use '${r[u]}'`)();else if(!f){const m=X6(u,i);Ew.warn(`${a} loader option '${l}${u}' not recognized. ${m}`)()}}}}function X6(t,e){const n=t.toLowerCase();let r="";for(const i of e)for(const a in i.options){if(t===a)return`Did you mean '${i.id}.${a}'?`;const l=a.toLowerCase();(n.startsWith(l)||l.startsWith(n))&&(r=r||`Did you mean '${i.id}.${a}'?`)}return r}function q6(t,e,n){const i={...t.options||{}};return Y6(i,n),i.log===null&&(i.log=new $6),Tw(i,fR()),Tw(i,e),i}function Tw(t,e){for(const n in e)if(n in e){const r=e[n];_w(r)&&_w(t[n])?t[n]={...t[n],...e[n]}:t[n]=e[n]}}function Y6(t,e){e&&!("baseUri"in t)&&(t.baseUri=e)}function My(t){return t?(Array.isArray(t)&&(t=t[0]),Array.isArray(t==null?void 0:t.extensions)):!1}function Oy(t){zh(t,"null loader"),zh(My(t),"invalid loader");let e;return Array.isArray(t)&&(e=t[1],t=t[0],t={...t,options:{...t.options,...e}}),(t!=null&&t.parseTextSync||t!=null&&t.parseText)&&(t.text=!0),t.text||(t.binary=!0),t}const dR=()=>{const t=uR();return t.loaderRegistry=t.loaderRegistry||[],t.loaderRegistry};function K6(t){const e=dR();t=Array.isArray(t)?t:[t];for(const n of t){const r=Oy(n);e.find(i=>r===i)||e.unshift(r)}}function Z6(){return dR()}const Q6=/\.([^.]+)$/;async function G6(t,e=[],n,r){if(!hR(t))return null;let i=Cw(t,e,{...n,nothrow:!0},r);if(i)return i;if(Wo(t)&&(t=await t.slice(0,10).arrayBuffer(),i=Cw(t,e,n,r)),!i&&!(n!=null&&n.nothrow))throw new Error(gR(t));return i}function Cw(t,e=[],n,r){if(!hR(t))return null;if(e&&!Array.isArray(e))return Oy(e);let i=[];e&&(i=i.concat(e)),n!=null&&n.ignoreRegisteredLoaders||i.push(...Z6()),eD(i);const a=J6(t,i,n,r);if(!a&&!(n!=null&&n.nothrow))throw new Error(gR(t));return a}function J6(t,e,n,r){const i=qg(t),a=xy(t),l=Ry(i)||(r==null?void 0:r.url);let u=null,f="";return n!=null&&n.mimeType&&(u=_v(e,n==null?void 0:n.mimeType),f=`match forced by supplied MIME type ${n==null?void 0:n.mimeType}`),u=u||tD(e,l),f=f||(u?`matched url ${l}`:""),u=u||_v(e,a),f=f||(u?`matched MIME type ${a}`:""),u=u||rD(e,t),f=f||(u?`matched initial data ${pR(t)}`:""),n!=null&&n.fallbackMimeType&&(u=u||_v(e,n==null?void 0:n.fallbackMimeType),f=f||(u?`matched fallback MIME type ${a}`:"")),f&&ZI.log(1,`selectLoader selected ${u==null?void 0:u.name}: ${f}.`),u}function hR(t){return!(t instanceof Response&&t.status===204)}function gR(t){const e=qg(t),n=xy(t);let r="No valid loader found (";r+=e?`${sR(e)}, `:"no url provided, ",r+=`MIME type: ${n?`"${n}"`:"not provided"}, `;const i=t?pR(t):"";return r+=i?` first bytes: "${i}"`:"first bytes: not available",r+=")",r}function eD(t){for(const e of t)Oy(e)}function tD(t,e){const n=e&&Q6.exec(e),r=n&&n[1];return r?nD(t,r):null}function nD(t,e){e=e.toLowerCase();for(const n of t)for(const r of n.extensions)if(r.toLowerCase()===e)return n;return null}function _v(t,e){var n;for(const r of t)if((n=r.mimeTypes)!=null&&n.some(i=>yw(e,i))||yw(e,`application/x.${r.id}`))return r;return null}function rD(t,e){if(!e)return null;for(const n of t)if(typeof e=="string"){if(iD(e,n))return n}else if(ArrayBuffer.isView(e)){if(Aw(e.buffer,e.byteOffset,n))return n}else if(e instanceof ArrayBuffer&&Aw(e,0,n))return n;return null}function iD(t,e){return e.testText?e.testText(t):(Array.isArray(e.tests)?e.tests:[e.tests]).some(r=>t.startsWith(r))}function Aw(t,e,n){return(Array.isArray(n.tests)?n.tests:[n.tests]).some(i=>sD(t,e,n,i))}function sD(t,e,n,r){if(r instanceof ArrayBuffer)return h6(r,t,r.byteLength);switch(typeof r){case"function":return r(t);case"string":const i=O0(t,e,r.length);return r===i;default:return!1}}function pR(t,e=5){return typeof t=="string"?t.slice(0,e):ArrayBuffer.isView(t)?O0(t.buffer,t.byteOffset,e):t instanceof ArrayBuffer?O0(t,0,e):""}function O0(t,e,n){if(t.byteLengthSw(i,r.fetch):e!=null&&e.fetch?e==null?void 0:e.fetch:Sw}function vD(t,e,n){if(n)return n;const r={fetch:vR(e,t),...t};if(r.url){const i=Ry(r.url);r.baseUrl=i,r.queryString=P6(r.url),r.filename=sR(i),r.baseUrl=b6(i)}return Array.isArray(r.loaders)||(r.loaders=null),r}function _D(t,e){if(t&&!Array.isArray(t))return t;let n;if(t&&(n=Array.isArray(t)?t:[t]),e&&e.loaders){const r=Array.isArray(e.loaders)?e.loaders:[e.loaders];n=n?[...n,...r]:r}return n&&n.length?n:void 0}async function Hh(t,e,n,r){e&&!Array.isArray(e)&&!My(e)&&(r=void 0,n=e,e=void 0),t=await t,n=n||{};const i=qg(t),l=_D(e,r),u=await G6(t,l,n);return u?(n=j6(n,u,l,i),r=vD({url:i,_parse:Hh,loaders:l},n,r||null),await yD(u,t,n,r)):null}async function yD(t,e,n,r){if(c6(t),n=QI(t.options,n),jo(e)){const a=e,{ok:l,redirected:u,status:f,statusText:h,type:g,url:m}=a,v=Object.fromEntries(a.headers.entries());r.response={headers:v,ok:l,redirected:u,status:f,statusText:h,type:g,url:m}}e=await mD(e,t,n);const i=t;if(i.parseTextSync&&typeof e=="string")return i.parseTextSync(e,n,r);if(u6(t,n))return await f6(t,e,n,r,Hh);if(i.parseText&&typeof e=="string")return await i.parseText(e,n,r);if(i.parse)return await i.parse(e,n,r);throw La(!i.parseSync),new Error(`${t.id} loader - no parser found and worker is disabled`)}const xw=100;class bD{constructor(e,n){M(this,"schema");M(this,"options");M(this,"shape");M(this,"length",0);M(this,"rows",null);M(this,"cursor",0);M(this,"_headers",[]);if(this.options=n,this.schema=e,!Array.isArray(e)){this._headers=[];for(const r in e)this._headers[e[r].index]=e[r].name}}rowCount(){return this.length}addArrayRow(e,n){Number.isFinite(n)&&(this.cursor=n),this.shape="array-row-table",this.rows=this.rows||new Array(xw),this.rows[this.length]=e,this.length++}addObjectRow(e,n){Number.isFinite(n)&&(this.cursor=n),this.shape="object-row-table",this.rows=this.rows||new Array(xw),this.rows[this.length]=e,this.length++}getBatch(){let e=this.rows;return e?(e=e.slice(0,this.length),this.rows=null,{shape:this.shape||"array-row-table",batchType:"data",data:e,length:this.length,schema:this.schema,cursor:this.cursor}):null}}function _R(t,e){if(!t)throw new Error("null row");const n={};if(e)for(let r=0;r0?this.allocated*=2:TD,this.columns={};for(const e in this.schema){const n=this.schema[e],r=n.type||Float32Array,i=this.columns[n.index];if(i&&ArrayBuffer.isView(i)){const a=new r(this.allocated);a.set(i),this.columns[n.index]=a}else i?(i.length=this.allocated,this.columns[n.index]=i):this.columns[n.index]=new r(this.allocated)}}}_pruneColumns(){for(const[e,n]of Object.entries(this.columns))this.columns[e]=n.slice(0,this.length)}}const AD={shape:void 0,batchSize:"auto",batchDebounceMs:0,limit:0,_limitMB:0},RD="TableBatchBuilder",cf=class cf{constructor(e,n){M(this,"schema");M(this,"options");M(this,"aggregator",null);M(this,"batchCount",0);M(this,"bytesUsed",0);M(this,"isChunkComplete",!1);M(this,"lastBatchEmittedMs",Date.now());M(this,"totalLength",0);M(this,"totalBytes",0);M(this,"rowBytes",0);this.schema=e,this.options={...AD,...n}}limitReached(){var e,n;return!!((e=this.options)!=null&&e.limit&&this.totalLength>=this.options.limit||(n=this.options)!=null&&n._limitMB&&this.totalBytes/1e6>=this.options._limitMB)}addRow(e){this.limitReached()||(this.totalLength++,this.rowBytes=this.rowBytes||this._estimateRowMB(e),this.totalBytes+=this.rowBytes,Array.isArray(e)?this.addArrayRow(e):this.addObjectRow(e))}addArrayRow(e){if(!this.aggregator){const n=this._getTableBatchType();this.aggregator=new n(this.schema,this.options)}this.aggregator.addArrayRow(e)}addObjectRow(e){if(!this.aggregator){const n=this._getTableBatchType();this.aggregator=new n(this.schema,this.options)}this.aggregator.addObjectRow(e)}chunkComplete(e){e instanceof ArrayBuffer&&(this.bytesUsed+=e.byteLength),typeof e=="string"&&(this.bytesUsed+=e.length),this.isChunkComplete=!0}getFullBatch(e){return this._isFull()?this._getBatch(e):null}getFinalBatch(e){return this._getBatch(e)}_estimateRowMB(e){return Array.isArray(e)?e.length*8:Object.keys(e).length*8}_isFull(){if(!this.aggregator||this.aggregator.rowCount()===0)return!1;if(this.options.batchSize==="auto"){if(!this.isChunkComplete)return!1}else if(this.options.batchSize>this.aggregator.rowCount())return!1;return this.options.batchDebounceMs>Date.now()-this.lastBatchEmittedMs?!1:(this.isChunkComplete=!1,this.lastBatchEmittedMs=Date.now(),!0)}_getBatch(e){if(!this.aggregator)return null;e!=null&&e.bytesUsed&&(this.bytesUsed=e.bytesUsed);const n=this.aggregator.getBatch();return n.count=this.batchCount,n.bytesUsed=this.bytesUsed,Object.assign(n,e),this.batchCount++,this.aggregator=null,n}_getTableBatchType(){switch(this.options.shape){case"array-row-table":case"object-row-table":return wD;case"columnar-table":return CD;case"arrow-table":if(!cf.ArrowBatch)throw new Error(RD);return cf.ArrowBatch;default:return bD}}};M(cf,"ArrowBatch");let P0=cf;class Ow extends Array{enqueue(e){return this.push(e)}dequeue(){return this.shift()}}class xD{constructor(){M(this,"_values");M(this,"_settlers");M(this,"_closed");this._values=new Ow,this._settlers=new Ow,this._closed=!1}close(){for(;this._settlers.length>0;)this._settlers.dequeue().resolve({done:!0});this._closed=!0}[Symbol.asyncIterator](){return this}enqueue(e){if(this._closed)throw new Error("Closed");if(this._settlers.length>0){if(this._values.length>0)throw new Error("Illegal internal state");const n=this._settlers.dequeue();e instanceof Error?n.reject(e):n.resolve({value:e})}else this._values.enqueue(e)}next(){if(this._values.length>0){const e=this._values.dequeue();return e instanceof Error?Promise.reject(e):Promise.resolve({value:e})}if(this._closed){if(this._settlers.length>0)throw new Error("Illegal internal state");return Promise.resolve({done:!0})}return new Promise((e,n)=>{this._settlers.enqueue({resolve:e,reject:n})})}}async function jh(t,e,n,r){let i,a;!Array.isArray(e)&&!My(e)?(i=[],a=e):(i=e,a=n);const l=vR(a);let u=t;return typeof t=="string"&&(u=await l(t)),Wo(t)&&(u=await l(t)),Array.isArray(i)?await Hh(u,i,a):await Hh(u,i,a)}/* @license -Papa Parse -v5.0.0-beta.0 -https://github.com/mholt/PapaParse -License: MIT -*/const Pw="\uFEFF";function MD(t,e={},n=PD){e=e||{};var r=e.dynamicTyping||!1;Zi(r)&&(e.dynamicTypingFunction=r,r={}),e.dynamicTyping=r,e.transform=Zi(e.transform)?e.transform:!1;var i=new n(e);return i.stream(t)}function OD(t,e){var n=!1,r=!0,i=",",a=`\r -`,l='"',u=l+l,f=!1,h=null;m();var g=new RegExp(gf(l),"g");if(typeof t=="string"&&(t=JSON.parse(t)),Array.isArray(t)){if(!t.length||Array.isArray(t[0]))return v(null,t,f);if(typeof t[0]=="object")return v(h||Object.keys(t[0]),t,f)}else if(typeof t=="object")return typeof t.data=="string"&&(t.data=JSON.parse(t.data)),Array.isArray(t.data)&&(t.fields||(t.fields=t.meta&&t.meta.fields),t.fields||(t.fields=Array.isArray(t.data[0])?t.fields:Object.keys(t.data[0])),!Array.isArray(t.data[0])&&typeof t.data[0]!="object"&&(t.data=[t.data])),v(t.fields||[],t.data||[],f);throw new Error("Unable to serialize unrecognized input");function m(){if(typeof e=="object"){if(typeof e.delimiter=="string"&&!Mi.BAD_DELIMITERS.filter(function(E){return e.delimiter.indexOf(E)!==-1}).length&&(i=e.delimiter),(typeof e.quotes=="boolean"||Array.isArray(e.quotes))&&(n=e.quotes),(typeof e.skipEmptyLines=="boolean"||typeof e.skipEmptyLines=="string")&&(f=e.skipEmptyLines),typeof e.newline=="string"&&(a=e.newline),typeof e.quoteChar=="string"&&(l=e.quoteChar),typeof e.header=="boolean"&&(r=e.header),Array.isArray(e.columns)){if(e.columns.length===0)throw new Error("Option columns is empty");h=e.columns}e.escapeChar!==void 0&&(u=e.escapeChar+l)}}function v(E,b,C){var T="";typeof E=="string"&&(E=JSON.parse(E)),typeof b=="string"&&(b=JSON.parse(b));var A=Array.isArray(E)&&E.length>0,O=!Array.isArray(b[0]);if(A&&r){for(var x=0;x0&&(T+=i),T+=S(E[x],x);b.length>0&&(T+=a)}for(var N=0;N0&&!D&&(T+=i);var Y=A&&O?E[X]:X;T+=S(b[N][Y],X)}N0&&!D)&&(T+=a)}}return T}function S(E,b){if(typeof E>"u"||E===null)return"";if(E.constructor===Date)return JSON.stringify(E).slice(1,25);E=E.toString().replace(g,u);var C=typeof n=="boolean"&&n||Array.isArray(n)&&n[b]||w(E,Mi.BAD_DELIMITERS)||E.indexOf(i)>-1||E.charAt(0)===" "||E.charAt(E.length-1)===" ";return C?l+E+l:E}function w(E,b){for(var C=0;C-1)return!0;return!1}}let bR=class{constructor(e){M(this,"_handle");M(this,"_config");M(this,"_finished",!1);M(this,"_completed",!1);M(this,"_input",null);M(this,"_baseIndex",0);M(this,"_partialLine","");M(this,"_rowCount",0);M(this,"_start",0);M(this,"isFirstChunk",!0);M(this,"_completeResults",{data:[],errors:[],meta:{}});var n={...e};n.chunkSize=parseInt(n.chunkSize),!e.step&&!e.chunk&&(n.chunkSize=null),this._handle=new SR(n),this._handle.streamer=this,this._config=n}parseChunk(e,n){if(this.isFirstChunk&&Zi(this._config.beforeFirstChunk)){var r=this._config.beforeFirstChunk(e);r!==void 0&&(e=r)}this.isFirstChunk=!1;var i=this._partialLine+e;this._partialLine="";var a=this._handle.parse(i,this._baseIndex,!this._finished);if(!(this._handle.paused()||this._handle.aborted())){var l=a.meta.cursor;this._finished||(this._partialLine=i.substring(l-this._baseIndex),this._baseIndex=l),a&&a.data&&(this._rowCount+=a.data.length);var u=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(Zi(this._config.chunk)&&!n){if(this._config.chunk(a,this._handle),this._handle.paused()||this._handle.aborted())return;a=void 0,this._completeResults=void 0}return!this._config.step&&!this._config.chunk&&(this._completeResults.data=this._completeResults.data.concat(a.data),this._completeResults.errors=this._completeResults.errors.concat(a.errors),this._completeResults.meta=a.meta),!this._completed&&u&&Zi(this._config.complete)&&(!a||!a.meta.aborted)&&(this._config.complete(this._completeResults,this._input),this._completed=!0),a}}_sendError(e){Zi(this._config.error)&&this._config.error(e)}};class PD extends bR{constructor(n={}){super(n);M(this,"remaining")}stream(n){return this.remaining=n,this._nextChunk()}_nextChunk(){if(!this._finished){var n=this._config.chunkSize,r=n?this.remaining.substr(0,n):this.remaining;return this.remaining=n?this.remaining.substr(n):"",this._finished=!this.remaining,this.parseChunk(r)}}}const ND=/^\s*-?(\d*\.?\d+|\d+\.?\d*)(e[-+]?\d+)?\s*$/i,ID=/(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/;class SR{constructor(e){M(this,"_config");M(this,"_stepCounter",0);M(this,"_rowCounter",0);M(this,"_input");M(this,"_parser");M(this,"_paused",!1);M(this,"_aborted",!1);M(this,"_delimiterError",!1);M(this,"_fields",[]);M(this,"_results",{data:[],errors:[],meta:{}});if(Zi(e.step)){var n=e.step;e.step=r=>{if(this._results=r,this.needsHeaderRow())this.processResults();else{if(this.processResults(),!this._results.data||this._results.data.length===0)return;this._stepCounter+=r.data.length,e.preview&&this._stepCounter>e.preview?this._parser.abort():n(this._results,this)}}}this._config=e}parse(e,n,r){var i=this._config.quoteChar||'"';if(this._config.newline||(this._config.newline=DD(e,i)),this._delimiterError=!1,this._config.delimiter)Zi(this._config.delimiter)&&(this._config.delimiter=this._config.delimiter(e),this._results.meta.delimiter=this._config.delimiter);else{var a=this.guessDelimiter(e,this._config.newline,this._config.skipEmptyLines,this._config.comments,this._config.delimitersToGuess);a.successful?this._config.delimiter=a.bestDelimiter:(this._delimiterError=!0,this._config.delimiter=Mi.DefaultDelimiter),this._results.meta.delimiter=this._config.delimiter}var l=ER(this._config);return this._config.preview&&this._config.header&&l.preview++,this._input=e,this._parser=new N0(l),this._results=this._parser.parse(this._input,n,r),this.processResults(),this._paused?{meta:{paused:!0}}:this._results||{meta:{paused:!1}}}paused(){return this._paused}pause(){this._paused=!0,this._parser.abort(),this._input=this._input.substr(this._parser.getCharIndex())}resume(){this._paused=!1,this.streamer.parseChunk(this._input,!0)}aborted(){return this._aborted}abort(){this._aborted=!0,this._parser.abort(),this._results.meta.aborted=!0,Zi(this._config.complete)&&this._config.complete(this._results),this._input=""}testEmptyLine(e){return this._config.skipEmptyLines==="greedy"?e.join("").trim()==="":e.length===1&&e[0].length===0}processResults(){if(this._results&&this._delimiterError&&(this.addError("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+Mi.DefaultDelimiter+"'"),this._delimiterError=!1),this._config.skipEmptyLines)for(var e=0;e{Zi(this._config.transformHeader)&&(r=this._config.transformHeader(r)),this._fields.push(r)};if(Array.isArray(this._results.data[0])){for(var n=0;this.needsHeaderRow()&&n=this._fields.length?"__parsed_extra":this._fields[i]),this._config.transform&&(l=this._config.transform(l,a)),l=this.parseDynamic(a,l),a==="__parsed_extra"?(r[a]=r[a]||[],r[a].push(l)):r[a]=l}return this._config.header&&(i>this._fields.length?this.addError("FieldMismatch","TooManyFields","Too many fields: expected "+this._fields.length+" fields but parsed "+i,this._rowCounter+n):i"u"){f=0;continue}else b>1&&(m+=Math.abs(b-f),f=b)}w.data.length>0&&(v/=w.data.length-S),(typeof u>"u"||m>u)&&v>1.99&&(u=m,l=g)}return this._config.delimiter=l,{successful:!!l,bestDelimiter:l}}addError(e,n,r,i){this._results.errors.push({type:e,code:n,message:r,row:i})}}function DD(t,e){t=t.substr(0,1024*1024);var n=new RegExp(gf(e)+"([^]*?)"+gf(e),"gm");t=t.replace(n,"");var r=t.split("\r"),i=t.split(` -`),a=i.length>1&&i[0].length=r.length/2?`\r -`:"\r"}function gf(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function N0(t){t=t||{};var e=t.delimiter,n=t.newline,r=t.comments,i=t.step,a=t.preview,l=t.fastMode,u;t.quoteChar===void 0?u='"':u=t.quoteChar;var f=u;if(t.escapeChar!==void 0&&(f=t.escapeChar),(typeof e!="string"||Mi.BAD_DELIMITERS.indexOf(e)>-1)&&(e=","),r===e)throw new Error("Comment character same as delimiter");r===!0?r="#":(typeof r!="string"||Mi.BAD_DELIMITERS.indexOf(r)>-1)&&(r=!1),n!==` -`&&n!=="\r"&&n!==`\r -`&&(n=` -`);var h=0,g=!1;this.parse=function(m,v,S){if(typeof m!="string")throw new Error("Input must be a string");var w=m.length,E=e.length,b=n.length,C=r.length,T=Zi(i);h=0;var A=[],O=[],x=[],N=0;if(!m)return $();if(l||l!==!1&&m.indexOf(u)===-1){for(var F=m.split(n),L=0;L=a)return A=A.slice(0,a),$(!0)}}return $()}for(var D=m.indexOf(e,h),V=m.indexOf(n,h),B=new RegExp(gf(f)+gf(u),"g"),W;;){if(m[h]===u){for(W=h,h++;;){if(W=m.indexOf(u,W+1),W===-1)return S||O.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:A.length,index:h}),Z();if(W===w-1){var X=m.substring(h,W).replace(B,u);return Z(X)}if(u===f&&m[W+1]===f){W++;continue}if(!(u!==f&&W!==0&&m[W-1]===f)){var Y=V===-1?D:Math.min(D,V),ae=j(Y);if(m[W+1+ae]===e){if(x.push(m.substring(h,W).replace(B,u)),h=W+1+ae+E,D=m.indexOf(e,h),V=m.indexOf(n,h),T&&(ie(),g))return $();if(a&&A.length>=a)return $(!0);break}var U=j(V);if(m.substr(W+1+U,b)===n){if(x.push(m.substring(h,W).replace(B,u)),P(W+1+U+b),D=m.indexOf(e,h),T&&(ie(),g))return $();if(a&&A.length>=a)return $(!0);break}O.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:A.length,index:h}),W++}}if(T&&(ie(),g))return $();if(a&&A.length>=a)return $(!0);continue}if(r&&x.length===0&&m.substr(h,C)===r){if(V===-1)return $();h=V+b,V=m.indexOf(n,h),D=m.indexOf(e,h);continue}if(D!==-1&&(D=a)return $(!0);continue}break}return Z();function z(se){A.push(se),N=h}function j(se){var q=0;if(se!==-1){var ce=m.substring(W+1,se);ce&&ce.trim()===""&&(q=ce.length)}return q}function Z(se){return S||(typeof se>"u"&&(se=m.substr(h)),x.push(se),h=w,z(x),T&&ie()),$()}function P(se){h=se,z(x),x=[],V=m.indexOf(n,h)}function $(se,q){var ce=q||!1;return{data:ce?A[0]:A,errors:O,meta:{delimiter:e,linebreak:n,aborted:g,truncated:!!se,cursor:N+(v||0)}}}function ie(){i($(void 0,!0)),A=[],O=[]}},this.abort=function(){g=!0},this.getCharIndex=function(){return h}}function ER(t){if(typeof t!="object"||t===null)return t;var e=Array.isArray(t)?[]:{};for(var n in t)e[n]=ER(t[n]);return e}function Zi(t){return typeof t=="function"}const Mi={parse:MD,unparse:OD,RECORD_SEP:"",UNIT_SEP:"",BYTE_ORDER_MARK:Pw,BAD_DELIMITERS:["\r",` -`,'"',Pw],WORKERS_SUPPORTED:!1,NODE_STREAM_INPUT:1,LocalChunkSize:1024*1024*10,RemoteChunkSize:1024*1024*5,DefaultDelimiter:",",Parser:N0,ParserHandle:SR,ChunkStreamer:bR},{ChunkStreamer:FD}=Mi;class kD extends FD{constructor(n={}){super(n);M(this,"textDecoder",new TextDecoder(this._config.encoding))}async stream(n){this._input=n;try{for await(const r of n)this.parseChunk(this.getStringChunk(r));this._finished=!0,this.parseChunk("")}catch(r){this._sendError(r)}}_nextChunk(){}getStringChunk(n){return typeof n=="string"?n:this.textDecoder.decode(n,{stream:!0})}}const BD="4.3.2",Py="object-row-table",Ny={dataType:null,batchType:null,id:"csv",module:"csv",name:"CSV",version:BD,extensions:["csv","tsv","dsv"],mimeTypes:["text/csv","text/tab-separated-values","text/dsv"],category:"table",parse:async(t,e)=>Nw(new TextDecoder().decode(t),e),parseText:(t,e)=>Nw(t,e),parseInBatches:UD,options:{csv:{shape:Py,optimizeMemoryUsage:!1,header:"auto",columnPrefix:"column",quoteChar:'"',escapeChar:'"',dynamicTyping:!0,comments:!1,skipEmptyLines:!0,delimitersToGuess:[","," ","|",";"]}}};async function Nw(t,e){const n={...Ny.options.csv,...e==null?void 0:e.csv},r=LD(t),a=n.header==="auto"?wR(r):!!n.header,l={...n,header:a,download:!1,transformHeader:a?TR():void 0,error:m=>{throw new Error(m)}},u=Mi.parse(t,l),f=u.data,h=u.meta.fields||CR(n.columnPrefix,r.length),g=n.shape||Py;switch(g){case"object-row-table":return{shape:"object-row-table",data:f.map(m=>Array.isArray(m)?_R(m,h):m)};case"array-row-table":return{shape:"array-row-table",data:f.map(m=>Array.isArray(m)?m:yR(m,h))};default:throw new Error(g)}}function UD(t,e){e={...e},e.batchSize==="auto"&&(e.batchSize=4e3);const n={...Ny.options.csv,...e==null?void 0:e.csv},r=new xD;let i=!0,a=null,l=null,u=null;const f={...n,header:!1,download:!1,chunkSize:1024*1024*5,skipEmptyLines:!1,step(h){let g=h.data;if(n.skipEmptyLines&&g.flat().join("").trim()==="")return;const m=h.meta.cursor;if(i&&!a&&(n.header==="auto"?wR(g):!!n.header)){a=g.map(TR());return}i&&(i=!1,a||(a=CR(n.columnPrefix,g.length)),u=zD(g,a)),n.optimizeMemoryUsage&&(g=JSON.parse(JSON.stringify(g)));const v=n.shape||Py;l=l||new P0(u,{shape:v,...e});try{l.addRow(g);const S=l&&l.getFullBatch({bytesUsed:m});S&&r.enqueue(S)}catch(S){r.enqueue(S)}},complete(h){try{const g=h.meta.cursor,m=l&&l.getFinalBatch({bytesUsed:g});m&&r.enqueue(m)}catch(g){r.enqueue(g)}r.close()}};return Mi.parse(t,f,kD),r}function wR(t){return t&&t.every(e=>typeof e=="string")}function LD(t){return Mi.parse(t,{dynamicTyping:!0,preview:1}).data[0]}function TR(){const t=new Set;return e=>{let n=e,r=1;for(;t.has(n);)n=`${e}.${r}`,r++;return t.add(n),n}}function CR(t,e=0){const n=[];for(let r=0;r1&&arguments[1]!==void 0?arguments[1]:{},n=[];return Ft.Children.forEach(t,function(r){r==null&&!e.keepEmpty||(Array.isArray(r)?n=n.concat(Lo(r)):AR(r)&&r.props?n=n.concat(Lo(r.props.children,e)):n.push(r))}),n}var I0={},XD=function(e){};function qD(t,e){}function YD(t,e){}function KD(){I0={}}function RR(t,e,n){!e&&!I0[n]&&(t(!1,n),I0[n]=!0)}function kr(t,e){RR(qD,t,e)}function ZD(t,e){RR(YD,t,e)}kr.preMessage=XD;kr.resetWarned=KD;kr.noteOnce=ZD;function QD(t,e){if(pt(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(pt(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function xR(t){var e=QD(t,"string");return pt(e)=="symbol"?e:e+""}function K(t,e,n){return(e=xR(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Dw(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function J(t){for(var e=1;e=19)return!0;var i=Sv.isMemo(e)?e.type.type:e.type;return!(typeof i=="function"&&!((n=i.prototype)!==null&&n!==void 0&&n.render)&&i.$$typeof!==Sv.ForwardRef||typeof e=="function"&&!((r=e.prototype)!==null&&r!==void 0&&r.render)&&e.$$typeof!==Sv.ForwardRef)};function MR(t){return _.isValidElement(t)&&!AR(t)}var Dy=function(e){if(e&&MR(e)){var n=e;return n.props.propertyIsEnumerable("ref")?n.props.ref:n.ref}return null},D0=_.createContext(null);function n4(t){var e=t.children,n=t.onBatchResize,r=_.useRef(0),i=_.useRef([]),a=_.useContext(D0),l=_.useCallback(function(u,f,h){r.current+=1;var g=r.current;i.current.push({size:u,element:f,data:h}),Promise.resolve().then(function(){g===r.current&&(n==null||n(i.current),i.current=[])}),a==null||a(u,f,h)},[n,a]);return _.createElement(D0.Provider,{value:l},e)}var OR=function(){if(typeof Map<"u")return Map;function t(e,n){var r=-1;return e.some(function(i,a){return i[0]===n?(r=a,!0):!1}),r}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(n){var r=t(this.__entries__,n),i=this.__entries__[r];return i&&i[1]},e.prototype.set=function(n,r){var i=t(this.__entries__,n);~i?this.__entries__[i][1]=r:this.__entries__.push([n,r])},e.prototype.delete=function(n){var r=this.__entries__,i=t(r,n);~i&&r.splice(i,1)},e.prototype.has=function(n){return!!~t(this.__entries__,n)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var i=0,a=this.__entries__;i0},t.prototype.connect_=function(){!F0||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),l4?(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)},t.prototype.disconnect_=function(){!F0||!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)},t.prototype.onTransitionEnd_=function(e){var n=e.propertyName,r=n===void 0?"":n,i=o4.some(function(a){return!!~r.indexOf(a)});i&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),PR=function(t,e){for(var n=0,r=Object.keys(e);n"u"||!(Element instanceof Object))){if(!(e instanceof _c(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(e)||(n.set(e,new v4(e)),this.controller_.addObserver(this),this.controller_.refresh())}},t.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof _c(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(e)&&(n.delete(e),n.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&e.activeObservations_.push(n)})},t.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new _4(r.target,r.broadcastRect())});this.callback_.call(e,n,e),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),IR=typeof WeakMap<"u"?new WeakMap:new OR,DR=function(){function t(e){if(!(this instanceof t))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=c4.getInstance(),r=new y4(e,n,this);IR.set(this,r)}return t}();["observe","unobserve","disconnect"].forEach(function(t){DR.prototype[t]=function(){var e;return(e=IR.get(this))[t].apply(e,arguments)}});var b4=function(){return typeof Wh.ResizeObserver<"u"?Wh.ResizeObserver:DR}(),Na=new Map;function S4(t){t.forEach(function(e){var n,r=e.target;(n=Na.get(r))===null||n===void 0||n.forEach(function(i){return i(r)})})}var FR=new b4(S4);function E4(t,e){Na.has(t)||(Na.set(t,new Set),FR.observe(t)),Na.get(t).add(e)}function w4(t,e){Na.has(t)&&(Na.get(t).delete(e),Na.get(t).size||(FR.unobserve(t),Na.delete(t)))}function xr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Lw(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=Array(e);n1&&arguments[1]!==void 0?arguments[1]:1;zw+=1;var r=zw;function i(a){if(a===0)LR(r),e();else{var l=BR(function(){i(a-1)});By.set(r,l)}}return i(n),r};dr.cancel=function(t){var e=By.get(t);return LR(t),UR(e)};function zR(t){if(Array.isArray(t))return t}function N4(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,a,l,u=[],f=!0,h=!1;try{if(a=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;f=!1}else for(;!(f=(r=a.call(n)).done)&&(u.push(r.value),u.length!==e);f=!0);}catch(g){h=!0,i=g}finally{try{if(!f&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(h)throw i}}return u}}function $R(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function de(t,e){return zR(t)||N4(t,e)||ky(t,e)||$R()}function _f(t){for(var e=0,n,r=0,i=t.length;i>=4;++r,i-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(i){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}function Zr(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function I4(t,e){if(!t)return!1;if(t.contains)return t.contains(e);for(var n=e;n;){if(n===t)return!0;n=n.parentNode}return!1}var $w="data-rc-order",Vw="data-rc-priority",D4="rc-util-key",B0=new Map;function VR(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.mark;return e?e.startsWith("data-")?e:"data-".concat(e):D4}function Jg(t){if(t.attachTo)return t.attachTo;var e=document.querySelector("head");return e||document.body}function F4(t){return t==="queue"?"prependQueue":t?"prepend":"append"}function Uy(t){return Array.from((B0.get(t)||t).children).filter(function(e){return e.tagName==="STYLE"})}function HR(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Zr())return null;var n=e.csp,r=e.prepend,i=e.priority,a=i===void 0?0:i,l=F4(r),u=l==="prependQueue",f=document.createElement("style");f.setAttribute($w,l),u&&a&&f.setAttribute(Vw,"".concat(a)),n!=null&&n.nonce&&(f.nonce=n==null?void 0:n.nonce),f.innerHTML=t;var h=Jg(e),g=h.firstChild;if(r){if(u){var m=(e.styles||Uy(h)).filter(function(v){if(!["prepend","prependQueue"].includes(v.getAttribute($w)))return!1;var S=Number(v.getAttribute(Vw)||0);return a>=S});if(m.length)return h.insertBefore(f,m[m.length-1].nextSibling),f}h.insertBefore(f,g)}else h.appendChild(f);return f}function jR(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=Jg(e);return(e.styles||Uy(n)).find(function(r){return r.getAttribute(VR(e))===t})}function yf(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=jR(t,e);if(n){var r=Jg(e);r.removeChild(n)}}function k4(t,e){var n=B0.get(t);if(!n||!I4(document,n)){var r=HR("",e),i=r.parentNode;B0.set(t,i),t.removeChild(r)}}function Hs(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=Jg(n),i=Uy(r),a=J(J({},n),{},{styles:i});k4(r,a);var l=jR(e,a);if(l){var u,f;if((u=a.csp)!==null&&u!==void 0&&u.nonce&&l.nonce!==((f=a.csp)===null||f===void 0?void 0:f.nonce)){var h;l.nonce=(h=a.csp)===null||h===void 0?void 0:h.nonce}return l.innerHTML!==t&&(l.innerHTML=t),l}var g=HR(t,a);return g.setAttribute(VR(a),e),g}function B4(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}function Fn(t,e){if(t==null)return{};var n,r,i=B4(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r2&&arguments[2]!==void 0?arguments[2]:!1,r=new Set;function i(a,l){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,f=r.has(a);if(kr(!f,"Warning: There may be circular references"),f)return!1;if(a===l)return!0;if(n&&u>1)return!1;r.add(a);var h=u+1;if(Array.isArray(a)){if(!Array.isArray(l)||a.length!==l.length)return!1;for(var g=0;g1&&arguments[1]!==void 0?arguments[1]:!1,l={map:this.cache};return n.forEach(function(u){if(!l)l=void 0;else{var f;l=(f=l)===null||f===void 0||(f=f.map)===null||f===void 0?void 0:f.get(u)}}),(r=l)!==null&&r!==void 0&&r.value&&a&&(l.value[1]=this.cacheCallTimes++),(i=l)===null||i===void 0?void 0:i.value}},{key:"get",value:function(n){var r;return(r=this.internalGet(n,!0))===null||r===void 0?void 0:r[0]}},{key:"has",value:function(n){return!!this.internalGet(n)}},{key:"set",value:function(n,r){var i=this;if(!this.has(n)){if(this.size()+1>t.MAX_CACHE_SIZE+t.MAX_CACHE_OFFSET){var a=this.keys.reduce(function(h,g){var m=de(h,2),v=m[1];return i.internalGet(g)[1]0,void 0),Hw+=1}return Mr(t,[{key:"getDerivativeToken",value:function(n){return this.derivatives.reduce(function(r,i){return i(n,r)},void 0)}}]),t}(),Ev=new Ly;function L0(t){var e=Array.isArray(t)?t:[t];return Ev.has(e)||Ev.set(e,new WR(e)),Ev.get(e)}var V4=new WeakMap,wv={};function H4(t,e){for(var n=V4,r=0;r3&&arguments[3]!==void 0?arguments[3]:{},a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(a)return t;var l=J(J({},i),{},(r={},K(r,yc,e),K(r,Ji,n),r)),u=Object.keys(l).map(function(f){var h=l[f];return h?"".concat(f,'="').concat(h,'"'):null}).filter(function(f){return f}).join(" ");return"")}var xh=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return"--".concat(n?"".concat(n,"-"):"").concat(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z0-9]+)/g,"$1-$2").replace(/([a-z])([A-Z0-9])/g,"$1-$2").toLowerCase()},j4=function(e,n,r){return Object.keys(e).length?".".concat(n).concat(r!=null&&r.scope?".".concat(r.scope):"","{").concat(Object.entries(e).map(function(i){var a=de(i,2),l=a[0],u=a[1];return"".concat(l,":").concat(u,";")}).join(""),"}"):""},XR=function(e,n,r){var i={},a={};return Object.entries(e).forEach(function(l){var u,f,h=de(l,2),g=h[0],m=h[1];if(r!=null&&(u=r.preserve)!==null&&u!==void 0&&u[g])a[g]=m;else if((typeof m=="string"||typeof m=="number")&&!(r!=null&&(f=r.ignore)!==null&&f!==void 0&&f[g])){var v,S=xh(g,r==null?void 0:r.prefix);i[S]=typeof m=="number"&&!(r!=null&&(v=r.unitless)!==null&&v!==void 0&&v[g])?"".concat(m,"px"):String(m),a[g]="var(".concat(S,")")}}),[a,j4(i,n,{scope:r==null?void 0:r.scope})]},Xw=Zr()?_.useLayoutEffect:_.useEffect,Dn=function(e,n){var r=_.useRef(!0);Xw(function(){return e(r.current)},n),Xw(function(){return r.current=!1,function(){r.current=!0}},[])},qw=function(e,n){Dn(function(r){if(!r)return e()},n)},W4=J({},Wg),Yw=W4.useInsertionEffect,X4=function(e,n,r){_.useMemo(e,r),Dn(function(){return n(!0)},r)},q4=Yw?function(t,e,n){return Yw(function(){return t(),e()},n)}:X4,Y4=J({},Wg),K4=Y4.useInsertionEffect,Z4=function(e){var n=[],r=!1;function i(a){r||n.push(a)}return _.useEffect(function(){return r=!1,function(){r=!0,n.length&&n.forEach(function(a){return a()})}},e),i},Q4=function(){return function(e){e()}},G4=typeof K4<"u"?Z4:Q4;function zy(t,e,n,r,i){var a=_.useContext($f),l=a.cache,u=[t].concat(ze(e)),f=U0(u),h=G4([f]),g=function(w){l.opUpdate(f,function(E){var b=E||[void 0,void 0],C=de(b,2),T=C[0],A=T===void 0?0:T,O=C[1],x=O,N=x||n(),F=[A,N];return w?w(F):F})};_.useMemo(function(){g()},[f]);var m=l.opGet(f),v=m[1];return q4(function(){i==null||i(v)},function(S){return g(function(w){var E=de(w,2),b=E[0],C=E[1];return S&&b===0&&(i==null||i(v)),[b+1,C]}),function(){l.opUpdate(f,function(w){var E=w||[],b=de(E,2),C=b[0],T=C===void 0?0:C,A=b[1],O=T-1;return O===0?(h(function(){(S||!l.opGet(f))&&(r==null||r(A,!1))}),null):[T-1,A]})}},[f]),v}var J4={},e5="css",po=new Map;function t5(t){po.set(t,(po.get(t)||0)+1)}function n5(t,e){if(typeof document<"u"){var n=document.querySelectorAll("style[".concat(yc,'="').concat(t,'"]'));n.forEach(function(r){if(r[Ia]===e){var i;(i=r.parentNode)===null||i===void 0||i.removeChild(r)}})}}var r5=0;function i5(t,e){po.set(t,(po.get(t)||0)-1);var n=Array.from(po.keys()),r=n.filter(function(i){var a=po.get(i)||0;return a<=0});n.length-r.length>r5&&r.forEach(function(i){n5(i,e),po.delete(i)})}var s5=function(e,n,r,i){var a=r.getDerivativeToken(e),l=J(J({},a),n);return i&&(l=i(l)),l},qR="token";function a5(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=_.useContext($f),i=r.cache.instanceId,a=r.container,l=n.salt,u=l===void 0?"":l,f=n.override,h=f===void 0?J4:f,g=n.formatToken,m=n.getComputedToken,v=n.cssVar,S=H4(function(){return Object.assign.apply(Object,[{}].concat(ze(e)))},e),w=Ju(S),E=Ju(h),b=v?Ju(v):"",C=zy(qR,[u,t.id,w,E,b],function(){var T,A=m?m(S,h,t):s5(S,h,t,g),O=J({},A),x="";if(v){var N=XR(A,v.key,{prefix:v.prefix,ignore:v.ignore,unitless:v.unitless,preserve:v.preserve}),F=de(N,2);A=F[0],x=F[1]}var L=Ww(A,u);A._tokenKey=L,O._tokenKey=Ww(O,u);var D=(T=v==null?void 0:v.key)!==null&&T!==void 0?T:L;A._themeKey=D,t5(D);var V="".concat(e5,"-").concat(_f(L));return A._hashId=V,[A,V,O,x,(v==null?void 0:v.key)||""]},function(T){i5(T[0]._themeKey,i)},function(T){var A=de(T,4),O=A[0],x=A[3];if(v&&x){var N=Hs(x,_f("css-variables-".concat(O._themeKey)),{mark:Ji,prepend:"queue",attachTo:a,priority:-999});N[Ia]=i,N.setAttribute(yc,O._themeKey)}});return C}var o5=function(e,n,r){var i=de(e,5),a=i[2],l=i[3],u=i[4],f=r||{},h=f.plain;if(!l)return null;var g=a._tokenKey,m=-999,v={"data-rc-order":"prependQueue","data-rc-priority":"".concat(m)},S=Yh(l,u,g,v,h);return[m,g,S]},l5={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},YR="comm",KR="rule",ZR="decl",c5="@import",u5="@namespace",f5="@keyframes",d5="@layer",QR=Math.abs,$y=String.fromCharCode;function GR(t){return t.trim()}function Mh(t,e,n){return t.replace(e,n)}function h5(t,e,n){return t.indexOf(e,n)}function Jl(t,e){return t.charCodeAt(e)|0}function bc(t,e,n){return t.slice(e,n)}function us(t){return t.length}function g5(t){return t.length}function nh(t,e){return e.push(t),t}var ep=1,Sc=1,JR=0,Ni=0,ar=0,Bc="";function Vy(t,e,n,r,i,a,l,u){return{value:t,root:e,parent:n,type:r,props:i,children:a,line:ep,column:Sc,length:l,return:"",siblings:u}}function p5(){return ar}function m5(){return ar=Ni>0?Jl(Bc,--Ni):0,Sc--,ar===10&&(Sc=1,ep--),ar}function es(){return ar=Ni2||bf(ar)>3?"":" "}function b5(t,e){for(;--e&&es()&&!(ar<48||ar>102||ar>57&&ar<65||ar>70&&ar<97););return tp(t,Oh()+(e<6&&Da()==32&&es()==32))}function $0(t){for(;es();)switch(ar){case t:return Ni;case 34:case 39:t!==34&&t!==39&&$0(ar);break;case 40:t===41&&$0(t);break;case 92:es();break}return Ni}function S5(t,e){for(;es()&&t+ar!==57;)if(t+ar===84&&Da()===47)break;return"/*"+tp(e,Ni-1)+"*"+$y(t===47?t:es())}function E5(t){for(;!bf(Da());)es();return tp(t,Ni)}function w5(t){return _5(Ph("",null,null,null,[""],t=v5(t),0,[0],t))}function Ph(t,e,n,r,i,a,l,u,f){for(var h=0,g=0,m=l,v=0,S=0,w=0,E=1,b=1,C=1,T=0,A="",O=i,x=a,N=r,F=A;b;)switch(w=T,T=es()){case 40:if(w!=108&&Jl(F,m-1)==58){h5(F+=Mh(Tv(T),"&","&\f"),"&\f",QR(h?u[h-1]:0))!=-1&&(C=-1);break}case 34:case 39:case 91:F+=Tv(T);break;case 9:case 10:case 13:case 32:F+=y5(w);break;case 92:F+=b5(Oh()-1,7);continue;case 47:switch(Da()){case 42:case 47:nh(T5(S5(es(),Oh()),e,n,f),f),(bf(w||1)==5||bf(Da()||1)==5)&&us(F)&&bc(F,-1,void 0)!==" "&&(F+=" ");break;default:F+="/"}break;case 123*E:u[h++]=us(F)*C;case 125*E:case 59:case 0:switch(T){case 0:case 125:b=0;case 59+g:C==-1&&(F=Mh(F,/\f/g,"")),S>0&&(us(F)-m||E===0&&w===47)&&nh(S>32?Zw(F+";",r,n,m-1,f):Zw(Mh(F," ","")+";",r,n,m-2,f),f);break;case 59:F+=";";default:if(nh(N=Kw(F,e,n,h,g,i,u,A,O=[],x=[],m,a),a),T===123)if(g===0)Ph(F,e,N,N,O,a,m,u,x);else{switch(v){case 99:if(Jl(F,3)===110)break;case 108:if(Jl(F,2)===97)break;default:g=0;case 100:case 109:case 115:}g?Ph(t,N,N,r&&nh(Kw(t,N,N,0,0,i,u,A,i,O=[],m,x),x),i,x,m,u,r?O:x):Ph(F,N,N,N,[""],x,0,u,x)}}h=g=S=0,E=C=1,A=F="",m=l;break;case 58:m=1+us(F),S=w;default:if(E<1){if(T==123)--E;else if(T==125&&E++==0&&m5()==125)continue}switch(F+=$y(T),T*E){case 38:C=g>0?1:(F+="\f",-1);break;case 44:u[h++]=(us(F)-1)*C,C=1;break;case 64:Da()===45&&(F+=Tv(es())),v=Da(),g=m=us(A=F+=E5(Oh())),T++;break;case 45:w===45&&us(F)==2&&(E=0)}}return a}function Kw(t,e,n,r,i,a,l,u,f,h,g,m){for(var v=i-1,S=i===0?a:[""],w=g5(S),E=0,b=0,C=0;E0?S[T]+" "+A:Mh(A,/&\f/g,S[T])))&&(f[C++]=O);return Vy(t,e,n,i===0?KR:u,f,h,g,m)}function T5(t,e,n,r){return Vy(t,e,n,YR,$y(p5()),bc(t,2,-2),0,r)}function Zw(t,e,n,r,i){return Vy(t,e,n,ZR,bc(t,0,r),bc(t,r+1,-1),r,i)}function V0(t,e){for(var n="",r=0;r1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{root:!0,parentSelectors:[]},i=r.root,a=r.injectHash,l=r.parentSelectors,u=n.hashId,f=n.layer;n.path;var h=n.hashPriority,g=n.transformers,m=g===void 0?[]:g;n.linters;var v="",S={};function w(C){var T=C.getName(u);if(!S[T]){var A=t(C.style,n,{root:!1,parentSelectors:l}),O=de(A,1),x=O[0];S[T]="@keyframes ".concat(C.getName(u)).concat(x)}}function E(C){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return C.forEach(function(A){Array.isArray(A)?E(A,T):A&&T.push(A)}),T}var b=E(Array.isArray(e)?e:[e]);return b.forEach(function(C){var T=typeof C=="string"&&!i?{}:C;if(typeof T=="string")v+="".concat(T,` -`);else if(T._keyframe)w(T);else{var A=m.reduce(function(O,x){var N;return(x==null||(N=x.visit)===null||N===void 0?void 0:N.call(x,O))||O},T);Object.keys(A).forEach(function(O){var x=A[O];if(pt(x)==="object"&&x&&(O!=="animationName"||!x._keyframe)&&!O5(x)){var N=!1,F=O.trim(),L=!1;(i||a)&&u?F.startsWith("@")?N=!0:F==="&"?F=Gw("",u,h):F=Gw(O,u,h):i&&!u&&(F==="&"||F==="")&&(F="",L=!0);var D=t(x,n,{root:L,injectHash:N,parentSelectors:[].concat(ze(l),[F])}),V=de(D,2),B=V[0],W=V[1];S=J(J({},S),W),v+="".concat(F).concat(B)}else{let ae=function(U,z){var j=U.replace(/[A-Z]/g,function(P){return"-".concat(P.toLowerCase())}),Z=z;!l5[U]&&typeof Z=="number"&&Z!==0&&(Z="".concat(Z,"px")),U==="animationName"&&z!==null&&z!==void 0&&z._keyframe&&(w(z),Z=z.getName(u)),v+="".concat(j,":").concat(Z,";")};var X,Y=(X=x==null?void 0:x.value)!==null&&X!==void 0?X:x;pt(x)==="object"&&x!==null&&x!==void 0&&x[n3]&&Array.isArray(Y)?Y.forEach(function(U){ae(O,U)}):ae(O,Y)}})}}),i?f&&(v&&(v="@layer ".concat(f.name," {").concat(v,"}")),f.dependencies&&(S["@layer ".concat(f.name)]=f.dependencies.map(function(C){return"@layer ".concat(C,", ").concat(f.name,";")}).join(` -`))):v="{".concat(v,"}"),[v,S]};function r3(t,e){return _f("".concat(t.join("%")).concat(e))}function N5(){return null}var i3="style";function H0(t,e){var n=t.token,r=t.path,i=t.hashId,a=t.layer,l=t.nonce,u=t.clientOnly,f=t.order,h=f===void 0?0:f,g=_.useContext($f),m=g.autoClear;g.mock;var v=g.defaultCache,S=g.hashPriority,w=g.container,E=g.ssrInline,b=g.transformers,C=g.linters,T=g.cache,A=g.layer,O=n._tokenKey,x=[O];A&&x.push("layer"),x.push.apply(x,ze(r));var N=z0,F=zy(i3,x,function(){var W=x.join("|");if(R5(W)){var X=x5(W),Y=de(X,2),ae=Y[0],U=Y[1];if(ae)return[ae,O,U,{},u,h]}var z=e(),j=P5(z,{hashId:i,hashPriority:S,layer:A?a:void 0,path:r.join("-"),transformers:b,linters:C}),Z=de(j,2),P=Z[0],$=Z[1],ie=Nh(P),se=r3(x,ie);return[ie,O,se,$,u,h]},function(W,X){var Y=de(W,3),ae=Y[2];(X||m)&&z0&&yf(ae,{mark:Ji})},function(W){var X=de(W,4),Y=X[0];X[1];var ae=X[2],U=X[3];if(N&&Y!==e3){var z={mark:Ji,prepend:A?!1:"queue",attachTo:w,priority:h},j=typeof l=="function"?l():l;j&&(z.csp={nonce:j});var Z=[],P=[];Object.keys(U).forEach(function(ie){ie.startsWith("@layer")?Z.push(ie):P.push(ie)}),Z.forEach(function(ie){Hs(Nh(U[ie]),"_layer-".concat(ie),J(J({},z),{},{prepend:!0}))});var $=Hs(Y,ae,z);$[Ia]=T.instanceId,$.setAttribute(yc,O),P.forEach(function(ie){Hs(Nh(U[ie]),"_effect-".concat(ie),z)})}}),L=de(F,3),D=L[0],V=L[1],B=L[2];return function(W){var X;if(!E||N||!v)X=_.createElement(N5,null);else{var Y;X=_.createElement("style",kt({},(Y={},K(Y,yc,V),K(Y,Ji,B),Y),{dangerouslySetInnerHTML:{__html:D}}))}return _.createElement(_.Fragment,null,X,W)}}var I5=function(e,n,r){var i=de(e,6),a=i[0],l=i[1],u=i[2],f=i[3],h=i[4],g=i[5],m=r||{},v=m.plain;if(h)return null;var S=a,w={"data-rc-order":"prependQueue","data-rc-priority":"".concat(g)};return S=Yh(a,l,u,w,v),f&&Object.keys(f).forEach(function(E){if(!n[E]){n[E]=!0;var b=Nh(f[E]),C=Yh(b,l,"_effect-".concat(E),w,v);E.startsWith("@layer")?S=C+S:S+=C}}),[g,u,S]},s3="cssVar",D5=function(e,n){var r=e.key,i=e.prefix,a=e.unitless,l=e.ignore,u=e.token,f=e.scope,h=f===void 0?"":f,g=_.useContext($f),m=g.cache.instanceId,v=g.container,S=u._tokenKey,w=[].concat(ze(e.path),[r,h,S]),E=zy(s3,w,function(){var b=n(),C=XR(b,r,{prefix:i,unitless:a,ignore:l,scope:h}),T=de(C,2),A=T[0],O=T[1],x=r3(w,O);return[A,O,x,r]},function(b){var C=de(b,3),T=C[2];z0&&yf(T,{mark:Ji})},function(b){var C=de(b,3),T=C[1],A=C[2];if(T){var O=Hs(T,A,{mark:Ji,prepend:"queue",attachTo:v,priority:-999});O[Ia]=m,O.setAttribute(yc,r)}});return E},F5=function(e,n,r){var i=de(e,4),a=i[1],l=i[2],u=i[3],f=r||{},h=f.plain;if(!a)return null;var g=-999,m={"data-rc-order":"prependQueue","data-rc-priority":"".concat(g)},v=Yh(a,u,l,m,h);return[g,l,v]},ku;ku={},K(ku,i3,I5),K(ku,qR,o5),K(ku,s3,F5);var ln=function(){function t(e,n){xr(this,t),K(this,"name",void 0),K(this,"style",void 0),K(this,"_keyframe",!0),this.name=e,this.style=n}return Mr(t,[{key:"getName",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return n?"".concat(n,"-").concat(this.name):this.name}}]),t}();function Il(t){return t.notSplit=!0,t}Il(["borderTop","borderBottom"]),Il(["borderTop"]),Il(["borderBottom"]),Il(["borderLeft","borderRight"]),Il(["borderLeft"]),Il(["borderRight"]);var Hy=_.createContext({});function a3(t){return zR(t)||kR(t)||ky(t)||$R()}function vs(t,e){for(var n=t,r=0;r3&&arguments[3]!==void 0?arguments[3]:!1;return e.length&&r&&n===void 0&&!vs(t,e.slice(0,-1))?t:o3(t,e,n,r)}function k5(t){return pt(t)==="object"&&t!==null&&Object.getPrototypeOf(t)===Object.prototype}function Jw(t){return Array.isArray(t)?[]:{}}var B5=typeof Reflect>"u"?Object.keys:Reflect.ownKeys;function Hl(){for(var t=arguments.length,e=new Array(t),n=0;n{const t=()=>{};return t.deprecated=U5,t},z5=_.createContext(void 0);var $5={items_per_page:"/ page",jump_to:"Go to",jump_to_confirm:"confirm",page:"Page",prev_page:"Previous Page",next_page:"Next Page",prev_5:"Previous 5 Pages",next_5:"Next 5 Pages",prev_3:"Previous 3 Pages",next_3:"Next 3 Pages",page_size:"Page Size"},V5={yearFormat:"YYYY",dayFormat:"D",cellMeridiemFormat:"A",monthBeforeYear:!0},H5=J(J({},V5),{},{locale:"en_US",today:"Today",now:"Now",backToToday:"Back to today",ok:"OK",clear:"Clear",week:"Week",month:"Month",year:"Year",timeSelect:"select time",dateSelect:"select date",weekSelect:"Choose a week",monthSelect:"Choose a month",yearSelect:"Choose a year",decadeSelect:"Choose a decade",dateFormat:"M/D/YYYY",dateTimeFormat:"M/D/YYYY HH:mm:ss",previousMonth:"Previous month (PageUp)",nextMonth:"Next month (PageDown)",previousYear:"Last year (Control + left)",nextYear:"Next year (Control + right)",previousDecade:"Last decade",nextDecade:"Next decade",previousCentury:"Last century",nextCentury:"Next century"});const c3={placeholder:"Select time",rangePlaceholder:["Start time","End time"]},eT={lang:Object.assign({placeholder:"Select date",yearPlaceholder:"Select year",quarterPlaceholder:"Select quarter",monthPlaceholder:"Select month",weekPlaceholder:"Select week",rangePlaceholder:["Start date","End date"],rangeYearPlaceholder:["Start year","End year"],rangeQuarterPlaceholder:["Start quarter","End quarter"],rangeMonthPlaceholder:["Start month","End month"],rangeWeekPlaceholder:["Start week","End week"]},H5),timePickerLocale:Object.assign({},c3)},ii="${label} is not a valid ${type}",Ec={locale:"en",Pagination:$5,DatePicker:eT,TimePicker:c3,Calendar:eT,global:{placeholder:"Please select"},Table:{filterTitle:"Filter menu",filterConfirm:"OK",filterReset:"Reset",filterEmptyText:"No filters",filterCheckAll:"Select all items",filterSearchPlaceholder:"Search in filters",emptyText:"No data",selectAll:"Select current page",selectInvert:"Invert current page",selectNone:"Clear all data",selectionAll:"Select all data",sortTitle:"Sort",expand:"Expand row",collapse:"Collapse row",triggerDesc:"Click to sort descending",triggerAsc:"Click to sort ascending",cancelSort:"Click to cancel sorting"},Tour:{Next:"Next",Previous:"Previous",Finish:"Finish"},Modal:{okText:"OK",cancelText:"Cancel",justOkText:"OK"},Popconfirm:{okText:"OK",cancelText:"Cancel"},Transfer:{titles:["",""],searchPlaceholder:"Search here",itemUnit:"item",itemsUnit:"items",remove:"Remove",selectCurrent:"Select current page",removeCurrent:"Remove current page",selectAll:"Select all data",deselectAll:"Deselect all data",removeAll:"Remove all data",selectInvert:"Invert current page"},Upload:{uploading:"Uploading...",removeFile:"Remove file",uploadError:"Upload error",previewFile:"Preview file",downloadFile:"Download file"},Empty:{description:"No data"},Icon:{icon:"icon"},Text:{edit:"Edit",copy:"Copy",copied:"Copied",expand:"Expand",collapse:"Collapse"},Form:{optional:"(optional)",defaultValidateMessages:{default:"Field validation error for ${label}",required:"Please enter ${label}",enum:"${label} must be one of [${enum}]",whitespace:"${label} cannot be a blank character",date:{format:"${label} date format is invalid",parse:"${label} cannot be converted to a date",invalid:"${label} is an invalid date"},types:{string:ii,method:ii,array:ii,object:ii,number:ii,date:ii,boolean:ii,integer:ii,float:ii,regexp:ii,email:ii,url:ii,hex:ii},string:{len:"${label} must be ${len} characters",min:"${label} must be at least ${min} characters",max:"${label} must be up to ${max} characters",range:"${label} must be between ${min}-${max} characters"},number:{len:"${label} must be equal to ${len}",min:"${label} must be minimum ${min}",max:"${label} must be maximum ${max}",range:"${label} must be between ${min}-${max}"},array:{len:"Must be ${len} ${label}",min:"At least ${min} ${label}",max:"At most ${max} ${label}",range:"The amount of ${label} must be between ${min}-${max}"},pattern:{mismatch:"${label} does not match the pattern ${pattern}"}}},Image:{preview:"Preview"},QRCode:{expired:"QR code expired",refresh:"Refresh",scanned:"Scanned"},ColorPicker:{presetEmpty:"Empty",transparent:"Transparent",singleColor:"Single",gradientColor:"Gradient"}};Object.assign({},Ec.Modal);let Ih=[];const tT=()=>Ih.reduce((t,e)=>Object.assign(Object.assign({},t),e),Ec.Modal);function j5(t){if(t){const e=Object.assign({},t);return Ih.push(e),tT(),()=>{Ih=Ih.filter(n=>n!==e),tT()}}Object.assign({},Ec.Modal)}const jy=_.createContext(void 0),Wy=(t,e)=>{const n=_.useContext(jy),r=_.useMemo(()=>{var a;const l=Ec[t],u=(a=n==null?void 0:n[t])!==null&&a!==void 0?a:{};return Object.assign(Object.assign({},typeof l=="function"?l():l),u||{})},[t,e,n]),i=_.useMemo(()=>{const a=n==null?void 0:n.locale;return n!=null&&n.exist&&!a?Ec.locale:a},[n]);return[r,i]},W5="internalMark",X5=t=>{const{locale:e={},children:n,_ANT_MARK__:r}=t;_.useEffect(()=>j5(e==null?void 0:e.Modal),[e]);const i=_.useMemo(()=>Object.assign(Object.assign({},e),{exist:!0}),[e]);return _.createElement(jy.Provider,{value:i},n)},u3={blue:"#1677FF",purple:"#722ED1",cyan:"#13C2C2",green:"#52C41A",magenta:"#EB2F96",pink:"#EB2F96",red:"#F5222D",orange:"#FA8C16",yellow:"#FADB14",volcano:"#FA541C",geekblue:"#2F54EB",gold:"#FAAD14",lime:"#A0D911"},Sf=Object.assign(Object.assign({},u3),{colorPrimary:"#1677ff",colorSuccess:"#52c41a",colorWarning:"#faad14",colorError:"#ff4d4f",colorInfo:"#1677ff",colorLink:"",colorTextBase:"",colorBgBase:"",fontFamily:`-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, -'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', -'Noto Color Emoji'`,fontFamilyCode:"'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace",fontSize:14,lineWidth:1,lineType:"solid",motionUnit:.1,motionBase:0,motionEaseOutCirc:"cubic-bezier(0.08, 0.82, 0.17, 1)",motionEaseInOutCirc:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",motionEaseOut:"cubic-bezier(0.215, 0.61, 0.355, 1)",motionEaseInOut:"cubic-bezier(0.645, 0.045, 0.355, 1)",motionEaseOutBack:"cubic-bezier(0.12, 0.4, 0.29, 1.46)",motionEaseInBack:"cubic-bezier(0.71, -0.46, 0.88, 0.6)",motionEaseInQuint:"cubic-bezier(0.755, 0.05, 0.855, 0.06)",motionEaseOutQuint:"cubic-bezier(0.23, 1, 0.32, 1)",borderRadius:6,sizeUnit:4,sizeStep:4,sizePopupArrow:16,controlHeight:32,zIndexBase:0,zIndexPopupBase:1e3,opacityImage:1,wireframe:!1,motion:!0}),_r=Math.round;function Cv(t,e){const n=t.replace(/^[^(]*\((.*)/,"$1").replace(/\).*/,"").match(/\d*\.?\d+%?/g)||[],r=n.map(i=>parseFloat(i));for(let i=0;i<3;i+=1)r[i]=e(r[i]||0,n[i]||"",i);return n[3]?r[3]=n[3].includes("%")?r[3]/100:r[3]:r[3]=1,r}const nT=(t,e,n)=>n===0?t:t/100;function Bu(t,e){const n=e||255;return t>n?n:t<0?0:t}class En{constructor(e){K(this,"isValid",!0),K(this,"r",0),K(this,"g",0),K(this,"b",0),K(this,"a",1),K(this,"_h",void 0),K(this,"_s",void 0),K(this,"_l",void 0),K(this,"_v",void 0),K(this,"_max",void 0),K(this,"_min",void 0),K(this,"_brightness",void 0);function n(r){return r[0]in e&&r[1]in e&&r[2]in e}if(e)if(typeof e=="string"){let i=function(a){return r.startsWith(a)};const r=e.trim();/^#?[A-F\d]{3,8}$/i.test(r)?this.fromHexString(r):i("rgb")?this.fromRgbString(r):i("hsl")?this.fromHslString(r):(i("hsv")||i("hsb"))&&this.fromHsvString(r)}else if(e instanceof En)this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this._h=e._h,this._s=e._s,this._l=e._l,this._v=e._v;else if(n("rgb"))this.r=Bu(e.r),this.g=Bu(e.g),this.b=Bu(e.b),this.a=typeof e.a=="number"?Bu(e.a,1):1;else if(n("hsl"))this.fromHsl(e);else if(n("hsv"))this.fromHsv(e);else throw new Error("@ant-design/fast-color: unsupported input "+JSON.stringify(e))}setR(e){return this._sc("r",e)}setG(e){return this._sc("g",e)}setB(e){return this._sc("b",e)}setA(e){return this._sc("a",e,1)}setHue(e){const n=this.toHsv();return n.h=e,this._c(n)}getLuminance(){function e(a){const l=a/255;return l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4)}const n=e(this.r),r=e(this.g),i=e(this.b);return .2126*n+.7152*r+.0722*i}getHue(){if(typeof this._h>"u"){const e=this.getMax()-this.getMin();e===0?this._h=0:this._h=_r(60*(this.r===this.getMax()?(this.g-this.b)/e+(this.g"u"){const e=this.getMax()-this.getMin();e===0?this._s=0:this._s=e/this.getMax()}return this._s}getLightness(){return typeof this._l>"u"&&(this._l=(this.getMax()+this.getMin())/510),this._l}getValue(){return typeof this._v>"u"&&(this._v=this.getMax()/255),this._v}getBrightness(){return typeof this._brightness>"u"&&(this._brightness=(this.r*299+this.g*587+this.b*114)/1e3),this._brightness}darken(e=10){const n=this.getHue(),r=this.getSaturation();let i=this.getLightness()-e/100;return i<0&&(i=0),this._c({h:n,s:r,l:i,a:this.a})}lighten(e=10){const n=this.getHue(),r=this.getSaturation();let i=this.getLightness()+e/100;return i>1&&(i=1),this._c({h:n,s:r,l:i,a:this.a})}mix(e,n=50){const r=this._c(e),i=n/100,a=u=>(r[u]-this[u])*i+this[u],l={r:_r(a("r")),g:_r(a("g")),b:_r(a("b")),a:_r(a("a")*100)/100};return this._c(l)}tint(e=10){return this.mix({r:255,g:255,b:255,a:1},e)}shade(e=10){return this.mix({r:0,g:0,b:0,a:1},e)}onBackground(e){const n=this._c(e),r=this.a+n.a*(1-this.a),i=a=>_r((this[a]*this.a+n[a]*n.a*(1-this.a))/r);return this._c({r:i("r"),g:i("g"),b:i("b"),a:r})}isDark(){return this.getBrightness()<128}isLight(){return this.getBrightness()>=128}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}clone(){return this._c(this)}toHexString(){let e="#";const n=(this.r||0).toString(16);e+=n.length===2?n:"0"+n;const r=(this.g||0).toString(16);e+=r.length===2?r:"0"+r;const i=(this.b||0).toString(16);if(e+=i.length===2?i:"0"+i,typeof this.a=="number"&&this.a>=0&&this.a<1){const a=_r(this.a*255).toString(16);e+=a.length===2?a:"0"+a}return e}toHsl(){return{h:this.getHue(),s:this.getSaturation(),l:this.getLightness(),a:this.a}}toHslString(){const e=this.getHue(),n=_r(this.getSaturation()*100),r=_r(this.getLightness()*100);return this.a!==1?`hsla(${e},${n}%,${r}%,${this.a})`:`hsl(${e},${n}%,${r}%)`}toHsv(){return{h:this.getHue(),s:this.getSaturation(),v:this.getValue(),a:this.a}}toRgb(){return{r:this.r,g:this.g,b:this.b,a:this.a}}toRgbString(){return this.a!==1?`rgba(${this.r},${this.g},${this.b},${this.a})`:`rgb(${this.r},${this.g},${this.b})`}toString(){return this.toRgbString()}_sc(e,n,r){const i=this.clone();return i[e]=Bu(n,r),i}_c(e){return new this.constructor(e)}getMax(){return typeof this._max>"u"&&(this._max=Math.max(this.r,this.g,this.b)),this._max}getMin(){return typeof this._min>"u"&&(this._min=Math.min(this.r,this.g,this.b)),this._min}fromHexString(e){const n=e.replace("#","");function r(i,a){return parseInt(n[i]+n[a||i],16)}n.length<6?(this.r=r(0),this.g=r(1),this.b=r(2),this.a=n[3]?r(3)/255:1):(this.r=r(0,1),this.g=r(2,3),this.b=r(4,5),this.a=n[6]?r(6,7)/255:1)}fromHsl({h:e,s:n,l:r,a:i}){if(this._h=e%360,this._s=n,this._l=r,this.a=typeof i=="number"?i:1,n<=0){const v=_r(r*255);this.r=v,this.g=v,this.b=v}let a=0,l=0,u=0;const f=e/60,h=(1-Math.abs(2*r-1))*n,g=h*(1-Math.abs(f%2-1));f>=0&&f<1?(a=h,l=g):f>=1&&f<2?(a=g,l=h):f>=2&&f<3?(l=h,u=g):f>=3&&f<4?(l=g,u=h):f>=4&&f<5?(a=g,u=h):f>=5&&f<6&&(a=h,u=g);const m=r-h/2;this.r=_r((a+m)*255),this.g=_r((l+m)*255),this.b=_r((u+m)*255)}fromHsv({h:e,s:n,v:r,a:i}){this._h=e%360,this._s=n,this._v=r,this.a=typeof i=="number"?i:1;const a=_r(r*255);if(this.r=a,this.g=a,this.b=a,n<=0)return;const l=e/60,u=Math.floor(l),f=l-u,h=_r(r*(1-n)*255),g=_r(r*(1-n*f)*255),m=_r(r*(1-n*(1-f))*255);switch(u){case 0:this.g=m,this.b=h;break;case 1:this.r=g,this.b=h;break;case 2:this.r=h,this.b=m;break;case 3:this.r=h,this.g=g;break;case 4:this.r=m,this.g=h;break;case 5:default:this.g=h,this.b=g;break}}fromHsvString(e){const n=Cv(e,nT);this.fromHsv({h:n[0],s:n[1],v:n[2],a:n[3]})}fromHslString(e){const n=Cv(e,nT);this.fromHsl({h:n[0],s:n[1],l:n[2],a:n[3]})}fromRgbString(e){const n=Cv(e,(r,i)=>i.includes("%")?_r(r/100*255):r);this.r=n[0],this.g=n[1],this.b=n[2],this.a=n[3]}}var rh=2,rT=.16,q5=.05,Y5=.05,K5=.15,f3=5,d3=4,Z5=[{index:7,amount:15},{index:6,amount:25},{index:5,amount:30},{index:5,amount:45},{index:5,amount:65},{index:5,amount:85},{index:4,amount:90},{index:3,amount:95},{index:2,amount:97},{index:1,amount:98}];function iT(t,e,n){var r;return Math.round(t.h)>=60&&Math.round(t.h)<=240?r=n?Math.round(t.h)-rh*e:Math.round(t.h)+rh*e:r=n?Math.round(t.h)+rh*e:Math.round(t.h)-rh*e,r<0?r+=360:r>=360&&(r-=360),r}function sT(t,e,n){if(t.h===0&&t.s===0)return t.s;var r;return n?r=t.s-rT*e:e===d3?r=t.s+rT:r=t.s+q5*e,r>1&&(r=1),n&&e===f3&&r>.1&&(r=.1),r<.06&&(r=.06),Math.round(r*100)/100}function aT(t,e,n){var r;return n?r=t.v+Y5*e:r=t.v-K5*e,r=Math.max(0,Math.min(1,r)),Math.round(r*100)/100}function Ef(t){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=[],r=new En(t),i=r.toHsv(),a=f3;a>0;a-=1){var l=new En({h:iT(i,a,!0),s:sT(i,a,!0),v:aT(i,a,!0)});n.push(l)}n.push(r);for(var u=1;u<=d3;u+=1){var f=new En({h:iT(i,u),s:sT(i,u),v:aT(i,u)});n.push(f)}return e.theme==="dark"?Z5.map(function(h){var g=h.index,m=h.amount;return new En(e.backgroundColor||"#141414").mix(n[g],m).toHexString()}):n.map(function(h){return h.toHexString()})}var Av={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"},j0=["#fff1f0","#ffccc7","#ffa39e","#ff7875","#ff4d4f","#f5222d","#cf1322","#a8071a","#820014","#5c0011"];j0.primary=j0[5];var W0=["#fff2e8","#ffd8bf","#ffbb96","#ff9c6e","#ff7a45","#fa541c","#d4380d","#ad2102","#871400","#610b00"];W0.primary=W0[5];var X0=["#fff7e6","#ffe7ba","#ffd591","#ffc069","#ffa940","#fa8c16","#d46b08","#ad4e00","#873800","#612500"];X0.primary=X0[5];var q0=["#fffbe6","#fff1b8","#ffe58f","#ffd666","#ffc53d","#faad14","#d48806","#ad6800","#874d00","#613400"];q0.primary=q0[5];var Y0=["#feffe6","#ffffb8","#fffb8f","#fff566","#ffec3d","#fadb14","#d4b106","#ad8b00","#876800","#614700"];Y0.primary=Y0[5];var K0=["#fcffe6","#f4ffb8","#eaff8f","#d3f261","#bae637","#a0d911","#7cb305","#5b8c00","#3f6600","#254000"];K0.primary=K0[5];var Z0=["#f6ffed","#d9f7be","#b7eb8f","#95de64","#73d13d","#52c41a","#389e0d","#237804","#135200","#092b00"];Z0.primary=Z0[5];var Q0=["#e6fffb","#b5f5ec","#87e8de","#5cdbd3","#36cfc9","#13c2c2","#08979c","#006d75","#00474f","#002329"];Q0.primary=Q0[5];var Kh=["#e6f4ff","#bae0ff","#91caff","#69b1ff","#4096ff","#1677ff","#0958d9","#003eb3","#002c8c","#001d66"];Kh.primary=Kh[5];var G0=["#f0f5ff","#d6e4ff","#adc6ff","#85a5ff","#597ef7","#2f54eb","#1d39c4","#10239e","#061178","#030852"];G0.primary=G0[5];var J0=["#f9f0ff","#efdbff","#d3adf7","#b37feb","#9254de","#722ed1","#531dab","#391085","#22075e","#120338"];J0.primary=J0[5];var e_=["#fff0f6","#ffd6e7","#ffadd2","#ff85c0","#f759ab","#eb2f96","#c41d7f","#9e1068","#780650","#520339"];e_.primary=e_[5];var t_=["#a6a6a6","#999999","#8c8c8c","#808080","#737373","#666666","#404040","#1a1a1a","#000000","#000000"];t_.primary=t_[5];var Rv={red:j0,volcano:W0,orange:X0,gold:q0,yellow:Y0,lime:K0,green:Z0,cyan:Q0,blue:Kh,geekblue:G0,purple:J0,magenta:e_,grey:t_};function Q5(t,e){let{generateColorPalettes:n,generateNeutralColorPalettes:r}=e;const{colorSuccess:i,colorWarning:a,colorError:l,colorInfo:u,colorPrimary:f,colorBgBase:h,colorTextBase:g}=t,m=n(f),v=n(i),S=n(a),w=n(l),E=n(u),b=r(h,g),C=t.colorLink||t.colorInfo,T=n(C),A=new En(w[1]).mix(new En(w[3]),50).toHexString();return Object.assign(Object.assign({},b),{colorPrimaryBg:m[1],colorPrimaryBgHover:m[2],colorPrimaryBorder:m[3],colorPrimaryBorderHover:m[4],colorPrimaryHover:m[5],colorPrimary:m[6],colorPrimaryActive:m[7],colorPrimaryTextHover:m[8],colorPrimaryText:m[9],colorPrimaryTextActive:m[10],colorSuccessBg:v[1],colorSuccessBgHover:v[2],colorSuccessBorder:v[3],colorSuccessBorderHover:v[4],colorSuccessHover:v[4],colorSuccess:v[6],colorSuccessActive:v[7],colorSuccessTextHover:v[8],colorSuccessText:v[9],colorSuccessTextActive:v[10],colorErrorBg:w[1],colorErrorBgHover:w[2],colorErrorBgFilledHover:A,colorErrorBgActive:w[3],colorErrorBorder:w[3],colorErrorBorderHover:w[4],colorErrorHover:w[5],colorError:w[6],colorErrorActive:w[7],colorErrorTextHover:w[8],colorErrorText:w[9],colorErrorTextActive:w[10],colorWarningBg:S[1],colorWarningBgHover:S[2],colorWarningBorder:S[3],colorWarningBorderHover:S[4],colorWarningHover:S[4],colorWarning:S[6],colorWarningActive:S[7],colorWarningTextHover:S[8],colorWarningText:S[9],colorWarningTextActive:S[10],colorInfoBg:E[1],colorInfoBgHover:E[2],colorInfoBorder:E[3],colorInfoBorderHover:E[4],colorInfoHover:E[4],colorInfo:E[6],colorInfoActive:E[7],colorInfoTextHover:E[8],colorInfoText:E[9],colorInfoTextActive:E[10],colorLinkHover:T[4],colorLink:T[6],colorLinkActive:T[7],colorBgMask:new En("#000").setA(.45).toRgbString(),colorWhite:"#fff"})}const G5=t=>{let e=t,n=t,r=t,i=t;return t<6&&t>=5?e=t+1:t<16&&t>=6?e=t+2:t>=16&&(e=16),t<7&&t>=5?n=4:t<8&&t>=7?n=5:t<14&&t>=8?n=6:t<16&&t>=14?n=7:t>=16&&(n=8),t<6&&t>=2?r=1:t>=6&&(r=2),t>4&&t<8?i=4:t>=8&&(i=6),{borderRadius:t,borderRadiusXS:r,borderRadiusSM:n,borderRadiusLG:e,borderRadiusOuter:i}};function J5(t){const{motionUnit:e,motionBase:n,borderRadius:r,lineWidth:i}=t;return Object.assign({motionDurationFast:`${(n+e).toFixed(1)}s`,motionDurationMid:`${(n+e*2).toFixed(1)}s`,motionDurationSlow:`${(n+e*3).toFixed(1)}s`,lineWidthBold:i+1},G5(r))}const eF=t=>{const{controlHeight:e}=t;return{controlHeightSM:e*.75,controlHeightXS:e*.5,controlHeightLG:e*1.25}};function tF(t){return(t+8)/t}function nF(t){const e=new Array(10).fill(null).map((n,r)=>{const i=r-1,a=t*Math.pow(Math.E,i/5),l=r>1?Math.floor(a):Math.ceil(a);return Math.floor(l/2)*2});return e[1]=t,e.map(n=>({size:n,lineHeight:tF(n)}))}const rF=t=>{const e=nF(t),n=e.map(g=>g.size),r=e.map(g=>g.lineHeight),i=n[1],a=n[0],l=n[2],u=r[1],f=r[0],h=r[2];return{fontSizeSM:a,fontSize:i,fontSizeLG:l,fontSizeXL:n[3],fontSizeHeading1:n[6],fontSizeHeading2:n[5],fontSizeHeading3:n[4],fontSizeHeading4:n[3],fontSizeHeading5:n[2],lineHeight:u,lineHeightLG:h,lineHeightSM:f,fontHeight:Math.round(u*i),fontHeightLG:Math.round(h*l),fontHeightSM:Math.round(f*a),lineHeightHeading1:r[6],lineHeightHeading2:r[5],lineHeightHeading3:r[4],lineHeightHeading4:r[3],lineHeightHeading5:r[2]}};function iF(t){const{sizeUnit:e,sizeStep:n}=t;return{sizeXXL:e*(n+8),sizeXL:e*(n+4),sizeLG:e*(n+2),sizeMD:e*(n+1),sizeMS:e*n,size:e*n,sizeSM:e*(n-1),sizeXS:e*(n-2),sizeXXS:e*(n-3)}}const Ti=(t,e)=>new En(t).setA(e).toRgbString(),Uu=(t,e)=>new En(t).darken(e).toHexString(),sF=t=>{const e=Ef(t);return{1:e[0],2:e[1],3:e[2],4:e[3],5:e[4],6:e[5],7:e[6],8:e[4],9:e[5],10:e[6]}},aF=(t,e)=>{const n=t||"#fff",r=e||"#000";return{colorBgBase:n,colorTextBase:r,colorText:Ti(r,.88),colorTextSecondary:Ti(r,.65),colorTextTertiary:Ti(r,.45),colorTextQuaternary:Ti(r,.25),colorFill:Ti(r,.15),colorFillSecondary:Ti(r,.06),colorFillTertiary:Ti(r,.04),colorFillQuaternary:Ti(r,.02),colorBgSolid:Ti(r,1),colorBgSolidHover:Ti(r,.75),colorBgSolidActive:Ti(r,.95),colorBgLayout:Uu(n,4),colorBgContainer:Uu(n,0),colorBgElevated:Uu(n,0),colorBgSpotlight:Ti(r,.85),colorBgBlur:"transparent",colorBorder:Uu(n,15),colorBorderSecondary:Uu(n,6)}};function oF(t){Av.pink=Av.magenta,Rv.pink=Rv.magenta;const e=Object.keys(u3).map(n=>{const r=t[n]===Av[n]?Rv[n]:Ef(t[n]);return new Array(10).fill(1).reduce((i,a,l)=>(i[`${n}-${l+1}`]=r[l],i[`${n}${l+1}`]=r[l],i),{})}).reduce((n,r)=>(n=Object.assign(Object.assign({},n),r),n),{});return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},t),e),Q5(t,{generateColorPalettes:sF,generateNeutralColorPalettes:aF})),rF(t.fontSize)),iF(t)),eF(t)),J5(t))}const h3=L0(oF),n_={token:Sf,override:{override:Sf},hashed:!0},g3=Ft.createContext(n_),r_="ant",Xy="anticon",lF=["outlined","borderless","filled","underlined"],cF=(t,e)=>e||(t?`${r_}-${t}`:r_),ci=_.createContext({getPrefixCls:cF,iconPrefixCls:Xy}),{Consumer:rG}=ci,oT={};function Uc(t){const e=_.useContext(ci),{getPrefixCls:n,direction:r,getPopupContainer:i}=e,a=e[t];return Object.assign(Object.assign({classNames:oT,styles:oT},a),{getPrefixCls:n,direction:r,getPopupContainer:i})}const uF=`-ant-${Date.now()}-${Math.random()}`;function fF(t,e){const n={},r=(l,u)=>{let f=l.clone();return f=(u==null?void 0:u(f))||f,f.toRgbString()},i=(l,u)=>{const f=new En(l),h=Ef(f.toRgbString());n[`${u}-color`]=r(f),n[`${u}-color-disabled`]=h[1],n[`${u}-color-hover`]=h[4],n[`${u}-color-active`]=h[6],n[`${u}-color-outline`]=f.clone().setA(.2).toRgbString(),n[`${u}-color-deprecated-bg`]=h[0],n[`${u}-color-deprecated-border`]=h[2]};if(e.primaryColor){i(e.primaryColor,"primary");const l=new En(e.primaryColor),u=Ef(l.toRgbString());u.forEach((h,g)=>{n[`primary-${g+1}`]=h}),n["primary-color-deprecated-l-35"]=r(l,h=>h.lighten(35)),n["primary-color-deprecated-l-20"]=r(l,h=>h.lighten(20)),n["primary-color-deprecated-t-20"]=r(l,h=>h.tint(20)),n["primary-color-deprecated-t-50"]=r(l,h=>h.tint(50)),n["primary-color-deprecated-f-12"]=r(l,h=>h.setA(h.a*.12));const f=new En(u[0]);n["primary-color-active-deprecated-f-30"]=r(f,h=>h.setA(h.a*.3)),n["primary-color-active-deprecated-d-02"]=r(f,h=>h.darken(2))}return e.successColor&&i(e.successColor,"success"),e.warningColor&&i(e.warningColor,"warning"),e.errorColor&&i(e.errorColor,"error"),e.infoColor&&i(e.infoColor,"info"),` - :root { - ${Object.keys(n).map(l=>`--${t}-${l}: ${n[l]};`).join(` -`)} - } - `.trim()}function dF(t,e){const n=fF(t,e);Zr()&&Hs(n,`${uF}-dynamic-theme`)}const wf=_.createContext(!1),hF=t=>{let{children:e,disabled:n}=t;const r=_.useContext(wf);return _.createElement(wf.Provider,{value:n??r},e)},wc=_.createContext(void 0),gF=t=>{let{children:e,size:n}=t;const r=_.useContext(wc);return _.createElement(wc.Provider,{value:n||r},e)};function pF(){const t=_.useContext(wf),e=_.useContext(wc);return{componentDisabled:t,componentSize:e}}var p3=Mr(function t(){xr(this,t)}),m3="CALC_UNIT",mF=new RegExp(m3,"g");function xv(t){return typeof t=="number"?"".concat(t).concat(m3):t}var vF=function(t){Xo(n,t);var e=qo(n);function n(r,i){var a;xr(this,n),a=e.call(this),K(Nt(a),"result",""),K(Nt(a),"unitlessCssVar",void 0),K(Nt(a),"lowPriority",void 0);var l=pt(r);return a.unitlessCssVar=i,r instanceof n?a.result="(".concat(r.result,")"):l==="number"?a.result=xv(r):l==="string"&&(a.result=r),a}return Mr(n,[{key:"add",value:function(i){return i instanceof n?this.result="".concat(this.result," + ").concat(i.getResult()):(typeof i=="number"||typeof i=="string")&&(this.result="".concat(this.result," + ").concat(xv(i))),this.lowPriority=!0,this}},{key:"sub",value:function(i){return i instanceof n?this.result="".concat(this.result," - ").concat(i.getResult()):(typeof i=="number"||typeof i=="string")&&(this.result="".concat(this.result," - ").concat(xv(i))),this.lowPriority=!0,this}},{key:"mul",value:function(i){return this.lowPriority&&(this.result="(".concat(this.result,")")),i instanceof n?this.result="".concat(this.result," * ").concat(i.getResult(!0)):(typeof i=="number"||typeof i=="string")&&(this.result="".concat(this.result," * ").concat(i)),this.lowPriority=!1,this}},{key:"div",value:function(i){return this.lowPriority&&(this.result="(".concat(this.result,")")),i instanceof n?this.result="".concat(this.result," / ").concat(i.getResult(!0)):(typeof i=="number"||typeof i=="string")&&(this.result="".concat(this.result," / ").concat(i)),this.lowPriority=!1,this}},{key:"getResult",value:function(i){return this.lowPriority||i?"(".concat(this.result,")"):this.result}},{key:"equal",value:function(i){var a=this,l=i||{},u=l.unit,f=!0;return typeof u=="boolean"?f=u:Array.from(this.unitlessCssVar).some(function(h){return a.result.includes(h)})&&(f=!1),this.result=this.result.replace(mF,f?"px":""),typeof this.lowPriority<"u"?"calc(".concat(this.result,")"):this.result}}]),n}(p3),_F=function(t){Xo(n,t);var e=qo(n);function n(r){var i;return xr(this,n),i=e.call(this),K(Nt(i),"result",0),r instanceof n?i.result=r.result:typeof r=="number"&&(i.result=r),i}return Mr(n,[{key:"add",value:function(i){return i instanceof n?this.result+=i.result:typeof i=="number"&&(this.result+=i),this}},{key:"sub",value:function(i){return i instanceof n?this.result-=i.result:typeof i=="number"&&(this.result-=i),this}},{key:"mul",value:function(i){return i instanceof n?this.result*=i.result:typeof i=="number"&&(this.result*=i),this}},{key:"div",value:function(i){return i instanceof n?this.result/=i.result:typeof i=="number"&&(this.result/=i),this}},{key:"equal",value:function(){return this.result}}]),n}(p3),yF=function(e,n){var r=e==="css"?vF:_F;return function(i){return new r(i,n)}},lT=function(e,n){return"".concat([n,e.replace(/([A-Z]+)([A-Z][a-z]+)/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2")].filter(Boolean).join("-"))};function fr(t){var e=_.useRef();e.current=t;var n=_.useCallback(function(){for(var r,i=arguments.length,a=new Array(i),l=0;l1e4){var r=Date.now();this.lastAccessBeat.forEach(function(i,a){r-i>wF&&(n.map.delete(a),n.lastAccessBeat.delete(a))}),this.accessBeat=0}}}]),t}(),dT=new TF;function CF(t,e){return Ft.useMemo(function(){var n=dT.get(e);if(n)return n;var r=t();return dT.set(e,r),r},e)}var AF=function(){return{}};function RF(t){var e=t.useCSP,n=e===void 0?AF:e,r=t.useToken,i=t.usePrefix,a=t.getResetStyles,l=t.getCommonStyle,u=t.getCompUnitless;function f(v,S,w,E){var b=Array.isArray(v)?v[0]:v;function C(L){return"".concat(String(b)).concat(L.slice(0,1).toUpperCase()).concat(L.slice(1))}var T=(E==null?void 0:E.unitless)||{},A=typeof u=="function"?u(v):{},O=J(J({},A),{},K({},C("zIndexPopup"),!0));Object.keys(T).forEach(function(L){O[C(L)]=T[L]});var x=J(J({},E),{},{unitless:O,prefixToken:C}),N=g(v,S,w,x),F=h(b,w,x);return function(L){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:L,V=N(L,D),B=de(V,2),W=B[1],X=F(D),Y=de(X,2),ae=Y[0],U=Y[1];return[ae,W,U]}}function h(v,S,w){var E=w.unitless,b=w.injectStyle,C=b===void 0?!0:b,T=w.prefixToken,A=w.ignore,O=function(F){var L=F.rootCls,D=F.cssVar,V=D===void 0?{}:D,B=r(),W=B.realToken;return D5({path:[v],prefix:V.prefix,key:V.key,unitless:E,ignore:A,token:W,scope:L},function(){var X=fT(v,W,S),Y=cT(v,W,X,{deprecatedTokens:w==null?void 0:w.deprecatedTokens});return Object.keys(X).forEach(function(ae){Y[T(ae)]=Y[ae],delete Y[ae]}),Y}),null},x=function(F){var L=r(),D=L.cssVar;return[function(V){return C&&D?Ft.createElement(Ft.Fragment,null,Ft.createElement(O,{rootCls:F,cssVar:D,component:v}),V):V},D==null?void 0:D.key]};return x}function g(v,S,w){var E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},b=Array.isArray(v)?v:[v,v],C=de(b,1),T=C[0],A=b.join("-"),O=t.layer||{name:"antd"};return function(x){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:x,F=r(),L=F.theme,D=F.realToken,V=F.hashId,B=F.token,W=F.cssVar,X=i(),Y=X.rootPrefixCls,ae=X.iconPrefixCls,U=n(),z=W?"css":"js",j=CF(function(){var q=new Set;return W&&Object.keys(E.unitless||{}).forEach(function(ce){q.add(xh(ce,W.prefix)),q.add(xh(ce,lT(T,W.prefix)))}),yF(z,q)},[z,T,W==null?void 0:W.prefix]),Z=EF(z),P=Z.max,$=Z.min,ie={theme:L,token:B,hashId:V,nonce:function(){return U.nonce},clientOnly:E.clientOnly,layer:O,order:E.order||-999};typeof a=="function"&&H0(J(J({},ie),{},{clientOnly:!1,path:["Shared",Y]}),function(){return a(B,{prefix:{rootPrefixCls:Y,iconPrefixCls:ae},csp:U})});var se=H0(J(J({},ie),{},{path:[A,x,ae]}),function(){if(E.injectStyle===!1)return[];var q=SF(B),ce=q.token,fe=q.flush,ye=fT(T,D,w),Ee=".".concat(x),Ce=cT(T,D,ye,{deprecatedTokens:E.deprecatedTokens});W&&ye&&pt(ye)==="object"&&Object.keys(ye).forEach(function(_e){ye[_e]="var(".concat(xh(_e,lT(T,W.prefix)),")")});var Te=ui(ce,{componentCls:Ee,prefixCls:x,iconCls:".".concat(ae),antCls:".".concat(Y),calc:j,max:P,min:$},W?ye:Ce),ve=S(Te,{hashId:V,prefixCls:x,rootPrefixCls:Y,iconPrefixCls:ae});fe(T,Ce);var ge=typeof l=="function"?l(Te,x,N,E.resetFont):null;return[E.resetStyle===!1?null:ge,ve]});return[se,V]}}function m(v,S,w){var E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},b=g(v,S,w,J({resetStyle:!1,order:-998},E)),C=function(A){var O=A.prefixCls,x=A.rootCls,N=x===void 0?O:x;return b(O,N),null};return C}return{genStyleHooks:f,genSubStyleComponent:m,genComponentStyleHook:g}}const Zh=["blue","purple","cyan","green","magenta","pink","red","orange","yellow","volcano","geekblue","lime","gold"],xF="5.24.0";function Ov(t){return t>=0&&t<=255}function ih(t,e){const{r:n,g:r,b:i,a}=new En(t).toRgb();if(a<1)return t;const{r:l,g:u,b:f}=new En(e).toRgb();for(let h=.01;h<=1;h+=.01){const g=Math.round((n-l*(1-h))/h),m=Math.round((r-u*(1-h))/h),v=Math.round((i-f*(1-h))/h);if(Ov(g)&&Ov(m)&&Ov(v))return new En({r:g,g:m,b:v,a:Math.round(h*100)/100}).toRgbString()}return new En({r:n,g:r,b:i,a:1}).toRgbString()}var MF=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{delete r[v]});const i=Object.assign(Object.assign({},n),r),a=480,l=576,u=768,f=992,h=1200,g=1600;if(i.motion===!1){const v="0s";i.motionDurationFast=v,i.motionDurationMid=v,i.motionDurationSlow=v}return Object.assign(Object.assign(Object.assign({},i),{colorFillContent:i.colorFillSecondary,colorFillContentHover:i.colorFill,colorFillAlter:i.colorFillQuaternary,colorBgContainerDisabled:i.colorFillTertiary,colorBorderBg:i.colorBgContainer,colorSplit:ih(i.colorBorderSecondary,i.colorBgContainer),colorTextPlaceholder:i.colorTextQuaternary,colorTextDisabled:i.colorTextQuaternary,colorTextHeading:i.colorText,colorTextLabel:i.colorTextSecondary,colorTextDescription:i.colorTextTertiary,colorTextLightSolid:i.colorWhite,colorHighlight:i.colorError,colorBgTextHover:i.colorFillSecondary,colorBgTextActive:i.colorFill,colorIcon:i.colorTextTertiary,colorIconHover:i.colorText,colorErrorOutline:ih(i.colorErrorBg,i.colorBgContainer),colorWarningOutline:ih(i.colorWarningBg,i.colorBgContainer),fontSizeIcon:i.fontSizeSM,lineWidthFocus:i.lineWidth*3,lineWidth:i.lineWidth,controlOutlineWidth:i.lineWidth*2,controlInteractiveSize:i.controlHeight/2,controlItemBgHover:i.colorFillTertiary,controlItemBgActive:i.colorPrimaryBg,controlItemBgActiveHover:i.colorPrimaryBgHover,controlItemBgActiveDisabled:i.colorFill,controlTmpOutline:i.colorFillQuaternary,controlOutline:ih(i.colorPrimaryBg,i.colorBgContainer),lineType:i.lineType,borderRadius:i.borderRadius,borderRadiusXS:i.borderRadiusXS,borderRadiusSM:i.borderRadiusSM,borderRadiusLG:i.borderRadiusLG,fontWeightStrong:600,opacityLoading:.65,linkDecoration:"none",linkHoverDecoration:"none",linkFocusDecoration:"none",controlPaddingHorizontal:12,controlPaddingHorizontalSM:8,paddingXXS:i.sizeXXS,paddingXS:i.sizeXS,paddingSM:i.sizeSM,padding:i.size,paddingMD:i.sizeMD,paddingLG:i.sizeLG,paddingXL:i.sizeXL,paddingContentHorizontalLG:i.sizeLG,paddingContentVerticalLG:i.sizeMS,paddingContentHorizontal:i.sizeMS,paddingContentVertical:i.sizeSM,paddingContentHorizontalSM:i.size,paddingContentVerticalSM:i.sizeXS,marginXXS:i.sizeXXS,marginXS:i.sizeXS,marginSM:i.sizeSM,margin:i.size,marginMD:i.sizeMD,marginLG:i.sizeLG,marginXL:i.sizeXL,marginXXL:i.sizeXXL,boxShadow:` - 0 6px 16px 0 rgba(0, 0, 0, 0.08), - 0 3px 6px -4px rgba(0, 0, 0, 0.12), - 0 9px 28px 8px rgba(0, 0, 0, 0.05) - `,boxShadowSecondary:` - 0 6px 16px 0 rgba(0, 0, 0, 0.08), - 0 3px 6px -4px rgba(0, 0, 0, 0.12), - 0 9px 28px 8px rgba(0, 0, 0, 0.05) - `,boxShadowTertiary:` - 0 1px 2px 0 rgba(0, 0, 0, 0.03), - 0 1px 6px -1px rgba(0, 0, 0, 0.02), - 0 2px 4px 0 rgba(0, 0, 0, 0.02) - `,screenXS:a,screenXSMin:a,screenXSMax:l-1,screenSM:l,screenSMMin:l,screenSMMax:u-1,screenMD:u,screenMDMin:u,screenMDMax:f-1,screenLG:f,screenLGMin:f,screenLGMax:h-1,screenXL:h,screenXLMin:h,screenXLMax:g-1,screenXXL:g,screenXXLMin:g,boxShadowPopoverArrow:"2px 2px 5px rgba(0, 0, 0, 0.05)",boxShadowCard:` - 0 1px 2px -2px ${new En("rgba(0, 0, 0, 0.16)").toRgbString()}, - 0 3px 6px 0 ${new En("rgba(0, 0, 0, 0.12)").toRgbString()}, - 0 5px 12px 4px ${new En("rgba(0, 0, 0, 0.09)").toRgbString()} - `,boxShadowDrawerRight:` - -6px 0 16px 0 rgba(0, 0, 0, 0.08), - -3px 0 6px -4px rgba(0, 0, 0, 0.12), - -9px 0 28px 8px rgba(0, 0, 0, 0.05) - `,boxShadowDrawerLeft:` - 6px 0 16px 0 rgba(0, 0, 0, 0.08), - 3px 0 6px -4px rgba(0, 0, 0, 0.12), - 9px 0 28px 8px rgba(0, 0, 0, 0.05) - `,boxShadowDrawerUp:` - 0 6px 16px 0 rgba(0, 0, 0, 0.08), - 0 3px 6px -4px rgba(0, 0, 0, 0.12), - 0 9px 28px 8px rgba(0, 0, 0, 0.05) - `,boxShadowDrawerDown:` - 0 -6px 16px 0 rgba(0, 0, 0, 0.08), - 0 -3px 6px -4px rgba(0, 0, 0, 0.12), - 0 -9px 28px 8px rgba(0, 0, 0, 0.05) - `,boxShadowTabsOverflowLeft:"inset 10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowRight:"inset -10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowTop:"inset 0 10px 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowBottom:"inset 0 -10px 8px -8px rgba(0, 0, 0, 0.08)"}),r)}var hT=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{const r=n.getDerivativeToken(t),{override:i}=e,a=hT(e,["override"]);let l=Object.assign(Object.assign({},r),{override:i});return l=_3(l),a&&Object.entries(a).forEach(u=>{let[f,h]=u;const{theme:g}=h,m=hT(h,["theme"]);let v=m;g&&(v=b3(Object.assign(Object.assign({},l),m),{override:m},g)),l[f]=v}),l};function Ws(){const{token:t,hashed:e,theme:n,override:r,cssVar:i}=Ft.useContext(g3),a=`${xF}-${e||""}`,l=n||h3,[u,f,h]=a5(l,[Sf,t],{salt:a,override:r,getComputedToken:b3,formatToken:_3,cssVar:i&&{prefix:i.prefix,key:i.key,unitless:y3,ignore:OF,preserve:PF}});return[l,h,e?f:"",u,i]}const s_={overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},Lc=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return{boxSizing:"border-box",margin:0,padding:0,color:t.colorText,fontSize:t.fontSize,lineHeight:t.lineHeight,listStyle:"none",fontFamily:e?"inherit":t.fontFamily}},qy=()=>({display:"inline-flex",alignItems:"center",color:"inherit",fontStyle:"normal",lineHeight:0,textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizeLegibility","-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale","> *":{lineHeight:1},svg:{display:"inline-block"}}),NF=t=>({a:{color:t.colorLink,textDecoration:t.linkDecoration,backgroundColor:"transparent",outline:"none",cursor:"pointer",transition:`color ${t.motionDurationSlow}`,"-webkit-text-decoration-skip":"objects","&:hover":{color:t.colorLinkHover},"&:active":{color:t.colorLinkActive},"&:active, &:hover":{textDecoration:t.linkHoverDecoration,outline:0},"&:focus":{textDecoration:t.linkFocusDecoration,outline:0},"&[disabled]":{color:t.colorTextDisabled,cursor:"not-allowed"}}}),IF=(t,e,n,r)=>{const i=`[class^="${e}"], [class*=" ${e}"]`,a=n?`.${n}`:i,l={boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"}};let u={};return r!==!1&&(u={fontFamily:t.fontFamily,fontSize:t.fontSize}),{[a]:Object.assign(Object.assign(Object.assign({},u),l),{[i]:l})}},S3=t=>({[`.${t}`]:Object.assign(Object.assign({},qy()),{[`.${t} .${t}-icon`]:{display:"block"}})}),{genStyleHooks:zc}=RF({usePrefix:()=>{const{getPrefixCls:t,iconPrefixCls:e}=_.useContext(ci);return{rootPrefixCls:t(),iconPrefixCls:e}},useToken:()=>{const[t,e,n,r,i]=Ws();return{theme:t,realToken:e,hashId:n,token:r,cssVar:i}},useCSP:()=>{const{csp:t}=_.useContext(ci);return t??{}},getResetStyles:(t,e)=>{var n;return[{"&":NF(t)},S3((n=e==null?void 0:e.prefix.iconPrefixCls)!==null&&n!==void 0?n:Xy)]},getCommonStyle:IF,getCompUnitless:()=>y3});function DF(t,e){return Zh.reduce((n,r)=>{const i=t[`${r}1`],a=t[`${r}3`],l=t[`${r}6`],u=t[`${r}7`];return Object.assign(Object.assign({},n),e(r,{lightColor:i,lightBorderColor:a,darkColor:l,textColor:u}))},{})}const FF=(t,e)=>{const[n,r]=Ws();return H0({token:r,hashId:"",path:["ant-design-icons",t],nonce:()=>e==null?void 0:e.nonce,layer:{name:"antd"}},()=>[S3(t)])},kF=Object.assign({},Wg),{useId:gT}=kF,BF=()=>"",UF=typeof gT>"u"?BF:gT;function LF(t,e,n){var r;l3();const i=t||{},a=i.inherit===!1||!e?Object.assign(Object.assign({},n_),{hashed:(r=e==null?void 0:e.hashed)!==null&&r!==void 0?r:n_.hashed,cssVar:e==null?void 0:e.cssVar}):e,l=UF();return Yg(()=>{var u,f;if(!t)return e;const h=Object.assign({},a.components);Object.keys(t.components||{}).forEach(v=>{h[v]=Object.assign(Object.assign({},h[v]),t.components[v])});const g=`css-var-${l.replace(/:/g,"")}`,m=((u=i.cssVar)!==null&&u!==void 0?u:a.cssVar)&&Object.assign(Object.assign(Object.assign({prefix:n==null?void 0:n.prefixCls},typeof a.cssVar=="object"?a.cssVar:{}),typeof i.cssVar=="object"?i.cssVar:{}),{key:typeof i.cssVar=="object"&&((f=i.cssVar)===null||f===void 0?void 0:f.key)||g});return Object.assign(Object.assign(Object.assign({},a),i),{token:Object.assign(Object.assign({},a.token),i.token),components:h,cssVar:m})},[i,a],(u,f)=>u.some((h,g)=>{const m=f[g];return!qh(h,m,!0)}))}var zF=["children"],E3=_.createContext({});function $F(t){var e=t.children,n=Fn(t,zF);return _.createElement(E3.Provider,{value:n},e)}var VF=function(t){Xo(n,t);var e=qo(n);function n(){return xr(this,n),e.apply(this,arguments)}return Mr(n,[{key:"render",value:function(){return this.props.children}}]),n}(_.Component);function HF(t){var e=_.useReducer(function(u){return u+1},0),n=de(e,2),r=n[1],i=_.useRef(t),a=fr(function(){return i.current}),l=fr(function(u){i.current=typeof u=="function"?u(i.current):u,r()});return[a,l]}var Sa="none",sh="appear",ah="enter",oh="leave",pT="none",qi="prepare",jl="start",Wl="active",Yy="end",w3="prepared";function mT(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit".concat(t)]="webkit".concat(e),n["Moz".concat(t)]="moz".concat(e),n["ms".concat(t)]="MS".concat(e),n["O".concat(t)]="o".concat(e.toLowerCase()),n}function jF(t,e){var n={animationend:mT("Animation","AnimationEnd"),transitionend:mT("Transition","TransitionEnd")};return t&&("AnimationEvent"in e||delete n.animationend.animation,"TransitionEvent"in e||delete n.transitionend.transition),n}var WF=jF(Zr(),typeof window<"u"?window:{}),T3={};if(Zr()){var XF=document.createElement("div");T3=XF.style}var lh={};function C3(t){if(lh[t])return lh[t];var e=WF[t];if(e)for(var n=Object.keys(e),r=n.length,i=0;i1&&arguments[1]!==void 0?arguments[1]:2;e();var a=dr(function(){i<=1?r({isCanceled:function(){return a!==t.current}}):n(r,i-1)});t.current=a}return _.useEffect(function(){return function(){e()}},[]),[n,e]};var KF=[qi,jl,Wl,Yy],ZF=[qi,w3],O3=!1,QF=!0;function P3(t){return t===Wl||t===Yy}const GF=function(t,e,n){var r=Tf(pT),i=de(r,2),a=i[0],l=i[1],u=YF(),f=de(u,2),h=f[0],g=f[1];function m(){l(qi,!0)}var v=e?ZF:KF;return M3(function(){if(a!==pT&&a!==Yy){var S=v.indexOf(a),w=v[S+1],E=n(a);E===O3?l(w,!0):w&&h(function(b){function C(){b.isCanceled()||l(w,!0)}E===!0?C():Promise.resolve(E).then(C)})}},[t,a]),_.useEffect(function(){return function(){g()}},[]),[m,a]};function JF(t,e,n,r){var i=r.motionEnter,a=i===void 0?!0:i,l=r.motionAppear,u=l===void 0?!0:l,f=r.motionLeave,h=f===void 0?!0:f,g=r.motionDeadline,m=r.motionLeaveImmediately,v=r.onAppearPrepare,S=r.onEnterPrepare,w=r.onLeavePrepare,E=r.onAppearStart,b=r.onEnterStart,C=r.onLeaveStart,T=r.onAppearActive,A=r.onEnterActive,O=r.onLeaveActive,x=r.onAppearEnd,N=r.onEnterEnd,F=r.onLeaveEnd,L=r.onVisibleChanged,D=Tf(),V=de(D,2),B=V[0],W=V[1],X=HF(Sa),Y=de(X,2),ae=Y[0],U=Y[1],z=Tf(null),j=de(z,2),Z=j[0],P=j[1],$=ae(),ie=_.useRef(!1),se=_.useRef(null);function q(){return n()}var ce=_.useRef(!1);function fe(){U(Sa),P(null,!0)}var ye=fr(function(He){var Ge=ae();if(Ge!==Sa){var Pe=q();if(!(He&&!He.deadline&&He.target!==Pe)){var Me=ce.current,dt;Ge===sh&&Me?dt=x==null?void 0:x(Pe,He):Ge===ah&&Me?dt=N==null?void 0:N(Pe,He):Ge===oh&&Me&&(dt=F==null?void 0:F(Pe,He)),Me&&dt!==!1&&fe()}}}),Ee=qF(ye),Ce=de(Ee,1),Te=Ce[0],ve=function(Ge){switch(Ge){case sh:return K(K(K({},qi,v),jl,E),Wl,T);case ah:return K(K(K({},qi,S),jl,b),Wl,A);case oh:return K(K(K({},qi,w),jl,C),Wl,O);default:return{}}},ge=_.useMemo(function(){return ve($)},[$]),_e=GF($,!t,function(He){if(He===qi){var Ge=ge[qi];return Ge?Ge(q()):O3}if(xe in ge){var Pe;P(((Pe=ge[xe])===null||Pe===void 0?void 0:Pe.call(ge,q(),null))||null)}return xe===Wl&&$!==Sa&&(Te(q()),g>0&&(clearTimeout(se.current),se.current=setTimeout(function(){ye({deadline:!0})},g))),xe===w3&&fe(),QF}),Ie=de(_e,2),we=Ie[0],xe=Ie[1],Ve=P3(xe);ce.current=Ve;var Fe=_.useRef(null);M3(function(){if(!(ie.current&&Fe.current===e)){W(e);var He=ie.current;ie.current=!0;var Ge;!He&&e&&u&&(Ge=sh),He&&e&&a&&(Ge=ah),(He&&!e&&h||!He&&m&&!e&&h)&&(Ge=oh);var Pe=ve(Ge);Ge&&(t||Pe[qi])?(U(Ge),we()):U(Sa),Fe.current=e}},[e]),_.useEffect(function(){($===sh&&!u||$===ah&&!a||$===oh&&!h)&&U(Sa)},[u,a,h]),_.useEffect(function(){return function(){ie.current=!1,clearTimeout(se.current)}},[]);var Be=_.useRef(!1);_.useEffect(function(){B&&(Be.current=!0),B!==void 0&&$===Sa&&((Be.current||B)&&(L==null||L(B)),Be.current=!0)},[B,$]);var nt=Z;return ge[qi]&&xe===jl&&(nt=J({transition:"none"},nt)),[$,xe,nt,B??e]}function ek(t){var e=t;pt(t)==="object"&&(e=t.transitionSupport);function n(i,a){return!!(i.motionName&&e&&a!==!1)}var r=_.forwardRef(function(i,a){var l=i.visible,u=l===void 0?!0:l,f=i.removeOnLeave,h=f===void 0?!0:f,g=i.forceRender,m=i.children,v=i.motionName,S=i.leavedClassName,w=i.eventProps,E=_.useContext(E3),b=E.motion,C=n(i,b),T=_.useRef(),A=_.useRef();function O(){try{return T.current instanceof HTMLElement?T.current:Gu(A.current)}catch{return null}}var x=JF(C,u,O,i),N=de(x,4),F=N[0],L=N[1],D=N[2],V=N[3],B=_.useRef(V);V&&(B.current=!0);var W=_.useCallback(function(j){T.current=j,Iy(a,j)},[a]),X,Y=J(J({},w),{},{visible:u});if(!m)X=null;else if(F===Sa)V?X=m(J({},Y),W):!h&&B.current&&S?X=m(J(J({},Y),{},{className:S}),W):g||!h&&!S?X=m(J(J({},Y),{},{style:{display:"none"}}),W):X=null;else{var ae;L===qi?ae="prepare":P3(L)?ae="active":L===jl&&(ae="start");var U=yT(v,"".concat(F,"-").concat(ae));X=m(J(J({},Y),{},{className:Ze(yT(v,F),K(K({},U,U&&ae),v,typeof v=="string")),style:D}),W)}if(_.isValidElement(X)&&Qg(X)){var z=Dy(X);z||(X=_.cloneElement(X,{ref:W}))}return _.createElement(VF,{ref:A},X)});return r.displayName="CSSMotion",r}const Ky=ek(x3);var a_="add",o_="keep",l_="remove",Pv="removed";function tk(t){var e;return t&&pt(t)==="object"&&"key"in t?e=t:e={key:t},J(J({},e),{},{key:String(e.key)})}function c_(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return t.map(tk)}function nk(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=[],r=0,i=e.length,a=c_(t),l=c_(e);a.forEach(function(h){for(var g=!1,m=r;m1});return f.forEach(function(h){n=n.filter(function(g){var m=g.key,v=g.status;return m!==h||v!==l_}),n.forEach(function(g){g.key===h&&(g.status=o_)})}),n}var rk=["component","children","onVisibleChanged","onAllRemoved"],ik=["status"],sk=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearPrepare","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function ak(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ky,n=function(r){Xo(a,r);var i=qo(a);function a(){var l;xr(this,a);for(var u=arguments.length,f=new Array(u),h=0;hnull;var ck=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);ie.endsWith("Color"))}const hk=t=>{const{prefixCls:e,iconPrefixCls:n,theme:r,holderRender:i}=t;e!==void 0&&(N3=e),r&&dk(r)&&dF(fk(),r)},gk=t=>{const{children:e,csp:n,autoInsertSpaceInButton:r,alert:i,anchor:a,form:l,locale:u,componentSize:f,direction:h,space:g,splitter:m,virtual:v,dropdownMatchSelectWidth:S,popupMatchSelectWidth:w,popupOverflow:E,legacyLocale:b,parentContext:C,iconPrefixCls:T,theme:A,componentDisabled:O,segmented:x,statistic:N,spin:F,calendar:L,carousel:D,cascader:V,collapse:B,typography:W,checkbox:X,descriptions:Y,divider:ae,drawer:U,skeleton:z,steps:j,image:Z,layout:P,list:$,mentions:ie,modal:se,progress:q,result:ce,slider:fe,breadcrumb:ye,menu:Ee,pagination:Ce,input:Te,textArea:ve,empty:ge,badge:_e,radio:Ie,rate:we,switch:xe,transfer:Ve,avatar:Fe,message:Be,tag:nt,table:He,card:Ge,tabs:Pe,timeline:Me,timePicker:dt,upload:rt,notification:it,tree:st,colorPicker:at,datePicker:Je,rangePicker:lt,flex:ft,wave:ct,dropdown:mt,warning:xt,tour:Bt,tooltip:ht,popover:Vt,popconfirm:qt,floatButtonGroup:wn,variant:Mn,inputNumber:Ut,treeSelect:It}=t,Lt=_.useCallback((We,Qe)=>{const{prefixCls:bt}=t;if(Qe)return Qe;const _t=bt||C.getPrefixCls("");return We?`${_t}-${We}`:_t},[C.getPrefixCls,t.prefixCls]),Jt=T||C.iconPrefixCls||Xy,Mt=n||C.csp;FF(Jt,Mt);const qe=LF(A,C.theme,{prefixCls:Lt("")}),ke={csp:Mt,autoInsertSpaceInButton:r,alert:i,anchor:a,locale:u||b,direction:h,space:g,splitter:m,virtual:v,popupMatchSelectWidth:w??S,popupOverflow:E,getPrefixCls:Lt,iconPrefixCls:Jt,theme:qe,segmented:x,statistic:N,spin:F,calendar:L,carousel:D,cascader:V,collapse:B,typography:W,checkbox:X,descriptions:Y,divider:ae,drawer:U,skeleton:z,steps:j,image:Z,input:Te,textArea:ve,layout:P,list:$,mentions:ie,modal:se,progress:q,result:ce,slider:fe,breadcrumb:ye,menu:Ee,pagination:Ce,empty:ge,badge:_e,radio:Ie,rate:we,switch:xe,transfer:Ve,avatar:Fe,message:Be,tag:nt,table:He,card:Ge,tabs:Pe,timeline:Me,timePicker:dt,upload:rt,notification:it,tree:st,colorPicker:at,datePicker:Je,rangePicker:lt,flex:ft,wave:ct,dropdown:mt,warning:xt,tour:Bt,tooltip:ht,popover:Vt,popconfirm:qt,floatButtonGroup:wn,variant:Mn,inputNumber:Ut,treeSelect:It},Ne=Object.assign({},C);Object.keys(ke).forEach(We=>{ke[We]!==void 0&&(Ne[We]=ke[We])}),uk.forEach(We=>{const Qe=t[We];Qe&&(Ne[We]=Qe)}),typeof r<"u"&&(Ne.button=Object.assign({autoInsertSpace:r},Ne.button));const Et=Yg(()=>Ne,Ne,(We,Qe)=>{const bt=Object.keys(We),_t=Object.keys(Qe);return bt.length!==_t.length||bt.some(Zt=>We[Zt]!==Qe[Zt])}),{layer:en}=_.useContext($f),Ue=_.useMemo(()=>({prefixCls:Jt,csp:Mt,layer:en?"antd":void 0}),[Jt,Mt,en]);let Oe=_.createElement(_.Fragment,null,_.createElement(lk,{dropdownMatchSelectWidth:S}),e);const je=_.useMemo(()=>{var We,Qe,bt,_t;return Hl(((We=Ec.Form)===null||We===void 0?void 0:We.defaultValidateMessages)||{},((bt=(Qe=Et.locale)===null||Qe===void 0?void 0:Qe.Form)===null||bt===void 0?void 0:bt.defaultValidateMessages)||{},((_t=Et.form)===null||_t===void 0?void 0:_t.validateMessages)||{},(l==null?void 0:l.validateMessages)||{})},[Et,l==null?void 0:l.validateMessages]);Object.keys(je).length>0&&(Oe=_.createElement(z5.Provider,{value:je},Oe)),u&&(Oe=_.createElement(X5,{locale:u,_ANT_MARK__:W5},Oe)),Oe=_.createElement(Hy.Provider,{value:Ue},Oe),f&&(Oe=_.createElement(gF,{size:f},Oe)),Oe=_.createElement(ok,null,Oe);const Ye=_.useMemo(()=>{const We=qe||{},{algorithm:Qe,token:bt,components:_t,cssVar:Zt}=We,Yt=ck(We,["algorithm","token","components","cssVar"]),vn=Qe&&(!Array.isArray(Qe)||Qe.length>0)?L0(Qe):h3,On={};Object.entries(_t||{}).forEach(Zn=>{let[un,rn]=Zn;const Ae=Object.assign({},rn);"algorithm"in Ae&&(Ae.algorithm===!0?Ae.theme=vn:(Array.isArray(Ae.algorithm)||typeof Ae.algorithm=="function")&&(Ae.theme=L0(Ae.algorithm)),delete Ae.algorithm),On[un]=Ae});const _n=Object.assign(Object.assign({},Sf),bt);return Object.assign(Object.assign({},Yt),{theme:vn,token:_n,components:On,override:Object.assign({override:_n},On),cssVar:Zt})},[qe]);return A&&(Oe=_.createElement(g3.Provider,{value:Ye},Oe)),Et.warning&&(Oe=_.createElement(L5.Provider,{value:Et.warning},Oe)),O!==void 0&&(Oe=_.createElement(hF,{disabled:O},Oe)),_.createElement(ci.Provider,{value:Et},Oe)},$c=t=>{const e=_.useContext(ci),n=_.useContext(jy);return _.createElement(gk,Object.assign({parentContext:e,legacyLocale:n},t))};$c.ConfigContext=ci;$c.SizeContext=wc;$c.config=hk;$c.useConfig=pF;Object.defineProperty($c,"SizeContext",{get:()=>wc});function I3(t){var e;return t==null||(e=t.getRootNode)===null||e===void 0?void 0:e.call(t)}function pk(t){return I3(t)instanceof ShadowRoot}function Qh(t){return pk(t)?I3(t):null}function mk(t){return t.replace(/-(.)/g,function(e,n){return n.toUpperCase()})}function vk(t,e){kr(t,"[@ant-design/icons] ".concat(e))}function bT(t){return pt(t)==="object"&&typeof t.name=="string"&&typeof t.theme=="string"&&(pt(t.icon)==="object"||typeof t.icon=="function")}function ST(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Object.keys(t).reduce(function(e,n){var r=t[n];switch(n){case"class":e.className=r,delete e.class;break;default:delete e[n],e[mk(n)]=r}return e},{})}function u_(t,e,n){return n?Ft.createElement(t.tag,J(J({key:e},ST(t.attrs)),n),(t.children||[]).map(function(r,i){return u_(r,"".concat(e,"-").concat(t.tag,"-").concat(i))})):Ft.createElement(t.tag,J({key:e},ST(t.attrs)),(t.children||[]).map(function(r,i){return u_(r,"".concat(e,"-").concat(t.tag,"-").concat(i))}))}function D3(t){return Ef(t)[0]}function F3(t){return t?Array.isArray(t)?t:[t]:[]}var _k=` -.anticon { - display: inline-flex; - align-items: center; - 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); - } -} -`,yk=function(e){var n=_.useContext(Hy),r=n.csp,i=n.prefixCls,a=n.layer,l=_k;i&&(l=l.replace(/anticon/g,i)),a&&(l="@layer ".concat(a,` { -`).concat(l,` -}`)),_.useEffect(function(){var u=e.current,f=Qh(u);Hs(l,"@ant-design-icons",{prepend:!a,csp:r,attachTo:f})},[])},bk=["icon","className","onClick","style","primaryColor","secondaryColor"],ef={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function Sk(t){var e=t.primaryColor,n=t.secondaryColor;ef.primaryColor=e,ef.secondaryColor=n||D3(e),ef.calculated=!!n}function Ek(){return J({},ef)}var Vc=function(e){var n=e.icon,r=e.className,i=e.onClick,a=e.style,l=e.primaryColor,u=e.secondaryColor,f=Fn(e,bk),h=_.useRef(),g=ef;if(l&&(g={primaryColor:l,secondaryColor:u||D3(l)}),yk(h),vk(bT(n),"icon should be icon definiton, but got ".concat(n)),!bT(n))return null;var m=n;return m&&typeof m.icon=="function"&&(m=J(J({},m),{},{icon:m.icon(g.primaryColor,g.secondaryColor)})),u_(m.icon,"svg-".concat(m.name),J(J({className:r,onClick:i,style:a,"data-icon":m.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},f),{},{ref:h}))};Vc.displayName="IconReact";Vc.getTwoToneColors=Ek;Vc.setTwoToneColors=Sk;function k3(t){var e=F3(t),n=de(e,2),r=n[0],i=n[1];return Vc.setTwoToneColors({primaryColor:r,secondaryColor:i})}function wk(){var t=Vc.getTwoToneColors();return t.calculated?[t.primaryColor,t.secondaryColor]:t.primaryColor}var Tk=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];k3(Kh.primary);var Xs=_.forwardRef(function(t,e){var n=t.className,r=t.icon,i=t.spin,a=t.rotate,l=t.tabIndex,u=t.onClick,f=t.twoToneColor,h=Fn(t,Tk),g=_.useContext(Hy),m=g.prefixCls,v=m===void 0?"anticon":m,S=g.rootClassName,w=Ze(S,v,K(K({},"".concat(v,"-").concat(r.name),!!r.name),"".concat(v,"-spin"),!!i||r.name==="loading"),n),E=l;E===void 0&&u&&(E=-1);var b=a?{msTransform:"rotate(".concat(a,"deg)"),transform:"rotate(".concat(a,"deg)")}:void 0,C=F3(f),T=de(C,2),A=T[0],O=T[1];return _.createElement("span",kt({role:"img","aria-label":r.name},h,{ref:e,tabIndex:E,onClick:u,className:w}),_.createElement(Vc,{icon:r,primaryColor:A,secondaryColor:O,style:b}))});Xs.displayName="AntdIcon";Xs.getTwoToneColor=wk;Xs.setTwoToneColor=k3;var Ck={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"}}]},name:"close-circle",theme:"filled"},Ak=function(e,n){return _.createElement(Xs,kt({},e,{ref:n,icon:Ck}))},Rk=_.forwardRef(Ak),xk={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z"}}]},name:"close",theme:"outlined"},Mk=function(e,n){return _.createElement(Xs,kt({},e,{ref:n,icon:xk}))},Ok=_.forwardRef(Mk),Pk=`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`,Nk=`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`,Ik="".concat(Pk," ").concat(Nk).split(/[\s\n]+/),Dk="aria-",Fk="data-";function ET(t,e){return t.indexOf(e)===0}function Gh(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n;e===!1?n={aria:!0,data:!0,attr:!0}:e===!0?n={aria:!0}:n=J({},e);var r={};return Object.keys(t).forEach(function(i){(n.aria&&(i==="role"||ET(i,Dk))||n.data&&ET(i,Fk)||n.attr&&Ik.includes(i))&&(r[i]=t[i])}),r}function kk(t){return t&&Ft.isValidElement(t)&&t.type===Ft.Fragment}const Bk=(t,e,n)=>Ft.isValidElement(t)?Ft.cloneElement(t,typeof n=="function"?n(t.props||{}):n):e;function B3(t,e){return Bk(t,t,e)}const Uk=t=>{const[,,,,e]=Ws();return e?`${t}-css-var`:""};var et={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,CAPS_LOCK:20,ESC:27,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46,N:78,P:80,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,SEMICOLON:186,EQUALS:187,WIN_KEY:224},Lk={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"},zk=function(e,n){return _.createElement(Xs,kt({},e,{ref:n,icon:Lk}))},$k=_.forwardRef(zk);const U3=Ft.createContext(void 0),co=100,L3={Modal:co,Drawer:co,Popover:co,Popconfirm:co,Tooltip:co,Tour:co,FloatButton:co},Vk={SelectLike:50,Dropdown:50,DatePicker:50,Menu:50,ImagePreview:1};function Hk(t){return t in L3}const z3=(t,e)=>{const[,n]=Ws(),r=Ft.useContext(U3),i=Hk(t);let a;if(e!==void 0)a=[e,e];else{let l=r??0;i?l+=(r?0:n.zIndexPopupBase)+L3[t]:l+=Vk[t],a=[r===void 0?e:l,l]}return a};function ts(){ts=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(U,z,j){U[z]=j.value},a=typeof Symbol=="function"?Symbol:{},l=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",f=a.toStringTag||"@@toStringTag";function h(U,z,j){return Object.defineProperty(U,z,{value:j,enumerable:!0,configurable:!0,writable:!0}),U[z]}try{h({},"")}catch{h=function(j,Z,P){return j[Z]=P}}function g(U,z,j,Z){var P=z&&z.prototype instanceof C?z:C,$=Object.create(P.prototype),ie=new Y(Z||[]);return i($,"_invoke",{value:V(U,j,ie)}),$}function m(U,z,j){try{return{type:"normal",arg:U.call(z,j)}}catch(Z){return{type:"throw",arg:Z}}}e.wrap=g;var v="suspendedStart",S="suspendedYield",w="executing",E="completed",b={};function C(){}function T(){}function A(){}var O={};h(O,l,function(){return this});var x=Object.getPrototypeOf,N=x&&x(x(ae([])));N&&N!==n&&r.call(N,l)&&(O=N);var F=A.prototype=C.prototype=Object.create(O);function L(U){["next","throw","return"].forEach(function(z){h(U,z,function(j){return this._invoke(z,j)})})}function D(U,z){function j(P,$,ie,se){var q=m(U[P],U,$);if(q.type!=="throw"){var ce=q.arg,fe=ce.value;return fe&&pt(fe)=="object"&&r.call(fe,"__await")?z.resolve(fe.__await).then(function(ye){j("next",ye,ie,se)},function(ye){j("throw",ye,ie,se)}):z.resolve(fe).then(function(ye){ce.value=ye,ie(ce)},function(ye){return j("throw",ye,ie,se)})}se(q.arg)}var Z;i(this,"_invoke",{value:function($,ie){function se(){return new z(function(q,ce){j($,ie,q,ce)})}return Z=Z?Z.then(se,se):se()}})}function V(U,z,j){var Z=v;return function(P,$){if(Z===w)throw Error("Generator is already running");if(Z===E){if(P==="throw")throw $;return{value:t,done:!0}}for(j.method=P,j.arg=$;;){var ie=j.delegate;if(ie){var se=B(ie,j);if(se){if(se===b)continue;return se}}if(j.method==="next")j.sent=j._sent=j.arg;else if(j.method==="throw"){if(Z===v)throw Z=E,j.arg;j.dispatchException(j.arg)}else j.method==="return"&&j.abrupt("return",j.arg);Z=w;var q=m(U,z,j);if(q.type==="normal"){if(Z=j.done?E:S,q.arg===b)continue;return{value:q.arg,done:j.done}}q.type==="throw"&&(Z=E,j.method="throw",j.arg=q.arg)}}}function B(U,z){var j=z.method,Z=U.iterator[j];if(Z===t)return z.delegate=null,j==="throw"&&U.iterator.return&&(z.method="return",z.arg=t,B(U,z),z.method==="throw")||j!=="return"&&(z.method="throw",z.arg=new TypeError("The iterator does not provide a '"+j+"' method")),b;var P=m(Z,U.iterator,z.arg);if(P.type==="throw")return z.method="throw",z.arg=P.arg,z.delegate=null,b;var $=P.arg;return $?$.done?(z[U.resultName]=$.value,z.next=U.nextLoc,z.method!=="return"&&(z.method="next",z.arg=t),z.delegate=null,b):$:(z.method="throw",z.arg=new TypeError("iterator result is not an object"),z.delegate=null,b)}function W(U){var z={tryLoc:U[0]};1 in U&&(z.catchLoc=U[1]),2 in U&&(z.finallyLoc=U[2],z.afterLoc=U[3]),this.tryEntries.push(z)}function X(U){var z=U.completion||{};z.type="normal",delete z.arg,U.completion=z}function Y(U){this.tryEntries=[{tryLoc:"root"}],U.forEach(W,this),this.reset(!0)}function ae(U){if(U||U===""){var z=U[l];if(z)return z.call(U);if(typeof U.next=="function")return U;if(!isNaN(U.length)){var j=-1,Z=function P(){for(;++j=0;--P){var $=this.tryEntries[P],ie=$.completion;if($.tryLoc==="root")return Z("end");if($.tryLoc<=this.prev){var se=r.call($,"catchLoc"),q=r.call($,"finallyLoc");if(se&&q){if(this.prev<$.catchLoc)return Z($.catchLoc,!0);if(this.prev<$.finallyLoc)return Z($.finallyLoc)}else if(se){if(this.prev<$.catchLoc)return Z($.catchLoc,!0)}else{if(!q)throw Error("try statement without catch or finally");if(this.prev<$.finallyLoc)return Z($.finallyLoc)}}}},abrupt:function(z,j){for(var Z=this.tryEntries.length-1;Z>=0;--Z){var P=this.tryEntries[Z];if(P.tryLoc<=this.prev&&r.call(P,"finallyLoc")&&this.prev=0;--j){var Z=this.tryEntries[j];if(Z.finallyLoc===z)return this.complete(Z.completion,Z.afterLoc),X(Z),b}},catch:function(z){for(var j=this.tryEntries.length-1;j>=0;--j){var Z=this.tryEntries[j];if(Z.tryLoc===z){var P=Z.completion;if(P.type==="throw"){var $=P.arg;X(Z)}return $}}throw Error("illegal catch attempt")},delegateYield:function(z,j,Z){return this.delegate={iterator:ae(z),resultName:j,nextLoc:Z},this.method==="next"&&(this.arg=t),b}},e}function wT(t,e,n,r,i,a,l){try{var u=t[a](l),f=u.value}catch(h){return void n(h)}u.done?e(f):Promise.resolve(f).then(r,i)}function Vf(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var a=t.apply(e,n);function l(f){wT(a,r,i,l,u,"next",f)}function u(f){wT(a,r,i,l,u,"throw",f)}l(void 0)})}}const $3=(t,e,n)=>n!==void 0?n:`${t}-${e}`;function V3(t,e){var n=Object.assign({},t);return Array.isArray(e)&&e.forEach(function(r){delete n[r]}),n}const jk=function(t){if(!t)return!1;if(t instanceof Element){if(t.offsetParent)return!0;if(t.getBBox){var e=t.getBBox(),n=e.width,r=e.height;if(n||r)return!0}if(t.getBoundingClientRect){var i=t.getBoundingClientRect(),a=i.width,l=i.height;if(a||l)return!0}}return!1},H3=t=>{const e=Ft.useContext(wc);return Ft.useMemo(()=>t?typeof t=="string"?t??e:t instanceof Function?t(e):e:e,[t,e])},Wk=t=>{const{componentCls:e}=t;return{[e]:{"&-block":{display:"flex",width:"100%"},"&-vertical":{flexDirection:"column"}}}},Xk=t=>{const{componentCls:e,antCls:n}=t;return{[e]:{display:"inline-flex","&-rtl":{direction:"rtl"},"&-vertical":{flexDirection:"column"},"&-align":{flexDirection:"column","&-center":{alignItems:"center"},"&-start":{alignItems:"flex-start"},"&-end":{alignItems:"flex-end"},"&-baseline":{alignItems:"baseline"}},[`${e}-item:empty`]:{display:"none"},[`${e}-item > ${n}-badge-not-a-wrapper:only-child`]:{display:"block"}}}},qk=t=>{const{componentCls:e}=t;return{[e]:{"&-gap-row-small":{rowGap:t.spaceGapSmallSize},"&-gap-row-middle":{rowGap:t.spaceGapMiddleSize},"&-gap-row-large":{rowGap:t.spaceGapLargeSize},"&-gap-col-small":{columnGap:t.spaceGapSmallSize},"&-gap-col-middle":{columnGap:t.spaceGapMiddleSize},"&-gap-col-large":{columnGap:t.spaceGapLargeSize}}}},j3=zc("Space",t=>{const e=ui(t,{spaceGapSmallSize:t.paddingXS,spaceGapMiddleSize:t.padding,spaceGapLargeSize:t.paddingLG});return[Xk(e),qk(e),Wk(e)]},()=>({}),{resetStyle:!1});var W3=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{const n=_.useContext(np),r=_.useMemo(()=>{if(!n)return"";const{compactDirection:i,isFirstItem:a,isLastItem:l}=n,u=i==="vertical"?"-vertical-":"-";return Ze(`${t}-compact${u}item`,{[`${t}-compact${u}first-item`]:a,[`${t}-compact${u}last-item`]:l,[`${t}-compact${u}item-rtl`]:e==="rtl"})},[t,e,n]);return{compactSize:n==null?void 0:n.compactSize,compactDirection:n==null?void 0:n.compactDirection,compactItemClassnames:r}},Kk=t=>{const{children:e}=t;return _.createElement(np.Provider,{value:null},e)},Zk=t=>{const{children:e}=t,n=W3(t,["children"]);return _.createElement(np.Provider,{value:_.useMemo(()=>n,[n])},e)},Qk=t=>{const{getPrefixCls:e,direction:n}=_.useContext(ci),{size:r,direction:i,block:a,prefixCls:l,className:u,rootClassName:f,children:h}=t,g=W3(t,["size","direction","block","prefixCls","className","rootClassName","children"]),m=H3(A=>r??A),v=e("space-compact",l),[S,w]=j3(v),E=Ze(v,w,{[`${v}-rtl`]:n==="rtl",[`${v}-block`]:a,[`${v}-vertical`]:i==="vertical"},u,f),b=_.useContext(np),C=Lo(h),T=_.useMemo(()=>C.map((A,O)=>{const x=(A==null?void 0:A.key)||`${v}-item-${O}`;return _.createElement(Zk,{key:x,compactSize:m,compactDirection:i,isFirstItem:O===0&&(!b||(b==null?void 0:b.isFirstItem)),isLastItem:O===C.length-1&&(!b||(b==null?void 0:b.isLastItem))},A)}),[r,C,b]);return C.length===0?null:S(_.createElement("div",Object.assign({className:E},g),T))},Gk=t=>({animationDuration:t,animationFillMode:"both"}),Jk=t=>({animationDuration:t,animationFillMode:"both"}),Zy=function(t,e,n,r){const a=(arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1)?"&":"";return{[` - ${a}${t}-enter, - ${a}${t}-appear - `]:Object.assign(Object.assign({},Gk(r)),{animationPlayState:"paused"}),[`${a}${t}-leave`]:Object.assign(Object.assign({},Jk(r)),{animationPlayState:"paused"}),[` - ${a}${t}-enter${t}-enter-active, - ${a}${t}-appear${t}-appear-active - `]:{animationName:e,animationPlayState:"running"},[`${a}${t}-leave${t}-leave-active`]:{animationName:n,animationPlayState:"running",pointerEvents:"none"}}},e8=new ln("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),t8=new ln("antMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}}),n8=new ln("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),r8=new ln("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),i8=new ln("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),s8=new ln("antMoveRightOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),a8=new ln("antMoveUpIn",{"0%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),o8=new ln("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}}),l8={"move-up":{inKeyframes:a8,outKeyframes:o8},"move-down":{inKeyframes:e8,outKeyframes:t8},"move-left":{inKeyframes:n8,outKeyframes:r8},"move-right":{inKeyframes:i8,outKeyframes:s8}},TT=(t,e)=>{const{antCls:n}=t,r=`${n}-${e}`,{inKeyframes:i,outKeyframes:a}=l8[e];return[Zy(r,i,a,t.motionDurationMid),{[` - ${r}-enter, - ${r}-appear - `]:{opacity:0,animationTimingFunction:t.motionEaseOutCirc},[`${r}-leave`]:{animationTimingFunction:t.motionEaseInOutCirc}}]},X3=new ln("antSlideUpIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1}}),q3=new ln("antSlideUpOut",{"0%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}}),Y3=new ln("antSlideDownIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1}}),K3=new ln("antSlideDownOut",{"0%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0}}),c8=new ln("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),u8=new ln("antSlideLeftOut",{"0%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0}}),f8=new ln("antSlideRightIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1}}),d8=new ln("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}}),h8={"slide-up":{inKeyframes:X3,outKeyframes:q3},"slide-down":{inKeyframes:Y3,outKeyframes:K3},"slide-left":{inKeyframes:c8,outKeyframes:u8},"slide-right":{inKeyframes:f8,outKeyframes:d8}},CT=(t,e)=>{const{antCls:n}=t,r=`${n}-${e}`,{inKeyframes:i,outKeyframes:a}=h8[e];return[Zy(r,i,a,t.motionDurationMid),{[` - ${r}-enter, - ${r}-appear - `]:{transform:"scale(0)",transformOrigin:"0% 0%",opacity:0,animationTimingFunction:t.motionEaseOutQuint,"&-prepare":{transform:"scale(1)"}},[`${r}-leave`]:{animationTimingFunction:t.motionEaseInQuint}}]},g8=new ln("antZoomIn",{"0%":{transform:"scale(0.2)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),p8=new ln("antZoomOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.2)",opacity:0}}),AT=new ln("antZoomBigIn",{"0%":{transform:"scale(0.8)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),RT=new ln("antZoomBigOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.8)",opacity:0}}),m8=new ln("antZoomUpIn",{"0%":{transform:"scale(0.8)",transformOrigin:"50% 0%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"50% 0%"}}),v8=new ln("antZoomUpOut",{"0%":{transform:"scale(1)",transformOrigin:"50% 0%"},"100%":{transform:"scale(0.8)",transformOrigin:"50% 0%",opacity:0}}),_8=new ln("antZoomLeftIn",{"0%":{transform:"scale(0.8)",transformOrigin:"0% 50%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"0% 50%"}}),y8=new ln("antZoomLeftOut",{"0%":{transform:"scale(1)",transformOrigin:"0% 50%"},"100%":{transform:"scale(0.8)",transformOrigin:"0% 50%",opacity:0}}),b8=new ln("antZoomRightIn",{"0%":{transform:"scale(0.8)",transformOrigin:"100% 50%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"100% 50%"}}),S8=new ln("antZoomRightOut",{"0%":{transform:"scale(1)",transformOrigin:"100% 50%"},"100%":{transform:"scale(0.8)",transformOrigin:"100% 50%",opacity:0}}),E8=new ln("antZoomDownIn",{"0%":{transform:"scale(0.8)",transformOrigin:"50% 100%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"50% 100%"}}),w8=new ln("antZoomDownOut",{"0%":{transform:"scale(1)",transformOrigin:"50% 100%"},"100%":{transform:"scale(0.8)",transformOrigin:"50% 100%",opacity:0}}),T8={zoom:{inKeyframes:g8,outKeyframes:p8},"zoom-big":{inKeyframes:AT,outKeyframes:RT},"zoom-big-fast":{inKeyframes:AT,outKeyframes:RT},"zoom-left":{inKeyframes:_8,outKeyframes:y8},"zoom-right":{inKeyframes:b8,outKeyframes:S8},"zoom-up":{inKeyframes:m8,outKeyframes:v8},"zoom-down":{inKeyframes:E8,outKeyframes:w8}},C8=(t,e)=>{const{antCls:n}=t,r=`${n}-${e}`,{inKeyframes:i,outKeyframes:a}=T8[e];return[Zy(r,i,a,t.motionDurationFast),{[` - ${r}-enter, - ${r}-appear - `]:{transform:"scale(0)",opacity:0,animationTimingFunction:t.motionEaseOutCirc,"&-prepare":{transform:"none"}},[`${r}-leave`]:{animationTimingFunction:t.motionEaseInOutCirc}}]};function A8(t,e,n){const{focusElCls:r,focus:i,borderElCls:a}=n,l=a?"> *":"",u=["hover",i?"focus":null,"active"].filter(Boolean).map(f=>`&:${f} ${l}`).join(",");return{[`&-item:not(${e}-last-item)`]:{marginInlineEnd:t.calc(t.lineWidth).mul(-1).equal()},"&-item":Object.assign(Object.assign({[u]:{zIndex:2}},r?{[`&${r}`]:{zIndex:2}}:{}),{[`&[disabled] ${l}`]:{zIndex:0}})}}function R8(t,e,n){const{borderElCls:r}=n,i=r?`> ${r}`:"";return{[`&-item:not(${e}-first-item):not(${e}-last-item) ${i}`]:{borderRadius:0},[`&-item:not(${e}-last-item)${e}-first-item`]:{[`& ${i}, &${t}-sm ${i}, &${t}-lg ${i}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&-item:not(${e}-first-item)${e}-last-item`]:{[`& ${i}, &${t}-sm ${i}, &${t}-lg ${i}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}}function x8(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{focus:!0};const{componentCls:n}=t,r=`${n}-compact`;return{[r]:Object.assign(Object.assign({},A8(t,r,e)),R8(n,r,e))}}var Z3=_.createContext(null),xT=[];function M8(t,e){var n=_.useState(function(){if(!Zr())return null;var w=document.createElement("div");return w}),r=de(n,1),i=r[0],a=_.useRef(!1),l=_.useContext(Z3),u=_.useState(xT),f=de(u,2),h=f[0],g=f[1],m=l||(a.current?void 0:function(w){g(function(E){var b=[w].concat(ze(E));return b})});function v(){i.parentElement||document.body.appendChild(i),a.current=!0}function S(){var w;(w=i.parentElement)===null||w===void 0||w.removeChild(i),a.current=!1}return Dn(function(){return t?l?l(v):v():S(),S},[t]),Dn(function(){h.length&&(h.forEach(function(w){return w()}),g(xT))},[h]),[i,m]}function O8(t){var e="rc-scrollbar-measure-".concat(Math.random().toString(36).substring(7)),n=document.createElement("div");n.id=e;var r=n.style;r.position="absolute",r.left="0",r.top="0",r.width="100px",r.height="100px",r.overflow="scroll";var i,a;if(t){var l=getComputedStyle(t);r.scrollbarColor=l.scrollbarColor,r.scrollbarWidth=l.scrollbarWidth;var u=getComputedStyle(t,"::-webkit-scrollbar"),f=parseInt(u.width,10),h=parseInt(u.height,10);try{var g=f?"width: ".concat(u.width,";"):"",m=h?"height: ".concat(u.height,";"):"";Hs(` -#`.concat(e,`::-webkit-scrollbar { -`).concat(g,` -`).concat(m,` -}`),e)}catch(w){console.error(w),i=f,a=h}}document.body.appendChild(n);var v=t&&i&&!isNaN(i)?i:n.offsetWidth-n.clientWidth,S=t&&a&&!isNaN(a)?a:n.offsetHeight-n.clientHeight;return document.body.removeChild(n),yf(e),{width:v,height:S}}function P8(t){return typeof document>"u"||!t||!(t instanceof Element)?{width:0,height:0}:O8(t)}function N8(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}var I8="rc-util-locker-".concat(Date.now()),MT=0;function D8(t){var e=!!t,n=_.useState(function(){return MT+=1,"".concat(I8,"_").concat(MT)}),r=de(n,1),i=r[0];Dn(function(){if(e){var a=P8(document.body).width,l=N8();Hs(` -html body { - overflow-y: hidden; - `.concat(l?"width: calc(100% - ".concat(a,"px);"):"",` -}`),i)}else yf(i);return function(){yf(i)}},[e,i])}var F8=!1;function k8(t){return F8}var OT=function(e){return e===!1?!1:!Zr()||!e?null:typeof e=="string"?document.querySelector(e):typeof e=="function"?e():e},Q3=_.forwardRef(function(t,e){var n=t.open,r=t.autoLock,i=t.getContainer;t.debug;var a=t.autoDestroy,l=a===void 0?!0:a,u=t.children,f=_.useState(n),h=de(f,2),g=h[0],m=h[1],v=g||n;_.useEffect(function(){(l||n)&&m(n)},[n,l]);var S=_.useState(function(){return OT(i)}),w=de(S,2),E=w[0],b=w[1];_.useEffect(function(){var B=OT(i);b(B??null)});var C=M8(v&&!E),T=de(C,2),A=T[0],O=T[1],x=E??A;D8(r&&n&&Zr()&&(x===A||x===document.body));var N=null;if(u&&Qg(u)&&e){var F=u;N=F.ref}var L=Zg(N,e);if(!v||!Zr()||E===void 0)return null;var D=x===!1||k8(),V=u;return e&&(V=_.cloneElement(u,{ref:L})),_.createElement(Z3.Provider,{value:O},D?V:za.createPortal(V,x))});function B8(){var t=J({},Wg);return t.useId}var PT=0,NT=B8();const G3=NT?function(e){var n=NT();return e||n}:function(e){var n=_.useState("ssr-id"),r=de(n,2),i=r[0],a=r[1];return _.useEffect(function(){var l=PT;PT+=1,a("rc_unique_".concat(l))},[]),e||i};var bo="RC_FORM_INTERNAL_HOOKS",gn=function(){kr(!1,"Can not find FormContext. Please make sure you wrap Field under Form.")},Cc=_.createContext({getFieldValue:gn,getFieldsValue:gn,getFieldError:gn,getFieldWarning:gn,getFieldsError:gn,isFieldsTouched:gn,isFieldTouched:gn,isFieldValidating:gn,isFieldsValidating:gn,resetFields:gn,setFields:gn,setFieldValue:gn,setFieldsValue:gn,validateFields:gn,submit:gn,getInternalHooks:function(){return gn(),{dispatch:gn,initEntityValue:gn,registerField:gn,useSubscribe:gn,setInitialValues:gn,destroyForm:gn,setCallbacks:gn,registerWatch:gn,getFields:gn,setValidateMessages:gn,setPreserve:gn,getInitialValue:gn}}}),Jh=_.createContext(null);function f_(t){return t==null?[]:Array.isArray(t)?t:[t]}function U8(t){return t&&!!t._init}function d_(){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 e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}var h_=d_();function L8(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}function z8(t,e,n){if(Fy())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var i=new(t.bind.apply(t,r));return n&&mf(i,n.prototype),i}function g_(t){var e=typeof Map=="function"?new Map:void 0;return g_=function(r){if(r===null||!L8(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(e!==void 0){if(e.has(r))return e.get(r);e.set(r,i)}function i(){return z8(r,arguments,vf(this).constructor)}return i.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),mf(i,r)},g_(t)}var $8=/%[sdj%]/g,V8=function(){};function p_(t){if(!t||!t.length)return null;var e={};return t.forEach(function(n){var r=n.field;e[r]=e[r]||[],e[r].push(n)}),e}function li(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r=a)return u;switch(u){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 u}});return l}return t}function H8(t){return t==="string"||t==="url"||t==="hex"||t==="email"||t==="date"||t==="pattern"}function hr(t,e){return!!(t==null||e==="array"&&Array.isArray(t)&&!t.length||H8(e)&&typeof t=="string"&&!t)}function j8(t,e,n){var r=[],i=0,a=t.length;function l(u){r.push.apply(r,ze(u||[])),i++,i===a&&n(r)}t.forEach(function(u){e(u,l)})}function IT(t,e,n){var r=0,i=t.length;function a(l){if(l&&l.length){n(l);return}var u=r;r=r+1,ue.max?i.push(li(a.messages[m].max,e.fullField,e.max)):u&&f&&(ge.max)&&i.push(li(a.messages[m].range,e.fullField,e.min,e.max))},J3=function(e,n,r,i,a,l){e.required&&(!r.hasOwnProperty(e.field)||hr(n,l||e.type))&&i.push(li(a.messages.required,e.fullField))},ch;const G8=function(){if(ch)return ch;var t="[a-fA-F\\d:]",e=function(N){return N&&N.includeBoundaries?"(?:(?<=\\s|^)(?=".concat(t,")|(?<=").concat(t,")(?=\\s|$))"):""},n="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",r="[a-fA-F\\d]{1,4}",i=["(?:".concat(r,":){7}(?:").concat(r,"|:)"),"(?:".concat(r,":){6}(?:").concat(n,"|:").concat(r,"|:)"),"(?:".concat(r,":){5}(?::").concat(n,"|(?::").concat(r,"){1,2}|:)"),"(?:".concat(r,":){4}(?:(?::").concat(r,"){0,1}:").concat(n,"|(?::").concat(r,"){1,3}|:)"),"(?:".concat(r,":){3}(?:(?::").concat(r,"){0,2}:").concat(n,"|(?::").concat(r,"){1,4}|:)"),"(?:".concat(r,":){2}(?:(?::").concat(r,"){0,3}:").concat(n,"|(?::").concat(r,"){1,5}|:)"),"(?:".concat(r,":){1}(?:(?::").concat(r,"){0,4}:").concat(n,"|(?::").concat(r,"){1,6}|:)"),"(?::(?:(?::".concat(r,"){0,5}:").concat(n,"|(?::").concat(r,"){1,7}|:))")],a="(?:%[0-9a-zA-Z]{1,})?",l="(?:".concat(i.join("|"),")").concat(a),u=new RegExp("(?:^".concat(n,"$)|(?:^").concat(l,"$)")),f=new RegExp("^".concat(n,"$")),h=new RegExp("^".concat(l,"$")),g=function(N){return N&&N.exact?u:new RegExp("(?:".concat(e(N)).concat(n).concat(e(N),")|(?:").concat(e(N)).concat(l).concat(e(N),")"),"g")};g.v4=function(x){return x&&x.exact?f:new RegExp("".concat(e(x)).concat(n).concat(e(x)),"g")},g.v6=function(x){return x&&x.exact?h:new RegExp("".concat(e(x)).concat(l).concat(e(x)),"g")};var m="(?:(?:[a-z]+:)?//)",v="(?:\\S+(?::\\S*)?@)?",S=g.v4().source,w=g.v6().source,E="(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)",b="(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*",C="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))",T="(?::\\d{2,5})?",A='(?:[/?#][^\\s"]*)?',O="(?:".concat(m,"|www\\.)").concat(v,"(?:localhost|").concat(S,"|").concat(w,"|").concat(E).concat(b).concat(C,")").concat(T).concat(A);return ch=new RegExp("(?:^".concat(O,"$)"),"i"),ch};var BT={email:/^(([^<>()\[\]\\.,;:\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},Xu={integer:function(e){return Xu.number(e)&&parseInt(e,10)===e},float:function(e){return Xu.number(e)&&!Xu.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch{return!1}},date:function(e){return typeof e.getTime=="function"&&typeof e.getMonth=="function"&&typeof e.getYear=="function"&&!isNaN(e.getTime())},number:function(e){return isNaN(e)?!1:typeof e=="number"},object:function(e){return pt(e)==="object"&&!Xu.array(e)},method:function(e){return typeof e=="function"},email:function(e){return typeof e=="string"&&e.length<=320&&!!e.match(BT.email)},url:function(e){return typeof e=="string"&&e.length<=2048&&!!e.match(G8())},hex:function(e){return typeof e=="string"&&!!e.match(BT.hex)}},J8=function(e,n,r,i,a){if(e.required&&n===void 0){J3(e,n,r,i,a);return}var l=["integer","float","array","regexp","object","method","email","number","date","url","hex"],u=e.type;l.indexOf(u)>-1?Xu[u](n)||i.push(li(a.messages.types[u],e.fullField,e.type)):u&&pt(n)!==e.type&&i.push(li(a.messages.types[u],e.fullField,e.type))},eB=function(e,n,r,i,a){(/^\s+$/.test(n)||n==="")&&i.push(li(a.messages.whitespace,e.fullField))};const Ht={required:J3,whitespace:eB,type:J8,range:Q8,enum:K8,pattern:Z8};var tB=function(e,n,r,i,a){var l=[],u=e.required||!e.required&&i.hasOwnProperty(e.field);if(u){if(hr(n)&&!e.required)return r();Ht.required(e,n,i,l,a)}r(l)},nB=function(e,n,r,i,a){var l=[],u=e.required||!e.required&&i.hasOwnProperty(e.field);if(u){if(n==null&&!e.required)return r();Ht.required(e,n,i,l,a,"array"),n!=null&&(Ht.type(e,n,i,l,a),Ht.range(e,n,i,l,a))}r(l)},rB=function(e,n,r,i,a){var l=[],u=e.required||!e.required&&i.hasOwnProperty(e.field);if(u){if(hr(n)&&!e.required)return r();Ht.required(e,n,i,l,a),n!==void 0&&Ht.type(e,n,i,l,a)}r(l)},iB=function(e,n,r,i,a){var l=[],u=e.required||!e.required&&i.hasOwnProperty(e.field);if(u){if(hr(n,"date")&&!e.required)return r();if(Ht.required(e,n,i,l,a),!hr(n,"date")){var f;n instanceof Date?f=n:f=new Date(n),Ht.type(e,f,i,l,a),f&&Ht.range(e,f.getTime(),i,l,a)}}r(l)},sB="enum",aB=function(e,n,r,i,a){var l=[],u=e.required||!e.required&&i.hasOwnProperty(e.field);if(u){if(hr(n)&&!e.required)return r();Ht.required(e,n,i,l,a),n!==void 0&&Ht[sB](e,n,i,l,a)}r(l)},oB=function(e,n,r,i,a){var l=[],u=e.required||!e.required&&i.hasOwnProperty(e.field);if(u){if(hr(n)&&!e.required)return r();Ht.required(e,n,i,l,a),n!==void 0&&(Ht.type(e,n,i,l,a),Ht.range(e,n,i,l,a))}r(l)},lB=function(e,n,r,i,a){var l=[],u=e.required||!e.required&&i.hasOwnProperty(e.field);if(u){if(hr(n)&&!e.required)return r();Ht.required(e,n,i,l,a),n!==void 0&&(Ht.type(e,n,i,l,a),Ht.range(e,n,i,l,a))}r(l)},cB=function(e,n,r,i,a){var l=[],u=e.required||!e.required&&i.hasOwnProperty(e.field);if(u){if(hr(n)&&!e.required)return r();Ht.required(e,n,i,l,a),n!==void 0&&Ht.type(e,n,i,l,a)}r(l)},uB=function(e,n,r,i,a){var l=[],u=e.required||!e.required&&i.hasOwnProperty(e.field);if(u){if(n===""&&(n=void 0),hr(n)&&!e.required)return r();Ht.required(e,n,i,l,a),n!==void 0&&(Ht.type(e,n,i,l,a),Ht.range(e,n,i,l,a))}r(l)},fB=function(e,n,r,i,a){var l=[],u=e.required||!e.required&&i.hasOwnProperty(e.field);if(u){if(hr(n)&&!e.required)return r();Ht.required(e,n,i,l,a),n!==void 0&&Ht.type(e,n,i,l,a)}r(l)},dB=function(e,n,r,i,a){var l=[],u=e.required||!e.required&&i.hasOwnProperty(e.field);if(u){if(hr(n,"string")&&!e.required)return r();Ht.required(e,n,i,l,a),hr(n,"string")||Ht.pattern(e,n,i,l,a)}r(l)},hB=function(e,n,r,i,a){var l=[],u=e.required||!e.required&&i.hasOwnProperty(e.field);if(u){if(hr(n)&&!e.required)return r();Ht.required(e,n,i,l,a),hr(n)||Ht.type(e,n,i,l,a)}r(l)},gB=function(e,n,r,i,a){var l=[],u=Array.isArray(n)?"array":pt(n);Ht.required(e,n,i,l,a,u),r(l)},pB=function(e,n,r,i,a){var l=[],u=e.required||!e.required&&i.hasOwnProperty(e.field);if(u){if(hr(n,"string")&&!e.required)return r();Ht.required(e,n,i,l,a,"string"),hr(n,"string")||(Ht.type(e,n,i,l,a),Ht.range(e,n,i,l,a),Ht.pattern(e,n,i,l,a),e.whitespace===!0&&Ht.whitespace(e,n,i,l,a))}r(l)},Nv=function(e,n,r,i,a){var l=e.type,u=[],f=e.required||!e.required&&i.hasOwnProperty(e.field);if(f){if(hr(n,l)&&!e.required)return r();Ht.required(e,n,i,u,a,l),hr(n,l)||Ht.type(e,n,i,u,a)}r(u)};const tf={string:pB,method:cB,number:uB,boolean:rB,regexp:hB,integer:lB,float:oB,array:nB,object:fB,enum:aB,pattern:dB,date:iB,url:Nv,hex:Nv,email:Nv,required:gB,any:tB};var Hf=function(){function t(e){xr(this,t),K(this,"rules",null),K(this,"_messages",h_),this.define(e)}return Mr(t,[{key:"define",value:function(n){var r=this;if(!n)throw new Error("Cannot configure a schema with no rules");if(pt(n)!=="object"||Array.isArray(n))throw new Error("Rules must be an object");this.rules={},Object.keys(n).forEach(function(i){var a=n[i];r.rules[i]=Array.isArray(a)?a:[a]})}},{key:"messages",value:function(n){return n&&(this._messages=kT(d_(),n)),this._messages}},{key:"validate",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},l=n,u=i,f=a;if(typeof u=="function"&&(f=u,u={}),!this.rules||Object.keys(this.rules).length===0)return f&&f(null,l),Promise.resolve(l);function h(w){var E=[],b={};function C(A){if(Array.isArray(A)){var O;E=(O=E).concat.apply(O,ze(A))}else E.push(A)}for(var T=0;T0&&arguments[0]!==void 0?arguments[0]:[],L=Array.isArray(F)?F:[F];!u.suppressWarning&&L.length&&t.warning("async-validator:",L),L.length&&b.message!==void 0&&(L=[].concat(b.message));var D=L.map(FT(b,l));if(u.first&&D.length)return S[b.field]=1,E(D);if(!C)E(D);else{if(b.required&&!w.value)return b.message!==void 0?D=[].concat(b.message).map(FT(b,l)):u.error&&(D=[u.error(b,li(u.messages.required,b.field))]),E(D);var V={};b.defaultField&&Object.keys(w.value).map(function(X){V[X]=b.defaultField}),V=J(J({},V),w.rule.fields);var B={};Object.keys(V).forEach(function(X){var Y=V[X],ae=Array.isArray(Y)?Y:[Y];B[X]=ae.map(T.bind(null,X))});var W=new t(B);W.messages(u.messages),w.rule.options&&(w.rule.options.messages=u.messages,w.rule.options.error=u.error),W.validate(w.value,w.rule.options||u,function(X){var Y=[];D&&D.length&&Y.push.apply(Y,ze(D)),X&&X.length&&Y.push.apply(Y,ze(X)),E(Y.length?Y:null)})}}var O;if(b.asyncValidator)O=b.asyncValidator(b,w.value,A,w.source,u);else if(b.validator){try{O=b.validator(b,w.value,A,w.source,u)}catch(F){var x,N;(x=(N=console).error)===null||x===void 0||x.call(N,F),u.suppressValidatorError||setTimeout(function(){throw F},0),A(F.message)}O===!0?A():O===!1?A(typeof b.message=="function"?b.message(b.fullField||b.field):b.message||"".concat(b.fullField||b.field," fails")):O instanceof Array?A(O):O instanceof Error&&A(O.message)}O&&O.then&&O.then(function(){return A()},function(F){return A(F)})},function(w){h(w)},l)}},{key:"getType",value:function(n){if(n.type===void 0&&n.pattern instanceof RegExp&&(n.type="pattern"),typeof n.validator!="function"&&n.type&&!tf.hasOwnProperty(n.type))throw new Error(li("Unknown rule type %s",n.type));return n.type||"string"}},{key:"getValidationMethod",value:function(n){if(typeof n.validator=="function")return n.validator;var r=Object.keys(n),i=r.indexOf("message");return i!==-1&&r.splice(i,1),r.length===1&&r[0]==="required"?tf.required:tf[this.getType(n)]||void 0}}]),t}();K(Hf,"register",function(e,n){if(typeof n!="function")throw new Error("Cannot register a validator by type, validator is not a function");tf[e]=n});K(Hf,"warning",V8);K(Hf,"messages",h_);K(Hf,"validators",tf);var si="'${name}' is not a valid ${type}",ex={default:"Validation error on field '${name}'",required:"'${name}' is required",enum:"'${name}' must be one of [${enum}]",whitespace:"'${name}' cannot be empty",date:{format:"'${name}' is invalid for format date",parse:"'${name}' could not be parsed as date",invalid:"'${name}' is invalid date"},types:{string:si,method:si,array:si,object:si,number:si,date:si,boolean:si,integer:si,float:si,regexp:si,email:si,url:si,hex:si},string:{len:"'${name}' must be exactly ${len} characters",min:"'${name}' must be at least ${min} characters",max:"'${name}' cannot be longer than ${max} characters",range:"'${name}' must be between ${min} and ${max} characters"},number:{len:"'${name}' must equal ${len}",min:"'${name}' cannot be less than ${min}",max:"'${name}' cannot be greater than ${max}",range:"'${name}' must be between ${min} and ${max}"},array:{len:"'${name}' must be exactly ${len} in length",min:"'${name}' cannot be less than ${min} in length",max:"'${name}' cannot be greater than ${max} in length",range:"'${name}' must be between ${min} and ${max} in length"},pattern:{mismatch:"'${name}' does not match pattern ${pattern}"}},UT=Hf;function mB(t,e){return t.replace(/\\?\$\{\w+\}/g,function(n){if(n.startsWith("\\"))return n.slice(1);var r=n.slice(2,-1);return e[r]})}var LT="CODE_LOGIC_ERROR";function m_(t,e,n,r,i){return v_.apply(this,arguments)}function v_(){return v_=Vf(ts().mark(function t(e,n,r,i,a){var l,u,f,h,g,m,v,S,w;return ts().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return l=J({},r),delete l.ruleIndex,UT.warning=function(){},l.validator&&(u=l.validator,l.validator=function(){try{return u.apply(void 0,arguments)}catch(C){return console.error(C),Promise.reject(LT)}}),f=null,l&&l.type==="array"&&l.defaultField&&(f=l.defaultField,delete l.defaultField),h=new UT(K({},e,[l])),g=Hl(ex,i.validateMessages),h.messages(g),m=[],b.prev=10,b.next=13,Promise.resolve(h.validate(K({},e,n),J({},i)));case 13:b.next=18;break;case 15:b.prev=15,b.t0=b.catch(10),b.t0.errors&&(m=b.t0.errors.map(function(C,T){var A=C.message,O=A===LT?g.default:A;return _.isValidElement(O)?_.cloneElement(O,{key:"error_".concat(T)}):O}));case 18:if(!(!m.length&&f)){b.next=23;break}return b.next=21,Promise.all(n.map(function(C,T){return m_("".concat(e,".").concat(T),C,f,i,a)}));case 21:return v=b.sent,b.abrupt("return",v.reduce(function(C,T){return[].concat(ze(C),ze(T))},[]));case 23:return S=J(J({},r),{},{name:e,enum:(r.enum||[]).join(", ")},a),w=m.map(function(C){return typeof C=="string"?mB(C,S):C}),b.abrupt("return",w);case 26:case"end":return b.stop()}},t,null,[[10,15]])})),v_.apply(this,arguments)}function vB(t,e,n,r,i,a){var l=t.join("."),u=n.map(function(g,m){var v=g.validator,S=J(J({},g),{},{ruleIndex:m});return v&&(S.validator=function(w,E,b){var C=!1,T=function(){for(var x=arguments.length,N=new Array(x),F=0;F2&&arguments[2]!==void 0?arguments[2]:!1;return t&&t.some(function(r){return tx(e,r,n)})}function tx(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return!t||!e||!n&&t.length!==e.length?!1:e.every(function(r,i){return t[i]===r})}function bB(t,e){if(t===e)return!0;if(!t&&e||t&&!e||!t||!e||pt(t)!=="object"||pt(e)!=="object")return!1;var n=Object.keys(t),r=Object.keys(e),i=new Set([].concat(n,r));return ze(i).every(function(a){var l=t[a],u=e[a];return typeof l=="function"&&typeof u=="function"?!0:l===u})}function SB(t){var e=arguments.length<=1?void 0:arguments[1];return e&&e.target&&pt(e.target)==="object"&&t in e.target?e.target[t]:e}function $T(t,e,n){var r=t.length;if(e<0||e>=r||n<0||n>=r)return t;var i=t[e],a=e-n;return a>0?[].concat(ze(t.slice(0,n)),[i],ze(t.slice(n,e)),ze(t.slice(e+1,r))):a<0?[].concat(ze(t.slice(0,e)),ze(t.slice(e+1,n+1)),[i],ze(t.slice(n+1,r))):t}var EB=["name"],Ci=[];function Iv(t,e,n,r,i,a){return typeof t=="function"?t(e,n,"source"in a?{source:a.source}:{}):r!==i}var Qy=function(t){Xo(n,t);var e=qo(n);function n(r){var i;if(xr(this,n),i=e.call(this,r),K(Nt(i),"state",{resetCount:0}),K(Nt(i),"cancelRegisterFunc",null),K(Nt(i),"mounted",!1),K(Nt(i),"touched",!1),K(Nt(i),"dirty",!1),K(Nt(i),"validatePromise",void 0),K(Nt(i),"prevValidating",void 0),K(Nt(i),"errors",Ci),K(Nt(i),"warnings",Ci),K(Nt(i),"cancelRegister",function(){var f=i.props,h=f.preserve,g=f.isListField,m=f.name;i.cancelRegisterFunc&&i.cancelRegisterFunc(g,h,Jn(m)),i.cancelRegisterFunc=null}),K(Nt(i),"getNamePath",function(){var f=i.props,h=f.name,g=f.fieldContext,m=g.prefixName,v=m===void 0?[]:m;return h!==void 0?[].concat(ze(v),ze(h)):[]}),K(Nt(i),"getRules",function(){var f=i.props,h=f.rules,g=h===void 0?[]:h,m=f.fieldContext;return g.map(function(v){return typeof v=="function"?v(m):v})}),K(Nt(i),"refresh",function(){i.mounted&&i.setState(function(f){var h=f.resetCount;return{resetCount:h+1}})}),K(Nt(i),"metaCache",null),K(Nt(i),"triggerMetaEvent",function(f){var h=i.props.onMetaChange;if(h){var g=J(J({},i.getMeta()),{},{destroy:f});qh(i.metaCache,g)||h(g),i.metaCache=g}else i.metaCache=null}),K(Nt(i),"onStoreChange",function(f,h,g){var m=i.props,v=m.shouldUpdate,S=m.dependencies,w=S===void 0?[]:S,E=m.onReset,b=g.store,C=i.getNamePath(),T=i.getValue(f),A=i.getValue(b),O=h&&ec(h,C);switch(g.type==="valueUpdate"&&g.source==="external"&&!qh(T,A)&&(i.touched=!0,i.dirty=!0,i.validatePromise=null,i.errors=Ci,i.warnings=Ci,i.triggerMetaEvent()),g.type){case"reset":if(!h||O){i.touched=!1,i.dirty=!1,i.validatePromise=void 0,i.errors=Ci,i.warnings=Ci,i.triggerMetaEvent(),E==null||E(),i.refresh();return}break;case"remove":{if(v&&Iv(v,f,b,T,A,g)){i.reRender();return}break}case"setField":{var x=g.data;if(O){"touched"in x&&(i.touched=x.touched),"validating"in x&&!("originRCField"in x)&&(i.validatePromise=x.validating?Promise.resolve([]):null),"errors"in x&&(i.errors=x.errors||Ci),"warnings"in x&&(i.warnings=x.warnings||Ci),i.dirty=!0,i.triggerMetaEvent(),i.reRender();return}else if("value"in x&&ec(h,C,!0)){i.reRender();return}if(v&&!C.length&&Iv(v,f,b,T,A,g)){i.reRender();return}break}case"dependenciesUpdate":{var N=w.map(Jn);if(N.some(function(F){return ec(g.relatedFields,F)})){i.reRender();return}break}default:if(O||(!w.length||C.length||v)&&Iv(v,f,b,T,A,g)){i.reRender();return}break}v===!0&&i.reRender()}),K(Nt(i),"validateRules",function(f){var h=i.getNamePath(),g=i.getValue(),m=f||{},v=m.triggerName,S=m.validateOnly,w=S===void 0?!1:S,E=Promise.resolve().then(Vf(ts().mark(function b(){var C,T,A,O,x,N,F;return ts().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:if(i.mounted){D.next=2;break}return D.abrupt("return",[]);case 2:if(C=i.props,T=C.validateFirst,A=T===void 0?!1:T,O=C.messageVariables,x=C.validateDebounce,N=i.getRules(),v&&(N=N.filter(function(V){return V}).filter(function(V){var B=V.validateTrigger;if(!B)return!0;var W=f_(B);return W.includes(v)})),!(x&&v)){D.next=10;break}return D.next=8,new Promise(function(V){setTimeout(V,x)});case 8:if(i.validatePromise===E){D.next=10;break}return D.abrupt("return",[]);case 10:return F=vB(h,g,N,f,A,O),F.catch(function(V){return V}).then(function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ci;if(i.validatePromise===E){var B;i.validatePromise=null;var W=[],X=[];(B=V.forEach)===null||B===void 0||B.call(V,function(Y){var ae=Y.rule.warningOnly,U=Y.errors,z=U===void 0?Ci:U;ae?X.push.apply(X,ze(z)):W.push.apply(W,ze(z))}),i.errors=W,i.warnings=X,i.triggerMetaEvent(),i.reRender()}}),D.abrupt("return",F);case 13:case"end":return D.stop()}},b)})));return w||(i.validatePromise=E,i.dirty=!0,i.errors=Ci,i.warnings=Ci,i.triggerMetaEvent(),i.reRender()),E}),K(Nt(i),"isFieldValidating",function(){return!!i.validatePromise}),K(Nt(i),"isFieldTouched",function(){return i.touched}),K(Nt(i),"isFieldDirty",function(){if(i.dirty||i.props.initialValue!==void 0)return!0;var f=i.props.fieldContext,h=f.getInternalHooks(bo),g=h.getInitialValue;return g(i.getNamePath())!==void 0}),K(Nt(i),"getErrors",function(){return i.errors}),K(Nt(i),"getWarnings",function(){return i.warnings}),K(Nt(i),"isListField",function(){return i.props.isListField}),K(Nt(i),"isList",function(){return i.props.isList}),K(Nt(i),"isPreserve",function(){return i.props.preserve}),K(Nt(i),"getMeta",function(){i.prevValidating=i.isFieldValidating();var f={touched:i.isFieldTouched(),validating:i.prevValidating,errors:i.errors,warnings:i.warnings,name:i.getNamePath(),validated:i.validatePromise===null};return f}),K(Nt(i),"getOnlyChild",function(f){if(typeof f=="function"){var h=i.getMeta();return J(J({},i.getOnlyChild(f(i.getControlled(),h,i.props.fieldContext))),{},{isFunction:!0})}var g=Lo(f);return g.length!==1||!_.isValidElement(g[0])?{child:g,isFunction:!1}:{child:g[0],isFunction:!1}}),K(Nt(i),"getValue",function(f){var h=i.props.fieldContext.getFieldsValue,g=i.getNamePath();return vs(f||h(!0),g)}),K(Nt(i),"getControlled",function(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},h=i.props,g=h.name,m=h.trigger,v=h.validateTrigger,S=h.getValueFromEvent,w=h.normalize,E=h.valuePropName,b=h.getValueProps,C=h.fieldContext,T=v!==void 0?v:C.validateTrigger,A=i.getNamePath(),O=C.getInternalHooks,x=C.getFieldsValue,N=O(bo),F=N.dispatch,L=i.getValue(),D=b||function(Y){return K({},E,Y)},V=f[m],B=g!==void 0?D(L):{},W=J(J({},f),B);W[m]=function(){i.touched=!0,i.dirty=!0,i.triggerMetaEvent();for(var Y,ae=arguments.length,U=new Array(ae),z=0;z=0&&V<=B.length?(g.keys=[].concat(ze(g.keys.slice(0,V)),[g.id],ze(g.keys.slice(V))),A([].concat(ze(B.slice(0,V)),[D],ze(B.slice(V))))):(g.keys=[].concat(ze(g.keys),[g.id]),A([].concat(ze(B),[D]))),g.id+=1},remove:function(D){var V=x(),B=new Set(Array.isArray(D)?D:[D]);B.size<=0||(g.keys=g.keys.filter(function(W,X){return!B.has(X)}),A(V.filter(function(W,X){return!B.has(X)})))},move:function(D,V){if(D!==V){var B=x();D<0||D>=B.length||V<0||V>=B.length||(g.keys=$T(g.keys,D,V),A($T(B,D,V)))}}},F=T||[];return Array.isArray(F)||(F=[]),r(F.map(function(L,D){var V=g.keys[D];return V===void 0&&(g.keys[D]=g.id,V=g.keys[D],g.id+=1),{name:D,key:V,isListField:!0}}),N,b)})))}function TB(t){var e=!1,n=t.length,r=[];return t.length?new Promise(function(i,a){t.forEach(function(l,u){l.catch(function(f){return e=!0,f}).then(function(f){n-=1,r[u]=f,!(n>0)&&(e&&a(r),i(r))})})}):Promise.resolve([])}var rx="__@field_split__";function Dv(t){return t.map(function(e){return"".concat(pt(e),":").concat(e)}).join(rx)}var Fl=function(){function t(){xr(this,t),K(this,"kvs",new Map)}return Mr(t,[{key:"set",value:function(n,r){this.kvs.set(Dv(n),r)}},{key:"get",value:function(n){return this.kvs.get(Dv(n))}},{key:"update",value:function(n,r){var i=this.get(n),a=r(i);a?this.set(n,a):this.delete(n)}},{key:"delete",value:function(n){this.kvs.delete(Dv(n))}},{key:"map",value:function(n){return ze(this.kvs.entries()).map(function(r){var i=de(r,2),a=i[0],l=i[1],u=a.split(rx);return n({key:u.map(function(f){var h=f.match(/^([^:]*):(.*)$/),g=de(h,3),m=g[1],v=g[2];return m==="number"?Number(v):v}),value:l})})}},{key:"toJSON",value:function(){var n={};return this.map(function(r){var i=r.key,a=r.value;return n[i.join(".")]=a,null}),n}}]),t}(),CB=["name"],AB=Mr(function t(e){var n=this;xr(this,t),K(this,"formHooked",!1),K(this,"forceRootUpdate",void 0),K(this,"subscribable",!0),K(this,"store",{}),K(this,"fieldEntities",[]),K(this,"initialValues",{}),K(this,"callbacks",{}),K(this,"validateMessages",null),K(this,"preserve",null),K(this,"lastValidatePromise",null),K(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}}),K(this,"getInternalHooks",function(r){return r===bo?(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}):(kr(!1,"`getInternalHooks` is internal usage. Should not call directly."),null)}),K(this,"useSubscribe",function(r){n.subscribable=r}),K(this,"prevWithoutPreserves",null),K(this,"setInitialValues",function(r,i){if(n.initialValues=r||{},i){var a,l=Hl(r,n.store);(a=n.prevWithoutPreserves)===null||a===void 0||a.map(function(u){var f=u.key;l=Xi(l,f,vs(r,f))}),n.prevWithoutPreserves=null,n.updateStore(l)}}),K(this,"destroyForm",function(r){if(r)n.updateStore({});else{var i=new Fl;n.getFieldEntities(!0).forEach(function(a){n.isMergedPreserve(a.isPreserve())||i.set(a.getNamePath(),!0)}),n.prevWithoutPreserves=i}}),K(this,"getInitialValue",function(r){var i=vs(n.initialValues,r);return r.length?Hl(i):i}),K(this,"setCallbacks",function(r){n.callbacks=r}),K(this,"setValidateMessages",function(r){n.validateMessages=r}),K(this,"setPreserve",function(r){n.preserve=r}),K(this,"watchList",[]),K(this,"registerWatch",function(r){return n.watchList.push(r),function(){n.watchList=n.watchList.filter(function(i){return i!==r})}}),K(this,"notifyWatch",function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(n.watchList.length){var i=n.getFieldsValue(),a=n.getFieldsValue(!0);n.watchList.forEach(function(l){l(i,a,r)})}}),K(this,"timeoutId",null),K(this,"warningUnhooked",function(){}),K(this,"updateStore",function(r){n.store=r}),K(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}),K(this,"getFieldsMap",function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=new Fl;return n.getFieldEntities(r).forEach(function(a){var l=a.getNamePath();i.set(l,a)}),i}),K(this,"getFieldEntitiesForNamePathList",function(r){if(!r)return n.getFieldEntities(!0);var i=n.getFieldsMap(!0);return r.map(function(a){var l=Jn(a);return i.get(l)||{INVALIDATE_NAME_PATH:Jn(a)}})}),K(this,"getFieldsValue",function(r,i){n.warningUnhooked();var a,l,u;if(r===!0||Array.isArray(r)?(a=r,l=i):r&&pt(r)==="object"&&(u=r.strict,l=r.filter),a===!0&&!l)return n.store;var f=n.getFieldEntitiesForNamePathList(Array.isArray(a)?a:null),h=[];return f.forEach(function(g){var m,v,S="INVALIDATE_NAME_PATH"in g?g.INVALIDATE_NAME_PATH:g.getNamePath();if(u){var w,E;if((w=(E=g).isList)!==null&&w!==void 0&&w.call(E))return}else if(!a&&(m=(v=g).isListField)!==null&&m!==void 0&&m.call(v))return;if(!l)h.push(S);else{var b="getMeta"in g?g.getMeta():null;l(b)&&h.push(S)}}),zT(n.store,h.map(Jn))}),K(this,"getFieldValue",function(r){n.warningUnhooked();var i=Jn(r);return vs(n.store,i)}),K(this,"getFieldsError",function(r){n.warningUnhooked();var i=n.getFieldEntitiesForNamePathList(r);return i.map(function(a,l){return a&&!("INVALIDATE_NAME_PATH"in a)?{name:a.getNamePath(),errors:a.getErrors(),warnings:a.getWarnings()}:{name:Jn(r[l]),errors:[],warnings:[]}})}),K(this,"getFieldError",function(r){n.warningUnhooked();var i=Jn(r),a=n.getFieldsError([i])[0];return a.errors}),K(this,"getFieldWarning",function(r){n.warningUnhooked();var i=Jn(r),a=n.getFieldsError([i])[0];return a.warnings}),K(this,"isFieldsTouched",function(){n.warningUnhooked();for(var r=arguments.length,i=new Array(r),a=0;a0&&arguments[0]!==void 0?arguments[0]:{},i=new Fl,a=n.getFieldEntities(!0);a.forEach(function(f){var h=f.props.initialValue,g=f.getNamePath();if(h!==void 0){var m=i.get(g)||new Set;m.add({entity:f,value:h}),i.set(g,m)}});var l=function(h){h.forEach(function(g){var m=g.props.initialValue;if(m!==void 0){var v=g.getNamePath(),S=n.getInitialValue(v);if(S!==void 0)kr(!1,"Form already set 'initialValues' with path '".concat(v.join("."),"'. Field can not overwrite it."));else{var w=i.get(v);if(w&&w.size>1)kr(!1,"Multiple Field with path '".concat(v.join("."),"' set 'initialValue'. Can not decide which one to pick."));else if(w){var E=n.getFieldValue(v),b=g.isListField();!b&&(!r.skipExist||E===void 0)&&n.updateStore(Xi(n.store,v,ze(w)[0].value))}}}})},u;r.entities?u=r.entities:r.namePathList?(u=[],r.namePathList.forEach(function(f){var h=i.get(f);if(h){var g;(g=u).push.apply(g,ze(ze(h).map(function(m){return m.entity})))}})):u=a,l(u)}),K(this,"resetFields",function(r){n.warningUnhooked();var i=n.store;if(!r){n.updateStore(Hl(n.initialValues)),n.resetWithFieldInitialValue(),n.notifyObservers(i,null,{type:"reset"}),n.notifyWatch();return}var a=r.map(Jn);a.forEach(function(l){var u=n.getInitialValue(l);n.updateStore(Xi(n.store,l,u))}),n.resetWithFieldInitialValue({namePathList:a}),n.notifyObservers(i,a,{type:"reset"}),n.notifyWatch(a)}),K(this,"setFields",function(r){n.warningUnhooked();var i=n.store,a=[];r.forEach(function(l){var u=l.name,f=Fn(l,CB),h=Jn(u);a.push(h),"value"in f&&n.updateStore(Xi(n.store,h,f.value)),n.notifyObservers(i,[h],{type:"setField",data:l})}),n.notifyWatch(a)}),K(this,"getFields",function(){var r=n.getFieldEntities(!0),i=r.map(function(a){var l=a.getNamePath(),u=a.getMeta(),f=J(J({},u),{},{name:l,value:n.getFieldValue(l)});return Object.defineProperty(f,"originRCField",{value:!0}),f});return i}),K(this,"initEntityValue",function(r){var i=r.props.initialValue;if(i!==void 0){var a=r.getNamePath(),l=vs(n.store,a);l===void 0&&n.updateStore(Xi(n.store,a,i))}}),K(this,"isMergedPreserve",function(r){var i=r!==void 0?r:n.preserve;return i??!0}),K(this,"registerField",function(r){n.fieldEntities.push(r);var i=r.getNamePath();if(n.notifyWatch([i]),r.props.initialValue!==void 0){var a=n.store;n.resetWithFieldInitialValue({entities:[r],skipExist:!0}),n.notifyObservers(a,[r.getNamePath()],{type:"valueUpdate",source:"internal"})}return function(l,u){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(n.fieldEntities=n.fieldEntities.filter(function(m){return m!==r}),!n.isMergedPreserve(u)&&(!l||f.length>1)){var h=l?void 0:n.getInitialValue(i);if(i.length&&n.getFieldValue(i)!==h&&n.fieldEntities.every(function(m){return!tx(m.getNamePath(),i)})){var g=n.store;n.updateStore(Xi(g,i,h,!0)),n.notifyObservers(g,[i],{type:"remove"}),n.triggerDependenciesUpdate(g,i)}}n.notifyWatch([i])}}),K(this,"dispatch",function(r){switch(r.type){case"updateValue":{var i=r.namePath,a=r.value;n.updateValue(i,a);break}case"validateField":{var l=r.namePath,u=r.triggerName;n.validateFields([l],{triggerName:u});break}}}),K(this,"notifyObservers",function(r,i,a){if(n.subscribable){var l=J(J({},a),{},{store:n.getFieldsValue(!0)});n.getFieldEntities().forEach(function(u){var f=u.onStoreChange;f(r,i,l)})}else n.forceRootUpdate()}),K(this,"triggerDependenciesUpdate",function(r,i){var a=n.getDependencyChildrenFields(i);return a.length&&n.validateFields(a),n.notifyObservers(r,a,{type:"dependenciesUpdate",relatedFields:[i].concat(ze(a))}),a}),K(this,"updateValue",function(r,i){var a=Jn(r),l=n.store;n.updateStore(Xi(n.store,a,i)),n.notifyObservers(l,[a],{type:"valueUpdate",source:"internal"}),n.notifyWatch([a]);var u=n.triggerDependenciesUpdate(l,a),f=n.callbacks.onValuesChange;if(f){var h=zT(n.store,[a]);f(h,n.getFieldsValue())}n.triggerOnFieldsChange([a].concat(ze(u)))}),K(this,"setFieldsValue",function(r){n.warningUnhooked();var i=n.store;if(r){var a=Hl(n.store,r);n.updateStore(a)}n.notifyObservers(i,null,{type:"valueUpdate",source:"external"}),n.notifyWatch()}),K(this,"setFieldValue",function(r,i){n.setFields([{name:r,value:i,errors:[],warnings:[]}])}),K(this,"getDependencyChildrenFields",function(r){var i=new Set,a=[],l=new Fl;n.getFieldEntities().forEach(function(f){var h=f.props.dependencies;(h||[]).forEach(function(g){var m=Jn(g);l.update(m,function(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Set;return v.add(f),v})})});var u=function f(h){var g=l.get(h)||new Set;g.forEach(function(m){if(!i.has(m)){i.add(m);var v=m.getNamePath();m.isFieldDirty()&&v.length&&(a.push(v),f(v))}})};return u(r),a}),K(this,"triggerOnFieldsChange",function(r,i){var a=n.callbacks.onFieldsChange;if(a){var l=n.getFields();if(i){var u=new Fl;i.forEach(function(h){var g=h.name,m=h.errors;u.set(g,m)}),l.forEach(function(h){h.errors=u.get(h.name)||h.errors})}var f=l.filter(function(h){var g=h.name;return ec(r,g)});f.length&&a(f,l)}}),K(this,"validateFields",function(r,i){n.warningUnhooked();var a,l;Array.isArray(r)||typeof r=="string"||typeof i=="string"?(a=r,l=i):l=r;var u=!!a,f=u?a.map(Jn):[],h=[],g=String(Date.now()),m=new Set,v=l||{},S=v.recursive,w=v.dirty;n.getFieldEntities(!0).forEach(function(T){if(u||f.push(T.getNamePath()),!(!T.props.rules||!T.props.rules.length)&&!(w&&!T.isFieldDirty())){var A=T.getNamePath();if(m.add(A.join(g)),!u||ec(f,A,S)){var O=T.validateRules(J({validateMessages:J(J({},ex),n.validateMessages)},l));h.push(O.then(function(){return{name:A,errors:[],warnings:[]}}).catch(function(x){var N,F=[],L=[];return(N=x.forEach)===null||N===void 0||N.call(x,function(D){var V=D.rule.warningOnly,B=D.errors;V?L.push.apply(L,ze(B)):F.push.apply(F,ze(B))}),F.length?Promise.reject({name:A,errors:F,warnings:L}):{name:A,errors:F,warnings:L}}))}}});var E=TB(h);n.lastValidatePromise=E,E.catch(function(T){return T}).then(function(T){var A=T.map(function(O){var x=O.name;return x});n.notifyObservers(n.store,A,{type:"validateFinish"}),n.triggerOnFieldsChange(A,T)});var b=E.then(function(){return n.lastValidatePromise===E?Promise.resolve(n.getFieldsValue(f)):Promise.reject([])}).catch(function(T){var A=T.filter(function(O){return O&&O.errors.length});return Promise.reject({values:n.getFieldsValue(f),errorFields:A,outOfDate:n.lastValidatePromise!==E})});b.catch(function(T){return T});var C=f.filter(function(T){return m.has(T.join(g))});return n.triggerOnFieldsChange(C),b}),K(this,"submit",function(){n.warningUnhooked(),n.validateFields().then(function(r){var i=n.callbacks.onFinish;if(i)try{i(r)}catch(a){console.error(a)}}).catch(function(r){var i=n.callbacks.onFinishFailed;i&&i(r)})}),this.forceRootUpdate=e});function ix(t){var e=_.useRef(),n=_.useState({}),r=de(n,2),i=r[1];if(!e.current)if(t)e.current=t;else{var a=function(){i({})},l=new AB(a);e.current=l.getForm()}return[e.current]}var b_=_.createContext({triggerFormChange:function(){},triggerFormFinish:function(){},registerForm:function(){},unregisterForm:function(){}}),RB=function(e){var n=e.validateMessages,r=e.onFormChange,i=e.onFormFinish,a=e.children,l=_.useContext(b_),u=_.useRef({});return _.createElement(b_.Provider,{value:J(J({},l),{},{validateMessages:J(J({},l.validateMessages),n),triggerFormChange:function(h,g){r&&r(h,{changedFields:g,forms:u.current}),l.triggerFormChange(h,g)},triggerFormFinish:function(h,g){i&&i(h,{values:g,forms:u.current}),l.triggerFormFinish(h,g)},registerForm:function(h,g){h&&(u.current=J(J({},u.current),{},K({},h,g))),l.registerForm(h,g)},unregisterForm:function(h){var g=J({},u.current);delete g[h],u.current=g,l.unregisterForm(h)}})},a)},xB=["name","initialValues","fields","form","preserve","children","component","validateMessages","validateTrigger","onValuesChange","onFieldsChange","onFinish","onFinishFailed","clearOnDestroy"],MB=function(e,n){var r=e.name,i=e.initialValues,a=e.fields,l=e.form,u=e.preserve,f=e.children,h=e.component,g=h===void 0?"form":h,m=e.validateMessages,v=e.validateTrigger,S=v===void 0?"onChange":v,w=e.onValuesChange,E=e.onFieldsChange,b=e.onFinish,C=e.onFinishFailed,T=e.clearOnDestroy,A=Fn(e,xB),O=_.useRef(null),x=_.useContext(b_),N=ix(l),F=de(N,1),L=F[0],D=L.getInternalHooks(bo),V=D.useSubscribe,B=D.setInitialValues,W=D.setCallbacks,X=D.setValidateMessages,Y=D.setPreserve,ae=D.destroyForm;_.useImperativeHandle(n,function(){return J(J({},L),{},{nativeElement:O.current})}),_.useEffect(function(){return x.registerForm(r,L),function(){x.unregisterForm(r)}},[x,L,r]),X(J(J({},x.validateMessages),m)),W({onValuesChange:w,onFieldsChange:function(q){if(x.triggerFormChange(r,q),E){for(var ce=arguments.length,fe=new Array(ce>1?ce-1:0),ye=1;ye{let{children:e,status:n,override:r}=t;const i=_.useContext(S_),a=_.useMemo(()=>{const l=Object.assign({},i);return r&&delete l.isFormItemInput,n&&(delete l.status,delete l.hasFeedback,delete l.feedbackIcon),l},[n,r,i]);return _.createElement(S_.Provider,{value:a},e)},IB=_.createContext(void 0),DB=t=>{const{space:e,form:n,children:r}=t;if(r==null)return null;let i=r;return n&&(i=Ft.createElement(NB,{override:!0,status:!0},i)),e&&(i=Ft.createElement(Kk,null,i)),i};function FB(t){return e=>_.createElement($c,{theme:{token:{motion:!1,zIndexPopupBase:0}}},_.createElement(t,Object.assign({},e)))}const kB=(t,e,n,r,i)=>FB(l=>{const{prefixCls:u,style:f}=l,h=_.useRef(null),[g,m]=_.useState(0),[v,S]=_.useState(0),[w,E]=Tc(!1,{value:l.open}),{getPrefixCls:b}=_.useContext(ci),C=b("select",u);_.useEffect(()=>{if(E(!0),typeof ResizeObserver<"u"){const O=new ResizeObserver(N=>{const F=N[0].target;m(F.offsetHeight+8),S(F.offsetWidth)}),x=setInterval(()=>{var N;const F=`.${C}-dropdown`,L=(N=h.current)===null||N===void 0?void 0:N.querySelector(F);L&&(clearInterval(x),O.observe(L))},10);return()=>{clearInterval(x),O.disconnect()}}},[]);let T=Object.assign(Object.assign({},l),{style:Object.assign(Object.assign({},f),{margin:0}),open:w,visible:w,getPopupContainer:()=>h.current});Object.assign(T,{[e]:{overflow:{adjustX:!1,adjustY:!1}}});const A={paddingBottom:g,position:"relative",minWidth:v};return _.createElement("div",{ref:h,style:A},_.createElement(t,Object.assign({},T)))}),sx=function(){if(typeof navigator>"u"||typeof window>"u")return!1;var t=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(t)||/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(t==null?void 0:t.substr(0,4))};var rp=function(e){var n=e.className,r=e.customizeIcon,i=e.customizeIconProps,a=e.children,l=e.onMouseDown,u=e.onClick,f=typeof r=="function"?r(i):r;return _.createElement("span",{className:n,onMouseDown:function(g){g.preventDefault(),l==null||l(g)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:u,"aria-hidden":!0},f!==void 0?f:_.createElement("span",{className:Ze(n.split(/\s+/).map(function(h){return"".concat(h,"-icon")}))},a))},BB=function(e,n,r,i,a){var l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,u=arguments.length>6?arguments[6]:void 0,f=arguments.length>7?arguments[7]:void 0,h=Ft.useMemo(function(){if(pt(i)==="object")return i.clearIcon;if(a)return a},[i,a]),g=Ft.useMemo(function(){return!!(!l&&i&&(r.length||u)&&!(f==="combobox"&&u===""))},[i,l,r.length,u,f]);return{allowClear:g,clearIcon:Ft.createElement(rp,{className:"".concat(e,"-clear"),onMouseDown:n,customizeIcon:h},"×")}},ax=_.createContext(null);function UB(){return _.useContext(ax)}function LB(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,e=_.useState(!1),n=de(e,2),r=n[0],i=n[1],a=_.useRef(null),l=function(){window.clearTimeout(a.current)};_.useEffect(function(){return l},[]);var u=function(h,g){l(),a.current=window.setTimeout(function(){i(h),g&&g()},t)};return[r,u,l]}function ox(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,e=_.useRef(null),n=_.useRef(null);_.useEffect(function(){return function(){window.clearTimeout(n.current)}},[]);function r(i){(i||e.current===null)&&(e.current=i),window.clearTimeout(n.current),n.current=window.setTimeout(function(){e.current=null},t)}return[function(){return e.current},r]}function zB(t,e,n,r){var i=_.useRef(null);i.current={open:e,triggerOpen:n,customizedTrigger:r},_.useEffect(function(){function a(l){var u;if(!((u=i.current)!==null&&u!==void 0&&u.customizedTrigger)){var f=l.target;f.shadowRoot&&l.composed&&(f=l.composedPath()[0]||f),i.current.open&&t().filter(function(h){return h}).every(function(h){return!h.contains(f)&&h!==f})&&i.current.triggerOpen(!1)}}return window.addEventListener("mousedown",a),function(){return window.removeEventListener("mousedown",a)}},[])}function $B(t){return t&&![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(t)}var VB=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],kl=void 0;function HB(t,e){var n=t.prefixCls,r=t.invalidate,i=t.item,a=t.renderItem,l=t.responsive,u=t.responsiveDisabled,f=t.registerSize,h=t.itemKey,g=t.className,m=t.style,v=t.children,S=t.display,w=t.order,E=t.component,b=E===void 0?"div":E,C=Fn(t,VB),T=l&&!S;function A(L){f(h,L)}_.useEffect(function(){return function(){A(null)}},[]);var O=a&&i!==kl?a(i,{index:w}):v,x;r||(x={opacity:T?0:1,height:T?0:kl,overflowY:T?"hidden":kl,order:l?w:kl,pointerEvents:T?"none":kl,position:T?"absolute":kl});var N={};T&&(N["aria-hidden"]=!0);var F=_.createElement(b,kt({className:Ze(!r&&n,g),style:J(J({},x),m)},N,C,{ref:e}),O);return l&&(F=_.createElement(Yo,{onResize:function(D){var V=D.offsetWidth;A(V)},disabled:u},F)),F}var nf=_.forwardRef(HB);nf.displayName="Item";function jB(t){if(typeof MessageChannel>"u")dr(t);else{var e=new MessageChannel;e.port1.onmessage=function(){return t()},e.port2.postMessage(void 0)}}function WB(){var t=_.useRef(null),e=function(r){t.current||(t.current=[],jB(function(){za.unstable_batchedUpdates(function(){t.current.forEach(function(i){i()}),t.current=null})})),t.current.push(r)};return e}function Lu(t,e){var n=_.useState(e),r=de(n,2),i=r[0],a=r[1],l=fr(function(u){t(function(){a(u)})});return[i,l]}var eg=Ft.createContext(null),XB=["component"],qB=["className"],YB=["className"],KB=function(e,n){var r=_.useContext(eg);if(!r){var i=e.component,a=i===void 0?"div":i,l=Fn(e,XB);return _.createElement(a,kt({},l,{ref:n}))}var u=r.className,f=Fn(r,qB),h=e.className,g=Fn(e,YB);return _.createElement(eg.Provider,{value:null},_.createElement(nf,kt({ref:n,className:Ze(u,h)},f,g)))},lx=_.forwardRef(KB);lx.displayName="RawItem";var ZB=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],cx="responsive",ux="invalidate";function QB(t){return"+ ".concat(t.length," ...")}function GB(t,e){var n=t.prefixCls,r=n===void 0?"rc-overflow":n,i=t.data,a=i===void 0?[]:i,l=t.renderItem,u=t.renderRawItem,f=t.itemKey,h=t.itemWidth,g=h===void 0?10:h,m=t.ssr,v=t.style,S=t.className,w=t.maxCount,E=t.renderRest,b=t.renderRawRest,C=t.suffix,T=t.component,A=T===void 0?"div":T,O=t.itemComponent,x=t.onVisibleChange,N=Fn(t,ZB),F=m==="full",L=WB(),D=Lu(L,null),V=de(D,2),B=V[0],W=V[1],X=B||0,Y=Lu(L,new Map),ae=de(Y,2),U=ae[0],z=ae[1],j=Lu(L,0),Z=de(j,2),P=Z[0],$=Z[1],ie=Lu(L,0),se=de(ie,2),q=se[0],ce=se[1],fe=Lu(L,0),ye=de(fe,2),Ee=ye[0],Ce=ye[1],Te=_.useState(null),ve=de(Te,2),ge=ve[0],_e=ve[1],Ie=_.useState(null),we=de(Ie,2),xe=we[0],Ve=we[1],Fe=_.useMemo(function(){return xe===null&&F?Number.MAX_SAFE_INTEGER:xe||0},[xe,B]),Be=_.useState(!1),nt=de(Be,2),He=nt[0],Ge=nt[1],Pe="".concat(r,"-item"),Me=Math.max(P,q),dt=w===cx,rt=a.length&&dt,it=w===ux,st=rt||typeof w=="number"&&a.length>w,at=_.useMemo(function(){var qe=a;return rt?B===null&&F?qe=a:qe=a.slice(0,Math.min(a.length,X/g)):typeof w=="number"&&(qe=a.slice(0,w)),qe},[a,g,B,w,rt]),Je=_.useMemo(function(){return rt?a.slice(Fe+1):a.slice(at.length)},[a,at,rt,Fe]),lt=_.useCallback(function(qe,ke){var Ne;return typeof f=="function"?f(qe):(Ne=f&&(qe==null?void 0:qe[f]))!==null&&Ne!==void 0?Ne:ke},[f]),ft=_.useCallback(l||function(qe){return qe},[l]);function ct(qe,ke,Ne){xe===qe&&(ke===void 0||ke===ge)||(Ve(qe),Ne||(Ge(qeX){ct(Et-1,qe-en-Ee+q);break}}C&&Vt(0)+Ee>X&&_e(null)}},[X,U,q,Ee,lt,at]);var qt=He&&!!Je.length,wn={};ge!==null&&rt&&(wn={position:"absolute",left:ge,top:0});var Mn={prefixCls:Pe,responsive:rt,component:O,invalidate:it},Ut=u?function(qe,ke){var Ne=lt(qe,ke);return _.createElement(eg.Provider,{key:Ne,value:J(J({},Mn),{},{order:ke,item:qe,itemKey:Ne,registerSize:xt,display:ke<=Fe})},u(qe,ke))}:function(qe,ke){var Ne=lt(qe,ke);return _.createElement(nf,kt({},Mn,{order:ke,key:Ne,item:qe,renderItem:ft,itemKey:Ne,registerSize:xt,display:ke<=Fe}))},It={order:qt?Fe:Number.MAX_SAFE_INTEGER,className:"".concat(Pe,"-rest"),registerSize:Bt,display:qt},Lt=E||QB,Jt=b?_.createElement(eg.Provider,{value:J(J({},Mn),It)},b(Je)):_.createElement(nf,kt({},Mn,It),typeof Lt=="function"?Lt(Je):Lt),Mt=_.createElement(A,kt({className:Ze(!it&&r,S),style:v,ref:e},N),at.map(Ut),st?Jt:null,C&&_.createElement(nf,kt({},Mn,{responsive:dt,responsiveDisabled:!rt,order:Fe,className:"".concat(Pe,"-suffix"),registerSize:ht,display:!0,style:wn}),C));return dt?_.createElement(Yo,{onResize:mt,disabled:!rt},Mt):Mt}var Wf=_.forwardRef(GB);Wf.displayName="Overflow";Wf.Item=lx;Wf.RESPONSIVE=cx;Wf.INVALIDATE=ux;var JB=function(e,n){var r,i=e.prefixCls,a=e.id,l=e.inputElement,u=e.disabled,f=e.tabIndex,h=e.autoFocus,g=e.autoComplete,m=e.editable,v=e.activeDescendantId,S=e.value,w=e.maxLength,E=e.onKeyDown,b=e.onMouseDown,C=e.onChange,T=e.onPaste,A=e.onCompositionStart,O=e.onCompositionEnd,x=e.onBlur,N=e.open,F=e.attrs,L=l||_.createElement("input",null),D=L,V=D.ref,B=D.props,W=B.onKeyDown,X=B.onChange,Y=B.onMouseDown,ae=B.onCompositionStart,U=B.onCompositionEnd,z=B.onBlur,j=B.style;return"maxLength"in L.props,L=_.cloneElement(L,J(J(J({type:"search"},B),{},{id:a,ref:Kg(n,V),disabled:u,tabIndex:f,autoComplete:g||"off",autoFocus:h,className:Ze("".concat(i,"-selection-search-input"),(r=L)===null||r===void 0||(r=r.props)===null||r===void 0?void 0:r.className),role:"combobox","aria-expanded":N||!1,"aria-haspopup":"listbox","aria-owns":"".concat(a,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(a,"_list"),"aria-activedescendant":N?v:void 0},F),{},{value:m?S:"",maxLength:w,readOnly:!m,unselectable:m?null:"on",style:J(J({},j),{},{opacity:m?null:0}),onKeyDown:function(P){E(P),W&&W(P)},onMouseDown:function(P){b(P),Y&&Y(P)},onChange:function(P){C(P),X&&X(P)},onCompositionStart:function(P){A(P),ae&&ae(P)},onCompositionEnd:function(P){O(P),U&&U(P)},onPaste:T,onBlur:function(P){x(P),z&&z(P)}})),L},fx=_.forwardRef(JB);function dx(t){return Array.isArray(t)?t:t!==void 0?[t]:[]}var eU=typeof window<"u"&&window.document&&window.document.documentElement,tU=eU;function nU(t){return t!=null}function rU(t){return!t&&t!==0}function HT(t){return["string","number"].includes(pt(t))}function hx(t){var e=void 0;return t&&(HT(t.title)?e=t.title.toString():HT(t.label)&&(e=t.label.toString())),e}function iU(t,e){tU?_.useLayoutEffect(t,e):_.useEffect(t,e)}function sU(t){var e;return(e=t.key)!==null&&e!==void 0?e:t.value}var jT=function(e){e.preventDefault(),e.stopPropagation()},aU=function(e){var n=e.id,r=e.prefixCls,i=e.values,a=e.open,l=e.searchValue,u=e.autoClearSearchValue,f=e.inputRef,h=e.placeholder,g=e.disabled,m=e.mode,v=e.showSearch,S=e.autoFocus,w=e.autoComplete,E=e.activeDescendantId,b=e.tabIndex,C=e.removeIcon,T=e.maxTagCount,A=e.maxTagTextLength,O=e.maxTagPlaceholder,x=O===void 0?function(Ie){return"+ ".concat(Ie.length," ...")}:O,N=e.tagRender,F=e.onToggleOpen,L=e.onRemove,D=e.onInputChange,V=e.onInputPaste,B=e.onInputKeyDown,W=e.onInputMouseDown,X=e.onInputCompositionStart,Y=e.onInputCompositionEnd,ae=e.onInputBlur,U=_.useRef(null),z=_.useState(0),j=de(z,2),Z=j[0],P=j[1],$=_.useState(!1),ie=de($,2),se=ie[0],q=ie[1],ce="".concat(r,"-selection"),fe=a||m==="multiple"&&u===!1||m==="tags"?l:"",ye=m==="tags"||m==="multiple"&&u===!1||v&&(a||se);iU(function(){P(U.current.scrollWidth)},[fe]);var Ee=function(we,xe,Ve,Fe,Be){return _.createElement("span",{title:hx(we),className:Ze("".concat(ce,"-item"),K({},"".concat(ce,"-item-disabled"),Ve))},_.createElement("span",{className:"".concat(ce,"-item-content")},xe),Fe&&_.createElement(rp,{className:"".concat(ce,"-item-remove"),onMouseDown:jT,onClick:Be,customizeIcon:C},"×"))},Ce=function(we,xe,Ve,Fe,Be,nt){var He=function(Pe){jT(Pe),F(!a)};return _.createElement("span",{onMouseDown:He},N({label:xe,value:we,disabled:Ve,closable:Fe,onClose:Be,isMaxTag:!!nt}))},Te=function(we){var xe=we.disabled,Ve=we.label,Fe=we.value,Be=!g&&!xe,nt=Ve;if(typeof A=="number"&&(typeof Ve=="string"||typeof Ve=="number")){var He=String(nt);He.length>A&&(nt="".concat(He.slice(0,A),"..."))}var Ge=function(Me){Me&&Me.stopPropagation(),L(we)};return typeof N=="function"?Ce(Fe,nt,xe,Be,Ge):Ee(we,nt,xe,Be,Ge)},ve=function(we){if(!i.length)return null;var xe=typeof x=="function"?x(we):x;return typeof N=="function"?Ce(void 0,xe,!1,!1,void 0,!0):Ee({title:xe},xe,!1)},ge=_.createElement("div",{className:"".concat(ce,"-search"),style:{width:Z},onFocus:function(){q(!0)},onBlur:function(){q(!1)}},_.createElement(fx,{ref:f,open:a,prefixCls:r,id:n,inputElement:null,disabled:g,autoFocus:S,autoComplete:w,editable:ye,activeDescendantId:E,value:fe,onKeyDown:B,onMouseDown:W,onChange:D,onPaste:V,onCompositionStart:X,onCompositionEnd:Y,onBlur:ae,tabIndex:b,attrs:Gh(e,!0)}),_.createElement("span",{ref:U,className:"".concat(ce,"-search-mirror"),"aria-hidden":!0},fe," ")),_e=_.createElement(Wf,{prefixCls:"".concat(ce,"-overflow"),data:i,renderItem:Te,renderRest:ve,suffix:ge,itemKey:sU,maxCount:T});return _.createElement("span",{className:"".concat(ce,"-wrap")},_e,!i.length&&!fe&&_.createElement("span",{className:"".concat(ce,"-placeholder")},h))},oU=function(e){var n=e.inputElement,r=e.prefixCls,i=e.id,a=e.inputRef,l=e.disabled,u=e.autoFocus,f=e.autoComplete,h=e.activeDescendantId,g=e.mode,m=e.open,v=e.values,S=e.placeholder,w=e.tabIndex,E=e.showSearch,b=e.searchValue,C=e.activeValue,T=e.maxLength,A=e.onInputKeyDown,O=e.onInputMouseDown,x=e.onInputChange,N=e.onInputPaste,F=e.onInputCompositionStart,L=e.onInputCompositionEnd,D=e.onInputBlur,V=e.title,B=_.useState(!1),W=de(B,2),X=W[0],Y=W[1],ae=g==="combobox",U=ae||E,z=v[0],j=b||"";ae&&C&&!X&&(j=C),_.useEffect(function(){ae&&Y(!1)},[ae,C]);var Z=g!=="combobox"&&!m&&!E?!1:!!j,P=V===void 0?hx(z):V,$=_.useMemo(function(){return z?null:_.createElement("span",{className:"".concat(r,"-selection-placeholder"),style:Z?{visibility:"hidden"}:void 0},S)},[z,Z,S,r]);return _.createElement("span",{className:"".concat(r,"-selection-wrap")},_.createElement("span",{className:"".concat(r,"-selection-search")},_.createElement(fx,{ref:a,prefixCls:r,id:i,open:m,inputElement:n,disabled:l,autoFocus:u,autoComplete:f,editable:U,activeDescendantId:h,value:j,onKeyDown:A,onMouseDown:O,onChange:function(se){Y(!0),x(se)},onPaste:N,onCompositionStart:F,onCompositionEnd:L,onBlur:D,tabIndex:w,attrs:Gh(e,!0),maxLength:ae?T:void 0})),!ae&&z?_.createElement("span",{className:"".concat(r,"-selection-item"),title:P,style:Z?{visibility:"hidden"}:void 0},z.label):null,$)},lU=function(e,n){var r=_.useRef(null),i=_.useRef(!1),a=e.prefixCls,l=e.open,u=e.mode,f=e.showSearch,h=e.tokenWithEnter,g=e.disabled,m=e.prefix,v=e.autoClearSearchValue,S=e.onSearch,w=e.onSearchSubmit,E=e.onToggleOpen,b=e.onInputKeyDown,C=e.onInputBlur,T=e.domRef;_.useImperativeHandle(n,function(){return{focus:function(P){r.current.focus(P)},blur:function(){r.current.blur()}}});var A=ox(0),O=de(A,2),x=O[0],N=O[1],F=function(P){var $=P.which,ie=r.current instanceof HTMLTextAreaElement;!ie&&l&&($===et.UP||$===et.DOWN)&&P.preventDefault(),b&&b(P),$===et.ENTER&&u==="tags"&&!i.current&&!l&&(w==null||w(P.target.value)),!(ie&&!l&&~[et.UP,et.DOWN,et.LEFT,et.RIGHT].indexOf($))&&$B($)&&E(!0)},L=function(){N(!0)},D=_.useRef(null),V=function(P){S(P,!0,i.current)!==!1&&E(!0)},B=function(){i.current=!0},W=function(P){i.current=!1,u!=="combobox"&&V(P.target.value)},X=function(P){var $=P.target.value;if(h&&D.current&&/[\r\n]/.test(D.current)){var ie=D.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");$=$.replace(ie,D.current)}D.current=null,V($)},Y=function(P){var $=P.clipboardData,ie=$==null?void 0:$.getData("text");D.current=ie||""},ae=function(P){var $=P.target;if($!==r.current){var ie=document.body.style.msTouchAction!==void 0;ie?setTimeout(function(){r.current.focus()}):r.current.focus()}},U=function(P){var $=x();P.target!==r.current&&!$&&!(u==="combobox"&&g)&&P.preventDefault(),(u!=="combobox"&&(!f||!$)||!l)&&(l&&v!==!1&&S("",!0,!1),E())},z={inputRef:r,onInputKeyDown:F,onInputMouseDown:L,onInputChange:X,onInputPaste:Y,onInputCompositionStart:B,onInputCompositionEnd:W,onInputBlur:C},j=u==="multiple"||u==="tags"?_.createElement(aU,kt({},e,z)):_.createElement(oU,kt({},e,z));return _.createElement("div",{ref:T,className:"".concat(a,"-selector"),onClick:ae,onMouseDown:U},m&&_.createElement("div",{className:"".concat(a,"-prefix")},m),j)},cU=_.forwardRef(lU);function uU(t){var e=t.prefixCls,n=t.align,r=t.arrow,i=t.arrowPos,a=r||{},l=a.className,u=a.content,f=i.x,h=f===void 0?0:f,g=i.y,m=g===void 0?0:g,v=_.useRef();if(!n||!n.points)return null;var S={position:"absolute"};if(n.autoArrow!==!1){var w=n.points[0],E=n.points[1],b=w[0],C=w[1],T=E[0],A=E[1];b===T||!["t","b"].includes(b)?S.top=m:b==="t"?S.top=0:S.bottom=0,C===A||!["l","r"].includes(C)?S.left=h:C==="l"?S.left=0:S.right=0}return _.createElement("div",{ref:v,className:Ze("".concat(e,"-arrow"),l),style:S},u)}function fU(t){var e=t.prefixCls,n=t.open,r=t.zIndex,i=t.mask,a=t.motion;return i?_.createElement(Ky,kt({},a,{motionAppear:!0,visible:n,removeOnLeave:!0}),function(l){var u=l.className;return _.createElement("div",{style:{zIndex:r},className:Ze("".concat(e,"-mask"),u)})}):null}var dU=_.memo(function(t){var e=t.children;return e},function(t,e){return e.cache}),hU=_.forwardRef(function(t,e){var n=t.popup,r=t.className,i=t.prefixCls,a=t.style,l=t.target,u=t.onVisibleChanged,f=t.open,h=t.keepDom,g=t.fresh,m=t.onClick,v=t.mask,S=t.arrow,w=t.arrowPos,E=t.align,b=t.motion,C=t.maskMotion,T=t.forceRender,A=t.getPopupContainer,O=t.autoDestroy,x=t.portal,N=t.zIndex,F=t.onMouseEnter,L=t.onMouseLeave,D=t.onPointerEnter,V=t.onPointerDownCapture,B=t.ready,W=t.offsetX,X=t.offsetY,Y=t.offsetR,ae=t.offsetB,U=t.onAlign,z=t.onPrepare,j=t.stretch,Z=t.targetWidth,P=t.targetHeight,$=typeof n=="function"?n():n,ie=f||h,se=(A==null?void 0:A.length)>0,q=_.useState(!A||!se),ce=de(q,2),fe=ce[0],ye=ce[1];if(Dn(function(){!fe&&se&&l&&ye(!0)},[fe,se,l]),!fe)return null;var Ee="auto",Ce={left:"-1000vw",top:"-1000vh",right:Ee,bottom:Ee};if(B||!f){var Te,ve=E.points,ge=E.dynamicInset||((Te=E._experimental)===null||Te===void 0?void 0:Te.dynamicInset),_e=ge&&ve[0][1]==="r",Ie=ge&&ve[0][0]==="b";_e?(Ce.right=Y,Ce.left=Ee):(Ce.left=W,Ce.right=Ee),Ie?(Ce.bottom=ae,Ce.top=Ee):(Ce.top=X,Ce.bottom=Ee)}var we={};return j&&(j.includes("height")&&P?we.height=P:j.includes("minHeight")&&P&&(we.minHeight=P),j.includes("width")&&Z?we.width=Z:j.includes("minWidth")&&Z&&(we.minWidth=Z)),f||(we.pointerEvents="none"),_.createElement(x,{open:T||ie,getContainer:A&&function(){return A(l)},autoDestroy:O},_.createElement(fU,{prefixCls:i,open:f,zIndex:N,mask:v,motion:C}),_.createElement(Yo,{onResize:U,disabled:!f},function(xe){return _.createElement(Ky,kt({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:T,leavedClassName:"".concat(i,"-hidden")},b,{onAppearPrepare:z,onEnterPrepare:z,visible:f,onVisibleChanged:function(Fe){var Be;b==null||(Be=b.onVisibleChanged)===null||Be===void 0||Be.call(b,Fe),u(Fe)}}),function(Ve,Fe){var Be=Ve.className,nt=Ve.style,He=Ze(i,Be,r);return _.createElement("div",{ref:Kg(xe,e,Fe),className:He,style:J(J(J(J({"--arrow-x":"".concat(w.x||0,"px"),"--arrow-y":"".concat(w.y||0,"px")},Ce),we),nt),{},{boxSizing:"border-box",zIndex:N},a),onMouseEnter:F,onMouseLeave:L,onPointerEnter:D,onClick:m,onPointerDownCapture:V},S&&_.createElement(uU,{prefixCls:i,arrow:S,arrowPos:w,align:E}),_.createElement(dU,{cache:!f&&!g},$))})}))}),gU=_.forwardRef(function(t,e){var n=t.children,r=t.getTriggerDOMNode,i=Qg(n),a=_.useCallback(function(u){Iy(e,r?r(u):u)},[r]),l=Zg(a,Dy(n));return i?_.cloneElement(n,{ref:l}):n}),WT=_.createContext(null);function XT(t){return t?Array.isArray(t)?t:[t]:[]}function pU(t,e,n,r){return _.useMemo(function(){var i=XT(n??e),a=XT(r??e),l=new Set(i),u=new Set(a);return t&&(l.has("hover")&&(l.delete("hover"),l.add("click")),u.has("hover")&&(u.delete("hover"),u.add("click"))),[l,u]},[t,e,n,r])}function mU(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;return n?t[0]===e[0]:t[0]===e[0]&&t[1]===e[1]}function vU(t,e,n,r){for(var i=n.points,a=Object.keys(t),l=0;l1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(t)?e:t}function zu(t){return Cf(parseFloat(t),0)}function YT(t,e){var n=J({},t);return(e||[]).forEach(function(r){if(!(r instanceof HTMLBodyElement||r instanceof HTMLHtmlElement)){var i=Xf(r).getComputedStyle(r),a=i.overflow,l=i.overflowClipMargin,u=i.borderTopWidth,f=i.borderBottomWidth,h=i.borderLeftWidth,g=i.borderRightWidth,m=r.getBoundingClientRect(),v=r.offsetHeight,S=r.clientHeight,w=r.offsetWidth,E=r.clientWidth,b=zu(u),C=zu(f),T=zu(h),A=zu(g),O=Cf(Math.round(m.width/w*1e3)/1e3),x=Cf(Math.round(m.height/v*1e3)/1e3),N=(w-E-T-A)*O,F=(v-S-b-C)*x,L=b*x,D=C*x,V=T*O,B=A*O,W=0,X=0;if(a==="clip"){var Y=zu(l);W=Y*O,X=Y*x}var ae=m.x+V-W,U=m.y+L-X,z=ae+m.width+2*W-V-B-N,j=U+m.height+2*X-L-D-F;n.left=Math.max(n.left,ae),n.top=Math.max(n.top,U),n.right=Math.min(n.right,z),n.bottom=Math.min(n.bottom,j)}}),n}function KT(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n="".concat(e),r=n.match(/^(.*)\%$/);return r?t*(parseFloat(r[1])/100):parseFloat(n)}function ZT(t,e){var n=e||[],r=de(n,2),i=r[0],a=r[1];return[KT(t.width,i),KT(t.height,a)]}function QT(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[t[0],t[1]]}function Bl(t,e){var n=e[0],r=e[1],i,a;return n==="t"?a=t.y:n==="b"?a=t.y+t.height:a=t.y+t.height/2,r==="l"?i=t.x:r==="r"?i=t.x+t.width:i=t.x+t.width/2,{x:i,y:a}}function pa(t,e){var n={t:"b",b:"t",l:"r",r:"l"};return t.map(function(r,i){return i===e?n[r]||"c":r}).join("")}function _U(t,e,n,r,i,a,l){var u=_.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:i[r]||{}}),f=de(u,2),h=f[0],g=f[1],m=_.useRef(0),v=_.useMemo(function(){return e?E_(e):[]},[e]),S=_.useRef({}),w=function(){S.current={}};t||w();var E=fr(function(){if(e&&n&&t){let Wr=function(ki,fi){var di=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Me,hi=q.x+ki,Bi=q.y+fi,Jo=hi+_e,Va=Bi+ge,el=Math.max(hi,di.left),$e=Math.max(Bi,di.top),gt=Math.min(Jo,di.right),sn=Math.min(Va,di.bottom);return Math.max(0,(gt-el)*(sn-$e))},Go=function(){vn=q.y+Ne,On=vn+ge,_n=q.x+ke,Zn=_n+_e};var T,A,O,x,N=e,F=N.ownerDocument,L=Xf(N),D=L.getComputedStyle(N),V=D.width,B=D.height,W=D.position,X=N.style.left,Y=N.style.top,ae=N.style.right,U=N.style.bottom,z=N.style.overflow,j=J(J({},i[r]),a),Z=F.createElement("div");(T=N.parentElement)===null||T===void 0||T.appendChild(Z),Z.style.left="".concat(N.offsetLeft,"px"),Z.style.top="".concat(N.offsetTop,"px"),Z.style.position=W,Z.style.height="".concat(N.offsetHeight,"px"),Z.style.width="".concat(N.offsetWidth,"px"),N.style.left="0",N.style.top="0",N.style.right="auto",N.style.bottom="auto",N.style.overflow="hidden";var P;if(Array.isArray(n))P={x:n[0],y:n[1],width:0,height:0};else{var $,ie,se=n.getBoundingClientRect();se.x=($=se.x)!==null&&$!==void 0?$:se.left,se.y=(ie=se.y)!==null&&ie!==void 0?ie:se.top,P={x:se.x,y:se.y,width:se.width,height:se.height}}var q=N.getBoundingClientRect();q.x=(A=q.x)!==null&&A!==void 0?A:q.left,q.y=(O=q.y)!==null&&O!==void 0?O:q.top;var ce=F.documentElement,fe=ce.clientWidth,ye=ce.clientHeight,Ee=ce.scrollWidth,Ce=ce.scrollHeight,Te=ce.scrollTop,ve=ce.scrollLeft,ge=q.height,_e=q.width,Ie=P.height,we=P.width,xe={left:0,top:0,right:fe,bottom:ye},Ve={left:-ve,top:-Te,right:Ee-ve,bottom:Ce-Te},Fe=j.htmlRegion,Be="visible",nt="visibleFirst";Fe!=="scroll"&&Fe!==nt&&(Fe=Be);var He=Fe===nt,Ge=YT(Ve,v),Pe=YT(xe,v),Me=Fe===Be?Pe:Ge,dt=He?Pe:Me;N.style.left="auto",N.style.top="auto",N.style.right="0",N.style.bottom="0";var rt=N.getBoundingClientRect();N.style.left=X,N.style.top=Y,N.style.right=ae,N.style.bottom=U,N.style.overflow=z,(x=N.parentElement)===null||x===void 0||x.removeChild(Z);var it=Cf(Math.round(_e/parseFloat(V)*1e3)/1e3),st=Cf(Math.round(ge/parseFloat(B)*1e3)/1e3);if(it===0||st===0||pf(n)&&!jk(n))return;var at=j.offset,Je=j.targetOffset,lt=ZT(q,at),ft=de(lt,2),ct=ft[0],mt=ft[1],xt=ZT(P,Je),Bt=de(xt,2),ht=Bt[0],Vt=Bt[1];P.x-=ht,P.y-=Vt;var qt=j.points||[],wn=de(qt,2),Mn=wn[0],Ut=wn[1],It=QT(Ut),Lt=QT(Mn),Jt=Bl(P,It),Mt=Bl(q,Lt),qe=J({},j),ke=Jt.x-Mt.x+ct,Ne=Jt.y-Mt.y+mt,Et=Wr(ke,Ne),en=Wr(ke,Ne,Pe),Ue=Bl(P,["t","l"]),Oe=Bl(q,["t","l"]),je=Bl(P,["b","r"]),Ye=Bl(q,["b","r"]),We=j.overflow||{},Qe=We.adjustX,bt=We.adjustY,_t=We.shiftX,Zt=We.shiftY,Yt=function(fi){return typeof fi=="boolean"?fi:fi>=0},vn,On,_n,Zn;Go();var un=Yt(bt),rn=Lt[0]===It[0];if(un&&Lt[0]==="t"&&(On>dt.bottom||S.current.bt)){var Ae=Ne;rn?Ae-=ge-Ie:Ae=Ue.y-Ye.y-mt;var Le=Wr(ke,Ae),De=Wr(ke,Ae,Pe);Le>Et||Le===Et&&(!He||De>=en)?(S.current.bt=!0,Ne=Ae,mt=-mt,qe.points=[pa(Lt,0),pa(It,0)]):S.current.bt=!1}if(un&&Lt[0]==="b"&&(vnEt||ut===Et&&(!He||zt>=en)?(S.current.tb=!0,Ne=be,mt=-mt,qe.points=[pa(Lt,0),pa(It,0)]):S.current.tb=!1}var Ot=Yt(Qe),In=Lt[1]===It[1];if(Ot&&Lt[1]==="l"&&(Zn>dt.right||S.current.rl)){var tn=ke;In?tn-=_e-we:tn=Ue.x-Ye.x-ct;var Vn=Wr(tn,Ne),Pn=Wr(tn,Ne,Pe);Vn>Et||Vn===Et&&(!He||Pn>=en)?(S.current.rl=!0,ke=tn,ct=-ct,qe.points=[pa(Lt,1),pa(It,1)]):S.current.rl=!1}if(Ot&&Lt[1]==="r"&&(_nEt||Or===Et&&(!He||er>=en)?(S.current.lr=!0,ke=Bn,ct=-ct,qe.points=[pa(Lt,1),pa(It,1)]):S.current.lr=!1}Go();var Un=_t===!0?0:_t;typeof Un=="number"&&(_nPe.right&&(ke-=Zn-Pe.right-ct,P.x>Pe.right-Un&&(ke+=P.x-Pe.right+Un)));var Tn=Zt===!0?0:Zt;typeof Tn=="number"&&(vnPe.bottom&&(Ne-=On-Pe.bottom-mt,P.y>Pe.bottom-Tn&&(Ne+=P.y-Pe.bottom+Tn)));var Qn=q.x+ke,Ii=Qn+_e,jr=q.y+Ne,Di=jr+ge,Fi=P.x,Tt=Fi+we,yt=P.y,nn=yt+Ie,Hn=Math.max(Qn,Fi),Cn=Math.min(Ii,Tt),Nn=(Hn+Cn)/2,tr=Nn-Qn,br=Math.max(jr,yt),Br=Math.min(Di,nn),Sr=(br+Br)/2,Qr=Sr-jr;l==null||l(e,qe);var Gr=rt.right-q.x-(ke+q.width),gr=rt.bottom-q.y-(Ne+q.height);it===1&&(ke=Math.round(ke),Gr=Math.round(Gr)),st===1&&(Ne=Math.round(Ne),gr=Math.round(gr));var $a={ready:!0,offsetX:ke/it,offsetY:Ne/st,offsetR:Gr/it,offsetB:gr/st,arrowX:tr/it,arrowY:Qr/st,scaleX:it,scaleY:st,align:qe};g($a)}}),b=function(){m.current+=1;var A=m.current;Promise.resolve().then(function(){m.current===A&&E()})},C=function(){g(function(A){return J(J({},A),{},{ready:!1})})};return Dn(C,[r]),Dn(function(){t||C()},[t]),[h.ready,h.offsetX,h.offsetY,h.offsetR,h.offsetB,h.arrowX,h.arrowY,h.scaleX,h.scaleY,h.align,b]}function yU(t,e,n,r,i){Dn(function(){if(t&&e&&n){let m=function(){r(),i()};var a=e,l=n,u=E_(a),f=E_(l),h=Xf(l),g=new Set([h].concat(ze(u),ze(f)));return g.forEach(function(v){v.addEventListener("scroll",m,{passive:!0})}),h.addEventListener("resize",m,{passive:!0}),r(),function(){g.forEach(function(v){v.removeEventListener("scroll",m),h.removeEventListener("resize",m)})}}},[t,e,n])}function bU(t,e,n,r,i,a,l,u){var f=_.useRef(t);f.current=t;var h=_.useRef(!1);_.useEffect(function(){if(e&&r&&(!i||a)){var m=function(){h.current=!1},v=function(b){var C;f.current&&!l(((C=b.composedPath)===null||C===void 0||(C=C.call(b))===null||C===void 0?void 0:C[0])||b.target)&&!h.current&&u(!1)},S=Xf(r);S.addEventListener("pointerdown",m,!0),S.addEventListener("mousedown",v,!0),S.addEventListener("contextmenu",v,!0);var w=Qh(n);return w&&(w.addEventListener("mousedown",v,!0),w.addEventListener("contextmenu",v,!0)),function(){S.removeEventListener("pointerdown",m,!0),S.removeEventListener("mousedown",v,!0),S.removeEventListener("contextmenu",v,!0),w&&(w.removeEventListener("mousedown",v,!0),w.removeEventListener("contextmenu",v,!0))}}},[e,n,r,i,a]);function g(){h.current=!0}return g}var SU=["prefixCls","children","action","showAction","hideAction","popupVisible","defaultPopupVisible","onPopupVisibleChange","afterPopupVisibleChange","mouseEnterDelay","mouseLeaveDelay","focusDelay","blurDelay","mask","maskClosable","getPopupContainer","forceRender","autoDestroy","destroyPopupOnHide","popup","popupClassName","popupStyle","popupPlacement","builtinPlacements","popupAlign","zIndex","stretch","getPopupClassNameFromAlign","fresh","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode"];function EU(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Q3,e=_.forwardRef(function(n,r){var i=n.prefixCls,a=i===void 0?"rc-trigger-popup":i,l=n.children,u=n.action,f=u===void 0?"hover":u,h=n.showAction,g=n.hideAction,m=n.popupVisible,v=n.defaultPopupVisible,S=n.onPopupVisibleChange,w=n.afterPopupVisibleChange,E=n.mouseEnterDelay,b=n.mouseLeaveDelay,C=b===void 0?.1:b,T=n.focusDelay,A=n.blurDelay,O=n.mask,x=n.maskClosable,N=x===void 0?!0:x,F=n.getPopupContainer,L=n.forceRender,D=n.autoDestroy,V=n.destroyPopupOnHide,B=n.popup,W=n.popupClassName,X=n.popupStyle,Y=n.popupPlacement,ae=n.builtinPlacements,U=ae===void 0?{}:ae,z=n.popupAlign,j=n.zIndex,Z=n.stretch,P=n.getPopupClassNameFromAlign,$=n.fresh,ie=n.alignPoint,se=n.onPopupClick,q=n.onPopupAlign,ce=n.arrow,fe=n.popupMotion,ye=n.maskMotion,Ee=n.popupTransitionName,Ce=n.popupAnimation,Te=n.maskTransitionName,ve=n.maskAnimation,ge=n.className,_e=n.getTriggerDOMNode,Ie=Fn(n,SU),we=D||V||!1,xe=_.useState(!1),Ve=de(xe,2),Fe=Ve[0],Be=Ve[1];Dn(function(){Be(sx())},[]);var nt=_.useRef({}),He=_.useContext(WT),Ge=_.useMemo(function(){return{registerSubPopup:function(gt,sn){nt.current[gt]=sn,He==null||He.registerSubPopup(gt,sn)}}},[He]),Pe=G3(),Me=_.useState(null),dt=de(Me,2),rt=dt[0],it=dt[1],st=_.useRef(null),at=fr(function($e){st.current=$e,pf($e)&&rt!==$e&&it($e),He==null||He.registerSubPopup(Pe,$e)}),Je=_.useState(null),lt=de(Je,2),ft=lt[0],ct=lt[1],mt=_.useRef(null),xt=fr(function($e){pf($e)&&ft!==$e&&(ct($e),mt.current=$e)}),Bt=_.Children.only(l),ht=(Bt==null?void 0:Bt.props)||{},Vt={},qt=fr(function($e){var gt,sn,fn=ft;return(fn==null?void 0:fn.contains($e))||((gt=Qh(fn))===null||gt===void 0?void 0:gt.host)===$e||$e===fn||(rt==null?void 0:rt.contains($e))||((sn=Qh(rt))===null||sn===void 0?void 0:sn.host)===$e||$e===rt||Object.values(nt.current).some(function(An){return(An==null?void 0:An.contains($e))||$e===An})}),wn=qT(a,fe,Ce,Ee),Mn=qT(a,ye,ve,Te),Ut=_.useState(v||!1),It=de(Ut,2),Lt=It[0],Jt=It[1],Mt=m??Lt,qe=fr(function($e){m===void 0&&Jt($e)});Dn(function(){Jt(m||!1)},[m]);var ke=_.useRef(Mt);ke.current=Mt;var Ne=_.useRef([]);Ne.current=[];var Et=fr(function($e){var gt;qe($e),((gt=Ne.current[Ne.current.length-1])!==null&>!==void 0?gt:Mt)!==$e&&(Ne.current.push($e),S==null||S($e))}),en=_.useRef(),Ue=function(){clearTimeout(en.current)},Oe=function(gt){var sn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;Ue(),sn===0?Et(gt):en.current=setTimeout(function(){Et(gt)},sn*1e3)};_.useEffect(function(){return Ue},[]);var je=_.useState(!1),Ye=de(je,2),We=Ye[0],Qe=Ye[1];Dn(function($e){(!$e||Mt)&&Qe(!0)},[Mt]);var bt=_.useState(null),_t=de(bt,2),Zt=_t[0],Yt=_t[1],vn=_.useState(null),On=de(vn,2),_n=On[0],Zn=On[1],un=function(gt){Zn([gt.clientX,gt.clientY])},rn=_U(Mt,rt,ie&&_n!==null?_n:ft,Y,U,z,q),Ae=de(rn,11),Le=Ae[0],De=Ae[1],be=Ae[2],ut=Ae[3],zt=Ae[4],Ot=Ae[5],In=Ae[6],tn=Ae[7],Vn=Ae[8],Pn=Ae[9],Bn=Ae[10],Or=pU(Fe,f,h,g),er=de(Or,2),Un=er[0],Tn=er[1],Qn=Un.has("click"),Ii=Tn.has("click")||Tn.has("contextMenu"),jr=fr(function(){We||Bn()}),Di=function(){ke.current&&ie&&Ii&&Oe(!1)};yU(Mt,ft,rt,jr,Di),Dn(function(){jr()},[_n,Y]),Dn(function(){Mt&&!(U!=null&&U[Y])&&jr()},[JSON.stringify(z)]);var Fi=_.useMemo(function(){var $e=vU(U,a,Pn,ie);return Ze($e,P==null?void 0:P(Pn))},[Pn,P,U,a,ie]);_.useImperativeHandle(r,function(){return{nativeElement:mt.current,popupElement:st.current,forceAlign:jr}});var Tt=_.useState(0),yt=de(Tt,2),nn=yt[0],Hn=yt[1],Cn=_.useState(0),Nn=de(Cn,2),tr=Nn[0],br=Nn[1],Br=function(){if(Z&&ft){var gt=ft.getBoundingClientRect();Hn(gt.width),br(gt.height)}},Sr=function(){Br(),jr()},Qr=function(gt){Qe(!1),Bn(),w==null||w(gt)},Gr=function(){return new Promise(function(gt){Br(),Yt(function(){return gt})})};Dn(function(){Zt&&(Bn(),Zt(),Yt(null))},[Zt]);function gr($e,gt,sn,fn){Vt[$e]=function(An){var ws;fn==null||fn(An),Oe(gt,sn);for(var tl=arguments.length,Ha=new Array(tl>1?tl-1:0),Ts=1;Ts1?sn-1:0),An=1;An1?sn-1:0),An=1;An1&&arguments[1]!==void 0?arguments[1]:{},n=e.fieldNames,r=e.childrenAsData,i=[],a=px(n,!1),l=a.label,u=a.value,f=a.options,h=a.groupLabel;function g(m,v){Array.isArray(m)&&m.forEach(function(S){if(v||!(f in S)){var w=S[u];i.push({key:GT(S,i.length),groupOption:v,data:S,label:S[l],value:w})}else{var E=S[h];E===void 0&&r&&(E=S.label),i.push({key:GT(S,i.length),group:!0,data:S,label:E}),g(S[f],!0)}})}return g(t,!1),i}function T_(t){var e=J({},t);return"props"in e||Object.defineProperty(e,"props",{get:function(){return kr(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),e}}),e}var xU=function(e,n,r){if(!n||!n.length)return null;var i=!1,a=function u(f,h){var g=a3(h),m=g[0],v=g.slice(1);if(!m)return[f];var S=f.split(m);return i=i||S.length>1,S.reduce(function(w,E){return[].concat(ze(w),ze(u(E,v)))},[]).filter(Boolean)},l=a(e,n);return i?typeof r<"u"?l.slice(0,r):l:null},Gy=_.createContext(null);function MU(t){var e=t.visible,n=t.values;if(!e)return null;var r=50;return _.createElement("span",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},"".concat(n.slice(0,r).map(function(i){var a=i.label,l=i.value;return["number","string"].includes(pt(a))?a:l}).join(", ")),n.length>r?", ...":null)}var OU=["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","prefix","suffixIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],PU=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"],C_=function(e){return e==="tags"||e==="multiple"},NU=_.forwardRef(function(t,e){var n,r=t.id,i=t.prefixCls,a=t.className,l=t.showSearch,u=t.tagRender,f=t.direction,h=t.omitDomProps,g=t.displayValues,m=t.onDisplayValuesChange,v=t.emptyOptions,S=t.notFoundContent,w=S===void 0?"Not Found":S,E=t.onClear,b=t.mode,C=t.disabled,T=t.loading,A=t.getInputElement,O=t.getRawInputElement,x=t.open,N=t.defaultOpen,F=t.onDropdownVisibleChange,L=t.activeValue,D=t.onActiveValueChange,V=t.activeDescendantId,B=t.searchValue,W=t.autoClearSearchValue,X=t.onSearch,Y=t.onSearchSplit,ae=t.tokenSeparators,U=t.allowClear,z=t.prefix,j=t.suffixIcon,Z=t.clearIcon,P=t.OptionList,$=t.animation,ie=t.transitionName,se=t.dropdownStyle,q=t.dropdownClassName,ce=t.dropdownMatchSelectWidth,fe=t.dropdownRender,ye=t.dropdownAlign,Ee=t.placement,Ce=t.builtinPlacements,Te=t.getPopupContainer,ve=t.showAction,ge=ve===void 0?[]:ve,_e=t.onFocus,Ie=t.onBlur,we=t.onKeyUp,xe=t.onKeyDown,Ve=t.onMouseDown,Fe=Fn(t,OU),Be=C_(b),nt=(l!==void 0?l:Be)||b==="combobox",He=J({},Fe);PU.forEach(function(Tt){delete He[Tt]}),h==null||h.forEach(function(Tt){delete He[Tt]});var Ge=_.useState(!1),Pe=de(Ge,2),Me=Pe[0],dt=Pe[1];_.useEffect(function(){dt(sx())},[]);var rt=_.useRef(null),it=_.useRef(null),st=_.useRef(null),at=_.useRef(null),Je=_.useRef(null),lt=_.useRef(!1),ft=LB(),ct=de(ft,3),mt=ct[0],xt=ct[1],Bt=ct[2];_.useImperativeHandle(e,function(){var Tt,yt;return{focus:(Tt=at.current)===null||Tt===void 0?void 0:Tt.focus,blur:(yt=at.current)===null||yt===void 0?void 0:yt.blur,scrollTo:function(Hn){var Cn;return(Cn=Je.current)===null||Cn===void 0?void 0:Cn.scrollTo(Hn)},nativeElement:rt.current||it.current}});var ht=_.useMemo(function(){var Tt;if(b!=="combobox")return B;var yt=(Tt=g[0])===null||Tt===void 0?void 0:Tt.value;return typeof yt=="string"||typeof yt=="number"?String(yt):""},[B,b,g]),Vt=b==="combobox"&&typeof A=="function"&&A()||null,qt=typeof O=="function"&&O(),wn=Zg(it,qt==null||(n=qt.props)===null||n===void 0?void 0:n.ref),Mn=_.useState(!1),Ut=de(Mn,2),It=Ut[0],Lt=Ut[1];Dn(function(){Lt(!0)},[]);var Jt=Tc(!1,{defaultValue:N,value:x}),Mt=de(Jt,2),qe=Mt[0],ke=Mt[1],Ne=It?qe:!1,Et=!w&&v;(C||Et&&Ne&&b==="combobox")&&(Ne=!1);var en=Et?!1:Ne,Ue=_.useCallback(function(Tt){var yt=Tt!==void 0?Tt:!Ne;C||(ke(yt),Ne!==yt&&(F==null||F(yt)))},[C,Ne,ke,F]),Oe=_.useMemo(function(){return(ae||[]).some(function(Tt){return[` -`,`\r -`].includes(Tt)})},[ae]),je=_.useContext(Gy)||{},Ye=je.maxCount,We=je.rawValues,Qe=function(yt,nn,Hn){if(!(Be&&w_(Ye)&&(We==null?void 0:We.size)>=Ye)){var Cn=!0,Nn=yt;D==null||D(null);var tr=xU(yt,ae,w_(Ye)?Ye-We.size:void 0),br=Hn?null:tr;return b!=="combobox"&&br&&(Nn="",Y==null||Y(br),Ue(!1),Cn=!1),X&&ht!==Nn&&X(Nn,{source:nn?"typing":"effect"}),Cn}},bt=function(yt){!yt||!yt.trim()||X(yt,{source:"submit"})};_.useEffect(function(){!Ne&&!Be&&b!=="combobox"&&Qe("",!1,!1)},[Ne]),_.useEffect(function(){qe&&C&&ke(!1),C&&!lt.current&&xt(!1)},[C]);var _t=ox(),Zt=de(_t,2),Yt=Zt[0],vn=Zt[1],On=_.useRef(!1),_n=function(yt){var nn=Yt(),Hn=yt.key,Cn=Hn==="Enter";if(Cn&&(b!=="combobox"&&yt.preventDefault(),Ne||Ue(!0)),vn(!!ht),Hn==="Backspace"&&!nn&&Be&&!ht&&g.length){for(var Nn=ze(g),tr=null,br=Nn.length-1;br>=0;br-=1){var Br=Nn[br];if(!Br.disabled){Nn.splice(br,1),tr=Br;break}}tr&&m(Nn,{type:"remove",values:[tr]})}for(var Sr=arguments.length,Qr=new Array(Sr>1?Sr-1:0),Gr=1;Gr1?nn-1:0),Cn=1;Cn1?tr-1:0),Br=1;Br"u"?"undefined":pt(navigator))==="object"&&/Firefox/i.test(navigator.userAgent);const vx=function(t,e,n,r){var i=_.useRef(!1),a=_.useRef(null);function l(){clearTimeout(a.current),i.current=!0,a.current=setTimeout(function(){i.current=!1},50)}var u=_.useRef({top:t,bottom:e,left:n,right:r});return u.current.top=t,u.current.bottom=e,u.current.left=n,u.current.right=r,function(f,h){var g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,m=f?h<0&&u.current.left||h>0&&u.current.right:h<0&&u.current.top||h>0&&u.current.bottom;return g&&m?(clearTimeout(a.current),i.current=!1):(!m||i.current)&&l(),!i.current&&m}};function BU(t,e,n,r,i,a,l){var u=_.useRef(0),f=_.useRef(null),h=_.useRef(null),g=_.useRef(!1),m=vx(e,n,r,i);function v(T,A){if(dr.cancel(f.current),!m(!1,A)){var O=T;if(!O._virtualHandled)O._virtualHandled=!0;else return;u.current+=A,h.current=A,JT||O.preventDefault(),f.current=dr(function(){var x=g.current?10:1;l(u.current*x,!1),u.current=0})}}function S(T,A){l(A,!0),JT||T.preventDefault()}var w=_.useRef(null),E=_.useRef(null);function b(T){if(t){dr.cancel(E.current),E.current=dr(function(){w.current=null},2);var A=T.deltaX,O=T.deltaY,x=T.shiftKey,N=A,F=O;(w.current==="sx"||!w.current&&x&&O&&!A)&&(N=O,F=0,w.current="sx");var L=Math.abs(N),D=Math.abs(F);w.current===null&&(w.current=a&&L>D?"x":"y"),w.current==="y"?v(T,F):S(T,N)}}function C(T){t&&(g.current=T.detail===h.current)}return[b,C]}function UU(t,e,n,r){var i=_.useMemo(function(){return[new Map,[]]},[t,n.id,r]),a=de(i,2),l=a[0],u=a[1],f=function(g){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:g,v=l.get(g),S=l.get(m);if(v===void 0||S===void 0)for(var w=t.length,E=u.length;E0&&arguments[0]!==void 0?arguments[0]:!1;g();var w=function(){var C=!1;u.current.forEach(function(T,A){if(T&&T.offsetParent){var O=Gu(T),x=O.offsetHeight,N=getComputedStyle(O),F=N.marginTop,L=N.marginBottom,D=eC(F),V=eC(L),B=x+D+V;f.current.get(A)!==B&&(f.current.set(A,B),C=!0)}}),C&&l(function(T){return T+1})};if(S)w();else{h.current+=1;var E=h.current;Promise.resolve().then(function(){E===h.current&&w()})}}function v(S,w){var E=t(S);u.current.get(E),w?(u.current.set(E,w),m()):u.current.delete(E)}return _.useEffect(function(){return g},[]),[v,m,f.current,a]}var tC=14/15;function $U(t,e,n){var r=_.useRef(!1),i=_.useRef(0),a=_.useRef(0),l=_.useRef(null),u=_.useRef(null),f,h=function(S){if(r.current){var w=Math.ceil(S.touches[0].pageX),E=Math.ceil(S.touches[0].pageY),b=i.current-w,C=a.current-E,T=Math.abs(b)>Math.abs(C);T?i.current=w:a.current=E;var A=n(T,T?b:C,!1,S);A&&S.preventDefault(),clearInterval(u.current),A&&(u.current=setInterval(function(){T?b*=tC:C*=tC;var O=Math.floor(T?b:C);(!n(T,O,!0)||Math.abs(O)<=.1)&&clearInterval(u.current)},16))}},g=function(){r.current=!1,f()},m=function(S){f(),S.touches.length===1&&!r.current&&(r.current=!0,i.current=Math.ceil(S.touches[0].pageX),a.current=Math.ceil(S.touches[0].pageY),l.current=S.target,l.current.addEventListener("touchmove",h,{passive:!1}),l.current.addEventListener("touchend",g,{passive:!0}))};f=function(){l.current&&(l.current.removeEventListener("touchmove",h),l.current.removeEventListener("touchend",g))},Dn(function(){return t&&e.current.addEventListener("touchstart",m,{passive:!0}),function(){var v;(v=e.current)===null||v===void 0||v.removeEventListener("touchstart",m),f(),clearInterval(u.current)}},[t])}function nC(t){return Math.floor(Math.pow(t,.5))}function A_(t,e){var n="touches"in t?t.touches[0]:t;return n[e?"pageX":"pageY"]-window[e?"scrollX":"scrollY"]}function VU(t,e,n){_.useEffect(function(){var r=e.current;if(t&&r){var i=!1,a,l,u=function(){dr.cancel(a)},f=function v(){u(),a=dr(function(){n(l),v()})},h=function(S){if(!S.target.draggable){var w=S;w._virtualHandled||(w._virtualHandled=!0,i=!0)}},g=function(){i=!1,u()},m=function(S){if(i){var w=A_(S,!1),E=r.getBoundingClientRect(),b=E.top,C=E.bottom;if(w<=b){var T=b-w;l=-nC(T),f()}else if(w>=C){var A=w-C;l=nC(A),f()}else u()}};return r.addEventListener("mousedown",h),r.ownerDocument.addEventListener("mouseup",g),r.ownerDocument.addEventListener("mousemove",m),function(){r.removeEventListener("mousedown",h),r.ownerDocument.removeEventListener("mouseup",g),r.ownerDocument.removeEventListener("mousemove",m),u()}}},[t])}var HU=10;function jU(t,e,n,r,i,a,l,u){var f=_.useRef(),h=_.useState(null),g=de(h,2),m=g[0],v=g[1];return Dn(function(){if(m&&m.times=0;Y-=1){var ae=i(e[Y]),U=n.get(ae);if(U===void 0){T=!0;break}if(X-=U,X<=0)break}switch(x){case"top":O=F-b;break;case"bottom":O=L-C+b;break;default:{var z=t.current.scrollTop,j=z+C;Fj&&(A="bottom")}}O!==null&&l(O),O!==m.lastTop&&(T=!0)}T&&v(J(J({},m),{},{times:m.times+1,targetAlign:A,lastTop:O}))}},[m,t.current]),function(S){if(S==null){u();return}if(dr.cancel(f.current),typeof S=="number")l(S);else if(S&&pt(S)==="object"){var w,E=S.align;"index"in S?w=S.index:w=e.findIndex(function(T){return i(T)===S.key});var b=S.offset,C=b===void 0?0:b;v({times:0,index:w,offset:C,originAlign:E})}}}var rC=_.forwardRef(function(t,e){var n=t.prefixCls,r=t.rtl,i=t.scrollOffset,a=t.scrollRange,l=t.onStartMove,u=t.onStopMove,f=t.onScroll,h=t.horizontal,g=t.spinSize,m=t.containerSize,v=t.style,S=t.thumbStyle,w=t.showScrollBar,E=_.useState(!1),b=de(E,2),C=b[0],T=b[1],A=_.useState(null),O=de(A,2),x=O[0],N=O[1],F=_.useState(null),L=de(F,2),D=L[0],V=L[1],B=!r,W=_.useRef(),X=_.useRef(),Y=_.useState(w),ae=de(Y,2),U=ae[0],z=ae[1],j=_.useRef(),Z=function(){w===!0||w===!1||(clearTimeout(j.current),z(!0),j.current=setTimeout(function(){z(!1)},3e3))},P=a-m||0,$=m-g||0,ie=_.useMemo(function(){if(i===0||P===0)return 0;var ve=i/P;return ve*$},[i,P,$]),se=function(ge){ge.stopPropagation(),ge.preventDefault()},q=_.useRef({top:ie,dragging:C,pageY:x,startTop:D});q.current={top:ie,dragging:C,pageY:x,startTop:D};var ce=function(ge){T(!0),N(A_(ge,h)),V(q.current.top),l(),ge.stopPropagation(),ge.preventDefault()};_.useEffect(function(){var ve=function(we){we.preventDefault()},ge=W.current,_e=X.current;return ge.addEventListener("touchstart",ve,{passive:!1}),_e.addEventListener("touchstart",ce,{passive:!1}),function(){ge.removeEventListener("touchstart",ve),_e.removeEventListener("touchstart",ce)}},[]);var fe=_.useRef();fe.current=P;var ye=_.useRef();ye.current=$,_.useEffect(function(){if(C){var ve,ge=function(we){var xe=q.current,Ve=xe.dragging,Fe=xe.pageY,Be=xe.startTop;dr.cancel(ve);var nt=W.current.getBoundingClientRect(),He=m/(h?nt.width:nt.height);if(Ve){var Ge=(A_(we,h)-Fe)*He,Pe=Be;!B&&h?Pe-=Ge:Pe+=Ge;var Me=fe.current,dt=ye.current,rt=dt?Pe/dt:0,it=Math.ceil(rt*Me);it=Math.max(it,0),it=Math.min(it,Me),ve=dr(function(){f(it,h)})}},_e=function(){T(!1),u()};return window.addEventListener("mousemove",ge,{passive:!0}),window.addEventListener("touchmove",ge,{passive:!0}),window.addEventListener("mouseup",_e,{passive:!0}),window.addEventListener("touchend",_e,{passive:!0}),function(){window.removeEventListener("mousemove",ge),window.removeEventListener("touchmove",ge),window.removeEventListener("mouseup",_e),window.removeEventListener("touchend",_e),dr.cancel(ve)}}},[C]),_.useEffect(function(){return Z(),function(){clearTimeout(j.current)}},[i]),_.useImperativeHandle(e,function(){return{delayHidden:Z}});var Ee="".concat(n,"-scrollbar"),Ce={position:"absolute",visibility:U?null:"hidden"},Te={position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"};return h?(Ce.height=8,Ce.left=0,Ce.right=0,Ce.bottom=0,Te.height="100%",Te.width=g,B?Te.left=ie:Te.right=ie):(Ce.width=8,Ce.top=0,Ce.bottom=0,B?Ce.right=0:Ce.left=0,Te.width="100%",Te.height=g,Te.top=ie),_.createElement("div",{ref:W,className:Ze(Ee,K(K(K({},"".concat(Ee,"-horizontal"),h),"".concat(Ee,"-vertical"),!h),"".concat(Ee,"-visible"),U)),style:J(J({},Ce),v),onMouseDown:se,onMouseMove:Z},_.createElement("div",{ref:X,className:Ze("".concat(Ee,"-thumb"),K({},"".concat(Ee,"-thumb-moving"),C)),style:J(J({},Te),S),onMouseDown:ce}))}),WU=20;function iC(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=t/e*t;return isNaN(n)&&(n=0),n=Math.max(n,WU),Math.floor(n)}var XU=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],qU=[],YU={overflowY:"auto",overflowAnchor:"none"};function KU(t,e){var n=t.prefixCls,r=n===void 0?"rc-virtual-list":n,i=t.className,a=t.height,l=t.itemHeight,u=t.fullHeight,f=u===void 0?!0:u,h=t.style,g=t.data,m=t.children,v=t.itemKey,S=t.virtual,w=t.direction,E=t.scrollWidth,b=t.component,C=b===void 0?"div":b,T=t.onScroll,A=t.onVirtualScroll,O=t.onVisibleChange,x=t.innerProps,N=t.extraRender,F=t.styles,L=t.showScrollBar,D=L===void 0?"optional":L,V=Fn(t,XU),B=_.useCallback(function(Ae){return typeof v=="function"?v(Ae):Ae==null?void 0:Ae[v]},[v]),W=zU(B),X=de(W,4),Y=X[0],ae=X[1],U=X[2],z=X[3],j=!!(S!==!1&&a&&l),Z=_.useMemo(function(){return Object.values(U.maps).reduce(function(Ae,Le){return Ae+Le},0)},[U.id,U.maps]),P=j&&g&&(Math.max(l*g.length,Z)>a||!!E),$=w==="rtl",ie=Ze(r,K({},"".concat(r,"-rtl"),$),i),se=g||qU,q=_.useRef(),ce=_.useRef(),fe=_.useRef(),ye=_.useState(0),Ee=de(ye,2),Ce=Ee[0],Te=Ee[1],ve=_.useState(0),ge=de(ve,2),_e=ge[0],Ie=ge[1],we=_.useState(!1),xe=de(we,2),Ve=xe[0],Fe=xe[1],Be=function(){Fe(!0)},nt=function(){Fe(!1)},He={getKey:B};function Ge(Ae){Te(function(Le){var De;typeof Ae=="function"?De=Ae(Le):De=Ae;var be=Lt(De);return q.current.scrollTop=be,be})}var Pe=_.useRef({start:0,end:se.length}),Me=_.useRef(),dt=kU(se,B),rt=de(dt,1),it=rt[0];Me.current=it;var st=_.useMemo(function(){if(!j)return{scrollHeight:void 0,start:0,end:se.length-1,offset:void 0};if(!P){var Ae;return{scrollHeight:((Ae=ce.current)===null||Ae===void 0?void 0:Ae.offsetHeight)||0,start:0,end:se.length-1,offset:void 0}}for(var Le=0,De,be,ut,zt=se.length,Ot=0;Ot=Ce&&De===void 0&&(De=Ot,be=Le),Pn>Ce+a&&ut===void 0&&(ut=Ot),Le=Pn}return De===void 0&&(De=0,be=0,ut=Math.ceil(a/l)),ut===void 0&&(ut=se.length-1),ut=Math.min(ut+1,se.length-1),{scrollHeight:Le,start:De,end:ut,offset:be}},[P,j,Ce,se,z,a]),at=st.scrollHeight,Je=st.start,lt=st.end,ft=st.offset;Pe.current.start=Je,Pe.current.end=lt,_.useLayoutEffect(function(){var Ae=U.getRecord();if(Ae.size===1){var Le=Array.from(Ae)[0],De=B(se[Je]);if(De===Le){var be=U.get(Le),ut=be-l;Ge(function(zt){return zt+ut})}}U.resetRecord()},[at]);var ct=_.useState({width:0,height:a}),mt=de(ct,2),xt=mt[0],Bt=mt[1],ht=function(Le){Bt({width:Le.offsetWidth,height:Le.offsetHeight})},Vt=_.useRef(),qt=_.useRef(),wn=_.useMemo(function(){return iC(xt.width,E)},[xt.width,E]),Mn=_.useMemo(function(){return iC(xt.height,at)},[xt.height,at]),Ut=at-a,It=_.useRef(Ut);It.current=Ut;function Lt(Ae){var Le=Ae;return Number.isNaN(It.current)||(Le=Math.min(Le,It.current)),Le=Math.max(Le,0),Le}var Jt=Ce<=0,Mt=Ce>=Ut,qe=_e<=0,ke=_e>=E,Ne=vx(Jt,Mt,qe,ke),Et=function(){return{x:$?-_e:_e,y:Ce}},en=_.useRef(Et()),Ue=fr(function(Ae){if(A){var Le=J(J({},Et()),Ae);(en.current.x!==Le.x||en.current.y!==Le.y)&&(A(Le),en.current=Le)}});function Oe(Ae,Le){var De=Ae;Le?(za.flushSync(function(){Ie(De)}),Ue()):Ge(De)}function je(Ae){var Le=Ae.currentTarget.scrollTop;Le!==Ce&&Ge(Le),T==null||T(Ae),Ue()}var Ye=function(Le){var De=Le,be=E?E-xt.width:0;return De=Math.max(De,0),De=Math.min(De,be),De},We=fr(function(Ae,Le){Le?(za.flushSync(function(){Ie(function(De){var be=De+($?-Ae:Ae);return Ye(be)})}),Ue()):Ge(function(De){var be=De+Ae;return be})}),Qe=BU(j,Jt,Mt,qe,ke,!!E,We),bt=de(Qe,2),_t=bt[0],Zt=bt[1];$U(j,q,function(Ae,Le,De,be){var ut=be;return Ne(Ae,Le,De)?!1:!ut||!ut._virtualHandled?(ut&&(ut._virtualHandled=!0),_t({preventDefault:function(){},deltaX:Ae?Le:0,deltaY:Ae?0:Le}),!0):!1}),VU(P,q,function(Ae){Ge(function(Le){return Le+Ae})}),Dn(function(){function Ae(De){var be=Jt&&De.detail<0,ut=Mt&&De.detail>0;j&&!be&&!ut&&De.preventDefault()}var Le=q.current;return Le.addEventListener("wheel",_t,{passive:!1}),Le.addEventListener("DOMMouseScroll",Zt,{passive:!0}),Le.addEventListener("MozMousePixelScroll",Ae,{passive:!1}),function(){Le.removeEventListener("wheel",_t),Le.removeEventListener("DOMMouseScroll",Zt),Le.removeEventListener("MozMousePixelScroll",Ae)}},[j,Jt,Mt]),Dn(function(){if(E){var Ae=Ye(_e);Ie(Ae),Ue({x:Ae})}},[xt.width,E]);var Yt=function(){var Le,De;(Le=Vt.current)===null||Le===void 0||Le.delayHidden(),(De=qt.current)===null||De===void 0||De.delayHidden()},vn=jU(q,se,U,l,B,function(){return ae(!0)},Ge,Yt);_.useImperativeHandle(e,function(){return{nativeElement:fe.current,getScrollInfo:Et,scrollTo:function(Le){function De(be){return be&&pt(be)==="object"&&("left"in be||"top"in be)}De(Le)?(Le.left!==void 0&&Ie(Ye(Le.left)),vn(Le.top)):vn(Le)}}}),Dn(function(){if(O){var Ae=se.slice(Je,lt+1);O(Ae,se)}},[Je,lt,se]);var On=UU(se,B,U,l),_n=N==null?void 0:N({start:Je,end:lt,virtual:P,offsetX:_e,offsetY:ft,rtl:$,getSize:On}),Zn=DU(se,Je,lt,E,_e,Y,m,He),un=null;a&&(un=J(K({},f?"height":"maxHeight",a),YU),j&&(un.overflowY="hidden",E&&(un.overflowX="hidden"),Ve&&(un.pointerEvents="none")));var rn={};return $&&(rn.dir="rtl"),_.createElement("div",kt({ref:fe,style:J(J({},h),{},{position:"relative"}),className:ie},rn,V),_.createElement(Yo,{onResize:ht},_.createElement(C,{className:"".concat(r,"-holder"),style:un,ref:q,onScroll:je,onMouseEnter:Yt},_.createElement(mx,{prefixCls:r,height:at,offsetX:_e,offsetY:ft,scrollWidth:E,onInnerResize:ae,ref:ce,innerProps:x,rtl:$,extra:_n},Zn))),P&&at>a&&_.createElement(rC,{ref:Vt,prefixCls:r,scrollOffset:Ce,scrollRange:at,rtl:$,onScroll:Oe,onStartMove:Be,onStopMove:nt,spinSize:Mn,containerSize:xt.height,style:F==null?void 0:F.verticalScrollBar,thumbStyle:F==null?void 0:F.verticalScrollBarThumb,showScrollBar:D}),P&&E>xt.width&&_.createElement(rC,{ref:qt,prefixCls:r,scrollOffset:_e,scrollRange:E,rtl:$,onScroll:Oe,onStartMove:Be,onStopMove:nt,spinSize:wn,containerSize:xt.width,horizontal:!0,style:F==null?void 0:F.horizontalScrollBar,thumbStyle:F==null?void 0:F.horizontalScrollBarThumb,showScrollBar:D}))}var _x=_.forwardRef(KU);_x.displayName="List";function ZU(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var QU=["disabled","title","children","style","className"];function sC(t){return typeof t=="string"||typeof t=="number"}var GU=function(e,n){var r=UB(),i=r.prefixCls,a=r.id,l=r.open,u=r.multiple,f=r.mode,h=r.searchValue,g=r.toggleOpen,m=r.notFoundContent,v=r.onPopupScroll,S=_.useContext(Gy),w=S.maxCount,E=S.flattenOptions,b=S.onActiveValue,C=S.defaultActiveFirstOption,T=S.onSelect,A=S.menuItemSelectedIcon,O=S.rawValues,x=S.fieldNames,N=S.virtual,F=S.direction,L=S.listHeight,D=S.listItemHeight,V=S.optionRender,B="".concat(i,"-item"),W=Yg(function(){return E},[l,E],function(ve,ge){return ge[0]&&ve[1]!==ge[1]}),X=_.useRef(null),Y=_.useMemo(function(){return u&&w_(w)&&(O==null?void 0:O.size)>=w},[u,w,O==null?void 0:O.size]),ae=function(ge){ge.preventDefault()},U=function(ge){var _e;(_e=X.current)===null||_e===void 0||_e.scrollTo(typeof ge=="number"?{index:ge}:ge)},z=_.useCallback(function(ve){return f==="combobox"?!1:O.has(ve)},[f,ze(O).toString(),O.size]),j=function(ge){for(var _e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Ie=W.length,we=0;we1&&arguments[1]!==void 0?arguments[1]:!1;ie(ge);var Ie={source:_e?"keyboard":"mouse"},we=W[ge];if(!we){b(null,-1,Ie);return}b(we.value,ge,Ie)};_.useEffect(function(){se(C!==!1?j(0):-1)},[W.length,h]);var q=_.useCallback(function(ve){return f==="combobox"?String(ve).toLowerCase()===h.toLowerCase():O.has(ve)},[f,h,ze(O).toString(),O.size]);_.useEffect(function(){var ve=setTimeout(function(){if(!u&&l&&O.size===1){var _e=Array.from(O)[0],Ie=W.findIndex(function(we){var xe=we.data;return xe.value===_e});Ie!==-1&&(se(Ie),U(Ie))}});if(l){var ge;(ge=X.current)===null||ge===void 0||ge.scrollTo(void 0)}return function(){return clearTimeout(ve)}},[l,h]);var ce=function(ge){ge!==void 0&&T(ge,{selected:!O.has(ge)}),u||g(!1)};if(_.useImperativeHandle(n,function(){return{onKeyDown:function(ge){var _e=ge.which,Ie=ge.ctrlKey;switch(_e){case et.N:case et.P:case et.UP:case et.DOWN:{var we=0;if(_e===et.UP?we=-1:_e===et.DOWN?we=1:ZU()&&Ie&&(_e===et.N?we=1:_e===et.P&&(we=-1)),we!==0){var xe=j($+we,we);U(xe),se(xe,!0)}break}case et.TAB:case et.ENTER:{var Ve,Fe=W[$];Fe&&!(Fe!=null&&(Ve=Fe.data)!==null&&Ve!==void 0&&Ve.disabled)&&!Y?ce(Fe.value):ce(void 0),l&&ge.preventDefault();break}case et.ESC:g(!1),l&&ge.stopPropagation()}},onKeyUp:function(){},scrollTo:function(ge){U(ge)}}}),W.length===0)return _.createElement("div",{role:"listbox",id:"".concat(a,"_list"),className:"".concat(B,"-empty"),onMouseDown:ae},m);var fe=Object.keys(x).map(function(ve){return x[ve]}),ye=function(ge){return ge.label};function Ee(ve,ge){var _e=ve.group;return{role:_e?"presentation":"option",id:"".concat(a,"_list_").concat(ge)}}var Ce=function(ge){var _e=W[ge];if(!_e)return null;var Ie=_e.data||{},we=Ie.value,xe=_e.group,Ve=Gh(Ie,!0),Fe=ye(_e);return _e?_.createElement("div",kt({"aria-label":typeof Fe=="string"&&!xe?Fe:null},Ve,{key:ge},Ee(_e,ge),{"aria-selected":q(we)}),we):null},Te={role:"listbox",id:"".concat(a,"_list")};return _.createElement(_.Fragment,null,N&&_.createElement("div",kt({},Te,{style:{height:0,width:0,overflow:"hidden"}}),Ce($-1),Ce($),Ce($+1)),_.createElement(_x,{itemKey:"key",ref:X,data:W,height:L,itemHeight:D,fullHeight:!1,onMouseDown:ae,onScroll:v,virtual:N,direction:F,innerProps:N?null:Te},function(ve,ge){var _e=ve.group,Ie=ve.groupOption,we=ve.data,xe=ve.label,Ve=ve.value,Fe=we.key;if(_e){var Be,nt=(Be=we.title)!==null&&Be!==void 0?Be:sC(xe)?xe.toString():void 0;return _.createElement("div",{className:Ze(B,"".concat(B,"-group"),we.className),title:nt},xe!==void 0?xe:Fe)}var He=we.disabled,Ge=we.title;we.children;var Pe=we.style,Me=we.className,dt=Fn(we,QU),rt=V3(dt,fe),it=z(Ve),st=He||!it&&Y,at="".concat(B,"-option"),Je=Ze(B,at,Me,K(K(K(K({},"".concat(at,"-grouped"),Ie),"".concat(at,"-active"),$===ge&&!st),"".concat(at,"-disabled"),st),"".concat(at,"-selected"),it)),lt=ye(ve),ft=!A||typeof A=="function"||it,ct=typeof lt=="number"?lt:lt||Ve,mt=sC(ct)?ct.toString():void 0;return Ge!==void 0&&(mt=Ge),_.createElement("div",kt({},Gh(rt),N?{}:Ee(ve,ge),{"aria-selected":q(Ve),className:Je,title:mt,onMouseMove:function(){$===ge||st||se(ge)},onClick:function(){st||ce(Ve)},style:Pe}),_.createElement("div",{className:"".concat(at,"-content")},typeof V=="function"?V(ve,{index:ge}):ct),_.isValidElement(A)||it,ft&&_.createElement(rp,{className:"".concat(B,"-option-state"),customizeIcon:A,customizeIconProps:{value:Ve,disabled:st,isSelected:it}},it?"✓":null))}))},JU=_.forwardRef(GU);const eL=function(t,e){var n=_.useRef({values:new Map,options:new Map}),r=_.useMemo(function(){var a=n.current,l=a.values,u=a.options,f=t.map(function(m){if(m.label===void 0){var v;return J(J({},m),{},{label:(v=l.get(m.value))===null||v===void 0?void 0:v.label})}return m}),h=new Map,g=new Map;return f.forEach(function(m){h.set(m.value,m),g.set(m.value,e.get(m.value)||u.get(m.value))}),n.current.values=h,n.current.options=g,f},[t,e]),i=_.useCallback(function(a){return e.get(a)||n.current.options.get(a)},[e]);return[r,i]};function Fv(t,e){return dx(t).join("").toUpperCase().includes(e)}const tL=function(t,e,n,r,i){return _.useMemo(function(){if(!n||r===!1)return t;var a=e.options,l=e.label,u=e.value,f=[],h=typeof r=="function",g=n.toUpperCase(),m=h?r:function(S,w){return i?Fv(w[i],g):w[a]?Fv(w[l!=="children"?l:"label"],g):Fv(w[u],g)},v=h?function(S){return T_(S)}:function(S){return S};return t.forEach(function(S){if(S[a]){var w=m(n,v(S));if(w)f.push(S);else{var E=S[a].filter(function(b){return m(n,v(b))});E.length&&f.push(J(J({},S),{},K({},a,E)))}return}m(n,v(S))&&f.push(S)}),f},[t,r,i,n,e])};var aC=0,nL=Zr();function rL(){var t;return nL?(t=aC,aC+=1):t="TEST_OR_SSR",t}function iL(t){var e=_.useState(),n=de(e,2),r=n[0],i=n[1];return _.useEffect(function(){i("rc_select_".concat(rL()))},[]),t||r}var sL=["children","value"],aL=["children"];function oL(t){var e=t,n=e.key,r=e.props,i=r.children,a=r.value,l=Fn(r,sL);return J({key:n,value:a!==void 0?a:n,children:i},l)}function yx(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Lo(t).map(function(n,r){if(!_.isValidElement(n)||!n.type)return null;var i=n,a=i.type.isSelectOptGroup,l=i.key,u=i.props,f=u.children,h=Fn(u,aL);return e||!a?oL(n):J(J({key:"__RC_SELECT_GRP__".concat(l===null?r:l,"__"),label:l},h),{},{options:yx(f)})}).filter(function(n){return n})}var lL=function(e,n,r,i,a){return _.useMemo(function(){var l=e,u=!e;u&&(l=yx(n));var f=new Map,h=new Map,g=function(S,w,E){E&&typeof E=="string"&&S.set(w[E],w)},m=function v(S){for(var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,E=0;E0?Ue(Ye.options):Ye.options}):Ye})},ct=_.useMemo(function(){return T?ft(lt):lt},[lt,T,Te]),mt=_.useMemo(function(){return RU(ct,{fieldNames:ye,childrenAsData:ce})},[ct,ye,ce]),xt=function(Oe){var je=xe(Oe);if(nt(je),P&&(je.length!==Me.length||je.some(function(Qe,bt){var _t;return((_t=Me[bt])===null||_t===void 0?void 0:_t.value)!==(Qe==null?void 0:Qe.value)}))){var Ye=Z?je:je.map(function(Qe){return Qe.value}),We=je.map(function(Qe){return T_(dt(Qe.value))});P(q?Ye:Ye[0],q?We:We[0])}},Bt=_.useState(null),ht=de(Bt,2),Vt=ht[0],qt=ht[1],wn=_.useState(0),Mn=de(wn,2),Ut=Mn[0],It=Mn[1],Lt=L!==void 0?L:r!=="combobox",Jt=_.useCallback(function(Ue,Oe){var je=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Ye=je.source,We=Ye===void 0?"keyboard":Ye;It(Oe),l&&r==="combobox"&&Ue!==null&&We==="keyboard"&&qt(String(Ue))},[l,r]),Mt=function(Oe,je,Ye){var We=function(){var un,rn=dt(Oe);return[Z?{label:rn==null?void 0:rn[ye.label],value:Oe,key:(un=rn==null?void 0:rn.key)!==null&&un!==void 0?un:Oe}:Oe,T_(rn)]};if(je&&S){var Qe=We(),bt=de(Qe,2),_t=bt[0],Zt=bt[1];S(_t,Zt)}else if(!je&&w&&Ye!=="clear"){var Yt=We(),vn=de(Yt,2),On=vn[0],_n=vn[1];w(On,_n)}},qe=oC(function(Ue,Oe){var je,Ye=q?Oe.selected:!0;Ye?je=q?[].concat(ze(Me),[Ue]):[Ue]:je=Me.filter(function(We){return We.value!==Ue}),xt(je),Mt(Ue,Ye),r==="combobox"?qt(""):(!C_||v)&&(ve(""),qt(""))}),ke=function(Oe,je){xt(Oe);var Ye=je.type,We=je.values;(Ye==="remove"||Ye==="clear")&&We.forEach(function(Qe){Mt(Qe.value,!1,Ye)})},Ne=function(Oe,je){if(ve(Oe),qt(null),je.source==="submit"){var Ye=(Oe||"").trim();if(Ye){var We=Array.from(new Set([].concat(ze(it),[Ye])));xt(We),Mt(Ye,!0),ve("")}return}je.source!=="blur"&&(r==="combobox"&&xt(Oe),g==null||g(Oe))},Et=function(Oe){var je=Oe;r!=="tags"&&(je=Oe.map(function(We){var Qe=Ie.get(We);return Qe==null?void 0:Qe.value}).filter(function(We){return We!==void 0}));var Ye=Array.from(new Set([].concat(ze(it),ze(je))));xt(Ye),Ye.forEach(function(We){Mt(We,!0)})},en=_.useMemo(function(){var Ue=V!==!1&&b!==!1;return J(J({},ge),{},{flattenOptions:mt,onActiveValue:Jt,defaultActiveFirstOption:Lt,onSelect:qe,menuItemSelectedIcon:D,rawValues:it,fieldNames:ye,virtual:Ue,direction:B,listHeight:X,listItemHeight:ae,childrenAsData:ce,maxCount:$,optionRender:N})},[$,ge,mt,Jt,Lt,qe,D,it,ye,V,b,B,X,ae,ce,N]);return _.createElement(Gy.Provider,{value:en},_.createElement(NU,kt({},ie,{id:se,prefixCls:a,ref:e,omitDomProps:uL,mode:r,displayValues:rt,onDisplayValuesChange:ke,direction:B,searchValue:Te,onSearch:Ne,autoClearSearchValue:v,onSearchSplit:Et,dropdownMatchSelectWidth:b,OptionList:JU,emptyOptions:!mt.length,activeValue:Vt,activeDescendantId:"".concat(se,"_list_").concat(Ut)})))}),tb=dL;tb.Option=eb;tb.OptGroup=Jy;function hL(t,e,n){return Ze({[`${t}-status-success`]:e==="success",[`${t}-status-warning`]:e==="warning",[`${t}-status-error`]:e==="error",[`${t}-status-validating`]:e==="validating",[`${t}-has-feedback`]:n})}const gL=(t,e)=>e||t,pL=()=>{const[,t]=Ws(),[e]=Wy("Empty"),r=new En(t.colorBgBase).toHsl().l<.5?{opacity:.65}:{};return _.createElement("svg",{style:r,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg"},_.createElement("title",null,(e==null?void 0:e.description)||"Empty"),_.createElement("g",{fill:"none",fillRule:"evenodd"},_.createElement("g",{transform:"translate(24 31.67)"},_.createElement("ellipse",{fillOpacity:".8",fill:"#F5F5F7",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),_.createElement("path",{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",fill:"#AEB8C2"}),_.createElement("path",{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",fill:"url(#linearGradient-1)",transform:"translate(13.56)"}),_.createElement("path",{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",fill:"#F5F5F7"}),_.createElement("path",{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",fill:"#DCE0E6"})),_.createElement("path",{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",fill:"#DCE0E6"}),_.createElement("g",{transform:"translate(149.65 15.383)",fill:"#FFF"},_.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),_.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"}))))},mL=()=>{const[,t]=Ws(),[e]=Wy("Empty"),{colorFill:n,colorFillTertiary:r,colorFillQuaternary:i,colorBgContainer:a}=t,{borderColor:l,shadowColor:u,contentColor:f}=_.useMemo(()=>({borderColor:new En(n).onBackground(a).toHexString(),shadowColor:new En(r).onBackground(a).toHexString(),contentColor:new En(i).onBackground(a).toHexString()}),[n,r,i,a]);return _.createElement("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},_.createElement("title",null,(e==null?void 0:e.description)||"Empty"),_.createElement("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd"},_.createElement("ellipse",{fill:u,cx:"32",cy:"33",rx:"32",ry:"7"}),_.createElement("g",{fillRule:"nonzero",stroke:l},_.createElement("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"}),_.createElement("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",fill:f}))))},vL=t=>{const{componentCls:e,margin:n,marginXS:r,marginXL:i,fontSize:a,lineHeight:l}=t;return{[e]:{marginInline:r,fontSize:a,lineHeight:l,textAlign:"center",[`${e}-image`]:{height:t.emptyImgHeight,marginBottom:r,opacity:t.opacityImage,img:{height:"100%"},svg:{maxWidth:"100%",height:"100%",margin:"auto"}},[`${e}-description`]:{color:t.colorTextDescription},[`${e}-footer`]:{marginTop:n},"&-normal":{marginBlock:i,color:t.colorTextDescription,[`${e}-description`]:{color:t.colorTextDescription},[`${e}-image`]:{height:t.emptyImgHeightMD}},"&-small":{marginBlock:r,color:t.colorTextDescription,[`${e}-image`]:{height:t.emptyImgHeightSM}}}}},_L=zc("Empty",t=>{const{componentCls:e,controlHeightLG:n,calc:r}=t,i=ui(t,{emptyImgCls:`${e}-img`,emptyImgHeight:r(n).mul(2.5).equal(),emptyImgHeightMD:n,emptyImgHeightSM:r(n).mul(.875).equal()});return[vL(i)]});var yL=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{const{className:e,rootClassName:n,prefixCls:r,image:i=bx,description:a,children:l,imageStyle:u,style:f,classNames:h,styles:g}=t,m=yL(t,["className","rootClassName","prefixCls","image","description","children","imageStyle","style","classNames","styles"]),{getPrefixCls:v,direction:S,className:w,style:E,classNames:b,styles:C}=Uc("empty"),T=v("empty",r),[A,O,x]=_L(T),[N]=Wy("Empty"),F=typeof a<"u"?a:N==null?void 0:N.description,L=typeof F=="string"?F:"empty";let D=null;return typeof i=="string"?D=_.createElement("img",{alt:L,src:i}):D=i,A(_.createElement("div",Object.assign({className:Ze(O,x,T,w,{[`${T}-normal`]:i===Sx,[`${T}-rtl`]:S==="rtl"},e,n,b.root,h==null?void 0:h.root),style:Object.assign(Object.assign(Object.assign(Object.assign({},C.root),E),g==null?void 0:g.root),f)},m),_.createElement("div",{className:Ze(`${T}-image`,b.image,h==null?void 0:h.image),style:Object.assign(Object.assign(Object.assign({},u),C.image),g==null?void 0:g.image)},D),F&&_.createElement("div",{className:Ze(`${T}-description`,b.description,h==null?void 0:h.description),style:Object.assign(Object.assign({},C.description),g==null?void 0:g.description)},F),l&&_.createElement("div",{className:Ze(`${T}-footer`,b.footer,h==null?void 0:h.footer),style:Object.assign(Object.assign({},C.footer),g==null?void 0:g.footer)},l)))};mo.PRESENTED_IMAGE_DEFAULT=bx;mo.PRESENTED_IMAGE_SIMPLE=Sx;const bL=t=>{const{componentName:e}=t,{getPrefixCls:n}=_.useContext(ci),r=n("empty");switch(e){case"Table":case"List":return Ft.createElement(mo,{image:mo.PRESENTED_IMAGE_SIMPLE});case"Select":case"TreeSelect":case"Cascader":case"Transfer":case"Mentions":return Ft.createElement(mo,{image:mo.PRESENTED_IMAGE_SIMPLE,className:`${r}-small`});case"Table.filter":return null;default:return Ft.createElement(mo,null)}},SL=function(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;var r,i;const{variant:a,[t]:l}=_.useContext(ci),u=_.useContext(IB),f=l==null?void 0:l.variant;let h;typeof e<"u"?h=e:n===!1?h="borderless":h=(i=(r=u??f)!==null&&r!==void 0?r:a)!==null&&i!==void 0?i:"outlined";const g=lF.includes(h);return[h,g]},EL=t=>{const n={overflow:{adjustX:!0,adjustY:!0,shiftY:!0},htmlRegion:t==="scroll"?"scroll":"visible",dynamicInset:!0};return{bottomLeft:Object.assign(Object.assign({},n),{points:["tl","bl"],offset:[0,4]}),bottomRight:Object.assign(Object.assign({},n),{points:["tr","br"],offset:[0,4]}),topLeft:Object.assign(Object.assign({},n),{points:["bl","tl"],offset:[0,-4]}),topRight:Object.assign(Object.assign({},n),{points:["br","tr"],offset:[0,-4]})}};function wL(t,e){return t||EL(e)}const lC=t=>{const{optionHeight:e,optionFontSize:n,optionLineHeight:r,optionPadding:i}=t;return{position:"relative",display:"block",minHeight:e,padding:i,color:t.colorText,fontWeight:"normal",fontSize:n,lineHeight:r,boxSizing:"border-box"}},TL=t=>{const{antCls:e,componentCls:n}=t,r=`${n}-item`,i=`&${e}-slide-up-enter${e}-slide-up-enter-active`,a=`&${e}-slide-up-appear${e}-slide-up-appear-active`,l=`&${e}-slide-up-leave${e}-slide-up-leave-active`,u=`${n}-dropdown-placement-`,f=`${r}-option-selected`;return[{[`${n}-dropdown`]:Object.assign(Object.assign({},Lc(t)),{position:"absolute",top:-9999,zIndex:t.zIndexPopup,boxSizing:"border-box",padding:t.paddingXXS,overflow:"hidden",fontSize:t.fontSize,fontVariant:"initial",backgroundColor:t.colorBgElevated,borderRadius:t.borderRadiusLG,outline:"none",boxShadow:t.boxShadowSecondary,[` - ${i}${u}bottomLeft, - ${a}${u}bottomLeft - `]:{animationName:X3},[` - ${i}${u}topLeft, - ${a}${u}topLeft, - ${i}${u}topRight, - ${a}${u}topRight - `]:{animationName:Y3},[`${l}${u}bottomLeft`]:{animationName:q3},[` - ${l}${u}topLeft, - ${l}${u}topRight - `]:{animationName:K3},"&-hidden":{display:"none"},[r]:Object.assign(Object.assign({},lC(t)),{cursor:"pointer",transition:`background ${t.motionDurationSlow} ease`,borderRadius:t.borderRadiusSM,"&-group":{color:t.colorTextDescription,fontSize:t.fontSizeSM,cursor:"default"},"&-option":{display:"flex","&-content":Object.assign({flex:"auto"},s_),"&-state":{flex:"none",display:"flex",alignItems:"center"},[`&-active:not(${r}-option-disabled)`]:{backgroundColor:t.optionActiveBg},[`&-selected:not(${r}-option-disabled)`]:{color:t.optionSelectedColor,fontWeight:t.optionSelectedFontWeight,backgroundColor:t.optionSelectedBg,[`${r}-option-state`]:{color:t.colorPrimary}},"&-disabled":{[`&${r}-option-selected`]:{backgroundColor:t.colorBgContainerDisabled},color:t.colorTextDisabled,cursor:"not-allowed"},"&-grouped":{paddingInlineStart:t.calc(t.controlPaddingHorizontal).mul(2).equal()}},"&-empty":Object.assign(Object.assign({},lC(t)),{color:t.colorTextDisabled})}),[`${f}:has(+ ${f})`]:{borderEndStartRadius:0,borderEndEndRadius:0,[`& + ${f}`]:{borderStartStartRadius:0,borderStartEndRadius:0}},"&-rtl":{direction:"rtl"}})},CT(t,"slide-up"),CT(t,"slide-down"),TT(t,"move-up"),TT(t,"move-down")]},CL=t=>{const{multipleSelectItemHeight:e,paddingXXS:n,lineWidth:r,INTERNAL_FIXED_ITEM_MARGIN:i}=t,a=t.max(t.calc(n).sub(r).equal(),0),l=t.max(t.calc(a).sub(i).equal(),0);return{basePadding:a,containerPadding:l,itemHeight:Rt(e),itemLineHeight:Rt(t.calc(e).sub(t.calc(t.lineWidth).mul(2)).equal())}},AL=t=>{const{multipleSelectItemHeight:e,selectHeight:n,lineWidth:r}=t;return t.calc(n).sub(e).div(2).sub(r).equal()},RL=t=>{const{componentCls:e,iconCls:n,borderRadiusSM:r,motionDurationSlow:i,paddingXS:a,multipleItemColorDisabled:l,multipleItemBorderColorDisabled:u,colorIcon:f,colorIconHover:h,INTERNAL_FIXED_ITEM_MARGIN:g}=t;return{[`${e}-selection-overflow`]:{position:"relative",display:"flex",flex:"auto",flexWrap:"wrap",maxWidth:"100%","&-item":{flex:"none",alignSelf:"center",maxWidth:"100%",display:"inline-flex"},[`${e}-selection-item`]:{display:"flex",alignSelf:"center",flex:"none",boxSizing:"border-box",maxWidth:"100%",marginBlock:g,borderRadius:r,cursor:"default",transition:`font-size ${i}, line-height ${i}, height ${i}`,marginInlineEnd:t.calc(g).mul(2).equal(),paddingInlineStart:a,paddingInlineEnd:t.calc(a).div(2).equal(),[`${e}-disabled&`]:{color:l,borderColor:u,cursor:"not-allowed"},"&-content":{display:"inline-block",marginInlineEnd:t.calc(a).div(2).equal(),overflow:"hidden",whiteSpace:"pre",textOverflow:"ellipsis"},"&-remove":Object.assign(Object.assign({},qy()),{display:"inline-flex",alignItems:"center",color:f,fontWeight:"bold",fontSize:10,lineHeight:"inherit",cursor:"pointer",[`> ${n}`]:{verticalAlign:"-0.2em"},"&:hover":{color:h}})}}}},xL=(t,e)=>{const{componentCls:n,INTERNAL_FIXED_ITEM_MARGIN:r}=t,i=`${n}-selection-overflow`,a=t.multipleSelectItemHeight,l=AL(t),u=e?`${n}-${e}`:"",f=CL(t);return{[`${n}-multiple${u}`]:Object.assign(Object.assign({},RL(t)),{[`${n}-selector`]:{display:"flex",alignItems:"center",width:"100%",height:"100%",paddingInline:f.basePadding,paddingBlock:f.containerPadding,borderRadius:t.borderRadius,[`${n}-disabled&`]:{background:t.multipleSelectorBgDisabled,cursor:"not-allowed"},"&:after":{display:"inline-block",width:0,margin:`${Rt(r)} 0`,lineHeight:Rt(a),visibility:"hidden",content:'"\\a0"'}},[`${n}-selection-item`]:{height:f.itemHeight,lineHeight:Rt(f.itemLineHeight)},[`${n}-selection-wrap`]:{alignSelf:"flex-start","&:after":{lineHeight:Rt(a),marginBlock:r}},[`${n}-prefix`]:{marginInlineStart:t.calc(t.inputPaddingHorizontalBase).sub(f.basePadding).equal()},[`${i}-item + ${i}-item, - ${n}-prefix + ${n}-selection-wrap - `]:{[`${n}-selection-search`]:{marginInlineStart:0},[`${n}-selection-placeholder`]:{insetInlineStart:0}},[`${i}-item-suffix`]:{minHeight:f.itemHeight,marginBlock:r},[`${n}-selection-search`]:{display:"inline-flex",position:"relative",maxWidth:"100%",marginInlineStart:t.calc(t.inputPaddingHorizontalBase).sub(l).equal(),"\n &-input,\n &-mirror\n ":{height:a,fontFamily:t.fontFamily,lineHeight:Rt(a),transition:`all ${t.motionDurationSlow}`},"&-input":{width:"100%",minWidth:4.1},"&-mirror":{position:"absolute",top:0,insetInlineStart:0,insetInlineEnd:"auto",zIndex:999,whiteSpace:"pre",visibility:"hidden"}},[`${n}-selection-placeholder`]:{position:"absolute",top:"50%",insetInlineStart:t.calc(t.inputPaddingHorizontalBase).sub(f.basePadding).equal(),insetInlineEnd:t.inputPaddingHorizontalBase,transform:"translateY(-50%)",transition:`all ${t.motionDurationSlow}`}})}};function kv(t,e){const{componentCls:n}=t,r=e?`${n}-${e}`:"",i={[`${n}-multiple${r}`]:{fontSize:t.fontSize,[`${n}-selector`]:{[`${n}-show-search&`]:{cursor:"text"}},[` - &${n}-show-arrow ${n}-selector, - &${n}-allow-clear ${n}-selector - `]:{paddingInlineEnd:t.calc(t.fontSizeIcon).add(t.controlPaddingHorizontal).equal()}}};return[xL(t,e),i]}const ML=t=>{const{componentCls:e}=t,n=ui(t,{selectHeight:t.controlHeightSM,multipleSelectItemHeight:t.multipleItemHeightSM,borderRadius:t.borderRadiusSM,borderRadiusSM:t.borderRadiusXS}),r=ui(t,{fontSize:t.fontSizeLG,selectHeight:t.controlHeightLG,multipleSelectItemHeight:t.multipleItemHeightLG,borderRadius:t.borderRadiusLG,borderRadiusSM:t.borderRadius});return[kv(t),kv(n,"sm"),{[`${e}-multiple${e}-sm`]:{[`${e}-selection-placeholder`]:{insetInline:t.calc(t.controlPaddingHorizontalSM).sub(t.lineWidth).equal()},[`${e}-selection-search`]:{marginInlineStart:2}}},kv(r,"lg")]};function Bv(t,e){const{componentCls:n,inputPaddingHorizontalBase:r,borderRadius:i}=t,a=t.calc(t.controlHeight).sub(t.calc(t.lineWidth).mul(2)).equal(),l=e?`${n}-${e}`:"";return{[`${n}-single${l}`]:{fontSize:t.fontSize,height:t.controlHeight,[`${n}-selector`]:Object.assign(Object.assign({},Lc(t,!0)),{display:"flex",borderRadius:i,flex:"1 1 auto",[`${n}-selection-search`]:{position:"absolute",inset:0,width:"100%","&-input":{width:"100%",WebkitAppearance:"textfield"}},[` - ${n}-selection-item, - ${n}-selection-placeholder - `]:{display:"block",padding:0,lineHeight:Rt(a),transition:`all ${t.motionDurationSlow}, visibility 0s`,alignSelf:"center"},[`${n}-selection-placeholder`]:{transition:"none",pointerEvents:"none"},[["&:after",`${n}-selection-item:empty:after`,`${n}-selection-placeholder:empty:after`].join(",")]:{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'}}),[` - &${n}-show-arrow ${n}-selection-item, - &${n}-show-arrow ${n}-selection-search, - &${n}-show-arrow ${n}-selection-placeholder - `]:{paddingInlineEnd:t.showArrowPaddingInlineEnd},[`&${n}-open ${n}-selection-item`]:{color:t.colorTextPlaceholder},[`&:not(${n}-customize-input)`]:{[`${n}-selector`]:{width:"100%",height:"100%",alignItems:"center",padding:`0 ${Rt(r)}`,[`${n}-selection-search-input`]:{height:a},"&:after":{lineHeight:Rt(a)}}},[`&${n}-customize-input`]:{[`${n}-selector`]:{"&:after":{display:"none"},[`${n}-selection-search`]:{position:"static",width:"100%"},[`${n}-selection-placeholder`]:{position:"absolute",insetInlineStart:0,insetInlineEnd:0,padding:`0 ${Rt(r)}`,"&:after":{display:"none"}}}}}}}function OL(t){const{componentCls:e}=t,n=t.calc(t.controlPaddingHorizontalSM).sub(t.lineWidth).equal();return[Bv(t),Bv(ui(t,{controlHeight:t.controlHeightSM,borderRadius:t.borderRadiusSM}),"sm"),{[`${e}-single${e}-sm`]:{[`&:not(${e}-customize-input)`]:{[`${e}-selector`]:{padding:`0 ${Rt(n)}`},[`&${e}-show-arrow ${e}-selection-search`]:{insetInlineEnd:t.calc(n).add(t.calc(t.fontSize).mul(1.5)).equal()},[` - &${e}-show-arrow ${e}-selection-item, - &${e}-show-arrow ${e}-selection-placeholder - `]:{paddingInlineEnd:t.calc(t.fontSize).mul(1.5).equal()}}}},Bv(ui(t,{controlHeight:t.singleItemHeightLG,fontSize:t.fontSizeLG,borderRadius:t.borderRadiusLG}),"lg")]}const PL=t=>{const{fontSize:e,lineHeight:n,lineWidth:r,controlHeight:i,controlHeightSM:a,controlHeightLG:l,paddingXXS:u,controlPaddingHorizontal:f,zIndexPopupBase:h,colorText:g,fontWeightStrong:m,controlItemBgActive:v,controlItemBgHover:S,colorBgContainer:w,colorFillSecondary:E,colorBgContainerDisabled:b,colorTextDisabled:C,colorPrimaryHover:T,colorPrimary:A,controlOutline:O}=t,x=u*2,N=r*2,F=Math.min(i-x,i-N),L=Math.min(a-x,a-N),D=Math.min(l-x,l-N);return{INTERNAL_FIXED_ITEM_MARGIN:Math.floor(u/2),zIndexPopup:h+50,optionSelectedColor:g,optionSelectedFontWeight:m,optionSelectedBg:v,optionActiveBg:S,optionPadding:`${(i-e*n)/2}px ${f}px`,optionFontSize:e,optionLineHeight:n,optionHeight:i,selectorBg:w,clearBg:w,singleItemHeightLG:l,multipleItemBg:E,multipleItemBorderColor:"transparent",multipleItemHeight:F,multipleItemHeightSM:L,multipleItemHeightLG:D,multipleSelectorBgDisabled:b,multipleItemColorDisabled:C,multipleItemBorderColorDisabled:"transparent",showArrowPaddingInlineEnd:Math.ceil(t.fontSize*1.25),hoverBorderColor:T,activeBorderColor:A,activeOutlineColor:O,selectAffixPadding:u}},Ex=(t,e)=>{const{componentCls:n,antCls:r,controlOutlineWidth:i}=t;return{[`&:not(${n}-customize-input) ${n}-selector`]:{border:`${Rt(t.lineWidth)} ${t.lineType} ${e.borderColor}`,background:t.selectorBg},[`&:not(${n}-disabled):not(${n}-customize-input):not(${r}-pagination-size-changer)`]:{[`&:hover ${n}-selector`]:{borderColor:e.hoverBorderHover},[`${n}-focused& ${n}-selector`]:{borderColor:e.activeBorderColor,boxShadow:`0 0 0 ${Rt(i)} ${e.activeOutlineColor}`,outline:0},[`${n}-prefix`]:{color:e.color}}}},cC=(t,e)=>({[`&${t.componentCls}-status-${e.status}`]:Object.assign({},Ex(t,e))}),NL=t=>({"&-outlined":Object.assign(Object.assign(Object.assign(Object.assign({},Ex(t,{borderColor:t.colorBorder,hoverBorderHover:t.hoverBorderColor,activeBorderColor:t.activeBorderColor,activeOutlineColor:t.activeOutlineColor,color:t.colorText})),cC(t,{status:"error",borderColor:t.colorError,hoverBorderHover:t.colorErrorHover,activeBorderColor:t.colorError,activeOutlineColor:t.colorErrorOutline,color:t.colorError})),cC(t,{status:"warning",borderColor:t.colorWarning,hoverBorderHover:t.colorWarningHover,activeBorderColor:t.colorWarning,activeOutlineColor:t.colorWarningOutline,color:t.colorWarning})),{[`&${t.componentCls}-disabled`]:{[`&:not(${t.componentCls}-customize-input) ${t.componentCls}-selector`]:{background:t.colorBgContainerDisabled,color:t.colorTextDisabled}},[`&${t.componentCls}-multiple ${t.componentCls}-selection-item`]:{background:t.multipleItemBg,border:`${Rt(t.lineWidth)} ${t.lineType} ${t.multipleItemBorderColor}`}})}),wx=(t,e)=>{const{componentCls:n,antCls:r}=t;return{[`&:not(${n}-customize-input) ${n}-selector`]:{background:e.bg,border:`${Rt(t.lineWidth)} ${t.lineType} transparent`,color:e.color},[`&:not(${n}-disabled):not(${n}-customize-input):not(${r}-pagination-size-changer)`]:{[`&:hover ${n}-selector`]:{background:e.hoverBg},[`${n}-focused& ${n}-selector`]:{background:t.selectorBg,borderColor:e.activeBorderColor,outline:0}}}},uC=(t,e)=>({[`&${t.componentCls}-status-${e.status}`]:Object.assign({},wx(t,e))}),IL=t=>({"&-filled":Object.assign(Object.assign(Object.assign(Object.assign({},wx(t,{bg:t.colorFillTertiary,hoverBg:t.colorFillSecondary,activeBorderColor:t.activeBorderColor,color:t.colorText})),uC(t,{status:"error",bg:t.colorErrorBg,hoverBg:t.colorErrorBgHover,activeBorderColor:t.colorError,color:t.colorError})),uC(t,{status:"warning",bg:t.colorWarningBg,hoverBg:t.colorWarningBgHover,activeBorderColor:t.colorWarning,color:t.colorWarning})),{[`&${t.componentCls}-disabled`]:{[`&:not(${t.componentCls}-customize-input) ${t.componentCls}-selector`]:{borderColor:t.colorBorder,background:t.colorBgContainerDisabled,color:t.colorTextDisabled}},[`&${t.componentCls}-multiple ${t.componentCls}-selection-item`]:{background:t.colorBgContainer,border:`${Rt(t.lineWidth)} ${t.lineType} ${t.colorSplit}`}})}),DL=t=>({"&-borderless":{[`${t.componentCls}-selector`]:{background:"transparent",border:`${Rt(t.lineWidth)} ${t.lineType} transparent`},[`&${t.componentCls}-disabled`]:{[`&:not(${t.componentCls}-customize-input) ${t.componentCls}-selector`]:{color:t.colorTextDisabled}},[`&${t.componentCls}-multiple ${t.componentCls}-selection-item`]:{background:t.multipleItemBg,border:`${Rt(t.lineWidth)} ${t.lineType} ${t.multipleItemBorderColor}`},[`&${t.componentCls}-status-error`]:{[`${t.componentCls}-prefix, ${t.componentCls}-selection-item`]:{color:t.colorError}},[`&${t.componentCls}-status-warning`]:{[`${t.componentCls}-prefix, ${t.componentCls}-selection-item`]:{color:t.colorWarning}}}}),Tx=(t,e)=>{const{componentCls:n,antCls:r}=t;return{[`&:not(${n}-customize-input) ${n}-selector`]:{borderWidth:`0 0 ${Rt(t.lineWidth)} 0`,borderStyle:`none none ${t.lineType} none`,borderColor:e.borderColor,background:t.selectorBg,borderRadius:0},[`&:not(${n}-disabled):not(${n}-customize-input):not(${r}-pagination-size-changer)`]:{[`&:hover ${n}-selector`]:{borderColor:e.hoverBorderHover},[`${n}-focused& ${n}-selector`]:{borderColor:e.activeBorderColor,outline:0},[`${n}-prefix`]:{color:e.color}}}},fC=(t,e)=>({[`&${t.componentCls}-status-${e.status}`]:Object.assign({},Tx(t,e))}),FL=t=>({"&-underlined":Object.assign(Object.assign(Object.assign(Object.assign({},Tx(t,{borderColor:t.colorBorder,hoverBorderHover:t.hoverBorderColor,activeBorderColor:t.activeBorderColor,activeOutlineColor:t.activeOutlineColor,color:t.colorText})),fC(t,{status:"error",borderColor:t.colorError,hoverBorderHover:t.colorErrorHover,activeBorderColor:t.colorError,activeOutlineColor:t.colorErrorOutline,color:t.colorError})),fC(t,{status:"warning",borderColor:t.colorWarning,hoverBorderHover:t.colorWarningHover,activeBorderColor:t.colorWarning,activeOutlineColor:t.colorWarningOutline,color:t.colorWarning})),{[`&${t.componentCls}-disabled`]:{[`&:not(${t.componentCls}-customize-input) ${t.componentCls}-selector`]:{color:t.colorTextDisabled}},[`&${t.componentCls}-multiple ${t.componentCls}-selection-item`]:{background:t.multipleItemBg,border:`${Rt(t.lineWidth)} ${t.lineType} ${t.multipleItemBorderColor}`}})}),kL=t=>({[t.componentCls]:Object.assign(Object.assign(Object.assign(Object.assign({},NL(t)),IL(t)),DL(t)),FL(t))}),BL=t=>{const{componentCls:e}=t;return{position:"relative",transition:`all ${t.motionDurationMid} ${t.motionEaseInOut}`,input:{cursor:"pointer"},[`${e}-show-search&`]:{cursor:"text",input:{cursor:"auto",color:"inherit",height:"100%"}},[`${e}-disabled&`]:{cursor:"not-allowed",input:{cursor:"not-allowed"}}}},UL=t=>{const{componentCls:e}=t;return{[`${e}-selection-search-input`]:{margin:0,padding:0,background:"transparent",border:"none",outline:"none",appearance:"none",fontFamily:"inherit","&::-webkit-search-cancel-button":{display:"none","-webkit-appearance":"none"}}}},LL=t=>{const{antCls:e,componentCls:n,inputPaddingHorizontalBase:r,iconCls:i}=t;return{[n]:Object.assign(Object.assign({},Lc(t)),{position:"relative",display:"inline-flex",cursor:"pointer",[`&:not(${n}-customize-input) ${n}-selector`]:Object.assign(Object.assign({},BL(t)),UL(t)),[`${n}-selection-item`]:Object.assign(Object.assign({flex:1,fontWeight:"normal",position:"relative",userSelect:"none"},s_),{[`> ${e}-typography`]:{display:"inline"}}),[`${n}-selection-placeholder`]:Object.assign(Object.assign({},s_),{flex:1,color:t.colorTextPlaceholder,pointerEvents:"none"}),[`${n}-arrow`]:Object.assign(Object.assign({},qy()),{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:r,height:t.fontSizeIcon,marginTop:t.calc(t.fontSizeIcon).mul(-1).div(2).equal(),color:t.colorTextQuaternary,fontSize:t.fontSizeIcon,lineHeight:1,textAlign:"center",pointerEvents:"none",display:"flex",alignItems:"center",transition:`opacity ${t.motionDurationSlow} ease`,[i]:{verticalAlign:"top",transition:`transform ${t.motionDurationSlow}`,"> svg":{verticalAlign:"top"},[`&:not(${n}-suffix)`]:{pointerEvents:"auto"}},[`${n}-disabled &`]:{cursor:"not-allowed"},"> *:not(:last-child)":{marginInlineEnd:8}}),[`${n}-selection-wrap`]:{display:"flex",width:"100%",position:"relative",minWidth:0,"&:after":{content:'"\\a0"',width:0,overflow:"hidden"}},[`${n}-prefix`]:{flex:"none",marginInlineEnd:t.selectAffixPadding},[`${n}-clear`]:{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:r,zIndex:1,display:"inline-block",width:t.fontSizeIcon,height:t.fontSizeIcon,marginTop:t.calc(t.fontSizeIcon).mul(-1).div(2).equal(),color:t.colorTextQuaternary,fontSize:t.fontSizeIcon,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",cursor:"pointer",opacity:0,transition:`color ${t.motionDurationMid} ease, opacity ${t.motionDurationSlow} ease`,textRendering:"auto","&:before":{display:"block"},"&:hover":{color:t.colorTextTertiary}},[`&:hover ${n}-clear`]:{opacity:1,background:t.colorBgBase,borderRadius:"50%"}}),[`${n}-status`]:{"&-error, &-warning, &-success, &-validating":{[`&${n}-has-feedback`]:{[`${n}-clear`]:{insetInlineEnd:t.calc(r).add(t.fontSize).add(t.paddingXS).equal()}}}}}},zL=t=>{const{componentCls:e}=t;return[{[e]:{[`&${e}-in-form-item`]:{width:"100%"}}},LL(t),OL(t),ML(t),TL(t),{[`${e}-rtl`]:{direction:"rtl"}},x8(t,{borderElCls:`${e}-selector`,focusElCls:`${e}-focused`})]},$L=zc("Select",(t,e)=>{let{rootPrefixCls:n}=e;const r=ui(t,{rootPrefixCls:n,inputPaddingHorizontalBase:t.calc(t.paddingSM).sub(1).equal(),multipleSelectItemHeight:t.multipleItemHeight,selectHeight:t.controlHeight});return[zL(r),kL(r)]},PL,{unitless:{optionLineHeight:!0,optionSelectedFontWeight:!0}});var VL={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"}}]},name:"check",theme:"outlined"},HL=function(e,n){return _.createElement(Xs,kt({},e,{ref:n,icon:VL}))},jL=_.forwardRef(HL),WL={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"},XL=function(e,n){return _.createElement(Xs,kt({},e,{ref:n,icon:WL}))},qL=_.forwardRef(XL),YL={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"}}]},name:"search",theme:"outlined"},KL=function(e,n){return _.createElement(Xs,kt({},e,{ref:n,icon:YL}))},ZL=_.forwardRef(KL);function QL(t){let{suffixIcon:e,clearIcon:n,menuItemSelectedIcon:r,removeIcon:i,loading:a,multiple:l,hasFeedback:u,prefixCls:f,showSuffixIcon:h,feedbackIcon:g,showArrow:m,componentName:v}=t;const S=n??_.createElement(Rk,null),w=T=>e===null&&!u&&!m?null:_.createElement(_.Fragment,null,h!==!1&&T,u&&g);let E=null;if(e!==void 0)E=w(e);else if(a)E=w(_.createElement($k,{spin:!0}));else{const T=`${f}-suffix`;E=A=>{let{open:O,showSearch:x}=A;return w(O&&x?_.createElement(ZL,{className:T}):_.createElement(qL,{className:T}))}}let b=null;r!==void 0?b=r:l?b=_.createElement(jL,null):b=null;let C=null;return i!==void 0?C=i:C=_.createElement(Ok,null),{clearIcon:S,suffixIcon:E,itemIcon:b,removeIcon:C}}function GL(t,e){return e!==void 0?e:t!==null}var JL=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{var n;const{prefixCls:r,bordered:i,className:a,rootClassName:l,getPopupContainer:u,popupClassName:f,dropdownClassName:h,listHeight:g=256,placement:m,listItemHeight:v,size:S,disabled:w,notFoundContent:E,status:b,builtinPlacements:C,dropdownMatchSelectWidth:T,popupMatchSelectWidth:A,direction:O,style:x,allowClear:N,variant:F,dropdownStyle:L,transitionName:D,tagRender:V,maxCount:B,prefix:W}=t,X=JL(t,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","builtinPlacements","dropdownMatchSelectWidth","popupMatchSelectWidth","direction","style","allowClear","variant","dropdownStyle","transitionName","tagRender","maxCount","prefix"]),{getPopupContainer:Y,getPrefixCls:ae,renderEmpty:U,direction:z,virtual:j,popupMatchSelectWidth:Z,popupOverflow:P}=_.useContext(ci),$=Uc("select"),[,ie]=Ws(),se=v??(ie==null?void 0:ie.controlHeight),q=ae("select",r),ce=ae(),fe=O??z,{compactSize:ye,compactItemClassnames:Ee}=Yk(q,fe),[Ce,Te]=SL("select",F,i),ve=Uk(q),[ge,_e,Ie]=$L(q,ve),we=_.useMemo(()=>{const{mode:Vt}=t;if(Vt!=="combobox")return Vt===Cx?"combobox":Vt},[t.mode]),xe=we==="multiple"||we==="tags",Ve=GL(t.suffixIcon,t.showArrow),Fe=(n=A??T)!==null&&n!==void 0?n:Z,{status:Be,hasFeedback:nt,isFormItemInput:He,feedbackIcon:Ge}=_.useContext(S_),Pe=gL(Be,b);let Me;E!==void 0?Me=E:we==="combobox"?Me=null:Me=(U==null?void 0:U("Select"))||_.createElement(bL,{componentName:"Select"});const{suffixIcon:dt,itemIcon:rt,removeIcon:it,clearIcon:st}=QL(Object.assign(Object.assign({},X),{multiple:xe,hasFeedback:nt,feedbackIcon:Ge,showSuffixIcon:Ve,prefixCls:q,componentName:"Select"})),at=N===!0?{clearIcon:st}:N,Je=V3(X,["suffixIcon","itemIcon"]),lt=Ze(f||h,{[`${q}-dropdown-${fe}`]:fe==="rtl"},l,Ie,ve,_e),ft=H3(Vt=>{var qt;return(qt=S??ye)!==null&&qt!==void 0?qt:Vt}),ct=_.useContext(wf),mt=w??ct,xt=Ze({[`${q}-lg`]:ft==="large",[`${q}-sm`]:ft==="small",[`${q}-rtl`]:fe==="rtl",[`${q}-${Ce}`]:Te,[`${q}-in-form-item`]:He},hL(q,Pe,nt),Ee,$.className,a,l,Ie,ve,_e),Bt=_.useMemo(()=>m!==void 0?m:fe==="rtl"?"bottomRight":"bottomLeft",[m,fe]),[ht]=z3("SelectLike",L==null?void 0:L.zIndex);return ge(_.createElement(tb,Object.assign({ref:e,virtual:j,showSearch:$.showSearch},Je,{style:Object.assign(Object.assign({},$.style),x),dropdownMatchSelectWidth:Fe,transitionName:$3(ce,"slide-up",D),builtinPlacements:wL(C,P),listHeight:g,listItemHeight:se,mode:we,prefixCls:q,placement:Bt,direction:fe,prefix:W,suffixIcon:dt,menuItemSelectedIcon:rt,removeIcon:it,allowClear:at,notFoundContent:Me,className:xt,getPopupContainer:u||Y,dropdownClassName:lt,disabled:mt,dropdownStyle:Object.assign(Object.assign({},L),{zIndex:ht}),maxCount:xe?B:void 0,tagRender:xe?V:void 0})))},Hc=_.forwardRef(e7),t7=kB(Hc,"dropdownAlign");Hc.SECRET_COMBOBOX_MODE_DO_NOT_USE=Cx;Hc.Option=eb;Hc.OptGroup=Jy;Hc._InternalPanelDoNotUseOrYouWillBeFired=t7;function Ax(t){var e=t.children,n=t.prefixCls,r=t.id,i=t.overlayInnerStyle,a=t.bodyClassName,l=t.className,u=t.style;return _.createElement("div",{className:Ze("".concat(n,"-content"),l),style:u},_.createElement("div",{className:Ze("".concat(n,"-inner"),a),id:r,role:"tooltip",style:i},typeof e=="function"?e():e))}var Ul={shiftX:64,adjustY:1},Ll={adjustX:1,shiftY:!0},Ai=[0,0],n7={left:{points:["cr","cl"],overflow:Ll,offset:[-4,0],targetOffset:Ai},right:{points:["cl","cr"],overflow:Ll,offset:[4,0],targetOffset:Ai},top:{points:["bc","tc"],overflow:Ul,offset:[0,-4],targetOffset:Ai},bottom:{points:["tc","bc"],overflow:Ul,offset:[0,4],targetOffset:Ai},topLeft:{points:["bl","tl"],overflow:Ul,offset:[0,-4],targetOffset:Ai},leftTop:{points:["tr","tl"],overflow:Ll,offset:[-4,0],targetOffset:Ai},topRight:{points:["br","tr"],overflow:Ul,offset:[0,-4],targetOffset:Ai},rightTop:{points:["tl","tr"],overflow:Ll,offset:[4,0],targetOffset:Ai},bottomRight:{points:["tr","br"],overflow:Ul,offset:[0,4],targetOffset:Ai},rightBottom:{points:["bl","br"],overflow:Ll,offset:[4,0],targetOffset:Ai},bottomLeft:{points:["tl","bl"],overflow:Ul,offset:[0,4],targetOffset:Ai},leftBottom:{points:["br","bl"],overflow:Ll,offset:[-4,0],targetOffset:Ai}},r7=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow","classNames","styles"],i7=function(e,n){var r=e.overlayClassName,i=e.trigger,a=i===void 0?["hover"]:i,l=e.mouseEnterDelay,u=l===void 0?0:l,f=e.mouseLeaveDelay,h=f===void 0?.1:f,g=e.overlayStyle,m=e.prefixCls,v=m===void 0?"rc-tooltip":m,S=e.children,w=e.onVisibleChange,E=e.afterVisibleChange,b=e.transitionName,C=e.animation,T=e.motion,A=e.placement,O=A===void 0?"right":A,x=e.align,N=x===void 0?{}:x,F=e.destroyTooltipOnHide,L=F===void 0?!1:F,D=e.defaultVisible,V=e.getTooltipContainer,B=e.overlayInnerStyle;e.arrowContent;var W=e.overlay,X=e.id,Y=e.showArrow,ae=Y===void 0?!0:Y,U=e.classNames,z=e.styles,j=Fn(e,r7),Z=G3(X),P=_.useRef(null);_.useImperativeHandle(n,function(){return P.current});var $=J({},j);"visible"in e&&($.popupVisible=e.visible);var ie=function(){return _.createElement(Ax,{key:"content",prefixCls:v,id:Z,bodyClassName:U==null?void 0:U.body,overlayInnerStyle:J(J({},B),z==null?void 0:z.body)},W)},se=function(){var ce=_.Children.only(S),fe=(ce==null?void 0:ce.props)||{},ye=J(J({},fe),{},{"aria-describedby":W?Z:null});return _.cloneElement(S,ye)};return _.createElement(gx,kt({popupClassName:Ze(r,U==null?void 0:U.root),prefixCls:v,popup:ie,action:a,builtinPlacements:n7,popupPlacement:O,ref:P,popupAlign:N,getPopupContainer:V,onPopupVisibleChange:w,afterPopupVisibleChange:E,popupTransitionName:b,popupAnimation:C,popupMotion:T,defaultPopupVisible:D,autoDestroy:L,mouseLeaveDelay:h,popupStyle:J(J({},g),z==null?void 0:z.root),mouseEnterDelay:u,arrow:ae},$),se())};const s7=_.forwardRef(i7);function a7(t){const{sizePopupArrow:e,borderRadiusXS:n,borderRadiusOuter:r}=t,i=e/2,a=0,l=i,u=r*1/Math.sqrt(2),f=i-r*(1-1/Math.sqrt(2)),h=i-n*(1/Math.sqrt(2)),g=r*(Math.sqrt(2)-1)+n*(1/Math.sqrt(2)),m=2*i-h,v=g,S=2*i-u,w=f,E=2*i-a,b=l,C=i*Math.sqrt(2)+r*(Math.sqrt(2)-2),T=r*(Math.sqrt(2)-1),A=`polygon(${T}px 100%, 50% ${T}px, ${2*i-T}px 100%, ${T}px 100%)`,O=`path('M ${a} ${l} A ${r} ${r} 0 0 0 ${u} ${f} L ${h} ${g} A ${n} ${n} 0 0 1 ${m} ${v} L ${S} ${w} A ${r} ${r} 0 0 0 ${E} ${b} Z')`;return{arrowShadowWidth:C,arrowPath:O,arrowPolygon:A}}const o7=(t,e,n)=>{const{sizePopupArrow:r,arrowPolygon:i,arrowPath:a,arrowShadowWidth:l,borderRadiusXS:u,calc:f}=t;return{pointerEvents:"none",width:r,height:r,overflow:"hidden","&::before":{position:"absolute",bottom:0,insetInlineStart:0,width:r,height:f(r).div(2).equal(),background:e,clipPath:{_multi_value_:!0,value:[i,a]},content:'""'},"&::after":{content:'""',position:"absolute",width:l,height:l,bottom:0,insetInline:0,margin:"auto",borderRadius:{_skip_check_:!0,value:`0 0 ${Rt(u)} 0`},transform:"translateY(50%) rotate(-135deg)",boxShadow:n,zIndex:0,background:"transparent"}}},Rx=8;function xx(t){const{contentRadius:e,limitVerticalRadius:n}=t,r=e>12?e+2:12;return{arrowOffsetHorizontal:r,arrowOffsetVertical:n?Rx:r}}function uh(t,e){return t?e:{}}function l7(t,e,n){const{componentCls:r,boxShadowPopoverArrow:i,arrowOffsetVertical:a,arrowOffsetHorizontal:l}=t,{arrowDistance:u=0,arrowPlacement:f={left:!0,right:!0,top:!0,bottom:!0}}={};return{[r]:Object.assign(Object.assign(Object.assign(Object.assign({[`${r}-arrow`]:[Object.assign(Object.assign({position:"absolute",zIndex:1,display:"block"},o7(t,e,i)),{"&:before":{background:e}})]},uh(!!f.top,{[[`&-placement-top > ${r}-arrow`,`&-placement-topLeft > ${r}-arrow`,`&-placement-topRight > ${r}-arrow`].join(",")]:{bottom:u,transform:"translateY(100%) rotate(180deg)"},[`&-placement-top > ${r}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},"&-placement-topLeft":{"--arrow-offset-horizontal":l,[`> ${r}-arrow`]:{left:{_skip_check_:!0,value:l}}},"&-placement-topRight":{"--arrow-offset-horizontal":`calc(100% - ${Rt(l)})`,[`> ${r}-arrow`]:{right:{_skip_check_:!0,value:l}}}})),uh(!!f.bottom,{[[`&-placement-bottom > ${r}-arrow`,`&-placement-bottomLeft > ${r}-arrow`,`&-placement-bottomRight > ${r}-arrow`].join(",")]:{top:u,transform:"translateY(-100%)"},[`&-placement-bottom > ${r}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},"&-placement-bottomLeft":{"--arrow-offset-horizontal":l,[`> ${r}-arrow`]:{left:{_skip_check_:!0,value:l}}},"&-placement-bottomRight":{"--arrow-offset-horizontal":`calc(100% - ${Rt(l)})`,[`> ${r}-arrow`]:{right:{_skip_check_:!0,value:l}}}})),uh(!!f.left,{[[`&-placement-left > ${r}-arrow`,`&-placement-leftTop > ${r}-arrow`,`&-placement-leftBottom > ${r}-arrow`].join(",")]:{right:{_skip_check_:!0,value:u},transform:"translateX(100%) rotate(90deg)"},[`&-placement-left > ${r}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(100%) rotate(90deg)"},[`&-placement-leftTop > ${r}-arrow`]:{top:a},[`&-placement-leftBottom > ${r}-arrow`]:{bottom:a}})),uh(!!f.right,{[[`&-placement-right > ${r}-arrow`,`&-placement-rightTop > ${r}-arrow`,`&-placement-rightBottom > ${r}-arrow`].join(",")]:{left:{_skip_check_:!0,value:u},transform:"translateX(-100%) rotate(-90deg)"},[`&-placement-right > ${r}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(-100%) rotate(-90deg)"},[`&-placement-rightTop > ${r}-arrow`]:{top:a},[`&-placement-rightBottom > ${r}-arrow`]:{bottom:a}}))}}function c7(t,e,n,r){if(r===!1)return{adjustX:!1,adjustY:!1};const i=r&&typeof r=="object"?r:{},a={};switch(t){case"top":case"bottom":a.shiftX=e.arrowOffsetHorizontal*2+n,a.shiftY=!0,a.adjustY=!0;break;case"left":case"right":a.shiftY=e.arrowOffsetVertical*2+n,a.shiftX=!0,a.adjustX=!0;break}const l=Object.assign(Object.assign({},a),i);return l.shiftX||(l.adjustX=!0),l.shiftY||(l.adjustY=!0),l}const dC={left:{points:["cr","cl"]},right:{points:["cl","cr"]},top:{points:["bc","tc"]},bottom:{points:["tc","bc"]},topLeft:{points:["bl","tl"]},leftTop:{points:["tr","tl"]},topRight:{points:["br","tr"]},rightTop:{points:["tl","tr"]},bottomRight:{points:["tr","br"]},rightBottom:{points:["bl","br"]},bottomLeft:{points:["tl","bl"]},leftBottom:{points:["br","bl"]}},u7={topLeft:{points:["bl","tc"]},leftTop:{points:["tr","cl"]},topRight:{points:["br","tc"]},rightTop:{points:["tl","cr"]},bottomRight:{points:["tr","bc"]},rightBottom:{points:["bl","cr"]},bottomLeft:{points:["tl","bc"]},leftBottom:{points:["br","cl"]}},f7=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function d7(t){const{arrowWidth:e,autoAdjustOverflow:n,arrowPointAtCenter:r,offset:i,borderRadius:a}=t,l=e/2,u={};return Object.keys(dC).forEach(f=>{const h=r&&u7[f]||dC[f],g=Object.assign(Object.assign({},h),{offset:[0,0],dynamicInset:!0});switch(u[f]=g,f7.has(f)&&(g.autoArrow=!1),f){case"top":case"topLeft":case"topRight":g.offset[1]=-l-i;break;case"bottom":case"bottomLeft":case"bottomRight":g.offset[1]=l+i;break;case"left":case"leftTop":case"leftBottom":g.offset[0]=-l-i;break;case"right":case"rightTop":case"rightBottom":g.offset[0]=l+i;break}const m=xx({contentRadius:a,limitVerticalRadius:!0});if(r)switch(f){case"topLeft":case"bottomLeft":g.offset[0]=-m.arrowOffsetHorizontal-l;break;case"topRight":case"bottomRight":g.offset[0]=m.arrowOffsetHorizontal+l;break;case"leftTop":case"rightTop":g.offset[1]=-m.arrowOffsetHorizontal*2+l;break;case"leftBottom":case"rightBottom":g.offset[1]=m.arrowOffsetHorizontal*2-l;break}g.overflow=c7(f,m,e,n),g.htmlRegion="visibleFirst"}),u}const h7=t=>{const{calc:e,componentCls:n,tooltipMaxWidth:r,tooltipColor:i,tooltipBg:a,tooltipBorderRadius:l,zIndexPopup:u,controlHeight:f,boxShadowSecondary:h,paddingSM:g,paddingXS:m,arrowOffsetHorizontal:v,sizePopupArrow:S}=t,w=e(l).add(S).add(v).equal(),E=e(l).mul(2).add(S).equal();return[{[n]:Object.assign(Object.assign(Object.assign(Object.assign({},Lc(t)),{position:"absolute",zIndex:u,display:"block",width:"max-content",maxWidth:r,visibility:"visible","--valid-offset-x":"var(--arrow-offset-horizontal, var(--arrow-x))",transformOrigin:["var(--valid-offset-x, 50%)","var(--arrow-y, 50%)"].join(" "),"&-hidden":{display:"none"},"--antd-arrow-background-color":a,[`${n}-inner`]:{minWidth:E,minHeight:f,padding:`${Rt(t.calc(g).div(2).equal())} ${Rt(m)}`,color:i,textAlign:"start",textDecoration:"none",wordWrap:"break-word",backgroundColor:a,borderRadius:l,boxShadow:h,boxSizing:"border-box"},[["&-placement-topLeft","&-placement-topRight","&-placement-bottomLeft","&-placement-bottomRight"].join(",")]:{minWidth:w},[["&-placement-left","&-placement-leftTop","&-placement-leftBottom","&-placement-right","&-placement-rightTop","&-placement-rightBottom"].join(",")]:{[`${n}-inner`]:{borderRadius:t.min(l,Rx)}},[`${n}-content`]:{position:"relative"}}),DF(t,(b,C)=>{let{darkColor:T}=C;return{[`&${n}-${b}`]:{[`${n}-inner`]:{backgroundColor:T},[`${n}-arrow`]:{"--antd-arrow-background-color":T}}}})),{"&-rtl":{direction:"rtl"}})},l7(t,"var(--antd-arrow-background-color)"),{[`${n}-pure`]:{position:"relative",maxWidth:"none",margin:t.sizePopupArrow}}]},g7=t=>Object.assign(Object.assign({zIndexPopup:t.zIndexPopupBase+70},xx({contentRadius:t.borderRadius,limitVerticalRadius:!0})),a7(ui(t,{borderRadiusOuter:Math.min(t.borderRadiusOuter,4)}))),Mx=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return zc("Tooltip",r=>{const{borderRadius:i,colorTextLightSolid:a,colorBgSpotlight:l}=r,u=ui(r,{tooltipMaxWidth:250,tooltipColor:a,tooltipBorderRadius:i,tooltipBg:l});return[h7(u),C8(r,"zoom-big-fast")]},g7,{resetStyle:!1,injectStyle:e})(t)},p7=Zh.map(t=>`${t}-inverse`);function m7(t){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)?[].concat(ze(p7),ze(Zh)).includes(t):Zh.includes(t)}function Ox(t,e){const n=m7(e),r=Ze({[`${t}-${e}`]:e&&n}),i={},a={};return e&&!n&&(i.background=e,a["--antd-arrow-background-color"]=e),{className:r,overlayStyle:i,arrowStyle:a}}const v7=t=>{const{prefixCls:e,className:n,placement:r="top",title:i,color:a,overlayInnerStyle:l}=t,{getPrefixCls:u}=_.useContext(ci),f=u("tooltip",e),[h,g,m]=Mx(f),v=Ox(f,a),S=v.arrowStyle,w=Object.assign(Object.assign({},l),v.overlayStyle),E=Ze(g,m,f,`${f}-pure`,`${f}-placement-${r}`,n,v.className);return h(_.createElement("div",{className:E,style:S},_.createElement("div",{className:`${f}-arrow`}),_.createElement(Ax,Object.assign({},t,{className:g,prefixCls:f,overlayInnerStyle:w}),i)))};var _7=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{var n,r;const{prefixCls:i,openClassName:a,getTooltipContainer:l,color:u,overlayInnerStyle:f,children:h,afterOpenChange:g,afterVisibleChange:m,destroyTooltipOnHide:v,arrow:S=!0,title:w,overlay:E,builtinPlacements:b,arrowPointAtCenter:C=!1,autoAdjustOverflow:T=!0,motion:A,getPopupContainer:O,placement:x="top",mouseEnterDelay:N=.1,mouseLeaveDelay:F=.1,overlayStyle:L,rootClassName:D,overlayClassName:V,styles:B,classNames:W}=t,X=_7(t,["prefixCls","openClassName","getTooltipContainer","color","overlayInnerStyle","children","afterOpenChange","afterVisibleChange","destroyTooltipOnHide","arrow","title","overlay","builtinPlacements","arrowPointAtCenter","autoAdjustOverflow","motion","getPopupContainer","placement","mouseEnterDelay","mouseLeaveDelay","overlayStyle","rootClassName","overlayClassName","styles","classNames"]),Y=!!S,[,ae]=Ws(),{getPopupContainer:U,getPrefixCls:z,direction:j,className:Z,style:P,classNames:$,styles:ie}=Uc("tooltip"),se=l3(),q=_.useRef(null),ce=()=>{var Je;(Je=q.current)===null||Je===void 0||Je.forceAlign()};_.useImperativeHandle(e,()=>{var Je,lt;return{forceAlign:ce,forcePopupAlign:()=>{se.deprecated(!1,"forcePopupAlign","forceAlign"),ce()},nativeElement:(Je=q.current)===null||Je===void 0?void 0:Je.nativeElement,popupElement:(lt=q.current)===null||lt===void 0?void 0:lt.popupElement}});const[fe,ye]=Tc(!1,{value:(n=t.open)!==null&&n!==void 0?n:t.visible,defaultValue:(r=t.defaultOpen)!==null&&r!==void 0?r:t.defaultVisible}),Ee=!w&&!E&&w!==0,Ce=Je=>{var lt,ft;ye(Ee?!1:Je),Ee||((lt=t.onOpenChange)===null||lt===void 0||lt.call(t,Je),(ft=t.onVisibleChange)===null||ft===void 0||ft.call(t,Je))},Te=_.useMemo(()=>{var Je,lt;let ft=C;return typeof S=="object"&&(ft=(lt=(Je=S.pointAtCenter)!==null&&Je!==void 0?Je:S.arrowPointAtCenter)!==null&<!==void 0?lt:C),b||d7({arrowPointAtCenter:ft,autoAdjustOverflow:T,arrowWidth:Y?ae.sizePopupArrow:0,borderRadius:ae.borderRadius,offset:ae.marginXXS})},[C,S,b,ae]),ve=_.useMemo(()=>w===0?w:E||w||"",[E,w]),ge=_.createElement(DB,{space:!0},typeof ve=="function"?ve():ve),_e=z("tooltip",i),Ie=z(),we=t["data-popover-inject"];let xe=fe;!("open"in t)&&!("visible"in t)&&Ee&&(xe=!1);const Ve=_.isValidElement(h)&&!kk(h)?h:_.createElement("span",null,h),Fe=Ve.props,Be=!Fe.className||typeof Fe.className=="string"?Ze(Fe.className,a||`${_e}-open`):Fe.className,[nt,He,Ge]=Mx(_e,!we),Pe=Ox(_e,u),Me=Pe.arrowStyle,dt=Ze(V,{[`${_e}-rtl`]:j==="rtl"},Pe.className,D,He,Ge,Z,$.root,W==null?void 0:W.root),rt=Ze($.body,W==null?void 0:W.body),[it,st]=z3("Tooltip",X.zIndex),at=_.createElement(s7,Object.assign({},X,{zIndex:it,showArrow:Y,placement:x,mouseEnterDelay:N,mouseLeaveDelay:F,prefixCls:_e,classNames:{root:dt,body:rt},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Me),ie.root),P),L),B==null?void 0:B.root),body:Object.assign(Object.assign(Object.assign(Object.assign({},ie.body),f),B==null?void 0:B.body),Pe.overlayStyle)},getTooltipContainer:O||l||U,ref:q,builtinPlacements:Te,overlay:ge,visible:xe,onVisibleChange:Ce,afterVisibleChange:g??m,arrowContent:_.createElement("span",{className:`${_e}-arrow-content`}),motion:{motionName:$3(Ie,"zoom-big-fast",t.transitionName),motionDeadline:1e3},destroyTooltipOnHide:!!v}),xe?B3(Ve,{className:Be}):Ve);return nt(_.createElement(U3.Provider,{value:st},at))}),Px=y7;Px._InternalPanelDoNotUseOrYouWillBeFired=v7;function b7(t,e,n){var r=n||{},i=r.noTrailing,a=i===void 0?!1:i,l=r.noLeading,u=l===void 0?!1:l,f=r.debounceMode,h=f===void 0?void 0:f,g,m=!1,v=0;function S(){g&&clearTimeout(g)}function w(b){var C=b||{},T=C.upcomingOnly,A=T===void 0?!1:T;S(),m=!A}function E(){for(var b=arguments.length,C=new Array(b),T=0;Tt?u?(v=Date.now(),a||(g=setTimeout(h?N:x,t))):x():a!==!0&&(g=setTimeout(h?N:x,h===void 0?t-O:t))}return E.cancel=w,E}function S7(t,e,n){var r={},i=r.atBegin,a=i===void 0?!1:i;return b7(t,e,{debounceMode:a!==!1})}function R_(t,e,n){return(t-e)/(n-e)}function nb(t,e,n,r){var i=R_(e,n,r),a={};switch(t){case"rtl":a.right="".concat(i*100,"%"),a.transform="translateX(50%)";break;case"btt":a.bottom="".concat(i*100,"%"),a.transform="translateY(50%)";break;case"ttb":a.top="".concat(i*100,"%"),a.transform="translateY(-50%)";break;default:a.left="".concat(i*100,"%"),a.transform="translateX(-50%)";break}return a}function vo(t,e){return Array.isArray(t)?t[e]:t}var Ko=_.createContext({min:0,max:0,direction:"ltr",step:1,includedStart:0,includedEnd:0,tabIndex:0,keyboard:!0,styles:{},classNames:{}}),E7=_.createContext({}),w7=["prefixCls","value","valueIndex","onStartMove","onDelete","style","render","dragging","draggingDelete","onOffsetChange","onChangeComplete","onFocus","onMouseEnter"],hC=_.forwardRef(function(t,e){var n=t.prefixCls,r=t.value,i=t.valueIndex,a=t.onStartMove,l=t.onDelete,u=t.style,f=t.render,h=t.dragging,g=t.draggingDelete,m=t.onOffsetChange,v=t.onChangeComplete,S=t.onFocus,w=t.onMouseEnter,E=Fn(t,w7),b=_.useContext(Ko),C=b.min,T=b.max,A=b.direction,O=b.disabled,x=b.keyboard,N=b.range,F=b.tabIndex,L=b.ariaLabelForHandle,D=b.ariaLabelledByForHandle,V=b.ariaRequired,B=b.ariaValueTextFormatterForHandle,W=b.styles,X=b.classNames,Y="".concat(n,"-handle"),ae=function(ce){O||a(ce,i)},U=function(ce){S==null||S(ce,i)},z=function(ce){w(ce,i)},j=function(ce){if(!O&&x){var fe=null;switch(ce.which||ce.keyCode){case et.LEFT:fe=A==="ltr"||A==="btt"?-1:1;break;case et.RIGHT:fe=A==="ltr"||A==="btt"?1:-1;break;case et.UP:fe=A!=="ttb"?1:-1;break;case et.DOWN:fe=A!=="ttb"?-1:1;break;case et.HOME:fe="min";break;case et.END:fe="max";break;case et.PAGE_UP:fe=2;break;case et.PAGE_DOWN:fe=-2;break;case et.BACKSPACE:case et.DELETE:l(i);break}fe!==null&&(ce.preventDefault(),m(fe,i))}},Z=function(ce){switch(ce.which||ce.keyCode){case et.LEFT:case et.RIGHT:case et.UP:case et.DOWN:case et.HOME:case et.END:case et.PAGE_UP:case et.PAGE_DOWN:v==null||v();break}},P=nb(A,r,C,T),$={};if(i!==null){var ie;$={tabIndex:O?null:vo(F,i),role:"slider","aria-valuemin":C,"aria-valuemax":T,"aria-valuenow":r,"aria-disabled":O,"aria-label":vo(L,i),"aria-labelledby":vo(D,i),"aria-required":vo(V,i),"aria-valuetext":(ie=vo(B,i))===null||ie===void 0?void 0:ie(r),"aria-orientation":A==="ltr"||A==="rtl"?"horizontal":"vertical",onMouseDown:ae,onTouchStart:ae,onFocus:U,onMouseEnter:z,onKeyDown:j,onKeyUp:Z}}var se=_.createElement("div",kt({ref:e,className:Ze(Y,K(K(K({},"".concat(Y,"-").concat(i+1),i!==null&&N),"".concat(Y,"-dragging"),h),"".concat(Y,"-dragging-delete"),g),X.handle),style:J(J(J({},P),u),W.handle)},$,E));return f&&(se=f(se,{index:i,prefixCls:n,value:r,dragging:h,draggingDelete:g})),se}),T7=["prefixCls","style","onStartMove","onOffsetChange","values","handleRender","activeHandleRender","draggingIndex","draggingDelete","onFocus"],C7=_.forwardRef(function(t,e){var n=t.prefixCls,r=t.style,i=t.onStartMove,a=t.onOffsetChange,l=t.values,u=t.handleRender,f=t.activeHandleRender,h=t.draggingIndex,g=t.draggingDelete,m=t.onFocus,v=Fn(t,T7),S=_.useRef({}),w=_.useState(!1),E=de(w,2),b=E[0],C=E[1],T=_.useState(-1),A=de(T,2),O=A[0],x=A[1],N=function(B){x(B),C(!0)},F=function(B,W){N(W),m==null||m(B)},L=function(B,W){N(W)};_.useImperativeHandle(e,function(){return{focus:function(B){var W;(W=S.current[B])===null||W===void 0||W.focus()},hideHelp:function(){za.flushSync(function(){C(!1)})}}});var D=J({prefixCls:n,onStartMove:i,onOffsetChange:a,render:u,onFocus:F,onMouseEnter:L},v);return _.createElement(_.Fragment,null,l.map(function(V,B){var W=h===B;return _.createElement(hC,kt({ref:function(Y){Y?S.current[B]=Y:delete S.current[B]},dragging:W,draggingDelete:W&&g,style:vo(r,B),key:B,value:V,valueIndex:B},D))}),f&&b&&_.createElement(hC,kt({key:"a11y"},D,{value:l[O],valueIndex:null,dragging:h!==-1,draggingDelete:g,render:f,style:{pointerEvents:"none"},tabIndex:null,"aria-hidden":!0})))}),A7=function(e){var n=e.prefixCls,r=e.style,i=e.children,a=e.value,l=e.onClick,u=_.useContext(Ko),f=u.min,h=u.max,g=u.direction,m=u.includedStart,v=u.includedEnd,S=u.included,w="".concat(n,"-text"),E=nb(g,a,f,h);return _.createElement("span",{className:Ze(w,K({},"".concat(w,"-active"),S&&m<=a&&a<=v)),style:J(J({},E),r),onMouseDown:function(C){C.stopPropagation()},onClick:function(){l(a)}},i)},R7=function(e){var n=e.prefixCls,r=e.marks,i=e.onClick,a="".concat(n,"-mark");return r.length?_.createElement("div",{className:a},r.map(function(l){var u=l.value,f=l.style,h=l.label;return _.createElement(A7,{key:u,prefixCls:a,style:f,value:u,onClick:i},h)})):null},x7=function(e){var n=e.prefixCls,r=e.value,i=e.style,a=e.activeStyle,l=_.useContext(Ko),u=l.min,f=l.max,h=l.direction,g=l.included,m=l.includedStart,v=l.includedEnd,S="".concat(n,"-dot"),w=g&&m<=r&&r<=v,E=J(J({},nb(h,r,u,f)),typeof i=="function"?i(r):i);return w&&(E=J(J({},E),typeof a=="function"?a(r):a)),_.createElement("span",{className:Ze(S,K({},"".concat(S,"-active"),w)),style:E})},M7=function(e){var n=e.prefixCls,r=e.marks,i=e.dots,a=e.style,l=e.activeStyle,u=_.useContext(Ko),f=u.min,h=u.max,g=u.step,m=_.useMemo(function(){var v=new Set;if(r.forEach(function(w){v.add(w.value)}),i&&g!==null)for(var S=f;S<=h;)v.add(S),S+=g;return Array.from(v)},[f,h,g,i,r]);return _.createElement("div",{className:"".concat(n,"-step")},m.map(function(v){return _.createElement(x7,{prefixCls:n,key:v,value:v,style:a,activeStyle:l})}))},gC=function(e){var n=e.prefixCls,r=e.style,i=e.start,a=e.end,l=e.index,u=e.onStartMove,f=e.replaceCls,h=_.useContext(Ko),g=h.direction,m=h.min,v=h.max,S=h.disabled,w=h.range,E=h.classNames,b="".concat(n,"-track"),C=R_(i,m,v),T=R_(a,m,v),A=function(F){!S&&u&&u(F,-1)},O={};switch(g){case"rtl":O.right="".concat(C*100,"%"),O.width="".concat(T*100-C*100,"%");break;case"btt":O.bottom="".concat(C*100,"%"),O.height="".concat(T*100-C*100,"%");break;case"ttb":O.top="".concat(C*100,"%"),O.height="".concat(T*100-C*100,"%");break;default:O.left="".concat(C*100,"%"),O.width="".concat(T*100-C*100,"%")}var x=f||Ze(b,K(K({},"".concat(b,"-").concat(l+1),l!==null&&w),"".concat(n,"-track-draggable"),u),E.track);return _.createElement("div",{className:x,style:J(J({},O),r),onMouseDown:A,onTouchStart:A})},O7=function(e){var n=e.prefixCls,r=e.style,i=e.values,a=e.startPoint,l=e.onStartMove,u=_.useContext(Ko),f=u.included,h=u.range,g=u.min,m=u.styles,v=u.classNames,S=_.useMemo(function(){if(!h){if(i.length===0)return[];var E=a??g,b=i[0];return[{start:Math.min(E,b),end:Math.max(E,b)}]}for(var C=[],T=0;TP7&&g3&&arguments[3]!==void 0?arguments[3]:"unit";if(typeof E=="number"){var T,A=w[b],O=A+E,x=[];r.forEach(function(V){x.push(V.value)}),x.push(t,e),x.push(u(A));var N=E>0?1:-1;C==="unit"?x.push(u(A+N*n)):x.push(u(O)),x=x.filter(function(V){return V!==null}).filter(function(V){return E<0?V<=A:V>=A}),C==="unit"&&(x=x.filter(function(V){return V!==A}));var F=C==="unit"?A:O;T=x[0];var L=Math.abs(T-F);if(x.forEach(function(V){var B=Math.abs(V-F);B1){var D=ze(w);return D[b]=T,S(D,E-N,b,C)}return T}else{if(E==="min")return t;if(E==="max")return e}},g=function(w,E,b){var C=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"unit",T=w[b],A=h(w,E,b,C);return{value:A,changed:A!==T}},m=function(w){return a===null&&w===0||typeof a=="number"&&w3&&arguments[3]!==void 0?arguments[3]:"unit",T=w.map(f),A=T[b],O=h(T,E,b,C);if(T[b]=O,i===!1){var x=a||0;b>0&&T[b-1]!==A&&(T[b]=Math.max(T[b],T[b-1]+x)),b0;D-=1)for(var V=!0;m(T[D]-T[D-1])&&V;){var B=g(T,-1,D-1);T[D-1]=B.value,V=B.changed}for(var W=T.length-1;W>0;W-=1)for(var X=!0;m(T[W]-T[W-1])&&X;){var Y=g(T,-1,W-1);T[W-1]=Y.value,X=Y.changed}for(var ae=0;ae=0?z:!1},[z,lt]),ct=_.useMemo(function(){return Object.keys(Ee||{}).map(function(De){var be=Ee[De],ut={value:Number(De)};return be&&pt(be)==="object"&&!_.isValidElement(be)&&("label"in be||"style"in be)?(ut.style=be.style,ut.label=be.label):ut.label=be,ut}).filter(function(De){var be=De.label;return be||typeof be=="number"}).sort(function(De,be){return De.value-be.value})},[Ee]),mt=I7(at,Je,lt,ct,ae,ft),xt=de(mt,2),Bt=xt[0],ht=xt[1],Vt=Tc(F,{value:N}),qt=de(Vt,2),wn=qt[0],Mn=qt[1],Ut=_.useMemo(function(){var De=wn==null?[]:Array.isArray(wn)?wn:[wn],be=de(De,1),ut=be[0],zt=ut===void 0?at:ut,Ot=wn===null?[]:[zt];if(Me){if(Ot=ze(De),D||wn===void 0){var In=D>=0?D+1:2;for(Ot=Ot.slice(0,In);Ot.length=0&&Be.current.focus(De)}_t(null)},[bt]);var Yt=_.useMemo(function(){return rt&<===null?!1:rt},[rt,lt]),vn=fr(function(De,be){Oe(De,be),B==null||B(It(Ut))}),On=Ne!==-1;_.useEffect(function(){if(!On){var De=Ut.lastIndexOf(Et);Be.current.focus(De)}},[On]);var _n=_.useMemo(function(){return ze(Ue).sort(function(De,be){return De-be})},[Ue]),Zn=_.useMemo(function(){return Me?[_n[0],_n[_n.length-1]]:[at,_n[0]]},[_n,Me,at]),un=de(Zn,2),rn=un[0],Ae=un[1];_.useImperativeHandle(e,function(){return{focus:function(){Be.current.focus(0)},blur:function(){var be,ut=document,zt=ut.activeElement;(be=nt.current)!==null&&be!==void 0&&be.contains(zt)&&(zt==null||zt.blur())}}}),_.useEffect(function(){S&&Be.current.focus(0)},[]);var Le=_.useMemo(function(){return{min:at,max:Je,direction:He,disabled:g,keyboard:v,step:lt,included:$,includedStart:rn,includedEnd:Ae,range:Me,tabIndex:Ie,ariaLabelForHandle:we,ariaLabelledByForHandle:xe,ariaRequired:Ve,ariaValueTextFormatterForHandle:Fe,styles:u||{},classNames:l||{}}},[at,Je,He,g,v,lt,$,rn,Ae,Me,Ie,we,xe,Ve,Fe,u,l]);return _.createElement(Ko.Provider,{value:Le},_.createElement("div",{ref:nt,className:Ze(r,i,K(K(K(K({},"".concat(r,"-disabled"),g),"".concat(r,"-vertical"),Z),"".concat(r,"-horizontal"),!Z),"".concat(r,"-with-marks"),ct.length)),style:a,onMouseDown:Ye,id:f},_.createElement("div",{className:Ze("".concat(r,"-rail"),l==null?void 0:l.rail),style:J(J({},ce),u==null?void 0:u.rail)}),ge!==!1&&_.createElement(O7,{prefixCls:r,style:se,values:Ut,startPoint:ie,onStartMove:Yt?vn:void 0}),_.createElement(M7,{prefixCls:r,marks:ct,dots:Ce,style:fe,activeStyle:ye}),_.createElement(C7,{ref:Be,prefixCls:r,style:q,values:Ue,draggingIndex:Ne,draggingDelete:en,onStartMove:vn,onOffsetChange:Zt,onFocus:w,onBlur:E,handleRender:Te,activeHandleRender:ve,onChangeComplete:Jt,onDelete:dt?Mt:void 0}),_.createElement(R7,{prefixCls:r,marks:ct,onClick:je})))});const k7=_.createContext({}),mC=_.forwardRef((t,e)=>{const{open:n,draggingDelete:r}=t,i=_.useRef(null),a=n&&!r,l=_.useRef(null);function u(){dr.cancel(l.current),l.current=null}function f(){l.current=dr(()=>{var h;(h=i.current)===null||h===void 0||h.forceAlign(),l.current=null})}return _.useEffect(()=>(a?f():u(),u),[a,t.title]),_.createElement(Px,Object.assign({ref:Kg(i,e)},t,{open:a}))}),B7=t=>{const{componentCls:e,antCls:n,controlSize:r,dotSize:i,marginFull:a,marginPart:l,colorFillContentHover:u,handleColorDisabled:f,calc:h,handleSize:g,handleSizeHover:m,handleActiveColor:v,handleActiveOutlineColor:S,handleLineWidth:w,handleLineWidthHover:E,motionDurationMid:b}=t;return{[e]:Object.assign(Object.assign({},Lc(t)),{position:"relative",height:r,margin:`${Rt(l)} ${Rt(a)}`,padding:0,cursor:"pointer",touchAction:"none","&-vertical":{margin:`${Rt(a)} ${Rt(l)}`},[`${e}-rail`]:{position:"absolute",backgroundColor:t.railBg,borderRadius:t.borderRadiusXS,transition:`background-color ${b}`},[`${e}-track,${e}-tracks`]:{position:"absolute",transition:`background-color ${b}`},[`${e}-track`]:{backgroundColor:t.trackBg,borderRadius:t.borderRadiusXS},[`${e}-track-draggable`]:{boxSizing:"content-box",backgroundClip:"content-box",border:"solid rgba(0,0,0,0)"},"&:hover":{[`${e}-rail`]:{backgroundColor:t.railHoverBg},[`${e}-track`]:{backgroundColor:t.trackHoverBg},[`${e}-dot`]:{borderColor:u},[`${e}-handle::after`]:{boxShadow:`0 0 0 ${Rt(w)} ${t.colorPrimaryBorderHover}`},[`${e}-dot-active`]:{borderColor:t.dotActiveBorderColor}},[`${e}-handle`]:{position:"absolute",width:g,height:g,outline:"none",userSelect:"none","&-dragging-delete":{opacity:0},"&::before":{content:'""',position:"absolute",insetInlineStart:h(w).mul(-1).equal(),insetBlockStart:h(w).mul(-1).equal(),width:h(g).add(h(w).mul(2)).equal(),height:h(g).add(h(w).mul(2)).equal(),backgroundColor:"transparent"},"&::after":{content:'""',position:"absolute",insetBlockStart:0,insetInlineStart:0,width:g,height:g,backgroundColor:t.colorBgElevated,boxShadow:`0 0 0 ${Rt(w)} ${t.handleColor}`,outline:"0px solid transparent",borderRadius:"50%",cursor:"pointer",transition:` - inset-inline-start ${b}, - inset-block-start ${b}, - width ${b}, - height ${b}, - box-shadow ${b}, - outline ${b} - `},"&:hover, &:active, &:focus":{"&::before":{insetInlineStart:h(m).sub(g).div(2).add(E).mul(-1).equal(),insetBlockStart:h(m).sub(g).div(2).add(E).mul(-1).equal(),width:h(m).add(h(E).mul(2)).equal(),height:h(m).add(h(E).mul(2)).equal()},"&::after":{boxShadow:`0 0 0 ${Rt(E)} ${v}`,outline:`6px solid ${S}`,width:m,height:m,insetInlineStart:t.calc(g).sub(m).div(2).equal(),insetBlockStart:t.calc(g).sub(m).div(2).equal()}}},[`&-lock ${e}-handle`]:{"&::before, &::after":{transition:"none"}},[`${e}-mark`]:{position:"absolute",fontSize:t.fontSize},[`${e}-mark-text`]:{position:"absolute",display:"inline-block",color:t.colorTextDescription,textAlign:"center",wordBreak:"keep-all",cursor:"pointer",userSelect:"none","&-active":{color:t.colorText}},[`${e}-step`]:{position:"absolute",background:"transparent",pointerEvents:"none"},[`${e}-dot`]:{position:"absolute",width:i,height:i,backgroundColor:t.colorBgElevated,border:`${Rt(w)} solid ${t.dotBorderColor}`,borderRadius:"50%",cursor:"pointer",transition:`border-color ${t.motionDurationSlow}`,pointerEvents:"auto","&-active":{borderColor:t.dotActiveBorderColor}},[`&${e}-disabled`]:{cursor:"not-allowed",[`${e}-rail`]:{backgroundColor:`${t.railBg} !important`},[`${e}-track`]:{backgroundColor:`${t.trackBgDisabled} !important`},[` - ${e}-dot - `]:{backgroundColor:t.colorBgElevated,borderColor:t.trackBgDisabled,boxShadow:"none",cursor:"not-allowed"},[`${e}-handle::after`]:{backgroundColor:t.colorBgElevated,cursor:"not-allowed",width:g,height:g,boxShadow:`0 0 0 ${Rt(w)} ${f}`,insetInlineStart:0,insetBlockStart:0},[` - ${e}-mark-text, - ${e}-dot - `]:{cursor:"not-allowed !important"}},[`&-tooltip ${n}-tooltip-inner`]:{minWidth:"unset"}})}},Nx=(t,e)=>{const{componentCls:n,railSize:r,handleSize:i,dotSize:a,marginFull:l,calc:u}=t,f=e?"paddingBlock":"paddingInline",h=e?"width":"height",g=e?"height":"width",m=e?"insetBlockStart":"insetInlineStart",v=e?"top":"insetInlineStart",S=u(r).mul(3).sub(i).div(2).equal(),w=u(i).sub(r).div(2).equal(),E=e?{borderWidth:`${Rt(w)} 0`,transform:`translateY(${Rt(u(w).mul(-1).equal())})`}:{borderWidth:`0 ${Rt(w)}`,transform:`translateX(${Rt(t.calc(w).mul(-1).equal())})`};return{[f]:r,[g]:u(r).mul(3).equal(),[`${n}-rail`]:{[h]:"100%",[g]:r},[`${n}-track,${n}-tracks`]:{[g]:r},[`${n}-track-draggable`]:Object.assign({},E),[`${n}-handle`]:{[m]:S},[`${n}-mark`]:{insetInlineStart:0,top:0,[v]:u(r).mul(3).add(e?0:l).equal(),[h]:"100%"},[`${n}-step`]:{insetInlineStart:0,top:0,[v]:r,[h]:"100%",[g]:r},[`${n}-dot`]:{position:"absolute",[m]:u(r).sub(a).div(2).equal()}}},U7=t=>{const{componentCls:e,marginPartWithMark:n}=t;return{[`${e}-horizontal`]:Object.assign(Object.assign({},Nx(t,!0)),{[`&${e}-with-marks`]:{marginBottom:n}})}},L7=t=>{const{componentCls:e}=t;return{[`${e}-vertical`]:Object.assign(Object.assign({},Nx(t,!1)),{height:"100%"})}},z7=t=>{const n=t.controlHeightLG/4,r=t.controlHeightSM/2,i=t.lineWidth+1,a=t.lineWidth+1*1.5,l=t.colorPrimary,u=new En(l).setA(.2).toRgbString();return{controlSize:n,railSize:4,handleSize:n,handleSizeHover:r,dotSize:8,handleLineWidth:i,handleLineWidthHover:a,railBg:t.colorFillTertiary,railHoverBg:t.colorFillSecondary,trackBg:t.colorPrimaryBorder,trackHoverBg:t.colorPrimaryBorderHover,handleColor:t.colorPrimaryBorder,handleActiveColor:l,handleActiveOutlineColor:u,handleColorDisabled:new En(t.colorTextDisabled).onBackground(t.colorBgContainer).toHexString(),dotBorderColor:t.colorBorderSecondary,dotActiveBorderColor:t.colorPrimaryBorder,trackBgDisabled:t.colorBgContainerDisabled}},$7=zc("Slider",t=>{const e=ui(t,{marginPart:t.calc(t.controlHeight).sub(t.controlSize).div(2).equal(),marginFull:t.calc(t.controlSize).div(2).equal(),marginPartWithMark:t.calc(t.controlHeightLG).sub(t.controlSize).equal()});return[B7(e),U7(e),L7(e)]},z7);function Uv(){const[t,e]=_.useState(!1),n=_.useRef(null),r=()=>{dr.cancel(n.current)},i=a=>{r(),a?e(a):n.current=dr(()=>{e(a)})};return _.useEffect(()=>r,[]),[t,i]}var V7=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);itypeof n=="number"?n.toString():""}const j7=Ft.forwardRef((t,e)=>{const{prefixCls:n,range:r,className:i,rootClassName:a,style:l,disabled:u,tooltipPrefixCls:f,tipFormatter:h,tooltipVisible:g,getTooltipPopupContainer:m,tooltipPlacement:v,tooltip:S={},onChangeComplete:w,classNames:E,styles:b}=t,C=V7(t,["prefixCls","range","className","rootClassName","style","disabled","tooltipPrefixCls","tipFormatter","tooltipVisible","getTooltipPopupContainer","tooltipPlacement","tooltip","onChangeComplete","classNames","styles"]),{vertical:T}=t,{getPrefixCls:A,direction:O,className:x,style:N,classNames:F,styles:L,getPopupContainer:D}=Uc("slider"),V=Ft.useContext(wf),B=u??V,{handleRender:W,direction:X}=Ft.useContext(k7),ae=(X||O)==="rtl",[U,z]=Uv(),[j,Z]=Uv(),P=Object.assign({},S),{open:$,placement:ie,getPopupContainer:se,prefixCls:q,formatter:ce}=P,fe=$??g,ye=(U||j)&&fe!==!1,Ee=H7(ce,h),[Ce,Te]=Uv(),ve=Me=>{w==null||w(Me),Te(!1)},ge=(Me,dt)=>Me||(dt?ae?"left":"right":"top"),_e=A("slider",n),[Ie,we,xe]=$7(_e),Ve=Ze(i,x,F.root,E==null?void 0:E.root,a,{[`${_e}-rtl`]:ae,[`${_e}-lock`]:Ce},we,xe);ae&&!C.vertical&&(C.reverse=!C.reverse),Ft.useEffect(()=>{const Me=()=>{dr(()=>{Z(!1)},1)};return document.addEventListener("mouseup",Me),()=>{document.removeEventListener("mouseup",Me)}},[]);const Fe=r&&!fe,Be=W||((Me,dt)=>{const{index:rt}=dt,it=Me.props;function st(ft,ct,mt){var xt,Bt,ht,Vt;mt&&((Bt=(xt=C)[ft])===null||Bt===void 0||Bt.call(xt,ct)),(Vt=(ht=it)[ft])===null||Vt===void 0||Vt.call(ht,ct)}const at=Object.assign(Object.assign({},it),{onMouseEnter:ft=>{z(!0),st("onMouseEnter",ft)},onMouseLeave:ft=>{z(!1),st("onMouseLeave",ft)},onMouseDown:ft=>{Z(!0),Te(!0),st("onMouseDown",ft)},onFocus:ft=>{var ct;Z(!0),(ct=C.onFocus)===null||ct===void 0||ct.call(C,ft),st("onFocus",ft,!0)},onBlur:ft=>{var ct;Z(!1),(ct=C.onBlur)===null||ct===void 0||ct.call(C,ft),st("onBlur",ft,!0)}}),Je=Ft.cloneElement(Me,at),lt=(!!fe||ye)&&Ee!==null;return Fe?Je:Ft.createElement(mC,Object.assign({},P,{prefixCls:A("tooltip",q??f),title:Ee?Ee(dt.value):"",open:lt,placement:ge(ie??v,T),key:rt,classNames:{root:`${_e}-tooltip`},getPopupContainer:se||m||D}),Je)}),nt=Fe?(Me,dt)=>{const rt=Ft.cloneElement(Me,{style:Object.assign(Object.assign({},Me.props.style),{visibility:"hidden"})});return Ft.createElement(mC,Object.assign({},P,{prefixCls:A("tooltip",q??f),title:Ee?Ee(dt.value):"",open:Ee!==null&&ye,placement:ge(ie??v,T),key:"tooltip",classNames:{root:`${_e}-tooltip`},getPopupContainer:se||m||D,draggingDelete:dt.draggingDelete}),rt)}:void 0,He=Object.assign(Object.assign(Object.assign(Object.assign({},L.root),N),b==null?void 0:b.root),l),Ge=Object.assign(Object.assign({},L.tracks),b==null?void 0:b.tracks),Pe=Ze(F.tracks,E==null?void 0:E.tracks);return Ie(Ft.createElement(F7,Object.assign({},C,{classNames:Object.assign({handle:Ze(F.handle,E==null?void 0:E.handle),rail:Ze(F.rail,E==null?void 0:E.rail),track:Ze(F.track,E==null?void 0:E.track)},Pe?{tracks:Pe}:{}),styles:Object.assign({handle:Object.assign(Object.assign({},L.handle),b==null?void 0:b.handle),rail:Object.assign(Object.assign({},L.rail),b==null?void 0:b.rail),track:Object.assign(Object.assign({},L.track),b==null?void 0:b.track)},Object.keys(Ge).length?{tracks:Ge}:{}),step:C.step,range:r,className:Ve,style:He,disabled:B,ref:e,prefixCls:_e,handleRender:Be,activeHandleRender:nt,onChangeComplete:ve})))});function vC(t){return["small","middle","large"].includes(t)}function _C(t){return t?typeof t=="number"&&!Number.isNaN(t):!1}const Ix=Ft.createContext({latestIndex:0}),W7=Ix.Provider,X7=t=>{let{className:e,index:n,children:r,split:i,style:a}=t;const{latestIndex:l}=_.useContext(Ix);return r==null?null:_.createElement(_.Fragment,null,_.createElement("div",{className:e,style:a},r),n{var n;const{getPrefixCls:r,direction:i,size:a,className:l,style:u,classNames:f,styles:h}=Uc("space"),{size:g=a??"small",align:m,className:v,rootClassName:S,children:w,direction:E="horizontal",prefixCls:b,split:C,style:T,wrap:A=!1,classNames:O,styles:x}=t,N=q7(t,["size","align","className","rootClassName","children","direction","prefixCls","split","style","wrap","classNames","styles"]),[F,L]=Array.isArray(g)?g:[g,g],D=vC(L),V=vC(F),B=_C(L),W=_C(F),X=Lo(w,{keepEmpty:!0}),Y=m===void 0&&E==="horizontal"?"center":m,ae=r("space",b),[U,z,j]=j3(ae),Z=Ze(ae,l,z,`${ae}-${E}`,{[`${ae}-rtl`]:i==="rtl",[`${ae}-align-${Y}`]:Y,[`${ae}-gap-row-${L}`]:D,[`${ae}-gap-col-${F}`]:V},v,S,j),P=Ze(`${ae}-item`,(n=O==null?void 0:O.item)!==null&&n!==void 0?n:f.item);let $=0;const ie=X.map((ce,fe)=>{var ye;ce!=null&&($=fe);const Ee=(ce==null?void 0:ce.key)||`${P}-${fe}`;return _.createElement(X7,{className:P,key:Ee,index:fe,split:C,style:(ye=x==null?void 0:x.item)!==null&&ye!==void 0?ye:h.item},ce)}),se=_.useMemo(()=>({latestIndex:$}),[$]);if(X.length===0)return null;const q={};return A&&(q.flexWrap="wrap"),!V&&W&&(q.columnGap=F),!D&&B&&(q.rowGap=L),U(_.createElement("div",Object.assign({ref:e,className:Z,style:Object.assign(Object.assign(Object.assign({},q),u),T)},N),_.createElement(W7,{value:se},ie)))}),Dx=Y7;Dx.Compact=Qk;const tg=100,Fx=tg/5,kx=tg/2-Fx/2,Lv=kx*2*Math.PI,yC=50,bC=t=>{const{dotClassName:e,style:n,hasCircleCls:r}=t;return _.createElement("circle",{className:Ze(`${e}-circle`,{[`${e}-circle-bg`]:r}),r:kx,cx:yC,cy:yC,strokeWidth:Fx,style:n})},K7=t=>{let{percent:e,prefixCls:n}=t;const r=`${n}-dot`,i=`${r}-holder`,a=`${i}-hidden`,[l,u]=_.useState(!1);Dn(()=>{e!==0&&u(!0)},[e!==0]);const f=Math.max(Math.min(e,100),0);if(!l)return null;const h={strokeDashoffset:`${Lv/4}`,strokeDasharray:`${Lv*f/100} ${Lv*(100-f)/100}`};return _.createElement("span",{className:Ze(i,`${r}-progress`,f<=0&&a)},_.createElement("svg",{viewBox:`0 0 ${tg} ${tg}`,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":f},_.createElement(bC,{dotClassName:r,hasCircleCls:!0}),_.createElement(bC,{dotClassName:r,style:h})))};function Z7(t){const{prefixCls:e,percent:n=0}=t,r=`${e}-dot`,i=`${r}-holder`,a=`${i}-hidden`;return _.createElement(_.Fragment,null,_.createElement("span",{className:Ze(i,n>0&&a)},_.createElement("span",{className:Ze(r,`${e}-dot-spin`)},[1,2,3,4].map(l=>_.createElement("i",{className:`${e}-dot-item`,key:l})))),_.createElement(K7,{prefixCls:e,percent:n}))}function Q7(t){const{prefixCls:e,indicator:n,percent:r}=t,i=`${e}-dot`;return n&&_.isValidElement(n)?B3(n,{className:Ze(n.props.className,i),percent:r}):_.createElement(Z7,{prefixCls:e,percent:r})}const G7=new ln("antSpinMove",{to:{opacity:1}}),J7=new ln("antRotate",{to:{transform:"rotate(405deg)"}}),e9=t=>{const{componentCls:e,calc:n}=t;return{[e]:Object.assign(Object.assign({},Lc(t)),{position:"absolute",display:"none",color:t.colorPrimary,fontSize:0,textAlign:"center",verticalAlign:"middle",opacity:0,transition:`transform ${t.motionDurationSlow} ${t.motionEaseInOutCirc}`,"&-spinning":{position:"relative",display:"inline-block",opacity:1},[`${e}-text`]:{fontSize:t.fontSize,paddingTop:n(n(t.dotSize).sub(t.fontSize)).div(2).add(2).equal()},"&-fullscreen":{position:"fixed",width:"100vw",height:"100vh",backgroundColor:t.colorBgMask,zIndex:t.zIndexPopupBase,inset:0,display:"flex",alignItems:"center",flexDirection:"column",justifyContent:"center",opacity:0,visibility:"hidden",transition:`all ${t.motionDurationMid}`,"&-show":{opacity:1,visibility:"visible"},[e]:{[`${e}-dot-holder`]:{color:t.colorWhite},[`${e}-text`]:{color:t.colorTextLightSolid}}},"&-nested-loading":{position:"relative",[`> div > ${e}`]:{position:"absolute",top:0,insetInlineStart:0,zIndex:4,display:"block",width:"100%",height:"100%",maxHeight:t.contentHeight,[`${e}-dot`]:{position:"absolute",top:"50%",insetInlineStart:"50%",margin:n(t.dotSize).mul(-1).div(2).equal()},[`${e}-text`]:{position:"absolute",top:"50%",width:"100%",textShadow:`0 1px 2px ${t.colorBgContainer}`},[`&${e}-show-text ${e}-dot`]:{marginTop:n(t.dotSize).div(2).mul(-1).sub(10).equal()},"&-sm":{[`${e}-dot`]:{margin:n(t.dotSizeSM).mul(-1).div(2).equal()},[`${e}-text`]:{paddingTop:n(n(t.dotSizeSM).sub(t.fontSize)).div(2).add(2).equal()},[`&${e}-show-text ${e}-dot`]:{marginTop:n(t.dotSizeSM).div(2).mul(-1).sub(10).equal()}},"&-lg":{[`${e}-dot`]:{margin:n(t.dotSizeLG).mul(-1).div(2).equal()},[`${e}-text`]:{paddingTop:n(n(t.dotSizeLG).sub(t.fontSize)).div(2).add(2).equal()},[`&${e}-show-text ${e}-dot`]:{marginTop:n(t.dotSizeLG).div(2).mul(-1).sub(10).equal()}}},[`${e}-container`]:{position:"relative",transition:`opacity ${t.motionDurationSlow}`,"&::after":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,zIndex:10,width:"100%",height:"100%",background:t.colorBgContainer,opacity:0,transition:`all ${t.motionDurationSlow}`,content:'""',pointerEvents:"none"}},[`${e}-blur`]:{clear:"both",opacity:.5,userSelect:"none",pointerEvents:"none","&::after":{opacity:.4,pointerEvents:"auto"}}},"&-tip":{color:t.spinDotDefault},[`${e}-dot-holder`]:{width:"1em",height:"1em",fontSize:t.dotSize,display:"inline-block",transition:`transform ${t.motionDurationSlow} ease, opacity ${t.motionDurationSlow} ease`,transformOrigin:"50% 50%",lineHeight:1,color:t.colorPrimary,"&-hidden":{transform:"scale(0.3)",opacity:0}},[`${e}-dot-progress`]:{position:"absolute",inset:0},[`${e}-dot`]:{position:"relative",display:"inline-block",fontSize:t.dotSize,width:"1em",height:"1em","&-item":{position:"absolute",display:"block",width:n(t.dotSize).sub(n(t.marginXXS).div(2)).div(2).equal(),height:n(t.dotSize).sub(n(t.marginXXS).div(2)).div(2).equal(),background:"currentColor",borderRadius:"100%",transform:"scale(0.75)",transformOrigin:"50% 50%",opacity:.3,animationName:G7,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"alternate","&:nth-child(1)":{top:0,insetInlineStart:0,animationDelay:"0s"},"&:nth-child(2)":{top:0,insetInlineEnd:0,animationDelay:"0.4s"},"&:nth-child(3)":{insetInlineEnd:0,bottom:0,animationDelay:"0.8s"},"&:nth-child(4)":{bottom:0,insetInlineStart:0,animationDelay:"1.2s"}},"&-spin":{transform:"rotate(45deg)",animationName:J7,animationDuration:"1.2s",animationIterationCount:"infinite",animationTimingFunction:"linear"},"&-circle":{strokeLinecap:"round",transition:["stroke-dashoffset","stroke-dasharray","stroke","stroke-width","opacity"].map(r=>`${r} ${t.motionDurationSlow} ease`).join(","),fillOpacity:0,stroke:"currentcolor"},"&-circle-bg":{stroke:t.colorFillSecondary}},[`&-sm ${e}-dot`]:{"&, &-holder":{fontSize:t.dotSizeSM}},[`&-sm ${e}-dot-holder`]:{i:{width:n(n(t.dotSizeSM).sub(n(t.marginXXS).div(2))).div(2).equal(),height:n(n(t.dotSizeSM).sub(n(t.marginXXS).div(2))).div(2).equal()}},[`&-lg ${e}-dot`]:{"&, &-holder":{fontSize:t.dotSizeLG}},[`&-lg ${e}-dot-holder`]:{i:{width:n(n(t.dotSizeLG).sub(t.marginXXS)).div(2).equal(),height:n(n(t.dotSizeLG).sub(t.marginXXS)).div(2).equal()}},[`&${e}-show-text ${e}-text`]:{display:"block"}})}},t9=t=>{const{controlHeightLG:e,controlHeight:n}=t;return{contentHeight:400,dotSize:e/2,dotSizeSM:e*.35,dotSizeLG:n}},n9=zc("Spin",t=>{const e=ui(t,{spinDotDefault:t.colorTextDescription});return[e9(e)]},t9),r9=200,SC=[[30,.05],[70,.03],[96,.01]];function i9(t,e){const[n,r]=_.useState(0),i=_.useRef(null),a=e==="auto";return _.useEffect(()=>(a&&t&&(r(0),i.current=setInterval(()=>{r(l=>{const u=100-l;for(let f=0;f{clearInterval(i.current)}),[a,t]),a?n:e}var s9=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{var e;const{prefixCls:n,spinning:r=!0,delay:i=0,className:a,rootClassName:l,size:u="default",tip:f,wrapperClassName:h,style:g,children:m,fullscreen:v=!1,indicator:S,percent:w}=t,E=s9(t,["prefixCls","spinning","delay","className","rootClassName","size","tip","wrapperClassName","style","children","fullscreen","indicator","percent"]),{getPrefixCls:b,direction:C,className:T,style:A,indicator:O}=Uc("spin"),x=b("spin",n),[N,F,L]=n9(x),[D,V]=_.useState(()=>r&&!a9(r,i)),B=i9(D,w);_.useEffect(()=>{if(r){const j=S7(i,()=>{V(!0)});return j(),()=>{var Z;(Z=j==null?void 0:j.cancel)===null||Z===void 0||Z.call(j)}}V(!1)},[i,r]);const W=_.useMemo(()=>typeof m<"u"&&!v,[m,v]),X=Ze(x,T,{[`${x}-sm`]:u==="small",[`${x}-lg`]:u==="large",[`${x}-spinning`]:D,[`${x}-show-text`]:!!f,[`${x}-rtl`]:C==="rtl"},a,!v&&l,F,L),Y=Ze(`${x}-container`,{[`${x}-blur`]:D}),ae=(e=S??O)!==null&&e!==void 0?e:Bx,U=Object.assign(Object.assign({},A),g),z=_.createElement("div",Object.assign({},E,{style:U,className:X,"aria-live":"polite","aria-busy":D}),_.createElement(Q7,{prefixCls:x,indicator:ae,percent:B}),f&&(W||v)?_.createElement("div",{className:`${x}-text`},f):null);return N(W?_.createElement("div",Object.assign({},E,{className:Ze(`${x}-nested-loading`,h,F,L)}),D&&_.createElement("div",{key:"loading"},z),_.createElement("div",{className:Y,key:"container"},m)):v?_.createElement("div",{className:Ze(`${x}-fullscreen`,{[`${x}-fullscreen-show`]:D},l,F,L)},z):z)};Ux.setDefaultIndicator=t=>{Bx=t};function Dh(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function o9(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function Lx(t){let e,n,r;t.length!==2?(e=Dh,n=(u,f)=>Dh(t(u),f),r=(u,f)=>t(u)-f):(e=t===Dh||t===o9?t:l9,n=t,r=t);function i(u,f,h=0,g=u.length){if(h>>1;n(u[m],f)<0?h=m+1:g=m}while(h>>1;n(u[m],f)<=0?h=m+1:g=m}while(hh&&r(u[m-1],f)>-r(u[m],f)?m-1:m}return{left:i,center:l,right:a}}function l9(){return 0}function c9(t){return t===null?NaN:+t}const u9=Lx(Dh),f9=u9.right;Lx(c9).center;const d9=Math.sqrt(50),h9=Math.sqrt(10),g9=Math.sqrt(2);function ng(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),l=a>=d9?10:a>=h9?5:a>=g9?2:1;let u,f,h;return i<0?(h=Math.pow(10,-i)/l,u=Math.round(t*h),f=Math.round(e*h),u/he&&--f,h=-h):(h=Math.pow(10,i)*l,u=Math.round(t/h),f=Math.round(e/h),u*he&&--f),f0))return[];if(t===e)return[t];const r=e=i))return[];const u=a-i+1,f=new Array(u);if(r)if(l<0)for(let h=0;h>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?fh(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?fh(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=y9.exec(t))?new Kr(e[1],e[2],e[3],1):(e=b9.exec(t))?new Kr(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=S9.exec(t))?fh(e[1],e[2],e[3],e[4]):(e=E9.exec(t))?fh(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=w9.exec(t))?xC(e[1],e[2]/100,e[3]/100,1):(e=T9.exec(t))?xC(e[1],e[2]/100,e[3]/100,e[4]):EC.hasOwnProperty(t)?CC(EC[t]):t==="transparent"?new Kr(NaN,NaN,NaN,0):null}function CC(t){return new Kr(t>>16&255,t>>8&255,t&255,1)}function fh(t,e,n,r){return r<=0&&(t=e=n=NaN),new Kr(t,e,n,r)}function R9(t){return t instanceof qf||(t=xf(t)),t?(t=t.rgb(),new Kr(t.r,t.g,t.b,t.opacity)):new Kr}function M_(t,e,n,r){return arguments.length===1?R9(t):new Kr(t,e,n,r??1)}function Kr(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}rb(Kr,M_,zx(qf,{brighter(t){return t=t==null?rg:Math.pow(rg,t),new Kr(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Af:Math.pow(Af,t),new Kr(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Kr(Io(this.r),Io(this.g),Io(this.b),ig(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:AC,formatHex:AC,formatHex8:x9,formatRgb:RC,toString:RC}));function AC(){return`#${So(this.r)}${So(this.g)}${So(this.b)}`}function x9(){return`#${So(this.r)}${So(this.g)}${So(this.b)}${So((isNaN(this.opacity)?1:this.opacity)*255)}`}function RC(){const t=ig(this.opacity);return`${t===1?"rgb(":"rgba("}${Io(this.r)}, ${Io(this.g)}, ${Io(this.b)}${t===1?")":`, ${t})`}`}function ig(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Io(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function So(t){return t=Io(t),(t<16?"0":"")+t.toString(16)}function xC(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Ki(t,e,n,r)}function $x(t){if(t instanceof Ki)return new Ki(t.h,t.s,t.l,t.opacity);if(t instanceof qf||(t=xf(t)),!t)return new Ki;if(t instanceof Ki)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),l=NaN,u=a-i,f=(a+i)/2;return u?(e===a?l=(n-r)/u+(n0&&f<1?0:l,new Ki(l,u,f,t.opacity)}function M9(t,e,n,r){return arguments.length===1?$x(t):new Ki(t,e,n,r??1)}function Ki(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}rb(Ki,M9,zx(qf,{brighter(t){return t=t==null?rg:Math.pow(rg,t),new Ki(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Af:Math.pow(Af,t),new Ki(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Kr(zv(t>=240?t-240:t+120,i,r),zv(t,i,r),zv(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new Ki(MC(this.h),dh(this.s),dh(this.l),ig(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=ig(this.opacity);return`${t===1?"hsl(":"hsla("}${MC(this.h)}, ${dh(this.s)*100}%, ${dh(this.l)*100}%${t===1?")":`, ${t})`}`}}));function MC(t){return t=(t||0)%360,t<0?t+360:t}function dh(t){return Math.max(0,Math.min(1,t||0))}function zv(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const ib=t=>()=>t;function O9(t,e){return function(n){return t+n*e}}function P9(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function N9(t){return(t=+t)==1?Vx:function(e,n){return n-e?P9(e,n,t):ib(isNaN(e)?n:e)}}function Vx(t,e){var n=e-t;return n?O9(t,n):ib(isNaN(t)?e:t)}const OC=function t(e){var n=N9(e);function r(i,a){var l=n((i=M_(i)).r,(a=M_(a)).r),u=n(i.g,a.g),f=n(i.b,a.b),h=Vx(i.opacity,a.opacity);return function(g){return i.r=l(g),i.g=u(g),i.b=f(g),i.opacity=h(g),i+""}}return r.gamma=t,r}(1);function I9(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),i;return function(a){for(i=0;in&&(a=e.slice(n,a),u[l]?u[l]+=a:u[++l]=a),(r=r[0])===(i=i[0])?u[l]?u[l]+=i:u[++l]=i:(u[++l]=null,f.push({i:l,x:sg(r,i)})),n=$v.lastIndex;return ne&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function W9(t,e,n){var r=t[0],i=t[1],a=e[0],l=e[1];return i2?X9:W9,f=h=null,m}function m(v){return v==null||isNaN(v=+v)?a:(f||(f=u(t.map(r),e,n)))(r(l(v)))}return m.invert=function(v){return l(i((h||(h=u(e,t.map(r),sg)))(v)))},m.domain=function(v){return arguments.length?(t=Array.from(v,H9),g()):t.slice()},m.range=function(v){return arguments.length?(e=Array.from(v),g()):e.slice()},m.rangeRound=function(v){return e=Array.from(v),n=$9,g()},m.clamp=function(v){return arguments.length?(l=v?!0:Xl,g()):l!==Xl},m.interpolate=function(v){return arguments.length?(n=v,g()):n},m.unknown=function(v){return arguments.length?(a=v,m):a},function(v,S){return r=v,i=S,g()}}function K9(){return Y9()(Xl,Xl)}function Z9(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function ag(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function Ac(t){return t=ag(Math.abs(t)),t?t[1]:NaN}function Q9(t,e){return function(n,r){for(var i=n.length,a=[],l=0,u=t[0],f=0;i>0&&u>0&&(f+u+1>r&&(u=Math.max(1,r-f)),a.push(n.substring(i-=u,i+u)),!((f+=u+1)>r));)u=t[l=(l+1)%t.length];return a.reverse().join(e)}}function G9(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var J9=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function og(t){if(!(e=J9.exec(t)))throw new Error("invalid format: "+t);var e;return new ab({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}og.prototype=ab.prototype;function ab(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}ab.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function ez(t){e:for(var e=t.length,n=1,r=-1,i;n0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(i+1):t}var Hx;function tz(t,e){var n=ag(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(Hx=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,l=r.length;return a===l?r:a>l?r+new Array(a-l+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+ag(t,Math.max(0,e+a-1))[0]}function NC(t,e){var n=ag(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const IC={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:Z9,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>NC(t*100,e),r:NC,s:tz,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function DC(t){return t}var FC=Array.prototype.map,kC=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function nz(t){var e=t.grouping===void 0||t.thousands===void 0?DC:Q9(FC.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",a=t.numerals===void 0?DC:G9(FC.call(t.numerals,String)),l=t.percent===void 0?"%":t.percent+"",u=t.minus===void 0?"−":t.minus+"",f=t.nan===void 0?"NaN":t.nan+"";function h(m){m=og(m);var v=m.fill,S=m.align,w=m.sign,E=m.symbol,b=m.zero,C=m.width,T=m.comma,A=m.precision,O=m.trim,x=m.type;x==="n"?(T=!0,x="g"):IC[x]||(A===void 0&&(A=12),O=!0,x="g"),(b||v==="0"&&S==="=")&&(b=!0,v="0",S="=");var N=E==="$"?n:E==="#"&&/[boxX]/.test(x)?"0"+x.toLowerCase():"",F=E==="$"?r:/[%p]/.test(x)?l:"",L=IC[x],D=/[defgprs%]/.test(x);A=A===void 0?6:/[gprs]/.test(x)?Math.max(1,Math.min(21,A)):Math.max(0,Math.min(20,A));function V(B){var W=N,X=F,Y,ae,U;if(x==="c")X=L(B)+X,B="";else{B=+B;var z=B<0||1/B<0;if(B=isNaN(B)?f:L(Math.abs(B),A),O&&(B=ez(B)),z&&+B==0&&w!=="+"&&(z=!1),W=(z?w==="("?w:u:w==="-"||w==="("?"":w)+W,X=(x==="s"?kC[8+Hx/3]:"")+X+(z&&w==="("?")":""),D){for(Y=-1,ae=B.length;++YU||U>57){X=(U===46?i+B.slice(Y+1):B.slice(Y))+X,B=B.slice(0,Y);break}}}T&&!b&&(B=e(B,1/0));var j=W.length+B.length+X.length,Z=j>1)+W+B+X+Z.slice(j);break;default:B=Z+W+B+X;break}return a(B)}return V.toString=function(){return m+""},V}function g(m,v){var S=h((m=og(m),m.type="f",m)),w=Math.max(-8,Math.min(8,Math.floor(Ac(v)/3)))*3,E=Math.pow(10,-w),b=kC[8+w/3];return function(C){return S(E*C)+b}}return{format:h,formatPrefix:g}}var hh,jx,Wx;rz({thousands:",",grouping:[3],currency:["$",""]});function rz(t){return hh=nz(t),jx=hh.format,Wx=hh.formatPrefix,hh}function iz(t){return Math.max(0,-Ac(Math.abs(t)))}function sz(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Ac(e)/3)))*3-Ac(Math.abs(t)))}function az(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Ac(e)-Ac(t))+1}function oz(t,e,n,r){var i=m9(t,e,n),a;switch(r=og(r??",f"),r.type){case"s":{var l=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(a=sz(i,l))&&(r.precision=a),Wx(r,l)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=az(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=iz(i))&&(r.precision=a-(r.type==="%")*2);break}}return jx(r)}function lz(t){var e=t.domain;return t.ticks=function(n){var r=e();return p9(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return oz(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,a=r.length-1,l=r[i],u=r[a],f,h,g=10;for(u0;){if(h=x_(l,u,n),h===f)return r[i]=l,r[a]=u,e(r);if(h>0)l=Math.floor(l/h)*h,u=Math.ceil(u/h)*h;else if(h<0)l=Math.ceil(l*h)/h,u=Math.floor(u*h)/h;else break;f=h}return t},t}function ob(){var t=K9();return t.copy=function(){return q9(t,ob())},v9.apply(t,arguments),lz(t)}function ip(t){for(var e=t.length/6|0,n=new Array(e),r=0;r{try{n.onload=()=>r(n),n.onerror=a=>{const l=a instanceof Error?a.message:"error";i(new Error(l))}}catch(a){i(a)}})}const Sz={};let UC=!0;async function Ez(t,e,n){let r;lb(n)?r=await qx(t,e,n):r=Xx(t,n);const i=e&&e.imagebitmap;return await wz(r,i)}async function wz(t,e=null){if((Tz(e)||!UC)&&(e=null),e)try{return await createImageBitmap(t,e)}catch(n){console.warn(n),UC=!1}return await createImageBitmap(t)}function Tz(t){for(const e in t||Sz)return!1;return!0}function Cz(t){return!Mz(t,"ftyp",4)||!(t[8]&96)?null:Az(t)}function Az(t){switch(Rz(t,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function Rz(t,e,n){return String.fromCharCode(...t.slice(e,n))}function xz(t){return[...t].map(e=>e.charCodeAt(0))}function Mz(t,e,n=0){const r=xz(e);for(let i=0;i=24&&e.getUint32(0,ms)===2303741511?{mimeType:"image/png",width:e.getUint32(16,ms),height:e.getUint32(20,ms)}:null}function Nz(t){const e=Yf(t);return e.byteLength>=10&&e.getUint32(0,ms)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,rf),height:e.getUint16(8,rf)}:null}function Iz(t){const e=Yf(t);return e.byteLength>=14&&e.getUint16(0,ms)===16973&&e.getUint32(2,rf)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,rf),height:e.getUint32(22,rf)}:null}function Dz(t){const e=Yf(t);if(!(e.byteLength>=3&&e.getUint16(0,ms)===65496&&e.getUint8(2)===255))return null;const{tableMarkers:r,sofMarkers:i}=Fz();let a=2;for(;a+9!!Yx(new DataView(t))],options:$z},Sn=new Lf({id:"deck"});let F_={};function Hz(t){F_=t}function Hr(t,e,n,r){Sn.level>0&&F_[t]&&F_[t].call(null,e,n,r)}function jz(t){const e=t[0],n=t[t.length-1];return e==="{"&&n==="}"||e==="["&&n==="]"}const Wz={dataType:null,batchType:null,id:"JSON",name:"JSON",module:"",version:"",options:{},extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:jz,parseTextSync:JSON.parse};function Xz(){const t="9.1.1",e=globalThis.deck&&globalThis.deck.VERSION;if(e&&e!==t)throw new Error(`deck.gl - multiple versions detected: ${e} vs ${t}`);return e||(Sn.log(1,`deck.gl ${t}`)(),globalThis.deck={...globalThis.deck,VERSION:t,version:t,log:Sn,_registerLoggers:Hz},K6([Wz,[Vz,{imagebitmap:{premultiplyAlpha:"none"}}]])),t}const qz=Xz();function cb(t,e){if(!t)throw new Error(e||"shadertools: assertion failed.")}const Vv={number:{type:"number",validate(t,e){return Number.isFinite(t)&&typeof e=="object"&&(e.max===void 0||t<=e.max)&&(e.min===void 0||t>=e.min)}},array:{type:"array",validate(t,e){return Array.isArray(t)||ArrayBuffer.isView(t)}}};function Yz(t){const e={};for(const[n,r]of Object.entries(t))e[n]=Kz(r);return e}function Kz(t){let e=LC(t);if(e!=="object")return{value:t,...Vv[e],type:e};if(typeof t=="object")return t?t.type!==void 0?{...t,...Vv[t.type],type:t.type}:t.value===void 0?{type:"object",value:t}:(e=LC(t.value),{...t,...Vv[e],type:e}):{type:"object",value:null};throw new Error("props")}function LC(t){return Array.isArray(t)||ArrayBuffer.isView(t)?"array":typeof t}const Zz=`#ifdef MODULE_LOGDEPTH - logdepth_adjustPosition(gl_Position); -#endif -`,Qz=`#ifdef MODULE_MATERIAL - fragColor = material_filterColor(fragColor); -#endif - -#ifdef MODULE_LIGHTING - fragColor = lighting_filterColor(fragColor); -#endif - -#ifdef MODULE_FOG - fragColor = fog_filterColor(fragColor); -#endif - -#ifdef MODULE_PICKING - fragColor = picking_filterHighlightColor(fragColor); - fragColor = picking_filterPickingColor(fragColor); -#endif - -#ifdef MODULE_LOGDEPTH - logdepth_setFragDepth(); -#endif -`,Gz={vertex:Zz,fragment:Qz},zC=/void\s+main\s*\([^)]*\)\s*\{\n?/,$C=/}\n?[^{}]*$/,Hv=[],Fh="__LUMA_INJECT_DECLARATIONS__";function Jz(t){const e={vertex:{},fragment:{}};for(const n in t){let r=t[n];const i=e$(n);typeof r=="string"&&(r={order:0,injection:r}),e[i][n]=r}return e}function e$(t){const e=t.slice(0,2);switch(e){case"vs":return"vertex";case"fs":return"fragment";default:throw new Error(e)}}function lg(t,e,n,r=!1){const i=e==="vertex";for(const a in n){const l=n[a];l.sort((f,h)=>f.order-h.order),Hv.length=l.length;for(let f=0,h=l.length;ff+u));break;case"vs:#main-end":i&&(t=t.replace($C,f=>u+f));break;case"fs:#decl":i||(t=t.replace(Fh,u));break;case"fs:#main-start":i||(t=t.replace(zC,f=>f+u));break;case"fs:#main-end":i||(t=t.replace($C,f=>u+f));break;default:t=t.replace(a,f=>f+u)}}return t=t.replace(Fh,""),r&&(t=t.replace(/\}\s*$/,a=>a+Gz[e])),t}function cg(t){t.map(e=>t$(e))}function t$(t){if(t.instance)return;cg(t.dependencies||[]);const{propTypes:e={},deprecations:n=[],inject:r={}}=t,i={normalizedInjections:Jz(r),parsedDeprecations:n$(n)};e&&(i.propValidators=Yz(e)),t.instance=i;let a={};e&&(a=Object.entries(e).reduce((l,[u,f])=>{const h=f==null?void 0:f.value;return h&&(l[u]=h),l},{})),t.defaultUniforms={...t.defaultUniforms,...a}}function Kx(t,e,n){var r;(r=t.deprecations)==null||r.forEach(i=>{var a;(a=i.regex)!=null&&a.test(e)&&(i.deprecated?n.deprecated(i.old,i.new)():n.removed(i.old,i.new)())})}function n$(t){return t.forEach(e=>{switch(e.type){case"function":e.regex=new RegExp(`\\b${e.old}\\(`);break;default:e.regex=new RegExp(`${e.type} ${e.old};`)}}),t}function ub(t){cg(t);const e={},n={};Zx({modules:t,level:0,moduleMap:e,moduleDepth:n});const r=Object.keys(n).sort((i,a)=>n[a]-n[i]).map(i=>e[i]);return cg(r),r}function Zx(t){const{modules:e,level:n,moduleMap:r,moduleDepth:i}=t;if(n>=5)throw new Error("Possible loop in shader dependency graph");for(const a of e)r[a.name]=a,(i[a.name]===void 0||i[a.name]l.order-u.order);for(const l of a)n+=` ${l.injection} -`}i.footer&&(n+=` ${i.footer}`),n+=`} -`}return n}function Jx(t){const e={vertex:{},fragment:{}};for(const n of t){let r,i;typeof n!="string"?(r=n,i=r.hook):(r={},i=n),i=i.trim();const[a,l]=i.split(":"),u=i.replace(/\(.+/,""),f=Object.assign(r,{signature:l});switch(a){case"vs":e.vertex[u]=f;break;case"fs":e.fragment[u]=f;break;default:throw new Error(a)}}return e}function o$(t,e){return{name:l$(t,e),language:"glsl",version:c$(t)}}function l$(t,e="unnamed"){const r=/#define[^\S\r\n]*SHADER_NAME[^\S\r\n]*([A-Za-z0-9_-]+)\s*/.exec(t);return r?r[1]:e}function c$(t){let e=100;const n=t.match(/[^\s]+/g);if(n&&n.length>=2&&n[0]==="#version"){const r=parseInt(n[1],10);Number.isFinite(r)&&(e=r)}if(e!==100&&e!==300)throw new Error(`Invalid GLSL version ${e}`);return e}const eM=` - -${Fh} -`,u$=`precision highp float; -`;function f$(t){const e=ub(t.modules||[]);return{source:h$(t.platformInfo,{...t,source:t.source,stage:"vertex",modules:e}),getUniforms:tM(e)}}function d$(t){const{vs:e,fs:n}=t,r=ub(t.modules||[]);return{vs:HC(t.platformInfo,{...t,source:e,stage:"vertex",modules:r}),fs:HC(t.platformInfo,{...t,source:n,stage:"fragment",modules:r}),getUniforms:tM(r)}}function h$(t,e){var E;const{source:n,stage:r,modules:i,hookFunctions:a=[],inject:l={},log:u}=e;cb(typeof n=="string","shader source must be a string");const f=n;let h="";const g=Jx(a),m={},v={},S={};for(const b in l){const C=typeof l[b]=="string"?{injection:l[b],order:0}:l[b],T=/^(v|f)s:(#)?([\w-]+)$/.exec(b);if(T){const A=T[2],O=T[3];A?O==="decl"?v[b]=[C]:S[b]=[C]:m[b]=[C]}else S[b]=[C]}const w=i;for(const b of w){u&&Kx(b,f,u);const C=nM(b,"wgsl");h+=C;const T=((E=b.injections)==null?void 0:E[r])||{};for(const A in T){const O=/^(v|f)s:#([\w-]+)$/.exec(A);if(O){const N=O[2]==="decl"?v:S;N[A]=N[A]||[],N[A].push(T[A])}else m[A]=m[A]||[],m[A].push(T[A])}}return h+=eM,h=lg(h,r,v),h+=Gx(g[r],m),h+=f,h=lg(h,r,S),h}function HC(t,e){var F;const{id:n,source:r,stage:i,language:a="glsl",modules:l,defines:u={},hookFunctions:f=[],inject:h={},prologue:g=!0,log:m}=e;cb(typeof r=="string","shader source must be a string");const v=a==="glsl"?o$(r).version:-1,S=t.shaderLanguageVersion,w=v===100?"#version 100":"#version 300 es",b=r.split(` -`).slice(1).join(` -`),C={};l.forEach(L=>{Object.assign(C,L.defines)}),Object.assign(C,u);let T="";switch(a){case"wgsl":break;case"glsl":T=g?`${w} - -// ----- PROLOGUE ------------------------- -${g$({id:n,source:r,stage:i})} -${`#define SHADER_TYPE_${i.toUpperCase()}`} - -${r$(t)} -${i==="fragment"?u$:""} - -// ----- APPLICATION DEFINES ------------------------- - -${p$(C)} - -`:`${w} -`;break}const A=Jx(f),O={},x={},N={};for(const L in h){const D=typeof h[L]=="string"?{injection:h[L],order:0}:h[L],V=/^(v|f)s:(#)?([\w-]+)$/.exec(L);if(V){const B=V[2],W=V[3];B?W==="decl"?x[L]=[D]:N[L]=[D]:O[L]=[D]}else N[L]=[D]}for(const L of l){m&&Kx(L,b,m);const D=nM(L,i);T+=D;const V=((F=L.instance)==null?void 0:F.normalizedInjections[i])||{};for(const B in V){const W=/^(v|f)s:#([\w-]+)$/.exec(B);if(W){const Y=W[2]==="decl"?x:N;Y[B]=Y[B]||[],Y[B].push(V[B])}else O[B]=O[B]||[],O[B].push(V[B])}}return T+="// ----- MAIN SHADER SOURCE -------------------------",T+=eM,T=lg(T,i,x),T+=Gx(A[i],O),T+=b,T=lg(T,i,N),a==="glsl"&&v!==S&&(T=i$(T,i)),T.trim()}function tM(t){return function(n){var i;const r={};for(const a of t){const l=(i=a.getUniforms)==null?void 0:i.call(a,n,r);Object.assign(r,l)}return r}}function g$(t){const{id:e,source:n,stage:r}=t;return e&&n.indexOf("SHADER_NAME")===-1?` -#define SHADER_NAME ${e}_${r}`:""}function p$(t={}){let e="";for(const n in t){const r=t[n];(r||Number.isFinite(r))&&(e+=`#define ${n.toUpperCase()} ${t[n]} -`)}return e}function nM(t,e){let n;switch(e){case"vertex":n=t.vs||"";break;case"fragment":n=t.fs||"";break;case"wgsl":n=t.source||"";break;default:cb(!1)}if(!t.name)throw new Error("Shader module must have a name");const r=t.name.toUpperCase().replace(/[^0-9a-z]/gi,"_");let i=`// ----- MODULE ${t.name} --------------- - -`;return e!=="wgsl"&&(i+=`#define MODULE_${r} -`),i+=`${n} -`,i}const m$=/^\s*\#\s*ifdef\s*([a-zA-Z_]+)\s*$/,v$=/^\s*\#\s*endif\s*$/;function _$(t,e){var l;const n=t.split(` -`),r=[];let i=!0,a=null;for(const u of n){const f=u.match(m$),h=u.match(v$);f?(a=f[1],i=!!((l=e==null?void 0:e.defines)!=null&&l[a])):h?i=!0:i&&r.push(u)}return r.join(` -`)}const yo=class yo{constructor(){M(this,"_hookFunctions",[]);M(this,"_defaultModules",[])}static getDefaultShaderAssembler(){return yo.defaultShaderAssembler=yo.defaultShaderAssembler||new yo,yo.defaultShaderAssembler}addDefaultModule(e){this._defaultModules.find(n=>n.name===(typeof e=="string"?e:e.name))||this._defaultModules.push(e)}removeDefaultModule(e){const n=typeof e=="string"?e:e.name;this._defaultModules=this._defaultModules.filter(r=>r.name!==n)}addShaderHook(e,n){n&&(e=Object.assign(n,{hook:e})),this._hookFunctions.push(e)}assembleWGSLShader(e){const n=this._getModuleList(e.modules),r=this._hookFunctions,{source:i,getUniforms:a}=f$({...e,source:e.source,modules:n,hookFunctions:r});return{source:e.platformInfo.shaderLanguage==="wgsl"?_$(i):i,getUniforms:a,modules:n}}assembleGLSLShaderPair(e){const n=this._getModuleList(e.modules),r=this._hookFunctions;return{...d$({...e,vs:e.vs,fs:e.fs,modules:n,hookFunctions:r}),modules:n}}_getModuleList(e=[]){const n=new Array(this._defaultModules.length+e.length),r={};let i=0;for(let a=0,l=this._defaultModules.length;at.startsWith(e))}function fb(t){let e=I$(t);if(aM(t)){e.channels="rgb",e.components=3,e.bytesPerPixel=1,e.srgb=!1,e.compressed=!0;const r=D$(t);r&&(e.blockWidth=r.blockWidth,e.blockHeight=r.blockHeight)}const n=N$.exec(t);if(n){const[,r,i,a,l,u]=n,f=`${a}${i}`,h=iM(f),g=h.byteLength*8,m=r.length,v=[g,m>=2?g:0,m>=3?g:0,m>=4?g:0];e={format:t,attachment:e.attachment,dataType:h.dataType,components:m,channels:r,integer:h.integer,signed:h.signed,normalized:h.normalized,bitsPerChannel:v,bytesPerPixel:h.byteLength*r.length,packed:e.packed,srgb:e.srgb},u==="-webgl"&&(e.webgl=!0),l==="-srgb"&&(e.srgb=!0)}return t.endsWith("-webgl")&&(e.webgl=!0),t.endsWith("-srgb")&&(e.srgb=!0),e}function I$(t){var a;const e=sM(t),n=e.bytesPerPixel||1,r=e.bitsPerChannel||[8,8,8,8];return delete e.bitsPerChannel,delete e.bytesPerPixel,delete e.f,delete e.render,delete e.filter,delete e.blend,delete e.store,{...e,format:t,attachment:e.attachment||"color",channels:e.channels||"r",components:e.components||((a=e.channels)==null?void 0:a.length)||1,bytesPerPixel:n,bitsPerChannel:r,dataType:e.dataType||"uint8",srgb:e.srgb??!1,packed:e.packed??!1,webgl:e.webgl??!1,integer:e.integer??!1,signed:e.signed??!1,normalized:e.normalized??!1,compressed:e.compressed??!1}}function D$(t){const n=/.*-(\d+)x(\d+)-.*/.exec(t);if(n){const[,r,i]=n;return{blockWidth:Number(r),blockHeight:Number(i)}}return null}function F$(t){const e=sM(t),n={format:t,create:e.f??!0,render:e.render??!0,filter:e.filter??!0,blend:e.blend??!0,store:e.store??!0},r=fb(t),i=t.startsWith("depth")||t.startsWith("stencil"),a=r==null?void 0:r.signed,l=r==null?void 0:r.integer,u=r==null?void 0:r.webgl;return n.render&&(n.render=!a),n.filter&&(n.filter=!i&&!a&&!l&&!u),n}class k${}class B${constructor(e=[],n){M(this,"features");M(this,"disabledFeatures");this.features=new Set(e),this.disabledFeatures=n||{}}*[Symbol.iterator](){yield*this.features}has(e){var n;return!((n=this.disabledFeatures)!=null&&n[e])&&this.features.has(e)}}const Og=class Og{constructor(e){M(this,"id");M(this,"props");M(this,"userData",{});M(this,"statsManager",rM);M(this,"timestamp",0);M(this,"_reused",!1);M(this,"_lumaData",{});this.props={...Og.defaultProps,...e},this.id=this.props.id||ap(this[Symbol.toStringTag].toLowerCase())}get[Symbol.toStringTag](){return"Device"}getTextureFormatCapabilities(e){const n=F$(e),r=l=>(typeof l=="string"?this.features.has(l):l)??!0,i=r(n.create),a={format:e,create:i,render:i&&r(n.render),filter:i&&r(n.filter),blend:i&&r(n.blend),store:i&&r(n.store)};return this._getDeviceSpecificTextureFormatCapabilities(a)}isTextureFormatSupported(e,n){return this.getTextureFormatCapabilities(e).create}isTextureFormatFilterable(e){return this.getTextureFormatCapabilities(e).filter}isTextureFormatRenderable(e){return this.getTextureFormatCapabilities(e).render}isTextureFormatCompressed(e){return aM(e)}loseDevice(){return!1}reportError(e){this.props.onError(e)}getDefaultCanvasContext(){if(!this.canvasContext)throw new Error("Device has no default CanvasContext. See props.createCanvasContext");return this.canvasContext}createCommandEncoder(e={}){throw new Error("not implemented")}incrementTimestamp(){return this.timestamp++}onError(e){this.props.onError(e)}getCanvasContext(){return this.getDefaultCanvasContext()}readPixelsToArrayWebGL(e,n){throw new Error("not implemented")}readPixelsToBufferWebGL(e,n){throw new Error("not implemented")}setParametersWebGL(e){throw new Error("not implemented")}getParametersWebGL(e){throw new Error("not implemented")}withParametersWebGL(e,n){throw new Error("not implemented")}clearWebGL(e){throw new Error("not implemented")}resetWebGL(){throw new Error("not implemented")}static _getCanvasContextProps(e){return e.createCanvasContext===!0?{}:e.createCanvasContext}_normalizeBufferProps(e){(e instanceof ArrayBuffer||ArrayBuffer.isView(e))&&(e={data:e});const n={...e};return(e.usage||0)&$n.INDEX&&!e.indexType&&(e.data instanceof Uint32Array?n.indexType="uint32":e.data instanceof Uint16Array?n.indexType="uint16":Re.warn("indices buffer content must be of integer type")()),n}};M(Og,"defaultProps",{id:null,powerPreference:"high-performance",failIfMajorPerformanceCaveat:!1,createCanvasContext:void 0,onError:e=>Re.error(e.message)(),_reuseDevices:!1,_requestMaxLimits:!0,_factoryDestroyPolicy:"unused",_initializeFeatures:!0,_disabledFeatures:{"compilation-status-async-webgl":!0},_resourceDefaults:{},webgl:{},debug:Re.get("debug")||void 0,debugShaders:Re.get("debug-shaders")||void 0,debugFramebuffers:!!Re.get("debug-framebuffers"),debugWebGL:!!Re.get("debug-webgl"),debugSpectorJS:void 0,debugSpectorJSUrl:void 0,_handle:void 0});let Ua=Og;const U$=Ho()&&typeof document<"u",L$=()=>U$&&document.readyState==="complete",z$="set luma.log.level=1 (or higher) to trace rendering",XC="No matching device found. Ensure `@luma.gl/webgl` and/or `@luma.gl/webgpu` modules are imported.",Ta=class Ta{constructor(){M(this,"stats",rM);M(this,"log",Re);M(this,"VERSION","9.1.2");M(this,"spector");M(this,"preregisteredAdapters",new Map);if(globalThis.luma){if(globalThis.luma.VERSION!==this.VERSION)throw Re.error(`Found luma.gl ${globalThis.luma.VERSION} while initialzing ${this.VERSION}`)(),Re.error("'yarn why @luma.gl/core' can help identify the source of the conflict")(),new Error("luma.gl - multiple versions detected: see console log");Re.error("This version of luma.gl has already been initialized")()}Re.log(1,`${this.VERSION} - ${z$}`)(),globalThis.luma=this}registerAdapters(e){for(const n of e)this.preregisteredAdapters.set(n.type,n)}getSupportedAdapters(e=[]){const n=this.getAdapterMap(e);return Array.from(n).map(([,r])=>r).filter(r=>{var i;return(i=r.isSupported)==null?void 0:i.call(r)}).map(r=>r.type)}getBestAvailableAdapter(e=[]){var r,i,a,l;const n=this.getAdapterMap(e);return(i=(r=n.get("webgpu"))==null?void 0:r.isSupported)!=null&&i.call(r)?"webgpu":(l=(a=n.get("webgl"))==null?void 0:a.isSupported)!=null&&l.call(a)?"webgl":null}setDefaultDeviceProps(e){Object.assign(Ta.defaultProps,e)}async createDevice(e={}){var u;e={...Ta.defaultProps,...e},e.waitForPageLoad&&await Ta.pageLoaded;const n=this.getAdapterMap(e.adapters);let r=e.type||"";r==="best-available"&&(r=this.getBestAvailableAdapter(e.adapters)||r);const a=(this.getAdapterMap(e.adapters)||n).get(r),l=await((u=a==null?void 0:a.create)==null?void 0:u.call(a,e));if(l)return l;throw new Error(XC)}async attachDevice(e){var l;const n=this.getAdapterMap(e.adapters);let r="";e.handle instanceof WebGL2RenderingContext&&(r="webgl"),e.createCanvasContext&&await Ta.pageLoaded,e.handle===null&&(r="unknown");const i=n.get(r),a=await((l=i==null?void 0:i.attach)==null?void 0:l.call(i,null));if(a)return a;throw new Error(XC)}enforceWebGL2(e=!0,n=[]){var a;const i=this.getAdapterMap(n).get("webgl");i||Re.warn("enforceWebGL2: webgl adapter not found")(),(a=i==null?void 0:i.enforceWebGL2)==null||a.call(i,e)}getAdapterMap(e=[]){const n=new Map(this.preregisteredAdapters);for(const r of e)n.set(r.type,r);return n}registerDevices(e){Re.warn("luma.registerDevices() is deprecated, use luma.registerAdapters() instead");for(const n of e){const r=n.adapter;r&&this.preregisteredAdapters.set(r.type,r)}}};M(Ta,"defaultProps",{...Ua.defaultProps,type:"best-available",adapters:void 0,waitForPageLoad:!0}),M(Ta,"pageLoaded",$$().then(()=>{Re.probe(2,"DOM is loaded")()}));let B_=Ta;const U_=new B_;function $$(){return L$()||typeof window>"u"?Promise.resolve():new Promise(t=>{window.addEventListener("load",()=>t())})}class V${}const Pg=class Pg{constructor(e){M(this,"id");M(this,"props");M(this,"canvas");M(this,"htmlCanvas");M(this,"offscreenCanvas");M(this,"type");M(this,"width",1);M(this,"height",1);M(this,"resizeObserver");M(this,"_canvasSizeInfo",{clientWidth:0,clientHeight:0,devicePixelRatio:1});if(this.props={...Pg.defaultProps,...e},e=this.props,!Ho()){this.id="node-canvas-context",this.type="node",this.width=this.props.width,this.height=this.props.height,this.canvas=null;return}if(e.canvas)typeof e.canvas=="string"?this.canvas=j$(e.canvas):this.canvas=e.canvas;else{const n=W$(e),r=H$((e==null?void 0:e.container)||null);r.insertBefore(n,r.firstChild),this.canvas=n,e!=null&&e.visible||(this.canvas.style.visibility="hidden")}this.canvas instanceof HTMLCanvasElement?(this.id=this.canvas.id,this.type="html-canvas",this.htmlCanvas=this.canvas):(this.id="offscreen-canvas",this.type="offscreen-canvas",this.offscreenCanvas=this.canvas),this.canvas instanceof HTMLCanvasElement&&e.autoResize&&(this.resizeObserver=new ResizeObserver(n=>{for(const r of n)r.target===this.canvas&&this.update()}),this.resizeObserver.observe(this.canvas))}toString(){return`${this[Symbol.toStringTag]}(${this.id})`}getDevicePixelRatio(e){return typeof OffscreenCanvas<"u"&&this.canvas instanceof OffscreenCanvas||(e=e===void 0?this.props.useDevicePixels:e,!e||e<=0)?1:e===!0?typeof window<"u"&&window.devicePixelRatio||1:e}getPixelSize(){switch(this.type){case"node":return[this.width,this.height];case"offscreen-canvas":return[this.canvas.width,this.canvas.height];case"html-canvas":const e=this.getDevicePixelRatio(),n=this.canvas;return n.parentElement?[n.clientWidth*e,n.clientHeight*e]:[this.canvas.width,this.canvas.height];default:throw new Error(this.type)}}getAspect(){const[e,n]=this.getPixelSize();return e/n}cssToDeviceRatio(){var e;try{const[n]=this.getDrawingBufferSize(),r=this._canvasSizeInfo.clientWidth||((e=this.htmlCanvas)==null?void 0:e.clientWidth);return r?n/r:1}catch{return 1}}cssToDevicePixels(e,n=!0){const r=this.cssToDeviceRatio(),[i,a]=this.getDrawingBufferSize();return X$(e,r,i,a,n)}setDevicePixelRatio(e,n={}){if(!this.htmlCanvas)return;let r="width"in n?n.width:this.htmlCanvas.clientWidth,i="height"in n?n.height:this.htmlCanvas.clientHeight;(!r||!i)&&(Re.log(1,"Canvas clientWidth/clientHeight is 0")(),e=1,r=this.htmlCanvas.width||1,i=this.htmlCanvas.height||1);const a=this._canvasSizeInfo;if(a.clientWidth!==r||a.clientHeight!==i||a.devicePixelRatio!==e){let l=e;const u=Math.floor(r*l),f=Math.floor(i*l);if(this.htmlCanvas.width=u,this.htmlCanvas.height=f,this.device.gl){const[g,m]=this.getDrawingBufferSize();(g!==u||m!==f)&&(l=Math.min(g/r,m/i),this.htmlCanvas.width=Math.floor(r*l),this.htmlCanvas.height=Math.floor(i*l),Re.warn("Device pixel ratio clamped")()),this._canvasSizeInfo.clientWidth=r,this._canvasSizeInfo.clientHeight=i,this._canvasSizeInfo.devicePixelRatio=e}}}getDrawingBufferSize(){const e=this.device.gl;if(!e)throw new Error("canvas size");return[e.drawingBufferWidth,e.drawingBufferHeight]}_setAutoCreatedCanvasId(e){var n;((n=this.htmlCanvas)==null?void 0:n.id)==="lumagl-auto-created-canvas"&&(this.htmlCanvas.id=e)}};M(Pg,"defaultProps",{canvas:null,width:800,height:600,useDevicePixels:!0,autoResize:!0,container:null,visible:!0,alphaMode:"opaque",colorSpace:"srgb"});let L_=Pg;function H$(t){if(typeof t=="string"){const e=document.getElementById(t);if(!e)throw new Error(`${t} is not an HTML element`);return e}else if(t)return t;return document.body}function j$(t){const e=document.getElementById(t);if(!(e instanceof HTMLCanvasElement))throw new Error("Object is not a canvas element");return e}function W$(t){const{width:e,height:n}=t,r=document.createElement("canvas");return r.id=ap("lumagl-auto-created-canvas"),r.width=e||1,r.height=n||1,r.style.width=Number.isFinite(e)?`${e}px`:"100%",r.style.height=Number.isFinite(n)?`${n}px`:"100%",r}function X$(t,e,n,r,i){const a=t,l=qC(a[0],e,n);let u=YC(a[1],e,r,i),f=qC(a[0]+1,e,n);const h=f===n-1?f:f-1;f=YC(a[1]+1,e,r,i);let g;return i?(f=f===0?f:f+1,g=u,u=f):g=f===r-1?f:f-1,{x:l,y:u,width:Math.max(h-l+1,1),height:Math.max(g-u+1,1)}}function qC(t,e,n){return Math.min(Math.round(t*e),n-1)}function YC(t,e,n,r){return r?Math.max(0,n-1-Math.round(t*e)):Math.min(Math.round(t*e),n-1)}const Ar=class Ar extends mn{constructor(n,r){r=Ar.normalizeProps(n,r);super(n,r,Ar.defaultProps);M(this,"dimension");M(this,"format");M(this,"width");M(this,"height");M(this,"depth");M(this,"mipLevels");M(this,"updateTimestamp");if(this.dimension=this.props.dimension,this.format=this.props.format,this.width=this.props.width,this.height=this.props.height,this.depth=this.props.depth,this.props.width===void 0||this.props.height===void 0){const i=Ar.getTextureDataSize(this.props.data);this.width=(i==null?void 0:i.width)||1,this.height=(i==null?void 0:i.height)||1}this.props.mipmaps&&this.props.mipLevels===void 0&&(this.props.mipLevels="pyramid"),this.mipLevels=this.props.mipLevels==="pyramid"?Ar.getMipLevelCount(this.width,this.height):this.props.mipLevels||1,this.updateTimestamp=n.incrementTimestamp()}get[Symbol.toStringTag](){return"Texture"}toString(){return`Texture(${this.id},${this.format},${this.width}x${this.height})`}clone(n){return this.device.createTexture({...this.props,...n})}static isExternalImage(n){return typeof ImageData<"u"&&n instanceof ImageData||typeof ImageBitmap<"u"&&n instanceof ImageBitmap||typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement||typeof HTMLVideoElement<"u"&&n instanceof HTMLVideoElement||typeof VideoFrame<"u"&&n instanceof VideoFrame||typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas}static getExternalImageSize(n){if(typeof ImageData<"u"&&n instanceof ImageData||typeof ImageBitmap<"u"&&n instanceof ImageBitmap||typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas)return{width:n.width,height:n.height};if(typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement)return{width:n.naturalWidth,height:n.naturalHeight};if(typeof HTMLVideoElement<"u"&&n instanceof HTMLVideoElement)return{width:n.videoWidth,height:n.videoHeight};if(typeof VideoFrame<"u"&&n instanceof VideoFrame)return{width:n.displayWidth,height:n.displayHeight};throw new Error("Unknown image type")}static isTextureLevelData(n){const r=n==null?void 0:n.data;return ArrayBuffer.isView(r)}static getTextureDataSize(n){if(!n||ArrayBuffer.isView(n))return null;if(Array.isArray(n))return Ar.getTextureDataSize(n[0]);if(Ar.isExternalImage(n))return Ar.getExternalImageSize(n);if(n&&typeof n=="object"&&n.constructor===Object){const i=Object.values(n)[0];return{width:i.width,height:i.height}}throw new Error("texture size deduction failed")}static normalizeTextureData(n,r){let i;return ArrayBuffer.isView(n)?i=[{data:n,width:r.width,height:r.height}]:Array.isArray(n)?i=n:i=[n],i}static getMipLevelCount(n,r){return Math.floor(Math.log2(Math.max(n,r)))+1}static getCubeFaceDepth(n){switch(n){case"+X":return 0;case"-X":return 1;case"+Y":return 2;case"-Y":return 3;case"+Z":return 4;case"-Z":return 5;default:throw new Error(n)}}static normalizeProps(n,r){var f,h;const i={...r},a=((h=(f=n==null?void 0:n.props)==null?void 0:f._resourceDefaults)==null?void 0:h.texture)||{};Object.assign(i,a);const{width:l,height:u}=i;return typeof l=="number"&&(i.width=Math.max(1,Math.ceil(l))),typeof u=="number"&&(i.height=Math.max(1,Math.ceil(u))),i}};M(Ar,"COPY_SRC",1),M(Ar,"COPY_DST",2),M(Ar,"TEXTURE",4),M(Ar,"STORAGE",8),M(Ar,"RENDER_ATTACHMENT",16),M(Ar,"CubeFaces",["+X","-X","+Y","-Y","+Z","-Z"]),M(Ar,"defaultProps",{...mn.defaultProps,data:null,dimension:"2d",format:"rgba8unorm",width:void 0,height:void 0,depth:1,mipmaps:!1,compressed:!1,usage:0,mipLevels:void 0,samples:void 0,sampler:{},view:void 0,flipY:void 0}),M(Ar,"defaultCopyExternalImageOptions",{image:void 0,sourceX:0,sourceY:0,width:void 0,height:void 0,depth:1,mipLevel:0,x:0,y:0,z:0,aspect:"all",colorSpace:"srgb",premultipliedAlpha:!1,flipY:!1});let Kn=Ar;const Ng=class Ng extends mn{get[Symbol.toStringTag](){return"TextureView"}constructor(e,n){super(e,n,Ng.defaultProps)}};M(Ng,"defaultProps",{...mn.defaultProps,format:void 0,dimension:void 0,aspect:"all",baseMipLevel:0,mipLevelCount:void 0,baseArrayLayer:0,arrayLayerCount:void 0});let fg=Ng;function q$(t,e,n){let r="";const i=e.split(/\r?\n/),a=t.slice().sort((l,u)=>l.lineNum-u.lineNum);switch((n==null?void 0:n.showSourceCode)||"no"){case"all":let l=0;for(let u=1;u<=i.length;u++)for(r+=oM(i[u-1],u,n);a.length>l&&a[l].lineNum===u;){const f=a[l++];r+=KC(f,i,f.lineNum,{...n,inlineSource:!1})}return r;case"issues":case"no":for(const u of t)r+=KC(u,i,u.lineNum,{inlineSource:(n==null?void 0:n.showSourceCode)!=="no"});return r}}function KC(t,e,n,r){if(r!=null&&r.inlineSource){const a=Y$(e,n),l=t.linePos>0?`${" ".repeat(t.linePos+5)}^^^ -`:"";return` -${a}${l}${t.type.toUpperCase()}: ${t.message} - -`}const i=t.type==="error"?"red":"#8B4000";return r!=null&&r.html?`
${t.type.toUpperCase()}: ${t.message}
`:`${t.type.toUpperCase()}: ${t.message}`}function Y$(t,e,n){let r="";for(let i=e-2;i<=e;i++){const a=t[i-1];a!==void 0&&(r+=oM(a,e,n))}return r}function oM(t,e,n){const r=n!=null&&n.html?Z$(t):t;return`${K$(String(e),4)}: ${r}${n!=null&&n.html?"
":` -`}`}function K$(t,e){let n="";for(let r=t.length;r",">").replaceAll('"',""").replaceAll("'","'")}const Ig=class Ig extends mn{constructor(n,r){r={...r,debugShaders:r.debugShaders||n.props.debugShaders||"errors"};super(n,{id:Q$(r),...r},Ig.defaultProps);M(this,"stage");M(this,"source");M(this,"compilationStatus","pending");this.stage=this.props.stage,this.source=this.props.source}get[Symbol.toStringTag](){return"Shader"}getCompilationInfoSync(){return null}getTranslatedSource(){return null}async debugShader(){const n=this.props.debugShaders;switch(n){case"never":return;case"errors":if(this.compilationStatus==="success")return;break}const r=await this.getCompilationInfo();n==="warnings"&&(r==null?void 0:r.length)===0||this._displayShaderLog(r)}_displayShaderLog(n){var h;if(typeof document>"u"||!(document!=null&&document.createElement))return;const r=lM(this.source),i=`${this.stage} ${r}`;let a=q$(n,this.source,{showSourceCode:"all",html:!0});const l=this.getTranslatedSource();l&&(a+=`

Translated Source



${l}
`);const u=document.createElement("Button");u.innerHTML=` -

Shader Compilation Error in ${i}



-
-${a}
-
`,u.style.top="10px",u.style.left="10px",u.style.position="absolute",u.style.zIndex="9999",u.style.width="100%",u.style.textAlign="left",document.body.appendChild(u),(h=document.getElementsByClassName("luma-compiler-log-error")[0])==null||h.scrollIntoView(),u.onclick=()=>{const g=`data:text/plain,${encodeURIComponent(this.source)}`;navigator.clipboard.writeText(g)}}};M(Ig,"defaultProps",{...mn.defaultProps,language:"auto",stage:void 0,source:"",sourceMap:null,entryPoint:"main",debugShaders:void 0});let dg=Ig;function Q$(t){return lM(t.source)||t.id||ap(`unnamed ${t.stage}-shader`)}function lM(t,e="unnamed"){const r=/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/.exec(t);return r?r[1]:e}const uf=class uf extends mn{get[Symbol.toStringTag](){return"Sampler"}constructor(e,n){n=uf.normalizeProps(e,n),super(e,n,uf.defaultProps)}static normalizeProps(e,n){var a,l;const r=((l=(a=e==null?void 0:e.props)==null?void 0:a._resourceDefaults)==null?void 0:l.sampler)||{};return{...n,...r}}};M(uf,"defaultProps",{...mn.defaultProps,type:"color-sampler",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge",addressModeW:"clamp-to-edge",magFilter:"nearest",minFilter:"nearest",mipmapFilter:"none",lodMinClamp:0,lodMaxClamp:32,compare:"less-equal",maxAnisotropy:1});let hg=uf;const Dg=class Dg extends mn{constructor(n,r={}){super(n,r,Dg.defaultProps);M(this,"width");M(this,"height");this.width=this.props.width,this.height=this.props.height}get[Symbol.toStringTag](){return"Framebuffer"}clone(n){const r=this.colorAttachments.map(a=>a.texture.clone(n)),i=this.depthStencilAttachment&&this.depthStencilAttachment.texture.clone(n);return this.device.createFramebuffer({...this.props,colorAttachments:r,depthStencilAttachment:i})}resize(n){let r=!n;if(n){const[i,a]=Array.isArray(n)?n:[n.width,n.height];r=r||a!==this.height||i!==this.width,this.width=i,this.height=a}r&&(Re.log(2,`Resizing framebuffer ${this.id} to ${this.width}x${this.height}`)(),this.resizeAttachments(this.width,this.height))}autoCreateAttachmentTextures(){if(this.props.colorAttachments.length===0&&!this.props.depthStencilAttachment)throw new Error("Framebuffer has noattachments");this.colorAttachments=this.props.colorAttachments.map((r,i)=>{if(typeof r=="string"){const a=this.createColorTexture(r,i);return this.attachResource(a),a.view}return r instanceof Kn?r.view:r});const n=this.props.depthStencilAttachment;if(n)if(typeof n=="string"){const r=this.createDepthStencilTexture(n);this.attachResource(r),this.depthStencilAttachment=r.view}else n instanceof Kn?this.depthStencilAttachment=n.view:this.depthStencilAttachment=n}createColorTexture(n,r){return this.device.createTexture({id:`${this.id}-color-attachment-${r}`,usage:Kn.RENDER_ATTACHMENT,format:n,width:this.width,height:this.height,sampler:{magFilter:"linear",minFilter:"linear"}})}createDepthStencilTexture(n){return this.device.createTexture({id:`${this.id}-depth-stencil-attachment`,usage:Kn.RENDER_ATTACHMENT,format:n,width:this.width,height:this.height,mipmaps:!1})}resizeAttachments(n,r){for(let i=0;i":["f32",2],"vec3":["f32",3],"vec4":["f32",4],f16:["f16",1],"vec2":["f16",2],"vec3":["f16",3],"vec4":["f16",4],i32:["i32",1],"vec2":["i32",2],"vec3":["i32",3],"vec4":["i32",4],u32:["u32",1],"vec2":["u32",2],"vec3":["u32",3],"vec4":["u32",4]},tV={f32:4,f16:2,i32:4,u32:4};function cM(t){let e;t.endsWith("-webgl")&&(t.replace("-webgl",""),e=!0);const[n,r]=t.split("x"),i=n,a=r?parseInt(r):1,l=iM(i),u={type:i,components:a,byteLength:l.byteLength*a,integer:l.integer,signed:l.signed,normalized:l.normalized};return e&&(u.webglOnly=!0),u}function uM(t,e){const n={};for(const r of t.attributes){const i=rV(t,e,r.name);i&&(n[r.name]=i)}return n}function nV(t,e,n=16){const r=uM(t,e),i=new Array(n).fill(null);for(const a of Object.values(r))i[a.location]=a;return i}function rV(t,e,n){const r=iV(t,n),i=sV(e,n);if(!r)return null;const a=G$(r.type),l=(i==null?void 0:i.vertexFormat)||a.defaultVertexFormat,u=cM(l);return{attributeName:(i==null?void 0:i.attributeName)||r.name,bufferName:(i==null?void 0:i.bufferName)||r.name,location:r.location,shaderType:r.type,shaderDataType:a.dataType,shaderComponents:a.components,vertexFormat:l,bufferDataType:u.type,bufferComponents:u.components,normalized:u.normalized,integer:a.integer,stepMode:(i==null?void 0:i.stepMode)||r.stepMode||"vertex",byteOffset:(i==null?void 0:i.byteOffset)||0,byteStride:(i==null?void 0:i.byteStride)||0}}function iV(t,e){const n=t.attributes.find(r=>r.name===e);return n||Re.warn(`shader layout attribute "${e}" not present in shader`),n||null}function sV(t,e){aV(t);let n=oV(t,e);return n||(n=lV(t,e),n)?n:(Re.warn(`layout for attribute "${e}" not present in buffer layout`),null)}function aV(t){for(const e of t)(e.attributes&&e.format||!e.attributes&&!e.format)&&Re.warn(`BufferLayout ${name} must have either 'attributes' or 'format' field`)}function oV(t,e){for(const n of t)if(n.format&&n.name===e)return{attributeName:n.name,bufferName:e,stepMode:n.stepMode,vertexFormat:n.format,byteOffset:0,byteStride:n.byteStride||0};return null}function lV(t,e){var n;for(const r of t){let i=r.byteStride;if(typeof r.byteStride!="number")for(const l of r.attributes||[]){const u=cM(l.format);i+=u.byteLength}const a=(n=r.attributes)==null?void 0:n.find(l=>l.attribute===e);if(a)return{attributeName:a.attribute,bufferName:r.name,stepMode:r.stepMode,vertexFormat:a.format,byteOffset:a.byteOffset,byteStride:i}}return null}const Lg=class Lg extends mn{constructor(n,r){super(n,r,Lg.defaultProps);M(this,"maxVertexAttributes");M(this,"attributeInfos");M(this,"indexBuffer",null);M(this,"attributes");this.maxVertexAttributes=n.limits.maxVertexAttributes,this.attributes=new Array(this.maxVertexAttributes).fill(null);const{shaderLayout:i,bufferLayout:a}=r.renderPipeline||{};if(!i||!a)throw new Error("VertexArray");this.attributeInfos=nV(i,a,this.maxVertexAttributes)}get[Symbol.toStringTag](){return"VertexArray"}setConstantWebGL(n,r){throw new Error("constant attributes not supported")}};M(Lg,"defaultProps",{...mn.defaultProps,renderPipeline:null});let H_=Lg;const zg=class zg extends mn{get[Symbol.toStringTag](){return"TransformFeedback"}constructor(e,n){super(e,n,zg.defaultProps)}};M(zg,"defaultProps",{...mn.defaultProps,layout:void 0,buffers:{}});let j_=zg;const $g=class $g extends mn{get[Symbol.toStringTag](){return"QuerySet"}constructor(e,n){super(e,n,$g.defaultProps)}};M($g,"defaultProps",{...mn.defaultProps,type:void 0,count:void 0});let W_=$g;const cV={f32:{type:"f32",components:1},i32:{type:"i32",components:1},u32:{type:"u32",components:1},"vec2":{type:"f32",components:2},"vec3":{type:"f32",components:3},"vec4":{type:"f32",components:4},"vec2":{type:"i32",components:2},"vec3":{type:"i32",components:3},"vec4":{type:"i32",components:4},"vec2":{type:"u32",components:2},"vec3":{type:"u32",components:3},"vec4":{type:"u32",components:4},"mat2x2":{type:"f32",components:4},"mat2x3":{type:"f32",components:6},"mat2x4":{type:"f32",components:8},"mat3x2":{type:"f32",components:6},"mat3x3":{type:"f32",components:9},"mat3x4":{type:"f32",components:12},"mat4x2":{type:"f32",components:8},"mat4x3":{type:"f32",components:12},"mat4x4":{type:"f32",components:16}};function uV(t){return cV[t]}function fV(t,e){switch(e){case 1:return t;case 2:return t+t%2;default:return t+(4-t%4)%4}}let vh;function fM(t){return(!vh||vh.byteLengtha.type==="uniform"&&a.name===(e==null?void 0:e.name));if(!r)throw new Error(e==null?void 0:e.name);const i=r;for(const a of i.uniforms||[])this.bindingLayout[a.name]=a}}setUniforms(e){for(const[n,r]of Object.entries(e))this._setUniform(n,r),this.needsRedraw||this.setNeedsRedraw(`${this.name}.${n}=${r}`)}setNeedsRedraw(e){this.needsRedraw=this.needsRedraw||e}getAllUniforms(){return this.modifiedUniforms={},this.needsRedraw=!1,this.uniforms||{}}_setUniform(e,n){pV(this.uniforms[e],n)||(this.uniforms[e]=mV(n),this.modifiedUniforms[e]=!0,this.modified=!0)}}class _V{constructor(e){M(this,"uniformBlocks",new Map);M(this,"uniformBufferLayouts",new Map);M(this,"uniformBuffers",new Map);for(const[n,r]of Object.entries(e)){const i=n,a=new gV(r.uniformTypes||{});this.uniformBufferLayouts.set(i,a);const l=new vV({name:n});l.setUniforms(r.defaultUniforms||{}),this.uniformBlocks.set(i,l)}}destroy(){for(const e of this.uniformBuffers.values())e.destroy()}setUniforms(e){var n;for(const[r,i]of Object.entries(e))(n=this.uniformBlocks.get(r))==null||n.setUniforms(i);this.updateUniformBuffers()}getUniformBufferByteLength(e){var n;return((n=this.uniformBufferLayouts.get(e))==null?void 0:n.byteLength)||0}getUniformBufferData(e){var r,i;const n=((r=this.uniformBlocks.get(e))==null?void 0:r.getAllUniforms())||{};return(i=this.uniformBufferLayouts.get(e))==null?void 0:i.getData(n)}createUniformBuffer(e,n,r){r&&this.setUniforms(r);const i=this.getUniformBufferByteLength(n),a=e.createBuffer({usage:$n.UNIFORM|$n.COPY_DST,byteLength:i}),l=this.getUniformBufferData(n);return a.write(l),a}getManagedUniformBuffer(e,n){if(!this.uniformBuffers.get(n)){const r=this.getUniformBufferByteLength(n),i=e.createBuffer({usage:$n.UNIFORM|$n.COPY_DST,byteLength:r});this.uniformBuffers.set(n,i)}return this.uniformBuffers.get(n)}updateUniformBuffers(){let e=!1;for(const n of this.uniformBlocks.keys()){const r=this.updateUniformBuffer(n);e||(e=r)}return e&&Re.log(3,`UniformStore.updateUniformBuffers(): ${e}`)(),e}updateUniformBuffer(e){var a;const n=this.uniformBlocks.get(e);let r=this.uniformBuffers.get(e),i=!1;if(r&&(n!=null&&n.needsRedraw)){i||(i=n.needsRedraw);const l=this.getUniformBufferData(e);r=this.uniformBuffers.get(e),r==null||r.write(l);const u=(a=this.uniformBlocks.get(e))==null?void 0:a.getAllUniforms();Re.log(4,`Writing to uniform buffer ${String(e)}`,l,u)()}return i}}function dM(t){const e=ArrayBuffer.isView(t)?t.constructor:t;switch(e){case Float32Array:return"float32";case Uint16Array:return"uint16";case Uint32Array:return"uint32";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int8Array:return"sint8";case Int16Array:return"sint16";case Int32Array:return"sint32";default:throw new Error(e.constructor.name)}}function hM(t){switch(t){case"float32":return Float32Array;case"uint32":return Uint32Array;case"sint32":return Int32Array;case"uint16":case"unorm16":return Uint16Array;case"sint16":case"snorm16":return Int16Array;case"uint8":case"unorm8":return Uint8Array;case"sint8":case"snorm8":return Int8Array;default:throw new Error(t)}}function yV(t,e,n){if(!e||e>4)throw new Error(`size ${e}`);const r=e;let i=dM(t);if(i==="uint8"&&n&&r===1)return"unorm8-webgl";if(i==="uint8"&&n&&r===3)return"unorm8x3-webgl";if(i==="uint8"||i==="sint8"){if(r===1||r===3)throw new Error(`size: ${e}`);return n&&(i=i.replace("int","norm")),`${i}x${r}`}if(i==="uint16"||i==="sint16"){if(r===1||r===3)throw new Error(`size: ${e}`);return n&&(i=i.replace("int","norm")),`${i}x${r}`}return r===1?i:`${i}x${r}`}class Kv{constructor(e){M(this,"bufferLayouts");this.bufferLayouts=e}getBufferLayout(e){return this.bufferLayouts.find(n=>n.name===e)||null}getAttributeNamesForBuffer(e){var n;return e.attributes?(n=e.attributes)==null?void 0:n.map(r=>r.attribute):[e.name]}mergeBufferLayouts(e,n){const r=[...e];for(const i of n){const a=r.findIndex(l=>l.name===i.name);a<0?r.push(i):r[a]=i}return r}}class bV{constructor(){this.constants=new Map,this.aliases=new Map,this.structs=new Map}}class qs{constructor(){}get isAstNode(){return!0}get astNodeType(){return""}evaluate(e){throw new Error("Cannot evaluate node")}evaluateString(e){return this.evaluate(e).toString()}search(e){}searchBlock(e,n){if(e){n(vg.instance);for(const r of e)r instanceof Array?this.searchBlock(r,n):r.search(n);n(_g.instance)}}}class vg extends qs{}vg.instance=new vg;class _g extends qs{}_g.instance=new _g;class kn extends qs{constructor(){super()}}let X_=class extends kn{constructor(e,n,r,i,a,l){super(),this.calls=new Set,this.name=e,this.args=n,this.returnType=r,this.body=i,this.startLine=a,this.endLine=l}get astNodeType(){return"function"}search(e){this.searchBlock(this.body,e)}};class SV extends kn{constructor(e){super(),this.expression=e}get astNodeType(){return"staticAssert"}search(e){this.expression.search(e)}}class EV extends kn{constructor(e,n){super(),this.condition=e,this.body=n}get astNodeType(){return"while"}search(e){this.condition.search(e),this.searchBlock(this.body,e)}}class wV extends kn{constructor(e){super(),this.body=e}get astNodeType(){return"continuing"}search(e){this.searchBlock(this.body,e)}}class TV extends kn{constructor(e,n,r,i){super(),this.init=e,this.condition=n,this.increment=r,this.body=i}get astNodeType(){return"for"}search(e){var n,r,i;(n=this.init)===null||n===void 0||n.search(e),(r=this.condition)===null||r===void 0||r.search(e),(i=this.increment)===null||i===void 0||i.search(e),this.searchBlock(this.body,e)}}class _o extends kn{constructor(e,n,r,i,a){super(),this.name=e,this.type=n,this.storage=r,this.access=i,this.value=a}get astNodeType(){return"var"}search(e){var n;e(this),(n=this.value)===null||n===void 0||n.search(e)}}class gM extends kn{constructor(e,n,r){super(),this.name=e,this.type=n,this.value=r}get astNodeType(){return"override"}search(e){var n;(n=this.value)===null||n===void 0||n.search(e)}}class q_ extends kn{constructor(e,n,r,i,a){super(),this.name=e,this.type=n,this.storage=r,this.access=i,this.value=a}get astNodeType(){return"let"}search(e){var n;e(this),(n=this.value)===null||n===void 0||n.search(e)}}class QC extends kn{constructor(e,n,r,i,a){super(),this.name=e,this.type=n,this.storage=r,this.access=i,this.value=a}get astNodeType(){return"const"}evaluate(e){return this.value.evaluate(e)}search(e){var n;e(this),(n=this.value)===null||n===void 0||n.search(e)}}var xc;(function(t){t.increment="++",t.decrement="--"})(xc||(xc={}));(function(t){function e(n){const r=n;if(r=="parse")throw new Error("Invalid value for IncrementOperator");return t[r]}t.parse=e})(xc||(xc={}));class CV extends kn{constructor(e,n){super(),this.operator=e,this.variable=n}get astNodeType(){return"increment"}search(e){this.variable.search(e)}}var Mf;(function(t){t.assign="=",t.addAssign="+=",t.subtractAssin="-=",t.multiplyAssign="*=",t.divideAssign="/=",t.moduloAssign="%=",t.andAssign="&=",t.orAssign="|=",t.xorAssign="^=",t.shiftLeftAssign="<<=",t.shiftRightAssign=">>="})(Mf||(Mf={}));(function(t){function e(n){const r=n;if(r=="parse")throw new Error("Invalid value for AssignOperator");return r}t.parse=e})(Mf||(Mf={}));class AV extends kn{constructor(e,n,r){super(),this.operator=e,this.variable=n,this.value=r}get astNodeType(){return"assign"}search(e){this.variable.search(e),this.value.search(e)}}class pM extends kn{constructor(e,n){super(),this.name=e,this.args=n}get astNodeType(){return"call"}search(e){for(const n of this.args)n.search(e);e(this)}}class RV extends kn{constructor(e,n){super(),this.body=e,this.continuing=n}get astNodeType(){return"loop"}}class xV extends kn{constructor(e,n){super(),this.condition=e,this.body=n}get astNodeType(){return"body"}}class MV extends kn{constructor(e,n,r,i){super(),this.condition=e,this.body=n,this.elseif=r,this.else=i}get astNodeType(){return"if"}search(e){this.condition.search(e),this.searchBlock(this.body,e),this.searchBlock(this.elseif,e),this.searchBlock(this.else,e)}}class OV extends kn{constructor(e){super(),this.value=e}get astNodeType(){return"return"}search(e){var n;(n=this.value)===null||n===void 0||n.search(e)}}class PV extends kn{constructor(e){super(),this.name=e}get astNodeType(){return"enable"}}class NV extends kn{constructor(e){super(),this.extensions=e}get astNodeType(){return"requires"}}class IV extends kn{constructor(e,n){super(),this.severity=e,this.rule=n}get astNodeType(){return"diagnostic"}}class mM extends kn{constructor(e,n){super(),this.name=e,this.type=n}get astNodeType(){return"alias"}}class DV extends kn{constructor(){super()}get astNodeType(){return"discard"}}class FV extends kn{constructor(){super()}get astNodeType(){return"break"}}class kV extends kn{constructor(){super()}get astNodeType(){return"continue"}}class Zo extends kn{constructor(e){super(),this.name=e}get astNodeType(){return"type"}get isStruct(){return!1}get isArray(){return!1}}class go extends Zo{constructor(e,n,r,i){super(e),this.members=n,this.startLine=r,this.endLine=i}get astNodeType(){return"struct"}get isStruct(){return!0}getMemberIndex(e){for(let n=0;n":return this.left.evaluate(e)>this.right.evaluate(e)?1:0;case"<=":return this.left.evaluate(e)<=this.right.evaluate(e)?1:0;case">=":return this.left.evaluate(e)>=this.right.evaluate(e)?1:0;case"&&":return this.left.evaluate(e)&&this.right.evaluate(e)?1:0;case"||":return this.left.evaluate(e)||this.right.evaluate(e)?1:0;default:throw new Error(`Unknown operator ${this.operator}`)}}search(e){this.left.search(e),this.right.search(e)}}class SM extends qs{constructor(){super()}}class VV extends SM{constructor(e,n){super(),this.selector=e,this.body=n}get astNodeType(){return"case"}search(e){this.searchBlock(this.body,e)}}class HV extends SM{constructor(e){super(),this.body=e}get astNodeType(){return"default"}search(e){this.searchBlock(this.body,e)}}class jV extends qs{constructor(e,n,r){super(),this.name=e,this.type=n,this.attributes=r}get astNodeType(){return"argument"}}class WV extends qs{constructor(e,n){super(),this.condition=e,this.body=n}get astNodeType(){return"elseif"}search(e){this.condition.search(e),this.searchBlock(this.body,e)}}class XV extends qs{constructor(e,n,r){super(),this.name=e,this.type=n,this.attributes=r}get astNodeType(){return"member"}}let qV=class extends qs{constructor(e,n){super(),this.name=e,this.value=n}get astNodeType(){return"attribute"}};var oe,te;(function(t){t[t.token=0]="token",t[t.keyword=1]="keyword",t[t.reserved=2]="reserved"})(te||(te={}));class ne{constructor(e,n,r){this.name=e,this.type=n,this.rule=r}toString(){return this.name}}class k{}oe=k;k.none=new ne("",te.reserved,"");k.eof=new ne("EOF",te.token,"");k.reserved={asm:new ne("asm",te.reserved,"asm"),bf16:new ne("bf16",te.reserved,"bf16"),do:new ne("do",te.reserved,"do"),enum:new ne("enum",te.reserved,"enum"),f16:new ne("f16",te.reserved,"f16"),f64:new ne("f64",te.reserved,"f64"),handle:new ne("handle",te.reserved,"handle"),i8:new ne("i8",te.reserved,"i8"),i16:new ne("i16",te.reserved,"i16"),i64:new ne("i64",te.reserved,"i64"),mat:new ne("mat",te.reserved,"mat"),premerge:new ne("premerge",te.reserved,"premerge"),regardless:new ne("regardless",te.reserved,"regardless"),typedef:new ne("typedef",te.reserved,"typedef"),u8:new ne("u8",te.reserved,"u8"),u16:new ne("u16",te.reserved,"u16"),u64:new ne("u64",te.reserved,"u64"),unless:new ne("unless",te.reserved,"unless"),using:new ne("using",te.reserved,"using"),vec:new ne("vec",te.reserved,"vec"),void:new ne("void",te.reserved,"void")};k.keywords={array:new ne("array",te.keyword,"array"),atomic:new ne("atomic",te.keyword,"atomic"),bool:new ne("bool",te.keyword,"bool"),f32:new ne("f32",te.keyword,"f32"),i32:new ne("i32",te.keyword,"i32"),mat2x2:new ne("mat2x2",te.keyword,"mat2x2"),mat2x3:new ne("mat2x3",te.keyword,"mat2x3"),mat2x4:new ne("mat2x4",te.keyword,"mat2x4"),mat3x2:new ne("mat3x2",te.keyword,"mat3x2"),mat3x3:new ne("mat3x3",te.keyword,"mat3x3"),mat3x4:new ne("mat3x4",te.keyword,"mat3x4"),mat4x2:new ne("mat4x2",te.keyword,"mat4x2"),mat4x3:new ne("mat4x3",te.keyword,"mat4x3"),mat4x4:new ne("mat4x4",te.keyword,"mat4x4"),ptr:new ne("ptr",te.keyword,"ptr"),sampler:new ne("sampler",te.keyword,"sampler"),sampler_comparison:new ne("sampler_comparison",te.keyword,"sampler_comparison"),struct:new ne("struct",te.keyword,"struct"),texture_1d:new ne("texture_1d",te.keyword,"texture_1d"),texture_2d:new ne("texture_2d",te.keyword,"texture_2d"),texture_2d_array:new ne("texture_2d_array",te.keyword,"texture_2d_array"),texture_3d:new ne("texture_3d",te.keyword,"texture_3d"),texture_cube:new ne("texture_cube",te.keyword,"texture_cube"),texture_cube_array:new ne("texture_cube_array",te.keyword,"texture_cube_array"),texture_multisampled_2d:new ne("texture_multisampled_2d",te.keyword,"texture_multisampled_2d"),texture_storage_1d:new ne("texture_storage_1d",te.keyword,"texture_storage_1d"),texture_storage_2d:new ne("texture_storage_2d",te.keyword,"texture_storage_2d"),texture_storage_2d_array:new ne("texture_storage_2d_array",te.keyword,"texture_storage_2d_array"),texture_storage_3d:new ne("texture_storage_3d",te.keyword,"texture_storage_3d"),texture_depth_2d:new ne("texture_depth_2d",te.keyword,"texture_depth_2d"),texture_depth_2d_array:new ne("texture_depth_2d_array",te.keyword,"texture_depth_2d_array"),texture_depth_cube:new ne("texture_depth_cube",te.keyword,"texture_depth_cube"),texture_depth_cube_array:new ne("texture_depth_cube_array",te.keyword,"texture_depth_cube_array"),texture_depth_multisampled_2d:new ne("texture_depth_multisampled_2d",te.keyword,"texture_depth_multisampled_2d"),texture_external:new ne("texture_external",te.keyword,"texture_external"),u32:new ne("u32",te.keyword,"u32"),vec2:new ne("vec2",te.keyword,"vec2"),vec3:new ne("vec3",te.keyword,"vec3"),vec4:new ne("vec4",te.keyword,"vec4"),bitcast:new ne("bitcast",te.keyword,"bitcast"),block:new ne("block",te.keyword,"block"),break:new ne("break",te.keyword,"break"),case:new ne("case",te.keyword,"case"),continue:new ne("continue",te.keyword,"continue"),continuing:new ne("continuing",te.keyword,"continuing"),default:new ne("default",te.keyword,"default"),diagnostic:new ne("diagnostic",te.keyword,"diagnostic"),discard:new ne("discard",te.keyword,"discard"),else:new ne("else",te.keyword,"else"),enable:new ne("enable",te.keyword,"enable"),fallthrough:new ne("fallthrough",te.keyword,"fallthrough"),false:new ne("false",te.keyword,"false"),fn:new ne("fn",te.keyword,"fn"),for:new ne("for",te.keyword,"for"),function:new ne("function",te.keyword,"function"),if:new ne("if",te.keyword,"if"),let:new ne("let",te.keyword,"let"),const:new ne("const",te.keyword,"const"),loop:new ne("loop",te.keyword,"loop"),while:new ne("while",te.keyword,"while"),private:new ne("private",te.keyword,"private"),read:new ne("read",te.keyword,"read"),read_write:new ne("read_write",te.keyword,"read_write"),return:new ne("return",te.keyword,"return"),requires:new ne("requires",te.keyword,"requires"),storage:new ne("storage",te.keyword,"storage"),switch:new ne("switch",te.keyword,"switch"),true:new ne("true",te.keyword,"true"),alias:new ne("alias",te.keyword,"alias"),type:new ne("type",te.keyword,"type"),uniform:new ne("uniform",te.keyword,"uniform"),var:new ne("var",te.keyword,"var"),override:new ne("override",te.keyword,"override"),workgroup:new ne("workgroup",te.keyword,"workgroup"),write:new ne("write",te.keyword,"write"),r8unorm:new ne("r8unorm",te.keyword,"r8unorm"),r8snorm:new ne("r8snorm",te.keyword,"r8snorm"),r8uint:new ne("r8uint",te.keyword,"r8uint"),r8sint:new ne("r8sint",te.keyword,"r8sint"),r16uint:new ne("r16uint",te.keyword,"r16uint"),r16sint:new ne("r16sint",te.keyword,"r16sint"),r16float:new ne("r16float",te.keyword,"r16float"),rg8unorm:new ne("rg8unorm",te.keyword,"rg8unorm"),rg8snorm:new ne("rg8snorm",te.keyword,"rg8snorm"),rg8uint:new ne("rg8uint",te.keyword,"rg8uint"),rg8sint:new ne("rg8sint",te.keyword,"rg8sint"),r32uint:new ne("r32uint",te.keyword,"r32uint"),r32sint:new ne("r32sint",te.keyword,"r32sint"),r32float:new ne("r32float",te.keyword,"r32float"),rg16uint:new ne("rg16uint",te.keyword,"rg16uint"),rg16sint:new ne("rg16sint",te.keyword,"rg16sint"),rg16float:new ne("rg16float",te.keyword,"rg16float"),rgba8unorm:new ne("rgba8unorm",te.keyword,"rgba8unorm"),rgba8unorm_srgb:new ne("rgba8unorm_srgb",te.keyword,"rgba8unorm_srgb"),rgba8snorm:new ne("rgba8snorm",te.keyword,"rgba8snorm"),rgba8uint:new ne("rgba8uint",te.keyword,"rgba8uint"),rgba8sint:new ne("rgba8sint",te.keyword,"rgba8sint"),bgra8unorm:new ne("bgra8unorm",te.keyword,"bgra8unorm"),bgra8unorm_srgb:new ne("bgra8unorm_srgb",te.keyword,"bgra8unorm_srgb"),rgb10a2unorm:new ne("rgb10a2unorm",te.keyword,"rgb10a2unorm"),rg11b10float:new ne("rg11b10float",te.keyword,"rg11b10float"),rg32uint:new ne("rg32uint",te.keyword,"rg32uint"),rg32sint:new ne("rg32sint",te.keyword,"rg32sint"),rg32float:new ne("rg32float",te.keyword,"rg32float"),rgba16uint:new ne("rgba16uint",te.keyword,"rgba16uint"),rgba16sint:new ne("rgba16sint",te.keyword,"rgba16sint"),rgba16float:new ne("rgba16float",te.keyword,"rgba16float"),rgba32uint:new ne("rgba32uint",te.keyword,"rgba32uint"),rgba32sint:new ne("rgba32sint",te.keyword,"rgba32sint"),rgba32float:new ne("rgba32float",te.keyword,"rgba32float"),static_assert:new ne("static_assert",te.keyword,"static_assert")};k.tokens={decimal_float_literal:new ne("decimal_float_literal",te.token,/((-?[0-9]*\.[0-9]+|-?[0-9]+\.[0-9]*)((e|E)(\+|-)?[0-9]+)?f?)|(-?[0-9]+(e|E)(\+|-)?[0-9]+f?)|(-?[0-9]+f)/),hex_float_literal:new ne("hex_float_literal",te.token,/-?0x((([0-9a-fA-F]*\.[0-9a-fA-F]+|[0-9a-fA-F]+\.[0-9a-fA-F]*)((p|P)(\+|-)?[0-9]+f?)?)|([0-9a-fA-F]+(p|P)(\+|-)?[0-9]+f?))/),int_literal:new ne("int_literal",te.token,/-?0x[0-9a-fA-F]+|0i?|-?[1-9][0-9]*i?/),uint_literal:new ne("uint_literal",te.token,/0x[0-9a-fA-F]+u|0u|[1-9][0-9]*u/),ident:new ne("ident",te.token,/[_a-zA-Z][0-9a-zA-Z_]*/),and:new ne("and",te.token,"&"),and_and:new ne("and_and",te.token,"&&"),arrow:new ne("arrow ",te.token,"->"),attr:new ne("attr",te.token,"@"),forward_slash:new ne("forward_slash",te.token,"/"),bang:new ne("bang",te.token,"!"),bracket_left:new ne("bracket_left",te.token,"["),bracket_right:new ne("bracket_right",te.token,"]"),brace_left:new ne("brace_left",te.token,"{"),brace_right:new ne("brace_right",te.token,"}"),colon:new ne("colon",te.token,":"),comma:new ne("comma",te.token,","),equal:new ne("equal",te.token,"="),equal_equal:new ne("equal_equal",te.token,"=="),not_equal:new ne("not_equal",te.token,"!="),greater_than:new ne("greater_than",te.token,">"),greater_than_equal:new ne("greater_than_equal",te.token,">="),shift_right:new ne("shift_right",te.token,">>"),less_than:new ne("less_than",te.token,"<"),less_than_equal:new ne("less_than_equal",te.token,"<="),shift_left:new ne("shift_left",te.token,"<<"),modulo:new ne("modulo",te.token,"%"),minus:new ne("minus",te.token,"-"),minus_minus:new ne("minus_minus",te.token,"--"),period:new ne("period",te.token,"."),plus:new ne("plus",te.token,"+"),plus_plus:new ne("plus_plus",te.token,"++"),or:new ne("or",te.token,"|"),or_or:new ne("or_or",te.token,"||"),paren_left:new ne("paren_left",te.token,"("),paren_right:new ne("paren_right",te.token,")"),semicolon:new ne("semicolon",te.token,";"),star:new ne("star",te.token,"*"),tilde:new ne("tilde",te.token,"~"),underscore:new ne("underscore",te.token,"_"),xor:new ne("xor",te.token,"^"),plus_equal:new ne("plus_equal",te.token,"+="),minus_equal:new ne("minus_equal",te.token,"-="),times_equal:new ne("times_equal",te.token,"*="),division_equal:new ne("division_equal",te.token,"/="),modulo_equal:new ne("modulo_equal",te.token,"%="),and_equal:new ne("and_equal",te.token,"&="),or_equal:new ne("or_equal",te.token,"|="),xor_equal:new ne("xor_equal",te.token,"^="),shift_right_equal:new ne("shift_right_equal",te.token,">>="),shift_left_equal:new ne("shift_left_equal",te.token,"<<=")};k.simpleTokens={"@":oe.tokens.attr,"{":oe.tokens.brace_left,"}":oe.tokens.brace_right,":":oe.tokens.colon,",":oe.tokens.comma,"(":oe.tokens.paren_left,")":oe.tokens.paren_right,";":oe.tokens.semicolon};k.literalTokens={"&":oe.tokens.and,"&&":oe.tokens.and_and,"->":oe.tokens.arrow,"/":oe.tokens.forward_slash,"!":oe.tokens.bang,"[":oe.tokens.bracket_left,"]":oe.tokens.bracket_right,"=":oe.tokens.equal,"==":oe.tokens.equal_equal,"!=":oe.tokens.not_equal,">":oe.tokens.greater_than,">=":oe.tokens.greater_than_equal,">>":oe.tokens.shift_right,"<":oe.tokens.less_than,"<=":oe.tokens.less_than_equal,"<<":oe.tokens.shift_left,"%":oe.tokens.modulo,"-":oe.tokens.minus,"--":oe.tokens.minus_minus,".":oe.tokens.period,"+":oe.tokens.plus,"++":oe.tokens.plus_plus,"|":oe.tokens.or,"||":oe.tokens.or_or,"*":oe.tokens.star,"~":oe.tokens.tilde,_:oe.tokens.underscore,"^":oe.tokens.xor,"+=":oe.tokens.plus_equal,"-=":oe.tokens.minus_equal,"*=":oe.tokens.times_equal,"/=":oe.tokens.division_equal,"%=":oe.tokens.modulo_equal,"&=":oe.tokens.and_equal,"|=":oe.tokens.or_equal,"^=":oe.tokens.xor_equal,">>=":oe.tokens.shift_right_equal,"<<=":oe.tokens.shift_left_equal};k.regexTokens={decimal_float_literal:oe.tokens.decimal_float_literal,hex_float_literal:oe.tokens.hex_float_literal,int_literal:oe.tokens.int_literal,uint_literal:oe.tokens.uint_literal,ident:oe.tokens.ident};k.storage_class=[oe.keywords.function,oe.keywords.private,oe.keywords.workgroup,oe.keywords.uniform,oe.keywords.storage];k.access_mode=[oe.keywords.read,oe.keywords.write,oe.keywords.read_write];k.sampler_type=[oe.keywords.sampler,oe.keywords.sampler_comparison];k.sampled_texture_type=[oe.keywords.texture_1d,oe.keywords.texture_2d,oe.keywords.texture_2d_array,oe.keywords.texture_3d,oe.keywords.texture_cube,oe.keywords.texture_cube_array];k.multisampled_texture_type=[oe.keywords.texture_multisampled_2d];k.storage_texture_type=[oe.keywords.texture_storage_1d,oe.keywords.texture_storage_2d,oe.keywords.texture_storage_2d_array,oe.keywords.texture_storage_3d];k.depth_texture_type=[oe.keywords.texture_depth_2d,oe.keywords.texture_depth_2d_array,oe.keywords.texture_depth_cube,oe.keywords.texture_depth_cube_array,oe.keywords.texture_depth_multisampled_2d];k.texture_external_type=[oe.keywords.texture_external];k.any_texture_type=[...oe.sampled_texture_type,...oe.multisampled_texture_type,...oe.storage_texture_type,...oe.depth_texture_type,...oe.texture_external_type];k.texel_format=[oe.keywords.r8unorm,oe.keywords.r8snorm,oe.keywords.r8uint,oe.keywords.r8sint,oe.keywords.r16uint,oe.keywords.r16sint,oe.keywords.r16float,oe.keywords.rg8unorm,oe.keywords.rg8snorm,oe.keywords.rg8uint,oe.keywords.rg8sint,oe.keywords.r32uint,oe.keywords.r32sint,oe.keywords.r32float,oe.keywords.rg16uint,oe.keywords.rg16sint,oe.keywords.rg16float,oe.keywords.rgba8unorm,oe.keywords.rgba8unorm_srgb,oe.keywords.rgba8snorm,oe.keywords.rgba8uint,oe.keywords.rgba8sint,oe.keywords.bgra8unorm,oe.keywords.bgra8unorm_srgb,oe.keywords.rgb10a2unorm,oe.keywords.rg11b10float,oe.keywords.rg32uint,oe.keywords.rg32sint,oe.keywords.rg32float,oe.keywords.rgba16uint,oe.keywords.rgba16sint,oe.keywords.rgba16float,oe.keywords.rgba32uint,oe.keywords.rgba32sint,oe.keywords.rgba32float];k.const_literal=[oe.tokens.int_literal,oe.tokens.uint_literal,oe.tokens.decimal_float_literal,oe.tokens.hex_float_literal,oe.keywords.true,oe.keywords.false];k.literal_or_ident=[oe.tokens.ident,oe.tokens.int_literal,oe.tokens.uint_literal,oe.tokens.decimal_float_literal,oe.tokens.hex_float_literal];k.element_count_expression=[oe.tokens.int_literal,oe.tokens.uint_literal,oe.tokens.ident];k.template_types=[oe.keywords.vec2,oe.keywords.vec3,oe.keywords.vec4,oe.keywords.mat2x2,oe.keywords.mat2x3,oe.keywords.mat2x4,oe.keywords.mat3x2,oe.keywords.mat3x3,oe.keywords.mat3x4,oe.keywords.mat4x2,oe.keywords.mat4x3,oe.keywords.mat4x4,oe.keywords.atomic,oe.keywords.bitcast,...oe.any_texture_type];k.attribute_name=[oe.tokens.ident,oe.keywords.block,oe.keywords.diagnostic];k.assignment_operators=[oe.tokens.equal,oe.tokens.plus_equal,oe.tokens.minus_equal,oe.tokens.times_equal,oe.tokens.division_equal,oe.tokens.modulo_equal,oe.tokens.and_equal,oe.tokens.or_equal,oe.tokens.xor_equal,oe.tokens.shift_right_equal,oe.tokens.shift_left_equal];k.increment_operators=[oe.tokens.plus_plus,oe.tokens.minus_minus];class t2{constructor(e,n,r){this.type=e,this.lexeme=n,this.line=r}toString(){return this.lexeme}isTemplateType(){return k.template_types.indexOf(this.type)!=-1}isArrayType(){return this.type==k.keywords.array}isArrayOrTemplateType(){return this.isArrayType()||this.isTemplateType()}}class YV{constructor(e){this._tokens=[],this._start=0,this._current=0,this._line=1,this._source=e??""}scanTokens(){for(;!this._isAtEnd();)if(this._start=this._current,!this.scanToken())throw`Invalid syntax at line ${this._line}`;return this._tokens.push(new t2(k.eof,"",this._line)),this._tokens}scanToken(){let e=this._advance();if(e==` -`)return this._line++,!0;if(this._isWhitespace(e))return!0;if(e=="/"){if(this._peekAhead()=="/"){for(;e!=` -`;){if(this._isAtEnd())return!0;e=this._advance()}return this._line++,!0}else if(this._peekAhead()=="*"){this._advance();let l=1;for(;l>0;){if(this._isAtEnd())return!0;if(e=this._advance(),e==` -`)this._line++;else if(e=="*"){if(this._peekAhead()=="/"&&(this._advance(),l--,l==0))return!0}else e=="/"&&this._peekAhead()=="*"&&(this._advance(),l++)}return!0}}const n=k.simpleTokens[e];if(n)return this._addToken(n),!0;let r=k.none;const i=this._isAlpha(e),a=e==="_";if(this._isAlphaNumeric(e)){let l=this._peekAhead();for(;this._isAlphaNumeric(l);)e+=this._advance(),l=this._peekAhead()}if(i){const l=k.keywords[e];if(l)return this._addToken(l),!0}if(i||a)return this._addToken(k.tokens.ident),!0;for(;;){let l=this._findType(e);const u=this._peekAhead();if(e=="-"&&this._tokens.length>0){if(u=="=")return this._current++,e+=u,this._addToken(k.tokens.minus_equal),!0;if(u=="-")return this._current++,e+=u,this._addToken(k.tokens.minus_minus),!0;const f=this._tokens.length-1;if((k.literal_or_ident.indexOf(this._tokens[f].type)!=-1||this._tokens[f].type==k.tokens.paren_right)&&u!=">")return this._addToken(l),!0}if(e==">"&&(u==">"||u=="=")){let f=!1,h=this._tokens.length-1;for(let g=0;g<5&&h>=0&&k.assignment_operators.indexOf(this._tokens[h].type)===-1;++g,--h)if(this._tokens[h].type===k.tokens.less_than){h>0&&this._tokens[h-1].isArrayOrTemplateType()&&(f=!0);break}if(f)return this._addToken(l),!0}if(l===k.none){let f=e,h=0;const g=2;for(let m=0;m=this._source.length}_isAlpha(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"}_isAlphaNumeric(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||e=="_"||e>="0"&&e<="9"}_isWhitespace(e){return e==" "||e==" "||e=="\r"}_advance(e=0){let n=this._source[this._current];return e=e||0,e++,this._current+=e,n}_peekAhead(e=0){return e=e||0,this._current+e>=this._source.length?"\0":this._source[this._current+e]}_addToken(e){const n=this._source.substring(this._start,this._current);this._tokens.push(new t2(e,n,this._line))}}class KV{constructor(){this._tokens=[],this._current=0,this._currentLine=0,this._context=new bV,this._deferArrayCountEval=[]}parse(e){this._initialize(e),this._deferArrayCountEval.length=0;const n=[];for(;!this._isAtEnd();){const r=this._global_decl_or_directive();if(!r)break;n.push(r)}if(this._deferArrayCountEval.length>0){for(const r of this._deferArrayCountEval){const i=r.arrayType,a=r.countNode;if(a instanceof Y_){const u=a.name,f=this._context.constants.get(u);if(f)try{const h=f.evaluate(this._context);i.count=h}catch{}}}this._deferArrayCountEval.length=0}return n}_initialize(e){if(e)if(typeof e=="string"){const n=new YV(e);this._tokens=n.scanTokens()}else this._tokens=e;else this._tokens=[];this._current=0}_error(e,n){return{token:e,message:n,toString:function(){return`${n}`}}}_isAtEnd(){return this._current>=this._tokens.length||this._peek().type==k.eof}_match(e){if(e instanceof ne)return this._check(e)?(this._advance(),!0):!1;for(let n=0,r=e.length;n'.");const i=this._paren_expression();return new LV(r,i)}const e=this._type_decl(),n=this._argument_expression_list();return new ql(e,n)}_argument_expression_list(){if(!this._match(k.tokens.paren_left))return null;const e=[];do{if(this._check(k.tokens.paren_right))break;const n=this._short_circuit_or_expression();e.push(n)}while(this._match(k.tokens.comma));return this._consume(k.tokens.paren_right,"Expected ')' for agument list"),e}_optional_paren_expression(){this._match(k.tokens.paren_left);const e=this._short_circuit_or_expression();return this._match(k.tokens.paren_right),new e2([e])}_paren_expression(){this._consume(k.tokens.paren_left,"Expected '('.");const e=this._short_circuit_or_expression();return this._consume(k.tokens.paren_right,"Expected ')'."),new e2([e])}_struct_decl(){if(!this._match(k.keywords.struct))return null;const e=this._currentLine,n=this._consume(k.tokens.ident,"Expected name for struct.").toString();this._consume(k.tokens.brace_left,"Expected '{' for struct body.");const r=[];for(;!this._check(k.tokens.brace_right);){const l=this._attribute(),u=this._consume(k.tokens.ident,"Expected variable name.").toString();this._consume(k.tokens.colon,"Expected ':' for struct member type.");const f=this._attribute(),h=this._type_decl();h!=null&&(h.attributes=f),this._check(k.tokens.brace_right)?this._match(k.tokens.comma):this._consume(k.tokens.comma,"Expected ',' for struct member."),r.push(new XV(u,h,l))}this._consume(k.tokens.brace_right,"Expected '}' after struct body.");const i=this._currentLine,a=new go(n,r,e,i);return this._context.structs.set(n,a),a}_global_variable_decl(){const e=this._variable_decl();return e&&this._match(k.tokens.equal)&&(e.value=this._const_expression()),e}_override_variable_decl(){const e=this._override_decl();return e&&this._match(k.tokens.equal)&&(e.value=this._const_expression()),e}_global_const_decl(){if(!this._match(k.keywords.const))return null;const e=this._consume(k.tokens.ident,"Expected variable name");let n=null;if(this._match(k.tokens.colon)){const a=this._attribute();n=this._type_decl(),n!=null&&(n.attributes=a)}let r=null;if(this._match(k.tokens.equal)){const a=this._short_circuit_or_expression();if(a instanceof ql)r=a;else if(a instanceof GC&&a.initializer instanceof ql)r=a.initializer;else try{const l=a.evaluate(this._context);r=new JC(l)}catch{r=a}}const i=new QC(e.toString(),n,"","",r);return this._context.constants.set(i.name,i),i}_global_let_decl(){if(!this._match(k.keywords.let))return null;const e=this._consume(k.tokens.ident,"Expected variable name");let n=null;if(this._match(k.tokens.colon)){const i=this._attribute();n=this._type_decl(),n!=null&&(n.attributes=i)}let r=null;return this._match(k.tokens.equal)&&(r=this._const_expression()),new q_(e.toString(),n,"","",r)}_const_expression(){return this._short_circuit_or_expression()}_variable_decl(){if(!this._match(k.keywords.var))return null;let e="",n="";this._match(k.tokens.less_than)&&(e=this._consume(k.storage_class,"Expected storage_class.").toString(),this._match(k.tokens.comma)&&(n=this._consume(k.access_mode,"Expected access_mode.").toString()),this._consume(k.tokens.greater_than,"Expected '>'."));const r=this._consume(k.tokens.ident,"Expected variable name");let i=null;if(this._match(k.tokens.colon)){const a=this._attribute();i=this._type_decl(),i!=null&&(i.attributes=a)}return new _o(r.toString(),i,e,n,null)}_override_decl(){if(!this._match(k.keywords.override))return null;const e=this._consume(k.tokens.ident,"Expected variable name");let n=null;if(this._match(k.tokens.colon)){const r=this._attribute();n=this._type_decl(),n!=null&&(n.attributes=r)}return new gM(e.toString(),n,null)}_diagnostic(){this._consume(k.tokens.paren_left,"Expected '('");const e=this._consume(k.tokens.ident,"Expected severity control name.");this._consume(k.tokens.comma,"Expected ','");const n=this._consume(k.tokens.ident,"Expected diagnostic rule name.");return this._consume(k.tokens.paren_right,"Expected ')'"),new IV(e.toString(),n.toString())}_enable_directive(){const e=this._consume(k.tokens.ident,"identity expected.");return new PV(e.toString())}_requires_directive(){const e=[this._consume(k.tokens.ident,"identity expected.").toString()];for(;this._match(k.tokens.comma);){const n=this._consume(k.tokens.ident,"identity expected.");e.push(n.toString())}return new NV(e)}_type_alias(){const e=this._consume(k.tokens.ident,"identity expected.");this._consume(k.tokens.equal,"Expected '=' for type alias.");let n=this._type_decl();if(n===null)throw this._error(this._peek(),"Expected Type for Alias.");this._context.aliases.has(n.name)&&(n=this._context.aliases.get(n.name).type);const r=new mM(e.toString(),n);return this._context.aliases.set(r.name,r),r}_type_decl(){if(this._check([k.tokens.ident,...k.texel_format,k.keywords.bool,k.keywords.f32,k.keywords.i32,k.keywords.u32])){const r=this._advance(),i=r.toString();return this._context.structs.has(i)?this._context.structs.get(i):this._context.aliases.has(i)?this._context.aliases.get(i).type:new Zo(r.toString())}let e=this._texture_sampler_types();if(e)return e;if(this._check(k.template_types)){let r=this._advance().toString(),i=null,a=null;return this._match(k.tokens.less_than)&&(i=this._type_decl(),a=null,this._match(k.tokens.comma)&&(a=this._consume(k.access_mode,"Expected access_mode for pointer").toString()),this._consume(k.tokens.greater_than,"Expected '>' for type.")),new vM(r,i,a)}if(this._match(k.keywords.ptr)){let r=this._previous().toString();this._consume(k.tokens.less_than,"Expected '<' for pointer.");const i=this._consume(k.storage_class,"Expected storage_class for pointer");this._consume(k.tokens.comma,"Expected ',' for pointer.");const a=this._type_decl();let l=null;return this._match(k.tokens.comma)&&(l=this._consume(k.access_mode,"Expected access_mode for pointer").toString()),this._consume(k.tokens.greater_than,"Expected '>' for pointer."),new BV(r,i.toString(),a,l)}const n=this._attribute();if(this._match(k.keywords.array)){let r=null,i=-1;const a=this._previous();let l=null;if(this._match(k.tokens.less_than)){r=this._type_decl(),this._context.aliases.has(r.name)&&(r=this._context.aliases.get(r.name).type);let f="";if(this._match(k.tokens.comma)){l=this._shift_expression();try{f=l.evaluate(this._context).toString(),l=null}catch{f="1"}}this._consume(k.tokens.greater_than,"Expected '>' for array."),i=f?parseInt(f):0}const u=new _M(a.toString(),n,r,i);return l&&this._deferArrayCountEval.push({arrayType:u,countNode:l}),u}return null}_texture_sampler_types(){if(this._match(k.sampler_type))return new qu(this._previous().toString(),null,null);if(this._match(k.depth_texture_type))return new qu(this._previous().toString(),null,null);if(this._match(k.sampled_texture_type)||this._match(k.multisampled_texture_type)){const e=this._previous();this._consume(k.tokens.less_than,"Expected '<' for sampler type.");const n=this._type_decl();return this._consume(k.tokens.greater_than,"Expected '>' for sampler type."),new qu(e.toString(),n,null)}if(this._match(k.storage_texture_type)){const e=this._previous();this._consume(k.tokens.less_than,"Expected '<' for sampler type.");const n=this._consume(k.texel_format,"Invalid texel format.").toString();this._consume(k.tokens.comma,"Expected ',' after texel format.");const r=this._consume(k.access_mode,"Expected access mode for storage texture type.").toString();return this._consume(k.tokens.greater_than,"Expected '>' for sampler type."),new qu(e.toString(),n,r)}return null}_attribute(){let e=[];for(;this._match(k.tokens.attr);){const n=this._consume(k.attribute_name,"Expected attribute name"),r=new qV(n.toString(),null);if(this._match(k.tokens.paren_left)){if(r.value=this._consume(k.literal_or_ident,"Expected attribute value").toString(),this._check(k.tokens.comma)){this._advance();do{const i=this._consume(k.literal_or_ident,"Expected attribute value").toString();r.value instanceof Array||(r.value=[r.value]),r.value.push(i)}while(this._match(k.tokens.comma))}this._consume(k.tokens.paren_right,"Expected ')'")}e.push(r)}return e.length==0?null:e}}class nc{constructor(e,n){this.name=e,this.attributes=n,this.size=0}get isArray(){return!1}get isStruct(){return!1}get isTemplate(){return!1}}class n2{constructor(e,n,r){this.name=e,this.type=n,this.attributes=r,this.offset=0,this.size=0}get isArray(){return this.type.isArray}get isStruct(){return this.type.isStruct}get isTemplate(){return this.type.isTemplate}get align(){return this.type.isStruct?this.type.align:0}get members(){return this.type.isStruct?this.type.members:null}get format(){return this.type.isArray?this.type.format:this.type.isTemplate?this.type.format:null}get count(){return this.type.isArray?this.type.count:0}get stride(){return this.type.isArray?this.type.stride:this.size}}class _h extends nc{constructor(e,n){super(e,n),this.members=[],this.align=0,this.startLine=-1,this.endLine=-1,this.inUse=!1}get isStruct(){return!0}}class Zv extends nc{constructor(e,n){super(e,n),this.count=0,this.stride=0}get isArray(){return!0}}class r2 extends nc{constructor(e,n,r,i){super(e,r),this.format=n,this.access=i}get isTemplate(){return!0}}var Ea;(function(t){t[t.Uniform=0]="Uniform",t[t.Storage=1]="Storage",t[t.Texture=2]="Texture",t[t.Sampler=3]="Sampler",t[t.StorageTexture=4]="StorageTexture"})(Ea||(Ea={}));class yh{constructor(e,n,r,i,a,l,u){this.name=e,this.type=n,this.group=r,this.binding=i,this.attributes=a,this.resourceType=l,this.access=u}get isArray(){return this.type.isArray}get isStruct(){return this.type.isStruct}get isTemplate(){return this.type.isTemplate}get size(){return this.type.size}get align(){return this.type.isStruct?this.type.align:0}get members(){return this.type.isStruct?this.type.members:null}get format(){return this.type.isArray?this.type.format:this.type.isTemplate?this.type.format:null}get count(){return this.type.isArray?this.type.count:0}get stride(){return this.type.isArray?this.type.stride:this.size}}class ZV{constructor(e,n){this.name=e,this.type=n}}class bh{constructor(e,n){this.align=e,this.size=n}}class QV{constructor(e,n,r,i){this.name=e,this.type=n,this.locationType=r,this.location=i,this.interpolation=null}}class i2{constructor(e,n,r,i){this.name=e,this.type=n,this.locationType=r,this.location=i}}class GV{constructor(e,n,r,i){this.name=e,this.type=n,this.attributes=r,this.id=i}}class JV{constructor(e,n){this.name=e,this.type=n}}class eH{constructor(e,n=null){this.stage=null,this.inputs=[],this.outputs=[],this.arguments=[],this.returnType=null,this.resources=[],this.overrides=[],this.startLine=-1,this.endLine=-1,this.inUse=!1,this.calls=new Set,this.name=e,this.stage=n}}class tH{constructor(){this.vertex=[],this.fragment=[],this.compute=[]}}class nH{constructor(e){this.resources=null,this.inUse=!1,this.info=null,this.node=e}}class Vs{constructor(e){this.uniforms=[],this.storage=[],this.textures=[],this.samplers=[],this.aliases=[],this.overrides=[],this.structs=[],this.entry=new tH,this.functions=[],this._types=new Map,this._functions=new Map,e&&this.update(e)}_isStorageTexture(e){return e.name=="texture_storage_1d"||e.name=="texture_storage_2d"||e.name=="texture_storage_2d_array"||e.name=="texture_storage_3d"}update(e){const r=new KV().parse(e);for(const i of r)i instanceof X_&&this._functions.set(i.name,new nH(i));for(const i of r)if(i instanceof go){const a=this._getTypeInfo(i,null);a instanceof _h&&this.structs.push(a)}for(const i of r){if(i instanceof mM){this.aliases.push(this._getAliasInfo(i));continue}if(i instanceof gM){const a=i,l=this._getAttributeNum(a.attributes,"id",0),u=a.type!=null?this._getTypeInfo(a.type,a.attributes):null;this.overrides.push(new GV(a.name,u,a.attributes,l));continue}if(this._isUniformVar(i)){const a=i,l=this._getAttributeNum(a.attributes,"group",0),u=this._getAttributeNum(a.attributes,"binding",0),f=this._getTypeInfo(a.type,a.attributes),h=new yh(a.name,f,l,u,a.attributes,Ea.Uniform,a.access);this.uniforms.push(h);continue}if(this._isStorageVar(i)){const a=i,l=this._getAttributeNum(a.attributes,"group",0),u=this._getAttributeNum(a.attributes,"binding",0),f=this._getTypeInfo(a.type,a.attributes),h=this._isStorageTexture(f),g=new yh(a.name,f,l,u,a.attributes,h?Ea.StorageTexture:Ea.Storage,a.access);this.storage.push(g);continue}if(this._isTextureVar(i)){const a=i,l=this._getAttributeNum(a.attributes,"group",0),u=this._getAttributeNum(a.attributes,"binding",0),f=this._getTypeInfo(a.type,a.attributes),h=this._isStorageTexture(f),g=new yh(a.name,f,l,u,a.attributes,h?Ea.StorageTexture:Ea.Texture,a.access);h?this.storage.push(g):this.textures.push(g);continue}if(this._isSamplerVar(i)){const a=i,l=this._getAttributeNum(a.attributes,"group",0),u=this._getAttributeNum(a.attributes,"binding",0),f=this._getTypeInfo(a.type,a.attributes),h=new yh(a.name,f,l,u,a.attributes,Ea.Sampler,a.access);this.samplers.push(h);continue}if(i instanceof X_){const a=this._getAttribute(i,"vertex"),l=this._getAttribute(i,"fragment"),u=this._getAttribute(i,"compute"),f=a||l||u,h=new eH(i.name,f==null?void 0:f.name);h.startLine=i.startLine,h.endLine=i.endLine,this.functions.push(h),this._functions.get(i.name).info=h,f&&(this._functions.get(i.name).inUse=!0,h.inUse=!0,h.resources=this._findResources(i,!!f),h.inputs=this._getInputs(i.args),h.outputs=this._getOutputs(i.returnType),this.entry[f.name].push(h)),h.arguments=i.args.map(g=>new JV(g.name,this._getTypeInfo(g.type,g.attributes))),h.returnType=i.returnType?this._getTypeInfo(i.returnType,i.attributes):null;continue}}for(const i of this._functions.values())i.info&&(i.info.inUse=i.inUse,this._addCalls(i.node,i.info.calls));for(const i of this._functions.values())i.node.search(a=>{var l;if(a.astNodeType==="varExpr"){const u=a;for(const f of this.overrides)u.name==f.name&&((l=i.info)===null||l===void 0||l.overrides.push(f))}});for(const i of this.uniforms)this._markStructsInUse(i.type);for(const i of this.storage)this._markStructsInUse(i.type)}_markStructsInUse(e){if(e)if(e.isStruct){if(e.inUse=!0,e.members)for(const n of e.members)this._markStructsInUse(n.type)}else if(e.isArray)this._markStructsInUse(e.format);else if(e.isTemplate)e.format&&this._markStructsInUse(e.format);else{const n=this._getAlias(e.name);n&&this._markStructsInUse(n)}}_addCalls(e,n){var r;for(const i of e.calls){const a=(r=this._functions.get(i.name))===null||r===void 0?void 0:r.info;a&&n.add(a)}}findResource(e,n){for(const r of this.uniforms)if(r.group==e&&r.binding==n)return r;for(const r of this.storage)if(r.group==e&&r.binding==n)return r;for(const r of this.textures)if(r.group==e&&r.binding==n)return r;for(const r of this.samplers)if(r.group==e&&r.binding==n)return r;return null}_findResource(e){for(const n of this.uniforms)if(n.name==e)return n;for(const n of this.storage)if(n.name==e)return n;for(const n of this.textures)if(n.name==e)return n;for(const n of this.samplers)if(n.name==e)return n;return null}_markStructsFromAST(e){const n=this._getTypeInfo(e,null);this._markStructsInUse(n)}_findResources(e,n){const r=[],i=this,a=[];return e.search(l=>{if(l instanceof vg)a.push({});else if(l instanceof _g)a.pop();else if(l instanceof _o){const u=l;n&&u.type!==null&&this._markStructsFromAST(u.type),a.length>0&&(a[a.length-1][u.name]=u)}else if(l instanceof ql){const u=l;n&&u.type!==null&&this._markStructsFromAST(u.type)}else if(l instanceof q_){const u=l;n&&u.type!==null&&this._markStructsFromAST(u.type),a.length>0&&(a[a.length-1][u.name]=u)}else if(l instanceof Y_){const u=l;if(a.length>0&&a[a.length-1][u.name])return;const f=i._findResource(u.name);f&&r.push(f)}else if(l instanceof yM){const u=l,f=i._functions.get(u.name);f&&(n&&(f.inUse=!0),e.calls.add(f.node),f.resources===null&&(f.resources=i._findResources(f.node,n)),r.push(...f.resources))}else if(l instanceof pM){const u=l,f=i._functions.get(u.name);f&&(n&&(f.inUse=!0),e.calls.add(f.node),f.resources===null&&(f.resources=i._findResources(f.node,n)),r.push(...f.resources))}}),[...new Map(r.map(l=>[l.name,l])).values()]}getBindGroups(){const e=[];function n(r,i){r>=e.length&&(e.length=r+1),e[r]===void 0&&(e[r]=[]),i>=e[r].length&&(e[r].length=i+1)}for(const r of this.uniforms){n(r.group,r.binding);const i=e[r.group];i[r.binding]=r}for(const r of this.storage){n(r.group,r.binding);const i=e[r.group];i[r.binding]=r}for(const r of this.textures){n(r.group,r.binding);const i=e[r.group];i[r.binding]=r}for(const r of this.samplers){n(r.group,r.binding);const i=e[r.group];i[r.binding]=r}return e}_getOutputs(e,n=void 0){if(n===void 0&&(n=[]),e instanceof go)this._getStructOutputs(e,n);else{const r=this._getOutputInfo(e);r!==null&&n.push(r)}return n}_getStructOutputs(e,n){for(const r of e.members)if(r.type instanceof go)this._getStructOutputs(r.type,n);else{const i=this._getAttribute(r,"location")||this._getAttribute(r,"builtin");if(i!==null){const a=this._getTypeInfo(r.type,r.type.attributes),l=this._parseInt(i.value),u=new i2(r.name,a,i.name,l);n.push(u)}}}_getOutputInfo(e){const n=this._getAttribute(e,"location")||this._getAttribute(e,"builtin");if(n!==null){const r=this._getTypeInfo(e,e.attributes),i=this._parseInt(n.value);return new i2("",r,n.name,i)}return null}_getInputs(e,n=void 0){n===void 0&&(n=[]);for(const r of e)if(r.type instanceof go)this._getStructInputs(r.type,n);else{const i=this._getInputInfo(r);i!==null&&n.push(i)}return n}_getStructInputs(e,n){for(const r of e.members)if(r.type instanceof go)this._getStructInputs(r.type,n);else{const i=this._getInputInfo(r);i!==null&&n.push(i)}}_getInputInfo(e){const n=this._getAttribute(e,"location")||this._getAttribute(e,"builtin");if(n!==null){const r=this._getAttribute(e,"interpolation"),i=this._getTypeInfo(e.type,e.attributes),a=this._parseInt(n.value),l=new QV(e.name,i,n.name,a);return r!==null&&(l.interpolation=this._parseString(r.value)),l}return null}_parseString(e){return e instanceof Array&&(e=e[0]),e}_parseInt(e){e instanceof Array&&(e=e[0]);const n=parseInt(e);return isNaN(n)?e:n}_getAlias(e){for(const n of this.aliases)if(n.name==e)return n.type;return null}_getAliasInfo(e){return new ZV(e.name,this._getTypeInfo(e.type,null))}_getTypeInfo(e,n){if(this._types.has(e))return this._types.get(e);if(e instanceof _M){const i=e,a=i.format?this._getTypeInfo(i.format,i.attributes):null,l=new Zv(i.name,n);return l.format=a,l.count=i.count,this._types.set(e,l),this._updateTypeInfo(l),l}if(e instanceof go){const i=e,a=new _h(i.name,n);a.startLine=i.startLine,a.endLine=i.endLine;for(const l of i.members){const u=this._getTypeInfo(l.type,l.attributes);a.members.push(new n2(l.name,u,l.attributes))}return this._types.set(e,a),this._updateTypeInfo(a),a}if(e instanceof qu){const i=e,a=i.format instanceof Zo,l=i.format?a?this._getTypeInfo(i.format,null):new nc(i.format,null):null,u=new r2(i.name,l,n,i.access);return this._types.set(e,u),this._updateTypeInfo(u),u}if(e instanceof vM){const i=e,a=i.format?this._getTypeInfo(i.format,null):null,l=new r2(i.name,a,n,i.access);return this._types.set(e,l),this._updateTypeInfo(l),l}const r=new nc(e.name,n);return this._types.set(e,r),this._updateTypeInfo(r),r}_updateTypeInfo(e){var n,r;const i=this._getTypeSize(e);if(e.size=(n=i==null?void 0:i.size)!==null&&n!==void 0?n:0,e instanceof Zv&&e.format){const a=this._getTypeSize(e.format);e.stride=(r=a==null?void 0:a.size)!==null&&r!==void 0?r:0,this._updateTypeInfo(e.format)}e instanceof _h&&this._updateStructInfo(e)}_updateStructInfo(e){var n;let r=0,i=0,a=0,l=0;for(let u=0,f=e.members.length;ut.name);Vs._samplerTypes=k.sampler_type.map(t=>t.name);function rH(t){var a;const e={attributes:[],bindings:[]};let n;try{n=iH(t)}catch(l){return Re.error(l.message)(),e}for(const l of n.uniforms){const u=[];for(const f of((a=l.type)==null?void 0:a.members)||[])u.push({name:f.name,type:s2(f.type)});e.bindings.push({type:"uniform",name:l.name,group:l.group,location:l.binding,members:u})}for(const l of n.textures)e.bindings.push({type:"texture",name:l.name,group:l.group,location:l.binding});for(const l of n.samplers)e.bindings.push({type:"sampler",name:l.name,group:l.group,location:l.binding});const r=n.entry.vertex[0],i=(r==null?void 0:r.inputs.length)||0;for(let l=0;l`:t.name}function iH(t){try{return new Vs(t)}catch(e){if(e instanceof Error)throw e;let n="WGSL parse error";throw typeof e=="object"&&(e!=null&&e.message)&&(n+=`: ${e.message} `),typeof e=="object"&&(e!=null&&e.token)&&(n+=e.token.line||""),new Error(n,{cause:e})}}const sH={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...sH}};const Oi=globalThis.mathgl.config;function aH(t,{precision:e=Oi.precision}={}){return t=oH(t),`${parseFloat(t.toPrecision(e))}`}function Mc(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Fa(t,e,n){return cH(t,r=>Math.max(e,Math.min(n,r)))}function yg(t,e,n){return Mc(t)?t.map((r,i)=>yg(r,e[i],n)):n*e+(1-n)*t}function Of(t,e,n){const r=Oi.EPSILON;try{if(t===e)return!0;if(Mc(t)&&Mc(e)){if(t.length!==e.length)return!1;for(let i=0;i0?", ":"")+aH(this[r],e);return`${e.printTypes?this.constructor.name:""}[${n}]`}equals(e){if(!e||this.length!==e.length)return!1;for(let n=0;n=0&&e=0&&eMath.PI*2)throw Error("expected radians")}function KH(t,e,n,r,i,a){const l=2*a/(n-e),u=2*a/(i-r),f=(n+e)/(n-e),h=(i+r)/(i-r),g=-1,m=-1,v=-2*a;return t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=f,t[9]=h,t[10]=g,t[11]=m,t[12]=0,t[13]=0,t[14]=v,t[15]=0,t}function xM(t,e=[],n=0){const r=Math.fround(t),i=t-r;return e[n]=r,e[n+1]=i,e}function ZH(t){return t-Math.fround(t)}function QH(t){const e=new Float32Array(32);for(let n=0;n<4;++n)for(let r=0;r<4;++r){const i=n*4+r;xM(t[r*4+n],e,i*2)}return e}const GH=`#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND - -// All these functions are for substituting tan() function from Intel GPU only -const float TWO_PI = 6.2831854820251465; -const float PI_2 = 1.5707963705062866; -const float PI_16 = 0.1963495463132858; - -const float SIN_TABLE_0 = 0.19509032368659973; -const float SIN_TABLE_1 = 0.3826834261417389; -const float SIN_TABLE_2 = 0.5555702447891235; -const float SIN_TABLE_3 = 0.7071067690849304; - -const float COS_TABLE_0 = 0.9807852506637573; -const float COS_TABLE_1 = 0.9238795042037964; -const float COS_TABLE_2 = 0.8314695954322815; -const float COS_TABLE_3 = 0.7071067690849304; - -const float INVERSE_FACTORIAL_3 = 1.666666716337204e-01; // 1/3! -const float INVERSE_FACTORIAL_5 = 8.333333767950535e-03; // 1/5! -const float INVERSE_FACTORIAL_7 = 1.9841270113829523e-04; // 1/7! -const float INVERSE_FACTORIAL_9 = 2.75573188446287533e-06; // 1/9! - -float sin_taylor_fp32(float a) { - float r, s, t, x; - - if (a == 0.0) { - return 0.0; - } - - x = -a * a; - s = a; - r = a; - - r = r * x; - t = r * INVERSE_FACTORIAL_3; - s = s + t; - - r = r * x; - t = r * INVERSE_FACTORIAL_5; - s = s + t; - - r = r * x; - t = r * INVERSE_FACTORIAL_7; - s = s + t; - - r = r * x; - t = r * INVERSE_FACTORIAL_9; - s = s + t; - - return s; -} - -void sincos_taylor_fp32(float a, out float sin_t, out float cos_t) { - if (a == 0.0) { - sin_t = 0.0; - cos_t = 1.0; - } - sin_t = sin_taylor_fp32(a); - cos_t = sqrt(1.0 - sin_t * sin_t); -} - -float tan_taylor_fp32(float a) { - float sin_a; - float cos_a; - - if (a == 0.0) { - return 0.0; - } - - // 2pi range reduction - float z = floor(a / TWO_PI); - float r = a - TWO_PI * z; - - float t; - float q = floor(r / PI_2 + 0.5); - int j = int(q); - - if (j < -2 || j > 2) { - return 1.0 / 0.0; - } - - t = r - PI_2 * q; - - q = floor(t / PI_16 + 0.5); - int k = int(q); - int abs_k = int(abs(float(k))); - - if (abs_k > 4) { - return 1.0 / 0.0; - } else { - t = t - PI_16 * q; - } - - float u = 0.0; - float v = 0.0; - - float sin_t, cos_t; - float s, c; - sincos_taylor_fp32(t, sin_t, cos_t); - - if (k == 0) { - s = sin_t; - c = cos_t; - } else { - if (abs(float(abs_k) - 1.0) < 0.5) { - u = COS_TABLE_0; - v = SIN_TABLE_0; - } else if (abs(float(abs_k) - 2.0) < 0.5) { - u = COS_TABLE_1; - v = SIN_TABLE_1; - } else if (abs(float(abs_k) - 3.0) < 0.5) { - u = COS_TABLE_2; - v = SIN_TABLE_2; - } else if (abs(float(abs_k) - 4.0) < 0.5) { - u = COS_TABLE_3; - v = SIN_TABLE_3; - } - if (k > 0) { - s = u * sin_t + v * cos_t; - c = u * cos_t - v * sin_t; - } else { - s = u * sin_t - v * cos_t; - c = u * cos_t + v * sin_t; - } - } - - if (j == 0) { - sin_a = s; - cos_a = c; - } else if (j == 1) { - sin_a = c; - cos_a = -s; - } else if (j == -1) { - sin_a = -c; - cos_a = s; - } else { - sin_a = -s; - cos_a = -c; - } - return sin_a / cos_a; -} -#endif - -float tan_fp32(float a) { -#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND - return tan_taylor_fp32(a); -#else - return tan(a); -#endif -} -`,JH={name:"fp32",vs:GH},ej=` -uniform fp64arithmeticUniforms { - uniform float ONE; -} fp64; - -/* -About LUMA_FP64_CODE_ELIMINATION_WORKAROUND - -The purpose of this workaround is to prevent shader compilers from -optimizing away necessary arithmetic operations by swapping their sequences -or transform the equation to some 'equivalent' form. - -The method is to multiply an artifical variable, ONE, which will be known to -the compiler to be 1 only at runtime. The whole expression is then represented -as a polynomial with respective to ONE. In the coefficients of all terms, only one a -and one b should appear - -err = (a + b) * ONE^6 - a * ONE^5 - (a + b) * ONE^4 + a * ONE^3 - b - (a + b) * ONE^2 + a * ONE -*/ - -// Divide float number to high and low floats to extend fraction bits -vec2 split(float a) { - const float SPLIT = 4097.0; - float t = a * SPLIT; -#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND) - float a_hi = t * fp64.ONE - (t - a); - float a_lo = a * fp64.ONE - a_hi; -#else - float a_hi = t - (t - a); - float a_lo = a - a_hi; -#endif - return vec2(a_hi, a_lo); -} - -// Divide float number again when high float uses too many fraction bits -vec2 split2(vec2 a) { - vec2 b = split(a.x); - b.y += a.y; - return b; -} - -// Special sum operation when a > b -vec2 quickTwoSum(float a, float b) { -#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND) - float sum = (a + b) * fp64.ONE; - float err = b - (sum - a) * fp64.ONE; -#else - float sum = a + b; - float err = b - (sum - a); -#endif - return vec2(sum, err); -} - -// General sum operation -vec2 twoSum(float a, float b) { - float s = (a + b); -#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND) - float v = (s * fp64.ONE - a) * fp64.ONE; - float err = (a - (s - v) * fp64.ONE) * fp64.ONE * fp64.ONE * fp64.ONE + (b - v); -#else - float v = s - a; - float err = (a - (s - v)) + (b - v); -#endif - return vec2(s, err); -} - -vec2 twoSub(float a, float b) { - float s = (a - b); -#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND) - float v = (s * fp64.ONE - a) * fp64.ONE; - float err = (a - (s - v) * fp64.ONE) * fp64.ONE * fp64.ONE * fp64.ONE - (b + v); -#else - float v = s - a; - float err = (a - (s - v)) - (b + v); -#endif - return vec2(s, err); -} - -vec2 twoSqr(float a) { - float prod = a * a; - vec2 a_fp64 = split(a); -#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND) - float err = ((a_fp64.x * a_fp64.x - prod) * fp64.ONE + 2.0 * a_fp64.x * - a_fp64.y * fp64.ONE * fp64.ONE) + a_fp64.y * a_fp64.y * fp64.ONE * fp64.ONE * fp64.ONE; -#else - float err = ((a_fp64.x * a_fp64.x - prod) + 2.0 * a_fp64.x * a_fp64.y) + a_fp64.y * a_fp64.y; -#endif - return vec2(prod, err); -} - -vec2 twoProd(float a, float b) { - float prod = a * b; - vec2 a_fp64 = split(a); - vec2 b_fp64 = split(b); - float err = ((a_fp64.x * b_fp64.x - prod) + a_fp64.x * b_fp64.y + - a_fp64.y * b_fp64.x) + a_fp64.y * b_fp64.y; - return vec2(prod, err); -} - -vec2 sum_fp64(vec2 a, vec2 b) { - vec2 s, t; - s = twoSum(a.x, b.x); - t = twoSum(a.y, b.y); - s.y += t.x; - s = quickTwoSum(s.x, s.y); - s.y += t.y; - s = quickTwoSum(s.x, s.y); - return s; -} - -vec2 sub_fp64(vec2 a, vec2 b) { - vec2 s, t; - s = twoSub(a.x, b.x); - t = twoSub(a.y, b.y); - s.y += t.x; - s = quickTwoSum(s.x, s.y); - s.y += t.y; - s = quickTwoSum(s.x, s.y); - return s; -} - -vec2 mul_fp64(vec2 a, vec2 b) { - vec2 prod = twoProd(a.x, b.x); - // y component is for the error - prod.y += a.x * b.y; -#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND) - prod = split2(prod); -#endif - prod = quickTwoSum(prod.x, prod.y); - prod.y += a.y * b.x; -#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND) - prod = split2(prod); -#endif - prod = quickTwoSum(prod.x, prod.y); - return prod; -} - -vec2 div_fp64(vec2 a, vec2 b) { - float xn = 1.0 / b.x; -#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND) - vec2 yn = mul_fp64(a, vec2(xn, 0)); -#else - vec2 yn = a * xn; -#endif - float diff = (sub_fp64(a, mul_fp64(b, yn))).x; - vec2 prod = twoProd(xn, diff); - return sum_fp64(yn, prod); -} - -vec2 sqrt_fp64(vec2 a) { - if (a.x == 0.0 && a.y == 0.0) return vec2(0.0, 0.0); - if (a.x < 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0); - - float x = 1.0 / sqrt(a.x); - float yn = a.x * x; -#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND) - vec2 yn_sqr = twoSqr(yn) * fp64.ONE; -#else - vec2 yn_sqr = twoSqr(yn); -#endif - float diff = sub_fp64(a, yn_sqr).x; - vec2 prod = twoProd(x * 0.5, diff); -#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND) - return sum_fp64(split(yn), prod); -#else - return sum_fp64(vec2(yn, 0.0), prod); -#endif -} -`,tj={ONE:1},nj={name:"fp64arithmetic",vs:ej,defaultUniforms:tj,uniformTypes:{ONE:"f32"},fp64ify:xM,fp64LowPart:ZH,fp64ifyMatrix4:QH},rj=[0,1,1,1],ij=`uniform pickingUniforms { - float isActive; - float isAttribute; - float isHighlightActive; - float useFloatColors; - vec3 highlightedObjectColor; - vec4 highlightColor; -} picking; - -out vec4 picking_vRGBcolor_Avalid; - -// Normalize unsigned byte color to 0-1 range -vec3 picking_normalizeColor(vec3 color) { - return picking.useFloatColors > 0.5 ? color : color / 255.0; -} - -// Normalize unsigned byte color to 0-1 range -vec4 picking_normalizeColor(vec4 color) { - return picking.useFloatColors > 0.5 ? color : color / 255.0; -} - -bool picking_isColorZero(vec3 color) { - return dot(color, vec3(1.0)) < 0.00001; -} - -bool picking_isColorValid(vec3 color) { - return dot(color, vec3(1.0)) > 0.00001; -} - -// Check if this vertex is highlighted -bool isVertexHighlighted(vec3 vertexColor) { - vec3 highlightedObjectColor = picking_normalizeColor(picking.highlightedObjectColor); - return - bool(picking.isHighlightActive) && picking_isColorZero(abs(vertexColor - highlightedObjectColor)); -} - -// Set the current picking color -void picking_setPickingColor(vec3 pickingColor) { - pickingColor = picking_normalizeColor(pickingColor); - - if (bool(picking.isActive)) { - // Use alpha as the validity flag. If pickingColor is [0, 0, 0] fragment is non-pickable - picking_vRGBcolor_Avalid.a = float(picking_isColorValid(pickingColor)); - - if (!bool(picking.isAttribute)) { - // Stores the picking color so that the fragment shader can render it during picking - picking_vRGBcolor_Avalid.rgb = pickingColor; - } - } else { - // Do the comparison with selected item color in vertex shader as it should mean fewer compares - picking_vRGBcolor_Avalid.a = float(isVertexHighlighted(pickingColor)); - } -} - -void picking_setPickingAttribute(float value) { - if (bool(picking.isAttribute)) { - picking_vRGBcolor_Avalid.r = value; - } -} - -void picking_setPickingAttribute(vec2 value) { - if (bool(picking.isAttribute)) { - picking_vRGBcolor_Avalid.rg = value; - } -} - -void picking_setPickingAttribute(vec3 value) { - if (bool(picking.isAttribute)) { - picking_vRGBcolor_Avalid.rgb = value; - } -} -`,sj=`uniform pickingUniforms { - float isActive; - float isAttribute; - float isHighlightActive; - float useFloatColors; - vec3 highlightedObjectColor; - vec4 highlightColor; -} picking; - -in vec4 picking_vRGBcolor_Avalid; - -/* - * Returns highlight color if this item is selected. - */ -vec4 picking_filterHighlightColor(vec4 color) { - // If we are still picking, we don't highlight - if (picking.isActive > 0.5) { - return color; - } - - bool selected = bool(picking_vRGBcolor_Avalid.a); - - if (selected) { - // Blend in highlight color based on its alpha value - float highLightAlpha = picking.highlightColor.a; - float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha); - float highLightRatio = highLightAlpha / blendedAlpha; - - vec3 blendedRGB = mix(color.rgb, picking.highlightColor.rgb, highLightRatio); - return vec4(blendedRGB, blendedAlpha); - } else { - return color; - } -} - -/* - * Returns picking color if picking enabled else unmodified argument. - */ -vec4 picking_filterPickingColor(vec4 color) { - if (bool(picking.isActive)) { - if (picking_vRGBcolor_Avalid.a == 0.0) { - discard; - } - return picking_vRGBcolor_Avalid; - } - return color; -} - -/* - * Returns picking color if picking is enabled if not - * highlight color if this item is selected, otherwise unmodified argument. - */ -vec4 picking_filterColor(vec4 color) { - vec4 highlightColor = picking_filterHighlightColor(color); - return picking_filterPickingColor(highlightColor); -} -`,c2={props:{},uniforms:{},name:"picking",uniformTypes:{isActive:"f32",isAttribute:"f32",isHighlightActive:"f32",useFloatColors:"f32",highlightedObjectColor:"vec3",highlightColor:"vec4"},defaultUniforms:{isActive:!1,isAttribute:!1,isHighlightActive:!1,useFloatColors:!0,highlightedObjectColor:[0,0,0],highlightColor:rj},vs:ij,fs:sj,getUniforms:aj};function aj(t={},e){const n={};if(t.highlightedObjectColor!==void 0)if(t.highlightedObjectColor===null)n.isHighlightActive=!1;else{n.isHighlightActive=!0;const r=t.highlightedObjectColor.slice(0,3);n.highlightedObjectColor=r}if(t.highlightColor){const r=Array.from(t.highlightColor,i=>i/255);Number.isFinite(r[3])||(r[3]=1),n.highlightColor=r}return t.isActive!==void 0&&(n.isActive=!!t.isActive,n.isAttribute=!!t.isAttribute),t.useFloatColors!==void 0&&(n.useFloatColors=!!t.useFloatColors),n}const u2=`precision highp int; - -// #if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX)) -struct AmbientLight { - vec3 color; -}; - -struct PointLight { - vec3 color; - vec3 position; - vec3 attenuation; // 2nd order x:Constant-y:Linear-z:Exponential -}; - -struct DirectionalLight { - vec3 color; - vec3 direction; -}; - -uniform lightingUniforms { - int enabled; - int lightType; - - int directionalLightCount; - int pointLightCount; - - vec3 ambientColor; - - vec3 lightColor0; - vec3 lightPosition0; - vec3 lightDirection0; - vec3 lightAttenuation0; - - vec3 lightColor1; - vec3 lightPosition1; - vec3 lightDirection1; - vec3 lightAttenuation1; - - vec3 lightColor2; - vec3 lightPosition2; - vec3 lightDirection2; - vec3 lightAttenuation2; -} lighting; - -PointLight lighting_getPointLight(int index) { - switch (index) { - case 0: - return PointLight(lighting.lightColor0, lighting.lightPosition0, lighting.lightAttenuation0); - case 1: - return PointLight(lighting.lightColor1, lighting.lightPosition1, lighting.lightAttenuation1); - case 2: - default: - return PointLight(lighting.lightColor2, lighting.lightPosition2, lighting.lightAttenuation2); - } -} - -DirectionalLight lighting_getDirectionalLight(int index) { - switch (index) { - case 0: - return DirectionalLight(lighting.lightColor0, lighting.lightDirection0); - case 1: - return DirectionalLight(lighting.lightColor1, lighting.lightDirection1); - case 2: - default: - return DirectionalLight(lighting.lightColor2, lighting.lightDirection2); - } -} - -float getPointLightAttenuation(PointLight pointLight, float distance) { - return pointLight.attenuation.x - + pointLight.attenuation.y * distance - + pointLight.attenuation.z * distance * distance; -} - -// #endif -`,oj=`// #if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX)) -struct AmbientLight { - color: vec3, -}; - -struct PointLight { - color: vec3, - position: vec3, - attenuation: vec3, // 2nd order x:Constant-y:Linear-z:Exponential -}; - -struct DirectionalLight { - color: vec3, - direction: vec3, -}; - -struct lightingUniforms { - enabled: i32, - poightCount: i32, - directionalLightCount: i32, - - ambientColor: vec3, - - // TODO - support multiple lights by uncommenting arrays below - lightType: i32, - lightColor: vec3, - lightDirection: vec3, - lightPosition: vec3, - lightAttenuation: vec3, - - // AmbientLight ambientLight; - // PointLight pointLight[MAX_LIGHTS]; - // DirectionalLight directionalLight[MAX_LIGHTS]; -}; - -// Binding 0:1 is reserved for lighting (Note: could go into separate bind group as it is stable across draw calls) -@binding(1) @group(0) var lighting : lightingUniforms; - -fn lighting_getPointLight(index: i32) -> PointLight { - return PointLight(lighting.lightColor, lighting.lightPosition, lighting.lightAttenuation); -} - -fn lighting_getDirectionalLight(index: i32) -> DirectionalLight { - return DirectionalLight(lighting.lightColor, lighting.lightDirection); -} - -fn getPointLightAttenuation(pointLight: PointLight, distance: f32) -> f32 { - return pointLight.attenuation.x - + pointLight.attenuation.y * distance - + pointLight.attenuation.z * distance * distance; -} -`,MM=3,lj=255;var Pf;(function(t){t[t.POINT=0]="POINT",t[t.DIRECTIONAL=1]="DIRECTIONAL"})(Pf||(Pf={}));const sf={props:{},uniforms:{},name:"lighting",defines:{MAX_LIGHTS:MM},uniformTypes:{enabled:"i32",lightType:"i32",directionalLightCount:"i32",pointLightCount:"i32",ambientLightColor:"vec3",lightColor0:"vec3",lightPosition0:"vec3",lightDirection0:"vec3",lightAttenuation0:"vec3",lightColor1:"vec3",lightPosition1:"vec3",lightDirection1:"vec3",lightAttenuation1:"vec3",lightColor2:"vec3",lightPosition2:"vec3",lightDirection2:"vec3",lightAttenuation2:"vec3"},defaultUniforms:{enabled:1,lightType:Pf.POINT,directionalLightCount:0,pointLightCount:0,ambientLightColor:[.1,.1,.1],lightColor0:[1,1,1],lightPosition0:[1,1,2],lightDirection0:[1,1,1],lightAttenuation0:[1,0,0],lightColor1:[1,1,1],lightPosition1:[1,1,2],lightDirection1:[1,1,1],lightAttenuation1:[1,0,0],lightColor2:[1,1,1],lightPosition2:[1,1,2],lightDirection2:[1,1,1],lightAttenuation2:[1,0,0]},source:oj,vs:u2,fs:u2,getUniforms:cj};function cj(t,e={}){if(t=t&&{...t},!t)return{...sf.defaultUniforms};t.lights&&(t={...t,...fj(t.lights),lights:void 0});const{ambientLight:n,pointLights:r,directionalLights:i}=t||{};if(!(n||r&&r.length>0||i&&i.length>0))return{...sf.defaultUniforms,enabled:0};const l={...sf.defaultUniforms,...e,...uj({ambientLight:n,pointLights:r,directionalLights:i})};return t.enabled!==void 0&&(l.enabled=t.enabled?1:0),l}function uj({ambientLight:t,pointLights:e=[],directionalLights:n=[]}){const r={};r.ambientLightColor=t0(t);let i=0;for(const a of e){r.lightType=Pf.POINT;const l=i;r[`lightColor${l}`]=t0(a),r[`lightPosition${l}`]=a.position,r[`lightAttenuation${l}`]=a.attenuation||[1,0,0],i++}for(const a of n){r.lightType=Pf.DIRECTIONAL;const l=i;r[`lightColor${l}`]=t0(a),r[`lightDirection${l}`]=a.direction,i++}return i>MM&&Re.warn("MAX_LIGHTS exceeded")(),r.directionalLightCount=n.length,r.pointLightCount=e.length,r}function fj(t){var n,r;const e={pointLights:[],directionalLights:[]};for(const i of t||[])switch(i.type){case"ambient":e.ambientLight=i;break;case"directional":(n=e.directionalLights)==null||n.push(i);break;case"point":(r=e.pointLights)==null||r.push(i);break}return e}function t0(t={}){const{color:e=[0,0,0],intensity:n=1}=t;return e.map(r=>r*n/lj)}const OM=`uniform phongMaterialUniforms { - uniform float ambient; - uniform float diffuse; - uniform float shininess; - uniform vec3 specularColor; -} material; -`,PM=`uniform phongMaterialUniforms { - uniform float ambient; - uniform float diffuse; - uniform float shininess; - uniform vec3 specularColor; -} material; - -vec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) { - vec3 halfway_direction = normalize(light_direction + view_direction); - float lambertian = dot(light_direction, normal_worldspace); - float specular = 0.0; - if (lambertian > 0.0) { - float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0); - specular = pow(specular_angle, material.shininess); - } - lambertian = max(lambertian, 0.0); - return (lambertian * material.diffuse * surfaceColor + specular * material.specularColor) * color; -} - -vec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) { - vec3 lightColor = surfaceColor; - - if (lighting.enabled == 0) { - return lightColor; - } - - vec3 view_direction = normalize(cameraPosition - position_worldspace); - lightColor = material.ambient * surfaceColor * lighting.ambientColor; - - for (int i = 0; i < lighting.pointLightCount; i++) { - PointLight pointLight = lighting_getPointLight(i); - vec3 light_position_worldspace = pointLight.position; - vec3 light_direction = normalize(light_position_worldspace - position_worldspace); - float light_attenuation = getPointLightAttenuation(pointLight, distance(light_position_worldspace, position_worldspace)); - lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color / light_attenuation); - } - - int totalLights = min(MAX_LIGHTS, lighting.pointLightCount + lighting.directionalLightCount); - for (int i = lighting.pointLightCount; i < totalLights; i++) { - DirectionalLight directionalLight = lighting_getDirectionalLight(i); - lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color); - } - - return lightColor; -} -`,NM={props:{},name:"gouraudMaterial",vs:PM.replace("phongMaterial","gouraudMaterial"),fs:OM.replace("phongMaterial","gouraudMaterial"),defines:{LIGHTING_VERTEX:1},dependencies:[sf],uniformTypes:{ambient:"f32",diffuse:"f32",shininess:"f32",specularColor:"vec3"},defaultUniforms:{ambient:.35,diffuse:.6,shininess:32,specularColor:[.15,.15,.15]},getUniforms(t){const e={...t};return e.specularColor&&(e.specularColor=e.specularColor.map(n=>n/255)),{...NM.defaultUniforms,...e}}},dj=`struct phongMaterialUniforms { - ambient: f32, - diffuse: f32, - shininess: f32, - specularColor: vec3, -}; - -@binding(2) @group(0) var material : phongMaterialUniforms; - -fn lighting_getLightColor(surfaceColor: vec3, light_direction: vec3, view_direction: vec3, normal_worldspace: vec3, color: vec3) -> vec3 { - let halfway_direction: vec3 = normalize(light_direction + view_direction); - var lambertian: f32 = dot(light_direction, normal_worldspace); - var specular: f32 = 0.0; - if (lambertian > 0.0) { - let specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0); - specular = pow(specular_angle, material.shininess); - } - lambertian = max(lambertian, 0.0); - return (lambertian * material.diffuse * surfaceColor + specular * material.specularColor) * color; -} - -fn lighting_getLightColor2(surfaceColor: vec3, cameraPosition: vec3, position_worldspace: vec3, normal_worldspace: vec3) -> vec3 { - var lightColor: vec3 = surfaceColor; - - if (lighting.enabled == 0) { - return lightColor; - } - - let view_direction: vec3 = normalize(cameraPosition - position_worldspace); - lightColor = material.ambient * surfaceColor * lighting.ambientColor; - - if (lighting.lightType == 0) { - let pointLight: PointLight = lighting_getPointLight(0); - let light_position_worldspace: vec3 = pointLight.position; - let light_direction: vec3 = normalize(light_position_worldspace - position_worldspace); - lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color); - } else if (lighting.lightType == 1) { - var directionalLight: DirectionalLight = lighting_getDirectionalLight(0); - lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color); - } - - return lightColor; - /* - for (int i = 0; i < MAX_LIGHTS; i++) { - if (i >= lighting.pointLightCount) { - break; - } - PointLight pointLight = lighting.pointLight[i]; - vec3 light_position_worldspace = pointLight.position; - vec3 light_direction = normalize(light_position_worldspace - position_worldspace); - lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color); - } - - for (int i = 0; i < MAX_LIGHTS; i++) { - if (i >= lighting.directionalLightCount) { - break; - } - DirectionalLight directionalLight = lighting.directionalLight[i]; - lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color); - } - */ -} - -fn lighting_getSpecularLightColor(cameraPosition: vec3, position_worldspace: vec3, normal_worldspace: vec3) -> vec3{ - var lightColor = vec3(0, 0, 0); - let surfaceColor = vec3(0, 0, 0); - - if (lighting.enabled == 0) { - let view_direction = normalize(cameraPosition - position_worldspace); - - switch (lighting.lightType) { - case 0, default: { - let pointLight: PointLight = lighting_getPointLight(0); - let light_position_worldspace: vec3 = pointLight.position; - let light_direction: vec3 = normalize(light_position_worldspace - position_worldspace); - lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color); - } - case 1: { - let directionalLight: DirectionalLight = lighting_getDirectionalLight(0); - lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color); - } - } - } - return lightColor; -} -`,IM={name:"phongMaterial",dependencies:[sf],source:dj,vs:OM,fs:PM,defines:{LIGHTING_FRAGMENT:1},uniformTypes:{ambient:"f32",diffuse:"f32",shininess:"f32",specularColor:"vec3"},defaultUniforms:{ambient:.35,diffuse:.6,shininess:32,specularColor:[.15,.15,.15]},getUniforms(t){const e={...t};return e.specularColor&&(e.specularColor=e.specularColor.map(n=>n/255)),{...IM.defaultUniforms,...e}}},f2=`uniform layerUniforms { - uniform float opacity; -} layer; -`,hj={name:"layer",vs:f2,fs:f2,getUniforms:t=>({opacity:Math.pow(t.opacity,1/2.2)}),uniformTypes:{opacity:"f32"}},DM="#define SMOOTH_EDGE_RADIUS 0.5",gj=` -${DM} - -struct VertexGeometry { - vec4 position; - vec3 worldPosition; - vec3 worldPositionAlt; - vec3 normal; - vec2 uv; - vec3 pickingColor; -} geometry = VertexGeometry( - vec4(0.0, 0.0, 1.0, 0.0), - vec3(0.0), - vec3(0.0), - vec3(0.0), - vec2(0.0), - vec3(0.0) -); -`,pj=` -${DM} - -struct FragmentGeometry { - vec2 uv; -} geometry; - -float smoothedge(float edge, float x) { - return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x); -} -`,FM={name:"geometry",vs:gj,fs:pj},mj=25;var or;(function(t){t[t.Start=1]="Start",t[t.Move=2]="Move",t[t.End=4]="End",t[t.Cancel=8]="Cancel"})(or||(or={}));var ur;(function(t){t[t.None=0]="None",t[t.Left=1]="Left",t[t.Right=2]="Right",t[t.Up=4]="Up",t[t.Down=8]="Down",t[t.Horizontal=3]="Horizontal",t[t.Vertical=12]="Vertical",t[t.All=15]="All"})(ur||(ur={}));var Ct;(function(t){t[t.Possible=1]="Possible",t[t.Began=2]="Began",t[t.Changed=4]="Changed",t[t.Ended=8]="Ended",t[t.Recognized=8]="Recognized",t[t.Cancelled=16]="Cancelled",t[t.Failed=32]="Failed"})(Ct||(Ct={}));const vj="compute",_j="auto",Q_="manipulation",Bh="none",G_="pan-x",J_="pan-y";function yj(t){if(t.includes(Bh))return Bh;const e=t.includes(G_),n=t.includes(J_);return e&&n?Bh:e||n?e?G_:J_:t.includes(Q_)?Q_:_j}class bj{constructor(e,n){this.actions="",this.manager=e,this.set(n)}set(e){e===vj&&(e=this.compute()),this.manager.element&&(this.manager.element.style.touchAction=e,this.actions=e)}update(){this.set(this.manager.options.touchAction)}compute(){let e=[];for(const n of this.manager.recognizers)n.options.enable&&(e=e.concat(n.getTouchAction()));return yj(e.join(" "))}}function Sg(t){return t.trim().split(/\s+/g)}function n0(t,e,n){if(t)for(const r of Sg(e))t.addEventListener(r,n,!1)}function r0(t,e,n){if(t)for(const r of Sg(e))t.removeEventListener(r,n,!1)}function d2(t){return(t.ownerDocument||t).defaultView}function Sj(t,e){let n=t;for(;n;){if(n===e)return!0;n=n.parentNode}return!1}function kM(t){const e=t.length;if(e===1)return{x:Math.round(t[0].clientX),y:Math.round(t[0].clientY)};let n=0,r=0,i=0;for(;i=Math.abs(e)?t<0?ur.Left:ur.Right:e<0?ur.Up:ur.Down}function wj(t,e){const n=e.center;let r=t.offsetDelta,i=t.prevDelta;const a=t.prevInput;return(e.eventType===or.Start||(a==null?void 0:a.eventType)===or.End)&&(i=t.prevDelta={x:(a==null?void 0:a.deltaX)||0,y:(a==null?void 0:a.deltaY)||0},r=t.offsetDelta={x:n.x,y:n.y}),{deltaX:i.x+(n.x-r.x),deltaY:i.y+(n.y-r.y)}}function LM(t,e,n){return{x:e/t||0,y:n/t||0}}function Tj(t,e){return g2(e[0],e[1])/g2(t[0],t[1])}function Cj(t,e){return p2(e[1],e[0])-p2(t[1],t[0])}function Aj(t,e){const n=t.lastInterval||e,r=e.timeStamp-n.timeStamp;let i,a,l,u;if(e.eventType!==or.Cancel&&(r>mj||n.velocity===void 0)){const f=e.deltaX-n.deltaX,h=e.deltaY-n.deltaY,g=LM(r,f,h);a=g.x,l=g.y,i=Math.abs(g.x)>Math.abs(g.y)?g.x:g.y,u=UM(f,h),t.lastInterval=e}else i=n.velocity,a=n.velocityX,l=n.velocityY,u=n.direction;e.velocity=i,e.velocityX=a,e.velocityY=l,e.direction=u}function Rj(t,e){const{session:n}=t,{pointers:r}=e,{length:i}=r;n.firstInput||(n.firstInput=h2(e)),i>1&&!n.firstMultiple?n.firstMultiple=h2(e):i===1&&(n.firstMultiple=!1);const{firstInput:a,firstMultiple:l}=n,u=l?l.center:a.center,f=e.center=kM(r);e.timeStamp=Date.now(),e.deltaTime=e.timeStamp-a.timeStamp,e.angle=Ej(u,f),e.distance=BM(u,f);const{deltaX:h,deltaY:g}=wj(n,e);e.deltaX=h,e.deltaY=g,e.offsetDirection=UM(e.deltaX,e.deltaY);const m=LM(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=m.x,e.overallVelocityY=m.y,e.overallVelocity=Math.abs(m.x)>Math.abs(m.y)?m.x:m.y,e.scale=l?Tj(l.pointers,r):1,e.rotation=l?Cj(l.pointers,r):0,e.maxPointers=n.prevInput?e.pointers.length>n.prevInput.maxPointers?e.pointers.length:n.prevInput.maxPointers:e.pointers.length;let v=t.element;return Sj(e.srcEvent.target,v)&&(v=e.srcEvent.target),e.target=v,Aj(n,e),e}function xj(t,e,n){const r=n.pointers.length,i=n.changedPointers.length,a=e&or.Start&&r-i===0,l=e&(or.End|or.Cancel)&&r-i===0;n.isFirst=!!a,n.isFinal=!!l,a&&(t.session={}),n.eventType=e;const u=Rj(t,n);t.emit("hammer.input",u),t.recognize(u),t.session.prevInput=u}let Mj=class{constructor(e){this.evEl="",this.evWin="",this.evTarget="",this.domHandler=n=>{this.manager.options.enable&&this.handler(n)},this.manager=e,this.element=e.element,this.target=e.options.inputTarget||e.element}callback(e,n){xj(this.manager,e,n)}init(){n0(this.element,this.evEl,this.domHandler),n0(this.target,this.evTarget,this.domHandler),n0(d2(this.element),this.evWin,this.domHandler)}destroy(){r0(this.element,this.evEl,this.domHandler),r0(this.target,this.evTarget,this.domHandler),r0(d2(this.element),this.evWin,this.domHandler)}};const Oj={pointerdown:or.Start,pointermove:or.Move,pointerup:or.End,pointercancel:or.Cancel,pointerout:or.Cancel},Pj="pointerdown",Nj="pointermove pointerup pointercancel";class Ij extends Mj{constructor(e){super(e),this.evEl=Pj,this.evWin=Nj,this.store=this.manager.session.pointerEvents=[],this.init()}handler(e){const{store:n}=this;let r=!1;const i=Oj[e.type],a=e.pointerType,l=a==="touch";let u=n.findIndex(f=>f.pointerId===e.pointerId);i&or.Start&&(e.buttons||l)?u<0&&(n.push(e),u=n.length-1):i&(or.End|or.Cancel)&&(r=!0),!(u<0)&&(n[u]=e,this.callback(i,{pointers:n,changedPointers:[e],eventType:i,pointerType:a,srcEvent:e}),r&&n.splice(u,1))}}const Dj=["","webkit","Moz","MS","ms","o"];function Fj(t,e){const n=e[0].toUpperCase()+e.slice(1);for(const r of Dj){const i=r?r+n:e;if(i in t)return i}}const kj=1,m2=2,v2={touchAction:"compute",enable:!0,inputTarget:null,cssProps:{userSelect:"none",userDrag:"none",touchCallout:"none",tapHighlightColor:"rgba(0,0,0,0)"}};class Bj{constructor(e,n){this.options={...v2,...n,cssProps:{...v2.cssProps,...n.cssProps},inputTarget:n.inputTarget||e},this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=new Ij(this),this.touchAction=new bj(this,this.options.touchAction),this.toggleCssProps(!0)}set(e){return Object.assign(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this}stop(e){this.session.stopped=e?m2:kj}recognize(e){const{session:n}=this;if(n.stopped)return;this.session.prevented&&e.srcEvent.preventDefault();let r;const{recognizers:i}=this;let{curRecognizer:a}=n;(!a||a&&a.state&Ct.Recognized)&&(a=n.curRecognizer=null);let l=0;for(;l-1&&this.requireFail.splice(r,1)}return this}hasRequireFailures(){return!!this.requireFail.find(e=>e.options.enable)}canRecognizeWith(e){return!!this.simultaneous[e.id]}emit(e){if(!e)return;const{state:n}=this;n=Ct.Ended&&this.manager.emit(this.options.event+_2(n),e)}tryEmit(e){this.canEmit()?this.emit(e):this.state=Ct.Failed}canEmit(){let e=0;for(;e{this.state=Ct.Recognized,this.tryEmit(this._input)},n.interval),Ct.Began):Ct.Recognized}return Ct.Failed}failTimeout(){return this._timer=setTimeout(()=>{this.state=Ct.Failed},this.options.interval),Ct.Failed}reset(){clearTimeout(this._timer)}emit(e){this.state===Ct.Recognized&&(e.tapCount=this.count,this.manager.emit(this.options.event,e))}}const zj=["","start","move","end","cancel","up","down","left","right"];class b2 extends $M{constructor(e={}){super({enable:!0,pointers:1,event:"pan",threshold:10,direction:ur.All,...e}),this.pX=null,this.pY=null}getTouchAction(){const{options:{direction:e}}=this,n=[];return e&ur.Horizontal&&n.push(J_),e&ur.Vertical&&n.push(G_),n}getEventNames(){return zj.map(e=>this.options.event+e)}directionTest(e){const{options:n}=this;let r=!0,{distance:i}=e,{direction:a}=e;const l=e.deltaX,u=e.deltaY;return a&n.direction||(n.direction&ur.Horizontal?(a=l===0?ur.None:l<0?ur.Left:ur.Right,r=l!==this.pX,i=Math.abs(e.deltaX)):(a=u===0?ur.None:u<0?ur.Up:ur.Down,r=u!==this.pY,i=Math.abs(e.deltaY))),e.direction=a,r&&i>n.threshold&&!!(a&n.direction)}attrTest(e){return super.attrTest(e)&&(!!(this.state&Ct.Began)||!(this.state&Ct.Began)&&this.directionTest(e))}emit(e){this.pX=e.deltaX,this.pY=e.deltaY;const n=ur[e.direction].toLowerCase();n&&(e.additionalEvent=this.options.event+n),super.emit(e)}}const $j=["","start","move","end","cancel","in","out"];class Vj extends $M{constructor(e={}){super({enable:!0,event:"pinch",threshold:0,pointers:2,...e})}getTouchAction(){return[Bh]}getEventNames(){return $j.map(e=>this.options.event+e)}attrTest(e){return super.attrTest(e)&&(Math.abs(e.scale-1)>this.options.threshold||!!(this.state&Ct.Began))}emit(e){if(e.scale!==1){const n=e.scale<1?"in":"out";e.additionalEvent=this.options.event+n}super.emit(e)}}class op{constructor(e,n,r){this.element=e,this.callback=n,this.options=r}}const Hj=typeof navigator<"u"&&navigator.userAgent?navigator.userAgent.toLowerCase():"",jj=Hj.indexOf("firefox")!==-1,S2=4.000244140625,Wj=40,Xj=.25;class qj extends op{constructor(e,n,r){super(e,n,{enable:!0,...r}),this.handleEvent=i=>{if(!this.options.enable)return;let a=i.deltaY;globalThis.WheelEvent&&(jj&&i.deltaMode===globalThis.WheelEvent.DOM_DELTA_PIXEL&&(a/=globalThis.devicePixelRatio),i.deltaMode===globalThis.WheelEvent.DOM_DELTA_LINE&&(a*=Wj)),a!==0&&a%S2===0&&(a=Math.floor(a/S2)),i.shiftKey&&a&&(a=a*Xj),this.callback({type:"wheel",center:{x:i.clientX,y:i.clientY},delta:-a,srcEvent:i,pointerType:"mouse",target:i.target})},e.addEventListener("wheel",this.handleEvent,{passive:!1})}destroy(){this.element.removeEventListener("wheel",this.handleEvent)}enableEventType(e,n){e==="wheel"&&(this.options.enable=n)}}const E2=["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"];class Yj extends op{constructor(e,n,r){super(e,n,{enable:!0,...r}),this.handleEvent=a=>{this.handleOverEvent(a),this.handleOutEvent(a),this.handleEnterEvent(a),this.handleLeaveEvent(a),this.handleMoveEvent(a)},this.pressed=!1;const{enable:i}=this.options;this.enableMoveEvent=i,this.enableLeaveEvent=i,this.enableEnterEvent=i,this.enableOutEvent=i,this.enableOverEvent=i,E2.forEach(a=>e.addEventListener(a,this.handleEvent))}destroy(){E2.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,n){switch(e){case"pointermove":this.enableMoveEvent=n;break;case"pointerover":this.enableOverEvent=n;break;case"pointerout":this.enableOutEvent=n;break;case"pointerenter":this.enableEnterEvent=n;break;case"pointerleave":this.enableLeaveEvent=n;break}}handleOverEvent(e){this.enableOverEvent&&e.type==="mouseover"&&this._emit("pointerover",e)}handleOutEvent(e){this.enableOutEvent&&e.type==="mouseout"&&this._emit("pointerout",e)}handleEnterEvent(e){this.enableEnterEvent&&e.type==="mouseenter"&&this._emit("pointerenter",e)}handleLeaveEvent(e){this.enableLeaveEvent&&e.type==="mouseleave"&&this._emit("pointerleave",e)}handleMoveEvent(e){if(this.enableMoveEvent)switch(e.type){case"mousedown":e.button>=0&&(this.pressed=!0);break;case"mousemove":e.buttons===0&&(this.pressed=!1),this.pressed||this._emit("pointermove",e);break;case"mouseup":this.pressed=!1;break}}_emit(e,n){this.callback({type:e,center:{x:n.clientX,y:n.clientY},srcEvent:n,pointerType:"mouse",target:n.target})}}const w2=["keydown","keyup"];class Kj extends op{constructor(e,n,r){super(e,n,{enable:!0,tabIndex:0,...r}),this.handleEvent=i=>{const a=i.target||i.srcElement;a.tagName==="INPUT"&&a.type==="text"||a.tagName==="TEXTAREA"||(this.enableDownEvent&&i.type==="keydown"&&this.callback({type:"keydown",srcEvent:i,key:i.key,target:i.target}),this.enableUpEvent&&i.type==="keyup"&&this.callback({type:"keyup",srcEvent:i,key:i.key,target:i.target}))},this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,e.tabIndex=this.options.tabIndex,e.style.outline="none",w2.forEach(i=>e.addEventListener(i,this.handleEvent))}destroy(){w2.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,n){e==="keydown"&&(this.enableDownEvent=n),e==="keyup"&&(this.enableUpEvent=n)}}class Zj extends op{constructor(e,n,r){super(e,n,r),this.handleEvent=i=>{this.options.enable&&this.callback({type:"contextmenu",center:{x:i.clientX,y:i.clientY},srcEvent:i,pointerType:"mouse",target:i.target})},e.addEventListener("contextmenu",this.handleEvent)}destroy(){this.element.removeEventListener("contextmenu",this.handleEvent)}enableEventType(e,n){e==="contextmenu"&&(this.options.enable=n)}}const T2=1,ey=2,C2=4,Qj={pointerdown:T2,pointermove:ey,pointerup:C2,mousedown:T2,mousemove:ey,mouseup:C2},Gj=0,Jj=1,eW=2,tW=1,nW=2,rW=4;function iW(t){const e=Qj[t.srcEvent.type];if(!e)return null;const{buttons:n,button:r}=t.srcEvent;let i=!1,a=!1,l=!1;return e===ey?(i=!!(n&tW),a=!!(n&rW),l=!!(n&nW)):(i=r===Gj,a=r===Jj,l=r===eW),{leftButton:i,middleButton:a,rightButton:l}}function sW(t,e){const n=t.center;if(!n)return null;const r=e.getBoundingClientRect(),i=r.width/e.offsetWidth||1,a=r.height/e.offsetHeight||1,l={x:(n.x-r.left-e.clientLeft)/i,y:(n.y-r.top-e.clientTop)/a};return{center:n,offsetCenter:l}}const aW={srcElement:"root",priority:0};class oW{constructor(e,n){this.handleEvent=r=>{if(this.isEmpty())return;const i=this._normalizeEvent(r);let a=r.srcEvent.target;for(;a&&a!==i.rootElement;){if(this._emit(i,a),i.handled)return;a=a.parentNode}this._emit(i,"root")},this.eventManager=e,this.recognizerName=n,this.handlers=[],this.handlersByElement=new Map,this._active=!1}isEmpty(){return!this._active}add(e,n,r,i=!1,a=!1){const{handlers:l,handlersByElement:u}=this,f={...aW,...r};let h=u.get(f.srcElement);h||(h=[],u.set(f.srcElement,h));const g={type:e,handler:n,srcElement:f.srcElement,priority:f.priority};i&&(g.once=!0),a&&(g.passive=!0),l.push(g),this._active=this._active||!g.passive;let m=h.length-1;for(;m>=0&&!(h[m].priority>=g.priority);)m--;h.splice(m+1,0,g)}remove(e,n){const{handlers:r,handlersByElement:i}=this;for(let a=r.length-1;a>=0;a--){const l=r[a];if(l.type===e&&l.handler===n){r.splice(a,1);const u=i.get(l.srcElement);u.splice(u.indexOf(l),1),u.length===0&&i.delete(l.srcElement)}}this._active=r.some(a=>!a.passive)}_emit(e,n){const r=this.handlersByElement.get(n);if(r){let i=!1;const a=()=>{e.handled=!0},l=()=>{e.handled=!0,i=!0},u=[];for(let f=0;f{e.srcEvent.preventDefault()},stopImmediatePropagation:null,stopPropagation:null,handled:!1,rootElement:n}}}function lW(t){if("recognizer"in t)return t;let e;const n=Array.isArray(t)?[...t]:[t];if(typeof n[0]=="function"){const r=n.shift(),i=n.shift()||{};e=new r(i)}else e=n.shift();return{recognizer:e,recognizeWith:typeof n[0]=="string"?[n[0]]:n[0],requireFailure:typeof n[1]=="string"?[n[1]]:n[1]}}class cW{constructor(e=null,n={}){if(this._onBasicInput=r=>{this.manager.emit(r.srcEvent.type,r)},this._onOtherEvent=r=>{this.manager.emit(r.type,r)},this.options={recognizers:[],events:{},touchAction:"compute",tabIndex:0,cssProps:{},...n},this.events=new Map,this.element=e,!!e){this.manager=new Bj(e,this.options);for(const r of this.options.recognizers){const{recognizer:i,recognizeWith:a,requireFailure:l}=lW(r);this.manager.add(i),a&&i.recognizeWith(a),l&&i.requireFailure(l)}this.manager.on("hammer.input",this._onBasicInput),this.wheelInput=new qj(e,this._onOtherEvent,{enable:!1}),this.moveInput=new Yj(e,this._onOtherEvent,{enable:!1}),this.keyInput=new Kj(e,this._onOtherEvent,{enable:!1,tabIndex:n.tabIndex}),this.contextmenuInput=new Zj(e,this._onOtherEvent,{enable:!1}),this.on(this.options.events)}}getElement(){return this.element}destroy(){this.element&&(this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy())}on(e,n,r){this._addEventHandler(e,n,r,!1)}once(e,n,r){this._addEventHandler(e,n,r,!0)}watch(e,n,r){this._addEventHandler(e,n,r,!1,!0)}off(e,n){this._removeEventHandler(e,n)}_toggleRecognizer(e,n){var a,l,u,f;const{manager:r}=this;if(!r)return;const i=r.get(e);i&&(i.set({enable:n}),r.touchAction.update()),(a=this.wheelInput)==null||a.enableEventType(e,n),(l=this.moveInput)==null||l.enableEventType(e,n),(u=this.keyInput)==null||u.enableEventType(e,n),(f=this.contextmenuInput)==null||f.enableEventType(e,n)}_addEventHandler(e,n,r,i,a){if(typeof e!="string"){r=n;for(const[h,g]of Object.entries(e))this._addEventHandler(h,g,r,i,a);return}const{manager:l,events:u}=this;if(!l)return;let f=u.get(e);if(!f){const h=this._getRecognizerName(e)||e;f=new oW(this,h),u.set(e,f),l&&l.on(e,f.handleEvent)}f.add(e,n,r,i,a),f.isEmpty()||this._toggleRecognizer(f.recognizerName,!0)}_removeEventHandler(e,n){if(typeof e!="string"){for(const[a,l]of Object.entries(e))this._removeEventHandler(a,l);return}const{events:r}=this,i=r.get(e);if(i&&(i.remove(e,n),i.isEmpty())){const{recognizerName:a}=i;let l=!1;for(const u of r.values())if(u.recognizerName===a&&!u.isEmpty()){l=!0;break}l||this._toggleRecognizer(a,!1)}}_getRecognizerName(e){var n;return(n=this.manager.recognizers.find(r=>r.getEventNames().includes(e)))==null?void 0:n.options.event}}const cn={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(cn,"IDENTITY",{get:()=>(Sn.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")(),0)});const _s={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},zo={common:0,meters:1,pixels:2},ty={click:"onClick",panstart:"onDragStart",panmove:"onDrag",panend:"onDragEnd"},A2={multipan:[b2,{threshold:10,direction:ur.Vertical,pointers:2}],pinch:[Vj,{},null,["multipan"]],pan:[b2,{threshold:1},["pinch"],["multipan"]],dblclick:[y2,{event:"dblclick",taps:2}],click:[y2,{event:"click"},null,["dblclick"]]},uW=Object.keys(cn).map(t=>`const int COORDINATE_SYSTEM_${t} = ${cn[t]};`).join(""),fW=Object.keys(_s).map(t=>`const int PROJECTION_MODE_${t} = ${_s[t]};`).join(""),dW=Object.keys(zo).map(t=>`const int UNIT_${t.toUpperCase()} = ${zo[t]};`).join(""),hW=`${uW} -${fW} -${dW} -uniform projectUniforms { -bool wrapLongitude; -int coordinateSystem; -vec3 commonUnitsPerMeter; -int projectionMode; -float scale; -vec3 commonUnitsPerWorldUnit; -vec3 commonUnitsPerWorldUnit2; -vec4 center; -mat4 modelMatrix; -mat4 viewProjectionMatrix; -vec2 viewportSize; -float devicePixelRatio; -float focalDistance; -vec3 cameraPosition; -vec3 coordinateOrigin; -vec3 commonOrigin; -bool pseudoMeters; -} project; -const float TILE_SIZE = 512.0; -const float PI = 3.1415926536; -const float WORLD_SCALE = TILE_SIZE / (PI * 2.0); -const vec3 ZERO_64_LOW = vec3(0.0); -const float EARTH_RADIUS = 6370972.0; -const float GLOBE_RADIUS = 256.0; -float project_size_at_latitude(float lat) { -float y = clamp(lat, -89.9, 89.9); -return 1.0 / cos(radians(y)); -} -float project_size() { -if (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR && -project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT && -project.pseudoMeters == false) { -if (geometry.position.w == 0.0) { -return project_size_at_latitude(geometry.worldPosition.y); -} -float y = geometry.position.y / TILE_SIZE * 2.0 - 1.0; -float y2 = y * y; -float y4 = y2 * y2; -float y6 = y4 * y2; -return 1.0 + 4.9348 * y2 + 4.0587 * y4 + 1.5642 * y6; -} -return 1.0; -} -float project_size_at_latitude(float meters, float lat) { -return meters * project.commonUnitsPerMeter.z * project_size_at_latitude(lat); -} -float project_size(float meters) { -return meters * project.commonUnitsPerMeter.z * project_size(); -} -vec2 project_size(vec2 meters) { -return meters * project.commonUnitsPerMeter.xy * project_size(); -} -vec3 project_size(vec3 meters) { -return meters * project.commonUnitsPerMeter * project_size(); -} -vec4 project_size(vec4 meters) { -return vec4(meters.xyz * project.commonUnitsPerMeter, meters.w); -} -mat3 project_get_orientation_matrix(vec3 up) { -vec3 uz = normalize(up); -vec3 ux = abs(uz.z) == 1.0 ? vec3(1.0, 0.0, 0.0) : normalize(vec3(uz.y, -uz.x, 0)); -vec3 uy = cross(uz, ux); -return mat3(ux, uy, uz); -} -bool project_needs_rotation(vec3 commonPosition, out mat3 transform) { -if (project.projectionMode == PROJECTION_MODE_GLOBE) { -transform = project_get_orientation_matrix(commonPosition); -return true; -} -return false; -} -vec3 project_normal(vec3 vector) { -vec4 normal_modelspace = project.modelMatrix * vec4(vector, 0.0); -vec3 n = normalize(normal_modelspace.xyz * project.commonUnitsPerMeter); -mat3 rotation; -if (project_needs_rotation(geometry.position.xyz, rotation)) { -n = rotation * n; -} -return n; -} -vec4 project_offset_(vec4 offset) { -float dy = offset.y; -vec3 commonUnitsPerWorldUnit = project.commonUnitsPerWorldUnit + project.commonUnitsPerWorldUnit2 * dy; -return vec4(offset.xyz * commonUnitsPerWorldUnit, offset.w); -} -vec2 project_mercator_(vec2 lnglat) { -float x = lnglat.x; -if (project.wrapLongitude) { -x = mod(x + 180., 360.0) - 180.; -} -float y = clamp(lnglat.y, -89.9, 89.9); -return vec2( -radians(x) + PI, -PI + log(tan_fp32(PI * 0.25 + radians(y) * 0.5)) -) * WORLD_SCALE; -} -vec3 project_globe_(vec3 lnglatz) { -float lambda = radians(lnglatz.x); -float phi = radians(lnglatz.y); -float cosPhi = cos(phi); -float D = (lnglatz.z / EARTH_RADIUS + 1.0) * GLOBE_RADIUS; -return vec3( -sin(lambda) * cosPhi, --cos(lambda) * cosPhi, -sin(phi) -) * D; -} -vec4 project_position(vec4 position, vec3 position64Low) { -vec4 position_world = project.modelMatrix * position; -if (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR) { -if (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT) { -return vec4( -project_mercator_(position_world.xy), -project_size_at_latitude(position_world.z, position_world.y), -position_world.w -); -} -if (project.coordinateSystem == COORDINATE_SYSTEM_CARTESIAN) { -position_world.xyz += project.coordinateOrigin; -} -} -if (project.projectionMode == PROJECTION_MODE_GLOBE) { -if (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT) { -return vec4( -project_globe_(position_world.xyz), -position_world.w -); -} -} -if (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) { -if (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT) { -if (abs(position_world.y - project.coordinateOrigin.y) > 0.25) { -return vec4( -project_mercator_(position_world.xy) - project.commonOrigin.xy, -project_size(position_world.z), -position_world.w -); -} -} -} -if (project.projectionMode == PROJECTION_MODE_IDENTITY || -(project.projectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET && -(project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT || -project.coordinateSystem == COORDINATE_SYSTEM_CARTESIAN))) { -position_world.xyz -= project.coordinateOrigin; -} -return project_offset_(position_world) + project_offset_(project.modelMatrix * vec4(position64Low, 0.0)); -} -vec4 project_position(vec4 position) { -return project_position(position, ZERO_64_LOW); -} -vec3 project_position(vec3 position, vec3 position64Low) { -vec4 projected_position = project_position(vec4(position, 1.0), position64Low); -return projected_position.xyz; -} -vec3 project_position(vec3 position) { -vec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_LOW); -return projected_position.xyz; -} -vec2 project_position(vec2 position) { -vec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_LOW); -return projected_position.xy; -} -vec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) { -return viewProjectionMatrix * position + center; -} -vec4 project_common_position_to_clipspace(vec4 position) { -return project_common_position_to_clipspace(position, project.viewProjectionMatrix, project.center); -} -vec2 project_pixel_size_to_clipspace(vec2 pixels) { -vec2 offset = pixels / project.viewportSize * project.devicePixelRatio * 2.0; -return offset * project.focalDistance; -} -float project_size_to_pixel(float meters) { -return project_size(meters) * project.scale; -} -float project_size_to_pixel(float size, int unit) { -if (unit == UNIT_METERS) return project_size_to_pixel(size); -if (unit == UNIT_COMMON) return size * project.scale; -return size; -} -float project_pixel_size(float pixels) { -return pixels / project.scale; -} -vec2 project_pixel_size(vec2 pixels) { -return pixels / project.scale; -} -`;function gW(t,e){if(t===e)return!0;if(Array.isArray(t)){const n=t.length;if(!e||e.length!==n)return!1;for(let r=0;r{for(const i in r)if(!gW(r[i],e[i])){n=t(r),e=r;break}return n}}const R2=[0,0,0,0],pW=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],VM=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],mW=[0,0,0],HM=[0,0,0],vW=Zf(bW);function jM(t,e,n=HM){n.length<3&&(n=[n[0],n[1],0]);let r=n,i,a=!0;switch(e===cn.LNGLAT_OFFSETS||e===cn.METER_OFFSETS?i=n:i=t.isGeospatial?[Math.fround(t.longitude),Math.fround(t.latitude),0]:null,t.projectionMode){case _s.WEB_MERCATOR:(e===cn.LNGLAT||e===cn.CARTESIAN)&&(i=[0,0,0],a=!1);break;case _s.WEB_MERCATOR_AUTO_OFFSET:e===cn.LNGLAT?r=i:e===cn.CARTESIAN&&(r=[Math.fround(t.center[0]),Math.fround(t.center[1]),0],i=t.unprojectPosition(r),r[0]-=n[0],r[1]-=n[1],r[2]-=n[2]);break;case _s.IDENTITY:r=t.position.map(Math.fround),r[2]=r[2]||0;break;case _s.GLOBE:a=!1,i=null;break;default:a=!1}return{geospatialOrigin:i,shaderCoordinateOrigin:r,offsetMode:a}}function _W(t,e,n){const{viewMatrixUncentered:r,projectionMatrix:i}=t;let{viewMatrix:a,viewProjectionMatrix:l}=t,u=R2,f=R2,h=t.cameraPosition;const{geospatialOrigin:g,shaderCoordinateOrigin:m,offsetMode:v}=jM(t,e,n);return v&&(f=t.projectPosition(g||m),h=[h[0]-f[0],h[1]-f[1],h[2]-f[2]],f[3]=1,u=Kf([],f,l),a=r||a,l=Do([],i,a),l=Do([],l,pW)),{viewMatrix:a,viewProjectionMatrix:l,projectionCenter:u,originCommon:f,cameraPosCommon:h,shaderCoordinateOrigin:m,geospatialOrigin:g}}function yW({viewport:t,devicePixelRatio:e=1,modelMatrix:n=null,coordinateSystem:r=cn.DEFAULT,coordinateOrigin:i=HM,autoWrapLongitude:a=!1}){r===cn.DEFAULT&&(r=t.isGeospatial?cn.LNGLAT:cn.CARTESIAN);const l=vW({viewport:t,devicePixelRatio:e,coordinateSystem:r,coordinateOrigin:i});return l.wrapLongitude=a,l.modelMatrix=n||VM,l}function bW({viewport:t,devicePixelRatio:e,coordinateSystem:n,coordinateOrigin:r}){const{projectionCenter:i,viewProjectionMatrix:a,originCommon:l,cameraPosCommon:u,shaderCoordinateOrigin:f,geospatialOrigin:h}=_W(t,n,r),g=t.getDistanceScales(),m=[t.width*e,t.height*e],v=Kf([],[0,0,-t.focalDistance,1],t.projectionMatrix)[3]||1,S={coordinateSystem:n,projectionMode:t.projectionMode,coordinateOrigin:f,commonOrigin:l.slice(0,3),center:i,pseudoMeters:!!t._pseudoMeters,viewportSize:m,devicePixelRatio:e,focalDistance:v,commonUnitsPerMeter:g.unitsPerMeter,commonUnitsPerWorldUnit:g.unitsPerMeter,commonUnitsPerWorldUnit2:mW,scale:t.scale,wrapLongitude:!1,viewProjectionMatrix:a,modelMatrix:VM,cameraPosition:u};if(h){const w=t.getDistanceScales(h);switch(n){case cn.METER_OFFSETS:S.commonUnitsPerWorldUnit=w.unitsPerMeter,S.commonUnitsPerWorldUnit2=w.unitsPerMeter2;break;case cn.LNGLAT:case cn.LNGLAT_OFFSETS:t._pseudoMeters||(S.commonUnitsPerMeter=w.unitsPerMeter),S.commonUnitsPerWorldUnit=w.unitsPerDegree,S.commonUnitsPerWorldUnit2=w.unitsPerDegree2;break;case cn.CARTESIAN:S.commonUnitsPerWorldUnit=[1,1,w.unitsPerMeter[2]],S.commonUnitsPerWorldUnit2=[0,0,w.unitsPerMeter2[2]];break}}return S}const SW={};function EW(t=SW){return"viewport"in t?yW(t):{}}const hb={name:"project",dependencies:[JH,FM],vs:hW,getUniforms:EW,uniformTypes:{wrapLongitude:"f32",coordinateSystem:"i32",commonUnitsPerMeter:"vec3",projectionMode:"i32",scale:"f32",commonUnitsPerWorldUnit:"vec3",commonUnitsPerWorldUnit2:"vec3",center:"vec4",modelMatrix:"mat4x4",viewProjectionMatrix:"mat4x4",viewportSize:"vec2",devicePixelRatio:"f32",focalDistance:"f32",cameraPosition:"vec3",coordinateOrigin:"vec3",commonOrigin:"vec3",pseudoMeters:"f32"}},wW=` -vec4 project_position_to_clipspace( - vec3 position, vec3 position64Low, vec3 offset, out vec4 commonPosition -) { - vec3 projectedPosition = project_position(position, position64Low); - mat3 rotation; - if (project_needs_rotation(projectedPosition, rotation)) { - // offset is specified as ENU - // when in globe projection, rotate offset so that the ground alighs with the surface of the globe - offset = rotation * offset; - } - commonPosition = vec4(projectedPosition + offset, 1.0); - return project_common_position_to_clipspace(commonPosition); -} - -vec4 project_position_to_clipspace( - vec3 position, vec3 position64Low, vec3 offset -) { - vec4 commonPosition; - return project_position_to_clipspace(position, position64Low, offset, commonPosition); -} -`,WM={name:"project32",dependencies:[hb],vs:wW};function TW(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function rc(t,e){const n=Kf([],e,t);return HH(n,n,1/n[3]),n}function x2(t,e){const n=t%e;return n<0?e+n:n}function ny(t,e,n){return tn?n:t}function CW(t){return Math.log(t)*Math.LOG2E}const gb=Math.log2||CW;function js(t,e){if(!t)throw new Error(e||"@math.gl/web-mercator: assertion failed.")}const Qi=Math.PI,XM=Qi/4,Pi=Qi/180,ry=180/Qi,Pc=512,Eg=4003e4,M2=85.051129,AW=1.5;function RW(t){return gb(t)}function wg(t){const[e,n]=t;js(Number.isFinite(e)),js(Number.isFinite(n)&&n>=-90&&n<=90,"invalid latitude");const r=e*Pi,i=n*Pi,a=Pc*(r+Qi)/(2*Qi),l=Pc*(Qi+Math.log(Math.tan(XM+i*.5)))/(2*Qi);return[a,l]}function Nc(t){const[e,n]=t,r=e/Pc*(2*Qi)-Qi,i=2*(Math.atan(Math.exp(n/Pc*(2*Qi)-Qi))-XM);return[r*ry,i*ry]}function xW(t){const{latitude:e}=t;js(Number.isFinite(e));const n=Math.cos(e*Pi);return RW(Eg*n)-9}function i0(t){const e=Math.cos(t*Pi);return Pc/Eg/e}function iy(t){const{latitude:e,longitude:n,highPrecision:r=!1}=t;js(Number.isFinite(e)&&Number.isFinite(n));const i=Pc,a=Math.cos(e*Pi),l=i/360,u=l/a,f=i/Eg/a,h={unitsPerMeter:[f,f,f],metersPerUnit:[1/f,1/f,1/f],unitsPerDegree:[l,u,f],degreesPerUnit:[1/l,1/u,1/f]};if(r){const g=Pi*Math.tan(e*Pi)/a,m=l*g/2,v=i/Eg*g,S=v/u*f;h.unitsPerDegree2=[0,m,v],h.unitsPerMeter2=[S,0,S]}return h}function qM(t,e){const[n,r,i]=t,[a,l,u]=e,{unitsPerMeter:f,unitsPerMeter2:h}=iy({longitude:n,latitude:r,highPrecision:!0}),g=wg(t);g[0]+=a*(f[0]+h[0]*l),g[1]+=l*(f[1]+h[1]*l);const m=Nc(g),v=(i||0)+(u||0);return Number.isFinite(i)||Number.isFinite(u)?[m[0],m[1],v]:m}function MW(t){const{height:e,pitch:n,bearing:r,altitude:i,scale:a,center:l}=t,u=TW();bg(u,u,[0,0,-i]),AM(u,u,-n*Pi),RM(u,u,r*Pi);const f=a/e;return db(u,u,[f,f,f]),l&&bg(u,u,yH([],l)),u}function OW(t){const{width:e,height:n,altitude:r,pitch:i=0,offset:a,center:l,scale:u,nearZMultiplier:f=1,farZMultiplier:h=1}=t;let{fovy:g=Tg(AW)}=t;r!==void 0&&(g=Tg(r));const m=g*Pi,v=i*Pi,S=YM(g);let w=S;l&&(w+=l[2]*u/Math.cos(v)/n);const E=m*(.5+(a?a[1]:0)/n),b=Math.sin(E)*w/Math.sin(ny(Math.PI/2-v-E,.01,Math.PI-.01)),C=Math.sin(v)*b+w,T=w*10,A=Math.min(C*h,T);return{fov:m,aspect:e/n,focalDistance:S,near:f,far:A}}function Tg(t){return 2*Math.atan(.5/t)*ry}function YM(t){return .5/Math.tan(.5*t*Pi)}function KM(t,e){const[n,r,i=0]=t;return js(Number.isFinite(n)&&Number.isFinite(r)&&Number.isFinite(i)),rc(e,[n,r,i,1])}function pb(t,e,n=0){const[r,i,a]=t;if(js(Number.isFinite(r)&&Number.isFinite(i),"invalid pixel coordinate"),Number.isFinite(a))return rc(e,[r,i,a,1]);const l=rc(e,[r,i,0,1]),u=rc(e,[r,i,1,1]),f=l[2],h=u[2],g=f===h?0:((n||0)-f)/(h-f);return wM([],l,u,g)}function PW(t){const{width:e,height:n,bounds:r,minExtent:i=0,maxZoom:a=24,offset:l=[0,0]}=t,[[u,f],[h,g]]=r,m=NW(t.padding),v=wg([u,ny(g,-85.051129,M2)]),S=wg([h,ny(f,-85.051129,M2)]),w=[Math.max(Math.abs(S[0]-v[0]),i),Math.max(Math.abs(S[1]-v[1]),i)],E=[e-m.left-m.right-Math.abs(l[0])*2,n-m.top-m.bottom-Math.abs(l[1])*2];js(E[0]>0&&E[1]>0);const b=E[0]/w[0],C=E[1]/w[1],T=(m.right-m.left)/2/b,A=(m.top-m.bottom)/2/C,O=[(S[0]+v[0])/2+T,(S[1]+v[1])/2+A],x=Nc(O),N=Math.min(a,gb(Math.abs(Math.min(b,C))));return js(Number.isFinite(N)),{longitude:x[0],latitude:x[1],zoom:N}}function NW(t=0){return typeof t=="number"?{top:t,bottom:t,left:t,right:t}:(js(Number.isFinite(t.top)&&Number.isFinite(t.bottom)&&Number.isFinite(t.left)&&Number.isFinite(t.right)),t)}const O2=Math.PI/180;function IW(t,e=0){const{width:n,height:r,unproject:i}=t,a={targetZ:e},l=i([0,r],a),u=i([n,r],a);let f,h;const g=t.fovy?.5*t.fovy*O2:Math.atan(.5/t.altitude),m=(90-t.pitch)*O2;return g>m-.01?(f=P2(t,0,e),h=P2(t,n,e)):(f=i([0,0],a),h=i([n,0],a)),[l,u,h,f]}function P2(t,e,n){const{pixelUnprojectionMatrix:r}=t,i=rc(r,[e,0,1,1]),a=rc(r,[e,t.height,1,1]),u=(n*t.distanceScales.unitsPerMeter[2]-i[2])/(a[2]-i[2]),f=wM([],i,a,u),h=Nc(f);return h.push(n),h}const N2=512;function DW(t){const{width:e,height:n,pitch:r=0}=t;let{longitude:i,latitude:a,zoom:l,bearing:u=0}=t;(i<-180||i>180)&&(i=x2(i+180,360)-180),(u<-180||u>180)&&(u=x2(u+180,360)-180);const f=gb(n/N2);if(l<=f)l=f,a=0;else{const h=n/2/Math.pow(2,l),g=Nc([0,h])[1];if(am&&(a=m)}}return{width:e,height:n,longitude:i,latitude:a,zoom:l,pitch:r,bearing:u}}const ZM=` -uniform shadowUniforms { - bool drawShadowMap; - bool useShadowMap; - vec4 color; - highp int lightId; - float lightCount; - mat4 viewProjectionMatrix0; - mat4 viewProjectionMatrix1; - vec4 projectCenter0; - vec4 projectCenter1; -} shadow; -`,FW=` -const int max_lights = 2; - -out vec3 shadow_vPosition[max_lights]; - -vec4 shadow_setVertexPosition(vec4 position_commonspace) { - mat4 viewProjectionMatrices[max_lights]; - viewProjectionMatrices[0] = shadow.viewProjectionMatrix0; - viewProjectionMatrices[1] = shadow.viewProjectionMatrix1; - vec4 projectCenters[max_lights]; - projectCenters[0] = shadow.projectCenter0; - projectCenters[1] = shadow.projectCenter1; - - if (shadow.drawShadowMap) { - return project_common_position_to_clipspace(position_commonspace, viewProjectionMatrices[shadow.lightId], projectCenters[shadow.lightId]); - } - if (shadow.useShadowMap) { - for (int i = 0; i < max_lights; i++) { - if(i < int(shadow.lightCount)) { - vec4 shadowMap_position = project_common_position_to_clipspace(position_commonspace, viewProjectionMatrices[i], projectCenters[i]); - shadow_vPosition[i] = (shadowMap_position.xyz / shadowMap_position.w + 1.0) / 2.0; - } - } - } - return gl_Position; -} -`,kW=` -${ZM} -${FW} -`,BW=` -const int max_lights = 2; -uniform sampler2D shadow_uShadowMap0; -uniform sampler2D shadow_uShadowMap1; - -in vec3 shadow_vPosition[max_lights]; - -const vec4 bitPackShift = vec4(1.0, 255.0, 65025.0, 16581375.0); -const vec4 bitUnpackShift = 1.0 / bitPackShift; -const vec4 bitMask = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0); - -float shadow_getShadowWeight(vec3 position, sampler2D shadowMap) { - vec4 rgbaDepth = texture(shadowMap, position.xy); - - float z = dot(rgbaDepth, bitUnpackShift); - return smoothstep(0.001, 0.01, position.z - z); -} - -vec4 shadow_filterShadowColor(vec4 color) { - if (shadow.drawShadowMap) { - vec4 rgbaDepth = fract(gl_FragCoord.z * bitPackShift); - rgbaDepth -= rgbaDepth.gbaa * bitMask; - return rgbaDepth; - } - if (shadow.useShadowMap) { - float shadowAlpha = 0.0; - shadowAlpha += shadow_getShadowWeight(shadow_vPosition[0], shadow_uShadowMap0); - if(shadow.lightCount > 1.0) { - shadowAlpha += shadow_getShadowWeight(shadow_vPosition[1], shadow_uShadowMap1); - } - shadowAlpha *= shadow.color.a / shadow.lightCount; - float blendedAlpha = shadowAlpha + color.a * (1.0 - shadowAlpha); - - return vec4( - mix(color.rgb, shadow.color.rgb, shadowAlpha / blendedAlpha), - blendedAlpha - ); - } - return color; -} -`,UW=` -${ZM} -${BW} -`,LW=Zf(jW),zW=Zf(WW),$W=[0,0,0,1],VW=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0];function HW(t,e){const[n,r,i]=t,a=pb([n,r,i],e);return Number.isFinite(i)?a:[a[0],a[1],0]}function jW({viewport:t,center:e}){return new Ss(t.viewProjectionMatrix).invert().transform(e)}function WW({viewport:t,shadowMatrices:e}){const n=[],r=t.pixelUnprojectionMatrix,i=t.isGeospatial?void 0:1,a=[[0,0,i],[t.width,0,i],[0,t.height,i],[t.width,t.height,i],[0,0,-1],[t.width,0,-1],[0,t.height,-1],[t.width,t.height,-1]].map(l=>HW(l,r));for(const l of e){const u=l.clone().translate(new bs(t.center).negate()),f=a.map(g=>u.transform(g)),h=new Ss().ortho({left:Math.min(...f.map(g=>g[0])),right:Math.max(...f.map(g=>g[0])),bottom:Math.min(...f.map(g=>g[1])),top:Math.max(...f.map(g=>g[1])),near:Math.min(...f.map(g=>-g[2])),far:Math.max(...f.map(g=>-g[2]))});n.push(h.multiplyRight(l))}return n}function XW(t){const{shadowEnabled:e=!0,project:n}=t;if(!e||!n||!t.shadowMatrices||!t.shadowMatrices.length)return{drawShadowMap:!1,useShadowMap:!1,shadow_uShadowMap0:t.dummyShadowMap,shadow_uShadowMap1:t.dummyShadowMap};const r=hb.getUniforms(n),i=LW({viewport:n.viewport,center:r.center}),a=[],l=zW({shadowMatrices:t.shadowMatrices,viewport:n.viewport}).slice();for(let f=0;f0:!1,color:t.shadowColor||$W,lightId:t.shadowLightId||0,lightCount:t.shadowMatrices.length,shadow_uShadowMap0:t.dummyShadowMap,shadow_uShadowMap1:t.dummyShadowMap};for(let f=0;f",lightId:"i32",lightCount:"f32",viewProjectionMatrix0:"mat4x4",viewProjectionMatrix1:"mat4x4",projectCenter0:"vec4",projectCenter1:"vec4"}},QM={...c2,defaultUniforms:{...c2.defaultUniforms,useFloatColors:!1},inject:{"vs:DECKGL_FILTER_GL_POSITION":` - // for picking depth values - picking_setPickingAttribute(position.z / position.w); - `,"vs:DECKGL_FILTER_COLOR":` - picking_setPickingColor(geometry.pickingColor); - `,"fs:DECKGL_FILTER_COLOR":{order:99,injection:` - // use highlight color if this fragment belongs to the selected object. - color = picking_filterHighlightColor(color); - - // use picking color if rendering to picking FBO. - color = picking_filterPickingColor(color); - `}}},qW=[FM],YW=["vs:DECKGL_FILTER_SIZE(inout vec3 size, VertexGeometry geometry)","vs:DECKGL_FILTER_GL_POSITION(inout vec4 position, VertexGeometry geometry)","vs:DECKGL_FILTER_COLOR(inout vec4 color, VertexGeometry geometry)","fs:DECKGL_FILTER_COLOR(inout vec4 color, FragmentGeometry geometry)"];function KW(){const t=ug.getDefaultShaderAssembler();for(const e of qW)t.addDefaultModule(e);for(const e of YW)t.addShaderHook(e);return t}const ZW=[255,255,255],QW=1;let GW=0;class JW{constructor(e={}){this.type="ambient";const{color:n=ZW}=e,{intensity:r=QW}=e;this.id=e.id||`ambient-${GW++}`,this.color=n,this.intensity=r}}const eX=[255,255,255],tX=1,nX=[0,0,-1];let rX=0;class D2{constructor(e={}){this.type="directional";const{color:n=eX}=e,{intensity:r=tX}=e,{direction:i=nX}=e,{_shadow:a=!1}=e;this.id=e.id||`directional-${rX++}`,this.color=n,this.intensity=r,this.type="directional",this.direction=new bs(i).normalize().toArray(),this.shadow=a}getProjectedLight(e){return this}}class iX{constructor(e,n={id:"pass"}){const{id:r}=n;this.id=r,this.device=e,this.props={...n}}setProps(e){Object.assign(this.props,e)}render(e){}cleanup(){}}class mb extends iX{constructor(){super(...arguments),this._lastRenderIndex=-1}render(e){const[n,r]=this.device.canvasContext.getDrawingBufferSize(),i=e.clearCanvas??!0,a=e.clearColor??(i?[0,0,0,0]:!1),l=i?1:!1,u=i?0:!1,f=e.colorMask??15,h={viewport:[0,0,n,r]};e.colorMask&&(h.colorMask=f),e.scissorRect&&(h.scissorRect=e.scissorRect);const g=this.device.beginRenderPass({framebuffer:e.target,parameters:h,clearColor:a,clearDepth:l,clearStencil:u});try{return this._drawLayers(g,e)}finally{g.end()}}_drawLayers(e,n){const{target:r,shaderModuleProps:i,viewports:a,views:l,onViewportActive:u,clearStack:f=!0}=n;n.pass=n.pass||"unknown",f&&(this._lastRenderIndex=-1);const h=[];for(const g of a){const m=l&&l[g.id];u==null||u(g);const v=this._getDrawLayerParams(g,n),S=g.subViewports||[g];for(const w of S){const E=this._drawLayersInViewport(e,{target:r,shaderModuleProps:i,viewport:w,view:m,pass:n.pass,layers:n.layers},v);h.push(E)}}return h}_getDrawLayerParams(e,{layers:n,pass:r,isPicking:i=!1,layerFilter:a,cullRect:l,effects:u,shaderModuleProps:f},h=!1){var w;const g=[],m=GM(this._lastRenderIndex+1),v={layer:n[0],viewport:e,isPicking:i,renderPass:r,cullRect:l},S={};for(let E=0;E{const l=i.props._offset,u=i.id,f=i.parent&&i.parent.id;let h;if(f&&!(f in e)&&r(i.parent,!1),f in n){const g=n[f]=n[f]||GM(e[f],e);h=g(i,a),n[u]=g}else Number.isFinite(l)?(h=l+(e[f]||0),n[u]=null):h=t;return a&&h>=t&&(t=h+1),e[u]=h,h};return r}function sX(t,{shaderModuleProps:e,target:n,viewport:r}){var f;const i=((f=e==null?void 0:e.project)==null?void 0:f.devicePixelRatio)??t.canvasContext.cssToDeviceRatio(),[,a]=t.canvasContext.getDrawingBufferSize(),l=n?n.height:a,u=r;return[u.x*i,l-(u.y+u.height)*i,u.width*i,u.height*i]}function F2(t,...e){for(const n of e)if(n)for(const r in n)t[r]?Object.assign(t[r],n[r]):t[r]=n[r];return t}class aX extends mb{constructor(e,n){super(e,n);const r=e.createTexture({format:"rgba8unorm",width:1,height:1,sampler:{minFilter:"linear",magFilter:"linear",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"},mipmaps:!0}),i=e.createTexture({format:"depth16unorm",width:1,height:1,mipmaps:!1});this.fbo=e.createFramebuffer({id:"shadowmap",width:1,height:1,colorAttachments:[r],depthStencilAttachment:i})}delete(){this.fbo&&(this.fbo.destroy(),this.fbo=null)}getShadowMap(){return this.fbo.colorAttachments[0].texture}render(e){const n=this.fbo,r=this.device.canvasContext.cssToDeviceRatio(),i=e.viewports[0],a=i.width*r,l=i.height*r,u=[1,1,1,1];(a!==n.width||l!==n.height)&&n.resize({width:a,height:l}),super.render({...e,clearColor:u,target:n,pass:"shadow"})}getLayerParameters(e,n,r){return{...e.props.parameters,blend:!1,depthWriteEnabled:!0,depthCompare:"less-equal"}}shouldDrawLayer(e){return e.props.shadowEnabled!==!1}getShaderModuleProps(e,n,r){return{shadow:{project:r.project,drawToShadowMap:!0}}}}const oX={color:[255,255,255],intensity:1},k2=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],lX=[0,0,0,200/255];class JM{constructor(e={}){this.id="lighting-effect",this.shadowColor=lX,this.shadow=!1,this.directionalLights=[],this.pointLights=[],this.shadowPasses=[],this.dummyShadowMap=null,this.setProps(e)}setup(e){this.context=e;const{device:n,deck:r}=e;this.shadow&&!this.dummyShadowMap&&(this._createShadowPasses(n),r._addDefaultShaderModule(I2),this.dummyShadowMap=n.createTexture({width:1,height:1}))}setProps(e){this.ambientLight=void 0,this.directionalLights=[],this.pointLights=[];for(const n in e){const r=e[n];switch(r.type){case"ambient":this.ambientLight=r;break;case"directional":this.directionalLights.push(r);break;case"point":this.pointLights.push(r);break}}this._applyDefaultLights(),this.shadow=this.directionalLights.some(n=>n.shadow),this.context&&this.setup(this.context),this.props=e}preRender({layers:e,layerFilter:n,viewports:r,onViewportActive:i,views:a}){if(this.shadow){this.shadowMatrices=this._calculateMatrices();for(let l=0;ll.getShadowMap()),dummyShadowMap:this.dummyShadowMap,shadowColor:this.shadowColor,shadowMatrices:this.shadowMatrices}:{},i={enabled:!0,ambientLight:this.ambientLight,directionalLights:this.directionalLights.map(l=>l.getProjectedLight({layer:e})),pointLights:this.pointLights.map(l=>l.getProjectedLight({layer:e}))},a=e.props.material;return{shadow:r,lighting:i,phongMaterial:a,gouraudMaterial:a}}cleanup(e){for(const n of this.shadowPasses)n.delete();this.shadowPasses.length=0,this.dummyShadowMap&&(this.dummyShadowMap.destroy(),this.dummyShadowMap=null,e.deck._removeDefaultShaderModule(I2))}_calculateMatrices(){const e=[];for(const n of this.directionalLights){const r=new Ss().lookAt({eye:new bs(n.direction).negate()});e.push(r)}return e}_createShadowPasses(e){for(let n=0;ni&&(a=i);const l=this._pool,u=e.BYTES_PER_ELEMENT*a,f=l.findIndex(h=>h.byteLength>=u);if(f>=0){const h=new e(l.splice(f,1)[0],0,a);return r&&h.fill(0),h}return new e(a)}_release(e){if(!ArrayBuffer.isView(e))return;const n=this._pool,{buffer:r}=e,{byteLength:i}=r,a=n.findIndex(l=>l.byteLength>=i);a<0?n.push(r):(a>0||n.lengththis.opts.poolSize&&n.shift()}}const Nf=new cX;function Yu(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function uX(t){return[t[12],t[13],t[14]]}function fX(t){return{left:zl(t[3]+t[0],t[7]+t[4],t[11]+t[8],t[15]+t[12]),right:zl(t[3]-t[0],t[7]-t[4],t[11]-t[8],t[15]-t[12]),bottom:zl(t[3]+t[1],t[7]+t[5],t[11]+t[9],t[15]+t[13]),top:zl(t[3]-t[1],t[7]-t[5],t[11]-t[9],t[15]-t[13]),near:zl(t[3]+t[2],t[7]+t[6],t[11]+t[10],t[15]+t[14]),far:zl(t[3]-t[2],t[7]-t[6],t[11]-t[10],t[15]-t[14])}}const B2=new bs;function zl(t,e,n,r){B2.set(t,e,n);const i=B2.len();return{distance:r/i,normal:new bs(-t/i,-e/i,-n/i)}}function dX(t){return t-Math.fround(t)}let Vu;function s0(t,e){const{size:n=1,startIndex:r=0}=e,i=e.endIndex!==void 0?e.endIndex:t.length,a=(i-r)/n;Vu=Nf.allocate(Vu,a,{type:Float32Array,size:n*2});let l=r,u=0;for(;l=n.delay+n.duration*n.repeat}getTime(e){if(e===void 0)return this.time;const n=this.channels.get(e);return n===void 0?-1:n.time}setTime(e){this.time=Math.max(0,e);const n=this.channels.values();for(const i of n)this._setChannelTime(i,this.time);const r=this.animations.values();for(const i of r){const{animation:a,channel:l}=i;a.setTime(this.getTime(l))}}play(){this.playing=!0}pause(){this.playing=!1,this.lastEngineTime=-1}reset(){this.setTime(0)}attachAnimation(e,n){const r=SX++;return this.animations.set(r,{animation:e,channel:n}),e.setTime(this.getTime(n)),r}detachAnimation(e){this.animations.delete(e)}update(e){this.playing&&(this.lastEngineTime===-1&&(this.lastEngineTime=e),this.setTime(this.time+(e-this.lastEngineTime)),this.lastEngineTime=e)}_setChannelTime(e,n){const r=n-e.delay,i=e.duration*e.repeat;r>=i?e.time=e.duration*e.rate:(e.time=Math.max(0,r)%e.duration,e.time*=e.rate)}}function EX(t){return typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame(t):setTimeout(t,1e3/60)}function wX(t){return typeof window<"u"&&window.cancelAnimationFrame?window.cancelAnimationFrame(t):clearTimeout(t)}let TX=0;const CX={device:null,onAddHTML:()=>"",onInitialize:async()=>null,onRender:()=>{},onFinalize:()=>{},onError:t=>console.error(t),stats:U_.stats.get(`animation-loop-${TX++}`),useDevicePixels:!0,autoResizeViewport:!1,autoResizeDrawingBuffer:!1};class AX{constructor(e){M(this,"device",null);M(this,"canvas",null);M(this,"props");M(this,"animationProps",null);M(this,"timeline",null);M(this,"stats");M(this,"cpuTime");M(this,"gpuTime");M(this,"frameRate");M(this,"display");M(this,"needsRedraw","initialized");M(this,"_initialized",!1);M(this,"_running",!1);M(this,"_animationFrameId",null);M(this,"_nextFramePromise",null);M(this,"_resolveNextFrame",null);M(this,"_cpuStartTime",0);M(this,"_error",null);if(this.props={...CX,...e},e=this.props,!e.device)throw new Error("No device provided");const{useDevicePixels:n=!0}=this.props;this.stats=e.stats||new Xg({id:"animation-loop-stats"}),this.cpuTime=this.stats.get("CPU Time"),this.gpuTime=this.stats.get("GPU Time"),this.frameRate=this.stats.get("Frame Rate"),this.setProps({autoResizeViewport:e.autoResizeViewport,autoResizeDrawingBuffer:e.autoResizeDrawingBuffer,useDevicePixels:n}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}destroy(){this.stop(),this._setDisplay(null)}delete(){this.destroy()}setError(e){var r,i;if(this.props.onError(e),this._error=Error(),((i=(r=this.device)==null?void 0:r.canvasContext)==null?void 0:i.canvas)instanceof HTMLCanvasElement){const a=document.createElement("h1");a.innerHTML=e.message,a.style.position="absolute",a.style.top="20%",a.style.left="10px",a.style.color="black",a.style.backgroundColor="red",document.body.appendChild(a)}}setNeedsRedraw(e){return this.needsRedraw=this.needsRedraw||e,this}setProps(e){return"autoResizeViewport"in e&&(this.props.autoResizeViewport=e.autoResizeViewport||!1),"autoResizeDrawingBuffer"in e&&(this.props.autoResizeDrawingBuffer=e.autoResizeDrawingBuffer||!1),"useDevicePixels"in e&&(this.props.useDevicePixels=e.useDevicePixels||!1),this}async start(){if(this._running)return this;this._running=!0;try{let e;return this._initialized||(this._initialized=!0,await this._initDevice(),this._initialize(),await this.props.onInitialize(this._getAnimationProps())),this._running?(e!==!1&&(this._cancelAnimationFrame(),this._requestAnimationFrame()),this):null}catch(e){const n=e instanceof Error?e:new Error("Unknown error");throw this.props.onError(n),n}}stop(){return this._running&&(this.animationProps&&!this._error&&this.props.onFinalize(this.animationProps),this._cancelAnimationFrame(),this._nextFramePromise=null,this._resolveNextFrame=null,this._running=!1),this}redraw(){var e;return(e=this.device)!=null&&e.isLost||this._error?this:(this._beginFrameTimers(),this._setupFrame(),this._updateAnimationProps(),this._renderFrame(this._getAnimationProps()),this._clearNeedsRedraw(),this._resolveNextFrame&&(this._resolveNextFrame(this),this._nextFramePromise=null,this._resolveNextFrame=null),this._endFrameTimers(),this)}attachTimeline(e){return this.timeline=e,this.timeline}detachTimeline(){this.timeline=null}waitForRender(){return this.setNeedsRedraw("waitForRender"),this._nextFramePromise||(this._nextFramePromise=new Promise(e=>{this._resolveNextFrame=e})),this._nextFramePromise}async toDataURL(){if(this.setNeedsRedraw("toDataURL"),await this.waitForRender(),this.canvas instanceof HTMLCanvasElement)return this.canvas.toDataURL();throw new Error("OffscreenCanvas")}_initialize(){this._startEventHandling(),this._initializeAnimationProps(),this._updateAnimationProps(),this._resizeCanvasDrawingBuffer(),this._resizeViewport()}_setDisplay(e){this.display&&(this.display.destroy(),this.display.animationLoop=null),e&&(e.animationLoop=this),this.display=e}_requestAnimationFrame(){this._running&&(this._animationFrameId=EX(this._animationFrame.bind(this)))}_cancelAnimationFrame(){this._animationFrameId!==null&&(wX(this._animationFrameId),this._animationFrameId=null)}_animationFrame(){this._running&&(this.redraw(),this._requestAnimationFrame())}_renderFrame(e){var n;if(this.display){this.display._renderFrame(e);return}this.props.onRender(this._getAnimationProps()),(n=this.device)==null||n.submit()}_clearNeedsRedraw(){this.needsRedraw=!1}_setupFrame(){this._resizeCanvasDrawingBuffer(),this._resizeViewport()}_initializeAnimationProps(){var n,r;const e=(r=(n=this.device)==null?void 0:n.canvasContext)==null?void 0:r.canvas;if(!this.device||!e)throw new Error("loop");this.animationProps={animationLoop:this,device:this.device,canvas:e,timeline:this.timeline,useDevicePixels:this.props.useDevicePixels,needsRedraw:!1,width:1,height:1,aspect:1,time:0,startTime:Date.now(),engineTime:0,tick:0,tock:0,_mousePosition:null}}_getAnimationProps(){if(!this.animationProps)throw new Error("animationProps");return this.animationProps}_updateAnimationProps(){if(!this.animationProps)return;const{width:e,height:n,aspect:r}=this._getSizeAndAspect();(e!==this.animationProps.width||n!==this.animationProps.height)&&this.setNeedsRedraw("drawing buffer resized"),r!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=e,this.animationProps.height=n,this.animationProps.aspect=r,this.animationProps.needsRedraw=this.needsRedraw,this.animationProps.engineTime=Date.now()-this.animationProps.startTime,this.timeline&&this.timeline.update(this.animationProps.engineTime),this.animationProps.tick=Math.floor(this.animationProps.time/1e3*60),this.animationProps.tock++,this.animationProps.time=this.timeline?this.timeline.getTime():this.animationProps.engineTime}async _initDevice(){var e;if(this.device=await this.props.device,!this.device)throw new Error("No device provided");this.canvas=((e=this.device.canvasContext)==null?void 0:e.canvas)||null}_createInfoDiv(){if(this.canvas&&this.props.onAddHTML){const e=document.createElement("div");document.body.appendChild(e),e.style.position="relative";const n=document.createElement("div");n.style.position="absolute",n.style.left="10px",n.style.bottom="10px",n.style.width="300px",n.style.background="white",this.canvas instanceof HTMLCanvasElement&&e.appendChild(this.canvas),e.appendChild(n);const r=this.props.onAddHTML(n);r&&(n.innerHTML=r)}}_getSizeAndAspect(){var a,l,u,f;if(!this.device)return{width:1,height:1,aspect:1};const[e,n]=((l=(a=this.device)==null?void 0:a.canvasContext)==null?void 0:l.getPixelSize())||[1,1];let r=1;const i=(f=(u=this.device)==null?void 0:u.canvasContext)==null?void 0:f.canvas;return i&&i.clientHeight?r=i.clientWidth/i.clientHeight:e>0&&n>0&&(r=e/n),{width:e,height:n,aspect:r}}_resizeViewport(){this.props.autoResizeViewport&&this.device.gl&&this.device.gl.viewport(0,0,this.device.gl.drawingBufferWidth,this.device.gl.drawingBufferHeight)}_resizeCanvasDrawingBuffer(){var e,n;this.props.autoResizeDrawingBuffer&&((n=(e=this.device)==null?void 0:e.canvasContext)==null||n.resize({useDevicePixels:this.props.useDevicePixels}))}_beginFrameTimers(){this.frameRate.timeEnd(),this.frameRate.timeStart(),this.cpuTime.timeStart()}_endFrameTimers(){this.cpuTime.timeEnd()}_startEventHandling(){this.canvas&&(this.canvas.addEventListener("mousemove",this._onMousemove.bind(this)),this.canvas.addEventListener("mouseleave",this._onMouseleave.bind(this)))}_onMousemove(e){e instanceof MouseEvent&&(this._getAnimationProps()._mousePosition=[e.offsetX,e.offsetY])}_onMouseleave(e){this._getAnimationProps()._mousePosition=null}}const o0={};function Gf(t="id"){o0[t]=o0[t]||1;const e=o0[t]++;return`${t}-${e}`}class z2{constructor(e){M(this,"id");M(this,"userData",{});M(this,"topology");M(this,"bufferLayout",[]);M(this,"vertexCount");M(this,"indices");M(this,"attributes");if(this.id=e.id||Gf("geometry"),this.topology=e.topology,this.indices=e.indices||null,this.attributes=e.attributes,this.vertexCount=e.vertexCount,this.bufferLayout=e.bufferLayout||[],this.indices&&!(this.indices.usage&$n.INDEX))throw new Error("Index buffer must have INDEX usage")}destroy(){var e;(e=this.indices)==null||e.destroy();for(const n of Object.values(this.attributes))n.destroy()}getVertexCount(){return this.vertexCount}getAttributes(){return this.attributes}getIndexes(){return this.indices||null}_calculateVertexCount(e){return e.byteLength/12}}function RX(t,e){if(e instanceof z2)return e;const n=xX(t,e),{attributes:r,bufferLayout:i}=MX(t,e);return new z2({topology:e.topology||"triangle-list",bufferLayout:i,vertexCount:e.vertexCount,indices:n,attributes:r})}function xX(t,e){if(!e.indices)return;const n=e.indices.value;return t.createBuffer({usage:$n.INDEX,data:n})}function MX(t,e){const n=[],r={};for(const[a,l]of Object.entries(e.attributes)){let u=a;switch(a){case"POSITION":u="positions";break;case"NORMAL":u="normals";break;case"TEXCOORD_0":u="texCoords";break;case"COLOR_0":u="colors";break}if(l){r[u]=t.createBuffer({data:l.value,id:`${a}-buffer`});const{value:f,size:h,normalized:g}=l;n.push({name:u,format:yV(f,h,g)})}}const i=e._calculateVertexCount(e.attributes,e.indices);return{attributes:r,bufferLayout:n,vertexCount:i}}const Vg=class Vg{constructor(e){M(this,"device");M(this,"destroyPolicy");M(this,"_hashCounter",0);M(this,"_hashes",{});M(this,"_renderPipelineCache",{});M(this,"_computePipelineCache",{});this.device=e,this.destroyPolicy=e.props._factoryDestroyPolicy}static getDefaultPipelineFactory(e){return e._lumaData.defaultPipelineFactory=e._lumaData.defaultPipelineFactory||new Vg(e),e._lumaData.defaultPipelineFactory}createRenderPipeline(e){const n={...Rc.defaultProps,...e},r=this._hashRenderPipeline(n);if(!this._renderPipelineCache[r]){const i=this.device.createRenderPipeline({...n,id:n.id?`${n.id}-cached`:void 0});i.hash=r,this._renderPipelineCache[r]={pipeline:i,useCount:0}}return this._renderPipelineCache[r].useCount++,this._renderPipelineCache[r].pipeline}createComputePipeline(e){const n={...pg.defaultProps,...e},r=this._hashComputePipeline(n);if(!this._computePipelineCache[r]){const i=this.device.createComputePipeline({...n,id:n.id?`${n.id}-cached`:void 0});i.hash=r,this._computePipelineCache[r]={pipeline:i,useCount:0}}return this._computePipelineCache[r].useCount++,this._computePipelineCache[r].pipeline}release(e){const n=e.hash,r=e instanceof pg?this._computePipelineCache:this._renderPipelineCache;r[n].useCount--,r[n].useCount===0&&this.destroyPolicy==="unused"&&(r[n].pipeline.destroy(),delete r[n])}_hashComputePipeline(e){return`${this._getHash(e.shader.source)}`}_hashRenderPipeline(e){const n=e.vs?this._getHash(e.vs.source):0,r=e.fs?this._getHash(e.fs.source):0,i="-",a=this._getHash(JSON.stringify(e.bufferLayout));switch(this.device.type){case"webgl":return`${n}/${r}V${i}BL${a}`;default:const l=this._getHash(JSON.stringify(e.parameters));return`${n}/${r}V${i}T${e.topology}P${l}BL${a}`}}_getHash(e){return this._hashes[e]===void 0&&(this._hashes[e]=this._hashCounter++),this._hashes[e]}};M(Vg,"defaultProps",{...Rc.defaultProps});let sy=Vg;const Hg=class Hg{constructor(e){M(this,"device");M(this,"destroyPolicy");M(this,"_cache",{});this.device=e,this.destroyPolicy=e.props._factoryDestroyPolicy}static getDefaultShaderFactory(e){var n;return(n=e._lumaData).defaultShaderFactory||(n.defaultShaderFactory=new Hg(e)),e._lumaData.defaultShaderFactory}createShader(e){const n=this._hashShader(e);let r=this._cache[n];if(!r){const i=this.device.createShader({...e,id:e.id?`${e.id}-cached`:void 0});this._cache[n]=r={shader:i,useCount:0}}return r.useCount++,r.shader}release(e){const n=this._hashShader(e),r=this._cache[n];r&&(r.useCount--,r.useCount===0&&this.destroyPolicy==="unused"&&(delete this._cache[n],r.shader.destroy()))}_hashShader(e){return`${e.stage}:${e.source}`}};M(Hg,"defaultProps",{...dg.defaultProps});let ay=Hg;function OX(t,e){var i;const n={},r="Values";if(t.attributes.length===0&&!((i=t.varyings)!=null&&i.length))return{"No attributes or varyings":{[r]:"N/A"}};for(const a of t.attributes)if(a){const l=`${a.location} ${a.name}: ${a.type}`;n[`in ${l}`]={[r]:a.stepMode||"vertex"}}for(const a of t.varyings||[]){const l=`${a.location} ${a.name}`;n[`out ${l}`]={[r]:JSON.stringify(a)}}return n}let yr=null,uo=null;function PX(t,{id:e,minimap:n,opaque:r,top:i="0",left:a="0",rgbaScale:l=1}){yr||(yr=document.createElement("canvas"),yr.id=e,yr.title=e,yr.style.zIndex="100",yr.style.position="absolute",yr.style.top=i,yr.style.left=a,yr.style.border="blue 5px solid",yr.style.transform="scaleY(-1)",document.body.appendChild(yr),uo=yr.getContext("2d")),(yr.width!==t.width||yr.height!==t.height)&&(yr.width=t.width/2,yr.height=t.height/2,yr.style.width="400px",yr.style.height="400px");const u=t.device.readPixelsToArrayWebGL(t),f=uo==null?void 0:uo.createImageData(t.width,t.height);if(f){for(let g=0;g{const r=t[n];DX(r)?e.uniforms[n]=r:e.bindings[n]=r}),e}class FX{constructor(e,n){M(this,"options",{disableWarnings:!1});M(this,"modules");M(this,"moduleUniforms");M(this,"moduleBindings");Object.assign(this.options,n);const r=ub(Object.values(e).filter(i=>i.dependencies));for(const i of r)e[i.name]=i;Re.log(1,"Creating ShaderInputs with modules",Object.keys(e))(),this.modules=e,this.moduleUniforms={},this.moduleBindings={};for(const[i,a]of Object.entries(e))this._addModule(a),a.name&&i!==a.name&&!this.options.disableWarnings&&Re.warn(`Module name: ${i} vs ${a.name}`)()}destroy(){}setProps(e){var n;for(const r of Object.keys(e)){const i=r,a=e[i]||{},l=this.modules[i];if(!l){this.options.disableWarnings||Re.warn(`Module ${r} not found`)();continue}const u=this.moduleUniforms[i],f=this.moduleBindings[i],h=((n=l.getUniforms)==null?void 0:n.call(l,a,u))||a,{uniforms:g,bindings:m}=rO(h);this.moduleUniforms[i]={...u,...g},this.moduleBindings[i]={...f,...m}}}getModules(){return Object.values(this.modules)}getUniformValues(){return this.moduleUniforms}getBindingValues(){const e={};for(const n of Object.values(this.moduleBindings))Object.assign(e,n);return e}getDebugTable(){var n;const e={};for(const[r,i]of Object.entries(this.moduleUniforms))for(const[a,l]of Object.entries(i))e[`${r}.${a}`]={type:(n=this.modules[r].uniformTypes)==null?void 0:n[a],value:String(l)};return e}_addModule(e){const n=e.name;this.moduleUniforms[n]=e.defaultUniforms||{},this.moduleBindings[n]={}}}let kX="";async function BX(t,e){const n=new Image;return n.crossOrigin="anonymous",n.src=t.startsWith("http")?t:kX+t,await n.decode(),e?await createImageBitmap(n,e):await createImageBitmap(n)}class l0{constructor(e,n){M(this,"device");M(this,"id");M(this,"texture");M(this,"sampler");M(this,"view");M(this,"ready");M(this,"isReady",!1);M(this,"destroyed",!1);M(this,"resolveReady",()=>{});M(this,"rejectReady",()=>{});this.device=e,this.id=n.id||Gf("async-texture"),typeof(n==null?void 0:n.data)=="string"&&n.dimension==="2d"&&(n={...n,data:BX(n.data)}),this.ready=new Promise((r,i)=>{this.resolveReady=()=>{this.isReady=!0,r()},this.rejectReady=i}),this.initAsync(n)}get[Symbol.toStringTag](){return"AsyncTexture"}toString(){return`AsyncTexture:"${this.id}"(${this.isReady?"ready":"loading"})`}async initAsync(e){let n,r;const i=e.data,a=await iO(i).then(n,r);if(this.destroyed)return;const l={...e,data:a};this.texture=this.device.createTexture(l),this.sampler=this.texture.sampler,this.view=this.texture.view,this.isReady=!0}destroy(){this.texture&&(this.texture.destroy(),this.texture=null),this.destroyed=!0}resize(e){if(!this.isReady)throw new Error("Cannot resize texture before it is ready");if(e.width===this.texture.width&&e.height===this.texture.height)return!1;if(this.texture){const n=this.texture;this.texture=n.clone(e),n.destroy()}return!0}}async function iO(t){if(t=await t,Array.isArray(t))return await Promise.all(t.map(iO));if(t&&typeof t=="object"&&t.constructor===Object){const e=t,n=await Promise.all(Object.values(e)),r=Object.keys(e),i={};for(let a=0;a[v.name,v]))||[]),i=n.shaderInputs||new FX(r,{disableWarnings:this.props.disableWarnings});this.setShaderInputs(i);const a=zX(e),l=(((h=this.props.modules)==null?void 0:h.length)>0?this.props.modules:(g=this.shaderInputs)==null?void 0:g.getModules())||[];if(this.device.type==="webgpu"&&this.props.source){(m=this.props).shaderLayout||(m.shaderLayout=rH(this.props.source));const{source:v,getUniforms:S}=this.props.shaderAssembler.assembleWGSLShader({platformInfo:a,...this.props,modules:l});this.source=v,this._getModuleUniforms=S}else{const{vs:v,fs:S,getUniforms:w}=this.props.shaderAssembler.assembleGLSLShaderPair({platformInfo:a,...this.props,modules:l});this.vs=v,this.fs=S,this._getModuleUniforms=w}this.vertexCount=this.props.vertexCount,this.instanceCount=this.props.instanceCount,this.topology=this.props.topology,this.bufferLayout=this.props.bufferLayout,this.parameters=this.props.parameters,n.geometry&&this.setGeometry(n.geometry),this.pipelineFactory=n.pipelineFactory||sy.getDefaultPipelineFactory(this.device),this.shaderFactory=n.shaderFactory||ay.getDefaultShaderFactory(this.device),this.pipeline=this._updatePipeline(),this.vertexArray=e.createVertexArray({renderPipeline:this.pipeline}),this._gpuGeometry&&this._setGeometryAttributes(this._gpuGeometry),"isInstanced"in n&&(this.isInstanced=n.isInstanced),n.instanceCount&&this.setInstanceCount(n.instanceCount),n.vertexCount&&this.setVertexCount(n.vertexCount),n.indexBuffer&&this.setIndexBuffer(n.indexBuffer),n.attributes&&this.setAttributes(n.attributes),n.constantAttributes&&this.setConstantAttributes(n.constantAttributes),n.bindings&&this.setBindings(n.bindings),n.uniforms&&this.setUniformsWebGL(n.uniforms),n.moduleSettings&&this.updateModuleSettingsWebGL(n.moduleSettings),n.transformFeedback&&(this.transformFeedback=n.transformFeedback),Object.seal(this)}get[Symbol.toStringTag](){return"Model"}toString(){return`Model(${this.id})`}destroy(){var e;this._destroyed||(this.pipelineFactory.release(this.pipeline),this.shaderFactory.release(this.pipeline.vs),this.pipeline.fs&&this.shaderFactory.release(this.pipeline.fs),this._uniformStore.destroy(),(e=this._gpuGeometry)==null||e.destroy(),this._destroyed=!0)}needsRedraw(){this._getBindingsUpdateTimestamp()>this._lastDrawTimestamp&&this.setNeedsRedraw("contents of bound textures or buffers updated");const e=this._needsRedraw;return this._needsRedraw=!1,e}setNeedsRedraw(e){this._needsRedraw||(this._needsRedraw=e)}predraw(){this.updateShaderInputs(),this.pipeline=this._updatePipeline()}draw(e){const n=this._areBindingsLoading();if(n)return Re.info(fo,`>>> DRAWING ABORTED ${this.id}: ${n} not loaded`)(),!1;try{e.pushDebugGroup(`${this}.predraw(${e})`),this.predraw()}finally{e.popDebugGroup()}let r;try{e.pushDebugGroup(`${this}.draw(${e})`),this._logDrawCallStart(),this.pipeline=this._updatePipeline();const i=this._getBindings();this.pipeline.setBindings(i,{disableWarnings:this.props.disableWarnings}),ly(this.uniforms)||this.pipeline.setUniformsWebGL(this.uniforms);const{indexBuffer:a}=this.vertexArray,l=a?a.byteLength/(a.indexType==="uint32"?4:2):void 0;r=this.pipeline.draw({renderPass:e,vertexArray:this.vertexArray,isInstanced:this.isInstanced,vertexCount:this.vertexCount,instanceCount:this.instanceCount,indexCount:l,transformFeedback:this.transformFeedback||void 0,parameters:this.parameters,topology:this.topology})}finally{e.popDebugGroup(),this._logDrawCallEnd()}return this._logFramebuffer(e),r?(this._lastDrawTimestamp=this.device.timestamp,this._needsRedraw=!1):this._needsRedraw="waiting for resource initialization",r}setGeometry(e){var r;(r=this._gpuGeometry)==null||r.destroy();const n=e&&RX(this.device,e);if(n){this.setTopology(n.topology||"triangle-list");const i=new Kv(this.bufferLayout);this.bufferLayout=i.mergeBufferLayouts(n.bufferLayout,this.bufferLayout),this.vertexArray&&this._setGeometryAttributes(n)}this._gpuGeometry=n}setTopology(e){e!==this.topology&&(this.topology=e,this._setPipelineNeedsUpdate("topology"))}setBufferLayout(e){const n=new Kv(this.bufferLayout);this.bufferLayout=this._gpuGeometry?n.mergeBufferLayouts(e,this._gpuGeometry.bufferLayout):e,this._setPipelineNeedsUpdate("bufferLayout"),this.pipeline=this._updatePipeline(),this.vertexArray=this.device.createVertexArray({renderPipeline:this.pipeline}),this._gpuGeometry&&this._setGeometryAttributes(this._gpuGeometry)}setParameters(e){oy(e,this.parameters,2)||(this.parameters=e,this._setPipelineNeedsUpdate("parameters"))}setInstanceCount(e){this.instanceCount=e,this.isInstanced===void 0&&e>0&&(this.isInstanced=!0),this.setNeedsRedraw("instanceCount")}setVertexCount(e){this.vertexCount=e,this.setNeedsRedraw("vertexCount")}setShaderInputs(e){this.shaderInputs=e,this._uniformStore=new _V(this.shaderInputs.modules);for(const[n,r]of Object.entries(this.shaderInputs.modules))if(LX(r)){const i=this._uniformStore.getManagedUniformBuffer(this.device,n);this.bindings[`${n}Uniforms`]=i}this.setNeedsRedraw("shaderInputs")}updateShaderInputs(){this._uniformStore.setUniforms(this.shaderInputs.getUniformValues()),this.setBindings(this.shaderInputs.getBindingValues()),this.setNeedsRedraw("shaderInputs")}setBindings(e){Object.assign(this.bindings,e),this.setNeedsRedraw("bindings")}setTransformFeedback(e){this.transformFeedback=e,this.setNeedsRedraw("transformFeedback")}setIndexBuffer(e){this.vertexArray.setIndexBuffer(e),this.setNeedsRedraw("indexBuffer")}setAttributes(e,n){const r=(n==null?void 0:n.disableWarnings)??this.props.disableWarnings;e.indices&&Re.warn(`Model:${this.id} setAttributes() - indexBuffer should be set using setIndexBuffer()`)();const i=new Kv(this.bufferLayout);for(const[a,l]of Object.entries(e)){const u=i.getBufferLayout(a);if(!u){r||Re.warn(`Model(${this.id}): Missing layout for buffer "${a}".`)();continue}const f=i.getAttributeNamesForBuffer(u);let h=!1;for(const g of f){const m=this._attributeInfos[g];m&&(this.vertexArray.setBuffer(m.location,l),h=!0)}!h&&!r&&Re.warn(`Model(${this.id}): Ignoring buffer "${l.id}" for unknown attribute "${a}"`)()}this.setNeedsRedraw("attributes")}setConstantAttributes(e,n){for(const[r,i]of Object.entries(e)){const a=this._attributeInfos[r];a?this.vertexArray.setConstantWebGL(a.location,i):((n==null?void 0:n.disableWarnings)??this.props.disableWarnings)||Re.warn(`Model "${this.id}: Ignoring constant supplied for unknown attribute "${r}"`)()}this.setNeedsRedraw("constants")}setUniforms(e){this.setUniformsWebGL(e)}setUniformsWebGL(e){ly(e)||(this.pipeline.setUniformsWebGL(e),Object.assign(this.uniforms,e)),this.setNeedsRedraw("uniforms")}updateModuleSettingsWebGL(e){const{bindings:n,uniforms:r}=rO(this._getModuleUniforms(e));Object.assign(this.bindings,n),Object.assign(this.uniforms,r),this.setNeedsRedraw("moduleSettings")}_areBindingsLoading(){for(const e of Object.values(this.bindings))if(e instanceof l0&&!e.isReady)return e.id;return!1}_getBindings(){const e={};for(const[n,r]of Object.entries(this.bindings))r instanceof l0?r.isReady&&(e[n]=r.texture):e[n]=r;return e}_getBindingsUpdateTimestamp(){let e=0;for(const n of Object.values(this.bindings))n instanceof fg?e=Math.max(e,n.texture.updateTimestamp):n instanceof $n||n instanceof Kn?e=Math.max(e,n.updateTimestamp):n instanceof l0?e=n.texture?Math.max(e,n.texture.updateTimestamp):1/0:n instanceof hg||(e=Math.max(e,n.buffer.updateTimestamp));return e}_setGeometryAttributes(e){const n={...e.attributes};for(const[r]of Object.entries(n))!this.pipeline.shaderLayout.attributes.find(i=>i.name===r)&&r!=="positions"&&delete n[r];this.vertexCount=e.vertexCount,this.setIndexBuffer(e.indices||null),this.setAttributes(e.attributes,{disableWarnings:!0}),this.setAttributes(n,{disableWarnings:this.props.disableWarnings}),this.setNeedsRedraw("geometry attributes")}_setPipelineNeedsUpdate(e){this._pipelineNeedsUpdate||(this._pipelineNeedsUpdate=e),this.setNeedsRedraw(e)}_updatePipeline(){if(this._pipelineNeedsUpdate){let e=null,n=null;this.pipeline&&(Re.log(1,`Model ${this.id}: Recreating pipeline because "${this._pipelineNeedsUpdate}".`)(),e=this.pipeline.vs,n=this.pipeline.fs),this._pipelineNeedsUpdate=!1;const r=this.shaderFactory.createShader({id:`${this.id}-vertex`,stage:"vertex",source:this.source||this.vs,debugShaders:this.props.debugShaders});let i=null;this.source?i=r:this.fs&&(i=this.shaderFactory.createShader({id:`${this.id}-fragment`,stage:"fragment",source:this.source||this.fs,debugShaders:this.props.debugShaders})),this.pipeline=this.pipelineFactory.createRenderPipeline({...this.props,bufferLayout:this.bufferLayout,topology:this.topology,parameters:this.parameters,bindings:this._getBindings(),vs:r,fs:i}),this._attributeInfos=uM(this.pipeline.shaderLayout,this.bufferLayout),e&&this.shaderFactory.release(e),n&&this.shaderFactory.release(n)}return this.pipeline}_logDrawCallStart(){const e=Re.level>3?0:UX;Re.level<2||Date.now()-this._lastLogTime>> DRAWING MODEL ${this.id}`,{collapsed:Re.level<=2})())}_logDrawCallEnd(){if(this._logOpen){const e=OX(this.pipeline.shaderLayout,this.id);Re.table(fo,e)();const n=this.shaderInputs.getDebugTable();for(const[i,a]of Object.entries(this.uniforms))n[i]={value:a};Re.table(fo,n)();const r=this._getAttributeDebugTable();Re.table(fo,this._attributeInfos)(),Re.table(fo,r)(),Re.groupEnd(fo)(),this._logOpen=!1}}_logFramebuffer(e){const n=this.device.props.debugFramebuffers;if(this._drawCount++,!n)return;const r=e.props.framebuffer;r&&PX(r,{id:r.id,minimap:!0})}_getAttributeDebugTable(){const e={};for(const[n,r]of Object.entries(this._attributeInfos)){const i=this.vertexArray.attributes[r.location];e[r.location]={name:n,type:r.shaderType,values:i?this._getBufferOrConstantValues(i,r.bufferDataType):"null"}}if(this.vertexArray.indexBuffer){const{indexBuffer:n}=this.vertexArray,r=n.indexType==="uint32"?new Uint32Array(n.debugData):new Uint16Array(n.debugData);e.indices={name:"indices",type:n.indexType,values:r.toString()}}return e}_getBufferOrConstantValues(e,n){const r=hM(n);return(e instanceof $n?new r(e.debugData):e).toString()}};M(jg,"defaultProps",{...Rc.defaultProps,source:void 0,vs:null,fs:null,id:"unnamed",handle:void 0,userData:{},defines:{},modules:[],moduleSettings:void 0,geometry:null,indexBuffer:null,attributes:{},constantAttributes:{},varyings:[],isInstanced:void 0,instanceCount:0,vertexCount:0,shaderInputs:void 0,pipelineFactory:void 0,shaderFactory:void 0,transformFeedback:void 0,shaderAssembler:ug.getDefaultShaderAssembler(),debugShaders:void 0,disableWarnings:void 0});let $o=jg;function LX(t){return!!(t.uniformTypes&&!ly(t.uniformTypes))}function zX(t){return{type:t.type,shaderLanguage:t.info.shadingLanguage,shaderLanguageVersion:t.info.shadingLanguageVersion,gpu:t.info.gpu,features:t.features}}function ly(t){for(const e in t)return!1;return!0}const ff=class ff{constructor(e,n=ff.defaultProps){M(this,"device");M(this,"model");M(this,"transformFeedback");if(!ff.isSupported(e))throw new Error("BufferTransform not yet implemented on WebGPU");this.device=e,this.model=new $o(this.device,{id:n.id||"buffer-transform-model",fs:n.fs||S$(),topology:n.topology||"point-list",varyings:n.outputs||n.varyings,...n}),this.transformFeedback=this.device.createTransformFeedback({layout:this.model.pipeline.shaderLayout,buffers:n.feedbackBuffers}),this.model.setTransformFeedback(this.transformFeedback),Object.seal(this)}static isSupported(e){var n;return((n=e==null?void 0:e.info)==null?void 0:n.type)==="webgl"}destroy(){this.model&&this.model.destroy()}delete(){this.destroy()}run(e){e!=null&&e.inputBuffers&&this.model.setAttributes(e.inputBuffers),e!=null&&e.outputBuffers&&this.transformFeedback.setBuffers(e.outputBuffers);const n=this.device.beginRenderPass(e);this.model.draw(n),n.end()}getBuffer(e){return this.transformFeedback.getBuffer(e)}readAsync(e){const n=this.getBuffer(e);if(!n)throw new Error("BufferTransform#getBuffer");if(n instanceof $n)return n.readAsync();const{buffer:r,byteOffset:i=0,byteLength:a=r.byteLength}=n;return r.readAsync(i,a)}};M(ff,"defaultProps",{...$o.defaultProps,outputs:void 0,feedbackBuffers:void 0});let If=ff;class vb{constructor(e){M(this,"id");M(this,"topology");M(this,"vertexCount");M(this,"indices");M(this,"attributes");M(this,"userData",{});const{attributes:n={},indices:r=null,vertexCount:i=null}=e;this.id=e.id||Gf("geometry"),this.topology=e.topology,r&&(this.indices=ArrayBuffer.isView(r)?{value:r,size:1}:r),this.attributes={};for(const[a,l]of Object.entries(n)){const u=ArrayBuffer.isView(l)?{value:l}:l;if(!ArrayBuffer.isView(u.value))throw new Error(`${this._print(a)}: must be typed array or object with value as typed array`);if((a==="POSITION"||a==="positions")&&!u.size&&(u.size=3),a==="indices"){if(this.indices)throw new Error("Multiple indices detected");this.indices=u}else this.attributes[a]=u}this.indices&&this.indices.isIndexed!==void 0&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this.vertexCount=i||this._calculateVertexCount(this.attributes,this.indices)}getVertexCount(){return this.vertexCount}getAttributes(){return this.indices?{indices:this.indices,...this.attributes}:this.attributes}_print(e){return`Geometry ${this.id} attribute ${e}`}_setAttributes(e,n){return this}_calculateVertexCount(e,n){if(n)return n.value.length;let r=1/0;for(const i of Object.values(e)){const{value:a,size:l,constant:u}=i;!u&&a&&l!==void 0&&l>=1&&(r=Math.min(r,a.length/l))}return r}}class $X extends vb{constructor(e={}){const{id:n=Gf("cube-geometry"),indices:r=!0}=e;super(r?{...e,id:n,topology:"triangle-list",indices:{size:1,value:VX},attributes:{...KX,...e.attributes}}:{...e,id:n,topology:"triangle-list",indices:void 0,attributes:{...ZX,...e.attributes}})}}const VX=new Uint16Array([0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]),HX=new Float32Array([-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,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,-1,1,-1,1,1,-1,1,-1]),jX=new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0]),WX=new Float32Array([0,0,1,0,1,1,0,1,1,0,1,1,0,1,0,0,0,1,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,0,0,0,1,0,1,1,0,1]),XX=new Float32Array([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,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,-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,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1]),qX=new Float32Array([1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,1,0,0]),YX=new Float32Array([1,0,1,1,0,0,1,1,0,0,0,1,1,0,0,1,1,0,1,1,0,0,0,1,1,1,1,1,1,0,1,1,1,0,0,1,1,1,0,1,1,1,1,1,1,0,0,1,0,1,1,1,1,1,1,1,1,1,0,1,0,1,0,1,0,1,1,1,1,1,0,1,0,0,1,1,0,1,1,1,0,1,0,1,0,0,0,1,0,0,1,1,0,1,0,1,1,1,1,1,0,1,1,1,0,0,1,1,0,0,1,1,1,0,1,1,1,1,1,1,1,0,0,1,0,0,0,1,0,1,0,1,1,1,0,1,1,0,0,1,0,1,0,1]),KX={POSITION:{size:3,value:HX},NORMAL:{size:3,value:jX},TEXCOORD_0:{size:2,value:WX}},ZX={POSITION:{size:3,value:XX},TEXCOORD_0:{size:2,value:qX},COLOR_0:{size:3,value:YX}},QX={blendColorOperation:"add",blendColorSrcFactor:"one",blendColorDstFactor:"zero",blendAlphaOperation:"add",blendAlphaSrcFactor:"constant-alpha",blendAlphaDstFactor:"zero"};class sO extends mb{constructor(){super(...arguments),this._colorEncoderState=null}render(e){return"pickingFBO"in e?this._drawPickingBuffer(e):super.render(e)}_drawPickingBuffer({layers:e,layerFilter:n,views:r,viewports:i,onViewportActive:a,pickingFBO:l,deviceRect:{x:u,y:f,width:h,height:g},cullRect:m,effects:v,pass:S="picking",pickZ:w,shaderModuleProps:E}){this.pickZ=w;const b=this._resetColorEncoder(w),C=[u,f,h,g],T=super.render({target:l,layers:e,layerFilter:n,views:r,viewports:i,onViewportActive:a,cullRect:m,effects:v==null?void 0:v.filter(O=>O.useInPicking),pass:S,isPicking:!0,shaderModuleProps:E,clearColor:[0,0,0,0],colorMask:15,scissorRect:C});return this._colorEncoderState=null,{decodePickingColor:b&&JX.bind(null,b),stats:T}}shouldDrawLayer(e){const{pickable:n,operation:r}=e.props;return n&&r.includes("draw")||r.includes("terrain")||r.includes("mask")}getShaderModuleProps(e,n,r){return{picking:{isActive:1,isAttribute:this.pickZ},lighting:{enabled:!1}}}getLayerParameters(e,n,r){const i={...e.props.parameters},{pickable:a,operation:l}=e.props;return!this._colorEncoderState||l.includes("terrain")?i.blend=!1:a&&l.includes("draw")&&(Object.assign(i,QX),i.blend=!0,i.blendColor=GX(this._colorEncoderState,e,r)),i}_resetColorEncoder(e){return this._colorEncoderState=e?null:{byLayer:new Map,byAlpha:[]},this._colorEncoderState}}function GX(t,e,n){const{byLayer:r,byAlpha:i}=t;let a,l=r.get(e);return l?(l.viewports.push(n),a=l.a):(a=r.size+1,a<=255?(l={a,layer:e,viewports:[n]},r.set(e,l),i[a]=l):(Sn.warn("Too many pickable layers, only picking the first 255")(),a=0)),[0,0,0,a/255]}function JX(t,e){const n=t.byAlpha[e[3]];return n&&{pickedLayer:n.layer,pickedViewports:n.viewports,pickedObjectIndex:n.layer.decodePickingColor(e)}}const Vl={NO_STATE:"Awaiting state",MATCHED:"Matched. State transferred from previous layer",INITIALIZED:"Initialized",AWAITING_GC:"Discarded. Awaiting garbage collection",AWAITING_FINALIZATION:"No longer matched. Awaiting garbage collection",FINALIZED:"Finalized! Awaiting garbage collection"},Cg=Symbol.for("component"),Fo=Symbol.for("propTypes"),c0=Symbol.for("deprecatedProps"),ic=Symbol.for("asyncPropDefaults"),Vo=Symbol.for("asyncPropOriginal"),ka=Symbol.for("asyncPropResolved");function aO(t,e=()=>!0){return Array.isArray(t)?oO(t,e,[]):e(t)?[t]:[]}function oO(t,e,n){let r=-1;for(;++r0}delete(){}getData(){return this.isLoaded?this._error?Promise.reject(this._error):this._content:this._loader.then(()=>this.getData())}setData(e,n){if(e===this._data&&!n)return;this._data=e;const r=++this._loadCount;let i=e;typeof e=="string"&&(i=jh(e)),i instanceof Promise?(this.isLoaded=!1,this._loader=i.then(a=>{this._loadCount===r&&(this.isLoaded=!0,this._error=void 0,this._content=a)}).catch(a=>{this._loadCount===r&&(this.isLoaded=!0,this._error=a||!0)})):(this.isLoaded=!0,this._error=void 0,this._content=e);for(const a of this._subscribers)a.onChange(this.getData())}}class nq{constructor(e){var n;this.protocol=e.protocol||"resource://",this._context={device:e.device,gl:(n=e.device)==null?void 0:n.gl,resourceManager:this},this._resources={},this._consumers={},this._pruneRequest=null}contains(e){return e.startsWith(this.protocol)?!0:e in this._resources}add({resourceId:e,data:n,forceUpdate:r=!1,persistent:i=!0}){let a=this._resources[e];a?a.setData(n,r):(a=new tq(e,n,this._context),this._resources[e]=a),a.persistent=i}remove(e){const n=this._resources[e];n&&(n.delete(),delete this._resources[e])}unsubscribe({consumerId:e}){const n=this._consumers[e];if(n){for(const r in n){const i=n[r],a=this._resources[i.resourceId];a&&a.unsubscribe(i)}delete this._consumers[e],this.prune()}}subscribe({resourceId:e,onChange:n,consumerId:r,requestId:i="default"}){const{_resources:a,protocol:l}=this;e.startsWith(l)&&(e=e.replace(l,""),a[e]||this.add({resourceId:e,data:null,persistent:!1}));const u=a[e];if(this._track(r,i,u,n),u)return u.getData()}prune(){this._pruneRequest||(this._pruneRequest=setTimeout(()=>this._prune(),0))}finalize(){for(const e in this._resources)this._resources[e].delete()}_track(e,n,r,i){const a=this._consumers,l=a[e]=a[e]||{};let u=l[n];const f=u&&u.resourceId&&this._resources[u.resourceId];f&&(f.unsubscribe(u),this.prune()),r&&(u?(u.onChange=i,u.resourceId=r.id):u={onChange:i,resourceId:r.id},l[n]=u,r.subscribe(u))}_prune(){this._pruneRequest=null;for(const e of Object.keys(this._resources)){const n=this._resources[e];!n.persistent&&!n.inUse()&&(n.delete(),delete this._resources[e])}}}const rq="layerManager.setLayers",iq="layerManager.activateViewport";class sq{constructor(e,n){this._lastRenderedLayers=[],this._needsRedraw=!1,this._needsUpdate=!1,this._nextLayers=null,this._debug=!1,this._defaultShaderModulesChanged=!1,this.activateViewport=u=>{Hr(iq,this,u),u&&(this.context.viewport=u)};const{deck:r,stats:i,viewport:a,timeline:l}=n||{};this.layers=[],this.resourceManager=new nq({device:e,protocol:"deck://"}),this.context={mousePosition:null,userData:{},layerManager:this,device:e,gl:e==null?void 0:e.gl,deck:r,shaderAssembler:KW(),defaultShaderModules:[hj],renderPass:void 0,stats:i||new Xg({id:"deck.gl"}),viewport:a||new Qf({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:l||new tO,resourceManager:this.resourceManager,onError:void 0},Object.seal(this)}finalize(){this.resourceManager.finalize();for(const e of this.layers)this._finalizeLayer(e)}needsRedraw(e={clearRedrawFlags:!1}){let n=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);for(const r of this.layers){const i=r.getNeedsRedraw(e);n=n||i}return n}needsUpdate(){return this._nextLayers&&this._nextLayers!==this._lastRenderedLayers?"layers changed":this._defaultShaderModulesChanged?"shader modules changed":this._needsUpdate}setNeedsRedraw(e){this._needsRedraw=this._needsRedraw||e}setNeedsUpdate(e){this._needsUpdate=this._needsUpdate||e}getLayers({layerIds:e}={}){return e?this.layers.filter(n=>e.find(r=>n.id.indexOf(r)===0)):this.layers}setProps(e){"debug"in e&&(this._debug=e.debug),"userData"in e&&(this.context.userData=e.userData),"layers"in e&&(this._nextLayers=e.layers),"onError"in e&&(this.context.onError=e.onError)}setLayers(e,n){Hr(rq,this,n,e),this._lastRenderedLayers=e;const r=aO(e,Boolean);for(const i of r)i.context=this.context;this._updateLayers(this.layers,r)}updateLayers(){const e=this.needsUpdate();e&&(this.setNeedsRedraw(`updating layers: ${e}`),this.setLayers(this._nextLayers||this._lastRenderedLayers,e)),this._nextLayers=null}addDefaultShaderModule(e){const{defaultShaderModules:n}=this.context;n.find(r=>r.name===e.name)||(n.push(e),this._defaultShaderModulesChanged=!0)}removeDefaultShaderModule(e){const{defaultShaderModules:n}=this.context,r=n.findIndex(i=>i.name===e.name);r>=0&&(n.splice(r,1),this._defaultShaderModulesChanged=!0)}_handleError(e,n,r){r.raiseError(n,`${e} of ${r}`)}_updateLayers(e,n){const r={};for(const l of e)r[l.id]?Sn.warn(`Multiple old layers with same id ${l.id}`)():r[l.id]=l;if(this._defaultShaderModulesChanged){for(const l of e)l.setNeedsUpdate(),l.setChangeFlags({extensionsChanged:!0});this._defaultShaderModulesChanged=!1}const i=[];this._updateSublayersRecursively(n,r,i),this._finalizeOldLayers(r);let a=!1;for(const l of i)if(l.hasUniformTransition()){a=`Uniform transition in ${l}`;break}this._needsUpdate=a,this.layers=i}_updateSublayersRecursively(e,n,r){for(const i of e){i.context=this.context;const a=n[i.id];a===null&&Sn.warn(`Multiple new layers with same id ${i.id}`)(),n[i.id]=null;let l=null;try{this._debug&&a!==i&&i.validateProps(),a?(this._transferLayerState(a,i),this._updateLayer(i)):this._initializeLayer(i),r.push(i),l=i.isComposite?i.getSubLayers():null}catch(u){this._handleError("matching",u,i)}l&&this._updateSublayersRecursively(l,n,r)}}_finalizeOldLayers(e){for(const n in e){const r=e[n];r&&this._finalizeLayer(r)}}_initializeLayer(e){try{e._initialize(),e.lifecycle=Vl.INITIALIZED}catch(n){this._handleError("initialization",n,e)}}_transferLayerState(e,n){n._transferState(e),n.lifecycle=Vl.MATCHED,n!==e&&(e.lifecycle=Vl.AWAITING_GC)}_updateLayer(e){try{e._update()}catch(n){this._handleError("update",n,e)}}_finalizeLayer(e){this._needsRedraw=this._needsRedraw||`finalized ${e}`,e.lifecycle=Vl.AWAITING_FINALIZATION;try{e._finalize(),e.lifecycle=Vl.FINALIZED}catch(n){this._handleError("finalization",n,e)}}}function Gi(t,e,n){if(t===e)return!0;if(!n||!t||!e)return!1;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let r=0;rn.containsPixel(e)):this._viewports}getViews(){const e={};return this.views.forEach(n=>{e[n.id]=n}),e}getView(e){return this.views.find(n=>n.id===e)}getViewState(e){const n=typeof e=="string"?this.getView(e):e,r=n&&this.viewState[n.getViewStateId()]||this.viewState;return n?n.filterViewState(r):r}getViewport(e){return this._viewportMap[e]}unproject(e,n){const r=this.getViewports(),i={x:e[0],y:e[1]};for(let a=r.length-1;a>=0;--a){const l=r[a];if(l.containsPixel(i)){const u=e.slice();return u[0]-=l.x,u[1]-=l.y,l.unproject(u,n)}}return null}setProps(e){e.views&&this._setViews(e.views),e.viewState&&this._setViewState(e.viewState),("width"in e||"height"in e)&&this._setSize(e.width,e.height),this._isUpdating||this._update()}_update(){this._isUpdating=!0,this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._isUpdating=!1}_setSize(e,n){(e!==this.width||n!==this.height)&&(this.width=e,this.height=n,this.setNeedsUpdate("Size changed"))}_setViews(e){e=aO(e,Boolean),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}_setViewState(e){e?(!Gi(e,this.viewState,3)&&this.setNeedsUpdate("viewState changed"),this.viewState=e):Sn.warn("missing `viewState` or `initialViewState`")()}_createController(e,n){const r=n.type;return new r({timeline:this.timeline,eventManager:this._eventManager,onViewStateChange:this._eventCallbacks.onViewStateChange,onStateChange:this._eventCallbacks.onInteractionStateChange,makeViewport:a=>{var l;return(l=this.getView(e.id))==null?void 0:l.makeViewport({viewState:a,width:this.width,height:this.height})}})}_updateController(e,n,r,i){const a=e.controller;if(a&&r){const l={...n,...a,id:e.id,x:r.x,y:r.y,width:r.width,height:r.height};return(!i||i.constructor!==a.type)&&(i=this._createController(e,l)),i&&i.setProps(l),i}return null}_rebuildViewports(){const{views:e}=this,n=this.controllers;this._viewports=[],this.controllers={};let r=!1;for(let i=e.length;i--;){const a=e[i],l=this.getViewState(a),u=a.makeViewport({viewState:l,width:this.width,height:this.height});let f=n[a.id];const h=!!a.controller;h&&!f&&(r=!0),(r||!h)&&f&&(f.finalize(),f=null),this.controllers[a.id]=this._updateController(a,l,u,f),u&&this._viewports.unshift(u)}for(const i in n){const a=n[i];a&&!this.controllers[i]&&a.finalize()}this._buildViewportMap()}_buildViewportMap(){this._viewportMap={},this._viewports.forEach(e=>{e.id&&(this._viewportMap[e.id]=this._viewportMap[e.id]||e)})}_diffViews(e,n){return e.length!==n.length?!0:e.some((r,i)=>!e[i].equals(n[i]))}}const oq=/([0-9]+\.?[0-9]*)(%|px)/;function ma(t){switch(typeof t){case"number":return{position:t,relative:!1};case"string":const e=oq.exec(t);if(e&&e.length>=3){const n=e[2]==="%",r=parseFloat(e[1]);return{position:n?r/100:r,relative:n}}default:throw new Error(`Could not parse position string ${t}`)}}function va(t,e){return t.relative?Math.round(t.position*e):t.position}class Dc{constructor(e){const{id:n,x:r=0,y:i=0,width:a="100%",height:l="100%",padding:u=null}=e;this.id=n||this.constructor.displayName||"view",this.props={...e,id:this.id},this._x=ma(r),this._y=ma(i),this._width=ma(a),this._height=ma(l),this._padding=u&&{left:ma(u.left||0),right:ma(u.right||0),top:ma(u.top||0),bottom:ma(u.bottom||0)},this.equals=this.equals.bind(this),Object.seal(this)}equals(e){return this===e?!0:this.constructor===e.constructor&&Gi(this.props,e.props,2)}makeViewport({width:e,height:n,viewState:r}){r=this.filterViewState(r);const i=this.getDimensions({width:e,height:n});if(!i.height||!i.width)return null;const a=this.getViewportType(r);return new a({...r,...this.props,...i})}getViewStateId(){const{viewState:e}=this.props;return typeof e=="string"?e:(e==null?void 0:e.id)||this.id}filterViewState(e){if(this.props.viewState&&typeof this.props.viewState=="object"){if(!this.props.viewState.id)return this.props.viewState;const n={...e};for(const r in this.props.viewState)r!=="id"&&(n[r]=this.props.viewState[r]);return n}return e}getDimensions({width:e,height:n}){const r={x:va(this._x,e),y:va(this._y,n),width:va(this._width,e),height:va(this._height,n)};return this._padding&&(r.padding={left:va(this._padding.left,e),top:va(this._padding.top,n),right:va(this._padding.right,e),bottom:va(this._padding.bottom,n)}),r}get controller(){const e=this.props.controller;return e?e===!0?{type:this.ControllerType}:typeof e=="function"?{type:e}:{type:this.ControllerType,...e}:null}}class lp{constructor(e){this._inProgress=!1,this._handle=null,this.time=0,this.settings={duration:0},this._timeline=e}get inProgress(){return this._inProgress}start(e){var n,r;this.cancel(),this.settings=e,this._inProgress=!0,(r=(n=this.settings).onStart)==null||r.call(n,this)}end(){var e,n;this._inProgress&&(this._timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1,(n=(e=this.settings).onEnd)==null||n.call(e,this))}cancel(){var e,n;this._inProgress&&((n=(e=this.settings).onInterrupt)==null||n.call(e,this),this._timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1)}update(){var e,n;if(!this._inProgress)return!1;if(this._handle===null){const{_timeline:r,settings:i}=this;this._handle=r.addChannel({delay:r.getTime(),duration:i.duration})}return this.time=this._timeline.getTime(this._handle),this._onUpdate(),(n=(e=this.settings).onUpdate)==null||n.call(e,this),this._timeline.isFinished(this._handle)&&this.end(),!0}_onUpdate(){}}const $2=()=>{},cy={BREAK:1,SNAP_TO_END:2,IGNORE:3},lq=t=>t,cq=cy.BREAK;class uq{constructor(e){this._onTransitionUpdate=n=>{const{time:r,settings:{interpolator:i,startProps:a,endProps:l,duration:u,easing:f}}=n,h=f(r/u),g=i.interpolateProps(a,l,h);this.propsInTransition=this.getControllerState({...this.props,...g}).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})},this.getControllerState=e.getControllerState,this.propsInTransition=null,this.transition=new lp(e.timeline),this.onViewStateChange=e.onViewStateChange||$2,this.onStateChange=e.onStateChange||$2}finalize(){this.transition.cancel()}getViewportInTransition(){return this.propsInTransition}processViewStateChange(e){let n=!1;const r=this.props;if(this.props=e,!r||this._shouldIgnoreViewportChange(r,e))return!1;if(this._isTransitionEnabled(e)){let i=r;if(this.transition.inProgress){const{interruption:a,endProps:l}=this.transition.settings;i={...r,...a===cy.SNAP_TO_END?l:this.propsInTransition||r}}this._triggerTransition(i,e),n=!0}else this.transition.cancel();return n}updateTransition(){this.transition.update()}_isTransitionEnabled(e){const{transitionDuration:n,transitionInterpolator:r}=e;return(n>0||n==="auto")&&!!r}_isUpdateDueToCurrentTransition(e){return this.transition.inProgress&&this.propsInTransition?this.transition.settings.interpolator.arePropsEqual(e,this.propsInTransition):!1}_shouldIgnoreViewportChange(e,n){return this.transition.inProgress?this.transition.settings.interruption===cy.IGNORE||this._isUpdateDueToCurrentTransition(n):this._isTransitionEnabled(n)?n.transitionInterpolator.arePropsEqual(e,n):!0}_triggerTransition(e,n){const r=this.getControllerState(e),i=this.getControllerState(n).shortestPathFrom(r),a=n.transitionInterpolator,l=a.getDuration?a.getDuration(e,n):n.transitionDuration;if(l===0)return;const u=a.initializeProps(e,i);this.propsInTransition={};const f={duration:l,easing:n.transitionEasing||lq,interpolator:a,interruption:n.transitionInterruption||cq,startProps:u.start,endProps:u.end,onStart:n.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(n.onTransitionInterrupt),onEnd:this._onTransitionEnd(n.onTransitionEnd)};this.transition.start(f),this.onStateChange({inTransition:!0}),this.updateTransition()}_onTransitionEnd(e){return n=>{this.propsInTransition=null,this.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1}),e==null||e(n)}}}function Fr(t,e){if(!t)throw new Error(e||"deck.gl: assertion failed.")}class fq{constructor(e){const{compare:n,extract:r,required:i}=e;this._propsToCompare=n,this._propsToExtract=r||n,this._requiredProps=i}arePropsEqual(e,n){for(const r of this._propsToCompare)if(!(r in e)||!(r in n)||!Of(e[r],n[r]))return!1;return!0}initializeProps(e,n){const r={},i={};for(const a of this._propsToExtract)(a in e||a in n)&&(r[a]=e[a],i[a]=n[a]);return this._checkRequiredProps(r),this._checkRequiredProps(i),{start:r,end:i}}getDuration(e,n){return n.transitionDuration}_checkRequiredProps(e){this._requiredProps&&this._requiredProps.forEach(n=>{const r=e[n];Fr(Number.isFinite(r)||Array.isArray(r),`${n} is required for transition`)})}}const dq=["longitude","latitude","zoom","bearing","pitch"],hq=["longitude","latitude","zoom"];class lO extends fq{constructor(e={}){const n=Array.isArray(e)?e:e.transitionProps,r=Array.isArray(e)?{}:e;r.transitionProps=Array.isArray(n)?{compare:n,required:n}:n||{compare:dq,required:hq},super(r.transitionProps),this.opts=r}initializeProps(e,n){const r=super.initializeProps(e,n),{makeViewport:i,around:a}=this.opts;if(i&&a){const l=i(e),u=i(n),f=l.unproject(a);r.start.around=a,Object.assign(r.end,{around:u.project(f),aroundPosition:f,width:n.width,height:n.height})}return r}interpolateProps(e,n,r){const i={};for(const a of this._propsToExtract)i[a]=yg(e[a]||0,n[a]||0,r);if(n.aroundPosition&&this.opts.makeViewport){const a=this.opts.makeViewport({...n,...i});Object.assign(i,a.panByPosition(n.aroundPosition,yg(e.around,n.around,r)))}return i}}const _a={transitionDuration:0},gq=300,Th=t=>1-(1-t)*(1-t),$l={WHEEL:["wheel"],PAN:["panstart","panmove","panend"],PINCH:["pinchstart","pinchmove","pinchend"],MULTI_PAN:["multipanstart","multipanmove","multipanend"],DOUBLE_CLICK:["dblclick"],KEYBOARD:["keydown"]},ho={};class pq{constructor(e){this.state={},this._events={},this._interactionState={isDragging:!1},this._customEvents=[],this._eventStartBlocked=null,this._panMove=!1,this.invertPan=!1,this.dragMode="rotate",this.inertia=0,this.scrollZoom=!0,this.dragPan=!0,this.dragRotate=!0,this.doubleClickZoom=!0,this.touchZoom=!0,this.touchRotate=!1,this.keyboard=!0,this.transitionManager=new uq({...e,getControllerState:n=>new this.ControllerState(n),onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}),this.handleEvent=this.handleEvent.bind(this),this.eventManager=e.eventManager,this.onViewStateChange=e.onViewStateChange||(()=>{}),this.onStateChange=e.onStateChange||(()=>{}),this.makeViewport=e.makeViewport}set events(e){this.toggleEvents(this._customEvents,!1),this.toggleEvents(e,!0),this._customEvents=e,this.props&&this.setProps(this.props)}finalize(){var e;for(const n in this._events)this._events[n]&&((e=this.eventManager)==null||e.off(n,this.handleEvent));this.transitionManager.finalize()}handleEvent(e){this._controllerState=void 0;const n=this._eventStartBlocked;switch(e.type){case"panstart":return n?!1:this._onPanStart(e);case"panmove":return this._onPan(e);case"panend":return this._onPanEnd(e);case"pinchstart":return n?!1:this._onPinchStart(e);case"pinchmove":return this._onPinch(e);case"pinchend":return this._onPinchEnd(e);case"multipanstart":return n?!1:this._onMultiPanStart(e);case"multipanmove":return this._onMultiPan(e);case"multipanend":return this._onMultiPanEnd(e);case"dblclick":return this._onDoubleClick(e);case"wheel":return this._onWheel(e);case"keydown":return this._onKeyDown(e);default:return!1}}get controllerState(){return this._controllerState=this._controllerState||new this.ControllerState({makeViewport:this.makeViewport,...this.props,...this.state}),this._controllerState}getCenter(e){const{x:n,y:r}=this.props,{offsetCenter:i}=e;return[i.x-n,i.y-r]}isPointInBounds(e,n){const{width:r,height:i}=this.props;if(n&&n.handled)return!1;const a=e[0]>=0&&e[0]<=r&&e[1]>=0&&e[1]<=i;return a&&n&&n.stopPropagation(),a}isFunctionKeyPressed(e){const{srcEvent:n}=e;return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}isDragging(){return this._interactionState.isDragging||!1}blockEvents(e){const n=setTimeout(()=>{this._eventStartBlocked===n&&(this._eventStartBlocked=null)},e);this._eventStartBlocked=n}setProps(e){e.dragMode&&(this.dragMode=e.dragMode),this.props=e,"transitionInterpolator"in e||(e.transitionInterpolator=this._getTransitionProps().transitionInterpolator),this.transitionManager.processViewStateChange(e);const{inertia:n}=e;this.inertia=Number.isFinite(n)?n:n===!0?gq:0;const{scrollZoom:r=!0,dragPan:i=!0,dragRotate:a=!0,doubleClickZoom:l=!0,touchZoom:u=!0,touchRotate:f=!1,keyboard:h=!0}=e,g=!!this.onViewStateChange;this.toggleEvents($l.WHEEL,g&&r),this.toggleEvents($l.PAN,g),this.toggleEvents($l.PINCH,g&&(u||f)),this.toggleEvents($l.MULTI_PAN,g&&f),this.toggleEvents($l.DOUBLE_CLICK,g&&l),this.toggleEvents($l.KEYBOARD,g&&h),this.scrollZoom=r,this.dragPan=i,this.dragRotate=a,this.doubleClickZoom=l,this.touchZoom=u,this.touchRotate=f,this.keyboard=h}updateTransition(){this.transitionManager.updateTransition()}toggleEvents(e,n){this.eventManager&&e.forEach(r=>{this._events[r]!==n&&(this._events[r]=n,n?this.eventManager.on(r,this.handleEvent):this.eventManager.off(r,this.handleEvent))})}updateViewport(e,n=null,r={}){const i={...e.getViewportProps(),...n},a=this.controllerState!==e;if(this.state=e.getState(),this._setInteractionState(r),a){const l=this.controllerState&&this.controllerState.getViewportProps();this.onViewStateChange&&this.onViewStateChange({viewState:i,interactionState:this._interactionState,oldViewState:l,viewId:this.props.id})}}_onTransition(e){this.onViewStateChange({...e,interactionState:this._interactionState,viewId:this.props.id})}_setInteractionState(e){Object.assign(this._interactionState,e),this.onStateChange(this._interactionState)}_onPanStart(e){const n=this.getCenter(e);if(!this.isPointInBounds(n,e))return!1;let r=this.isFunctionKeyPressed(e)||e.rightButton||!1;(this.invertPan||this.dragMode==="pan")&&(r=!r);const i=this.controllerState[r?"panStart":"rotateStart"]({pos:n});return this._panMove=r,this.updateViewport(i,_a,{isDragging:!0}),!0}_onPan(e){return this.isDragging()?this._panMove?this._onPanMove(e):this._onPanRotate(e):!1}_onPanEnd(e){return this.isDragging()?this._panMove?this._onPanMoveEnd(e):this._onPanRotateEnd(e):!1}_onPanMove(e){if(!this.dragPan)return!1;const n=this.getCenter(e),r=this.controllerState.pan({pos:n});return this.updateViewport(r,_a,{isDragging:!0,isPanning:!0}),!0}_onPanMoveEnd(e){const{inertia:n}=this;if(this.dragPan&&n&&e.velocity){const r=this.getCenter(e),i=[r[0]+e.velocityX*n/2,r[1]+e.velocityY*n/2],a=this.controllerState.pan({pos:i}).panEnd();this.updateViewport(a,{...this._getTransitionProps(),transitionDuration:n,transitionEasing:Th},{isDragging:!1,isPanning:!0})}else{const r=this.controllerState.panEnd();this.updateViewport(r,null,{isDragging:!1,isPanning:!1})}return!0}_onPanRotate(e){if(!this.dragRotate)return!1;const n=this.getCenter(e),r=this.controllerState.rotate({pos:n});return this.updateViewport(r,_a,{isDragging:!0,isRotating:!0}),!0}_onPanRotateEnd(e){const{inertia:n}=this;if(this.dragRotate&&n&&e.velocity){const r=this.getCenter(e),i=[r[0]+e.velocityX*n/2,r[1]+e.velocityY*n/2],a=this.controllerState.rotate({pos:i}).rotateEnd();this.updateViewport(a,{...this._getTransitionProps(),transitionDuration:n,transitionEasing:Th},{isDragging:!1,isRotating:!0})}else{const r=this.controllerState.rotateEnd();this.updateViewport(r,null,{isDragging:!1,isRotating:!1})}return!0}_onWheel(e){if(!this.scrollZoom)return!1;const n=this.getCenter(e);if(!this.isPointInBounds(n,e))return!1;e.srcEvent.preventDefault();const{speed:r=.01,smooth:i=!1}=this.scrollZoom===!0?{}:this.scrollZoom,{delta:a}=e;let l=2/(1+Math.exp(-Math.abs(a*r)));a<0&&l!==0&&(l=1/l);const u=this.controllerState.zoom({pos:n,scale:l});return this.updateViewport(u,{...this._getTransitionProps({around:n}),transitionDuration:i?250:1},{isZooming:!0,isPanning:!0}),!0}_onMultiPanStart(e){const n=this.getCenter(e);if(!this.isPointInBounds(n,e))return!1;const r=this.controllerState.rotateStart({pos:n});return this.updateViewport(r,_a,{isDragging:!0}),!0}_onMultiPan(e){if(!this.touchRotate||!this.isDragging())return!1;const n=this.getCenter(e);n[0]-=e.deltaX;const r=this.controllerState.rotate({pos:n});return this.updateViewport(r,_a,{isDragging:!0,isRotating:!0}),!0}_onMultiPanEnd(e){if(!this.isDragging())return!1;const{inertia:n}=this;if(this.touchRotate&&n&&e.velocityY){const r=this.getCenter(e),i=[r[0],r[1]+=e.velocityY*n/2],a=this.controllerState.rotate({pos:i});this.updateViewport(a,{...this._getTransitionProps(),transitionDuration:n,transitionEasing:Th},{isDragging:!1,isRotating:!0}),this.blockEvents(n)}else{const r=this.controllerState.rotateEnd();this.updateViewport(r,null,{isDragging:!1,isRotating:!1})}return!0}_onPinchStart(e){const n=this.getCenter(e);if(!this.isPointInBounds(n,e))return!1;const r=this.controllerState.zoomStart({pos:n}).rotateStart({pos:n});return ho._startPinchRotation=e.rotation,ho._lastPinchEvent=e,this.updateViewport(r,_a,{isDragging:!0}),!0}_onPinch(e){if(!this.touchZoom&&!this.touchRotate||!this.isDragging())return!1;let n=this.controllerState;if(this.touchZoom){const{scale:r}=e,i=this.getCenter(e);n=n.zoom({pos:i,scale:r})}if(this.touchRotate){const{rotation:r}=e;n=n.rotate({deltaAngleX:ho._startPinchRotation-r})}return this.updateViewport(n,_a,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),ho._lastPinchEvent=e,!0}_onPinchEnd(e){if(!this.isDragging())return!1;const{inertia:n}=this,{_lastPinchEvent:r}=ho;if(this.touchZoom&&n&&r&&e.scale!==r.scale){const i=this.getCenter(e);let a=this.controllerState.rotateEnd();const l=Math.log2(e.scale),u=(l-Math.log2(r.scale))/(e.deltaTime-r.deltaTime),f=Math.pow(2,l+u*n/2);a=a.zoom({pos:i,scale:f}).zoomEnd(),this.updateViewport(a,{...this._getTransitionProps({around:i}),transitionDuration:n,transitionEasing:Th},{isDragging:!1,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:!1}),this.blockEvents(n)}else{const i=this.controllerState.zoomEnd().rotateEnd();this.updateViewport(i,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1})}return ho._startPinchRotation=null,ho._lastPinchEvent=null,!0}_onDoubleClick(e){if(!this.doubleClickZoom)return!1;const n=this.getCenter(e);if(!this.isPointInBounds(n,e))return!1;const r=this.isFunctionKeyPressed(e),i=this.controllerState.zoom({pos:n,scale:r?.5:2});return this.updateViewport(i,this._getTransitionProps({around:n}),{isZooming:!0,isPanning:!0}),this.blockEvents(100),!0}_onKeyDown(e){if(!this.keyboard)return!1;const n=this.isFunctionKeyPressed(e),{zoomSpeed:r,moveSpeed:i,rotateSpeedX:a,rotateSpeedY:l}=this.keyboard===!0?{}:this.keyboard,{controllerState:u}=this;let f;const h={};switch(e.srcEvent.code){case"Minus":f=n?u.zoomOut(r).zoomOut(r):u.zoomOut(r),h.isZooming=!0;break;case"Equal":f=n?u.zoomIn(r).zoomIn(r):u.zoomIn(r),h.isZooming=!0;break;case"ArrowLeft":n?(f=u.rotateLeft(a),h.isRotating=!0):(f=u.moveLeft(i),h.isPanning=!0);break;case"ArrowRight":n?(f=u.rotateRight(a),h.isRotating=!0):(f=u.moveRight(i),h.isPanning=!0);break;case"ArrowUp":n?(f=u.rotateUp(l),h.isRotating=!0):(f=u.moveUp(i),h.isPanning=!0);break;case"ArrowDown":n?(f=u.rotateDown(l),h.isRotating=!0):(f=u.moveDown(i),h.isPanning=!0);break;default:return!1}return this.updateViewport(f,this._getTransitionProps(),h),!0}_getTransitionProps(e){const{transition:n}=this;return!n||!n.transitionInterpolator?_a:e?{...n,transitionInterpolator:new lO({...e,...n.transitionInterpolator.opts,makeViewport:this.controllerState.makeViewport})}:n}}class mq{constructor(e,n){this._viewportProps=this.applyConstraints(e),this._state=n}getViewportProps(){return this._viewportProps}getState(){return this._state}}const V2=5,vq=1.2;class _q extends mq{constructor(e){const{width:n,height:r,latitude:i,longitude:a,zoom:l,bearing:u=0,pitch:f=0,altitude:h=1.5,position:g=[0,0,0],maxZoom:m=20,minZoom:v=0,maxPitch:S=60,minPitch:w=0,startPanLngLat:E,startZoomLngLat:b,startRotatePos:C,startBearing:T,startPitch:A,startZoom:O,normalize:x=!0}=e;Fr(Number.isFinite(a)),Fr(Number.isFinite(i)),Fr(Number.isFinite(l)),super({width:n,height:r,latitude:i,longitude:a,zoom:l,bearing:u,pitch:f,altitude:h,maxZoom:m,minZoom:v,maxPitch:S,minPitch:w,normalize:x,position:g},{startPanLngLat:E,startZoomLngLat:b,startRotatePos:C,startBearing:T,startPitch:A,startZoom:O}),this.makeViewport=e.makeViewport}panStart({pos:e}){return this._getUpdatedState({startPanLngLat:this._unproject(e)})}pan({pos:e,startPos:n}){const r=this.getState().startPanLngLat||this._unproject(n);if(!r)return this;const a=this.makeViewport(this.getViewportProps()).panByPosition(r,e);return this._getUpdatedState(a)}panEnd(){return this._getUpdatedState({startPanLngLat:null})}rotateStart({pos:e}){return this._getUpdatedState({startRotatePos:e,startBearing:this.getViewportProps().bearing,startPitch:this.getViewportProps().pitch})}rotate({pos:e,deltaAngleX:n=0,deltaAngleY:r=0}){const{startRotatePos:i,startBearing:a,startPitch:l}=this.getState();if(!i||a===void 0||l===void 0)return this;let u;return e?u=this._getNewRotation(e,i,l,a):u={bearing:a+n,pitch:l+r},this._getUpdatedState(u)}rotateEnd(){return this._getUpdatedState({startBearing:null,startPitch:null})}zoomStart({pos:e}){return this._getUpdatedState({startZoomLngLat:this._unproject(e),startZoom:this.getViewportProps().zoom})}zoom({pos:e,startPos:n,scale:r}){let{startZoom:i,startZoomLngLat:a}=this.getState();if(a||(i=this.getViewportProps().zoom,a=this._unproject(n)||this._unproject(e)),!a)return this;const{maxZoom:l,minZoom:u}=this.getViewportProps();let f=i+Math.log2(r);f=Fa(f,u,l);const h=this.makeViewport({...this.getViewportProps(),zoom:f});return this._getUpdatedState({zoom:f,...h.panByPosition(a,e)})}zoomEnd(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}zoomIn(e=2){return this._zoomFromCenter(e)}zoomOut(e=2){return this._zoomFromCenter(1/e)}moveLeft(e=100){return this._panFromCenter([e,0])}moveRight(e=100){return this._panFromCenter([-e,0])}moveUp(e=100){return this._panFromCenter([0,e])}moveDown(e=100){return this._panFromCenter([0,-e])}rotateLeft(e=15){return this._getUpdatedState({bearing:this.getViewportProps().bearing-e})}rotateRight(e=15){return this._getUpdatedState({bearing:this.getViewportProps().bearing+e})}rotateUp(e=10){return this._getUpdatedState({pitch:this.getViewportProps().pitch+e})}rotateDown(e=10){return this._getUpdatedState({pitch:this.getViewportProps().pitch-e})}shortestPathFrom(e){const n=e.getViewportProps(),r={...this.getViewportProps()},{bearing:i,longitude:a}=r;return Math.abs(i-n.bearing)>180&&(r.bearing=i<0?i+360:i-360),Math.abs(a-n.longitude)>180&&(r.longitude=a<0?a+360:a-360),r}applyConstraints(e){const{maxZoom:n,minZoom:r,zoom:i}=e;e.zoom=Fa(i,r,n);const{maxPitch:a,minPitch:l,pitch:u}=e;e.pitch=Fa(u,l,a);const{normalize:f=!0}=e;return f&&Object.assign(e,DW(e)),e}_zoomFromCenter(e){const{width:n,height:r}=this.getViewportProps();return this.zoom({pos:[n/2,r/2],scale:e})}_panFromCenter(e){const{width:n,height:r}=this.getViewportProps();return this.pan({startPos:[n/2,r/2],pos:[n/2+e[0],r/2+e[1]]})}_getUpdatedState(e){return new this.constructor({makeViewport:this.makeViewport,...this.getViewportProps(),...this.getState(),...e})}_unproject(e){const n=this.makeViewport(this.getViewportProps());return e&&n.unproject(e)}_getNewRotation(e,n,r,i){const a=e[0]-n[0],l=e[1]-n[1],u=e[1],f=n[1],{width:h,height:g}=this.getViewportProps(),m=a/h;let v=0;l>0?Math.abs(g-f)>V2&&(v=l/(f-g)*vq):l<0&&f>V2&&(v=1-u/f),v=Fa(v,-1,1);const{minPitch:S,maxPitch:w}=this.getViewportProps(),E=i+180*m;let b=r;return v>0?b=r+v*(w-r):v<0&&(b=r-v*(S-r)),{pitch:b,bearing:E}}}class yq extends pq{constructor(){super(...arguments),this.ControllerState=_q,this.transition={transitionDuration:300,transitionInterpolator:new lO({transitionProps:{compare:["longitude","latitude","zoom","bearing","pitch","position"],required:["longitude","latitude","zoom"]}})},this.dragMode="pan"}setProps(e){e.position=e.position||[0,0,0];const n=this.props;super.setProps(e),(!n||n.height!==e.height)&&this.updateViewport(new this.ControllerState({makeViewport:this.makeViewport,...e,...this.state}))}}class cO extends Dc{constructor(e={}){super(e)}getViewportType(){return Ic}get ControllerType(){return yq}}cO.displayName="MapView";const bq=new JM;function Sq(t,e){const n=t.order??1/0,r=e.order??1/0;return n-r}class Eq{constructor(e){this._resolvedEffects=[],this._defaultEffects=[],this.effects=[],this._context=e,this._needsRedraw="Initial render",this._setEffects([])}addDefaultEffect(e){const n=this._defaultEffects;if(!n.find(r=>r.id===e.id)){const r=n.findIndex(i=>Sq(i,e)>0);r<0?n.push(e):n.splice(r,0,e),e.setup(this._context),this._setEffects(this.effects)}}setProps(e){"effects"in e&&(Gi(e.effects,this.effects,1)||this._setEffects(e.effects))}needsRedraw(e={clearRedrawFlags:!1}){const n=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),n}getEffects(){return this._resolvedEffects}_setEffects(e){const n={};for(const i of this.effects)n[i.id]=i;const r=[];for(const i of e){const a=n[i.id];let l=i;a&&a!==i?a.setProps?(a.setProps(i.props),l=a):a.cleanup(this._context):a||i.setup(this._context),r.push(l),delete n[i.id]}for(const i in n)n[i].cleanup(this._context);this.effects=r,this._resolvedEffects=r.concat(this._defaultEffects),e.some(i=>i instanceof JM)||this._resolvedEffects.push(bq),this._needsRedraw="effects changed"}finalize(){for(const e of this._resolvedEffects)e.cleanup(this._context);this.effects.length=0,this._resolvedEffects.length=0,this._defaultEffects.length=0}}class wq extends mb{shouldDrawLayer(e){const{operation:n}=e.props;return n.includes("draw")||n.includes("terrain")}}const Tq="deckRenderer.renderLayers";class Cq{constructor(e){this.device=e,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new wq(e),this.pickLayersPass=new sO(e),this.renderCount=0,this._needsRedraw="Initial render",this.renderBuffers=[],this.lastPostProcessEffect=null}setProps(e){this.layerFilter!==e.layerFilter&&(this.layerFilter=e.layerFilter,this._needsRedraw="layerFilter changed"),this.drawPickingColors!==e.drawPickingColors&&(this.drawPickingColors=e.drawPickingColors,this._needsRedraw="drawPickingColors changed")}renderLayers(e){if(!e.viewports.length)return;const n=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass,r={layerFilter:this.layerFilter,isPicking:this.drawPickingColors,...e};r.effects&&this._preRender(r.effects,r);const i=this.lastPostProcessEffect?this.renderBuffers[0]:r.target;this.lastPostProcessEffect&&(r.clearColor=[0,0,0,0],r.clearCanvas=!0);const a=n.render({...r,target:i});r.effects&&this._postRender(r.effects,r),this.renderCount++,Hr(Tq,this,a,e)}needsRedraw(e={clearRedrawFlags:!1}){const n=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),n}finalize(){const{renderBuffers:e}=this;for(const n of e)n.delete();e.length=0}_preRender(e,n){this.lastPostProcessEffect=null,n.preRenderStats=n.preRenderStats||{};for(const r of e)n.preRenderStats[r.id]=r.preRender(n),r.postRender&&(this.lastPostProcessEffect=r.id);this.lastPostProcessEffect&&this._resizeRenderBuffers()}_resizeRenderBuffers(){const{renderBuffers:e}=this,n=this.device.canvasContext.getDrawingBufferSize();e.length===0&&[0,1].map(r=>{const i=this.device.createTexture({sampler:{minFilter:"linear",magFilter:"linear"}});e.push(this.device.createFramebuffer({id:`deck-renderbuffer-${r}`,colorAttachments:[i]}))});for(const r of e)r.resize(n)}_postRender(e,n){const{renderBuffers:r}=this,i={...n,inputBuffer:r[0],swapBuffer:r[1]};for(const a of e)if(a.postRender){i.target=a.id===this.lastPostProcessEffect?n.target:void 0;const l=a.postRender(i);i.inputBuffer=l,i.swapBuffer=l===r[0]?r[1]:r[0]}}}const Aq={pickedColor:null,pickedObjectIndex:-1};function Rq({pickedColors:t,decodePickingColor:e,deviceX:n,deviceY:r,deviceRadius:i,deviceRect:a}){const{x:l,y:u,width:f,height:h}=a;let g=i*i,m=-1,v=0;for(let S=0;Sg)v+=4*f;else for(let b=0;b=0){const T=b+l-n,A=T*T+E;A<=g&&(g=A,m=v)}v+=4}}if(m>=0){const S=t.slice(m,m+4),w=e(S);if(w){const E=Math.floor(m/4/f),b=m/4-E*f;return{...w,pickedColor:S,pickedX:l+b,pickedY:u+E}}Sn.error("Picked non-existent layer. Is picking buffer corrupt?")()}return Aq}function xq({pickedColors:t,decodePickingColor:e}){const n=new Map;if(t){for(let r=0;r=0){const a=t.slice(r,r+4),l=a.join(",");if(!n.has(l)){const u=e(a);u?n.set(l,{...u,color:a}):Sn.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(n.values())}function uO({pickInfo:t,viewports:e,pixelRatio:n,x:r,y:i,z:a}){let l=e[0];e.length>1&&(l=Oq((t==null?void 0:t.pickedViewports)||e,{x:r,y:i}));let u;if(l){const f=[r-l.x,i-l.y];a!==void 0&&(f[2]=a),u=l.unproject(f)}return{color:null,layer:null,viewport:l,index:-1,picked:!1,x:r,y:i,pixel:[r,i],coordinate:u,devicePixel:t&&"pickedX"in t?[t.pickedX,t.pickedY]:void 0,pixelRatio:n}}function Mq(t){const{pickInfo:e,lastPickedInfo:n,mode:r,layers:i}=t,{pickedColor:a,pickedLayer:l,pickedObjectIndex:u}=e,f=l?[l]:[];if(r==="hover"){const m=n.index,v=n.layerId,S=l?l.props.id:null;if(S!==v||u!==m){if(S!==v){const w=i.find(E=>E.props.id===v);w&&f.unshift(w)}n.layerId=S,n.index=u,n.info=null}}const h=uO(t),g=new Map;return g.set(null,h),f.forEach(m=>{let v={...h};m===l&&(v.color=a,v.index=u,v.picked=!0),v=fO({layer:m,info:v,mode:r});const S=v.layer;m===l&&r==="hover"&&(n.info=v),g.set(S.id,v),r==="hover"&&S.updateAutoHighlight(v)}),g}function fO({layer:t,info:e,mode:n}){for(;t&&e;){const r=e.layer||null;e.sourceLayer=r,e.layer=t,e=t.getPickingInfo({info:e,mode:n,sourceLayer:r}),t=t.parent}return e}function Oq(t,e){for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.containsPixel(e))return r}return t[0]}class Pq{constructor(e){this._pickable=!0,this.device=e,this.pickLayersPass=new sO(e),this.lastPickedInfo={index:-1,layerId:null,info:null}}setProps(e){"layerFilter"in e&&(this.layerFilter=e.layerFilter),"_pickable"in e&&(this._pickable=e._pickable)}finalize(){this.pickingFBO&&this.pickingFBO.destroy(),this.depthFBO&&this.depthFBO.destroy()}pickObject(e){return this._pickClosestObject(e)}pickObjects(e){return this._pickVisibleObjects(e)}getLastPickedObject({x:e,y:n,layers:r,viewports:i},a=this.lastPickedInfo.info){const l=a&&a.layer&&a.layer.id,u=a&&a.viewport&&a.viewport.id,f=l?r.find(v=>v.id===l):null,h=u&&i.find(v=>v.id===u)||i[0],g=h&&h.unproject([e-h.x,n-h.y]);return{...a,...{x:e,y:n,viewport:h,coordinate:g,layer:f}}}_resizeBuffer(){var n,r;if(!this.pickingFBO&&(this.pickingFBO=this.device.createFramebuffer({colorAttachments:["rgba8unorm"],depthStencilAttachment:"depth16unorm"}),this.device.isTextureFormatRenderable("rgba32float"))){const i=this.device.createFramebuffer({colorAttachments:["rgba32float"],depthStencilAttachment:"depth16unorm"});this.depthFBO=i}const{canvas:e}=this.device.getDefaultCanvasContext();(n=this.pickingFBO)==null||n.resize({width:e.width,height:e.height}),(r=this.depthFBO)==null||r.resize({width:e.width,height:e.height})}_getPickable(e){if(this._pickable===!1)return null;const n=e.filter(r=>this.pickLayersPass.shouldDrawLayer(r)&&!r.isComposite);return n.length?n:null}_pickClosestObject({layers:e,views:n,viewports:r,x:i,y:a,radius:l=0,depth:u=1,mode:f="query",unproject3D:h,onViewportActive:g,effects:m}){const v=this.device.canvasContext.cssToDeviceRatio(),S=this._getPickable(e);if(!S||r.length===0)return{result:[],emptyInfo:uO({viewports:r,x:i,y:a,pixelRatio:v})};this._resizeBuffer();const w=this.device.canvasContext.cssToDevicePixels([i,a],!0),E=[w.x+Math.floor(w.width/2),w.y+Math.floor(w.height/2)],b=Math.round(l*v),{width:C,height:T}=this.pickingFBO,A=this._getPickingRect({deviceX:E[0],deviceY:E[1],deviceRadius:b,deviceWidth:C,deviceHeight:T}),O={x:i-l,y:a-l,width:l*2+1,height:l*2+1};let x;const N=[],F=new Set;for(let L=0;L=h);V++){const B=N[V];let W={color:B.pickedColor,layer:null,index:B.pickedObjectIndex,picked:!0,x:i,y:a,pixelRatio:S};W=fO({layer:B.pickedLayer,info:W,mode:f});const X=W.layer.id;F.has(X)||F.set(X,new Set);const Y=F.get(X),ae=W.object??W.index;Y.has(ae)||(Y.add(ae),L.push(W))}return L}_drawAndSample({layers:e,views:n,viewports:r,onViewportActive:i,deviceRect:a,cullRect:l,effects:u,pass:f},h=!1){const g=h?this.depthFBO:this.pickingFBO,m={layers:e,layerFilter:this.layerFilter,views:n,viewports:r,onViewportActive:i,pickingFBO:g,deviceRect:a,cullRect:l,effects:u,pass:f,pickZ:h,preRenderStats:{},isPicking:!0};for(const T of u)T.useInPicking&&(m.preRenderStats[T.id]=T.preRender(m));const{decodePickingColor:v}=this.pickLayersPass.render(m),{x:S,y:w,width:E,height:b}=a,C=new(h?Float32Array:Uint8Array)(E*b*4);return this.device.readPixelsToArrayWebGL(g,{sourceX:S,sourceY:w,sourceWidth:E,sourceHeight:b,target:C}),{pickedColors:C,decodePickingColor:v}}_getPickingRect({deviceX:e,deviceY:n,deviceRadius:r,deviceWidth:i,deviceHeight:a}){const l=Math.max(0,e-r),u=Math.max(0,n-r),f=Math.min(i,e+r+1)-l,h=Math.min(a,n+r+1)-u;return f<=0||h<=0?null:{x:l,y:u,width:f,height:h}}}const Nq={"top-left":{top:0,left:0},"top-right":{top:0,right:0},"bottom-left":{bottom:0,left:0},"bottom-right":{bottom:0,right:0},fill:{top:0,left:0,bottom:0,right:0}},Iq="top-left",H2="__root";class Dq{constructor({deck:e,parentElement:n}){this.defaultWidgets=[],this.widgets=[],this.resolvedWidgets=[],this.containers={},this.lastViewports={},this.deck=e,this.parentElement=n}getWidgets(){return this.resolvedWidgets}setProps(e){e.widgets&&!Gi(e.widgets,this.widgets,1)&&this._setWidgets(e.widgets)}finalize(){for(const e of this.getWidgets())this._remove(e);this.defaultWidgets.length=0,this.resolvedWidgets.length=0;for(const e in this.containers)this.containers[e].remove()}addDefault(e){this.defaultWidgets.find(n=>n.id===e.id)||(this._add(e),this.defaultWidgets.push(e),this._setWidgets(this.widgets))}_setWidgets(e){const n={};for(const r of this.resolvedWidgets)n[r.id]=r;this.resolvedWidgets.length=0;for(const r of this.defaultWidgets)n[r.id]=null,this.resolvedWidgets.push(r);for(let r of e){const i=n[r.id];i?i.viewId!==r.viewId||i.placement!==r.placement?(this._remove(i),this._add(r)):r!==i&&(i.setProps(r.props),r=i):this._add(r),n[r.id]=null,this.resolvedWidgets.push(r)}for(const r in n){const i=n[r];i&&this._remove(i)}this.widgets=e}_add(e){const{viewId:n=null,placement:r=Iq}=e,i=e.onAdd({deck:this.deck,viewId:n});i&&this._getContainer(n,r).append(i),e._element=i}_remove(e){var n;(n=e.onRemove)==null||n.call(e),e._element&&e._element.remove(),e._element=void 0}_getContainer(e,n){var l;const r=e||H2;let i=this.containers[r];i||(i=document.createElement("div"),i.style.pointerEvents="none",i.style.position="absolute",i.style.overflow="hidden",(l=this.parentElement)==null||l.append(i),this.containers[r]=i);let a=i.querySelector(`.${n}`);return a||(a=document.createElement("div"),a.className=n,a.style.position="absolute",a.style.zIndex="2",Object.assign(a.style,Nq[n]),i.append(a)),a}_updateContainers(){const e=this.deck.width,n=this.deck.height;for(const r in this.containers){const i=this.lastViewports[r]||null,a=r===H2||i,l=this.containers[r];a?(l.style.display="block",l.style.left=`${i?i.x:0}px`,l.style.top=`${i?i.y:0}px`,l.style.width=`${i?i.width:e}px`,l.style.height=`${i?i.height:n}px`):l.style.display="none"}}onRedraw({viewports:e,layers:n}){var i,a;const r=e.reduce((l,u)=>(l[u.id]=u,l),{});for(const l of this.getWidgets()){const{viewId:u}=l;if(u){const f=r[u];f&&(l.onViewportChange&&l.onViewportChange(f),(i=l.onRedraw)==null||i.call(l,{viewports:[f],layers:n}))}else{if(l.onViewportChange)for(const f of e)l.onViewportChange(f);(a=l.onRedraw)==null||a.call(l,{viewports:e,layers:n})}}this.lastViewports=r,this._updateContainers()}onHover(e,n){var r,i;for(const a of this.getWidgets()){const{viewId:l}=a;(!l||l===((r=e.viewport)==null?void 0:r.id))&&((i=a.onHover)==null||i.call(a,e,n))}}onEvent(e,n){var i,a;const r=ty[n.type];if(r)for(const l of this.getWidgets()){const{viewId:u}=l;(!u||u===((i=e.viewport)==null?void 0:i.id))&&((a=l[r])==null||a.call(l,e,n))}}}const Fq={zIndex:"1",position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:"0",left:"0",display:"none"};class kq{constructor(){this.id="default-tooltip",this.placement="fill",this.props={},this.isVisible=!1}onAdd({deck:e}){const n=document.createElement("div");return n.className="deck-tooltip",Object.assign(n.style,Fq),this.deck=e,this.element=n,n}onRemove(){this.deck=void 0,this.element=void 0}setProps(){}onViewportChange(e){var n;this.isVisible&&e.id===((n=this.lastViewport)==null?void 0:n.id)&&e!==this.lastViewport&&this.setTooltip(null)}onHover(e){const{deck:n}=this,r=n&&n.props.getTooltip;if(!r)return;const i=r(e);this.lastViewport=e.viewport,this.setTooltip(i,e.x,e.y)}setTooltip(e,n,r){const i=this.element;if(i){if(typeof e=="string")i.innerText=e;else if(e)e.text&&(i.innerText=e.text),e.html&&(i.innerHTML=e.html),e.className&&(i.className=e.className);else{this.isVisible=!1,i.style.display="none";return}this.isVisible=!0,i.style.display="block",i.style.transform=`translate(${n}px, ${r}px)`,e&&typeof e=="object"&&"style"in e&&Object.assign(i.style,e.style)}}}var Yl;(function(t){t[t.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",t[t.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",t[t.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN",t[t.ZERO=0]="ZERO",t[t.ONE=1]="ONE",t[t.SRC_COLOR=768]="SRC_COLOR",t[t.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",t[t.SRC_ALPHA=770]="SRC_ALPHA",t[t.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",t[t.DST_ALPHA=772]="DST_ALPHA",t[t.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",t[t.DST_COLOR=774]="DST_COLOR",t[t.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",t[t.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",t[t.CONSTANT_COLOR=32769]="CONSTANT_COLOR",t[t.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",t[t.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",t[t.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",t[t.FUNC_ADD=32774]="FUNC_ADD",t[t.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",t[t.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",t[t.BLEND_EQUATION=32777]="BLEND_EQUATION",t[t.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",t[t.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",t[t.BLEND_DST_RGB=32968]="BLEND_DST_RGB",t[t.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",t[t.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",t[t.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",t[t.BLEND_COLOR=32773]="BLEND_COLOR",t[t.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",t[t.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",t[t.LINE_WIDTH=2849]="LINE_WIDTH",t[t.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",t[t.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",t[t.CULL_FACE_MODE=2885]="CULL_FACE_MODE",t[t.FRONT_FACE=2886]="FRONT_FACE",t[t.DEPTH_RANGE=2928]="DEPTH_RANGE",t[t.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",t[t.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",t[t.DEPTH_FUNC=2932]="DEPTH_FUNC",t[t.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",t[t.STENCIL_FUNC=2962]="STENCIL_FUNC",t[t.STENCIL_FAIL=2964]="STENCIL_FAIL",t[t.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",t[t.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",t[t.STENCIL_REF=2967]="STENCIL_REF",t[t.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",t[t.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",t[t.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",t[t.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",t[t.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",t[t.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",t[t.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",t[t.VIEWPORT=2978]="VIEWPORT",t[t.SCISSOR_BOX=3088]="SCISSOR_BOX",t[t.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",t[t.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",t[t.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",t[t.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",t[t.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",t[t.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",t[t.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",t[t.RED_BITS=3410]="RED_BITS",t[t.GREEN_BITS=3411]="GREEN_BITS",t[t.BLUE_BITS=3412]="BLUE_BITS",t[t.ALPHA_BITS=3413]="ALPHA_BITS",t[t.DEPTH_BITS=3414]="DEPTH_BITS",t[t.STENCIL_BITS=3415]="STENCIL_BITS",t[t.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",t[t.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",t[t.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",t[t.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",t[t.SAMPLES=32937]="SAMPLES",t[t.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",t[t.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",t[t.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",t[t.VENDOR=7936]="VENDOR",t[t.RENDERER=7937]="RENDERER",t[t.VERSION=7938]="VERSION",t[t.IMPLEMENTATION_COLOR_READ_TYPE=35738]="IMPLEMENTATION_COLOR_READ_TYPE",t[t.IMPLEMENTATION_COLOR_READ_FORMAT=35739]="IMPLEMENTATION_COLOR_READ_FORMAT",t[t.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL",t[t.STATIC_DRAW=35044]="STATIC_DRAW",t[t.STREAM_DRAW=35040]="STREAM_DRAW",t[t.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.BUFFER_SIZE=34660]="BUFFER_SIZE",t[t.BUFFER_USAGE=34661]="BUFFER_USAGE",t[t.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",t[t.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",t[t.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",t[t.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",t[t.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",t[t.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",t[t.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",t[t.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",t[t.CULL_FACE=2884]="CULL_FACE",t[t.FRONT=1028]="FRONT",t[t.BACK=1029]="BACK",t[t.FRONT_AND_BACK=1032]="FRONT_AND_BACK",t[t.BLEND=3042]="BLEND",t[t.DEPTH_TEST=2929]="DEPTH_TEST",t[t.DITHER=3024]="DITHER",t[t.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",t[t.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",t[t.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",t[t.SCISSOR_TEST=3089]="SCISSOR_TEST",t[t.STENCIL_TEST=2960]="STENCIL_TEST",t[t.NO_ERROR=0]="NO_ERROR",t[t.INVALID_ENUM=1280]="INVALID_ENUM",t[t.INVALID_VALUE=1281]="INVALID_VALUE",t[t.INVALID_OPERATION=1282]="INVALID_OPERATION",t[t.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",t[t.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",t[t.CW=2304]="CW",t[t.CCW=2305]="CCW",t[t.DONT_CARE=4352]="DONT_CARE",t[t.FASTEST=4353]="FASTEST",t[t.NICEST=4354]="NICEST",t[t.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",t[t.BYTE=5120]="BYTE",t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.SHORT=5122]="SHORT",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.INT=5124]="INT",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.FLOAT=5126]="FLOAT",t[t.DOUBLE=5130]="DOUBLE",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.ALPHA=6406]="ALPHA",t[t.RGB=6407]="RGB",t[t.RGBA=6408]="RGBA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",t[t.VERTEX_SHADER=35633]="VERTEX_SHADER",t[t.COMPILE_STATUS=35713]="COMPILE_STATUS",t[t.DELETE_STATUS=35712]="DELETE_STATUS",t[t.LINK_STATUS=35714]="LINK_STATUS",t[t.VALIDATE_STATUS=35715]="VALIDATE_STATUS",t[t.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",t[t.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",t[t.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",t[t.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",t[t.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",t[t.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",t[t.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",t[t.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",t[t.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",t[t.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",t[t.SHADER_TYPE=35663]="SHADER_TYPE",t[t.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",t[t.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",t[t.NEVER=512]="NEVER",t[t.LESS=513]="LESS",t[t.EQUAL=514]="EQUAL",t[t.LEQUAL=515]="LEQUAL",t[t.GREATER=516]="GREATER",t[t.NOTEQUAL=517]="NOTEQUAL",t[t.GEQUAL=518]="GEQUAL",t[t.ALWAYS=519]="ALWAYS",t[t.KEEP=7680]="KEEP",t[t.REPLACE=7681]="REPLACE",t[t.INCR=7682]="INCR",t[t.DECR=7683]="DECR",t[t.INVERT=5386]="INVERT",t[t.INCR_WRAP=34055]="INCR_WRAP",t[t.DECR_WRAP=34056]="DECR_WRAP",t[t.NEAREST=9728]="NEAREST",t[t.LINEAR=9729]="LINEAR",t[t.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",t[t.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",t[t.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",t[t.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",t[t.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",t[t.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",t[t.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",t[t.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE=5890]="TEXTURE",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t[t.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",t[t.TEXTURE0=33984]="TEXTURE0",t[t.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",t[t.REPEAT=10497]="REPEAT",t[t.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",t[t.TEXTURE_WIDTH=4096]="TEXTURE_WIDTH",t[t.TEXTURE_HEIGHT=4097]="TEXTURE_HEIGHT",t[t.FLOAT_VEC2=35664]="FLOAT_VEC2",t[t.FLOAT_VEC3=35665]="FLOAT_VEC3",t[t.FLOAT_VEC4=35666]="FLOAT_VEC4",t[t.INT_VEC2=35667]="INT_VEC2",t[t.INT_VEC3=35668]="INT_VEC3",t[t.INT_VEC4=35669]="INT_VEC4",t[t.BOOL=35670]="BOOL",t[t.BOOL_VEC2=35671]="BOOL_VEC2",t[t.BOOL_VEC3=35672]="BOOL_VEC3",t[t.BOOL_VEC4=35673]="BOOL_VEC4",t[t.FLOAT_MAT2=35674]="FLOAT_MAT2",t[t.FLOAT_MAT3=35675]="FLOAT_MAT3",t[t.FLOAT_MAT4=35676]="FLOAT_MAT4",t[t.SAMPLER_2D=35678]="SAMPLER_2D",t[t.SAMPLER_CUBE=35680]="SAMPLER_CUBE",t[t.LOW_FLOAT=36336]="LOW_FLOAT",t[t.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",t[t.HIGH_FLOAT=36338]="HIGH_FLOAT",t[t.LOW_INT=36339]="LOW_INT",t[t.MEDIUM_INT=36340]="MEDIUM_INT",t[t.HIGH_INT=36341]="HIGH_INT",t[t.FRAMEBUFFER=36160]="FRAMEBUFFER",t[t.RENDERBUFFER=36161]="RENDERBUFFER",t[t.RGBA4=32854]="RGBA4",t[t.RGB5_A1=32855]="RGB5_A1",t[t.RGB565=36194]="RGB565",t[t.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",t[t.STENCIL_INDEX=6401]="STENCIL_INDEX",t[t.STENCIL_INDEX8=36168]="STENCIL_INDEX8",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t[t.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",t[t.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",t[t.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",t[t.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",t[t.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",t[t.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",t[t.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",t[t.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",t[t.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",t[t.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",t[t.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",t[t.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",t[t.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",t[t.NONE=0]="NONE",t[t.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",t[t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",t[t.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",t[t.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",t[t.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",t[t.READ_FRAMEBUFFER=36008]="READ_FRAMEBUFFER",t[t.DRAW_FRAMEBUFFER=36009]="DRAW_FRAMEBUFFER",t[t.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",t[t.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",t[t.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",t[t.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",t[t.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",t[t.READ_BUFFER=3074]="READ_BUFFER",t[t.UNPACK_ROW_LENGTH=3314]="UNPACK_ROW_LENGTH",t[t.UNPACK_SKIP_ROWS=3315]="UNPACK_SKIP_ROWS",t[t.UNPACK_SKIP_PIXELS=3316]="UNPACK_SKIP_PIXELS",t[t.PACK_ROW_LENGTH=3330]="PACK_ROW_LENGTH",t[t.PACK_SKIP_ROWS=3331]="PACK_SKIP_ROWS",t[t.PACK_SKIP_PIXELS=3332]="PACK_SKIP_PIXELS",t[t.TEXTURE_BINDING_3D=32874]="TEXTURE_BINDING_3D",t[t.UNPACK_SKIP_IMAGES=32877]="UNPACK_SKIP_IMAGES",t[t.UNPACK_IMAGE_HEIGHT=32878]="UNPACK_IMAGE_HEIGHT",t[t.MAX_3D_TEXTURE_SIZE=32883]="MAX_3D_TEXTURE_SIZE",t[t.MAX_ELEMENTS_VERTICES=33e3]="MAX_ELEMENTS_VERTICES",t[t.MAX_ELEMENTS_INDICES=33001]="MAX_ELEMENTS_INDICES",t[t.MAX_TEXTURE_LOD_BIAS=34045]="MAX_TEXTURE_LOD_BIAS",t[t.MAX_FRAGMENT_UNIFORM_COMPONENTS=35657]="MAX_FRAGMENT_UNIFORM_COMPONENTS",t[t.MAX_VERTEX_UNIFORM_COMPONENTS=35658]="MAX_VERTEX_UNIFORM_COMPONENTS",t[t.MAX_ARRAY_TEXTURE_LAYERS=35071]="MAX_ARRAY_TEXTURE_LAYERS",t[t.MIN_PROGRAM_TEXEL_OFFSET=35076]="MIN_PROGRAM_TEXEL_OFFSET",t[t.MAX_PROGRAM_TEXEL_OFFSET=35077]="MAX_PROGRAM_TEXEL_OFFSET",t[t.MAX_VARYING_COMPONENTS=35659]="MAX_VARYING_COMPONENTS",t[t.FRAGMENT_SHADER_DERIVATIVE_HINT=35723]="FRAGMENT_SHADER_DERIVATIVE_HINT",t[t.RASTERIZER_DISCARD=35977]="RASTERIZER_DISCARD",t[t.VERTEX_ARRAY_BINDING=34229]="VERTEX_ARRAY_BINDING",t[t.MAX_VERTEX_OUTPUT_COMPONENTS=37154]="MAX_VERTEX_OUTPUT_COMPONENTS",t[t.MAX_FRAGMENT_INPUT_COMPONENTS=37157]="MAX_FRAGMENT_INPUT_COMPONENTS",t[t.MAX_SERVER_WAIT_TIMEOUT=37137]="MAX_SERVER_WAIT_TIMEOUT",t[t.MAX_ELEMENT_INDEX=36203]="MAX_ELEMENT_INDEX",t[t.RED=6403]="RED",t[t.RGB8=32849]="RGB8",t[t.RGBA8=32856]="RGBA8",t[t.RGB10_A2=32857]="RGB10_A2",t[t.TEXTURE_3D=32879]="TEXTURE_3D",t[t.TEXTURE_WRAP_R=32882]="TEXTURE_WRAP_R",t[t.TEXTURE_MIN_LOD=33082]="TEXTURE_MIN_LOD",t[t.TEXTURE_MAX_LOD=33083]="TEXTURE_MAX_LOD",t[t.TEXTURE_BASE_LEVEL=33084]="TEXTURE_BASE_LEVEL",t[t.TEXTURE_MAX_LEVEL=33085]="TEXTURE_MAX_LEVEL",t[t.TEXTURE_COMPARE_MODE=34892]="TEXTURE_COMPARE_MODE",t[t.TEXTURE_COMPARE_FUNC=34893]="TEXTURE_COMPARE_FUNC",t[t.SRGB=35904]="SRGB",t[t.SRGB8=35905]="SRGB8",t[t.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8",t[t.COMPARE_REF_TO_TEXTURE=34894]="COMPARE_REF_TO_TEXTURE",t[t.RGBA32F=34836]="RGBA32F",t[t.RGB32F=34837]="RGB32F",t[t.RGBA16F=34842]="RGBA16F",t[t.RGB16F=34843]="RGB16F",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_BINDING_2D_ARRAY=35869]="TEXTURE_BINDING_2D_ARRAY",t[t.R11F_G11F_B10F=35898]="R11F_G11F_B10F",t[t.RGB9_E5=35901]="RGB9_E5",t[t.RGBA32UI=36208]="RGBA32UI",t[t.RGB32UI=36209]="RGB32UI",t[t.RGBA16UI=36214]="RGBA16UI",t[t.RGB16UI=36215]="RGB16UI",t[t.RGBA8UI=36220]="RGBA8UI",t[t.RGB8UI=36221]="RGB8UI",t[t.RGBA32I=36226]="RGBA32I",t[t.RGB32I=36227]="RGB32I",t[t.RGBA16I=36232]="RGBA16I",t[t.RGB16I=36233]="RGB16I",t[t.RGBA8I=36238]="RGBA8I",t[t.RGB8I=36239]="RGB8I",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.R8=33321]="R8",t[t.RG8=33323]="RG8",t[t.R16F=33325]="R16F",t[t.R32F=33326]="R32F",t[t.RG16F=33327]="RG16F",t[t.RG32F=33328]="RG32F",t[t.R8I=33329]="R8I",t[t.R8UI=33330]="R8UI",t[t.R16I=33331]="R16I",t[t.R16UI=33332]="R16UI",t[t.R32I=33333]="R32I",t[t.R32UI=33334]="R32UI",t[t.RG8I=33335]="RG8I",t[t.RG8UI=33336]="RG8UI",t[t.RG16I=33337]="RG16I",t[t.RG16UI=33338]="RG16UI",t[t.RG32I=33339]="RG32I",t[t.RG32UI=33340]="RG32UI",t[t.R8_SNORM=36756]="R8_SNORM",t[t.RG8_SNORM=36757]="RG8_SNORM",t[t.RGB8_SNORM=36758]="RGB8_SNORM",t[t.RGBA8_SNORM=36759]="RGBA8_SNORM",t[t.RGB10_A2UI=36975]="RGB10_A2UI",t[t.TEXTURE_IMMUTABLE_FORMAT=37167]="TEXTURE_IMMUTABLE_FORMAT",t[t.TEXTURE_IMMUTABLE_LEVELS=33503]="TEXTURE_IMMUTABLE_LEVELS",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.HALF_FLOAT=5131]="HALF_FLOAT",t[t.RG=33319]="RG",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.INT_2_10_10_10_REV=36255]="INT_2_10_10_10_REV",t[t.CURRENT_QUERY=34917]="CURRENT_QUERY",t[t.QUERY_RESULT=34918]="QUERY_RESULT",t[t.QUERY_RESULT_AVAILABLE=34919]="QUERY_RESULT_AVAILABLE",t[t.ANY_SAMPLES_PASSED=35887]="ANY_SAMPLES_PASSED",t[t.ANY_SAMPLES_PASSED_CONSERVATIVE=36202]="ANY_SAMPLES_PASSED_CONSERVATIVE",t[t.MAX_DRAW_BUFFERS=34852]="MAX_DRAW_BUFFERS",t[t.DRAW_BUFFER0=34853]="DRAW_BUFFER0",t[t.DRAW_BUFFER1=34854]="DRAW_BUFFER1",t[t.DRAW_BUFFER2=34855]="DRAW_BUFFER2",t[t.DRAW_BUFFER3=34856]="DRAW_BUFFER3",t[t.DRAW_BUFFER4=34857]="DRAW_BUFFER4",t[t.DRAW_BUFFER5=34858]="DRAW_BUFFER5",t[t.DRAW_BUFFER6=34859]="DRAW_BUFFER6",t[t.DRAW_BUFFER7=34860]="DRAW_BUFFER7",t[t.DRAW_BUFFER8=34861]="DRAW_BUFFER8",t[t.DRAW_BUFFER9=34862]="DRAW_BUFFER9",t[t.DRAW_BUFFER10=34863]="DRAW_BUFFER10",t[t.DRAW_BUFFER11=34864]="DRAW_BUFFER11",t[t.DRAW_BUFFER12=34865]="DRAW_BUFFER12",t[t.DRAW_BUFFER13=34866]="DRAW_BUFFER13",t[t.DRAW_BUFFER14=34867]="DRAW_BUFFER14",t[t.DRAW_BUFFER15=34868]="DRAW_BUFFER15",t[t.MAX_COLOR_ATTACHMENTS=36063]="MAX_COLOR_ATTACHMENTS",t[t.COLOR_ATTACHMENT1=36065]="COLOR_ATTACHMENT1",t[t.COLOR_ATTACHMENT2=36066]="COLOR_ATTACHMENT2",t[t.COLOR_ATTACHMENT3=36067]="COLOR_ATTACHMENT3",t[t.COLOR_ATTACHMENT4=36068]="COLOR_ATTACHMENT4",t[t.COLOR_ATTACHMENT5=36069]="COLOR_ATTACHMENT5",t[t.COLOR_ATTACHMENT6=36070]="COLOR_ATTACHMENT6",t[t.COLOR_ATTACHMENT7=36071]="COLOR_ATTACHMENT7",t[t.COLOR_ATTACHMENT8=36072]="COLOR_ATTACHMENT8",t[t.COLOR_ATTACHMENT9=36073]="COLOR_ATTACHMENT9",t[t.COLOR_ATTACHMENT10=36074]="COLOR_ATTACHMENT10",t[t.COLOR_ATTACHMENT11=36075]="COLOR_ATTACHMENT11",t[t.COLOR_ATTACHMENT12=36076]="COLOR_ATTACHMENT12",t[t.COLOR_ATTACHMENT13=36077]="COLOR_ATTACHMENT13",t[t.COLOR_ATTACHMENT14=36078]="COLOR_ATTACHMENT14",t[t.COLOR_ATTACHMENT15=36079]="COLOR_ATTACHMENT15",t[t.SAMPLER_3D=35679]="SAMPLER_3D",t[t.SAMPLER_2D_SHADOW=35682]="SAMPLER_2D_SHADOW",t[t.SAMPLER_2D_ARRAY=36289]="SAMPLER_2D_ARRAY",t[t.SAMPLER_2D_ARRAY_SHADOW=36292]="SAMPLER_2D_ARRAY_SHADOW",t[t.SAMPLER_CUBE_SHADOW=36293]="SAMPLER_CUBE_SHADOW",t[t.INT_SAMPLER_2D=36298]="INT_SAMPLER_2D",t[t.INT_SAMPLER_3D=36299]="INT_SAMPLER_3D",t[t.INT_SAMPLER_CUBE=36300]="INT_SAMPLER_CUBE",t[t.INT_SAMPLER_2D_ARRAY=36303]="INT_SAMPLER_2D_ARRAY",t[t.UNSIGNED_INT_SAMPLER_2D=36306]="UNSIGNED_INT_SAMPLER_2D",t[t.UNSIGNED_INT_SAMPLER_3D=36307]="UNSIGNED_INT_SAMPLER_3D",t[t.UNSIGNED_INT_SAMPLER_CUBE=36308]="UNSIGNED_INT_SAMPLER_CUBE",t[t.UNSIGNED_INT_SAMPLER_2D_ARRAY=36311]="UNSIGNED_INT_SAMPLER_2D_ARRAY",t[t.MAX_SAMPLES=36183]="MAX_SAMPLES",t[t.SAMPLER_BINDING=35097]="SAMPLER_BINDING",t[t.PIXEL_PACK_BUFFER=35051]="PIXEL_PACK_BUFFER",t[t.PIXEL_UNPACK_BUFFER=35052]="PIXEL_UNPACK_BUFFER",t[t.PIXEL_PACK_BUFFER_BINDING=35053]="PIXEL_PACK_BUFFER_BINDING",t[t.PIXEL_UNPACK_BUFFER_BINDING=35055]="PIXEL_UNPACK_BUFFER_BINDING",t[t.COPY_READ_BUFFER=36662]="COPY_READ_BUFFER",t[t.COPY_WRITE_BUFFER=36663]="COPY_WRITE_BUFFER",t[t.COPY_READ_BUFFER_BINDING=36662]="COPY_READ_BUFFER_BINDING",t[t.COPY_WRITE_BUFFER_BINDING=36663]="COPY_WRITE_BUFFER_BINDING",t[t.FLOAT_MAT2x3=35685]="FLOAT_MAT2x3",t[t.FLOAT_MAT2x4=35686]="FLOAT_MAT2x4",t[t.FLOAT_MAT3x2=35687]="FLOAT_MAT3x2",t[t.FLOAT_MAT3x4=35688]="FLOAT_MAT3x4",t[t.FLOAT_MAT4x2=35689]="FLOAT_MAT4x2",t[t.FLOAT_MAT4x3=35690]="FLOAT_MAT4x3",t[t.UNSIGNED_INT_VEC2=36294]="UNSIGNED_INT_VEC2",t[t.UNSIGNED_INT_VEC3=36295]="UNSIGNED_INT_VEC3",t[t.UNSIGNED_INT_VEC4=36296]="UNSIGNED_INT_VEC4",t[t.UNSIGNED_NORMALIZED=35863]="UNSIGNED_NORMALIZED",t[t.SIGNED_NORMALIZED=36764]="SIGNED_NORMALIZED",t[t.VERTEX_ATTRIB_ARRAY_INTEGER=35069]="VERTEX_ATTRIB_ARRAY_INTEGER",t[t.VERTEX_ATTRIB_ARRAY_DIVISOR=35070]="VERTEX_ATTRIB_ARRAY_DIVISOR",t[t.TRANSFORM_FEEDBACK_BUFFER_MODE=35967]="TRANSFORM_FEEDBACK_BUFFER_MODE",t[t.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS=35968]="MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS",t[t.TRANSFORM_FEEDBACK_VARYINGS=35971]="TRANSFORM_FEEDBACK_VARYINGS",t[t.TRANSFORM_FEEDBACK_BUFFER_START=35972]="TRANSFORM_FEEDBACK_BUFFER_START",t[t.TRANSFORM_FEEDBACK_BUFFER_SIZE=35973]="TRANSFORM_FEEDBACK_BUFFER_SIZE",t[t.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN=35976]="TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN",t[t.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS=35978]="MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS",t[t.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS=35979]="MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS",t[t.INTERLEAVED_ATTRIBS=35980]="INTERLEAVED_ATTRIBS",t[t.SEPARATE_ATTRIBS=35981]="SEPARATE_ATTRIBS",t[t.TRANSFORM_FEEDBACK_BUFFER=35982]="TRANSFORM_FEEDBACK_BUFFER",t[t.TRANSFORM_FEEDBACK_BUFFER_BINDING=35983]="TRANSFORM_FEEDBACK_BUFFER_BINDING",t[t.TRANSFORM_FEEDBACK=36386]="TRANSFORM_FEEDBACK",t[t.TRANSFORM_FEEDBACK_PAUSED=36387]="TRANSFORM_FEEDBACK_PAUSED",t[t.TRANSFORM_FEEDBACK_ACTIVE=36388]="TRANSFORM_FEEDBACK_ACTIVE",t[t.TRANSFORM_FEEDBACK_BINDING=36389]="TRANSFORM_FEEDBACK_BINDING",t[t.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING=33296]="FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING",t[t.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE=33297]="FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE",t[t.FRAMEBUFFER_ATTACHMENT_RED_SIZE=33298]="FRAMEBUFFER_ATTACHMENT_RED_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE=33299]="FRAMEBUFFER_ATTACHMENT_GREEN_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE=33300]="FRAMEBUFFER_ATTACHMENT_BLUE_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE=33301]="FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE=33302]="FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE=33303]="FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE",t[t.FRAMEBUFFER_DEFAULT=33304]="FRAMEBUFFER_DEFAULT",t[t.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8",t[t.DRAW_FRAMEBUFFER_BINDING=36006]="DRAW_FRAMEBUFFER_BINDING",t[t.READ_FRAMEBUFFER_BINDING=36010]="READ_FRAMEBUFFER_BINDING",t[t.RENDERBUFFER_SAMPLES=36011]="RENDERBUFFER_SAMPLES",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER=36052]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER",t[t.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE=36182]="FRAMEBUFFER_INCOMPLETE_MULTISAMPLE",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t[t.UNIFORM_BUFFER_BINDING=35368]="UNIFORM_BUFFER_BINDING",t[t.UNIFORM_BUFFER_START=35369]="UNIFORM_BUFFER_START",t[t.UNIFORM_BUFFER_SIZE=35370]="UNIFORM_BUFFER_SIZE",t[t.MAX_VERTEX_UNIFORM_BLOCKS=35371]="MAX_VERTEX_UNIFORM_BLOCKS",t[t.MAX_FRAGMENT_UNIFORM_BLOCKS=35373]="MAX_FRAGMENT_UNIFORM_BLOCKS",t[t.MAX_COMBINED_UNIFORM_BLOCKS=35374]="MAX_COMBINED_UNIFORM_BLOCKS",t[t.MAX_UNIFORM_BUFFER_BINDINGS=35375]="MAX_UNIFORM_BUFFER_BINDINGS",t[t.MAX_UNIFORM_BLOCK_SIZE=35376]="MAX_UNIFORM_BLOCK_SIZE",t[t.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS=35377]="MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS",t[t.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS=35379]="MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS",t[t.UNIFORM_BUFFER_OFFSET_ALIGNMENT=35380]="UNIFORM_BUFFER_OFFSET_ALIGNMENT",t[t.ACTIVE_UNIFORM_BLOCKS=35382]="ACTIVE_UNIFORM_BLOCKS",t[t.UNIFORM_TYPE=35383]="UNIFORM_TYPE",t[t.UNIFORM_SIZE=35384]="UNIFORM_SIZE",t[t.UNIFORM_BLOCK_INDEX=35386]="UNIFORM_BLOCK_INDEX",t[t.UNIFORM_OFFSET=35387]="UNIFORM_OFFSET",t[t.UNIFORM_ARRAY_STRIDE=35388]="UNIFORM_ARRAY_STRIDE",t[t.UNIFORM_MATRIX_STRIDE=35389]="UNIFORM_MATRIX_STRIDE",t[t.UNIFORM_IS_ROW_MAJOR=35390]="UNIFORM_IS_ROW_MAJOR",t[t.UNIFORM_BLOCK_BINDING=35391]="UNIFORM_BLOCK_BINDING",t[t.UNIFORM_BLOCK_DATA_SIZE=35392]="UNIFORM_BLOCK_DATA_SIZE",t[t.UNIFORM_BLOCK_ACTIVE_UNIFORMS=35394]="UNIFORM_BLOCK_ACTIVE_UNIFORMS",t[t.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES=35395]="UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES",t[t.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER=35396]="UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER",t[t.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER=35398]="UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER",t[t.OBJECT_TYPE=37138]="OBJECT_TYPE",t[t.SYNC_CONDITION=37139]="SYNC_CONDITION",t[t.SYNC_STATUS=37140]="SYNC_STATUS",t[t.SYNC_FLAGS=37141]="SYNC_FLAGS",t[t.SYNC_FENCE=37142]="SYNC_FENCE",t[t.SYNC_GPU_COMMANDS_COMPLETE=37143]="SYNC_GPU_COMMANDS_COMPLETE",t[t.UNSIGNALED=37144]="UNSIGNALED",t[t.SIGNALED=37145]="SIGNALED",t[t.ALREADY_SIGNALED=37146]="ALREADY_SIGNALED",t[t.TIMEOUT_EXPIRED=37147]="TIMEOUT_EXPIRED",t[t.CONDITION_SATISFIED=37148]="CONDITION_SATISFIED",t[t.WAIT_FAILED=37149]="WAIT_FAILED",t[t.SYNC_FLUSH_COMMANDS_BIT=1]="SYNC_FLUSH_COMMANDS_BIT",t[t.COLOR=6144]="COLOR",t[t.DEPTH=6145]="DEPTH",t[t.STENCIL=6146]="STENCIL",t[t.MIN=32775]="MIN",t[t.MAX=32776]="MAX",t[t.DEPTH_COMPONENT24=33190]="DEPTH_COMPONENT24",t[t.STREAM_READ=35041]="STREAM_READ",t[t.STREAM_COPY=35042]="STREAM_COPY",t[t.STATIC_READ=35045]="STATIC_READ",t[t.STATIC_COPY=35046]="STATIC_COPY",t[t.DYNAMIC_READ=35049]="DYNAMIC_READ",t[t.DYNAMIC_COPY=35050]="DYNAMIC_COPY",t[t.DEPTH_COMPONENT32F=36012]="DEPTH_COMPONENT32F",t[t.DEPTH32F_STENCIL8=36013]="DEPTH32F_STENCIL8",t[t.INVALID_INDEX=4294967295]="INVALID_INDEX",t[t.TIMEOUT_IGNORED=-1]="TIMEOUT_IGNORED",t[t.MAX_CLIENT_WAIT_TIMEOUT_WEBGL=37447]="MAX_CLIENT_WAIT_TIMEOUT_WEBGL",t[t.UNMASKED_VENDOR_WEBGL=37445]="UNMASKED_VENDOR_WEBGL",t[t.UNMASKED_RENDERER_WEBGL=37446]="UNMASKED_RENDERER_WEBGL",t[t.MAX_TEXTURE_MAX_ANISOTROPY_EXT=34047]="MAX_TEXTURE_MAX_ANISOTROPY_EXT",t[t.TEXTURE_MAX_ANISOTROPY_EXT=34046]="TEXTURE_MAX_ANISOTROPY_EXT",t[t.R16_EXT=33322]="R16_EXT",t[t.RG16_EXT=33324]="RG16_EXT",t[t.RGB16_EXT=32852]="RGB16_EXT",t[t.RGBA16_EXT=32859]="RGBA16_EXT",t[t.R16_SNORM_EXT=36760]="R16_SNORM_EXT",t[t.RG16_SNORM_EXT=36761]="RG16_SNORM_EXT",t[t.RGB16_SNORM_EXT=36762]="RGB16_SNORM_EXT",t[t.RGBA16_SNORM_EXT=36763]="RGBA16_SNORM_EXT",t[t.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",t[t.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",t[t.COMPRESSED_RED_RGTC1_EXT=36283]="COMPRESSED_RED_RGTC1_EXT",t[t.COMPRESSED_SIGNED_RED_RGTC1_EXT=36284]="COMPRESSED_SIGNED_RED_RGTC1_EXT",t[t.COMPRESSED_RED_GREEN_RGTC2_EXT=36285]="COMPRESSED_RED_GREEN_RGTC2_EXT",t[t.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT=36286]="COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT",t[t.COMPRESSED_RGBA_BPTC_UNORM_EXT=36492]="COMPRESSED_RGBA_BPTC_UNORM_EXT",t[t.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=36493]="COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT",t[t.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT=36494]="COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT",t[t.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT=36495]="COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT",t[t.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",t[t.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",t[t.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",t[t.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",t[t.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",t[t.COMPRESSED_RGBA8_ETC2_EAC=37493]="COMPRESSED_RGBA8_ETC2_EAC",t[t.COMPRESSED_SRGB8_ETC2=37494]="COMPRESSED_SRGB8_ETC2",t[t.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37495]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",t[t.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37496]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37497]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",t[t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",t[t.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",t[t.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",t[t.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35986]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",t[t.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",t[t.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR",t[t.COMPRESSED_RGBA_ASTC_5x4_KHR=37809]="COMPRESSED_RGBA_ASTC_5x4_KHR",t[t.COMPRESSED_RGBA_ASTC_5x5_KHR=37810]="COMPRESSED_RGBA_ASTC_5x5_KHR",t[t.COMPRESSED_RGBA_ASTC_6x5_KHR=37811]="COMPRESSED_RGBA_ASTC_6x5_KHR",t[t.COMPRESSED_RGBA_ASTC_6x6_KHR=37812]="COMPRESSED_RGBA_ASTC_6x6_KHR",t[t.COMPRESSED_RGBA_ASTC_8x5_KHR=37813]="COMPRESSED_RGBA_ASTC_8x5_KHR",t[t.COMPRESSED_RGBA_ASTC_8x6_KHR=37814]="COMPRESSED_RGBA_ASTC_8x6_KHR",t[t.COMPRESSED_RGBA_ASTC_8x8_KHR=37815]="COMPRESSED_RGBA_ASTC_8x8_KHR",t[t.COMPRESSED_RGBA_ASTC_10x5_KHR=37816]="COMPRESSED_RGBA_ASTC_10x5_KHR",t[t.COMPRESSED_RGBA_ASTC_10x6_KHR=37817]="COMPRESSED_RGBA_ASTC_10x6_KHR",t[t.COMPRESSED_RGBA_ASTC_10x8_KHR=37818]="COMPRESSED_RGBA_ASTC_10x8_KHR",t[t.COMPRESSED_RGBA_ASTC_10x10_KHR=37819]="COMPRESSED_RGBA_ASTC_10x10_KHR",t[t.COMPRESSED_RGBA_ASTC_12x10_KHR=37820]="COMPRESSED_RGBA_ASTC_12x10_KHR",t[t.COMPRESSED_RGBA_ASTC_12x12_KHR=37821]="COMPRESSED_RGBA_ASTC_12x12_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR=37840]="COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR=37841]="COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR=37842]="COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR=37843]="COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR=37844]="COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR=37845]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR=37846]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR=37847]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR=37848]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR=37849]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR=37850]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR=37851]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR=37852]="COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR",t[t.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR=37853]="COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR",t[t.QUERY_COUNTER_BITS_EXT=34916]="QUERY_COUNTER_BITS_EXT",t[t.CURRENT_QUERY_EXT=34917]="CURRENT_QUERY_EXT",t[t.QUERY_RESULT_EXT=34918]="QUERY_RESULT_EXT",t[t.QUERY_RESULT_AVAILABLE_EXT=34919]="QUERY_RESULT_AVAILABLE_EXT",t[t.TIME_ELAPSED_EXT=35007]="TIME_ELAPSED_EXT",t[t.TIMESTAMP_EXT=36392]="TIMESTAMP_EXT",t[t.GPU_DISJOINT_EXT=36795]="GPU_DISJOINT_EXT",t[t.COMPLETION_STATUS_KHR=37297]="COMPLETION_STATUS_KHR",t[t.DEPTH_CLAMP_EXT=34383]="DEPTH_CLAMP_EXT",t[t.FIRST_VERTEX_CONVENTION_WEBGL=36429]="FIRST_VERTEX_CONVENTION_WEBGL",t[t.LAST_VERTEX_CONVENTION_WEBGL=36430]="LAST_VERTEX_CONVENTION_WEBGL",t[t.PROVOKING_VERTEX_WEBL=36431]="PROVOKING_VERTEX_WEBL",t[t.POLYGON_MODE_WEBGL=2880]="POLYGON_MODE_WEBGL",t[t.POLYGON_OFFSET_LINE_WEBGL=10754]="POLYGON_OFFSET_LINE_WEBGL",t[t.LINE_WEBGL=6913]="LINE_WEBGL",t[t.FILL_WEBGL=6914]="FILL_WEBGL",t[t.MAX_CLIP_DISTANCES_WEBGL=3378]="MAX_CLIP_DISTANCES_WEBGL",t[t.MAX_CULL_DISTANCES_WEBGL=33529]="MAX_CULL_DISTANCES_WEBGL",t[t.MAX_COMBINED_CLIP_AND_CULL_DISTANCES_WEBGL=33530]="MAX_COMBINED_CLIP_AND_CULL_DISTANCES_WEBGL",t[t.CLIP_DISTANCE0_WEBGL=12288]="CLIP_DISTANCE0_WEBGL",t[t.CLIP_DISTANCE1_WEBGL=12289]="CLIP_DISTANCE1_WEBGL",t[t.CLIP_DISTANCE2_WEBGL=12290]="CLIP_DISTANCE2_WEBGL",t[t.CLIP_DISTANCE3_WEBGL=12291]="CLIP_DISTANCE3_WEBGL",t[t.CLIP_DISTANCE4_WEBGL=12292]="CLIP_DISTANCE4_WEBGL",t[t.CLIP_DISTANCE5_WEBGL=12293]="CLIP_DISTANCE5_WEBGL",t[t.CLIP_DISTANCE6_WEBGL=12294]="CLIP_DISTANCE6_WEBGL",t[t.CLIP_DISTANCE7_WEBGL=12295]="CLIP_DISTANCE7_WEBGL",t[t.POLYGON_OFFSET_CLAMP_EXT=36379]="POLYGON_OFFSET_CLAMP_EXT",t[t.LOWER_LEFT_EXT=36001]="LOWER_LEFT_EXT",t[t.UPPER_LEFT_EXT=36002]="UPPER_LEFT_EXT",t[t.NEGATIVE_ONE_TO_ONE_EXT=37726]="NEGATIVE_ONE_TO_ONE_EXT",t[t.ZERO_TO_ONE_EXT=37727]="ZERO_TO_ONE_EXT",t[t.CLIP_ORIGIN_EXT=37724]="CLIP_ORIGIN_EXT",t[t.CLIP_DEPTH_MODE_EXT=37725]="CLIP_DEPTH_MODE_EXT",t[t.SRC1_COLOR_WEBGL=35065]="SRC1_COLOR_WEBGL",t[t.SRC1_ALPHA_WEBGL=34185]="SRC1_ALPHA_WEBGL",t[t.ONE_MINUS_SRC1_COLOR_WEBGL=35066]="ONE_MINUS_SRC1_COLOR_WEBGL",t[t.ONE_MINUS_SRC1_ALPHA_WEBGL=35067]="ONE_MINUS_SRC1_ALPHA_WEBGL",t[t.MAX_DUAL_SOURCE_DRAW_BUFFERS_WEBGL=35068]="MAX_DUAL_SOURCE_DRAW_BUFFERS_WEBGL",t[t.MIRROR_CLAMP_TO_EDGE_EXT=34627]="MIRROR_CLAMP_TO_EDGE_EXT"})(Yl||(Yl={}));const _b={3042:!1,32773:new Float32Array([0,0,0,0]),32777:32774,34877:32774,32969:1,32968:0,32971:1,32970:0,3106:new Float32Array([0,0,0,0]),3107:[!0,!0,!0,!0],2884:!1,2885:1029,2929:!1,2931:1,2932:513,2928:new Float32Array([0,1]),2930:!0,3024:!0,35725:null,36006:null,36007:null,34229:null,34964:null,2886:2305,33170:4352,2849:1,32823:!1,32824:0,10752:0,32926:!1,32928:!1,32938:1,32939:!1,3089:!1,3088:new Int32Array([0,0,1024,1024]),2960:!1,2961:0,2968:4294967295,36005:4294967295,2962:519,2967:0,2963:4294967295,34816:519,36003:0,36004:4294967295,2964:7680,2965:7680,2966:7680,34817:7680,34818:7680,34819:7680,2978:[0,0,1024,1024],36389:null,36662:null,36663:null,35053:null,35055:null,35723:4352,36010:null,35977:!1,3333:4,3317:4,37440:!1,37441:!1,37443:37444,3330:0,3332:0,3331:0,3314:0,32878:0,3316:0,3315:0,32877:0},sr=(t,e,n)=>e?t.enable(n):t.disable(n),j2=(t,e,n)=>t.hint(n,e),ai=(t,e,n)=>t.pixelStorei(n,e),W2=(t,e,n)=>{const r=n===36006?36009:36008;return t.bindFramebuffer(r,e)},Hu=(t,e,n)=>{const i={34964:34962,36662:36662,36663:36663,35053:35051,35055:35052}[n];t.bindBuffer(i,e)};function u0(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}const Bq={3042:sr,32773:(t,e)=>t.blendColor(...e),32777:"blendEquation",34877:"blendEquation",32969:"blendFunc",32968:"blendFunc",32971:"blendFunc",32970:"blendFunc",3106:(t,e)=>t.clearColor(...e),3107:(t,e)=>t.colorMask(...e),2884:sr,2885:(t,e)=>t.cullFace(e),2929:sr,2931:(t,e)=>t.clearDepth(e),2932:(t,e)=>t.depthFunc(e),2928:(t,e)=>t.depthRange(...e),2930:(t,e)=>t.depthMask(e),3024:sr,35723:j2,35725:(t,e)=>t.useProgram(e),36007:(t,e)=>t.bindRenderbuffer(36161,e),36389:(t,e)=>{var n;return(n=t.bindTransformFeedback)==null?void 0:n.call(t,36386,e)},34229:(t,e)=>t.bindVertexArray(e),36006:W2,36010:W2,34964:Hu,36662:Hu,36663:Hu,35053:Hu,35055:Hu,2886:(t,e)=>t.frontFace(e),33170:j2,2849:(t,e)=>t.lineWidth(e),32823:sr,32824:"polygonOffset",10752:"polygonOffset",35977:sr,32926:sr,32928:sr,32938:"sampleCoverage",32939:"sampleCoverage",3089:sr,3088:(t,e)=>t.scissor(...e),2960:sr,2961:(t,e)=>t.clearStencil(e),2968:(t,e)=>t.stencilMaskSeparate(1028,e),36005:(t,e)=>t.stencilMaskSeparate(1029,e),2962:"stencilFuncFront",2967:"stencilFuncFront",2963:"stencilFuncFront",34816:"stencilFuncBack",36003:"stencilFuncBack",36004:"stencilFuncBack",2964:"stencilOpFront",2965:"stencilOpFront",2966:"stencilOpFront",34817:"stencilOpBack",34818:"stencilOpBack",34819:"stencilOpBack",2978:(t,e)=>t.viewport(...e),34383:sr,10754:sr,12288:sr,12289:sr,12290:sr,12291:sr,12292:sr,12293:sr,12294:sr,12295:sr,3333:ai,3317:ai,37440:ai,37441:ai,37443:ai,3330:ai,3332:ai,3331:ai,3314:ai,32878:ai,3316:ai,3315:ai,32877:ai,framebuffer:(t,e)=>{const n=e&&"handle"in e?e.handle:e;return t.bindFramebuffer(36160,n)},blend:(t,e)=>e?t.enable(3042):t.disable(3042),blendColor:(t,e)=>t.blendColor(...e),blendEquation:(t,e)=>{const n=typeof e=="number"?[e,e]:e;t.blendEquationSeparate(...n)},blendFunc:(t,e)=>{const n=(e==null?void 0:e.length)===2?[...e,...e]:e;t.blendFuncSeparate(...n)},clearColor:(t,e)=>t.clearColor(...e),clearDepth:(t,e)=>t.clearDepth(e),clearStencil:(t,e)=>t.clearStencil(e),colorMask:(t,e)=>t.colorMask(...e),cull:(t,e)=>e?t.enable(2884):t.disable(2884),cullFace:(t,e)=>t.cullFace(e),depthTest:(t,e)=>e?t.enable(2929):t.disable(2929),depthFunc:(t,e)=>t.depthFunc(e),depthMask:(t,e)=>t.depthMask(e),depthRange:(t,e)=>t.depthRange(...e),dither:(t,e)=>e?t.enable(3024):t.disable(3024),derivativeHint:(t,e)=>{t.hint(35723,e)},frontFace:(t,e)=>t.frontFace(e),mipmapHint:(t,e)=>t.hint(33170,e),lineWidth:(t,e)=>t.lineWidth(e),polygonOffsetFill:(t,e)=>e?t.enable(32823):t.disable(32823),polygonOffset:(t,e)=>t.polygonOffset(...e),sampleCoverage:(t,e)=>t.sampleCoverage(e[0],e[1]||!1),scissorTest:(t,e)=>e?t.enable(3089):t.disable(3089),scissor:(t,e)=>t.scissor(...e),stencilTest:(t,e)=>e?t.enable(2960):t.disable(2960),stencilMask:(t,e)=>{e=u0(e)?e:[e,e];const[n,r]=e;t.stencilMaskSeparate(1028,n),t.stencilMaskSeparate(1029,r)},stencilFunc:(t,e)=>{e=u0(e)&&e.length===3?[...e,...e]:e;const[n,r,i,a,l,u]=e;t.stencilFuncSeparate(1028,n,r,i),t.stencilFuncSeparate(1029,a,l,u)},stencilOp:(t,e)=>{e=u0(e)&&e.length===3?[...e,...e]:e;const[n,r,i,a,l,u]=e;t.stencilOpSeparate(1028,n,r,i),t.stencilOpSeparate(1029,a,l,u)},viewport:(t,e)=>t.viewport(...e)};function qn(t,e,n){return e[t]!==void 0?e[t]:n[t]}const Uq={blendEquation:(t,e,n)=>t.blendEquationSeparate(qn(32777,e,n),qn(34877,e,n)),blendFunc:(t,e,n)=>t.blendFuncSeparate(qn(32969,e,n),qn(32968,e,n),qn(32971,e,n),qn(32970,e,n)),polygonOffset:(t,e,n)=>t.polygonOffset(qn(32824,e,n),qn(10752,e,n)),sampleCoverage:(t,e,n)=>t.sampleCoverage(qn(32938,e,n),qn(32939,e,n)),stencilFuncFront:(t,e,n)=>t.stencilFuncSeparate(1028,qn(2962,e,n),qn(2967,e,n),qn(2963,e,n)),stencilFuncBack:(t,e,n)=>t.stencilFuncSeparate(1029,qn(34816,e,n),qn(36003,e,n),qn(36004,e,n)),stencilOpFront:(t,e,n)=>t.stencilOpSeparate(1028,qn(2964,e,n),qn(2965,e,n),qn(2966,e,n)),stencilOpBack:(t,e,n)=>t.stencilOpSeparate(1029,qn(34817,e,n),qn(34818,e,n),qn(34819,e,n))},X2={enable:(t,e)=>t({[e]:!0}),disable:(t,e)=>t({[e]:!1}),pixelStorei:(t,e,n)=>t({[e]:n}),hint:(t,e,n)=>t({[e]:n}),useProgram:(t,e)=>t({35725:e}),bindRenderbuffer:(t,e,n)=>t({36007:n}),bindTransformFeedback:(t,e,n)=>t({36389:n}),bindVertexArray:(t,e)=>t({34229:e}),bindFramebuffer:(t,e,n)=>{switch(e){case 36160:return t({36006:n,36010:n});case 36009:return t({36006:n});case 36008:return t({36010:n});default:return null}},bindBuffer:(t,e,n)=>{const r={34962:[34964],36662:[36662],36663:[36663],35051:[35053],35052:[35055]}[e];return r?t({[r]:n}):{valueChanged:!0}},blendColor:(t,e,n,r,i)=>t({32773:new Float32Array([e,n,r,i])}),blendEquation:(t,e)=>t({32777:e,34877:e}),blendEquationSeparate:(t,e,n)=>t({32777:e,34877:n}),blendFunc:(t,e,n)=>t({32969:e,32968:n,32971:e,32970:n}),blendFuncSeparate:(t,e,n,r,i)=>t({32969:e,32968:n,32971:r,32970:i}),clearColor:(t,e,n,r,i)=>t({3106:new Float32Array([e,n,r,i])}),clearDepth:(t,e)=>t({2931:e}),clearStencil:(t,e)=>t({2961:e}),colorMask:(t,e,n,r,i)=>t({3107:[e,n,r,i]}),cullFace:(t,e)=>t({2885:e}),depthFunc:(t,e)=>t({2932:e}),depthRange:(t,e,n)=>t({2928:new Float32Array([e,n])}),depthMask:(t,e)=>t({2930:e}),frontFace:(t,e)=>t({2886:e}),lineWidth:(t,e)=>t({2849:e}),polygonOffset:(t,e,n)=>t({32824:e,10752:n}),sampleCoverage:(t,e,n)=>t({32938:e,32939:n}),scissor:(t,e,n,r,i)=>t({3088:new Int32Array([e,n,r,i])}),stencilMask:(t,e)=>t({2968:e,36005:e}),stencilMaskSeparate:(t,e,n)=>t({[e===1028?2968:36005]:n}),stencilFunc:(t,e,n,r)=>t({2962:e,2967:n,2963:r,34816:e,36003:n,36004:r}),stencilFuncSeparate:(t,e,n,r,i)=>t({[e===1028?2962:34816]:n,[e===1028?2967:36003]:r,[e===1028?2963:36004]:i}),stencilOp:(t,e,n,r)=>t({2964:e,2965:n,2966:r,34817:e,34818:n,34819:r}),stencilOpSeparate:(t,e,n,r,i)=>t({[e===1028?2964:34817]:n,[e===1028?2965:34818]:r,[e===1028?2966:34819]:i}),viewport:(t,e,n,r,i)=>t({2978:[e,n,r,i]})},cs=(t,e)=>t.isEnabled(e),q2={3042:cs,2884:cs,2929:cs,3024:cs,32823:cs,32926:cs,32928:cs,3089:cs,2960:cs,35977:cs},Lq=new Set([34016,36388,36387,35983,35368,34965,35739,35738,3074,34853,34854,34855,34856,34857,34858,34859,34860,34861,34862,34863,34864,34865,34866,34867,34868,35097,32873,35869,32874,34068]);function jc(t,e){if($q(e))return;const n={};for(const i in e){const a=Number(i),l=Bq[i];l&&(typeof l=="string"?n[l]=!0:l(t,e[i],a))}const r=t.state&&t.state.cache;if(r)for(const i in n){const a=Uq[i];a(t,e,r)}}function dO(t,e=_b){if(typeof e=="number"){const i=e,a=q2[i];return a?a(t,i):t.getParameter(i)}const n=Array.isArray(e)?e:Object.keys(e),r={};for(const i of n){const a=q2[i];r[i]=a?a(t,Number(i)):t.getParameter(Number(i))}return r}function zq(t){jc(t,_b)}function $q(t){for(const e in t)return!1;return!0}function Vq(t,e){if(t===e)return!0;const n=Array.isArray(t)||ArrayBuffer.isView(t),r=Array.isArray(e)||ArrayBuffer.isView(e);if(n&&r&&t.length===e.length){for(let i=0;i{}),this._updateCache=this._updateCache.bind(this),Object.seal(this)}static get(e){return e.state}push(e={}){this.stateStack.push({})}pop(){const e=this.stateStack[this.stateStack.length-1];jc(this.gl,e),this.stateStack.pop()}trackState(e,n){if(this.cache=n.copyState?dO(e):Object.assign({},_b),this.initialized)throw new Error("WebGLStateTracker");this.initialized=!0,this.gl.state=this,jq(e);for(const r in X2){const i=X2[r];Hq(e,r,i)}Y2(e,"getParameter"),Y2(e,"isEnabled")}_updateCache(e){let n=!1,r;const i=this.stateStack.length>0?this.stateStack[this.stateStack.length-1]:null;for(const a in e){const l=e[a],u=this.cache[a];Vq(l,u)||(n=!0,r=u,i&&!(a in i)&&(i[a]=u),this.cache[a]=l)}return{valueChanged:n,oldValue:r}}}function Y2(t,e){const n=t[e].bind(t);t[e]=function(i){if(i===void 0||Lq.has(i))return n(i);const a=ko.get(t);return i in a.cache||(a.cache[i]=n(i)),a.enable?a.cache[i]:n(i)},Object.defineProperty(t[e],"name",{value:`${e}-from-cache`,configurable:!1})}function Hq(t,e,n){if(!t[e])return;const r=t[e].bind(t);t[e]=function(...a){const l=ko.get(t),{valueChanged:u,oldValue:f}=n(l._updateCache,...a);return u&&r(...a),f},Object.defineProperty(t[e],"name",{value:`${e}-to-cache`,configurable:!1})}function jq(t){const e=t.useProgram.bind(t);t.useProgram=function(r){const i=ko.get(t);i.program!==r&&(e(r),i.program=r)}}function Wq(t,e,n){let r="";const i={preserveDrawingBuffer:!0,...n};let a=null;if(a||(a=t.getContext("webgl2",i)),i.failIfMajorPerformanceCaveat&&(r||(r="Only software GPU is available. Set `failIfMajorPerformanceCaveat: false` to allow.")),!a&&!n.failIfMajorPerformanceCaveat&&(i.failIfMajorPerformanceCaveat=!1,a=t.getContext("webgl2",i),a.luma||(a.luma={}),a.luma.softwareRenderer=!0),a||(a=t.getContext("webgl",{}),a&&(a=null,r||(r="Your browser only supports WebGL1"))),!a)throw r||(r="Your browser does not support WebGL"),new Error(`Failed to create WebGL context: ${r}`);const{onContextLost:l,onContextRestored:u}=e;return t.addEventListener("webglcontextlost",f=>l(f),!1),t.addEventListener("webglcontextrestored",f=>u(f),!1),a.luma||(a.luma={}),a}function Fc(t,e,n){return n[e]===void 0&&(n[e]=t.getExtension(e)||null),n[e]}function Xq(t,e){const n=t.getParameter(7936),r=t.getParameter(7937);Fc(t,"WEBGL_debug_renderer_info",e);const i=e.WEBGL_debug_renderer_info,a=t.getParameter(i?i.UNMASKED_VENDOR_WEBGL:7936),l=t.getParameter(i?i.UNMASKED_RENDERER_WEBGL:7937),u=a||n,f=l||r,h=t.getParameter(7938),g=hO(u,f),m=qq(u,f),v=Yq(u,f);return{type:"webgl",gpu:g,gpuType:v,gpuBackend:m,vendor:u,renderer:f,version:h,shadingLanguage:"glsl",shadingLanguageVersion:300}}function hO(t,e){return/NVIDIA/i.exec(t)||/NVIDIA/i.exec(e)?"nvidia":/INTEL/i.exec(t)||/INTEL/i.exec(e)?"intel":/Apple/i.exec(t)||/Apple/i.exec(e)?"apple":/AMD/i.exec(t)||/AMD/i.exec(e)||/ATI/i.exec(t)||/ATI/i.exec(e)?"amd":/SwiftShader/i.exec(t)||/SwiftShader/i.exec(e)?"software":"unknown"}function qq(t,e){return/Metal/i.exec(t)||/Metal/i.exec(e)?"metal":/ANGLE/i.exec(t)||/ANGLE/i.exec(e)?"opengl":"unknown"}function Yq(t,e){if(/SwiftShader/i.exec(t)||/SwiftShader/i.exec(e))return"cpu";switch(hO(t,e)){case"intel":return"integrated";case"software":return"cpu";case"unknown":return"unknown";default:return"discrete"}}function gO(t){switch(t){case"uint8":return 5121;case"sint8":return 5120;case"unorm8":return 5121;case"snorm8":return 5120;case"uint16":return 5123;case"sint16":return 5122;case"unorm16":return 5123;case"snorm16":return 5122;case"uint32":return 5125;case"sint32":return 5124;case"float16":return 5131;case"float32":return 5126}throw new Error(String(t))}const Ku="WEBGL_compressed_texture_s3tc",Zu="WEBGL_compressed_texture_s3tc_srgb",Kl="EXT_texture_compression_rgtc",Zl="EXT_texture_compression_bptc",Kq="WEBGL_compressed_texture_etc",Zq="WEBGL_compressed_texture_astc",Qq="WEBGL_compressed_texture_etc1",Gq="WEBGL_compressed_texture_pvrtc",Jq="WEBGL_compressed_texture_atc",K2="EXT_texture_norm16",Z2="EXT_render_snorm",eY="EXT_color_buffer_float",yb={"float32-renderable-webgl":["EXT_color_buffer_float"],"float16-renderable-webgl":["EXT_color_buffer_half_float"],"rgb9e5ufloat-renderable-webgl":["WEBGL_render_shared_exponent"],"snorm8-renderable-webgl":[Z2],"norm16-renderable-webgl":[K2],"snorm16-renderable-webgl":[K2,Z2],"float32-filterable":["OES_texture_float_linear"],"float16-filterable-webgl":["OES_texture_half_float_linear"],"texture-filterable-anisotropic-webgl":["EXT_texture_filter_anisotropic"],"texture-blend-float-webgl":["EXT_float_blend"],"texture-compression-bc":[Ku,Zu,Kl,Zl],"texture-compression-bc5-webgl":[Kl],"texture-compression-bc7-webgl":[Zl],"texture-compression-etc2":[Kq],"texture-compression-astc":[Zq],"texture-compression-etc1-webgl":[Qq],"texture-compression-pvrtc-webgl":[Gq],"texture-compression-atc-webgl":[Jq]};function tY(t){return t in yb}function nY(t,e,n){return(yb[e]||[]).every(i=>Fc(t,i,n))}const bb={r8unorm:{gl:33321,rb:!0},r8snorm:{gl:36756},r8uint:{gl:33330,rb:!0},r8sint:{gl:33329,rb:!0},rg8unorm:{gl:33323,rb:!0},rg8snorm:{gl:36757},rg8uint:{gl:33336,rb:!0},rg8sint:{gl:33335,rb:!0},r16uint:{gl:33332,rb:!0},r16sint:{gl:33331,rb:!0},r16float:{gl:33325,rb:!0},"r16unorm-webgl":{gl:33322,rb:!0},"r16snorm-webgl":{gl:36760},"rgba4unorm-webgl":{gl:32854,rb:!0},"rgb565unorm-webgl":{gl:36194,rb:!0},"rgb5a1unorm-webgl":{gl:32855,rb:!0},"rgb8unorm-webgl":{gl:32849},"rgb8snorm-webgl":{gl:36758},rgba8unorm:{gl:32856},"rgba8unorm-srgb":{gl:35907},rgba8snorm:{gl:36759},rgba8uint:{gl:36220},rgba8sint:{gl:36238},bgra8unorm:{},"bgra8unorm-srgb":{},rg16uint:{gl:33338},rg16sint:{gl:33337},rg16float:{gl:33327,rb:!0},"rg16unorm-webgl":{gl:33324},"rg16snorm-webgl":{gl:36761},r32uint:{gl:33334,rb:!0},r32sint:{gl:33333,rb:!0},r32float:{gl:33326},rgb9e5ufloat:{gl:35901},rg11b10ufloat:{gl:35898,rb:!0},rgb10a2unorm:{gl:32857,rb:!0},"rgb10a2uint-webgl":{gl:36975,rb:!0},"rgb16unorm-webgl":{gl:32852},"rgb16snorm-webgl":{gl:36762},rg32uint:{gl:33340,rb:!0},rg32sint:{gl:33339,rb:!0},rg32float:{gl:33328,rb:!0},rgba16uint:{gl:36214,rb:!0},rgba16sint:{gl:36232,rb:!0},rgba16float:{gl:34842},"rgba16unorm-webgl":{gl:32859,rb:!0},"rgba16snorm-webgl":{gl:36763},"rgb32float-webgl":{gl:34837,x:eY,dataFormat:6407,types:[5126]},rgba32uint:{gl:36208,rb:!0},rgba32sint:{gl:36226,rb:!0},rgba32float:{gl:34836,rb:!0},stencil8:{gl:36168,rb:!0},depth16unorm:{gl:33189,dataFormat:6402,types:[5123],rb:!0},depth24plus:{gl:33190,dataFormat:6402,types:[5125]},depth32float:{gl:36012,dataFormat:6402,types:[5126],rb:!0},"depth24plus-stencil8":{gl:35056,rb:!0,depthTexture:!0,dataFormat:34041,types:[34042]},"depth32float-stencil8":{gl:36013,dataFormat:34041,types:[36269],rb:!0},"bc1-rgb-unorm-webgl":{gl:33776,x:Ku},"bc1-rgb-unorm-srgb-webgl":{gl:35916,x:Zu},"bc1-rgba-unorm":{gl:33777,x:Ku},"bc1-rgba-unorm-srgb":{gl:35916,x:Zu},"bc2-rgba-unorm":{gl:33778,x:Ku},"bc2-rgba-unorm-srgb":{gl:35918,x:Zu},"bc3-rgba-unorm":{gl:33779,x:Ku},"bc3-rgba-unorm-srgb":{gl:35919,x:Zu},"bc4-r-unorm":{gl:36283,x:Kl},"bc4-r-snorm":{gl:36284,x:Kl},"bc5-rg-unorm":{gl:36285,x:Kl},"bc5-rg-snorm":{gl:36286,x:Kl},"bc6h-rgb-ufloat":{gl:36495,x:Zl},"bc6h-rgb-float":{gl:36494,x:Zl},"bc7-rgba-unorm":{gl:36492,x:Zl},"bc7-rgba-unorm-srgb":{gl:36493,x:Zl},"etc2-rgb8unorm":{gl:37492},"etc2-rgb8unorm-srgb":{gl:37494},"etc2-rgb8a1unorm":{gl:37496},"etc2-rgb8a1unorm-srgb":{gl:37497},"etc2-rgba8unorm":{gl:37493},"etc2-rgba8unorm-srgb":{gl:37495},"eac-r11unorm":{gl:37488},"eac-r11snorm":{gl:37489},"eac-rg11unorm":{gl:37490},"eac-rg11snorm":{gl:37491},"astc-4x4-unorm":{gl:37808},"astc-4x4-unorm-srgb":{gl:37840},"astc-5x4-unorm":{gl:37809},"astc-5x4-unorm-srgb":{gl:37841},"astc-5x5-unorm":{gl:37810},"astc-5x5-unorm-srgb":{gl:37842},"astc-6x5-unorm":{gl:37811},"astc-6x5-unorm-srgb":{gl:37843},"astc-6x6-unorm":{gl:37812},"astc-6x6-unorm-srgb":{gl:37844},"astc-8x5-unorm":{gl:37813},"astc-8x5-unorm-srgb":{gl:37845},"astc-8x6-unorm":{gl:37814},"astc-8x6-unorm-srgb":{gl:37846},"astc-8x8-unorm":{gl:37815},"astc-8x8-unorm-srgb":{gl:37847},"astc-10x5-unorm":{gl:37819},"astc-10x5-unorm-srgb":{gl:37851},"astc-10x6-unorm":{gl:37817},"astc-10x6-unorm-srgb":{gl:37849},"astc-10x8-unorm":{gl:37818},"astc-10x8-unorm-srgb":{gl:37850},"astc-10x10-unorm":{gl:37819},"astc-10x10-unorm-srgb":{gl:37851},"astc-12x10-unorm":{gl:37820},"astc-12x10-unorm-srgb":{gl:37852},"astc-12x12-unorm":{gl:37821},"astc-12x12-unorm-srgb":{gl:37853},"pvrtc-rgb4unorm-webgl":{gl:35840},"pvrtc-rgba4unorm-webgl":{gl:35842},"pvrtc-rbg2unorm-webgl":{gl:35841},"pvrtc-rgba2unorm-webgl":{gl:35843},"etc1-rbg-unorm-webgl":{gl:36196},"atc-rgb-unorm-webgl":{gl:35986},"atc-rgba-unorm-webgl":{gl:35986},"atc-rgbai-unorm-webgl":{gl:34798}};function rY(t,e,n){let r=e.create;const i=bb[e.format];return(i==null?void 0:i.gl)===void 0&&(r=!1),i!=null&&i.x&&(r=r&&!!Fc(t,i.x,n)),{format:e.format,create:r&&e.create,render:r&&e.render,filter:r&&e.filter,blend:r&&e.blend,store:r&&e.store}}function pO(t){var i;const e=bb[t],n=aY(t),r=fb(t);return{internalFormat:n,format:(e==null?void 0:e.dataFormat)||sY(r.channels,r.integer,r.normalized,n),type:r.dataType?gO(r.dataType):((i=e==null?void 0:e.types)==null?void 0:i[0])||5121,compressed:r.compressed||!1}}function iY(t){switch(fb(t).attachment){case"depth":return 36096;case"stencil":return 36128;case"depth-stencil":return 33306;default:throw new Error(`Not a depth stencil format: ${t}`)}}function sY(t,e,n,r){if(r===6408||r===6407)return r;switch(t){case"r":return e&&!n?36244:6403;case"rg":return e&&!n?33320:33319;case"rgb":return e&&!n?36248:6407;case"rgba":return e&&!n?36249:6408;case"bgra":throw new Error("bgra pixels not supported by WebGL");default:return 6408}}function aY(t){const e=bb[t],n=e==null?void 0:e.gl;if(n===void 0)throw new Error(`Unsupported texture format ${t}`);return n}const Q2={"depth-clip-control":"EXT_depth_clamp","timer-query-webgl":"EXT_disjoint_timer_query_webgl2","compilation-status-async-webgl":"KHR_parallel_shader_compile","polygon-mode-webgl":"WEBGL_polygon_mode","provoking-vertex-webgl":"WEBGL_provoking_vertex","shader-clip-cull-distance-webgl":"WEBGL_clip_cull_distance","shader-noperspective-interpolation-webgl":"NV_shader_noperspective_interpolation","shader-conservative-depth-webgl":"EXT_conservative_depth"};class oY extends B${constructor(n,r,i){super([],i);M(this,"gl");M(this,"extensions");M(this,"testedFeatures",new Set);this.gl=n,this.extensions=r,Fc(n,"EXT_color_buffer_float",r)}*[Symbol.iterator](){const n=this.getFeatures();for(const r of n)this.has(r)&&(yield r);return[]}has(n){var r;return(r=this.disabledFeatures)!=null&&r[n]?!1:(this.testedFeatures.has(n)||(this.testedFeatures.add(n),tY(n)&&nY(this.gl,n,this.extensions)&&this.features.add(n),this.getWebGLFeature(n)&&this.features.add(n)),this.features.has(n))}initializeFeatures(){const n=this.getFeatures().filter(r=>r!=="polygon-mode-webgl");for(const r of n)this.has(r)}getFeatures(){return[...Object.keys(Q2),...Object.keys(yb)]}getWebGLFeature(n){const r=Q2[n];return typeof r=="string"?!!Fc(this.gl,r,this.extensions):!!r}}class lY extends k${constructor(n){super();M(this,"gl");M(this,"limits",{});this.gl=n}get maxTextureDimension1D(){return 0}get maxTextureDimension2D(){return this.getParameter(3379)}get maxTextureDimension3D(){return this.getParameter(32883)}get maxTextureArrayLayers(){return this.getParameter(35071)}get maxBindGroups(){return 0}get maxDynamicUniformBuffersPerPipelineLayout(){return 0}get maxDynamicStorageBuffersPerPipelineLayout(){return 0}get maxSampledTexturesPerShaderStage(){return this.getParameter(35660)}get maxSamplersPerShaderStage(){return this.getParameter(35661)}get maxStorageBuffersPerShaderStage(){return 0}get maxStorageTexturesPerShaderStage(){return 0}get maxUniformBuffersPerShaderStage(){return this.getParameter(35375)}get maxUniformBufferBindingSize(){return this.getParameter(35376)}get maxStorageBufferBindingSize(){return 0}get minUniformBufferOffsetAlignment(){return this.getParameter(35380)}get minStorageBufferOffsetAlignment(){return 0}get maxVertexBuffers(){return 16}get maxVertexAttributes(){return this.getParameter(34921)}get maxVertexBufferArrayStride(){return 2048}get maxInterStageShaderComponents(){return this.getParameter(35659)}get maxComputeWorkgroupStorageSize(){return 0}get maxComputeInvocationsPerWorkgroup(){return 0}get maxComputeWorkgroupSizeX(){return 0}get maxComputeWorkgroupSizeY(){return 0}get maxComputeWorkgroupSizeZ(){return 0}get maxComputeWorkgroupsPerDimension(){return 0}getParameter(n){return this.limits[n]===void 0&&(this.limits[n]=this.gl.getParameter(n)),this.limits[n]||0}}class af extends gg{constructor(n,r){super(n,r);M(this,"device");M(this,"gl");M(this,"handle");M(this,"colorAttachments",[]);M(this,"depthStencilAttachment",null);const i=r.handle===null;this.device=n,this.gl=n.gl,this.handle=this.props.handle||i?this.props.handle:this.gl.createFramebuffer(),i||(n.setSpectorMetadata(this.handle,{id:this.props.id,props:this.props}),this.autoCreateAttachmentTextures(),this.updateAttachments())}destroy(){super.destroy(),!this.destroyed&&this.handle!==null&&this.gl.deleteFramebuffer(this.handle)}updateAttachments(){const n=this.gl.bindFramebuffer(36160,this.handle);for(let r=0;r{r.onload=i,r.onerror=l=>a(new Error(`Unable to load script '${t}': ${l}`)),n.appendChild(r)})}const dY=1;let bn=null,G2=!1;const Sb={debugSpectorJS:Re.get("debug-spectorjs"),debugSpectorJSUrl:"https://cdn.jsdelivr.net/npm/spectorjs@0.9.30/dist/spector.bundle.js",gl:void 0};async function hY(t){if(!globalThis.SPECTOR)try{await mO(t.debugSpectorJSUrl||Sb.debugSpectorJSUrl)}catch(e){Re.warn(String(e))}}function gY(t){var e;if(t={...Sb,...t},!t.debugSpectorJS)return null;if(!bn&&globalThis.SPECTOR&&!((e=globalThis.luma)!=null&&e.spector)){Re.probe(dY,"SPECTOR found and initialized. Start with `luma.spector.displayUI()`")();const{Spector:n}=globalThis.SPECTOR;bn=new n,globalThis.luma&&(globalThis.luma.spector=bn)}if(!bn)return null;if(G2||(G2=!0,bn.spyCanvases(),bn==null||bn.onCaptureStarted.add(n=>Re.info("Spector capture started:",n)()),bn==null||bn.onCapture.add(n=>{Re.info("Spector capture complete:",n)(),bn==null||bn.getResultUI(),bn==null||bn.resultView.display(),bn==null||bn.resultView.addCapture(n)})),t.gl){const n=t.gl,r=n.device;bn==null||bn.startCapture(t.gl,500),n.device=r,new Promise(i=>setTimeout(i,2e3)).then(i=>{Re.info("Spector capture stopped after 2 seconds")(),bn==null||bn.stopCapture()})}return bn}const pY="https://unpkg.com/webgl-debug@2.0.1/index.js";function vO(t){return t.luma=t.luma||{},t.luma}async function mY(){Ho()&&!globalThis.WebGLDebugUtils&&(globalThis.global=globalThis.global||globalThis,globalThis.global.module={},await mO(pY))}function vY(t,e={}){return e.debugWebGL||e.traceWebGL?yY(t,e):_Y(t)}function _Y(t){const e=vO(t);return e.realContext?e.realContext:t}function yY(t,e){if(!globalThis.WebGLDebugUtils)return Re.warn("webgl-debug not loaded")(),t;const n=vO(t);if(n.debugContext)return n.debugContext;globalThis.WebGLDebugUtils.init({...Yl,...t});const r=globalThis.WebGLDebugUtils.makeDebugContext(t,bY.bind(null,e),SY.bind(null,e));for(const l in Yl)!(l in r)&&typeof Yl[l]=="number"&&(r[l]=Yl[l]);class i{}Object.setPrototypeOf(r,Object.getPrototypeOf(t)),Object.setPrototypeOf(i,r);const a=Object.create(i);return n.realContext=t,n.debugContext=a,a.debug=!0,a}function J2(t,e){e=Array.from(e).map(r=>r===void 0?"undefined":r);let n=globalThis.WebGLDebugUtils.glFunctionArgsToString(t,e);return n=`${n.slice(0,100)}${n.length>100?"...":""}`,`gl.${t}(${n})`}function bY(t,e,n,r){r=Array.from(r).map(u=>u===void 0?"undefined":u);const i=globalThis.WebGLDebugUtils.glEnumToString(e),a=globalThis.WebGLDebugUtils.glFunctionArgsToString(n,r),l=`${i} in gl.${n}(${a})`;Re.error(l)();debugger}function SY(t,e,n){let r="";Re.level>=1&&(r=J2(e,n),t.traceWebGL&&Re.log(1,r)());for(const i of n)if(i===void 0){r=r||J2(e,n);debugger}}const f0={};function EY(t="id"){f0[t]=f0[t]||1;const e=f0[t]++;return`${t}-${e}`}class of extends $n{constructor(n,r={}){super(n,r);M(this,"device");M(this,"gl");M(this,"handle");M(this,"glTarget");M(this,"glUsage");M(this,"glIndexType",5123);M(this,"byteLength");M(this,"bytesUsed");this.device=n,this.gl=this.device.gl;const i=typeof r=="object"?r.handle:void 0;this.handle=i||this.gl.createBuffer(),n.setSpectorMetadata(this.handle,{...this.props,data:typeof this.props.data}),this.glTarget=wY(this.props.usage),this.glUsage=TY(this.props.usage),this.glIndexType=this.props.indexType==="uint32"?5125:5123,r.data?this._initWithData(r.data,r.byteOffset,r.byteLength):this._initWithByteLength(r.byteLength||0)}_initWithData(n,r=0,i=n.byteLength+r){const a=this.glTarget;this.gl.bindBuffer(a,this.handle),this.gl.bufferData(a,i,this.glUsage),this.gl.bufferSubData(a,r,n),this.gl.bindBuffer(a,null),this.bytesUsed=i,this.byteLength=i,this._setDebugData(n,r,i),this.trackAllocatedMemory(i)}_initWithByteLength(n){let r=n;n===0&&(r=new Float32Array(0));const i=this.glTarget;return this.gl.bindBuffer(i,this.handle),this.gl.bufferData(i,r,this.glUsage),this.gl.bindBuffer(i,null),this.bytesUsed=n,this.byteLength=n,this._setDebugData(null,0,n),this.trackAllocatedMemory(n),this}destroy(){!this.destroyed&&this.handle&&(this.removeStats(),this.trackDeallocatedMemory(),this.gl.deleteBuffer(this.handle),this.destroyed=!0,this.handle=null)}write(n,r=0){this.gl.bindBuffer(36663,this.handle),this.gl.bufferSubData(36663,r,n),this.gl.bindBuffer(36663,null),this._setDebugData(n,r,n.byteLength)}async readAsync(n=0,r){return this.readSyncWebGL(n,r)}readSyncWebGL(n=0,r){r=r??this.byteLength-n;const i=new Uint8Array(r),a=0;return this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,n,i,a,r),this.gl.bindBuffer(36662,null),this._setDebugData(i,n,r),i}}function wY(t){return t&$n.INDEX?34963:t&$n.VERTEX?34962:t&$n.UNIFORM?35345:34962}function TY(t){return t&$n.INDEX||t&$n.VERTEX?35044:t&$n.UNIFORM?35048:35044}function CY(t){const e=t.split(/\r?\n/),n=[];for(const r of e){if(r.length<=1)continue;const i=r.split(":");if(i.length===2){const[m,v]=i;n.push({message:v.trim(),type:eA(m),lineNum:0,linePos:0});continue}const[a,l,u,...f]=i;let h=parseInt(u,10);isNaN(h)&&(h=0);let g=parseInt(l,10);isNaN(g)&&(g=0),n.push({message:f.join(":").trim(),type:eA(a),lineNum:h,linePos:g})}return n}function eA(t){const e=["warning","error","info"],n=t.toLowerCase();return e.includes(n)?n:"info"}class AY extends dg{constructor(n,r){super(n,r);M(this,"device");M(this,"handle");switch(this.device=n,this.props.stage){case"vertex":this.handle=this.props.handle||this.device.gl.createShader(35633);break;case"fragment":this.handle=this.props.handle||this.device.gl.createShader(35632);break;default:throw new Error(this.props.stage)}this._compile(this.source)}destroy(){this.handle&&(this.removeStats(),this.device.gl.deleteShader(this.handle),this.destroyed=!0)}get asyncCompilationStatus(){return this._waitForCompilationComplete().then(()=>this.compilationStatus)}async getCompilationInfo(){return await this._waitForCompilationComplete(),this.getCompilationInfoSync()}getCompilationInfoSync(){const n=this.device.gl.getShaderInfoLog(this.handle);return n?CY(n):[]}getTranslatedSource(){const r=this.device.getExtension("WEBGL_debug_shaders").WEBGL_debug_shaders;return(r==null?void 0:r.getTranslatedShaderSource(this.handle))||null}async _compile(n){n=n.startsWith("#version ")?n:`#version 300 es -${n}`;const{gl:r}=this.device;if(r.shaderSource(this.handle,n),r.compileShader(this.handle),!this.device.props.debug){this.compilationStatus="pending";return}if(!this.device.features.has("compilation-status-async-webgl")){if(this._getCompilationStatus(),this.debugShader(),this.compilationStatus==="error")throw new Error(`GLSL compilation errors in ${this.props.stage} shader ${this.props.id}`);return}Re.once(1,"Shader compilation is asynchronous")(),await this._waitForCompilationComplete(),Re.info(2,`Shader ${this.id} - async compilation complete: ${this.compilationStatus}`)(),this._getCompilationStatus(),this.debugShader()}async _waitForCompilationComplete(){const n=async a=>await new Promise(l=>setTimeout(l,a));if(!this.device.features.has("compilation-status-async-webgl")){await n(10);return}const{gl:i}=this.device;for(;;){if(i.getShaderParameter(this.handle,37297))return;await n(10)}}_getCompilationStatus(){this.compilationStatus=this.device.gl.getShaderParameter(this.handle,35713)?"success":"error"}}function RY(t,e,n,r){if(PY(e))return r(t);const i=t;i.pushState();try{return xY(t,e),jc(i.gl,n),r(t)}finally{i.popState()}}function xY(t,e){const n=t,{gl:r}=n;if(e.cullMode)switch(e.cullMode){case"none":r.disable(2884);break;case"front":r.enable(2884),r.cullFace(1028);break;case"back":r.enable(2884),r.cullFace(1029);break}if(e.frontFace&&r.frontFace(Bo("frontFace",e.frontFace,{ccw:2305,cw:2304})),e.unclippedDepth&&t.features.has("depth-clip-control")&&r.enable(34383),e.depthBias!==void 0&&(r.enable(32823),r.polygonOffset(e.depthBias,e.depthBiasSlopeScale||0)),e.provokingVertex&&t.features.has("provoking-vertex-webgl")){const a=n.getExtension("WEBGL_provoking_vertex").WEBGL_provoking_vertex,l=Bo("provokingVertex",e.provokingVertex,{first:36429,last:36430});a==null||a.provokingVertexWEBGL(l)}if((e.polygonMode||e.polygonOffsetLine)&&t.features.has("polygon-mode-webgl")){if(e.polygonMode){const a=n.getExtension("WEBGL_polygon_mode").WEBGL_polygon_mode,l=Bo("polygonMode",e.polygonMode,{fill:6914,line:6913});a==null||a.polygonModeWEBGL(1028,l),a==null||a.polygonModeWEBGL(1029,l)}e.polygonOffsetLine&&r.enable(10754)}if(t.features.has("shader-clip-cull-distance-webgl")&&(e.clipDistance0&&r.enable(12288),e.clipDistance1&&r.enable(12289),e.clipDistance2&&r.enable(12290),e.clipDistance3&&r.enable(12291),e.clipDistance4&&r.enable(12292),e.clipDistance5&&r.enable(12293),e.clipDistance6&&r.enable(12294),e.clipDistance7&&r.enable(12295)),e.depthWriteEnabled!==void 0&&r.depthMask(OY("depthWriteEnabled",e.depthWriteEnabled)),e.depthCompare&&(e.depthCompare!=="always"?r.enable(2929):r.disable(2929),r.depthFunc(uy("depthCompare",e.depthCompare))),e.stencilWriteMask){const i=e.stencilWriteMask;r.stencilMaskSeparate(1028,i),r.stencilMaskSeparate(1029,i)}if(e.stencilReadMask&&Re.warn("stencilReadMask not supported under WebGL"),e.stencilCompare){const i=e.stencilReadMask||4294967295,a=uy("depthCompare",e.stencilCompare);e.stencilCompare!=="always"?r.enable(2960):r.disable(2960),r.stencilFuncSeparate(1028,a,0,i),r.stencilFuncSeparate(1029,a,0,i)}if(e.stencilPassOperation&&e.stencilFailOperation&&e.stencilDepthFailOperation){const i=d0("stencilPassOperation",e.stencilPassOperation),a=d0("stencilFailOperation",e.stencilFailOperation),l=d0("stencilDepthFailOperation",e.stencilDepthFailOperation);r.stencilOpSeparate(1028,a,l,i),r.stencilOpSeparate(1029,a,l,i)}switch(e.blend){case!0:r.enable(3042);break;case!1:r.disable(3042);break}if(e.blendColorOperation||e.blendAlphaOperation){const i=tA("blendColorOperation",e.blendColorOperation||"add"),a=tA("blendAlphaOperation",e.blendAlphaOperation||"add");r.blendEquationSeparate(i,a);const l=Ch("blendColorSrcFactor",e.blendColorSrcFactor||"one"),u=Ch("blendColorDstFactor",e.blendColorDstFactor||"zero"),f=Ch("blendAlphaSrcFactor",e.blendAlphaSrcFactor||"one"),h=Ch("blendAlphaDstFactor",e.blendAlphaDstFactor||"zero");r.blendFuncSeparate(l,u,f,h)}}function uy(t,e){return Bo(t,e,{never:512,less:513,equal:514,"less-equal":515,greater:516,"not-equal":517,"greater-equal":518,always:519})}function d0(t,e){return Bo(t,e,{keep:7680,zero:0,replace:7681,invert:5386,"increment-clamp":7682,"decrement-clamp":7683,"increment-wrap":34055,"decrement-wrap":34056})}function tA(t,e){return Bo(t,e,{add:32774,subtract:32778,"reverse-subtract":32779,min:32775,max:32776})}function Ch(t,e){return Bo(t,e,{one:1,zero:0,"src-color":768,"one-minus-src-color":769,"dst-color":774,"one-minus-dst-color":775,"src-alpha":770,"one-minus-src-alpha":771,"dst-alpha":772,"one-minus-dst-alpha":773,"src-alpha-saturated":776,"constant-color":32769,"one-minus-constant-color":32770,"constant-alpha":32771,"one-minus-constant-alpha":32772})}function MY(t,e){return`Illegal parameter ${e} for ${t}`}function Bo(t,e,n){if(!(e in n))throw new Error(MY(t,e));return n[e]}function OY(t,e){return e}function PY(t){let e=!0;for(const n in t){e=!1;break}return e}function _O(t){const e={};return t.addressModeU&&(e[10242]=h0(t.addressModeU)),t.addressModeV&&(e[10243]=h0(t.addressModeV)),t.addressModeW&&(e[32882]=h0(t.addressModeW)),t.magFilter&&(e[10240]=fy(t.magFilter)),(t.minFilter||t.mipmapFilter)&&(e[10241]=NY(t.minFilter||"linear",t.mipmapFilter)),t.lodMinClamp!==void 0&&(e[33082]=t.lodMinClamp),t.lodMaxClamp!==void 0&&(e[33083]=t.lodMaxClamp),t.type==="comparison-sampler"&&(e[34892]=34894),t.compare&&(e[34893]=uy("compare",t.compare)),t.maxAnisotropy&&(e[34046]=t.maxAnisotropy),e}function h0(t){switch(t){case"clamp-to-edge":return 33071;case"repeat":return 10497;case"mirror-repeat":return 33648}}function fy(t){switch(t){case"nearest":return 9728;case"linear":return 9729}}function NY(t,e="none"){if(!e)return fy(t);switch(e){case"none":return fy(t);case"nearest":return t==="nearest"?9984:9986;case"linear":return t==="nearest"?9985:9987}}class dy extends hg{constructor(n,r){super(n,r);M(this,"device");M(this,"handle");M(this,"parameters");this.device=n,this.parameters=_O(r),this.handle=this.handle||this.device.gl.createSampler(),this._setSamplerParameters(this.parameters)}destroy(){this.handle&&(this.device.gl.deleteSampler(this.handle),this.handle=void 0)}toString(){return`Sampler(${this.id},${JSON.stringify(this.props)})`}_setSamplerParameters(n){for(const[r,i]of Object.entries(n)){const a=Number(r);switch(a){case 33082:case 33083:this.device.gl.samplerParameterf(this.handle,a,i);break;default:this.device.gl.samplerParameteri(this.handle,a,i);break}}}}class Ql extends fg{constructor(n,r){super(n,{...Kn.defaultProps,...r});M(this,"device");M(this,"gl");M(this,"handle");M(this,"texture");this.device=n,this.gl=this.device.gl,this.handle=null,this.texture=r.texture}}const IY="Failed to deduce GL constant from typed array";function DY(t){switch(ArrayBuffer.isView(t)?t.constructor:t){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:return 5121;case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error(IY)}}function FY(t,e){const{clamped:n=!0}=e||{};switch(t){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return n?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}function yO(t){switch(t){case 6406:case 33326:case 6403:case 36244:return 1;case 33339:case 33340:case 33328:case 33320:case 33319:return 2;case 6407:case 36248:case 34837:return 3;case 6408:case 36249:case 34836:return 4;default:return 0}}function kY(t){switch(t){case 5121:return 1;case 33635:case 32819:case 32820:return 2;case 5126:return 4;default:return 0}}function Ag(t,e,n){if(BY(e))return n(t);const{nocatch:r=!0}=e,i=ko.get(t);i.push(),jc(t,e);let a;if(r)a=n(t),i.pop();else try{a=n(t)}finally{i.pop()}return a}function BY(t){for(const e in t)return!1;return!0}function UY(t,e,n){const{dimension:r,width:i,height:a,depth:l=0}=n,{glInternalFormat:u}=n,f=n.glTarget;switch(r){case"2d-array":case"3d":t.texStorage3D(f,e,u,i,a,l);break;default:t.texStorage2D(f,e,u,i,a)}}function nA(t,e,n,r){const{width:i,height:a}=r,{dimension:l,depth:u=0,mipLevel:f=0}=r,{x:h=0,y:g=0,z:m=0}=r,{glFormat:v,glType:S}=r,w=bO(r.glTarget,l,u),E=r.flipY?{37440:!0}:{};Ag(t,E,()=>{switch(l){case"2d-array":case"3d":t.bindTexture(w,e),t.texSubImage3D(w,f,h,g,m,i,a,u,v,S,n),t.bindTexture(w,null);break;case"2d":case"cube":t.bindTexture(w,e),t.texSubImage2D(w,f,h,g,i,a,v,S,n),t.bindTexture(w,null);break;default:throw new Error(l)}})}function rA(t,e,n){const{dimension:r,width:i,height:a,depth:l=0,mipLevel:u=0,byteOffset:f=0}=n,{x:h=0,y:g=0,z:m=0}=n,{glFormat:v,glType:S,compressed:w}=n,E=bO(n.glTarget,r,l);switch(r){case"2d-array":case"3d":w?t.compressedTexSubImage3D(E,u,h,g,m,i,a,l,v,e,f):t.texSubImage3D(E,u,h,g,m,i,a,l,v,S,e,f);break;case"2d":case"cube":w?t.compressedTexSubImage2D(E,u,h,g,i,a,v,e,f):t.texSubImage2D(E,u,h,g,i,a,v,S,e,f);break;default:throw new Error(r)}}function LY(t){switch(t){case"1d":break;case"2d":return 3553;case"3d":return 32879;case"cube":return 34067;case"2d-array":return 35866}throw new Error(t)}function bO(t,e,n){return e==="cube"?34069+n:t}function zY(t,e){var C;const{sourceX:n=0,sourceY:r=0,sourceAttachment:i=0}=e||{};let{target:a=null,sourceWidth:l,sourceHeight:u,sourceDepth:f,sourceFormat:h,sourceType:g}=e||{};const{framebuffer:m,deleteFramebuffer:v}=SO(t),{gl:S,handle:w}=m;l||(l=m.width),u||(u=m.height);const E=(C=m.colorAttachments[i])==null?void 0:C.texture;if(!E)throw new Error(`Invalid framebuffer attachment ${i}`);f=(E==null?void 0:E.depth)||1,h||(h=(E==null?void 0:E.glFormat)||6408),g||(g=(E==null?void 0:E.glType)||5121),a=HY(a,g,h,l,u),g=g||DY(a);const b=S.bindFramebuffer(36160,w);return S.readBuffer(36064+i),S.readPixels(n,r,l,u,h,g,a),S.readBuffer(36064),S.bindFramebuffer(36160,b||null),v&&m.destroy(),a}function $Y(t,e){const{target:n,sourceX:r=0,sourceY:i=0,sourceFormat:a=6408,targetByteOffset:l=0}=e||{};let{sourceWidth:u,sourceHeight:f,sourceType:h}=e||{};const{framebuffer:g,deleteFramebuffer:m}=SO(t);u=u||g.width,f=f||g.height;const v=g;h=h||5121;let S=n;if(!S){const E=yO(a),b=kY(h),C=l+u*f*E*b;S=v.device.createBuffer({byteLength:C})}const w=t.device.createCommandEncoder();return w.copyTextureToBuffer({sourceTexture:t,width:u,height:f,origin:[r,i],destinationBuffer:S,byteOffset:l}),w.destroy(),m&&g.destroy(),S}function SO(t){return t instanceof gg?{framebuffer:t,deleteFramebuffer:!1}:{framebuffer:VY(t),deleteFramebuffer:!0}}function VY(t,e){const{device:n,width:r,height:i,id:a}=t;return n.createFramebuffer({...e,id:`framebuffer-for-${a}`,width:r,height:i,colorAttachments:[t]})}function HY(t,e,n,r,i,a){if(t)return t;e||(e=5121);const l=FY(e,{clamped:!1}),u=yO(n);return new l(r*i*u)}class lf extends Kn{constructor(n,r){super(n,r);M(this,"device");M(this,"gl");M(this,"handle");M(this,"sampler");M(this,"view");M(this,"mipmaps");M(this,"compressed");M(this,"glTarget");M(this,"glFormat");M(this,"glType");M(this,"glInternalFormat");M(this,"textureUnit",0);const i={...this.props};i.data=r.data,this.device=n,this.gl=this.device.gl,this.glTarget=LY(this.props.dimension);const a=pO(this.props.format);this.glInternalFormat=a.internalFormat,this.glFormat=a.format,this.glType=a.type,this.compressed=a.compressed,this.mipmaps=!!this.props.mipmaps,this._initialize(i),Object.seal(this)}_initialize(n){this.handle=this.props.handle||this.gl.createTexture(),this.device.setSpectorMetadata(this.handle,{...this.props,data:n.data});let{width:r,height:i}=n;if(!r||!i){const a=Kn.getTextureDataSize(n.data);r=(a==null?void 0:a.width)||1,i=(a==null?void 0:a.height)||1}if(this.width=r,this.height=i,this.depth=n.depth,this.setSampler(n.sampler),this.view=new Ql(this.device,{...this.props,texture:this}),this.bind(),UY(this.gl,this.mipLevels,this),n.data)switch(n.dimension){case"1d":this.setTexture1DData(n.data);break;case"2d":this.setTexture2DData(n.data);break;case"3d":this.setTexture3DData(n.data);break;case"cube":this.setTextureCubeData(n.data);break;case"2d-array":this.setTextureArrayData(n.data);break;case"cube-array":this.setTextureCubeArrayData(n.data);break;default:throw new Error(n.dimension)}this.mipmaps&&this.generateMipmap()}destroy(){this.handle&&(this.gl.deleteTexture(this.handle),this.removeStats(),this.trackDeallocatedMemory("Texture"),this.destroyed=!0)}createView(n){return new Ql(this.device,{...n,texture:this})}setSampler(n={}){let r;n instanceof dy?(this.sampler=n,r=n.props):(this.sampler=new dy(this.device,n),r=n);const i=_O(r);this._setSamplerParameters(i)}generateMipmap(n){if(!(!(this.device.isTextureFormatRenderable(this.props.format)&&this.device.isTextureFormatFilterable(this.props.format))&&(Re.warn(`${this} is not renderable or filterable, may not be able to generate mipmaps`)(),!(n!=null&&n.force))))try{this.gl.bindTexture(this.glTarget,this.handle),this.gl.generateMipmap(this.glTarget)}catch(i){Re.warn(`Error generating mipmap for ${this}: ${i.message}`)()}finally{this.gl.bindTexture(this.glTarget,null)}}copyExternalImage(n){const r=Kn.getExternalImageSize(n.image),i={...Kn.defaultCopyExternalImageOptions,...r,...n},{image:a,depth:l,mipLevel:u,x:f,y:h,z:g,flipY:m}=i;let{width:v,height:S}=i;const{dimension:w,glTarget:E,glFormat:b,glInternalFormat:C,glType:T}=this;if(v=Math.min(v,this.width-f),S=Math.min(S,this.height-h),n.sourceX||n.sourceY)throw new Error("WebGL does not support sourceX/sourceY)");return nA(this.device.gl,this.handle,a,{dimension:w,mipLevel:u,x:f,y:h,z:g,width:v,height:S,depth:l,glFormat:b,glType:T,glTarget:E,flipY:m}),{width:i.width,height:i.height}}setTexture1DData(n){throw new Error("setTexture1DData not supported in WebGL.")}setTexture2DData(n,r=0){this.bind();const i=Kn.normalizeTextureData(n,this);i.length>1&&this.props.mipmaps!==!1&&Re.warn(`Texture ${this.id} mipmap and multiple LODs.`)();for(let a=0;a1&&this.props.mipmaps!==!1&&Re.warn(`${this.id} has mipmap and multiple LODs.`)();const a=Kn.CubeFaces.indexOf(r);this.setTexture2DData(n,a)}update(){throw new Error("Texture.update() not implemented. Use ExternalTexture")}setImageDataForFace(n){const{face:r,width:i,height:a,pixels:l,data:u,format:f=6408,type:h=5121}=n,{gl:g}=this,m=l||u;this.bind(),m instanceof Promise?m.then(v=>this.setImageDataForFace(Object.assign({},n,{face:r,data:v,pixels:v}))):this.width||this.height?g.texImage2D(r,0,f,i,a,0,f,h,m):g.texImage2D(r,0,f,f,h,m)}_getImageDataMap(n){for(let r=0;r36064+f);this.device.gl.drawBuffers(l)}else this.device.gl.drawBuffers([1029]);this.clear()}end(){this.device.popState()}pushDebugGroup(n){}popDebugGroup(){}insertDebugMarker(n){}setParameters(n={}){const r={...this.glParameters};r.framebuffer=this.props.framebuffer||null,this.props.depthReadOnly&&(r.depthMask=!this.props.depthReadOnly),r.stencilMask=this.props.stencilReadOnly?0:1,r[35977]=this.props.discard,n.viewport&&(n.viewport.length>=6?(r.viewport=n.viewport.slice(0,4),r.depthRange=[n.viewport[4],n.viewport[5]]):r.viewport=n.viewport),n.scissorRect&&(r.scissorTest=!0,r.scissor=n.scissorRect),n.blendConstant&&(r.blendColor=n.blendConstant),n.stencilReference&&(console.warn("RenderPassParameters.stencilReference not yet implemented in WebGL"),n[2967]=n.stencilReference),n.colorMask&&(r.colorMask=jY.map(i=>!!(i&n.colorMask))),this.glParameters=r,jc(this.device.gl,r)}beginOcclusionQuery(n){const r=this.props.occlusionQuerySet;r==null||r.beginOcclusionQuery()}endOcclusionQuery(){const n=this.props.occlusionQuerySet;n==null||n.endOcclusionQuery()}clear(){const n={...this.glParameters};let r=0;this.props.clearColors&&this.props.clearColors.forEach((i,a)=>{i&&this.clearColorBuffer(a,i)}),this.props.clearColor!==!1&&this.props.clearColors===void 0&&(r|=16384,n.clearColor=this.props.clearColor),this.props.clearDepth!==!1&&(r|=256,n.clearDepth=this.props.clearDepth),this.props.clearStencil!==!1&&(r|=1024,n.clearStencil=this.props.clearStencil),r!==0&&Ag(this.device.gl,n,()=>{this.device.gl.clear(r)})}clearColorBuffer(n=0,r=[0,0,0,0]){Ag(this.device.gl,{framebuffer:this.props.framebuffer},()=>{switch(r.constructor){case Int8Array:case Int16Array:case Int32Array:this.device.gl.clearBufferiv(6144,n,r);break;case Uint8Array:case Uint8ClampedArray:case Uint16Array:case Uint32Array:this.device.gl.clearBufferuiv(6144,n,r);break;case Float32Array:this.device.gl.clearBufferfv(6144,n,r);break;default:throw new Error("clearColorBuffer: color must be typed array")}})}}function XY(t){return qY.includes(t)}const qY=[35678,35680,35679,35682,36289,36292,36293,36298,36299,36300,36303,36306,36307,36308,36311],EO={5126:[5126,1,"float","f32","float32"],35664:[5126,2,"vec2","vec2","float32x2"],35665:[5126,3,"vec3","vec3","float32x3"],35666:[5126,4,"vec4","vec4","float32x4"],5124:[5124,1,"int","i32","sint32"],35667:[5124,2,"ivec2","vec2","sint32x2"],35668:[5124,3,"ivec3","vec3","sint32x3"],35669:[5124,4,"ivec4","vec4","sint32x4"],5125:[5125,1,"uint","u32","uint32"],36294:[5125,2,"uvec2","vec2","uint32x2"],36295:[5125,3,"uvec3","vec3","uint32x3"],36296:[5125,4,"uvec4","vec4","uint32x4"],35670:[5126,1,"bool","f32","float32"],35671:[5126,2,"bvec2","vec2","float32x2"],35672:[5126,3,"bvec3","vec3","float32x3"],35673:[5126,4,"bvec4","vec4","float32x4"],35674:[5126,8,"mat2","mat2x2"],35685:[5126,8,"mat2x3","mat2x3"],35686:[5126,8,"mat2x4","mat2x4"],35687:[5126,12,"mat3x2","mat3x2"],35675:[5126,12,"mat3","mat3x3"],35688:[5126,12,"mat3x4","mat3x4"],35689:[5126,16,"mat4x2","mat4x2"],35690:[5126,16,"mat4x3","mat4x3"],35676:[5126,16,"mat4","mat4x4"]};function wO(t){const e=EO[t];if(!e)throw new Error("uniform");const[n,r,,i]=e;return{format:i,components:r,glType:n}}function YY(t){const e=EO[t];if(!e)throw new Error("attribute");const[,n,,r,i]=e;return{attributeType:r,vertexFormat:i,components:n}}function KY(t,e){const n={attributes:[],bindings:[]};n.attributes=ZY(t,e);const r=JY(t,e);for(const u of r){const f=u.uniforms.map(h=>({name:h.name,format:h.format,byteOffset:h.byteOffset,byteStride:h.byteStride,arrayLength:h.arrayLength}));n.bindings.push({type:"uniform",name:u.name,group:0,location:u.location,visibility:(u.vertex?1:0)&(u.fragment?2:0),minBindingSize:u.byteLength,uniforms:f})}const i=GY(t,e);let a=0;for(const u of i)if(XY(u.type)){const{viewDimension:f,sampleType:h}=tK(u.type);n.bindings.push({type:"texture",name:u.name,group:0,location:a,viewDimension:f,sampleType:h}),u.textureUnit=a,a+=1}i.length&&(n.uniforms=i);const l=QY(t,e);return l!=null&&l.length&&(n.varyings=l),n}function ZY(t,e){const n=[],r=t.getProgramParameter(e,35721);for(let i=0;i=0){const{attributeType:h}=YY(u),g=/instance/i.test(l)?"instance":"vertex";n.push({name:l,location:f,stepMode:g,type:h})}}return n.sort((i,a)=>i.location-a.location),n}function QY(t,e){const n=[],r=t.getProgramParameter(e,35971);for(let i=0;ii.location-a.location),n}function GY(t,e){const n=[],r=t.getProgramParameter(e,35718);for(let i=0;i1)for(let S=0;St.getActiveUniformBlockParameter(e,a,l),r=[],i=t.getProgramParameter(e,35382);for(let a=0;aa.location-l.location),r}const eK={35678:["2d","float"],35680:["cube","float"],35679:["3d","float"],35682:["3d","depth"],36289:["2d-array","float"],36292:["2d-array","depth"],36293:["cube","float"],36298:["2d","sint"],36299:["3d","sint"],36300:["cube","sint"],36303:["2d-array","uint"],36306:["2d","uint"],36307:["3d","uint"],36308:["cube","uint"],36311:["2d-array","uint"]};function tK(t){const e=eK[t];if(!e)throw new Error("sampler");const[n,r]=e;return{viewDimension:n,sampleType:r}}function nK(t){if(t[t.length-1]!=="]")return{name:t,length:1,isArray:!1};const n=/([^[]*)(\[[0-9]+\])?/.exec(t);if(!n||n.length<2)throw new Error(`Failed to parse GLSL uniform name ${t}`);return{name:n[1],length:n[2]?1:0,isArray:!!n[2]}}function rK(t,e,n,r){const i=t;let a=r;a===!0&&(a=1),a===!1&&(a=0);const l=typeof a=="number"?[a]:a;switch(n){case 35678:case 35680:case 35679:case 35682:case 36289:case 36292:case 36293:case 36298:case 36299:case 36300:case 36303:case 36306:case 36307:case 36308:case 36311:if(typeof r!="number")throw new Error("samplers must be set to integers");return t.uniform1i(e,r);case 5126:return t.uniform1fv(e,l);case 35664:return t.uniform2fv(e,l);case 35665:return t.uniform3fv(e,l);case 35666:return t.uniform4fv(e,l);case 5124:return t.uniform1iv(e,l);case 35667:return t.uniform2iv(e,l);case 35668:return t.uniform3iv(e,l);case 35669:return t.uniform4iv(e,l);case 35670:return t.uniform1iv(e,l);case 35671:return t.uniform2iv(e,l);case 35672:return t.uniform3iv(e,l);case 35673:return t.uniform4iv(e,l);case 5125:return i.uniform1uiv(e,l,1);case 36294:return i.uniform2uiv(e,l,2);case 36295:return i.uniform3uiv(e,l,3);case 36296:return i.uniform4uiv(e,l,4);case 35674:return t.uniformMatrix2fv(e,!1,l);case 35675:return t.uniformMatrix3fv(e,!1,l);case 35676:return t.uniformMatrix4fv(e,!1,l);case 35685:return i.uniformMatrix2x3fv(e,!1,l);case 35686:return i.uniformMatrix2x4fv(e,!1,l);case 35687:return i.uniformMatrix3x2fv(e,!1,l);case 35688:return i.uniformMatrix3x4fv(e,!1,l);case 35689:return i.uniformMatrix4x2fv(e,!1,l);case 35690:return i.uniformMatrix4x3fv(e,!1,l)}throw new Error("Illegal uniform")}function iK(t){return nO(t)!==null||typeof t=="number"||typeof t=="boolean"}function sK(t){const e={bindings:{},uniforms:{}};return Object.keys(t).forEach(n=>{const r=t[n];iK(r)?e.uniforms[n]=r:e.bindings[n]=r}),e}function aK(t){switch(t){case"point-list":return 0;case"line-list":return 1;case"line-strip":return 3;case"triangle-list":return 4;case"triangle-strip":return 5;default:throw new Error(t)}}function oK(t){switch(t){case"point-list":return 0;case"line-list":return 1;case"line-strip":return 1;case"triangle-list":return 4;case"triangle-strip":return 4;default:throw new Error(t)}}const iA=4;class lK extends Rc{constructor(n,r){super(n,r);M(this,"device");M(this,"handle");M(this,"vs");M(this,"fs");M(this,"introspectedLayout");M(this,"uniforms",{});M(this,"bindings",{});M(this,"varyings",null);M(this,"_uniformCount",0);M(this,"_uniformSetters",{});this.device=n,this.handle=this.props.handle||this.device.gl.createProgram(),this.device.setSpectorMetadata(this.handle,{id:this.props.id}),this.vs=r.vs,this.fs=r.fs;const{varyings:i,bufferMode:a=35981}=r;i&&i.length>0&&(this.varyings=i,this.device.gl.transformFeedbackVaryings(this.handle,i,a)),this._linkShaders(),Re.time(1,`RenderPipeline ${this.id} - shaderLayout introspection`)(),this.introspectedLayout=KY(this.device.gl,this.handle),Re.timeEnd(1,`RenderPipeline ${this.id} - shaderLayout introspection`)(),this.shaderLayout=cK(this.introspectedLayout,r.shaderLayout)}destroy(){this.handle&&(this.device.gl.deleteProgram(this.handle),this.destroyed=!0)}setBindings(n,r){for(const[i,a]of Object.entries(n)){const l=this.shaderLayout.bindings.find(u=>u.name===i)||this.shaderLayout.bindings.find(u=>u.name===`${i}Uniforms`);if(!l){const u=this.shaderLayout.bindings.map(f=>`"${f.name}"`).join(", ");r!=null&&r.disableWarnings||Re.warn(`No binding "${i}" in render pipeline "${this.id}", expected one of ${u}`,a)();continue}switch(a||Re.warn(`Unsetting binding "${i}" in render pipeline "${this.id}"`)(),l.type){case"uniform":if(!(a instanceof of)&&!(a.buffer instanceof of))throw new Error("buffer value");break;case"texture":if(!(a instanceof Ql||a instanceof lf||a instanceof af))throw new Error("texture value");break;case"sampler":Re.warn(`Ignoring sampler ${i}`)();break;default:throw new Error(l.type)}this.bindings[i]=a}}draw(n){var b;const{renderPass:r,parameters:i=this.props.parameters,topology:a=this.props.topology,vertexArray:l,vertexCount:u,instanceCount:f,isInstanced:h=!1,firstVertex:g=0,transformFeedback:m}=n,v=aK(a),S=!!l.indexBuffer,w=(b=l.indexBuffer)==null?void 0:b.glIndexType;if(this.linkStatus!=="success")return Re.info(2,`RenderPipeline:${this.id}.draw() aborted - waiting for shader linking`)(),!1;if(!this._areTexturesRenderable())return Re.info(2,`RenderPipeline:${this.id}.draw() aborted - textures not yet loaded`)(),!1;this.device.gl.useProgram(this.handle),l.bindBeforeRender(r),m&&m.begin(this.props.topology),this._applyBindings(),this._applyUniforms();const E=r;return RY(this.device,i,E.glParameters,()=>{S&&h?this.device.gl.drawElementsInstanced(v,u||0,w,g,f||0):S?this.device.gl.drawElements(v,u||0,w,g):h?this.device.gl.drawArraysInstanced(v,g,u||0,f||0):this.device.gl.drawArrays(v,g,u||0),m&&m.end()}),l.unbindAfterRender(r),!0}setUniformsWebGL(n){const{bindings:r}=sK(n);Object.keys(r).forEach(i=>{Re.warn(`Unsupported value "${JSON.stringify(r[i])}" used in setUniforms() for key ${i}. Use setBindings() instead?`)()}),Object.assign(this.uniforms,n)}async _linkShaders(){const{gl:n}=this.device;if(n.attachShader(this.handle,this.vs.handle),n.attachShader(this.handle,this.fs.handle),Re.time(iA,`linkProgram for ${this.id}`)(),n.linkProgram(this.handle),Re.timeEnd(iA,`linkProgram for ${this.id}`)(),Re.level,!this.device.features.has("compilation-status-async-webgl")){const i=this._getLinkStatus();this._reportLinkStatus(i);return}Re.once(1,"RenderPipeline linking is asynchronous")(),await this._waitForLinkComplete(),Re.info(2,`RenderPipeline ${this.id} - async linking complete: ${this.linkStatus}`)();const r=this._getLinkStatus();this._reportLinkStatus(r)}async _reportLinkStatus(n){var r;switch(n){case"success":return;default:switch(this.vs.compilationStatus){case"error":throw this.vs.debugShader(),new Error(`Error during compilation of shader ${this.vs.id}`);case"pending":this.vs.asyncCompilationStatus.then(()=>this.vs.debugShader());break}switch((r=this.fs)==null?void 0:r.compilationStatus){case"error":throw this.fs.debugShader(),new Error(`Error during compilation of shader ${this.fs.id}`);case"pending":this.fs.asyncCompilationStatus.then(()=>this.fs.debugShader());break}const i=this.device.gl.getProgramInfoLog(this.handle);throw new Error(`Error during ${n}: ${i}`)}}_getLinkStatus(){const{gl:n}=this.device;return n.getProgramParameter(this.handle,35714)?(n.validateProgram(this.handle),n.getProgramParameter(this.handle,35715)?(this.linkStatus="success","success"):(this.linkStatus="error","validation")):(this.linkStatus="error","linking")}async _waitForLinkComplete(){const n=async a=>await new Promise(l=>setTimeout(l,a));if(!this.device.features.has("compilation-status-async-webgl")){await n(10);return}const{gl:i}=this.device;for(;;){if(i.getProgramParameter(this.handle,37297))return;await n(10)}}_areTexturesRenderable(){let n=!0;for(const r of this.shaderLayout.bindings)!this.bindings[r.name]&&!this.bindings[r.name.replace(/Uniforms$/,"")]&&(Re.warn(`Binding ${r.name} not found in ${this.id}`)(),n=!1);return n}_applyBindings(){if(this.linkStatus!=="success")return;const{gl:n}=this.device;n.useProgram(this.handle);let r=0,i=0;for(const a of this.shaderLayout.bindings){const l=this.bindings[a.name]||this.bindings[a.name.replace(/Uniforms$/,"")];if(!l)throw new Error(`No value for binding ${a.name} in ${this.id}`);switch(a.type){case"uniform":const{name:u}=a,f=n.getUniformBlockIndex(this.handle,u);if(f===4294967295)throw new Error(`Invalid uniform block name ${u}`);n.uniformBlockBinding(this.handle,i,f),l instanceof of?n.bindBufferBase(35345,i,l.handle):n.bindBufferRange(35345,i,l.buffer.handle,l.offset||0,l.size||l.buffer.byteLength-l.offset),i+=1;break;case"texture":if(!(l instanceof Ql||l instanceof lf||l instanceof af))throw new Error("texture");let h;if(l instanceof Ql)h=l.texture;else if(l instanceof lf)h=l;else if(l instanceof af&&l.colorAttachments[0]instanceof Ql)Re.warn("Passing framebuffer in texture binding may be deprecated. Use fbo.colorAttachments[0] instead")(),h=l.colorAttachments[0].texture;else throw new Error("No texture");n.activeTexture(33984+r),n.bindTexture(h.glTarget,h.handle),r+=1;break;case"sampler":break;case"storage":case"read-only-storage":throw new Error(`binding type '${a.type}' not supported in WebGL`)}}}_applyUniforms(){for(const n of this.shaderLayout.uniforms||[]){const{name:r,location:i,type:a,textureUnit:l}=n,u=this.uniforms[r]??l;u!==void 0&&rK(this.device.gl,i,a,u)}}}function cK(t,e){const n={...t,attributes:t.attributes.map(r=>({...r}))};for(const r of(e==null?void 0:e.attributes)||[]){const i=n.attributes.find(a=>a.name===r.name);i?(i.type=r.type||i.type,i.stepMode=r.stepMode||i.stepMode):Re.warn(`shader layout attribute ${r.name} not present in shader`)}return n}class uK extends V_{constructor(n){super(n,{});M(this,"device");M(this,"commands",[]);this.device=n}submitCommands(n=this.commands){for(const r of n)switch(r.name){case"copy-buffer-to-buffer":fK(this.device,r.options);break;case"copy-buffer-to-texture":dK(this.device,r.options);break;case"copy-texture-to-buffer":hK(this.device,r.options);break;case"copy-texture-to-texture":gK(this.device,r.options);break;default:throw new Error(r.name)}}}function fK(t,e){const n=e.sourceBuffer,r=e.destinationBuffer;t.gl.bindBuffer(36662,n.handle),t.gl.bindBuffer(36663,r.handle),t.gl.copyBufferSubData(36662,36663,e.sourceOffset??0,e.destinationOffset??0,e.size),t.gl.bindBuffer(36662,null),t.gl.bindBuffer(36663,null)}function dK(t,e){throw new Error("Not implemented")}function hK(t,e){const{sourceTexture:n,mipLevel:r=0,aspect:i="all",width:a=e.sourceTexture.width,height:l=e.sourceTexture.height,depthOrArrayLayers:u=0,origin:f=[0,0],destinationBuffer:h,byteOffset:g=0,bytesPerRow:m,rowsPerImage:v}=e;if(i!=="all")throw new Error("aspect not supported in WebGL");if(r!==0||u!==0||m||v)throw new Error("not implemented");const{framebuffer:S,destroyFramebuffer:w}=TO(n);let E;try{const b=h,C=a||S.width,T=l||S.height,A=pO(S.colorAttachments[0].texture.props.format),O=A.format,x=A.type;t.gl.bindBuffer(35051,b.handle),E=t.gl.bindFramebuffer(36160,S.handle),t.gl.readPixels(f[0],f[1],C,T,O,x,g)}finally{t.gl.bindBuffer(35051,null),E!==void 0&&t.gl.bindFramebuffer(36160,E),w&&S.destroy()}}function gK(t,e){const{sourceTexture:n,destinationMipLevel:r=0,origin:i=[0,0],destinationOrigin:a=[0,0],destinationTexture:l}=e;let{width:u=e.destinationTexture.width,height:f=e.destinationTexture.height}=e;const{framebuffer:h,destroyFramebuffer:g}=TO(n),[m,v]=i,[S,w,E]=a,b=t.gl.bindFramebuffer(36160,h.handle);let C=null,T;if(l instanceof lf)C=l,u=Number.isFinite(u)?u:C.width,f=Number.isFinite(f)?f:C.height,C.bind(0),T=C.glTarget;else throw new Error("invalid destination");switch(T){case 3553:case 34067:t.gl.copyTexSubImage2D(T,r,S,w,m,v,u,f);break;case 35866:case 32879:t.gl.copyTexSubImage3D(T,r,S,w,E,m,v,u,f);break}C&&C.unbind(),t.gl.bindFramebuffer(36160,b),g&&h.destroy()}function TO(t){if(t instanceof Kn){const{width:e,height:n,id:r}=t;return{framebuffer:t.device.createFramebuffer({id:`framebuffer-for-${r}`,width:e,height:n,colorAttachments:[t]}),destroyFramebuffer:!0}}return{framebuffer:t,destroyFramebuffer:!1}}class pK extends $_{constructor(n,r){super(n,r);M(this,"device");M(this,"commandBuffer");this.device=n,this.commandBuffer=new uK(n)}destroy(){}finish(){this.commandBuffer.submitCommands()}copyBufferToBuffer(n){this.commandBuffer.commands.push({name:"copy-buffer-to-buffer",options:n})}copyBufferToTexture(n){this.commandBuffer.commands.push({name:"copy-buffer-to-texture",options:n})}copyTextureToBuffer(n){this.commandBuffer.commands.push({name:"copy-texture-to-buffer",options:n})}copyTextureToTexture(n){this.commandBuffer.commands.push({name:"copy-texture-to-texture",options:n})}pushDebugGroup(n){}popDebugGroup(){}insertDebugMarker(n){}resolveQuerySet(n,r,i){}}function mK(t){const{target:e,source:n,start:r=0,count:i=1}=t,a=n.length,l=i*a;let u=0;for(let f=r;u{for(const r in n)this.setBuffer(r,n[r])})}setBuffer(n,r){const i=this._getVaryingIndex(n),{buffer:a,byteLength:l,byteOffset:u}=this._getBufferRange(r);if(i<0){this.unusedBuffers[n]=a,Re.warn(`${this.id} unusedBuffers varying buffer ${n}`)();return}this.buffers[i]={buffer:a,byteLength:l,byteOffset:u},this.bindOnUse||this._bindBuffer(i,a,u,l)}getBuffer(n){if(sA(n))return this.buffers[n]||null;const r=this._getVaryingIndex(n);return r>=0?this.buffers[r]:null}bind(n=this.handle){if(typeof n!="function")return this.gl.bindTransformFeedback(36386,n),this;let r;return this._bound?r=n():(this.gl.bindTransformFeedback(36386,this.handle),this._bound=!0,r=n(),this._bound=!1,this.gl.bindTransformFeedback(36386,null)),r}unbind(){this.bind(null)}_getBufferRange(n){if(n instanceof of)return{buffer:n,byteOffset:0,byteLength:n.byteLength};const{buffer:r,byteOffset:i=0,byteLength:a=n.buffer.byteLength}=n;return{buffer:r,byteOffset:i,byteLength:a}}_getVaryingIndex(n){if(sA(n))return Number(n);for(const r of this.layout.varyings)if(n===r.name)return r.location;return-1}_bindBuffers(){for(const n in this.buffers){const{buffer:r,byteLength:i,byteOffset:a}=this._getBufferRange(this.buffers[n]);this._bindBuffer(Number(n),r,a,i)}}_unbindBuffers(){for(const n in this.buffers)this.gl.bindBufferBase(35982,Number(n),null)}_bindBuffer(n,r,i=0,a){const l=r&&r.handle;!l||a===void 0?this.gl.bindBufferBase(35982,n,l):this.gl.bindBufferRange(35982,n,l,i,a)}}function sA(t){return typeof t=="number"?Number.isInteger(t):/^\d+$/.test(t)}class bK extends W_{constructor(n,r){super(n,r);M(this,"device");M(this,"handle");M(this,"target",null);M(this,"_queryPending",!1);M(this,"_pollingPromise",null);if(this.device=n,r.count>1)throw new Error("WebGL QuerySet can only have one value");this.handle=this.device.gl.createQuery(),Object.seal(this)}get[Symbol.toStringTag](){return"Query"}destroy(){this.device.gl.deleteQuery(this.handle)}beginTimestampQuery(){return this._begin(35007)}endTimestampQuery(){this._end()}beginOcclusionQuery(n){return this._begin(n!=null&&n.conservative?36202:35887)}endOcclusionQuery(){this._end()}beginTransformFeedbackQuery(){return this._begin(35976)}endTransformFeedbackQuery(){this._end()}async resolveQuery(){return[await this.pollQuery()]}_begin(n){this._queryPending||(this.target=n,this.device.gl.beginQuery(this.target,this.handle))}_end(){this._queryPending||this.target&&(this.device.gl.endQuery(this.target),this.target=null,this._queryPending=!0)}isResultAvailable(){if(!this._queryPending)return!1;const n=this.device.gl.getQueryParameter(this.handle,34919);return n&&(this._queryPending=!1),n}isTimerDisjoint(){return this.device.gl.getParameter(36795)}getResult(){return this.device.gl.getQueryParameter(this.handle,34918)}getTimerMilliseconds(){return this.getResult()/1e6}pollQuery(n=Number.POSITIVE_INFINITY){if(this._pollingPromise)return this._pollingPromise;let r=0;return this._pollingPromise=new Promise((i,a)=>{const l=()=>{this.isResultAvailable()?(i(this.getResult()),this._pollingPromise=null):r++>n?(a("Timed out"),this._pollingPromise=null):requestAnimationFrame(l)};requestAnimationFrame(l)}),this._pollingPromise}}class Ba extends Ua{constructor(n){var m,v;super({...n,id:n.id||EY("webgl-device")});M(this,"type","webgl");M(this,"handle");M(this,"features");M(this,"limits");M(this,"info");M(this,"canvasContext");M(this,"lost");M(this,"_resolveContextLost");M(this,"gl");M(this,"debug",!1);M(this,"_canvasSizeInfo",{clientWidth:0,clientHeight:0,devicePixelRatio:1});M(this,"_extensions",{});M(this,"_polyfilled",!1);M(this,"spectorJS");M(this,"renderPass",null);M(this,"_constants");const r=Ua._getCanvasContextProps(n);if(!r)throw new Error("WebGLDevice requires props.createCanvasContext to be set");let i=(v=(m=r.canvas)==null?void 0:m.gl)==null?void 0:v.device;if(i)throw new Error(`WebGL context already attached to device ${i.id}`);this.canvasContext=new fY(this,r),this.lost=new Promise(S=>{this._resolveContextLost=S});const a={...n.webgl};r.alphaMode==="premultiplied"&&(a.premultipliedAlpha=!0),n.powerPreference!==void 0&&(a.powerPreference=n.powerPreference);const u=this.props._handle||Wq(this.canvasContext.canvas,{onContextLost:S=>{var w;return(w=this._resolveContextLost)==null?void 0:w.call(this,{reason:"destroyed",message:"Entered sleep mode, or too many apps or browser tabs are using the GPU."})},onContextRestored:S=>console.log("WebGL context restored")},a);if(!u)throw new Error("WebGL context creation failed");if(i=u.device,i){if(n._reuseDevices)return Re.log(1,`Not creating a new Device, instead returning a reference to Device ${i.id} already attached to WebGL context`,i)(),i._reused=!0,i;throw new Error(`WebGL context already attached to device ${i.id}`)}this.handle=u,this.gl=u,this.spectorJS=gY({...this.props,gl:this.handle}),this.gl.device=this,this.gl._version=2,this.info=Xq(this.gl,this._extensions),this.limits=new lY(this.gl),this.features=new oY(this.gl,this._extensions,this.props._disabledFeatures),this.props._initializeFeatures&&this.features.initializeFeatures(),r.autoResize!==!1&&this.canvasContext.resize(),new ko(this.gl,{log:(...S)=>Re.log(1,...S)()}).trackState(this.gl,{copyState:!1});const h=n.debugWebGL||n.debug,g=n.debugWebGL;h&&(this.gl=vY(this.gl,{debugWebGL:h,traceWebGL:g}),Re.warn("WebGL debug mode activated. Performance reduced.")(),n.debugWebGL&&(Re.level=Math.max(Re.level,1)))}destroy(){!this.props._reuseDevices&&!this._reused&&delete this.gl.device}get isLost(){return this.gl.isContextLost()}createCanvasContext(n){throw new Error("WebGL only supports a single canvas")}createBuffer(n){const r=this._normalizeBufferProps(n);return new of(this,r)}createTexture(n){return new lf(this,n)}createExternalTexture(n){throw new Error("createExternalTexture() not implemented")}createSampler(n){return new dy(this,n)}createShader(n){return new AY(this,n)}createFramebuffer(n){return new af(this,n)}createVertexArray(n){return new Eb(this,n)}createTransformFeedback(n){return new yK(this,n)}createQuerySet(n){return new bK(this,n)}createRenderPipeline(n){return new lK(this,n)}beginRenderPass(n){return new WY(this,n)}createComputePipeline(n){throw new Error("ComputePipeline not supported in WebGL")}beginComputePass(n){throw new Error("ComputePass not supported in WebGL")}createCommandEncoder(n={}){return new pK(this,n)}submit(){var n;(n=this.renderPass)==null||n.end(),this.renderPass=null}readPixelsToArrayWebGL(n,r){return zY(n,r)}readPixelsToBufferWebGL(n,r){return $Y(n,r)}setParametersWebGL(n){jc(this.gl,n)}getParametersWebGL(n){return dO(this.gl,n)}withParametersWebGL(n,r){return Ag(this.gl,n,r)}resetWebGL(){Re.warn("WebGLDevice.resetWebGL is deprecated, use only for debugging")(),zq(this.gl)}_getDeviceSpecificTextureFormatCapabilities(n){return rY(this.gl,n,this._extensions)}loseDevice(){var a;let n=!1;const i=this.getExtension("WEBGL_lose_context").WEBGL_lose_context;return i&&(n=!0,i.loseContext()),(a=this._resolveContextLost)==null||a.call(this,{reason:"destroyed",message:"Application triggered context loss"}),n}pushState(){ko.get(this.gl).push()}popState(){ko.get(this.gl).pop()}setSpectorMetadata(n,r){n.__SPECTOR_Metadata=r}getGLKey(n,r){const i=Number(n);for(const a in this.gl)if(this.gl[a]===i)return`GL.${a}`;return r!=null&&r.emptyIfUnknown?"":String(n)}getGLKeys(n){const r={emptyIfUnknown:!0};return Object.entries(n).reduce((i,[a,l])=>(i[`${a}:${this.getGLKey(a,r)}`]=`${l}:${this.getGLKey(l,r)}`,i),{})}setConstantAttributeWebGL(n,r){const i=this.limits.maxVertexAttributes;this._constants=this._constants||new Array(i).fill(null);const a=this._constants[n];switch(a&&TK(a,r)&&Re.info(1,`setConstantAttributeWebGL(${n}) could have been skipped, value unchanged`)(),this._constants[n]=r,r.constructor){case Float32Array:SK(this,n,r);break;case Int32Array:EK(this,n,r);break;case Uint32Array:wK(this,n,r);break;default:throw new Error("constant")}}getExtension(n){return Fc(this.gl,n,this._extensions),this._extensions}}function SK(t,e,n){switch(n.length){case 1:t.gl.vertexAttrib1fv(e,n);break;case 2:t.gl.vertexAttrib2fv(e,n);break;case 3:t.gl.vertexAttrib3fv(e,n);break;case 4:t.gl.vertexAttrib4fv(e,n);break}}function EK(t,e,n){t.gl.vertexAttribI4iv(e,n)}function wK(t,e,n){t.gl.vertexAttribI4uiv(e,n)}function TK(t,e){if(!t||!e||t.length!==e.length||t.constructor!==e.constructor)return!1;for(let n=0;n({drawBuffersWEBGL(e){return t.drawBuffers(e)},COLOR_ATTACHMENT0_WEBGL:36064,COLOR_ATTACHMENT1_WEBGL:36065,COLOR_ATTACHMENT2_WEBGL:36066,COLOR_ATTACHMENT3_WEBGL:36067}),RK=t=>({VERTEX_ARRAY_BINDING_OES:34229,createVertexArrayOES(){return t.createVertexArray()},deleteVertexArrayOES(e){return t.deleteVertexArray(e)},isVertexArrayOES(e){return t.isVertexArray(e)},bindVertexArrayOES(e){return t.bindVertexArray(e)}}),xK=t=>({VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE:35070,drawArraysInstancedANGLE(...e){return t.drawArraysInstanced(...e)},drawElementsInstancedANGLE(...e){return t.drawElementsInstanced(...e)},vertexAttribDivisorANGLE(...e){return t.vertexAttribDivisor(...e)}});function MK(t=!0){const e=HTMLCanvasElement.prototype;if(!t&&e.originalGetContext){e.getContext=e.originalGetContext,e.originalGetContext=void 0;return}e.originalGetContext=e.getContext,e.getContext=function(n,r){if(n==="webgl"||n==="experimental-webgl"){const i=this.originalGetContext("webgl2",r);return i instanceof HTMLElement&&OK(i),i}return this.originalGetContext(n,r)}}function OK(t){t.getExtension("EXT_color_buffer_float");const e={...CK,WEBGL_disjoint_timer_query:t.getExtension("EXT_disjoint_timer_query_webgl2"),WEBGL_draw_buffers:AK(t),OES_vertex_array_object:RK(t),ANGLE_instanced_arrays:xK(t)},n=t.getExtension;t.getExtension=function(i){const a=n.call(t,i);return a||(i in e?e[i]:null)};const r=t.getSupportedExtensions;t.getSupportedExtensions=function(){const i=r.apply(t)||[];return i==null?void 0:i.concat(Object.keys(e))}}const Ah=1;class PK extends V${constructor(){super();M(this,"type","webgl");Ua.defaultProps={...Ua.defaultProps,...Sb},Ba.adapter=this}isSupported(){return typeof WebGL2RenderingContext<"u"}enforceWebGL2(n){MK(n)}async attach(n){if(n instanceof Ba)return n;if((n==null?void 0:n.device)instanceof Ua)return n.device;if(!NK(n))throw new Error("Invalid WebGL2RenderingContext");return new Ba({_handle:n,createCanvasContext:{canvas:n.canvas,autoResize:!1}})}async create(n={}){Re.groupCollapsed(Ah,"WebGLDevice created")();const r=[];(n.debugWebGL||n.debug)&&r.push(mY()),n.debugSpectorJS&&r.push(hY(n));const i=await Promise.allSettled(r);for(const u of i)u.status==="rejected"&&Re.error(`Failed to initialize debug libraries ${u.reason}`)();const a=new Ba(n),l=`${a._reused?"Reusing":"Created"} device with WebGL2 ${a.debug?"debug ":""}context: ${a.info.vendor}, ${a.info.renderer} for canvas: ${a.canvasContext.id}`;return Re.probe(Ah,l)(),Re.table(Ah,a.info)(),Re.groupEnd(Ah)(),a}}function NK(t){return typeof WebGL2RenderingContext<"u"&&t instanceof WebGL2RenderingContext?!0:!!(t&&Number.isFinite(t._version))}const aA=new PK;function ya(){}const IK=({isDragging:t})=>t?"grabbing":"grab",CO={id:"",width:"100%",height:"100%",style:null,viewState:null,initialViewState:null,pickingRadius:0,layerFilter:null,parameters:{},parent:null,device:null,deviceProps:{type:"webgl"},gl:null,canvas:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,touchAction:"none",eventRecognizerOptions:{},_framebuffer:null,_animate:!1,_pickable:!0,_typedArrayManagerProps:{},_customRender:null,widgets:[],onDeviceInitialized:ya,onWebGLInitialized:ya,onResize:ya,onViewStateChange:ya,onInteractionStateChange:ya,onBeforeRender:ya,onAfterRender:ya,onLoad:ya,onError:t=>Sn.error(t.message,t.cause)(),onHover:null,onClick:null,onDragStart:null,onDrag:null,onDragEnd:null,_onMetrics:null,getCursor:IK,getTooltip:null,debug:!1,drawPickingColors:!1};class wb{constructor(e){this.width=0,this.height=0,this.userData={},this.device=null,this.canvas=null,this.viewManager=null,this.layerManager=null,this.effectManager=null,this.deckRenderer=null,this.deckPicker=null,this.eventManager=null,this.widgetManager=null,this.tooltip=null,this.animationLoop=null,this.cursorState={isHovering:!1,isDragging:!1},this.stats=new Xg({id:"deck.gl"}),this.metrics={fps:0,setPropsTime:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this._needsRedraw="Initial render",this._pickRequest={mode:"hover",x:-1,y:-1,radius:0,event:null},this._lastPointerDownInfo=null,this._onPointerMove=r=>{const{_pickRequest:i}=this;if(r.type==="pointerleave")i.x=-1,i.y=-1,i.radius=0;else{if(r.leftButton||r.rightButton)return;{const a=r.offsetCenter;if(!a)return;i.x=a.x,i.y=a.y,i.radius=this.props.pickingRadius}}this.layerManager&&(this.layerManager.context.mousePosition={x:i.x,y:i.y}),i.event=r},this._onEvent=r=>{const i=ty[r.type],a=r.offsetCenter;if(!i||!a||!this.layerManager)return;const l=this.layerManager.getLayers(),u=this.deckPicker.getLastPickedObject({x:a.x,y:a.y,layers:l,viewports:this.getViewports(a)},this._lastPointerDownInfo),{layer:f}=u,h=f&&(f[i]||f.props[i]),g=this.props[i];let m=!1;h&&(m=h.call(f,u,r)),m||(g==null||g(u,r),this.widgetManager.onEvent(u,r))},this._onPointerDown=r=>{const i=r.offsetCenter,a=this._pick("pickObject","pickObject Time",{x:i.x,y:i.y,radius:this.props.pickingRadius});this._lastPointerDownInfo=a.result[0]||a.emptyInfo},this.props={...CO,...e},e=this.props,e.viewState&&e.initialViewState&&Sn.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),this.viewState=this.props.initialViewState,e.device&&(this.device=e.device);let n=this.device;!n&&e.gl&&(e.gl instanceof WebGLRenderingContext&&Sn.error("WebGL1 context not supported.")(),n=aA.attach(e.gl)),n||(n=U_.createDevice({type:"best-available",_reuseDevices:!0,adapters:[aA],...e.deviceProps,createCanvasContext:{canvas:this._createCanvas(e),useDevicePixels:this.props.useDevicePixels,autoResize:!1}})),this.animationLoop=this._createAnimationLoop(n,e),this.setProps(e),e._typedArrayManagerProps&&Nf.setOptions(e._typedArrayManagerProps),this.animationLoop.start()}finalize(){var e,n,r,i,a,l,u,f,h,g;(e=this.animationLoop)==null||e.stop(),(n=this.animationLoop)==null||n.destroy(),this.animationLoop=null,this._lastPointerDownInfo=null,(r=this.layerManager)==null||r.finalize(),this.layerManager=null,(i=this.viewManager)==null||i.finalize(),this.viewManager=null,(a=this.effectManager)==null||a.finalize(),this.effectManager=null,(l=this.deckRenderer)==null||l.finalize(),this.deckRenderer=null,(u=this.deckPicker)==null||u.finalize(),this.deckPicker=null,(f=this.eventManager)==null||f.destroy(),this.eventManager=null,(h=this.widgetManager)==null||h.finalize(),this.widgetManager=null,!this.props.canvas&&!this.props.device&&!this.props.gl&&this.canvas&&((g=this.canvas.parentElement)==null||g.removeChild(this.canvas),this.canvas=null)}setProps(e){var r;this.stats.get("setProps Time").timeStart(),"onLayerHover"in e&&Sn.removed("onLayerHover","onHover")(),"onLayerClick"in e&&Sn.removed("onLayerClick","onClick")(),e.initialViewState&&!Gi(this.props.initialViewState,e.initialViewState,3)&&(this.viewState=e.initialViewState),Object.assign(this.props,e),this._setCanvasSize(this.props);const n=Object.create(this.props);Object.assign(n,{views:this._getViews(),width:this.width,height:this.height,viewState:this._getViewState()}),(r=this.animationLoop)==null||r.setProps(n),this.layerManager&&(this.viewManager.setProps(n),this.layerManager.activateViewport(this.getViewports()[0]),this.layerManager.setProps(n),this.effectManager.setProps(n),this.deckRenderer.setProps(n),this.deckPicker.setProps(n),this.widgetManager.setProps(n)),this.stats.get("setProps Time").timeEnd()}needsRedraw(e={clearRedrawFlags:!1}){if(!this.layerManager)return!1;if(this.props._animate)return"Deck._animate";let n=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);const r=this.viewManager.needsRedraw(e),i=this.layerManager.needsRedraw(e),a=this.effectManager.needsRedraw(e),l=this.deckRenderer.needsRedraw(e);return n=n||r||i||a||l,n}redraw(e){if(!this.layerManager)return;let n=this.needsRedraw({clearRedrawFlags:!0});n=e||n,n&&(this.stats.get("Redraw Count").incrementCount(),this.props._customRender?this.props._customRender(n):this._drawLayers(n))}get isInitialized(){return this.viewManager!==null}getViews(){return Fr(this.viewManager),this.viewManager.views}getViewports(e){return Fr(this.viewManager),this.viewManager.getViewports(e)}getCanvas(){return this.canvas}pickObject(e){const n=this._pick("pickObject","pickObject Time",e).result;return n.length?n[0]:null}pickMultipleObjects(e){return e.depth=e.depth||10,this._pick("pickObject","pickMultipleObjects Time",e).result}pickObjects(e){return this._pick("pickObjects","pickObjects Time",e)}_addResources(e,n=!1){for(const r in e)this.layerManager.resourceManager.add({resourceId:r,data:e[r],forceUpdate:n})}_removeResources(e){for(const n of e)this.layerManager.resourceManager.remove(n)}_addDefaultEffect(e){this.effectManager.addDefaultEffect(e)}_addDefaultShaderModule(e){this.layerManager.addDefaultShaderModule(e)}_removeDefaultShaderModule(e){var n;(n=this.layerManager)==null||n.removeDefaultShaderModule(e)}_pick(e,n,r){Fr(this.deckPicker);const{stats:i}=this;i.get("Pick Count").incrementCount(),i.get(n).timeStart();const a=this.deckPicker[e]({layers:this.layerManager.getLayers(r),views:this.viewManager.getViews(),viewports:this.getViewports(r),onViewportActive:this.layerManager.activateViewport,effects:this.effectManager.getEffects(),...r});return i.get(n).timeEnd(),a}_createCanvas(e){let n=e.canvas;return typeof n=="string"&&(n=document.getElementById(n),Fr(n)),n||(n=document.createElement("canvas"),n.id=e.id||"deckgl-overlay",(e.parent||document.body).appendChild(n)),Object.assign(n.style,e.style),n}_setCanvasSize(e){var i;if(!this.canvas)return;const{width:n,height:r}=e;if(n||n===0){const a=Number.isFinite(n)?`${n}px`:n;this.canvas.style.width=a}if(r||r===0){const a=Number.isFinite(r)?`${r}px`:r;this.canvas.style.position=((i=e.style)==null?void 0:i.position)||"absolute",this.canvas.style.height=a}}_updateCanvasSize(){var i,a;const{canvas:e}=this;if(!e)return;const n=e.clientWidth??e.width,r=e.clientHeight??e.height;(n!==this.width||r!==this.height)&&(this.width=n,this.height=r,(i=this.viewManager)==null||i.setProps({width:n,height:r}),(a=this.layerManager)==null||a.activateViewport(this.getViewports()[0]),this.props.onResize({width:n,height:r}))}_createAnimationLoop(e,n){const{gl:r,onError:i,useDevicePixels:a}=n;return new AX({device:e,useDevicePixels:a,autoResizeDrawingBuffer:!r,autoResizeViewport:!1,onInitialize:l=>this._setDevice(l.device),onRender:this._onRenderFrame.bind(this),onError:i})}_getViewState(){return this.props.viewState||this.viewState}_getViews(){const{views:e}=this.props,n=Array.isArray(e)?e:e?[e]:[new cO({id:"default-view"})];return n.length&&this.props.controller&&(n[0].props.controller=this.props.controller),n}_onContextLost(){const{onError:e}=this.props;this.animationLoop&&e&&e(new Error("WebGL context is lost"))}_pickAndCallback(){var n,r,i;const{_pickRequest:e}=this;if(e.event){const{result:a,emptyInfo:l}=this._pick("pickObject","pickObject Time",e);this.cursorState.isHovering=a.length>0;let u=l,f=!1;for(const h of a)u=h,f=((n=h.layer)==null?void 0:n.onHover(h,e.event))||f;f||((i=(r=this.props).onHover)==null||i.call(r,u,e.event),this.widgetManager.onHover(u,e.event)),e.event=null}}_updateCursor(){const e=this.props.parent||this.canvas;e&&(e.style.cursor=this.props.getCursor(this.cursorState))}_setDevice(e){var i,a;if(this.device=e,!this.animationLoop)return;this.canvas||(this.canvas=(i=this.device.canvasContext)==null?void 0:i.canvas),this.device instanceof Ba&&this.device.setParametersWebGL({blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onDeviceInitialized(this.device),this.device instanceof Ba&&this.props.onWebGLInitialized(this.device.gl);const n=new tO;n.play(),this.animationLoop.attachTimeline(n),this.eventManager=new cW(this.props.parent||this.canvas,{touchAction:this.props.touchAction,recognizers:Object.keys(A2).map(l=>{var S;const[u,f,h,g]=A2[l],m=(S=this.props.eventRecognizerOptions)==null?void 0:S[l],v={...f,...m,event:l};return{recognizer:new u(v),recognizeWith:h,requestFailure:g}}),events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerMove}});for(const l in ty)this.eventManager.on(l,this._onEvent);this.viewManager=new aq({timeline:n,eventManager:this.eventManager,onViewStateChange:this._onViewStateChange.bind(this),onInteractionStateChange:this._onInteractionStateChange.bind(this),views:this._getViews(),viewState:this._getViewState(),width:this.width,height:this.height});const r=this.viewManager.getViewports()[0];this.layerManager=new sq(this.device,{deck:this,stats:this.stats,viewport:r,timeline:n}),this.effectManager=new Eq({deck:this,device:this.device}),this.deckRenderer=new Cq(this.device),this.deckPicker=new Pq(this.device),this.widgetManager=new Dq({deck:this,parentElement:(a=this.canvas)==null?void 0:a.parentElement}),this.widgetManager.addDefault(new kq),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}_drawLayers(e,n){var l;const{device:r,gl:i}=this.layerManager.context;this.props.onBeforeRender({device:r,gl:i});const a={target:this.props._framebuffer,layers:this.layerManager.getLayers(),viewports:this.viewManager.getViewports(),onViewportActive:this.layerManager.activateViewport,views:this.viewManager.getViews(),pass:"screen",effects:this.effectManager.getEffects(),...n};(l=this.deckRenderer)==null||l.renderLayers(a),a.pass==="screen"&&this.widgetManager.onRedraw({viewports:a.viewports,layers:a.layers}),this.props.onAfterRender({device:r,gl:i})}_onRenderFrame(){this._getFrameStats(),this._metricsCounter++%60===0&&(this._getMetrics(),this.stats.reset(),Sn.table(4,this.metrics)(),this.props._onMetrics&&this.props._onMetrics(this.metrics)),this._updateCanvasSize(),this._updateCursor(),this.layerManager.updateLayers(),this._pickAndCallback(),this.redraw(),this.viewManager&&this.viewManager.updateViewStates()}_onViewStateChange(e){const n=this.props.onViewStateChange(e)||e.viewState;this.viewState&&(this.viewState={...this.viewState,[e.viewId]:n},this.props.viewState||this.viewManager&&this.viewManager.setProps({viewState:this.viewState}))}_onInteractionStateChange(e){this.cursorState.isDragging=e.isDragging||!1,this.props.onInteractionStateChange(e)}_getFrameStats(){const{stats:e}=this;e.get("frameRate").timeEnd(),e.get("frameRate").timeStart();const n=this.animationLoop.stats;e.get("GPU Time").addTime(n.get("GPU Time").lastTiming),e.get("CPU Time").addTime(n.get("CPU Time").lastTiming)}_getMetrics(){const{metrics:e,stats:n}=this;e.fps=n.get("frameRate").getHz(),e.setPropsTime=n.get("setProps Time").time,e.updateAttributesTime=n.get("Update Attributes").time,e.framesRedrawn=n.get("Redraw Count").count,e.pickTime=n.get("pickObject Time").time+n.get("pickMultipleObjects Time").time+n.get("pickObjects Time").time,e.pickCount=n.get("Pick Count").count,e.gpuTime=n.get("GPU Time").time,e.cpuTime=n.get("CPU Time").time,e.gpuTimePerFrame=n.get("GPU Time").getAverageTime(),e.cpuTimePerFrame=n.get("CPU Time").getAverageTime();const r=U_.stats.get("Memory Usage");e.bufferMemory=r.get("Buffer Memory").count,e.textureMemory=r.get("Texture Memory").count,e.renderbufferMemory=r.get("Renderbuffer Memory").count,e.gpuMemory=r.get("GPU Memory").count}}wb.defaultProps=CO;wb.VERSION=qz;function DK(t){switch(t){case"float64":return Float64Array;case"uint8":case"unorm8":return Uint8ClampedArray;default:return hM(t)}}const FK=dM;function Rh(t,e){return{attribute:t,format:e.size>1?`${e.type}x${e.size}`:e.type,byteOffset:e.offset||0}}function Eo(t){return t.stride||t.size*t.bytesPerElement}function kK(t,e){return t.type===e.type&&t.size===e.size&&Eo(t)===Eo(e)&&(t.offset||0)===(e.offset||0)}function hy(t,e){e.offset&&Sn.removed("shaderAttribute.offset","vertexOffset, elementOffset")();const n=Eo(t),r=e.vertexOffset!==void 0?e.vertexOffset:t.vertexOffset||0,i=e.elementOffset||0,a=r*n+i*t.bytesPerElement+(t.offset||0);return{...e,offset:a,stride:n}}function BK(t,e){const n=hy(t,e);return{high:n,low:{...n,offset:n.offset+t.size*4}}}class UK{constructor(e,n,r){this._buffer=null,this.device=e,this.id=n.id||"",this.size=n.size||1;const i=n.logicalType||n.type,a=i==="float64";let{defaultValue:l}=n;l=Number.isFinite(l)?[l]:l||new Array(this.size).fill(0);let u;a?u="float32":!i&&n.isIndexed?u="uint32":u=i||"float32";let f=DK(i||u);this.doublePrecision=a,a&&n.fp64===!1&&(f=Float32Array),this.value=null,this.settings={...n,defaultType:f,defaultValue:l,logicalType:i,type:u,normalized:u.includes("norm"),size:this.size,bytesPerElement:f.BYTES_PER_ELEMENT},this.state={...r,externalBuffer:null,bufferAccessor:this.settings,allocatedValue:null,numInstances:0,bounds:null,constant:!1}}get isConstant(){return this.state.constant}get buffer(){return this._buffer}get byteOffset(){const e=this.getAccessor();return e.vertexOffset?e.vertexOffset*Eo(e):0}get numInstances(){return this.state.numInstances}set numInstances(e){this.state.numInstances=e}delete(){this._buffer&&(this._buffer.delete(),this._buffer=null),Nf.release(this.state.allocatedValue)}getBuffer(){return this.state.constant?null:this.state.externalBuffer||this._buffer}getValue(e=this.id,n=null){const r={};if(this.state.constant){const i=this.value;if(n){const a=hy(this.getAccessor(),n),l=a.offset/i.BYTES_PER_ELEMENT,u=a.size||this.size;r[e]=i.subarray(l,l+u)}else r[e]=i}else r[e]=this.getBuffer();return this.doublePrecision&&(this.value instanceof Float64Array?r[`${e}64Low`]=r[e]:r[`${e}64Low`]=new Float32Array(this.size)),r}_getBufferLayout(e=this.id,n=null){const r=this.getAccessor(),i=[],a={name:this.id,byteStride:Eo(r),attributes:i};if(this.doublePrecision){const l=BK(r,n||{});i.push(Rh(e,{...r,...l.high}),Rh(`${e}64Low`,{...r,...l.low}))}else if(n){const l=hy(r,n);i.push(Rh(e,{...r,...l}))}else i.push(Rh(e,r));return a}setAccessor(e){this.state.bufferAccessor=e}getAccessor(){return this.state.bufferAccessor}getBounds(){if(this.state.bounds)return this.state.bounds;let e=null;if(this.state.constant&&this.value){const n=Array.from(this.value);e=[n,n]}else{const{value:n,numInstances:r,size:i}=this,a=r*i;if(n&&a&&n.length>=a){const l=new Array(i).fill(1/0),u=new Array(i).fill(-1/0);for(let f=0;fu[h]&&(u[h]=g)}e=[l,u]}}return this.state.bounds=e,e}setData(e){const{state:n}=this;let r;ArrayBuffer.isView(e)?r={value:e}:e instanceof $n?r={buffer:e}:r=e;const i={...this.settings,...r};if(ArrayBuffer.isView(r.value)){if(!r.type)if(this.doublePrecision&&r.value instanceof Float64Array)i.type="float32";else{const l=FK(r.value);i.type=i.normalized?l.replace("int","norm"):l}i.bytesPerElement=r.value.BYTES_PER_ELEMENT,i.stride=Eo(i)}if(n.bounds=null,r.constant){let a=r.value;if(a=this._normalizeValue(a,[],0),this.settings.normalized&&(a=this.normalizeConstant(a)),!(!n.constant||!this._areValuesEqual(a,this.value)))return!1;n.externalBuffer=null,n.constant=!0,this.value=ArrayBuffer.isView(a)?a:new Float32Array(a)}else if(r.buffer){const a=r.buffer;n.externalBuffer=a,n.constant=!1,this.value=r.value||null}else if(r.value){this._checkExternalBuffer(r);let a=r.value;n.externalBuffer=null,n.constant=!1,this.value=a;let{buffer:l}=this;const u=Eo(i),f=(i.vertexOffset||0)*u;if(this.doublePrecision&&a instanceof Float64Array&&(a=s0(a,i)),this.settings.isIndexed){const g=this.settings.defaultType;a.constructor!==g&&(a=new g(a))}const h=a.byteLength+f+u*2;(!l||l.byteLength(n+128)/255*2-1);case"snorm16":return new Float32Array(e).map(n=>(n+32768)/65535*2-1);case"unorm8":return new Float32Array(e).map(n=>n/255);case"unorm16":return new Float32Array(e).map(n=>n/65535);default:return e}}_normalizeValue(e,n,r){const{defaultValue:i,size:a}=this.settings;if(Number.isFinite(e))return n[r]=e,n;if(!e){let l=a;for(;--l>=0;)n[r+l]=i[l];return n}switch(a){case 4:n[r+3]=Number.isFinite(e[3])?e[3]:i[3];case 3:n[r+2]=Number.isFinite(e[2])?e[2]:i[2];case 2:n[r+1]=Number.isFinite(e[1])?e[1]:i[1];case 1:n[r+0]=Number.isFinite(e[0])?e[0]:i[0];break;default:let l=a;for(;--l>=0;)n[r+l]=Number.isFinite(e[l])?e[l]:i[l]}return n}_areValuesEqual(e,n){if(!e||!n)return!1;const{size:r}=this;for(let i=0;i0&&(lA.length=t.length,r=lA):r=oA,(e>0||Number.isFinite(n))&&(r=(Array.isArray(r)?r:Array.from(r)).slice(e,n),i.index=e-1),{iterable:r,objectInfo:i}}function AO(t){return t&&t[Symbol.asyncIterator]}function zK(t,e){const{size:n,stride:r,offset:i,startIndices:a,nested:l}=e,u=t.BYTES_PER_ELEMENT,f=r?r/u:n,h=i?i/u:0,g=Math.floor((t.length-h)/f);return(m,{index:v,target:S})=>{if(!a){const C=v*f+h;for(let T=0;T=e[1]))return t;const n=[],r=t.length;let i=0;for(let a=0;ae[1]?n.push(l):e=[Math.min(l[0],e[0]),Math.max(l[1],e[1])]}return n.splice(i,0,e),n}const HK={interpolation:{duration:0,easing:t=>t},spring:{stiffness:.05,damping:.5}};function RO(t,e){if(!t)return null;Number.isFinite(t)&&(t={type:"interpolation",duration:t});const n=t.type||"interpolation";return{...HK[n],...e,...t,type:n}}class xO extends UK{constructor(e,n){super(e,n,{startIndices:null,lastExternalBuffer:null,binaryValue:null,binaryAccessor:null,needsUpdate:!0,needsRedraw:!1,layoutChanged:!1,updateRanges:Uh}),this.constant=!1,this.settings.update=n.update||(n.accessor?this._autoUpdater:void 0),Object.seal(this.settings),Object.seal(this.state),this._validateAttributeUpdaters()}get startIndices(){return this.state.startIndices}set startIndices(e){this.state.startIndices=e}needsUpdate(){return this.state.needsUpdate}needsRedraw({clearChangedFlags:e=!1}={}){const n=this.state.needsRedraw;return this.state.needsRedraw=n&&!e,n}layoutChanged(){return this.state.layoutChanged}setAccessor(e){var n;(n=this.state).layoutChanged||(n.layoutChanged=!kK(e,this.getAccessor())),super.setAccessor(e)}getUpdateTriggers(){const{accessor:e}=this.settings;return[this.id].concat(typeof e!="function"&&e||[])}supportsTransition(){return!!this.settings.transition}getTransitionSetting(e){if(!e||!this.supportsTransition())return null;const{accessor:n}=this.settings,r=this.settings.transition,i=Array.isArray(n)?e[n.find(a=>e[a])]:e[n];return RO(i,r)}setNeedsUpdate(e=this.id,n){if(this.state.needsUpdate=this.state.needsUpdate||e,this.setNeedsRedraw(e),n){const{startRow:r=0,endRow:i=1/0}=n;this.state.updateRanges=VK(this.state.updateRanges,[r,i])}else this.state.updateRanges=Uh}clearNeedsUpdate(){this.state.needsUpdate=!1,this.state.updateRanges=$K}setNeedsRedraw(e=this.id){this.state.needsRedraw=this.state.needsRedraw||e}allocate(e){const{state:n,settings:r}=this;return r.noAlloc?!1:r.update?(super.allocate(e,n.updateRanges!==Uh),!0):!1}updateBuffer({numInstances:e,data:n,props:r,context:i}){if(!this.needsUpdate())return!1;const{state:{updateRanges:a},settings:{update:l,noAlloc:u}}=this;let f=!0;if(l){for(const[h,g]of a)l.call(i,this,{data:n,startRow:h,endRow:g,props:r,numInstances:e});if(this.value)if(this.constant||!this.buffer||this.buffer.byteLengthg?h.set(A,E):(e._normalizeValue(A,C.target,0),eq({target:h,source:C.target,start:E,count:O}));E+=O*g}else e._normalizeValue(A,h,E),E+=g}}_validateAttributeUpdaters(){const{settings:e}=this;if(!(e.noAlloc||typeof e.update=="function"))throw new Error(`Attribute ${this.id} missing update or accessor`)}_checkAttributeArray(){const{value:e}=this,n=Math.min(4,this.size);if(e&&e.length>=n){let r=!0;switch(n){case 4:r=r&&Number.isFinite(e[3]);case 3:r=r&&Number.isFinite(e[2]);case 2:r=r&&Number.isFinite(e[1]);case 1:r=r&&Number.isFinite(e[0]);break;default:r=!1}if(!r)throw new Error(`Illegal attribute generated for ${this.id}`)}}}function g0(t){const{source:e,target:n,start:r=0,size:i,getData:a}=t,l=t.end||n.length,u=e.length,f=l-r;if(u>f){n.set(e.subarray(0,f),r);return}if(n.set(e,r),!a)return;let h=u;for(;hr(g+u,m)),h=Math.min(i.length,a.length);for(let g=1;gu}){const u=n.doublePrecision&&n.value instanceof Float64Array?2:1,f=n.size*u,h=n.byteOffset,g=n.settings.bytesPerElement<4?h/n.settings.bytesPerElement*4:h,m=n.startIndices,v=a&&m,S=n.isConstant;if(!v&&e&&r>=i)return e;const w=n.value instanceof Float64Array?Float32Array:n.value.constructor,E=S?n.value:new w(n.getBuffer().readSyncWebGL(h,i*w.BYTES_PER_ELEMENT).buffer);if(n.settings.normalized&&!S){const A=l;l=(O,x)=>n.normalizeConstant(A(O,x))}const b=S?(A,O)=>l(E,O):(A,O)=>l(E.subarray(A+h,A+h+f),O),C=e?new Float32Array(e.readSyncWebGL(g,r*4).buffer):new Float32Array(0),T=new Float32Array(i);return jK({source:C,target:T,sourceStartIndices:a,targetStartIndices:m,size:f,getData:b}),(!e||e.byteLength0||i.end()}delete(){super.delete(),this.transform.destroy(),this.texture.destroy(),this.framebuffer.destroy()}}const JK=`uniform springUniforms { - float damping; - float stiffness; -} spring; -`,eZ={name:"spring",vs:JK,uniformTypes:{damping:"f32",stiffness:"f32"}},tZ=`#version 300 es -#define SHADER_NAME spring-transition-vertex-shader - -#define EPSILON 0.00001 - -in ATTRIBUTE_TYPE aPrev; -in ATTRIBUTE_TYPE aCur; -in ATTRIBUTE_TYPE aTo; -out ATTRIBUTE_TYPE vNext; -out float vIsTransitioningFlag; - -ATTRIBUTE_TYPE getNextValue(ATTRIBUTE_TYPE cur, ATTRIBUTE_TYPE prev, ATTRIBUTE_TYPE dest) { - ATTRIBUTE_TYPE velocity = cur - prev; - ATTRIBUTE_TYPE delta = dest - cur; - ATTRIBUTE_TYPE force = delta * spring.stiffness; - ATTRIBUTE_TYPE resistance = velocity * spring.damping; - return force - resistance + velocity + cur; -} - -void main(void) { - bool isTransitioning = length(aCur - aPrev) > EPSILON || length(aTo - aCur) > EPSILON; - vIsTransitioningFlag = isTransitioning ? 1.0 : 0.0; - - vNext = getNextValue(aCur, aPrev, aTo); - gl_Position = vec4(0, 0, 0, 1); - gl_PointSize = 100.0; -} -`,nZ=`#version 300 es -#define SHADER_NAME spring-transition-is-transitioning-fragment-shader - -in float vIsTransitioningFlag; - -out vec4 fragColor; - -void main(void) { - if (vIsTransitioningFlag == 0.0) { - discard; - } - fragColor = vec4(1.0); -}`;function rZ(t,e){const n=MO(e.size),r=OO(e.size);return new If(t,{vs:tZ,fs:nZ,bufferLayout:[{name:"aPrev",format:r},{name:"aCur",format:r},{name:"aTo",format:e.getBufferLayout().attributes[0].format}],varyings:["vNext"],modules:[eZ],defines:{ATTRIBUTE_TYPE:n},parameters:{depthCompare:"always",blendColorOperation:"max",blendColorSrcFactor:"one",blendColorDstFactor:"one",blendAlphaOperation:"max",blendAlphaSrcFactor:"one",blendAlphaDstFactor:"one"}})}function iZ(t){return t.createTexture({data:new Uint8Array(4),format:"rgba8unorm",mipmaps:!1,width:1,height:1})}function sZ(t,e){return t.createFramebuffer({id:"spring-transition-is-transitioning-framebuffer",width:1,height:1,colorAttachments:[e]})}const aZ={interpolation:qK,spring:GK};class oZ{constructor(e,{id:n,timeline:r}){if(!e)throw new Error("AttributeTransitionManager is constructed without device");this.id=n,this.device=e,this.timeline=r,this.transitions={},this.needsRedraw=!1,this.numInstances=1}finalize(){for(const e in this.transitions)this._removeTransition(e)}update({attributes:e,transitions:n,numInstances:r}){this.numInstances=r||1;for(const i in e){const a=e[i],l=a.getTransitionSetting(n);l&&this._updateAttribute(i,a,l)}for(const i in this.transitions){const a=e[i];(!a||!a.getTransitionSetting(n))&&this._removeTransition(i)}}hasAttribute(e){const n=this.transitions[e];return n&&n.inProgress}getAttributes(){const e={};for(const n in this.transitions){const r=this.transitions[n];r.inProgress&&(e[n]=r.attributeInTransition)}return e}run(){if(this.numInstances===0)return!1;for(const n in this.transitions)this.transitions[n].update()&&(this.needsRedraw=!0);const e=this.needsRedraw;return this.needsRedraw=!1,e}_removeTransition(e){this.transitions[e].delete(),delete this.transitions[e]}_updateAttribute(e,n,r){const i=this.transitions[e];let a=!i||i.type!==r.type;if(a){i&&this._removeTransition(e);const l=aZ[r.type];l?this.transitions[e]=new l({attribute:n,timeline:this.timeline,device:this.device}):(Sn.error(`unsupported transition type '${r.type}'`)(),a=!1)}(a||n.needsRedraw())&&(this.needsRedraw=!0,this.transitions[e].start(r,this.numInstances))}}const uA="attributeManager.invalidate",lZ="attributeManager.updateStart",cZ="attributeManager.updateEnd",uZ="attribute.updateStart",fZ="attribute.allocate",dZ="attribute.updateEnd";class hZ{constructor(e,{id:n="attribute-manager",stats:r,timeline:i}={}){this.mergeBoundsMemoized=Zf(hX),this.id=n,this.device=e,this.attributes={},this.updateTriggers={},this.needsRedraw=!0,this.userData={},this.stats=r,this.attributeTransitionManager=new oZ(e,{id:`${n}-transitions`,timeline:i}),Object.seal(this)}finalize(){for(const e in this.attributes)this.attributes[e].delete();this.attributeTransitionManager.finalize()}getNeedsRedraw(e={clearRedrawFlags:!1}){const n=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!e.clearRedrawFlags,n&&this.id}setNeedsRedraw(){this.needsRedraw=!0}add(e){this._add(e)}addInstanced(e){this._add(e,{stepMode:"instance"})}remove(e){for(const n of e)this.attributes[n]!==void 0&&(this.attributes[n].delete(),delete this.attributes[n])}invalidate(e,n){const r=this._invalidateTrigger(e,n);Hr(uA,this,e,r)}invalidateAll(e){for(const n in this.attributes)this.attributes[n].setNeedsUpdate(n,e);Hr(uA,this,"all")}update({data:e,numInstances:n,startIndices:r=null,transitions:i,props:a={},buffers:l={},context:u={}}){let f=!1;Hr(lZ,this),this.stats&&this.stats.get("Update Attributes").timeStart();for(const h in this.attributes){const g=this.attributes[h],m=g.settings.accessor;g.startIndices=r,g.numInstances=n,a[h]&&Sn.removed(`props.${h}`,`data.attributes.${h}`)(),g.setExternalBuffer(l[h])||g.setBinaryValue(typeof m=="string"?l[m]:void 0,e.startIndices)||typeof m=="string"&&!l[m]&&g.setConstantValue(a[m])||g.needsUpdate()&&(f=!0,this._updateAttribute({attribute:g,numInstances:n,data:e,props:a,context:u})),this.needsRedraw=this.needsRedraw||g.needsRedraw()}f&&Hr(cZ,this,n),this.stats&&this.stats.get("Update Attributes").timeEnd(),this.attributeTransitionManager.update({attributes:this.attributes,numInstances:n,transitions:i})}updateTransition(){const{attributeTransitionManager:e}=this,n=e.run();return this.needsRedraw=this.needsRedraw||n,n}getAttributes(){return{...this.attributes,...this.attributeTransitionManager.getAttributes()}}getBounds(e){const n=e.map(r=>{var i;return(i=this.attributes[r])==null?void 0:i.getBounds()});return this.mergeBoundsMemoized(n)}getChangedAttributes(e={clearChangedFlags:!1}){const{attributes:n,attributeTransitionManager:r}=this,i={...r.getAttributes()};for(const a in n){const l=n[a];l.needsRedraw(e)&&!r.hasAttribute(a)&&(i[a]=l)}return i}getBufferLayouts(e){return Object.values(this.getAttributes()).map(n=>n.getBufferLayout(e))}_add(e,n){for(const r in e){const i=e[r],a={...i,id:r,size:i.isIndexed&&1||i.size||1,...n};this.attributes[r]=new xO(this.device,a)}this._mapUpdateTriggersToAttributes()}_mapUpdateTriggersToAttributes(){const e={};for(const n in this.attributes)this.attributes[n].getUpdateTriggers().forEach(i=>{e[i]||(e[i]=[]),e[i].push(n)});this.updateTriggers=e}_invalidateTrigger(e,n){const{attributes:r,updateTriggers:i}=this,a=i[e];return a&&a.forEach(l=>{const u=r[l];u&&u.setNeedsUpdate(u.id,n)}),a}_updateAttribute(e){const{attribute:n,numInstances:r}=e;if(Hr(uZ,n),n.constant){n.setConstantValue(n.value);return}n.allocate(r)&&Hr(fZ,n,r),n.updateBuffer(e)&&(this.needsRedraw=!0,Hr(dZ,n,r))}}class gZ extends lp{get value(){return this._value}_onUpdate(){const{time:e,settings:{fromValue:n,toValue:r,duration:i,easing:a}}=this,l=a(e/i);this._value=yg(n,r,l)}}const fA=1e-5;function dA(t,e,n,r,i){const a=e-t,u=(n-e)*i,f=-a*r;return u+f+a+e}function pZ(t,e,n,r,i){if(Array.isArray(n)){const a=[];for(let l=0;l0}add(e,n,r,i){const{transitions:a}=this;if(a.has(e)){const f=a.get(e),{value:h=f.settings.fromValue}=f;n=h,this.remove(e)}if(i=RO(i),!i)return;const l=vZ[i.type];if(!l){Sn.error(`unsupported transition type '${i.type}'`)();return}const u=new l(this.timeline);u.start({...i,fromValue:n,toValue:r}),a.set(e,u)}remove(e){const{transitions:n}=this;n.has(e)&&(n.get(e).cancel(),n.delete(e))}update(){const e={};for(const[n,r]of this.transitions)r.update(),e[n]=r.value,r.inProgress||this.remove(n);return e}clear(){for(const e of this.transitions.keys())this.remove(e)}}function yZ(t){const e=t[Fo];for(const n in e){const r=e[n],{validate:i}=r;if(i&&!i(t[n],r))throw new Error(`Invalid prop ${n}: ${t[n]}`)}}function bZ(t,e){const n=kO({newProps:t,oldProps:e,propTypes:t[Fo],ignoreProps:{data:null,updateTriggers:null,extensions:null,transitions:null}}),r=EZ(t,e);let i=!1;return r||(i=wZ(t,e)),{dataChanged:r,propsChanged:n,updateTriggersChanged:i,extensionsChanged:TZ(t,e),transitionsChanged:SZ(t,e)}}function SZ(t,e){if(!t.transitions)return!1;const n={},r=t[Fo];let i=!1;for(const a in t.transitions){const l=r[a],u=l&&l.type;(u==="number"||u==="color"||u==="array")&&gy(t[a],e[a],l)&&(n[a]=!0,i=!0)}return i?n:!1}function kO({newProps:t,oldProps:e,ignoreProps:n={},propTypes:r={},triggerName:i="props"}){if(e===t)return!1;if(typeof t!="object"||t===null)return`${i} changed shallowly`;if(typeof e!="object"||e===null)return`${i} changed shallowly`;for(const a of Object.keys(t))if(!(a in n)){if(!(a in e))return`${i}.${a} added`;const l=gy(t[a],e[a],r[a]);if(l)return`${i}.${a} ${l}`}for(const a of Object.keys(e))if(!(a in n)){if(!(a in t))return`${i}.${a} dropped`;if(!Object.hasOwnProperty.call(t,a)){const l=gy(t[a],e[a],r[a]);if(l)return`${i}.${a} ${l}`}}return!1}function gy(t,e,n){let r=n&&n.equal;return r&&!r(t,e,n)||!r&&(r=t&&e&&t.equals,r&&!r.call(t,e))?"changed deeply":!r&&e!==t?"changed shallowly":null}function EZ(t,e){if(e===null)return"oldProps is null, initial diff";let n=!1;const{dataComparator:r,_dataDiff:i}=t;return r?r(t.data,e.data)||(n="Data comparator detected a change"):t.data!==e.data&&(n="A new data container was supplied"),n&&i&&(n=i(t.data,e.data)||n),n}function wZ(t,e){if(e===null)return{all:!0};if("all"in t.updateTriggers&&gA(t,e,"all"))return{all:!0};const n={};let r=!1;for(const i in t.updateTriggers)i!=="all"&&gA(t,e,i)&&(n[i]=!0,r=!0);return r?n:!1}function TZ(t,e){if(e===null)return!0;const n=e.extensions,{extensions:r}=t;if(r===n)return!1;if(!n||!r||r.length!==n.length)return!0;for(let i=0;ir.name==="project64"))){const r=n.modules.findIndex(i=>i.name==="project32");r>=0&&n.modules.splice(r,1)}if("inject"in e)if(!t.inject)n.inject=e.inject;else{const r={...t.inject};for(const i in e.inject)r[i]=(r[i]||"")+e.inject[i];n.inject=r}return n}const OZ={minFilter:"linear",mipmapFilter:"linear",magFilter:"linear",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"},py={};function PZ(t,e,n,r){if(n instanceof Kn)return n;n.constructor&&n.constructor.name!=="Object"&&(n={data:n});let i=null;n.compressed&&(i={minFilter:"linear",mipmapFilter:n.data.length>1?"nearest":"linear"});const a=e.createTexture({...n,sampler:{...OZ,...i,...r},mipmaps:!0});return py[a.id]=t,a}function NZ(t,e){!e||!(e instanceof Kn)||py[e.id]===t&&(e.delete(),delete py[e.id])}const IZ={boolean:{validate(t,e){return!0},equal(t,e,n){return!!t==!!e}},number:{validate(t,e){return Number.isFinite(t)&&(!("max"in e)||t<=e.max)&&(!("min"in e)||t>=e.min)}},color:{validate(t,e){return e.optional&&!t||my(t)&&(t.length===3||t.length===4)},equal(t,e,n){return Gi(t,e,1)}},accessor:{validate(t,e){const n=Rg(t);return n==="function"||n===Rg(e.value)},equal(t,e,n){return typeof e=="function"?!0:Gi(t,e,1)}},array:{validate(t,e){return e.optional&&!t||my(t)},equal(t,e,n){const{compare:r}=n,i=Number.isInteger(r)?r:r?1:0;return r?Gi(t,e,i):t===e}},object:{equal(t,e,n){if(n.ignore)return!0;const{compare:r}=n,i=Number.isInteger(r)?r:r?1:0;return r?Gi(t,e,i):t===e}},function:{validate(t,e){return e.optional&&!t||typeof t=="function"},equal(t,e,n){return!n.compare&&n.ignore!==!1||t===e}},data:{transform:(t,e,n)=>{if(!t)return t;const{dataTransform:r}=n.props;return r?r(t):typeof t.shape=="string"&&t.shape.endsWith("-table")&&Array.isArray(t.data)?t.data:t}},image:{transform:(t,e,n)=>{const r=n.context;return!r||!r.device?null:PZ(n.id,r.device,t,{...e.parameters,...n.props.textureParameters})},release:(t,e,n)=>{NZ(n.id,t)}}};function DZ(t){const e={},n={},r={};for(const[i,a]of Object.entries(t)){const l=a==null?void 0:a.deprecatedFor;if(l)r[i]=Array.isArray(l)?l:[l];else{const u=FZ(i,a);e[i]=u,n[i]=u.value}}return{propTypes:e,defaultProps:n,deprecatedProps:r}}function FZ(t,e){switch(Rg(e)){case"object":return ju(t,e);case"array":return ju(t,{type:"array",value:e,compare:!1});case"boolean":return ju(t,{type:"boolean",value:e});case"number":return ju(t,{type:"number",value:e});case"function":return ju(t,{type:"function",value:e,compare:!0});default:return{name:t,type:"unknown",value:e}}}function ju(t,e){return"type"in e?{name:t,...IZ[e.type],...e}:"value"in e?{name:t,type:Rg(e.value),...e}:{name:t,type:"object",value:e}}function my(t){return Array.isArray(t)||ArrayBuffer.isView(t)}function Rg(t){return my(t)?"array":t===null?"null":typeof t}function kZ(t,e){let n;for(let a=e.length-1;a>=0;a--){const l=e[a];"extensions"in l&&(n=l.extensions)}const r=vy(t.constructor,n),i=Object.create(r);i[Cg]=t,i[Vo]={},i[ka]={};for(let a=0;a{},this.oldProps=null,this.oldAsyncProps=null}finalize(){for(const e in this.asyncProps){const n=this.asyncProps[e];n&&n.type&&n.type.release&&n.type.release(n.resolvedValue,n.type,this.component)}this.asyncProps={},this.component=null,this.resetOldProps()}getOldProps(){return this.oldAsyncProps||this.oldProps||WZ}resetOldProps(){this.oldAsyncProps=null,this.oldProps=this.component?this.component.props:null}hasAsyncProp(e){return e in this.asyncProps}getAsyncProp(e){const n=this.asyncProps[e];return n&&n.resolvedValue}isAsyncPropLoading(e){if(e){const n=this.asyncProps[e];return!!(n&&n.pendingLoadCount>0&&n.pendingLoadCount!==n.resolvedLoadCount)}for(const n in this.asyncProps)if(this.isAsyncPropLoading(n))return!0;return!1}reloadAsyncProp(e,n){this._watchPromise(e,Promise.resolve(n))}setAsyncProps(e){this.component=e[Cg]||this.component;const n=e[ka]||{},r=e[Vo]||e,i=e[ic]||{};for(const a in n){const l=n[a];this._createAsyncPropData(a,i[a]),this._updateAsyncProp(a,l),n[a]=this.getAsyncProp(a)}for(const a in r){const l=r[a];this._createAsyncPropData(a,i[a]),this._updateAsyncProp(a,l)}}_fetch(e,n){return null}_onResolve(e,n){}_onError(e,n){}_updateAsyncProp(e,n){if(this._didAsyncInputValueChange(e,n)){if(typeof n=="string"&&(n=this._fetch(e,n)),n instanceof Promise){this._watchPromise(e,n);return}if(AO(n)){this._resolveAsyncIterable(e,n);return}this._setPropValue(e,n)}}_freezeAsyncOldProps(){if(!this.oldAsyncProps&&this.oldProps){this.oldAsyncProps=Object.create(this.oldProps);for(const e in this.asyncProps)Object.defineProperty(this.oldAsyncProps,e,{enumerable:!0,value:this.oldProps[e]})}}_didAsyncInputValueChange(e,n){const r=this.asyncProps[e];return n===r.resolvedValue||n===r.lastValue?!1:(r.lastValue=n,!0)}_setPropValue(e,n){this._freezeAsyncOldProps();const r=this.asyncProps[e];r&&(n=this._postProcessValue(r,n),r.resolvedValue=n,r.pendingLoadCount++,r.resolvedLoadCount=r.pendingLoadCount)}_setAsyncPropValue(e,n,r){const i=this.asyncProps[e];i&&r>=i.resolvedLoadCount&&n!==void 0&&(this._freezeAsyncOldProps(),i.resolvedValue=n,i.resolvedLoadCount=r,this.onAsyncPropUpdated(e,n))}_watchPromise(e,n){const r=this.asyncProps[e];if(r){r.pendingLoadCount++;const i=r.pendingLoadCount;n.then(a=>{this.component&&(a=this._postProcessValue(r,a),this._setAsyncPropValue(e,a,i),this._onResolve(e,a))}).catch(a=>{this._onError(e,a)})}}async _resolveAsyncIterable(e,n){if(e!=="data"){this._setPropValue(e,n);return}const r=this.asyncProps[e];if(!r)return;r.pendingLoadCount++;const i=r.pendingLoadCount;let a=[],l=0;for await(const u of n){if(!this.component)return;const{dataTransform:f}=this.component.props;f?a=f(u,a):a=a.concat(u),Object.defineProperty(a,"__diff",{enumerable:!1,value:[{startRow:l,endRow:a.length}]}),l=a.length,this._setAsyncPropValue(e,a,i)}this._onResolve(e,a)}_postProcessValue(e,n){const r=e.type;return r&&this.component&&(r.release&&r.release(e.resolvedValue,r,this.component),r.transform)?r.transform(n,r,this.component):n}_createAsyncPropData(e,n){if(!this.asyncProps[e]){const i=this.component&&this.component.props[Fo];this.asyncProps[e]={type:i&&i[e],lastValue:null,resolvedValue:n,pendingLoadCount:0,resolvedLoadCount:0}}}}class qZ extends XZ{constructor({attributeManager:e,layer:n}){super(n),this.attributeManager=e,this.needsRedraw=!0,this.needsUpdate=!0,this.subLayers=null,this.usesPickingColorCache=!1}get layer(){return this.component}_fetch(e,n){const r=this.layer,i=r==null?void 0:r.props.fetch;return i?i(n,{propName:e,layer:r}):super._fetch(e,n)}_onResolve(e,n){const r=this.layer;if(r){const i=r.props.onDataLoad;e==="data"&&i&&i(n,{propName:e,layer:r})}}_onError(e,n){const r=this.layer;r&&r.raiseError(n,`loading ${e} of ${this.layer}`)}}const YZ="layer.changeFlag",KZ="layer.initialize",ZZ="layer.update",QZ="layer.finalize",GZ="layer.matched",mA=2**24-1,JZ=Object.freeze([]),eQ=Zf(({oldViewport:t,viewport:e})=>t.equals(e));let Vi=new Uint8ClampedArray(0);const tQ={data:{type:"data",value:JZ,async:!0},dataComparator:{type:"function",value:null,optional:!0},_dataDiff:{type:"function",value:t=>t&&t.__diff,optional:!0},dataTransform:{type:"function",value:null,optional:!0},onDataLoad:{type:"function",value:null,optional:!0},onError:{type:"function",value:null,optional:!0},fetch:{type:"function",value:(t,{propName:e,layer:n,loaders:r,loadOptions:i,signal:a})=>{const{resourceManager:l}=n.context;i=i||n.getLoadOptions(),r=r||n.props.loaders,a&&(i={...i,fetch:{...i==null?void 0:i.fetch,signal:a}});let u=l.contains(t);return!u&&!i&&(l.add({resourceId:t,data:jh(t,r),persistent:!1}),u=!0),u?l.subscribe({resourceId:t,onChange:f=>{var h;return(h=n.internalState)==null?void 0:h.reloadAsyncProp(e,f)},consumerId:n.id,requestId:e}):jh(t,r,i)}},updateTriggers:{},visible:!0,pickable:!1,opacity:{type:"number",min:0,max:1,value:1},operation:"draw",onHover:{type:"function",value:null,optional:!0},onClick:{type:"function",value:null,optional:!0},onDragStart:{type:"function",value:null,optional:!0},onDrag:{type:"function",value:null,optional:!0},onDragEnd:{type:"function",value:null,optional:!0},coordinateSystem:cn.DEFAULT,coordinateOrigin:{type:"array",value:[0,0,0],compare:!0},modelMatrix:{type:"array",value:null,compare:!0,optional:!0},wrapLongitude:!1,positionFormat:"XYZ",colorFormat:"RGBA",parameters:{type:"object",value:{},optional:!0,compare:2},loadOptions:{type:"object",value:null,optional:!0,ignore:!0},transitions:null,extensions:[],loaders:{type:"array",value:[],optional:!0,ignore:!0},getPolygonOffset:{type:"function",value:({layerIndex:t})=>[0,-t*100]},highlightedObjectIndex:null,autoHighlight:!1,highlightColor:{type:"accessor",value:[0,0,128,128]}};class Jf extends cp{constructor(){super(...arguments),this.internalState=null,this.lifecycle=Vl.NO_STATE,this.parent=null}static get componentName(){return Object.prototype.hasOwnProperty.call(this,"layerName")?this.layerName:""}get root(){let e=this;for(;e.parent;)e=e.parent;return e}toString(){return`${this.constructor.layerName||this.constructor.name}({id: '${this.props.id}'})`}project(e){Fr(this.internalState);const n=this.internalState.viewport||this.context.viewport,r=eO(e,{viewport:n,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),[i,a,l]=KM(r,n.pixelProjectionMatrix);return e.length===2?[i,a]:[i,a,l]}unproject(e){return Fr(this.internalState),(this.internalState.viewport||this.context.viewport).unproject(e)}projectPosition(e,n){Fr(this.internalState);const r=this.internalState.viewport||this.context.viewport;return yX(e,{viewport:r,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem,...n})}get isComposite(){return!1}get isDrawable(){return!0}setState(e){this.setChangeFlags({stateChanged:!0}),Object.assign(this.state,e),this.setNeedsRedraw()}setNeedsRedraw(){this.internalState&&(this.internalState.needsRedraw=!0)}setNeedsUpdate(){this.internalState&&(this.context.layerManager.setNeedsUpdate(String(this)),this.internalState.needsUpdate=!0)}get isLoaded(){return this.internalState?!this.internalState.isAsyncPropLoading():!1}get wrapLongitude(){return this.props.wrapLongitude}isPickable(){return this.props.pickable&&this.props.visible}getModels(){const e=this.state;return e&&(e.models||e.model&&[e.model])||[]}setShaderModuleProps(...e){for(const n of this.getModels())n.shaderInputs.setProps(...e)}getAttributeManager(){return this.internalState&&this.internalState.attributeManager}getCurrentLayer(){return this.internalState&&this.internalState.layer}getLoadOptions(){return this.props.loadOptions}use64bitPositions(){const{coordinateSystem:e}=this.props;return e===cn.DEFAULT||e===cn.LNGLAT||e===cn.CARTESIAN}onHover(e,n){return this.props.onHover&&this.props.onHover(e,n)||!1}onClick(e,n){return this.props.onClick&&this.props.onClick(e,n)||!1}nullPickingColor(){return[0,0,0]}encodePickingColor(e,n=[]){return n[0]=e+1&255,n[1]=e+1>>8&255,n[2]=e+1>>8>>8&255,n}decodePickingColor(e){Fr(e instanceof Uint8Array);const[n,r,i]=e;return n+r*256+i*65536-1}getNumInstances(){return Number.isFinite(this.props.numInstances)?this.props.numInstances:this.state&&this.state.numInstances!==void 0?this.state.numInstances:RZ(this.props.data)}getStartIndices(){return this.props.startIndices?this.props.startIndices:this.state&&this.state.startIndices?this.state.startIndices:null}getBounds(){var e;return(e=this.getAttributeManager())==null?void 0:e.getBounds(["positions","instancePositions"])}getShaders(e){e=pA(e,{disableWarnings:!0,modules:this.context.defaultShaderModules});for(const n of this.props.extensions)e=pA(e,n.getShaders.call(this,n));return e}shouldUpdateState(e){return e.changeFlags.propsOrDataChanged}updateState(e){const n=this.getAttributeManager(),{dataChanged:r}=e.changeFlags;if(r&&n)if(Array.isArray(r))for(const i of r)n.invalidateAll(i);else n.invalidateAll();if(n){const{props:i}=e,a=this.internalState.hasPickingBuffer,l=Number.isInteger(i.highlightedObjectIndex)||i.pickable||i.extensions.some(u=>u.getNeedsPickingBuffer.call(this,u));if(a!==l){this.internalState.hasPickingBuffer=l;const{pickingColors:u,instancePickingColors:f}=n.attributes,h=u||f;h&&(l&&h.constant&&(h.constant=!1,n.invalidate(h.id)),!h.value&&!l&&(h.constant=!0,h.value=[0,0,0]))}}}finalizeState(e){for(const r of this.getModels())r.destroy();const n=this.getAttributeManager();n&&n.finalize(),this.context&&this.context.resourceManager.unsubscribe({consumerId:this.id}),this.internalState&&(this.internalState.uniformTransitions.clear(),this.internalState.finalize())}draw(e){for(const n of this.getModels())n.draw(e.renderPass)}getPickingInfo({info:e,mode:n,sourceLayer:r}){const{index:i}=e;return i>=0&&Array.isArray(this.props.data)&&(e.object=this.props.data[i]),e}raiseError(e,n){var r,i,a,l;n&&(e=new Error(`${n}: ${e.message}`,{cause:e})),(i=(r=this.props).onError)!=null&&i.call(r,e)||(l=(a=this.context)==null?void 0:a.onError)==null||l.call(a,e,this)}getNeedsRedraw(e={clearRedrawFlags:!1}){return this._getNeedsRedraw(e)}needsUpdate(){return this.internalState?this.internalState.needsUpdate||this.hasUniformTransition()||this.shouldUpdateState(this._getUpdateParams()):!1}hasUniformTransition(){var e;return((e=this.internalState)==null?void 0:e.uniformTransitions.active)||!1}activateViewport(e){if(!this.internalState)return;const n=this.internalState.viewport;this.internalState.viewport=e,(!n||!eQ({oldViewport:n,viewport:e}))&&(this.setChangeFlags({viewportChanged:!0}),this.isComposite?this.needsUpdate()&&this.setNeedsUpdate():this._update())}invalidateAttribute(e="all"){const n=this.getAttributeManager();n&&(e==="all"?n.invalidateAll():n.invalidate(e))}updateAttributes(e){let n=!1;for(const r in e)e[r].layoutChanged()&&(n=!0);for(const r of this.getModels())this._setModelAttributes(r,e,n)}_updateAttributes(){const e=this.getAttributeManager();if(!e)return;const n=this.props,r=this.getNumInstances(),i=this.getStartIndices();e.update({data:n.data,numInstances:r,startIndices:i,props:n,transitions:n.transitions,buffers:n.data.attributes,context:this});const a=e.getChangedAttributes({clearChangedFlags:!0});this.updateAttributes(a)}_updateAttributeTransition(){const e=this.getAttributeManager();e&&e.updateTransition()}_updateUniformTransition(){const{uniformTransitions:e}=this.internalState;if(e.active){const n=e.update(),r=Object.create(this.props);for(const i in n)Object.defineProperty(r,i,{value:n[i]});return r}return this.props}calculateInstancePickingColors(e,{numInstances:n}){if(e.constant)return;const r=Math.floor(Vi.length/4);if(this.internalState.usesPickingColorCache=!0,rmA&&Sn.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),Vi=Nf.allocate(Vi,n,{size:4,copy:!0,maxCount:Math.max(n,mA)});const i=Math.floor(Vi.length/4),a=[0,0,0];for(let l=r;l(Sn.deprecated("layer.state.attributeManager","layer.getAttributeManager()")(),e)}),this.internalState.uniformTransitions=new _Z(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props),this.initializeState(this.context);for(const n of this.props.extensions)n.initializeState.call(this,this.context,n);this.setChangeFlags({dataChanged:"init",propsChanged:"init",viewportChanged:!0,extensionsChanged:!0}),this._update()}_transferState(e){Hr(GZ,this,this===e);const{state:n,internalState:r}=e;this!==e&&(this.internalState=r,this.state=n,this.internalState.setAsyncProps(this.props),this._diffProps(this.props,this.internalState.getOldProps()))}_update(){const e=this.needsUpdate();if(Hr(ZZ,this,e),!e)return;const n=this.props,r=this.context,i=this.internalState,a=r.viewport,l=this._updateUniformTransition();i.propsInTransition=l,r.viewport=i.viewport||a,this.props=l;try{const u=this._getUpdateParams(),f=this.getModels();if(r.device)this.updateState(u);else try{this.updateState(u)}catch{}for(const g of this.props.extensions)g.updateState.call(this,u,g);this.setNeedsRedraw(),this._updateAttributes();const h=this.getModels()[0]!==f[0];this._postUpdate(u,h)}finally{r.viewport=a,this.props=n,this._clearChangeFlags(),i.needsUpdate=!1,i.resetOldProps()}}_finalize(){Hr(QZ,this),this.finalizeState(this.context);for(const e of this.props.extensions)e.finalizeState.call(this,this.context,e)}_drawLayer({renderPass:e,shaderModuleProps:n=null,uniforms:r={},parameters:i={}}){this._updateAttributeTransition();const a=this.props,l=this.context;this.props=this.internalState.propsInTransition||a;try{n&&this.setShaderModuleProps(n);const{getPolygonOffset:u}=this.props,f=u&&u(r)||[0,0];l.device instanceof Ba&&l.device.setParametersWebGL({polygonOffset:f});for(const h of this.getModels())h.setParameters(i);if(l.device instanceof Ba)l.device.withParametersWebGL(i,()=>{const h={renderPass:e,shaderModuleProps:n,uniforms:r,parameters:i,context:l};for(const g of this.props.extensions)g.draw.call(this,h,g);this.draw(h)});else{const h={renderPass:e,shaderModuleProps:n,uniforms:r,parameters:i,context:l};for(const g of this.props.extensions)g.draw.call(this,h,g);this.draw(h)}}finally{this.props=a}}getChangeFlags(){var e;return(e=this.internalState)==null?void 0:e.changeFlags}setChangeFlags(e){if(!this.internalState)return;const{changeFlags:n}=this.internalState;for(const i in e)if(e[i]){let a=!1;switch(i){case"dataChanged":const l=e[i],u=n[i];l&&Array.isArray(u)&&(n.dataChanged=Array.isArray(l)?u.concat(l):l,a=!0);default:n[i]||(n[i]=e[i],a=!0)}a&&Hr(YZ,this,i,e)}const r=!!(n.dataChanged||n.updateTriggersChanged||n.propsChanged||n.extensionsChanged);n.propsOrDataChanged=r,n.somethingChanged=r||n.viewportChanged||n.stateChanged}_clearChangeFlags(){this.internalState.changeFlags={dataChanged:!1,propsChanged:!1,updateTriggersChanged:!1,viewportChanged:!1,stateChanged:!1,extensionsChanged:!1,propsOrDataChanged:!1,somethingChanged:!1}}_diffProps(e,n){var i;const r=bZ(e,n);if(r.updateTriggersChanged)for(const a in r.updateTriggersChanged)r.updateTriggersChanged[a]&&this.invalidateAttribute(a);if(r.transitionsChanged)for(const a in r.transitionsChanged)this.internalState.uniformTransitions.add(a,n[a],e[a],(i=e.transitions)==null?void 0:i[a]);return this.setChangeFlags(r)}validateProps(){yZ(this.props)}updateAutoHighlight(e){this.props.autoHighlight&&!Number.isInteger(this.props.highlightedObjectIndex)&&this._updateAutoHighlight(e)}_updateAutoHighlight(e){const n={highlightedObjectColor:e.picked?e.color:null},{highlightColor:r}=this.props;e.picked&&typeof r=="function"&&(n.highlightColor=r(e)),this.setShaderModuleProps({picking:n}),this.setNeedsRedraw()}_getAttributeManager(){const e=this.context;return new hZ(e.device,{id:this.props.id,stats:e.stats,timeline:e.timeline})}_postUpdate(e,n){const{props:r,oldProps:i}=e,a=this.state.model;a!=null&&a.isInstanced&&a.setInstanceCount(this.getNumInstances());const{autoHighlight:l,highlightedObjectIndex:u,highlightColor:f}=r;if(n||i.autoHighlight!==l||i.highlightedObjectIndex!==u||i.highlightColor!==f){const h={};Array.isArray(f)&&(h.highlightColor=f),(n||i.autoHighlight!==l||u!==i.highlightedObjectIndex)&&(h.highlightedObjectColor=Number.isFinite(u)&&u>=0?this.encodePickingColor(u):null),this.setShaderModuleProps({picking:h})}}_getUpdateParams(){return{props:this.props,oldProps:this.internalState.getOldProps(),context:this.context,changeFlags:this.internalState.changeFlags}}_getNeedsRedraw(e){if(!this.internalState)return!1;let n=!1;n=n||this.internalState.needsRedraw&&this.id;const r=this.getAttributeManager(),i=r?r.getNeedsRedraw(e):!1;if(n=n||i,n)for(const a of this.props.extensions)a.onNeedsRedraw.call(this,a);return this.internalState.needsRedraw=this.internalState.needsRedraw&&!e.clearRedrawFlags,n}_onAsyncPropUpdated(){this._diffProps(this.props,this.internalState.getOldProps()),this.setNeedsUpdate()}}Jf.defaultProps=tQ;Jf.layerName="Layer";const vA=`uniform scatterplotUniforms { - float radiusScale; - float radiusMinPixels; - float radiusMaxPixels; - float lineWidthScale; - float lineWidthMinPixels; - float lineWidthMaxPixels; - float stroked; - bool filled; - bool antialiasing; - bool billboard; - highp int radiusUnits; - highp int lineWidthUnits; -} scatterplot; -`,nQ={name:"scatterplot",vs:vA,fs:vA,uniformTypes:{radiusScale:"f32",radiusMinPixels:"f32",radiusMaxPixels:"f32",lineWidthScale:"f32",lineWidthMinPixels:"f32",lineWidthMaxPixels:"f32",stroked:"f32",filled:"f32",antialiasing:"f32",billboard:"f32",radiusUnits:"i32",lineWidthUnits:"i32"}},rQ=`#version 300 es -#define SHADER_NAME scatterplot-layer-vertex-shader -in vec3 positions; -in vec3 instancePositions; -in vec3 instancePositions64Low; -in float instanceRadius; -in float instanceLineWidths; -in vec4 instanceFillColors; -in vec4 instanceLineColors; -in vec3 instancePickingColors; -out vec4 vFillColor; -out vec4 vLineColor; -out vec2 unitPosition; -out float innerUnitRadius; -out float outerRadiusPixels; -void main(void) { -geometry.worldPosition = instancePositions; -outerRadiusPixels = clamp( -project_size_to_pixel(scatterplot.radiusScale * instanceRadius, scatterplot.radiusUnits), -scatterplot.radiusMinPixels, scatterplot.radiusMaxPixels -); -float lineWidthPixels = clamp( -project_size_to_pixel(scatterplot.lineWidthScale * instanceLineWidths, scatterplot.lineWidthUnits), -scatterplot.lineWidthMinPixels, scatterplot.lineWidthMaxPixels -); -outerRadiusPixels += scatterplot.stroked * lineWidthPixels / 2.0; -float edgePadding = scatterplot.antialiasing ? (outerRadiusPixels + SMOOTH_EDGE_RADIUS) / outerRadiusPixels : 1.0; -unitPosition = edgePadding * positions.xy; -geometry.uv = unitPosition; -geometry.pickingColor = instancePickingColors; -innerUnitRadius = 1.0 - scatterplot.stroked * lineWidthPixels / outerRadiusPixels; -if (scatterplot.billboard) { -gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position); -DECKGL_FILTER_GL_POSITION(gl_Position, geometry); -vec3 offset = edgePadding * positions * outerRadiusPixels; -DECKGL_FILTER_SIZE(offset, geometry); -gl_Position.xy += project_pixel_size_to_clipspace(offset.xy); -} else { -vec3 offset = edgePadding * positions * project_pixel_size(outerRadiusPixels); -DECKGL_FILTER_SIZE(offset, geometry); -gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset, geometry.position); -DECKGL_FILTER_GL_POSITION(gl_Position, geometry); -} -vFillColor = vec4(instanceFillColors.rgb, instanceFillColors.a * layer.opacity); -DECKGL_FILTER_COLOR(vFillColor, geometry); -vLineColor = vec4(instanceLineColors.rgb, instanceLineColors.a * layer.opacity); -DECKGL_FILTER_COLOR(vLineColor, geometry); -} -`,iQ=`#version 300 es -#define SHADER_NAME scatterplot-layer-fragment-shader -precision highp float; -in vec4 vFillColor; -in vec4 vLineColor; -in vec2 unitPosition; -in float innerUnitRadius; -in float outerRadiusPixels; -out vec4 fragColor; -void main(void) { -geometry.uv = unitPosition; -float distToCenter = length(unitPosition) * outerRadiusPixels; -float inCircle = scatterplot.antialiasing ? -smoothedge(distToCenter, outerRadiusPixels) : -step(distToCenter, outerRadiusPixels); -if (inCircle == 0.0) { -discard; -} -if (scatterplot.stroked > 0.5) { -float isLine = scatterplot.antialiasing ? -smoothedge(innerUnitRadius * outerRadiusPixels, distToCenter) : -step(innerUnitRadius * outerRadiusPixels, distToCenter); -if (scatterplot.filled) { -fragColor = mix(vFillColor, vLineColor, isLine); -} else { -if (isLine == 0.0) { -discard; -} -fragColor = vec4(vLineColor.rgb, vLineColor.a * isLine); -} -} else if (scatterplot.filled == false) { -discard; -} else { -fragColor = vFillColor; -} -fragColor.a *= inCircle; -DECKGL_FILTER_COLOR(fragColor, geometry); -} -`,_A=[0,0,0,255],sQ={radiusUnits:"meters",radiusScale:{type:"number",min:0,value:1},radiusMinPixels:{type:"number",min:0,value:0},radiusMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},lineWidthUnits:"meters",lineWidthScale:{type:"number",min:0,value:1},lineWidthMinPixels:{type:"number",min:0,value:0},lineWidthMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},stroked:!1,filled:!0,billboard:!1,antialiasing:!0,getPosition:{type:"accessor",value:t=>t.position},getRadius:{type:"accessor",value:1},getFillColor:{type:"accessor",value:_A},getLineColor:{type:"accessor",value:_A},getLineWidth:{type:"accessor",value:1},strokeWidth:{deprecatedFor:"getLineWidth"},outline:{deprecatedFor:"stroked"},getColor:{deprecatedFor:["getFillColor","getLineColor"]}};class Cb extends Jf{getShaders(){return super.getShaders({vs:rQ,fs:iQ,modules:[WM,QM,nQ]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:"float64",fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceRadius:{size:1,transition:!0,accessor:"getRadius",defaultValue:1},instanceFillColors:{size:this.props.colorFormat.length,transition:!0,type:"unorm8",accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:this.props.colorFormat.length,transition:!0,type:"unorm8",accessor:"getLineColor",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:"getLineWidth",defaultValue:1}})}updateState(e){var n;super.updateState(e),e.changeFlags.extensionsChanged&&((n=this.state.model)==null||n.destroy(),this.state.model=this._getModel(),this.getAttributeManager().invalidateAll())}draw({uniforms:e}){const{radiusUnits:n,radiusScale:r,radiusMinPixels:i,radiusMaxPixels:a,stroked:l,filled:u,billboard:f,antialiasing:h,lineWidthUnits:g,lineWidthScale:m,lineWidthMinPixels:v,lineWidthMaxPixels:S}=this.props,w={stroked:l,filled:u,billboard:f,antialiasing:h,radiusUnits:zo[n],radiusScale:r,radiusMinPixels:i,radiusMaxPixels:a,lineWidthUnits:zo[g],lineWidthScale:m,lineWidthMinPixels:v,lineWidthMaxPixels:S},E=this.state.model;E.shaderInputs.setProps({scatterplot:w}),E.draw(this.context.renderPass)}_getModel(){const e=[-1,-1,0,1,-1,0,-1,1,0,1,1,0];return new $o(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),geometry:new vb({topology:"triangle-strip",attributes:{positions:{size:3,value:new Float32Array(e)}}}),isInstanced:!0})}}Cb.defaultProps=sQ;Cb.layerName="ScatterplotLayer";const aQ={COUNTER_CLOCKWISE:-1};function oQ(t,e,n={}){return lQ(t,n)!==e?(uQ(t,n),!0):!1}function lQ(t,e={}){return Math.sign(cQ(t,e))}const yA={x:0,y:1,z:2};function cQ(t,e={}){const{start:n=0,end:r=t.length,plane:i="xy"}=e,a=e.size||2;let l=0;const u=yA[i[0]],f=yA[i[1]];for(let h=n,g=r-a;h=r),i=i.flatMap(S=>[S[0],S[1]]),oQ(i,aQ.COUNTER_CLOCKWISE));const a=n>0,l=r+1,u=a?l*3+1:r,f=Math.PI*2/r,h=new Uint16Array(a?r*3*2:0),g=new Float32Array(u*3),m=new Float32Array(u*3);let v=0;if(a){for(let S=0;S",extruded:"f32",stroked:"f32",isStroke:"f32",coverage:"f32",elevationScale:"f32",edgeDistance:"f32",widthScale:"f32",widthMinPixels:"f32",widthMaxPixels:"f32",radiusUnits:"i32",widthUnits:"i32"}},gQ=`#version 300 es -#define SHADER_NAME column-layer-vertex-shader -in vec3 positions; -in vec3 normals; -in vec3 instancePositions; -in float instanceElevations; -in vec3 instancePositions64Low; -in vec4 instanceFillColors; -in vec4 instanceLineColors; -in float instanceStrokeWidths; -in vec3 instancePickingColors; -out vec4 vColor; -#ifdef FLAT_SHADING -out vec3 cameraPosition; -out vec4 position_commonspace; -#endif -void main(void) { -geometry.worldPosition = instancePositions; -vec4 color = column.isStroke ? instanceLineColors : instanceFillColors; -mat2 rotationMatrix = mat2(cos(column.angle), sin(column.angle), -sin(column.angle), cos(column.angle)); -float elevation = 0.0; -float strokeOffsetRatio = 1.0; -if (column.extruded) { -elevation = instanceElevations * (positions.z + 1.0) / 2.0 * column.elevationScale; -} else if (column.stroked) { -float widthPixels = clamp( -project_size_to_pixel(instanceStrokeWidths * column.widthScale, column.widthUnits), -column.widthMinPixels, column.widthMaxPixels) / 2.0; -float halfOffset = project_pixel_size(widthPixels) / project_size(column.edgeDistance * column.coverage * column.radius); -if (column.isStroke) { -strokeOffsetRatio -= sign(positions.z) * halfOffset; -} else { -strokeOffsetRatio -= halfOffset; -} -} -float shouldRender = float(color.a > 0.0 && instanceElevations >= 0.0); -float dotRadius = column.radius * column.coverage * shouldRender; -geometry.pickingColor = instancePickingColors; -vec3 centroidPosition = vec3(instancePositions.xy, instancePositions.z + elevation); -vec3 centroidPosition64Low = instancePositions64Low; -vec2 offset = (rotationMatrix * positions.xy * strokeOffsetRatio + column.offset) * dotRadius; -if (column.radiusUnits == UNIT_METERS) { -offset = project_size(offset); -} -vec3 pos = vec3(offset, 0.); -DECKGL_FILTER_SIZE(pos, geometry); -gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64Low, pos, geometry.position); -geometry.normal = project_normal(vec3(rotationMatrix * normals.xy, normals.z)); -DECKGL_FILTER_GL_POSITION(gl_Position, geometry); -if (column.extruded && !column.isStroke) { -#ifdef FLAT_SHADING -cameraPosition = project.cameraPosition; -position_commonspace = geometry.position; -vColor = vec4(color.rgb, color.a * layer.opacity); -#else -vec3 lightColor = lighting_getLightColor(color.rgb, project.cameraPosition, geometry.position.xyz, geometry.normal); -vColor = vec4(lightColor, color.a * layer.opacity); -#endif -} else { -vColor = vec4(color.rgb, color.a * layer.opacity); -} -DECKGL_FILTER_COLOR(vColor, geometry); -} -`,pQ=`#version 300 es -#define SHADER_NAME column-layer-fragment-shader -precision highp float; -out vec4 fragColor; -in vec4 vColor; -#ifdef FLAT_SHADING -in vec3 cameraPosition; -in vec4 position_commonspace; -#endif -void main(void) { -fragColor = vColor; -geometry.uv = vec2(0.); -#ifdef FLAT_SHADING -if (column.extruded && !column.isStroke && !bool(picking.isActive)) { -vec3 normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz))); -fragColor.rgb = lighting_getLightColor(vColor.rgb, cameraPosition, position_commonspace.xyz, normal); -} -#endif -DECKGL_FILTER_COLOR(fragColor, geometry); -} -`,xg=[0,0,0,255],mQ={diskResolution:{type:"number",min:4,value:20},vertices:null,radius:{type:"number",min:0,value:1e3},angle:{type:"number",value:0},offset:{type:"array",value:[0,0]},coverage:{type:"number",min:0,max:1,value:1},elevationScale:{type:"number",min:0,value:1},radiusUnits:"meters",lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,extruded:!0,wireframe:!1,filled:!0,stroked:!1,flatShading:!1,getPosition:{type:"accessor",value:t=>t.position},getFillColor:{type:"accessor",value:xg},getLineColor:{type:"accessor",value:xg},getLineWidth:{type:"accessor",value:1},getElevation:{type:"accessor",value:1e3},material:!0,getColor:{deprecatedFor:["getFillColor","getLineColor"]}};class Ab extends Jf{getShaders(){const e={},{flatShading:n}=this.props;return n&&(e.FLAT_SHADING=1),super.getShaders({vs:gQ,fs:pQ,defines:e,modules:[WM,n?IM:NM,QM,hQ]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:"float64",fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceElevations:{size:1,transition:!0,accessor:"getElevation"},instanceFillColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getFillColor",defaultValue:xg},instanceLineColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getLineColor",defaultValue:xg},instanceStrokeWidths:{size:1,accessor:"getLineWidth",transition:!0}})}updateState(e){var u;super.updateState(e);const{props:n,oldProps:r,changeFlags:i}=e,a=i.extensionsChanged||n.flatShading!==r.flatShading;a&&((u=this.state.models)==null||u.forEach(f=>f.destroy()),this.setState(this._getModels()),this.getAttributeManager().invalidateAll());const l=this.getNumInstances();this.state.fillModel.setInstanceCount(l),this.state.wireframeModel.setInstanceCount(l),(a||n.diskResolution!==r.diskResolution||n.vertices!==r.vertices||(n.extruded||n.stroked)!==(r.extruded||r.stroked))&&this._updateGeometry(n)}getGeometry(e,n,r){const i=new fQ({radius:1,height:r?2:0,vertices:n,nradial:e});let a=0;if(n)for(let l=0;lUO(n,e));if(up(t)){if(bQ(t))return e.style=yQ,_.cloneElement(t,e);if(SQ(t))return _.cloneElement(t,e)}return t}function up(t){return t&&typeof t=="object"&&"type"in t||!1}function bQ(t){var e;return(e=t.props)==null?void 0:e.mapStyle}function SQ(t){const e=t.type;return e&&e.deckGLViewProps}function _y(t){if(typeof t=="function")return _.createElement(Dc,{},t);if(Array.isArray(t))return t.map(_y);if(up(t)){if(t.type===_.Fragment)return _y(t.props.children);if(Mg(t.type,Dc))return t}return t}function EQ({children:t,layers:e=[],views:n=null}){const r=[],i=[],a={};return _.Children.forEach(_y(t),l=>{if(up(l)){const u=l.type;if(Mg(u,Jf)){const f=wQ(u,l.props);i.push(f)}else r.push(l);if(Mg(u,Dc)&&u!==Dc&&l.props.id){const f=new u(l.props);a[f.id]=f}}else l&&r.push(l)}),Object.keys(a).length>0&&(Array.isArray(n)?n.forEach(l=>{a[l.id]=l}):n&&(a[n.id]=n),n=Object.values(a)),e=i.length>0?[...i,...e]:e,{layers:e,children:r,views:n}}function wQ(t,e){const n={},r=t.defaultProps||{};for(const i in e)r[i]!==e[i]&&(n[i]=e[i]);return new t(n)}const TQ=_.createContext();function CQ({children:t,deck:e,ContextProvider:n=TQ.Provider}){const{viewManager:r}=e||{};if(!r||!r.views.length)return[];const i={},a=r.views[0].id;for(const l of t){let u=a,f=l;up(l)&&Mg(l.type,Dc)&&(u=l.props.id||a,f=l.props.children);const h=r.getViewport(u),g=r.getViewState(u);if(h){g.padding=h.padding;const{x:m,y:v,width:S,height:w}=h;f=UO(f,{x:m,y:v,width:S,height:w,viewport:h,viewState:g}),i[u]||(i[u]={viewport:h,children:[]}),i[u].children.push(f)}}return Object.keys(i).map(l=>{const{viewport:u,children:f}=i[l],{x:h,y:g,width:m,height:v}=u,S={position:"absolute",left:h,top:g,width:m,height:v},w=`view-${l}`,E=_.createElement("div",{key:w,id:w,style:S},...f),b={deck:e,viewport:u,container:e.canvas.offsetParent,eventManager:e.eventManager,onViewStateChange:T=>{T.viewId=l,e._onViewStateChange(T)},widgets:[]},C=`view-${l}-context`;return _.createElement(n,{key:C,value:b},E)})}const AQ={mixBlendMode:null};function RQ({width:t,height:e,style:n}){const r={position:"absolute",zIndex:0,left:0,top:0,width:t,height:e},i={left:0,top:0};if(n)for(const a in n)a in AQ?i[a]=n[a]:r[a]=n[a];return{containerStyle:r,canvasStyle:i}}function xQ(t){return{get deck(){return t.deck},pickObject:e=>t.deck.pickObject(e),pickMultipleObjects:e=>t.deck.pickMultipleObjects(e),pickObjects:e=>t.deck.pickObjects(e)}}function LO(t){t.redrawReason&&(t.deck._drawLayers(t.redrawReason),t.redrawReason=null)}function MQ(t,e,n){const r=new e({...n,_customRender:i=>{t.redrawReason=i;const a=r.getViewports();t.lastRenderedViewports!==a?t.forceUpdate():LO(t)}});return r}function OQ(t,e){const[n,r]=_.useState(0),a=_.useRef({control:null,version:n,forceUpdate:()=>r(x=>x+1)}).current,l=_.useRef(null),u=_.useRef(null),f=_.useMemo(()=>EQ(t),[t.layers,t.views,t.children]);let h=!0;const g=x=>{var N;return h&&t.viewState?(a.viewStateUpdateRequested=x,null):(a.viewStateUpdateRequested=null,(N=t.onViewStateChange)==null?void 0:N.call(t,x))},m=x=>{var N;h?a.interactionStateUpdateRequested=x:(a.interactionStateUpdateRequested=null,(N=t.onInteractionStateChange)==null||N.call(t,x))},v=_.useMemo(()=>{const x={widgets:[],...t,style:null,width:"100%",height:"100%",parent:l.current,canvas:u.current,layers:f.layers,views:f.views,onViewStateChange:g,onInteractionStateChange:m};return delete x._customRender,a.deck&&a.deck.setProps(x),x},[t]);_.useEffect(()=>{const x=t.Deck||wb;return a.deck=MQ(a,x,{...v,parent:l.current,canvas:u.current}),()=>{var N;return(N=a.deck)==null?void 0:N.finalize()}},[]),_Q(()=>{LO(a);const{viewStateUpdateRequested:x,interactionStateUpdateRequested:N}=a;x&&g(x),N&&m(N)}),_.useImperativeHandle(e,()=>xQ(a),[]);const S=a.deck&&a.deck.isInitialized?a.deck.getViewports():void 0,{ContextProvider:w,width:E="100%",height:b="100%",id:C,style:T}=t,{containerStyle:A,canvasStyle:O}=_.useMemo(()=>RQ({width:E,height:b,style:T}),[E,b,T]);if(!a.viewStateUpdateRequested&&a.lastRenderedViewports===S||a.version!==n){a.lastRenderedViewports=S,a.version=n;const x=CQ({children:f.children,deck:a.deck,ContextProvider:w}),N=_.createElement("canvas",{key:"canvas",id:C||"deckgl-overlay",ref:u,style:O});a.control=_.createElement("div",{id:`${C||"deckgl"}-wrapper`,ref:l,style:A},[N,x])}return h=!1,a.control}const PQ=_.forwardRef(OQ),NQ=_.createContext(null);function IQ(t,e){const n=Array.isArray(t)?t[0]:t?t.x:0,r=Array.isArray(t)?t[1]:t?t.y:0,i=Array.isArray(e)?e[0]:e?e.x:0,a=Array.isArray(e)?e[1]:e?e.y:0;return n===i&&r===a}function ps(t,e){if(t===e)return!0;if(!t||!e)return!1;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let n=0;n{let i=null;"interactive"in r&&(i=Object.assign({},r),delete i.interactive);const a=e[r.ref];if(a){i=i||Object.assign({},r),delete i.ref;for(const l of DQ)l in a&&(i[l]=a[l])}return i||r});return{...t,layers:n}}const TA={version:8,sources:{},layers:[]},CA={mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",click:"onClick",dblclick:"onDblClick",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mouseout:"onMouseOut",contextmenu:"onContextMenu",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",touchcancel:"onTouchCancel"},AA={movestart:"onMoveStart",move:"onMove",moveend:"onMoveEnd",dragstart:"onDragStart",drag:"onDrag",dragend:"onDragEnd",zoomstart:"onZoomStart",zoom:"onZoom",zoomend:"onZoomEnd",rotatestart:"onRotateStart",rotate:"onRotate",rotateend:"onRotateEnd",pitchstart:"onPitchStart",pitch:"onPitch",pitchend:"onPitchEnd"},RA={wheel:"onWheel",boxzoomstart:"onBoxZoomStart",boxzoomend:"onBoxZoomEnd",boxzoomcancel:"onBoxZoomCancel",resize:"onResize",load:"onLoad",render:"onRender",idle:"onIdle",remove:"onRemove",data:"onData",styledata:"onStyleData",sourcedata:"onSourceData",error:"onError"},FQ=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],kQ=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"];class kc{constructor(e,n,r){this._map=null,this._internalUpdate=!1,this._hoveredFeatures=null,this._propsedCameraUpdate=null,this._styleComponents={},this._onEvent=i=>{const a=this.props[RA[i.type]];a?a(i):i.type==="error"&&console.error(i.error)},this._onCameraEvent=i=>{if(this._internalUpdate)return;i.viewState=this._propsedCameraUpdate||SA(this._map.transform);const a=this.props[AA[i.type]];a&&a(i)},this._onCameraUpdate=i=>this._internalUpdate?i:(this._propsedCameraUpdate=SA(i),EA(i,this.props)),this._onPointerEvent=i=>{(i.type==="mousemove"||i.type==="mouseout")&&this._updateHover(i);const a=this.props[CA[i.type]];a&&(this.props.interactiveLayerIds&&i.type!=="mouseover"&&i.type!=="mouseout"&&(i.features=this._hoveredFeatures||this._queryRenderedFeatures(i.point)),a(i),delete i.features)},this._MapClass=e,this.props=n,this._initialize(r)}get map(){return this._map}setProps(e){const n=this.props;this.props=e;const r=this._updateSettings(e,n),i=this._updateSize(e),a=this._updateViewState(e);this._updateStyle(e,n),this._updateStyleComponents(e),this._updateHandlers(e,n),(r||i||a&&!this._map.isMoving())&&this.redraw()}static reuse(e,n){const r=kc.savedMaps.pop();if(!r)return null;const i=r.map,a=i.getContainer();for(n.className=a.className;a.childNodes.length>0;)n.appendChild(a.childNodes[0]);i._container=n;const l=i._resizeObserver;l&&(l.disconnect(),l.observe(n)),r.setProps({...e,styleDiffing:!1}),i.resize();const{initialViewState:u}=e;return u&&(u.bounds?i.fitBounds(u.bounds,{...u.fitBoundsOptions,duration:0}):r._updateViewState(u)),i.isStyleLoaded()?i.fire("load"):i.once("style.load",()=>i.fire("load")),i._update(),r}_initialize(e){const{props:n}=this,{mapStyle:r=TA}=n,i={...n,...n.initialViewState,container:e,style:wA(r)},a=i.initialViewState||i.viewState||i;if(Object.assign(i,{center:[a.longitude||0,a.latitude||0],zoom:a.zoom||0,pitch:a.pitch||0,bearing:a.bearing||0}),n.gl){const u=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=u,n.gl)}const l=new this._MapClass(i);a.padding&&l.setPadding(a.padding),n.cursor&&(l.getCanvas().style.cursor=n.cursor),l.transformCameraUpdate=this._onCameraUpdate,l.on("style.load",()=>{var u;this._styleComponents={light:l.getLight(),sky:l.getSky(),projection:(u=l.getProjection)==null?void 0:u.call(l),terrain:l.getTerrain()},this._updateStyleComponents(this.props)}),l.on("sourcedata",()=>{this._updateStyleComponents(this.props)});for(const u in CA)l.on(u,this._onPointerEvent);for(const u in AA)l.on(u,this._onCameraEvent);for(const u in RA)l.on(u,this._onEvent);this._map=l}recycle(){const n=this.map.getContainer().querySelector("[mapboxgl-children]");n==null||n.remove(),kc.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){const e=this._map;e.style&&(e._frame&&(e._frame.cancel(),e._frame=null),e._render())}_updateSize(e){const{viewState:n}=e;if(n){const r=this._map;if(n.width!==r.transform.width||n.height!==r.transform.height)return r.resize(),!0}return!1}_updateViewState(e){const n=this._map,r=n.transform;if(!n.isMoving()){const a=EA(r,e);if(Object.keys(a).length>0)return this._internalUpdate=!0,n.jumpTo(a),this._internalUpdate=!1,!0}return!1}_updateSettings(e,n){const r=this._map;let i=!1;for(const a of FQ)if(a in e&&!ps(e[a],n[a])){i=!0;const l=r[`set${a[0].toUpperCase()}${a.slice(1)}`];l==null||l.call(r,e[a])}return i}_updateStyle(e,n){if(e.cursor!==n.cursor&&(this._map.getCanvas().style.cursor=e.cursor||""),e.mapStyle!==n.mapStyle){const{mapStyle:r=TA,styleDiffing:i=!0}=e,a={diff:i};"localIdeographFontFamily"in e&&(a.localIdeographFontFamily=e.localIdeographFontFamily),this._map.setStyle(wA(r),a)}}_updateStyleComponents({light:e,projection:n,sky:r,terrain:i}){var u,f;const a=this._map,l=this._styleComponents;a.style._loaded&&(e&&!ps(e,l.light)&&(l.light=e,a.setLight(e)),n&&!ps(n,l.projection)&&n!==((u=l.projection)==null?void 0:u.type)&&(l.projection=typeof n=="string"?{type:n}:n,(f=a.setProjection)==null||f.call(a,l.projection)),r&&!ps(r,l.sky)&&(l.sky=r,a.setSky(r)),i!==void 0&&!ps(i,l.terrain)&&(!i||a.getSource(i.source))&&(l.terrain=i,a.setTerrain(i)))}_updateHandlers(e,n){const r=this._map;for(const i of kQ){const a=e[i]??!0,l=n[i]??!0;ps(a,l)||(a?r[i].enable(a):r[i].disable())}}_queryRenderedFeatures(e){const n=this._map,{interactiveLayerIds:r=[]}=this.props;try{return n.queryRenderedFeatures(e,{layers:r.filter(n.getLayer.bind(n))})}catch{return[]}}_updateHover(e){var i;const{props:n}=this;if(n.interactiveLayerIds&&(n.onMouseMove||n.onMouseEnter||n.onMouseLeave)){const a=e.type,l=((i=this._hoveredFeatures)==null?void 0:i.length)>0,u=this._queryRenderedFeatures(e.point),f=u.length>0;!f&&l&&(e.type="mouseleave",this._onPointerEvent(e)),this._hoveredFeatures=u,f&&!l&&(e.type="mouseenter",this._onPointerEvent(e)),e.type=a}else this._hoveredFeatures=null}}kc.savedMaps=[];const BQ=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function UQ(t){if(!t)return null;const e=t.map,n={getMap:()=>e};for(const r of LQ(e))!(r in n)&&!BQ.includes(r)&&(n[r]=e[r].bind(e));return n}function LQ(t){const e=new Set;let n=t;for(;n;){for(const r of Object.getOwnPropertyNames(n))r[0]!=="_"&&typeof t[r]=="function"&&r!=="fire"&&r!=="setEventedParent"&&e.add(r);n=Object.getPrototypeOf(n)}return Array.from(e)}const zQ=typeof document<"u"?_.useLayoutEffect:_.useEffect;function $Q(t,e){const{RTLTextPlugin:n,maxParallelImageRequests:r,workerCount:i,workerUrl:a}=e;if(n&&t.getRTLTextPluginStatus&&t.getRTLTextPluginStatus()==="unavailable"){const{pluginUrl:l,lazy:u=!0}=typeof n=="string"?{pluginUrl:n}:n;t.setRTLTextPlugin(l,f=>{f&&console.error(f)},u)}r!==void 0&&t.setMaxParallelImageRequests(r),i!==void 0&&t.setWorkerCount(i),a!==void 0&&t.setWorkerUrl(a)}const fp=_.createContext(null);function VQ(t,e){const n=_.useContext(NQ),[r,i]=_.useState(null),a=_.useRef(),{current:l}=_.useRef({mapLib:null,map:null});_.useEffect(()=>{const h=t.mapLib;let g=!0,m;return Promise.resolve(h||xI(()=>import("./maplibre-gl-CaxPo2JM.js").then(v=>v.m),[])).then(v=>{if(!g)return;if(!v)throw new Error("Invalid mapLib");const S="Map"in v?v:v.default;if(!S.Map)throw new Error("Invalid mapLib");if($Q(S,t),!S.supported||S.supported(t))t.reuseMaps&&(m=kc.reuse(t,a.current)),m||(m=new kc(S.Map,t,a.current)),l.map=UQ(m),l.mapLib=S,i(m),n==null||n.onMapMount(l.map,t.id);else throw new Error("Map is not supported by this browser")}).catch(v=>{const{onError:S}=t;S?S({type:"error",target:null,originalEvent:null,error:v}):console.error(v)}),()=>{g=!1,m&&(n==null||n.onMapUnmount(t.id),t.reuseMaps?m.recycle():m.destroy())}},[]),zQ(()=>{r&&r.setProps(t)}),_.useImperativeHandle(e,()=>l.map,[r]);const u=_.useMemo(()=>({position:"relative",width:"100%",height:"100%",...t.style}),[t.style]),f={height:"100%"};return _.createElement("div",{id:t.id,ref:a,style:u},r&&_.createElement(fp.Provider,{value:l},_.createElement("div",{"mapboxgl-children":"",style:f},t.children)))}const HQ=_.forwardRef(VQ),jQ=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function Ys(t,e){if(!t||!e)return;const n=t.style;for(const r in e){const i=e[r];Number.isFinite(i)&&!jQ.test(r)?n[r]=`${i}px`:n[r]=i}}_.memo(_.forwardRef((t,e)=>{const{map:n,mapLib:r}=_.useContext(fp),i=_.useRef({props:t});i.current.props=t;const a=_.useMemo(()=>{let E=!1;_.Children.forEach(t.children,T=>{T&&(E=!0)});const b={...t,element:E?document.createElement("div"):null},C=new r.Marker(b);return C.setLngLat([t.longitude,t.latitude]),C.getElement().addEventListener("click",T=>{var A,O;(O=(A=i.current.props).onClick)==null||O.call(A,{type:"click",target:C,originalEvent:T})}),C.on("dragstart",T=>{var O,x;const A=T;A.lngLat=a.getLngLat(),(x=(O=i.current.props).onDragStart)==null||x.call(O,A)}),C.on("drag",T=>{var O,x;const A=T;A.lngLat=a.getLngLat(),(x=(O=i.current.props).onDrag)==null||x.call(O,A)}),C.on("dragend",T=>{var O,x;const A=T;A.lngLat=a.getLngLat(),(x=(O=i.current.props).onDragEnd)==null||x.call(O,A)}),C},[]);_.useEffect(()=>(a.addTo(n.getMap()),()=>{a.remove()}),[]);const{longitude:l,latitude:u,offset:f,style:h,draggable:g=!1,popup:m=null,rotation:v=0,rotationAlignment:S="auto",pitchAlignment:w="auto"}=t;return _.useEffect(()=>{Ys(a.getElement(),h)},[h]),_.useImperativeHandle(e,()=>a,[]),(a.getLngLat().lng!==l||a.getLngLat().lat!==u)&&a.setLngLat([l,u]),f&&!IQ(a.getOffset(),f)&&a.setOffset(f),a.isDraggable()!==g&&a.setDraggable(g),a.getRotation()!==v&&a.setRotation(v),a.getRotationAlignment()!==S&&a.setRotationAlignment(S),a.getPitchAlignment()!==w&&a.setPitchAlignment(w),a.getPopup()!==m&&a.setPopup(m),za.createPortal(t.children,a.getElement())}));function xA(t){return new Set(t?t.trim().split(/\s+/):[])}_.memo(_.forwardRef((t,e)=>{const{map:n,mapLib:r}=_.useContext(fp),i=_.useMemo(()=>document.createElement("div"),[]),a=_.useRef({props:t});a.current.props=t;const l=_.useMemo(()=>{const u={...t},f=new r.Popup(u);return f.setLngLat([t.longitude,t.latitude]),f.once("open",h=>{var g,m;(m=(g=a.current.props).onOpen)==null||m.call(g,h)}),f},[]);if(_.useEffect(()=>{const u=f=>{var h,g;(g=(h=a.current.props).onClose)==null||g.call(h,f)};return l.on("close",u),l.setDOMContent(i).addTo(n.getMap()),()=>{l.off("close",u),l.isOpen()&&l.remove()}},[]),_.useEffect(()=>{Ys(l.getElement(),t.style)},[t.style]),_.useImperativeHandle(e,()=>l,[]),l.isOpen()&&((l.getLngLat().lng!==t.longitude||l.getLngLat().lat!==t.latitude)&&l.setLngLat([t.longitude,t.latitude]),t.offset&&!ps(l.options.offset,t.offset)&&l.setOffset(t.offset),(l.options.anchor!==t.anchor||l.options.maxWidth!==t.maxWidth)&&(l.options.anchor=t.anchor,l.setMaxWidth(t.maxWidth)),l.options.className!==t.className)){const u=xA(l.options.className),f=xA(t.className);for(const h of u)f.has(h)||l.removeClassName(h);for(const h of f)u.has(h)||l.addClassName(h);l.options.className=t.className}return za.createPortal(t.children,i)}));function Qo(t,e,n,r){const i=_.useContext(fp),a=_.useMemo(()=>t(i),[]);return _.useEffect(()=>{const l=e,u=null,f=typeof e=="function"?e:null,{map:h}=i;return h.hasControl(a)||(h.addControl(a,l==null?void 0:l.position),u&&u(i)),()=>{f&&f(i),h.hasControl(a)&&h.removeControl(a)}},[]),a}function WQ(t){const e=Qo(({mapLib:n})=>new n.AttributionControl(t),{position:t.position});return _.useEffect(()=>{Ys(e._container,t.style)},[t.style]),null}_.memo(WQ);function XQ(t){const e=Qo(({mapLib:n})=>new n.FullscreenControl({container:t.containerId&&document.getElementById(t.containerId)}),{position:t.position});return _.useEffect(()=>{Ys(e._controlContainer,t.style)},[t.style]),null}_.memo(XQ);function qQ(t,e){const n=_.useRef({props:t}),r=Qo(({mapLib:i})=>{const a=new i.GeolocateControl(t),l=a._setupUI;return a._setupUI=()=>{a._container.hasChildNodes()||l()},a.on("geolocate",u=>{var f,h;(h=(f=n.current.props).onGeolocate)==null||h.call(f,u)}),a.on("error",u=>{var f,h;(h=(f=n.current.props).onError)==null||h.call(f,u)}),a.on("outofmaxbounds",u=>{var f,h;(h=(f=n.current.props).onOutOfMaxBounds)==null||h.call(f,u)}),a.on("trackuserlocationstart",u=>{var f,h;(h=(f=n.current.props).onTrackUserLocationStart)==null||h.call(f,u)}),a.on("trackuserlocationend",u=>{var f,h;(h=(f=n.current.props).onTrackUserLocationEnd)==null||h.call(f,u)}),a},{position:t.position});return n.current.props=t,_.useImperativeHandle(e,()=>r,[]),_.useEffect(()=>{Ys(r._container,t.style)},[t.style]),null}_.memo(_.forwardRef(qQ));function YQ(t){const e=Qo(({mapLib:n})=>new n.NavigationControl(t),{position:t.position});return _.useEffect(()=>{Ys(e._container,t.style)},[t.style]),null}_.memo(YQ);function KQ(t){const e=Qo(({mapLib:a})=>new a.ScaleControl(t),{position:t.position}),n=_.useRef(t),r=n.current;n.current=t;const{style:i}=t;return t.maxWidth!==void 0&&t.maxWidth!==r.maxWidth&&(e.options.maxWidth=t.maxWidth),t.unit!==void 0&&t.unit!==r.unit&&e.setUnit(t.unit),_.useEffect(()=>{Ys(e._container,i)},[i]),null}_.memo(KQ);function ZQ(t){const e=Qo(({mapLib:n})=>new n.TerrainControl(t),{position:t.position});return _.useEffect(()=>{Ys(e._container,t.style)},[t.style]),null}_.memo(ZQ);function QQ(t){const e=Qo(({mapLib:n})=>new n.LogoControl(t),{position:t.position});return _.useEffect(()=>{Ys(e._container,t.style)},[t.style]),null}_.memo(QQ);const MA=ob().domain([0,1e4]).range([BC(0),BC(1)]),GQ=ob().domain([0,12e3]).range([50,250]);function JQ(){const[t,e]=_.useState(0),[n,r]=_.useState("00:00:00"),[i,a]=_.useState("2023-12-01"),{isPending:l,error:u,data:f}=CI({queryKey:[i],queryFn:()=>jh(`./${i}.csv`,Ny,{csv:{}})});u&&console.log(u);const h=l?[]:[new Rb({id:"deckgl-grid",data:f.data,getPosition:g=>[g.x,g.y],getFillColor:g=>MA(g[n]).slice(4,-1).split(", ").map(Number),cellSize:505,extruded:!1,updateTriggers:{getFillColor:[n]}}),new Cb({id:"deckgl-circle2",getPosition:g=>[g.x,g.y],getFillColor:g=>MA(g[n]).slice(4,-1).split(", ").map(Number),getRadius:g=>GQ(g[n]),updateTriggers:{getFillColor:[n],getRadius:[n]}})];return Vr.jsxs(Vr.Fragment,{children:[Vr.jsx(PQ,{initialViewState:{longitude:37.028,latitude:55.778,zoom:7},controller:!0,layers:h,children:Vr.jsx(HQ,{mapStyle:"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",hash:!0})}),Vr.jsxs(Dx,{style:{position:"absolute",zIndex:1,justifyContent:"center",padding:30},direction:"vertical",children:[Vr.jsx(Ux,{spinning:l}),Vr.jsx(Hc,{onChange:a,options:[{value:"2023-12-01"},{value:"2023-12-02"}],value:i}),Vr.jsx(j7,{value:t,min:0,max:47,onChange:g=>e(g),onChangeComplete:g=>{const m=Math.floor(g/2).toString().padStart(2,"0"),v=(g%2*30).toString().padStart(2,"0"),S=m+":"+v+":00";r(S)}}),Vr.jsx("p",{id:"time",children:n}),Vr.jsx("button",{onClick:()=>{e(t+1);const g=parseInt(t),m=Math.floor(g/2).toString().padStart(2,"0"),v=(g%2*30).toString().padStart(2,"0"),S=m+":"+v+":00";r(S)},children:"Плюс"})]})]})}const eG=new aI;FI.createRoot(document.getElementById("root")).render(Vr.jsx(_.StrictMode,{children:Vr.jsxs(dI,{client:eG,children:[Vr.jsx(JQ,{}),Vr.jsx(MI,{initialIsOpen:!1})]})}));export{yy as g}; diff --git a/dist/assets/maplibre-gl-CaxPo2JM.js b/dist/assets/maplibre-gl-C_BhQy4_.js similarity index 99% rename from dist/assets/maplibre-gl-CaxPo2JM.js rename to dist/assets/maplibre-gl-C_BhQy4_.js index 6df394f..1688ab7 100644 --- a/dist/assets/maplibre-gl-CaxPo2JM.js +++ b/dist/assets/maplibre-gl-C_BhQy4_.js @@ -1,4 +1,4 @@ -import{g as Yp}from"./index-CNEkaNgL.js";function Jp(Da,Tc){for(var Rr=0;RrRi[Lr]})}}}return Object.freeze(Object.defineProperty(Da,Symbol.toStringTag,{value:"Module"}))}var wc={exports:{}};/** +import{g as Yp}from"./index-BuvbEsT3.js";function Jp(Da,Tc){for(var Rr=0;RrRi[Lr]})}}}return Object.freeze(Object.defineProperty(Da,Symbol.toStringTag,{value:"Module"}))}var wc={exports:{}};/** * MapLibre GL JS * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v5.1.0/LICENSE.txt */var Qp=wc.exports,fd;function ef(){return fd||(fd=1,function(Da,Tc){(function(Rr,Ri){Da.exports=Ri()})(Qp,function(){var Rr={},Ri={};function Lr(z,c,Pi){if(Ri[z]=Pi,z==="index"){var fr="var sharedModule = {}; ("+Ri.shared+")(sharedModule); ("+Ri.worker+")(sharedModule);",Mi={};return Ri.shared(Mi),Ri.index(Rr,Mi),typeof window<"u"&&Rr.setWorkerUrl(window.URL.createObjectURL(new Blob([fr],{type:"text/javascript"}))),Rr}}Lr("shared",["exports"],function(z){function c(n,t,r,s){return new(r||(r=Promise))(function(l,d){function p(x){try{g(s.next(x))}catch(b){d(b)}}function m(x){try{g(s.throw(x))}catch(b){d(b)}}function g(x){var b;x.done?l(x.value):(b=x.value,b instanceof r?b:new r(function(w){w(b)})).then(p,m)}g((s=s.apply(n,t||[])).next())})}function Pi(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var fr,Mi;function mr(){if(Mi)return fr;function n(t,r){this.x=t,this.y=r}return Mi=1,fr=n,n.prototype={clone:function(){return new n(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,r){return this.clone()._rotateAround(t,r)},matMult:function(t){return this.clone()._matMult(t)},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(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var r=t.x-this.x,s=t.y-this.y;return r*r+s*s},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,r){return Math.atan2(this.x*r-this.y*t,this.x*t+this.y*r)},_matMult:function(t){var r=t[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=r,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var r=Math.cos(t),s=Math.sin(t),l=s*this.x+r*this.y;return this.x=r*this.x-s*this.y,this.y=l,this},_rotateAround:function(t,r){var s=Math.cos(t),l=Math.sin(t),d=r.y+l*(this.x-r.x)+s*(this.y-r.y);return this.x=r.x+s*(this.x-r.x)-l*(this.y-r.y),this.y=d,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},n.convert=function(t){return t instanceof n?t:Array.isArray(t)?new n(t[0],t[1]):t},fr}typeof SuppressedError=="function"&&SuppressedError;var Ze,ue,Oe=Pi(mr()),Br=function(){if(ue)return Ze;function n(t,r,s,l){this.cx=3*t,this.bx=3*(s-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*r,this.by=3*(l-r)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=r,this.p2x=s,this.p2y=l}return ue=1,Ze=n,n.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,r){if(r===void 0&&(r=1e-6),t<0)return 0;if(t>1)return 1;for(var s=t,l=0;l<8;l++){var d=this.sampleCurveX(s)-t;if(Math.abs(d)d?m=s:g=s,s=.5*(g-m)+m;return s},solve:function(t,r){return this.sampleCurveY(this.solveCurveX(t,r))}},Ze}(),_r=Pi(Br);let Fr,Or;function Xn(){return Fr==null&&(Fr=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),Fr}function oi(){if(Or==null&&(Or=!1,Xn())){const t=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(t){for(let s=0;s<5*5;s++){const l=4*s;t.fillStyle=`rgb(${l},${l+1},${l+2})`,t.fillRect(s%5,Math.floor(s/5),1,1)}const r=t.getImageData(0,0,5,5).data;for(let s=0;s<5*5*4;s++)if(s%4!=3&&r[s]!==s){Or=!0;break}}}return Or||!1}var gr,Mt=1e-6,ft=typeof Float32Array<"u"?Float32Array:Array;function Ct(){var n=new ft(9);return ft!=Float32Array&&(n[1]=0,n[2]=0,n[3]=0,n[5]=0,n[6]=0,n[7]=0),n[0]=1,n[4]=1,n[8]=1,n}function Wn(n){return n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function Rs(){var n=new ft(3);return ft!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0),n}function yr(n,t,r){var s=new ft(3);return s[0]=n,s[1]=t,s[2]=r,s}function Ji(n,t,r){var s=t[0],l=t[1],d=t[2],p=t[3];return n[0]=r[0]*s+r[4]*l+r[8]*d+r[12]*p,n[1]=r[1]*s+r[5]*l+r[9]*d+r[13]*p,n[2]=r[2]*s+r[6]*l+r[10]*d+r[14]*p,n[3]=r[3]*s+r[7]*l+r[11]*d+r[15]*p,n}function Si(){var n=new ft(4);return ft!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0),n[3]=1,n}function ei(){var n=new ft(2);return ft!=Float32Array&&(n[0]=0,n[1]=0),n}function Kn(n,t){var r=new ft(2);return r[0]=n,r[1]=t,r}Math.hypot||(Math.hypot=function(){for(var n=0,t=arguments.length;t--;)n+=arguments[t]*arguments[t];return Math.sqrt(n)}),Rs(),gr=new ft(4),ft!=Float32Array&&(gr[0]=0,gr[1]=0,gr[2]=0,gr[3]=0),Rs(),yr(1,0,0),yr(0,1,0),Si(),Si(),Ct(),ei();const rt=8192;function yn(n,t,r){return t*(rt/(n.tileSize*Math.pow(2,r-n.tileID.overscaledZ)))}function xr(n,t){return(n%t+t)%t}function jr(n,t,r){return n*(1-r)+t*r}function Nr(n){if(n<=0)return 0;if(n>=1)return 1;const t=n*n,r=t*n;return 4*(n<.5?r:3*(n-t)+r-.75)}function xn(n,t,r,s){const l=new _r(n,t,r,s);return d=>l.solve(d)}const $i=xn(.25,.1,.25,1);function Li(n,t,r){return Math.min(r,Math.max(t,n))}function Ii(n,t,r){const s=r-t,l=((n-t)%s+s)%s+t;return l===t?r:l}function Wt(n,...t){for(const r of t)for(const s in r)n[s]=r[s];return n}let Vr=1;function Ur(n,t,r){const s={};for(const l in n)s[l]=t.call(this,n[l],l,n);return s}function Zr(n,t,r){const s={};for(const l in n)t.call(this,n[l],l,n)&&(s[l]=n[l]);return s}function fi(n){return Array.isArray(n)?n.map(fi):typeof n=="object"&&n?Ur(n,fi):n}const Yn={};function ti(n){Yn[n]||(typeof console<"u"&&console.warn(n),Yn[n]=!0)}function Ot(n,t,r){return(r.y-n.y)*(t.x-n.x)>(t.y-n.y)*(r.x-n.x)}function Qi(n){return typeof WorkerGlobalScope<"u"&&n!==void 0&&n instanceof WorkerGlobalScope}let zt=null;function Gr(n){return typeof ImageBitmap<"u"&&n instanceof ImageBitmap}const $r="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Bi(n,t,r,s,l){return c(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");const d=new VideoFrame(n,{timestamp:0});try{const p=d==null?void 0:d.format;if(!p||!p.startsWith("BGR")&&!p.startsWith("RGB"))throw new Error(`Unrecognized format ${p}`);const m=p.startsWith("BGR"),g=new Uint8ClampedArray(s*l*4);if(yield d.copyTo(g,function(x,b,w,M,C){const E=4*Math.max(1,0),k=(Math.max(0,w)-w)*M*4+E,O=4*M,Z=Math.max(0,b),ee=Math.max(0,w);return{rect:{x:Z,y:ee,width:Math.min(x.width,b+M)-Z,height:Math.min(x.height,w+C)-ee},layout:[{offset:k,stride:O}]}}(n,t,r,s,l)),m)for(let x=0;xQi(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,tr=function(n,t){if(/:\/\//.test(n.url)&&!/^https?:|^file:/.test(n.url)){const s=Jn(n.url);if(s)return s(n,t);if(Qi(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:n,targetMapId:Xr},t)}if(!(/^file:/.test(r=n.url)||/^file:/.test(Wr())&&!/^\w+:/.test(r))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(s,l){return c(this,void 0,void 0,function*(){const d=new Request(s.url,{method:s.method||"GET",body:s.body,credentials:s.credentials,headers:s.headers,cache:s.cache,referrer:Wr(),signal:l.signal});let p,m;s.type!=="json"||d.headers.has("Accept")||d.headers.set("Accept","application/json");try{p=yield fetch(d)}catch(x){throw new er(0,x.message,s.url,new Blob)}if(!p.ok){const x=yield p.blob();throw new er(p.status,p.statusText,s.url,x)}m=s.type==="arrayBuffer"||s.type==="image"?p.arrayBuffer():s.type==="json"?p.json():p.text();const g=yield m;if(l.signal.aborted)throw Hr();return{data:g,cacheControl:p.headers.get("Cache-Control"),expires:p.headers.get("Expires")}})}(n,t);if(Qi(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:n,mustQueue:!0,targetMapId:Xr},t)}var r;return function(s,l){return new Promise((d,p)=>{var m;const g=new XMLHttpRequest;g.open(s.method||"GET",s.url,!0),s.type!=="arrayBuffer"&&s.type!=="image"||(g.responseType="arraybuffer");for(const x in s.headers)g.setRequestHeader(x,s.headers[x]);s.type==="json"&&(g.responseType="text",!((m=s.headers)===null||m===void 0)&&m.Accept||g.setRequestHeader("Accept","application/json")),g.withCredentials=s.credentials==="include",g.onerror=()=>{p(new Error(g.statusText))},g.onload=()=>{if(!l.signal.aborted)if((g.status>=200&&g.status<300||g.status===0)&&g.response!==null){let x=g.response;if(s.type==="json")try{x=JSON.parse(g.response)}catch(b){return void p(b)}d({data:x,cacheControl:g.getResponseHeader("Cache-Control"),expires:g.getResponseHeader("Expires")})}else{const x=new Blob([g.response],{type:g.getResponseHeader("Content-Type")});p(new er(g.status,g.statusText,s.url,x))}},l.signal.addEventListener("abort",()=>{g.abort(),p(Hr())}),g.send(s.body)})}(n,t)};function Kr(n){if(!n||n.indexOf("://")<=0||n.indexOf("data:image/")===0||n.indexOf("blob:")===0)return!0;const t=new URL(n),r=window.location;return t.protocol===r.protocol&&t.host===r.host}function Tr(n,t,r){r[n]&&r[n].indexOf(t)!==-1||(r[n]=r[n]||[],r[n].push(t))}function vn(n,t,r){if(r&&r[n]){const s=r[n].indexOf(t);s!==-1&&r[n].splice(s,1)}}class bn{constructor(t,r={}){Wt(this,r),this.type=t}}class Qn extends bn{constructor(t,r={}){super("error",Wt({error:t},r))}}class Pr{on(t,r){return this._listeners=this._listeners||{},Tr(t,r,this._listeners),{unsubscribe:()=>{this.off(t,r)}}}off(t,r){return vn(t,r,this._listeners),vn(t,r,this._oneTimeListeners),this}once(t,r){return r?(this._oneTimeListeners=this._oneTimeListeners||{},Tr(t,r,this._oneTimeListeners),this):new Promise(s=>this.once(t,s))}fire(t,r){typeof t=="string"&&(t=new bn(t,r||{}));const s=t.type;if(this.listens(s)){t.target=this;const l=this._listeners&&this._listeners[s]?this._listeners[s].slice():[];for(const m of l)m.call(this,t);const d=this._oneTimeListeners&&this._oneTimeListeners[s]?this._oneTimeListeners[s].slice():[];for(const m of d)vn(s,m,this._oneTimeListeners),m.call(this,t);const p=this._eventedParent;p&&(Wt(t,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),p.fire(t))}else t instanceof Qn&&console.error(t.error);return this}listens(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)}setEventedParent(t,r){return this._eventedParent=t,this._eventedParentData=r,this}}var j={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},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:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,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-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"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":{}}},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}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},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"}}};const D=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function L(n,t){const r={};for(const s in n)s!=="ref"&&(r[s]=n[s]);return D.forEach(s=>{s in t&&(r[s]=t[s])}),r}function B(n,t){if(Array.isArray(n)){if(!Array.isArray(t)||n.length!==t.length)return!1;for(let r=0;r`:n.itemType.kind==="value"?"array":`array<${t}>`}return n.kind}const es=[Ue,ge,Ce,De,qe,Je,Mr,Ve,_i(ze),jt,Rt,mt];function wn(n,t){if(t.kind==="error")return null;if(n.kind==="array"){if(t.kind==="array"&&(t.N===0&&t.itemType.kind==="value"||!wn(n.itemType,t.itemType))&&(typeof n.N!="number"||n.N===t.N))return null}else{if(n.kind===t.kind)return null;if(n.kind==="value"){for(const r of es)if(!wn(r,t))return null}}return`Expected ${_t(n)} but found ${_t(t)} instead.`}function La(n,t){return t.some(r=>r.kind===n.kind)}function Yr(n,t){return t.some(r=>r==="null"?n===null:r==="array"?Array.isArray(n):r==="object"?n&&!Array.isArray(n)&&typeof n=="object":r===typeof n)}function Jr(n,t){return n.kind==="array"&&t.kind==="array"?n.itemType.kind===t.itemType.kind&&typeof n.N=="number":n.kind===t.kind}const rl=.96422,Ba=.82521,nl=4/29,Tn=6/29,sl=3*Tn*Tn,Pc=Tn*Tn*Tn,Mc=Math.PI/180,Sc=180/Math.PI;function al(n){return(n%=360)<0&&(n+=360),n}function Fa([n,t,r,s]){let l,d;const p=Oa((.2225045*(n=Qr(n))+.7168786*(t=Qr(t))+.0606169*(r=Qr(r)))/1);n===t&&t===r?l=d=p:(l=Oa((.4360747*n+.3850649*t+.1430804*r)/rl),d=Oa((.0139322*n+.0971045*t+.7141733*r)/Ba));const m=116*p-16;return[m<0?0:m,500*(l-p),200*(p-d),s]}function Qr(n){return n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function Oa(n){return n>Pc?Math.pow(n,1/3):n/sl+nl}function ol([n,t,r,s]){let l=(n+16)/116,d=isNaN(t)?l:l+t/500,p=isNaN(r)?l:l-r/200;return l=1*ja(l),d=rl*ja(d),p=Ba*ja(p),[en(3.1338561*d-1.6168667*l-.4906146*p),en(-.9787684*d+1.9161415*l+.033454*p),en(.0719453*d-.2289914*l+1.4052427*p),s]}function en(n){return(n=n<=.00304?12.92*n:1.055*Math.pow(n,1/2.4)-.055)<0?0:n>1?1:n}function ja(n){return n>Tn?n*n*n:sl*(n-nl)}function Ls(n){return parseInt(n.padEnd(2,n),16)/255}function ll(n,t){return tn(t?n/100:n,0,1)}function tn(n,t,r){return Math.min(Math.max(t,n),r)}function Na(n){return!n.some(Number.isNaN)}const qi={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function He(n,t,r){return n+r*(t-n)}function Hi(n,t,r){return n.map((s,l)=>He(s,t[l],r))}class Xe{constructor(t,r,s,l=1,d=!0){this.r=t,this.g=r,this.b=s,this.a=l,d||(this.r*=l,this.g*=l,this.b*=l,l||this.overwriteGetter("rgb",[t,r,s,l]))}static parse(t){if(t instanceof Xe)return t;if(typeof t!="string")return;const r=function(s){if((s=s.toLowerCase().trim())==="transparent")return[0,0,0,0];const l=qi[s];if(l){const[p,m,g]=l;return[p/255,m/255,g/255,1]}if(s.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(s)){const p=s.length<6?1:2;let m=1;return[Ls(s.slice(m,m+=p)),Ls(s.slice(m,m+=p)),Ls(s.slice(m,m+=p)),Ls(s.slice(m,m+p)||"ff")]}if(s.startsWith("rgb")){const p=s.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(p){const[m,g,x,b,w,M,C,E,k,O,Z,ee]=p,q=[b||" ",C||" ",O].join("");if(q===" "||q===" /"||q===",,"||q===",,,"){const I=[x,M,k].join(""),F=I==="%%%"?100:I===""?255:0;if(F){const H=[tn(+g/F,0,1),tn(+w/F,0,1),tn(+E/F,0,1),Z?ll(+Z,ee):1];if(Na(H))return H}}return}}const d=s.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(d){const[p,m,g,x,b,w,M,C,E]=d,k=[g||" ",b||" ",M].join("");if(k===" "||k===" /"||k===",,"||k===",,,"){const O=[+m,tn(+x,0,100),tn(+w,0,100),C?ll(+C,E):1];if(Na(O))return function([Z,ee,q,I]){function F(H){const ae=(H+Z/30)%12,xe=ee*Math.min(q,1-q);return q-xe*Math.max(-1,Math.min(ae-3,9-ae,1))}return Z=al(Z),ee/=100,q/=100,[F(0),F(8),F(4),I]}(O)}}}(t);return r?new Xe(...r,!1):void 0}get rgb(){const{r:t,g:r,b:s,a:l}=this,d=l||1/0;return this.overwriteGetter("rgb",[t/d,r/d,s/d,l])}get hcl(){return this.overwriteGetter("hcl",function(t){const[r,s,l,d]=Fa(t),p=Math.sqrt(s*s+l*l);return[Math.round(1e4*p)?al(Math.atan2(l,s)*Sc):NaN,p,r,d]}(this.rgb))}get lab(){return this.overwriteGetter("lab",Fa(this.rgb))}overwriteGetter(t,r){return Object.defineProperty(this,t,{value:r}),r}toString(){const[t,r,s,l]=this.rgb;return`rgba(${[t,r,s].map(d=>Math.round(255*d)).join(",")},${l})`}static interpolate(t,r,s,l="rgb"){switch(l){case"rgb":{const[d,p,m,g]=Hi(t.rgb,r.rgb,s);return new Xe(d,p,m,g,!1)}case"hcl":{const[d,p,m,g]=t.hcl,[x,b,w,M]=r.hcl;let C,E;if(isNaN(d)||isNaN(x))isNaN(d)?isNaN(x)?C=NaN:(C=x,m!==1&&m!==0||(E=b)):(C=d,w!==1&&w!==0||(E=p));else{let q=x-d;x>d&&q>180?q-=360:x180&&(q+=360),C=d+s*q}const[k,O,Z,ee]=function([q,I,F,H]){return q=isNaN(q)?0:q*Mc,ol([F,Math.cos(q)*I,Math.sin(q)*I,H])}([C,E??He(p,b,s),He(m,w,s),He(g,M,s)]);return new Xe(k,O,Z,ee,!1)}case"lab":{const[d,p,m,g]=ol(Hi(t.lab,r.lab,s));return new Xe(d,p,m,g,!1)}}}}Xe.black=new Xe(0,0,0,1),Xe.white=new Xe(1,1,1,1),Xe.transparent=new Xe(0,0,0,0),Xe.red=new Xe(1,0,0,1);class Bs{constructor(t,r,s){this.sensitivity=t?r?"variant":"case":r?"accent":"base",this.locale=s,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,r){return this.collator.compare(t,r)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}const cl=["bottom","center","top"];class ts{constructor(t,r,s,l,d,p){this.text=t,this.image=r,this.scale=s,this.fontStack=l,this.textColor=d,this.verticalAlign=p}}class Et{constructor(t){this.sections=t}static fromString(t){return new Et([new ts(t,null,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(t=>t.text.length!==0||t.image&&t.image.name.length!==0)}static factory(t){return t instanceof Et?t:Et.fromString(t)}toString(){return this.sections.length===0?"":this.sections.map(t=>t.text).join("")}}class Nt{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof Nt)return t;if(typeof t=="number")return new Nt([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1||t.length>4)){for(const r of t)if(typeof r!="number")return;switch(t.length){case 1:t=[t[0],t[0],t[0],t[0]];break;case 2:t=[t[0],t[1],t[0],t[1]];break;case 3:t=[t[0],t[1],t[2],t[1]]}return new Nt(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,r,s){return new Nt(Hi(t.values,r.values,s))}}class wt{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}}const Va=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class ii{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof ii)return t;if(Array.isArray(t)&&!(t.length<1)&&t.length%2==0){for(let r=0;r=0&&n<=255&&typeof t=="number"&&t>=0&&t<=255&&typeof r=="number"&&r>=0&&r<=255?s===void 0||typeof s=="number"&&s>=0&&s<=1?null:`Invalid rgba value [${[n,t,r,s].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof s=="number"?[n,t,r,s]:[n,t,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function rn(n){if(n===null||typeof n=="string"||typeof n=="boolean"||typeof n=="number"||n instanceof ni||n instanceof Xe||n instanceof Bs||n instanceof Et||n instanceof Nt||n instanceof ii||n instanceof ri)return!0;if(Array.isArray(n)){for(const t of n)if(!rn(t))return!1;return!0}if(typeof n=="object"){for(const t in n)if(!rn(n[t]))return!1;return!0}return!1}function ut(n){if(n===null)return Ue;if(typeof n=="string")return Ce;if(typeof n=="boolean")return De;if(typeof n=="number")return ge;if(n instanceof Xe)return qe;if(n instanceof ni)return Je;if(n instanceof Bs)return St;if(n instanceof Et)return Mr;if(n instanceof Nt)return jt;if(n instanceof ii)return mt;if(n instanceof ri)return Rt;if(Array.isArray(n)){const t=n.length;let r;for(const s of n){const l=ut(s);if(r){if(r===l)continue;r=ze;break}r=l}return _i(r||ze,t)}return Ve}function is(n){const t=typeof n;return n===null?"":t==="string"||t==="number"||t==="boolean"?String(n):n instanceof Xe||n instanceof ni||n instanceof Et||n instanceof Nt||n instanceof ii||n instanceof ri?n.toString():JSON.stringify(n)}class Xi{constructor(t,r){this.type=t,this.value=r}static parse(t,r){if(t.length!==2)return r.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!rn(t[1]))return r.error("invalid value");const s=t[1];let l=ut(s);const d=r.expectedType;return l.kind!=="array"||l.N!==0||!d||d.kind!=="array"||typeof d.N=="number"&&d.N!==0||(l=d),new Xi(l,s)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}const ir={string:Ce,number:ge,boolean:De,object:Ve};class Ci{constructor(t,r){this.type=t,this.args=r}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let s,l=1;const d=t[0];if(d==="array"){let m,g;if(t.length>2){const x=t[1];if(typeof x!="string"||!(x in ir)||x==="object")return r.error('The item type argument of "array" must be one of string, number, boolean',1);m=ir[x],l++}else m=ze;if(t.length>3){if(t[2]!==null&&(typeof t[2]!="number"||t[2]<0||t[2]!==Math.floor(t[2])))return r.error('The length argument to "array" must be a positive integer literal',2);g=t[2],l++}s=_i(m,g)}else{if(!ir[d])throw new Error(`Types doesn't contain name = ${d}`);s=ir[d]}const p=[];for(;lt.outputDefined())}}const Za={"to-boolean":De,"to-color":qe,"to-number":ge,"to-string":Ce};class rr{constructor(t,r){this.type=t,this.args=r}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");const s=t[0];if(!Za[s])throw new Error(`Can't parse ${s} as it is not part of the known types`);if((s==="to-boolean"||s==="to-string")&&t.length!==2)return r.error("Expected one argument.");const l=Za[s],d=[];for(let p=1;p4?`Invalid rgba value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:Ua(r[0],r[1],r[2],r[3]),!s))return new Xe(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new wt(s||`Could not parse color from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"padding":{let r;for(const s of this.args){r=s.evaluate(t);const l=Nt.parse(r);if(l)return l}throw new wt(`Could not parse padding from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"variableAnchorOffsetCollection":{let r;for(const s of this.args){r=s.evaluate(t);const l=ii.parse(r);if(l)return l}throw new wt(`Could not parse variableAnchorOffsetCollection from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"number":{let r=null;for(const s of this.args){if(r=s.evaluate(t),r===null)return 0;const l=Number(r);if(!isNaN(l))return l}throw new wt(`Could not convert ${JSON.stringify(r)} to number.`)}case"formatted":return Et.fromString(is(this.args[0].evaluate(t)));case"resolvedImage":return ri.fromString(is(this.args[0].evaluate(t)));case"projectionDefinition":return this.args[0].evaluate(t);default:return is(this.args[0].evaluate(t))}}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}const Fs=["Unknown","Point","LineString","Polygon"];class dt{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"?Fs[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(t){let r=this._parseColorCache[t];return r||(r=this._parseColorCache[t]=Xe.parse(t)),r}}class Pn{constructor(t,r,s=[],l,d=new je,p=[]){this.registry=t,this.path=s,this.key=s.map(m=>`[${m}]`).join(""),this.scope=d,this.errors=p,this.expectedType=l,this._isConstant=r}parse(t,r,s,l,d={}){return r?this.concat(r,s,l)._parse(t,d):this._parse(t,d)}_parse(t,r){function s(l,d,p){return p==="assert"?new Ci(d,[l]):p==="coerce"?new rr(d,[l]):l}if(t!==null&&typeof t!="string"&&typeof t!="boolean"&&typeof t!="number"||(t=["literal",t]),Array.isArray(t)){if(t.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const l=t[0];if(typeof l!="string")return this.error(`Expression name must be a string, but found ${typeof l} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const d=this.registry[l];if(d){let p=d.parse(t,this);if(!p)return null;if(this.expectedType){const m=this.expectedType,g=p.type;if(m.kind!=="string"&&m.kind!=="number"&&m.kind!=="boolean"&&m.kind!=="object"&&m.kind!=="array"||g.kind!=="value")if(m.kind!=="projectionDefinition"||g.kind!=="string"&&g.kind!=="array")if(m.kind!=="color"&&m.kind!=="formatted"&&m.kind!=="resolvedImage"||g.kind!=="value"&&g.kind!=="string")if(m.kind!=="padding"||g.kind!=="value"&&g.kind!=="number"&&g.kind!=="array")if(m.kind!=="variableAnchorOffsetCollection"||g.kind!=="value"&&g.kind!=="array"){if(this.checkSubtype(m,g))return null}else p=s(p,m,r.typeAnnotation||"coerce");else p=s(p,m,r.typeAnnotation||"coerce");else p=s(p,m,r.typeAnnotation||"coerce");else p=s(p,m,r.typeAnnotation||"coerce");else p=s(p,m,r.typeAnnotation||"assert")}if(!(p instanceof Xi)&&p.type.kind!=="resolvedImage"&&this._isConstant(p)){const m=new dt;try{p=new Xi(p.type,p.evaluate(m))}catch(g){return this.error(g.message),null}}return p}return this.error(`Unknown expression "${l}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(t===void 0?"'undefined' value invalid. Use null instead.":typeof t=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof t} instead.`)}concat(t,r,s){const l=typeof t=="number"?this.path.concat(t):this.path,d=s?this.scope.concat(s):this.scope;return new Pn(this.registry,this._isConstant,l,r||null,d,this.errors)}error(t,...r){const s=`${this.key}${r.map(l=>`[${l}]`).join("")}`;this.errors.push(new Me(s,t))}checkSubtype(t,r){const s=wn(t,r);return s&&this.error(s),s}}class Ye{constructor(t,r){this.type=r.type,this.bindings=[].concat(t),this.result=r}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const r of this.bindings)t(r[1]);t(this.result)}static parse(t,r){if(t.length<4)return r.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);const s=[];for(let d=1;d=s.length)throw new wt(`Array index out of bounds: ${r} > ${s.length-1}.`);if(r!==Math.floor(r))throw new wt(`Array index must be an integer, but found ${r} instead.`);return s[r]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}}class Qe{constructor(t,r){this.type=De,this.needle=t,this.haystack=r}static parse(t,r){if(t.length!==3)return r.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const s=r.parse(t[1],1,ze),l=r.parse(t[2],2,ze);return s&&l?La(s.type,[De,Ce,ge,Ue,ze])?new Qe(s,l):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${_t(s.type)} instead`):null}evaluate(t){const r=this.needle.evaluate(t),s=this.haystack.evaluate(t);if(!s)return!1;if(!Yr(r,["boolean","string","number","null"]))throw new wt(`Expected first argument to be of type boolean, string, number or null, but found ${_t(ut(r))} instead.`);if(!Yr(s,["string","array"]))throw new wt(`Expected second argument to be of type array or string, but found ${_t(ut(s))} instead.`);return s.indexOf(r)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}}class Mn{constructor(t,r,s){this.type=ge,this.needle=t,this.haystack=r,this.fromIndex=s}static parse(t,r){if(t.length<=2||t.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const s=r.parse(t[1],1,ze),l=r.parse(t[2],2,ze);if(!s||!l)return null;if(!La(s.type,[De,Ce,ge,Ue,ze]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${_t(s.type)} instead`);if(t.length===4){const d=r.parse(t[3],3,ge);return d?new Mn(s,l,d):null}return new Mn(s,l)}evaluate(t){const r=this.needle.evaluate(t),s=this.haystack.evaluate(t);if(!Yr(r,["boolean","string","number","null"]))throw new wt(`Expected first argument to be of type boolean, string, number or null, but found ${_t(ut(r))} instead.`);let l;if(this.fromIndex&&(l=this.fromIndex.evaluate(t)),Yr(s,["string"])){const d=s.indexOf(r,l);return d===-1?-1:[...s.slice(0,d)].length}if(Yr(s,["array"]))return s.indexOf(r,l);throw new wt(`Expected second argument to be of type array or string, but found ${_t(ut(s))} instead.`)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}}class Fi{constructor(t,r,s,l,d,p){this.inputType=t,this.type=r,this.input=s,this.cases=l,this.outputs=d,this.otherwise=p}static parse(t,r){if(t.length<5)return r.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return r.error("Expected an even number of arguments.");let s,l;r.expectedType&&r.expectedType.kind!=="value"&&(l=r.expectedType);const d={},p=[];for(let x=2;xNumber.MAX_SAFE_INTEGER)return M.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof E=="number"&&Math.floor(E)!==E)return M.error("Numeric branch labels must be integer values.");if(s){if(M.checkSubtype(s,ut(E)))return null}else s=ut(E);if(d[String(E)]!==void 0)return M.error("Branch labels must be unique.");d[String(E)]=p.length}const C=r.parse(w,x,l);if(!C)return null;l=l||C.type,p.push(C)}const m=r.parse(t[1],1,ze);if(!m)return null;const g=r.parse(t[t.length-1],t.length-1,l);return g?m.type.kind!=="value"&&r.concat(1).checkSubtype(s,m.type)?null:new Fi(s,l,m,d,p,g):null}evaluate(t){const r=this.input.evaluate(t);return(ut(r)===this.inputType&&this.outputs[this.cases[r]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every(t=>t.outputDefined())&&this.otherwise.outputDefined()}}class ns{constructor(t,r,s){this.type=t,this.branches=r,this.otherwise=s}static parse(t,r){if(t.length<4)return r.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return r.error("Expected an odd number of arguments.");let s;r.expectedType&&r.expectedType.kind!=="value"&&(s=r.expectedType);const l=[];for(let p=1;pr.outputDefined())&&this.otherwise.outputDefined()}}class ss{constructor(t,r,s,l){this.type=t,this.input=r,this.beginIndex=s,this.endIndex=l}static parse(t,r){if(t.length<=2||t.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const s=r.parse(t[1],1,ze),l=r.parse(t[2],2,ge);if(!s||!l)return null;if(!La(s.type,[_i(ze),Ce,ze]))return r.error(`Expected first argument to be of type array or string, but found ${_t(s.type)} instead`);if(t.length===4){const d=r.parse(t[3],3,ge);return d?new ss(s.type,s,l,d):null}return new ss(s.type,s,l)}evaluate(t){const r=this.input.evaluate(t),s=this.beginIndex.evaluate(t);let l;if(this.endIndex&&(l=this.endIndex.evaluate(t)),Yr(r,["string"]))return[...r].slice(s,l).join("");if(Yr(r,["array"]))return r.slice(s,l);throw new wt(`Expected first argument to be of type array or string, but found ${_t(ut(r))} instead.`)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}}function as(n,t){const r=n.length-1;let s,l,d=0,p=r,m=0;for(;d<=p;)if(m=Math.floor((d+p)/2),s=n[m],l=n[m+1],s<=t){if(m===r||tt))throw new wt("Input is not a number.");p=m-1}return 0}class nn{constructor(t,r,s){this.type=t,this.input=r,this.labels=[],this.outputs=[];for(const[l,d]of s)this.labels.push(l),this.outputs.push(d)}static parse(t,r){if(t.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return r.error("Expected an even number of arguments.");const s=r.parse(t[1],1,ge);if(!s)return null;const l=[];let d=null;r.expectedType&&r.expectedType.kind!=="value"&&(d=r.expectedType);for(let p=1;p=m)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',x);const w=r.parse(g,b,d);if(!w)return null;d=d||w.type,l.push([m,w])}return new nn(d,s,l)}evaluate(t){const r=this.labels,s=this.outputs;if(r.length===1)return s[0].evaluate(t);const l=this.input.evaluate(t);if(l<=r[0])return s[0].evaluate(t);const d=r.length;return l>=r[d-1]?s[d-1].evaluate(t):s[as(r,l)].evaluate(t)}eachChild(t){t(this.input);for(const r of this.outputs)t(r)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}}function hl(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Ga,$a,ul=function(){if($a)return Ga;function n(t,r,s,l){this.cx=3*t,this.bx=3*(s-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*r,this.by=3*(l-r)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=r,this.p2x=s,this.p2y=l}return $a=1,Ga=n,n.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,r){if(r===void 0&&(r=1e-6),t<0)return 0;if(t>1)return 1;for(var s=t,l=0;l<8;l++){var d=this.sampleCurveX(s)-t;if(Math.abs(d)d?m=s:g=s,s=.5*(g-m)+m;return s},solve:function(t,r){return this.sampleCurveY(this.solveCurveX(t,r))}},Ga}(),os=hl(ul);class ct{constructor(t,r,s,l,d){this.type=t,this.operator=r,this.interpolation=s,this.input=l,this.labels=[],this.outputs=[];for(const[p,m]of d)this.labels.push(p),this.outputs.push(m)}static interpolationFactor(t,r,s,l){let d=0;if(t.name==="exponential")d=Sn(r,t.base,s,l);else if(t.name==="linear")d=Sn(r,1,s,l);else if(t.name==="cubic-bezier"){const p=t.controlPoints;d=new os(p[0],p[1],p[2],p[3]).solve(Sn(r,1,s,l))}return d}static parse(t,r){let[s,l,d,...p]=t;if(!Array.isArray(l)||l.length===0)return r.error("Expected an interpolation type expression.",1);if(l[0]==="linear")l={name:"linear"};else if(l[0]==="exponential"){const x=l[1];if(typeof x!="number")return r.error("Exponential interpolation requires a numeric base.",1,1);l={name:"exponential",base:x}}else{if(l[0]!=="cubic-bezier")return r.error(`Unknown interpolation type ${String(l[0])}`,1,0);{const x=l.slice(1);if(x.length!==4||x.some(b=>typeof b!="number"||b<0||b>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);l={name:"cubic-bezier",controlPoints:x}}}if(t.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(d=r.parse(d,2,ge),!d)return null;const m=[];let g=null;s==="interpolate-hcl"||s==="interpolate-lab"?g=qe:r.expectedType&&r.expectedType.kind!=="value"&&(g=r.expectedType);for(let x=0;x=b)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',M);const E=r.parse(w,C,g);if(!E)return null;g=g||E.type,m.push([b,E])}return Jr(g,ge)||Jr(g,Je)||Jr(g,qe)||Jr(g,jt)||Jr(g,mt)||Jr(g,_i(ge))?new ct(g,s,l,d,m):r.error(`Type ${_t(g)} is not interpolatable.`)}evaluate(t){const r=this.labels,s=this.outputs;if(r.length===1)return s[0].evaluate(t);const l=this.input.evaluate(t);if(l<=r[0])return s[0].evaluate(t);const d=r.length;if(l>=r[d-1])return s[d-1].evaluate(t);const p=as(r,l),m=ct.interpolationFactor(this.interpolation,l,r[p],r[p+1]),g=s[p].evaluate(t),x=s[p+1].evaluate(t);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return He(g,x,m);case"color":return Xe.interpolate(g,x,m);case"padding":return Nt.interpolate(g,x,m);case"variableAnchorOffsetCollection":return ii.interpolate(g,x,m);case"array":return Hi(g,x,m);case"projectionDefinition":return ni.interpolate(g,x,m)}case"interpolate-hcl":return Xe.interpolate(g,x,m,"hcl");case"interpolate-lab":return Xe.interpolate(g,x,m,"lab")}}eachChild(t){t(this.input);for(const r of this.outputs)t(r)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}}function Sn(n,t,r,s){const l=s-r,d=n-r;return l===0?0:t===1?d/l:(Math.pow(t,d)-1)/(Math.pow(t,l)-1)}const Oi={color:Xe.interpolate,number:He,padding:Nt.interpolate,variableAnchorOffsetCollection:ii.interpolate,array:Hi};class sn{constructor(t,r){this.type=t,this.args=r}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let s=null;const l=r.expectedType;l&&l.kind!=="value"&&(s=l);const d=[];for(const m of t.slice(1)){const g=r.parse(m,1+d.length,s,void 0,{typeAnnotation:"omit"});if(!g)return null;s=s||g.type,d.push(g)}if(!s)throw new Error("No output type");const p=l&&d.some(m=>wn(l,m.type));return new sn(p?ze:s,d)}evaluate(t){let r,s=null,l=0;for(const d of this.args)if(l++,s=d.evaluate(t),s&&s instanceof ri&&!s.available&&(r||(r=s.name),s=null,l===this.args.length&&(s=r)),s!==null)break;return s}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}function Vt(n,t){return n==="=="||n==="!="?t.kind==="boolean"||t.kind==="string"||t.kind==="number"||t.kind==="null"||t.kind==="value":t.kind==="string"||t.kind==="number"||t.kind==="value"}function qa(n,t,r,s){return s.compare(t,r)===0}function Sr(n,t,r){const s=n!=="=="&&n!=="!=";return class md{constructor(d,p,m){this.type=De,this.lhs=d,this.rhs=p,this.collator=m,this.hasUntypedArgument=d.type.kind==="value"||p.type.kind==="value"}static parse(d,p){if(d.length!==3&&d.length!==4)return p.error("Expected two or three arguments.");const m=d[0];let g=p.parse(d[1],1,ze);if(!g)return null;if(!Vt(m,g.type))return p.concat(1).error(`"${m}" comparisons are not supported for type '${_t(g.type)}'.`);let x=p.parse(d[2],2,ze);if(!x)return null;if(!Vt(m,x.type))return p.concat(2).error(`"${m}" comparisons are not supported for type '${_t(x.type)}'.`);if(g.type.kind!==x.type.kind&&g.type.kind!=="value"&&x.type.kind!=="value")return p.error(`Cannot compare types '${_t(g.type)}' and '${_t(x.type)}'.`);s&&(g.type.kind==="value"&&x.type.kind!=="value"?g=new Ci(x.type,[g]):g.type.kind!=="value"&&x.type.kind==="value"&&(x=new Ci(g.type,[x])));let b=null;if(d.length===4){if(g.type.kind!=="string"&&x.type.kind!=="string"&&g.type.kind!=="value"&&x.type.kind!=="value")return p.error("Cannot use collator to compare non-string types.");if(b=p.parse(d[3],3,St),!b)return null}return new md(g,x,b)}evaluate(d){const p=this.lhs.evaluate(d),m=this.rhs.evaluate(d);if(s&&this.hasUntypedArgument){const g=ut(p),x=ut(m);if(g.kind!==x.kind||g.kind!=="string"&&g.kind!=="number")throw new wt(`Expected arguments for "${n}" to be (string, string) or (number, number), but found (${g.kind}, ${x.kind}) instead.`)}if(this.collator&&!s&&this.hasUntypedArgument){const g=ut(p),x=ut(m);if(g.kind!=="string"||x.kind!=="string")return t(d,p,m)}return this.collator?r(d,p,m,this.collator.evaluate(d)):t(d,p,m)}eachChild(d){d(this.lhs),d(this.rhs),this.collator&&d(this.collator)}outputDefined(){return!0}}}const dl=Sr("==",function(n,t,r){return t===r},qa),Ic=Sr("!=",function(n,t,r){return t!==r},function(n,t,r,s){return!qa(0,t,r,s)}),Os=Sr("<",function(n,t,r){return t",function(n,t,r){return t>r},function(n,t,r,s){return s.compare(t,r)>0}),Cc=Sr("<=",function(n,t,r){return t<=r},function(n,t,r,s){return s.compare(t,r)<=0}),js=Sr(">=",function(n,t,r){return t>=r},function(n,t,r,s){return s.compare(t,r)>=0});class an{constructor(t,r,s){this.type=St,this.locale=s,this.caseSensitive=t,this.diacriticSensitive=r}static parse(t,r){if(t.length!==2)return r.error("Expected one argument.");const s=t[1];if(typeof s!="object"||Array.isArray(s))return r.error("Collator options argument must be an object.");const l=r.parse(s["case-sensitive"]!==void 0&&s["case-sensitive"],1,De);if(!l)return null;const d=r.parse(s["diacritic-sensitive"]!==void 0&&s["diacritic-sensitive"],1,De);if(!d)return null;let p=null;return s.locale&&(p=r.parse(s.locale,1,Ce),!p)?null:new an(l,d,p)}evaluate(t){return new Bs(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return!1}}class gi{constructor(t,r,s,l,d){this.type=Ce,this.number=t,this.locale=r,this.currency=s,this.minFractionDigits=l,this.maxFractionDigits=d}static parse(t,r){if(t.length!==3)return r.error("Expected two arguments.");const s=r.parse(t[1],1,ge);if(!s)return null;const l=t[2];if(typeof l!="object"||Array.isArray(l))return r.error("NumberFormat options argument must be an object.");let d=null;if(l.locale&&(d=r.parse(l.locale,1,Ce),!d))return null;let p=null;if(l.currency&&(p=r.parse(l.currency,1,Ce),!p))return null;let m=null;if(l["min-fraction-digits"]&&(m=r.parse(l["min-fraction-digits"],1,ge),!m))return null;let g=null;return l["max-fraction-digits"]&&(g=r.parse(l["max-fraction-digits"],1,ge),!g)?null:new gi(s,d,p,m,g)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}}class ls{constructor(t){this.type=Mr,this.sections=t}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");const s=t[1];if(!Array.isArray(s)&&typeof s=="object")return r.error("First argument must be an image or text section.");const l=[];let d=!1;for(let p=1;p<=t.length-1;++p){const m=t[p];if(d&&typeof m=="object"&&!Array.isArray(m)){d=!1;let g=null;if(m["font-scale"]&&(g=r.parse(m["font-scale"],1,ge),!g))return null;let x=null;if(m["text-font"]&&(x=r.parse(m["text-font"],1,_i(Ce)),!x))return null;let b=null;if(m["text-color"]&&(b=r.parse(m["text-color"],1,qe),!b))return null;let w=null;if(m["vertical-align"]){if(typeof m["vertical-align"]=="string"&&!cl.includes(m["vertical-align"]))return r.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${m["vertical-align"]}' instead.`);if(w=r.parse(m["vertical-align"],1,Ce),!w)return null}const M=l[l.length-1];M.scale=g,M.font=x,M.textColor=b,M.verticalAlign=w}else{const g=r.parse(t[p],1,ze);if(!g)return null;const x=g.type.kind;if(x!=="string"&&x!=="value"&&x!=="null"&&x!=="resolvedImage")return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");d=!0,l.push({content:g,scale:null,font:null,textColor:null,verticalAlign:null})}}return new ls(l)}evaluate(t){return new Et(this.sections.map(r=>{const s=r.content.evaluate(t);return ut(s)===Rt?new ts("",s,null,null,null,r.verticalAlign?r.verticalAlign.evaluate(t):null):new ts(is(s),null,r.scale?r.scale.evaluate(t):null,r.font?r.font.evaluate(t).join(","):null,r.textColor?r.textColor.evaluate(t):null,r.verticalAlign?r.verticalAlign.evaluate(t):null)}))}eachChild(t){for(const r of this.sections)t(r.content),r.scale&&t(r.scale),r.font&&t(r.font),r.textColor&&t(r.textColor),r.verticalAlign&&t(r.verticalAlign)}outputDefined(){return!1}}class In{constructor(t){this.type=Rt,this.input=t}static parse(t,r){if(t.length!==2)return r.error("Expected two arguments.");const s=r.parse(t[1],1,Ce);return s?new In(s):r.error("No image name provided.")}evaluate(t){const r=this.input.evaluate(t),s=ri.fromString(r);return s&&t.availableImages&&(s.available=t.availableImages.indexOf(r)>-1),s}eachChild(t){t(this.input)}outputDefined(){return!1}}class Xa{constructor(t){this.type=ge,this.input=t}static parse(t,r){if(t.length!==2)return r.error(`Expected 1 argument, but found ${t.length-1} instead.`);const s=r.parse(t[1],1);return s?s.type.kind!=="array"&&s.type.kind!=="string"&&s.type.kind!=="value"?r.error(`Expected argument of type string or array, but found ${_t(s.type)} instead.`):new Xa(s):null}evaluate(t){const r=this.input.evaluate(t);if(typeof r=="string")return[...r].length;if(Array.isArray(r))return r.length;throw new wt(`Expected value to be of type string or array, but found ${_t(ut(r))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}}const Ei=8192;function Ec(n,t){const r=(180+n[0])/360,s=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+n[1]*Math.PI/360)))/360,l=Math.pow(2,t.z);return[Math.round(r*l*Ei),Math.round(s*l*Ei)]}function Wa(n,t){const r=Math.pow(2,t.z);return[(l=(n[0]/Ei+t.x)/r,360*l-180),(s=(n[1]/Ei+t.y)/r,360/Math.PI*Math.atan(Math.exp((180-360*s)*Math.PI/180))-90)];var s,l}function cs(n,t){n[0]=Math.min(n[0],t[0]),n[1]=Math.min(n[1],t[1]),n[2]=Math.max(n[2],t[0]),n[3]=Math.max(n[3],t[1])}function hs(n,t){return!(n[0]<=t[0]||n[2]>=t[2]||n[1]<=t[1]||n[3]>=t[3])}function Ns(n,t,r){const s=n[0]-t[0],l=n[1]-t[1],d=n[0]-r[0],p=n[1]-r[1];return s*p-d*l==0&&s*d<=0&&l*p<=0}function Vs(n,t,r,s){return(l=[s[0]-r[0],s[1]-r[1]])[0]*(d=[t[0]-n[0],t[1]-n[1]])[1]-l[1]*d[0]!=0&&!(!fl(n,t,r,s)||!fl(r,s,n,t));var l,d}function pl(n,t,r){for(const s of r)for(let l=0;l(l=n)[1]!=(p=m[g+1])[1]>l[1]&&l[0]<(p[0]-d[0])*(l[1]-d[1])/(p[1]-d[1])+d[0]&&(s=!s)}var l,d,p;return s}function Ac(n,t){for(const r of t)if(on(n,r))return!0;return!1}function Ka(n,t){for(const r of n)if(!on(r,t))return!1;for(let r=0;r0&&m<0||p<0&&m>0}function Ya(n,t,r){const s=[];for(let l=0;lr[2]){const l=.5*s;let d=n[0]-r[0]>l?-s:r[0]-n[0]>l?s:0;d===0&&(d=n[0]-r[2]>l?-s:r[2]-n[0]>l?s:0),n[0]+=d}cs(t,n)}function Ja(n,t,r,s){const l=Math.pow(2,s.z)*Ei,d=[s.x*Ei,s.y*Ei],p=[];for(const m of n)for(const g of m){const x=[g.x+d[0],g.y+d[1]];_l(x,t,r,l),p.push(x)}return p}function Qa(n,t,r,s){const l=Math.pow(2,s.z)*Ei,d=[s.x*Ei,s.y*Ei],p=[];for(const g of n){const x=[];for(const b of g){const w=[b.x+d[0],b.y+d[1]];cs(t,w),x.push(w)}p.push(x)}if(t[2]-t[0]<=l/2){(m=t)[0]=m[1]=1/0,m[2]=m[3]=-1/0;for(const g of p)for(const x of g)_l(x,t,r,l)}var m;return p}class Ir{constructor(t,r){this.type=De,this.geojson=t,this.geometries=r}static parse(t,r){if(t.length!==2)return r.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(rn(t[1])){const s=t[1];if(s.type==="FeatureCollection"){const l=[];for(const d of s.features){const{type:p,coordinates:m}=d.geometry;p==="Polygon"&&l.push(m),p==="MultiPolygon"&&l.push(...m)}if(l.length)return new Ir(s,{type:"MultiPolygon",coordinates:l})}else if(s.type==="Feature"){const l=s.geometry.type;if(l==="Polygon"||l==="MultiPolygon")return new Ir(s,s.geometry)}else if(s.type==="Polygon"||s.type==="MultiPolygon")return new Ir(s,s)}return r.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(t.geometry()!=null&&t.canonicalID()!=null){if(t.geometryType()==="Point")return function(r,s){const l=[1/0,1/0,-1/0,-1/0],d=[1/0,1/0,-1/0,-1/0],p=r.canonicalID();if(s.type==="Polygon"){const m=Ya(s.coordinates,d,p),g=Ja(r.geometry(),l,d,p);if(!hs(l,d))return!1;for(const x of g)if(!on(x,m))return!1}if(s.type==="MultiPolygon"){const m=ml(s.coordinates,d,p),g=Ja(r.geometry(),l,d,p);if(!hs(l,d))return!1;for(const x of g)if(!Ac(x,m))return!1}return!0}(t,this.geometries);if(t.geometryType()==="LineString")return function(r,s){const l=[1/0,1/0,-1/0,-1/0],d=[1/0,1/0,-1/0,-1/0],p=r.canonicalID();if(s.type==="Polygon"){const m=Ya(s.coordinates,d,p),g=Qa(r.geometry(),l,d,p);if(!hs(l,d))return!1;for(const x of g)if(!Ka(x,m))return!1}if(s.type==="MultiPolygon"){const m=ml(s.coordinates,d,p),g=Qa(r.geometry(),l,d,p);if(!hs(l,d))return!1;for(const x of g)if(!zc(x,m))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let gl=class{constructor(n=[],t=(r,s)=>rs?1:0){if(this.data=n,this.length=this.data.length,this.compare=t,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(n){this.data.push(n),this._up(this.length++)}pop(){if(this.length===0)return;const n=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),n}peek(){return this.data[0]}_up(n){const{data:t,compare:r}=this,s=t[n];for(;n>0;){const l=n-1>>1,d=t[l];if(r(s,d)>=0)break;t[n]=d,n=l}t[n]=s}_down(n){const{data:t,compare:r}=this,s=this.length>>1,l=t[n];for(;n=0)break;t[n]=t[d],n=d}t[n]=l}};function yl(n,t,r=0,s=n.length-1,l=eo){for(;s>r;){if(s-r>600){const g=s-r+1,x=t-r+1,b=Math.log(g),w=.5*Math.exp(2*b/3),M=.5*Math.sqrt(b*w*(g-w)/g)*(x-g/2<0?-1:1);yl(n,t,Math.max(r,Math.floor(t-x*w/g+M)),Math.min(s,Math.floor(t+(g-x)*w/g+M)),l)}const d=n[t];let p=r,m=s;for(us(n,r,t),l(n[s],d)>0&&us(n,r,s);p0;)m--}l(n[r],d)===0?us(n,r,m):(m++,us(n,m,s)),m<=t&&(r=m+1),t<=m&&(s=m-1)}}function us(n,t,r){const s=n[t];n[t]=n[r],n[r]=s}function eo(n,t){return nt?1:0}function Us(n,t){if(n.length<=1)return[n];const r=[];let s,l;for(const d of n){const p=Dc(d);p!==0&&(d.area=Math.abs(p),l===void 0&&(l=p<0),l===p<0?(s&&r.push(s),s=[d]):s.push(d))}if(s&&r.push(s),t>1)for(let d=0;d1?(x=t[g+1][0],b=t[g+1][1]):C>0&&(x+=w/this.kx*C,b+=M/this.ky*C)),w=this.wrap(r[0]-x)*this.kx,M=(r[1]-b)*this.ky;const E=w*w+M*M;E180;)t-=360;return t}}function no(n,t){return t[0]-n[0]}function ds(n){return n[1]-n[0]+1}function nr(n,t){return n[1]>=n[0]&&n[1]n[1])return[null,null];const r=ds(n);if(t){if(r===2)return[n,null];const l=Math.floor(r/2);return[[n[0],n[0]+l],[n[0]+l,n[1]]]}if(r===1)return[n,null];const s=Math.floor(r/2)-1;return[[n[0],n[0]+s],[n[0]+s+1,n[1]]]}function ao(n,t){if(!nr(t,n.length))return[1/0,1/0,-1/0,-1/0];const r=[1/0,1/0,-1/0,-1/0];for(let s=t[0];s<=t[1];++s)cs(r,n[s]);return r}function Zs(n){const t=[1/0,1/0,-1/0,-1/0];for(const r of n)for(const s of r)cs(t,s);return t}function vl(n){return n[0]!==-1/0&&n[1]!==-1/0&&n[2]!==1/0&&n[3]!==1/0}function oo(n,t,r){if(!vl(n)||!vl(t))return NaN;let s=0,l=0;return n[2]t[2]&&(s=n[0]-t[2]),n[1]>t[3]&&(l=n[1]-t[3]),n[3]=s)return s;if(hs(l,d)){if(bl(n,t))return 0}else if(bl(t,n))return 0;let p=1/0;for(const m of n)for(let g=0,x=m.length,b=x-1;g0;){const g=p.pop();if(g[0]>=d)continue;const x=g[1],b=t?50:100;if(ds(x)<=b){if(!nr(x,n.length))return NaN;if(t){const w=Bc(n,x,r,s);if(isNaN(w)||w===0)return w;d=Math.min(d,w)}else for(let w=x[0];w<=x[1];++w){const M=Lc(n[w],r,s);if(d=Math.min(d,M),d===0)return 0}}else{const w=so(x,t);wl(p,d,s,n,m,w[0]),wl(p,d,s,n,m,w[1])}}return d}function qs(n,t,r,s,l,d=1/0){let p=Math.min(d,l.distance(n[0],r[0]));if(p===0)return p;const m=new gl([[0,[0,n.length-1],[0,r.length-1]]],no);for(;m.length>0;){const g=m.pop();if(g[0]>=p)continue;const x=g[1],b=g[2],w=t?50:100,M=s?50:100;if(ds(x)<=w&&ds(b)<=M){if(!nr(x,n.length)&&nr(b,r.length))return NaN;let C;if(t&&s)C=it(n,x,r,b,l),p=Math.min(p,C);else if(t&&!s){const E=n.slice(x[0],x[1]+1);for(let k=b[0];k<=b[1];++k)if(C=ln(r[k],E,l),p=Math.min(p,C),p===0)return p}else if(!t&&s){const E=r.slice(b[0],b[1]+1);for(let k=x[0];k<=x[1];++k)if(C=ln(n[k],E,l),p=Math.min(p,C),p===0)return p}else C=Rc(n,x,r,b,l),p=Math.min(p,C)}else{const C=so(x,t),E=so(b,s);Gs(m,p,l,n,r,C[0],E[0]),Gs(m,p,l,n,r,C[0],E[1]),Gs(m,p,l,n,r,C[1],E[0]),Gs(m,p,l,n,r,C[1],E[1])}}return p}function co(n){return n.type==="MultiPolygon"?n.coordinates.map(t=>({type:"Polygon",coordinates:t})):n.type==="MultiLineString"?n.coordinates.map(t=>({type:"LineString",coordinates:t})):n.type==="MultiPoint"?n.coordinates.map(t=>({type:"Point",coordinates:t})):[n]}class cn{constructor(t,r){this.type=ge,this.geojson=t,this.geometries=r}static parse(t,r){if(t.length!==2)return r.error(`'distance' expression requires exactly one argument, but found ${t.length-1} instead.`);if(rn(t[1])){const s=t[1];if(s.type==="FeatureCollection")return new cn(s,s.features.map(l=>co(l.geometry)).flat());if(s.type==="Feature")return new cn(s,co(s.geometry));if("type"in s&&"coordinates"in s)return new cn(s,co(s))}return r.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(t.geometry()!=null&&t.canonicalID()!=null){if(t.geometryType()==="Point")return function(r,s){const l=r.geometry(),d=l.flat().map(g=>Wa([g.x,g.y],r.canonical));if(l.length===0)return NaN;const p=new ro(d[0][1]);let m=1/0;for(const g of s){switch(g.type){case"Point":m=Math.min(m,qs(d,!1,[g.coordinates],!1,p,m));break;case"LineString":m=Math.min(m,qs(d,!1,g.coordinates,!0,p,m));break;case"Polygon":m=Math.min(m,$s(d,!1,g.coordinates,p,m))}if(m===0)return m}return m}(t,this.geometries);if(t.geometryType()==="LineString")return function(r,s){const l=r.geometry(),d=l.flat().map(g=>Wa([g.x,g.y],r.canonical));if(l.length===0)return NaN;const p=new ro(d[0][1]);let m=1/0;for(const g of s){switch(g.type){case"Point":m=Math.min(m,qs(d,!0,[g.coordinates],!1,p,m));break;case"LineString":m=Math.min(m,qs(d,!0,g.coordinates,!0,p,m));break;case"Polygon":m=Math.min(m,$s(d,!0,g.coordinates,p,m))}if(m===0)return m}return m}(t,this.geometries);if(t.geometryType()==="Polygon")return function(r,s){const l=r.geometry();if(l.length===0||l[0].length===0)return NaN;const d=Us(l,0).map(g=>g.map(x=>x.map(b=>Wa([b.x,b.y],r.canonical)))),p=new ro(d[0][0][0][1]);let m=1/0;for(const g of s)for(const x of d){switch(g.type){case"Point":m=Math.min(m,$s([g.coordinates],!1,x,p,m));break;case"LineString":m=Math.min(m,$s(g.coordinates,!0,x,p,m));break;case"Polygon":m=Math.min(m,Fc(x,g.coordinates,p,m))}if(m===0)return m}return m}(t,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}const Cn={"==":dl,"!=":Ic,">":Ha,"<":Os,">=":js,"<=":Cc,array:Ci,at:rs,boolean:Ci,case:ns,coalesce:sn,collator:an,format:ls,image:In,in:Qe,"index-of":Mn,interpolate:ct,"interpolate-hcl":ct,"interpolate-lab":ct,length:Xa,let:Ye,literal:Xi,match:Fi,number:Ci,"number-format":gi,object:Ci,slice:ss,step:nn,string:Ci,"to-boolean":rr,"to-color":rr,"to-number":rr,"to-string":rr,var:Ge,within:Ir,distance:cn};class Ai{constructor(t,r,s,l){this.name=t,this.type=r,this._evaluate=s,this.args=l}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}static parse(t,r){const s=t[0],l=Ai.definitions[s];if(!l)return r.error(`Unknown expression "${s}". If you wanted a literal array, use ["literal", [...]].`,0);const d=Array.isArray(l)?l[0]:l.type,p=Array.isArray(l)?[[l[1],l[2]]]:l.overloads,m=p.filter(([x])=>!Array.isArray(x)||x.length===t.length-1);let g=null;for(const[x,b]of m){g=new Pn(r.registry,Hs,r.path,null,r.scope);const w=[];let M=!1;for(let C=1;C{return M=w,Array.isArray(M)?`(${M.map(_t).join(", ")})`:`(${_t(M.type)}...)`;var M}).join(" | "),b=[];for(let w=1;w{r=t?r&&Hs(s):r&&s instanceof Xi}),!!r&&Xs(n)&&Ws(n,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Xs(n){if(n instanceof Ai&&(n.name==="get"&&n.args.length===1||n.name==="feature-state"||n.name==="has"&&n.args.length===1||n.name==="properties"||n.name==="geometry-type"||n.name==="id"||/^filter-/.test(n.name))||n instanceof Ir||n instanceof cn)return!1;let t=!0;return n.eachChild(r=>{t&&!Xs(r)&&(t=!1)}),t}function ps(n){if(n instanceof Ai&&n.name==="feature-state")return!1;let t=!0;return n.eachChild(r=>{t&&!ps(r)&&(t=!1)}),t}function Ws(n,t){if(n instanceof Ai&&t.indexOf(n.name)>=0)return!1;let r=!0;return n.eachChild(s=>{r&&!Ws(s,t)&&(r=!1)}),r}function Ml(n){return{result:"success",value:n}}function En(n){return{result:"error",value:n}}function An(n){return n["property-type"]==="data-driven"||n["property-type"]==="cross-faded-data-driven"}function Sl(n){return!!n.expression&&n.expression.parameters.indexOf("zoom")>-1}function uo(n){return!!n.expression&&n.expression.interpolated}function tt(n){return n instanceof Number?"number":n instanceof String?"string":n instanceof Boolean?"boolean":Array.isArray(n)?"array":n===null?"null":typeof n}function Ks(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}function Oc(n){return n}function Il(n,t){const r=t.type==="color",s=n.stops&&typeof n.stops[0][0]=="object",l=s||!(s||n.property!==void 0),d=n.type||(uo(t)?"exponential":"interval");if(r||t.type==="padding"){const b=r?Xe.parse:Nt.parse;(n=Ie({},n)).stops&&(n.stops=n.stops.map(w=>[w[0],b(w[1])])),n.default=b(n.default?n.default:t.default)}if(n.colorSpace&&(p=n.colorSpace)!=="rgb"&&p!=="hcl"&&p!=="lab")throw new Error(`Unknown color space: "${n.colorSpace}"`);var p;let m,g,x;if(d==="exponential")m=Cl;else if(d==="interval")m=jc;else if(d==="categorical"){m=po,g=Object.create(null);for(const b of n.stops)g[b[0]]=b[1];x=typeof n.stops[0][0]}else{if(d!=="identity")throw new Error(`Unknown function type "${d}"`);m=Nc}if(s){const b={},w=[];for(let E=0;EE[0]),evaluate:({zoom:E},k)=>Cl({stops:M,base:n.base},t,E).evaluate(E,k)}}if(l){const b=d==="exponential"?{name:"exponential",base:n.base!==void 0?n.base:1}:null;return{kind:"camera",interpolationType:b,interpolationFactor:ct.interpolationFactor.bind(void 0,b),zoomStops:n.stops.map(w=>w[0]),evaluate:({zoom:w})=>m(n,t,w,g,x)}}return{kind:"source",evaluate(b,w){const M=w&&w.properties?w.properties[n.property]:void 0;return M===void 0?fs(n.default,t.default):m(n,t,M,g,x)}}}function fs(n,t,r){return n!==void 0?n:t!==void 0?t:r!==void 0?r:void 0}function po(n,t,r,s,l){return fs(typeof r===l?s[r]:void 0,n.default,t.default)}function jc(n,t,r){if(tt(r)!=="number")return fs(n.default,t.default);const s=n.stops.length;if(s===1||r<=n.stops[0][0])return n.stops[0][1];if(r>=n.stops[s-1][0])return n.stops[s-1][1];const l=as(n.stops.map(d=>d[0]),r);return n.stops[l][1]}function Cl(n,t,r){const s=n.base!==void 0?n.base:1;if(tt(r)!=="number")return fs(n.default,t.default);const l=n.stops.length;if(l===1||r<=n.stops[0][0])return n.stops[0][1];if(r>=n.stops[l-1][0])return n.stops[l-1][1];const d=as(n.stops.map(b=>b[0]),r),p=function(b,w,M,C){const E=C-M,k=b-M;return E===0?0:w===1?k/E:(Math.pow(w,k)-1)/(Math.pow(w,E)-1)}(r,s,n.stops[d][0],n.stops[d+1][0]),m=n.stops[d][1],g=n.stops[d+1][1],x=Oi[t.type]||Oc;return typeof m.evaluate=="function"?{evaluate(...b){const w=m.evaluate.apply(void 0,b),M=g.evaluate.apply(void 0,b);if(w!==void 0&&M!==void 0)return x(w,M,p,n.colorSpace)}}:x(m,g,p,n.colorSpace)}function Nc(n,t,r){switch(t.type){case"color":r=Xe.parse(r);break;case"formatted":r=Et.fromString(r.toString());break;case"resolvedImage":r=ri.fromString(r.toString());break;case"padding":r=Nt.parse(r);break;default:tt(r)===t.type||t.type==="enum"&&t.values[r]||(r=void 0)}return fs(r,n.default,t.default)}Ai.register(Cn,{error:[{kind:"error"},[Ce],(n,[t])=>{throw new wt(t.evaluate(n))}],typeof:[Ce,[ze],(n,[t])=>_t(ut(t.evaluate(n)))],"to-rgba":[_i(ge,4),[qe],(n,[t])=>{const[r,s,l,d]=t.evaluate(n).rgb;return[255*r,255*s,255*l,d]}],rgb:[qe,[ge,ge,ge],Tl],rgba:[qe,[ge,ge,ge,ge],Tl],has:{type:De,overloads:[[[Ce],(n,[t])=>Pl(t.evaluate(n),n.properties())],[[Ce,Ve],(n,[t,r])=>Pl(t.evaluate(n),r.evaluate(n))]]},get:{type:ze,overloads:[[[Ce],(n,[t])=>ho(t.evaluate(n),n.properties())],[[Ce,Ve],(n,[t,r])=>ho(t.evaluate(n),r.evaluate(n))]]},"feature-state":[ze,[Ce],(n,[t])=>ho(t.evaluate(n),n.featureState||{})],properties:[Ve,[],n=>n.properties()],"geometry-type":[Ce,[],n=>n.geometryType()],id:[ze,[],n=>n.id()],zoom:[ge,[],n=>n.globals.zoom],"heatmap-density":[ge,[],n=>n.globals.heatmapDensity||0],"line-progress":[ge,[],n=>n.globals.lineProgress||0],accumulated:[ze,[],n=>n.globals.accumulated===void 0?null:n.globals.accumulated],"+":[ge,hn(ge),(n,t)=>{let r=0;for(const s of t)r+=s.evaluate(n);return r}],"*":[ge,hn(ge),(n,t)=>{let r=1;for(const s of t)r*=s.evaluate(n);return r}],"-":{type:ge,overloads:[[[ge,ge],(n,[t,r])=>t.evaluate(n)-r.evaluate(n)],[[ge],(n,[t])=>-t.evaluate(n)]]},"/":[ge,[ge,ge],(n,[t,r])=>t.evaluate(n)/r.evaluate(n)],"%":[ge,[ge,ge],(n,[t,r])=>t.evaluate(n)%r.evaluate(n)],ln2:[ge,[],()=>Math.LN2],pi:[ge,[],()=>Math.PI],e:[ge,[],()=>Math.E],"^":[ge,[ge,ge],(n,[t,r])=>Math.pow(t.evaluate(n),r.evaluate(n))],sqrt:[ge,[ge],(n,[t])=>Math.sqrt(t.evaluate(n))],log10:[ge,[ge],(n,[t])=>Math.log(t.evaluate(n))/Math.LN10],ln:[ge,[ge],(n,[t])=>Math.log(t.evaluate(n))],log2:[ge,[ge],(n,[t])=>Math.log(t.evaluate(n))/Math.LN2],sin:[ge,[ge],(n,[t])=>Math.sin(t.evaluate(n))],cos:[ge,[ge],(n,[t])=>Math.cos(t.evaluate(n))],tan:[ge,[ge],(n,[t])=>Math.tan(t.evaluate(n))],asin:[ge,[ge],(n,[t])=>Math.asin(t.evaluate(n))],acos:[ge,[ge],(n,[t])=>Math.acos(t.evaluate(n))],atan:[ge,[ge],(n,[t])=>Math.atan(t.evaluate(n))],min:[ge,hn(ge),(n,t)=>Math.min(...t.map(r=>r.evaluate(n)))],max:[ge,hn(ge),(n,t)=>Math.max(...t.map(r=>r.evaluate(n)))],abs:[ge,[ge],(n,[t])=>Math.abs(t.evaluate(n))],round:[ge,[ge],(n,[t])=>{const r=t.evaluate(n);return r<0?-Math.round(-r):Math.round(r)}],floor:[ge,[ge],(n,[t])=>Math.floor(t.evaluate(n))],ceil:[ge,[ge],(n,[t])=>Math.ceil(t.evaluate(n))],"filter-==":[De,[Ce,ze],(n,[t,r])=>n.properties()[t.value]===r.value],"filter-id-==":[De,[ze],(n,[t])=>n.id()===t.value],"filter-type-==":[De,[Ce],(n,[t])=>n.geometryType()===t.value],"filter-<":[De,[Ce,ze],(n,[t,r])=>{const s=n.properties()[t.value],l=r.value;return typeof s==typeof l&&s{const r=n.id(),s=t.value;return typeof r==typeof s&&r":[De,[Ce,ze],(n,[t,r])=>{const s=n.properties()[t.value],l=r.value;return typeof s==typeof l&&s>l}],"filter-id->":[De,[ze],(n,[t])=>{const r=n.id(),s=t.value;return typeof r==typeof s&&r>s}],"filter-<=":[De,[Ce,ze],(n,[t,r])=>{const s=n.properties()[t.value],l=r.value;return typeof s==typeof l&&s<=l}],"filter-id-<=":[De,[ze],(n,[t])=>{const r=n.id(),s=t.value;return typeof r==typeof s&&r<=s}],"filter->=":[De,[Ce,ze],(n,[t,r])=>{const s=n.properties()[t.value],l=r.value;return typeof s==typeof l&&s>=l}],"filter-id->=":[De,[ze],(n,[t])=>{const r=n.id(),s=t.value;return typeof r==typeof s&&r>=s}],"filter-has":[De,[ze],(n,[t])=>t.value in n.properties()],"filter-has-id":[De,[],n=>n.id()!==null&&n.id()!==void 0],"filter-type-in":[De,[_i(Ce)],(n,[t])=>t.value.indexOf(n.geometryType())>=0],"filter-id-in":[De,[_i(ze)],(n,[t])=>t.value.indexOf(n.id())>=0],"filter-in-small":[De,[Ce,_i(ze)],(n,[t,r])=>r.value.indexOf(n.properties()[t.value])>=0],"filter-in-large":[De,[Ce,_i(ze)],(n,[t,r])=>function(s,l,d,p){for(;d<=p;){const m=d+p>>1;if(l[m]===s)return!0;l[m]>s?p=m-1:d=m+1}return!1}(n.properties()[t.value],r.value,0,r.value.length-1)],all:{type:De,overloads:[[[De,De],(n,[t,r])=>t.evaluate(n)&&r.evaluate(n)],[hn(De),(n,t)=>{for(const r of t)if(!r.evaluate(n))return!1;return!0}]]},any:{type:De,overloads:[[[De,De],(n,[t,r])=>t.evaluate(n)||r.evaluate(n)],[hn(De),(n,t)=>{for(const r of t)if(r.evaluate(n))return!0;return!1}]]},"!":[De,[De],(n,[t])=>!t.evaluate(n)],"is-supported-script":[De,[Ce],(n,[t])=>{const r=n.globals&&n.globals.isSupportedScript;return!r||r(t.evaluate(n))}],upcase:[Ce,[Ce],(n,[t])=>t.evaluate(n).toUpperCase()],downcase:[Ce,[Ce],(n,[t])=>t.evaluate(n).toLowerCase()],concat:[Ce,hn(ze),(n,t)=>t.map(r=>is(r.evaluate(n))).join("")],"resolved-locale":[Ce,[St],(n,[t])=>t.evaluate(n).resolvedLocale()]});class Ys{constructor(t,r){var s;this.expression=t,this._warningHistory={},this._evaluator=new dt,this._defaultValue=r?(s=r).type==="color"&&Ks(s.default)?new Xe(0,0,0,0):s.type==="color"?Xe.parse(s.default)||null:s.type==="padding"?Nt.parse(s.default)||null:s.type==="variableAnchorOffsetCollection"?ii.parse(s.default)||null:s.type==="projectionDefinition"?ni.parse(s.default)||null:s.default===void 0?null:s.default:null,this._enumValues=r&&r.type==="enum"?r.values:null}evaluateWithoutErrorHandling(t,r,s,l,d,p){return this._evaluator.globals=t,this._evaluator.feature=r,this._evaluator.featureState=s,this._evaluator.canonical=l,this._evaluator.availableImages=d||null,this._evaluator.formattedSection=p,this.expression.evaluate(this._evaluator)}evaluate(t,r,s,l,d,p){this._evaluator.globals=t,this._evaluator.feature=r||null,this._evaluator.featureState=s||null,this._evaluator.canonical=l,this._evaluator.availableImages=d||null,this._evaluator.formattedSection=p||null;try{const m=this.expression.evaluate(this._evaluator);if(m==null||typeof m=="number"&&m!=m)return this._defaultValue;if(this._enumValues&&!(m in this._enumValues))throw new wt(`Expected value to be one of ${Object.keys(this._enumValues).map(g=>JSON.stringify(g)).join(", ")}, but found ${JSON.stringify(m)} instead.`);return m}catch(m){return this._warningHistory[m.message]||(this._warningHistory[m.message]=!0,typeof console<"u"&&console.warn(m.message)),this._defaultValue}}}function Js(n){return Array.isArray(n)&&n.length>0&&typeof n[0]=="string"&&n[0]in Cn}function Qs(n,t){const r=new Pn(Cn,Hs,[],t?function(l){const d={color:qe,string:Ce,number:ge,enum:Ce,boolean:De,formatted:Mr,padding:jt,projectionDefinition:Je,resolvedImage:Rt,variableAnchorOffsetCollection:mt};return l.type==="array"?_i(d[l.value]||ze,l.length):d[l.type]}(t):void 0),s=r.parse(n,void 0,void 0,void 0,t&&t.type==="string"?{typeAnnotation:"coerce"}:void 0);return s?Ml(new Ys(s,t)):En(r.errors)}class zn{constructor(t,r){this.kind=t,this._styleExpression=r,this.isStateDependent=t!=="constant"&&!ps(r.expression)}evaluateWithoutErrorHandling(t,r,s,l,d,p){return this._styleExpression.evaluateWithoutErrorHandling(t,r,s,l,d,p)}evaluate(t,r,s,l,d,p){return this._styleExpression.evaluate(t,r,s,l,d,p)}}class ea{constructor(t,r,s,l){this.kind=t,this.zoomStops=s,this._styleExpression=r,this.isStateDependent=t!=="camera"&&!ps(r.expression),this.interpolationType=l}evaluateWithoutErrorHandling(t,r,s,l,d,p){return this._styleExpression.evaluateWithoutErrorHandling(t,r,s,l,d,p)}evaluate(t,r,s,l,d,p){return this._styleExpression.evaluate(t,r,s,l,d,p)}interpolationFactor(t,r,s){return this.interpolationType?ct.interpolationFactor(this.interpolationType,t,r,s):0}}function El(n,t){const r=Qs(n,t);if(r.result==="error")return r;const s=r.value.expression,l=Xs(s);if(!l&&!An(t))return En([new Me("","data expressions not supported")]);const d=Ws(s,["zoom"]);if(!d&&!Sl(t))return En([new Me("","zoom expressions not supported")]);const p=ia(s);return p||d?p instanceof Me?En([p]):p instanceof ct&&!uo(t)?En([new Me("",'"interpolate" expressions cannot be used with this property')]):Ml(p?new ea(l?"camera":"composite",r.value,p.labels,p instanceof ct?p.interpolation:void 0):new zn(l?"constant":"source",r.value)):En([new Me("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class ta{constructor(t,r){this._parameters=t,this._specification=r,Ie(this,Il(this._parameters,this._specification))}static deserialize(t){return new ta(t._parameters,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification}}}function ia(n){let t=null;if(n instanceof Ye)t=ia(n.result);else if(n instanceof sn){for(const r of n.args)if(t=ia(r),t)break}else(n instanceof nn||n instanceof ct)&&n.input instanceof Ai&&n.input.name==="zoom"&&(t=n);return t instanceof Me||n.eachChild(r=>{const s=ia(r);s instanceof Me?t=s:!t&&s?t=new Me("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&s&&t!==s&&(t=new Me("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),t}function fo(n){if(n===!0||n===!1)return!0;if(!Array.isArray(n)||n.length===0)return!1;switch(n[0]){case"has":return n.length>=2&&n[1]!=="$id"&&n[1]!=="$type";case"in":return n.length>=3&&(typeof n[1]!="string"||Array.isArray(n[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return n.length!==3||Array.isArray(n[1])||Array.isArray(n[2]);case"any":case"all":for(const t of n.slice(1))if(!fo(t)&&typeof t!="boolean")return!1;return!0;default:return!0}}const Vc={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function ra(n){if(n==null)return{filter:()=>!0,needGeometry:!1};fo(n)||(n=na(n));const t=Qs(n,Vc);if(t.result==="error")throw new Error(t.value.map(r=>`${r.key}: ${r.message}`).join(", "));return{filter:(r,s,l)=>t.value.evaluate(r,s,{},l),needGeometry:zl(n)}}function Al(n,t){return nt?1:0}function zl(n){if(!Array.isArray(n))return!1;if(n[0]==="within"||n[0]==="distance")return!0;for(let t=1;t"||t==="<="||t===">="?sa(n[1],n[2],t):t==="any"?(r=n.slice(1),["any"].concat(r.map(na))):t==="all"?["all"].concat(n.slice(1).map(na)):t==="none"?["all"].concat(n.slice(1).map(na).map(ms)):t==="in"?mo(n[1],n.slice(2)):t==="!in"?ms(mo(n[1],n.slice(2))):t==="has"?_o(n[1]):t!=="!has"||ms(_o(n[1]));var r}function sa(n,t,r){switch(n){case"$type":return[`filter-type-${r}`,t];case"$id":return[`filter-id-${r}`,t];default:return[`filter-${r}`,n,t]}}function mo(n,t){if(t.length===0)return!1;switch(n){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some(r=>typeof r!=typeof t[0])?["filter-in-large",n,["literal",t.sort(Al)]]:["filter-in-small",n,["literal",t]]}}function _o(n){switch(n){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",n]}}function ms(n){return["!",n]}function _s(n){const t=typeof n;if(t==="number"||t==="boolean"||t==="string"||n==null)return JSON.stringify(n);if(Array.isArray(n)){let l="[";for(const d of n)l+=`${_s(d)},`;return`${l}]`}const r=Object.keys(n).sort();let s="{";for(let l=0;ls.maximum?[new te(t,r,`${r} is greater than the maximum value ${s.maximum}`)]:[]}function kl(n){const t=n.valueSpec,r=gt(n.value.type);let s,l,d,p={};const m=r!=="categorical"&&n.value.property===void 0,g=!m,x=tt(n.value.stops)==="array"&&tt(n.value.stops[0])==="array"&&tt(n.value.stops[0][0])==="object",b=zi({key:n.key,value:n.value,valueSpec:n.styleSpec.function,validateSpec:n.validateSpec,style:n.style,styleSpec:n.styleSpec,objectElementValidators:{stops:function(C){if(r==="identity")return[new te(C.key,C.value,'identity function may not have a "stops" property')];let E=[];const k=C.value;return E=E.concat(yo({key:C.key,value:k,valueSpec:C.valueSpec,validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec,arrayElementValidator:w})),tt(k)==="array"&&k.length===0&&E.push(new te(C.key,k,"array must have at least one stop")),E},default:function(C){return C.validateSpec({key:C.key,value:C.value,valueSpec:t,validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec})}}});return r==="identity"&&m&&b.push(new te(n.key,n.value,'missing required property "property"')),r==="identity"||n.value.stops||b.push(new te(n.key,n.value,'missing required property "stops"')),r==="exponential"&&n.valueSpec.expression&&!uo(n.valueSpec)&&b.push(new te(n.key,n.value,"exponential functions not supported")),n.styleSpec.$version>=8&&(g&&!An(n.valueSpec)?b.push(new te(n.key,n.value,"property functions not supported")):m&&!Sl(n.valueSpec)&&b.push(new te(n.key,n.value,"zoom functions not supported"))),r!=="categorical"&&!x||n.value.property!==void 0||b.push(new te(n.key,n.value,'"property" property is required')),b;function w(C){let E=[];const k=C.value,O=C.key;if(tt(k)!=="array")return[new te(O,k,`array expected, ${tt(k)} found`)];if(k.length!==2)return[new te(O,k,`array length 2 expected, length ${k.length} found`)];if(x){if(tt(k[0])!=="object")return[new te(O,k,`object expected, ${tt(k[0])} found`)];if(k[0].zoom===void 0)return[new te(O,k,"object stop key must have zoom")];if(k[0].value===void 0)return[new te(O,k,"object stop key must have value")];if(d&&d>gt(k[0].zoom))return[new te(O,k[0].zoom,"stop zoom values must appear in ascending order")];gt(k[0].zoom)!==d&&(d=gt(k[0].zoom),l=void 0,p={}),E=E.concat(zi({key:`${O}[0]`,value:k[0],valueSpec:{zoom:{}},validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec,objectElementValidators:{zoom:xo,value:M}}))}else E=E.concat(M({key:`${O}[0]`,value:k[0],validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec},k));return Js(un(k[1]))?E.concat([new te(`${O}[1]`,k[1],"expressions are not allowed in function stops.")]):E.concat(C.validateSpec({key:`${O}[1]`,value:k[1],valueSpec:t,validateSpec:C.validateSpec,style:C.style,styleSpec:C.styleSpec}))}function M(C,E){const k=tt(C.value),O=gt(C.value),Z=C.value!==null?C.value:E;if(s){if(k!==s)return[new te(C.key,Z,`${k} stop domain type must match previous stop domain type ${s}`)]}else s=k;if(k!=="number"&&k!=="string"&&k!=="boolean")return[new te(C.key,Z,"stop domain value must be a number, string, or boolean")];if(k!=="number"&&r!=="categorical"){let ee=`number expected, ${k} found`;return An(t)&&r===void 0&&(ee+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new te(C.key,Z,ee)]}return r!=="categorical"||k!=="number"||isFinite(O)&&Math.floor(O)===O?r!=="categorical"&&k==="number"&&l!==void 0&&Onew te(`${n.key}${s.key}`,n.value,s.message));const r=t.value.expression||t.value._styleExpression.expression;if(n.expressionContext==="property"&&n.propertyKey==="text-font"&&!r.outputDefined())return[new te(n.key,n.value,`Invalid data expression for "${n.propertyKey}". Output values must be contained as literals within the expression.`)];if(n.expressionContext==="property"&&n.propertyType==="layout"&&!ps(r))return[new te(n.key,n.value,'"feature-state" data expressions are not supported with layout properties.')];if(n.expressionContext==="filter"&&!ps(r))return[new te(n.key,n.value,'"feature-state" data expressions are not supported with filters.')];if(n.expressionContext&&n.expressionContext.indexOf("cluster")===0){if(!Ws(r,["zoom","feature-state"]))return[new te(n.key,n.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(n.expressionContext==="cluster-initial"&&!Xs(r))return[new te(n.key,n.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Dn(n){const t=n.key,r=n.value,s=n.valueSpec,l=[];return Array.isArray(s.values)?s.values.indexOf(gt(r))===-1&&l.push(new te(t,r,`expected one of [${s.values.join(", ")}], ${JSON.stringify(r)} found`)):Object.keys(s.values).indexOf(gt(r))===-1&&l.push(new te(t,r,`expected one of [${Object.keys(s.values).join(", ")}], ${JSON.stringify(r)} found`)),l}function oa(n){return fo(un(n.value))?kn(Ie({},n,{expressionContext:"filter",valueSpec:{value:"boolean"}})):gs(n)}function gs(n){const t=n.value,r=n.key;if(tt(t)!=="array")return[new te(r,t,`array expected, ${tt(t)} found`)];const s=n.styleSpec;let l,d=[];if(t.length<1)return[new te(r,t,"filter array must have at least 1 element")];switch(d=d.concat(Dn({key:`${r}[0]`,value:t[0],valueSpec:s.filter_operator,style:n.style,styleSpec:n.styleSpec})),gt(t[0])){case"<":case"<=":case">":case">=":t.length>=2&>(t[1])==="$type"&&d.push(new te(r,t,`"$type" cannot be use with operator "${t[0]}"`));case"==":case"!=":t.length!==3&&d.push(new te(r,t,`filter array for operator "${t[0]}" must have 3 elements`));case"in":case"!in":t.length>=2&&(l=tt(t[1]),l!=="string"&&d.push(new te(`${r}[1]`,t[1],`string expected, ${l} found`)));for(let p=2;p