From 2a4dfdce9fff3ef4a2fcb4ee8c6c0bde4885f1aa Mon Sep 17 00:00:00 2001 From: links Date: Wed, 10 Jun 2026 16:26:11 +0800 Subject: [PATCH 1/7] feat: add Seeed Cloud compute provider --- frontend/dist/assets/index-BrfrpyNp.js | 4272 +++++++++++++++++ frontend/dist/assets/index-CKfgS6qV.css | 1 + frontend/dist/index.html | 4 +- frontend/src/components/jobs/HubJobCard.tsx | 53 +- frontend/src/components/jobs/JobsSection.tsx | 57 +- .../components/training/ConfigurationTab.tsx | 11 +- .../training/config/EssentialsCard.tsx | 5 +- .../components/training/config/TargetCard.tsx | 284 +- frontend/src/components/training/types.ts | 4 +- frontend/src/contexts/ApiContext.tsx | 15 +- frontend/src/lib/checkpointsApi.ts | 2 +- frontend/src/lib/jobsApi.ts | 31 +- frontend/src/pages/Recording.tsx | 39 +- frontend/src/pages/Training.tsx | 103 +- lelab/compute_providers.py | 95 + lelab/jobs.py | 455 +- lelab/record.py | 178 +- lelab/rollout.py | 5 + lelab/seeed_cloud_config.py | 87 + lelab/server.py | 232 +- lelab/train.py | 2 +- lelab/utils/hf_auth.py | 29 +- pyproject.toml | 1 + tests/test_compute_providers.py | 434 ++ tests/test_packaging.py | 13 + tests/test_record.py | 83 + tests/test_seeed_cloud_config.py | 61 + tests/test_train.py | 11 + uv.lock | 3173 ++++++++++++ 29 files changed, 9566 insertions(+), 174 deletions(-) create mode 100644 frontend/dist/assets/index-BrfrpyNp.js create mode 100644 frontend/dist/assets/index-CKfgS6qV.css create mode 100644 lelab/compute_providers.py create mode 100644 lelab/seeed_cloud_config.py create mode 100644 tests/test_compute_providers.py create mode 100644 tests/test_packaging.py create mode 100644 tests/test_seeed_cloud_config.py create mode 100644 uv.lock diff --git a/frontend/dist/assets/index-BrfrpyNp.js b/frontend/dist/assets/index-BrfrpyNp.js new file mode 100644 index 0000000..82ac5d1 --- /dev/null +++ b/frontend/dist/assets/index-BrfrpyNp.js @@ -0,0 +1,4272 @@ +var fG=Object.defineProperty;var bP=t=>{throw TypeError(t)};var hG=(t,e,n)=>e in t?fG(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Kb=(t,e,n)=>hG(t,typeof e!="symbol"?e+"":e,n),Yb=(t,e,n)=>e.has(t)||bP("Cannot "+n);var xe=(t,e,n)=>(Yb(t,e,"read from private field"),n?n.call(t):e.get(t)),Xt=(t,e,n)=>e.has(t)?bP("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),At=(t,e,n,r)=>(Yb(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Sr=(t,e,n)=>(Yb(t,e,"access private method"),n);var Jm=(t,e,n,r)=>({set _(i){At(t,e,i,n)},get _(){return xe(t,e,r)}});function pG(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 o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var Zm=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function dn(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Tk={exports:{}},D0={},Mk={exports:{}},kt={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var vm=Symbol.for("react.element"),mG=Symbol.for("react.portal"),gG=Symbol.for("react.fragment"),vG=Symbol.for("react.strict_mode"),yG=Symbol.for("react.profiler"),xG=Symbol.for("react.provider"),bG=Symbol.for("react.context"),_G=Symbol.for("react.forward_ref"),wG=Symbol.for("react.suspense"),SG=Symbol.for("react.memo"),EG=Symbol.for("react.lazy"),_P=Symbol.iterator;function TG(t){return t===null||typeof t!="object"?null:(t=_P&&t[_P]||t["@@iterator"],typeof t=="function"?t:null)}var Ak={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Ck=Object.assign,Pk={};function hf(t,e,n){this.props=t,this.context=e,this.refs=Pk,this.updater=n||Ak}hf.prototype.isReactComponent={};hf.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};hf.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function Rk(){}Rk.prototype=hf.prototype;function KT(t,e,n){this.props=t,this.context=e,this.refs=Pk,this.updater=n||Ak}var YT=KT.prototype=new Rk;YT.constructor=KT;Ck(YT,hf.prototype);YT.isPureReactComponent=!0;var wP=Array.isArray,Nk=Object.prototype.hasOwnProperty,JT={current:null},Ok={key:!0,ref:!0,__self:!0,__source:!0};function Ik(t,e,n){var r,i={},o=null,a=null;if(e!=null)for(r in e.ref!==void 0&&(a=e.ref),e.key!==void 0&&(o=""+e.key),e)Nk.call(e,r)&&!Ok.hasOwnProperty(r)&&(i[r]=e[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1>>1,F=L[K];if(0>>1;Ki(Q,X))tei(ee,Q)?(L[K]=ee,L[te]=X,K=te):(L[K]=Q,L[q]=X,K=q);else if(tei(ee,X))L[K]=ee,L[te]=X,K=te;else break e}}return j}function i(L,j){var X=L.sortIndex-j.sortIndex;return X!==0?X:L.id-j.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var a=Date,s=a.now();t.unstable_now=function(){return a.now()-s}}var l=[],c=[],u=1,d=null,f=3,p=!1,y=!1,v=!1,g=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(L){for(var j=n(c);j!==null;){if(j.callback===null)r(c);else if(j.startTime<=L)r(c),j.sortIndex=j.expirationTime,e(l,j);else break;j=n(c)}}function S(L){if(v=!1,b(L),!y)if(n(l)!==null)y=!0,O(w);else{var j=n(c);j!==null&&W(S,j.startTime-L)}}function w(L,j){y=!1,v&&(v=!1,m(A),A=-1),p=!0;var X=f;try{for(b(j),d=n(l);d!==null&&(!(d.expirationTime>j)||L&&!P());){var K=d.callback;if(typeof K=="function"){d.callback=null,f=d.priorityLevel;var F=K(d.expirationTime<=j);j=t.unstable_now(),typeof F=="function"?d.callback=F:d===n(l)&&r(l),b(j)}else r(l);d=n(l)}if(d!==null)var Y=!0;else{var q=n(c);q!==null&&W(S,q.startTime-j),Y=!1}return Y}finally{d=null,f=X,p=!1}}var E=!1,T=null,A=-1,M=5,C=-1;function P(){return!(t.unstable_now()-CL||125K?(L.sortIndex=X,e(c,L),n(l)===null&&L===n(c)&&(v?(m(A),A=-1):v=!0,W(S,X-K))):(L.sortIndex=F,e(l,L),y||p||(y=!0,O(w))),L},t.unstable_shouldYield=P,t.unstable_wrapCallback=function(L){var j=f;return function(){var X=f;f=j;try{return L.apply(this,arguments)}finally{f=X}}}})(Uk);jk.exports=Uk;var kG=jk.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var jG=_,Oi=kG;function Ce(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),cS=Object.prototype.hasOwnProperty,UG=/^[: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]*$/,EP={},TP={};function FG(t){return cS.call(TP,t)?!0:cS.call(EP,t)?!1:UG.test(t)?TP[t]=!0:(EP[t]=!0,!1)}function BG(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function $G(t,e,n,r){if(e===null||typeof e>"u"||BG(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Jr(t,e,n,r,i,o,a){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=o,this.removeEmptyString=a}var xr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){xr[t]=new Jr(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];xr[e]=new Jr(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){xr[t]=new Jr(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){xr[t]=new Jr(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){xr[t]=new Jr(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){xr[t]=new Jr(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){xr[t]=new Jr(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){xr[t]=new Jr(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){xr[t]=new Jr(t,5,!1,t.toLowerCase(),null,!1,!1)});var eM=/[\-:]([a-z])/g;function tM(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(eM,tM);xr[e]=new Jr(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(eM,tM);xr[e]=new Jr(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(eM,tM);xr[e]=new Jr(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){xr[t]=new Jr(t,1,!1,t.toLowerCase(),null,!1,!1)});xr.xlinkHref=new Jr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){xr[t]=new Jr(t,1,!1,t.toLowerCase(),null,!0,!0)});function nM(t,e,n,r){var i=xr.hasOwnProperty(e)?xr[e]:null;(i!==null?i.type!==0:r||!(2s||i[a]!==o[s]){var l=` +`+i[a].replace(" at new "," at ");return t.displayName&&l.includes("")&&(l=l.replace("",t.displayName)),l}while(1<=a&&0<=s);break}}}finally{Qb=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?wh(t):""}function zG(t){switch(t.tag){case 5:return wh(t.type);case 16:return wh("Lazy");case 13:return wh("Suspense");case 19:return wh("SuspenseList");case 0:case 2:case 15:return t=e_(t.type,!1),t;case 11:return t=e_(t.type.render,!1),t;case 1:return t=e_(t.type,!0),t;default:return""}}function hS(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Ru:return"Fragment";case Pu:return"Portal";case uS:return"Profiler";case rM:return"StrictMode";case dS:return"Suspense";case fS:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case $k:return(t.displayName||"Context")+".Consumer";case Bk:return(t._context.displayName||"Context")+".Provider";case iM:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case oM:return e=t.displayName||null,e!==null?e:hS(t.type)||"Memo";case Ms:e=t._payload,t=t._init;try{return hS(t(e))}catch{}}return null}function HG(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return hS(e);case 8:return e===rM?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function il(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Hk(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function VG(t){var e=Hk(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,o.call(this,a)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function tg(t){t._valueTracker||(t._valueTracker=VG(t))}function Vk(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=Hk(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function Xv(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function pS(t,e){var n=e.checked;return Nn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function AP(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=il(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function Gk(t,e){e=e.checked,e!=null&&nM(t,"checked",e,!1)}function mS(t,e){Gk(t,e);var n=il(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?gS(t,e.type,n):e.hasOwnProperty("defaultValue")&&gS(t,e.type,il(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function CP(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function gS(t,e,n){(e!=="number"||Xv(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var Sh=Array.isArray;function Ku(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=ng.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Qh(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var Dh={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},GG=["Webkit","ms","Moz","O"];Object.keys(Dh).forEach(function(t){GG.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Dh[e]=Dh[t]})});function Kk(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||Dh.hasOwnProperty(t)&&Dh[t]?(""+e).trim():e+"px"}function Yk(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Kk(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var WG=Nn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function xS(t,e){if(e){if(WG[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Ce(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Ce(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Ce(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Ce(62))}}function bS(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var _S=null;function aM(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var wS=null,Yu=null,Ju=null;function NP(t){if(t=bm(t)){if(typeof wS!="function")throw Error(Ce(280));var e=t.stateNode;e&&(e=F0(e),wS(t.stateNode,t.type,e))}}function Jk(t){Yu?Ju?Ju.push(t):Ju=[t]:Yu=t}function Zk(){if(Yu){var t=Yu,e=Ju;if(Ju=Yu=null,NP(t),e)for(t=0;t>>=0,t===0?32:31-(r8(t)/i8|0)|0}var rg=64,ig=4194304;function Eh(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Jv(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,o=t.pingedLanes,a=n&268435455;if(a!==0){var s=a&~i;s!==0?r=Eh(s):(o&=a,o!==0&&(r=Eh(o)))}else a=n&~i,a!==0?r=Eh(a):o!==0&&(r=Eh(o));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,o=e&-e,i>=o||i===16&&(o&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0n;n++)e.push(t);return e}function ym(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Lo(e),t[e]=n}function l8(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0=kh),BP=" ",$P=!1;function yj(t,e){switch(t){case"keyup":return k8.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function xj(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Nu=!1;function U8(t,e){switch(t){case"compositionend":return xj(e);case"keypress":return e.which!==32?null:($P=!0,BP);case"textInput":return t=e.data,t===BP&&$P?null:t;default:return null}}function F8(t,e){if(Nu)return t==="compositionend"||!pM&&yj(t,e)?(t=gj(),Sv=dM=js=null,Nu=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=GP(n)}}function Sj(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Sj(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Ej(){for(var t=window,e=Xv();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Xv(t.document)}return e}function mM(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function q8(t){var e=Ej(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&Sj(n.ownerDocument.documentElement,n)){if(r!==null&&mM(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!t.extend&&o>r&&(i=r,r=o,o=i),i=WP(n,o);var a=WP(n,r);i&&a&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==a.node||t.focusOffset!==a.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),o>r?(t.addRange(e),t.extend(a.node,a.offset)):(e.setEnd(a.node,a.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Ou=null,CS=null,Uh=null,PS=!1;function XP(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;PS||Ou==null||Ou!==Xv(r)||(r=Ou,"selectionStart"in r&&mM(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Uh&&op(Uh,r)||(Uh=r,r=ey(CS,"onSelect"),0Lu||(t.current=LS[Lu],LS[Lu]=null,Lu--)}function gn(t,e){Lu++,LS[Lu]=t.current,t.current=e}var ol={},Ir=ml(ol),si=ml(!1),bc=ol;function Md(t,e){var n=t.type.contextTypes;if(!n)return ol;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=e[o];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function li(t){return t=t.childContextTypes,t!=null}function ny(){Sn(si),Sn(Ir)}function eR(t,e,n){if(Ir.current!==ol)throw Error(Ce(168));gn(Ir,e),gn(si,n)}function Ij(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(Ce(108,HG(t)||"Unknown",i));return Nn({},n,r)}function ry(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||ol,bc=Ir.current,gn(Ir,t),gn(si,si.current),!0}function tR(t,e,n){var r=t.stateNode;if(!r)throw Error(Ce(169));n?(t=Ij(t,e,bc),r.__reactInternalMemoizedMergedChildContext=t,Sn(si),Sn(Ir),gn(Ir,t)):Sn(si),gn(si,n)}var ja=null,B0=!1,p_=!1;function Dj(t){ja===null?ja=[t]:ja.push(t)}function aW(t){B0=!0,Dj(t)}function gl(){if(!p_&&ja!==null){p_=!0;var t=0,e=rn;try{var n=ja;for(rn=1;t>=a,i-=a,Ba=1<<32-Lo(e)+i|n<A?(M=T,T=null):M=T.sibling;var C=f(m,T,b[A],S);if(C===null){T===null&&(T=M);break}t&&T&&C.alternate===null&&e(m,T),x=o(C,x,A),E===null?w=C:E.sibling=C,E=C,T=M}if(A===b.length)return n(m,T),Tn&&$l(m,A),w;if(T===null){for(;AA?(M=T,T=null):M=T.sibling;var P=f(m,T,C.value,S);if(P===null){T===null&&(T=M);break}t&&T&&P.alternate===null&&e(m,T),x=o(P,x,A),E===null?w=P:E.sibling=P,E=P,T=M}if(C.done)return n(m,T),Tn&&$l(m,A),w;if(T===null){for(;!C.done;A++,C=b.next())C=d(m,C.value,S),C!==null&&(x=o(C,x,A),E===null?w=C:E.sibling=C,E=C);return Tn&&$l(m,A),w}for(T=r(m,T);!C.done;A++,C=b.next())C=p(T,m,A,C.value,S),C!==null&&(t&&C.alternate!==null&&T.delete(C.key===null?A:C.key),x=o(C,x,A),E===null?w=C:E.sibling=C,E=C);return t&&T.forEach(function(R){return e(m,R)}),Tn&&$l(m,A),w}function g(m,x,b,S){if(typeof b=="object"&&b!==null&&b.type===Ru&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case eg:e:{for(var w=b.key,E=x;E!==null;){if(E.key===w){if(w=b.type,w===Ru){if(E.tag===7){n(m,E.sibling),x=i(E,b.props.children),x.return=m,m=x;break e}}else if(E.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Ms&&iR(w)===E.type){n(m,E.sibling),x=i(E,b.props),x.ref=Kf(m,E,b),x.return=m,m=x;break e}n(m,E);break}else e(m,E);E=E.sibling}b.type===Ru?(x=dc(b.props.children,m.mode,S,b.key),x.return=m,m=x):(S=Nv(b.type,b.key,b.props,null,m.mode,S),S.ref=Kf(m,x,b),S.return=m,m=S)}return a(m);case Pu:e:{for(E=b.key;x!==null;){if(x.key===E)if(x.tag===4&&x.stateNode.containerInfo===b.containerInfo&&x.stateNode.implementation===b.implementation){n(m,x.sibling),x=i(x,b.children||[]),x.return=m,m=x;break e}else{n(m,x);break}else e(m,x);x=x.sibling}x=w_(b,m.mode,S),x.return=m,m=x}return a(m);case Ms:return E=b._init,g(m,x,E(b._payload),S)}if(Sh(b))return y(m,x,b,S);if(Vf(b))return v(m,x,b,S);dg(m,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,x!==null&&x.tag===6?(n(m,x.sibling),x=i(x,b),x.return=m,m=x):(n(m,x),x=__(b,m.mode,S),x.return=m,m=x),a(m)):n(m,x)}return g}var Cd=Uj(!0),Fj=Uj(!1),ay=ml(null),sy=null,Uu=null,xM=null;function bM(){xM=Uu=sy=null}function _M(t){var e=ay.current;Sn(ay),t._currentValue=e}function US(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function Qu(t,e){sy=t,xM=Uu=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(oi=!0),t.firstContext=null)}function io(t){var e=t._currentValue;if(xM!==t)if(t={context:t,memoizedValue:e,next:null},Uu===null){if(sy===null)throw Error(Ce(308));Uu=t,sy.dependencies={lanes:0,firstContext:t}}else Uu=Uu.next=t;return e}var Ql=null;function wM(t){Ql===null?Ql=[t]:Ql.push(t)}function Bj(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,wM(e)):(n.next=i.next,i.next=n),e.interleaved=n,Qa(t,r)}function Qa(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var As=!1;function SM(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function $j(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Ga(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Ws(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,Ht&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,Qa(t,n)}return i=r.interleaved,i===null?(e.next=e,wM(r)):(e.next=i.next,i.next=e),r.interleaved=e,Qa(t,n)}function Tv(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,lM(t,n)}}function oR(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=a:o=o.next=a,n=n.next}while(n!==null);o===null?i=o=e:o=o.next=e}else i=o=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function ly(t,e,n,r){var i=t.updateQueue;As=!1;var o=i.firstBaseUpdate,a=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var l=s,c=l.next;l.next=null,a===null?o=c:a.next=c,a=l;var u=t.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==a&&(s===null?u.firstBaseUpdate=c:s.next=c,u.lastBaseUpdate=l))}if(o!==null){var d=i.baseState;a=0,u=c=l=null,s=o;do{var f=s.lane,p=s.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var y=t,v=s;switch(f=e,p=n,v.tag){case 1:if(y=v.payload,typeof y=="function"){d=y.call(p,d,f);break e}d=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=v.payload,f=typeof y=="function"?y.call(p,d,f):y,f==null)break e;d=Nn({},d,f);break e;case 2:As=!0}}s.callback!==null&&s.lane!==0&&(t.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else p={eventTime:p,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(c=u=p,l=d):u=u.next=p,a|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(u===null&&(l=d),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,e=i.shared.interleaved,e!==null){i=e;do a|=i.lane,i=i.next;while(i!==e)}else o===null&&(i.shared.lanes=0);Sc|=a,t.lanes=a,t.memoizedState=d}}function aR(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;en?n:4,t(!0);var r=g_.transition;g_.transition={};try{t(!1),e()}finally{rn=n,g_.transition=r}}function i3(){return oo().memoizedState}function uW(t,e,n){var r=qs(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},o3(t))a3(e,n);else if(n=Bj(t,e,n,r),n!==null){var i=Vr();ko(n,t,r,i),s3(n,e,r)}}function dW(t,e,n){var r=qs(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(o3(t))a3(e,i);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var a=e.lastRenderedState,s=o(a,n);if(i.hasEagerState=!0,i.eagerState=s,Bo(s,a)){var l=e.interleaved;l===null?(i.next=i,wM(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}n=Bj(t,e,i,r),n!==null&&(i=Vr(),ko(n,t,r,i),s3(n,e,r))}}function o3(t){var e=t.alternate;return t===Rn||e!==null&&e===Rn}function a3(t,e){Fh=uy=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function s3(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,lM(t,n)}}var dy={readContext:io,useCallback:Er,useContext:Er,useEffect:Er,useImperativeHandle:Er,useInsertionEffect:Er,useLayoutEffect:Er,useMemo:Er,useReducer:Er,useRef:Er,useState:Er,useDebugValue:Er,useDeferredValue:Er,useTransition:Er,useMutableSource:Er,useSyncExternalStore:Er,useId:Er,unstable_isNewReconciler:!1},fW={readContext:io,useCallback:function(t,e){return Jo().memoizedState=[t,e===void 0?null:e],t},useContext:io,useEffect:lR,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Av(4194308,4,Qj.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Av(4194308,4,t,e)},useInsertionEffect:function(t,e){return Av(4,2,t,e)},useMemo:function(t,e){var n=Jo();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Jo();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=uW.bind(null,Rn,t),[r.memoizedState,t]},useRef:function(t){var e=Jo();return t={current:t},e.memoizedState=t},useState:sR,useDebugValue:NM,useDeferredValue:function(t){return Jo().memoizedState=t},useTransition:function(){var t=sR(!1),e=t[0];return t=cW.bind(null,t[1]),Jo().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Rn,i=Jo();if(Tn){if(n===void 0)throw Error(Ce(407));n=n()}else{if(n=e(),ar===null)throw Error(Ce(349));wc&30||Gj(r,e,n)}i.memoizedState=n;var o={value:n,getSnapshot:e};return i.queue=o,lR(Xj.bind(null,r,o,t),[t]),r.flags|=2048,hp(9,Wj.bind(null,r,o,n,e),void 0,null),n},useId:function(){var t=Jo(),e=ar.identifierPrefix;if(Tn){var n=$a,r=Ba;n=(r&~(1<<32-Lo(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=dp++,0<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=a.createElement(n,{is:r.is}):(t=a.createElement(n),n==="select"&&(a=t,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):t=a.createElementNS(t,n),t[na]=e,t[lp]=r,v3(t,e,!1,!1),e.stateNode=t;e:{switch(a=bS(n,r),n){case"dialog":xn("cancel",t),xn("close",t),i=r;break;case"iframe":case"object":case"embed":xn("load",t),i=r;break;case"video":case"audio":for(i=0;iNd&&(e.flags|=128,r=!0,Yf(o,!1),e.lanes=4194304)}else{if(!r)if(t=cy(a),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),Yf(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!Tn)return Tr(e),null}else 2*kn()-o.renderingStartTime>Nd&&n!==1073741824&&(e.flags|=128,r=!0,Yf(o,!1),e.lanes=4194304);o.isBackwards?(a.sibling=e.child,e.child=a):(n=o.last,n!==null?n.sibling=a:e.child=a,o.last=a)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=kn(),e.sibling=null,n=Pn.current,gn(Pn,r?n&1|2:n&1),e):(Tr(e),null);case 22:case 23:return jM(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Si&1073741824&&(Tr(e),e.subtreeFlags&6&&(e.flags|=8192)):Tr(e),null;case 24:return null;case 25:return null}throw Error(Ce(156,e.tag))}function bW(t,e){switch(vM(e),e.tag){case 1:return li(e.type)&&ny(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Pd(),Sn(si),Sn(Ir),MM(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return TM(e),null;case 13:if(Sn(Pn),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(Ce(340));Ad()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Sn(Pn),null;case 4:return Pd(),null;case 10:return _M(e.type._context),null;case 22:case 23:return jM(),null;case 24:return null;default:return null}}var hg=!1,Rr=!1,_W=typeof WeakSet=="function"?WeakSet:Set,qe=null;function Fu(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){In(t,e,r)}else n.current=null}function XS(t,e,n){try{n()}catch(r){In(t,e,r)}}var xR=!1;function wW(t,e){if(RS=Zv,t=Ej(),mM(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var a=0,s=-1,l=-1,c=0,u=0,d=t,f=null;t:for(;;){for(var p;d!==n||i!==0&&d.nodeType!==3||(s=a+i),d!==o||r!==0&&d.nodeType!==3||(l=a+r),d.nodeType===3&&(a+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===t)break t;if(f===n&&++c===i&&(s=a),f===o&&++u===r&&(l=a),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(NS={focusedElem:t,selectionRange:n},Zv=!1,qe=e;qe!==null;)if(e=qe,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,qe=t;else for(;qe!==null;){e=qe;try{var y=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var v=y.memoizedProps,g=y.memoizedState,m=e.stateNode,x=m.getSnapshotBeforeUpdate(e.elementType===e.type?v:yo(e.type,v),g);m.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var b=e.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Ce(163))}}catch(S){In(e,e.return,S)}if(t=e.sibling,t!==null){t.return=e.return,qe=t;break}qe=e.return}return y=xR,xR=!1,y}function Bh(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var o=i.destroy;i.destroy=void 0,o!==void 0&&XS(e,n,o)}i=i.next}while(i!==r)}}function H0(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function qS(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function b3(t){var e=t.alternate;e!==null&&(t.alternate=null,b3(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[na],delete e[lp],delete e[DS],delete e[iW],delete e[oW])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function _3(t){return t.tag===5||t.tag===3||t.tag===4}function bR(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||_3(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function KS(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=ty));else if(r!==4&&(t=t.child,t!==null))for(KS(t,e,n),t=t.sibling;t!==null;)KS(t,e,n),t=t.sibling}function YS(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(YS(t,e,n),t=t.sibling;t!==null;)YS(t,e,n),t=t.sibling}var pr=null,wo=!1;function hs(t,e,n){for(n=n.child;n!==null;)w3(t,e,n),n=n.sibling}function w3(t,e,n){if(ua&&typeof ua.onCommitFiberUnmount=="function")try{ua.onCommitFiberUnmount(L0,n)}catch{}switch(n.tag){case 5:Rr||Fu(n,e);case 6:var r=pr,i=wo;pr=null,hs(t,e,n),pr=r,wo=i,pr!==null&&(wo?(t=pr,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):pr.removeChild(n.stateNode));break;case 18:pr!==null&&(wo?(t=pr,n=n.stateNode,t.nodeType===8?h_(t.parentNode,n):t.nodeType===1&&h_(t,n),rp(t)):h_(pr,n.stateNode));break;case 4:r=pr,i=wo,pr=n.stateNode.containerInfo,wo=!0,hs(t,e,n),pr=r,wo=i;break;case 0:case 11:case 14:case 15:if(!Rr&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&XS(n,e,a),i=i.next}while(i!==r)}hs(t,e,n);break;case 1:if(!Rr&&(Fu(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){In(n,e,s)}hs(t,e,n);break;case 21:hs(t,e,n);break;case 22:n.mode&1?(Rr=(r=Rr)||n.memoizedState!==null,hs(t,e,n),Rr=r):hs(t,e,n);break;default:hs(t,e,n)}}function _R(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new _W),e.forEach(function(r){var i=NW.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function co(t,e){var n=e.deletions;if(n!==null)for(var r=0;ri&&(i=a),r&=~o}if(r=i,r=kn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*EW(r/1960))-r,10t?16:t,Us===null)var r=!1;else{if(t=Us,Us=null,py=0,Ht&6)throw Error(Ce(331));var i=Ht;for(Ht|=4,qe=t.current;qe!==null;){var o=qe,a=o.child;if(qe.flags&16){var s=o.deletions;if(s!==null){for(var l=0;lkn()-LM?uc(t,0):DM|=n),ci(t,e)}function R3(t,e){e===0&&(t.mode&1?(e=ig,ig<<=1,!(ig&130023424)&&(ig=4194304)):e=1);var n=Vr();t=Qa(t,e),t!==null&&(ym(t,e,n),ci(t,n))}function RW(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),R3(t,n)}function NW(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(Ce(314))}r!==null&&r.delete(e),R3(t,n)}var N3;N3=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||si.current)oi=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return oi=!1,yW(t,e,n);oi=!!(t.flags&131072)}else oi=!1,Tn&&e.flags&1048576&&Lj(e,oy,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Cv(t,e),t=e.pendingProps;var i=Md(e,Ir.current);Qu(e,n),i=CM(null,e,r,t,i,n);var o=PM();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,li(r)?(o=!0,ry(e)):o=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,SM(e),i.updater=z0,e.stateNode=i,i._reactInternals=e,BS(e,r,t,n),e=HS(null,e,r,!0,o,n)):(e.tag=0,Tn&&o&&gM(e),$r(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(Cv(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=IW(r),t=yo(r,t),i){case 0:e=zS(null,e,r,t,n);break e;case 1:e=gR(null,e,r,t,n);break e;case 11:e=pR(null,e,r,t,n);break e;case 14:e=mR(null,e,r,yo(r.type,t),n);break e}throw Error(Ce(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:yo(r,i),zS(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:yo(r,i),gR(t,e,r,i,n);case 3:e:{if(p3(e),t===null)throw Error(Ce(387));r=e.pendingProps,o=e.memoizedState,i=o.element,$j(t,e),ly(e,r,null,n);var a=e.memoizedState;if(r=a.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){i=Rd(Error(Ce(423)),e),e=vR(t,e,r,n,i);break e}else if(r!==i){i=Rd(Error(Ce(424)),e),e=vR(t,e,r,n,i);break e}else for(Pi=Gs(e.stateNode.containerInfo.firstChild),Ri=e,Tn=!0,Mo=null,n=Fj(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ad(),r===i){e=es(t,e,n);break e}$r(t,e,r,n)}e=e.child}return e;case 5:return zj(e),t===null&&jS(e),r=e.type,i=e.pendingProps,o=t!==null?t.memoizedProps:null,a=i.children,OS(r,i)?a=null:o!==null&&OS(r,o)&&(e.flags|=32),h3(t,e),$r(t,e,a,n),e.child;case 6:return t===null&&jS(e),null;case 13:return m3(t,e,n);case 4:return EM(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Cd(e,null,r,n):$r(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:yo(r,i),pR(t,e,r,i,n);case 7:return $r(t,e,e.pendingProps,n),e.child;case 8:return $r(t,e,e.pendingProps.children,n),e.child;case 12:return $r(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,o=e.memoizedProps,a=i.value,gn(ay,r._currentValue),r._currentValue=a,o!==null)if(Bo(o.value,a)){if(o.children===i.children&&!si.current){e=es(t,e,n);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var s=o.dependencies;if(s!==null){a=o.child;for(var l=s.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=Ga(-1,n&-n),l.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),US(o.return,n,e),s.lanes|=n;break}l=l.next}}else if(o.tag===10)a=o.type===e.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(Ce(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),US(a,n,e),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===e){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}$r(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,Qu(e,n),i=io(i),r=r(i),e.flags|=1,$r(t,e,r,n),e.child;case 14:return r=e.type,i=yo(r,e.pendingProps),i=yo(r.type,i),mR(t,e,r,i,n);case 15:return d3(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:yo(r,i),Cv(t,e),e.tag=1,li(r)?(t=!0,ry(e)):t=!1,Qu(e,n),l3(e,r,i),BS(e,r,i,n),HS(null,e,r,!0,t,n);case 19:return g3(t,e,n);case 22:return f3(t,e,n)}throw Error(Ce(156,e.tag))};function O3(t,e){return oj(t,e)}function OW(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Yi(t,e,n,r){return new OW(t,e,n,r)}function FM(t){return t=t.prototype,!(!t||!t.isReactComponent)}function IW(t){if(typeof t=="function")return FM(t)?1:0;if(t!=null){if(t=t.$$typeof,t===iM)return 11;if(t===oM)return 14}return 2}function Ks(t,e){var n=t.alternate;return n===null?(n=Yi(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Nv(t,e,n,r,i,o){var a=2;if(r=t,typeof t=="function")FM(t)&&(a=1);else if(typeof t=="string")a=5;else e:switch(t){case Ru:return dc(n.children,i,o,e);case rM:a=8,i|=8;break;case uS:return t=Yi(12,n,e,i|2),t.elementType=uS,t.lanes=o,t;case dS:return t=Yi(13,n,e,i),t.elementType=dS,t.lanes=o,t;case fS:return t=Yi(19,n,e,i),t.elementType=fS,t.lanes=o,t;case zk:return G0(n,i,o,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Bk:a=10;break e;case $k:a=9;break e;case iM:a=11;break e;case oM:a=14;break e;case Ms:a=16,r=null;break e}throw Error(Ce(130,t==null?t:typeof t,""))}return e=Yi(a,n,e,i),e.elementType=t,e.type=r,e.lanes=o,e}function dc(t,e,n,r){return t=Yi(7,t,r,e),t.lanes=n,t}function G0(t,e,n,r){return t=Yi(22,t,r,e),t.elementType=zk,t.lanes=n,t.stateNode={isHidden:!1},t}function __(t,e,n){return t=Yi(6,t,null,e),t.lanes=n,t}function w_(t,e,n){return e=Yi(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function DW(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=n_(0),this.expirationTimes=n_(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=n_(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function BM(t,e,n,r,i,o,a,s,l){return t=new DW(t,e,n,s,l),e===1?(e=1,o===!0&&(e|=8)):e=0,o=Yi(3,null,null,e),t.current=o,o.stateNode=t,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},SM(o),t}function LW(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(k3)}catch(t){console.error(t)}}k3(),kk.exports=Li;var Bc=kk.exports;const j3=dn(Bc);var U3,PR=Bc;U3=PR.createRoot,PR.hydrateRoot;/** + * @remix-run/router v1.23.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function mp(){return mp=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function F3(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function $W(){return Math.random().toString(36).substr(2,8)}function NR(t,e){return{usr:t.state,key:t.key,idx:e}}function tE(t,e,n,r){return n===void 0&&(n=null),mp({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?gf(e):e,{state:n,key:e&&e.key||r||$W()})}function B3(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function gf(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function zW(t,e,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,a=i.history,s=Fs.Pop,l=null,c=u();c==null&&(c=0,a.replaceState(mp({},a.state,{idx:c}),""));function u(){return(a.state||{idx:null}).idx}function d(){s=Fs.Pop;let g=u(),m=g==null?null:g-c;c=g,l&&l({action:s,location:v.location,delta:m})}function f(g,m){s=Fs.Push;let x=tE(v.location,g,m);c=u()+1;let b=NR(x,c),S=v.createHref(x);try{a.pushState(b,"",S)}catch(w){if(w instanceof DOMException&&w.name==="DataCloneError")throw w;i.location.assign(S)}o&&l&&l({action:s,location:v.location,delta:1})}function p(g,m){s=Fs.Replace;let x=tE(v.location,g,m);c=u();let b=NR(x,c),S=v.createHref(x);a.replaceState(b,"",S),o&&l&&l({action:s,location:v.location,delta:0})}function y(g){let m=i.location.origin!=="null"?i.location.origin:i.location.href,x=typeof g=="string"?g:B3(g);return x=x.replace(/ $/,"%20"),Jn(m,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,m)}let v={get action(){return s},get location(){return t(i,a)},listen(g){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(RR,d),l=g,()=>{i.removeEventListener(RR,d),l=null}},createHref(g){return e(i,g)},createURL:y,encodeLocation(g){let m=y(g);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:f,replace:p,go(g){return a.go(g)}};return v}var OR;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(OR||(OR={}));function HW(t,e,n){return n===void 0&&(n="/"),VW(t,e,n)}function VW(t,e,n,r){let i=typeof e=="string"?gf(e):e,o=H3(i.pathname||"/",n);if(o==null)return null;let a=$3(t);GW(a);let s=null;for(let l=0;s==null&&l{let l={relativePath:s===void 0?o.path||"":s,caseSensitive:o.caseSensitive===!0,childrenIndex:a,route:o};l.relativePath.startsWith("/")&&(Jn(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let c=fc([r,l.relativePath]),u=n.concat(l);o.children&&o.children.length>0&&(Jn(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),$3(o.children,e,u,c)),!(o.path==null&&!o.index)&&e.push({path:c,score:ZW(c,o.index),routesMeta:u})};return t.forEach((o,a)=>{var s;if(o.path===""||!((s=o.path)!=null&&s.includes("?")))i(o,a);else for(let l of z3(o.path))i(o,a,l)}),e}function z3(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let a=z3(r.join("/")),s=[];return s.push(...a.map(l=>l===""?o:[o,l].join("/"))),i&&s.push(...a),s.map(l=>t.startsWith("/")&&l===""?"/":l)}function GW(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:QW(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const WW=/^:[\w-]+$/,XW=3,qW=2,KW=1,YW=10,JW=-2,IR=t=>t==="*";function ZW(t,e){let n=t.split("/"),r=n.length;return n.some(IR)&&(r+=JW),e&&(r+=qW),n.filter(i=>!IR(i)).reduce((i,o)=>i+(WW.test(o)?XW:o===""?KW:YW),r)}function QW(t,e){return t.length===e.length&&t.slice(0,-1).every((r,i)=>r===e[i])?t[t.length-1]-e[e.length-1]:0}function e6(t,e,n){let{routesMeta:r}=t,i={},o="/",a=[];for(let s=0;s{let{paramName:f,isOptional:p}=u;if(f==="*"){let v=s[d]||"";a=o.slice(0,o.length-v.length).replace(/(.)\/+$/,"$1")}const y=s[d];return p&&!y?c[f]=void 0:c[f]=(y||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:a,pattern:t}}function n6(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),F3(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,s,l)=>(r.push({paramName:s,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function r6(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return F3(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function H3(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function i6(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:i=""}=typeof t=="string"?gf(t):t;return{pathname:n?n.startsWith("/")?n:o6(n,e):e,search:u6(r),hash:d6(i)}}function o6(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function S_(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function a6(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function s6(t,e){let n=a6(t);return e?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function l6(t,e,n,r){r===void 0&&(r=!1);let i;typeof t=="string"?i=gf(t):(i=mp({},t),Jn(!i.pathname||!i.pathname.includes("?"),S_("?","pathname","search",i)),Jn(!i.pathname||!i.pathname.includes("#"),S_("#","pathname","hash",i)),Jn(!i.search||!i.search.includes("#"),S_("#","search","hash",i)));let o=t===""||i.pathname==="",a=o?"/":i.pathname,s;if(a==null)s=n;else{let d=e.length-1;if(!r&&a.startsWith("..")){let f=a.split("/");for(;f[0]==="..";)f.shift(),d-=1;i.pathname=f.join("/")}s=d>=0?e[d]:"/"}let l=i6(i,s),c=a&&a!=="/"&&a.endsWith("/"),u=(o||a===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}const fc=t=>t.join("/").replace(/\/\/+/g,"/"),c6=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),u6=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,d6=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function f6(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const V3=["post","put","patch","delete"];new Set(V3);const h6=["get",...V3];new Set(h6);/** + * React Router v6.30.1 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function gp(){return gp=Object.assign?Object.assign.bind():function(t){for(var e=1;e{s.current=!0}),_.useCallback(function(c,u){if(u===void 0&&(u={}),!s.current)return;if(typeof c=="number"){r.go(c);return}let d=l6(c,JSON.parse(a),o,u.relative==="path");t==null&&e!=="/"&&(d.pathname=d.pathname==="/"?e:fc([e,d.pathname])),(u.replace?r.replace:r.push)(d,u.state,u)},[e,r,a,o,t])}function g6(){let{matches:t}=_.useContext($c),e=t[t.length-1];return e?e.params:{}}function v6(t,e){return y6(t,e)}function y6(t,e,n,r){Z0()||Jn(!1);let{navigator:i}=_.useContext(Y0),{matches:o}=_.useContext($c),a=o[o.length-1],s=a?a.params:{};a&&a.pathname;let l=a?a.pathnameBase:"/";a&&a.route;let c=vl(),u;if(e){var d;let g=typeof e=="string"?gf(e):e;l==="/"||(d=g.pathname)!=null&&d.startsWith(l)||Jn(!1),u=g}else u=c;let f=u.pathname||"/",p=f;if(l!=="/"){let g=l.replace(/^\//,"").split("/");p="/"+f.replace(/^\//,"").split("/").slice(g.length).join("/")}let y=HW(t,{pathname:p}),v=S6(y&&y.map(g=>Object.assign({},g,{params:Object.assign({},s,g.params),pathname:fc([l,i.encodeLocation?i.encodeLocation(g.pathname).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?l:fc([l,i.encodeLocation?i.encodeLocation(g.pathnameBase).pathname:g.pathnameBase])})),o,n,r);return e&&v?_.createElement(J0.Provider,{value:{location:gp({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:Fs.Pop}},v):v}function x6(){let t=A6(),e=f6(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return _.createElement(_.Fragment,null,_.createElement("h2",null,"Unexpected Application Error!"),_.createElement("h3",{style:{fontStyle:"italic"}},e),n?_.createElement("pre",{style:i},n):null,null)}const b6=_.createElement(x6,null);class _6 extends _.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?_.createElement($c.Provider,{value:this.props.routeContext},_.createElement(G3.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function w6(t){let{routeContext:e,match:n,children:r}=t,i=_.useContext(VM);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),_.createElement($c.Provider,{value:e},r)}function S6(t,e,n,r){var i;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var o;if(!n)return null;if(n.errors)t=n.matches;else if((o=r)!=null&&o.v7_partialHydration&&e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let a=t,s=(i=n)==null?void 0:i.errors;if(s!=null){let u=a.findIndex(d=>d.route.id&&(s==null?void 0:s[d.route.id])!==void 0);u>=0||Jn(!1),a=a.slice(0,Math.min(a.length,u+1))}let l=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let u=0;u=0?a=a.slice(0,c+1):a=[a[0]];break}}}return a.reduceRight((u,d,f)=>{let p,y=!1,v=null,g=null;n&&(p=s&&d.route.id?s[d.route.id]:void 0,v=d.route.errorElement||b6,l&&(c<0&&f===0?(P6("route-fallback"),y=!0,g=null):c===f&&(y=!0,g=d.route.hydrateFallbackElement||null)));let m=e.concat(a.slice(0,f+1)),x=()=>{let b;return p?b=v:y?b=g:d.route.Component?b=_.createElement(d.route.Component,null):d.route.element?b=d.route.element:b=u,_.createElement(w6,{match:d,routeContext:{outlet:u,matches:m,isDataRoute:n!=null},children:b})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?_.createElement(_6,{location:n.location,revalidation:n.revalidation,component:v,error:p,children:x(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):x()},null)}var X3=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(X3||{}),q3=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(q3||{});function E6(t){let e=_.useContext(VM);return e||Jn(!1),e}function T6(t){let e=_.useContext(p6);return e||Jn(!1),e}function M6(t){let e=_.useContext($c);return e||Jn(!1),e}function K3(t){let e=M6(),n=e.matches[e.matches.length-1];return n.route.id||Jn(!1),n.route.id}function A6(){var t;let e=_.useContext(G3),n=T6(),r=K3();return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function C6(){let{router:t}=E6(X3.UseNavigateStable),e=K3(q3.UseNavigateStable),n=_.useRef(!1);return W3(()=>{n.current=!0}),_.useCallback(function(i,o){o===void 0&&(o={}),n.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,gp({fromRouteId:e},o)))},[t,e])}const DR={};function P6(t,e,n){DR[t]||(DR[t]=!0)}function R6(t,e){t==null||t.v7_startTransition,t==null||t.v7_relativeSplatPath}function go(t){Jn(!1)}function N6(t){let{basename:e="/",children:n=null,location:r,navigationType:i=Fs.Pop,navigator:o,static:a=!1,future:s}=t;Z0()&&Jn(!1);let l=e.replace(/^\/*/,"/"),c=_.useMemo(()=>({basename:l,navigator:o,static:a,future:gp({v7_relativeSplatPath:!1},s)}),[l,s,o,a]);typeof r=="string"&&(r=gf(r));let{pathname:u="/",search:d="",hash:f="",state:p=null,key:y="default"}=r,v=_.useMemo(()=>{let g=H3(u,l);return g==null?null:{location:{pathname:g,search:d,hash:f,state:p,key:y},navigationType:i}},[l,u,d,f,p,y,i]);return v==null?null:_.createElement(Y0.Provider,{value:c},_.createElement(J0.Provider,{children:n,value:v}))}function O6(t){let{children:e,location:n}=t;return v6(nE(e),n)}new Promise(()=>{});function nE(t,e){e===void 0&&(e=[]);let n=[];return _.Children.forEach(t,(r,i)=>{if(!_.isValidElement(r))return;let o=[...e,i];if(r.type===_.Fragment){n.push.apply(n,nE(r.props.children,o));return}r.type!==go&&Jn(!1),!r.props.index||!r.props.children||Jn(!1);let a={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(a.children=nE(r.props.children,o)),n.push(a)}),n}/** + * React Router DOM v6.30.1 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */const I6="6";try{window.__reactRouterVersion=I6}catch{}const D6="startTransition",LR=QT[D6];function L6(t){let{basename:e,children:n,future:r,window:i}=t,o=_.useRef();o.current==null&&(o.current=BW({window:i,v5Compat:!0}));let a=o.current,[s,l]=_.useState({action:a.action,location:a.location}),{v7_startTransition:c}=r||{},u=_.useCallback(d=>{c&&LR?LR(()=>l(d)):l(d)},[l,c]);return _.useLayoutEffect(()=>a.listen(u),[a,u]),_.useEffect(()=>R6(r),[r]),_.createElement(N6,{basename:e,children:n,location:s.location,navigationType:s.action,navigator:a,future:r})}var kR;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(kR||(kR={}));var jR;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(jR||(jR={}));var Q0=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(){}},ex=typeof window>"u"||"Deno"in globalThis;function xo(){}function k6(t,e){return typeof t=="function"?t(e):t}function j6(t){return typeof t=="number"&&t>=0&&t!==1/0}function U6(t,e){return Math.max(t+(e||0)-Date.now(),0)}function rE(t,e){return typeof t=="function"?t(e):t}function F6(t,e){return typeof t=="function"?t(e):t}function UR(t,e){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:a,stale:s}=t;if(a){if(r){if(e.queryHash!==GM(a,e.options))return!1}else if(!yp(e.queryKey,a))return!1}if(n!=="all"){const l=e.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof s=="boolean"&&e.isStale()!==s||i&&i!==e.state.fetchStatus||o&&!o(e))}function FR(t,e){const{exact:n,status:r,predicate:i,mutationKey:o}=t;if(o){if(!e.options.mutationKey)return!1;if(n){if(vp(e.options.mutationKey)!==vp(o))return!1}else if(!yp(e.options.mutationKey,o))return!1}return!(r&&e.state.status!==r||i&&!i(e))}function GM(t,e){return((e==null?void 0:e.queryKeyHashFn)||vp)(t)}function vp(t){return JSON.stringify(t,(e,n)=>iE(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function yp(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>yp(t[n],e[n])):!1}function Y3(t,e){if(t===e)return t;const n=BR(t)&&BR(e);if(n||iE(t)&&iE(e)){const r=n?t:Object.keys(t),i=r.length,o=n?e:Object.keys(e),a=o.length,s=n?[]:{},l=new Set(r);let c=0;for(let u=0;u{setTimeout(e,t)})}function $6(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?Y3(t,e):e}function z6(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function H6(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var WM=Symbol();function J3(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===WM?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var oc,Os,gd,vk,V6=(vk=class extends Q0{constructor(){super();Xt(this,oc);Xt(this,Os);Xt(this,gd);At(this,gd,e=>{if(!ex&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){xe(this,Os)||this.setEventListener(xe(this,gd))}onUnsubscribe(){var e;this.hasListeners()||((e=xe(this,Os))==null||e.call(this),At(this,Os,void 0))}setEventListener(e){var n;At(this,gd,e),(n=xe(this,Os))==null||n.call(this),At(this,Os,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){xe(this,oc)!==e&&(At(this,oc,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof xe(this,oc)=="boolean"?xe(this,oc):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},oc=new WeakMap,Os=new WeakMap,gd=new WeakMap,vk),Z3=new V6,vd,Is,yd,yk,G6=(yk=class extends Q0{constructor(){super();Xt(this,vd,!0);Xt(this,Is);Xt(this,yd);At(this,yd,e=>{if(!ex&&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(){xe(this,Is)||this.setEventListener(xe(this,yd))}onUnsubscribe(){var e;this.hasListeners()||((e=xe(this,Is))==null||e.call(this),At(this,Is,void 0))}setEventListener(e){var n;At(this,yd,e),(n=xe(this,Is))==null||n.call(this),At(this,Is,e(this.setOnline.bind(this)))}setOnline(e){xe(this,vd)!==e&&(At(this,vd,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return xe(this,vd)}},vd=new WeakMap,Is=new WeakMap,yd=new WeakMap,yk),vy=new G6;function W6(){let t,e;const n=new Promise((i,o)=>{t=i,e=o});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 X6(t){return Math.min(1e3*2**t,3e4)}function Q3(t){return(t??"online")==="online"?vy.isOnline():!0}var eU=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function E_(t){return t instanceof eU}function tU(t){let e=!1,n=0,r=!1,i;const o=W6(),a=v=>{var g;r||(f(new eU(v)),(g=t.abort)==null||g.call(t))},s=()=>{e=!0},l=()=>{e=!1},c=()=>Z3.isFocused()&&(t.networkMode==="always"||vy.isOnline())&&t.canRun(),u=()=>Q3(t.networkMode)&&t.canRun(),d=v=>{var g;r||(r=!0,(g=t.onSuccess)==null||g.call(t,v),i==null||i(),o.resolve(v))},f=v=>{var g;r||(r=!0,(g=t.onError)==null||g.call(t,v),i==null||i(),o.reject(v))},p=()=>new Promise(v=>{var g;i=m=>{(r||c())&&v(m)},(g=t.onPause)==null||g.call(t)}).then(()=>{var v;i=void 0,r||(v=t.onContinue)==null||v.call(t)}),y=()=>{if(r)return;let v;const g=n===0?t.initialPromise:void 0;try{v=g??t.fn()}catch(m){v=Promise.reject(m)}Promise.resolve(v).then(d).catch(m=>{var E;if(r)return;const x=t.retry??(ex?0:3),b=t.retryDelay??X6,S=typeof b=="function"?b(n,m):b,w=x===!0||typeof x=="number"&&nc()?void 0:p()).then(()=>{e?f(m):y()})})};return{promise:o,cancel:a,continue:()=>(i==null||i(),o),cancelRetry:s,continueRetry:l,canStart:u,start:()=>(u()?y():p().then(y),o)}}var q6=t=>setTimeout(t,0);function K6(){let t=[],e=0,n=s=>{s()},r=s=>{s()},i=q6;const o=s=>{e?t.push(s):i(()=>{n(s)})},a=()=>{const s=t;t=[],s.length&&i(()=>{r(()=>{s.forEach(l=>{n(l)})})})};return{batch:s=>{let l;e++;try{l=s()}finally{e--,e||a()}return l},batchCalls:s=>(...l)=>{o(()=>{s(...l)})},schedule:o,setNotifyFunction:s=>{n=s},setBatchNotifyFunction:s=>{r=s},setScheduler:s=>{i=s}}}var zr=K6(),ac,xk,nU=(xk=class{constructor(){Xt(this,ac)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),j6(this.gcTime)&&At(this,ac,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(ex?1/0:5*60*1e3))}clearGcTimeout(){xe(this,ac)&&(clearTimeout(xe(this,ac)),At(this,ac,void 0))}},ac=new WeakMap,xk),xd,bd,Gi,sc,Cr,mm,lc,bo,Ia,bk,Y6=(bk=class extends nU{constructor(e){super();Xt(this,bo);Xt(this,xd);Xt(this,bd);Xt(this,Gi);Xt(this,sc);Xt(this,Cr);Xt(this,mm);Xt(this,lc);At(this,lc,!1),At(this,mm,e.defaultOptions),this.setOptions(e.options),this.observers=[],At(this,sc,e.client),At(this,Gi,xe(this,sc).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,At(this,xd,Z6(this.options)),this.state=e.state??xe(this,xd),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=xe(this,Cr))==null?void 0:e.promise}setOptions(e){this.options={...xe(this,mm),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&xe(this,Gi).remove(this)}setData(e,n){const r=$6(this.state.data,e,this.options);return Sr(this,bo,Ia).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){Sr(this,bo,Ia).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var r,i;const n=(r=xe(this,Cr))==null?void 0:r.promise;return(i=xe(this,Cr))==null||i.cancel(e),n?n.then(xo).catch(xo):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(xe(this,xd))}isActive(){return this.observers.some(e=>F6(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===WM||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>rE(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!U6(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=xe(this,Cr))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=xe(this,Cr))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),xe(this,Gi).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(xe(this,Cr)&&(xe(this,lc)?xe(this,Cr).cancel({revert:!0}):xe(this,Cr).cancelRetry()),this.scheduleGc()),xe(this,Gi).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Sr(this,bo,Ia).call(this,{type:"invalidate"})}fetch(e,n){var c,u,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(xe(this,Cr))return xe(this,Cr).continueRetry(),xe(this,Cr).promise}if(e&&this.setOptions(e),!this.options.queryFn){const f=this.observers.find(p=>p.options.queryFn);f&&this.setOptions(f.options)}const r=new AbortController,i=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(At(this,lc,!0),r.signal)})},o=()=>{const f=J3(this.options,n),y=(()=>{const v={client:xe(this,sc),queryKey:this.queryKey,meta:this.meta};return i(v),v})();return At(this,lc,!1),this.options.persister?this.options.persister(f,y,this):f(y)},s=(()=>{const f={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:xe(this,sc),state:this.state,fetchFn:o};return i(f),f})();(c=this.options.behavior)==null||c.onFetch(s,this),At(this,bd,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=s.fetchOptions)==null?void 0:u.meta))&&Sr(this,bo,Ia).call(this,{type:"fetch",meta:(d=s.fetchOptions)==null?void 0:d.meta});const l=f=>{var p,y,v,g;E_(f)&&f.silent||Sr(this,bo,Ia).call(this,{type:"error",error:f}),E_(f)||((y=(p=xe(this,Gi).config).onError)==null||y.call(p,f,this),(g=(v=xe(this,Gi).config).onSettled)==null||g.call(v,this.state.data,f,this)),this.scheduleGc()};return At(this,Cr,tU({initialPromise:n==null?void 0:n.initialPromise,fn:s.fetchFn,abort:r.abort.bind(r),onSuccess:f=>{var p,y,v,g;if(f===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(m){l(m);return}(y=(p=xe(this,Gi).config).onSuccess)==null||y.call(p,f,this),(g=(v=xe(this,Gi).config).onSettled)==null||g.call(v,f,this.state.error,this),this.scheduleGc()},onError:l,onFail:(f,p)=>{Sr(this,bo,Ia).call(this,{type:"failed",failureCount:f,error:p})},onPause:()=>{Sr(this,bo,Ia).call(this,{type:"pause"})},onContinue:()=>{Sr(this,bo,Ia).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0})),xe(this,Cr).start()}},xd=new WeakMap,bd=new WeakMap,Gi=new WeakMap,sc=new WeakMap,Cr=new WeakMap,mm=new WeakMap,lc=new WeakMap,bo=new WeakSet,Ia=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,...J6(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 E_(i)&&i.revert&&xe(this,bd)?{...xe(this,bd),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),zr.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),xe(this,Gi).notify({query:this,type:"updated",action:e})})},bk);function J6(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Q3(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function Z6(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 Zo,_k,Q6=(_k=class extends Q0{constructor(e={}){super();Xt(this,Zo);this.config=e,At(this,Zo,new Map)}build(e,n,r){const i=n.queryKey,o=n.queryHash??GM(i,n);let a=this.get(o);return a||(a=new Y6({client:e,queryKey:i,queryHash:o,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(a)),a}add(e){xe(this,Zo).has(e.queryHash)||(xe(this,Zo).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=xe(this,Zo).get(e.queryHash);n&&(e.destroy(),n===e&&xe(this,Zo).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){zr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return xe(this,Zo).get(e)}getAll(){return[...xe(this,Zo).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>UR(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>UR(e,r)):n}notify(e){zr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){zr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){zr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Zo=new WeakMap,_k),Qo,Br,cc,ea,Es,wk,e9=(wk=class extends nU{constructor(e){super();Xt(this,ea);Xt(this,Qo);Xt(this,Br);Xt(this,cc);this.mutationId=e.mutationId,At(this,Br,e.mutationCache),At(this,Qo,[]),this.state=e.state||t9(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){xe(this,Qo).includes(e)||(xe(this,Qo).push(e),this.clearGcTimeout(),xe(this,Br).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){At(this,Qo,xe(this,Qo).filter(n=>n!==e)),this.scheduleGc(),xe(this,Br).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){xe(this,Qo).length||(this.state.status==="pending"?this.scheduleGc():xe(this,Br).remove(this))}continue(){var e;return((e=xe(this,cc))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var o,a,s,l,c,u,d,f,p,y,v,g,m,x,b,S,w,E,T,A;const n=()=>{Sr(this,ea,Es).call(this,{type:"continue"})};At(this,cc,tU({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(M,C)=>{Sr(this,ea,Es).call(this,{type:"failed",failureCount:M,error:C})},onPause:()=>{Sr(this,ea,Es).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>xe(this,Br).canRun(this)}));const r=this.state.status==="pending",i=!xe(this,cc).canStart();try{if(r)n();else{Sr(this,ea,Es).call(this,{type:"pending",variables:e,isPaused:i}),await((a=(o=xe(this,Br).config).onMutate)==null?void 0:a.call(o,e,this));const C=await((l=(s=this.options).onMutate)==null?void 0:l.call(s,e));C!==this.state.context&&Sr(this,ea,Es).call(this,{type:"pending",context:C,variables:e,isPaused:i})}const M=await xe(this,cc).start();return await((u=(c=xe(this,Br).config).onSuccess)==null?void 0:u.call(c,M,e,this.state.context,this)),await((f=(d=this.options).onSuccess)==null?void 0:f.call(d,M,e,this.state.context)),await((y=(p=xe(this,Br).config).onSettled)==null?void 0:y.call(p,M,null,this.state.variables,this.state.context,this)),await((g=(v=this.options).onSettled)==null?void 0:g.call(v,M,null,e,this.state.context)),Sr(this,ea,Es).call(this,{type:"success",data:M}),M}catch(M){try{throw await((x=(m=xe(this,Br).config).onError)==null?void 0:x.call(m,M,e,this.state.context,this)),await((S=(b=this.options).onError)==null?void 0:S.call(b,M,e,this.state.context)),await((E=(w=xe(this,Br).config).onSettled)==null?void 0:E.call(w,void 0,M,this.state.variables,this.state.context,this)),await((A=(T=this.options).onSettled)==null?void 0:A.call(T,void 0,M,e,this.state.context)),M}finally{Sr(this,ea,Es).call(this,{type:"error",error:M})}}finally{xe(this,Br).runNext(this)}}},Qo=new WeakMap,Br=new WeakMap,cc=new WeakMap,ea=new WeakSet,Es=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),zr.batch(()=>{xe(this,Qo).forEach(r=>{r.onMutationUpdate(e)}),xe(this,Br).notify({mutation:this,type:"updated",action:e})})},wk);function t9(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Fa,_o,gm,Sk,n9=(Sk=class extends Q0{constructor(e={}){super();Xt(this,Fa);Xt(this,_o);Xt(this,gm);this.config=e,At(this,Fa,new Set),At(this,_o,new Map),At(this,gm,0)}build(e,n,r){const i=new e9({mutationCache:this,mutationId:++Jm(this,gm)._,options:e.defaultMutationOptions(n),state:r});return this.add(i),i}add(e){xe(this,Fa).add(e);const n=gg(e);if(typeof n=="string"){const r=xe(this,_o).get(n);r?r.push(e):xe(this,_o).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(xe(this,Fa).delete(e)){const n=gg(e);if(typeof n=="string"){const r=xe(this,_o).get(n);if(r)if(r.length>1){const i=r.indexOf(e);i!==-1&&r.splice(i,1)}else r[0]===e&&xe(this,_o).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=gg(e);if(typeof n=="string"){const r=xe(this,_o).get(n),i=r==null?void 0:r.find(o=>o.state.status==="pending");return!i||i===e}else return!0}runNext(e){var r;const n=gg(e);if(typeof n=="string"){const i=(r=xe(this,_o).get(n))==null?void 0:r.find(o=>o!==e&&o.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){zr.batch(()=>{xe(this,Fa).forEach(e=>{this.notify({type:"removed",mutation:e})}),xe(this,Fa).clear(),xe(this,_o).clear()})}getAll(){return Array.from(xe(this,Fa))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>FR(n,r))}findAll(e={}){return this.getAll().filter(n=>FR(e,n))}notify(e){zr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return zr.batch(()=>Promise.all(e.map(n=>n.continue().catch(xo))))}},Fa=new WeakMap,_o=new WeakMap,gm=new WeakMap,Sk);function gg(t){var e;return(e=t.options.scope)==null?void 0:e.id}function zR(t){return{onFetch:(e,n)=>{var u,d,f,p,y;const r=e.options,i=(f=(d=(u=e.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,o=((p=e.state.data)==null?void 0:p.pages)||[],a=((y=e.state.data)==null?void 0:y.pageParams)||[];let s={pages:[],pageParams:[]},l=0;const c=async()=>{let v=!1;const g=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(e.signal.aborted?v=!0:e.signal.addEventListener("abort",()=>{v=!0}),e.signal)})},m=J3(e.options,e.fetchOptions),x=async(b,S,w)=>{if(v)return Promise.reject();if(S==null&&b.pages.length)return Promise.resolve(b);const T=(()=>{const P={client:e.client,queryKey:e.queryKey,pageParam:S,direction:w?"backward":"forward",meta:e.options.meta};return g(P),P})(),A=await m(T),{maxPages:M}=e.options,C=w?H6:z6;return{pages:C(b.pages,A,M),pageParams:C(b.pageParams,S,M)}};if(i&&o.length){const b=i==="backward",S=b?r9:HR,w={pages:o,pageParams:a},E=S(r,w);s=await x(w,E,b)}else{const b=t??o.length;do{const S=l===0?a[0]??r.initialPageParam:HR(r,s);if(l>0&&S==null)break;s=await x(s,S),l++}while(l{var v,g;return(g=(v=e.options).persister)==null?void 0:g.call(v,c,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=c}}}function HR(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 r9(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 On,Ds,Ls,_d,wd,ks,Sd,Ed,Ek,i9=(Ek=class{constructor(t={}){Xt(this,On);Xt(this,Ds);Xt(this,Ls);Xt(this,_d);Xt(this,wd);Xt(this,ks);Xt(this,Sd);Xt(this,Ed);At(this,On,t.queryCache||new Q6),At(this,Ds,t.mutationCache||new n9),At(this,Ls,t.defaultOptions||{}),At(this,_d,new Map),At(this,wd,new Map),At(this,ks,0)}mount(){Jm(this,ks)._++,xe(this,ks)===1&&(At(this,Sd,Z3.subscribe(async t=>{t&&(await this.resumePausedMutations(),xe(this,On).onFocus())})),At(this,Ed,vy.subscribe(async t=>{t&&(await this.resumePausedMutations(),xe(this,On).onOnline())})))}unmount(){var t,e;Jm(this,ks)._--,xe(this,ks)===0&&((t=xe(this,Sd))==null||t.call(this),At(this,Sd,void 0),(e=xe(this,Ed))==null||e.call(this),At(this,Ed,void 0))}isFetching(t){return xe(this,On).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return xe(this,Ds).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=xe(this,On).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=xe(this,On).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(rE(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return xe(this,On).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=xe(this,On).get(r.queryHash),o=i==null?void 0:i.state.data,a=k6(e,o);if(a!==void 0)return xe(this,On).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(t,e,n){return zr.batch(()=>xe(this,On).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=xe(this,On).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=xe(this,On);zr.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=xe(this,On);return zr.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=zr.batch(()=>xe(this,On).findAll(t).map(i=>i.cancel(n)));return Promise.all(r).then(xo).catch(xo)}invalidateQueries(t,e={}){return zr.batch(()=>(xe(this,On).findAll(t).forEach(n=>{n.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=zr.batch(()=>xe(this,On).findAll(t).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(xo)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(xo)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=xe(this,On).build(this,e);return n.isStaleByTime(rE(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(xo).catch(xo)}fetchInfiniteQuery(t){return t.behavior=zR(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(xo).catch(xo)}ensureInfiniteQueryData(t){return t.behavior=zR(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return vy.isOnline()?xe(this,Ds).resumePausedMutations():Promise.resolve()}getQueryCache(){return xe(this,On)}getMutationCache(){return xe(this,Ds)}getDefaultOptions(){return xe(this,Ls)}setDefaultOptions(t){At(this,Ls,t)}setQueryDefaults(t,e){xe(this,_d).set(vp(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...xe(this,_d).values()],n={};return e.forEach(r=>{yp(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){xe(this,wd).set(vp(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...xe(this,wd).values()],n={};return e.forEach(r=>{yp(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...xe(this,Ls).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=GM(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===WM&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...xe(this,Ls).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){xe(this,On).clear(),xe(this,Ds).clear()}},On=new WeakMap,Ds=new WeakMap,Ls=new WeakMap,_d=new WeakMap,wd=new WeakMap,ks=new WeakMap,Sd=new WeakMap,Ed=new WeakMap,Ek),o9=_.createContext(void 0),a9=({client:t,children:e})=>(_.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),h.jsx(o9.Provider,{value:t,children:e}));const s9={theme:"system",setTheme:()=>null},l9=_.createContext(s9);function c9({children:t,defaultTheme:e="system",storageKey:n="vite-ui-theme",...r}){const[i,o]=_.useState(()=>localStorage.getItem(n)||e);_.useEffect(()=>{const l=window.document.documentElement;if(l.classList.remove("light","dark"),i==="system"){const c=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";l.classList.add(c);return}l.classList.add(i)},[i]);const a=_.useCallback(l=>{localStorage.setItem(n,l),o(l)},[n]),s=_.useMemo(()=>({theme:i,setTheme:a}),[i,a]);return h.jsx(l9.Provider,{...r,value:s,children:t})}var u9=t=>{switch(t){case"success":return h9;case"info":return m9;case"warning":return p9;case"error":return g9;default:return null}},d9=Array(12).fill(0),f9=({visible:t,className:e})=>Z.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},Z.createElement("div",{className:"sonner-spinner"},d9.map((n,r)=>Z.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),h9=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Z.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),p9=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Z.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),m9=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Z.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),g9=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Z.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),v9=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},Z.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Z.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),y9=()=>{let[t,e]=Z.useState(document.hidden);return Z.useEffect(()=>{let n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t},oE=1,x9=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let e=this.subscribers.indexOf(t);this.subscribers.splice(e,1)}),this.publish=t=>{this.subscribers.forEach(e=>e(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var e;let{message:n,...r}=t,i=typeof(t==null?void 0:t.id)=="number"||((e=t.id)==null?void 0:e.length)>0?t.id:oE++,o=this.toasts.find(s=>s.id===i),a=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),o?this.toasts=this.toasts.map(s=>s.id===i?(this.publish({...s,...t,id:i,title:n}),{...s,...t,id:i,dismissible:a,title:n}):s):this.addToast({title:n,...r,dismissible:a,id:i}),i},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(e=>{this.subscribers.forEach(n=>n({id:e.id,dismiss:!0}))}),this.subscribers.forEach(e=>e({id:t,dismiss:!0})),t),this.message=(t,e)=>this.create({...e,message:t}),this.error=(t,e)=>this.create({...e,message:t,type:"error"}),this.success=(t,e)=>this.create({...e,type:"success",message:t}),this.info=(t,e)=>this.create({...e,type:"info",message:t}),this.warning=(t,e)=>this.create({...e,type:"warning",message:t}),this.loading=(t,e)=>this.create({...e,type:"loading",message:t}),this.promise=(t,e)=>{if(!e)return;let n;e.loading!==void 0&&(n=this.create({...e,promise:t,type:"loading",message:e.loading,description:typeof e.description!="function"?e.description:void 0}));let r=t instanceof Promise?t:t(),i=n!==void 0,o,a=r.then(async l=>{if(o=["resolve",l],Z.isValidElement(l))i=!1,this.create({id:n,type:"default",message:l});else if(_9(l)&&!l.ok){i=!1;let c=typeof e.error=="function"?await e.error(`HTTP error! status: ${l.status}`):e.error,u=typeof e.description=="function"?await e.description(`HTTP error! status: ${l.status}`):e.description;this.create({id:n,type:"error",message:c,description:u})}else if(e.success!==void 0){i=!1;let c=typeof e.success=="function"?await e.success(l):e.success,u=typeof e.description=="function"?await e.description(l):e.description;this.create({id:n,type:"success",message:c,description:u})}}).catch(async l=>{if(o=["reject",l],e.error!==void 0){i=!1;let c=typeof e.error=="function"?await e.error(l):e.error,u=typeof e.description=="function"?await e.description(l):e.description;this.create({id:n,type:"error",message:c,description:u})}}).finally(()=>{var l;i&&(this.dismiss(n),n=void 0),(l=e.finally)==null||l.call(e)}),s=()=>new Promise((l,c)=>a.then(()=>o[0]==="reject"?c(o[1]):l(o[1])).catch(c));return typeof n!="string"&&typeof n!="number"?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(t,e)=>{let n=(e==null?void 0:e.id)||oE++;return this.create({jsx:t(n),id:n,...e}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},ni=new x9,b9=(t,e)=>{let n=(e==null?void 0:e.id)||oE++;return ni.addToast({title:t,...e,id:n}),n},_9=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",w9=b9,S9=()=>ni.toasts,E9=()=>ni.getActiveToasts(),Ur=Object.assign(w9,{success:ni.success,info:ni.info,warning:ni.warning,error:ni.error,custom:ni.custom,message:ni.message,promise:ni.promise,dismiss:ni.dismiss,loading:ni.loading},{getHistory:S9,getToasts:E9});function T9(t,{insertAt:e}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}T9(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-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;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)} +`);function vg(t){return t.label!==void 0}var M9=3,A9="32px",C9="16px",VR=4e3,P9=356,R9=14,N9=20,O9=200;function uo(...t){return t.filter(Boolean).join(" ")}function I9(t){let[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}var D9=t=>{var e,n,r,i,o,a,s,l,c,u,d;let{invert:f,toast:p,unstyled:y,interacting:v,setHeights:g,visibleToasts:m,heights:x,index:b,toasts:S,expanded:w,removeToast:E,defaultRichColors:T,closeButton:A,style:M,cancelButtonStyle:C,actionButtonStyle:P,className:R="",descriptionClassName:D="",duration:k,position:U,gap:O,loadingIcon:W,expandByDefault:L,classNames:j,icons:X,closeButtonAriaLabel:K="Close toast",pauseWhenPageIsHidden:F}=t,[Y,q]=Z.useState(null),[Q,te]=Z.useState(null),[ee,ce]=Z.useState(!1),[ae,fe]=Z.useState(!1),[we,le]=Z.useState(!1),[ie,G]=Z.useState(!1),[Ve,Ne]=Z.useState(!1),[st,Re]=Z.useState(0),[ct,Ye]=Z.useState(0),it=Z.useRef(p.duration||k||VR),Ft=Z.useRef(null),J=Z.useRef(null),B=b===0,ue=b+1<=m,me=p.type,be=p.dismissible!==!1,ge=p.className||"",rt=p.descriptionClassName||"",Ie=Z.useMemo(()=>x.findIndex(Se=>Se.toastId===p.id)||0,[x,p.id]),Je=Z.useMemo(()=>{var Se;return(Se=p.closeButton)!=null?Se:A},[p.closeButton,A]),tt=Z.useMemo(()=>p.duration||k||VR,[p.duration,k]),Ee=Z.useRef(0),Be=Z.useRef(0),ht=Z.useRef(0),ot=Z.useRef(null),[Le,_t]=U.split("-"),re=Z.useMemo(()=>x.reduce((Se,je,vt)=>vt>=Ie?Se:Se+je.height,0),[x,Ie]),ke=y9(),Me=p.invert||f,Ge=me==="loading";Be.current=Z.useMemo(()=>Ie*O+re,[Ie,re]),Z.useEffect(()=>{it.current=tt},[tt]),Z.useEffect(()=>{ce(!0)},[]),Z.useEffect(()=>{let Se=J.current;if(Se){let je=Se.getBoundingClientRect().height;return Ye(je),g(vt=>[{toastId:p.id,height:je,position:p.position},...vt]),()=>g(vt=>vt.filter(pt=>pt.toastId!==p.id))}},[g,p.id]),Z.useLayoutEffect(()=>{if(!ee)return;let Se=J.current,je=Se.style.height;Se.style.height="auto";let vt=Se.getBoundingClientRect().height;Se.style.height=je,Ye(vt),g(pt=>pt.find(fn=>fn.toastId===p.id)?pt.map(fn=>fn.toastId===p.id?{...fn,height:vt}:fn):[{toastId:p.id,height:vt,position:p.position},...pt])},[ee,p.title,p.description,g,p.id]);let Te=Z.useCallback(()=>{fe(!0),Re(Be.current),g(Se=>Se.filter(je=>je.toastId!==p.id)),setTimeout(()=>{E(p)},O9)},[p,E,g,Be]);Z.useEffect(()=>{if(p.promise&&me==="loading"||p.duration===1/0||p.type==="loading")return;let Se;return w||v||F&&ke?(()=>{if(ht.current{var je;(je=p.onAutoClose)==null||je.call(p,p),Te()},it.current)),()=>clearTimeout(Se)},[w,v,p,me,F,ke,Te]),Z.useEffect(()=>{p.delete&&Te()},[Te,p.delete]);function _e(){var Se,je,vt;return X!=null&&X.loading?Z.createElement("div",{className:uo(j==null?void 0:j.loader,(Se=p==null?void 0:p.classNames)==null?void 0:Se.loader,"sonner-loader"),"data-visible":me==="loading"},X.loading):W?Z.createElement("div",{className:uo(j==null?void 0:j.loader,(je=p==null?void 0:p.classNames)==null?void 0:je.loader,"sonner-loader"),"data-visible":me==="loading"},W):Z.createElement(f9,{className:uo(j==null?void 0:j.loader,(vt=p==null?void 0:p.classNames)==null?void 0:vt.loader),visible:me==="loading"})}return Z.createElement("li",{tabIndex:0,ref:J,className:uo(R,ge,j==null?void 0:j.toast,(e=p==null?void 0:p.classNames)==null?void 0:e.toast,j==null?void 0:j.default,j==null?void 0:j[me],(n=p==null?void 0:p.classNames)==null?void 0:n[me]),"data-sonner-toast":"","data-rich-colors":(r=p.richColors)!=null?r:T,"data-styled":!(p.jsx||p.unstyled||y),"data-mounted":ee,"data-promise":!!p.promise,"data-swiped":Ve,"data-removed":ae,"data-visible":ue,"data-y-position":Le,"data-x-position":_t,"data-index":b,"data-front":B,"data-swiping":we,"data-dismissible":be,"data-type":me,"data-invert":Me,"data-swipe-out":ie,"data-swipe-direction":Q,"data-expanded":!!(w||L&&ee),style:{"--index":b,"--toasts-before":b,"--z-index":S.length-b,"--offset":`${ae?st:Be.current}px`,"--initial-height":L?"auto":`${ct}px`,...M,...p.style},onDragEnd:()=>{le(!1),q(null),ot.current=null},onPointerDown:Se=>{Ge||!be||(Ft.current=new Date,Re(Be.current),Se.target.setPointerCapture(Se.pointerId),Se.target.tagName!=="BUTTON"&&(le(!0),ot.current={x:Se.clientX,y:Se.clientY}))},onPointerUp:()=>{var Se,je,vt,pt;if(ie||!be)return;ot.current=null;let fn=Number(((Se=J.current)==null?void 0:Se.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Un=Number(((je=J.current)==null?void 0:je.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ui=new Date().getTime()-((vt=Ft.current)==null?void 0:vt.getTime()),_r=Y==="x"?fn:Un,nr=Math.abs(_r)/Ui;if(Math.abs(_r)>=N9||nr>.11){Re(Be.current),(pt=p.onDismiss)==null||pt.call(p,p),te(Y==="x"?fn>0?"right":"left":Un>0?"down":"up"),Te(),G(!0),Ne(!1);return}le(!1),q(null)},onPointerMove:Se=>{var je,vt,pt,fn;if(!ot.current||!be||((je=window.getSelection())==null?void 0:je.toString().length)>0)return;let Un=Se.clientY-ot.current.y,Ui=Se.clientX-ot.current.x,_r=(vt=t.swipeDirections)!=null?vt:I9(U);!Y&&(Math.abs(Ui)>1||Math.abs(Un)>1)&&q(Math.abs(Ui)>Math.abs(Un)?"x":"y");let nr={x:0,y:0};Y==="y"?(_r.includes("top")||_r.includes("bottom"))&&(_r.includes("top")&&Un<0||_r.includes("bottom")&&Un>0)&&(nr.y=Un):Y==="x"&&(_r.includes("left")||_r.includes("right"))&&(_r.includes("left")&&Ui<0||_r.includes("right")&&Ui>0)&&(nr.x=Ui),(Math.abs(nr.x)>0||Math.abs(nr.y)>0)&&Ne(!0),(pt=J.current)==null||pt.style.setProperty("--swipe-amount-x",`${nr.x}px`),(fn=J.current)==null||fn.style.setProperty("--swipe-amount-y",`${nr.y}px`)}},Je&&!p.jsx?Z.createElement("button",{"aria-label":K,"data-disabled":Ge,"data-close-button":!0,onClick:Ge||!be?()=>{}:()=>{var Se;Te(),(Se=p.onDismiss)==null||Se.call(p,p)},className:uo(j==null?void 0:j.closeButton,(i=p==null?void 0:p.classNames)==null?void 0:i.closeButton)},(o=X==null?void 0:X.close)!=null?o:v9):null,p.jsx||_.isValidElement(p.title)?p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title:Z.createElement(Z.Fragment,null,me||p.icon||p.promise?Z.createElement("div",{"data-icon":"",className:uo(j==null?void 0:j.icon,(a=p==null?void 0:p.classNames)==null?void 0:a.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||_e():null,p.type!=="loading"?p.icon||(X==null?void 0:X[me])||u9(me):null):null,Z.createElement("div",{"data-content":"",className:uo(j==null?void 0:j.content,(s=p==null?void 0:p.classNames)==null?void 0:s.content)},Z.createElement("div",{"data-title":"",className:uo(j==null?void 0:j.title,(l=p==null?void 0:p.classNames)==null?void 0:l.title)},typeof p.title=="function"?p.title():p.title),p.description?Z.createElement("div",{"data-description":"",className:uo(D,rt,j==null?void 0:j.description,(c=p==null?void 0:p.classNames)==null?void 0:c.description)},typeof p.description=="function"?p.description():p.description):null),_.isValidElement(p.cancel)?p.cancel:p.cancel&&vg(p.cancel)?Z.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||C,onClick:Se=>{var je,vt;vg(p.cancel)&&be&&((vt=(je=p.cancel).onClick)==null||vt.call(je,Se),Te())},className:uo(j==null?void 0:j.cancelButton,(u=p==null?void 0:p.classNames)==null?void 0:u.cancelButton)},p.cancel.label):null,_.isValidElement(p.action)?p.action:p.action&&vg(p.action)?Z.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||P,onClick:Se=>{var je,vt;vg(p.action)&&((vt=(je=p.action).onClick)==null||vt.call(je,Se),!Se.defaultPrevented&&Te())},className:uo(j==null?void 0:j.actionButton,(d=p==null?void 0:p.classNames)==null?void 0:d.actionButton)},p.action.label):null))};function GR(){if(typeof window>"u"||typeof document>"u")return"ltr";let t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function L9(t,e){let n={};return[t,e].forEach((r,i)=>{let o=i===1,a=o?"--mobile-offset":"--offset",s=o?C9:A9;function l(c){["top","right","bottom","left"].forEach(u=>{n[`${a}-${u}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{r[c]===void 0?n[`${a}-${c}`]=s:n[`${a}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):l(s)}),n}_.forwardRef(function(t,e){let{invert:n,position:r="bottom-right",hotkey:i=["altKey","KeyT"],expand:o,closeButton:a,className:s,offset:l,mobileOffset:c,theme:u="light",richColors:d,duration:f,style:p,visibleToasts:y=M9,toastOptions:v,dir:g=GR(),gap:m=R9,loadingIcon:x,icons:b,containerAriaLabel:S="Notifications",pauseWhenPageIsHidden:w}=t,[E,T]=Z.useState([]),A=Z.useMemo(()=>Array.from(new Set([r].concat(E.filter(F=>F.position).map(F=>F.position)))),[E,r]),[M,C]=Z.useState([]),[P,R]=Z.useState(!1),[D,k]=Z.useState(!1),[U,O]=Z.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),W=Z.useRef(null),L=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),j=Z.useRef(null),X=Z.useRef(!1),K=Z.useCallback(F=>{T(Y=>{var q;return(q=Y.find(Q=>Q.id===F.id))!=null&&q.delete||ni.dismiss(F.id),Y.filter(({id:Q})=>Q!==F.id)})},[]);return Z.useEffect(()=>ni.subscribe(F=>{if(F.dismiss){T(Y=>Y.map(q=>q.id===F.id?{...q,delete:!0}:q));return}setTimeout(()=>{j3.flushSync(()=>{T(Y=>{let q=Y.findIndex(Q=>Q.id===F.id);return q!==-1?[...Y.slice(0,q),{...Y[q],...F},...Y.slice(q+1)]:[F,...Y]})})})}),[]),Z.useEffect(()=>{if(u!=="system"){O(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?O("dark"):O("light")),typeof window>"u")return;let F=window.matchMedia("(prefers-color-scheme: dark)");try{F.addEventListener("change",({matches:Y})=>{O(Y?"dark":"light")})}catch{F.addListener(({matches:q})=>{try{O(q?"dark":"light")}catch(Q){console.error(Q)}})}},[u]),Z.useEffect(()=>{E.length<=1&&R(!1)},[E]),Z.useEffect(()=>{let F=Y=>{var q,Q;i.every(te=>Y[te]||Y.code===te)&&(R(!0),(q=W.current)==null||q.focus()),Y.code==="Escape"&&(document.activeElement===W.current||(Q=W.current)!=null&&Q.contains(document.activeElement))&&R(!1)};return document.addEventListener("keydown",F),()=>document.removeEventListener("keydown",F)},[i]),Z.useEffect(()=>{if(W.current)return()=>{j.current&&(j.current.focus({preventScroll:!0}),j.current=null,X.current=!1)}},[W.current]),Z.createElement("section",{ref:e,"aria-label":`${S} ${L}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},A.map((F,Y)=>{var q;let[Q,te]=F.split("-");return E.length?Z.createElement("ol",{key:F,dir:g==="auto"?GR():g,tabIndex:-1,ref:W,className:s,"data-sonner-toaster":!0,"data-theme":U,"data-y-position":Q,"data-lifted":P&&E.length>1&&!o,"data-x-position":te,style:{"--front-toast-height":`${((q=M[0])==null?void 0:q.height)||0}px`,"--width":`${P9}px`,"--gap":`${m}px`,...p,...L9(l,c)},onBlur:ee=>{X.current&&!ee.currentTarget.contains(ee.relatedTarget)&&(X.current=!1,j.current&&(j.current.focus({preventScroll:!0}),j.current=null))},onFocus:ee=>{ee.target instanceof HTMLElement&&ee.target.dataset.dismissible==="false"||X.current||(X.current=!0,j.current=ee.relatedTarget)},onMouseEnter:()=>R(!0),onMouseMove:()=>R(!0),onMouseLeave:()=>{D||R(!1)},onDragEnd:()=>R(!1),onPointerDown:ee=>{ee.target instanceof HTMLElement&&ee.target.dataset.dismissible==="false"||k(!0)},onPointerUp:()=>k(!1)},E.filter(ee=>!ee.position&&Y===0||ee.position===F).map((ee,ce)=>{var ae,fe;return Z.createElement(D9,{key:ee.id,icons:b,index:ce,toast:ee,defaultRichColors:d,duration:(ae=v==null?void 0:v.duration)!=null?ae:f,className:v==null?void 0:v.className,descriptionClassName:v==null?void 0:v.descriptionClassName,invert:n,visibleToasts:y,closeButton:(fe=v==null?void 0:v.closeButton)!=null?fe:a,interacting:D,position:F,style:v==null?void 0:v.style,unstyled:v==null?void 0:v.unstyled,classNames:v==null?void 0:v.classNames,cancelButtonStyle:v==null?void 0:v.cancelButtonStyle,actionButtonStyle:v==null?void 0:v.actionButtonStyle,removeToast:K,toasts:E.filter(we=>we.position==ee.position),heights:M.filter(we=>we.position==ee.position),setHeights:C,expandByDefault:o,gap:m,loadingIcon:x,expanded:P,pauseWhenPageIsHidden:w,swipeDirections:t.swipeDirections})})):null}))});function k9(t){if(!(t instanceof DataTransfer))throw new Error('Data must be of type "DataTransfer"');const e={};function n(r){const i=a=>a!==null&&typeof a=="object"&&"isFile"in a&&typeof a.file=="function"&&"fullPath"in a,o=a=>a!==null&&typeof a=="object"&&"isFile"in a&&typeof a.createReader=="function";if(i(r)&&r.isFile)return new Promise(a=>{r.file(s=>{e[r.fullPath]=s,a()})});if(o(r)&&!r.isFile){const a=r.createReader();return new Promise(s=>{const l=[];function c(){a.readEntries(u=>{u.length===0?Promise.all(l).then(()=>s()):(u.forEach(d=>{l.push(n(d))}),c())})}c()})}return Promise.resolve()}return new Promise(r=>{const i=t.items&&Array.from(t.items),o=Array.from(t.files);if(i&&i.length&&"webkitGetAsEntry"in i[0]){const a=[];for(let s=0;sr(e))}else o.filter(a=>a.size!==0).forEach(a=>e["/"+a.name]=a),r(e)})}function WR(t){return t.replace(/\\/g,"/").split(/\//g).reduce((e,n)=>(n===".."?e.pop():n!=="."&&e.push(n),e),[]).join("/")}function XR(t){return new Promise((e,n)=>{const r=new FileReader;r.onload=i=>{i.target&&i.target.result?e(i.target.result):n(new Error("Failed to read Urdf file content"))},r.onerror=()=>n(new Error("Error reading Urdf file")),r.readAsText(t)})}async function j9(t,e){const n=await k9(t),r=Object.keys(n).map(a=>WR(a)),i=r.filter(a=>/urdf$/i.test(a)),o={};if(i.forEach(a=>{o[a]=URL.createObjectURL(n[a])}),i.length>0){const s=i[0].match(/^(\/[^/]+\/)/);s&&s[1]&&s[1]}return e.setUrlModifierFunc(a=>{var u;const l=WR(a).split("/").pop()||"";let c=r.find(d=>d.endsWith(l));if(!c&&l.includes(".")){const d="."+l.split(".").pop();c=r.find(f=>f.endsWith(d))}if(c!=null){const d=((u=c.split(".").pop())==null?void 0:u.toLowerCase())||"",f=new Blob([n[c]],{type:U9(d)}),p=URL.createObjectURL(f)+"#."+d;return setTimeout(()=>URL.revokeObjectURL(p),5e3),p}return console.warn(`No matching file found for: ${a}`),a}),{files:n,availableModels:i,blobUrls:o}}function U9(t){switch(t.toLowerCase()){case"stl":return"model/stl";case"obj":return"model/obj";case"gltf":case"glb":return"model/gltf+json";case"dae":return"model/vnd.collada+xml";case"urdf":return"application/xml";default:return"application/octet-stream"}}const rU=_.createContext(void 0),F9=({children:t})=>{const[e,n]=_.useState(null),[r,i]=_.useState({}),[o,a]=_.useState([]),[s,l]=_.useState(!1),[c,u]=_.useState([]),[d,f]=_.useState(!0),[p,y]=_.useState(null),[v,g]=_.useState(null);_.useEffect(()=>{if(!d||p)return;let P=!1;return(async()=>{try{const R=await fetch("/so-101-urdf/urdf/so101_new_calib.urdf");if(!R.ok)throw new Error(`Failed to fetch default Urdf: ${R.statusText}`);const D=await R.text();P||y(D)}catch(R){P||console.error("Error loading default Urdf content:",R)}})(),()=>{P=!0}},[d,p]);const m=_.useRef([]),x=_.useCallback(()=>{f(!0),y(null),g(null),Ur.info("Switched to default model",{description:"The default ARM100 robot model is now displayed."})},[]),b=_.useCallback(P=>(m.current.push(P),()=>{m.current=m.current.filter(R=>R!==P)}),[]),S=_.useCallback(P=>{n(P)},[]),w=_.useCallback(P=>{P.hasUrdf?f(!1):x(),m.current.forEach(R=>R(P))},[x]),E=_.useCallback(async P=>{var k;if(!e)return;const R=Object.values(r).filter(U=>U===P.blobUrl).map(U=>{const O=Object.keys(r).find(W=>r[W]===U);return O?{path:O,url:U}:null}).filter(U=>U!==null);if(R.length===0){console.error("โŒ Could not find file for selected Urdf model");return}const D=Ur.loading("Loading Urdf model...",{description:"Preparing 3D visualization",duration:5e3});try{const U=(k=R[0])==null?void 0:k.path;if(!U||!r[U])throw new Error("File not found in records");const W=await(await fetch(P.blobUrl)).blob(),L=new File([W],U.split("/").pop()||"model.urdf",{type:"application/xml"}),j=await XR(L);y(j),Ur.dismiss(D),f(!1);const X=P.name||P.path.split("/").pop()||"Unknown";Ur.success("Urdf model loaded successfully",{description:`Model: ${X}`,duration:3e3}),w({hasUrdf:!0,modelName:X})}catch(U){console.error("โŒ Error processing selected Urdf:",U),Ur.dismiss(D),Ur.error("Error loading Urdf",{description:`Error: ${U instanceof Error?U.message:String(U)}`,duration:3e3})}},[r,e,w]),T=_.useCallback(P=>{var D;if(!e){console.error("โŒ No Urdf processor available");return}l(!1);const R=P.name||((D=P.path.split("/").pop())==null?void 0:D.replace(/\.urdf$/i,""))||"Unknown";e.loadUrdf(P.blobUrl),f(!1),Ur.info(`Loading model: ${R}`,{description:"Preparing 3D visualization",duration:2e3}),w({hasUrdf:!0,modelName:R}),E(P)},[e,w,E]),A=_.useCallback(async(P,R)=>{Object.values(r).forEach(URL.revokeObjectURL),i({}),a([]),u([]);try{if(R.length>0&&e){const D={};R.forEach(U=>{P[U]&&(D[U]=URL.createObjectURL(P[U]))}),i(D),a(R);const k=R.map(U=>{const W=(U.split("/").pop()||"").replace(/\.urdf$/i,"");return{path:U,blobUrl:D[U],name:W}});if(u(k),R.length===1){const O=(R[0].split("/").pop()||"").replace(/\.urdf$/i,""),W=D[R[0]];if(W)if(e.loadUrdf(W),f(!1),P[R[0]]){const L=Ur.loading("Loading Urdf model...",{description:"Preparing 3D visualization",duration:5e3});try{const j=await XR(P[R[0]]);y(j),Ur.dismiss(L),Ur.success("Urdf model loaded successfully",{description:`Model: ${O}`,duration:3e3}),w({hasUrdf:!0,modelName:O})}catch(j){console.error("Error loading Urdf:",j),Ur.dismiss(L),Ur.error("Error loading Urdf",{description:`Error: ${j instanceof Error?j.message:String(j)}`,duration:3e3}),w({hasUrdf:!0,modelName:O})}}else console.error("Could not find file for Urdf model:",R[0]),w({hasUrdf:!0,modelName:O});else console.warn(`No blob URL found for ${R[0]}, using path directly`),e.loadUrdf(R[0]),f(!1),w({hasUrdf:!0,modelName:O})}else l(!0),w({hasUrdf:!0,modelName:"Multiple models available"})}else w({hasUrdf:!1}),x(),Ur.error("No Urdf file found",{description:"Please upload a folder containing a .urdf file.",duration:3e3})}catch(D){console.error("Error processing Urdf files:",D),Ur.error("Error processing files",{description:`Error: ${D instanceof Error?D.message:String(D)}`,duration:3e3}),x()}},[w,r,e,x]),M=_.useRef(r);M.current=r,_.useEffect(()=>()=>{Object.values(M.current).forEach(URL.revokeObjectURL)},[]);const C=_.useMemo(()=>({urdfProcessor:e,registerUrdfProcessor:S,onUrdfDetected:b,processUrdfFiles:A,urdfBlobUrls:r,alternativeUrdfModels:o,isSelectionModalOpen:s,setIsSelectionModalOpen:l,urdfModelOptions:c,selectUrdfModel:T,isDefaultModel:d,setIsDefaultModel:f,resetToDefaultModel:x,urdfContent:p,currentAnimationConfig:v,setCurrentAnimationConfig:g}),[e,S,b,A,r,o,s,c,T,d,x,p,v]);return h.jsx(rU.Provider,{value:C,children:t})},iU=()=>{const t=_.useContext(rU);if(t===void 0)throw new Error("useUrdf must be used within a UrdfProvider");return t},B9=_.createContext(void 0),$9=({children:t})=>{const[e,n]=_.useState(!1),{urdfProcessor:r,processUrdfFiles:i}=iU(),o=u=>{u.preventDefault(),u.stopPropagation()},a=u=>{u.preventDefault(),u.stopPropagation(),n(!0)},s=u=>{u.preventDefault(),u.stopPropagation(),(!u.relatedTarget||!u.relatedTarget.closest("html"))&&n(!1)},l=_.useCallback(async u=>{if(u.preventDefault(),u.stopPropagation(),n(!1),!(!u.dataTransfer||!r))try{const{availableModels:d,files:f}=await j9(u.dataTransfer,r);await i(f,d)}catch(d){console.error("Error in handleDrop:",d)}},[r,i]);_.useEffect(()=>(document.addEventListener("dragover",o),document.addEventListener("dragenter",a),document.addEventListener("dragleave",s),document.addEventListener("drop",l),()=>{document.removeEventListener("dragover",o),document.removeEventListener("dragenter",a),document.removeEventListener("dragleave",s),document.removeEventListener("drop",l)}),[l]);const c=_.useMemo(()=>({isDragging:e,setIsDragging:n,handleDrop:l}),[e,l]);return h.jsxs(B9.Provider,{value:c,children:[t,e&&h.jsx("div",{className:"fixed inset-0 bg-primary/10 pointer-events-none z-50 flex items-center justify-center",children:h.jsxs("div",{className:"bg-background p-8 rounded-lg shadow-lg text-center",children:[h.jsx("div",{className:"text-3xl font-bold mb-4",children:"Drop Urdf Files Here"}),h.jsx("p",{className:"text-muted-foreground",children:"Release to upload your robot model"})]})})]})},z9=1,H9=1e6;let T_=0;function V9(){return T_=(T_+1)%Number.MAX_SAFE_INTEGER,T_.toString()}const M_=new Map,qR=t=>{if(M_.has(t))return;const e=setTimeout(()=>{M_.delete(t),Hh({type:"REMOVE_TOAST",toastId:t})},H9);M_.set(t,e)},G9=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,z9)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(n=>n.id===e.toast.id?{...n,...e.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=e;return n?qR(n):t.toasts.forEach(r=>{qR(r.id)}),{...t,toasts:t.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(n=>n.id!==e.toastId)}}},Ov=[];let Iv={toasts:[]};function Hh(t){Iv=G9(Iv,t),Ov.forEach(e=>{e(Iv)})}function W9({...t}){const e=V9(),n=i=>Hh({type:"UPDATE_TOAST",toast:{...i,id:e}}),r=()=>Hh({type:"DISMISS_TOAST",toastId:e});return Hh({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:i=>{i||r()}}}),{id:e,dismiss:r,update:n}}function Dr(){const[t,e]=_.useState(Iv);return _.useEffect(()=>(Ov.push(e),()=>{const n=Ov.indexOf(e);n>-1&&Ov.splice(n,1)}),[t]),{...t,toast:W9,dismiss:n=>Hh({type:"DISMISS_TOAST",toastId:n})}}function Oe(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t==null||t(i),n===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function KR(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function ts(...t){return e=>{let n=!1;const r=t.map(i=>{const o=KR(i,e);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i{const{children:a,...s}=o,l=_.useMemo(()=>s,Object.values(s));return h.jsx(n.Provider,{value:l,children:a})};r.displayName=t+"Provider";function i(o){const a=_.useContext(n);if(a)return a;if(e!==void 0)return e;throw new Error(`\`${o}\` must be used within \`${t}\``)}return[r,i]}function mi(t,e=[]){let n=[];function r(o,a){const s=_.createContext(a),l=n.length;n=[...n,a];const c=d=>{var m;const{scope:f,children:p,...y}=d,v=((m=f==null?void 0:f[t])==null?void 0:m[l])||s,g=_.useMemo(()=>y,Object.values(y));return h.jsx(v.Provider,{value:g,children:p})};c.displayName=o+"Provider";function u(d,f){var v;const p=((v=f==null?void 0:f[t])==null?void 0:v[l])||s,y=_.useContext(p);if(y)return y;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${o}\``)}return[c,u]}const i=()=>{const o=n.map(a=>_.createContext(a));return function(s){const l=(s==null?void 0:s[t])||o;return _.useMemo(()=>({[`__scope${t}`]:{...s,[t]:l}}),[s,l])}};return i.scopeName=t,[r,q9(i,...e)]}function q9(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((s,{useScope:l,scopeName:c})=>{const d=l(o)[`__scope${c}`];return{...s,...d}},{});return _.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}function al(t){const e=Y9(t),n=_.forwardRef((r,i)=>{const{children:o,...a}=r,s=_.Children.toArray(o),l=s.find(J9);if(l){const c=l.props.children,u=s.map(d=>d===l?_.Children.count(c)>1?_.Children.only(null):_.isValidElement(c)?c.props.children:null:d);return h.jsx(e,{...a,ref:i,children:_.isValidElement(c)?_.cloneElement(c,void 0,u):null})}return h.jsx(e,{...a,ref:i,children:o})});return n.displayName=`${t}.Slot`,n}var K9=al("Slot");function Y9(t){const e=_.forwardRef((n,r)=>{const{children:i,...o}=n;if(_.isValidElement(i)){const a=Q9(i),s=Z9(o,i.props);return i.type!==_.Fragment&&(s.ref=r?ts(r,a):a),_.cloneElement(i,s)}return _.Children.count(i)>1?_.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var oU=Symbol("radix.slottable");function aU(t){const e=({children:n})=>h.jsx(h.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=oU,e}function J9(t){return _.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===oU}function Z9(t,e){const n={...e};for(const r in e){const i=t[r],o=e[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{const l=o(...s);return i(...s),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...t,...n}}function Q9(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function tx(t){const e=t+"CollectionProvider",[n,r]=mi(e),[i,o]=n(e,{collectionRef:{current:null},itemMap:new Map}),a=v=>{const{scope:g,children:m}=v,x=Z.useRef(null),b=Z.useRef(new Map).current;return h.jsx(i,{scope:g,itemMap:b,collectionRef:x,children:m})};a.displayName=e;const s=t+"CollectionSlot",l=al(s),c=Z.forwardRef((v,g)=>{const{scope:m,children:x}=v,b=o(s,m),S=Ot(g,b.collectionRef);return h.jsx(l,{ref:S,children:x})});c.displayName=s;const u=t+"CollectionItemSlot",d="data-radix-collection-item",f=al(u),p=Z.forwardRef((v,g)=>{const{scope:m,children:x,...b}=v,S=Z.useRef(null),w=Ot(g,S),E=o(u,m);return Z.useEffect(()=>(E.itemMap.set(S,{ref:S,...b}),()=>void E.itemMap.delete(S))),h.jsx(f,{[d]:"",ref:w,children:x})});p.displayName=u;function y(v){const g=o(t+"CollectionConsumer",v);return Z.useCallback(()=>{const x=g.collectionRef.current;if(!x)return[];const b=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(g.itemMap.values()).sort((E,T)=>b.indexOf(E.ref.current)-b.indexOf(T.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:a,Slot:c,ItemSlot:p},y,r]}var e7=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],nt=e7.reduce((t,e)=>{const n=al(`Primitive.${e}`),r=_.forwardRef((i,o)=>{const{asChild:a,...s}=i,l=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(l,{...s,ref:o})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function XM(t,e){t&&Bc.flushSync(()=>t.dispatchEvent(e))}function di(t){const e=_.useRef(t);return _.useEffect(()=>{e.current=t}),_.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function t7(t,e=globalThis==null?void 0:globalThis.document){const n=di(t);_.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var n7="DismissableLayer",aE="dismissableLayer.update",r7="dismissableLayer.pointerDownOutside",i7="dismissableLayer.focusOutside",YR,sU=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),zc=_.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:a,onDismiss:s,...l}=t,c=_.useContext(sU),[u,d]=_.useState(null),f=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=_.useState({}),y=Ot(e,T=>d(T)),v=Array.from(c.layers),[g]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),m=v.indexOf(g),x=u?v.indexOf(u):-1,b=c.layersWithOutsidePointerEventsDisabled.size>0,S=x>=m,w=a7(T=>{const A=T.target,M=[...c.branches].some(C=>C.contains(A));!S||M||(i==null||i(T),a==null||a(T),T.defaultPrevented||s==null||s())},f),E=s7(T=>{const A=T.target;[...c.branches].some(C=>C.contains(A))||(o==null||o(T),a==null||a(T),T.defaultPrevented||s==null||s())},f);return t7(T=>{x===c.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&s&&(T.preventDefault(),s()))},f),_.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(YR=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),JR(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=YR)}},[u,f,n,c]),_.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),JR())},[u,c]),_.useEffect(()=>{const T=()=>p({});return document.addEventListener(aE,T),()=>document.removeEventListener(aE,T)},[]),h.jsx(nt.div,{...l,ref:y,style:{pointerEvents:b?S?"auto":"none":void 0,...t.style},onFocusCapture:Oe(t.onFocusCapture,E.onFocusCapture),onBlurCapture:Oe(t.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Oe(t.onPointerDownCapture,w.onPointerDownCapture)})});zc.displayName=n7;var o7="DismissableLayerBranch",lU=_.forwardRef((t,e)=>{const n=_.useContext(sU),r=_.useRef(null),i=Ot(e,r);return _.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),h.jsx(nt.div,{...t,ref:i})});lU.displayName=o7;function a7(t,e=globalThis==null?void 0:globalThis.document){const n=di(t),r=_.useRef(!1),i=_.useRef(()=>{});return _.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let l=function(){cU(r7,n,c,{discrete:!0})};const c={originalEvent:s};s.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=l,e.addEventListener("click",i.current,{once:!0})):l()}else e.removeEventListener("click",i.current);r.current=!1},a=window.setTimeout(()=>{e.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),e.removeEventListener("pointerdown",o),e.removeEventListener("click",i.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function s7(t,e=globalThis==null?void 0:globalThis.document){const n=di(t),r=_.useRef(!1);return _.useEffect(()=>{const i=o=>{o.target&&!r.current&&cU(i7,n,{originalEvent:o},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function JR(){const t=new CustomEvent(aE);document.dispatchEvent(t)}function cU(t,e,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?XM(i,o):i.dispatchEvent(o)}var l7=zc,c7=lU,ur=globalThis!=null&&globalThis.document?_.useLayoutEffect:()=>{},u7="Portal",vf=_.forwardRef((t,e)=>{var s;const{container:n,...r}=t,[i,o]=_.useState(!1);ur(()=>o(!0),[]);const a=n||i&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return a?j3.createPortal(h.jsx(nt.div,{...r,ref:e}),a):null});vf.displayName=u7;function d7(t,e){return _.useReducer((n,r)=>e[n][r]??n,t)}var gi=t=>{const{present:e,children:n}=t,r=f7(e),i=typeof n=="function"?n({present:r.isPresent}):_.Children.only(n),o=Ot(r.ref,h7(i));return typeof n=="function"||r.isPresent?_.cloneElement(i,{ref:o}):null};gi.displayName="Presence";function f7(t){const[e,n]=_.useState(),r=_.useRef(null),i=_.useRef(t),o=_.useRef("none"),a=t?"mounted":"unmounted",[s,l]=d7(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const c=yg(r.current);o.current=s==="mounted"?c:"none"},[s]),ur(()=>{const c=r.current,u=i.current;if(u!==t){const f=o.current,p=yg(c);t?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&f!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,l]),ur(()=>{if(e){let c;const u=e.ownerDocument.defaultView??window,d=p=>{const v=yg(r.current).includes(p.animationName);if(p.target===e&&v&&(l("ANIMATION_END"),!i.current)){const g=e.style.animationFillMode;e.style.animationFillMode="forwards",c=u.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=g)})}},f=p=>{p.target===e&&(o.current=yg(r.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",d),e.addEventListener("animationend",d),()=>{u.clearTimeout(c),e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",d),e.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:_.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function yg(t){return(t==null?void 0:t.animationName)||"none"}function h7(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var p7=QT[" useInsertionEffect ".trim().toString()]||ur;function $o({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[i,o,a]=m7({defaultProp:e,onChange:n}),s=t!==void 0,l=s?t:i;{const u=_.useRef(t!==void 0);_.useEffect(()=>{const d=u.current;d!==s&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=s},[s,r])}const c=_.useCallback(u=>{var d;if(s){const f=g7(u)?u(t):u;f!==t&&((d=a.current)==null||d.call(a,f))}else o(u)},[s,t,o,a]);return[l,c]}function m7({defaultProp:t,onChange:e}){const[n,r]=_.useState(t),i=_.useRef(n),o=_.useRef(e);return p7(()=>{o.current=e},[e]),_.useEffect(()=>{var a;i.current!==n&&((a=o.current)==null||a.call(o,n),i.current=n)},[n,i]),[n,r,o]}function g7(t){return typeof t=="function"}var uU=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),v7="VisuallyHidden",nx=_.forwardRef((t,e)=>h.jsx(nt.span,{...t,ref:e,style:{...uU,...t.style}}));nx.displayName=v7;var y7=nx,qM="ToastProvider",[KM,x7,b7]=tx("Toast"),[dU,hDe]=mi("Toast",[b7]),[_7,rx]=dU(qM),fU=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:i="right",swipeThreshold:o=50,children:a}=t,[s,l]=_.useState(null),[c,u]=_.useState(0),d=_.useRef(!1),f=_.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${qM}\`. Expected non-empty \`string\`.`),h.jsx(KM.Provider,{scope:e,children:h.jsx(_7,{scope:e,label:n,duration:r,swipeDirection:i,swipeThreshold:o,toastCount:c,viewport:s,onViewportChange:l,onToastAdd:_.useCallback(()=>u(p=>p+1),[]),onToastRemove:_.useCallback(()=>u(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:a})})};fU.displayName=qM;var hU="ToastViewport",w7=["F8"],sE="toast.viewportPause",lE="toast.viewportResume",pU=_.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=w7,label:i="Notifications ({hotkey})",...o}=t,a=rx(hU,n),s=x7(n),l=_.useRef(null),c=_.useRef(null),u=_.useRef(null),d=_.useRef(null),f=Ot(e,d,a.onViewportChange),p=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),y=a.toastCount>0;_.useEffect(()=>{const g=m=>{var b;r.length!==0&&r.every(S=>m[S]||m.code===S)&&((b=d.current)==null||b.focus())};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[r]),_.useEffect(()=>{const g=l.current,m=d.current;if(y&&g&&m){const x=()=>{if(!a.isClosePausedRef.current){const E=new CustomEvent(sE);m.dispatchEvent(E),a.isClosePausedRef.current=!0}},b=()=>{if(a.isClosePausedRef.current){const E=new CustomEvent(lE);m.dispatchEvent(E),a.isClosePausedRef.current=!1}},S=E=>{!g.contains(E.relatedTarget)&&b()},w=()=>{g.contains(document.activeElement)||b()};return g.addEventListener("focusin",x),g.addEventListener("focusout",S),g.addEventListener("pointermove",x),g.addEventListener("pointerleave",w),window.addEventListener("blur",x),window.addEventListener("focus",b),()=>{g.removeEventListener("focusin",x),g.removeEventListener("focusout",S),g.removeEventListener("pointermove",x),g.removeEventListener("pointerleave",w),window.removeEventListener("blur",x),window.removeEventListener("focus",b)}}},[y,a.isClosePausedRef]);const v=_.useCallback(({tabbingDirection:g})=>{const x=s().map(b=>{const S=b.ref.current,w=[S,...L7(S)];return g==="forwards"?w:w.reverse()});return(g==="forwards"?x.reverse():x).flat()},[s]);return _.useEffect(()=>{const g=d.current;if(g){const m=x=>{var w,E,T;const b=x.altKey||x.ctrlKey||x.metaKey;if(x.key==="Tab"&&!b){const A=document.activeElement,M=x.shiftKey;if(x.target===g&&M){(w=c.current)==null||w.focus();return}const R=v({tabbingDirection:M?"backwards":"forwards"}),D=R.findIndex(k=>k===A);A_(R.slice(D+1))?x.preventDefault():M?(E=c.current)==null||E.focus():(T=u.current)==null||T.focus()}};return g.addEventListener("keydown",m),()=>g.removeEventListener("keydown",m)}},[s,v]),h.jsxs(c7,{ref:l,role:"region","aria-label":i.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:y?void 0:"none"},children:[y&&h.jsx(cE,{ref:c,onFocusFromOutsideViewport:()=>{const g=v({tabbingDirection:"forwards"});A_(g)}}),h.jsx(KM.Slot,{scope:n,children:h.jsx(nt.ol,{tabIndex:-1,...o,ref:f})}),y&&h.jsx(cE,{ref:u,onFocusFromOutsideViewport:()=>{const g=v({tabbingDirection:"backwards"});A_(g)}})]})});pU.displayName=hU;var mU="ToastFocusProxy",cE=_.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=t,o=rx(mU,n);return h.jsx(nx,{"aria-hidden":!0,tabIndex:0,...i,ref:e,style:{position:"fixed"},onFocus:a=>{var c;const s=a.relatedTarget;!((c=o.viewport)!=null&&c.contains(s))&&r()}})});cE.displayName=mU;var wm="Toast",S7="toast.swipeStart",E7="toast.swipeMove",T7="toast.swipeCancel",M7="toast.swipeEnd",gU=_.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:i,onOpenChange:o,...a}=t,[s,l]=$o({prop:r,defaultProp:i??!0,onChange:o,caller:wm});return h.jsx(gi,{present:n||s,children:h.jsx(P7,{open:s,...a,ref:e,onClose:()=>l(!1),onPause:di(t.onPause),onResume:di(t.onResume),onSwipeStart:Oe(t.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Oe(t.onSwipeMove,c=>{const{x:u,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${d}px`)}),onSwipeCancel:Oe(t.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Oe(t.onSwipeEnd,c=>{const{x:u,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${d}px`),l(!1)})})})});gU.displayName=wm;var[A7,C7]=dU(wm,{onClose(){}}),P7=_.forwardRef((t,e)=>{const{__scopeToast:n,type:r="foreground",duration:i,open:o,onClose:a,onEscapeKeyDown:s,onPause:l,onResume:c,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:p,...y}=t,v=rx(wm,n),[g,m]=_.useState(null),x=Ot(e,k=>m(k)),b=_.useRef(null),S=_.useRef(null),w=i||v.duration,E=_.useRef(0),T=_.useRef(w),A=_.useRef(0),{onToastAdd:M,onToastRemove:C}=v,P=di(()=>{var U;(g==null?void 0:g.contains(document.activeElement))&&((U=v.viewport)==null||U.focus()),a()}),R=_.useCallback(k=>{!k||k===1/0||(window.clearTimeout(A.current),E.current=new Date().getTime(),A.current=window.setTimeout(P,k))},[P]);_.useEffect(()=>{const k=v.viewport;if(k){const U=()=>{R(T.current),c==null||c()},O=()=>{const W=new Date().getTime()-E.current;T.current=T.current-W,window.clearTimeout(A.current),l==null||l()};return k.addEventListener(sE,O),k.addEventListener(lE,U),()=>{k.removeEventListener(sE,O),k.removeEventListener(lE,U)}}},[v.viewport,w,l,c,R]),_.useEffect(()=>{o&&!v.isClosePausedRef.current&&R(w)},[o,w,v.isClosePausedRef,R]),_.useEffect(()=>(M(),()=>C()),[M,C]);const D=_.useMemo(()=>g?SU(g):null,[g]);return v.viewport?h.jsxs(h.Fragment,{children:[D&&h.jsx(R7,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:D}),h.jsx(A7,{scope:n,onClose:P,children:Bc.createPortal(h.jsx(KM.ItemSlot,{scope:n,children:h.jsx(l7,{asChild:!0,onEscapeKeyDown:Oe(s,()=>{v.isFocusedToastEscapeKeyDownRef.current||P(),v.isFocusedToastEscapeKeyDownRef.current=!1}),children:h.jsx(nt.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":v.swipeDirection,...y,ref:x,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:Oe(t.onKeyDown,k=>{k.key==="Escape"&&(s==null||s(k.nativeEvent),k.nativeEvent.defaultPrevented||(v.isFocusedToastEscapeKeyDownRef.current=!0,P()))}),onPointerDown:Oe(t.onPointerDown,k=>{k.button===0&&(b.current={x:k.clientX,y:k.clientY})}),onPointerMove:Oe(t.onPointerMove,k=>{if(!b.current)return;const U=k.clientX-b.current.x,O=k.clientY-b.current.y,W=!!S.current,L=["left","right"].includes(v.swipeDirection),j=["left","up"].includes(v.swipeDirection)?Math.min:Math.max,X=L?j(0,U):0,K=L?0:j(0,O),F=k.pointerType==="touch"?10:2,Y={x:X,y:K},q={originalEvent:k,delta:Y};W?(S.current=Y,xg(E7,d,q,{discrete:!1})):ZR(Y,v.swipeDirection,F)?(S.current=Y,xg(S7,u,q,{discrete:!1}),k.target.setPointerCapture(k.pointerId)):(Math.abs(U)>F||Math.abs(O)>F)&&(b.current=null)}),onPointerUp:Oe(t.onPointerUp,k=>{const U=S.current,O=k.target;if(O.hasPointerCapture(k.pointerId)&&O.releasePointerCapture(k.pointerId),S.current=null,b.current=null,U){const W=k.currentTarget,L={originalEvent:k,delta:U};ZR(U,v.swipeDirection,v.swipeThreshold)?xg(M7,p,L,{discrete:!0}):xg(T7,f,L,{discrete:!0}),W.addEventListener("click",j=>j.preventDefault(),{once:!0})}})})})}),v.viewport)})]}):null}),R7=t=>{const{__scopeToast:e,children:n,...r}=t,i=rx(wm,e),[o,a]=_.useState(!1),[s,l]=_.useState(!1);return I7(()=>a(!0)),_.useEffect(()=>{const c=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(c)},[]),s?null:h.jsx(vf,{asChild:!0,children:h.jsx(nx,{...r,children:o&&h.jsxs(h.Fragment,{children:[i.label," ",n]})})})},N7="ToastTitle",vU=_.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return h.jsx(nt.div,{...r,ref:e})});vU.displayName=N7;var O7="ToastDescription",yU=_.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return h.jsx(nt.div,{...r,ref:e})});yU.displayName=O7;var xU="ToastAction",bU=_.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?h.jsx(wU,{altText:n,asChild:!0,children:h.jsx(YM,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${xU}\`. Expected non-empty \`string\`.`),null)});bU.displayName=xU;var _U="ToastClose",YM=_.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,i=C7(_U,n);return h.jsx(wU,{asChild:!0,children:h.jsx(nt.button,{type:"button",...r,ref:e,onClick:Oe(t.onClick,i.onClose)})})});YM.displayName=_U;var wU=_.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...i}=t;return h.jsx(nt.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...i,ref:e})});function SU(t){const e=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),D7(r)){const i=r.ariaHidden||r.hidden||r.style.display==="none",o=r.dataset.radixToastAnnounceExclude==="";if(!i)if(o){const a=r.dataset.radixToastAnnounceAlt;a&&e.push(a)}else e.push(...SU(r))}}),e}function xg(t,e,n,{discrete:r}){const i=n.originalEvent.currentTarget,o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?XM(i,o):i.dispatchEvent(o)}var ZR=(t,e,n=0)=>{const r=Math.abs(t.x),i=Math.abs(t.y),o=r>i;return e==="left"||e==="right"?o&&r>n:!o&&i>n};function I7(t=()=>{}){const e=di(t);ur(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}function D7(t){return t.nodeType===t.ELEMENT_NODE}function L7(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function A_(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var k7=fU,EU=pU,TU=gU,MU=vU,AU=yU,CU=bU,PU=YM;function RU(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;etypeof t=="boolean"?`${t}`:t===0?"0":t,eN=zt,Sm=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return eN(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=e,a=Object.keys(i).map(c=>{const u=n==null?void 0:n[c],d=o==null?void 0:o[c];if(u===null)return null;const f=QR(u)||QR(d);return i[c][f]}),s=n&&Object.entries(n).reduce((c,u)=>{let[d,f]=u;return f===void 0||(c[d]=f),c},{}),l=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:f,...p}=u;return Object.entries(p).every(y=>{let[v,g]=y;return Array.isArray(g)?g.includes({...o,...s}[v]):{...o,...s}[v]===g})?[...c,d,f]:c},[]);return eN(t,a,l,n==null?void 0:n.class,n==null?void 0:n.className)};/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const j7=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),NU=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var U7={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const F7=_.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:a,...s},l)=>_.createElement("svg",{ref:l,...U7,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:NU("lucide",i),...s},[...a.map(([c,u])=>_.createElement(c,u)),...Array.isArray(o)?o:[o]]));/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Tt=(t,e)=>{const n=_.forwardRef(({className:r,...i},o)=>_.createElement(F7,{ref:o,iconNode:e,className:NU(`lucide-${j7(t)}`,r),...i}));return n.displayName=`${t}`,n};/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $u=Tt("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const sl=Tt("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const B7=Tt("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $7=Tt("Camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const yl=Tt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const hc=Tt("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const xp=Tt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const z7=Tt("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const JM=Tt("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const td=Tt("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const qi=Tt("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ZM=Tt("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const H7=Tt("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const nd=Tt("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const uE=Tt("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const dE=Tt("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const QM=Tt("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const V7=Tt("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const G7=Tt("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ll=Tt("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const W7=Tt("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const X7=Tt("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const q7=Tt("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const K7=Tt("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Y7=Tt("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const fi=Tt("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const J7=Tt("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Z7=Tt("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Tc=Tt("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const eA=Tt("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const OU=Tt("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Q7=Tt("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const tA=Tt("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Mh=Tt("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const eX=Tt("SkipForward",[["polygon",{points:"5 4 15 12 5 20 5 4",key:"16p6eg"}],["line",{x1:"19",x2:"19",y1:"5",y2:"19",key:"futhcm"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Od=Tt("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const tX=Tt("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const nA=Tt("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ia=Tt("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const IU=Tt("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const DU=Tt("VideoOff",[["path",{d:"M10.66 6H14a2 2 0 0 1 2 2v2.5l5.248-3.062A.5.5 0 0 1 22 7.87v8.196",key:"w8jjjt"}],["path",{d:"M16 16a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h2",key:"1xawa7"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const nX=Tt("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const rX=Tt("VolumeX",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ix=Tt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),rA="-",iX=t=>{const e=aX(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:a=>{const s=a.split(rA);return s[0]===""&&s.length!==1&&s.shift(),LU(s,e)||oX(a)},getConflictingClassGroupIds:(a,s)=>{const l=n[a]||[];return s&&r[a]?[...l,...r[a]]:l}}},LU=(t,e)=>{var a;if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),i=r?LU(t.slice(1),r):void 0;if(i)return i;if(e.validators.length===0)return;const o=t.join(rA);return(a=e.validators.find(({validator:s})=>s(o)))==null?void 0:a.classGroupId},tN=/^\[(.+)\]$/,oX=t=>{if(tN.test(t)){const e=tN.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},aX=t=>{const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return lX(Object.entries(t.classGroups),n).forEach(([o,a])=>{fE(a,r,o,e)}),r},fE=(t,e,n,r)=>{t.forEach(i=>{if(typeof i=="string"){const o=i===""?e:nN(e,i);o.classGroupId=n;return}if(typeof i=="function"){if(sX(i)){fE(i(r),e,n,r);return}e.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,a])=>{fE(a,nN(e,o),n,r)})})},nN=(t,e)=>{let n=t;return e.split(rA).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},sX=t=>t.isThemeGetter,lX=(t,e)=>e?t.map(([n,r])=>{const i=r.map(o=>typeof o=="string"?e+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([a,s])=>[e+a,s])):o);return[n,i]}):t,cX=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const i=(o,a)=>{n.set(o,a),e++,e>t&&(e=0,r=n,n=new Map)};return{get(o){let a=n.get(o);if(a!==void 0)return a;if((a=r.get(o))!==void 0)return i(o,a),a},set(o,a){n.has(o)?n.set(o,a):i(o,a)}}},kU="!",uX=t=>{const{separator:e,experimentalParseClassName:n}=t,r=e.length===1,i=e[0],o=e.length,a=s=>{const l=[];let c=0,u=0,d;for(let g=0;gu?d-u:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:y,maybePostfixModifierPosition:v}};return n?s=>n({className:s,parseClassName:a}):a},dX=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e},fX=t=>({cache:cX(t.cacheSize),parseClassName:uX(t),...iX(t)}),hX=/\s+/,pX=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=e,o=[],a=t.trim().split(hX);let s="";for(let l=a.length-1;l>=0;l-=1){const c=a[l],{modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(c);let y=!!p,v=r(y?f.substring(0,p):f);if(!v){if(!y){s=c+(s.length>0?" "+s:s);continue}if(v=r(f),!v){s=c+(s.length>0?" "+s:s);continue}y=!1}const g=dX(u).join(":"),m=d?g+kU:g,x=m+v;if(o.includes(x))continue;o.push(x);const b=i(v,y);for(let S=0;S0?" "+s:s)}return s};function mX(){let t=0,e,n,r="";for(;t{if(typeof t=="string")return t;let e,n="";for(let r=0;rd(u),t());return n=fX(c),r=n.cache.get,i=n.cache.set,o=s,s(l)}function s(l){const c=r(l);if(c)return c;const u=pX(l,n);return i(l,u),u}return function(){return o(mX.apply(null,arguments))}}const yn=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},UU=/^\[(?:([a-z-]+):)?(.+)\]$/i,vX=/^\d+\/\d+$/,yX=new Set(["px","full","screen"]),xX=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,bX=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,_X=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,wX=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,SX=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ta=t=>rd(t)||yX.has(t)||vX.test(t),ps=t=>yf(t,"length",NX),rd=t=>!!t&&!Number.isNaN(Number(t)),C_=t=>yf(t,"number",rd),Zf=t=>!!t&&Number.isInteger(Number(t)),EX=t=>t.endsWith("%")&&rd(t.slice(0,-1)),Ct=t=>UU.test(t),ms=t=>xX.test(t),TX=new Set(["length","size","percentage"]),MX=t=>yf(t,TX,FU),AX=t=>yf(t,"position",FU),CX=new Set(["image","url"]),PX=t=>yf(t,CX,IX),RX=t=>yf(t,"",OX),Qf=()=>!0,yf=(t,e,n)=>{const r=UU.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1},NX=t=>bX.test(t)&&!_X.test(t),FU=()=>!1,OX=t=>wX.test(t),IX=t=>SX.test(t),DX=()=>{const t=yn("colors"),e=yn("spacing"),n=yn("blur"),r=yn("brightness"),i=yn("borderColor"),o=yn("borderRadius"),a=yn("borderSpacing"),s=yn("borderWidth"),l=yn("contrast"),c=yn("grayscale"),u=yn("hueRotate"),d=yn("invert"),f=yn("gap"),p=yn("gradientColorStops"),y=yn("gradientColorStopPositions"),v=yn("inset"),g=yn("margin"),m=yn("opacity"),x=yn("padding"),b=yn("saturate"),S=yn("scale"),w=yn("sepia"),E=yn("skew"),T=yn("space"),A=yn("translate"),M=()=>["auto","contain","none"],C=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto",Ct,e],R=()=>[Ct,e],D=()=>["",Ta,ps],k=()=>["auto",rd,Ct],U=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],O=()=>["solid","dashed","dotted","double","none"],W=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],L=()=>["start","end","center","between","around","evenly","stretch"],j=()=>["","0",Ct],X=()=>["auto","avoid","all","avoid-page","page","left","right","column"],K=()=>[rd,Ct];return{cacheSize:500,separator:":",theme:{colors:[Qf],spacing:[Ta,ps],blur:["none","",ms,Ct],brightness:K(),borderColor:[t],borderRadius:["none","","full",ms,Ct],borderSpacing:R(),borderWidth:D(),contrast:K(),grayscale:j(),hueRotate:K(),invert:j(),gap:R(),gradientColorStops:[t],gradientColorStopPositions:[EX,ps],inset:P(),margin:P(),opacity:K(),padding:R(),saturate:K(),scale:K(),sepia:j(),skew:K(),space:R(),translate:R()},classGroups:{aspect:[{aspect:["auto","square","video",Ct]}],container:["container"],columns:[{columns:[ms]}],"break-after":[{"break-after":X()}],"break-before":[{"break-before":X()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...U(),Ct]}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Zf,Ct]}],basis:[{basis:P()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ct]}],grow:[{grow:j()}],shrink:[{shrink:j()}],order:[{order:["first","last","none",Zf,Ct]}],"grid-cols":[{"grid-cols":[Qf]}],"col-start-end":[{col:["auto",{span:["full",Zf,Ct]},Ct]}],"col-start":[{"col-start":k()}],"col-end":[{"col-end":k()}],"grid-rows":[{"grid-rows":[Qf]}],"row-start-end":[{row:["auto",{span:[Zf,Ct]},Ct]}],"row-start":[{"row-start":k()}],"row-end":[{"row-end":k()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ct]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ct]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...L()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...L(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...L(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ct,e]}],"min-w":[{"min-w":[Ct,e,"min","max","fit"]}],"max-w":[{"max-w":[Ct,e,"none","full","min","max","fit","prose",{screen:[ms]},ms]}],h:[{h:[Ct,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ct,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ct,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ct,e,"auto","min","max","fit"]}],"font-size":[{text:["base",ms,ps]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",C_]}],"font-family":[{font:[Qf]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Ct]}],"line-clamp":[{"line-clamp":["none",rd,C_]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ta,Ct]}],"list-image":[{"list-image":["none",Ct]}],"list-style-type":[{list:["none","disc","decimal",Ct]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[m]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[m]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...O(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ta,ps]}],"underline-offset":[{"underline-offset":["auto",Ta,Ct]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ct]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ct]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[m]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...U(),AX]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",MX]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},PX]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[m]}],"border-style":[{border:[...O(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[m]}],"divide-style":[{divide:O()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...O()]}],"outline-offset":[{"outline-offset":[Ta,Ct]}],"outline-w":[{outline:[Ta,ps]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:D()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[m]}],"ring-offset-w":[{"ring-offset":[Ta,ps]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",ms,RX]}],"shadow-color":[{shadow:[Qf]}],opacity:[{opacity:[m]}],"mix-blend":[{"mix-blend":[...W(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":W()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",ms,Ct]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[b]}],sepia:[{sepia:[w]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[m]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[w]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ct]}],duration:[{duration:K()}],ease:[{ease:["linear","in","out","in-out",Ct]}],delay:[{delay:K()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ct]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[Zf,Ct]}],"translate-x":[{"translate-x":[A]}],"translate-y":[{"translate-y":[A]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ct]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ct]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ct]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[Ta,ps,C_]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},LX=gX(DX);function He(...t){return LX(zt(t))}const kX=k7,BU=_.forwardRef(({className:t,...e},n)=>h.jsx(EU,{ref:n,className:He("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",t),...e}));BU.displayName=EU.displayName;const jX=Sm("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),$U=_.forwardRef(({className:t,variant:e,...n},r)=>h.jsx(TU,{ref:r,className:He(jX({variant:e}),t),...n}));$U.displayName=TU.displayName;const UX=_.forwardRef(({className:t,...e},n)=>h.jsx(CU,{ref:n,className:He("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",t),...e}));UX.displayName=CU.displayName;const zU=_.forwardRef(({className:t,...e},n)=>h.jsx(PU,{ref:n,className:He("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",t),"toast-close":"",...e,children:h.jsx(ix,{className:"h-4 w-4"})}));zU.displayName=PU.displayName;const HU=_.forwardRef(({className:t,...e},n)=>h.jsx(MU,{ref:n,className:He("text-sm font-semibold",t),...e}));HU.displayName=MU.displayName;const VU=_.forwardRef(({className:t,...e},n)=>h.jsx(AU,{ref:n,className:He("text-sm opacity-90",t),...e}));VU.displayName=AU.displayName;function FX(){const{toasts:t}=Dr();return h.jsxs(kX,{children:[t.map(function({id:e,title:n,description:r,action:i,...o}){return h.jsxs($U,{...o,children:[h.jsxs("div",{className:"grid gap-1",children:[n&&h.jsx(HU,{children:n}),r&&h.jsx(VU,{children:r})]}),i,h.jsx(zU,{})]},e)}),h.jsx(BU,{})]})}const iA=Sm("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),et=_.forwardRef(({className:t,variant:e,size:n,asChild:r=!1,...i},o)=>{const a=r?K9:"button";return h.jsx(a,{className:He(iA({variant:e,size:n,className:t})),ref:o,...i})});et.displayName="Button";const GU=_.createContext(void 0),P_="lelab.apiBaseUrl",R_="http://127.0.0.1:8000",BX=t=>t.replace(/^http(s?):/,"ws$1:"),$X=new Set(["http://localhost:8001","http://127.0.0.1:8001","http://localhost:8000","http://127.0.0.1:8000"]),zX=()=>{if(typeof window>"u")return R_;const t=new URLSearchParams(window.location.search).get("api");if(t)try{new URL(t);const n=t.replace(/\/$/,"");return window.localStorage.setItem(P_,n),n}catch{console.warn("Invalid `api` query param, ignoring:",t)}const e=window.localStorage.getItem(P_);return e&&!$X.has(e)?e:(e&&window.localStorage.setItem(P_,R_),R_)},HX=({children:t})=>{const[e]=_.useState(zX),n=BX(e),r=_.useCallback(async(o,a={})=>fetch(o,{...a,headers:{"Content-Type":"application/json",...a.headers}}),[]),i=_.useMemo(()=>({baseUrl:e,wsBaseUrl:n,fetchWithHeaders:r}),[e,n,r]);return h.jsx(GU.Provider,{value:i,children:t})},Ln=()=>{const t=_.useContext(GU);if(t===void 0)throw new Error("useApi must be used within an ApiProvider");return t},WU=_.createContext(void 0),VX=({children:t})=>{const{baseUrl:e,fetchWithHeaders:n}=Ln(),[r,i]=_.useState({status:"loading"}),o=_.useCallback(async()=>{i({status:"loading"});try{const l=await(await n(`${e}/hf-auth-status`)).json();l.authenticated?i({status:"authenticated",username:l.username,orgs:l.orgs??[]}):i({status:"unauthenticated",loginCommand:l.login_command??"hf auth login"})}catch(s){console.warn("HF auth status fetch failed:",s),i({status:"unauthenticated",loginCommand:"hf auth login"})}},[e,n]);_.useEffect(()=>{o()},[o]);const a=_.useMemo(()=>({auth:r,refetch:o}),[r,o]);return h.jsx(WU.Provider,{value:a,children:t})},xf=()=>{const t=_.useContext(WU);if(t===void 0)throw new Error("useHfAuth must be used within an HfAuthProvider");return t};var GX=QT[" useId ".trim().toString()]||(()=>{}),WX=0;function sr(t){const[e,n]=_.useState(GX());return ur(()=>{n(r=>r??String(WX++))},[t]),e?`radix-${e}`:""}var N_="focusScope.autoFocusOnMount",O_="focusScope.autoFocusOnUnmount",rN={bubbles:!1,cancelable:!0},XX="FocusScope",Em=_.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=t,[s,l]=_.useState(null),c=di(i),u=di(o),d=_.useRef(null),f=Ot(e,v=>l(v)),p=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(r){let v=function(b){if(p.paused||!s)return;const S=b.target;s.contains(S)?d.current=S:Ts(d.current,{select:!0})},g=function(b){if(p.paused||!s)return;const S=b.relatedTarget;S!==null&&(s.contains(S)||Ts(d.current,{select:!0}))},m=function(b){if(document.activeElement===document.body)for(const w of b)w.removedNodes.length>0&&Ts(s)};document.addEventListener("focusin",v),document.addEventListener("focusout",g);const x=new MutationObserver(m);return s&&x.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",g),x.disconnect()}}},[r,s,p.paused]),_.useEffect(()=>{if(s){oN.add(p);const v=document.activeElement;if(!s.contains(v)){const m=new CustomEvent(N_,rN);s.addEventListener(N_,c),s.dispatchEvent(m),m.defaultPrevented||(qX(QX(XU(s)),{select:!0}),document.activeElement===v&&Ts(s))}return()=>{s.removeEventListener(N_,c),setTimeout(()=>{const m=new CustomEvent(O_,rN);s.addEventListener(O_,u),s.dispatchEvent(m),m.defaultPrevented||Ts(v??document.body,{select:!0}),s.removeEventListener(O_,u),oN.remove(p)},0)}}},[s,c,u,p]);const y=_.useCallback(v=>{if(!n&&!r||p.paused)return;const g=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,m=document.activeElement;if(g&&m){const x=v.currentTarget,[b,S]=KX(x);b&&S?!v.shiftKey&&m===S?(v.preventDefault(),n&&Ts(b,{select:!0})):v.shiftKey&&m===b&&(v.preventDefault(),n&&Ts(S,{select:!0})):m===x&&v.preventDefault()}},[n,r,p.paused]);return h.jsx(nt.div,{tabIndex:-1,...a,ref:f,onKeyDown:y})});Em.displayName=XX;function qX(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Ts(r,{select:e}),document.activeElement!==n)return}function KX(t){const e=XU(t),n=iN(e,t),r=iN(e.reverse(),t);return[n,r]}function XU(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function iN(t,e){for(const n of t)if(!YX(n,{upTo:e}))return n}function YX(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function JX(t){return t instanceof HTMLInputElement&&"select"in t}function Ts(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&JX(t)&&e&&t.select()}}var oN=ZX();function ZX(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=aN(t,e),t.unshift(e)},remove(e){var n;t=aN(t,e),(n=t[0])==null||n.resume()}}}function aN(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function QX(t){return t.filter(e=>e.tagName!=="A")}var I_=0;function ox(){_.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??sN()),document.body.insertAdjacentElement("beforeend",t[1]??sN()),I_++,()=>{I_===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),I_--}},[])}function sN(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var ra=function(){return ra=Object.assign||function(e){for(var n,r=1,i=arguments.length;r"u")return gq;var e=vq(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},xq=JU(),id="data-scroll-locked",bq=function(t,e,n,r){var i=t.left,o=t.top,a=t.right,s=t.gap;return n===void 0&&(n="margin"),` + .`.concat(tq,` { + overflow: hidden `).concat(r,`; + padding-right: `).concat(s,"px ").concat(r,`; + } + body[`).concat(id,`] { + overflow: hidden `).concat(r,`; + overscroll-behavior: contain; + `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&` + padding-left: `.concat(i,`px; + padding-top: `).concat(o,`px; + padding-right: `).concat(a,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(s,"px ").concat(r,`; + `),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),` + } + + .`).concat(Dv,` { + right: `).concat(s,"px ").concat(r,`; + } + + .`).concat(Lv,` { + margin-right: `).concat(s,"px ").concat(r,`; + } + + .`).concat(Dv," .").concat(Dv,` { + right: 0 `).concat(r,`; + } + + .`).concat(Lv," .").concat(Lv,` { + margin-right: 0 `).concat(r,`; + } + + body[`).concat(id,`] { + `).concat(nq,": ").concat(s,`px; + } +`)},cN=function(){var t=parseInt(document.body.getAttribute(id)||"0",10);return isFinite(t)?t:0},_q=function(){_.useEffect(function(){return document.body.setAttribute(id,(cN()+1).toString()),function(){var t=cN()-1;t<=0?document.body.removeAttribute(id):document.body.setAttribute(id,t.toString())}},[])},wq=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,i=r===void 0?"margin":r;_q();var o=_.useMemo(function(){return yq(i)},[i]);return _.createElement(xq,{styles:bq(o,!e,i,n?"":"!important")})},hE=!1;if(typeof window<"u")try{var bg=Object.defineProperty({},"passive",{get:function(){return hE=!0,!0}});window.addEventListener("test",bg,bg),window.removeEventListener("test",bg,bg)}catch{hE=!1}var ru=hE?{passive:!1}:!1,Sq=function(t){return t.tagName==="TEXTAREA"},ZU=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!Sq(t)&&n[e]==="visible")},Eq=function(t){return ZU(t,"overflowY")},Tq=function(t){return ZU(t,"overflowX")},uN=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=QU(t,r);if(i){var o=eF(t,r),a=o[1],s=o[2];if(a>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Mq=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},Aq=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},QU=function(t,e){return t==="v"?Eq(e):Tq(e)},eF=function(t,e){return t==="v"?Mq(e):Aq(e)},Cq=function(t,e){return t==="h"&&e==="rtl"?-1:1},Pq=function(t,e,n,r,i){var o=Cq(t,window.getComputedStyle(e).direction),a=o*r,s=n.target,l=e.contains(s),c=!1,u=a>0,d=0,f=0;do{if(!s)break;var p=eF(t,s),y=p[0],v=p[1],g=p[2],m=v-g-o*y;(y||m)&&QU(t,s)&&(d+=m,f+=y);var x=s.parentNode;s=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}while(!l&&s!==document.body||l&&(e.contains(s)||e===s));return(u&&Math.abs(d)<1||!u&&Math.abs(f)<1)&&(c=!0),c},_g=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},dN=function(t){return[t.deltaX,t.deltaY]},fN=function(t){return t&&"current"in t?t.current:t},Rq=function(t,e){return t[0]===e[0]&&t[1]===e[1]},Nq=function(t){return` + .block-interactivity-`.concat(t,` {pointer-events: none;} + .allow-interactivity-`).concat(t,` {pointer-events: all;} +`)},Oq=0,iu=[];function Iq(t){var e=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),i=_.useState(Oq++)[0],o=_.useState(JU)[0],a=_.useRef(t);_.useEffect(function(){a.current=t},[t]),_.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var v=eq([t.lockRef.current],(t.shards||[]).map(fN),!0).filter(Boolean);return v.forEach(function(g){return g.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),v.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var s=_.useCallback(function(v,g){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!a.current.allowPinchZoom;var m=_g(v),x=n.current,b="deltaX"in v?v.deltaX:x[0]-m[0],S="deltaY"in v?v.deltaY:x[1]-m[1],w,E=v.target,T=Math.abs(b)>Math.abs(S)?"h":"v";if("touches"in v&&T==="h"&&E.type==="range")return!1;var A=uN(T,E);if(!A)return!0;if(A?w=T:(w=T==="v"?"h":"v",A=uN(T,E)),!A)return!1;if(!r.current&&"changedTouches"in v&&(b||S)&&(r.current=w),!w)return!0;var M=r.current||w;return Pq(M,g,v,M==="h"?b:S)},[]),l=_.useCallback(function(v){var g=v;if(!(!iu.length||iu[iu.length-1]!==o)){var m="deltaY"in g?dN(g):_g(g),x=e.current.filter(function(w){return w.name===g.type&&(w.target===g.target||g.target===w.shadowParent)&&Rq(w.delta,m)})[0];if(x&&x.should){g.cancelable&&g.preventDefault();return}if(!x){var b=(a.current.shards||[]).map(fN).filter(Boolean).filter(function(w){return w.contains(g.target)}),S=b.length>0?s(g,b[0]):!a.current.noIsolation;S&&g.cancelable&&g.preventDefault()}}},[]),c=_.useCallback(function(v,g,m,x){var b={name:v,delta:g,target:m,should:x,shadowParent:Dq(m)};e.current.push(b),setTimeout(function(){e.current=e.current.filter(function(S){return S!==b})},1)},[]),u=_.useCallback(function(v){n.current=_g(v),r.current=void 0},[]),d=_.useCallback(function(v){c(v.type,dN(v),v.target,s(v,t.lockRef.current))},[]),f=_.useCallback(function(v){c(v.type,_g(v),v.target,s(v,t.lockRef.current))},[]);_.useEffect(function(){return iu.push(o),t.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,ru),document.addEventListener("touchmove",l,ru),document.addEventListener("touchstart",u,ru),function(){iu=iu.filter(function(v){return v!==o}),document.removeEventListener("wheel",l,ru),document.removeEventListener("touchmove",l,ru),document.removeEventListener("touchstart",u,ru)}},[]);var p=t.removeScrollBar,y=t.inert;return _.createElement(_.Fragment,null,y?_.createElement(o,{styles:Nq(i)}):null,p?_.createElement(wq,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function Dq(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const Lq=cq(YU,Iq);var Tm=_.forwardRef(function(t,e){return _.createElement(ax,ra({},t,{ref:e,sideCar:Lq}))});Tm.classNames=ax.classNames;var kq=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},ou=new WeakMap,wg=new WeakMap,Sg={},j_=0,tF=function(t){return t&&(t.host||tF(t.parentNode))},jq=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=tF(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},Uq=function(t,e,n,r){var i=jq(e,Array.isArray(t)?t:[t]);Sg[n]||(Sg[n]=new WeakMap);var o=Sg[n],a=[],s=new Set,l=new Set(i),c=function(d){!d||s.has(d)||(s.add(d),c(d.parentNode))};i.forEach(c);var u=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(f){if(s.has(f))u(f);else try{var p=f.getAttribute(r),y=p!==null&&p!=="false",v=(ou.get(f)||0)+1,g=(o.get(f)||0)+1;ou.set(f,v),o.set(f,g),a.push(f),v===1&&y&&wg.set(f,!0),g===1&&f.setAttribute(n,"true"),y||f.setAttribute(r,"true")}catch(m){console.error("aria-hidden: cannot operate on ",f,m)}})};return u(e),s.clear(),j_++,function(){a.forEach(function(d){var f=ou.get(d)-1,p=o.get(d)-1;ou.set(d,f),o.set(d,p),f||(wg.has(d)||d.removeAttribute(r),wg.delete(d)),p||d.removeAttribute(n)}),j_--,j_||(ou=new WeakMap,ou=new WeakMap,wg=new WeakMap,Sg={})}},sx=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),i=kq(t);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),Uq(r,i,n,"aria-hidden")):function(){return null}},lx="Dialog",[nF,rF]=mi(lx),[Fq,Go]=nF(lx),iF=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:a=!0}=t,s=_.useRef(null),l=_.useRef(null),[c,u]=$o({prop:r,defaultProp:i??!1,onChange:o,caller:lx});return h.jsx(Fq,{scope:e,triggerRef:s,contentRef:l,contentId:sr(),titleId:sr(),descriptionId:sr(),open:c,onOpenChange:u,onOpenToggle:_.useCallback(()=>u(d=>!d),[u]),modal:a,children:n})};iF.displayName=lx;var oF="DialogTrigger",aF=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Go(oF,n),o=Ot(e,i.triggerRef);return h.jsx(nt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":sA(i.open),...r,ref:o,onClick:Oe(t.onClick,i.onOpenToggle)})});aF.displayName=oF;var oA="DialogPortal",[Bq,sF]=nF(oA,{forceMount:void 0}),lF=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:i}=t,o=Go(oA,e);return h.jsx(Bq,{scope:e,forceMount:n,children:_.Children.map(r,a=>h.jsx(gi,{present:n||o.open,children:h.jsx(vf,{asChild:!0,container:i,children:a})}))})};lF.displayName=oA;var yy="DialogOverlay",cF=_.forwardRef((t,e)=>{const n=sF(yy,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,o=Go(yy,t.__scopeDialog);return o.modal?h.jsx(gi,{present:r||o.open,children:h.jsx(zq,{...i,ref:e})}):null});cF.displayName=yy;var $q=al("DialogOverlay.RemoveScroll"),zq=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Go(yy,n);return h.jsx(Tm,{as:$q,allowPinchZoom:!0,shards:[i.contentRef],children:h.jsx(nt.div,{"data-state":sA(i.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),Mc="DialogContent",uF=_.forwardRef((t,e)=>{const n=sF(Mc,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,o=Go(Mc,t.__scopeDialog);return h.jsx(gi,{present:r||o.open,children:o.modal?h.jsx(Hq,{...i,ref:e}):h.jsx(Vq,{...i,ref:e})})});uF.displayName=Mc;var Hq=_.forwardRef((t,e)=>{const n=Go(Mc,t.__scopeDialog),r=_.useRef(null),i=Ot(e,n.contentRef,r);return _.useEffect(()=>{const o=r.current;if(o)return sx(o)},[]),h.jsx(dF,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Oe(t.onCloseAutoFocus,o=>{var a;o.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Oe(t.onPointerDownOutside,o=>{const a=o.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&o.preventDefault()}),onFocusOutside:Oe(t.onFocusOutside,o=>o.preventDefault())})}),Vq=_.forwardRef((t,e)=>{const n=Go(Mc,t.__scopeDialog),r=_.useRef(!1),i=_.useRef(!1);return h.jsx(dF,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var a,s;(a=t.onCloseAutoFocus)==null||a.call(t,o),o.defaultPrevented||(r.current||(s=n.triggerRef.current)==null||s.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var l,c;(l=t.onInteractOutside)==null||l.call(t,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=o.target;((c=n.triggerRef.current)==null?void 0:c.contains(a))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),dF=_.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...a}=t,s=Go(Mc,n),l=_.useRef(null),c=Ot(e,l);return ox(),h.jsxs(h.Fragment,{children:[h.jsx(Em,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:h.jsx(zc,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":sA(s.open),...a,ref:c,onDismiss:()=>s.onOpenChange(!1)})}),h.jsxs(h.Fragment,{children:[h.jsx(Wq,{titleId:s.titleId}),h.jsx(qq,{contentRef:l,descriptionId:s.descriptionId})]})]})}),aA="DialogTitle",fF=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Go(aA,n);return h.jsx(nt.h2,{id:i.titleId,...r,ref:e})});fF.displayName=aA;var hF="DialogDescription",pF=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Go(hF,n);return h.jsx(nt.p,{id:i.descriptionId,...r,ref:e})});pF.displayName=hF;var mF="DialogClose",gF=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Go(mF,n);return h.jsx(nt.button,{type:"button",...r,ref:e,onClick:Oe(t.onClick,()=>i.onOpenChange(!1))})});gF.displayName=mF;function sA(t){return t?"open":"closed"}var vF="DialogTitleWarning",[Gq,yF]=X9(vF,{contentName:Mc,titleName:aA,docsSlug:"dialog"}),Wq=({titleId:t})=>{const e=yF(vF),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users. + +If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component. + +For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return _.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},Xq="DialogDescriptionWarning",qq=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${yF(Xq).contentName}}.`;return _.useEffect(()=>{var o;const i=(o=t.current)==null?void 0:o.getAttribute("aria-describedby");e&&i&&(document.getElementById(e)||console.warn(r))},[r,t,e]),null},lA=iF,Kq=aF,cA=lF,cx=cF,ux=uF,uA=fF,dA=pF,fA=gF;const Hc=lA,Yq=cA,xF=_.forwardRef(({className:t,...e},n)=>h.jsx(cx,{ref:n,className:He("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e}));xF.displayName=cx.displayName;const xl=_.forwardRef(({className:t,children:e,hideClose:n,...r},i)=>h.jsxs(Yq,{children:[h.jsx(xF,{}),h.jsxs(ux,{ref:i,className:He("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...r,children:[e,!n&&h.jsxs(fA,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[h.jsx(ix,{className:"h-4 w-4"}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));xl.displayName=ux.displayName;const bl=({className:t,...e})=>h.jsx("div",{className:He("flex flex-col space-y-1.5 text-center sm:text-left",t),...e});bl.displayName="DialogHeader";const bF=({className:t,...e})=>h.jsx("div",{className:He("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});bF.displayName="DialogFooter";const _l=_.forwardRef(({className:t,...e},n)=>h.jsx(uA,{ref:n,className:He("text-lg font-semibold leading-none tracking-tight",t),...e}));_l.displayName=uA.displayName;const wl=_.forwardRef(({className:t,...e},n)=>h.jsx(dA,{ref:n,className:He("text-sm text-muted-foreground",t),...e}));wl.displayName=dA.displayName;const Jq=({open:t,onOpenChange:e})=>{const{auth:n,refetch:r}=xf(),[i,o]=_.useState(!1),[a,s]=_.useState(!1);if(n.status!=="unauthenticated")return null;const l=async()=>{try{await navigator.clipboard.writeText(n.loginCommand),o(!0),setTimeout(()=>o(!1),1500)}catch(u){console.warn("Clipboard write failed:",u)}},c=async()=>{s(!0);try{await r()}finally{s(!1)}};return h.jsx(Hc,{open:t,onOpenChange:e,children:h.jsxs(xl,{className:"bg-gray-900 border-gray-800 text-white",children:[h.jsxs(bl,{children:[h.jsx(_l,{className:"text-amber-200",children:"Hugging Face CLI not configured"}),h.jsx(wl,{className:"text-gray-400",children:"Uploads, training, and replay-from-Hub require a logged-in HF CLI. Run this in a terminal:"})]}),h.jsxs("pre",{className:"bg-gray-950 p-3 rounded border border-gray-700 text-xs sm:text-sm overflow-x-auto flex items-center justify-between gap-2",children:[h.jsx("code",{className:"text-green-400",children:n.loginCommand}),h.jsx("button",{type:"button",onClick:l,className:"flex-shrink-0 text-gray-400 hover:text-gray-200 transition-colors","aria-label":"Copy command",children:i?h.jsx(yl,{className:"w-4 h-4 text-green-400"}):h.jsx(QM,{className:"w-4 h-4"})})]}),h.jsxs(et,{variant:"outline",size:"sm",onClick:c,disabled:a,className:"border-amber-700 bg-transparent text-amber-100 hover:bg-amber-900/40 hover:text-amber-50",children:[h.jsx(OU,{className:`w-4 h-4 mr-2 ${a?"animate-spin":""}`}),"I've logged in โ€” recheck"]})]})})},Zq=()=>{const{auth:t}=xf(),[e,n]=_.useState(!1);return t.status==="loading"?h.jsxs("div",{className:"inline-flex items-center gap-2 rounded-full border border-gray-800 bg-gray-900/60 px-3 py-1 text-xs text-gray-400",children:[h.jsx(fi,{className:"w-3 h-3 animate-spin"}),h.jsx("span",{children:"Checking HFโ€ฆ"})]}):t.status==="authenticated"?h.jsxs("div",{className:"inline-flex items-center gap-2 rounded-full border border-gray-800 bg-gray-900/60 px-3 py-1 text-xs text-gray-200",title:"Hugging Face authenticated",children:[h.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-400","aria-hidden":"true"}),h.jsx("span",{children:t.username})]}):h.jsxs(h.Fragment,{children:[h.jsxs("button",{type:"button",onClick:()=>n(!0),className:"inline-flex items-center gap-2 rounded-full border border-amber-700/60 bg-amber-950/40 px-3 py-1 text-xs text-amber-100 hover:bg-amber-900/40 transition-colors","aria-label":"Hugging Face not configured โ€” show login instructions",children:[h.jsx("span",{className:"h-2 w-2 rounded-full bg-amber-400","aria-hidden":"true"}),h.jsx("span",{children:"HF not configured"})]}),h.jsx(Jq,{open:e,onOpenChange:n})]})},Qq=()=>h.jsx("header",{className:"sticky top-0 z-30 w-full border-b border-gray-800 bg-black/95 backdrop-blur supports-[backdrop-filter]:bg-black/70",children:h.jsxs("div",{className:"mx-auto flex h-12 max-w-7xl items-center justify-between px-4",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("img",{src:"/lovable-uploads/5e648747-34b7-4d8f-93fd-4dbd00aeeefc.png",alt:"LeLab",className:"h-7 w-7"}),h.jsx("span",{className:"text-base font-semibold tracking-tight text-white",children:"LeLab"})]}),h.jsx(Zq,{})]})}),eK=({className:t})=>h.jsx("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",className:t,children:h.jsx("path",{d:"M20.317 4.369A19.79 19.79 0 0 0 16.558 3.2a.07.07 0 0 0-.074.035c-.211.375-.444.864-.608 1.249a18.27 18.27 0 0 0-5.487 0 12.51 12.51 0 0 0-.617-1.249.077.077 0 0 0-.074-.035 19.736 19.736 0 0 0-3.76 1.169.07.07 0 0 0-.032.027C2.533 8.046 1.79 11.624 2.155 15.157a.082.082 0 0 0 .031.056 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.027c.462-.63.873-1.295 1.226-1.994a.076.076 0 0 0-.041-.105 13.13 13.13 0 0 1-1.873-.892.077.077 0 0 1-.008-.128c.126-.094.252-.192.372-.291a.074.074 0 0 1 .077-.01c3.927 1.793 8.18 1.793 12.061 0a.074.074 0 0 1 .078.009c.12.099.246.198.373.292a.077.077 0 0 1-.006.128 12.32 12.32 0 0 1-1.873.891.077.077 0 0 0-.04.106c.36.698.772 1.363 1.225 1.993a.076.076 0 0 0 .084.028 19.84 19.84 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-4.087-.838-7.636-3.548-10.787a.061.061 0 0 0-.031-.028zM8.02 12.997c-1.182 0-2.156-1.085-2.156-2.419 0-1.333.955-2.419 2.156-2.419 1.21 0 2.175 1.095 2.156 2.42 0 1.333-.955 2.418-2.156 2.418zm7.974 0c-1.182 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.175 1.095 2.156 2.42 0 1.333-.946 2.418-2.156 2.418z"})}),tK=[{href:"https://github.com/huggingface/lerobot",label:"GitHub",Icon:K7},{href:"https://huggingface.co/docs/lerobot",label:"Documentation",Icon:B7},{href:"https://discord.com/invite/s3KuuzsPFb",label:"Discord",Icon:eK}],nK=()=>h.jsx("footer",{className:"fixed inset-x-0 bottom-0 z-30 border-t border-gray-800 bg-black/95",children:h.jsxs("div",{className:"mx-auto flex max-w-7xl flex-col items-center justify-between gap-3 px-4 py-4 text-sm text-gray-400 sm:flex-row",children:[h.jsxs("span",{children:["Powered by"," ",h.jsx("a",{href:"https://github.com/huggingface/lerobot",target:"_blank",rel:"noopener noreferrer",className:"font-medium text-gray-200 hover:text-white",children:"LeRobot"})]}),h.jsx("nav",{className:"flex items-center gap-4",children:tK.map(({href:t,label:e,Icon:n})=>h.jsxs("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 text-gray-400 hover:text-white",children:[h.jsx(n,{className:"h-4 w-4"}),h.jsx("span",{children:e})]},e))})]})}),rK=["top","right","bottom","left"],cl=Math.min,Ti=Math.max,xy=Math.round,Eg=Math.floor,fa=t=>({x:t,y:t}),iK={left:"right",right:"left",bottom:"top",top:"bottom"},oK={start:"end",end:"start"};function pE(t,e,n){return Ti(t,cl(e,n))}function ns(t,e){return typeof t=="function"?t(e):t}function rs(t){return t.split("-")[0]}function bf(t){return t.split("-")[1]}function hA(t){return t==="x"?"y":"x"}function pA(t){return t==="y"?"height":"width"}function oa(t){return["top","bottom"].includes(rs(t))?"y":"x"}function mA(t){return hA(oa(t))}function aK(t,e,n){n===void 0&&(n=!1);const r=bf(t),i=mA(t),o=pA(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(a=by(a)),[a,by(a)]}function sK(t){const e=by(t);return[mE(t),e,mE(e)]}function mE(t){return t.replace(/start|end/g,e=>oK[e])}function lK(t,e,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],a=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:r:e?r:i;case"left":case"right":return e?o:a;default:return[]}}function cK(t,e,n,r){const i=bf(t);let o=lK(rs(t),n==="start",r);return i&&(o=o.map(a=>a+"-"+i),e&&(o=o.concat(o.map(mE)))),o}function by(t){return t.replace(/left|right|bottom|top/g,e=>iK[e])}function uK(t){return{top:0,right:0,bottom:0,left:0,...t}}function _F(t){return typeof t!="number"?uK(t):{top:t,right:t,bottom:t,left:t}}function _y(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function hN(t,e,n){let{reference:r,floating:i}=t;const o=oa(e),a=mA(e),s=pA(a),l=rs(e),c=o==="y",u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2;let p;switch(l){case"top":p={x:u,y:r.y-i.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(bf(e)){case"start":p[a]-=f*(n&&c?-1:1);break;case"end":p[a]+=f*(n&&c?-1:1);break}return p}const dK=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=o.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(e));let c=await a.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:d}=hN(c,r,l),f=r,p={},y=0;for(let v=0;v({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:o,platform:a,elements:s,middlewareData:l}=e,{element:c,padding:u=0}=ns(t,e)||{};if(c==null)return{};const d=_F(u),f={x:n,y:r},p=mA(i),y=pA(p),v=await a.getDimensions(c),g=p==="y",m=g?"top":"left",x=g?"bottom":"right",b=g?"clientHeight":"clientWidth",S=o.reference[y]+o.reference[p]-f[p]-o.floating[y],w=f[p]-o.reference[p],E=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c));let T=E?E[b]:0;(!T||!await(a.isElement==null?void 0:a.isElement(E)))&&(T=s.floating[b]||o.floating[y]);const A=S/2-w/2,M=T/2-v[y]/2-1,C=cl(d[m],M),P=cl(d[x],M),R=C,D=T-v[y]-P,k=T/2-v[y]/2+A,U=pE(R,k,D),O=!l.arrow&&bf(i)!=null&&k!==U&&o.reference[y]/2-(kk<=0)){var P,R;const k=(((P=o.flip)==null?void 0:P.index)||0)+1,U=T[k];if(U&&(!(d==="alignment"?x!==oa(U):!1)||C.every(L=>L.overflows[0]>0&&oa(L.placement)===x)))return{data:{index:k,overflows:C},reset:{placement:U}};let O=(R=C.filter(W=>W.overflows[0]<=0).sort((W,L)=>W.overflows[1]-L.overflows[1])[0])==null?void 0:R.placement;if(!O)switch(p){case"bestFit":{var D;const W=(D=C.filter(L=>{if(E){const j=oa(L.placement);return j===x||j==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(j=>j>0).reduce((j,X)=>j+X,0)]).sort((L,j)=>L[1]-j[1])[0])==null?void 0:D[0];W&&(O=W);break}case"initialPlacement":O=s;break}if(i!==O)return{reset:{placement:O}}}return{}}}};function pN(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function mN(t){return rK.some(e=>t[e]>=0)}const pK=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...i}=ns(t,e);switch(r){case"referenceHidden":{const o=await bp(e,{...i,elementContext:"reference"}),a=pN(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:mN(a)}}}case"escaped":{const o=await bp(e,{...i,altBoundary:!0}),a=pN(o,n.floating);return{data:{escapedOffsets:a,escaped:mN(a)}}}default:return{}}}}};async function mK(t,e){const{placement:n,platform:r,elements:i}=t,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=rs(n),s=bf(n),l=oa(n)==="y",c=["left","top"].includes(a)?-1:1,u=o&&l?-1:1,d=ns(e,t);let{mainAxis:f,crossAxis:p,alignmentAxis:y}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof y=="number"&&(p=s==="end"?y*-1:y),l?{x:p*u,y:f*c}:{x:f*c,y:p*u}}const gK=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:o,placement:a,middlewareData:s}=e,l=await mK(e,t);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:a}}}}},vK=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:g=>{let{x:m,y:x}=g;return{x:m,y:x}}},...l}=ns(t,e),c={x:n,y:r},u=await bp(e,l),d=oa(rs(i)),f=hA(d);let p=c[f],y=c[d];if(o){const g=f==="y"?"top":"left",m=f==="y"?"bottom":"right",x=p+u[g],b=p-u[m];p=pE(x,p,b)}if(a){const g=d==="y"?"top":"left",m=d==="y"?"bottom":"right",x=y+u[g],b=y-u[m];y=pE(x,y,b)}const v=s.fn({...e,[f]:p,[d]:y});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[f]:o,[d]:a}}}}}},yK=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=e,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=ns(t,e),u={x:n,y:r},d=oa(i),f=hA(d);let p=u[f],y=u[d];const v=ns(s,e),g=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(l){const b=f==="y"?"height":"width",S=o.reference[f]-o.floating[b]+g.mainAxis,w=o.reference[f]+o.reference[b]-g.mainAxis;pw&&(p=w)}if(c){var m,x;const b=f==="y"?"width":"height",S=["top","left"].includes(rs(i)),w=o.reference[d]-o.floating[b]+(S&&((m=a.offset)==null?void 0:m[d])||0)+(S?0:g.crossAxis),E=o.reference[d]+o.reference[b]+(S?0:((x=a.offset)==null?void 0:x[d])||0)-(S?g.crossAxis:0);yE&&(y=E)}return{[f]:p,[d]:y}}}},xK=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:o,platform:a,elements:s}=e,{apply:l=()=>{},...c}=ns(t,e),u=await bp(e,c),d=rs(i),f=bf(i),p=oa(i)==="y",{width:y,height:v}=o.floating;let g,m;d==="top"||d==="bottom"?(g=d,m=f===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(m=d,g=f==="end"?"top":"bottom");const x=v-u.top-u.bottom,b=y-u.left-u.right,S=cl(v-u[g],x),w=cl(y-u[m],b),E=!e.middlewareData.shift;let T=S,A=w;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(A=b),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(T=x),E&&!f){const C=Ti(u.left,0),P=Ti(u.right,0),R=Ti(u.top,0),D=Ti(u.bottom,0);p?A=y-2*(C!==0||P!==0?C+P:Ti(u.left,u.right)):T=v-2*(R!==0||D!==0?R+D:Ti(u.top,u.bottom))}await l({...e,availableWidth:A,availableHeight:T});const M=await a.getDimensions(s.floating);return y!==M.width||v!==M.height?{reset:{rects:!0}}:{}}}};function dx(){return typeof window<"u"}function _f(t){return wF(t)?(t.nodeName||"").toLowerCase():"#document"}function Ni(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function ba(t){var e;return(e=(wF(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function wF(t){return dx()?t instanceof Node||t instanceof Ni(t).Node:!1}function zo(t){return dx()?t instanceof Element||t instanceof Ni(t).Element:!1}function ga(t){return dx()?t instanceof HTMLElement||t instanceof Ni(t).HTMLElement:!1}function gN(t){return!dx()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Ni(t).ShadowRoot}function Mm(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=Ho(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function bK(t){return["table","td","th"].includes(_f(t))}function fx(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function gA(t){const e=vA(),n=zo(t)?Ho(t):t;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function _K(t){let e=ul(t);for(;ga(e)&&!Id(e);){if(gA(e))return e;if(fx(e))return null;e=ul(e)}return null}function vA(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Id(t){return["html","body","#document"].includes(_f(t))}function Ho(t){return Ni(t).getComputedStyle(t)}function hx(t){return zo(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ul(t){if(_f(t)==="html")return t;const e=t.assignedSlot||t.parentNode||gN(t)&&t.host||ba(t);return gN(e)?e.host:e}function SF(t){const e=ul(t);return Id(e)?t.ownerDocument?t.ownerDocument.body:t.body:ga(e)&&Mm(e)?e:SF(e)}function _p(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=SF(t),o=i===((r=t.ownerDocument)==null?void 0:r.body),a=Ni(i);if(o){const s=gE(a);return e.concat(a,a.visualViewport||[],Mm(i)?i:[],s&&n?_p(s):[])}return e.concat(i,_p(i,[],n))}function gE(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function EF(t){const e=Ho(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=ga(t),o=i?t.offsetWidth:n,a=i?t.offsetHeight:r,s=xy(n)!==o||xy(r)!==a;return s&&(n=o,r=a),{width:n,height:r,$:s}}function yA(t){return zo(t)?t:t.contextElement}function od(t){const e=yA(t);if(!ga(e))return fa(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:o}=EF(e);let a=(o?xy(n.width):n.width)/r,s=(o?xy(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const wK=fa(0);function TF(t){const e=Ni(t);return!vA()||!e.visualViewport?wK:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function SK(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Ni(t)?!1:e}function Ac(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),o=yA(t);let a=fa(1);e&&(r?zo(r)&&(a=od(r)):a=od(t));const s=SK(o,n,r)?TF(o):fa(0);let l=(i.left+s.x)/a.x,c=(i.top+s.y)/a.y,u=i.width/a.x,d=i.height/a.y;if(o){const f=Ni(o),p=r&&zo(r)?Ni(r):r;let y=f,v=gE(y);for(;v&&r&&p!==y;){const g=od(v),m=v.getBoundingClientRect(),x=Ho(v),b=m.left+(v.clientLeft+parseFloat(x.paddingLeft))*g.x,S=m.top+(v.clientTop+parseFloat(x.paddingTop))*g.y;l*=g.x,c*=g.y,u*=g.x,d*=g.y,l+=b,c+=S,y=Ni(v),v=gE(y)}}return _y({width:u,height:d,x:l,y:c})}function xA(t,e){const n=hx(t).scrollLeft;return e?e.left+n:Ac(ba(t)).left+n}function MF(t,e,n){n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=r.left+e.scrollLeft-(n?0:xA(t,r)),o=r.top+e.scrollTop;return{x:i,y:o}}function EK(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const o=i==="fixed",a=ba(r),s=e?fx(e.floating):!1;if(r===a||s&&o)return n;let l={scrollLeft:0,scrollTop:0},c=fa(1);const u=fa(0),d=ga(r);if((d||!d&&!o)&&((_f(r)!=="body"||Mm(a))&&(l=hx(r)),ga(r))){const p=Ac(r);c=od(r),u.x=p.x+r.clientLeft,u.y=p.y+r.clientTop}const f=a&&!d&&!o?MF(a,l,!0):fa(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}}function TK(t){return Array.from(t.getClientRects())}function MK(t){const e=ba(t),n=hx(t),r=t.ownerDocument.body,i=Ti(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=Ti(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+xA(t);const s=-n.scrollTop;return Ho(r).direction==="rtl"&&(a+=Ti(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:s}}function AK(t,e){const n=Ni(t),r=ba(t),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;const c=vA();(!c||c&&e==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s,y:l}}function CK(t,e){const n=Ac(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,o=ga(t)?od(t):fa(1),a=t.clientWidth*o.x,s=t.clientHeight*o.y,l=i*o.x,c=r*o.y;return{width:a,height:s,x:l,y:c}}function vN(t,e,n){let r;if(e==="viewport")r=AK(t,n);else if(e==="document")r=MK(ba(t));else if(zo(e))r=CK(e,n);else{const i=TF(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return _y(r)}function AF(t,e){const n=ul(t);return n===e||!zo(n)||Id(n)?!1:Ho(n).position==="fixed"||AF(n,e)}function PK(t,e){const n=e.get(t);if(n)return n;let r=_p(t,[],!1).filter(s=>zo(s)&&_f(s)!=="body"),i=null;const o=Ho(t).position==="fixed";let a=o?ul(t):t;for(;zo(a)&&!Id(a);){const s=Ho(a),l=gA(a);!l&&s.position==="fixed"&&(i=null),(o?!l&&!i:!l&&s.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Mm(a)&&!l&&AF(t,a))?r=r.filter(u=>u!==a):i=s,a=ul(a)}return e.set(t,r),r}function RK(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const a=[...n==="clippingAncestors"?fx(e)?[]:PK(e,this._c):[].concat(n),r],s=a[0],l=a.reduce((c,u)=>{const d=vN(e,u,i);return c.top=Ti(d.top,c.top),c.right=cl(d.right,c.right),c.bottom=cl(d.bottom,c.bottom),c.left=Ti(d.left,c.left),c},vN(e,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function NK(t){const{width:e,height:n}=EF(t);return{width:e,height:n}}function OK(t,e,n){const r=ga(e),i=ba(e),o=n==="fixed",a=Ac(t,!0,o,e);let s={scrollLeft:0,scrollTop:0};const l=fa(0);function c(){l.x=xA(i)}if(r||!r&&!o)if((_f(e)!=="body"||Mm(i))&&(s=hx(e)),r){const p=Ac(e,!0,o,e);l.x=p.x+e.clientLeft,l.y=p.y+e.clientTop}else i&&c();o&&!r&&i&&c();const u=i&&!r&&!o?MF(i,s):fa(0),d=a.left+s.scrollLeft-l.x-u.x,f=a.top+s.scrollTop-l.y-u.y;return{x:d,y:f,width:a.width,height:a.height}}function U_(t){return Ho(t).position==="static"}function yN(t,e){if(!ga(t)||Ho(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return ba(t)===n&&(n=n.ownerDocument.body),n}function CF(t,e){const n=Ni(t);if(fx(t))return n;if(!ga(t)){let i=ul(t);for(;i&&!Id(i);){if(zo(i)&&!U_(i))return i;i=ul(i)}return n}let r=yN(t,e);for(;r&&bK(r)&&U_(r);)r=yN(r,e);return r&&Id(r)&&U_(r)&&!gA(r)?n:r||_K(t)||n}const IK=async function(t){const e=this.getOffsetParent||CF,n=this.getDimensions,r=await n(t.floating);return{reference:OK(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function DK(t){return Ho(t).direction==="rtl"}const LK={convertOffsetParentRelativeRectToViewportRelativeRect:EK,getDocumentElement:ba,getClippingRect:RK,getOffsetParent:CF,getElementRects:IK,getClientRects:TK,getDimensions:NK,getScale:od,isElement:zo,isRTL:DK};function PF(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function kK(t,e){let n=null,r;const i=ba(t);function o(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function a(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),o();const c=t.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=c;if(s||e(),!f||!p)return;const y=Eg(d),v=Eg(i.clientWidth-(u+f)),g=Eg(i.clientHeight-(d+p)),m=Eg(u),b={rootMargin:-y+"px "+-v+"px "+-g+"px "+-m+"px",threshold:Ti(0,cl(1,l))||1};let S=!0;function w(E){const T=E[0].intersectionRatio;if(T!==l){if(!S)return a();T?a(!1,T):r=setTimeout(()=>{a(!1,1e-7)},1e3)}T===1&&!PF(c,t.getBoundingClientRect())&&a(),S=!1}try{n=new IntersectionObserver(w,{...b,root:i.ownerDocument})}catch{n=new IntersectionObserver(w,b)}n.observe(t)}return a(!0),o}function jK(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=yA(t),u=i||o?[...c?_p(c):[],..._p(e)]:[];u.forEach(m=>{i&&m.addEventListener("scroll",n,{passive:!0}),o&&m.addEventListener("resize",n)});const d=c&&s?kK(c,n):null;let f=-1,p=null;a&&(p=new ResizeObserver(m=>{let[x]=m;x&&x.target===c&&p&&(p.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var b;(b=p)==null||b.observe(e)})),n()}),c&&!l&&p.observe(c),p.observe(e));let y,v=l?Ac(t):null;l&&g();function g(){const m=Ac(t);v&&!PF(v,m)&&n(),v=m,y=requestAnimationFrame(g)}return n(),()=>{var m;u.forEach(x=>{i&&x.removeEventListener("scroll",n),o&&x.removeEventListener("resize",n)}),d==null||d(),(m=p)==null||m.disconnect(),p=null,l&&cancelAnimationFrame(y)}}const UK=gK,FK=vK,BK=hK,$K=xK,zK=pK,xN=fK,HK=yK,VK=(t,e,n)=>{const r=new Map,i={platform:LK,...n},o={...i.platform,_c:r};return dK(t,e,{...i,platform:o})};var GK=typeof document<"u",WK=function(){},kv=GK?_.useLayoutEffect:WK;function wy(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!wy(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&t.$$typeof)&&!wy(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function RF(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function bN(t,e){const n=RF(t);return Math.round(e*n)/n}function F_(t){const e=_.useRef(t);return kv(()=>{e.current=t}),e}function XK(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:a}={},transform:s=!0,whileElementsMounted:l,open:c}=t,[u,d]=_.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[f,p]=_.useState(r);wy(f,r)||p(r);const[y,v]=_.useState(null),[g,m]=_.useState(null),x=_.useCallback(L=>{L!==E.current&&(E.current=L,v(L))},[]),b=_.useCallback(L=>{L!==T.current&&(T.current=L,m(L))},[]),S=o||y,w=a||g,E=_.useRef(null),T=_.useRef(null),A=_.useRef(u),M=l!=null,C=F_(l),P=F_(i),R=F_(c),D=_.useCallback(()=>{if(!E.current||!T.current)return;const L={placement:e,strategy:n,middleware:f};P.current&&(L.platform=P.current),VK(E.current,T.current,L).then(j=>{const X={...j,isPositioned:R.current!==!1};k.current&&!wy(A.current,X)&&(A.current=X,Bc.flushSync(()=>{d(X)}))})},[f,e,n,P,R]);kv(()=>{c===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,d(L=>({...L,isPositioned:!1})))},[c]);const k=_.useRef(!1);kv(()=>(k.current=!0,()=>{k.current=!1}),[]),kv(()=>{if(S&&(E.current=S),w&&(T.current=w),S&&w){if(C.current)return C.current(S,w,D);D()}},[S,w,D,C,M]);const U=_.useMemo(()=>({reference:E,floating:T,setReference:x,setFloating:b}),[x,b]),O=_.useMemo(()=>({reference:S,floating:w}),[S,w]),W=_.useMemo(()=>{const L={position:n,left:0,top:0};if(!O.floating)return L;const j=bN(O.floating,u.x),X=bN(O.floating,u.y);return s?{...L,transform:"translate("+j+"px, "+X+"px)",...RF(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:j,top:X}},[n,s,O.floating,u.x,u.y]);return _.useMemo(()=>({...u,update:D,refs:U,elements:O,floatingStyles:W}),[u,D,U,O,W])}const qK=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:i}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?xN({element:r.current,padding:i}).fn(n):{}:r?xN({element:r,padding:i}).fn(n):{}}}},KK=(t,e)=>({...UK(t),options:[t,e]}),YK=(t,e)=>({...FK(t),options:[t,e]}),JK=(t,e)=>({...HK(t),options:[t,e]}),ZK=(t,e)=>({...BK(t),options:[t,e]}),QK=(t,e)=>({...$K(t),options:[t,e]}),eY=(t,e)=>({...zK(t),options:[t,e]}),tY=(t,e)=>({...qK(t),options:[t,e]});var nY="Arrow",NF=_.forwardRef((t,e)=>{const{children:n,width:r=10,height:i=5,...o}=t;return h.jsx(nt.svg,{...o,ref:e,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:h.jsx("polygon",{points:"0,0 30,0 15,10"})})});NF.displayName=nY;var rY=NF;function bA(t){const[e,n]=_.useState(void 0);return ur(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,s;if("borderBoxSize"in o){const l=o.borderBoxSize,c=Array.isArray(l)?l[0]:l;a=c.inlineSize,s=c.blockSize}else a=t.offsetWidth,s=t.offsetHeight;n({width:a,height:s})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var _A="Popper",[OF,Sl]=mi(_A),[iY,IF]=OF(_A),DF=t=>{const{__scopePopper:e,children:n}=t,[r,i]=_.useState(null);return h.jsx(iY,{scope:e,anchor:r,onAnchorChange:i,children:n})};DF.displayName=_A;var LF="PopperAnchor",kF=_.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...i}=t,o=IF(LF,n),a=_.useRef(null),s=Ot(e,a);return _.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:h.jsx(nt.div,{...i,ref:s})});kF.displayName=LF;var wA="PopperContent",[oY,aY]=OF(wA),jF=_.forwardRef((t,e)=>{var ee,ce,ae,fe,we,le;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:a=0,arrowPadding:s=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:y,...v}=t,g=IF(wA,n),[m,x]=_.useState(null),b=Ot(e,ie=>x(ie)),[S,w]=_.useState(null),E=bA(S),T=(E==null?void 0:E.width)??0,A=(E==null?void 0:E.height)??0,M=r+(o!=="center"?"-"+o:""),C=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},P=Array.isArray(c)?c:[c],R=P.length>0,D={padding:C,boundary:P.filter(lY),altBoundary:R},{refs:k,floatingStyles:U,placement:O,isPositioned:W,middlewareData:L}=XK({strategy:"fixed",placement:M,whileElementsMounted:(...ie)=>jK(...ie,{animationFrame:p==="always"}),elements:{reference:g.anchor},middleware:[KK({mainAxis:i+A,alignmentAxis:a}),l&&YK({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?JK():void 0,...D}),l&&ZK({...D}),QK({...D,apply:({elements:ie,rects:G,availableWidth:Ve,availableHeight:Ne})=>{const{width:st,height:Re}=G.reference,ct=ie.floating.style;ct.setProperty("--radix-popper-available-width",`${Ve}px`),ct.setProperty("--radix-popper-available-height",`${Ne}px`),ct.setProperty("--radix-popper-anchor-width",`${st}px`),ct.setProperty("--radix-popper-anchor-height",`${Re}px`)}}),S&&tY({element:S,padding:s}),cY({arrowWidth:T,arrowHeight:A}),f&&eY({strategy:"referenceHidden",...D})]}),[j,X]=BF(O),K=di(y);ur(()=>{W&&(K==null||K())},[W,K]);const F=(ee=L.arrow)==null?void 0:ee.x,Y=(ce=L.arrow)==null?void 0:ce.y,q=((ae=L.arrow)==null?void 0:ae.centerOffset)!==0,[Q,te]=_.useState();return ur(()=>{m&&te(window.getComputedStyle(m).zIndex)},[m]),h.jsx("div",{ref:k.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:W?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Q,"--radix-popper-transform-origin":[(fe=L.transformOrigin)==null?void 0:fe.x,(we=L.transformOrigin)==null?void 0:we.y].join(" "),...((le=L.hide)==null?void 0:le.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:h.jsx(oY,{scope:n,placedSide:j,onArrowChange:w,arrowX:F,arrowY:Y,shouldHideArrow:q,children:h.jsx(nt.div,{"data-side":j,"data-align":X,...v,ref:b,style:{...v.style,animation:W?void 0:"none"}})})})});jF.displayName=wA;var UF="PopperArrow",sY={top:"bottom",right:"left",bottom:"top",left:"right"},FF=_.forwardRef(function(e,n){const{__scopePopper:r,...i}=e,o=aY(UF,r),a=sY[o.placedSide];return h.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:h.jsx(rY,{...i,ref:n,style:{...i.style,display:"block"}})})});FF.displayName=UF;function lY(t){return t!==null}var cY=t=>({name:"transformOrigin",options:t,fn(e){var g,m,x;const{placement:n,rects:r,middlewareData:i}=e,a=((g=i.arrow)==null?void 0:g.centerOffset)!==0,s=a?0:t.arrowWidth,l=a?0:t.arrowHeight,[c,u]=BF(n),d={start:"0%",center:"50%",end:"100%"}[u],f=(((m=i.arrow)==null?void 0:m.x)??0)+s/2,p=(((x=i.arrow)==null?void 0:x.y)??0)+l/2;let y="",v="";return c==="bottom"?(y=a?d:`${f}px`,v=`${-l}px`):c==="top"?(y=a?d:`${f}px`,v=`${r.floating.height+l}px`):c==="right"?(y=`${-l}px`,v=a?d:`${p}px`):c==="left"&&(y=`${r.floating.width+l}px`,v=a?d:`${p}px`),{data:{x:y,y:v}}}});function BF(t){const[e,n="center"]=t.split("-");return[e,n]}var px=DF,Am=kF,mx=jF,gx=FF,[vx,pDe]=mi("Tooltip",[Sl]),yx=Sl(),$F="TooltipProvider",uY=700,vE="tooltip.open",[dY,SA]=vx($F),zF=t=>{const{__scopeTooltip:e,delayDuration:n=uY,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=t,a=_.useRef(!0),s=_.useRef(!1),l=_.useRef(0);return _.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),h.jsx(dY,{scope:e,isOpenDelayedRef:a,delayDuration:n,onOpen:_.useCallback(()=>{window.clearTimeout(l.current),a.current=!1},[]),onClose:_.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:_.useCallback(c=>{s.current=c},[]),disableHoverableContent:i,children:o})};zF.displayName=$F;var wp="Tooltip",[fY,xx]=vx(wp),HF=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:i,onOpenChange:o,disableHoverableContent:a,delayDuration:s}=t,l=SA(wp,t.__scopeTooltip),c=yx(e),[u,d]=_.useState(null),f=sr(),p=_.useRef(0),y=a??l.disableHoverableContent,v=s??l.delayDuration,g=_.useRef(!1),[m,x]=$o({prop:r,defaultProp:i??!1,onChange:T=>{T?(l.onOpen(),document.dispatchEvent(new CustomEvent(vE))):l.onClose(),o==null||o(T)},caller:wp}),b=_.useMemo(()=>m?g.current?"delayed-open":"instant-open":"closed",[m]),S=_.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,x(!0)},[x]),w=_.useCallback(()=>{window.clearTimeout(p.current),p.current=0,x(!1)},[x]),E=_.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,x(!0),p.current=0},v)},[v,x]);return _.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),h.jsx(px,{...c,children:h.jsx(fY,{scope:e,contentId:f,open:m,stateAttribute:b,trigger:u,onTriggerChange:d,onTriggerEnter:_.useCallback(()=>{l.isOpenDelayedRef.current?E():S()},[l.isOpenDelayedRef,E,S]),onTriggerLeave:_.useCallback(()=>{y?w():(window.clearTimeout(p.current),p.current=0)},[w,y]),onOpen:S,onClose:w,disableHoverableContent:y,children:n})})};HF.displayName=wp;var yE="TooltipTrigger",VF=_.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=xx(yE,n),o=SA(yE,n),a=yx(n),s=_.useRef(null),l=Ot(e,s,i.onTriggerChange),c=_.useRef(!1),u=_.useRef(!1),d=_.useCallback(()=>c.current=!1,[]);return _.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),h.jsx(Am,{asChild:!0,...a,children:h.jsx(nt.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:l,onPointerMove:Oe(t.onPointerMove,f=>{f.pointerType!=="touch"&&!u.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),u.current=!0)}),onPointerLeave:Oe(t.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:Oe(t.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Oe(t.onFocus,()=>{c.current||i.onOpen()}),onBlur:Oe(t.onBlur,i.onClose),onClick:Oe(t.onClick,i.onClose)})})});VF.displayName=yE;var hY="TooltipPortal",[mDe,pY]=vx(hY,{forceMount:void 0}),Dd="TooltipContent",GF=_.forwardRef((t,e)=>{const n=pY(Dd,t.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=t,a=xx(Dd,t.__scopeTooltip);return h.jsx(gi,{present:r||a.open,children:a.disableHoverableContent?h.jsx(WF,{side:i,...o,ref:e}):h.jsx(mY,{side:i,...o,ref:e})})}),mY=_.forwardRef((t,e)=>{const n=xx(Dd,t.__scopeTooltip),r=SA(Dd,t.__scopeTooltip),i=_.useRef(null),o=Ot(e,i),[a,s]=_.useState(null),{trigger:l,onClose:c}=n,u=i.current,{onPointerInTransitChange:d}=r,f=_.useCallback(()=>{s(null),d(!1)},[d]),p=_.useCallback((y,v)=>{const g=y.currentTarget,m={x:y.clientX,y:y.clientY},x=bY(m,g.getBoundingClientRect()),b=_Y(m,x),S=wY(v.getBoundingClientRect()),w=EY([...b,...S]);s(w),d(!0)},[d]);return _.useEffect(()=>()=>f(),[f]),_.useEffect(()=>{if(l&&u){const y=g=>p(g,u),v=g=>p(g,l);return l.addEventListener("pointerleave",y),u.addEventListener("pointerleave",v),()=>{l.removeEventListener("pointerleave",y),u.removeEventListener("pointerleave",v)}}},[l,u,p,f]),_.useEffect(()=>{if(a){const y=v=>{const g=v.target,m={x:v.clientX,y:v.clientY},x=(l==null?void 0:l.contains(g))||(u==null?void 0:u.contains(g)),b=!SY(m,a);x?f():b&&(f(),c())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[l,u,a,c,f]),h.jsx(WF,{...t,ref:o})}),[gY,vY]=vx(wp,{isInside:!1}),yY=aU("TooltipContent"),WF=_.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:a,...s}=t,l=xx(Dd,n),c=yx(n),{onClose:u}=l;return _.useEffect(()=>(document.addEventListener(vE,u),()=>document.removeEventListener(vE,u)),[u]),_.useEffect(()=>{if(l.trigger){const d=f=>{const p=f.target;p!=null&&p.contains(l.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,u]),h.jsx(zc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:h.jsxs(mx,{"data-state":l.stateAttribute,...c,...s,ref:e,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[h.jsx(yY,{children:r}),h.jsx(gY,{scope:n,isInside:!0,children:h.jsx(y7,{id:l.contentId,role:"tooltip",children:i||r})})]})})});GF.displayName=Dd;var XF="TooltipArrow",xY=_.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=yx(n);return vY(XF,n).isInside?null:h.jsx(gx,{...i,...r,ref:e})});xY.displayName=XF;function bY(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),i=Math.abs(e.right-t.x),o=Math.abs(e.left-t.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function _Y(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function wY(t){const{top:e,right:n,bottom:r,left:i}=t;return[{x:i,y:e},{x:n,y:e},{x:n,y:r},{x:i,y:r}]}function SY(t,e){const{x:n,y:r}=t;let i=!1;for(let o=0,a=e.length-1;or!=f>r&&n<(d-c)*(r-u)/(f-u)+c&&(i=!i)}return i}function EY(t){const e=t.slice();return e.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),TY(e)}function TY(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r=2;){const o=e[e.length-1],a=e[e.length-2];if((o.x-a.x)*(i.y-a.y)>=(o.y-a.y)*(i.x-a.x))e.pop();else break}e.push(i)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const i=t[r];for(;n.length>=2;){const o=n[n.length-1],a=n[n.length-2];if((o.x-a.x)*(i.y-a.y)>=(o.y-a.y)*(i.x-a.x))n.pop();else break}n.push(i)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var MY=HF,AY=VF,qF=GF;const jv=MY,Uv=AY,Vh=_.forwardRef(({className:t,sideOffset:e=4,...n},r)=>h.jsx(qF,{ref:r,sideOffset:e,className:He("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n}));Vh.displayName=qF.displayName;var bx="Popover",[KF,gDe]=mi(bx,[Sl]),Cm=Sl(),[CY,El]=KF(bx),YF=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:a=!1}=t,s=Cm(e),l=_.useRef(null),[c,u]=_.useState(!1),[d,f]=$o({prop:r,defaultProp:i??!1,onChange:o,caller:bx});return h.jsx(px,{...s,children:h.jsx(CY,{scope:e,contentId:sr(),triggerRef:l,open:d,onOpenChange:f,onOpenToggle:_.useCallback(()=>f(p=>!p),[f]),hasCustomAnchor:c,onCustomAnchorAdd:_.useCallback(()=>u(!0),[]),onCustomAnchorRemove:_.useCallback(()=>u(!1),[]),modal:a,children:n})})};YF.displayName=bx;var JF="PopoverAnchor",PY=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=El(JF,n),o=Cm(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:s}=i;return _.useEffect(()=>(a(),()=>s()),[a,s]),h.jsx(Am,{...o,...r,ref:e})});PY.displayName=JF;var ZF="PopoverTrigger",QF=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=El(ZF,n),o=Cm(n),a=Ot(e,i.triggerRef),s=h.jsx(nt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":iB(i.open),...r,ref:a,onClick:Oe(t.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:h.jsx(Am,{asChild:!0,...o,children:s})});QF.displayName=ZF;var EA="PopoverPortal",[RY,NY]=KF(EA,{forceMount:void 0}),eB=t=>{const{__scopePopover:e,forceMount:n,children:r,container:i}=t,o=El(EA,e);return h.jsx(RY,{scope:e,forceMount:n,children:h.jsx(gi,{present:n||o.open,children:h.jsx(vf,{asChild:!0,container:i,children:r})})})};eB.displayName=EA;var Ld="PopoverContent",tB=_.forwardRef((t,e)=>{const n=NY(Ld,t.__scopePopover),{forceMount:r=n.forceMount,...i}=t,o=El(Ld,t.__scopePopover);return h.jsx(gi,{present:r||o.open,children:o.modal?h.jsx(IY,{...i,ref:e}):h.jsx(DY,{...i,ref:e})})});tB.displayName=Ld;var OY=al("PopoverContent.RemoveScroll"),IY=_.forwardRef((t,e)=>{const n=El(Ld,t.__scopePopover),r=_.useRef(null),i=Ot(e,r),o=_.useRef(!1);return _.useEffect(()=>{const a=r.current;if(a)return sx(a)},[]),h.jsx(Tm,{as:OY,allowPinchZoom:!0,children:h.jsx(nB,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Oe(t.onCloseAutoFocus,a=>{var s;a.preventDefault(),o.current||(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:Oe(t.onPointerDownOutside,a=>{const s=a.detail.originalEvent,l=s.button===0&&s.ctrlKey===!0,c=s.button===2||l;o.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:Oe(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),DY=_.forwardRef((t,e)=>{const n=El(Ld,t.__scopePopover),r=_.useRef(!1),i=_.useRef(!1);return h.jsx(nB,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var a,s;(a=t.onCloseAutoFocus)==null||a.call(t,o),o.defaultPrevented||(r.current||(s=n.triggerRef.current)==null||s.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var l,c;(l=t.onInteractOutside)==null||l.call(t,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=o.target;((c=n.triggerRef.current)==null?void 0:c.contains(a))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),nB=_.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...d}=t,f=El(Ld,n),p=Cm(n);return ox(),h.jsx(Em,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:h.jsx(zc,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>f.onOpenChange(!1),children:h.jsx(mx,{"data-state":iB(f.open),role:"dialog",id:f.contentId,...p,...d,ref:e,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),rB="PopoverClose",LY=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=El(rB,n);return h.jsx(nt.button,{type:"button",...r,ref:e,onClick:Oe(t.onClick,()=>i.onOpenChange(!1))})});LY.displayName=rB;var kY="PopoverArrow",jY=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Cm(n);return h.jsx(gx,{...i,...r,ref:e})});jY.displayName=kY;function iB(t){return t?"open":"closed"}var UY=YF,FY=QF,BY=eB,oB=tB;const _x=UY,wx=FY,Pm=_.forwardRef(({className:t,align:e="center",sideOffset:n=4,...r},i)=>h.jsx(BY,{children:h.jsx(oB,{ref:i,align:e,sideOffset:n,className:He("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r})}));Pm.displayName=oB.displayName;var _N=1,$Y=.9,zY=.8,HY=.17,B_=.1,$_=.999,VY=.9999,GY=.99,WY=/[\\\/_+.#"@\[\(\{&]/,XY=/[\\\/_+.#"@\[\(\{&]/g,qY=/[\s-]/,aB=/[\s-]/g;function xE(t,e,n,r,i,o,a){if(o===e.length)return i===t.length?_N:GY;var s=`${i},${o}`;if(a[s]!==void 0)return a[s];for(var l=r.charAt(o),c=n.indexOf(l,i),u=0,d,f,p,y;c>=0;)d=xE(t,e,n,r,c+1,o+1,a),d>u&&(c===i?d*=_N:WY.test(t.charAt(c-1))?(d*=zY,p=t.slice(i,c-1).match(XY),p&&i>0&&(d*=Math.pow($_,p.length))):qY.test(t.charAt(c-1))?(d*=$Y,y=t.slice(i,c-1).match(aB),y&&i>0&&(d*=Math.pow($_,y.length))):(d*=HY,i>0&&(d*=Math.pow($_,c-i))),t.charAt(c)!==e.charAt(o)&&(d*=VY)),(dd&&(d=f*B_)),d>u&&(u=d),c=n.indexOf(l,c+1);return a[s]=u,u}function wN(t){return t.toLowerCase().replace(aB," ")}function KY(t,e,n){return t=n&&n.length>0?`${t+" "+n.join(" ")}`:t,xE(t,e,wN(t),wN(e),0,0,{})}var eh='[cmdk-group=""]',z_='[cmdk-group-items=""]',YY='[cmdk-group-heading=""]',sB='[cmdk-item=""]',SN=`${sB}:not([aria-disabled="true"])`,bE="cmdk-item-select",Mu="data-value",JY=(t,e,n)=>KY(t,e,n),lB=_.createContext(void 0),Rm=()=>_.useContext(lB),cB=_.createContext(void 0),TA=()=>_.useContext(cB),uB=_.createContext(void 0),dB=_.forwardRef((t,e)=>{let n=Au(()=>{var F,Y;return{search:"",value:(Y=(F=t.value)!=null?F:t.defaultValue)!=null?Y:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Au(()=>new Set),i=Au(()=>new Map),o=Au(()=>new Map),a=Au(()=>new Set),s=fB(t),{label:l,children:c,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:y,disablePointerSelection:v=!1,vimBindings:g=!0,...m}=t,x=sr(),b=sr(),S=sr(),w=_.useRef(null),E=lJ();Cc(()=>{if(u!==void 0){let F=u.trim();n.current.value=F,T.emit()}},[u]),Cc(()=>{E(6,D)},[]);let T=_.useMemo(()=>({subscribe:F=>(a.current.add(F),()=>a.current.delete(F)),snapshot:()=>n.current,setState:(F,Y,q)=>{var Q,te,ee,ce;if(!Object.is(n.current[F],Y)){if(n.current[F]=Y,F==="search")R(),C(),E(1,P);else if(F==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ae=document.getElementById(S);ae?ae.focus():(Q=document.getElementById(x))==null||Q.focus()}if(E(7,()=>{var ae;n.current.selectedItemId=(ae=k())==null?void 0:ae.id,T.emit()}),q||E(5,D),((te=s.current)==null?void 0:te.value)!==void 0){let ae=Y??"";(ce=(ee=s.current).onValueChange)==null||ce.call(ee,ae);return}}T.emit()}},emit:()=>{a.current.forEach(F=>F())}}),[]),A=_.useMemo(()=>({value:(F,Y,q)=>{var Q;Y!==((Q=o.current.get(F))==null?void 0:Q.value)&&(o.current.set(F,{value:Y,keywords:q}),n.current.filtered.items.set(F,M(Y,q)),E(2,()=>{C(),T.emit()}))},item:(F,Y)=>(r.current.add(F),Y&&(i.current.has(Y)?i.current.get(Y).add(F):i.current.set(Y,new Set([F]))),E(3,()=>{R(),C(),n.current.value||P(),T.emit()}),()=>{o.current.delete(F),r.current.delete(F),n.current.filtered.items.delete(F);let q=k();E(4,()=>{R(),(q==null?void 0:q.getAttribute("id"))===F&&P(),T.emit()})}),group:F=>(i.current.has(F)||i.current.set(F,new Set),()=>{o.current.delete(F),i.current.delete(F)}),filter:()=>s.current.shouldFilter,label:l||t["aria-label"],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:x,inputId:S,labelId:b,listInnerRef:w}),[]);function M(F,Y){var q,Q;let te=(Q=(q=s.current)==null?void 0:q.filter)!=null?Q:JY;return F?te(F,n.current.search,Y):0}function C(){if(!n.current.search||s.current.shouldFilter===!1)return;let F=n.current.filtered.items,Y=[];n.current.filtered.groups.forEach(Q=>{let te=i.current.get(Q),ee=0;te.forEach(ce=>{let ae=F.get(ce);ee=Math.max(ae,ee)}),Y.push([Q,ee])});let q=w.current;U().sort((Q,te)=>{var ee,ce;let ae=Q.getAttribute("id"),fe=te.getAttribute("id");return((ee=F.get(fe))!=null?ee:0)-((ce=F.get(ae))!=null?ce:0)}).forEach(Q=>{let te=Q.closest(z_);te?te.appendChild(Q.parentElement===te?Q:Q.closest(`${z_} > *`)):q.appendChild(Q.parentElement===q?Q:Q.closest(`${z_} > *`))}),Y.sort((Q,te)=>te[1]-Q[1]).forEach(Q=>{var te;let ee=(te=w.current)==null?void 0:te.querySelector(`${eh}[${Mu}="${encodeURIComponent(Q[0])}"]`);ee==null||ee.parentElement.appendChild(ee)})}function P(){let F=U().find(q=>q.getAttribute("aria-disabled")!=="true"),Y=F==null?void 0:F.getAttribute(Mu);T.setState("value",Y||void 0)}function R(){var F,Y,q,Q;if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let te=0;for(let ee of r.current){let ce=(Y=(F=o.current.get(ee))==null?void 0:F.value)!=null?Y:"",ae=(Q=(q=o.current.get(ee))==null?void 0:q.keywords)!=null?Q:[],fe=M(ce,ae);n.current.filtered.items.set(ee,fe),fe>0&&te++}for(let[ee,ce]of i.current)for(let ae of ce)if(n.current.filtered.items.get(ae)>0){n.current.filtered.groups.add(ee);break}n.current.filtered.count=te}function D(){var F,Y,q;let Q=k();Q&&(((F=Q.parentElement)==null?void 0:F.firstChild)===Q&&((q=(Y=Q.closest(eh))==null?void 0:Y.querySelector(YY))==null||q.scrollIntoView({block:"nearest"})),Q.scrollIntoView({block:"nearest"}))}function k(){var F;return(F=w.current)==null?void 0:F.querySelector(`${sB}[aria-selected="true"]`)}function U(){var F;return Array.from(((F=w.current)==null?void 0:F.querySelectorAll(SN))||[])}function O(F){let Y=U()[F];Y&&T.setState("value",Y.getAttribute(Mu))}function W(F){var Y;let q=k(),Q=U(),te=Q.findIndex(ce=>ce===q),ee=Q[te+F];(Y=s.current)!=null&&Y.loop&&(ee=te+F<0?Q[Q.length-1]:te+F===Q.length?Q[0]:Q[te+F]),ee&&T.setState("value",ee.getAttribute(Mu))}function L(F){let Y=k(),q=Y==null?void 0:Y.closest(eh),Q;for(;q&&!Q;)q=F>0?aJ(q,eh):sJ(q,eh),Q=q==null?void 0:q.querySelector(SN);Q?T.setState("value",Q.getAttribute(Mu)):W(F)}let j=()=>O(U().length-1),X=F=>{F.preventDefault(),F.metaKey?j():F.altKey?L(1):W(1)},K=F=>{F.preventDefault(),F.metaKey?O(0):F.altKey?L(-1):W(-1)};return _.createElement(nt.div,{ref:e,tabIndex:-1,...m,"cmdk-root":"",onKeyDown:F=>{var Y;(Y=m.onKeyDown)==null||Y.call(m,F);let q=F.nativeEvent.isComposing||F.keyCode===229;if(!(F.defaultPrevented||q))switch(F.key){case"n":case"j":{g&&F.ctrlKey&&X(F);break}case"ArrowDown":{X(F);break}case"p":case"k":{g&&F.ctrlKey&&K(F);break}case"ArrowUp":{K(F);break}case"Home":{F.preventDefault(),O(0);break}case"End":{F.preventDefault(),j();break}case"Enter":{F.preventDefault();let Q=k();if(Q){let te=new Event(bE);Q.dispatchEvent(te)}}}}},_.createElement("label",{"cmdk-label":"",htmlFor:A.inputId,id:A.labelId,style:uJ},l),Sx(t,F=>_.createElement(cB.Provider,{value:T},_.createElement(lB.Provider,{value:A},F))))}),ZY=_.forwardRef((t,e)=>{var n,r;let i=sr(),o=_.useRef(null),a=_.useContext(uB),s=Rm(),l=fB(t),c=(r=(n=l.current)==null?void 0:n.forceMount)!=null?r:a==null?void 0:a.forceMount;Cc(()=>{if(!c)return s.item(i,a==null?void 0:a.id)},[c]);let u=hB(i,o,[t.value,t.children,o],t.keywords),d=TA(),f=dl(E=>E.value&&E.value===u.current),p=dl(E=>c||s.filter()===!1?!0:E.search?E.filtered.items.get(i)>0:!0);_.useEffect(()=>{let E=o.current;if(!(!E||t.disabled))return E.addEventListener(bE,y),()=>E.removeEventListener(bE,y)},[p,t.onSelect,t.disabled]);function y(){var E,T;v(),(T=(E=l.current).onSelect)==null||T.call(E,u.current)}function v(){d.setState("value",u.current,!0)}if(!p)return null;let{disabled:g,value:m,onSelect:x,forceMount:b,keywords:S,...w}=t;return _.createElement(nt.div,{ref:ts(o,e),...w,id:i,"cmdk-item":"",role:"option","aria-disabled":!!g,"aria-selected":!!f,"data-disabled":!!g,"data-selected":!!f,onPointerMove:g||s.getDisablePointerSelection()?void 0:v,onClick:g?void 0:y},t.children)}),QY=_.forwardRef((t,e)=>{let{heading:n,children:r,forceMount:i,...o}=t,a=sr(),s=_.useRef(null),l=_.useRef(null),c=sr(),u=Rm(),d=dl(p=>i||u.filter()===!1?!0:p.search?p.filtered.groups.has(a):!0);Cc(()=>u.group(a),[]),hB(a,s,[t.value,t.heading,l]);let f=_.useMemo(()=>({id:a,forceMount:i}),[i]);return _.createElement(nt.div,{ref:ts(s,e),...o,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},n&&_.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:c},n),Sx(t,p=>_.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?c:void 0},_.createElement(uB.Provider,{value:f},p))))}),eJ=_.forwardRef((t,e)=>{let{alwaysRender:n,...r}=t,i=_.useRef(null),o=dl(a=>!a.search);return!n&&!o?null:_.createElement(nt.div,{ref:ts(i,e),...r,"cmdk-separator":"",role:"separator"})}),tJ=_.forwardRef((t,e)=>{let{onValueChange:n,...r}=t,i=t.value!=null,o=TA(),a=dl(c=>c.search),s=dl(c=>c.selectedItemId),l=Rm();return _.useEffect(()=>{t.value!=null&&o.setState("search",t.value)},[t.value]),_.createElement(nt.input,{ref:e,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":s,id:l.inputId,type:"text",value:i?t.value:a,onChange:c=>{i||o.setState("search",c.target.value),n==null||n(c.target.value)}})}),nJ=_.forwardRef((t,e)=>{let{children:n,label:r="Suggestions",...i}=t,o=_.useRef(null),a=_.useRef(null),s=dl(c=>c.selectedItemId),l=Rm();return _.useEffect(()=>{if(a.current&&o.current){let c=a.current,u=o.current,d,f=new ResizeObserver(()=>{d=requestAnimationFrame(()=>{let p=c.offsetHeight;u.style.setProperty("--cmdk-list-height",p.toFixed(1)+"px")})});return f.observe(c),()=>{cancelAnimationFrame(d),f.unobserve(c)}}},[]),_.createElement(nt.div,{ref:ts(o,e),...i,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:l.listId},Sx(t,c=>_.createElement("div",{ref:ts(a,l.listInnerRef),"cmdk-list-sizer":""},c)))}),rJ=_.forwardRef((t,e)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:o,container:a,...s}=t;return _.createElement(lA,{open:n,onOpenChange:r},_.createElement(cA,{container:a},_.createElement(cx,{"cmdk-overlay":"",className:i}),_.createElement(ux,{"aria-label":t.label,"cmdk-dialog":"",className:o},_.createElement(dB,{ref:e,...s}))))}),iJ=_.forwardRef((t,e)=>dl(n=>n.filtered.count===0)?_.createElement(nt.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),oJ=_.forwardRef((t,e)=>{let{progress:n,children:r,label:i="Loading...",...o}=t;return _.createElement(nt.div,{ref:e,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},Sx(t,a=>_.createElement("div",{"aria-hidden":!0},a)))}),vi=Object.assign(dB,{List:nJ,Item:ZY,Input:tJ,Group:QY,Separator:eJ,Dialog:rJ,Empty:iJ,Loading:oJ});function aJ(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function sJ(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function fB(t){let e=_.useRef(t);return Cc(()=>{e.current=t}),e}var Cc=typeof window>"u"?_.useEffect:_.useLayoutEffect;function Au(t){let e=_.useRef();return e.current===void 0&&(e.current=t()),e}function dl(t){let e=TA(),n=()=>t(e.snapshot());return _.useSyncExternalStore(e.subscribe,n,n)}function hB(t,e,n,r=[]){let i=_.useRef(),o=Rm();return Cc(()=>{var a;let s=(()=>{var c;for(let u of n){if(typeof u=="string")return u.trim();if(typeof u=="object"&&"current"in u)return u.current?(c=u.current.textContent)==null?void 0:c.trim():i.current}})(),l=r.map(c=>c.trim());o.value(t,s,l),(a=e.current)==null||a.setAttribute(Mu,s),i.current=s}),i}var lJ=()=>{let[t,e]=_.useState(),n=Au(()=>new Map);return Cc(()=>{n.current.forEach(r=>r()),n.current=new Map},[t]),(r,i)=>{n.current.set(r,i),e({})}};function cJ(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function Sx({asChild:t,children:e},n){return t&&_.isValidElement(e)?_.cloneElement(cJ(e),{ref:e.ref},n(e.props.children)):n(e)}var uJ={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Ex=_.forwardRef(({className:t,...e},n)=>h.jsx(vi,{ref:n,className:He("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...e}));Ex.displayName=vi.displayName;const Tx=_.forwardRef(({className:t,...e},n)=>h.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[h.jsx(tA,{className:"mr-2 h-4 w-4 shrink-0 text-slate-400"}),h.jsx(vi.Input,{ref:n,className:He("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",t),...e})]}));Tx.displayName=vi.Input.displayName;const Mx=_.forwardRef(({className:t,...e},n)=>h.jsx(vi.List,{ref:n,className:He("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...e}));Mx.displayName=vi.List.displayName;const Ax=_.forwardRef((t,e)=>h.jsx(vi.Empty,{ref:e,className:"py-6 text-center text-sm",...t}));Ax.displayName=vi.Empty.displayName;const Ys=_.forwardRef(({className:t,...e},n)=>h.jsx(vi.Group,{ref:n,className:He("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",t),...e}));Ys.displayName=vi.Group.displayName;const dJ=_.forwardRef(({className:t,...e},n)=>h.jsx(vi.Separator,{ref:n,className:He("-mx-1 h-px bg-border",t),...e}));dJ.displayName=vi.Separator.displayName;const kd=_.forwardRef(({className:t,...e},n)=>h.jsx(vi.Item,{ref:n,className:He("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",t),...e}));kd.displayName=vi.Item.displayName;const fJ=({selectedName:t,availableNames:e,onSelect:n,onCreateNew:r,isLoading:i})=>{const[o,a]=_.useState(!1),[s,l]=_.useState(""),c=s.trim(),u=e.some(m=>m.toLowerCase()===c.toLowerCase()),d=c.length>0&&!u,f=!d,p=u?"Already exists":c===""?"Create new robotโ€ฆ":`Create "${c}"`,y=()=>{l(""),a(!1)},v=m=>{n(m),y()},g=async()=>{if(!d)return;await r(c)&&y()};return h.jsxs(_x,{open:o,onOpenChange:a,children:[h.jsx(wx,{asChild:!0,children:h.jsxs(et,{variant:"outline",role:"combobox","aria-expanded":o,disabled:i,className:"w-full justify-between bg-gray-900 border-gray-700 text-white hover:bg-gray-700 hover:text-white font-normal",children:[h.jsx("span",{className:He("truncate",t?"":"text-gray-400"),children:i?"Loading...":t??"Select a robot or type a new name"}),h.jsx(JM,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),h.jsx(Pm,{className:"p-0 bg-gray-800 border-gray-700 text-white",style:{width:"var(--radix-popover-trigger-width)"},align:"start",children:h.jsxs(Ex,{className:"bg-gray-800",children:[h.jsx(Tx,{placeholder:"Search or type new name...",value:s,onValueChange:l,onKeyDown:m=>{m.key==="Enter"&&d&&(m.preventDefault(),g())},className:"text-white"}),h.jsxs(Mx,{children:[e.length===0&&h.jsx(Ax,{className:"py-4 text-sm text-gray-400 text-center",children:"No robots yet. Type a name to create one."}),e.length>0&&h.jsx(Ys,{heading:"Existing",children:e.map(m=>h.jsxs(kd,{value:m,onSelect:()=>v(m),className:"text-white aria-selected:bg-gray-700",children:[h.jsx(yl,{className:He("mr-2 h-4 w-4",t===m?"opacity-100":"opacity-0")}),m]},m))})]}),h.jsxs("button",{type:"button",onClick:g,disabled:f,className:"flex w-full items-center gap-2 border-t border-gray-700 px-3 py-2 text-sm text-white hover:bg-gray-700 disabled:cursor-not-allowed disabled:text-gray-500 disabled:hover:bg-transparent",children:[h.jsx(eA,{className:"h-4 w-4"}),p]})]})})]})},hJ=({robot:t,selectedName:e,availableNames:n,isLoading:r,onSelect:i,onCreateNew:o,onConfigure:a,onTeleop:s,onDelete:l})=>{const[c,u]=_.useState(!1),d=t?t.is_clean?"Ready":"Needs configuration":null,f=!t||!t.is_clean;return h.jsxs("div",{className:"bg-gray-800 rounded-lg border border-gray-700 p-3 flex flex-col gap-2 relative",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("div",{className:"flex-1 min-w-0",children:h.jsx(fJ,{selectedName:e,availableNames:n,onSelect:i,onCreateNew:o,isLoading:r})}),d&&h.jsx("p",{className:`text-xs truncate shrink-0 ${t.is_clean?"text-green-400":"text-amber-400"}`,children:d}),t&&h.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[h.jsxs(jv,{children:[h.jsx(Uv,{asChild:!0,children:h.jsx(et,{size:"icon",variant:"ghost",className:"h-8 w-8 text-gray-300 hover:text-white",onClick:()=>a(t.name),"aria-label":"Configure",children:h.jsx(Mh,{className:"w-4 h-4"})})}),h.jsx(Vh,{children:"Configure (calibrate)"})]}),h.jsxs(jv,{children:[h.jsx(Uv,{asChild:!0,children:h.jsx(et,{size:"icon",variant:"ghost",className:"h-8 w-8 text-red-400 hover:text-red-300 hover:bg-red-900/20",onClick:()=>u(!0),"aria-label":"Delete robot",children:h.jsx(nA,{className:"w-4 h-4"})})}),h.jsx(Vh,{children:"Delete robot config"})]})]})]}),t&&h.jsxs(jv,{children:[h.jsx(Uv,{asChild:!0,children:h.jsx("div",{className:"w-full",children:h.jsx(et,{onClick:()=>s(t),disabled:f,className:`w-full ${f?"bg-red-500/30 hover:bg-red-500/30 text-red-200 cursor-not-allowed":"bg-yellow-500 hover:bg-yellow-600 text-white"}`,children:"Teleoperation"})})}),f&&h.jsx(Vh,{children:"Configure the robot first."})]}),t&&h.jsx(Hc,{open:c,onOpenChange:u,children:h.jsxs(xl,{className:"bg-gray-900 border-gray-800 text-white",children:[h.jsxs(bl,{children:[h.jsx(_l,{children:"Delete robot config?"}),h.jsx(wl,{className:"text-gray-400",children:"This deletes the robot config file from disk. Calibration files are not removed. This cannot be undone."})]}),h.jsxs(bF,{className:"flex gap-2 justify-end",children:[h.jsx(et,{variant:"outline",className:"border-gray-600 text-gray-300",onClick:()=>u(!1),children:"Cancel"}),h.jsx(et,{className:"bg-red-500 hover:bg-red-600 text-white",onClick:async()=>{u(!1),await l(t.name)},children:"Delete"})]})]})})]})},pJ=({selectedName:t,selectedRecord:e,availableNames:n,isLoading:r,selectRobot:i,createRobot:o,deleteRobot:a})=>{const s=ji(),{baseUrl:l,fetchWithHeaders:c}=Ln(),{toast:u}=Dr(),d=p=>{s("/calibration",{state:{robot_name:p}})},f=async p=>{try{const y=await c(`${l}/move-arm`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({leader_port:p.leader_port,follower_port:p.follower_port,leader_config:p.leader_config,follower_config:p.follower_config})}),v=await y.json();y.ok?(u({title:"Teleoperation Started",description:v.message||`Started teleoperation for ${p.name}.`}),s("/teleoperation")):u({title:"Error Starting Teleoperation",description:v.message||"Failed to start.",variant:"destructive"})}catch{u({title:"Connection Error",description:"Could not connect to the backend server.",variant:"destructive"})}};return h.jsx(hJ,{robot:e,selectedName:t,availableNames:n,isLoading:r,onSelect:i,onCreateNew:o,onConfigure:d,onTeleop:f,onDelete:a})},hi=_.forwardRef(({className:t,type:e,...n},r)=>h.jsx("input",{type:e,className:He("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:r,...n}));hi.displayName="Input";const mr=_.forwardRef(({value:t,onChange:e,integer:n=!0,className:r,...i},o)=>{const[a,s]=_.useState(t==null?"":String(t)),l=_.useRef(t);return _.useEffect(()=>{t!==l.current&&(l.current=t,s(t==null?"":String(t)))},[t]),h.jsx(hi,{ref:o,type:"number",inputMode:n?"numeric":"decimal",value:a,onChange:c=>{const u=c.target.value;if(s(u),u===""){e(void 0);return}const d=n?parseInt(u,10):parseFloat(u);Number.isFinite(d)&&e(d)},className:He("[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:m-0 [&::-webkit-outer-spin-button]:m-0",r),...i})});mr.displayName="NumberInput";var mJ="Label",pB=_.forwardRef((t,e)=>h.jsx(nt.label,{...t,ref:e,onMouseDown:n=>{var i;n.target.closest("button, input, select, textarea")||((i=t.onMouseDown)==null||i.call(t,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));pB.displayName=mJ;var mB=pB;const gJ=Sm("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Nt=_.forwardRef(({className:t,...e},n)=>h.jsx(mB,{ref:n,className:He(gJ(),t),...e}));Nt.displayName=mB.displayName;function MA(t){const e=_.useRef({value:t,previous:t});return _.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var Cx="Checkbox",[vJ,vDe]=mi(Cx),[yJ,AA]=vJ(Cx);function xJ(t){const{__scopeCheckbox:e,checked:n,children:r,defaultChecked:i,disabled:o,form:a,name:s,onCheckedChange:l,required:c,value:u="on",internal_do_not_use_render:d}=t,[f,p]=$o({prop:n,defaultProp:i??!1,onChange:l,caller:Cx}),[y,v]=_.useState(null),[g,m]=_.useState(null),x=_.useRef(!1),b=y?!!a||!!y.closest("form"):!0,S={checked:f,disabled:o,setChecked:p,control:y,setControl:v,name:s,form:a,value:u,hasConsumerStoppedPropagationRef:x,required:c,defaultChecked:Js(i)?!1:i,isFormControl:b,bubbleInput:g,setBubbleInput:m};return h.jsx(yJ,{scope:e,...S,children:bJ(d)?d(S):r})}var gB="CheckboxTrigger",vB=_.forwardRef(({__scopeCheckbox:t,onKeyDown:e,onClick:n,...r},i)=>{const{control:o,value:a,disabled:s,checked:l,required:c,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,isFormControl:p,bubbleInput:y}=AA(gB,t),v=Ot(i,u),g=_.useRef(l);return _.useEffect(()=>{const m=o==null?void 0:o.form;if(m){const x=()=>d(g.current);return m.addEventListener("reset",x),()=>m.removeEventListener("reset",x)}},[o,d]),h.jsx(nt.button,{type:"button",role:"checkbox","aria-checked":Js(l)?"mixed":l,"aria-required":c,"data-state":wB(l),"data-disabled":s?"":void 0,disabled:s,value:a,...r,ref:v,onKeyDown:Oe(e,m=>{m.key==="Enter"&&m.preventDefault()}),onClick:Oe(n,m=>{d(x=>Js(x)?!0:!x),y&&p&&(f.current=m.isPropagationStopped(),f.current||m.stopPropagation())})})});vB.displayName=gB;var CA=_.forwardRef((t,e)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:o,required:a,disabled:s,value:l,onCheckedChange:c,form:u,...d}=t;return h.jsx(xJ,{__scopeCheckbox:n,checked:i,defaultChecked:o,disabled:s,required:a,onCheckedChange:c,name:r,form:u,value:l,internal_do_not_use_render:({isFormControl:f})=>h.jsxs(h.Fragment,{children:[h.jsx(vB,{...d,ref:e,__scopeCheckbox:n}),f&&h.jsx(_B,{__scopeCheckbox:n})]})})});CA.displayName=Cx;var yB="CheckboxIndicator",xB=_.forwardRef((t,e)=>{const{__scopeCheckbox:n,forceMount:r,...i}=t,o=AA(yB,n);return h.jsx(gi,{present:r||Js(o.checked)||o.checked===!0,children:h.jsx(nt.span,{"data-state":wB(o.checked),"data-disabled":o.disabled?"":void 0,...i,ref:e,style:{pointerEvents:"none",...t.style}})})});xB.displayName=yB;var bB="CheckboxBubbleInput",_B=_.forwardRef(({__scopeCheckbox:t,...e},n)=>{const{control:r,hasConsumerStoppedPropagationRef:i,checked:o,defaultChecked:a,required:s,disabled:l,name:c,value:u,form:d,bubbleInput:f,setBubbleInput:p}=AA(bB,t),y=Ot(n,p),v=MA(o),g=bA(r);_.useEffect(()=>{const x=f;if(!x)return;const b=window.HTMLInputElement.prototype,w=Object.getOwnPropertyDescriptor(b,"checked").set,E=!i.current;if(v!==o&&w){const T=new Event("click",{bubbles:E});x.indeterminate=Js(o),w.call(x,Js(o)?!1:o),x.dispatchEvent(T)}},[f,v,o,i]);const m=_.useRef(Js(o)?!1:o);return h.jsx(nt.input,{type:"checkbox","aria-hidden":!0,defaultChecked:a??m.current,required:s,disabled:l,name:c,value:u,form:d,...e,tabIndex:-1,ref:y,style:{...e.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});_B.displayName=bB;function bJ(t){return typeof t=="function"}function Js(t){return t==="indeterminate"}function wB(t){return Js(t)?"indeterminate":t?"checked":"unchecked"}const PA=_.forwardRef(({className:t,...e},n)=>h.jsx(CA,{ref:n,className:He("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",t),...e,children:h.jsx(xB,{className:He("flex items-center justify-center text-current"),children:h.jsx(yl,{className:"h-4 w-4"})})}));PA.displayName=CA.displayName;var Px="Collapsible",[_J,yDe]=mi(Px),[wJ,RA]=_J(Px),SB=_.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:a,...s}=t,[l,c]=$o({prop:r,defaultProp:i??!1,onChange:a,caller:Px});return h.jsx(wJ,{scope:n,disabled:o,contentId:sr(),open:l,onOpenToggle:_.useCallback(()=>c(u=>!u),[c]),children:h.jsx(nt.div,{"data-state":OA(l),"data-disabled":o?"":void 0,...s,ref:e})})});SB.displayName=Px;var EB="CollapsibleTrigger",TB=_.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,i=RA(EB,n);return h.jsx(nt.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":OA(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:e,onClick:Oe(t.onClick,i.onOpenToggle)})});TB.displayName=EB;var NA="CollapsibleContent",MB=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=RA(NA,t.__scopeCollapsible);return h.jsx(gi,{present:n||i.open,children:({present:o})=>h.jsx(SJ,{...r,ref:e,present:o})})});MB.displayName=NA;var SJ=_.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=t,a=RA(NA,n),[s,l]=_.useState(r),c=_.useRef(null),u=Ot(e,c),d=_.useRef(0),f=d.current,p=_.useRef(0),y=p.current,v=a.open||s,g=_.useRef(v),m=_.useRef(void 0);return _.useEffect(()=>{const x=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(x)},[]),ur(()=>{const x=c.current;if(x){m.current=m.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";const b=x.getBoundingClientRect();d.current=b.height,p.current=b.width,g.current||(x.style.transitionDuration=m.current.transitionDuration,x.style.animationName=m.current.animationName),l(r)}},[a.open,r]),h.jsx(nt.div,{"data-state":OA(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!v,...o,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":y?`${y}px`:void 0,...t.style},children:v&&i})});function OA(t){return t?"open":"closed"}var EJ=SB;const Sy=EJ,Ey=TB,Ty=MB,TJ=Sm("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Mi=_.forwardRef(({className:t,variant:e,...n},r)=>h.jsx("div",{ref:r,role:"alert",className:He(TJ({variant:e}),t),...n}));Mi.displayName="Alert";const MJ=_.forwardRef(({className:t,...e},n)=>h.jsx("h5",{ref:n,className:He("mb-1 font-medium leading-none tracking-tight",t),...e}));MJ.displayName="AlertTitle";const Ai=_.forwardRef(({className:t,...e},n)=>h.jsx("div",{ref:n,className:He("text-sm [&_p]:leading-relaxed",t),...e}));Ai.displayName="AlertDescription";function EN(t,[e,n]){return Math.min(n,Math.max(e,t))}var AJ=_.createContext(void 0);function IA(t){const e=_.useContext(AJ);return t||e||"ltr"}var CJ=[" ","Enter","ArrowUp","ArrowDown"],PJ=[" ","Enter"],Pc="Select",[Rx,Nx,RJ]=tx(Pc),[wf,xDe]=mi(Pc,[RJ,Sl]),Ox=Sl(),[NJ,Tl]=wf(Pc),[OJ,IJ]=wf(Pc),AB=t=>{const{__scopeSelect:e,children:n,open:r,defaultOpen:i,onOpenChange:o,value:a,defaultValue:s,onValueChange:l,dir:c,name:u,autoComplete:d,disabled:f,required:p,form:y}=t,v=Ox(e),[g,m]=_.useState(null),[x,b]=_.useState(null),[S,w]=_.useState(!1),E=IA(c),[T,A]=$o({prop:r,defaultProp:i??!1,onChange:o,caller:Pc}),[M,C]=$o({prop:a,defaultProp:s,onChange:l,caller:Pc}),P=_.useRef(null),R=g?y||!!g.closest("form"):!0,[D,k]=_.useState(new Set),U=Array.from(D).map(O=>O.props.value).join(";");return h.jsx(px,{...v,children:h.jsxs(NJ,{required:p,scope:e,trigger:g,onTriggerChange:m,valueNode:x,onValueNodeChange:b,valueNodeHasChildren:S,onValueNodeHasChildrenChange:w,contentId:sr(),value:M,onValueChange:C,open:T,onOpenChange:A,dir:E,triggerPointerDownPosRef:P,disabled:f,children:[h.jsx(Rx.Provider,{scope:e,children:h.jsx(OJ,{scope:t.__scopeSelect,onNativeOptionAdd:_.useCallback(O=>{k(W=>new Set(W).add(O))},[]),onNativeOptionRemove:_.useCallback(O=>{k(W=>{const L=new Set(W);return L.delete(O),L})},[]),children:n})}),R?h.jsxs(JB,{"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:d,value:M,onChange:O=>C(O.target.value),disabled:f,form:y,children:[M===void 0?h.jsx("option",{value:""}):null,Array.from(D)]},U):null]})})};AB.displayName=Pc;var CB="SelectTrigger",PB=_.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:r=!1,...i}=t,o=Ox(n),a=Tl(CB,n),s=a.disabled||r,l=Ot(e,a.onTriggerChange),c=Nx(n),u=_.useRef("touch"),[d,f,p]=QB(v=>{const g=c().filter(b=>!b.disabled),m=g.find(b=>b.value===a.value),x=e4(g,v,m);x!==void 0&&a.onValueChange(x.value)}),y=v=>{s||(a.onOpenChange(!0),p()),v&&(a.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})};return h.jsx(Am,{asChild:!0,...o,children:h.jsx(nt.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":ZB(a.value)?"":void 0,...i,ref:l,onClick:Oe(i.onClick,v=>{v.currentTarget.focus(),u.current!=="mouse"&&y(v)}),onPointerDown:Oe(i.onPointerDown,v=>{u.current=v.pointerType;const g=v.target;g.hasPointerCapture(v.pointerId)&&g.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(y(v),v.preventDefault())}),onKeyDown:Oe(i.onKeyDown,v=>{const g=d.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&f(v.key),!(g&&v.key===" ")&&CJ.includes(v.key)&&(y(),v.preventDefault())})})})});PB.displayName=CB;var RB="SelectValue",NB=_.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:a="",...s}=t,l=Tl(RB,n),{onValueNodeHasChildrenChange:c}=l,u=o!==void 0,d=Ot(e,l.onValueNodeChange);return ur(()=>{c(u)},[c,u]),h.jsx(nt.span,{...s,ref:d,style:{pointerEvents:"none"},children:ZB(l.value)?h.jsx(h.Fragment,{children:a}):o})});NB.displayName=RB;var DJ="SelectIcon",OB=_.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,...i}=t;return h.jsx(nt.span,{"aria-hidden":!0,...i,ref:e,children:r||"โ–ผ"})});OB.displayName=DJ;var LJ="SelectPortal",IB=t=>h.jsx(vf,{asChild:!0,...t});IB.displayName=LJ;var Rc="SelectContent",DB=_.forwardRef((t,e)=>{const n=Tl(Rc,t.__scopeSelect),[r,i]=_.useState();if(ur(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?Bc.createPortal(h.jsx(LB,{scope:t.__scopeSelect,children:h.jsx(Rx.Slot,{scope:t.__scopeSelect,children:h.jsx("div",{children:t.children})})}),o):null}return h.jsx(kB,{...t,ref:e})});DB.displayName=Rc;var vo=10,[LB,Ml]=wf(Rc),kJ="SelectContentImpl",jJ=al("SelectContent.RemoveScroll"),kB=_.forwardRef((t,e)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:a,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:y,hideWhenDetached:v,avoidCollisions:g,...m}=t,x=Tl(Rc,n),[b,S]=_.useState(null),[w,E]=_.useState(null),T=Ot(e,ee=>S(ee)),[A,M]=_.useState(null),[C,P]=_.useState(null),R=Nx(n),[D,k]=_.useState(!1),U=_.useRef(!1);_.useEffect(()=>{if(b)return sx(b)},[b]),ox();const O=_.useCallback(ee=>{const[ce,...ae]=R().map(le=>le.ref.current),[fe]=ae.slice(-1),we=document.activeElement;for(const le of ee)if(le===we||(le==null||le.scrollIntoView({block:"nearest"}),le===ce&&w&&(w.scrollTop=0),le===fe&&w&&(w.scrollTop=w.scrollHeight),le==null||le.focus(),document.activeElement!==we))return},[R,w]),W=_.useCallback(()=>O([A,b]),[O,A,b]);_.useEffect(()=>{D&&W()},[D,W]);const{onOpenChange:L,triggerPointerDownPosRef:j}=x;_.useEffect(()=>{if(b){let ee={x:0,y:0};const ce=fe=>{var we,le;ee={x:Math.abs(Math.round(fe.pageX)-(((we=j.current)==null?void 0:we.x)??0)),y:Math.abs(Math.round(fe.pageY)-(((le=j.current)==null?void 0:le.y)??0))}},ae=fe=>{ee.x<=10&&ee.y<=10?fe.preventDefault():b.contains(fe.target)||L(!1),document.removeEventListener("pointermove",ce),j.current=null};return j.current!==null&&(document.addEventListener("pointermove",ce),document.addEventListener("pointerup",ae,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ce),document.removeEventListener("pointerup",ae,{capture:!0})}}},[b,L,j]),_.useEffect(()=>{const ee=()=>L(!1);return window.addEventListener("blur",ee),window.addEventListener("resize",ee),()=>{window.removeEventListener("blur",ee),window.removeEventListener("resize",ee)}},[L]);const[X,K]=QB(ee=>{const ce=R().filter(we=>!we.disabled),ae=ce.find(we=>we.ref.current===document.activeElement),fe=e4(ce,ee,ae);fe&&setTimeout(()=>fe.ref.current.focus())}),F=_.useCallback((ee,ce,ae)=>{const fe=!U.current&&!ae;(x.value!==void 0&&x.value===ce||fe)&&(M(ee),fe&&(U.current=!0))},[x.value]),Y=_.useCallback(()=>b==null?void 0:b.focus(),[b]),q=_.useCallback((ee,ce,ae)=>{const fe=!U.current&&!ae;(x.value!==void 0&&x.value===ce||fe)&&P(ee)},[x.value]),Q=r==="popper"?_E:jB,te=Q===_E?{side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:y,hideWhenDetached:v,avoidCollisions:g}:{};return h.jsx(LB,{scope:n,content:b,viewport:w,onViewportChange:E,itemRefCallback:F,selectedItem:A,onItemLeave:Y,itemTextRefCallback:q,focusSelectedItem:W,selectedItemText:C,position:r,isPositioned:D,searchRef:X,children:h.jsx(Tm,{as:jJ,allowPinchZoom:!0,children:h.jsx(Em,{asChild:!0,trapped:x.open,onMountAutoFocus:ee=>{ee.preventDefault()},onUnmountAutoFocus:Oe(i,ee=>{var ce;(ce=x.trigger)==null||ce.focus({preventScroll:!0}),ee.preventDefault()}),children:h.jsx(zc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:ee=>ee.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:h.jsx(Q,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:ee=>ee.preventDefault(),...m,...te,onPlaced:()=>k(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...m.style},onKeyDown:Oe(m.onKeyDown,ee=>{const ce=ee.ctrlKey||ee.altKey||ee.metaKey;if(ee.key==="Tab"&&ee.preventDefault(),!ce&&ee.key.length===1&&K(ee.key),["ArrowUp","ArrowDown","Home","End"].includes(ee.key)){let fe=R().filter(we=>!we.disabled).map(we=>we.ref.current);if(["ArrowUp","End"].includes(ee.key)&&(fe=fe.slice().reverse()),["ArrowUp","ArrowDown"].includes(ee.key)){const we=ee.target,le=fe.indexOf(we);fe=fe.slice(le+1)}setTimeout(()=>O(fe)),ee.preventDefault()}})})})})})})});kB.displayName=kJ;var UJ="SelectItemAlignedPosition",jB=_.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:r,...i}=t,o=Tl(Rc,n),a=Ml(Rc,n),[s,l]=_.useState(null),[c,u]=_.useState(null),d=Ot(e,T=>u(T)),f=Nx(n),p=_.useRef(!1),y=_.useRef(!0),{viewport:v,selectedItem:g,selectedItemText:m,focusSelectedItem:x}=a,b=_.useCallback(()=>{if(o.trigger&&o.valueNode&&s&&c&&v&&g&&m){const T=o.trigger.getBoundingClientRect(),A=c.getBoundingClientRect(),M=o.valueNode.getBoundingClientRect(),C=m.getBoundingClientRect();if(o.dir!=="rtl"){const we=C.left-A.left,le=M.left-we,ie=T.left-le,G=T.width+ie,Ve=Math.max(G,A.width),Ne=window.innerWidth-vo,st=EN(le,[vo,Math.max(vo,Ne-Ve)]);s.style.minWidth=G+"px",s.style.left=st+"px"}else{const we=A.right-C.right,le=window.innerWidth-M.right-we,ie=window.innerWidth-T.right-le,G=T.width+ie,Ve=Math.max(G,A.width),Ne=window.innerWidth-vo,st=EN(le,[vo,Math.max(vo,Ne-Ve)]);s.style.minWidth=G+"px",s.style.right=st+"px"}const P=f(),R=window.innerHeight-vo*2,D=v.scrollHeight,k=window.getComputedStyle(c),U=parseInt(k.borderTopWidth,10),O=parseInt(k.paddingTop,10),W=parseInt(k.borderBottomWidth,10),L=parseInt(k.paddingBottom,10),j=U+O+D+L+W,X=Math.min(g.offsetHeight*5,j),K=window.getComputedStyle(v),F=parseInt(K.paddingTop,10),Y=parseInt(K.paddingBottom,10),q=T.top+T.height/2-vo,Q=R-q,te=g.offsetHeight/2,ee=g.offsetTop+te,ce=U+O+ee,ae=j-ce;if(ce<=q){const we=P.length>0&&g===P[P.length-1].ref.current;s.style.bottom="0px";const le=c.clientHeight-v.offsetTop-v.offsetHeight,ie=Math.max(Q,te+(we?Y:0)+le+W),G=ce+ie;s.style.height=G+"px"}else{const we=P.length>0&&g===P[0].ref.current;s.style.top="0px";const ie=Math.max(q,U+v.offsetTop+(we?F:0)+te)+ae;s.style.height=ie+"px",v.scrollTop=ce-q+v.offsetTop}s.style.margin=`${vo}px 0`,s.style.minHeight=X+"px",s.style.maxHeight=R+"px",r==null||r(),requestAnimationFrame(()=>p.current=!0)}},[f,o.trigger,o.valueNode,s,c,v,g,m,o.dir,r]);ur(()=>b(),[b]);const[S,w]=_.useState();ur(()=>{c&&w(window.getComputedStyle(c).zIndex)},[c]);const E=_.useCallback(T=>{T&&y.current===!0&&(b(),x==null||x(),y.current=!1)},[b,x]);return h.jsx(BJ,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:E,children:h.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:h.jsx(nt.div,{...i,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});jB.displayName=UJ;var FJ="SelectPopperPosition",_E=_.forwardRef((t,e)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=vo,...o}=t,a=Ox(n);return h.jsx(mx,{...a,...o,ref:e,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});_E.displayName=FJ;var[BJ,DA]=wf(Rc,{}),wE="SelectViewport",UB=_.forwardRef((t,e)=>{const{__scopeSelect:n,nonce:r,...i}=t,o=Ml(wE,n),a=DA(wE,n),s=Ot(e,o.onViewportChange),l=_.useRef(0);return h.jsxs(h.Fragment,{children:[h.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),h.jsx(Rx.Slot,{scope:n,children:h.jsx(nt.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Oe(i.onScroll,c=>{const u=c.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:f}=a;if(f!=null&&f.current&&d){const p=Math.abs(l.current-u.scrollTop);if(p>0){const y=window.innerHeight-vo*2,v=parseFloat(d.style.minHeight),g=parseFloat(d.style.height),m=Math.max(v,g);if(m0?S:0,d.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});UB.displayName=wE;var FB="SelectGroup",[$J,zJ]=wf(FB),HJ=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=sr();return h.jsx($J,{scope:n,id:i,children:h.jsx(nt.div,{role:"group","aria-labelledby":i,...r,ref:e})})});HJ.displayName=FB;var BB="SelectLabel",$B=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=zJ(BB,n);return h.jsx(nt.div,{id:i.id,...r,ref:e})});$B.displayName=BB;var My="SelectItem",[VJ,zB]=wf(My),HB=_.forwardRef((t,e)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...a}=t,s=Tl(My,n),l=Ml(My,n),c=s.value===r,[u,d]=_.useState(o??""),[f,p]=_.useState(!1),y=Ot(e,x=>{var b;return(b=l.itemRefCallback)==null?void 0:b.call(l,x,r,i)}),v=sr(),g=_.useRef("touch"),m=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return h.jsx(VJ,{scope:n,value:r,disabled:i,textId:v,isSelected:c,onItemTextChange:_.useCallback(x=>{d(b=>b||((x==null?void 0:x.textContent)??"").trim())},[]),children:h.jsx(Rx.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:h.jsx(nt.div,{role:"option","aria-labelledby":v,"data-highlighted":f?"":void 0,"aria-selected":c&&f,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...a,ref:y,onFocus:Oe(a.onFocus,()=>p(!0)),onBlur:Oe(a.onBlur,()=>p(!1)),onClick:Oe(a.onClick,()=>{g.current!=="mouse"&&m()}),onPointerUp:Oe(a.onPointerUp,()=>{g.current==="mouse"&&m()}),onPointerDown:Oe(a.onPointerDown,x=>{g.current=x.pointerType}),onPointerMove:Oe(a.onPointerMove,x=>{var b;g.current=x.pointerType,i?(b=l.onItemLeave)==null||b.call(l):g.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Oe(a.onPointerLeave,x=>{var b;x.currentTarget===document.activeElement&&((b=l.onItemLeave)==null||b.call(l))}),onKeyDown:Oe(a.onKeyDown,x=>{var S;((S=l.searchRef)==null?void 0:S.current)!==""&&x.key===" "||(PJ.includes(x.key)&&m(),x.key===" "&&x.preventDefault())})})})})});HB.displayName=My;var Ah="SelectItemText",VB=_.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:i,...o}=t,a=Tl(Ah,n),s=Ml(Ah,n),l=zB(Ah,n),c=IJ(Ah,n),[u,d]=_.useState(null),f=Ot(e,m=>d(m),l.onItemTextChange,m=>{var x;return(x=s.itemTextRefCallback)==null?void 0:x.call(s,m,l.value,l.disabled)}),p=u==null?void 0:u.textContent,y=_.useMemo(()=>h.jsx("option",{value:l.value,disabled:l.disabled,children:p},l.value),[l.disabled,l.value,p]),{onNativeOptionAdd:v,onNativeOptionRemove:g}=c;return ur(()=>(v(y),()=>g(y)),[v,g,y]),h.jsxs(h.Fragment,{children:[h.jsx(nt.span,{id:l.textId,...o,ref:f}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Bc.createPortal(o.children,a.valueNode):null]})});VB.displayName=Ah;var GB="SelectItemIndicator",WB=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return zB(GB,n).isSelected?h.jsx(nt.span,{"aria-hidden":!0,...r,ref:e}):null});WB.displayName=GB;var SE="SelectScrollUpButton",XB=_.forwardRef((t,e)=>{const n=Ml(SE,t.__scopeSelect),r=DA(SE,t.__scopeSelect),[i,o]=_.useState(!1),a=Ot(e,r.onScrollButtonChange);return ur(()=>{if(n.viewport&&n.isPositioned){let s=function(){const c=l.scrollTop>0;o(c)};const l=n.viewport;return s(),l.addEventListener("scroll",s),()=>l.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?h.jsx(KB,{...t,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop-l.offsetHeight)}}):null});XB.displayName=SE;var EE="SelectScrollDownButton",qB=_.forwardRef((t,e)=>{const n=Ml(EE,t.__scopeSelect),r=DA(EE,t.__scopeSelect),[i,o]=_.useState(!1),a=Ot(e,r.onScrollButtonChange);return ur(()=>{if(n.viewport&&n.isPositioned){let s=function(){const c=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)l.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?h.jsx(KB,{...t,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop+l.offsetHeight)}}):null});qB.displayName=EE;var KB=_.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=t,o=Ml("SelectScrollButton",n),a=_.useRef(null),s=Nx(n),l=_.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return _.useEffect(()=>()=>l(),[l]),ur(()=>{var u;const c=s().find(d=>d.ref.current===document.activeElement);(u=c==null?void 0:c.ref.current)==null||u.scrollIntoView({block:"nearest"})},[s]),h.jsx(nt.div,{"aria-hidden":!0,...i,ref:e,style:{flexShrink:0,...i.style},onPointerDown:Oe(i.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:Oe(i.onPointerMove,()=>{var c;(c=o.onItemLeave)==null||c.call(o),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:Oe(i.onPointerLeave,()=>{l()})})}),GJ="SelectSeparator",YB=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return h.jsx(nt.div,{"aria-hidden":!0,...r,ref:e})});YB.displayName=GJ;var TE="SelectArrow",WJ=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=Ox(n),o=Tl(TE,n),a=Ml(TE,n);return o.open&&a.position==="popper"?h.jsx(gx,{...i,...r,ref:e}):null});WJ.displayName=TE;var XJ="SelectBubbleInput",JB=_.forwardRef(({__scopeSelect:t,value:e,...n},r)=>{const i=_.useRef(null),o=Ot(r,i),a=MA(e);return _.useEffect(()=>{const s=i.current;if(!s)return;const l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==e&&u){const d=new Event("change",{bubbles:!0});u.call(s,e),s.dispatchEvent(d)}},[a,e]),h.jsx(nt.select,{...n,style:{...uU,...n.style},ref:o,defaultValue:e})});JB.displayName=XJ;function ZB(t){return t===""||t===void 0}function QB(t){const e=di(t),n=_.useRef(""),r=_.useRef(0),i=_.useCallback(a=>{const s=n.current+a;e(s),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(s)},[e]),o=_.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return _.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function e4(t,e,n){const i=e.length>1&&Array.from(e).every(c=>c===e[0])?e[0]:e,o=n?t.indexOf(n):-1;let a=qJ(t,Math.max(o,0));i.length===1&&(a=a.filter(c=>c!==n));const l=a.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function qJ(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var KJ=AB,t4=PB,YJ=NB,JJ=OB,ZJ=IB,n4=DB,QJ=UB,r4=$B,i4=HB,eZ=VB,tZ=WB,o4=XB,a4=qB,s4=YB;const Zs=KJ,Qs=YJ,Wa=_.forwardRef(({className:t,children:e,...n},r)=>h.jsxs(t4,{ref:r,className:He("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...n,children:[e,h.jsx(JJ,{asChild:!0,children:h.jsx(hc,{className:"h-4 w-4 text-slate-400"})})]}));Wa.displayName=t4.displayName;const l4=_.forwardRef(({className:t,...e},n)=>h.jsx(o4,{ref:n,className:He("flex cursor-default items-center justify-center py-1",t),...e,children:h.jsx(z7,{className:"h-4 w-4"})}));l4.displayName=o4.displayName;const c4=_.forwardRef(({className:t,...e},n)=>h.jsx(a4,{ref:n,className:He("flex cursor-default items-center justify-center py-1",t),...e,children:h.jsx(hc,{className:"h-4 w-4"})}));c4.displayName=a4.displayName;const Xa=_.forwardRef(({className:t,children:e,position:n="popper",...r},i)=>h.jsx(ZJ,{children:h.jsxs(n4,{ref:i,className:He("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:n,...r,children:[h.jsx(l4,{}),h.jsx(QJ,{className:He("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),h.jsx(c4,{})]})}));Xa.displayName=n4.displayName;const nZ=_.forwardRef(({className:t,...e},n)=>h.jsx(r4,{ref:n,className:He("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...e}));nZ.displayName=r4.displayName;const _n=_.forwardRef(({className:t,children:e,...n},r)=>h.jsxs(i4,{ref:r,className:He("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[h.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:h.jsx(tZ,{children:h.jsx(yl,{className:"h-4 w-4"})})}),h.jsx(eZ,{children:e})]}));_n.displayName=i4.displayName;const rZ=_.forwardRef(({className:t,...e},n)=>h.jsx(s4,{ref:n,className:He("-mx-1 my-1 h-px bg-muted",t),...e}));rZ.displayName=s4.displayName;const th=t=>t.toLowerCase().replace(/\s+/g," ").trim();function u4({enabled:t=!0}={}){const{baseUrl:e,fetchWithHeaders:n}=Ln(),[r,i]=_.useState([]),[o,a]=_.useState(!1),s=_.useCallback(async()=>{a(!0);try{try{(await navigator.mediaDevices.getUserMedia({video:!0})).getTracks().forEach(v=>v.stop())}catch{}const l=(await navigator.mediaDevices.enumerateDevices()).filter(y=>y.kind==="videoinput").map(y=>({deviceId:y.deviceId,label:y.label})),c=await n(`${e}/available-cameras`);if(!c.ok)return i([]),[];const d=(await c.json()).cameras??[],f=new Set,p=d.map(y=>{const v=y.name||`Camera ${y.index}`,g=th(v),m=l.filter(b=>!f.has(b.deviceId)&&b.label),x=m.find(b=>th(b.label)===g)||m.find(b=>th(b.label).startsWith(g))||m.find(b=>th(b.label).includes(g)||g.includes(th(b.label)));return x&&f.add(x.deviceId),{index:y.index,name:v,deviceId:(x==null?void 0:x.deviceId)??"",available:y.available}});return i(p),p}catch{return i([]),[]}finally{a(!1)}},[e,n]);return _.useEffect(()=>{if(!t)return;s();const l=()=>s();return navigator.mediaDevices.addEventListener("devicechange",l),()=>navigator.mediaDevices.removeEventListener("devicechange",l)},[t,s]),{cameras:r,isLoading:o,refresh:s}}function d4(t,e){const n=_.useRef(null),[r,i]=_.useState(!1);return _.useEffect(()=>{if(e||!t){t||i(!0);return}let o=!1,a=null;return i(!1),(async()=>{try{if(a=await navigator.mediaDevices.getUserMedia({video:{deviceId:{exact:t}}}),o){a.getTracks().forEach(s=>s.stop());return}n.current&&(n.current.srcObject=a,await n.current.play().catch(()=>{}))}catch{i(!0)}})(),()=>{o=!0,a&&a.getTracks().forEach(s=>s.stop())}},[t,e]),{videoRef:n,hasError:r}}const f4=({cameras:t,onCamerasChange:e,releaseStreamsRef:n})=>{const{toast:r}=Dr(),{cameras:i,isLoading:o}=u4(),[a,s]=_.useState(""),[l,c]=_.useState("");_.useEffect(()=>{if(i.length===0||t.length===0)return;let g=!1;const m=t.map(x=>{if(!x.device_id)return x;const b=i.find(S=>S.deviceId===x.device_id);return b&&b.index!==x.camera_index?(g=!0,{...x,camera_index:b.index}):x});g&&e(m)},[i]);const u=()=>{if(!a||!l.trim()){r({title:"Missing Information",description:"Please select a camera and provide a name.",variant:"destructive"});return}const g=parseInt(a),m=i.find(S=>S.index===g);if(!m){r({title:"Invalid Camera",description:"Selected camera is not available.",variant:"destructive"});return}if(t.some(S=>S.camera_index===m.index||m.deviceId&&S.device_id===m.deviceId)){r({title:"Camera Already Added",description:"This camera is already in the configuration.",variant:"destructive"});return}const b={id:`camera_${Date.now()}`,name:l.trim(),type:"opencv",camera_index:m.index,device_id:m.deviceId,width:640,height:480,fps:30};e([...t,b]),s(""),c(""),r({title:"Camera Added",description:`${b.name} has been added to the configuration.`})},d=g=>{e(t.filter(m=>m.id!==g)),r({title:"Camera Removed",description:"Camera has been removed from the configuration."})},f=(g,m)=>{e(t.map(x=>x.id===g?{...x,...m}:x))},[p,y]=_.useState(!1),v=_.useCallback(()=>{y(!0)},[]);return _.useEffect(()=>{n&&(n.current=v)},[n,v]),h.jsxs("div",{className:"space-y-4",children:[h.jsx("h3",{className:"text-lg font-semibold text-white border-b border-gray-700 pb-2",children:"Camera Configuration"}),h.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-4 space-y-4",children:[h.jsx("h4",{className:"text-md font-medium text-gray-300",children:"Add Camera"}),h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(Nt,{className:"text-sm font-medium text-gray-300",children:"Available Cameras"}),h.jsxs(Zs,{value:a,onValueChange:s,disabled:o,children:[h.jsx(Wa,{className:"bg-gray-800 border-gray-700 text-white",children:h.jsx(Qs,{placeholder:o?"Loading cameras...":"Select camera"})}),h.jsx(Xa,{className:"bg-gray-800 border-gray-700",children:i.map(g=>{const m=t.some(x=>x.camera_index===g.index||g.deviceId&&x.device_id===g.deviceId);return h.jsx(_n,{value:g.index.toString(),className:"text-white hover:bg-gray-700",disabled:!g.available||m,children:h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{className:"font-medium",children:g.name}),h.jsxs("span",{className:"text-xs text-gray-400",children:["Index ",g.index,m&&" ยท already added"]})]})},g.index)})})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(Nt,{className:"text-sm font-medium text-gray-300",children:"Camera Name"}),h.jsx(hi,{value:l,onChange:g=>c(g.target.value),placeholder:"e.g., workspace_cam",className:"bg-gray-800 border-gray-700 text-white"})]}),h.jsx("div",{className:"space-y-2 flex flex-col justify-end",children:h.jsxs(et,{onClick:u,className:"bg-blue-500 hover:bg-blue-600 text-white",disabled:!a||!l.trim(),children:[h.jsx(eA,{className:"w-4 h-4 mr-2"}),"Add Camera"]})})]})]}),t.length>0&&h.jsxs("div",{className:"space-y-4",children:[h.jsxs("h4",{className:"text-md font-medium text-gray-300",children:["Configured Cameras (",t.length,")"]}),h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-2 gap-4",children:t.map(g=>h.jsx(iZ,{camera:g,paused:p,onRemove:()=>d(g.id),onUpdate:m=>f(g.id,m)},g.id))})]}),t.length===0&&h.jsxs("div",{className:"text-center py-8 text-gray-500",children:[h.jsx($7,{className:"w-12 h-12 mx-auto mb-4 text-gray-600"}),h.jsx("p",{children:"No cameras configured. Add a camera to get started."})]})]})},iZ=({camera:t,paused:e,onRemove:n,onUpdate:r})=>{var s;const{videoRef:i,hasError:o}=d4(t.device_id,e),a=!e&&t.device_id&&!o;return h.jsxs("div",{className:"bg-gray-900 rounded-lg border border-gray-700 overflow-hidden",children:[h.jsx("div",{className:"aspect-[4/3] bg-gray-800 relative",children:a?h.jsx("video",{ref:i,autoPlay:!0,muted:!0,playsInline:!0,className:"w-full h-full object-cover"}):h.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center",children:[h.jsx(DU,{className:"w-8 h-8 text-gray-500 mb-2"}),h.jsx("span",{className:"text-gray-500 text-sm",children:e?"Preview paused":t.device_id?"Preview failed":"No browser match"})]})}),h.jsxs("div",{className:"p-3 space-y-2",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("h5",{className:"font-medium text-white truncate",children:t.name}),h.jsx(et,{onClick:n,size:"sm",variant:"ghost",className:"text-red-400 hover:text-red-300 hover:bg-red-900/20 p-1",children:h.jsx(ix,{className:"w-4 h-4"})})]}),h.jsxs("div",{className:"grid grid-cols-1 gap-2 text-xs text-gray-400",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"w-16",children:"Resolution:"}),h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx(mr,{value:t.width,onChange:l=>{l!==void 0&&r({width:l})},className:"bg-gray-800 border-gray-700 text-white text-xs h-6 px-2 w-16",min:"320",max:"1920"}),h.jsx("span",{className:"flex items-center",children:"ร—"}),h.jsx(mr,{value:t.height,onChange:l=>{l!==void 0&&r({height:l})},className:"bg-gray-800 border-gray-700 text-white text-xs h-6 px-2 w-16",min:"240",max:"1080"})]})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"w-16",children:"FPS:"}),h.jsx(mr,{value:t.fps??30,onChange:l=>{l!==void 0&&r({fps:l})},className:"bg-gray-800 border-gray-700 text-white text-xs h-6 px-2 w-16",min:"10",max:"60"})]})]}),h.jsxs("div",{className:"text-xs text-gray-500",children:["Type: ",t.type," | Device: ",(s=t.device_id)==null?void 0:s.substring(0,10),"..."]})]})]})},oZ=({open:t,onOpenChange:e,robot:n,datasetName:r,setDatasetName:i,singleTask:o,setSingleTask:a,numEpisodes:s,setNumEpisodes:l,episodeTimeS:c,setEpisodeTimeS:u,resetTimeS:d,setResetTimeS:f,streamingEncoding:p,setStreamingEncoding:y,cameras:v,setCameras:g,onStart:m,releaseStreamsRef:x})=>{const{auth:b}=xf(),S=!!n&&n.is_clean;return h.jsx(Hc,{open:t,onOpenChange:e,children:h.jsxs(xl,{className:"bg-gray-900 border-gray-800 text-white sm:max-w-[600px] p-8 max-h-[90vh] overflow-y-auto",children:[h.jsxs(bl,{children:[h.jsx("div",{className:"flex justify-center items-center mb-4",children:h.jsx("div",{className:"w-8 h-8 bg-red-500 rounded-full flex items-center justify-center",children:h.jsx("span",{className:"text-white font-bold text-sm",children:"REC"})})}),h.jsx(_l,{className:"text-white text-center text-2xl font-bold",children:"Configure Recording"})]}),h.jsxs("div",{className:"space-y-6 py-4",children:[h.jsx(wl,{className:"text-gray-400 text-base leading-relaxed text-center",children:"Pick a configured robot and dataset parameters for recording."}),h.jsxs("div",{className:"grid grid-cols-1 gap-6",children:[h.jsxs("div",{className:"space-y-4",children:[h.jsx("h3",{className:"text-lg font-semibold text-white border-b border-gray-700 pb-2",children:"Robot Configuration"}),n?n.is_clean?h.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[h.jsx(qi,{className:"w-4 h-4 text-green-400"}),h.jsxs("span",{className:"text-slate-200",children:["Recording with ",h.jsx("strong",{children:n.name})]})]}):h.jsxs(Mi,{className:"bg-amber-900/40 border-amber-700 text-amber-100",children:[h.jsx(ia,{className:"h-4 w-4"}),h.jsxs(Ai,{children:[h.jsx("strong",{children:n.name})," is missing a calibration. Configure it before recording."]})]}):h.jsxs(Mi,{className:"bg-amber-900/40 border-amber-700 text-amber-100",children:[h.jsx(ia,{className:"h-4 w-4"}),h.jsx(Ai,{children:"Select and configure a robot on the Landing page before recording."})]})]}),h.jsxs("div",{className:"space-y-4",children:[h.jsx("h3",{className:"text-lg font-semibold text-white border-b border-gray-700 pb-2",children:"Dataset Configuration"}),h.jsxs("div",{className:"grid grid-cols-1 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(Nt,{htmlFor:"datasetName",className:"text-sm font-medium text-gray-300",children:"Dataset Name *"}),h.jsx(hi,{id:"datasetName",value:r,onChange:w=>i(w.target.value.replace(/[^A-Za-z0-9._-]/g,"_")),placeholder:"my_dataset",className:"bg-gray-800 border-gray-700 text-white"}),h.jsxs("p",{className:"text-xs text-gray-500",children:["Letters, numbers, ",h.jsx("code",{children:"."})," ",h.jsx("code",{children:"_"})," ",h.jsx("code",{children:"-"})," only โ€” other characters become"," ",h.jsx("code",{children:"_"}),"."]}),r&&(b.status==="authenticated"?h.jsxs("p",{className:"text-xs text-gray-500",children:["Will be saved as"," ",h.jsxs("span",{className:"text-gray-300 font-mono",children:[b.username,"/",r]})]}):b.status==="unauthenticated"?h.jsx("p",{className:"text-xs text-amber-400/80",children:"Log in to Hugging Face to set the repository owner."}):null)]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(Nt,{htmlFor:"singleTask",className:"text-sm font-medium text-gray-300",children:"Task Description *"}),h.jsx(hi,{id:"singleTask",value:o,onChange:w=>a(w.target.value),placeholder:"e.g., pick up the red block and place it on the blue square",className:"bg-gray-800 border-gray-700 text-white"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(Nt,{htmlFor:"numEpisodes",className:"text-sm font-medium text-gray-300",children:"Number of Episodes"}),h.jsx(mr,{id:"numEpisodes",min:"1",max:"100",value:s,onChange:w=>{w!==void 0&&l(w)},className:"bg-gray-800 border-gray-700 text-white"})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(Nt,{htmlFor:"episodeTimeS",className:"text-sm font-medium text-gray-300",children:"Episode duration (seconds)"}),h.jsx(mr,{id:"episodeTimeS",min:"1",value:c,onChange:w=>{w!==void 0&&u(w)},className:"bg-gray-800 border-gray-700 text-white"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(Nt,{htmlFor:"resetTimeS",className:"text-sm font-medium text-gray-300",children:"Reset duration (seconds)"}),h.jsx(mr,{id:"resetTimeS",min:"1",value:d,onChange:w=>{w!==void 0&&f(w)},className:"bg-gray-800 border-gray-700 text-white"})]})]})]})]}),h.jsx("div",{className:"space-y-4",children:h.jsx(f4,{cameras:v,onCamerasChange:g,releaseStreamsRef:x})}),h.jsxs(Sy,{className:"space-y-4 group",children:[h.jsxs(Ey,{className:"flex items-center justify-between w-full text-lg font-semibold text-white border-b border-gray-700 pb-2",children:[h.jsx("span",{children:"Advanced Parameters"}),h.jsx(hc,{className:"w-4 h-4 transition-transform group-data-[state=open]:rotate-180"})]}),h.jsx(Ty,{className:"space-y-3",children:h.jsxs("div",{className:"flex items-start gap-3",children:[h.jsx(PA,{id:"streamingEncoding",checked:p,onCheckedChange:w=>y(w===!0),className:"mt-0.5 border-gray-500 data-[state=checked]:bg-red-500 data-[state=checked]:border-red-500"}),h.jsxs("div",{className:"space-y-1",children:[h.jsx(Nt,{htmlFor:"streamingEncoding",className:"text-sm font-medium text-gray-200 cursor-pointer",children:"Streaming video encoding"}),h.jsx("p",{className:"text-xs text-gray-500",children:"Encodes frames in real time during capture so each episode saves almost instantly. Uncheck to fall back to the slower PNG-then-encode flow."})]})]})})]})]}),h.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center pt-4",children:[h.jsx(et,{onClick:m,disabled:!S,className:"w-full sm:w-auto bg-red-500 hover:bg-red-600 text-white px-10 py-6 text-lg transition-all shadow-md shadow-red-500/30 hover:shadow-lg hover:shadow-red-500/40 disabled:opacity-40 disabled:cursor-not-allowed",children:"Start Recording"}),h.jsx(et,{onClick:()=>e(!1),variant:"outline",className:"w-full sm:w-auto border-gray-500 hover:border-gray-200 px-10 py-6 text-lg text-zinc-500 bg-zinc-900 hover:bg-zinc-800",children:"Cancel"})]})]})]})})},aZ=/^[\w.\-]+\/[\w.\-]+$/,sZ=/^[A-Za-z0-9._-]+$/,lZ=({datasets:t,loading:e,onPickExisting:n,onCreateNew:r,onOpenCustom:i,children:o})=>{const[a,s]=_.useState(!1),[l,c]=_.useState(""),u=l.trim(),d=t.some(C=>C.repo_id.toLowerCase()===u.toLowerCase()),f=aZ.test(u),p=sZ.test(u)&&!u.includes("/"),y=u.length>0&&p&&!d,v=f&&!d,g=d||u!==""&&!y,m=d?"Already exists":u===""?"Create new datasetโ€ฆ":y?`Create "${u}"`:'Use a name without "/"',x=()=>{g||(r(u),w())},b=t.filter(C=>C.source==="local"||C.source==="both"),S=t.filter(C=>C.source==="hub"),w=()=>{c(""),s(!1)},E=C=>{n(C),w()},T=()=>{y&&(r(u),w())},A=()=>{v&&(i(u),w())},M=C=>h.jsxs(kd,{value:C.repo_id,onSelect:()=>E(C),className:"text-white aria-selected:bg-gray-700",children:[h.jsx("span",{className:"flex-1 truncate",children:C.repo_id}),C.source==="both"&&h.jsx("span",{className:"text-xs text-gray-400 mr-2",children:"on Hub"}),C.private&&h.jsx("span",{className:"text-xs text-amber-400",children:"private"})]},C.repo_id);return h.jsxs(_x,{open:a,onOpenChange:s,children:[h.jsx(wx,{asChild:!0,children:o}),h.jsx(Pm,{className:"w-[320px] p-0 bg-gray-800 border-gray-700 text-white",align:"end",children:h.jsxs(Ex,{className:"bg-gray-800",children:[h.jsx(Tx,{placeholder:"Search, type a new name, or org/nameโ€ฆ",value:l,onValueChange:C=>c(C.replace(/[^A-Za-z0-9._\-/]/g,"_")),onKeyDown:C=>{C.key==="Enter"&&(y?(C.preventDefault(),T()):v&&(C.preventDefault(),A()))},className:"text-white"}),h.jsxs(Mx,{children:[t.length===0&&!y&&!v&&h.jsx(Ax,{className:"py-4 text-sm text-gray-400 text-center",children:e?"Loading datasetsโ€ฆ":"No datasets yet. Type a name to create one."}),b.length>0&&h.jsx(Ys,{heading:"Local",children:b.map(M)}),S.length>0&&h.jsx(Ys,{heading:"Hugging Face",children:S.map(M)}),v&&h.jsx(Ys,{heading:"Custom repo",children:h.jsxs(kd,{value:`__open__${u}`,onSelect:A,className:"text-white aria-selected:bg-gray-700",children:[h.jsx(ll,{className:"mr-2 h-4 w-4"}),'Open "',u,'" in viewer']})})]}),h.jsxs("button",{type:"button",onClick:x,disabled:g,className:"flex w-full items-center gap-2 border-t border-gray-700 px-3 py-2 text-sm text-white hover:bg-gray-700 disabled:cursor-not-allowed disabled:text-gray-500 disabled:hover:bg-transparent",children:[h.jsx(eA,{className:"h-4 w-4"}),m]})]})})]})},cZ=(t,e)=>{const{wsBaseUrl:n}=Ln(),r=_.useRef(t);r.current=t;const i=_.useRef(e);i.current=e,_.useEffect(()=>{let o=!1,a=null,s=null;const l=()=>{if(!o){try{a=new WebSocket(`${n}/ws/joint-data`)}catch{s=setTimeout(l,3e3);return}a.onmessage=c=>{try{const u=JSON.parse(c.data);(u==null?void 0:u.type)==="jobs_changed"?r.current():(u==null?void 0:u.type)==="job_progress"&&i.current&&Array.isArray(u==null?void 0:u.jobs)&&i.current(u.jobs)}catch{}},a.onclose=()=>{o||(s=setTimeout(l,3e3))}}};return l(),()=>{o=!0,s&&clearTimeout(s),a&&a.close()}},[n])};class Ix extends Error{constructor(n,r,i){super(n);Kb(this,"status");Kb(this,"detail");this.name="ApiError",this.status=r,this.detail=i}}async function er(t,e,n,{method:r="GET",body:i,signal:o,action:a}={}){const s={method:r,signal:o};i!==void 0&&(s.body=JSON.stringify(i));const l=`${t}${n}`,c=await e(l,s);if(!c.ok){let u=null;try{const f=await c.json();u=(f==null?void 0:f.detail)??(f==null?void 0:f.message)??null}catch{}const d=a||`${r} ${n}`;throw new Ix(`${d} failed: ${u??c.status}`,c.status,u)}if(c.status!==204)return c.json()}async function ME(t,e,n=10,r){return(await er(t,e,`/jobs?limit=${n}`,{signal:r,action:"List jobs"})).jobs}async function uZ(t,e,n,r){return er(t,e,`/jobs/${n}`,{signal:r,action:"Get job"})}async function dZ(t,e,n,r){return(await er(t,e,`/jobs/${n}/logs`,{signal:r,action:"Get job logs"})).logs}async function fZ(t,e,n,r){return(await er(t,e,`/jobs/${n}/log-file`,{signal:r,action:"Get job log file"})).logs}async function hZ(t,e,n,r){return(await er(t,e,`/jobs/${n}/metrics-history`,{signal:r,action:"Get job metrics history"})).points}async function pZ(t,e,n){const{target:r,...i}=n,o=r?{config:i,target:r}:i;try{return await er(t,e,"/jobs/training",{method:"POST",body:o,action:"Start training"})}catch(a){throw a instanceof Ix&&a.status===409?new Error("Another training is already running. Stop it first."):a}}async function h4(t,e,n){return er(t,e,`/jobs/${n}/stop`,{method:"POST",action:"Stop job"})}async function mZ(t,e,n,r){return er(t,e,`/jobs/providers/${encodeURIComponent(n)}/jobs/${encodeURIComponent(r)}/attach`,{method:"POST",action:"Attach provider job"})}async function p4(t,e,n){await er(t,e,`/jobs/${n}`,{method:"DELETE",action:"Delete job"})}const gZ={authenticated:!1,username:null,flavors:[],providers:[]};async function TN(t,e,n){try{const r=await er(t,e,"/jobs/runners/hardware",{signal:n,action:"List runner hardware"});return{authenticated:!!r.authenticated,username:r.username??null,flavors:Array.isArray(r.flavors)?r.flavors:[],providers:Array.isArray(r.providers)?r.providers.map(i=>({...i,flavors:Array.isArray(i.flavors)?i.flavors:[]})):[]}}catch(r){if(r instanceof Ix)return gZ;throw r}}async function vZ(t,e,n){return er(t,e,"/compute/seeed-cloud/config",{signal:n,action:"Get Seeed Cloud config"})}async function yZ(t,e,n){return er(t,e,"/compute/seeed-cloud/config",{method:"POST",body:n,action:"Save Seeed Cloud config"})}const xZ={authenticated:!1,jobs:[],models:[]};async function bZ(t,e,n){try{return await er(t,e,"/jobs/hub",{signal:n,action:"List hub jobs"})}catch(r){if(r instanceof Ix)return xZ;throw r}}const Gr=_.forwardRef(({className:t,...e},n)=>h.jsx("div",{ref:n,className:He("rounded-lg border bg-card text-card-foreground shadow-sm",t),...e}));Gr.displayName="Card";const jo=_.forwardRef(({className:t,...e},n)=>h.jsx("div",{ref:n,className:He("flex flex-col space-y-1.5 p-6",t),...e}));jo.displayName="CardHeader";const ha=_.forwardRef(({className:t,...e},n)=>h.jsx("h3",{ref:n,className:He("text-2xl font-semibold leading-none tracking-tight",t),...e}));ha.displayName="CardTitle";const _Z=_.forwardRef(({className:t,...e},n)=>h.jsx("p",{ref:n,className:He("text-sm text-muted-foreground",t),...e}));_Z.displayName="CardDescription";const Wr=_.forwardRef(({className:t,...e},n)=>h.jsx("div",{ref:n,className:He("p-6 pt-0",t),...e}));Wr.displayName="CardContent";const wZ=_.forwardRef(({className:t,...e},n)=>h.jsx("div",{ref:n,className:He("flex items-center p-6 pt-0",t),...e}));wZ.displayName="CardFooter";async function LA(t,e,n,r){return(await er(t,e,`/jobs/${n}/checkpoints`,{signal:r,action:"List checkpoints"})).checkpoints}async function SZ(t,e,n,r,i){return er(t,e,`/jobs/${n}/checkpoints/${r}/policy-config`,{signal:i,action:"Load policy config"})}const kA=({checkpoints:t,selectedStep:e,onChange:n,disabled:r,placeholder:i="Select checkpoint"})=>{const o=e!=null?String(e):void 0;return h.jsxs(Zs,{value:o,onValueChange:a=>n(Number(a)),disabled:r||t.length===0,children:[h.jsx(Wa,{className:"bg-slate-800 border-slate-700 text-white h-8 text-xs px-2 w-auto min-w-[110px]",onClick:a=>a.stopPropagation(),children:h.jsx(Qs,{placeholder:i})}),h.jsx(Xa,{className:"bg-slate-900 border-slate-700 text-white",children:t.map(a=>h.jsxs(_n,{value:String(a.step),onClick:s=>s.stopPropagation(),children:["step ",a.step]},a.step))})]})};function MN(t){const e=Math.max(0,Date.now()/1e3-t);return e<60?`${Math.floor(e)}s ago`:e<3600?`${Math.floor(e/60)}m ago`:e<86400?`${Math.floor(e/3600)}h ago`:`${Math.floor(e/86400)}d ago`}const EZ={running:{label:"Running",color:"text-green-400",Icon:fi},done:{label:"Done",color:"text-slate-400",Icon:ZM},failed:{label:"Failed",color:"text-red-400",Icon:nd},interrupted:{label:"Interrupted",color:"text-amber-400",Icon:ia}},Tg=({job:t,onStop:e,onDelete:n,onPlay:r})=>{const i=ji(),{baseUrl:o,fetchWithHeaders:a}=Ln(),s=EZ[t.state],l=s.Icon,c=t.state==="running",u=c&&t.metrics.total_steps===0,d=t.metrics.total_steps>0?Math.min(100,t.metrics.current_step/t.metrics.total_steps*100):0,f=u?"startingโ€ฆ":c?`started ${MN(t.started_at)}`:t.ended_at!=null?`ended ${MN(t.ended_at)}`:s.label.toLowerCase(),[p,y]=_.useState([]),[v,g]=_.useState(null);_.useEffect(()=>{if(t.checkpoint_count<=0){y([]),g(null);return}let w=!1;return LA(o,a,t.id).then(E=>{if(!w)if(y(E),E.length>0){const T=E[E.length-1].step;g(A=>A!=null&&E.some(M=>M.step===A)?A:T)}else g(null)}).catch(()=>{w||(y([]),g(null))}),()=>{w=!0}},[o,a,t.id,t.checkpoint_count]);const m=w=>{w.stopPropagation(),c?window.confirm("Stop this run?")&&e(t.id):window.confirm("Delete this run? This wipes the output directory.")&&n(t.id)},x=w=>{w.stopPropagation(),v!=null&&r(t,v)},b=c,S=p.length>0&&v!=null;return h.jsx(Gr,{onClick:()=>i(`/training/${t.id}`),className:"bg-slate-800/50 border-slate-700 rounded-xl cursor-pointer hover:border-slate-500 transition-colors",children:h.jsxs(Wr,{className:"p-4 space-y-3",children:[h.jsxs("div",{className:"flex items-start justify-between gap-2",children:[h.jsxs("div",{className:`flex items-center gap-1.5 text-xs font-semibold ${s.color}`,children:[h.jsx(l,{className:`w-3.5 h-3.5 ${c?"animate-spin":""}`}),s.label]}),t.runner==="hf_cloud"&&t.hf_job_url?h.jsx(et,{variant:"ghost",size:"icon",asChild:!0,className:"h-7 w-7 text-slate-400 hover:text-white","aria-label":"Open Hub job page",children:h.jsx("a",{href:t.hf_job_url,target:"_blank",rel:"noopener noreferrer",onClick:w=>w.stopPropagation(),children:h.jsx(ll,{className:"w-3.5 h-3.5"})})}):h.jsx(et,{variant:"ghost",size:"icon",onClick:m,className:"h-7 w-7 text-slate-400 hover:text-white","aria-label":c?"Stop job":"Delete job",children:c?h.jsx(Od,{className:"w-3.5 h-3.5"}):h.jsx(ix,{className:"w-3.5 h-3.5"})})]}),h.jsxs("div",{children:[h.jsx("div",{className:"text-white font-semibold truncate",title:t.name,children:t.name}),h.jsx("div",{className:"text-xs text-slate-400",children:f})]}),b?h.jsxs("div",{className:"relative h-5 w-full overflow-hidden rounded-md bg-slate-900 border border-slate-700",children:[h.jsx("div",{className:"h-full bg-gradient-to-r from-blue-500 to-sky-400 transition-[width] duration-500",style:{width:`${d}%`}}),h.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-xs font-semibold text-white tabular-nums drop-shadow",children:u?"Training startingโ€ฆ":`${d.toFixed(1)}%`})]}):null,S?h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(kA,{checkpoints:p,selectedStep:v,onChange:g}),h.jsx(et,{size:"icon",onClick:x,className:"h-8 w-8 bg-green-500 hover:bg-green-600 text-white","aria-label":"Run inference with this checkpoint",children:h.jsx(Tc,{className:"w-4 h-4"})})]}):null]})})};function TZ(t){if(!t)return"โ€”";const e=Date.parse(t);if(Number.isNaN(e))return"โ€”";const n=Math.max(0,(Date.now()-e)/1e3);return n<60?`${Math.floor(n)}s ago`:n<3600?`${Math.floor(n/60)}m ago`:n<86400?`${Math.floor(n/3600)}h ago`:`${Math.floor(n/86400)}d ago`}const MZ={RUNNING:{label:"Running",color:"text-green-400",Icon:fi,spin:!0},QUEUED:{label:"Queued",color:"text-amber-400",Icon:dE},SCHEDULING:{label:"Scheduling",color:"text-amber-400",Icon:dE},COMPLETED:{label:"Done",color:"text-slate-400",Icon:ZM},FAILED:{label:"Failed",color:"text-red-400",Icon:nd},CANCELED:{label:"Cancelled",color:"text-amber-400",Icon:ia},CANCELLED:{label:"Cancelled",color:"text-amber-400",Icon:ia}},AN=({job:t,onOpen:e,busy:n=!1})=>{var c,u,d;const r=((u=(c=t.status)==null?void 0:c.stage)==null?void 0:u.toUpperCase())??"",i=MZ[r]??{label:r||"Unknown",color:"text-slate-400",Icon:H7},o=i.Icon,a=t.docker_image??t.space_id??`Job ${t.id.slice(0,12)}โ€ฆ`,s=!!t.url,l=!!(e||s);return h.jsx(Gr,{onClick:()=>{if(!n){if(e){e(t);return}s&&window.open(t.url,"_blank","noopener,noreferrer")}},className:`bg-slate-800/50 border-slate-700 rounded-xl hover:border-slate-500 transition-colors ${l?"cursor-pointer":""}`,children:h.jsxs(Wr,{className:"p-4 space-y-3",children:[h.jsxs("div",{className:"flex items-start justify-between gap-2",children:[h.jsxs("div",{className:`flex items-center gap-1.5 text-xs font-semibold ${i.color}`,children:[h.jsx(o,{className:`w-3.5 h-3.5 ${i.spin||n?"animate-spin":""}`}),i.label]}),s?h.jsx(et,{variant:"ghost",size:"icon",asChild:!0,className:"h-7 w-7 text-slate-400 hover:text-white","aria-label":"View provider job",children:h.jsx("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",onClick:f=>f.stopPropagation(),children:h.jsx(ll,{className:"w-3.5 h-3.5"})})}):null]}),h.jsxs("div",{children:[h.jsx("div",{className:"text-white font-semibold truncate",title:a,children:a}),h.jsxs("div",{className:"text-xs text-slate-400 truncate",children:[t.flavor??"โ€”"," ยท ",TZ(t.created_at),t.owner?` ยท ${t.owner}`:""]})]}),(d=t.status)!=null&&d.message?h.jsx("div",{className:"text-xs text-slate-500 truncate",title:t.status.message,children:t.status.message}):null]})})};function AZ(t){if(!t)return"โ€”";const e=Date.parse(t);if(Number.isNaN(e))return"โ€”";const n=Math.max(0,(Date.now()-e)/1e3);return n<60?`${Math.floor(n)}s ago`:n<3600?`${Math.floor(n/60)}m ago`:n<86400?`${Math.floor(n/3600)}h ago`:`${Math.floor(n/86400)}d ago`}const CZ=({model:t})=>{const e=`https://huggingface.co/${t.repo_id}`,n=t.repo_id.includes("/")?t.repo_id.split("/").slice(1).join("/"):t.repo_id;return h.jsx(Gr,{onClick:()=>window.open(e,"_blank","noopener,noreferrer"),className:"bg-slate-800/50 border-slate-700 rounded-xl cursor-pointer hover:border-slate-500 transition-colors",children:h.jsxs(Wr,{className:"p-4 space-y-3",children:[h.jsxs("div",{className:"flex items-start justify-between gap-2",children:[h.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-semibold text-sky-400",children:[h.jsx(IU,{className:"w-3.5 h-3.5"}),"Uploaded"]}),h.jsx(et,{variant:"ghost",size:"icon",asChild:!0,className:"h-7 w-7 text-slate-400 hover:text-white","aria-label":"View on Hub",children:h.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",onClick:r=>r.stopPropagation(),children:h.jsx(ll,{className:"w-3.5 h-3.5"})})})]}),h.jsxs("div",{children:[h.jsxs("div",{className:"text-white font-semibold truncate flex items-center gap-1.5",title:t.repo_id,children:[t.private?h.jsx(J7,{className:"w-3.5 h-3.5 text-slate-400 shrink-0"}):null,h.jsx("span",{className:"truncate",children:n})]}),h.jsxs("div",{className:"text-xs text-slate-400 truncate",title:t.repo_id,children:[t.repo_id," ยท updated ",AZ(t.last_modified)]})]})]})})};async function PZ(t,e,n){return er(t,e,"/start-inference",{method:"POST",body:n,action:"Start inference"})}async function CN(t,e){return er(t,e,"/stop-inference",{method:"POST",action:"Stop inference"})}async function RZ(t,e,n){return er(t,e,"/inference-status",{signal:n,action:"Get inference status"})}const NZ=({deviceId:t,paused:e})=>{const{videoRef:n,hasError:r}=d4(t,e);return e||r||!t?h.jsxs("div",{className:"w-32 h-24 bg-gray-800 rounded border border-gray-700 flex flex-col items-center justify-center",children:[h.jsx(DU,{className:"w-5 h-5 text-gray-500 mb-1"}),h.jsx("span",{className:"text-[10px] text-gray-500",children:e?"Released":"No preview"})]}):h.jsx("video",{ref:n,autoPlay:!0,muted:!0,playsInline:!0,className:"w-32 h-24 object-cover rounded border border-gray-700 bg-black"})},OZ=30,m4=({open:t,onOpenChange:e,robot:n,jobId:r,initialStep:i})=>{var L;const{baseUrl:o,fetchWithHeaders:a}=Ln(),{toast:s}=Dr(),l=ji(),[c,u]=_.useState([]),[d,f]=_.useState(i),[p,y]=_.useState(""),[v,g]=_.useState(60),[m,x]=_.useState(!1),[b,S]=_.useState(null),[w,E]=_.useState(!1),[T,A]=_.useState(null),[M,C]=_.useState({}),{cameras:P}=u4({enabled:t});_.useEffect(()=>{if(!t)return;let j=!1;return LA(o,a,r).then(X=>{if(!j&&(u(X),X.length>0)){const K=X[X.length-1].step;f(F=>F??K)}}).catch(()=>{j||u([])}),()=>{j=!0}},[t,o,a,r]),_.useEffect(()=>{if(!t||d==null){S(null),A(null);return}let j=!1;return E(!0),A(null),SZ(o,a,r,d).then(X=>{j||(S(X),C(K=>{const F={};for(const Y of Object.keys(X.image_features))F[Y]=K[Y]??null;return F}))}).catch(X=>{j||(S(null),A(X instanceof Error?X.message:String(X)))}).finally(()=>{j||E(!1)}),()=>{j=!0}},[t,o,a,r,d]),_.useEffect(()=>{if(!b)return;const j=(n==null?void 0:n.cameras)??[];j.length===0||P.length===0||C(X=>{let K=!1;const F={...X};for(const Y of Object.keys(b.image_features)){if(F[Y]!=null)continue;const q=j.find(te=>te.name.toLowerCase()===Y.toLowerCase());if(!q)continue;const Q=q.device_id&&P.find(te=>te.deviceId===q.device_id)||P.find(te=>te.index===q.camera_index);Q&&(F[Y]=Q.index,K=!0)}return K?F:X})},[b,n,P]);const R=d!=null?((L=c.find(j=>j.step===d))==null?void 0:L.ref)??null:null,D=b?Object.keys(b.image_features):[],k=D.every(j=>M[j]!=null),U=!!n&&n.is_clean&&R!=null&&!!b&&k&&!m,O=async()=>{if(!n||R==null||!b)return;x(!0),await new Promise(X=>setTimeout(X,300));const j={};for(const[X,K]of Object.entries(b.image_features)){const F=M[X];F!=null&&(j[X]={type:"opencv",camera_index:F,width:K.width,height:K.height,fps:OZ})}try{await PZ(o,a,{follower_port:n.follower_port,follower_config:n.follower_config,policy_ref:R,task:p,cameras:j,duration_s:v}),e(!1),l("/inference")}catch(X){s({title:"Couldn't start inference",description:X instanceof Error?X.message:String(X),variant:"destructive"}),x(!1)}},W=(j,X)=>{const K=Number(X);C(F=>({...F,[j]:K}))};return h.jsx(Hc,{open:t,onOpenChange:e,children:h.jsxs(xl,{className:"bg-gray-900 border-gray-800 text-white sm:max-w-[600px] p-8 max-h-[90vh] overflow-y-auto",children:[h.jsxs(bl,{children:[h.jsx("div",{className:"flex justify-center items-center mb-4",children:h.jsx("div",{className:"w-8 h-8 bg-green-500 rounded-full flex items-center justify-center",children:h.jsx(Tc,{className:"w-4 h-4 text-white"})})}),h.jsx(_l,{className:"text-white text-center text-2xl font-bold",children:"Configure Inference"})]}),h.jsxs("div",{className:"space-y-6 py-4",children:[h.jsx(wl,{className:"text-gray-400 text-base leading-relaxed text-center",children:"Pick a checkpoint and confirm hardware. The selected policy will drive the follower autonomously for the configured duration."}),h.jsxs("div",{className:"space-y-4",children:[h.jsx("h3",{className:"text-lg font-semibold text-white border-b border-gray-700 pb-2",children:"Robot Configuration"}),n?n.is_clean?h.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[h.jsx(qi,{className:"w-4 h-4 text-green-400"}),h.jsxs("span",{className:"text-slate-200",children:["Running on ",h.jsx("strong",{children:n.name})]})]}):h.jsxs(Mi,{className:"bg-amber-900/40 border-amber-700 text-amber-100",children:[h.jsx(ia,{className:"h-4 w-4"}),h.jsxs(Ai,{children:[h.jsx("strong",{children:n.name})," is missing a calibration. Configure it before running inference."]})]}):h.jsxs(Mi,{className:"bg-amber-900/40 border-amber-700 text-amber-100",children:[h.jsx(ia,{className:"h-4 w-4"}),h.jsx(Ai,{children:"Select and configure a robot on the Landing page first."})]})]}),h.jsxs("div",{className:"space-y-4",children:[h.jsx("h3",{className:"text-lg font-semibold text-white border-b border-gray-700 pb-2",children:"Checkpoint"}),c.length===0?h.jsxs(Mi,{className:"bg-amber-900/40 border-amber-700 text-amber-100",children:[h.jsx(ia,{className:"h-4 w-4"}),h.jsx(Ai,{children:"No checkpoints available for this job yet."})]}):h.jsx(kA,{checkpoints:c,selectedStep:d,onChange:f})]}),h.jsxs("div",{className:"space-y-4",children:[h.jsx("h3",{className:"text-lg font-semibold text-white border-b border-gray-700 pb-2",children:"Run parameters"}),b!=null&&b.requires_task?h.jsxs("div",{className:"space-y-2",children:[h.jsx(Nt,{htmlFor:"task",className:"text-sm font-medium text-gray-300",children:"Task description"}),h.jsx(hi,{id:"task",value:p,onChange:j=>y(j.target.value),placeholder:"e.g., pick up the red block",className:"bg-gray-800 border-gray-700 text-white"}),h.jsxs("p",{className:"text-xs text-gray-500",children:["This policy is language-conditioned (",b.policy_type,")."]})]}):null,h.jsxs("div",{className:"space-y-2",children:[h.jsx(Nt,{htmlFor:"durationS",className:"text-sm font-medium text-gray-300",children:"Max duration (seconds)"}),h.jsx(mr,{id:"durationS",min:1,value:v,onChange:j=>{j!==void 0&&g(j)},className:"bg-gray-800 border-gray-700 text-white"})]})]}),h.jsxs("div",{className:"space-y-4",children:[h.jsx("h3",{className:"text-lg font-semibold text-white border-b border-gray-700 pb-2",children:"Cameras"}),w?h.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-400",children:[h.jsx(fi,{className:"w-4 h-4 animate-spin"}),"Reading policy configโ€ฆ"]}):T?h.jsxs(Mi,{className:"bg-red-900/40 border-red-700 text-red-100",children:[h.jsx(ia,{className:"h-4 w-4"}),h.jsxs(Ai,{children:["Couldn't load policy config: ",T]})]}):b?D.length===0?h.jsx("p",{className:"text-xs text-gray-500",children:"This policy doesn't use cameras."}):h.jsxs("div",{className:"space-y-3",children:[h.jsx("p",{className:"text-xs text-gray-500",children:"Bind a physical camera to each name the policy was trained with. Resolution comes from the checkpoint."}),D.map(j=>{const X=b.image_features[j],K=M[j],F=K!=null?P.find(Y=>Y.index===K):void 0;return h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs("div",{className:"flex-1",children:[h.jsx(Nt,{className:"text-sm font-medium text-gray-200",children:j}),h.jsxs("p",{className:"text-xs text-gray-500",children:[X.width,"ร—",X.height]})]}),h.jsxs(Zs,{value:K!=null?String(K):void 0,onValueChange:Y=>W(j,Y),children:[h.jsx(Wa,{className:"bg-gray-800 border-gray-700 text-white w-56",children:h.jsx(Qs,{placeholder:"Select a camera"})}),h.jsx(Xa,{className:"bg-gray-900 border-gray-700 text-white",children:P.length===0?h.jsx("div",{className:"px-2 py-1.5 text-xs text-gray-500",children:"No cameras detected"}):P.map(Y=>h.jsxs(_n,{value:String(Y.index),children:["#",Y.index," โ€” ",Y.name]},Y.index))})]}),h.jsx(NZ,{deviceId:(F==null?void 0:F.deviceId)??"",paused:m})]},j)})]}):null]}),h.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center pt-4",children:[h.jsxs(et,{onClick:O,disabled:!U,className:"w-full sm:w-auto bg-green-500 hover:bg-green-600 text-white px-10 py-6 text-lg disabled:opacity-40 disabled:cursor-not-allowed",children:[h.jsx(Tc,{className:"w-5 h-5 mr-2"}),m?"Startingโ€ฆ":"Start Inference"]}),h.jsx(et,{onClick:()=>e(!1),variant:"outline",className:"w-full sm:w-auto border-gray-500 hover:border-gray-200 px-10 py-6 text-lg text-zinc-500 bg-zinc-900 hover:bg-zinc-800",children:"Cancel"})]})]})]})})},AE="lelab.selectedRobot",IZ=()=>{try{const t=localStorage.getItem(AE);return t&&typeof t=="string"?t:null}catch{return null}},DZ=t=>{try{t?localStorage.setItem(AE,t):localStorage.removeItem(AE)}catch{}},jA=()=>{const{baseUrl:t,fetchWithHeaders:e}=Ln(),{toast:n}=Dr(),r=vl(),[i,o]=_.useState({}),[a,s]=_.useState(()=>IZ()),[l,c]=_.useState(!1);_.useEffect(()=>{let g=!1;return(async()=>{c(!0);try{const b=await(await e(`${t}/robots`)).json();if(g)return;const S={};for(const w of b.robots??[])S[w.name]=w;o(S),s(w=>w&&w in S?w:null)}catch(x){g||console.error("Failed to fetch robots:",x)}finally{g||c(!1)}})(),()=>{g=!0}},[t,e,r.key]),_.useEffect(()=>{DZ(a)},[a]);const u=_.useCallback(g=>{s(g)},[]),d=_.useCallback(()=>{s(null)},[]),f=_.useCallback(async g=>{const m=g.trim();if(!m)return n({title:"Missing name",description:"Robot name cannot be empty.",variant:"destructive"}),!1;if(/[/\\]|\.\./.test(m))return n({title:"Invalid name",description:"Robot names cannot contain '/', '\\', or '..'",variant:"destructive"}),!1;try{const x=await e(`${t}/robots/${encodeURIComponent(m)}?create=true`,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"});if(x.status===409)return n({title:"Already exists",description:`A robot named "${m}" already exists. Pick it from the dropdown or choose a different name.`,variant:"destructive"}),!1;if(!x.ok){const S=await x.text();return n({title:"Failed to create",description:S,variant:"destructive"}),!1}const b=await x.json();return b.robot&&(o(S=>({...S,[m]:b.robot})),s(m)),!0}catch(x){return n({title:"Network error",description:String(x),variant:"destructive"}),!1}},[t,e,n]),p=_.useCallback(async g=>{try{const m=await e(`${t}/robots/${encodeURIComponent(g)}`,{method:"DELETE"});if(!m.ok){const x=await m.text();return n({title:"Failed to delete",description:x,variant:"destructive"}),!1}return o(x=>{const{[g]:b,...S}=x;return S}),s(x=>x===g?null:x),!0}catch(m){return n({title:"Network error",description:String(m),variant:"destructive"}),!1}},[t,e,n]),y=_.useMemo(()=>a?i[a]??null:null,[a,i]),v=_.useMemo(()=>Object.keys(i).sort(),[i]);return{records:i,selectedName:a,selectedRecord:y,availableNames:v,isLoading:l,selectRobot:u,clearSelection:d,createRobot:f,deleteRobot:p}},LZ=10,kZ=new Set(["RUNNING","QUEUED","SCHEDULING"]),Mg=t=>t.state==="running"||t.checkpoint_count>0,PN=t=>{var e;return kZ.has((((e=t.status)==null?void 0:e.stage)??"").toUpperCase())},jZ=()=>{const{baseUrl:t,fetchWithHeaders:e}=Ln(),{toast:n}=Dr(),r=ji(),[i,o]=_.useState([]),[a,s]=_.useState([]),[l,c]=_.useState([]),[u,d]=_.useState(!1),[f,p]=_.useState(null),[y,v]=_.useState(""),[g,m]=_.useState(null),{selectedRecord:x}=jA(),[b,S]=_.useState(!1),[w,E]=_.useState(null),[T,A]=_.useState(null),M=_.useCallback(async()=>{try{const[ie,G]=await Promise.all([ME(t,e,LZ),bZ(t,e)]);o(ie),s(G.jobs),c(G.models),d(G.authenticated),p(null)}catch(ie){p(ie instanceof Error?ie.message:String(ie))}},[t,e]);_.useEffect(()=>{M();const ie=()=>{document.visibilityState==="visible"&&M()};return document.addEventListener("visibilitychange",ie),window.addEventListener("focus",M),()=>{document.removeEventListener("visibilitychange",ie),window.removeEventListener("focus",M)}},[M]);const C=_.useCallback(ie=>{ie.length!==0&&o(G=>{if(G.length===0)return G;const Ve=new Map(ie.map(Re=>[Re.id,Re]));let Ne=!1;const st=G.map(Re=>{const ct=Ve.get(Re.id);return ct?(Ne=!0,{...Re,state:ct.state,metrics:ct.metrics,wandb_run_url:ct.wandb_run_url,checkpoint_count:ct.checkpoint_count}):Re});return Ne?st:G})},[]);cZ(M,C);const P=async ie=>{try{await h4(t,e,ie),n({title:"Job stopping"}),M()}catch(G){n({title:"Stop failed",description:G instanceof Error?G.message:String(G),variant:"destructive"})}},R=(ie,G)=>{E(ie),A(G),S(!0)},D=async ie=>{try{await p4(t,e,ie),n({title:"Job removed"}),M()}catch(G){n({title:"Delete failed",description:G instanceof Error?G.message:String(G),variant:"destructive"})}},k=async ie=>{if(ie.provider!=="seeed_cloud"){ie.url&&window.open(ie.url,"_blank","noopener,noreferrer");return}try{m(ie.id);const G=await mZ(t,e,"seeed_cloud",ie.id);o(Ve=>Ve.some(Ne=>Ne.id===G.id)?Ve:[G,...Ve]),r(`/training/${G.id}`)}catch(G){n({title:"Attach failed",description:G instanceof Error?G.message:String(G),variant:"destructive"})}finally{m(null)}},U=y.trim().toLowerCase(),O=_.useCallback(ie=>!U||(ie??"").toLowerCase().includes(U),[U]),W=_.useMemo(()=>i.filter(ie=>O(ie.name)),[i,O]),L=_.useMemo(()=>a.filter(ie=>O(ie.docker_image??ie.space_id??ie.id)),[a,O]),j=_.useMemo(()=>l.filter(ie=>O(ie.repo_id)),[l,O]),X=_.useMemo(()=>W.filter(ie=>ie.runner==="local"),[W]),K=_.useMemo(()=>W.filter(ie=>ie.runner==="hf_cloud"||ie.runner==="seeed_cloud"),[W]),F=_.useMemo(()=>new Set(K.map(ie=>ie.hf_job_id).filter(ie=>!!ie)),[K]),Y=_.useMemo(()=>L.filter(ie=>ie.provider==="hf_cloud"?!F.has(ie.id):ie.provider==="seeed_cloud"?!K.some(G=>G.external_provider==="seeed_cloud"&&G.external_job_id===ie.id):!0),[L,K,F]),q=_.useMemo(()=>new Set(K.map(ie=>ie.hf_repo_id).filter(ie=>!!ie)),[K]),Q=_.useMemo(()=>j.filter(ie=>!q.has(ie.repo_id)),[j,q]),te=_.useMemo(()=>X.filter(Mg),[X]),ee=_.useMemo(()=>X.filter(ie=>!Mg(ie)),[X]),ce=_.useMemo(()=>K.filter(Mg),[K]),ae=_.useMemo(()=>K.filter(ie=>!Mg(ie)),[K]),fe=_.useMemo(()=>Y.filter(PN),[Y]),we=_.useMemo(()=>Y.filter(ie=>!PN(ie)),[Y]),le=ee.length+ae.length+we.length;return h.jsxs("section",{className:"space-y-6",children:[h.jsxs("div",{className:"flex items-center justify-between gap-3",children:[h.jsx("h2",{className:"text-lg font-semibold text-white",children:"Jobs"}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs("div",{className:"relative",children:[h.jsx(tA,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-slate-400 pointer-events-none"}),h.jsx(hi,{value:y,onChange:ie=>v(ie.target.value),placeholder:"Search jobs",className:"h-8 w-48 sm:w-60 pl-8 bg-slate-800/50 border-slate-700 text-sm text-white placeholder:text-slate-500","aria-label":"Search jobs"})]}),h.jsx(et,{variant:"ghost",size:"icon",onClick:M,className:"h-7 w-7 text-slate-400 hover:text-white","aria-label":"Refresh jobs",children:h.jsx(OU,{className:"w-4 h-4"})})]})]}),f?h.jsxs("p",{className:"text-sm text-red-300",children:["Couldn't load jobs: ",f]}):null,h.jsxs("div",{className:"space-y-3",children:[h.jsx("h3",{className:"text-sm font-semibold uppercase tracking-wide text-slate-400",children:"Local jobs"}),te.length===0?h.jsx("p",{className:"text-sm text-slate-500",children:U?"No local jobs match your search.":"No active local jobs. Start one from the Training page."}):h.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:te.map(ie=>h.jsx(Tg,{job:ie,onStop:P,onDelete:D,onPlay:R},ie.id))})]}),h.jsx("div",{className:"border-t border-slate-700"}),h.jsxs("div",{className:"space-y-3",children:[h.jsx("h3",{className:"text-sm font-semibold uppercase tracking-wide text-slate-400",children:"Online jobs"}),!u&&K.length===0?h.jsx("p",{className:"text-sm text-slate-500",children:"Sign in with Hugging Face to see your cloud jobs."}):ce.length===0&&fe.length===0&&Q.length===0?h.jsx("p",{className:"text-sm text-slate-500",children:U?"No online jobs match your search.":"No active cloud jobs."}):h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[ce.map(ie=>h.jsx(Tg,{job:ie,onStop:P,onDelete:D,onPlay:R},ie.id)),fe.map(ie=>h.jsx(AN,{job:ie,onOpen:k,busy:g===ie.id},ie.id)),Q.map(ie=>h.jsx(CZ,{model:ie},ie.repo_id))]})]}),le>0?h.jsxs(Sy,{children:[h.jsxs(Ey,{className:"group flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wide text-slate-400 hover:text-white transition-colors",children:[h.jsx(xp,{className:"w-3.5 h-3.5 transition-transform group-data-[state=open]:rotate-90"}),"Untracked (",le,")"]}),h.jsx(Ty,{className:"pt-3",children:h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[ee.map(ie=>h.jsx(Tg,{job:ie,onStop:P,onDelete:D,onPlay:R},ie.id)),ae.map(ie=>h.jsx(Tg,{job:ie,onStop:P,onDelete:D,onPlay:R},ie.id)),we.map(ie=>h.jsx(AN,{job:ie,onOpen:k,busy:g===ie.id},ie.id))]})})]}):null,w?h.jsx(m4,{open:b,onOpenChange:S,robot:x,jobId:w.id,initialStep:T}):null]})},RN="uv tool install git+https://github.com/huggingface/leLab.git && lelab",UZ="http://localhost:8000/",FZ=({open:t,onOpenChange:e,dismissible:n=!0})=>{const[r,i]=_.useState(!1),o=s=>{n||s.preventDefault()},a=async()=>{try{await navigator.clipboard.writeText(RN),i(!0),setTimeout(()=>i(!1),1500)}catch(s){console.warn("Clipboard write failed:",s)}};return h.jsx(Hc,{open:t,onOpenChange:n?e:()=>{},children:h.jsxs(xl,{className:"bg-gray-900 border-gray-700 text-gray-300 sm:max-w-xl",hideClose:!n,onEscapeKeyDown:o,onPointerDownOutside:o,onInteractOutside:o,children:[h.jsxs(bl,{className:"text-center sm:text-center min-w-0",children:[h.jsxs(_l,{className:"text-white flex items-center justify-center gap-2 text-xl",children:[h.jsx(tX,{className:"w-6 h-6"}),"Get Started with LeLab"]}),h.jsx(wl,{children:"LeLab runs on your machine. Click the command to copy it, then paste in a terminal:"})]}),h.jsxs("div",{className:"space-y-4 py-2 min-w-0",children:[h.jsxs("button",{type:"button",onClick:a,"aria-label":"Copy command to clipboard",className:"group relative w-full bg-gray-800 hover:bg-gray-750 rounded-lg border border-gray-700 hover:border-gray-600 text-left transition-colors cursor-pointer",children:[h.jsx("pre",{className:"p-4 pr-12 text-xs sm:text-sm overflow-x-auto whitespace-pre-wrap break-all",children:h.jsx("code",{className:"text-green-400",children:RN})}),h.jsx("span",{className:"absolute right-2 top-2 flex items-center gap-1 px-2 py-1 rounded text-xs text-gray-400 group-hover:text-white bg-gray-900/80",children:r?h.jsxs(h.Fragment,{children:[h.jsx(yl,{className:"w-3.5 h-3.5 text-green-400"}),"Copied"]}):h.jsxs(h.Fragment,{children:[h.jsx(QM,{className:"w-3.5 h-3.5"}),"Copy"]})})]}),h.jsx("p",{className:"text-gray-400 text-sm text-center",children:"After running, your browser will open the local LeLab app."}),h.jsx(et,{asChild:!0,className:"w-full bg-blue-600 hover:bg-blue-700 text-white",children:h.jsxs("a",{href:UZ,target:"_blank",rel:"noopener noreferrer",children:[h.jsx(ll,{className:"w-4 h-4 mr-2"}),"Open LeLab"]})})]})]})})};async function g4(t,e,n){return er(t,e,"/datasets",{signal:n,action:"List datasets"})}const BZ=()=>{const{baseUrl:t,fetchWithHeaders:e}=Ln(),[n,r]=_.useState([]),[i,o]=_.useState(!0),a=_.useCallback(()=>{o(!0),g4(t,e).then(r).catch(()=>r([])).finally(()=>o(!1))},[t,e]);return _.useEffect(()=>{a()},[a]),{datasets:n,loading:i,refresh:a}},$Z=()=>typeof window<"u"&&window.location.hostname.endsWith(".hf.space"),NN=$Z(),zZ=()=>{const[t,e]=_.useState(NN),{auth:n}=xf(),{selectedName:r,selectedRecord:i,availableNames:o,isLoading:a,selectRobot:s,createRobot:l,deleteRobot:c}=jA(),{datasets:u,loading:d}=BZ(),[f,p]=_.useState(!1),[y,v]=_.useState(""),[g,m]=_.useState(""),[x,b]=_.useState(5),[S,w]=_.useState(60),[E,T]=_.useState(15),[A,M]=_.useState(!0),[C,P]=_.useState([]),R=_.useRef(null),D=ji(),{toast:k}=Dr();_.useEffect(()=>{C.length>0&&(R.current&&R.current(),P([]))},[]),_.useEffect(()=>()=>{R.current&&R.current()},[]);const U=()=>{P(i?[...i.cameras??[]]:[]),p(!0)},O=Y=>{p(Y),!Y&&R.current&&R.current()},W=()=>D("/training"),L=(Y,q)=>{const Q=`/spaces/lerobot/visualize_dataset?path=${encodeURIComponent(`/${Y}`)}`,te=q?`https://huggingface.co/login?next=${encodeURIComponent(Q)}`:`https://huggingface.co${Q}`;window.open(te,"_blank","noopener,noreferrer")},j=Y=>{if(Y.source==="local"||Y.source==="both"){D("/upload",{state:{datasetInfo:{dataset_repo_id:Y.repo_id,source:Y.source}}});return}L(Y.repo_id,Y.private)},X=Y=>{L(Y,!0)},K=Y=>{v(Y),U()},F=async()=>{if(!i){k({title:"No robot selected",description:"Select or create a robot on the Landing page first.",variant:"destructive"});return}const Y=i;if(!Y.is_clean){k({title:"Robot not ready",description:`${Y.name} is missing a calibration. Configure it before recording.`,variant:"destructive"});return}if(!y||!g){k({title:"Missing dataset details",description:"Please enter a dataset name and task description.",variant:"destructive"});return}const q=n.status==="authenticated"?`${n.username}/${y}`:y;C.length>0&&R.current&&(k({title:"Preparing Camera Resources",description:`Releasing ${C.length} camera stream(s) for recording...`}),R.current(),await new Promise(ee=>setTimeout(ee,500)),k({title:"Camera Resources Ready",description:"Camera streams released successfully. Starting recording..."}));const Q=C.reduce((ee,ce)=>(ee[ce.name]={type:ce.type,camera_index:ce.camera_index,width:ce.width,height:ce.height,fps:ce.fps},ee),{}),te={leader_port:Y.leader_port,follower_port:Y.follower_port,leader_config:Y.leader_config,follower_config:Y.follower_config,dataset_repo_id:q,single_task:g,num_episodes:x,episode_time_s:S,reset_time_s:E,fps:30,video:!0,push_to_hub:!1,resume:!1,streaming_encoding:A,cameras:Q};p(!1),D("/recording",{state:{recordingConfig:te}})};return h.jsxs("div",{className:"min-h-screen bg-black text-white pb-16",style:{"--lelab-topbar-h":"48px"},children:[h.jsx(Qq,{}),h.jsx("div",{className:"sticky z-20 bg-black/95 backdrop-blur supports-[backdrop-filter]:bg-black/70 border-b border-gray-800",style:{top:"var(--lelab-topbar-h)"},children:h.jsxs("div",{className:"mx-auto max-w-7xl px-4 py-4 grid gap-4 grid-cols-1 lg:grid-cols-[1.2fr_2fr]",children:[h.jsx(pJ,{selectedName:r,selectedRecord:i,availableNames:o,isLoading:a,selectRobot:s,createRobot:l,deleteRobot:c}),h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[h.jsxs("div",{className:"bg-gray-800 rounded-lg border border-gray-700 p-3 flex flex-col gap-2",children:[h.jsx("h3",{className:"font-semibold text-lg text-left h-10 flex items-center",children:"Dataset"}),h.jsx(lZ,{datasets:u,loading:d,onPickExisting:j,onOpenCustom:X,onCreateNew:K,children:h.jsxs(et,{variant:"outline",role:"combobox",className:"w-full justify-between bg-gray-800 border-gray-600 text-white hover:bg-gray-700",children:[h.jsx("span",{className:"truncate text-gray-300",children:d?"Loading datasetsโ€ฆ":"Select or create a datasetโ€ฆ"}),h.jsx(JM,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})})]}),h.jsxs("div",{className:"bg-gray-800 rounded-lg border border-gray-700 p-3 flex flex-col gap-2",children:[h.jsx("h3",{className:"font-semibold text-lg text-left h-10 flex items-center",children:"Create a model"}),h.jsx(et,{onClick:W,className:"w-full bg-green-500 hover:bg-green-600 text-white",children:"Training"})]})]})]})}),h.jsx("main",{className:"mx-auto max-w-7xl px-4 py-6",children:h.jsx(jZ,{})}),h.jsx(nK,{}),h.jsx(FZ,{open:t,onOpenChange:e,dismissible:!NN}),h.jsx(oZ,{open:f,onOpenChange:O,robot:i,datasetName:y,setDatasetName:v,singleTask:g,setSingleTask:m,numEpisodes:x,setNumEpisodes:b,episodeTimeS:S,setEpisodeTimeS:w,resetTimeS:E,setResetTimeS:T,streamingEncoding:A,setStreamingEncoding:M,cameras:C,setCameras:P,onStart:F,releaseStreamsRef:R})]})};/** + * @license + * Copyright 2010-2025 Three.js Authors + * SPDX-License-Identifier: MIT + */const UA="177",ad={ROTATE:0,DOLLY:1,PAN:2},zu={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},HZ=0,ON=1,VZ=2,v4=1,y4=2,Da=3,va=0,ui=1,Ki=2,el=0,sd=1,IN=2,DN=3,LN=4,GZ=5,Xl=100,WZ=101,XZ=102,qZ=103,KZ=104,YZ=200,JZ=201,ZZ=202,QZ=203,CE=204,PE=205,eQ=206,tQ=207,nQ=208,rQ=209,iQ=210,oQ=211,aQ=212,sQ=213,lQ=214,RE=0,NE=1,OE=2,jd=3,IE=4,DE=5,LE=6,kE=7,Dx=0,cQ=1,uQ=2,tl=0,dQ=1,fQ=2,hQ=3,pQ=4,mQ=5,gQ=6,vQ=7,kN="attached",yQ="detached",x4=300,Ud=301,Fd=302,jE=303,UE=304,Lx=306,aa=1e3,Ji=1001,Ay=1002,Xr=1003,b4=1004,Ch=1005,Or=1006,Fv=1007,Oo=1008,ya=1009,_4=1010,w4=1011,Sp=1012,FA=1013,Nc=1014,Io=1015,Nm=1016,BA=1017,$A=1018,Ep=1020,S4=35902,E4=1021,T4=1022,Zi=1023,Tp=1026,Mp=1027,zA=1028,HA=1029,M4=1030,VA=1031,GA=1033,Bv=33776,$v=33777,zv=33778,Hv=33779,FE=35840,BE=35841,$E=35842,zE=35843,HE=36196,VE=37492,GE=37496,WE=37808,XE=37809,qE=37810,KE=37811,YE=37812,JE=37813,ZE=37814,QE=37815,e1=37816,t1=37817,n1=37818,r1=37819,i1=37820,o1=37821,Vv=36492,a1=36494,s1=36495,A4=36283,l1=36284,c1=36285,u1=36286,Ap=2300,Cp=2301,H_=2302,jN=2400,UN=2401,FN=2402,xQ=2500,bQ=0,C4=1,d1=2,_Q=3200,wQ=3201,kx=0,SQ=1,Ns="",Zt="srgb",Kr="srgb-linear",Cy="linear",an="srgb",au=7680,BN=519,EQ=512,TQ=513,MQ=514,P4=515,AQ=516,CQ=517,PQ=518,RQ=519,f1=35044,$N="300 es",za=2e3,Py=2001;class Vc{addEventListener(e,n){this._listeners===void 0&&(this._listeners={});const r=this._listeners;r[e]===void 0&&(r[e]=[]),r[e].indexOf(n)===-1&&r[e].push(n)}hasEventListener(e,n){const r=this._listeners;return r===void 0?!1:r[e]!==void 0&&r[e].indexOf(n)!==-1}removeEventListener(e,n){const r=this._listeners;if(r===void 0)return;const i=r[e];if(i!==void 0){const o=i.indexOf(n);o!==-1&&i.splice(o,1)}}dispatchEvent(e){const n=this._listeners;if(n===void 0)return;const r=n[e.type];if(r!==void 0){e.target=this;const i=r.slice(0);for(let o=0,a=i.length;o>8&255]+Mr[t>>16&255]+Mr[t>>24&255]+"-"+Mr[e&255]+Mr[e>>8&255]+"-"+Mr[e>>16&15|64]+Mr[e>>24&255]+"-"+Mr[n&63|128]+Mr[n>>8&255]+"-"+Mr[n>>16&255]+Mr[n>>24&255]+Mr[r&255]+Mr[r>>8&255]+Mr[r>>16&255]+Mr[r>>24&255]).toLowerCase()}function It(t,e,n){return Math.max(e,Math.min(n,t))}function WA(t,e){return(t%e+e)%e}function NQ(t,e,n,r,i){return r+(t-e)*(i-r)/(n-e)}function OQ(t,e,n){return t!==e?(n-t)/(e-t):0}function Wh(t,e,n){return(1-n)*t+n*e}function IQ(t,e,n,r){return Wh(t,e,1-Math.exp(-n*r))}function DQ(t,e=1){return e-Math.abs(WA(t,e*2)-e)}function LQ(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*(3-2*t))}function kQ(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*t*(t*(t*6-15)+10))}function jQ(t,e){return t+Math.floor(Math.random()*(e-t+1))}function UQ(t,e){return t+Math.random()*(e-t)}function FQ(t){return t*(.5-Math.random())}function BQ(t){t!==void 0&&(zN=t);let e=zN+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function $Q(t){return t*Gh}function zQ(t){return t*Bd}function HQ(t){return(t&t-1)===0&&t!==0}function VQ(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function GQ(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function WQ(t,e,n,r,i){const o=Math.cos,a=Math.sin,s=o(n/2),l=a(n/2),c=o((e+r)/2),u=a((e+r)/2),d=o((e-r)/2),f=a((e-r)/2),p=o((r-e)/2),y=a((r-e)/2);switch(i){case"XYX":t.set(s*u,l*d,l*f,s*c);break;case"YZY":t.set(l*f,s*u,l*d,s*c);break;case"ZXZ":t.set(l*d,l*f,s*u,s*c);break;case"XZX":t.set(s*u,l*y,l*p,s*c);break;case"YXY":t.set(l*p,s*u,l*y,s*c);break;case"ZYZ":t.set(l*y,l*p,s*u,s*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Po(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function tn(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(t*4294967295);case Uint16Array:return Math.round(t*65535);case Uint8Array:return Math.round(t*255);case Int32Array:return Math.round(t*2147483647);case Int16Array:return Math.round(t*32767);case Int8Array:return Math.round(t*127);default:throw new Error("Invalid component type.")}}const ql={DEG2RAD:Gh,RAD2DEG:Bd,generateUUID:Uo,clamp:It,euclideanModulo:WA,mapLinear:NQ,inverseLerp:OQ,lerp:Wh,damp:IQ,pingpong:DQ,smoothstep:LQ,smootherstep:kQ,randInt:jQ,randFloat:UQ,randFloatSpread:FQ,seededRandom:BQ,degToRad:$Q,radToDeg:zQ,isPowerOfTwo:HQ,ceilPowerOfTwo:VQ,floorPowerOfTwo:GQ,setQuaternionFromProperEuler:WQ,normalize:tn,denormalize:Po};class xt{constructor(e=0,n=0){xt.prototype.isVector2=!0,this.x=e,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,n){return this.x=e,this.y=n,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const n=this.x,r=this.y,i=e.elements;return this.x=i[0]*n+i[3]*r+i[6],this.y=i[1]*n+i[4]*r+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,n){return this.x=It(this.x,e.x,n.x),this.y=It(this.y,e.y,n.y),this}clampScalar(e,n){return this.x=It(this.x,e,n),this.y=It(this.y,e,n),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(It(r,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const r=this.dot(e)/n;return Math.acos(It(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y;return n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this}rotateAround(e,n){const r=Math.cos(n),i=Math.sin(n),o=this.x-e.x,a=this.y-e.y;return this.x=o*r-a*i+e.x,this.y=o*i+a*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Ii{constructor(e=0,n=0,r=0,i=1){this.isQuaternion=!0,this._x=e,this._y=n,this._z=r,this._w=i}static slerpFlat(e,n,r,i,o,a,s){let l=r[i+0],c=r[i+1],u=r[i+2],d=r[i+3];const f=o[a+0],p=o[a+1],y=o[a+2],v=o[a+3];if(s===0){e[n+0]=l,e[n+1]=c,e[n+2]=u,e[n+3]=d;return}if(s===1){e[n+0]=f,e[n+1]=p,e[n+2]=y,e[n+3]=v;return}if(d!==v||l!==f||c!==p||u!==y){let g=1-s;const m=l*f+c*p+u*y+d*v,x=m>=0?1:-1,b=1-m*m;if(b>Number.EPSILON){const w=Math.sqrt(b),E=Math.atan2(w,m*x);g=Math.sin(g*E)/w,s=Math.sin(s*E)/w}const S=s*x;if(l=l*g+f*S,c=c*g+p*S,u=u*g+y*S,d=d*g+v*S,g===1-s){const w=1/Math.sqrt(l*l+c*c+u*u+d*d);l*=w,c*=w,u*=w,d*=w}}e[n]=l,e[n+1]=c,e[n+2]=u,e[n+3]=d}static multiplyQuaternionsFlat(e,n,r,i,o,a){const s=r[i],l=r[i+1],c=r[i+2],u=r[i+3],d=o[a],f=o[a+1],p=o[a+2],y=o[a+3];return e[n]=s*y+u*d+l*p-c*f,e[n+1]=l*y+u*f+c*d-s*p,e[n+2]=c*y+u*p+s*f-l*d,e[n+3]=u*y-s*d-l*f-c*p,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,n,r,i){return this._x=e,this._y=n,this._z=r,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,n=!0){const r=e._x,i=e._y,o=e._z,a=e._order,s=Math.cos,l=Math.sin,c=s(r/2),u=s(i/2),d=s(o/2),f=l(r/2),p=l(i/2),y=l(o/2);switch(a){case"XYZ":this._x=f*u*d+c*p*y,this._y=c*p*d-f*u*y,this._z=c*u*y+f*p*d,this._w=c*u*d-f*p*y;break;case"YXZ":this._x=f*u*d+c*p*y,this._y=c*p*d-f*u*y,this._z=c*u*y-f*p*d,this._w=c*u*d+f*p*y;break;case"ZXY":this._x=f*u*d-c*p*y,this._y=c*p*d+f*u*y,this._z=c*u*y+f*p*d,this._w=c*u*d-f*p*y;break;case"ZYX":this._x=f*u*d-c*p*y,this._y=c*p*d+f*u*y,this._z=c*u*y-f*p*d,this._w=c*u*d+f*p*y;break;case"YZX":this._x=f*u*d+c*p*y,this._y=c*p*d+f*u*y,this._z=c*u*y-f*p*d,this._w=c*u*d-f*p*y;break;case"XZY":this._x=f*u*d-c*p*y,this._y=c*p*d-f*u*y,this._z=c*u*y+f*p*d,this._w=c*u*d+f*p*y;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return n===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,n){const r=n/2,i=Math.sin(r);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(e){const n=e.elements,r=n[0],i=n[4],o=n[8],a=n[1],s=n[5],l=n[9],c=n[2],u=n[6],d=n[10],f=r+s+d;if(f>0){const p=.5/Math.sqrt(f+1);this._w=.25/p,this._x=(u-l)*p,this._y=(o-c)*p,this._z=(a-i)*p}else if(r>s&&r>d){const p=2*Math.sqrt(1+r-s-d);this._w=(u-l)/p,this._x=.25*p,this._y=(i+a)/p,this._z=(o+c)/p}else if(s>d){const p=2*Math.sqrt(1+s-r-d);this._w=(o-c)/p,this._x=(i+a)/p,this._y=.25*p,this._z=(l+u)/p}else{const p=2*Math.sqrt(1+d-r-s);this._w=(a-i)/p,this._x=(o+c)/p,this._y=(l+u)/p,this._z=.25*p}return this._onChangeCallback(),this}setFromUnitVectors(e,n){let r=e.dot(n)+1;return rMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=r):(this._x=0,this._y=-e.z,this._z=e.y,this._w=r)):(this._x=e.y*n.z-e.z*n.y,this._y=e.z*n.x-e.x*n.z,this._z=e.x*n.y-e.y*n.x,this._w=r),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(It(this.dot(e),-1,1)))}rotateTowards(e,n){const r=this.angleTo(e);if(r===0)return this;const i=Math.min(1,n/r);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,n){const r=e._x,i=e._y,o=e._z,a=e._w,s=n._x,l=n._y,c=n._z,u=n._w;return this._x=r*u+a*s+i*c-o*l,this._y=i*u+a*l+o*s-r*c,this._z=o*u+a*c+r*l-i*s,this._w=a*u-r*s-i*l-o*c,this._onChangeCallback(),this}slerp(e,n){if(n===0)return this;if(n===1)return this.copy(e);const r=this._x,i=this._y,o=this._z,a=this._w;let s=a*e._w+r*e._x+i*e._y+o*e._z;if(s<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,s=-s):this.copy(e),s>=1)return this._w=a,this._x=r,this._y=i,this._z=o,this;const l=1-s*s;if(l<=Number.EPSILON){const p=1-n;return this._w=p*a+n*this._w,this._x=p*r+n*this._x,this._y=p*i+n*this._y,this._z=p*o+n*this._z,this.normalize(),this}const c=Math.sqrt(l),u=Math.atan2(c,s),d=Math.sin((1-n)*u)/c,f=Math.sin(n*u)/c;return this._w=a*d+this._w*f,this._x=r*d+this._x*f,this._y=i*d+this._y*f,this._z=o*d+this._z*f,this._onChangeCallback(),this}slerpQuaternions(e,n,r){return this.copy(e).slerp(n,r)}random(){const e=2*Math.PI*Math.random(),n=2*Math.PI*Math.random(),r=Math.random(),i=Math.sqrt(1-r),o=Math.sqrt(r);return this.set(i*Math.sin(e),i*Math.cos(e),o*Math.sin(n),o*Math.cos(n))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,n=0){return this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._w,e}fromBufferAttribute(e,n){return this._x=e.getX(n),this._y=e.getY(n),this._z=e.getZ(n),this._w=e.getW(n),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class ne{constructor(e=0,n=0,r=0){ne.prototype.isVector3=!0,this.x=e,this.y=n,this.z=r}set(e,n,r){return r===void 0&&(r=this.z),this.x=e,this.y=n,this.z=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,n){return this.x=e.x*n.x,this.y=e.y*n.y,this.z=e.z*n.z,this}applyEuler(e){return this.applyQuaternion(HN.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(HN.setFromAxisAngle(e,n))}applyMatrix3(e){const n=this.x,r=this.y,i=this.z,o=e.elements;return this.x=o[0]*n+o[3]*r+o[6]*i,this.y=o[1]*n+o[4]*r+o[7]*i,this.z=o[2]*n+o[5]*r+o[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const n=this.x,r=this.y,i=this.z,o=e.elements,a=1/(o[3]*n+o[7]*r+o[11]*i+o[15]);return this.x=(o[0]*n+o[4]*r+o[8]*i+o[12])*a,this.y=(o[1]*n+o[5]*r+o[9]*i+o[13])*a,this.z=(o[2]*n+o[6]*r+o[10]*i+o[14])*a,this}applyQuaternion(e){const n=this.x,r=this.y,i=this.z,o=e.x,a=e.y,s=e.z,l=e.w,c=2*(a*i-s*r),u=2*(s*n-o*i),d=2*(o*r-a*n);return this.x=n+l*c+a*d-s*u,this.y=r+l*u+s*c-o*d,this.z=i+l*d+o*u-a*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const n=this.x,r=this.y,i=this.z,o=e.elements;return this.x=o[0]*n+o[4]*r+o[8]*i,this.y=o[1]*n+o[5]*r+o[9]*i,this.z=o[2]*n+o[6]*r+o[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,n){return this.x=It(this.x,e.x,n.x),this.y=It(this.y,e.y,n.y),this.z=It(this.z,e.z,n.z),this}clampScalar(e,n){return this.x=It(this.x,e,n),this.y=It(this.y,e,n),this.z=It(this.z,e,n),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(It(r,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this.z=e.z+(n.z-e.z)*r,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,n){const r=e.x,i=e.y,o=e.z,a=n.x,s=n.y,l=n.z;return this.x=i*l-o*s,this.y=o*a-r*l,this.z=r*s-i*a,this}projectOnVector(e){const n=e.lengthSq();if(n===0)return this.set(0,0,0);const r=e.dot(this)/n;return this.copy(e).multiplyScalar(r)}projectOnPlane(e){return V_.copy(this).projectOnVector(e),this.sub(V_)}reflect(e){return this.sub(V_.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const r=this.dot(e)/n;return Math.acos(It(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y,i=this.z-e.z;return n*n+r*r+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,n,r){const i=Math.sin(n)*e;return this.x=i*Math.sin(r),this.y=Math.cos(n)*e,this.z=i*Math.cos(r),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,n,r){return this.x=e*Math.sin(n),this.y=r,this.z=e*Math.cos(n),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(e){const n=this.setFromMatrixColumn(e,0).length(),r=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=n,this.y=r,this.z=i,this}setFromMatrixColumn(e,n){return this.fromArray(e.elements,n*4)}setFromMatrix3Column(e,n){return this.fromArray(e.elements,n*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,n=Math.random()*2-1,r=Math.sqrt(1-n*n);return this.x=r*Math.cos(e),this.y=n,this.z=r*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const V_=new ne,HN=new Ii;class Pt{constructor(e,n,r,i,o,a,s,l,c){Pt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,n,r,i,o,a,s,l,c)}set(e,n,r,i,o,a,s,l,c){const u=this.elements;return u[0]=e,u[1]=i,u[2]=s,u[3]=n,u[4]=o,u[5]=l,u[6]=r,u[7]=a,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const n=this.elements,r=e.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],this}extractBasis(e,n,r){return e.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const n=e.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const r=e.elements,i=n.elements,o=this.elements,a=r[0],s=r[3],l=r[6],c=r[1],u=r[4],d=r[7],f=r[2],p=r[5],y=r[8],v=i[0],g=i[3],m=i[6],x=i[1],b=i[4],S=i[7],w=i[2],E=i[5],T=i[8];return o[0]=a*v+s*x+l*w,o[3]=a*g+s*b+l*E,o[6]=a*m+s*S+l*T,o[1]=c*v+u*x+d*w,o[4]=c*g+u*b+d*E,o[7]=c*m+u*S+d*T,o[2]=f*v+p*x+y*w,o[5]=f*g+p*b+y*E,o[8]=f*m+p*S+y*T,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=e,n[4]*=e,n[7]*=e,n[2]*=e,n[5]*=e,n[8]*=e,this}determinant(){const e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],u=e[8];return n*a*u-n*s*c-r*o*u+r*s*l+i*o*c-i*a*l}invert(){const e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],u=e[8],d=u*a-s*c,f=s*l-u*o,p=c*o-a*l,y=n*d+r*f+i*p;if(y===0)return this.set(0,0,0,0,0,0,0,0,0);const v=1/y;return e[0]=d*v,e[1]=(i*c-u*r)*v,e[2]=(s*r-i*a)*v,e[3]=f*v,e[4]=(u*n-i*l)*v,e[5]=(i*o-s*n)*v,e[6]=p*v,e[7]=(r*l-c*n)*v,e[8]=(a*n-r*o)*v,this}transpose(){let e;const n=this.elements;return e=n[1],n[1]=n[3],n[3]=e,e=n[2],n[2]=n[6],n[6]=e,e=n[5],n[5]=n[7],n[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const n=this.elements;return e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],this}setUvTransform(e,n,r,i,o,a,s){const l=Math.cos(o),c=Math.sin(o);return this.set(r*l,r*c,-r*(l*a+c*s)+a+e,-i*c,i*l,-i*(-c*a+l*s)+s+n,0,0,1),this}scale(e,n){return this.premultiply(G_.makeScale(e,n)),this}rotate(e){return this.premultiply(G_.makeRotation(-e)),this}translate(e,n){return this.premultiply(G_.makeTranslation(e,n)),this}makeTranslation(e,n){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,n,0,0,1),this}makeRotation(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,-r,0,r,n,0,0,0,1),this}makeScale(e,n){return this.set(e,0,0,0,n,0,0,0,1),this}equals(e){const n=this.elements,r=e.elements;for(let i=0;i<9;i++)if(n[i]!==r[i])return!1;return!0}fromArray(e,n=0){for(let r=0;r<9;r++)this.elements[r]=e[r+n];return this}toArray(e=[],n=0){const r=this.elements;return e[n]=r[0],e[n+1]=r[1],e[n+2]=r[2],e[n+3]=r[3],e[n+4]=r[4],e[n+5]=r[5],e[n+6]=r[6],e[n+7]=r[7],e[n+8]=r[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const G_=new Pt;function R4(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}function Pp(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function XQ(){const t=Pp("canvas");return t.style.display="block",t}const VN={};function ld(t){t in VN||(VN[t]=!0,console.warn(t))}function qQ(t,e,n){return new Promise(function(r,i){function o(){switch(t.clientWaitSync(e,t.SYNC_FLUSH_COMMANDS_BIT,0)){case t.WAIT_FAILED:i();break;case t.TIMEOUT_EXPIRED:setTimeout(o,n);break;default:r()}}setTimeout(o,n)})}function KQ(t){const e=t.elements;e[2]=.5*e[2]+.5*e[3],e[6]=.5*e[6]+.5*e[7],e[10]=.5*e[10]+.5*e[11],e[14]=.5*e[14]+.5*e[15]}function YQ(t){const e=t.elements;e[11]===-1?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=-e[14]+1)}const GN=new Pt().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),WN=new Pt().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function JQ(){const t={enabled:!0,workingColorSpace:Kr,spaces:{},convert:function(i,o,a){return this.enabled===!1||o===a||!o||!a||(this.spaces[o].transfer===an&&(i.r=qa(i.r),i.g=qa(i.g),i.b=qa(i.b)),this.spaces[o].primaries!==this.spaces[a].primaries&&(i.applyMatrix3(this.spaces[o].toXYZ),i.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===an&&(i.r=cd(i.r),i.g=cd(i.g),i.b=cd(i.b))),i},workingToColorSpace:function(i,o){return this.convert(i,this.workingColorSpace,o)},colorSpaceToWorking:function(i,o){return this.convert(i,o,this.workingColorSpace)},getPrimaries:function(i){return this.spaces[i].primaries},getTransfer:function(i){return i===Ns?Cy:this.spaces[i].transfer},getLuminanceCoefficients:function(i,o=this.workingColorSpace){return i.fromArray(this.spaces[o].luminanceCoefficients)},define:function(i){Object.assign(this.spaces,i)},_getMatrix:function(i,o,a){return i.copy(this.spaces[o].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(i){return this.spaces[i].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(i=this.workingColorSpace){return this.spaces[i].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(i,o){return ld("THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),t.workingToColorSpace(i,o)},toWorkingColorSpace:function(i,o){return ld("THREE.ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),t.colorSpaceToWorking(i,o)}},e=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],r=[.3127,.329];return t.define({[Kr]:{primaries:e,whitePoint:r,transfer:Cy,toXYZ:GN,fromXYZ:WN,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:Zt},outputColorSpaceConfig:{drawingBufferColorSpace:Zt}},[Zt]:{primaries:e,whitePoint:r,transfer:an,toXYZ:GN,fromXYZ:WN,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:Zt}}}),t}const Dt=JQ();function qa(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function cd(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}let su;class ZQ{static getDataURL(e,n="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let r;if(e instanceof HTMLCanvasElement)r=e;else{su===void 0&&(su=Pp("canvas")),su.width=e.width,su.height=e.height;const i=su.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),r=su}return r.toDataURL(n)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const n=Pp("canvas");n.width=e.width,n.height=e.height;const r=n.getContext("2d");r.drawImage(e,0,0,e.width,e.height);const i=r.getImageData(0,0,e.width,e.height),o=i.data;for(let a=0;a1),this.pmremVersion=0}get width(){return this.source.getSize(X_).x}get height(){return this.source.getSize(X_).y}get depth(){return this.source.getSize(X_).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const n in e){const r=e[n];if(r===void 0){console.warn(`THREE.Texture.setValues(): parameter '${n}' has value of undefined.`);continue}const i=this[n];if(i===void 0){console.warn(`THREE.Texture.setValues(): property '${n}' does not exist.`);continue}i&&r&&i.isVector2&&r.isVector2||i&&r&&i.isVector3&&r.isVector3||i&&r&&i.isMatrix3&&r.isMatrix3?i.copy(r):this[n]=r}}toJSON(e){const n=e===void 0||typeof e=="string";if(!n&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const r={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(r.userData=this.userData),n||(e.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==x4)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case aa:e.x=e.x-Math.floor(e.x);break;case Ji:e.x=e.x<0?0:1;break;case Ay:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case aa:e.y=e.y-Math.floor(e.y);break;case Ji:e.y=e.y<0?0:1;break;case Ay:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}lr.DEFAULT_IMAGE=null;lr.DEFAULT_MAPPING=x4;lr.DEFAULT_ANISOTROPY=1;class Yt{constructor(e=0,n=0,r=0,i=1){Yt.prototype.isVector4=!0,this.x=e,this.y=n,this.z=r,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,n,r,i){return this.x=e,this.y=n,this.z=r,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this.w=e.w+n.w,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this.w+=e.w*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this.w=e.w-n.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const n=this.x,r=this.y,i=this.z,o=this.w,a=e.elements;return this.x=a[0]*n+a[4]*r+a[8]*i+a[12]*o,this.y=a[1]*n+a[5]*r+a[9]*i+a[13]*o,this.z=a[2]*n+a[6]*r+a[10]*i+a[14]*o,this.w=a[3]*n+a[7]*r+a[11]*i+a[15]*o,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const n=Math.sqrt(1-e.w*e.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/n,this.y=e.y/n,this.z=e.z/n),this}setAxisAngleFromRotationMatrix(e){let n,r,i,o;const l=e.elements,c=l[0],u=l[4],d=l[8],f=l[1],p=l[5],y=l[9],v=l[2],g=l[6],m=l[10];if(Math.abs(u-f)<.01&&Math.abs(d-v)<.01&&Math.abs(y-g)<.01){if(Math.abs(u+f)<.1&&Math.abs(d+v)<.1&&Math.abs(y+g)<.1&&Math.abs(c+p+m-3)<.1)return this.set(1,0,0,0),this;n=Math.PI;const b=(c+1)/2,S=(p+1)/2,w=(m+1)/2,E=(u+f)/4,T=(d+v)/4,A=(y+g)/4;return b>S&&b>w?b<.01?(r=0,i=.707106781,o=.707106781):(r=Math.sqrt(b),i=E/r,o=T/r):S>w?S<.01?(r=.707106781,i=0,o=.707106781):(i=Math.sqrt(S),r=E/i,o=A/i):w<.01?(r=.707106781,i=.707106781,o=0):(o=Math.sqrt(w),r=T/o,i=A/o),this.set(r,i,o,n),this}let x=Math.sqrt((g-y)*(g-y)+(d-v)*(d-v)+(f-u)*(f-u));return Math.abs(x)<.001&&(x=1),this.x=(g-y)/x,this.y=(d-v)/x,this.z=(f-u)/x,this.w=Math.acos((c+p+m-1)/2),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this.w=n[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,n){return this.x=It(this.x,e.x,n.x),this.y=It(this.y,e.y,n.y),this.z=It(this.z,e.z,n.z),this.w=It(this.w,e.w,n.w),this}clampScalar(e,n){return this.x=It(this.x,e,n),this.y=It(this.y,e,n),this.z=It(this.z,e,n),this.w=It(this.w,e,n),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(It(r,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this.w+=(e.w-this.w)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this.z=e.z+(n.z-e.z)*r,this.w=e.w+(n.w-e.w)*r,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this.w=e[n+3],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e[n+3]=this.w,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this.w=e.getW(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class tee extends Vc{constructor(e=1,n=1,r={}){super(),r=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Or,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},r),this.isRenderTarget=!0,this.width=e,this.height=n,this.depth=r.depth,this.scissor=new Yt(0,0,e,n),this.scissorTest=!1,this.viewport=new Yt(0,0,e,n);const i={width:e,height:n,depth:r.depth},o=new lr(i);this.textures=[];const a=r.count;for(let s=0;s1;this.dispose()}this.viewport.set(0,0,e,n),this.scissor.set(0,0,e,n)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let n=0,r=e.textures.length;n=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,n){return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,fo),fo.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let n,r;return e.normal.x>0?(n=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(n=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(n+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(n+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(n+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(n+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),n<=-e.constant&&r>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(nh),Cg.subVectors(this.max,nh),lu.subVectors(e.a,nh),cu.subVectors(e.b,nh),uu.subVectors(e.c,nh),gs.subVectors(cu,lu),vs.subVectors(uu,cu),Ol.subVectors(lu,uu);let n=[0,-gs.z,gs.y,0,-vs.z,vs.y,0,-Ol.z,Ol.y,gs.z,0,-gs.x,vs.z,0,-vs.x,Ol.z,0,-Ol.x,-gs.y,gs.x,0,-vs.y,vs.x,0,-Ol.y,Ol.x,0];return!q_(n,lu,cu,uu,Cg)||(n=[1,0,0,0,1,0,0,0,1],!q_(n,lu,cu,uu,Cg))?!1:(Pg.crossVectors(gs,vs),n=[Pg.x,Pg.y,Pg.z],q_(n,lu,cu,uu,Cg))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,fo).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(fo).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Ma[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Ma[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Ma[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Ma[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Ma[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Ma[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Ma[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Ma[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Ma),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const Ma=[new ne,new ne,new ne,new ne,new ne,new ne,new ne,new ne],fo=new ne,Ag=new Wo,lu=new ne,cu=new ne,uu=new ne,gs=new ne,vs=new ne,Ol=new ne,nh=new ne,Cg=new ne,Pg=new ne,Il=new ne;function q_(t,e,n,r,i){for(let o=0,a=t.length-3;o<=a;o+=3){Il.fromArray(t,o);const s=i.x*Math.abs(Il.x)+i.y*Math.abs(Il.y)+i.z*Math.abs(Il.z),l=e.dot(Il),c=n.dot(Il),u=r.dot(Il);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>s)return!1}return!0}const ree=new Wo,rh=new ne,K_=new ne;class Xo{constructor(e=new ne,n=-1){this.isSphere=!0,this.center=e,this.radius=n}set(e,n){return this.center.copy(e),this.radius=n,this}setFromPoints(e,n){const r=this.center;n!==void 0?r.copy(n):ree.setFromPoints(e).getCenter(r);let i=0;for(let o=0,a=e.length;othis.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;rh.subVectors(e,this.center);const n=rh.lengthSq();if(n>this.radius*this.radius){const r=Math.sqrt(n),i=(r-this.radius)*.5;this.center.addScaledVector(rh,i/r),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(K_.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(rh.copy(e.center).add(K_)),this.expandByPoint(rh.copy(e.center).sub(K_))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}const Aa=new ne,Y_=new ne,Rg=new ne,ys=new ne,J_=new ne,Ng=new ne,Z_=new ne;class Sf{constructor(e=new ne,n=new ne(0,0,-1)){this.origin=e,this.direction=n}set(e,n){return this.origin.copy(e),this.direction.copy(n),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,n){return n.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Aa)),this}closestPointToPoint(e,n){n.subVectors(e,this.origin);const r=n.dot(this.direction);return r<0?n.copy(this.origin):n.copy(this.origin).addScaledVector(this.direction,r)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const n=Aa.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(Aa.copy(this.origin).addScaledVector(this.direction,n),Aa.distanceToSquared(e))}distanceSqToSegment(e,n,r,i){Y_.copy(e).add(n).multiplyScalar(.5),Rg.copy(n).sub(e).normalize(),ys.copy(this.origin).sub(Y_);const o=e.distanceTo(n)*.5,a=-this.direction.dot(Rg),s=ys.dot(this.direction),l=-ys.dot(Rg),c=ys.lengthSq(),u=Math.abs(1-a*a);let d,f,p,y;if(u>0)if(d=a*l-s,f=a*s-l,y=o*u,d>=0)if(f>=-y)if(f<=y){const v=1/u;d*=v,f*=v,p=d*(d+a*f+2*s)+f*(a*d+f+2*l)+c}else f=o,d=Math.max(0,-(a*f+s)),p=-d*d+f*(f+2*l)+c;else f=-o,d=Math.max(0,-(a*f+s)),p=-d*d+f*(f+2*l)+c;else f<=-y?(d=Math.max(0,-(-a*o+s)),f=d>0?-o:Math.min(Math.max(-o,-l),o),p=-d*d+f*(f+2*l)+c):f<=y?(d=0,f=Math.min(Math.max(-o,-l),o),p=f*(f+2*l)+c):(d=Math.max(0,-(a*o+s)),f=d>0?o:Math.min(Math.max(-o,-l),o),p=-d*d+f*(f+2*l)+c);else f=a>0?-o:o,d=Math.max(0,-(a*f+s)),p=-d*d+f*(f+2*l)+c;return r&&r.copy(this.origin).addScaledVector(this.direction,d),i&&i.copy(Y_).addScaledVector(Rg,f),p}intersectSphere(e,n){Aa.subVectors(e.center,this.origin);const r=Aa.dot(this.direction),i=Aa.dot(Aa)-r*r,o=e.radius*e.radius;if(i>o)return null;const a=Math.sqrt(o-i),s=r-a,l=r+a;return l<0?null:s<0?this.at(l,n):this.at(s,n)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const n=e.normal.dot(this.direction);if(n===0)return e.distanceToPoint(this.origin)===0?0:null;const r=-(this.origin.dot(e.normal)+e.constant)/n;return r>=0?r:null}intersectPlane(e,n){const r=this.distanceToPlane(e);return r===null?null:this.at(r,n)}intersectsPlane(e){const n=e.distanceToPoint(this.origin);return n===0||e.normal.dot(this.direction)*n<0}intersectBox(e,n){let r,i,o,a,s,l;const c=1/this.direction.x,u=1/this.direction.y,d=1/this.direction.z,f=this.origin;return c>=0?(r=(e.min.x-f.x)*c,i=(e.max.x-f.x)*c):(r=(e.max.x-f.x)*c,i=(e.min.x-f.x)*c),u>=0?(o=(e.min.y-f.y)*u,a=(e.max.y-f.y)*u):(o=(e.max.y-f.y)*u,a=(e.min.y-f.y)*u),r>a||o>i||((o>r||isNaN(r))&&(r=o),(a=0?(s=(e.min.z-f.z)*d,l=(e.max.z-f.z)*d):(s=(e.max.z-f.z)*d,l=(e.min.z-f.z)*d),r>l||s>i)||((s>r||r!==r)&&(r=s),(l=0?r:i,n)}intersectsBox(e){return this.intersectBox(e,Aa)!==null}intersectTriangle(e,n,r,i,o){J_.subVectors(n,e),Ng.subVectors(r,e),Z_.crossVectors(J_,Ng);let a=this.direction.dot(Z_),s;if(a>0){if(i)return null;s=1}else if(a<0)s=-1,a=-a;else return null;ys.subVectors(this.origin,e);const l=s*this.direction.dot(Ng.crossVectors(ys,Ng));if(l<0)return null;const c=s*this.direction.dot(J_.cross(ys));if(c<0||l+c>a)return null;const u=-s*ys.dot(Z_);return u<0?null:this.at(u/a,o)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class gt{constructor(e,n,r,i,o,a,s,l,c,u,d,f,p,y,v,g){gt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,n,r,i,o,a,s,l,c,u,d,f,p,y,v,g)}set(e,n,r,i,o,a,s,l,c,u,d,f,p,y,v,g){const m=this.elements;return m[0]=e,m[4]=n,m[8]=r,m[12]=i,m[1]=o,m[5]=a,m[9]=s,m[13]=l,m[2]=c,m[6]=u,m[10]=d,m[14]=f,m[3]=p,m[7]=y,m[11]=v,m[15]=g,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new gt().fromArray(this.elements)}copy(e){const n=this.elements,r=e.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],n[9]=r[9],n[10]=r[10],n[11]=r[11],n[12]=r[12],n[13]=r[13],n[14]=r[14],n[15]=r[15],this}copyPosition(e){const n=this.elements,r=e.elements;return n[12]=r[12],n[13]=r[13],n[14]=r[14],this}setFromMatrix3(e){const n=e.elements;return this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1),this}extractBasis(e,n,r){return e.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}makeBasis(e,n,r){return this.set(e.x,n.x,r.x,0,e.y,n.y,r.y,0,e.z,n.z,r.z,0,0,0,0,1),this}extractRotation(e){const n=this.elements,r=e.elements,i=1/du.setFromMatrixColumn(e,0).length(),o=1/du.setFromMatrixColumn(e,1).length(),a=1/du.setFromMatrixColumn(e,2).length();return n[0]=r[0]*i,n[1]=r[1]*i,n[2]=r[2]*i,n[3]=0,n[4]=r[4]*o,n[5]=r[5]*o,n[6]=r[6]*o,n[7]=0,n[8]=r[8]*a,n[9]=r[9]*a,n[10]=r[10]*a,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromEuler(e){const n=this.elements,r=e.x,i=e.y,o=e.z,a=Math.cos(r),s=Math.sin(r),l=Math.cos(i),c=Math.sin(i),u=Math.cos(o),d=Math.sin(o);if(e.order==="XYZ"){const f=a*u,p=a*d,y=s*u,v=s*d;n[0]=l*u,n[4]=-l*d,n[8]=c,n[1]=p+y*c,n[5]=f-v*c,n[9]=-s*l,n[2]=v-f*c,n[6]=y+p*c,n[10]=a*l}else if(e.order==="YXZ"){const f=l*u,p=l*d,y=c*u,v=c*d;n[0]=f+v*s,n[4]=y*s-p,n[8]=a*c,n[1]=a*d,n[5]=a*u,n[9]=-s,n[2]=p*s-y,n[6]=v+f*s,n[10]=a*l}else if(e.order==="ZXY"){const f=l*u,p=l*d,y=c*u,v=c*d;n[0]=f-v*s,n[4]=-a*d,n[8]=y+p*s,n[1]=p+y*s,n[5]=a*u,n[9]=v-f*s,n[2]=-a*c,n[6]=s,n[10]=a*l}else if(e.order==="ZYX"){const f=a*u,p=a*d,y=s*u,v=s*d;n[0]=l*u,n[4]=y*c-p,n[8]=f*c+v,n[1]=l*d,n[5]=v*c+f,n[9]=p*c-y,n[2]=-c,n[6]=s*l,n[10]=a*l}else if(e.order==="YZX"){const f=a*l,p=a*c,y=s*l,v=s*c;n[0]=l*u,n[4]=v-f*d,n[8]=y*d+p,n[1]=d,n[5]=a*u,n[9]=-s*u,n[2]=-c*u,n[6]=p*d+y,n[10]=f-v*d}else if(e.order==="XZY"){const f=a*l,p=a*c,y=s*l,v=s*c;n[0]=l*u,n[4]=-d,n[8]=c*u,n[1]=f*d+v,n[5]=a*u,n[9]=p*d-y,n[2]=y*d-p,n[6]=s*u,n[10]=v*d+f}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromQuaternion(e){return this.compose(iee,e,oee)}lookAt(e,n,r){const i=this.elements;return xi.subVectors(e,n),xi.lengthSq()===0&&(xi.z=1),xi.normalize(),xs.crossVectors(r,xi),xs.lengthSq()===0&&(Math.abs(r.z)===1?xi.x+=1e-4:xi.z+=1e-4,xi.normalize(),xs.crossVectors(r,xi)),xs.normalize(),Og.crossVectors(xi,xs),i[0]=xs.x,i[4]=Og.x,i[8]=xi.x,i[1]=xs.y,i[5]=Og.y,i[9]=xi.y,i[2]=xs.z,i[6]=Og.z,i[10]=xi.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const r=e.elements,i=n.elements,o=this.elements,a=r[0],s=r[4],l=r[8],c=r[12],u=r[1],d=r[5],f=r[9],p=r[13],y=r[2],v=r[6],g=r[10],m=r[14],x=r[3],b=r[7],S=r[11],w=r[15],E=i[0],T=i[4],A=i[8],M=i[12],C=i[1],P=i[5],R=i[9],D=i[13],k=i[2],U=i[6],O=i[10],W=i[14],L=i[3],j=i[7],X=i[11],K=i[15];return o[0]=a*E+s*C+l*k+c*L,o[4]=a*T+s*P+l*U+c*j,o[8]=a*A+s*R+l*O+c*X,o[12]=a*M+s*D+l*W+c*K,o[1]=u*E+d*C+f*k+p*L,o[5]=u*T+d*P+f*U+p*j,o[9]=u*A+d*R+f*O+p*X,o[13]=u*M+d*D+f*W+p*K,o[2]=y*E+v*C+g*k+m*L,o[6]=y*T+v*P+g*U+m*j,o[10]=y*A+v*R+g*O+m*X,o[14]=y*M+v*D+g*W+m*K,o[3]=x*E+b*C+S*k+w*L,o[7]=x*T+b*P+S*U+w*j,o[11]=x*A+b*R+S*O+w*X,o[15]=x*M+b*D+S*W+w*K,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[4]*=e,n[8]*=e,n[12]*=e,n[1]*=e,n[5]*=e,n[9]*=e,n[13]*=e,n[2]*=e,n[6]*=e,n[10]*=e,n[14]*=e,n[3]*=e,n[7]*=e,n[11]*=e,n[15]*=e,this}determinant(){const e=this.elements,n=e[0],r=e[4],i=e[8],o=e[12],a=e[1],s=e[5],l=e[9],c=e[13],u=e[2],d=e[6],f=e[10],p=e[14],y=e[3],v=e[7],g=e[11],m=e[15];return y*(+o*l*d-i*c*d-o*s*f+r*c*f+i*s*p-r*l*p)+v*(+n*l*p-n*c*f+o*a*f-i*a*p+i*c*u-o*l*u)+g*(+n*c*d-n*s*p-o*a*d+r*a*p+o*s*u-r*c*u)+m*(-i*s*u-n*l*d+n*s*f+i*a*d-r*a*f+r*l*u)}transpose(){const e=this.elements;let n;return n=e[1],e[1]=e[4],e[4]=n,n=e[2],e[2]=e[8],e[8]=n,n=e[6],e[6]=e[9],e[9]=n,n=e[3],e[3]=e[12],e[12]=n,n=e[7],e[7]=e[13],e[13]=n,n=e[11],e[11]=e[14],e[14]=n,this}setPosition(e,n,r){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=n,i[14]=r),this}invert(){const e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],u=e[8],d=e[9],f=e[10],p=e[11],y=e[12],v=e[13],g=e[14],m=e[15],x=d*g*c-v*f*c+v*l*p-s*g*p-d*l*m+s*f*m,b=y*f*c-u*g*c-y*l*p+a*g*p+u*l*m-a*f*m,S=u*v*c-y*d*c+y*s*p-a*v*p-u*s*m+a*d*m,w=y*d*l-u*v*l-y*s*f+a*v*f+u*s*g-a*d*g,E=n*x+r*b+i*S+o*w;if(E===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const T=1/E;return e[0]=x*T,e[1]=(v*f*o-d*g*o-v*i*p+r*g*p+d*i*m-r*f*m)*T,e[2]=(s*g*o-v*l*o+v*i*c-r*g*c-s*i*m+r*l*m)*T,e[3]=(d*l*o-s*f*o-d*i*c+r*f*c+s*i*p-r*l*p)*T,e[4]=b*T,e[5]=(u*g*o-y*f*o+y*i*p-n*g*p-u*i*m+n*f*m)*T,e[6]=(y*l*o-a*g*o-y*i*c+n*g*c+a*i*m-n*l*m)*T,e[7]=(a*f*o-u*l*o+u*i*c-n*f*c-a*i*p+n*l*p)*T,e[8]=S*T,e[9]=(y*d*o-u*v*o-y*r*p+n*v*p+u*r*m-n*d*m)*T,e[10]=(a*v*o-y*s*o+y*r*c-n*v*c-a*r*m+n*s*m)*T,e[11]=(u*s*o-a*d*o-u*r*c+n*d*c+a*r*p-n*s*p)*T,e[12]=w*T,e[13]=(u*v*i-y*d*i+y*r*f-n*v*f-u*r*g+n*d*g)*T,e[14]=(y*s*i-a*v*i-y*r*l+n*v*l+a*r*g-n*s*g)*T,e[15]=(a*d*i-u*s*i+u*r*l-n*d*l-a*r*f+n*s*f)*T,this}scale(e){const n=this.elements,r=e.x,i=e.y,o=e.z;return n[0]*=r,n[4]*=i,n[8]*=o,n[1]*=r,n[5]*=i,n[9]*=o,n[2]*=r,n[6]*=i,n[10]*=o,n[3]*=r,n[7]*=i,n[11]*=o,this}getMaxScaleOnAxis(){const e=this.elements,n=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(n,r,i))}makeTranslation(e,n,r){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,n,0,0,1,r,0,0,0,1),this}makeRotationX(e){const n=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,n,-r,0,0,r,n,0,0,0,0,1),this}makeRotationY(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,0,r,0,0,1,0,0,-r,0,n,0,0,0,0,1),this}makeRotationZ(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,-r,0,0,r,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,n){const r=Math.cos(n),i=Math.sin(n),o=1-r,a=e.x,s=e.y,l=e.z,c=o*a,u=o*s;return this.set(c*a+r,c*s-i*l,c*l+i*s,0,c*s+i*l,u*s+r,u*l-i*a,0,c*l-i*s,u*l+i*a,o*l*l+r,0,0,0,0,1),this}makeScale(e,n,r){return this.set(e,0,0,0,0,n,0,0,0,0,r,0,0,0,0,1),this}makeShear(e,n,r,i,o,a){return this.set(1,r,o,0,e,1,a,0,n,i,1,0,0,0,0,1),this}compose(e,n,r){const i=this.elements,o=n._x,a=n._y,s=n._z,l=n._w,c=o+o,u=a+a,d=s+s,f=o*c,p=o*u,y=o*d,v=a*u,g=a*d,m=s*d,x=l*c,b=l*u,S=l*d,w=r.x,E=r.y,T=r.z;return i[0]=(1-(v+m))*w,i[1]=(p+S)*w,i[2]=(y-b)*w,i[3]=0,i[4]=(p-S)*E,i[5]=(1-(f+m))*E,i[6]=(g+x)*E,i[7]=0,i[8]=(y+b)*T,i[9]=(g-x)*T,i[10]=(1-(f+v))*T,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,n,r){const i=this.elements;let o=du.set(i[0],i[1],i[2]).length();const a=du.set(i[4],i[5],i[6]).length(),s=du.set(i[8],i[9],i[10]).length();this.determinant()<0&&(o=-o),e.x=i[12],e.y=i[13],e.z=i[14],ho.copy(this);const c=1/o,u=1/a,d=1/s;return ho.elements[0]*=c,ho.elements[1]*=c,ho.elements[2]*=c,ho.elements[4]*=u,ho.elements[5]*=u,ho.elements[6]*=u,ho.elements[8]*=d,ho.elements[9]*=d,ho.elements[10]*=d,n.setFromRotationMatrix(ho),r.x=o,r.y=a,r.z=s,this}makePerspective(e,n,r,i,o,a,s=za){const l=this.elements,c=2*o/(n-e),u=2*o/(r-i),d=(n+e)/(n-e),f=(r+i)/(r-i);let p,y;if(s===za)p=-(a+o)/(a-o),y=-2*a*o/(a-o);else if(s===Py)p=-a/(a-o),y=-a*o/(a-o);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+s);return l[0]=c,l[4]=0,l[8]=d,l[12]=0,l[1]=0,l[5]=u,l[9]=f,l[13]=0,l[2]=0,l[6]=0,l[10]=p,l[14]=y,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,n,r,i,o,a,s=za){const l=this.elements,c=1/(n-e),u=1/(r-i),d=1/(a-o),f=(n+e)*c,p=(r+i)*u;let y,v;if(s===za)y=(a+o)*d,v=-2*d;else if(s===Py)y=o*d,v=-1*d;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+s);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-f,l[1]=0,l[5]=2*u,l[9]=0,l[13]=-p,l[2]=0,l[6]=0,l[10]=v,l[14]=-y,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const n=this.elements,r=e.elements;for(let i=0;i<16;i++)if(n[i]!==r[i])return!1;return!0}fromArray(e,n=0){for(let r=0;r<16;r++)this.elements[r]=e[r+n];return this}toArray(e=[],n=0){const r=this.elements;return e[n]=r[0],e[n+1]=r[1],e[n+2]=r[2],e[n+3]=r[3],e[n+4]=r[4],e[n+5]=r[5],e[n+6]=r[6],e[n+7]=r[7],e[n+8]=r[8],e[n+9]=r[9],e[n+10]=r[10],e[n+11]=r[11],e[n+12]=r[12],e[n+13]=r[13],e[n+14]=r[14],e[n+15]=r[15],e}}const du=new ne,ho=new gt,iee=new ne(0,0,0),oee=new ne(1,1,1),xs=new ne,Og=new ne,xi=new ne,XN=new gt,qN=new Ii;class pi{constructor(e=0,n=0,r=0,i=pi.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=n,this._z=r,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,n,r,i=this._order){return this._x=e,this._y=n,this._z=r,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,n=this._order,r=!0){const i=e.elements,o=i[0],a=i[4],s=i[8],l=i[1],c=i[5],u=i[9],d=i[2],f=i[6],p=i[10];switch(n){case"XYZ":this._y=Math.asin(It(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-u,p),this._z=Math.atan2(-a,o)):(this._x=Math.atan2(f,c),this._z=0);break;case"YXZ":this._x=Math.asin(-It(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(s,p),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-d,o),this._z=0);break;case"ZXY":this._x=Math.asin(It(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-d,p),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,o));break;case"ZYX":this._y=Math.asin(-It(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(f,p),this._z=Math.atan2(l,o)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(It(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-d,o)):(this._x=0,this._y=Math.atan2(s,p));break;case"XZY":this._z=Math.asin(-It(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(f,c),this._y=Math.atan2(s,o)):(this._x=Math.atan2(-u,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,r===!0&&this._onChangeCallback(),this}setFromQuaternion(e,n,r){return XN.makeRotationFromQuaternion(e),this.setFromRotationMatrix(XN,n,r)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return qN.setFromEuler(this),this.setFromQuaternion(qN,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}pi.DEFAULT_ORDER="XYZ";class qA{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let n=0;n1){for(let r=0;r0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.geometryInfo=this._geometryInfo.map(s=>({...s,boundingBox:s.boundingBox?s.boundingBox.toJSON():void 0,boundingSphere:s.boundingSphere?s.boundingSphere.toJSON():void 0})),i.instanceInfo=this._instanceInfo.map(s=>({...s})),i.availableInstanceIds=this._availableInstanceIds.slice(),i.availableGeometryIds=this._availableGeometryIds.slice(),i.nextIndexStart=this._nextIndexStart,i.nextVertexStart=this._nextVertexStart,i.geometryCount=this._geometryCount,i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.matricesTexture=this._matricesTexture.toJSON(e),i.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(i.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(i.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(i.boundingBox=this.boundingBox.toJSON()));function o(s,l){return s[l.uuid]===void 0&&(s[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=o(e.geometries,this.geometry);const s=this.geometry.parameters;if(s!==void 0&&s.shapes!==void 0){const l=s.shapes;if(Array.isArray(l))for(let c=0,u=l.length;c0){i.children=[];for(let s=0;s0){i.animations=[];for(let s=0;s0&&(r.geometries=s),l.length>0&&(r.materials=l),c.length>0&&(r.textures=c),u.length>0&&(r.images=u),d.length>0&&(r.shapes=d),f.length>0&&(r.skeletons=f),p.length>0&&(r.animations=p),y.length>0&&(r.nodes=y)}return r.object=i,r;function a(s){const l=[];for(const c in s){const u=s[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,n=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),n===!0)for(let r=0;r0?i.multiplyScalar(1/Math.sqrt(o)):i.set(0,0,0)}static getBarycoord(e,n,r,i,o){po.subVectors(i,n),Pa.subVectors(r,n),ew.subVectors(e,n);const a=po.dot(po),s=po.dot(Pa),l=po.dot(ew),c=Pa.dot(Pa),u=Pa.dot(ew),d=a*c-s*s;if(d===0)return o.set(0,0,0),null;const f=1/d,p=(c*l-s*u)*f,y=(a*u-s*l)*f;return o.set(1-p-y,y,p)}static containsPoint(e,n,r,i){return this.getBarycoord(e,n,r,i,Ra)===null?!1:Ra.x>=0&&Ra.y>=0&&Ra.x+Ra.y<=1}static getInterpolation(e,n,r,i,o,a,s,l){return this.getBarycoord(e,n,r,i,Ra)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(o,Ra.x),l.addScaledVector(a,Ra.y),l.addScaledVector(s,Ra.z),l)}static getInterpolatedAttribute(e,n,r,i,o,a){return iw.setScalar(0),ow.setScalar(0),aw.setScalar(0),iw.fromBufferAttribute(e,n),ow.fromBufferAttribute(e,r),aw.fromBufferAttribute(e,i),a.setScalar(0),a.addScaledVector(iw,o.x),a.addScaledVector(ow,o.y),a.addScaledVector(aw,o.z),a}static isFrontFacing(e,n,r,i){return po.subVectors(r,n),Pa.subVectors(e,n),po.cross(Pa).dot(i)<0}set(e,n,r){return this.a.copy(e),this.b.copy(n),this.c.copy(r),this}setFromPointsAndIndices(e,n,r,i){return this.a.copy(e[n]),this.b.copy(e[r]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,n,r,i){return this.a.fromBufferAttribute(e,n),this.b.fromBufferAttribute(e,r),this.c.fromBufferAttribute(e,i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return po.subVectors(this.c,this.b),Pa.subVectors(this.a,this.b),po.cross(Pa).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Ro.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return Ro.getBarycoord(e,this.a,this.b,this.c,n)}getInterpolation(e,n,r,i,o){return Ro.getInterpolation(e,this.a,this.b,this.c,n,r,i,o)}containsPoint(e){return Ro.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Ro.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,n){const r=this.a,i=this.b,o=this.c;let a,s;pu.subVectors(i,r),mu.subVectors(o,r),tw.subVectors(e,r);const l=pu.dot(tw),c=mu.dot(tw);if(l<=0&&c<=0)return n.copy(r);nw.subVectors(e,i);const u=pu.dot(nw),d=mu.dot(nw);if(u>=0&&d<=u)return n.copy(i);const f=l*d-u*c;if(f<=0&&l>=0&&u<=0)return a=l/(l-u),n.copy(r).addScaledVector(pu,a);rw.subVectors(e,o);const p=pu.dot(rw),y=mu.dot(rw);if(y>=0&&p<=y)return n.copy(o);const v=p*c-l*y;if(v<=0&&c>=0&&y<=0)return s=c/(c-y),n.copy(r).addScaledVector(mu,s);const g=u*y-p*d;if(g<=0&&d-u>=0&&p-y>=0)return eO.subVectors(o,i),s=(d-u)/(d-u+(p-y)),n.copy(i).addScaledVector(eO,s);const m=1/(g+v+f);return a=v*m,s=f*m,n.copy(r).addScaledVector(pu,a).addScaledVector(mu,s)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const O4={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},bs={h:0,s:0,l:0},Dg={h:0,s:0,l:0};function sw(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*6*(2/3-n):t}let ft=class{constructor(e,n,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,n,r)}set(e,n,r){if(n===void 0&&r===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,n,r);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,n=Zt){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Dt.colorSpaceToWorking(this,n),this}setRGB(e,n,r,i=Dt.workingColorSpace){return this.r=e,this.g=n,this.b=r,Dt.colorSpaceToWorking(this,i),this}setHSL(e,n,r,i=Dt.workingColorSpace){if(e=WA(e,1),n=It(n,0,1),r=It(r,0,1),n===0)this.r=this.g=this.b=r;else{const o=r<=.5?r*(1+n):r+n-r*n,a=2*r-o;this.r=sw(a,o,e+1/3),this.g=sw(a,o,e),this.b=sw(a,o,e-1/3)}return Dt.colorSpaceToWorking(this,i),this}setStyle(e,n=Zt){function r(o){o!==void 0&&parseFloat(o)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let o;const a=i[1],s=i[2];switch(a){case"rgb":case"rgba":if(o=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return r(o[4]),this.setRGB(Math.min(255,parseInt(o[1],10))/255,Math.min(255,parseInt(o[2],10))/255,Math.min(255,parseInt(o[3],10))/255,n);if(o=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return r(o[4]),this.setRGB(Math.min(100,parseInt(o[1],10))/100,Math.min(100,parseInt(o[2],10))/100,Math.min(100,parseInt(o[3],10))/100,n);break;case"hsl":case"hsla":if(o=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return r(o[4]),this.setHSL(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,n);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const o=i[1],a=o.length;if(a===3)return this.setRGB(parseInt(o.charAt(0),16)/15,parseInt(o.charAt(1),16)/15,parseInt(o.charAt(2),16)/15,n);if(a===6)return this.setHex(parseInt(o,16),n);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,n);return this}setColorName(e,n=Zt){const r=O4[e.toLowerCase()];return r!==void 0?this.setHex(r,n):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=qa(e.r),this.g=qa(e.g),this.b=qa(e.b),this}copyLinearToSRGB(e){return this.r=cd(e.r),this.g=cd(e.g),this.b=cd(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Zt){return Dt.workingToColorSpace(Ar.copy(this),e),Math.round(It(Ar.r*255,0,255))*65536+Math.round(It(Ar.g*255,0,255))*256+Math.round(It(Ar.b*255,0,255))}getHexString(e=Zt){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=Dt.workingColorSpace){Dt.workingToColorSpace(Ar.copy(this),n);const r=Ar.r,i=Ar.g,o=Ar.b,a=Math.max(r,i,o),s=Math.min(r,i,o);let l,c;const u=(s+a)/2;if(s===a)l=0,c=0;else{const d=a-s;switch(c=u<=.5?d/(a+s):d/(2-a-s),a){case r:l=(i-o)/d+(i0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const n in e){const r=e[n];if(r===void 0){console.warn(`THREE.Material: parameter '${n}' has value of undefined.`);continue}const i=this[n];if(i===void 0){console.warn(`THREE.Material: '${n}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(r):i&&i.isVector3&&r&&r.isVector3?i.copy(r):this[n]=r}}toJSON(e){const n=e===void 0||typeof e=="string";n&&(e={textures:{},images:{}});const r={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),this.roughness!==void 0&&(r.roughness=this.roughness),this.metalness!==void 0&&(r.metalness=this.metalness),this.sheen!==void 0&&(r.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(r.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(r.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(r.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(r.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(r.shininess=this.shininess),this.clearcoat!==void 0&&(r.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(r.dispersion=this.dispersion),this.iridescence!==void 0&&(r.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(r.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(r.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(r.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(r.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(r.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(r.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(e).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(e).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(e).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(e).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(e).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(r.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(r.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(r.combine=this.combine)),this.envMapRotation!==void 0&&(r.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(r.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(r.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(r.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(r.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(r.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(r.size=this.size),this.shadowSide!==null&&(r.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(r.sizeAttenuation=this.sizeAttenuation),this.blending!==sd&&(r.blending=this.blending),this.side!==va&&(r.side=this.side),this.vertexColors===!0&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),this.transparent===!0&&(r.transparent=!0),this.blendSrc!==CE&&(r.blendSrc=this.blendSrc),this.blendDst!==PE&&(r.blendDst=this.blendDst),this.blendEquation!==Xl&&(r.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(r.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(r.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(r.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(r.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(r.blendAlpha=this.blendAlpha),this.depthFunc!==jd&&(r.depthFunc=this.depthFunc),this.depthTest===!1&&(r.depthTest=this.depthTest),this.depthWrite===!1&&(r.depthWrite=this.depthWrite),this.colorWrite===!1&&(r.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(r.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==BN&&(r.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(r.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(r.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==au&&(r.stencilFail=this.stencilFail),this.stencilZFail!==au&&(r.stencilZFail=this.stencilZFail),this.stencilZPass!==au&&(r.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(r.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(r.rotation=this.rotation),this.polygonOffset===!0&&(r.polygonOffset=!0),this.polygonOffsetFactor!==0&&(r.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(r.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(r.linewidth=this.linewidth),this.dashSize!==void 0&&(r.dashSize=this.dashSize),this.gapSize!==void 0&&(r.gapSize=this.gapSize),this.scale!==void 0&&(r.scale=this.scale),this.dithering===!0&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),this.alphaHash===!0&&(r.alphaHash=!0),this.alphaToCoverage===!0&&(r.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(r.premultipliedAlpha=!0),this.forceSinglePass===!0&&(r.forceSinglePass=!0),this.wireframe===!0&&(r.wireframe=!0),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(r.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(r.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(r.flatShading=!0),this.visible===!1&&(r.visible=!1),this.toneMapped===!1&&(r.toneMapped=!1),this.fog===!1&&(r.fog=!1),Object.keys(this.userData).length>0&&(r.userData=this.userData);function i(o){const a=[];for(const s in o){const l=o[s];delete l.metadata,a.push(l)}return a}if(n){const o=i(e.textures),a=i(e.images);o.length>0&&(r.textures=o),a.length>0&&(r.images=a)}return r}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const n=e.clippingPlanes;let r=null;if(n!==null){const i=n.length;r=new Array(i);for(let o=0;o!==i;++o)r[o]=n[o].clone()}return this.clippingPlanes=r,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class sa extends qr{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new ft(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new pi,this.combine=Dx,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Bn=new ne,Lg=new xt;let dee=0;class cr{constructor(e,n,r=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:dee++}),this.name="",this.array=e,this.itemSize=n,this.count=e!==void 0?e.length/n:0,this.normalized=r,this.usage=f1,this.updateRanges=[],this.gpuType=Io,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,n,r){e*=this.itemSize,r*=n.itemSize;for(let i=0,o=this.itemSize;in.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),n.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Wo);const e=this.attributes.position,n=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new ne(-1/0,-1/0,-1/0),new ne(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),n)for(let r=0,i=n.length;r0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const n=this.index;n!==null&&(e.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});const r=this.attributes;for(const l in r){const c=r[l];e.data.attributes[l]=c.toJSON(e.data)}const i={};let o=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let d=0,f=c.length;d0&&(i[l]=u,o=!0)}o&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const s=this.boundingSphere;return s!==null&&(e.data.boundingSphere=s.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const n={};this.name=e.name;const r=e.index;r!==null&&this.setIndex(r.clone());const i=e.attributes;for(const c in i){const u=i[c];this.setAttribute(c,u.clone(n))}const o=e.morphAttributes;for(const c in o){const u=[],d=o[c];for(let f=0,p=d.length;f0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,a=i.length;o(e.far-e.near)**2))&&(tO.copy(o).invert(),Dl.copy(e.ray).applyMatrix4(tO),!(r.boundingBox!==null&&Dl.intersectsBox(r.boundingBox)===!1)&&this._computeIntersections(e,n,Dl)))}_computeIntersections(e,n,r){let i;const o=this.geometry,a=this.material,s=o.index,l=o.attributes.position,c=o.attributes.uv,u=o.attributes.uv1,d=o.attributes.normal,f=o.groups,p=o.drawRange;if(s!==null)if(Array.isArray(a))for(let y=0,v=f.length;yn.far?null:{distance:c,point:$g.clone(),object:t}}function zg(t,e,n,r,i,o,a,s,l,c){t.getVertexPosition(s,jg),t.getVertexPosition(l,Ug),t.getVertexPosition(c,Fg);const u=hee(t,e,n,r,jg,Ug,Fg,rO);if(u){const d=new ne;Ro.getBarycoord(rO,jg,Ug,Fg,d),i&&(u.uv=Ro.getInterpolatedAttribute(i,s,l,c,d,new xt)),o&&(u.uv1=Ro.getInterpolatedAttribute(o,s,l,c,d,new xt)),a&&(u.normal=Ro.getInterpolatedAttribute(a,s,l,c,d,new ne),u.normal.dot(r.direction)>0&&u.normal.multiplyScalar(-1));const f={a:s,b:l,c,normal:new ne,materialIndex:0};Ro.getNormal(jg,Ug,Fg,f.normal),u.face=f,u.barycoord=d}return u}class Gc extends br{constructor(e=1,n=1,r=1,i=1,o=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:n,depth:r,widthSegments:i,heightSegments:o,depthSegments:a};const s=this;i=Math.floor(i),o=Math.floor(o),a=Math.floor(a);const l=[],c=[],u=[],d=[];let f=0,p=0;y("z","y","x",-1,-1,r,n,e,a,o,0),y("z","y","x",1,-1,r,n,-e,a,o,1),y("x","z","y",1,1,e,r,n,i,a,2),y("x","z","y",1,-1,e,r,-n,i,a,3),y("x","y","z",1,-1,e,n,r,i,o,4),y("x","y","z",-1,-1,e,n,-r,i,o,5),this.setIndex(l),this.setAttribute("position",new Qt(c,3)),this.setAttribute("normal",new Qt(u,3)),this.setAttribute("uv",new Qt(d,2));function y(v,g,m,x,b,S,w,E,T,A,M){const C=S/T,P=w/A,R=S/2,D=w/2,k=E/2,U=T+1,O=A+1;let W=0,L=0;const j=new ne;for(let X=0;X0?1:-1,u.push(j.x,j.y,j.z),d.push(F/T),d.push(1-X/A),W+=1}}for(let X=0;X0&&(n.defines=this.defines),n.vertexShader=this.vertexShader,n.fragmentShader=this.fragmentShader,n.lights=this.lights,n.clipping=this.clipping;const r={};for(const i in this.extensions)this.extensions[i]===!0&&(r[i]=!0);return Object.keys(r).length>0&&(n.extensions=r),n}}class k4 extends vn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new gt,this.projectionMatrix=new gt,this.projectionMatrixInverse=new gt,this.coordinateSystem=za}copy(e,n){return super.copy(e,n),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,n){super.updateWorldMatrix(e,n),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const _s=new ne,iO=new xt,oO=new xt;class gr extends k4{constructor(e=50,n=1,r=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=r,this.far=i,this.focus=10,this.aspect=n,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const n=.5*this.getFilmHeight()/e;this.fov=Bd*2*Math.atan(n),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Gh*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Bd*2*Math.atan(Math.tan(Gh*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,n,r){_s.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(_s.x,_s.y).multiplyScalar(-e/_s.z),_s.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),r.set(_s.x,_s.y).multiplyScalar(-e/_s.z)}getViewSize(e,n){return this.getViewBounds(e,iO,oO),n.subVectors(oO,iO)}setViewOffset(e,n,r,i,o,a){this.aspect=e/n,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let n=e*Math.tan(Gh*.5*this.fov)/this.zoom,r=2*n,i=this.aspect*r,o=-.5*i;const a=this.view;if(this.view!==null&&this.view.enabled){const l=a.fullWidth,c=a.fullHeight;o+=a.offsetX*i/l,n-=a.offsetY*r/c,i*=a.width/l,r*=a.height/c}const s=this.filmOffset;s!==0&&(o+=e*s/this.getFilmWidth()),this.projectionMatrix.makePerspective(o,o+i,n,n-r,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.fov=this.fov,n.object.zoom=this.zoom,n.object.near=this.near,n.object.far=this.far,n.object.focus=this.focus,n.object.aspect=this.aspect,this.view!==null&&(n.object.view=Object.assign({},this.view)),n.object.filmGauge=this.filmGauge,n.object.filmOffset=this.filmOffset,n}}const vu=-90,yu=1;class yee extends vn{constructor(e,n,r){super(),this.type="CubeCamera",this.renderTarget=r,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new gr(vu,yu,e,n);i.layers=this.layers,this.add(i);const o=new gr(vu,yu,e,n);o.layers=this.layers,this.add(o);const a=new gr(vu,yu,e,n);a.layers=this.layers,this.add(a);const s=new gr(vu,yu,e,n);s.layers=this.layers,this.add(s);const l=new gr(vu,yu,e,n);l.layers=this.layers,this.add(l);const c=new gr(vu,yu,e,n);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,n=this.children.concat(),[r,i,o,a,s,l]=n;for(const c of n)this.remove(c);if(e===za)r.up.set(0,1,0),r.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),o.up.set(0,0,-1),o.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),s.up.set(0,1,0),s.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===Py)r.up.set(0,-1,0),r.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),o.up.set(0,0,1),o.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),s.up.set(0,-1,0),s.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const c of n)this.add(c),c.updateMatrixWorld()}update(e,n){this.parent===null&&this.updateMatrixWorld();const{renderTarget:r,activeMipmapLevel:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[o,a,s,l,c,u]=this.children,d=e.getRenderTarget(),f=e.getActiveCubeFace(),p=e.getActiveMipmapLevel(),y=e.xr.enabled;e.xr.enabled=!1;const v=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,e.setRenderTarget(r,0,i),e.render(n,o),e.setRenderTarget(r,1,i),e.render(n,a),e.setRenderTarget(r,2,i),e.render(n,s),e.setRenderTarget(r,3,i),e.render(n,l),e.setRenderTarget(r,4,i),e.render(n,c),r.texture.generateMipmaps=v,e.setRenderTarget(r,5,i),e.render(n,u),e.setRenderTarget(d,f,p),e.xr.enabled=y,r.texture.needsPMREMUpdate=!0}}class j4 extends lr{constructor(e=[],n=Ud,r,i,o,a,s,l,c,u){super(e,n,r,i,o,a,s,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class xee extends Oc{constructor(e=1,n={}){super(e,e,n),this.isWebGLCubeRenderTarget=!0;const r={width:e,height:e,depth:1},i=[r,r,r,r,r,r];this.texture=new j4(i),this._setTextureOptions(n),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(e,n){this.texture.type=n.type,this.texture.colorSpace=n.colorSpace,this.texture.generateMipmaps=n.generateMipmaps,this.texture.minFilter=n.minFilter,this.texture.magFilter=n.magFilter;const r={uniforms:{tEquirect:{value:null}},vertexShader:` + + varying vec3 vWorldDirection; + + vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); + + } + + void main() { + + vWorldDirection = transformDirection( position, modelMatrix ); + + #include + #include + + } + `,fragmentShader:` + + uniform sampler2D tEquirect; + + varying vec3 vWorldDirection; + + #include + + void main() { + + vec3 direction = normalize( vWorldDirection ); + + vec2 sampleUV = equirectUv( direction ); + + gl_FragColor = texture2D( tEquirect, sampleUV ); + + } + `},i=new Gc(5,5,5),o=new fl({name:"CubemapFromEquirect",uniforms:$d(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:ui,blending:el});o.uniforms.tEquirect.value=n;const a=new Mn(i,o),s=n.minFilter;return n.minFilter===Oo&&(n.minFilter=Or),new yee(1,10,this).update(e,a),n.minFilter=s,a.geometry.dispose(),a.material.dispose(),this}clear(e,n=!0,r=!0,i=!0){const o=e.getRenderTarget();for(let a=0;a<6;a++)e.setRenderTarget(this,a),e.clear(n,r,i);e.setRenderTarget(o)}}let la=class extends vn{constructor(){super(),this.isGroup=!0,this.type="Group"}};const bee={type:"move"};class uw{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new la,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new la,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new ne,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new ne),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new la,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new ne,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new ne),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const n=this._hand;if(n)for(const r of e.hand.values())this._getHandJoint(n,r)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,n,r){let i=null,o=null,a=null;const s=this._targetRay,l=this._grip,c=this._hand;if(e&&n.session.visibilityState!=="visible-blurred"){if(c&&e.hand){a=!0;for(const v of e.hand.values()){const g=n.getJointPose(v,r),m=this._getHandJoint(c,v);g!==null&&(m.matrix.fromArray(g.transform.matrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.matrixWorldNeedsUpdate=!0,m.jointRadius=g.radius),m.visible=g!==null}const u=c.joints["index-finger-tip"],d=c.joints["thumb-tip"],f=u.position.distanceTo(d.position),p=.02,y=.005;c.inputState.pinching&&f>p+y?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&f<=p-y&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(o=n.getPose(e.gripSpace,r),o!==null&&(l.matrix.fromArray(o.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,o.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(o.linearVelocity)):l.hasLinearVelocity=!1,o.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(o.angularVelocity)):l.hasAngularVelocity=!1));s!==null&&(i=n.getPose(e.targetRaySpace,r),i===null&&o!==null&&(i=o),i!==null&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(bee)))}return s!==null&&(s.visible=i!==null),l!==null&&(l.visible=o!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(e,n){if(e.joints[n.jointName]===void 0){const r=new la;r.matrixAutoUpdate=!1,r.visible=!1,e.joints[n.jointName]=r,e.add(r)}return e.joints[n.jointName]}}class U4 extends vn{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new pi,this.environmentIntensity=1,this.environmentRotation=new pi,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,n){return super.copy(e,n),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const n=super.toJSON(e);return this.fog!==null&&(n.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(n.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(n.object.backgroundIntensity=this.backgroundIntensity),n.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(n.object.environmentIntensity=this.environmentIntensity),n.object.environmentRotation=this.environmentRotation.toArray(),n}}class _ee{constructor(e,n){this.isInterleavedBuffer=!0,this.array=e,this.stride=n,this.count=e!==void 0?e.length/n:0,this.usage=f1,this.updateRanges=[],this.version=0,this.uuid=Uo()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,n,r){e*=this.stride,r*=n.stride;for(let i=0,o=this.stride;i1?null:n.copy(e.start).addScaledVector(r,o)}intersectsLine(e){const n=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return n<0&&r>0||r<0&&n>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,n){const r=n||Aee.getNormalMatrix(e),i=this.coplanarPoint(hw).applyMatrix4(e),o=this.normal.applyMatrix3(r).normalize();return this.constant=-i.dot(o),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Ll=new Xo,Gg=new ne;class ZA{constructor(e=new Ua,n=new Ua,r=new Ua,i=new Ua,o=new Ua,a=new Ua){this.planes=[e,n,r,i,o,a]}set(e,n,r,i,o,a){const s=this.planes;return s[0].copy(e),s[1].copy(n),s[2].copy(r),s[3].copy(i),s[4].copy(o),s[5].copy(a),this}copy(e){const n=this.planes;for(let r=0;r<6;r++)n[r].copy(e.planes[r]);return this}setFromProjectionMatrix(e,n=za){const r=this.planes,i=e.elements,o=i[0],a=i[1],s=i[2],l=i[3],c=i[4],u=i[5],d=i[6],f=i[7],p=i[8],y=i[9],v=i[10],g=i[11],m=i[12],x=i[13],b=i[14],S=i[15];if(r[0].setComponents(l-o,f-c,g-p,S-m).normalize(),r[1].setComponents(l+o,f+c,g+p,S+m).normalize(),r[2].setComponents(l+a,f+u,g+y,S+x).normalize(),r[3].setComponents(l-a,f-u,g-y,S-x).normalize(),r[4].setComponents(l-s,f-d,g-v,S-b).normalize(),n===za)r[5].setComponents(l+s,f+d,g+v,S+b).normalize();else if(n===Py)r[5].setComponents(s,d,v,b).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+n);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Ll.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const n=e.geometry;n.boundingSphere===null&&n.computeBoundingSphere(),Ll.copy(n.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Ll)}intersectsSprite(e){return Ll.center.set(0,0,0),Ll.radius=.7071067811865476,Ll.applyMatrix4(e.matrixWorld),this.intersectsSphere(Ll)}intersectsSphere(e){const n=this.planes,r=e.center,i=-e.radius;for(let o=0;o<6;o++)if(n[o].distanceToPoint(r)0?e.max.x:e.min.x,Gg.y=i.normal.y>0?e.max.y:e.min.y,Gg.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Gg)<0)return!1}return!0}containsPoint(e){const n=this.planes;for(let r=0;r<6;r++)if(n[r].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class pc extends qr{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new ft(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const Ry=new ne,Ny=new ne,pO=new gt,lh=new Sf,Wg=new Xo,pw=new ne,mO=new ne;let Ux=class extends vn{constructor(e=new br,n=new pc){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=n,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,n){return super.copy(e,n),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const n=e.attributes.position,r=[0];for(let i=1,o=n.count;i0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,a=i.length;or)return;pw.applyMatrix4(t.matrixWorld);const c=e.ray.origin.distanceTo(pw);if(!(ce.far))return{distance:c,point:mO.clone().applyMatrix4(t.matrixWorld),index:a,face:null,faceIndex:null,barycoord:null,object:t}}const gO=new ne,vO=new ne;class Oy extends Ux{constructor(e,n){super(e,n),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const n=e.attributes.position,r=[];for(let i=0,o=n.count;i0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,a=i.length;oi.far)return;o.push({distance:c,distanceToRay:Math.sqrt(s),point:l,index:e,face:null,faceIndex:null,barycoord:null,object:a})}}class B4 extends lr{constructor(e,n,r=Nc,i,o,a,s=Xr,l=Xr,c,u=Tp,d=1){if(u!==Tp&&u!==Mp)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const f={width:e,height:n,depth:d};super(f,i,o,a,s,l,u,r,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new XA(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const n=super.toJSON(e);return this.compareFunction!==null&&(n.compareFunction=this.compareFunction),n}}class QA extends br{constructor(e=1,n=1,r=1,i=32,o=1,a=!1,s=0,l=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:n,height:r,radialSegments:i,heightSegments:o,openEnded:a,thetaStart:s,thetaLength:l};const c=this;i=Math.floor(i),o=Math.floor(o);const u=[],d=[],f=[],p=[];let y=0;const v=[],g=r/2;let m=0;x(),a===!1&&(e>0&&b(!0),n>0&&b(!1)),this.setIndex(u),this.setAttribute("position",new Qt(d,3)),this.setAttribute("normal",new Qt(f,3)),this.setAttribute("uv",new Qt(p,2));function x(){const S=new ne,w=new ne;let E=0;const T=(n-e)/r;for(let A=0;A<=o;A++){const M=[],C=A/o,P=C*(n-e)+e;for(let R=0;R<=i;R++){const D=R/i,k=D*l+s,U=Math.sin(k),O=Math.cos(k);w.x=P*U,w.y=-C*r+g,w.z=P*O,d.push(w.x,w.y,w.z),S.set(U,T,O).normalize(),f.push(S.x,S.y,S.z),p.push(D,1-C),M.push(y++)}v.push(M)}for(let A=0;A0||M!==0)&&(u.push(C,P,D),E+=3),(n>0||M!==o-1)&&(u.push(P,R,D),E+=3)}c.addGroup(m,E,0),m+=E}function b(S){const w=y,E=new xt,T=new ne;let A=0;const M=S===!0?e:n,C=S===!0?1:-1;for(let R=1;R<=i;R++)d.push(0,g*C,0),f.push(0,C,0),p.push(.5,.5),y++;const P=y;for(let R=0;R<=i;R++){const k=R/i*l+s,U=Math.cos(k),O=Math.sin(k);T.x=M*O,T.y=g*C,T.z=M*U,d.push(T.x,T.y,T.z),f.push(0,C,0),E.x=U*.5+.5,E.y=O*.5*C+.5,p.push(E.x,E.y),y++}for(let R=0;R0)&&p.push(b,S,E),(m!==r-1||l0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class Fo extends qr{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new ft(16777215),this.specular=new ft(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ft(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=kx,this.normalScale=new xt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new pi,this.combine=Dx,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Ree extends qr{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new ft(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ft(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=kx,this.normalScale=new xt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new pi,this.combine=Dx,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Nee extends qr{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=_Q,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class Oee extends qr{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}function Yg(t,e){return!t||t.constructor===e?t:typeof e.BYTES_PER_ELEMENT=="number"?new e(t):Array.prototype.slice.call(t)}function Iee(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Dee(t){function e(i,o){return t[i]-t[o]}const n=t.length,r=new Array(n);for(let i=0;i!==n;++i)r[i]=i;return r.sort(e),r}function bO(t,e,n){const r=t.length,i=new t.constructor(r);for(let o=0,a=0;a!==r;++o){const s=n[o]*e;for(let l=0;l!==e;++l)i[a++]=t[s+l]}return i}function $4(t,e,n,r){let i=1,o=t[0];for(;o!==void 0&&o[r]===void 0;)o=t[i++];if(o===void 0)return;let a=o[r];if(a!==void 0)if(Array.isArray(a))do a=o[r],a!==void 0&&(e.push(o.time),n.push(...a)),o=t[i++];while(o!==void 0);else if(a.toArray!==void 0)do a=o[r],a!==void 0&&(e.push(o.time),a.toArray(n,n.length)),o=t[i++];while(o!==void 0);else do a=o[r],a!==void 0&&(e.push(o.time),n.push(a)),o=t[i++];while(o!==void 0)}class Im{constructor(e,n,r,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new n.constructor(r),this.sampleValues=n,this.valueSize=r,this.settings=null,this.DefaultSettings_={}}evaluate(e){const n=this.parameterPositions;let r=this._cachedIndex,i=n[r],o=n[r-1];e:{t:{let a;n:{r:if(!(e=o)){const s=n[1];e=o)break t}a=r,r=0;break n}break e}for(;r>>1;en;)--a;if(++a,o!==0||a!==i){o>=a&&(a=Math.max(a,1),o=a-1);const s=this.getValueSize();this.times=r.slice(o,a),this.values=this.values.slice(o*s,a*s)}return this}validate(){let e=!0;const n=this.getValueSize();n-Math.floor(n)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const r=this.times,i=this.values,o=r.length;o===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let a=null;for(let s=0;s!==o;s++){const l=r[s];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,s,l),e=!1;break}if(a!==null&&a>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,s,l,a),e=!1;break}a=l}if(i!==void 0&&Iee(i))for(let s=0,l=i.length;s!==l;++s){const c=i[s];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,s,c),e=!1;break}}return e}optimize(){const e=this.times.slice(),n=this.values.slice(),r=this.getValueSize(),i=this.getInterpolation()===H_,o=e.length-1;let a=1;for(let s=1;s0){e[a]=e[o];for(let s=o*r,l=a*r,c=0;c!==r;++c)n[l+c]=n[s+c];++a}return a!==e.length?(this.times=e.slice(0,a),this.values=n.slice(0,a*r)):(this.times=e,this.values=n),this}clone(){const e=this.times.slice(),n=this.values.slice(),r=this.constructor,i=new r(this.name,e,n);return i.createInterpolant=this.createInterpolant,i}}qo.prototype.ValueTypeName="";qo.prototype.TimeBufferType=Float32Array;qo.prototype.ValueBufferType=Float32Array;qo.prototype.DefaultInterpolation=Cp;class Ef extends qo{constructor(e,n,r){super(e,n,r)}}Ef.prototype.ValueTypeName="bool";Ef.prototype.ValueBufferType=Array;Ef.prototype.DefaultInterpolation=Ap;Ef.prototype.InterpolantFactoryMethodLinear=void 0;Ef.prototype.InterpolantFactoryMethodSmooth=void 0;class z4 extends qo{constructor(e,n,r,i){super(e,n,r,i)}}z4.prototype.ValueTypeName="color";class zd extends qo{constructor(e,n,r,i){super(e,n,r,i)}}zd.prototype.ValueTypeName="number";class Uee extends Im{constructor(e,n,r,i){super(e,n,r,i)}interpolate_(e,n,r,i){const o=this.resultBuffer,a=this.sampleValues,s=this.valueSize,l=(r-n)/(i-n);let c=e*s;for(let u=c+s;c!==u;c+=4)Ii.slerpFlat(o,0,a,c-s,a,c,l);return o}}class Ic extends qo{constructor(e,n,r,i){super(e,n,r,i)}InterpolantFactoryMethodLinear(e){return new Uee(this.times,this.values,this.getValueSize(),e)}}Ic.prototype.ValueTypeName="quaternion";Ic.prototype.InterpolantFactoryMethodSmooth=void 0;class Tf extends qo{constructor(e,n,r){super(e,n,r)}}Tf.prototype.ValueTypeName="string";Tf.prototype.ValueBufferType=Array;Tf.prototype.DefaultInterpolation=Ap;Tf.prototype.InterpolantFactoryMethodLinear=void 0;Tf.prototype.InterpolantFactoryMethodSmooth=void 0;class hl extends qo{constructor(e,n,r,i){super(e,n,r,i)}}hl.prototype.ValueTypeName="vector";class m1{constructor(e="",n=-1,r=[],i=xQ){this.name=e,this.tracks=r,this.duration=n,this.blendMode=i,this.uuid=Uo(),this.duration<0&&this.resetDuration()}static parse(e){const n=[],r=e.tracks,i=1/(e.fps||1);for(let a=0,s=r.length;a!==s;++a)n.push(Bee(r[a]).scale(i));const o=new this(e.name,e.duration,n,e.blendMode);return o.uuid=e.uuid,o}static toJSON(e){const n=[],r=e.tracks,i={name:e.name,duration:e.duration,tracks:n,uuid:e.uuid,blendMode:e.blendMode};for(let o=0,a=r.length;o!==a;++o)n.push(qo.toJSON(r[o]));return i}static CreateFromMorphTargetSequence(e,n,r,i){const o=n.length,a=[];for(let s=0;s1){const d=u[1];let f=i[d];f||(i[d]=f=[]),f.push(c)}}const a=[];for(const s in i)a.push(this.CreateFromMorphTargetSequence(s,i[s],n,r));return a}static parseAnimation(e,n){if(console.warn("THREE.AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const r=function(d,f,p,y,v){if(p.length!==0){const g=[],m=[];$4(p,g,m,y),g.length!==0&&v.push(new d(f,g,m))}},i=[],o=e.name||"default",a=e.fps||30,s=e.blendMode;let l=e.length||-1;const c=e.hierarchy||[];for(let d=0;d{n&&n(o),this.manager.itemEnd(e)},0),o;if(Na[e]!==void 0){Na[e].push({onLoad:n,onProgress:r,onError:i});return}Na[e]=[],Na[e].push({onLoad:n,onProgress:r,onError:i});const a=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),s=this.mimeType,l=this.responseType;fetch(a).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const u=Na[e],d=c.body.getReader(),f=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),p=f?parseInt(f):0,y=p!==0;let v=0;const g=new ReadableStream({start(m){x();function x(){d.read().then(({done:b,value:S})=>{if(b)m.close();else{v+=S.byteLength;const w=new ProgressEvent("progress",{lengthComputable:y,loaded:v,total:p});for(let E=0,T=u.length;E{m.error(b)})}}});return new Response(g)}else throw new $ee(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`,c)}).then(c=>{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(u=>new DOMParser().parseFromString(u,s));case"json":return c.json();default:if(s==="")return c.text();{const d=/charset="?([^;"\s]*)"?/i.exec(s),f=d&&d[1]?d[1].toLowerCase():void 0,p=new TextDecoder(f);return c.arrayBuffer().then(y=>p.decode(y))}}}).then(c=>{Bs.add(e,c);const u=Na[e];delete Na[e];for(let d=0,f=u.length;d{const u=Na[e];if(u===void 0)throw this.manager.itemError(e),c;delete Na[e];for(let d=0,f=u.length;d{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class zee extends Vo{constructor(e){super(e)}load(e,n,r,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,a=Bs.get(e);if(a!==void 0)return o.manager.itemStart(e),setTimeout(function(){n&&n(a),o.manager.itemEnd(e)},0),a;const s=Pp("img");function l(){u(),Bs.add(e,this),n&&n(this),o.manager.itemEnd(e)}function c(d){u(),i&&i(d),o.manager.itemError(e),o.manager.itemEnd(e)}function u(){s.removeEventListener("load",l,!1),s.removeEventListener("error",c,!1)}return s.addEventListener("load",l,!1),s.addEventListener("error",c,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(s.crossOrigin=this.crossOrigin),o.manager.itemStart(e),s.src=e,s}}class Hee extends Vo{constructor(e){super(e)}load(e,n,r,i){const o=this,a=new JA,s=new Mf(this.manager);return s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setPath(this.path),s.setWithCredentials(o.withCredentials),s.load(e,function(l){let c;try{c=o.parse(l)}catch(u){if(i!==void 0)i(u);else{console.error(u);return}}c.image!==void 0?a.image=c.image:c.data!==void 0&&(a.image.width=c.width,a.image.height=c.height,a.image.data=c.data),a.wrapS=c.wrapS!==void 0?c.wrapS:Ji,a.wrapT=c.wrapT!==void 0?c.wrapT:Ji,a.magFilter=c.magFilter!==void 0?c.magFilter:Or,a.minFilter=c.minFilter!==void 0?c.minFilter:Or,a.anisotropy=c.anisotropy!==void 0?c.anisotropy:1,c.colorSpace!==void 0&&(a.colorSpace=c.colorSpace),c.flipY!==void 0&&(a.flipY=c.flipY),c.format!==void 0&&(a.format=c.format),c.type!==void 0&&(a.type=c.type),c.mipmaps!==void 0&&(a.mipmaps=c.mipmaps,a.minFilter=Oo),c.mipmapCount===1&&(a.minFilter=Or),c.generateMipmaps!==void 0&&(a.generateMipmaps=c.generateMipmaps),a.needsUpdate=!0,n&&n(a,c)},r,i),a}}class nC extends Vo{constructor(e){super(e)}load(e,n,r,i){const o=new lr,a=new zee(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,function(s){o.image=s,o.needsUpdate=!0,n!==void 0&&n(o)},r,i),o}}class Dm extends vn{constructor(e,n=1){super(),this.isLight=!0,this.type="Light",this.color=new ft(e),this.intensity=n}dispose(){}copy(e,n){return super.copy(e,n),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const n=super.toJSON(e);return n.object.color=this.color.getHex(),n.object.intensity=this.intensity,this.groundColor!==void 0&&(n.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(n.object.distance=this.distance),this.angle!==void 0&&(n.object.angle=this.angle),this.decay!==void 0&&(n.object.decay=this.decay),this.penumbra!==void 0&&(n.object.penumbra=this.penumbra),this.shadow!==void 0&&(n.object.shadow=this.shadow.toJSON()),this.target!==void 0&&(n.object.target=this.target.uuid),n}}class Vee extends Dm{constructor(e,n,r){super(e,r),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(vn.DEFAULT_UP),this.updateMatrix(),this.groundColor=new ft(n)}copy(e,n){return super.copy(e,n),this.groundColor.copy(e.groundColor),this}}const mw=new gt,_O=new ne,wO=new ne;class rC{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new xt(512,512),this.mapType=ya,this.map=null,this.mapPass=null,this.matrix=new gt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new ZA,this._frameExtents=new xt(1,1),this._viewportCount=1,this._viewports=[new Yt(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const n=this.camera,r=this.matrix;_O.setFromMatrixPosition(e.matrixWorld),n.position.copy(_O),wO.setFromMatrixPosition(e.target.matrixWorld),n.lookAt(wO),n.updateMatrixWorld(),mw.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(mw),r.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),r.multiply(mw)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.autoUpdate=e.autoUpdate,this.needsUpdate=e.needsUpdate,this.normalBias=e.normalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.intensity!==1&&(e.intensity=this.intensity),this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class Gee extends rC{constructor(){super(new gr(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(e){const n=this.camera,r=Bd*2*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height*this.aspect,o=e.distance||n.far;(r!==n.fov||i!==n.aspect||o!==n.far)&&(n.fov=r,n.aspect=i,n.far=o,n.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class G4 extends Dm{constructor(e,n,r=0,i=Math.PI/3,o=0,a=2){super(e,n),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(vn.DEFAULT_UP),this.updateMatrix(),this.target=new vn,this.distance=r,this.angle=i,this.penumbra=o,this.decay=a,this.map=null,this.shadow=new Gee}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,n){return super.copy(e,n),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const SO=new gt,ch=new ne,gw=new ne;class Wee extends rC{constructor(){super(new gr(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new xt(4,2),this._viewportCount=6,this._viewports=[new Yt(2,1,1,1),new Yt(0,1,1,1),new Yt(3,1,1,1),new Yt(1,1,1,1),new Yt(3,0,1,1),new Yt(1,0,1,1)],this._cubeDirections=[new ne(1,0,0),new ne(-1,0,0),new ne(0,0,1),new ne(0,0,-1),new ne(0,1,0),new ne(0,-1,0)],this._cubeUps=[new ne(0,1,0),new ne(0,1,0),new ne(0,1,0),new ne(0,1,0),new ne(0,0,1),new ne(0,0,-1)]}updateMatrices(e,n=0){const r=this.camera,i=this.matrix,o=e.distance||r.far;o!==r.far&&(r.far=o,r.updateProjectionMatrix()),ch.setFromMatrixPosition(e.matrixWorld),r.position.copy(ch),gw.copy(r.position),gw.add(this._cubeDirections[n]),r.up.copy(this._cubeUps[n]),r.lookAt(gw),r.updateMatrixWorld(),i.makeTranslation(-ch.x,-ch.y,-ch.z),SO.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),this._frustum.setFromProjectionMatrix(SO)}}class W4 extends Dm{constructor(e,n,r=0,i=2){super(e,n),this.isPointLight=!0,this.type="PointLight",this.distance=r,this.decay=i,this.shadow=new Wee}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,n){return super.copy(e,n),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class Fx extends k4{constructor(e=-1,n=1,r=1,i=-1,o=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=n,this.top=r,this.bottom=i,this.near=o,this.far=a,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,n,r,i,o,a){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),n=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let o=r-e,a=r+e,s=i+n,l=i-n;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;o+=c*this.view.offsetX,a=o+c*this.view.width,s-=u*this.view.offsetY,l=s-u*this.view.height}this.projectionMatrix.makeOrthographic(o,a,s,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.zoom=this.zoom,n.object.left=this.left,n.object.right=this.right,n.object.top=this.top,n.object.bottom=this.bottom,n.object.near=this.near,n.object.far=this.far,this.view!==null&&(n.object.view=Object.assign({},this.view)),n}}class Xee extends rC{constructor(){super(new Fx(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class Bx extends Dm{constructor(e,n){super(e,n),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(vn.DEFAULT_UP),this.updateMatrix(),this.target=new vn,this.shadow=new Xee}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class X4 extends Dm{constructor(e,n){super(e,n),this.isAmbientLight=!0,this.type="AmbientLight"}}class mc{static extractUrlBase(e){const n=e.lastIndexOf("/");return n===-1?"./":e.slice(0,n+1)}static resolveURL(e,n){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(n)&&/^\//.test(e)&&(n=n.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:n+e)}}const vw=new WeakMap;class qee extends Vo{constructor(e){super(e),this.isImageBitmapLoader=!0,typeof createImageBitmap>"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,n,r,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,a=Bs.get(e);if(a!==void 0){if(o.manager.itemStart(e),a.then){a.then(c=>{if(vw.has(a)===!0)i&&i(vw.get(a)),o.manager.itemError(e),o.manager.itemEnd(e);else return n&&n(c),o.manager.itemEnd(e),c});return}return setTimeout(function(){n&&n(a),o.manager.itemEnd(e)},0),a}const s={};s.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",s.headers=this.requestHeader;const l=fetch(e,s).then(function(c){return c.blob()}).then(function(c){return createImageBitmap(c,Object.assign(o.options,{colorSpaceConversion:"none"}))}).then(function(c){return Bs.add(e,c),n&&n(c),o.manager.itemEnd(e),c}).catch(function(c){i&&i(c),vw.set(l,c),Bs.remove(e),o.manager.itemError(e),o.manager.itemEnd(e)});Bs.add(e,l),o.manager.itemStart(e)}}class Kee extends gr{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}const iC="\\[\\]\\.:\\/",Yee=new RegExp("["+iC+"]","g"),oC="[^"+iC+"]",Jee="[^"+iC.replace("\\.","")+"]",Zee=/((?:WC+[\/:])*)/.source.replace("WC",oC),Qee=/(WCOD+)?/.source.replace("WCOD",Jee),ete=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",oC),tte=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",oC),nte=new RegExp("^"+Zee+Qee+ete+tte+"$"),rte=["material","materials","bones","map"];class ite{constructor(e,n,r){const i=r||nn.parseTrackName(n);this._targetGroup=e,this._bindings=e.subscribe_(n,i)}getValue(e,n){this.bind();const r=this._targetGroup.nCachedObjects_,i=this._bindings[r];i!==void 0&&i.getValue(e,n)}setValue(e,n){const r=this._bindings;for(let i=this._targetGroup.nCachedObjects_,o=r.length;i!==o;++i)r[i].setValue(e,n)}bind(){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=e.length;n!==r;++n)e[n].bind()}unbind(){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=e.length;n!==r;++n)e[n].unbind()}}class nn{constructor(e,n,r){this.path=n,this.parsedPath=r||nn.parseTrackName(n),this.node=nn.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,n,r){return e&&e.isAnimationObjectGroup?new nn.Composite(e,n,r):new nn(e,n,r)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(Yee,"")}static parseTrackName(e){const n=nte.exec(e);if(n===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const r={nodeName:n[2],objectName:n[3],objectIndex:n[4],propertyName:n[5],propertyIndex:n[6]},i=r.nodeName&&r.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const o=r.nodeName.substring(i+1);rte.indexOf(o)!==-1&&(r.nodeName=r.nodeName.substring(0,i),r.objectName=o)}if(r.propertyName===null||r.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return r}static findNode(e,n){if(n===void 0||n===""||n==="."||n===-1||n===e.name||n===e.uuid)return e;if(e.skeleton){const r=e.skeleton.getBoneByName(n);if(r!==void 0)return r}if(e.children){const r=function(o){for(let a=0;ap.start-y.start);let f=0;for(let p=1;p 0 + vec4 plane; + #ifdef ALPHA_TO_COVERAGE + float distanceToPlane, distanceGradient; + float clipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + if ( clipOpacity == 0.0 ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + float unionClipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + } + #pragma unroll_loop_end + clipOpacity *= 1.0 - unionClipOpacity; + #endif + diffuseColor.a *= clipOpacity; + if ( diffuseColor.a == 0.0 ) discard; + #else + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + bool clipped = true; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; + } + #pragma unroll_loop_end + if ( clipped ) discard; + #endif + #endif +#endif`,Ete=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; + uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; +#endif`,Tte=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; +#endif`,Mte=`#if NUM_CLIPPING_PLANES > 0 + vClipPosition = - mvPosition.xyz; +#endif`,Ate=`#if defined( USE_COLOR_ALPHA ) + diffuseColor *= vColor; +#elif defined( USE_COLOR ) + diffuseColor.rgb *= vColor; +#endif`,Cte=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) + varying vec3 vColor; +#endif`,Pte=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) + varying vec3 vColor; +#endif`,Rte=`#if defined( USE_COLOR_ALPHA ) + vColor = vec4( 1.0 ); +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) + vColor = vec3( 1.0 ); +#endif +#ifdef USE_COLOR + vColor *= color; +#endif +#ifdef USE_INSTANCING_COLOR + vColor.xyz *= instanceColor.xyz; +#endif +#ifdef USE_BATCHING_COLOR + vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) ); + vColor.xyz *= batchingColor.xyz; +#endif`,Nte=`#define PI 3.141592653589793 +#define PI2 6.283185307179586 +#define PI_HALF 1.5707963267948966 +#define RECIPROCAL_PI 0.3183098861837907 +#define RECIPROCAL_PI2 0.15915494309189535 +#define EPSILON 1e-6 +#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +#define whiteComplement( a ) ( 1.0 - saturate( a ) ) +float pow2( const in float x ) { return x*x; } +vec3 pow2( const in vec3 x ) { return x*x; } +float pow3( const in float x ) { return x*x*x; } +float pow4( const in float x ) { float x2 = x*x; return x2*x2; } +float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } +float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } +highp float rand( const in vec2 uv ) { + const highp float a = 12.9898, b = 78.233, c = 43758.5453; + highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); + return fract( sin( sn ) * c ); +} +#ifdef HIGH_PRECISION + float precisionSafeLength( vec3 v ) { return length( v ); } +#else + float precisionSafeLength( vec3 v ) { + float maxComponent = max3( abs( v ) ); + return length( v / maxComponent ) * maxComponent; + } +#endif +struct IncidentLight { + vec3 color; + vec3 direction; + bool visible; +}; +struct ReflectedLight { + vec3 directDiffuse; + vec3 directSpecular; + vec3 indirectDiffuse; + vec3 indirectSpecular; +}; +#ifdef USE_ALPHAHASH + varying vec3 vPosition; +#endif +vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); +} +vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); +} +mat3 transposeMat3( const in mat3 m ) { + mat3 tmp; + tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); + tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); + tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); + return tmp; +} +bool isPerspectiveMatrix( mat4 m ) { + return m[ 2 ][ 3 ] == - 1.0; +} +vec2 equirectUv( in vec3 dir ) { + float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; + float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; + return vec2( u, v ); +} +vec3 BRDF_Lambert( const in vec3 diffuseColor ) { + return RECIPROCAL_PI * diffuseColor; +} +vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} +float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} // validated`,Ote=`#ifdef ENVMAP_TYPE_CUBE_UV + #define cubeUV_minMipLevel 4.0 + #define cubeUV_minTileSize 16.0 + float getFace( vec3 direction ) { + vec3 absDirection = abs( direction ); + float face = - 1.0; + if ( absDirection.x > absDirection.z ) { + if ( absDirection.x > absDirection.y ) + face = direction.x > 0.0 ? 0.0 : 3.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } else { + if ( absDirection.z > absDirection.y ) + face = direction.z > 0.0 ? 2.0 : 5.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } + return face; + } + vec2 getUV( vec3 direction, float face ) { + vec2 uv; + if ( face == 0.0 ) { + uv = vec2( direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 1.0 ) { + uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); + } else if ( face == 2.0 ) { + uv = vec2( - direction.x, direction.y ) / abs( direction.z ); + } else if ( face == 3.0 ) { + uv = vec2( - direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 4.0 ) { + uv = vec2( - direction.x, direction.z ) / abs( direction.y ); + } else { + uv = vec2( direction.x, direction.y ) / abs( direction.z ); + } + return 0.5 * ( uv + 1.0 ); + } + vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { + float face = getFace( direction ); + float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); + mipInt = max( mipInt, cubeUV_minMipLevel ); + float faceSize = exp2( mipInt ); + highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; + if ( face > 2.0 ) { + uv.y += faceSize; + face -= 3.0; + } + uv.x += face * faceSize; + uv.x += filterInt * 3.0 * cubeUV_minTileSize; + uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); + uv.x *= CUBEUV_TEXEL_WIDTH; + uv.y *= CUBEUV_TEXEL_HEIGHT; + #ifdef texture2DGradEXT + return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; + #else + return texture2D( envMap, uv ).rgb; + #endif + } + #define cubeUV_r0 1.0 + #define cubeUV_m0 - 2.0 + #define cubeUV_r1 0.8 + #define cubeUV_m1 - 1.0 + #define cubeUV_r4 0.4 + #define cubeUV_m4 2.0 + #define cubeUV_r5 0.305 + #define cubeUV_m5 3.0 + #define cubeUV_r6 0.21 + #define cubeUV_m6 4.0 + float roughnessToMip( float roughness ) { + float mip = 0.0; + if ( roughness >= cubeUV_r1 ) { + mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; + } else if ( roughness >= cubeUV_r4 ) { + mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; + } else if ( roughness >= cubeUV_r5 ) { + mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; + } else if ( roughness >= cubeUV_r6 ) { + mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; + } else { + mip = - 2.0 * log2( 1.16 * roughness ); } + return mip; + } + vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { + float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); + float mipF = fract( mip ); + float mipInt = floor( mip ); + vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); + if ( mipF == 0.0 ) { + return vec4( color0, 1.0 ); + } else { + vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); + return vec4( mix( color0, color1, mipF ), 1.0 ); + } + } +#endif`,Ite=`vec3 transformedNormal = objectNormal; +#ifdef USE_TANGENT + vec3 transformedTangent = objectTangent; +#endif +#ifdef USE_BATCHING + mat3 bm = mat3( batchingMatrix ); + transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); + transformedNormal = bm * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = bm * transformedTangent; + #endif +#endif +#ifdef USE_INSTANCING + mat3 im = mat3( instanceMatrix ); + transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); + transformedNormal = im * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = im * transformedTangent; + #endif +#endif +transformedNormal = normalMatrix * transformedNormal; +#ifdef FLIP_SIDED + transformedNormal = - transformedNormal; +#endif +#ifdef USE_TANGENT + transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; + #ifdef FLIP_SIDED + transformedTangent = - transformedTangent; + #endif +#endif`,Dte=`#ifdef USE_DISPLACEMENTMAP + uniform sampler2D displacementMap; + uniform float displacementScale; + uniform float displacementBias; +#endif`,Lte=`#ifdef USE_DISPLACEMENTMAP + transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); +#endif`,kte=`#ifdef USE_EMISSIVEMAP + vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); + #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE + emissiveColor = sRGBTransferEOTF( emissiveColor ); + #endif + totalEmissiveRadiance *= emissiveColor.rgb; +#endif`,jte=`#ifdef USE_EMISSIVEMAP + uniform sampler2D emissiveMap; +#endif`,Ute="gl_FragColor = linearToOutputTexel( gl_FragColor );",Fte=`vec4 LinearTransferOETF( in vec4 value ) { + return value; +} +vec4 sRGBTransferEOTF( in vec4 value ) { + return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); +} +vec4 sRGBTransferOETF( in vec4 value ) { + return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); +}`,Bte=`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vec3 cameraToFrag; + if ( isOrthographic ) { + cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToFrag = normalize( vWorldPosition - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vec3 reflectVec = reflect( cameraToFrag, worldNormal ); + #else + vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); + #endif + #else + vec3 reflectVec = vReflect; + #endif + #ifdef ENVMAP_TYPE_CUBE + vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); + #else + vec4 envColor = vec4( 0.0 ); + #endif + #ifdef ENVMAP_BLENDING_MULTIPLY + outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_MIX ) + outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_ADD ) + outgoingLight += envColor.xyz * specularStrength * reflectivity; + #endif +#endif`,$te=`#ifdef USE_ENVMAP + uniform float envMapIntensity; + uniform float flipEnvMap; + uniform mat3 envMapRotation; + #ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; + #else + uniform sampler2D envMap; + #endif + +#endif`,zte=`#ifdef USE_ENVMAP + uniform float reflectivity; + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + varying vec3 vWorldPosition; + uniform float refractionRatio; + #else + varying vec3 vReflect; + #endif +#endif`,Hte=`#ifdef USE_ENVMAP + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + + varying vec3 vWorldPosition; + #else + varying vec3 vReflect; + uniform float refractionRatio; + #endif +#endif`,Vte=`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vWorldPosition = worldPosition.xyz; + #else + vec3 cameraToVertex; + if ( isOrthographic ) { + cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vReflect = reflect( cameraToVertex, worldNormal ); + #else + vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); + #endif + #endif +#endif`,Gte=`#ifdef USE_FOG + vFogDepth = - mvPosition.z; +#endif`,Wte=`#ifdef USE_FOG + varying float vFogDepth; +#endif`,Xte=`#ifdef USE_FOG + #ifdef FOG_EXP2 + float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); + #else + float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); + #endif + gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); +#endif`,qte=`#ifdef USE_FOG + uniform vec3 fogColor; + varying float vFogDepth; + #ifdef FOG_EXP2 + uniform float fogDensity; + #else + uniform float fogNear; + uniform float fogFar; + #endif +#endif`,Kte=`#ifdef USE_GRADIENTMAP + uniform sampler2D gradientMap; +#endif +vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { + float dotNL = dot( normal, lightDirection ); + vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); + #ifdef USE_GRADIENTMAP + return vec3( texture2D( gradientMap, coord ).r ); + #else + vec2 fw = fwidth( coord ) * 0.5; + return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); + #endif +}`,Yte=`#ifdef USE_LIGHTMAP + uniform sampler2D lightMap; + uniform float lightMapIntensity; +#endif`,Jte=`LambertMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularStrength = specularStrength;`,Zte=`varying vec3 vViewPosition; +struct LambertMaterial { + vec3 diffuseColor; + float specularStrength; +}; +void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Lambert +#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,Qte=`uniform bool receiveShadow; +uniform vec3 ambientLightColor; +#if defined( USE_LIGHT_PROBES ) + uniform vec3 lightProbe[ 9 ]; +#endif +vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { + float x = normal.x, y = normal.y, z = normal.z; + vec3 result = shCoefficients[ 0 ] * 0.886227; + result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; + result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; + result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; + result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; + result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; + result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); + result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; + result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); + return result; +} +vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); + return irradiance; +} +vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { + vec3 irradiance = ambientLightColor; + return irradiance; +} +float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { + float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); + if ( cutoffDistance > 0.0 ) { + distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); + } + return distanceFalloff; +} +float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { + return smoothstep( coneCosine, penumbraCosine, angleCosine ); +} +#if NUM_DIR_LIGHTS > 0 + struct DirectionalLight { + vec3 direction; + vec3 color; + }; + uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; + void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { + light.color = directionalLight.color; + light.direction = directionalLight.direction; + light.visible = true; + } +#endif +#if NUM_POINT_LIGHTS > 0 + struct PointLight { + vec3 position; + vec3 color; + float distance; + float decay; + }; + uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; + void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = pointLight.position - geometryPosition; + light.direction = normalize( lVector ); + float lightDistance = length( lVector ); + light.color = pointLight.color; + light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } +#endif +#if NUM_SPOT_LIGHTS > 0 + struct SpotLight { + vec3 position; + vec3 direction; + vec3 color; + float distance; + float decay; + float coneCos; + float penumbraCos; + }; + uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; + void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = spotLight.position - geometryPosition; + light.direction = normalize( lVector ); + float angleCos = dot( light.direction, spotLight.direction ); + float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); + if ( spotAttenuation > 0.0 ) { + float lightDistance = length( lVector ); + light.color = spotLight.color * spotAttenuation; + light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } else { + light.color = vec3( 0.0 ); + light.visible = false; + } + } +#endif +#if NUM_RECT_AREA_LIGHTS > 0 + struct RectAreaLight { + vec3 color; + vec3 position; + vec3 halfWidth; + vec3 halfHeight; + }; + uniform sampler2D ltc_1; uniform sampler2D ltc_2; + uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; +#endif +#if NUM_HEMI_LIGHTS > 0 + struct HemisphereLight { + vec3 direction; + vec3 skyColor; + vec3 groundColor; + }; + uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; + vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { + float dotNL = dot( normal, hemiLight.direction ); + float hemiDiffuseWeight = 0.5 * dotNL + 0.5; + vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); + return irradiance; + } +#endif`,ene=`#ifdef USE_ENVMAP + vec3 getIBLIrradiance( const in vec3 normal ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 ); + return PI * envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 reflectVec = reflect( - viewDir, normal ); + reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); + reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness ); + return envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + #ifdef USE_ANISOTROPY + vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 bentNormal = cross( bitangent, viewDir ); + bentNormal = normalize( cross( bentNormal, bitangent ) ); + bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); + return getIBLRadiance( viewDir, bentNormal, roughness ); + #else + return vec3( 0.0 ); + #endif + } + #endif +#endif`,tne=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,nne=`varying vec3 vViewPosition; +struct ToonMaterial { + vec3 diffuseColor; +}; +void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Toon +#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,rne=`BlinnPhongMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularColor = specular; +material.specularShininess = shininess; +material.specularStrength = specularStrength;`,ine=`varying vec3 vViewPosition; +struct BlinnPhongMaterial { + vec3 diffuseColor; + vec3 specularColor; + float specularShininess; + float specularStrength; +}; +void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); + reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; +} +void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_BlinnPhong +#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,one=`PhysicalMaterial material; +material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); +vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); +float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); +material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; +material.roughness = min( material.roughness, 1.0 ); +#ifdef IOR + material.ior = ior; + #ifdef USE_SPECULAR + float specularIntensityFactor = specularIntensity; + vec3 specularColorFactor = specularColor; + #ifdef USE_SPECULAR_COLORMAP + specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; + #endif + material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); + #else + float specularIntensityFactor = 1.0; + vec3 specularColorFactor = vec3( 1.0 ); + material.specularF90 = 1.0; + #endif + material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); +#else + material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor ); + material.specularF90 = 1.0; +#endif +#ifdef USE_CLEARCOAT + material.clearcoat = clearcoat; + material.clearcoatRoughness = clearcoatRoughness; + material.clearcoatF0 = vec3( 0.04 ); + material.clearcoatF90 = 1.0; + #ifdef USE_CLEARCOATMAP + material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; + #endif + #ifdef USE_CLEARCOAT_ROUGHNESSMAP + material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; + #endif + material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); + material.clearcoatRoughness += geometryRoughness; + material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); +#endif +#ifdef USE_DISPERSION + material.dispersion = dispersion; +#endif +#ifdef USE_IRIDESCENCE + material.iridescence = iridescence; + material.iridescenceIOR = iridescenceIOR; + #ifdef USE_IRIDESCENCEMAP + material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; + #endif + #ifdef USE_IRIDESCENCE_THICKNESSMAP + material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; + #else + material.iridescenceThickness = iridescenceThicknessMaximum; + #endif +#endif +#ifdef USE_SHEEN + material.sheenColor = sheenColor; + #ifdef USE_SHEEN_COLORMAP + material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; + #endif + material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); + #ifdef USE_SHEEN_ROUGHNESSMAP + material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; + #endif +#endif +#ifdef USE_ANISOTROPY + #ifdef USE_ANISOTROPYMAP + mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); + vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; + vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; + #else + vec2 anisotropyV = anisotropyVector; + #endif + material.anisotropy = length( anisotropyV ); + if( material.anisotropy == 0.0 ) { + anisotropyV = vec2( 1.0, 0.0 ); + } else { + anisotropyV /= material.anisotropy; + material.anisotropy = saturate( material.anisotropy ); + } + material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); + material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; + material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; +#endif`,ane=`struct PhysicalMaterial { + vec3 diffuseColor; + float roughness; + vec3 specularColor; + float specularF90; + float dispersion; + #ifdef USE_CLEARCOAT + float clearcoat; + float clearcoatRoughness; + vec3 clearcoatF0; + float clearcoatF90; + #endif + #ifdef USE_IRIDESCENCE + float iridescence; + float iridescenceIOR; + float iridescenceThickness; + vec3 iridescenceFresnel; + vec3 iridescenceF0; + #endif + #ifdef USE_SHEEN + vec3 sheenColor; + float sheenRoughness; + #endif + #ifdef IOR + float ior; + #endif + #ifdef USE_TRANSMISSION + float transmission; + float transmissionAlpha; + float thickness; + float attenuationDistance; + vec3 attenuationColor; + #endif + #ifdef USE_ANISOTROPY + float anisotropy; + float alphaT; + vec3 anisotropyT; + vec3 anisotropyB; + #endif +}; +vec3 clearcoatSpecularDirect = vec3( 0.0 ); +vec3 clearcoatSpecularIndirect = vec3( 0.0 ); +vec3 sheenSpecularDirect = vec3( 0.0 ); +vec3 sheenSpecularIndirect = vec3(0.0 ); +vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { + float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); + float x2 = x * x; + float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); + return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); +} +float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { + float a2 = pow2( alpha ); + float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); + float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); + return 0.5 / max( gv + gl, EPSILON ); +} +float D_GGX( const in float alpha, const in float dotNH ) { + float a2 = pow2( alpha ); + float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; + return RECIPROCAL_PI * a2 / pow2( denom ); +} +#ifdef USE_ANISOTROPY + float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) { + float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); + float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); + float v = 0.5 / ( gv + gl ); + return saturate(v); + } + float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { + float a2 = alphaT * alphaB; + highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); + highp float v2 = dot( v, v ); + float w2 = a2 / v2; + return RECIPROCAL_PI * a2 * pow2 ( w2 ); + } +#endif +#ifdef USE_CLEARCOAT + vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { + vec3 f0 = material.clearcoatF0; + float f90 = material.clearcoatF90; + float roughness = material.clearcoatRoughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + return F * ( V * D ); + } +#endif +vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { + vec3 f0 = material.specularColor; + float f90 = material.specularF90; + float roughness = material.roughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + #ifdef USE_IRIDESCENCE + F = mix( F, material.iridescenceFresnel, material.iridescence ); + #endif + #ifdef USE_ANISOTROPY + float dotTL = dot( material.anisotropyT, lightDir ); + float dotTV = dot( material.anisotropyT, viewDir ); + float dotTH = dot( material.anisotropyT, halfDir ); + float dotBL = dot( material.anisotropyB, lightDir ); + float dotBV = dot( material.anisotropyB, viewDir ); + float dotBH = dot( material.anisotropyB, halfDir ); + float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); + float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); + #else + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + #endif + return F * ( V * D ); +} +vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { + const float LUT_SIZE = 64.0; + const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; + const float LUT_BIAS = 0.5 / LUT_SIZE; + float dotNV = saturate( dot( N, V ) ); + vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); + uv = uv * LUT_SCALE + LUT_BIAS; + return uv; +} +float LTC_ClippedSphereFormFactor( const in vec3 f ) { + float l = length( f ); + return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); +} +vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { + float x = dot( v1, v2 ); + float y = abs( x ); + float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; + float b = 3.4175940 + ( 4.1616724 + y ) * y; + float v = a / b; + float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; + return cross( v1, v2 ) * theta_sintheta; +} +vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { + vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; + vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; + vec3 lightNormal = cross( v1, v2 ); + if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); + vec3 T1, T2; + T1 = normalize( V - N * dot( V, N ) ); + T2 = - cross( N, T1 ); + mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); + vec3 coords[ 4 ]; + coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); + coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); + coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); + coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); + coords[ 0 ] = normalize( coords[ 0 ] ); + coords[ 1 ] = normalize( coords[ 1 ] ); + coords[ 2 ] = normalize( coords[ 2 ] ); + coords[ 3 ] = normalize( coords[ 3 ] ); + vec3 vectorFormFactor = vec3( 0.0 ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); + float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); + return vec3( result ); +} +#if defined( USE_SHEEN ) +float D_Charlie( float roughness, float dotNH ) { + float alpha = pow2( roughness ); + float invAlpha = 1.0 / alpha; + float cos2h = dotNH * dotNH; + float sin2h = max( 1.0 - cos2h, 0.0078125 ); + return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); +} +float V_Neubelt( float dotNV, float dotNL ) { + return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); +} +vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float D = D_Charlie( sheenRoughness, dotNH ); + float V = V_Neubelt( dotNV, dotNL ); + return sheenColor * ( D * V ); +} +#endif +float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + float r2 = roughness * roughness; + float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; + float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; + float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); + return saturate( DG * RECIPROCAL_PI ); +} +vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); + const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); + vec4 r = roughness * c0 + c1; + float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; + vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; + return fab; +} +vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { + vec2 fab = DFGApprox( normal, viewDir, roughness ); + return specularColor * fab.x + specularF90 * fab.y; +} +#ifdef USE_IRIDESCENCE +void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#else +void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#endif + vec2 fab = DFGApprox( normal, viewDir, roughness ); + #ifdef USE_IRIDESCENCE + vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); + #else + vec3 Fr = specularColor; + #endif + vec3 FssEss = Fr * fab.x + specularF90 * fab.y; + float Ess = fab.x + fab.y; + float Ems = 1.0 - Ess; + vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); + singleScatter += FssEss; + multiScatter += Fms * Ems; +} +#if NUM_RECT_AREA_LIGHTS > 0 + void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + vec3 normal = geometryNormal; + vec3 viewDir = geometryViewDir; + vec3 position = geometryPosition; + vec3 lightPos = rectAreaLight.position; + vec3 halfWidth = rectAreaLight.halfWidth; + vec3 halfHeight = rectAreaLight.halfHeight; + vec3 lightColor = rectAreaLight.color; + float roughness = material.roughness; + vec3 rectCoords[ 4 ]; + rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; + rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; + rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; + vec2 uv = LTC_Uv( normal, viewDir, roughness ); + vec4 t1 = texture2D( ltc_1, uv ); + vec4 t2 = texture2D( ltc_2, uv ); + mat3 mInv = mat3( + vec3( t1.x, 0, t1.y ), + vec3( 0, 1, 0 ), + vec3( t1.z, 0, t1.w ) + ); + vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); + reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); + reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); + } +#endif +void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + #ifdef USE_CLEARCOAT + float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); + vec3 ccIrradiance = dotNLcc * directLight.color; + clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); + #endif + #ifdef USE_SHEEN + sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); + #endif + reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material ); + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { + #ifdef USE_CLEARCOAT + clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); + #endif + #ifdef USE_SHEEN + sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); + #endif + vec3 singleScattering = vec3( 0.0 ); + vec3 multiScattering = vec3( 0.0 ); + vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; + #ifdef USE_IRIDESCENCE + computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); + #else + computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); + #endif + vec3 totalScattering = singleScattering + multiScattering; + vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); + reflectedLight.indirectSpecular += radiance * singleScattering; + reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; + reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; +} +#define RE_Direct RE_Direct_Physical +#define RE_Direct_RectArea RE_Direct_RectArea_Physical +#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical +#define RE_IndirectSpecular RE_IndirectSpecular_Physical +float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { + return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); +}`,sne=` +vec3 geometryPosition = - vViewPosition; +vec3 geometryNormal = normal; +vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); +vec3 geometryClearcoatNormal = vec3( 0.0 ); +#ifdef USE_CLEARCOAT + geometryClearcoatNormal = clearcoatNormal; +#endif +#ifdef USE_IRIDESCENCE + float dotNVi = saturate( dot( normal, geometryViewDir ) ); + if ( material.iridescenceThickness == 0.0 ) { + material.iridescence = 0.0; + } else { + material.iridescence = saturate( material.iridescence ); + } + if ( material.iridescence > 0.0 ) { + material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); + material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); + } +#endif +IncidentLight directLight; +#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) + PointLight pointLight; + #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { + pointLight = pointLights[ i ]; + getPointLightInfo( pointLight, geometryPosition, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) + pointLightShadow = pointLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) + SpotLight spotLight; + vec4 spotColor; + vec3 spotLightCoord; + bool inSpotLightMap; + #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { + spotLight = spotLights[ i ]; + getSpotLightInfo( spotLight, geometryPosition, directLight ); + #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX + #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS + #else + #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #endif + #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) + spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; + inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); + spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); + directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; + #endif + #undef SPOT_LIGHT_MAP_INDEX + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + spotLightShadow = spotLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) + DirectionalLight directionalLight; + #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { + directionalLight = directionalLights[ i ]; + getDirectionalLightInfo( directionalLight, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) + directionalLightShadow = directionalLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) + RectAreaLight rectAreaLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { + rectAreaLight = rectAreaLights[ i ]; + RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if defined( RE_IndirectDiffuse ) + vec3 iblIrradiance = vec3( 0.0 ); + vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); + #if defined( USE_LIGHT_PROBES ) + irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); + #endif + #if ( NUM_HEMI_LIGHTS > 0 ) + #pragma unroll_loop_start + for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { + irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); + } + #pragma unroll_loop_end + #endif +#endif +#if defined( RE_IndirectSpecular ) + vec3 radiance = vec3( 0.0 ); + vec3 clearcoatRadiance = vec3( 0.0 ); +#endif`,lne=`#if defined( RE_IndirectDiffuse ) + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; + irradiance += lightMapIrradiance; + #endif + #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) + iblIrradiance += getIBLIrradiance( geometryNormal ); + #endif +#endif +#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) + #ifdef USE_ANISOTROPY + radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); + #else + radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); + #endif + #ifdef USE_CLEARCOAT + clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); + #endif +#endif`,cne=`#if defined( RE_IndirectDiffuse ) + RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); +#endif +#if defined( RE_IndirectSpecular ) + RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); +#endif`,une=`#if defined( USE_LOGDEPTHBUF ) + gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; +#endif`,dne=`#if defined( USE_LOGDEPTHBUF ) + uniform float logDepthBufFC; + varying float vFragDepth; + varying float vIsPerspective; +#endif`,fne=`#ifdef USE_LOGDEPTHBUF + varying float vFragDepth; + varying float vIsPerspective; +#endif`,hne=`#ifdef USE_LOGDEPTHBUF + vFragDepth = 1.0 + gl_Position.w; + vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); +#endif`,pne=`#ifdef USE_MAP + vec4 sampledDiffuseColor = texture2D( map, vMapUv ); + #ifdef DECODE_VIDEO_TEXTURE + sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor ); + #endif + diffuseColor *= sampledDiffuseColor; +#endif`,mne=`#ifdef USE_MAP + uniform sampler2D map; +#endif`,gne=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + #if defined( USE_POINTS_UV ) + vec2 uv = vUv; + #else + vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; + #endif +#endif +#ifdef USE_MAP + diffuseColor *= texture2D( map, uv ); +#endif +#ifdef USE_ALPHAMAP + diffuseColor.a *= texture2D( alphaMap, uv ).g; +#endif`,vne=`#if defined( USE_POINTS_UV ) + varying vec2 vUv; +#else + #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + uniform mat3 uvTransform; + #endif +#endif +#ifdef USE_MAP + uniform sampler2D map; +#endif +#ifdef USE_ALPHAMAP + uniform sampler2D alphaMap; +#endif`,yne=`float metalnessFactor = metalness; +#ifdef USE_METALNESSMAP + vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); + metalnessFactor *= texelMetalness.b; +#endif`,xne=`#ifdef USE_METALNESSMAP + uniform sampler2D metalnessMap; +#endif`,bne=`#ifdef USE_INSTANCING_MORPH + float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; + } +#endif`,_ne=`#if defined( USE_MORPHCOLORS ) + vColor *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + #if defined( USE_COLOR_ALPHA ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; + #elif defined( USE_COLOR ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; + #endif + } +#endif`,wne=`#ifdef USE_MORPHNORMALS + objectNormal *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; + } +#endif`,Sne=`#ifdef USE_MORPHTARGETS + #ifndef USE_INSTANCING_MORPH + uniform float morphTargetBaseInfluence; + uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + #endif + uniform sampler2DArray morphTargetsTexture; + uniform ivec2 morphTargetsTextureSize; + vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { + int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; + int y = texelIndex / morphTargetsTextureSize.x; + int x = texelIndex - y * morphTargetsTextureSize.x; + ivec3 morphUV = ivec3( x, y, morphTargetIndex ); + return texelFetch( morphTargetsTexture, morphUV, 0 ); + } +#endif`,Ene=`#ifdef USE_MORPHTARGETS + transformed *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; + } +#endif`,Tne=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; +#ifdef FLAT_SHADED + vec3 fdx = dFdx( vViewPosition ); + vec3 fdy = dFdy( vViewPosition ); + vec3 normal = normalize( cross( fdx, fdy ) ); +#else + vec3 normal = normalize( vNormal ); + #ifdef DOUBLE_SIDED + normal *= faceDirection; + #endif +#endif +#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) + #ifdef USE_TANGENT + mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn = getTangentFrame( - vViewPosition, normal, + #if defined( USE_NORMALMAP ) + vNormalMapUv + #elif defined( USE_CLEARCOAT_NORMALMAP ) + vClearcoatNormalMapUv + #else + vUv + #endif + ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn[0] *= faceDirection; + tbn[1] *= faceDirection; + #endif +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + #ifdef USE_TANGENT + mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn2[0] *= faceDirection; + tbn2[1] *= faceDirection; + #endif +#endif +vec3 nonPerturbedNormal = normal;`,Mne=`#ifdef USE_NORMALMAP_OBJECTSPACE + normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + #ifdef FLIP_SIDED + normal = - normal; + #endif + #ifdef DOUBLE_SIDED + normal = normal * faceDirection; + #endif + normal = normalize( normalMatrix * normal ); +#elif defined( USE_NORMALMAP_TANGENTSPACE ) + vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + mapN.xy *= normalScale; + normal = normalize( tbn * mapN ); +#elif defined( USE_BUMPMAP ) + normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); +#endif`,Ane=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,Cne=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,Pne=`#ifndef FLAT_SHADED + vNormal = normalize( transformedNormal ); + #ifdef USE_TANGENT + vTangent = normalize( transformedTangent ); + vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); + #endif +#endif`,Rne=`#ifdef USE_NORMALMAP + uniform sampler2D normalMap; + uniform vec2 normalScale; +#endif +#ifdef USE_NORMALMAP_OBJECTSPACE + uniform mat3 normalMatrix; +#endif +#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) + mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { + vec3 q0 = dFdx( eye_pos.xyz ); + vec3 q1 = dFdy( eye_pos.xyz ); + vec2 st0 = dFdx( uv.st ); + vec2 st1 = dFdy( uv.st ); + vec3 N = surf_norm; + vec3 q1perp = cross( q1, N ); + vec3 q0perp = cross( N, q0 ); + vec3 T = q1perp * st0.x + q0perp * st1.x; + vec3 B = q1perp * st0.y + q0perp * st1.y; + float det = max( dot( T, T ), dot( B, B ) ); + float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); + return mat3( T * scale, B * scale, N ); + } +#endif`,Nne=`#ifdef USE_CLEARCOAT + vec3 clearcoatNormal = nonPerturbedNormal; +#endif`,One=`#ifdef USE_CLEARCOAT_NORMALMAP + vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; + clearcoatMapN.xy *= clearcoatNormalScale; + clearcoatNormal = normalize( tbn2 * clearcoatMapN ); +#endif`,Ine=`#ifdef USE_CLEARCOATMAP + uniform sampler2D clearcoatMap; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform sampler2D clearcoatNormalMap; + uniform vec2 clearcoatNormalScale; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform sampler2D clearcoatRoughnessMap; +#endif`,Dne=`#ifdef USE_IRIDESCENCEMAP + uniform sampler2D iridescenceMap; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform sampler2D iridescenceThicknessMap; +#endif`,Lne=`#ifdef OPAQUE +diffuseColor.a = 1.0; +#endif +#ifdef USE_TRANSMISSION +diffuseColor.a *= material.transmissionAlpha; +#endif +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,kne=`vec3 packNormalToRGB( const in vec3 normal ) { + return normalize( normal ) * 0.5 + 0.5; +} +vec3 unpackRGBToNormal( const in vec3 rgb ) { + return 2.0 * rgb.xyz - 1.0; +} +const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.; +const float Inv255 = 1. / 255.; +const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 ); +const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g ); +const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b ); +const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a ); +vec4 packDepthToRGBA( const in float v ) { + if( v <= 0.0 ) + return vec4( 0., 0., 0., 0. ); + if( v >= 1.0 ) + return vec4( 1., 1., 1., 1. ); + float vuf; + float af = modf( v * PackFactors.a, vuf ); + float bf = modf( vuf * ShiftRight8, vuf ); + float gf = modf( vuf * ShiftRight8, vuf ); + return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af ); +} +vec3 packDepthToRGB( const in float v ) { + if( v <= 0.0 ) + return vec3( 0., 0., 0. ); + if( v >= 1.0 ) + return vec3( 1., 1., 1. ); + float vuf; + float bf = modf( v * PackFactors.b, vuf ); + float gf = modf( vuf * ShiftRight8, vuf ); + return vec3( vuf * Inv255, gf * PackUpscale, bf ); +} +vec2 packDepthToRG( const in float v ) { + if( v <= 0.0 ) + return vec2( 0., 0. ); + if( v >= 1.0 ) + return vec2( 1., 1. ); + float vuf; + float gf = modf( v * 256., vuf ); + return vec2( vuf * Inv255, gf ); +} +float unpackRGBAToDepth( const in vec4 v ) { + return dot( v, UnpackFactors4 ); +} +float unpackRGBToDepth( const in vec3 v ) { + return dot( v, UnpackFactors3 ); +} +float unpackRGToDepth( const in vec2 v ) { + return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g; +} +vec4 pack2HalfToRGBA( const in vec2 v ) { + vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); + return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); +} +vec2 unpackRGBATo2Half( const in vec4 v ) { + return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); +} +float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { + return ( viewZ + near ) / ( near - far ); +} +float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { + return depth * ( near - far ) - near; +} +float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { + return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); +} +float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { + return ( near * far ) / ( ( far - near ) * depth - far ); +}`,jne=`#ifdef PREMULTIPLIED_ALPHA + gl_FragColor.rgb *= gl_FragColor.a; +#endif`,Une=`vec4 mvPosition = vec4( transformed, 1.0 ); +#ifdef USE_BATCHING + mvPosition = batchingMatrix * mvPosition; +#endif +#ifdef USE_INSTANCING + mvPosition = instanceMatrix * mvPosition; +#endif +mvPosition = modelViewMatrix * mvPosition; +gl_Position = projectionMatrix * mvPosition;`,Fne=`#ifdef DITHERING + gl_FragColor.rgb = dithering( gl_FragColor.rgb ); +#endif`,Bne=`#ifdef DITHERING + vec3 dithering( vec3 color ) { + float grid_position = rand( gl_FragCoord.xy ); + vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); + dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); + return color + dither_shift_RGB; + } +#endif`,$ne=`float roughnessFactor = roughness; +#ifdef USE_ROUGHNESSMAP + vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); + roughnessFactor *= texelRoughness.g; +#endif`,zne=`#ifdef USE_ROUGHNESSMAP + uniform sampler2D roughnessMap; +#endif`,Hne=`#if NUM_SPOT_LIGHT_COORDS > 0 + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#if NUM_SPOT_LIGHT_MAPS > 0 + uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; + struct SpotLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif + float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { + return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); + } + vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { + return unpackRGBATo2Half( texture2D( shadow, uv ) ); + } + float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ + float occlusion = 1.0; + vec2 distribution = texture2DDistribution( shadow, uv ); + float hard_shadow = step( compare , distribution.x ); + if (hard_shadow != 1.0 ) { + float distance = compare - distribution.x ; + float variance = max( 0.00000, distribution.y * distribution.y ); + float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); + } + return occlusion; + } + float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { + float shadow = 1.0; + shadowCoord.xyz /= shadowCoord.w; + shadowCoord.z += shadowBias; + bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; + bool frustumTest = inFrustum && shadowCoord.z <= 1.0; + if ( frustumTest ) { + #if defined( SHADOWMAP_TYPE_PCF ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx0 = - texelSize.x * shadowRadius; + float dy0 = - texelSize.y * shadowRadius; + float dx1 = + texelSize.x * shadowRadius; + float dy1 = + texelSize.y * shadowRadius; + float dx2 = dx0 / 2.0; + float dy2 = dy0 / 2.0; + float dx3 = dx1 / 2.0; + float dy3 = dy1 / 2.0; + shadow = ( + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) + ) * ( 1.0 / 17.0 ); + #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx = texelSize.x; + float dy = texelSize.y; + vec2 uv = shadowCoord.xy; + vec2 f = fract( uv * shadowMapSize + 0.5 ); + uv -= f * texelSize; + shadow = ( + texture2DCompare( shadowMap, uv, shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), + f.x ), + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), + f.x ), + f.y ) + ) * ( 1.0 / 9.0 ); + #elif defined( SHADOWMAP_TYPE_VSM ) + shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); + #else + shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); + #endif + } + return mix( 1.0, shadow, shadowIntensity ); + } + vec2 cubeToUV( vec3 v, float texelSizeY ) { + vec3 absV = abs( v ); + float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); + absV *= scaleToCube; + v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); + vec2 planar = v.xy; + float almostATexel = 1.5 * texelSizeY; + float almostOne = 1.0 - almostATexel; + if ( absV.z >= almostOne ) { + if ( v.z > 0.0 ) + planar.x = 4.0 - v.x; + } else if ( absV.x >= almostOne ) { + float signX = sign( v.x ); + planar.x = v.z * signX + 2.0 * signX; + } else if ( absV.y >= almostOne ) { + float signY = sign( v.y ); + planar.x = v.x + 2.0 * signY + 2.0; + planar.y = v.z * signY - 2.0; + } + return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); + } + float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { + float shadow = 1.0; + vec3 lightToPosition = shadowCoord.xyz; + + float lightToPositionLength = length( lightToPosition ); + if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) { + float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; + vec3 bd3D = normalize( lightToPosition ); + vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); + #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) + vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; + shadow = ( + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) + ) * ( 1.0 / 9.0 ); + #else + shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); + #endif + } + return mix( 1.0, shadow, shadowIntensity ); + } +#endif`,Vne=`#if NUM_SPOT_LIGHT_COORDS > 0 + uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + struct SpotLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif +#endif`,Gne=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) + vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); + vec4 shadowWorldPosition; +#endif +#if defined( USE_SHADOWMAP ) + #if NUM_DIR_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); + vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); + vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif +#endif +#if NUM_SPOT_LIGHT_COORDS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { + shadowWorldPosition = worldPosition; + #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; + #endif + vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end +#endif`,Wne=`float getShadowMask() { + float shadow = 1.0; + #ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + directionalLight = directionalLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { + spotLight = spotLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + pointLight = pointLightShadows[ i ]; + shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; + } + #pragma unroll_loop_end + #endif + #endif + return shadow; +}`,Xne=`#ifdef USE_SKINNING + mat4 boneMatX = getBoneMatrix( skinIndex.x ); + mat4 boneMatY = getBoneMatrix( skinIndex.y ); + mat4 boneMatZ = getBoneMatrix( skinIndex.z ); + mat4 boneMatW = getBoneMatrix( skinIndex.w ); +#endif`,qne=`#ifdef USE_SKINNING + uniform mat4 bindMatrix; + uniform mat4 bindMatrixInverse; + uniform highp sampler2D boneTexture; + mat4 getBoneMatrix( const in float i ) { + int size = textureSize( boneTexture, 0 ).x; + int j = int( i ) * 4; + int x = j % size; + int y = j / size; + vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); + vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); + vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); + vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); + return mat4( v1, v2, v3, v4 ); + } +#endif`,Kne=`#ifdef USE_SKINNING + vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); + vec4 skinned = vec4( 0.0 ); + skinned += boneMatX * skinVertex * skinWeight.x; + skinned += boneMatY * skinVertex * skinWeight.y; + skinned += boneMatZ * skinVertex * skinWeight.z; + skinned += boneMatW * skinVertex * skinWeight.w; + transformed = ( bindMatrixInverse * skinned ).xyz; +#endif`,Yne=`#ifdef USE_SKINNING + mat4 skinMatrix = mat4( 0.0 ); + skinMatrix += skinWeight.x * boneMatX; + skinMatrix += skinWeight.y * boneMatY; + skinMatrix += skinWeight.z * boneMatZ; + skinMatrix += skinWeight.w * boneMatW; + skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; + objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; + #ifdef USE_TANGENT + objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; + #endif +#endif`,Jne=`float specularStrength; +#ifdef USE_SPECULARMAP + vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); + specularStrength = texelSpecular.r; +#else + specularStrength = 1.0; +#endif`,Zne=`#ifdef USE_SPECULARMAP + uniform sampler2D specularMap; +#endif`,Qne=`#if defined( TONE_MAPPING ) + gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); +#endif`,ere=`#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +uniform float toneMappingExposure; +vec3 LinearToneMapping( vec3 color ) { + return saturate( toneMappingExposure * color ); +} +vec3 ReinhardToneMapping( vec3 color ) { + color *= toneMappingExposure; + return saturate( color / ( vec3( 1.0 ) + color ) ); +} +vec3 CineonToneMapping( vec3 color ) { + color *= toneMappingExposure; + color = max( vec3( 0.0 ), color - 0.004 ); + return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); +} +vec3 RRTAndODTFit( vec3 v ) { + vec3 a = v * ( v + 0.0245786 ) - 0.000090537; + vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; + return a / b; +} +vec3 ACESFilmicToneMapping( vec3 color ) { + const mat3 ACESInputMat = mat3( + vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), + vec3( 0.04823, 0.01566, 0.83777 ) + ); + const mat3 ACESOutputMat = mat3( + vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), + vec3( -0.07367, -0.00605, 1.07602 ) + ); + color *= toneMappingExposure / 0.6; + color = ACESInputMat * color; + color = RRTAndODTFit( color ); + color = ACESOutputMat * color; + return saturate( color ); +} +const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( + vec3( 1.6605, - 0.1246, - 0.0182 ), + vec3( - 0.5876, 1.1329, - 0.1006 ), + vec3( - 0.0728, - 0.0083, 1.1187 ) +); +const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( + vec3( 0.6274, 0.0691, 0.0164 ), + vec3( 0.3293, 0.9195, 0.0880 ), + vec3( 0.0433, 0.0113, 0.8956 ) +); +vec3 agxDefaultContrastApprox( vec3 x ) { + vec3 x2 = x * x; + vec3 x4 = x2 * x2; + return + 15.5 * x4 * x2 + - 40.14 * x4 * x + + 31.96 * x4 + - 6.868 * x2 * x + + 0.4298 * x2 + + 0.1191 * x + - 0.00232; +} +vec3 AgXToneMapping( vec3 color ) { + const mat3 AgXInsetMatrix = mat3( + vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), + vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), + vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) + ); + const mat3 AgXOutsetMatrix = mat3( + vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), + vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), + vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) + ); + const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; + color *= toneMappingExposure; + color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; + color = AgXInsetMatrix * color; + color = max( color, 1e-10 ); color = log2( color ); + color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); + color = clamp( color, 0.0, 1.0 ); + color = agxDefaultContrastApprox( color ); + color = AgXOutsetMatrix * color; + color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); + color = LINEAR_REC2020_TO_LINEAR_SRGB * color; + color = clamp( color, 0.0, 1.0 ); + return color; +} +vec3 NeutralToneMapping( vec3 color ) { + const float StartCompression = 0.8 - 0.04; + const float Desaturation = 0.15; + color *= toneMappingExposure; + float x = min( color.r, min( color.g, color.b ) ); + float offset = x < 0.08 ? x - 6.25 * x * x : 0.04; + color -= offset; + float peak = max( color.r, max( color.g, color.b ) ); + if ( peak < StartCompression ) return color; + float d = 1. - StartCompression; + float newPeak = 1. - d * d / ( peak + d - StartCompression ); + color *= newPeak / peak; + float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); + return mix( color, vec3( newPeak ), g ); +} +vec3 CustomToneMapping( vec3 color ) { return color; }`,tre=`#ifdef USE_TRANSMISSION + material.transmission = transmission; + material.transmissionAlpha = 1.0; + material.thickness = thickness; + material.attenuationDistance = attenuationDistance; + material.attenuationColor = attenuationColor; + #ifdef USE_TRANSMISSIONMAP + material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; + #endif + #ifdef USE_THICKNESSMAP + material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; + #endif + vec3 pos = vWorldPosition; + vec3 v = normalize( cameraPosition - pos ); + vec3 n = inverseTransformDirection( normal, viewMatrix ); + vec4 transmitted = getIBLVolumeRefraction( + n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, + pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness, + material.attenuationColor, material.attenuationDistance ); + material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); + totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); +#endif`,nre=`#ifdef USE_TRANSMISSION + uniform float transmission; + uniform float thickness; + uniform float attenuationDistance; + uniform vec3 attenuationColor; + #ifdef USE_TRANSMISSIONMAP + uniform sampler2D transmissionMap; + #endif + #ifdef USE_THICKNESSMAP + uniform sampler2D thicknessMap; + #endif + uniform vec2 transmissionSamplerSize; + uniform sampler2D transmissionSamplerMap; + uniform mat4 modelMatrix; + uniform mat4 projectionMatrix; + varying vec3 vWorldPosition; + float w0( float a ) { + return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); + } + float w1( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); + } + float w2( float a ){ + return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); + } + float w3( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * a ); + } + float g0( float a ) { + return w0( a ) + w1( a ); + } + float g1( float a ) { + return w2( a ) + w3( a ); + } + float h0( float a ) { + return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); + } + float h1( float a ) { + return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); + } + vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { + uv = uv * texelSize.zw + 0.5; + vec2 iuv = floor( uv ); + vec2 fuv = fract( uv ); + float g0x = g0( fuv.x ); + float g1x = g1( fuv.x ); + float h0x = h0( fuv.x ); + float h1x = h1( fuv.x ); + float h0y = h0( fuv.y ); + float h1y = h1( fuv.y ); + vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + + g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); + } + vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { + vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); + vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); + vec2 fLodSizeInv = 1.0 / fLodSize; + vec2 cLodSizeInv = 1.0 / cLodSize; + vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); + vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); + return mix( fSample, cSample, fract( lod ) ); + } + vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { + vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); + vec3 modelScale; + modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); + modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); + modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); + return normalize( refractionVector ) * thickness * modelScale; + } + float applyIorToRoughness( const in float roughness, const in float ior ) { + return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); + } + vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { + float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); + return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); + } + vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { + if ( isinf( attenuationDistance ) ) { + return vec3( 1.0 ); + } else { + vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; + vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; + } + } + vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, + const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, + const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness, + const in vec3 attenuationColor, const in float attenuationDistance ) { + vec4 transmittedLight; + vec3 transmittance; + #ifdef USE_DISPERSION + float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion; + vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread ); + for ( int i = 0; i < 3; i ++ ) { + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] ); + transmittedLight[ i ] = transmissionSample[ i ]; + transmittedLight.a += transmissionSample.a; + transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ]; + } + transmittedLight.a /= 3.0; + #else + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); + transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); + #endif + vec3 attenuatedColor = transmittance * transmittedLight.rgb; + vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); + float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; + return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); + } +#endif`,rre=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + varying vec2 vNormalMapUv; +#endif +#ifdef USE_EMISSIVEMAP + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_SPECULARMAP + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,ire=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + uniform mat3 mapTransform; + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + uniform mat3 alphaMapTransform; + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + uniform mat3 lightMapTransform; + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + uniform mat3 aoMapTransform; + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + uniform mat3 bumpMapTransform; + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + uniform mat3 normalMapTransform; + varying vec2 vNormalMapUv; +#endif +#ifdef USE_DISPLACEMENTMAP + uniform mat3 displacementMapTransform; + varying vec2 vDisplacementMapUv; +#endif +#ifdef USE_EMISSIVEMAP + uniform mat3 emissiveMapTransform; + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + uniform mat3 metalnessMapTransform; + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + uniform mat3 roughnessMapTransform; + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + uniform mat3 anisotropyMapTransform; + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + uniform mat3 clearcoatMapTransform; + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform mat3 clearcoatNormalMapTransform; + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform mat3 clearcoatRoughnessMapTransform; + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + uniform mat3 sheenColorMapTransform; + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + uniform mat3 sheenRoughnessMapTransform; + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + uniform mat3 iridescenceMapTransform; + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform mat3 iridescenceThicknessMapTransform; + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SPECULARMAP + uniform mat3 specularMapTransform; + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + uniform mat3 specularColorMapTransform; + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + uniform mat3 specularIntensityMapTransform; + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,ore=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + vUv = vec3( uv, 1 ).xy; +#endif +#ifdef USE_MAP + vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ALPHAMAP + vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_LIGHTMAP + vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_AOMAP + vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_BUMPMAP + vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_NORMALMAP + vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_DISPLACEMENTMAP + vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_EMISSIVEMAP + vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_METALNESSMAP + vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ROUGHNESSMAP + vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ANISOTROPYMAP + vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOATMAP + vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCEMAP + vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_COLORMAP + vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULARMAP + vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_COLORMAP + vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_TRANSMISSIONMAP + vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_THICKNESSMAP + vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; +#endif`,are=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 + vec4 worldPosition = vec4( transformed, 1.0 ); + #ifdef USE_BATCHING + worldPosition = batchingMatrix * worldPosition; + #endif + #ifdef USE_INSTANCING + worldPosition = instanceMatrix * worldPosition; + #endif + worldPosition = modelMatrix * worldPosition; +#endif`;const sre=`varying vec2 vUv; +uniform mat3 uvTransform; +void main() { + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + gl_Position = vec4( position.xy, 1.0, 1.0 ); +}`,lre=`uniform sampler2D t2D; +uniform float backgroundIntensity; +varying vec2 vUv; +void main() { + vec4 texColor = texture2D( t2D, vUv ); + #ifdef DECODE_VIDEO_TEXTURE + texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,cre=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,ure=`#ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; +#elif defined( ENVMAP_TYPE_CUBE_UV ) + uniform sampler2D envMap; +#endif +uniform float flipEnvMap; +uniform float backgroundBlurriness; +uniform float backgroundIntensity; +uniform mat3 backgroundRotation; +varying vec3 vWorldDirection; +#include +void main() { + #ifdef ENVMAP_TYPE_CUBE + vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); + #elif defined( ENVMAP_TYPE_CUBE_UV ) + vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness ); + #else + vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,dre=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,fre=`uniform samplerCube tCube; +uniform float tFlip; +uniform float opacity; +varying vec3 vWorldDirection; +void main() { + vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); + gl_FragColor = texColor; + gl_FragColor.a *= opacity; + #include + #include +}`,hre=`#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + #include + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vHighPrecisionZW = gl_Position.zw; +}`,pre=`#if DEPTH_PACKING == 3200 + uniform float opacity; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + vec4 diffuseColor = vec4( 1.0 ); + #include + #if DEPTH_PACKING == 3200 + diffuseColor.a = opacity; + #endif + #include + #include + #include + #include + #include + float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; + #if DEPTH_PACKING == 3200 + gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); + #elif DEPTH_PACKING == 3201 + gl_FragColor = packDepthToRGBA( fragCoordZ ); + #elif DEPTH_PACKING == 3202 + gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 ); + #elif DEPTH_PACKING == 3203 + gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); + #endif +}`,mre=`#define DISTANCE +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vWorldPosition = worldPosition.xyz; +}`,gre=`#define DISTANCE +uniform vec3 referencePosition; +uniform float nearDistance; +uniform float farDistance; +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +#include +void main () { + vec4 diffuseColor = vec4( 1.0 ); + #include + #include + #include + #include + #include + float dist = length( vWorldPosition - referencePosition ); + dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); + dist = saturate( dist ); + gl_FragColor = packDepthToRGBA( dist ); +}`,vre=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include +}`,yre=`uniform sampler2D tEquirect; +varying vec3 vWorldDirection; +#include +void main() { + vec3 direction = normalize( vWorldDirection ); + vec2 sampleUV = equirectUv( direction ); + gl_FragColor = texture2D( tEquirect, sampleUV ); + #include + #include +}`,xre=`uniform float scale; +attribute float lineDistance; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vLineDistance = scale * lineDistance; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,bre=`uniform vec3 diffuse; +uniform float opacity; +uniform float dashSize; +uniform float totalSize; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + if ( mod( vLineDistance, totalSize ) > dashSize ) { + discard; + } + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,_re=`#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) + #include + #include + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,wre=`uniform vec3 diffuse; +uniform float opacity; +#ifndef FLAT_SHADED + varying vec3 vNormal; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; + #else + reflectedLight.indirectDiffuse += vec3( 1.0 ); + #endif + #include + reflectedLight.indirectDiffuse *= diffuseColor.rgb; + vec3 outgoingLight = reflectedLight.indirectDiffuse; + #include + #include + #include + #include + #include + #include + #include +}`,Sre=`#define LAMBERT +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,Ere=`#define LAMBERT +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,Tre=`#define MATCAP +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; +}`,Mre=`#define MATCAP +uniform vec3 diffuse; +uniform float opacity; +uniform sampler2D matcap; +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 viewDir = normalize( vViewPosition ); + vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); + vec3 y = cross( viewDir, x ); + vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; + #ifdef USE_MATCAP + vec4 matcapColor = texture2D( matcap, uv ); + #else + vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); + #endif + vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; + #include + #include + #include + #include + #include + #include +}`,Are=`#define NORMAL +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + vViewPosition = - mvPosition.xyz; +#endif +}`,Cre=`#define NORMAL +uniform float opacity; +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); + #include + #include + #include + #include + gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a ); + #ifdef OPAQUE + gl_FragColor.a = 1.0; + #endif +}`,Pre=`#define PHONG +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,Rre=`#define PHONG +uniform vec3 diffuse; +uniform vec3 emissive; +uniform vec3 specular; +uniform float shininess; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,Nre=`#define STANDARD +varying vec3 vViewPosition; +#ifdef USE_TRANSMISSION + varying vec3 vWorldPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +#ifdef USE_TRANSMISSION + vWorldPosition = worldPosition.xyz; +#endif +}`,Ore=`#define STANDARD +#ifdef PHYSICAL + #define IOR + #define USE_SPECULAR +#endif +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float roughness; +uniform float metalness; +uniform float opacity; +#ifdef IOR + uniform float ior; +#endif +#ifdef USE_SPECULAR + uniform float specularIntensity; + uniform vec3 specularColor; + #ifdef USE_SPECULAR_COLORMAP + uniform sampler2D specularColorMap; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + uniform sampler2D specularIntensityMap; + #endif +#endif +#ifdef USE_CLEARCOAT + uniform float clearcoat; + uniform float clearcoatRoughness; +#endif +#ifdef USE_DISPERSION + uniform float dispersion; +#endif +#ifdef USE_IRIDESCENCE + uniform float iridescence; + uniform float iridescenceIOR; + uniform float iridescenceThicknessMinimum; + uniform float iridescenceThicknessMaximum; +#endif +#ifdef USE_SHEEN + uniform vec3 sheenColor; + uniform float sheenRoughness; + #ifdef USE_SHEEN_COLORMAP + uniform sampler2D sheenColorMap; + #endif + #ifdef USE_SHEEN_ROUGHNESSMAP + uniform sampler2D sheenRoughnessMap; + #endif +#endif +#ifdef USE_ANISOTROPY + uniform vec2 anisotropyVector; + #ifdef USE_ANISOTROPYMAP + uniform sampler2D anisotropyMap; + #endif +#endif +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; + vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; + #include + vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; + #ifdef USE_SHEEN + float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); + outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect; + #endif + #ifdef USE_CLEARCOAT + float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); + vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); + outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; + #endif + #include + #include + #include + #include + #include + #include +}`,Ire=`#define TOON +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +}`,Dre=`#define TOON +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include +}`,Lre=`uniform float size; +uniform float scale; +#include +#include +#include +#include +#include +#include +#ifdef USE_POINTS_UV + varying vec2 vUv; + uniform mat3 uvTransform; +#endif +void main() { + #ifdef USE_POINTS_UV + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + #endif + #include + #include + #include + #include + #include + #include + gl_PointSize = size; + #ifdef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); + #endif + #include + #include + #include + #include +}`,kre=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,jre=`#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,Ure=`uniform vec3 color; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); + #include + #include + #include +}`,Fre=`uniform float rotation; +uniform vec2 center; +#include +#include +#include +#include +#include +void main() { + #include + vec4 mvPosition = modelViewMatrix[ 3 ]; + vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) ); + #ifndef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) scale *= - mvPosition.z; + #endif + vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; + vec2 rotatedPosition; + rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; + rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; + mvPosition.xy += rotatedPosition; + gl_Position = projectionMatrix * mvPosition; + #include + #include + #include +}`,Bre=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include +}`,Rt={alphahash_fragment:lte,alphahash_pars_fragment:cte,alphamap_fragment:ute,alphamap_pars_fragment:dte,alphatest_fragment:fte,alphatest_pars_fragment:hte,aomap_fragment:pte,aomap_pars_fragment:mte,batching_pars_vertex:gte,batching_vertex:vte,begin_vertex:yte,beginnormal_vertex:xte,bsdfs:bte,iridescence_fragment:_te,bumpmap_pars_fragment:wte,clipping_planes_fragment:Ste,clipping_planes_pars_fragment:Ete,clipping_planes_pars_vertex:Tte,clipping_planes_vertex:Mte,color_fragment:Ate,color_pars_fragment:Cte,color_pars_vertex:Pte,color_vertex:Rte,common:Nte,cube_uv_reflection_fragment:Ote,defaultnormal_vertex:Ite,displacementmap_pars_vertex:Dte,displacementmap_vertex:Lte,emissivemap_fragment:kte,emissivemap_pars_fragment:jte,colorspace_fragment:Ute,colorspace_pars_fragment:Fte,envmap_fragment:Bte,envmap_common_pars_fragment:$te,envmap_pars_fragment:zte,envmap_pars_vertex:Hte,envmap_physical_pars_fragment:ene,envmap_vertex:Vte,fog_vertex:Gte,fog_pars_vertex:Wte,fog_fragment:Xte,fog_pars_fragment:qte,gradientmap_pars_fragment:Kte,lightmap_pars_fragment:Yte,lights_lambert_fragment:Jte,lights_lambert_pars_fragment:Zte,lights_pars_begin:Qte,lights_toon_fragment:tne,lights_toon_pars_fragment:nne,lights_phong_fragment:rne,lights_phong_pars_fragment:ine,lights_physical_fragment:one,lights_physical_pars_fragment:ane,lights_fragment_begin:sne,lights_fragment_maps:lne,lights_fragment_end:cne,logdepthbuf_fragment:une,logdepthbuf_pars_fragment:dne,logdepthbuf_pars_vertex:fne,logdepthbuf_vertex:hne,map_fragment:pne,map_pars_fragment:mne,map_particle_fragment:gne,map_particle_pars_fragment:vne,metalnessmap_fragment:yne,metalnessmap_pars_fragment:xne,morphinstance_vertex:bne,morphcolor_vertex:_ne,morphnormal_vertex:wne,morphtarget_pars_vertex:Sne,morphtarget_vertex:Ene,normal_fragment_begin:Tne,normal_fragment_maps:Mne,normal_pars_fragment:Ane,normal_pars_vertex:Cne,normal_vertex:Pne,normalmap_pars_fragment:Rne,clearcoat_normal_fragment_begin:Nne,clearcoat_normal_fragment_maps:One,clearcoat_pars_fragment:Ine,iridescence_pars_fragment:Dne,opaque_fragment:Lne,packing:kne,premultiplied_alpha_fragment:jne,project_vertex:Une,dithering_fragment:Fne,dithering_pars_fragment:Bne,roughnessmap_fragment:$ne,roughnessmap_pars_fragment:zne,shadowmap_pars_fragment:Hne,shadowmap_pars_vertex:Vne,shadowmap_vertex:Gne,shadowmask_pars_fragment:Wne,skinbase_vertex:Xne,skinning_pars_vertex:qne,skinning_vertex:Kne,skinnormal_vertex:Yne,specularmap_fragment:Jne,specularmap_pars_fragment:Zne,tonemapping_fragment:Qne,tonemapping_pars_fragment:ere,transmission_fragment:tre,transmission_pars_fragment:nre,uv_pars_fragment:rre,uv_pars_vertex:ire,uv_vertex:ore,worldpos_vertex:are,background_vert:sre,background_frag:lre,backgroundCube_vert:cre,backgroundCube_frag:ure,cube_vert:dre,cube_frag:fre,depth_vert:hre,depth_frag:pre,distanceRGBA_vert:mre,distanceRGBA_frag:gre,equirect_vert:vre,equirect_frag:yre,linedashed_vert:xre,linedashed_frag:bre,meshbasic_vert:_re,meshbasic_frag:wre,meshlambert_vert:Sre,meshlambert_frag:Ere,meshmatcap_vert:Tre,meshmatcap_frag:Mre,meshnormal_vert:Are,meshnormal_frag:Cre,meshphong_vert:Pre,meshphong_frag:Rre,meshphysical_vert:Nre,meshphysical_frag:Ore,meshtoon_vert:Ire,meshtoon_frag:Dre,points_vert:Lre,points_frag:kre,shadow_vert:jre,shadow_frag:Ure,sprite_vert:Fre,sprite_frag:Bre},Fe={common:{diffuse:{value:new ft(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Pt},alphaMap:{value:null},alphaMapTransform:{value:new Pt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Pt}},envmap:{envMap:{value:null},envMapRotation:{value:new Pt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Pt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Pt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Pt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Pt},normalScale:{value:new xt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Pt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Pt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Pt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Pt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ft(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new ft(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Pt},alphaTest:{value:0},uvTransform:{value:new Pt}},sprite:{diffuse:{value:new ft(16777215)},opacity:{value:1},center:{value:new xt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Pt},alphaMap:{value:null},alphaMapTransform:{value:new Pt},alphaTest:{value:0}}},ta={basic:{uniforms:Fr([Fe.common,Fe.specularmap,Fe.envmap,Fe.aomap,Fe.lightmap,Fe.fog]),vertexShader:Rt.meshbasic_vert,fragmentShader:Rt.meshbasic_frag},lambert:{uniforms:Fr([Fe.common,Fe.specularmap,Fe.envmap,Fe.aomap,Fe.lightmap,Fe.emissivemap,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.fog,Fe.lights,{emissive:{value:new ft(0)}}]),vertexShader:Rt.meshlambert_vert,fragmentShader:Rt.meshlambert_frag},phong:{uniforms:Fr([Fe.common,Fe.specularmap,Fe.envmap,Fe.aomap,Fe.lightmap,Fe.emissivemap,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.fog,Fe.lights,{emissive:{value:new ft(0)},specular:{value:new ft(1118481)},shininess:{value:30}}]),vertexShader:Rt.meshphong_vert,fragmentShader:Rt.meshphong_frag},standard:{uniforms:Fr([Fe.common,Fe.envmap,Fe.aomap,Fe.lightmap,Fe.emissivemap,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.roughnessmap,Fe.metalnessmap,Fe.fog,Fe.lights,{emissive:{value:new ft(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Rt.meshphysical_vert,fragmentShader:Rt.meshphysical_frag},toon:{uniforms:Fr([Fe.common,Fe.aomap,Fe.lightmap,Fe.emissivemap,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.gradientmap,Fe.fog,Fe.lights,{emissive:{value:new ft(0)}}]),vertexShader:Rt.meshtoon_vert,fragmentShader:Rt.meshtoon_frag},matcap:{uniforms:Fr([Fe.common,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.fog,{matcap:{value:null}}]),vertexShader:Rt.meshmatcap_vert,fragmentShader:Rt.meshmatcap_frag},points:{uniforms:Fr([Fe.points,Fe.fog]),vertexShader:Rt.points_vert,fragmentShader:Rt.points_frag},dashed:{uniforms:Fr([Fe.common,Fe.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Rt.linedashed_vert,fragmentShader:Rt.linedashed_frag},depth:{uniforms:Fr([Fe.common,Fe.displacementmap]),vertexShader:Rt.depth_vert,fragmentShader:Rt.depth_frag},normal:{uniforms:Fr([Fe.common,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,{opacity:{value:1}}]),vertexShader:Rt.meshnormal_vert,fragmentShader:Rt.meshnormal_frag},sprite:{uniforms:Fr([Fe.sprite,Fe.fog]),vertexShader:Rt.sprite_vert,fragmentShader:Rt.sprite_frag},background:{uniforms:{uvTransform:{value:new Pt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Rt.background_vert,fragmentShader:Rt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Pt}},vertexShader:Rt.backgroundCube_vert,fragmentShader:Rt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Rt.cube_vert,fragmentShader:Rt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Rt.equirect_vert,fragmentShader:Rt.equirect_frag},distanceRGBA:{uniforms:Fr([Fe.common,Fe.displacementmap,{referencePosition:{value:new ne},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Rt.distanceRGBA_vert,fragmentShader:Rt.distanceRGBA_frag},shadow:{uniforms:Fr([Fe.lights,Fe.fog,{color:{value:new ft(0)},opacity:{value:1}}]),vertexShader:Rt.shadow_vert,fragmentShader:Rt.shadow_frag}};ta.physical={uniforms:Fr([ta.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Pt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Pt},clearcoatNormalScale:{value:new xt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Pt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Pt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Pt},sheen:{value:0},sheenColor:{value:new ft(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Pt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Pt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Pt},transmissionSamplerSize:{value:new xt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Pt},attenuationDistance:{value:0},attenuationColor:{value:new ft(0)},specularColor:{value:new ft(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Pt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Pt},anisotropyVector:{value:new xt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Pt}}]),vertexShader:Rt.meshphysical_vert,fragmentShader:Rt.meshphysical_frag};const Jg={r:0,b:0,g:0},kl=new pi,$re=new gt;function zre(t,e,n,r,i,o,a){const s=new ft(0);let l=o===!0?0:1,c,u,d=null,f=0,p=null;function y(b){let S=b.isScene===!0?b.background:null;return S&&S.isTexture&&(S=(b.backgroundBlurriness>0?n:e).get(S)),S}function v(b){let S=!1;const w=y(b);w===null?m(s,l):w&&w.isColor&&(m(w,1),S=!0);const E=t.xr.getEnvironmentBlendMode();E==="additive"?r.buffers.color.setClear(0,0,0,1,a):E==="alpha-blend"&&r.buffers.color.setClear(0,0,0,0,a),(t.autoClear||S)&&(r.buffers.depth.setTest(!0),r.buffers.depth.setMask(!0),r.buffers.color.setMask(!0),t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil))}function g(b,S){const w=y(S);w&&(w.isCubeTexture||w.mapping===Lx)?(u===void 0&&(u=new Mn(new Gc(1,1,1),new fl({name:"BackgroundCubeMaterial",uniforms:$d(ta.backgroundCube.uniforms),vertexShader:ta.backgroundCube.vertexShader,fragmentShader:ta.backgroundCube.fragmentShader,side:ui,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(E,T,A){this.matrixWorld.copyPosition(A.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(u)),kl.copy(S.backgroundRotation),kl.x*=-1,kl.y*=-1,kl.z*=-1,w.isCubeTexture&&w.isRenderTargetTexture===!1&&(kl.y*=-1,kl.z*=-1),u.material.uniforms.envMap.value=w,u.material.uniforms.flipEnvMap.value=w.isCubeTexture&&w.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=S.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=S.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4($re.makeRotationFromEuler(kl)),u.material.toneMapped=Dt.getTransfer(w.colorSpace)!==an,(d!==w||f!==w.version||p!==t.toneMapping)&&(u.material.needsUpdate=!0,d=w,f=w.version,p=t.toneMapping),u.layers.enableAll(),b.unshift(u,u.geometry,u.material,0,0,null)):w&&w.isTexture&&(c===void 0&&(c=new Mn(new Om(2,2),new fl({name:"BackgroundMaterial",uniforms:$d(ta.background.uniforms),vertexShader:ta.background.vertexShader,fragmentShader:ta.background.fragmentShader,side:va,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(c)),c.material.uniforms.t2D.value=w,c.material.uniforms.backgroundIntensity.value=S.backgroundIntensity,c.material.toneMapped=Dt.getTransfer(w.colorSpace)!==an,w.matrixAutoUpdate===!0&&w.updateMatrix(),c.material.uniforms.uvTransform.value.copy(w.matrix),(d!==w||f!==w.version||p!==t.toneMapping)&&(c.material.needsUpdate=!0,d=w,f=w.version,p=t.toneMapping),c.layers.enableAll(),b.unshift(c,c.geometry,c.material,0,0,null))}function m(b,S){b.getRGB(Jg,L4(t)),r.buffers.color.setClear(Jg.r,Jg.g,Jg.b,S,a)}function x(){u!==void 0&&(u.geometry.dispose(),u.material.dispose(),u=void 0),c!==void 0&&(c.geometry.dispose(),c.material.dispose(),c=void 0)}return{getClearColor:function(){return s},setClearColor:function(b,S=1){s.set(b),l=S,m(s,l)},getClearAlpha:function(){return l},setClearAlpha:function(b){l=b,m(s,l)},render:v,addToRenderList:g,dispose:x}}function Hre(t,e){const n=t.getParameter(t.MAX_VERTEX_ATTRIBS),r={},i=f(null);let o=i,a=!1;function s(C,P,R,D,k){let U=!1;const O=d(D,R,P);o!==O&&(o=O,c(o.object)),U=p(C,D,R,k),U&&y(C,D,R,k),k!==null&&e.update(k,t.ELEMENT_ARRAY_BUFFER),(U||a)&&(a=!1,S(C,P,R,D),k!==null&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e.get(k).buffer))}function l(){return t.createVertexArray()}function c(C){return t.bindVertexArray(C)}function u(C){return t.deleteVertexArray(C)}function d(C,P,R){const D=R.wireframe===!0;let k=r[C.id];k===void 0&&(k={},r[C.id]=k);let U=k[P.id];U===void 0&&(U={},k[P.id]=U);let O=U[D];return O===void 0&&(O=f(l()),U[D]=O),O}function f(C){const P=[],R=[],D=[];for(let k=0;k=0){const X=k[L];let K=U[L];if(K===void 0&&(L==="instanceMatrix"&&C.instanceMatrix&&(K=C.instanceMatrix),L==="instanceColor"&&C.instanceColor&&(K=C.instanceColor)),X===void 0||X.attribute!==K||K&&X.data!==K.data)return!0;O++}return o.attributesNum!==O||o.index!==D}function y(C,P,R,D){const k={},U=P.attributes;let O=0;const W=R.getAttributes();for(const L in W)if(W[L].location>=0){let X=U[L];X===void 0&&(L==="instanceMatrix"&&C.instanceMatrix&&(X=C.instanceMatrix),L==="instanceColor"&&C.instanceColor&&(X=C.instanceColor));const K={};K.attribute=X,X&&X.data&&(K.data=X.data),k[L]=K,O++}o.attributes=k,o.attributesNum=O,o.index=D}function v(){const C=o.newAttributes;for(let P=0,R=C.length;P=0){let j=k[W];if(j===void 0&&(W==="instanceMatrix"&&C.instanceMatrix&&(j=C.instanceMatrix),W==="instanceColor"&&C.instanceColor&&(j=C.instanceColor)),j!==void 0){const X=j.normalized,K=j.itemSize,F=e.get(j);if(F===void 0)continue;const Y=F.buffer,q=F.type,Q=F.bytesPerElement,te=q===t.INT||q===t.UNSIGNED_INT||j.gpuType===FA;if(j.isInterleavedBufferAttribute){const ee=j.data,ce=ee.stride,ae=j.offset;if(ee.isInstancedInterleavedBuffer){for(let fe=0;fe0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";T="mediump"}return T==="mediump"&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=n.precision!==void 0?n.precision:"highp";const u=l(c);u!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",u,"instead."),c=u);const d=n.logarithmicDepthBuffer===!0,f=n.reverseDepthBuffer===!0&&e.has("EXT_clip_control"),p=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),y=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),v=t.getParameter(t.MAX_TEXTURE_SIZE),g=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),m=t.getParameter(t.MAX_VERTEX_ATTRIBS),x=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),b=t.getParameter(t.MAX_VARYING_VECTORS),S=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),w=y>0,E=t.getParameter(t.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:o,getMaxPrecision:l,textureFormatReadable:a,textureTypeReadable:s,precision:c,logarithmicDepthBuffer:d,reverseDepthBuffer:f,maxTextures:p,maxVertexTextures:y,maxTextureSize:v,maxCubemapSize:g,maxAttributes:m,maxVertexUniforms:x,maxVaryings:b,maxFragmentUniforms:S,vertexTextures:w,maxSamples:E}}function Wre(t){const e=this;let n=null,r=0,i=!1,o=!1;const a=new Ua,s=new Pt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(d,f){const p=d.length!==0||f||r!==0||i;return i=f,r=d.length,p},this.beginShadows=function(){o=!0,u(null)},this.endShadows=function(){o=!1},this.setGlobalState=function(d,f){n=u(d,f,0)},this.setState=function(d,f,p){const y=d.clippingPlanes,v=d.clipIntersection,g=d.clipShadows,m=t.get(d);if(!i||y===null||y.length===0||o&&!g)o?u(null):c();else{const x=o?0:r,b=x*4;let S=m.clippingState||null;l.value=S,S=u(y,f,b,p);for(let w=0;w!==b;++w)S[w]=n[w];m.clippingState=S,this.numIntersection=v?this.numPlanes:0,this.numPlanes+=x}};function c(){l.value!==n&&(l.value=n,l.needsUpdate=r>0),e.numPlanes=r,e.numIntersection=0}function u(d,f,p,y){const v=d!==null?d.length:0;let g=null;if(v!==0){if(g=l.value,y!==!0||g===null){const m=p+v*4,x=f.matrixWorldInverse;s.getNormalMatrix(x),(g===null||g.length0){const c=new xee(l.height);return c.fromEquirectangularTexture(t,a),e.set(a,c),a.addEventListener("dispose",i),n(c.texture,a.mapping)}else return null}}return a}function i(a){const s=a.target;s.removeEventListener("dispose",i);const l=e.get(s);l!==void 0&&(e.delete(s),l.dispose())}function o(){e=new WeakMap}return{get:r,dispose:o}}const Vu=4,CO=[.125,.215,.35,.446,.526,.582],Kl=20,yw=new Fx,PO=new ft;let xw=null,bw=0,_w=0,ww=!1;const Hl=(1+Math.sqrt(5))/2,bu=1/Hl,RO=[new ne(-Hl,bu,0),new ne(Hl,bu,0),new ne(-bu,0,Hl),new ne(bu,0,Hl),new ne(0,Hl,-bu),new ne(0,Hl,bu),new ne(-1,1,-1),new ne(1,1,-1),new ne(-1,1,1),new ne(1,1,1)],qre=new ne;class NO{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,n=0,r=.1,i=100,o={}){const{size:a=256,position:s=qre}=o;xw=this._renderer.getRenderTarget(),bw=this._renderer.getActiveCubeFace(),_w=this._renderer.getActiveMipmapLevel(),ww=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(a);const l=this._allocateTargets();return l.depthBuffer=!0,this._sceneToCubeUV(e,r,i,l,s),n>0&&this._blur(l,0,0,n),this._applyPMREM(l),this._cleanup(l),l}fromEquirectangular(e,n=null){return this._fromTexture(e,n)}fromCubemap(e,n=null){return this._fromTexture(e,n)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=DO(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=IO(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?S:0,S,S),d.setRenderTarget(i),g&&d.render(v,l),d.render(e,l)}v.geometry.dispose(),v.material.dispose(),d.toneMapping=p,d.autoClear=f,e.background=m}_textureToCubeUV(e,n){const r=this._renderer,i=e.mapping===Ud||e.mapping===Fd;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=DO()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=IO());const o=i?this._cubemapMaterial:this._equirectMaterial,a=new Mn(this._lodPlanes[0],o),s=o.uniforms;s.envMap.value=e;const l=this._cubeSize;Zg(n,0,0,3*l,2*l),r.setRenderTarget(n),r.render(a,yw)}_applyPMREM(e){const n=this._renderer,r=n.autoClear;n.autoClear=!1;const i=this._lodPlanes.length;for(let o=1;oKl&&console.warn(`sigmaRadians, ${o}, is too large and will clip, as it requested ${g} samples when the maximum is set to ${Kl}`);const m=[];let x=0;for(let T=0;Tb-Vu?i-b+Vu:0),E=4*(this._cubeSize-S);Zg(n,w,E,3*S,2*S),l.setRenderTarget(n),l.render(d,yw)}}function Kre(t){const e=[],n=[],r=[];let i=t;const o=t-Vu+1+CO.length;for(let a=0;at-Vu?l=CO[a-t+Vu-1]:a===0&&(l=0),r.push(l);const c=1/(s-2),u=-c,d=1+c,f=[u,u,d,u,d,d,u,u,d,d,u,d],p=6,y=6,v=3,g=2,m=1,x=new Float32Array(v*y*p),b=new Float32Array(g*y*p),S=new Float32Array(m*y*p);for(let E=0;E2?0:-1,M=[T,A,0,T+2/3,A,0,T+2/3,A+1,0,T,A,0,T+2/3,A+1,0,T,A+1,0];x.set(M,v*y*E),b.set(f,g*y*E);const C=[E,E,E,E,E,E];S.set(C,m*y*E)}const w=new br;w.setAttribute("position",new cr(x,v)),w.setAttribute("uv",new cr(b,g)),w.setAttribute("faceIndex",new cr(S,m)),e.push(w),i>Vu&&i--}return{lodPlanes:e,sizeLods:n,sigmas:r}}function OO(t,e,n){const r=new Oc(t,e,n);return r.texture.mapping=Lx,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function Zg(t,e,n,r,i){t.viewport.set(e,n,r,i),t.scissor.set(e,n,r,i)}function Yre(t,e,n){const r=new Float32Array(Kl),i=new ne(0,1,0);return new fl({name:"SphericalGaussianBlur",defines:{n:Kl,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:aC(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + uniform int samples; + uniform float weights[ n ]; + uniform bool latitudinal; + uniform float dTheta; + uniform float mipInt; + uniform vec3 poleAxis; + + #define ENVMAP_TYPE_CUBE_UV + #include + + vec3 getSample( float theta, vec3 axis ) { + + float cosTheta = cos( theta ); + // Rodrigues' axis-angle rotation + vec3 sampleDirection = vOutputDirection * cosTheta + + cross( axis, vOutputDirection ) * sin( theta ) + + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); + + return bilinearCubeUV( envMap, sampleDirection, mipInt ); + + } + + void main() { + + vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); + + if ( all( equal( axis, vec3( 0.0 ) ) ) ) { + + axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); + + } + + axis = normalize( axis ); + + gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); + + for ( int i = 1; i < n; i++ ) { + + if ( i >= samples ) { + + break; + + } + + float theta = dTheta * float( i ); + gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); + gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); + + } + + } + `,blending:el,depthTest:!1,depthWrite:!1})}function IO(){return new fl({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:aC(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + + #include + + void main() { + + vec3 outputDirection = normalize( vOutputDirection ); + vec2 uv = equirectUv( outputDirection ); + + gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); + + } + `,blending:el,depthTest:!1,depthWrite:!1})}function DO(){return new fl({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:aC(),fragmentShader:` + + precision mediump float; + precision mediump int; + + uniform float flipEnvMap; + + varying vec3 vOutputDirection; + + uniform samplerCube envMap; + + void main() { + + gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); + + } + `,blending:el,depthTest:!1,depthWrite:!1})}function aC(){return` + + precision mediump float; + precision mediump int; + + attribute float faceIndex; + + varying vec3 vOutputDirection; + + // RH coordinate system; PMREM face-indexing convention + vec3 getDirection( vec2 uv, float face ) { + + uv = 2.0 * uv - 1.0; + + vec3 direction = vec3( uv, 1.0 ); + + if ( face == 0.0 ) { + + direction = direction.zyx; // ( 1, v, u ) pos x + + } else if ( face == 1.0 ) { + + direction = direction.xzy; + direction.xz *= -1.0; // ( -u, 1, -v ) pos y + + } else if ( face == 2.0 ) { + + direction.x *= -1.0; // ( -u, v, 1 ) pos z + + } else if ( face == 3.0 ) { + + direction = direction.zyx; + direction.xz *= -1.0; // ( -1, v, -u ) neg x + + } else if ( face == 4.0 ) { + + direction = direction.xzy; + direction.xy *= -1.0; // ( -u, -1, v ) neg y + + } else if ( face == 5.0 ) { + + direction.z *= -1.0; // ( u, v, -1 ) neg z + + } + + return direction; + + } + + void main() { + + vOutputDirection = getDirection( uv, faceIndex ); + gl_Position = vec4( position, 1.0 ); + + } + `}function Jre(t){let e=new WeakMap,n=null;function r(s){if(s&&s.isTexture){const l=s.mapping,c=l===jE||l===UE,u=l===Ud||l===Fd;if(c||u){let d=e.get(s);const f=d!==void 0?d.texture.pmremVersion:0;if(s.isRenderTargetTexture&&s.pmremVersion!==f)return n===null&&(n=new NO(t)),d=c?n.fromEquirectangular(s,d):n.fromCubemap(s,d),d.texture.pmremVersion=s.pmremVersion,e.set(s,d),d.texture;if(d!==void 0)return d.texture;{const p=s.image;return c&&p&&p.height>0||u&&p&&i(p)?(n===null&&(n=new NO(t)),d=c?n.fromEquirectangular(s):n.fromCubemap(s),d.texture.pmremVersion=s.pmremVersion,e.set(s,d),s.addEventListener("dispose",o),d.texture):null}}}return s}function i(s){let l=0;const c=6;for(let u=0;ue.maxTextureSize&&(E=Math.ceil(w/e.maxTextureSize),w=e.maxTextureSize);const T=new Float32Array(w*E*4*d),A=new N4(T,w,E,d);A.type=Io,A.needsUpdate=!0;const M=S*4;for(let P=0;P0)return t;const i=e*n;let o=kO[i];if(o===void 0&&(o=new Float32Array(i),kO[i]=o),e!==0){r.toArray(o,0);for(let a=1,s=0;a!==e;++a)s+=n,t[a].toArray(o,s)}return o}function Zn(t,e){if(t.length!==e.length)return!1;for(let n=0,r=t.length;n":" "} ${s}: ${n[a]}`)}return r.join(` +`)}const HO=new Pt;function Jie(t){Dt._getMatrix(HO,Dt.workingColorSpace,t);const e=`mat3( ${HO.elements.map(n=>n.toFixed(4))} )`;switch(Dt.getTransfer(t)){case Cy:return[e,"LinearTransferOETF"];case an:return[e,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",t),[e,"LinearTransferOETF"]}}function VO(t,e,n){const r=t.getShaderParameter(e,t.COMPILE_STATUS),i=t.getShaderInfoLog(e).trim();if(r&&i==="")return"";const o=/ERROR: 0:(\d+)/.exec(i);if(o){const a=parseInt(o[1]);return n.toUpperCase()+` + +`+i+` + +`+Yie(t.getShaderSource(e),a)}else return i}function Zie(t,e){const n=Jie(e);return[`vec4 ${t}( vec4 value ) {`,` return ${n[1]}( vec4( value.rgb * ${n[0]}, value.a ) );`,"}"].join(` +`)}function Qie(t,e){let n;switch(e){case dQ:n="Linear";break;case fQ:n="Reinhard";break;case hQ:n="Cineon";break;case pQ:n="ACESFilmic";break;case gQ:n="AgX";break;case vQ:n="Neutral";break;case mQ:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}const Qg=new ne;function eoe(){Dt.getLuminanceCoefficients(Qg);const t=Qg.x.toFixed(4),e=Qg.y.toFixed(4),n=Qg.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${t}, ${e}, ${n} );`," return dot( weights, rgb );","}"].join(` +`)}function toe(t){return[t.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",t.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Ph).join(` +`)}function noe(t){const e=[];for(const n in t){const r=t[n];r!==!1&&e.push("#define "+n+" "+r)}return e.join(` +`)}function roe(t,e){const n={},r=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let i=0;i/gm;function v1(t){return t.replace(ioe,aoe)}const ooe=new Map;function aoe(t,e){let n=Rt[e];if(n===void 0){const r=ooe.get(e);if(r!==void 0)n=Rt[r],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,r);else throw new Error("Can not resolve #include <"+e+">")}return v1(n)}const soe=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function XO(t){return t.replace(soe,loe)}function loe(t,e,n,r){let i="";for(let o=parseInt(e);o0&&(g+=` +`),m=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,y].filter(Ph).join(` +`),m.length>0&&(m+=` +`)):(g=[qO(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,y,n.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",n.batching?"#define USE_BATCHING":"",n.batchingColor?"#define USE_BATCHING_COLOR":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.instancingMorph?"#define USE_INSTANCING_MORPH":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&n.flatShading===!1?"#define USE_MORPHNORMALS":"",n.morphColors?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` +`].filter(Ph).join(` +`),m=[qO(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,y,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.envMap?"#define "+u:"",n.envMap?"#define "+d:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.dispersion?"#define USE_DISPERSION":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor||n.batchingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==tl?"#define TONE_MAPPING":"",n.toneMapping!==tl?Rt.tonemapping_pars_fragment:"",n.toneMapping!==tl?Qie("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",Rt.colorspace_pars_fragment,Zie("linearToOutputTexel",n.outputColorSpace),eoe(),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"",` +`].filter(Ph).join(` +`)),a=v1(a),a=GO(a,n),a=WO(a,n),s=v1(s),s=GO(s,n),s=WO(s,n),a=XO(a),s=XO(s),n.isRawShaderMaterial!==!0&&(x=`#version 300 es +`,g=[p,"#define attribute in","#define varying out","#define texture2D texture"].join(` +`)+` +`+g,m=["#define varying in",n.glslVersion===$N?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===$N?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` +`)+` +`+m);const b=x+g+a,S=x+m+s,w=zO(i,i.VERTEX_SHADER,b),E=zO(i,i.FRAGMENT_SHADER,S);i.attachShader(v,w),i.attachShader(v,E),n.index0AttributeName!==void 0?i.bindAttribLocation(v,0,n.index0AttributeName):n.morphTargets===!0&&i.bindAttribLocation(v,0,"position"),i.linkProgram(v);function T(P){if(t.debug.checkShaderErrors){const R=i.getProgramInfoLog(v).trim(),D=i.getShaderInfoLog(w).trim(),k=i.getShaderInfoLog(E).trim();let U=!0,O=!0;if(i.getProgramParameter(v,i.LINK_STATUS)===!1)if(U=!1,typeof t.debug.onShaderError=="function")t.debug.onShaderError(i,v,w,E);else{const W=VO(i,w,"vertex"),L=VO(i,E,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(v,i.VALIDATE_STATUS)+` + +Material Name: `+P.name+` +Material Type: `+P.type+` + +Program Info Log: `+R+` +`+W+` +`+L)}else R!==""?console.warn("THREE.WebGLProgram: Program Info Log:",R):(D===""||k==="")&&(O=!1);O&&(P.diagnostics={runnable:U,programLog:R,vertexShader:{log:D,prefix:g},fragmentShader:{log:k,prefix:m}})}i.deleteShader(w),i.deleteShader(E),A=new Wv(i,v),M=roe(i,v)}let A;this.getUniforms=function(){return A===void 0&&T(this),A};let M;this.getAttributes=function(){return M===void 0&&T(this),M};let C=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return C===!1&&(C=i.getProgramParameter(v,qie)),C},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(v),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=Kie++,this.cacheKey=e,this.usedTimes=1,this.program=v,this.vertexShader=w,this.fragmentShader=E,this}let moe=0;class goe{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const n=e.vertexShader,r=e.fragmentShader,i=this._getShaderStage(n),o=this._getShaderStage(r),a=this._getShaderCacheForMaterial(e);return a.has(i)===!1&&(a.add(i),i.usedTimes++),a.has(o)===!1&&(a.add(o),o.usedTimes++),this}remove(e){const n=this.materialCache.get(e);for(const r of n)r.usedTimes--,r.usedTimes===0&&this.shaderCache.delete(r.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const n=this.materialCache;let r=n.get(e);return r===void 0&&(r=new Set,n.set(e,r)),r}_getShaderStage(e){const n=this.shaderCache;let r=n.get(e);return r===void 0&&(r=new voe(e),n.set(e,r)),r}}class voe{constructor(e){this.id=moe++,this.code=e,this.usedTimes=0}}function yoe(t,e,n,r,i,o,a){const s=new qA,l=new goe,c=new Set,u=[],d=i.logarithmicDepthBuffer,f=i.vertexTextures;let p=i.precision;const y={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function v(M){return c.add(M),M===0?"uv":`uv${M}`}function g(M,C,P,R,D){const k=R.fog,U=D.geometry,O=M.isMeshStandardMaterial?R.environment:null,W=(M.isMeshStandardMaterial?n:e).get(M.envMap||O),L=W&&W.mapping===Lx?W.image.height:null,j=y[M.type];M.precision!==null&&(p=i.getMaxPrecision(M.precision),p!==M.precision&&console.warn("THREE.WebGLProgram.getParameters:",M.precision,"not supported, using",p,"instead."));const X=U.morphAttributes.position||U.morphAttributes.normal||U.morphAttributes.color,K=X!==void 0?X.length:0;let F=0;U.morphAttributes.position!==void 0&&(F=1),U.morphAttributes.normal!==void 0&&(F=2),U.morphAttributes.color!==void 0&&(F=3);let Y,q,Q,te;if(j){const pt=ta[j];Y=pt.vertexShader,q=pt.fragmentShader}else Y=M.vertexShader,q=M.fragmentShader,l.update(M),Q=l.getVertexShaderID(M),te=l.getFragmentShaderID(M);const ee=t.getRenderTarget(),ce=t.state.buffers.depth.getReversed(),ae=D.isInstancedMesh===!0,fe=D.isBatchedMesh===!0,we=!!M.map,le=!!M.matcap,ie=!!W,G=!!M.aoMap,Ve=!!M.lightMap,Ne=!!M.bumpMap,st=!!M.normalMap,Re=!!M.displacementMap,ct=!!M.emissiveMap,Ye=!!M.metalnessMap,it=!!M.roughnessMap,Ft=M.anisotropy>0,J=M.clearcoat>0,B=M.dispersion>0,ue=M.iridescence>0,me=M.sheen>0,be=M.transmission>0,ge=Ft&&!!M.anisotropyMap,rt=J&&!!M.clearcoatMap,Ie=J&&!!M.clearcoatNormalMap,Je=J&&!!M.clearcoatRoughnessMap,tt=ue&&!!M.iridescenceMap,Ee=ue&&!!M.iridescenceThicknessMap,Be=me&&!!M.sheenColorMap,ht=me&&!!M.sheenRoughnessMap,ot=!!M.specularMap,Le=!!M.specularColorMap,_t=!!M.specularIntensityMap,re=be&&!!M.transmissionMap,ke=be&&!!M.thicknessMap,Me=!!M.gradientMap,Ge=!!M.alphaMap,Te=M.alphaTest>0,_e=!!M.alphaHash,Se=!!M.extensions;let je=tl;M.toneMapped&&(ee===null||ee.isXRRenderTarget===!0)&&(je=t.toneMapping);const vt={shaderID:j,shaderType:M.type,shaderName:M.name,vertexShader:Y,fragmentShader:q,defines:M.defines,customVertexShaderID:Q,customFragmentShaderID:te,isRawShaderMaterial:M.isRawShaderMaterial===!0,glslVersion:M.glslVersion,precision:p,batching:fe,batchingColor:fe&&D._colorsTexture!==null,instancing:ae,instancingColor:ae&&D.instanceColor!==null,instancingMorph:ae&&D.morphTexture!==null,supportsVertexTextures:f,outputColorSpace:ee===null?t.outputColorSpace:ee.isXRRenderTarget===!0?ee.texture.colorSpace:Kr,alphaToCoverage:!!M.alphaToCoverage,map:we,matcap:le,envMap:ie,envMapMode:ie&&W.mapping,envMapCubeUVHeight:L,aoMap:G,lightMap:Ve,bumpMap:Ne,normalMap:st,displacementMap:f&&Re,emissiveMap:ct,normalMapObjectSpace:st&&M.normalMapType===SQ,normalMapTangentSpace:st&&M.normalMapType===kx,metalnessMap:Ye,roughnessMap:it,anisotropy:Ft,anisotropyMap:ge,clearcoat:J,clearcoatMap:rt,clearcoatNormalMap:Ie,clearcoatRoughnessMap:Je,dispersion:B,iridescence:ue,iridescenceMap:tt,iridescenceThicknessMap:Ee,sheen:me,sheenColorMap:Be,sheenRoughnessMap:ht,specularMap:ot,specularColorMap:Le,specularIntensityMap:_t,transmission:be,transmissionMap:re,thicknessMap:ke,gradientMap:Me,opaque:M.transparent===!1&&M.blending===sd&&M.alphaToCoverage===!1,alphaMap:Ge,alphaTest:Te,alphaHash:_e,combine:M.combine,mapUv:we&&v(M.map.channel),aoMapUv:G&&v(M.aoMap.channel),lightMapUv:Ve&&v(M.lightMap.channel),bumpMapUv:Ne&&v(M.bumpMap.channel),normalMapUv:st&&v(M.normalMap.channel),displacementMapUv:Re&&v(M.displacementMap.channel),emissiveMapUv:ct&&v(M.emissiveMap.channel),metalnessMapUv:Ye&&v(M.metalnessMap.channel),roughnessMapUv:it&&v(M.roughnessMap.channel),anisotropyMapUv:ge&&v(M.anisotropyMap.channel),clearcoatMapUv:rt&&v(M.clearcoatMap.channel),clearcoatNormalMapUv:Ie&&v(M.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Je&&v(M.clearcoatRoughnessMap.channel),iridescenceMapUv:tt&&v(M.iridescenceMap.channel),iridescenceThicknessMapUv:Ee&&v(M.iridescenceThicknessMap.channel),sheenColorMapUv:Be&&v(M.sheenColorMap.channel),sheenRoughnessMapUv:ht&&v(M.sheenRoughnessMap.channel),specularMapUv:ot&&v(M.specularMap.channel),specularColorMapUv:Le&&v(M.specularColorMap.channel),specularIntensityMapUv:_t&&v(M.specularIntensityMap.channel),transmissionMapUv:re&&v(M.transmissionMap.channel),thicknessMapUv:ke&&v(M.thicknessMap.channel),alphaMapUv:Ge&&v(M.alphaMap.channel),vertexTangents:!!U.attributes.tangent&&(st||Ft),vertexColors:M.vertexColors,vertexAlphas:M.vertexColors===!0&&!!U.attributes.color&&U.attributes.color.itemSize===4,pointsUvs:D.isPoints===!0&&!!U.attributes.uv&&(we||Ge),fog:!!k,useFog:M.fog===!0,fogExp2:!!k&&k.isFogExp2,flatShading:M.flatShading===!0,sizeAttenuation:M.sizeAttenuation===!0,logarithmicDepthBuffer:d,reverseDepthBuffer:ce,skinning:D.isSkinnedMesh===!0,morphTargets:U.morphAttributes.position!==void 0,morphNormals:U.morphAttributes.normal!==void 0,morphColors:U.morphAttributes.color!==void 0,morphTargetsCount:K,morphTextureStride:F,numDirLights:C.directional.length,numPointLights:C.point.length,numSpotLights:C.spot.length,numSpotLightMaps:C.spotLightMap.length,numRectAreaLights:C.rectArea.length,numHemiLights:C.hemi.length,numDirLightShadows:C.directionalShadowMap.length,numPointLightShadows:C.pointShadowMap.length,numSpotLightShadows:C.spotShadowMap.length,numSpotLightShadowsWithMaps:C.numSpotLightShadowsWithMaps,numLightProbes:C.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:M.dithering,shadowMapEnabled:t.shadowMap.enabled&&P.length>0,shadowMapType:t.shadowMap.type,toneMapping:je,decodeVideoTexture:we&&M.map.isVideoTexture===!0&&Dt.getTransfer(M.map.colorSpace)===an,decodeVideoTextureEmissive:ct&&M.emissiveMap.isVideoTexture===!0&&Dt.getTransfer(M.emissiveMap.colorSpace)===an,premultipliedAlpha:M.premultipliedAlpha,doubleSided:M.side===Ki,flipSided:M.side===ui,useDepthPacking:M.depthPacking>=0,depthPacking:M.depthPacking||0,index0AttributeName:M.index0AttributeName,extensionClipCullDistance:Se&&M.extensions.clipCullDistance===!0&&r.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Se&&M.extensions.multiDraw===!0||fe)&&r.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:r.has("KHR_parallel_shader_compile"),customProgramCacheKey:M.customProgramCacheKey()};return vt.vertexUv1s=c.has(1),vt.vertexUv2s=c.has(2),vt.vertexUv3s=c.has(3),c.clear(),vt}function m(M){const C=[];if(M.shaderID?C.push(M.shaderID):(C.push(M.customVertexShaderID),C.push(M.customFragmentShaderID)),M.defines!==void 0)for(const P in M.defines)C.push(P),C.push(M.defines[P]);return M.isRawShaderMaterial===!1&&(x(C,M),b(C,M),C.push(t.outputColorSpace)),C.push(M.customProgramCacheKey),C.join()}function x(M,C){M.push(C.precision),M.push(C.outputColorSpace),M.push(C.envMapMode),M.push(C.envMapCubeUVHeight),M.push(C.mapUv),M.push(C.alphaMapUv),M.push(C.lightMapUv),M.push(C.aoMapUv),M.push(C.bumpMapUv),M.push(C.normalMapUv),M.push(C.displacementMapUv),M.push(C.emissiveMapUv),M.push(C.metalnessMapUv),M.push(C.roughnessMapUv),M.push(C.anisotropyMapUv),M.push(C.clearcoatMapUv),M.push(C.clearcoatNormalMapUv),M.push(C.clearcoatRoughnessMapUv),M.push(C.iridescenceMapUv),M.push(C.iridescenceThicknessMapUv),M.push(C.sheenColorMapUv),M.push(C.sheenRoughnessMapUv),M.push(C.specularMapUv),M.push(C.specularColorMapUv),M.push(C.specularIntensityMapUv),M.push(C.transmissionMapUv),M.push(C.thicknessMapUv),M.push(C.combine),M.push(C.fogExp2),M.push(C.sizeAttenuation),M.push(C.morphTargetsCount),M.push(C.morphAttributeCount),M.push(C.numDirLights),M.push(C.numPointLights),M.push(C.numSpotLights),M.push(C.numSpotLightMaps),M.push(C.numHemiLights),M.push(C.numRectAreaLights),M.push(C.numDirLightShadows),M.push(C.numPointLightShadows),M.push(C.numSpotLightShadows),M.push(C.numSpotLightShadowsWithMaps),M.push(C.numLightProbes),M.push(C.shadowMapType),M.push(C.toneMapping),M.push(C.numClippingPlanes),M.push(C.numClipIntersection),M.push(C.depthPacking)}function b(M,C){s.disableAll(),C.supportsVertexTextures&&s.enable(0),C.instancing&&s.enable(1),C.instancingColor&&s.enable(2),C.instancingMorph&&s.enable(3),C.matcap&&s.enable(4),C.envMap&&s.enable(5),C.normalMapObjectSpace&&s.enable(6),C.normalMapTangentSpace&&s.enable(7),C.clearcoat&&s.enable(8),C.iridescence&&s.enable(9),C.alphaTest&&s.enable(10),C.vertexColors&&s.enable(11),C.vertexAlphas&&s.enable(12),C.vertexUv1s&&s.enable(13),C.vertexUv2s&&s.enable(14),C.vertexUv3s&&s.enable(15),C.vertexTangents&&s.enable(16),C.anisotropy&&s.enable(17),C.alphaHash&&s.enable(18),C.batching&&s.enable(19),C.dispersion&&s.enable(20),C.batchingColor&&s.enable(21),M.push(s.mask),s.disableAll(),C.fog&&s.enable(0),C.useFog&&s.enable(1),C.flatShading&&s.enable(2),C.logarithmicDepthBuffer&&s.enable(3),C.reverseDepthBuffer&&s.enable(4),C.skinning&&s.enable(5),C.morphTargets&&s.enable(6),C.morphNormals&&s.enable(7),C.morphColors&&s.enable(8),C.premultipliedAlpha&&s.enable(9),C.shadowMapEnabled&&s.enable(10),C.doubleSided&&s.enable(11),C.flipSided&&s.enable(12),C.useDepthPacking&&s.enable(13),C.dithering&&s.enable(14),C.transmission&&s.enable(15),C.sheen&&s.enable(16),C.opaque&&s.enable(17),C.pointsUvs&&s.enable(18),C.decodeVideoTexture&&s.enable(19),C.decodeVideoTextureEmissive&&s.enable(20),C.alphaToCoverage&&s.enable(21),M.push(s.mask)}function S(M){const C=y[M.type];let P;if(C){const R=ta[C];P=mee.clone(R.uniforms)}else P=M.uniforms;return P}function w(M,C){let P;for(let R=0,D=u.length;R0?r.push(m):p.transparent===!0?i.push(m):n.push(m)}function l(d,f,p,y,v,g){const m=a(d,f,p,y,v,g);p.transmission>0?r.unshift(m):p.transparent===!0?i.unshift(m):n.unshift(m)}function c(d,f){n.length>1&&n.sort(d||boe),r.length>1&&r.sort(f||KO),i.length>1&&i.sort(f||KO)}function u(){for(let d=e,f=t.length;d=o.length?(a=new YO,o.push(a)):a=o[i],a}function n(){t=new WeakMap}return{get:e,dispose:n}}function woe(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new ne,color:new ft};break;case"SpotLight":n={position:new ne,direction:new ne,color:new ft,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new ne,color:new ft,distance:0,decay:0};break;case"HemisphereLight":n={direction:new ne,skyColor:new ft,groundColor:new ft};break;case"RectAreaLight":n={color:new ft,position:new ne,halfWidth:new ne,halfHeight:new ne};break}return t[e.id]=n,n}}}function Soe(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new xt};break;case"SpotLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new xt};break;case"PointLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new xt,shadowCameraNear:1,shadowCameraFar:1e3};break}return t[e.id]=n,n}}}let Eoe=0;function Toe(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function Moe(t){const e=new woe,n=Soe(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)r.probe.push(new ne);const i=new ne,o=new gt,a=new gt;function s(c){let u=0,d=0,f=0;for(let M=0;M<9;M++)r.probe[M].set(0,0,0);let p=0,y=0,v=0,g=0,m=0,x=0,b=0,S=0,w=0,E=0,T=0;c.sort(Toe);for(let M=0,C=c.length;M0&&(t.has("OES_texture_float_linear")===!0?(r.rectAreaLTC1=Fe.LTC_FLOAT_1,r.rectAreaLTC2=Fe.LTC_FLOAT_2):(r.rectAreaLTC1=Fe.LTC_HALF_1,r.rectAreaLTC2=Fe.LTC_HALF_2)),r.ambient[0]=u,r.ambient[1]=d,r.ambient[2]=f;const A=r.hash;(A.directionalLength!==p||A.pointLength!==y||A.spotLength!==v||A.rectAreaLength!==g||A.hemiLength!==m||A.numDirectionalShadows!==x||A.numPointShadows!==b||A.numSpotShadows!==S||A.numSpotMaps!==w||A.numLightProbes!==T)&&(r.directional.length=p,r.spot.length=v,r.rectArea.length=g,r.point.length=y,r.hemi.length=m,r.directionalShadow.length=x,r.directionalShadowMap.length=x,r.pointShadow.length=b,r.pointShadowMap.length=b,r.spotShadow.length=S,r.spotShadowMap.length=S,r.directionalShadowMatrix.length=x,r.pointShadowMatrix.length=b,r.spotLightMatrix.length=S+w-E,r.spotLightMap.length=w,r.numSpotLightShadowsWithMaps=E,r.numLightProbes=T,A.directionalLength=p,A.pointLength=y,A.spotLength=v,A.rectAreaLength=g,A.hemiLength=m,A.numDirectionalShadows=x,A.numPointShadows=b,A.numSpotShadows=S,A.numSpotMaps=w,A.numLightProbes=T,r.version=Eoe++)}function l(c,u){let d=0,f=0,p=0,y=0,v=0;const g=u.matrixWorldInverse;for(let m=0,x=c.length;m=a.length?(s=new JO(t),a.push(s)):s=a[o],s}function r(){e=new WeakMap}return{get:n,dispose:r}}const Coe=`void main() { + gl_Position = vec4( position, 1.0 ); +}`,Poe=`uniform sampler2D shadow_pass; +uniform vec2 resolution; +uniform float radius; +#include +void main() { + const float samples = float( VSM_SAMPLES ); + float mean = 0.0; + float squared_mean = 0.0; + float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); + float uvStart = samples <= 1.0 ? 0.0 : - 1.0; + for ( float i = 0.0; i < samples; i ++ ) { + float uvOffset = uvStart + i * uvStride; + #ifdef HORIZONTAL_PASS + vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); + mean += distribution.x; + squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; + #else + float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); + mean += depth; + squared_mean += depth * depth; + #endif + } + mean = mean / samples; + squared_mean = squared_mean / samples; + float std_dev = sqrt( squared_mean - mean * mean ); + gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); +}`;function Roe(t,e,n){let r=new ZA;const i=new xt,o=new xt,a=new Yt,s=new Nee({depthPacking:wQ}),l=new Oee,c={},u=n.maxTextureSize,d={[va]:ui,[ui]:va,[Ki]:Ki},f=new fl({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new xt},radius:{value:4}},vertexShader:Coe,fragmentShader:Poe}),p=f.clone();p.defines.HORIZONTAL_PASS=1;const y=new br;y.setAttribute("position",new cr(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const v=new Mn(y,f),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=v4;let m=this.type;this.render=function(E,T,A){if(g.enabled===!1||g.autoUpdate===!1&&g.needsUpdate===!1||E.length===0)return;const M=t.getRenderTarget(),C=t.getActiveCubeFace(),P=t.getActiveMipmapLevel(),R=t.state;R.setBlending(el),R.buffers.color.setClear(1,1,1,1),R.buffers.depth.setTest(!0),R.setScissorTest(!1);const D=m!==Da&&this.type===Da,k=m===Da&&this.type!==Da;for(let U=0,O=E.length;Uu||i.y>u)&&(i.x>u&&(o.x=Math.floor(u/j.x),i.x=o.x*j.x,L.mapSize.x=o.x),i.y>u&&(o.y=Math.floor(u/j.y),i.y=o.y*j.y,L.mapSize.y=o.y)),L.map===null||D===!0||k===!0){const K=this.type!==Da?{minFilter:Xr,magFilter:Xr}:{};L.map!==null&&L.map.dispose(),L.map=new Oc(i.x,i.y,K),L.map.texture.name=W.name+".shadowMap",L.camera.updateProjectionMatrix()}t.setRenderTarget(L.map),t.clear();const X=L.getViewportCount();for(let K=0;K0||T.map&&T.alphaTest>0||T.alphaToCoverage===!0){const R=C.uuid,D=T.uuid;let k=c[R];k===void 0&&(k={},c[R]=k);let U=k[D];U===void 0&&(U=C.clone(),k[D]=U,T.addEventListener("dispose",w)),C=U}if(C.visible=T.visible,C.wireframe=T.wireframe,M===Da?C.side=T.shadowSide!==null?T.shadowSide:T.side:C.side=T.shadowSide!==null?T.shadowSide:d[T.side],C.alphaMap=T.alphaMap,C.alphaTest=T.alphaToCoverage===!0?.5:T.alphaTest,C.map=T.map,C.clipShadows=T.clipShadows,C.clippingPlanes=T.clippingPlanes,C.clipIntersection=T.clipIntersection,C.displacementMap=T.displacementMap,C.displacementScale=T.displacementScale,C.displacementBias=T.displacementBias,C.wireframeLinewidth=T.wireframeLinewidth,C.linewidth=T.linewidth,A.isPointLight===!0&&C.isMeshDistanceMaterial===!0){const R=t.properties.get(C);R.light=A}return C}function S(E,T,A,M,C){if(E.visible===!1)return;if(E.layers.test(T.layers)&&(E.isMesh||E.isLine||E.isPoints)&&(E.castShadow||E.receiveShadow&&C===Da)&&(!E.frustumCulled||r.intersectsObject(E))){E.modelViewMatrix.multiplyMatrices(A.matrixWorldInverse,E.matrixWorld);const D=e.update(E),k=E.material;if(Array.isArray(k)){const U=D.groups;for(let O=0,W=U.length;O=1):L.indexOf("OpenGL ES")!==-1&&(W=parseFloat(/^OpenGL ES (\d)/.exec(L)[1]),O=W>=2);let j=null,X={};const K=t.getParameter(t.SCISSOR_BOX),F=t.getParameter(t.VIEWPORT),Y=new Yt().fromArray(K),q=new Yt().fromArray(F);function Q(re,ke,Me,Ge){const Te=new Uint8Array(4),_e=t.createTexture();t.bindTexture(re,_e),t.texParameteri(re,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(re,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let Se=0;Se"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new xt,u=new WeakMap;let d;const f=new WeakMap;let p=!1;try{p=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function y(J,B){return p?new OffscreenCanvas(J,B):Pp("canvas")}function v(J,B,ue){let me=1;const be=Ft(J);if((be.width>ue||be.height>ue)&&(me=ue/Math.max(be.width,be.height)),me<1)if(typeof HTMLImageElement<"u"&&J instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&J instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&J instanceof ImageBitmap||typeof VideoFrame<"u"&&J instanceof VideoFrame){const ge=Math.floor(me*be.width),rt=Math.floor(me*be.height);d===void 0&&(d=y(ge,rt));const Ie=B?y(ge,rt):d;return Ie.width=ge,Ie.height=rt,Ie.getContext("2d").drawImage(J,0,0,ge,rt),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+be.width+"x"+be.height+") to ("+ge+"x"+rt+")."),Ie}else return"data"in J&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+be.width+"x"+be.height+")."),J;return J}function g(J){return J.generateMipmaps}function m(J){t.generateMipmap(J)}function x(J){return J.isWebGLCubeRenderTarget?t.TEXTURE_CUBE_MAP:J.isWebGL3DRenderTarget?t.TEXTURE_3D:J.isWebGLArrayRenderTarget||J.isCompressedArrayTexture?t.TEXTURE_2D_ARRAY:t.TEXTURE_2D}function b(J,B,ue,me,be=!1){if(J!==null){if(t[J]!==void 0)return t[J];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+J+"'")}let ge=B;if(B===t.RED&&(ue===t.FLOAT&&(ge=t.R32F),ue===t.HALF_FLOAT&&(ge=t.R16F),ue===t.UNSIGNED_BYTE&&(ge=t.R8)),B===t.RED_INTEGER&&(ue===t.UNSIGNED_BYTE&&(ge=t.R8UI),ue===t.UNSIGNED_SHORT&&(ge=t.R16UI),ue===t.UNSIGNED_INT&&(ge=t.R32UI),ue===t.BYTE&&(ge=t.R8I),ue===t.SHORT&&(ge=t.R16I),ue===t.INT&&(ge=t.R32I)),B===t.RG&&(ue===t.FLOAT&&(ge=t.RG32F),ue===t.HALF_FLOAT&&(ge=t.RG16F),ue===t.UNSIGNED_BYTE&&(ge=t.RG8)),B===t.RG_INTEGER&&(ue===t.UNSIGNED_BYTE&&(ge=t.RG8UI),ue===t.UNSIGNED_SHORT&&(ge=t.RG16UI),ue===t.UNSIGNED_INT&&(ge=t.RG32UI),ue===t.BYTE&&(ge=t.RG8I),ue===t.SHORT&&(ge=t.RG16I),ue===t.INT&&(ge=t.RG32I)),B===t.RGB_INTEGER&&(ue===t.UNSIGNED_BYTE&&(ge=t.RGB8UI),ue===t.UNSIGNED_SHORT&&(ge=t.RGB16UI),ue===t.UNSIGNED_INT&&(ge=t.RGB32UI),ue===t.BYTE&&(ge=t.RGB8I),ue===t.SHORT&&(ge=t.RGB16I),ue===t.INT&&(ge=t.RGB32I)),B===t.RGBA_INTEGER&&(ue===t.UNSIGNED_BYTE&&(ge=t.RGBA8UI),ue===t.UNSIGNED_SHORT&&(ge=t.RGBA16UI),ue===t.UNSIGNED_INT&&(ge=t.RGBA32UI),ue===t.BYTE&&(ge=t.RGBA8I),ue===t.SHORT&&(ge=t.RGBA16I),ue===t.INT&&(ge=t.RGBA32I)),B===t.RGB&&ue===t.UNSIGNED_INT_5_9_9_9_REV&&(ge=t.RGB9_E5),B===t.RGBA){const rt=be?Cy:Dt.getTransfer(me);ue===t.FLOAT&&(ge=t.RGBA32F),ue===t.HALF_FLOAT&&(ge=t.RGBA16F),ue===t.UNSIGNED_BYTE&&(ge=rt===an?t.SRGB8_ALPHA8:t.RGBA8),ue===t.UNSIGNED_SHORT_4_4_4_4&&(ge=t.RGBA4),ue===t.UNSIGNED_SHORT_5_5_5_1&&(ge=t.RGB5_A1)}return(ge===t.R16F||ge===t.R32F||ge===t.RG16F||ge===t.RG32F||ge===t.RGBA16F||ge===t.RGBA32F)&&e.get("EXT_color_buffer_float"),ge}function S(J,B){let ue;return J?B===null||B===Nc||B===Ep?ue=t.DEPTH24_STENCIL8:B===Io?ue=t.DEPTH32F_STENCIL8:B===Sp&&(ue=t.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):B===null||B===Nc||B===Ep?ue=t.DEPTH_COMPONENT24:B===Io?ue=t.DEPTH_COMPONENT32F:B===Sp&&(ue=t.DEPTH_COMPONENT16),ue}function w(J,B){return g(J)===!0||J.isFramebufferTexture&&J.minFilter!==Xr&&J.minFilter!==Or?Math.log2(Math.max(B.width,B.height))+1:J.mipmaps!==void 0&&J.mipmaps.length>0?J.mipmaps.length:J.isCompressedTexture&&Array.isArray(J.image)?B.mipmaps.length:1}function E(J){const B=J.target;B.removeEventListener("dispose",E),A(B),B.isVideoTexture&&u.delete(B)}function T(J){const B=J.target;B.removeEventListener("dispose",T),C(B)}function A(J){const B=r.get(J);if(B.__webglInit===void 0)return;const ue=J.source,me=f.get(ue);if(me){const be=me[B.__cacheKey];be.usedTimes--,be.usedTimes===0&&M(J),Object.keys(me).length===0&&f.delete(ue)}r.remove(J)}function M(J){const B=r.get(J);t.deleteTexture(B.__webglTexture);const ue=J.source,me=f.get(ue);delete me[B.__cacheKey],a.memory.textures--}function C(J){const B=r.get(J);if(J.depthTexture&&(J.depthTexture.dispose(),r.remove(J.depthTexture)),J.isWebGLCubeRenderTarget)for(let me=0;me<6;me++){if(Array.isArray(B.__webglFramebuffer[me]))for(let be=0;be=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+J+" texture units while this GPU supports only "+i.maxTextures),P+=1,J}function k(J){const B=[];return B.push(J.wrapS),B.push(J.wrapT),B.push(J.wrapR||0),B.push(J.magFilter),B.push(J.minFilter),B.push(J.anisotropy),B.push(J.internalFormat),B.push(J.format),B.push(J.type),B.push(J.generateMipmaps),B.push(J.premultiplyAlpha),B.push(J.flipY),B.push(J.unpackAlignment),B.push(J.colorSpace),B.join()}function U(J,B){const ue=r.get(J);if(J.isVideoTexture&&Ye(J),J.isRenderTargetTexture===!1&&J.version>0&&ue.__version!==J.version){const me=J.image;if(me===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(me.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{te(ue,J,B);return}}n.bindTexture(t.TEXTURE_2D,ue.__webglTexture,t.TEXTURE0+B)}function O(J,B){const ue=r.get(J);if(J.version>0&&ue.__version!==J.version){te(ue,J,B);return}n.bindTexture(t.TEXTURE_2D_ARRAY,ue.__webglTexture,t.TEXTURE0+B)}function W(J,B){const ue=r.get(J);if(J.version>0&&ue.__version!==J.version){te(ue,J,B);return}n.bindTexture(t.TEXTURE_3D,ue.__webglTexture,t.TEXTURE0+B)}function L(J,B){const ue=r.get(J);if(J.version>0&&ue.__version!==J.version){ee(ue,J,B);return}n.bindTexture(t.TEXTURE_CUBE_MAP,ue.__webglTexture,t.TEXTURE0+B)}const j={[aa]:t.REPEAT,[Ji]:t.CLAMP_TO_EDGE,[Ay]:t.MIRRORED_REPEAT},X={[Xr]:t.NEAREST,[b4]:t.NEAREST_MIPMAP_NEAREST,[Ch]:t.NEAREST_MIPMAP_LINEAR,[Or]:t.LINEAR,[Fv]:t.LINEAR_MIPMAP_NEAREST,[Oo]:t.LINEAR_MIPMAP_LINEAR},K={[EQ]:t.NEVER,[RQ]:t.ALWAYS,[TQ]:t.LESS,[P4]:t.LEQUAL,[MQ]:t.EQUAL,[PQ]:t.GEQUAL,[AQ]:t.GREATER,[CQ]:t.NOTEQUAL};function F(J,B){if(B.type===Io&&e.has("OES_texture_float_linear")===!1&&(B.magFilter===Or||B.magFilter===Fv||B.magFilter===Ch||B.magFilter===Oo||B.minFilter===Or||B.minFilter===Fv||B.minFilter===Ch||B.minFilter===Oo)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),t.texParameteri(J,t.TEXTURE_WRAP_S,j[B.wrapS]),t.texParameteri(J,t.TEXTURE_WRAP_T,j[B.wrapT]),(J===t.TEXTURE_3D||J===t.TEXTURE_2D_ARRAY)&&t.texParameteri(J,t.TEXTURE_WRAP_R,j[B.wrapR]),t.texParameteri(J,t.TEXTURE_MAG_FILTER,X[B.magFilter]),t.texParameteri(J,t.TEXTURE_MIN_FILTER,X[B.minFilter]),B.compareFunction&&(t.texParameteri(J,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(J,t.TEXTURE_COMPARE_FUNC,K[B.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(B.magFilter===Xr||B.minFilter!==Ch&&B.minFilter!==Oo||B.type===Io&&e.has("OES_texture_float_linear")===!1)return;if(B.anisotropy>1||r.get(B).__currentAnisotropy){const ue=e.get("EXT_texture_filter_anisotropic");t.texParameterf(J,ue.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(B.anisotropy,i.getMaxAnisotropy())),r.get(B).__currentAnisotropy=B.anisotropy}}}function Y(J,B){let ue=!1;J.__webglInit===void 0&&(J.__webglInit=!0,B.addEventListener("dispose",E));const me=B.source;let be=f.get(me);be===void 0&&(be={},f.set(me,be));const ge=k(B);if(ge!==J.__cacheKey){be[ge]===void 0&&(be[ge]={texture:t.createTexture(),usedTimes:0},a.memory.textures++,ue=!0),be[ge].usedTimes++;const rt=be[J.__cacheKey];rt!==void 0&&(be[J.__cacheKey].usedTimes--,rt.usedTimes===0&&M(B)),J.__cacheKey=ge,J.__webglTexture=be[ge].texture}return ue}function q(J,B,ue){return Math.floor(Math.floor(J/ue)/B)}function Q(J,B,ue,me){const ge=J.updateRanges;if(ge.length===0)n.texSubImage2D(t.TEXTURE_2D,0,0,0,B.width,B.height,ue,me,B.data);else{ge.sort((Ee,Be)=>Ee.start-Be.start);let rt=0;for(let Ee=1;Ee0){re&&ke&&n.texStorage2D(t.TEXTURE_2D,Ge,ot,_t[0].width,_t[0].height);for(let Te=0,_e=_t.length;Te<_e;Te++)Le=_t[Te],re?Me&&n.texSubImage2D(t.TEXTURE_2D,Te,0,0,Le.width,Le.height,Be,ht,Le.data):n.texImage2D(t.TEXTURE_2D,Te,ot,Le.width,Le.height,0,Be,ht,Le.data);B.generateMipmaps=!1}else re?(ke&&n.texStorage2D(t.TEXTURE_2D,Ge,ot,Ee.width,Ee.height),Me&&Q(B,Ee,Be,ht)):n.texImage2D(t.TEXTURE_2D,0,ot,Ee.width,Ee.height,0,Be,ht,Ee.data);else if(B.isCompressedTexture)if(B.isCompressedArrayTexture){re&&ke&&n.texStorage3D(t.TEXTURE_2D_ARRAY,Ge,ot,_t[0].width,_t[0].height,Ee.depth);for(let Te=0,_e=_t.length;Te<_e;Te++)if(Le=_t[Te],B.format!==Zi)if(Be!==null)if(re){if(Me)if(B.layerUpdates.size>0){const Se=AO(Le.width,Le.height,B.format,B.type);for(const je of B.layerUpdates){const vt=Le.data.subarray(je*Se/Le.data.BYTES_PER_ELEMENT,(je+1)*Se/Le.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,Te,0,0,je,Le.width,Le.height,1,Be,vt)}B.clearLayerUpdates()}else n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,Te,0,0,0,Le.width,Le.height,Ee.depth,Be,Le.data)}else n.compressedTexImage3D(t.TEXTURE_2D_ARRAY,Te,ot,Le.width,Le.height,Ee.depth,0,Le.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else re?Me&&n.texSubImage3D(t.TEXTURE_2D_ARRAY,Te,0,0,0,Le.width,Le.height,Ee.depth,Be,ht,Le.data):n.texImage3D(t.TEXTURE_2D_ARRAY,Te,ot,Le.width,Le.height,Ee.depth,0,Be,ht,Le.data)}else{re&&ke&&n.texStorage2D(t.TEXTURE_2D,Ge,ot,_t[0].width,_t[0].height);for(let Te=0,_e=_t.length;Te<_e;Te++)Le=_t[Te],B.format!==Zi?Be!==null?re?Me&&n.compressedTexSubImage2D(t.TEXTURE_2D,Te,0,0,Le.width,Le.height,Be,Le.data):n.compressedTexImage2D(t.TEXTURE_2D,Te,ot,Le.width,Le.height,0,Le.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):re?Me&&n.texSubImage2D(t.TEXTURE_2D,Te,0,0,Le.width,Le.height,Be,ht,Le.data):n.texImage2D(t.TEXTURE_2D,Te,ot,Le.width,Le.height,0,Be,ht,Le.data)}else if(B.isDataArrayTexture)if(re){if(ke&&n.texStorage3D(t.TEXTURE_2D_ARRAY,Ge,ot,Ee.width,Ee.height,Ee.depth),Me)if(B.layerUpdates.size>0){const Te=AO(Ee.width,Ee.height,B.format,B.type);for(const _e of B.layerUpdates){const Se=Ee.data.subarray(_e*Te/Ee.data.BYTES_PER_ELEMENT,(_e+1)*Te/Ee.data.BYTES_PER_ELEMENT);n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,_e,Ee.width,Ee.height,1,Be,ht,Se)}B.clearLayerUpdates()}else n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,0,Ee.width,Ee.height,Ee.depth,Be,ht,Ee.data)}else n.texImage3D(t.TEXTURE_2D_ARRAY,0,ot,Ee.width,Ee.height,Ee.depth,0,Be,ht,Ee.data);else if(B.isData3DTexture)re?(ke&&n.texStorage3D(t.TEXTURE_3D,Ge,ot,Ee.width,Ee.height,Ee.depth),Me&&n.texSubImage3D(t.TEXTURE_3D,0,0,0,0,Ee.width,Ee.height,Ee.depth,Be,ht,Ee.data)):n.texImage3D(t.TEXTURE_3D,0,ot,Ee.width,Ee.height,Ee.depth,0,Be,ht,Ee.data);else if(B.isFramebufferTexture){if(ke)if(re)n.texStorage2D(t.TEXTURE_2D,Ge,ot,Ee.width,Ee.height);else{let Te=Ee.width,_e=Ee.height;for(let Se=0;Se>=1,_e>>=1}}else if(_t.length>0){if(re&&ke){const Te=Ft(_t[0]);n.texStorage2D(t.TEXTURE_2D,Ge,ot,Te.width,Te.height)}for(let Te=0,_e=_t.length;Te<_e;Te++)Le=_t[Te],re?Me&&n.texSubImage2D(t.TEXTURE_2D,Te,0,0,Be,ht,Le):n.texImage2D(t.TEXTURE_2D,Te,ot,Be,ht,Le);B.generateMipmaps=!1}else if(re){if(ke){const Te=Ft(Ee);n.texStorage2D(t.TEXTURE_2D,Ge,ot,Te.width,Te.height)}Me&&n.texSubImage2D(t.TEXTURE_2D,0,0,0,Be,ht,Ee)}else n.texImage2D(t.TEXTURE_2D,0,ot,Be,ht,Ee);g(B)&&m(me),rt.__version=ge.version,B.onUpdate&&B.onUpdate(B)}J.__version=B.version}function ee(J,B,ue){if(B.image.length!==6)return;const me=Y(J,B),be=B.source;n.bindTexture(t.TEXTURE_CUBE_MAP,J.__webglTexture,t.TEXTURE0+ue);const ge=r.get(be);if(be.version!==ge.__version||me===!0){n.activeTexture(t.TEXTURE0+ue);const rt=Dt.getPrimaries(Dt.workingColorSpace),Ie=B.colorSpace===Ns?null:Dt.getPrimaries(B.colorSpace),Je=B.colorSpace===Ns||rt===Ie?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,B.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,B.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,B.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,Je);const tt=B.isCompressedTexture||B.image[0].isCompressedTexture,Ee=B.image[0]&&B.image[0].isDataTexture,Be=[];for(let _e=0;_e<6;_e++)!tt&&!Ee?Be[_e]=v(B.image[_e],!0,i.maxCubemapSize):Be[_e]=Ee?B.image[_e].image:B.image[_e],Be[_e]=it(B,Be[_e]);const ht=Be[0],ot=o.convert(B.format,B.colorSpace),Le=o.convert(B.type),_t=b(B.internalFormat,ot,Le,B.colorSpace),re=B.isVideoTexture!==!0,ke=ge.__version===void 0||me===!0,Me=be.dataReady;let Ge=w(B,ht);F(t.TEXTURE_CUBE_MAP,B);let Te;if(tt){re&&ke&&n.texStorage2D(t.TEXTURE_CUBE_MAP,Ge,_t,ht.width,ht.height);for(let _e=0;_e<6;_e++){Te=Be[_e].mipmaps;for(let Se=0;Se0&&Ge++;const _e=Ft(Be[0]);n.texStorage2D(t.TEXTURE_CUBE_MAP,Ge,_t,_e.width,_e.height)}for(let _e=0;_e<6;_e++)if(Ee){re?Me&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+_e,0,0,0,Be[_e].width,Be[_e].height,ot,Le,Be[_e].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+_e,0,_t,Be[_e].width,Be[_e].height,0,ot,Le,Be[_e].data);for(let Se=0;Se>ge),ht=Math.max(1,B.height>>ge);be===t.TEXTURE_3D||be===t.TEXTURE_2D_ARRAY?n.texImage3D(be,ge,Je,Be,ht,B.depth,0,rt,Ie,null):n.texImage2D(be,ge,Je,Be,ht,0,rt,Ie,null)}n.bindFramebuffer(t.FRAMEBUFFER,J),ct(B)?s.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,me,be,Ee.__webglTexture,0,Re(B)):(be===t.TEXTURE_2D||be>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&be<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,me,be,Ee.__webglTexture,ge),n.bindFramebuffer(t.FRAMEBUFFER,null)}function ae(J,B,ue){if(t.bindRenderbuffer(t.RENDERBUFFER,J),B.depthBuffer){const me=B.depthTexture,be=me&&me.isDepthTexture?me.type:null,ge=S(B.stencilBuffer,be),rt=B.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,Ie=Re(B);ct(B)?s.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,Ie,ge,B.width,B.height):ue?t.renderbufferStorageMultisample(t.RENDERBUFFER,Ie,ge,B.width,B.height):t.renderbufferStorage(t.RENDERBUFFER,ge,B.width,B.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,rt,t.RENDERBUFFER,J)}else{const me=B.textures;for(let be=0;be{delete B.__boundDepthTexture,delete B.__depthDisposeCallback,me.removeEventListener("dispose",be)};me.addEventListener("dispose",be),B.__depthDisposeCallback=be}B.__boundDepthTexture=me}if(J.depthTexture&&!B.__autoAllocateDepthBuffer){if(ue)throw new Error("target.depthTexture not supported in Cube render targets");const me=J.texture.mipmaps;me&&me.length>0?fe(B.__webglFramebuffer[0],J):fe(B.__webglFramebuffer,J)}else if(ue){B.__webglDepthbuffer=[];for(let me=0;me<6;me++)if(n.bindFramebuffer(t.FRAMEBUFFER,B.__webglFramebuffer[me]),B.__webglDepthbuffer[me]===void 0)B.__webglDepthbuffer[me]=t.createRenderbuffer(),ae(B.__webglDepthbuffer[me],J,!1);else{const be=J.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,ge=B.__webglDepthbuffer[me];t.bindRenderbuffer(t.RENDERBUFFER,ge),t.framebufferRenderbuffer(t.FRAMEBUFFER,be,t.RENDERBUFFER,ge)}}else{const me=J.texture.mipmaps;if(me&&me.length>0?n.bindFramebuffer(t.FRAMEBUFFER,B.__webglFramebuffer[0]):n.bindFramebuffer(t.FRAMEBUFFER,B.__webglFramebuffer),B.__webglDepthbuffer===void 0)B.__webglDepthbuffer=t.createRenderbuffer(),ae(B.__webglDepthbuffer,J,!1);else{const be=J.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,ge=B.__webglDepthbuffer;t.bindRenderbuffer(t.RENDERBUFFER,ge),t.framebufferRenderbuffer(t.FRAMEBUFFER,be,t.RENDERBUFFER,ge)}}n.bindFramebuffer(t.FRAMEBUFFER,null)}function le(J,B,ue){const me=r.get(J);B!==void 0&&ce(me.__webglFramebuffer,J,J.texture,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,0),ue!==void 0&&we(J)}function ie(J){const B=J.texture,ue=r.get(J),me=r.get(B);J.addEventListener("dispose",T);const be=J.textures,ge=J.isWebGLCubeRenderTarget===!0,rt=be.length>1;if(rt||(me.__webglTexture===void 0&&(me.__webglTexture=t.createTexture()),me.__version=B.version,a.memory.textures++),ge){ue.__webglFramebuffer=[];for(let Ie=0;Ie<6;Ie++)if(B.mipmaps&&B.mipmaps.length>0){ue.__webglFramebuffer[Ie]=[];for(let Je=0;Je0){ue.__webglFramebuffer=[];for(let Ie=0;Ie0&&ct(J)===!1){ue.__webglMultisampledFramebuffer=t.createFramebuffer(),ue.__webglColorRenderbuffer=[],n.bindFramebuffer(t.FRAMEBUFFER,ue.__webglMultisampledFramebuffer);for(let Ie=0;Ie0)for(let Je=0;Je0)for(let Je=0;Je0){if(ct(J)===!1){const B=J.textures,ue=J.width,me=J.height;let be=t.COLOR_BUFFER_BIT;const ge=J.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,rt=r.get(J),Ie=B.length>1;if(Ie)for(let tt=0;tt0?n.bindFramebuffer(t.DRAW_FRAMEBUFFER,rt.__webglFramebuffer[0]):n.bindFramebuffer(t.DRAW_FRAMEBUFFER,rt.__webglFramebuffer);for(let tt=0;tt0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&B.__useRenderToTexture!==!1}function Ye(J){const B=a.render.frame;u.get(J)!==B&&(u.set(J,B),J.update())}function it(J,B){const ue=J.colorSpace,me=J.format,be=J.type;return J.isCompressedTexture===!0||J.isVideoTexture===!0||ue!==Kr&&ue!==Ns&&(Dt.getTransfer(ue)===an?(me!==Zi||be!==ya)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",ue)),B}function Ft(J){return typeof HTMLImageElement<"u"&&J instanceof HTMLImageElement?(c.width=J.naturalWidth||J.width,c.height=J.naturalHeight||J.height):typeof VideoFrame<"u"&&J instanceof VideoFrame?(c.width=J.displayWidth,c.height=J.displayHeight):(c.width=J.width,c.height=J.height),c}this.allocateTextureUnit=D,this.resetTextureUnits=R,this.setTexture2D=U,this.setTexture2DArray=O,this.setTexture3D=W,this.setTextureCube=L,this.rebindTextures=le,this.setupRenderTarget=ie,this.updateRenderTargetMipmap=G,this.updateMultisampleRenderTarget=st,this.setupDepthRenderbuffer=we,this.setupFrameBufferTexture=ce,this.useMultisampledRTT=ct}function Doe(t,e){function n(r,i=Ns){let o;const a=Dt.getTransfer(i);if(r===ya)return t.UNSIGNED_BYTE;if(r===BA)return t.UNSIGNED_SHORT_4_4_4_4;if(r===$A)return t.UNSIGNED_SHORT_5_5_5_1;if(r===S4)return t.UNSIGNED_INT_5_9_9_9_REV;if(r===_4)return t.BYTE;if(r===w4)return t.SHORT;if(r===Sp)return t.UNSIGNED_SHORT;if(r===FA)return t.INT;if(r===Nc)return t.UNSIGNED_INT;if(r===Io)return t.FLOAT;if(r===Nm)return t.HALF_FLOAT;if(r===E4)return t.ALPHA;if(r===T4)return t.RGB;if(r===Zi)return t.RGBA;if(r===Tp)return t.DEPTH_COMPONENT;if(r===Mp)return t.DEPTH_STENCIL;if(r===zA)return t.RED;if(r===HA)return t.RED_INTEGER;if(r===M4)return t.RG;if(r===VA)return t.RG_INTEGER;if(r===GA)return t.RGBA_INTEGER;if(r===Bv||r===$v||r===zv||r===Hv)if(a===an)if(o=e.get("WEBGL_compressed_texture_s3tc_srgb"),o!==null){if(r===Bv)return o.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(r===$v)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(r===zv)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(r===Hv)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(o=e.get("WEBGL_compressed_texture_s3tc"),o!==null){if(r===Bv)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(r===$v)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(r===zv)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(r===Hv)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(r===FE||r===BE||r===$E||r===zE)if(o=e.get("WEBGL_compressed_texture_pvrtc"),o!==null){if(r===FE)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(r===BE)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(r===$E)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(r===zE)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(r===HE||r===VE||r===GE)if(o=e.get("WEBGL_compressed_texture_etc"),o!==null){if(r===HE||r===VE)return a===an?o.COMPRESSED_SRGB8_ETC2:o.COMPRESSED_RGB8_ETC2;if(r===GE)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:o.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(r===WE||r===XE||r===qE||r===KE||r===YE||r===JE||r===ZE||r===QE||r===e1||r===t1||r===n1||r===r1||r===i1||r===o1)if(o=e.get("WEBGL_compressed_texture_astc"),o!==null){if(r===WE)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:o.COMPRESSED_RGBA_ASTC_4x4_KHR;if(r===XE)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:o.COMPRESSED_RGBA_ASTC_5x4_KHR;if(r===qE)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:o.COMPRESSED_RGBA_ASTC_5x5_KHR;if(r===KE)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:o.COMPRESSED_RGBA_ASTC_6x5_KHR;if(r===YE)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:o.COMPRESSED_RGBA_ASTC_6x6_KHR;if(r===JE)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:o.COMPRESSED_RGBA_ASTC_8x5_KHR;if(r===ZE)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:o.COMPRESSED_RGBA_ASTC_8x6_KHR;if(r===QE)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:o.COMPRESSED_RGBA_ASTC_8x8_KHR;if(r===e1)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:o.COMPRESSED_RGBA_ASTC_10x5_KHR;if(r===t1)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:o.COMPRESSED_RGBA_ASTC_10x6_KHR;if(r===n1)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:o.COMPRESSED_RGBA_ASTC_10x8_KHR;if(r===r1)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:o.COMPRESSED_RGBA_ASTC_10x10_KHR;if(r===i1)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:o.COMPRESSED_RGBA_ASTC_12x10_KHR;if(r===o1)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:o.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(r===Vv||r===a1||r===s1)if(o=e.get("EXT_texture_compression_bptc"),o!==null){if(r===Vv)return a===an?o.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:o.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(r===a1)return o.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(r===s1)return o.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(r===A4||r===l1||r===c1||r===u1)if(o=e.get("EXT_texture_compression_rgtc"),o!==null){if(r===Vv)return o.COMPRESSED_RED_RGTC1_EXT;if(r===l1)return o.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(r===c1)return o.COMPRESSED_RED_GREEN_RGTC2_EXT;if(r===u1)return o.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return r===Ep?t.UNSIGNED_INT_24_8:t[r]!==void 0?t[r]:null}return{convert:n}}const Loe=` +void main() { + + gl_Position = vec4( position, 1.0 ); + +}`,koe=` +uniform sampler2DArray depthColor; +uniform float depthWidth; +uniform float depthHeight; + +void main() { + + vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); + + if ( coord.x >= 1.0 ) { + + gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; + + } else { + + gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; + + } + +}`;class joe{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,n,r){if(this.texture===null){const i=new lr,o=e.properties.get(i);o.__webglTexture=n.texture,(n.depthNear!==r.depthNear||n.depthFar!==r.depthFar)&&(this.depthNear=n.depthNear,this.depthFar=n.depthFar),this.texture=i}}getMesh(e){if(this.texture!==null&&this.mesh===null){const n=e.cameras[0].viewport,r=new fl({vertexShader:Loe,fragmentShader:koe,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new Mn(new Om(20,20),r)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class Uoe extends Vc{constructor(e,n){super();const r=this;let i=null,o=1,a=null,s="local-floor",l=1,c=null,u=null,d=null,f=null,p=null,y=null;const v=new joe,g=n.getContextAttributes();let m=null,x=null;const b=[],S=[],w=new xt;let E=null;const T=new gr;T.viewport=new Yt;const A=new gr;A.viewport=new Yt;const M=[T,A],C=new Kee;let P=null,R=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(q){let Q=b[q];return Q===void 0&&(Q=new uw,b[q]=Q),Q.getTargetRaySpace()},this.getControllerGrip=function(q){let Q=b[q];return Q===void 0&&(Q=new uw,b[q]=Q),Q.getGripSpace()},this.getHand=function(q){let Q=b[q];return Q===void 0&&(Q=new uw,b[q]=Q),Q.getHandSpace()};function D(q){const Q=S.indexOf(q.inputSource);if(Q===-1)return;const te=b[Q];te!==void 0&&(te.update(q.inputSource,q.frame,c||a),te.dispatchEvent({type:q.type,data:q.inputSource}))}function k(){i.removeEventListener("select",D),i.removeEventListener("selectstart",D),i.removeEventListener("selectend",D),i.removeEventListener("squeeze",D),i.removeEventListener("squeezestart",D),i.removeEventListener("squeezeend",D),i.removeEventListener("end",k),i.removeEventListener("inputsourceschange",U);for(let q=0;q=0&&(S[ee]=null,b[ee].disconnect(te))}for(let Q=0;Q=S.length){S.push(te),ee=ae;break}else if(S[ae]===null){S[ae]=te,ee=ae;break}if(ee===-1)break}const ce=b[ee];ce&&ce.connect(te)}}const O=new ne,W=new ne;function L(q,Q,te){O.setFromMatrixPosition(Q.matrixWorld),W.setFromMatrixPosition(te.matrixWorld);const ee=O.distanceTo(W),ce=Q.projectionMatrix.elements,ae=te.projectionMatrix.elements,fe=ce[14]/(ce[10]-1),we=ce[14]/(ce[10]+1),le=(ce[9]+1)/ce[5],ie=(ce[9]-1)/ce[5],G=(ce[8]-1)/ce[0],Ve=(ae[8]+1)/ae[0],Ne=fe*G,st=fe*Ve,Re=ee/(-G+Ve),ct=Re*-G;if(Q.matrixWorld.decompose(q.position,q.quaternion,q.scale),q.translateX(ct),q.translateZ(Re),q.matrixWorld.compose(q.position,q.quaternion,q.scale),q.matrixWorldInverse.copy(q.matrixWorld).invert(),ce[10]===-1)q.projectionMatrix.copy(Q.projectionMatrix),q.projectionMatrixInverse.copy(Q.projectionMatrixInverse);else{const Ye=fe+Re,it=we+Re,Ft=Ne-ct,J=st+(ee-ct),B=le*we/it*Ye,ue=ie*we/it*Ye;q.projectionMatrix.makePerspective(Ft,J,B,ue,Ye,it),q.projectionMatrixInverse.copy(q.projectionMatrix).invert()}}function j(q,Q){Q===null?q.matrixWorld.copy(q.matrix):q.matrixWorld.multiplyMatrices(Q.matrixWorld,q.matrix),q.matrixWorldInverse.copy(q.matrixWorld).invert()}this.updateCamera=function(q){if(i===null)return;let Q=q.near,te=q.far;v.texture!==null&&(v.depthNear>0&&(Q=v.depthNear),v.depthFar>0&&(te=v.depthFar)),C.near=A.near=T.near=Q,C.far=A.far=T.far=te,(P!==C.near||R!==C.far)&&(i.updateRenderState({depthNear:C.near,depthFar:C.far}),P=C.near,R=C.far),T.layers.mask=q.layers.mask|2,A.layers.mask=q.layers.mask|4,C.layers.mask=T.layers.mask|A.layers.mask;const ee=q.parent,ce=C.cameras;j(C,ee);for(let ae=0;ae0&&(g.alphaTest.value=m.alphaTest);const x=e.get(m),b=x.envMap,S=x.envMapRotation;b&&(g.envMap.value=b,jl.copy(S),jl.x*=-1,jl.y*=-1,jl.z*=-1,b.isCubeTexture&&b.isRenderTargetTexture===!1&&(jl.y*=-1,jl.z*=-1),g.envMapRotation.value.setFromMatrix4(Foe.makeRotationFromEuler(jl)),g.flipEnvMap.value=b.isCubeTexture&&b.isRenderTargetTexture===!1?-1:1,g.reflectivity.value=m.reflectivity,g.ior.value=m.ior,g.refractionRatio.value=m.refractionRatio),m.lightMap&&(g.lightMap.value=m.lightMap,g.lightMapIntensity.value=m.lightMapIntensity,n(m.lightMap,g.lightMapTransform)),m.aoMap&&(g.aoMap.value=m.aoMap,g.aoMapIntensity.value=m.aoMapIntensity,n(m.aoMap,g.aoMapTransform))}function a(g,m){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,m.map&&(g.map.value=m.map,n(m.map,g.mapTransform))}function s(g,m){g.dashSize.value=m.dashSize,g.totalSize.value=m.dashSize+m.gapSize,g.scale.value=m.scale}function l(g,m,x,b){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,g.size.value=m.size*x,g.scale.value=b*.5,m.map&&(g.map.value=m.map,n(m.map,g.uvTransform)),m.alphaMap&&(g.alphaMap.value=m.alphaMap,n(m.alphaMap,g.alphaMapTransform)),m.alphaTest>0&&(g.alphaTest.value=m.alphaTest)}function c(g,m){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,g.rotation.value=m.rotation,m.map&&(g.map.value=m.map,n(m.map,g.mapTransform)),m.alphaMap&&(g.alphaMap.value=m.alphaMap,n(m.alphaMap,g.alphaMapTransform)),m.alphaTest>0&&(g.alphaTest.value=m.alphaTest)}function u(g,m){g.specular.value.copy(m.specular),g.shininess.value=Math.max(m.shininess,1e-4)}function d(g,m){m.gradientMap&&(g.gradientMap.value=m.gradientMap)}function f(g,m){g.metalness.value=m.metalness,m.metalnessMap&&(g.metalnessMap.value=m.metalnessMap,n(m.metalnessMap,g.metalnessMapTransform)),g.roughness.value=m.roughness,m.roughnessMap&&(g.roughnessMap.value=m.roughnessMap,n(m.roughnessMap,g.roughnessMapTransform)),m.envMap&&(g.envMapIntensity.value=m.envMapIntensity)}function p(g,m,x){g.ior.value=m.ior,m.sheen>0&&(g.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),g.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(g.sheenColorMap.value=m.sheenColorMap,n(m.sheenColorMap,g.sheenColorMapTransform)),m.sheenRoughnessMap&&(g.sheenRoughnessMap.value=m.sheenRoughnessMap,n(m.sheenRoughnessMap,g.sheenRoughnessMapTransform))),m.clearcoat>0&&(g.clearcoat.value=m.clearcoat,g.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(g.clearcoatMap.value=m.clearcoatMap,n(m.clearcoatMap,g.clearcoatMapTransform)),m.clearcoatRoughnessMap&&(g.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap,n(m.clearcoatRoughnessMap,g.clearcoatRoughnessMapTransform)),m.clearcoatNormalMap&&(g.clearcoatNormalMap.value=m.clearcoatNormalMap,n(m.clearcoatNormalMap,g.clearcoatNormalMapTransform),g.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),m.side===ui&&g.clearcoatNormalScale.value.negate())),m.dispersion>0&&(g.dispersion.value=m.dispersion),m.iridescence>0&&(g.iridescence.value=m.iridescence,g.iridescenceIOR.value=m.iridescenceIOR,g.iridescenceThicknessMinimum.value=m.iridescenceThicknessRange[0],g.iridescenceThicknessMaximum.value=m.iridescenceThicknessRange[1],m.iridescenceMap&&(g.iridescenceMap.value=m.iridescenceMap,n(m.iridescenceMap,g.iridescenceMapTransform)),m.iridescenceThicknessMap&&(g.iridescenceThicknessMap.value=m.iridescenceThicknessMap,n(m.iridescenceThicknessMap,g.iridescenceThicknessMapTransform))),m.transmission>0&&(g.transmission.value=m.transmission,g.transmissionSamplerMap.value=x.texture,g.transmissionSamplerSize.value.set(x.width,x.height),m.transmissionMap&&(g.transmissionMap.value=m.transmissionMap,n(m.transmissionMap,g.transmissionMapTransform)),g.thickness.value=m.thickness,m.thicknessMap&&(g.thicknessMap.value=m.thicknessMap,n(m.thicknessMap,g.thicknessMapTransform)),g.attenuationDistance.value=m.attenuationDistance,g.attenuationColor.value.copy(m.attenuationColor)),m.anisotropy>0&&(g.anisotropyVector.value.set(m.anisotropy*Math.cos(m.anisotropyRotation),m.anisotropy*Math.sin(m.anisotropyRotation)),m.anisotropyMap&&(g.anisotropyMap.value=m.anisotropyMap,n(m.anisotropyMap,g.anisotropyMapTransform))),g.specularIntensity.value=m.specularIntensity,g.specularColor.value.copy(m.specularColor),m.specularColorMap&&(g.specularColorMap.value=m.specularColorMap,n(m.specularColorMap,g.specularColorMapTransform)),m.specularIntensityMap&&(g.specularIntensityMap.value=m.specularIntensityMap,n(m.specularIntensityMap,g.specularIntensityMapTransform))}function y(g,m){m.matcap&&(g.matcap.value=m.matcap)}function v(g,m){const x=e.get(m).light;g.referencePosition.value.setFromMatrixPosition(x.matrixWorld),g.nearDistance.value=x.shadow.camera.near,g.farDistance.value=x.shadow.camera.far}return{refreshFogUniforms:r,refreshMaterialUniforms:i}}function $oe(t,e,n,r){let i={},o={},a=[];const s=t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS);function l(x,b){const S=b.program;r.uniformBlockBinding(x,S)}function c(x,b){let S=i[x.id];S===void 0&&(y(x),S=u(x),i[x.id]=S,x.addEventListener("dispose",g));const w=b.program;r.updateUBOMapping(x,w);const E=e.render.frame;o[x.id]!==E&&(f(x),o[x.id]=E)}function u(x){const b=d();x.__bindingPointIndex=b;const S=t.createBuffer(),w=x.__size,E=x.usage;return t.bindBuffer(t.UNIFORM_BUFFER,S),t.bufferData(t.UNIFORM_BUFFER,w,E),t.bindBuffer(t.UNIFORM_BUFFER,null),t.bindBufferBase(t.UNIFORM_BUFFER,b,S),S}function d(){for(let x=0;x0&&(S+=w-E),x.__size=S,x.__cache={},this}function v(x){const b={boundary:0,storage:0};return typeof x=="number"||typeof x=="boolean"?(b.boundary=4,b.storage=4):x.isVector2?(b.boundary=8,b.storage=8):x.isVector3||x.isColor?(b.boundary=16,b.storage=12):x.isVector4?(b.boundary=16,b.storage=16):x.isMatrix3?(b.boundary=48,b.storage=48):x.isMatrix4?(b.boundary=64,b.storage=64):x.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",x),b}function g(x){const b=x.target;b.removeEventListener("dispose",g);const S=a.indexOf(b.__bindingPointIndex);a.splice(S,1),t.deleteBuffer(i[b.id]),delete i[b.id],delete o[b.id]}function m(){for(const x in i)t.deleteBuffer(i[x]);a=[],i={},o={}}return{bind:l,update:c,dispose:m}}class zoe{constructor(e={}){const{canvas:n=XQ(),context:r=null,depth:i=!0,stencil:o=!1,alpha:a=!1,antialias:s=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:d=!1,reverseDepthBuffer:f=!1}=e;this.isWebGLRenderer=!0;let p;if(r!==null){if(typeof WebGLRenderingContext<"u"&&r instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");p=r.getContextAttributes().alpha}else p=a;const y=new Uint32Array(4),v=new Int32Array(4);let g=null,m=null;const x=[],b=[];this.domElement=n,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=tl,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const S=this;let w=!1;this._outputColorSpace=Zt;let E=0,T=0,A=null,M=-1,C=null;const P=new Yt,R=new Yt;let D=null;const k=new ft(0);let U=0,O=n.width,W=n.height,L=1,j=null,X=null;const K=new Yt(0,0,O,W),F=new Yt(0,0,O,W);let Y=!1;const q=new ZA;let Q=!1,te=!1;const ee=new gt,ce=new gt,ae=new ne,fe=new Yt,we={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let le=!1;function ie(){return A===null?L:1}let G=r;function Ve(z,oe){return n.getContext(z,oe)}try{const z={alpha:!0,depth:i,stencil:o,antialias:s,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:d};if("setAttribute"in n&&n.setAttribute("data-engine",`three.js r${UA}`),n.addEventListener("webglcontextlost",Ge,!1),n.addEventListener("webglcontextrestored",Te,!1),n.addEventListener("webglcontextcreationerror",_e,!1),G===null){const oe="webgl2";if(G=Ve(oe,z),G===null)throw Ve(oe)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(z){throw console.error("THREE.WebGLRenderer: "+z.message),z}let Ne,st,Re,ct,Ye,it,Ft,J,B,ue,me,be,ge,rt,Ie,Je,tt,Ee,Be,ht,ot,Le,_t,re;function ke(){Ne=new Zre(G),Ne.init(),Le=new Doe(G,Ne),st=new Gre(G,Ne,e,Le),Re=new Ooe(G,Ne),st.reverseDepthBuffer&&f&&Re.buffers.depth.setReversed(!0),ct=new tie(G),Ye=new xoe,it=new Ioe(G,Ne,Re,Ye,st,Le,ct),Ft=new Xre(S),J=new Jre(S),B=new ste(G),_t=new Hre(G,B),ue=new Qre(G,B,ct,_t),me=new rie(G,ue,B,ct),Be=new nie(G,st,it),Je=new Wre(Ye),be=new yoe(S,Ft,J,Ne,st,_t,Je),ge=new Boe(S,Ye),rt=new _oe,Ie=new Aoe(Ne),Ee=new zre(S,Ft,J,Re,me,p,l),tt=new Roe(S,me,st),re=new $oe(G,ct,st,Re),ht=new Vre(G,Ne,ct),ot=new eie(G,Ne,ct),ct.programs=be.programs,S.capabilities=st,S.extensions=Ne,S.properties=Ye,S.renderLists=rt,S.shadowMap=tt,S.state=Re,S.info=ct}ke();const Me=new Uoe(S,G);this.xr=Me,this.getContext=function(){return G},this.getContextAttributes=function(){return G.getContextAttributes()},this.forceContextLoss=function(){const z=Ne.get("WEBGL_lose_context");z&&z.loseContext()},this.forceContextRestore=function(){const z=Ne.get("WEBGL_lose_context");z&&z.restoreContext()},this.getPixelRatio=function(){return L},this.setPixelRatio=function(z){z!==void 0&&(L=z,this.setSize(O,W,!1))},this.getSize=function(z){return z.set(O,W)},this.setSize=function(z,oe,de=!0){if(Me.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}O=z,W=oe,n.width=Math.floor(z*L),n.height=Math.floor(oe*L),de===!0&&(n.style.width=z+"px",n.style.height=oe+"px"),this.setViewport(0,0,z,oe)},this.getDrawingBufferSize=function(z){return z.set(O*L,W*L).floor()},this.setDrawingBufferSize=function(z,oe,de){O=z,W=oe,L=de,n.width=Math.floor(z*de),n.height=Math.floor(oe*de),this.setViewport(0,0,z,oe)},this.getCurrentViewport=function(z){return z.copy(P)},this.getViewport=function(z){return z.copy(K)},this.setViewport=function(z,oe,de,he){z.isVector4?K.set(z.x,z.y,z.z,z.w):K.set(z,oe,de,he),Re.viewport(P.copy(K).multiplyScalar(L).round())},this.getScissor=function(z){return z.copy(F)},this.setScissor=function(z,oe,de,he){z.isVector4?F.set(z.x,z.y,z.z,z.w):F.set(z,oe,de,he),Re.scissor(R.copy(F).multiplyScalar(L).round())},this.getScissorTest=function(){return Y},this.setScissorTest=function(z){Re.setScissorTest(Y=z)},this.setOpaqueSort=function(z){j=z},this.setTransparentSort=function(z){X=z},this.getClearColor=function(z){return z.copy(Ee.getClearColor())},this.setClearColor=function(){Ee.setClearColor(...arguments)},this.getClearAlpha=function(){return Ee.getClearAlpha()},this.setClearAlpha=function(){Ee.setClearAlpha(...arguments)},this.clear=function(z=!0,oe=!0,de=!0){let he=0;if(z){let se=!1;if(A!==null){const Pe=A.texture.format;se=Pe===GA||Pe===VA||Pe===HA}if(se){const Pe=A.texture.type,Ue=Pe===ya||Pe===Nc||Pe===Sp||Pe===Ep||Pe===BA||Pe===$A,Ze=Ee.getClearColor(),We=Ee.getClearAlpha(),wt=Ze.r,St=Ze.g,ut=Ze.b;Ue?(y[0]=wt,y[1]=St,y[2]=ut,y[3]=We,G.clearBufferuiv(G.COLOR,0,y)):(v[0]=wt,v[1]=St,v[2]=ut,v[3]=We,G.clearBufferiv(G.COLOR,0,v))}else he|=G.COLOR_BUFFER_BIT}oe&&(he|=G.DEPTH_BUFFER_BIT),de&&(he|=G.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),G.clear(he)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){n.removeEventListener("webglcontextlost",Ge,!1),n.removeEventListener("webglcontextrestored",Te,!1),n.removeEventListener("webglcontextcreationerror",_e,!1),Ee.dispose(),rt.dispose(),Ie.dispose(),Ye.dispose(),Ft.dispose(),J.dispose(),me.dispose(),_t.dispose(),re.dispose(),be.dispose(),Me.dispose(),Me.removeEventListener("sessionstart",Ui),Me.removeEventListener("sessionend",_r),nr.stop()};function Ge(z){z.preventDefault(),w=!0}function Te(){w=!1;const z=ct.autoReset,oe=tt.enabled,de=tt.autoUpdate,he=tt.needsUpdate,se=tt.type;ke(),ct.autoReset=z,tt.enabled=oe,tt.autoUpdate=de,tt.needsUpdate=he,tt.type=se}function _e(z){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",z.statusMessage)}function Se(z){const oe=z.target;oe.removeEventListener("dispose",Se),je(oe)}function je(z){vt(z),Ye.remove(z)}function vt(z){const oe=Ye.get(z).programs;oe!==void 0&&(oe.forEach(function(de){be.releaseProgram(de)}),z.isShaderMaterial&&be.releaseShaderCache(z))}this.renderBufferDirect=function(z,oe,de,he,se,Pe){oe===null&&(oe=we);const Ue=se.isMesh&&se.matrixWorld.determinant()<0,Ze=Hb(z,oe,de,he,se);Re.setMaterial(he,Ue);let We=de.index,wt=1;if(he.wireframe===!0){if(We=ue.getWireframeAttribute(de),We===void 0)return;wt=2}const St=de.drawRange,ut=de.attributes.position;let Mt=St.start*wt,Kt=(St.start+St.count)*wt;Pe!==null&&(Mt=Math.max(Mt,Pe.start*wt),Kt=Math.min(Kt,(Pe.start+Pe.count)*wt)),We!==null?(Mt=Math.max(Mt,0),Kt=Math.min(Kt,We.count)):ut!=null&&(Mt=Math.max(Mt,0),Kt=Math.min(Kt,ut.count));const hn=Kt-Mt;if(hn<0||hn===1/0)return;_t.setup(se,he,Ze,de,We);let En,Bt=ht;if(We!==null&&(En=B.get(We),Bt=ot,Bt.setIndex(En)),se.isMesh)he.wireframe===!0?(Re.setLineWidth(he.wireframeLinewidth*ie()),Bt.setMode(G.LINES)):Bt.setMode(G.TRIANGLES);else if(se.isLine){let mt=he.linewidth;mt===void 0&&(mt=1),Re.setLineWidth(mt*ie()),se.isLineSegments?Bt.setMode(G.LINES):se.isLineLoop?Bt.setMode(G.LINE_LOOP):Bt.setMode(G.LINE_STRIP)}else se.isPoints?Bt.setMode(G.POINTS):se.isSprite&&Bt.setMode(G.TRIANGLES);if(se.isBatchedMesh)if(se._multiDrawInstances!==null)ld("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),Bt.renderMultiDrawInstances(se._multiDrawStarts,se._multiDrawCounts,se._multiDrawCount,se._multiDrawInstances);else if(Ne.get("WEBGL_multi_draw"))Bt.renderMultiDraw(se._multiDrawStarts,se._multiDrawCounts,se._multiDrawCount);else{const mt=se._multiDrawStarts,Vn=se._multiDrawCounts,Vt=se._multiDrawCount,Qr=We?B.get(We).bytesPerElement:1,pn=Ye.get(he).currentProgram.getUniforms();for(let fr=0;fr{function Pe(){if(he.forEach(function(Ue){Ye.get(Ue).currentProgram.isReady()&&he.delete(Ue)}),he.size===0){se(z);return}setTimeout(Pe,10)}Ne.get("KHR_parallel_shader_compile")!==null?Pe():setTimeout(Pe,10)})};let fn=null;function Un(z){fn&&fn(z)}function Ui(){nr.stop()}function _r(){nr.start()}const nr=new K4;nr.setAnimationLoop(Un),typeof self<"u"&&nr.setContext(self),this.setAnimationLoop=function(z){fn=z,Me.setAnimationLoop(z),z===null?nr.stop():nr.start()},Me.addEventListener("sessionstart",Ui),Me.addEventListener("sessionend",_r),this.render=function(z,oe){if(oe!==void 0&&oe.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(w===!0)return;if(z.matrixWorldAutoUpdate===!0&&z.updateMatrixWorld(),oe.parent===null&&oe.matrixWorldAutoUpdate===!0&&oe.updateMatrixWorld(),Me.enabled===!0&&Me.isPresenting===!0&&(Me.cameraAutoUpdate===!0&&Me.updateCamera(oe),oe=Me.getCamera()),z.isScene===!0&&z.onBeforeRender(S,z,oe,A),m=Ie.get(z,b.length),m.init(oe),b.push(m),ce.multiplyMatrices(oe.projectionMatrix,oe.matrixWorldInverse),q.setFromProjectionMatrix(ce),te=this.localClippingEnabled,Q=Je.init(this.clippingPlanes,te),g=rt.get(z,x.length),g.init(),x.push(g),Me.enabled===!0&&Me.isPresenting===!0){const Pe=S.xr.getDepthSensingMesh();Pe!==null&&$f(Pe,oe,-1/0,S.sortObjects)}$f(z,oe,0,S.sortObjects),g.finish(),S.sortObjects===!0&&g.sort(j,X),le=Me.enabled===!1||Me.isPresenting===!1||Me.hasDepthSensing()===!1,le&&Ee.addToRenderList(g,z),this.info.render.frame++,Q===!0&&Je.beginShadows();const de=m.state.shadowsArray;tt.render(de,z,oe),Q===!0&&Je.endShadows(),this.info.autoReset===!0&&this.info.reset();const he=g.opaque,se=g.transmissive;if(m.setupLights(),oe.isArrayCamera){const Pe=oe.cameras;if(se.length>0)for(let Ue=0,Ze=Pe.length;Ue0&&zf(he,se,z,oe),le&&Ee.render(z),Xm(g,z,oe);A!==null&&T===0&&(it.updateMultisampleRenderTarget(A),it.updateRenderTargetMipmap(A)),z.isScene===!0&&z.onAfterRender(S,z,oe),_t.resetDefaultState(),M=-1,C=null,b.pop(),b.length>0?(m=b[b.length-1],Q===!0&&Je.setGlobalState(S.clippingPlanes,m.state.camera)):m=null,x.pop(),x.length>0?g=x[x.length-1]:g=null};function $f(z,oe,de,he){if(z.visible===!1)return;if(z.layers.test(oe.layers)){if(z.isGroup)de=z.renderOrder;else if(z.isLOD)z.autoUpdate===!0&&z.update(oe);else if(z.isLight)m.pushLight(z),z.castShadow&&m.pushShadow(z);else if(z.isSprite){if(!z.frustumCulled||q.intersectsSprite(z)){he&&fe.setFromMatrixPosition(z.matrixWorld).applyMatrix4(ce);const Ue=me.update(z),Ze=z.material;Ze.visible&&g.push(z,Ue,Ze,de,fe.z,null)}}else if((z.isMesh||z.isLine||z.isPoints)&&(!z.frustumCulled||q.intersectsObject(z))){const Ue=me.update(z),Ze=z.material;if(he&&(z.boundingSphere!==void 0?(z.boundingSphere===null&&z.computeBoundingSphere(),fe.copy(z.boundingSphere.center)):(Ue.boundingSphere===null&&Ue.computeBoundingSphere(),fe.copy(Ue.boundingSphere.center)),fe.applyMatrix4(z.matrixWorld).applyMatrix4(ce)),Array.isArray(Ze)){const We=Ue.groups;for(let wt=0,St=We.length;wt0&&Zc(se,oe,de),Pe.length>0&&Zc(Pe,oe,de),Ue.length>0&&Zc(Ue,oe,de),Re.buffers.depth.setTest(!0),Re.buffers.depth.setMask(!0),Re.buffers.color.setMask(!0),Re.setPolygonOffset(!1)}function zf(z,oe,de,he){if((de.isScene===!0?de.overrideMaterial:null)!==null)return;m.state.transmissionRenderTarget[he.id]===void 0&&(m.state.transmissionRenderTarget[he.id]=new Oc(1,1,{generateMipmaps:!0,type:Ne.has("EXT_color_buffer_half_float")||Ne.has("EXT_color_buffer_float")?Nm:ya,minFilter:Oo,samples:4,stencilBuffer:o,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Dt.workingColorSpace}));const Pe=m.state.transmissionRenderTarget[he.id],Ue=he.viewport||P;Pe.setSize(Ue.z*S.transmissionResolutionScale,Ue.w*S.transmissionResolutionScale);const Ze=S.getRenderTarget();S.setRenderTarget(Pe),S.getClearColor(k),U=S.getClearAlpha(),U<1&&S.setClearColor(16777215,.5),S.clear(),le&&Ee.render(de);const We=S.toneMapping;S.toneMapping=tl;const wt=he.viewport;if(he.viewport!==void 0&&(he.viewport=void 0),m.setupLightsView(he),Q===!0&&Je.setGlobalState(S.clippingPlanes,he),Zc(z,de,he),it.updateMultisampleRenderTarget(Pe),it.updateRenderTargetMipmap(Pe),Ne.has("WEBGL_multisampled_render_to_texture")===!1){let St=!1;for(let ut=0,Mt=oe.length;ut0),ut=!!de.morphAttributes.position,Mt=!!de.morphAttributes.normal,Kt=!!de.morphAttributes.color;let hn=tl;he.toneMapped&&(A===null||A.isXRRenderTarget===!0)&&(hn=S.toneMapping);const En=de.morphAttributes.position||de.morphAttributes.normal||de.morphAttributes.color,Bt=En!==void 0?En.length:0,mt=Ye.get(he),Vn=m.state.lights;if(Q===!0&&(te===!0||z!==C)){const Fn=z===C&&he.id===M;Je.setState(he,z,Fn)}let Vt=!1;he.version===mt.__version?(mt.needsLights&&mt.lightsStateVersion!==Vn.state.version||mt.outputColorSpace!==Ze||se.isBatchedMesh&&mt.batching===!1||!se.isBatchedMesh&&mt.batching===!0||se.isBatchedMesh&&mt.batchingColor===!0&&se.colorTexture===null||se.isBatchedMesh&&mt.batchingColor===!1&&se.colorTexture!==null||se.isInstancedMesh&&mt.instancing===!1||!se.isInstancedMesh&&mt.instancing===!0||se.isSkinnedMesh&&mt.skinning===!1||!se.isSkinnedMesh&&mt.skinning===!0||se.isInstancedMesh&&mt.instancingColor===!0&&se.instanceColor===null||se.isInstancedMesh&&mt.instancingColor===!1&&se.instanceColor!==null||se.isInstancedMesh&&mt.instancingMorph===!0&&se.morphTexture===null||se.isInstancedMesh&&mt.instancingMorph===!1&&se.morphTexture!==null||mt.envMap!==We||he.fog===!0&&mt.fog!==Pe||mt.numClippingPlanes!==void 0&&(mt.numClippingPlanes!==Je.numPlanes||mt.numIntersection!==Je.numIntersection)||mt.vertexAlphas!==wt||mt.vertexTangents!==St||mt.morphTargets!==ut||mt.morphNormals!==Mt||mt.morphColors!==Kt||mt.toneMapping!==hn||mt.morphTargetsCount!==Bt)&&(Vt=!0):(Vt=!0,mt.__version=he.version);let Qr=mt.currentProgram;Vt===!0&&(Qr=Qc(he,oe,se));let pn=!1,fr=!1,Nl=!1;const cn=Qr.getUniforms(),Lr=mt.uniforms;if(Re.useProgram(Qr.program)&&(pn=!0,fr=!0,Nl=!0),he.id!==M&&(M=he.id,fr=!0),pn||C!==z){Re.buffers.depth.getReversed()?(ee.copy(z.projectionMatrix),KQ(ee),YQ(ee),cn.setValue(G,"projectionMatrix",ee)):cn.setValue(G,"projectionMatrix",z.projectionMatrix),cn.setValue(G,"viewMatrix",z.matrixWorldInverse);const Gn=cn.map.cameraPosition;Gn!==void 0&&Gn.setValue(G,ae.setFromMatrixPosition(z.matrixWorld)),st.logarithmicDepthBuffer&&cn.setValue(G,"logDepthBufFC",2/(Math.log(z.far+1)/Math.LN2)),(he.isMeshPhongMaterial||he.isMeshToonMaterial||he.isMeshLambertMaterial||he.isMeshBasicMaterial||he.isMeshStandardMaterial||he.isShaderMaterial)&&cn.setValue(G,"isOrthographic",z.isOrthographicCamera===!0),C!==z&&(C=z,fr=!0,Nl=!0)}if(se.isSkinnedMesh){cn.setOptional(G,se,"bindMatrix"),cn.setOptional(G,se,"bindMatrixInverse");const Fn=se.skeleton;Fn&&(Fn.boneTexture===null&&Fn.computeBoneTexture(),cn.setValue(G,"boneTexture",Fn.boneTexture,it))}se.isBatchedMesh&&(cn.setOptional(G,se,"batchingTexture"),cn.setValue(G,"batchingTexture",se._matricesTexture,it),cn.setOptional(G,se,"batchingIdTexture"),cn.setValue(G,"batchingIdTexture",se._indirectTexture,it),cn.setOptional(G,se,"batchingColorTexture"),se._colorsTexture!==null&&cn.setValue(G,"batchingColorTexture",se._colorsTexture,it));const wr=de.morphAttributes;if((wr.position!==void 0||wr.normal!==void 0||wr.color!==void 0)&&Be.update(se,de,Qr),(fr||mt.receiveShadow!==se.receiveShadow)&&(mt.receiveShadow=se.receiveShadow,cn.setValue(G,"receiveShadow",se.receiveShadow)),he.isMeshGouraudMaterial&&he.envMap!==null&&(Lr.envMap.value=We,Lr.flipEnvMap.value=We.isCubeTexture&&We.isRenderTargetTexture===!1?-1:1),he.isMeshStandardMaterial&&he.envMap===null&&oe.environment!==null&&(Lr.envMapIntensity.value=oe.environmentIntensity),fr&&(cn.setValue(G,"toneMappingExposure",S.toneMappingExposure),mt.needsLights&&Vb(Lr,Nl),Pe&&he.fog===!0&&ge.refreshFogUniforms(Lr,Pe),ge.refreshMaterialUniforms(Lr,he,L,W,m.state.transmissionRenderTarget[z.id]),Wv.upload(G,qm(mt),Lr,it)),he.isShaderMaterial&&he.uniformsNeedUpdate===!0&&(Wv.upload(G,qm(mt),Lr,it),he.uniformsNeedUpdate=!1),he.isSpriteMaterial&&cn.setValue(G,"center",se.center),cn.setValue(G,"modelViewMatrix",se.modelViewMatrix),cn.setValue(G,"normalMatrix",se.normalMatrix),cn.setValue(G,"modelMatrix",se.matrixWorld),he.isShaderMaterial||he.isRawShaderMaterial){const Fn=he.uniformsGroups;for(let Gn=0,eu=Fn.length;Gn0&&it.useMultisampledRTT(z)===!1?se=Ye.get(z).__webglMultisampledFramebuffer:Array.isArray(St)?se=St[de]:se=St,P.copy(z.viewport),R.copy(z.scissor),D=z.scissorTest}else P.copy(K).multiplyScalar(L).floor(),R.copy(F).multiplyScalar(L).floor(),D=Y;if(de!==0&&(se=Wb),Re.bindFramebuffer(G.FRAMEBUFFER,se)&&he&&Re.drawBuffers(z,se),Re.viewport(P),Re.scissor(R),Re.setScissorTest(D),Pe){const We=Ye.get(z.texture);G.framebufferTexture2D(G.FRAMEBUFFER,G.COLOR_ATTACHMENT0,G.TEXTURE_CUBE_MAP_POSITIVE_X+oe,We.__webglTexture,de)}else if(Ue){const We=Ye.get(z.texture),wt=oe;G.framebufferTextureLayer(G.FRAMEBUFFER,G.COLOR_ATTACHMENT0,We.__webglTexture,de,wt)}else if(z!==null&&de!==0){const We=Ye.get(z.texture);G.framebufferTexture2D(G.FRAMEBUFFER,G.COLOR_ATTACHMENT0,G.TEXTURE_2D,We.__webglTexture,de)}M=-1},this.readRenderTargetPixels=function(z,oe,de,he,se,Pe,Ue,Ze=0){if(!(z&&z.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let We=Ye.get(z).__webglFramebuffer;if(z.isWebGLCubeRenderTarget&&Ue!==void 0&&(We=We[Ue]),We){Re.bindFramebuffer(G.FRAMEBUFFER,We);try{const wt=z.textures[Ze],St=wt.format,ut=wt.type;if(!st.textureFormatReadable(St)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!st.textureTypeReadable(ut)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}oe>=0&&oe<=z.width-he&&de>=0&&de<=z.height-se&&(z.textures.length>1&&G.readBuffer(G.COLOR_ATTACHMENT0+Ze),G.readPixels(oe,de,he,se,Le.convert(St),Le.convert(ut),Pe))}finally{const wt=A!==null?Ye.get(A).__webglFramebuffer:null;Re.bindFramebuffer(G.FRAMEBUFFER,wt)}}},this.readRenderTargetPixelsAsync=async function(z,oe,de,he,se,Pe,Ue,Ze=0){if(!(z&&z.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let We=Ye.get(z).__webglFramebuffer;if(z.isWebGLCubeRenderTarget&&Ue!==void 0&&(We=We[Ue]),We)if(oe>=0&&oe<=z.width-he&&de>=0&&de<=z.height-se){Re.bindFramebuffer(G.FRAMEBUFFER,We);const wt=z.textures[Ze],St=wt.format,ut=wt.type;if(!st.textureFormatReadable(St))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!st.textureTypeReadable(ut))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const Mt=G.createBuffer();G.bindBuffer(G.PIXEL_PACK_BUFFER,Mt),G.bufferData(G.PIXEL_PACK_BUFFER,Pe.byteLength,G.STREAM_READ),z.textures.length>1&&G.readBuffer(G.COLOR_ATTACHMENT0+Ze),G.readPixels(oe,de,he,se,Le.convert(St),Le.convert(ut),0);const Kt=A!==null?Ye.get(A).__webglFramebuffer:null;Re.bindFramebuffer(G.FRAMEBUFFER,Kt);const hn=G.fenceSync(G.SYNC_GPU_COMMANDS_COMPLETE,0);return G.flush(),await qQ(G,hn,4),G.bindBuffer(G.PIXEL_PACK_BUFFER,Mt),G.getBufferSubData(G.PIXEL_PACK_BUFFER,0,Pe),G.deleteBuffer(Mt),G.deleteSync(hn),Pe}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(z,oe=null,de=0){const he=Math.pow(2,-de),se=Math.floor(z.image.width*he),Pe=Math.floor(z.image.height*he),Ue=oe!==null?oe.x:0,Ze=oe!==null?oe.y:0;it.setTexture2D(z,0),G.copyTexSubImage2D(G.TEXTURE_2D,de,0,0,Ue,Ze,se,Pe),Re.unbindTexture()};const Xb=G.createFramebuffer(),qb=G.createFramebuffer();this.copyTextureToTexture=function(z,oe,de=null,he=null,se=0,Pe=null){Pe===null&&(se!==0?(ld("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),Pe=se,se=0):Pe=0);let Ue,Ze,We,wt,St,ut,Mt,Kt,hn;const En=z.isCompressedTexture?z.mipmaps[Pe]:z.image;if(de!==null)Ue=de.max.x-de.min.x,Ze=de.max.y-de.min.y,We=de.isBox3?de.max.z-de.min.z:1,wt=de.min.x,St=de.min.y,ut=de.isBox3?de.min.z:0;else{const wr=Math.pow(2,-se);Ue=Math.floor(En.width*wr),Ze=Math.floor(En.height*wr),z.isDataArrayTexture?We=En.depth:z.isData3DTexture?We=Math.floor(En.depth*wr):We=1,wt=0,St=0,ut=0}he!==null?(Mt=he.x,Kt=he.y,hn=he.z):(Mt=0,Kt=0,hn=0);const Bt=Le.convert(oe.format),mt=Le.convert(oe.type);let Vn;oe.isData3DTexture?(it.setTexture3D(oe,0),Vn=G.TEXTURE_3D):oe.isDataArrayTexture||oe.isCompressedArrayTexture?(it.setTexture2DArray(oe,0),Vn=G.TEXTURE_2D_ARRAY):(it.setTexture2D(oe,0),Vn=G.TEXTURE_2D),G.pixelStorei(G.UNPACK_FLIP_Y_WEBGL,oe.flipY),G.pixelStorei(G.UNPACK_PREMULTIPLY_ALPHA_WEBGL,oe.premultiplyAlpha),G.pixelStorei(G.UNPACK_ALIGNMENT,oe.unpackAlignment);const Vt=G.getParameter(G.UNPACK_ROW_LENGTH),Qr=G.getParameter(G.UNPACK_IMAGE_HEIGHT),pn=G.getParameter(G.UNPACK_SKIP_PIXELS),fr=G.getParameter(G.UNPACK_SKIP_ROWS),Nl=G.getParameter(G.UNPACK_SKIP_IMAGES);G.pixelStorei(G.UNPACK_ROW_LENGTH,En.width),G.pixelStorei(G.UNPACK_IMAGE_HEIGHT,En.height),G.pixelStorei(G.UNPACK_SKIP_PIXELS,wt),G.pixelStorei(G.UNPACK_SKIP_ROWS,St),G.pixelStorei(G.UNPACK_SKIP_IMAGES,ut);const cn=z.isDataArrayTexture||z.isData3DTexture,Lr=oe.isDataArrayTexture||oe.isData3DTexture;if(z.isDepthTexture){const wr=Ye.get(z),Fn=Ye.get(oe),Gn=Ye.get(wr.__renderTarget),eu=Ye.get(Fn.__renderTarget);Re.bindFramebuffer(G.READ_FRAMEBUFFER,Gn.__webglFramebuffer),Re.bindFramebuffer(G.DRAW_FRAMEBUFFER,eu.__webglFramebuffer);for(let Sa=0;SaMath.PI&&(r-=ti),i<-Math.PI?i+=ti:i>Math.PI&&(i-=ti),r<=i?this._spherical.theta=Math.max(r,Math.min(i,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(r+i)/2?Math.max(r,this._spherical.theta):Math.min(i,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let o=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const a=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),o=a!=this._spherical.radius}if(Wn.setFromSpherical(this._spherical),Wn.applyQuaternion(this._quatInverse),n.copy(this.target).add(Wn),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let a=null;if(this.object.isPerspectiveCamera){const s=Wn.length();a=this._clampDistance(s*this._scale);const l=s-a;this.object.position.addScaledVector(this._dollyDirection,l),this.object.updateMatrixWorld(),o=!!l}else if(this.object.isOrthographicCamera){const s=new ne(this._mouse.x,this._mouse.y,0);s.unproject(this.object);const l=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),o=l!==this.object.zoom;const c=new ne(this._mouse.x,this._mouse.y,0);c.unproject(this.object),this.object.position.sub(c).add(s),this.object.updateMatrixWorld(),a=Wn.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;a!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(a).add(this.object.position):(ev.origin.copy(this.object.position),ev.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(ev.direction))Ew||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Ew||this._lastTargetPosition.distanceToSquared(this.target)>Ew?(this.dispatchEvent(ZO),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(e){return e!==null?ti/60*this.autoRotateSpeed*e:ti/60/60*this.autoRotateSpeed}_getZoomScale(e){const n=Math.abs(e*.01);return Math.pow(.95,this.zoomSpeed*n)}_rotateLeft(e){this._sphericalDelta.theta-=e}_rotateUp(e){this._sphericalDelta.phi-=e}_panLeft(e,n){Wn.setFromMatrixColumn(n,0),Wn.multiplyScalar(-e),this._panOffset.add(Wn)}_panUp(e,n){this.screenSpacePanning===!0?Wn.setFromMatrixColumn(n,1):(Wn.setFromMatrixColumn(n,0),Wn.crossVectors(this.object.up,Wn)),Wn.multiplyScalar(e),this._panOffset.add(Wn)}_pan(e,n){const r=this.domElement;if(this.object.isPerspectiveCamera){const i=this.object.position;Wn.copy(i).sub(this.target);let o=Wn.length();o*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*e*o/r.clientHeight,this.object.matrix),this._panUp(2*n*o/r.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(e*(this.object.right-this.object.left)/this.object.zoom/r.clientWidth,this.object.matrix),this._panUp(n*(this.object.top-this.object.bottom)/this.object.zoom/r.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(e,n){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const r=this.domElement.getBoundingClientRect(),i=e-r.left,o=n-r.top,a=r.width,s=r.height;this._mouse.x=i/a*2-1,this._mouse.y=-(o/s)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(e){return Math.max(this.minDistance,Math.min(this.maxDistance,e))}_handleMouseDownRotate(e){this._rotateStart.set(e.clientX,e.clientY)}_handleMouseDownDolly(e){this._updateZoomParameters(e.clientX,e.clientX),this._dollyStart.set(e.clientX,e.clientY)}_handleMouseDownPan(e){this._panStart.set(e.clientX,e.clientY)}_handleMouseMoveRotate(e){this._rotateEnd.set(e.clientX,e.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const n=this.domElement;this._rotateLeft(ti*this._rotateDelta.x/n.clientHeight),this._rotateUp(ti*this._rotateDelta.y/n.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(e){this._dollyEnd.set(e.clientX,e.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(e){this._panEnd.set(e.clientX,e.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(e){this._updateZoomParameters(e.clientX,e.clientY),e.deltaY<0?this._dollyIn(this._getZoomScale(e.deltaY)):e.deltaY>0&&this._dollyOut(this._getZoomScale(e.deltaY)),this.update()}_handleKeyDown(e){let n=!1;switch(e.code){case this.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(ti*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),n=!0;break;case this.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(-ti*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),n=!0;break;case this.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(ti*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),n=!0;break;case this.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(-ti*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),n=!0;break}n&&(e.preventDefault(),this.update())}_handleTouchStartRotate(e){if(this._pointers.length===1)this._rotateStart.set(e.pageX,e.pageY);else{const n=this._getSecondPointerPosition(e),r=.5*(e.pageX+n.x),i=.5*(e.pageY+n.y);this._rotateStart.set(r,i)}}_handleTouchStartPan(e){if(this._pointers.length===1)this._panStart.set(e.pageX,e.pageY);else{const n=this._getSecondPointerPosition(e),r=.5*(e.pageX+n.x),i=.5*(e.pageY+n.y);this._panStart.set(r,i)}}_handleTouchStartDolly(e){const n=this._getSecondPointerPosition(e),r=e.pageX-n.x,i=e.pageY-n.y,o=Math.sqrt(r*r+i*i);this._dollyStart.set(0,o)}_handleTouchStartDollyPan(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enablePan&&this._handleTouchStartPan(e)}_handleTouchStartDollyRotate(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enableRotate&&this._handleTouchStartRotate(e)}_handleTouchMoveRotate(e){if(this._pointers.length==1)this._rotateEnd.set(e.pageX,e.pageY);else{const r=this._getSecondPointerPosition(e),i=.5*(e.pageX+r.x),o=.5*(e.pageY+r.y);this._rotateEnd.set(i,o)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const n=this.domElement;this._rotateLeft(ti*this._rotateDelta.x/n.clientHeight),this._rotateUp(ti*this._rotateDelta.y/n.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(e){if(this._pointers.length===1)this._panEnd.set(e.pageX,e.pageY);else{const n=this._getSecondPointerPosition(e),r=.5*(e.pageX+n.x),i=.5*(e.pageY+n.y);this._panEnd.set(r,i)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(e){const n=this._getSecondPointerPosition(e),r=e.pageX-n.x,i=e.pageY-n.y,o=Math.sqrt(r*r+i*i);this._dollyEnd.set(0,o),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const a=(e.pageX+n.x)*.5,s=(e.pageY+n.y)*.5;this._updateZoomParameters(a,s)}_handleTouchMoveDollyPan(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enablePan&&this._handleTouchMovePan(e)}_handleTouchMoveDollyRotate(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enableRotate&&this._handleTouchMoveRotate(e)}_addPointer(e){this._pointers.push(e.pointerId)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let n=0;n>5&31)/31,y=(O>>10&31)/31)}for(let O=1;O<=3;O++){const W=R+O*12,L=P*3*3+(O-1)*3;A[L]=u.getFloat32(W,!0),A[L+1]=u.getFloat32(W+4,!0),A[L+2]=u.getFloat32(W+8,!0),M[L]=D,M[L+1]=k,M[L+2]=U,v&&(C.setRGB(f,p,y,Zt),g[L]=C.r,g[L+1]=C.g,g[L+2]=C.b)}}return T.setAttribute("position",new cr(A,3)),T.setAttribute("normal",new cr(M,3)),v&&(T.setAttribute("color",new cr(g,3)),T.hasColors=!0,T.alpha=S),T}function o(c){const u=new br,d=/solid([\s\S]*?)endsolid/g,f=/facet([\s\S]*?)endfacet/g,p=/solid\s(.+)/;let y=0;const v=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,g=new RegExp("vertex"+v+v+v,"g"),m=new RegExp("normal"+v+v+v,"g"),x=[],b=[],S=[],w=new ne;let E,T=0,A=0,M=0;for(;(E=d.exec(c))!==null;){A=M;const C=E[0],P=(E=p.exec(C))!==null?E[1]:"";for(S.push(P);(E=f.exec(C))!==null;){let k=0,U=0;const O=E[0];for(;(E=m.exec(O))!==null;)w.x=parseFloat(E[1]),w.y=parseFloat(E[2]),w.z=parseFloat(E[3]),U++;for(;(E=g.exec(O))!==null;)x.push(parseFloat(E[1]),parseFloat(E[2]),parseFloat(E[3])),b.push(w.x,w.y,w.z),k++,M++;U!==1&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+y),k!==3&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+y),y++}const R=A,D=M-A;u.userData.groupNames=S,u.addGroup(R,D,T),T++}return u.setAttribute("position",new Qt(x,3)),u.setAttribute("normal",new Qt(b,3)),u}function a(c){return typeof c!="string"?new TextDecoder().decode(c):c}function s(c){if(typeof c=="string"){const u=new Uint8Array(c.length);for(let d=0;d256||O.colormap_size!==24||O.colormap_type!==1)throw new Error("THREE.TGALoader: Invalid type colormap data for indexed type.");break;case p:case y:case g:case m:if(O.colormap_type)throw new Error("THREE.TGALoader: Invalid type colormap data for colormap type.");break;case d:throw new Error("THREE.TGALoader: No data.");default:throw new Error("THREE.TGALoader: Invalid type "+O.image_type)}if(O.width<=0||O.height<=0)throw new Error("THREE.TGALoader: Invalid image size.");if(O.pixel_size!==8&&O.pixel_size!==16&&O.pixel_size!==24&&O.pixel_size!==32)throw new Error("THREE.TGALoader: Invalid pixel size "+O.pixel_size)}function r(O,W,L,j,X){let K,F;const Y=L.pixel_size>>3,q=L.width*L.height*Y;if(W&&(F=X.subarray(j,j+=L.colormap_length*(L.colormap_size>>3))),O){K=new Uint8Array(q);let Q,te,ee,ce=0;const ae=new Uint8Array(Y);for(;ce>7,O[(te+ce*ee)*4+1]=(q&992)>>2,O[(te+ce*ee)*4+2]=(q&31)<<3,O[(te+ce*ee)*4+3]=q&32768?0:255;return O}function a(O,W,L,j,X,K,F,Y){let q=0,Q,te;const ee=C.width;for(te=W;te!==j;te+=L)for(Q=X;Q!==F;Q+=K,q+=3)O[(Q+ee*te)*4+3]=255,O[(Q+ee*te)*4+2]=Y[q+0],O[(Q+ee*te)*4+1]=Y[q+1],O[(Q+ee*te)*4+0]=Y[q+2];return O}function s(O,W,L,j,X,K,F,Y){let q=0,Q,te;const ee=C.width;for(te=W;te!==j;te+=L)for(Q=X;Q!==F;Q+=K,q+=4)O[(Q+ee*te)*4+2]=Y[q+0],O[(Q+ee*te)*4+1]=Y[q+1],O[(Q+ee*te)*4+0]=Y[q+2],O[(Q+ee*te)*4+3]=Y[q+3];return O}function l(O,W,L,j,X,K,F,Y){let q,Q=0,te,ee;const ce=C.width;for(ee=W;ee!==j;ee+=L)for(te=X;te!==F;te+=K,Q++)q=Y[Q],O[(te+ce*ee)*4+0]=q,O[(te+ce*ee)*4+1]=q,O[(te+ce*ee)*4+2]=q,O[(te+ce*ee)*4+3]=255;return O}function c(O,W,L,j,X,K,F,Y){let q=0,Q,te;const ee=C.width;for(te=W;te!==j;te+=L)for(Q=X;Q!==F;Q+=K,q+=2)O[(Q+ee*te)*4+0]=Y[q+0],O[(Q+ee*te)*4+1]=Y[q+0],O[(Q+ee*te)*4+2]=Y[q+0],O[(Q+ee*te)*4+3]=Y[q+1];return O}function u(O,W,L,j,X){let K,F,Y,q,Q,te;switch((C.flags&x)>>b){default:case E:K=0,Y=1,Q=W,F=0,q=1,te=L;break;case S:K=0,Y=1,Q=W,F=L-1,q=-1,te=-1;break;case T:K=W-1,Y=-1,Q=-1,F=0,q=1,te=L;break;case w:K=W-1,Y=-1,Q=-1,F=L-1,q=-1,te=-1;break}if(D)switch(C.pixel_size){case 8:l(O,F,q,te,K,Y,Q,j);break;case 16:c(O,F,q,te,K,Y,Q,j);break;default:throw new Error("THREE.TGALoader: Format not supported.")}else switch(C.pixel_size){case 8:i(O,F,q,te,K,Y,Q,j,X);break;case 16:o(O,F,q,te,K,Y,Q,j);break;case 24:a(O,F,q,te,K,Y,Q,j);break;case 32:s(O,F,q,te,K,Y,Q,j);break;default:throw new Error("THREE.TGALoader: Format not supported.")}return O}const d=0,f=1,p=2,y=3,v=9,g=10,m=11,x=48,b=4,S=0,w=1,E=2,T=3;if(e.length<19)throw new Error("THREE.TGALoader: Not enough data to contain header.");let A=0;const M=new Uint8Array(e),C={id_length:M[A++],colormap_type:M[A++],image_type:M[A++],colormap_index:M[A++]|M[A++]<<8,colormap_length:M[A++]|M[A++]<<8,colormap_size:M[A++],origin:[M[A++]|M[A++]<<8,M[A++]|M[A++]<<8],width:M[A++]|M[A++]<<8,height:M[A++]|M[A++]<<8,pixel_size:M[A++],flags:M[A++]};if(n(C),C.id_length+A>e.length)throw new Error("THREE.TGALoader: No data.");A+=C.id_length;let P=!1,R=!1,D=!1;switch(C.image_type){case v:P=!0,R=!0;break;case f:R=!0;break;case g:P=!0;break;case p:break;case m:P=!0,D=!0;break;case y:D=!0;break}const k=new Uint8Array(C.width*C.height*4),U=r(P,R,C,A,M);return u(k,C.width,C.height,U.pixel_data,U.palettes),{data:k,width:C.width,height:C.height,flipY:!0,generateMipmaps:!0,minFilter:Oo}}}class n$ extends Vo{load(e,n,r,i){const o=this,a=o.path===""?mc.extractUrlBase(e):o.path,s=new Mf(o.manager);s.setPath(o.path),s.setRequestHeader(o.requestHeader),s.setWithCredentials(o.withCredentials),s.load(e,function(l){try{n(o.parse(l,a))}catch(c){i?i(c):console.error(c),o.manager.itemError(e)}},r,i)}parse(e,n){function r(I,N){const H=[],$=I.childNodes;for(let V=0,pe=$.length;V0&&N.push(new hl($+".position",V,pe)),ye.length>0&&N.push(new Ic($+".quaternion",V,ye)),Xe.length>0&&N.push(new hl($+".scale",V,Xe)),N}function P(I,N,H){let $,V=!0,pe,ye;for(pe=0,ye=I.length;pe=0;){const $=I[N];if($.value[H]!==null)return $;N--}return null}function k(I,N,H){for(;N>>0)+2);switch(H=H.toLowerCase(),H){case"tga":N=wr;break;default:N=Lr}return N}function be(I){const N=B(I.url),H=N.profile.technique;let $;switch(H.type){case"phong":case"blinn":$=new Fo;break;case"lambert":$=new Ree;break;default:$=new sa;break}$.name=I.name||"";function V(De,$e=null){const lt=N.profile.samplers[De.id];let Ae=null;if(lt!==void 0){const at=N.profile.surfaces[lt.source];Ae=ce(at.init_from)}else console.warn("THREE.ColladaLoader: Undefined sampler. Access image directly (see #12530)."),Ae=ce(De.id);if(Ae!==null){const at=me(Ae);if(at!==void 0){const Qe=at.load(Ae),yt=De.extra;if(yt!==void 0&&yt.technique!==void 0&&c(yt.technique)===!1){const dt=yt.technique;Qe.wrapS=dt.wrapU?aa:Ji,Qe.wrapT=dt.wrapV?aa:Ji,Qe.offset.set(dt.offsetU||0,dt.offsetV||0),Qe.repeat.set(dt.repeatU||1,dt.repeatV||1)}else Qe.wrapS=aa,Qe.wrapT=aa;return $e!==null&&(Qe.colorSpace=$e),Qe}else return console.warn("THREE.ColladaLoader: Loader for texture %s not found.",Ae),null}else return console.warn("THREE.ColladaLoader: Couldn't create texture with ID:",De.id),null}const pe=H.parameters;for(const De in pe){const $e=pe[De];switch(De){case"diffuse":$e.color&&$.color.fromArray($e.color),$e.texture&&($.map=V($e.texture,Zt));break;case"specular":$e.color&&$.specular&&$.specular.fromArray($e.color),$e.texture&&($.specularMap=V($e.texture));break;case"bump":$e.texture&&($.normalMap=V($e.texture));break;case"ambient":$e.texture&&($.lightMap=V($e.texture,Zt));break;case"shininess":$e.float&&$.shininess&&($.shininess=$e.float);break;case"emission":$e.color&&$.emissive&&$.emissive.fromArray($e.color),$e.texture&&($.emissiveMap=V($e.texture,Zt));break}}Dt.colorSpaceToWorking($.color,Zt),$.specular&&Dt.colorSpaceToWorking($.specular,Zt),$.emissive&&Dt.colorSpaceToWorking($.emissive,Zt);let ye=pe.transparent,Xe=pe.transparency;if(Xe===void 0&&ye&&(Xe={float:1}),ye===void 0&&Xe&&(ye={opaque:"A_ONE",data:{color:[1,1,1,1]}}),ye&&Xe)if(ye.data.texture)$.transparent=!0;else{const De=ye.data.color;switch(ye.opaque){case"A_ONE":$.opacity=De[3]*Xe.float;break;case"RGB_ZERO":$.opacity=1-De[0]*Xe.float;break;case"A_ZERO":$.opacity=1-De[3]*Xe.float;break;case"RGB_ONE":$.opacity=De[0]*Xe.float;break;default:console.warn('THREE.ColladaLoader: Invalid opaque type "%s" of transparent tag.',ye.opaque)}$.opacity<1&&($.transparent=!0)}if(H.extra!==void 0&&H.extra.technique!==void 0){const De=H.extra.technique;for(const $e in De){const lt=De[$e];switch($e){case"double_sided":$.side=lt===1?Ki:va;break;case"bump":$.normalMap=V(lt.texture),$.normalScale=new xt(1,1);break}}}return $}function ge(I){return v(Et.materials[I],be)}function rt(I){const N={name:I.getAttribute("name")};for(let H=0,$=I.childNodes.length;H<$;H++){const V=I.childNodes[H];if(V.nodeType===1)switch(V.nodeName){case"optics":N.optics=Ie(V);break}}Et.cameras[I.getAttribute("id")]=N}function Ie(I){for(let N=0;N0?ye+De:ye;N.inputs[$e]={id:pe,offset:Xe},N.stride=Math.max(N.stride,Xe+1),ye==="TEXCOORD"&&(N.hasUV=!0);break;case"vcount":N.vcount=a(V.textContent);break;case"p":N.p=a(V.textContent);break}}return N}function _e(I){const N={};for(let H=0;H0&&N0&&Ae.setAttribute("position",new Qt(V.array,V.stride)),pe.array.length>0&&Ae.setAttribute("normal",new Qt(pe.array,pe.stride)),De.array.length>0&&Ae.setAttribute("color",new Qt(De.array,De.stride)),ye.array.length>0&&Ae.setAttribute("uv",new Qt(ye.array,ye.stride)),Xe.array.length>0&&Ae.setAttribute("uv1",new Qt(Xe.array,Xe.stride)),$e.array.length>0&&Ae.setAttribute("skinIndex",new Qt($e.array,$e.stride)),lt.array.length>0&&Ae.setAttribute("skinWeight",new Qt(lt.array,lt.stride)),$.data=Ae,$.type=I[0].type,$.materialKeys=at,$}function pt(I,N,H,$,V=!1){const pe=I.p,ye=I.stride,Xe=I.vcount;function De(Ae){let at=pe[Ae+H]*lt;const Qe=at+lt;for(;at4)for(let dt=1,Cn=yt-2;dt<=Cn;dt++){const en=Ae+ye*0,Gt=Ae+ye*dt,Wt=Ae+ye*(dt+1);De(en),De(Gt),De(Wt)}Ae+=ye*yt}}else for(let Ae=0,at=pe.length;Ae=N.limits.max&&(N.static=!0),N.middlePosition=(N.limits.min+N.limits.max)/2,N}function zf(I){const N={sid:I.getAttribute("sid"),name:I.getAttribute("name")||"",attachments:[],transforms:[]};for(let H=0;HQe.limits.max||Aer===null?null:parseFloat(r)),(!this.origPosition||!this.origQuaternion)&&(this.origPosition=this.position.clone(),this.origQuaternion=this.quaternion.clone());let n=!1;switch(this.mimicJoints.forEach(r=>{n=r.updateFromMimickedJoint(...e)||n}),this.jointType){case"fixed":return n;case"continuous":case"revolute":{let r=e[0];return r==null||r===this.jointValue[0]?n:(!this.ignoreLimits&&this.jointType==="revolute"&&(r=Math.min(this.limit.upper,r),r=Math.max(this.limit.lower,r)),this.quaternion.setFromAxisAngle(this.axis,r).premultiply(this.origQuaternion),this.jointValue[0]!==r?(this.jointValue[0]=r,this.matrixWorldNeedsUpdate=!0,!0):n)}case"prismatic":{let r=e[0];return r==null||r===this.jointValue[0]?n:(this.ignoreLimits||(r=Math.min(this.limit.upper,r),r=Math.max(this.limit.lower,r)),this.position.copy(this.origPosition),t2.copy(this.axis).applyEuler(this.rotation),this.position.addScaledVector(t2,r),this.jointValue[0]!==r?(this.jointValue[0]=r,this.matrixWorldNeedsUpdate=!0,!0):n)}case"floating":return this.jointValue.every((r,i)=>e[i]===r||e[i]===null)?n:(this.jointValue[0]=e[0]!==null?e[0]:this.jointValue[0],this.jointValue[1]=e[1]!==null?e[1]:this.jointValue[1],this.jointValue[2]=e[2]!==null?e[2]:this.jointValue[2],this.jointValue[3]=e[3]!==null?e[3]:this.jointValue[3],this.jointValue[4]=e[4]!==null?e[4]:this.jointValue[4],this.jointValue[5]=e[5]!==null?e[5]:this.jointValue[5],ws.compose(this.origPosition,this.origQuaternion,rv),nv.setFromEuler(rae.set(this.jointValue[3],this.jointValue[4],this.jointValue[5],"XYZ")),iv.set(this.jointValue[0],this.jointValue[1],this.jointValue[2]),tv.compose(iv,nv,rv),ws.premultiply(tv),this.position.setFromMatrixPosition(ws),this.rotation.setFromRotationMatrix(ws),this.matrixWorldNeedsUpdate=!0,!0);case"planar":return this.jointValue.every((r,i)=>e[i]===r||e[i]===null)?n:(this.jointValue[0]=e[0]!==null?e[0]:this.jointValue[0],this.jointValue[1]=e[1]!==null?e[1]:this.jointValue[1],this.jointValue[2]=e[2]!==null?e[2]:this.jointValue[2],ws.compose(this.origPosition,this.origQuaternion,rv),nv.setFromAxisAngle(this.axis,this.jointValue[2]),iv.set(this.jointValue[0],this.jointValue[1],0),tv.compose(iv,nv,rv),ws.premultiply(tv),this.position.setFromMatrixPosition(ws),this.rotation.setFromRotationMatrix(ws),this.matrixWorldNeedsUpdate=!0,!0)}return n}}class n2 extends i${constructor(...e){super(...e),this.type="URDFMimicJoint",this.mimicJoint=null,this.offset=0,this.multiplier=1}updateFromMimickedJoint(...e){const n=e.map(r=>r*this.multiplier+this.offset);return super.setJointValue(...n)}copy(e,n){return super.copy(e,n),this.mimicJoint=e.mimicJoint,this.offset=e.offset,this.multiplier=e.multiplier,this}}class aae extends r${constructor(...e){super(...e),this.isURDFRobot=!0,this.urdfNode=null,this.urdfRobotNode=null,this.robotName=null,this.links=null,this.joints=null,this.colliders=null,this.visual=null,this.frames=null}copy(e,n){super.copy(e,n),this.urdfRobotNode=e.urdfRobotNode,this.robotName=e.robotName,this.links={},this.joints={},this.colliders={},this.visual={},this.traverse(r=>{r.isURDFJoint&&r.urdfName in e.joints&&(this.joints[r.urdfName]=r),r.isURDFLink&&r.urdfName in e.links&&(this.links[r.urdfName]=r),r.isURDFCollider&&r.urdfName in e.colliders&&(this.colliders[r.urdfName]=r),r.isURDFVisual&&r.urdfName in e.visual&&(this.visual[r.urdfName]=r)});for(const r in this.joints)this.joints[r].mimicJoints=this.joints[r].mimicJoints.map(i=>this.joints[i.name]);return this.frames={...this.colliders,...this.visual,...this.links,...this.joints},this}getFrame(e){return this.frames[e]}setJointValue(e,...n){const r=this.joints[e];return r?r.setJointValue(...n):!1}setJointValues(e){let n=!1;for(const r in e){const i=e[r];Array.isArray(i)?n=this.setJointValue(r,...i)||n:n=this.setJointValue(r,i)||n}return n}}const Tw=new Ii,r2=new pi;function _u(t){return t?t.trim().split(/\s+/g).map(e=>parseFloat(e)):[0,0,0]}function i2(t,e,n=!1){n||t.rotation.set(0,0,0),r2.set(e[0],e[1],e[2],"ZYX"),Tw.setFromEuler(r2),Tw.multiply(t.quaternion),t.quaternion.copy(Tw)}class sae{constructor(e){this.manager=e||V4,this.loadMeshCb=this.defaultMeshLoader.bind(this),this.parseVisual=!0,this.parseCollision=!1,this.packages="",this.workingPath="",this.fetchOptions={}}loadAsync(e){return new Promise((n,r)=>{this.load(e,n,null,r)})}load(e,n,r,i){const o=this.manager,a=mc.extractUrlBase(e),s=this.manager.resolveURL(e);o.itemStart(s),fetch(s,this.fetchOptions).then(l=>{if(l.ok)return r&&r(null),l.text();throw new Error(`URDFLoader: Failed to load url '${s}' with error code ${l.status} : ${l.statusText}.`)}).then(l=>{const c=this.parse(l,this.workingPath||a);n(c),o.itemEnd(s)}).catch(l=>{i?i(l):console.error("URDFLoader: Error loading file.",l),o.itemError(s),o.itemEnd(s)})}parse(e,n=this.workingPath){const r=this.packages,i=this.loadMeshCb,o=this.parseVisual,a=this.parseCollision,s=this.manager,l={},c={},u={};function d(x){if(!/^package:\/\//.test(x))return n?n+x:x;const[b,S]=x.replace(/^package:\/\//,"").split(/\/(.+)/);if(typeof r=="string")return r.endsWith(b)?r+"/"+S:r+"/"+b+"/"+S;if(r instanceof Function)return r(b)+"/"+S;if(typeof r=="object")return b in r?r[b]+"/"+S:(console.error(`URDFLoader : ${b} not found in provided package list.`),null)}function f(x){let b;x instanceof Document?b=[...x.children]:x instanceof Element?b=[x]:b=[...new DOMParser().parseFromString(x,"text/xml").children];const S=b.filter(w=>w.nodeName==="robot").pop();return p(S)}function p(x){const b=[...x.children],S=b.filter(P=>P.nodeName.toLowerCase()==="link"),w=b.filter(P=>P.nodeName.toLowerCase()==="joint"),E=b.filter(P=>P.nodeName.toLowerCase()==="material"),T=new aae;T.robotName=x.getAttribute("name"),T.urdfRobotNode=x,E.forEach(P=>{const R=P.getAttribute("name");u[R]=g(P)});const A={},M={};S.forEach(P=>{const R=P.getAttribute("name"),D=x.querySelector(`child[link="${R}"]`)===null;l[R]=v(P,A,M,D?T:null)}),w.forEach(P=>{const R=P.getAttribute("name");c[R]=y(P)}),T.joints=c,T.links=l,T.colliders=M,T.visual=A;const C=Object.values(c);return C.forEach(P=>{P instanceof n2&&c[P.mimicJoint].mimicJoints.push(P)}),C.forEach(P=>{const R=new Set,D=k=>{if(R.has(k))throw new Error("URDFLoader: Detected an infinite loop of mimic joints.");R.add(k),k.mimicJoints.forEach(U=>{D(U)})};D(P)}),T.frames={...M,...A,...l,...c},T}function y(x){const b=[...x.children],S=x.getAttribute("type");let w;const E=b.find(R=>R.nodeName.toLowerCase()==="mimic");E?(w=new n2,w.mimicJoint=E.getAttribute("joint"),w.multiplier=parseFloat(E.getAttribute("multiplier")||1),w.offset=parseFloat(E.getAttribute("offset")||0)):w=new i$,w.urdfNode=x,w.name=x.getAttribute("name"),w.urdfName=w.name,w.jointType=S;let T=null,A=null,M=[0,0,0],C=[0,0,0];b.forEach(R=>{const D=R.nodeName.toLowerCase();D==="origin"?(M=_u(R.getAttribute("xyz")),C=_u(R.getAttribute("rpy"))):D==="child"?A=l[R.getAttribute("link")]:D==="parent"?T=l[R.getAttribute("link")]:D==="limit"&&(w.limit.lower=parseFloat(R.getAttribute("lower")||w.limit.lower),w.limit.upper=parseFloat(R.getAttribute("upper")||w.limit.upper))}),T.add(w),w.add(A),i2(w,C),w.position.set(M[0],M[1],M[2]);const P=b.filter(R=>R.nodeName.toLowerCase()==="axis")[0];if(P){const R=P.getAttribute("xyz").split(/\s+/g).map(D=>parseFloat(D));w.axis=new ne(R[0],R[1],R[2]),w.axis.normalize()}return w}function v(x,b,S,w=null){w===null&&(w=new r$);const E=[...x.children];return w.name=x.getAttribute("name"),w.urdfName=w.name,w.urdfNode=x,o&&E.filter(A=>A.nodeName.toLowerCase()==="visual").forEach(A=>{const M=m(A,u);if(w.add(M),A.hasAttribute("name")){const C=A.getAttribute("name");M.name=C,M.urdfName=C,b[C]=M}}),a&&E.filter(A=>A.nodeName.toLowerCase()==="collision").forEach(A=>{const M=m(A);if(w.add(M),A.hasAttribute("name")){const C=A.getAttribute("name");M.name=C,M.urdfName=C,S[C]=M}}),w}function g(x){const b=[...x.children],S=new Fo;return S.name=x.getAttribute("name")||"",b.forEach(w=>{const E=w.nodeName.toLowerCase();if(E==="color"){const T=w.getAttribute("rgba").split(/\s/g).map(A=>parseFloat(A));S.color.setRGB(T[0],T[1],T[2]),S.opacity=T[3],S.transparent=T[3]<1,S.depthWrite=!S.transparent}else if(E==="texture"){const T=w.getAttribute("filename");if(T){const A=new nC(s),M=d(T);S.map=A.load(M),S.map.colorSpace=Zt}}}),S}function m(x,b={}){const S=x.nodeName.toLowerCase()==="collision",w=[...x.children];let E=null;const T=w.filter(M=>M.nodeName.toLowerCase()==="material")[0];if(T){const M=T.getAttribute("name");M&&M in b?E=b[M]:E=g(T)}else E=new Fo;const A=S?new iae:new oae;return A.urdfNode=x,w.forEach(M=>{const C=M.nodeName.toLowerCase();if(C==="geometry"){const P=M.children[0].nodeName.toLowerCase();if(P==="mesh"){const R=M.children[0].getAttribute("filename"),D=d(R);if(D!==null){const k=M.children[0].getAttribute("scale");if(k){const U=_u(k);A.scale.set(U[0],U[1],U[2])}i(D,s,(U,O)=>{O?console.error("URDFLoader: Error loading mesh.",O):U&&(U instanceof Mn&&(U.material=E),U.position.set(0,0,0),U.quaternion.identity(),A.add(U))})}}else if(P==="box"){const R=new Mn;R.geometry=new Gc(1,1,1),R.material=E;const D=_u(M.children[0].getAttribute("size"));R.scale.set(D[0],D[1],D[2]),A.add(R)}else if(P==="sphere"){const R=new Mn;R.geometry=new eC(1,30,30),R.material=E;const D=parseFloat(M.children[0].getAttribute("radius"))||0;R.scale.set(D,D,D),A.add(R)}else if(P==="cylinder"){const R=new Mn;R.geometry=new QA(1,1,1,30),R.material=E;const D=parseFloat(M.children[0].getAttribute("radius"))||0,k=parseFloat(M.children[0].getAttribute("length"))||0;R.scale.set(D,k,D),R.rotation.set(Math.PI/2,0,0),A.add(R)}}else if(C==="origin"){const P=_u(M.getAttribute("xyz")),R=_u(M.getAttribute("rpy"));A.position.set(P[0],P[1],P[2]),A.rotation.set(0,0,0),i2(A,R)}}),A}return f(e)}defaultMeshLoader(e,n,r){/\.stl$/i.test(e)?new t$(n).load(e,o=>{const a=new Mn(o,new Fo);r(a)}):/\.dae$/i.test(e)?new n$(n).load(e,o=>r(o.scene)):console.warn(`URDFLoader: Could not load model at ${e}. +No loader available`)}}const lae=new xt,cae=()=>{};class uae extends HTMLElement{static get observedAttributes(){return["package","urdf","up","display-shadow","ambient-color","ignore-limits","show-collision"]}get package(){return this.getAttribute("package")||""}set package(e){this.setAttribute("package",e)}get urdf(){return this.getAttribute("urdf")||""}set urdf(e){this.setAttribute("urdf",e)}get ignoreLimits(){return this.hasAttribute("ignore-limits")||!1}set ignoreLimits(e){e?this.setAttribute("ignore-limits",e):this.removeAttribute("ignore-limits")}get up(){return this.getAttribute("up")||"+Z"}set up(e){this.setAttribute("up",e)}get displayShadow(){return this.hasAttribute("display-shadow")||!1}set displayShadow(e){e?this.setAttribute("display-shadow",""):this.removeAttribute("display-shadow")}get ambientColor(){return this.getAttribute("ambient-color")||"#8ea0a8"}set ambientColor(e){e?this.setAttribute("ambient-color",e):this.removeAttribute("ambient-color")}get autoRedraw(){return this.hasAttribute("auto-redraw")||!1}set autoRedraw(e){e?this.setAttribute("auto-redraw",!0):this.removeAttribute("auto-redraw")}get noAutoRecenter(){return this.hasAttribute("no-auto-recenter")||!1}set noAutoRecenter(e){e?this.setAttribute("no-auto-recenter",!0):this.removeAttribute("no-auto-recenter")}get showCollision(){return this.hasAttribute("show-collision")||!1}set showCollision(e){e?this.setAttribute("show-collision",!0):this.removeAttribute("show-collision")}get jointValues(){const e={};if(this.robot)for(const n in this.robot.joints){const r=this.robot.joints[n];e[n]=r.jointValue.length===1?r.angle:[...r.jointValue]}return e}set jointValues(e){this.setJointValues(e)}get angles(){return this.jointValues}set angles(e){this.jointValues=e}constructor(){super(),this._requestId=0,this._dirty=!1,this._loadScheduled=!1,this.robot=null,this.loadMeshFunc=null,this.urlModifierFunc=null;const e=new U4,n=new Vee(this.ambientColor,"#000");n.groundColor.lerp(n.color,.5*Math.PI),n.intensity=.5,n.position.set(0,1,0),e.add(n);const r=new Bx(16777215,Math.PI);r.position.set(4,10,1),r.shadow.mapSize.width=2048,r.shadow.mapSize.height=2048,r.shadow.normalBias=.001,r.castShadow=!0,e.add(r),e.add(r.target);const i=new zoe({antialias:!0,alpha:!0});i.setClearColor(16777215),i.setClearAlpha(0),i.shadowMap.enabled=!0,i.shadowMap.type=y4,i.outputColorSpace=Zt;const o=new gr(75,1,.1,1e3);o.position.z=-10;const a=new vn;e.add(a);const s=new Mn(new Om(40,40),new Pee({side:Ki,transparent:!0,opacity:.25}));s.rotation.x=-Math.PI/2,s.position.y=-.5,s.receiveShadow=!0,s.scale.set(10,10,10),e.add(s);const l=new Voe(o,i.domElement);l.rotateSpeed=2,l.zoomSpeed=5,l.panSpeed=2,l.enableZoom=!0,l.enableDamping=!1,l.maxDistance=50,l.minDistance=.25,l.addEventListener("change",()=>this.recenter()),this.scene=e,this.world=a,this.renderer=i,this.camera=o,this.controls=l,this.plane=s,this.directionalLight=r,this.ambientLight=n,this._setUp(this.up),this._collisionMaterial=new Fo({transparent:!0,opacity:.35,shininess:2.5,premultipliedAlpha:!0,color:16760376,polygonOffset:!0,polygonOffsetFactor:-1,polygonOffsetUnits:-1});const c=()=>{this.parentNode&&(this.updateSize(),(this._dirty||this.autoRedraw)&&(this.noAutoRecenter||this._updateEnvironment(),this.renderer.render(e,o),this._dirty=!1),this.controls.update()),this._renderLoopId=requestAnimationFrame(c)};c()}connectedCallback(){if(!this.constructor._styletag){const e=document.createElement("style");e.innerHTML=` + ${this.tagName} { display: block; } + ${this.tagName} canvas { + width: 100%; + height: 100%; + } + `,document.head.appendChild(e),this.constructor._styletag=e}this.childElementCount===0&&this.appendChild(this.renderer.domElement),this.updateSize(),requestAnimationFrame(()=>this.updateSize())}disconnectedCallback(){cancelAnimationFrame(this._renderLoopId)}attributeChangedCallback(e,n,r){switch(this._updateCollisionVisibility(),this.noAutoRecenter||this.recenter(),e){case"package":case"urdf":{this._scheduleLoad();break}case"up":{this._setUp(this.up);break}case"ambient-color":{this.ambientLight.color.set(this.ambientColor),this.ambientLight.groundColor.set("#000").lerp(this.ambientLight.color,.5);break}case"ignore-limits":{this._setIgnoreLimits(this.ignoreLimits,!0);break}}}updateSize(){const e=this.renderer,n=this.clientWidth,r=this.clientHeight,i=e.getSize(lae);(i.width!==n||i.height!==r)&&this.recenter(),e.setPixelRatio(window.devicePixelRatio),e.setSize(n,r,!1),this.camera.aspect=n/r,this.camera.updateProjectionMatrix()}redraw(){this._dirty=!0}recenter(){this._updateEnvironment(),this.redraw()}setJointValue(e,...n){this.robot&&this.robot.joints[e]&&this.robot.joints[e].setJointValue(...n)&&(this.redraw(),this.dispatchEvent(new CustomEvent("angle-change",{bubbles:!0,cancelable:!0,detail:e})))}setJointValues(e){for(const n in e)this.setJointValue(n,e[n])}_updateEnvironment(){const e=this.robot;if(!e)return;this.world.updateMatrixWorld();const n=new Wo;n.makeEmpty(),e.traverse(o=>{o.isURDFVisual&&n.expandByObject(o)});const r=n.getCenter(new ne);this.controls.target.y=r.y,this.plane.position.y=n.min.y-.001;const i=this.directionalLight;if(i.castShadow=this.displayShadow,this.displayShadow){const a=n.getBoundingSphere(new Xo).radius,s=i.shadow.camera;s.left=s.bottom=-a,s.right=s.top=a;const l=i.position.clone().sub(i.target.position);i.target.position.copy(r),i.position.copy(r).add(l),s.updateProjectionMatrix()}}_scheduleLoad(){this._prevload!==`${this.package}|${this.urdf}`&&(this._prevload=`${this.package}|${this.urdf}`,!this._loadScheduled&&(this._loadScheduled=!0,this.robot&&(this.robot.traverse(e=>e.dispose&&e.dispose()),this.robot.parent.remove(this.robot),this.robot=null),requestAnimationFrame(()=>{this._loadUrdf(this.package,this.urdf),this._loadScheduled=!1})))}_loadUrdf(e,n){if(this.dispatchEvent(new CustomEvent("urdf-change",{bubbles:!0,cancelable:!0,composed:!0})),n){this._requestId++;const r=this._requestId,i=l=>{l.traverse(c=>{if(c.isMesh&&(c.castShadow=!0,c.receiveShadow=!0,c.material)){const u=(Array.isArray(c.material)?c.material:[c.material]).map(d=>(d instanceof sa&&(d=new Fo),d.map&&(d.map.colorSpace=Zt),d));c.material=u.length===1?u[0]:u}})};e.includes(":")&&e.split(":")[1].substring(0,2)!=="//"&&(e=e.split(",").reduce((l,c)=>{const u=c.split(/:/).filter(p=>!!p),d=u.shift().trim(),f=u.join(":").trim();return l[d]=f,l},{}));let o=null;const a=new H4;a.onLoad=()=>{if(this._requestId!==r){o.traverse(l=>l.dispose&&l.dispose());return}this.robot=o,this.world.add(o),i(o),this._setIgnoreLimits(this.ignoreLimits),this._updateCollisionVisibility(),this.dispatchEvent(new CustomEvent("urdf-processed",{bubbles:!0,cancelable:!0,composed:!0})),this.dispatchEvent(new CustomEvent("geometry-loaded",{bubbles:!0,cancelable:!0,composed:!0})),this.recenter()},this.urlModifierFunc&&a.setURLModifier(this.urlModifierFunc);const s=new sae(a);s.packages=e,s.loadMeshCb=this.loadMeshFunc,s.fetchOptions={mode:"cors",credentials:"same-origin"},s.parseCollision=!0,s.load(n,l=>o=l)}}_updateCollisionVisibility(){const e=this.showCollision,n=this._collisionMaterial,r=this.robot;if(r===null)return;const i=[];r.traverse(o=>{o.isURDFCollider&&(o.visible=e,i.push(o))}),i.forEach(o=>{o.traverse(a=>{a.isMesh&&(a.raycast=cae,a.material=n,a.castShadow=!1)})})}_setUp(e){e||(e="+Z"),e=e.toUpperCase();const n=e.replace(/[^-+]/g,"")[0]||"+",r=e.replace(/[^XYZ]/gi,"")[0]||"Z",i=Math.PI,o=i/2;r==="X"&&this.world.rotation.set(0,0,n==="+"?o:-o),r==="Z"&&this.world.rotation.set(n==="+"?-o:o,0,0),r==="Y"&&this.world.rotation.set(n==="+"?0:i,0,0)}_setIgnoreLimits(e,n=!1){this.robot&&Object.values(this.robot.joints).forEach(r=>{r.ignoreLimits=e,r.setJointValue(...r.jointValue)}),n&&this.dispatchEvent(new CustomEvent("ignore-limits-change",{bubbles:!0,cancelable:!0,composed:!0}))}}function dae(t){return t.isURDFJoint&&t.jointType!=="fixed"}function fae(t){let e=t;for(;e;){if(dae(e))return e;e=e.parent}return e}const Mw=new ne,Aw=new ne,Gu=new ne,ri=new ne,o2=new ne,Rh=new ne,Nh=new ne,Ao=new Ua;class hae{constructor(e){this.enabled=!0,this.scene=e,this.raycaster=new q4,this.initialGrabPoint=new ne,this.hitDistance=-1,this.hovered=null,this.manipulating=null}update(){const{raycaster:e,hovered:n,manipulating:r,scene:i}=this;if(r)return;let o=null;const a=e.intersectObject(i,!0);if(a.length!==0){const s=a[0];this.hitDistance=s.distance,o=fae(s.object),this.initialGrabPoint.copy(s.point)}o!==n&&(n&&this.onUnhover(n),this.hovered=o,o&&this.onHover(o))}updateJoint(e,n){e.setJointValue(n)}onDragStart(e){}onDragEnd(e){}onHover(e){}onUnhover(e){}getRevoluteDelta(e,n,r){return ri.copy(e.axis).transformDirection(e.matrixWorld).normalize(),Gu.set(0,0,0).applyMatrix4(e.matrixWorld),Ao.setFromNormalAndCoplanarPoint(ri,Gu),Ao.projectPoint(n,Rh),Ao.projectPoint(r,Nh),Rh.sub(Gu),Nh.sub(Gu),ri.crossVectors(Rh,Nh),Math.sign(ri.dot(Ao.normal))*Nh.angleTo(Rh)}getPrismaticDelta(e,n,r){return ri.subVectors(r,n),Ao.normal.copy(e.axis).transformDirection(e.parent.matrixWorld).normalize(),ri.dot(Ao.normal)}moveRay(e){const{raycaster:n,hitDistance:r,manipulating:i}=this,{ray:o}=n;if(i){o.at(r,Mw),e.at(r,Aw);let a=0;i.jointType==="revolute"||i.jointType==="continuous"?a=this.getRevoluteDelta(i,Mw,Aw):i.jointType==="prismatic"&&(a=this.getPrismaticDelta(i,Mw,Aw)),a&&this.updateJoint(i,i.angle+a)}this.raycaster.ray.copy(e),this.update()}setGrabbed(e){const{hovered:n,manipulating:r}=this;if(e){if(r!==null||n===null)return;this.manipulating=n,this.onDragStart(n)}else{if(this.manipulating===null)return;this.onDragEnd(this.manipulating),this.manipulating=null,this.update()}}}class pae extends hae{constructor(e,n,r){super(e),this.camera=n,this.domElement=r;const i=new q4,o=new xt;function a(s){const l=r.getBoundingClientRect();o.x=(s.clientX-l.left)/l.width*2-1,o.y=-((s.clientY-l.top)/l.height)*2+1}this._mouseDown=s=>{a(s),i.setFromCamera(o,this.camera),this.moveRay(i.ray),this.setGrabbed(!0)},this._mouseMove=s=>{a(s),i.setFromCamera(o,this.camera),this.moveRay(i.ray)},this._mouseUp=s=>{a(s),i.setFromCamera(o,this.camera),this.moveRay(i.ray),this.setGrabbed(!1)},r.addEventListener("mousedown",this._mouseDown),r.addEventListener("mousemove",this._mouseMove),r.addEventListener("mouseup",this._mouseUp)}getRevoluteDelta(e,n,r){const{camera:i,initialGrabPoint:o}=this;return ri.copy(e.axis).transformDirection(e.matrixWorld).normalize(),Gu.set(0,0,0).applyMatrix4(e.matrixWorld),Ao.setFromNormalAndCoplanarPoint(ri,Gu),ri.copy(i.position).sub(o).normalize(),Math.abs(ri.dot(Ao.normal))>.3?super.getRevoluteDelta(e,n,r):(ri.set(0,1,0).transformDirection(i.matrixWorld),Ao.projectPoint(n,Rh),Ao.projectPoint(r,Nh),ri.set(0,0,-1).transformDirection(i.matrixWorld),ri.cross(Ao.normal),o2.subVectors(r,n),ri.dot(o2))}dispose(){const{domElement:e}=this;e.removeEventListener("mousedown",this._mouseDown),e.removeEventListener("mousemove",this._mouseMove),e.removeEventListener("mouseup",this._mouseUp)}}class mae extends uae{static get observedAttributes(){return["highlight-color",...super.observedAttributes]}get disableDragging(){return this.hasAttribute("disable-dragging")}set disableDragging(e){e?this.setAttribute("disable-dragging",!!e):this.removeAttribute("disable-dragging")}get highlightColor(){return this.getAttribute("highlight-color")||"#FFFFFF"}set highlightColor(e){e?this.setAttribute("highlight-color",e):this.removeAttribute("highlight-color")}constructor(...e){super(...e),this.highlightMaterial=new Fo({shininess:10,color:this.highlightColor,emissive:this.highlightColor,emissiveIntensity:.25});const n=a=>a.isURDFJoint&&a.jointType!=="fixed",r=(a,s)=>{const l=c=>{if(c.type==="Mesh"&&(s?(c.material=c.__origMaterial,delete c.__origMaterial):(c.__origMaterial=c.material,c.material=this.highlightMaterial)),c===a||!n(c))for(let u=0;u{this.dispatchEvent(new CustomEvent("manipulate-start",{bubbles:!0,cancelable:!0,detail:a.name})),this.controls.enabled=!1,this.redraw()},o.onDragEnd=a=>{this.dispatchEvent(new CustomEvent("manipulate-end",{bubbles:!0,cancelable:!0,detail:a.name})),this.controls.enabled=!0,this.redraw()},o.updateJoint=(a,s)=>{this.setJointValue(a.name,s)},o.onHover=a=>{r(a,!1),this.dispatchEvent(new CustomEvent("joint-mouseover",{bubbles:!0,cancelable:!0,detail:a.name})),this.redraw()},o.onUnhover=a=>{r(a,!0),this.dispatchEvent(new CustomEvent("joint-mouseout",{bubbles:!0,cancelable:!0,detail:a.name})),this.redraw()},this.dragControls=o}disconnectedCallback(){super.disconnectedCallback(),this.dragControls.dispose()}attributeChangedCallback(e,n,r){switch(super.attributeChangedCallback(e,n,r),e){case"highlight-color":this.highlightMaterial.color.set(this.highlightColor),this.highlightMaterial.emissive.set(this.highlightColor);break}}}const a2=1e3,gae=3e4,vae=({viewerRef:t,enabled:e=!0,websocketUrl:n})=>{const{wsBaseUrl:r}=Ln(),i=n||`${r}/ws/joint-data`,o=_.useRef(null),a=_.useRef(null),s=_.useRef(a2),l=_.useRef(!1),[c,u]=_.useState(!1),d=_.useCallback(f=>{const p=t.current;!p||typeof p.setJointValue!="function"||Object.entries(f).forEach(([y,v])=>{try{p.setJointValue(y,v)}catch(g){console.warn(`Failed to set joint ${y}:`,g)}})},[t]);return _.useEffect(()=>{if(!e)return;l.current=!1;const f=()=>{if(l.current)return;let y;try{y=new WebSocket(i)}catch(v){console.error("Failed to create WebSocket:",v),p();return}o.current=y,y.onopen=()=>{u(!0),s.current=a2,a.current&&(clearTimeout(a.current),a.current=null)},y.onmessage=v=>{try{const g=JSON.parse(v.data);g.type==="joint_update"&&g.joints&&d(g.joints)}catch(g){console.error("Error parsing WebSocket message:",g)}},y.onclose=v=>{u(!1),o.current=null,!l.current&&v.code!==1e3&&p()},y.onerror=()=>{u(!1)}},p=()=>{if(a.current)return;const y=s.current;s.current=Math.min(y*2,gae),a.current=setTimeout(()=>{a.current=null,f()},y)};return f(),()=>{l.current=!0,a.current&&(clearTimeout(a.current),a.current=null),o.current&&(o.current.close(1e3),o.current=null),u(!1)}},[e,i,d]),{isConnected:c}};var s2=["light","dark"],yae="(prefers-color-scheme: dark)";_.createContext(void 0);_.memo(({forcedTheme:t,storageKey:e,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:o,value:a,attrs:s,nonce:l})=>{let c=o==="system",u=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${s.map(y=>`'${y}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,d=i?s2.includes(o)&&o?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${o}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",f=(y,v=!1,g=!0)=>{let m=a?a[y]:y,x=v?y+"|| ''":`'${m}'`,b="";return i&&g&&!v&&s2.includes(y)&&(b+=`d.style.colorScheme = '${y}';`),n==="class"?v||m?b+=`c.add(${x})`:b+="null":m&&(b+=`d[s](n,${x})`),b},p=t?`!function(){${u}${f(t)}}()`:r?`!function(){try{${u}var e=localStorage.getItem('${e}');if('system'===e||(!e&&${c})){var t='${yae}',m=window.matchMedia(t);if(m.media!==t||m.matches){${f("dark")}}else{${f("light")}}}else if(e){${a?`var x=${JSON.stringify(a)};`:""}${f(a?"x[e]":"e",!0)}}${c?"":"else{"+f(o,!1,!1)+"}"}${d}}catch(e){}}()`:`!function(){try{${u}var e=localStorage.getItem('${e}');if(e){${a?`var x=${JSON.stringify(a)};`:""}${f(a?"x[e]":"e",!0)}}else{${f(o,!1,!1)};}${d}}catch(t){}}();`;return _.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:p}})});function l2(t,e){if(e===bQ)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),t;if(e===d1||e===C4){let n=t.getIndex();if(n===null){const a=[],s=t.getAttribute("position");if(s!==void 0){for(let l=0;l=2.0 are supported."));return}const c=new Zae(o,{path:n||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u=0&&s[d]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+d+'".')}}c.setExtensions(a),c.setPlugins(s),c.parse(r,i)}parseAsync(e,n){const r=this;return new Promise(function(i,o){r.parse(e,n,i,o)})}}function bae(){let t={};return{get:function(e){return t[e]},add:function(e,n){t[e]=n},remove:function(e){delete t[e]},removeAll:function(){t={}}}}const Lt={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class _ae{constructor(e){this.parser=e,this.name=Lt.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,n=this.parser.json.nodes||[];for(let r=0,i=n.length;r=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return n.loadTextureImage(e,o.source,a)}}class Lae{constructor(e){this.parser=e,this.name=Lt.EXT_TEXTURE_WEBP}loadTexture(e){const n=this.name,r=this.parser,i=r.json,o=i.textures[e];if(!o.extensions||!o.extensions[n])return null;const a=o.extensions[n],s=i.images[a.source];let l=r.textureLoader;if(s.uri){const c=r.options.manager.getHandler(s.uri);c!==null&&(l=c)}return r.loadTextureImage(e,a.source,l)}}class kae{constructor(e){this.parser=e,this.name=Lt.EXT_TEXTURE_AVIF}loadTexture(e){const n=this.name,r=this.parser,i=r.json,o=i.textures[e];if(!o.extensions||!o.extensions[n])return null;const a=o.extensions[n],s=i.images[a.source];let l=r.textureLoader;if(s.uri){const c=r.options.manager.getHandler(s.uri);c!==null&&(l=c)}return r.loadTextureImage(e,a.source,l)}}class jae{constructor(e){this.name=Lt.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const n=this.parser.json,r=n.bufferViews[e];if(r.extensions&&r.extensions[this.name]){const i=r.extensions[this.name],o=this.parser.getDependency("buffer",i.buffer),a=this.parser.options.meshoptDecoder;if(!a||!a.supported){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return o.then(function(s){const l=i.byteOffset||0,c=i.byteLength||0,u=i.count,d=i.byteStride,f=new Uint8Array(s,l,c);return a.decodeGltfBufferAsync?a.decodeGltfBufferAsync(u,d,f,i.mode,i.filter).then(function(p){return p.buffer}):a.ready.then(function(){const p=new ArrayBuffer(u*d);return a.decodeGltfBuffer(new Uint8Array(p),u,d,f,i.mode,i.filter),p})})}else return null}}class Uae{constructor(e){this.name=Lt.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const n=this.parser.json,r=n.nodes[e];if(!r.extensions||!r.extensions[this.name]||r.mesh===void 0)return null;const i=n.meshes[r.mesh];for(const c of i.primitives)if(c.mode!==Vi.TRIANGLES&&c.mode!==Vi.TRIANGLE_STRIP&&c.mode!==Vi.TRIANGLE_FAN&&c.mode!==void 0)return null;const a=r.extensions[this.name].attributes,s=[],l={};for(const c in a)s.push(this.parser.getDependency("accessor",a[c]).then(u=>(l[c]=u,l[c])));return s.length<1?null:(s.push(this.parser.createNodeMesh(e)),Promise.all(s).then(c=>{const u=c.pop(),d=u.isGroup?u.children:[u],f=c[0].count,p=[];for(const y of d){const v=new gt,g=new ne,m=new Ii,x=new ne(1,1,1),b=new Tee(y.geometry,y.material,f);for(let S=0;S0||t.search(/^data\:image\/jpeg/)===0?"image/jpeg":t.search(/\.webp($|\?)/i)>0||t.search(/^data\:image\/webp/)===0?"image/webp":t.search(/\.ktx2($|\?)/i)>0||t.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const Jae=new gt;class Zae{constructor(e={},n={}){this.json=e,this.extensions={},this.plugins={},this.options=n,this.cache=new bae,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let r=!1,i=-1,o=!1,a=-1;if(typeof navigator<"u"){const s=navigator.userAgent;r=/^((?!chrome|android).)*safari/i.test(s)===!0;const l=s.match(/Version\/(\d+)/);i=r&&l?parseInt(l[1],10):-1,o=s.indexOf("Firefox")>-1,a=o?s.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||r&&i<17||o&&a<98?this.textureLoader=new nC(this.options.manager):this.textureLoader=new qee(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Mf(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,n){const r=this,i=this.json,o=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(a){return a._markDefs&&a._markDefs()}),Promise.all(this._invokeAll(function(a){return a.beforeRoot&&a.beforeRoot()})).then(function(){return Promise.all([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])}).then(function(a){const s={scene:a[0][i.scene||0],scenes:a[0],animations:a[1],cameras:a[2],asset:i.asset,parser:r,userData:{}};return Ul(o,s,i),ka(s,i),Promise.all(r._invokeAll(function(l){return l.afterRoot&&l.afterRoot(s)})).then(function(){for(const l of s.scenes)l.updateMatrixWorld();e(s)})}).catch(n)}_markDefs(){const e=this.json.nodes||[],n=this.json.skins||[],r=this.json.meshes||[];for(let i=0,o=n.length;i{const l=this.associations.get(a);l!=null&&this.associations.set(s,l);for(const[c,u]of a.children.entries())o(u,s.children[c])};return o(r,i),i.name+="_instance_"+e.uses[n]++,i}_invokeOne(e){const n=Object.values(this.plugins);n.push(this);for(let r=0;r=2&&g.setY(M,E[T*l+1]),l>=3&&g.setZ(M,E[T*l+2]),l>=4&&g.setW(M,E[T*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}g.normalized=y}return g})}loadTexture(e){const n=this.json,r=this.options,o=n.textures[e].source,a=n.images[o];let s=this.textureLoader;if(a.uri){const l=r.manager.getHandler(a.uri);l!==null&&(s=l)}return this.loadTextureImage(e,o,s)}loadTextureImage(e,n,r){const i=this,o=this.json,a=o.textures[e],s=o.images[n],l=(s.uri||s.bufferView)+":"+a.sampler;if(this.textureCache[l])return this.textureCache[l];const c=this.loadImageSource(n,r).then(function(u){u.flipY=!1,u.name=a.name||s.name||"",u.name===""&&typeof s.uri=="string"&&s.uri.startsWith("data:image/")===!1&&(u.name=s.uri);const f=(o.samplers||{})[a.sampler]||{};return u.magFilter=u2[f.magFilter]||Or,u.minFilter=u2[f.minFilter]||Oo,u.wrapS=d2[f.wrapS]||aa,u.wrapT=d2[f.wrapT]||aa,u.generateMipmaps=!u.isCompressedTexture&&u.minFilter!==Xr&&u.minFilter!==Or,i.associations.set(u,{textures:e}),u}).catch(function(){return null});return this.textureCache[l]=c,c}loadImageSource(e,n){const r=this,i=this.json,o=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(d=>d.clone());const a=i.images[e],s=self.URL||self.webkitURL;let l=a.uri||"",c=!1;if(a.bufferView!==void 0)l=r.getDependency("bufferView",a.bufferView).then(function(d){c=!0;const f=new Blob([d],{type:a.mimeType});return l=s.createObjectURL(f),l});else if(a.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const u=Promise.resolve(l).then(function(d){return new Promise(function(f,p){let y=f;n.isImageBitmapLoader===!0&&(y=function(v){const g=new lr(v);g.needsUpdate=!0,f(g)}),n.load(mc.resolveURL(d,o.path),y,void 0,p)})}).then(function(d){return c===!0&&s.revokeObjectURL(l),ka(d,a),d.userData.mimeType=a.mimeType||Yae(a.uri),d}).catch(function(d){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),d});return this.sourceCache[e]=u,u}assignTexture(e,n,r,i){const o=this;return this.getDependency("texture",r.index).then(function(a){if(!a)return null;if(r.texCoord!==void 0&&r.texCoord>0&&(a=a.clone(),a.channel=r.texCoord),o.extensions[Lt.KHR_TEXTURE_TRANSFORM]){const s=r.extensions!==void 0?r.extensions[Lt.KHR_TEXTURE_TRANSFORM]:void 0;if(s){const l=o.associations.get(a);a=o.extensions[Lt.KHR_TEXTURE_TRANSFORM].extendTexture(a,s),o.associations.set(a,l)}}return i!==void 0&&(a.colorSpace=i),e[n]=a,a})}assignFinalMaterial(e){const n=e.geometry;let r=e.material;const i=n.attributes.tangent===void 0,o=n.attributes.color!==void 0,a=n.attributes.normal===void 0;if(e.isPoints){const s="PointsMaterial:"+r.uuid;let l=this.cache.get(s);l||(l=new Hu,qr.prototype.copy.call(l,r),l.color.copy(r.color),l.map=r.map,l.sizeAttenuation=!1,this.cache.add(s,l)),r=l}else if(e.isLine){const s="LineBasicMaterial:"+r.uuid;let l=this.cache.get(s);l||(l=new pc,qr.prototype.copy.call(l,r),l.color.copy(r.color),l.map=r.map,this.cache.add(s,l)),r=l}if(i||o||a){let s="ClonedMaterial:"+r.uuid+":";i&&(s+="derivative-tangents:"),o&&(s+="vertex-colors:"),a&&(s+="flat-shading:");let l=this.cache.get(s);l||(l=r.clone(),o&&(l.vertexColors=!0),a&&(l.flatShading=!0),i&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(s,l),this.associations.set(l,this.associations.get(r))),r=l}e.material=r}getMaterialType(){return tC}loadMaterial(e){const n=this,r=this.json,i=this.extensions,o=r.materials[e];let a;const s={},l=o.extensions||{},c=[];if(l[Lt.KHR_MATERIALS_UNLIT]){const d=i[Lt.KHR_MATERIALS_UNLIT];a=d.getMaterialType(),c.push(d.extendParams(s,o,n))}else{const d=o.pbrMetallicRoughness||{};if(s.color=new ft(1,1,1),s.opacity=1,Array.isArray(d.baseColorFactor)){const f=d.baseColorFactor;s.color.setRGB(f[0],f[1],f[2],Kr),s.opacity=f[3]}d.baseColorTexture!==void 0&&c.push(n.assignTexture(s,"map",d.baseColorTexture,Zt)),s.metalness=d.metallicFactor!==void 0?d.metallicFactor:1,s.roughness=d.roughnessFactor!==void 0?d.roughnessFactor:1,d.metallicRoughnessTexture!==void 0&&(c.push(n.assignTexture(s,"metalnessMap",d.metallicRoughnessTexture)),c.push(n.assignTexture(s,"roughnessMap",d.metallicRoughnessTexture))),a=this._invokeOne(function(f){return f.getMaterialType&&f.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(f){return f.extendMaterialParams&&f.extendMaterialParams(e,s)})))}o.doubleSided===!0&&(s.side=Ki);const u=o.alphaMode||Pw.OPAQUE;if(u===Pw.BLEND?(s.transparent=!0,s.depthWrite=!1):(s.transparent=!1,u===Pw.MASK&&(s.alphaTest=o.alphaCutoff!==void 0?o.alphaCutoff:.5)),o.normalTexture!==void 0&&a!==sa&&(c.push(n.assignTexture(s,"normalMap",o.normalTexture)),s.normalScale=new xt(1,1),o.normalTexture.scale!==void 0)){const d=o.normalTexture.scale;s.normalScale.set(d,d)}if(o.occlusionTexture!==void 0&&a!==sa&&(c.push(n.assignTexture(s,"aoMap",o.occlusionTexture)),o.occlusionTexture.strength!==void 0&&(s.aoMapIntensity=o.occlusionTexture.strength)),o.emissiveFactor!==void 0&&a!==sa){const d=o.emissiveFactor;s.emissive=new ft().setRGB(d[0],d[1],d[2],Kr)}return o.emissiveTexture!==void 0&&a!==sa&&c.push(n.assignTexture(s,"emissiveMap",o.emissiveTexture,Zt)),Promise.all(c).then(function(){const d=new a(s);return o.name&&(d.name=o.name),ka(d,o),n.associations.set(d,{materials:e}),o.extensions&&Ul(i,d,o),d})}createUniqueName(e){const n=nn.sanitizeNodeName(e||"");return n in this.nodeNamesUsed?n+"_"+ ++this.nodeNamesUsed[n]:(this.nodeNamesUsed[n]=0,n)}loadGeometries(e){const n=this,r=this.extensions,i=this.primitiveCache;function o(s){return r[Lt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(s,n).then(function(l){return f2(l,s,n)})}const a=[];for(let s=0,l=e.length;s0&&qae(m,o),m.name=n.createUniqueName(o.name||"mesh_"+e),ka(m,o),g.extensions&&Ul(i,m,g),n.assignFinalMaterial(m),d.push(m)}for(let p=0,y=d.length;p1?u=new la:c.length===1?u=c[0]:u=new vn,u!==c[0])for(let d=0,f=c.length;d1){const d=i.associations.get(u);i.associations.set(u,{...d})}return i.associations.get(u).nodes=e,u}),this.nodeCache[e]}loadScene(e){const n=this.extensions,r=this.json.scenes[e],i=this,o=new la;r.name&&(o.name=i.createUniqueName(r.name)),ka(o,r),r.extensions&&Ul(n,o,r);const a=r.nodes||[],s=[];for(let l=0,c=a.length;l{const d=new Map;for(const[f,p]of i.associations)(f instanceof qr||f instanceof lr)&&d.set(f,p);return u.traverse(f=>{const p=i.associations.get(f);p!=null&&d.set(f,p)}),d};return i.associations=c(o),o})}_createAnimationTracks(e,n,r,i,o){const a=[],s=e.name?e.name:e.uuid,l=[];Ss[o.path]===Ss.weights?e.traverse(function(f){f.morphTargetInfluences&&l.push(f.name?f.name:f.uuid)}):l.push(s);let c;switch(Ss[o.path]){case Ss.weights:c=zd;break;case Ss.rotation:c=Ic;break;case Ss.translation:case Ss.scale:c=hl;break;default:switch(r.itemSize){case 1:c=zd;break;case 2:case 3:default:c=hl;break}break}const u=i.interpolation!==void 0?Gae[i.interpolation]:Cp,d=this._getArrayFromAccessor(r);for(let f=0,p=l.length;f0?o[o.length-1]:"",smooth:a!==void 0?a.smooth:this.smooth,groupStart:a!==void 0?a.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(l){const c={index:typeof l=="number"?l:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return c.clone=this.clone.bind(c),c}};return this.materials.push(s),s},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(i){const o=this.currentMaterial();if(o&&o.groupEnd===-1&&(o.groupEnd=this.geometry.vertices.length/3,o.groupCount=o.groupEnd-o.groupStart,o.inherited=!1),i&&this.materials.length>1)for(let a=this.materials.length-1;a>=0;a--)this.materials[a].groupCount<=0&&this.materials.splice(a,1);return i&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),o}},r&&r.name&&typeof r.clone=="function"){const i=r.clone(0);i.inherited=!0,this.object.materials.push(i)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(e,n){const r=parseInt(e,10);return(r>=0?r-1:r+n/3)*3},parseNormalIndex:function(e,n){const r=parseInt(e,10);return(r>=0?r-1:r+n/3)*3},parseUVIndex:function(e,n){const r=parseInt(e,10);return(r>=0?r-1:r+n/2)*2},addVertex:function(e,n,r){const i=this.vertices,o=this.object.geometry.vertices;o.push(i[e+0],i[e+1],i[e+2]),o.push(i[n+0],i[n+1],i[n+2]),o.push(i[r+0],i[r+1],i[r+2])},addVertexPoint:function(e){const n=this.vertices;this.object.geometry.vertices.push(n[e+0],n[e+1],n[e+2])},addVertexLine:function(e){const n=this.vertices;this.object.geometry.vertices.push(n[e+0],n[e+1],n[e+2])},addNormal:function(e,n,r){const i=this.normals,o=this.object.geometry.normals;o.push(i[e+0],i[e+1],i[e+2]),o.push(i[n+0],i[n+1],i[n+2]),o.push(i[r+0],i[r+1],i[r+2])},addFaceNormal:function(e,n,r){const i=this.vertices,o=this.object.geometry.normals;p2.fromArray(i,e),Nw.fromArray(i,n),m2.fromArray(i,r),Bi.subVectors(m2,Nw),g2.subVectors(p2,Nw),Bi.cross(g2),Bi.normalize(),o.push(Bi.x,Bi.y,Bi.z),o.push(Bi.x,Bi.y,Bi.z),o.push(Bi.x,Bi.y,Bi.z)},addColor:function(e,n,r){const i=this.colors,o=this.object.geometry.colors;i[e]!==void 0&&o.push(i[e+0],i[e+1],i[e+2]),i[n]!==void 0&&o.push(i[n+0],i[n+1],i[n+2]),i[r]!==void 0&&o.push(i[r+0],i[r+1],i[r+2])},addUV:function(e,n,r){const i=this.uvs,o=this.object.geometry.uvs;o.push(i[e+0],i[e+1]),o.push(i[n+0],i[n+1]),o.push(i[r+0],i[r+1])},addDefaultUV:function(){const e=this.object.geometry.uvs;e.push(0,0),e.push(0,0),e.push(0,0)},addUVLine:function(e){const n=this.uvs;this.object.geometry.uvs.push(n[e+0],n[e+1])},addFace:function(e,n,r,i,o,a,s,l,c){const u=this.vertices.length;let d=this.parseVertexIndex(e,u),f=this.parseVertexIndex(n,u),p=this.parseVertexIndex(r,u);if(this.addVertex(d,f,p),this.addColor(d,f,p),s!==void 0&&s!==""){const y=this.normals.length;d=this.parseNormalIndex(s,y),f=this.parseNormalIndex(l,y),p=this.parseNormalIndex(c,y),this.addNormal(d,f,p)}else this.addFaceNormal(d,f,p);if(i!==void 0&&i!==""){const y=this.uvs.length;d=this.parseUVIndex(i,y),f=this.parseUVIndex(o,y),p=this.parseUVIndex(a,y),this.addUV(d,f,p),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(e){this.object.geometry.type="Points";const n=this.vertices.length;for(let r=0,i=e.length;r=7?(ov.setRGB(parseFloat(d[4]),parseFloat(d[5]),parseFloat(d[6]),Zt),n.colors.push(ov.r,ov.g,ov.b)):n.colors.push(void 0,void 0,void 0);break;case"vn":n.normals.push(parseFloat(d[1]),parseFloat(d[2]),parseFloat(d[3]));break;case"vt":n.uvs.push(parseFloat(d[1]),parseFloat(d[2]));break}}else if(u==="f"){const f=c.slice(1).trim().split(h2),p=[];for(let v=0,g=f.length;v0){const x=m.split("/");p.push(x)}}const y=p[0];for(let v=1,g=p.length-1;v1){const f=i[1].trim().toLowerCase();n.object.smooth=f!=="0"&&f!=="off"}else n.object.smooth=!0;const d=n.object.currentMaterial();d&&(d.smooth=n.object.smooth)}else{if(c==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+c+'"')}}n.finalize();const o=new la;if(o.materialLibraries=[].concat(n.materialLibraries),!(n.objects.length===1&&n.objects[0].geometry.vertices.length===0)===!0)for(let s=0,l=n.objects.length;s0&&v.setAttribute("normal",new Qt(u.normals,3)),u.colors.length>0&&(y=!0,v.setAttribute("color",new Qt(u.colors,3))),u.hasUVIndices===!0&&v.setAttribute("uv",new Qt(u.uvs,2));const g=[];for(let x=0,b=d.length;x1){for(let x=0,b=d.length;x0){const s=new Hu({size:1,sizeAttenuation:!1}),l=new br;l.setAttribute("position",new Qt(n.vertices,3)),n.colors.length>0&&n.colors[0]!==void 0&&(l.setAttribute("color",new Qt(n.colors,3)),s.vertexColors=!0);const c=new Gv(l,s);o.add(c)}return o}}const ase=(t,e,n)=>{var i;let r=(i=t.split(/\./g).pop())==null?void 0:i.toLowerCase();if(t.startsWith("blob:")&&t.includes("#.")){const o=t.split("#.").pop();o&&(r=o.toLowerCase())}if(!r){console.error(`Could not determine file extension for: ${t}`),n(null,new Error(`Unsupported file format: ${t}`));return}switch(r){case"gltf":case"glb":new xae(e).load(t,o=>n(o.scene),void 0,o=>n(null,o));break;case"obj":new ose(e).load(t,o=>n(o),()=>{},o=>n(null,o));break;case"dae":new n$(e).load(t,o=>n(o.scene),void 0,o=>n(null,o));break;case"stl":new t$(e).load(t,o=>{const a=new Fo,s=new Mn(o,a);n(s)},o=>{},o=>{console.error(`โŒ STL loading failed: ${t}`,o);const a=new Gc(.05,.05,.05),s=new Fo({color:16739125,transparent:!0,opacity:.7}),l=new Mn(a,s);n(l)});break;default:n(null,new Error(`Unsupported file format: ${r}`))}};function sse(t,e){t.innerHTML="";const n=document.createElement("urdf-viewer");n.classList.add("w-full","h-full"),t.appendChild(n),n.setAttribute("up","Z"),dse(n,"#2c2b3a"),n.setAttribute("highlight-color","#df6dd4"),n.setAttribute("auto-redraw","true");const r=new X4(14079702,1);n.scene.add(r);const i=new Bx(16777215,.8);return i.position.set(5,30,5),i.castShadow=!0,n.scene.add(i),n}function lse(t,e){"loadMeshFunc"in t&&(t.loadMeshFunc=(n,r,i)=>{const o=e?e(n):n;try{ase(o,r,(a,s)=>{s?(console.warn(`Error loading mesh ${o}:`,s),i(null)):i(a)})}catch(a){console.error(`Exception loading mesh ${o}:`,a),i(null,a)}})}function cse(t,e){const n=i=>{e(i.detail)},r=()=>{e(null)};return t.addEventListener("joint-mouseover",n),t.addEventListener("joint-mouseout",r),()=>{t.removeEventListener("joint-mouseover",n),t.removeEventListener("joint-mouseout",r)}}function use(t,e,n,r,i=[]){const o=e.startsWith("blob:")&&!e.includes("#.")?e+"#.urdf":e;t.setAttribute("urdf",o),t.setAttribute("package",n);const a=()=>{if(i.length>0){const s=i[0];s&&(r(s),Ur.info("Trying alternative model...",{description:`First model failed to load. Trying ${s.split("/").pop()||"alternative model"}`,duration:2e3}))}};return t.addEventListener("error",a),()=>{t.removeEventListener("error",a)}}function dse(t,e){const n=t.parentElement;n&&(n.style.backgroundColor=e)}typeof window<"u"&&!customElements.get("urdf-viewer")&&customElements.define("urdf-viewer",mae);const fse=()=>{const t=_.useRef(null),[e,n]=_.useState(null),{registerUrdfProcessor:r,alternativeUrdfModels:i,isDefaultModel:o}=iU(),a=_.useRef(null),s=_.useRef(null),l=_.useRef(!1),{isConnected:c}=vae({viewerRef:s,enabled:o}),[u,d]=_.useState(null),[f,p]=_.useState(null),y=_.useRef(""),v=_.useMemo(()=>({loadUrdf:m=>{d(m)},setUrlModifierFunc:m=>{p(()=>m)},getPackage:()=>y.current}),[]);_.useEffect(()=>{r(v)},[r,v]);const g=_.useCallback(m=>m.startsWith("package://so_arm_description/meshes/")?m.replace("package://so_arm_description/meshes/","/so-101-urdf/meshes/"):m.includes("so_arm_description/meshes/")?m.replace(/.*so_arm_description\/meshes\//,"/so-101-urdf/meshes/"):m.includes("/so-101-urdf/so_arm_description/meshes/")?m.replace("/so-101-urdf/so_arm_description/meshes/","/so-101-urdf/meshes/"):m.endsWith(".stl")&&!m.startsWith("/")&&!m.startsWith("http")?`/so-101-urdf/meshes/${m}`:m,[]);return _.useEffect(()=>{if(!t.current)return;const m=sse(t.current);s.current=m,lse(m,o?g:f);const b=o?"/so-101-urdf/urdf/so101_new_calib.urdf":u||"";o&&(y.current="/");let S=()=>{};b&&(S=use(m,b,y.current,d,i));const w=cse(m,n),E=M=>{if(!(!M||!M.robot))try{const C=new Wo().setFromObject(M.robot),P=new ne;C.getCenter(P);const R=new ne;C.getSize(R);const D=Math.max(R.x,R.y,R.z);M.camera.position.copy(P);const k=new ne;M.up==="+Z"||M.up==="Z"||M.up==="+Y"||M.up,k.set(1,1,1),k.normalize().multiplyScalar(D*1.3),M.camera.position.add(k),M.controls.target.copy(P),M.controls.update(),M.redraw()}catch(C){console.error("[RobotViewer] Error fitting robot to view:",C)}},T=()=>{E(m)},A=()=>{l.current=!0,"setJointValue"in m&&a.current&&(a.current(),a.current=null),T()};return m.addEventListener("urdf-processed",A),()=>{a.current&&(a.current(),a.current=null),l.current=!1,w(),S(),m.removeEventListener("urdf-processed",A)}},[o,u,f,g,i]),h.jsxs("div",{className:He("w-full h-full transition-all duration-300 ease-in-out relative","bg-gradient-to-br from-gray-900 to-gray-800"),children:[h.jsx("div",{ref:t,className:"w-full h-full"}),e&&h.jsxs("div",{className:"absolute bottom-4 right-4 bg-black/70 text-white px-3 py-2 rounded-md text-sm font-mono z-10",children:["Joint: ",e]}),o&&h.jsx("div",{className:"absolute top-4 right-4 z-10",children:h.jsxs("div",{className:`flex items-center gap-2 px-3 py-2 rounded-md text-sm font-mono ${c?"bg-green-900/70 text-green-300":"bg-red-900/70 text-red-300"}`,children:[h.jsx("div",{className:`w-2 h-2 rounded-full ${c?"bg-green-400":"bg-red-400"}`}),c?"Live Robot Data":"Disconnected"]})})]})},hse=_.memo(fse),Hx=({className:t,iconOnly:e=!1})=>h.jsxs("div",{className:He("flex items-center gap-2",t),children:[h.jsx("img",{src:"/lovable-uploads/5e648747-34b7-4d8f-93fd-4dbd00aeeefc.png",alt:"LeLab Logo",className:"h-8 w-8"}),!e&&h.jsx("span",{className:"font-bold text-white text-2xl",children:"LeLab"})]}),pse=({onGoBack:t,className:e})=>h.jsx("div",{className:He("w-full p-2 sm:p-4 space-y-4 lg:space-y-0 lg:space-x-4 flex flex-col lg:flex-row",e),children:h.jsxs("div",{className:"bg-gray-900 rounded-lg p-4 flex-1 flex flex-col",children:[h.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[h.jsx(et,{variant:"ghost",size:"icon",onClick:t,className:"text-gray-400 hover:text-white hover:bg-gray-800 flex-shrink-0",children:h.jsx(sl,{className:"h-5 w-5"})}),h.jsx(Hx,{iconOnly:!0}),h.jsx("div",{className:"w-px h-6 bg-gray-700"}),h.jsx("h2",{className:"text-xl font-medium text-gray-200",children:"Teleoperation"})]}),h.jsx("div",{className:"flex-1 bg-black rounded border border-gray-800 min-h-[50vh] lg:min-h-0",children:h.jsx(hse,{})})]})}),mse=()=>{const t=ji(),{toast:e}=Dr(),{baseUrl:n,fetchWithHeaders:r}=Ln(),i=async()=>{try{const o=await r(`${n}/stop-teleoperation`,{method:"POST"});if(o.ok){const a=await o.json();a.message,e({title:"Teleoperation Stopped",description:a.message||"Robot teleoperation has been stopped successfully."})}else{const a=await o.text();console.warn("โš ๏ธ Failed to stop teleoperation:",o.status,a),e({title:"Warning",description:`Failed to stop teleoperation properly. Status: ${o.status}`,variant:"destructive"})}}catch(o){console.error("โŒ Error stopping teleoperation:",o),e({title:"Error",description:"Failed to communicate with the robot server.",variant:"destructive"})}finally{t("/")}};return h.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center p-2 sm:p-4",children:h.jsx("div",{className:"w-full h-[95vh] flex",children:h.jsx(pse,{onGoBack:i,className:"lg:w-full"})})})},gse=Sm("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function b1({className:t,variant:e,...n}){return h.jsx("div",{className:He(gse({variant:e}),t),...n})}var vse="Separator",v2="horizontal",yse=["horizontal","vertical"],s$=_.forwardRef((t,e)=>{const{decorative:n,orientation:r=v2,...i}=t,o=xse(r)?r:v2,s=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return h.jsx(nt.div,{"data-orientation":o,...s,...i,ref:e})});s$.displayName=vse;function xse(t){return yse.includes(t)}var l$=s$;const Yl=_.forwardRef(({className:t,orientation:e="horizontal",decorative:n=!0,...r},i)=>h.jsx(l$,{ref:i,decorative:n,orientation:e,className:He("shrink-0 bg-border",e==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...r}));Yl.displayName=l$.displayName;const bse=({onClick:t,robotType:e,className:n=""})=>h.jsxs(et,{type:"button",onClick:t,variant:"outline",size:"sm",className:` + h-8 px-2 + border-gray-600 hover:border-blue-500 + text-gray-400 hover:text-blue-400 + bg-gray-800 hover:bg-gray-700 + transition-all duration-200 + ${n} + `,title:`Find ${e||"robot"} port automatically`,children:[h.jsx(tA,{className:"w-3 h-3 mr-1"}),"Find"]}),_se=2e3,wse=({open:t,onOpenChange:e,robotType:n,onPortDetected:r})=>{const[i,o]=_.useState("detecting"),[a,s]=_.useState(""),[l,c]=_.useState(""),u=_.useRef(!1),d=_.useRef(null),f=_.useRef(null),{toast:p}=Dr(),{baseUrl:y,fetchWithHeaders:v}=Ln(),g=async()=>{try{d.current=new AbortController;const E=await(await v(`${y}/start-port-detection`,{method:"POST",body:JSON.stringify({robot_type:n}),signal:d.current.signal})).json();if(u.current)return;if(E.status!=="success")throw new Error(E.message||"Failed to start port detection");const T=E.data.ports_before;for(;!u.current;){d.current=new AbortController;const M=await(await v(`${y}/detect-port-after-disconnect`,{method:"POST",body:JSON.stringify({ports_before:T}),signal:d.current.signal})).json();if(u.current)return;if(M.status==="success"){if(s(M.port),await m(M.port),u.current)return;o("success"),p({title:"Port Detected Successfully",description:`${n} port detected: ${M.port}`}),f.current=window.setTimeout(()=>{u.current||(r(M.port),e(!1))},_se);return}const C=typeof M.message=="string"?M.message:"";if(!C.includes("Timed out"))throw new Error(C||"Failed to detect port")}}catch(w){if(u.current||w instanceof DOMException&&w.name==="AbortError")return;console.error("Port detection failed:",w),c(w instanceof Error?w.message:"Unknown error"),o("error")}},m=async w=>{try{await v(`${y}/save-robot-port`,{method:"POST",body:JSON.stringify({robot_type:n,port:w})})}catch(E){console.error("Error saving port:",E)}};_.useEffect(()=>{if(t)return u.current=!1,o("detecting"),c(""),s(""),g(),()=>{var w;u.current=!0,(w=d.current)==null||w.abort(),f.current!==null&&(window.clearTimeout(f.current),f.current=null)}},[t]);const x=()=>{e(!1)},b=()=>{var w;u.current=!1,(w=d.current)==null||w.abort(),o("detecting"),c(""),s(""),g()},S=()=>{switch(i){case"detecting":return h.jsxs("div",{className:"space-y-6 text-center",children:[h.jsx(fi,{className:"w-16 h-16 text-blue-500 mx-auto animate-spin"}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs("h3",{className:"text-lg font-semibold text-white",children:["Unplug the ",n," arm"]}),h.jsxs("p",{className:"text-gray-400",children:["Disconnect the ",n," robot arm from USB. The port will be detected automatically."]})]}),h.jsx("div",{className:"flex justify-center",children:h.jsx(et,{onClick:x,variant:"outline",className:"border-gray-500 hover:border-gray-200 text-gray-300 hover:text-white px-8 py-2",children:"Cancel"})})]});case"success":return h.jsxs("div",{className:"space-y-6 text-center",children:[h.jsx(qi,{className:"w-16 h-16 text-green-500 mx-auto"}),h.jsxs("div",{className:"space-y-2",children:[h.jsx("h3",{className:"text-lg font-semibold text-white",children:"Port Detected"}),h.jsx("p",{className:"text-xl font-mono text-green-400 bg-gray-800 px-4 py-2 rounded inline-block",children:a})]})]});case"error":return h.jsxs("div",{className:"space-y-6 text-center",children:[h.jsx(td,{className:"w-16 h-16 text-red-500 mx-auto"}),h.jsxs("div",{className:"space-y-2",children:[h.jsx("h3",{className:"text-lg font-semibold text-white",children:"Detection Failed"}),h.jsx("div",{className:"bg-red-900/20 border border-red-800 rounded-lg p-3",children:h.jsx("p",{className:"text-red-400 text-sm",children:l})})]}),h.jsxs("div",{className:"flex gap-4 justify-center",children:[h.jsx(et,{onClick:b,className:"bg-blue-500 hover:bg-blue-600 text-white px-8 py-2",children:"Try Again"}),h.jsx(et,{onClick:x,variant:"outline",className:"border-gray-500 hover:border-gray-200 text-gray-300 hover:text-white px-8 py-2",children:"Cancel"})]})]});default:return null}};return h.jsx(Hc,{open:t,onOpenChange:e,children:h.jsxs(xl,{className:"bg-gray-900 border-gray-800 text-white sm:max-w-[500px] p-8",children:[h.jsxs(bl,{children:[h.jsx(_l,{className:"text-white text-center text-xl font-bold",children:"Port Detection"}),h.jsxs(wl,{className:"text-gray-400 text-center",children:["Detect the USB port for your ",n," arm"]})]}),h.jsx("div",{className:"py-4",children:S()})]})})},Sse={shoulder_pan:2400,shoulder_lift:2300,elbow_flex:2150,wrist_flex:2250,wrist_roll:3700,gripper:1150},Ese={shoulder_pan:2400,shoulder_lift:2300,elbow_flex:2150,wrist_flex:2250,wrist_roll:3700,gripper:1400},Tse={teleop:Sse,robot:Ese},Mse=.98;function y2(t,e,n){var i;if(!t)return!1;const r=(i=Tse[t])==null?void 0:i[e];return r?n>=r*Mse:!1}const x2="Motor discontinuity detected",Ase=()=>{var X;const t=ji(),n=((X=vl().state)==null?void 0:X.robot_name)??null,{toast:r}=Dr(),{baseUrl:i,fetchWithHeaders:o}=Ln();_.useRef(null);const a=_.useRef(null),[s,l]=_.useState("teleop"),[c,u]=_.useState(""),[d,f]=_.useState(null),[p,y]=_.useState([]),v=_.useRef(null),g=_.useCallback(async()=>{if(!n)return null;try{const K=await o(`${i}/robots/${encodeURIComponent(n)}`);if(!K.ok)return null;const Y=(await K.json()).robot??null;return f(Y),Y}catch(K){return console.error("Failed to load robot record:",K),null}},[n,i,o]);_.useEffect(()=>{if(!n)return;let K=!1;return(async()=>{const F=await g();if(!F||K)return;const Y=F.leader_config?F.follower_config?"teleop":"robot":"teleop";l(Y),u(Y==="teleop"?F.leader_port||"":F.follower_port||""),y(F.cameras??[])})(),()=>{K=!0}},[n,g]);const m=K=>{y(K),n&&(v.current&&clearTimeout(v.current),v.current=setTimeout(async()=>{try{await o(`${i}/robots/${encodeURIComponent(n)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cameras:K})})}catch(F){console.error("Failed to save cameras to robot record:",F)}},500))};_.useEffect(()=>()=>{v.current&&clearTimeout(v.current)},[]);const[x,b]=_.useState(!1),[S,w]=_.useState("leader"),[E,T]=_.useState({calibration_active:!1,status:"idle",device_type:null,error:null,message:"",step:0,total_steps:1,current_positions:null,recorded_ranges:null}),[A,M]=_.useState(!1),C=_.useRef(!1);_.useEffect(()=>{C.current=E.calibration_active},[E.calibration_active]),_.useEffect(()=>()=>{C.current&&o(`${i}/stop-calibration`,{method:"POST"}).catch(K=>console.error("Failed to stop calibration on unmount:",K))},[i,o]);const P=async()=>{try{const K=await o(`${i}/calibration-status`);if(K.ok){const F=await K.json();T(F),!F.calibration_active&&(F.status==="completed"||F.status==="error"||F.status==="idle")&&M(!1)}}catch(K){console.error("Error polling status:",K)}},R=async()=>{if(!n){r({title:"No robot selected",description:"Open Calibration from a robot's gear icon on the Landing page.",variant:"destructive"});return}if(!c){r({title:"Missing port",description:"Set the device's serial port before starting.",variant:"destructive"});return}const K={device_type:s,port:c,config_file:n,robot_name:n};C.current=!0;try{const Y=await(await o(`${i}/start-calibration`,{method:"POST",body:JSON.stringify(K)})).json();Y.success?(r({title:"Calibration Started",description:`Calibration started for ${s}`}),M(!0)):(C.current=!1,r({title:"Calibration Failed",description:Y.message||"Failed to start calibration",variant:"destructive"}))}catch(F){C.current=!1,console.error("Error starting calibration:",F),r({title:"Error",description:"Failed to start calibration",variant:"destructive"})}},D=async()=>{try{const F=await(await o(`${i}/stop-calibration`,{method:"POST"})).json();F.success?r({title:"Calibration Stopped",description:"Calibration has been stopped"}):r({title:"Error",description:F.message||"Failed to stop calibration",variant:"destructive"})}catch(K){console.error("Error stopping calibration:",K),r({title:"Error",description:"Failed to stop calibration",variant:"destructive"})}},k=async()=>{if(E.calibration_active)try{const F=await(await o(`${i}/complete-calibration-step`,{method:"POST"})).json();F.success?r({title:"Step Completed",description:F.message}):r({title:"Step Failed",description:F.message||"Could not complete step",variant:"destructive"})}catch(K){console.error("Error completing step:",K),r({title:"Error",description:"Could not complete calibration step",variant:"destructive"})}};_.useEffect(()=>{var K,F;E.status==="error"&&((K=E.error)!=null&&K.startsWith(x2))&&((F=a.current)==null||F.scrollIntoView({behavior:"smooth",block:"center"}))},[E.status,E.error]),_.useEffect(()=>{if(!A)return;P();const K=setInterval(()=>{P()},200);return()=>clearInterval(K)},[A]),_.useEffect(()=>{(async()=>{if(s&&!n)try{const q=await(await o(`${i}/robot-port/${s==="robot"?"follower":"leader"}`)).json();if(q.status==="success"){const Q=q.saved_port||q.default_port;Q&&u(Q)}}catch(F){console.error("Error loading default port:",F)}})()},[s,n,i,o]);const U=K=>{l(K),d&&u(K==="teleop"?d.leader_port||"":d.follower_port||"")};_.useEffect(()=>{E.status==="completed"&&(async()=>{const K=await g();if(!K)return;const F=K.leader_config?K.follower_config?"teleop":"robot":"teleop";l(F),u(F==="teleop"?K.leader_port||"":K.follower_port||"")})()},[E.status,g]);const O=()=>{w(s==="robot"?"follower":"leader"),b(!0)},W=K=>{u(K)},j=(()=>{switch(E.status){case"idle":return{color:"bg-slate-500",icon:h.jsx(Mh,{className:"w-4 h-4"}),text:"Idle"};case"connecting":return{color:"bg-yellow-500",icon:h.jsx(fi,{className:"w-4 h-4 animate-spin"}),text:"Connecting"};case"recording":return{color:"bg-purple-500",icon:h.jsx($u,{className:"w-4 h-4"}),text:"Recording Ranges"};case"completed":return{color:"bg-green-500",icon:h.jsx(qi,{className:"w-4 h-4"}),text:"Completed"};case"error":return{color:"bg-red-500",icon:h.jsx(nd,{className:"w-4 h-4"}),text:"Error"};case"stopping":return{color:"bg-orange-500",icon:h.jsx(Od,{className:"w-4 h-4"}),text:"Stopping"};default:return{color:"bg-slate-500",icon:h.jsx(Mh,{className:"w-4 h-4"}),text:"Unknown"}}})();return h.jsxs("div",{className:"min-h-screen bg-slate-900 text-white p-4",children:[h.jsxs("div",{className:"max-w-4xl mx-auto",children:[h.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[h.jsx(et,{variant:"ghost",size:"icon",onClick:()=>t(-1),className:"text-slate-400 hover:text-white hover:bg-slate-800",children:h.jsx(sl,{className:"w-5 h-5"})}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx(Hx,{iconOnly:!0}),h.jsx("h1",{className:"text-3xl font-bold",children:n?`Calibrate "${n}"`:"Device Calibration"})]})]}),!n&&h.jsxs(Mi,{className:"mb-6 bg-amber-900/40 border-amber-700 text-amber-100",children:[h.jsx(td,{className:"h-4 w-4"}),h.jsx(Ai,{children:"Open Calibration from a robot's gear icon on the Landing page. Each robot has its own calibration; running this page directly is not supported."})]}),h.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[h.jsxs(Gr,{className:"bg-slate-800/60 border-slate-700 backdrop-blur-sm",children:[h.jsx(jo,{children:h.jsxs(ha,{className:"flex items-center gap-2 text-slate-200",children:[h.jsx(Mh,{className:"w-5 h-5 text-blue-400"}),"Configuration"]})}),h.jsxs(Wr,{className:"space-y-6",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(Nt,{htmlFor:"deviceType",className:"text-sm font-medium text-slate-300",children:"Device Type *"}),h.jsxs(Zs,{value:s,onValueChange:U,children:[h.jsx(Wa,{className:"bg-slate-700 border-slate-600 text-white rounded-md",children:h.jsx(Qs,{placeholder:"Select device type"})}),h.jsxs(Xa,{className:"bg-slate-800 border-slate-700 text-white",children:[h.jsx(_n,{value:"teleop",className:"hover:bg-slate-700",children:"Teleoperator (Leader)"}),h.jsx(_n,{value:"robot",className:"hover:bg-slate-700",children:"Robot (Follower)"})]})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(Nt,{htmlFor:"port",className:"text-sm font-medium text-slate-300",children:"Port *"}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx(hi,{id:"port",value:c,onChange:K=>u(K.target.value),placeholder:"/dev/tty.usbmodem...",className:"bg-slate-700 border-slate-600 text-white rounded-md flex-1"}),h.jsx(bse,{onClick:O,robotType:s==="robot"?"follower":"leader",className:"border-slate-600 hover:border-blue-500 text-slate-400 hover:text-blue-400 bg-slate-700 hover:bg-slate-600"})]})]}),h.jsx(Yl,{className:"bg-slate-700"}),h.jsx("div",{className:"flex flex-col gap-3",children:E.calibration_active?h.jsxs(et,{onClick:D,variant:"destructive",className:"w-full rounded-full py-6 text-lg",children:[h.jsx(Od,{className:"w-5 h-5 mr-2"}),"Cancel Calibration"]}):h.jsxs(et,{onClick:R,className:"w-full bg-blue-600 hover:bg-blue-700 text-white rounded-full py-6 text-lg",disabled:!n||!s||!c,children:[h.jsx(Tc,{className:"w-5 h-5 mr-2"}),"Start Calibration"]})}),d&&h.jsxs("div",{className:"space-y-2 pt-2",children:[h.jsx("div",{className:"text-sm font-medium text-slate-300",children:"Robot calibration"}),h.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[d.leader_config?h.jsx(qi,{className:"w-4 h-4 text-green-400"}):h.jsx(uE,{className:"w-4 h-4 text-slate-500"}),h.jsx("span",{className:d.leader_config?"text-slate-200":"text-slate-400",children:"Leader (Teleoperator)"})]}),h.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[d.follower_config?h.jsx(qi,{className:"w-4 h-4 text-green-400"}):h.jsx(uE,{className:"w-4 h-4 text-slate-500"}),h.jsx("span",{className:d.follower_config?"text-slate-200":"text-slate-400",children:"Follower (Robot)"})]})]})]})]}),h.jsxs(Gr,{className:"bg-slate-800/60 border-slate-700 backdrop-blur-sm",children:[h.jsx(jo,{children:h.jsxs(ha,{className:"flex items-center gap-2 text-slate-200",children:[h.jsx($u,{className:"w-5 h-5 text-teal-400"}),"Status"]})}),h.jsxs(Wr,{className:"space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between p-3 bg-slate-900/50 rounded-md",children:[h.jsx("span",{className:"text-slate-300",children:"Status:"}),h.jsxs(b1,{className:`${j.color} text-white rounded-md`,children:[j.icon,h.jsx("span",{className:"ml-2",children:j.text})]})]}),E.status==="recording"&&E.recorded_ranges&&h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx($u,{className:"w-4 h-4 text-purple-400"}),h.jsx("span",{className:"text-sm font-medium text-slate-300",children:"Live Position Data"})]}),h.jsx("div",{className:"bg-slate-800 rounded-lg p-4 border border-slate-700",children:h.jsx("div",{className:"space-y-3",children:Object.entries(E.recorded_ranges).map(([K,F])=>{const Y=F.max-F.min,q=F.current-F.min,Q=Y>0?q/Y*100:50,te=y2(E.device_type,K,Y);return h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-white font-semibold text-sm",children:K}),te&&h.jsx(qi,{className:"w-4 h-4 text-green-400","aria-label":"Range complete"})]}),h.jsx("span",{className:"text-slate-300 text-xs font-mono",children:F.current})]}),h.jsxs("div",{className:"relative",children:[h.jsx("div",{className:"w-full bg-slate-700 rounded-full h-3",children:h.jsx("div",{className:"bg-slate-600 h-3 rounded-full relative",style:{width:"100%"},children:h.jsx("div",{className:`absolute top-0 w-1 h-3 rounded-full transition-all duration-100 ${te?"bg-green-400":"bg-yellow-400"}`,style:{left:`${Math.max(0,Math.min(100,Q))}%`,transform:"translateX(-50%)"}})})}),h.jsxs("div",{className:"flex justify-between text-xs text-slate-400 mt-1",children:[h.jsx("span",{children:F.min}),h.jsx("span",{children:F.max})]})]})]},K)})})})]}),E.status==="connecting"&&h.jsxs(Mi,{className:"bg-yellow-900/50 border-yellow-700 text-yellow-200",children:[h.jsx(td,{className:"h-4 w-4"}),h.jsx(Ai,{children:"Connecting to the device. Please ensure it's connected."})]}),E.status==="recording"&&(()=>{const K=E.recorded_ranges??{},F=Object.entries(K),Y=F.length>0&&F.every(([q,Q])=>y2(E.device_type,q,Q.max-Q.min));return h.jsxs("div",{className:"space-y-3",children:[h.jsx("div",{className:"flex justify-center",children:h.jsxs(et,{onClick:k,disabled:!E.calibration_active,className:`px-8 py-3 rounded-full transition-colors ${Y?"bg-green-600 hover:bg-green-700":"bg-orange-500 hover:bg-orange-600"}`,children:[Y?h.jsx(qi,{className:"w-4 h-4 mr-2"}):h.jsx(td,{className:"w-4 h-4 mr-2"}),"Save Calibration"]})}),h.jsxs(Mi,{className:"bg-purple-900/50 border-purple-700 text-purple-200",children:[h.jsx($u,{className:"h-4 w-4"}),h.jsxs(Ai,{children:[h.jsx("strong",{children:"Important:"})," Move EACH joint through its full range. A check appears next to each joint once its range is wide enough."]})]})]})})(),E.status==="completed"&&h.jsxs(Mi,{className:"bg-green-900/50 border-green-700 text-green-200",children:[h.jsx(qi,{className:"h-4 w-4"}),h.jsx(Ai,{children:"Calibration completed successfully!"})]}),E.status==="error"&&E.error&&(E.error.startsWith(x2)?h.jsxs(Mi,{className:"bg-red-900/50 border-red-700 text-red-200",children:[h.jsx(nd,{className:"h-4 w-4"}),h.jsxs(Ai,{children:[h.jsx("div",{className:"font-semibold text-base mb-1",children:"Motor discontinuity detected"}),h.jsx("div",{children:"Make sure to start the calibration with the robot in a middle position โ€” all joints in the middle of their ranges. See the calibration demo below for the correct starting pose."})]})]}):h.jsxs(Mi,{className:"bg-red-900/50 border-red-700 text-red-200",children:[h.jsx(nd,{className:"h-4 w-4"}),h.jsxs(Ai,{children:[h.jsx("strong",{children:"Error:"})," ",E.error]})]})),h.jsxs("div",{ref:a,className:"bg-slate-900/50 p-4 rounded-lg border border-slate-700",children:[h.jsx("h4",{className:"font-semibold mb-3 text-slate-200",children:"Calibration Demo:"}),h.jsx("div",{className:"relative rounded-lg overflow-hidden bg-slate-800",children:h.jsxs("video",{className:"w-full h-auto rounded-md",controls:!0,preload:"auto",muted:!0,children:[h.jsx("source",{src:"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/lerobot/calibrate_so101_2.mp4",type:"video/mp4"}),h.jsxs("p",{className:"text-slate-400 text-sm text-center py-4",children:["Your browser does not support the video tag.",h.jsx("br",{}),h.jsx("a",{href:"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/lerobot/calibrate_so101_2.mp4",className:"text-blue-400 hover:text-blue-300 underline",target:"_blank",rel:"noopener noreferrer",children:"Click here to view the calibration video"})]})]})})]})]})]})]}),n&&h.jsxs(Gr,{className:"bg-slate-800/60 border-slate-700 backdrop-blur-sm mt-6",children:[h.jsx(jo,{children:h.jsxs(ha,{className:"flex items-center gap-2 text-slate-200",children:[h.jsx(Mh,{className:"w-5 h-5 text-blue-400"}),"Attached cameras"]})}),h.jsx(Wr,{children:h.jsx(f4,{cameras:p,onCamerasChange:m})})]})]}),h.jsx(wse,{open:x,onOpenChange:b,robotType:S,onPortDetected:W})]})};var Ow="rovingFocusGroup.onEntryFocus",Cse={bubbles:!1,cancelable:!0},Lm="RovingFocusGroup",[_1,c$,Pse]=tx(Lm),[Rse,u$]=mi(Lm,[Pse]),[Nse,Ose]=Rse(Lm),d$=_.forwardRef((t,e)=>h.jsx(_1.Provider,{scope:t.__scopeRovingFocusGroup,children:h.jsx(_1.Slot,{scope:t.__scopeRovingFocusGroup,children:h.jsx(Ise,{...t,ref:e})})}));d$.displayName=Lm;var Ise=_.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=t,f=_.useRef(null),p=Ot(e,f),y=IA(o),[v,g]=$o({prop:a,defaultProp:s??null,onChange:l,caller:Lm}),[m,x]=_.useState(!1),b=di(c),S=c$(n),w=_.useRef(!1),[E,T]=_.useState(0);return _.useEffect(()=>{const A=f.current;if(A)return A.addEventListener(Ow,b),()=>A.removeEventListener(Ow,b)},[b]),h.jsx(Nse,{scope:n,orientation:r,dir:y,loop:i,currentTabStopId:v,onItemFocus:_.useCallback(A=>g(A),[g]),onItemShiftTab:_.useCallback(()=>x(!0),[]),onFocusableItemAdd:_.useCallback(()=>T(A=>A+1),[]),onFocusableItemRemove:_.useCallback(()=>T(A=>A-1),[]),children:h.jsx(nt.div,{tabIndex:m||E===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:"none",...t.style},onMouseDown:Oe(t.onMouseDown,()=>{w.current=!0}),onFocus:Oe(t.onFocus,A=>{const M=!w.current;if(A.target===A.currentTarget&&M&&!m){const C=new CustomEvent(Ow,Cse);if(A.currentTarget.dispatchEvent(C),!C.defaultPrevented){const P=S().filter(O=>O.focusable),R=P.find(O=>O.active),D=P.find(O=>O.id===v),U=[R,D,...P].filter(Boolean).map(O=>O.ref.current);p$(U,u)}}w.current=!1}),onBlur:Oe(t.onBlur,()=>x(!1))})})}),f$="RovingFocusGroupItem",h$=_.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,children:a,...s}=t,l=sr(),c=o||l,u=Ose(f$,n),d=u.currentTabStopId===c,f=c$(n),{onFocusableItemAdd:p,onFocusableItemRemove:y,currentTabStopId:v}=u;return _.useEffect(()=>{if(r)return p(),()=>y()},[r,p,y]),h.jsx(_1.ItemSlot,{scope:n,id:c,focusable:r,active:i,children:h.jsx(nt.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:e,onMouseDown:Oe(t.onMouseDown,g=>{r?u.onItemFocus(c):g.preventDefault()}),onFocus:Oe(t.onFocus,()=>u.onItemFocus(c)),onKeyDown:Oe(t.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){u.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const m=kse(g,u.orientation,u.dir);if(m!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let b=f().filter(S=>S.focusable).map(S=>S.ref.current);if(m==="last")b.reverse();else if(m==="prev"||m==="next"){m==="prev"&&b.reverse();const S=b.indexOf(g.currentTarget);b=u.loop?jse(b,S+1):b.slice(S+1)}setTimeout(()=>p$(b))}}),children:typeof a=="function"?a({isCurrentTabStop:d,hasTabStop:v!=null}):a})})});h$.displayName=f$;var Dse={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Lse(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function kse(t,e,n){const r=Lse(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Dse[r]}function p$(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function jse(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var Use=d$,Fse=h$,w1=["Enter"," "],Bse=["ArrowDown","PageUp","Home"],m$=["ArrowUp","PageDown","End"],$se=[...Bse,...m$],zse={ltr:[...w1,"ArrowRight"],rtl:[...w1,"ArrowLeft"]},Hse={ltr:["ArrowLeft"],rtl:["ArrowRight"]},km="Menu",[Rp,Vse,Gse]=tx(km),[Wc,g$]=mi(km,[Gse,Sl,u$]),Vx=Sl(),v$=u$(),[Wse,Xc]=Wc(km),[Xse,jm]=Wc(km),y$=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:i,onOpenChange:o,modal:a=!0}=t,s=Vx(e),[l,c]=_.useState(null),u=_.useRef(!1),d=di(o),f=IA(i);return _.useEffect(()=>{const p=()=>{u.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>u.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),h.jsx(px,{...s,children:h.jsx(Wse,{scope:e,open:n,onOpenChange:d,content:l,onContentChange:c,children:h.jsx(Xse,{scope:e,onClose:_.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:a,children:r})})})};y$.displayName=km;var qse="MenuAnchor",lC=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,i=Vx(n);return h.jsx(Am,{...i,...r,ref:e})});lC.displayName=qse;var cC="MenuPortal",[Kse,x$]=Wc(cC,{forceMount:void 0}),b$=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:i}=t,o=Xc(cC,e);return h.jsx(Kse,{scope:e,forceMount:n,children:h.jsx(gi,{present:n||o.open,children:h.jsx(vf,{asChild:!0,container:i,children:r})})})};b$.displayName=cC;var to="MenuContent",[Yse,uC]=Wc(to),_$=_.forwardRef((t,e)=>{const n=x$(to,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,o=Xc(to,t.__scopeMenu),a=jm(to,t.__scopeMenu);return h.jsx(Rp.Provider,{scope:t.__scopeMenu,children:h.jsx(gi,{present:r||o.open,children:h.jsx(Rp.Slot,{scope:t.__scopeMenu,children:a.modal?h.jsx(Jse,{...i,ref:e}):h.jsx(Zse,{...i,ref:e})})})})}),Jse=_.forwardRef((t,e)=>{const n=Xc(to,t.__scopeMenu),r=_.useRef(null),i=Ot(e,r);return _.useEffect(()=>{const o=r.current;if(o)return sx(o)},[]),h.jsx(dC,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Oe(t.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Zse=_.forwardRef((t,e)=>{const n=Xc(to,t.__scopeMenu);return h.jsx(dC,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Qse=al("MenuContent.ScrollLock"),dC=_.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:y,...v}=t,g=Xc(to,n),m=jm(to,n),x=Vx(n),b=v$(n),S=Vse(n),[w,E]=_.useState(null),T=_.useRef(null),A=Ot(e,T,g.onContentChange),M=_.useRef(0),C=_.useRef(""),P=_.useRef(0),R=_.useRef(null),D=_.useRef("right"),k=_.useRef(0),U=y?Tm:_.Fragment,O=y?{as:Qse,allowPinchZoom:!0}:void 0,W=j=>{var ee,ce;const X=C.current+j,K=S().filter(ae=>!ae.disabled),F=document.activeElement,Y=(ee=K.find(ae=>ae.ref.current===F))==null?void 0:ee.textValue,q=K.map(ae=>ae.textValue),Q=dle(q,X,Y),te=(ce=K.find(ae=>ae.textValue===Q))==null?void 0:ce.ref.current;(function ae(fe){C.current=fe,window.clearTimeout(M.current),fe!==""&&(M.current=window.setTimeout(()=>ae(""),1e3))})(X),te&&setTimeout(()=>te.focus())};_.useEffect(()=>()=>window.clearTimeout(M.current),[]),ox();const L=_.useCallback(j=>{var K,F;return D.current===((K=R.current)==null?void 0:K.side)&&hle(j,(F=R.current)==null?void 0:F.area)},[]);return h.jsx(Yse,{scope:n,searchRef:C,onItemEnter:_.useCallback(j=>{L(j)&&j.preventDefault()},[L]),onItemLeave:_.useCallback(j=>{var X;L(j)||((X=T.current)==null||X.focus(),E(null))},[L]),onTriggerLeave:_.useCallback(j=>{L(j)&&j.preventDefault()},[L]),pointerGraceTimerRef:P,onPointerGraceIntentChange:_.useCallback(j=>{R.current=j},[]),children:h.jsx(U,{...O,children:h.jsx(Em,{asChild:!0,trapped:i,onMountAutoFocus:Oe(o,j=>{var X;j.preventDefault(),(X=T.current)==null||X.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:h.jsx(zc,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:h.jsx(Use,{asChild:!0,...b,dir:m.dir,orientation:"vertical",loop:r,currentTabStopId:w,onCurrentTabStopIdChange:E,onEntryFocus:Oe(l,j=>{m.isUsingKeyboardRef.current||j.preventDefault()}),preventScrollOnEntryFocus:!0,children:h.jsx(mx,{role:"menu","aria-orientation":"vertical","data-state":j$(g.open),"data-radix-menu-content":"",dir:m.dir,...x,...v,ref:A,style:{outline:"none",...v.style},onKeyDown:Oe(v.onKeyDown,j=>{const K=j.target.closest("[data-radix-menu-content]")===j.currentTarget,F=j.ctrlKey||j.altKey||j.metaKey,Y=j.key.length===1;K&&(j.key==="Tab"&&j.preventDefault(),!F&&Y&&W(j.key));const q=T.current;if(j.target!==q||!$se.includes(j.key))return;j.preventDefault();const te=S().filter(ee=>!ee.disabled).map(ee=>ee.ref.current);m$.includes(j.key)&&te.reverse(),cle(te)}),onBlur:Oe(t.onBlur,j=>{j.currentTarget.contains(j.target)||(window.clearTimeout(M.current),C.current="")}),onPointerMove:Oe(t.onPointerMove,Np(j=>{const X=j.target,K=k.current!==j.clientX;if(j.currentTarget.contains(X)&&K){const F=j.clientX>k.current?"right":"left";D.current=F,k.current=j.clientX}}))})})})})})})});_$.displayName=to;var ele="MenuGroup",fC=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return h.jsx(nt.div,{role:"group",...r,ref:e})});fC.displayName=ele;var tle="MenuLabel",w$=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return h.jsx(nt.div,{...r,ref:e})});w$.displayName=tle;var Iy="MenuItem",b2="menu.itemSelect",Gx=_.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...i}=t,o=_.useRef(null),a=jm(Iy,t.__scopeMenu),s=uC(Iy,t.__scopeMenu),l=Ot(e,o),c=_.useRef(!1),u=()=>{const d=o.current;if(!n&&d){const f=new CustomEvent(b2,{bubbles:!0,cancelable:!0});d.addEventListener(b2,p=>r==null?void 0:r(p),{once:!0}),XM(d,f),f.defaultPrevented?c.current=!1:a.onClose()}};return h.jsx(S$,{...i,ref:l,disabled:n,onClick:Oe(t.onClick,u),onPointerDown:d=>{var f;(f=t.onPointerDown)==null||f.call(t,d),c.current=!0},onPointerUp:Oe(t.onPointerUp,d=>{var f;c.current||(f=d.currentTarget)==null||f.click()}),onKeyDown:Oe(t.onKeyDown,d=>{const f=s.searchRef.current!=="";n||f&&d.key===" "||w1.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});Gx.displayName=Iy;var S$=_.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=t,a=uC(Iy,n),s=v$(n),l=_.useRef(null),c=Ot(e,l),[u,d]=_.useState(!1),[f,p]=_.useState("");return _.useEffect(()=>{const y=l.current;y&&p((y.textContent??"").trim())},[o.children]),h.jsx(Rp.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:h.jsx(Fse,{asChild:!0,...s,focusable:!r,children:h.jsx(nt.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:c,onPointerMove:Oe(t.onPointerMove,Np(y=>{r?a.onItemLeave(y):(a.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Oe(t.onPointerLeave,Np(y=>a.onItemLeave(y))),onFocus:Oe(t.onFocus,()=>d(!0)),onBlur:Oe(t.onBlur,()=>d(!1))})})})}),nle="MenuCheckboxItem",E$=_.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...i}=t;return h.jsx(P$,{scope:t.__scopeMenu,checked:n,children:h.jsx(Gx,{role:"menuitemcheckbox","aria-checked":Dy(n)?"mixed":n,...i,ref:e,"data-state":pC(n),onSelect:Oe(i.onSelect,()=>r==null?void 0:r(Dy(n)?!0:!n),{checkForDefaultPrevented:!1})})})});E$.displayName=nle;var T$="MenuRadioGroup",[rle,ile]=Wc(T$,{value:void 0,onValueChange:()=>{}}),M$=_.forwardRef((t,e)=>{const{value:n,onValueChange:r,...i}=t,o=di(r);return h.jsx(rle,{scope:t.__scopeMenu,value:n,onValueChange:o,children:h.jsx(fC,{...i,ref:e})})});M$.displayName=T$;var A$="MenuRadioItem",C$=_.forwardRef((t,e)=>{const{value:n,...r}=t,i=ile(A$,t.__scopeMenu),o=n===i.value;return h.jsx(P$,{scope:t.__scopeMenu,checked:o,children:h.jsx(Gx,{role:"menuitemradio","aria-checked":o,...r,ref:e,"data-state":pC(o),onSelect:Oe(r.onSelect,()=>{var a;return(a=i.onValueChange)==null?void 0:a.call(i,n)},{checkForDefaultPrevented:!1})})})});C$.displayName=A$;var hC="MenuItemIndicator",[P$,ole]=Wc(hC,{checked:!1}),R$=_.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...i}=t,o=ole(hC,n);return h.jsx(gi,{present:r||Dy(o.checked)||o.checked===!0,children:h.jsx(nt.span,{...i,ref:e,"data-state":pC(o.checked)})})});R$.displayName=hC;var ale="MenuSeparator",N$=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return h.jsx(nt.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});N$.displayName=ale;var sle="MenuArrow",O$=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,i=Vx(n);return h.jsx(gx,{...i,...r,ref:e})});O$.displayName=sle;var lle="MenuSub",[SDe,I$]=Wc(lle),Oh="MenuSubTrigger",D$=_.forwardRef((t,e)=>{const n=Xc(Oh,t.__scopeMenu),r=jm(Oh,t.__scopeMenu),i=I$(Oh,t.__scopeMenu),o=uC(Oh,t.__scopeMenu),a=_.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:l}=o,c={__scopeMenu:t.__scopeMenu},u=_.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return _.useEffect(()=>u,[u]),_.useEffect(()=>{const d=s.current;return()=>{window.clearTimeout(d),l(null)}},[s,l]),h.jsx(lC,{asChild:!0,...c,children:h.jsx(S$,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":j$(n.open),...t,ref:ts(e,i.onTriggerChange),onClick:d=>{var f;(f=t.onClick)==null||f.call(t,d),!(t.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Oe(t.onPointerMove,Np(d=>{o.onItemEnter(d),!d.defaultPrevented&&!t.disabled&&!n.open&&!a.current&&(o.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:Oe(t.onPointerLeave,Np(d=>{var p,y;u();const f=(p=n.content)==null?void 0:p.getBoundingClientRect();if(f){const v=(y=n.content)==null?void 0:y.dataset.side,g=v==="right",m=g?-5:5,x=f[g?"left":"right"],b=f[g?"right":"left"];o.onPointerGraceIntentChange({area:[{x:d.clientX+m,y:d.clientY},{x,y:f.top},{x:b,y:f.top},{x:b,y:f.bottom},{x,y:f.bottom}],side:v}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(d),d.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Oe(t.onKeyDown,d=>{var p;const f=o.searchRef.current!=="";t.disabled||f&&d.key===" "||zse[r.dir].includes(d.key)&&(n.onOpenChange(!0),(p=n.content)==null||p.focus(),d.preventDefault())})})})});D$.displayName=Oh;var L$="MenuSubContent",k$=_.forwardRef((t,e)=>{const n=x$(to,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,o=Xc(to,t.__scopeMenu),a=jm(to,t.__scopeMenu),s=I$(L$,t.__scopeMenu),l=_.useRef(null),c=Ot(e,l);return h.jsx(Rp.Provider,{scope:t.__scopeMenu,children:h.jsx(gi,{present:r||o.open,children:h.jsx(Rp.Slot,{scope:t.__scopeMenu,children:h.jsx(dC,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:c,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var d;a.isUsingKeyboardRef.current&&((d=l.current)==null||d.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:Oe(t.onFocusOutside,u=>{u.target!==s.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Oe(t.onEscapeKeyDown,u=>{a.onClose(),u.preventDefault()}),onKeyDown:Oe(t.onKeyDown,u=>{var p;const d=u.currentTarget.contains(u.target),f=Hse[a.dir].includes(u.key);d&&f&&(o.onOpenChange(!1),(p=s.trigger)==null||p.focus(),u.preventDefault())})})})})})});k$.displayName=L$;function j$(t){return t?"open":"closed"}function Dy(t){return t==="indeterminate"}function pC(t){return Dy(t)?"indeterminate":t?"checked":"unchecked"}function cle(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function ule(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function dle(t,e,n){const i=e.length>1&&Array.from(e).every(c=>c===e[0])?e[0]:e,o=n?t.indexOf(n):-1;let a=ule(t,Math.max(o,0));i.length===1&&(a=a.filter(c=>c!==n));const l=a.find(c=>c.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function fle(t,e){const{x:n,y:r}=t;let i=!1;for(let o=0,a=e.length-1;or!=f>r&&n<(d-c)*(r-u)/(f-u)+c&&(i=!i)}return i}function hle(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return fle(n,e)}function Np(t){return e=>e.pointerType==="mouse"?t(e):void 0}var ple=y$,mle=lC,gle=b$,vle=_$,yle=fC,xle=w$,ble=Gx,_le=E$,wle=M$,Sle=C$,Ele=R$,Tle=N$,Mle=O$,Ale=D$,Cle=k$,Wx="DropdownMenu",[Ple,EDe]=mi(Wx,[g$]),Zr=g$(),[Rle,U$]=Ple(Wx),F$=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:i,defaultOpen:o,onOpenChange:a,modal:s=!0}=t,l=Zr(e),c=_.useRef(null),[u,d]=$o({prop:i,defaultProp:o??!1,onChange:a,caller:Wx});return h.jsx(Rle,{scope:e,triggerId:sr(),triggerRef:c,contentId:sr(),open:u,onOpenChange:d,onOpenToggle:_.useCallback(()=>d(f=>!f),[d]),modal:s,children:h.jsx(ple,{...l,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};F$.displayName=Wx;var B$="DropdownMenuTrigger",$$=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=t,o=U$(B$,n),a=Zr(n);return h.jsx(mle,{asChild:!0,...a,children:h.jsx(nt.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:ts(e,o.triggerRef),onPointerDown:Oe(t.onPointerDown,s=>{!r&&s.button===0&&s.ctrlKey===!1&&(o.onOpenToggle(),o.open||s.preventDefault())}),onKeyDown:Oe(t.onKeyDown,s=>{r||(["Enter"," "].includes(s.key)&&o.onOpenToggle(),s.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})})});$$.displayName=B$;var Nle="DropdownMenuPortal",z$=t=>{const{__scopeDropdownMenu:e,...n}=t,r=Zr(e);return h.jsx(gle,{...r,...n})};z$.displayName=Nle;var H$="DropdownMenuContent",V$=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=U$(H$,n),o=Zr(n),a=_.useRef(!1);return h.jsx(vle,{id:i.contentId,"aria-labelledby":i.triggerId,...o,...r,ref:e,onCloseAutoFocus:Oe(t.onCloseAutoFocus,s=>{var l;a.current||(l=i.triggerRef.current)==null||l.focus(),a.current=!1,s.preventDefault()}),onInteractOutside:Oe(t.onInteractOutside,s=>{const l=s.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;(!i.modal||u)&&(a.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});V$.displayName=H$;var Ole="DropdownMenuGroup",Ile=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(yle,{...i,...r,ref:e})});Ile.displayName=Ole;var Dle="DropdownMenuLabel",G$=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(xle,{...i,...r,ref:e})});G$.displayName=Dle;var Lle="DropdownMenuItem",W$=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(ble,{...i,...r,ref:e})});W$.displayName=Lle;var kle="DropdownMenuCheckboxItem",X$=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(_le,{...i,...r,ref:e})});X$.displayName=kle;var jle="DropdownMenuRadioGroup",Ule=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(wle,{...i,...r,ref:e})});Ule.displayName=jle;var Fle="DropdownMenuRadioItem",q$=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(Sle,{...i,...r,ref:e})});q$.displayName=Fle;var Ble="DropdownMenuItemIndicator",K$=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(Ele,{...i,...r,ref:e})});K$.displayName=Ble;var $le="DropdownMenuSeparator",Y$=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(Tle,{...i,...r,ref:e})});Y$.displayName=$le;var zle="DropdownMenuArrow",Hle=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(Mle,{...i,...r,ref:e})});Hle.displayName=zle;var Vle="DropdownMenuSubTrigger",J$=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(Ale,{...i,...r,ref:e})});J$.displayName=Vle;var Gle="DropdownMenuSubContent",Z$=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(Cle,{...i,...r,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Z$.displayName=Gle;var Wle=F$,Xle=$$,qle=z$,Q$=V$,ez=G$,tz=W$,nz=X$,rz=q$,iz=K$,oz=Y$,az=J$,sz=Z$;const Kle=Wle,Yle=Xle,Jle=_.forwardRef(({className:t,inset:e,children:n,...r},i)=>h.jsxs(az,{ref:i,className:He("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",e&&"pl-8",t),...r,children:[n,h.jsx(xp,{className:"ml-auto h-4 w-4"})]}));Jle.displayName=az.displayName;const Zle=_.forwardRef(({className:t,...e},n)=>h.jsx(sz,{ref:n,className:He("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...e}));Zle.displayName=sz.displayName;const lz=_.forwardRef(({className:t,sideOffset:e=4,...n},r)=>h.jsx(qle,{children:h.jsx(Q$,{ref:r,sideOffset:e,className:He("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n})}));lz.displayName=Q$.displayName;const S1=_.forwardRef(({className:t,inset:e,...n},r)=>h.jsx(tz,{ref:r,className:He("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e&&"pl-8",t),...n}));S1.displayName=tz.displayName;const Qle=_.forwardRef(({className:t,children:e,checked:n,...r},i)=>h.jsxs(nz,{ref:i,className:He("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:n,...r,children:[h.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:h.jsx(iz,{children:h.jsx(yl,{className:"h-4 w-4"})})}),e]}));Qle.displayName=nz.displayName;const ece=_.forwardRef(({className:t,children:e,...n},r)=>h.jsxs(rz,{ref:r,className:He("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[h.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:h.jsx(iz,{children:h.jsx(uE,{className:"h-2 w-2 fill-current"})})}),e]}));ece.displayName=rz.displayName;const tce=_.forwardRef(({className:t,inset:e,...n},r)=>h.jsx(ez,{ref:r,className:He("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...n}));tce.displayName=ez.displayName;const nce=_.forwardRef(({className:t,...e},n)=>h.jsx(oz,{ref:n,className:He("-mx-1 my-1 h-px bg-muted",t),...e}));nce.displayName=oz.displayName;const cz="lelab.recording.muted";let Iw=null;const rce=()=>(Iw||(Iw=new AudioContext),Iw),uz=()=>localStorage.getItem(cz)==="1",ice=t=>{localStorage.setItem(cz,t?"1":"0")},gc=(t,e,n=0)=>{if(uz())return;const r=rce(),i=r.createOscillator(),o=r.createGain();i.frequency.value=t,i.type="sine",o.gain.value=0,i.connect(o),o.connect(r.destination);const a=r.currentTime+n/1e3,s=a+e/1e3;o.gain.setValueAtTime(0,a),o.gain.linearRampToValueAtTime(.2,a+.01),o.gain.setValueAtTime(.2,s-.02),o.gain.linearRampToValueAtTime(0,s),i.start(a),i.stop(s)},oce=()=>{gc(660,80,0),gc(880,80,90)},ace=()=>{gc(660,80,0),gc(440,80,90)},sce=()=>{gc(880,70,0),gc(880,70,1e3),gc(880,70,2e3)};var dz="AlertDialog",[lce,TDe]=mi(dz,[rF]),cs=rF(),fz=t=>{const{__scopeAlertDialog:e,...n}=t,r=cs(e);return h.jsx(lA,{...r,...n,modal:!0})};fz.displayName=dz;var cce="AlertDialogTrigger",uce=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=cs(n);return h.jsx(Kq,{...i,...r,ref:e})});uce.displayName=cce;var dce="AlertDialogPortal",hz=t=>{const{__scopeAlertDialog:e,...n}=t,r=cs(e);return h.jsx(cA,{...r,...n})};hz.displayName=dce;var fce="AlertDialogOverlay",pz=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=cs(n);return h.jsx(cx,{...i,...r,ref:e})});pz.displayName=fce;var dd="AlertDialogContent",[hce,pce]=lce(dd),mce=aU("AlertDialogContent"),mz=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,children:r,...i}=t,o=cs(n),a=_.useRef(null),s=Ot(e,a),l=_.useRef(null);return h.jsx(Gq,{contentName:dd,titleName:gz,docsSlug:"alert-dialog",children:h.jsx(hce,{scope:n,cancelRef:l,children:h.jsxs(ux,{role:"alertdialog",...o,...i,ref:s,onOpenAutoFocus:Oe(i.onOpenAutoFocus,c=>{var u;c.preventDefault(),(u=l.current)==null||u.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[h.jsx(mce,{children:r}),h.jsx(vce,{contentRef:a})]})})})});mz.displayName=dd;var gz="AlertDialogTitle",vz=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=cs(n);return h.jsx(uA,{...i,...r,ref:e})});vz.displayName=gz;var yz="AlertDialogDescription",xz=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=cs(n);return h.jsx(dA,{...i,...r,ref:e})});xz.displayName=yz;var gce="AlertDialogAction",bz=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=cs(n);return h.jsx(fA,{...i,...r,ref:e})});bz.displayName=gce;var _z="AlertDialogCancel",wz=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,{cancelRef:i}=pce(_z,n),o=cs(n),a=Ot(e,i);return h.jsx(fA,{...o,...r,ref:a})});wz.displayName=_z;var vce=({contentRef:t})=>{const e=`\`${dd}\` requires a description for the component to be accessible for screen reader users. + +You can add a description to the \`${dd}\` by passing a \`${yz}\` component as a child, which also benefits sighted users by adding visible context to the dialog. + +Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${dd}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. + +For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return _.useEffect(()=>{var r;document.getElementById((r=t.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(e)},[e,t]),null},yce=fz,xce=hz,Sz=pz,Ez=mz,Tz=bz,Mz=wz,Az=vz,Cz=xz;const mC=yce,bce=xce,Pz=_.forwardRef(({className:t,...e},n)=>h.jsx(Sz,{className:He("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e,ref:n}));Pz.displayName=Sz.displayName;const Xx=_.forwardRef(({className:t,...e},n)=>h.jsxs(bce,{children:[h.jsx(Pz,{}),h.jsx(Ez,{ref:n,className:He("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...e})]}));Xx.displayName=Ez.displayName;const qx=({className:t,...e})=>h.jsx("div",{className:He("flex flex-col space-y-2 text-center sm:text-left",t),...e});qx.displayName="AlertDialogHeader";const Kx=({className:t,...e})=>h.jsx("div",{className:He("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});Kx.displayName="AlertDialogFooter";const Yx=_.forwardRef(({className:t,...e},n)=>h.jsx(Az,{ref:n,className:He("text-lg font-semibold",t),...e}));Yx.displayName=Az.displayName;const Jx=_.forwardRef(({className:t,...e},n)=>h.jsx(Cz,{ref:n,className:He("text-sm text-muted-foreground",t),...e}));Jx.displayName=Cz.displayName;const Zx=_.forwardRef(({className:t,...e},n)=>h.jsx(Tz,{ref:n,className:He(iA(),t),...e}));Zx.displayName=Tz.displayName;const Qx=_.forwardRef(({className:t,...e},n)=>h.jsx(Mz,{ref:n,className:He(iA({variant:"outline"}),"mt-2 sm:mt-0",t),...e}));Qx.displayName=Mz.displayName;const _ce=()=>{var le;const t=vl(),e=ji(),{toast:n}=Dr(),{baseUrl:r,wsBaseUrl:i,fetchWithHeaders:o}=Ln(),a=(le=t.state)==null?void 0:le.recordingConfig,[s,l]=_.useState(null),[c,u]=_.useState(!1),[d,f]=_.useState(null),[p,y]=_.useState(!1),[v,g]=_.useState(()=>uz()),m=_.useRef(null),[x,b]=_.useState(0),S=_.useRef({phase:null,episode:null,tick:0}),w=_.useRef(!1),E=_.useRef(!1),T=_.useCallback(()=>{g(ie=>{const G=!ie;return ice(G),G})},[]);_.useEffect(()=>{a||(n({title:"No Configuration",description:"Please start recording from the main page.",variant:"destructive"}),e("/"))},[a,e,n]),_.useEffect(()=>{a&&!E.current&&(E.current=!0,P())},[a]);const A=_.useRef(d);A.current=d;const M=_.useRef(x);M.current=x,_.useEffect(()=>{if(!c)return;const ie=async()=>{try{const Ve=await o(`${r}/recording-status`);if(!Ve.ok)return;const Ne=await Ve.json();l(Ne);const st=A.current;st&&Ne.current_phase===st&&f(null);const Re=Ne.current_phase,ct=m.current;ct!==Re&&(Re==="recording"&&ct!==null?oce():Re==="resetting"&&ace(),m.current=Re,S.current={phase:null,episode:null,tick:0});const Ye=Ne.phase_elapsed_seconds||0,it=Ne.phase_time_limit_s||0,Ft=it>3&&Ye>=it-3,J=Ne.current_episode??null,B=M.current,ue=S.current;if(Ft&&st===null&&(ue.phase!==Re||ue.episode!==J||ue.tick!==B)&&(sce(),S.current={phase:Re,episode:J,tick:B}),!Ne.recording_active&&Ne.session_ended&&Ne.current_phase==="error"){w.current||(w.current=!0,u(!1),n({title:"Recording failed",description:Ne.error||Ne.message||"Check the robot connection and try again.",variant:"destructive"}));return}if(!Ne.recording_active&&Ne.session_ended){const me={dataset_repo_id:Ne.dataset_repo_id||a.dataset_repo_id,single_task:a.single_task,num_episodes:a.num_episodes,saved_episodes:Ne.saved_episodes||0,session_elapsed_seconds:Ne.session_elapsed_seconds||0};e("/upload",{state:{datasetInfo:me}})}}catch(Ve){console.error("Error polling recording status:",Ve)}};ie();const G=setInterval(ie,1e3);return()=>clearInterval(G)},[c,a,e,r,o]);const C=ie=>{const G=Math.floor(ie/60),Ve=ie%60;return`${G.toString().padStart(2,"0")}:${Ve.toString().padStart(2,"0")}`},P=async()=>{try{const ie=await o(`${r}/start-recording`,{method:"POST",body:JSON.stringify(a)}),G=await ie.json();ie.ok?(w.current=!1,u(!0),n({title:"Recording Started",description:`Started recording ${a.num_episodes} episodes`})):(n({title:"Error Starting Recording",description:G.message||"Failed to start recording session.",variant:"destructive"}),e("/"))}catch{n({title:"Connection Error",description:"Could not connect to the backend server.",variant:"destructive"}),e("/")}},R=_.useCallback(async()=>{if(!(s!=null&&s.available_controls.exit_early)||d!==null)return;const ie=s.current_phase,G=ie==="recording"?"resetting":ie==="resetting"?"recording":null;if(G){f(G);try{const Ve=await o(`${r}/recording-exit-early`,{method:"POST"});if(!Ve.ok){const Ne=await Ve.json();f(null),n({title:"Error",description:Ne.message,variant:"destructive"})}}catch{f(null),n({title:"Connection Error",description:"Could not connect to the backend server.",variant:"destructive"})}}},[s,d,r,o,n]),D=_.useCallback(async()=>{if(s!=null&&s.available_controls.rerecord_episode)try{const ie=await o(`${r}/recording-rerecord-episode`,{method:"POST"}),G=await ie.json();ie.ok?(b(Ve=>Ve+1),n({title:"Re-recording Episode",description:`Episode ${s.current_episode} will be re-recorded.`})):n({title:"Error",description:G.message,variant:"destructive"})}catch{n({title:"Connection Error",description:"Could not connect to the backend server.",variant:"destructive"})}},[s,r,o,n]),k=_.useCallback(async()=>{if(s!=null&&s.available_controls.stop_recording)try{await o(`${r}/stop-recording`,{method:"POST"}),n({title:"Stopping recording",description:"Finalizing datasetโ€ฆ"})}catch{n({title:"Error",description:"Failed to stop recording.",variant:"destructive"})}},[s,r,o,n]),U=_.useCallback(()=>{s!=null&&s.available_controls.stop_recording&&y(!0)},[s]),O=_.useCallback(async()=>{y(!1),await k()},[k]),W=_.useRef({handleExitEarly:R,handleRerecordEpisode:D,requestStopRecording:U,showStopConfirm:p});_.useEffect(()=>{W.current={handleExitEarly:R,handleRerecordEpisode:D,requestStopRecording:U,showStopConfirm:p}});const L=c&&s!==null;if(_.useEffect(()=>{if(!L)return;const ie=G=>{const Ve=G.target;if(!(Ve&&(Ve.tagName==="INPUT"||Ve.tagName==="TEXTAREA"||Ve.isContentEditable))){if(G.key===" "||G.code==="Space"||G.key==="ArrowRight")G.preventDefault(),W.current.handleExitEarly();else if(G.key==="ArrowLeft")G.preventDefault(),W.current.handleRerecordEpisode();else if(G.key==="Escape"){if(W.current.showStopConfirm)return;W.current.requestStopRecording()}}};return window.addEventListener("keydown",ie),()=>window.removeEventListener("keydown",ie)},[L]),!a)return h.jsx("div",{className:"min-h-screen bg-black text-white flex items-center justify-center",children:h.jsxs("div",{className:"text-center",children:[h.jsx("p",{className:"text-lg",children:"No recording configuration found."}),h.jsx(et,{onClick:()=>e("/"),className:"mt-4",children:"Return to Home"})]})});if(!s)return h.jsx("div",{className:"min-h-screen bg-black text-white flex items-center justify-center",children:h.jsxs("div",{className:"text-center",children:[h.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-red-500 mx-auto mb-4"}),h.jsx("p",{className:"text-lg",children:"Connecting to recording session..."})]})});const j=s.current_phase,X=d??j,K=s.current_episode??1,F=s.total_episodes??a.num_episodes,Y=d?0:s.phase_elapsed_seconds||0,q=X==="recording"?a.episode_time_s:X==="resetting"?a.reset_time_s:s.phase_time_limit_s||0,Q=s.session_elapsed_seconds||0,te=()=>X==="recording"?`RECORDING EPISODE ${K}`:X==="resetting"?"RESET โ€” GET READY":X==="preparing"?"PREPARING SESSION":X==="stopping"?"STOPPING RECORDING":X==="error"?"RECORDING ERROR":"SESSION COMPLETE",ee=X==="recording"?{dot:"bg-red-500",pill:"bg-red-500/15 text-red-300",timer:"text-green-400",bar:"bg-green-500",button:"bg-green-500 hover:bg-green-600"}:X==="resetting"?{dot:"bg-orange-500",pill:"bg-orange-500/15 text-orange-300",timer:"text-orange-400",bar:"bg-orange-500",button:"bg-orange-500 hover:bg-orange-600"}:{dot:"bg-gray-500",pill:"bg-gray-500/15 text-gray-300",timer:"text-gray-400",bar:"bg-gray-500",button:"bg-gray-500"},ce=X==="recording"?"End Episode":X==="resetting"?"Start Next Episode":X==="stopping"?"Stopping...":X==="error"?"Recording failed":"Advance",ae=X==="recording"?eX:Tc,fe=s.available_controls.exit_early&&d===null&&(X==="recording"||X==="resetting"),we=q>0?Math.min(Y/q*100,100):0;return h.jsxs("div",{className:"min-h-screen bg-black text-white p-8",children:[h.jsxs("div",{className:"max-w-2xl mx-auto",children:[h.jsx("div",{className:"mb-8",children:h.jsxs(et,{onClick:()=>e("/"),variant:"outline",className:"border-gray-500 hover:border-gray-200 text-gray-300 hover:text-white",children:[h.jsx(sl,{className:"w-4 h-4 mr-2"}),"Back to Home"]})}),h.jsxs("div",{className:"bg-gray-900 rounded-lg border border-gray-700 p-8",children:[h.jsxs("div",{className:"flex justify-end items-center gap-4 mb-6 text-sm text-gray-400",children:[h.jsxs("span",{"aria-label":`Episode ${K} of ${F}`,children:["Episode ",h.jsx("span",{className:"text-white font-semibold",children:K})," / ",F]}),h.jsx("span",{className:"font-mono","aria-label":`Total session time ${C(Q)}`,children:C(Q)}),h.jsx(et,{variant:"ghost",size:"icon",onClick:T,"aria-label":v?"Unmute":"Mute",className:"h-8 w-8 text-gray-400 hover:text-white hover:bg-gray-800",children:v?h.jsx(rX,{className:"w-5 h-5"}):h.jsx(nX,{className:"w-5 h-5"})}),h.jsxs(Kle,{children:[h.jsx(Yle,{asChild:!0,children:h.jsx(et,{variant:"ghost",size:"icon",className:"h-8 w-8 text-gray-400 hover:text-white hover:bg-gray-800","aria-label":"More actions",children:h.jsx(G7,{className:"w-5 h-5"})})}),h.jsxs(lz,{align:"end",onCloseAutoFocus:ie=>ie.preventDefault(),className:"bg-gray-900 border-gray-700 text-white",children:[h.jsxs(S1,{onClick:D,disabled:!s.available_controls.rerecord_episode,className:"focus:bg-gray-800 focus:text-white",children:[h.jsx(Q7,{className:"w-4 h-4 mr-2"}),"Re-record episode"]}),h.jsxs(S1,{onClick:U,disabled:!s.available_controls.stop_recording,className:"text-red-400 focus:bg-gray-800 focus:text-red-300",children:[h.jsx(Od,{className:"w-4 h-4 mr-2"}),"Stop recording"]})]})]})]}),h.jsx("div",{className:"text-center mb-6",children:h.jsxs("div",{role:"status","aria-live":"polite",className:`inline-flex items-center gap-2 px-3 py-1 rounded-full text-xs font-bold tracking-widest ${ee.pill}`,children:[h.jsx("span",{className:`w-2 h-2 rounded-full ${ee.dot} ${X!=="completed"?"animate-pulse":""}`}),te()]})}),h.jsxs("div",{className:"text-center mb-4",children:[h.jsx("div",{className:`text-7xl font-mono font-bold leading-none ${ee.timer}`,children:C(Y)}),h.jsxs("div",{className:"text-sm text-gray-500 mt-2",children:["/ ",C(q)]})]}),h.jsx("div",{className:"w-full bg-gray-800 rounded-full h-1.5 mb-8",children:h.jsx("div",{className:`h-1.5 rounded-full transition-all duration-500 ${ee.bar}`,style:{width:`${we}%`}})}),h.jsxs(et,{onClick:R,disabled:!fe,className:`w-full text-white font-semibold py-6 text-lg disabled:opacity-50 ${ee.button}`,children:[h.jsx(ae,{className:"w-5 h-5 mr-2"}),ce,(X==="recording"||X==="resetting")&&h.jsx("span",{className:"ml-3 px-2 py-0.5 rounded text-xs font-mono bg-black/30 text-white/70",children:"SPACE / โ†’"})]}),X==="completed"&&h.jsx("p",{className:"text-center text-sm text-gray-400 mt-6",children:"Recording complete โ€” redirecting to uploadโ€ฆ"})]})]}),h.jsx(mC,{open:p,onOpenChange:y,children:h.jsxs(Xx,{className:"bg-gray-900 border-gray-700 text-white",children:[h.jsxs(qx,{children:[h.jsx(Yx,{children:"Stop recording?"}),h.jsx(Jx,{className:"text-gray-400",children:"Saved episodes are kept. The session will end and you'll be taken to the upload page."})]}),h.jsxs(Kx,{children:[h.jsx(Qx,{className:"bg-gray-800 border-gray-700 text-white hover:bg-gray-700",children:"Keep recording"}),h.jsx(Zx,{onClick:O,className:"bg-red-500 hover:bg-red-600 text-white",children:"Stop"})]})]})})]})},Dw=()=>{const t=ji();return h.jsx("div",{className:"flex items-center justify-between mb-8",children:h.jsxs("div",{className:"flex items-center gap-4 text-3xl",children:[h.jsx(et,{variant:"ghost",size:"icon",onClick:()=>t("/"),className:"text-slate-400 hover:bg-slate-800 hover:text-white rounded-lg",children:h.jsx(sl,{className:"w-5 h-5"})}),h.jsx(Hx,{}),h.jsx("h1",{className:"font-bold text-white text-2xl",children:"Training"})]})})};var eb="Switch",[wce,MDe]=mi(eb),[Sce,Ece]=wce(eb),Rz=_.forwardRef((t,e)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:o,required:a,disabled:s,value:l="on",onCheckedChange:c,form:u,...d}=t,[f,p]=_.useState(null),y=Ot(e,b=>p(b)),v=_.useRef(!1),g=f?u||!!f.closest("form"):!0,[m,x]=$o({prop:i,defaultProp:o??!1,onChange:c,caller:eb});return h.jsxs(Sce,{scope:n,checked:m,disabled:s,children:[h.jsx(nt.button,{type:"button",role:"switch","aria-checked":m,"aria-required":a,"data-state":Dz(m),"data-disabled":s?"":void 0,disabled:s,value:l,...d,ref:y,onClick:Oe(t.onClick,b=>{x(S=>!S),g&&(v.current=b.isPropagationStopped(),v.current||b.stopPropagation())})}),g&&h.jsx(Iz,{control:f,bubbles:!v.current,name:r,value:l,checked:m,required:a,disabled:s,form:u,style:{transform:"translateX(-100%)"}})]})});Rz.displayName=eb;var Nz="SwitchThumb",Oz=_.forwardRef((t,e)=>{const{__scopeSwitch:n,...r}=t,i=Ece(Nz,n);return h.jsx(nt.span,{"data-state":Dz(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:e})});Oz.displayName=Nz;var Tce="SwitchBubbleInput",Iz=_.forwardRef(({__scopeSwitch:t,control:e,checked:n,bubbles:r=!0,...i},o)=>{const a=_.useRef(null),s=Ot(a,o),l=MA(n),c=bA(e);return _.useEffect(()=>{const u=a.current;if(!u)return;const d=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(d,"checked").set;if(l!==n&&p){const y=new Event("click",{bubbles:r});p.call(u,n),u.dispatchEvent(y)}},[l,n,r]),h.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...i.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Iz.displayName=Tce;function Dz(t){return t?"checked":"unchecked"}var Lz=Rz,Mce=Oz;const Jl=_.forwardRef(({className:t,...e},n)=>h.jsx(Lz,{className:He("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",t),...e,ref:n,children:h.jsx(Mce,{className:He("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));Jl.displayName=Lz.displayName;const _2=/^[\w.\-]+\/[\w.\-]+$/,Ace=({datasets:t,loading:e,value:n,onChange:r})=>{const[i,o]=Z.useState(!1),[a,s]=Z.useState(!1),[l,c]=Z.useState(""),u=()=>{const y=l.trim();_2.test(y)&&(r(y),s(!1))},d=t.filter(y=>y.source==="local"||y.source==="both"),f=t.filter(y=>y.source==="hub"),p=y=>h.jsxs(kd,{value:y.repo_id,onSelect:()=>{r(y.repo_id),o(!1)},className:"text-white aria-selected:bg-gray-700",children:[h.jsx(yl,{className:He("mr-2 h-4 w-4",n===y.repo_id?"opacity-100":"opacity-0")}),h.jsx("span",{className:"flex-1 truncate",children:y.repo_id}),y.source==="both"&&h.jsx("span",{className:"text-xs text-gray-400 mr-2",children:"on Hub"}),y.private&&h.jsx("span",{className:"text-xs text-amber-400",children:"private"})]},y.repo_id);return a?h.jsxs("div",{className:"flex gap-2",children:[h.jsx(hi,{autoFocus:!0,value:l,onChange:y=>c(y.target.value),onKeyDown:y=>{y.key==="Enter"&&u()},placeholder:"org/dataset-name",className:"bg-gray-800 border-gray-600 text-white"}),h.jsx(et,{onClick:u,disabled:!_2.test(l.trim()),children:"Use"}),h.jsx(et,{variant:"ghost",onClick:()=>s(!1),children:"Cancel"})]}):h.jsxs(_x,{open:i,onOpenChange:o,children:[h.jsx(wx,{asChild:!0,children:h.jsxs(et,{variant:"outline",role:"combobox","aria-expanded":i,className:"w-full justify-between bg-gray-800 border-gray-600 text-white hover:bg-gray-700",children:[n??(e?"Loading datasetsโ€ฆ":"Select a datasetโ€ฆ"),h.jsx(JM,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),h.jsx(Pm,{className:"w-[--radix-popover-trigger-width] p-0 bg-gray-800 border-gray-700",align:"start",children:h.jsxs(Ex,{className:"bg-gray-800 text-white",children:[h.jsx(Tx,{placeholder:"Search datasetsโ€ฆ",className:"text-white"}),h.jsxs(Mx,{children:[h.jsx(Ax,{children:e?"Loadingโ€ฆ":"No datasets."}),d.length>0&&h.jsx(Ys,{heading:"Local",children:d.map(p)}),f.length>0&&h.jsx(Ys,{heading:"Hugging Face",children:f.map(p)}),h.jsx(Ys,{children:h.jsxs(kd,{onSelect:()=>{s(!0),o(!1)},className:"text-purple-300 aria-selected:bg-gray-700",children:[h.jsx(Z7,{className:"mr-2 h-4 w-4"}),"Use custom repo IDโ€ฆ"]})})]})]})})]})},Cce=1500;function kz(t,e=!0){const{baseUrl:n,fetchWithHeaders:r}=Ln(),[i,o]=_.useState("idle"),[a,s]=_.useState(null),[l,c]=_.useState([]),u=_.useRef(null);_.useEffect(()=>{if(!e)return;let p=!1;return r(`${n}/${t}/install-status`).then(y=>y.json()).then(y=>{p||(o(y.state),s(y.error),y.logs.length>0&&c(y.logs))}).catch(()=>{}),()=>{p=!0}},[e,n,r,t]),_.useEffect(()=>{if(i!=="installing")return;const p=setInterval(async()=>{try{const y=await r(`${n}/${t}/install-status`);if(!y.ok)return;const v=await y.json();v.logs&&v.logs.length>0&&c(g=>[...g,...v.logs]),v.state!=="installing"&&(o(v.state),s(v.error))}catch{}},Cce);return()=>clearInterval(p)},[i,n,r,t]),_.useEffect(()=>{u.current&&(u.current.scrollTop=u.current.scrollHeight)},[l]);const d=_.useCallback(async()=>{o("installing"),s(null),c([]);try{const p=await r(`${n}/${t}/install`,{method:"POST"}),y=await p.json();if(!y.started&&p.ok)return;p.ok||(o("error"),s(y.message||`Install request failed (${p.status})`))}catch(p){o("error"),s(`Install request failed: ${p instanceof Error?p.message:String(p)}`)}},[n,r,t]),f=_.useCallback(()=>{o("idle"),s(null),c([])},[]);return{state:i,error:a,logs:l,logBoxRef:u,handleInstall:d,handleRetry:f}}function jz(t,e){switch(t){case"done":return"Install Complete";case"error":return"Install Failed";case"installing":return"Installingโ€ฆ";default:return e}}function Uz({state:t}){return t==="done"?h.jsx(ZM,{className:"w-6 h-6 text-green-400"}):t==="error"?h.jsx(nd,{className:"w-6 h-6 text-red-400"}):t==="installing"?h.jsx(fi,{className:"w-6 h-6 text-sky-400 animate-spin"}):h.jsx(ia,{className:"w-6 h-6 text-amber-400"})}const Fz=({state:t,error:e,logs:n,logBoxRef:r,onInstall:i,onRetry:o,installHint:a,packageName:s,idleDescription:l,doneDescription:c})=>{const{toast:u}=Dr(),d=async()=>{try{await navigator.clipboard.writeText(a),u({title:"Copied",description:a})}catch{u({title:"Copy failed",description:"Select the command and copy manually.",variant:"destructive"})}};return h.jsxs(h.Fragment,{children:[t==="idle"&&h.jsxs(h.Fragment,{children:[h.jsx("p",{className:"text-slate-300",children:l}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("code",{className:"flex-1 bg-slate-900 border border-slate-700 rounded-lg px-3 py-2 text-sm text-slate-200 font-mono",children:a}),h.jsx(et,{variant:"ghost",size:"icon",onClick:d,className:"text-slate-400 hover:text-white","aria-label":"Copy install command",children:h.jsx(QM,{className:"w-4 h-4"})})]}),h.jsx(et,{onClick:i,className:"bg-green-500 hover:bg-green-600 text-white font-semibold",children:"Install Now"})]}),t==="installing"&&h.jsxs("p",{className:"text-slate-300",children:["Installing"," ",h.jsx("code",{className:"px-1 py-0.5 rounded bg-slate-900 text-sky-300",children:s}),". This usually takes about 10 seconds."]}),t==="done"&&h.jsx("div",{className:"space-y-3 text-slate-300",children:c}),t==="error"&&h.jsxs(h.Fragment,{children:[h.jsx("p",{className:"text-red-300",children:e||"Install failed."}),h.jsx(et,{onClick:o,className:"bg-slate-700 hover:bg-slate-600 text-white",children:"Try again"})]}),t==="error"&&n.length>0&&h.jsx("div",{ref:r,className:"bg-slate-900 rounded-lg p-3 h-48 overflow-y-auto font-mono text-xs border border-slate-700 text-slate-300 whitespace-pre-wrap break-words",children:n.map((f,p)=>h.jsx("div",{children:f.message},p))})]})},Bz=({purpose:t})=>h.jsxs(h.Fragment,{children:[h.jsxs("p",{children:["Install complete. Restart"," ",h.jsx("code",{className:"px-1 py-0.5 rounded bg-slate-900 text-sky-300",children:"lelab"})," ","to enable ",t,":"]}),h.jsxs("ol",{className:"list-decimal list-inside space-y-2 pl-1",children:[h.jsxs("li",{children:["Press"," ",h.jsx("kbd",{className:"px-1.5 py-0.5 rounded bg-slate-900 border border-slate-600 text-xs font-mono text-slate-200",children:"Ctrl+C"})," ","in the terminal running"," ",h.jsx("code",{className:"px-1 py-0.5 rounded bg-slate-900 text-sky-300",children:"lelab"}),"."]}),h.jsxs("li",{children:["Run"," ",h.jsx("code",{className:"px-1 py-0.5 rounded bg-slate-900 text-sky-300",children:"lelab"})," ","again."]})]})]}),Pce=({open:t,onOpenChange:e,installHint:n})=>{const r=kz("system/wandb-extra",t);return h.jsx(Hc,{open:t,onOpenChange:e,children:h.jsxs(xl,{className:"bg-slate-800 border-slate-700 text-white max-w-2xl",children:[h.jsxs(bl,{children:[h.jsxs(_l,{className:"flex items-center gap-3 text-white",children:[h.jsx(Uz,{state:r.state}),jz(r.state,"Weights & Biases Not Installed")]}),h.jsx(wl,{className:"sr-only",children:"Install the wandb package to enable W&B logging."})]}),h.jsx("div",{className:"space-y-4",children:h.jsx(Fz,{state:r.state,error:r.error,logs:r.logs,logBoxRef:r.logBoxRef,onInstall:r.handleInstall,onRetry:r.handleRetry,installHint:n,packageName:"wandb",idleTitle:"Weights & Biases Not Installed",idleDescription:h.jsxs(h.Fragment,{children:["Enabling W&B logging requires the"," ",h.jsx("code",{className:"px-1 py-0.5 rounded bg-slate-900 text-sky-300",children:"wandb"})," ","package, which isn't installed in this environment. Install it to log this run to W&B."]}),doneDescription:h.jsx(Bz,{purpose:"W&B logging"})})})]})})},Rce=({config:t,updateConfig:e,datasets:n,datasetsLoading:r})=>{const{baseUrl:i,fetchWithHeaders:o}=Ln(),[a,s]=_.useState(!1),[l,c]=_.useState("pip install wandb"),u=t.target.runner==="seeed_cloud"||t.target.runner==="external",d=async f=>{if(!f){e("wandb_enable",!1);return}try{const y=await(await o(`${i}/system/wandb-extra`)).json();y.available?e("wandb_enable",!0):(c(y.install_hint),s(!0))}catch{e("wandb_enable",!0)}};return h.jsxs(Gr,{className:"bg-slate-800/50 border-slate-700 rounded-xl",children:[h.jsx(jo,{children:h.jsx(ha,{className:"text-white",children:"Run Configuration"})}),h.jsxs(Wr,{className:"space-y-6",children:[h.jsxs("div",{children:[h.jsx(Nt,{className:"text-slate-300",children:"Dataset Repository ID *"}),h.jsx("div",{className:"mt-1",children:h.jsx(Ace,{datasets:n,loading:r,value:t.dataset_repo_id||null,onChange:f=>{f&&e("dataset_repo_id",f)}})}),h.jsx("p",{className:"text-xs text-slate-500 mt-1",children:u?"LeLab dataset repository ID; Seeed Cloud also accepts an archive URL or SEEED_CLOUD_DATASET_URL override":"HuggingFace Hub dataset repository ID"})]}),h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[h.jsxs("div",{children:[h.jsx(Nt,{htmlFor:"policy_type",className:"text-slate-300",children:"Policy"}),h.jsxs(Zs,{value:t.policy_type,onValueChange:f=>e("policy_type",f),children:[h.jsx(Wa,{id:"policy_type",className:"bg-slate-900 border-slate-600 text-white rounded-lg",children:h.jsx(Qs,{})}),h.jsxs(Xa,{className:"bg-slate-800 border-slate-600 text-white",children:[h.jsx(_n,{value:"act",children:"ACT (Action Chunking Transformer)"}),h.jsx(_n,{value:"diffusion",children:"Diffusion Policy"}),h.jsx(_n,{value:"pi0",children:"PI0"}),h.jsx(_n,{value:"smolvla",children:"SmolVLA"}),h.jsx(_n,{value:"tdmpc",children:"TD-MPC"}),h.jsx(_n,{value:"vqbet",children:"VQ-BeT"}),h.jsx(_n,{value:"pi0fast",children:"PI0 Fast"}),h.jsx(_n,{value:"sac",children:"SAC"}),h.jsx(_n,{value:"reward_classifier",children:"Reward Classifier"})]})]})]}),h.jsxs("div",{children:[h.jsx(Nt,{htmlFor:"steps",className:"text-slate-300",children:"Training Steps"}),h.jsx(mr,{id:"steps",value:t.steps,onChange:f=>{f!==void 0&&e("steps",f)},className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]}),h.jsxs("div",{children:[h.jsx(Nt,{htmlFor:"batch_size",className:"text-slate-300",children:"Batch Size"}),h.jsx(mr,{id:"batch_size",value:t.batch_size,onChange:f=>{f!==void 0&&e("batch_size",f)},className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]}),h.jsxs("div",{className:"flex items-center space-x-3 pt-6",children:[h.jsx(Jl,{id:"wandb_enable",checked:t.wandb_enable,onCheckedChange:d,className:"data-[state=checked]:bg-green-500"}),h.jsx(Nt,{htmlFor:"wandb_enable",className:"text-slate-300",children:"Enable Weights & Biases"})]})]}),h.jsx(Pce,{open:a,onOpenChange:s,installHint:l}),t.wandb_enable&&h.jsxs("div",{children:[h.jsx(Nt,{htmlFor:"wandb_project",className:"text-slate-300",children:"W&B Project Name"}),h.jsx(hi,{id:"wandb_project",value:t.wandb_project||"",onChange:f=>e("wandb_project",f.target.value||void 0),placeholder:"my-robotics-project",className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]})]})]})},wu=({children:t})=>h.jsx("h4",{className:"text-xs font-semibold text-slate-400 uppercase tracking-wider",children:t}),Nce=({config:t,updateConfig:e})=>{const[n,r]=_.useState(!1);return h.jsxs(Gr,{className:"bg-slate-800/50 border-slate-700 rounded-xl",children:[h.jsxs(jo,{role:"button",tabIndex:0,"aria-expanded":n,onClick:()=>r(i=>!i),onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),r(o=>!o))},className:"cursor-pointer select-none flex flex-row items-center justify-between",children:[h.jsx("span",{className:"text-white font-semibold",children:"Advanced"}),h.jsxs("span",{className:"flex items-center gap-1 text-slate-400 text-sm",children:[n?h.jsx(hc,{className:"w-4 h-4"}):h.jsx(xp,{className:"w-4 h-4"}),n?"Hide":"Show"]})]}),n&&h.jsxs(Wr,{className:"space-y-8",children:[h.jsxs("section",{className:"space-y-4",children:[h.jsx(wu,{children:"Policy"}),h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[h.jsxs("div",{children:[h.jsx(Nt,{htmlFor:"policy_device",className:"text-slate-300",children:"Device"}),h.jsxs(Zs,{value:t.policy_device||"cuda",onValueChange:i=>e("policy_device",i),children:[h.jsx(Wa,{id:"policy_device",className:"bg-slate-900 border-slate-600 text-white rounded-lg",children:h.jsx(Qs,{})}),h.jsxs(Xa,{className:"bg-slate-800 border-slate-600 text-white",children:[h.jsx(_n,{value:"cuda",children:"CUDA (GPU)"}),h.jsx(_n,{value:"cpu",children:"CPU"}),h.jsx(_n,{value:"mps",children:"MPS (Apple Silicon)"})]})]})]}),h.jsxs("div",{className:"flex items-center space-x-3 pt-6",children:[h.jsx(Jl,{id:"policy_use_amp",checked:t.policy_use_amp,onCheckedChange:i=>e("policy_use_amp",i)}),h.jsx(Nt,{htmlFor:"policy_use_amp",className:"text-slate-300",children:"Use Automatic Mixed Precision"})]})]})]}),h.jsx(Yl,{className:"bg-slate-700"}),h.jsxs("section",{className:"space-y-4",children:[h.jsx(wu,{children:"Training"}),h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[h.jsxs("div",{children:[h.jsx(Nt,{htmlFor:"seed",className:"text-slate-300",children:"Random Seed"}),h.jsx(mr,{id:"seed",value:t.seed,onChange:i=>e("seed",i),className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]}),h.jsxs("div",{children:[h.jsx(Nt,{htmlFor:"num_workers",className:"text-slate-300",children:"Number of Workers"}),h.jsx(mr,{id:"num_workers",value:t.num_workers,onChange:i=>{i!==void 0&&e("num_workers",i)},className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]})]})]}),h.jsx(Yl,{className:"bg-slate-700"}),h.jsxs("section",{className:"space-y-4",children:[h.jsx(wu,{children:"Optimizer"}),h.jsxs("div",{children:[h.jsx(Nt,{htmlFor:"optimizer_type",className:"text-slate-300",children:"Optimizer"}),h.jsxs(Zs,{value:t.optimizer_type||"adam",onValueChange:i=>e("optimizer_type",i),children:[h.jsx(Wa,{id:"optimizer_type",className:"bg-slate-900 border-slate-600 text-white rounded-lg",children:h.jsx(Qs,{})}),h.jsxs(Xa,{className:"bg-slate-800 border-slate-600 text-white",children:[h.jsx(_n,{value:"adam",children:"Adam"}),h.jsx(_n,{value:"adamw",children:"AdamW"}),h.jsx(_n,{value:"sgd",children:"SGD"}),h.jsx(_n,{value:"multi_adam",children:"Multi Adam"})]})]})]}),h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[h.jsxs("div",{children:[h.jsx(Nt,{htmlFor:"optimizer_lr",className:"text-slate-300",children:"Learning Rate"}),h.jsx(mr,{id:"optimizer_lr",integer:!1,step:"0.0001",value:t.optimizer_lr,onChange:i=>e("optimizer_lr",i),placeholder:"Use policy default",className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]}),h.jsxs("div",{children:[h.jsx(Nt,{htmlFor:"optimizer_weight_decay",className:"text-slate-300",children:"Weight Decay"}),h.jsx(mr,{id:"optimizer_weight_decay",integer:!1,step:"0.0001",value:t.optimizer_weight_decay,onChange:i=>e("optimizer_weight_decay",i),placeholder:"Use policy default",className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]}),h.jsxs("div",{children:[h.jsx(Nt,{htmlFor:"optimizer_grad_clip_norm",className:"text-slate-300",children:"Gradient Clipping"}),h.jsx(mr,{id:"optimizer_grad_clip_norm",integer:!1,step:"0.0001",value:t.optimizer_grad_clip_norm,onChange:i=>e("optimizer_grad_clip_norm",i),placeholder:"Use policy default",className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]})]})]}),h.jsx(Yl,{className:"bg-slate-700"}),h.jsxs("section",{className:"space-y-4",children:[h.jsx(wu,{children:"Logging & Checkpointing"}),h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[h.jsxs("div",{children:[h.jsx(Nt,{htmlFor:"log_freq",className:"text-slate-300",children:"Log Frequency"}),h.jsx(mr,{id:"log_freq",value:t.log_freq,onChange:i=>{i!==void 0&&e("log_freq",i)},className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]}),h.jsxs("div",{children:[h.jsx(Nt,{htmlFor:"save_freq",className:"text-slate-300",children:"Save Frequency"}),h.jsx(mr,{id:"save_freq",value:t.save_freq,onChange:i=>{i!==void 0&&e("save_freq",i)},className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]})]}),h.jsxs("div",{className:"flex items-center space-x-3",children:[h.jsx(Jl,{id:"save_checkpoint",checked:t.save_checkpoint,onCheckedChange:i=>e("save_checkpoint",i)}),h.jsx(Nt,{htmlFor:"save_checkpoint",className:"text-slate-300",children:"Save Checkpoints"})]}),h.jsxs("div",{className:"flex items-center space-x-3",children:[h.jsx(Jl,{id:"resume",checked:t.resume,onCheckedChange:i=>e("resume",i)}),h.jsx(Nt,{htmlFor:"resume",className:"text-slate-300",children:"Resume from Checkpoint"})]})]}),t.wandb_enable&&h.jsxs(h.Fragment,{children:[h.jsx(Yl,{className:"bg-slate-700"}),h.jsxs("section",{className:"space-y-4",children:[h.jsx(wu,{children:"Weights & Biases"}),h.jsxs("div",{children:[h.jsx(Nt,{htmlFor:"wandb_entity",className:"text-slate-300",children:"W&B Entity (optional)"}),h.jsx(hi,{id:"wandb_entity",value:t.wandb_entity||"",onChange:i=>e("wandb_entity",i.target.value||void 0),placeholder:"your-username",className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]}),h.jsxs("div",{children:[h.jsx(Nt,{htmlFor:"wandb_notes",className:"text-slate-300",children:"W&B Notes (optional)"}),h.jsx(hi,{id:"wandb_notes",value:t.wandb_notes||"",onChange:i=>e("wandb_notes",i.target.value||void 0),placeholder:"Training run notes...",className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]}),h.jsxs("div",{children:[h.jsx(Nt,{htmlFor:"wandb_mode",className:"text-slate-300",children:"W&B Mode"}),h.jsxs(Zs,{value:t.wandb_mode||"online",onValueChange:i=>e("wandb_mode",i),children:[h.jsx(Wa,{id:"wandb_mode",className:"bg-slate-900 border-slate-600 text-white rounded-lg",children:h.jsx(Qs,{})}),h.jsxs(Xa,{className:"bg-slate-800 border-slate-600 text-white",children:[h.jsx(_n,{value:"online",children:"Online"}),h.jsx(_n,{value:"offline",children:"Offline"}),h.jsx(_n,{value:"disabled",children:"Disabled"})]})]})]}),h.jsxs("div",{className:"flex items-center space-x-3",children:[h.jsx(Jl,{id:"wandb_disable_artifact",checked:t.wandb_disable_artifact,onCheckedChange:i=>e("wandb_disable_artifact",i)}),h.jsx(Nt,{htmlFor:"wandb_disable_artifact",className:"text-slate-300",children:"Disable Artifacts"})]})]})]}),!t.wandb_enable&&h.jsx(Yl,{className:"bg-slate-700"}),h.jsxs("section",{className:"space-y-4",children:[h.jsx(wu,{children:"Misc"}),h.jsxs("div",{className:"flex items-center space-x-3",children:[h.jsx(Jl,{id:"use_policy_training_preset",checked:t.use_policy_training_preset,onCheckedChange:i=>e("use_policy_training_preset",i)}),h.jsx(Nt,{htmlFor:"use_policy_training_preset",className:"text-slate-300",children:"Use Policy Training Preset"})]})]})]})]})},Oce=(t,e)=>`$${(e==="minute"?t*60:t).toFixed(2)}/hr`,Ice=t=>{const e=t.accelerator;if(!e)return{manufacturer:"",model:t.cpu||t.pretty_name||t.name};if(typeof e=="string")return{manufacturer:/nvidia/i.test(e)?"":"Nvidia",model:e};const n=String(e.quantity??"").trim(),r=n&&n!=="1"?`${n}x `:"";return{manufacturer:e.manufacturer||"",model:`${r}${e.model||t.pretty_name||t.name}`}},Dce=t=>{const{manufacturer:e,model:n}=Ice(t);return[e,n].filter(Boolean).join(" ")},dh=(t,e)=>`${t} ${Dce(e)} - ${Oce(e.unit_cost_usd,e.unit_label)}`,w2=t=>{const e=[t.cpu,t.ram].filter(Boolean);return e.length>0?e.join(" ยท "):t.pretty_name},Fl="seeed_cloud",Lce=({config:t,updateConfig:e,authenticated:n,flavors:r,providers:i,loading:o,seeedConnecting:a,onConnectSeeedCloud:s})=>{const l=t.target,[c,u]=_.useState(!1),[d,f]=_.useState(!0),[p,y]=_.useState({[Fl]:!0}),v=_.useMemo(()=>i??[],[i]),g=_.useMemo(()=>r??[],[r]),m=v.find(A=>A.id===Fl),x=v.map(A=>({...A,open:p[A.id]??A.id===Fl,label:A.id===Fl?"Seeed Cloud":A.display_name})),b=_.useMemo(()=>{if(l.runner==="local")return"Local - your machine";if(l.runner==="hf_cloud"){const C=g.find(P=>P.name===l.flavor);return C?dh("HF",C):"Hugging Face"}if(l.runner==="seeed_cloud"){const C=m==null?void 0:m.flavors.find(P=>P.name===l.flavor);return C?dh("Seeed",C):"Seeed Cloud"}const A=v.find(C=>C.id===l.provider),M=A==null?void 0:A.flavors.find(C=>C.name===l.flavor);return M?dh((A==null?void 0:A.display_name)??"External",M):(A==null?void 0:A.display_name)??"External"},[g,v,m,l]),S=A=>{if(A==="local")e("target",{runner:"local"});else if(A.startsWith("hf:")){const M=A.slice(3);e("target",{runner:"hf_cloud",flavor:M})}else if(A.startsWith("seeed:")){const M=A.slice(6);e("target",{runner:"seeed_cloud",flavor:M})}else if(A.startsWith("external:")){const[,M,C]=A.split(":");e("target",{runner:"external",provider:M,flavor:C})}u(!1)},w=l.runner==="local"?"local":l.runner==="hf_cloud"?`hf:${l.flavor??""}`:l.runner==="seeed_cloud"?`seeed:${l.flavor??""}`:`external:${l.provider}:${l.flavor??""}`,E=(A,M,C,P)=>h.jsxs("button",{type:"button",disabled:P,onClick:()=>S(A),className:He("flex min-h-10 w-full items-center gap-3 rounded-md px-3 py-2 text-left text-sm transition-colors","hover:bg-slate-700/80 focus:bg-slate-700/80 focus:outline-none",P&&"cursor-not-allowed opacity-45 hover:bg-transparent"),children:[h.jsx(yl,{className:He("h-4 w-4 shrink-0 text-emerald-300",w===A?"opacity-100":"opacity-0")}),h.jsxs("span",{className:"min-w-0 flex-1",children:[h.jsx("span",{className:"block truncate text-slate-100",children:M}),C?h.jsx("span",{className:"block truncate text-xs text-slate-500",children:C}):null]})]},A),T=(A,M)=>{y(C=>({...C,[A]:M}))};return h.jsxs(Gr,{className:"bg-slate-800/50 border-slate-700 rounded-xl",children:[h.jsx(jo,{children:h.jsx(ha,{className:"text-white",children:"Compute target"})}),h.jsx(Wr,{className:"space-y-3",children:h.jsxs("div",{children:[h.jsx(Nt,{className:"text-slate-300",children:"Run training on"}),h.jsxs(_x,{open:c,onOpenChange:u,children:[h.jsx(wx,{asChild:!0,children:h.jsxs(et,{type:"button",variant:"outline",className:"mt-1 flex h-11 w-full justify-between border-slate-600 bg-slate-900 px-3 text-left text-white hover:bg-slate-900 hover:text-white",children:[h.jsx("span",{className:"min-w-0 flex-1 truncate",children:o?"Loading...":b}),h.jsx(hc,{className:"ml-3 h-4 w-4 shrink-0 text-slate-400"})]})}),h.jsx(Pm,{align:"start",className:"w-[min(560px,calc(100vw-2rem))] border-slate-700 bg-slate-800 p-2 text-white shadow-xl",children:h.jsxs("div",{className:"max-h-[440px] overflow-y-auto pr-1",children:[E("local","Local - your machine","Free",!1),h.jsxs(Sy,{open:d,onOpenChange:f,children:[h.jsxs(Ey,{className:"mt-1 flex h-10 w-full items-center gap-2 rounded-md px-3 text-left text-sm text-slate-200 hover:bg-slate-700/70",children:[d?h.jsx(hc,{className:"h-4 w-4 text-slate-400"}):h.jsx(xp,{className:"h-4 w-4 text-slate-400"}),h.jsx("span",{className:"font-medium",children:"Hugging Face"}),h.jsx(b1,{variant:"outline",className:"ml-auto border-slate-600 text-slate-300",children:n?`${g.length} flavors`:"Login required"})]}),h.jsx(Ty,{className:"ml-3 border-l border-slate-700 pl-2",children:n&&g.length>0?g.map(A=>E(`hf:${A.name}`,dh("HF",A),w2(A),!1)):h.jsx("div",{className:"px-8 py-3 text-xs text-slate-500",children:n?"No HF hardware flavors available.":"Log in to HF to unlock official flavors."})})]}),x.map(A=>h.jsxs(Sy,{open:A.open,onOpenChange:M=>T(A.id,M),children:[h.jsxs(Ey,{className:"mt-1 flex h-10 w-full items-center gap-2 rounded-md px-3 text-left text-sm text-slate-200 hover:bg-slate-700/70",children:[A.open?h.jsx(hc,{className:"h-4 w-4 text-slate-400"}):h.jsx(xp,{className:"h-4 w-4 text-slate-400"}),h.jsx("span",{className:"font-medium",children:A.label}),h.jsx(b1,{variant:"outline",className:He("ml-auto border-slate-600 text-slate-300",A.authenticated&&"border-emerald-500/50 text-emerald-200"),children:A.authenticated?`Connected ยท ${A.flavors.length} flavors`:"Connect required"})]}),h.jsxs(Ty,{className:"ml-3 border-l border-slate-700 pl-2",children:[!A.authenticated&&A.id===Fl?h.jsxs("div",{className:"flex items-center justify-between gap-3 px-3 py-2",children:[h.jsx("span",{className:"text-xs text-slate-500",children:"Connect to unlock Seeed Cloud flavors."}),h.jsxs(et,{type:"button",size:"sm",variant:"outline",disabled:a,onClick:s,className:"h-8 shrink-0 border-amber-400/60 bg-slate-900 text-amber-100 hover:bg-amber-500/20",children:[a?h.jsx(fi,{className:"mr-2 h-4 w-4 animate-spin"}):h.jsx(Y7,{className:"mr-2 h-4 w-4"}),"Connect"]})]}):null,A.flavors.length>0?A.flavors.map(M=>{const C=A.id===Fl?"Seeed":A.display_name,P=A.id===Fl?`seeed:${M.name}`:`external:${A.id}:${M.name}`;return E(P,dh(C,M),w2(M),!A.authenticated)}):h.jsx("div",{className:"px-8 py-3 text-xs text-slate-500",children:"No flavors available."})]})]},A.id))]})})]}),h.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Cost shown is per running hour. Final policy uploads to your HF account when training completes."})]})})]})},kce=({config:t,updateConfig:e,datasets:n,datasetsLoading:r,authenticated:i,flavors:o,providers:a,hardwareLoading:s,seeedConnecting:l,onConnectSeeedCloud:c})=>h.jsxs("div",{className:"max-w-3xl mx-auto space-y-6",children:[h.jsx(Lce,{config:t,updateConfig:e,authenticated:i,flavors:o,providers:a,loading:s,seeedConnecting:l,onConnectSeeedCloud:c}),h.jsx(Rce,{config:t,updateConfig:e,datasets:n,datasetsLoading:r}),h.jsx(Nce,{config:t,updateConfig:e})]});var jce=Array.isArray,yi=jce,Uce=typeof Zm=="object"&&Zm&&Zm.Object===Object&&Zm,$z=Uce,Fce=$z,Bce=typeof self=="object"&&self&&self.Object===Object&&self,$ce=Fce||Bce||Function("return this")(),wa=$ce,zce=wa,Hce=zce.Symbol,Um=Hce,S2=Um,zz=Object.prototype,Vce=zz.hasOwnProperty,Gce=zz.toString,fh=S2?S2.toStringTag:void 0;function Wce(t){var e=Vce.call(t,fh),n=t[fh];try{t[fh]=void 0;var r=!0}catch{}var i=Gce.call(t);return r&&(e?t[fh]=n:delete t[fh]),i}var Xce=Wce,qce=Object.prototype,Kce=qce.toString;function Yce(t){return Kce.call(t)}var Jce=Yce,E2=Um,Zce=Xce,Qce=Jce,eue="[object Null]",tue="[object Undefined]",T2=E2?E2.toStringTag:void 0;function nue(t){return t==null?t===void 0?tue:eue:T2&&T2 in Object(t)?Zce(t):Qce(t)}var us=nue;function rue(t){return t!=null&&typeof t=="object"}var ds=rue,iue=us,oue=ds,aue="[object Symbol]";function sue(t){return typeof t=="symbol"||oue(t)&&iue(t)==aue}var Cf=sue,lue=yi,cue=Cf,uue=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,due=/^\w*$/;function fue(t,e){if(lue(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||cue(t)?!0:due.test(t)||!uue.test(t)||e!=null&&t in Object(e)}var gC=fue;function hue(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Al=hue;const Pf=dn(Al);var pue=us,mue=Al,gue="[object AsyncFunction]",vue="[object Function]",yue="[object GeneratorFunction]",xue="[object Proxy]";function bue(t){if(!mue(t))return!1;var e=pue(t);return e==vue||e==yue||e==gue||e==xue}var vC=bue;const jt=dn(vC);var _ue=wa,wue=_ue["__core-js_shared__"],Sue=wue,Lw=Sue,M2=function(){var t=/[^.]+$/.exec(Lw&&Lw.keys&&Lw.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Eue(t){return!!M2&&M2 in t}var Tue=Eue,Mue=Function.prototype,Aue=Mue.toString;function Cue(t){if(t!=null){try{return Aue.call(t)}catch{}try{return t+""}catch{}}return""}var Hz=Cue,Pue=vC,Rue=Tue,Nue=Al,Oue=Hz,Iue=/[\\^$.*+?()[\]{}|]/g,Due=/^\[object .+?Constructor\]$/,Lue=Function.prototype,kue=Object.prototype,jue=Lue.toString,Uue=kue.hasOwnProperty,Fue=RegExp("^"+jue.call(Uue).replace(Iue,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Bue(t){if(!Nue(t)||Rue(t))return!1;var e=Pue(t)?Fue:Due;return e.test(Oue(t))}var $ue=Bue;function zue(t,e){return t==null?void 0:t[e]}var Hue=zue,Vue=$ue,Gue=Hue;function Wue(t,e){var n=Gue(t,e);return Vue(n)?n:void 0}var qc=Wue,Xue=qc,que=Xue(Object,"create"),tb=que,A2=tb;function Kue(){this.__data__=A2?A2(null):{},this.size=0}var Yue=Kue;function Jue(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Zue=Jue,Que=tb,ede="__lodash_hash_undefined__",tde=Object.prototype,nde=tde.hasOwnProperty;function rde(t){var e=this.__data__;if(Que){var n=e[t];return n===ede?void 0:n}return nde.call(e,t)?e[t]:void 0}var ide=rde,ode=tb,ade=Object.prototype,sde=ade.hasOwnProperty;function lde(t){var e=this.__data__;return ode?e[t]!==void 0:sde.call(e,t)}var cde=lde,ude=tb,dde="__lodash_hash_undefined__";function fde(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=ude&&e===void 0?dde:e,this}var hde=fde,pde=Yue,mde=Zue,gde=ide,vde=cde,yde=hde;function Rf(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e-1}var Lde=Dde,kde=nb;function jde(t,e){var n=this.__data__,r=kde(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var Ude=jde,Fde=_de,Bde=Pde,$de=Ode,zde=Lde,Hde=Ude;function Nf(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e0?1:-1},tc=function(e){return Dc(e)&&e.indexOf("%")===e.length-1},ze=function(e){return che(e)&&!Fm(e)},Yn=function(e){return ze(e)||Dc(e)},hhe=0,Bm=function(e){var n=++hhe;return"".concat(e||"").concat(n)},Lc=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!ze(e)&&!Dc(e))return r;var o;if(tc(e)){var a=e.indexOf("%");o=n*parseFloat(e.slice(0,a))/100}else o=+e;return Fm(o)&&(o=r),i&&o>n&&(o=n),o},Cu=function(e){if(!e)return null;var n=Object.keys(e);return n&&n.length?e[n[0]]:null},phe=function(e){if(!Array.isArray(e))return!1;for(var n=e.length,r={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function _he(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function T1(t){"@babel/helpers - typeof";return T1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},T1(t)}var D2={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Ka=function(e){return typeof e=="string"?e:e?e.displayName||e.name||"Component":""},L2=null,jw=null,AC=function t(e){if(e===L2&&Array.isArray(jw))return jw;var n=[];return _.Children.forEach(e,function(r){Ut(r)||(ihe.isFragment(r)?n=n.concat(t(r.props.children)):n.push(r))}),jw=n,L2=e,n};function ro(t,e){var n=[],r=[];return Array.isArray(e)?r=e.map(function(i){return Ka(i)}):r=[Ka(e)],AC(t).forEach(function(i){var o=no(i,"type.displayName")||no(i,"type.name");r.indexOf(o)!==-1&&n.push(i)}),n}function Ei(t,e){var n=ro(t,e);return n&&n[0]}var k2=function(e){if(!e||!e.props)return!1;var n=e.props,r=n.width,i=n.height;return!(!ze(r)||r<=0||!ze(i)||i<=0)},whe=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],She=function(e){return e&&e.type&&Dc(e.type)&&whe.indexOf(e.type)>=0},Ehe=function(e){return e&&T1(e)==="object"&&"clipDot"in e},The=function(e,n,r,i){var o,a=(o=kw==null?void 0:kw[i])!==null&&o!==void 0?o:[];return n.startsWith("data-")||!jt(e)&&(i&&a.includes(n)||vhe.includes(n))||r&&MC.includes(n)},$t=function(e,n,r){if(!e||typeof e=="function"||typeof e=="boolean")return null;var i=e;if(_.isValidElement(e)&&(i=e.props),!Pf(i))return null;var o={};return Object.keys(i).forEach(function(a){var s;The((s=i)===null||s===void 0?void 0:s[a],a,n,r)&&(o[a]=i[a])}),o},M1=function t(e,n){if(e===n)return!0;var r=_.Children.count(e);if(r!==_.Children.count(n))return!1;if(r===0)return!0;if(r===1)return j2(Array.isArray(e)?e[0]:e,Array.isArray(n)?n[0]:n);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Rhe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function C1(t){var e=t.children,n=t.width,r=t.height,i=t.viewBox,o=t.className,a=t.style,s=t.title,l=t.desc,c=Phe(t,Che),u=i||{width:n,height:r,x:0,y:0},d=zt("recharts-surface",o);return Z.createElement("svg",A1({},$t(c,!0,"svg"),{className:d,width:n,height:r,style:a,viewBox:"".concat(u.x," ").concat(u.y," ").concat(u.width," ").concat(u.height)}),Z.createElement("title",null,s),Z.createElement("desc",null,l),e)}var Nhe=["children","className"];function P1(){return P1=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Ihe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}var jn=Z.forwardRef(function(t,e){var n=t.children,r=t.className,i=Ohe(t,Nhe),o=zt("recharts-layer",r);return Z.createElement("g",P1({className:o},$t(i,!0),{ref:e}),n)}),vc=function(e,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;oi?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(i);++r=r?t:khe(t,e,n)}var Uhe=jhe,Fhe="\\ud800-\\udfff",Bhe="\\u0300-\\u036f",$he="\\ufe20-\\ufe2f",zhe="\\u20d0-\\u20ff",Hhe=Bhe+$he+zhe,Vhe="\\ufe0e\\ufe0f",Ghe="\\u200d",Whe=RegExp("["+Ghe+Fhe+Hhe+Vhe+"]");function Xhe(t){return Whe.test(t)}var Qz=Xhe;function qhe(t){return t.split("")}var Khe=qhe,e5="\\ud800-\\udfff",Yhe="\\u0300-\\u036f",Jhe="\\ufe20-\\ufe2f",Zhe="\\u20d0-\\u20ff",Qhe=Yhe+Jhe+Zhe,epe="\\ufe0e\\ufe0f",tpe="["+e5+"]",R1="["+Qhe+"]",N1="\\ud83c[\\udffb-\\udfff]",npe="(?:"+R1+"|"+N1+")",t5="[^"+e5+"]",n5="(?:\\ud83c[\\udde6-\\uddff]){2}",r5="[\\ud800-\\udbff][\\udc00-\\udfff]",rpe="\\u200d",i5=npe+"?",o5="["+epe+"]?",ipe="(?:"+rpe+"(?:"+[t5,n5,r5].join("|")+")"+o5+i5+")*",ope=o5+i5+ipe,ape="(?:"+[t5+R1+"?",R1,n5,r5,tpe].join("|")+")",spe=RegExp(N1+"(?="+N1+")|"+ape+ope,"g");function lpe(t){return t.match(spe)||[]}var cpe=lpe,upe=Khe,dpe=Qz,fpe=cpe;function hpe(t){return dpe(t)?fpe(t):upe(t)}var ppe=hpe,mpe=Uhe,gpe=Qz,vpe=ppe,ype=Xz;function xpe(t){return function(e){e=ype(e);var n=gpe(e)?vpe(e):void 0,r=n?n[0]:e.charAt(0),i=n?mpe(n,1).join(""):e.slice(1);return r[t]()+i}}var bpe=xpe,_pe=bpe,wpe=_pe("toUpperCase"),Spe=wpe;const gb=dn(Spe);function mn(t){return function(){return t}}const a5=Math.cos,Uy=Math.sin,Ko=Math.sqrt,Fy=Math.PI,vb=2*Fy,O1=Math.PI,I1=2*O1,Vl=1e-6,Epe=I1-Vl;function s5(t){this._+=t[0];for(let e=1,n=t.length;e=0))throw new Error(`invalid digits: ${t}`);if(e>15)return s5;const n=10**e;return function(r){this._+=r[0];for(let i=1,o=r.length;iVl)if(!(Math.abs(d*l-c*u)>Vl)||!o)this._append`L${this._x1=e},${this._y1=n}`;else{let p=r-a,y=i-s,v=l*l+c*c,g=p*p+y*y,m=Math.sqrt(v),x=Math.sqrt(f),b=o*Math.tan((O1-Math.acos((v+f-g)/(2*m*x)))/2),S=b/x,w=b/m;Math.abs(S-1)>Vl&&this._append`L${e+S*u},${n+S*d}`,this._append`A${o},${o},0,0,${+(d*p>u*y)},${this._x1=e+w*l},${this._y1=n+w*c}`}}arc(e,n,r,i,o,a){if(e=+e,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(i),l=r*Math.sin(i),c=e+s,u=n+l,d=1^a,f=a?i-o:o-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>Vl||Math.abs(this._y1-u)>Vl)&&this._append`L${c},${u}`,r&&(f<0&&(f=f%I1+I1),f>Epe?this._append`A${r},${r},0,1,${d},${e-s},${n-l}A${r},${r},0,1,${d},${this._x1=c},${this._y1=u}`:f>Vl&&this._append`A${r},${r},0,${+(f>=O1)},${d},${this._x1=e+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(e,n,r,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function CC(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(n==null)e=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);e=r}return t},()=>new Mpe(e)}function PC(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function l5(t){this._context=t}l5.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function yb(t){return new l5(t)}function c5(t){return t[0]}function u5(t){return t[1]}function d5(t,e){var n=mn(!0),r=null,i=yb,o=null,a=CC(s);t=typeof t=="function"?t:t===void 0?c5:mn(t),e=typeof e=="function"?e:e===void 0?u5:mn(e);function s(l){var c,u=(l=PC(l)).length,d,f=!1,p;for(r==null&&(o=i(p=a())),c=0;c<=u;++c)!(c=p;--y)s.point(b[y],S[y]);s.lineEnd(),s.areaEnd()}m&&(b[f]=+t(g,f,d),S[f]=+e(g,f,d),s.point(r?+r(g,f,d):b[f],n?+n(g,f,d):S[f]))}if(x)return s=null,x+""||null}function u(){return d5().defined(i).curve(a).context(o)}return c.x=function(d){return arguments.length?(t=typeof d=="function"?d:mn(+d),r=null,c):t},c.x0=function(d){return arguments.length?(t=typeof d=="function"?d:mn(+d),c):t},c.x1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:mn(+d),c):r},c.y=function(d){return arguments.length?(e=typeof d=="function"?d:mn(+d),n=null,c):e},c.y0=function(d){return arguments.length?(e=typeof d=="function"?d:mn(+d),c):e},c.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:mn(+d),c):n},c.lineX0=c.lineY0=function(){return u().x(t).y(e)},c.lineY1=function(){return u().x(t).y(n)},c.lineX1=function(){return u().x(r).y(e)},c.defined=function(d){return arguments.length?(i=typeof d=="function"?d:mn(!!d),c):i},c.curve=function(d){return arguments.length?(a=d,o!=null&&(s=a(o)),c):a},c.context=function(d){return arguments.length?(d==null?o=s=null:s=a(o=d),c):o},c}class f5{constructor(e,n){this._context=e,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,n){switch(e=+e,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,n):this._context.moveTo(e,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,n,e,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,e,this._y0,e,n);break}}this._x0=e,this._y0=n}}function Ape(t){return new f5(t,!0)}function Cpe(t){return new f5(t,!1)}const RC={draw(t,e){const n=Ko(e/Fy);t.moveTo(n,0),t.arc(0,0,n,0,vb)}},Ppe={draw(t,e){const n=Ko(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},h5=Ko(1/3),Rpe=h5*2,Npe={draw(t,e){const n=Ko(e/Rpe),r=n*h5;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},Ope={draw(t,e){const n=Ko(e),r=-n/2;t.rect(r,r,n,n)}},Ipe=.8908130915292852,p5=Uy(Fy/10)/Uy(7*Fy/10),Dpe=Uy(vb/10)*p5,Lpe=-a5(vb/10)*p5,kpe={draw(t,e){const n=Ko(e*Ipe),r=Dpe*n,i=Lpe*n;t.moveTo(0,-n),t.lineTo(r,i);for(let o=1;o<5;++o){const a=vb*o/5,s=a5(a),l=Uy(a);t.lineTo(l*n,-s*n),t.lineTo(s*r-l*i,l*r+s*i)}t.closePath()}},Uw=Ko(3),jpe={draw(t,e){const n=-Ko(e/(Uw*3));t.moveTo(0,n*2),t.lineTo(-Uw*n,-n),t.lineTo(Uw*n,-n),t.closePath()}},$i=-.5,zi=Ko(3)/2,D1=1/Ko(12),Upe=(D1/2+1)*3,Fpe={draw(t,e){const n=Ko(e/Upe),r=n/2,i=n*D1,o=r,a=n*D1+n,s=-o,l=a;t.moveTo(r,i),t.lineTo(o,a),t.lineTo(s,l),t.lineTo($i*r-zi*i,zi*r+$i*i),t.lineTo($i*o-zi*a,zi*o+$i*a),t.lineTo($i*s-zi*l,zi*s+$i*l),t.lineTo($i*r+zi*i,$i*i-zi*r),t.lineTo($i*o+zi*a,$i*a-zi*o),t.lineTo($i*s+zi*l,$i*l-zi*s),t.closePath()}};function Bpe(t,e){let n=null,r=CC(i);t=typeof t=="function"?t:mn(t||RC),e=typeof e=="function"?e:mn(e===void 0?64:+e);function i(){let o;if(n||(n=o=r()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),o)return n=null,o+""||null}return i.type=function(o){return arguments.length?(t=typeof o=="function"?o:mn(o),i):t},i.size=function(o){return arguments.length?(e=typeof o=="function"?o:mn(+o),i):e},i.context=function(o){return arguments.length?(n=o??null,i):n},i}function By(){}function $y(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function m5(t){this._context=t}m5.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:$y(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:$y(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function $pe(t){return new m5(t)}function g5(t){this._context=t}g5.prototype={areaStart:By,areaEnd:By,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:$y(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function zpe(t){return new g5(t)}function v5(t){this._context=t}v5.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:$y(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Hpe(t){return new v5(t)}function y5(t){this._context=t}y5.prototype={areaStart:By,areaEnd:By,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function Vpe(t){return new y5(t)}function F2(t){return t<0?-1:1}function B2(t,e,n){var r=t._x1-t._x0,i=e-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(n-t._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(F2(o)+F2(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function $2(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function Fw(t,e,n){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,s=(o-r)/3;t._context.bezierCurveTo(r+s,i+s*e,o-s,a-s*n,o,a)}function zy(t){this._context=t}zy.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Fw(this,this._t0,$2(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,Fw(this,$2(this,n=B2(this,t,e)),n);break;default:Fw(this,this._t0,n=B2(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function x5(t){this._context=new b5(t)}(x5.prototype=Object.create(zy.prototype)).point=function(t,e){zy.prototype.point.call(this,e,t)};function b5(t){this._context=t}b5.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,o){this._context.bezierCurveTo(e,t,r,n,o,i)}};function Gpe(t){return new zy(t)}function Wpe(t){return new x5(t)}function _5(t){this._context=t}_5.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),n===2)this._context.lineTo(t[1],e[1]);else for(var r=z2(t),i=z2(e),o=0,a=1;a=0;--e)i[e]=(a[e]-i[e+1])/o[e];for(o[n-1]=(t[n]+i[n-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}break}}this._x=t,this._y=e}};function qpe(t){return new xb(t,.5)}function Kpe(t){return new xb(t,0)}function Ype(t){return new xb(t,1)}function Hd(t,e){if((a=t.length)>1)for(var n=1,r,i,o=t[e[0]],a,s=o.length;n=0;)n[e]=e;return n}function Jpe(t,e){return t[e]}function Zpe(t){const e=[];return e.key=t,e}function Qpe(){var t=mn([]),e=L1,n=Hd,r=Jpe;function i(o){var a=Array.from(t.apply(this,arguments),Zpe),s,l=a.length,c=-1,u;for(const d of o)for(s=0,++c;s0){for(var n,r,i=0,o=t[0].length,a;i0){for(var n=0,r=t[e[0]],i,o=r.length;n0)||!((o=(i=t[e[0]]).length)>0))){for(var n=0,r=1,i,o,a;r=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function lme(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}var w5={symbolCircle:RC,symbolCross:Ppe,symbolDiamond:Npe,symbolSquare:Ope,symbolStar:kpe,symbolTriangle:jpe,symbolWye:Fpe},cme=Math.PI/180,ume=function(e){var n="symbol".concat(gb(e));return w5[n]||RC},dme=function(e,n,r){if(n==="area")return e;switch(r){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var i=18*cme;return 1.25*e*e*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},fme=function(e,n){w5["symbol".concat(gb(e))]=n},NC=function(e){var n=e.type,r=n===void 0?"circle":n,i=e.size,o=i===void 0?64:i,a=e.sizeType,s=a===void 0?"area":a,l=sme(e,rme),c=V2(V2({},l),{},{type:r,size:o,sizeType:s}),u=function(){var g=ume(r),m=Bpe().type(g).size(dme(o,s,r));return m()},d=c.className,f=c.cx,p=c.cy,y=$t(c,!0);return f===+f&&p===+p&&o===+o?Z.createElement("path",k1({},y,{className:zt("recharts-symbols",d),transform:"translate(".concat(f,", ").concat(p,")"),d:u()})):null};NC.registerSymbol=fme;function Vd(t){"@babel/helpers - typeof";return Vd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vd(t)}function j1(){return j1=Object.assign?Object.assign.bind():function(t){for(var e=1;e`);var x=p.inactive?c:p.color;return Z.createElement("li",j1({className:g,style:d,key:"legend-item-".concat(y)},jy(r.props,p,y)),Z.createElement(C1,{width:a,height:a,viewBox:u,style:f},r.renderIcon(p)),Z.createElement("span",{className:"recharts-legend-item-text",style:{color:x}},v?v(m,p,y):m))})}},{key:"render",value:function(){var r=this.props,i=r.payload,o=r.layout,a=r.align;if(!i||!i.length)return null;var s={padding:0,margin:0,textAlign:o==="horizontal"?a:"left"};return Z.createElement("ul",{className:"recharts-default-legend",style:s},this.renderItems())}}])}(_.PureComponent);Ip(OC,"displayName","Legend");Ip(OC,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var wme=rb;function Sme(){this.__data__=new wme,this.size=0}var Eme=Sme;function Tme(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}var Mme=Tme;function Ame(t){return this.__data__.get(t)}var Cme=Ame;function Pme(t){return this.__data__.has(t)}var Rme=Pme,Nme=rb,Ome=xC,Ime=bC,Dme=200;function Lme(t,e){var n=this.__data__;if(n instanceof Nme){var r=n.__data__;if(!Ome||r.lengths))return!1;var c=o.get(t),u=o.get(e);if(c&&u)return c==e&&u==t;var d=-1,f=!0,p=n&rge?new Qme:void 0;for(o.set(t,e),o.set(e,t);++d-1&&t%1==0&&t-1&&t%1==0&&t<=sve}var kC=lve,cve=us,uve=kC,dve=ds,fve="[object Arguments]",hve="[object Array]",pve="[object Boolean]",mve="[object Date]",gve="[object Error]",vve="[object Function]",yve="[object Map]",xve="[object Number]",bve="[object Object]",_ve="[object RegExp]",wve="[object Set]",Sve="[object String]",Eve="[object WeakMap]",Tve="[object ArrayBuffer]",Mve="[object DataView]",Ave="[object Float32Array]",Cve="[object Float64Array]",Pve="[object Int8Array]",Rve="[object Int16Array]",Nve="[object Int32Array]",Ove="[object Uint8Array]",Ive="[object Uint8ClampedArray]",Dve="[object Uint16Array]",Lve="[object Uint32Array]",bn={};bn[Ave]=bn[Cve]=bn[Pve]=bn[Rve]=bn[Nve]=bn[Ove]=bn[Ive]=bn[Dve]=bn[Lve]=!0;bn[fve]=bn[hve]=bn[Tve]=bn[pve]=bn[Mve]=bn[mve]=bn[gve]=bn[vve]=bn[yve]=bn[xve]=bn[bve]=bn[_ve]=bn[wve]=bn[Sve]=bn[Eve]=!1;function kve(t){return dve(t)&&uve(t.length)&&!!bn[cve(t)]}var jve=kve;function Uve(t){return function(e){return t(e)}}var I5=Uve,Wy={exports:{}};Wy.exports;(function(t,e){var n=$z,r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,o=i&&i.exports===r,a=o&&n.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||a&&a.binding&&a.binding("util")}catch{}}();t.exports=s})(Wy,Wy.exports);var Fve=Wy.exports,Bve=jve,$ve=I5,J2=Fve,Z2=J2&&J2.isTypedArray,zve=Z2?$ve(Z2):Bve,D5=zve,Hve=Wge,Vve=DC,Gve=yi,Wve=O5,Xve=LC,qve=D5,Kve=Object.prototype,Yve=Kve.hasOwnProperty;function Jve(t,e){var n=Gve(t),r=!n&&Vve(t),i=!n&&!r&&Wve(t),o=!n&&!r&&!i&&qve(t),a=n||r||i||o,s=a?Hve(t.length,String):[],l=s.length;for(var c in t)(e||Yve.call(t,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Xve(c,l)))&&s.push(c);return s}var Zve=Jve,Qve=Object.prototype;function eye(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||Qve;return t===n}var tye=eye;function nye(t,e){return function(n){return t(e(n))}}var L5=nye,rye=L5,iye=rye(Object.keys,Object),oye=iye,aye=tye,sye=oye,lye=Object.prototype,cye=lye.hasOwnProperty;function uye(t){if(!aye(t))return sye(t);var e=[];for(var n in Object(t))cye.call(t,n)&&n!="constructor"&&e.push(n);return e}var dye=uye,fye=vC,hye=kC;function pye(t){return t!=null&&hye(t.length)&&!fye(t)}var bb=pye,mye=Zve,gye=dye,vye=bb;function yye(t){return vye(t)?mye(t):gye(t)}var jC=yye,xye=Dge,bye=Vge,_ye=jC;function wye(t){return xye(t,_ye,bye)}var Sye=wye,Q2=Sye,Eye=1,Tye=Object.prototype,Mye=Tye.hasOwnProperty;function Aye(t,e,n,r,i,o){var a=n&Eye,s=Q2(t),l=s.length,c=Q2(e),u=c.length;if(l!=u&&!a)return!1;for(var d=l;d--;){var f=s[d];if(!(a?f in e:Mye.call(e,f)))return!1}var p=o.get(t),y=o.get(e);if(p&&y)return p==e&&y==t;var v=!0;o.set(t,e),o.set(e,t);for(var g=a;++d-1}var Mxe=Txe;function Axe(t,e,n){for(var r=-1,i=t==null?0:t.length;++r=zxe){var c=e?null:Bxe(t);if(c)return $xe(c);a=!1,i=Fxe,l=new kxe}else l=e?[]:s;e:for(;++r=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function ibe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function obe(t){return t.value}function abe(t,e){if(Z.isValidElement(t))return Z.cloneElement(t,e);if(typeof t=="function")return Z.createElement(t,e);e.ref;var n=rbe(e,Kxe);return Z.createElement(OC,n)}var mI=1,hd=function(t){function e(){var n;Yxe(this,e);for(var r=arguments.length,i=new Array(r),o=0;omI||Math.abs(i.height-this.lastBoundingBox.height)>mI)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,r&&r(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Oa({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var i=this.props,o=i.layout,a=i.align,s=i.verticalAlign,l=i.margin,c=i.chartWidth,u=i.chartHeight,d,f;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(a==="center"&&o==="vertical"){var p=this.getBBoxSnapshot();d={left:((c||0)-p.width)/2}}else d=a==="right"?{right:l&&l.right||0}:{left:l&&l.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(s==="middle"){var y=this.getBBoxSnapshot();f={top:((u||0)-y.height)/2}}else f=s==="bottom"?{bottom:l&&l.bottom||0}:{top:l&&l.top||0};return Oa(Oa({},d),f)}},{key:"render",value:function(){var r=this,i=this.props,o=i.content,a=i.width,s=i.height,l=i.wrapperStyle,c=i.payloadUniqBy,u=i.payload,d=Oa(Oa({position:"absolute",width:a||"auto",height:s||"auto"},this.getDefaultPosition(l)),l);return Z.createElement("div",{className:"recharts-legend-wrapper",style:d,ref:function(p){r.wrapperNode=p}},abe(o,Oa(Oa({},this.props),{},{payload:$5(u,c,obe)})))}}],[{key:"getWithHeight",value:function(r,i){var o=Oa(Oa({},this.defaultProps),r.props),a=o.layout;return a==="vertical"&&ze(r.props.height)?{height:r.props.height}:a==="horizontal"?{width:r.props.width||i}:null}}])}(_.PureComponent);_b(hd,"displayName","Legend");_b(hd,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var gI=Um,sbe=DC,lbe=yi,vI=gI?gI.isConcatSpreadable:void 0;function cbe(t){return lbe(t)||sbe(t)||!!(vI&&t&&t[vI])}var ube=cbe,dbe=R5,fbe=ube;function V5(t,e,n,r,i){var o=-1,a=t.length;for(n||(n=fbe),i||(i=[]);++o0&&n(s)?e>1?V5(s,e-1,n,r,i):dbe(i,s):r||(i[i.length]=s)}return i}var G5=V5;function hbe(t){return function(e,n,r){for(var i=-1,o=Object(e),a=r(e),s=a.length;s--;){var l=a[t?s:++i];if(n(o[l],l,o)===!1)break}return e}}var pbe=hbe,mbe=pbe,gbe=mbe(),vbe=gbe,ybe=vbe,xbe=jC;function bbe(t,e){return t&&ybe(t,e,xbe)}var W5=bbe,_be=bb;function wbe(t,e){return function(n,r){if(n==null)return n;if(!_be(n))return t(n,r);for(var i=n.length,o=e?i:-1,a=Object(n);(e?o--:++oe||o&&a&&l&&!s&&!c||r&&a&&l||!n&&l||!i)return 1;if(!r&&!o&&!c&&t=s)return l;var c=n[r];return l*(c=="desc"?-1:1)}}return t.index-e.index}var kbe=Lbe,Hw=wC,jbe=SC,Ube=kf,Fbe=X5,Bbe=Nbe,$be=I5,zbe=kbe,Hbe=Lf,Vbe=yi;function Gbe(t,e,n){e.length?e=Hw(e,function(o){return Vbe(o)?function(a){return jbe(a,o.length===1?o[0]:o)}:o}):e=[Hbe];var r=-1;e=Hw(e,$be(Ube));var i=Fbe(t,function(o,a,s){var l=Hw(e,function(c){return c(o)});return{criteria:l,index:++r,value:o}});return Bbe(i,function(o,a){return zbe(o,a,n)})}var Wbe=Gbe;function Xbe(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var qbe=Xbe,Kbe=qbe,xI=Math.max;function Ybe(t,e,n){return e=xI(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=xI(r.length-e,0),a=Array(o);++i0){if(++e>=a_e)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var u_e=c_e,d_e=o_e,f_e=u_e,h_e=f_e(d_e),p_e=h_e,m_e=Lf,g_e=Jbe,v_e=p_e;function y_e(t,e){return v_e(g_e(t,e,m_e),t+"")}var x_e=y_e,b_e=yC,__e=bb,w_e=LC,S_e=Al;function E_e(t,e,n){if(!S_e(n))return!1;var r=typeof e;return(r=="number"?__e(n)&&w_e(e,n.length):r=="string"&&e in n)?b_e(n[e],t):!1}var wb=E_e,T_e=G5,M_e=Wbe,A_e=x_e,_I=wb,C_e=A_e(function(t,e){if(t==null)return[];var n=e.length;return n>1&&_I(t,e[0],e[1])?e=[]:n>2&&_I(e[0],e[1],e[2])&&(e=[e[0]]),M_e(t,T_e(e,1),[])}),P_e=C_e;const BC=dn(P_e);function Dp(t){"@babel/helpers - typeof";return Dp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Dp(t)}function G1(){return G1=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=e.x),"".concat(hh,"-left"),ze(n)&&e&&ze(e.x)&&n=e.y),"".concat(hh,"-top"),ze(r)&&e&&ze(e.y)&&rv?Math.max(u,l[r]):Math.max(d,l[r])}function V_e(t){var e=t.translateX,n=t.translateY,r=t.useTranslate3d;return{transform:r?"translate3d(".concat(e,"px, ").concat(n,"px, 0)"):"translate(".concat(e,"px, ").concat(n,"px)")}}function G_e(t){var e=t.allowEscapeViewBox,n=t.coordinate,r=t.offsetTopLeft,i=t.position,o=t.reverseDirection,a=t.tooltipBox,s=t.useTranslate3d,l=t.viewBox,c,u,d;return a.height>0&&a.width>0&&n?(u=EI({allowEscapeViewBox:e,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:a.width,viewBox:l,viewBoxDimension:l.width}),d=EI({allowEscapeViewBox:e,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:a.height,viewBox:l,viewBoxDimension:l.height}),c=V_e({translateX:u,translateY:d,useTranslate3d:s})):c=z_e,{cssProperties:c,cssClasses:H_e({translateX:u,translateY:d,coordinate:n})}}function Wd(t){"@babel/helpers - typeof";return Wd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Wd(t)}function TI(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 MI(t){for(var e=1;eAI||Math.abs(r.height-this.state.lastBoundingBox.height)>AI)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,i=this.props,o=i.active,a=i.allowEscapeViewBox,s=i.animationDuration,l=i.animationEasing,c=i.children,u=i.coordinate,d=i.hasPayload,f=i.isAnimationActive,p=i.offset,y=i.position,v=i.reverseDirection,g=i.useTranslate3d,m=i.viewBox,x=i.wrapperStyle,b=G_e({allowEscapeViewBox:a,coordinate:u,offsetTopLeft:p,position:y,reverseDirection:v,tooltipBox:this.state.lastBoundingBox,useTranslate3d:g,viewBox:m}),S=b.cssClasses,w=b.cssProperties,E=MI(MI({transition:f&&o?"transform ".concat(s,"ms ").concat(l):void 0},w),{},{pointerEvents:"none",visibility:!this.state.dismissed&&o&&d?"visible":"hidden",position:"absolute",top:0,left:0},x);return Z.createElement("div",{tabIndex:-1,className:S,style:E,ref:function(A){r.wrapperNode=A}},c)}}])}(_.PureComponent),twe=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},jf={isSsr:twe()};function Xd(t){"@babel/helpers - typeof";return Xd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xd(t)}function CI(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 PI(t){for(var e=1;e0;return Z.createElement(ewe,{allowEscapeViewBox:a,animationDuration:s,animationEasing:l,isAnimationActive:f,active:o,coordinate:u,hasPayload:E,offset:p,position:g,reverseDirection:m,useTranslate3d:x,viewBox:b,wrapperStyle:S},dwe(c,PI(PI({},this.props),{},{payload:w})))}}])}(_.PureComponent);$C(So,"displayName","Tooltip");$C(So,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!jf.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var fwe=wa,hwe=function(){return fwe.Date.now()},pwe=hwe,mwe=/\s/;function gwe(t){for(var e=t.length;e--&&mwe.test(t.charAt(e)););return e}var vwe=gwe,ywe=vwe,xwe=/^\s+/;function bwe(t){return t&&t.slice(0,ywe(t)+1).replace(xwe,"")}var _we=bwe,wwe=_we,RI=Al,Swe=Cf,NI=NaN,Ewe=/^[-+]0x[0-9a-f]+$/i,Twe=/^0b[01]+$/i,Mwe=/^0o[0-7]+$/i,Awe=parseInt;function Cwe(t){if(typeof t=="number")return t;if(Swe(t))return NI;if(RI(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=RI(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=wwe(t);var n=Twe.test(t);return n||Mwe.test(t)?Awe(t.slice(2),n?2:8):Ewe.test(t)?NI:+t}var Q5=Cwe,Pwe=Al,Gw=pwe,OI=Q5,Rwe="Expected a function",Nwe=Math.max,Owe=Math.min;function Iwe(t,e,n){var r,i,o,a,s,l,c=0,u=!1,d=!1,f=!0;if(typeof t!="function")throw new TypeError(Rwe);e=OI(e)||0,Pwe(n)&&(u=!!n.leading,d="maxWait"in n,o=d?Nwe(OI(n.maxWait)||0,e):o,f="trailing"in n?!!n.trailing:f);function p(E){var T=r,A=i;return r=i=void 0,c=E,a=t.apply(A,T),a}function y(E){return c=E,s=setTimeout(m,e),u?p(E):a}function v(E){var T=E-l,A=E-c,M=e-T;return d?Owe(M,o-A):M}function g(E){var T=E-l,A=E-c;return l===void 0||T>=e||T<0||d&&A>=o}function m(){var E=Gw();if(g(E))return x(E);s=setTimeout(m,v(E))}function x(E){return s=void 0,f&&r?p(E):(r=i=void 0,a)}function b(){s!==void 0&&clearTimeout(s),c=0,r=l=i=s=void 0}function S(){return s===void 0?a:x(Gw())}function w(){var E=Gw(),T=g(E);if(r=arguments,i=this,l=E,T){if(s===void 0)return y(l);if(d)return clearTimeout(s),s=setTimeout(m,e),p(l)}return s===void 0&&(s=setTimeout(m,e)),a}return w.cancel=b,w.flush=S,w}var Dwe=Iwe,Lwe=Dwe,kwe=Al,jwe="Expected a function";function Uwe(t,e,n){var r=!0,i=!0;if(typeof t!="function")throw new TypeError(jwe);return kwe(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Lwe(t,e,{leading:r,maxWait:e,trailing:i})}var Fwe=Uwe;const eH=dn(Fwe);function kp(t){"@babel/helpers - typeof";return kp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},kp(t)}function II(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 cv(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&(D=eH(D,v,{trailing:!0,leading:!1}));var k=new ResizeObserver(D),U=w.current.getBoundingClientRect(),O=U.width,W=U.height;return P(O,W),k.observe(w.current),function(){k.disconnect()}},[P,v]);var R=_.useMemo(function(){var D=M.containerWidth,k=M.containerHeight;if(D<0||k<0)return null;vc(tc(a)||tc(l),`The width(%s) and height(%s) are both fixed numbers, + maybe you don't need to use a ResponsiveContainer.`,a,l),vc(!n||n>0,"The aspect(%s) must be greater than zero.",n);var U=tc(a)?D:a,O=tc(l)?k:l;n&&n>0&&(U?O=U/n:O&&(U=O*n),f&&O>f&&(O=f)),vc(U>0||O>0,`The width(%s) and height(%s) of chart should be greater than 0, + please check the style of container, or the props width(%s) and height(%s), + or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the + height and width.`,U,O,a,l,u,d,n);var W=!Array.isArray(p)&&Ka(p.type).endsWith("Chart");return Z.Children.map(p,function(L){return Z.isValidElement(L)?_.cloneElement(L,cv({width:U,height:O},W?{style:cv({height:"100%",width:"100%",maxHeight:O,maxWidth:U},L.props.style)}:{})):L})},[n,p,l,f,d,u,M,a]);return Z.createElement("div",{id:g?"".concat(g):void 0,className:zt("recharts-responsive-container",m),style:cv(cv({},S),{},{width:a,height:l,minWidth:u,minHeight:d,maxHeight:f}),ref:w},R)}),tH=function(e){return null};tH.displayName="Cell";function jp(t){"@babel/helpers - typeof";return jp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jp(t)}function kI(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 K1(t){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||jf.isSsr)return{width:0,height:0};var r=Qwe(n),i=JSON.stringify({text:e,copyStyle:r});if(Su.widthCache[i])return Su.widthCache[i];try{var o=document.getElementById(jI);o||(o=document.createElement("span"),o.setAttribute("id",jI),o.setAttribute("aria-hidden","true"),document.body.appendChild(o));var a=K1(K1({},Zwe),r);Object.assign(o.style,a),o.textContent="".concat(e);var s=o.getBoundingClientRect(),l={width:s.width,height:s.height};return Su.widthCache[i]=l,++Su.cacheCount>Jwe&&(Su.cacheCount=0,Su.widthCache={}),l}catch{return{width:0,height:0}}},eSe=function(e){return{top:e.top+window.scrollY-document.documentElement.clientTop,left:e.left+window.scrollX-document.documentElement.clientLeft}};function Up(t){"@babel/helpers - typeof";return Up=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Up(t)}function Yy(t,e){return iSe(t)||rSe(t,e)||nSe(t,e)||tSe()}function tSe(){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 nSe(t,e){if(t){if(typeof t=="string")return UI(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return UI(t,e)}}function UI(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function ySe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function VI(t,e){return wSe(t)||_Se(t,e)||bSe(t,e)||xSe()}function xSe(){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 bSe(t,e){if(t){if(typeof t=="string")return GI(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return GI(t,e)}}function GI(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&arguments[0]!==void 0?arguments[0]:[];return U.reduce(function(O,W){var L=W.word,j=W.width,X=O[O.length-1];if(X&&(i==null||o||X.width+j+rW.width?O:W})};if(!u)return p;for(var v="โ€ฆ",g=function(U){var O=d.slice(0,U),W=oH({breakAll:c,style:l,children:O+v}).wordsWithComputedWidth,L=f(W),j=L.length>a||y(L).width>Number(i);return[j,L]},m=0,x=d.length-1,b=0,S;m<=x&&b<=d.length-1;){var w=Math.floor((m+x)/2),E=w-1,T=g(E),A=VI(T,2),M=A[0],C=A[1],P=g(w),R=VI(P,1),D=R[0];if(!M&&!D&&(m=w+1),M&&D&&(x=w-1),!M&&D){S=C;break}b++}return S||p},WI=function(e){var n=Ut(e)?[]:e.toString().split(iH);return[{words:n}]},ESe=function(e){var n=e.width,r=e.scaleToFit,i=e.children,o=e.style,a=e.breakAll,s=e.maxLines;if((n||r)&&!jf.isSsr){var l,c,u=oH({breakAll:a,children:i,style:o});if(u){var d=u.wordsWithComputedWidth,f=u.spaceWidth;l=d,c=f}else return WI(i);return SSe({breakAll:a,children:i,maxLines:s,style:o},l,c,n,r)}return WI(i)},XI="#808080",Jy=function(e){var n=e.x,r=n===void 0?0:n,i=e.y,o=i===void 0?0:i,a=e.lineHeight,s=a===void 0?"1em":a,l=e.capHeight,c=l===void 0?"0.71em":l,u=e.scaleToFit,d=u===void 0?!1:u,f=e.textAnchor,p=f===void 0?"start":f,y=e.verticalAnchor,v=y===void 0?"end":y,g=e.fill,m=g===void 0?XI:g,x=HI(e,gSe),b=_.useMemo(function(){return ESe({breakAll:x.breakAll,children:x.children,maxLines:x.maxLines,scaleToFit:d,style:x.style,width:x.width})},[x.breakAll,x.children,x.maxLines,d,x.style,x.width]),S=x.dx,w=x.dy,E=x.angle,T=x.className,A=x.breakAll,M=HI(x,vSe);if(!Yn(r)||!Yn(o))return null;var C=r+(ze(S)?S:0),P=o+(ze(w)?w:0),R;switch(v){case"start":R=Ww("calc(".concat(c,")"));break;case"middle":R=Ww("calc(".concat((b.length-1)/2," * -").concat(s," + (").concat(c," / 2))"));break;default:R=Ww("calc(".concat(b.length-1," * -").concat(s,")"));break}var D=[];if(d){var k=b[0].width,U=x.width;D.push("scale(".concat((ze(U)?U/k:1)/k,")"))}return E&&D.push("rotate(".concat(E,", ").concat(C,", ").concat(P,")")),D.length&&(M.transform=D.join(" ")),Z.createElement("text",Y1({},$t(M,!0),{x:C,y:P,className:zt("recharts-text",T),textAnchor:p,fill:m.includes("url")?XI:m}),b.map(function(O,W){var L=O.words.join(A?"":" ");return Z.createElement("tspan",{x:C,dy:W===0?R:s,key:"".concat(L,"-").concat(W)},L)}))};function nl(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function TSe(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function zC(t){let e,n,r;t.length!==2?(e=nl,n=(s,l)=>nl(t(s),l),r=(s,l)=>t(s)-l):(e=t===nl||t===TSe?t:MSe,n=t,r=t);function i(s,l,c=0,u=s.length){if(c>>1;n(s[d],l)<0?c=d+1:u=d}while(c>>1;n(s[d],l)<=0?c=d+1:u=d}while(cc&&r(s[d-1],l)>-r(s[d],l)?d-1:d}return{left:i,center:a,right:o}}function MSe(){return 0}function aH(t){return t===null?NaN:+t}function*ASe(t,e){for(let n of t)n!=null&&(n=+n)>=n&&(yield n)}const CSe=zC(nl),$m=CSe.right;zC(aH).center;class qI extends Map{constructor(e,n=NSe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const[r,i]of e)this.set(r,i)}get(e){return super.get(KI(this,e))}has(e){return super.has(KI(this,e))}set(e,n){return super.set(PSe(this,e),n)}delete(e){return super.delete(RSe(this,e))}}function KI({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function PSe({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function RSe({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function NSe(t){return t!==null&&typeof t=="object"?t.valueOf():t}function OSe(t=nl){if(t===nl)return sH;if(typeof t!="function")throw new TypeError("compare is not a function");return(e,n)=>{const r=t(e,n);return r||r===0?r:(t(n,n)===0)-(t(e,e)===0)}}function sH(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(te?1:0)}const ISe=Math.sqrt(50),DSe=Math.sqrt(10),LSe=Math.sqrt(2);function Zy(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=ISe?10:o>=DSe?5:o>=LSe?2:1;let s,l,c;return i<0?(c=Math.pow(10,-i)/a,s=Math.round(t*c),l=Math.round(e*c),s/ce&&--l,c=-c):(c=Math.pow(10,i)*a,s=Math.round(t/c),l=Math.round(e/c),s*ce&&--l),l0))return[];if(t===e)return[t];const r=e=i))return[];const s=o-i+1,l=new Array(s);if(r)if(a<0)for(let c=0;c=r)&&(n=r);return n}function JI(t,e){let n;for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function lH(t,e,n=0,r=1/0,i){if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(t.length-1,r)),!(n<=e&&e<=r))return t;for(i=i===void 0?sH:OSe(i);r>n;){if(r-n>600){const l=r-n+1,c=e-n+1,u=Math.log(l),d=.5*Math.exp(2*u/3),f=.5*Math.sqrt(u*d*(l-d)/l)*(c-l/2<0?-1:1),p=Math.max(n,Math.floor(e-c*d/l+f)),y=Math.min(r,Math.floor(e+(l-c)*d/l+f));lH(t,e,p,y,i)}const o=t[e];let a=n,s=r;for(ph(t,n,e),i(t[r],o)>0&&ph(t,n,r);a0;)--s}i(t[n],o)===0?ph(t,n,s):(++s,ph(t,s,r)),s<=e&&(n=s+1),e<=s&&(r=s-1)}return t}function ph(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function kSe(t,e,n){if(t=Float64Array.from(ASe(t)),!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return JI(t);if(e>=1)return YI(t);var r,i=(r-1)*e,o=Math.floor(i),a=YI(lH(t,o).subarray(0,o+1)),s=JI(t.subarray(o+1));return a+(s-a)*(i-o)}}function jSe(t,e,n=aH){if(!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,o=Math.floor(i),a=+n(t[o],o,t),s=+n(t[o+1],o+1,t);return a+(s-a)*(i-o)}}function USe(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((e-t)/n))|0,o=new Array(i);++r>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?dv(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?dv(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=BSe.exec(t))?new ai(e[1],e[2],e[3],1):(e=$Se.exec(t))?new ai(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=zSe.exec(t))?dv(e[1],e[2],e[3],e[4]):(e=HSe.exec(t))?dv(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=VSe.exec(t))?iD(e[1],e[2]/100,e[3]/100,1):(e=GSe.exec(t))?iD(e[1],e[2]/100,e[3]/100,e[4]):ZI.hasOwnProperty(t)?tD(ZI[t]):t==="transparent"?new ai(NaN,NaN,NaN,0):null}function tD(t){return new ai(t>>16&255,t>>8&255,t&255,1)}function dv(t,e,n,r){return r<=0&&(t=e=n=NaN),new ai(t,e,n,r)}function qSe(t){return t instanceof zm||(t=zp(t)),t?(t=t.rgb(),new ai(t.r,t.g,t.b,t.opacity)):new ai}function tT(t,e,n,r){return arguments.length===1?qSe(t):new ai(t,e,n,r??1)}function ai(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}VC(ai,tT,uH(zm,{brighter(t){return t=t==null?Qy:Math.pow(Qy,t),new ai(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Bp:Math.pow(Bp,t),new ai(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new ai(yc(this.r),yc(this.g),yc(this.b),e0(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:nD,formatHex:nD,formatHex8:KSe,formatRgb:rD,toString:rD}));function nD(){return`#${nc(this.r)}${nc(this.g)}${nc(this.b)}`}function KSe(){return`#${nc(this.r)}${nc(this.g)}${nc(this.b)}${nc((isNaN(this.opacity)?1:this.opacity)*255)}`}function rD(){const t=e0(this.opacity);return`${t===1?"rgb(":"rgba("}${yc(this.r)}, ${yc(this.g)}, ${yc(this.b)}${t===1?")":`, ${t})`}`}function e0(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function yc(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function nc(t){return t=yc(t),(t<16?"0":"")+t.toString(16)}function iD(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new No(t,e,n,r)}function dH(t){if(t instanceof No)return new No(t.h,t.s,t.l,t.opacity);if(t instanceof zm||(t=zp(t)),!t)return new No;if(t instanceof No)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(e===o?a=(n-r)/s+(n0&&l<1?0:a,new No(a,s,l,t.opacity)}function YSe(t,e,n,r){return arguments.length===1?dH(t):new No(t,e,n,r??1)}function No(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}VC(No,YSe,uH(zm,{brighter(t){return t=t==null?Qy:Math.pow(Qy,t),new No(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Bp:Math.pow(Bp,t),new No(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 ai(Xw(t>=240?t-240:t+120,i,r),Xw(t,i,r),Xw(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new No(oD(this.h),fv(this.s),fv(this.l),e0(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=e0(this.opacity);return`${t===1?"hsl(":"hsla("}${oD(this.h)}, ${fv(this.s)*100}%, ${fv(this.l)*100}%${t===1?")":`, ${t})`}`}}));function oD(t){return t=(t||0)%360,t<0?t+360:t}function fv(t){return Math.max(0,Math.min(1,t||0))}function Xw(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 GC=t=>()=>t;function JSe(t,e){return function(n){return t+n*e}}function ZSe(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 QSe(t){return(t=+t)==1?fH:function(e,n){return n-e?ZSe(e,n,t):GC(isNaN(e)?n:e)}}function fH(t,e){var n=e-t;return n?JSe(t,n):GC(isNaN(t)?e:t)}const aD=function t(e){var n=QSe(e);function r(i,o){var a=n((i=tT(i)).r,(o=tT(o)).r),s=n(i.g,o.g),l=n(i.b,o.b),c=fH(i.opacity,o.opacity);return function(u){return i.r=a(u),i.g=s(u),i.b=l(u),i.opacity=c(u),i+""}}return r.gamma=t,r}(1);function eEe(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),i;return function(o){for(i=0;in&&(o=e.slice(n,o),s[a]?s[a]+=o:s[++a]=o),(r=r[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,l.push({i:a,x:t0(r,i)})),n=qw.lastIndex;return ne&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function dEe(t,e,n){var r=t[0],i=t[1],o=e[0],a=e[1];return i2?fEe:dEe,l=c=null,d}function d(f){return f==null||isNaN(f=+f)?o:(l||(l=s(t.map(r),e,n)))(r(a(f)))}return d.invert=function(f){return a(i((c||(c=s(e,t.map(r),t0)))(f)))},d.domain=function(f){return arguments.length?(t=Array.from(f,n0),u()):t.slice()},d.range=function(f){return arguments.length?(e=Array.from(f),u()):e.slice()},d.rangeRound=function(f){return e=Array.from(f),n=WC,u()},d.clamp=function(f){return arguments.length?(a=f?!0:Hr,u()):a!==Hr},d.interpolate=function(f){return arguments.length?(n=f,u()):n},d.unknown=function(f){return arguments.length?(o=f,d):o},function(f,p){return r=f,i=p,u()}}function XC(){return Sb()(Hr,Hr)}function hEe(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function r0(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 qd(t){return t=r0(Math.abs(t)),t?t[1]:NaN}function pEe(t,e){return function(n,r){for(var i=n.length,o=[],a=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),o.push(n.substring(i-=s,i+s)),!((l+=s+1)>r));)s=t[a=(a+1)%t.length];return o.reverse().join(e)}}function mEe(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var gEe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Hp(t){if(!(e=gEe.exec(t)))throw new Error("invalid format: "+t);var e;return new qC({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]})}Hp.prototype=qC.prototype;function qC(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+""}qC.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 vEe(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 hH;function yEe(t,e){var n=r0(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(hH=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+r0(t,Math.max(0,e+o-1))[0]}function lD(t,e){var n=r0(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 cD={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:hEe,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)=>lD(t*100,e),r:lD,s:yEe,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function uD(t){return t}var dD=Array.prototype.map,fD=["y","z","a","f","p","n","ยต","m","","k","M","G","T","P","E","Z","Y"];function xEe(t){var e=t.grouping===void 0||t.thousands===void 0?uD:pEe(dD.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+"",o=t.numerals===void 0?uD:mEe(dD.call(t.numerals,String)),a=t.percent===void 0?"%":t.percent+"",s=t.minus===void 0?"โˆ’":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function c(d){d=Hp(d);var f=d.fill,p=d.align,y=d.sign,v=d.symbol,g=d.zero,m=d.width,x=d.comma,b=d.precision,S=d.trim,w=d.type;w==="n"?(x=!0,w="g"):cD[w]||(b===void 0&&(b=12),S=!0,w="g"),(g||f==="0"&&p==="=")&&(g=!0,f="0",p="=");var E=v==="$"?n:v==="#"&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",T=v==="$"?r:/[%p]/.test(w)?a:"",A=cD[w],M=/[defgprs%]/.test(w);b=b===void 0?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b));function C(P){var R=E,D=T,k,U,O;if(w==="c")D=A(P)+D,P="";else{P=+P;var W=P<0||1/P<0;if(P=isNaN(P)?l:A(Math.abs(P),b),S&&(P=vEe(P)),W&&+P==0&&y!=="+"&&(W=!1),R=(W?y==="("?y:s:y==="-"||y==="("?"":y)+R,D=(w==="s"?fD[8+hH/3]:"")+D+(W&&y==="("?")":""),M){for(k=-1,U=P.length;++kO||O>57){D=(O===46?i+P.slice(k+1):P.slice(k))+D,P=P.slice(0,k);break}}}x&&!g&&(P=e(P,1/0));var L=R.length+P.length+D.length,j=L>1)+R+P+D+j.slice(L);break;default:P=j+R+P+D;break}return o(P)}return C.toString=function(){return d+""},C}function u(d,f){var p=c((d=Hp(d),d.type="f",d)),y=Math.max(-8,Math.min(8,Math.floor(qd(f)/3)))*3,v=Math.pow(10,-y),g=fD[8+y/3];return function(m){return p(v*m)+g}}return{format:c,formatPrefix:u}}var hv,KC,pH;bEe({thousands:",",grouping:[3],currency:["$",""]});function bEe(t){return hv=xEe(t),KC=hv.format,pH=hv.formatPrefix,hv}function _Ee(t){return Math.max(0,-qd(Math.abs(t)))}function wEe(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(qd(e)/3)))*3-qd(Math.abs(t)))}function SEe(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,qd(e)-qd(t))+1}function mH(t,e,n,r){var i=Q1(t,e,n),o;switch(r=Hp(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(o=wEe(i,a))&&(r.precision=o),pH(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=SEe(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=_Ee(i))&&(r.precision=o-(r.type==="%")*2);break}}return KC(r)}function Cl(t){var e=t.domain;return t.ticks=function(n){var r=e();return J1(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return mH(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,o=r.length-1,a=r[i],s=r[o],l,c,u=10;for(s0;){if(c=Z1(a,s,n),c===l)return r[i]=a,r[o]=s,e(r);if(c>0)a=Math.floor(a/c)*c,s=Math.ceil(s/c)*c;else if(c<0)a=Math.ceil(a*c)/c,s=Math.floor(s*c)/c;else break;l=c}return t},t}function i0(){var t=XC();return t.copy=function(){return Hm(t,i0())},lo.apply(t,arguments),Cl(t)}function gH(t){var e;function n(r){return r==null||isNaN(r=+r)?e:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(t=Array.from(r,n0),n):t.slice()},n.unknown=function(r){return arguments.length?(e=r,n):e},n.copy=function(){return gH(t).unknown(e)},t=arguments.length?Array.from(t,n0):[0,1],Cl(n)}function vH(t,e){t=t.slice();var n=0,r=t.length-1,i=t[n],o=t[r],a;return oMath.pow(t,e)}function CEe(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function mD(t){return(e,n)=>-t(-e,n)}function YC(t){const e=t(hD,pD),n=e.domain;let r=10,i,o;function a(){return i=CEe(r),o=AEe(r),n()[0]<0?(i=mD(i),o=mD(o),t(EEe,TEe)):t(hD,pD),e}return e.base=function(s){return arguments.length?(r=+s,a()):r},e.domain=function(s){return arguments.length?(n(s),a()):n()},e.ticks=s=>{const l=n();let c=l[0],u=l[l.length-1];const d=u0){for(;f<=p;++f)for(y=1;yu)break;m.push(v)}}else for(;f<=p;++f)for(y=r-1;y>=1;--y)if(v=f>0?y/o(-f):y*o(f),!(vu)break;m.push(v)}m.length*2{if(s==null&&(s=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=Hp(l)).precision==null&&(l.trim=!0),l=KC(l)),s===1/0)return l;const c=Math.max(1,r*s/e.ticks().length);return u=>{let d=u/o(Math.round(i(u)));return d*rn(vH(n(),{floor:s=>o(Math.floor(i(s))),ceil:s=>o(Math.ceil(i(s)))})),e}function yH(){const t=YC(Sb()).domain([1,10]);return t.copy=()=>Hm(t,yH()).base(t.base()),lo.apply(t,arguments),t}function gD(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function vD(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function JC(t){var e=1,n=t(gD(e),vD(e));return n.constant=function(r){return arguments.length?t(gD(e=+r),vD(e)):e},Cl(n)}function xH(){var t=JC(Sb());return t.copy=function(){return Hm(t,xH()).constant(t.constant())},lo.apply(t,arguments)}function yD(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function PEe(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function REe(t){return t<0?-t*t:t*t}function ZC(t){var e=t(Hr,Hr),n=1;function r(){return n===1?t(Hr,Hr):n===.5?t(PEe,REe):t(yD(n),yD(1/n))}return e.exponent=function(i){return arguments.length?(n=+i,r()):n},Cl(e)}function QC(){var t=ZC(Sb());return t.copy=function(){return Hm(t,QC()).exponent(t.exponent())},lo.apply(t,arguments),t}function NEe(){return QC.apply(null,arguments).exponent(.5)}function xD(t){return Math.sign(t)*t*t}function OEe(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}function bH(){var t=XC(),e=[0,1],n=!1,r;function i(o){var a=OEe(t(o));return isNaN(a)?r:n?Math.round(a):a}return i.invert=function(o){return t.invert(xD(o))},i.domain=function(o){return arguments.length?(t.domain(o),i):t.domain()},i.range=function(o){return arguments.length?(t.range((e=Array.from(o,n0)).map(xD)),i):e.slice()},i.rangeRound=function(o){return i.range(o).round(!0)},i.round=function(o){return arguments.length?(n=!!o,i):n},i.clamp=function(o){return arguments.length?(t.clamp(o),i):t.clamp()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return bH(t.domain(),e).round(n).clamp(t.clamp()).unknown(r)},lo.apply(i,arguments),Cl(i)}function _H(){var t=[],e=[],n=[],r;function i(){var a=0,s=Math.max(1,e.length);for(n=new Array(s-1);++a0?n[s-1]:t[0],s=n?[r[n-1],e]:[r[c-1],r[c]]},a.unknown=function(l){return arguments.length&&(o=l),a},a.thresholds=function(){return r.slice()},a.copy=function(){return wH().domain([t,e]).range(i).unknown(o)},lo.apply(Cl(a),arguments)}function SH(){var t=[.5],e=[0,1],n,r=1;function i(o){return o!=null&&o<=o?e[$m(t,o,0,r)]:n}return i.domain=function(o){return arguments.length?(t=Array.from(o),r=Math.min(t.length,e.length-1),i):t.slice()},i.range=function(o){return arguments.length?(e=Array.from(o),r=Math.min(t.length,e.length-1),i):e.slice()},i.invertExtent=function(o){var a=e.indexOf(o);return[t[a-1],t[a]]},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return SH().domain(t).range(e).unknown(n)},lo.apply(i,arguments)}const Kw=new Date,Yw=new Date;function tr(t,e,n,r){function i(o){return t(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(t(o=new Date(+o)),o),i.ceil=o=>(t(o=new Date(o-1)),e(o,1),t(o),o),i.round=o=>{const a=i(o),s=i.ceil(o);return o-a(e(o=new Date(+o),a==null?1:Math.floor(a)),o),i.range=(o,a,s)=>{const l=[];if(o=i.ceil(o),s=s==null?1:Math.floor(s),!(o0))return l;let c;do l.push(c=new Date(+o)),e(o,s),t(o);while(ctr(a=>{if(a>=a)for(;t(a),!o(a);)a.setTime(a-1)},(a,s)=>{if(a>=a)if(s<0)for(;++s<=0;)for(;e(a,-1),!o(a););else for(;--s>=0;)for(;e(a,1),!o(a););}),n&&(i.count=(o,a)=>(Kw.setTime(+o),Yw.setTime(+a),t(Kw),t(Yw),Math.floor(n(Kw,Yw))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?a=>r(a)%o===0:a=>i.count(0,a)%o===0):i)),i}const o0=tr(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);o0.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?tr(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):o0);o0.range;const Ha=1e3,Qi=Ha*60,Va=Qi*60,is=Va*24,eP=is*7,bD=is*30,Jw=is*365,rc=tr(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*Ha)},(t,e)=>(e-t)/Ha,t=>t.getUTCSeconds());rc.range;const tP=tr(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Ha)},(t,e)=>{t.setTime(+t+e*Qi)},(t,e)=>(e-t)/Qi,t=>t.getMinutes());tP.range;const nP=tr(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*Qi)},(t,e)=>(e-t)/Qi,t=>t.getUTCMinutes());nP.range;const rP=tr(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Ha-t.getMinutes()*Qi)},(t,e)=>{t.setTime(+t+e*Va)},(t,e)=>(e-t)/Va,t=>t.getHours());rP.range;const iP=tr(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*Va)},(t,e)=>(e-t)/Va,t=>t.getUTCHours());iP.range;const Vm=tr(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Qi)/is,t=>t.getDate()-1);Vm.range;const Eb=tr(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/is,t=>t.getUTCDate()-1);Eb.range;const EH=tr(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/is,t=>Math.floor(t/is));EH.range;function Kc(t){return tr(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*Qi)/eP)}const Tb=Kc(0),a0=Kc(1),IEe=Kc(2),DEe=Kc(3),Kd=Kc(4),LEe=Kc(5),kEe=Kc(6);Tb.range;a0.range;IEe.range;DEe.range;Kd.range;LEe.range;kEe.range;function Yc(t){return tr(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/eP)}const Mb=Yc(0),s0=Yc(1),jEe=Yc(2),UEe=Yc(3),Yd=Yc(4),FEe=Yc(5),BEe=Yc(6);Mb.range;s0.range;jEe.range;UEe.range;Yd.range;FEe.range;BEe.range;const oP=tr(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());oP.range;const aP=tr(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());aP.range;const os=tr(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());os.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:tr(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});os.range;const as=tr(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());as.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:tr(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});as.range;function TH(t,e,n,r,i,o){const a=[[rc,1,Ha],[rc,5,5*Ha],[rc,15,15*Ha],[rc,30,30*Ha],[o,1,Qi],[o,5,5*Qi],[o,15,15*Qi],[o,30,30*Qi],[i,1,Va],[i,3,3*Va],[i,6,6*Va],[i,12,12*Va],[r,1,is],[r,2,2*is],[n,1,eP],[e,1,bD],[e,3,3*bD],[t,1,Jw]];function s(c,u,d){const f=ug).right(a,f);if(p===a.length)return t.every(Q1(c/Jw,u/Jw,d));if(p===0)return o0.every(Math.max(Q1(c,u,d),1));const[y,v]=a[f/a[p-1][2]53)return null;"w"in le||(le.w=1),"Z"in le?(G=Qw(mh(le.y,0,1)),Ve=G.getUTCDay(),G=Ve>4||Ve===0?s0.ceil(G):s0(G),G=Eb.offset(G,(le.V-1)*7),le.y=G.getUTCFullYear(),le.m=G.getUTCMonth(),le.d=G.getUTCDate()+(le.w+6)%7):(G=Zw(mh(le.y,0,1)),Ve=G.getDay(),G=Ve>4||Ve===0?a0.ceil(G):a0(G),G=Vm.offset(G,(le.V-1)*7),le.y=G.getFullYear(),le.m=G.getMonth(),le.d=G.getDate()+(le.w+6)%7)}else("W"in le||"U"in le)&&("w"in le||(le.w="u"in le?le.u%7:"W"in le?1:0),Ve="Z"in le?Qw(mh(le.y,0,1)).getUTCDay():Zw(mh(le.y,0,1)).getDay(),le.m=0,le.d="W"in le?(le.w+6)%7+le.W*7-(Ve+5)%7:le.w+le.U*7-(Ve+6)%7);return"Z"in le?(le.H+=le.Z/100|0,le.M+=le.Z%100,Qw(le)):Zw(le)}}function A(ae,fe,we,le){for(var ie=0,G=fe.length,Ve=we.length,Ne,st;ie=Ve)return-1;if(Ne=fe.charCodeAt(ie++),Ne===37){if(Ne=fe.charAt(ie++),st=w[Ne in _D?fe.charAt(ie++):Ne],!st||(le=st(ae,we,le))<0)return-1}else if(Ne!=we.charCodeAt(le++))return-1}return le}function M(ae,fe,we){var le=c.exec(fe.slice(we));return le?(ae.p=u.get(le[0].toLowerCase()),we+le[0].length):-1}function C(ae,fe,we){var le=p.exec(fe.slice(we));return le?(ae.w=y.get(le[0].toLowerCase()),we+le[0].length):-1}function P(ae,fe,we){var le=d.exec(fe.slice(we));return le?(ae.w=f.get(le[0].toLowerCase()),we+le[0].length):-1}function R(ae,fe,we){var le=m.exec(fe.slice(we));return le?(ae.m=x.get(le[0].toLowerCase()),we+le[0].length):-1}function D(ae,fe,we){var le=v.exec(fe.slice(we));return le?(ae.m=g.get(le[0].toLowerCase()),we+le[0].length):-1}function k(ae,fe,we){return A(ae,e,fe,we)}function U(ae,fe,we){return A(ae,n,fe,we)}function O(ae,fe,we){return A(ae,r,fe,we)}function W(ae){return a[ae.getDay()]}function L(ae){return o[ae.getDay()]}function j(ae){return l[ae.getMonth()]}function X(ae){return s[ae.getMonth()]}function K(ae){return i[+(ae.getHours()>=12)]}function F(ae){return 1+~~(ae.getMonth()/3)}function Y(ae){return a[ae.getUTCDay()]}function q(ae){return o[ae.getUTCDay()]}function Q(ae){return l[ae.getUTCMonth()]}function te(ae){return s[ae.getUTCMonth()]}function ee(ae){return i[+(ae.getUTCHours()>=12)]}function ce(ae){return 1+~~(ae.getUTCMonth()/3)}return{format:function(ae){var fe=E(ae+="",b);return fe.toString=function(){return ae},fe},parse:function(ae){var fe=T(ae+="",!1);return fe.toString=function(){return ae},fe},utcFormat:function(ae){var fe=E(ae+="",S);return fe.toString=function(){return ae},fe},utcParse:function(ae){var fe=T(ae+="",!0);return fe.toString=function(){return ae},fe}}}var _D={"-":"",_:" ",0:"0"},dr=/^\s*\d+/,WEe=/^%/,XEe=/[\\^$*+?|[\]().{}]/g;function qt(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o[e.toLowerCase(),n]))}function KEe(t,e,n){var r=dr.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function YEe(t,e,n){var r=dr.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function JEe(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function ZEe(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function QEe(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function wD(t,e,n){var r=dr.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function SD(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function e1e(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function t1e(t,e,n){var r=dr.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function n1e(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function ED(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function r1e(t,e,n){var r=dr.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function TD(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function i1e(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function o1e(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function a1e(t,e,n){var r=dr.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function s1e(t,e,n){var r=dr.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function l1e(t,e,n){var r=WEe.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function c1e(t,e,n){var r=dr.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function u1e(t,e,n){var r=dr.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function MD(t,e){return qt(t.getDate(),e,2)}function d1e(t,e){return qt(t.getHours(),e,2)}function f1e(t,e){return qt(t.getHours()%12||12,e,2)}function h1e(t,e){return qt(1+Vm.count(os(t),t),e,3)}function MH(t,e){return qt(t.getMilliseconds(),e,3)}function p1e(t,e){return MH(t,e)+"000"}function m1e(t,e){return qt(t.getMonth()+1,e,2)}function g1e(t,e){return qt(t.getMinutes(),e,2)}function v1e(t,e){return qt(t.getSeconds(),e,2)}function y1e(t){var e=t.getDay();return e===0?7:e}function x1e(t,e){return qt(Tb.count(os(t)-1,t),e,2)}function AH(t){var e=t.getDay();return e>=4||e===0?Kd(t):Kd.ceil(t)}function b1e(t,e){return t=AH(t),qt(Kd.count(os(t),t)+(os(t).getDay()===4),e,2)}function _1e(t){return t.getDay()}function w1e(t,e){return qt(a0.count(os(t)-1,t),e,2)}function S1e(t,e){return qt(t.getFullYear()%100,e,2)}function E1e(t,e){return t=AH(t),qt(t.getFullYear()%100,e,2)}function T1e(t,e){return qt(t.getFullYear()%1e4,e,4)}function M1e(t,e){var n=t.getDay();return t=n>=4||n===0?Kd(t):Kd.ceil(t),qt(t.getFullYear()%1e4,e,4)}function A1e(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+qt(e/60|0,"0",2)+qt(e%60,"0",2)}function AD(t,e){return qt(t.getUTCDate(),e,2)}function C1e(t,e){return qt(t.getUTCHours(),e,2)}function P1e(t,e){return qt(t.getUTCHours()%12||12,e,2)}function R1e(t,e){return qt(1+Eb.count(as(t),t),e,3)}function CH(t,e){return qt(t.getUTCMilliseconds(),e,3)}function N1e(t,e){return CH(t,e)+"000"}function O1e(t,e){return qt(t.getUTCMonth()+1,e,2)}function I1e(t,e){return qt(t.getUTCMinutes(),e,2)}function D1e(t,e){return qt(t.getUTCSeconds(),e,2)}function L1e(t){var e=t.getUTCDay();return e===0?7:e}function k1e(t,e){return qt(Mb.count(as(t)-1,t),e,2)}function PH(t){var e=t.getUTCDay();return e>=4||e===0?Yd(t):Yd.ceil(t)}function j1e(t,e){return t=PH(t),qt(Yd.count(as(t),t)+(as(t).getUTCDay()===4),e,2)}function U1e(t){return t.getUTCDay()}function F1e(t,e){return qt(s0.count(as(t)-1,t),e,2)}function B1e(t,e){return qt(t.getUTCFullYear()%100,e,2)}function $1e(t,e){return t=PH(t),qt(t.getUTCFullYear()%100,e,2)}function z1e(t,e){return qt(t.getUTCFullYear()%1e4,e,4)}function H1e(t,e){var n=t.getUTCDay();return t=n>=4||n===0?Yd(t):Yd.ceil(t),qt(t.getUTCFullYear()%1e4,e,4)}function V1e(){return"+0000"}function CD(){return"%"}function PD(t){return+t}function RD(t){return Math.floor(+t/1e3)}var Eu,RH,NH;G1e({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function G1e(t){return Eu=GEe(t),RH=Eu.format,Eu.parse,NH=Eu.utcFormat,Eu.utcParse,Eu}function W1e(t){return new Date(t)}function X1e(t){return t instanceof Date?+t:+new Date(+t)}function sP(t,e,n,r,i,o,a,s,l,c){var u=XC(),d=u.invert,f=u.domain,p=c(".%L"),y=c(":%S"),v=c("%I:%M"),g=c("%I %p"),m=c("%a %d"),x=c("%b %d"),b=c("%B"),S=c("%Y");function w(E){return(l(E)e(i/(t.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,o)=>kSe(t,o/r))},n.copy=function(){return LH(e).domain(t)},fs.apply(n,arguments)}function Cb(){var t=0,e=.5,n=1,r=1,i,o,a,s,l,c=Hr,u,d=!1,f;function p(v){return isNaN(v=+v)?f:(v=.5+((v=+u(v))-o)*(r*ve}var tTe=eTe,nTe=FH,rTe=tTe,iTe=Lf;function oTe(t){return t&&t.length?nTe(t,iTe,rTe):void 0}var aTe=oTe;const Pb=dn(aTe);function sTe(t,e){return tt.e^o.s<0?1:-1;for(r=o.d.length,i=t.d.length,e=0,n=rt.d[e]^o.s<0?1:-1;return r===i?0:r>i^o.s<0?1:-1};Ke.decimalPlaces=Ke.dp=function(){var t=this,e=t.d.length-1,n=(e-t.e)*wn;if(e=t.d[e],e)for(;e%10==0;e/=10)n--;return n<0?0:n};Ke.dividedBy=Ke.div=function(t){return Ya(this,new this.constructor(t))};Ke.dividedToIntegerBy=Ke.idiv=function(t){var e=this,n=e.constructor;return un(Ya(e,new n(t),0,1),n.precision)};Ke.equals=Ke.eq=function(t){return!this.cmp(t)};Ke.exponent=function(){return Hn(this)};Ke.greaterThan=Ke.gt=function(t){return this.cmp(t)>0};Ke.greaterThanOrEqualTo=Ke.gte=function(t){return this.cmp(t)>=0};Ke.isInteger=Ke.isint=function(){return this.e>this.d.length-2};Ke.isNegative=Ke.isneg=function(){return this.s<0};Ke.isPositive=Ke.ispos=function(){return this.s>0};Ke.isZero=function(){return this.s===0};Ke.lessThan=Ke.lt=function(t){return this.cmp(t)<0};Ke.lessThanOrEqualTo=Ke.lte=function(t){return this.cmp(t)<1};Ke.logarithm=Ke.log=function(t){var e,n=this,r=n.constructor,i=r.precision,o=i+5;if(t===void 0)t=new r(10);else if(t=new r(t),t.s<1||t.eq(Ci))throw Error(ao+"NaN");if(n.s<1)throw Error(ao+(n.s?"NaN":"-Infinity"));return n.eq(Ci)?new r(0):(An=!1,e=Ya(Vp(n,o),Vp(t,o),o),An=!0,un(e,i))};Ke.minus=Ke.sub=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?HH(e,t):$H(e,(t.s=-t.s,t))};Ke.modulo=Ke.mod=function(t){var e,n=this,r=n.constructor,i=r.precision;if(t=new r(t),!t.s)throw Error(ao+"NaN");return n.s?(An=!1,e=Ya(n,t,0,1).times(t),An=!0,n.minus(e)):un(new r(n),i)};Ke.naturalExponential=Ke.exp=function(){return zH(this)};Ke.naturalLogarithm=Ke.ln=function(){return Vp(this)};Ke.negated=Ke.neg=function(){var t=new this.constructor(this);return t.s=-t.s||0,t};Ke.plus=Ke.add=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?$H(e,t):HH(e,(t.s=-t.s,t))};Ke.precision=Ke.sd=function(t){var e,n,r,i=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(xc+t);if(e=Hn(i)+1,r=i.d.length-1,n=r*wn+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return t&&e>n?e:n};Ke.squareRoot=Ke.sqrt=function(){var t,e,n,r,i,o,a,s=this,l=s.constructor;if(s.s<1){if(!s.s)return new l(0);throw Error(ao+"NaN")}for(t=Hn(s),An=!1,i=Math.sqrt(+s),i==0||i==1/0?(e=ca(s.d),(e.length+t)%2==0&&(e+="0"),i=Math.sqrt(e),t=Bf((t+1)/2)-(t<0||t%2),i==1/0?e="5e"+t:(e=i.toExponential(),e=e.slice(0,e.indexOf("e")+1)+t),r=new l(e)):r=new l(i.toString()),n=l.precision,i=a=n+3;;)if(o=r,r=o.plus(Ya(s,o,a+2)).times(.5),ca(o.d).slice(0,a)===(e=ca(r.d)).slice(0,a)){if(e=e.slice(a-3,a+1),i==a&&e=="4999"){if(un(o,n+1,0),o.times(o).eq(s)){r=o;break}}else if(e!="9999")break;a+=4}return An=!0,un(r,n)};Ke.times=Ke.mul=function(t){var e,n,r,i,o,a,s,l,c,u=this,d=u.constructor,f=u.d,p=(t=new d(t)).d;if(!u.s||!t.s)return new d(0);for(t.s*=u.s,n=u.e+t.e,l=f.length,c=p.length,l=0;){for(e=0,i=l+r;i>r;)s=o[i]+p[r]*f[i-r-1]+e,o[i--]=s%ir|0,e=s/ir|0;o[i]=(o[i]+e)%ir|0}for(;!o[--a];)o.pop();return e?++n:o.shift(),t.d=o,t.e=n,An?un(t,d.precision):t};Ke.toDecimalPlaces=Ke.todp=function(t,e){var n=this,r=n.constructor;return n=new r(n),t===void 0?n:(xa(t,0,Ff),e===void 0?e=r.rounding:xa(e,0,8),un(n,t+Hn(n)+1,e))};Ke.toExponential=function(t,e){var n,r=this,i=r.constructor;return t===void 0?n=kc(r,!0):(xa(t,0,Ff),e===void 0?e=i.rounding:xa(e,0,8),r=un(new i(r),t+1,e),n=kc(r,!0,t+1)),n};Ke.toFixed=function(t,e){var n,r,i=this,o=i.constructor;return t===void 0?kc(i):(xa(t,0,Ff),e===void 0?e=o.rounding:xa(e,0,8),r=un(new o(i),t+Hn(i)+1,e),n=kc(r.abs(),!1,t+Hn(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};Ke.toInteger=Ke.toint=function(){var t=this,e=t.constructor;return un(new e(t),Hn(t)+1,e.rounding)};Ke.toNumber=function(){return+this};Ke.toPower=Ke.pow=function(t){var e,n,r,i,o,a,s=this,l=s.constructor,c=12,u=+(t=new l(t));if(!t.s)return new l(Ci);if(s=new l(s),!s.s){if(t.s<1)throw Error(ao+"Infinity");return s}if(s.eq(Ci))return s;if(r=l.precision,t.eq(Ci))return un(s,r);if(e=t.e,n=t.d.length-1,a=e>=n,o=s.s,a){if((n=u<0?-u:u)<=BH){for(i=new l(Ci),e=Math.ceil(r/wn+4),An=!1;n%2&&(i=i.times(s),ID(i.d,e)),n=Bf(n/2),n!==0;)s=s.times(s),ID(s.d,e);return An=!0,t.s<0?new l(Ci).div(i):un(i,r)}}else if(o<0)throw Error(ao+"NaN");return o=o<0&&t.d[Math.max(e,n)]&1?-1:1,s.s=1,An=!1,i=t.times(Vp(s,r+c)),An=!0,i=zH(i),i.s=o,i};Ke.toPrecision=function(t,e){var n,r,i=this,o=i.constructor;return t===void 0?(n=Hn(i),r=kc(i,n<=o.toExpNeg||n>=o.toExpPos)):(xa(t,1,Ff),e===void 0?e=o.rounding:xa(e,0,8),i=un(new o(i),t,e),n=Hn(i),r=kc(i,t<=n||n<=o.toExpNeg,t)),r};Ke.toSignificantDigits=Ke.tosd=function(t,e){var n=this,r=n.constructor;return t===void 0?(t=r.precision,e=r.rounding):(xa(t,1,Ff),e===void 0?e=r.rounding:xa(e,0,8)),un(new r(n),t,e)};Ke.toString=Ke.valueOf=Ke.val=Ke.toJSON=Ke[Symbol.for("nodejs.util.inspect.custom")]=function(){var t=this,e=Hn(t),n=t.constructor;return kc(t,e<=n.toExpNeg||e>=n.toExpPos)};function $H(t,e){var n,r,i,o,a,s,l,c,u=t.constructor,d=u.precision;if(!t.s||!e.s)return e.s||(e=new u(t)),An?un(e,d):e;if(l=t.d,c=e.d,a=t.e,i=e.e,l=l.slice(),o=a-i,o){for(o<0?(r=l,o=-o,s=c.length):(r=c,i=a,s=l.length),a=Math.ceil(d/wn),s=a>s?a+1:s+1,o>s&&(o=s,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(s=l.length,o=c.length,s-o<0&&(o=s,r=c,c=l,l=r),n=0;o;)n=(l[--o]=l[o]+c[o]+n)/ir|0,l[o]%=ir;for(n&&(l.unshift(n),++i),s=l.length;l[--s]==0;)l.pop();return e.d=l,e.e=i,An?un(e,d):e}function xa(t,e,n){if(t!==~~t||tn)throw Error(xc+t)}function ca(t){var e,n,r,i=t.length-1,o="",a=t[0];if(i>0){for(o+=a,e=1;ea?1:-1;else for(s=l=0;si[s]?1:-1;break}return l}function n(r,i,o){for(var a=0;o--;)r[o]-=a,a=r[o]1;)r.shift()}return function(r,i,o,a){var s,l,c,u,d,f,p,y,v,g,m,x,b,S,w,E,T,A,M=r.constructor,C=r.s==i.s?1:-1,P=r.d,R=i.d;if(!r.s)return new M(r);if(!i.s)throw Error(ao+"Division by zero");for(l=r.e-i.e,T=R.length,w=P.length,p=new M(C),y=p.d=[],c=0;R[c]==(P[c]||0);)++c;if(R[c]>(P[c]||0)&&--l,o==null?x=o=M.precision:a?x=o+(Hn(r)-Hn(i))+1:x=o,x<0)return new M(0);if(x=x/wn+2|0,c=0,T==1)for(u=0,R=R[0],x++;(c1&&(R=t(R,u),P=t(P,u),T=R.length,w=P.length),S=T,v=P.slice(0,T),g=v.length;g=ir/2&&++E;do u=0,s=e(R,v,T,g),s<0?(m=v[0],T!=g&&(m=m*ir+(v[1]||0)),u=m/E|0,u>1?(u>=ir&&(u=ir-1),d=t(R,u),f=d.length,g=v.length,s=e(d,v,f,g),s==1&&(u--,n(d,T16)throw Error(uP+Hn(t));if(!t.s)return new u(Ci);for(An=!1,s=d,a=new u(.03125);t.abs().gte(.1);)t=t.times(a),c+=5;for(r=Math.log(Wl(2,c))/Math.LN10*2+5|0,s+=r,n=i=o=new u(Ci),u.precision=s;;){if(i=un(i.times(t),s),n=n.times(++l),a=o.plus(Ya(i,n,s)),ca(a.d).slice(0,s)===ca(o.d).slice(0,s)){for(;c--;)o=un(o.times(o),s);return u.precision=d,e==null?(An=!0,un(o,d)):o}o=a}}function Hn(t){for(var e=t.e*wn,n=t.d[0];n>=10;n/=10)e++;return e}function eS(t,e,n){if(e>t.LN10.sd())throw An=!0,n&&(t.precision=n),Error(ao+"LN10 precision limit exceeded");return un(new t(t.LN10),e)}function Cs(t){for(var e="";t--;)e+="0";return e}function Vp(t,e){var n,r,i,o,a,s,l,c,u,d=1,f=10,p=t,y=p.d,v=p.constructor,g=v.precision;if(p.s<1)throw Error(ao+(p.s?"NaN":"-Infinity"));if(p.eq(Ci))return new v(0);if(e==null?(An=!1,c=g):c=e,p.eq(10))return e==null&&(An=!0),eS(v,c);if(c+=f,v.precision=c,n=ca(y),r=n.charAt(0),o=Hn(p),Math.abs(o)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)p=p.times(t),n=ca(p.d),r=n.charAt(0),d++;o=Hn(p),r>1?(p=new v("0."+n),o++):p=new v(r+"."+n.slice(1))}else return l=eS(v,c+2,g).times(o+""),p=Vp(new v(r+"."+n.slice(1)),c-f).plus(l),v.precision=g,e==null?(An=!0,un(p,g)):p;for(s=a=p=Ya(p.minus(Ci),p.plus(Ci),c),u=un(p.times(p),c),i=3;;){if(a=un(a.times(u),c),l=s.plus(Ya(a,new v(i),c)),ca(l.d).slice(0,c)===ca(s.d).slice(0,c))return s=s.times(2),o!==0&&(s=s.plus(eS(v,c+2,g).times(o+""))),s=Ya(s,new v(d),c),v.precision=g,e==null?(An=!0,un(s,g)):s;s=l,i+=2}}function OD(t,e){var n,r,i;for((n=e.indexOf("."))>-1&&(e=e.replace(".","")),(r=e.search(/e/i))>0?(n<0&&(n=r),n+=+e.slice(r+1),e=e.substring(0,r)):n<0&&(n=e.length),r=0;e.charCodeAt(r)===48;)++r;for(i=e.length;e.charCodeAt(i-1)===48;)--i;if(e=e.slice(r,i),e){if(i-=r,n=n-r-1,t.e=Bf(n/wn),t.d=[],r=(n+1)%wn,n<0&&(r+=wn),rl0||t.e<-l0))throw Error(uP+n)}else t.s=0,t.e=0,t.d=[0];return t}function un(t,e,n){var r,i,o,a,s,l,c,u,d=t.d;for(a=1,o=d[0];o>=10;o/=10)a++;if(r=e-a,r<0)r+=wn,i=e,c=d[u=0];else{if(u=Math.ceil((r+1)/wn),o=d.length,u>=o)return t;for(c=o=d[u],a=1;o>=10;o/=10)a++;r%=wn,i=r-wn+a}if(n!==void 0&&(o=Wl(10,a-i-1),s=c/o%10|0,l=e<0||d[u+1]!==void 0||c%o,l=n<4?(s||l)&&(n==0||n==(t.s<0?3:2)):s>5||s==5&&(n==4||l||n==6&&(r>0?i>0?c/Wl(10,a-i):0:d[u-1])%10&1||n==(t.s<0?8:7))),e<1||!d[0])return l?(o=Hn(t),d.length=1,e=e-o-1,d[0]=Wl(10,(wn-e%wn)%wn),t.e=Bf(-e/wn)||0):(d.length=1,d[0]=t.e=t.s=0),t;if(r==0?(d.length=u,o=1,u--):(d.length=u+1,o=Wl(10,wn-r),d[u]=i>0?(c/Wl(10,a-i)%Wl(10,i)|0)*o:0),l)for(;;)if(u==0){(d[0]+=o)==ir&&(d[0]=1,++t.e);break}else{if(d[u]+=o,d[u]!=ir)break;d[u--]=0,o=1}for(r=d.length;d[--r]===0;)d.pop();if(An&&(t.e>l0||t.e<-l0))throw Error(uP+Hn(t));return t}function HH(t,e){var n,r,i,o,a,s,l,c,u,d,f=t.constructor,p=f.precision;if(!t.s||!e.s)return e.s?e.s=-e.s:e=new f(t),An?un(e,p):e;if(l=t.d,d=e.d,r=e.e,c=t.e,l=l.slice(),a=c-r,a){for(u=a<0,u?(n=l,a=-a,s=d.length):(n=d,r=c,s=l.length),i=Math.max(Math.ceil(p/wn),s)+2,a>i&&(a=i,n.length=1),n.reverse(),i=a;i--;)n.push(0);n.reverse()}else{for(i=l.length,s=d.length,u=i0;--i)l[s++]=0;for(i=d.length;i>a;){if(l[--i]0?o=o.charAt(0)+"."+o.slice(1)+Cs(r):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+Cs(-i-1)+o,n&&(r=n-a)>0&&(o+=Cs(r))):i>=a?(o+=Cs(i+1-a),n&&(r=n-i-1)>0&&(o=o+"."+Cs(r))):((r=i+1)0&&(i+1===a&&(o+="."),o+=Cs(r))),t.s<0?"-"+o:o}function ID(t,e){if(t.length>e)return t.length=e,!0}function VH(t){var e,n,r;function i(o){var a=this;if(!(a instanceof i))return new i(o);if(a.constructor=i,o instanceof i){a.s=o.s,a.e=o.e,a.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(xc+o);if(o>0)a.s=1;else if(o<0)o=-o,a.s=-1;else{a.s=0,a.e=0,a.d=[0];return}if(o===~~o&&o<1e7){a.e=0,a.d=[o];return}return OD(a,o.toString())}else if(typeof o!="string")throw Error(xc+o);if(o.charCodeAt(0)===45?(o=o.slice(1),a.s=-1):a.s=1,PTe.test(o))OD(a,o);else throw Error(xc+o)}if(i.prototype=Ke,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=VH,i.config=i.set=RTe,t===void 0&&(t={}),t)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],e=0;e=i[e+1]&&r<=i[e+2])this[n]=r;else throw Error(xc+n+": "+r);if((r=t[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(xc+n+": "+r);return this}var dP=VH(CTe);Ci=new dP(1);const sn=dP;function NTe(t){return LTe(t)||DTe(t)||ITe(t)||OTe()}function OTe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ITe(t,e){if(t){if(typeof t=="string")return iT(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return iT(t,e)}}function DTe(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function LTe(t){if(Array.isArray(t))return iT(t)}function iT(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=e?n.apply(void 0,i):t(e-a,DD(function(){for(var s=arguments.length,l=new Array(s),c=0;ct.length)&&(e=t.length);for(var n=0,r=new Array(e);n"u"||!(Symbol.iterator in Object(t)))){var n=[],r=!0,i=!1,o=void 0;try{for(var a=t[Symbol.iterator](),s;!(r=(s=a.next()).done)&&(n.push(s.value),!(e&&n.length===e));r=!0);}catch(l){i=!0,o=l}finally{try{!r&&a.return!=null&&a.return()}finally{if(i)throw o}}return n}}function YTe(t){if(Array.isArray(t))return t}function KH(t){var e=Gp(t,2),n=e[0],r=e[1],i=n,o=r;return n>r&&(i=r,o=n),[i,o]}function YH(t,e,n){if(t.lte(0))return new sn(0);var r=Ib.getDigitCount(t.toNumber()),i=new sn(10).pow(r),o=t.div(i),a=r!==1?.05:.1,s=new sn(Math.ceil(o.div(a).toNumber())).add(n).mul(a),l=s.mul(i);return e?l:new sn(Math.ceil(l))}function JTe(t,e,n){var r=1,i=new sn(t);if(!i.isint()&&n){var o=Math.abs(t);o<1?(r=new sn(10).pow(Ib.getDigitCount(t)-1),i=new sn(Math.floor(i.div(r).toNumber())).mul(r)):o>1&&(i=new sn(Math.floor(t)))}else t===0?i=new sn(Math.floor((e-1)/2)):n||(i=new sn(Math.floor(t)));var a=Math.floor((e-1)/2),s=FTe(UTe(function(l){return i.add(new sn(l-a).mul(r)).toNumber()}),oT);return s(0,e)}function JH(t,e,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((e-t)/(n-1)))return{step:new sn(0),tickMin:new sn(0),tickMax:new sn(0)};var o=YH(new sn(e).sub(t).div(n-1),r,i),a;t<=0&&e>=0?a=new sn(0):(a=new sn(t).add(e).div(2),a=a.sub(new sn(a).mod(o)));var s=Math.ceil(a.sub(t).div(o).toNumber()),l=Math.ceil(new sn(e).sub(a).div(o).toNumber()),c=s+l+1;return c>n?JH(t,e,n,r,i+1):(c0?l+(n-c):l,s=e>0?s:s+(n-c)),{step:o,tickMin:a.sub(new sn(s).mul(o)),tickMax:a.add(new sn(l).mul(o))})}function ZTe(t){var e=Gp(t,2),n=e[0],r=e[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=Math.max(i,2),s=KH([n,r]),l=Gp(s,2),c=l[0],u=l[1];if(c===-1/0||u===1/0){var d=u===1/0?[c].concat(sT(oT(0,i-1).map(function(){return 1/0}))):[].concat(sT(oT(0,i-1).map(function(){return-1/0})),[u]);return n>r?aT(d):d}if(c===u)return JTe(c,i,o);var f=JH(c,u,a,o),p=f.step,y=f.tickMin,v=f.tickMax,g=Ib.rangeStep(y,v.add(new sn(.1).mul(p)),p);return n>r?aT(g):g}function QTe(t,e){var n=Gp(t,2),r=n[0],i=n[1],o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=KH([r,i]),s=Gp(a,2),l=s[0],c=s[1];if(l===-1/0||c===1/0)return[r,i];if(l===c)return[l];var u=Math.max(e,2),d=YH(new sn(c).sub(l).div(u-1),o,0),f=[].concat(sT(Ib.rangeStep(new sn(l),new sn(c).sub(new sn(.99).mul(d)),d)),[c]);return r>i?aT(f):f}var eMe=XH(ZTe),tMe=XH(QTe),nMe="Invariant failed";function jc(t,e){throw new Error(nMe)}var rMe=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Jd(t){"@babel/helpers - typeof";return Jd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jd(t)}function c0(){return c0=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function uMe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function dMe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function fMe(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,a=-1,s=(n=r==null?void 0:r.length)!==null&&n!==void 0?n:0;if(s<=1)return 0;if(o&&o.axisType==="angleAxis"&&Math.abs(Math.abs(o.range[1]-o.range[0])-360)<=1e-6)for(var l=o.range,c=0;c0?i[c-1].coordinate:i[s-1].coordinate,d=i[c].coordinate,f=c>=s-1?i[0].coordinate:i[c+1].coordinate,p=void 0;if(Do(d-u)!==Do(f-d)){var y=[];if(Do(f-d)===Do(l[1]-l[0])){p=f;var v=d+l[1]-l[0];y[0]=Math.min(v,(v+u)/2),y[1]=Math.max(v,(v+u)/2)}else{p=u;var g=f+l[1]-l[0];y[0]=Math.min(d,(g+d)/2),y[1]=Math.max(d,(g+d)/2)}var m=[Math.min(d,(p+d)/2),Math.max(d,(p+d)/2)];if(e>m[0]&&e<=m[1]||e>=y[0]&&e<=y[1]){a=i[c].index;break}}else{var x=Math.min(u,f),b=Math.max(u,f);if(e>(x+d)/2&&e<=(b+d)/2){a=i[c].index;break}}}else for(var S=0;S0&&S(r[S].coordinate+r[S-1].coordinate)/2&&e<=(r[S].coordinate+r[S+1].coordinate)/2||S===s-1&&e>(r[S].coordinate+r[S-1].coordinate)/2){a=r[S].index;break}return a},fP=function(e){var n,r=e,i=r.type.displayName,o=(n=e.type)!==null&&n!==void 0&&n.defaultProps?Dn(Dn({},e.type.defaultProps),e.props):e.props,a=o.stroke,s=o.fill,l;switch(i){case"Line":l=a;break;case"Area":case"Radar":l=a&&a!=="none"?a:s;break;default:l=s;break}return l},PMe=function(e){var n=e.barSize,r=e.totalSize,i=e.stackGroups,o=i===void 0?{}:i;if(!o)return{};for(var a={},s=Object.keys(o),l=0,c=s.length;l=0});if(m&&m.length){var x=m[0].type.defaultProps,b=x!==void 0?Dn(Dn({},x),m[0].props):m[0].props,S=b.barSize,w=b[g];a[w]||(a[w]=[]);var E=Ut(S)?n:S;a[w].push({item:m[0],stackList:m.slice(1),barSize:Ut(E)?void 0:Lc(E,r,0)})}}return a},RMe=function(e){var n=e.barGap,r=e.barCategoryGap,i=e.bandSize,o=e.sizeList,a=o===void 0?[]:o,s=e.maxBarSize,l=a.length;if(l<1)return null;var c=Lc(n,i,0,!0),u,d=[];if(a[0].barSize===+a[0].barSize){var f=!1,p=i/l,y=a.reduce(function(S,w){return S+w.barSize||0},0);y+=(l-1)*c,y>=i&&(y-=(l-1)*c,c=0),y>=i&&p>0&&(f=!0,p*=.9,y=l*p);var v=(i-y)/2>>0,g={offset:v-c,size:0};u=a.reduce(function(S,w){var E={item:w.item,position:{offset:g.offset+g.size+c,size:f?p:w.barSize}},T=[].concat(jD(S),[E]);return g=T[T.length-1].position,w.stackList&&w.stackList.length&&w.stackList.forEach(function(A){T.push({item:A,position:g})}),T},d)}else{var m=Lc(r,i,0,!0);i-2*m-(l-1)*c<=0&&(c=0);var x=(i-2*m-(l-1)*c)/l;x>1&&(x>>=0);var b=s===+s?Math.min(x,s):x;u=a.reduce(function(S,w,E){var T=[].concat(jD(S),[{item:w.item,position:{offset:m+(x+c)*E+(x-b)/2,size:b}}]);return w.stackList&&w.stackList.length&&w.stackList.forEach(function(A){T.push({item:A,position:T[T.length-1].position})}),T},d)}return u},NMe=function(e,n,r,i){var o=r.children,a=r.width,s=r.margin,l=a-(s.left||0)-(s.right||0),c=tV({children:o,legendWidth:l});if(c){var u=i||{},d=u.width,f=u.height,p=c.align,y=c.verticalAlign,v=c.layout;if((v==="vertical"||v==="horizontal"&&y==="middle")&&p!=="center"&&ze(e[p]))return Dn(Dn({},e),{},md({},p,e[p]+(d||0)));if((v==="horizontal"||v==="vertical"&&p==="center")&&y!=="middle"&&ze(e[y]))return Dn(Dn({},e),{},md({},y,e[y]+(f||0)))}return e},OMe=function(e,n,r){return Ut(n)?!0:e==="horizontal"?n==="yAxis":e==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},nV=function(e,n,r,i,o){var a=n.props.children,s=ro(a,Gm).filter(function(c){return OMe(i,o,c.props.direction)});if(s&&s.length){var l=s.map(function(c){return c.props.dataKey});return e.reduce(function(c,u){var d=Di(u,r);if(Ut(d))return c;var f=Array.isArray(d)?[Rb(d),Pb(d)]:[d,d],p=l.reduce(function(y,v){var g=Di(u,v,0),m=f[0]-Math.abs(Array.isArray(g)?g[0]:g),x=f[1]+Math.abs(Array.isArray(g)?g[1]:g);return[Math.min(m,y[0]),Math.max(x,y[1])]},[1/0,-1/0]);return[Math.min(p[0],c[0]),Math.max(p[1],c[1])]},[1/0,-1/0])}return null},IMe=function(e,n,r,i,o){var a=n.map(function(s){return nV(e,s,r,o,i)}).filter(function(s){return!Ut(s)});return a&&a.length?a.reduce(function(s,l){return[Math.min(s[0],l[0]),Math.max(s[1],l[1])]},[1/0,-1/0]):null},rV=function(e,n,r,i,o){var a=n.map(function(l){var c=l.props.dataKey;return r==="number"&&c&&nV(e,l,c,i)||Kh(e,c,r,o)});if(r==="number")return a.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]);var s={};return a.reduce(function(l,c){for(var u=0,d=c.length;u=2?Do(s[0]-s[1])*2*c:c,n&&(e.ticks||e.niceTicks)){var u=(e.ticks||e.niceTicks).map(function(d){var f=o?o.indexOf(d):d;return{coordinate:i(f)+c,value:d,offset:c}});return u.filter(function(d){return!Fm(d.coordinate)})}return e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map(function(d,f){return{coordinate:i(d)+c,value:d,index:f,offset:c}}):i.ticks&&!r?i.ticks(e.tickCount).map(function(d){return{coordinate:i(d)+c,value:d,offset:c}}):i.domain().map(function(d,f){return{coordinate:i(d)+c,value:o?o[d]:d,index:f,offset:c}})},tS=new WeakMap,pv=function(e,n){if(typeof n!="function")return e;tS.has(e)||tS.set(e,new WeakMap);var r=tS.get(e);if(r.has(n))return r.get(n);var i=function(){e.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,i),i},DMe=function(e,n,r){var i=e.scale,o=e.type,a=e.layout,s=e.axisType;if(i==="auto")return a==="radial"&&s==="radiusAxis"?{scale:Fp(),realScaleType:"band"}:a==="radial"&&s==="angleAxis"?{scale:i0(),realScaleType:"linear"}:o==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:qh(),realScaleType:"point"}:o==="category"?{scale:Fp(),realScaleType:"band"}:{scale:i0(),realScaleType:"linear"};if(Dc(i)){var l="scale".concat(gb(i));return{scale:(ND[l]||qh)(),realScaleType:ND[l]?l:"point"}}return jt(i)?{scale:i}:{scale:qh(),realScaleType:"point"}},FD=1e-4,LMe=function(e){var n=e.domain();if(!(!n||n.length<=2)){var r=n.length,i=e.range(),o=Math.min(i[0],i[1])-FD,a=Math.max(i[0],i[1])+FD,s=e(n[0]),l=e(n[r-1]);(sa||la)&&e.domain([n[0],n[r-1]])}},kMe=function(e,n){if(!e)return null;for(var r=0,i=e.length;ri)&&(o[1]=i),o[0]>i&&(o[0]=i),o[1]=0?(e[s][r][0]=o,e[s][r][1]=o+l,o=e[s][r][1]):(e[s][r][0]=a,e[s][r][1]=a+l,a=e[s][r][1])}},FMe=function(e){var n=e.length;if(!(n<=0))for(var r=0,i=e[0].length;r=0?(e[a][r][0]=o,e[a][r][1]=o+s,o=e[a][r][1]):(e[a][r][0]=0,e[a][r][1]=0)}},BMe={sign:UMe,expand:eme,none:Hd,silhouette:tme,wiggle:nme,positive:FMe},$Me=function(e,n,r){var i=n.map(function(s){return s.props.dataKey}),o=BMe[r],a=Qpe().keys(i).value(function(s,l){return+Di(s,l,0)}).order(L1).offset(o);return a(e)},zMe=function(e,n,r,i,o,a){if(!e)return null;var s=a?n.reverse():n,l={},c=s.reduce(function(d,f){var p,y=(p=f.type)!==null&&p!==void 0&&p.defaultProps?Dn(Dn({},f.type.defaultProps),f.props):f.props,v=y.stackId,g=y.hide;if(g)return d;var m=y[r],x=d[m]||{hasStack:!1,stackGroups:{}};if(Yn(v)){var b=x.stackGroups[v]||{numericAxisId:r,cateAxisId:i,items:[]};b.items.push(f),x.hasStack=!0,x.stackGroups[v]=b}else x.stackGroups[Bm("_stackId_")]={numericAxisId:r,cateAxisId:i,items:[f]};return Dn(Dn({},d),{},md({},m,x))},l),u={};return Object.keys(c).reduce(function(d,f){var p=c[f];if(p.hasStack){var y={};p.stackGroups=Object.keys(p.stackGroups).reduce(function(v,g){var m=p.stackGroups[g];return Dn(Dn({},v),{},md({},g,{numericAxisId:r,cateAxisId:i,items:m.items,stackedData:$Me(e,m.items,o)}))},y)}return Dn(Dn({},d),{},md({},f,p))},u)},HMe=function(e,n){var r=n.realScaleType,i=n.type,o=n.tickCount,a=n.originalDomain,s=n.allowDecimals,l=r||n.scale;if(l!=="auto"&&l!=="linear")return null;if(o&&i==="number"&&a&&(a[0]==="auto"||a[1]==="auto")){var c=e.domain();if(!c.length)return null;var u=eMe(c,o,s);return e.domain([Rb(u),Pb(u)]),{niceTicks:u}}if(o&&i==="number"){var d=e.domain(),f=tMe(d,o,s);return{niceTicks:f}}return null};function BD(t){var e=t.axis,n=t.ticks,r=t.bandSize,i=t.entry,o=t.index,a=t.dataKey;if(e.type==="category"){if(!e.allowDuplicatedCategory&&e.dataKey&&!Ut(i[e.dataKey])){var s=Ly(n,"value",i[e.dataKey]);if(s)return s.coordinate+r/2}return n[o]?n[o].coordinate+r/2:null}var l=Di(i,Ut(a)?e.dataKey:a);return Ut(l)?null:e.scale(l)}var $D=function(e){var n=e.axis,r=e.ticks,i=e.offset,o=e.bandSize,a=e.entry,s=e.index;if(n.type==="category")return r[s]?r[s].coordinate+i:null;var l=Di(a,n.dataKey,n.domain[s]);return Ut(l)?null:n.scale(l)-o/2+i},VMe=function(e){var n=e.numericAxis,r=n.scale.domain();if(n.type==="number"){var i=Math.min(r[0],r[1]),o=Math.max(r[0],r[1]);return i<=0&&o>=0?0:o<0?o:i}return r[0]},GMe=function(e,n){var r,i=(r=e.type)!==null&&r!==void 0&&r.defaultProps?Dn(Dn({},e.type.defaultProps),e.props):e.props,o=i.stackId;if(Yn(o)){var a=n[o];if(a){var s=a.items.indexOf(e);return s>=0?a.stackedData[s]:null}}return null},WMe=function(e){return e.reduce(function(n,r){return[Rb(r.concat([n[0]]).filter(ze)),Pb(r.concat([n[1]]).filter(ze))]},[1/0,-1/0])},oV=function(e,n,r){return Object.keys(e).reduce(function(i,o){var a=e[o],s=a.stackedData,l=s.reduce(function(c,u){var d=WMe(u.slice(n,r+1));return[Math.min(c[0],d[0]),Math.max(c[1],d[1])]},[1/0,-1/0]);return[Math.min(l[0],i[0]),Math.max(l[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},zD=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,HD=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,dT=function(e,n,r){if(jt(e))return e(n,r);if(!Array.isArray(e))return n;var i=[];if(ze(e[0]))i[0]=r?e[0]:Math.min(e[0],n[0]);else if(zD.test(e[0])){var o=+zD.exec(e[0])[1];i[0]=n[0]-o}else jt(e[0])?i[0]=e[0](n[0]):i[0]=n[0];if(ze(e[1]))i[1]=r?e[1]:Math.max(e[1],n[1]);else if(HD.test(e[1])){var a=+HD.exec(e[1])[1];i[1]=n[1]+a}else jt(e[1])?i[1]=e[1](n[1]):i[1]=n[1];return i},d0=function(e,n,r){if(e&&e.scale&&e.scale.bandwidth){var i=e.scale.bandwidth();if(!r||i>0)return i}if(e&&n&&n.length>=2){for(var o=BC(n,function(d){return d.coordinate}),a=1/0,s=1,l=o.length;sa&&(c=2*Math.PI-c),{radius:s,angle:YMe(c),angleInRadian:c}},QMe=function(e){var n=e.startAngle,r=e.endAngle,i=Math.floor(n/360),o=Math.floor(r/360),a=Math.min(i,o);return{startAngle:n-a*360,endAngle:r-a*360}},eAe=function(e,n){var r=n.startAngle,i=n.endAngle,o=Math.floor(r/360),a=Math.floor(i/360),s=Math.min(o,a);return e+s*360},XD=function(e,n){var r=e.x,i=e.y,o=ZMe({x:r,y:i},n),a=o.radius,s=o.angle,l=n.innerRadius,c=n.outerRadius;if(ac)return!1;if(a===0)return!0;var u=QMe(n),d=u.startAngle,f=u.endAngle,p=s,y;if(d<=f){for(;p>f;)p-=360;for(;p=d&&p<=f}else{for(;p>d;)p-=360;for(;p=f&&p<=d}return y?WD(WD({},n),{},{radius:a,angle:eAe(p,n)}):null};function Kp(t){"@babel/helpers - typeof";return Kp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Kp(t)}var tAe=["offset"];function nAe(t){return aAe(t)||oAe(t)||iAe(t)||rAe()}function rAe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function iAe(t,e){if(t){if(typeof t=="string")return fT(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fT(t,e)}}function oAe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function aAe(t){if(Array.isArray(t))return fT(t)}function fT(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function lAe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function qD(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 Xn(t){for(var e=1;e=0?1:-1,b,S;i==="insideStart"?(b=p+x*a,S=v):i==="insideEnd"?(b=y-x*a,S=!v):i==="end"&&(b=y+x*a,S=v),S=m<=0?S:!S;var w=vr(c,u,g,b),E=vr(c,u,g,b+(S?1:-1)*359),T="M".concat(w.x,",").concat(w.y,` + A`).concat(g,",").concat(g,",0,1,").concat(S?0:1,`, + `).concat(E.x,",").concat(E.y),A=Ut(e.id)?Bm("recharts-radial-line-"):e.id;return Z.createElement("text",Yp({},r,{dominantBaseline:"central",className:zt("recharts-radial-bar-label",s)}),Z.createElement("defs",null,Z.createElement("path",{id:A,d:T})),Z.createElement("textPath",{xlinkHref:"#".concat(A)},n))},mAe=function(e){var n=e.viewBox,r=e.offset,i=e.position,o=n,a=o.cx,s=o.cy,l=o.innerRadius,c=o.outerRadius,u=o.startAngle,d=o.endAngle,f=(u+d)/2;if(i==="outside"){var p=vr(a,s,c+r,f),y=p.x,v=p.y;return{x:y,y:v,textAnchor:y>=a?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"end"};var g=(l+c)/2,m=vr(a,s,g,f),x=m.x,b=m.y;return{x,y:b,textAnchor:"middle",verticalAnchor:"middle"}},gAe=function(e){var n=e.viewBox,r=e.parentViewBox,i=e.offset,o=e.position,a=n,s=a.x,l=a.y,c=a.width,u=a.height,d=u>=0?1:-1,f=d*i,p=d>0?"end":"start",y=d>0?"start":"end",v=c>=0?1:-1,g=v*i,m=v>0?"end":"start",x=v>0?"start":"end";if(o==="top"){var b={x:s+c/2,y:l-d*i,textAnchor:"middle",verticalAnchor:p};return Xn(Xn({},b),r?{height:Math.max(l-r.y,0),width:c}:{})}if(o==="bottom"){var S={x:s+c/2,y:l+u+f,textAnchor:"middle",verticalAnchor:y};return Xn(Xn({},S),r?{height:Math.max(r.y+r.height-(l+u),0),width:c}:{})}if(o==="left"){var w={x:s-g,y:l+u/2,textAnchor:m,verticalAnchor:"middle"};return Xn(Xn({},w),r?{width:Math.max(w.x-r.x,0),height:u}:{})}if(o==="right"){var E={x:s+c+g,y:l+u/2,textAnchor:x,verticalAnchor:"middle"};return Xn(Xn({},E),r?{width:Math.max(r.x+r.width-E.x,0),height:u}:{})}var T=r?{width:c,height:u}:{};return o==="insideLeft"?Xn({x:s+g,y:l+u/2,textAnchor:x,verticalAnchor:"middle"},T):o==="insideRight"?Xn({x:s+c-g,y:l+u/2,textAnchor:m,verticalAnchor:"middle"},T):o==="insideTop"?Xn({x:s+c/2,y:l+f,textAnchor:"middle",verticalAnchor:y},T):o==="insideBottom"?Xn({x:s+c/2,y:l+u-f,textAnchor:"middle",verticalAnchor:p},T):o==="insideTopLeft"?Xn({x:s+g,y:l+f,textAnchor:x,verticalAnchor:y},T):o==="insideTopRight"?Xn({x:s+c-g,y:l+f,textAnchor:m,verticalAnchor:y},T):o==="insideBottomLeft"?Xn({x:s+g,y:l+u-f,textAnchor:x,verticalAnchor:p},T):o==="insideBottomRight"?Xn({x:s+c-g,y:l+u-f,textAnchor:m,verticalAnchor:p},T):Pf(o)&&(ze(o.x)||tc(o.x))&&(ze(o.y)||tc(o.y))?Xn({x:s+Lc(o.x,c),y:l+Lc(o.y,u),textAnchor:"end",verticalAnchor:"end"},T):Xn({x:s+c/2,y:l+u/2,textAnchor:"middle",verticalAnchor:"middle"},T)},vAe=function(e){return"cx"in e&&ze(e.cx)};function Nr(t){var e=t.offset,n=e===void 0?5:e,r=sAe(t,tAe),i=Xn({offset:n},r),o=i.viewBox,a=i.position,s=i.value,l=i.children,c=i.content,u=i.className,d=u===void 0?"":u,f=i.textBreakAll;if(!o||Ut(s)&&Ut(l)&&!_.isValidElement(c)&&!jt(c))return null;if(_.isValidElement(c))return _.cloneElement(c,i);var p;if(jt(c)){if(p=_.createElement(c,i),_.isValidElement(p))return p}else p=fAe(i);var y=vAe(o),v=$t(i,!0);if(y&&(a==="insideStart"||a==="insideEnd"||a==="end"))return pAe(i,p,v);var g=y?mAe(i):gAe(i);return Z.createElement(Jy,Yp({className:zt("recharts-label",d)},v,g,{breakAll:f}),p)}Nr.displayName="Label";var sV=function(e){var n=e.cx,r=e.cy,i=e.angle,o=e.startAngle,a=e.endAngle,s=e.r,l=e.radius,c=e.innerRadius,u=e.outerRadius,d=e.x,f=e.y,p=e.top,y=e.left,v=e.width,g=e.height,m=e.clockWise,x=e.labelViewBox;if(x)return x;if(ze(v)&&ze(g)){if(ze(d)&&ze(f))return{x:d,y:f,width:v,height:g};if(ze(p)&&ze(y))return{x:p,y,width:v,height:g}}return ze(d)&&ze(f)?{x:d,y:f,width:0,height:0}:ze(n)&&ze(r)?{cx:n,cy:r,startAngle:o||i||0,endAngle:a||i||0,innerRadius:c||0,outerRadius:u||l||s||0,clockWise:m}:e.viewBox?e.viewBox:{}},yAe=function(e,n){return e?e===!0?Z.createElement(Nr,{key:"label-implicit",viewBox:n}):Yn(e)?Z.createElement(Nr,{key:"label-implicit",viewBox:n,value:e}):_.isValidElement(e)?e.type===Nr?_.cloneElement(e,{key:"label-implicit",viewBox:n}):Z.createElement(Nr,{key:"label-implicit",content:e,viewBox:n}):jt(e)?Z.createElement(Nr,{key:"label-implicit",content:e,viewBox:n}):Pf(e)?Z.createElement(Nr,Yp({viewBox:n},e,{key:"label-implicit"})):null:null},xAe=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var i=e.children,o=sV(e),a=ro(i,Nr).map(function(l,c){return _.cloneElement(l,{viewBox:n||o,key:"label-".concat(c)})});if(!r)return a;var s=yAe(e.label,n||o);return[s].concat(nAe(a))};Nr.parseViewBox=sV;Nr.renderCallByParent=xAe;function bAe(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var _Ae=bAe;const wAe=dn(_Ae);function Jp(t){"@babel/helpers - typeof";return Jp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jp(t)}var SAe=["valueAccessor"],EAe=["data","dataKey","clockWise","id","textBreakAll"];function TAe(t){return PAe(t)||CAe(t)||AAe(t)||MAe()}function MAe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function AAe(t,e){if(t){if(typeof t=="string")return hT(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return hT(t,e)}}function CAe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function PAe(t){if(Array.isArray(t))return hT(t)}function hT(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function IAe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}var DAe=function(e){return Array.isArray(e.value)?wAe(e.value):e.value};function rl(t){var e=t.valueAccessor,n=e===void 0?DAe:e,r=JD(t,SAe),i=r.data,o=r.dataKey,a=r.clockWise,s=r.id,l=r.textBreakAll,c=JD(r,EAe);return!i||!i.length?null:Z.createElement(jn,{className:"recharts-label-list"},i.map(function(u,d){var f=Ut(o)?n(u,d):Di(u&&u.payload,o),p=Ut(s)?{}:{id:"".concat(s,"-").concat(d)};return Z.createElement(Nr,h0({},$t(u,!0),c,p,{parentViewBox:u.parentViewBox,value:f,textBreakAll:l,viewBox:Nr.parseViewBox(Ut(a)?u:YD(YD({},u),{},{clockWise:a})),key:"label-".concat(d),index:d}))}))}rl.displayName="LabelList";function LAe(t,e){return t?t===!0?Z.createElement(rl,{key:"labelList-implicit",data:e}):Z.isValidElement(t)||jt(t)?Z.createElement(rl,{key:"labelList-implicit",data:e,content:t}):Pf(t)?Z.createElement(rl,h0({data:e},t,{key:"labelList-implicit"})):null:null}function kAe(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var r=t.children,i=ro(r,rl).map(function(a,s){return _.cloneElement(a,{data:e,key:"labelList-".concat(s)})});if(!n)return i;var o=LAe(t.label,e);return[o].concat(TAe(i))}rl.renderCallByParent=kAe;function Zp(t){"@babel/helpers - typeof";return Zp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zp(t)}function pT(){return pT=Object.assign?Object.assign.bind():function(t){for(var e=1;e180),",").concat(+(a>c),`, + `).concat(d.x,",").concat(d.y,` + `);if(i>0){var p=vr(n,r,i,a),y=vr(n,r,i,c);f+="L ".concat(y.x,",").concat(y.y,` + A `).concat(i,",").concat(i,`,0, + `).concat(+(Math.abs(l)>180),",").concat(+(a<=c),`, + `).concat(p.x,",").concat(p.y," Z")}else f+="L ".concat(n,",").concat(r," Z");return f},$Ae=function(e){var n=e.cx,r=e.cy,i=e.innerRadius,o=e.outerRadius,a=e.cornerRadius,s=e.forceCornerRadius,l=e.cornerIsExternal,c=e.startAngle,u=e.endAngle,d=Do(u-c),f=mv({cx:n,cy:r,radius:o,angle:c,sign:d,cornerRadius:a,cornerIsExternal:l}),p=f.circleTangency,y=f.lineTangency,v=f.theta,g=mv({cx:n,cy:r,radius:o,angle:u,sign:-d,cornerRadius:a,cornerIsExternal:l}),m=g.circleTangency,x=g.lineTangency,b=g.theta,S=l?Math.abs(c-u):Math.abs(c-u)-v-b;if(S<0)return s?"M ".concat(y.x,",").concat(y.y,` + a`).concat(a,",").concat(a,",0,0,1,").concat(a*2,`,0 + a`).concat(a,",").concat(a,",0,0,1,").concat(-a*2,`,0 + `):lV({cx:n,cy:r,innerRadius:i,outerRadius:o,startAngle:c,endAngle:u});var w="M ".concat(y.x,",").concat(y.y,` + A`).concat(a,",").concat(a,",0,0,").concat(+(d<0),",").concat(p.x,",").concat(p.y,` + A`).concat(o,",").concat(o,",0,").concat(+(S>180),",").concat(+(d<0),",").concat(m.x,",").concat(m.y,` + A`).concat(a,",").concat(a,",0,0,").concat(+(d<0),",").concat(x.x,",").concat(x.y,` + `);if(i>0){var E=mv({cx:n,cy:r,radius:i,angle:c,sign:d,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),T=E.circleTangency,A=E.lineTangency,M=E.theta,C=mv({cx:n,cy:r,radius:i,angle:u,sign:-d,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),P=C.circleTangency,R=C.lineTangency,D=C.theta,k=l?Math.abs(c-u):Math.abs(c-u)-M-D;if(k<0&&a===0)return"".concat(w,"L").concat(n,",").concat(r,"Z");w+="L".concat(R.x,",").concat(R.y,` + A`).concat(a,",").concat(a,",0,0,").concat(+(d<0),",").concat(P.x,",").concat(P.y,` + A`).concat(i,",").concat(i,",0,").concat(+(k>180),",").concat(+(d>0),",").concat(T.x,",").concat(T.y,` + A`).concat(a,",").concat(a,",0,0,").concat(+(d<0),",").concat(A.x,",").concat(A.y,"Z")}else w+="L".concat(n,",").concat(r,"Z");return w},zAe={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},cV=function(e){var n=QD(QD({},zAe),e),r=n.cx,i=n.cy,o=n.innerRadius,a=n.outerRadius,s=n.cornerRadius,l=n.forceCornerRadius,c=n.cornerIsExternal,u=n.startAngle,d=n.endAngle,f=n.className;if(a0&&Math.abs(u-d)<360?g=$Ae({cx:r,cy:i,innerRadius:o,outerRadius:a,cornerRadius:Math.min(v,y/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:d}):g=lV({cx:r,cy:i,innerRadius:o,outerRadius:a,startAngle:u,endAngle:d}),Z.createElement("path",pT({},$t(n,!0),{className:p,d:g,role:"img"}))};function Qp(t){"@babel/helpers - typeof";return Qp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qp(t)}function mT(){return mT=Object.assign?Object.assign.bind():function(t){for(var e=1;e0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function sCe(t,e){return Jc(t.getTime(),e.getTime())}function lCe(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function cCe(t,e){return t===e}function sL(t,e,n){var r=t.size;if(r!==e.size)return!1;if(!r)return!0;for(var i=new Array(r),o=t.entries(),a,s,l=0;(a=o.next())&&!a.done;){for(var c=e.entries(),u=!1,d=0;(s=c.next())&&!s.done;){if(i[d]){d++;continue}var f=a.value,p=s.value;if(n.equals(f[0],p[0],l,d,t,e,n)&&n.equals(f[1],p[1],f[0],p[0],t,e,n)){u=i[d]=!0;break}d++}if(!u)return!1;l++}return!0}var uCe=Jc;function dCe(t,e,n){var r=aL(t),i=r.length;if(aL(e).length!==i)return!1;for(;i-- >0;)if(!hV(t,e,n,r[i]))return!1;return!0}function bh(t,e,n){var r=iL(t),i=r.length;if(iL(e).length!==i)return!1;for(var o,a,s;i-- >0;)if(o=r[i],!hV(t,e,n,o)||(a=oL(t,o),s=oL(e,o),(a||s)&&(!a||!s||a.configurable!==s.configurable||a.enumerable!==s.enumerable||a.writable!==s.writable)))return!1;return!0}function fCe(t,e){return Jc(t.valueOf(),e.valueOf())}function hCe(t,e){return t.source===e.source&&t.flags===e.flags}function lL(t,e,n){var r=t.size;if(r!==e.size)return!1;if(!r)return!0;for(var i=new Array(r),o=t.values(),a,s;(a=o.next())&&!a.done;){for(var l=e.values(),c=!1,u=0;(s=l.next())&&!s.done;){if(!i[u]&&n.equals(a.value,s.value,a.value,s.value,t,e,n)){c=i[u]=!0;break}u++}if(!c)return!1}return!0}function pCe(t,e){var n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}function mCe(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function hV(t,e,n,r){return(r===oCe||r===iCe||r===rCe)&&(t.$$typeof||e.$$typeof)?!0:nCe(e,r)&&n.equals(t[r],e[r],r,r,t,e,n)}var gCe="[object Arguments]",vCe="[object Boolean]",yCe="[object Date]",xCe="[object Error]",bCe="[object Map]",_Ce="[object Number]",wCe="[object Object]",SCe="[object RegExp]",ECe="[object Set]",TCe="[object String]",MCe="[object URL]",ACe=Array.isArray,cL=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,uL=Object.assign,CCe=Object.prototype.toString.call.bind(Object.prototype.toString);function PCe(t){var e=t.areArraysEqual,n=t.areDatesEqual,r=t.areErrorsEqual,i=t.areFunctionsEqual,o=t.areMapsEqual,a=t.areNumbersEqual,s=t.areObjectsEqual,l=t.arePrimitiveWrappersEqual,c=t.areRegExpsEqual,u=t.areSetsEqual,d=t.areTypedArraysEqual,f=t.areUrlsEqual;return function(y,v,g){if(y===v)return!0;if(y==null||v==null)return!1;var m=typeof y;if(m!==typeof v)return!1;if(m!=="object")return m==="number"?a(y,v,g):m==="function"?i(y,v,g):!1;var x=y.constructor;if(x!==v.constructor)return!1;if(x===Object)return s(y,v,g);if(ACe(y))return e(y,v,g);if(cL!=null&&cL(y))return d(y,v,g);if(x===Date)return n(y,v,g);if(x===RegExp)return c(y,v,g);if(x===Map)return o(y,v,g);if(x===Set)return u(y,v,g);var b=CCe(y);return b===yCe?n(y,v,g):b===SCe?c(y,v,g):b===bCe?o(y,v,g):b===ECe?u(y,v,g):b===wCe?typeof y.then!="function"&&typeof v.then!="function"&&s(y,v,g):b===MCe?f(y,v,g):b===xCe?r(y,v,g):b===gCe?s(y,v,g):b===vCe||b===_Ce||b===TCe?l(y,v,g):!1}}function RCe(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,i={areArraysEqual:r?bh:aCe,areDatesEqual:sCe,areErrorsEqual:lCe,areFunctionsEqual:cCe,areMapsEqual:r?rL(sL,bh):sL,areNumbersEqual:uCe,areObjectsEqual:r?bh:dCe,arePrimitiveWrappersEqual:fCe,areRegExpsEqual:hCe,areSetsEqual:r?rL(lL,bh):lL,areTypedArraysEqual:r?bh:pCe,areUrlsEqual:mCe};if(n&&(i=uL({},i,n(i))),e){var o=vv(i.areArraysEqual),a=vv(i.areMapsEqual),s=vv(i.areObjectsEqual),l=vv(i.areSetsEqual);i=uL({},i,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:s,areSetsEqual:l})}return i}function NCe(t){return function(e,n,r,i,o,a,s){return t(e,n,s)}}function OCe(t){var e=t.circular,n=t.comparator,r=t.createState,i=t.equals,o=t.strict;if(r)return function(l,c){var u=r(),d=u.cache,f=d===void 0?e?new WeakMap:void 0:d,p=u.meta;return n(l,c,{cache:f,equals:i,meta:p,strict:o})};if(e)return function(l,c){return n(l,c,{cache:new WeakMap,equals:i,meta:void 0,strict:o})};var a={cache:void 0,equals:i,meta:void 0,strict:o};return function(l,c){return n(l,c,a)}}var ICe=Rl();Rl({strict:!0});Rl({circular:!0});Rl({circular:!0,strict:!0});Rl({createInternalComparator:function(){return Jc}});Rl({strict:!0,createInternalComparator:function(){return Jc}});Rl({circular:!0,createInternalComparator:function(){return Jc}});Rl({circular:!0,createInternalComparator:function(){return Jc},strict:!0});function Rl(t){t===void 0&&(t={});var e=t.circular,n=e===void 0?!1:e,r=t.createInternalComparator,i=t.createState,o=t.strict,a=o===void 0?!1:o,s=RCe(t),l=PCe(s),c=r?r(l):NCe(l);return OCe({circular:n,comparator:l,createState:i,equals:c,strict:a})}function DCe(t){typeof requestAnimationFrame<"u"&&requestAnimationFrame(t)}function dL(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function i(o){n<0&&(n=o),o-n>e?(t(o),n=-1):DCe(i)};requestAnimationFrame(r)}function vT(t){"@babel/helpers - typeof";return vT=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vT(t)}function LCe(t){return FCe(t)||UCe(t)||jCe(t)||kCe()}function kCe(){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 jCe(t,e){if(t){if(typeof t=="string")return fL(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fL(t,e)}}function fL(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n1?1:m<0?0:m},v=function(m){for(var x=m>1?1:m,b=x,S=0;S<8;++S){var w=d(b)-x,E=p(b);if(Math.abs(w-x)0&&arguments[0]!==void 0?arguments[0]:{},n=e.stiff,r=n===void 0?100:n,i=e.damping,o=i===void 0?8:i,a=e.dt,s=a===void 0?17:a,l=function(u,d,f){var p=-(u-d)*r,y=f*o,v=f+(p-y)*s/1e3,g=f*s/1e3+u;return Math.abs(g-d)t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function gPe(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function nS(t){return bPe(t)||xPe(t)||yPe(t)||vPe()}function vPe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yPe(t,e){if(t){if(typeof t=="string")return wT(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return wT(t,e)}}function xPe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function bPe(t){if(Array.isArray(t))return wT(t)}function wT(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function g0(t){return g0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},g0(t)}var ss=function(t){TPe(n,t);var e=MPe(n);function n(r,i){var o;_Pe(this,n),o=e.call(this,r,i);var a=o.props,s=a.isActive,l=a.attributeName,c=a.from,u=a.to,d=a.steps,f=a.children,p=a.duration;if(o.handleStyleChange=o.handleStyleChange.bind(TT(o)),o.changeStyle=o.changeStyle.bind(TT(o)),!s||p<=0)return o.state={style:{}},typeof f=="function"&&(o.state={style:u}),ET(o);if(d&&d.length)o.state={style:d[0].style};else if(c){if(typeof f=="function")return o.state={style:c},ET(o);o.state={style:l?Ih({},l,c):c}}else o.state={style:{}};return o}return SPe(n,[{key:"componentDidMount",value:function(){var i=this.props,o=i.isActive,a=i.canBegin;this.mounted=!0,!(!o||!a)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var o=this.props,a=o.isActive,s=o.canBegin,l=o.attributeName,c=o.shouldReAnimate,u=o.to,d=o.from,f=this.state.style;if(s){if(!a){var p={style:l?Ih({},l,u):u};this.state&&f&&(l&&f[l]!==u||!l&&f!==u)&&this.setState(p);return}if(!(ICe(i.to,u)&&i.canBegin&&i.isActive)){var y=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var v=y||c?d:i.to;if(this.state&&f){var g={style:l?Ih({},l,v):v};(l&&f[l]!==v||!l&&f!==v)&&this.setState(g)}this.runAnimation(mo(mo({},this.props),{},{from:v,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var o=this,a=i.from,s=i.to,l=i.duration,c=i.easing,u=i.begin,d=i.onAnimationEnd,f=i.onAnimationStart,p=hPe(a,s,nPe(c),l,this.changeStyle),y=function(){o.stopJSAnimation=p()};this.manager.start([f,u,y,l,d])}},{key:"runStepAnimation",value:function(i){var o=this,a=i.steps,s=i.begin,l=i.onAnimationStart,c=a[0],u=c.style,d=c.duration,f=d===void 0?0:d,p=function(v,g,m){if(m===0)return v;var x=g.duration,b=g.easing,S=b===void 0?"ease":b,w=g.style,E=g.properties,T=g.onAnimationEnd,A=m>0?a[m-1]:g,M=E||Object.keys(w);if(typeof S=="function"||S==="spring")return[].concat(nS(v),[o.runJSAnimation.bind(o,{from:A.style,to:w,duration:x,easing:S}),x]);var C=mL(M,x,S),P=mo(mo(mo({},A.style),w),{},{transition:C});return[].concat(nS(v),[P,x,T]).filter(VCe)};return this.manager.start([l].concat(nS(a.reduce(p,[u,Math.max(f,s)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=BCe());var o=i.begin,a=i.duration,s=i.attributeName,l=i.to,c=i.easing,u=i.onAnimationStart,d=i.onAnimationEnd,f=i.steps,p=i.children,y=this.manager;if(this.unSubscribe=y.subscribe(this.handleStyleChange),typeof c=="function"||typeof p=="function"||c==="spring"){this.runJSAnimation(i);return}if(f.length>1){this.runStepAnimation(i);return}var v=s?Ih({},s,l):l,g=mL(Object.keys(v),a,c);y.start([u,o,mo(mo({},v),{},{transition:g}),a,d])}},{key:"render",value:function(){var i=this.props,o=i.children;i.begin;var a=i.duration;i.attributeName,i.easing;var s=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var l=mPe(i,pPe),c=_.Children.count(o),u=this.state.style;if(typeof o=="function")return o(u);if(!s||c===0||a<=0)return o;var d=function(p){var y=p.props,v=y.style,g=v===void 0?{}:v,m=y.className,x=_.cloneElement(p,mo(mo({},l),{},{style:mo(mo({},g),u),className:m}));return x};return c===1?d(_.Children.only(o)):Z.createElement("div",null,_.Children.map(o,function(f){return d(f)}))}}]),n}(_.PureComponent);ss.displayName="Animate";ss.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};ss.propTypes={from:Jt.oneOfType([Jt.object,Jt.string]),to:Jt.oneOfType([Jt.object,Jt.string]),attributeName:Jt.string,duration:Jt.number,begin:Jt.number,easing:Jt.oneOfType([Jt.string,Jt.func]),steps:Jt.arrayOf(Jt.shape({duration:Jt.number.isRequired,style:Jt.object.isRequired,easing:Jt.oneOfType([Jt.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Jt.func]),properties:Jt.arrayOf("string"),onAnimationEnd:Jt.func})),children:Jt.oneOfType([Jt.node,Jt.func]),isActive:Jt.bool,canBegin:Jt.bool,onAnimationEnd:Jt.func,shouldReAnimate:Jt.bool,onAnimationStart:Jt.func,onAnimationReStart:Jt.func};function nm(t){"@babel/helpers - typeof";return nm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nm(t)}function v0(){return v0=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0?1:-1,l=r>=0?1:-1,c=i>=0&&r>=0||i<0&&r<0?1:0,u;if(a>0&&o instanceof Array){for(var d=[0,0,0,0],f=0,p=4;fa?a:o[f];u="M".concat(e,",").concat(n+s*d[0]),d[0]>0&&(u+="A ".concat(d[0],",").concat(d[0],",0,0,").concat(c,",").concat(e+l*d[0],",").concat(n)),u+="L ".concat(e+r-l*d[1],",").concat(n),d[1]>0&&(u+="A ".concat(d[1],",").concat(d[1],",0,0,").concat(c,`, + `).concat(e+r,",").concat(n+s*d[1])),u+="L ".concat(e+r,",").concat(n+i-s*d[2]),d[2]>0&&(u+="A ".concat(d[2],",").concat(d[2],",0,0,").concat(c,`, + `).concat(e+r-l*d[2],",").concat(n+i)),u+="L ".concat(e+l*d[3],",").concat(n+i),d[3]>0&&(u+="A ".concat(d[3],",").concat(d[3],",0,0,").concat(c,`, + `).concat(e,",").concat(n+i-s*d[3])),u+="Z"}else if(a>0&&o===+o&&o>0){var y=Math.min(a,o);u="M ".concat(e,",").concat(n+s*y,` + A `).concat(y,",").concat(y,",0,0,").concat(c,",").concat(e+l*y,",").concat(n,` + L `).concat(e+r-l*y,",").concat(n,` + A `).concat(y,",").concat(y,",0,0,").concat(c,",").concat(e+r,",").concat(n+s*y,` + L `).concat(e+r,",").concat(n+i-s*y,` + A `).concat(y,",").concat(y,",0,0,").concat(c,",").concat(e+r-l*y,",").concat(n+i,` + L `).concat(e+l*y,",").concat(n+i,` + A `).concat(y,",").concat(y,",0,0,").concat(c,",").concat(e,",").concat(n+i-s*y," Z")}else u="M ".concat(e,",").concat(n," h ").concat(r," v ").concat(i," h ").concat(-r," Z");return u},kPe=function(e,n){if(!e||!n)return!1;var r=e.x,i=e.y,o=n.x,a=n.y,s=n.width,l=n.height;if(Math.abs(s)>0&&Math.abs(l)>0){var c=Math.min(o,o+s),u=Math.max(o,o+s),d=Math.min(a,a+l),f=Math.max(a,a+l);return r>=c&&r<=u&&i>=d&&i<=f}return!1},jPe={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},hP=function(e){var n=SL(SL({},jPe),e),r=_.useRef(),i=_.useState(-1),o=CPe(i,2),a=o[0],s=o[1];_.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var S=r.current.getTotalLength();S&&s(S)}catch{}},[]);var l=n.x,c=n.y,u=n.width,d=n.height,f=n.radius,p=n.className,y=n.animationEasing,v=n.animationDuration,g=n.animationBegin,m=n.isAnimationActive,x=n.isUpdateAnimationActive;if(l!==+l||c!==+c||u!==+u||d!==+d||u===0||d===0)return null;var b=zt("recharts-rectangle",p);return x?Z.createElement(ss,{canBegin:a>0,from:{width:u,height:d,x:l,y:c},to:{width:u,height:d,x:l,y:c},duration:v,animationEasing:y,isActive:x},function(S){var w=S.width,E=S.height,T=S.x,A=S.y;return Z.createElement(ss,{canBegin:a>0,from:"0px ".concat(a===-1?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:v,isActive:m,easing:y},Z.createElement("path",v0({},$t(n,!0),{className:b,d:EL(T,A,w,E,f),ref:r})))}):Z.createElement("path",v0({},$t(n,!0),{className:b,d:EL(l,c,u,d,f)}))};function MT(){return MT=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function VPe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}var GPe=function(e,n,r,i,o,a){return"M".concat(e,",").concat(o,"v").concat(i,"M").concat(a,",").concat(n,"h").concat(r)},WPe=function(e){var n=e.x,r=n===void 0?0:n,i=e.y,o=i===void 0?0:i,a=e.top,s=a===void 0?0:a,l=e.left,c=l===void 0?0:l,u=e.width,d=u===void 0?0:u,f=e.height,p=f===void 0?0:f,y=e.className,v=HPe(e,UPe),g=FPe({x:r,y:o,top:s,left:c,width:d,height:p},v);return!ze(r)||!ze(o)||!ze(d)||!ze(p)||!ze(s)||!ze(c)?null:Z.createElement("path",AT({},$t(g,!0),{className:zt("recharts-cross",y),d:GPe(r,o,d,p,s,c)}))},XPe=L5,qPe=XPe(Object.getPrototypeOf,Object),KPe=qPe,YPe=us,JPe=KPe,ZPe=ds,QPe="[object Object]",eRe=Function.prototype,tRe=Object.prototype,bV=eRe.toString,nRe=tRe.hasOwnProperty,rRe=bV.call(Object);function iRe(t){if(!ZPe(t)||YPe(t)!=QPe)return!1;var e=JPe(t);if(e===null)return!0;var n=nRe.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&bV.call(n)==rRe}var oRe=iRe;const aRe=dn(oRe);var sRe=us,lRe=ds,cRe="[object Boolean]";function uRe(t){return t===!0||t===!1||lRe(t)&&sRe(t)==cRe}var dRe=uRe;const fRe=dn(dRe);function im(t){"@babel/helpers - typeof";return im=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},im(t)}function y0(){return y0=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n0,from:{upperWidth:0,lowerWidth:0,height:f,x:l,y:c},to:{upperWidth:u,lowerWidth:d,height:f,x:l,y:c},duration:v,animationEasing:y,isActive:m},function(b){var S=b.upperWidth,w=b.lowerWidth,E=b.height,T=b.x,A=b.y;return Z.createElement(ss,{canBegin:a>0,from:"0px ".concat(a===-1?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:v,easing:y},Z.createElement("path",y0({},$t(n,!0),{className:x,d:PL(T,A,S,w,E),ref:r})))}):Z.createElement("g",null,Z.createElement("path",y0({},$t(n,!0),{className:x,d:PL(l,c,u,d,f)})))},SRe=["option","shapeType","propTransformer","activeClassName","isActive"];function om(t){"@babel/helpers - typeof";return om=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},om(t)}function ERe(t,e){if(t==null)return{};var n=TRe(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function TRe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function RL(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 x0(t){for(var e=1;e0&&r.handleDrag(i.changedTouches[0])}),wi(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=r.props,o=i.endIndex,a=i.onDragEnd,s=i.startIndex;a==null||a({endIndex:o,startIndex:s})}),r.detachDragEndListener()}),wi(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),wi(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),wi(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),wi(r,"handleSlideDragStart",function(i){var o=jL(i)?i.changedTouches[0]:i;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:o.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return uNe(e,t),aNe(e,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var i=r.startX,o=r.endX,a=this.state.scaleValues,s=this.props,l=s.gap,c=s.data,u=c.length-1,d=Math.min(i,o),f=Math.max(i,o),p=e.getIndexInRange(a,d),y=e.getIndexInRange(a,f);return{startIndex:p-p%l,endIndex:y===u?u:y-y%l}}},{key:"getTextOfTick",value:function(r){var i=this.props,o=i.data,a=i.tickFormatter,s=i.dataKey,l=Di(o[r],s,r);return jt(a)?a(l,r):l}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var i=this.state,o=i.slideMoveStartX,a=i.startX,s=i.endX,l=this.props,c=l.x,u=l.width,d=l.travellerWidth,f=l.startIndex,p=l.endIndex,y=l.onChange,v=r.pageX-o;v>0?v=Math.min(v,c+u-d-s,c+u-d-a):v<0&&(v=Math.max(v,c-a,c-s));var g=this.getIndex({startX:a+v,endX:s+v});(g.startIndex!==f||g.endIndex!==p)&&y&&y(g),this.setState({startX:a+v,endX:s+v,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,i){var o=jL(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:o.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var i=this.state,o=i.brushMoveStartX,a=i.movingTravellerId,s=i.endX,l=i.startX,c=this.state[a],u=this.props,d=u.x,f=u.width,p=u.travellerWidth,y=u.onChange,v=u.gap,g=u.data,m={startX:this.state.startX,endX:this.state.endX},x=r.pageX-o;x>0?x=Math.min(x,d+f-p-c):x<0&&(x=Math.max(x,d-c)),m[a]=c+x;var b=this.getIndex(m),S=b.startIndex,w=b.endIndex,E=function(){var A=g.length-1;return a==="startX"&&(s>l?S%v===0:w%v===0)||sl?w%v===0:S%v===0)||s>l&&w===A};this.setState(wi(wi({},a,c+x),"brushMoveStartX",r.pageX),function(){y&&E()&&y(b)})}},{key:"handleTravellerMoveKeyboard",value:function(r,i){var o=this,a=this.state,s=a.scaleValues,l=a.startX,c=a.endX,u=this.state[i],d=s.indexOf(u);if(d!==-1){var f=d+r;if(!(f===-1||f>=s.length)){var p=s[f];i==="startX"&&p>=c||i==="endX"&&p<=l||this.setState(wi({},i,p),function(){o.props.onChange(o.getIndex({startX:o.state.startX,endX:o.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,i=r.x,o=r.y,a=r.width,s=r.height,l=r.fill,c=r.stroke;return Z.createElement("rect",{stroke:c,fill:l,x:i,y:o,width:a,height:s})}},{key:"renderPanorama",value:function(){var r=this.props,i=r.x,o=r.y,a=r.width,s=r.height,l=r.data,c=r.children,u=r.padding,d=_.Children.only(c);return d?Z.cloneElement(d,{x:i,y:o,width:a,height:s,margin:u,compact:!0,data:l}):null}},{key:"renderTravellerLayer",value:function(r,i){var o,a,s=this,l=this.props,c=l.y,u=l.travellerWidth,d=l.height,f=l.traveller,p=l.ariaLabel,y=l.data,v=l.startIndex,g=l.endIndex,m=Math.max(r,this.props.x),x=iS(iS({},$t(this.props,!1)),{},{x:m,y:c,width:u,height:d}),b=p||"Min value: ".concat((o=y[v])===null||o===void 0?void 0:o.name,", Max value: ").concat((a=y[g])===null||a===void 0?void 0:a.name);return Z.createElement(jn,{tabIndex:0,role:"slider","aria-label":b,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(w){["ArrowLeft","ArrowRight"].includes(w.key)&&(w.preventDefault(),w.stopPropagation(),s.handleTravellerMoveKeyboard(w.key==="ArrowRight"?1:-1,i))},onFocus:function(){s.setState({isTravellerFocused:!0})},onBlur:function(){s.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},e.renderTraveller(f,x))}},{key:"renderSlide",value:function(r,i){var o=this.props,a=o.y,s=o.height,l=o.stroke,c=o.travellerWidth,u=Math.min(r,i)+c,d=Math.max(Math.abs(i-r)-c,0);return Z.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:l,fillOpacity:.2,x:u,y:a,width:d,height:s})}},{key:"renderText",value:function(){var r=this.props,i=r.startIndex,o=r.endIndex,a=r.y,s=r.height,l=r.travellerWidth,c=r.stroke,u=this.state,d=u.startX,f=u.endX,p=5,y={pointerEvents:"none",fill:c};return Z.createElement(jn,{className:"recharts-brush-texts"},Z.createElement(Jy,_0({textAnchor:"end",verticalAnchor:"middle",x:Math.min(d,f)-p,y:a+s/2},y),this.getTextOfTick(i)),Z.createElement(Jy,_0({textAnchor:"start",verticalAnchor:"middle",x:Math.max(d,f)+l+p,y:a+s/2},y),this.getTextOfTick(o)))}},{key:"render",value:function(){var r=this.props,i=r.data,o=r.className,a=r.children,s=r.x,l=r.y,c=r.width,u=r.height,d=r.alwaysShowText,f=this.state,p=f.startX,y=f.endX,v=f.isTextActive,g=f.isSlideMoving,m=f.isTravellerMoving,x=f.isTravellerFocused;if(!i||!i.length||!ze(s)||!ze(l)||!ze(c)||!ze(u)||c<=0||u<=0)return null;var b=zt("recharts-brush",o),S=Z.Children.count(a)===1,w=iNe("userSelect","none");return Z.createElement(jn,{className:b,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:w},this.renderBackground(),S&&this.renderPanorama(),this.renderSlide(p,y),this.renderTravellerLayer(p,"startX"),this.renderTravellerLayer(y,"endX"),(v||g||m||x||d)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var i=r.x,o=r.y,a=r.width,s=r.height,l=r.stroke,c=Math.floor(o+s/2)-1;return Z.createElement(Z.Fragment,null,Z.createElement("rect",{x:i,y:o,width:a,height:s,fill:l,stroke:"none"}),Z.createElement("line",{x1:i+1,y1:c,x2:i+a-1,y2:c,fill:"none",stroke:"#fff"}),Z.createElement("line",{x1:i+1,y1:c+2,x2:i+a-1,y2:c+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,i){var o;return Z.isValidElement(r)?o=Z.cloneElement(r,i):jt(r)?o=r(i):o=e.renderDefaultTraveller(i),o}},{key:"getDerivedStateFromProps",value:function(r,i){var o=r.data,a=r.width,s=r.x,l=r.travellerWidth,c=r.updateId,u=r.startIndex,d=r.endIndex;if(o!==i.prevData||c!==i.prevUpdateId)return iS({prevData:o,prevTravellerWidth:l,prevUpdateId:c,prevX:s,prevWidth:a},o&&o.length?fNe({data:o,width:a,x:s,travellerWidth:l,startIndex:u,endIndex:d}):{scale:null,scaleValues:null});if(i.scale&&(a!==i.prevWidth||s!==i.prevX||l!==i.prevTravellerWidth)){i.scale.range([s,s+a-l]);var f=i.scale.domain().map(function(p){return i.scale(p)});return{prevData:o,prevTravellerWidth:l,prevUpdateId:c,prevX:s,prevWidth:a,startX:i.scale(r.startIndex),endX:i.scale(r.endIndex),scaleValues:f}}return null}},{key:"getIndexInRange",value:function(r,i){for(var o=r.length,a=0,s=o-1;s-a>1;){var l=Math.floor((a+s)/2);r[l]>i?s=l:a=l}return i>=r[s]?s:a}}])}(_.PureComponent);wi(ef,"displayName","Brush");wi(ef,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var hNe=FC;function pNe(t,e){var n;return hNe(t,function(r,i,o){return n=e(r,i,o),!n}),!!n}var mNe=pNe,gNe=A5,vNe=kf,yNe=mNe,xNe=yi,bNe=wb;function _Ne(t,e,n){var r=xNe(t)?gNe:yNe;return n&&bNe(t,e,n)&&(e=void 0),r(t,vNe(e))}var wNe=_Ne;const SNe=dn(wNe);var ma=function(e,n){var r=e.alwaysShow,i=e.ifOverflow;return r&&(i="extendDomain"),i===n},UL=q5;function ENe(t,e,n){e=="__proto__"&&UL?UL(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var TNe=ENe,MNe=TNe,ANe=W5,CNe=kf;function PNe(t,e){var n={};return e=CNe(e),ANe(t,function(r,i,o){MNe(n,i,e(r,i,o))}),n}var RNe=PNe;const NNe=dn(RNe);function ONe(t,e){for(var n=-1,r=t==null?0:t.length;++n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function YNe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function JNe(t,e){var n=t.x,r=t.y,i=KNe(t,GNe),o="".concat(n),a=parseInt(o,10),s="".concat(r),l=parseInt(s,10),c="".concat(e.height||i.height),u=parseInt(c,10),d="".concat(e.width||i.width),f=parseInt(d,10);return _h(_h(_h(_h(_h({},e),i),a?{x:a}:{}),l?{y:l}:{}),{},{height:u,width:f,name:e.name,radius:e.radius})}function BL(t){return Z.createElement(ORe,PT({shapeType:"rectangle",propTransformer:JNe,activeClassName:"recharts-active-bar"},t))}var ZNe=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,i){if(typeof e=="number")return e;var o=typeof r=="number";return o?e(r,i):(o||jc(),n)}},QNe=["value","background"],EV;function tf(t){"@babel/helpers - typeof";return tf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tf(t)}function eOe(t,e){if(t==null)return{};var n=tOe(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function tOe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function S0(){return S0=Object.assign?Object.assign.bind():function(t){for(var e=1;e0&&Math.abs(U)0&&Math.abs(k)0&&(D=Math.min((q||0)-(k[Q-1]||0),D))}),Number.isFinite(D)){var U=D/R,O=v.layout==="vertical"?r.height:r.width;if(v.padding==="gap"&&(T=U*O/2),v.padding==="no-gap"){var W=Lc(e.barCategoryGap,U*O),L=U*O/2;T=L-W-(L-W)/O*W}}}i==="xAxis"?A=[r.left+(b.left||0)+(T||0),r.left+r.width-(b.right||0)-(T||0)]:i==="yAxis"?A=l==="horizontal"?[r.top+r.height-(b.bottom||0),r.top+(b.top||0)]:[r.top+(b.top||0)+(T||0),r.top+r.height-(b.bottom||0)-(T||0)]:A=v.range,w&&(A=[A[1],A[0]]);var j=DMe(v,o,f),X=j.scale,K=j.realScaleType;X.domain(m).range(A),LMe(X);var F=HMe(X,Eo(Eo({},v),{},{realScaleType:K}));i==="xAxis"?(P=g==="top"&&!S||g==="bottom"&&S,M=r.left,C=d[E]-P*v.height):i==="yAxis"&&(P=g==="left"&&!S||g==="right"&&S,M=d[E]-P*v.width,C=r.top);var Y=Eo(Eo(Eo({},v),F),{},{realScaleType:K,x:M,y:C,scale:X,width:i==="xAxis"?r.width:v.width,height:i==="yAxis"?r.height:v.height});return Y.bandSize=d0(Y,F),!v.hide&&i==="xAxis"?d[E]+=(P?-1:1)*Y.height:v.hide||(d[E]+=(P?-1:1)*Y.width),Eo(Eo({},p),{},kb({},y,Y))},{})},CV=function(e,n){var r=e.x,i=e.y,o=n.x,a=n.y;return{x:Math.min(r,o),y:Math.min(i,a),width:Math.abs(o-r),height:Math.abs(a-i)}},hOe=function(e){var n=e.x1,r=e.y1,i=e.x2,o=e.y2;return CV({x:n,y:r},{x:i,y:o})},PV=function(){function t(e){cOe(this,t),this.scale=e}return uOe(t,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.bandAware,o=r.position;if(n!==void 0){if(o)switch(o){case"start":return this.scale(n);case"middle":{var a=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+a}case"end":{var s=this.bandwidth?this.bandwidth():0;return this.scale(n)+s}default:return this.scale(n)}if(i){var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+l}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),i=r[0],o=r[r.length-1];return i<=o?n>=i&&n<=o:n>=o&&n<=i}}],[{key:"create",value:function(n){return new t(n)}}])}();kb(PV,"EPS",1e-4);var mP=function(e){var n=Object.keys(e).reduce(function(r,i){return Eo(Eo({},r),{},kb({},i,PV.create(e[i])))},{});return Eo(Eo({},n),{},{apply:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=o.bandAware,s=o.position;return NNe(i,function(l,c){return n[c].apply(l,{bandAware:a,position:s})})},isInRange:function(i){return VNe(i,function(o,a){return n[a].isInRange(o)})}})};function pOe(t){return(t%180+180)%180}var mOe=function(e){var n=e.width,r=e.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=pOe(i),a=o*Math.PI/180,s=Math.atan(r/n),l=a>s&&at.length)&&(e=t.length);for(var n=0,r=new Array(e);nt*i)return!1;var o=n();return t*(e-t*o/2-r)>=0&&t*(e+t*o/2-i)<=0}function n2e(t,e){return WV(t,e+1)}function r2e(t,e,n,r,i){for(var o=(r||[]).slice(),a=e.start,s=e.end,l=0,c=1,u=a,d=function(){var y=r==null?void 0:r[l];if(y===void 0)return{v:WV(r,c)};var v=l,g,m=function(){return g===void 0&&(g=n(y,v)),g},x=y.coordinate,b=l===0||C0(t,x,m,u,s);b||(l=0,u=a,c+=1),b&&(u=x+t*(m()/2+i),l+=c)},f;c<=o.length;)if(f=d(),f)return f.v;return[]}function um(t){"@babel/helpers - typeof";return um=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},um(t)}function QL(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 Pr(t){for(var e=1;e0?p.coordinate-g*t:p.coordinate})}else o[f]=p=Pr(Pr({},p),{},{tickCoord:p.coordinate});var m=C0(t,p.tickCoord,v,s,l);m&&(l=p.tickCoord-t*(v()/2+i),o[f]=Pr(Pr({},p),{},{isShow:!0}))},u=a-1;u>=0;u--)c(u);return o}function l2e(t,e,n,r,i,o){var a=(r||[]).slice(),s=a.length,l=e.start,c=e.end;if(o){var u=r[s-1],d=n(u,s-1),f=t*(u.coordinate+t*d/2-c);a[s-1]=u=Pr(Pr({},u),{},{tickCoord:f>0?u.coordinate-f*t:u.coordinate});var p=C0(t,u.tickCoord,function(){return d},l,c);p&&(c=u.tickCoord-t*(d/2+i),a[s-1]=Pr(Pr({},u),{},{isShow:!0}))}for(var y=o?s-1:s,v=function(x){var b=a[x],S,w=function(){return S===void 0&&(S=n(b,x)),S};if(x===0){var E=t*(b.coordinate-t*w()/2-l);a[x]=b=Pr(Pr({},b),{},{tickCoord:E<0?b.coordinate-E*t:b.coordinate})}else a[x]=b=Pr(Pr({},b),{},{tickCoord:b.coordinate});var T=C0(t,b.tickCoord,w,l,c);T&&(l=b.tickCoord+t*(w()/2+i),a[x]=Pr(Pr({},b),{},{isShow:!0}))},g=0;g=2?Do(i[1].coordinate-i[0].coordinate):1,m=t2e(o,g,p);return l==="equidistantPreserveStart"?r2e(g,m,v,i,a):(l==="preserveStart"||l==="preserveStartEnd"?f=l2e(g,m,v,i,a,l==="preserveStartEnd"):f=s2e(g,m,v,i,a),f.filter(function(x){return x.isShow}))}var u2e=["viewBox"],d2e=["viewBox"],f2e=["ticks"];function af(t){"@babel/helpers - typeof";return af=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},af(t)}function Xu(){return Xu=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function h2e(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function p2e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function tk(t,e){for(var n=0;n0?l(this.props):l(p)),a<=0||s<=0||!y||!y.length?null:Z.createElement(jn,{className:zt("recharts-cartesian-axis",c),ref:function(g){r.layerReference=g}},o&&this.renderAxisLine(),this.renderTicks(y,this.state.fontSize,this.state.letterSpacing),Nr.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,i,o){var a;return Z.isValidElement(r)?a=Z.cloneElement(r,i):jt(r)?a=r(i):a=Z.createElement(Jy,Xu({},i,{className:"recharts-cartesian-axis-tick-value"}),o),a}}])}(_.Component);yP($b,"displayName","CartesianAxis");yP($b,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var _2e=["type","layout","connectNulls","ref"],w2e=["key"];function sf(t){"@babel/helpers - typeof";return sf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},sf(t)}function nk(t,e){if(t==null)return{};var n=S2e(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function S2e(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function Jh(){return Jh=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);nd){p=[].concat(Tu(l.slice(0,y)),[d-v]);break}var g=p.length%2===0?[0,f]:[f];return[].concat(Tu(e.repeat(l,u)),Tu(p),g).map(function(m){return"".concat(m,"px")}).join(", ")}),To(n,"id",Bm("recharts-line-")),To(n,"pathRef",function(a){n.mainCurve=a}),To(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),To(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return I2e(e,t),P2e(e,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();this.setState({totalLength:r})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();r!==this.state.totalLength&&this.setState({totalLength:r})}}},{key:"getTotalLength",value:function(){var r=this.mainCurve;try{return r&&r.getTotalLength&&r.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(r,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,a=o.points,s=o.xAxis,l=o.yAxis,c=o.layout,u=o.children,d=ro(u,Gm);if(!d)return null;var f=function(v,g){return{x:v.x,y:v.y,value:v.value,errorVal:Di(v.payload,g)}},p={clipPath:r?"url(#clipPath-".concat(i,")"):null};return Z.createElement(jn,p,d.map(function(y){return Z.cloneElement(y,{key:"bar-".concat(y.props.dataKey),data:a,xAxis:s,yAxis:l,layout:c,dataPointFormatter:f})}))}},{key:"renderDots",value:function(r,i,o){var a=this.props.isAnimationActive;if(a&&!this.state.isAnimationFinished)return null;var s=this.props,l=s.dot,c=s.points,u=s.dataKey,d=$t(this.props,!1),f=$t(l,!0),p=c.map(function(v,g){var m=_i(_i(_i({key:"dot-".concat(g),r:3},d),f),{},{index:g,cx:v.x,cy:v.y,value:v.value,dataKey:u,payload:v.payload,points:c});return e.renderDotItem(l,m)}),y={clipPath:r?"url(#clipPath-".concat(i?"":"dots-").concat(o,")"):null};return Z.createElement(jn,Jh({className:"recharts-line-dots",key:"dots"},y),p)}},{key:"renderCurveStatically",value:function(r,i,o,a){var s=this.props,l=s.type,c=s.layout,u=s.connectNulls;s.ref;var d=nk(s,_2e),f=_i(_i(_i({},$t(d,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(o,")"):null,points:r},a),{},{type:l,layout:c,connectNulls:u});return Z.createElement(gT,Jh({},f,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,i){var o=this,a=this.props,s=a.points,l=a.strokeDasharray,c=a.isAnimationActive,u=a.animationBegin,d=a.animationDuration,f=a.animationEasing,p=a.animationId,y=a.animateNewValues,v=a.width,g=a.height,m=this.state,x=m.prevPoints,b=m.totalLength;return Z.createElement(ss,{begin:u,duration:d,isActive:c,easing:f,from:{t:0},to:{t:1},key:"line-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(S){var w=S.t;if(x){var E=x.length/s.length,T=s.map(function(R,D){var k=Math.floor(D*E);if(x[k]){var U=x[k],O=Co(U.x,R.x),W=Co(U.y,R.y);return _i(_i({},R),{},{x:O(w),y:W(w)})}if(y){var L=Co(v*2,R.x),j=Co(g/2,R.y);return _i(_i({},R),{},{x:L(w),y:j(w)})}return _i(_i({},R),{},{x:R.x,y:R.y})});return o.renderCurveStatically(T,r,i)}var A=Co(0,b),M=A(w),C;if(l){var P="".concat(l).split(/[,\s]+/gim).map(function(R){return parseFloat(R)});C=o.getStrokeDasharray(M,b,P)}else C=o.generateSimpleStrokeDasharray(b,M);return o.renderCurveStatically(s,r,i,{strokeDasharray:C})})}},{key:"renderCurve",value:function(r,i){var o=this.props,a=o.points,s=o.isAnimationActive,l=this.state,c=l.prevPoints,u=l.totalLength;return s&&a&&a.length&&(!c&&u>0||!Nb(c,a))?this.renderCurveWithAnimation(r,i):this.renderCurveStatically(a,r,i)}},{key:"render",value:function(){var r,i=this.props,o=i.hide,a=i.dot,s=i.points,l=i.className,c=i.xAxis,u=i.yAxis,d=i.top,f=i.left,p=i.width,y=i.height,v=i.isAnimationActive,g=i.id;if(o||!s||!s.length)return null;var m=this.state.isAnimationFinished,x=s.length===1,b=zt("recharts-line",l),S=c&&c.allowDataOverflow,w=u&&u.allowDataOverflow,E=S||w,T=Ut(g)?this.id:g,A=(r=$t(a,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},M=A.r,C=M===void 0?3:M,P=A.strokeWidth,R=P===void 0?2:P,D=Ehe(a)?a:{},k=D.clipDot,U=k===void 0?!0:k,O=C*2+R;return Z.createElement(jn,{className:b},S||w?Z.createElement("defs",null,Z.createElement("clipPath",{id:"clipPath-".concat(T)},Z.createElement("rect",{x:S?f:f-p/2,y:w?d:d-y/2,width:S?p:p*2,height:w?y:y*2})),!U&&Z.createElement("clipPath",{id:"clipPath-dots-".concat(T)},Z.createElement("rect",{x:f-O/2,y:d-O/2,width:p+O,height:y+O}))):null,!x&&this.renderCurve(E,T),this.renderErrorBar(E,T),(x||a)&&this.renderDots(E,U,T),(!v||m)&&rl.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:i.curPoints}:r.points!==i.curPoints?{curPoints:r.points}:null}},{key:"repeat",value:function(r,i){for(var o=r.length%2!==0?[].concat(Tu(r),[0]):r,a=[],s=0;st.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function wIe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function SIe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function EIe(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n0?a:e&&e.length&&ze(i)&&ze(o)?e.slice(i,o+1):[]};function uG(t){return t==="number"?[0,"auto"]:void 0}var qT=function(e,n,r,i){var o=e.graphicalItems,a=e.tooltipAxis,s=zb(n,e);return r<0||!o||!o.length||r>=s.length?null:o.reduce(function(l,c){var u,d=(u=c.props.data)!==null&&u!==void 0?u:n;d&&e.dataStartIndex+e.dataEndIndex!==0&&e.dataEndIndex-e.dataStartIndex>=r&&(d=d.slice(e.dataStartIndex,e.dataEndIndex+1));var f;if(a.dataKey&&!a.allowDuplicatedCategory){var p=d===void 0?s:d;f=Ly(p,a.dataKey,i)}else f=d&&d[r]||s[r];return f?[].concat(ff(l),[aV(c,f)]):l},[])},uk=function(e,n,r,i){var o=i||{x:e.chartX,y:e.chartY},a=kIe(o,r),s=e.orderedTooltipTicks,l=e.tooltipAxis,c=e.tooltipTicks,u=CMe(a,s,c,l);if(u>=0&&c){var d=c[u]&&c[u].value,f=qT(e,n,u,d),p=jIe(r,s,u,o);return{activeTooltipIndex:u,activeLabel:d,activePayload:f,activeCoordinate:p}}return null},UIe=function(e,n){var r=n.axes,i=n.graphicalItems,o=n.axisType,a=n.axisIdKey,s=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=e.layout,d=e.children,f=e.stackOffset,p=iV(u,o);return r.reduce(function(y,v){var g,m=v.type.defaultProps!==void 0?ve(ve({},v.type.defaultProps),v.props):v.props,x=m.type,b=m.dataKey,S=m.allowDataOverflow,w=m.allowDuplicatedCategory,E=m.scale,T=m.ticks,A=m.includeHidden,M=m[a];if(y[M])return y;var C=zb(e.data,{graphicalItems:i.filter(function(F){var Y,q=a in F.props?F.props[a]:(Y=F.type.defaultProps)===null||Y===void 0?void 0:Y[a];return q===M}),dataStartIndex:l,dataEndIndex:c}),P=C.length,R,D,k;uIe(m.domain,S,x)&&(R=dT(m.domain,null,S),p&&(x==="number"||E!=="auto")&&(k=Kh(C,b,"category")));var U=uG(x);if(!R||R.length===0){var O,W=(O=m.domain)!==null&&O!==void 0?O:U;if(b){if(R=Kh(C,b,x),x==="category"&&p){var L=phe(R);w&&L?(D=R,R=b0(0,P)):w||(R=VD(W,R,v).reduce(function(F,Y){return F.indexOf(Y)>=0?F:[].concat(ff(F),[Y])},[]))}else if(x==="category")w?R=R.filter(function(F){return F!==""&&!Ut(F)}):R=VD(W,R,v).reduce(function(F,Y){return F.indexOf(Y)>=0||Y===""||Ut(Y)?F:[].concat(ff(F),[Y])},[]);else if(x==="number"){var j=IMe(C,i.filter(function(F){var Y,q,Q=a in F.props?F.props[a]:(Y=F.type.defaultProps)===null||Y===void 0?void 0:Y[a],te="hide"in F.props?F.props.hide:(q=F.type.defaultProps)===null||q===void 0?void 0:q.hide;return Q===M&&(A||!te)}),b,o,u);j&&(R=j)}p&&(x==="number"||E!=="auto")&&(k=Kh(C,b,"category"))}else p?R=b0(0,P):s&&s[M]&&s[M].hasStack&&x==="number"?R=f==="expand"?[0,1]:oV(s[M].stackGroups,l,c):R=rV(C,i.filter(function(F){var Y=a in F.props?F.props[a]:F.type.defaultProps[a],q="hide"in F.props?F.props.hide:F.type.defaultProps.hide;return Y===M&&(A||!q)}),x,u,!0);if(x==="number")R=GT(d,R,M,o,T),W&&(R=dT(W,R,S));else if(x==="category"&&W){var X=W,K=R.every(function(F){return X.indexOf(F)>=0});K&&(R=X)}}return ve(ve({},y),{},bt({},M,ve(ve({},m),{},{axisType:o,domain:R,categoricalDomain:k,duplicateDomain:D,originalDomain:(g=m.domain)!==null&&g!==void 0?g:U,isCategorical:p,layout:u})))},{})},FIe=function(e,n){var r=n.graphicalItems,i=n.Axis,o=n.axisType,a=n.axisIdKey,s=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=e.layout,d=e.children,f=zb(e.data,{graphicalItems:r,dataStartIndex:l,dataEndIndex:c}),p=f.length,y=iV(u,o),v=-1;return r.reduce(function(g,m){var x=m.type.defaultProps!==void 0?ve(ve({},m.type.defaultProps),m.props):m.props,b=x[a],S=uG("number");if(!g[b]){v++;var w;return y?w=b0(0,p):s&&s[b]&&s[b].hasStack?(w=oV(s[b].stackGroups,l,c),w=GT(d,w,b,o)):(w=dT(S,rV(f,r.filter(function(E){var T,A,M=a in E.props?E.props[a]:(T=E.type.defaultProps)===null||T===void 0?void 0:T[a],C="hide"in E.props?E.props.hide:(A=E.type.defaultProps)===null||A===void 0?void 0:A.hide;return M===b&&!C}),"number",u),i.defaultProps.allowDataOverflow),w=GT(d,w,b,o)),ve(ve({},g),{},bt({},b,ve(ve({axisType:o},i.defaultProps),{},{hide:!0,orientation:no(DIe,"".concat(o,".").concat(v%2),null),domain:w,originalDomain:S,isCategorical:y,layout:u})))}return g},{})},BIe=function(e,n){var r=n.axisType,i=r===void 0?"xAxis":r,o=n.AxisComp,a=n.graphicalItems,s=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=e.children,d="".concat(i,"Id"),f=ro(u,o),p={};return f&&f.length?p=UIe(e,{axes:f,graphicalItems:a,axisType:i,axisIdKey:d,stackGroups:s,dataStartIndex:l,dataEndIndex:c}):a&&a.length&&(p=FIe(e,{Axis:o,graphicalItems:a,axisType:i,axisIdKey:d,stackGroups:s,dataStartIndex:l,dataEndIndex:c})),p},$Ie=function(e){var n=Cu(e),r=ic(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:BC(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:d0(n,r)}},dk=function(e){var n=e.children,r=e.defaultShowTooltip,i=Ei(n,ef),o=0,a=0;return e.data&&e.data.length!==0&&(a=e.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(o=i.props.startIndex),i.props.endIndex>=0&&(a=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:a,activeTooltipIndex:-1,isTooltipActive:!!r}},zIe=function(e){return!e||!e.length?!1:e.some(function(n){var r=Ka(n&&n.type);return r&&r.indexOf("Bar")>=0})},fk=function(e){return e==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:e==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:e==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},HIe=function(e,n){var r=e.props,i=e.graphicalItems,o=e.xAxisMap,a=o===void 0?{}:o,s=e.yAxisMap,l=s===void 0?{}:s,c=r.width,u=r.height,d=r.children,f=r.margin||{},p=Ei(d,ef),y=Ei(d,hd),v=Object.keys(l).reduce(function(w,E){var T=l[E],A=T.orientation;return!T.mirror&&!T.hide?ve(ve({},w),{},bt({},A,w[A]+T.width)):w},{left:f.left||0,right:f.right||0}),g=Object.keys(a).reduce(function(w,E){var T=a[E],A=T.orientation;return!T.mirror&&!T.hide?ve(ve({},w),{},bt({},A,no(w,"".concat(A))+T.height)):w},{top:f.top||0,bottom:f.bottom||0}),m=ve(ve({},g),v),x=m.bottom;p&&(m.bottom+=p.props.height||ef.defaultProps.height),y&&n&&(m=NMe(m,i,r,n));var b=c-m.left-m.right,S=u-m.top-m.bottom;return ve(ve({brushBottom:x},m),{},{width:Math.max(b,0),height:Math.max(S,0)})},VIe=function(e,n){if(n==="xAxis")return e[n].width;if(n==="yAxis")return e[n].height},GIe=function(e){var n=e.chartName,r=e.GraphicalChild,i=e.defaultTooltipEventType,o=i===void 0?"axis":i,a=e.validateTooltipEventTypes,s=a===void 0?["axis"]:a,l=e.axisComponents,c=e.legendContent,u=e.formatAxisMap,d=e.defaultProps,f=function(m,x){var b=x.graphicalItems,S=x.stackGroups,w=x.offset,E=x.updateId,T=x.dataStartIndex,A=x.dataEndIndex,M=m.barSize,C=m.layout,P=m.barGap,R=m.barCategoryGap,D=m.maxBarSize,k=fk(C),U=k.numericAxisName,O=k.cateAxisName,W=zIe(b),L=[];return b.forEach(function(j,X){var K=zb(m.data,{graphicalItems:[j],dataStartIndex:T,dataEndIndex:A}),F=j.type.defaultProps!==void 0?ve(ve({},j.type.defaultProps),j.props):j.props,Y=F.dataKey,q=F.maxBarSize,Q=F["".concat(U,"Id")],te=F["".concat(O,"Id")],ee={},ce=l.reduce(function(it,Ft){var J=x["".concat(Ft.axisType,"Map")],B=F["".concat(Ft.axisType,"Id")];J&&J[B]||Ft.axisType==="zAxis"||jc();var ue=J[B];return ve(ve({},it),{},bt(bt({},Ft.axisType,ue),"".concat(Ft.axisType,"Ticks"),ic(ue)))},ee),ae=ce[O],fe=ce["".concat(O,"Ticks")],we=S&&S[Q]&&S[Q].hasStack&&GMe(j,S[Q].stackGroups),le=Ka(j.type).indexOf("Bar")>=0,ie=d0(ae,fe),G=[],Ve=W&&PMe({barSize:M,stackGroups:S,totalSize:VIe(ce,O)});if(le){var Ne,st,Re=Ut(q)?D:q,ct=(Ne=(st=d0(ae,fe,!0))!==null&&st!==void 0?st:Re)!==null&&Ne!==void 0?Ne:0;G=RMe({barGap:P,barCategoryGap:R,bandSize:ct!==ie?ct:ie,sizeList:Ve[te],maxBarSize:Re}),ct!==ie&&(G=G.map(function(it){return ve(ve({},it),{},{position:ve(ve({},it.position),{},{offset:it.position.offset-ct/2})})}))}var Ye=j&&j.type&&j.type.getComposedData;Ye&&L.push({props:ve(ve({},Ye(ve(ve({},ce),{},{displayedData:K,props:m,dataKey:Y,item:j,bandSize:ie,barPosition:G,offset:w,stackedData:we,layout:C,dataStartIndex:T,dataEndIndex:A}))),{},bt(bt(bt({key:j.key||"item-".concat(X)},U,ce[U]),O,ce[O]),"animationId",E)),childIndex:Ahe(j,m.children),item:j})}),L},p=function(m,x){var b=m.props,S=m.dataStartIndex,w=m.dataEndIndex,E=m.updateId;if(!k2({props:b}))return null;var T=b.children,A=b.layout,M=b.stackOffset,C=b.data,P=b.reverseStackOrder,R=fk(A),D=R.numericAxisName,k=R.cateAxisName,U=ro(T,r),O=zMe(C,U,"".concat(D,"Id"),"".concat(k,"Id"),M,P),W=l.reduce(function(F,Y){var q="".concat(Y.axisType,"Map");return ve(ve({},F),{},bt({},q,BIe(b,ve(ve({},Y),{},{graphicalItems:U,stackGroups:Y.axisType===D&&O,dataStartIndex:S,dataEndIndex:w}))))},{}),L=HIe(ve(ve({},W),{},{props:b,graphicalItems:U}),x==null?void 0:x.legendBBox);Object.keys(W).forEach(function(F){W[F]=u(b,W[F],L,F.replace("Map",""),n)});var j=W["".concat(k,"Map")],X=$Ie(j),K=f(b,ve(ve({},W),{},{dataStartIndex:S,dataEndIndex:w,updateId:E,graphicalItems:U,stackGroups:O,offset:L}));return ve(ve({formattedGraphicalItems:K,graphicalItems:U,offset:L,stackGroups:O},X),W)},y=function(g){function m(x){var b,S,w;return SIe(this,m),w=MIe(this,m,[x]),bt(w,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),bt(w,"accessibilityManager",new cIe),bt(w,"handleLegendBBoxUpdate",function(E){if(E){var T=w.state,A=T.dataStartIndex,M=T.dataEndIndex,C=T.updateId;w.setState(ve({legendBBox:E},p({props:w.props,dataStartIndex:A,dataEndIndex:M,updateId:C},ve(ve({},w.state),{},{legendBBox:E}))))}}),bt(w,"handleReceiveSyncEvent",function(E,T,A){if(w.props.syncId===E){if(A===w.eventEmitterSymbol&&typeof w.props.syncMethod!="function")return;w.applySyncEvent(T)}}),bt(w,"handleBrushChange",function(E){var T=E.startIndex,A=E.endIndex;if(T!==w.state.dataStartIndex||A!==w.state.dataEndIndex){var M=w.state.updateId;w.setState(function(){return ve({dataStartIndex:T,dataEndIndex:A},p({props:w.props,dataStartIndex:T,dataEndIndex:A,updateId:M},w.state))}),w.triggerSyncEvent({dataStartIndex:T,dataEndIndex:A})}}),bt(w,"handleMouseEnter",function(E){var T=w.getMouseInfo(E);if(T){var A=ve(ve({},T),{},{isTooltipActive:!0});w.setState(A),w.triggerSyncEvent(A);var M=w.props.onMouseEnter;jt(M)&&M(A,E)}}),bt(w,"triggeredAfterMouseMove",function(E){var T=w.getMouseInfo(E),A=T?ve(ve({},T),{},{isTooltipActive:!0}):{isTooltipActive:!1};w.setState(A),w.triggerSyncEvent(A);var M=w.props.onMouseMove;jt(M)&&M(A,E)}),bt(w,"handleItemMouseEnter",function(E){w.setState(function(){return{isTooltipActive:!0,activeItem:E,activePayload:E.tooltipPayload,activeCoordinate:E.tooltipPosition||{x:E.cx,y:E.cy}}})}),bt(w,"handleItemMouseLeave",function(){w.setState(function(){return{isTooltipActive:!1}})}),bt(w,"handleMouseMove",function(E){E.persist(),w.throttleTriggeredAfterMouseMove(E)}),bt(w,"handleMouseLeave",function(E){w.throttleTriggeredAfterMouseMove.cancel();var T={isTooltipActive:!1};w.setState(T),w.triggerSyncEvent(T);var A=w.props.onMouseLeave;jt(A)&&A(T,E)}),bt(w,"handleOuterEvent",function(E){var T=Mhe(E),A=no(w.props,"".concat(T));if(T&&jt(A)){var M,C;/.*touch.*/i.test(T)?C=w.getMouseInfo(E.changedTouches[0]):C=w.getMouseInfo(E),A((M=C)!==null&&M!==void 0?M:{},E)}}),bt(w,"handleClick",function(E){var T=w.getMouseInfo(E);if(T){var A=ve(ve({},T),{},{isTooltipActive:!0});w.setState(A),w.triggerSyncEvent(A);var M=w.props.onClick;jt(M)&&M(A,E)}}),bt(w,"handleMouseDown",function(E){var T=w.props.onMouseDown;if(jt(T)){var A=w.getMouseInfo(E);T(A,E)}}),bt(w,"handleMouseUp",function(E){var T=w.props.onMouseUp;if(jt(T)){var A=w.getMouseInfo(E);T(A,E)}}),bt(w,"handleTouchMove",function(E){E.changedTouches!=null&&E.changedTouches.length>0&&w.throttleTriggeredAfterMouseMove(E.changedTouches[0])}),bt(w,"handleTouchStart",function(E){E.changedTouches!=null&&E.changedTouches.length>0&&w.handleMouseDown(E.changedTouches[0])}),bt(w,"handleTouchEnd",function(E){E.changedTouches!=null&&E.changedTouches.length>0&&w.handleMouseUp(E.changedTouches[0])}),bt(w,"handleDoubleClick",function(E){var T=w.props.onDoubleClick;if(jt(T)){var A=w.getMouseInfo(E);T(A,E)}}),bt(w,"handleContextMenu",function(E){var T=w.props.onContextMenu;if(jt(T)){var A=w.getMouseInfo(E);T(A,E)}}),bt(w,"triggerSyncEvent",function(E){w.props.syncId!==void 0&&aS.emit(sS,w.props.syncId,E,w.eventEmitterSymbol)}),bt(w,"applySyncEvent",function(E){var T=w.props,A=T.layout,M=T.syncMethod,C=w.state.updateId,P=E.dataStartIndex,R=E.dataEndIndex;if(E.dataStartIndex!==void 0||E.dataEndIndex!==void 0)w.setState(ve({dataStartIndex:P,dataEndIndex:R},p({props:w.props,dataStartIndex:P,dataEndIndex:R,updateId:C},w.state)));else if(E.activeTooltipIndex!==void 0){var D=E.chartX,k=E.chartY,U=E.activeTooltipIndex,O=w.state,W=O.offset,L=O.tooltipTicks;if(!W)return;if(typeof M=="function")U=M(L,E);else if(M==="value"){U=-1;for(var j=0;j=0){var we,le;if(D.dataKey&&!D.allowDuplicatedCategory){var ie=typeof D.dataKey=="function"?fe:"payload.".concat(D.dataKey.toString());we=Ly(j,ie,U),le=X&&K&&Ly(K,ie,U)}else we=j==null?void 0:j[k],le=X&&K&&K[k];if(te||Q){var G=E.props.activeIndex!==void 0?E.props.activeIndex:k;return[_.cloneElement(E,ve(ve(ve({},M.props),ce),{},{activeIndex:G})),null,null]}if(!Ut(we))return[ae].concat(ff(w.renderActivePoints({item:M,activePoint:we,basePoint:le,childIndex:k,isRange:X})))}else{var Ve,Ne=(Ve=w.getItemByXY(w.state.activeCoordinate))!==null&&Ve!==void 0?Ve:{graphicalItem:ae},st=Ne.graphicalItem,Re=st.item,ct=Re===void 0?E:Re,Ye=st.childIndex,it=ve(ve(ve({},M.props),ce),{},{activeIndex:Ye});return[_.cloneElement(ct,it),null,null]}return X?[ae,null,null]:[ae,null]}),bt(w,"renderCustomized",function(E,T,A){return _.cloneElement(E,ve(ve({key:"recharts-customized-".concat(A)},w.props),w.state))}),bt(w,"renderMap",{CartesianGrid:{handler:xv,once:!0},ReferenceArea:{handler:w.renderReferenceElement},ReferenceLine:{handler:xv},ReferenceDot:{handler:w.renderReferenceElement},XAxis:{handler:xv},YAxis:{handler:xv},Brush:{handler:w.renderBrush,once:!0},Bar:{handler:w.renderGraphicChild},Line:{handler:w.renderGraphicChild},Area:{handler:w.renderGraphicChild},Radar:{handler:w.renderGraphicChild},RadialBar:{handler:w.renderGraphicChild},Scatter:{handler:w.renderGraphicChild},Pie:{handler:w.renderGraphicChild},Funnel:{handler:w.renderGraphicChild},Tooltip:{handler:w.renderCursor,once:!0},PolarGrid:{handler:w.renderPolarGrid,once:!0},PolarAngleAxis:{handler:w.renderPolarAxis},PolarRadiusAxis:{handler:w.renderPolarAxis},Customized:{handler:w.renderCustomized}}),w.clipPathId="".concat((b=x.id)!==null&&b!==void 0?b:Bm("recharts"),"-clip"),w.throttleTriggeredAfterMouseMove=eH(w.triggeredAfterMouseMove,(S=x.throttleDelay)!==null&&S!==void 0?S:1e3/60),w.state={},w}return PIe(m,g),TIe(m,[{key:"componentDidMount",value:function(){var b,S;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(b=this.props.margin.left)!==null&&b!==void 0?b:0,top:(S=this.props.margin.top)!==null&&S!==void 0?S:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var b=this.props,S=b.children,w=b.data,E=b.height,T=b.layout,A=Ei(S,So);if(A){var M=A.props.defaultIndex;if(!(typeof M!="number"||M<0||M>this.state.tooltipTicks.length-1)){var C=this.state.tooltipTicks[M]&&this.state.tooltipTicks[M].value,P=qT(this.state,w,M,C),R=this.state.tooltipTicks[M].coordinate,D=(this.state.offset.top+E)/2,k=T==="horizontal",U=k?{x:R,y:D}:{y:R,x:D},O=this.state.formattedGraphicalItems.find(function(L){var j=L.item;return j.type.name==="Scatter"});O&&(U=ve(ve({},U),O.props.points[M].tooltipPosition),P=O.props.points[M].tooltipPayload);var W={activeTooltipIndex:M,isTooltipActive:!0,activeLabel:C,activePayload:P,activeCoordinate:U};this.setState(W),this.renderCursor(A),this.accessibilityManager.setIndex(M)}}}},{key:"getSnapshotBeforeUpdate",value:function(b,S){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==S.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==b.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==b.margin){var w,E;this.accessibilityManager.setDetails({offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(E=this.props.margin.top)!==null&&E!==void 0?E:0}})}return null}},{key:"componentDidUpdate",value:function(b){M1([Ei(b.children,So)],[Ei(this.props.children,So)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var b=Ei(this.props.children,So);if(b&&typeof b.props.shared=="boolean"){var S=b.props.shared?"axis":"item";return s.indexOf(S)>=0?S:o}return o}},{key:"getMouseInfo",value:function(b){if(!this.container)return null;var S=this.container,w=S.getBoundingClientRect(),E=eSe(w),T={chartX:Math.round(b.pageX-E.left),chartY:Math.round(b.pageY-E.top)},A=w.width/S.offsetWidth||1,M=this.inRange(T.chartX,T.chartY,A);if(!M)return null;var C=this.state,P=C.xAxisMap,R=C.yAxisMap,D=this.getTooltipEventType(),k=uk(this.state,this.props.data,this.props.layout,M);if(D!=="axis"&&P&&R){var U=Cu(P).scale,O=Cu(R).scale,W=U&&U.invert?U.invert(T.chartX):null,L=O&&O.invert?O.invert(T.chartY):null;return ve(ve({},T),{},{xValue:W,yValue:L},k)}return k?ve(ve({},T),k):null}},{key:"inRange",value:function(b,S){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,E=this.props.layout,T=b/w,A=S/w;if(E==="horizontal"||E==="vertical"){var M=this.state.offset,C=T>=M.left&&T<=M.left+M.width&&A>=M.top&&A<=M.top+M.height;return C?{x:T,y:A}:null}var P=this.state,R=P.angleAxisMap,D=P.radiusAxisMap;if(R&&D){var k=Cu(R);return XD({x:T,y:A},k)}return null}},{key:"parseEventsOfWrapper",value:function(){var b=this.props.children,S=this.getTooltipEventType(),w=Ei(b,So),E={};w&&S==="axis"&&(w.props.trigger==="click"?E={onClick:this.handleClick}:E={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var T=ky(this.props,this.handleOuterEvent);return ve(ve({},T),E)}},{key:"addListener",value:function(){aS.on(sS,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){aS.removeListener(sS,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(b,S,w){for(var E=this.state.formattedGraphicalItems,T=0,A=E.length;T{var v,g;const[i,o]=_.useState([]),[a,s]=_.useState([]),l=_.useRef(0),{baseUrl:c,fetchWithHeaders:u}=Ln();_.useEffect(()=>{let m=!1;return hZ(c,u,t).then(x=>{var E;if(m||x.length===0)return;const b=x.filter(T=>T.loss!=null).map(T=>({step:T.step,loss:T.loss})).slice(-2e3),S=x.filter(T=>T.lr!=null).map(T=>({step:T.step,lr:T.lr})).slice(-2e3);o(b),s(S);const w=((E=x[x.length-1])==null?void 0:E.step)??0;l.current=w}).catch(()=>{}),()=>{m=!0}},[c,u,t]),_.useEffect(()=>{const m=e.current_step;if(m0&&e.current_loss!=null){const x=e.current_loss;o(b=>{const S=b[b.length-1];return S&&S.step===m?b:[...b,{step:m,loss:x}].slice(-2e3)})}if(m>0&&e.current_lr!=null){const x=e.current_lr;s(b=>{const S=b[b.length-1];return S&&S.step===m?b:[...b,{step:m,lr:x}].slice(-2e3)})}},[e.current_step,e.current_loss,e.current_lr]);const d=n(),f=e.training_active&&e.total_steps===0,p=f?"Training startingโ€ฆ":`${e.current_step.toLocaleString()} / ${e.total_steps.toLocaleString()}`,y=e.eta_seconds!=null?r(e.eta_seconds):"โ€”";return h.jsxs("div",{className:"space-y-6",children:[h.jsx(Gr,{className:"bg-slate-800/50 border-slate-700 rounded-xl",children:h.jsxs(Wr,{className:"p-6",children:[h.jsxs("div",{className:"flex items-baseline justify-between mb-3",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg bg-blue-500/20 text-blue-400",children:h.jsx($u,{className:"w-5 h-5"})}),h.jsxs("div",{children:[h.jsx("h3",{className:"text-sm text-slate-400",children:"Progress"}),h.jsx("div",{className:"text-base font-semibold text-white",children:p})]})]}),h.jsxs("div",{className:"flex items-center gap-2 text-slate-300",children:[h.jsx(dE,{className:"w-4 h-4 text-purple-400"}),h.jsxs("span",{className:"text-sm",children:["ETA ",h.jsx("span",{className:"font-semibold text-white",children:y})]})]})]}),h.jsxs("div",{className:"relative h-8 w-full overflow-hidden rounded-md bg-slate-900 border border-slate-700",children:[h.jsx("div",{className:"h-full bg-gradient-to-r from-blue-500 to-sky-400 transition-[width] duration-500",style:{width:`${d}%`}}),h.jsx("div",{className:"absolute inset-0 flex items-center justify-center font-semibold text-white text-sm tabular-nums drop-shadow",children:f?"warming upโ€ฆ":`${d.toFixed(1)}%`})]})]})}),h.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[h.jsxs(Gr,{className:"bg-slate-800/50 border-slate-700 rounded-xl",children:[h.jsx(jo,{className:"pb-2",children:h.jsxs(ha,{className:"flex items-center gap-3 text-white text-base",children:[h.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-green-500/20 text-green-400",children:h.jsx(qi,{className:"w-4 h-4"})}),h.jsxs("span",{children:["Loss"," ",h.jsxs("span",{className:"text-slate-400 text-sm font-normal",children:["(",((v=e.current_loss)==null?void 0:v.toFixed(4))??"โ€”",")"]})]})]})}),h.jsx(Wr,{className:"pt-0",children:h.jsx("div",{className:"h-48",children:i.length===0?h.jsx("div",{className:"flex h-full items-center justify-center text-slate-500 text-sm",children:"Waiting for first metric tickโ€ฆ"}):h.jsx(LI,{width:"100%",height:"100%",children:h.jsxs(hk,{data:i,margin:{top:8,right:12,left:0,bottom:0},children:[h.jsx(dm,{dataKey:"step",tick:{fill:"#94a3b8",fontSize:11},stroke:"#475569"}),h.jsx(fm,{tick:{fill:"#94a3b8",fontSize:11},stroke:"#475569",width:48}),h.jsx(So,{contentStyle:{background:"#1e293b",border:"1px solid #475569",borderRadius:8},labelStyle:{color:"#cbd5e1"},itemStyle:{color:"#34d399"},formatter:m=>m.toFixed(4)}),h.jsx(lf,{type:"monotone",dataKey:"loss",stroke:"#34d399",strokeWidth:2,dot:!1,isAnimationActive:!1})]})})})})]}),h.jsxs(Gr,{className:"bg-slate-800/50 border-slate-700 rounded-xl",children:[h.jsx(jo,{className:"pb-2",children:h.jsxs(ha,{className:"flex items-center gap-3 text-white text-base",children:[h.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-orange-500/20 text-orange-400",children:h.jsx($u,{className:"w-4 h-4"})}),h.jsxs("span",{children:["Learning Rate"," ",h.jsxs("span",{className:"text-slate-400 text-sm font-normal",children:["(",((g=e.current_lr)==null?void 0:g.toExponential(2))??"โ€”",")"]})]})]})}),h.jsx(Wr,{className:"pt-0",children:h.jsx("div",{className:"h-48",children:a.length===0?h.jsx("div",{className:"flex h-full items-center justify-center text-slate-500 text-sm",children:"Waiting for first metric tickโ€ฆ"}):h.jsx(LI,{width:"100%",height:"100%",children:h.jsxs(hk,{data:a,margin:{top:8,right:12,left:0,bottom:0},children:[h.jsx(dm,{dataKey:"step",tick:{fill:"#94a3b8",fontSize:11},stroke:"#475569"}),h.jsx(fm,{tick:{fill:"#94a3b8",fontSize:11},stroke:"#475569",width:48,tickFormatter:m=>m.toExponential(0)}),h.jsx(So,{contentStyle:{background:"#1e293b",border:"1px solid #475569",borderRadius:8},labelStyle:{color:"#cbd5e1"},itemStyle:{color:"#fb923c"},formatter:m=>m.toExponential(2)}),h.jsx(lf,{type:"monotone",dataKey:"lr",stroke:"#fb923c",strokeWidth:2,dot:!1,isAnimationActive:!1})]})})})})]})]})]})},XIe=({logs:t,logContainerRef:e})=>h.jsxs(Gr,{className:"bg-slate-800/50 border-slate-700 rounded-xl",children:[h.jsx(jo,{children:h.jsxs(ha,{className:"flex items-center gap-3 text-white",children:[h.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-slate-700",children:h.jsx(q7,{className:"w-5 h-5 text-sky-400"})}),"Training Logs"]})}),h.jsx(Wr,{children:h.jsx("div",{ref:e,className:"bg-slate-900 rounded-lg p-4 h-96 overflow-y-auto font-mono text-sm border border-slate-700",children:t.length===0?h.jsx("div",{className:"text-slate-500 py-8",children:"No training logs yet. Start training to see output."}):t.map((n,r)=>h.jsxs("div",{className:"text-slate-300 break-words whitespace-pre-wrap",children:[h.jsx("span",{className:"text-slate-500 mr-2 select-none",children:new Date(n.timestamp*1e3).toLocaleTimeString()}),n.message]},r))})})]}),qIe=({installHint:t})=>{const e=kz("system/training-extra");return h.jsx("div",{className:"max-w-3xl mx-auto",children:h.jsxs(Gr,{className:"bg-slate-800/50 border-slate-700 rounded-xl",children:[h.jsx(jo,{children:h.jsxs(ha,{className:"flex items-center gap-3 text-white",children:[h.jsx(Uz,{state:e.state}),jz(e.state,"Training Extra Not Installed")]})}),h.jsx(Wr,{className:"space-y-4",children:h.jsx(Fz,{state:e.state,error:e.error,logs:e.logs,logBoxRef:e.logBoxRef,onInstall:e.handleInstall,onRetry:e.handleRetry,installHint:t,packageName:"accelerate",idleTitle:"Training Extra Not Installed",idleDescription:h.jsxs(h.Fragment,{children:["Training requires the"," ",h.jsx("code",{className:"px-1 py-0.5 rounded bg-slate-900 text-sky-300",children:"accelerate"})," ","package, which isn't installed in this environment. Install it to enable the Training page."]}),doneDescription:h.jsx(Bz,{purpose:"training"})})})]})})},KIe=()=>{const{auth:t,refetch:e}=xf(),{baseUrl:n,fetchWithHeaders:r}=Ln(),[i,o]=_.useState(""),[a,s]=_.useState(!1),[l,c]=_.useState(null);if(t.status==="authenticated"||t.status==="loading")return null;const u=async()=>{const d=i.trim();if(d){s(!0),c(null);try{const f=await r(`${n}/hf-auth/login`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:d})});if(!f.ok){const p=await f.json().catch(()=>({}));throw new Error(p.detail||`HTTP ${f.status}`)}o(""),await e()}catch(f){c(f instanceof Error?f.message:String(f))}finally{s(!1)}}};return h.jsx("div",{className:"bg-amber-950/40 border border-amber-700/60 rounded-lg p-4 mb-6",children:h.jsxs("div",{className:"flex items-start gap-3",children:[h.jsx(td,{className:"w-5 h-5 text-amber-400 flex-shrink-0 mt-0.5"}),h.jsxs("div",{className:"flex-1 space-y-3",children:[h.jsxs("div",{children:[h.jsx("p",{className:"text-sm text-amber-100 font-medium",children:"Hugging Face access required for cloud training"}),h.jsxs("p",{className:"text-xs text-amber-200/80 mt-1",children:["Create a token at"," ",h.jsxs("a",{href:"https://huggingface.co/settings/tokens",target:"_blank",rel:"noreferrer",className:"underline hover:text-amber-50 inline-flex items-center gap-1",children:["huggingface.co/settings/tokens",h.jsx(ll,{className:"w-3 h-3"})]})," ","with ",h.jsx("span",{className:"font-mono",children:"Write"})," access (so trained policies can upload to your account), then paste it below."]})]}),h.jsxs("form",{onSubmit:d=>{d.preventDefault(),u()},className:"flex gap-2",children:[h.jsx(hi,{type:"password",placeholder:"hf_...",value:i,onChange:d=>o(d.target.value),className:"bg-slate-900 border-slate-600 text-white placeholder:text-slate-500",disabled:a,autoComplete:"off"}),h.jsx(et,{type:"submit",disabled:a||!i.trim(),className:"bg-amber-600 hover:bg-amber-700 text-white",children:a?h.jsxs(h.Fragment,{children:[h.jsx(fi,{className:"w-4 h-4 mr-2 animate-spin"}),"Savingโ€ฆ"]}):"Save token"})]}),l&&h.jsx("p",{className:"text-xs text-red-300",children:l})]})]})})},YIe=1e3,pk=5e3;function JIe(t,e){return t?{training_active:t.state==="running",current_step:t.metrics.current_step,total_steps:t.metrics.total_steps,current_loss:t.metrics.current_loss??void 0,current_lr:t.metrics.current_lr??void 0,grad_norm:t.metrics.grad_norm??void 0,eta_seconds:t.metrics.eta_seconds??void 0,available_controls:{stop_training:t.state==="running",pause_training:!1,resume_training:!1}}:{training_active:e,current_step:0,total_steps:0,available_controls:{stop_training:!1,pause_training:!1,resume_training:!1}}}function ZIe(t){return{target:t.target,dataset_repo_id:t.dataset_repo_id,policy_type:t.policy_type,steps:t.steps,batch_size:t.batch_size,seed:t.seed,num_workers:t.num_workers,log_freq:t.log_freq,save_freq:t.save_freq,save_checkpoint:t.save_checkpoint,resume:t.resume,wandb_enable:t.wandb_enable,wandb_project:t.wandb_project,wandb_entity:t.wandb_entity,wandb_notes:t.wandb_notes,wandb_mode:t.wandb_mode,wandb_disable_artifact:t.wandb_disable_artifact,policy_device:t.policy_device,policy_use_amp:t.policy_use_amp,optimizer_type:t.optimizer_type,optimizer_lr:t.optimizer_lr,optimizer_weight_decay:t.optimizer_weight_decay,optimizer_grad_clip_norm:t.optimizer_grad_clip_norm,use_policy_training_preset:t.use_policy_training_preset}}const QIe=()=>{var Q;const{baseUrl:t,fetchWithHeaders:e}=Ln(),{auth:n}=xf(),{toast:r}=Dr(),i=ji(),a=((Q=vl().state)==null?void 0:Q.datasetRepoId)??"",[s,l]=_.useState({target:{runner:"local"},dataset_repo_id:a,policy_type:"act",steps:1e4,batch_size:8,seed:1e3,num_workers:4,log_freq:250,save_freq:1e3,save_checkpoint:!0,resume:!1,wandb_enable:!1,wandb_mode:"online",wandb_disable_artifact:!1,policy_device:"cuda",policy_use_amp:!1,optimizer_type:"adam",use_policy_training_preset:!0}),[c,u]=_.useState([]),[d,f]=_.useState(!0),[p,y]=_.useState(null),[v,g]=_.useState("pip install accelerate"),[m,x]=_.useState(!1),[b,S]=_.useState(!1),[w,E]=_.useState(!1),[T,A]=_.useState([]),[M,C]=_.useState([]),[P,R]=_.useState(!0),[D,k]=_.useState("https://sensecraft-gpu.seeed.cc/lelab/connect"),[U,O]=_.useState(!1);_.useEffect(()=>{f(!0),g4(t,e).then(u).catch(()=>u([])).finally(()=>f(!1))},[t,e]),_.useEffect(()=>{e(`${t}/system/training-extra`).then(te=>te.json()).then(te=>{y(te.available),g(te.install_hint)}).catch(()=>y(!0))},[t,e]),_.useEffect(()=>{ME(t,e,200).then(te=>x(te.some(ee=>ee.runner==="local"&&ee.state==="running"))).catch(()=>x(!1))},[t,e]),_.useEffect(()=>{R(!0),TN(t,e).then(te=>{E(te.authenticated),A(te.flavors??[]),C(te.providers??[])}).catch(()=>{E(!1),A([]),C([])}).finally(()=>R(!1))},[t,e,n.status]),_.useEffect(()=>{vZ(t,e).then(te=>{const ee=te.web_url||"https://sensecraft-gpu.seeed.cc";k(`${ee.replace(/\/$/,"")}/lelab/connect`)}).catch(()=>k("https://sensecraft-gpu.seeed.cc/lelab/connect"))},[t,e]);const W=(te,ee)=>{l(ce=>({...ce,[te]:ee}))},L=async()=>{if(!s.dataset_repo_id.trim()){r({title:"Error",description:"Dataset repository ID is required",variant:"destructive"});return}S(!0);try{const te=await pZ(t,e,ZIe(s));r({title:"Training Started",description:te.name}),i(`/training/${te.id}`)}catch(te){const ee=te instanceof Error?te.message:String(te);r({title:"Error",description:ee,variant:"destructive"}),ME(t,e,200).then(ce=>x(ce.some(ae=>ae.runner==="local"&&ae.state==="running"))).catch(()=>{})}finally{S(!1)}},j=()=>{O(!0);const te=window.open(D,"lelab-seeed-cloud","width=520,height=720");if(!te){O(!1),r({title:"Seeed Cloud",description:"Browser blocked the connection window.",variant:"destructive"});return}const ee=window.setTimeout(()=>{window.removeEventListener("message",ae),O(!1)},12e4),ce=async(fe,we,le)=>{try{await yZ(t,e,{token:fe,api_url:we,web_url:le});const ie=await TN(t,e);E(ie.authenticated),A(ie.flavors??[]),C(ie.providers??[]),r({title:"Seeed Cloud connected",description:"GPU flavors are available now."})}catch(ie){const G=ie instanceof Error?ie.message:String(ie);r({title:"Seeed Cloud",description:G,variant:"destructive"})}finally{window.clearTimeout(ee),window.removeEventListener("message",ae),O(!1),te.close()}};function ae(fe){const we=new URL(D).origin;if(fe.origin!==we)return;const le=fe.data;(le==null?void 0:le.type)!=="seeed-cloud-token"||!le.token||ce(le.token,le.apiUrl,le.webUrl)}window.addEventListener("message",ae)};if(p===null)return h.jsx("div",{className:"min-h-screen bg-slate-900 text-white p-4",children:h.jsxs("div",{className:"max-w-7xl mx-auto",children:[h.jsx(Dw,{}),h.jsxs("div",{className:"flex items-center justify-center py-24 text-slate-400",children:[h.jsx(fi,{className:"w-6 h-6 animate-spin mr-3"}),"Checking training environmentโ€ฆ"]})]})});if(p===!1)return h.jsx("div",{className:"min-h-screen bg-slate-900 text-white p-4",children:h.jsxs("div",{className:"max-w-7xl mx-auto",children:[h.jsx(Dw,{}),h.jsx(qIe,{installHint:v})]})});const X=s.target.runner==="hf_cloud",K=(s.target.runner==="hf_cloud"||s.target.runner==="seeed_cloud"||s.target.runner==="external")&&!s.target.flavor,F=s.target.runner==="local"&&m,Y=b||!s.dataset_repo_id.trim()||F||X&&!w||K,q=F?"Another local training is already running":X&&!w?"Log in to Hugging Face to use cloud compute":K?"Select a hardware flavor":void 0;return h.jsx("div",{className:"min-h-screen bg-slate-900 text-white p-4",children:h.jsxs("div",{className:"max-w-7xl mx-auto",children:[h.jsx(Dw,{}),h.jsx(KIe,{}),h.jsx(kce,{config:s,updateConfig:W,datasets:c,datasetsLoading:d,authenticated:w,flavors:T,providers:M,hardwareLoading:P,seeedConnecting:U,onConnectSeeedCloud:j}),h.jsx("div",{className:"max-w-3xl mx-auto mt-6 flex justify-end",children:(()=>{const te=h.jsx(et,{onClick:L,disabled:Y,size:"lg",className:"bg-green-500 hover:bg-green-600 text-white font-semibold px-6",children:b?h.jsxs(h.Fragment,{children:[h.jsx(fi,{className:"w-5 h-5 mr-2 animate-spin"})," Startingโ€ฆ"]}):h.jsxs(h.Fragment,{children:[h.jsx(Tc,{className:"w-5 h-5 mr-2"})," Start Training"]})});return q?h.jsxs(jv,{children:[h.jsx(Uv,{asChild:!0,children:h.jsx("span",{tabIndex:0,children:te})}),h.jsx(Vh,{children:q})]}):te})()})]})})},eDe=({jobId:t})=>{const{baseUrl:e,fetchWithHeaders:n}=Ln(),{toast:r}=Dr(),i=ji(),{selectedRecord:o}=jA(),[a,s]=_.useState(null),[l,c]=_.useState(null),[u,d]=_.useState([]),f=_.useRef(null),[p,y]=_.useState([]),[v,g]=_.useState(null),[m,x]=_.useState(!1);_.useEffect(()=>{let M=!1;return fZ(e,n,t).then(C=>{!M&&C.length>0&&d(C)}).catch(()=>{}),()=>{M=!0}},[e,n,t]);const b=_.useRef(a==null?void 0:a.state);b.current=a==null?void 0:a.state,_.useEffect(()=>{let M=!1;const C=()=>{LA(e,n,t).then(R=>{if(!M)if(y(R),R.length>0){const D=R[R.length-1].step;g(k=>k!=null&&R.some(U=>U.step===k)?k:D)}else g(null)}).catch(()=>{M||(y([]),g(null))})};C();const P=setInterval(()=>{M||b.current&&b.current!=="running"||C()},5e3);return()=>{M=!0,clearInterval(P)}},[e,n,t]),_.useEffect(()=>{let M=!1;const C=async()=>{try{const R=await uZ(e,n,t);if(M)return;if(s(R),R.state==="running"){const D=await dZ(e,n,t);!M&&D.length>0&&d(k=>{const U=[...k,...D];return U.length>pk?U.slice(U.length-pk):U})}}catch(R){M||c(R instanceof Error?R.message:String(R))}};C();const P=setInterval(()=>{M||b.current&&b.current!=="running"||C()},YIe);return()=>{M=!0,clearInterval(P)}},[e,n,t]),_.useEffect(()=>{f.current&&(f.current.scrollTop=f.current.scrollHeight)},[u]);const S=M=>{const C=Math.floor(M/3600),P=Math.floor(M%3600/60),R=Math.floor(M%60);return`${C.toString().padStart(2,"0")}:${P.toString().padStart(2,"0")}:${R.toString().padStart(2,"0")}`},w=()=>!a||a.metrics.total_steps===0?0:a.metrics.current_step/a.metrics.total_steps*100,E=async()=>{if(a&&window.confirm("Stop this run?"))try{const M=await h4(e,n,a.id);s(M),r({title:"Stoppingโ€ฆ"})}catch(M){r({title:"Stop failed",description:M instanceof Error?M.message:String(M),variant:"destructive"})}},T=async()=>{if(a&&window.confirm("Delete this run? This wipes the output directory."))try{await p4(e,n,a.id),r({title:"Job removed"}),i("/")}catch(M){r({title:"Delete failed",description:M instanceof Error?M.message:String(M),variant:"destructive"})}};if(l&&!a)return h.jsx("div",{className:"min-h-screen bg-slate-900 text-white p-4",children:h.jsxs("div",{className:"max-w-7xl mx-auto space-y-4",children:[h.jsxs(et,{variant:"ghost",onClick:()=>i("/"),className:"text-slate-400",children:[h.jsx(sl,{className:"w-4 h-4 mr-2"})," Back to Jobs"]}),h.jsxs("p",{className:"text-red-300",children:["Couldn't load job ",t,": ",l]})]})});if(!a)return h.jsx("div",{className:"min-h-screen bg-slate-900 text-white p-4",children:h.jsxs("div",{className:"max-w-7xl mx-auto flex items-center justify-center py-24 text-slate-400",children:[h.jsx(fi,{className:"w-6 h-6 animate-spin mr-3"})," Loading jobโ€ฆ"]})});const A=a.state==="running";return h.jsx("div",{className:"min-h-screen bg-slate-900 text-white p-4",children:h.jsxs("div",{className:"max-w-7xl mx-auto space-y-6",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs(et,{variant:"ghost",onClick:()=>i("/"),className:"text-slate-400 hover:text-white",children:[h.jsx(sl,{className:"w-4 h-4 mr-2"})," Jobs"]}),h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("h1",{className:"text-xl font-semibold text-white",children:a.name}),a.runner==="hf_cloud"?h.jsxs("span",{className:"text-xs px-2 py-0.5 rounded bg-amber-900/40 text-amber-200 border border-amber-700",children:["HF ยท ",a.hf_flavor??"cloud"]}):a.runner==="seeed_cloud"||a.runner==="external"?h.jsxs("span",{className:"text-xs px-2 py-0.5 rounded bg-emerald-900/40 text-emerald-200 border border-emerald-700",children:[a.runner==="seeed_cloud"?"Seeed":a.external_provider??"External"," ยท"," ",a.external_flavor??"GPU"]}):h.jsx("span",{className:"text-xs px-2 py-0.5 rounded bg-slate-700 text-slate-200 border border-slate-600",children:"Local"}),a.runner==="hf_cloud"&&a.hf_repo_id&&a.state==="done"&&h.jsx("a",{href:`https://huggingface.co/${a.hf_repo_id}`,target:"_blank",rel:"noreferrer",className:"text-xs text-amber-300 hover:text-amber-200 underline",children:"View on Hub โ†—"}),(a.runner==="seeed_cloud"||a.runner==="external")&&a.external_job_url&&h.jsx("a",{href:a.external_job_url,target:"_blank",rel:"noreferrer",className:"text-xs text-emerald-300 hover:text-emerald-200 underline",children:"View provider job โ†—"}),a.wandb_run_url&&h.jsx("a",{href:a.wandb_run_url,target:"_blank",rel:"noreferrer",className:"text-xs text-yellow-300 hover:text-yellow-200 underline",children:"View on W&B โ†—"})]}),h.jsxs("p",{className:"text-xs text-slate-400",children:[a.state,a.error_message?` โ€” ${a.error_message}`:""]})]})]}),A?h.jsxs(et,{onClick:E,className:"bg-red-500 hover:bg-red-600 text-white",children:[h.jsx(Od,{className:"w-4 h-4 mr-2"})," Stop"]}):h.jsxs(et,{onClick:T,variant:"ghost",className:"text-slate-400 hover:text-white",children:[h.jsx(nA,{className:"w-4 h-4 mr-2"})," Delete"]})]}),h.jsx(WIe,{jobId:t,trainingStatus:JIe(a,!1),getProgressPercentage:w,formatTime:S}),h.jsxs("div",{className:"bg-slate-800/40 border border-slate-700 rounded-lg p-4 flex items-center gap-3",children:[h.jsx("span",{className:"text-sm font-semibold text-slate-300",children:"Run inference"}),p.length===0?h.jsx("span",{className:"text-xs text-slate-500",children:"No checkpoints yet โ€” wait for the first save."}):h.jsxs(h.Fragment,{children:[h.jsx(kA,{checkpoints:p,selectedStep:v,onChange:g}),h.jsxs(et,{onClick:()=>x(!0),disabled:v==null,className:"bg-green-500 hover:bg-green-600 text-white",children:[h.jsx(Tc,{className:"w-4 h-4 mr-2"}),"Run on robot"]})]})]}),h.jsx(m4,{open:m,onOpenChange:x,robot:o,jobId:t,initialStep:v}),h.jsx(XIe,{logs:u,logContainerRef:f})]})})},mk=()=>{const{jobId:t}=g6();return t?h.jsx(eDe,{jobId:t}):h.jsx(QIe,{})},tDe=1e3;function gk(t){const e=Math.max(0,Math.floor(t)),n=Math.floor(e/60),r=e%60;return`${String(n).padStart(2,"0")}:${String(r).padStart(2,"0")}`}const nDe=()=>{const t=ji(),{baseUrl:e,fetchWithHeaders:n}=Ln(),{toast:r}=Dr(),[i,o]=_.useState(null),[a,s]=_.useState(!1),l=_.useRef(!1),c=_.useRef(!1);_.useEffect(()=>{let b=!1;const S=async()=>{try{await CN(e,n)}catch{}},w=async()=>{try{const T=await RZ(e,n);if(b)return;if(o(T),!T.inference_active&&!l.current){l.current=!0,T.exited&&r({title:"Inference finished",description:T.exit_code===0?"Run completed.":`Exit code ${T.exit_code}. See ${T.log_path}.`,variant:T.exit_code===0?"default":"destructive"}),t("/");return}T.inference_active&&T.rollout_started_at!=null&&T.duration_s!=null&&T.duration_s>0&&T.rollout_elapsed_s>T.duration_s+10&&!c.current&&(c.current=!0,r({title:"Inference seems hung",description:`Rollout past duration by ${Math.round(T.rollout_elapsed_s-T.duration_s)}s. Stopping.`,variant:"destructive"}),S())}catch(T){b||r({title:"Lost connection to backend",description:T instanceof Error?T.message:String(T),variant:"destructive"})}};w();const E=setInterval(w,tDe);return()=>{b=!0,clearInterval(E)}},[e,n,t,r]);const u=async()=>{s(!1);try{await CN(e,n)}catch(b){r({title:"Stop failed",description:b instanceof Error?b.message:String(b),variant:"destructive"})}};if(!i)return h.jsxs("div",{className:"min-h-screen bg-black text-white flex items-center justify-center",children:[h.jsx(fi,{className:"w-6 h-6 animate-spin mr-3"})," Connecting to inferenceโ€ฆ"]});const d=i.elapsed_s??0,f=i.rollout_elapsed_s??0,p=i.duration_s??0,y=i.inference_active&&i.rollout_started_at==null,v=i.inference_active&&i.rollout_started_at!=null,g=v&&p>0?Math.min(100,f/p*100):0,m=y?"SETTING UP":v?"RUNNING":"FINISHED",x=v?f:d;return h.jsxs("div",{className:"min-h-screen bg-black text-white flex flex-col p-4 sm:p-6 lg:p-8",children:[h.jsxs("div",{className:"flex items-center gap-4 mb-8",children:[h.jsx(et,{variant:"ghost",size:"icon",onClick:()=>t("/"),className:"text-slate-400 hover:bg-slate-800 hover:text-white rounded-lg",children:h.jsx(sl,{className:"w-5 h-5"})}),h.jsx(Hx,{}),h.jsx("h1",{className:"font-bold text-white text-2xl",children:"Inference"})]}),h.jsx("div",{className:"flex-1 flex items-center justify-center",children:h.jsxs("div",{className:"bg-gray-900 rounded-lg border border-gray-700 p-8 w-full max-w-xl",children:[h.jsx("div",{className:"text-center mb-6",children:h.jsxs("div",{className:`inline-flex items-center gap-2 px-3 py-1 rounded-full text-xs font-bold tracking-widest ${y?"bg-amber-500/15 text-amber-300":"bg-green-500/15 text-green-300"}`,children:[h.jsx("span",{className:`w-2 h-2 rounded-full ${y?"bg-amber-500":"bg-green-500"} animate-pulse`}),m]})}),h.jsxs("div",{className:"text-center mb-4",children:[h.jsx("div",{className:`text-7xl font-mono font-bold leading-none ${y?"text-amber-400":"text-green-400"}`,children:gk(x)}),h.jsx("div",{className:"text-sm text-gray-500 mt-2",children:y?"Loading policy & connecting hardwareโ€ฆ":`/ ${gk(p)}`})]}),h.jsx("div",{className:"w-full bg-gray-800 rounded-full h-1.5 mb-8",children:h.jsx("div",{className:`h-1.5 rounded-full transition-all duration-500 ${y?"bg-amber-500/40 animate-pulse w-full":"bg-green-500"}`,style:y?void 0:{width:`${g}%`}})}),h.jsxs("div",{className:"text-xs text-slate-500 break-all mb-6",children:["policy: ",i.policy_ref??"(unknown)"]}),h.jsxs(et,{onClick:()=>s(!0),disabled:!i.inference_active,className:"w-full bg-red-500 hover:bg-red-600 text-white font-semibold py-6 text-lg disabled:opacity-50",children:[h.jsx(Od,{className:"w-5 h-5 mr-2"}),"Stop"]})]})}),h.jsx(mC,{open:a,onOpenChange:s,children:h.jsxs(Xx,{className:"bg-gray-900 border-gray-700 text-white",children:[h.jsxs(qx,{children:[h.jsx(Yx,{children:"Stop inference?"}),h.jsx(Jx,{className:"text-gray-400",children:"The follower will hold its current pose. You can launch another run from the job tile."})]}),h.jsxs(Kx,{children:[h.jsx(Qx,{className:"bg-gray-800 border-gray-700 text-white hover:bg-gray-700",children:"Keep running"}),h.jsx(Zx,{onClick:u,className:"bg-red-500 hover:bg-red-600 text-white",children:"Stop"})]})]})})]})},rDe=()=>h.jsxs("div",{className:"min-h-screen bg-black text-white flex flex-col items-center justify-center p-4",children:[h.jsx("h1",{className:"text-5xl font-bold tracking-tight",children:"Edit Dataset"}),h.jsx("p",{className:"mt-4 text-xl text-gray-400",children:"This page is under construction."})]}),iDe=()=>{var R;const t=vl(),e=ji(),{toast:n}=Dr(),{baseUrl:r,fetchWithHeaders:i}=Ln(),o=(R=t.state)==null?void 0:R.datasetInfo,[a,s]=_.useState(null),[l,c]=_.useState(!0),[u,d]=_.useState({tags:["robotics","lerobot"],private:!1}),[f,p]=_.useState(u.tags.join(", ")),[y,v]=_.useState(!1),[g,m]=_.useState(!1),[x,b]=_.useState(!1),[S,w]=_.useState(!1);Z.useEffect(()=>{(async()=>{if(!(o!=null&&o.dataset_repo_id)){n({title:"No Dataset Information",description:"Please complete a recording session first.",variant:"destructive"}),e("/");return}try{const k=await i(`${r}/dataset-info`,{method:"POST",body:JSON.stringify({dataset_repo_id:o.dataset_repo_id})}),U=await k.json();k.ok&&U.success?s({...U,saved_episodes:U.num_episodes,session_elapsed_seconds:o.session_elapsed_seconds||0,source:o.source}):(n({title:"Warning",description:"Could not load complete dataset information. Using session data.",variant:"destructive"}),s(o))}catch(k){console.error("Error loading dataset info:",k),n({title:"Warning",description:"Could not connect to backend. Using session data.",variant:"destructive"}),s(o)}finally{c(!1)}})()},[o,e,n]);const E=D=>{const k=`/spaces/lerobot/visualize_dataset?path=${encodeURIComponent(`/${D}`)}`,U=`https://huggingface.co/login?next=${encodeURIComponent(k)}`;window.open(U,"_blank","noopener,noreferrer")},T=D=>{const k=Math.floor(D/3600),U=Math.floor(D%3600/60),O=D%60;return k>0?`${k}h ${U}m ${O}s`:U>0?`${U}m ${O}s`:`${O}s`},A=async()=>{if(a){v(!0);try{const D=f.split(",").map(O=>O.trim()).filter(O=>O.length>0),k=await i(`${r}/upload-dataset`,{method:"POST",body:JSON.stringify({dataset_repo_id:a.dataset_repo_id,tags:D,private:u.private})}),U=await k.json();if(k.ok&&U.success)m(!0),n({title:"Upload Successful!",description:`Dataset ${a.dataset_repo_id} has been uploaded to HuggingFace Hub.`});else{const O="Failed to upload dataset to HuggingFace Hub.";n({title:"Upload Failed",description:U.docs_url?h.jsxs("span",{children:[U.message||O," ",h.jsx("a",{href:U.docs_url,target:"_blank",rel:"noopener noreferrer",className:"underline font-medium",children:"Open setup guide"})]}):U.message||O,variant:"destructive"})}}catch(D){console.error("Error uploading dataset:",D),n({title:"Connection Error",description:"Could not connect to the backend server.",variant:"destructive"})}finally{v(!1)}}},M=()=>{n({title:"Upload Skipped",description:"Dataset saved locally. You can upload it manually later."}),e("/")},C=async()=>{if(a){w(!0);try{const D=await i(`${r}/delete-dataset`,{method:"POST",body:JSON.stringify({dataset_repo_id:a.dataset_repo_id})}),k=await D.json();D.ok&&k.success?(n({title:"Dataset Deleted",description:`${a.dataset_repo_id} has been removed from disk.`}),e("/")):n({title:"Delete Failed",description:k.message||"Could not delete the dataset.",variant:"destructive"})}catch{n({title:"Connection Error",description:"Could not connect to the backend server.",variant:"destructive"})}finally{w(!1),b(!1)}}};if(l||!a)return h.jsx("div",{className:"min-h-screen bg-black text-white flex items-center justify-center",children:h.jsxs("div",{className:"text-center",children:[h.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-500 mx-auto mb-4"}),h.jsx("p",{className:"text-lg",children:"Loading dataset information..."})]})});const P=a.source==="both";return h.jsxs("div",{className:"min-h-screen bg-black text-white p-8",children:[h.jsxs("div",{className:"max-w-4xl mx-auto",children:[h.jsxs("div",{className:"flex items-center justify-between mb-8",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs(et,{onClick:()=>e("/"),variant:"outline",className:"border-gray-500 hover:border-gray-200 text-gray-300 hover:text-white",children:[h.jsx(sl,{className:"w-4 h-4 mr-2"}),"Back to Home"]}),h.jsx(et,{onClick:()=>b(!0),variant:"outline",size:"icon",disabled:S,"aria-label":"Delete dataset from disk",className:"border-red-500/40 text-red-400 hover:border-red-400 hover:text-red-300 hover:bg-red-500/10",children:h.jsx(nA,{className:"w-4 h-4"})})]}),h.jsxs("div",{className:"flex items-center gap-3",children:[g?h.jsx(qi,{className:"w-8 h-8 text-green-500"}):h.jsx(V7,{className:"w-8 h-8 text-blue-500"}),h.jsx("h1",{className:"text-3xl font-bold",children:g?"Upload Complete":"Dataset Upload"})]})]}),g&&h.jsxs("div",{className:"bg-green-900/20 border border-green-600 rounded-lg p-6 mb-8",children:[h.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[h.jsx(qi,{className:"w-6 h-6 text-green-500"}),h.jsx("h2",{className:"text-xl font-semibold text-green-400",children:"Successfully Uploaded!"})]}),h.jsx("p",{className:"text-gray-300 mb-4",children:"Your dataset has been uploaded to HuggingFace Hub and is now available for training and sharing."}),h.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[h.jsxs(et,{onClick:()=>{const D=`/spaces/lerobot/visualize_dataset?path=${encodeURIComponent(`/${a.dataset_repo_id}`)}`,k=u.private?`https://huggingface.co/login?next=${encodeURIComponent(D)}`:`https://huggingface.co${D}`;window.open(k,"_blank","noopener,noreferrer")},className:"bg-blue-500 hover:bg-blue-600 text-white",children:[h.jsx(ll,{className:"w-4 h-4 mr-2"}),"View on HuggingFace Hub"]}),h.jsx(et,{onClick:()=>e("/training",{state:{datasetRepoId:a.dataset_repo_id}}),className:"bg-purple-500 hover:bg-purple-600 text-white",children:"Start Training"})]})]}),!g&&h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"bg-gray-900 rounded-lg p-6 border border-gray-700 mb-8",children:[h.jsx("h2",{className:"text-xl font-semibold text-white mb-4",children:"Dataset Summary"}),h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-400",children:"Repository ID:"}),h.jsx("p",{className:"text-white font-mono text-lg",children:a.dataset_repo_id})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-400",children:"Task:"}),h.jsx("p",{className:"text-white",children:a.single_task})]})]}),h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-400",children:"Episodes Recorded:"}),h.jsx("p",{className:"text-white text-2xl font-bold text-green-400",children:a.saved_episodes||a.num_episodes}),a.total_frames&&h.jsxs("p",{className:"text-gray-400 text-sm",children:[a.total_frames," total frames"]})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-400",children:"Session Duration:"}),h.jsx("p",{className:"text-white",children:T(a.session_elapsed_seconds||0)}),a.fps&&h.jsxs("p",{className:"text-gray-400 text-sm",children:[a.fps," FPS"]})]})]})]})]}),!P&&h.jsxs("div",{className:"bg-gray-900 rounded-lg p-6 border border-gray-700 mb-8",children:[h.jsx("h2",{className:"text-xl font-semibold text-white mb-6",children:"Upload Configuration"}),h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{children:[h.jsx(Nt,{htmlFor:"tags",className:"text-gray-300 mb-2 block",children:"Tags (comma-separated)"}),h.jsx(hi,{id:"tags",value:f,onChange:D=>p(D.target.value),placeholder:"robotics, lerobot, manipulation",className:"bg-gray-800 border-gray-600 text-white"}),h.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Tags help others discover your dataset on HuggingFace Hub"})]}),h.jsxs("div",{className:"flex items-center space-x-3",children:[h.jsx(PA,{id:"private",checked:u.private,onCheckedChange:D=>d({...u,private:D})}),h.jsxs("div",{className:"flex items-center gap-2",children:[u.private?h.jsx(W7,{className:"w-4 h-4 text-gray-400"}):h.jsx(X7,{className:"w-4 h-4 text-gray-400"}),h.jsx(Nt,{htmlFor:"private",className:"text-gray-300",children:"Make dataset private"})]})]}),h.jsx("p",{className:"text-sm text-gray-500 ml-6",children:u.private?"Only you will be able to access this dataset":"Dataset will be publicly accessible on HuggingFace Hub"})]})]}),h.jsx("div",{className:"flex flex-col sm:flex-row gap-4 justify-center",children:P?h.jsxs(et,{onClick:()=>E(a.dataset_repo_id),className:"bg-blue-500 hover:bg-blue-600 text-white font-semibold py-4 px-8 text-lg",children:[h.jsx(ll,{className:"w-5 h-5 mr-2"}),"View on Hugging Face Hub"]}):h.jsxs(h.Fragment,{children:[h.jsx(et,{onClick:A,disabled:y,className:"bg-blue-500 hover:bg-blue-600 text-white font-semibold py-4 px-8 text-lg",children:y?h.jsxs(h.Fragment,{children:[h.jsx(fi,{className:"w-5 h-5 mr-2 animate-spin"}),"Uploading to Hub..."]}):h.jsxs(h.Fragment,{children:[h.jsx(IU,{className:"w-5 h-5 mr-2"}),"Upload to HuggingFace Hub"]})}),h.jsx(et,{onClick:M,disabled:y,variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-800 hover:text-white py-4 px-8 text-lg",children:"Skip Upload"})]})}),!P&&h.jsx("div",{className:"mt-8 p-4 bg-blue-900/20 border border-blue-600 rounded-lg",children:h.jsxs("div",{className:"flex items-start gap-3",children:[h.jsx(td,{className:"w-5 h-5 text-blue-400 mt-0.5"}),h.jsxs("div",{children:[h.jsx("h3",{className:"font-semibold text-blue-400 mb-2",children:"About HuggingFace Hub Upload"}),h.jsxs("ul",{className:"text-sm text-gray-300 space-y-1",children:[h.jsx("li",{children:"โ€ข Your dataset will be uploaded to HuggingFace Hub for sharing and collaboration"}),h.jsx("li",{children:"โ€ข You need to be logged in to HuggingFace CLI on the server"}),h.jsx("li",{children:"โ€ข Uploaded datasets can be used for training models and sharing with the community"}),h.jsx("li",{children:"โ€ข You can always upload manually later using the HuggingFace CLI"})]})]})]})})]})]}),h.jsx(mC,{open:x,onOpenChange:b,children:h.jsxs(Xx,{className:"bg-gray-900 border-gray-700 text-white",children:[h.jsxs(qx,{children:[h.jsx(Yx,{children:"Delete dataset from disk?"}),h.jsxs(Jx,{className:"text-gray-400",children:["This permanently removes ",h.jsx("span",{className:"font-mono text-white",children:a.dataset_repo_id})," from your local cache. This action cannot be undone."]})]}),h.jsxs(Kx,{children:[h.jsx(Qx,{className:"bg-gray-800 border-gray-700 text-white hover:bg-gray-700",children:"Keep dataset"}),h.jsx(Zx,{onClick:C,disabled:S,className:"bg-red-500 hover:bg-red-600 text-white",children:S?"Deletingโ€ฆ":"Delete"})]})]})})]})},oDe=()=>{const t=vl();return _.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",t.pathname)},[t.pathname]),h.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-100",children:h.jsxs("div",{className:"text-center",children:[h.jsx("h1",{className:"text-4xl font-bold mb-4",children:"404"}),h.jsx("p",{className:"text-xl text-gray-600 mb-4",children:"Oops! Page not found"}),h.jsx("a",{href:"/",className:"text-blue-500 hover:text-blue-700 underline",children:"Return to Home"})]})})},aDe="lelab-tabs-v1",sDe=1e3,lDe=3e3,cDe=({children:t})=>{const[e,n]=_.useState(!0),r=_.useRef(new Map),i=_.useRef(""),o=_.useRef(0),a=_.useRef(null),s=_.useCallback(()=>{const c=r.current,u=Date.now()-lDe;for(const[p,y]of c)y.lastSeen{if(typeof window>"u"||typeof BroadcastChannel>"u")return;i.current=crypto.randomUUID(),o.current=Date.now();const c=new BroadcastChannel(aDe);a.current=c;const u=p=>{c.postMessage({type:p,id:i.current,openedAt:o.current})};c.onmessage=p=>{const y=p.data;if(!y||y.id===i.current)return;const v=r.current;y.type==="HEARTBEAT"?v.set(y.id,{id:y.id,openedAt:y.openedAt,lastSeen:Date.now()}):y.type==="RELEASE"?v.delete(y.id):y.type==="TAKEOVER"&&(v.set(y.id,{id:y.id,openedAt:y.openedAt,lastSeen:Date.now()}),o.current<=y.openedAt&&(o.current=y.openedAt+1)),s()},u("HEARTBEAT");const d=setInterval(()=>{u("HEARTBEAT"),s()},sDe),f=()=>u("RELEASE");return window.addEventListener("beforeunload",f),()=>{window.removeEventListener("beforeunload",f),clearInterval(d),u("RELEASE"),c.close(),a.current=null}},[s]);const l=_.useCallback(()=>{var c;o.current=0,(c=a.current)==null||c.postMessage({type:"TAKEOVER",id:i.current,openedAt:0}),s()},[s]);return h.jsxs(h.Fragment,{children:[t,!e&&h.jsx("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center bg-black/80 backdrop-blur-sm",role:"dialog","aria-modal":"true",children:h.jsxs("div",{className:"mx-4 max-w-md space-y-4 rounded-lg border bg-background p-6 text-center shadow-lg",children:[h.jsx("h2",{className:"text-lg font-semibold",children:"LeLab is already open in another tab"}),h.jsx("p",{className:"text-sm text-muted-foreground",children:"Only one tab can control the robot at a time. Switch back to the original tab, or take over here โ€” the other tab will lock."}),h.jsx(et,{onClick:l,children:"Use this tab"})]})})]})},uDe=new i9;function dDe(){return h.jsx(a9,{client:uDe,children:h.jsx(zF,{children:h.jsx(c9,{children:h.jsx(HX,{children:h.jsx(VX,{children:h.jsx(F9,{children:h.jsx($9,{children:h.jsxs(L6,{children:[h.jsx(cDe,{children:h.jsxs(O6,{children:[h.jsx(go,{path:"/",element:h.jsx(zZ,{})}),h.jsx(go,{path:"/teleoperation",element:h.jsx(mse,{})}),h.jsx(go,{path:"/recording",element:h.jsx(_ce,{})}),h.jsx(go,{path:"/upload",element:h.jsx(iDe,{})}),h.jsx(go,{path:"/training",element:h.jsx(mk,{})}),h.jsx(go,{path:"/training/:jobId",element:h.jsx(mk,{})}),h.jsx(go,{path:"/inference",element:h.jsx(nDe,{})}),h.jsx(go,{path:"/calibration",element:h.jsx(Ase,{})}),h.jsx(go,{path:"/edit-dataset",element:h.jsx(rDe,{})}),h.jsx(go,{path:"*",element:h.jsx(oDe,{})})]})}),h.jsx(FX,{})]})})})})})})})})}U3(document.getElementById("root")).render(h.jsx(dDe,{})); diff --git a/frontend/dist/assets/index-CKfgS6qV.css b/frontend/dist/assets/index-CKfgS6qV.css new file mode 100644 index 0000000..7ba9c4b --- /dev/null +++ b/frontend/dist/assets/index-CKfgS6qV.css @@ -0,0 +1 @@ +*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--background: 0 0% 100%;--foreground: 222.2 84% 4.9%;--card: 0 0% 100%;--card-foreground: 222.2 84% 4.9%;--popover: 0 0% 100%;--popover-foreground: 222.2 84% 4.9%;--primary: 222.2 47.4% 11.2%;--primary-foreground: 210 40% 98%;--secondary: 210 40% 96.1%;--secondary-foreground: 222.2 47.4% 11.2%;--muted: 210 40% 96.1%;--muted-foreground: 215.4 16.3% 46.9%;--accent: 210 40% 96.1%;--accent-foreground: 222.2 47.4% 11.2%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 210 40% 98%;--border: 214.3 31.8% 91.4%;--input: 214.3 31.8% 91.4%;--ring: 222.2 84% 4.9%;--radius: .5rem;--sidebar-background: 0 0% 98%;--sidebar-foreground: 240 5.3% 26.1%;--sidebar-primary: 240 5.9% 10%;--sidebar-primary-foreground: 0 0% 98%;--sidebar-accent: 240 4.8% 95.9%;--sidebar-accent-foreground: 240 5.9% 10%;--sidebar-border: 220 13% 91%;--sidebar-ring: 217.2 91.2% 59.8%}.dark{--background: 222.2 84% 4.9%;--foreground: 210 40% 98%;--card: 222.2 84% 4.9%;--card-foreground: 210 40% 98%;--popover: 222.2 84% 4.9%;--popover-foreground: 210 40% 98%;--primary: 210 40% 98%;--primary-foreground: 222.2 47.4% 11.2%;--secondary: 217.2 32.6% 17.5%;--secondary-foreground: 210 40% 98%;--muted: 217.2 32.6% 17.5%;--muted-foreground: 215 20.2% 65.1%;--accent: 217.2 32.6% 17.5%;--accent-foreground: 210 40% 98%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 210 40% 98%;--border: 217.2 32.6% 17.5%;--input: 217.2 32.6% 17.5%;--ring: 212.7 26.8% 83.9%;--sidebar-background: 240 5.9% 10%;--sidebar-foreground: 240 4.8% 95.9%;--sidebar-primary: 224.3 76.3% 48%;--sidebar-primary-foreground: 0 0% 100%;--sidebar-accent: 240 3.7% 15.9%;--sidebar-accent-foreground: 240 4.8% 95.9%;--sidebar-border: 240 3.7% 15.9%;--sidebar-ring: 217.2 91.2% 59.8%}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground))}.container{width:100%;margin-right:auto;margin-left:auto;padding-right:2rem;padding-left:2rem}@media (min-width: 1400px){.container{max-width:1400px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{left:0;right:0}.bottom-0{bottom:0}.bottom-4{bottom:1rem}.left-2{left:.5rem}.left-2\.5{left:.625rem}.left-\[50\%\]{left:50%}.right-2{right:.5rem}.right-4{right:1rem}.top-0{top:0}.top-1\/2{top:50%}.top-2{top:.5rem}.top-4{top:1rem}.top-\[50\%\]{top:50%}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-50{z-index:50}.z-\[100\]{z-index:100}.z-\[9999\]{z-index:9999}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-6{margin-left:1.5rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.contents{display:contents}.hidden{display:none}.aspect-\[4\/3\]{aspect-ratio:4/3}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-16{height:4rem}.h-2{height:.5rem}.h-24{height:6rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-40{height:10rem}.h-48{height:12rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-64{height:16rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-96{height:24rem}.h-\[1px\]{height:1px}.h-\[95vh\]{height:95vh}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.max-h-96{max-height:24rem}.max-h-\[300px\]{max-height:300px}.max-h-\[440px\]{max-height:440px}.max-h-\[90vh\]{max-height:90vh}.max-h-screen{max-height:100vh}.min-h-10{min-height:2.5rem}.min-h-\[120px\]{min-height:120px}.min-h-\[50vh\]{min-height:50vh}.min-h-screen{min-height:100vh}.w-1{width:.25rem}.w-1\.5{width:.375rem}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-32{width:8rem}.w-4{width:1rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-56{width:14rem}.w-6{width:1.5rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-\[--radix-popover-trigger-width\]{width:var(--radix-popover-trigger-width)}.w-\[1px\]{width:1px}.w-\[320px\]{width:320px}.w-\[min\(560px\,calc\(100vw-2rem\)\)\]{width:min(560px,calc(100vw - 2rem))}.w-auto{width:auto}.w-full{width:100%}.w-px{width:1px}.min-w-0{min-width:0px}.min-w-\[110px\]{min-width:110px}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-4xl{max-width:56rem}.max-w-7xl{max-width:80rem}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-xl{max-width:36rem}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\[-50\%\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\[-50\%\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-px{gap:1px}.space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.75rem * var(--tw-space-x-reverse));margin-left:calc(.75rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.self-stretch{align-self:stretch}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.rounded-t-lg{border-top-left-radius:var(--radius);border-top-right-radius:var(--radius)}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-t{border-top-width:1px}.border-amber-400\/60{border-color:#fbbf2499}.border-amber-700{--tw-border-opacity: 1;border-color:rgb(180 83 9 / var(--tw-border-opacity, 1))}.border-amber-700\/60{border-color:#b4530999}.border-blue-500{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.border-blue-600{--tw-border-opacity: 1;border-color:rgb(37 99 235 / var(--tw-border-opacity, 1))}.border-destructive{border-color:hsl(var(--destructive))}.border-destructive\/50{border-color:hsl(var(--destructive) / .5)}.border-emerald-500\/50{border-color:#10b98180}.border-emerald-700{--tw-border-opacity: 1;border-color:rgb(4 120 87 / var(--tw-border-opacity, 1))}.border-gray-500{--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity, 1))}.border-gray-600{--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1))}.border-gray-700{--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))}.border-gray-800{--tw-border-opacity: 1;border-color:rgb(31 41 55 / var(--tw-border-opacity, 1))}.border-green-600{--tw-border-opacity: 1;border-color:rgb(22 163 74 / var(--tw-border-opacity, 1))}.border-green-700{--tw-border-opacity: 1;border-color:rgb(21 128 61 / var(--tw-border-opacity, 1))}.border-input{border-color:hsl(var(--input))}.border-primary{border-color:hsl(var(--primary))}.border-purple-700{--tw-border-opacity: 1;border-color:rgb(126 34 206 / var(--tw-border-opacity, 1))}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.border-red-500\/40{border-color:#ef444466}.border-red-700{--tw-border-opacity: 1;border-color:rgb(185 28 28 / var(--tw-border-opacity, 1))}.border-red-800{--tw-border-opacity: 1;border-color:rgb(153 27 27 / var(--tw-border-opacity, 1))}.border-slate-600{--tw-border-opacity: 1;border-color:rgb(71 85 105 / var(--tw-border-opacity, 1))}.border-slate-700{--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-yellow-700{--tw-border-opacity: 1;border-color:rgb(161 98 7 / var(--tw-border-opacity, 1))}.bg-accent{background-color:hsl(var(--accent))}.bg-amber-400{--tw-bg-opacity: 1;background-color:rgb(251 191 36 / var(--tw-bg-opacity, 1))}.bg-amber-500{--tw-bg-opacity: 1;background-color:rgb(245 158 11 / var(--tw-bg-opacity, 1))}.bg-amber-500\/15{background-color:#f59e0b26}.bg-amber-500\/40{background-color:#f59e0b66}.bg-amber-600{--tw-bg-opacity: 1;background-color:rgb(217 119 6 / var(--tw-bg-opacity, 1))}.bg-amber-900\/40{background-color:#78350f66}.bg-amber-950\/40{background-color:#451a0366}.bg-background{background-color:hsl(var(--background))}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-black\/30{background-color:#0000004d}.bg-black\/70{background-color:#000000b3}.bg-black\/80{background-color:#000c}.bg-black\/95{background-color:#000000f2}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-blue-500\/20{background-color:#3b82f633}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.bg-blue-900\/20{background-color:#1e3a8a33}.bg-border{background-color:hsl(var(--border))}.bg-card{background-color:hsl(var(--card))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-emerald-400{--tw-bg-opacity: 1;background-color:rgb(52 211 153 / var(--tw-bg-opacity, 1))}.bg-emerald-900\/40{background-color:#064e3b66}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-500{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity, 1))}.bg-gray-500\/15{background-color:#6b728026}.bg-gray-600{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.bg-gray-700{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.bg-gray-800\/50{background-color:#1f293780}.bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.bg-gray-900\/60{background-color:#11182799}.bg-gray-900\/80{background-color:#111827cc}.bg-gray-950{--tw-bg-opacity: 1;background-color:rgb(3 7 18 / var(--tw-bg-opacity, 1))}.bg-green-400{--tw-bg-opacity: 1;background-color:rgb(74 222 128 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-green-500\/15{background-color:#22c55e26}.bg-green-500\/20{background-color:#22c55e33}.bg-green-600{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity, 1))}.bg-green-900\/20{background-color:#14532d33}.bg-green-900\/50{background-color:#14532d80}.bg-green-900\/70{background-color:#14532db3}.bg-muted{background-color:hsl(var(--muted))}.bg-orange-500{--tw-bg-opacity: 1;background-color:rgb(249 115 22 / var(--tw-bg-opacity, 1))}.bg-orange-500\/15{background-color:#f9731626}.bg-orange-500\/20{background-color:#f9731633}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-primary\/10{background-color:hsl(var(--primary) / .1)}.bg-purple-500{--tw-bg-opacity: 1;background-color:rgb(168 85 247 / var(--tw-bg-opacity, 1))}.bg-purple-900\/50{background-color:#581c8780}.bg-red-400{--tw-bg-opacity: 1;background-color:rgb(248 113 113 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-500\/15{background-color:#ef444426}.bg-red-500\/30{background-color:#ef44444d}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-red-900\/20{background-color:#7f1d1d33}.bg-red-900\/40{background-color:#7f1d1d66}.bg-red-900\/50{background-color:#7f1d1d80}.bg-red-900\/70{background-color:#7f1d1db3}.bg-secondary{background-color:hsl(var(--secondary))}.bg-slate-500{--tw-bg-opacity: 1;background-color:rgb(100 116 139 / var(--tw-bg-opacity, 1))}.bg-slate-600{--tw-bg-opacity: 1;background-color:rgb(71 85 105 / var(--tw-bg-opacity, 1))}.bg-slate-700{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity, 1))}.bg-slate-800{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1))}.bg-slate-800\/40{background-color:#1e293b66}.bg-slate-800\/50{background-color:#1e293b80}.bg-slate-800\/60{background-color:#1e293b99}.bg-slate-900{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.bg-slate-900\/50{background-color:#0f172a80}.bg-transparent{background-color:transparent}.bg-yellow-400{--tw-bg-opacity: 1;background-color:rgb(250 204 21 / var(--tw-bg-opacity, 1))}.bg-yellow-500{--tw-bg-opacity: 1;background-color:rgb(234 179 8 / var(--tw-bg-opacity, 1))}.bg-yellow-900\/50{background-color:#713f1280}.bg-zinc-900{--tw-bg-opacity: 1;background-color:rgb(24 24 27 / var(--tw-bg-opacity, 1))}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-blue-500{--tw-gradient-from: #3b82f6 var(--tw-gradient-from-position);--tw-gradient-to: rgb(59 130 246 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-gray-900{--tw-gradient-from: #111827 var(--tw-gradient-from-position);--tw-gradient-to: rgb(17 24 39 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-gray-800{--tw-gradient-to: #1f2937 var(--tw-gradient-to-position)}.to-sky-400{--tw-gradient-to: #38bdf8 var(--tw-gradient-to-position)}.fill-current{fill:currentColor}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-10{padding-left:2.5rem;padding-right:2.5rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-24{padding-top:6rem;padding-bottom:6rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-16{padding-bottom:4rem}.pb-2{padding-bottom:.5rem}.pl-1{padding-left:.25rem}.pl-2{padding-left:.5rem}.pl-8{padding-left:2rem}.pr-1{padding-right:.25rem}.pr-12{padding-right:3rem}.pr-2{padding-right:.5rem}.pr-8{padding-right:2rem}.pt-0{padding-top:0}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.pt-6{padding-top:1.5rem}.text-left{text-align:left}.text-center{text-align:center}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-5xl{font-size:3rem;line-height:1}.text-7xl{font-size:4.5rem;line-height:1}.text-\[10px\]{font-size:10px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-amber-100{--tw-text-opacity: 1;color:rgb(254 243 199 / var(--tw-text-opacity, 1))}.text-amber-200{--tw-text-opacity: 1;color:rgb(253 230 138 / var(--tw-text-opacity, 1))}.text-amber-200\/80{color:#fde68acc}.text-amber-300{--tw-text-opacity: 1;color:rgb(252 211 77 / var(--tw-text-opacity, 1))}.text-amber-400{--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.text-amber-400\/80{color:#fbbf24cc}.text-blue-400{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-card-foreground{color:hsl(var(--card-foreground))}.text-current{color:currentColor}.text-destructive{color:hsl(var(--destructive))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-emerald-200{--tw-text-opacity: 1;color:rgb(167 243 208 / var(--tw-text-opacity, 1))}.text-emerald-300{--tw-text-opacity: 1;color:rgb(110 231 183 / var(--tw-text-opacity, 1))}.text-foreground{color:hsl(var(--foreground))}.text-foreground\/50{color:hsl(var(--foreground) / .5)}.text-gray-200{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-green-200{--tw-text-opacity: 1;color:rgb(187 247 208 / var(--tw-text-opacity, 1))}.text-green-300{--tw-text-opacity: 1;color:rgb(134 239 172 / var(--tw-text-opacity, 1))}.text-green-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-orange-300{--tw-text-opacity: 1;color:rgb(253 186 116 / var(--tw-text-opacity, 1))}.text-orange-400{--tw-text-opacity: 1;color:rgb(251 146 60 / var(--tw-text-opacity, 1))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-purple-200{--tw-text-opacity: 1;color:rgb(233 213 255 / var(--tw-text-opacity, 1))}.text-purple-300{--tw-text-opacity: 1;color:rgb(216 180 254 / var(--tw-text-opacity, 1))}.text-purple-400{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.text-red-100{--tw-text-opacity: 1;color:rgb(254 226 226 / var(--tw-text-opacity, 1))}.text-red-200{--tw-text-opacity: 1;color:rgb(254 202 202 / var(--tw-text-opacity, 1))}.text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-sky-300{--tw-text-opacity: 1;color:rgb(125 211 252 / var(--tw-text-opacity, 1))}.text-sky-400{--tw-text-opacity: 1;color:rgb(56 189 248 / var(--tw-text-opacity, 1))}.text-slate-100{--tw-text-opacity: 1;color:rgb(241 245 249 / var(--tw-text-opacity, 1))}.text-slate-200{--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.text-slate-300{--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-teal-400{--tw-text-opacity: 1;color:rgb(45 212 191 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-white\/70{color:#ffffffb3}.text-yellow-200{--tw-text-opacity: 1;color:rgb(254 240 138 / var(--tw-text-opacity, 1))}.text-yellow-300{--tw-text-opacity: 1;color:rgb(253 224 71 / var(--tw-text-opacity, 1))}.text-zinc-500{--tw-text-opacity: 1;color:rgb(113 113 122 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.placeholder-gray-400::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}.placeholder-gray-400::placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-45{opacity:.45}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-90{opacity:.9}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-red-500\/30{--tw-shadow-color: rgb(239 68 68 / .3);--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.drop-shadow{--tw-drop-shadow: drop-shadow(0 1px 2px rgb(0 0 0 / .1)) drop-shadow(0 1px 1px rgb(0 0 0 / .06));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur{--tw-backdrop-blur: blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[width\]{transition-property:width;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-100{transition-duration:.1s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.duration-75{transition-duration:75ms}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in-0{--tw-enter-opacity: 0}.zoom-in-95{--tw-enter-scale: .95}.duration-100{animation-duration:.1s}.duration-200{animation-duration:.2s}.duration-300{animation-duration:.3s}.duration-500{animation-duration:.5s}.duration-75{animation-duration:75ms}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.running{animation-play-state:running}.\!paused{animation-play-state:paused!important}.paused{animation-play-state:paused}.\[appearance\:textfield\]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.file\:text-foreground::file-selector-button{color:hsl(var(--foreground))}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-slate-500::-moz-placeholder{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.placeholder\:text-slate-500::placeholder{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.hover\:border-blue-500:hover{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.hover\:border-gray-200:hover{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.hover\:border-gray-600:hover{--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1))}.hover\:border-red-400:hover{--tw-border-opacity: 1;border-color:rgb(248 113 113 / var(--tw-border-opacity, 1))}.hover\:border-slate-500:hover{--tw-border-opacity: 1;border-color:rgb(100 116 139 / var(--tw-border-opacity, 1))}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-amber-500\/20:hover{background-color:#f59e0b33}.hover\:bg-amber-700:hover{--tw-bg-opacity: 1;background-color:rgb(180 83 9 / var(--tw-bg-opacity, 1))}.hover\:bg-amber-900\/40:hover{background-color:#78350f66}.hover\:bg-blue-600:hover{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.hover\:bg-blue-700:hover{--tw-bg-opacity: 1;background-color:rgb(29 78 216 / var(--tw-bg-opacity, 1))}.hover\:bg-destructive\/80:hover{background-color:hsl(var(--destructive) / .8)}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-gray-500:hover{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-600:hover{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-700:hover{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-800:hover{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.hover\:bg-green-600:hover{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity, 1))}.hover\:bg-green-700:hover{--tw-bg-opacity: 1;background-color:rgb(21 128 61 / var(--tw-bg-opacity, 1))}.hover\:bg-orange-600:hover{--tw-bg-opacity: 1;background-color:rgb(234 88 12 / var(--tw-bg-opacity, 1))}.hover\:bg-primary\/80:hover{background-color:hsl(var(--primary) / .8)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-purple-600:hover{--tw-bg-opacity: 1;background-color:rgb(147 51 234 / var(--tw-bg-opacity, 1))}.hover\:bg-red-500\/10:hover{background-color:#ef44441a}.hover\:bg-red-500\/30:hover{background-color:#ef44444d}.hover\:bg-red-600:hover{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.hover\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity, 1))}.hover\:bg-red-900\/20:hover{background-color:#7f1d1d33}.hover\:bg-secondary:hover{background-color:hsl(var(--secondary))}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:bg-slate-600:hover{--tw-bg-opacity: 1;background-color:rgb(71 85 105 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-700:hover{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-700\/70:hover{background-color:#334155b3}.hover\:bg-slate-700\/80:hover{background-color:#334155cc}.hover\:bg-slate-800:hover{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-900:hover{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.hover\:bg-transparent:hover{background-color:transparent}.hover\:bg-yellow-600:hover{--tw-bg-opacity: 1;background-color:rgb(202 138 4 / var(--tw-bg-opacity, 1))}.hover\:bg-zinc-800:hover{--tw-bg-opacity: 1;background-color:rgb(39 39 42 / var(--tw-bg-opacity, 1))}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-amber-200:hover{--tw-text-opacity: 1;color:rgb(253 230 138 / var(--tw-text-opacity, 1))}.hover\:text-amber-50:hover{--tw-text-opacity: 1;color:rgb(255 251 235 / var(--tw-text-opacity, 1))}.hover\:text-blue-300:hover{--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.hover\:text-blue-400:hover{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.hover\:text-blue-700:hover{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.hover\:text-emerald-200:hover{--tw-text-opacity: 1;color:rgb(167 243 208 / var(--tw-text-opacity, 1))}.hover\:text-foreground:hover{color:hsl(var(--foreground))}.hover\:text-gray-200:hover{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.hover\:text-red-300:hover{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.hover\:text-yellow-200:hover{--tw-text-opacity: 1;color:rgb(254 240 138 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-lg:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-red-500\/40:hover{--tw-shadow-color: rgb(239 68 68 / .4);--tw-shadow: var(--tw-shadow-colored)}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:bg-gray-800:focus{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.focus\:bg-slate-700\/80:focus{background-color:#334155cc}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:text-red-300:focus{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.focus\:text-white:focus{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.focus\:opacity-100:focus{opacity:1}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--background))}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:text-gray-500:disabled{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.disabled\:hover\:bg-transparent:hover:disabled{background-color:transparent}.group:hover .group-hover\:text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.group:hover .group-hover\:opacity-100{opacity:1}.group.destructive .group-\[\.destructive\]\:border-muted\/40{border-color:hsl(var(--muted) / .4)}.group.toaster .group-\[\.toaster\]\:border-border{border-color:hsl(var(--border))}.group.toast .group-\[\.toast\]\:bg-muted{background-color:hsl(var(--muted))}.group.toast .group-\[\.toast\]\:bg-primary{background-color:hsl(var(--primary))}.group.toaster .group-\[\.toaster\]\:bg-background{background-color:hsl(var(--background))}.group.destructive .group-\[\.destructive\]\:text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.group.toast .group-\[\.toast\]\:text-muted-foreground{color:hsl(var(--muted-foreground))}.group.toast .group-\[\.toast\]\:text-primary-foreground{color:hsl(var(--primary-foreground))}.group.toaster .group-\[\.toaster\]\:text-foreground{color:hsl(var(--foreground))}.group.toaster .group-\[\.toaster\]\:shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.group.destructive .group-\[\.destructive\]\:hover\:border-destructive\/30:hover{border-color:hsl(var(--destructive) / .3)}.group.destructive .group-\[\.destructive\]\:hover\:bg-destructive:hover{background-color:hsl(var(--destructive))}.group.destructive .group-\[\.destructive\]\:hover\:text-destructive-foreground:hover{color:hsl(var(--destructive-foreground))}.group.destructive .group-\[\.destructive\]\:hover\:text-red-50:hover{--tw-text-opacity: 1;color:rgb(254 242 242 / var(--tw-text-opacity, 1))}.group.destructive .group-\[\.destructive\]\:focus\:ring-destructive:focus{--tw-ring-color: hsl(var(--destructive))}.group.destructive .group-\[\.destructive\]\:focus\:ring-red-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(248 113 113 / var(--tw-ring-opacity, 1))}.group.destructive .group-\[\.destructive\]\:focus\:ring-offset-red-600:focus{--tw-ring-offset-color: #dc2626}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.aria-selected\:bg-gray-700[aria-selected=true]{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.data-\[disabled\=true\]\:pointer-events-none[data-disabled=true],.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=checked\]\:translate-x-5[data-state=checked]{--tw-translate-x: 1.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked],.data-\[swipe\=cancel\]\:translate-x-0[data-swipe=cancel]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=end\]\:translate-x-\[var\(--radix-toast-swipe-end-x\)\][data-swipe=end]{--tw-translate-x: var(--radix-toast-swipe-end-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=move\]\:translate-x-\[var\(--radix-toast-swipe-move-x\)\][data-swipe=move]{--tw-translate-x: var(--radix-toast-swipe-move-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=checked\]\:border-red-500[data-state=checked]{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.data-\[selected\=\'true\'\]\:bg-accent[data-selected=true]{background-color:hsl(var(--accent))}.data-\[state\=checked\]\:bg-green-500[data-state=checked]{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:hsl(var(--primary))}.data-\[state\=checked\]\:bg-red-500[data-state=checked]{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\[state\=unchecked\]\:bg-input[data-state=unchecked]{background-color:hsl(var(--input))}.data-\[selected\=true\]\:text-accent-foreground[data-selected=true]{color:hsl(var(--accent-foreground))}.data-\[state\=checked\]\:text-primary-foreground[data-state=checked]{color:hsl(var(--primary-foreground))}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\[disabled\=true\]\:opacity-50[data-disabled=true],.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[swipe\=move\]\:transition-none[data-swipe=move]{transition-property:none}.data-\[state\=open\]\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\[state\=closed\]\:animate-out[data-state=closed],.data-\[swipe\=end\]\:animate-out[data-swipe=end]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\[state\=closed\]\:fade-out-80[data-state=closed]{--tw-exit-opacity: .8}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}.data-\[state\=closed\]\:slide-out-to-left-1\/2[data-state=closed]{--tw-exit-translate-x: -50%}.data-\[state\=closed\]\:slide-out-to-right-full[data-state=closed]{--tw-exit-translate-x: 100%}.data-\[state\=closed\]\:slide-out-to-top-\[48\%\][data-state=closed]{--tw-exit-translate-y: -48%}.data-\[state\=open\]\:slide-in-from-left-1\/2[data-state=open]{--tw-enter-translate-x: -50%}.data-\[state\=open\]\:slide-in-from-top-\[48\%\][data-state=open]{--tw-enter-translate-y: -48%}.data-\[state\=open\]\:slide-in-from-top-full[data-state=open]{--tw-enter-translate-y: -100%}.group[data-state=open] .group-data-\[state\=open\]\:rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-state=open] .group-data-\[state\=open\]\:rotate-90{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@supports ((-webkit-backdrop-filter: var(--tw)) or (backdrop-filter: var(--tw))){.supports-\[backdrop-filter\]\:bg-black\/70{background-color:#000000b3}}.dark\:border-destructive:is(.dark *){border-color:hsl(var(--destructive))}@media (min-width: 640px){.sm\:bottom-0{bottom:0}.sm\:right-0{right:0}.sm\:top-auto{top:auto}.sm\:mt-0{margin-top:0}.sm\:w-60{width:15rem}.sm\:w-auto{width:auto}.sm\:max-w-\[500px\]{max-width:500px}.sm\:max-w-\[600px\]{max-width:600px}.sm\:max-w-xl{max-width:36rem}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:flex-col{flex-direction:column}.sm\:justify-end{justify-content:flex-end}.sm\:gap-4{gap:1rem}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:self-auto{align-self:auto}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:p-4{padding:1rem}.sm\:p-6{padding:1.5rem}.sm\:text-left{text-align:left}.sm\:text-center{text-align:center}.sm\:text-base{font-size:1rem;line-height:1.5rem}.sm\:text-sm{font-size:.875rem;line-height:1.25rem}.data-\[state\=open\]\:sm\:slide-in-from-bottom-full[data-state=open]{--tw-enter-translate-y: 100%}}@media (min-width: 768px){.md\:max-w-\[420px\]{max-width:420px}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:text-sm{font-size:.875rem;line-height:1.25rem}}@media (min-width: 1024px){.lg\:min-h-0{min-height:0px}.lg\:w-1\/2{width:50%}.lg\:w-full{width:100%}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-\[1\.2fr_2fr\]{grid-template-columns:1.2fr 2fr}.lg\:flex-row{flex-direction:row}.lg\:space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.lg\:space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.lg\:p-8{padding:2rem}}.\[\&\:\:-webkit-inner-spin-button\]\:m-0::-webkit-inner-spin-button{margin:0}.\[\&\:\:-webkit-inner-spin-button\]\:appearance-none::-webkit-inner-spin-button{-webkit-appearance:none;-moz-appearance:none;appearance:none}.\[\&\:\:-webkit-outer-spin-button\]\:m-0::-webkit-outer-spin-button{margin:0}.\[\&\:\:-webkit-outer-spin-button\]\:appearance-none::-webkit-outer-spin-button{-webkit-appearance:none;-moz-appearance:none;appearance:none}.\[\&\>span\]\:line-clamp-1>span{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\[\&\>svg\+div\]\:translate-y-\[-3px\]>svg+div{--tw-translate-y: -3px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\>svg\]\:absolute>svg{position:absolute}.\[\&\>svg\]\:left-4>svg{left:1rem}.\[\&\>svg\]\:top-4>svg{top:1rem}.\[\&\>svg\]\:text-destructive>svg{color:hsl(var(--destructive))}.\[\&\>svg\]\:text-foreground>svg{color:hsl(var(--foreground))}.\[\&\>svg\~\*\]\:pl-7>svg~*{padding-left:1.75rem}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-top:.375rem;padding-bottom:.375rem}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:.75rem;line-height:1rem}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{font-weight:500}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:hsl(var(--muted-foreground))}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:1.25rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:1.25rem}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:3rem}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-top:.75rem;padding-bottom:.75rem}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:1.25rem}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:1.25rem}.\[\&_p\]\:leading-relaxed p{line-height:1.625}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:size-4 svg{width:1rem;height:1rem}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0} diff --git a/frontend/dist/index.html b/frontend/dist/index.html index b3018d5..5f65fc7 100644 --- a/frontend/dist/index.html +++ b/frontend/dist/index.html @@ -10,8 +10,8 @@ - - + + diff --git a/frontend/src/components/jobs/HubJobCard.tsx b/frontend/src/components/jobs/HubJobCard.tsx index 6f2a34d..0f96565 100644 --- a/frontend/src/components/jobs/HubJobCard.tsx +++ b/frontend/src/components/jobs/HubJobCard.tsx @@ -14,6 +14,8 @@ import { interface Props { job: HubJob; + onOpen?: (job: HubJob) => void; + busy?: boolean; } function relativeTime(iso: string | null): string { @@ -45,7 +47,7 @@ const stagePresentation: Record = { CANCELLED: { label: "Cancelled", color: "text-amber-400", Icon: AlertTriangle }, }; -const HubJobCard: React.FC = ({ job }) => { +const HubJobCard: React.FC = ({ job, onOpen, busy = false }) => { const stage = job.status?.stage?.toUpperCase() ?? ""; const present: StagePresentation = stagePresentation[stage] ?? { label: stage || "Unknown", @@ -55,34 +57,47 @@ const HubJobCard: React.FC = ({ job }) => { const Icon = present.Icon; const title = job.docker_image ?? job.space_id ?? `Job ${job.id.slice(0, 12)}โ€ฆ`; + const hasUrl = Boolean(job.url); + const canOpen = Boolean(onOpen || hasUrl); return ( window.open(job.url, "_blank", "noopener,noreferrer")} - className="bg-slate-800/50 border-slate-700 rounded-xl cursor-pointer hover:border-slate-500 transition-colors" + onClick={() => { + if (busy) return; + if (onOpen) { + onOpen(job); + return; + } + if (hasUrl) window.open(job.url, "_blank", "noopener,noreferrer"); + }} + className={`bg-slate-800/50 border-slate-700 rounded-xl hover:border-slate-500 transition-colors ${ + canOpen ? "cursor-pointer" : "" + }`} >
diff --git a/frontend/src/components/jobs/JobsSection.tsx b/frontend/src/components/jobs/JobsSection.tsx index 1ae635b..f8f2969 100644 --- a/frontend/src/components/jobs/JobsSection.tsx +++ b/frontend/src/components/jobs/JobsSection.tsx @@ -1,4 +1,5 @@ import React, { useCallback, useEffect, useMemo, useState } from "react"; +import { useNavigate } from "react-router-dom"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { useApi } from "@/contexts/ApiContext"; @@ -9,6 +10,7 @@ import { HubModel, JobProgressSnapshot, JobRecord, + attachProviderJob, deleteJob, listHubJobs, listJobs, @@ -42,6 +44,7 @@ const isHubJobActive = (h: HubJob) => const JobsSection: React.FC = () => { const { baseUrl, fetchWithHeaders } = useApi(); const { toast } = useToast(); + const navigate = useNavigate(); const [jobs, setJobs] = useState([]); const [hubJobs, setHubJobs] = useState([]); @@ -49,6 +52,7 @@ const JobsSection: React.FC = () => { const [hubAuthenticated, setHubAuthenticated] = useState(false); const [error, setError] = useState(null); const [search, setSearch] = useState(""); + const [attachingJobId, setAttachingJobId] = useState(null); const { selectedRecord } = useRobots(); const [inferenceModalOpen, setInferenceModalOpen] = useState(false); @@ -148,6 +152,30 @@ const JobsSection: React.FC = () => { } }; + const handleHubJobOpen = async (job: HubJob) => { + if (job.provider !== "seeed_cloud") { + if (job.url) window.open(job.url, "_blank", "noopener,noreferrer"); + return; + } + try { + setAttachingJobId(job.id); + const record = await attachProviderJob(baseUrl, fetchWithHeaders, "seeed_cloud", job.id); + setJobs((prev) => { + if (prev.some((item) => item.id === record.id)) return prev; + return [record, ...prev]; + }); + navigate(`/training/${record.id}`); + } catch (e) { + toast({ + title: "Attach failed", + description: e instanceof Error ? e.message : String(e), + variant: "destructive", + }); + } finally { + setAttachingJobId(null); + } + }; + const query = search.trim().toLowerCase(); const matchesQuery = useCallback( (text: string | null | undefined) => @@ -176,7 +204,7 @@ const JobsSection: React.FC = () => { [filteredJobs], ); const trackedCloudJobs = useMemo( - () => filteredJobs.filter((j) => j.runner === "hf_cloud"), + () => filteredJobs.filter((j) => j.runner === "hf_cloud" || j.runner === "seeed_cloud"), [filteredJobs], ); const importedJobs = useMemo( @@ -195,8 +223,17 @@ const JobsSection: React.FC = () => { [trackedCloudJobs], ); const untrackedHubJobs = useMemo( - () => filteredHubJobs.filter((h) => !trackedHfJobIds.has(h.id)), - [filteredHubJobs, trackedHfJobIds], + () => + filteredHubJobs.filter((h) => { + if (h.provider === "hf_cloud") return !trackedHfJobIds.has(h.id); + if (h.provider === "seeed_cloud") { + return !trackedCloudJobs.some( + (j) => j.external_provider === "seeed_cloud" && j.external_job_id === h.id, + ); + } + return true; + }), + [filteredHubJobs, trackedCloudJobs, trackedHfJobIds], ); // Hide model repos that map 1-to-1 to a tracked cloud job (those already // appear via JobCard); the remainder are past trainings the registry no @@ -369,7 +406,12 @@ const JobsSection: React.FC = () => { /> ))} {untrackedHubActive.map((job) => ( - + ))} {untrackedHubModels.map((model) => ( @@ -406,7 +448,12 @@ const JobsSection: React.FC = () => { /> ))} {untrackedHubInactive.map((job) => ( - + ))}
diff --git a/frontend/src/components/training/ConfigurationTab.tsx b/frontend/src/components/training/ConfigurationTab.tsx index 8106bb7..b9489c3 100644 --- a/frontend/src/components/training/ConfigurationTab.tsx +++ b/frontend/src/components/training/ConfigurationTab.tsx @@ -4,14 +4,17 @@ import AdvancedCard from './config/AdvancedCard'; import TargetCard from './config/TargetCard'; import { ConfigComponentProps } from './types'; import { DatasetItem } from '@/lib/replayApi'; -import { RunnerFlavor } from '@/lib/jobsApi'; +import { RunnerFlavor, RunnerProvider } from '@/lib/jobsApi'; interface ConfigurationTabProps extends ConfigComponentProps { datasets: DatasetItem[]; datasetsLoading: boolean; authenticated: boolean; flavors: RunnerFlavor[]; + providers: RunnerProvider[]; hardwareLoading: boolean; + seeedConnecting: boolean; + onConnectSeeedCloud: () => void; } const ConfigurationTab: React.FC = ({ @@ -21,7 +24,10 @@ const ConfigurationTab: React.FC = ({ datasetsLoading, authenticated, flavors, + providers, hardwareLoading, + seeedConnecting, + onConnectSeeedCloud, }) => { return (
@@ -30,7 +36,10 @@ const ConfigurationTab: React.FC = ({ updateConfig={updateConfig} authenticated={authenticated} flavors={flavors} + providers={providers} loading={hardwareLoading} + seeedConnecting={seeedConnecting} + onConnectSeeedCloud={onConnectSeeedCloud} /> = ({ config, updateConfig, d const { baseUrl, fetchWithHeaders } = useApi(); const [wandbDialogOpen, setWandbDialogOpen] = useState(false); const [wandbInstallHint, setWandbInstallHint] = useState('pip install wandb'); + const isExternalTarget = config.target.runner === 'seeed_cloud' || config.target.runner === 'external'; const handleWandbToggle = async (checked: boolean) => { if (!checked) { @@ -71,7 +72,9 @@ const EssentialsCard: React.FC = ({ config, updateConfig, d />

- HuggingFace Hub dataset repository ID + {isExternalTarget + ? 'LeLab dataset repository ID; Seeed Cloud also accepts an archive URL or SEEED_CLOUD_DATASET_URL override' + : 'HuggingFace Hub dataset repository ID'}

diff --git a/frontend/src/components/training/config/TargetCard.tsx b/frontend/src/components/training/config/TargetCard.tsx index 9da59f0..7376994 100644 --- a/frontend/src/components/training/config/TargetCard.tsx +++ b/frontend/src/components/training/config/TargetCard.tsx @@ -1,20 +1,26 @@ -import React from "react"; +import React, { useMemo, useState } from "react"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Label } from "@/components/ui/label"; +import { Button } from "@/components/ui/button"; +import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover"; import { - Select, - SelectContent, - SelectItem, - SelectTrigger, - SelectValue, -} from "@/components/ui/select"; + Collapsible, + CollapsibleContent, + CollapsibleTrigger, +} from "@/components/ui/collapsible"; +import { Badge } from "@/components/ui/badge"; import { ConfigComponentProps } from "../types"; -import { RunnerFlavor } from "@/lib/jobsApi"; +import { RunnerFlavor, RunnerProvider } from "@/lib/jobsApi"; +import { Check, ChevronDown, ChevronRight, Loader2, Link } from "lucide-react"; +import { cn } from "@/lib/utils"; interface TargetCardProps extends ConfigComponentProps { authenticated: boolean; flavors: RunnerFlavor[]; + providers: RunnerProvider[]; loading: boolean; + seeedConnecting: boolean; + onConnectSeeedCloud: () => void; } const formatHourly = (unitCostUsd: number, unitLabel: string): string => { @@ -22,21 +28,85 @@ const formatHourly = (unitCostUsd: number, unitLabel: string): string => { return `$${hourly.toFixed(2)}/hr`; }; -const formatFlavorLine = (f: RunnerFlavor): string => { - const accel = f.accelerator ? f.accelerator : f.cpu; - return `${f.pretty_name} ยท ${accel} ยท ${formatHourly(f.unit_cost_usd, f.unit_label)}`; +const acceleratorParts = (f: RunnerFlavor) => { + const accelerator = f.accelerator; + if (!accelerator) { + return { manufacturer: "", model: f.cpu || f.pretty_name || f.name }; + } + if (typeof accelerator === "string") { + return { + manufacturer: /nvidia/i.test(accelerator) ? "" : "Nvidia", + model: accelerator, + }; + } + const quantity = String(accelerator.quantity ?? "").trim(); + const prefix = quantity && quantity !== "1" ? `${quantity}x ` : ""; + return { + manufacturer: accelerator.manufacturer || "", + model: `${prefix}${accelerator.model || f.pretty_name || f.name}`, + }; +}; + +const formatHardwareName = (f: RunnerFlavor): string => { + const { manufacturer, model } = acceleratorParts(f); + return [manufacturer, model].filter(Boolean).join(" "); +}; + +const formatProviderFlavor = (providerLabel: string, f: RunnerFlavor): string => { + return `${providerLabel} ${formatHardwareName(f)} - ${formatHourly( + f.unit_cost_usd, + f.unit_label, + )}`; }; +const formatFlavorMeta = (f: RunnerFlavor): string => { + const parts = [f.cpu, f.ram].filter(Boolean); + return parts.length > 0 ? parts.join(" ยท ") : f.pretty_name; +}; + +const SEEED_PROVIDER_ID = "seeed_cloud"; + const TargetCard: React.FC = ({ config, updateConfig, authenticated, flavors, + providers, loading, + seeedConnecting, + onConnectSeeedCloud, }) => { const target = config.target; - const value = - target.runner === "local" ? "local" : `hf:${target.flavor ?? ""}`; + const [open, setOpen] = useState(false); + const [hfOpen, setHfOpen] = useState(true); + const [providerOpen, setProviderOpen] = useState>({ + [SEEED_PROVIDER_ID]: true, + }); + const safeProviders = useMemo(() => providers ?? [], [providers]); + const safeFlavors = useMemo(() => flavors ?? [], [flavors]); + const seeedProvider = safeProviders.find((provider) => provider.id === SEEED_PROVIDER_ID); + const providerGroups = safeProviders.map((provider) => ({ + ...provider, + open: providerOpen[provider.id] ?? provider.id === SEEED_PROVIDER_ID, + label: provider.id === SEEED_PROVIDER_ID ? "Seeed Cloud" : provider.display_name, + })); + + const selectedLabel = useMemo(() => { + if (target.runner === "local") return "Local - your machine"; + if (target.runner === "hf_cloud") { + const flavor = safeFlavors.find((f) => f.name === target.flavor); + return flavor ? formatProviderFlavor("HF", flavor) : "Hugging Face"; + } + if (target.runner === "seeed_cloud") { + const flavor = seeedProvider?.flavors.find((f) => f.name === target.flavor); + return flavor ? formatProviderFlavor("Seeed", flavor) : "Seeed Cloud"; + } + const provider = safeProviders.find((p) => p.id === target.provider); + const flavor = provider?.flavors.find((f) => f.name === target.flavor); + return flavor + ? formatProviderFlavor(provider?.display_name ?? "External", flavor) + : provider?.display_name ?? "External"; + }, [safeFlavors, safeProviders, seeedProvider, target]); const handleChange = (v: string) => { if (v === "local") { @@ -44,7 +114,56 @@ const TargetCard: React.FC = ({ } else if (v.startsWith("hf:")) { const flavor = v.slice("hf:".length); updateConfig("target", { runner: "hf_cloud", flavor }); + } else if (v.startsWith("seeed:")) { + const flavor = v.slice("seeed:".length); + updateConfig("target", { runner: "seeed_cloud", flavor }); + } else if (v.startsWith("external:")) { + const [, provider, flavor] = v.split(":"); + updateConfig("target", { runner: "external", provider, flavor }); } + setOpen(false); + }; + + const selectedValue = target.runner === "local" + ? "local" + : target.runner === "hf_cloud" + ? `hf:${target.flavor ?? ""}` + : target.runner === "seeed_cloud" + ? `seeed:${target.flavor ?? ""}` + : `external:${target.provider}:${target.flavor ?? ""}`; + + const renderOption = ( + value: string, + label: string, + meta: string, + disabled: boolean, + ) => ( + + ); + + const setProviderExpanded = (providerId: string, nextOpen: boolean) => { + setProviderOpen((prev) => ({ ...prev, [providerId]: nextOpen })); }; return ( @@ -55,28 +174,123 @@ const TargetCard: React.FC = ({
- + + + + + +
+ {renderOption("local", "Local - your machine", "Free", false)} + + + + {hfOpen ? ( + + ) : ( + + )} + Hugging Face + + {authenticated ? `${safeFlavors.length} flavors` : "Login required"} + + + + {authenticated && safeFlavors.length > 0 ? ( + safeFlavors.map((f) => + renderOption( + `hf:${f.name}`, + formatProviderFlavor("HF", f), + formatFlavorMeta(f), + false, + ), + ) + ) : ( +
+ {authenticated ? "No HF hardware flavors available." : "Log in to HF to unlock official flavors."} +
+ )} +
+
+ + {providerGroups.map((provider) => ( + setProviderExpanded(provider.id, nextOpen)} + > + + {provider.open ? ( + + ) : ( + + )} + {provider.label} + + {provider.authenticated + ? `Connected ยท ${provider.flavors.length} flavors` + : "Connect required"} + + + + {!provider.authenticated && provider.id === SEEED_PROVIDER_ID ? ( +
+ Connect to unlock Seeed Cloud flavors. + +
+ ) : null} + {provider.flavors.length > 0 ? ( + provider.flavors.map((f) => { + const prefix = provider.id === SEEED_PROVIDER_ID ? "Seeed" : provider.display_name; + const value = + provider.id === SEEED_PROVIDER_ID + ? `seeed:${f.name}` + : `external:${provider.id}:${f.name}`; + return renderOption( + value, + formatProviderFlavor(prefix, f), + formatFlavorMeta(f), + !provider.authenticated, + ); + }) + ) : ( +
No flavors available.
+ )} +
+
+ ))} +
+
+

Cost shown is per running hour. Final policy uploads to your HF account when training completes. diff --git a/frontend/src/components/training/types.ts b/frontend/src/components/training/types.ts index d0ee5f4..03114a2 100644 --- a/frontend/src/components/training/types.ts +++ b/frontend/src/components/training/types.ts @@ -1,5 +1,7 @@ +import { RunnerTarget } from "@/lib/jobsApi"; + export interface TrainingConfig { - target: { runner: "local" | "hf_cloud"; flavor?: string }; + target: RunnerTarget; // Dataset configuration dataset_repo_id: string; diff --git a/frontend/src/contexts/ApiContext.tsx b/frontend/src/contexts/ApiContext.tsx index 824f02a..62ebc27 100644 --- a/frontend/src/contexts/ApiContext.tsx +++ b/frontend/src/contexts/ApiContext.tsx @@ -9,10 +9,18 @@ interface ApiContextType { const ApiContext = createContext(undefined); const STORAGE_KEY = "lelab.apiBaseUrl"; -const DEFAULT_LOCALHOST = "http://localhost:8000"; +const DEFAULT_LOCALHOST = + import.meta.env.VITE_LELAB_API_BASE_URL || "http://127.0.0.1:8000"; const httpToWs = (url: string): string => url.replace(/^http(s?):/, "ws$1:"); +const LEGACY_LOCALHOST = new Set([ + "http://localhost:8001", + "http://127.0.0.1:8001", + "http://localhost:8000", + "http://127.0.0.1:8000", +]); + const resolveInitialBaseUrl = (): string => { if (typeof window === "undefined") return DEFAULT_LOCALHOST; @@ -28,7 +36,10 @@ const resolveInitialBaseUrl = (): string => { } } - return window.localStorage.getItem(STORAGE_KEY) || DEFAULT_LOCALHOST; + const stored = window.localStorage.getItem(STORAGE_KEY); + if (stored && !LEGACY_LOCALHOST.has(stored)) return stored; + if (stored) window.localStorage.setItem(STORAGE_KEY, DEFAULT_LOCALHOST); + return DEFAULT_LOCALHOST; }; export const ApiProvider: React.FC<{ children: ReactNode }> = ({ diff --git a/frontend/src/lib/checkpointsApi.ts b/frontend/src/lib/checkpointsApi.ts index 226591e..ed72629 100644 --- a/frontend/src/lib/checkpointsApi.ts +++ b/frontend/src/lib/checkpointsApi.ts @@ -2,7 +2,7 @@ import { Fetcher, apiRequest } from "./apiClient"; export interface JobCheckpoint { step: number; - source: "local" | "hub"; + source: "local" | "hub" | "external"; ref: string; } diff --git a/frontend/src/lib/jobsApi.ts b/frontend/src/lib/jobsApi.ts index 088b727..0b6088b 100644 --- a/frontend/src/lib/jobsApi.ts +++ b/frontend/src/lib/jobsApi.ts @@ -1,6 +1,11 @@ import { ApiError, Fetcher, apiRequest } from "./apiClient"; export type JobState = "running" | "done" | "failed" | "interrupted"; +export type RunnerTarget = + | { runner: "local" } + | { runner: "hf_cloud"; flavor?: string } + | { runner: "seeed_cloud"; flavor?: string } + | { runner: "external"; provider: string; flavor?: string }; export interface TrainingMetrics { current_step: number; @@ -50,7 +55,7 @@ export interface TrainingRequest { optimizer_grad_clip_norm?: number; use_policy_training_preset: boolean; // Optional target for runner dispatch; omitted โ‡’ local. - target?: { runner: "local" | "hf_cloud"; flavor?: string }; + target?: RunnerTarget; } export interface JobRecord { @@ -64,11 +69,15 @@ export interface JobRecord { exit_code: number | null; error_message: string | null; metrics: TrainingMetrics; - runner: "local" | "hf_cloud" | "imported"; + runner: "local" | "hf_cloud" | "imported" | "seeed_cloud" | "external"; hf_job_id: string | null; hf_flavor: string | null; hf_repo_id: string | null; hf_job_url: string | null; + external_provider: string | null; + external_flavor: string | null; + external_job_id: string | null; + external_job_url: string | null; wandb_run_url: string | null; checkpoint_count: number; } @@ -200,6 +209,23 @@ export async function stopJob( }); } +export async function attachProviderJob( + baseUrl: string, + fetcher: Fetcher, + providerId: string, + remoteJobId: string, +): Promise { + return apiRequest( + baseUrl, + fetcher, + `/jobs/providers/${encodeURIComponent(providerId)}/jobs/${encodeURIComponent(remoteJobId)}/attach`, + { + method: "POST", + action: "Attach provider job", + }, + ); +} + export async function deleteJob( baseUrl: string, fetcher: Fetcher, @@ -262,6 +288,7 @@ export interface HubJob { status: { stage: string; message: string | null } | null; owner: string | null; url: string; + provider: string; } export interface HubModel { diff --git a/frontend/src/pages/Recording.tsx b/frontend/src/pages/Recording.tsx index 840da85..593e9f0 100644 --- a/frontend/src/pages/Recording.tsx +++ b/frontend/src/pages/Recording.tsx @@ -54,7 +54,7 @@ interface RecordingConfig { streaming_encoding: boolean; } -type Phase = "preparing" | "recording" | "resetting" | "completed"; +type Phase = "preparing" | "recording" | "resetting" | "stopping" | "completed" | "error"; interface BackendStatus { recording_active: boolean; @@ -67,6 +67,7 @@ interface BackendStatus { session_elapsed_seconds?: number; session_ended?: boolean; dataset_repo_id?: string; + error?: string; available_controls: { stop_recording: boolean; exit_early: boolean; @@ -96,6 +97,7 @@ const Recording = () => { // Bumps on each re-record so the auto-advance warning re-fires for the same episode number. const [rerecordTick, setRerecordTick] = useState(0); const warningFiredForPhaseRef = useRef<{ phase: Phase | null; episode: number | null; tick: number }>({ phase: null, episode: null, tick: 0 }); + const errorHandledRef = useRef(false); // Guards against React StrictMode double-invocation of the start effect. const startInitiatedRef = useRef(false); @@ -186,6 +188,19 @@ const Recording = () => { warningFiredForPhaseRef.current = { phase: real, episode: ep, tick }; } + if (!status.recording_active && status.session_ended && status.current_phase === "error") { + if (!errorHandledRef.current) { + errorHandledRef.current = true; + setRecordingSessionStarted(false); + toast({ + title: "Recording failed", + description: status.error || status.message || "Check the robot connection and try again.", + variant: "destructive", + }); + } + return; + } + if (!status.recording_active && status.session_ended) { const datasetInfo = { dataset_repo_id: @@ -225,6 +240,7 @@ const Recording = () => { const data = await response.json(); if (response.ok) { + errorHandledRef.current = false; setRecordingSessionStarted(true); toast({ title: "Recording Started", @@ -437,6 +453,8 @@ const Recording = () => { if (currentPhase === "recording") return `RECORDING EPISODE ${currentEpisode}`; if (currentPhase === "resetting") return "RESET โ€” GET READY"; if (currentPhase === "preparing") return "PREPARING SESSION"; + if (currentPhase === "stopping") return "STOPPING RECORDING"; + if (currentPhase === "error") return "RECORDING ERROR"; return "SESSION COMPLETE"; }; @@ -452,9 +470,18 @@ const Recording = () => { ? "End Episode" : currentPhase === "resetting" ? "Start Next Episode" + : currentPhase === "stopping" + ? "Stopping..." + : currentPhase === "error" + ? "Recording failed" : "Advance"; const PrimaryIcon = currentPhase === "recording" ? SkipForward : Play; + const canAdvance = + backendStatus.available_controls.exit_early && + optimisticPhase === null && + (currentPhase === "recording" || currentPhase === "resetting"); + const progressPercent = phaseTimeLimit > 0 ? Math.min((phaseElapsedTime / phaseTimeLimit) * 100, 100) : 0; return (

@@ -547,23 +574,19 @@ const Recording = () => {
diff --git a/frontend/src/pages/Training.tsx b/frontend/src/pages/Training.tsx index bc618a0..b4a5654 100644 --- a/frontend/src/pages/Training.tsx +++ b/frontend/src/pages/Training.tsx @@ -28,7 +28,10 @@ import { stopJob, deleteJob, listRunnerHardware, + getSeeedCloudConfig, + saveSeeedCloudConfig, RunnerFlavor, + RunnerProvider, } from "@/lib/jobsApi"; import { JobCheckpoint, listJobCheckpoints } from "@/lib/checkpointsApi"; import CheckpointDropdown from "@/components/jobs/CheckpointDropdown"; @@ -133,7 +136,10 @@ const ConfigurationMode: React.FC = () => { const [isStarting, setIsStarting] = useState(false); const [authenticated, setAuthenticated] = useState(false); const [flavors, setFlavors] = useState([]); + const [providers, setProviders] = useState([]); const [hardwareLoading, setHardwareLoading] = useState(true); + const [seeedConnectUrl, setSeeedConnectUrl] = useState("https://sensecraft-gpu.seeed.cc/lelab/connect"); + const [seeedConnecting, setSeeedConnecting] = useState(false); useEffect(() => { setDatasetsLoading(true); @@ -173,15 +179,26 @@ const ConfigurationMode: React.FC = () => { listRunnerHardware(baseUrl, fetchWithHeaders) .then((data) => { setAuthenticated(data.authenticated); - setFlavors(data.flavors); + setFlavors(data.flavors ?? []); + setProviders(data.providers ?? []); }) .catch(() => { setAuthenticated(false); setFlavors([]); + setProviders([]); }) .finally(() => setHardwareLoading(false)); }, [baseUrl, fetchWithHeaders, auth.status]); + useEffect(() => { + getSeeedCloudConfig(baseUrl, fetchWithHeaders) + .then((cfg) => { + const webUrl = cfg.web_url || "https://sensecraft-gpu.seeed.cc"; + setSeeedConnectUrl(`${webUrl.replace(/\/$/, "")}/lelab/connect`); + }) + .catch(() => setSeeedConnectUrl("https://sensecraft-gpu.seeed.cc/lelab/connect")); + }, [baseUrl, fetchWithHeaders]); + const updateConfig = (key: T, value: TrainingConfig[T]) => { setTrainingConfig((prev) => ({ ...prev, [key]: value })); }; @@ -212,6 +229,67 @@ const ConfigurationMode: React.FC = () => { } }; + const handleConnectSeeedCloud = () => { + setSeeedConnecting(true); + const popup = window.open(seeedConnectUrl, "lelab-seeed-cloud", "width=520,height=720"); + if (!popup) { + setSeeedConnecting(false); + toast({ + title: "Seeed Cloud", + description: "Browser blocked the connection window.", + variant: "destructive", + }); + return; + } + + const timeout = window.setTimeout(() => { + window.removeEventListener("message", onMessage); + setSeeedConnecting(false); + }, 120000); + + const finish = async (token: string, apiUrl?: string, webUrl?: string) => { + try { + await saveSeeedCloudConfig(baseUrl, fetchWithHeaders, { + token, + api_url: apiUrl, + web_url: webUrl, + }); + const hardware = await listRunnerHardware(baseUrl, fetchWithHeaders); + setAuthenticated(hardware.authenticated); + setFlavors(hardware.flavors ?? []); + setProviders(hardware.providers ?? []); + toast({ title: "Seeed Cloud connected", description: "GPU flavors are available now." }); + } catch (e) { + const msg = e instanceof Error ? e.message : String(e); + toast({ title: "Seeed Cloud", description: msg, variant: "destructive" }); + } finally { + window.clearTimeout(timeout); + window.removeEventListener("message", onMessage); + setSeeedConnecting(false); + popup.close(); + } + }; + + function onMessage(event: MessageEvent) { + const expectedOrigin = new URL(seeedConnectUrl).origin; + if (event.origin !== expectedOrigin) { + return; + } + const data = event.data as { + type?: string; + token?: string; + apiUrl?: string; + webUrl?: string; + }; + if (data?.type !== "seeed-cloud-token" || !data.token) { + return; + } + finish(data.token, data.apiUrl, data.webUrl); + } + + window.addEventListener("message", onMessage); + }; + if (trainingExtraAvailable === null) { return (
@@ -239,7 +317,10 @@ const ConfigurationMode: React.FC = () => { const targetRequiresAuth = trainingConfig.target.runner === "hf_cloud"; const targetMissingFlavor = - trainingConfig.target.runner === "hf_cloud" && !trainingConfig.target.flavor; + (trainingConfig.target.runner === "hf_cloud" || + trainingConfig.target.runner === "seeed_cloud" || + trainingConfig.target.runner === "external") && + !trainingConfig.target.flavor; const localBlocked = trainingConfig.target.runner === "local" && localJobRunning; const startDisabled = @@ -268,7 +349,10 @@ const ConfigurationMode: React.FC = () => { datasetsLoading={datasetsLoading} authenticated={authenticated} flavors={flavors} + providers={providers} hardwareLoading={hardwareLoading} + seeedConnecting={seeedConnecting} + onConnectSeeedCloud={handleConnectSeeedCloud} />
{(() => { @@ -512,6 +596,11 @@ const MonitoringMode: React.FC<{ jobId: string }> = ({ jobId }) => { HF ยท {job.hf_flavor ?? "cloud"} + ) : job.runner === "seeed_cloud" || job.runner === "external" ? ( + + {job.runner === "seeed_cloud" ? "Seeed" : job.external_provider ?? "External"} ยท{" "} + {job.external_flavor ?? "GPU"} + ) : ( Local @@ -527,6 +616,16 @@ const MonitoringMode: React.FC<{ jobId: string }> = ({ jobId }) => { View on Hub โ†— )} + {(job.runner === "seeed_cloud" || job.runner === "external") && job.external_job_url && ( + + View provider job โ†— + + )} {job.wandb_run_url && ( bool: ... + def list_flavors(self) -> list[dict]: ... + def create_runner(self, metrics, log_file_path: Path, target): ... + + +def discover_compute_providers() -> list[ComputeProvider]: + providers: list[ComputeProvider] = [] + providers.extend(_load_env_provider_modules()) + providers.extend(_load_entry_point_providers()) + return _dedupe_providers(providers) + + +def get_compute_provider(provider_id: str) -> ComputeProvider | None: + for provider in discover_compute_providers(): + if provider.id == provider_id: + return provider + return None + + +def _load_env_provider_modules() -> list[ComputeProvider]: + raw = os.environ.get(ENV_PROVIDER_MODULES, "").strip() + if not raw: + return [] + providers: list[ComputeProvider] = [] + for spec in [part.strip() for part in raw.split(",") if part.strip()]: + try: + providers.append(_load_provider_object(spec)) + except Exception as exc: + logger.warning("Failed to load compute provider %s: %s", spec, exc) + return providers + + +def _load_entry_point_providers() -> list[ComputeProvider]: + providers: list[ComputeProvider] = [] + try: + entry_points = importlib.metadata.entry_points() + if hasattr(entry_points, "select"): + selected = entry_points.select(group=ENTRY_POINT_GROUP) + else: + selected = entry_points.get(ENTRY_POINT_GROUP, []) + except Exception as exc: + logger.warning("Failed to inspect compute provider entry points: %s", exc) + return [] + for entry_point in selected: + try: + providers.append(_instantiate(entry_point.load())) + except Exception as exc: + logger.warning("Failed to load compute provider entry point %s: %s", entry_point.name, exc) + return providers + + +def _load_provider_object(spec: str) -> ComputeProvider: + module_name, sep, attr = spec.partition(":") + if not sep or not module_name or not attr: + raise ValueError(f"Expected module:attribute, got {spec!r}") + module = importlib.import_module(module_name) + return _instantiate(getattr(module, attr)) + + +def _instantiate(obj) -> ComputeProvider: + if isinstance(obj, type): + return obj() + candidate = obj() + return candidate + + +def _dedupe_providers(providers: list[ComputeProvider]) -> list[ComputeProvider]: + seen: set[str] = set() + out: list[ComputeProvider] = [] + for provider in providers: + provider_id = getattr(provider, "id", "") + if not provider_id or provider_id in seen: + continue + seen.add(provider_id) + out.append(provider) + return out diff --git a/lelab/jobs.py b/lelab/jobs.py index cf6706a..a913766 100644 --- a/lelab/jobs.py +++ b/lelab/jobs.py @@ -28,8 +28,10 @@ import signal import subprocess import sys +import tarfile import threading import time +import urllib.parse from collections.abc import Callable from datetime import datetime from pathlib import Path @@ -44,16 +46,43 @@ JobState = Literal["running", "done", "failed", "interrupted"] +SEEED_CLOUD_PROVIDER_ID = "seeed_cloud" class JobTarget(BaseModel): """Where a job should run. `local` โ‡’ LocalJobRunner. `hf_cloud` requires - a non-empty `flavor` from HfApi.list_jobs_hardware().""" + a non-empty `flavor` from HfApi.list_jobs_hardware(). `seeed_cloud` is the + Seeed-maintained external compute provider. `external` keeps the generic + provider extension hook available without exposing it as the common path.""" - runner: Literal["local", "hf_cloud"] = "local" + runner: Literal["local", "hf_cloud", "seeed_cloud", "external"] = "local" + provider: str | None = None flavor: str | None = None +def _target_provider_id(target: JobTarget) -> str | None: + if target.runner == "seeed_cloud": + return SEEED_CLOUD_PROVIDER_ID + if target.runner == "external": + return target.provider + return None + + +_EXTERNAL_RUNNING_STATUSES = { + "QUEUED", + "INSTANCE_CREATING", + "DATASET_PREPARING", + "INSTANCE_READY", + "TRAINING_STARTING", + "TRAINING_RUNNING", + "ARTIFACT_UPLOADING", + "RUNNING", + "SCHEDULING", +} +_EXTERNAL_SUCCESS_STATUSES = {"SUCCEEDED", "COMPLETED", "DONE"} +_EXTERNAL_FAILED_STATUSES = {"FAILED", "CANCELLED", "CANCELED"} + + class TrainingMetrics(BaseModel): current_step: int = 0 total_steps: int = 0 @@ -79,7 +108,7 @@ class JobRecord(BaseModel): exit_code: int | None = None error_message: str | None = None metrics: TrainingMetrics = TrainingMetrics() - runner: Literal["local", "hf_cloud", "imported"] = "local" + runner: Literal["local", "hf_cloud", "imported", "seeed_cloud", "external"] = "local" # PID of the detached subprocess (local runner only); survives uvicorn # --reload so a fresh registry can re-attach by tailing the log file. process_pid: int | None = None @@ -88,6 +117,11 @@ class JobRecord(BaseModel): hf_flavor: str | None = None hf_repo_id: str | None = None hf_job_url: str | None = None + # External compute provider identifiers (external runner only). + external_provider: str | None = None + external_flavor: str | None = None + external_job_id: str | None = None + external_job_url: str | None = None # Captured from training stdout the first time wandb prints the run URL. wandb_run_url: str | None = None # Number of checkpoints currently visible (local: filesystem; cloud: @@ -103,7 +137,7 @@ class JobCheckpoint(BaseModel): snapshot_download for hub refs).""" step: int - source: Literal["local", "hub"] + source: Literal["local", "hub", "external"] ref: str @@ -170,6 +204,59 @@ def _parse_duration(s: str) -> float | None: return None +def _external_job_state(status: str) -> JobState: + normalized = (status or "").upper() + if normalized in _EXTERNAL_SUCCESS_STATUSES: + return "done" + if normalized in _EXTERNAL_FAILED_STATUSES: + return "failed" + if normalized in _EXTERNAL_RUNNING_STATUSES: + return "running" + return "running" + + +def _training_request_from_external_job(job) -> TrainingRequest: + raw_config = getattr(job, "training_config", None) + config = dict(raw_config) if isinstance(raw_config, dict) else {} + config.setdefault("dataset_repo_id", f"seeed-cloud/{getattr(job, 'id', 'remote-job')}") + if getattr(job, "policy_type", None): + config.setdefault("policy_type", getattr(job, "policy_type")) + if getattr(job, "train_steps", None): + config.setdefault("steps", getattr(job, "train_steps")) + return TrainingRequest.model_validate(config) + + +def _training_metrics_from_external_job(job) -> TrainingMetrics: + out = TrainingMetrics(total_steps=int(getattr(job, "train_steps", 0) or 0)) + remote = getattr(job, "metrics", None) + if remote is None: + return out + out.current_step = int(getattr(remote, "current_step", 0) or 0) + out.total_steps = int(getattr(remote, "total_steps", 0) or out.total_steps) + out.current_loss = getattr(remote, "current_loss", None) + out.current_lr = getattr(remote, "current_lr", None) + out.grad_norm = getattr(remote, "grad_norm", None) + out.eta_seconds = getattr(remote, "eta_seconds", None) + return out + + +def _external_flavor(job) -> str | None: + target = getattr(job, "target", None) + if isinstance(target, dict) and target.get("flavor"): + return str(target["flavor"]) + gpu_type = str(getattr(job, "gpu_type", "") or "").strip() + return gpu_type or None + + +def _parse_external_timestamp(value: str | None) -> float | None: + if not value: + return None + try: + return datetime.fromisoformat(value.replace("Z", "+00:00")).timestamp() + except ValueError: + return None + + def parse_metrics_into(line: str, metrics: TrainingMetrics) -> None: """Update `metrics` in-place from one stdout line. @@ -567,6 +654,100 @@ def _list_hub_checkpoints(api, repo_id: str) -> list[JobCheckpoint]: _HUB_CKPT_REF_RE = re.compile(r"^(?P[^@]+)@checkpoints/(?P\d+)$") _HUB_ROOT_REF_RE = re.compile(r"^(?P[^@]+)@root$") +_EXTERNAL_CKPT_REF_RE = re.compile(r"^seeed-cloud://(?P[^/]+)/(?P[^/]+)/(?P\d+)$") + + +def _external_checkpoint_ref(provider_id: str, remote_job_id: str, step: int) -> str: + return ( + "seeed-cloud://" + + urllib.parse.quote(provider_id, safe="") + + "/" + + urllib.parse.quote(remote_job_id, safe="") + + f"/{step}" + ) + + +def _external_checkpoint_cache_dir(provider_id: str, remote_job_id: str, step: int) -> Path: + return ( + Path.home() + / ".cache" + / "huggingface" + / "lerobot" + / "external_checkpoints" + / provider_id + / remote_job_id + / str(step) + ) + + +def _find_pretrained_model_dir(root: Path) -> Path | None: + direct = root / "pretrained_model" + if (direct / "config.json").is_file(): + return direct + if (root / "config.json").is_file(): + return root + for config_path in root.rglob("config.json"): + if config_path.parent.name == "pretrained_model": + return config_path.parent + return None + + +def _safe_extract_tar(archive_path: Path, dest_dir: Path) -> None: + dest_root = dest_dir.resolve() + with tarfile.open(archive_path, "r:*") as archive: + for member in archive.getmembers(): + target = (dest_dir / member.name).resolve() + if target != dest_root and dest_root not in target.parents: + raise ValueError(f"Unsafe path in artifact archive: {member.name!r}") + try: + archive.extractall(dest_dir, filter="data") + except TypeError: + archive.extractall(dest_dir) + + +def resolve_external_checkpoint_path(policy_ref: str) -> str | None: + match = _EXTERNAL_CKPT_REF_RE.match(policy_ref) + if not match: + return None + provider_id = urllib.parse.unquote(match.group("provider")) + remote_job_id = urllib.parse.unquote(match.group("job_id")) + step = int(match.group("step")) + + from .compute_providers import get_compute_provider + + provider = get_compute_provider(provider_id) + if provider is None or not provider.is_configured(): + raise ValueError(f"compute provider {provider_id!r} is not configured") + download_artifact = getattr(provider, "download_artifact", None) + if not callable(download_artifact): + raise ValueError(f"compute provider {provider_id!r} cannot download training artifacts") + + cache_dir = _external_checkpoint_cache_dir(provider_id, remote_job_id, step) + extract_dir = cache_dir / "extracted" + existing = _find_pretrained_model_dir(extract_dir) + if existing is not None: + return str(existing) + + cache_dir.mkdir(parents=True, exist_ok=True) + artifact_path = cache_dir / "model.tar.gz" + for attempt in range(2): + if not artifact_path.is_file(): + download_artifact(remote_job_id, artifact_path) + if extract_dir.exists(): + shutil.rmtree(extract_dir) + extract_dir.mkdir(parents=True, exist_ok=True) + try: + _safe_extract_tar(artifact_path, extract_dir) + break + except (tarfile.TarError, EOFError, OSError): + with contextlib.suppress(OSError): + artifact_path.unlink() + if attempt == 1: + raise + resolved = _find_pretrained_model_dir(extract_dir) + if resolved is None: + raise FileNotFoundError(f"No pretrained_model/config.json found in artifact for {remote_job_id}") + return str(resolved) def _read_checkpoint_config(ckpt: JobCheckpoint) -> dict[str, object]: @@ -581,6 +762,10 @@ def _read_checkpoint_config(ckpt: JobCheckpoint) -> dict[str, object]: if ckpt.source == "local": with open(Path(ckpt.ref) / "config.json") as f: return json.load(f) + external_path = resolve_external_checkpoint_path(ckpt.ref) + if external_path is not None: + with open(Path(external_path) / "config.json") as f: + return json.load(f) from huggingface_hub import hf_hub_download m = _HUB_CKPT_REF_RE.match(ckpt.ref) @@ -784,6 +969,10 @@ def start(self, config: TrainingRequest, target: JobTarget | None = None) -> Job target = target or JobTarget() if target.runner == "hf_cloud" and not target.flavor: raise ValueError("flavor is required when runner is hf_cloud") + if target.runner == "seeed_cloud" and not target.flavor: + raise ValueError("flavor is required when runner is seeed_cloud") + if target.runner == "external" and not target.provider: + raise ValueError("provider is required when runner is external") with self._lock: # Local trainings are bounded by this machine's GPU/USB resources, @@ -806,7 +995,9 @@ def start(self, config: TrainingRequest, target: JobTarget | None = None) -> Job output_dir=lerobot_output_dir, started_at=time.time(), runner=target.runner, - hf_flavor=target.flavor, + hf_flavor=target.flavor if target.runner == "hf_cloud" else None, + external_provider=_target_provider_id(target), + external_flavor=target.flavor if target.runner in {"seeed_cloud", "external"} else None, ) job_dir.mkdir(parents=True, exist_ok=True) @@ -816,8 +1007,19 @@ def start(self, config: TrainingRequest, target: JobTarget | None = None) -> Job log_path = _job_log_path(self._output_root, job_id) if target.runner == "local": runner = LocalJobRunner(record.metrics, log_file_path=log_path) - else: + elif target.runner == "hf_cloud": runner = HfCloudJobRunner(record.metrics, log_path, target.flavor) + else: + from .compute_providers import get_compute_provider + + provider_id = _target_provider_id(target) or "" + provider = get_compute_provider(provider_id) + if provider is None: + raise ValueError(f"compute provider {provider_id!r} is not available") + if not provider.is_configured(): + raise ValueError(f"compute provider {provider_id!r} is not configured") + provider_target = JobTarget(runner="external", provider=provider_id, flavor=target.flavor) + runner = provider.create_runner(record.metrics, log_path, provider_target) try: runner.start(job_id, config, lerobot_output_dir) @@ -832,12 +1034,19 @@ def start(self, config: TrainingRequest, target: JobTarget | None = None) -> Job # Capture runner-specific identifiers. if target.runner == "local": record.process_pid = runner.pid() - else: + elif target.runner == "hf_cloud": record.hf_job_id = runner.hf_job_id() record.hf_job_url = runner.hf_job_url() # config was mutated by HfCloudJobRunner.start to set # policy_repo_id; mirror it onto the record for the UI. record.hf_repo_id = config.policy_repo_id + else: + get_external_id = getattr(runner, "external_job_id", None) + get_external_url = getattr(runner, "external_job_url", None) + if callable(get_external_id): + record.external_job_id = get_external_id() + if callable(get_external_url): + record.external_job_url = get_external_url() self._persist(record, force=True) self._runners[job_id] = runner @@ -901,6 +1110,91 @@ def register_imported(self, source: str, name: str | None = None) -> JobRecord: self._notify_change() return record + def attach_external(self, provider_id: str, remote_job_id: str) -> JobRecord: + if provider_id != SEEED_CLOUD_PROVIDER_ID: + raise ValueError("only seeed_cloud provider attach is supported") + + from .compute_providers import get_compute_provider + + provider = get_compute_provider(provider_id) + if provider is None: + raise ValueError(f"compute provider {provider_id!r} is not available") + if not provider.is_configured(): + raise ValueError(f"compute provider {provider_id!r} is not configured") + + with self._lock: + existing = next( + ( + record + for record in self._records.values() + if record.external_provider == provider_id and record.external_job_id == remote_job_id + ), + None, + ) + if existing is not None: + return existing + + remote_job = self._find_provider_job(provider, remote_job_id) + config = _training_request_from_external_job(remote_job) + metrics = _training_metrics_from_external_job(remote_job) + state = _external_job_state(getattr(remote_job, "status", "")) + job_id = _generate_job_id(config.policy_type, config.dataset_repo_id) + job_dir = _job_dir(self._output_root, job_id) + output_dir = str(job_dir / "run") + log_path = _job_log_path(self._output_root, job_id) + + record = JobRecord( + id=job_id, + name=f"{config.policy_type.upper()} ยท {config.dataset_repo_id}", + state=state, + config=config, + output_dir=output_dir, + started_at=_parse_external_timestamp(getattr(remote_job, "created_at", None)) or time.time(), + ended_at=( + _parse_external_timestamp(getattr(remote_job, "updated_at", None)) + if state in {"done", "failed"} + else None + ), + error_message=getattr(remote_job, "error_message", "") or None, + metrics=metrics, + runner="seeed_cloud", + external_provider=provider_id, + external_flavor=_external_flavor(remote_job), + external_job_id=remote_job_id, + external_job_url=getattr(remote_job, "external_job_url", "") or None, + ) + + runner = None + if state == "running": + provider_target = JobTarget( + runner="external", + provider=provider_id, + flavor=record.external_flavor, + ) + runner = provider.create_runner(record.metrics, log_path, provider_target) + reattach = getattr(runner, "reattach", None) + if not callable(reattach): + raise ValueError(f"compute provider {provider_id!r} cannot reattach remote jobs") + reattach(remote_job_id) + + with self._lock: + job_dir.mkdir(parents=True, exist_ok=True) + self._records[job_id] = record + if runner is not None: + self._runners[job_id] = runner + self._persist(record, force=True) + self._notify_change() + return record + + def _find_provider_job(self, provider, remote_job_id: str): + list_jobs = getattr(provider, "list_jobs", None) + if not callable(list_jobs): + raise JobNotFoundError(remote_job_id) + for job in list_jobs(): + if getattr(job, "id", None) == remote_job_id: + return job + raise JobNotFoundError(remote_job_id) + def stop(self, job_id: str) -> JobRecord: with self._lock: record = self._records.get(job_id) @@ -936,8 +1230,14 @@ def read_persisted_logs(self, job_id: str) -> builtins.list[LogLine]: restart marked the job 'interrupted'). """ with self._lock: - if job_id not in self._records: + record = self._records.get(job_id) + if record is None: raise JobNotFoundError(job_id) + if record.runner in {"seeed_cloud", "external"} and record.external_provider and record.external_job_id: + logs = self._read_external_logs(record) + if logs: + self._write_log_lines(job_id, logs) + return logs path = _job_log_path(self._output_root, job_id) if not path.exists(): return [] @@ -953,6 +1253,37 @@ def read_persisted_logs(self, job_id: str) -> builtins.list[LogLine]: continue # skip a malformed line rather than 500ing return out + def _read_external_logs(self, record: JobRecord) -> builtins.list[LogLine]: + if not record.external_provider or not record.external_job_id: + return [] + try: + from .compute_providers import get_compute_provider + + provider = get_compute_provider(record.external_provider) + if provider is None or not provider.is_configured(): + return [] + list_logs = getattr(provider, "list_logs", None) + if not callable(list_logs): + return [] + out: list[LogLine] = [] + for item in list_logs(record.external_job_id): + timestamp = _parse_external_timestamp(getattr(item, "created_at", None)) or time.time() + out.append(LogLine(timestamp=timestamp, message=str(getattr(item, "content", "")))) + return out + except Exception as exc: + logger.debug("Failed to read external logs for %s: %s", record.id, exc) + return [] + + def _write_log_lines(self, job_id: str, logs: builtins.list[LogLine]) -> None: + try: + path = _job_log_path(self._output_root, job_id) + path.parent.mkdir(parents=True, exist_ok=True) + with path.open("w") as f: + for line in logs: + f.write(line.model_dump_json() + "\n") + except Exception as exc: + logger.debug("Failed to persist external logs for %s: %s", job_id, exc) + def read_metrics_history(self, job_id: str) -> builtins.list[MetricsHistoryPoint]: """Reconstruct the per-step loss/lr/grad-norm series from log.jsonl. @@ -961,8 +1292,13 @@ def read_metrics_history(self, job_id: str) -> builtins.list[MetricsHistoryPoint on every call; cache later if a slow file ever shows up. """ with self._lock: - if job_id not in self._records: + record = self._records.get(job_id) + if record is None: raise JobNotFoundError(job_id) + if record.runner in {"seeed_cloud", "external"} and record.external_provider and record.external_job_id: + external = self._read_external_metrics_history(record) + if external: + return external path = _job_log_path(self._output_root, job_id) if not path.exists(): return [] @@ -1000,6 +1336,39 @@ def read_metrics_history(self, job_id: str) -> builtins.list[MetricsHistoryPoint points.sort(key=lambda p: p.step) return points + def _read_external_metrics_history(self, record: JobRecord) -> builtins.list[MetricsHistoryPoint]: + if not record.external_provider or not record.external_job_id: + return [] + try: + from .compute_providers import get_compute_provider + + provider = get_compute_provider(record.external_provider) + if provider is None or not provider.is_configured(): + return [] + list_history = getattr(provider, "list_metrics_history", None) + if not callable(list_history): + return [] + points: list[MetricsHistoryPoint] = [] + for item in list_history(record.external_job_id): + step = int(getattr(item, "step", 0) or 0) + if step <= 0: + continue + point = MetricsHistoryPoint( + step=step, + loss=getattr(item, "loss", None), + lr=getattr(item, "lr", None), + grad_norm=getattr(item, "grad_norm", None), + ) + if points and points[-1].step == point.step: + points[-1] = point + else: + points.append(point) + points.sort(key=lambda p: p.step) + return points + except Exception as exc: + logger.debug("Failed to read external metrics history for %s: %s", record.id, exc) + return [] + def _checkpoints_for(self, record: JobRecord) -> builtins.list[JobCheckpoint]: if record.runner == "imported": if record.hf_repo_id: @@ -1007,8 +1376,41 @@ def _checkpoints_for(self, record: JobRecord) -> builtins.list[JobCheckpoint]: return _list_imported_local(record.output_dir) if record.runner == "local": return _list_local_checkpoints(record.output_dir) + if record.runner in {"seeed_cloud", "external"} and record.external_provider and record.external_job_id: + external = self._list_external_checkpoints(record) + if external: + return external return self._list_cloud_cached(record.hf_repo_id) + def _list_external_checkpoints(self, record: JobRecord) -> builtins.list[JobCheckpoint]: + if not record.external_provider or not record.external_job_id: + return [] + try: + from .compute_providers import get_compute_provider + + provider = get_compute_provider(record.external_provider) + if provider is None or not provider.is_configured(): + return [] + remote_job = self._find_provider_job(provider, record.external_job_id) + if _external_job_state(getattr(remote_job, "status", "")) != "done": + return [] + if not str(getattr(remote_job, "artifact_url", "") or "").strip(): + return [] + metrics = getattr(remote_job, "metrics", None) + step = int(getattr(metrics, "current_step", 0) or getattr(remote_job, "train_steps", 0) or record.config.steps or 0) + if step <= 0: + return [] + return [ + JobCheckpoint( + step=step, + source="external", + ref=_external_checkpoint_ref(record.external_provider, record.external_job_id, step), + ) + ] + except Exception as exc: + logger.debug("Failed to list external checkpoints for %s: %s", record.id, exc) + return [] + def list_checkpoints(self, job_id: str) -> builtins.list[JobCheckpoint]: """Return checkpoints saved for this job, ascending by step. @@ -1146,6 +1548,41 @@ def _load_from_disk(self) -> None: ) runner.reattach(record.hf_job_id) self._runners[record.id] = runner + elif record.runner in {"seeed_cloud", "external"} and record.external_provider and record.external_job_id: + from .compute_providers import get_compute_provider + + provider = get_compute_provider(record.external_provider) + if provider is not None and provider.is_configured(): + logger.info( + "Re-attaching to external compute job %s (provider=%s external_job_id=%s)", + record.id, + record.external_provider, + record.external_job_id, + ) + provider_target = JobTarget( + runner="external", + provider=record.external_provider, + flavor=record.external_flavor, + ) + runner = provider.create_runner( + record.metrics, + _job_log_path(self._output_root, record.id), + provider_target, + ) + reattach = getattr(runner, "reattach", None) + if callable(reattach): + reattach(record.external_job_id) + self._runners[record.id] = runner + else: + record.state = "interrupted" + if record.ended_at is None: + record.ended_at = time.time() + self._write_meta(record) + else: + record.state = "interrupted" + if record.ended_at is None: + record.ended_at = time.time() + self._write_meta(record) else: # Malformed running record โ€” mark interrupted. record.state = "interrupted" diff --git a/lelab/record.py b/lelab/record.py index 2e61d9e..f96ec70 100644 --- a/lelab/record.py +++ b/lelab/record.py @@ -17,8 +17,10 @@ import shutil import threading import time +from contextlib import contextmanager from datetime import datetime from typing import Any +from unittest.mock import patch from pydantic import BaseModel @@ -31,6 +33,7 @@ from lerobot.teleoperators.so_leader import SO101LeaderConfig from .utils.config import setup_calibration_files, with_lelab_tag +from .utils.hf_auth import cached_whoami logger = logging.getLogger(__name__) @@ -53,6 +56,56 @@ _state_lock = threading.Lock() +def _sanitize_dataset_repo_component(value: str) -> str: + return re.sub(r"[^A-Za-z0-9._-]", "_", value.strip()).strip("._-") + + +def _default_dataset_namespace() -> str: + try: + info = cached_whoami() + except Exception: + logger.exception("Failed to resolve Hugging Face username for dataset namespace") + info = None + + namespace = info.get("name") if isinstance(info, dict) else None + if namespace: + return _sanitize_dataset_repo_component(namespace) or "local" + return "local" + + +def _normalize_dataset_repo_id(repo_id: str, *, resume: bool) -> str: + repo_id = repo_id.strip() + if not repo_id: + return repo_id + + if "/" in repo_id: + namespace, name = repo_id.split("/", 1) + namespace = _sanitize_dataset_repo_component(namespace) or _default_dataset_namespace() + else: + namespace = _default_dataset_namespace() + name = repo_id + + name = _sanitize_dataset_repo_component(name) or "dataset" + if not resume: + name = f"{name}_{datetime.now().strftime('%Y%m%d_%H%M%S')}" + return f"{namespace}/{name}" + + +def _recording_phase_should_rerecord(web_events: dict) -> bool: + return bool(web_events.get("rerecord_episode")) + + +@contextmanager +def _use_existing_calibration_input(): + # LeRobot's SO arm connect path may prompt: + # "Press ENTER to use provided calibration file ...". + # Recording runs in a web worker thread, so waiting for stdin would leave + # the UI stuck in PREPARING forever. Returning "" chooses the existing + # calibration file and avoids the interactive recalibration path. + with patch("builtins.input", return_value=""): + yield + + class RecordingRequest(BaseModel): leader_port: str follower_port: str @@ -197,6 +250,70 @@ def create_record_config(request: RecordingRequest) -> RecordConfig: return record_config +def _camera_backend_for_platform(): + import platform + + from lerobot.cameras.configs import Cv2Backends + + if platform.system() == "Darwin": + return Cv2Backends.AVFOUNDATION + if platform.system() == "Linux": + return Cv2Backends.V4L2 + return Cv2Backends.ANY + + +def _wait_for_opencv_cameras(cameras: dict, *, timeout_s: float = 8.0) -> None: + opencv_cameras = [ + (name, cfg) + for name, cfg in cameras.items() + if cfg.get("type") == "opencv" + ] + if not opencv_cameras: + return + + import cv2 + + backend = _camera_backend_for_platform() + deadline = time.time() + timeout_s + last_error = "" + + while time.time() < deadline: + opened_caps = [] + try: + for name, cfg in opencv_cameras: + index = cfg.get("camera_index", 0) + cap = cv2.VideoCapture(index, backend.value) + opened_caps.append(cap) + if not cap.isOpened(): + last_error = f"{name} (index {index}) did not open" + break + if cfg.get("width"): + cap.set(cv2.CAP_PROP_FRAME_WIDTH, cfg["width"]) + if cfg.get("height"): + cap.set(cv2.CAP_PROP_FRAME_HEIGHT, cfg["height"]) + if cfg.get("fps"): + cap.set(cv2.CAP_PROP_FPS, cfg["fps"]) + ok, _frame = cap.read() + if not ok: + last_error = f"{name} (index {index}) opened but did not return a frame" + break + else: + logger.info("OpenCV camera preflight passed for %s", [name for name, _ in opencv_cameras]) + return + finally: + for cap in opened_caps: + cap.release() + + logger.info("Waiting for camera resources: %s", last_error) + time.sleep(0.5) + + raise RuntimeError( + "Camera is not available for recording. " + f"Last check failed: {last_error or 'unknown camera error'}. " + "Close any browser/app preview using the camera, or run `lerobot-find-cameras opencv`." + ) + + def handle_start_recording(request: RecordingRequest) -> dict[str, Any]: """Handle start recording request by using the existing record() function""" global \ @@ -236,21 +353,14 @@ def handle_start_recording(request: RecordingRequest) -> dict[str, Any]: last_recording_info = None try: - # Sanitize the dataset name so push_to_hub never rejects a finished - # recording over an invalid character. HF repo names allow only - # [A-Za-z0-9._-]; everything else becomes "_". + # LeRobot requires repo_id to be namespace/name even for local + # recording. The UI may provide only a bare dataset name, so normalize + # it before constructing RecordConfig and before the worker starts. if request.dataset_repo_id: - if "/" in request.dataset_repo_id: - namespace, name = request.dataset_repo_id.split("/", 1) - name = re.sub(r"[^A-Za-z0-9._-]", "_", name) - request.dataset_repo_id = f"{namespace}/{name}" - else: - request.dataset_repo_id = re.sub(r"[^A-Za-z0-9._-]", "_", request.dataset_repo_id) - # Stamp the repo_id with a timestamp (matches lerobot-record CLI behavior), - # so each session lands in a unique directory and the frontend gets the - # final id back in the response and status payload. - if not request.resume and request.dataset_repo_id: - request.dataset_repo_id = f"{request.dataset_repo_id}_{datetime.now().strftime('%Y%m%d_%H%M%S')}" + request.dataset_repo_id = _normalize_dataset_repo_id( + request.dataset_repo_id, + resume=request.resume, + ) logger.info(f"Starting recording for dataset: {request.dataset_repo_id}") logger.info(f"Task: {request.single_task}") @@ -294,6 +404,8 @@ def recording_worker(): list(request.cameras.keys()), ) time.sleep(2.0) + _wait_for_opencv_cameras(request.cameras) + time.sleep(0.2) dataset = record_with_web_events(record_config, recording_events) logger.info(f"Recording completed successfully. Dataset has {dataset.num_episodes} episodes") @@ -308,11 +420,12 @@ def recording_worker(): "robot_type": getattr(dataset.meta, "robot_type", "Unknown robot"), } except Exception as e: - logger.exception("Recording session failed") + error_message = str(e) or repr(e) + logger.exception("Recording session failed: %s", error_message) current_phase = "error" if recording_start_time: session_end_elapsed_seconds = int(time.time() - recording_start_time) - last_recording_info = {"success": False, "error": str(e)} + last_recording_info = {"success": False, "error": error_message} finally: if current_phase != "error": current_phase = "completed" @@ -413,8 +526,9 @@ def handle_recording_status() -> dict[str, Any]: "current_phase": current_phase, # "preparing", "recording", "resetting", "completed" "session_ended": session_ended, # New field to indicate session completion "available_controls": { - "stop_recording": recording_active, # ESC key replacement - "exit_early": recording_active, # Right arrow key replacement + "stop_recording": recording_active and current_phase != "stopping", # ESC key replacement + "exit_early": recording_active + and current_phase in ["recording", "resetting"], # Right arrow key replacement "rerecord_episode": recording_active and current_phase == "recording", # Only during recording phase }, @@ -455,6 +569,8 @@ def handle_recording_status() -> dict[str, Any]: status["phase_time_limit_s"] = recording_config.reset_time_s elif session_end_elapsed_seconds is not None: status["session_elapsed_seconds"] = session_end_elapsed_seconds + if current_phase == "error" and last_recording_info and last_recording_info.get("error"): + status["error"] = last_recording_info["error"] return status @@ -631,7 +747,8 @@ def record_with_web_events(cfg: RecordConfig, web_events: dict) -> LeRobotDatase # ๐Ÿ”ง ROBOT CONNECTION: Connect with enhanced error handling for camera conflicts try: logger.info("๐Ÿ”ง ROBOT CONNECTION: Attempting to connect robot...") - robot.connect() + with _use_existing_calibration_input(): + robot.connect() logger.info("โœ… ROBOT CONNECTION: Robot connected successfully") except Exception as e: logger.error(f"โŒ ROBOT CONNECTION: Failed to connect robot: {e}") @@ -646,7 +763,8 @@ def record_with_web_events(cfg: RecordConfig, web_events: dict) -> LeRobotDatase if teleop is not None: try: logger.info("๐Ÿ”ง TELEOP CONNECTION: Attempting to connect teleoperator...") - teleop.connect() + with _use_existing_calibration_input(): + teleop.connect() logger.info("โœ… TELEOP CONNECTION: Teleoperator connected successfully") except Exception as e: logger.error(f"โŒ TELEOP CONNECTION: Failed to connect teleoperator: {e}") @@ -713,25 +831,23 @@ def record_with_web_events(cfg: RecordConfig, web_events: dict) -> LeRobotDatase logger.info(f"Recording phase completed - events state: {web_events}") - # Check if exit_early was triggered (use our tracking flag) - recording_interrupted_by_exit_early = web_events.get("_exit_early_triggered", False) - if recording_interrupted_by_exit_early: - logger.info("๐ŸŸก RECORDING PHASE INTERRUPTED BY EXIT_EARLY - proceeding to save episode") + # Whether the phase ended by timeout or by Advance, the collected + # buffer is a valid episode. Only the explicit Re-record control + # should clear the buffer and keep the same episode number. + if web_events.get("_exit_early_triggered", False): + logger.info("๐ŸŸก RECORDING PHASE ADVANCED BY USER - proceeding to save episode") print( - f"๐ŸŸก STATUS CHANGE: Recording phase interrupted by user - episode {current_episode} data collected" + f"๐ŸŸก STATUS CHANGE: Recording phase advanced by user - episode {current_episode} data collected" ) - # Reset our tracking flag web_events["_exit_early_triggered"] = False else: - # Recording completed due to timeout - trigger re-record behavior - logger.info("โฐ RECORDING PHASE COMPLETED DUE TO TIMEOUT - triggering re-record") + logger.info("โฐ RECORDING PHASE COMPLETED DUE TO TIMEOUT - proceeding to save episode") print( - f"โฐ STATUS CHANGE: Recording timeout reached for episode {current_episode} - re-recording" + f"โฐ STATUS CHANGE: Recording timeout reached for episode {current_episode} - saving" ) - web_events["rerecord_episode"] = True # Handle rerecord logic first (before saving) - if web_events["rerecord_episode"]: + if _recording_phase_should_rerecord(web_events): log_say("Re-record episode", cfg.play_sounds) print( f"๐Ÿ”„ STATUS CHANGE: Re-recording episode {current_episode} (episode number stays the same)" diff --git a/lelab/rollout.py b/lelab/rollout.py index bdffdf1..4052e50 100644 --- a/lelab/rollout.py +++ b/lelab/rollout.py @@ -122,6 +122,11 @@ def _resolve_policy_path(policy_ref: str) -> str: snapshot_download and its root is returned directly.""" if Path(policy_ref).is_dir(): return policy_ref + from .jobs import resolve_external_checkpoint_path + + external_path = resolve_external_checkpoint_path(policy_ref) + if external_path is not None: + return external_path from huggingface_hub import snapshot_download m = _HUB_REF_RE.match(policy_ref) diff --git a/lelab/seeed_cloud_config.py b/lelab/seeed_cloud_config.py new file mode 100644 index 0000000..21901ee --- /dev/null +++ b/lelab/seeed_cloud_config.py @@ -0,0 +1,87 @@ +from __future__ import annotations + +import json +import os +from dataclasses import dataclass +from pathlib import Path + + +CONFIG_PATH_ENV = "LELAB_SEEED_CLOUD_CONFIG_PATH" +DEFAULT_API_URL = "https://sensecraft-gpu.seeed.cc/api" +DEFAULT_WEB_URL = "https://sensecraft-gpu.seeed.cc" + + +@dataclass(frozen=True) +class SeeedCloudConfig: + api_url: str = "" + web_url: str = "" + token: str = "" + + @property + def configured(self) -> bool: + return bool(self.api_url and self.token) + + def public_dict(self) -> dict[str, str | bool]: + return { + "configured": self.configured, + "api_url": self.api_url, + "web_url": self.web_url, + } + + +def config_path() -> Path: + override = os.environ.get(CONFIG_PATH_ENV, "").strip() + if override: + return Path(override).expanduser() + return Path.home() / ".config" / "lelab" / "seeed-cloud.json" + + +def load_config() -> SeeedCloudConfig: + path = config_path() + if not path.exists(): + return SeeedCloudConfig( + api_url=os.environ.get("SEEED_CLOUD_API_URL", "").strip(), + web_url=os.environ.get("SEEED_CLOUD_WEB_URL", "").strip(), + token=os.environ.get("SEEED_CLOUD_TOKEN", "").strip(), + ) + try: + data = json.loads(path.read_text()) + except (OSError, json.JSONDecodeError): + return SeeedCloudConfig() + if not isinstance(data, dict): + return SeeedCloudConfig() + return SeeedCloudConfig( + api_url=str(data.get("api_url") or "").strip(), + web_url=str(data.get("web_url") or "").strip(), + token=str(data.get("token") or "").strip(), + ) + + +def save_config(*, api_url: str, token: str, web_url: str = "") -> SeeedCloudConfig: + cfg = SeeedCloudConfig( + api_url=api_url.strip() or DEFAULT_API_URL, + web_url=web_url.strip() or DEFAULT_WEB_URL, + token=token.strip(), + ) + if not cfg.token: + raise ValueError("token is required") + + path = config_path() + path.parent.mkdir(parents=True, exist_ok=True) + path.write_text( + json.dumps( + { + "api_url": cfg.api_url, + "web_url": cfg.web_url, + "token": cfg.token, + }, + indent=2, + sort_keys=True, + ) + + "\n" + ) + try: + path.chmod(0o600) + except OSError: + pass + return cfg diff --git a/lelab/server.py b/lelab/server.py index 43e7d71..c8db389 100644 --- a/lelab/server.py +++ b/lelab/server.py @@ -13,6 +13,7 @@ # limitations under the License. import asyncio +import concurrent.futures import contextlib import glob import json @@ -132,9 +133,34 @@ def from_legacy(cls, raw: dict) -> "StartTrainingBody": return cls(config=TrainingRequest.model_validate(raw)) +class SPAStaticFiles(StaticFiles): + """Serve React Router routes from index.html while preserving real 404s.""" + + async def get_response(self, path: str, scope): + try: + return await super().get_response(path, scope) + except StarletteHTTPException as exc: + if exc.status_code == 404 and self._should_fallback_to_index(path, scope): + return await super().get_response("index.html", scope) + raise + + @staticmethod + def _should_fallback_to_index(path: str, scope) -> bool: + if scope.get("method") not in {"GET", "HEAD"}: + return False + if path.startswith(("assets/", "favicon.ico", "lovable-uploads/", "so-101-urdf/")): + return False + headers = { + key.decode("latin-1").lower(): value.decode("latin-1") + for key, value in scope.get("headers", []) + } + return "text/html" in headers.get("accept", "") + + # Cache for HF Jobs hardware flavors (5-minute TTL) _flavors_cache: dict = {"data": None, "fetched_at": 0.0} _FLAVOR_CACHE_TTL_SECONDS = 300.0 +_HF_HARDWARE_TIMEOUT_SECONDS = 4.0 app = FastAPI() @@ -510,54 +536,54 @@ def list_jobs(limit: int = 10): @app.get("/jobs/hub") def list_hub_jobs(): - """List the user's HF Cloud compute Jobs and their uploaded LeRobot model - repos on huggingface.co. + """List online compute Jobs and uploaded LeRobot model repos. - Returns 200 with empty lists when no token is configured so the frontend - can render an unauthenticated empty state without surfacing an error. + HF Cloud jobs come from huggingface.co. Seeed Cloud jobs come from the + external compute provider's v2 LeLab API when configured. Declared before `/jobs/{job_id}` so FastAPI's first-match routing doesn't treat "hub" as a job id. """ info = cached_whoami() - if info is None: - return {"authenticated": False, "jobs": [], "models": []} - api = shared_hf_api() - + hf_jobs = [] + models: list[dict] = [] authors: list[str] = [] - if info.get("name"): - authors.append(info["name"]) - for o in info.get("orgs", []) or []: - if isinstance(o, dict) and o.get("name"): - authors.append(o["name"]) + if info is not None: + api = shared_hf_api() + if info.get("name"): + authors.append(info["name"]) + for o in info.get("orgs", []) or []: + if isinstance(o, dict) and o.get("name"): + authors.append(o["name"]) - try: - jobs = api.list_jobs() - except Exception as exc: - logger.warning("list_jobs failed: %s", exc) - jobs = [] - - seen_models: set[str] = set() - models: list[dict] = [] - for author in authors: try: - for m in api.list_models(author=author, filter="LeRobot", limit=200): - if m.id in seen_models: - continue - seen_models.add(m.id) - models.append( - { - "repo_id": m.id, - "last_modified": m.last_modified.isoformat() if m.last_modified else None, - "private": bool(getattr(m, "private", False)), - } - ) + hf_jobs = api.list_jobs() except Exception as exc: - logger.warning("list_models(%s) failed: %s", author, exc) + logger.warning("list_jobs failed: %s", exc) + hf_jobs = [] + + seen_models: set[str] = set() + for author in authors: + try: + for m in api.list_models(author=author, filter="LeRobot", limit=200): + if m.id in seen_models: + continue + seen_models.add(m.id) + models.append( + { + "repo_id": m.id, + "last_modified": m.last_modified.isoformat() if m.last_modified else None, + "private": bool(getattr(m, "private", False)), + } + ) + except Exception as exc: + logger.warning("list_models(%s) failed: %s", author, exc) models.sort(key=lambda m: m["last_modified"] or "", reverse=True) + seeed_jobs, seeed_authenticated = _list_seeed_cloud_hub_jobs() + return { - "authenticated": True, + "authenticated": info is not None or seeed_authenticated, "jobs": [ { "id": ji.id, @@ -568,13 +594,66 @@ def list_hub_jobs(): "status": ({"stage": ji.status.stage, "message": ji.status.message} if ji.status else None), "owner": ji.owner.name if ji.owner else None, "url": ji.url, + "provider": "hf_cloud", } - for ji in jobs - ], + for ji in hf_jobs + ] + + seeed_jobs, "models": models, } +def _list_seeed_cloud_hub_jobs() -> tuple[list[dict], bool]: + try: + from .compute_providers import get_compute_provider + + provider = get_compute_provider("seeed_cloud") + if provider is None or not provider.is_configured(): + return [], False + list_jobs = getattr(provider, "list_jobs", None) + if not callable(list_jobs): + return [], True + jobs = list_jobs() + except Exception as exc: + logger.warning("list seeed cloud jobs failed: %s", exc) + return [], False + + return [ + { + "id": job.id, + "created_at": job.created_at, + "docker_image": _seeed_hub_job_title(job), + "space_id": None, + "flavor": job.gpu_type or None, + "status": { + "stage": _seeed_hub_stage(job.status), + "message": job.error_message or None, + }, + "owner": "Seeed Cloud", + "url": job.external_job_url or "", + "provider": "seeed_cloud", + } + for job in jobs + ], True + + +def _seeed_hub_job_title(job) -> str: + policy = (job.policy_type or "training").upper() + suffix = f" ยท {job.id[:12]}โ€ฆ" if job.id else "" + return f"Seeed ยท {policy}{suffix}" + + +def _seeed_hub_stage(status: str) -> str: + status = (status or "").upper() + if status == "SUCCEEDED": + return "COMPLETED" + if status in {"FAILED", "CANCELLED", "CANCELED"}: + return status + if status: + return "RUNNING" + return "UNKNOWN" + + @app.get("/jobs/{job_id}") def get_job(job_id: str): try: @@ -651,6 +730,16 @@ def stop_job(job_id: str): raise HTTPException(status_code=409, detail=f"Job {job_id!r} is not running") from exc +@app.post("/jobs/providers/{provider_id}/jobs/{remote_job_id}/attach") +def attach_provider_job(provider_id: str, remote_job_id: str): + try: + return job_registry.attach_external(provider_id, remote_job_id) + except JobNotFoundError as exc: + raise HTTPException(status_code=404, detail=f"Remote job {remote_job_id!r} not found") from exc + except ValueError as exc: + raise HTTPException(status_code=400, detail=str(exc)) from exc + + @app.delete("/jobs/{job_id}", status_code=204) def delete_job(job_id: str): try: @@ -669,19 +758,38 @@ def get_runners_hardware(): keep this endpoint cheap (it can be re-fetched whenever auth state changes). The whoami cache is invalidated on login. """ + from .compute_providers import discover_compute_providers + + external_providers = [] + for provider in discover_compute_providers(): + provider_flavors = [ + { + **flavor, + "provider": provider.id, + "provider_label": provider.display_name, + } + for flavor in provider.list_flavors() + ] + external_providers.append( + { + "id": provider.id, + "display_name": provider.display_name, + "authenticated": provider.is_configured(), + "flavors": provider_flavors, + } + ) + info = cached_whoami() if info is None or not info.get("name"): - return {"authenticated": False, "username": None, "flavors": []} + return {"authenticated": False, "username": None, "flavors": [], "providers": external_providers} username: str = info["name"] api = shared_hf_api() now = time.time() if _flavors_cache["data"] is None or now - _flavors_cache["fetched_at"] > _FLAVOR_CACHE_TTL_SECONDS: - try: - hw_list = api.list_jobs_hardware() - except Exception as exc: - logger.warning("list_jobs_hardware failed: %s", exc) - return {"authenticated": True, "username": username, "flavors": []} + hw_list = _list_hf_jobs_hardware(api) + if hw_list is None: + return {"authenticated": True, "username": username, "flavors": [], "providers": external_providers} _flavors_cache["data"] = [ { "name": h.name, @@ -700,9 +808,47 @@ def get_runners_hardware(): "authenticated": True, "username": username, "flavors": _flavors_cache["data"], + "providers": external_providers, } +@app.get("/compute/seeed-cloud/config") +def get_seeed_cloud_config(): + from .seeed_cloud_config import load_config + + return load_config().public_dict() + + +@app.post("/compute/seeed-cloud/config") +def save_seeed_cloud_config(payload: dict): + from .seeed_cloud_config import save_config + + try: + cfg = save_config( + api_url=str(payload.get("api_url") or ""), + web_url=str(payload.get("web_url") or ""), + token=str(payload.get("token") or ""), + ) + except ValueError as exc: + raise HTTPException(status_code=400, detail=str(exc)) from exc + return cfg.public_dict() + + +def _list_hf_jobs_hardware(api): + executor = concurrent.futures.ThreadPoolExecutor(max_workers=1) + future = executor.submit(api.list_jobs_hardware) + try: + return future.result(timeout=_HF_HARDWARE_TIMEOUT_SECONDS) + except concurrent.futures.TimeoutError: + logger.warning("list_jobs_hardware timed out after %.1fs", _HF_HARDWARE_TIMEOUT_SECONDS) + return None + except Exception as exc: + logger.warning("list_jobs_hardware failed: %s", exc) + return None + finally: + executor.shutdown(wait=False, cancel_futures=True) + + # ============================================================================ # SYSTEM ENDPOINTS # ============================================================================ diff --git a/lelab/train.py b/lelab/train.py index 6ee726e..d6da4b1 100644 --- a/lelab/train.py +++ b/lelab/train.py @@ -65,7 +65,7 @@ class TrainingRequest(BaseModel): env_type: str | None = None env_task: str | None = None eval_n_episodes: int = 10 - eval_batch_size: int = 50 + eval_batch_size: int = 10 eval_use_async_envs: bool = False # Policy-specific diff --git a/lelab/utils/hf_auth.py b/lelab/utils/hf_auth.py index b83e052..3195b71 100644 --- a/lelab/utils/hf_auth.py +++ b/lelab/utils/hf_auth.py @@ -13,6 +13,7 @@ # limitations under the License. import logging +import concurrent.futures import types from huggingface_hub import HfApi, get_token, login as hf_login, whoami @@ -21,6 +22,7 @@ logger = logging.getLogger(__name__) LOGIN_COMMAND = "hf auth login" +_WHOAMI_TIMEOUT_SECONDS = 4.0 # /whoami-v2 is heavily rate-limited (security). Share one HfApi across the # app so its in-process whoami cache (cache=True) actually hits โ€” otherwise @@ -51,11 +53,18 @@ def cached_whoami() -> dict | None: token = get_token() if not token: return None + executor = concurrent.futures.ThreadPoolExecutor(max_workers=1) + future = executor.submit(_WHOAMI_API.whoami, token=token, cache=True) try: - return _WHOAMI_API.whoami(token=token, cache=True) + return future.result(timeout=_WHOAMI_TIMEOUT_SECONDS) + except concurrent.futures.TimeoutError: + logger.info("whoami timed out after %.1fs", _WHOAMI_TIMEOUT_SECONDS) + return None except Exception as exc: logger.info("whoami failed: %s", exc) return None + finally: + executor.shutdown(wait=False, cancel_futures=True) def shared_hf_api() -> HfApi: @@ -72,22 +81,20 @@ def invalidate_whoami_cache() -> None: def handle_hf_auth_status() -> dict: - try: - info = whoami() - return { - "authenticated": True, - "username": info["name"], - "orgs": [o["name"] for o in info.get("orgs", [])], - "login_command": LOGIN_COMMAND, - } - except (LocalTokenNotFoundError, HfHubHTTPError, OSError) as e: - logger.info(f"HF auth check: not authenticated ({type(e).__name__})") + info = cached_whoami() + if info is None: return { "authenticated": False, "username": None, "orgs": [], "login_command": LOGIN_COMMAND, } + return { + "authenticated": True, + "username": info["name"], + "orgs": [o["name"] for o in info.get("orgs", [])], + "login_command": LOGIN_COMMAND, + } def handle_hf_login(token: str) -> dict: diff --git a/pyproject.toml b/pyproject.toml index f94d038..e5af645 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,6 +15,7 @@ dependencies = [ "websockets>=15.0.1", "uvicorn>=0.24.0", "psutil>=5.9.0", + "lelab-compute-seeed-cloud @ git+https://github.com/Seeed-Solution/lelab-compute-seeed-cloud.git", "lerobot[core_scripts,feetech,training] @ git+https://github.com/huggingface/lerobot.git@82dffde7fad11cba91f7916b050fbe7d7eea35ab", # Windows-only: real DirectShow camera names for /available-cameras so the # frontend can match a camera to its browser deviceId (issues #12, #16). diff --git a/tests/test_compute_providers.py b/tests/test_compute_providers.py new file mode 100644 index 0000000..586f889 --- /dev/null +++ b/tests/test_compute_providers.py @@ -0,0 +1,434 @@ +from __future__ import annotations + +import io +import json +import tarfile +from dataclasses import dataclass +from pathlib import Path + + +@dataclass(frozen=True) +class _RemoteMetrics: + current_step: int = 20 + total_steps: int = 100 + current_loss: float | None = 1.2 + current_lr: float | None = 0.0001 + grad_norm: float | None = 0.8 + eta_seconds: float | None = 120 + + +@dataclass(frozen=True) +class _RemoteJob: + id: str = "lerobot-job-1" + status: str = "SUCCEEDED" + gpu_type: str = "RTX 4090D" + policy_type: str = "act" + train_steps: int = 100 + artifact_url: str = "https://r2.example.com/model.tar.gz" + error_message: str = "" + created_at: str = "2026-06-07T08:37:30Z" + updated_at: str = "2026-06-07T08:40:01Z" + external_job_url: str = "https://gpu.example.com/jobs/lerobot-job-1" + metrics: _RemoteMetrics = _RemoteMetrics() + training_config: dict | None = None + target: dict | None = None + + def __post_init__(self): + if self.training_config is None: + object.__setattr__( + self, + "training_config", + { + "dataset_repo_id": "links7/soarm101", + "policy_type": self.policy_type, + "steps": self.train_steps, + "batch_size": 8, + }, + ) + if self.target is None: + object.__setattr__( + self, + "target", + {"provider": "seeed_cloud", "flavor": "rtx-4090d", "gpu_type": self.gpu_type}, + ) + + +@dataclass(frozen=True) +class _RemoteHistoryPoint: + step: int + loss: float | None = None + lr: float | None = None + grad_norm: float | None = None + + +class _Provider: + id = "seeed_cloud" + display_name = "Seeed Cloud Platform" + + def is_configured(self) -> bool: + return True + + def list_flavors(self): + return [ + { + "name": "rtx-4090", + "pretty_name": "Seeed RTX 4090", + "cpu": "", + "ram": "", + "accelerator": "RTX 4090", + "unit_cost_usd": 0.0, + "unit_label": "hour", + } + ] + + def list_jobs(self): + return [_RemoteJob()] + + def list_metrics_history(self, job_id: str): + assert job_id == "lerobot-job-1" + return [ + _RemoteHistoryPoint(step=10, loss=37.69, lr=0.00001, grad_norm=100.5), + _RemoteHistoryPoint(step=100, loss=4.124, lr=0.00001, grad_norm=105.453), + ] + + def list_logs(self, job_id: str): + assert job_id == "lerobot-job-1" + return [ + type("RemoteLog", (), {"content": "line 1", "created_at": "2026-06-07T08:37:30Z"})(), + type("RemoteLog", (), {"content": "INFO step:100 loss:4.124 grdn:105.453 lr:1.0e-05", "created_at": "2026-06-07T08:40:01Z"})(), + ] + + def download_artifact(self, job_id: str, destination): + assert job_id == "lerobot-job-1" + config = { + "type": "act", + "input_features": { + "observation.images.front": {"type": "VISUAL", "shape": [3, 480, 640]}, + }, + } + data = json.dumps(config).encode("utf-8") + path = Path(destination) + path.parent.mkdir(parents=True, exist_ok=True) + with tarfile.open(path, "w:gz") as archive: + info = tarfile.TarInfo("pretrained_model/config.json") + info.size = len(data) + archive.addfile(info, io.BytesIO(data)) + return path + + +class _UnconfiguredProvider(_Provider): + def is_configured(self) -> bool: + return False + + +class _ExternalRunner: + def __init__(self) -> None: + self.started = False + self.reattached_job_id = None + + def start(self, job_id: str, config, output_dir: str) -> None: + self.started = True + + def stop(self) -> None: + pass + + def is_running(self) -> bool: + return True + + def returncode(self) -> int | None: + return None + + def stream_log_lines(self): + return [] + + def wandb_run_url(self) -> str | None: + return None + + def external_job_id(self) -> str: + return "remote-job-123" + + def external_job_url(self) -> str: + return "https://gpu.example.com/jobs/remote-job-123" + + def reattach(self, job_id: str) -> None: + self.reattached_job_id = job_id + + +class _ExternalProvider(_Provider): + runner: _ExternalRunner | None = None + + def create_runner(self, metrics, log_file_path, target): + self.runner = _ExternalRunner() + return self.runner + + +class _RunningProvider(_ExternalProvider): + def list_jobs(self): + return [_RemoteJob(status="TRAINING_RUNNING")] + + +class _EntryPoint: + name = "seeed_cloud" + + def load(self): + return _Provider + + +class _EntryPoints: + def select(self, *, group: str): + if group == "lelab.compute_providers": + return [_EntryPoint()] + return [] + + +def test_discover_compute_providers_loads_module_factories(monkeypatch) -> None: + from lelab.compute_providers import discover_compute_providers + + monkeypatch.setenv("LELAB_COMPUTE_PROVIDER_MODULES", "tests.test_compute_providers:_Provider") + + providers = discover_compute_providers() + + assert [p.id for p in providers] == ["seeed_cloud"] + assert providers[0].display_name == "Seeed Cloud Platform" + + +def test_discover_compute_providers_loads_entry_points(monkeypatch) -> None: + import importlib.metadata + + from lelab.compute_providers import discover_compute_providers + + monkeypatch.delenv("LELAB_COMPUTE_PROVIDER_MODULES", raising=False) + monkeypatch.setattr(importlib.metadata, "entry_points", lambda: _EntryPoints()) + + providers = discover_compute_providers() + + assert [p.id for p in providers] == ["seeed_cloud"] + + +def test_job_registry_starts_external_provider_runner(monkeypatch, tmp_path) -> None: + from lelab.jobs import JobRegistry, JobTarget + from lelab.train import TrainingRequest + + monkeypatch.setenv("LELAB_COMPUTE_PROVIDER_MODULES", "tests.test_compute_providers:_ExternalProvider") + + registry = JobRegistry(tmp_path) + try: + record = registry.start( + TrainingRequest(dataset_repo_id="https://storage.example.com/so101.zip", policy_type="act", steps=100), + JobTarget(runner="external", provider="seeed_cloud", flavor="RTX 4090"), + ) + finally: + registry.shutdown() + + assert record.runner == "external" + assert record.external_provider == "seeed_cloud" + assert record.external_flavor == "RTX 4090" + assert record.external_job_id == "remote-job-123" + assert record.external_job_url == "https://gpu.example.com/jobs/remote-job-123" + + +def test_job_registry_starts_seeed_cloud_provider_runner(monkeypatch, tmp_path) -> None: + from lelab.jobs import JobRegistry, JobTarget + from lelab.train import TrainingRequest + + monkeypatch.setenv("LELAB_COMPUTE_PROVIDER_MODULES", "tests.test_compute_providers:_ExternalProvider") + + registry = JobRegistry(tmp_path) + try: + record = registry.start( + TrainingRequest(dataset_repo_id="links7/soarm101", policy_type="act", steps=100), + JobTarget(runner="seeed_cloud", flavor="rtx-4090"), + ) + finally: + registry.shutdown() + + assert record.runner == "seeed_cloud" + assert record.external_provider == "seeed_cloud" + assert record.external_flavor == "rtx-4090" + assert record.external_job_id == "remote-job-123" + + +def test_job_registry_reads_external_metrics_history(monkeypatch, tmp_path) -> None: + from lelab.jobs import JobRegistry + + monkeypatch.setenv("LELAB_COMPUTE_PROVIDER_MODULES", "tests.test_compute_providers:_Provider") + + registry = JobRegistry(tmp_path) + try: + record = registry.attach_external("seeed_cloud", "lerobot-job-1") + points = registry.read_metrics_history(record.id) + finally: + registry.shutdown() + + assert len(points) == 2 + assert points[0].step == 10 + assert points[0].loss == 37.69 + assert points[1].step == 100 + assert points[1].loss == 4.124 + + +def test_job_registry_reads_external_training_logs(monkeypatch, tmp_path) -> None: + from lelab.jobs import JobRegistry + + monkeypatch.setenv("LELAB_COMPUTE_PROVIDER_MODULES", "tests.test_compute_providers:_Provider") + + registry = JobRegistry(tmp_path) + try: + record = registry.attach_external("seeed_cloud", "lerobot-job-1") + logs = registry.read_persisted_logs(record.id) + finally: + registry.shutdown() + + assert len(logs) == 2 + assert logs[0].message == "line 1" + assert logs[1].message.endswith("lr:1.0e-05") + + +def test_job_registry_exposes_external_artifact_checkpoint(monkeypatch, tmp_path) -> None: + from lelab.jobs import JobRegistry + + monkeypatch.setenv("LELAB_COMPUTE_PROVIDER_MODULES", "tests.test_compute_providers:_Provider") + + registry = JobRegistry(tmp_path) + try: + record = registry.attach_external("seeed_cloud", "lerobot-job-1") + checkpoints = registry.list_checkpoints(record.id) + summary = registry.get_policy_config_summary(record.id, checkpoints[0].step) + finally: + registry.shutdown() + + assert len(checkpoints) == 1 + assert checkpoints[0].step == 20 + assert checkpoints[0].source == "external" + assert checkpoints[0].ref.startswith("seeed-cloud://seeed_cloud/lerobot-job-1/") + assert summary["policy_type"] == "act" + assert summary["image_features"] == {"front": {"height": 480, "width": 640}} + + +def test_runner_hardware_includes_configured_external_providers(monkeypatch) -> None: + from lelab import server + + monkeypatch.setenv("LELAB_COMPUTE_PROVIDER_MODULES", "tests.test_compute_providers:_Provider") + monkeypatch.setattr(server, "cached_whoami", lambda: None) + + body = server.get_runners_hardware() + + assert body["authenticated"] is False + assert body["providers"] == [ + { + "id": "seeed_cloud", + "display_name": "Seeed Cloud Platform", + "authenticated": True, + "flavors": [ + { + "name": "rtx-4090", + "pretty_name": "Seeed RTX 4090", + "cpu": "", + "ram": "", + "accelerator": "RTX 4090", + "unit_cost_usd": 0.0, + "unit_label": "hour", + "provider": "seeed_cloud", + "provider_label": "Seeed Cloud Platform", + } + ], + } + ] + + +def test_runner_hardware_includes_unconfigured_provider_flavor_catalog(monkeypatch) -> None: + from lelab import server + + monkeypatch.setenv("LELAB_COMPUTE_PROVIDER_MODULES", "tests.test_compute_providers:_UnconfiguredProvider") + monkeypatch.setattr(server, "cached_whoami", lambda: None) + + body = server.get_runners_hardware() + + assert body["providers"] == [ + { + "id": "seeed_cloud", + "display_name": "Seeed Cloud Platform", + "authenticated": False, + "flavors": [ + { + "name": "rtx-4090", + "pretty_name": "Seeed RTX 4090", + "cpu": "", + "ram": "", + "accelerator": "RTX 4090", + "unit_cost_usd": 0.0, + "unit_label": "hour", + "provider": "seeed_cloud", + "provider_label": "Seeed Cloud Platform", + } + ], + } + ] + + +def test_hub_jobs_includes_seeed_cloud_jobs_without_hf_login(monkeypatch) -> None: + from lelab import server + + monkeypatch.setenv("LELAB_COMPUTE_PROVIDER_MODULES", "tests.test_compute_providers:_Provider") + monkeypatch.setattr(server, "cached_whoami", lambda: None) + + body = server.list_hub_jobs() + + assert body["authenticated"] is True + assert body["models"] == [] + assert body["jobs"] == [ + { + "id": "lerobot-job-1", + "created_at": "2026-06-07T08:37:30Z", + "docker_image": "Seeed ยท ACT ยท lerobot-job-โ€ฆ", + "space_id": None, + "flavor": "RTX 4090D", + "status": {"stage": "COMPLETED", "message": None}, + "owner": "Seeed Cloud", + "url": "https://gpu.example.com/jobs/lerobot-job-1", + "provider": "seeed_cloud", + } + ] + + +def test_job_registry_attaches_seeed_cloud_remote_job(monkeypatch, tmp_path) -> None: + from lelab.jobs import JobRegistry + + monkeypatch.setenv("LELAB_COMPUTE_PROVIDER_MODULES", "tests.test_compute_providers:_RunningProvider") + + registry = JobRegistry(tmp_path) + try: + record = registry.attach_external("seeed_cloud", "lerobot-job-1") + same_record = registry.attach_external("seeed_cloud", "lerobot-job-1") + finally: + registry.shutdown() + + assert same_record.id == record.id + assert record.runner == "seeed_cloud" + assert record.state == "running" + assert record.config.dataset_repo_id == "links7/soarm101" + assert record.external_provider == "seeed_cloud" + assert record.external_flavor == "rtx-4090d" + assert record.external_job_id == "lerobot-job-1" + assert record.external_job_url == "https://gpu.example.com/jobs/lerobot-job-1" + assert record.metrics.current_step == 20 + assert record.metrics.total_steps == 100 + assert record.metrics.current_loss == 1.2 + + +def test_attach_provider_job_route_returns_local_record(monkeypatch, tmp_path) -> None: + from lelab import server + from lelab.jobs import JobRegistry + + monkeypatch.setenv("LELAB_COMPUTE_PROVIDER_MODULES", "tests.test_compute_providers:_Provider") + registry = JobRegistry(tmp_path) + monkeypatch.setattr(server, "job_registry", registry) + + try: + record = server.attach_provider_job("seeed_cloud", "lerobot-job-1") + finally: + registry.shutdown() + + assert record.runner == "seeed_cloud" + assert record.state == "done" + assert record.external_job_id == "lerobot-job-1" diff --git a/tests/test_packaging.py b/tests/test_packaging.py new file mode 100644 index 0000000..55ef59f --- /dev/null +++ b/tests/test_packaging.py @@ -0,0 +1,13 @@ +from __future__ import annotations + +import tomllib +from pathlib import Path + + +def test_lelab_fork_depends_on_seeed_cloud_plugin_by_default() -> None: + pyproject = tomllib.loads((Path(__file__).parents[1] / "pyproject.toml").read_text()) + + assert ( + "lelab-compute-seeed-cloud @ git+https://github.com/Seeed-Solution/lelab-compute-seeed-cloud.git" + in pyproject["project"]["dependencies"] + ) diff --git a/tests/test_record.py b/tests/test_record.py index 486eb95..6c8ebd9 100644 --- a/tests/test_record.py +++ b/tests/test_record.py @@ -70,6 +70,89 @@ def test_create_record_config_pins_dshow_on_windows(monkeypatch: pytest.MonkeyPa assert config.robot.cameras["wrist"].backend == Cv2Backends.DSHOW +def test_recording_status_disables_advance_while_stopping(monkeypatch) -> None: + from lelab import record + + monkeypatch.setattr(record, "recording_active", True) + monkeypatch.setattr(record, "recording_events", {"stop_recording": True, "exit_early": True}) + monkeypatch.setattr(record, "recording_config", None) + monkeypatch.setattr(record, "current_phase", "stopping") + + result = record.handle_recording_status() + + assert result["recording_active"] is True + assert result["current_phase"] == "stopping" + assert result["available_controls"]["stop_recording"] is False + assert result["available_controls"]["exit_early"] is False + assert result["available_controls"]["rerecord_episode"] is False + + +def test_recording_status_exposes_error_message(monkeypatch) -> None: + from lelab import record + + monkeypatch.setattr(record, "recording_active", False) + monkeypatch.setattr(record, "recording_config", None) + monkeypatch.setattr(record, "current_phase", "error") + monkeypatch.setattr(record, "session_end_elapsed_seconds", 2) + monkeypatch.setattr(record, "last_recording_info", {"success": False, "error": "camera failed"}) + + result = record.handle_recording_status() + + assert result["session_ended"] is True + assert result["error"] == "camera failed" + + +def test_recording_connect_uses_existing_calibration_input() -> None: + from lelab.record import _use_existing_calibration_input + + with _use_existing_calibration_input(): + assert input("Press ENTER to use provided calibration file") == "" + + +def test_bare_dataset_repo_id_gets_hf_namespace(monkeypatch) -> None: + from lelab import record + + monkeypatch.setattr(record, "cached_whoami", lambda: {"name": "links7"}) + + result = record._normalize_dataset_repo_id("soarm 101", resume=False) + + assert result.startswith("links7/soarm_101_") + + +def test_bare_dataset_repo_id_uses_local_namespace_without_hf(monkeypatch) -> None: + from lelab import record + + monkeypatch.setattr(record, "cached_whoami", lambda: None) + + result = record._normalize_dataset_repo_id("soarm_101", resume=False) + + assert result.startswith("local/soarm_101_") + + +def test_namespaced_dataset_repo_id_keeps_namespace(monkeypatch) -> None: + from lelab import record + + monkeypatch.setattr(record, "cached_whoami", lambda: {"name": "other"}) + + result = record._normalize_dataset_repo_id("links7/soarm 101", resume=False) + + assert result.startswith("links7/soarm_101_") + + +@pytest.mark.parametrize( + ("events", "should_rerecord"), + [ + ({"exit_early": False, "rerecord_episode": False}, False), + ({"exit_early": False, "_exit_early_triggered": True, "rerecord_episode": False}, False), + ({"exit_early": True, "rerecord_episode": True}, True), + ], +) +def test_recording_phase_rerecord_only_when_requested(events, should_rerecord) -> None: + from lelab.record import _recording_phase_should_rerecord + + assert _recording_phase_should_rerecord(events) is should_rerecord + + def test_build_camera_configs_uses_default_backend_when_unset() -> None: from lelab.record import _build_camera_configs from lerobot.cameras.configs import Cv2Backends diff --git a/tests/test_seeed_cloud_config.py b/tests/test_seeed_cloud_config.py new file mode 100644 index 0000000..e06622f --- /dev/null +++ b/tests/test_seeed_cloud_config.py @@ -0,0 +1,61 @@ +from __future__ import annotations + +import json + +from fastapi.testclient import TestClient + + +def test_seeed_cloud_config_api_persists_local_connection(monkeypatch, tmp_path) -> None: + from lelab import server + + config_path = tmp_path / "seeed-cloud.json" + monkeypatch.setenv("LELAB_SEEED_CLOUD_CONFIG_PATH", str(config_path)) + + client = TestClient(server.app) + response = client.post( + "/compute/seeed-cloud/config", + json={ + "api_url": "https://gpu.example.com/api", + "web_url": "https://gpu.example.com", + "token": "token-123", + }, + ) + + assert response.status_code == 200 + assert response.json() == { + "configured": True, + "api_url": "https://gpu.example.com/api", + "web_url": "https://gpu.example.com", + } + assert json.loads(config_path.read_text()) == { + "api_url": "https://gpu.example.com/api", + "web_url": "https://gpu.example.com", + "token": "token-123", + } + + saved = client.get("/compute/seeed-cloud/config") + assert saved.status_code == 200 + assert saved.json() == { + "configured": True, + "api_url": "https://gpu.example.com/api", + "web_url": "https://gpu.example.com", + } + + +def test_seeed_cloud_config_api_uses_env_defaults_without_saved_file(monkeypatch, tmp_path) -> None: + from lelab import server + + monkeypatch.setenv("LELAB_SEEED_CLOUD_CONFIG_PATH", str(tmp_path / "missing.json")) + monkeypatch.setenv("SEEED_CLOUD_API_URL", "http://127.0.0.1:5173/api") + monkeypatch.setenv("SEEED_CLOUD_WEB_URL", "http://127.0.0.1:5173") + monkeypatch.delenv("SEEED_CLOUD_TOKEN", raising=False) + + client = TestClient(server.app) + response = client.get("/compute/seeed-cloud/config") + + assert response.status_code == 200 + assert response.json() == { + "configured": False, + "api_url": "http://127.0.0.1:5173/api", + "web_url": "http://127.0.0.1:5173", + } diff --git a/tests/test_train.py b/tests/test_train.py index cd2fa12..588c256 100644 --- a/tests/test_train.py +++ b/tests/test_train.py @@ -37,6 +37,17 @@ def test_minimal_request_yields_well_formed_argv() -> None: assert _arg_value(cmd, "--output_dir") == "/tmp/out" +def test_minimal_request_eval_defaults_are_valid_for_lerobot() -> None: + from lelab.train import TrainingRequest, build_training_command + + req = TrainingRequest(dataset_repo_id="lerobot/pusht") + cmd = build_training_command(req, output_dir="/tmp/out") + + eval_n_episodes = int(_arg_value(cmd, "--eval.n_episodes")) + eval_batch_size = int(_arg_value(cmd, "--eval.batch_size")) + assert eval_batch_size <= eval_n_episodes + + def test_optional_dataset_fields_only_present_when_set() -> None: from lelab.train import TrainingRequest, build_training_command diff --git a/uv.lock b/uv.lock new file mode 100644 index 0000000..f33199c --- /dev/null +++ b/uv.lock @@ -0,0 +1,3173 @@ +version = 1 +revision = 3 +requires-python = ">=3.12" +resolution-markers = [ + "python_full_version >= '3.14' and sys_platform == 'linux'", + "python_full_version == '3.13.*' and sys_platform == 'linux'", + "python_full_version < '3.13' and sys_platform == 'linux'", + "python_full_version >= '3.14' and sys_platform != 'linux'", + "python_full_version == '3.13.*' and sys_platform != 'linux'", + "python_full_version < '3.13' and sys_platform != 'linux'", +] + +[[package]] +name = "accelerate" +version = "1.13.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "huggingface-hub" }, + { name = "numpy" }, + { name = "packaging" }, + { name = "psutil" }, + { name = "pyyaml" }, + { name = "safetensors" }, + { name = "torch" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/ca/14/787e5498cd062640f0f3d92ef4ae4063174f76f9afd29d13fc52a319daae/accelerate-1.13.0.tar.gz", hash = "sha256:d631b4e0f5b3de4aff2d7e9e6857d164810dfc3237d54d017f075122d057b236", size = 402835, upload-time = "2026-03-04T19:34:12.359Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7e/46/02ac5e262d4af18054b3e922b2baedbb2a03289ee792162de60a865defc5/accelerate-1.13.0-py3-none-any.whl", hash = "sha256:cf1a3efb96c18f7b152eb0fa7490f3710b19c3f395699358f08decca2b8b62e0", size = 383744, upload-time = "2026-03-04T19:34:10.313Z" }, +] + +[[package]] +name = "aiohappyeyeballs" +version = "2.6.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/33/c6/61a2d7b7572279226bb2e7f61d7a19ca7c90da0329c93fa0d560cbf288d8/aiohappyeyeballs-2.6.2.tar.gz", hash = "sha256:e202810ee718bd01fc6ef49e8ea53d023d5cb6b581076d7925aa499fa55dbe64", size = 22591, upload-time = "2026-05-20T15:12:24.631Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/5f/fc/a7bf5b6e4e617b45f90f2d9d2a68519c249c81dd4fc2658c7a2a61c4f4b7/aiohappyeyeballs-2.6.2-py3-none-any.whl", hash = "sha256:4708045e2d7a6c6bdf8aafa8ed39649eaf926a4543b54560659129e3365953c4", size = 15062, upload-time = "2026-05-20T15:12:23.328Z" }, +] + +[[package]] +name = "aiohttp" +version = "3.14.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "aiohappyeyeballs" }, + { name = "aiosignal" }, + { name = "attrs" }, + { name = "frozenlist" }, + { name = "multidict" }, + { name = "propcache" }, + { name = "typing-extensions", marker = "python_full_version < '3.13'" }, + { name = "yarl" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/ee/ab/93ce242f899b68c51b0578c027aafa791ab3614cb9345fa5d37b5f5c8e3e/aiohttp-3.14.0.tar.gz", hash = "sha256:2882de819734c715fd1b9c11c97e09fa020d14438203d1d354d8ed1702791c9b", size = 7940674, upload-time = "2026-06-01T19:41:02.763Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/89/97/2b6889bfb6b6847520d50d95eb8c4307a45e28aaca39faf4a9454b3d1b2f/aiohttp-3.14.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:b29518c9c2ec7e373e68259206a137c7f4f5439c58baaec4b5ab3ab799850a4e", size = 750194, upload-time = "2026-06-01T19:37:48.164Z" }, + { url = "https://files.pythonhosted.org/packages/21/e2/62634b7fff918ed98c3c6b2f0e70d520f7f28846cb412d451b04354c6459/aiohttp-3.14.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:dbec68ce61b64cb73cab4d33df9433427b1713c8bcccb181dce695c1b6f8e87c", size = 506966, upload-time = "2026-06-01T19:37:50.014Z" }, + { url = "https://files.pythonhosted.org/packages/dd/fb/5ce075150828c797a5106f1c2fb26034e709d4289b9d2bf8b07f1e59fac6/aiohttp-3.14.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:3cdf534aa455593e589302990c5097aa5c92c06c4262a20da22934f9186a5fff", size = 507527, upload-time = "2026-06-01T19:37:51.96Z" }, + { url = "https://files.pythonhosted.org/packages/01/d5/405a0ae4e6b081754a3609c1c97c63a950e000a2def16046f1e736933a0e/aiohttp-3.14.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:cb6c657104393b5fbff01a5f59b2023db74058a8077d94475d6c25d03882a108", size = 1762420, upload-time = "2026-06-01T19:37:53.839Z" }, + { url = "https://files.pythonhosted.org/packages/ae/1d/e05a7c896b15a6bc6fb8fc5319eb437861c2c49c34559ef928add6590315/aiohttp-3.14.0-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:46fbbec4e4fab7428d4396a3823f9320e4560aa3113b89eeebce712c27c9ed5a", size = 1733672, upload-time = "2026-06-01T19:37:55.791Z" }, + { url = "https://files.pythonhosted.org/packages/cc/22/a72f7c459e195fa41bf4f7abd1f925b91fe91f8097e51c654229ba144a33/aiohttp-3.14.0-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:2c2c7e05dd5335b298085abf45ddf98673934c3ee1c083d0b9ea13d4186ad500", size = 1805064, upload-time = "2026-06-01T19:37:57.931Z" }, + { url = "https://files.pythonhosted.org/packages/80/50/e85bdaba0be59ca4838005ebfef4048fcdd5f35a02b07057a9a123394440/aiohttp-3.14.0-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:3c7139100fbaae76515b73051d8f0aa3a3ff02e415eec8a8eee8e2223d9ba955", size = 1902125, upload-time = "2026-06-01T19:38:00.225Z" }, + { url = "https://files.pythonhosted.org/packages/19/d8/51de5c6b971c27bb1ef620293b8d1ca611ec78736b34b3f6ccf68e4c8785/aiohttp-3.14.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:78d6f9286a629ce52728430afe18f8ed2b6c39a1fddb3802d7244b9983910ad2", size = 1783112, upload-time = "2026-06-01T19:38:02.641Z" }, + { url = "https://files.pythonhosted.org/packages/73/ae/b4402bfde77e43dfb1b6ccff83c7b7ab63ed06b50c4754f0c5423fb374fe/aiohttp-3.14.0-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:cc3c3e12cdaeb92d7dcf13db00e9f6b1956b910e47256e696df1cfa946d02159", size = 1586356, upload-time = "2026-06-01T19:38:04.637Z" }, + { url = "https://files.pythonhosted.org/packages/bc/05/750a3265ca4dc54a460bd0cb1121a8f2ce9171fce4a135fb47ea7fd594d2/aiohttp-3.14.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:4d6a998191f5ebe3b8c28463ff72bc030250008b3193c402464efadd08b5ca02", size = 1723119, upload-time = "2026-06-01T19:38:06.713Z" }, + { url = "https://files.pythonhosted.org/packages/37/01/8c0812c50b3b1b1c37b323bf170d6be8847a8f234060485b7d1e71953f60/aiohttp-3.14.0-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:0fc2b75ae8d169d853be2862d960be8550da6c5c65711d5476407eb3fdb006bd", size = 1757216, upload-time = "2026-06-01T19:38:08.736Z" }, + { url = "https://files.pythonhosted.org/packages/47/2a/50fb98028a26887cbe48dcc1df92a90825615bc73b5584301304090cded8/aiohttp-3.14.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:16eee56bcc72d04600bc56c1759982c2385ec0b41d3fd3521f836bf64a0957ef", size = 1770500, upload-time = "2026-06-01T19:38:11.111Z" }, + { url = "https://files.pythonhosted.org/packages/bd/32/0ffd598a2fa2b9a423daf242e700cfdabda35d6e602394ad9ae58972c1c7/aiohttp-3.14.0-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:5a2e7ca615c3ddc15b82687e05a624e5f5cba3f1d6c20cb81172d70ea498451e", size = 1576224, upload-time = "2026-06-01T19:38:13.391Z" }, + { url = "https://files.pythonhosted.org/packages/0b/f9/b9fc381dd9b66afb33f2634c40e229d106467be0afcabe79648631ab6712/aiohttp-3.14.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:f0b7b8bbbec3ce9467ee0ebe334622fd90624f593edd3136c567811453fc4fae", size = 1794252, upload-time = "2026-06-01T19:38:15.498Z" }, + { url = "https://files.pythonhosted.org/packages/a8/fb/05d9214c975f23225a8cd5c439325e338c7c377b315480ef3871db51f54e/aiohttp-3.14.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:5ba10966d4f03dd96a14365be4b8e37c327c76f11c3ca867116966cdd9f98066", size = 1760193, upload-time = "2026-06-01T19:38:17.624Z" }, + { url = "https://files.pythonhosted.org/packages/d9/4b/02992fc4fb9e1b6673ee3f888a8e587a6447afda1f6f4aca776c148c2876/aiohttp-3.14.0-cp312-cp312-win32.whl", hash = "sha256:101df7779c80c0636014a6b2c6642acd3efb5b355d48347c9d7dfb720aee9430", size = 448650, upload-time = "2026-06-01T19:38:19.545Z" }, + { url = "https://files.pythonhosted.org/packages/39/e9/246532214c3abda518477cbaaf16d420295ad8effa5233844cbb38f299ab/aiohttp-3.14.0-cp312-cp312-win_amd64.whl", hash = "sha256:b0a5747586d4467efd1f932710b269131c9717a872dce082cd92a00c1c13123a", size = 476145, upload-time = "2026-06-01T19:38:21.505Z" }, + { url = "https://files.pythonhosted.org/packages/2b/c3/63f8c20090048915711598b0adf475b149216d736157961de06480a45b15/aiohttp-3.14.0-cp312-cp312-win_arm64.whl", hash = "sha256:5f1c5be60add78fabb4aacd13c5a348ae79d2fcbfc7fa78da8f1eb192273b370", size = 444250, upload-time = "2026-06-01T19:38:24.027Z" }, + { url = "https://files.pythonhosted.org/packages/21/61/d11f7d9a3144bffe825247d6367cd93053666da50b94707c9129c78868d5/aiohttp-3.14.0-cp313-cp313-android_21_arm64_v8a.whl", hash = "sha256:25400d710641a8040bf022a8a99f579e581ffa1c5bd42c33255d7d6f3957c127", size = 502399, upload-time = "2026-06-01T19:38:25.955Z" }, + { url = "https://files.pythonhosted.org/packages/4f/9b/a7e317625d36356844f8bb022cabd305b541f968856cc3c2e0b58e53ee6e/aiohttp-3.14.0-cp313-cp313-android_21_x86_64.whl", hash = "sha256:c5492b9929826e07cc3fcb9739ae87aab05dff6b5e67a9b73fd1700c6d008981", size = 510068, upload-time = "2026-06-01T19:38:27.828Z" }, + { url = "https://files.pythonhosted.org/packages/11/41/cc2d2cfbfbdc3126ba258f3cd27d1ac8a33492ae3c35a4583ee21f0ba7f1/aiohttp-3.14.0-cp313-cp313-ios_13_0_arm64_iphoneos.whl", hash = "sha256:3366751d68d237c621264233a32f3078bbc21b7904ab90a77e03d21390c742c6", size = 481670, upload-time = "2026-06-01T19:38:29.836Z" }, + { url = "https://files.pythonhosted.org/packages/3c/07/381f4023c3b08cb616e520f566d8c58957abad54e56441d41fe67cfb0195/aiohttp-3.14.0-cp313-cp313-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:57ea07d28695a7a40304d42251892a8df765e5588c10ee32afeddcd5df33c0a2", size = 487591, upload-time = "2026-06-01T19:38:31.704Z" }, + { url = "https://files.pythonhosted.org/packages/fb/4d/4506fdb7a022bdf70011a3bbb4ca00c5c570026ef6a3c5bd7bc70c39089c/aiohttp-3.14.0-cp313-cp313-ios_13_0_x86_64_iphonesimulator.whl", hash = "sha256:076cb014191ae2e65d949e1ad01f1dcfe33e32789b5172510f3e79c79fc04d50", size = 496503, upload-time = "2026-06-01T19:38:33.6Z" }, + { url = "https://files.pythonhosted.org/packages/ef/7d/c814111e04894a45d9e2defc94443879a6f118d9633d5fedfe6e2e8af5f0/aiohttp-3.14.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:2f3fc37054564dee64a855b5b092d87ec35dcddfaabf7dacb1c8a2b1f83dc0a9", size = 745870, upload-time = "2026-06-01T19:38:36.013Z" }, + { url = "https://files.pythonhosted.org/packages/c6/ee/80eee0efddfe187e7cd05027086b7ce1c0e492e82a4eda58f5c5543a44a0/aiohttp-3.14.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:8fcaef74d2ab0f607d7ff85a0d15e21bb5a258c4a58df1908396eb50d7f4ed3c", size = 505588, upload-time = "2026-06-01T19:38:38.282Z" }, + { url = "https://files.pythonhosted.org/packages/d6/f8/0f28f04eef75d52fc9c715dde7ce9c0abb810fd20cfeb0fea7afd2ab1e98/aiohttp-3.14.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:e4c01b0bfc6209590960e68eac083cd22d5d87c21f974dd6208cafa5d3542bc8", size = 504492, upload-time = "2026-06-01T19:38:40.611Z" }, + { url = "https://files.pythonhosted.org/packages/ff/db/44c755232085545065c94378dfce38641b1aee647f4939fcd32f5b32e719/aiohttp-3.14.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f12eb7896e81caf403a2b18c9406426f1207361e7239c057ab29c076d4257e83", size = 1752111, upload-time = "2026-06-01T19:38:42.682Z" }, + { url = "https://files.pythonhosted.org/packages/5e/6a/42e030a46743841414402a3b00cd3d78419055e86c66fb5822c14b5abfc6/aiohttp-3.14.0-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:6c79a044cacf360ec46738d863d2f41c9300d2a06ef4a7402ea0df306a350e61", size = 1729674, upload-time = "2026-06-01T19:38:44.79Z" }, + { url = "https://files.pythonhosted.org/packages/34/26/3199beb415202e3108e7b83ecebe10914d806d33fb9860c3e4aa60a19be3/aiohttp-3.14.0-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:85e0675f47be4eff0636bf88c02140ea89168ae0df3ff1f3f464e9de9610d277", size = 1798808, upload-time = "2026-06-01T19:38:47.01Z" }, + { url = "https://files.pythonhosted.org/packages/bd/94/b9b6fcf0ee17c21d0d19fb8c22bf83ad18f82e702a9c3bd901a868f5e446/aiohttp-3.14.0-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:7b33e751cab03fdc960095b1e326cb5a03f5ee577d6ded59f3d1c100f8668882", size = 1891921, upload-time = "2026-06-01T19:38:49.233Z" }, + { url = "https://files.pythonhosted.org/packages/c5/a3/3800dbd095cb2bb165a7ea5d94d790914677e27f45638c7d80e3f34c8945/aiohttp-3.14.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:26d9224c6dd7f5c749aba4f61315a894601448b28d94d12f4dea0903e26d2096", size = 1777241, upload-time = "2026-06-01T19:38:52.04Z" }, + { url = "https://files.pythonhosted.org/packages/21/2a/45be91ad1b860508557448d4cc2e165a2ee68dd865657b73bf66cc5a00fb/aiohttp-3.14.0-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:6281aecdf2732940f4fe06bd6adec5ae4d59b78b080b8e3a6b81467301010988", size = 1579554, upload-time = "2026-06-01T19:38:54.508Z" }, + { url = "https://files.pythonhosted.org/packages/b4/3d/dc94df99ed1511fdf28314f722643ed334112643cab00223577085e788c4/aiohttp-3.14.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:23e8314e7aed8576fbe33314d218bd81447a3adbc91dc36f1163bf583cd3084c", size = 1714864, upload-time = "2026-06-01T19:38:56.788Z" }, + { url = "https://files.pythonhosted.org/packages/ae/e4/1f1c8acbb3acd5c8f795473b92c9c3d44eb60a5692c6104256c8a1c83a0c/aiohttp-3.14.0-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:3b54fbff46127aeafdd764cecd0d99fa2f24a0e37ea5c18a7c3a4ac450df1db3", size = 1749803, upload-time = "2026-06-01T19:38:59.367Z" }, + { url = "https://files.pythonhosted.org/packages/0b/c8/c45ea6e7ed84cebba939b9c334498a045ba19d79c61b0110df5f21580de3/aiohttp-3.14.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:b27d89af91a555f58e08e4902dbcbc48862fd40095720ca705990476bd93b7ac", size = 1765023, upload-time = "2026-06-01T19:39:01.651Z" }, + { url = "https://files.pythonhosted.org/packages/a8/a1/a932941784432962fe390e1066823aaef64b4e5ac9fa595df57b5fe472a9/aiohttp-3.14.0-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:25d2326a4967bf705a9f9913a13005e93b6020ad8a9f6bd6bd78850d5171332e", size = 1571671, upload-time = "2026-06-01T19:39:04.044Z" }, + { url = "https://files.pythonhosted.org/packages/b0/01/e1280feac522597a4d46eb67a0cdfa053cfae263033030b761ab146f29fb/aiohttp-3.14.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:a1d209375c503472b3c0a340cdf3c55fcd82e84b46dda7caeaced59faba373ec", size = 1789904, upload-time = "2026-06-01T19:39:06.294Z" }, + { url = "https://files.pythonhosted.org/packages/fa/10/ab28818262f4d26bdb47ed5f1fc7999b69e2fc6e0370b02d0f49011f45ea/aiohttp-3.14.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:666c7c5036df57b693026398b69b41874a1931ac5b3485fd910e57bfac253869", size = 1754516, upload-time = "2026-06-01T19:39:08.788Z" }, + { url = "https://files.pythonhosted.org/packages/af/cc/c122eabd7a1b7e0c9bbdd6be60e4715905b858399145d9df872bb94f1427/aiohttp-3.14.0-cp313-cp313-win32.whl", hash = "sha256:23f094a1ef64823fd35854ddf5c7a80a078162f37f9d2f7c6142b51a6affa456", size = 448656, upload-time = "2026-06-01T19:39:11.171Z" }, + { url = "https://files.pythonhosted.org/packages/41/a5/bab07d79848a00eedd8ed979ccb302aaea3ac6eb9fa16bd0ed87135869b4/aiohttp-3.14.0-cp313-cp313-win_amd64.whl", hash = "sha256:e03abdaa17d553f17e1d1d06bb266b3970106c78051d06795723e748d8e49d11", size = 475803, upload-time = "2026-06-01T19:39:13.439Z" }, + { url = "https://files.pythonhosted.org/packages/d1/a0/f03ade8566c153666a3871afccbedf6d99911da006325e1fc6cf72a2de99/aiohttp-3.14.0-cp313-cp313-win_arm64.whl", hash = "sha256:acdb400538cf4769543548bb5d1eb23d39bed4f96554a6078cb728c7cb2c268b", size = 443889, upload-time = "2026-06-01T19:39:15.945Z" }, + { url = "https://files.pythonhosted.org/packages/28/03/5f36ab196a88ba5e9648ae5643e6531e67a3a8c0e96f9c6510ff41540fec/aiohttp-3.14.0-cp314-cp314-android_24_arm64_v8a.whl", hash = "sha256:363ef9e91014e7891679bfb2ac0a7c6ea93435dbbfd10ecf41b9f06fcf506c5f", size = 503330, upload-time = "2026-06-01T19:39:18.195Z" }, + { url = "https://files.pythonhosted.org/packages/2c/ce/8b49ec2f30f68e02f314f4832186cd45e583360a5a386058be36855d23b6/aiohttp-3.14.0-cp314-cp314-android_24_x86_64.whl", hash = "sha256:884a4edbdad77be9d0ef36142c8b504351b170df0bf62b51e784fadabf311c42", size = 509822, upload-time = "2026-06-01T19:39:20.396Z" }, + { url = "https://files.pythonhosted.org/packages/1a/fe/6edbf5d39bf29322b6816365b17ed8ede4dace164a3aea1abcd30110eb78/aiohttp-3.14.0-cp314-cp314-ios_13_0_arm64_iphoneos.whl", hash = "sha256:70ea956f6cc4a37620966b56c2e205d88ca3e6d85ec063277e414b1035cddad3", size = 483329, upload-time = "2026-06-01T19:39:22.607Z" }, + { url = "https://files.pythonhosted.org/packages/1b/5a/fae531bdbc6456fb6241f46b7b81e4d8a0dd3fc09118a0055dc7141ac1ec/aiohttp-3.14.0-cp314-cp314-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:ea3b9806c89f61da22fddf1f12dd524fb368e5e28f1261fbdafe5c3cd8ce893b", size = 489502, upload-time = "2026-06-01T19:39:24.881Z" }, + { url = "https://files.pythonhosted.org/packages/36/f4/48a7b0414db7fed77a03d5dde34508c026afd83510ab6bca08c313855776/aiohttp-3.14.0-cp314-cp314-ios_13_0_x86_64_iphonesimulator.whl", hash = "sha256:a071be341c2bd9b0188e62d173509f024e0a35b1c342c53c50f8daaeda8c3bd8", size = 497357, upload-time = "2026-06-01T19:39:27.197Z" }, + { url = "https://files.pythonhosted.org/packages/75/75/e85a13a370acc007fca5feb1fd1b88ac2d8426e6dadd625479b7cadd55a3/aiohttp-3.14.0-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:198cfe61bf253b19da1fb3e0fa122249dc4f14c12709493fed8054aa0411cc76", size = 750898, upload-time = "2026-06-01T19:39:29.563Z" }, + { url = "https://files.pythonhosted.org/packages/9e/e4/3d637f800c724eff0e2bed64df72557444482366fd0a35b0cec0e6968f6c/aiohttp-3.14.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:9dc203d6ce6b9106d54e2a93f41dfdfebfbca2d99962ba503bfd3e5921a6549e", size = 506986, upload-time = "2026-06-01T19:39:31.872Z" }, + { url = "https://files.pythonhosted.org/packages/1d/df/35161f3598bf7501d2b2a805b41ab4f45a2e34150c421bcb4ef8c0d281a7/aiohttp-3.14.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:9e19d17ab02bf16832a2c8c0d55a486792c5b1645665652ee9531aebcc30cb72", size = 508033, upload-time = "2026-06-01T19:39:34.137Z" }, + { url = "https://files.pythonhosted.org/packages/e5/39/b36e5d3d31e850fb4691dd3e941684ac490a2559249f6fa634b6b0fdf020/aiohttp-3.14.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d925fba0c14d5b498a8028b0107beebdfd16c5d48d702ff54f879cb017aaaca3", size = 1746213, upload-time = "2026-06-01T19:39:36.654Z" }, + { url = "https://files.pythonhosted.org/packages/b1/28/24e1409e605a9aa5d84abe0e2acb365354b70ae56d40948101cabe3341ab/aiohttp-3.14.0-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:d33e61021222ce7f9792bcac870d6f58d8adfceda33ab857b01264f4560f2c5f", size = 1705862, upload-time = "2026-06-01T19:39:38.968Z" }, + { url = "https://files.pythonhosted.org/packages/8c/d0/e5eb3ff1daeaf644c7e36a957517672494122628e067c38b263fa04eda77/aiohttp-3.14.0-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:44eca38755d0105bb32f47d085f5dd449846a449e1245fc105889e3279dcf8e3", size = 1798909, upload-time = "2026-06-01T19:39:41.334Z" }, + { url = "https://files.pythonhosted.org/packages/d3/ba/8943f906f0570342886ababb9a722a44e360f786a028c5e0b0e29e3f735b/aiohttp-3.14.0-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:f13087e06f68fea4941c21a0c541c00553aa16e4f8fd7bbe2b198df761e964d6", size = 1868892, upload-time = "2026-06-01T19:39:43.807Z" }, + { url = "https://files.pythonhosted.org/packages/3a/05/27df32c844b2156e1675a8d8ec22d963e3c8ba469ed7ceb1863320c7b521/aiohttp-3.14.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ff82be7f1ef73634cb77890a770743239bc3d487b848669be1c599889336dc0a", size = 1751659, upload-time = "2026-06-01T19:39:46.398Z" }, + { url = "https://files.pythonhosted.org/packages/7f/62/da182e5910ab912b2e88aa919b61a16046a37a95714a5795b02eb57b2d18/aiohttp-3.14.0-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:a150c0875ac8fd87f1c398650841308a30d65facf7416b12dbdb9cfdcbe5a48c", size = 1578775, upload-time = "2026-06-01T19:39:48.902Z" }, + { url = "https://files.pythonhosted.org/packages/66/e3/53c67097e8a5ce98625e91e3fa7f43c9c6940de680345d03b3509a72a078/aiohttp-3.14.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:edc01ea4e1ec5a1649a28866262bf24195889ff7b27bdd947029a6086741de9b", size = 1710090, upload-time = "2026-06-01T19:39:51.392Z" }, + { url = "https://files.pythonhosted.org/packages/dd/55/0e2732ca598c7a4dfe8a775662376d0ca2977cb1030e48386d4da5d9a456/aiohttp-3.14.0-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:540632bf882ff8fc88f2e1697be0761578e89e0d79fb4a8a6d65dc5da7e729d4", size = 1715016, upload-time = "2026-06-01T19:39:53.807Z" }, + { url = "https://files.pythonhosted.org/packages/5a/96/f0b73730798c9ca525afc30b39f1f81bbe24e245d9654c54d3b39d63212d/aiohttp-3.14.0-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:860a86bc2c80237f5dff52edcf427e10a8d8352271fd84845429a3e60199e02c", size = 1763810, upload-time = "2026-06-01T19:39:56.31Z" }, + { url = "https://files.pythonhosted.org/packages/71/cc/11acb6c4518f448323405a7312b6f255d0f974a34373ad1db7633c4aadc8/aiohttp-3.14.0-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:5cbd50e6a50d6b99283a826b18cbdebf65b0797689a7535cb0e9dd37be0f63c3", size = 1573064, upload-time = "2026-06-01T19:39:58.718Z" }, + { url = "https://files.pythonhosted.org/packages/de/2d/28c31dde0a7dc98c0ee7d0da2ddcec3f7688c4fc131e5989e278d0c03c0a/aiohttp-3.14.0-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:20144819e99db593e22bbd2f3f2691a5e149f879142d6b8670254708853ff4fb", size = 1775765, upload-time = "2026-06-01T19:40:01.195Z" }, + { url = "https://files.pythonhosted.org/packages/b8/69/155c4ef3aec96417d47024800472b33b16c5d8a665371dcd044c2afdf25d/aiohttp-3.14.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:26b6d79aa54cb4ed50cc7d41ed14e99e0f1fc8e7c2d42f2e05b37aea897b2b52", size = 1733716, upload-time = "2026-06-01T19:40:03.631Z" }, + { url = "https://files.pythonhosted.org/packages/5f/44/6126116fd8a316b712bb615660b855c78466bb67ba1bb1742427eafcf7ac/aiohttp-3.14.0-cp314-cp314-win32.whl", hash = "sha256:106ed074a856f3e21d186b8579e2c8afb6da598e267cdaab01059e13db2fc44d", size = 453684, upload-time = "2026-06-01T19:40:06.277Z" }, + { url = "https://files.pythonhosted.org/packages/a2/d7/eff4c58a88c5cac5e38b55f44fb8a6d3929c3cbd77356e383e094d3220bd/aiohttp-3.14.0-cp314-cp314-win_amd64.whl", hash = "sha256:4f770846edae8f00ecc57af825bce811f787f87a7dcf0e90d191790efe5b31f7", size = 481758, upload-time = "2026-06-01T19:40:08.653Z" }, + { url = "https://files.pythonhosted.org/packages/d7/ed/17b5bd9fbcb46e688f02e572f517754a9a75831e7b54702f027761dc4fa5/aiohttp-3.14.0-cp314-cp314-win_arm64.whl", hash = "sha256:acf1581c4f21ed4b80a2dded504d87b055a071a84d5737ea966435f768275ac6", size = 450557, upload-time = "2026-06-01T19:40:11.03Z" }, + { url = "https://files.pythonhosted.org/packages/12/34/6180103ce9aabc8ebff3f7bb55a1228ffe60f61042823031d9692cb7b101/aiohttp-3.14.0-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:6aa1a40f9cbb3da9f80714c5966b8946c21e6a2530d809b9498b33161e3c8733", size = 787878, upload-time = "2026-06-01T19:40:13.401Z" }, + { url = "https://files.pythonhosted.org/packages/92/e9/08954a40e8b7baa3d8beadd2b074b186e9b1e9c8ddabc288678a6265de50/aiohttp-3.14.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:b62af5a8cc96a194eaa01a9ed7b34a3ffa58d3d8daaa1a0d7a749353ad12d228", size = 524400, upload-time = "2026-06-01T19:40:15.972Z" }, + { url = "https://files.pythonhosted.org/packages/08/6a/b5965a634ac4d5ba99a463314cf4ab214ca073fcdc38a15e0294273701fc/aiohttp-3.14.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:6eb63b1417efaf7d1002a6ad034a40d44376afcc16508a57f8e74b49ad26a095", size = 527904, upload-time = "2026-06-01T19:40:18.28Z" }, + { url = "https://files.pythonhosted.org/packages/06/b4/932bcdd850c354d9bcca30f360e475d7852e30413fbbd44b182782ed5432/aiohttp-3.14.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c20b9ad156a79eb97be5cf9e069eec01d2f0dc8472ffbd75299a8b2d4c2cbbde", size = 1912162, upload-time = "2026-06-01T19:40:20.825Z" }, + { url = "https://files.pythonhosted.org/packages/c6/85/ce79bab0310d2e3fd2d7bc7e44412abeff7c8338f8a21dd0f2f1714989e5/aiohttp-3.14.0-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:40ae7b0642c25632c7eabc4a04754012691864d2a1b93becf7cddb76027b838a", size = 1778813, upload-time = "2026-06-01T19:40:23.726Z" }, + { url = "https://files.pythonhosted.org/packages/05/54/ba62ac2d1bc87e010aad23751e383b8794e45d931df67677313a2da78823/aiohttp-3.14.0-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:95f5217e76a046b9f228a101717ef8d42b1eb3d9d196d15202db5bf41df88936", size = 1899969, upload-time = "2026-06-01T19:40:26.406Z" }, + { url = "https://files.pythonhosted.org/packages/dc/82/7cc7907725d83a19f31551334061e1ab8e108b1d7ac52632a2a844a4acb5/aiohttp-3.14.0-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:1a4a9f17e85b80878c176695c1998c790e83731d8271881e5d356488652a1f9e", size = 1991771, upload-time = "2026-06-01T19:40:29.061Z" }, + { url = "https://files.pythonhosted.org/packages/d0/1c/a57de71a4508c93a830b77c28af3d08cd97f606dedfc6b94275347744508/aiohttp-3.14.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:145262119b07d7f95abc1839add35ba2bfc84551d4b4660ca11542c0b215455b", size = 1868606, upload-time = "2026-06-01T19:40:31.843Z" }, + { url = "https://files.pythonhosted.org/packages/9c/ae/3839726cd49150a53ed340cc24ce5ba09d4c2117020ef9d45542bec5eb2f/aiohttp-3.14.0-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:49a33ded29b0b2fa7a367a02cf0fb89af602bb87542a16177ec8ce1c9c51d12a", size = 1665437, upload-time = "2026-06-01T19:40:35.01Z" }, + { url = "https://files.pythonhosted.org/packages/35/1e/c237923232c7da7f0392ea25d89fc5e60c0e93f685f4ebca8e7bcdd5271c/aiohttp-3.14.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:2cc736a9c9fc2bc4dd71fd404815741b6573df27c3f985948ec4076989ac57de", size = 1834090, upload-time = "2026-06-01T19:40:37.733Z" }, + { url = "https://files.pythonhosted.org/packages/98/02/a5a7a2524f92d3911761b405a7c067c751891942144adc13e2ad79611e39/aiohttp-3.14.0-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:b4141a3e5342ee3053a9cab54d25b64ed28289c1041e4c54b3d99839314d90ce", size = 1816907, upload-time = "2026-06-01T19:40:40.46Z" }, + { url = "https://files.pythonhosted.org/packages/fa/76/a8b9f0d09234d516af9f2d7dd715557f33b5da3b0b56ead41d1170e86e3c/aiohttp-3.14.0-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:e30871b2d58996cb81aac52d2b1d15ac05257131ef0f90f18c2115a380fbfe7c", size = 1840382, upload-time = "2026-06-01T19:40:43.48Z" }, + { url = "https://files.pythonhosted.org/packages/c9/8e/140e715a0a4bbc211979ea30ec8396ad2ed5bf90ab87d8058fc4668b1923/aiohttp-3.14.0-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:667b881d083ccae3900ea5a241e17e5007ca78844c53ed389bb63d48f729d9c7", size = 1659497, upload-time = "2026-06-01T19:40:46.265Z" }, + { url = "https://files.pythonhosted.org/packages/10/c7/7ba5de8af9650b9767b063c675427b8685f43fa7ce563673a7bc3af60f08/aiohttp-3.14.0-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:b584dfe615d151e9b8f0a8ecb3aee6147f2927ec5b95ba25fe621f5377510928", size = 1870829, upload-time = "2026-06-01T19:40:49.583Z" }, + { url = "https://files.pythonhosted.org/packages/cc/bc/2aaab2f85cadb26ea59c091fa2b8e370d625154b5c14b478f1b489d07551/aiohttp-3.14.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:6199707cc40e0e9cd39c36fbc97bec416c704e1d0ddce03412bb3b3e6a90ccd0", size = 1832281, upload-time = "2026-06-01T19:40:52.303Z" }, + { url = "https://files.pythonhosted.org/packages/39/98/31b9ad9fbc01f0075ee7221002df5fd2d10b647f451ca5f30edc802d9dd6/aiohttp-3.14.0-cp314-cp314t-win32.whl", hash = "sha256:a8d93334d4961c9d566b1f046c81dee475b7c21eb730728d38237bfa70d1c8e6", size = 490597, upload-time = "2026-06-01T19:40:54.937Z" }, + { url = "https://files.pythonhosted.org/packages/59/1f/299b21441c8de42ff70fddc7cfe65e92f810abcf740739a09b56f7835364/aiohttp-3.14.0-cp314-cp314t-win_amd64.whl", hash = "sha256:2d2ffe9b614f50f069068b3b52e73414e4107fc10b7efc939a76acff9251fdd2", size = 525789, upload-time = "2026-06-01T19:40:57.306Z" }, + { url = "https://files.pythonhosted.org/packages/70/11/7f83fcba9ee05d4c54d61b3f8104da0d43a59adac44dd28effc0c9a10422/aiohttp-3.14.0-cp314-cp314t-win_arm64.whl", hash = "sha256:7a3fc4358e65826c515350f199c210de747cf669998211b1ee6c2e46de364b24", size = 467399, upload-time = "2026-06-01T19:40:59.993Z" }, +] + +[[package]] +name = "aiosignal" +version = "1.4.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "frozenlist" }, + { name = "typing-extensions", marker = "python_full_version < '3.13'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/61/62/06741b579156360248d1ec624842ad0edf697050bbaf7c3e46394e106ad1/aiosignal-1.4.0.tar.gz", hash = "sha256:f47eecd9468083c2029cc99945502cb7708b082c232f9aca65da147157b251c7", size = 25007, upload-time = "2025-07-03T22:54:43.528Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/fb/76/641ae371508676492379f16e2fa48f4e2c11741bd63c48be4b12a6b09cba/aiosignal-1.4.0-py3-none-any.whl", hash = "sha256:053243f8b92b990551949e63930a839ff0cf0b0ebbe0597b0f3fb19e1a0fe82e", size = 7490, upload-time = "2025-07-03T22:54:42.156Z" }, +] + +[[package]] +name = "annotated-doc" +version = "0.0.4" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/57/ba/046ceea27344560984e26a590f90bc7f4a75b06701f653222458922b558c/annotated_doc-0.0.4.tar.gz", hash = "sha256:fbcda96e87e9c92ad167c2e53839e57503ecfda18804ea28102353485033faa4", size = 7288, upload-time = "2025-11-10T22:07:42.062Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/1e/d3/26bf1008eb3d2daa8ef4cacc7f3bfdc11818d111f7e2d0201bc6e3b49d45/annotated_doc-0.0.4-py3-none-any.whl", hash = "sha256:571ac1dc6991c450b25a9c2d84a3705e2ae7a53467b5d111c24fa8baabbed320", size = 5303, upload-time = "2025-11-10T22:07:40.673Z" }, +] + +[[package]] +name = "annotated-types" +version = "0.7.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/ee/67/531ea369ba64dcff5ec9c3402f9f51bf748cec26dde048a2f973a4eea7f5/annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89", size = 16081, upload-time = "2024-05-20T21:33:25.928Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/78/b6/6307fbef88d9b5ee7421e68d78a9f162e0da4900bc5f5793f6d3d0e34fb8/annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53", size = 13643, upload-time = "2024-05-20T21:33:24.1Z" }, +] + +[[package]] +name = "anyio" +version = "4.13.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "idna" }, + { name = "typing-extensions", marker = "python_full_version < '3.13'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/19/14/2c5dd9f512b66549ae92767a9c7b330ae88e1932ca57876909410251fe13/anyio-4.13.0.tar.gz", hash = "sha256:334b70e641fd2221c1505b3890c69882fe4a2df910cba14d97019b90b24439dc", size = 231622, upload-time = "2026-03-24T12:59:09.671Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/da/42/e921fccf5015463e32a3cf6ee7f980a6ed0f395ceeaa45060b61d86486c2/anyio-4.13.0-py3-none-any.whl", hash = "sha256:08b310f9e24a9594186fd75b4f73f4a4152069e3853f1ed8bfbf58369f4ad708", size = 114353, upload-time = "2026-03-24T12:59:08.246Z" }, +] + +[[package]] +name = "attrs" +version = "26.1.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/9a/8e/82a0fe20a541c03148528be8cac2408564a6c9a0cc7e9171802bc1d26985/attrs-26.1.0.tar.gz", hash = "sha256:d03ceb89cb322a8fd706d4fb91940737b6642aa36998fe130a9bc96c985eff32", size = 952055, upload-time = "2026-03-19T14:22:25.026Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/64/b4/17d4b0b2a2dc85a6df63d1157e028ed19f90d4cd97c36717afef2bc2f395/attrs-26.1.0-py3-none-any.whl", hash = "sha256:c647aa4a12dfbad9333ca4e71fe62ddc36f4e63b2d260a37a8b83d2f043ac309", size = 67548, upload-time = "2026-03-19T14:22:23.645Z" }, +] + +[[package]] +name = "av" +version = "15.1.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/e9/c3/83e6e73d1592bc54436eae0bc61704ae0cff0c3cfbde7b58af9ed67ebb49/av-15.1.0.tar.gz", hash = "sha256:39cda2dc810e11c1938f8cb5759c41d6b630550236b3365790e67a313660ec85", size = 3774192, upload-time = "2025-08-30T04:41:56.076Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/58/de78b276d20db6ffcd4371283df771721a833ba525a3d57e753d00a9fe79/av-15.1.0-cp312-cp312-macosx_13_0_arm64.whl", hash = "sha256:40c5df37f4c354ab8190c6fd68dab7881d112f527906f64ca73da4c252a58cee", size = 21760991, upload-time = "2025-08-30T04:40:00.801Z" }, + { url = "https://files.pythonhosted.org/packages/56/cc/45f85775304ae60b66976360d82ba5b152ad3fd91f9267d5020a51e9a828/av-15.1.0-cp312-cp312-macosx_13_0_x86_64.whl", hash = "sha256:af455ce65ada3d361f80c90c810d9bced4db5655ab9aa513024d6c71c5c476d5", size = 26953097, upload-time = "2025-08-30T04:40:03.998Z" }, + { url = "https://files.pythonhosted.org/packages/f3/f8/2d781e5e71d02fc829487e775ccb1185e72f95340d05f2e84eb57a11e093/av-15.1.0-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:86226d2474c80c3393fa07a9c366106029ae500716098b72b3ec3f67205524c3", size = 38319710, upload-time = "2025-08-30T04:40:07.701Z" }, + { url = "https://files.pythonhosted.org/packages/ac/13/37737ef2193e83862ccacff23580c39de251da456a1bf0459e762cca273c/av-15.1.0-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:11326f197e7001c4ca53a83b2dbc67fd39ddff8cdf62ce6be3b22d9f3f9338bd", size = 39915519, upload-time = "2025-08-30T04:40:11.066Z" }, + { url = "https://files.pythonhosted.org/packages/26/e9/e8032c7b8f2a4129a03f63f896544f8b7cf068e2db2950326fa2400d5c47/av-15.1.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:a631ea879cc553080ee62874f4284765c42ba08ee0279851a98a85e2ceb3cc8d", size = 40286166, upload-time = "2025-08-30T04:40:14.561Z" }, + { url = "https://files.pythonhosted.org/packages/e2/23/612c0fd809444d04b8387a2dfd942ccc77829507bd78a387ff65a9d98c24/av-15.1.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:8f383949b010c3e731c245f80351d19dc0c08f345e194fc46becb1cb279be3ff", size = 41150592, upload-time = "2025-08-30T04:40:17.951Z" }, + { url = "https://files.pythonhosted.org/packages/15/74/6f8e38a3b0aea5f28e72813672ff45b64615f2c69e6a4a558718c95edb9f/av-15.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:d5921aa45f4c1f8c1a8d8185eb347e02aa4c3071278a2e2dd56368d54433d643", size = 31336093, upload-time = "2025-08-30T04:40:21.393Z" }, + { url = "https://files.pythonhosted.org/packages/2e/bc/78b2ffa8235eeffc29aa4a8cc47b02e660cfec32f601f39a00975fb06d0e/av-15.1.0-cp313-cp313-macosx_13_0_arm64.whl", hash = "sha256:2f77853c3119c59d1bff4214ccbe46e3133eccff85ed96adee51c68684443f4e", size = 21726244, upload-time = "2025-08-30T04:40:24.14Z" }, + { url = "https://files.pythonhosted.org/packages/1a/99/66d69453a2dce028e6e8ebea085d90e880aac03d3a3ab7d8ec16755ffd75/av-15.1.0-cp313-cp313-macosx_13_0_x86_64.whl", hash = "sha256:c0bc4471c156a0a1c70a607502434f477bc8dfe085eef905e55b4b0d66bcd3a5", size = 26918663, upload-time = "2025-08-30T04:40:27.557Z" }, + { url = "https://files.pythonhosted.org/packages/fa/51/1a7dfbeda71f2772bc46d758af0e7fab1cc8388ce4bc7f24aecbc4bfd764/av-15.1.0-cp313-cp313-manylinux_2_28_aarch64.whl", hash = "sha256:37839d4fa1407f047af82560dfc0f94d8d6266071eff49e1cbe16c4483054621", size = 38041408, upload-time = "2025-08-30T04:40:30.811Z" }, + { url = "https://files.pythonhosted.org/packages/d7/97/2c4e0288ad4359b6064cb06ae79c2ff3a84ac73d27e91f2161b75fcd86fa/av-15.1.0-cp313-cp313-manylinux_2_28_x86_64.whl", hash = "sha256:729179cd8622815e8b6f6854d13a806fe710576e08895c77e5e4ad254609de9a", size = 39642563, upload-time = "2025-08-30T04:40:34.617Z" }, + { url = "https://files.pythonhosted.org/packages/ea/94/2362502149e276d00957edabcc201a5f4d5109a8a7b4fd30793714a532f3/av-15.1.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:4abdf085bfa4eec318efccff567831b361ea56c045cc38366811552e3127c665", size = 40022119, upload-time = "2025-08-30T04:40:37.703Z" }, + { url = "https://files.pythonhosted.org/packages/df/58/1a0ce1b3835d9728da0a7a54aeffaa0a2b1a88405eaed9322efd55212a54/av-15.1.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:f985661644879e4520d28a995fcb2afeb951bc15a1d51412eb8e5f36da85b6fe", size = 40885158, upload-time = "2025-08-30T04:40:40.952Z" }, + { url = "https://files.pythonhosted.org/packages/30/e6/054bb64e424d90b77ed5fc6a7358e4013fb436154c998fc90a89a186313f/av-15.1.0-cp313-cp313-win_amd64.whl", hash = "sha256:7d7804a44c8048bb4b014a99353dd124663a12cd1d4613ba2bd3b457c3b1d539", size = 31312256, upload-time = "2025-08-30T04:40:44.224Z" }, + { url = "https://files.pythonhosted.org/packages/6f/8b/89eae6dca10d7d2b83c131025a31ccc750be78699ac0304439faa1d1df99/av-15.1.0-cp314-cp314-macosx_13_0_arm64.whl", hash = "sha256:5dd73c6447947edcb82e5fecf96e1f146aeda0f169c7ad4c54df4d9f66f63fde", size = 21730645, upload-time = "2025-08-30T04:40:47.259Z" }, + { url = "https://files.pythonhosted.org/packages/a3/f0/abffaf69405ed68041524be12a1e294faf396971d6a0e70eb00e93687df7/av-15.1.0-cp314-cp314-macosx_13_0_x86_64.whl", hash = "sha256:a81cd515934a5d51290aa66b059b7ed29c4a212e704f3c5e99e32877ff1c312c", size = 26913753, upload-time = "2025-08-30T04:40:50.445Z" }, + { url = "https://files.pythonhosted.org/packages/37/9e/7af078bcfc3cd340c981ac5d613c090ab007023d2ac13b05acd52f22f069/av-15.1.0-cp314-cp314-manylinux_2_28_aarch64.whl", hash = "sha256:57cc7a733a7e7d7a153682f35c9cf5d01e8269367b049c954779de36fc3d0b10", size = 38027048, upload-time = "2025-08-30T04:40:54.076Z" }, + { url = "https://files.pythonhosted.org/packages/02/76/1f9dac11ad713e3619288993ea04e9c9cf4ec0f04e5ee81e83b8129dd8f3/av-15.1.0-cp314-cp314-manylinux_2_28_x86_64.whl", hash = "sha256:a77b75bdb6899a64302ff923a5246e0747b3f0a3ecee7d61118db407a22c3f53", size = 39565396, upload-time = "2025-08-30T04:40:57.84Z" }, + { url = "https://files.pythonhosted.org/packages/8b/32/2188c46e2747247458ffc26b230c57dd28e61f65ff7b9e6223a411af5e98/av-15.1.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:d0a1154ce081f1720082a133cfe12356c59f62dad2b93a7a1844bf1dcd010d85", size = 40015050, upload-time = "2025-08-30T04:41:01.091Z" }, + { url = "https://files.pythonhosted.org/packages/1e/41/b57fbce9994580619d7574817ece0fe0e7b822cde2af57904549d0150b8d/av-15.1.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:8a7bf5a34dee15c86790414fa86a144e6d0dcc788bc83b565fdcbc080b4fbc90", size = 40821225, upload-time = "2025-08-30T04:41:04.349Z" }, + { url = "https://files.pythonhosted.org/packages/b1/36/e85cd1f0d3369c6764ad422882895d082f7ececb66d3df8aeae3234ef7a6/av-15.1.0-cp314-cp314-win_amd64.whl", hash = "sha256:e30c9a6fd9734784941384a2e25fad3c22881a7682f378914676aa7e795acdb7", size = 31311750, upload-time = "2025-08-30T04:41:07.744Z" }, + { url = "https://files.pythonhosted.org/packages/80/d8/08a681758a4e49adfda409a6a35eff533f42654c6a6cfa102bc5cae1a728/av-15.1.0-cp314-cp314t-macosx_13_0_arm64.whl", hash = "sha256:60666833d7e65ebcfc48034a072de74349edbb62c9aaa3e6722fef31ca028eb6", size = 21828343, upload-time = "2025-08-30T04:41:10.81Z" }, + { url = "https://files.pythonhosted.org/packages/4a/52/29bec3fe68669b21f7d1ab5d94e21f597b8dfd37f50a3e3c9af6a8da925c/av-15.1.0-cp314-cp314t-macosx_13_0_x86_64.whl", hash = "sha256:53fbdae45aa2a49a22e864ff4f4017416ef62c060a172085d3247ba0a101104e", size = 27001666, upload-time = "2025-08-30T04:41:13.822Z" }, + { url = "https://files.pythonhosted.org/packages/9d/54/2c1d1faced66d708f5df328e800997cb47f90b500a214130c3a0f2ad601e/av-15.1.0-cp314-cp314t-manylinux_2_28_aarch64.whl", hash = "sha256:e6c51061667983dc801502aff9140bbc4f0e0d97f879586f17fb2f9a7e49c381", size = 39496753, upload-time = "2025-08-30T04:41:16.759Z" }, + { url = "https://files.pythonhosted.org/packages/c3/76/06ded5e52c4dcc2d9b5184c6da8de5ea77bd7ecb79a59a2b9700f1984949/av-15.1.0-cp314-cp314t-manylinux_2_28_x86_64.whl", hash = "sha256:2f80ec387f04aa34868662b11018b5f09654ae1530a61e24e92a142a24b10b62", size = 40784729, upload-time = "2025-08-30T04:41:20.491Z" }, + { url = "https://files.pythonhosted.org/packages/52/ef/797b76f3b39c99a96e387f501bbc07dca340b27d3dda12862fe694066b63/av-15.1.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:4975e03177d37d8165c99c8d494175675ba8acb72458fb5d7e43f746a53e0374", size = 41284953, upload-time = "2025-08-30T04:41:23.949Z" }, + { url = "https://files.pythonhosted.org/packages/31/47/e4656f00e62fd059ea5a40b492dea784f5aecfe1dfac10c0d7a0664ce200/av-15.1.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:8f78f3dad11780b4cdd024cdb92ce43cb170929297c00f2f4555c2b103f51e55", size = 41985340, upload-time = "2025-08-30T04:41:27.561Z" }, + { url = "https://files.pythonhosted.org/packages/b1/c9/15bb4fd7a1f39d70db35af2b9c20a0ae19e4220eb58a8b8446e903b98d72/av-15.1.0-cp314-cp314t-win_amd64.whl", hash = "sha256:9a20c5eba3ec49c2f4b281797021923fc68a86aeb66c5cda4fd0252fa8004951", size = 31487337, upload-time = "2025-08-30T04:41:30.591Z" }, +] + +[[package]] +name = "certifi" +version = "2026.5.20" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f3/ce/ee2ecad540810a79593028e88299baeae54d346cc7a0d94b6199988b89b1/certifi-2026.5.20.tar.gz", hash = "sha256:69dea482ab64caa7b9f6aba1c6bf48bb6a5448d1c0f1b17ab42ad8c763a5344d", size = 135422, upload-time = "2026-05-20T11:46:50.073Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/59/8c/57e832b7af6d7c5abe66eb3fbe3a3a32f4d11ea23a1aa7131371035be991/certifi-2026.5.20-py3-none-any.whl", hash = "sha256:3c52e209ba0a4ad7aebe60436a4ab349c39e1e602e8c134221e546902ad25897", size = 134134, upload-time = "2026-05-20T11:46:48.578Z" }, +] + +[[package]] +name = "cfgv" +version = "3.5.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/4e/b5/721b8799b04bf9afe054a3899c6cf4e880fcf8563cc71c15610242490a0c/cfgv-3.5.0.tar.gz", hash = "sha256:d5b1034354820651caa73ede66a6294d6e95c1b00acc5e9b098e917404669132", size = 7334, upload-time = "2025-11-19T20:55:51.612Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/db/3c/33bac158f8ab7f89b2e59426d5fe2e4f63f7ed25df84c036890172b412b5/cfgv-3.5.0-py2.py3-none-any.whl", hash = "sha256:a8dc6b26ad22ff227d2634a65cb388215ce6cc96bbcc5cfde7641ae87e8dacc0", size = 7445, upload-time = "2025-11-19T20:55:50.744Z" }, +] + +[[package]] +name = "charset-normalizer" +version = "3.4.7" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/e7/a1/67fe25fac3c7642725500a3f6cfe5821ad557c3abb11c9d20d12c7008d3e/charset_normalizer-3.4.7.tar.gz", hash = "sha256:ae89db9e5f98a11a4bf50407d4363e7b09b31e55bc117b4f7d80aab97ba009e5", size = 144271, upload-time = "2026-04-02T09:28:39.342Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0c/eb/4fc8d0a7110eb5fc9cc161723a34a8a6c200ce3b4fbf681bc86feee22308/charset_normalizer-3.4.7-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:eca9705049ad3c7345d574e3510665cb2cf844c2f2dcfe675332677f081cbd46", size = 311328, upload-time = "2026-04-02T09:26:24.331Z" }, + { url = "https://files.pythonhosted.org/packages/f8/e3/0fadc706008ac9d7b9b5be6dc767c05f9d3e5df51744ce4cc9605de7b9f4/charset_normalizer-3.4.7-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6178f72c5508bfc5fd446a5905e698c6212932f25bcdd4b47a757a50605a90e2", size = 208061, upload-time = "2026-04-02T09:26:25.568Z" }, + { url = "https://files.pythonhosted.org/packages/42/f0/3dd1045c47f4a4604df85ec18ad093912ae1344ac706993aff91d38773a2/charset_normalizer-3.4.7-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:e1421b502d83040e6d7fb2fb18dff63957f720da3d77b2fbd3187ceb63755d7b", size = 229031, upload-time = "2026-04-02T09:26:26.865Z" }, + { url = "https://files.pythonhosted.org/packages/dc/67/675a46eb016118a2fbde5a277a5d15f4f69d5f3f5f338e5ee2f8948fcf43/charset_normalizer-3.4.7-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:edac0f1ab77644605be2cbba52e6b7f630731fc42b34cb0f634be1a6eface56a", size = 225239, upload-time = "2026-04-02T09:26:28.044Z" }, + { url = "https://files.pythonhosted.org/packages/4b/f8/d0118a2f5f23b02cd166fa385c60f9b0d4f9194f574e2b31cef350ad7223/charset_normalizer-3.4.7-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5649fd1c7bade02f320a462fdefd0b4bd3ce036065836d4f42e0de958038e116", size = 216589, upload-time = "2026-04-02T09:26:29.239Z" }, + { url = "https://files.pythonhosted.org/packages/b1/f1/6d2b0b261b6c4ceef0fcb0d17a01cc5bc53586c2d4796fa04b5c540bc13d/charset_normalizer-3.4.7-cp312-cp312-manylinux_2_31_armv7l.whl", hash = "sha256:203104ed3e428044fd943bc4bf45fa73c0730391f9621e37fe39ecf477b128cb", size = 202733, upload-time = "2026-04-02T09:26:30.5Z" }, + { url = "https://files.pythonhosted.org/packages/6f/c0/7b1f943f7e87cc3db9626ba17807d042c38645f0a1d4415c7a14afb5591f/charset_normalizer-3.4.7-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:298930cec56029e05497a76988377cbd7457ba864beeea92ad7e844fe74cd1f1", size = 212652, upload-time = "2026-04-02T09:26:31.709Z" }, + { url = "https://files.pythonhosted.org/packages/38/dd/5a9ab159fe45c6e72079398f277b7d2b523e7f716acc489726115a910097/charset_normalizer-3.4.7-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:708838739abf24b2ceb208d0e22403dd018faeef86ddac04319a62ae884c4f15", size = 211229, upload-time = "2026-04-02T09:26:33.282Z" }, + { url = "https://files.pythonhosted.org/packages/d5/ff/531a1cad5ca855d1c1a8b69cb71abfd6d85c0291580146fda7c82857caa1/charset_normalizer-3.4.7-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:0f7eb884681e3938906ed0434f20c63046eacd0111c4ba96f27b76084cd679f5", size = 203552, upload-time = "2026-04-02T09:26:34.845Z" }, + { url = "https://files.pythonhosted.org/packages/c1/4c/a5fb52d528a8ca41f7598cb619409ece30a169fbdf9cdce592e53b46c3a6/charset_normalizer-3.4.7-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:4dc1e73c36828f982bfe79fadf5919923f8a6f4df2860804db9a98c48824ce8d", size = 230806, upload-time = "2026-04-02T09:26:36.152Z" }, + { url = "https://files.pythonhosted.org/packages/59/7a/071feed8124111a32b316b33ae4de83d36923039ef8cf48120266844285b/charset_normalizer-3.4.7-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:aed52fea0513bac0ccde438c188c8a471c4e0f457c2dd20cdbf6ea7a450046c7", size = 212316, upload-time = "2026-04-02T09:26:37.672Z" }, + { url = "https://files.pythonhosted.org/packages/fd/35/f7dba3994312d7ba508e041eaac39a36b120f32d4c8662b8814dab876431/charset_normalizer-3.4.7-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:fea24543955a6a729c45a73fe90e08c743f0b3334bbf3201e6c4bc1b0c7fa464", size = 227274, upload-time = "2026-04-02T09:26:38.93Z" }, + { url = "https://files.pythonhosted.org/packages/8a/2d/a572df5c9204ab7688ec1edc895a73ebded3b023bb07364710b05dd1c9be/charset_normalizer-3.4.7-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:bb6d88045545b26da47aa879dd4a89a71d1dce0f0e549b1abcb31dfe4a8eac49", size = 218468, upload-time = "2026-04-02T09:26:40.17Z" }, + { url = "https://files.pythonhosted.org/packages/86/eb/890922a8b03a568ca2f336c36585a4713c55d4d67bf0f0c78924be6315ca/charset_normalizer-3.4.7-cp312-cp312-win32.whl", hash = "sha256:2257141f39fe65a3fdf38aeccae4b953e5f3b3324f4ff0daf9f15b8518666a2c", size = 148460, upload-time = "2026-04-02T09:26:41.416Z" }, + { url = "https://files.pythonhosted.org/packages/35/d9/0e7dffa06c5ab081f75b1b786f0aefc88365825dfcd0ac544bdb7b2b6853/charset_normalizer-3.4.7-cp312-cp312-win_amd64.whl", hash = "sha256:5ed6ab538499c8644b8a3e18debabcd7ce684f3fa91cf867521a7a0279cab2d6", size = 159330, upload-time = "2026-04-02T09:26:42.554Z" }, + { url = "https://files.pythonhosted.org/packages/9e/5d/481bcc2a7c88ea6b0878c299547843b2521ccbc40980cb406267088bc701/charset_normalizer-3.4.7-cp312-cp312-win_arm64.whl", hash = "sha256:56be790f86bfb2c98fb742ce566dfb4816e5a83384616ab59c49e0604d49c51d", size = 147828, upload-time = "2026-04-02T09:26:44.075Z" }, + { url = "https://files.pythonhosted.org/packages/c1/3b/66777e39d3ae1ddc77ee606be4ec6d8cbd4c801f65e5a1b6f2b11b8346dd/charset_normalizer-3.4.7-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:f496c9c3cc02230093d8330875c4c3cdfc3b73612a5fd921c65d39cbcef08063", size = 309627, upload-time = "2026-04-02T09:26:45.198Z" }, + { url = "https://files.pythonhosted.org/packages/2e/4e/b7f84e617b4854ade48a1b7915c8ccfadeba444d2a18c291f696e37f0d3b/charset_normalizer-3.4.7-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0ea948db76d31190bf08bd371623927ee1339d5f2a0b4b1b4a4439a65298703c", size = 207008, upload-time = "2026-04-02T09:26:46.824Z" }, + { url = "https://files.pythonhosted.org/packages/c4/bb/ec73c0257c9e11b268f018f068f5d00aa0ef8c8b09f7753ebd5f2880e248/charset_normalizer-3.4.7-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:a277ab8928b9f299723bc1a2dabb1265911b1a76341f90a510368ca44ad9ab66", size = 228303, upload-time = "2026-04-02T09:26:48.397Z" }, + { url = "https://files.pythonhosted.org/packages/85/fb/32d1f5033484494619f701e719429c69b766bfc4dbc61aa9e9c8c166528b/charset_normalizer-3.4.7-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:3bec022aec2c514d9cf199522a802bd007cd588ab17ab2525f20f9c34d067c18", size = 224282, upload-time = "2026-04-02T09:26:49.684Z" }, + { url = "https://files.pythonhosted.org/packages/fa/07/330e3a0dda4c404d6da83b327270906e9654a24f6c546dc886a0eb0ffb23/charset_normalizer-3.4.7-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e044c39e41b92c845bc815e5ae4230804e8e7bc29e399b0437d64222d92809dd", size = 215595, upload-time = "2026-04-02T09:26:50.915Z" }, + { url = "https://files.pythonhosted.org/packages/e3/7c/fc890655786e423f02556e0216d4b8c6bcb6bdfa890160dc66bf52dee468/charset_normalizer-3.4.7-cp313-cp313-manylinux_2_31_armv7l.whl", hash = "sha256:f495a1652cf3fbab2eb0639776dad966c2fb874d79d87ca07f9d5f059b8bd215", size = 201986, upload-time = "2026-04-02T09:26:52.197Z" }, + { url = "https://files.pythonhosted.org/packages/d8/97/bfb18b3db2aed3b90cf54dc292ad79fdd5ad65c4eae454099475cbeadd0d/charset_normalizer-3.4.7-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:e712b419df8ba5e42b226c510472b37bd57b38e897d3eca5e8cfd410a29fa859", size = 211711, upload-time = "2026-04-02T09:26:53.49Z" }, + { url = "https://files.pythonhosted.org/packages/6f/a5/a581c13798546a7fd557c82614a5c65a13df2157e9ad6373166d2a3e645d/charset_normalizer-3.4.7-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:7804338df6fcc08105c7745f1502ba68d900f45fd770d5bdd5288ddccb8a42d8", size = 210036, upload-time = "2026-04-02T09:26:54.975Z" }, + { url = "https://files.pythonhosted.org/packages/8c/bf/b3ab5bcb478e4193d517644b0fb2bf5497fbceeaa7a1bc0f4d5b50953861/charset_normalizer-3.4.7-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:481551899c856c704d58119b5025793fa6730adda3571971af568f66d2424bb5", size = 202998, upload-time = "2026-04-02T09:26:56.303Z" }, + { url = "https://files.pythonhosted.org/packages/e7/4e/23efd79b65d314fa320ec6017b4b5834d5c12a58ba4610aa353af2e2f577/charset_normalizer-3.4.7-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:f59099f9b66f0d7145115e6f80dd8b1d847176df89b234a5a6b3f00437aa0832", size = 230056, upload-time = "2026-04-02T09:26:57.554Z" }, + { url = "https://files.pythonhosted.org/packages/b9/9f/1e1941bc3f0e01df116e68dc37a55c4d249df5e6fa77f008841aef68264f/charset_normalizer-3.4.7-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:f59ad4c0e8f6bba240a9bb85504faa1ab438237199d4cce5f622761507b8f6a6", size = 211537, upload-time = "2026-04-02T09:26:58.843Z" }, + { url = "https://files.pythonhosted.org/packages/80/0f/088cbb3020d44428964a6c97fe1edfb1b9550396bf6d278330281e8b709c/charset_normalizer-3.4.7-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:3dedcc22d73ec993f42055eff4fcfed9318d1eeb9a6606c55892a26964964e48", size = 226176, upload-time = "2026-04-02T09:27:00.437Z" }, + { url = "https://files.pythonhosted.org/packages/6a/9f/130394f9bbe06f4f63e22641d32fc9b202b7e251c9aef4db044324dac493/charset_normalizer-3.4.7-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:64f02c6841d7d83f832cd97ccf8eb8a906d06eb95d5276069175c696b024b60a", size = 217723, upload-time = "2026-04-02T09:27:02.021Z" }, + { url = "https://files.pythonhosted.org/packages/73/55/c469897448a06e49f8fa03f6caae97074fde823f432a98f979cc42b90e69/charset_normalizer-3.4.7-cp313-cp313-win32.whl", hash = "sha256:4042d5c8f957e15221d423ba781e85d553722fc4113f523f2feb7b188cc34c5e", size = 148085, upload-time = "2026-04-02T09:27:03.192Z" }, + { url = "https://files.pythonhosted.org/packages/5d/78/1b74c5bbb3f99b77a1715c91b3e0b5bdb6fe302d95ace4f5b1bec37b0167/charset_normalizer-3.4.7-cp313-cp313-win_amd64.whl", hash = "sha256:3946fa46a0cf3e4c8cb1cc52f56bb536310d34f25f01ca9b6c16afa767dab110", size = 158819, upload-time = "2026-04-02T09:27:04.454Z" }, + { url = "https://files.pythonhosted.org/packages/68/86/46bd42279d323deb8687c4a5a811fd548cb7d1de10cf6535d099877a9a9f/charset_normalizer-3.4.7-cp313-cp313-win_arm64.whl", hash = "sha256:80d04837f55fc81da168b98de4f4b797ef007fc8a79ab71c6ec9bc4dd662b15b", size = 147915, upload-time = "2026-04-02T09:27:05.971Z" }, + { url = "https://files.pythonhosted.org/packages/97/c8/c67cb8c70e19ef1960b97b22ed2a1567711de46c4ddf19799923adc836c2/charset_normalizer-3.4.7-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:c36c333c39be2dbca264d7803333c896ab8fa7d4d6f0ab7edb7dfd7aea6e98c0", size = 309234, upload-time = "2026-04-02T09:27:07.194Z" }, + { url = "https://files.pythonhosted.org/packages/99/85/c091fdee33f20de70d6c8b522743b6f831a2f1cd3ff86de4c6a827c48a76/charset_normalizer-3.4.7-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1c2aed2e5e41f24ea8ef1590b8e848a79b56f3a5564a65ceec43c9d692dc7d8a", size = 208042, upload-time = "2026-04-02T09:27:08.749Z" }, + { url = "https://files.pythonhosted.org/packages/87/1c/ab2ce611b984d2fd5d86a5a8a19c1ae26acac6bad967da4967562c75114d/charset_normalizer-3.4.7-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:54523e136b8948060c0fa0bc7b1b50c32c186f2fceee897a495406bb6e311d2b", size = 228706, upload-time = "2026-04-02T09:27:09.951Z" }, + { url = "https://files.pythonhosted.org/packages/a8/29/2b1d2cb00bf085f59d29eb773ce58ec2d325430f8c216804a0a5cd83cbca/charset_normalizer-3.4.7-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:715479b9a2802ecac752a3b0efa2b0b60285cf962ee38414211abdfccc233b41", size = 224727, upload-time = "2026-04-02T09:27:11.175Z" }, + { url = "https://files.pythonhosted.org/packages/47/5c/032c2d5a07fe4d4855fea851209cca2b6f03ebeb6d4e3afdb3358386a684/charset_normalizer-3.4.7-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bd6c2a1c7573c64738d716488d2cdd3c00e340e4835707d8fdb8dc1a66ef164e", size = 215882, upload-time = "2026-04-02T09:27:12.446Z" }, + { url = "https://files.pythonhosted.org/packages/2c/c2/356065d5a8b78ed04499cae5f339f091946a6a74f91e03476c33f0ab7100/charset_normalizer-3.4.7-cp314-cp314-manylinux_2_31_armv7l.whl", hash = "sha256:c45e9440fb78f8ddabcf714b68f936737a121355bf59f3907f4e17721b9d1aae", size = 200860, upload-time = "2026-04-02T09:27:13.721Z" }, + { url = "https://files.pythonhosted.org/packages/0c/cd/a32a84217ced5039f53b29f460962abb2d4420def55afabe45b1c3c7483d/charset_normalizer-3.4.7-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:3534e7dcbdcf757da6b85a0bbf5b6868786d5982dd959b065e65481644817a18", size = 211564, upload-time = "2026-04-02T09:27:15.272Z" }, + { url = "https://files.pythonhosted.org/packages/44/86/58e6f13ce26cc3b8f4a36b94a0f22ae2f00a72534520f4ae6857c4b81f89/charset_normalizer-3.4.7-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:e8ac484bf18ce6975760921bb6148041faa8fef0547200386ea0b52b5d27bf7b", size = 211276, upload-time = "2026-04-02T09:27:16.834Z" }, + { url = "https://files.pythonhosted.org/packages/8f/fe/d17c32dc72e17e155e06883efa84514ca375f8a528ba2546bee73fc4df81/charset_normalizer-3.4.7-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:a5fe03b42827c13cdccd08e6c0247b6a6d4b5e3cdc53fd1749f5896adcdc2356", size = 201238, upload-time = "2026-04-02T09:27:18.229Z" }, + { url = "https://files.pythonhosted.org/packages/6a/29/f33daa50b06525a237451cdb6c69da366c381a3dadcd833fa5676bc468b3/charset_normalizer-3.4.7-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:2d6eb928e13016cea4f1f21d1e10c1cebd5a421bc57ddf5b1142ae3f86824fab", size = 230189, upload-time = "2026-04-02T09:27:19.445Z" }, + { url = "https://files.pythonhosted.org/packages/b6/6e/52c84015394a6a0bdcd435210a7e944c5f94ea1055f5cc5d56c5fe368e7b/charset_normalizer-3.4.7-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:e74327fb75de8986940def6e8dee4f127cc9752bee7355bb323cc5b2659b6d46", size = 211352, upload-time = "2026-04-02T09:27:20.79Z" }, + { url = "https://files.pythonhosted.org/packages/8c/d7/4353be581b373033fb9198bf1da3cf8f09c1082561e8e922aa7b39bf9fe8/charset_normalizer-3.4.7-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:d6038d37043bced98a66e68d3aa2b6a35505dc01328cd65217cefe82f25def44", size = 227024, upload-time = "2026-04-02T09:27:22.063Z" }, + { url = "https://files.pythonhosted.org/packages/30/45/99d18aa925bd1740098ccd3060e238e21115fffbfdcb8f3ece837d0ace6c/charset_normalizer-3.4.7-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:7579e913a5339fb8fa133f6bbcfd8e6749696206cf05acdbdca71a1b436d8e72", size = 217869, upload-time = "2026-04-02T09:27:23.486Z" }, + { url = "https://files.pythonhosted.org/packages/5c/05/5ee478aa53f4bb7996482153d4bfe1b89e0f087f0ab6b294fcf92d595873/charset_normalizer-3.4.7-cp314-cp314-win32.whl", hash = "sha256:5b77459df20e08151cd6f8b9ef8ef1f961ef73d85c21a555c7eed5b79410ec10", size = 148541, upload-time = "2026-04-02T09:27:25.146Z" }, + { url = "https://files.pythonhosted.org/packages/48/77/72dcb0921b2ce86420b2d79d454c7022bf5be40202a2a07906b9f2a35c97/charset_normalizer-3.4.7-cp314-cp314-win_amd64.whl", hash = "sha256:92a0a01ead5e668468e952e4238cccd7c537364eb7d851ab144ab6627dbbe12f", size = 159634, upload-time = "2026-04-02T09:27:26.642Z" }, + { url = "https://files.pythonhosted.org/packages/c6/a3/c2369911cd72f02386e4e340770f6e158c7980267da16af8f668217abaa0/charset_normalizer-3.4.7-cp314-cp314-win_arm64.whl", hash = "sha256:67f6279d125ca0046a7fd386d01b311c6363844deac3e5b069b514ba3e63c246", size = 148384, upload-time = "2026-04-02T09:27:28.271Z" }, + { url = "https://files.pythonhosted.org/packages/94/09/7e8a7f73d24dba1f0035fbbf014d2c36828fc1bf9c88f84093e57d315935/charset_normalizer-3.4.7-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:effc3f449787117233702311a1b7d8f59cba9ced946ba727bdc329ec69028e24", size = 330133, upload-time = "2026-04-02T09:27:29.474Z" }, + { url = "https://files.pythonhosted.org/packages/8d/da/96975ddb11f8e977f706f45cddd8540fd8242f71ecdb5d18a80723dcf62c/charset_normalizer-3.4.7-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:fbccdc05410c9ee21bbf16a35f4c1d16123dcdeb8a1d38f33654fa21d0234f79", size = 216257, upload-time = "2026-04-02T09:27:30.793Z" }, + { url = "https://files.pythonhosted.org/packages/e5/e8/1d63bf8ef2d388e95c64b2098f45f84758f6d102a087552da1485912637b/charset_normalizer-3.4.7-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:733784b6d6def852c814bce5f318d25da2ee65dd4839a0718641c696e09a2960", size = 234851, upload-time = "2026-04-02T09:27:32.44Z" }, + { url = "https://files.pythonhosted.org/packages/9b/40/e5ff04233e70da2681fa43969ad6f66ca5611d7e669be0246c4c7aaf6dc8/charset_normalizer-3.4.7-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:a89c23ef8d2c6b27fd200a42aa4ac72786e7c60d40efdc76e6011260b6e949c4", size = 233393, upload-time = "2026-04-02T09:27:34.03Z" }, + { url = "https://files.pythonhosted.org/packages/be/c1/06c6c49d5a5450f76899992f1ee40b41d076aee9279b49cf9974d2f313d5/charset_normalizer-3.4.7-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6c114670c45346afedc0d947faf3c7f701051d2518b943679c8ff88befe14f8e", size = 223251, upload-time = "2026-04-02T09:27:35.369Z" }, + { url = "https://files.pythonhosted.org/packages/2b/9f/f2ff16fb050946169e3e1f82134d107e5d4ae72647ec8a1b1446c148480f/charset_normalizer-3.4.7-cp314-cp314t-manylinux_2_31_armv7l.whl", hash = "sha256:a180c5e59792af262bf263b21a3c49353f25945d8d9f70628e73de370d55e1e1", size = 206609, upload-time = "2026-04-02T09:27:36.661Z" }, + { url = "https://files.pythonhosted.org/packages/69/d5/a527c0cd8d64d2eab7459784fb4169a0ac76e5a6fc5237337982fd61347e/charset_normalizer-3.4.7-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:3c9a494bc5ec77d43cea229c4f6db1e4d8fe7e1bbffa8b6f0f0032430ff8ab44", size = 220014, upload-time = "2026-04-02T09:27:38.019Z" }, + { url = "https://files.pythonhosted.org/packages/7e/80/8a7b8104a3e203074dc9aa2c613d4b726c0e136bad1cc734594b02867972/charset_normalizer-3.4.7-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:8d828b6667a32a728a1ad1d93957cdf37489c57b97ae6c4de2860fa749b8fc1e", size = 218979, upload-time = "2026-04-02T09:27:39.37Z" }, + { url = "https://files.pythonhosted.org/packages/02/9a/b759b503d507f375b2b5c153e4d2ee0a75aa215b7f2489cf314f4541f2c0/charset_normalizer-3.4.7-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:cf1493cd8607bec4d8a7b9b004e699fcf8f9103a9284cc94962cb73d20f9d4a3", size = 209238, upload-time = "2026-04-02T09:27:40.722Z" }, + { url = "https://files.pythonhosted.org/packages/c2/4e/0f3f5d47b86bdb79256e7290b26ac847a2832d9a4033f7eb2cd4bcf4bb5b/charset_normalizer-3.4.7-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:0c96c3b819b5c3e9e165495db84d41914d6894d55181d2d108cc1a69bfc9cce0", size = 236110, upload-time = "2026-04-02T09:27:42.33Z" }, + { url = "https://files.pythonhosted.org/packages/96/23/bce28734eb3ed2c91dcf93abeb8a5cf393a7b2749725030bb630e554fdd8/charset_normalizer-3.4.7-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:752a45dc4a6934060b3b0dab47e04edc3326575f82be64bc4fc293914566503e", size = 219824, upload-time = "2026-04-02T09:27:43.924Z" }, + { url = "https://files.pythonhosted.org/packages/2c/6f/6e897c6984cc4d41af319b077f2f600fc8214eb2fe2d6bcb79141b882400/charset_normalizer-3.4.7-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:8778f0c7a52e56f75d12dae53ae320fae900a8b9b4164b981b9c5ce059cd1fcb", size = 233103, upload-time = "2026-04-02T09:27:45.348Z" }, + { url = "https://files.pythonhosted.org/packages/76/22/ef7bd0fe480a0ae9b656189ec00744b60933f68b4f42a7bb06589f6f576a/charset_normalizer-3.4.7-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:ce3412fbe1e31eb81ea42f4169ed94861c56e643189e1e75f0041f3fe7020abe", size = 225194, upload-time = "2026-04-02T09:27:46.706Z" }, + { url = "https://files.pythonhosted.org/packages/c5/a7/0e0ab3e0b5bc1219bd80a6a0d4d72ca74d9250cb2382b7c699c147e06017/charset_normalizer-3.4.7-cp314-cp314t-win32.whl", hash = "sha256:c03a41a8784091e67a39648f70c5f97b5b6a37f216896d44d2cdcb82615339a0", size = 159827, upload-time = "2026-04-02T09:27:48.053Z" }, + { url = "https://files.pythonhosted.org/packages/7a/1d/29d32e0fb40864b1f878c7f5a0b343ae676c6e2b271a2d55cc3a152391da/charset_normalizer-3.4.7-cp314-cp314t-win_amd64.whl", hash = "sha256:03853ed82eeebbce3c2abfdbc98c96dc205f32a79627688ac9a27370ea61a49c", size = 174168, upload-time = "2026-04-02T09:27:49.795Z" }, + { url = "https://files.pythonhosted.org/packages/de/32/d92444ad05c7a6e41fb2036749777c163baf7a0301a040cb672d6b2b1ae9/charset_normalizer-3.4.7-cp314-cp314t-win_arm64.whl", hash = "sha256:c35abb8bfff0185efac5878da64c45dafd2b37fb0383add1be155a763c1f083d", size = 153018, upload-time = "2026-04-02T09:27:51.116Z" }, + { url = "https://files.pythonhosted.org/packages/db/8f/61959034484a4a7c527811f4721e75d02d653a35afb0b6054474d8185d4c/charset_normalizer-3.4.7-py3-none-any.whl", hash = "sha256:3dce51d0f5e7951f8bb4900c257dad282f49190fdbebecd4ba99bcc41fef404d", size = 61958, upload-time = "2026-04-02T09:28:37.794Z" }, +] + +[[package]] +name = "click" +version = "8.4.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/9b/98/518d8e5081007684232226f475082b30087d0f585e8457db087298259f49/click-8.4.1.tar.gz", hash = "sha256:918b5633eddf6b41c32d4f454bf0de810065c74e3f7dbf8ee5452f8be88d3e96", size = 353007, upload-time = "2026-05-22T04:08:37.769Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/c7/0d/67e5b4109ea4a837e80daa87c2c696711955e40449a97e8926672534def2/click-8.4.1-py3-none-any.whl", hash = "sha256:482be17c6991b8c19c5429a1e995d9b0efdbb63172824c41f99965dc0ade8ec2", size = 116639, upload-time = "2026-05-22T04:08:35.26Z" }, +] + +[[package]] +name = "cloudpickle" +version = "3.1.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/27/fb/576f067976d320f5f0114a8d9fa1215425441bb35627b1993e5afd8111e5/cloudpickle-3.1.2.tar.gz", hash = "sha256:7fda9eb655c9c230dab534f1983763de5835249750e85fbcef43aaa30a9a2414", size = 22330, upload-time = "2025-11-03T09:25:26.604Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/39/799be3f2f0f38cc727ee3b4f1445fe6d5e4133064ec2e4115069418a5bb6/cloudpickle-3.1.2-py3-none-any.whl", hash = "sha256:9acb47f6afd73f60dc1df93bb801b472f05ff42fa6c84167d25cb206be1fbf4a", size = 22228, upload-time = "2025-11-03T09:25:25.534Z" }, +] + +[[package]] +name = "cmake" +version = "4.1.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f2/17/f8f42ae205604319cc36f46d9929bd9bfbd83d3d02d6314c44fa97c42006/cmake-4.1.3.tar.gz", hash = "sha256:89f48ddc2570eb62447e33311cffc6dfeb09631bd0a19423d8a59cec8af030f1", size = 34998, upload-time = "2025-11-19T22:41:27.312Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/24/79/1bf4009d7ef16d62e0b92ddb78efeda830ca5903149abf9dc01d270c3d4e/cmake-4.1.3-py3-none-macosx_10_10_universal2.whl", hash = "sha256:3b6b25ce8fecc768881b36a1dfbca0013adac10a299c73e24cf4cbb99e4c37d6", size = 49246088, upload-time = "2025-11-19T22:40:28.02Z" }, + { url = "https://files.pythonhosted.org/packages/4d/9d/14e076406388efa2bbea2366ec0bbe85e2536787ebbb374dda792f068222/cmake-4.1.3-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:3893eb9c20d8a8bac3d951bbef9a4ce9d5495cd35a08b4e08d76215f5ead5897", size = 30381441, upload-time = "2025-11-19T22:40:31.55Z" }, + { url = "https://files.pythonhosted.org/packages/f7/9e/0f7216dfef03f1cbac0cdf4685da6994559f5ede3452e563335a35d6a6cb/cmake-4.1.3-py3-none-manylinux2014_i686.manylinux_2_17_i686.whl", hash = "sha256:487faf892ff5e05084c6a7f229dd9e568d0542b88487386acb42f0cb2f6634b6", size = 30781002, upload-time = "2025-11-19T22:40:35.325Z" }, + { url = "https://files.pythonhosted.org/packages/e5/2e/69d9b1eee7b7c68e9ce53f8449e372151b4967c223ecd43c7083a4dece8d/cmake-4.1.3-py3-none-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:3dbddc52f839df0ebc1c6b6915bd78d63d0805137c6f419fbddd587404276c28", size = 32613762, upload-time = "2025-11-19T22:40:39.488Z" }, + { url = "https://files.pythonhosted.org/packages/2a/9b/deac4d6f8cf4adcaa61d7f16d1ec42d41d471bf330ffcdac4d29c83e46a3/cmake-4.1.3-py3-none-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:b42e99eb6e976f455f29283dd7583270d611b55c7687b5fe8d022d9ae7c95de5", size = 28577197, upload-time = "2025-11-19T22:40:42.517Z" }, + { url = "https://files.pythonhosted.org/packages/e0/6c/323c40671c6f1b3e02bb4a7404fbe2bf653190a56e63cf4b6a4f06e876bc/cmake-4.1.3-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:81f11b72bc59cbe547d9f283487ef0519bf68176edffcdfa1a4dc5a52f292369", size = 29690899, upload-time = "2025-11-19T22:40:45.363Z" }, + { url = "https://files.pythonhosted.org/packages/19/a3/ab7866f55ee11a07aa446ee31b91b8f337f1b702b9546fc7b18e23d0566f/cmake-4.1.3-py3-none-manylinux_2_31_armv7l.whl", hash = "sha256:fd633c4395b1522caedf0b64034d1a48ea0e483f19e9c2985d14ee7152b21593", size = 26522320, upload-time = "2025-11-19T22:40:48.463Z" }, + { url = "https://files.pythonhosted.org/packages/db/21/a99ed3f1192c85d6d565e61c0cd0161f8046afcf0b0951e6492be632f2f2/cmake-4.1.3-py3-none-manylinux_2_35_riscv64.whl", hash = "sha256:ea40a64b8027f2b7fb1684312a2f170e4d0904b7a4f123cd96e7290103bb1ed4", size = 28869263, upload-time = "2025-11-19T22:40:51.618Z" }, + { url = "https://files.pythonhosted.org/packages/13/66/3c32bb2d5e72f00a0861066b29cc6981cbffcf9786f7339317f151a4d4be/cmake-4.1.3-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:e3782d5f82e8960290e50747b1fb5ff8396363a656ad5716a3aedc77334ca94f", size = 41751469, upload-time = "2025-11-19T22:40:54.75Z" }, + { url = "https://files.pythonhosted.org/packages/05/60/922c05d62ba5b422afd211966877673ddceb634e95552893bf9a11cc4e58/cmake-4.1.3-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:44b011b8374aac8f3d7a7fb319b3c25d54c2fd9342d94a855ae3a64240efe828", size = 35040544, upload-time = "2025-11-19T22:40:57.669Z" }, + { url = "https://files.pythonhosted.org/packages/71/ae/957336b0489f7d3050cd19010585d4ab5ebcdef485292b9baee68ebbeccf/cmake-4.1.3-py3-none-musllinux_1_2_i686.whl", hash = "sha256:1f29e924fd6d1a4f2f731eb743cc687b82063f73f15f0b4fb8e2b8a8211faba8", size = 45811680, upload-time = "2025-11-19T22:41:01.124Z" }, + { url = "https://files.pythonhosted.org/packages/85/0d/41e2ac694b156b249bfaccec071897c46b21deeb4db1ec51d949e7843f4b/cmake-4.1.3-py3-none-musllinux_1_2_ppc64le.whl", hash = "sha256:466cdce904392f18b201471a3a6429cc12b4d98a166faa3ee0ad4461f3043083", size = 45859079, upload-time = "2025-11-19T22:41:04.694Z" }, + { url = "https://files.pythonhosted.org/packages/dd/d4/42ca38f001b1f1327c19734e4c0080557a7991db832aacfe4b193ba7743a/cmake-4.1.3-py3-none-musllinux_1_2_riscv64.whl", hash = "sha256:d37db26f98ac26f0858cf6a30157a4be83b29cb195afeb640b355b097f1d94d7", size = 39946757, upload-time = "2025-11-19T22:41:08.082Z" }, + { url = "https://files.pythonhosted.org/packages/73/ab/a3965bfce6376894c76e17af095b0e360a9e1a1719e3df1e244ea6d6d893/cmake-4.1.3-py3-none-musllinux_1_2_s390x.whl", hash = "sha256:18e1e2b7b226763017521ba8721c74d1a2a3cd7d1ec8e889b0b869d4e939370b", size = 44016695, upload-time = "2025-11-19T22:41:11.84Z" }, + { url = "https://files.pythonhosted.org/packages/a4/66/fa0e8d3c66459a616f0baf9d22933e14137c259f4b62f0dad9c3723cf42d/cmake-4.1.3-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:6966746b25d1e9c8d32c731452e220e84331b5133544f710b21bd228a93812ca", size = 43357408, upload-time = "2025-11-19T22:41:15.302Z" }, + { url = "https://files.pythonhosted.org/packages/6e/8f/5c43c6465af62bb16159de113438365c789c5a69261dad36746aa1ec74b8/cmake-4.1.3-py3-none-win32.whl", hash = "sha256:b1c890af27bb548d0a2c0e1affc81ad180fc17d8dfa9545e0658153446fe7db4", size = 34268275, upload-time = "2025-11-19T22:41:18.733Z" }, + { url = "https://files.pythonhosted.org/packages/c1/51/2bc56a4d8d9c2680913f1a7e0b7a33e48100f336df91176b74dda6dff8b3/cmake-4.1.3-py3-none-win_amd64.whl", hash = "sha256:fd5a2ea9a38c6109036d8c912a7db4df2de241cfbc00b7424ae246494387da80", size = 37545974, upload-time = "2025-11-19T22:41:21.85Z" }, + { url = "https://files.pythonhosted.org/packages/36/a5/ec213d5c228ab7a205abeb51cc23aa1be9b586041c40cdccc157c325822a/cmake-4.1.3-py3-none-win_arm64.whl", hash = "sha256:79bd8f92a3385cc6641949b0274cd10ee9a4f45a2c13840121b68b2e90b5af3a", size = 36337597, upload-time = "2025-11-19T22:41:24.968Z" }, +] + +[[package]] +name = "colorama" +version = "0.4.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697, upload-time = "2022-10-25T02:36:22.414Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" }, +] + +[[package]] +name = "cuda-bindings" +version = "12.9.4" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "cuda-pathfinder", marker = "sys_platform == 'linux'" }, +] +wheels = [ + { url = "https://files.pythonhosted.org/packages/a9/c1/dabe88f52c3e3760d861401bb994df08f672ec893b8f7592dc91626adcf3/cuda_bindings-12.9.4-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:fda147a344e8eaeca0c6ff113d2851ffca8f7dfc0a6c932374ee5c47caa649c8", size = 12151019, upload-time = "2025-10-21T14:51:43.167Z" }, + { url = "https://files.pythonhosted.org/packages/63/56/e465c31dc9111be3441a9ba7df1941fe98f4aa6e71e8788a3fb4534ce24d/cuda_bindings-12.9.4-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:32bdc5a76906be4c61eb98f546a6786c5773a881f3b166486449b5d141e4a39f", size = 11906628, upload-time = "2025-10-21T14:51:49.905Z" }, + { url = "https://files.pythonhosted.org/packages/a3/84/1e6be415e37478070aeeee5884c2022713c1ecc735e6d82d744de0252eee/cuda_bindings-12.9.4-cp313-cp313t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:56e0043c457a99ac473ddc926fe0dc4046694d99caef633e92601ab52cbe17eb", size = 11925991, upload-time = "2025-10-21T14:51:56.535Z" }, + { url = "https://files.pythonhosted.org/packages/d1/af/6dfd8f2ed90b1d4719bc053ff8940e494640fe4212dc3dd72f383e4992da/cuda_bindings-12.9.4-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8b72ee72a9cc1b531db31eebaaee5c69a8ec3500e32c6933f2d3b15297b53686", size = 11922703, upload-time = "2025-10-21T14:52:03.585Z" }, + { url = "https://files.pythonhosted.org/packages/6c/19/90ac264acc00f6df8a49378eedec9fd2db3061bf9263bf9f39fd3d8377c3/cuda_bindings-12.9.4-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d80bffc357df9988dca279734bc9674c3934a654cab10cadeed27ce17d8635ee", size = 11924658, upload-time = "2025-10-21T14:52:10.411Z" }, +] + +[[package]] +name = "cuda-pathfinder" +version = "1.5.5" +source = { registry = "https://pypi.org/simple" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/11/c8/26f2e4aae92f11522a96043892ba39a90eac610d5242523aa863212bc1c7/cuda_pathfinder-1.5.5-py3-none-any.whl", hash = "sha256:0228c023f95d1480f143ef5c8922d27a2ab052087a942e81dc289c9eb8f91689", size = 51671, upload-time = "2026-05-27T01:21:25.413Z" }, +] + +[[package]] +name = "datasets" +version = "4.8.5" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "dill" }, + { name = "filelock" }, + { name = "fsspec", extra = ["http"] }, + { name = "httpx" }, + { name = "huggingface-hub" }, + { name = "multiprocess" }, + { name = "numpy" }, + { name = "packaging" }, + { name = "pandas" }, + { name = "pyarrow" }, + { name = "pyyaml" }, + { name = "requests" }, + { name = "tqdm" }, + { name = "xxhash" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/66/34/14cd8e76f907f7d4dca2334cfeec9f81d30fd15c25a015f99aaea694eaed/datasets-4.8.5.tar.gz", hash = "sha256:0f0c1c3d56ffff2c93b2f4c63c95bac94f3d7e8621aea2a2a576275233bba772", size = 605649, upload-time = "2026-04-27T15:43:57.384Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/65/99/00f3196036501b53032c4b1ab8337a0b978dee832ed276dae3815df4e8b5/datasets-4.8.5-py3-none-any.whl", hash = "sha256:5079900781719c0e063a8efdd2cd95a31ad0c63209178669cd23cf1b926149ff", size = 528973, upload-time = "2026-04-27T15:43:53.702Z" }, +] + +[[package]] +name = "deepdiff" +version = "8.6.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "orderly-set" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/89/50/767448e792d41bfb6094ee317a355c1cb221dca24b2e178e2203bbea2a77/deepdiff-8.6.2.tar.gz", hash = "sha256:186dcbd181e4d76cef11ab05f802d0056c5d6083c5a6748c1473e9d7481e183e", size = 634860, upload-time = "2026-03-18T17:16:33.785Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/2b/5f/c52bd1255db763d0cdcb7084d2e90c42119cb229302c56bdf1d0aa78abd2/deepdiff-8.6.2-py3-none-any.whl", hash = "sha256:4d22034a866c3928303a9332c279362f714192d9305bac17c498720d095fd1b4", size = 91979, upload-time = "2026-03-18T17:16:32.171Z" }, +] + +[[package]] +name = "detect-installer" +version = "0.1.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/5f/ce/6897d812825e9d4c53e3c7112726e800cc5231b013b2223bf64f653ff362/detect_installer-0.1.0.tar.gz", hash = "sha256:00ad7ba0a36e3cf7d08a40d3643011746dbc112597c7d475cc91c416710ca4e7", size = 3049, upload-time = "2026-02-23T10:40:22.567Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/cc/34/8cc73273414405086c58852916e4031812a6a30fe04c057e37ad99397b7f/detect_installer-0.1.0-py3-none-any.whl", hash = "sha256:034fb20fd665c36e6ba52b8821525ea07fb4f7f938cac459df889fb33801528a", size = 4539, upload-time = "2026-02-23T10:40:23.807Z" }, +] + +[[package]] +name = "dill" +version = "0.4.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/81/e1/56027a71e31b02ddc53c7d65b01e68edf64dea2932122fe7746a516f75d5/dill-0.4.1.tar.gz", hash = "sha256:423092df4182177d4d8ba8290c8a5b640c66ab35ec7da59ccfa00f6fa3eea5fa", size = 187315, upload-time = "2026-01-19T02:36:56.85Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/1e/77/dc8c558f7593132cf8fefec57c4f60c83b16941c574ac5f619abb3ae7933/dill-0.4.1-py3-none-any.whl", hash = "sha256:1e1ce33e978ae97fcfcff5638477032b801c46c7c65cf717f95fbc2248f79a9d", size = 120019, upload-time = "2026-01-19T02:36:55.663Z" }, +] + +[[package]] +name = "distlib" +version = "0.4.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/86/b2/d6fc3f2347f43dada79e5ff118493e8109c98400a0e29a1d5264a3aa479b/distlib-0.4.1.tar.gz", hash = "sha256:c3804d0d2d4b5fcd44036eb860cb6660485fcdf5c2aba53dc324d805837ea65b", size = 610526, upload-time = "2026-06-02T11:17:40.691Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/25/18/3497c4fa83a76dcb154923fd2075522e8dd6995ecee4093c00ae18160046/distlib-0.4.1-py2.py3-none-any.whl", hash = "sha256:9c2c552c68cbadc619f2d0ed3a69e27c351a3f4c9baa9ffb7df9e9cdc3d19a97", size = 469216, upload-time = "2026-06-02T11:17:38.779Z" }, +] + +[[package]] +name = "dnspython" +version = "2.8.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/8c/8b/57666417c0f90f08bcafa776861060426765fdb422eb10212086fb811d26/dnspython-2.8.0.tar.gz", hash = "sha256:181d3c6996452cb1189c4046c61599b84a5a86e099562ffde77d26984ff26d0f", size = 368251, upload-time = "2025-09-07T18:58:00.022Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ba/5a/18ad964b0086c6e62e2e7500f7edc89e3faa45033c71c1893d34eed2b2de/dnspython-2.8.0-py3-none-any.whl", hash = "sha256:01d9bbc4a2d76bf0db7c1f729812ded6d912bd318d3b1cf81d30c0f845dbf3af", size = 331094, upload-time = "2025-09-07T18:57:58.071Z" }, +] + +[[package]] +name = "draccus" +version = "0.10.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "mergedeep" }, + { name = "pyyaml" }, + { name = "pyyaml-include" }, + { name = "toml" }, + { name = "typing-inspect" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/4e/e2/f5012fda17ee5d1eaf3481b6ca3e11dffa5348e5e08ab745538fdc8041bb/draccus-0.10.0.tar.gz", hash = "sha256:8dd08304219becdcd66cd16058ba98e9c3e6b7bfe48ccb9579dae39f8d37ae19", size = 62243, upload-time = "2025-02-05T07:27:48.182Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/c4/9a/a83083b230d352ee5d205757b74006dbe084448ca45e3bc5ca99215b1e55/draccus-0.10.0-py3-none-any.whl", hash = "sha256:90243418ae0e9271c390a59cafb6acfd37001193696ed36fcc8525f791a83282", size = 71783, upload-time = "2025-02-05T07:27:46.1Z" }, +] + +[[package]] +name = "einops" +version = "0.8.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/2c/77/850bef8d72ffb9219f0b1aac23fbc1bf7d038ee6ea666f331fa273031aa2/einops-0.8.2.tar.gz", hash = "sha256:609da665570e5e265e27283aab09e7f279ade90c4f01bcfca111f3d3e13f2827", size = 56261, upload-time = "2026-01-26T04:13:17.638Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/2a/09/f8d8f8f31e4483c10a906437b4ce31bdf3d6d417b73fe33f1a8b59e34228/einops-0.8.2-py3-none-any.whl", hash = "sha256:54058201ac7087911181bfec4af6091bb59380360f069276601256a76af08193", size = 65638, upload-time = "2026-01-26T04:13:18.546Z" }, +] + +[[package]] +name = "email-validator" +version = "2.3.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "dnspython" }, + { name = "idna" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/f5/22/900cb125c76b7aaa450ce02fd727f452243f2e91a61af068b40adba60ea9/email_validator-2.3.0.tar.gz", hash = "sha256:9fc05c37f2f6cf439ff414f8fc46d917929974a82244c20eb10231ba60c54426", size = 51238, upload-time = "2025-08-26T13:09:06.831Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/de/15/545e2b6cf2e3be84bc1ed85613edd75b8aea69807a71c26f4ca6a9258e82/email_validator-2.3.0-py3-none-any.whl", hash = "sha256:80f13f623413e6b197ae73bb10bf4eb0908faf509ad8362c5edeb0be7fd450b4", size = 35604, upload-time = "2025-08-26T13:09:05.858Z" }, +] + +[[package]] +name = "evdev" +version = "1.9.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/a5/f5/397b61091120a9ca5001041dd7bf76c385b3bfd67a0e5bcb74b852bd22a4/evdev-1.9.3.tar.gz", hash = "sha256:2c140e01ac8437758fa23fe5c871397412461f42d421aa20241dc8fe8cfccbc9", size = 32723, upload-time = "2026-02-05T21:54:24.987Z" } + +[[package]] +name = "farama-notifications" +version = "0.0.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/ec/91/14397890dde30adc4bee6462158933806207bc5dd10d7b4d09d5c33845cf/farama_notifications-0.0.6.tar.gz", hash = "sha256:b19acac4bb41d76e59e03394b5dd165f4761c86fa327f56307a35cbee3b60158", size = 2517, upload-time = "2026-04-24T08:43:57.603Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7c/f0/21f81892e4ed10f4ec3ef2e7cf8635fb76e7c0907c55d0da66be50094760/farama_notifications-0.0.6-py3-none-any.whl", hash = "sha256:f84839188efa1ce5bb361c2a84881b2dc2c0d0d7fb661ff00421820170930935", size = 2897, upload-time = "2026-04-24T08:43:56.785Z" }, +] + +[[package]] +name = "fastapi" +version = "0.136.3" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "annotated-doc" }, + { name = "pydantic" }, + { name = "starlette" }, + { name = "typing-extensions" }, + { name = "typing-inspection" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/81/2d/ff8d91d7b564d464629a0fd50a4489c97fcb836ac230bf3a7269232a9b1f/fastapi-0.136.3.tar.gz", hash = "sha256:e487fae93ad408e6f47641ee4dfe389864fd7bec92e547ea8498fc13f43e83ab", size = 396410, upload-time = "2026-05-23T18:53:15.192Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e0/82/45359b62a067409bd929ae8a56b8ed13e5a8c8a61194b3c236920999ab83/fastapi-0.136.3-py3-none-any.whl", hash = "sha256:3d2a69bdf04b7e9f3afa292c3bc7a98816bbfafa10bc9b45f3f3700d2f761620", size = 117481, upload-time = "2026-05-23T18:53:16.924Z" }, +] + +[package.optional-dependencies] +standard = [ + { name = "email-validator" }, + { name = "fastapi-cli", extra = ["standard"] }, + { name = "fastar" }, + { name = "httpx" }, + { name = "jinja2" }, + { name = "pydantic-extra-types" }, + { name = "pydantic-settings" }, + { name = "python-multipart" }, + { name = "uvicorn", extra = ["standard"] }, +] + +[[package]] +name = "fastapi-cli" +version = "0.0.24" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "rich-toolkit" }, + { name = "typer" }, + { name = "uvicorn", extra = ["standard"] }, +] +sdist = { url = "https://files.pythonhosted.org/packages/6e/58/74797ae9e4610cfa0c6b34c8309096d3b20bb29be3b8b5fbf1004d10fa5f/fastapi_cli-0.0.24.tar.gz", hash = "sha256:1afc9c9e21d7ebc8a3ca5e31790cd8d837742be7e4f8b9236e99cb3451f0de00", size = 19043, upload-time = "2026-02-24T10:45:10.476Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/c7/4b/68f9fe268e535d79c76910519530026a4f994ce07189ac0dded45c6af825/fastapi_cli-0.0.24-py3-none-any.whl", hash = "sha256:4a1f78ed798f106b4fee85ca93b85d8fe33c0a3570f775964d37edb80b8f0edc", size = 12304, upload-time = "2026-02-24T10:45:09.552Z" }, +] + +[package.optional-dependencies] +standard = [ + { name = "fastapi-cloud-cli" }, + { name = "uvicorn", extra = ["standard"] }, +] + +[[package]] +name = "fastapi-cloud-cli" +version = "0.19.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "detect-installer" }, + { name = "fastar" }, + { name = "httpx" }, + { name = "pydantic", extra = ["email"] }, + { name = "rich-toolkit" }, + { name = "rignore" }, + { name = "sentry-sdk" }, + { name = "typer" }, + { name = "uvicorn", extra = ["standard"] }, +] +sdist = { url = "https://files.pythonhosted.org/packages/a7/7c/f194925af8fabdb0b7a886a1b89087c0b7f327f99e79497a882aa94c1e34/fastapi_cloud_cli-0.19.0.tar.gz", hash = "sha256:f97b31c2ad6af3832eb4065870bdca3365b6e827a0ccf6eeb15e477bc1662b13", size = 57476, upload-time = "2026-06-01T08:24:03.407Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/bf/e6/1a2ec890fc273b9da2b173ca45f692a2e24a369bdd39ea7812c1d8a799e5/fastapi_cloud_cli-0.19.0-py3-none-any.whl", hash = "sha256:a2dfc4074c321e63ec88589cc1f90573d4b5bf980ddc44a7033e6f3cd8e96628", size = 38239, upload-time = "2026-06-01T08:24:02.437Z" }, +] + +[[package]] +name = "fastar" +version = "0.11.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/03/0f/0aeb3fc50046617702acc0078b277b58367fd62eb727b9ec733ae0e8bbcc/fastar-0.11.0.tar.gz", hash = "sha256:aa7f100f7313c03fdb20f1385927ba95671071ba308ad0c1763fef295e1895ce", size = 70238, upload-time = "2026-04-13T17:11:17.143Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0f/06/a5773706afc8bd496769786590bbc56d2d0ee419a299cc12ea3f5717fcf3/fastar-0.11.0-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:3c51f1c2cdddbd1420d2897ace7738e36c65e17f6ae84e0bfe763f8d1068bb97", size = 708394, upload-time = "2026-04-13T17:09:57.269Z" }, + { url = "https://files.pythonhosted.org/packages/cc/a6/d5e2a4e48495616440a21eed07558219ca90243ad00b0502586f95bd4833/fastar-0.11.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:0d9d6b052baf5380baea866675dab6ccd04ec2460d12b1c46f10ce3f4ee6a820", size = 628417, upload-time = "2026-04-13T17:09:42.145Z" }, + { url = "https://files.pythonhosted.org/packages/ab/69/9816d69ac8265c9e50456637a487ccfb7a9c566efd9dbcd673df9c2558c2/fastar-0.11.0-cp312-cp312-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:bd2f05666d4df7e14885b5c38fefd92a785917387513d33d837ff42ec143a22f", size = 863950, upload-time = "2026-04-13T17:09:11.506Z" }, + { url = "https://files.pythonhosted.org/packages/5b/0d/f88daad53aff2e754b6b5ff2a7113f72447a34f6ef17cc23ca99988117b7/fastar-0.11.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c1e6e74aba1ae77ca4aedcaf1697cd413319f4c88a5ccbe5b42c709517c5097e", size = 760737, upload-time = "2026-04-13T17:07:55.958Z" }, + { url = "https://files.pythonhosted.org/packages/2f/a6/82ef4ecd969d50d92ed3ed9dbd8fe77faa24be5e5736f716edc9f4ce8d62/fastar-0.11.0-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:38ef77fe940bbc9b37a98bd838727f844b11731cd39358a2640ff864fb385086", size = 757603, upload-time = "2026-04-13T17:08:10.623Z" }, + { url = "https://files.pythonhosted.org/packages/03/35/50249f0d827251f8ac511495e2eacccebda80a00a0ad73e9615b8113b84f/fastar-0.11.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8955e61b32d6aff82c983217abf80933fd823b0e727586fc72f08043d996fd59", size = 923952, upload-time = "2026-04-13T17:08:25.526Z" }, + { url = "https://files.pythonhosted.org/packages/7b/d8/faee41659e9c379d906d24eaee6d6833ac8cfef0a5df480e5c2a8d3efb33/fastar-0.11.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:483532442cdb08fbff0169510224eae0836f2f672cea6aacb52847d90fefdc46", size = 816574, upload-time = "2026-04-13T17:08:56.076Z" }, + { url = "https://files.pythonhosted.org/packages/22/47/0448ea7992b997dad2bf004bfd98eca74b5858630eae080b50c7b17d9ddc/fastar-0.11.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ef5a6071121e05d8287fc75bccb054bcbac8bb0501200a0c0a8feeace5303ea4", size = 819382, upload-time = "2026-04-13T17:09:26.66Z" }, + { url = "https://files.pythonhosted.org/packages/33/ef/0d63eb43586831b7a6f8b22c4d77125a7c594423af1f4f090fa9541b9b40/fastar-0.11.0-cp312-cp312-manylinux_2_31_riscv64.whl", hash = "sha256:e45e598af5afe8412197d4786efd6cf29be02e7d3d4f6a3461149eae5d7e94f1", size = 885254, upload-time = "2026-04-13T17:08:40.9Z" }, + { url = "https://files.pythonhosted.org/packages/01/25/edd584675d69e49a165052c3ee886df1c5d574f3e7d813c990306387c623/fastar-0.11.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:2e160919b1c47ddb8538e7e8eb4cd527281b40f0bf75110a75993838ef61f286", size = 971239, upload-time = "2026-04-13T17:10:12.997Z" }, + { url = "https://files.pythonhosted.org/packages/a5/37/e8bb24f506ba2b08fbaf36c5800e843bd4d542954e9331f00418e2d23349/fastar-0.11.0-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:4bb4dc0fc8f7a6807febcebce8a2f3626ba4955a9263d81ecc630aad83be84c0", size = 1035185, upload-time = "2026-04-13T17:10:30.207Z" }, + { url = "https://files.pythonhosted.org/packages/9a/bf/be753736296338149ee4cb3e92e2b5423d6ba17c7b951d15218fd7e99bbf/fastar-0.11.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:4ec95af56aa173f6e320e1183001bf108ba59beaf13edd1fc8200648db203588", size = 1072191, upload-time = "2026-04-13T17:10:47.072Z" }, + { url = "https://files.pythonhosted.org/packages/d2/cd/a81c1aaafb5a22ce57c98ae22f39c89413ed53e4ee6e1b1444b0bd666a6c/fastar-0.11.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:136cf342735464091c39dc3708168f9fdeb9ebea40b1ead937c61afaf46143d9", size = 1028054, upload-time = "2026-04-13T17:11:04.293Z" }, + { url = "https://files.pythonhosted.org/packages/ec/88/1ce4eed3d70627c95f49ca017f6bbbf2ddcc4b0c601d293259de7689bc20/fastar-0.11.0-cp312-cp312-win32.whl", hash = "sha256:35f23c11b556cc4d3704587faacbc0037f7bdf6c4525cd1d09c70bda4b1c6809", size = 454198, upload-time = "2026-04-13T17:11:45.168Z" }, + { url = "https://files.pythonhosted.org/packages/8f/1d/26ce92f4331cd61a69840db9ca6115829805eec24f285481a854f578e917/fastar-0.11.0-cp312-cp312-win_amd64.whl", hash = "sha256:920bc56c3c0b8a8ca492904941d1883c1c947c858cd93343356c29122a38f44c", size = 486697, upload-time = "2026-04-13T17:11:31.084Z" }, + { url = "https://files.pythonhosted.org/packages/ed/96/e6eda4480559c69b05d466e7b5ea9170e81fef3795a73e059959a3258319/fastar-0.11.0-cp312-cp312-win_arm64.whl", hash = "sha256:395248faf89e8a6bd5dc1fd544c8465113b627cb6d7c8b296796b60ebea33593", size = 462591, upload-time = "2026-04-13T17:11:20.577Z" }, + { url = "https://files.pythonhosted.org/packages/c9/d6/3be260037e86fb694e88d47f583bac3a0188c99cee1a6b257ac26cb6b53c/fastar-0.11.0-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:33f544b08b4541b678e53749b4552a44720d96761fb79c172b005b1089c443ed", size = 707975, upload-time = "2026-04-13T17:09:58.866Z" }, + { url = "https://files.pythonhosted.org/packages/e1/cd/7867aefb1784662554a335f2952c75a50f0c70585ed0d2210d6cc15e5627/fastar-0.11.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:91c1c792447e4a642745f347ff9847c52af39633071c57ee67ed53c157fc3506", size = 628460, upload-time = "2026-04-13T17:09:43.776Z" }, + { url = "https://files.pythonhosted.org/packages/e5/2b/d11d84bdd5e0e377771b955755771e3460b290da5809cb78c1b735ee2228/fastar-0.11.0-cp313-cp313-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:881247e6b6eaea59fc6569f9b61447aa6b9fc2ee864e048b4643d69c52745805", size = 863054, upload-time = "2026-04-13T17:09:13.048Z" }, + { url = "https://files.pythonhosted.org/packages/25/39/d3f428b318fa940b1b6e785b8d54fc895dfb5d5b945ef8d5442ffa904fb2/fastar-0.11.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:863b7929845c9fec92ef6c8d59579cf46af5136655e5342f8df5cebe46cab06c", size = 760247, upload-time = "2026-04-13T17:07:57.396Z" }, + { url = "https://files.pythonhosted.org/packages/9e/04/03949aee82aabb8ede06ac5a4a5579ffaf98a8fe59ce958494508ff15513/fastar-0.11.0-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:96b4a57df12bf3211662627a3ea29d62ecb314a2434a0d0843f9fc23e47536e5", size = 756512, upload-time = "2026-04-13T17:08:12.415Z" }, + { url = "https://files.pythonhosted.org/packages/3f/0c/2ca1ae0a3828ca51047962d932b80daca2522db73e8cb9d040cb6ebe28d5/fastar-0.11.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ceef1c2c4df7b7b8ebd3f5d718bbf457b9bbdf25ce0bd07870211ec4fbd9aff4", size = 922183, upload-time = "2026-04-13T17:08:27.187Z" }, + { url = "https://files.pythonhosted.org/packages/65/68/7fe808b1f73a68e686f25434f538c6dc10ef4dfb3db0ace22cd861744bf8/fastar-0.11.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b8e545918441910a779659d4759ad0eef349e935fbdb4668a666d3681567eb05", size = 816394, upload-time = "2026-04-13T17:08:57.657Z" }, + { url = "https://files.pythonhosted.org/packages/1f/17/07d086080f8a83b8d7966955e29bcdbd6a060f5bd949dc9d5abd3658cead/fastar-0.11.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:28095bb8f821e85fc2764e1a55f03e5e2876dee2abe7cd0ee9420d929905d643", size = 818983, upload-time = "2026-04-13T17:09:28.46Z" }, + { url = "https://files.pythonhosted.org/packages/fb/e2/2c4edf0910af2e814ff6d65b77a91196d472ca8a9fb2033bd983f6856caa/fastar-0.11.0-cp313-cp313-manylinux_2_31_riscv64.whl", hash = "sha256:0fafb95ecbe70f666a5e9b35dd63974ccdc9bb3d99ccdbd4014a823ec3e659b5", size = 884689, upload-time = "2026-04-13T17:08:42.763Z" }, + { url = "https://files.pythonhosted.org/packages/fa/ba/04fdcbd6558e60de4ced3b55230fac47675d181252582b2fcec3c74608e5/fastar-0.11.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:af48fed039b94016629dcdad1c95c90c486326dd068de2b0a4df419ee09b6821", size = 970677, upload-time = "2026-04-13T17:10:15.124Z" }, + { url = "https://files.pythonhosted.org/packages/df/b3/2b860a9658550167dbd5824c85e88d0b4b912bf493e42a6322544d6e483d/fastar-0.11.0-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:74cd96163f39b8638ab4e8d49708ca887959672a22871d8170d01f067319533b", size = 1034026, upload-time = "2026-04-13T17:10:32.318Z" }, + { url = "https://files.pythonhosted.org/packages/b7/9b/fa42ea1188b144bac4b1b60753dfd449974a4d5eda132029ee7711569f94/fastar-0.11.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:4e8b993cb5613bab495ed482810bedc0986633fcb9a3b55c37ec88e0d6714f6a", size = 1071147, upload-time = "2026-04-13T17:10:48.833Z" }, + { url = "https://files.pythonhosted.org/packages/95/c8/d2e501556dca9f1fbc9246111a31792fb49ad908fa4927f34938a97a3604/fastar-0.11.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:dfe39d91fc28e37e06162d94afe01050220edb7df554acb5b702b5503e564816", size = 1028377, upload-time = "2026-04-13T17:11:06.374Z" }, + { url = "https://files.pythonhosted.org/packages/db/33/5f11f23eca0a569cd052507bc45dda2e5468697f8665728d25be44120f7d/fastar-0.11.0-cp313-cp313-win32.whl", hash = "sha256:c5f63d4d99ff4bfb37c659982ec413358bdee747005348756cc50a04d412d989", size = 454089, upload-time = "2026-04-13T17:11:46.821Z" }, + { url = "https://files.pythonhosted.org/packages/da/2f/35ff03c939cba7a255a9132367873fec6c355fd06a7f84fedcbaf4c8129f/fastar-0.11.0-cp313-cp313-win_amd64.whl", hash = "sha256:8690ed1928d31ded3ada308e1086525fb3871f5fa81e1b69601a3f7774004583", size = 486312, upload-time = "2026-04-13T17:11:32.86Z" }, + { url = "https://files.pythonhosted.org/packages/ef/71/ee9246cbfcbfd4144558f35e7e9a306ffe0a7564730a5188c45f21d2dab8/fastar-0.11.0-cp313-cp313-win_arm64.whl", hash = "sha256:d977ded9d98a0719a305e0a4d5ee811f1d3e856d853a50acb8ae833c3cd6d5d2", size = 461975, upload-time = "2026-04-13T17:11:22.589Z" }, + { url = "https://files.pythonhosted.org/packages/7a/cd/3644c48ecac456f928c12d47ec3bed36c36555b17c3859856f1ff860265d/fastar-0.11.0-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:71375bd6f03c2a43eb47bd949ea38ff45434917f9cdac79675c5b9f60de4fa73", size = 707860, upload-time = "2026-04-13T17:10:00.371Z" }, + { url = "https://files.pythonhosted.org/packages/69/ca/dee04476ae3626b2b040a60ad84628f77e1ffd8444232f2426b0ca1e0d7e/fastar-0.11.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:eddfd9cab16e19ae247fe44bf992cb403ccfe27d3931d6de29a4695d95ad386c", size = 628216, upload-time = "2026-04-13T17:09:45.355Z" }, + { url = "https://files.pythonhosted.org/packages/dc/5e/9395c7353d079cb4f5be0f7982ce0dc9f2e7dec5fd175eef466729d6023a/fastar-0.11.0-cp314-cp314-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:7c371f1d4386c699018bb64eb2fa785feacf32785559049d2bb72fe4af023f53", size = 864378, upload-time = "2026-04-13T17:09:14.611Z" }, + { url = "https://files.pythonhosted.org/packages/fa/ba/1e4f67148223ff219612b6281a6000357abbcc2417964fa5c83f11d68fce/fastar-0.11.0-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cad7fa41e3e66554387481c1a09365e4638becd322904932674159d5f4046728", size = 760921, upload-time = "2026-04-13T17:07:59.138Z" }, + { url = "https://files.pythonhosted.org/packages/0f/82/09d11fb6d12f17993ffaf32ffd30c3c121a11e2966e84f19fb6f66430118/fastar-0.11.0-cp314-cp314-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:cf36652fa71b83761717c9899b98732498f8a2cb6327ff16bbf07f6be85c3437", size = 757012, upload-time = "2026-04-13T17:08:14.186Z" }, + { url = "https://files.pythonhosted.org/packages/52/1f/5aeeacc4cb65615e2c9292cd9c5b0cd6fb6d2e6ee472ca6adc6c1b1b22ef/fastar-0.11.0-cp314-cp314-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f68ff8c17833053da4841720e95edde80ce45bb994b6b7d51418dddaac70ee47", size = 924510, upload-time = "2026-04-13T17:08:28.741Z" }, + { url = "https://files.pythonhosted.org/packages/bb/1a/1e5bdabbeaf2e856928956292609f2ff6a650f94480fb8afaca30229e483/fastar-0.11.0-cp314-cp314-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4563ed37a12ea1cdc398af8571258d24b988bf342b7b3bf5451bd5891243280c", size = 816602, upload-time = "2026-04-13T17:08:59.461Z" }, + { url = "https://files.pythonhosted.org/packages/87/24/f960147910da3bed41a3adfcb026e17d5f50f4cf467a3324237a7088f61a/fastar-0.11.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cee63c9875cba3b70dc44338c560facc5d6e763047dcc4a30501f9a68cf5f890", size = 819452, upload-time = "2026-04-13T17:09:29.926Z" }, + { url = "https://files.pythonhosted.org/packages/cc/f4/3e77d7901d5707fd7f8a352e153c8ae09ea974e6fabad0b7c4eb9944b8d4/fastar-0.11.0-cp314-cp314-manylinux_2_31_riscv64.whl", hash = "sha256:bd76bfffae6d0a91f4ac4a612f721e7aec108db97dccdd120ae063cd66959f27", size = 885254, upload-time = "2026-04-13T17:08:44.285Z" }, + { url = "https://files.pythonhosted.org/packages/47/01/1585edd5ec47782ae93cd94edf05828e0ab02ef00aec00aea4194a600464/fastar-0.11.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:8f5b707501ec01c1bc0518f741f01d322e50c9adc19a451aa24f67a2316e9397", size = 971496, upload-time = "2026-04-13T17:10:17.024Z" }, + { url = "https://files.pythonhosted.org/packages/f1/e9/6874c9d1236ded565a0bed54b320ac9f165f287b1d89490fb70f9f323c81/fastar-0.11.0-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:37c0b5a88a657839aad98b0a6c9e4ac4c2c15d6b49c44ee3935c6b08e9d3e479", size = 1034685, upload-time = "2026-04-13T17:10:34.063Z" }, + { url = "https://files.pythonhosted.org/packages/14/d8/4ab20613ce2983427aee958e39be878dba874aa227c530a845e32429c4f6/fastar-0.11.0-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:6c55f536c62a6efb180c1af0d5182948bff576bbfe6276e8e1359c9c7d2215d8", size = 1072675, upload-time = "2026-04-13T17:10:50.53Z" }, + { url = "https://files.pythonhosted.org/packages/1f/ae/5ac3b7c20ce4b08f011dd2b979f96caabe64f9b10b157f211ea91bdfadca/fastar-0.11.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:3082eeca59e189b9039335862f4c2780c0c8871d656bfdf559db4414a105b251", size = 1029330, upload-time = "2026-04-13T17:11:08.138Z" }, + { url = "https://files.pythonhosted.org/packages/8a/e7/37cd6a1d4e288292170b64e19d79ecce2a7de8bb76790323399a2abc4619/fastar-0.11.0-cp314-cp314-win32.whl", hash = "sha256:b201a0a4e29f9fec2a177e13154b8725ec65ab9f83bd6415483efaa2aa18344b", size = 453940, upload-time = "2026-04-13T17:11:48.713Z" }, + { url = "https://files.pythonhosted.org/packages/ff/1c/795c878b1ee29d79021cf8ed81f18f2b25ccde58453b0d34b9bdc7e025ea/fastar-0.11.0-cp314-cp314-win_amd64.whl", hash = "sha256:868fddb26072a43e870a8819134b9f80ee602931be5a76e6fb873e04da343637", size = 486334, upload-time = "2026-04-13T17:11:34.882Z" }, + { url = "https://files.pythonhosted.org/packages/ff/a4/113f104301df8bddcc0b3775b611a30cb7610baa3add933c7ccac9386467/fastar-0.11.0-cp314-cp314-win_arm64.whl", hash = "sha256:3db39c9cc42abb0c780a26b299f24dfbc8be455985e969e15336d70d7b2f833b", size = 461534, upload-time = "2026-04-13T17:11:24.329Z" }, + { url = "https://files.pythonhosted.org/packages/5a/a6/5c5f2c2c8e0c63e56a5636ebc7721589c889e94c0092cec7eb28ae7207e6/fastar-0.11.0-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:49c3299dec5e125e7ebaa27545714da9c7391777366015427e0ae62d548b442b", size = 707156, upload-time = "2026-04-13T17:10:02.176Z" }, + { url = "https://files.pythonhosted.org/packages/df/f7/982c01b61f0fc135ad2b16d01e6d0ee53cf8791e68827f5f7c5a65b2e5b1/fastar-0.11.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:3328ed1ed56d31f5198350b17dd60449b8d6b9d47abb4688bab6aef4450a165b", size = 627032, upload-time = "2026-04-13T17:09:46.978Z" }, + { url = "https://files.pythonhosted.org/packages/2b/c3/38f1dac77ae0c71c37b176277c96d830796b8ce2fe69705f917829b53829/fastar-0.11.0-cp314-cp314t-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:bd3eca3bbfec84a614bcb4143b4ad4f784d0895babc26cfc88436af88ca23c7a", size = 864403, upload-time = "2026-04-13T17:09:16.58Z" }, + { url = "https://files.pythonhosted.org/packages/6e/f0/e69c363bdb3e5a5848e937b662b5469581ee6682c51bc1c0556494773929/fastar-0.11.0-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ff86a967acb0d621dd24063dda090daa67bf4993b9570e97fe156de88a9006ca", size = 759480, upload-time = "2026-04-13T17:08:00.599Z" }, + { url = "https://files.pythonhosted.org/packages/3b/29/4d8737590c2a6357d614d7cc7288e8f68e7e449680b8922997cc4349e65e/fastar-0.11.0-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:86eaf7c0e985d93a7734168be2fb232b2a8cca53e41431c2782d7c12b12c03b1", size = 756219, upload-time = "2026-04-13T17:08:15.699Z" }, + { url = "https://files.pythonhosted.org/packages/bb/ec/400de7b3b7d48801908f19cf5462177104395799472671b3e8152b2b04ca/fastar-0.11.0-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:91f07b0b8eb67e2f177733a1f884edad7dfb9f8977ffef15927b20cb9604027d", size = 923669, upload-time = "2026-04-13T17:08:30.574Z" }, + { url = "https://files.pythonhosted.org/packages/5d/01/8926c53da923fed7ab4b96e7fbf7f73b663beb4f02095b654d6fab46f9ad/fastar-0.11.0-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f85c896885eb4abf1a635d54dea22cac6ae48d04fc2ea26ae652fcf1febe1220", size = 815729, upload-time = "2026-04-13T17:09:01.204Z" }, + { url = "https://files.pythonhosted.org/packages/89/f0/5fef4c7946e352651b504b1a4235dac3505e7cfd24020788ab50552e84bf/fastar-0.11.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:075c07095c8de4b774ba8f28b9c0a02b1a2cd254da50cbe464dd3bb2432e9158", size = 819812, upload-time = "2026-04-13T17:09:31.907Z" }, + { url = "https://files.pythonhosted.org/packages/b3/c8/0ebc3298b4a45e7bddc50b169ae6a6f5b80c939394d4befe6e60de535ee7/fastar-0.11.0-cp314-cp314t-manylinux_2_31_riscv64.whl", hash = "sha256:07f028933820c65750baf3383b807ecce1cd9385cf00ce192b79d263ad6b856c", size = 884074, upload-time = "2026-04-13T17:08:45.802Z" }, + { url = "https://files.pythonhosted.org/packages/ae/9f/7baa4cdff8d6fbca41fa5c764b48a941fed8a9ec6c4cc92de65895a28299/fastar-0.11.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:039f875efa0f01fa43c20bf4e2fc7305489c61d0ac76eda991acfba7820a0e63", size = 969450, upload-time = "2026-04-13T17:10:18.667Z" }, + { url = "https://files.pythonhosted.org/packages/d4/dc/1ebbfb58a47056ba866494f19efbcdd2ba2897096b94f36e796594b4d05b/fastar-0.11.0-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:fff12452a9a5c6814a012445f26365541cc3d99dcca61f09762e6a389f7a32ea", size = 1033775, upload-time = "2026-04-13T17:10:36.165Z" }, + { url = "https://files.pythonhosted.org/packages/c2/5f/ce4e3914066f08c99eb8c32952cc07c1a013e81b1db1b0f598130bf6b974/fastar-0.11.0-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:2bf733e09f942b6fa876efe30a90508d1f4caef5630c00fb2a84fba355873712", size = 1072158, upload-time = "2026-04-13T17:10:52.497Z" }, + { url = "https://files.pythonhosted.org/packages/03/2a/6bca72992c84151c387cc6558f3867f5ebe5fb3684ee6fa9b76280ba4b8e/fastar-0.11.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:d1531fa848fdd3677d2dce0a4b436ea64d9ae38fb8babe2ddbc180dd153cb7a3", size = 1028577, upload-time = "2026-04-13T17:11:09.934Z" }, + { url = "https://files.pythonhosted.org/packages/83/18/7a7c15657a3da5569b26fc51cde6a80f8d84cb54b3b1aea6d74a103db4ad/fastar-0.11.0-cp314-cp314t-win32.whl", hash = "sha256:5744551bc67c6fc6581cbd0e34a0fd6e2cd0bd30b43e94b1c3119cf35064b162", size = 453601, upload-time = "2026-04-13T17:11:53.726Z" }, + { url = "https://files.pythonhosted.org/packages/6d/d8/331b59a6de279f3ad75c10c02c40a12f21d64a437d9c3d6f1af2dcbd7a76/fastar-0.11.0-cp314-cp314t-win_amd64.whl", hash = "sha256:f4ce44e3b56c47cf38244b98d29f269b259740a580c47a2552efa5b96a5458fb", size = 486436, upload-time = "2026-04-13T17:11:40.089Z" }, + { url = "https://files.pythonhosted.org/packages/6b/fd/5390ec4f49100f3ecb9968a392f9e6d039f1e3fe0ecd28443716ff01e589/fastar-0.11.0-cp314-cp314t-win_arm64.whl", hash = "sha256:76c1359314355eafbc6989f20fb1ad565a3d10200117923b9da765a17e2f6f11", size = 461049, upload-time = "2026-04-13T17:11:25.918Z" }, +] + +[[package]] +name = "feetech-servo-sdk" +version = "1.0.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pyserial" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/5f/8e/c53d6f9a8bf3a86a635b58eeb675723f1b040f1665a0681467756c8989aa/feetech-servo-sdk-1.0.0.tar.gz", hash = "sha256:d4d3832e4b1b22a8222133a414db9f868224c2fb639426a1b11d96ddfe84e69c", size = 8392, upload-time = "2022-11-08T03:44:45.269Z" } + +[[package]] +name = "filelock" +version = "3.29.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/1f/f9/f38573ed5844586db374d085911740a501ccfa373b455fc9413f09f85237/filelock-3.29.1.tar.gz", hash = "sha256:d97e6b1b9757569626c58caa07dc4beb1613f4a2938b1e8cc81afca398906c9e", size = 59335, upload-time = "2026-06-03T15:19:04.053Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/4c/a0/614c5fe402fd88951df45f4dda2fa3b4e17a99ecd92340771929169b3b95/filelock-3.29.1-py3-none-any.whl", hash = "sha256:85199dfd706869641b72b2e8955d5416a4b2b7dc4b0e8e6d97b4cc1299a6983b", size = 40750, upload-time = "2026-06-03T15:19:02.959Z" }, +] + +[[package]] +name = "frozenlist" +version = "1.8.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/2d/f5/c831fac6cc817d26fd54c7eaccd04ef7e0288806943f7cc5bbf69f3ac1f0/frozenlist-1.8.0.tar.gz", hash = "sha256:3ede829ed8d842f6cd48fc7081d7a41001a56f1f38603f9d49bf3020d59a31ad", size = 45875, upload-time = "2025-10-06T05:38:17.865Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/69/29/948b9aa87e75820a38650af445d2ef2b6b8a6fab1a23b6bb9e4ef0be2d59/frozenlist-1.8.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:78f7b9e5d6f2fdb88cdde9440dc147259b62b9d3b019924def9f6478be254ac1", size = 87782, upload-time = "2025-10-06T05:36:06.649Z" }, + { url = "https://files.pythonhosted.org/packages/64/80/4f6e318ee2a7c0750ed724fa33a4bdf1eacdc5a39a7a24e818a773cd91af/frozenlist-1.8.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:229bf37d2e4acdaf808fd3f06e854a4a7a3661e871b10dc1f8f1896a3b05f18b", size = 50594, upload-time = "2025-10-06T05:36:07.69Z" }, + { url = "https://files.pythonhosted.org/packages/2b/94/5c8a2b50a496b11dd519f4a24cb5496cf125681dd99e94c604ccdea9419a/frozenlist-1.8.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f833670942247a14eafbb675458b4e61c82e002a148f49e68257b79296e865c4", size = 50448, upload-time = "2025-10-06T05:36:08.78Z" }, + { url = "https://files.pythonhosted.org/packages/6a/bd/d91c5e39f490a49df14320f4e8c80161cfcce09f1e2cde1edd16a551abb3/frozenlist-1.8.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:494a5952b1c597ba44e0e78113a7266e656b9794eec897b19ead706bd7074383", size = 242411, upload-time = "2025-10-06T05:36:09.801Z" }, + { url = "https://files.pythonhosted.org/packages/8f/83/f61505a05109ef3293dfb1ff594d13d64a2324ac3482be2cedc2be818256/frozenlist-1.8.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:96f423a119f4777a4a056b66ce11527366a8bb92f54e541ade21f2374433f6d4", size = 243014, upload-time = "2025-10-06T05:36:11.394Z" }, + { url = "https://files.pythonhosted.org/packages/d8/cb/cb6c7b0f7d4023ddda30cf56b8b17494eb3a79e3fda666bf735f63118b35/frozenlist-1.8.0-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:3462dd9475af2025c31cc61be6652dfa25cbfb56cbbf52f4ccfe029f38decaf8", size = 234909, upload-time = "2025-10-06T05:36:12.598Z" }, + { url = "https://files.pythonhosted.org/packages/31/c5/cd7a1f3b8b34af009fb17d4123c5a778b44ae2804e3ad6b86204255f9ec5/frozenlist-1.8.0-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:c4c800524c9cd9bac5166cd6f55285957fcfc907db323e193f2afcd4d9abd69b", size = 250049, upload-time = "2025-10-06T05:36:14.065Z" }, + { url = "https://files.pythonhosted.org/packages/c0/01/2f95d3b416c584a1e7f0e1d6d31998c4a795f7544069ee2e0962a4b60740/frozenlist-1.8.0-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:d6a5df73acd3399d893dafc71663ad22534b5aa4f94e8a2fabfe856c3c1b6a52", size = 256485, upload-time = "2025-10-06T05:36:15.39Z" }, + { url = "https://files.pythonhosted.org/packages/ce/03/024bf7720b3abaebcff6d0793d73c154237b85bdf67b7ed55e5e9596dc9a/frozenlist-1.8.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:405e8fe955c2280ce66428b3ca55e12b3c4e9c336fb2103a4937e891c69a4a29", size = 237619, upload-time = "2025-10-06T05:36:16.558Z" }, + { url = "https://files.pythonhosted.org/packages/69/fa/f8abdfe7d76b731f5d8bd217827cf6764d4f1d9763407e42717b4bed50a0/frozenlist-1.8.0-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:908bd3f6439f2fef9e85031b59fd4f1297af54415fb60e4254a95f75b3cab3f3", size = 250320, upload-time = "2025-10-06T05:36:17.821Z" }, + { url = "https://files.pythonhosted.org/packages/f5/3c/b051329f718b463b22613e269ad72138cc256c540f78a6de89452803a47d/frozenlist-1.8.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:294e487f9ec720bd8ffcebc99d575f7eff3568a08a253d1ee1a0378754b74143", size = 246820, upload-time = "2025-10-06T05:36:19.046Z" }, + { url = "https://files.pythonhosted.org/packages/0f/ae/58282e8f98e444b3f4dd42448ff36fa38bef29e40d40f330b22e7108f565/frozenlist-1.8.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:74c51543498289c0c43656701be6b077f4b265868fa7f8a8859c197006efb608", size = 250518, upload-time = "2025-10-06T05:36:20.763Z" }, + { url = "https://files.pythonhosted.org/packages/8f/96/007e5944694d66123183845a106547a15944fbbb7154788cbf7272789536/frozenlist-1.8.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:776f352e8329135506a1d6bf16ac3f87bc25b28e765949282dcc627af36123aa", size = 239096, upload-time = "2025-10-06T05:36:22.129Z" }, + { url = "https://files.pythonhosted.org/packages/66/bb/852b9d6db2fa40be96f29c0d1205c306288f0684df8fd26ca1951d461a56/frozenlist-1.8.0-cp312-cp312-win32.whl", hash = "sha256:433403ae80709741ce34038da08511d4a77062aa924baf411ef73d1146e74faf", size = 39985, upload-time = "2025-10-06T05:36:23.661Z" }, + { url = "https://files.pythonhosted.org/packages/b8/af/38e51a553dd66eb064cdf193841f16f077585d4d28394c2fa6235cb41765/frozenlist-1.8.0-cp312-cp312-win_amd64.whl", hash = "sha256:34187385b08f866104f0c0617404c8eb08165ab1272e884abc89c112e9c00746", size = 44591, upload-time = "2025-10-06T05:36:24.958Z" }, + { url = "https://files.pythonhosted.org/packages/a7/06/1dc65480ab147339fecc70797e9c2f69d9cea9cf38934ce08df070fdb9cb/frozenlist-1.8.0-cp312-cp312-win_arm64.whl", hash = "sha256:fe3c58d2f5db5fbd18c2987cba06d51b0529f52bc3a6cdc33d3f4eab725104bd", size = 40102, upload-time = "2025-10-06T05:36:26.333Z" }, + { url = "https://files.pythonhosted.org/packages/2d/40/0832c31a37d60f60ed79e9dfb5a92e1e2af4f40a16a29abcc7992af9edff/frozenlist-1.8.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:8d92f1a84bb12d9e56f818b3a746f3efba93c1b63c8387a73dde655e1e42282a", size = 85717, upload-time = "2025-10-06T05:36:27.341Z" }, + { url = "https://files.pythonhosted.org/packages/30/ba/b0b3de23f40bc55a7057bd38434e25c34fa48e17f20ee273bbde5e0650f3/frozenlist-1.8.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:96153e77a591c8adc2ee805756c61f59fef4cf4073a9275ee86fe8cba41241f7", size = 49651, upload-time = "2025-10-06T05:36:28.855Z" }, + { url = "https://files.pythonhosted.org/packages/0c/ab/6e5080ee374f875296c4243c381bbdef97a9ac39c6e3ce1d5f7d42cb78d6/frozenlist-1.8.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:f21f00a91358803399890ab167098c131ec2ddd5f8f5fd5fe9c9f2c6fcd91e40", size = 49417, upload-time = "2025-10-06T05:36:29.877Z" }, + { url = "https://files.pythonhosted.org/packages/d5/4e/e4691508f9477ce67da2015d8c00acd751e6287739123113a9fca6f1604e/frozenlist-1.8.0-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:fb30f9626572a76dfe4293c7194a09fb1fe93ba94c7d4f720dfae3b646b45027", size = 234391, upload-time = "2025-10-06T05:36:31.301Z" }, + { url = "https://files.pythonhosted.org/packages/40/76/c202df58e3acdf12969a7895fd6f3bc016c642e6726aa63bd3025e0fc71c/frozenlist-1.8.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:eaa352d7047a31d87dafcacbabe89df0aa506abb5b1b85a2fb91bc3faa02d822", size = 233048, upload-time = "2025-10-06T05:36:32.531Z" }, + { url = "https://files.pythonhosted.org/packages/f9/c0/8746afb90f17b73ca5979c7a3958116e105ff796e718575175319b5bb4ce/frozenlist-1.8.0-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:03ae967b4e297f58f8c774c7eabcce57fe3c2434817d4385c50661845a058121", size = 226549, upload-time = "2025-10-06T05:36:33.706Z" }, + { url = "https://files.pythonhosted.org/packages/7e/eb/4c7eefc718ff72f9b6c4893291abaae5fbc0c82226a32dcd8ef4f7a5dbef/frozenlist-1.8.0-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:f6292f1de555ffcc675941d65fffffb0a5bcd992905015f85d0592201793e0e5", size = 239833, upload-time = "2025-10-06T05:36:34.947Z" }, + { url = "https://files.pythonhosted.org/packages/c2/4e/e5c02187cf704224f8b21bee886f3d713ca379535f16893233b9d672ea71/frozenlist-1.8.0-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:29548f9b5b5e3460ce7378144c3010363d8035cea44bc0bf02d57f5a685e084e", size = 245363, upload-time = "2025-10-06T05:36:36.534Z" }, + { url = "https://files.pythonhosted.org/packages/1f/96/cb85ec608464472e82ad37a17f844889c36100eed57bea094518bf270692/frozenlist-1.8.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:ec3cc8c5d4084591b4237c0a272cc4f50a5b03396a47d9caaf76f5d7b38a4f11", size = 229314, upload-time = "2025-10-06T05:36:38.582Z" }, + { url = "https://files.pythonhosted.org/packages/5d/6f/4ae69c550e4cee66b57887daeebe006fe985917c01d0fff9caab9883f6d0/frozenlist-1.8.0-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:517279f58009d0b1f2e7c1b130b377a349405da3f7621ed6bfae50b10adf20c1", size = 243365, upload-time = "2025-10-06T05:36:40.152Z" }, + { url = "https://files.pythonhosted.org/packages/7a/58/afd56de246cf11780a40a2c28dc7cbabbf06337cc8ddb1c780a2d97e88d8/frozenlist-1.8.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:db1e72ede2d0d7ccb213f218df6a078a9c09a7de257c2fe8fcef16d5925230b1", size = 237763, upload-time = "2025-10-06T05:36:41.355Z" }, + { url = "https://files.pythonhosted.org/packages/cb/36/cdfaf6ed42e2644740d4a10452d8e97fa1c062e2a8006e4b09f1b5fd7d63/frozenlist-1.8.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:b4dec9482a65c54a5044486847b8a66bf10c9cb4926d42927ec4e8fd5db7fed8", size = 240110, upload-time = "2025-10-06T05:36:42.716Z" }, + { url = "https://files.pythonhosted.org/packages/03/a8/9ea226fbefad669f11b52e864c55f0bd57d3c8d7eb07e9f2e9a0b39502e1/frozenlist-1.8.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:21900c48ae04d13d416f0e1e0c4d81f7931f73a9dfa0b7a8746fb2fe7dd970ed", size = 233717, upload-time = "2025-10-06T05:36:44.251Z" }, + { url = "https://files.pythonhosted.org/packages/1e/0b/1b5531611e83ba7d13ccc9988967ea1b51186af64c42b7a7af465dcc9568/frozenlist-1.8.0-cp313-cp313-win32.whl", hash = "sha256:8b7b94a067d1c504ee0b16def57ad5738701e4ba10cec90529f13fa03c833496", size = 39628, upload-time = "2025-10-06T05:36:45.423Z" }, + { url = "https://files.pythonhosted.org/packages/d8/cf/174c91dbc9cc49bc7b7aab74d8b734e974d1faa8f191c74af9b7e80848e6/frozenlist-1.8.0-cp313-cp313-win_amd64.whl", hash = "sha256:878be833caa6a3821caf85eb39c5ba92d28e85df26d57afb06b35b2efd937231", size = 43882, upload-time = "2025-10-06T05:36:46.796Z" }, + { url = "https://files.pythonhosted.org/packages/c1/17/502cd212cbfa96eb1388614fe39a3fc9ab87dbbe042b66f97acb57474834/frozenlist-1.8.0-cp313-cp313-win_arm64.whl", hash = "sha256:44389d135b3ff43ba8cc89ff7f51f5a0bb6b63d829c8300f79a2fe4fe61bcc62", size = 39676, upload-time = "2025-10-06T05:36:47.8Z" }, + { url = "https://files.pythonhosted.org/packages/d2/5c/3bbfaa920dfab09e76946a5d2833a7cbdf7b9b4a91c714666ac4855b88b4/frozenlist-1.8.0-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:e25ac20a2ef37e91c1b39938b591457666a0fa835c7783c3a8f33ea42870db94", size = 89235, upload-time = "2025-10-06T05:36:48.78Z" }, + { url = "https://files.pythonhosted.org/packages/d2/d6/f03961ef72166cec1687e84e8925838442b615bd0b8854b54923ce5b7b8a/frozenlist-1.8.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:07cdca25a91a4386d2e76ad992916a85038a9b97561bf7a3fd12d5d9ce31870c", size = 50742, upload-time = "2025-10-06T05:36:49.837Z" }, + { url = "https://files.pythonhosted.org/packages/1e/bb/a6d12b7ba4c3337667d0e421f7181c82dda448ce4e7ad7ecd249a16fa806/frozenlist-1.8.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:4e0c11f2cc6717e0a741f84a527c52616140741cd812a50422f83dc31749fb52", size = 51725, upload-time = "2025-10-06T05:36:50.851Z" }, + { url = "https://files.pythonhosted.org/packages/bc/71/d1fed0ffe2c2ccd70b43714c6cab0f4188f09f8a67a7914a6b46ee30f274/frozenlist-1.8.0-cp313-cp313t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:b3210649ee28062ea6099cfda39e147fa1bc039583c8ee4481cb7811e2448c51", size = 284533, upload-time = "2025-10-06T05:36:51.898Z" }, + { url = "https://files.pythonhosted.org/packages/c9/1f/fb1685a7b009d89f9bf78a42d94461bc06581f6e718c39344754a5d9bada/frozenlist-1.8.0-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:581ef5194c48035a7de2aefc72ac6539823bb71508189e5de01d60c9dcd5fa65", size = 292506, upload-time = "2025-10-06T05:36:53.101Z" }, + { url = "https://files.pythonhosted.org/packages/e6/3b/b991fe1612703f7e0d05c0cf734c1b77aaf7c7d321df4572e8d36e7048c8/frozenlist-1.8.0-cp313-cp313t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:3ef2d026f16a2b1866e1d86fc4e1291e1ed8a387b2c333809419a2f8b3a77b82", size = 274161, upload-time = "2025-10-06T05:36:54.309Z" }, + { url = "https://files.pythonhosted.org/packages/ca/ec/c5c618767bcdf66e88945ec0157d7f6c4a1322f1473392319b7a2501ded7/frozenlist-1.8.0-cp313-cp313t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:5500ef82073f599ac84d888e3a8c1f77ac831183244bfd7f11eaa0289fb30714", size = 294676, upload-time = "2025-10-06T05:36:55.566Z" }, + { url = "https://files.pythonhosted.org/packages/7c/ce/3934758637d8f8a88d11f0585d6495ef54b2044ed6ec84492a91fa3b27aa/frozenlist-1.8.0-cp313-cp313t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:50066c3997d0091c411a66e710f4e11752251e6d2d73d70d8d5d4c76442a199d", size = 300638, upload-time = "2025-10-06T05:36:56.758Z" }, + { url = "https://files.pythonhosted.org/packages/fc/4f/a7e4d0d467298f42de4b41cbc7ddaf19d3cfeabaf9ff97c20c6c7ee409f9/frozenlist-1.8.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:5c1c8e78426e59b3f8005e9b19f6ff46e5845895adbde20ece9218319eca6506", size = 283067, upload-time = "2025-10-06T05:36:57.965Z" }, + { url = "https://files.pythonhosted.org/packages/dc/48/c7b163063d55a83772b268e6d1affb960771b0e203b632cfe09522d67ea5/frozenlist-1.8.0-cp313-cp313t-musllinux_1_2_armv7l.whl", hash = "sha256:eefdba20de0d938cec6a89bd4d70f346a03108a19b9df4248d3cf0d88f1b0f51", size = 292101, upload-time = "2025-10-06T05:36:59.237Z" }, + { url = "https://files.pythonhosted.org/packages/9f/d0/2366d3c4ecdc2fd391e0afa6e11500bfba0ea772764d631bbf82f0136c9d/frozenlist-1.8.0-cp313-cp313t-musllinux_1_2_ppc64le.whl", hash = "sha256:cf253e0e1c3ceb4aaff6df637ce033ff6535fb8c70a764a8f46aafd3d6ab798e", size = 289901, upload-time = "2025-10-06T05:37:00.811Z" }, + { url = "https://files.pythonhosted.org/packages/b8/94/daff920e82c1b70e3618a2ac39fbc01ae3e2ff6124e80739ce5d71c9b920/frozenlist-1.8.0-cp313-cp313t-musllinux_1_2_s390x.whl", hash = "sha256:032efa2674356903cd0261c4317a561a6850f3ac864a63fc1583147fb05a79b0", size = 289395, upload-time = "2025-10-06T05:37:02.115Z" }, + { url = "https://files.pythonhosted.org/packages/e3/20/bba307ab4235a09fdcd3cc5508dbabd17c4634a1af4b96e0f69bfe551ebd/frozenlist-1.8.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:6da155091429aeba16851ecb10a9104a108bcd32f6c1642867eadaee401c1c41", size = 283659, upload-time = "2025-10-06T05:37:03.711Z" }, + { url = "https://files.pythonhosted.org/packages/fd/00/04ca1c3a7a124b6de4f8a9a17cc2fcad138b4608e7a3fc5877804b8715d7/frozenlist-1.8.0-cp313-cp313t-win32.whl", hash = "sha256:0f96534f8bfebc1a394209427d0f8a63d343c9779cda6fc25e8e121b5fd8555b", size = 43492, upload-time = "2025-10-06T05:37:04.915Z" }, + { url = "https://files.pythonhosted.org/packages/59/5e/c69f733a86a94ab10f68e496dc6b7e8bc078ebb415281d5698313e3af3a1/frozenlist-1.8.0-cp313-cp313t-win_amd64.whl", hash = "sha256:5d63a068f978fc69421fb0e6eb91a9603187527c86b7cd3f534a5b77a592b888", size = 48034, upload-time = "2025-10-06T05:37:06.343Z" }, + { url = "https://files.pythonhosted.org/packages/16/6c/be9d79775d8abe79b05fa6d23da99ad6e7763a1d080fbae7290b286093fd/frozenlist-1.8.0-cp313-cp313t-win_arm64.whl", hash = "sha256:bf0a7e10b077bf5fb9380ad3ae8ce20ef919a6ad93b4552896419ac7e1d8e042", size = 41749, upload-time = "2025-10-06T05:37:07.431Z" }, + { url = "https://files.pythonhosted.org/packages/f1/c8/85da824b7e7b9b6e7f7705b2ecaf9591ba6f79c1177f324c2735e41d36a2/frozenlist-1.8.0-cp314-cp314-macosx_10_13_universal2.whl", hash = "sha256:cee686f1f4cadeb2136007ddedd0aaf928ab95216e7691c63e50a8ec066336d0", size = 86127, upload-time = "2025-10-06T05:37:08.438Z" }, + { url = "https://files.pythonhosted.org/packages/8e/e8/a1185e236ec66c20afd72399522f142c3724c785789255202d27ae992818/frozenlist-1.8.0-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:119fb2a1bd47307e899c2fac7f28e85b9a543864df47aa7ec9d3c1b4545f096f", size = 49698, upload-time = "2025-10-06T05:37:09.48Z" }, + { url = "https://files.pythonhosted.org/packages/a1/93/72b1736d68f03fda5fdf0f2180fb6caaae3894f1b854d006ac61ecc727ee/frozenlist-1.8.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:4970ece02dbc8c3a92fcc5228e36a3e933a01a999f7094ff7c23fbd2beeaa67c", size = 49749, upload-time = "2025-10-06T05:37:10.569Z" }, + { url = "https://files.pythonhosted.org/packages/a7/b2/fabede9fafd976b991e9f1b9c8c873ed86f202889b864756f240ce6dd855/frozenlist-1.8.0-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:cba69cb73723c3f329622e34bdbf5ce1f80c21c290ff04256cff1cd3c2036ed2", size = 231298, upload-time = "2025-10-06T05:37:11.993Z" }, + { url = "https://files.pythonhosted.org/packages/3a/3b/d9b1e0b0eed36e70477ffb8360c49c85c8ca8ef9700a4e6711f39a6e8b45/frozenlist-1.8.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:778a11b15673f6f1df23d9586f83c4846c471a8af693a22e066508b77d201ec8", size = 232015, upload-time = "2025-10-06T05:37:13.194Z" }, + { url = "https://files.pythonhosted.org/packages/dc/94/be719d2766c1138148564a3960fc2c06eb688da592bdc25adcf856101be7/frozenlist-1.8.0-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:0325024fe97f94c41c08872db482cf8ac4800d80e79222c6b0b7b162d5b13686", size = 225038, upload-time = "2025-10-06T05:37:14.577Z" }, + { url = "https://files.pythonhosted.org/packages/e4/09/6712b6c5465f083f52f50cf74167b92d4ea2f50e46a9eea0523d658454ae/frozenlist-1.8.0-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:97260ff46b207a82a7567b581ab4190bd4dfa09f4db8a8b49d1a958f6aa4940e", size = 240130, upload-time = "2025-10-06T05:37:15.781Z" }, + { url = "https://files.pythonhosted.org/packages/f8/d4/cd065cdcf21550b54f3ce6a22e143ac9e4836ca42a0de1022da8498eac89/frozenlist-1.8.0-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:54b2077180eb7f83dd52c40b2750d0a9f175e06a42e3213ce047219de902717a", size = 242845, upload-time = "2025-10-06T05:37:17.037Z" }, + { url = "https://files.pythonhosted.org/packages/62/c3/f57a5c8c70cd1ead3d5d5f776f89d33110b1addae0ab010ad774d9a44fb9/frozenlist-1.8.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:2f05983daecab868a31e1da44462873306d3cbfd76d1f0b5b69c473d21dbb128", size = 229131, upload-time = "2025-10-06T05:37:18.221Z" }, + { url = "https://files.pythonhosted.org/packages/6c/52/232476fe9cb64f0742f3fde2b7d26c1dac18b6d62071c74d4ded55e0ef94/frozenlist-1.8.0-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:33f48f51a446114bc5d251fb2954ab0164d5be02ad3382abcbfe07e2531d650f", size = 240542, upload-time = "2025-10-06T05:37:19.771Z" }, + { url = "https://files.pythonhosted.org/packages/5f/85/07bf3f5d0fb5414aee5f47d33c6f5c77bfe49aac680bfece33d4fdf6a246/frozenlist-1.8.0-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:154e55ec0655291b5dd1b8731c637ecdb50975a2ae70c606d100750a540082f7", size = 237308, upload-time = "2025-10-06T05:37:20.969Z" }, + { url = "https://files.pythonhosted.org/packages/11/99/ae3a33d5befd41ac0ca2cc7fd3aa707c9c324de2e89db0e0f45db9a64c26/frozenlist-1.8.0-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:4314debad13beb564b708b4a496020e5306c7333fa9a3ab90374169a20ffab30", size = 238210, upload-time = "2025-10-06T05:37:22.252Z" }, + { url = "https://files.pythonhosted.org/packages/b2/60/b1d2da22f4970e7a155f0adde9b1435712ece01b3cd45ba63702aea33938/frozenlist-1.8.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:073f8bf8becba60aa931eb3bc420b217bb7d5b8f4750e6f8b3be7f3da85d38b7", size = 231972, upload-time = "2025-10-06T05:37:23.5Z" }, + { url = "https://files.pythonhosted.org/packages/3f/ab/945b2f32de889993b9c9133216c068b7fcf257d8595a0ac420ac8677cab0/frozenlist-1.8.0-cp314-cp314-win32.whl", hash = "sha256:bac9c42ba2ac65ddc115d930c78d24ab8d4f465fd3fc473cdedfccadb9429806", size = 40536, upload-time = "2025-10-06T05:37:25.581Z" }, + { url = "https://files.pythonhosted.org/packages/59/ad/9caa9b9c836d9ad6f067157a531ac48b7d36499f5036d4141ce78c230b1b/frozenlist-1.8.0-cp314-cp314-win_amd64.whl", hash = "sha256:3e0761f4d1a44f1d1a47996511752cf3dcec5bbdd9cc2b4fe595caf97754b7a0", size = 44330, upload-time = "2025-10-06T05:37:26.928Z" }, + { url = "https://files.pythonhosted.org/packages/82/13/e6950121764f2676f43534c555249f57030150260aee9dcf7d64efda11dd/frozenlist-1.8.0-cp314-cp314-win_arm64.whl", hash = "sha256:d1eaff1d00c7751b7c6662e9c5ba6eb2c17a2306ba5e2a37f24ddf3cc953402b", size = 40627, upload-time = "2025-10-06T05:37:28.075Z" }, + { url = "https://files.pythonhosted.org/packages/c0/c7/43200656ecc4e02d3f8bc248df68256cd9572b3f0017f0a0c4e93440ae23/frozenlist-1.8.0-cp314-cp314t-macosx_10_13_universal2.whl", hash = "sha256:d3bb933317c52d7ea5004a1c442eef86f426886fba134ef8cf4226ea6ee1821d", size = 89238, upload-time = "2025-10-06T05:37:29.373Z" }, + { url = "https://files.pythonhosted.org/packages/d1/29/55c5f0689b9c0fb765055629f472c0de484dcaf0acee2f7707266ae3583c/frozenlist-1.8.0-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:8009897cdef112072f93a0efdce29cd819e717fd2f649ee3016efd3cd885a7ed", size = 50738, upload-time = "2025-10-06T05:37:30.792Z" }, + { url = "https://files.pythonhosted.org/packages/ba/7d/b7282a445956506fa11da8c2db7d276adcbf2b17d8bb8407a47685263f90/frozenlist-1.8.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:2c5dcbbc55383e5883246d11fd179782a9d07a986c40f49abe89ddf865913930", size = 51739, upload-time = "2025-10-06T05:37:32.127Z" }, + { url = "https://files.pythonhosted.org/packages/62/1c/3d8622e60d0b767a5510d1d3cf21065b9db874696a51ea6d7a43180a259c/frozenlist-1.8.0-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:39ecbc32f1390387d2aa4f5a995e465e9e2f79ba3adcac92d68e3e0afae6657c", size = 284186, upload-time = "2025-10-06T05:37:33.21Z" }, + { url = "https://files.pythonhosted.org/packages/2d/14/aa36d5f85a89679a85a1d44cd7a6657e0b1c75f61e7cad987b203d2daca8/frozenlist-1.8.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:92db2bf818d5cc8d9c1f1fc56b897662e24ea5adb36ad1f1d82875bd64e03c24", size = 292196, upload-time = "2025-10-06T05:37:36.107Z" }, + { url = "https://files.pythonhosted.org/packages/05/23/6bde59eb55abd407d34f77d39a5126fb7b4f109a3f611d3929f14b700c66/frozenlist-1.8.0-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:2dc43a022e555de94c3b68a4ef0b11c4f747d12c024a520c7101709a2144fb37", size = 273830, upload-time = "2025-10-06T05:37:37.663Z" }, + { url = "https://files.pythonhosted.org/packages/d2/3f/22cff331bfad7a8afa616289000ba793347fcd7bc275f3b28ecea2a27909/frozenlist-1.8.0-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:cb89a7f2de3602cfed448095bab3f178399646ab7c61454315089787df07733a", size = 294289, upload-time = "2025-10-06T05:37:39.261Z" }, + { url = "https://files.pythonhosted.org/packages/a4/89/5b057c799de4838b6c69aa82b79705f2027615e01be996d2486a69ca99c4/frozenlist-1.8.0-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:33139dc858c580ea50e7e60a1b0ea003efa1fd42e6ec7fdbad78fff65fad2fd2", size = 300318, upload-time = "2025-10-06T05:37:43.213Z" }, + { url = "https://files.pythonhosted.org/packages/30/de/2c22ab3eb2a8af6d69dc799e48455813bab3690c760de58e1bf43b36da3e/frozenlist-1.8.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:168c0969a329b416119507ba30b9ea13688fafffac1b7822802537569a1cb0ef", size = 282814, upload-time = "2025-10-06T05:37:45.337Z" }, + { url = "https://files.pythonhosted.org/packages/59/f7/970141a6a8dbd7f556d94977858cfb36fa9b66e0892c6dd780d2219d8cd8/frozenlist-1.8.0-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:28bd570e8e189d7f7b001966435f9dac6718324b5be2990ac496cf1ea9ddb7fe", size = 291762, upload-time = "2025-10-06T05:37:46.657Z" }, + { url = "https://files.pythonhosted.org/packages/c1/15/ca1adae83a719f82df9116d66f5bb28bb95557b3951903d39135620ef157/frozenlist-1.8.0-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:b2a095d45c5d46e5e79ba1e5b9cb787f541a8dee0433836cea4b96a2c439dcd8", size = 289470, upload-time = "2025-10-06T05:37:47.946Z" }, + { url = "https://files.pythonhosted.org/packages/ac/83/dca6dc53bf657d371fbc88ddeb21b79891e747189c5de990b9dfff2ccba1/frozenlist-1.8.0-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:eab8145831a0d56ec9c4139b6c3e594c7a83c2c8be25d5bcf2d86136a532287a", size = 289042, upload-time = "2025-10-06T05:37:49.499Z" }, + { url = "https://files.pythonhosted.org/packages/96/52/abddd34ca99be142f354398700536c5bd315880ed0a213812bc491cff5e4/frozenlist-1.8.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:974b28cf63cc99dfb2188d8d222bc6843656188164848c4f679e63dae4b0708e", size = 283148, upload-time = "2025-10-06T05:37:50.745Z" }, + { url = "https://files.pythonhosted.org/packages/af/d3/76bd4ed4317e7119c2b7f57c3f6934aba26d277acc6309f873341640e21f/frozenlist-1.8.0-cp314-cp314t-win32.whl", hash = "sha256:342c97bf697ac5480c0a7ec73cd700ecfa5a8a40ac923bd035484616efecc2df", size = 44676, upload-time = "2025-10-06T05:37:52.222Z" }, + { url = "https://files.pythonhosted.org/packages/89/76/c615883b7b521ead2944bb3480398cbb07e12b7b4e4d073d3752eb721558/frozenlist-1.8.0-cp314-cp314t-win_amd64.whl", hash = "sha256:06be8f67f39c8b1dc671f5d83aaefd3358ae5cdcf8314552c57e7ed3e6475bdd", size = 49451, upload-time = "2025-10-06T05:37:53.425Z" }, + { url = "https://files.pythonhosted.org/packages/e0/a3/5982da14e113d07b325230f95060e2169f5311b1017ea8af2a29b374c289/frozenlist-1.8.0-cp314-cp314t-win_arm64.whl", hash = "sha256:102e6314ca4da683dca92e3b1355490fed5f313b768500084fbe6371fddfdb79", size = 42507, upload-time = "2025-10-06T05:37:54.513Z" }, + { url = "https://files.pythonhosted.org/packages/9a/9a/e35b4a917281c0b8419d4207f4334c8e8c5dbf4f3f5f9ada73958d937dcc/frozenlist-1.8.0-py3-none-any.whl", hash = "sha256:0c18a16eab41e82c295618a77502e17b195883241c563b00f0aa5106fc4eaa0d", size = 13409, upload-time = "2025-10-06T05:38:16.721Z" }, +] + +[[package]] +name = "fsspec" +version = "2026.2.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/51/7c/f60c259dcbf4f0c47cc4ddb8f7720d2dcdc8888c8e5ad84c73ea4531cc5b/fsspec-2026.2.0.tar.gz", hash = "sha256:6544e34b16869f5aacd5b90bdf1a71acb37792ea3ddf6125ee69a22a53fb8bff", size = 313441, upload-time = "2026-02-05T21:50:53.743Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e6/ab/fb21f4c939bb440104cc2b396d3be1d9b7a9fd3c6c2a53d98c45b3d7c954/fsspec-2026.2.0-py3-none-any.whl", hash = "sha256:98de475b5cb3bd66bedd5c4679e87b4fdfe1a3bf4d707b151b3c07e58c9a2437", size = 202505, upload-time = "2026-02-05T21:50:51.819Z" }, +] + +[package.optional-dependencies] +http = [ + { name = "aiohttp" }, +] + +[[package]] +name = "gitdb" +version = "4.0.12" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "smmap" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/72/94/63b0fc47eb32792c7ba1fe1b694daec9a63620db1e313033d18140c2320a/gitdb-4.0.12.tar.gz", hash = "sha256:5ef71f855d191a3326fcfbc0d5da835f26b13fbcba60c32c21091c349ffdb571", size = 394684, upload-time = "2025-01-02T07:20:46.413Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a0/61/5c78b91c3143ed5c14207f463aecfc8f9dbb5092fb2869baf37c273b2705/gitdb-4.0.12-py3-none-any.whl", hash = "sha256:67073e15955400952c6565cc3e707c554a4eea2e428946f7a4c162fab9bd9bcf", size = 62794, upload-time = "2025-01-02T07:20:43.624Z" }, +] + +[[package]] +name = "gitpython" +version = "3.1.50" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "gitdb" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/33/f6/354ae6491228b5eb40e10d89c4d13c651fe1cf7556e35ebdded50cff57ce/gitpython-3.1.50.tar.gz", hash = "sha256:80da2d12504d52e1f998772dc5baf6e553f8d2fcfe1fcc226c9d9a2ee3372dcc", size = 219798, upload-time = "2026-05-06T04:01:26.571Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/20/7a/1c6e3562dfd8950adbb11ffbc65d21e7c89d01a6e4f137fa981056de25c5/gitpython-3.1.50-py3-none-any.whl", hash = "sha256:d352abe2908d07355014abdd21ddf798c2a961469239afec4962e9da884858f9", size = 212507, upload-time = "2026-05-06T04:01:23.799Z" }, +] + +[[package]] +name = "gymnasium" +version = "1.3.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "cloudpickle" }, + { name = "farama-notifications" }, + { name = "numpy" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/4d/ff/14b6880d703dfaca204490979d3254ccd280c99550798993319902873658/gymnasium-1.3.0.tar.gz", hash = "sha256:6939e86e835d6b71b6ba6bfd360487420876deafc79bfb7bacba83a7c446bcf3", size = 830646, upload-time = "2026-04-22T13:47:14.155Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e9/73/fda6a25f3beeb5e49d74330b44092b9e5a547395ccd478d1103ddcbff1fc/gymnasium-1.3.0-py3-none-any.whl", hash = "sha256:6b8c159a8540dcbcb221722d7efda24d78ebbcbc3bd2ea1c2611aa2a34471fc2", size = 953904, upload-time = "2026-04-22T13:47:12.13Z" }, +] + +[[package]] +name = "h11" +version = "0.16.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/01/ee/02a2c011bdab74c6fb3c75474d40b3052059d95df7e73351460c8588d963/h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1", size = 101250, upload-time = "2025-04-24T03:35:25.427Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/04/4b/29cac41a4d98d144bf5f6d33995617b185d14b22401f75ca86f384e87ff1/h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86", size = 37515, upload-time = "2025-04-24T03:35:24.344Z" }, +] + +[[package]] +name = "hf-xet" +version = "1.5.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/74/d8/5c06fc76461418326a7decf8367480c35be11a41fd938633929c60a9ec6b/hf_xet-1.5.0.tar.gz", hash = "sha256:e0fb0a34d9f406eed88233e829a67ec016bec5af19e480eac65a233ea289a948", size = 837196, upload-time = "2026-05-06T06:18:15.583Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/68/9b/6912c99070915a4f28119e3c5b52a9abd1eec0ad5cb293b8c967a0c6f5a2/hf_xet-1.5.0-cp313-cp313t-macosx_10_12_x86_64.whl", hash = "sha256:7d70fe2ce97b9db73b9c9b9c81fe3693640aec83416a966c446afea54acfae3c", size = 4023383, upload-time = "2026-05-06T06:17:53.947Z" }, + { url = "https://files.pythonhosted.org/packages/0f/6d/9563cfde59b5d8128a9c7ec972a087f4c782e4f7bac5a85234edfd5d5e49/hf_xet-1.5.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:73a0dae8c71de3b0633a45c73f4a4a5ed09e94b43441d82981a781d4f12baa42", size = 3792751, upload-time = "2026-05-06T06:17:51.791Z" }, + { url = "https://files.pythonhosted.org/packages/07/a5/ed5a0cf35b49a0571af5a8f53416dad1877a718c021c9937c3a53cb45781/hf_xet-1.5.0-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:a60290ec57e9b71767fba7c3645ddafdd0759974b540441510c629c6db6db24a", size = 4456058, upload-time = "2026-05-06T06:17:40.735Z" }, + { url = "https://files.pythonhosted.org/packages/60/fb/3ae8bf2a7a37a4197d0195d7247fd25b3952e15cb8a599e285dfaa6f52b3/hf_xet-1.5.0-cp313-cp313t-manylinux_2_28_aarch64.whl", hash = "sha256:e5de0f6deada0dada870bb376a11bcd1f08abf3a968a6d118f33e72d1b1eb480", size = 4250783, upload-time = "2026-05-06T06:17:38.412Z" }, + { url = "https://files.pythonhosted.org/packages/a2/9b/8bae40d4d91525085137196e84eb0ed49cf65b5e96e5c3ecdadd8bd0fac2/hf_xet-1.5.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:c799d49f1a5544a0ef7591c0ee75e0d6b93d6f56dc7a4979f59f7518d2872216", size = 4445594, upload-time = "2026-05-06T06:18:04.219Z" }, + { url = "https://files.pythonhosted.org/packages/13/59/c74efbbd4e8728172b2cc72a2bc014d2947a4b7bdced932fbd3f5da1a4e5/hf_xet-1.5.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:2baea1b0b989e5c152fe81425f7745ddc8901280ba3d97c98d8cdece7b706c60", size = 4663995, upload-time = "2026-05-06T06:18:06.1Z" }, + { url = "https://files.pythonhosted.org/packages/73/32/8e1e0410af64cda9b139d1dcebdc993a8ff9c8c7c0e2696ae356d75ccc0d/hf_xet-1.5.0-cp313-cp313t-win_amd64.whl", hash = "sha256:526345b3ed45f374f6317349df489167606736c876241ba984105afe7fd4839d", size = 3966608, upload-time = "2026-05-06T06:18:19.74Z" }, + { url = "https://files.pythonhosted.org/packages/fc/34/a8febc8f4edbea8b3e21b02ebc8b628679b84ba7e45cde624a7736b51500/hf_xet-1.5.0-cp313-cp313t-win_arm64.whl", hash = "sha256:786d28e2eb8315d5035544b9d137b4a842d600c434bb91bf7d0d953cce906ad4", size = 3796946, upload-time = "2026-05-06T06:18:17.568Z" }, + { url = "https://files.pythonhosted.org/packages/2a/20/8fc8996afe5815fa1a6be8e9e5c02f24500f409d599e905800d498a4e14d/hf_xet-1.5.0-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:872d5601e6deea30d15865ede55d29eac6daf5a534ab417b99b6ef6b076dd96c", size = 4023495, upload-time = "2026-05-06T06:18:01.94Z" }, + { url = "https://files.pythonhosted.org/packages/32/6a/93d84463c00cecb561a7508aa6303e35ee2894294eac14245526924415fe/hf_xet-1.5.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:9929561f5abf4581c8ea79587881dfef6b8abb2a0d8a51915936fc2a614f4e73", size = 3792731, upload-time = "2026-05-06T06:18:00.021Z" }, + { url = "https://files.pythonhosted.org/packages/9d/5a/8ec8e0c863b382d00b3c2e2af6ded6b06371be617144a625903a6d562f4b/hf_xet-1.5.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:f7b7bbae318e583a86fb21e5a4a175d6721d628a2874f4bd022d0e660c32a682", size = 4456738, upload-time = "2026-05-06T06:17:49.574Z" }, + { url = "https://files.pythonhosted.org/packages/c5/ca/f7effa1a67717da2bcc6b6c28f71c6ca648c77acaec4e2c32f40cbe16d85/hf_xet-1.5.0-cp314-cp314t-manylinux_2_28_aarch64.whl", hash = "sha256:cf7b2dc6f31a4ea754bb50f74cde482dcf5d366d184076d8530b9872787f3761", size = 4251622, upload-time = "2026-05-06T06:17:47.096Z" }, + { url = "https://files.pythonhosted.org/packages/65/f2/19247dba3e231cf77dec59ddfb878f00057635ff773d099c9b59d37812c3/hf_xet-1.5.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:8dbcbab554c9ef158ef2c991545c3e970ddd8cc7acdcd0a78c5a41095dab4ded", size = 4445667, upload-time = "2026-05-06T06:18:11.983Z" }, + { url = "https://files.pythonhosted.org/packages/7f/64/6f116801a3bcfb6f59f5c251f48cadc47ea54026441c4a385079286a94fa/hf_xet-1.5.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:5906bf7718d3636dc13402914736abe723492cb730f744834f5f5b67d3a12702", size = 4664619, upload-time = "2026-05-06T06:18:13.771Z" }, + { url = "https://files.pythonhosted.org/packages/5c/e8/069542d37946ed08669b127e1496fa99e78196d71de8d41eda5e9f1b7a58/hf_xet-1.5.0-cp314-cp314t-win_amd64.whl", hash = "sha256:5f3dc2248fc01cc0a00cd392ab497f1ca373fcbc7e3f2da1f452480b384e839e", size = 3966802, upload-time = "2026-05-06T06:18:28.162Z" }, + { url = "https://files.pythonhosted.org/packages/f9/91/fc6fdec27b14d04e88c386ac0a0129732b53fa23f7c4a78f4b83a039c567/hf_xet-1.5.0-cp314-cp314t-win_arm64.whl", hash = "sha256:b285cea1b5bab46b758772716ba8d6854a1a0310fed1c249d678a8b38601e5a0", size = 3797168, upload-time = "2026-05-06T06:18:26.287Z" }, + { url = "https://files.pythonhosted.org/packages/3d/fb/69ff198a82cae7eb1a69fb84d93b3a3e4816564d76817fe541ddc96874eb/hf_xet-1.5.0-cp37-abi3-macosx_10_12_x86_64.whl", hash = "sha256:dad0dc84e941b8ba3c860659fe1fdc35c049d47cce293f003287757e971a8f56", size = 4030814, upload-time = "2026-05-06T06:17:57.933Z" }, + { url = "https://files.pythonhosted.org/packages/9b/ff/edcc2b40162bef3ff78e14ab637e5f3b89243d6aee72f5949d3bb6a5af83/hf_xet-1.5.0-cp37-abi3-macosx_11_0_arm64.whl", hash = "sha256:fd6e5a9b0fdac4ed03ed45ef79254a655b1aaab514a02202617fbf643f5fdf7a", size = 3798444, upload-time = "2026-05-06T06:17:55.79Z" }, + { url = "https://files.pythonhosted.org/packages/49/4d/103f76b04310e5e57656696cc184690d20c466af0bca3ca88f8c8ea5d4f3/hf_xet-1.5.0-cp37-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:3531b1823a0e6d77d80f9ed15ca0e00f0d115094f8ac033d5cae88f4564cc949", size = 4465986, upload-time = "2026-05-06T06:17:44.886Z" }, + { url = "https://files.pythonhosted.org/packages/c4/a2/546f47f464737b3edbab6f8ddb57f2599b93d2cbb66f06abb475ccb48651/hf_xet-1.5.0-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:9a0ee58cd18d5ea799f7ed11290bbccbe56bdd8b1d97ca74b9cc49a3945d7a3b", size = 4259865, upload-time = "2026-05-06T06:17:42.639Z" }, + { url = "https://files.pythonhosted.org/packages/95/7f/1be593c1f28613be2e196473481cd81bfc5910795e30a34e8f744f6cac4f/hf_xet-1.5.0-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:1e60df5a42e9bed8628b6416af2cba4cba57ae9f02de226a06b020d98e1aab18", size = 4459835, upload-time = "2026-05-06T06:18:08.026Z" }, + { url = "https://files.pythonhosted.org/packages/aa/b2/703569fc881f3284487e68cda7b42179978480da3c438042a6bbbb4a671c/hf_xet-1.5.0-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:4b35549ce62601b84da4ff9b24d970032ace3d4430f52d91bcbb26c901d6c690", size = 4672414, upload-time = "2026-05-06T06:18:09.864Z" }, + { url = "https://files.pythonhosted.org/packages/af/37/1b6def445c567286b50aa3b33828158e135b1be44938dde59f11382a500c/hf_xet-1.5.0-cp37-abi3-win_amd64.whl", hash = "sha256:2806c7c17b4d23f8d88f7c4814f838c3b6150773fe339c20af23e1cfaf2797e4", size = 3977238, upload-time = "2026-05-06T06:18:23.621Z" }, + { url = "https://files.pythonhosted.org/packages/62/94/3b66b148778ee100dcfd69c2ca22b57b41b44d3063ceec934f209e9184ce/hf_xet-1.5.0-cp37-abi3-win_arm64.whl", hash = "sha256:b6c9df403040248c76d808d3e047d64db2d923bae593eb244c41e425cf6cd7be", size = 3806916, upload-time = "2026-05-06T06:18:21.7Z" }, +] + +[[package]] +name = "httpcore" +version = "1.0.9" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "certifi" }, + { name = "h11" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/06/94/82699a10bca87a5556c9c59b5963f2d039dbd239f25bc2a63907a05a14cb/httpcore-1.0.9.tar.gz", hash = "sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8", size = 85484, upload-time = "2025-04-24T22:06:22.219Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7e/f5/f66802a942d491edb555dd61e3a9961140fd64c90bce1eafd741609d334d/httpcore-1.0.9-py3-none-any.whl", hash = "sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55", size = 78784, upload-time = "2025-04-24T22:06:20.566Z" }, +] + +[[package]] +name = "httptools" +version = "0.8.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/43/e5/d471fcb0e14523fe1c3f4ba58ca52480e7bd70ad7109a3846bc75892f7fb/httptools-0.8.0.tar.gz", hash = "sha256:6b2a32f18d97e16e90827d7a819ffa8dbd8cc245fc4e1fa9d1095b54ef4bd999", size = 271342, upload-time = "2026-05-25T22:17:48.841Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/14/88/1d21a36da8f5cb0fa49eafd4b169eba5608d57e75bbcf61845cbc6243216/httptools-0.8.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:880490234c10f70a9830743097e8958d6e4b9f5a0ffc24515023afeef984054d", size = 208247, upload-time = "2026-05-25T22:17:07.843Z" }, + { url = "https://files.pythonhosted.org/packages/a5/42/cc4feea2945cb3051038f090c9b36bd5b8a9d7f5a894a506a8983e33fd1c/httptools-0.8.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:5931891fb7b441b8a3853cf1b85c82c903defce084dd5f6771ca46e31bf862c5", size = 113064, upload-time = "2026-05-25T22:17:09.136Z" }, + { url = "https://files.pythonhosted.org/packages/e3/a6/febbb8b8db0f58b38e44ad6cb946e6a255ae49b55f2e8543408fb7501ccd/httptools-0.8.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:b15fc622b0f869d19207c4089a501d9bcc63ca5e071ffdd2f03f922df882dcb2", size = 523851, upload-time = "2026-05-25T22:17:10.106Z" }, + { url = "https://files.pythonhosted.org/packages/b7/e4/f90a0df0b83beff265b7e3b65f2a4cefd95792d4be0ac3e16049f2acd3c2/httptools-0.8.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:425f83884fd6343828d8c565f046cb72b6d19063f6924093e11bcd8e1548cd09", size = 518842, upload-time = "2026-05-25T22:17:11.218Z" }, + { url = "https://files.pythonhosted.org/packages/9e/2d/0c9ac76dd2c893841fbf6498d6acec4f2442e1b7067f6e3e316a80e494e8/httptools-0.8.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:ef7c3c97f4311c7be57e2986629df89d49cb434dbff78eafcd48c2bff986b15a", size = 501238, upload-time = "2026-05-25T22:17:12.728Z" }, + { url = "https://files.pythonhosted.org/packages/ca/42/906adc91ae3a5fa9c59c0a2f21c139725bd7e5b41ae6acd485cd14123ebf/httptools-0.8.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:a1afd7c9fbff0d9f5d489c4ce2768bd09c84a46ddefc7161e6aa82ae35c85745", size = 509567, upload-time = "2026-05-25T22:17:13.842Z" }, + { url = "https://files.pythonhosted.org/packages/05/0b/4240efeb672751ee5b9b380cb0e3fdc050bc05f68adc7a8aefc4fcd9a69a/httptools-0.8.0-cp312-cp312-win_amd64.whl", hash = "sha256:cd96f29b4bab1d42fa6e3d008711c75e0f79e94e06827330160e3a304227f150", size = 90918, upload-time = "2026-05-25T22:17:15.155Z" }, + { url = "https://files.pythonhosted.org/packages/5e/e5/8cfcabc5546e8022f168be28bcdaa128a240a0befdd03b59d558b4f18bd6/httptools-0.8.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:614ceea8ea606848bece2338ac03b3ce5324bcb4be8dc7d377ed708012fa4db8", size = 205148, upload-time = "2026-05-25T22:17:16.333Z" }, + { url = "https://files.pythonhosted.org/packages/2a/0e/0fb14848c19a686c8062ff9067c1a48793e3224b47bc5b201535b6036fce/httptools-0.8.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:2d689918c15a013c65ef52d9fd495d766893ab831a2c8d89f2ac5940a5df847c", size = 111368, upload-time = "2026-05-25T22:17:17.586Z" }, + { url = "https://files.pythonhosted.org/packages/2e/1b/46f1cecf06b9bbde8e4b8c88034ac7908989e5ff7a3a388ef38392949c1f/httptools-0.8.0-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:eb3028cca2fc0a6d720e52ef61d8ebb62fcbfeb1de56874546d858d3f25a26b7", size = 486447, upload-time = "2026-05-25T22:17:18.564Z" }, + { url = "https://files.pythonhosted.org/packages/77/00/258bfc0837221f81d9725c45f9b948a6a6b2994a147a4fb66e85100c668f/httptools-0.8.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:88bdd940f2b5d487b4d032c6afa5489a7dc4694410d43de3c38c4fb3af0dc45d", size = 482448, upload-time = "2026-05-25T22:17:19.912Z" }, + { url = "https://files.pythonhosted.org/packages/04/ab/d1cef3b5523f4d272a70f42a776c3169a2dddfe3a54de4b2ce4a36341528/httptools-0.8.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:6a43c9dd399758ccc0531acb0a3c4a6c299ee893ee9400e9c893b7bdcfae0681", size = 464460, upload-time = "2026-05-25T22:17:20.882Z" }, + { url = "https://files.pythonhosted.org/packages/ce/48/5d1d072442277bb2b3434e0e60690b8e8c23840ef7de8b6ea54040a536d3/httptools-0.8.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:0770728beb05094c809b98e814edff5fef69d26ad7d21185f2f6d5884a0ba683", size = 471312, upload-time = "2026-05-25T22:17:22.085Z" }, + { url = "https://files.pythonhosted.org/packages/0d/66/b96623b27e51a68199ef4efdda0613cced9233fe3062ac74e50749c5ad37/httptools-0.8.0-cp313-cp313-win_amd64.whl", hash = "sha256:7685df791fad561384bfb139e77fde27a1ffd93134e016f95a0db424ffbf77b1", size = 90117, upload-time = "2026-05-25T22:17:23.074Z" }, + { url = "https://files.pythonhosted.org/packages/1a/12/fa3fbf5f9517b273edea2dc982aa82a8c634091e67c590792b729017bc6f/httptools-0.8.0-cp314-cp314-macosx_10_13_universal2.whl", hash = "sha256:de242a49b5d18e0a8776e654e9f6bf6d89f3875a5c35b425a0e7ce940feb3fd6", size = 206183, upload-time = "2026-05-25T22:17:24.004Z" }, + { url = "https://files.pythonhosted.org/packages/30/fc/5e7c4cb443370f2090a3aba0453a07384d29ff66b7435bb90e77e1037599/httptools-0.8.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:159e9ab5f701ccd42e555a12f1ad8ff69702910fc1c996cf2bb66e5fcb7a231b", size = 112079, upload-time = "2026-05-25T22:17:25.216Z" }, + { url = "https://files.pythonhosted.org/packages/ba/53/771bd891eb0f236f32145d6a1775777ec85745f3cc983a1f23d1a3b8ddfe/httptools-0.8.0-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:c4a9f1707e4823d54dfec6c33fa3697d302aed536ed352a7ebb5a061ddb869d0", size = 481596, upload-time = "2026-05-25T22:17:26.186Z" }, + { url = "https://files.pythonhosted.org/packages/62/42/94e15bc68ce3d423243c45d7f1b0c7561f13844f97dc52ae23182fb65628/httptools-0.8.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d76ad7b951387e3632c8716a9bb03ac5b45c5f16119aa409db0459520887944e", size = 480865, upload-time = "2026-05-25T22:17:27.542Z" }, + { url = "https://files.pythonhosted.org/packages/1c/7c/fe2980fc03723272e30f135b62360b075f513dfe7cc73aef36c7f04012bd/httptools-0.8.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:a3b7387147361c3fd47a0bde763c5c91b5b4cd4dc9989b8ece84ff436c99843b", size = 463189, upload-time = "2026-05-25T22:17:28.546Z" }, + { url = "https://files.pythonhosted.org/packages/15/1b/47fc5fff68acd1bfa20b4734059c9a06cadb88119dcd5258b5b0d21d91c8/httptools-0.8.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:f256d6ce930c52ca1cb2a960b7da03548c454e7d28b06059ad41bfe789036ce0", size = 466610, upload-time = "2026-05-25T22:17:29.816Z" }, + { url = "https://files.pythonhosted.org/packages/60/bd/07b13c93ffd9bec9546e0d43f8e19378dd696dbd278511406bc07371ef1f/httptools-0.8.0-cp314-cp314-win_amd64.whl", hash = "sha256:19d1ee275bb59ba2643ba9a3a1e51cc0c788caf2b8df506368e03f56fdd08527", size = 92705, upload-time = "2026-05-25T22:17:31.133Z" }, + { url = "https://files.pythonhosted.org/packages/fd/c4/121648f68ce066d7bd762d6b6d97e620847642d38d54f3d90ff11d947629/httptools-0.8.0-cp314-cp314t-macosx_10_13_universal2.whl", hash = "sha256:de1ed58a974e75d56560acc7e7fed01a454994429456f65209789992e41f2568", size = 215023, upload-time = "2026-05-25T22:17:32.401Z" }, + { url = "https://files.pythonhosted.org/packages/b9/b0/312a062ae741ae3e8baa8c8bf20be81b2e67337b259ab4349bebc7b6142e/httptools-0.8.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:e93c227b595c6926c1acee96891dd9da4be338cfbe82e5cd3bb9d8dd7dc4ac0b", size = 117405, upload-time = "2026-05-25T22:17:33.742Z" }, + { url = "https://files.pythonhosted.org/packages/fc/37/fccd705f795386bb05bf413012fecff2a33e5aa8c2f069096de3e9fd8702/httptools-0.8.0-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:2a021c3a8e65cc125390d72f59b968afca3bdcaff25bd67965e0a055a14946ca", size = 558497, upload-time = "2026-05-25T22:17:34.732Z" }, + { url = "https://files.pythonhosted.org/packages/bd/39/f172e8003576de35f5ba77ff417cf0e34429d35dc014deef15afa337a72c/httptools-0.8.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:48774d39cbb70e2b1f71f88852a3087ae1d3a1eb80482bb48c13067ab080c14f", size = 571585, upload-time = "2026-05-25T22:17:35.813Z" }, + { url = "https://files.pythonhosted.org/packages/3e/b9/f5564760af99f3dbbf3f9104dc00e5da27e96cf433c6bdcf77617f70bf3f/httptools-0.8.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:88eead8ec8680a9f146c655bc88445a325bd7921cfd8194c7337e9467282427d", size = 543297, upload-time = "2026-05-25T22:17:37.08Z" }, + { url = "https://files.pythonhosted.org/packages/99/67/8d9f2c313618e161b82f3873188e7196126da1d6e29688df40eb3997c77a/httptools-0.8.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:2c032fa028f46871ec7e1fc59fc15e8023eab3e6bbe6ece786a1611719a5d081", size = 539535, upload-time = "2026-05-25T22:17:38.032Z" }, + { url = "https://files.pythonhosted.org/packages/48/63/b906c01e53f50d432c0defe43ce52764a111dc1bdd028bafbeb54dcfd008/httptools-0.8.0-cp314-cp314t-win_amd64.whl", hash = "sha256:384c17174464c8e873398b7af24f0b1f44d992c820328413951a625323155d77", size = 108209, upload-time = "2026-05-25T22:17:39.473Z" }, +] + +[[package]] +name = "httpx" +version = "0.28.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "anyio" }, + { name = "certifi" }, + { name = "httpcore" }, + { name = "idna" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/b1/df/48c586a5fe32a0f01324ee087459e112ebb7224f646c0b5023f5e79e9956/httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc", size = 141406, upload-time = "2024-12-06T15:37:23.222Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/2a/39/e50c7c3a983047577ee07d2a9e53faf5a69493943ec3f6a384bdc792deb2/httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad", size = 73517, upload-time = "2024-12-06T15:37:21.509Z" }, +] + +[[package]] +name = "huggingface-hub" +version = "1.18.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "click" }, + { name = "filelock" }, + { name = "fsspec" }, + { name = "hf-xet", marker = "platform_machine == 'AMD64' or platform_machine == 'aarch64' or platform_machine == 'amd64' or platform_machine == 'arm64' or platform_machine == 'x86_64'" }, + { name = "httpx" }, + { name = "packaging" }, + { name = "pyyaml" }, + { name = "tqdm" }, + { name = "typer" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/fb/d8/748ea0a47f0fa15227fe682f7a80826b4b7c096e4818044b8f56d6cb66d6/huggingface_hub-1.18.0.tar.gz", hash = "sha256:f0c5ecd1ef8c6a60f86f61ee278f2c1570ba9e279c9f54de9094210723b3613b", size = 812699, upload-time = "2026-06-05T09:26:33.401Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0b/03/40a05316cb6616e5b7efd7773656441ab04b4b022c2199e79bb4622a92a3/huggingface_hub-1.18.0-py3-none-any.whl", hash = "sha256:729be4a976fb706dcc02d176bcda8a3f32bdf21a294e8f4b3dda6fbcbc9c1ab1", size = 684411, upload-time = "2026-06-05T09:26:31.48Z" }, +] + +[[package]] +name = "identify" +version = "2.6.19" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/52/63/51723b5f116cc04b061cb6f5a561790abf249d25931d515cd375e063e0f4/identify-2.6.19.tar.gz", hash = "sha256:6be5020c38fcb07da56c53733538a3081ea5aa70d36a156f83044bfbf9173842", size = 99567, upload-time = "2026-04-17T18:39:50.265Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/94/84/d9273cd09688070a6523c4aee4663a8538721b2b755c4962aafae0011e72/identify-2.6.19-py2.py3-none-any.whl", hash = "sha256:20e6a87f786f768c092a721ad107fc9df0eb89347be9396cadf3f4abbd1fb78a", size = 99397, upload-time = "2026-04-17T18:39:49.221Z" }, +] + +[[package]] +name = "idna" +version = "3.18" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/cd/63/9496c57188a2ee585e0f1db071d75089a11e98aa86eb99d9d7618fc1edce/idna-3.18.tar.gz", hash = "sha256:ffb385a7e039654cef1ab9ef32c6fafe283c0c0467bba1d9029738ce4a14a848", size = 196711, upload-time = "2026-06-02T14:34:07.794Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/1e/5e/d4e9f1a599fb8e573b7b87160658329fbf28d19eac2718f51fc3def3aa5a/idna-3.18-py3-none-any.whl", hash = "sha256:7f952cbe720b688055e3f87de14f5c3e5fdaa8bc3928985c4077ca689de849a2", size = 65455, upload-time = "2026-06-02T14:34:06.319Z" }, +] + +[[package]] +name = "iniconfig" +version = "2.3.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/72/34/14ca021ce8e5dfedc35312d08ba8bf51fdd999c576889fc2c24cb97f4f10/iniconfig-2.3.0.tar.gz", hash = "sha256:c76315c77db068650d49c5b56314774a7804df16fee4402c1f19d6d15d8c4730", size = 20503, upload-time = "2025-10-18T21:55:43.219Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl", hash = "sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12", size = 7484, upload-time = "2025-10-18T21:55:41.639Z" }, +] + +[[package]] +name = "jinja2" +version = "3.1.6" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "markupsafe" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/df/bf/f7da0350254c0ed7c72f3e33cef02e048281fec7ecec5f032d4aac52226b/jinja2-3.1.6.tar.gz", hash = "sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d", size = 245115, upload-time = "2025-03-05T20:05:02.478Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/62/a1/3d680cbfd5f4b8f15abc1d571870c5fc3e594bb582bc3b64ea099db13e56/jinja2-3.1.6-py3-none-any.whl", hash = "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67", size = 134899, upload-time = "2025-03-05T20:05:00.369Z" }, +] + +[[package]] +name = "jsonlines" +version = "4.0.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "attrs" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/35/87/bcda8e46c88d0e34cad2f09ee2d0c7f5957bccdb9791b0b934ec84d84be4/jsonlines-4.0.0.tar.gz", hash = "sha256:0c6d2c09117550c089995247f605ae4cf77dd1533041d366351f6f298822ea74", size = 11359, upload-time = "2023-09-01T12:34:44.187Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/f8/62/d9ba6323b9202dd2fe166beab8a86d29465c41a0288cbe229fac60c1ab8d/jsonlines-4.0.0-py3-none-any.whl", hash = "sha256:185b334ff2ca5a91362993f42e83588a360cf95ce4b71a73548502bda52a7c55", size = 8701, upload-time = "2023-09-01T12:34:42.563Z" }, +] + +[[package]] +name = "lelab" +version = "0.1.0" +source = { editable = "." } +dependencies = [ + { name = "fastapi", extra = ["standard"] }, + { name = "lelab-compute-seeed-cloud" }, + { name = "lerobot", extra = ["core-scripts", "feetech", "training"] }, + { name = "psutil" }, + { name = "uvicorn" }, + { name = "websockets" }, +] + +[package.optional-dependencies] +dev = [ + { name = "pre-commit" }, + { name = "pytest" }, + { name = "ruff" }, +] +test = [ + { name = "httpx" }, + { name = "pytest" }, + { name = "pytest-asyncio" }, +] + +[package.metadata] +requires-dist = [ + { name = "fastapi", extras = ["standard"], specifier = ">=0.115.12" }, + { name = "httpx", marker = "extra == 'test'", specifier = ">=0.27" }, + { name = "lelab-compute-seeed-cloud", git = "https://github.com/Seeed-Solution/lelab-compute-seeed-cloud.git" }, + { name = "lerobot", extras = ["core-scripts", "feetech", "training"], git = "https://github.com/huggingface/lerobot.git?rev=82dffde7fad11cba91f7916b050fbe7d7eea35ab" }, + { name = "pre-commit", marker = "extra == 'dev'", specifier = ">=3.0" }, + { name = "psutil", specifier = ">=5.9.0" }, + { name = "pytest", marker = "extra == 'dev'", specifier = ">=7.0" }, + { name = "pytest", marker = "extra == 'test'", specifier = ">=7.0" }, + { name = "pytest-asyncio", marker = "extra == 'test'", specifier = ">=0.23" }, + { name = "ruff", marker = "extra == 'dev'", specifier = ">=0.6" }, + { name = "uvicorn", specifier = ">=0.24.0" }, + { name = "websockets", specifier = ">=15.0.1" }, +] +provides-extras = ["dev", "test"] + +[[package]] +name = "lelab-compute-seeed-cloud" +version = "0.1.0" +source = { git = "https://github.com/Seeed-Solution/lelab-compute-seeed-cloud.git#8a053bc814dbaf77c7652b69ff84f99fea9c025d" } + +[[package]] +name = "lerobot" +version = "0.5.2" +source = { git = "https://github.com/huggingface/lerobot.git?rev=82dffde7fad11cba91f7916b050fbe7d7eea35ab#82dffde7fad11cba91f7916b050fbe7d7eea35ab" } +dependencies = [ + { name = "cmake" }, + { name = "draccus" }, + { name = "einops" }, + { name = "gymnasium" }, + { name = "huggingface-hub" }, + { name = "numpy" }, + { name = "opencv-python-headless" }, + { name = "packaging" }, + { name = "pillow" }, + { name = "requests" }, + { name = "safetensors" }, + { name = "setuptools" }, + { name = "termcolor" }, + { name = "torch" }, + { name = "torchvision" }, + { name = "tqdm" }, +] + +[package.optional-dependencies] +core-scripts = [ + { name = "av" }, + { name = "datasets" }, + { name = "deepdiff" }, + { name = "jsonlines" }, + { name = "pandas" }, + { name = "pyarrow" }, + { name = "pynput" }, + { name = "pyserial" }, + { name = "rerun-sdk" }, + { name = "torchcodec", marker = "(platform_machine != 'aarch64' and platform_machine != 'arm64' and platform_machine != 'armv7l' and sys_platform == 'linux') or (platform_machine != 'x86_64' and sys_platform == 'darwin') or (sys_platform != 'darwin' and sys_platform != 'linux' and sys_platform != 'win32')" }, +] +feetech = [ + { name = "deepdiff" }, + { name = "feetech-servo-sdk" }, + { name = "pyserial" }, +] +training = [ + { name = "accelerate" }, + { name = "av" }, + { name = "datasets" }, + { name = "jsonlines" }, + { name = "pandas" }, + { name = "pyarrow" }, + { name = "torchcodec", marker = "(platform_machine != 'aarch64' and platform_machine != 'arm64' and platform_machine != 'armv7l' and sys_platform == 'linux') or (platform_machine != 'x86_64' and sys_platform == 'darwin') or (sys_platform != 'darwin' and sys_platform != 'linux' and sys_platform != 'win32')" }, + { name = "wandb" }, +] + +[[package]] +name = "markdown-it-py" +version = "4.2.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "mdurl" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/06/ff/7841249c247aa650a76b9ee4bbaeae59370dc8bfd2f6c01f3630c35eb134/markdown_it_py-4.2.0.tar.gz", hash = "sha256:04a21681d6fbb623de53f6f364d352309d4094dd4194040a10fd51833e418d49", size = 82454, upload-time = "2026-05-07T12:08:28.36Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b3/81/4da04ced5a082363ecfa159c010d200ecbd959ae410c10c0264a38cac0f5/markdown_it_py-4.2.0-py3-none-any.whl", hash = "sha256:9f7ebbcd14fe59494226453aed97c1070d83f8d24b6fc3a3bcf9a38092641c4a", size = 91687, upload-time = "2026-05-07T12:08:27.182Z" }, +] + +[[package]] +name = "markupsafe" +version = "3.0.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/7e/99/7690b6d4034fffd95959cbe0c02de8deb3098cc577c67bb6a24fe5d7caa7/markupsafe-3.0.3.tar.gz", hash = "sha256:722695808f4b6457b320fdc131280796bdceb04ab50fe1795cd540799ebe1698", size = 80313, upload-time = "2025-09-27T18:37:40.426Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/5a/72/147da192e38635ada20e0a2e1a51cf8823d2119ce8883f7053879c2199b5/markupsafe-3.0.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d53197da72cc091b024dd97249dfc7794d6a56530370992a5e1a08983ad9230e", size = 11615, upload-time = "2025-09-27T18:36:30.854Z" }, + { url = "https://files.pythonhosted.org/packages/9a/81/7e4e08678a1f98521201c3079f77db69fb552acd56067661f8c2f534a718/markupsafe-3.0.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:1872df69a4de6aead3491198eaf13810b565bdbeec3ae2dc8780f14458ec73ce", size = 12020, upload-time = "2025-09-27T18:36:31.971Z" }, + { url = "https://files.pythonhosted.org/packages/1e/2c/799f4742efc39633a1b54a92eec4082e4f815314869865d876824c257c1e/markupsafe-3.0.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:3a7e8ae81ae39e62a41ec302f972ba6ae23a5c5396c8e60113e9066ef893da0d", size = 24332, upload-time = "2025-09-27T18:36:32.813Z" }, + { url = "https://files.pythonhosted.org/packages/3c/2e/8d0c2ab90a8c1d9a24f0399058ab8519a3279d1bd4289511d74e909f060e/markupsafe-3.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d6dd0be5b5b189d31db7cda48b91d7e0a9795f31430b7f271219ab30f1d3ac9d", size = 22947, upload-time = "2025-09-27T18:36:33.86Z" }, + { url = "https://files.pythonhosted.org/packages/2c/54/887f3092a85238093a0b2154bd629c89444f395618842e8b0c41783898ea/markupsafe-3.0.3-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:94c6f0bb423f739146aec64595853541634bde58b2135f27f61c1ffd1cd4d16a", size = 21962, upload-time = "2025-09-27T18:36:35.099Z" }, + { url = "https://files.pythonhosted.org/packages/c9/2f/336b8c7b6f4a4d95e91119dc8521402461b74a485558d8f238a68312f11c/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:be8813b57049a7dc738189df53d69395eba14fb99345e0a5994914a3864c8a4b", size = 23760, upload-time = "2025-09-27T18:36:36.001Z" }, + { url = "https://files.pythonhosted.org/packages/32/43/67935f2b7e4982ffb50a4d169b724d74b62a3964bc1a9a527f5ac4f1ee2b/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:83891d0e9fb81a825d9a6d61e3f07550ca70a076484292a70fde82c4b807286f", size = 21529, upload-time = "2025-09-27T18:36:36.906Z" }, + { url = "https://files.pythonhosted.org/packages/89/e0/4486f11e51bbba8b0c041098859e869e304d1c261e59244baa3d295d47b7/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:77f0643abe7495da77fb436f50f8dab76dbc6e5fd25d39589a0f1fe6548bfa2b", size = 23015, upload-time = "2025-09-27T18:36:37.868Z" }, + { url = "https://files.pythonhosted.org/packages/2f/e1/78ee7a023dac597a5825441ebd17170785a9dab23de95d2c7508ade94e0e/markupsafe-3.0.3-cp312-cp312-win32.whl", hash = "sha256:d88b440e37a16e651bda4c7c2b930eb586fd15ca7406cb39e211fcff3bf3017d", size = 14540, upload-time = "2025-09-27T18:36:38.761Z" }, + { url = "https://files.pythonhosted.org/packages/aa/5b/bec5aa9bbbb2c946ca2733ef9c4ca91c91b6a24580193e891b5f7dbe8e1e/markupsafe-3.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:26a5784ded40c9e318cfc2bdb30fe164bdb8665ded9cd64d500a34fb42067b1c", size = 15105, upload-time = "2025-09-27T18:36:39.701Z" }, + { url = "https://files.pythonhosted.org/packages/e5/f1/216fc1bbfd74011693a4fd837e7026152e89c4bcf3e77b6692fba9923123/markupsafe-3.0.3-cp312-cp312-win_arm64.whl", hash = "sha256:35add3b638a5d900e807944a078b51922212fb3dedb01633a8defc4b01a3c85f", size = 13906, upload-time = "2025-09-27T18:36:40.689Z" }, + { url = "https://files.pythonhosted.org/packages/38/2f/907b9c7bbba283e68f20259574b13d005c121a0fa4c175f9bed27c4597ff/markupsafe-3.0.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:e1cf1972137e83c5d4c136c43ced9ac51d0e124706ee1c8aa8532c1287fa8795", size = 11622, upload-time = "2025-09-27T18:36:41.777Z" }, + { url = "https://files.pythonhosted.org/packages/9c/d9/5f7756922cdd676869eca1c4e3c0cd0df60ed30199ffd775e319089cb3ed/markupsafe-3.0.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:116bb52f642a37c115f517494ea5feb03889e04df47eeff5b130b1808ce7c219", size = 12029, upload-time = "2025-09-27T18:36:43.257Z" }, + { url = "https://files.pythonhosted.org/packages/00/07/575a68c754943058c78f30db02ee03a64b3c638586fba6a6dd56830b30a3/markupsafe-3.0.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:133a43e73a802c5562be9bbcd03d090aa5a1fe899db609c29e8c8d815c5f6de6", size = 24374, upload-time = "2025-09-27T18:36:44.508Z" }, + { url = "https://files.pythonhosted.org/packages/a9/21/9b05698b46f218fc0e118e1f8168395c65c8a2c750ae2bab54fc4bd4e0e8/markupsafe-3.0.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ccfcd093f13f0f0b7fdd0f198b90053bf7b2f02a3927a30e63f3ccc9df56b676", size = 22980, upload-time = "2025-09-27T18:36:45.385Z" }, + { url = "https://files.pythonhosted.org/packages/7f/71/544260864f893f18b6827315b988c146b559391e6e7e8f7252839b1b846a/markupsafe-3.0.3-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:509fa21c6deb7a7a273d629cf5ec029bc209d1a51178615ddf718f5918992ab9", size = 21990, upload-time = "2025-09-27T18:36:46.916Z" }, + { url = "https://files.pythonhosted.org/packages/c2/28/b50fc2f74d1ad761af2f5dcce7492648b983d00a65b8c0e0cb457c82ebbe/markupsafe-3.0.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a4afe79fb3de0b7097d81da19090f4df4f8d3a2b3adaa8764138aac2e44f3af1", size = 23784, upload-time = "2025-09-27T18:36:47.884Z" }, + { url = "https://files.pythonhosted.org/packages/ed/76/104b2aa106a208da8b17a2fb72e033a5a9d7073c68f7e508b94916ed47a9/markupsafe-3.0.3-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:795e7751525cae078558e679d646ae45574b47ed6e7771863fcc079a6171a0fc", size = 21588, upload-time = "2025-09-27T18:36:48.82Z" }, + { url = "https://files.pythonhosted.org/packages/b5/99/16a5eb2d140087ebd97180d95249b00a03aa87e29cc224056274f2e45fd6/markupsafe-3.0.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:8485f406a96febb5140bfeca44a73e3ce5116b2501ac54fe953e488fb1d03b12", size = 23041, upload-time = "2025-09-27T18:36:49.797Z" }, + { url = "https://files.pythonhosted.org/packages/19/bc/e7140ed90c5d61d77cea142eed9f9c303f4c4806f60a1044c13e3f1471d0/markupsafe-3.0.3-cp313-cp313-win32.whl", hash = "sha256:bdd37121970bfd8be76c5fb069c7751683bdf373db1ed6c010162b2a130248ed", size = 14543, upload-time = "2025-09-27T18:36:51.584Z" }, + { url = "https://files.pythonhosted.org/packages/05/73/c4abe620b841b6b791f2edc248f556900667a5a1cf023a6646967ae98335/markupsafe-3.0.3-cp313-cp313-win_amd64.whl", hash = "sha256:9a1abfdc021a164803f4d485104931fb8f8c1efd55bc6b748d2f5774e78b62c5", size = 15113, upload-time = "2025-09-27T18:36:52.537Z" }, + { url = "https://files.pythonhosted.org/packages/f0/3a/fa34a0f7cfef23cf9500d68cb7c32dd64ffd58a12b09225fb03dd37d5b80/markupsafe-3.0.3-cp313-cp313-win_arm64.whl", hash = "sha256:7e68f88e5b8799aa49c85cd116c932a1ac15caaa3f5db09087854d218359e485", size = 13911, upload-time = "2025-09-27T18:36:53.513Z" }, + { url = "https://files.pythonhosted.org/packages/e4/d7/e05cd7efe43a88a17a37b3ae96e79a19e846f3f456fe79c57ca61356ef01/markupsafe-3.0.3-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:218551f6df4868a8d527e3062d0fb968682fe92054e89978594c28e642c43a73", size = 11658, upload-time = "2025-09-27T18:36:54.819Z" }, + { url = "https://files.pythonhosted.org/packages/99/9e/e412117548182ce2148bdeacdda3bb494260c0b0184360fe0d56389b523b/markupsafe-3.0.3-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:3524b778fe5cfb3452a09d31e7b5adefeea8c5be1d43c4f810ba09f2ceb29d37", size = 12066, upload-time = "2025-09-27T18:36:55.714Z" }, + { url = "https://files.pythonhosted.org/packages/bc/e6/fa0ffcda717ef64a5108eaa7b4f5ed28d56122c9a6d70ab8b72f9f715c80/markupsafe-3.0.3-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4e885a3d1efa2eadc93c894a21770e4bc67899e3543680313b09f139e149ab19", size = 25639, upload-time = "2025-09-27T18:36:56.908Z" }, + { url = "https://files.pythonhosted.org/packages/96/ec/2102e881fe9d25fc16cb4b25d5f5cde50970967ffa5dddafdb771237062d/markupsafe-3.0.3-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8709b08f4a89aa7586de0aadc8da56180242ee0ada3999749b183aa23df95025", size = 23569, upload-time = "2025-09-27T18:36:57.913Z" }, + { url = "https://files.pythonhosted.org/packages/4b/30/6f2fce1f1f205fc9323255b216ca8a235b15860c34b6798f810f05828e32/markupsafe-3.0.3-cp313-cp313t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:b8512a91625c9b3da6f127803b166b629725e68af71f8184ae7e7d54686a56d6", size = 23284, upload-time = "2025-09-27T18:36:58.833Z" }, + { url = "https://files.pythonhosted.org/packages/58/47/4a0ccea4ab9f5dcb6f79c0236d954acb382202721e704223a8aafa38b5c8/markupsafe-3.0.3-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:9b79b7a16f7fedff2495d684f2b59b0457c3b493778c9eed31111be64d58279f", size = 24801, upload-time = "2025-09-27T18:36:59.739Z" }, + { url = "https://files.pythonhosted.org/packages/6a/70/3780e9b72180b6fecb83a4814d84c3bf4b4ae4bf0b19c27196104149734c/markupsafe-3.0.3-cp313-cp313t-musllinux_1_2_riscv64.whl", hash = "sha256:12c63dfb4a98206f045aa9563db46507995f7ef6d83b2f68eda65c307c6829eb", size = 22769, upload-time = "2025-09-27T18:37:00.719Z" }, + { url = "https://files.pythonhosted.org/packages/98/c5/c03c7f4125180fc215220c035beac6b9cb684bc7a067c84fc69414d315f5/markupsafe-3.0.3-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:8f71bc33915be5186016f675cd83a1e08523649b0e33efdb898db577ef5bb009", size = 23642, upload-time = "2025-09-27T18:37:01.673Z" }, + { url = "https://files.pythonhosted.org/packages/80/d6/2d1b89f6ca4bff1036499b1e29a1d02d282259f3681540e16563f27ebc23/markupsafe-3.0.3-cp313-cp313t-win32.whl", hash = "sha256:69c0b73548bc525c8cb9a251cddf1931d1db4d2258e9599c28c07ef3580ef354", size = 14612, upload-time = "2025-09-27T18:37:02.639Z" }, + { url = "https://files.pythonhosted.org/packages/2b/98/e48a4bfba0a0ffcf9925fe2d69240bfaa19c6f7507b8cd09c70684a53c1e/markupsafe-3.0.3-cp313-cp313t-win_amd64.whl", hash = "sha256:1b4b79e8ebf6b55351f0d91fe80f893b4743f104bff22e90697db1590e47a218", size = 15200, upload-time = "2025-09-27T18:37:03.582Z" }, + { url = "https://files.pythonhosted.org/packages/0e/72/e3cc540f351f316e9ed0f092757459afbc595824ca724cbc5a5d4263713f/markupsafe-3.0.3-cp313-cp313t-win_arm64.whl", hash = "sha256:ad2cf8aa28b8c020ab2fc8287b0f823d0a7d8630784c31e9ee5edea20f406287", size = 13973, upload-time = "2025-09-27T18:37:04.929Z" }, + { url = "https://files.pythonhosted.org/packages/33/8a/8e42d4838cd89b7dde187011e97fe6c3af66d8c044997d2183fbd6d31352/markupsafe-3.0.3-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:eaa9599de571d72e2daf60164784109f19978b327a3910d3e9de8c97b5b70cfe", size = 11619, upload-time = "2025-09-27T18:37:06.342Z" }, + { url = "https://files.pythonhosted.org/packages/b5/64/7660f8a4a8e53c924d0fa05dc3a55c9cee10bbd82b11c5afb27d44b096ce/markupsafe-3.0.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:c47a551199eb8eb2121d4f0f15ae0f923d31350ab9280078d1e5f12b249e0026", size = 12029, upload-time = "2025-09-27T18:37:07.213Z" }, + { url = "https://files.pythonhosted.org/packages/da/ef/e648bfd021127bef5fa12e1720ffed0c6cbb8310c8d9bea7266337ff06de/markupsafe-3.0.3-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f34c41761022dd093b4b6896d4810782ffbabe30f2d443ff5f083e0cbbb8c737", size = 24408, upload-time = "2025-09-27T18:37:09.572Z" }, + { url = "https://files.pythonhosted.org/packages/41/3c/a36c2450754618e62008bf7435ccb0f88053e07592e6028a34776213d877/markupsafe-3.0.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:457a69a9577064c05a97c41f4e65148652db078a3a509039e64d3467b9e7ef97", size = 23005, upload-time = "2025-09-27T18:37:10.58Z" }, + { url = "https://files.pythonhosted.org/packages/bc/20/b7fdf89a8456b099837cd1dc21974632a02a999ec9bf7ca3e490aacd98e7/markupsafe-3.0.3-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:e8afc3f2ccfa24215f8cb28dcf43f0113ac3c37c2f0f0806d8c70e4228c5cf4d", size = 22048, upload-time = "2025-09-27T18:37:11.547Z" }, + { url = "https://files.pythonhosted.org/packages/9a/a7/591f592afdc734f47db08a75793a55d7fbcc6902a723ae4cfbab61010cc5/markupsafe-3.0.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:ec15a59cf5af7be74194f7ab02d0f59a62bdcf1a537677ce67a2537c9b87fcda", size = 23821, upload-time = "2025-09-27T18:37:12.48Z" }, + { url = "https://files.pythonhosted.org/packages/7d/33/45b24e4f44195b26521bc6f1a82197118f74df348556594bd2262bda1038/markupsafe-3.0.3-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:0eb9ff8191e8498cca014656ae6b8d61f39da5f95b488805da4bb029cccbfbaf", size = 21606, upload-time = "2025-09-27T18:37:13.485Z" }, + { url = "https://files.pythonhosted.org/packages/ff/0e/53dfaca23a69fbfbbf17a4b64072090e70717344c52eaaaa9c5ddff1e5f0/markupsafe-3.0.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:2713baf880df847f2bece4230d4d094280f4e67b1e813eec43b4c0e144a34ffe", size = 23043, upload-time = "2025-09-27T18:37:14.408Z" }, + { url = "https://files.pythonhosted.org/packages/46/11/f333a06fc16236d5238bfe74daccbca41459dcd8d1fa952e8fbd5dccfb70/markupsafe-3.0.3-cp314-cp314-win32.whl", hash = "sha256:729586769a26dbceff69f7a7dbbf59ab6572b99d94576a5592625d5b411576b9", size = 14747, upload-time = "2025-09-27T18:37:15.36Z" }, + { url = "https://files.pythonhosted.org/packages/28/52/182836104b33b444e400b14f797212f720cbc9ed6ba34c800639d154e821/markupsafe-3.0.3-cp314-cp314-win_amd64.whl", hash = "sha256:bdc919ead48f234740ad807933cdf545180bfbe9342c2bb451556db2ed958581", size = 15341, upload-time = "2025-09-27T18:37:16.496Z" }, + { url = "https://files.pythonhosted.org/packages/6f/18/acf23e91bd94fd7b3031558b1f013adfa21a8e407a3fdb32745538730382/markupsafe-3.0.3-cp314-cp314-win_arm64.whl", hash = "sha256:5a7d5dc5140555cf21a6fefbdbf8723f06fcd2f63ef108f2854de715e4422cb4", size = 14073, upload-time = "2025-09-27T18:37:17.476Z" }, + { url = "https://files.pythonhosted.org/packages/3c/f0/57689aa4076e1b43b15fdfa646b04653969d50cf30c32a102762be2485da/markupsafe-3.0.3-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:1353ef0c1b138e1907ae78e2f6c63ff67501122006b0f9abad68fda5f4ffc6ab", size = 11661, upload-time = "2025-09-27T18:37:18.453Z" }, + { url = "https://files.pythonhosted.org/packages/89/c3/2e67a7ca217c6912985ec766c6393b636fb0c2344443ff9d91404dc4c79f/markupsafe-3.0.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:1085e7fbddd3be5f89cc898938f42c0b3c711fdcb37d75221de2666af647c175", size = 12069, upload-time = "2025-09-27T18:37:19.332Z" }, + { url = "https://files.pythonhosted.org/packages/f0/00/be561dce4e6ca66b15276e184ce4b8aec61fe83662cce2f7d72bd3249d28/markupsafe-3.0.3-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1b52b4fb9df4eb9ae465f8d0c228a00624de2334f216f178a995ccdcf82c4634", size = 25670, upload-time = "2025-09-27T18:37:20.245Z" }, + { url = "https://files.pythonhosted.org/packages/50/09/c419f6f5a92e5fadde27efd190eca90f05e1261b10dbd8cbcb39cd8ea1dc/markupsafe-3.0.3-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:fed51ac40f757d41b7c48425901843666a6677e3e8eb0abcff09e4ba6e664f50", size = 23598, upload-time = "2025-09-27T18:37:21.177Z" }, + { url = "https://files.pythonhosted.org/packages/22/44/a0681611106e0b2921b3033fc19bc53323e0b50bc70cffdd19f7d679bb66/markupsafe-3.0.3-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:f190daf01f13c72eac4efd5c430a8de82489d9cff23c364c3ea822545032993e", size = 23261, upload-time = "2025-09-27T18:37:22.167Z" }, + { url = "https://files.pythonhosted.org/packages/5f/57/1b0b3f100259dc9fffe780cfb60d4be71375510e435efec3d116b6436d43/markupsafe-3.0.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:e56b7d45a839a697b5eb268c82a71bd8c7f6c94d6fd50c3d577fa39a9f1409f5", size = 24835, upload-time = "2025-09-27T18:37:23.296Z" }, + { url = "https://files.pythonhosted.org/packages/26/6a/4bf6d0c97c4920f1597cc14dd720705eca0bf7c787aebc6bb4d1bead5388/markupsafe-3.0.3-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:f3e98bb3798ead92273dc0e5fd0f31ade220f59a266ffd8a4f6065e0a3ce0523", size = 22733, upload-time = "2025-09-27T18:37:24.237Z" }, + { url = "https://files.pythonhosted.org/packages/14/c7/ca723101509b518797fedc2fdf79ba57f886b4aca8a7d31857ba3ee8281f/markupsafe-3.0.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:5678211cb9333a6468fb8d8be0305520aa073f50d17f089b5b4b477ea6e67fdc", size = 23672, upload-time = "2025-09-27T18:37:25.271Z" }, + { url = "https://files.pythonhosted.org/packages/fb/df/5bd7a48c256faecd1d36edc13133e51397e41b73bb77e1a69deab746ebac/markupsafe-3.0.3-cp314-cp314t-win32.whl", hash = "sha256:915c04ba3851909ce68ccc2b8e2cd691618c4dc4c4232fb7982bca3f41fd8c3d", size = 14819, upload-time = "2025-09-27T18:37:26.285Z" }, + { url = "https://files.pythonhosted.org/packages/1a/8a/0402ba61a2f16038b48b39bccca271134be00c5c9f0f623208399333c448/markupsafe-3.0.3-cp314-cp314t-win_amd64.whl", hash = "sha256:4faffd047e07c38848ce017e8725090413cd80cbc23d86e55c587bf979e579c9", size = 15426, upload-time = "2025-09-27T18:37:27.316Z" }, + { url = "https://files.pythonhosted.org/packages/70/bc/6f1c2f612465f5fa89b95bead1f44dcb607670fd42891d8fdcd5d039f4f4/markupsafe-3.0.3-cp314-cp314t-win_arm64.whl", hash = "sha256:32001d6a8fc98c8cb5c947787c5d08b0a50663d139f1305bac5885d98d9b40fa", size = 14146, upload-time = "2025-09-27T18:37:28.327Z" }, +] + +[[package]] +name = "mdurl" +version = "0.1.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d6/54/cfe61301667036ec958cb99bd3efefba235e65cdeb9c84d24a8293ba1d90/mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba", size = 8729, upload-time = "2022-08-14T12:40:10.846Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b3/38/89ba8ad64ae25be8de66a6d463314cf1eb366222074cfda9ee839c56a4b4/mdurl-0.1.2-py3-none-any.whl", hash = "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8", size = 9979, upload-time = "2022-08-14T12:40:09.779Z" }, +] + +[[package]] +name = "mergedeep" +version = "1.3.4" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/3a/41/580bb4006e3ed0361b8151a01d324fb03f420815446c7def45d02f74c270/mergedeep-1.3.4.tar.gz", hash = "sha256:0096d52e9dad9939c3d975a774666af186eda617e6ca84df4c94dec30004f2a8", size = 4661, upload-time = "2021-02-05T18:55:30.623Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/2c/19/04f9b178c2d8a15b076c8b5140708fa6ffc5601fb6f1e975537072df5b2a/mergedeep-1.3.4-py3-none-any.whl", hash = "sha256:70775750742b25c0d8f36c55aed03d24c3384d17c951b3175d898bd778ef0307", size = 6354, upload-time = "2021-02-05T18:55:29.583Z" }, +] + +[[package]] +name = "mpmath" +version = "1.3.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/e0/47/dd32fa426cc72114383ac549964eecb20ecfd886d1e5ccf5340b55b02f57/mpmath-1.3.0.tar.gz", hash = "sha256:7a28eb2a9774d00c7bc92411c19a89209d5da7c4c9a9e227be8330a23a25b91f", size = 508106, upload-time = "2023-03-07T16:47:11.061Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/43/e3/7d92a15f894aa0c9c4b49b8ee9ac9850d6e63b03c9c32c0367a13ae62209/mpmath-1.3.0-py3-none-any.whl", hash = "sha256:a0b2b9fe80bbcd81a6647ff13108738cfb482d481d826cc0e02f5b35e5c88d2c", size = 536198, upload-time = "2023-03-07T16:47:09.197Z" }, +] + +[[package]] +name = "multidict" +version = "6.7.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/1a/c2/c2d94cbe6ac1753f3fc980da97b3d930efe1da3af3c9f5125354436c073d/multidict-6.7.1.tar.gz", hash = "sha256:ec6652a1bee61c53a3e5776b6049172c53b6aaba34f18c9ad04f82712bac623d", size = 102010, upload-time = "2026-01-26T02:46:45.979Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/8d/9c/f20e0e2cf80e4b2e4b1c365bf5fe104ee633c751a724246262db8f1a0b13/multidict-6.7.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:a90f75c956e32891a4eda3639ce6dd86e87105271f43d43442a3aedf3cddf172", size = 76893, upload-time = "2026-01-26T02:43:52.754Z" }, + { url = "https://files.pythonhosted.org/packages/fe/cf/18ef143a81610136d3da8193da9d80bfe1cb548a1e2d1c775f26b23d024a/multidict-6.7.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:3fccb473e87eaa1382689053e4a4618e7ba7b9b9b8d6adf2027ee474597128cd", size = 45456, upload-time = "2026-01-26T02:43:53.893Z" }, + { url = "https://files.pythonhosted.org/packages/a9/65/1caac9d4cd32e8433908683446eebc953e82d22b03d10d41a5f0fefe991b/multidict-6.7.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:b0fa96985700739c4c7853a43c0b3e169360d6855780021bfc6d0f1ce7c123e7", size = 43872, upload-time = "2026-01-26T02:43:55.041Z" }, + { url = "https://files.pythonhosted.org/packages/cf/3b/d6bd75dc4f3ff7c73766e04e705b00ed6dbbaccf670d9e05a12b006f5a21/multidict-6.7.1-cp312-cp312-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:cb2a55f408c3043e42b40cc8eecd575afa27b7e0b956dfb190de0f8499a57a53", size = 251018, upload-time = "2026-01-26T02:43:56.198Z" }, + { url = "https://files.pythonhosted.org/packages/fd/80/c959c5933adedb9ac15152e4067c702a808ea183a8b64cf8f31af8ad3155/multidict-6.7.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:eb0ce7b2a32d09892b3dd6cc44877a0d02a33241fafca5f25c8b6b62374f8b75", size = 258883, upload-time = "2026-01-26T02:43:57.499Z" }, + { url = "https://files.pythonhosted.org/packages/86/85/7ed40adafea3d4f1c8b916e3b5cc3a8e07dfcdcb9cd72800f4ed3ca1b387/multidict-6.7.1-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:c3a32d23520ee37bf327d1e1a656fec76a2edd5c038bf43eddfa0572ec49c60b", size = 242413, upload-time = "2026-01-26T02:43:58.755Z" }, + { url = "https://files.pythonhosted.org/packages/d2/57/b8565ff533e48595503c785f8361ff9a4fde4d67de25c207cd0ba3befd03/multidict-6.7.1-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:9c90fed18bffc0189ba814749fdcc102b536e83a9f738a9003e569acd540a733", size = 268404, upload-time = "2026-01-26T02:44:00.216Z" }, + { url = "https://files.pythonhosted.org/packages/e0/50/9810c5c29350f7258180dfdcb2e52783a0632862eb334c4896ac717cebcb/multidict-6.7.1-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:da62917e6076f512daccfbbde27f46fed1c98fee202f0559adec8ee0de67f71a", size = 269456, upload-time = "2026-01-26T02:44:02.202Z" }, + { url = "https://files.pythonhosted.org/packages/f3/8d/5e5be3ced1d12966fefb5c4ea3b2a5b480afcea36406559442c6e31d4a48/multidict-6.7.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bfde23ef6ed9db7eaee6c37dcec08524cb43903c60b285b172b6c094711b3961", size = 256322, upload-time = "2026-01-26T02:44:03.56Z" }, + { url = "https://files.pythonhosted.org/packages/31/6e/d8a26d81ac166a5592782d208dd90dfdc0a7a218adaa52b45a672b46c122/multidict-6.7.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:3758692429e4e32f1ba0df23219cd0b4fc0a52f476726fff9337d1a57676a582", size = 253955, upload-time = "2026-01-26T02:44:04.845Z" }, + { url = "https://files.pythonhosted.org/packages/59/4c/7c672c8aad41534ba619bcd4ade7a0dc87ed6b8b5c06149b85d3dd03f0cd/multidict-6.7.1-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:398c1478926eca669f2fd6a5856b6de9c0acf23a2cb59a14c0ba5844fa38077e", size = 251254, upload-time = "2026-01-26T02:44:06.133Z" }, + { url = "https://files.pythonhosted.org/packages/7b/bd/84c24de512cbafbdbc39439f74e967f19570ce7924e3007174a29c348916/multidict-6.7.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:c102791b1c4f3ab36ce4101154549105a53dc828f016356b3e3bcae2e3a039d3", size = 252059, upload-time = "2026-01-26T02:44:07.518Z" }, + { url = "https://files.pythonhosted.org/packages/fa/ba/f5449385510825b73d01c2d4087bf6d2fccc20a2d42ac34df93191d3dd03/multidict-6.7.1-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:a088b62bd733e2ad12c50dad01b7d0166c30287c166e137433d3b410add807a6", size = 263588, upload-time = "2026-01-26T02:44:09.382Z" }, + { url = "https://files.pythonhosted.org/packages/d7/11/afc7c677f68f75c84a69fe37184f0f82fce13ce4b92f49f3db280b7e92b3/multidict-6.7.1-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:3d51ff4785d58d3f6c91bdbffcb5e1f7ddfda557727043aa20d20ec4f65e324a", size = 259642, upload-time = "2026-01-26T02:44:10.73Z" }, + { url = "https://files.pythonhosted.org/packages/2b/17/ebb9644da78c4ab36403739e0e6e0e30ebb135b9caf3440825001a0bddcb/multidict-6.7.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:fc5907494fccf3e7d3f94f95c91d6336b092b5fc83811720fae5e2765890dfba", size = 251377, upload-time = "2026-01-26T02:44:12.042Z" }, + { url = "https://files.pythonhosted.org/packages/ca/a4/840f5b97339e27846c46307f2530a2805d9d537d8b8bd416af031cad7fa0/multidict-6.7.1-cp312-cp312-win32.whl", hash = "sha256:28ca5ce2fd9716631133d0e9a9b9a745ad7f60bac2bccafb56aa380fc0b6c511", size = 41887, upload-time = "2026-01-26T02:44:14.245Z" }, + { url = "https://files.pythonhosted.org/packages/80/31/0b2517913687895f5904325c2069d6a3b78f66cc641a86a2baf75a05dcbb/multidict-6.7.1-cp312-cp312-win_amd64.whl", hash = "sha256:fcee94dfbd638784645b066074b338bc9cc155d4b4bffa4adce1615c5a426c19", size = 46053, upload-time = "2026-01-26T02:44:15.371Z" }, + { url = "https://files.pythonhosted.org/packages/0c/5b/aba28e4ee4006ae4c7df8d327d31025d760ffa992ea23812a601d226e682/multidict-6.7.1-cp312-cp312-win_arm64.whl", hash = "sha256:ba0a9fb644d0c1a2194cf7ffb043bd852cea63a57f66fbd33959f7dae18517bf", size = 43307, upload-time = "2026-01-26T02:44:16.852Z" }, + { url = "https://files.pythonhosted.org/packages/f2/22/929c141d6c0dba87d3e1d38fbdf1ba8baba86b7776469f2bc2d3227a1e67/multidict-6.7.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:2b41f5fed0ed563624f1c17630cb9941cf2309d4df00e494b551b5f3e3d67a23", size = 76174, upload-time = "2026-01-26T02:44:18.509Z" }, + { url = "https://files.pythonhosted.org/packages/c7/75/bc704ae15fee974f8fccd871305e254754167dce5f9e42d88a2def741a1d/multidict-6.7.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:84e61e3af5463c19b67ced91f6c634effb89ef8bfc5ca0267f954451ed4bb6a2", size = 45116, upload-time = "2026-01-26T02:44:19.745Z" }, + { url = "https://files.pythonhosted.org/packages/79/76/55cd7186f498ed080a18440c9013011eb548f77ae1b297206d030eb1180a/multidict-6.7.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:935434b9853c7c112eee7ac891bc4cb86455aa631269ae35442cb316790c1445", size = 43524, upload-time = "2026-01-26T02:44:21.571Z" }, + { url = "https://files.pythonhosted.org/packages/e9/3c/414842ef8d5a1628d68edee29ba0e5bcf235dbfb3ccd3ea303a7fe8c72ff/multidict-6.7.1-cp313-cp313-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:432feb25a1cb67fe82a9680b4d65fb542e4635cb3166cd9c01560651ad60f177", size = 249368, upload-time = "2026-01-26T02:44:22.803Z" }, + { url = "https://files.pythonhosted.org/packages/f6/32/befed7f74c458b4a525e60519fe8d87eef72bb1e99924fa2b0f9d97a221e/multidict-6.7.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e82d14e3c948952a1a85503817e038cba5905a3352de76b9a465075d072fba23", size = 256952, upload-time = "2026-01-26T02:44:24.306Z" }, + { url = "https://files.pythonhosted.org/packages/03/d6/c878a44ba877f366630c860fdf74bfb203c33778f12b6ac274936853c451/multidict-6.7.1-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:4cfb48c6ea66c83bcaaf7e4dfa7ec1b6bbcf751b7db85a328902796dfde4c060", size = 240317, upload-time = "2026-01-26T02:44:25.772Z" }, + { url = "https://files.pythonhosted.org/packages/68/49/57421b4d7ad2e9e60e25922b08ceb37e077b90444bde6ead629095327a6f/multidict-6.7.1-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:1d540e51b7e8e170174555edecddbd5538105443754539193e3e1061864d444d", size = 267132, upload-time = "2026-01-26T02:44:27.648Z" }, + { url = "https://files.pythonhosted.org/packages/b7/fe/ec0edd52ddbcea2a2e89e174f0206444a61440b40f39704e64dc807a70bd/multidict-6.7.1-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:273d23f4b40f3dce4d6c8a821c741a86dec62cded82e1175ba3d99be128147ed", size = 268140, upload-time = "2026-01-26T02:44:29.588Z" }, + { url = "https://files.pythonhosted.org/packages/b0/73/6e1b01cbeb458807aa0831742232dbdd1fa92bfa33f52a3f176b4ff3dc11/multidict-6.7.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9d624335fd4fa1c08a53f8b4be7676ebde19cd092b3895c421045ca87895b429", size = 254277, upload-time = "2026-01-26T02:44:30.902Z" }, + { url = "https://files.pythonhosted.org/packages/6a/b2/5fb8c124d7561a4974c342bc8c778b471ebbeb3cc17df696f034a7e9afe7/multidict-6.7.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:12fad252f8b267cc75b66e8fc51b3079604e8d43a75428ffe193cd9e2195dfd6", size = 252291, upload-time = "2026-01-26T02:44:32.31Z" }, + { url = "https://files.pythonhosted.org/packages/5a/96/51d4e4e06bcce92577fcd488e22600bd38e4fd59c20cb49434d054903bd2/multidict-6.7.1-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:03ede2a6ffbe8ef936b92cb4529f27f42be7f56afcdab5ab739cd5f27fb1cbf9", size = 250156, upload-time = "2026-01-26T02:44:33.734Z" }, + { url = "https://files.pythonhosted.org/packages/db/6b/420e173eec5fba721a50e2a9f89eda89d9c98fded1124f8d5c675f7a0c0f/multidict-6.7.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:90efbcf47dbe33dcf643a1e400d67d59abeac5db07dc3f27d6bdeae497a2198c", size = 249742, upload-time = "2026-01-26T02:44:35.222Z" }, + { url = "https://files.pythonhosted.org/packages/44/a3/ec5b5bd98f306bc2aa297b8c6f11a46714a56b1e6ef5ebda50a4f5d7c5fb/multidict-6.7.1-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:5c4b9bfc148f5a91be9244d6264c53035c8a0dcd2f51f1c3c6e30e30ebaa1c84", size = 262221, upload-time = "2026-01-26T02:44:36.604Z" }, + { url = "https://files.pythonhosted.org/packages/cd/f7/e8c0d0da0cd1e28d10e624604e1a36bcc3353aaebdfdc3a43c72bc683a12/multidict-6.7.1-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:401c5a650f3add2472d1d288c26deebc540f99e2fb83e9525007a74cd2116f1d", size = 258664, upload-time = "2026-01-26T02:44:38.008Z" }, + { url = "https://files.pythonhosted.org/packages/52/da/151a44e8016dd33feed44f730bd856a66257c1ee7aed4f44b649fb7edeb3/multidict-6.7.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:97891f3b1b3ffbded884e2916cacf3c6fc87b66bb0dde46f7357404750559f33", size = 249490, upload-time = "2026-01-26T02:44:39.386Z" }, + { url = "https://files.pythonhosted.org/packages/87/af/a3b86bf9630b732897f6fc3f4c4714b90aa4361983ccbdcd6c0339b21b0c/multidict-6.7.1-cp313-cp313-win32.whl", hash = "sha256:e1c5988359516095535c4301af38d8a8838534158f649c05dd1050222321bcb3", size = 41695, upload-time = "2026-01-26T02:44:41.318Z" }, + { url = "https://files.pythonhosted.org/packages/b2/35/e994121b0e90e46134673422dd564623f93304614f5d11886b1b3e06f503/multidict-6.7.1-cp313-cp313-win_amd64.whl", hash = "sha256:960c83bf01a95b12b08fd54324a4eb1d5b52c88932b5cba5d6e712bb3ed12eb5", size = 45884, upload-time = "2026-01-26T02:44:42.488Z" }, + { url = "https://files.pythonhosted.org/packages/ca/61/42d3e5dbf661242a69c97ea363f2d7b46c567da8eadef8890022be6e2ab0/multidict-6.7.1-cp313-cp313-win_arm64.whl", hash = "sha256:563fe25c678aaba333d5399408f5ec3c383ca5b663e7f774dd179a520b8144df", size = 43122, upload-time = "2026-01-26T02:44:43.664Z" }, + { url = "https://files.pythonhosted.org/packages/6d/b3/e6b21c6c4f314bb956016b0b3ef2162590a529b84cb831c257519e7fde44/multidict-6.7.1-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:c76c4bec1538375dad9d452d246ca5368ad6e1c9039dadcf007ae59c70619ea1", size = 83175, upload-time = "2026-01-26T02:44:44.894Z" }, + { url = "https://files.pythonhosted.org/packages/fb/76/23ecd2abfe0957b234f6c960f4ade497f55f2c16aeb684d4ecdbf1c95791/multidict-6.7.1-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:57b46b24b5d5ebcc978da4ec23a819a9402b4228b8a90d9c656422b4bdd8a963", size = 48460, upload-time = "2026-01-26T02:44:46.106Z" }, + { url = "https://files.pythonhosted.org/packages/c4/57/a0ed92b23f3a042c36bc4227b72b97eca803f5f1801c1ab77c8a212d455e/multidict-6.7.1-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:e954b24433c768ce78ab7929e84ccf3422e46deb45a4dc9f93438f8217fa2d34", size = 46930, upload-time = "2026-01-26T02:44:47.278Z" }, + { url = "https://files.pythonhosted.org/packages/b5/66/02ec7ace29162e447f6382c495dc95826bf931d3818799bbef11e8f7df1a/multidict-6.7.1-cp313-cp313t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:3bd231490fa7217cc832528e1cd8752a96f0125ddd2b5749390f7c3ec8721b65", size = 242582, upload-time = "2026-01-26T02:44:48.604Z" }, + { url = "https://files.pythonhosted.org/packages/58/18/64f5a795e7677670e872673aca234162514696274597b3708b2c0d276cce/multidict-6.7.1-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:253282d70d67885a15c8a7716f3a73edf2d635793ceda8173b9ecc21f2fb8292", size = 250031, upload-time = "2026-01-26T02:44:50.544Z" }, + { url = "https://files.pythonhosted.org/packages/c8/ed/e192291dbbe51a8290c5686f482084d31bcd9d09af24f63358c3d42fd284/multidict-6.7.1-cp313-cp313t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:0b4c48648d7649c9335cf1927a8b87fa692de3dcb15faa676c6a6f1f1aabda43", size = 228596, upload-time = "2026-01-26T02:44:51.951Z" }, + { url = "https://files.pythonhosted.org/packages/1e/7e/3562a15a60cf747397e7f2180b0a11dc0c38d9175a650e75fa1b4d325e15/multidict-6.7.1-cp313-cp313t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:98bc624954ec4d2c7cb074b8eefc2b5d0ce7d482e410df446414355d158fe4ca", size = 257492, upload-time = "2026-01-26T02:44:53.902Z" }, + { url = "https://files.pythonhosted.org/packages/24/02/7d0f9eae92b5249bb50ac1595b295f10e263dd0078ebb55115c31e0eaccd/multidict-6.7.1-cp313-cp313t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:1b99af4d9eec0b49927b4402bcbb58dea89d3e0db8806a4086117019939ad3dd", size = 255899, upload-time = "2026-01-26T02:44:55.316Z" }, + { url = "https://files.pythonhosted.org/packages/00/e3/9b60ed9e23e64c73a5cde95269ef1330678e9c6e34dd4eb6b431b85b5a10/multidict-6.7.1-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6aac4f16b472d5b7dc6f66a0d49dd57b0e0902090be16594dc9ebfd3d17c47e7", size = 247970, upload-time = "2026-01-26T02:44:56.783Z" }, + { url = "https://files.pythonhosted.org/packages/3e/06/538e58a63ed5cfb0bd4517e346b91da32fde409d839720f664e9a4ae4f9d/multidict-6.7.1-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:21f830fe223215dffd51f538e78c172ed7c7f60c9b96a2bf05c4848ad49921c3", size = 245060, upload-time = "2026-01-26T02:44:58.195Z" }, + { url = "https://files.pythonhosted.org/packages/b2/2f/d743a3045a97c895d401e9bd29aaa09b94f5cbdf1bd561609e5a6c431c70/multidict-6.7.1-cp313-cp313t-musllinux_1_2_armv7l.whl", hash = "sha256:f5dd81c45b05518b9aa4da4aa74e1c93d715efa234fd3e8a179df611cc85e5f4", size = 235888, upload-time = "2026-01-26T02:44:59.57Z" }, + { url = "https://files.pythonhosted.org/packages/38/83/5a325cac191ab28b63c52f14f1131f3b0a55ba3b9aa65a6d0bf2a9b921a0/multidict-6.7.1-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:eb304767bca2bb92fb9c5bd33cedc95baee5bb5f6c88e63706533a1c06ad08c8", size = 243554, upload-time = "2026-01-26T02:45:01.054Z" }, + { url = "https://files.pythonhosted.org/packages/20/1f/9d2327086bd15da2725ef6aae624208e2ef828ed99892b17f60c344e57ed/multidict-6.7.1-cp313-cp313t-musllinux_1_2_ppc64le.whl", hash = "sha256:c9035dde0f916702850ef66460bc4239d89d08df4d02023a5926e7446724212c", size = 252341, upload-time = "2026-01-26T02:45:02.484Z" }, + { url = "https://files.pythonhosted.org/packages/e8/2c/2a1aa0280cf579d0f6eed8ee5211c4f1730bd7e06c636ba2ee6aafda302e/multidict-6.7.1-cp313-cp313t-musllinux_1_2_s390x.whl", hash = "sha256:af959b9beeb66c822380f222f0e0a1889331597e81f1ded7f374f3ecb0fd6c52", size = 246391, upload-time = "2026-01-26T02:45:03.862Z" }, + { url = "https://files.pythonhosted.org/packages/e5/03/7ca022ffc36c5a3f6e03b179a5ceb829be9da5783e6fe395f347c0794680/multidict-6.7.1-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:41f2952231456154ee479651491e94118229844dd7226541788be783be2b5108", size = 243422, upload-time = "2026-01-26T02:45:05.296Z" }, + { url = "https://files.pythonhosted.org/packages/dc/1d/b31650eab6c5778aceed46ba735bd97f7c7d2f54b319fa916c0f96e7805b/multidict-6.7.1-cp313-cp313t-win32.whl", hash = "sha256:df9f19c28adcb40b6aae30bbaa1478c389efd50c28d541d76760199fc1037c32", size = 47770, upload-time = "2026-01-26T02:45:06.754Z" }, + { url = "https://files.pythonhosted.org/packages/ac/5b/2d2d1d522e51285bd61b1e20df8f47ae1a9d80839db0b24ea783b3832832/multidict-6.7.1-cp313-cp313t-win_amd64.whl", hash = "sha256:d54ecf9f301853f2c5e802da559604b3e95bb7a3b01a9c295c6ee591b9882de8", size = 53109, upload-time = "2026-01-26T02:45:08.044Z" }, + { url = "https://files.pythonhosted.org/packages/3d/a3/cc409ba012c83ca024a308516703cf339bdc4b696195644a7215a5164a24/multidict-6.7.1-cp313-cp313t-win_arm64.whl", hash = "sha256:5a37ca18e360377cfda1d62f5f382ff41f2b8c4ccb329ed974cc2e1643440118", size = 45573, upload-time = "2026-01-26T02:45:09.349Z" }, + { url = "https://files.pythonhosted.org/packages/91/cc/db74228a8be41884a567e88a62fd589a913708fcf180d029898c17a9a371/multidict-6.7.1-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:8f333ec9c5eb1b7105e3b84b53141e66ca05a19a605368c55450b6ba208cb9ee", size = 75190, upload-time = "2026-01-26T02:45:10.651Z" }, + { url = "https://files.pythonhosted.org/packages/d5/22/492f2246bb5b534abd44804292e81eeaf835388901f0c574bac4eeec73c5/multidict-6.7.1-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:a407f13c188f804c759fc6a9f88286a565c242a76b27626594c133b82883b5c2", size = 44486, upload-time = "2026-01-26T02:45:11.938Z" }, + { url = "https://files.pythonhosted.org/packages/f1/4f/733c48f270565d78b4544f2baddc2fb2a245e5a8640254b12c36ac7ac68e/multidict-6.7.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:0e161ddf326db5577c3a4cc2d8648f81456e8a20d40415541587a71620d7a7d1", size = 43219, upload-time = "2026-01-26T02:45:14.346Z" }, + { url = "https://files.pythonhosted.org/packages/24/bb/2c0c2287963f4259c85e8bcbba9182ced8d7fca65c780c38e99e61629d11/multidict-6.7.1-cp314-cp314-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:1e3a8bb24342a8201d178c3b4984c26ba81a577c80d4d525727427460a50c22d", size = 245132, upload-time = "2026-01-26T02:45:15.712Z" }, + { url = "https://files.pythonhosted.org/packages/a7/f9/44d4b3064c65079d2467888794dea218d1601898ac50222ab8a9a8094460/multidict-6.7.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:97231140a50f5d447d3164f994b86a0bed7cd016e2682f8650d6a9158e14fd31", size = 252420, upload-time = "2026-01-26T02:45:17.293Z" }, + { url = "https://files.pythonhosted.org/packages/8b/13/78f7275e73fa17b24c9a51b0bd9d73ba64bb32d0ed51b02a746eb876abe7/multidict-6.7.1-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:6b10359683bd8806a200fd2909e7c8ca3a7b24ec1d8132e483d58e791d881048", size = 233510, upload-time = "2026-01-26T02:45:19.356Z" }, + { url = "https://files.pythonhosted.org/packages/4b/25/8167187f62ae3cbd52da7893f58cb036b47ea3fb67138787c76800158982/multidict-6.7.1-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:283ddac99f7ac25a4acadbf004cb5ae34480bbeb063520f70ce397b281859362", size = 264094, upload-time = "2026-01-26T02:45:20.834Z" }, + { url = "https://files.pythonhosted.org/packages/a1/e7/69a3a83b7b030cf283fb06ce074a05a02322359783424d7edf0f15fe5022/multidict-6.7.1-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:538cec1e18c067d0e6103aa9a74f9e832904c957adc260e61cd9d8cf0c3b3d37", size = 260786, upload-time = "2026-01-26T02:45:22.818Z" }, + { url = "https://files.pythonhosted.org/packages/fe/3b/8ec5074bcfc450fe84273713b4b0a0dd47c0249358f5d82eb8104ffe2520/multidict-6.7.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7eee46ccb30ff48a1e35bb818cc90846c6be2b68240e42a78599166722cea709", size = 248483, upload-time = "2026-01-26T02:45:24.368Z" }, + { url = "https://files.pythonhosted.org/packages/48/5a/d5a99e3acbca0e29c5d9cba8f92ceb15dce78bab963b308ae692981e3a5d/multidict-6.7.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:fa263a02f4f2dd2d11a7b1bb4362aa7cb1049f84a9235d31adf63f30143469a0", size = 248403, upload-time = "2026-01-26T02:45:25.982Z" }, + { url = "https://files.pythonhosted.org/packages/35/48/e58cd31f6c7d5102f2a4bf89f96b9cf7e00b6c6f3d04ecc44417c00a5a3c/multidict-6.7.1-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:2e1425e2f99ec5bd36c15a01b690a1a2456209c5deed58f95469ffb46039ccbb", size = 240315, upload-time = "2026-01-26T02:45:27.487Z" }, + { url = "https://files.pythonhosted.org/packages/94/33/1cd210229559cb90b6786c30676bb0c58249ff42f942765f88793b41fdce/multidict-6.7.1-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:497394b3239fc6f0e13a78a3e1b61296e72bf1c5f94b4c4eb80b265c37a131cd", size = 245528, upload-time = "2026-01-26T02:45:28.991Z" }, + { url = "https://files.pythonhosted.org/packages/64/f2/6e1107d226278c876c783056b7db43d800bb64c6131cec9c8dfb6903698e/multidict-6.7.1-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:233b398c29d3f1b9676b4b6f75c518a06fcb2ea0b925119fb2c1bc35c05e1601", size = 258784, upload-time = "2026-01-26T02:45:30.503Z" }, + { url = "https://files.pythonhosted.org/packages/4d/c1/11f664f14d525e4a1b5327a82d4de61a1db604ab34c6603bb3c2cc63ad34/multidict-6.7.1-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:93b1818e4a6e0930454f0f2af7dfce69307ca03cdcfb3739bf4d91241967b6c1", size = 251980, upload-time = "2026-01-26T02:45:32.603Z" }, + { url = "https://files.pythonhosted.org/packages/e1/9f/75a9ac888121d0c5bbd4ecf4eead45668b1766f6baabfb3b7f66a410e231/multidict-6.7.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:f33dc2a3abe9249ea5d8360f969ec7f4142e7ac45ee7014d8f8d5acddf178b7b", size = 243602, upload-time = "2026-01-26T02:45:34.043Z" }, + { url = "https://files.pythonhosted.org/packages/9a/e7/50bf7b004cc8525d80dbbbedfdc7aed3e4c323810890be4413e589074032/multidict-6.7.1-cp314-cp314-win32.whl", hash = "sha256:3ab8b9d8b75aef9df299595d5388b14530839f6422333357af1339443cff777d", size = 40930, upload-time = "2026-01-26T02:45:36.278Z" }, + { url = "https://files.pythonhosted.org/packages/e0/bf/52f25716bbe93745595800f36fb17b73711f14da59ed0bb2eba141bc9f0f/multidict-6.7.1-cp314-cp314-win_amd64.whl", hash = "sha256:5e01429a929600e7dab7b166062d9bb54a5eed752384c7384c968c2afab8f50f", size = 45074, upload-time = "2026-01-26T02:45:37.546Z" }, + { url = "https://files.pythonhosted.org/packages/97/ab/22803b03285fa3a525f48217963da3a65ae40f6a1b6f6cf2768879e208f9/multidict-6.7.1-cp314-cp314-win_arm64.whl", hash = "sha256:4885cb0e817aef5d00a2e8451d4665c1808378dc27c2705f1bf4ef8505c0d2e5", size = 42471, upload-time = "2026-01-26T02:45:38.889Z" }, + { url = "https://files.pythonhosted.org/packages/e0/6d/f9293baa6146ba9507e360ea0292b6422b016907c393e2f63fc40ab7b7b5/multidict-6.7.1-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:0458c978acd8e6ea53c81eefaddbbee9c6c5e591f41b3f5e8e194780fe026581", size = 82401, upload-time = "2026-01-26T02:45:40.254Z" }, + { url = "https://files.pythonhosted.org/packages/7a/68/53b5494738d83558d87c3c71a486504d8373421c3e0dbb6d0db48ad42ee0/multidict-6.7.1-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:c0abd12629b0af3cf590982c0b413b1e7395cd4ec026f30986818ab95bfaa94a", size = 48143, upload-time = "2026-01-26T02:45:41.635Z" }, + { url = "https://files.pythonhosted.org/packages/37/e8/5284c53310dcdc99ce5d66563f6e5773531a9b9fe9ec7a615e9bc306b05f/multidict-6.7.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:14525a5f61d7d0c94b368a42cff4c9a4e7ba2d52e2672a7b23d84dc86fb02b0c", size = 46507, upload-time = "2026-01-26T02:45:42.99Z" }, + { url = "https://files.pythonhosted.org/packages/e4/fc/6800d0e5b3875568b4083ecf5f310dcf91d86d52573160834fb4bfcf5e4f/multidict-6.7.1-cp314-cp314t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:17307b22c217b4cf05033dabefe68255a534d637c6c9b0cc8382718f87be4262", size = 239358, upload-time = "2026-01-26T02:45:44.376Z" }, + { url = "https://files.pythonhosted.org/packages/41/75/4ad0973179361cdf3a113905e6e088173198349131be2b390f9fa4da5fc6/multidict-6.7.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:7a7e590ff876a3eaf1c02a4dfe0724b6e69a9e9de6d8f556816f29c496046e59", size = 246884, upload-time = "2026-01-26T02:45:47.167Z" }, + { url = "https://files.pythonhosted.org/packages/c3/9c/095bb28b5da139bd41fb9a5d5caff412584f377914bd8787c2aa98717130/multidict-6.7.1-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:5fa6a95dfee63893d80a34758cd0e0c118a30b8dcb46372bf75106c591b77889", size = 225878, upload-time = "2026-01-26T02:45:48.698Z" }, + { url = "https://files.pythonhosted.org/packages/07/d0/c0a72000243756e8f5a277b6b514fa005f2c73d481b7d9e47cd4568aa2e4/multidict-6.7.1-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:a0543217a6a017692aa6ae5cc39adb75e587af0f3a82288b1492eb73dd6cc2a4", size = 253542, upload-time = "2026-01-26T02:45:50.164Z" }, + { url = "https://files.pythonhosted.org/packages/c0/6b/f69da15289e384ecf2a68837ec8b5ad8c33e973aa18b266f50fe55f24b8c/multidict-6.7.1-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:f99fe611c312b3c1c0ace793f92464d8cd263cc3b26b5721950d977b006b6c4d", size = 252403, upload-time = "2026-01-26T02:45:51.779Z" }, + { url = "https://files.pythonhosted.org/packages/a2/76/b9669547afa5a1a25cd93eaca91c0da1c095b06b6d2d8ec25b713588d3a1/multidict-6.7.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9004d8386d133b7e6135679424c91b0b854d2d164af6ea3f289f8f2761064609", size = 244889, upload-time = "2026-01-26T02:45:53.27Z" }, + { url = "https://files.pythonhosted.org/packages/7e/a9/a50d2669e506dad33cfc45b5d574a205587b7b8a5f426f2fbb2e90882588/multidict-6.7.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:e628ef0e6859ffd8273c69412a2465c4be4a9517d07261b33334b5ec6f3c7489", size = 241982, upload-time = "2026-01-26T02:45:54.919Z" }, + { url = "https://files.pythonhosted.org/packages/c5/bb/1609558ad8b456b4827d3c5a5b775c93b87878fd3117ed3db3423dfbce1b/multidict-6.7.1-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:841189848ba629c3552035a6a7f5bf3b02eb304e9fea7492ca220a8eda6b0e5c", size = 232415, upload-time = "2026-01-26T02:45:56.981Z" }, + { url = "https://files.pythonhosted.org/packages/d8/59/6f61039d2aa9261871e03ab9dc058a550d240f25859b05b67fd70f80d4b3/multidict-6.7.1-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:ce1bbd7d780bb5a0da032e095c951f7014d6b0a205f8318308140f1a6aba159e", size = 240337, upload-time = "2026-01-26T02:45:58.698Z" }, + { url = "https://files.pythonhosted.org/packages/a1/29/fdc6a43c203890dc2ae9249971ecd0c41deaedfe00d25cb6564b2edd99eb/multidict-6.7.1-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:b26684587228afed0d50cf804cc71062cc9c1cdf55051c4c6345d372947b268c", size = 248788, upload-time = "2026-01-26T02:46:00.862Z" }, + { url = "https://files.pythonhosted.org/packages/a9/14/a153a06101323e4cf086ecee3faadba52ff71633d471f9685c42e3736163/multidict-6.7.1-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:9f9af11306994335398293f9958071019e3ab95e9a707dc1383a35613f6abcb9", size = 242842, upload-time = "2026-01-26T02:46:02.824Z" }, + { url = "https://files.pythonhosted.org/packages/41/5f/604ae839e64a4a6efc80db94465348d3b328ee955e37acb24badbcd24d83/multidict-6.7.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:b4938326284c4f1224178a560987b6cf8b4d38458b113d9b8c1db1a836e640a2", size = 240237, upload-time = "2026-01-26T02:46:05.898Z" }, + { url = "https://files.pythonhosted.org/packages/5f/60/c3a5187bf66f6fb546ff4ab8fb5a077cbdd832d7b1908d4365c7f74a1917/multidict-6.7.1-cp314-cp314t-win32.whl", hash = "sha256:98655c737850c064a65e006a3df7c997cd3b220be4ec8fe26215760b9697d4d7", size = 48008, upload-time = "2026-01-26T02:46:07.468Z" }, + { url = "https://files.pythonhosted.org/packages/0c/f7/addf1087b860ac60e6f382240f64fb99f8bfb532bb06f7c542b83c29ca61/multidict-6.7.1-cp314-cp314t-win_amd64.whl", hash = "sha256:497bde6223c212ba11d462853cfa4f0ae6ef97465033e7dc9940cdb3ab5b48e5", size = 53542, upload-time = "2026-01-26T02:46:08.809Z" }, + { url = "https://files.pythonhosted.org/packages/4c/81/4629d0aa32302ef7b2ec65c75a728cc5ff4fa410c50096174c1632e70b3e/multidict-6.7.1-cp314-cp314t-win_arm64.whl", hash = "sha256:2bbd113e0d4af5db41d5ebfe9ccaff89de2120578164f86a5d17d5a576d1e5b2", size = 44719, upload-time = "2026-01-26T02:46:11.146Z" }, + { url = "https://files.pythonhosted.org/packages/81/08/7036c080d7117f28a4af526d794aab6a84463126db031b007717c1a6676e/multidict-6.7.1-py3-none-any.whl", hash = "sha256:55d97cc6dae627efa6a6e548885712d4864b81110ac76fa4e534c03819fa4a56", size = 12319, upload-time = "2026-01-26T02:46:44.004Z" }, +] + +[[package]] +name = "multiprocess" +version = "0.70.19" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "dill" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/a2/f2/e783ac7f2aeeed14e9e12801f22529cc7e6b7ab80928d6dcce4e9f00922d/multiprocess-0.70.19.tar.gz", hash = "sha256:952021e0e6c55a4a9fe4cd787895b86e239a40e76802a789d6305398d3975897", size = 2079989, upload-time = "2026-01-19T06:47:39.744Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e3/45/8004d1e6b9185c1a444d6b55ac5682acf9d98035e54386d967366035a03a/multiprocess-0.70.19-py310-none-any.whl", hash = "sha256:97404393419dcb2a8385910864eedf47a3cadf82c66345b44f036420eb0b5d87", size = 134948, upload-time = "2026-01-19T06:47:32.325Z" }, + { url = "https://files.pythonhosted.org/packages/86/c2/dec9722dc3474c164a0b6bcd9a7ed7da542c98af8cabce05374abab35edd/multiprocess-0.70.19-py311-none-any.whl", hash = "sha256:928851ae7973aea4ce0eaf330bbdafb2e01398a91518d5c8818802845564f45c", size = 144457, upload-time = "2026-01-19T06:47:33.711Z" }, + { url = "https://files.pythonhosted.org/packages/71/70/38998b950a97ea279e6bd657575d22d1a2047256caf707d9a10fbce4f065/multiprocess-0.70.19-py312-none-any.whl", hash = "sha256:3a56c0e85dd5025161bac5ce138dcac1e49174c7d8e74596537e729fd5c53c28", size = 150281, upload-time = "2026-01-19T06:47:35.037Z" }, + { url = "https://files.pythonhosted.org/packages/7f/74/d2c27e03cb84251dfe7249b8e82923643c6d48fa4883b9476b025e7dc7eb/multiprocess-0.70.19-py313-none-any.whl", hash = "sha256:8d5eb4ec5017ba2fab4e34a747c6d2c2b6fecfe9e7236e77988db91580ada952", size = 156414, upload-time = "2026-01-19T06:47:35.915Z" }, + { url = "https://files.pythonhosted.org/packages/a0/61/af9115673a5870fd885247e2f1b68c4f1197737da315b520a91c757a861a/multiprocess-0.70.19-py314-none-any.whl", hash = "sha256:e8cc7fbdff15c0613f0a1f1f8744bef961b0a164c0ca29bdff53e9d2d93c5e5f", size = 160318, upload-time = "2026-01-19T06:47:37.497Z" }, + { url = "https://files.pythonhosted.org/packages/7e/82/69e539c4c2027f1e1697e09aaa2449243085a0edf81ae2c6341e84d769b6/multiprocess-0.70.19-py39-none-any.whl", hash = "sha256:0d4b4397ed669d371c81dcd1ef33fd384a44d6c3de1bd0ca7ac06d837720d3c5", size = 133477, upload-time = "2026-01-19T06:47:38.619Z" }, +] + +[[package]] +name = "mypy-extensions" +version = "1.1.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/a2/6e/371856a3fb9d31ca8dac321cda606860fa4548858c0cc45d9d1d4ca2628b/mypy_extensions-1.1.0.tar.gz", hash = "sha256:52e68efc3284861e772bbcd66823fde5ae21fd2fdb51c62a211403730b916558", size = 6343, upload-time = "2025-04-22T14:54:24.164Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/79/7b/2c79738432f5c924bef5071f933bcc9efd0473bac3b4aa584a6f7c1c8df8/mypy_extensions-1.1.0-py3-none-any.whl", hash = "sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505", size = 4963, upload-time = "2025-04-22T14:54:22.983Z" }, +] + +[[package]] +name = "networkx" +version = "3.6.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/6a/51/63fe664f3908c97be9d2e4f1158eb633317598cfa6e1fc14af5383f17512/networkx-3.6.1.tar.gz", hash = "sha256:26b7c357accc0c8cde558ad486283728b65b6a95d85ee1cd66bafab4c8168509", size = 2517025, upload-time = "2025-12-08T17:02:39.908Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/9e/c9/b2622292ea83fbb4ec318f5b9ab867d0a28ab43c5717bb85b0a5f6b3b0a4/networkx-3.6.1-py3-none-any.whl", hash = "sha256:d47fbf302e7d9cbbb9e2555a0d267983d2aa476bac30e90dfbe5669bd57f3762", size = 2068504, upload-time = "2025-12-08T17:02:38.159Z" }, +] + +[[package]] +name = "nodeenv" +version = "1.10.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/24/bf/d1bda4f6168e0b2e9e5958945e01910052158313224ada5ce1fb2e1113b8/nodeenv-1.10.0.tar.gz", hash = "sha256:996c191ad80897d076bdfba80a41994c2b47c68e224c542b48feba42ba00f8bb", size = 55611, upload-time = "2025-12-20T14:08:54.006Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/b2/d0896bdcdc8d28a7fc5717c305f1a861c26e18c05047949fb371034d98bd/nodeenv-1.10.0-py2.py3-none-any.whl", hash = "sha256:5bb13e3eed2923615535339b3c620e76779af4cb4c6a90deccc9e36b274d3827", size = 23438, upload-time = "2025-12-20T14:08:52.782Z" }, +] + +[[package]] +name = "numpy" +version = "2.2.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/76/21/7d2a95e4bba9dc13d043ee156a356c0a8f0c6309dff6b21b4d71a073b8a8/numpy-2.2.6.tar.gz", hash = "sha256:e29554e2bef54a90aa5cc07da6ce955accb83f21ab5de01a62c8478897b264fd", size = 20276440, upload-time = "2025-05-17T22:38:04.611Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/82/5d/c00588b6cf18e1da539b45d3598d3557084990dcc4331960c15ee776ee41/numpy-2.2.6-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:41c5a21f4a04fa86436124d388f6ed60a9343a6f767fced1a8a71c3fbca038ff", size = 20875348, upload-time = "2025-05-17T21:34:39.648Z" }, + { url = "https://files.pythonhosted.org/packages/66/ee/560deadcdde6c2f90200450d5938f63a34b37e27ebff162810f716f6a230/numpy-2.2.6-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:de749064336d37e340f640b05f24e9e3dd678c57318c7289d222a8a2f543e90c", size = 14119362, upload-time = "2025-05-17T21:35:01.241Z" }, + { url = "https://files.pythonhosted.org/packages/3c/65/4baa99f1c53b30adf0acd9a5519078871ddde8d2339dc5a7fde80d9d87da/numpy-2.2.6-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:894b3a42502226a1cac872f840030665f33326fc3dac8e57c607905773cdcde3", size = 5084103, upload-time = "2025-05-17T21:35:10.622Z" }, + { url = "https://files.pythonhosted.org/packages/cc/89/e5a34c071a0570cc40c9a54eb472d113eea6d002e9ae12bb3a8407fb912e/numpy-2.2.6-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:71594f7c51a18e728451bb50cc60a3ce4e6538822731b2933209a1f3614e9282", size = 6625382, upload-time = "2025-05-17T21:35:21.414Z" }, + { url = "https://files.pythonhosted.org/packages/f8/35/8c80729f1ff76b3921d5c9487c7ac3de9b2a103b1cd05e905b3090513510/numpy-2.2.6-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f2618db89be1b4e05f7a1a847a9c1c0abd63e63a1607d892dd54668dd92faf87", size = 14018462, upload-time = "2025-05-17T21:35:42.174Z" }, + { url = "https://files.pythonhosted.org/packages/8c/3d/1e1db36cfd41f895d266b103df00ca5b3cbe965184df824dec5c08c6b803/numpy-2.2.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fd83c01228a688733f1ded5201c678f0c53ecc1006ffbc404db9f7a899ac6249", size = 16527618, upload-time = "2025-05-17T21:36:06.711Z" }, + { url = "https://files.pythonhosted.org/packages/61/c6/03ed30992602c85aa3cd95b9070a514f8b3c33e31124694438d88809ae36/numpy-2.2.6-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:37c0ca431f82cd5fa716eca9506aefcabc247fb27ba69c5062a6d3ade8cf8f49", size = 15505511, upload-time = "2025-05-17T21:36:29.965Z" }, + { url = "https://files.pythonhosted.org/packages/b7/25/5761d832a81df431e260719ec45de696414266613c9ee268394dd5ad8236/numpy-2.2.6-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:fe27749d33bb772c80dcd84ae7e8df2adc920ae8297400dabec45f0dedb3f6de", size = 18313783, upload-time = "2025-05-17T21:36:56.883Z" }, + { url = "https://files.pythonhosted.org/packages/57/0a/72d5a3527c5ebffcd47bde9162c39fae1f90138c961e5296491ce778e682/numpy-2.2.6-cp312-cp312-win32.whl", hash = "sha256:4eeaae00d789f66c7a25ac5f34b71a7035bb474e679f410e5e1a94deb24cf2d4", size = 6246506, upload-time = "2025-05-17T21:37:07.368Z" }, + { url = "https://files.pythonhosted.org/packages/36/fa/8c9210162ca1b88529ab76b41ba02d433fd54fecaf6feb70ef9f124683f1/numpy-2.2.6-cp312-cp312-win_amd64.whl", hash = "sha256:c1f9540be57940698ed329904db803cf7a402f3fc200bfe599334c9bd84a40b2", size = 12614190, upload-time = "2025-05-17T21:37:26.213Z" }, + { url = "https://files.pythonhosted.org/packages/f9/5c/6657823f4f594f72b5471f1db1ab12e26e890bb2e41897522d134d2a3e81/numpy-2.2.6-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:0811bb762109d9708cca4d0b13c4f67146e3c3b7cf8d34018c722adb2d957c84", size = 20867828, upload-time = "2025-05-17T21:37:56.699Z" }, + { url = "https://files.pythonhosted.org/packages/dc/9e/14520dc3dadf3c803473bd07e9b2bd1b69bc583cb2497b47000fed2fa92f/numpy-2.2.6-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:287cc3162b6f01463ccd86be154f284d0893d2b3ed7292439ea97eafa8170e0b", size = 14143006, upload-time = "2025-05-17T21:38:18.291Z" }, + { url = "https://files.pythonhosted.org/packages/4f/06/7e96c57d90bebdce9918412087fc22ca9851cceaf5567a45c1f404480e9e/numpy-2.2.6-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:f1372f041402e37e5e633e586f62aa53de2eac8d98cbfb822806ce4bbefcb74d", size = 5076765, upload-time = "2025-05-17T21:38:27.319Z" }, + { url = "https://files.pythonhosted.org/packages/73/ed/63d920c23b4289fdac96ddbdd6132e9427790977d5457cd132f18e76eae0/numpy-2.2.6-cp313-cp313-macosx_14_0_x86_64.whl", hash = "sha256:55a4d33fa519660d69614a9fad433be87e5252f4b03850642f88993f7b2ca566", size = 6617736, upload-time = "2025-05-17T21:38:38.141Z" }, + { url = "https://files.pythonhosted.org/packages/85/c5/e19c8f99d83fd377ec8c7e0cf627a8049746da54afc24ef0a0cb73d5dfb5/numpy-2.2.6-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f92729c95468a2f4f15e9bb94c432a9229d0d50de67304399627a943201baa2f", size = 14010719, upload-time = "2025-05-17T21:38:58.433Z" }, + { url = "https://files.pythonhosted.org/packages/19/49/4df9123aafa7b539317bf6d342cb6d227e49f7a35b99c287a6109b13dd93/numpy-2.2.6-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1bc23a79bfabc5d056d106f9befb8d50c31ced2fbc70eedb8155aec74a45798f", size = 16526072, upload-time = "2025-05-17T21:39:22.638Z" }, + { url = "https://files.pythonhosted.org/packages/b2/6c/04b5f47f4f32f7c2b0e7260442a8cbcf8168b0e1a41ff1495da42f42a14f/numpy-2.2.6-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:e3143e4451880bed956e706a3220b4e5cf6172ef05fcc397f6f36a550b1dd868", size = 15503213, upload-time = "2025-05-17T21:39:45.865Z" }, + { url = "https://files.pythonhosted.org/packages/17/0a/5cd92e352c1307640d5b6fec1b2ffb06cd0dabe7d7b8227f97933d378422/numpy-2.2.6-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:b4f13750ce79751586ae2eb824ba7e1e8dba64784086c98cdbbcc6a42112ce0d", size = 18316632, upload-time = "2025-05-17T21:40:13.331Z" }, + { url = "https://files.pythonhosted.org/packages/f0/3b/5cba2b1d88760ef86596ad0f3d484b1cbff7c115ae2429678465057c5155/numpy-2.2.6-cp313-cp313-win32.whl", hash = "sha256:5beb72339d9d4fa36522fc63802f469b13cdbe4fdab4a288f0c441b74272ebfd", size = 6244532, upload-time = "2025-05-17T21:43:46.099Z" }, + { url = "https://files.pythonhosted.org/packages/cb/3b/d58c12eafcb298d4e6d0d40216866ab15f59e55d148a5658bb3132311fcf/numpy-2.2.6-cp313-cp313-win_amd64.whl", hash = "sha256:b0544343a702fa80c95ad5d3d608ea3599dd54d4632df855e4c8d24eb6ecfa1c", size = 12610885, upload-time = "2025-05-17T21:44:05.145Z" }, + { url = "https://files.pythonhosted.org/packages/6b/9e/4bf918b818e516322db999ac25d00c75788ddfd2d2ade4fa66f1f38097e1/numpy-2.2.6-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:0bca768cd85ae743b2affdc762d617eddf3bcf8724435498a1e80132d04879e6", size = 20963467, upload-time = "2025-05-17T21:40:44Z" }, + { url = "https://files.pythonhosted.org/packages/61/66/d2de6b291507517ff2e438e13ff7b1e2cdbdb7cb40b3ed475377aece69f9/numpy-2.2.6-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:fc0c5673685c508a142ca65209b4e79ed6740a4ed6b2267dbba90f34b0b3cfda", size = 14225144, upload-time = "2025-05-17T21:41:05.695Z" }, + { url = "https://files.pythonhosted.org/packages/e4/25/480387655407ead912e28ba3a820bc69af9adf13bcbe40b299d454ec011f/numpy-2.2.6-cp313-cp313t-macosx_14_0_arm64.whl", hash = "sha256:5bd4fc3ac8926b3819797a7c0e2631eb889b4118a9898c84f585a54d475b7e40", size = 5200217, upload-time = "2025-05-17T21:41:15.903Z" }, + { url = "https://files.pythonhosted.org/packages/aa/4a/6e313b5108f53dcbf3aca0c0f3e9c92f4c10ce57a0a721851f9785872895/numpy-2.2.6-cp313-cp313t-macosx_14_0_x86_64.whl", hash = "sha256:fee4236c876c4e8369388054d02d0e9bb84821feb1a64dd59e137e6511a551f8", size = 6712014, upload-time = "2025-05-17T21:41:27.321Z" }, + { url = "https://files.pythonhosted.org/packages/b7/30/172c2d5c4be71fdf476e9de553443cf8e25feddbe185e0bd88b096915bcc/numpy-2.2.6-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e1dda9c7e08dc141e0247a5b8f49cf05984955246a327d4c48bda16821947b2f", size = 14077935, upload-time = "2025-05-17T21:41:49.738Z" }, + { url = "https://files.pythonhosted.org/packages/12/fb/9e743f8d4e4d3c710902cf87af3512082ae3d43b945d5d16563f26ec251d/numpy-2.2.6-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f447e6acb680fd307f40d3da4852208af94afdfab89cf850986c3ca00562f4fa", size = 16600122, upload-time = "2025-05-17T21:42:14.046Z" }, + { url = "https://files.pythonhosted.org/packages/12/75/ee20da0e58d3a66f204f38916757e01e33a9737d0b22373b3eb5a27358f9/numpy-2.2.6-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:389d771b1623ec92636b0786bc4ae56abafad4a4c513d36a55dce14bd9ce8571", size = 15586143, upload-time = "2025-05-17T21:42:37.464Z" }, + { url = "https://files.pythonhosted.org/packages/76/95/bef5b37f29fc5e739947e9ce5179ad402875633308504a52d188302319c8/numpy-2.2.6-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:8e9ace4a37db23421249ed236fdcdd457d671e25146786dfc96835cd951aa7c1", size = 18385260, upload-time = "2025-05-17T21:43:05.189Z" }, + { url = "https://files.pythonhosted.org/packages/09/04/f2f83279d287407cf36a7a8053a5abe7be3622a4363337338f2585e4afda/numpy-2.2.6-cp313-cp313t-win32.whl", hash = "sha256:038613e9fb8c72b0a41f025a7e4c3f0b7a1b5d768ece4796b674c8f3fe13efff", size = 6377225, upload-time = "2025-05-17T21:43:16.254Z" }, + { url = "https://files.pythonhosted.org/packages/67/0e/35082d13c09c02c011cf21570543d202ad929d961c02a147493cb0c2bdf5/numpy-2.2.6-cp313-cp313t-win_amd64.whl", hash = "sha256:6031dd6dfecc0cf9f668681a37648373bddd6421fff6c66ec1624eed0180ee06", size = 12771374, upload-time = "2025-05-17T21:43:35.479Z" }, +] + +[[package]] +name = "nvidia-cublas-cu12" +version = "12.8.4.1" +source = { registry = "https://pypi.org/simple" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/dc/61/e24b560ab2e2eaeb3c839129175fb330dfcfc29e5203196e5541a4c44682/nvidia_cublas_cu12-12.8.4.1-py3-none-manylinux_2_27_x86_64.whl", hash = "sha256:8ac4e771d5a348c551b2a426eda6193c19aa630236b418086020df5ba9667142", size = 594346921, upload-time = "2025-03-07T01:44:31.254Z" }, +] + +[[package]] +name = "nvidia-cuda-cupti-cu12" +version = "12.8.90" +source = { registry = "https://pypi.org/simple" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/f8/02/2adcaa145158bf1a8295d83591d22e4103dbfd821bcaf6f3f53151ca4ffa/nvidia_cuda_cupti_cu12-12.8.90-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:ea0cb07ebda26bb9b29ba82cda34849e73c166c18162d3913575b0c9db9a6182", size = 10248621, upload-time = "2025-03-07T01:40:21.213Z" }, +] + +[[package]] +name = "nvidia-cuda-nvrtc-cu12" +version = "12.8.93" +source = { registry = "https://pypi.org/simple" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/05/6b/32f747947df2da6994e999492ab306a903659555dddc0fbdeb9d71f75e52/nvidia_cuda_nvrtc_cu12-12.8.93-py3-none-manylinux2010_x86_64.manylinux_2_12_x86_64.whl", hash = "sha256:a7756528852ef889772a84c6cd89d41dfa74667e24cca16bb31f8f061e3e9994", size = 88040029, upload-time = "2025-03-07T01:42:13.562Z" }, +] + +[[package]] +name = "nvidia-cuda-runtime-cu12" +version = "12.8.90" +source = { registry = "https://pypi.org/simple" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0d/9b/a997b638fcd068ad6e4d53b8551a7d30fe8b404d6f1804abf1df69838932/nvidia_cuda_runtime_cu12-12.8.90-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:adade8dcbd0edf427b7204d480d6066d33902cab2a4707dcfc48a2d0fd44ab90", size = 954765, upload-time = "2025-03-07T01:40:01.615Z" }, +] + +[[package]] +name = "nvidia-cudnn-cu12" +version = "9.10.2.21" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "nvidia-cublas-cu12", marker = "sys_platform == 'linux'" }, +] +wheels = [ + { url = "https://files.pythonhosted.org/packages/ba/51/e123d997aa098c61d029f76663dedbfb9bc8dcf8c60cbd6adbe42f76d049/nvidia_cudnn_cu12-9.10.2.21-py3-none-manylinux_2_27_x86_64.whl", hash = "sha256:949452be657fa16687d0930933f032835951ef0892b37d2d53824d1a84dc97a8", size = 706758467, upload-time = "2025-06-06T21:54:08.597Z" }, +] + +[[package]] +name = "nvidia-cufft-cu12" +version = "11.3.3.83" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "nvidia-nvjitlink-cu12", marker = "sys_platform == 'linux'" }, +] +wheels = [ + { url = "https://files.pythonhosted.org/packages/1f/13/ee4e00f30e676b66ae65b4f08cb5bcbb8392c03f54f2d5413ea99a5d1c80/nvidia_cufft_cu12-11.3.3.83-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:4d2dd21ec0b88cf61b62e6b43564355e5222e4a3fb394cac0db101f2dd0d4f74", size = 193118695, upload-time = "2025-03-07T01:45:27.821Z" }, +] + +[[package]] +name = "nvidia-cufile-cu12" +version = "1.13.1.3" +source = { registry = "https://pypi.org/simple" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/bb/fe/1bcba1dfbfb8d01be8d93f07bfc502c93fa23afa6fd5ab3fc7c1df71038a/nvidia_cufile_cu12-1.13.1.3-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:1d069003be650e131b21c932ec3d8969c1715379251f8d23a1860554b1cb24fc", size = 1197834, upload-time = "2025-03-07T01:45:50.723Z" }, +] + +[[package]] +name = "nvidia-curand-cu12" +version = "10.3.9.90" +source = { registry = "https://pypi.org/simple" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/fb/aa/6584b56dc84ebe9cf93226a5cde4d99080c8e90ab40f0c27bda7a0f29aa1/nvidia_curand_cu12-10.3.9.90-py3-none-manylinux_2_27_x86_64.whl", hash = "sha256:b32331d4f4df5d6eefa0554c565b626c7216f87a06a4f56fab27c3b68a830ec9", size = 63619976, upload-time = "2025-03-07T01:46:23.323Z" }, +] + +[[package]] +name = "nvidia-cusolver-cu12" +version = "11.7.3.90" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "nvidia-cublas-cu12", marker = "sys_platform == 'linux'" }, + { name = "nvidia-cusparse-cu12", marker = "sys_platform == 'linux'" }, + { name = "nvidia-nvjitlink-cu12", marker = "sys_platform == 'linux'" }, +] +wheels = [ + { url = "https://files.pythonhosted.org/packages/85/48/9a13d2975803e8cf2777d5ed57b87a0b6ca2cc795f9a4f59796a910bfb80/nvidia_cusolver_cu12-11.7.3.90-py3-none-manylinux_2_27_x86_64.whl", hash = "sha256:4376c11ad263152bd50ea295c05370360776f8c3427b30991df774f9fb26c450", size = 267506905, upload-time = "2025-03-07T01:47:16.273Z" }, +] + +[[package]] +name = "nvidia-cusparse-cu12" +version = "12.5.8.93" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "nvidia-nvjitlink-cu12", marker = "sys_platform == 'linux'" }, +] +wheels = [ + { url = "https://files.pythonhosted.org/packages/c2/f5/e1854cb2f2bcd4280c44736c93550cc300ff4b8c95ebe370d0aa7d2b473d/nvidia_cusparse_cu12-12.5.8.93-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:1ec05d76bbbd8b61b06a80e1eaf8cf4959c3d4ce8e711b65ebd0443bb0ebb13b", size = 288216466, upload-time = "2025-03-07T01:48:13.779Z" }, +] + +[[package]] +name = "nvidia-cusparselt-cu12" +version = "0.7.1" +source = { registry = "https://pypi.org/simple" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/56/79/12978b96bd44274fe38b5dde5cfb660b1d114f70a65ef962bcbbed99b549/nvidia_cusparselt_cu12-0.7.1-py3-none-manylinux2014_x86_64.whl", hash = "sha256:f1bb701d6b930d5a7cea44c19ceb973311500847f81b634d802b7b539dc55623", size = 287193691, upload-time = "2025-02-26T00:15:44.104Z" }, +] + +[[package]] +name = "nvidia-nccl-cu12" +version = "2.27.5" +source = { registry = "https://pypi.org/simple" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/6e/89/f7a07dc961b60645dbbf42e80f2bc85ade7feb9a491b11a1e973aa00071f/nvidia_nccl_cu12-2.27.5-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:ad730cf15cb5d25fe849c6e6ca9eb5b76db16a80f13f425ac68d8e2e55624457", size = 322348229, upload-time = "2025-06-26T04:11:28.385Z" }, +] + +[[package]] +name = "nvidia-nvjitlink-cu12" +version = "12.8.93" +source = { registry = "https://pypi.org/simple" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/f6/74/86a07f1d0f42998ca31312f998bd3b9a7eff7f52378f4f270c8679c77fb9/nvidia_nvjitlink_cu12-12.8.93-py3-none-manylinux2010_x86_64.manylinux_2_12_x86_64.whl", hash = "sha256:81ff63371a7ebd6e6451970684f916be2eab07321b73c9d244dc2b4da7f73b88", size = 39254836, upload-time = "2025-03-07T01:49:55.661Z" }, +] + +[[package]] +name = "nvidia-nvshmem-cu12" +version = "3.4.5" +source = { registry = "https://pypi.org/simple" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b5/09/6ea3ea725f82e1e76684f0708bbedd871fc96da89945adeba65c3835a64c/nvidia_nvshmem_cu12-3.4.5-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:042f2500f24c021db8a06c5eec2539027d57460e1c1a762055a6554f72c369bd", size = 139103095, upload-time = "2025-09-06T00:32:31.266Z" }, +] + +[[package]] +name = "nvidia-nvtx-cu12" +version = "12.8.90" +source = { registry = "https://pypi.org/simple" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a2/eb/86626c1bbc2edb86323022371c39aa48df6fd8b0a1647bc274577f72e90b/nvidia_nvtx_cu12-12.8.90-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:5b17e2001cc0d751a5bc2c6ec6d26ad95913324a4adb86788c944f8ce9ba441f", size = 89954, upload-time = "2025-03-07T01:42:44.131Z" }, +] + +[[package]] +name = "opencv-python-headless" +version = "4.13.0.92" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "numpy" }, +] +wheels = [ + { url = "https://files.pythonhosted.org/packages/79/42/2310883be3b8826ac58c3f2787b9358a2d46923d61f88fedf930bc59c60c/opencv_python_headless-4.13.0.92-cp37-abi3-macosx_13_0_arm64.whl", hash = "sha256:1a7d040ac656c11b8c38677cc8cccdc149f98535089dbe5b081e80a4e5903209", size = 46247192, upload-time = "2026-02-05T07:01:35.187Z" }, + { url = "https://files.pythonhosted.org/packages/2d/1e/6f9e38005a6f7f22af785df42a43139d0e20f169eb5787ce8be37ee7fcc9/opencv_python_headless-4.13.0.92-cp37-abi3-macosx_14_0_x86_64.whl", hash = "sha256:3e0a6f0a37994ec6ce5f59e936be21d5d6384a4556f2d2da9c2f9c5dc948394c", size = 32568914, upload-time = "2026-02-05T07:01:51.989Z" }, + { url = "https://files.pythonhosted.org/packages/21/76/9417a6aef9def70e467a5bf560579f816148a4c658b7d525581b356eda9e/opencv_python_headless-4.13.0.92-cp37-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:5c8cfc8e87ed452b5cecb9419473ee5560a989859fe1d10d1ce11ae87b09a2cb", size = 33703709, upload-time = "2026-02-05T10:24:46.469Z" }, + { url = "https://files.pythonhosted.org/packages/92/ce/bd17ff5772938267fd49716e94ca24f616ff4cb1ff4c6be13085108037be/opencv_python_headless-4.13.0.92-cp37-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:0525a3d2c0b46c611e2130b5fdebc94cf404845d8fa64d2f3a3b679572a5bd22", size = 56016764, upload-time = "2026-02-05T10:26:48.904Z" }, + { url = "https://files.pythonhosted.org/packages/8f/b4/b7bcbf7c874665825a8c8e1097e93ea25d1f1d210a3e20d4451d01da30aa/opencv_python_headless-4.13.0.92-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:eb60e36b237b1ebd40a912da5384b348df8ed534f6f644d8e0b4f103e272ba7d", size = 35010236, upload-time = "2026-02-05T10:28:11.031Z" }, + { url = "https://files.pythonhosted.org/packages/4b/33/b5db29a6c00eb8f50708110d8d453747ca125c8b805bc437b289dbdcc057/opencv_python_headless-4.13.0.92-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:0bd48544f77c68b2941392fcdf9bcd2b9cdf00e98cb8c29b2455d194763cf99e", size = 60391106, upload-time = "2026-02-05T10:30:14.236Z" }, + { url = "https://files.pythonhosted.org/packages/fb/c3/52cfea47cd33e53e8c0fbd6e7c800b457245c1fda7d61660b4ffe9596a7f/opencv_python_headless-4.13.0.92-cp37-abi3-win32.whl", hash = "sha256:a7cf08e5b191f4ebb530791acc0825a7986e0d0dee2a3c491184bd8599848a4b", size = 30812232, upload-time = "2026-02-05T07:02:29.594Z" }, + { url = "https://files.pythonhosted.org/packages/4a/90/b338326131ccb2aaa3c2c85d00f41822c0050139a4bfe723cfd95455bd2d/opencv_python_headless-4.13.0.92-cp37-abi3-win_amd64.whl", hash = "sha256:77a82fe35ddcec0f62c15f2ba8a12ecc2ed4207c17b0902c7a3151ae29f37fb6", size = 40070414, upload-time = "2026-02-05T07:02:26.448Z" }, +] + +[[package]] +name = "orderly-set" +version = "5.5.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/4a/88/39c83c35d5e97cc203e9e77a4f93bf87ec89cf6a22ac4818fdcc65d66584/orderly_set-5.5.0.tar.gz", hash = "sha256:e87185c8e4d8afa64e7f8160ee2c542a475b738bc891dc3f58102e654125e6ce", size = 27414, upload-time = "2025-07-10T20:10:55.885Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/12/27/fb8d7338b4d551900fa3e580acbe7a0cf655d940e164cb5c00ec31961094/orderly_set-5.5.0-py3-none-any.whl", hash = "sha256:46f0b801948e98f427b412fcabb831677194c05c3b699b80de260374baa0b1e7", size = 13068, upload-time = "2025-07-10T20:10:54.377Z" }, +] + +[[package]] +name = "packaging" +version = "25.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/a1/d4/1fc4078c65507b51b96ca8f8c3ba19e6a61c8253c72794544580a7b6c24d/packaging-25.0.tar.gz", hash = "sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f", size = 165727, upload-time = "2025-04-19T11:48:59.673Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/20/12/38679034af332785aac8774540895e234f4d07f7545804097de4b666afd8/packaging-25.0-py3-none-any.whl", hash = "sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484", size = 66469, upload-time = "2025-04-19T11:48:57.875Z" }, +] + +[[package]] +name = "pandas" +version = "2.3.3" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "numpy" }, + { name = "python-dateutil" }, + { name = "pytz" }, + { name = "tzdata" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/33/01/d40b85317f86cf08d853a4f495195c73815fdf205eef3993821720274518/pandas-2.3.3.tar.gz", hash = "sha256:e05e1af93b977f7eafa636d043f9f94c7ee3ac81af99c13508215942e64c993b", size = 4495223, upload-time = "2025-09-29T23:34:51.853Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/9c/fb/231d89e8637c808b997d172b18e9d4a4bc7bf31296196c260526055d1ea0/pandas-2.3.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:6d21f6d74eb1725c2efaa71a2bfc661a0689579b58e9c0ca58a739ff0b002b53", size = 11597846, upload-time = "2025-09-29T23:19:48.856Z" }, + { url = "https://files.pythonhosted.org/packages/5c/bd/bf8064d9cfa214294356c2d6702b716d3cf3bb24be59287a6a21e24cae6b/pandas-2.3.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:3fd2f887589c7aa868e02632612ba39acb0b8948faf5cc58f0850e165bd46f35", size = 10729618, upload-time = "2025-09-29T23:39:08.659Z" }, + { url = "https://files.pythonhosted.org/packages/57/56/cf2dbe1a3f5271370669475ead12ce77c61726ffd19a35546e31aa8edf4e/pandas-2.3.3-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ecaf1e12bdc03c86ad4a7ea848d66c685cb6851d807a26aa245ca3d2017a1908", size = 11737212, upload-time = "2025-09-29T23:19:59.765Z" }, + { url = "https://files.pythonhosted.org/packages/e5/63/cd7d615331b328e287d8233ba9fdf191a9c2d11b6af0c7a59cfcec23de68/pandas-2.3.3-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b3d11d2fda7eb164ef27ffc14b4fcab16a80e1ce67e9f57e19ec0afaf715ba89", size = 12362693, upload-time = "2025-09-29T23:20:14.098Z" }, + { url = "https://files.pythonhosted.org/packages/a6/de/8b1895b107277d52f2b42d3a6806e69cfef0d5cf1d0ba343470b9d8e0a04/pandas-2.3.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:a68e15f780eddf2b07d242e17a04aa187a7ee12b40b930bfdd78070556550e98", size = 12771002, upload-time = "2025-09-29T23:20:26.76Z" }, + { url = "https://files.pythonhosted.org/packages/87/21/84072af3187a677c5893b170ba2c8fbe450a6ff911234916da889b698220/pandas-2.3.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:371a4ab48e950033bcf52b6527eccb564f52dc826c02afd9a1bc0ab731bba084", size = 13450971, upload-time = "2025-09-29T23:20:41.344Z" }, + { url = "https://files.pythonhosted.org/packages/86/41/585a168330ff063014880a80d744219dbf1dd7a1c706e75ab3425a987384/pandas-2.3.3-cp312-cp312-win_amd64.whl", hash = "sha256:a16dcec078a01eeef8ee61bf64074b4e524a2a3f4b3be9326420cabe59c4778b", size = 10992722, upload-time = "2025-09-29T23:20:54.139Z" }, + { url = "https://files.pythonhosted.org/packages/cd/4b/18b035ee18f97c1040d94debd8f2e737000ad70ccc8f5513f4eefad75f4b/pandas-2.3.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:56851a737e3470de7fa88e6131f41281ed440d29a9268dcbf0002da5ac366713", size = 11544671, upload-time = "2025-09-29T23:21:05.024Z" }, + { url = "https://files.pythonhosted.org/packages/31/94/72fac03573102779920099bcac1c3b05975c2cb5f01eac609faf34bed1ca/pandas-2.3.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:bdcd9d1167f4885211e401b3036c0c8d9e274eee67ea8d0758a256d60704cfe8", size = 10680807, upload-time = "2025-09-29T23:21:15.979Z" }, + { url = "https://files.pythonhosted.org/packages/16/87/9472cf4a487d848476865321de18cc8c920b8cab98453ab79dbbc98db63a/pandas-2.3.3-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e32e7cc9af0f1cc15548288a51a3b681cc2a219faa838e995f7dc53dbab1062d", size = 11709872, upload-time = "2025-09-29T23:21:27.165Z" }, + { url = "https://files.pythonhosted.org/packages/15/07/284f757f63f8a8d69ed4472bfd85122bd086e637bf4ed09de572d575a693/pandas-2.3.3-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:318d77e0e42a628c04dc56bcef4b40de67918f7041c2b061af1da41dcff670ac", size = 12306371, upload-time = "2025-09-29T23:21:40.532Z" }, + { url = "https://files.pythonhosted.org/packages/33/81/a3afc88fca4aa925804a27d2676d22dcd2031c2ebe08aabd0ae55b9ff282/pandas-2.3.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:4e0a175408804d566144e170d0476b15d78458795bb18f1304fb94160cabf40c", size = 12765333, upload-time = "2025-09-29T23:21:55.77Z" }, + { url = "https://files.pythonhosted.org/packages/8d/0f/b4d4ae743a83742f1153464cf1a8ecfafc3ac59722a0b5c8602310cb7158/pandas-2.3.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:93c2d9ab0fc11822b5eece72ec9587e172f63cff87c00b062f6e37448ced4493", size = 13418120, upload-time = "2025-09-29T23:22:10.109Z" }, + { url = "https://files.pythonhosted.org/packages/4f/c7/e54682c96a895d0c808453269e0b5928a07a127a15704fedb643e9b0a4c8/pandas-2.3.3-cp313-cp313-win_amd64.whl", hash = "sha256:f8bfc0e12dc78f777f323f55c58649591b2cd0c43534e8355c51d3fede5f4dee", size = 10993991, upload-time = "2025-09-29T23:25:04.889Z" }, + { url = "https://files.pythonhosted.org/packages/f9/ca/3f8d4f49740799189e1395812f3bf23b5e8fc7c190827d55a610da72ce55/pandas-2.3.3-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:75ea25f9529fdec2d2e93a42c523962261e567d250b0013b16210e1d40d7c2e5", size = 12048227, upload-time = "2025-09-29T23:22:24.343Z" }, + { url = "https://files.pythonhosted.org/packages/0e/5a/f43efec3e8c0cc92c4663ccad372dbdff72b60bdb56b2749f04aa1d07d7e/pandas-2.3.3-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:74ecdf1d301e812db96a465a525952f4dde225fdb6d8e5a521d47e1f42041e21", size = 11411056, upload-time = "2025-09-29T23:22:37.762Z" }, + { url = "https://files.pythonhosted.org/packages/46/b1/85331edfc591208c9d1a63a06baa67b21d332e63b7a591a5ba42a10bb507/pandas-2.3.3-cp313-cp313t-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6435cb949cb34ec11cc9860246ccb2fdc9ecd742c12d3304989017d53f039a78", size = 11645189, upload-time = "2025-09-29T23:22:51.688Z" }, + { url = "https://files.pythonhosted.org/packages/44/23/78d645adc35d94d1ac4f2a3c4112ab6f5b8999f4898b8cdf01252f8df4a9/pandas-2.3.3-cp313-cp313t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:900f47d8f20860de523a1ac881c4c36d65efcb2eb850e6948140fa781736e110", size = 12121912, upload-time = "2025-09-29T23:23:05.042Z" }, + { url = "https://files.pythonhosted.org/packages/53/da/d10013df5e6aaef6b425aa0c32e1fc1f3e431e4bcabd420517dceadce354/pandas-2.3.3-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:a45c765238e2ed7d7c608fc5bc4a6f88b642f2f01e70c0c23d2224dd21829d86", size = 12712160, upload-time = "2025-09-29T23:23:28.57Z" }, + { url = "https://files.pythonhosted.org/packages/bd/17/e756653095a083d8a37cbd816cb87148debcfcd920129b25f99dd8d04271/pandas-2.3.3-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:c4fc4c21971a1a9f4bdb4c73978c7f7256caa3e62b323f70d6cb80db583350bc", size = 13199233, upload-time = "2025-09-29T23:24:24.876Z" }, + { url = "https://files.pythonhosted.org/packages/04/fd/74903979833db8390b73b3a8a7d30d146d710bd32703724dd9083950386f/pandas-2.3.3-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:ee15f284898e7b246df8087fc82b87b01686f98ee67d85a17b7ab44143a3a9a0", size = 11540635, upload-time = "2025-09-29T23:25:52.486Z" }, + { url = "https://files.pythonhosted.org/packages/21/00/266d6b357ad5e6d3ad55093a7e8efc7dd245f5a842b584db9f30b0f0a287/pandas-2.3.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:1611aedd912e1ff81ff41c745822980c49ce4a7907537be8692c8dbc31924593", size = 10759079, upload-time = "2025-09-29T23:26:33.204Z" }, + { url = "https://files.pythonhosted.org/packages/ca/05/d01ef80a7a3a12b2f8bbf16daba1e17c98a2f039cbc8e2f77a2c5a63d382/pandas-2.3.3-cp314-cp314-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6d2cefc361461662ac48810cb14365a365ce864afe85ef1f447ff5a1e99ea81c", size = 11814049, upload-time = "2025-09-29T23:27:15.384Z" }, + { url = "https://files.pythonhosted.org/packages/15/b2/0e62f78c0c5ba7e3d2c5945a82456f4fac76c480940f805e0b97fcbc2f65/pandas-2.3.3-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ee67acbbf05014ea6c763beb097e03cd629961c8a632075eeb34247120abcb4b", size = 12332638, upload-time = "2025-09-29T23:27:51.625Z" }, + { url = "https://files.pythonhosted.org/packages/c5/33/dd70400631b62b9b29c3c93d2feee1d0964dc2bae2e5ad7a6c73a7f25325/pandas-2.3.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:c46467899aaa4da076d5abc11084634e2d197e9460643dd455ac3db5856b24d6", size = 12886834, upload-time = "2025-09-29T23:28:21.289Z" }, + { url = "https://files.pythonhosted.org/packages/d3/18/b5d48f55821228d0d2692b34fd5034bb185e854bdb592e9c640f6290e012/pandas-2.3.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:6253c72c6a1d990a410bc7de641d34053364ef8bcd3126f7e7450125887dffe3", size = 13409925, upload-time = "2025-09-29T23:28:58.261Z" }, + { url = "https://files.pythonhosted.org/packages/a6/3d/124ac75fcd0ecc09b8fdccb0246ef65e35b012030defb0e0eba2cbbbe948/pandas-2.3.3-cp314-cp314-win_amd64.whl", hash = "sha256:1b07204a219b3b7350abaae088f451860223a52cfb8a6c53358e7948735158e5", size = 11109071, upload-time = "2025-09-29T23:32:27.484Z" }, + { url = "https://files.pythonhosted.org/packages/89/9c/0e21c895c38a157e0faa1fb64587a9226d6dd46452cac4532d80c3c4a244/pandas-2.3.3-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:2462b1a365b6109d275250baaae7b760fd25c726aaca0054649286bcfbb3e8ec", size = 12048504, upload-time = "2025-09-29T23:29:31.47Z" }, + { url = "https://files.pythonhosted.org/packages/d7/82/b69a1c95df796858777b68fbe6a81d37443a33319761d7c652ce77797475/pandas-2.3.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:0242fe9a49aa8b4d78a4fa03acb397a58833ef6199e9aa40a95f027bb3a1b6e7", size = 11410702, upload-time = "2025-09-29T23:29:54.591Z" }, + { url = "https://files.pythonhosted.org/packages/f9/88/702bde3ba0a94b8c73a0181e05144b10f13f29ebfc2150c3a79062a8195d/pandas-2.3.3-cp314-cp314t-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a21d830e78df0a515db2b3d2f5570610f5e6bd2e27749770e8bb7b524b89b450", size = 11634535, upload-time = "2025-09-29T23:30:21.003Z" }, + { url = "https://files.pythonhosted.org/packages/a4/1e/1bac1a839d12e6a82ec6cb40cda2edde64a2013a66963293696bbf31fbbb/pandas-2.3.3-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2e3ebdb170b5ef78f19bfb71b0dc5dc58775032361fa188e814959b74d726dd5", size = 12121582, upload-time = "2025-09-29T23:30:43.391Z" }, + { url = "https://files.pythonhosted.org/packages/44/91/483de934193e12a3b1d6ae7c8645d083ff88dec75f46e827562f1e4b4da6/pandas-2.3.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:d051c0e065b94b7a3cea50eb1ec32e912cd96dba41647eb24104b6c6c14c5788", size = 12699963, upload-time = "2025-09-29T23:31:10.009Z" }, + { url = "https://files.pythonhosted.org/packages/70/44/5191d2e4026f86a2a109053e194d3ba7a31a2d10a9c2348368c63ed4e85a/pandas-2.3.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:3869faf4bd07b3b66a9f462417d0ca3a9df29a9f6abd5d0d0dbab15dac7abe87", size = 13202175, upload-time = "2025-09-29T23:31:59.173Z" }, +] + +[[package]] +name = "pillow" +version = "12.2.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/8c/21/c2bcdd5906101a30244eaffc1b6e6ce71a31bd0742a01eb89e660ebfac2d/pillow-12.2.0.tar.gz", hash = "sha256:a830b1a40919539d07806aa58e1b114df53ddd43213d9c8b75847eee6c0182b5", size = 46987819, upload-time = "2026-04-01T14:46:17.687Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/58/be/7482c8a5ebebbc6470b3eb791812fff7d5e0216c2be3827b30b8bb6603ed/pillow-12.2.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:2d192a155bbcec180f8564f693e6fd9bccff5a7af9b32e2e4bf8c9c69dbad6b5", size = 5308279, upload-time = "2026-04-01T14:43:13.246Z" }, + { url = "https://files.pythonhosted.org/packages/d8/95/0a351b9289c2b5cbde0bacd4a83ebc44023e835490a727b2a3bd60ddc0f4/pillow-12.2.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f3f40b3c5a968281fd507d519e444c35f0ff171237f4fdde090dd60699458421", size = 4695490, upload-time = "2026-04-01T14:43:15.584Z" }, + { url = "https://files.pythonhosted.org/packages/de/af/4e8e6869cbed569d43c416fad3dc4ecb944cb5d9492defaed89ddd6fe871/pillow-12.2.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:03e7e372d5240cc23e9f07deca4d775c0817bffc641b01e9c3af208dbd300987", size = 6284462, upload-time = "2026-04-01T14:43:18.268Z" }, + { url = "https://files.pythonhosted.org/packages/e9/9e/c05e19657fd57841e476be1ab46c4d501bffbadbafdc31a6d665f8b737b6/pillow-12.2.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:b86024e52a1b269467a802258c25521e6d742349d760728092e1bc2d135b4d76", size = 8094744, upload-time = "2026-04-01T14:43:20.716Z" }, + { url = "https://files.pythonhosted.org/packages/2b/54/1789c455ed10176066b6e7e6da1b01e50e36f94ba584dc68d9eebfe9156d/pillow-12.2.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:7371b48c4fa448d20d2714c9a1f775a81155050d383333e0a6c15b1123dda005", size = 6398371, upload-time = "2026-04-01T14:43:23.443Z" }, + { url = "https://files.pythonhosted.org/packages/43/e3/fdc657359e919462369869f1c9f0e973f353f9a9ee295a39b1fea8ee1a77/pillow-12.2.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:62f5409336adb0663b7caa0da5c7d9e7bdbaae9ce761d34669420c2a801b2780", size = 7087215, upload-time = "2026-04-01T14:43:26.758Z" }, + { url = "https://files.pythonhosted.org/packages/8b/f8/2f6825e441d5b1959d2ca5adec984210f1ec086435b0ed5f52c19b3b8a6e/pillow-12.2.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:01afa7cf67f74f09523699b4e88c73fb55c13346d212a59a2db1f86b0a63e8c5", size = 6509783, upload-time = "2026-04-01T14:43:29.56Z" }, + { url = "https://files.pythonhosted.org/packages/67/f9/029a27095ad20f854f9dba026b3ea6428548316e057e6fc3545409e86651/pillow-12.2.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:fc3d34d4a8fbec3e88a79b92e5465e0f9b842b628675850d860b8bd300b159f5", size = 7212112, upload-time = "2026-04-01T14:43:32.091Z" }, + { url = "https://files.pythonhosted.org/packages/be/42/025cfe05d1be22dbfdb4f264fe9de1ccda83f66e4fc3aac94748e784af04/pillow-12.2.0-cp312-cp312-win32.whl", hash = "sha256:58f62cc0f00fd29e64b29f4fd923ffdb3859c9f9e6105bfc37ba1d08994e8940", size = 6378489, upload-time = "2026-04-01T14:43:34.601Z" }, + { url = "https://files.pythonhosted.org/packages/5d/7b/25a221d2c761c6a8ae21bfa3874988ff2583e19cf8a27bf2fee358df7942/pillow-12.2.0-cp312-cp312-win_amd64.whl", hash = "sha256:7f84204dee22a783350679a0333981df803dac21a0190d706a50475e361c93f5", size = 7084129, upload-time = "2026-04-01T14:43:37.213Z" }, + { url = "https://files.pythonhosted.org/packages/10/e1/542a474affab20fd4a0f1836cb234e8493519da6b76899e30bcc5d990b8b/pillow-12.2.0-cp312-cp312-win_arm64.whl", hash = "sha256:af73337013e0b3b46f175e79492d96845b16126ddf79c438d7ea7ff27783a414", size = 2463612, upload-time = "2026-04-01T14:43:39.421Z" }, + { url = "https://files.pythonhosted.org/packages/4a/01/53d10cf0dbad820a8db274d259a37ba50b88b24768ddccec07355382d5ad/pillow-12.2.0-cp313-cp313-ios_13_0_arm64_iphoneos.whl", hash = "sha256:8297651f5b5679c19968abefd6bb84d95fe30ef712eb1b2d9b2d31ca61267f4c", size = 4100837, upload-time = "2026-04-01T14:43:41.506Z" }, + { url = "https://files.pythonhosted.org/packages/0f/98/f3a6657ecb698c937f6c76ee564882945f29b79bad496abcba0e84659ec5/pillow-12.2.0-cp313-cp313-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:50d8520da2a6ce0af445fa6d648c4273c3eeefbc32d7ce049f22e8b5c3daecc2", size = 4176528, upload-time = "2026-04-01T14:43:43.773Z" }, + { url = "https://files.pythonhosted.org/packages/69/bc/8986948f05e3ea490b8442ea1c1d4d990b24a7e43d8a51b2c7d8b1dced36/pillow-12.2.0-cp313-cp313-ios_13_0_x86_64_iphonesimulator.whl", hash = "sha256:766cef22385fa1091258ad7e6216792b156dc16d8d3fa607e7545b2b72061f1c", size = 3640401, upload-time = "2026-04-01T14:43:45.87Z" }, + { url = "https://files.pythonhosted.org/packages/34/46/6c717baadcd62bc8ed51d238d521ab651eaa74838291bda1f86fe1f864c9/pillow-12.2.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:5d2fd0fa6b5d9d1de415060363433f28da8b1526c1c129020435e186794b3795", size = 5308094, upload-time = "2026-04-01T14:43:48.438Z" }, + { url = "https://files.pythonhosted.org/packages/71/43/905a14a8b17fdb1ccb58d282454490662d2cb89a6bfec26af6d3520da5ec/pillow-12.2.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:56b25336f502b6ed02e889f4ece894a72612fe885889a6e8c4c80239ff6e5f5f", size = 4695402, upload-time = "2026-04-01T14:43:51.292Z" }, + { url = "https://files.pythonhosted.org/packages/73/dd/42107efcb777b16fa0393317eac58f5b5cf30e8392e266e76e51cff28c3d/pillow-12.2.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:f1c943e96e85df3d3478f7b691f229887e143f81fedab9b20205349ab04d73ed", size = 6280005, upload-time = "2026-04-01T14:43:54.242Z" }, + { url = "https://files.pythonhosted.org/packages/a8/68/b93e09e5e8549019e61acf49f65b1a8530765a7f812c77a7461bca7e4494/pillow-12.2.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:03f6fab9219220f041c74aeaa2939ff0062bd5c364ba9ce037197f4c6d498cd9", size = 8090669, upload-time = "2026-04-01T14:43:57.335Z" }, + { url = "https://files.pythonhosted.org/packages/4b/6e/3ccb54ce8ec4ddd1accd2d89004308b7b0b21c4ac3d20fa70af4760a4330/pillow-12.2.0-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5cdfebd752ec52bf5bb4e35d9c64b40826bc5b40a13df7c3cda20a2c03a0f5ed", size = 6395194, upload-time = "2026-04-01T14:43:59.864Z" }, + { url = "https://files.pythonhosted.org/packages/67/ee/21d4e8536afd1a328f01b359b4d3997b291ffd35a237c877b331c1c3b71c/pillow-12.2.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:eedf4b74eda2b5a4b2b2fb4c006d6295df3bf29e459e198c90ea48e130dc75c3", size = 7082423, upload-time = "2026-04-01T14:44:02.74Z" }, + { url = "https://files.pythonhosted.org/packages/78/5f/e9f86ab0146464e8c133fe85df987ed9e77e08b29d8d35f9f9f4d6f917ba/pillow-12.2.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:00a2865911330191c0b818c59103b58a5e697cae67042366970a6b6f1b20b7f9", size = 6505667, upload-time = "2026-04-01T14:44:05.381Z" }, + { url = "https://files.pythonhosted.org/packages/ed/1e/409007f56a2fdce61584fd3acbc2bbc259857d555196cedcadc68c015c82/pillow-12.2.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:1e1757442ed87f4912397c6d35a0db6a7b52592156014706f17658ff58bbf795", size = 7208580, upload-time = "2026-04-01T14:44:08.39Z" }, + { url = "https://files.pythonhosted.org/packages/23/c4/7349421080b12fb35414607b8871e9534546c128a11965fd4a7002ccfbee/pillow-12.2.0-cp313-cp313-win32.whl", hash = "sha256:144748b3af2d1b358d41286056d0003f47cb339b8c43a9ea42f5fea4d8c66b6e", size = 6375896, upload-time = "2026-04-01T14:44:11.197Z" }, + { url = "https://files.pythonhosted.org/packages/3f/82/8a3739a5e470b3c6cbb1d21d315800d8e16bff503d1f16b03a4ec3212786/pillow-12.2.0-cp313-cp313-win_amd64.whl", hash = "sha256:390ede346628ccc626e5730107cde16c42d3836b89662a115a921f28440e6a3b", size = 7081266, upload-time = "2026-04-01T14:44:13.947Z" }, + { url = "https://files.pythonhosted.org/packages/c3/25/f968f618a062574294592f668218f8af564830ccebdd1fa6200f598e65c5/pillow-12.2.0-cp313-cp313-win_arm64.whl", hash = "sha256:8023abc91fba39036dbce14a7d6535632f99c0b857807cbbbf21ecc9f4717f06", size = 2463508, upload-time = "2026-04-01T14:44:16.312Z" }, + { url = "https://files.pythonhosted.org/packages/4d/a4/b342930964e3cb4dce5038ae34b0eab4653334995336cd486c5a8c25a00c/pillow-12.2.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:042db20a421b9bafecc4b84a8b6e444686bd9d836c7fd24542db3e7df7baad9b", size = 5309927, upload-time = "2026-04-01T14:44:18.89Z" }, + { url = "https://files.pythonhosted.org/packages/9f/de/23198e0a65a9cf06123f5435a5d95cea62a635697f8f03d134d3f3a96151/pillow-12.2.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:dd025009355c926a84a612fecf58bb315a3f6814b17ead51a8e48d3823d9087f", size = 4698624, upload-time = "2026-04-01T14:44:21.115Z" }, + { url = "https://files.pythonhosted.org/packages/01/a6/1265e977f17d93ea37aa28aa81bad4fa597933879fac2520d24e021c8da3/pillow-12.2.0-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:88ddbc66737e277852913bd1e07c150cc7bb124539f94c4e2df5344494e0a612", size = 6321252, upload-time = "2026-04-01T14:44:23.663Z" }, + { url = "https://files.pythonhosted.org/packages/3c/83/5982eb4a285967baa70340320be9f88e57665a387e3a53a7f0db8231a0cd/pillow-12.2.0-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:d362d1878f00c142b7e1a16e6e5e780f02be8195123f164edf7eddd911eefe7c", size = 8126550, upload-time = "2026-04-01T14:44:26.772Z" }, + { url = "https://files.pythonhosted.org/packages/4e/48/6ffc514adce69f6050d0753b1a18fd920fce8cac87620d5a31231b04bfc5/pillow-12.2.0-cp313-cp313t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:2c727a6d53cb0018aadd8018c2b938376af27914a68a492f59dfcaca650d5eea", size = 6433114, upload-time = "2026-04-01T14:44:29.615Z" }, + { url = "https://files.pythonhosted.org/packages/36/a3/f9a77144231fb8d40ee27107b4463e205fa4677e2ca2548e14da5cf18dce/pillow-12.2.0-cp313-cp313t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:efd8c21c98c5cc60653bcb311bef2ce0401642b7ce9d09e03a7da87c878289d4", size = 7115667, upload-time = "2026-04-01T14:44:32.773Z" }, + { url = "https://files.pythonhosted.org/packages/c1/fc/ac4ee3041e7d5a565e1c4fd72a113f03b6394cc72ab7089d27608f8aaccb/pillow-12.2.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:9f08483a632889536b8139663db60f6724bfcb443c96f1b18855860d7d5c0fd4", size = 6538966, upload-time = "2026-04-01T14:44:35.252Z" }, + { url = "https://files.pythonhosted.org/packages/c0/a8/27fb307055087f3668f6d0a8ccb636e7431d56ed0750e07a60547b1e083e/pillow-12.2.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:dac8d77255a37e81a2efcbd1fc05f1c15ee82200e6c240d7e127e25e365c39ea", size = 7238241, upload-time = "2026-04-01T14:44:37.875Z" }, + { url = "https://files.pythonhosted.org/packages/ad/4b/926ab182c07fccae9fcb120043464e1ff1564775ec8864f21a0ebce6ac25/pillow-12.2.0-cp313-cp313t-win32.whl", hash = "sha256:ee3120ae9dff32f121610bb08e4313be87e03efeadfc6c0d18f89127e24d0c24", size = 6379592, upload-time = "2026-04-01T14:44:40.336Z" }, + { url = "https://files.pythonhosted.org/packages/c2/c4/f9e476451a098181b30050cc4c9a3556b64c02cf6497ea421ac047e89e4b/pillow-12.2.0-cp313-cp313t-win_amd64.whl", hash = "sha256:325ca0528c6788d2a6c3d40e3568639398137346c3d6e66bb61db96b96511c98", size = 7085542, upload-time = "2026-04-01T14:44:43.251Z" }, + { url = "https://files.pythonhosted.org/packages/00/a4/285f12aeacbe2d6dc36c407dfbbe9e96d4a80b0fb710a337f6d2ad978c75/pillow-12.2.0-cp313-cp313t-win_arm64.whl", hash = "sha256:2e5a76d03a6c6dcef67edabda7a52494afa4035021a79c8558e14af25313d453", size = 2465765, upload-time = "2026-04-01T14:44:45.996Z" }, + { url = "https://files.pythonhosted.org/packages/bf/98/4595daa2365416a86cb0d495248a393dfc84e96d62ad080c8546256cb9c0/pillow-12.2.0-cp314-cp314-ios_13_0_arm64_iphoneos.whl", hash = "sha256:3adc9215e8be0448ed6e814966ecf3d9952f0ea40eb14e89a102b87f450660d8", size = 4100848, upload-time = "2026-04-01T14:44:48.48Z" }, + { url = "https://files.pythonhosted.org/packages/0b/79/40184d464cf89f6663e18dfcf7ca21aae2491fff1a16127681bf1fa9b8cf/pillow-12.2.0-cp314-cp314-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:6a9adfc6d24b10f89588096364cc726174118c62130c817c2837c60cf08a392b", size = 4176515, upload-time = "2026-04-01T14:44:51.353Z" }, + { url = "https://files.pythonhosted.org/packages/b0/63/703f86fd4c422a9cf722833670f4f71418fb116b2853ff7da722ea43f184/pillow-12.2.0-cp314-cp314-ios_13_0_x86_64_iphonesimulator.whl", hash = "sha256:6a6e67ea2e6feda684ed370f9a1c52e7a243631c025ba42149a2cc5934dec295", size = 3640159, upload-time = "2026-04-01T14:44:53.588Z" }, + { url = "https://files.pythonhosted.org/packages/71/e0/fb22f797187d0be2270f83500aab851536101b254bfa1eae10795709d283/pillow-12.2.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:2bb4a8d594eacdfc59d9e5ad972aa8afdd48d584ffd5f13a937a664c3e7db0ed", size = 5312185, upload-time = "2026-04-01T14:44:56.039Z" }, + { url = "https://files.pythonhosted.org/packages/ba/8c/1a9e46228571de18f8e28f16fabdfc20212a5d019f3e3303452b3f0a580d/pillow-12.2.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:80b2da48193b2f33ed0c32c38140f9d3186583ce7d516526d462645fd98660ae", size = 4695386, upload-time = "2026-04-01T14:44:58.663Z" }, + { url = "https://files.pythonhosted.org/packages/70/62/98f6b7f0c88b9addd0e87c217ded307b36be024d4ff8869a812b241d1345/pillow-12.2.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:22db17c68434de69d8ecfc2fe821569195c0c373b25cccb9cbdacf2c6e53c601", size = 6280384, upload-time = "2026-04-01T14:45:01.5Z" }, + { url = "https://files.pythonhosted.org/packages/5e/03/688747d2e91cfbe0e64f316cd2e8005698f76ada3130d0194664174fa5de/pillow-12.2.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:7b14cc0106cd9aecda615dd6903840a058b4700fcb817687d0ee4fc8b6e389be", size = 8091599, upload-time = "2026-04-01T14:45:04.5Z" }, + { url = "https://files.pythonhosted.org/packages/f6/35/577e22b936fcdd66537329b33af0b4ccfefaeabd8aec04b266528cddb33c/pillow-12.2.0-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8cbeb542b2ebc6fcdacabf8aca8c1a97c9b3ad3927d46b8723f9d4f033288a0f", size = 6396021, upload-time = "2026-04-01T14:45:07.117Z" }, + { url = "https://files.pythonhosted.org/packages/11/8d/d2532ad2a603ca2b93ad9f5135732124e57811d0168155852f37fbce2458/pillow-12.2.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4bfd07bc812fbd20395212969e41931001fd59eb55a60658b0e5710872e95286", size = 7083360, upload-time = "2026-04-01T14:45:09.763Z" }, + { url = "https://files.pythonhosted.org/packages/5e/26/d325f9f56c7e039034897e7380e9cc202b1e368bfd04d4cbe6a441f02885/pillow-12.2.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:9aba9a17b623ef750a4d11b742cbafffeb48a869821252b30ee21b5e91392c50", size = 6507628, upload-time = "2026-04-01T14:45:12.378Z" }, + { url = "https://files.pythonhosted.org/packages/5f/f7/769d5632ffb0988f1c5e7660b3e731e30f7f8ec4318e94d0a5d674eb65a4/pillow-12.2.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:deede7c263feb25dba4e82ea23058a235dcc2fe1f6021025dc71f2b618e26104", size = 7209321, upload-time = "2026-04-01T14:45:15.122Z" }, + { url = "https://files.pythonhosted.org/packages/6a/7a/c253e3c645cd47f1aceea6a8bacdba9991bf45bb7dfe927f7c893e89c93c/pillow-12.2.0-cp314-cp314-win32.whl", hash = "sha256:632ff19b2778e43162304d50da0181ce24ac5bb8180122cbe1bf4673428328c7", size = 6479723, upload-time = "2026-04-01T14:45:17.797Z" }, + { url = "https://files.pythonhosted.org/packages/cd/8b/601e6566b957ca50e28725cb6c355c59c2c8609751efbecd980db44e0349/pillow-12.2.0-cp314-cp314-win_amd64.whl", hash = "sha256:4e6c62e9d237e9b65fac06857d511e90d8461a32adcc1b9065ea0c0fa3a28150", size = 7217400, upload-time = "2026-04-01T14:45:20.529Z" }, + { url = "https://files.pythonhosted.org/packages/d6/94/220e46c73065c3e2951bb91c11a1fb636c8c9ad427ac3ce7d7f3359b9b2f/pillow-12.2.0-cp314-cp314-win_arm64.whl", hash = "sha256:b1c1fbd8a5a1af3412a0810d060a78b5136ec0836c8a4ef9aa11807f2a22f4e1", size = 2554835, upload-time = "2026-04-01T14:45:23.162Z" }, + { url = "https://files.pythonhosted.org/packages/b6/ab/1b426a3974cb0e7da5c29ccff4807871d48110933a57207b5a676cccc155/pillow-12.2.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:57850958fe9c751670e49b2cecf6294acc99e562531f4bd317fa5ddee2068463", size = 5314225, upload-time = "2026-04-01T14:45:25.637Z" }, + { url = "https://files.pythonhosted.org/packages/19/1e/dce46f371be2438eecfee2a1960ee2a243bbe5e961890146d2dee1ff0f12/pillow-12.2.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:d5d38f1411c0ed9f97bcb49b7bd59b6b7c314e0e27420e34d99d844b9ce3b6f3", size = 4698541, upload-time = "2026-04-01T14:45:28.355Z" }, + { url = "https://files.pythonhosted.org/packages/55/c3/7fbecf70adb3a0c33b77a300dc52e424dc22ad8cdc06557a2e49523b703d/pillow-12.2.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:5c0a9f29ca8e79f09de89293f82fc9b0270bb4af1d58bc98f540cc4aedf03166", size = 6322251, upload-time = "2026-04-01T14:45:30.924Z" }, + { url = "https://files.pythonhosted.org/packages/1c/3c/7fbc17cfb7e4fe0ef1642e0abc17fc6c94c9f7a16be41498e12e2ba60408/pillow-12.2.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:1610dd6c61621ae1cf811bef44d77e149ce3f7b95afe66a4512f8c59f25d9ebe", size = 8127807, upload-time = "2026-04-01T14:45:33.908Z" }, + { url = "https://files.pythonhosted.org/packages/ff/c3/a8ae14d6defd2e448493ff512fae903b1e9bd40b72efb6ec55ce0048c8ce/pillow-12.2.0-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0a34329707af4f73cf1782a36cd2289c0368880654a2c11f027bcee9052d35dd", size = 6433935, upload-time = "2026-04-01T14:45:36.623Z" }, + { url = "https://files.pythonhosted.org/packages/6e/32/2880fb3a074847ac159d8f902cb43278a61e85f681661e7419e6596803ed/pillow-12.2.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8e9c4f5b3c546fa3458a29ab22646c1c6c787ea8f5ef51300e5a60300736905e", size = 7116720, upload-time = "2026-04-01T14:45:39.258Z" }, + { url = "https://files.pythonhosted.org/packages/46/87/495cc9c30e0129501643f24d320076f4cc54f718341df18cc70ec94c44e1/pillow-12.2.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:fb043ee2f06b41473269765c2feae53fc2e2fbf96e5e22ca94fb5ad677856f06", size = 6540498, upload-time = "2026-04-01T14:45:41.879Z" }, + { url = "https://files.pythonhosted.org/packages/18/53/773f5edca692009d883a72211b60fdaf8871cbef075eaa9d577f0a2f989e/pillow-12.2.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:f278f034eb75b4e8a13a54a876cc4a5ab39173d2cdd93a638e1b467fc545ac43", size = 7239413, upload-time = "2026-04-01T14:45:44.705Z" }, + { url = "https://files.pythonhosted.org/packages/c9/e4/4b64a97d71b2a83158134abbb2f5bd3f8a2ea691361282f010998f339ec7/pillow-12.2.0-cp314-cp314t-win32.whl", hash = "sha256:6bb77b2dcb06b20f9f4b4a8454caa581cd4dd0643a08bacf821216a16d9c8354", size = 6482084, upload-time = "2026-04-01T14:45:47.568Z" }, + { url = "https://files.pythonhosted.org/packages/ba/13/306d275efd3a3453f72114b7431c877d10b1154014c1ebbedd067770d629/pillow-12.2.0-cp314-cp314t-win_amd64.whl", hash = "sha256:6562ace0d3fb5f20ed7290f1f929cae41b25ae29528f2af1722966a0a02e2aa1", size = 7225152, upload-time = "2026-04-01T14:45:50.032Z" }, + { url = "https://files.pythonhosted.org/packages/ff/6e/cf826fae916b8658848d7b9f38d88da6396895c676e8086fc0988073aaf8/pillow-12.2.0-cp314-cp314t-win_arm64.whl", hash = "sha256:aa88ccfe4e32d362816319ed727a004423aab09c5cea43c01a4b435643fa34eb", size = 2556579, upload-time = "2026-04-01T14:45:52.529Z" }, +] + +[[package]] +name = "platformdirs" +version = "4.10.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d7/47/e4501f49c178ae1d9f4a75073fda4204f52647993f075a9db4d14930e0c5/platformdirs-4.10.0.tar.gz", hash = "sha256:31e761a6a0ca04faf7353ea759bdba55652be214725111e5aac52dfa29d4bef7", size = 31224, upload-time = "2026-05-28T03:32:53.587Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/81/e6/cd9575ac904136b3cbf7aa7ee819ef86eedb7274e46f230e94ea4342e729/platformdirs-4.10.0-py3-none-any.whl", hash = "sha256:fb516cdb12eb0d857d0cd85a7c57cea4d060bee4578d6cf5a14dfdf8cbf8784a", size = 22743, upload-time = "2026-05-28T03:32:52.175Z" }, +] + +[[package]] +name = "pluggy" +version = "1.6.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f9/e2/3e91f31a7d2b083fe6ef3fa267035b518369d9511ffab804f839851d2779/pluggy-1.6.0.tar.gz", hash = "sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3", size = 69412, upload-time = "2025-05-15T12:30:07.975Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746", size = 20538, upload-time = "2025-05-15T12:30:06.134Z" }, +] + +[[package]] +name = "pre-commit" +version = "4.6.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "cfgv" }, + { name = "identify" }, + { name = "nodeenv" }, + { name = "pyyaml" }, + { name = "virtualenv" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/8e/22/2de9408ac81acbb8a7d05d4cc064a152ccf33b3d480ebe0cd292153db239/pre_commit-4.6.0.tar.gz", hash = "sha256:718d2208cef53fdc38206e40524a6d4d9576d103eb16f0fec11c875e7716e9d9", size = 198525, upload-time = "2026-04-21T20:31:41.613Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/80/6e/4b28b62ecb6aae56769c34a8ff1d661473ec1e9519e2d5f8b2c150086b26/pre_commit-4.6.0-py2.py3-none-any.whl", hash = "sha256:e2cf246f7299edcabcf15f9b0571fdce06058527f0a06535068a86d38089f29b", size = 226472, upload-time = "2026-04-21T20:31:40.092Z" }, +] + +[[package]] +name = "propcache" +version = "0.5.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/ec/44/c87281c333769159c50594f22610f77398a47ccbfbbf23074e744e86f87c/propcache-0.5.2.tar.gz", hash = "sha256:01c4fc7480cd0598bb4b57022df55b9ca296da7fc5a8760bd8451a7e63a7d427", size = 50208, upload-time = "2026-05-08T21:02:12.199Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/4a/cb/e27bc2b2737a0bb49962b275efa051e8f1c35a936df7d5139b6b658b7dc9/propcache-0.5.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:806719138ecd720339a12410fb9614ac9b2b2d3a5fdf8235d56981c36f4039ba", size = 95887, upload-time = "2026-05-08T21:00:11.277Z" }, + { url = "https://files.pythonhosted.org/packages/e6/13/b8ae04c59392f8d11c6cd9fb4011d1dc7c86b81225c770280300e259ffe1/propcache-0.5.2-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:db2b80ea58eab4f86b2beec3cc8b39e8ff9276ac20e96b7cce43c8ae84cd6b5a", size = 54654, upload-time = "2026-05-08T21:00:12.604Z" }, + { url = "https://files.pythonhosted.org/packages/2c/7d/49777a3e20b55863d4794384a38acd460c04157b0a00f8602b0d508b8431/propcache-0.5.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:e5cbfac9f61484f7e9f3597775500cd3ebe8274e9b050c38f9525c77c97520bf", size = 55190, upload-time = "2026-05-08T21:00:13.935Z" }, + { url = "https://files.pythonhosted.org/packages/44/c7/085d0cd63062e84044e3f05797749c3f8e3938ff3aeb0eb2f69d43fafc91/propcache-0.5.2-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5dbc581d2814337da56222fab8dc5f161cd798a434e49bac27930aaef798e144", size = 59995, upload-time = "2026-05-08T21:00:15.526Z" }, + { url = "https://files.pythonhosted.org/packages/9c/42/32cf8e3009e92b2645cf1e944f701e8ea4e924dffde1ee26db860bcbf7e4/propcache-0.5.2-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:857187f381f88c8e2fa2fe56ab94879d011b883d5a2ee5a1b60a8cd2a06846d9", size = 63422, upload-time = "2026-05-08T21:00:16.824Z" }, + { url = "https://files.pythonhosted.org/packages/9e/1b/f112433f99fc979431b87a39ef169e3f8df070d99a72792c56d6937ac48b/propcache-0.5.2-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:178b4a2cdaac1818e2bf1c5a99b94383fa73ea5382e032a48dec07dc5668dc42", size = 64342, upload-time = "2026-05-08T21:00:18.362Z" }, + { url = "https://files.pythonhosted.org/packages/14/15/5574111ae50dd6e879456888c0eadd4c5a869959775854e18e18a6b345f3/propcache-0.5.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6f328175a2cde1f0ff2c4ed8ce968b9dcfb55f3a7153f39e2957ed994da13476", size = 61639, upload-time = "2026-05-08T21:00:19.692Z" }, + { url = "https://files.pythonhosted.org/packages/cc/da/4d775080b1490c0ae604acda868bd71aabe3a89ed16f2aa4339eb8a283e7/propcache-0.5.2-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:5671d09a36b06d0fd4a3da0fccbcae360e9b1570924171a15e9e0997f0249fba", size = 61588, upload-time = "2026-05-08T21:00:21.155Z" }, + { url = "https://files.pythonhosted.org/packages/04/ac/f076982cbe2195ee9cf32de5a1e46951d9fb399fc207f390562dd0fd8fb2/propcache-0.5.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:80168e2ebe4d3ec6599d10ad8f520304ae1cad9b6c5a95372aef1b66b7bfb53a", size = 60029, upload-time = "2026-05-08T21:00:22.713Z" }, + { url = "https://files.pythonhosted.org/packages/70/60/189be62e0dd898dce3b331e1b8c7a543cd3a405ac0c81fe8ee8a9d5d77e1/propcache-0.5.2-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:45f11346f884bc47444f6e6647131055844134c3175b629f84952e2b5cd62b64", size = 56774, upload-time = "2026-05-08T21:00:24.001Z" }, + { url = "https://files.pythonhosted.org/packages/ea/9e/93377b9c7939c1ffae98f878dee955efadfd638078bc86dbc21f9d52f651/propcache-0.5.2-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:8e778ebd44ef4f66ed60a0416b06b489687db264a9c0b3620362f26489492913", size = 63532, upload-time = "2026-05-08T21:00:25.545Z" }, + { url = "https://files.pythonhosted.org/packages/14/f9/590ef6cfb9b8028d516d287812ece32bb0bc5f11fbb9c8bf6b2e6313fec8/propcache-0.5.2-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:c0cb9ed24c8964e172768d455a38254c2dd8a552905729ce006cad3d3dda59b1", size = 61592, upload-time = "2026-05-08T21:00:27.186Z" }, + { url = "https://files.pythonhosted.org/packages/b4/5e/70958b3034c297a630bba2f17ca7abc2d5f39a803ad7e370ab79d1ecd022/propcache-0.5.2-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:1d1ad32d9d4355e2be65574fd0bfd3677e7066b009cd5b9b2dee8aa6a6393b33", size = 64788, upload-time = "2026-05-08T21:00:28.8Z" }, + { url = "https://files.pythonhosted.org/packages/12/fd/77fe5936d8c3086ca9048f7f415f122ed82e53884a9ec193646b42deef06/propcache-0.5.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:c80f4ba3e8f00189165999a742ee526ebeccedf6c3f7beb0c7df821e9772435a", size = 62514, upload-time = "2026-05-08T21:00:30.098Z" }, + { url = "https://files.pythonhosted.org/packages/cf/74/66bd798b5b3be70aa1b391f5cc9d6a0a5532d7fd3b19ec0b213e72e6ad9d/propcache-0.5.2-cp312-cp312-win32.whl", hash = "sha256:8c7972d8f193740d9175f0998ab38717e6cd322d5935c5b0fef8c0d323fd9031", size = 39018, upload-time = "2026-05-08T21:00:31.622Z" }, + { url = "https://files.pythonhosted.org/packages/61/7c/5c0d34aa3024694d6dcb9271cdbdd08c4e47c1c0ad95ec7e7bc74cdea145/propcache-0.5.2-cp312-cp312-win_amd64.whl", hash = "sha256:d9ee8826a7d47863a08ac44e1a5f611a462eefc3a194b492da242128bec75b42", size = 42322, upload-time = "2026-05-08T21:00:32.918Z" }, + { url = "https://files.pythonhosted.org/packages/4d/91/875812f1a3feb20ceba818ef39fbe4d92f1081e04ac815c822496d0d038b/propcache-0.5.2-cp312-cp312-win_arm64.whl", hash = "sha256:2800a4a8ead6b28cccd1ec54b59346f0def7922ee1c7598e8499c733cfbb7c84", size = 38172, upload-time = "2026-05-08T21:00:35.124Z" }, + { url = "https://files.pythonhosted.org/packages/c5/09/f049e45385503fe67db75a6b6186a7b9f0c3930366dc960522c312a825b1/propcache-0.5.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:099aaf4b4d1a02265b92a977edf00b5c4f63b3b17ac6de39b0d637c9cac0188a", size = 94457, upload-time = "2026-05-08T21:00:36.355Z" }, + { url = "https://files.pythonhosted.org/packages/6b/65/83d1d05655baf63113731bd5a1008435e14f8d1e5a06cbe4ec5b23ad7a31/propcache-0.5.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:68ce1c44c7a813a7f71ea04315a8c7b330b63db99d059a797a4651bb6f69f117", size = 53835, upload-time = "2026-05-08T21:00:38.072Z" }, + { url = "https://files.pythonhosted.org/packages/a9/12/a6ba6482bb5ea3260c000c9b20881c95fa11c6b30173715668259f844ed7/propcache-0.5.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:fc299c129490f55f254cd90be0deca4764e36e9a7c08b4aa588479a3bbed3098", size = 54545, upload-time = "2026-05-08T21:00:39.319Z" }, + { url = "https://files.pythonhosted.org/packages/a9/19/7fa086f5764c59ec8a8e157cd93aa8497acc00aba9dcdec56bfffb32602d/propcache-0.5.2-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a6ae2198be502c10f09b2516e7b5d019816924bc3183a43ce792a7bd6625e6f4", size = 59886, upload-time = "2026-05-08T21:00:40.621Z" }, + { url = "https://files.pythonhosted.org/packages/a1/e4/5d7663dc8235956c8f5281698a3af1d351d8820341ddd890f59d9a9127f2/propcache-0.5.2-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:6041d31504dc1779d700e1edcfb08eea334b357620b06681a4eabb57a74e574e", size = 63261, upload-time = "2026-05-08T21:00:41.775Z" }, + { url = "https://files.pythonhosted.org/packages/4a/4a/15a03adee24d6350da4292caeac44c34c033d2afe5e87eb370f38854560f/propcache-0.5.2-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:f7eabc04151c78a9f4d5bbb5f1faf571e4defeb4b585e0fe95b60ff2dbe4d3d7", size = 64184, upload-time = "2026-05-08T21:00:43.018Z" }, + { url = "https://files.pythonhosted.org/packages/8b/c6/979176efdaa3d239e36d503d5af63a0a773b36662ed8f52e5b6a6d9fd40e/propcache-0.5.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4db0ba63d693afd40d249bd93f842b5f144f8fcbb83de05660373bcf30517b1d", size = 61534, upload-time = "2026-05-08T21:00:44.507Z" }, + { url = "https://files.pythonhosted.org/packages/c8/22/63e8cd1bae4c2d2be6493b6b7d10566ddafad88137cfbc99964a1119853c/propcache-0.5.2-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:1dbcf7675229b35d31abb6547d8ebc8c27a830ac3f9a794edff6254873ec7c0a", size = 61500, upload-time = "2026-05-08T21:00:45.796Z" }, + { url = "https://files.pythonhosted.org/packages/60/5a/28e5d9acbac1cc9ccb67045e8c1b943aa8d79fdf39c93bd73cacd68008ea/propcache-0.5.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:d310c013aad2c72f1c3f2f8dd3279d460a858c551f97aeb8c63e4693cca7b4d2", size = 59994, upload-time = "2026-05-08T21:00:47.093Z" }, + { url = "https://files.pythonhosted.org/packages/f3/40/db650677f554a95b9c01a7c9d93d629e93a15562f5deb4573c9ee136fed2/propcache-0.5.2-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:06187263ddad280d05b4d8a8b3bb7d164cbebd469236544a42e6d9b28ac6a4fa", size = 56884, upload-time = "2026-05-08T21:00:48.376Z" }, + { url = "https://files.pythonhosted.org/packages/80/45/70b39b89516ff8b96bf732fa6fded8cef20f293cb1508690101c3c07ec51/propcache-0.5.2-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:3115559b8effafd63b142ea5ed53d63a16ea6469cbc63dce4ee194b42db5d853", size = 63464, upload-time = "2026-05-08T21:00:49.954Z" }, + { url = "https://files.pythonhosted.org/packages/f9/e2/fa59d3a89eac5534293124af4f1d0d0ada091ce4a0ab4610ce03fd2bdd8d/propcache-0.5.2-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:c60462af8e6dc30c35407c7237ea908d777b22862bbee27bc4699c0d8bcdc45a", size = 61588, upload-time = "2026-05-08T21:00:51.281Z" }, + { url = "https://files.pythonhosted.org/packages/0b/97/efb547a55c4bc7381cfb202d6a2239ac621045277bc1ea5dfd3a7f0516c0/propcache-0.5.2-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:40314bca9ac559716fe374094fc81c11dcc34b64fd6c585360f5775690505704", size = 64667, upload-time = "2026-05-08T21:00:52.602Z" }, + { url = "https://files.pythonhosted.org/packages/92/56/f5c7d9b4b7595d5127da38974d791b2153f3d1eae6c674af3583ace92ad3/propcache-0.5.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:cfa21e036ce1e1db2be04ba3b85d2df1bb1702fa01932d984c5464c665228ff4", size = 62463, upload-time = "2026-05-08T21:00:54.303Z" }, + { url = "https://files.pythonhosted.org/packages/bd/3b/484a3a65fc9f9f60c41dcd17b428bace5389544e2c680994534a20755066/propcache-0.5.2-cp313-cp313-win32.whl", hash = "sha256:f156a3529f38063b6dbaf356e15602a7f95f8055b1295a438433a6386f10463d", size = 38621, upload-time = "2026-05-08T21:00:55.808Z" }, + { url = "https://files.pythonhosted.org/packages/1c/fd/3f0f10dba4dabad3bf53102be007abf55481067952bde0fdddff439e7c61/propcache-0.5.2-cp313-cp313-win_amd64.whl", hash = "sha256:dfed59d0a5aeb01e242e66ff0300bc4a265a7c05f612d30016f0b60b1017d757", size = 41649, upload-time = "2026-05-08T21:00:57.061Z" }, + { url = "https://files.pythonhosted.org/packages/90/ec/6ce619cc32bb500a482f811f9cd509368b4e58e638d13f2c68f370d6b475/propcache-0.5.2-cp313-cp313-win_arm64.whl", hash = "sha256:ba338430e87ceb9c8f0cf754de38a9860560261e56c00376debd628698a7364f", size = 37636, upload-time = "2026-05-08T21:00:58.646Z" }, + { url = "https://files.pythonhosted.org/packages/1b/82/c1d268bbbf2ef981c5bf0fbbe746db617c66e3bcefe431a1aa8943fbe23a/propcache-0.5.2-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:a592f5f3da71c8691c788c13cb6734b6d17663d2e1cb8caddf0673d01ef8847d", size = 98872, upload-time = "2026-05-08T21:00:59.889Z" }, + { url = "https://files.pythonhosted.org/packages/f4/d4/52c871e73e864e6b34c0e2d58ac1ec5ccd149497ddc7ad2137ae98323a35/propcache-0.5.2-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:6a997d0489e9668a384fcfd5061b857aa5361de73191cac204d04b889cfbbafa", size = 56257, upload-time = "2026-05-08T21:01:01.195Z" }, + { url = "https://files.pythonhosted.org/packages/67/f0/9b90ca2a210b3d09bcfcd96ecd0f55545c091535abce2a45de2775cfd357/propcache-0.5.2-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:10734b5484ea113152ee25a91dccedf81631791805d2c9ccb054958e51842c94", size = 56696, upload-time = "2026-05-08T21:01:02.941Z" }, + { url = "https://files.pythonhosted.org/packages/9d/0e/6e9d4ba07c8e56e21ddec1e75f12148142b21ca83a51871babce095334f4/propcache-0.5.2-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:cafca7e56c12bb02ae16d283742bef25a61122e9dab2b5b3f2ccbe589ce32164", size = 62378, upload-time = "2026-05-08T21:01:04.475Z" }, + { url = "https://files.pythonhosted.org/packages/65/19/c10badaa463dde8a27ce884f8ee2ec37e6035b7c9f5ff0c8f74f06f08dac/propcache-0.5.2-cp313-cp313t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:f064f8d2b59177878b7615df1735cd8fe3462ed6be8c7b217d17a276489c2b7f", size = 65283, upload-time = "2026-05-08T21:01:05.959Z" }, + { url = "https://files.pythonhosted.org/packages/b0/b6/93bea99ca80e19cef6512a8580e5b7857bbe09422d9daa7fd4ef5723306c/propcache-0.5.2-cp313-cp313t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:f78abfa8dfc32376fd1aacf597b2f2fbbe0ea751419aee718af5d4f82537ef8c", size = 66616, upload-time = "2026-05-08T21:01:07.228Z" }, + { url = "https://files.pythonhosted.org/packages/83/e4/5c7462e50625f051f37fb38b8224f7639f667184bbd34424ec83819bb1b7/propcache-0.5.2-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:f7467da8a9822bf1a55336f877340c5bcbd3c482afc43a99771169f74a26dedc", size = 63773, upload-time = "2026-05-08T21:01:08.514Z" }, + { url = "https://files.pythonhosted.org/packages/ca/b6/99238894047b13c823be25027e736626cd414a52a5e30d2c3347c2733529/propcache-0.5.2-cp313-cp313t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:a6ddc6ac9e25de626c1f129c1b467d7ecd33ce2237d3fd0c4e429feef0a7ee1f", size = 63664, upload-time = "2026-05-08T21:01:09.874Z" }, + { url = "https://files.pythonhosted.org/packages/85/1e/a3a1a63116a2b8edb415a8bb9a6f0c34bd03830b1e18e8ce2904e1dc1cf4/propcache-0.5.2-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:2f22cbbac9e26a8e864c0985ff1268d5d939d53d9d9411a9824279097e03a2cb", size = 62643, upload-time = "2026-05-08T21:01:11.132Z" }, + { url = "https://files.pythonhosted.org/packages/e4/03/893cf147de2fc6543c5eaa07ad833170e7e2a2385725bbebe8c0503723bb/propcache-0.5.2-cp313-cp313t-musllinux_1_2_armv7l.whl", hash = "sha256:fc76378c62a0f04d0cd82fbb1a2cd2d7e28fcb40d5873f28a6c44e388aaa2751", size = 59595, upload-time = "2026-05-08T21:01:12.387Z" }, + { url = "https://files.pythonhosted.org/packages/86/3b/04c1a2e12c57766568ba75ba72b3bf2042818d4c1425fab6fc07155c7cff/propcache-0.5.2-cp313-cp313t-musllinux_1_2_ppc64le.whl", hash = "sha256:acd2c8edba48e31e58a363b8cf4e5c7db3b04b3f9e371f601df30d9b0d244836", size = 65711, upload-time = "2026-05-08T21:01:13.676Z" }, + { url = "https://files.pythonhosted.org/packages/1c/34/80f8d0099f8d6bacc4de1624c85672681c8cd1149ca2da0e38fd120b817f/propcache-0.5.2-cp313-cp313t-musllinux_1_2_riscv64.whl", hash = "sha256:452b5065457eb9991ec5eb38ff41d6cd4c991c9ac7c531c4d5849ae473a9a13f", size = 64247, upload-time = "2026-05-08T21:01:14.936Z" }, + { url = "https://files.pythonhosted.org/packages/f3/1a/8b08f3a5f1037e9e370c55883ceeeee0f6dd0416fb2d2d67b8bfc91f2a79/propcache-0.5.2-cp313-cp313t-musllinux_1_2_s390x.whl", hash = "sha256:3430bb2bfe1331885c427745a751e774ee679fd4344f80b97bf879815fe8fa55", size = 67102, upload-time = "2026-05-08T21:01:16.281Z" }, + { url = "https://files.pythonhosted.org/packages/34/68/8bdb7bb7756d76e005490649d10e4a8369e610c74d619f71e1aedf889e9c/propcache-0.5.2-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:cef6cea3922890dd6c9654971001fa797b526c16ab5e1e46c05fd6f877be7568", size = 64964, upload-time = "2026-05-08T21:01:17.57Z" }, + { url = "https://files.pythonhosted.org/packages/0a/aa/50fb0b5d3968b61a510926ff8b8465f1d6e976b3ab74496d7a4b9fc42515/propcache-0.5.2-cp313-cp313t-win32.whl", hash = "sha256:72d61e16dd78228b58c5d47be830ff3da7e5f139abdf0aef9d86cde1c5cf2191", size = 42546, upload-time = "2026-05-08T21:01:18.946Z" }, + { url = "https://files.pythonhosted.org/packages/ae/4c/0ddbae64321bd4a95bcbfc19307238016b5b1fee645c84626c8d539e5b74/propcache-0.5.2-cp313-cp313t-win_amd64.whl", hash = "sha256:0958834041a0166d343b8d2cedcd8bcbaeb4fdbe0cf08320c5379f143c3be6e7", size = 46330, upload-time = "2026-05-08T21:01:20.162Z" }, + { url = "https://files.pythonhosted.org/packages/00/d9/9cddc8efb78d8af264c5ec9f6d10b62f57c515feda8d321595f56010fb23/propcache-0.5.2-cp313-cp313t-win_arm64.whl", hash = "sha256:6de8bd93ddde9b992cf2b2e0d796d501a19026b5b9fd87356d7d0779531a8d96", size = 40521, upload-time = "2026-05-08T21:01:21.399Z" }, + { url = "https://files.pythonhosted.org/packages/e2/ea/23ee535d90ce8bcc465a3028eb3cc0ce3bd1005f4bb27710b30587de798d/propcache-0.5.2-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:46088abff4cba581dea21ae0467a480526cb25aa5f3c269e909f800328bc3999", size = 94662, upload-time = "2026-05-08T21:01:22.683Z" }, + { url = "https://files.pythonhosted.org/packages/b5/06/c5a52f419b5d8972f8d46a7577476090d8e3263ff589ce40b5ca4968d5be/propcache-0.5.2-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:fc88b26f08d634f7bc819a7852e5214f5802641ab8d9fd5326892292eee1993e", size = 53928, upload-time = "2026-05-08T21:01:23.986Z" }, + { url = "https://files.pythonhosted.org/packages/63/b1/4260d67d6bd85e58a66b72d54ce15d5de789b6f3870cc6bedf8ff9667401/propcache-0.5.2-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:97797ebb098e670a2f92dd66f32897e30d7615b14e7f59711de23e30a9072539", size = 54650, upload-time = "2026-05-08T21:01:25.305Z" }, + { url = "https://files.pythonhosted.org/packages/70/06/2f46c318e3307cd7a6a7481def374ce838c0fe20084b39dd54b0879d0e99/propcache-0.5.2-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ba57fffe4ac99c5d30076161b5866336d97600769bad35cc68f7774b15298a4e", size = 59912, upload-time = "2026-05-08T21:01:26.545Z" }, + { url = "https://files.pythonhosted.org/packages/4c/29/fe1aebec2ce57ab985a9c382bded1124431f85078113aa222c5d278430d4/propcache-0.5.2-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:583c19759d9eec1e5b69e2fbef36a7d9c326041be9746cb822d335c8cedc2979", size = 63300, upload-time = "2026-05-08T21:01:27.937Z" }, + { url = "https://files.pythonhosted.org/packages/b4/18/2334b26768b6c82be8c69e83671b767d5ef426aa09b0cba6c2ea47816774/propcache-0.5.2-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:d0326e2e5e1f3163fa306c834e48e8d490e5fae607a097a40c0648109b47ba80", size = 64208, upload-time = "2026-05-08T21:01:29.484Z" }, + { url = "https://files.pythonhosted.org/packages/2b/76/7f1bfd6afff4c5e38e36a3c6d68eb5f4b7311ea80baf693db78d95b603c4/propcache-0.5.2-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e00820e192c8dbebcafb383ebbf99030895f09905e7a0eb2e0340a0bcc2bc825", size = 61633, upload-time = "2026-05-08T21:01:31.068Z" }, + { url = "https://files.pythonhosted.org/packages/c4/46/b3ff8aba2b4953a3e50de2cf72f1b5748b8eca93b15f3dc2c84339084c09/propcache-0.5.2-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:c66afea89b1e43725731d2004732a046fe6fe955d51f952c3e95a7314a284a39", size = 61724, upload-time = "2026-05-08T21:01:32.374Z" }, + { url = "https://files.pythonhosted.org/packages/c5/01/814cfcafbcff954f94c01cf30e097ddc88a076b5440fbcf4570753437d40/propcache-0.5.2-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:d4dc37dec6c6cdad0b57881a5658fd14fbf53e333b1a86cf86559f190e1d9ec4", size = 60069, upload-time = "2026-05-08T21:01:33.67Z" }, + { url = "https://files.pythonhosted.org/packages/da/68/5c6f7622d510cc666a300687e06fd060c1a43361c0c9b20d284f06d8096a/propcache-0.5.2-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:5570dbcc97571c15f68068e529c92715a12f8d54030e272d264b377e22bd17a5", size = 57099, upload-time = "2026-05-08T21:01:34.915Z" }, + { url = "https://files.pythonhosted.org/packages/55/27/9cb0b4c679124085327957d42521c99dba04c88c90c3e55a6f0b633ebccc/propcache-0.5.2-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:f814362777a9f841adddb200ecdf8f5cb1e5a3c4b7a86378edbd6ccb26edd702", size = 63391, upload-time = "2026-05-08T21:01:36.231Z" }, + { url = "https://files.pythonhosted.org/packages/f0/9d/7258aaa5bdf60fc6f27591eef6fe52768cb0beda7140be477c8b12c9794a/propcache-0.5.2-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:196913dea116aeb5a2ba95af4ddcb7ea85559ae07d8eee8751688310d09168c3", size = 61626, upload-time = "2026-05-08T21:01:37.545Z" }, + { url = "https://files.pythonhosted.org/packages/8e/0d/41c602003e8a9b16fe1e7eadf62c7bfba9d5474370b24200bf48b315f45f/propcache-0.5.2-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:6e7b8719005dd1175be4ab1cd25e9b98659a5e0347331506ec6760d2773a7fb5", size = 64781, upload-time = "2026-05-08T21:01:38.83Z" }, + { url = "https://files.pythonhosted.org/packages/8b/f3/38e66b1856e9bd079deea015bc4a55f7767c0e4db2f7dcf69e7e680ba4ce/propcache-0.5.2-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:51f96d685ab16e88cab128cd37a52c5da540809c8b879fa047731bfcb4ad35a4", size = 62570, upload-time = "2026-05-08T21:01:40.415Z" }, + { url = "https://files.pythonhosted.org/packages/95/ca/bbfe9b910ce57dde8bb4876b4520fc02a4e89497c10de26be936758a3aaa/propcache-0.5.2-cp314-cp314-win32.whl", hash = "sha256:cc6fc3cc62e8501d3ed62894425040d2728ecddb1ed072737a5c70bd537aa9f0", size = 39436, upload-time = "2026-05-08T21:01:41.654Z" }, + { url = "https://files.pythonhosted.org/packages/61/d2/45c9defbaa1ea297035d9d4cce9e8f80daafbf19319c6007f157c6256ea9/propcache-0.5.2-cp314-cp314-win_amd64.whl", hash = "sha256:81e3a30b0bb60caa22033dd0f8a3618d1d67356212514f62c57db75cb0ef410c", size = 42373, upload-time = "2026-05-08T21:01:43.041Z" }, + { url = "https://files.pythonhosted.org/packages/44/68/9ea5103f41d5217d7d6ec24db90018e23aebec070c3f9a6e54d12b841fd8/propcache-0.5.2-cp314-cp314-win_arm64.whl", hash = "sha256:0d2c9bf8528f135dbb805ce027567e09164f7efa51a2be07458a2c0420f292d0", size = 38554, upload-time = "2026-05-08T21:01:44.336Z" }, + { url = "https://files.pythonhosted.org/packages/8a/81/fadf555f42d3b762eea8a53950b0489fdc0aa9da5f8ed9e10ce0a4e01b48/propcache-0.5.2-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:4bc8ff1feffc6a61c7002ffe84634c41b822e104990ae009f44a0834430070bb", size = 99395, upload-time = "2026-05-08T21:01:45.883Z" }, + { url = "https://files.pythonhosted.org/packages/f5/c9/c61e134a686949cf7971af3a390148b1156f7be81c73bc0cd12c873e2d48/propcache-0.5.2-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:79aa3ff0a9b566633b642fa9caf7e21ed1c13d6feca718187873f199e1514078", size = 56653, upload-time = "2026-05-08T21:01:47.307Z" }, + { url = "https://files.pythonhosted.org/packages/cb/73/daf935ea7048ddd7ec8eec5345b4a40b619d2d178b3c0a0900796bc3c794/propcache-0.5.2-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:1b31822f4474c4036bae62de9402710051d431a606d6a0f907fec79935a071aa", size = 56914, upload-time = "2026-05-08T21:01:48.573Z" }, + { url = "https://files.pythonhosted.org/packages/79/9f/aba959b435ea18617edd7cf0a7ad0b9c574b8fc7e3d2cd55fb59cb255d33/propcache-0.5.2-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:13fef48778b5a2a756523fdb781326b028ca75e32858b04f2cdd19f394564917", size = 62567, upload-time = "2026-05-08T21:01:49.903Z" }, + { url = "https://files.pythonhosted.org/packages/6c/a1/859942de9a791ff42f6141736f5b37749b8f53e65edfa49638c67dd67e6a/propcache-0.5.2-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:8b73ab70f1a3351fbc71f663b3e645af6dd0329100c353081cf69c37433fc6fe", size = 65542, upload-time = "2026-05-08T21:01:51.204Z" }, + { url = "https://files.pythonhosted.org/packages/b5/61/315bc0fd6c0fc7f80a528b8afd209e5fc4a875ea79571b91b8f50f442907/propcache-0.5.2-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:5538d2c13d93e4698af7e092b57bc7298fd35d1d58e656ae18f23ee0d0378e03", size = 66845, upload-time = "2026-05-08T21:01:52.539Z" }, + { url = "https://files.pythonhosted.org/packages/47/f7/9f8122e3132e8e354ac41975ef8f1099be7d5a16bc7ae562734e993665c0/propcache-0.5.2-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:cd645f03898405cabe694fb8bc35241e3a9c332ec85627584fe3de201452b335", size = 63985, upload-time = "2026-05-08T21:01:53.847Z" }, + { url = "https://files.pythonhosted.org/packages/c8/54/c317819ec157cbf6f35df9df9657a6f82daf34d5faf15948b2f639c2192e/propcache-0.5.2-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:a473b3440261e0c60706e732b2ed2f517857344fc21bf48fdfe211e2d98eb285", size = 63999, upload-time = "2026-05-08T21:01:55.179Z" }, + { url = "https://files.pythonhosted.org/packages/5a/56/387e3f7dfce0a9233df41fb888aa1c30222cb4bbbf09537c02dd9bd85fe2/propcache-0.5.2-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:7afa37062e6650640e932e4cc9297d81f9f42d9944029cc386b8247dea4da837", size = 62779, upload-time = "2026-05-08T21:01:57.489Z" }, + { url = "https://files.pythonhosted.org/packages/a1/9c/596784cb5824ed61ee960d3f8655a3f0993e107c6e98ab6c818b7fb92ccb/propcache-0.5.2-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:8a90efd5777e996e42d568db9ac740b944d691e565cbfd31b2f7832f9184b2b8", size = 59796, upload-time = "2026-05-08T21:01:58.736Z" }, + { url = "https://files.pythonhosted.org/packages/c2/3d/1a6cfa1726a48542c1e8784a0761421476a5b68e09b7f36bf95eb954aaba/propcache-0.5.2-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:f19bb891234d72535764d703bfed1153cc34f4214d5bd7150aee1eec9e8f4366", size = 66023, upload-time = "2026-05-08T21:02:00.228Z" }, + { url = "https://files.pythonhosted.org/packages/e4/0e/05fd6990369477076e4e280bcb970de760fddf0161a46e988bc95f7940ec/propcache-0.5.2-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:32775082acd2d807ee3db715c7770d38767b817870acfa08c29e057f3c4d5b56", size = 64448, upload-time = "2026-05-08T21:02:01.888Z" }, + { url = "https://files.pythonhosted.org/packages/cd/86/5f8da315a4309c62c10c0b2516b17492d5d3bbe1bb862b96604db67e2a37/propcache-0.5.2-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:9282fb1a3bccd038da9f768b927b24a0c753e466c086b7c4f3c6982851eefb2d", size = 67329, upload-time = "2026-05-08T21:02:03.484Z" }, + { url = "https://files.pythonhosted.org/packages/da/d3/3368efe79ab21f0cdf86ef49895811c9cc933131d4cde1f28a624e22e712/propcache-0.5.2-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:cc49723e2f60d6b32a0f0b08a3fd6d13203c07f1cd9566cfce0f12a917c967a2", size = 65172, upload-time = "2026-05-08T21:02:04.745Z" }, + { url = "https://files.pythonhosted.org/packages/d5/07/127e8b0bacfb325396196f9d976a22453049b89b9b2b08477cc3145faa44/propcache-0.5.2-cp314-cp314t-win32.whl", hash = "sha256:2d7aa89ebca5acc98cba9d1472d976e394782f587bad6661003602a619fd1821", size = 43813, upload-time = "2026-05-08T21:02:06.025Z" }, + { url = "https://files.pythonhosted.org/packages/88/fb/46dad6c0ae49ed230ab1b16c890c2b6314e2403e6c412976f4a72d64a527/propcache-0.5.2-cp314-cp314t-win_amd64.whl", hash = "sha256:d447bb0b3054be5818458fbb171208b1d9ff11eba14e18ca18b90cbb45767370", size = 47764, upload-time = "2026-05-08T21:02:07.353Z" }, + { url = "https://files.pythonhosted.org/packages/e7/c4/a47d0a63aa309d10d59ede6e9d4cff03a344a79d1f0f4cd0cd74997b53e0/propcache-0.5.2-cp314-cp314t-win_arm64.whl", hash = "sha256:fe67a3d11cd9b4efabfa45c3d00ffba2b26811442a73a581a94b67c2b5faccf6", size = 41140, upload-time = "2026-05-08T21:02:09.065Z" }, + { url = "https://files.pythonhosted.org/packages/3a/ed/1cdcab6ba3d6ab7feca11fc14f0eeea80755bb53ef4e892079f31b10a25f/propcache-0.5.2-py3-none-any.whl", hash = "sha256:be1ddfcbb376e3de5d2e2db1d58d6d67463e6b4f9f040c000de8e300295465fe", size = 14036, upload-time = "2026-05-08T21:02:10.673Z" }, +] + +[[package]] +name = "protobuf" +version = "6.33.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/66/70/e908e9c5e52ef7c3a6c7902c9dfbb34c7e29c25d2f81ade3856445fd5c94/protobuf-6.33.6.tar.gz", hash = "sha256:a6768d25248312c297558af96a9f9c929e8c4cee0659cb07e780731095f38135", size = 444531, upload-time = "2026-03-18T19:05:00.988Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/fc/9f/2f509339e89cfa6f6a4c4ff50438db9ca488dec341f7e454adad60150b00/protobuf-6.33.6-cp310-abi3-win32.whl", hash = "sha256:7d29d9b65f8afef196f8334e80d6bc1d5d4adedb449971fefd3723824e6e77d3", size = 425739, upload-time = "2026-03-18T19:04:48.373Z" }, + { url = "https://files.pythonhosted.org/packages/76/5d/683efcd4798e0030c1bab27374fd13a89f7c2515fb1f3123efdfaa5eab57/protobuf-6.33.6-cp310-abi3-win_amd64.whl", hash = "sha256:0cd27b587afca21b7cfa59a74dcbd48a50f0a6400cfb59391340ad729d91d326", size = 437089, upload-time = "2026-03-18T19:04:50.381Z" }, + { url = "https://files.pythonhosted.org/packages/5c/01/a3c3ed5cd186f39e7880f8303cc51385a198a81469d53d0fdecf1f64d929/protobuf-6.33.6-cp39-abi3-macosx_10_9_universal2.whl", hash = "sha256:9720e6961b251bde64edfdab7d500725a2af5280f3f4c87e57c0208376aa8c3a", size = 427737, upload-time = "2026-03-18T19:04:51.866Z" }, + { url = "https://files.pythonhosted.org/packages/ee/90/b3c01fdec7d2f627b3a6884243ba328c1217ed2d978def5c12dc50d328a3/protobuf-6.33.6-cp39-abi3-manylinux2014_aarch64.whl", hash = "sha256:e2afbae9b8e1825e3529f88d514754e094278bb95eadc0e199751cdd9a2e82a2", size = 324610, upload-time = "2026-03-18T19:04:53.096Z" }, + { url = "https://files.pythonhosted.org/packages/9b/ca/25afc144934014700c52e05103c2421997482d561f3101ff352e1292fb81/protobuf-6.33.6-cp39-abi3-manylinux2014_s390x.whl", hash = "sha256:c96c37eec15086b79762ed265d59ab204dabc53056e3443e702d2681f4b39ce3", size = 339381, upload-time = "2026-03-18T19:04:54.616Z" }, + { url = "https://files.pythonhosted.org/packages/16/92/d1e32e3e0d894fe00b15ce28ad4944ab692713f2e7f0a99787405e43533a/protobuf-6.33.6-cp39-abi3-manylinux2014_x86_64.whl", hash = "sha256:e9db7e292e0ab79dd108d7f1a94fe31601ce1ee3f7b79e0692043423020b0593", size = 323436, upload-time = "2026-03-18T19:04:55.768Z" }, + { url = "https://files.pythonhosted.org/packages/c4/72/02445137af02769918a93807b2b7890047c32bfb9f90371cbc12688819eb/protobuf-6.33.6-py3-none-any.whl", hash = "sha256:77179e006c476e69bf8e8ce866640091ec42e1beb80b213c3900006ecfba6901", size = 170656, upload-time = "2026-03-18T19:04:59.826Z" }, +] + +[[package]] +name = "psutil" +version = "7.2.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/aa/c6/d1ddf4abb55e93cebc4f2ed8b5d6dbad109ecb8d63748dd2b20ab5e57ebe/psutil-7.2.2.tar.gz", hash = "sha256:0746f5f8d406af344fd547f1c8daa5f5c33dbc293bb8d6a16d80b4bb88f59372", size = 493740, upload-time = "2026-01-28T18:14:54.428Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/51/08/510cbdb69c25a96f4ae523f733cdc963ae654904e8db864c07585ef99875/psutil-7.2.2-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:2edccc433cbfa046b980b0df0171cd25bcaeb3a68fe9022db0979e7aa74a826b", size = 130595, upload-time = "2026-01-28T18:14:57.293Z" }, + { url = "https://files.pythonhosted.org/packages/d6/f5/97baea3fe7a5a9af7436301f85490905379b1c6f2dd51fe3ecf24b4c5fbf/psutil-7.2.2-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:e78c8603dcd9a04c7364f1a3e670cea95d51ee865e4efb3556a3a63adef958ea", size = 131082, upload-time = "2026-01-28T18:14:59.732Z" }, + { url = "https://files.pythonhosted.org/packages/37/d6/246513fbf9fa174af531f28412297dd05241d97a75911ac8febefa1a53c6/psutil-7.2.2-cp313-cp313t-manylinux2010_x86_64.manylinux_2_12_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1a571f2330c966c62aeda00dd24620425d4b0cc86881c89861fbc04549e5dc63", size = 181476, upload-time = "2026-01-28T18:15:01.884Z" }, + { url = "https://files.pythonhosted.org/packages/b8/b5/9182c9af3836cca61696dabe4fd1304e17bc56cb62f17439e1154f225dd3/psutil-7.2.2-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:917e891983ca3c1887b4ef36447b1e0873e70c933afc831c6b6da078ba474312", size = 184062, upload-time = "2026-01-28T18:15:04.436Z" }, + { url = "https://files.pythonhosted.org/packages/16/ba/0756dca669f5a9300d0cbcbfae9a4c30e446dfc7440ffe43ded5724bfd93/psutil-7.2.2-cp313-cp313t-win_amd64.whl", hash = "sha256:ab486563df44c17f5173621c7b198955bd6b613fb87c71c161f827d3fb149a9b", size = 139893, upload-time = "2026-01-28T18:15:06.378Z" }, + { url = "https://files.pythonhosted.org/packages/1c/61/8fa0e26f33623b49949346de05ec1ddaad02ed8ba64af45f40a147dbfa97/psutil-7.2.2-cp313-cp313t-win_arm64.whl", hash = "sha256:ae0aefdd8796a7737eccea863f80f81e468a1e4cf14d926bd9b6f5f2d5f90ca9", size = 135589, upload-time = "2026-01-28T18:15:08.03Z" }, + { url = "https://files.pythonhosted.org/packages/81/69/ef179ab5ca24f32acc1dac0c247fd6a13b501fd5534dbae0e05a1c48b66d/psutil-7.2.2-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:eed63d3b4d62449571547b60578c5b2c4bcccc5387148db46e0c2313dad0ee00", size = 130664, upload-time = "2026-01-28T18:15:09.469Z" }, + { url = "https://files.pythonhosted.org/packages/7b/64/665248b557a236d3fa9efc378d60d95ef56dd0a490c2cd37dafc7660d4a9/psutil-7.2.2-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:7b6d09433a10592ce39b13d7be5a54fbac1d1228ed29abc880fb23df7cb694c9", size = 131087, upload-time = "2026-01-28T18:15:11.724Z" }, + { url = "https://files.pythonhosted.org/packages/d5/2e/e6782744700d6759ebce3043dcfa661fb61e2fb752b91cdeae9af12c2178/psutil-7.2.2-cp314-cp314t-manylinux2010_x86_64.manylinux_2_12_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1fa4ecf83bcdf6e6c8f4449aff98eefb5d0604bf88cb883d7da3d8d2d909546a", size = 182383, upload-time = "2026-01-28T18:15:13.445Z" }, + { url = "https://files.pythonhosted.org/packages/57/49/0a41cefd10cb7505cdc04dab3eacf24c0c2cb158a998b8c7b1d27ee2c1f5/psutil-7.2.2-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e452c464a02e7dc7822a05d25db4cde564444a67e58539a00f929c51eddda0cf", size = 185210, upload-time = "2026-01-28T18:15:16.002Z" }, + { url = "https://files.pythonhosted.org/packages/dd/2c/ff9bfb544f283ba5f83ba725a3c5fec6d6b10b8f27ac1dc641c473dc390d/psutil-7.2.2-cp314-cp314t-win_amd64.whl", hash = "sha256:c7663d4e37f13e884d13994247449e9f8f574bc4655d509c3b95e9ec9e2b9dc1", size = 141228, upload-time = "2026-01-28T18:15:18.385Z" }, + { url = "https://files.pythonhosted.org/packages/f2/fc/f8d9c31db14fcec13748d373e668bc3bed94d9077dbc17fb0eebc073233c/psutil-7.2.2-cp314-cp314t-win_arm64.whl", hash = "sha256:11fe5a4f613759764e79c65cf11ebdf26e33d6dd34336f8a337aa2996d71c841", size = 136284, upload-time = "2026-01-28T18:15:19.912Z" }, + { url = "https://files.pythonhosted.org/packages/e7/36/5ee6e05c9bd427237b11b3937ad82bb8ad2752d72c6969314590dd0c2f6e/psutil-7.2.2-cp36-abi3-macosx_10_9_x86_64.whl", hash = "sha256:ed0cace939114f62738d808fdcecd4c869222507e266e574799e9c0faa17d486", size = 129090, upload-time = "2026-01-28T18:15:22.168Z" }, + { url = "https://files.pythonhosted.org/packages/80/c4/f5af4c1ca8c1eeb2e92ccca14ce8effdeec651d5ab6053c589b074eda6e1/psutil-7.2.2-cp36-abi3-macosx_11_0_arm64.whl", hash = "sha256:1a7b04c10f32cc88ab39cbf606e117fd74721c831c98a27dc04578deb0c16979", size = 129859, upload-time = "2026-01-28T18:15:23.795Z" }, + { url = "https://files.pythonhosted.org/packages/b5/70/5d8df3b09e25bce090399cf48e452d25c935ab72dad19406c77f4e828045/psutil-7.2.2-cp36-abi3-manylinux2010_x86_64.manylinux_2_12_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:076a2d2f923fd4821644f5ba89f059523da90dc9014e85f8e45a5774ca5bc6f9", size = 155560, upload-time = "2026-01-28T18:15:25.976Z" }, + { url = "https://files.pythonhosted.org/packages/63/65/37648c0c158dc222aba51c089eb3bdfa238e621674dc42d48706e639204f/psutil-7.2.2-cp36-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b0726cecd84f9474419d67252add4ac0cd9811b04d61123054b9fb6f57df6e9e", size = 156997, upload-time = "2026-01-28T18:15:27.794Z" }, + { url = "https://files.pythonhosted.org/packages/8e/13/125093eadae863ce03c6ffdbae9929430d116a246ef69866dad94da3bfbc/psutil-7.2.2-cp36-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:fd04ef36b4a6d599bbdb225dd1d3f51e00105f6d48a28f006da7f9822f2606d8", size = 148972, upload-time = "2026-01-28T18:15:29.342Z" }, + { url = "https://files.pythonhosted.org/packages/04/78/0acd37ca84ce3ddffaa92ef0f571e073faa6d8ff1f0559ab1272188ea2be/psutil-7.2.2-cp36-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:b58fabe35e80b264a4e3bb23e6b96f9e45a3df7fb7eed419ac0e5947c61e47cc", size = 148266, upload-time = "2026-01-28T18:15:31.597Z" }, + { url = "https://files.pythonhosted.org/packages/b4/90/e2159492b5426be0c1fef7acba807a03511f97c5f86b3caeda6ad92351a7/psutil-7.2.2-cp37-abi3-win_amd64.whl", hash = "sha256:eb7e81434c8d223ec4a219b5fc1c47d0417b12be7ea866e24fb5ad6e84b3d988", size = 137737, upload-time = "2026-01-28T18:15:33.849Z" }, + { url = "https://files.pythonhosted.org/packages/8c/c7/7bb2e321574b10df20cbde462a94e2b71d05f9bbda251ef27d104668306a/psutil-7.2.2-cp37-abi3-win_arm64.whl", hash = "sha256:8c233660f575a5a89e6d4cb65d9f938126312bca76d8fe087b947b3a1aaac9ee", size = 134617, upload-time = "2026-01-28T18:15:36.514Z" }, +] + +[[package]] +name = "pyarrow" +version = "24.0.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/91/13/13e1069b351bdc3881266e11147ffccf687505dbb0ea74036237f5d454a5/pyarrow-24.0.0.tar.gz", hash = "sha256:85fe721a14dd823aca09127acbb06c3ca723efbd436c004f16bca601b04dcc83", size = 1180261, upload-time = "2026-04-21T10:51:25.837Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b4/a9/9686d9f07837f91f775e8932659192e02c74f9d8920524b480b85212cc68/pyarrow-24.0.0-cp312-cp312-macosx_12_0_arm64.whl", hash = "sha256:6233c9ed9ab9d1db47de57d9753256d9dcffbf42db341576099f0fd9f6bf4810", size = 34981559, upload-time = "2026-04-21T10:47:22.17Z" }, + { url = "https://files.pythonhosted.org/packages/80/b6/0ddf0e9b6ead3474ab087ae598c76b031fc45532bf6a63f3a553440fb258/pyarrow-24.0.0-cp312-cp312-macosx_12_0_x86_64.whl", hash = "sha256:f7616236ec1bc2b15bfdec22a71ab38851c86f8f05ff64f379e1278cf20c634a", size = 36663654, upload-time = "2026-04-21T10:47:28.315Z" }, + { url = "https://files.pythonhosted.org/packages/7c/3b/926382efe8ce27ba729071d3566ade6dfb86bdf112f366000196b2f5780a/pyarrow-24.0.0-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:1617043b99bd33e5318ae18eb2919af09c71322ef1ca46566cdafc6e6712fb66", size = 45679394, upload-time = "2026-04-21T10:47:34.821Z" }, + { url = "https://files.pythonhosted.org/packages/b3/7a/829f7d9dfd37c207206081d6dad474d81dde29952401f07f2ba507814818/pyarrow-24.0.0-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:6165461f55ef6314f026de6638d661188e3455d3ec49834556a0ebbdbace18bb", size = 48863122, upload-time = "2026-04-21T10:47:42.056Z" }, + { url = "https://files.pythonhosted.org/packages/5f/e8/f88ce625fe8babaae64e8db2d417c7653adb3019b08aae85c5ed787dc816/pyarrow-24.0.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:3b13dedfe76a0ad2d1d859b0811b53827a4e9d93a0bcb05cf59333ab4980cc7e", size = 49376032, upload-time = "2026-04-21T10:47:48.967Z" }, + { url = "https://files.pythonhosted.org/packages/36/7a/82c363caa145fff88fb475da50d3bf52bb024f61917be5424c3392eaf878/pyarrow-24.0.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:25ea65d868eb04015cd18e6df2fbe98f07e5bda2abefabcb88fce39a947716f6", size = 51929490, upload-time = "2026-04-21T10:47:55.981Z" }, + { url = "https://files.pythonhosted.org/packages/66/1c/e3e72c8014ad2743ca64a701652c733cc5cbcee15c0463a32a8c55518d9e/pyarrow-24.0.0-cp312-cp312-win_amd64.whl", hash = "sha256:295f0a7f2e242dabd513737cf076007dc5b2d59237e3eca37b05c0c6446f3826", size = 27355660, upload-time = "2026-04-21T10:48:01.718Z" }, + { url = "https://files.pythonhosted.org/packages/6f/d3/a1abf004482026ddc17f4503db227787fa3cfe41ec5091ff20e4fea55e57/pyarrow-24.0.0-cp313-cp313-macosx_12_0_arm64.whl", hash = "sha256:02b001b3ed4723caa44f6cd1af2d5c86aa2cf9971dacc2ffa55b21237713dfba", size = 34976759, upload-time = "2026-04-21T10:48:07.258Z" }, + { url = "https://files.pythonhosted.org/packages/4f/4a/34f0a36d28a2dd32225301b79daad44e243dc1a2bb77d43b60749be255c4/pyarrow-24.0.0-cp313-cp313-macosx_12_0_x86_64.whl", hash = "sha256:04920d6a71aabd08a0417709efce97d45ea8e6fb733d9ca9ecffb13c67839f68", size = 36658471, upload-time = "2026-04-21T10:48:13.347Z" }, + { url = "https://files.pythonhosted.org/packages/1f/78/543b94712ae8bb1a6023bcc1acf1a740fbff8286747c289cd9468fced2a5/pyarrow-24.0.0-cp313-cp313-manylinux_2_28_aarch64.whl", hash = "sha256:a964266397740257f16f7bb2e4f08a0c81454004beab8ff59dd531b73610e9f2", size = 45675981, upload-time = "2026-04-21T10:48:20.201Z" }, + { url = "https://files.pythonhosted.org/packages/84/9f/8fb7c222b100d314137fa40ec050de56cd8c6d957d1cfff685ce72f15b17/pyarrow-24.0.0-cp313-cp313-manylinux_2_28_x86_64.whl", hash = "sha256:6f066b179d68c413374294bc1735f68475457c933258df594443bb9d88ddc2a0", size = 48859172, upload-time = "2026-04-21T10:48:27.541Z" }, + { url = "https://files.pythonhosted.org/packages/a7/d3/1ea72538e6c8b3b475ed78d1049a2c518e655761ea50fe1171fc855fcab7/pyarrow-24.0.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:1183baeb14c5f587b1ec52831e665718ce632caab84b7cd6b85fd44f96114495", size = 49385733, upload-time = "2026-04-21T10:48:34.7Z" }, + { url = "https://files.pythonhosted.org/packages/c3/be/c3d8b06a1ba35f2260f8e1f771abbee7d5e345c0937aab90675706b1690a/pyarrow-24.0.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:806f24b4085453c197a5078218d1ee08783ebbba271badd153d1ae22a3ee804f", size = 51934335, upload-time = "2026-04-21T10:48:42.099Z" }, + { url = "https://files.pythonhosted.org/packages/9c/62/89e07a1e7329d2cde3e3c6994ba0839a24977a2beda8be6005ea3d860b99/pyarrow-24.0.0-cp313-cp313-win_amd64.whl", hash = "sha256:e4505fc6583f7b05ab854934896bcac8253b04ac1171a77dfb73efef92076d91", size = 27271748, upload-time = "2026-04-21T10:49:42.532Z" }, + { url = "https://files.pythonhosted.org/packages/17/1a/cff3a59f80b5b1658549d46611b67163f65e0664431c076ad728bf9d5af4/pyarrow-24.0.0-cp313-cp313t-macosx_12_0_arm64.whl", hash = "sha256:1a4e45017efbf115032e4475ee876d525e0e36c742214fbe405332480ecd6275", size = 35238554, upload-time = "2026-04-21T10:48:48.526Z" }, + { url = "https://files.pythonhosted.org/packages/a8/99/cce0f42a327bfef2c420fb6078a3eb834826e5d6697bf3009fe11d2ad051/pyarrow-24.0.0-cp313-cp313t-macosx_12_0_x86_64.whl", hash = "sha256:7986f1fa71cee060ad00758bcc79d3a93bab8559bf978fab9e53472a2e25a17b", size = 36782301, upload-time = "2026-04-21T10:48:55.181Z" }, + { url = "https://files.pythonhosted.org/packages/2a/66/8e560d5ff6793ca29aca213c53eec0dd482dd46cb93b2819e5aab52e4252/pyarrow-24.0.0-cp313-cp313t-manylinux_2_28_aarch64.whl", hash = "sha256:d3e0b61e8efb24ed38898e5cdc5fffa9124be480008d401a1f8071500494ae42", size = 45721929, upload-time = "2026-04-21T10:49:03.676Z" }, + { url = "https://files.pythonhosted.org/packages/27/0c/a26e25505d030716e078d9f16eb74973cbf0b33b672884e9f9da1c83b871/pyarrow-24.0.0-cp313-cp313t-manylinux_2_28_x86_64.whl", hash = "sha256:55a3bc1e3df3b5567b7d27ef551b2283f0c68a5e86f1cd56abc569da4f31335b", size = 48825365, upload-time = "2026-04-21T10:49:11.714Z" }, + { url = "https://files.pythonhosted.org/packages/5f/eb/771f9ecb0c65e73fe9dccdd1717901b9594f08c4515d000c7c62df573811/pyarrow-24.0.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:641f795b361874ac9da5294f8f443dfdbee355cf2bd9e3b8d97aaac2306b9b37", size = 49451819, upload-time = "2026-04-21T10:49:21.474Z" }, + { url = "https://files.pythonhosted.org/packages/48/da/61ae89a88732f5a785646f3ec6125dbb640fa98a540eb2b9889caa561403/pyarrow-24.0.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:8adc8e6ce5fccf5dc707046ae4914fd537def529709cc0d285d37a7f9cd442ca", size = 51909252, upload-time = "2026-04-21T10:49:31.164Z" }, + { url = "https://files.pythonhosted.org/packages/cb/1a/8dd5cafab7b66573fa91c03d06d213356ad4edd71813aa75e08ce2b3a844/pyarrow-24.0.0-cp313-cp313t-win_amd64.whl", hash = "sha256:9b18371ad2f44044b81a8d23bc2d8a9b6a6226dca775e8e16cfee640473d6c5d", size = 27388127, upload-time = "2026-04-21T10:49:37.334Z" }, + { url = "https://files.pythonhosted.org/packages/ad/80/d022a34ff05d2cbedd8ccf841fc1f532ecfa9eb5ed1711b56d0e0ea71fc9/pyarrow-24.0.0-cp314-cp314-macosx_12_0_arm64.whl", hash = "sha256:1cc9057f0319e26333b357e17f3c2c022f1a83739b48a88b25bfd5fa2dc18838", size = 35007997, upload-time = "2026-04-21T10:49:48.796Z" }, + { url = "https://files.pythonhosted.org/packages/1a/ff/f01485fda6f4e5d441afb8dd5e7681e4db18826c1e271852f5d3957d6a80/pyarrow-24.0.0-cp314-cp314-macosx_12_0_x86_64.whl", hash = "sha256:e6f1278ee4785b6db21229374a1c9e54ec7c549de5d1efc9630b6207de7e170b", size = 36678720, upload-time = "2026-04-21T10:49:55.858Z" }, + { url = "https://files.pythonhosted.org/packages/9e/c2/2d2d5fea814237923f71b36495211f20b43a1576f9a4d6da7e751a64ec6f/pyarrow-24.0.0-cp314-cp314-manylinux_2_28_aarch64.whl", hash = "sha256:adbbedc55506cbdabb830890444fb856bfb0060c46c6f8026c6c2f2cf86ae795", size = 45741852, upload-time = "2026-04-21T10:50:04.624Z" }, + { url = "https://files.pythonhosted.org/packages/8e/3a/28ba9c1c1ebdbb5f1b94dfebb46f207e52e6a554b7fe4132540fde29a3a0/pyarrow-24.0.0-cp314-cp314-manylinux_2_28_x86_64.whl", hash = "sha256:ae8a1145af31d903fa9bb166824d7abe9b4681a000b0159c9fb99c11bc11ad26", size = 48889852, upload-time = "2026-04-21T10:50:12.293Z" }, + { url = "https://files.pythonhosted.org/packages/df/51/4a389acfd31dca009f8fb82d7f510bb4130f2b3a8e18cf00194d0687d8ac/pyarrow-24.0.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:d7027eba1df3b2069e2e8d80f644fa0918b68c46432af3d088ddd390d063ecde", size = 49445207, upload-time = "2026-04-21T10:50:20.677Z" }, + { url = "https://files.pythonhosted.org/packages/19/4b/0bab2b23d2ae901b1b9a03c0efd4b2d070256f8ce3fc43f6e58c167b2081/pyarrow-24.0.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:e56a1ffe9bf7b727432b89104cc0849c21582949dd7bdcb34f17b2001a351a76", size = 51954117, upload-time = "2026-04-21T10:50:29.14Z" }, + { url = "https://files.pythonhosted.org/packages/29/88/f4e9145da0417b3d2c12035a8492b35ff4a3dbc653e614fcfb51d9dedb38/pyarrow-24.0.0-cp314-cp314-win_amd64.whl", hash = "sha256:38be1808cdd068605b787e6ca9119b27eb275a0234e50212c3492331680c3b1e", size = 28001155, upload-time = "2026-04-21T10:51:22.337Z" }, + { url = "https://files.pythonhosted.org/packages/79/4f/46a49a63f43526da895b1a45bbb51d5baf8e4d77159f8528fc3e5490007f/pyarrow-24.0.0-cp314-cp314t-macosx_12_0_arm64.whl", hash = "sha256:418e48ce50a45a6a6c73c454677203a9c75c966cb1e92ca3370959185f197a05", size = 35250387, upload-time = "2026-04-21T10:50:35.552Z" }, + { url = "https://files.pythonhosted.org/packages/a0/da/d5e0cd5ef00796922404806d5f00325cdadc3441ce2c13fe7115f2df9a64/pyarrow-24.0.0-cp314-cp314t-macosx_12_0_x86_64.whl", hash = "sha256:2f16197705a230a78270cdd4ea8a1d57e86b2fdcbc34a1f6aebc72e65c986f9a", size = 36797102, upload-time = "2026-04-21T10:50:42.417Z" }, + { url = "https://files.pythonhosted.org/packages/34/c7/5904145b0a593a05236c882933d439b5720f0a145381179063722fbfc123/pyarrow-24.0.0-cp314-cp314t-manylinux_2_28_aarch64.whl", hash = "sha256:fb24ac194bfc5e86839d7dcd52092ee31e5fe6733fe11f5e3b06ef0812b20072", size = 45745118, upload-time = "2026-04-21T10:50:49.324Z" }, + { url = "https://files.pythonhosted.org/packages/13/d3/cca42fe166d1c6e4d5b80e530b7949104d10e17508a90ae202dac205ce2a/pyarrow-24.0.0-cp314-cp314t-manylinux_2_28_x86_64.whl", hash = "sha256:9700ebd9a51f5895ce75ff4ac4b3c47a7d4b42bc618be8e713e5d56bacf5f931", size = 48844765, upload-time = "2026-04-21T10:50:55.579Z" }, + { url = "https://files.pythonhosted.org/packages/b0/49/942c3b79878ba928324d1e17c274ed84581db8c0a749b24bcf4cbdf15bd3/pyarrow-24.0.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:d8ddd2768da81d3ee08cfea9b597f4abb4e8e1dc8ae7e204b608d23a0d3ab699", size = 49471890, upload-time = "2026-04-21T10:51:02.439Z" }, + { url = "https://files.pythonhosted.org/packages/76/97/ff71431000a75d84135a1ace5ca4ba11726a231a8007bbb320a4c54075d5/pyarrow-24.0.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:61a3d7eaa97a14768b542f3d284dc6400dd2470d9f080708b13cd46b6ae18136", size = 51932250, upload-time = "2026-04-21T10:51:10.576Z" }, + { url = "https://files.pythonhosted.org/packages/51/be/6f79d55816d5c22557cf27533543d5d70dfe692adfbee4b99f2760674f38/pyarrow-24.0.0-cp314-cp314t-win_amd64.whl", hash = "sha256:c91d00057f23b8d353039520dc3a6c09d8608164c692e9f59a175a42b2ae0c19", size = 28131282, upload-time = "2026-04-21T10:51:16.815Z" }, +] + +[[package]] +name = "pydantic" +version = "2.13.4" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "annotated-types" }, + { name = "pydantic-core" }, + { name = "typing-extensions" }, + { name = "typing-inspection" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/18/a5/b60d21ac674192f8ab0ba4e9fd860690f9b4a6e51ca5df118733b487d8d6/pydantic-2.13.4.tar.gz", hash = "sha256:c40756b57adaa8b1efeeced5c196f3f3b7c435f90e84ea7f443901bec8099ef6", size = 844775, upload-time = "2026-05-06T13:43:05.343Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/fd/7b/122376b1fd3c62c1ed9dc80c931ace4844b3c55407b6fb2d199377c9736f/pydantic-2.13.4-py3-none-any.whl", hash = "sha256:45a282cde31d808236fd7ea9d919b128653c8b38b393d1c4ab335c62924d9aba", size = 472262, upload-time = "2026-05-06T13:43:02.641Z" }, +] + +[package.optional-dependencies] +email = [ + { name = "email-validator" }, +] + +[[package]] +name = "pydantic-core" +version = "2.46.4" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/9d/56/921726b776ace8d8f5db44c4ef961006580d91dc52b803c489fafd1aa249/pydantic_core-2.46.4.tar.gz", hash = "sha256:62f875393d7f270851f20523dd2e29f082bcc82292d66db2b64ea71f64b6e1c1", size = 471464, upload-time = "2026-05-06T13:37:06.98Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ce/8c/af022f0af448d7747c5154288d46b5f2bc5f17366eaa0e23e9aa04d59f3b/pydantic_core-2.46.4-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:3245406455a5d98187ec35530fd772b1d799b26667980872c8d4614991e2c4a2", size = 2106158, upload-time = "2026-05-06T13:38:57.215Z" }, + { url = "https://files.pythonhosted.org/packages/19/95/6195171e385007300f0f5574592e467c568becce2d937a0b6804f218bc49/pydantic_core-2.46.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:962ccbab7b642487b1d8b7df90ef677e03134cf1fd8880bf698649b22a69371f", size = 1951724, upload-time = "2026-05-06T13:37:02.697Z" }, + { url = "https://files.pythonhosted.org/packages/8e/bc/f47d1ff9cbb1620e1b5b697eef06010035735f07820180e74178226b27b3/pydantic_core-2.46.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8233f2947cf85404441fd7e0085f53b10c93e0ee78611099b5c7237e36aacbf7", size = 1975742, upload-time = "2026-05-06T13:37:09.448Z" }, + { url = "https://files.pythonhosted.org/packages/5b/11/9b9a5b0306345664a2da6410877af6e8082481b5884b3ddd78d47c6013ce/pydantic_core-2.46.4-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:3a233125ac121aa3ffba9a2b59edfc4a985a76092dc8279586ab4b71390875e7", size = 2052418, upload-time = "2026-05-06T13:37:38.234Z" }, + { url = "https://files.pythonhosted.org/packages/f1/b7/a65fec226f5d78fc39f4a13c4cc0c768c22b113438f60c14adc9d2865038/pydantic_core-2.46.4-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5b712b53160b79a5850310b912a5ef8e57e56947c8ad690c227f5c9d7e561712", size = 2232274, upload-time = "2026-05-06T13:38:27.753Z" }, + { url = "https://files.pythonhosted.org/packages/68/f0/92039db98b907ef49269a8271f67db9cb78ae2fc68062ef7e4e77adb5f61/pydantic_core-2.46.4-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9401557acd873c3a7f3eb9383edef8ac4968f9510e340f4808d427e75667e7b4", size = 2309940, upload-time = "2026-05-06T13:38:05.353Z" }, + { url = "https://files.pythonhosted.org/packages/5f/97/2aab507d3d00ca626e8e57c1eac6a79e4e5fbcc63eb99733ff55d1717f65/pydantic_core-2.46.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:926c9541b14b12b1681dca8a0b75feb510b06c6341b70a8e500c2fdcff837cce", size = 2094516, upload-time = "2026-05-06T13:39:10.577Z" }, + { url = "https://files.pythonhosted.org/packages/22/37/a8aca44d40d737dde2bc05b3c6c07dff0de07ce6f82e9f3167aeaf4d5dea/pydantic_core-2.46.4-cp312-cp312-manylinux_2_31_riscv64.whl", hash = "sha256:56cb4851bcaf3d117eddcef4fe66afd750a50274b0da8e22be256d10e5611987", size = 2136854, upload-time = "2026-05-06T13:40:22.59Z" }, + { url = "https://files.pythonhosted.org/packages/24/99/fcef1b79238c06a8cbec70819ac722ba76e02bc8ada9b0fd66eba40da01b/pydantic_core-2.46.4-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c68fcd102d71ea85c5b2dfac3f4f8476eff42a9e078fd5faefff6d145063536b", size = 2180306, upload-time = "2026-05-06T13:40:10.666Z" }, + { url = "https://files.pythonhosted.org/packages/ae/6c/fc44000918855b42779d007ae63b0532794739027b2f417321cddbc44f6a/pydantic_core-2.46.4-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:b2f69dec1725e79a012d920df1707de5caf7ed5e08f3be4435e25803efc47458", size = 2190044, upload-time = "2026-05-06T13:40:43.231Z" }, + { url = "https://files.pythonhosted.org/packages/6b/65/d9cadc9f1920d7a127ad2edba16c1db7916e59719285cd6c94600b0080ba/pydantic_core-2.46.4-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:8d0820e8192167f80d88d64038e609c31452eeca865b4e1d9950a27a4609b00b", size = 2329133, upload-time = "2026-05-06T13:39:57.365Z" }, + { url = "https://files.pythonhosted.org/packages/d0/cf/c873d91679f3a30bcf5e7ac280ce5573483e72295307685120d0d5ad3416/pydantic_core-2.46.4-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:fbdb89b3e1c94a30cc5edfce477c6e6a5dc4d8f84665b455c27582f211a1c72c", size = 2374464, upload-time = "2026-05-06T13:38:06.976Z" }, + { url = "https://files.pythonhosted.org/packages/47/bd/6f2fc8188f31bf10590f1e98e7b306336161fac930a8c514cd7bd828c7dc/pydantic_core-2.46.4-cp312-cp312-win32.whl", hash = "sha256:9aa768456404a8bf48a4406685ac2bec8e72b62c69313734fa3b73cf33b3a894", size = 1974823, upload-time = "2026-05-06T13:40:47.985Z" }, + { url = "https://files.pythonhosted.org/packages/40/8c/985c1d41ea1107c2534abd9870e4ed5c8e7669b5c308297835c001e7a1c4/pydantic_core-2.46.4-cp312-cp312-win_amd64.whl", hash = "sha256:e9c26f834c65f5752f3f06cb08cb86a913ceb7274d0db6e267808a708b46bc89", size = 2072919, upload-time = "2026-05-06T13:39:21.153Z" }, + { url = "https://files.pythonhosted.org/packages/c4/ba/f463d006e0c47373ca7ec5e1a261c59dc01ef4d62b2657af925fb0deee3a/pydantic_core-2.46.4-cp312-cp312-win_arm64.whl", hash = "sha256:4fc73cb559bdb54b1134a706a2802a4cddd27a0633f5abb7e53056268751ac6a", size = 2027604, upload-time = "2026-05-06T13:39:03.753Z" }, + { url = "https://files.pythonhosted.org/packages/51/a2/5d30b469c5267a17b39dec53208222f76a8d351dfac4af661888c5aee77d/pydantic_core-2.46.4-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:5d5902252db0d3cedf8d4a1bc68f70eeb430f7e4c7104c8c476753519b423008", size = 2106306, upload-time = "2026-05-06T13:37:48.029Z" }, + { url = "https://files.pythonhosted.org/packages/c1/81/4fa520eaffa8bd7d1525e644cd6d39e7d60b1592bc5b516693c7340b50f1/pydantic_core-2.46.4-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:c94f0688e7b8d0a67abf40e57a7eaaecd17cc9586706a31b76c031f63df052b4", size = 1951906, upload-time = "2026-05-06T13:37:17.012Z" }, + { url = "https://files.pythonhosted.org/packages/03/d5/fd02da45b659668b05923b17ba3a0100a0a3d5541e3bd8fcc4ecb711309e/pydantic_core-2.46.4-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f027324c56cd5406ca49c124b0db10e56c69064fec039acc571c29020cc87c76", size = 1976802, upload-time = "2026-05-06T13:37:35.113Z" }, + { url = "https://files.pythonhosted.org/packages/21/f2/95727e1368be3d3ed485eaab7adbd7dda408f33f7a36e8b48e0144002b91/pydantic_core-2.46.4-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e739fee756ba1010f8bcccb534252e85a35fe45ae92c295a06059ce58b74ccd3", size = 2052446, upload-time = "2026-05-06T13:37:12.313Z" }, + { url = "https://files.pythonhosted.org/packages/9c/86/5d99feea3f77c7234b8718075b23db11532773c1a0dbd9b9490215dc2eeb/pydantic_core-2.46.4-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9d56801be94b86a9da183e5f3766e6310752b99ff647e38b09a9500d88e46e76", size = 2232757, upload-time = "2026-05-06T13:39:01.149Z" }, + { url = "https://files.pythonhosted.org/packages/d2/3a/508ac615935ef7588cf6d9e9b91309fdc2da751af865e02a9098de88258c/pydantic_core-2.46.4-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2412e734dcb48da14d4e4006b82b46b74f2518b8a26ee7e58c6844a6cd6d03c4", size = 2309275, upload-time = "2026-05-06T13:37:41.406Z" }, + { url = "https://files.pythonhosted.org/packages/07/f8/41db9de19d7987d6b04715a02b3b40aea467000275d9d758ffaa31af7d50/pydantic_core-2.46.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9551187363ffc0de2a00b2e47c25aeaeb1020b69b668762966df15fc5659dd5a", size = 2094467, upload-time = "2026-05-06T13:39:18.847Z" }, + { url = "https://files.pythonhosted.org/packages/2c/e2/f35033184cb11d0052daf4416e8e10a502ea2ac006fc4f459aee872727d1/pydantic_core-2.46.4-cp313-cp313-manylinux_2_31_riscv64.whl", hash = "sha256:0186750b482eefa11d7f435892b09c5c606193ef3375bcf94aa00ae6bfb66262", size = 2134417, upload-time = "2026-05-06T13:40:17.944Z" }, + { url = "https://files.pythonhosted.org/packages/7e/7b/6ceeb1cc90e193862f444ebe373d8fdf613f0a82572dde03fb10734c6c71/pydantic_core-2.46.4-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:5855698a4856556d86e8e6cd8434bc3ac0314ee8e12089ae0e143f64c6256e4e", size = 2179782, upload-time = "2026-05-06T13:40:32.618Z" }, + { url = "https://files.pythonhosted.org/packages/5a/f2/c8d7773ede6af08036423a00ae0ceffce266c3c52a096c435d68c896083f/pydantic_core-2.46.4-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:cbaf13819775b7f769bf4a1f066cb6df7a28d4480081a589828ef190226881cd", size = 2188782, upload-time = "2026-05-06T13:36:51.018Z" }, + { url = "https://files.pythonhosted.org/packages/59/31/0c864784e31f09f05cdd87606f08923b9c9e7f6e51dd27f20f62f975ce9f/pydantic_core-2.46.4-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:633147d34cf4550417f12e2b1a0383973bdf5cdfde212cb09e9a581cf10820be", size = 2328334, upload-time = "2026-05-06T13:40:37.764Z" }, + { url = "https://files.pythonhosted.org/packages/c2/eb/4f6c8a41efa30baa755590f4141abf3a8c370fab610915733e74134a7270/pydantic_core-2.46.4-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:82cf5301172168103724d49a1444d3378cb20cdee30b116a1bd6031236298a5d", size = 2372986, upload-time = "2026-05-06T13:39:34.152Z" }, + { url = "https://files.pythonhosted.org/packages/5b/24/b375a480d53113860c299764bfe9f349a3dc9108b3adc0d7f0d786492ebf/pydantic_core-2.46.4-cp313-cp313-win32.whl", hash = "sha256:9fa8ae11da9e2b3126c6426f147e0fba88d96d65921799bb30c6abd1cb2c97fb", size = 1973693, upload-time = "2026-05-06T13:37:55.072Z" }, + { url = "https://files.pythonhosted.org/packages/7e/e8/cff247591966f2d22ec8c003cd7587e27b7ba7b81ab2fb888e3ab75dc285/pydantic_core-2.46.4-cp313-cp313-win_amd64.whl", hash = "sha256:6b3ace8194b0e5204818c92802dcdca7fc6d88aabbb799d7c795540d9cd6d292", size = 2071819, upload-time = "2026-05-06T13:38:49.139Z" }, + { url = "https://files.pythonhosted.org/packages/c6/1a/f4aee670d5670e9e148e0c82c7db98d780be566c6e6a97ee8035528ca0b3/pydantic_core-2.46.4-cp313-cp313-win_arm64.whl", hash = "sha256:184c081504d17f1c1066e430e117142b2c77d9448a97f7b65c6ac9fd9aee238d", size = 2027411, upload-time = "2026-05-06T13:40:45.796Z" }, + { url = "https://files.pythonhosted.org/packages/8d/74/228a26ddad29c6672b805d9fd78e8d251cd04004fa7eed0e622096cd0250/pydantic_core-2.46.4-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:428e04521a40150c85216fc8b85e8d39fece235a9cf5e383761238c7fa9b96fb", size = 2102079, upload-time = "2026-05-06T13:38:41.019Z" }, + { url = "https://files.pythonhosted.org/packages/ad/1f/8970b150a4b4365623ae00fc88603491f763c627311ae8031e3111356d6e/pydantic_core-2.46.4-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:23ace664830ee0bfe014a0c7bc248b1f7f25ed7ad103852c317624a1083af462", size = 1952179, upload-time = "2026-05-06T13:36:59.812Z" }, + { url = "https://files.pythonhosted.org/packages/95/30/5211a831ae054928054b2f79731661087a2bc5c01e825c672b3a4a8f1b3e/pydantic_core-2.46.4-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ce5c1d2a8b27468f433ca974829c44060b8097eedc39933e3c206a90ee49c4a9", size = 1978926, upload-time = "2026-05-06T13:37:39.933Z" }, + { url = "https://files.pythonhosted.org/packages/57/e9/689668733b1eb67adeef047db3c2e8788fcf65a7fd9c9e2b46b7744fe245/pydantic_core-2.46.4-cp314-cp314-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:7283d57845ecf5a163403eb0702dfc220cc4fbdd18919cb5ccea4f95ee1cdab4", size = 2046785, upload-time = "2026-05-06T13:38:01.995Z" }, + { url = "https://files.pythonhosted.org/packages/60/d9/6715260422ff50a2109878fd24d948a6c3446bb2664f34ee78cd972b3acd/pydantic_core-2.46.4-cp314-cp314-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8daafc69c93ee8a0204506a3b6b30f586ef54028f52aeeeb5c4cfc5184fd5914", size = 2228733, upload-time = "2026-05-06T13:40:50.371Z" }, + { url = "https://files.pythonhosted.org/packages/18/ae/fdb2f64316afca925640f8e70bb1a564b0ec2721c1389e25b8eb4bf9a299/pydantic_core-2.46.4-cp314-cp314-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cd2213145bcc2ba85884d0ac63d222fece9209678f77b9b4d76f054c561adb28", size = 2307534, upload-time = "2026-05-06T13:37:21.531Z" }, + { url = "https://files.pythonhosted.org/packages/89/1d/8eff589b45bb8190a9d12c49cfad0f176a5cbd1534908a6b5125e2886239/pydantic_core-2.46.4-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7a5f930472650a82629163023e630d160863fce524c616f4e5186e5de9d9a49b", size = 2099732, upload-time = "2026-05-06T13:39:31.942Z" }, + { url = "https://files.pythonhosted.org/packages/06/d5/ee5a3366637fee41dee51a1fc91562dcf12ddbc68fda34e6b253da2324bb/pydantic_core-2.46.4-cp314-cp314-manylinux_2_31_riscv64.whl", hash = "sha256:c1b3f518abeca3aa13c712fd202306e145abf59a18b094a6bafb2d2bbf59192c", size = 2129627, upload-time = "2026-05-06T13:37:25.033Z" }, + { url = "https://files.pythonhosted.org/packages/94/33/2414be571d2c6a6c4d08be21f9292b6d3fdb08949a97b6dfe985017821db/pydantic_core-2.46.4-cp314-cp314-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:1a7dd0b3ee80d90150e3495a3a13ac34dbcbfd4f012996a6a1d8900e91b5c0fb", size = 2179141, upload-time = "2026-05-06T13:37:14.046Z" }, + { url = "https://files.pythonhosted.org/packages/7b/79/7daa95be995be0eecc4cf75064cb33f9bbbfe3fe0158caf2f0d4a996a5c7/pydantic_core-2.46.4-cp314-cp314-musllinux_1_1_aarch64.whl", hash = "sha256:3fb702cd90b0446a3a1c5e470bfa0dd23c0233b676a9099ddcc964fa6ca13898", size = 2184325, upload-time = "2026-05-06T13:36:53.615Z" }, + { url = "https://files.pythonhosted.org/packages/9f/cb/d0a382f5c0de8a222dc61c65348e0ce831b1f68e0a018450d31c2cace3a5/pydantic_core-2.46.4-cp314-cp314-musllinux_1_1_armv7l.whl", hash = "sha256:b8458003118a712e66286df6a707db01c52c0f52f7db8e4a38f0da1d3b94fc4e", size = 2323990, upload-time = "2026-05-06T13:40:29.971Z" }, + { url = "https://files.pythonhosted.org/packages/05/db/d9ba624cc4a5aced1598e88c04fdbd8310c8a69b9d38b9a3d39ce3a61ed7/pydantic_core-2.46.4-cp314-cp314-musllinux_1_1_x86_64.whl", hash = "sha256:372429a130e469c9cd698925ce5fc50940b7a1336b0d82038e63d5bbc4edc519", size = 2369978, upload-time = "2026-05-06T13:37:23.027Z" }, + { url = "https://files.pythonhosted.org/packages/f2/20/d15df15ba918c423461905802bfd2981c3af0bfa0e40d05e13edbfa48bc3/pydantic_core-2.46.4-cp314-cp314-win32.whl", hash = "sha256:85bb3611ff1802f3ee7fdd7dbff26b56f343fb432d57a4728fdd49b6ef35e2f4", size = 1966354, upload-time = "2026-05-06T13:38:03.499Z" }, + { url = "https://files.pythonhosted.org/packages/fc/b6/6b8de4c0a7d7ab3004c439c80c5c1e0a3e8d78bbae19379b01960383d9e5/pydantic_core-2.46.4-cp314-cp314-win_amd64.whl", hash = "sha256:811ff8e9c313ab425368bcbb36e5c4ebd7108c2bbf4e4089cfbb0b01eff63fac", size = 2072238, upload-time = "2026-05-06T13:39:40.807Z" }, + { url = "https://files.pythonhosted.org/packages/32/36/51eb763beec1f4cf59b1db243a7dcc39cbb41230f050a09b9d69faaf0a48/pydantic_core-2.46.4-cp314-cp314-win_arm64.whl", hash = "sha256:bfec22eab3c8cc2ceec0248aec886624116dc079afa027ecc8ad4a7e62010f8a", size = 2018251, upload-time = "2026-05-06T13:37:26.72Z" }, + { url = "https://files.pythonhosted.org/packages/e8/91/855af51d625b23aa987116a19e231d2aaef9c4a415273ddc189b79a45fee/pydantic_core-2.46.4-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:af8244b2bef6aaad6d92cda81372de7f8c8d36c9f0c3ea36e827c60e7d9467a0", size = 2099593, upload-time = "2026-05-06T13:39:47.682Z" }, + { url = "https://files.pythonhosted.org/packages/fb/1b/8784a54c65edb5f49f0a14d6977cf1b209bba85a4c77445b255c2de58ab3/pydantic_core-2.46.4-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:5a4330cdbc57162e4b3aa303f588ba752257694c9c9be3e7ebb11b4aca659b5d", size = 1935226, upload-time = "2026-05-06T13:40:40.428Z" }, + { url = "https://files.pythonhosted.org/packages/e8/e7/1955d28d1afc56dd4b3ad7cc0cf39df1b9852964cf16e5d13912756d6d6b/pydantic_core-2.46.4-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:29c61fc04a3d840155ff08e475a04809278972fe6aef51e2720554e96367e34b", size = 1974605, upload-time = "2026-05-06T13:37:32.029Z" }, + { url = "https://files.pythonhosted.org/packages/93/e2/3fedbf0ba7a22850e6e9fd78117f1c0f10f950182344d8a6c535d468fdd8/pydantic_core-2.46.4-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:c50f2528cf200c5eed56faf3f4e22fcd5f38c157a8b78576e6ba3168ec35f000", size = 2030777, upload-time = "2026-05-06T13:38:55.239Z" }, + { url = "https://files.pythonhosted.org/packages/f8/61/46be275fcaaba0b4f5b9669dd852267ce1ff616592dccf7a7845588df091/pydantic_core-2.46.4-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0cbe8b01f948de4286c74cdd6c667aceb38f5c1e26f0693b3983d9d74887c65e", size = 2236641, upload-time = "2026-05-06T13:37:08.096Z" }, + { url = "https://files.pythonhosted.org/packages/60/db/12e93e46a8bac9988be3c016860f83293daea8c716c029c9ace279036f2f/pydantic_core-2.46.4-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:617d7e2ca7dcb8c5cf6bcb8c59b8832c94b36196bbf1cbd1bfb56ed341905edd", size = 2286404, upload-time = "2026-05-06T13:40:20.221Z" }, + { url = "https://files.pythonhosted.org/packages/e2/4a/4d8b19008f38d31c53b8219cfedc2e3d5de5fe99d90076b7e767de29274f/pydantic_core-2.46.4-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7027560ee92211647d0d34e3f7cd6f50da56399d26a9c8ad0da286d3869a53f3", size = 2109219, upload-time = "2026-05-06T13:38:12.153Z" }, + { url = "https://files.pythonhosted.org/packages/88/70/3cbc40978fefb7bb09c6708d40d4ad1a5d70fd7213c3d17f971de868ec1f/pydantic_core-2.46.4-cp314-cp314t-manylinux_2_31_riscv64.whl", hash = "sha256:f99626688942fb746e545232e7726926f3be91b5975f8b55327665fafda991c7", size = 2110594, upload-time = "2026-05-06T13:40:02.971Z" }, + { url = "https://files.pythonhosted.org/packages/9d/20/b8d36736216e29491125531685b2f9e61aa5b4b2599893f8268551da3338/pydantic_core-2.46.4-cp314-cp314t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:fc3e9034a63de20e15e8ade85358bc6efc614008cab72898b4b4952bea0509ff", size = 2159542, upload-time = "2026-05-06T13:39:27.506Z" }, + { url = "https://files.pythonhosted.org/packages/1d/a2/367df868eb584dacf6bf82a389272406d7178e301c4ac82545ab98bc2dd9/pydantic_core-2.46.4-cp314-cp314t-musllinux_1_1_aarch64.whl", hash = "sha256:97e7cf2be5c77b7d1a9713a05605d49460d02c6078d38d8bef3cbe323c548424", size = 2168146, upload-time = "2026-05-06T13:38:31.93Z" }, + { url = "https://files.pythonhosted.org/packages/c1/b8/4460f77f7e201893f649a29ab355dddd3beee8a97bcb1a320db414f9a06e/pydantic_core-2.46.4-cp314-cp314t-musllinux_1_1_armv7l.whl", hash = "sha256:3bf92c5d0e00fefaab325a4d27828fe6b6e2a21848686b5b60d2d9eeb09d76c6", size = 2306309, upload-time = "2026-05-06T13:37:44.717Z" }, + { url = "https://files.pythonhosted.org/packages/64/c4/be2639293acd87dc8ddbcec41a73cee9b2ebf996fe6d892a1a74e88ad3f7/pydantic_core-2.46.4-cp314-cp314t-musllinux_1_1_x86_64.whl", hash = "sha256:3ecbc122d18468d06ca279dc26a8c2e2d5acb10943bb35e36ae92096dc3b5565", size = 2369736, upload-time = "2026-05-06T13:37:05.645Z" }, + { url = "https://files.pythonhosted.org/packages/30/a6/9f9f380dbb301f67023bf8f707aaa75daadf84f7152d95c410fd7e81d994/pydantic_core-2.46.4-cp314-cp314t-win32.whl", hash = "sha256:e846ae7835bf0703ae43f534ab79a867146dadd59dc9ca5c8b53d5c8f7c9ef02", size = 1955575, upload-time = "2026-05-06T13:38:51.116Z" }, + { url = "https://files.pythonhosted.org/packages/40/1f/f1eb9eb350e795d1af8586289746f5c5677d16043040d63710e22abc43c9/pydantic_core-2.46.4-cp314-cp314t-win_amd64.whl", hash = "sha256:2108ba5c1c1eca18030634489dc544844144ee36357f2f9f780b93e7ddbb44b5", size = 2051624, upload-time = "2026-05-06T13:38:21.672Z" }, + { url = "https://files.pythonhosted.org/packages/f6/d2/42dd53d0a85c27606f316d3aa5d2869c4e8470a5ed6dec30e4a1abe19192/pydantic_core-2.46.4-cp314-cp314t-win_arm64.whl", hash = "sha256:4fcbe087dbc2068af7eda3aa87634eba216dbda64d1ae73c8684b621d33f6596", size = 2017325, upload-time = "2026-05-06T13:40:52.723Z" }, + { url = "https://files.pythonhosted.org/packages/9d/1d/8987ad40f65ae1432753072f214fb5c74fe47ffbd0698bb9cbbb585664f8/pydantic_core-2.46.4-graalpy312-graalpy250_312_native-macosx_10_12_x86_64.whl", hash = "sha256:1d8ba486450b14f3b1d63bc521d410ec7565e52f887b9fb671791886436a42f7", size = 2095527, upload-time = "2026-05-06T13:39:52.283Z" }, + { url = "https://files.pythonhosted.org/packages/64/d3/84c282a7eee1d3ac4c0377546ef5a1ea436ce26840d9ac3b7ed54a377507/pydantic_core-2.46.4-graalpy312-graalpy250_312_native-macosx_11_0_arm64.whl", hash = "sha256:3009f12e4e90b7f88b4f9adb1b0c4a3d58fe7820f3238c190047209d148026df", size = 1936024, upload-time = "2026-05-06T13:40:15.671Z" }, + { url = "https://files.pythonhosted.org/packages/d7/ca/eac61596cdeb4d7e174d3dc0bd8a6238f14f75f97a24e7b7db4c7e7340a0/pydantic_core-2.46.4-graalpy312-graalpy250_312_native-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ad785e92e6dc634c21555edc8bd6b64957ab844541bcb96a1366c202951ae526", size = 1990696, upload-time = "2026-05-06T13:38:34.717Z" }, + { url = "https://files.pythonhosted.org/packages/fa/c3/7c8b240552251faf6b3a957db200fcfbbcec36763c050428b601e0c9b83b/pydantic_core-2.46.4-graalpy312-graalpy250_312_native-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:00c603d540afdd6b80eb39f078f33ebd46211f02f33e34a32d9f053bba711de0", size = 2147590, upload-time = "2026-05-06T13:39:29.883Z" }, +] + +[[package]] +name = "pydantic-extra-types" +version = "2.11.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pydantic" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/66/71/dba38ee2651f84f7842206adbd2233d8bbdb59fb85e9fa14232486a8c471/pydantic_extra_types-2.11.1.tar.gz", hash = "sha256:46792d2307383859e923d8fcefa82108b1a141f8a9c0198982b3832ab5ef1049", size = 172002, upload-time = "2026-03-16T08:08:03.92Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/17/c1/3226e6d7f5a4f736f38ac11a6fbb262d701889802595cdb0f53a885ac2e0/pydantic_extra_types-2.11.1-py3-none-any.whl", hash = "sha256:1722ea2bddae5628ace25f2aa685b69978ef533123e5638cfbddb999e0100ec1", size = 79526, upload-time = "2026-03-16T08:08:02.533Z" }, +] + +[[package]] +name = "pydantic-settings" +version = "2.14.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pydantic" }, + { name = "python-dotenv" }, + { name = "typing-inspection" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/07/60/1d1e59c9c90d54591469ada7d268251f71c24bdb765f1a8a832cee8c6653/pydantic_settings-2.14.1.tar.gz", hash = "sha256:e874d3bec7e787b0c9958277956ed9b4dd5de6a80e162188fdaff7c5e26fd5fa", size = 235551, upload-time = "2026-05-08T13:40:06.542Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ae/8d/f1af3832f5e6eb13ba94ee809e72b8ecb5eef226d27ee0bef7d963d943c7/pydantic_settings-2.14.1-py3-none-any.whl", hash = "sha256:6e3c7edfd8277687cdc598f56e5cff0e9bfff0910a3749deaa8d4401c3a2b9de", size = 60964, upload-time = "2026-05-08T13:40:04.958Z" }, +] + +[[package]] +name = "pygments" +version = "2.20.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/c3/b2/bc9c9196916376152d655522fdcebac55e66de6603a76a02bca1b6414f6c/pygments-2.20.0.tar.gz", hash = "sha256:6757cd03768053ff99f3039c1a36d6c0aa0b263438fcab17520b30a303a82b5f", size = 4955991, upload-time = "2026-03-29T13:29:33.898Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/f4/7e/a72dd26f3b0f4f2bf1dd8923c85f7ceb43172af56d63c7383eb62b332364/pygments-2.20.0-py3-none-any.whl", hash = "sha256:81a9e26dd42fd28a23a2d169d86d7ac03b46e2f8b59ed4698fb4785f946d0176", size = 1231151, upload-time = "2026-03-29T13:29:30.038Z" }, +] + +[[package]] +name = "pynput" +version = "1.8.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "evdev", marker = "'linux' in sys_platform" }, + { name = "pyobjc-framework-applicationservices", marker = "sys_platform == 'darwin'" }, + { name = "pyobjc-framework-quartz", marker = "sys_platform == 'darwin'" }, + { name = "python-xlib", marker = "'linux' in sys_platform" }, + { name = "six" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/86/c6/e2d415610cfbc78308bee44218a46124aaa3301b1df08814df819b2254a1/pynput-1.8.2.tar.gz", hash = "sha256:f493c87157cd3861b4468f7f896857051762f44ed26f1b641e7cc5840a457087", size = 82818, upload-time = "2026-05-12T19:11:39.464Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/6d/98/bbeb760852adb27f166ce1617f0e51aabb15f21b1e60ea703f2aed3c78ac/pynput-1.8.2-py2.py3-none-any.whl", hash = "sha256:8cc38cf13a6ab2749cb375678be8a0fd705d7ce49c8001ff5db4007a723bbef1", size = 92028, upload-time = "2026-05-12T19:11:37.89Z" }, +] + +[[package]] +name = "pyobjc-core" +version = "12.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/2a/e8/a6cc12669211e7c9b29e8f26bf2159e67c7a73555dc229018abf46d8167a/pyobjc_core-12.2.tar.gz", hash = "sha256:51d7de4cfa32f508c6a7aac31f131b12d5e196a8dcf588e6e8d7e6337224f66d", size = 1062064, upload-time = "2026-05-30T12:29:55.417Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/24/be/4771f4fd786f0e1a2bd6d8931a72a5f3929b7bb1b28a1fe6ca8a08371c55/pyobjc_core-12.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:7677ed758a367bbbb5589d6f5276fb360a45c89168276c26162f61840b0fa03d", size = 6421145, upload-time = "2026-05-30T10:17:41.992Z" }, + { url = "https://files.pythonhosted.org/packages/d6/ed/6e62d038992bc7ef9091d95ec97c3c221686fe52a993a6501e961c757613/pyobjc_core-12.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:9287c7c46d6ae8676b4c6c0389a8f4b5381f42ae53a47151900c08b157e5a992", size = 6428611, upload-time = "2026-05-30T10:21:33.83Z" }, + { url = "https://files.pythonhosted.org/packages/bf/0b/d492110202f4d1050a5e590620ebd1e730cf89f9880a26cf18205e0f5800/pyobjc_core-12.2-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:515ecf2afe168301feb66a7230d700584ce2e4b8a0ac178e19450b8898384139", size = 6677992, upload-time = "2026-05-30T10:44:13.039Z" }, + { url = "https://files.pythonhosted.org/packages/2e/b2/ecfbd0c80e7688ed6f3db23414758443c69c3a9d318f2036e26530ede955/pyobjc_core-12.2-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:a51352e478785cd7fce1604b9902125a286139caea0759cb340e59d75b594992", size = 6421372, upload-time = "2026-05-30T10:47:27.907Z" }, + { url = "https://files.pythonhosted.org/packages/2b/89/ecd5cb62573fba9a95f8bdb838a9860a360907104a0724af6611d3b20512/pyobjc_core-12.2-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:3137b2d14f9f2154fb5b1c092c38d15e164f68ab190c18335d76e4e7e1583f79", size = 6676789, upload-time = "2026-05-30T10:59:33.811Z" }, + { url = "https://files.pythonhosted.org/packages/74/24/5091d156b19df0f657127f42b08eada11c9b9cc5df49fedb91bb354d9821/pyobjc_core-12.2-cp315-cp315-macosx_10_15_universal2.whl", hash = "sha256:1e4216f2ec962dc13cf7f31b9bc3a7190337a0f401e7dc9de6b2d8c08b9dbb7a", size = 6476112, upload-time = "2026-05-30T11:21:46.914Z" }, + { url = "https://files.pythonhosted.org/packages/77/e2/ee91ea8a0ad28e759f351ed8654027c34fc62ad5e207672522025a6a3fc2/pyobjc_core-12.2-cp315-cp315t-macosx_10_15_universal2.whl", hash = "sha256:ac952bac8057dd0b97ee7b311c39f97cad7430b7cfbd67ca0a30135a7d17d2ab", size = 6718365, upload-time = "2026-05-30T11:51:47.35Z" }, +] + +[[package]] +name = "pyobjc-framework-applicationservices" +version = "12.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pyobjc-core", marker = "sys_platform != 'linux'" }, + { name = "pyobjc-framework-cocoa", marker = "sys_platform != 'linux'" }, + { name = "pyobjc-framework-coretext", marker = "sys_platform != 'linux'" }, + { name = "pyobjc-framework-quartz", marker = "sys_platform != 'linux'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/a9/ab/1776ac62687cb3d81e59517ca55970f26efa5a96bbf3ebcea57afcdd6b06/pyobjc_framework_applicationservices-12.2.tar.gz", hash = "sha256:4f6c4027405f709872e5b098f3cd86961bdf262fb80679a548725a02171bb0cf", size = 109325, upload-time = "2026-05-30T12:30:18.7Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b8/e4/0c7c5a48f88ab7510365559facf060f7c059dd4d5e39571d07d96a2b84a8/pyobjc_framework_applicationservices-12.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:36a03ae7168657379e3ad96397f3ebb15e6c617b96901a919c7610ce2de0007a", size = 32736, upload-time = "2026-05-30T11:52:38.386Z" }, + { url = "https://files.pythonhosted.org/packages/4b/28/8c85ef2dff09fb4c6adf2161bf1d32ff81dca497863682ba46107e38bbb9/pyobjc_framework_applicationservices-12.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:7119c75ad2c0e21b0bd44865641944e691e80abce0d5805fa344730238b16b15", size = 32754, upload-time = "2026-05-30T11:52:41.299Z" }, + { url = "https://files.pythonhosted.org/packages/61/ee/4be28e61319055092d3a963514c2fb4daba86785d4044f073a4135273bb0/pyobjc_framework_applicationservices-12.2-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:0492c478b175005f38c887523f895382a9ed47c0810ab786c6712d3fda245832", size = 33017, upload-time = "2026-05-30T11:52:44.534Z" }, + { url = "https://files.pythonhosted.org/packages/c6/60/43c4e2697971bb9ec7766d6fe00861ef2055f3fa7d733c407676fcd5cbac/pyobjc_framework_applicationservices-12.2-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:d157ace1d768665f180cf9711fb31ddb29006e5df545e7e3ebf2be5054c6170d", size = 32896, upload-time = "2026-05-30T11:52:47.456Z" }, + { url = "https://files.pythonhosted.org/packages/03/12/4f0662012b77b9c15afb6c52fa92e069d2a6793dcfcd9864bfef4c7d3c4b/pyobjc_framework_applicationservices-12.2-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:9be6f6866f532fca35f7d62f27f43df6a95c8b195030d44b9d68ed63ecb1e1f0", size = 33135, upload-time = "2026-05-30T11:52:50.587Z" }, + { url = "https://files.pythonhosted.org/packages/36/9d/91c93ad58e6b52035da745c2ddcbb32018a03091d9f139e077f53089a002/pyobjc_framework_applicationservices-12.2-cp315-cp315-macosx_10_15_universal2.whl", hash = "sha256:01afa4ef373edc58cd3fa55f5fe5d7db5dda22b8e6ff65f743a509180149dab7", size = 32888, upload-time = "2026-05-30T11:52:53.487Z" }, + { url = "https://files.pythonhosted.org/packages/33/f5/c25b153ea0be05a749915bc45b4f9d85e7d84d2fbafc81efe68cae29540e/pyobjc_framework_applicationservices-12.2-cp315-cp315t-macosx_10_15_universal2.whl", hash = "sha256:8e14e97fc6bbedc95479f7b408f00e3b4aaaafafc23f9e2a955210beca15b474", size = 33128, upload-time = "2026-05-30T11:52:56.477Z" }, +] + +[[package]] +name = "pyobjc-framework-cocoa" +version = "12.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pyobjc-core", marker = "sys_platform != 'linux'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/6d/cc/927169225e72bab9c9b44285656768fb75052a0bc85fdbca62740e1ca43c/pyobjc_framework_cocoa-12.2.tar.gz", hash = "sha256:20b392e2b7241caad0538dfde12143343e5dfe48f72e7df660a7548e635903dc", size = 3125555, upload-time = "2026-05-30T12:35:09.273Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/30/66/5a91f2eddfced4f26bc2df2bcebb7f5f10c5bf5666aff6fa00ded845af07/pyobjc_framework_cocoa-12.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:06cb92d97d1af9d1f459ae6cf1d1a7b824c12d3aff1b709885966acd6b7208c2", size = 388093, upload-time = "2026-05-30T11:58:14.921Z" }, + { url = "https://files.pythonhosted.org/packages/3f/3b/1af2be2bf5204bbcfc94de215d5f87d35348c9982d9b05f54ceefbc53b8f/pyobjc_framework_cocoa-12.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:f0bbe0abedfb24b11ff6c71e26cdefb0df001c6482f95591fad40c2688c16498", size = 388154, upload-time = "2026-05-30T11:58:38.547Z" }, + { url = "https://files.pythonhosted.org/packages/41/cb/c0435d64f1199210af36141b90aea2ae3344719f7313d4160b8b0dd527db/pyobjc_framework_cocoa-12.2-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:46b6681e2b21b099ed095339c140f2c8137d6ac5658653166ee90722f9e3c621", size = 392245, upload-time = "2026-05-30T11:59:02.436Z" }, + { url = "https://files.pythonhosted.org/packages/56/4b/df8e359e5e422e8f1430bde038aa64364e8c1d4542d7f6fcc4f8a97ec0b7/pyobjc_framework_cocoa-12.2-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:aecfd44908fa12a9291fb6ca2458ebbc611102de6784f2202a35fd5ed9f56c60", size = 388334, upload-time = "2026-05-30T11:59:25.861Z" }, + { url = "https://files.pythonhosted.org/packages/43/a2/68c0702cc9d6dbc7077edbd13ccc9aa30ac589d514f51ad6f5c3840e3bf1/pyobjc_framework_cocoa-12.2-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:ef679740f541c52118149b558b757d1f11d9dcf30c2a23344b13a6af6a99a1ab", size = 392376, upload-time = "2026-05-30T11:59:50.031Z" }, + { url = "https://files.pythonhosted.org/packages/83/c3/e170672302e75cc1aa833546fb0d5a3bd4a126ede4124566d5a2e4a50cd6/pyobjc_framework_cocoa-12.2-cp315-cp315-macosx_10_15_universal2.whl", hash = "sha256:290e544a8c2d0786a34a359d825eaad44ebaaa3b30cdd765b2755422ca39a0d2", size = 388566, upload-time = "2026-05-30T12:00:13.606Z" }, + { url = "https://files.pythonhosted.org/packages/f7/6b/78e98e4de11646e56cf98066f9f84b43c86adc8b273a660d85a6ceba7a31/pyobjc_framework_cocoa-12.2-cp315-cp315t-macosx_10_15_universal2.whl", hash = "sha256:5a0bed77b0b56074cc2b4564aae3e6e9d5da5fdf93252f50b6dbced0f7fece3a", size = 392674, upload-time = "2026-05-30T12:00:37.572Z" }, +] + +[[package]] +name = "pyobjc-framework-coretext" +version = "12.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pyobjc-core", marker = "sys_platform != 'linux'" }, + { name = "pyobjc-framework-cocoa", marker = "sys_platform != 'linux'" }, + { name = "pyobjc-framework-quartz", marker = "sys_platform != 'linux'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/1f/b0/e7ef99240f853d4dddde82c9c0114cc525de7355661b2bf2d5e04cfb1582/pyobjc_framework_coretext-12.2.tar.gz", hash = "sha256:82def2c281347e0677866315675124c84c36e9bc21651d62870cfdcecb7da34e", size = 97343, upload-time = "2026-05-30T12:37:00.996Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/72/8a/52cef4b31d5a6d3c9c426759bd256229fbf6757efec1b7f1ba5c2d051621/pyobjc_framework_coretext-12.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:c1845fbdb96f605c7146c478c5d562961d77aadba6cc40e166fade08e11a730f", size = 30091, upload-time = "2026-05-30T12:05:17.568Z" }, + { url = "https://files.pythonhosted.org/packages/cc/db/783ae8290da2edb57b479fc474c7d66a319f4fd5f1f32dd642af1fd962ec/pyobjc_framework_coretext-12.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:09daa6b6befea7c0d673a037d02ed13bb4443ed65d8948329ba6c8a08e06c763", size = 30087, upload-time = "2026-05-30T12:05:20.422Z" }, + { url = "https://files.pythonhosted.org/packages/0c/58/6d0a37fed6eee8ed4c950f71cc98355e8ce8d3a38c19aba1bf7ff6ac5441/pyobjc_framework_coretext-12.2-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:867e6f56c1c7703f27a7328d42d37cd184151657a3026cf46c0de207cc90a46c", size = 30635, upload-time = "2026-05-30T12:05:23.59Z" }, + { url = "https://files.pythonhosted.org/packages/26/22/3c6dbe97cb5b121b01f61d575bf202238b0cd6f39f22f15d94179461b677/pyobjc_framework_coretext-12.2-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:88b9e705d47a663f079f6ebbca54f5b57f305bb639d5a9d943231596653520d7", size = 30075, upload-time = "2026-05-30T12:05:26.195Z" }, + { url = "https://files.pythonhosted.org/packages/6c/28/ffd7807c835010839678c6a43b7aa66d956816becb035c2371b8d03325b6/pyobjc_framework_coretext-12.2-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:dec9a67529615fbcc7c11a9a655e8d17a6095d94807e5df11e0bda55b37f0190", size = 30614, upload-time = "2026-05-30T12:05:28.997Z" }, + { url = "https://files.pythonhosted.org/packages/4c/49/8c56735a3758b6570e98a22861becf514057db33abe48f7bfd6e7f533b91/pyobjc_framework_coretext-12.2-cp315-cp315-macosx_10_15_universal2.whl", hash = "sha256:639ba39b119f24198184abf878bc1633355fecb36f8eab57f32956252df30d40", size = 30080, upload-time = "2026-05-30T12:05:31.979Z" }, + { url = "https://files.pythonhosted.org/packages/0a/0a/5c881e86eda55bd4c7d33e7e93a8ef3b327e06203bfe45e16b7f8af0a3e8/pyobjc_framework_coretext-12.2-cp315-cp315t-macosx_10_15_universal2.whl", hash = "sha256:06bcb4e7de281423c212a39b3dc9873f09d9fd69da0abe93d987a59761bf265a", size = 30641, upload-time = "2026-05-30T12:05:34.814Z" }, +] + +[[package]] +name = "pyobjc-framework-quartz" +version = "12.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pyobjc-core", marker = "sys_platform != 'linux'" }, + { name = "pyobjc-framework-cocoa", marker = "sys_platform != 'linux'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/91/a3/5ae4c90c13999b46315f549694f25c374c48a9f7ab18f98ace6e74f4a5c1/pyobjc_framework_quartz-12.2.tar.gz", hash = "sha256:b343395d4790323b0376fe20c83ac468510ba19f65429323ca211708c939d107", size = 3215525, upload-time = "2026-05-30T12:44:27.759Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/96/98/3b1fa78ddb1cd10d0edd4d49a3d00301d941f535694ac444fbed53ec7504/pyobjc_framework_quartz-12.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:8b238979d62b6e0b90d466477eee968d8f2f6720e850af2472e01cef349293b4", size = 218969, upload-time = "2026-05-30T12:19:58.528Z" }, + { url = "https://files.pythonhosted.org/packages/96/56/670a847a3a8ee2799f405b876a2f20914f22b4865f1d8157169095c21d94/pyobjc_framework_quartz-12.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:214c19aadfd100d9202994a22fbced804f7d60f8473de6f292111cc1668f9373", size = 219383, upload-time = "2026-05-30T12:20:12.444Z" }, + { url = "https://files.pythonhosted.org/packages/35/ef/598bd4d1fb796305648c03667938f08bb59ed4e0bcdc1591fd2c6238abf2/pyobjc_framework_quartz-12.2-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:4e0634ee9782e480587a074d1d08867fa7ef0d845c2f6cbaef6a48b7d2c3899f", size = 224436, upload-time = "2026-05-30T12:20:26.608Z" }, + { url = "https://files.pythonhosted.org/packages/11/b4/7ec90f6480b554173df109b570915c26d286c414d9444d2066fc93567781/pyobjc_framework_quartz-12.2-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:08f7c7b42de70875cee15f4d0e217471e382ffac44d0a5bcfd30f583b9b41adb", size = 219749, upload-time = "2026-05-30T12:20:40.674Z" }, + { url = "https://files.pythonhosted.org/packages/72/f7/9a6cc42345d7a89c7344763e931476c9bf00d3b16ef1e862b1f720709afe/pyobjc_framework_quartz-12.2-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:57553e7085191f9421ec78fe57a8a0c8462e39d675014ac1e4b389381f04535a", size = 224703, upload-time = "2026-05-30T12:20:54.835Z" }, + { url = "https://files.pythonhosted.org/packages/41/76/a831a11a67fe36898b4b887bfe7694a291e08a96266416a832a9de97bec8/pyobjc_framework_quartz-12.2-cp315-cp315-macosx_10_15_universal2.whl", hash = "sha256:6fbd127d864108103d4980292ffca32bd9c1e5f643e0abd5773fdde2918afaca", size = 219804, upload-time = "2026-05-30T12:21:08.79Z" }, + { url = "https://files.pythonhosted.org/packages/bb/77/3223cef0bf8cc97f1d586ad1b6c79e04bfbe2a47a1fe5bd1ad3abd862325/pyobjc_framework_quartz-12.2-cp315-cp315t-macosx_10_15_universal2.whl", hash = "sha256:359738c88b12427a30d73a3d202002ab910e31eebf6bee4550495ec8aa64a004", size = 224750, upload-time = "2026-05-30T12:21:22.826Z" }, +] + +[[package]] +name = "pyserial" +version = "3.5" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/1e/7d/ae3f0a63f41e4d2f6cb66a5b57197850f919f59e558159a4dd3a818f5082/pyserial-3.5.tar.gz", hash = "sha256:3c77e014170dfffbd816e6ffc205e9842efb10be9f58ec16d3e8675b4925cddb", size = 159125, upload-time = "2020-11-23T03:59:15.045Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/07/bc/587a445451b253b285629263eb51c2d8e9bcea4fc97826266d186f96f558/pyserial-3.5-py2.py3-none-any.whl", hash = "sha256:c4451db6ba391ca6ca299fb3ec7bae67a5c55dde170964c7a14ceefec02f2cf0", size = 90585, upload-time = "2020-11-23T03:59:13.41Z" }, +] + +[[package]] +name = "pytest" +version = "9.0.3" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "iniconfig" }, + { name = "packaging" }, + { name = "pluggy" }, + { name = "pygments" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/7d/0d/549bd94f1a0a402dc8cf64563a117c0f3765662e2e668477624baeec44d5/pytest-9.0.3.tar.gz", hash = "sha256:b86ada508af81d19edeb213c681b1d48246c1a91d304c6c81a427674c17eb91c", size = 1572165, upload-time = "2026-04-07T17:16:18.027Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d4/24/a372aaf5c9b7208e7112038812994107bc65a84cd00e0354a88c2c77a617/pytest-9.0.3-py3-none-any.whl", hash = "sha256:2c5efc453d45394fdd706ade797c0a81091eccd1d6e4bccfcd476e2b8e0ab5d9", size = 375249, upload-time = "2026-04-07T17:16:16.13Z" }, +] + +[[package]] +name = "pytest-asyncio" +version = "1.4.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pytest" }, + { name = "typing-extensions", marker = "python_full_version < '3.13'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/43/7c/d36d04db312ecf4298932ef77e6e4a9e8ad017906e24e34f0b0c361a2473/pytest_asyncio-1.4.0.tar.gz", hash = "sha256:c6c0d2259945122819f171a32ecea2c349ead889ee28176caaf492143424be42", size = 58514, upload-time = "2026-05-26T09:56:04.083Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/03/e2/08a497ef684b88559c9cc5f4ad53a37e7b99e727094a86d6ea32536d5d3c/pytest_asyncio-1.4.0-py3-none-any.whl", hash = "sha256:933ca923a23075a87fb7070c0ec272a6848489824d887c85c812670932835aa1", size = 16930, upload-time = "2026-05-26T09:56:02.576Z" }, +] + +[[package]] +name = "python-dateutil" +version = "2.9.0.post0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "six" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/66/c0/0c8b6ad9f17a802ee498c46e004a0eb49bc148f2fd230864601a86dcf6db/python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3", size = 342432, upload-time = "2024-03-01T18:36:20.211Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ec/57/56b9bcc3c9c6a792fcbaf139543cee77261f3651ca9da0c93f5c1221264b/python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427", size = 229892, upload-time = "2024-03-01T18:36:18.57Z" }, +] + +[[package]] +name = "python-discovery" +version = "1.4.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "filelock" }, + { name = "platformdirs" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/a6/12/38c1a0b1e64806780c9563e3fc9f6e472251839662587cfbe9bfaf2ae10a/python_discovery-1.4.0.tar.gz", hash = "sha256:eb8bc7daad3c226c147e45bb4e970a1feb1bf4048ee178e6db59e197b8010ce3", size = 68455, upload-time = "2026-05-28T01:15:37.639Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/c8/8d/3d316429f65029532bb1e28ff77b797d86b5ac3915bb44ca4e19aa283d43/python_discovery-1.4.0-py3-none-any.whl", hash = "sha256:26ed78d703e234879a66244c7d4114563fb13ec5cd30a2d1357e5fb4850782da", size = 33217, upload-time = "2026-05-28T01:15:36.573Z" }, +] + +[[package]] +name = "python-dotenv" +version = "1.2.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/82/ed/0301aeeac3e5353ef3d94b6ec08bbcabd04a72018415dcb29e588514bba8/python_dotenv-1.2.2.tar.gz", hash = "sha256:2c371a91fbd7ba082c2c1dc1f8bf89ca22564a087c2c287cd9b662adde799cf3", size = 50135, upload-time = "2026-03-01T16:00:26.196Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0b/d7/1959b9648791274998a9c3526f6d0ec8fd2233e4d4acce81bbae76b44b2a/python_dotenv-1.2.2-py3-none-any.whl", hash = "sha256:1d8214789a24de455a8b8bd8ae6fe3c6b69a5e3d64aa8a8e5d68e694bbcb285a", size = 22101, upload-time = "2026-03-01T16:00:25.09Z" }, +] + +[[package]] +name = "python-multipart" +version = "0.0.32" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/5b/42/55c32bb9b12693c092ad250a0e82edb5b31ddeda6eb772de5f308b3804ad/python_multipart-0.0.32.tar.gz", hash = "sha256:be54b7f3fa167bb83e4fcd936b887b708f4e57fe75911c02aebf53efaf8d938e", size = 46881, upload-time = "2026-06-04T16:18:58.647Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e1/04/e8135ebd1ad02c56ec633277529b2602ff99ff634be76cdba5744cf554fd/python_multipart-0.0.32-py3-none-any.whl", hash = "sha256:ff6d3f776f16878c894e52e107296ffc890e913c611b1a4ec6c44e2821fe2e23", size = 30042, upload-time = "2026-06-04T16:18:57.319Z" }, +] + +[[package]] +name = "python-xlib" +version = "0.33" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "six" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/86/f5/8c0653e5bb54e0cbdfe27bf32d41f27bc4e12faa8742778c17f2a71be2c0/python-xlib-0.33.tar.gz", hash = "sha256:55af7906a2c75ce6cb280a584776080602444f75815a7aff4d287bb2d7018b32", size = 269068, upload-time = "2022-12-25T18:53:00.824Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/fc/b8/ff33610932e0ee81ae7f1269c890f697d56ff74b9f5b2ee5d9b7fa2c5355/python_xlib-0.33-py2.py3-none-any.whl", hash = "sha256:c3534038d42e0df2f1392a1b30a15a4ff5fdc2b86cfa94f072bf11b10a164398", size = 182185, upload-time = "2022-12-25T18:52:58.662Z" }, +] + +[[package]] +name = "pytz" +version = "2026.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/ff/46/dd499ec9038423421951e4fad73051febaa13d2df82b4064f87af8b8c0c3/pytz-2026.2.tar.gz", hash = "sha256:0e60b47b29f21574376f218fe21abc009894a2321ea16c6754f3cad6eb7cdd6a", size = 320861, upload-time = "2026-05-04T01:35:29.667Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ec/dd/96da98f892250475bdf2328112d7468abdd4acc7b902b6af23f4ed958ea0/pytz-2026.2-py2.py3-none-any.whl", hash = "sha256:04156e608bee23d3792fd45c94ae47fae1036688e75032eea2e3bf0323d1f126", size = 510141, upload-time = "2026-05-04T01:35:27.408Z" }, +] + +[[package]] +name = "pyyaml" +version = "6.0.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/05/8e/961c0007c59b8dd7729d542c61a4d537767a59645b82a0b521206e1e25c2/pyyaml-6.0.3.tar.gz", hash = "sha256:d76623373421df22fb4cf8817020cbb7ef15c725b9d5e45f17e189bfc384190f", size = 130960, upload-time = "2025-09-25T21:33:16.546Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/33/422b98d2195232ca1826284a76852ad5a86fe23e31b009c9886b2d0fb8b2/pyyaml-6.0.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:7f047e29dcae44602496db43be01ad42fc6f1cc0d8cd6c83d342306c32270196", size = 182063, upload-time = "2025-09-25T21:32:11.445Z" }, + { url = "https://files.pythonhosted.org/packages/89/a0/6cf41a19a1f2f3feab0e9c0b74134aa2ce6849093d5517a0c550fe37a648/pyyaml-6.0.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:fc09d0aa354569bc501d4e787133afc08552722d3ab34836a80547331bb5d4a0", size = 173973, upload-time = "2025-09-25T21:32:12.492Z" }, + { url = "https://files.pythonhosted.org/packages/ed/23/7a778b6bd0b9a8039df8b1b1d80e2e2ad78aa04171592c8a5c43a56a6af4/pyyaml-6.0.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9149cad251584d5fb4981be1ecde53a1ca46c891a79788c0df828d2f166bda28", size = 775116, upload-time = "2025-09-25T21:32:13.652Z" }, + { url = "https://files.pythonhosted.org/packages/65/30/d7353c338e12baef4ecc1b09e877c1970bd3382789c159b4f89d6a70dc09/pyyaml-6.0.3-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:5fdec68f91a0c6739b380c83b951e2c72ac0197ace422360e6d5a959d8d97b2c", size = 844011, upload-time = "2025-09-25T21:32:15.21Z" }, + { url = "https://files.pythonhosted.org/packages/8b/9d/b3589d3877982d4f2329302ef98a8026e7f4443c765c46cfecc8858c6b4b/pyyaml-6.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ba1cc08a7ccde2d2ec775841541641e4548226580ab850948cbfda66a1befcdc", size = 807870, upload-time = "2025-09-25T21:32:16.431Z" }, + { url = "https://files.pythonhosted.org/packages/05/c0/b3be26a015601b822b97d9149ff8cb5ead58c66f981e04fedf4e762f4bd4/pyyaml-6.0.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:8dc52c23056b9ddd46818a57b78404882310fb473d63f17b07d5c40421e47f8e", size = 761089, upload-time = "2025-09-25T21:32:17.56Z" }, + { url = "https://files.pythonhosted.org/packages/be/8e/98435a21d1d4b46590d5459a22d88128103f8da4c2d4cb8f14f2a96504e1/pyyaml-6.0.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:41715c910c881bc081f1e8872880d3c650acf13dfa8214bad49ed4cede7c34ea", size = 790181, upload-time = "2025-09-25T21:32:18.834Z" }, + { url = "https://files.pythonhosted.org/packages/74/93/7baea19427dcfbe1e5a372d81473250b379f04b1bd3c4c5ff825e2327202/pyyaml-6.0.3-cp312-cp312-win32.whl", hash = "sha256:96b533f0e99f6579b3d4d4995707cf36df9100d67e0c8303a0c55b27b5f99bc5", size = 137658, upload-time = "2025-09-25T21:32:20.209Z" }, + { url = "https://files.pythonhosted.org/packages/86/bf/899e81e4cce32febab4fb42bb97dcdf66bc135272882d1987881a4b519e9/pyyaml-6.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:5fcd34e47f6e0b794d17de1b4ff496c00986e1c83f7ab2fb8fcfe9616ff7477b", size = 154003, upload-time = "2025-09-25T21:32:21.167Z" }, + { url = "https://files.pythonhosted.org/packages/1a/08/67bd04656199bbb51dbed1439b7f27601dfb576fb864099c7ef0c3e55531/pyyaml-6.0.3-cp312-cp312-win_arm64.whl", hash = "sha256:64386e5e707d03a7e172c0701abfb7e10f0fb753ee1d773128192742712a98fd", size = 140344, upload-time = "2025-09-25T21:32:22.617Z" }, + { url = "https://files.pythonhosted.org/packages/d1/11/0fd08f8192109f7169db964b5707a2f1e8b745d4e239b784a5a1dd80d1db/pyyaml-6.0.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:8da9669d359f02c0b91ccc01cac4a67f16afec0dac22c2ad09f46bee0697eba8", size = 181669, upload-time = "2025-09-25T21:32:23.673Z" }, + { url = "https://files.pythonhosted.org/packages/b1/16/95309993f1d3748cd644e02e38b75d50cbc0d9561d21f390a76242ce073f/pyyaml-6.0.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:2283a07e2c21a2aa78d9c4442724ec1eb15f5e42a723b99cb3d822d48f5f7ad1", size = 173252, upload-time = "2025-09-25T21:32:25.149Z" }, + { url = "https://files.pythonhosted.org/packages/50/31/b20f376d3f810b9b2371e72ef5adb33879b25edb7a6d072cb7ca0c486398/pyyaml-6.0.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ee2922902c45ae8ccada2c5b501ab86c36525b883eff4255313a253a3160861c", size = 767081, upload-time = "2025-09-25T21:32:26.575Z" }, + { url = "https://files.pythonhosted.org/packages/49/1e/a55ca81e949270d5d4432fbbd19dfea5321eda7c41a849d443dc92fd1ff7/pyyaml-6.0.3-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:a33284e20b78bd4a18c8c2282d549d10bc8408a2a7ff57653c0cf0b9be0afce5", size = 841159, upload-time = "2025-09-25T21:32:27.727Z" }, + { url = "https://files.pythonhosted.org/packages/74/27/e5b8f34d02d9995b80abcef563ea1f8b56d20134d8f4e5e81733b1feceb2/pyyaml-6.0.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0f29edc409a6392443abf94b9cf89ce99889a1dd5376d94316ae5145dfedd5d6", size = 801626, upload-time = "2025-09-25T21:32:28.878Z" }, + { url = "https://files.pythonhosted.org/packages/f9/11/ba845c23988798f40e52ba45f34849aa8a1f2d4af4b798588010792ebad6/pyyaml-6.0.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:f7057c9a337546edc7973c0d3ba84ddcdf0daa14533c2065749c9075001090e6", size = 753613, upload-time = "2025-09-25T21:32:30.178Z" }, + { url = "https://files.pythonhosted.org/packages/3d/e0/7966e1a7bfc0a45bf0a7fb6b98ea03fc9b8d84fa7f2229e9659680b69ee3/pyyaml-6.0.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:eda16858a3cab07b80edaf74336ece1f986ba330fdb8ee0d6c0d68fe82bc96be", size = 794115, upload-time = "2025-09-25T21:32:31.353Z" }, + { url = "https://files.pythonhosted.org/packages/de/94/980b50a6531b3019e45ddeada0626d45fa85cbe22300844a7983285bed3b/pyyaml-6.0.3-cp313-cp313-win32.whl", hash = "sha256:d0eae10f8159e8fdad514efdc92d74fd8d682c933a6dd088030f3834bc8e6b26", size = 137427, upload-time = "2025-09-25T21:32:32.58Z" }, + { url = "https://files.pythonhosted.org/packages/97/c9/39d5b874e8b28845e4ec2202b5da735d0199dbe5b8fb85f91398814a9a46/pyyaml-6.0.3-cp313-cp313-win_amd64.whl", hash = "sha256:79005a0d97d5ddabfeeea4cf676af11e647e41d81c9a7722a193022accdb6b7c", size = 154090, upload-time = "2025-09-25T21:32:33.659Z" }, + { url = "https://files.pythonhosted.org/packages/73/e8/2bdf3ca2090f68bb3d75b44da7bbc71843b19c9f2b9cb9b0f4ab7a5a4329/pyyaml-6.0.3-cp313-cp313-win_arm64.whl", hash = "sha256:5498cd1645aa724a7c71c8f378eb29ebe23da2fc0d7a08071d89469bf1d2defb", size = 140246, upload-time = "2025-09-25T21:32:34.663Z" }, + { url = "https://files.pythonhosted.org/packages/9d/8c/f4bd7f6465179953d3ac9bc44ac1a8a3e6122cf8ada906b4f96c60172d43/pyyaml-6.0.3-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:8d1fab6bb153a416f9aeb4b8763bc0f22a5586065f86f7664fc23339fc1c1fac", size = 181814, upload-time = "2025-09-25T21:32:35.712Z" }, + { url = "https://files.pythonhosted.org/packages/bd/9c/4d95bb87eb2063d20db7b60faa3840c1b18025517ae857371c4dd55a6b3a/pyyaml-6.0.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:34d5fcd24b8445fadc33f9cf348c1047101756fd760b4dacb5c3e99755703310", size = 173809, upload-time = "2025-09-25T21:32:36.789Z" }, + { url = "https://files.pythonhosted.org/packages/92/b5/47e807c2623074914e29dabd16cbbdd4bf5e9b2db9f8090fa64411fc5382/pyyaml-6.0.3-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:501a031947e3a9025ed4405a168e6ef5ae3126c59f90ce0cd6f2bfc477be31b7", size = 766454, upload-time = "2025-09-25T21:32:37.966Z" }, + { url = "https://files.pythonhosted.org/packages/02/9e/e5e9b168be58564121efb3de6859c452fccde0ab093d8438905899a3a483/pyyaml-6.0.3-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:b3bc83488de33889877a0f2543ade9f70c67d66d9ebb4ac959502e12de895788", size = 836355, upload-time = "2025-09-25T21:32:39.178Z" }, + { url = "https://files.pythonhosted.org/packages/88/f9/16491d7ed2a919954993e48aa941b200f38040928474c9e85ea9e64222c3/pyyaml-6.0.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c458b6d084f9b935061bc36216e8a69a7e293a2f1e68bf956dcd9e6cbcd143f5", size = 794175, upload-time = "2025-09-25T21:32:40.865Z" }, + { url = "https://files.pythonhosted.org/packages/dd/3f/5989debef34dc6397317802b527dbbafb2b4760878a53d4166579111411e/pyyaml-6.0.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:7c6610def4f163542a622a73fb39f534f8c101d690126992300bf3207eab9764", size = 755228, upload-time = "2025-09-25T21:32:42.084Z" }, + { url = "https://files.pythonhosted.org/packages/d7/ce/af88a49043cd2e265be63d083fc75b27b6ed062f5f9fd6cdc223ad62f03e/pyyaml-6.0.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:5190d403f121660ce8d1d2c1bb2ef1bd05b5f68533fc5c2ea899bd15f4399b35", size = 789194, upload-time = "2025-09-25T21:32:43.362Z" }, + { url = "https://files.pythonhosted.org/packages/23/20/bb6982b26a40bb43951265ba29d4c246ef0ff59c9fdcdf0ed04e0687de4d/pyyaml-6.0.3-cp314-cp314-win_amd64.whl", hash = "sha256:4a2e8cebe2ff6ab7d1050ecd59c25d4c8bd7e6f400f5f82b96557ac0abafd0ac", size = 156429, upload-time = "2025-09-25T21:32:57.844Z" }, + { url = "https://files.pythonhosted.org/packages/f4/f4/a4541072bb9422c8a883ab55255f918fa378ecf083f5b85e87fc2b4eda1b/pyyaml-6.0.3-cp314-cp314-win_arm64.whl", hash = "sha256:93dda82c9c22deb0a405ea4dc5f2d0cda384168e466364dec6255b293923b2f3", size = 143912, upload-time = "2025-09-25T21:32:59.247Z" }, + { url = "https://files.pythonhosted.org/packages/7c/f9/07dd09ae774e4616edf6cda684ee78f97777bdd15847253637a6f052a62f/pyyaml-6.0.3-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:02893d100e99e03eda1c8fd5c441d8c60103fd175728e23e431db1b589cf5ab3", size = 189108, upload-time = "2025-09-25T21:32:44.377Z" }, + { url = "https://files.pythonhosted.org/packages/4e/78/8d08c9fb7ce09ad8c38ad533c1191cf27f7ae1effe5bb9400a46d9437fcf/pyyaml-6.0.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:c1ff362665ae507275af2853520967820d9124984e0f7466736aea23d8611fba", size = 183641, upload-time = "2025-09-25T21:32:45.407Z" }, + { url = "https://files.pythonhosted.org/packages/7b/5b/3babb19104a46945cf816d047db2788bcaf8c94527a805610b0289a01c6b/pyyaml-6.0.3-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6adc77889b628398debc7b65c073bcb99c4a0237b248cacaf3fe8a557563ef6c", size = 831901, upload-time = "2025-09-25T21:32:48.83Z" }, + { url = "https://files.pythonhosted.org/packages/8b/cc/dff0684d8dc44da4d22a13f35f073d558c268780ce3c6ba1b87055bb0b87/pyyaml-6.0.3-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:a80cb027f6b349846a3bf6d73b5e95e782175e52f22108cfa17876aaeff93702", size = 861132, upload-time = "2025-09-25T21:32:50.149Z" }, + { url = "https://files.pythonhosted.org/packages/b1/5e/f77dc6b9036943e285ba76b49e118d9ea929885becb0a29ba8a7c75e29fe/pyyaml-6.0.3-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:00c4bdeba853cc34e7dd471f16b4114f4162dc03e6b7afcc2128711f0eca823c", size = 839261, upload-time = "2025-09-25T21:32:51.808Z" }, + { url = "https://files.pythonhosted.org/packages/ce/88/a9db1376aa2a228197c58b37302f284b5617f56a5d959fd1763fb1675ce6/pyyaml-6.0.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:66e1674c3ef6f541c35191caae2d429b967b99e02040f5ba928632d9a7f0f065", size = 805272, upload-time = "2025-09-25T21:32:52.941Z" }, + { url = "https://files.pythonhosted.org/packages/da/92/1446574745d74df0c92e6aa4a7b0b3130706a4142b2d1a5869f2eaa423c6/pyyaml-6.0.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:16249ee61e95f858e83976573de0f5b2893b3677ba71c9dd36b9cf8be9ac6d65", size = 829923, upload-time = "2025-09-25T21:32:54.537Z" }, + { url = "https://files.pythonhosted.org/packages/f0/7a/1c7270340330e575b92f397352af856a8c06f230aa3e76f86b39d01b416a/pyyaml-6.0.3-cp314-cp314t-win_amd64.whl", hash = "sha256:4ad1906908f2f5ae4e5a8ddfce73c320c2a1429ec52eafd27138b7f1cbe341c9", size = 174062, upload-time = "2025-09-25T21:32:55.767Z" }, + { url = "https://files.pythonhosted.org/packages/f1/12/de94a39c2ef588c7e6455cfbe7343d3b2dc9d6b6b2f40c4c6565744c873d/pyyaml-6.0.3-cp314-cp314t-win_arm64.whl", hash = "sha256:ebc55a14a21cb14062aa4162f906cd962b28e2e9ea38f9b4391244cd8de4ae0b", size = 149341, upload-time = "2025-09-25T21:32:56.828Z" }, +] + +[[package]] +name = "pyyaml-include" +version = "1.4.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pyyaml" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/7f/be/2d07ad85e3d593d69640876a8686eae2c533db8cb7bf298d25c421b4d2d5/pyyaml-include-1.4.1.tar.gz", hash = "sha256:1a96e33a99a3e56235f5221273832464025f02ff3d8539309a3bf00dec624471", size = 20592, upload-time = "2024-03-25T14:56:43.748Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d5/ca/6a2cc3a73170d10b5af1f1613baa2ed1f8f46f62dd0bfab2bffd2c2fe260/pyyaml_include-1.4.1-py3-none-any.whl", hash = "sha256:323c7f3a19c82fbc4d73abbaab7ef4f793e146a13383866831631b26ccc7fb00", size = 19079, upload-time = "2024-03-25T14:56:41.274Z" }, +] + +[[package]] +name = "requests" +version = "2.34.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "certifi" }, + { name = "charset-normalizer" }, + { name = "idna" }, + { name = "urllib3" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/ac/c3/e2a2b89f2d3e2179abd6d00ebd70bff6273f37fb3e0cc209f48b39d00cbf/requests-2.34.2.tar.gz", hash = "sha256:f288924cae4e29463698d6d60bc6a4da69c89185ad1e0bcc4104f584e960b9ed", size = 142856, upload-time = "2026-05-14T19:25:27.735Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a0/f4/c67b0b3f1b9245e8d266f0f112c500d50e5b4e83cb6f3b71b6528104182a/requests-2.34.2-py3-none-any.whl", hash = "sha256:2a0d60c172f83ac6ab31e4554906c0f3b3588d37b5cb939b1c061f4907e278e0", size = 73075, upload-time = "2026-05-14T19:25:26.443Z" }, +] + +[[package]] +name = "rerun-sdk" +version = "0.26.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "attrs" }, + { name = "numpy" }, + { name = "pillow" }, + { name = "pyarrow" }, + { name = "typing-extensions" }, +] +wheels = [ + { url = "https://files.pythonhosted.org/packages/4b/4a/767c20e1529d74d9be5b5e55c6c26b63a6918ef3c1709fc422d08a460114/rerun_sdk-0.26.2-cp39-abi3-macosx_10_12_x86_64.whl", hash = "sha256:3d4151c9a3484e112b53d1df90c8fa07397dc7b8bfbb420f09e011eff20f1ef2", size = 93349439, upload-time = "2025-10-27T11:34:10.745Z" }, + { url = "https://files.pythonhosted.org/packages/2b/3d/d8dd0af9c287a85d51ec99d69406cc4b94a9feb1d6f192d3bbcaac9f0b81/rerun_sdk-0.26.2-cp39-abi3-macosx_11_0_arm64.whl", hash = "sha256:03977d2aba4966d9a70b682eca196123fda11408fecd733441ede9916c6341e2", size = 86323042, upload-time = "2025-10-27T11:34:17.995Z" }, + { url = "https://files.pythonhosted.org/packages/13/29/53d8d98799ab32418fd4ba6834d6a5749c31f56160d3c87f52a7219887e9/rerun_sdk-0.26.2-cp39-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:b6128c3c4f014cae5be18e4d37657c5932d1bcdb2ce5e9d4b488a6eed47f7437", size = 92677274, upload-time = "2025-10-27T11:34:22.601Z" }, + { url = "https://files.pythonhosted.org/packages/f5/86/0b9c8f56398b4fc85f8e99279907c258413a297e5603f8f2537fe5806e51/rerun_sdk-0.26.2-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:a6f97b60aaa7d4e8c6124a3f6b97ce9dbd09520050955f0e0bdacb72b0eb106a", size = 98768129, upload-time = "2025-10-27T11:34:27.36Z" }, + { url = "https://files.pythonhosted.org/packages/be/e7/99fc91c0f99f69d7d43e1db0a6f6cb8273ffc02111539bfc1fee43749bad/rerun_sdk-0.26.2-cp39-abi3-win_amd64.whl", hash = "sha256:a493ad6c8357022cba2ca6f8954a81d0faf984b0b22154eb1d976bfc7649df63", size = 84267089, upload-time = "2025-10-27T11:34:32.023Z" }, +] + +[[package]] +name = "rich" +version = "15.0.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "markdown-it-py" }, + { name = "pygments" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/c0/8f/0722ca900cc807c13a6a0c696dacf35430f72e0ec571c4275d2371fca3e9/rich-15.0.0.tar.gz", hash = "sha256:edd07a4824c6b40189fb7ac9bc4c52536e9780fbbfbddf6f1e2502c31b068c36", size = 230680, upload-time = "2026-04-12T08:24:00.75Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/82/3b/64d4899d73f91ba49a8c18a8ff3f0ea8f1c1d75481760df8c68ef5235bf5/rich-15.0.0-py3-none-any.whl", hash = "sha256:33bd4ef74232fb73fe9279a257718407f169c09b78a87ad3d296f548e27de0bb", size = 310654, upload-time = "2026-04-12T08:24:02.83Z" }, +] + +[[package]] +name = "rich-toolkit" +version = "0.20.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "click" }, + { name = "rich" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/29/63/3e427c62f1992945c997d4ec31e2fcb37d26aadbe5aa44ae5b29f7f64d26/rich_toolkit-0.20.1.tar.gz", hash = "sha256:c7336ae281f435c785acecaedc4b71d4b663dc73d9c8079fea96372527e822a4", size = 203473, upload-time = "2026-06-05T08:56:57.679Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/00/88/309f07d08155da2ba1d5ceb42d270fb42fbe34a807684543e3ffc10fe713/rich_toolkit-0.20.1-py3-none-any.whl", hash = "sha256:2a6d5f8e15759b9eba5a9ee63da10b275359ead20e5a0fc92bd5b4dbae8ce4bf", size = 35525, upload-time = "2026-06-05T08:56:58.586Z" }, +] + +[[package]] +name = "rignore" +version = "0.7.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/e5/f5/8bed2310abe4ae04b67a38374a4d311dd85220f5d8da56f47ae9361be0b0/rignore-0.7.6.tar.gz", hash = "sha256:00d3546cd793c30cb17921ce674d2c8f3a4b00501cb0e3dd0e82217dbeba2671", size = 57140, upload-time = "2025-11-05T21:41:21.968Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0b/0e/012556ef3047a2628842b44e753bb15f4dc46806780ff090f1e8fe4bf1eb/rignore-0.7.6-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:03e82348cb7234f8d9b2834f854400ddbbd04c0f8f35495119e66adbd37827a8", size = 883488, upload-time = "2025-11-05T20:42:41.359Z" }, + { url = "https://files.pythonhosted.org/packages/93/b0/d4f1f3fe9eb3f8e382d45ce5b0547ea01c4b7e0b4b4eb87bcd66a1d2b888/rignore-0.7.6-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:b9e624f6be6116ea682e76c5feb71ea91255c67c86cb75befe774365b2931961", size = 820411, upload-time = "2025-11-05T20:42:24.782Z" }, + { url = "https://files.pythonhosted.org/packages/4a/c8/dea564b36dedac8de21c18e1851789545bc52a0c22ece9843444d5608a6a/rignore-0.7.6-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bda49950d405aa8d0ebe26af807c4e662dd281d926530f03f29690a2e07d649a", size = 897821, upload-time = "2025-11-05T20:40:52.613Z" }, + { url = "https://files.pythonhosted.org/packages/b3/2b/ee96db17ac1835e024c5d0742eefb7e46de60020385ac883dd3d1cde2c1f/rignore-0.7.6-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:b5fd5ab3840b8c16851d327ed06e9b8be6459702a53e5ab1fc4073b684b3789e", size = 873963, upload-time = "2025-11-05T20:41:07.49Z" }, + { url = "https://files.pythonhosted.org/packages/a5/8c/ad5a57bbb9d14d5c7e5960f712a8a0b902472ea3f4a2138cbf70d1777b75/rignore-0.7.6-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ced2a248352636a5c77504cb755dc02c2eef9a820a44d3f33061ce1bb8a7f2d2", size = 1169216, upload-time = "2025-11-05T20:41:23.73Z" }, + { url = "https://files.pythonhosted.org/packages/80/e6/5b00bc2a6bc1701e6878fca798cf5d9125eb3113193e33078b6fc0d99123/rignore-0.7.6-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a04a3b73b75ddc12c9c9b21efcdaab33ca3832941d6f1d67bffd860941cd448a", size = 942942, upload-time = "2025-11-05T20:41:39.393Z" }, + { url = "https://files.pythonhosted.org/packages/85/e5/7f99bd0cc9818a91d0e8b9acc65b792e35750e3bdccd15a7ee75e64efca4/rignore-0.7.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d24321efac92140b7ec910ac7c53ab0f0c86a41133d2bb4b0e6a7c94967f44dd", size = 959787, upload-time = "2025-11-05T20:42:09.765Z" }, + { url = "https://files.pythonhosted.org/packages/55/54/2ffea79a7c1eabcede1926347ebc2a81bc6b81f447d05b52af9af14948b9/rignore-0.7.6-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:73c7aa109d41e593785c55fdaa89ad80b10330affa9f9d3e3a51fa695f739b20", size = 984245, upload-time = "2025-11-05T20:41:54.062Z" }, + { url = "https://files.pythonhosted.org/packages/41/f7/e80f55dfe0f35787fa482aa18689b9c8251e045076c35477deb0007b3277/rignore-0.7.6-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:1734dc49d1e9501b07852ef44421f84d9f378da9fbeda729e77db71f49cac28b", size = 1078647, upload-time = "2025-11-05T21:40:13.463Z" }, + { url = "https://files.pythonhosted.org/packages/d4/cf/2c64f0b6725149f7c6e7e5a909d14354889b4beaadddaa5fff023ec71084/rignore-0.7.6-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:5719ea14ea2b652c0c0894be5dfde954e1853a80dea27dd2fbaa749618d837f5", size = 1139186, upload-time = "2025-11-05T21:40:31.27Z" }, + { url = "https://files.pythonhosted.org/packages/75/95/a86c84909ccc24af0d094b50d54697951e576c252a4d9f21b47b52af9598/rignore-0.7.6-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:8e23424fc7ce35726854f639cb7968151a792c0c3d9d082f7f67e0c362cfecca", size = 1117604, upload-time = "2025-11-05T21:40:48.07Z" }, + { url = "https://files.pythonhosted.org/packages/7f/5e/13b249613fd5d18d58662490ab910a9f0be758981d1797789913adb4e918/rignore-0.7.6-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:3efdcf1dd84d45f3e2bd2f93303d9be103888f56dfa7c3349b5bf4f0657ec696", size = 1127725, upload-time = "2025-11-05T21:41:05.804Z" }, + { url = "https://files.pythonhosted.org/packages/c7/28/fa5dcd1e2e16982c359128664e3785f202d3eca9b22dd0b2f91c4b3d242f/rignore-0.7.6-cp312-cp312-win32.whl", hash = "sha256:ccca9d1a8b5234c76b71546fc3c134533b013f40495f394a65614a81f7387046", size = 646145, upload-time = "2025-11-05T21:41:51.096Z" }, + { url = "https://files.pythonhosted.org/packages/26/87/69387fb5dd81a0f771936381431780b8cf66fcd2cfe9495e1aaf41548931/rignore-0.7.6-cp312-cp312-win_amd64.whl", hash = "sha256:c96a285e4a8bfec0652e0bfcf42b1aabcdda1e7625f5006d188e3b1c87fdb543", size = 726090, upload-time = "2025-11-05T21:41:36.485Z" }, + { url = "https://files.pythonhosted.org/packages/24/5f/e8418108dcda8087fb198a6f81caadbcda9fd115d61154bf0df4d6d3619b/rignore-0.7.6-cp312-cp312-win_arm64.whl", hash = "sha256:a64a750e7a8277a323f01ca50b7784a764845f6cce2fe38831cb93f0508d0051", size = 656317, upload-time = "2025-11-05T21:41:25.305Z" }, + { url = "https://files.pythonhosted.org/packages/b7/8a/a4078f6e14932ac7edb171149c481de29969d96ddee3ece5dc4c26f9e0c3/rignore-0.7.6-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:2bdab1d31ec9b4fb1331980ee49ea051c0d7f7bb6baa28b3125ef03cdc48fdaf", size = 883057, upload-time = "2025-11-05T20:42:42.741Z" }, + { url = "https://files.pythonhosted.org/packages/f9/8f/f8daacd177db4bf7c2223bab41e630c52711f8af9ed279be2058d2fe4982/rignore-0.7.6-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:90f0a00ce0c866c275bf888271f1dc0d2140f29b82fcf33cdbda1e1a6af01010", size = 820150, upload-time = "2025-11-05T20:42:26.545Z" }, + { url = "https://files.pythonhosted.org/packages/36/31/b65b837e39c3f7064c426754714ac633b66b8c2290978af9d7f513e14aa9/rignore-0.7.6-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c1ad295537041dc2ed4b540fb1a3906bd9ede6ccdad3fe79770cd89e04e3c73c", size = 897406, upload-time = "2025-11-05T20:40:53.854Z" }, + { url = "https://files.pythonhosted.org/packages/ca/58/1970ce006c427e202ac7c081435719a076c478f07b3a23f469227788dc23/rignore-0.7.6-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f782dbd3a65a5ac85adfff69e5c6b101285ef3f845c3a3cae56a54bebf9fe116", size = 874050, upload-time = "2025-11-05T20:41:08.922Z" }, + { url = "https://files.pythonhosted.org/packages/d4/00/eb45db9f90137329072a732273be0d383cb7d7f50ddc8e0bceea34c1dfdf/rignore-0.7.6-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:65cece3b36e5b0826d946494734c0e6aaf5a0337e18ff55b071438efe13d559e", size = 1167835, upload-time = "2025-11-05T20:41:24.997Z" }, + { url = "https://files.pythonhosted.org/packages/f3/f1/6f1d72ddca41a64eed569680587a1236633587cc9f78136477ae69e2c88a/rignore-0.7.6-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d7e4bb66c13cd7602dc8931822c02dfbbd5252015c750ac5d6152b186f0a8be0", size = 941945, upload-time = "2025-11-05T20:41:40.628Z" }, + { url = "https://files.pythonhosted.org/packages/48/6f/2f178af1c1a276a065f563ec1e11e7a9e23d4996fd0465516afce4b5c636/rignore-0.7.6-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:297e500c15766e196f68aaaa70e8b6db85fa23fdc075b880d8231fdfba738cd7", size = 959067, upload-time = "2025-11-05T20:42:11.09Z" }, + { url = "https://files.pythonhosted.org/packages/5b/db/423a81c4c1e173877c7f9b5767dcaf1ab50484a94f60a0b2ed78be3fa765/rignore-0.7.6-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:a07084211a8d35e1a5b1d32b9661a5ed20669970b369df0cf77da3adea3405de", size = 984438, upload-time = "2025-11-05T20:41:55.443Z" }, + { url = "https://files.pythonhosted.org/packages/31/eb/c4f92cc3f2825d501d3c46a244a671eb737fc1bcf7b05a3ecd34abb3e0d7/rignore-0.7.6-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:181eb2a975a22256a1441a9d2f15eb1292839ea3f05606620bd9e1938302cf79", size = 1078365, upload-time = "2025-11-05T21:40:15.148Z" }, + { url = "https://files.pythonhosted.org/packages/26/09/99442f02794bd7441bfc8ed1c7319e890449b816a7493b2db0e30af39095/rignore-0.7.6-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:7bbcdc52b5bf9f054b34ce4af5269df5d863d9c2456243338bc193c28022bd7b", size = 1139066, upload-time = "2025-11-05T21:40:32.771Z" }, + { url = "https://files.pythonhosted.org/packages/2c/88/bcfc21e520bba975410e9419450f4b90a2ac8236b9a80fd8130e87d098af/rignore-0.7.6-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:f2e027a6da21a7c8c0d87553c24ca5cc4364def18d146057862c23a96546238e", size = 1118036, upload-time = "2025-11-05T21:40:49.646Z" }, + { url = "https://files.pythonhosted.org/packages/e2/25/d37215e4562cda5c13312636393aea0bafe38d54d4e0517520a4cc0753ec/rignore-0.7.6-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:ee4a18b82cbbc648e4aac1510066682fe62beb5dc88e2c67c53a83954e541360", size = 1127550, upload-time = "2025-11-05T21:41:07.648Z" }, + { url = "https://files.pythonhosted.org/packages/dc/76/a264ab38bfa1620ec12a8ff1c07778da89e16d8c0f3450b0333020d3d6dc/rignore-0.7.6-cp313-cp313-win32.whl", hash = "sha256:a7d7148b6e5e95035d4390396895adc384d37ff4e06781a36fe573bba7c283e5", size = 646097, upload-time = "2025-11-05T21:41:53.201Z" }, + { url = "https://files.pythonhosted.org/packages/62/44/3c31b8983c29ea8832b6082ddb1d07b90379c2d993bd20fce4487b71b4f4/rignore-0.7.6-cp313-cp313-win_amd64.whl", hash = "sha256:b037c4b15a64dced08fc12310ee844ec2284c4c5c1ca77bc37d0a04f7bff386e", size = 726170, upload-time = "2025-11-05T21:41:38.131Z" }, + { url = "https://files.pythonhosted.org/packages/aa/41/e26a075cab83debe41a42661262f606166157df84e0e02e2d904d134c0d8/rignore-0.7.6-cp313-cp313-win_arm64.whl", hash = "sha256:e47443de9b12fe569889bdbe020abe0e0b667516ee2ab435443f6d0869bd2804", size = 656184, upload-time = "2025-11-05T21:41:27.396Z" }, + { url = "https://files.pythonhosted.org/packages/9a/b9/1f5bd82b87e5550cd843ceb3768b4a8ef274eb63f29333cf2f29644b3d75/rignore-0.7.6-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:8e41be9fa8f2f47239ded8920cc283699a052ac4c371f77f5ac017ebeed75732", size = 882632, upload-time = "2025-11-05T20:42:44.063Z" }, + { url = "https://files.pythonhosted.org/packages/e9/6b/07714a3efe4a8048864e8a5b7db311ba51b921e15268b17defaebf56d3db/rignore-0.7.6-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:6dc1e171e52cefa6c20e60c05394a71165663b48bca6c7666dee4f778f2a7d90", size = 820760, upload-time = "2025-11-05T20:42:27.885Z" }, + { url = "https://files.pythonhosted.org/packages/ac/0f/348c829ea2d8d596e856371b14b9092f8a5dfbb62674ec9b3f67e4939a9d/rignore-0.7.6-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0ce2268837c3600f82ab8db58f5834009dc638ee17103582960da668963bebc5", size = 899044, upload-time = "2025-11-05T20:40:55.336Z" }, + { url = "https://files.pythonhosted.org/packages/f0/30/2e1841a19b4dd23878d73edd5d82e998a83d5ed9570a89675f140ca8b2ad/rignore-0.7.6-cp314-cp314-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:690a3e1b54bfe77e89c4bacb13f046e642f8baadafc61d68f5a726f324a76ab6", size = 874144, upload-time = "2025-11-05T20:41:10.195Z" }, + { url = "https://files.pythonhosted.org/packages/c2/bf/0ce9beb2e5f64c30e3580bef09f5829236889f01511a125f98b83169b993/rignore-0.7.6-cp314-cp314-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:09d12ac7a0b6210c07bcd145007117ebd8abe99c8eeb383e9e4673910c2754b2", size = 1168062, upload-time = "2025-11-05T20:41:26.511Z" }, + { url = "https://files.pythonhosted.org/packages/b9/8b/571c178414eb4014969865317da8a02ce4cf5241a41676ef91a59aab24de/rignore-0.7.6-cp314-cp314-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2a2b2b74a8c60203b08452479b90e5ce3dbe96a916214bc9eb2e5af0b6a9beb0", size = 942542, upload-time = "2025-11-05T20:41:41.838Z" }, + { url = "https://files.pythonhosted.org/packages/19/62/7a3cf601d5a45137a7e2b89d10c05b5b86499190c4b7ca5c3c47d79ee519/rignore-0.7.6-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8fc5a531ef02131e44359419a366bfac57f773ea58f5278c2cdd915f7d10ea94", size = 958739, upload-time = "2025-11-05T20:42:12.463Z" }, + { url = "https://files.pythonhosted.org/packages/5f/1f/4261f6a0d7caf2058a5cde2f5045f565ab91aa7badc972b57d19ce58b14e/rignore-0.7.6-cp314-cp314-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:b7a1f77d9c4cd7e76229e252614d963442686bfe12c787a49f4fe481df49e7a9", size = 984138, upload-time = "2025-11-05T20:41:56.775Z" }, + { url = "https://files.pythonhosted.org/packages/2b/bf/628dfe19c75e8ce1f45f7c248f5148b17dfa89a817f8e3552ab74c3ae812/rignore-0.7.6-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:ead81f728682ba72b5b1c3d5846b011d3e0174da978de87c61645f2ed36659a7", size = 1079299, upload-time = "2025-11-05T21:40:16.639Z" }, + { url = "https://files.pythonhosted.org/packages/af/a5/be29c50f5c0c25c637ed32db8758fdf5b901a99e08b608971cda8afb293b/rignore-0.7.6-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:12ffd50f520c22ffdabed8cd8bfb567d9ac165b2b854d3e679f4bcaef11a9441", size = 1139618, upload-time = "2025-11-05T21:40:34.507Z" }, + { url = "https://files.pythonhosted.org/packages/2a/40/3c46cd7ce4fa05c20b525fd60f599165e820af66e66f2c371cd50644558f/rignore-0.7.6-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:e5a16890fbe3c894f8ca34b0fcacc2c200398d4d46ae654e03bc9b3dbf2a0a72", size = 1117626, upload-time = "2025-11-05T21:40:51.494Z" }, + { url = "https://files.pythonhosted.org/packages/8c/b9/aea926f263b8a29a23c75c2e0d8447965eb1879d3feb53cfcf84db67ed58/rignore-0.7.6-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:3abab3bf99e8a77488ef6c7c9a799fac22224c28fe9f25cc21aa7cc2b72bfc0b", size = 1128144, upload-time = "2025-11-05T21:41:09.169Z" }, + { url = "https://files.pythonhosted.org/packages/a4/f6/0d6242f8d0df7f2ecbe91679fefc1f75e7cd2072cb4f497abaab3f0f8523/rignore-0.7.6-cp314-cp314-win32.whl", hash = "sha256:eeef421c1782953c4375aa32f06ecae470c1285c6381eee2a30d2e02a5633001", size = 646385, upload-time = "2025-11-05T21:41:55.105Z" }, + { url = "https://files.pythonhosted.org/packages/d5/38/c0dcd7b10064f084343d6af26fe9414e46e9619c5f3224b5272e8e5d9956/rignore-0.7.6-cp314-cp314-win_amd64.whl", hash = "sha256:6aeed503b3b3d5af939b21d72a82521701a4bd3b89cd761da1e7dc78621af304", size = 725738, upload-time = "2025-11-05T21:41:39.736Z" }, + { url = "https://files.pythonhosted.org/packages/d9/7a/290f868296c1ece914d565757ab363b04730a728b544beb567ceb3b2d96f/rignore-0.7.6-cp314-cp314-win_arm64.whl", hash = "sha256:104f215b60b3c984c386c3e747d6ab4376d5656478694e22c7bd2f788ddd8304", size = 656008, upload-time = "2025-11-05T21:41:29.028Z" }, + { url = "https://files.pythonhosted.org/packages/ca/d2/3c74e3cd81fe8ea08a8dcd2d755c09ac2e8ad8fe409508904557b58383d3/rignore-0.7.6-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:bb24a5b947656dd94cb9e41c4bc8b23cec0c435b58be0d74a874f63c259549e8", size = 882835, upload-time = "2025-11-05T20:42:45.443Z" }, + { url = "https://files.pythonhosted.org/packages/77/61/a772a34b6b63154877433ac2d048364815b24c2dd308f76b212c408101a2/rignore-0.7.6-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:5b1e33c9501cefe24b70a1eafd9821acfd0ebf0b35c3a379430a14df089993e3", size = 820301, upload-time = "2025-11-05T20:42:29.226Z" }, + { url = "https://files.pythonhosted.org/packages/71/30/054880b09c0b1b61d17eeb15279d8bf729c0ba52b36c3ada52fb827cbb3c/rignore-0.7.6-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bec3994665a44454df86deb762061e05cd4b61e3772f5b07d1882a8a0d2748d5", size = 897611, upload-time = "2025-11-05T20:40:56.475Z" }, + { url = "https://files.pythonhosted.org/packages/1e/40/b2d1c169f833d69931bf232600eaa3c7998ba4f9a402e43a822dad2ea9f2/rignore-0.7.6-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:26cba2edfe3cff1dfa72bddf65d316ddebf182f011f2f61538705d6dbaf54986", size = 873875, upload-time = "2025-11-05T20:41:11.561Z" }, + { url = "https://files.pythonhosted.org/packages/55/59/ca5ae93d83a1a60e44b21d87deb48b177a8db1b85e82fc8a9abb24a8986d/rignore-0.7.6-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ffa86694fec604c613696cb91e43892aa22e1fec5f9870e48f111c603e5ec4e9", size = 1167245, upload-time = "2025-11-05T20:41:28.29Z" }, + { url = "https://files.pythonhosted.org/packages/a5/52/cf3dce392ba2af806cba265aad6bcd9c48bb2a6cb5eee448d3319f6e505b/rignore-0.7.6-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:48efe2ed95aa8104145004afb15cdfa02bea5cdde8b0344afeb0434f0d989aa2", size = 941750, upload-time = "2025-11-05T20:41:43.111Z" }, + { url = "https://files.pythonhosted.org/packages/ec/be/3f344c6218d779395e785091d05396dfd8b625f6aafbe502746fcd880af2/rignore-0.7.6-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8dcae43eb44b7f2457fef7cc87f103f9a0013017a6f4e62182c565e924948f21", size = 958896, upload-time = "2025-11-05T20:42:13.784Z" }, + { url = "https://files.pythonhosted.org/packages/c9/34/d3fa71938aed7d00dcad87f0f9bcb02ad66c85d6ffc83ba31078ce53646a/rignore-0.7.6-cp314-cp314t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2cd649a7091c0dad2f11ef65630d30c698d505cbe8660dd395268e7c099cc99f", size = 983992, upload-time = "2025-11-05T20:41:58.022Z" }, + { url = "https://files.pythonhosted.org/packages/24/a4/52a697158e9920705bdbd0748d59fa63e0f3233fb92e9df9a71afbead6ca/rignore-0.7.6-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:42de84b0289d478d30ceb7ae59023f7b0527786a9a5b490830e080f0e4ea5aeb", size = 1078181, upload-time = "2025-11-05T21:40:18.151Z" }, + { url = "https://files.pythonhosted.org/packages/ac/65/aa76dbcdabf3787a6f0fd61b5cc8ed1e88580590556d6c0207960d2384bb/rignore-0.7.6-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:875a617e57b53b4acbc5a91de418233849711c02e29cc1f4f9febb2f928af013", size = 1139232, upload-time = "2025-11-05T21:40:35.966Z" }, + { url = "https://files.pythonhosted.org/packages/08/44/31b31a49b3233c6842acc1c0731aa1e7fb322a7170612acf30327f700b44/rignore-0.7.6-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:8703998902771e96e49968105207719f22926e4431b108450f3f430b4e268b7c", size = 1117349, upload-time = "2025-11-05T21:40:53.013Z" }, + { url = "https://files.pythonhosted.org/packages/e9/ae/1b199a2302c19c658cf74e5ee1427605234e8c91787cfba0015f2ace145b/rignore-0.7.6-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:602ef33f3e1b04c1e9a10a3c03f8bc3cef2d2383dcc250d309be42b49923cabc", size = 1127702, upload-time = "2025-11-05T21:41:10.881Z" }, + { url = "https://files.pythonhosted.org/packages/fc/d3/18210222b37e87e36357f7b300b7d98c6dd62b133771e71ae27acba83a4f/rignore-0.7.6-cp314-cp314t-win32.whl", hash = "sha256:c1d8f117f7da0a4a96a8daef3da75bc090e3792d30b8b12cfadc240c631353f9", size = 647033, upload-time = "2025-11-05T21:42:00.095Z" }, + { url = "https://files.pythonhosted.org/packages/3e/87/033eebfbee3ec7d92b3bb1717d8f68c88e6fc7de54537040f3b3a405726f/rignore-0.7.6-cp314-cp314t-win_amd64.whl", hash = "sha256:ca36e59408bec81de75d307c568c2d0d410fb880b1769be43611472c61e85c96", size = 725647, upload-time = "2025-11-05T21:41:44.449Z" }, + { url = "https://files.pythonhosted.org/packages/79/62/b88e5879512c55b8ee979c666ee6902adc4ed05007226de266410ae27965/rignore-0.7.6-cp314-cp314t-win_arm64.whl", hash = "sha256:b83adabeb3e8cf662cabe1931b83e165b88c526fa6af6b3aa90429686e474896", size = 656035, upload-time = "2025-11-05T21:41:31.13Z" }, +] + +[[package]] +name = "ruff" +version = "0.15.16" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/a6/bd/5f7ec371001337d8fa61701c186ff8b613ecac1651848c5950f4c4d5f2e9/ruff-0.15.16.tar.gz", hash = "sha256:d05e78d38c78caf020b03789e25106c93017db5a0cb6e2819885018c61343b78", size = 4714267, upload-time = "2026-06-04T16:33:09.974Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0c/42/53ef1c3953f157956db9bf7861e3bc50b9b887ce93300aa48cdba8336fe6/ruff-0.15.16-py3-none-linux_armv6l.whl", hash = "sha256:6ac3c0b3969cc6cf6b158c4e2f8f682acb58e7d700d8a44b65ecdc72d66ab0b2", size = 10709025, upload-time = "2026-06-04T16:32:51.935Z" }, + { url = "https://files.pythonhosted.org/packages/93/9a/a79159346f19134a956607754e57d8d128f7a4c00f4ad2f7514d224c172c/ruff-0.15.16-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:197c207ed75ffba54a0dec23db4aa939a27a3053073e085e0042433cbdc58e4a", size = 11063550, upload-time = "2026-06-04T16:32:42.24Z" }, + { url = "https://files.pythonhosted.org/packages/bc/72/3ce2ac000a5299ec238e01f51397b3b653c93b077d9b1bfe8715bb895f20/ruff-0.15.16-py3-none-macosx_11_0_arm64.whl", hash = "sha256:3a39fec45ab316cc23e7558f23fea4a70403ddb5648ea9a4a3854a16973d0071", size = 10421345, upload-time = "2026-06-04T16:32:37.251Z" }, + { url = "https://files.pythonhosted.org/packages/b0/c2/cc7fad3ec9169373f5b6a18f1917b91080feec40c3f9658334a1d28e2f03/ruff-0.15.16-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ba93191d79003116b95128c9d306e045200fdbd0bccb782b110f3cd1d4abc5cf", size = 10757217, upload-time = "2026-06-04T16:32:54.722Z" }, + { url = "https://files.pythonhosted.org/packages/69/d2/3474009eaa0a65b31fa7152a2fad5e2f050c640ceb1e6b02ee6922e94c82/ruff-0.15.16-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:c6ee4b90520630120ef032aa5cc10db483852dff950e78b1d717e2993a61ac8d", size = 10507035, upload-time = "2026-06-04T16:33:05.343Z" }, + { url = "https://files.pythonhosted.org/packages/ca/81/b7ae6ccbd11f0c8dc3d5d67fc4be9b57ff57ca86ba56152021378e1277f2/ruff-0.15.16-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4e4215bc938bc3c8215c1472c1aa437e310fee20cd427335fec9d7e609563628", size = 11255291, upload-time = "2026-06-04T16:32:49.49Z" }, + { url = "https://files.pythonhosted.org/packages/d9/e1/46e526f1a7cc90857ce6ddf25fbb77eb6568651ac38d71b033af07076dd5/ruff-0.15.16-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7c8d26be963b090f10e29abc8b3e74a2a321f6fa34e02424e30b5af89350ecbb", size = 12124922, upload-time = "2026-06-04T16:33:07.821Z" }, + { url = "https://files.pythonhosted.org/packages/1a/da/5c791b088b596b24d0deb967fa28ae02ad751a140c0b9ea81c5ab915d6c0/ruff-0.15.16-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f198cf4123602a2280ed46c307bcbafe41758d6fee5b456b6b6058ca1514b3b4", size = 11332186, upload-time = "2026-06-04T16:33:02.971Z" }, + { url = "https://files.pythonhosted.org/packages/72/11/5da87abe20047c8962361473923ebb2f62b595250126aadfad8c20649c1e/ruff-0.15.16-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bb27515fa6240fb586ae82b901a59e67d24acff86f2190b433dc542fe0435aeb", size = 11373541, upload-time = "2026-06-04T16:32:47.007Z" }, + { url = "https://files.pythonhosted.org/packages/fe/2a/8554754c23a854ae3fd6b507e36ad61ddb121e298c6d5d617dec94ed0f14/ruff-0.15.16-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:a267c46ba1593fc26b8eecbea050b39d40c0b6bb7781ee11c90a02cd10032951", size = 11353014, upload-time = "2026-06-04T16:32:34.795Z" }, + { url = "https://files.pythonhosted.org/packages/62/25/62ea41529ec89f742ea3fed9cb1059c72877ec7cf9b9e99ac9cf3294d1d9/ruff-0.15.16-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:528c68f39a91498a8d50e91ff5985df3d105782bab49cc378e73ac26bff083e8", size = 10737467, upload-time = "2026-06-04T16:32:26.348Z" }, + { url = "https://files.pythonhosted.org/packages/90/17/334d3ad9de4d40f9dd58fdd09e35ce64553bb501e2f19a839e2fb6be14fc/ruff-0.15.16-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:7ed55c58950df60589a9a7a5d2f8fa5f54ebd287163be805adfe6ee95a9de123", size = 10521910, upload-time = "2026-06-04T16:32:32.54Z" }, + { url = "https://files.pythonhosted.org/packages/4d/bd/3ac7c6ae77a885c1004b3dda2446ea401768d24f851c14b4ad4b24f6639c/ruff-0.15.16-py3-none-musllinux_1_2_i686.whl", hash = "sha256:d482feaf51512b50f9790ceb417a56a61dd1e9d9bf967662b9ed27c01b34f53a", size = 10979190, upload-time = "2026-06-04T16:32:57.492Z" }, + { url = "https://files.pythonhosted.org/packages/33/d7/609546e6a413c3f216fbf2a50c928f97c80939154f6a0503114094a86191/ruff-0.15.16-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:1e15bc8c94513dae2a40cc9ef07c94fdd4ecc9e29dabebeebe170f952322c9e3", size = 11477014, upload-time = "2026-06-04T16:32:44.687Z" }, + { url = "https://files.pythonhosted.org/packages/74/0d/f2cd247ad32633a5c36e97141a2c21b11c6279f7957bc2ff360b1e08fddd/ruff-0.15.16-py3-none-win32.whl", hash = "sha256:580378f7bd4aa25f72e74aa54948a9622f142b1e509521dd10902e886681cc1e", size = 10735541, upload-time = "2026-06-04T16:32:30.145Z" }, + { url = "https://files.pythonhosted.org/packages/8b/9e/02e845ef151b1dee585e55c4739f8e1734ae1d9f1221dff65761c162208b/ruff-0.15.16-py3-none-win_amd64.whl", hash = "sha256:408256017284eddf98fff77b29aa4fb30f586042d535b2d9befc6512f400aaec", size = 11843403, upload-time = "2026-06-04T16:32:39.76Z" }, + { url = "https://files.pythonhosted.org/packages/15/19/016553f86f207450aebebc2b2b5088d086b901cc8186c02ac4284db3bd88/ruff-0.15.16-py3-none-win_arm64.whl", hash = "sha256:8cd61783afb39638a7133ef0d2dfb1e91277593962f81b5a8423eb0b888a6121", size = 11134555, upload-time = "2026-06-04T16:33:00.136Z" }, +] + +[[package]] +name = "safetensors" +version = "0.7.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/29/9c/6e74567782559a63bd040a236edca26fd71bc7ba88de2ef35d75df3bca5e/safetensors-0.7.0.tar.gz", hash = "sha256:07663963b67e8bd9f0b8ad15bb9163606cd27cc5a1b96235a50d8369803b96b0", size = 200878, upload-time = "2025-11-19T15:18:43.199Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/fa/47/aef6c06649039accf914afef490268e1067ed82be62bcfa5b7e886ad15e8/safetensors-0.7.0-cp38-abi3-macosx_10_12_x86_64.whl", hash = "sha256:c82f4d474cf725255d9e6acf17252991c3c8aac038d6ef363a4bf8be2f6db517", size = 467781, upload-time = "2025-11-19T15:18:35.84Z" }, + { url = "https://files.pythonhosted.org/packages/e8/00/374c0c068e30cd31f1e1b46b4b5738168ec79e7689ca82ee93ddfea05109/safetensors-0.7.0-cp38-abi3-macosx_11_0_arm64.whl", hash = "sha256:94fd4858284736bb67a897a41608b5b0c2496c9bdb3bf2af1fa3409127f20d57", size = 447058, upload-time = "2025-11-19T15:18:34.416Z" }, + { url = "https://files.pythonhosted.org/packages/f1/06/578ffed52c2296f93d7fd2d844cabfa92be51a587c38c8afbb8ae449ca89/safetensors-0.7.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e07d91d0c92a31200f25351f4acb2bc6aff7f48094e13ebb1d0fb995b54b6542", size = 491748, upload-time = "2025-11-19T15:18:09.79Z" }, + { url = "https://files.pythonhosted.org/packages/ae/33/1debbbb70e4791dde185edb9413d1fe01619255abb64b300157d7f15dddd/safetensors-0.7.0-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:8469155f4cb518bafb4acf4865e8bb9d6804110d2d9bdcaa78564b9fd841e104", size = 503881, upload-time = "2025-11-19T15:18:16.145Z" }, + { url = "https://files.pythonhosted.org/packages/8e/1c/40c2ca924d60792c3be509833df711b553c60effbd91da6f5284a83f7122/safetensors-0.7.0-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:54bef08bf00a2bff599982f6b08e8770e09cc012d7bba00783fc7ea38f1fb37d", size = 623463, upload-time = "2025-11-19T15:18:21.11Z" }, + { url = "https://files.pythonhosted.org/packages/9b/3a/13784a9364bd43b0d61eef4bea2845039bc2030458b16594a1bd787ae26e/safetensors-0.7.0-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:42cb091236206bb2016d245c377ed383aa7f78691748f3bb6ee1bfa51ae2ce6a", size = 532855, upload-time = "2025-11-19T15:18:25.719Z" }, + { url = "https://files.pythonhosted.org/packages/a0/60/429e9b1cb3fc651937727befe258ea24122d9663e4d5709a48c9cbfceecb/safetensors-0.7.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dac7252938f0696ddea46f5e855dd3138444e82236e3be475f54929f0c510d48", size = 507152, upload-time = "2025-11-19T15:18:33.023Z" }, + { url = "https://files.pythonhosted.org/packages/3c/a8/4b45e4e059270d17af60359713ffd83f97900d45a6afa73aaa0d737d48b6/safetensors-0.7.0-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:1d060c70284127fa805085d8f10fbd0962792aed71879d00864acda69dbab981", size = 541856, upload-time = "2025-11-19T15:18:31.075Z" }, + { url = "https://files.pythonhosted.org/packages/06/87/d26d8407c44175d8ae164a95b5a62707fcc445f3c0c56108e37d98070a3d/safetensors-0.7.0-cp38-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:cdab83a366799fa730f90a4ebb563e494f28e9e92c4819e556152ad55e43591b", size = 674060, upload-time = "2025-11-19T15:18:37.211Z" }, + { url = "https://files.pythonhosted.org/packages/11/f5/57644a2ff08dc6325816ba7217e5095f17269dada2554b658442c66aed51/safetensors-0.7.0-cp38-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:672132907fcad9f2aedcb705b2d7b3b93354a2aec1b2f706c4db852abe338f85", size = 771715, upload-time = "2025-11-19T15:18:38.689Z" }, + { url = "https://files.pythonhosted.org/packages/86/31/17883e13a814bd278ae6e266b13282a01049b0c81341da7fd0e3e71a80a3/safetensors-0.7.0-cp38-abi3-musllinux_1_2_i686.whl", hash = "sha256:5d72abdb8a4d56d4020713724ba81dac065fedb7f3667151c4a637f1d3fb26c0", size = 714377, upload-time = "2025-11-19T15:18:40.162Z" }, + { url = "https://files.pythonhosted.org/packages/4a/d8/0c8a7dc9b41dcac53c4cbf9df2b9c83e0e0097203de8b37a712b345c0be5/safetensors-0.7.0-cp38-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:b0f6d66c1c538d5a94a73aa9ddca8ccc4227e6c9ff555322ea40bdd142391dd4", size = 677368, upload-time = "2025-11-19T15:18:41.627Z" }, + { url = "https://files.pythonhosted.org/packages/05/e5/cb4b713c8a93469e3c5be7c3f8d77d307e65fe89673e731f5c2bfd0a9237/safetensors-0.7.0-cp38-abi3-win32.whl", hash = "sha256:c74af94bf3ac15ac4d0f2a7c7b4663a15f8c2ab15ed0fc7531ca61d0835eccba", size = 326423, upload-time = "2025-11-19T15:18:45.74Z" }, + { url = "https://files.pythonhosted.org/packages/5d/e6/ec8471c8072382cb91233ba7267fd931219753bb43814cbc71757bfd4dab/safetensors-0.7.0-cp38-abi3-win_amd64.whl", hash = "sha256:d1239932053f56f3456f32eb9625590cc7582e905021f94636202a864d470755", size = 341380, upload-time = "2025-11-19T15:18:44.427Z" }, +] + +[[package]] +name = "sentry-sdk" +version = "2.61.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "certifi" }, + { name = "urllib3" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/63/3b/4bc6b348bbd331daa14d4babe9f2b99bc854f4da41560eefb9488d78481d/sentry_sdk-2.61.1.tar.gz", hash = "sha256:9c6adccb3feefa9ba032c8d295ca477575c2f11896046a2b0ad686c47c4af555", size = 459429, upload-time = "2026-06-01T07:24:18.875Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/df/54/c9218db183846e08efaf68534889ef42e499dde432778881104a42f7071b/sentry_sdk-2.61.1-py3-none-any.whl", hash = "sha256:fa36eaf4b8ad708f718500d4bdcc1532637526a22beb874d88cbc0a46458b5ae", size = 483735, upload-time = "2026-06-01T07:24:17.027Z" }, +] + +[[package]] +name = "setuptools" +version = "80.10.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/76/95/faf61eb8363f26aa7e1d762267a8d602a1b26d4f3a1e758e92cb3cb8b054/setuptools-80.10.2.tar.gz", hash = "sha256:8b0e9d10c784bf7d262c4e5ec5d4ec94127ce206e8738f29a437945fbc219b70", size = 1200343, upload-time = "2026-01-25T22:38:17.252Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/94/b8/f1f62a5e3c0ad2ff1d189590bfa4c46b4f3b6e49cef6f26c6ee4e575394d/setuptools-80.10.2-py3-none-any.whl", hash = "sha256:95b30ddfb717250edb492926c92b5221f7ef3fbcc2b07579bcd4a27da21d0173", size = 1064234, upload-time = "2026-01-25T22:38:15.216Z" }, +] + +[[package]] +name = "shellingham" +version = "1.5.4" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/58/15/8b3609fd3830ef7b27b655beb4b4e9c62313a4e8da8c676e142cc210d58e/shellingham-1.5.4.tar.gz", hash = "sha256:8dbca0739d487e5bd35ab3ca4b36e11c4078f3a234bfce294b0a0291363404de", size = 10310, upload-time = "2023-10-24T04:13:40.426Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e0/f9/0595336914c5619e5f28a1fb793285925a8cd4b432c9da0a987836c7f822/shellingham-1.5.4-py2.py3-none-any.whl", hash = "sha256:7ecfff8f2fd72616f7481040475a65b2bf8af90a56c89140852d1120324e8686", size = 9755, upload-time = "2023-10-24T04:13:38.866Z" }, +] + +[[package]] +name = "six" +version = "1.17.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/94/e7/b2c673351809dca68a0e064b6af791aa332cf192da575fd474ed7d6f16a2/six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81", size = 34031, upload-time = "2024-12-04T17:35:28.174Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b7/ce/149a00dd41f10bc29e5921b496af8b574d8413afcd5e30dfa0ed46c2cc5e/six-1.17.0-py2.py3-none-any.whl", hash = "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274", size = 11050, upload-time = "2024-12-04T17:35:26.475Z" }, +] + +[[package]] +name = "smmap" +version = "5.0.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/1f/ea/49c993d6dfdd7338c9b1000a0f36817ed7ec84577ae2e52f890d1a4ff909/smmap-5.0.3.tar.gz", hash = "sha256:4d9debb8b99007ae47165abc08670bd74cb74b5227dda7f643eccc4e9eb5642c", size = 22506, upload-time = "2026-03-09T03:43:26.1Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/c1/d4/59e74daffcb57a07668852eeeb6035af9f32cbfd7a1d2511f17d2fe6a738/smmap-5.0.3-py3-none-any.whl", hash = "sha256:c106e05d5a61449cf6ba9a1e650227ecfb141590d2a98412103ff35d89fc7b2f", size = 24390, upload-time = "2026-03-09T03:43:24.361Z" }, +] + +[[package]] +name = "starlette" +version = "1.2.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "anyio" }, + { name = "typing-extensions", marker = "python_full_version < '3.13'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/25/44/ec35f1b6e83094b997da438a02c8c9b0ade2b1e84cfc48bd4656780760a6/starlette-1.2.1.tar.gz", hash = "sha256:9b9b5ebb992e67d6093741e63c2f59e4f6fff986f81163c087867bd7b924b3f6", size = 2701854, upload-time = "2026-05-31T01:07:51.847Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/1c/54/196d0c1db10af76baa4f64894448505d60d3cdf70ef92cbb35f46a4e4c71/starlette-1.2.1-py3-none-any.whl", hash = "sha256:4de0082d08c8f6764a85a54cf1120d6939507a19905c7768acad2a9f875d2b89", size = 73350, upload-time = "2026-05-31T01:07:50.09Z" }, +] + +[[package]] +name = "sympy" +version = "1.14.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "mpmath" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/83/d3/803453b36afefb7c2bb238361cd4ae6125a569b4db67cd9e79846ba2d68c/sympy-1.14.0.tar.gz", hash = "sha256:d3d3fe8df1e5a0b42f0e7bdf50541697dbe7d23746e894990c030e2b05e72517", size = 7793921, upload-time = "2025-04-27T18:05:01.611Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a2/09/77d55d46fd61b4a135c444fc97158ef34a095e5681d0a6c10b75bf356191/sympy-1.14.0-py3-none-any.whl", hash = "sha256:e091cc3e99d2141a0ba2847328f5479b05d94a6635cb96148ccb3f34671bd8f5", size = 6299353, upload-time = "2025-04-27T18:04:59.103Z" }, +] + +[[package]] +name = "termcolor" +version = "3.3.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/46/79/cf31d7a93a8fdc6aa0fbb665be84426a8c5a557d9240b6239e9e11e35fc5/termcolor-3.3.0.tar.gz", hash = "sha256:348871ca648ec6a9a983a13ab626c0acce02f515b9e1983332b17af7979521c5", size = 14434, upload-time = "2025-12-29T12:55:21.882Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/33/d1/8bb87d21e9aeb323cc03034f5eaf2c8f69841e40e4853c2627edf8111ed3/termcolor-3.3.0-py3-none-any.whl", hash = "sha256:cf642efadaf0a8ebbbf4bc7a31cec2f9b5f21a9f726f4ccbb08192c9c26f43a5", size = 7734, upload-time = "2025-12-29T12:55:20.718Z" }, +] + +[[package]] +name = "toml" +version = "0.10.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/be/ba/1f744cdc819428fc6b5084ec34d9b30660f6f9daaf70eead706e3203ec3c/toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f", size = 22253, upload-time = "2020-11-01T01:40:22.204Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/44/6f/7120676b6d73228c96e17f1f794d8ab046fc910d781c8d151120c3f1569e/toml-0.10.2-py2.py3-none-any.whl", hash = "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b", size = 16588, upload-time = "2020-11-01T01:40:20.672Z" }, +] + +[[package]] +name = "torch" +version = "2.10.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "cuda-bindings", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" }, + { name = "filelock" }, + { name = "fsspec" }, + { name = "jinja2" }, + { name = "networkx" }, + { name = "nvidia-cublas-cu12", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" }, + { name = "nvidia-cuda-cupti-cu12", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" }, + { name = "nvidia-cuda-nvrtc-cu12", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" }, + { name = "nvidia-cuda-runtime-cu12", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" }, + { name = "nvidia-cudnn-cu12", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" }, + { name = "nvidia-cufft-cu12", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" }, + { name = "nvidia-cufile-cu12", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" }, + { name = "nvidia-curand-cu12", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" }, + { name = "nvidia-cusolver-cu12", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" }, + { name = "nvidia-cusparse-cu12", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" }, + { name = "nvidia-cusparselt-cu12", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" }, + { name = "nvidia-nccl-cu12", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" }, + { name = "nvidia-nvjitlink-cu12", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" }, + { name = "nvidia-nvshmem-cu12", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" }, + { name = "nvidia-nvtx-cu12", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" }, + { name = "setuptools" }, + { name = "sympy" }, + { name = "triton", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" }, + { name = "typing-extensions" }, +] +wheels = [ + { url = "https://files.pythonhosted.org/packages/d3/54/a2ba279afcca44bbd320d4e73675b282fcee3d81400ea1b53934efca6462/torch-2.10.0-2-cp312-none-macosx_11_0_arm64.whl", hash = "sha256:13ec4add8c3faaed8d13e0574f5cd4a323c11655546f91fbe6afa77b57423574", size = 79498202, upload-time = "2026-02-10T21:44:52.603Z" }, + { url = "https://files.pythonhosted.org/packages/ec/23/2c9fe0c9c27f7f6cb865abcea8a4568f29f00acaeadfc6a37f6801f84cb4/torch-2.10.0-2-cp313-none-macosx_11_0_arm64.whl", hash = "sha256:e521c9f030a3774ed770a9c011751fb47c4d12029a3d6522116e48431f2ff89e", size = 79498254, upload-time = "2026-02-10T21:44:44.095Z" }, + { url = "https://files.pythonhosted.org/packages/b3/7a/abada41517ce0011775f0f4eacc79659bc9bc6c361e6bfe6f7052a6b9363/torch-2.10.0-3-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:98c01b8bb5e3240426dcde1446eed6f40c778091c8544767ef1168fc663a05a6", size = 915622781, upload-time = "2026-03-11T14:17:11.354Z" }, + { url = "https://files.pythonhosted.org/packages/ab/c6/4dfe238342ffdcec5aef1c96c457548762d33c40b45a1ab7033bb26d2ff2/torch-2.10.0-3-cp313-cp313-manylinux_2_28_x86_64.whl", hash = "sha256:80b1b5bfe38eb0e9f5ff09f206dcac0a87aadd084230d4a36eea5ec5232c115b", size = 915627275, upload-time = "2026-03-11T14:16:11.325Z" }, + { url = "https://files.pythonhosted.org/packages/d8/f0/72bf18847f58f877a6a8acf60614b14935e2f156d942483af1ffc081aea0/torch-2.10.0-3-cp313-cp313t-manylinux_2_28_x86_64.whl", hash = "sha256:46b3574d93a2a8134b3f5475cfb98e2eb46771794c57015f6ad1fb795ec25e49", size = 915523474, upload-time = "2026-03-11T14:17:44.422Z" }, + { url = "https://files.pythonhosted.org/packages/f4/39/590742415c3030551944edc2ddc273ea1fdfe8ffb2780992e824f1ebee98/torch-2.10.0-3-cp314-cp314-manylinux_2_28_x86_64.whl", hash = "sha256:b1d5e2aba4eb7f8e87fbe04f86442887f9167a35f092afe4c237dfcaaef6e328", size = 915632474, upload-time = "2026-03-11T14:15:13.666Z" }, + { url = "https://files.pythonhosted.org/packages/b6/8e/34949484f764dde5b222b7fe3fede43e4a6f0da9d7f8c370bb617d629ee2/torch-2.10.0-3-cp314-cp314t-manylinux_2_28_x86_64.whl", hash = "sha256:0228d20b06701c05a8f978357f657817a4a63984b0c90745def81c18aedfa591", size = 915523882, upload-time = "2026-03-11T14:14:46.311Z" }, + { url = "https://files.pythonhosted.org/packages/cc/af/758e242e9102e9988969b5e621d41f36b8f258bb4a099109b7a4b4b50ea4/torch-2.10.0-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:5fd4117d89ffd47e3dcc71e71a22efac24828ad781c7e46aaaf56bf7f2796acf", size = 145996088, upload-time = "2026-01-21T16:24:44.171Z" }, + { url = "https://files.pythonhosted.org/packages/23/8e/3c74db5e53bff7ed9e34c8123e6a8bfef718b2450c35eefab85bb4a7e270/torch-2.10.0-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:787124e7db3b379d4f1ed54dd12ae7c741c16a4d29b49c0226a89bea50923ffb", size = 915711952, upload-time = "2026-01-21T16:23:53.503Z" }, + { url = "https://files.pythonhosted.org/packages/6e/01/624c4324ca01f66ae4c7cd1b74eb16fb52596dce66dbe51eff95ef9e7a4c/torch-2.10.0-cp312-cp312-win_amd64.whl", hash = "sha256:2c66c61f44c5f903046cc696d088e21062644cbe541c7f1c4eaae88b2ad23547", size = 113757972, upload-time = "2026-01-21T16:24:39.516Z" }, + { url = "https://files.pythonhosted.org/packages/c9/5c/dee910b87c4d5c0fcb41b50839ae04df87c1cfc663cf1b5fca7ea565eeaa/torch-2.10.0-cp312-none-macosx_11_0_arm64.whl", hash = "sha256:6d3707a61863d1c4d6ebba7be4ca320f42b869ee657e9b2c21c736bf17000294", size = 79498198, upload-time = "2026-01-21T16:24:34.704Z" }, + { url = "https://files.pythonhosted.org/packages/c9/6f/f2e91e34e3fcba2e3fc8d8f74e7d6c22e74e480bbd1db7bc8900fdf3e95c/torch-2.10.0-cp313-cp313-manylinux_2_28_aarch64.whl", hash = "sha256:5c4d217b14741e40776dd7074d9006fd28b8a97ef5654db959d8635b2fe5f29b", size = 146004247, upload-time = "2026-01-21T16:24:29.335Z" }, + { url = "https://files.pythonhosted.org/packages/98/fb/5160261aeb5e1ee12ee95fe599d0541f7c976c3701d607d8fc29e623229f/torch-2.10.0-cp313-cp313-manylinux_2_28_x86_64.whl", hash = "sha256:6b71486353fce0f9714ca0c9ef1c850a2ae766b409808acd58e9678a3edb7738", size = 915716445, upload-time = "2026-01-21T16:22:45.353Z" }, + { url = "https://files.pythonhosted.org/packages/6a/16/502fb1b41e6d868e8deb5b0e3ae926bbb36dab8ceb0d1b769b266ad7b0c3/torch-2.10.0-cp313-cp313-win_amd64.whl", hash = "sha256:c2ee399c644dc92ef7bc0d4f7e74b5360c37cdbe7c5ba11318dda49ffac2bc57", size = 113757050, upload-time = "2026-01-21T16:24:19.204Z" }, + { url = "https://files.pythonhosted.org/packages/1a/0b/39929b148f4824bc3ad6f9f72a29d4ad865bcf7ebfc2fa67584773e083d2/torch-2.10.0-cp313-cp313t-macosx_14_0_arm64.whl", hash = "sha256:3202429f58309b9fa96a614885eace4b7995729f44beb54d3e4a47773649d382", size = 79851305, upload-time = "2026-01-21T16:24:09.209Z" }, + { url = "https://files.pythonhosted.org/packages/d8/14/21fbce63bc452381ba5f74a2c0a959fdf5ad5803ccc0c654e752e0dbe91a/torch-2.10.0-cp313-cp313t-manylinux_2_28_aarch64.whl", hash = "sha256:aae1b29cd68e50a9397f5ee897b9c24742e9e306f88a807a27d617f07adb3bd8", size = 146005472, upload-time = "2026-01-21T16:22:29.022Z" }, + { url = "https://files.pythonhosted.org/packages/54/fd/b207d1c525cb570ef47f3e9f836b154685011fce11a2f444ba8a4084d042/torch-2.10.0-cp313-cp313t-manylinux_2_28_x86_64.whl", hash = "sha256:6021db85958db2f07ec94e1bc77212721ba4920c12a18dc552d2ae36a3eb163f", size = 915612644, upload-time = "2026-01-21T16:21:47.019Z" }, + { url = "https://files.pythonhosted.org/packages/36/53/0197f868c75f1050b199fe58f9bf3bf3aecac9b4e85cc9c964383d745403/torch-2.10.0-cp313-cp313t-win_amd64.whl", hash = "sha256:ff43db38af76fda183156153983c9a096fc4c78d0cd1e07b14a2314c7f01c2c8", size = 113997015, upload-time = "2026-01-21T16:23:00.767Z" }, + { url = "https://files.pythonhosted.org/packages/0e/13/e76b4d9c160e89fff48bf16b449ea324bda84745d2ab30294c37c2434c0d/torch-2.10.0-cp313-none-macosx_11_0_arm64.whl", hash = "sha256:cdf2a523d699b70d613243211ecaac14fe9c5df8a0b0a9c02add60fb2a413e0f", size = 79498248, upload-time = "2026-01-21T16:23:09.315Z" }, + { url = "https://files.pythonhosted.org/packages/4f/93/716b5ac0155f1be70ed81bacc21269c3ece8dba0c249b9994094110bfc51/torch-2.10.0-cp314-cp314-macosx_14_0_arm64.whl", hash = "sha256:bf0d9ff448b0218e0433aeb198805192346c4fd659c852370d5cc245f602a06a", size = 79464992, upload-time = "2026-01-21T16:23:05.162Z" }, + { url = "https://files.pythonhosted.org/packages/69/2b/51e663ff190c9d16d4a8271203b71bc73a16aa7619b9f271a69b9d4a936b/torch-2.10.0-cp314-cp314-manylinux_2_28_aarch64.whl", hash = "sha256:233aed0659a2503b831d8a67e9da66a62c996204c0bba4f4c442ccc0c68a3f60", size = 146018567, upload-time = "2026-01-21T16:22:23.393Z" }, + { url = "https://files.pythonhosted.org/packages/5e/cd/4b95ef7f293b927c283db0b136c42be91c8ec6845c44de0238c8c23bdc80/torch-2.10.0-cp314-cp314-manylinux_2_28_x86_64.whl", hash = "sha256:682497e16bdfa6efeec8cde66531bc8d1fbbbb4d8788ec6173c089ed3cc2bfe5", size = 915721646, upload-time = "2026-01-21T16:21:16.983Z" }, + { url = "https://files.pythonhosted.org/packages/56/97/078a007208f8056d88ae43198833469e61a0a355abc0b070edd2c085eb9a/torch-2.10.0-cp314-cp314-win_amd64.whl", hash = "sha256:6528f13d2a8593a1a412ea07a99812495bec07e9224c28b2a25c0a30c7da025c", size = 113752373, upload-time = "2026-01-21T16:22:13.471Z" }, + { url = "https://files.pythonhosted.org/packages/d8/94/71994e7d0d5238393df9732fdab607e37e2b56d26a746cb59fdb415f8966/torch-2.10.0-cp314-cp314t-macosx_14_0_arm64.whl", hash = "sha256:f5ab4ba32383061be0fb74bda772d470140a12c1c3b58a0cfbf3dae94d164c28", size = 79850324, upload-time = "2026-01-21T16:22:09.494Z" }, + { url = "https://files.pythonhosted.org/packages/e2/65/1a05346b418ea8ccd10360eef4b3e0ce688fba544e76edec26913a8d0ee0/torch-2.10.0-cp314-cp314t-manylinux_2_28_aarch64.whl", hash = "sha256:716b01a176c2a5659c98f6b01bf868244abdd896526f1c692712ab36dbaf9b63", size = 146006482, upload-time = "2026-01-21T16:22:18.42Z" }, + { url = "https://files.pythonhosted.org/packages/1d/b9/5f6f9d9e859fc3235f60578fa64f52c9c6e9b4327f0fe0defb6de5c0de31/torch-2.10.0-cp314-cp314t-manylinux_2_28_x86_64.whl", hash = "sha256:d8f5912ba938233f86361e891789595ff35ca4b4e2ac8fe3670895e5976731d6", size = 915613050, upload-time = "2026-01-21T16:20:49.035Z" }, + { url = "https://files.pythonhosted.org/packages/66/4d/35352043ee0eaffdeff154fad67cd4a31dbed7ff8e3be1cc4549717d6d51/torch-2.10.0-cp314-cp314t-win_amd64.whl", hash = "sha256:71283a373f0ee2c89e0f0d5f446039bdabe8dbc3c9ccf35f0f784908b0acd185", size = 113995816, upload-time = "2026-01-21T16:22:05.312Z" }, +] + +[[package]] +name = "torchcodec" +version = "0.10.0" +source = { registry = "https://pypi.org/simple" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/52/ff/2b27797e039673156710e5a0febe87cafc203722acafa3d34db283b40cf9/torchcodec-0.10.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:b35fa4061c5757f8d714187c040a90a11669de6470a644bb04e3cd335ff1c110", size = 4073213, upload-time = "2026-01-22T15:41:45.485Z" }, + { url = "https://files.pythonhosted.org/packages/29/34/ccc711b6dc581e43b8d8d227e4173a8826994ee7b68d6b3d82291f307325/torchcodec-0.10.0-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:6e43184d83ccced965b31cad5bb6200c779646fee2ec153a6d784b4def40c91b", size = 2083121, upload-time = "2026-01-22T15:41:37.947Z" }, + { url = "https://files.pythonhosted.org/packages/d2/b6/b1041c8ccb175b08779b3e2d3e60f838bbcbfe2398d49e3673b6a66f0649/torchcodec-0.10.0-cp313-cp313-macosx_12_0_arm64.whl", hash = "sha256:be3ce7cc667effecd06da9d0d6c5e9e347c5f376b705934e7b82378a65cf6eef", size = 4043681, upload-time = "2026-01-22T15:41:47.236Z" }, + { url = "https://files.pythonhosted.org/packages/fd/85/fc44f6d702dfd344e6859a9a4d713aaaa991578eb74677a80297d9ae8a07/torchcodec-0.10.0-cp313-cp313-manylinux_2_28_x86_64.whl", hash = "sha256:71f25caf9ab89a434ae2008b1374fd98557a6864b8313b103bae53af3e6fd17f", size = 2088572, upload-time = "2026-01-22T15:41:39.203Z" }, + { url = "https://files.pythonhosted.org/packages/90/c9/4b6242e3456bae148f4086337d3e43d98c4e79c04091de3462db9f5eb67a/torchcodec-0.10.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:bb882c12ca07dcf6d82833db67e6b565693a4bccfeab6696697620e43e465556", size = 3821202, upload-time = "2026-01-22T15:41:48.627Z" }, + { url = "https://files.pythonhosted.org/packages/96/a2/5fe0e62b208a367f741361881321c1b25de487318a44f870f326747585a1/torchcodec-0.10.0-cp314-cp314-manylinux_2_28_x86_64.whl", hash = "sha256:bec2b938ad4b294bd71d0b0ab4976037c740be0c80be79e67803ebed4eff270e", size = 2089647, upload-time = "2026-01-22T15:41:40.711Z" }, +] + +[[package]] +name = "torchvision" +version = "0.25.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "numpy" }, + { name = "pillow" }, + { name = "torch" }, +] +wheels = [ + { url = "https://files.pythonhosted.org/packages/56/3a/6ea0d73f49a9bef38a1b3a92e8dd455cea58470985d25635beab93841748/torchvision-0.25.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:c2abe430c90b1d5e552680037d68da4eb80a5852ebb1c811b2b89d299b10573b", size = 1874920, upload-time = "2026-01-21T16:27:45.348Z" }, + { url = "https://files.pythonhosted.org/packages/51/f8/c0e1ef27c66e15406fece94930e7d6feee4cb6374bbc02d945a630d6426e/torchvision-0.25.0-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:b75deafa2dfea3e2c2a525559b04783515e3463f6e830cb71de0fb7ea36fe233", size = 2344556, upload-time = "2026-01-21T16:27:40.125Z" }, + { url = "https://files.pythonhosted.org/packages/68/2f/f24b039169db474e8688f649377de082a965fbf85daf4e46c44412f1d15a/torchvision-0.25.0-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:f25aa9e380865b11ea6e9d99d84df86b9cc959f1a007cd966fc6f1ab2ed0e248", size = 8072351, upload-time = "2026-01-21T16:27:21.074Z" }, + { url = "https://files.pythonhosted.org/packages/ad/16/8f650c2e288977cf0f8f85184b90ee56ed170a4919347fc74ee99286ed6f/torchvision-0.25.0-cp312-cp312-win_amd64.whl", hash = "sha256:f9c55ae8d673ab493325d1267cbd285bb94d56f99626c00ac4644de32a59ede3", size = 4303059, upload-time = "2026-01-21T16:27:11.08Z" }, + { url = "https://files.pythonhosted.org/packages/f5/5b/1562a04a6a5a4cf8cf40016a0cdeda91ede75d6962cff7f809a85ae966a5/torchvision-0.25.0-cp313-cp313-macosx_12_0_arm64.whl", hash = "sha256:24e11199e4d84ba9c5ee7825ebdf1cd37ce8deec225117f10243cae984ced3ec", size = 1874918, upload-time = "2026-01-21T16:27:39.02Z" }, + { url = "https://files.pythonhosted.org/packages/36/b1/3d6c42f62c272ce34fcce609bb8939bdf873dab5f1b798fd4e880255f129/torchvision-0.25.0-cp313-cp313-manylinux_2_28_aarch64.whl", hash = "sha256:5f271136d2d2c0b7a24c5671795c6e4fd8da4e0ea98aeb1041f62bc04c4370ef", size = 2309106, upload-time = "2026-01-21T16:27:30.624Z" }, + { url = "https://files.pythonhosted.org/packages/c7/60/59bb9c8b67cce356daeed4cb96a717caa4f69c9822f72e223a0eae7a9bd9/torchvision-0.25.0-cp313-cp313-manylinux_2_28_x86_64.whl", hash = "sha256:855c0dc6d37f462482da7531c6788518baedca1e0847f3df42a911713acdfe52", size = 8071522, upload-time = "2026-01-21T16:27:29.392Z" }, + { url = "https://files.pythonhosted.org/packages/32/a5/9a9b1de0720f884ea50dbf9acb22cbe5312e51d7b8c4ac6ba9b51efd9bba/torchvision-0.25.0-cp313-cp313-win_amd64.whl", hash = "sha256:cef0196be31be421f6f462d1e9da1101be7332d91984caa6f8022e6c78a5877f", size = 4321911, upload-time = "2026-01-21T16:27:35.195Z" }, + { url = "https://files.pythonhosted.org/packages/52/99/dca81ed21ebaeff2b67cc9f815a20fdaa418b69f5f9ea4c6ed71721470db/torchvision-0.25.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:a8f8061284395ce31bcd460f2169013382ccf411148ceb2ee38e718e9860f5a7", size = 1896209, upload-time = "2026-01-21T16:27:32.159Z" }, + { url = "https://files.pythonhosted.org/packages/28/cc/2103149761fdb4eaed58a53e8437b2d716d48f05174fab1d9fcf1e2a2244/torchvision-0.25.0-cp313-cp313t-manylinux_2_28_aarch64.whl", hash = "sha256:146d02c9876858420adf41f3189fe90e3d6a409cbfa65454c09f25fb33bf7266", size = 2310735, upload-time = "2026-01-21T16:27:22.327Z" }, + { url = "https://files.pythonhosted.org/packages/76/ad/f4c985ad52ddd3b22711c588501be1b330adaeaf6850317f66751711b78c/torchvision-0.25.0-cp313-cp313t-manylinux_2_28_x86_64.whl", hash = "sha256:c4d395cb2c4a2712f6eb93a34476cdf7aae74bb6ea2ea1917f858e96344b00aa", size = 8089557, upload-time = "2026-01-21T16:27:27.666Z" }, + { url = "https://files.pythonhosted.org/packages/63/cc/0ea68b5802e5e3c31f44b307e74947bad5a38cc655231d845534ed50ddb8/torchvision-0.25.0-cp313-cp313t-win_amd64.whl", hash = "sha256:5e6b449e9fa7d642142c0e27c41e5a43b508d57ed8e79b7c0a0c28652da8678c", size = 4344260, upload-time = "2026-01-21T16:27:17.018Z" }, + { url = "https://files.pythonhosted.org/packages/9e/1f/fa839532660e2602b7e704d65010787c5bb296258b44fa8b9c1cd6175e7d/torchvision-0.25.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:620a236288d594dcec7634c754484542dc0a5c1b0e0b83a34bda5e91e9b7c3a1", size = 1896193, upload-time = "2026-01-21T16:27:24.785Z" }, + { url = "https://files.pythonhosted.org/packages/80/ed/d51889da7ceaf5ff7a0574fb28f9b6b223df19667265395891f81b364ab3/torchvision-0.25.0-cp314-cp314-manylinux_2_28_aarch64.whl", hash = "sha256:0b5e7f50002a8145a98c5694a018e738c50e2972608310c7e88e1bd4c058f6ce", size = 2309331, upload-time = "2026-01-21T16:27:19.97Z" }, + { url = "https://files.pythonhosted.org/packages/90/a5/f93fcffaddd8f12f9e812256830ec9c9ca65abbf1bc369379f9c364d1ff4/torchvision-0.25.0-cp314-cp314-manylinux_2_28_x86_64.whl", hash = "sha256:632db02300e83793812eee4f61ae6a2686dab10b4cfd628b620dc47747aa9d03", size = 8088713, upload-time = "2026-01-21T16:27:15.281Z" }, + { url = "https://files.pythonhosted.org/packages/1f/eb/d0096eed5690d962853213f2ee00d91478dfcb586b62dbbb449fb8abc3a6/torchvision-0.25.0-cp314-cp314-win_amd64.whl", hash = "sha256:d1abd5ed030c708f5dbf4812ad5f6fbe9384b63c40d6bd79f8df41a4a759a917", size = 4325058, upload-time = "2026-01-21T16:27:26.165Z" }, + { url = "https://files.pythonhosted.org/packages/97/36/96374a4c7ab50dea9787ce987815614ccfe988a42e10ac1a2e3e5b60319a/torchvision-0.25.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:ad9a8a5877782944d99186e4502a614770fe906626d76e9cd32446a0ac3075f2", size = 1896207, upload-time = "2026-01-21T16:27:23.383Z" }, + { url = "https://files.pythonhosted.org/packages/b5/e2/7abb10a867db79b226b41da419b63b69c0bd5b82438c4a4ed50e084c552f/torchvision-0.25.0-cp314-cp314t-manylinux_2_28_aarch64.whl", hash = "sha256:40a122c3cf4d14b651f095e0f672b688dde78632783fc5cd3d4d5e4f6a828563", size = 2310741, upload-time = "2026-01-21T16:27:18.712Z" }, + { url = "https://files.pythonhosted.org/packages/08/e6/0927784e6ffc340b6676befde1c60260bd51641c9c574b9298d791a9cda4/torchvision-0.25.0-cp314-cp314t-manylinux_2_28_x86_64.whl", hash = "sha256:846890161b825b38aa85fc37fb3ba5eea74e7091ff28bab378287111483b6443", size = 8089772, upload-time = "2026-01-21T16:27:14.048Z" }, + { url = "https://files.pythonhosted.org/packages/b6/37/e7ca4ec820d434c0f23f824eb29f0676a0c3e7a118f1514f5b949c3356da/torchvision-0.25.0-cp314-cp314t-win_amd64.whl", hash = "sha256:f07f01d27375ad89d72aa2b3f2180f07da95dd9d2e4c758e015c0acb2da72977", size = 4425879, upload-time = "2026-01-21T16:27:12.579Z" }, +] + +[[package]] +name = "tqdm" +version = "4.68.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/06/b3/36c8ecf72e8925200671613332db156d84b99b3aee742a41c1938ebb0808/tqdm-4.68.1.tar.gz", hash = "sha256:fc163d96b287bd031e1aa24421ce4411b25559bd0a1be4fe649bdaa4d2c02bf5", size = 171236, upload-time = "2026-06-05T17:23:15.267Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/47/aa/218a0eb34de1f753c83e4d0d1c8e7c4cef27f20dcb8342e024f63a80dc86/tqdm-4.68.1-py3-none-any.whl", hash = "sha256:fea4a90e4023f764914569f7802a297277c5ab1a66be5144143e142e1a4031d8", size = 78354, upload-time = "2026-06-05T17:23:13.654Z" }, +] + +[[package]] +name = "triton" +version = "3.6.0" +source = { registry = "https://pypi.org/simple" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ab/a8/cdf8b3e4c98132f965f88c2313a4b493266832ad47fb52f23d14d4f86bb5/triton-3.6.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:74caf5e34b66d9f3a429af689c1c7128daba1d8208df60e81106b115c00d6fca", size = 188266850, upload-time = "2026-01-20T16:00:43.041Z" }, + { url = "https://files.pythonhosted.org/packages/f9/0b/37d991d8c130ce81a8728ae3c25b6e60935838e9be1b58791f5997b24a54/triton-3.6.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:10c7f76c6e72d2ef08df639e3d0d30729112f47a56b0c81672edc05ee5116ac9", size = 188289450, upload-time = "2026-01-20T16:00:49.136Z" }, + { url = "https://files.pythonhosted.org/packages/35/f8/9c66bfc55361ec6d0e4040a0337fb5924ceb23de4648b8a81ae9d33b2b38/triton-3.6.0-cp313-cp313t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d002e07d7180fd65e622134fbd980c9a3d4211fb85224b56a0a0efbd422ab72f", size = 188400296, upload-time = "2026-01-20T16:00:56.042Z" }, + { url = "https://files.pythonhosted.org/packages/df/3d/9e7eee57b37c80cec63322c0231bb6da3cfe535a91d7a4d64896fcb89357/triton-3.6.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a17a5d5985f0ac494ed8a8e54568f092f7057ef60e1b0fa09d3fd1512064e803", size = 188273063, upload-time = "2026-01-20T16:01:07.278Z" }, + { url = "https://files.pythonhosted.org/packages/f6/56/6113c23ff46c00aae423333eb58b3e60bdfe9179d542781955a5e1514cb3/triton-3.6.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:46bd1c1af4b6704e554cad2eeb3b0a6513a980d470ccfa63189737340c7746a7", size = 188397994, upload-time = "2026-01-20T16:01:14.236Z" }, +] + +[[package]] +name = "typer" +version = "0.25.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "annotated-doc" }, + { name = "click" }, + { name = "rich" }, + { name = "shellingham" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/e4/51/9aed62104cea109b820bbd6c14245af756112017d309da813ef107d42e7e/typer-0.25.1.tar.gz", hash = "sha256:9616eb8853a09ffeabab1698952f33c6f29ffdbceb4eaeecf571880e8d7664cc", size = 122276, upload-time = "2026-04-30T19:32:16.964Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/3f/f9/2b3ff4e56e5fa7debfaf9eb135d0da96f3e9a1d5b27222223c7296336e5f/typer-0.25.1-py3-none-any.whl", hash = "sha256:75caa44ed46a03fb2dab8808753ffacdbfea88495e74c85a28c5eefcf5f39c89", size = 58409, upload-time = "2026-04-30T19:32:18.271Z" }, +] + +[[package]] +name = "typing-extensions" +version = "4.15.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/72/94/1a15dd82efb362ac84269196e94cf00f187f7ed21c242792a923cdb1c61f/typing_extensions-4.15.0.tar.gz", hash = "sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466", size = 109391, upload-time = "2025-08-25T13:49:26.313Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/18/67/36e9267722cc04a6b9f15c7f3441c2363321a3ea07da7ae0c0707beb2a9c/typing_extensions-4.15.0-py3-none-any.whl", hash = "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548", size = 44614, upload-time = "2025-08-25T13:49:24.86Z" }, +] + +[[package]] +name = "typing-inspect" +version = "0.9.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "mypy-extensions" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/dc/74/1789779d91f1961fa9438e9a8710cdae6bd138c80d7303996933d117264a/typing_inspect-0.9.0.tar.gz", hash = "sha256:b23fc42ff6f6ef6954e4852c1fb512cdd18dbea03134f91f856a95ccc9461f78", size = 13825, upload-time = "2023-05-24T20:25:47.612Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/65/f3/107a22063bf27bdccf2024833d3445f4eea42b2e598abfbd46f6a63b6cb0/typing_inspect-0.9.0-py3-none-any.whl", hash = "sha256:9ee6fc59062311ef8547596ab6b955e1b8aa46242d854bfc78f4f6b0eff35f9f", size = 8827, upload-time = "2023-05-24T20:25:45.287Z" }, +] + +[[package]] +name = "typing-inspection" +version = "0.4.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/55/e3/70399cb7dd41c10ac53367ae42139cf4b1ca5f36bb3dc6c9d33acdb43655/typing_inspection-0.4.2.tar.gz", hash = "sha256:ba561c48a67c5958007083d386c3295464928b01faa735ab8547c5692e87f464", size = 75949, upload-time = "2025-10-01T02:14:41.687Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/dc/9b/47798a6c91d8bdb567fe2698fe81e0c6b7cb7ef4d13da4114b41d239f65d/typing_inspection-0.4.2-py3-none-any.whl", hash = "sha256:4ed1cacbdc298c220f1bd249ed5287caa16f34d44ef4e9c3d0cbad5b521545e7", size = 14611, upload-time = "2025-10-01T02:14:40.154Z" }, +] + +[[package]] +name = "tzdata" +version = "2026.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/ba/19/1b9b0e29f30c6d35cb345486df41110984ea67ae69dddbc0e8a100999493/tzdata-2026.2.tar.gz", hash = "sha256:9173fde7d80d9018e02a662e168e5a2d04f87c41ea174b139fbef642eda62d10", size = 198254, upload-time = "2026-04-24T15:22:08.651Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ce/e4/dccd7f47c4b64213ac01ef921a1337ee6e30e8c6466046018326977efd95/tzdata-2026.2-py2.py3-none-any.whl", hash = "sha256:bbe9af844f658da81a5f95019480da3a89415801f6cc966806612cc7169bffe7", size = 349321, upload-time = "2026-04-24T15:22:05.876Z" }, +] + +[[package]] +name = "urllib3" +version = "2.7.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/53/0c/06f8b233b8fd13b9e5ee11424ef85419ba0d8ba0b3138bf360be2ff56953/urllib3-2.7.0.tar.gz", hash = "sha256:231e0ec3b63ceb14667c67be60f2f2c40a518cb38b03af60abc813da26505f4c", size = 433602, upload-time = "2026-05-07T16:13:18.596Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7f/3e/5db95bcf282c52709639744ca2a8b149baccf648e39c8cc87553df9eae0c/urllib3-2.7.0-py3-none-any.whl", hash = "sha256:9fb4c81ebbb1ce9531cce37674bbc6f1360472bc18ca9a553ede278ef7276897", size = 131087, upload-time = "2026-05-07T16:13:17.151Z" }, +] + +[[package]] +name = "uvicorn" +version = "0.49.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "click" }, + { name = "h11" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/c4/1f/fa18009dea8469069cca78a4e877a008ab78f08b064bfc9ab891579077ff/uvicorn-0.49.0.tar.gz", hash = "sha256:ebf4271aa580d9de97f93192d4595176df6e91f9aae919ca73e4fc07df1e66a3", size = 91284, upload-time = "2026-06-03T22:01:30.448Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/fa/e1388bbcf24ef3274f45c0c1c7b501fd14971037c1b6ee23610553307497/uvicorn-0.49.0-py3-none-any.whl", hash = "sha256:ba3d14c3ee7e41c6c654c46c9eb489d33213cdd30aa1696eab1374337c13f68f", size = 71376, upload-time = "2026-06-03T22:01:29.037Z" }, +] + +[package.optional-dependencies] +standard = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "httptools" }, + { name = "python-dotenv" }, + { name = "pyyaml" }, + { name = "uvloop", marker = "platform_python_implementation != 'PyPy' and sys_platform != 'cygwin' and sys_platform != 'win32'" }, + { name = "watchfiles" }, + { name = "websockets" }, +] + +[[package]] +name = "uvloop" +version = "0.22.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/06/f0/18d39dbd1971d6d62c4629cc7fa67f74821b0dc1f5a77af43719de7936a7/uvloop-0.22.1.tar.gz", hash = "sha256:6c84bae345b9147082b17371e3dd5d42775bddce91f885499017f4607fdaf39f", size = 2443250, upload-time = "2025-10-16T22:17:19.342Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/3d/ff/7f72e8170be527b4977b033239a83a68d5c881cc4775fca255c677f7ac5d/uvloop-0.22.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:fe94b4564e865d968414598eea1a6de60adba0c040ba4ed05ac1300de402cd42", size = 1359936, upload-time = "2025-10-16T22:16:29.436Z" }, + { url = "https://files.pythonhosted.org/packages/c3/c6/e5d433f88fd54d81ef4be58b2b7b0cea13c442454a1db703a1eea0db1a59/uvloop-0.22.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:51eb9bd88391483410daad430813d982010f9c9c89512321f5b60e2cddbdddd6", size = 752769, upload-time = "2025-10-16T22:16:30.493Z" }, + { url = "https://files.pythonhosted.org/packages/24/68/a6ac446820273e71aa762fa21cdcc09861edd3536ff47c5cd3b7afb10eeb/uvloop-0.22.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:700e674a166ca5778255e0e1dc4e9d79ab2acc57b9171b79e65feba7184b3370", size = 4317413, upload-time = "2025-10-16T22:16:31.644Z" }, + { url = "https://files.pythonhosted.org/packages/5f/6f/e62b4dfc7ad6518e7eff2516f680d02a0f6eb62c0c212e152ca708a0085e/uvloop-0.22.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7b5b1ac819a3f946d3b2ee07f09149578ae76066d70b44df3fa990add49a82e4", size = 4426307, upload-time = "2025-10-16T22:16:32.917Z" }, + { url = "https://files.pythonhosted.org/packages/90/60/97362554ac21e20e81bcef1150cb2a7e4ffdaf8ea1e5b2e8bf7a053caa18/uvloop-0.22.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:e047cc068570bac9866237739607d1313b9253c3051ad84738cbb095be0537b2", size = 4131970, upload-time = "2025-10-16T22:16:34.015Z" }, + { url = "https://files.pythonhosted.org/packages/99/39/6b3f7d234ba3964c428a6e40006340f53ba37993f46ed6e111c6e9141d18/uvloop-0.22.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:512fec6815e2dd45161054592441ef76c830eddaad55c8aa30952e6fe1ed07c0", size = 4296343, upload-time = "2025-10-16T22:16:35.149Z" }, + { url = "https://files.pythonhosted.org/packages/89/8c/182a2a593195bfd39842ea68ebc084e20c850806117213f5a299dfc513d9/uvloop-0.22.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:561577354eb94200d75aca23fbde86ee11be36b00e52a4eaf8f50fb0c86b7705", size = 1358611, upload-time = "2025-10-16T22:16:36.833Z" }, + { url = "https://files.pythonhosted.org/packages/d2/14/e301ee96a6dc95224b6f1162cd3312f6d1217be3907b79173b06785f2fe7/uvloop-0.22.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:1cdf5192ab3e674ca26da2eada35b288d2fa49fdd0f357a19f0e7c4e7d5077c8", size = 751811, upload-time = "2025-10-16T22:16:38.275Z" }, + { url = "https://files.pythonhosted.org/packages/b7/02/654426ce265ac19e2980bfd9ea6590ca96a56f10c76e63801a2df01c0486/uvloop-0.22.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6e2ea3d6190a2968f4a14a23019d3b16870dd2190cd69c8180f7c632d21de68d", size = 4288562, upload-time = "2025-10-16T22:16:39.375Z" }, + { url = "https://files.pythonhosted.org/packages/15/c0/0be24758891ef825f2065cd5db8741aaddabe3e248ee6acc5e8a80f04005/uvloop-0.22.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0530a5fbad9c9e4ee3f2b33b148c6a64d47bbad8000ea63704fa8260f4cf728e", size = 4366890, upload-time = "2025-10-16T22:16:40.547Z" }, + { url = "https://files.pythonhosted.org/packages/d2/53/8369e5219a5855869bcee5f4d317f6da0e2c669aecf0ef7d371e3d084449/uvloop-0.22.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:bc5ef13bbc10b5335792360623cc378d52d7e62c2de64660616478c32cd0598e", size = 4119472, upload-time = "2025-10-16T22:16:41.694Z" }, + { url = "https://files.pythonhosted.org/packages/f8/ba/d69adbe699b768f6b29a5eec7b47dd610bd17a69de51b251126a801369ea/uvloop-0.22.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:1f38ec5e3f18c8a10ded09742f7fb8de0108796eb673f30ce7762ce1b8550cad", size = 4239051, upload-time = "2025-10-16T22:16:43.224Z" }, + { url = "https://files.pythonhosted.org/packages/90/cd/b62bdeaa429758aee8de8b00ac0dd26593a9de93d302bff3d21439e9791d/uvloop-0.22.1-cp314-cp314-macosx_10_13_universal2.whl", hash = "sha256:3879b88423ec7e97cd4eba2a443aa26ed4e59b45e6b76aabf13fe2f27023a142", size = 1362067, upload-time = "2025-10-16T22:16:44.503Z" }, + { url = "https://files.pythonhosted.org/packages/0d/f8/a132124dfda0777e489ca86732e85e69afcd1ff7686647000050ba670689/uvloop-0.22.1-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:4baa86acedf1d62115c1dc6ad1e17134476688f08c6efd8a2ab076e815665c74", size = 752423, upload-time = "2025-10-16T22:16:45.968Z" }, + { url = "https://files.pythonhosted.org/packages/a3/94/94af78c156f88da4b3a733773ad5ba0b164393e357cc4bd0ab2e2677a7d6/uvloop-0.22.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:297c27d8003520596236bdb2335e6b3f649480bd09e00d1e3a99144b691d2a35", size = 4272437, upload-time = "2025-10-16T22:16:47.451Z" }, + { url = "https://files.pythonhosted.org/packages/b5/35/60249e9fd07b32c665192cec7af29e06c7cd96fa1d08b84f012a56a0b38e/uvloop-0.22.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c1955d5a1dd43198244d47664a5858082a3239766a839b2102a269aaff7a4e25", size = 4292101, upload-time = "2025-10-16T22:16:49.318Z" }, + { url = "https://files.pythonhosted.org/packages/02/62/67d382dfcb25d0a98ce73c11ed1a6fba5037a1a1d533dcbb7cab033a2636/uvloop-0.22.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:b31dc2fccbd42adc73bc4e7cdbae4fc5086cf378979e53ca5d0301838c5682c6", size = 4114158, upload-time = "2025-10-16T22:16:50.517Z" }, + { url = "https://files.pythonhosted.org/packages/f0/7a/f1171b4a882a5d13c8b7576f348acfe6074d72eaf52cccef752f748d4a9f/uvloop-0.22.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:93f617675b2d03af4e72a5333ef89450dfaa5321303ede6e67ba9c9d26878079", size = 4177360, upload-time = "2025-10-16T22:16:52.646Z" }, + { url = "https://files.pythonhosted.org/packages/79/7b/b01414f31546caf0919da80ad57cbfe24c56b151d12af68cee1b04922ca8/uvloop-0.22.1-cp314-cp314t-macosx_10_13_universal2.whl", hash = "sha256:37554f70528f60cad66945b885eb01f1bb514f132d92b6eeed1c90fd54ed6289", size = 1454790, upload-time = "2025-10-16T22:16:54.355Z" }, + { url = "https://files.pythonhosted.org/packages/d4/31/0bb232318dd838cad3fa8fb0c68c8b40e1145b32025581975e18b11fab40/uvloop-0.22.1-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:b76324e2dc033a0b2f435f33eb88ff9913c156ef78e153fb210e03c13da746b3", size = 796783, upload-time = "2025-10-16T22:16:55.906Z" }, + { url = "https://files.pythonhosted.org/packages/42/38/c9b09f3271a7a723a5de69f8e237ab8e7803183131bc57c890db0b6bb872/uvloop-0.22.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:badb4d8e58ee08dad957002027830d5c3b06aea446a6a3744483c2b3b745345c", size = 4647548, upload-time = "2025-10-16T22:16:57.008Z" }, + { url = "https://files.pythonhosted.org/packages/c1/37/945b4ca0ac27e3dc4952642d4c900edd030b3da6c9634875af6e13ae80e5/uvloop-0.22.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b91328c72635f6f9e0282e4a57da7470c7350ab1c9f48546c0f2866205349d21", size = 4467065, upload-time = "2025-10-16T22:16:58.206Z" }, + { url = "https://files.pythonhosted.org/packages/97/cc/48d232f33d60e2e2e0b42f4e73455b146b76ebe216487e862700457fbf3c/uvloop-0.22.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:daf620c2995d193449393d6c62131b3fbd40a63bf7b307a1527856ace637fe88", size = 4328384, upload-time = "2025-10-16T22:16:59.36Z" }, + { url = "https://files.pythonhosted.org/packages/e4/16/c1fd27e9549f3c4baf1dc9c20c456cd2f822dbf8de9f463824b0c0357e06/uvloop-0.22.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:6cde23eeda1a25c75b2e07d39970f3374105d5eafbaab2a4482be82f272d5a5e", size = 4296730, upload-time = "2025-10-16T22:17:00.744Z" }, +] + +[[package]] +name = "virtualenv" +version = "21.4.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "distlib" }, + { name = "filelock" }, + { name = "platformdirs" }, + { name = "python-discovery" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/e1/0d/4e93c8e6d1001a75763f87d8f5ecda8ebc7f4aa2153dddfaf4ae8892821a/virtualenv-21.4.2.tar.gz", hash = "sha256:38e6ee0a555615c0ea9da2ac7e9998fe8dc3b911dd33ad8eaad2020957653b0c", size = 7613326, upload-time = "2026-05-31T17:01:22.827Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/bf/c4/557dc082be035381b85fdb2b74e21d3d21b57750b74f2b47a32f3a639ff9/virtualenv-21.4.2-py3-none-any.whl", hash = "sha256:854210ca524a1a4d0d744734f4acbc721c3ffe163b85bbf5d56d14d5ae2f0fae", size = 7594079, upload-time = "2026-05-31T17:01:20.735Z" }, +] + +[[package]] +name = "wandb" +version = "0.24.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "click" }, + { name = "gitpython" }, + { name = "packaging" }, + { name = "platformdirs" }, + { name = "protobuf" }, + { name = "pydantic" }, + { name = "pyyaml" }, + { name = "requests" }, + { name = "sentry-sdk" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/97/5c/53cf9f74b89e90facc8c7892d1449f7b39527e50e5cd577346baeb97e423/wandb-0.24.2.tar.gz", hash = "sha256:968b5b91d0a164dfb2f8c604cdf69e6fb09de6596b85b9f9d3c916b71ae86198", size = 44237317, upload-time = "2026-02-05T00:12:16.739Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/98/82/5299fa22faf2dd55f33f05c26bf908b11ea4d25f32ac270d4bf838b0d97e/wandb-0.24.2-py3-none-macosx_12_0_arm64.whl", hash = "sha256:755b8a92edd28e15c052dc2bdc4652e26bce379fa7745360249cbfc589ff5f53", size = 21640026, upload-time = "2026-02-05T00:11:55.267Z" }, + { url = "https://files.pythonhosted.org/packages/ca/38/33cb321258778c25c00fb7eb578e69ce99428a66d4376eee4058f230a21a/wandb-0.24.2-py3-none-macosx_12_0_x86_64.whl", hash = "sha256:5e6c0ad176792c7c3d1620a2ad65bd9a5f3886c69362af540d3667bfc97b67fb", size = 22894053, upload-time = "2026-02-05T00:11:58.304Z" }, + { url = "https://files.pythonhosted.org/packages/3e/99/33b0281ac9a0b0c251195e6ce6cb310efa2f84ee117a15e9997fc2f9503b/wandb-0.24.2-py3-none-manylinux_2_28_aarch64.whl", hash = "sha256:85861f9b3e54a07b84bade0aa5f4caa156028ab959351d98816a45e3b1411d35", size = 21286409, upload-time = "2026-02-05T00:12:00.584Z" }, + { url = "https://files.pythonhosted.org/packages/70/c8/1b758bd903afee000f023cd03f335ff328a21b3914f9f9deda49b1e57723/wandb-0.24.2-py3-none-manylinux_2_28_x86_64.whl", hash = "sha256:38661c666e70d7e1f460fc0a0edab8a393eaaa5f8773c17be534961a7022779d", size = 23026085, upload-time = "2026-02-05T00:12:02.682Z" }, + { url = "https://files.pythonhosted.org/packages/60/87/724583f258aaeb2c368c79d7412167ce628f8a5ca667faed3cd427dd3be2/wandb-0.24.2-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:656a4272000999569eb8e0773f1259403bc6bd3e7d1c7d2238d3e359874da9c4", size = 21342088, upload-time = "2026-02-05T00:12:05.375Z" }, + { url = "https://files.pythonhosted.org/packages/1e/5c/e9b36ddc9beb2745a4fb1ec67ae7f995c31f7305a6d17837b72b228360ff/wandb-0.24.2-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:33cba098d95fd46720cc9023bd23e4a38e9b11836a836b4a57b8d41cff8985f2", size = 23120819, upload-time = "2026-02-05T00:12:07.487Z" }, + { url = "https://files.pythonhosted.org/packages/f6/6e/1ad011da4a5c860fdb88645c738a2dae914b1eea2249aa606659ccd1443f/wandb-0.24.2-py3-none-win32.whl", hash = "sha256:70db8680e8d7edb5bd60dfb7f31aeb5af30b31ad72498c47e1aba7471c337bb2", size = 22295643, upload-time = "2026-02-05T00:12:09.85Z" }, + { url = "https://files.pythonhosted.org/packages/38/8b/721c77616bd1fca8963bffef309da09cdff71002f9d4201dfd5bd370591a/wandb-0.24.2-py3-none-win_amd64.whl", hash = "sha256:a78ac1fa116b196cd33250b3d80f4a5c05c141ad949175515c007ec9826e49a6", size = 22295646, upload-time = "2026-02-05T00:12:11.898Z" }, + { url = "https://files.pythonhosted.org/packages/3a/9a/f3919d7ee7ba99dabf0aac7e299c6c328f5eae94f9f6b28c76005f882d5d/wandb-0.24.2-py3-none-win_arm64.whl", hash = "sha256:b42614b99f8b9af69f88c15a84283a973c8cd5750e9c4752aa3ce21f13dbac9a", size = 20268261, upload-time = "2026-02-05T00:12:14.353Z" }, +] + +[[package]] +name = "watchfiles" +version = "1.2.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "anyio" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/cd/41/5e1a4bb12aac5f1493fa1bdc11154eca3b258ca4eba65d39c473fe19d8e9/watchfiles-1.2.0.tar.gz", hash = "sha256:c995fba777f1ea992f090f9236e9284cf7a5d1a0130dd5a3d82c598cacd76838", size = 108252, upload-time = "2026-05-18T04:32:04.251Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b8/2f/e42c992d2afda3108ea1c02acecc991b9f31d05c14adc2a7cee9ee211fc4/watchfiles-1.2.0-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:bc13eb17538be00c874699dc0abe4ee2bc8d50bb1166a6b9e175ef3fd7eb8f26", size = 400115, upload-time = "2026-05-18T04:32:02.06Z" }, + { url = "https://files.pythonhosted.org/packages/5f/8f/6af2ea19065c91d8b0ea3516fdfc8c0d349f407e8e9fbf4e5a17360de8ad/watchfiles-1.2.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2d95ddc1eb6914154253d239089900813f6a767e174b8e6a50e7fdacb7e4236c", size = 393659, upload-time = "2026-05-18T04:30:50.951Z" }, + { url = "https://files.pythonhosted.org/packages/13/01/b32a967c56fb3e3e5be3db52c3d3b87fa4513aa367d8ed1ad96d42952e5f/watchfiles-1.2.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8f70d8b291ef6e88d19b1f297a6905ddb978888d9272b0d05e6f53309856bcfc", size = 453207, upload-time = "2026-05-18T04:31:04.231Z" }, + { url = "https://files.pythonhosted.org/packages/04/98/97557a812180338cb1abd32e1cffcc4588f59b5f23e0cb006b2ba95ba64a/watchfiles-1.2.0-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:56d8641cf834c2836922899105bd3ce3d0dfc69291d52edf0b4d0436829b34c0", size = 459273, upload-time = "2026-05-18T04:31:50.377Z" }, + { url = "https://files.pythonhosted.org/packages/e8/a8/b4b08dcb7653b8087c6586f7ce649505900e866bbcfe40dc9587af02e686/watchfiles-1.2.0-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2581a94056e55d7d0a31a823ea92bf73749c489ca2285bfdc0fbe6b2bb49d50c", size = 489927, upload-time = "2026-05-18T04:31:42.485Z" }, + { url = "https://files.pythonhosted.org/packages/50/94/3dceea03545d2e5ddfd839f0ddd5e1cecbf1697b5a428d5ba11cef6af95d/watchfiles-1.2.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:41bc1199f7523b3f82843c88cbb979180c949caef0342cf90968f178e5d49b01", size = 570476, upload-time = "2026-05-18T04:31:03.071Z" }, + { url = "https://files.pythonhosted.org/packages/cc/f2/d39a5450c3532092b91f81d274360e613c2371bc874a89c7a1a3c5e8d138/watchfiles-1.2.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7571e4464cb6e434958f867f7f730b8ab0b75e3f8e5eac0499168486ab3c33a8", size = 465650, upload-time = "2026-05-18T04:30:12.701Z" }, + { url = "https://files.pythonhosted.org/packages/22/24/ed72f68cbc1333ca9b9f2200aa048bb6658ae41709bc1caad4310f4bdffd/watchfiles-1.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e53a384f76b631c3ae5334ce6a52f0baa3a911eb94a4eac7f160079868b716d5", size = 456398, upload-time = "2026-05-18T04:30:13.784Z" }, + { url = "https://files.pythonhosted.org/packages/0d/64/982ef4a4e5bab5b6e5b6becc8cd5e732f6130a78b855f0abec6439a9a135/watchfiles-1.2.0-cp312-cp312-manylinux_2_31_riscv64.whl", hash = "sha256:d20029a60a71a052a24c4db7673bc4de39ab89adbaccbfb5d67987c5d73f424d", size = 465140, upload-time = "2026-05-18T04:31:52.111Z" }, + { url = "https://files.pythonhosted.org/packages/a0/0c/95282abf4ed680b6096010bcfc30c5fa7a041fc5aa5a2ad17a2cc6c75bba/watchfiles-1.2.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:2cb93af48550faf1cea04c303107c8b75833de7013e57ce27d3b8d21d8d0f58c", size = 630259, upload-time = "2026-05-18T04:31:25.676Z" }, + { url = "https://files.pythonhosted.org/packages/30/45/607c1de1530c4bdcf2cf1d1ecc2505ddba5d96bd43ba9f2b0e79876f850f/watchfiles-1.2.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:2995c176de7692b86a2e4c58d9ec718f753150a979cb4a754e2b4ffa38e70906", size = 659859, upload-time = "2026-05-18T04:30:24.333Z" }, + { url = "https://files.pythonhosted.org/packages/fa/08/d9e2e0f9e8e6791d33aefc694ad7eefa7f901f63caff84a81ded38692f9c/watchfiles-1.2.0-cp312-cp312-win32.whl", hash = "sha256:7a2cffd17d27d2ecbb310c2b1d8174f222a5495b1a721894afa88ec11e25b898", size = 275480, upload-time = "2026-05-18T04:30:31.307Z" }, + { url = "https://files.pythonhosted.org/packages/1c/e6/9d42569c0102645cc8cea5d8c7d8a1e9d4ada2cb7f05f75e554b8aa2202a/watchfiles-1.2.0-cp312-cp312-win_amd64.whl", hash = "sha256:f155b3a1b2a5fc89cdc70d47ee5d54e3b75e88efa34982028a35daef9ba00379", size = 288718, upload-time = "2026-05-18T04:32:10.745Z" }, + { url = "https://files.pythonhosted.org/packages/0a/26/88e0dc6ee3898169d7fa22bb6a69cabf2502d2ee25cb8c876d1262d204f8/watchfiles-1.2.0-cp312-cp312-win_arm64.whl", hash = "sha256:8fa585ede612ee9f9e91b18bebf9ba11b9ae29a4e3a0d0cf6fca3e382133f0d5", size = 281026, upload-time = "2026-05-18T04:30:22.23Z" }, + { url = "https://files.pythonhosted.org/packages/d1/4d/70a7feced9f87e2ff26dba42667290f41694fc64646c67261fbb8cab5d5c/watchfiles-1.2.0-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:01ea8d66f0693b9b60a6541c8d10263091ca9a9060d242f3c1f3143f9aad2c98", size = 399730, upload-time = "2026-05-18T04:31:38.162Z" }, + { url = "https://files.pythonhosted.org/packages/31/3a/0da302f2307aee316922806ebd5726c542cbd787c938271cf14a074c7daf/watchfiles-1.2.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:7ba0480b9a74af058f43b337e937a451e109295c420916d68ad24e3dc02f5e44", size = 392842, upload-time = "2026-05-18T04:30:27.051Z" }, + { url = "https://files.pythonhosted.org/packages/db/ef/d5bdb705c224dbc256aa0c1ec47bf4e61ec52558f2afb44a71a1fe4d7015/watchfiles-1.2.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4f34e26a19f91f710c08e0183429f0d1d15df734e6bc78c31e77b9ea9c433658", size = 452989, upload-time = "2026-05-18T04:31:11.945Z" }, + { url = "https://files.pythonhosted.org/packages/71/29/5495f2c1661949ef7a35e4d71111d129cfe7606414a26887a919d0a55406/watchfiles-1.2.0-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:b4e77f6a55f858504069abd35d336a637555c09bca453dde1ee1e5ada8a6a1fb", size = 458978, upload-time = "2026-05-18T04:30:52.606Z" }, + { url = "https://files.pythonhosted.org/packages/d5/8c/7f9c07c433811c2fffd93e13fdfb7135de9aab5f2ae41be08960fa0047dc/watchfiles-1.2.0-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0cb4d80e212f116474a545c21c912b445f16bb0cef9e6a73a498164223e14e2f", size = 490248, upload-time = "2026-05-18T04:31:36.003Z" }, + { url = "https://files.pythonhosted.org/packages/3c/11/d93632febc52fbc21be90231bb7c17fd5387f46c9076fd40a5f9c2ae6910/watchfiles-1.2.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b974946a10af379d425e2eef5b62f5c6ebeaccf91d45eaad6f5b27ecd4f91aa0", size = 571847, upload-time = "2026-05-18T04:31:10.862Z" }, + { url = "https://files.pythonhosted.org/packages/55/b4/383173e73aabb07ad1d9c7aa859d95437ac46a6d6a1e11005facda0c9d19/watchfiles-1.2.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:86bc13c25a8d1fcd70b51d0ce7c9b65e90de5666fcbfd3e34957cc73ee19aeb5", size = 465974, upload-time = "2026-05-18T04:30:17.006Z" }, + { url = "https://files.pythonhosted.org/packages/a7/6c/89b1a230a78f57c52dd8893adb1f92f94411721b6ec12596c56d98c74356/watchfiles-1.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ca148d73dea36c9763aaa351e4d7a51780ec1584217c45276f4fe8239c768b71", size = 454782, upload-time = "2026-05-18T04:30:35.656Z" }, + { url = "https://files.pythonhosted.org/packages/24/62/1732118367cfff0a9fce3bf62ff4bfded09ef5df21d9d446b858b3f70a96/watchfiles-1.2.0-cp313-cp313-manylinux_2_31_riscv64.whl", hash = "sha256:c525543d91961c6955b2636b308569e84a1d1c5f5f2932041ab9ef46422f43e3", size = 465182, upload-time = "2026-05-18T04:30:20.846Z" }, + { url = "https://files.pythonhosted.org/packages/28/96/716f7e5f51339bf22963f3345f9f27d7f3b30e2eadc597e257c881dd3c53/watchfiles-1.2.0-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:a204794696ffb8f9b10fba6f7cb5216d42f3b2b71860ccac6b6e42f5f10973b0", size = 629841, upload-time = "2026-05-18T04:31:05.397Z" }, + { url = "https://files.pythonhosted.org/packages/4c/fe/c40783950fd771ccf66ab3ec2722d188a9af1c7f96c6e811f36e40c6e03f/watchfiles-1.2.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:10d86db20695afe7997ac9e1717637d6714a8d0220458c33f3d2061f54cec427", size = 658028, upload-time = "2026-05-18T04:31:48.22Z" }, + { url = "https://files.pythonhosted.org/packages/71/72/4508db1856d1d87fcbb3b63f4839bab1b5682cb0e8d224d122263c09654a/watchfiles-1.2.0-cp313-cp313-win32.whl", hash = "sha256:eb283ee99e21ad6443c8cdb06ac5b34b1308c329cbdf03fa02b445363714c799", size = 275183, upload-time = "2026-05-18T04:30:59.57Z" }, + { url = "https://files.pythonhosted.org/packages/f9/36/14b76ca57652e5cc5fd1c11f32a261292c08a0d19a00351013c2549cbfb2/watchfiles-1.2.0-cp313-cp313-win_amd64.whl", hash = "sha256:a0f27f01bee51861392bb6b7c4fdb290b27d1eb194e9e28788d68102a0e898d9", size = 288059, upload-time = "2026-05-18T04:32:07.937Z" }, + { url = "https://files.pythonhosted.org/packages/1b/8d/0a85e395398d8d20fadfe5c5d32c726eee17a519e78fb356f2cf7531bffe/watchfiles-1.2.0-cp313-cp313-win_arm64.whl", hash = "sha256:3651aa7058595e9cfb75d35dd5ada2bf9f48a5b8a0f3562821d3e210c507e077", size = 280186, upload-time = "2026-05-18T04:31:54.484Z" }, + { url = "https://files.pythonhosted.org/packages/37/68/36db056f1fdcc5f07302f56e631774d6835bcd6fa3ace402304621d5f9e5/watchfiles-1.2.0-cp313-cp313t-macosx_10_12_x86_64.whl", hash = "sha256:faea288b6f0ab1902ef08f4ca6de005dccf856c4e0c4f21b8c5fce02d90a1b08", size = 399031, upload-time = "2026-05-18T04:30:44.576Z" }, + { url = "https://files.pythonhosted.org/packages/c1/64/01a9d6f66a82a5c101ce939274106cc72759d62427e153f01edd2b9f87c2/watchfiles-1.2.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:01859b11fd9fbca670f4d5da00fbac282cfea9bd67a2125d8b2833a3b5617ea9", size = 391205, upload-time = "2026-05-18T04:30:25.413Z" }, + { url = "https://files.pythonhosted.org/packages/84/2c/0a44fe058cb4bb7b8ede6b6670698bbb7c0400740e378d00022189b7b31d/watchfiles-1.2.0-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fff610d7bb2256a317bb1e96f0d7862c7aa8076733ee5df0fd41bbe76a24a4f4", size = 451892, upload-time = "2026-05-18T04:32:14.005Z" }, + { url = "https://files.pythonhosted.org/packages/67/a1/351e0d56cd35e6488b5c8b4fb11a809a5bc923e8fe8fed9faf8920be0c89/watchfiles-1.2.0-cp313-cp313t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:b141a4891c995a039cd89e9a49e62df1dc8a559a5d1a6e4c7106d16c12777a55", size = 458867, upload-time = "2026-05-18T04:31:22.279Z" }, + { url = "https://files.pythonhosted.org/packages/d5/7d/9d09605187f1b838998624049fcf8bf47b73c1a3b76901fcac1782f62277/watchfiles-1.2.0-cp313-cp313t-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f22943b7770483f6ea0721c6b11d022947a98eb0acae14694de034f4d0d38925", size = 490217, upload-time = "2026-05-18T04:31:43.657Z" }, + { url = "https://files.pythonhosted.org/packages/60/5d/a17a16eccb182f04188cd308ec24b1a71a9b5c4e7098269cf35d9fa56d02/watchfiles-1.2.0-cp313-cp313t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1bc6195825b7dcd217968bb1f801a60fd4c16e8eeab5bedc7fe917d7d5995ab4", size = 571458, upload-time = "2026-05-18T04:32:11.875Z" }, + { url = "https://files.pythonhosted.org/packages/d3/3d/4dd457062083ab1938e5dfd45032eb425cee2ac817287ca8ff4356183e5d/watchfiles-1.2.0-cp313-cp313t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d4a4b147f5dca2a5d325a06a832fb43f345751adfbc63204aec30e0d9ca965a2", size = 464707, upload-time = "2026-05-18T04:30:43.492Z" }, + { url = "https://files.pythonhosted.org/packages/c6/71/ea8c57b128f5383de74d0c7d2d9c57ad7c9a65a930c451bd25d524b295b7/watchfiles-1.2.0-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4543579a9bdb0c9560039b4ffddbdb39545707659fbc430ce4c10f3f68d557f9", size = 454663, upload-time = "2026-05-18T04:30:16.061Z" }, + { url = "https://files.pythonhosted.org/packages/53/fd/2e812bf938406d7db351f0703ddd3fc6c061cf30d96153a77bc79a943a44/watchfiles-1.2.0-cp313-cp313t-manylinux_2_31_riscv64.whl", hash = "sha256:20aa0e708b920bde876a4aa82dc7dd6ebea228a63a67cda6632c2fc87b787efa", size = 463537, upload-time = "2026-05-18T04:31:44.9Z" }, + { url = "https://files.pythonhosted.org/packages/86/56/d17a7f1dd1bc3035f1072694a551301272f1739c2d8e319c927cb9e29b38/watchfiles-1.2.0-cp313-cp313t-musllinux_1_1_aarch64.whl", hash = "sha256:d413349d565dab74297f2a63e84a097936be69bf8f3b3801f27f380e32040f44", size = 629194, upload-time = "2026-05-18T04:31:14.141Z" }, + { url = "https://files.pythonhosted.org/packages/be/06/f1ff66bf5cae50aa4062779a0ecd0bbaf15e466195719074078947d9a17d/watchfiles-1.2.0-cp313-cp313t-musllinux_1_1_x86_64.whl", hash = "sha256:f28b2725eb8cce327b9b3ab02415c853011dc55c95832fe90de6bc56f5315f72", size = 656194, upload-time = "2026-05-18T04:31:47.14Z" }, + { url = "https://files.pythonhosted.org/packages/e7/54/a9c7ea9a82a4ac65e7004c0a03920b5cdd2f9c3b678757d9cd425aa51d53/watchfiles-1.2.0-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:b8c8358484d5fa12ef34f05b7f4168eaf1932f408725ff6d023c33ec17bd79d4", size = 400205, upload-time = "2026-05-18T04:32:05.153Z" }, + { url = "https://files.pythonhosted.org/packages/aa/5d/c9ab3534374a4a67450696905d6ef16a04405448b8dc52bd752ae50423d4/watchfiles-1.2.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:9f04b092229ad2c50126dd3c922c8822e51e605993764a33058d4a791ab42281", size = 392508, upload-time = "2026-05-18T04:30:54.849Z" }, + { url = "https://files.pythonhosted.org/packages/26/ca/1ad30103535cf0cecd7b993e8d50edc5351b1820e38f2d22e3df58962feb/watchfiles-1.2.0-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7a7ce236284f002a156f70add88efe5c70879cccbb658be0822c54b1306fc09d", size = 452448, upload-time = "2026-05-18T04:30:53.727Z" }, + { url = "https://files.pythonhosted.org/packages/37/a1/ceee2cdf2afbd715fa07758d39c9859513eae411b23196f7fd039e5feedd/watchfiles-1.2.0-cp314-cp314-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:b9909cc2b48468b575eefa944919e1fe8a36c5849d5c7c168f80a8c1db69398e", size = 459605, upload-time = "2026-05-18T04:30:23.312Z" }, + { url = "https://files.pythonhosted.org/packages/e8/f6/421e30fd1cb3907a84ed92ab3f1983e37ba2dca015e9a894a048418417a2/watchfiles-1.2.0-cp314-cp314-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0a37faaed405c67e28e6be45a1fa4f206ef5a2860f27c237db9fa30704c38242", size = 490757, upload-time = "2026-05-18T04:30:47.358Z" }, + { url = "https://files.pythonhosted.org/packages/41/b0/55ed1b97ed08be7bba6f9a541cac15f2a858e1d74d2b07b6da70a82aab00/watchfiles-1.2.0-cp314-cp314-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9649193aa27bd9ff2e80ff29bfaa93085496c7a3a377592823cc58b77ee88add", size = 568672, upload-time = "2026-05-18T04:30:38.915Z" }, + { url = "https://files.pythonhosted.org/packages/d1/cf/d8ae8a80dd7bafab395ea7681c10237311bbf34d37704a8c744e7cf31fc7/watchfiles-1.2.0-cp314-cp314-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4e4ff8e37f99cf1da89e255e07c9c4b37c214038c4283707bdec308cb1b0ea1f", size = 464197, upload-time = "2026-05-18T04:30:09.914Z" }, + { url = "https://files.pythonhosted.org/packages/7c/8a/3076c496ca8dafe0e8cd03fcebdfc47be4b1174b4e5b24ff6e396e6b3af2/watchfiles-1.2.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:054dc20fd2e3132b4c3883b4a00d72fd6e1f56fdaf89fccd12e8057d74cd74d7", size = 453181, upload-time = "2026-05-18T04:30:14.829Z" }, + { url = "https://files.pythonhosted.org/packages/e5/10/9745e17c98e7b8a86454df0a3c7b5686bd650383f1e9f26e4ebcbd6cc0c0/watchfiles-1.2.0-cp314-cp314-manylinux_2_31_riscv64.whl", hash = "sha256:e140ed30ebde76796b686e67c182cff10ea2fbab186fafd1560f74bb5a473a6e", size = 465109, upload-time = "2026-05-18T04:30:28.123Z" }, + { url = "https://files.pythonhosted.org/packages/8f/95/8ef4a95481d3e0cb52d62a06fa6e972e81424be2d9698b91a2fecca9904c/watchfiles-1.2.0-cp314-cp314-musllinux_1_1_aarch64.whl", hash = "sha256:bb7e52ecf68ba46d22df23467b87cffeb2146908aa523ebfe803019618cfda06", size = 630653, upload-time = "2026-05-18T04:31:49.304Z" }, + { url = "https://files.pythonhosted.org/packages/fd/e4/3b3bf36b0f829b50c6ebcb8d031583863c59f923d6a6af3d485e470d0fac/watchfiles-1.2.0-cp314-cp314-musllinux_1_1_x86_64.whl", hash = "sha256:23282a321c8baf9b3a3c4afff673f9fe65eb7fdc2338d765ccad9d3d1916a5ba", size = 657838, upload-time = "2026-05-18T04:31:06.497Z" }, + { url = "https://files.pythonhosted.org/packages/21/b1/6cbbb50c1f3002ab568777d44aa21206dfb8807a840990c4037523b51812/watchfiles-1.2.0-cp314-cp314-win32.whl", hash = "sha256:c0db965c5f79aa49fe672d297cf1febc5ad149b658594944f49a54a2b96270a7", size = 275108, upload-time = "2026-05-18T04:30:06.891Z" }, + { url = "https://files.pythonhosted.org/packages/92/45/190ce6db8dcb4536682cf75d3889ff1a27182a58cb519d343cb6d9ea63d8/watchfiles-1.2.0-cp314-cp314-win_amd64.whl", hash = "sha256:71283b39fd17e5408eb123bd37aeecfd9d54c81fc184421943208aadb879d103", size = 288441, upload-time = "2026-05-18T04:32:12.901Z" }, + { url = "https://files.pythonhosted.org/packages/74/0d/3eae1c2313ab08378431d907c3f8095ecca00f3eda33111cf4f0f2591799/watchfiles-1.2.0-cp314-cp314-win_arm64.whl", hash = "sha256:c5c19526f4e54a00f2666a6c0e9e40d582c09e865055ea7378bf0009aab857b3", size = 280684, upload-time = "2026-05-18T04:31:26.902Z" }, + { url = "https://files.pythonhosted.org/packages/b1/75/fb64e6c25d6b5ca636d03df34ffb1c6e9873303e76d27967e045f8df088f/watchfiles-1.2.0-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:d73a585accffa5ae39c17264c36ec3166d2fad7000c780f5ef83b2722afb9dd2", size = 398857, upload-time = "2026-05-18T04:32:17.108Z" }, + { url = "https://files.pythonhosted.org/packages/73/4e/9f7adf01754cbf81843722ccfec169d8f26c69778281a302855cecd2ee08/watchfiles-1.2.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:ae99b14c5f21e026e0e9d96f40e07d8570ebee6cafd9d8fc318354606daa7a28", size = 392413, upload-time = "2026-05-18T04:31:07.911Z" }, + { url = "https://files.pythonhosted.org/packages/47/c8/bec626bcc2d69f44b9acb24ce7d60ed7b16b73628eea747fcbd169d8edda/watchfiles-1.2.0-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4429f3b105524a10b72c3a819b091c495d2811d419c1e1e8df773a5a5974f831", size = 452409, upload-time = "2026-05-18T04:31:20.142Z" }, + { url = "https://files.pythonhosted.org/packages/00/b7/b6362068e81e7c556d155a34c35d40ac3ef42d747b06d7f6e5bf58e359c2/watchfiles-1.2.0-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:43d818978d06062d9b22c4fab2ebe44cf5213d42dc8e62bda8c2760cfa2eeb33", size = 458827, upload-time = "2026-05-18T04:32:06.219Z" }, + { url = "https://files.pythonhosted.org/packages/67/f8/9a813fa42afb1e0b4625e75f0479826644d3ee8dc287e093799bc01f390c/watchfiles-1.2.0-cp314-cp314t-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b9f732dc58b2dbe69e464ccf8fff7a03b0dd0be439da4c0720d3558527d3d6b4", size = 490104, upload-time = "2026-05-18T04:31:56.034Z" }, + { url = "https://files.pythonhosted.org/packages/2f/bf/27dfb6094ca4c9aad21298b5525b6c53cb36121ee454331d05161e58d130/watchfiles-1.2.0-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8f200104103feb097de4cab8fe4f5dd18a2026934c7dea98c55a2f5fd6d5a33b", size = 571360, upload-time = "2026-05-18T04:31:57.133Z" }, + { url = "https://files.pythonhosted.org/packages/fb/39/44a096d67270ea93df91d33877dbe91fbda3aa4f8ec2edf799d93eda8736/watchfiles-1.2.0-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:63ac26eefbf4af1741247d6fb68b11c49a25b2f7413fbd318a83a12aaa9cf666", size = 464644, upload-time = "2026-05-18T04:30:57.33Z" }, + { url = "https://files.pythonhosted.org/packages/0e/80/c7472203bad6268e3ef1ad260739704847898938ad7ea8b63a5131f46b50/watchfiles-1.2.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0c4997d4e4a55f0d02b6cde327322daf3a0400e5df6c6b15948994bf72497925", size = 454771, upload-time = "2026-05-18T04:30:48.736Z" }, + { url = "https://files.pythonhosted.org/packages/51/cf/3b10b268b4b7f0fc26e9debb5eef1998b515887840f444cd3ec80c688755/watchfiles-1.2.0-cp314-cp314t-manylinux_2_31_riscv64.whl", hash = "sha256:4c887eba18b7945ac73067a8b4a66f21cd46c2539b2bc68588f7be6c7eb6d26b", size = 463494, upload-time = "2026-05-18T04:31:33.826Z" }, + { url = "https://files.pythonhosted.org/packages/3d/3e/a4302545cd589262a0dc7d140e86f7688eba3f9c72776c27f7e23b8864c4/watchfiles-1.2.0-cp314-cp314t-musllinux_1_1_aarch64.whl", hash = "sha256:3416ff151bb6b5a8d8d11664974fbef4d9305b9b2957839ab5a270468fd8df30", size = 629383, upload-time = "2026-05-18T04:31:15.596Z" }, + { url = "https://files.pythonhosted.org/packages/db/99/d5649df0a9a410d45b7c882304d0b790903ac9b6e8f2cfd12114e0c6b9f2/watchfiles-1.2.0-cp314-cp314t-musllinux_1_1_x86_64.whl", hash = "sha256:0e831a271c035d89789cffc386b6aa1375f39f1cd25eb7ca0997e4970d152fc5", size = 656093, upload-time = "2026-05-18T04:31:58.707Z" }, + { url = "https://files.pythonhosted.org/packages/92/b9/362702539275019a54dd2e94511b31a9b89c5f9e6a21966de7eb692549fc/watchfiles-1.2.0-cp315-cp315-macosx_10_12_x86_64.whl", hash = "sha256:37a6721cdf3f65dbb13aa9503510ccb4451603ac837e44d265d7992a597e1374", size = 400109, upload-time = "2026-05-18T04:31:16.879Z" }, + { url = "https://files.pythonhosted.org/packages/8f/75/71d5ba62db781e5587bded1d944c675374bc4aa37ff33d5018d98e8b6538/watchfiles-1.2.0-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:2b37d10b5a63bd4d87e18472d80fa525bd670586fae62e5dd580452764879b65", size = 392167, upload-time = "2026-05-18T04:31:28.058Z" }, + { url = "https://files.pythonhosted.org/packages/3c/01/c66dd95d0423fe30d31820e2d1d5bda773764131bbb6ac0cb1cf303ac328/watchfiles-1.2.0-cp315-cp315-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0a105bc2283f67e8fbec74253ec2d94925de92ed72c0393f1206bf326b7b7b69", size = 452372, upload-time = "2026-05-18T04:31:00.836Z" }, + { url = "https://files.pythonhosted.org/packages/91/15/2fe99557e72f85627c6a8eed50d889e8d101623e060a22ad75b875cb932d/watchfiles-1.2.0-cp315-cp315-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5327989a465505f05cfe06f04fa9d0c2fd5432bb243e10e6f012b1bdca3c8579", size = 459596, upload-time = "2026-05-18T04:31:34.96Z" }, + { url = "https://files.pythonhosted.org/packages/ed/23/d4acfa0023367428ed48351b3b9b267893037b6cadae55620c61c24bcfd4/watchfiles-1.2.0-cp315-cp315-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ecb47f183a8025b2aa18b546725c3657e542112ae9c0613a2af79b4fa8d04ad7", size = 490869, upload-time = "2026-05-18T04:31:59.923Z" }, + { url = "https://files.pythonhosted.org/packages/a4/5f/3164cbdce06c9fb95c4f7b9e2f9760b5e2797af43a9ecc317ef42a23a278/watchfiles-1.2.0-cp315-cp315-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8520a4ab0e37f770afc34459c4f8f7019e153f9124dc101c15538365875d1ab2", size = 571641, upload-time = "2026-05-18T04:32:00.948Z" }, + { url = "https://files.pythonhosted.org/packages/41/e6/85d3731c55e65cd7690f3f803d24c139588aaf863e4bf2148fe7a7fa1a19/watchfiles-1.2.0-cp315-cp315-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:71cd71740ed2c15211ebb237ced4e39a1cdf6f80566e5fe95428da1626f4fde6", size = 464444, upload-time = "2026-05-18T04:30:34.298Z" }, + { url = "https://files.pythonhosted.org/packages/f4/7d/562641012b8b09872742c3b8adf9629ec479fd78f8d68ae4a0c13da8add6/watchfiles-1.2.0-cp315-cp315-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f88af53d6ddaf72179ef613ddc905e6f4785f712b49b80b3bef9f3525e6194b4", size = 453593, upload-time = "2026-05-18T04:31:23.464Z" }, + { url = "https://files.pythonhosted.org/packages/56/fe/cb8ef3d6f929d14158fdaaad9925985b7310abc9384dcd4d82dd0016fb59/watchfiles-1.2.0-cp315-cp315-manylinux_2_31_riscv64.whl", hash = "sha256:cee9d5efd929efdac5f7e58f72b3376f676b64050a91c5b99a7094c5b2317488", size = 465096, upload-time = "2026-05-18T04:31:30.384Z" }, + { url = "https://files.pythonhosted.org/packages/25/91/80908e835e100527a9267147b08c0eee1fa6ab0ffec15edc04d1d44885f7/watchfiles-1.2.0-cp315-cp315-musllinux_1_1_aarch64.whl", hash = "sha256:b718bf356bbc15e559bd8ef41782b573b8ae0e3f177ab244b440568d7ea02cfb", size = 630638, upload-time = "2026-05-18T04:30:49.89Z" }, + { url = "https://files.pythonhosted.org/packages/46/4b/95ab2f256bb4af3cb2eb23b9317bda984ee6e0f11733a5c004a6c95b06e3/watchfiles-1.2.0-cp315-cp315-musllinux_1_1_x86_64.whl", hash = "sha256:922c0e019fe68b3ae392965a766b02a71ba1168c932cebc3733cd52c5fe5b377", size = 657684, upload-time = "2026-05-18T04:31:32.027Z" }, +] + +[[package]] +name = "websockets" +version = "16.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/04/24/4b2031d72e840ce4c1ccb255f693b15c334757fc50023e4db9537080b8c4/websockets-16.0.tar.gz", hash = "sha256:5f6261a5e56e8d5c42a4497b364ea24d94d9563e8fbd44e78ac40879c60179b5", size = 179346, upload-time = "2026-01-10T09:23:47.181Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/84/7b/bac442e6b96c9d25092695578dda82403c77936104b5682307bd4deb1ad4/websockets-16.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:71c989cbf3254fbd5e84d3bff31e4da39c43f884e64f2551d14bb3c186230f00", size = 177365, upload-time = "2026-01-10T09:22:46.787Z" }, + { url = "https://files.pythonhosted.org/packages/b0/fe/136ccece61bd690d9c1f715baaeefd953bb2360134de73519d5df19d29ca/websockets-16.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:8b6e209ffee39ff1b6d0fa7bfef6de950c60dfb91b8fcead17da4ee539121a79", size = 175038, upload-time = "2026-01-10T09:22:47.999Z" }, + { url = "https://files.pythonhosted.org/packages/40/1e/9771421ac2286eaab95b8575b0cb701ae3663abf8b5e1f64f1fd90d0a673/websockets-16.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:86890e837d61574c92a97496d590968b23c2ef0aeb8a9bc9421d174cd378ae39", size = 175328, upload-time = "2026-01-10T09:22:49.809Z" }, + { url = "https://files.pythonhosted.org/packages/18/29/71729b4671f21e1eaa5d6573031ab810ad2936c8175f03f97f3ff164c802/websockets-16.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:9b5aca38b67492ef518a8ab76851862488a478602229112c4b0d58d63a7a4d5c", size = 184915, upload-time = "2026-01-10T09:22:51.071Z" }, + { url = "https://files.pythonhosted.org/packages/97/bb/21c36b7dbbafc85d2d480cd65df02a1dc93bf76d97147605a8e27ff9409d/websockets-16.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e0334872c0a37b606418ac52f6ab9cfd17317ac26365f7f65e203e2d0d0d359f", size = 186152, upload-time = "2026-01-10T09:22:52.224Z" }, + { url = "https://files.pythonhosted.org/packages/4a/34/9bf8df0c0cf88fa7bfe36678dc7b02970c9a7d5e065a3099292db87b1be2/websockets-16.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:a0b31e0b424cc6b5a04b8838bbaec1688834b2383256688cf47eb97412531da1", size = 185583, upload-time = "2026-01-10T09:22:53.443Z" }, + { url = "https://files.pythonhosted.org/packages/47/88/4dd516068e1a3d6ab3c7c183288404cd424a9a02d585efbac226cb61ff2d/websockets-16.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:485c49116d0af10ac698623c513c1cc01c9446c058a4e61e3bf6c19dff7335a2", size = 184880, upload-time = "2026-01-10T09:22:55.033Z" }, + { url = "https://files.pythonhosted.org/packages/91/d6/7d4553ad4bf1c0421e1ebd4b18de5d9098383b5caa1d937b63df8d04b565/websockets-16.0-cp312-cp312-win32.whl", hash = "sha256:eaded469f5e5b7294e2bdca0ab06becb6756ea86894a47806456089298813c89", size = 178261, upload-time = "2026-01-10T09:22:56.251Z" }, + { url = "https://files.pythonhosted.org/packages/c3/f0/f3a17365441ed1c27f850a80b2bc680a0fa9505d733fe152fdf5e98c1c0b/websockets-16.0-cp312-cp312-win_amd64.whl", hash = "sha256:5569417dc80977fc8c2d43a86f78e0a5a22fee17565d78621b6bb264a115d4ea", size = 178693, upload-time = "2026-01-10T09:22:57.478Z" }, + { url = "https://files.pythonhosted.org/packages/cc/9c/baa8456050d1c1b08dd0ec7346026668cbc6f145ab4e314d707bb845bf0d/websockets-16.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:878b336ac47938b474c8f982ac2f7266a540adc3fa4ad74ae96fea9823a02cc9", size = 177364, upload-time = "2026-01-10T09:22:59.333Z" }, + { url = "https://files.pythonhosted.org/packages/7e/0c/8811fc53e9bcff68fe7de2bcbe75116a8d959ac699a3200f4847a8925210/websockets-16.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:52a0fec0e6c8d9a784c2c78276a48a2bdf099e4ccc2a4cad53b27718dbfd0230", size = 175039, upload-time = "2026-01-10T09:23:01.171Z" }, + { url = "https://files.pythonhosted.org/packages/aa/82/39a5f910cb99ec0b59e482971238c845af9220d3ab9fa76dd9162cda9d62/websockets-16.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:e6578ed5b6981005df1860a56e3617f14a6c307e6a71b4fff8c48fdc50f3ed2c", size = 175323, upload-time = "2026-01-10T09:23:02.341Z" }, + { url = "https://files.pythonhosted.org/packages/bd/28/0a25ee5342eb5d5f297d992a77e56892ecb65e7854c7898fb7d35e9b33bd/websockets-16.0-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:95724e638f0f9c350bb1c2b0a7ad0e83d9cc0c9259f3ea94e40d7b02a2179ae5", size = 184975, upload-time = "2026-01-10T09:23:03.756Z" }, + { url = "https://files.pythonhosted.org/packages/f9/66/27ea52741752f5107c2e41fda05e8395a682a1e11c4e592a809a90c6a506/websockets-16.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c0204dc62a89dc9d50d682412c10b3542d748260d743500a85c13cd1ee4bde82", size = 186203, upload-time = "2026-01-10T09:23:05.01Z" }, + { url = "https://files.pythonhosted.org/packages/37/e5/8e32857371406a757816a2b471939d51c463509be73fa538216ea52b792a/websockets-16.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:52ac480f44d32970d66763115edea932f1c5b1312de36df06d6b219f6741eed8", size = 185653, upload-time = "2026-01-10T09:23:06.301Z" }, + { url = "https://files.pythonhosted.org/packages/9b/67/f926bac29882894669368dc73f4da900fcdf47955d0a0185d60103df5737/websockets-16.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:6e5a82b677f8f6f59e8dfc34ec06ca6b5b48bc4fcda346acd093694cc2c24d8f", size = 184920, upload-time = "2026-01-10T09:23:07.492Z" }, + { url = "https://files.pythonhosted.org/packages/3c/a1/3d6ccdcd125b0a42a311bcd15a7f705d688f73b2a22d8cf1c0875d35d34a/websockets-16.0-cp313-cp313-win32.whl", hash = "sha256:abf050a199613f64c886ea10f38b47770a65154dc37181bfaff70c160f45315a", size = 178255, upload-time = "2026-01-10T09:23:09.245Z" }, + { url = "https://files.pythonhosted.org/packages/6b/ae/90366304d7c2ce80f9b826096a9e9048b4bb760e44d3b873bb272cba696b/websockets-16.0-cp313-cp313-win_amd64.whl", hash = "sha256:3425ac5cf448801335d6fdc7ae1eb22072055417a96cc6b31b3861f455fbc156", size = 178689, upload-time = "2026-01-10T09:23:10.483Z" }, + { url = "https://files.pythonhosted.org/packages/f3/1d/e88022630271f5bd349ed82417136281931e558d628dd52c4d8621b4a0b2/websockets-16.0-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:8cc451a50f2aee53042ac52d2d053d08bf89bcb31ae799cb4487587661c038a0", size = 177406, upload-time = "2026-01-10T09:23:12.178Z" }, + { url = "https://files.pythonhosted.org/packages/f2/78/e63be1bf0724eeb4616efb1ae1c9044f7c3953b7957799abb5915bffd38e/websockets-16.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:daa3b6ff70a9241cf6c7fc9e949d41232d9d7d26fd3522b1ad2b4d62487e9904", size = 175085, upload-time = "2026-01-10T09:23:13.511Z" }, + { url = "https://files.pythonhosted.org/packages/bb/f4/d3c9220d818ee955ae390cf319a7c7a467beceb24f05ee7aaaa2414345ba/websockets-16.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:fd3cb4adb94a2a6e2b7c0d8d05cb94e6f1c81a0cf9dc2694fb65c7e8d94c42e4", size = 175328, upload-time = "2026-01-10T09:23:14.727Z" }, + { url = "https://files.pythonhosted.org/packages/63/bc/d3e208028de777087e6fb2b122051a6ff7bbcca0d6df9d9c2bf1dd869ae9/websockets-16.0-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:781caf5e8eee67f663126490c2f96f40906594cb86b408a703630f95550a8c3e", size = 185044, upload-time = "2026-01-10T09:23:15.939Z" }, + { url = "https://files.pythonhosted.org/packages/ad/6e/9a0927ac24bd33a0a9af834d89e0abc7cfd8e13bed17a86407a66773cc0e/websockets-16.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:caab51a72c51973ca21fa8a18bd8165e1a0183f1ac7066a182ff27107b71e1a4", size = 186279, upload-time = "2026-01-10T09:23:17.148Z" }, + { url = "https://files.pythonhosted.org/packages/b9/ca/bf1c68440d7a868180e11be653c85959502efd3a709323230314fda6e0b3/websockets-16.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:19c4dc84098e523fd63711e563077d39e90ec6702aff4b5d9e344a60cb3c0cb1", size = 185711, upload-time = "2026-01-10T09:23:18.372Z" }, + { url = "https://files.pythonhosted.org/packages/c4/f8/fdc34643a989561f217bb477cbc47a3a07212cbda91c0e4389c43c296ebf/websockets-16.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:a5e18a238a2b2249c9a9235466b90e96ae4795672598a58772dd806edc7ac6d3", size = 184982, upload-time = "2026-01-10T09:23:19.652Z" }, + { url = "https://files.pythonhosted.org/packages/dd/d1/574fa27e233764dbac9c52730d63fcf2823b16f0856b3329fc6268d6ae4f/websockets-16.0-cp314-cp314-win32.whl", hash = "sha256:a069d734c4a043182729edd3e9f247c3b2a4035415a9172fd0f1b71658a320a8", size = 177915, upload-time = "2026-01-10T09:23:21.458Z" }, + { url = "https://files.pythonhosted.org/packages/8a/f1/ae6b937bf3126b5134ce1f482365fde31a357c784ac51852978768b5eff4/websockets-16.0-cp314-cp314-win_amd64.whl", hash = "sha256:c0ee0e63f23914732c6d7e0cce24915c48f3f1512ec1d079ed01fc629dab269d", size = 178381, upload-time = "2026-01-10T09:23:22.715Z" }, + { url = "https://files.pythonhosted.org/packages/06/9b/f791d1db48403e1f0a27577a6beb37afae94254a8c6f08be4a23e4930bc0/websockets-16.0-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:a35539cacc3febb22b8f4d4a99cc79b104226a756aa7400adc722e83b0d03244", size = 177737, upload-time = "2026-01-10T09:23:24.523Z" }, + { url = "https://files.pythonhosted.org/packages/bd/40/53ad02341fa33b3ce489023f635367a4ac98b73570102ad2cdd770dacc9a/websockets-16.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:b784ca5de850f4ce93ec85d3269d24d4c82f22b7212023c974c401d4980ebc5e", size = 175268, upload-time = "2026-01-10T09:23:25.781Z" }, + { url = "https://files.pythonhosted.org/packages/74/9b/6158d4e459b984f949dcbbb0c5d270154c7618e11c01029b9bbd1bb4c4f9/websockets-16.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:569d01a4e7fba956c5ae4fc988f0d4e187900f5497ce46339c996dbf24f17641", size = 175486, upload-time = "2026-01-10T09:23:27.033Z" }, + { url = "https://files.pythonhosted.org/packages/e5/2d/7583b30208b639c8090206f95073646c2c9ffd66f44df967981a64f849ad/websockets-16.0-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:50f23cdd8343b984957e4077839841146f67a3d31ab0d00e6b824e74c5b2f6e8", size = 185331, upload-time = "2026-01-10T09:23:28.259Z" }, + { url = "https://files.pythonhosted.org/packages/45/b0/cce3784eb519b7b5ad680d14b9673a31ab8dcb7aad8b64d81709d2430aa8/websockets-16.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:152284a83a00c59b759697b7f9e9cddf4e3c7861dd0d964b472b70f78f89e80e", size = 186501, upload-time = "2026-01-10T09:23:29.449Z" }, + { url = "https://files.pythonhosted.org/packages/19/60/b8ebe4c7e89fb5f6cdf080623c9d92789a53636950f7abacfc33fe2b3135/websockets-16.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:bc59589ab64b0022385f429b94697348a6a234e8ce22544e3681b2e9331b5944", size = 186062, upload-time = "2026-01-10T09:23:31.368Z" }, + { url = "https://files.pythonhosted.org/packages/88/a8/a080593f89b0138b6cba1b28f8df5673b5506f72879322288b031337c0b8/websockets-16.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:32da954ffa2814258030e5a57bc73a3635463238e797c7375dc8091327434206", size = 185356, upload-time = "2026-01-10T09:23:32.627Z" }, + { url = "https://files.pythonhosted.org/packages/c2/b6/b9afed2afadddaf5ebb2afa801abf4b0868f42f8539bfe4b071b5266c9fe/websockets-16.0-cp314-cp314t-win32.whl", hash = "sha256:5a4b4cc550cb665dd8a47f868c8d04c8230f857363ad3c9caf7a0c3bf8c61ca6", size = 178085, upload-time = "2026-01-10T09:23:33.816Z" }, + { url = "https://files.pythonhosted.org/packages/9f/3e/28135a24e384493fa804216b79a6a6759a38cc4ff59118787b9fb693df93/websockets-16.0-cp314-cp314t-win_amd64.whl", hash = "sha256:b14dc141ed6d2dde437cddb216004bcac6a1df0935d79656387bd41632ba0bbd", size = 178531, upload-time = "2026-01-10T09:23:35.016Z" }, + { url = "https://files.pythonhosted.org/packages/6f/28/258ebab549c2bf3e64d2b0217b973467394a9cea8c42f70418ca2c5d0d2e/websockets-16.0-py3-none-any.whl", hash = "sha256:1637db62fad1dc833276dded54215f2c7fa46912301a24bd94d45d46a011ceec", size = 171598, upload-time = "2026-01-10T09:23:45.395Z" }, +] + +[[package]] +name = "xxhash" +version = "3.7.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/24/2f/e183a1b407002f5af81822bee18b61cdb94b8670208ef34734d8d2b8ebe9/xxhash-3.7.0.tar.gz", hash = "sha256:6cc4eefbb542a5d6ffd6d70ea9c502957c925e800f998c5630ecc809d6702bae", size = 82022, upload-time = "2026-04-25T11:10:32.553Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/f2/8a/51a14cdef4728c6c2337db8a7d8704422cc65676d9199d77215464c880af/xxhash-3.7.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:082c87bfdd2b9f457606c7a4a53457f4c4b48b0cdc48de0277f4349d79bb3d7a", size = 33357, upload-time = "2026-04-25T11:06:20.44Z" }, + { url = "https://files.pythonhosted.org/packages/b9/1b/0c2c933809421ffd9bf42b59315552c143c755db5d9a816b2f1ae273e884/xxhash-3.7.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:5e7ce913b61f35b0c1c839a49ac9c8e75dd8d860150688aed353b0ce1bf409d8", size = 30869, upload-time = "2026-04-25T11:06:21.989Z" }, + { url = "https://files.pythonhosted.org/packages/03/a8/89d5fdd6ee12d70ba99451de46dd0e8010167468dcd913ec855653f4dd50/xxhash-3.7.0-cp312-cp312-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:3beb1de3b1e9694fcdd853e570ee64c631c7062435d2f8c69c1adf809bc086f0", size = 194100, upload-time = "2026-04-25T11:06:23.586Z" }, + { url = "https://files.pythonhosted.org/packages/87/ee/2f9f2ed993e77206d1e66991290a1ebe22e843351ca3ebec8e49e01ba186/xxhash-3.7.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f3e7b689c3bce16699efcf736066f5c6cc4472c3840fe4b22bd8279daf4abdac", size = 212977, upload-time = "2026-04-25T11:06:25.019Z" }, + { url = "https://files.pythonhosted.org/packages/de/60/5a91644615a9e9d4e42c2e9925f1908e3a24e4e691d9de7340d565bea024/xxhash-3.7.0-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:a6545e6b409e3d5cbafc850fb84c55a1ca26ed15a6b11e3bf07a0e0cd84517c8", size = 236373, upload-time = "2026-04-25T11:06:26.482Z" }, + { url = "https://files.pythonhosted.org/packages/22/c0/f3a9384eaaed9d14d4d062a5d953aa0da489bfe9747877aa994caa87cd0b/xxhash-3.7.0-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:31ab1461c77a11461d703c88eb949e132a1c6515933cf675d97ec680f4bd18de", size = 212229, upload-time = "2026-04-25T11:06:28.065Z" }, + { url = "https://files.pythonhosted.org/packages/2e/67/02f07a9fd79726804190f2172c4894c3ed9a4ebccaca05653c84beb58025/xxhash-3.7.0-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:7c4d596b7676f811172687ec567cbafb9e4dea2f9be1bbb4f622410cb7f40f40", size = 445462, upload-time = "2026-04-25T11:06:30.048Z" }, + { url = "https://files.pythonhosted.org/packages/40/37/558f5a90c0672fc9b4402dc25d87ac5b7406616e8969430c9ca4e52ee74d/xxhash-3.7.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:13805f0461cba0a857924e70ff91ae6d52d2598f79a884e788db80532614a4a1", size = 193932, upload-time = "2026-04-25T11:06:31.857Z" }, + { url = "https://files.pythonhosted.org/packages/d5/90/aaa09cd58661d32044dbbad7df55bbe22a623032b810e7ed3b8c569a2a6f/xxhash-3.7.0-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:1d398f372496152f1c6933a33566373f8d1b37b98b8c9d608fa6edc0976f23b2", size = 284807, upload-time = "2026-04-25T11:06:33.697Z" }, + { url = "https://files.pythonhosted.org/packages/d6/f3/53df3719ab127a02c174f0c1c74924fcd110866e89c966bc7909cfa8fa84/xxhash-3.7.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:d610aa62cdb7d4d497740741772a24a794903bf3e79eaa51d2e800082abe11e5", size = 210445, upload-time = "2026-04-25T11:06:35.488Z" }, + { url = "https://files.pythonhosted.org/packages/72/33/d219975c0e8b6fa2eb9ccd486fe47e21bf1847985b878dd2fbc3126e0d5c/xxhash-3.7.0-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:073c23900a9fbf3d26616c17c830db28af9803677cd5b33aea3224d824111514", size = 241273, upload-time = "2026-04-25T11:06:37.24Z" }, + { url = "https://files.pythonhosted.org/packages/3e/50/49b1afe610eb3964cedcb90a4d4c3d46a261ee8669cbd4f060652619ae3c/xxhash-3.7.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:418a463c3e6a590c0cdc890f8be19adb44a8c8acd175ca5b2a6de77e61d0b386", size = 197950, upload-time = "2026-04-25T11:06:39.148Z" }, + { url = "https://files.pythonhosted.org/packages/c6/75/5f42a1a4c78717d906a4b6a140c6dbf837ab1f547a54d23c4e2903310936/xxhash-3.7.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:03f8ff4474ee61c845758ce00711d7087a770d77efb36f7e74a6e867301000b8", size = 210709, upload-time = "2026-04-25T11:06:40.958Z" }, + { url = "https://files.pythonhosted.org/packages/8a/85/237e446c25abced71e9c53d269f2cef5bab8a82b3f88a12e00c5368e7368/xxhash-3.7.0-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:44fba4a5f1d179b7ddc7b3dc40f56f9209046421679b57025d4d8821b376fd8d", size = 275345, upload-time = "2026-04-25T11:06:42.525Z" }, + { url = "https://files.pythonhosted.org/packages/62/34/c2c26c0a6a9cc739bc2a5f0ae03ba8b87deb12b8bce35f7ac495e790dc6d/xxhash-3.7.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:31e3516a0f829d06ded4a2c0f3c7c5561993256bfa1c493975fb9dc7bfa828a1", size = 414056, upload-time = "2026-04-25T11:06:44.343Z" }, + { url = "https://files.pythonhosted.org/packages/a0/aa/5c58e9bc8071b8afd8dcf297ff362f723c4892168faba149f19904132bf4/xxhash-3.7.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:b59ee2ac81de57771a09ecad09191e840a1d2fae1ef684208320591055768f83", size = 191485, upload-time = "2026-04-25T11:06:46.262Z" }, + { url = "https://files.pythonhosted.org/packages/d4/69/a929cf9d1e2e65a48b818cdce72cb6b69eab2e6877f21436d0a1942aff43/xxhash-3.7.0-cp312-cp312-win32.whl", hash = "sha256:74bbd92f8c7fcc397ba0a11bfdc106bc72ad7f11e3a60277753f87e7532b4d81", size = 30671, upload-time = "2026-04-25T11:06:48.039Z" }, + { url = "https://files.pythonhosted.org/packages/b9/1b/104b41a8947f4e1d4a66ce1e628eea752f37d1890bfd7453559ca7a3d950/xxhash-3.7.0-cp312-cp312-win_amd64.whl", hash = "sha256:7bd7bc82dd4f185f28f35193c2e968ef46131628e3cac62f639dadf321cba4d1", size = 31514, upload-time = "2026-04-25T11:06:49.279Z" }, + { url = "https://files.pythonhosted.org/packages/98/a0/1fd0ea1f1b886d9e7c73f0397571e22333a7d79e31da6d7127c2a4a71d75/xxhash-3.7.0-cp312-cp312-win_arm64.whl", hash = "sha256:7d7148180ec99ba36585b42c8c5de25e9b40191613bc4be68909b4d25a77a852", size = 27761, upload-time = "2026-04-25T11:06:50.448Z" }, + { url = "https://files.pythonhosted.org/packages/c1/ca/d5174b4c36d10f64d4ca7050563138c5a599efb01a765858ddefc9c1202a/xxhash-3.7.0-cp313-cp313-android_21_arm64_v8a.whl", hash = "sha256:4b6d6b33f141158692bd4eafbb96edbc5aa0dabdb593a962db01a91983d4f8fa", size = 36813, upload-time = "2026-04-25T11:06:51.73Z" }, + { url = "https://files.pythonhosted.org/packages/41/d0/abc6c9d347ba1f1e1e1d98125d0881a0452c7f9a76a9dd03a7b5d2197f23/xxhash-3.7.0-cp313-cp313-android_21_x86_64.whl", hash = "sha256:845d347df254d6c619f616afa921331bada8614b8d373d58725c663ba97c3605", size = 35121, upload-time = "2026-04-25T11:06:53.048Z" }, + { url = "https://files.pythonhosted.org/packages/bf/11/4cc834eb3d79f2f2b3a6ef7324195208bcdfbdcf7534d2b17267aa5f3a8f/xxhash-3.7.0-cp313-cp313-ios_13_0_arm64_iphoneos.whl", hash = "sha256:fddbbb69a6fff4f421e7a0d1fa28f894b20112e9e3fab306af451e2dfd0e459b", size = 29624, upload-time = "2026-04-25T11:06:54.311Z" }, + { url = "https://files.pythonhosted.org/packages/23/83/e97d3e7b635fe73a1dfb1e91f805324dd6d930bb42041cbf18f183bc0b6d/xxhash-3.7.0-cp313-cp313-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:54876a4e45101cec2bf8f31a973cda073a23e2e108538dad224ba07f85f22487", size = 30638, upload-time = "2026-04-25T11:06:55.864Z" }, + { url = "https://files.pythonhosted.org/packages/f4/40/d84951d80c35db1f4c40a29a64a8520eea5d56e764c603906b4fe763580f/xxhash-3.7.0-cp313-cp313-ios_13_0_x86_64_iphonesimulator.whl", hash = "sha256:0c72fe9c7e3d6dfd7f1e21e224a877917fa09c465694ba4e06464b9511b65544", size = 33323, upload-time = "2026-04-25T11:06:57.336Z" }, + { url = "https://files.pythonhosted.org/packages/89/cc/c7dc6558d97e9ab023f663d69ab28b340ed9bf4d2d94f2c259cf896bb354/xxhash-3.7.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:a6d73a830b17ef49bc04e00182bd839164c1b3c59c127cd7c54fcb10c7ed8ee8", size = 33362, upload-time = "2026-04-25T11:06:58.656Z" }, + { url = "https://files.pythonhosted.org/packages/2a/6e/46b84017b1301d54091430353d4ad5901654a3e0871649877a416f7f1644/xxhash-3.7.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:91c3b07cf3362086d8f126c6aecd8e5e9396ad8b2f2219ea7e49a8250c318acd", size = 30874, upload-time = "2026-04-25T11:06:59.834Z" }, + { url = "https://files.pythonhosted.org/packages/df/5e/8f9158e3ab906ad3fec51e09b5ea0093e769f12207bfa42a368ca204e7ab/xxhash-3.7.0-cp313-cp313-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:50e879ebbac351c81565ca108db766d7832f5b8b6a5b14b8c0151f7190028e3d", size = 194185, upload-time = "2026-04-25T11:07:01.658Z" }, + { url = "https://files.pythonhosted.org/packages/f3/29/a804ded9f5d3d3758292678d23e7528b08fda7b7e750688d08b052322475/xxhash-3.7.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:921c14e93817842dd0dd9f372890a0f0c72e534650b6ab13c5be5cd0db11d47e", size = 213033, upload-time = "2026-04-25T11:07:03.606Z" }, + { url = "https://files.pythonhosted.org/packages/8b/91/1ce5a7d2fdc975267320e2c78fc1cecfe7ab735ccbcf6993ec5dd541cb2c/xxhash-3.7.0-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:e64a7c9d7dfca3e0fafcbc5e455519090706a3e36e95d655cec3e04e79f95aaa", size = 236140, upload-time = "2026-04-25T11:07:05.396Z" }, + { url = "https://files.pythonhosted.org/packages/34/04/fd595a4fd8617b05fa27bd9b684ecb4985bfed27917848eea85d54036d06/xxhash-3.7.0-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:2220af08163baf5fa36c2b8af079dc2cbe6e66ae061385267f9472362dfd53c6", size = 212291, upload-time = "2026-04-25T11:07:06.966Z" }, + { url = "https://files.pythonhosted.org/packages/03/fb/f1a379cbc372ae5b9f4ab36154c48a849ca6ebe3ac477067a57865bf3bc6/xxhash-3.7.0-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:f14bb8b22a4a91325813e3d553b8963c10cf8c756cff65ee50c194431296c655", size = 445532, upload-time = "2026-04-25T11:07:08.525Z" }, + { url = "https://files.pythonhosted.org/packages/65/59/172424b79f8cfd4b6d8a122b2193e6b8ad4b11f7159bb3b6f9b3191329bb/xxhash-3.7.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:496736f86a9bedaf64b0dc70e3539d0766df01c71ea22032698e88f3f04a1ce9", size = 193990, upload-time = "2026-04-25T11:07:10.315Z" }, + { url = "https://files.pythonhosted.org/packages/b9/19/aeac22161d953f139f07ba5586cb4a17c5b7b6dff985122803bb12933500/xxhash-3.7.0-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:0ff71596bd79816975b3de7130ab1ff4541410285a3c084584eeb1c8239996fd", size = 284876, upload-time = "2026-04-25T11:07:12.15Z" }, + { url = "https://files.pythonhosted.org/packages/77/d5/4fd0b59e7a02242953da05ff679fbb961b0a4368eac97a217e11dae110c1/xxhash-3.7.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:1ad86695c19b1d46fe106925db3c7a37f16be37669dcf58dcc70a9dd6e324676", size = 210495, upload-time = "2026-04-25T11:07:13.952Z" }, + { url = "https://files.pythonhosted.org/packages/aa/fb/976a3165c728c7faf74aa1b5ab3cf6a85e6d731612894741840524c7d28c/xxhash-3.7.0-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:970f9f8c50961d639cbd0d988c96f80ddf66006de93641719282c4fe7a87c5e6", size = 241331, upload-time = "2026-04-25T11:07:15.557Z" }, + { url = "https://files.pythonhosted.org/packages/4a/2c/6763d5901d53ac9e6ba296e5717ae599025c9d268396e8faa8b4b0a8e0ac/xxhash-3.7.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:5886ad85e9e347911783760a1d16cb6b393e8f9e3b52c982568226cb56927bdc", size = 198037, upload-time = "2026-04-25T11:07:17.563Z" }, + { url = "https://files.pythonhosted.org/packages/61/2b/876e722d533833f5f9a83473e6ba993e48745701096944e77bbecf29b2c3/xxhash-3.7.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:6e934bbae1e0ec74e27d5f0d7f37ef547ce5ff9f0a7e63fb39e559fc99526734", size = 210744, upload-time = "2026-04-25T11:07:19.055Z" }, + { url = "https://files.pythonhosted.org/packages/21/e6/d7e7baef7ce24166b4668d3c48557bb35a23b92ecadcac7e7718d099ab69/xxhash-3.7.0-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:3b6b3d28228af044ebcded71c4a3dd86e1dbd7e2f4645bf40f7b5da65bb5fb5a", size = 275406, upload-time = "2026-04-25T11:07:20.908Z" }, + { url = "https://files.pythonhosted.org/packages/92/fe/198b3763b2e01ca908f2154969a2352ec99bda892b574a11a9a151c5ede4/xxhash-3.7.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:6be4d70d9ab76c9f324ead9c01af6ff52c324745ea0c3731682a0cf99720f1fe", size = 414125, upload-time = "2026-04-25T11:07:23.037Z" }, + { url = "https://files.pythonhosted.org/packages/3a/6d/019a11affd5a5499137cacca53808659964785439855b5aa40dfd3412916/xxhash-3.7.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:151d7520838d4465461a0b7f4ae488b3b00de16183dd3214c1a6b14bf89d7fb6", size = 191555, upload-time = "2026-04-25T11:07:24.991Z" }, + { url = "https://files.pythonhosted.org/packages/76/21/b96d58568df2d01533244c3e0e5cbdd0c8b2b25c4bec4d72f19259a292d7/xxhash-3.7.0-cp313-cp313-win32.whl", hash = "sha256:d798c1e291bffb8e37b5bbe0dda77fc767cd19e89cadaf66e6ed5d0ff88c9fe6", size = 30668, upload-time = "2026-04-25T11:07:26.665Z" }, + { url = "https://files.pythonhosted.org/packages/99/57/d849a8d3afa1f8f4bc6a831cd89f49f9706fbbad94d2975d6140a171988c/xxhash-3.7.0-cp313-cp313-win_amd64.whl", hash = "sha256:875811ba23c543b1a1c3143c926e43996eb27ebb8f52d3500744aa608c275aed", size = 31524, upload-time = "2026-04-25T11:07:27.92Z" }, + { url = "https://files.pythonhosted.org/packages/81/52/bacc753e92dee78b058af8dcef0a50815f5f860986c664a92d75f965b6a5/xxhash-3.7.0-cp313-cp313-win_arm64.whl", hash = "sha256:54a675cb300dda83d71daae2a599389d22db8021a0f8db0dd659e14626eb3ecc", size = 27768, upload-time = "2026-04-25T11:07:29.113Z" }, + { url = "https://files.pythonhosted.org/packages/1c/47/ddbd683b7fc7e592c1a8d9d65f73ce9ab513f082b3967eee2baf549b8fc6/xxhash-3.7.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:a3b19a42111c4057c1547a4a1396a53961dca576a0f6b82bfa88a2d1561764b2", size = 33576, upload-time = "2026-04-25T11:07:30.469Z" }, + { url = "https://files.pythonhosted.org/packages/07/f2/36d3310161db7f72efb4562aadde0ed429f1d0531782dd6345b12d2da527/xxhash-3.7.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:8f4608a06e4d61b7a3425665a46d00e0579122e1a2fae97a0c52953a3aad9aa3", size = 31123, upload-time = "2026-04-25T11:07:31.989Z" }, + { url = "https://files.pythonhosted.org/packages/0d/3f/75937a5c69556ed213021e43cbedd84c8e0279d0d74e7d41a255d84ba4b1/xxhash-3.7.0-cp313-cp313t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:ad37c7792479e49cf96c1ab25517d7003fe0d93687a772ba19a097d235bbe41e", size = 196491, upload-time = "2026-04-25T11:07:33.358Z" }, + { url = "https://files.pythonhosted.org/packages/22/29/f10d7ff8c7a733d4403a43b9de18c8fabc005f98cec054644f04418659ee/xxhash-3.7.0-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:dc026e3b89d98e30a8288c95cb696e77d150b3f0fb7a51f73dcd49ee6b5577fa", size = 215793, upload-time = "2026-04-25T11:07:34.919Z" }, + { url = "https://files.pythonhosted.org/packages/8b/fd/778f60aa295f58907938f030a8b514611f391405614a525cccd2ffc00eb5/xxhash-3.7.0-cp313-cp313t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:c9b31ab1f28b078a6a1ac1a54eb35e7d5390deddd56870d0be3a0a733d1c321c", size = 237993, upload-time = "2026-04-25T11:07:36.638Z" }, + { url = "https://files.pythonhosted.org/packages/70/f5/736db5de387b4a540e37a05b84b40dc58a1ce974bfd2b4e5754ce29b68c3/xxhash-3.7.0-cp313-cp313t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:3bb5fd680c038fd5229e44e9c493782f90df9bef632fd0499d442374688ff70b", size = 214887, upload-time = "2026-04-25T11:07:38.564Z" }, + { url = "https://files.pythonhosted.org/packages/4d/aa/09a095f22fdb9a27fbb716841fbff52119721f9ca4261952d07a912f7839/xxhash-3.7.0-cp313-cp313t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:030c0fd688fce3569fbb49a2feefd4110cbb0b650186fb4610759ecfac677548", size = 448407, upload-time = "2026-04-25T11:07:40.552Z" }, + { url = "https://files.pythonhosted.org/packages/74/8a/b745efeeca9e34a91c26fdc97ad8514c43d5a81ac78565cba80a1353870a/xxhash-3.7.0-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5b1bde10324f4c31812ae0d0502e92d916ae8917cad7209353f122b8b8f610c3", size = 196119, upload-time = "2026-04-25T11:07:42.101Z" }, + { url = "https://files.pythonhosted.org/packages/8a/5c/0cfceb024af90c191f665c7933b1f318ee234f4797858383bebd1881d52f/xxhash-3.7.0-cp313-cp313t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:503722d52a615f2604f5e7611de7d43878df010dc0053094ef91cb9a9ac3d987", size = 286751, upload-time = "2026-04-25T11:07:43.568Z" }, + { url = "https://files.pythonhosted.org/packages/0b/0a/0793e405dc3cf8f4ebe2c1acec1e4e4608cd9e7e50ea691dabbc2a95ccbb/xxhash-3.7.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:c72500a3b6d6c30ebfc135035bcace9eb5884f2dc220804efcaaba43e9f611dd", size = 212961, upload-time = "2026-04-25T11:07:45.388Z" }, + { url = "https://files.pythonhosted.org/packages/0c/7e/721118ffc63bfff94aa565bcf2555a820f9f4bdb0f001e0d609bdfad70de/xxhash-3.7.0-cp313-cp313t-musllinux_1_2_armv7l.whl", hash = "sha256:43475925a766d01ca8cd9a857fd87f3d50406983c8506a4c07c4df12adcc867f", size = 243703, upload-time = "2026-04-25T11:07:47.053Z" }, + { url = "https://files.pythonhosted.org/packages/6e/18/16f6267160488b8276fd3d449d425712512add292ba545c1b6946bfdb7dd/xxhash-3.7.0-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:8d09dfd2ab135b985daf868b594315ebe11ad86cd9fea46e6c69f19b28f7d25a", size = 200894, upload-time = "2026-04-25T11:07:48.657Z" }, + { url = "https://files.pythonhosted.org/packages/2d/94/80ba841287fd97e3e9cac1d228788c8ef623746f570404961eec748ecb5c/xxhash-3.7.0-cp313-cp313t-musllinux_1_2_ppc64le.whl", hash = "sha256:c50269d0055ac1faecfd559886d2cbe4b730de236585aba0e873f9d9dadbe585", size = 213357, upload-time = "2026-04-25T11:07:50.257Z" }, + { url = "https://files.pythonhosted.org/packages/a1/7e/106d4067130c59f1e18a55ffadcd876d8c68534883a1e02685b29d3d8153/xxhash-3.7.0-cp313-cp313t-musllinux_1_2_riscv64.whl", hash = "sha256:1910df4756a5ab58cfad8744fc2d0f23926e3efcc346ee76e87b974abab922f4", size = 277600, upload-time = "2026-04-25T11:07:51.745Z" }, + { url = "https://files.pythonhosted.org/packages/c5/86/a081dd30da71d720b2612a792bfd55e45fa9a07ac76a0507f60487473c25/xxhash-3.7.0-cp313-cp313t-musllinux_1_2_s390x.whl", hash = "sha256:d006faf3b491957efcb433489be3c149efe4787b7063d5cddb8ddaefdc60e0c1", size = 416980, upload-time = "2026-04-25T11:07:53.504Z" }, + { url = "https://files.pythonhosted.org/packages/35/29/1a95221a029a3c1293773869e1ab47b07cbbdd82444a42809e8c60156626/xxhash-3.7.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:abb65b4e947e958f7b3b0d71db3ce447d1bc5f37f5eab871ce7223bda8768a04", size = 193840, upload-time = "2026-04-25T11:07:55.103Z" }, + { url = "https://files.pythonhosted.org/packages/c5/e0/db909dd0823285de2286f67e10ee4d81e96ad35d7d8e964ecb07fccd8af9/xxhash-3.7.0-cp313-cp313t-win32.whl", hash = "sha256:178959906cb1716a1ce08e0d69c82886c70a15a6f2790fc084fdd146ca30cd49", size = 30966, upload-time = "2026-04-25T11:07:56.524Z" }, + { url = "https://files.pythonhosted.org/packages/7b/ff/d705b15b22f21ee106adce239cb65d35067a158c630b240270f09b17c2e6/xxhash-3.7.0-cp313-cp313t-win_amd64.whl", hash = "sha256:2524a1e20d4c231d13b50f7cf39e44265b055669a64a7a4b9a2a44faa03f19b6", size = 31784, upload-time = "2026-04-25T11:07:57.758Z" }, + { url = "https://files.pythonhosted.org/packages/a2/1f/b2cf83c3638fd0588e0b17f22e5a9400bdfb1a3e3755324ac0aee2250b88/xxhash-3.7.0-cp313-cp313t-win_arm64.whl", hash = "sha256:37d994d0ffe81ef087bb330d392caa809bb5853c77e22ea3f71db024a0543dba", size = 27932, upload-time = "2026-04-25T11:07:59.109Z" }, + { url = "https://files.pythonhosted.org/packages/0e/cc/431db584f6fbb9312e40a173af027644e5580d39df1f73603cbb9dca4d6b/xxhash-3.7.0-cp314-cp314-android_24_arm64_v8a.whl", hash = "sha256:8c5fcfd806c335bfa2adf1cd0b3110a44fc7b6995c3a648c27489bae85801465", size = 36644, upload-time = "2026-04-25T11:08:00.658Z" }, + { url = "https://files.pythonhosted.org/packages/bc/01/255ec513e0a705d1f9a61413e78dfce4e3235203f0ed525a24c2b4b56345/xxhash-3.7.0-cp314-cp314-android_24_x86_64.whl", hash = "sha256:506a0b488f190f0a06769575e30caf71615c898ed93ab18b0dbcb6dec5c3713c", size = 35003, upload-time = "2026-04-25T11:08:02.338Z" }, + { url = "https://files.pythonhosted.org/packages/68/70/c55fc33c93445b44d8fc5a17b41ed99e3cebe92bcf8396809e63fc9a1165/xxhash-3.7.0-cp314-cp314-ios_13_0_arm64_iphoneos.whl", hash = "sha256:ec68dbba21532c0173a9872298e65c89749f7c9d21538c3a78b5bb6105871568", size = 29655, upload-time = "2026-04-25T11:08:03.701Z" }, + { url = "https://files.pythonhosted.org/packages/c2/72/ff8de73df000d74467d12a59ce6d6e2b2a368b978d41ab7b1fba5ed442be/xxhash-3.7.0-cp314-cp314-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:fa77e7ec1450d415d20129961814787c9abd9a07f98872f070b1fe96c5084611", size = 30664, upload-time = "2026-04-25T11:08:05.011Z" }, + { url = "https://files.pythonhosted.org/packages/b6/91/08416d9bd9bc3bf39d831abe8a5631ac2db5141dfd6fe81c3fe59a1f9264/xxhash-3.7.0-cp314-cp314-ios_13_0_x86_64_iphonesimulator.whl", hash = "sha256:fe32736295ea38e43e7d9424053c8c47c9f64fecfc7c895fb3da9b30b131c9ee", size = 33317, upload-time = "2026-04-25T11:08:06.413Z" }, + { url = "https://files.pythonhosted.org/packages/0e/3b/86b1caa4dee10a99f4bf9521e623359341c5e50d05158fa10c275b2bd079/xxhash-3.7.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:ab9dd2c83c4bbd63e422181a76f13502d049d3ddcac9a1bdc29196263d692bb8", size = 33457, upload-time = "2026-04-25T11:08:08.099Z" }, + { url = "https://files.pythonhosted.org/packages/ed/38/98ea14ad1517e1461292a65906951458d520689782bfbae111050145bdba/xxhash-3.7.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:3afec3a336a2286601a437cb07562ab0227685e6fbb9ec17e8c18457ff348ecf", size = 30894, upload-time = "2026-04-25T11:08:09.429Z" }, + { url = "https://files.pythonhosted.org/packages/61/a2/074654d0b893606541199993c7db70067d9fc63b748e0d60020a52a1bd36/xxhash-3.7.0-cp314-cp314-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:565df64437a9390f84465dcca33e7377114c7ede8d05cd2cf20081f831ea788e", size = 194409, upload-time = "2026-04-25T11:08:10.91Z" }, + { url = "https://files.pythonhosted.org/packages/e2/26/6d2a1afc468189f77ca28c32e1c83e1b9da1178231e05641dbc1b350e332/xxhash-3.7.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:12eca820a5d558633d423bf8bb78ce72a55394823f64089247f788a7e0ae691e", size = 213135, upload-time = "2026-04-25T11:08:12.575Z" }, + { url = "https://files.pythonhosted.org/packages/8e/0e/d8aecf95e09c42547453137be74d2f7b8b14e08f5177fa2fab6144a19061/xxhash-3.7.0-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:f262b8f7599516567e070abf607b9af649052b2c4bd6f9be02b0cb41b7024805", size = 236379, upload-time = "2026-04-25T11:08:14.206Z" }, + { url = "https://files.pythonhosted.org/packages/f2/74/8140e8210536b3dd0cc816c4faaeb5ba6e63e8125ab25af4bcddd6a037b3/xxhash-3.7.0-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:f1598916cb197681e03e601901e4ab96a9a963de398c59d0964f8a6f44a2b361", size = 212447, upload-time = "2026-04-25T11:08:15.79Z" }, + { url = "https://files.pythonhosted.org/packages/a0/d2/462001d2903b4bee5a5689598a0a55e5e7cd1ac7f4247a5545cff10d3ebb/xxhash-3.7.0-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:322b2f0622230f526aeb1738149948a7ae357a9e2ceb1383c6fd1fdaecdafa16", size = 445660, upload-time = "2026-04-25T11:08:17.441Z" }, + { url = "https://files.pythonhosted.org/packages/23/09/2bd1ed7f8689b20e51727952cac8329d50c694dc32b2eba06ba5bc742b37/xxhash-3.7.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:24cc22070880cc57b830a65cde4e65fa884c6d9b28ae4803b5ee05911e7bafba", size = 194076, upload-time = "2026-04-25T11:08:19.134Z" }, + { url = "https://files.pythonhosted.org/packages/c9/6e/692302cd0a5f4ac4e6289f37fa888dc2e1e07750b68fe3e4bfe939b8cea3/xxhash-3.7.0-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:cb5a888a968b2434abf9ecda357b5d43f10d7b5a6da6fdbbe036208473aff0e2", size = 284990, upload-time = "2026-04-25T11:08:20.618Z" }, + { url = "https://files.pythonhosted.org/packages/05/d9/e54b159b3d9df7999d2a7c676ce7b323d1b5588a64f8f51ed8172567bd87/xxhash-3.7.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:a999771ff97bec27d18341be4f3a36b163bb1ac41ec17bef6d2dabd84acd33c7", size = 210590, upload-time = "2026-04-25T11:08:22.24Z" }, + { url = "https://files.pythonhosted.org/packages/50/93/0e0df1a3a196ced4ca71de76d65ead25d8e87bbfb87b64306ea47a40c00d/xxhash-3.7.0-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:ed4a6efe2dee1655adb73e7ad40c6aa955a6892422b1e3b95de6a34de56e3cbb", size = 241442, upload-time = "2026-04-25T11:08:23.844Z" }, + { url = "https://files.pythonhosted.org/packages/9a/a9/d917a7a814e90b218f8a0d37967105eea91bf752c3303683c99a1f7bfc1f/xxhash-3.7.0-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:9fd17f14ac0faa12126c2f9ca774a8cf342957265ec3c8669c144e5e6cdb478c", size = 198356, upload-time = "2026-04-25T11:08:25.99Z" }, + { url = "https://files.pythonhosted.org/packages/89/5e/f2ba1877c39469abbefc72991d6ebdcbd4c0880db01ae8cb1f553b0c537d/xxhash-3.7.0-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:05fd1254268c59b5cb2a029dfc204275e9fc52de2913f1e53aa8d01442c96b4d", size = 210898, upload-time = "2026-04-25T11:08:27.608Z" }, + { url = "https://files.pythonhosted.org/packages/90/c6/be56b58e73de531f39a10de1355bb77ceb663900dc4bf2d6d3002a9c3f9e/xxhash-3.7.0-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:a2eae53197c6276d5b317f75a1be226bbf440c20b58bf525f36b5d0e1f657ca6", size = 275519, upload-time = "2026-04-25T11:08:29.301Z" }, + { url = "https://files.pythonhosted.org/packages/92/e2/17ddc85d5765b9c709f192009ed8f5a1fc876f4eb35bba7c307b5b1169f9/xxhash-3.7.0-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:bfe6f92e3522dcbe8c4281efd74fa7542a336cb00b0e3272c4ec0edabeaeaf67", size = 414191, upload-time = "2026-04-25T11:08:31.16Z" }, + { url = "https://files.pythonhosted.org/packages/9c/42/85f5b79f4bf1ec7ba052491164adfd4f4e9519f5dc7246de4fbd64a1bd56/xxhash-3.7.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:7ab9a49c410d8c6c786ab99e79c529938d894c01433130353dd0fe999111077a", size = 191604, upload-time = "2026-04-25T11:08:32.862Z" }, + { url = "https://files.pythonhosted.org/packages/b8/d0/6127b623aa4cca18d8b7743592b048d689fd6c6e37ff26a22cddf6cd9d7f/xxhash-3.7.0-cp314-cp314-win32.whl", hash = "sha256:040ea63668f9185b92bc74942df09c7e65703deed71431333678fc6e739a9955", size = 31271, upload-time = "2026-04-25T11:08:34.651Z" }, + { url = "https://files.pythonhosted.org/packages/64/4f/44fc4788568004c43921701cbc127f48218a1eede2c9aea231115323564d/xxhash-3.7.0-cp314-cp314-win_amd64.whl", hash = "sha256:2a61e2a3fb23c892496d587b470dee7fa1b58b248a187719c65ea8e94ec13257", size = 32284, upload-time = "2026-04-25T11:08:35.987Z" }, + { url = "https://files.pythonhosted.org/packages/6d/77/18bb895eb60a49453d16e17d67990e5caff557c78eafc90ad4e2eabf4570/xxhash-3.7.0-cp314-cp314-win_arm64.whl", hash = "sha256:c7741c7524961d8c0cb4d4c21b28957ff731a3fd5b5cd8b856dc80a40e9e5acc", size = 28701, upload-time = "2026-04-25T11:08:37.767Z" }, + { url = "https://files.pythonhosted.org/packages/45/a0/46f72244570c550fbbb7db1ef554183dd5ebe9136385f30e032b781ae8f6/xxhash-3.7.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:fc84bf7aa7592f31ec63a3e7b11d624f468a3f19f5238cec7282a42e838ab1d7", size = 33646, upload-time = "2026-04-25T11:08:39.109Z" }, + { url = "https://files.pythonhosted.org/packages/4a/3a/453846a7eceea11e75def361eed01ec6a0205b9822c19927ed364ccae7cc/xxhash-3.7.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:9f1563fdc8abfc389748e6932c7e4e99c89a53e4ec37d4563c24fc06f5e5644b", size = 31125, upload-time = "2026-04-25T11:08:40.467Z" }, + { url = "https://files.pythonhosted.org/packages/bd/3e/49434aba738885d512f9e486db1bdd19db28dfa40372b56da26ef7a4e738/xxhash-3.7.0-cp314-cp314t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:2d415f18becf6f153046ab6adc97da77e3643a0ee205dae61c4012604113a020", size = 196633, upload-time = "2026-04-25T11:08:41.943Z" }, + { url = "https://files.pythonhosted.org/packages/a4/e9/006cb6127baeb9f8abe6d15e62faa01349f09b34e2bfd65175b2422d026b/xxhash-3.7.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:bb16aa13ed175bc9be5c2491ba031b85a9b51c4ed90e0b3d4ebe63cf3fb54f8e", size = 215899, upload-time = "2026-04-25T11:08:43.645Z" }, + { url = "https://files.pythonhosted.org/packages/27/e4/cc57d72e66df0ae29b914335f1c6dcf61e8f3746ddf0ae3c471aa4f15e00/xxhash-3.7.0-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:f9fd595f1e5941b3d7863e4774e4b30caa6731fc34b9277da032295aa5656ee5", size = 238116, upload-time = "2026-04-25T11:08:45.698Z" }, + { url = "https://files.pythonhosted.org/packages/af/78/3531d4a3fd8a0038cc6be1f265a69c1b3587f557a10b677dd736de2202c1/xxhash-3.7.0-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:1295325c5a98d552333fa53dc2b026b0ef0ec9c8e73ca3a952990b4c7d65d459", size = 215012, upload-time = "2026-04-25T11:08:47.355Z" }, + { url = "https://files.pythonhosted.org/packages/b4/f6/259fb1eaaec921f59b17203b0daee69829761226d3b980d5191d7723dd83/xxhash-3.7.0-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:3573a651d146912da9daa9e29e5fbc45994420daaa9ef1e2fa5823e1dc485513", size = 448534, upload-time = "2026-04-25T11:08:49.149Z" }, + { url = "https://files.pythonhosted.org/packages/7b/16/a66d0eaf6a7e68532c07714361ddc904c663ec940f3b028c1ae4a21a7b9d/xxhash-3.7.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5ec1e080a3d02d94ea9335bfab0e3374b877e25411422c18f51a943fa4b46381", size = 196217, upload-time = "2026-04-25T11:08:50.805Z" }, + { url = "https://files.pythonhosted.org/packages/8d/ef/d2efc7fc51756dc52509109d1a25cefc859d74bc4b19a167b12dbd8c2786/xxhash-3.7.0-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:84415265192072d8638a3afc3c1bc5995e310570cd9acb54dc46d3939e364fe0", size = 286906, upload-time = "2026-04-25T11:08:52.418Z" }, + { url = "https://files.pythonhosted.org/packages/fc/67/25decd1d4a4018582ec4db2a868a2b7e40640f4adb20dfeb19ac923aa825/xxhash-3.7.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:8d4dea659b57443989ef32f4295104fd6912c73d0bf26d1d148bb88a9f159b02", size = 213057, upload-time = "2026-04-25T11:08:54.105Z" }, + { url = "https://files.pythonhosted.org/packages/0d/5d/17651eb29d06786cdc40c60ae3d27d645aa5d61d2eca6237a7ba0b94789b/xxhash-3.7.0-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:05ece0fe4d9c9c2728912d1981ae1566cfc83a011571b24732cbf76e1fb70dca", size = 243886, upload-time = "2026-04-25T11:08:56.109Z" }, + { url = "https://files.pythonhosted.org/packages/8a/d4/174d9cf7502243d586e6a9ae842b1ae23026620995114f85f1380e588bc9/xxhash-3.7.0-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:fd880353cf1ffaf321bc18dd663e111976dbd0d3bbd8a66d58d2b470dfa7f396", size = 201015, upload-time = "2026-04-25T11:08:57.777Z" }, + { url = "https://files.pythonhosted.org/packages/91/8c/2254e2d06c3ac5e6fe22eaf3da791b87ea823ae9f2c17b4af66755c5752d/xxhash-3.7.0-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:4e15cc9e2817f6481160f930c62842b3ff419e20e13072bcbab12230943092bc", size = 213457, upload-time = "2026-04-25T11:08:59.826Z" }, + { url = "https://files.pythonhosted.org/packages/79/a2/e3daa762545921173e3360f3b4ff7fc63c2d27359f7230ec1a7a74e117f6/xxhash-3.7.0-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:90b9d1a8bd37d768ffc92a1f651ec69afc532a96fa1ac2ea7abbed5d630b3237", size = 277738, upload-time = "2026-04-25T11:09:01.423Z" }, + { url = "https://files.pythonhosted.org/packages/e1/4c/e186da2c46b87f5204640e008d42730bf3c1ee9f0efb71ae1ebcdfeac681/xxhash-3.7.0-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:157c49475b34ecea8809e51123d9769a534e139d1247942f7a4bc67710bb2533", size = 417127, upload-time = "2026-04-25T11:09:03.592Z" }, + { url = "https://files.pythonhosted.org/packages/17/28/3798e15007a3712d0da3d3fe70f8e11916569858b5cc371053bc26270832/xxhash-3.7.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:5a6ddec83325685e729ca119d1f5c518ec39294212ecd770e60693cdc5f7eb79", size = 193962, upload-time = "2026-04-25T11:09:06.228Z" }, + { url = "https://files.pythonhosted.org/packages/ad/95/a26baa93b5241fd7630998816a4ec47a5a0bad193b3f8fc8f3593e1a4a67/xxhash-3.7.0-cp314-cp314t-win32.whl", hash = "sha256:a04a6cab47e2166435aaf5b9e5ee41d1532cc8300efdef87f2a4d0acb7db19ed", size = 31643, upload-time = "2026-04-25T11:09:08.153Z" }, + { url = "https://files.pythonhosted.org/packages/44/36/5454f13c447e395f9b06a3e91274c59f503d31fad84e1836efe3bdb71f6a/xxhash-3.7.0-cp314-cp314t-win_amd64.whl", hash = "sha256:8653dd7c2eda020545bb2c71c7f7039b53fe7434d0fc1a0a9deb79ab3f1a4fc1", size = 32522, upload-time = "2026-04-25T11:09:09.534Z" }, + { url = "https://files.pythonhosted.org/packages/74/35/698e7e3ff38e22992ea24870a511d8762474fb6783627a2910ff22a185c2/xxhash-3.7.0-cp314-cp314t-win_arm64.whl", hash = "sha256:468f0fc114faaa4b36699f8e328bbc3bb11dc418ba94ac52c26dd736d4b6c637", size = 28807, upload-time = "2026-04-25T11:09:11.234Z" }, +] + +[[package]] +name = "yarl" +version = "1.24.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "idna" }, + { name = "multidict" }, + { name = "propcache" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/79/12/1e8f37460ea0f7eb59c221fdaf0ed75e7ac43e97f8093b9c6f411df50a78/yarl-1.24.2.tar.gz", hash = "sha256:9ac374123c6fd7abf64d1fec93962b0bd4ee2c19751755a762a72dd96c0378f8", size = 210798, upload-time = "2026-05-19T21:31:05.599Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/f0/da/866bcb01076ba49d2b42b309867bed3826421f1c479655eb7a607b44f20b/yarl-1.24.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:b975866c184564c827e0877380f0dae57dcca7e52782128381b72feff6dfceb8", size = 129957, upload-time = "2026-05-19T21:28:51.695Z" }, + { url = "https://files.pythonhosted.org/packages/bf/1d/fcefb70922ea2268a8971d8e5874d9a8218644200fb8465f1dcad55e6851/yarl-1.24.2-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:3b075301a2836a0e297b1b658cb6d6135df535d62efefdd60366bd589c2c82f2", size = 92164, upload-time = "2026-05-19T21:28:53.242Z" }, + { url = "https://files.pythonhosted.org/packages/29/b6/170e2b8d4e3bc30e6bfdcca53556537f5bf595e938632dfcb059311f3ff6/yarl-1.24.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:8ae44649b00947634ab0dab2a374a638f52923a6e67083f2c156cd5cbd1a881d", size = 91688, upload-time = "2026-05-19T21:28:54.865Z" }, + { url = "https://files.pythonhosted.org/packages/fe/a5/c9f655d5553ea0b99fdac9d6a99ad3f9b3e73b8e5758bb46f58c9831f74c/yarl-1.24.2-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:507cc19f0b45454e2d6dcd62ff7d062b9f77a2812404e62dbdaec05b50faa035", size = 102902, upload-time = "2026-05-19T21:28:56.963Z" }, + { url = "https://files.pythonhosted.org/packages/5d/bc/6b9664d815d79af4ee553337f9d606c56bbf269186ada9172de45f1b5f60/yarl-1.24.2-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:c4c17bad5a530912d2111825d3f05e89bab2dd376aaa8cbc77e449e6db63e576", size = 97931, upload-time = "2026-05-19T21:28:58.56Z" }, + { url = "https://files.pythonhosted.org/packages/98/ec/32ba48acae30fecd60928f5791188b80a9d6ee3840507ffda29fecd37b71/yarl-1.24.2-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:f5f0cbb112838a4a293985b6ed73948a547dadcc1ba6d2089938e7abdedceef8", size = 111030, upload-time = "2026-05-19T21:29:00.148Z" }, + { url = "https://files.pythonhosted.org/packages/82/5a/6f4cd081e5f4934d2ae3a8ef4abe3afacc010d26f0035ee91b35cd7d7c37/yarl-1.24.2-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:5ec8356b8a6afcf81fc7aeeef13b1ff7a49dec00f313394bbb9e83830d32ccd7", size = 110392, upload-time = "2026-05-19T21:29:02.155Z" }, + { url = "https://files.pythonhosted.org/packages/7a/da/323a01c349bd5fb01bb6652e314d9bb218cee630a736bdb810ad50e4013f/yarl-1.24.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7e7ebcdef69dec6c6451e616f32b622a6d4a2e92b445c992f7c8e5274a6bbc4c", size = 105612, upload-time = "2026-05-19T21:29:04.247Z" }, + { url = "https://files.pythonhosted.org/packages/7c/80/264ab684f181e1a876389374519ff05d10248725535ae2ac4e8ac4e563d6/yarl-1.24.2-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:47a55d6cf6db2f401017a9e96e5288844e5051911fb4e0c8311a3980f5e59a7d", size = 104487, upload-time = "2026-05-19T21:29:06.491Z" }, + { url = "https://files.pythonhosted.org/packages/41/07/efabe5df87e96d7ad5959760b888344be48cd6884db127b407c6b5503adc/yarl-1.24.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:3065657c80a2321225e804048597ad55658a7e76b32d6f5ee4074d04c50401db", size = 102333, upload-time = "2026-05-19T21:29:08.267Z" }, + { url = "https://files.pythonhosted.org/packages/44/0c/bcf7c42603e1009295f586d8890f2ba032c8b53310e815adf0a202c73d9f/yarl-1.24.2-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:cb84b80d88e19ede158619b80813968713d8d008b0e2497a576e6a0557d50712", size = 99025, upload-time = "2026-05-19T21:29:10.682Z" }, + { url = "https://files.pythonhosted.org/packages/4f/82/84482ab1a57a0f21a08afe6a7004c61d741f8f2ecc3b05c321577c612164/yarl-1.24.2-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:990de4f680b1c217e77ff0d6aa0029f9eb79889c11fb3e9a3942c7eba29c1996", size = 110507, upload-time = "2026-05-19T21:29:12.954Z" }, + { url = "https://files.pythonhosted.org/packages/c4/8d/a546ba1dfe1b0f290e05fef145cd07614c0f15df1a707195e512d1e39d1d/yarl-1.24.2-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:abb8ec0323b80161e3802da3150ef660b41d0e9be2048b76a363d93eee992c2b", size = 103719, upload-time = "2026-05-19T21:29:14.893Z" }, + { url = "https://files.pythonhosted.org/packages/1a/b6/267f2a09213138473adfce6b8a6e17791d7fee70bd4d9003218e4dec58b0/yarl-1.24.2-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:e7977781f83638a4c73e0f88425563d70173e0dfd90ac006a45c65036293ee3c", size = 110438, upload-time = "2026-05-19T21:29:16.485Z" }, + { url = "https://files.pythonhosted.org/packages/48/2d/1c8d89c7c5f9cad9fb2902445d94e2ab1d7aa35de029afbb8ae95c42d00f/yarl-1.24.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:e30dd55825dc554ec5b66a94953b8eda8745926514c5089dfcacecb9c99b5bd1", size = 105719, upload-time = "2026-05-19T21:29:18.367Z" }, + { url = "https://files.pythonhosted.org/packages/a7/25/722e3b93bd687009afb2d59a35e13d30ddd8f80571445bb0c4e4ce26ec66/yarl-1.24.2-cp312-cp312-win_amd64.whl", hash = "sha256:7dafe10c12ddd4d120d528c4b5599c953bd7b12845347d507b95451195bb6cad", size = 92901, upload-time = "2026-05-19T21:29:20.014Z" }, + { url = "https://files.pythonhosted.org/packages/39/47/4486ccfb674c04854a1ef8aa77868b6a6f765feaf69633409d7ca4f02cb8/yarl-1.24.2-cp312-cp312-win_arm64.whl", hash = "sha256:044a09d8401fcf8681977faef6d286b8ade1e2d2e9dceda175d1cfa5ca496f30", size = 87229, upload-time = "2026-05-19T21:29:22.1Z" }, + { url = "https://files.pythonhosted.org/packages/82/62/fcf0ce677f17e5c471c06311dd25964be38a4c586993632910d2e75278bc/yarl-1.24.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:491ac9141decf49ee8030199e1ee251cdff0e131f25678817ff6aa5f837a3536", size = 128978, upload-time = "2026-05-19T21:29:23.83Z" }, + { url = "https://files.pythonhosted.org/packages/d3/58/8e63299bb71ed61a834121d9d3fe6c9fcf2a6a5d09754ff4f20f2d20baf5/yarl-1.24.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:e89418f65eda18f99030386305bd44d7d504e328a7945db1ead514fbe03a0607", size = 91733, upload-time = "2026-05-19T21:29:25.375Z" }, + { url = "https://files.pythonhosted.org/packages/c1/24/16748d5dab6daec8b0ed81ccec639a1cded0f18dcc62a4f696b4fe366c37/yarl-1.24.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:cdfcce633b4a4bb8281913c57fcafd4b5933fbc19111a5e3930bbd299d6102f1", size = 91113, upload-time = "2026-05-19T21:29:26.928Z" }, + { url = "https://files.pythonhosted.org/packages/1b/66/b63fff7b71211e866624b21432d5943cbb633eb0c2872d9ee3070648f22c/yarl-1.24.2-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:863297ddede92ee49024e9a9b11ecb59f310ca85b60d8537f56bed9bbb5b1986", size = 103899, upload-time = "2026-05-19T21:29:28.842Z" }, + { url = "https://files.pythonhosted.org/packages/9d/ac/ba1974b8533909636f7733fe86cf677e3619527c3c2fa913e0ea89c48757/yarl-1.24.2-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:374423f70754a2c96942ede36a29d37dc6b0cb8f92f8d009ddf3ed78d3da5488", size = 97862, upload-time = "2026-05-19T21:29:31.086Z" }, + { url = "https://files.pythonhosted.org/packages/1b/a5/123ac993b5c2ba6f554a140305620cb8f150fa543711bbc49be3ec0a65a4/yarl-1.24.2-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:33a29b5d00ccbf3219bb3e351d7875739c19481e030779f48cc46a7a71681a9b", size = 111060, upload-time = "2026-05-19T21:29:32.657Z" }, + { url = "https://files.pythonhosted.org/packages/23/37/c472d3af3509688392134a88a825276770a187f1daa4de3f6dc0a327a751/yarl-1.24.2-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:a9532c57211730c515341af11fef6e9b61d157487272a096d0c04da445642592", size = 110613, upload-time = "2026-05-19T21:29:34.379Z" }, + { url = "https://files.pythonhosted.org/packages/df/88/09c28dad91e662ccfaa1b78f1c57badde74fc9d0b23e74aef644750ecd73/yarl-1.24.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:91e72cf093fd833483a97ee648e0c053c7c629f51ff4a0e7edd84f806b0c5617", size = 107012, upload-time = "2026-05-19T21:29:36.216Z" }, + { url = "https://files.pythonhosted.org/packages/07/ab/9d4f69d571a94f4d112fa7e2e007200f5a54d319f58c82ac7b7baa61f5c6/yarl-1.24.2-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:b3177bc0a768ef3bacceb4f272632990b7bea352f1b2f1eee9d6d6ff16516f92", size = 105887, upload-time = "2026-05-19T21:29:38.746Z" }, + { url = "https://files.pythonhosted.org/packages/8e/9a/000b2b66c0d772a499fc531d21dab92dfeb73b640a12eed6ba89f49bb2d0/yarl-1.24.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:e196952aacaf3b232e265ff02980b64d483dc0972bd49bcb061171ff22ac203a", size = 103620, upload-time = "2026-05-19T21:29:40.368Z" }, + { url = "https://files.pythonhosted.org/packages/41/7c/7c1050f73450fbdaa3f0c72017059f00ce5e13366692f3dba25275a1083d/yarl-1.24.2-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:204e7a61ce99919c0de1bf904ab5d7aa188a129ea8f690a8f76cfb6e2844dc44", size = 100599, upload-time = "2026-05-19T21:29:42.66Z" }, + { url = "https://files.pythonhosted.org/packages/ec/b1/29e5756b3926705f5f6089bd5b9f50a56eaac550da6e260bf713ead44d04/yarl-1.24.2-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:4b156914620f0b9d78dc1adb3751141daee561cfec796088abb89ed49d220f1a", size = 110604, upload-time = "2026-05-19T21:29:44.632Z" }, + { url = "https://files.pythonhosted.org/packages/a3/4b/8415bc96e9b150cde942fbac9a8182985e58f40ce5c54c34ed015407d3ee/yarl-1.24.2-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:8372a2b976cf70654b2be6619ab6068acabb35f724c0fda7b277fbf53d66a5cf", size = 105161, upload-time = "2026-05-19T21:29:46.755Z" }, + { url = "https://files.pythonhosted.org/packages/8b/d4/cde059abfa229553b7298a2eadde2752e723d50aeedaef86ce59da2718ee/yarl-1.24.2-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:f9a1e9b622ca284143aab5d885848686dcd85453bb1ca9abcdb7503e64dc0056", size = 110619, upload-time = "2026-05-19T21:29:48.972Z" }, + { url = "https://files.pythonhosted.org/packages/e7/2c/d6a6c9a61549f7b6c7e6dc6937d195bcf069582b47b7200dcd0e7b256acf/yarl-1.24.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:810e19b685c8c3c5862f6a38160a1f4e4c0916c9390024ec347b6157a45a0992", size = 107362, upload-time = "2026-05-19T21:29:51Z" }, + { url = "https://files.pythonhosted.org/packages/92/dd/3ae5fe417e9d1c353a548553326eb9935e76b6b727161563b424cc296df3/yarl-1.24.2-cp313-cp313-win_amd64.whl", hash = "sha256:7d37fb7c38f2b6edab0f845c4f85148d4c44204f52bc127021bd2bc9fdbf1656", size = 92667, upload-time = "2026-05-19T21:29:52.743Z" }, + { url = "https://files.pythonhosted.org/packages/10/cc/a7beb239f78f27fca1b053c8e8595e4179c02e62249b4687ec218c370c50/yarl-1.24.2-cp313-cp313-win_arm64.whl", hash = "sha256:1e831894be7c2954240e49791fa4b50c05a0dc881de2552cfe3ffd8631c7f461", size = 87069, upload-time = "2026-05-19T21:29:54.442Z" }, + { url = "https://files.pythonhosted.org/packages/40/0e/e08087695fc12789263821c5dc0f8dc52b5b17efd0887cacf419f8a43ba3/yarl-1.24.2-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:f9312b3c02d9b3d23840f67952913c9c8721d7f1b7db305289faefa878f364c2", size = 129670, upload-time = "2026-05-19T21:29:56.631Z" }, + { url = "https://files.pythonhosted.org/packages/3a/98/ab4b5ed1b1b5cd973c8a3eb994c3a6aefb6ce6d399e21bb5f0316c33815c/yarl-1.24.2-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:a4f4d6cd615823bfc7fb7e9b5987c3f41666371d870d51058f77e2680fbe9630", size = 91916, upload-time = "2026-05-19T21:29:58.645Z" }, + { url = "https://files.pythonhosted.org/packages/ba/b1/5297bb6a7df4782f7605bffc43b31f5044070935fbbcaa6c705a07e6ac65/yarl-1.24.2-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:0c3063e5c0a8e8e62fae6c2596fa01da1561e4cd1da6fec5789f5cf99a8aefd8", size = 91625, upload-time = "2026-05-19T21:30:00.412Z" }, + { url = "https://files.pythonhosted.org/packages/02/a7/45baabfff76829264e623b185cff0c340d7e11bf3e1cd9ea37e7d17934bd/yarl-1.24.2-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:fecd17873a096036c1c87ab3486f1aef7f269ada7f23f7f856f93b1cc7744f14", size = 104574, upload-time = "2026-05-19T21:30:02.544Z" }, + { url = "https://files.pythonhosted.org/packages/f3/40/3a5ab144d3d650ca37d4f4b57e56169be8af3ca34c448793e064b30baaed/yarl-1.24.2-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:a46d1ab4ba4d32e6dc80daf8a28ce0bd83d08df52fbc32f3e288663427734535", size = 97534, upload-time = "2026-05-19T21:30:04.319Z" }, + { url = "https://files.pythonhosted.org/packages/9c/b5/5658fef3681fb5776b4513b052bec750009f47b3a592251c705d75375798/yarl-1.24.2-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:73e68edf6dfd5f73f9ca127d84e2a6f9213c65bdffb736bda19524c0564fcd14", size = 111481, upload-time = "2026-05-19T21:30:05.988Z" }, + { url = "https://files.pythonhosted.org/packages/4c/06/fdcd7dde037f00866dce123ed4ba23dba94beb56fc4cf561668d27be37f2/yarl-1.24.2-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:a296ca617f2d25fbceafb962b88750d627e5984e75732c712154d058ae8d79a3", size = 111529, upload-time = "2026-05-19T21:30:07.738Z" }, + { url = "https://files.pythonhosted.org/packages/c2/53/d81269aaafccea0d33396c03035de997b743f11e648e6e27a0df99c72980/yarl-1.24.2-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e51b2cf5ec89a8b8470177641ed62a3ba22d74e1e898e06ad53aa77972487208", size = 107338, upload-time = "2026-05-19T21:30:09.713Z" }, + { url = "https://files.pythonhosted.org/packages/ae/04/23049463f729bd899df203a7960505a75333edd499cda8aa1d5a82b64df5/yarl-1.24.2-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:310fc687f7b2044ec54e372c8cbe923bb88f5c37bded0d3079e5791c2fc3cf50", size = 106147, upload-time = "2026-05-19T21:30:11.365Z" }, + { url = "https://files.pythonhosted.org/packages/14/18/04a4b5830b43ed5e4c5015b40e9f6241ad91487d71611061b4e111d6ac80/yarl-1.24.2-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:297a2fe352ecf858b30a98f87948746ec16f001d279f84aebdbd3bd965e2f1bd", size = 104272, upload-time = "2026-05-19T21:30:12.978Z" }, + { url = "https://files.pythonhosted.org/packages/5a/f7/8cffdf319aee7a7c1dbd07b61d91c3e3fda460c7a93b5f93e445f3806c4c/yarl-1.24.2-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:2a263e76b97bc42bdcd7c5f4953dec1f7cd62a1112fa7f869e57255229390d67", size = 99962, upload-time = "2026-05-19T21:30:15.001Z" }, + { url = "https://files.pythonhosted.org/packages/d7/39/b3cce3b7dbef64ac700ad4cea156a207d01bede0f507587616c364b5468e/yarl-1.24.2-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:822519b64cf0b474f1a0aaef1dc621438ea46bb77c94df97a5b4d213a7d8a8b1", size = 111063, upload-time = "2026-05-19T21:30:16.683Z" }, + { url = "https://files.pythonhosted.org/packages/a1/ea/100818505e7ebf165c7242ff17fdf7d9fee79e27234aeca871c1082920d7/yarl-1.24.2-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:b6067060d9dc594899ba83e6db6c48c68d1e494a6dab158156ed86977ca7bcb1", size = 105438, upload-time = "2026-05-19T21:30:18.769Z" }, + { url = "https://files.pythonhosted.org/packages/8f/d2/e075a0b32aa6625087de9e653087df0759fed5de4a435fef594181102a77/yarl-1.24.2-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:0063adad533e57171b79db3943b229d40dfafeeee579767f96541f106bac5f1b", size = 111458, upload-time = "2026-05-19T21:30:21.024Z" }, + { url = "https://files.pythonhosted.org/packages/e6/5c/ceea7ba98b65c8eb8d947fdc52f9bedfcd43c6a57c9e3c90c17be8f324a3/yarl-1.24.2-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:ee8e3fb34513e8dc082b586ef4910c98335d43a6fab688cd44d4851bacfce3e8", size = 107589, upload-time = "2026-05-19T21:30:23.412Z" }, + { url = "https://files.pythonhosted.org/packages/fa/d9/5582d57e2b2db9b85eb6663a22efdd78e08805f3f5389566e9fcad254d1b/yarl-1.24.2-cp314-cp314-win_amd64.whl", hash = "sha256:afb00d7fd8e0f285ca29a44cc50df2d622ff2f7a6d933fa641577b5f9d5f3db0", size = 94424, upload-time = "2026-05-19T21:30:25.425Z" }, + { url = "https://files.pythonhosted.org/packages/92/10/7dc07a0e22806a9280f42a57361395506e800c64e22737cd7b0886feab42/yarl-1.24.2-cp314-cp314-win_arm64.whl", hash = "sha256:68cf6eacd6028ef1142bc4b48376b81566385ca6f9e7dde3b0fa91be08ffcb57", size = 88690, upload-time = "2026-05-19T21:30:27.623Z" }, + { url = "https://files.pythonhosted.org/packages/9e/13/d5b8e2c8667db955bcb3de233f18798fefe7edf1d7429c2c9d4f9c401114/yarl-1.24.2-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:221ce1dd921ac4f603957f17d7c18c5cc0797fbb52f156941f92e04605d1d67b", size = 136248, upload-time = "2026-05-19T21:30:29.297Z" }, + { url = "https://files.pythonhosted.org/packages/de/46/a4a97c05c9c9b8fd266bb2a0df12992c7fbd02391eb9640583411b6dab32/yarl-1.24.2-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:5f3224db28173a00d7afacdee07045cc4673dfab2b15492c7ae10deddbece761", size = 95084, upload-time = "2026-05-19T21:30:31.031Z" }, + { url = "https://files.pythonhosted.org/packages/95/b2/845cf2074a015e6fe0d0808cf1a2d9e868386c4220d657ebd8302b199043/yarl-1.24.2-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:c557165320d6244ebe3a02431b2a201a20080e02f41f0cfa0ccc47a183765da8", size = 95272, upload-time = "2026-05-19T21:30:33.062Z" }, + { url = "https://files.pythonhosted.org/packages/fe/16/e69d4aa244aef45235ddfebc0e04036a6829842bc5a6a795aedc6c998d23/yarl-1.24.2-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:904065e6e85b1fa54d0d87438bd58c14c0bad97aad654ad1077fd9d87e8478ed", size = 101497, upload-time = "2026-05-19T21:30:34.842Z" }, + { url = "https://files.pythonhosted.org/packages/15/94/c07107715d621076863ee88b3ddf183fa5e9d4aba5769623c9979828410a/yarl-1.24.2-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:8cec2a38d70edc10e0e856ceda886af5327a017ccbde8e1de1bd44d300357543", size = 94002, upload-time = "2026-05-19T21:30:37.724Z" }, + { url = "https://files.pythonhosted.org/packages/a9/35/fc1bbdd895b5e4010b8fdd037f7ed3aa289d3863e08231b30231ca9a0815/yarl-1.24.2-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:e7484b9361ed222ee1ca5b4337aa4cbdcc4618ce5aff57d9ef1582fd95893fc0", size = 106524, upload-time = "2026-05-19T21:30:40.196Z" }, + { url = "https://files.pythonhosted.org/packages/1f/f2/32b66d0a4ba47c296cf86d03e2c67bff58399fe6d6d84d5205c04c66cc6d/yarl-1.24.2-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:84f9670b89f34db07f81e53aee83e0b938a3412329d51c8f922488be7fcc4024", size = 106165, upload-time = "2026-05-19T21:30:41.888Z" }, + { url = "https://files.pythonhosted.org/packages/95/47/37cb5ff50c5e825d4d38e81bb04d1b7e96bf960f7ab89f9850b162f3f114/yarl-1.24.2-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:abb2759733d63a28b4956500a5dd57140f26486c92b2caedfb964ab7d9b79dbf", size = 103010, upload-time = "2026-05-19T21:30:43.985Z" }, + { url = "https://files.pythonhosted.org/packages/6f/d2/4597912315096f7bb359e46e13bf8b60994fcbb2db29b804c0902ef4eff5/yarl-1.24.2-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:081c2bf54efe03774d0311172bc04fedf9ca01e644d4cd8c805688e527209bdc", size = 101128, upload-time = "2026-05-19T21:30:46.291Z" }, + { url = "https://files.pythonhosted.org/packages/b9/d5/c8e86e120521e646013d02a8e3b8884392e28494be8f392366e50d208efc/yarl-1.24.2-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:86746bef442aa479107fe28132e1277237f9c24c2f00b0b0cf22b3ee0904f2bb", size = 101382, upload-time = "2026-05-19T21:30:48.085Z" }, + { url = "https://files.pythonhosted.org/packages/fa/98/70b229236118f89dbeb739b76f10225bbf53b5497725502594c9a01d699a/yarl-1.24.2-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:2d07d21d0bc4b17558e8de0b02fbfdf1e347d3bb3699edd00bb92e7c57925420", size = 95964, upload-time = "2026-05-19T21:30:49.785Z" }, + { url = "https://files.pythonhosted.org/packages/87/f8/56c386981e3c8648d279fdef2397ffec577e8320fd5649745e34d54faeb7/yarl-1.24.2-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:4fb1ac3fc5fecd8ae7453ea237e4d22b49befa70266dfe1629924245c21a0c7f", size = 106204, upload-time = "2026-05-19T21:30:51.862Z" }, + { url = "https://files.pythonhosted.org/packages/1a/1e/765afe97811ca35933e2a7de70ac57b1997ea2e4ee895719ee7a231fb7e5/yarl-1.24.2-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:4da31a5512ed1729ca8d8aacde3f7faeb8843cde3165d6bcf7f88f74f17bb8aa", size = 101510, upload-time = "2026-05-19T21:30:53.62Z" }, + { url = "https://files.pythonhosted.org/packages/ee/78/393913f4b9039e1edd09ae8a9bbb9d539be909a8abf6d8a2084585bed4b7/yarl-1.24.2-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:533ded4dceb5f1f3da7906244f4e82cf46cfd40d84c69a1faf5ac506aa65ecbe", size = 105584, upload-time = "2026-05-19T21:30:55.962Z" }, + { url = "https://files.pythonhosted.org/packages/78/87/deb17b7049bbe74ea11a713b86f8f27800cc1c8648b0b797243ebb4830ba/yarl-1.24.2-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:7b3a85525f6e7eeabcfdd372862b21ee1915db1b498a04e8bf0e389b607ff0bd", size = 103410, upload-time = "2026-05-19T21:30:57.962Z" }, + { url = "https://files.pythonhosted.org/packages/8f/be/f9f7594e23b5b93affff0318e4593c1920331bcaefda326cabcad94296a1/yarl-1.24.2-cp314-cp314t-win_amd64.whl", hash = "sha256:a7624b1ca46ca5d7b864ef0d2f8efe3091454085ee1855b4e992314529972215", size = 102980, upload-time = "2026-05-19T21:30:59.735Z" }, + { url = "https://files.pythonhosted.org/packages/65/a4/ba80dccd3593ff1f01051a818694d07b58cb8232677ee9a22a5a1f93a9fc/yarl-1.24.2-cp314-cp314t-win_arm64.whl", hash = "sha256:e434a45ce2e7a947f951fc5a8944c8cc080b7e59f9c50ae80fd39107cf88126d", size = 91219, upload-time = "2026-05-19T21:31:01.934Z" }, + { url = "https://files.pythonhosted.org/packages/fd/4d/4b880086bd0d3e034d25647be1d830afc3e3f610e98c4ab3490af6b1b6d5/yarl-1.24.2-py3-none-any.whl", hash = "sha256:2783d9226db8797636cd6896e4de81feed252d1db72265686c9558d97a4d94b9", size = 53576, upload-time = "2026-05-19T21:31:03.909Z" }, +] From 7271223cc923f88e8a18ba8db2e095d60d7b0d64 Mon Sep 17 00:00:00 2001 From: links Date: Fri, 12 Jun 2026 16:36:54 +0800 Subject: [PATCH 2/7] feat(training): support offline policy options --- .gitignore | 1 + frontend/dist/assets/index-BrfrpyNp.js | 4272 ----------------- frontend/dist/assets/index-DIKndiT6.js | 4272 +++++++++++++++++ frontend/dist/index.html | 2 +- .../training/config/AdvancedCard.tsx | 66 + .../training/config/EssentialsCard.tsx | 15 +- .../components/training/trainingPolicies.ts | 74 + frontend/src/components/training/types.ts | 4 + frontend/src/lib/jobsApi.ts | 4 + frontend/src/pages/Training.tsx | 27 +- lelab/train.py | 70 +- tests/test_train.py | 67 + 12 files changed, 4590 insertions(+), 4284 deletions(-) delete mode 100644 frontend/dist/assets/index-BrfrpyNp.js create mode 100644 frontend/dist/assets/index-DIKndiT6.js create mode 100644 frontend/src/components/training/trainingPolicies.ts diff --git a/.gitignore b/.gitignore index e101caf..a60dac5 100644 --- a/.gitignore +++ b/.gitignore @@ -61,6 +61,7 @@ yarn-error.log* # Local dev / tool state .claude/ +.dev/ .playwright-mcp/ .superpowers/ .worktrees/ diff --git a/frontend/dist/assets/index-BrfrpyNp.js b/frontend/dist/assets/index-BrfrpyNp.js deleted file mode 100644 index 82ac5d1..0000000 --- a/frontend/dist/assets/index-BrfrpyNp.js +++ /dev/null @@ -1,4272 +0,0 @@ -var fG=Object.defineProperty;var bP=t=>{throw TypeError(t)};var hG=(t,e,n)=>e in t?fG(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Kb=(t,e,n)=>hG(t,typeof e!="symbol"?e+"":e,n),Yb=(t,e,n)=>e.has(t)||bP("Cannot "+n);var xe=(t,e,n)=>(Yb(t,e,"read from private field"),n?n.call(t):e.get(t)),Xt=(t,e,n)=>e.has(t)?bP("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),At=(t,e,n,r)=>(Yb(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Sr=(t,e,n)=>(Yb(t,e,"access private method"),n);var Jm=(t,e,n,r)=>({set _(i){At(t,e,i,n)},get _(){return xe(t,e,r)}});function pG(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 o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var Zm=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function dn(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Tk={exports:{}},D0={},Mk={exports:{}},kt={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var vm=Symbol.for("react.element"),mG=Symbol.for("react.portal"),gG=Symbol.for("react.fragment"),vG=Symbol.for("react.strict_mode"),yG=Symbol.for("react.profiler"),xG=Symbol.for("react.provider"),bG=Symbol.for("react.context"),_G=Symbol.for("react.forward_ref"),wG=Symbol.for("react.suspense"),SG=Symbol.for("react.memo"),EG=Symbol.for("react.lazy"),_P=Symbol.iterator;function TG(t){return t===null||typeof t!="object"?null:(t=_P&&t[_P]||t["@@iterator"],typeof t=="function"?t:null)}var Ak={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Ck=Object.assign,Pk={};function hf(t,e,n){this.props=t,this.context=e,this.refs=Pk,this.updater=n||Ak}hf.prototype.isReactComponent={};hf.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};hf.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function Rk(){}Rk.prototype=hf.prototype;function KT(t,e,n){this.props=t,this.context=e,this.refs=Pk,this.updater=n||Ak}var YT=KT.prototype=new Rk;YT.constructor=KT;Ck(YT,hf.prototype);YT.isPureReactComponent=!0;var wP=Array.isArray,Nk=Object.prototype.hasOwnProperty,JT={current:null},Ok={key:!0,ref:!0,__self:!0,__source:!0};function Ik(t,e,n){var r,i={},o=null,a=null;if(e!=null)for(r in e.ref!==void 0&&(a=e.ref),e.key!==void 0&&(o=""+e.key),e)Nk.call(e,r)&&!Ok.hasOwnProperty(r)&&(i[r]=e[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1>>1,F=L[K];if(0>>1;Ki(Q,X))tei(ee,Q)?(L[K]=ee,L[te]=X,K=te):(L[K]=Q,L[q]=X,K=q);else if(tei(ee,X))L[K]=ee,L[te]=X,K=te;else break e}}return j}function i(L,j){var X=L.sortIndex-j.sortIndex;return X!==0?X:L.id-j.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var a=Date,s=a.now();t.unstable_now=function(){return a.now()-s}}var l=[],c=[],u=1,d=null,f=3,p=!1,y=!1,v=!1,g=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(L){for(var j=n(c);j!==null;){if(j.callback===null)r(c);else if(j.startTime<=L)r(c),j.sortIndex=j.expirationTime,e(l,j);else break;j=n(c)}}function S(L){if(v=!1,b(L),!y)if(n(l)!==null)y=!0,O(w);else{var j=n(c);j!==null&&W(S,j.startTime-L)}}function w(L,j){y=!1,v&&(v=!1,m(A),A=-1),p=!0;var X=f;try{for(b(j),d=n(l);d!==null&&(!(d.expirationTime>j)||L&&!P());){var K=d.callback;if(typeof K=="function"){d.callback=null,f=d.priorityLevel;var F=K(d.expirationTime<=j);j=t.unstable_now(),typeof F=="function"?d.callback=F:d===n(l)&&r(l),b(j)}else r(l);d=n(l)}if(d!==null)var Y=!0;else{var q=n(c);q!==null&&W(S,q.startTime-j),Y=!1}return Y}finally{d=null,f=X,p=!1}}var E=!1,T=null,A=-1,M=5,C=-1;function P(){return!(t.unstable_now()-CL||125K?(L.sortIndex=X,e(c,L),n(l)===null&&L===n(c)&&(v?(m(A),A=-1):v=!0,W(S,X-K))):(L.sortIndex=F,e(l,L),y||p||(y=!0,O(w))),L},t.unstable_shouldYield=P,t.unstable_wrapCallback=function(L){var j=f;return function(){var X=f;f=j;try{return L.apply(this,arguments)}finally{f=X}}}})(Uk);jk.exports=Uk;var kG=jk.exports;/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var jG=_,Oi=kG;function Ce(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),cS=Object.prototype.hasOwnProperty,UG=/^[: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]*$/,EP={},TP={};function FG(t){return cS.call(TP,t)?!0:cS.call(EP,t)?!1:UG.test(t)?TP[t]=!0:(EP[t]=!0,!1)}function BG(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function $G(t,e,n,r){if(e===null||typeof e>"u"||BG(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Jr(t,e,n,r,i,o,a){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=o,this.removeEmptyString=a}var xr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){xr[t]=new Jr(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];xr[e]=new Jr(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){xr[t]=new Jr(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){xr[t]=new Jr(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){xr[t]=new Jr(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){xr[t]=new Jr(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){xr[t]=new Jr(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){xr[t]=new Jr(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){xr[t]=new Jr(t,5,!1,t.toLowerCase(),null,!1,!1)});var eM=/[\-:]([a-z])/g;function tM(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(eM,tM);xr[e]=new Jr(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(eM,tM);xr[e]=new Jr(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(eM,tM);xr[e]=new Jr(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){xr[t]=new Jr(t,1,!1,t.toLowerCase(),null,!1,!1)});xr.xlinkHref=new Jr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){xr[t]=new Jr(t,1,!1,t.toLowerCase(),null,!0,!0)});function nM(t,e,n,r){var i=xr.hasOwnProperty(e)?xr[e]:null;(i!==null?i.type!==0:r||!(2s||i[a]!==o[s]){var l=` -`+i[a].replace(" at new "," at ");return t.displayName&&l.includes("")&&(l=l.replace("",t.displayName)),l}while(1<=a&&0<=s);break}}}finally{Qb=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?wh(t):""}function zG(t){switch(t.tag){case 5:return wh(t.type);case 16:return wh("Lazy");case 13:return wh("Suspense");case 19:return wh("SuspenseList");case 0:case 2:case 15:return t=e_(t.type,!1),t;case 11:return t=e_(t.type.render,!1),t;case 1:return t=e_(t.type,!0),t;default:return""}}function hS(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Ru:return"Fragment";case Pu:return"Portal";case uS:return"Profiler";case rM:return"StrictMode";case dS:return"Suspense";case fS:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case $k:return(t.displayName||"Context")+".Consumer";case Bk:return(t._context.displayName||"Context")+".Provider";case iM:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case oM:return e=t.displayName||null,e!==null?e:hS(t.type)||"Memo";case Ms:e=t._payload,t=t._init;try{return hS(t(e))}catch{}}return null}function HG(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return hS(e);case 8:return e===rM?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function il(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Hk(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function VG(t){var e=Hk(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,o.call(this,a)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function tg(t){t._valueTracker||(t._valueTracker=VG(t))}function Vk(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=Hk(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function Xv(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function pS(t,e){var n=e.checked;return Nn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function AP(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=il(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function Gk(t,e){e=e.checked,e!=null&&nM(t,"checked",e,!1)}function mS(t,e){Gk(t,e);var n=il(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?gS(t,e.type,n):e.hasOwnProperty("defaultValue")&&gS(t,e.type,il(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function CP(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function gS(t,e,n){(e!=="number"||Xv(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var Sh=Array.isArray;function Ku(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=ng.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Qh(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var Dh={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},GG=["Webkit","ms","Moz","O"];Object.keys(Dh).forEach(function(t){GG.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Dh[e]=Dh[t]})});function Kk(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||Dh.hasOwnProperty(t)&&Dh[t]?(""+e).trim():e+"px"}function Yk(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Kk(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var WG=Nn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function xS(t,e){if(e){if(WG[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Ce(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Ce(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Ce(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Ce(62))}}function bS(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var _S=null;function aM(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var wS=null,Yu=null,Ju=null;function NP(t){if(t=bm(t)){if(typeof wS!="function")throw Error(Ce(280));var e=t.stateNode;e&&(e=F0(e),wS(t.stateNode,t.type,e))}}function Jk(t){Yu?Ju?Ju.push(t):Ju=[t]:Yu=t}function Zk(){if(Yu){var t=Yu,e=Ju;if(Ju=Yu=null,NP(t),e)for(t=0;t>>=0,t===0?32:31-(r8(t)/i8|0)|0}var rg=64,ig=4194304;function Eh(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Jv(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,o=t.pingedLanes,a=n&268435455;if(a!==0){var s=a&~i;s!==0?r=Eh(s):(o&=a,o!==0&&(r=Eh(o)))}else a=n&~i,a!==0?r=Eh(a):o!==0&&(r=Eh(o));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,o=e&-e,i>=o||i===16&&(o&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0n;n++)e.push(t);return e}function ym(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Lo(e),t[e]=n}function l8(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0=kh),BP=" ",$P=!1;function yj(t,e){switch(t){case"keyup":return k8.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function xj(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Nu=!1;function U8(t,e){switch(t){case"compositionend":return xj(e);case"keypress":return e.which!==32?null:($P=!0,BP);case"textInput":return t=e.data,t===BP&&$P?null:t;default:return null}}function F8(t,e){if(Nu)return t==="compositionend"||!pM&&yj(t,e)?(t=gj(),Sv=dM=js=null,Nu=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=GP(n)}}function Sj(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Sj(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Ej(){for(var t=window,e=Xv();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Xv(t.document)}return e}function mM(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function q8(t){var e=Ej(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&Sj(n.ownerDocument.documentElement,n)){if(r!==null&&mM(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!t.extend&&o>r&&(i=r,r=o,o=i),i=WP(n,o);var a=WP(n,r);i&&a&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==a.node||t.focusOffset!==a.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),o>r?(t.addRange(e),t.extend(a.node,a.offset)):(e.setEnd(a.node,a.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Ou=null,CS=null,Uh=null,PS=!1;function XP(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;PS||Ou==null||Ou!==Xv(r)||(r=Ou,"selectionStart"in r&&mM(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Uh&&op(Uh,r)||(Uh=r,r=ey(CS,"onSelect"),0Lu||(t.current=LS[Lu],LS[Lu]=null,Lu--)}function gn(t,e){Lu++,LS[Lu]=t.current,t.current=e}var ol={},Ir=ml(ol),si=ml(!1),bc=ol;function Md(t,e){var n=t.type.contextTypes;if(!n)return ol;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=e[o];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function li(t){return t=t.childContextTypes,t!=null}function ny(){Sn(si),Sn(Ir)}function eR(t,e,n){if(Ir.current!==ol)throw Error(Ce(168));gn(Ir,e),gn(si,n)}function Ij(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(Ce(108,HG(t)||"Unknown",i));return Nn({},n,r)}function ry(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||ol,bc=Ir.current,gn(Ir,t),gn(si,si.current),!0}function tR(t,e,n){var r=t.stateNode;if(!r)throw Error(Ce(169));n?(t=Ij(t,e,bc),r.__reactInternalMemoizedMergedChildContext=t,Sn(si),Sn(Ir),gn(Ir,t)):Sn(si),gn(si,n)}var ja=null,B0=!1,p_=!1;function Dj(t){ja===null?ja=[t]:ja.push(t)}function aW(t){B0=!0,Dj(t)}function gl(){if(!p_&&ja!==null){p_=!0;var t=0,e=rn;try{var n=ja;for(rn=1;t>=a,i-=a,Ba=1<<32-Lo(e)+i|n<A?(M=T,T=null):M=T.sibling;var C=f(m,T,b[A],S);if(C===null){T===null&&(T=M);break}t&&T&&C.alternate===null&&e(m,T),x=o(C,x,A),E===null?w=C:E.sibling=C,E=C,T=M}if(A===b.length)return n(m,T),Tn&&$l(m,A),w;if(T===null){for(;AA?(M=T,T=null):M=T.sibling;var P=f(m,T,C.value,S);if(P===null){T===null&&(T=M);break}t&&T&&P.alternate===null&&e(m,T),x=o(P,x,A),E===null?w=P:E.sibling=P,E=P,T=M}if(C.done)return n(m,T),Tn&&$l(m,A),w;if(T===null){for(;!C.done;A++,C=b.next())C=d(m,C.value,S),C!==null&&(x=o(C,x,A),E===null?w=C:E.sibling=C,E=C);return Tn&&$l(m,A),w}for(T=r(m,T);!C.done;A++,C=b.next())C=p(T,m,A,C.value,S),C!==null&&(t&&C.alternate!==null&&T.delete(C.key===null?A:C.key),x=o(C,x,A),E===null?w=C:E.sibling=C,E=C);return t&&T.forEach(function(R){return e(m,R)}),Tn&&$l(m,A),w}function g(m,x,b,S){if(typeof b=="object"&&b!==null&&b.type===Ru&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case eg:e:{for(var w=b.key,E=x;E!==null;){if(E.key===w){if(w=b.type,w===Ru){if(E.tag===7){n(m,E.sibling),x=i(E,b.props.children),x.return=m,m=x;break e}}else if(E.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Ms&&iR(w)===E.type){n(m,E.sibling),x=i(E,b.props),x.ref=Kf(m,E,b),x.return=m,m=x;break e}n(m,E);break}else e(m,E);E=E.sibling}b.type===Ru?(x=dc(b.props.children,m.mode,S,b.key),x.return=m,m=x):(S=Nv(b.type,b.key,b.props,null,m.mode,S),S.ref=Kf(m,x,b),S.return=m,m=S)}return a(m);case Pu:e:{for(E=b.key;x!==null;){if(x.key===E)if(x.tag===4&&x.stateNode.containerInfo===b.containerInfo&&x.stateNode.implementation===b.implementation){n(m,x.sibling),x=i(x,b.children||[]),x.return=m,m=x;break e}else{n(m,x);break}else e(m,x);x=x.sibling}x=w_(b,m.mode,S),x.return=m,m=x}return a(m);case Ms:return E=b._init,g(m,x,E(b._payload),S)}if(Sh(b))return y(m,x,b,S);if(Vf(b))return v(m,x,b,S);dg(m,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,x!==null&&x.tag===6?(n(m,x.sibling),x=i(x,b),x.return=m,m=x):(n(m,x),x=__(b,m.mode,S),x.return=m,m=x),a(m)):n(m,x)}return g}var Cd=Uj(!0),Fj=Uj(!1),ay=ml(null),sy=null,Uu=null,xM=null;function bM(){xM=Uu=sy=null}function _M(t){var e=ay.current;Sn(ay),t._currentValue=e}function US(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function Qu(t,e){sy=t,xM=Uu=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(oi=!0),t.firstContext=null)}function io(t){var e=t._currentValue;if(xM!==t)if(t={context:t,memoizedValue:e,next:null},Uu===null){if(sy===null)throw Error(Ce(308));Uu=t,sy.dependencies={lanes:0,firstContext:t}}else Uu=Uu.next=t;return e}var Ql=null;function wM(t){Ql===null?Ql=[t]:Ql.push(t)}function Bj(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,wM(e)):(n.next=i.next,i.next=n),e.interleaved=n,Qa(t,r)}function Qa(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var As=!1;function SM(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function $j(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Ga(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Ws(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,Ht&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,Qa(t,n)}return i=r.interleaved,i===null?(e.next=e,wM(r)):(e.next=i.next,i.next=e),r.interleaved=e,Qa(t,n)}function Tv(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,lM(t,n)}}function oR(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=a:o=o.next=a,n=n.next}while(n!==null);o===null?i=o=e:o=o.next=e}else i=o=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function ly(t,e,n,r){var i=t.updateQueue;As=!1;var o=i.firstBaseUpdate,a=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var l=s,c=l.next;l.next=null,a===null?o=c:a.next=c,a=l;var u=t.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==a&&(s===null?u.firstBaseUpdate=c:s.next=c,u.lastBaseUpdate=l))}if(o!==null){var d=i.baseState;a=0,u=c=l=null,s=o;do{var f=s.lane,p=s.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var y=t,v=s;switch(f=e,p=n,v.tag){case 1:if(y=v.payload,typeof y=="function"){d=y.call(p,d,f);break e}d=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=v.payload,f=typeof y=="function"?y.call(p,d,f):y,f==null)break e;d=Nn({},d,f);break e;case 2:As=!0}}s.callback!==null&&s.lane!==0&&(t.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else p={eventTime:p,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(c=u=p,l=d):u=u.next=p,a|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(u===null&&(l=d),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,e=i.shared.interleaved,e!==null){i=e;do a|=i.lane,i=i.next;while(i!==e)}else o===null&&(i.shared.lanes=0);Sc|=a,t.lanes=a,t.memoizedState=d}}function aR(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;en?n:4,t(!0);var r=g_.transition;g_.transition={};try{t(!1),e()}finally{rn=n,g_.transition=r}}function i3(){return oo().memoizedState}function uW(t,e,n){var r=qs(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},o3(t))a3(e,n);else if(n=Bj(t,e,n,r),n!==null){var i=Vr();ko(n,t,r,i),s3(n,e,r)}}function dW(t,e,n){var r=qs(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(o3(t))a3(e,i);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var a=e.lastRenderedState,s=o(a,n);if(i.hasEagerState=!0,i.eagerState=s,Bo(s,a)){var l=e.interleaved;l===null?(i.next=i,wM(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}n=Bj(t,e,i,r),n!==null&&(i=Vr(),ko(n,t,r,i),s3(n,e,r))}}function o3(t){var e=t.alternate;return t===Rn||e!==null&&e===Rn}function a3(t,e){Fh=uy=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function s3(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,lM(t,n)}}var dy={readContext:io,useCallback:Er,useContext:Er,useEffect:Er,useImperativeHandle:Er,useInsertionEffect:Er,useLayoutEffect:Er,useMemo:Er,useReducer:Er,useRef:Er,useState:Er,useDebugValue:Er,useDeferredValue:Er,useTransition:Er,useMutableSource:Er,useSyncExternalStore:Er,useId:Er,unstable_isNewReconciler:!1},fW={readContext:io,useCallback:function(t,e){return Jo().memoizedState=[t,e===void 0?null:e],t},useContext:io,useEffect:lR,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Av(4194308,4,Qj.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Av(4194308,4,t,e)},useInsertionEffect:function(t,e){return Av(4,2,t,e)},useMemo:function(t,e){var n=Jo();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Jo();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=uW.bind(null,Rn,t),[r.memoizedState,t]},useRef:function(t){var e=Jo();return t={current:t},e.memoizedState=t},useState:sR,useDebugValue:NM,useDeferredValue:function(t){return Jo().memoizedState=t},useTransition:function(){var t=sR(!1),e=t[0];return t=cW.bind(null,t[1]),Jo().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Rn,i=Jo();if(Tn){if(n===void 0)throw Error(Ce(407));n=n()}else{if(n=e(),ar===null)throw Error(Ce(349));wc&30||Gj(r,e,n)}i.memoizedState=n;var o={value:n,getSnapshot:e};return i.queue=o,lR(Xj.bind(null,r,o,t),[t]),r.flags|=2048,hp(9,Wj.bind(null,r,o,n,e),void 0,null),n},useId:function(){var t=Jo(),e=ar.identifierPrefix;if(Tn){var n=$a,r=Ba;n=(r&~(1<<32-Lo(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=dp++,0<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=a.createElement(n,{is:r.is}):(t=a.createElement(n),n==="select"&&(a=t,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):t=a.createElementNS(t,n),t[na]=e,t[lp]=r,v3(t,e,!1,!1),e.stateNode=t;e:{switch(a=bS(n,r),n){case"dialog":xn("cancel",t),xn("close",t),i=r;break;case"iframe":case"object":case"embed":xn("load",t),i=r;break;case"video":case"audio":for(i=0;iNd&&(e.flags|=128,r=!0,Yf(o,!1),e.lanes=4194304)}else{if(!r)if(t=cy(a),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),Yf(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!Tn)return Tr(e),null}else 2*kn()-o.renderingStartTime>Nd&&n!==1073741824&&(e.flags|=128,r=!0,Yf(o,!1),e.lanes=4194304);o.isBackwards?(a.sibling=e.child,e.child=a):(n=o.last,n!==null?n.sibling=a:e.child=a,o.last=a)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=kn(),e.sibling=null,n=Pn.current,gn(Pn,r?n&1|2:n&1),e):(Tr(e),null);case 22:case 23:return jM(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Si&1073741824&&(Tr(e),e.subtreeFlags&6&&(e.flags|=8192)):Tr(e),null;case 24:return null;case 25:return null}throw Error(Ce(156,e.tag))}function bW(t,e){switch(vM(e),e.tag){case 1:return li(e.type)&&ny(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Pd(),Sn(si),Sn(Ir),MM(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return TM(e),null;case 13:if(Sn(Pn),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(Ce(340));Ad()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Sn(Pn),null;case 4:return Pd(),null;case 10:return _M(e.type._context),null;case 22:case 23:return jM(),null;case 24:return null;default:return null}}var hg=!1,Rr=!1,_W=typeof WeakSet=="function"?WeakSet:Set,qe=null;function Fu(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){In(t,e,r)}else n.current=null}function XS(t,e,n){try{n()}catch(r){In(t,e,r)}}var xR=!1;function wW(t,e){if(RS=Zv,t=Ej(),mM(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var a=0,s=-1,l=-1,c=0,u=0,d=t,f=null;t:for(;;){for(var p;d!==n||i!==0&&d.nodeType!==3||(s=a+i),d!==o||r!==0&&d.nodeType!==3||(l=a+r),d.nodeType===3&&(a+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===t)break t;if(f===n&&++c===i&&(s=a),f===o&&++u===r&&(l=a),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(NS={focusedElem:t,selectionRange:n},Zv=!1,qe=e;qe!==null;)if(e=qe,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,qe=t;else for(;qe!==null;){e=qe;try{var y=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var v=y.memoizedProps,g=y.memoizedState,m=e.stateNode,x=m.getSnapshotBeforeUpdate(e.elementType===e.type?v:yo(e.type,v),g);m.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var b=e.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Ce(163))}}catch(S){In(e,e.return,S)}if(t=e.sibling,t!==null){t.return=e.return,qe=t;break}qe=e.return}return y=xR,xR=!1,y}function Bh(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var o=i.destroy;i.destroy=void 0,o!==void 0&&XS(e,n,o)}i=i.next}while(i!==r)}}function H0(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function qS(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function b3(t){var e=t.alternate;e!==null&&(t.alternate=null,b3(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[na],delete e[lp],delete e[DS],delete e[iW],delete e[oW])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function _3(t){return t.tag===5||t.tag===3||t.tag===4}function bR(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||_3(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function KS(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=ty));else if(r!==4&&(t=t.child,t!==null))for(KS(t,e,n),t=t.sibling;t!==null;)KS(t,e,n),t=t.sibling}function YS(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(YS(t,e,n),t=t.sibling;t!==null;)YS(t,e,n),t=t.sibling}var pr=null,wo=!1;function hs(t,e,n){for(n=n.child;n!==null;)w3(t,e,n),n=n.sibling}function w3(t,e,n){if(ua&&typeof ua.onCommitFiberUnmount=="function")try{ua.onCommitFiberUnmount(L0,n)}catch{}switch(n.tag){case 5:Rr||Fu(n,e);case 6:var r=pr,i=wo;pr=null,hs(t,e,n),pr=r,wo=i,pr!==null&&(wo?(t=pr,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):pr.removeChild(n.stateNode));break;case 18:pr!==null&&(wo?(t=pr,n=n.stateNode,t.nodeType===8?h_(t.parentNode,n):t.nodeType===1&&h_(t,n),rp(t)):h_(pr,n.stateNode));break;case 4:r=pr,i=wo,pr=n.stateNode.containerInfo,wo=!0,hs(t,e,n),pr=r,wo=i;break;case 0:case 11:case 14:case 15:if(!Rr&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&XS(n,e,a),i=i.next}while(i!==r)}hs(t,e,n);break;case 1:if(!Rr&&(Fu(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){In(n,e,s)}hs(t,e,n);break;case 21:hs(t,e,n);break;case 22:n.mode&1?(Rr=(r=Rr)||n.memoizedState!==null,hs(t,e,n),Rr=r):hs(t,e,n);break;default:hs(t,e,n)}}function _R(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new _W),e.forEach(function(r){var i=NW.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function co(t,e){var n=e.deletions;if(n!==null)for(var r=0;ri&&(i=a),r&=~o}if(r=i,r=kn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*EW(r/1960))-r,10t?16:t,Us===null)var r=!1;else{if(t=Us,Us=null,py=0,Ht&6)throw Error(Ce(331));var i=Ht;for(Ht|=4,qe=t.current;qe!==null;){var o=qe,a=o.child;if(qe.flags&16){var s=o.deletions;if(s!==null){for(var l=0;lkn()-LM?uc(t,0):DM|=n),ci(t,e)}function R3(t,e){e===0&&(t.mode&1?(e=ig,ig<<=1,!(ig&130023424)&&(ig=4194304)):e=1);var n=Vr();t=Qa(t,e),t!==null&&(ym(t,e,n),ci(t,n))}function RW(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),R3(t,n)}function NW(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(Ce(314))}r!==null&&r.delete(e),R3(t,n)}var N3;N3=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||si.current)oi=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return oi=!1,yW(t,e,n);oi=!!(t.flags&131072)}else oi=!1,Tn&&e.flags&1048576&&Lj(e,oy,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Cv(t,e),t=e.pendingProps;var i=Md(e,Ir.current);Qu(e,n),i=CM(null,e,r,t,i,n);var o=PM();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,li(r)?(o=!0,ry(e)):o=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,SM(e),i.updater=z0,e.stateNode=i,i._reactInternals=e,BS(e,r,t,n),e=HS(null,e,r,!0,o,n)):(e.tag=0,Tn&&o&&gM(e),$r(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(Cv(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=IW(r),t=yo(r,t),i){case 0:e=zS(null,e,r,t,n);break e;case 1:e=gR(null,e,r,t,n);break e;case 11:e=pR(null,e,r,t,n);break e;case 14:e=mR(null,e,r,yo(r.type,t),n);break e}throw Error(Ce(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:yo(r,i),zS(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:yo(r,i),gR(t,e,r,i,n);case 3:e:{if(p3(e),t===null)throw Error(Ce(387));r=e.pendingProps,o=e.memoizedState,i=o.element,$j(t,e),ly(e,r,null,n);var a=e.memoizedState;if(r=a.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){i=Rd(Error(Ce(423)),e),e=vR(t,e,r,n,i);break e}else if(r!==i){i=Rd(Error(Ce(424)),e),e=vR(t,e,r,n,i);break e}else for(Pi=Gs(e.stateNode.containerInfo.firstChild),Ri=e,Tn=!0,Mo=null,n=Fj(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ad(),r===i){e=es(t,e,n);break e}$r(t,e,r,n)}e=e.child}return e;case 5:return zj(e),t===null&&jS(e),r=e.type,i=e.pendingProps,o=t!==null?t.memoizedProps:null,a=i.children,OS(r,i)?a=null:o!==null&&OS(r,o)&&(e.flags|=32),h3(t,e),$r(t,e,a,n),e.child;case 6:return t===null&&jS(e),null;case 13:return m3(t,e,n);case 4:return EM(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Cd(e,null,r,n):$r(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:yo(r,i),pR(t,e,r,i,n);case 7:return $r(t,e,e.pendingProps,n),e.child;case 8:return $r(t,e,e.pendingProps.children,n),e.child;case 12:return $r(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,o=e.memoizedProps,a=i.value,gn(ay,r._currentValue),r._currentValue=a,o!==null)if(Bo(o.value,a)){if(o.children===i.children&&!si.current){e=es(t,e,n);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var s=o.dependencies;if(s!==null){a=o.child;for(var l=s.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=Ga(-1,n&-n),l.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),US(o.return,n,e),s.lanes|=n;break}l=l.next}}else if(o.tag===10)a=o.type===e.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(Ce(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),US(a,n,e),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===e){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}$r(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,Qu(e,n),i=io(i),r=r(i),e.flags|=1,$r(t,e,r,n),e.child;case 14:return r=e.type,i=yo(r,e.pendingProps),i=yo(r.type,i),mR(t,e,r,i,n);case 15:return d3(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:yo(r,i),Cv(t,e),e.tag=1,li(r)?(t=!0,ry(e)):t=!1,Qu(e,n),l3(e,r,i),BS(e,r,i,n),HS(null,e,r,!0,t,n);case 19:return g3(t,e,n);case 22:return f3(t,e,n)}throw Error(Ce(156,e.tag))};function O3(t,e){return oj(t,e)}function OW(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Yi(t,e,n,r){return new OW(t,e,n,r)}function FM(t){return t=t.prototype,!(!t||!t.isReactComponent)}function IW(t){if(typeof t=="function")return FM(t)?1:0;if(t!=null){if(t=t.$$typeof,t===iM)return 11;if(t===oM)return 14}return 2}function Ks(t,e){var n=t.alternate;return n===null?(n=Yi(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Nv(t,e,n,r,i,o){var a=2;if(r=t,typeof t=="function")FM(t)&&(a=1);else if(typeof t=="string")a=5;else e:switch(t){case Ru:return dc(n.children,i,o,e);case rM:a=8,i|=8;break;case uS:return t=Yi(12,n,e,i|2),t.elementType=uS,t.lanes=o,t;case dS:return t=Yi(13,n,e,i),t.elementType=dS,t.lanes=o,t;case fS:return t=Yi(19,n,e,i),t.elementType=fS,t.lanes=o,t;case zk:return G0(n,i,o,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Bk:a=10;break e;case $k:a=9;break e;case iM:a=11;break e;case oM:a=14;break e;case Ms:a=16,r=null;break e}throw Error(Ce(130,t==null?t:typeof t,""))}return e=Yi(a,n,e,i),e.elementType=t,e.type=r,e.lanes=o,e}function dc(t,e,n,r){return t=Yi(7,t,r,e),t.lanes=n,t}function G0(t,e,n,r){return t=Yi(22,t,r,e),t.elementType=zk,t.lanes=n,t.stateNode={isHidden:!1},t}function __(t,e,n){return t=Yi(6,t,null,e),t.lanes=n,t}function w_(t,e,n){return e=Yi(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function DW(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=n_(0),this.expirationTimes=n_(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=n_(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function BM(t,e,n,r,i,o,a,s,l){return t=new DW(t,e,n,s,l),e===1?(e=1,o===!0&&(e|=8)):e=0,o=Yi(3,null,null,e),t.current=o,o.stateNode=t,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},SM(o),t}function LW(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(k3)}catch(t){console.error(t)}}k3(),kk.exports=Li;var Bc=kk.exports;const j3=dn(Bc);var U3,PR=Bc;U3=PR.createRoot,PR.hydrateRoot;/** - * @remix-run/router v1.23.0 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function mp(){return mp=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function F3(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function $W(){return Math.random().toString(36).substr(2,8)}function NR(t,e){return{usr:t.state,key:t.key,idx:e}}function tE(t,e,n,r){return n===void 0&&(n=null),mp({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?gf(e):e,{state:n,key:e&&e.key||r||$W()})}function B3(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function gf(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function zW(t,e,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,a=i.history,s=Fs.Pop,l=null,c=u();c==null&&(c=0,a.replaceState(mp({},a.state,{idx:c}),""));function u(){return(a.state||{idx:null}).idx}function d(){s=Fs.Pop;let g=u(),m=g==null?null:g-c;c=g,l&&l({action:s,location:v.location,delta:m})}function f(g,m){s=Fs.Push;let x=tE(v.location,g,m);c=u()+1;let b=NR(x,c),S=v.createHref(x);try{a.pushState(b,"",S)}catch(w){if(w instanceof DOMException&&w.name==="DataCloneError")throw w;i.location.assign(S)}o&&l&&l({action:s,location:v.location,delta:1})}function p(g,m){s=Fs.Replace;let x=tE(v.location,g,m);c=u();let b=NR(x,c),S=v.createHref(x);a.replaceState(b,"",S),o&&l&&l({action:s,location:v.location,delta:0})}function y(g){let m=i.location.origin!=="null"?i.location.origin:i.location.href,x=typeof g=="string"?g:B3(g);return x=x.replace(/ $/,"%20"),Jn(m,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,m)}let v={get action(){return s},get location(){return t(i,a)},listen(g){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(RR,d),l=g,()=>{i.removeEventListener(RR,d),l=null}},createHref(g){return e(i,g)},createURL:y,encodeLocation(g){let m=y(g);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:f,replace:p,go(g){return a.go(g)}};return v}var OR;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(OR||(OR={}));function HW(t,e,n){return n===void 0&&(n="/"),VW(t,e,n)}function VW(t,e,n,r){let i=typeof e=="string"?gf(e):e,o=H3(i.pathname||"/",n);if(o==null)return null;let a=$3(t);GW(a);let s=null;for(let l=0;s==null&&l{let l={relativePath:s===void 0?o.path||"":s,caseSensitive:o.caseSensitive===!0,childrenIndex:a,route:o};l.relativePath.startsWith("/")&&(Jn(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let c=fc([r,l.relativePath]),u=n.concat(l);o.children&&o.children.length>0&&(Jn(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),$3(o.children,e,u,c)),!(o.path==null&&!o.index)&&e.push({path:c,score:ZW(c,o.index),routesMeta:u})};return t.forEach((o,a)=>{var s;if(o.path===""||!((s=o.path)!=null&&s.includes("?")))i(o,a);else for(let l of z3(o.path))i(o,a,l)}),e}function z3(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let a=z3(r.join("/")),s=[];return s.push(...a.map(l=>l===""?o:[o,l].join("/"))),i&&s.push(...a),s.map(l=>t.startsWith("/")&&l===""?"/":l)}function GW(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:QW(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const WW=/^:[\w-]+$/,XW=3,qW=2,KW=1,YW=10,JW=-2,IR=t=>t==="*";function ZW(t,e){let n=t.split("/"),r=n.length;return n.some(IR)&&(r+=JW),e&&(r+=qW),n.filter(i=>!IR(i)).reduce((i,o)=>i+(WW.test(o)?XW:o===""?KW:YW),r)}function QW(t,e){return t.length===e.length&&t.slice(0,-1).every((r,i)=>r===e[i])?t[t.length-1]-e[e.length-1]:0}function e6(t,e,n){let{routesMeta:r}=t,i={},o="/",a=[];for(let s=0;s{let{paramName:f,isOptional:p}=u;if(f==="*"){let v=s[d]||"";a=o.slice(0,o.length-v.length).replace(/(.)\/+$/,"$1")}const y=s[d];return p&&!y?c[f]=void 0:c[f]=(y||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:a,pattern:t}}function n6(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),F3(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,s,l)=>(r.push({paramName:s,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function r6(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return F3(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function H3(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function i6(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:i=""}=typeof t=="string"?gf(t):t;return{pathname:n?n.startsWith("/")?n:o6(n,e):e,search:u6(r),hash:d6(i)}}function o6(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function S_(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function a6(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function s6(t,e){let n=a6(t);return e?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function l6(t,e,n,r){r===void 0&&(r=!1);let i;typeof t=="string"?i=gf(t):(i=mp({},t),Jn(!i.pathname||!i.pathname.includes("?"),S_("?","pathname","search",i)),Jn(!i.pathname||!i.pathname.includes("#"),S_("#","pathname","hash",i)),Jn(!i.search||!i.search.includes("#"),S_("#","search","hash",i)));let o=t===""||i.pathname==="",a=o?"/":i.pathname,s;if(a==null)s=n;else{let d=e.length-1;if(!r&&a.startsWith("..")){let f=a.split("/");for(;f[0]==="..";)f.shift(),d-=1;i.pathname=f.join("/")}s=d>=0?e[d]:"/"}let l=i6(i,s),c=a&&a!=="/"&&a.endsWith("/"),u=(o||a===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}const fc=t=>t.join("/").replace(/\/\/+/g,"/"),c6=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),u6=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,d6=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function f6(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const V3=["post","put","patch","delete"];new Set(V3);const h6=["get",...V3];new Set(h6);/** - * React Router v6.30.1 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function gp(){return gp=Object.assign?Object.assign.bind():function(t){for(var e=1;e{s.current=!0}),_.useCallback(function(c,u){if(u===void 0&&(u={}),!s.current)return;if(typeof c=="number"){r.go(c);return}let d=l6(c,JSON.parse(a),o,u.relative==="path");t==null&&e!=="/"&&(d.pathname=d.pathname==="/"?e:fc([e,d.pathname])),(u.replace?r.replace:r.push)(d,u.state,u)},[e,r,a,o,t])}function g6(){let{matches:t}=_.useContext($c),e=t[t.length-1];return e?e.params:{}}function v6(t,e){return y6(t,e)}function y6(t,e,n,r){Z0()||Jn(!1);let{navigator:i}=_.useContext(Y0),{matches:o}=_.useContext($c),a=o[o.length-1],s=a?a.params:{};a&&a.pathname;let l=a?a.pathnameBase:"/";a&&a.route;let c=vl(),u;if(e){var d;let g=typeof e=="string"?gf(e):e;l==="/"||(d=g.pathname)!=null&&d.startsWith(l)||Jn(!1),u=g}else u=c;let f=u.pathname||"/",p=f;if(l!=="/"){let g=l.replace(/^\//,"").split("/");p="/"+f.replace(/^\//,"").split("/").slice(g.length).join("/")}let y=HW(t,{pathname:p}),v=S6(y&&y.map(g=>Object.assign({},g,{params:Object.assign({},s,g.params),pathname:fc([l,i.encodeLocation?i.encodeLocation(g.pathname).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?l:fc([l,i.encodeLocation?i.encodeLocation(g.pathnameBase).pathname:g.pathnameBase])})),o,n,r);return e&&v?_.createElement(J0.Provider,{value:{location:gp({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:Fs.Pop}},v):v}function x6(){let t=A6(),e=f6(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return _.createElement(_.Fragment,null,_.createElement("h2",null,"Unexpected Application Error!"),_.createElement("h3",{style:{fontStyle:"italic"}},e),n?_.createElement("pre",{style:i},n):null,null)}const b6=_.createElement(x6,null);class _6 extends _.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?_.createElement($c.Provider,{value:this.props.routeContext},_.createElement(G3.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function w6(t){let{routeContext:e,match:n,children:r}=t,i=_.useContext(VM);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),_.createElement($c.Provider,{value:e},r)}function S6(t,e,n,r){var i;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var o;if(!n)return null;if(n.errors)t=n.matches;else if((o=r)!=null&&o.v7_partialHydration&&e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let a=t,s=(i=n)==null?void 0:i.errors;if(s!=null){let u=a.findIndex(d=>d.route.id&&(s==null?void 0:s[d.route.id])!==void 0);u>=0||Jn(!1),a=a.slice(0,Math.min(a.length,u+1))}let l=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let u=0;u=0?a=a.slice(0,c+1):a=[a[0]];break}}}return a.reduceRight((u,d,f)=>{let p,y=!1,v=null,g=null;n&&(p=s&&d.route.id?s[d.route.id]:void 0,v=d.route.errorElement||b6,l&&(c<0&&f===0?(P6("route-fallback"),y=!0,g=null):c===f&&(y=!0,g=d.route.hydrateFallbackElement||null)));let m=e.concat(a.slice(0,f+1)),x=()=>{let b;return p?b=v:y?b=g:d.route.Component?b=_.createElement(d.route.Component,null):d.route.element?b=d.route.element:b=u,_.createElement(w6,{match:d,routeContext:{outlet:u,matches:m,isDataRoute:n!=null},children:b})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?_.createElement(_6,{location:n.location,revalidation:n.revalidation,component:v,error:p,children:x(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):x()},null)}var X3=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(X3||{}),q3=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(q3||{});function E6(t){let e=_.useContext(VM);return e||Jn(!1),e}function T6(t){let e=_.useContext(p6);return e||Jn(!1),e}function M6(t){let e=_.useContext($c);return e||Jn(!1),e}function K3(t){let e=M6(),n=e.matches[e.matches.length-1];return n.route.id||Jn(!1),n.route.id}function A6(){var t;let e=_.useContext(G3),n=T6(),r=K3();return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function C6(){let{router:t}=E6(X3.UseNavigateStable),e=K3(q3.UseNavigateStable),n=_.useRef(!1);return W3(()=>{n.current=!0}),_.useCallback(function(i,o){o===void 0&&(o={}),n.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,gp({fromRouteId:e},o)))},[t,e])}const DR={};function P6(t,e,n){DR[t]||(DR[t]=!0)}function R6(t,e){t==null||t.v7_startTransition,t==null||t.v7_relativeSplatPath}function go(t){Jn(!1)}function N6(t){let{basename:e="/",children:n=null,location:r,navigationType:i=Fs.Pop,navigator:o,static:a=!1,future:s}=t;Z0()&&Jn(!1);let l=e.replace(/^\/*/,"/"),c=_.useMemo(()=>({basename:l,navigator:o,static:a,future:gp({v7_relativeSplatPath:!1},s)}),[l,s,o,a]);typeof r=="string"&&(r=gf(r));let{pathname:u="/",search:d="",hash:f="",state:p=null,key:y="default"}=r,v=_.useMemo(()=>{let g=H3(u,l);return g==null?null:{location:{pathname:g,search:d,hash:f,state:p,key:y},navigationType:i}},[l,u,d,f,p,y,i]);return v==null?null:_.createElement(Y0.Provider,{value:c},_.createElement(J0.Provider,{children:n,value:v}))}function O6(t){let{children:e,location:n}=t;return v6(nE(e),n)}new Promise(()=>{});function nE(t,e){e===void 0&&(e=[]);let n=[];return _.Children.forEach(t,(r,i)=>{if(!_.isValidElement(r))return;let o=[...e,i];if(r.type===_.Fragment){n.push.apply(n,nE(r.props.children,o));return}r.type!==go&&Jn(!1),!r.props.index||!r.props.children||Jn(!1);let a={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(a.children=nE(r.props.children,o)),n.push(a)}),n}/** - * React Router DOM v6.30.1 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */const I6="6";try{window.__reactRouterVersion=I6}catch{}const D6="startTransition",LR=QT[D6];function L6(t){let{basename:e,children:n,future:r,window:i}=t,o=_.useRef();o.current==null&&(o.current=BW({window:i,v5Compat:!0}));let a=o.current,[s,l]=_.useState({action:a.action,location:a.location}),{v7_startTransition:c}=r||{},u=_.useCallback(d=>{c&&LR?LR(()=>l(d)):l(d)},[l,c]);return _.useLayoutEffect(()=>a.listen(u),[a,u]),_.useEffect(()=>R6(r),[r]),_.createElement(N6,{basename:e,children:n,location:s.location,navigationType:s.action,navigator:a,future:r})}var kR;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(kR||(kR={}));var jR;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(jR||(jR={}));var Q0=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(){}},ex=typeof window>"u"||"Deno"in globalThis;function xo(){}function k6(t,e){return typeof t=="function"?t(e):t}function j6(t){return typeof t=="number"&&t>=0&&t!==1/0}function U6(t,e){return Math.max(t+(e||0)-Date.now(),0)}function rE(t,e){return typeof t=="function"?t(e):t}function F6(t,e){return typeof t=="function"?t(e):t}function UR(t,e){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:a,stale:s}=t;if(a){if(r){if(e.queryHash!==GM(a,e.options))return!1}else if(!yp(e.queryKey,a))return!1}if(n!=="all"){const l=e.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof s=="boolean"&&e.isStale()!==s||i&&i!==e.state.fetchStatus||o&&!o(e))}function FR(t,e){const{exact:n,status:r,predicate:i,mutationKey:o}=t;if(o){if(!e.options.mutationKey)return!1;if(n){if(vp(e.options.mutationKey)!==vp(o))return!1}else if(!yp(e.options.mutationKey,o))return!1}return!(r&&e.state.status!==r||i&&!i(e))}function GM(t,e){return((e==null?void 0:e.queryKeyHashFn)||vp)(t)}function vp(t){return JSON.stringify(t,(e,n)=>iE(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function yp(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>yp(t[n],e[n])):!1}function Y3(t,e){if(t===e)return t;const n=BR(t)&&BR(e);if(n||iE(t)&&iE(e)){const r=n?t:Object.keys(t),i=r.length,o=n?e:Object.keys(e),a=o.length,s=n?[]:{},l=new Set(r);let c=0;for(let u=0;u{setTimeout(e,t)})}function $6(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?Y3(t,e):e}function z6(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function H6(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var WM=Symbol();function J3(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===WM?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var oc,Os,gd,vk,V6=(vk=class extends Q0{constructor(){super();Xt(this,oc);Xt(this,Os);Xt(this,gd);At(this,gd,e=>{if(!ex&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){xe(this,Os)||this.setEventListener(xe(this,gd))}onUnsubscribe(){var e;this.hasListeners()||((e=xe(this,Os))==null||e.call(this),At(this,Os,void 0))}setEventListener(e){var n;At(this,gd,e),(n=xe(this,Os))==null||n.call(this),At(this,Os,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){xe(this,oc)!==e&&(At(this,oc,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof xe(this,oc)=="boolean"?xe(this,oc):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},oc=new WeakMap,Os=new WeakMap,gd=new WeakMap,vk),Z3=new V6,vd,Is,yd,yk,G6=(yk=class extends Q0{constructor(){super();Xt(this,vd,!0);Xt(this,Is);Xt(this,yd);At(this,yd,e=>{if(!ex&&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(){xe(this,Is)||this.setEventListener(xe(this,yd))}onUnsubscribe(){var e;this.hasListeners()||((e=xe(this,Is))==null||e.call(this),At(this,Is,void 0))}setEventListener(e){var n;At(this,yd,e),(n=xe(this,Is))==null||n.call(this),At(this,Is,e(this.setOnline.bind(this)))}setOnline(e){xe(this,vd)!==e&&(At(this,vd,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return xe(this,vd)}},vd=new WeakMap,Is=new WeakMap,yd=new WeakMap,yk),vy=new G6;function W6(){let t,e;const n=new Promise((i,o)=>{t=i,e=o});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 X6(t){return Math.min(1e3*2**t,3e4)}function Q3(t){return(t??"online")==="online"?vy.isOnline():!0}var eU=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function E_(t){return t instanceof eU}function tU(t){let e=!1,n=0,r=!1,i;const o=W6(),a=v=>{var g;r||(f(new eU(v)),(g=t.abort)==null||g.call(t))},s=()=>{e=!0},l=()=>{e=!1},c=()=>Z3.isFocused()&&(t.networkMode==="always"||vy.isOnline())&&t.canRun(),u=()=>Q3(t.networkMode)&&t.canRun(),d=v=>{var g;r||(r=!0,(g=t.onSuccess)==null||g.call(t,v),i==null||i(),o.resolve(v))},f=v=>{var g;r||(r=!0,(g=t.onError)==null||g.call(t,v),i==null||i(),o.reject(v))},p=()=>new Promise(v=>{var g;i=m=>{(r||c())&&v(m)},(g=t.onPause)==null||g.call(t)}).then(()=>{var v;i=void 0,r||(v=t.onContinue)==null||v.call(t)}),y=()=>{if(r)return;let v;const g=n===0?t.initialPromise:void 0;try{v=g??t.fn()}catch(m){v=Promise.reject(m)}Promise.resolve(v).then(d).catch(m=>{var E;if(r)return;const x=t.retry??(ex?0:3),b=t.retryDelay??X6,S=typeof b=="function"?b(n,m):b,w=x===!0||typeof x=="number"&&nc()?void 0:p()).then(()=>{e?f(m):y()})})};return{promise:o,cancel:a,continue:()=>(i==null||i(),o),cancelRetry:s,continueRetry:l,canStart:u,start:()=>(u()?y():p().then(y),o)}}var q6=t=>setTimeout(t,0);function K6(){let t=[],e=0,n=s=>{s()},r=s=>{s()},i=q6;const o=s=>{e?t.push(s):i(()=>{n(s)})},a=()=>{const s=t;t=[],s.length&&i(()=>{r(()=>{s.forEach(l=>{n(l)})})})};return{batch:s=>{let l;e++;try{l=s()}finally{e--,e||a()}return l},batchCalls:s=>(...l)=>{o(()=>{s(...l)})},schedule:o,setNotifyFunction:s=>{n=s},setBatchNotifyFunction:s=>{r=s},setScheduler:s=>{i=s}}}var zr=K6(),ac,xk,nU=(xk=class{constructor(){Xt(this,ac)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),j6(this.gcTime)&&At(this,ac,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(ex?1/0:5*60*1e3))}clearGcTimeout(){xe(this,ac)&&(clearTimeout(xe(this,ac)),At(this,ac,void 0))}},ac=new WeakMap,xk),xd,bd,Gi,sc,Cr,mm,lc,bo,Ia,bk,Y6=(bk=class extends nU{constructor(e){super();Xt(this,bo);Xt(this,xd);Xt(this,bd);Xt(this,Gi);Xt(this,sc);Xt(this,Cr);Xt(this,mm);Xt(this,lc);At(this,lc,!1),At(this,mm,e.defaultOptions),this.setOptions(e.options),this.observers=[],At(this,sc,e.client),At(this,Gi,xe(this,sc).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,At(this,xd,Z6(this.options)),this.state=e.state??xe(this,xd),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=xe(this,Cr))==null?void 0:e.promise}setOptions(e){this.options={...xe(this,mm),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&xe(this,Gi).remove(this)}setData(e,n){const r=$6(this.state.data,e,this.options);return Sr(this,bo,Ia).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){Sr(this,bo,Ia).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var r,i;const n=(r=xe(this,Cr))==null?void 0:r.promise;return(i=xe(this,Cr))==null||i.cancel(e),n?n.then(xo).catch(xo):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(xe(this,xd))}isActive(){return this.observers.some(e=>F6(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===WM||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>rE(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!U6(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=xe(this,Cr))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=xe(this,Cr))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),xe(this,Gi).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(xe(this,Cr)&&(xe(this,lc)?xe(this,Cr).cancel({revert:!0}):xe(this,Cr).cancelRetry()),this.scheduleGc()),xe(this,Gi).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Sr(this,bo,Ia).call(this,{type:"invalidate"})}fetch(e,n){var c,u,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(xe(this,Cr))return xe(this,Cr).continueRetry(),xe(this,Cr).promise}if(e&&this.setOptions(e),!this.options.queryFn){const f=this.observers.find(p=>p.options.queryFn);f&&this.setOptions(f.options)}const r=new AbortController,i=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(At(this,lc,!0),r.signal)})},o=()=>{const f=J3(this.options,n),y=(()=>{const v={client:xe(this,sc),queryKey:this.queryKey,meta:this.meta};return i(v),v})();return At(this,lc,!1),this.options.persister?this.options.persister(f,y,this):f(y)},s=(()=>{const f={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:xe(this,sc),state:this.state,fetchFn:o};return i(f),f})();(c=this.options.behavior)==null||c.onFetch(s,this),At(this,bd,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=s.fetchOptions)==null?void 0:u.meta))&&Sr(this,bo,Ia).call(this,{type:"fetch",meta:(d=s.fetchOptions)==null?void 0:d.meta});const l=f=>{var p,y,v,g;E_(f)&&f.silent||Sr(this,bo,Ia).call(this,{type:"error",error:f}),E_(f)||((y=(p=xe(this,Gi).config).onError)==null||y.call(p,f,this),(g=(v=xe(this,Gi).config).onSettled)==null||g.call(v,this.state.data,f,this)),this.scheduleGc()};return At(this,Cr,tU({initialPromise:n==null?void 0:n.initialPromise,fn:s.fetchFn,abort:r.abort.bind(r),onSuccess:f=>{var p,y,v,g;if(f===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(m){l(m);return}(y=(p=xe(this,Gi).config).onSuccess)==null||y.call(p,f,this),(g=(v=xe(this,Gi).config).onSettled)==null||g.call(v,f,this.state.error,this),this.scheduleGc()},onError:l,onFail:(f,p)=>{Sr(this,bo,Ia).call(this,{type:"failed",failureCount:f,error:p})},onPause:()=>{Sr(this,bo,Ia).call(this,{type:"pause"})},onContinue:()=>{Sr(this,bo,Ia).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0})),xe(this,Cr).start()}},xd=new WeakMap,bd=new WeakMap,Gi=new WeakMap,sc=new WeakMap,Cr=new WeakMap,mm=new WeakMap,lc=new WeakMap,bo=new WeakSet,Ia=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,...J6(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 E_(i)&&i.revert&&xe(this,bd)?{...xe(this,bd),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),zr.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),xe(this,Gi).notify({query:this,type:"updated",action:e})})},bk);function J6(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Q3(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function Z6(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 Zo,_k,Q6=(_k=class extends Q0{constructor(e={}){super();Xt(this,Zo);this.config=e,At(this,Zo,new Map)}build(e,n,r){const i=n.queryKey,o=n.queryHash??GM(i,n);let a=this.get(o);return a||(a=new Y6({client:e,queryKey:i,queryHash:o,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(a)),a}add(e){xe(this,Zo).has(e.queryHash)||(xe(this,Zo).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=xe(this,Zo).get(e.queryHash);n&&(e.destroy(),n===e&&xe(this,Zo).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){zr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return xe(this,Zo).get(e)}getAll(){return[...xe(this,Zo).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>UR(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>UR(e,r)):n}notify(e){zr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){zr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){zr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Zo=new WeakMap,_k),Qo,Br,cc,ea,Es,wk,e9=(wk=class extends nU{constructor(e){super();Xt(this,ea);Xt(this,Qo);Xt(this,Br);Xt(this,cc);this.mutationId=e.mutationId,At(this,Br,e.mutationCache),At(this,Qo,[]),this.state=e.state||t9(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){xe(this,Qo).includes(e)||(xe(this,Qo).push(e),this.clearGcTimeout(),xe(this,Br).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){At(this,Qo,xe(this,Qo).filter(n=>n!==e)),this.scheduleGc(),xe(this,Br).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){xe(this,Qo).length||(this.state.status==="pending"?this.scheduleGc():xe(this,Br).remove(this))}continue(){var e;return((e=xe(this,cc))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var o,a,s,l,c,u,d,f,p,y,v,g,m,x,b,S,w,E,T,A;const n=()=>{Sr(this,ea,Es).call(this,{type:"continue"})};At(this,cc,tU({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(M,C)=>{Sr(this,ea,Es).call(this,{type:"failed",failureCount:M,error:C})},onPause:()=>{Sr(this,ea,Es).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>xe(this,Br).canRun(this)}));const r=this.state.status==="pending",i=!xe(this,cc).canStart();try{if(r)n();else{Sr(this,ea,Es).call(this,{type:"pending",variables:e,isPaused:i}),await((a=(o=xe(this,Br).config).onMutate)==null?void 0:a.call(o,e,this));const C=await((l=(s=this.options).onMutate)==null?void 0:l.call(s,e));C!==this.state.context&&Sr(this,ea,Es).call(this,{type:"pending",context:C,variables:e,isPaused:i})}const M=await xe(this,cc).start();return await((u=(c=xe(this,Br).config).onSuccess)==null?void 0:u.call(c,M,e,this.state.context,this)),await((f=(d=this.options).onSuccess)==null?void 0:f.call(d,M,e,this.state.context)),await((y=(p=xe(this,Br).config).onSettled)==null?void 0:y.call(p,M,null,this.state.variables,this.state.context,this)),await((g=(v=this.options).onSettled)==null?void 0:g.call(v,M,null,e,this.state.context)),Sr(this,ea,Es).call(this,{type:"success",data:M}),M}catch(M){try{throw await((x=(m=xe(this,Br).config).onError)==null?void 0:x.call(m,M,e,this.state.context,this)),await((S=(b=this.options).onError)==null?void 0:S.call(b,M,e,this.state.context)),await((E=(w=xe(this,Br).config).onSettled)==null?void 0:E.call(w,void 0,M,this.state.variables,this.state.context,this)),await((A=(T=this.options).onSettled)==null?void 0:A.call(T,void 0,M,e,this.state.context)),M}finally{Sr(this,ea,Es).call(this,{type:"error",error:M})}}finally{xe(this,Br).runNext(this)}}},Qo=new WeakMap,Br=new WeakMap,cc=new WeakMap,ea=new WeakSet,Es=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),zr.batch(()=>{xe(this,Qo).forEach(r=>{r.onMutationUpdate(e)}),xe(this,Br).notify({mutation:this,type:"updated",action:e})})},wk);function t9(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Fa,_o,gm,Sk,n9=(Sk=class extends Q0{constructor(e={}){super();Xt(this,Fa);Xt(this,_o);Xt(this,gm);this.config=e,At(this,Fa,new Set),At(this,_o,new Map),At(this,gm,0)}build(e,n,r){const i=new e9({mutationCache:this,mutationId:++Jm(this,gm)._,options:e.defaultMutationOptions(n),state:r});return this.add(i),i}add(e){xe(this,Fa).add(e);const n=gg(e);if(typeof n=="string"){const r=xe(this,_o).get(n);r?r.push(e):xe(this,_o).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(xe(this,Fa).delete(e)){const n=gg(e);if(typeof n=="string"){const r=xe(this,_o).get(n);if(r)if(r.length>1){const i=r.indexOf(e);i!==-1&&r.splice(i,1)}else r[0]===e&&xe(this,_o).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=gg(e);if(typeof n=="string"){const r=xe(this,_o).get(n),i=r==null?void 0:r.find(o=>o.state.status==="pending");return!i||i===e}else return!0}runNext(e){var r;const n=gg(e);if(typeof n=="string"){const i=(r=xe(this,_o).get(n))==null?void 0:r.find(o=>o!==e&&o.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){zr.batch(()=>{xe(this,Fa).forEach(e=>{this.notify({type:"removed",mutation:e})}),xe(this,Fa).clear(),xe(this,_o).clear()})}getAll(){return Array.from(xe(this,Fa))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>FR(n,r))}findAll(e={}){return this.getAll().filter(n=>FR(e,n))}notify(e){zr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return zr.batch(()=>Promise.all(e.map(n=>n.continue().catch(xo))))}},Fa=new WeakMap,_o=new WeakMap,gm=new WeakMap,Sk);function gg(t){var e;return(e=t.options.scope)==null?void 0:e.id}function zR(t){return{onFetch:(e,n)=>{var u,d,f,p,y;const r=e.options,i=(f=(d=(u=e.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,o=((p=e.state.data)==null?void 0:p.pages)||[],a=((y=e.state.data)==null?void 0:y.pageParams)||[];let s={pages:[],pageParams:[]},l=0;const c=async()=>{let v=!1;const g=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(e.signal.aborted?v=!0:e.signal.addEventListener("abort",()=>{v=!0}),e.signal)})},m=J3(e.options,e.fetchOptions),x=async(b,S,w)=>{if(v)return Promise.reject();if(S==null&&b.pages.length)return Promise.resolve(b);const T=(()=>{const P={client:e.client,queryKey:e.queryKey,pageParam:S,direction:w?"backward":"forward",meta:e.options.meta};return g(P),P})(),A=await m(T),{maxPages:M}=e.options,C=w?H6:z6;return{pages:C(b.pages,A,M),pageParams:C(b.pageParams,S,M)}};if(i&&o.length){const b=i==="backward",S=b?r9:HR,w={pages:o,pageParams:a},E=S(r,w);s=await x(w,E,b)}else{const b=t??o.length;do{const S=l===0?a[0]??r.initialPageParam:HR(r,s);if(l>0&&S==null)break;s=await x(s,S),l++}while(l{var v,g;return(g=(v=e.options).persister)==null?void 0:g.call(v,c,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=c}}}function HR(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 r9(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 On,Ds,Ls,_d,wd,ks,Sd,Ed,Ek,i9=(Ek=class{constructor(t={}){Xt(this,On);Xt(this,Ds);Xt(this,Ls);Xt(this,_d);Xt(this,wd);Xt(this,ks);Xt(this,Sd);Xt(this,Ed);At(this,On,t.queryCache||new Q6),At(this,Ds,t.mutationCache||new n9),At(this,Ls,t.defaultOptions||{}),At(this,_d,new Map),At(this,wd,new Map),At(this,ks,0)}mount(){Jm(this,ks)._++,xe(this,ks)===1&&(At(this,Sd,Z3.subscribe(async t=>{t&&(await this.resumePausedMutations(),xe(this,On).onFocus())})),At(this,Ed,vy.subscribe(async t=>{t&&(await this.resumePausedMutations(),xe(this,On).onOnline())})))}unmount(){var t,e;Jm(this,ks)._--,xe(this,ks)===0&&((t=xe(this,Sd))==null||t.call(this),At(this,Sd,void 0),(e=xe(this,Ed))==null||e.call(this),At(this,Ed,void 0))}isFetching(t){return xe(this,On).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return xe(this,Ds).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=xe(this,On).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=xe(this,On).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(rE(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return xe(this,On).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=xe(this,On).get(r.queryHash),o=i==null?void 0:i.state.data,a=k6(e,o);if(a!==void 0)return xe(this,On).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(t,e,n){return zr.batch(()=>xe(this,On).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=xe(this,On).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=xe(this,On);zr.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=xe(this,On);return zr.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=zr.batch(()=>xe(this,On).findAll(t).map(i=>i.cancel(n)));return Promise.all(r).then(xo).catch(xo)}invalidateQueries(t,e={}){return zr.batch(()=>(xe(this,On).findAll(t).forEach(n=>{n.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=zr.batch(()=>xe(this,On).findAll(t).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(xo)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(xo)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=xe(this,On).build(this,e);return n.isStaleByTime(rE(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(xo).catch(xo)}fetchInfiniteQuery(t){return t.behavior=zR(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(xo).catch(xo)}ensureInfiniteQueryData(t){return t.behavior=zR(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return vy.isOnline()?xe(this,Ds).resumePausedMutations():Promise.resolve()}getQueryCache(){return xe(this,On)}getMutationCache(){return xe(this,Ds)}getDefaultOptions(){return xe(this,Ls)}setDefaultOptions(t){At(this,Ls,t)}setQueryDefaults(t,e){xe(this,_d).set(vp(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...xe(this,_d).values()],n={};return e.forEach(r=>{yp(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){xe(this,wd).set(vp(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...xe(this,wd).values()],n={};return e.forEach(r=>{yp(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...xe(this,Ls).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=GM(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===WM&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...xe(this,Ls).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){xe(this,On).clear(),xe(this,Ds).clear()}},On=new WeakMap,Ds=new WeakMap,Ls=new WeakMap,_d=new WeakMap,wd=new WeakMap,ks=new WeakMap,Sd=new WeakMap,Ed=new WeakMap,Ek),o9=_.createContext(void 0),a9=({client:t,children:e})=>(_.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),h.jsx(o9.Provider,{value:t,children:e}));const s9={theme:"system",setTheme:()=>null},l9=_.createContext(s9);function c9({children:t,defaultTheme:e="system",storageKey:n="vite-ui-theme",...r}){const[i,o]=_.useState(()=>localStorage.getItem(n)||e);_.useEffect(()=>{const l=window.document.documentElement;if(l.classList.remove("light","dark"),i==="system"){const c=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";l.classList.add(c);return}l.classList.add(i)},[i]);const a=_.useCallback(l=>{localStorage.setItem(n,l),o(l)},[n]),s=_.useMemo(()=>({theme:i,setTheme:a}),[i,a]);return h.jsx(l9.Provider,{...r,value:s,children:t})}var u9=t=>{switch(t){case"success":return h9;case"info":return m9;case"warning":return p9;case"error":return g9;default:return null}},d9=Array(12).fill(0),f9=({visible:t,className:e})=>Z.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},Z.createElement("div",{className:"sonner-spinner"},d9.map((n,r)=>Z.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),h9=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Z.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),p9=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Z.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),m9=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Z.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),g9=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Z.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),v9=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},Z.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Z.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),y9=()=>{let[t,e]=Z.useState(document.hidden);return Z.useEffect(()=>{let n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t},oE=1,x9=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let e=this.subscribers.indexOf(t);this.subscribers.splice(e,1)}),this.publish=t=>{this.subscribers.forEach(e=>e(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var e;let{message:n,...r}=t,i=typeof(t==null?void 0:t.id)=="number"||((e=t.id)==null?void 0:e.length)>0?t.id:oE++,o=this.toasts.find(s=>s.id===i),a=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),o?this.toasts=this.toasts.map(s=>s.id===i?(this.publish({...s,...t,id:i,title:n}),{...s,...t,id:i,dismissible:a,title:n}):s):this.addToast({title:n,...r,dismissible:a,id:i}),i},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(e=>{this.subscribers.forEach(n=>n({id:e.id,dismiss:!0}))}),this.subscribers.forEach(e=>e({id:t,dismiss:!0})),t),this.message=(t,e)=>this.create({...e,message:t}),this.error=(t,e)=>this.create({...e,message:t,type:"error"}),this.success=(t,e)=>this.create({...e,type:"success",message:t}),this.info=(t,e)=>this.create({...e,type:"info",message:t}),this.warning=(t,e)=>this.create({...e,type:"warning",message:t}),this.loading=(t,e)=>this.create({...e,type:"loading",message:t}),this.promise=(t,e)=>{if(!e)return;let n;e.loading!==void 0&&(n=this.create({...e,promise:t,type:"loading",message:e.loading,description:typeof e.description!="function"?e.description:void 0}));let r=t instanceof Promise?t:t(),i=n!==void 0,o,a=r.then(async l=>{if(o=["resolve",l],Z.isValidElement(l))i=!1,this.create({id:n,type:"default",message:l});else if(_9(l)&&!l.ok){i=!1;let c=typeof e.error=="function"?await e.error(`HTTP error! status: ${l.status}`):e.error,u=typeof e.description=="function"?await e.description(`HTTP error! status: ${l.status}`):e.description;this.create({id:n,type:"error",message:c,description:u})}else if(e.success!==void 0){i=!1;let c=typeof e.success=="function"?await e.success(l):e.success,u=typeof e.description=="function"?await e.description(l):e.description;this.create({id:n,type:"success",message:c,description:u})}}).catch(async l=>{if(o=["reject",l],e.error!==void 0){i=!1;let c=typeof e.error=="function"?await e.error(l):e.error,u=typeof e.description=="function"?await e.description(l):e.description;this.create({id:n,type:"error",message:c,description:u})}}).finally(()=>{var l;i&&(this.dismiss(n),n=void 0),(l=e.finally)==null||l.call(e)}),s=()=>new Promise((l,c)=>a.then(()=>o[0]==="reject"?c(o[1]):l(o[1])).catch(c));return typeof n!="string"&&typeof n!="number"?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(t,e)=>{let n=(e==null?void 0:e.id)||oE++;return this.create({jsx:t(n),id:n,...e}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},ni=new x9,b9=(t,e)=>{let n=(e==null?void 0:e.id)||oE++;return ni.addToast({title:t,...e,id:n}),n},_9=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",w9=b9,S9=()=>ni.toasts,E9=()=>ni.getActiveToasts(),Ur=Object.assign(w9,{success:ni.success,info:ni.info,warning:ni.warning,error:ni.error,custom:ni.custom,message:ni.message,promise:ni.promise,dismiss:ni.dismiss,loading:ni.loading},{getHistory:S9,getToasts:E9});function T9(t,{insertAt:e}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}T9(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-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;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)} -`);function vg(t){return t.label!==void 0}var M9=3,A9="32px",C9="16px",VR=4e3,P9=356,R9=14,N9=20,O9=200;function uo(...t){return t.filter(Boolean).join(" ")}function I9(t){let[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}var D9=t=>{var e,n,r,i,o,a,s,l,c,u,d;let{invert:f,toast:p,unstyled:y,interacting:v,setHeights:g,visibleToasts:m,heights:x,index:b,toasts:S,expanded:w,removeToast:E,defaultRichColors:T,closeButton:A,style:M,cancelButtonStyle:C,actionButtonStyle:P,className:R="",descriptionClassName:D="",duration:k,position:U,gap:O,loadingIcon:W,expandByDefault:L,classNames:j,icons:X,closeButtonAriaLabel:K="Close toast",pauseWhenPageIsHidden:F}=t,[Y,q]=Z.useState(null),[Q,te]=Z.useState(null),[ee,ce]=Z.useState(!1),[ae,fe]=Z.useState(!1),[we,le]=Z.useState(!1),[ie,G]=Z.useState(!1),[Ve,Ne]=Z.useState(!1),[st,Re]=Z.useState(0),[ct,Ye]=Z.useState(0),it=Z.useRef(p.duration||k||VR),Ft=Z.useRef(null),J=Z.useRef(null),B=b===0,ue=b+1<=m,me=p.type,be=p.dismissible!==!1,ge=p.className||"",rt=p.descriptionClassName||"",Ie=Z.useMemo(()=>x.findIndex(Se=>Se.toastId===p.id)||0,[x,p.id]),Je=Z.useMemo(()=>{var Se;return(Se=p.closeButton)!=null?Se:A},[p.closeButton,A]),tt=Z.useMemo(()=>p.duration||k||VR,[p.duration,k]),Ee=Z.useRef(0),Be=Z.useRef(0),ht=Z.useRef(0),ot=Z.useRef(null),[Le,_t]=U.split("-"),re=Z.useMemo(()=>x.reduce((Se,je,vt)=>vt>=Ie?Se:Se+je.height,0),[x,Ie]),ke=y9(),Me=p.invert||f,Ge=me==="loading";Be.current=Z.useMemo(()=>Ie*O+re,[Ie,re]),Z.useEffect(()=>{it.current=tt},[tt]),Z.useEffect(()=>{ce(!0)},[]),Z.useEffect(()=>{let Se=J.current;if(Se){let je=Se.getBoundingClientRect().height;return Ye(je),g(vt=>[{toastId:p.id,height:je,position:p.position},...vt]),()=>g(vt=>vt.filter(pt=>pt.toastId!==p.id))}},[g,p.id]),Z.useLayoutEffect(()=>{if(!ee)return;let Se=J.current,je=Se.style.height;Se.style.height="auto";let vt=Se.getBoundingClientRect().height;Se.style.height=je,Ye(vt),g(pt=>pt.find(fn=>fn.toastId===p.id)?pt.map(fn=>fn.toastId===p.id?{...fn,height:vt}:fn):[{toastId:p.id,height:vt,position:p.position},...pt])},[ee,p.title,p.description,g,p.id]);let Te=Z.useCallback(()=>{fe(!0),Re(Be.current),g(Se=>Se.filter(je=>je.toastId!==p.id)),setTimeout(()=>{E(p)},O9)},[p,E,g,Be]);Z.useEffect(()=>{if(p.promise&&me==="loading"||p.duration===1/0||p.type==="loading")return;let Se;return w||v||F&&ke?(()=>{if(ht.current{var je;(je=p.onAutoClose)==null||je.call(p,p),Te()},it.current)),()=>clearTimeout(Se)},[w,v,p,me,F,ke,Te]),Z.useEffect(()=>{p.delete&&Te()},[Te,p.delete]);function _e(){var Se,je,vt;return X!=null&&X.loading?Z.createElement("div",{className:uo(j==null?void 0:j.loader,(Se=p==null?void 0:p.classNames)==null?void 0:Se.loader,"sonner-loader"),"data-visible":me==="loading"},X.loading):W?Z.createElement("div",{className:uo(j==null?void 0:j.loader,(je=p==null?void 0:p.classNames)==null?void 0:je.loader,"sonner-loader"),"data-visible":me==="loading"},W):Z.createElement(f9,{className:uo(j==null?void 0:j.loader,(vt=p==null?void 0:p.classNames)==null?void 0:vt.loader),visible:me==="loading"})}return Z.createElement("li",{tabIndex:0,ref:J,className:uo(R,ge,j==null?void 0:j.toast,(e=p==null?void 0:p.classNames)==null?void 0:e.toast,j==null?void 0:j.default,j==null?void 0:j[me],(n=p==null?void 0:p.classNames)==null?void 0:n[me]),"data-sonner-toast":"","data-rich-colors":(r=p.richColors)!=null?r:T,"data-styled":!(p.jsx||p.unstyled||y),"data-mounted":ee,"data-promise":!!p.promise,"data-swiped":Ve,"data-removed":ae,"data-visible":ue,"data-y-position":Le,"data-x-position":_t,"data-index":b,"data-front":B,"data-swiping":we,"data-dismissible":be,"data-type":me,"data-invert":Me,"data-swipe-out":ie,"data-swipe-direction":Q,"data-expanded":!!(w||L&&ee),style:{"--index":b,"--toasts-before":b,"--z-index":S.length-b,"--offset":`${ae?st:Be.current}px`,"--initial-height":L?"auto":`${ct}px`,...M,...p.style},onDragEnd:()=>{le(!1),q(null),ot.current=null},onPointerDown:Se=>{Ge||!be||(Ft.current=new Date,Re(Be.current),Se.target.setPointerCapture(Se.pointerId),Se.target.tagName!=="BUTTON"&&(le(!0),ot.current={x:Se.clientX,y:Se.clientY}))},onPointerUp:()=>{var Se,je,vt,pt;if(ie||!be)return;ot.current=null;let fn=Number(((Se=J.current)==null?void 0:Se.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Un=Number(((je=J.current)==null?void 0:je.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ui=new Date().getTime()-((vt=Ft.current)==null?void 0:vt.getTime()),_r=Y==="x"?fn:Un,nr=Math.abs(_r)/Ui;if(Math.abs(_r)>=N9||nr>.11){Re(Be.current),(pt=p.onDismiss)==null||pt.call(p,p),te(Y==="x"?fn>0?"right":"left":Un>0?"down":"up"),Te(),G(!0),Ne(!1);return}le(!1),q(null)},onPointerMove:Se=>{var je,vt,pt,fn;if(!ot.current||!be||((je=window.getSelection())==null?void 0:je.toString().length)>0)return;let Un=Se.clientY-ot.current.y,Ui=Se.clientX-ot.current.x,_r=(vt=t.swipeDirections)!=null?vt:I9(U);!Y&&(Math.abs(Ui)>1||Math.abs(Un)>1)&&q(Math.abs(Ui)>Math.abs(Un)?"x":"y");let nr={x:0,y:0};Y==="y"?(_r.includes("top")||_r.includes("bottom"))&&(_r.includes("top")&&Un<0||_r.includes("bottom")&&Un>0)&&(nr.y=Un):Y==="x"&&(_r.includes("left")||_r.includes("right"))&&(_r.includes("left")&&Ui<0||_r.includes("right")&&Ui>0)&&(nr.x=Ui),(Math.abs(nr.x)>0||Math.abs(nr.y)>0)&&Ne(!0),(pt=J.current)==null||pt.style.setProperty("--swipe-amount-x",`${nr.x}px`),(fn=J.current)==null||fn.style.setProperty("--swipe-amount-y",`${nr.y}px`)}},Je&&!p.jsx?Z.createElement("button",{"aria-label":K,"data-disabled":Ge,"data-close-button":!0,onClick:Ge||!be?()=>{}:()=>{var Se;Te(),(Se=p.onDismiss)==null||Se.call(p,p)},className:uo(j==null?void 0:j.closeButton,(i=p==null?void 0:p.classNames)==null?void 0:i.closeButton)},(o=X==null?void 0:X.close)!=null?o:v9):null,p.jsx||_.isValidElement(p.title)?p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title:Z.createElement(Z.Fragment,null,me||p.icon||p.promise?Z.createElement("div",{"data-icon":"",className:uo(j==null?void 0:j.icon,(a=p==null?void 0:p.classNames)==null?void 0:a.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||_e():null,p.type!=="loading"?p.icon||(X==null?void 0:X[me])||u9(me):null):null,Z.createElement("div",{"data-content":"",className:uo(j==null?void 0:j.content,(s=p==null?void 0:p.classNames)==null?void 0:s.content)},Z.createElement("div",{"data-title":"",className:uo(j==null?void 0:j.title,(l=p==null?void 0:p.classNames)==null?void 0:l.title)},typeof p.title=="function"?p.title():p.title),p.description?Z.createElement("div",{"data-description":"",className:uo(D,rt,j==null?void 0:j.description,(c=p==null?void 0:p.classNames)==null?void 0:c.description)},typeof p.description=="function"?p.description():p.description):null),_.isValidElement(p.cancel)?p.cancel:p.cancel&&vg(p.cancel)?Z.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||C,onClick:Se=>{var je,vt;vg(p.cancel)&&be&&((vt=(je=p.cancel).onClick)==null||vt.call(je,Se),Te())},className:uo(j==null?void 0:j.cancelButton,(u=p==null?void 0:p.classNames)==null?void 0:u.cancelButton)},p.cancel.label):null,_.isValidElement(p.action)?p.action:p.action&&vg(p.action)?Z.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||P,onClick:Se=>{var je,vt;vg(p.action)&&((vt=(je=p.action).onClick)==null||vt.call(je,Se),!Se.defaultPrevented&&Te())},className:uo(j==null?void 0:j.actionButton,(d=p==null?void 0:p.classNames)==null?void 0:d.actionButton)},p.action.label):null))};function GR(){if(typeof window>"u"||typeof document>"u")return"ltr";let t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function L9(t,e){let n={};return[t,e].forEach((r,i)=>{let o=i===1,a=o?"--mobile-offset":"--offset",s=o?C9:A9;function l(c){["top","right","bottom","left"].forEach(u=>{n[`${a}-${u}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{r[c]===void 0?n[`${a}-${c}`]=s:n[`${a}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):l(s)}),n}_.forwardRef(function(t,e){let{invert:n,position:r="bottom-right",hotkey:i=["altKey","KeyT"],expand:o,closeButton:a,className:s,offset:l,mobileOffset:c,theme:u="light",richColors:d,duration:f,style:p,visibleToasts:y=M9,toastOptions:v,dir:g=GR(),gap:m=R9,loadingIcon:x,icons:b,containerAriaLabel:S="Notifications",pauseWhenPageIsHidden:w}=t,[E,T]=Z.useState([]),A=Z.useMemo(()=>Array.from(new Set([r].concat(E.filter(F=>F.position).map(F=>F.position)))),[E,r]),[M,C]=Z.useState([]),[P,R]=Z.useState(!1),[D,k]=Z.useState(!1),[U,O]=Z.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),W=Z.useRef(null),L=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),j=Z.useRef(null),X=Z.useRef(!1),K=Z.useCallback(F=>{T(Y=>{var q;return(q=Y.find(Q=>Q.id===F.id))!=null&&q.delete||ni.dismiss(F.id),Y.filter(({id:Q})=>Q!==F.id)})},[]);return Z.useEffect(()=>ni.subscribe(F=>{if(F.dismiss){T(Y=>Y.map(q=>q.id===F.id?{...q,delete:!0}:q));return}setTimeout(()=>{j3.flushSync(()=>{T(Y=>{let q=Y.findIndex(Q=>Q.id===F.id);return q!==-1?[...Y.slice(0,q),{...Y[q],...F},...Y.slice(q+1)]:[F,...Y]})})})}),[]),Z.useEffect(()=>{if(u!=="system"){O(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?O("dark"):O("light")),typeof window>"u")return;let F=window.matchMedia("(prefers-color-scheme: dark)");try{F.addEventListener("change",({matches:Y})=>{O(Y?"dark":"light")})}catch{F.addListener(({matches:q})=>{try{O(q?"dark":"light")}catch(Q){console.error(Q)}})}},[u]),Z.useEffect(()=>{E.length<=1&&R(!1)},[E]),Z.useEffect(()=>{let F=Y=>{var q,Q;i.every(te=>Y[te]||Y.code===te)&&(R(!0),(q=W.current)==null||q.focus()),Y.code==="Escape"&&(document.activeElement===W.current||(Q=W.current)!=null&&Q.contains(document.activeElement))&&R(!1)};return document.addEventListener("keydown",F),()=>document.removeEventListener("keydown",F)},[i]),Z.useEffect(()=>{if(W.current)return()=>{j.current&&(j.current.focus({preventScroll:!0}),j.current=null,X.current=!1)}},[W.current]),Z.createElement("section",{ref:e,"aria-label":`${S} ${L}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},A.map((F,Y)=>{var q;let[Q,te]=F.split("-");return E.length?Z.createElement("ol",{key:F,dir:g==="auto"?GR():g,tabIndex:-1,ref:W,className:s,"data-sonner-toaster":!0,"data-theme":U,"data-y-position":Q,"data-lifted":P&&E.length>1&&!o,"data-x-position":te,style:{"--front-toast-height":`${((q=M[0])==null?void 0:q.height)||0}px`,"--width":`${P9}px`,"--gap":`${m}px`,...p,...L9(l,c)},onBlur:ee=>{X.current&&!ee.currentTarget.contains(ee.relatedTarget)&&(X.current=!1,j.current&&(j.current.focus({preventScroll:!0}),j.current=null))},onFocus:ee=>{ee.target instanceof HTMLElement&&ee.target.dataset.dismissible==="false"||X.current||(X.current=!0,j.current=ee.relatedTarget)},onMouseEnter:()=>R(!0),onMouseMove:()=>R(!0),onMouseLeave:()=>{D||R(!1)},onDragEnd:()=>R(!1),onPointerDown:ee=>{ee.target instanceof HTMLElement&&ee.target.dataset.dismissible==="false"||k(!0)},onPointerUp:()=>k(!1)},E.filter(ee=>!ee.position&&Y===0||ee.position===F).map((ee,ce)=>{var ae,fe;return Z.createElement(D9,{key:ee.id,icons:b,index:ce,toast:ee,defaultRichColors:d,duration:(ae=v==null?void 0:v.duration)!=null?ae:f,className:v==null?void 0:v.className,descriptionClassName:v==null?void 0:v.descriptionClassName,invert:n,visibleToasts:y,closeButton:(fe=v==null?void 0:v.closeButton)!=null?fe:a,interacting:D,position:F,style:v==null?void 0:v.style,unstyled:v==null?void 0:v.unstyled,classNames:v==null?void 0:v.classNames,cancelButtonStyle:v==null?void 0:v.cancelButtonStyle,actionButtonStyle:v==null?void 0:v.actionButtonStyle,removeToast:K,toasts:E.filter(we=>we.position==ee.position),heights:M.filter(we=>we.position==ee.position),setHeights:C,expandByDefault:o,gap:m,loadingIcon:x,expanded:P,pauseWhenPageIsHidden:w,swipeDirections:t.swipeDirections})})):null}))});function k9(t){if(!(t instanceof DataTransfer))throw new Error('Data must be of type "DataTransfer"');const e={};function n(r){const i=a=>a!==null&&typeof a=="object"&&"isFile"in a&&typeof a.file=="function"&&"fullPath"in a,o=a=>a!==null&&typeof a=="object"&&"isFile"in a&&typeof a.createReader=="function";if(i(r)&&r.isFile)return new Promise(a=>{r.file(s=>{e[r.fullPath]=s,a()})});if(o(r)&&!r.isFile){const a=r.createReader();return new Promise(s=>{const l=[];function c(){a.readEntries(u=>{u.length===0?Promise.all(l).then(()=>s()):(u.forEach(d=>{l.push(n(d))}),c())})}c()})}return Promise.resolve()}return new Promise(r=>{const i=t.items&&Array.from(t.items),o=Array.from(t.files);if(i&&i.length&&"webkitGetAsEntry"in i[0]){const a=[];for(let s=0;sr(e))}else o.filter(a=>a.size!==0).forEach(a=>e["/"+a.name]=a),r(e)})}function WR(t){return t.replace(/\\/g,"/").split(/\//g).reduce((e,n)=>(n===".."?e.pop():n!=="."&&e.push(n),e),[]).join("/")}function XR(t){return new Promise((e,n)=>{const r=new FileReader;r.onload=i=>{i.target&&i.target.result?e(i.target.result):n(new Error("Failed to read Urdf file content"))},r.onerror=()=>n(new Error("Error reading Urdf file")),r.readAsText(t)})}async function j9(t,e){const n=await k9(t),r=Object.keys(n).map(a=>WR(a)),i=r.filter(a=>/urdf$/i.test(a)),o={};if(i.forEach(a=>{o[a]=URL.createObjectURL(n[a])}),i.length>0){const s=i[0].match(/^(\/[^/]+\/)/);s&&s[1]&&s[1]}return e.setUrlModifierFunc(a=>{var u;const l=WR(a).split("/").pop()||"";let c=r.find(d=>d.endsWith(l));if(!c&&l.includes(".")){const d="."+l.split(".").pop();c=r.find(f=>f.endsWith(d))}if(c!=null){const d=((u=c.split(".").pop())==null?void 0:u.toLowerCase())||"",f=new Blob([n[c]],{type:U9(d)}),p=URL.createObjectURL(f)+"#."+d;return setTimeout(()=>URL.revokeObjectURL(p),5e3),p}return console.warn(`No matching file found for: ${a}`),a}),{files:n,availableModels:i,blobUrls:o}}function U9(t){switch(t.toLowerCase()){case"stl":return"model/stl";case"obj":return"model/obj";case"gltf":case"glb":return"model/gltf+json";case"dae":return"model/vnd.collada+xml";case"urdf":return"application/xml";default:return"application/octet-stream"}}const rU=_.createContext(void 0),F9=({children:t})=>{const[e,n]=_.useState(null),[r,i]=_.useState({}),[o,a]=_.useState([]),[s,l]=_.useState(!1),[c,u]=_.useState([]),[d,f]=_.useState(!0),[p,y]=_.useState(null),[v,g]=_.useState(null);_.useEffect(()=>{if(!d||p)return;let P=!1;return(async()=>{try{const R=await fetch("/so-101-urdf/urdf/so101_new_calib.urdf");if(!R.ok)throw new Error(`Failed to fetch default Urdf: ${R.statusText}`);const D=await R.text();P||y(D)}catch(R){P||console.error("Error loading default Urdf content:",R)}})(),()=>{P=!0}},[d,p]);const m=_.useRef([]),x=_.useCallback(()=>{f(!0),y(null),g(null),Ur.info("Switched to default model",{description:"The default ARM100 robot model is now displayed."})},[]),b=_.useCallback(P=>(m.current.push(P),()=>{m.current=m.current.filter(R=>R!==P)}),[]),S=_.useCallback(P=>{n(P)},[]),w=_.useCallback(P=>{P.hasUrdf?f(!1):x(),m.current.forEach(R=>R(P))},[x]),E=_.useCallback(async P=>{var k;if(!e)return;const R=Object.values(r).filter(U=>U===P.blobUrl).map(U=>{const O=Object.keys(r).find(W=>r[W]===U);return O?{path:O,url:U}:null}).filter(U=>U!==null);if(R.length===0){console.error("โŒ Could not find file for selected Urdf model");return}const D=Ur.loading("Loading Urdf model...",{description:"Preparing 3D visualization",duration:5e3});try{const U=(k=R[0])==null?void 0:k.path;if(!U||!r[U])throw new Error("File not found in records");const W=await(await fetch(P.blobUrl)).blob(),L=new File([W],U.split("/").pop()||"model.urdf",{type:"application/xml"}),j=await XR(L);y(j),Ur.dismiss(D),f(!1);const X=P.name||P.path.split("/").pop()||"Unknown";Ur.success("Urdf model loaded successfully",{description:`Model: ${X}`,duration:3e3}),w({hasUrdf:!0,modelName:X})}catch(U){console.error("โŒ Error processing selected Urdf:",U),Ur.dismiss(D),Ur.error("Error loading Urdf",{description:`Error: ${U instanceof Error?U.message:String(U)}`,duration:3e3})}},[r,e,w]),T=_.useCallback(P=>{var D;if(!e){console.error("โŒ No Urdf processor available");return}l(!1);const R=P.name||((D=P.path.split("/").pop())==null?void 0:D.replace(/\.urdf$/i,""))||"Unknown";e.loadUrdf(P.blobUrl),f(!1),Ur.info(`Loading model: ${R}`,{description:"Preparing 3D visualization",duration:2e3}),w({hasUrdf:!0,modelName:R}),E(P)},[e,w,E]),A=_.useCallback(async(P,R)=>{Object.values(r).forEach(URL.revokeObjectURL),i({}),a([]),u([]);try{if(R.length>0&&e){const D={};R.forEach(U=>{P[U]&&(D[U]=URL.createObjectURL(P[U]))}),i(D),a(R);const k=R.map(U=>{const W=(U.split("/").pop()||"").replace(/\.urdf$/i,"");return{path:U,blobUrl:D[U],name:W}});if(u(k),R.length===1){const O=(R[0].split("/").pop()||"").replace(/\.urdf$/i,""),W=D[R[0]];if(W)if(e.loadUrdf(W),f(!1),P[R[0]]){const L=Ur.loading("Loading Urdf model...",{description:"Preparing 3D visualization",duration:5e3});try{const j=await XR(P[R[0]]);y(j),Ur.dismiss(L),Ur.success("Urdf model loaded successfully",{description:`Model: ${O}`,duration:3e3}),w({hasUrdf:!0,modelName:O})}catch(j){console.error("Error loading Urdf:",j),Ur.dismiss(L),Ur.error("Error loading Urdf",{description:`Error: ${j instanceof Error?j.message:String(j)}`,duration:3e3}),w({hasUrdf:!0,modelName:O})}}else console.error("Could not find file for Urdf model:",R[0]),w({hasUrdf:!0,modelName:O});else console.warn(`No blob URL found for ${R[0]}, using path directly`),e.loadUrdf(R[0]),f(!1),w({hasUrdf:!0,modelName:O})}else l(!0),w({hasUrdf:!0,modelName:"Multiple models available"})}else w({hasUrdf:!1}),x(),Ur.error("No Urdf file found",{description:"Please upload a folder containing a .urdf file.",duration:3e3})}catch(D){console.error("Error processing Urdf files:",D),Ur.error("Error processing files",{description:`Error: ${D instanceof Error?D.message:String(D)}`,duration:3e3}),x()}},[w,r,e,x]),M=_.useRef(r);M.current=r,_.useEffect(()=>()=>{Object.values(M.current).forEach(URL.revokeObjectURL)},[]);const C=_.useMemo(()=>({urdfProcessor:e,registerUrdfProcessor:S,onUrdfDetected:b,processUrdfFiles:A,urdfBlobUrls:r,alternativeUrdfModels:o,isSelectionModalOpen:s,setIsSelectionModalOpen:l,urdfModelOptions:c,selectUrdfModel:T,isDefaultModel:d,setIsDefaultModel:f,resetToDefaultModel:x,urdfContent:p,currentAnimationConfig:v,setCurrentAnimationConfig:g}),[e,S,b,A,r,o,s,c,T,d,x,p,v]);return h.jsx(rU.Provider,{value:C,children:t})},iU=()=>{const t=_.useContext(rU);if(t===void 0)throw new Error("useUrdf must be used within a UrdfProvider");return t},B9=_.createContext(void 0),$9=({children:t})=>{const[e,n]=_.useState(!1),{urdfProcessor:r,processUrdfFiles:i}=iU(),o=u=>{u.preventDefault(),u.stopPropagation()},a=u=>{u.preventDefault(),u.stopPropagation(),n(!0)},s=u=>{u.preventDefault(),u.stopPropagation(),(!u.relatedTarget||!u.relatedTarget.closest("html"))&&n(!1)},l=_.useCallback(async u=>{if(u.preventDefault(),u.stopPropagation(),n(!1),!(!u.dataTransfer||!r))try{const{availableModels:d,files:f}=await j9(u.dataTransfer,r);await i(f,d)}catch(d){console.error("Error in handleDrop:",d)}},[r,i]);_.useEffect(()=>(document.addEventListener("dragover",o),document.addEventListener("dragenter",a),document.addEventListener("dragleave",s),document.addEventListener("drop",l),()=>{document.removeEventListener("dragover",o),document.removeEventListener("dragenter",a),document.removeEventListener("dragleave",s),document.removeEventListener("drop",l)}),[l]);const c=_.useMemo(()=>({isDragging:e,setIsDragging:n,handleDrop:l}),[e,l]);return h.jsxs(B9.Provider,{value:c,children:[t,e&&h.jsx("div",{className:"fixed inset-0 bg-primary/10 pointer-events-none z-50 flex items-center justify-center",children:h.jsxs("div",{className:"bg-background p-8 rounded-lg shadow-lg text-center",children:[h.jsx("div",{className:"text-3xl font-bold mb-4",children:"Drop Urdf Files Here"}),h.jsx("p",{className:"text-muted-foreground",children:"Release to upload your robot model"})]})})]})},z9=1,H9=1e6;let T_=0;function V9(){return T_=(T_+1)%Number.MAX_SAFE_INTEGER,T_.toString()}const M_=new Map,qR=t=>{if(M_.has(t))return;const e=setTimeout(()=>{M_.delete(t),Hh({type:"REMOVE_TOAST",toastId:t})},H9);M_.set(t,e)},G9=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,z9)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(n=>n.id===e.toast.id?{...n,...e.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=e;return n?qR(n):t.toasts.forEach(r=>{qR(r.id)}),{...t,toasts:t.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(n=>n.id!==e.toastId)}}},Ov=[];let Iv={toasts:[]};function Hh(t){Iv=G9(Iv,t),Ov.forEach(e=>{e(Iv)})}function W9({...t}){const e=V9(),n=i=>Hh({type:"UPDATE_TOAST",toast:{...i,id:e}}),r=()=>Hh({type:"DISMISS_TOAST",toastId:e});return Hh({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:i=>{i||r()}}}),{id:e,dismiss:r,update:n}}function Dr(){const[t,e]=_.useState(Iv);return _.useEffect(()=>(Ov.push(e),()=>{const n=Ov.indexOf(e);n>-1&&Ov.splice(n,1)}),[t]),{...t,toast:W9,dismiss:n=>Hh({type:"DISMISS_TOAST",toastId:n})}}function Oe(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t==null||t(i),n===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function KR(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function ts(...t){return e=>{let n=!1;const r=t.map(i=>{const o=KR(i,e);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i{const{children:a,...s}=o,l=_.useMemo(()=>s,Object.values(s));return h.jsx(n.Provider,{value:l,children:a})};r.displayName=t+"Provider";function i(o){const a=_.useContext(n);if(a)return a;if(e!==void 0)return e;throw new Error(`\`${o}\` must be used within \`${t}\``)}return[r,i]}function mi(t,e=[]){let n=[];function r(o,a){const s=_.createContext(a),l=n.length;n=[...n,a];const c=d=>{var m;const{scope:f,children:p,...y}=d,v=((m=f==null?void 0:f[t])==null?void 0:m[l])||s,g=_.useMemo(()=>y,Object.values(y));return h.jsx(v.Provider,{value:g,children:p})};c.displayName=o+"Provider";function u(d,f){var v;const p=((v=f==null?void 0:f[t])==null?void 0:v[l])||s,y=_.useContext(p);if(y)return y;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${o}\``)}return[c,u]}const i=()=>{const o=n.map(a=>_.createContext(a));return function(s){const l=(s==null?void 0:s[t])||o;return _.useMemo(()=>({[`__scope${t}`]:{...s,[t]:l}}),[s,l])}};return i.scopeName=t,[r,q9(i,...e)]}function q9(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((s,{useScope:l,scopeName:c})=>{const d=l(o)[`__scope${c}`];return{...s,...d}},{});return _.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}function al(t){const e=Y9(t),n=_.forwardRef((r,i)=>{const{children:o,...a}=r,s=_.Children.toArray(o),l=s.find(J9);if(l){const c=l.props.children,u=s.map(d=>d===l?_.Children.count(c)>1?_.Children.only(null):_.isValidElement(c)?c.props.children:null:d);return h.jsx(e,{...a,ref:i,children:_.isValidElement(c)?_.cloneElement(c,void 0,u):null})}return h.jsx(e,{...a,ref:i,children:o})});return n.displayName=`${t}.Slot`,n}var K9=al("Slot");function Y9(t){const e=_.forwardRef((n,r)=>{const{children:i,...o}=n;if(_.isValidElement(i)){const a=Q9(i),s=Z9(o,i.props);return i.type!==_.Fragment&&(s.ref=r?ts(r,a):a),_.cloneElement(i,s)}return _.Children.count(i)>1?_.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var oU=Symbol("radix.slottable");function aU(t){const e=({children:n})=>h.jsx(h.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=oU,e}function J9(t){return _.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===oU}function Z9(t,e){const n={...e};for(const r in e){const i=t[r],o=e[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{const l=o(...s);return i(...s),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...t,...n}}function Q9(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function tx(t){const e=t+"CollectionProvider",[n,r]=mi(e),[i,o]=n(e,{collectionRef:{current:null},itemMap:new Map}),a=v=>{const{scope:g,children:m}=v,x=Z.useRef(null),b=Z.useRef(new Map).current;return h.jsx(i,{scope:g,itemMap:b,collectionRef:x,children:m})};a.displayName=e;const s=t+"CollectionSlot",l=al(s),c=Z.forwardRef((v,g)=>{const{scope:m,children:x}=v,b=o(s,m),S=Ot(g,b.collectionRef);return h.jsx(l,{ref:S,children:x})});c.displayName=s;const u=t+"CollectionItemSlot",d="data-radix-collection-item",f=al(u),p=Z.forwardRef((v,g)=>{const{scope:m,children:x,...b}=v,S=Z.useRef(null),w=Ot(g,S),E=o(u,m);return Z.useEffect(()=>(E.itemMap.set(S,{ref:S,...b}),()=>void E.itemMap.delete(S))),h.jsx(f,{[d]:"",ref:w,children:x})});p.displayName=u;function y(v){const g=o(t+"CollectionConsumer",v);return Z.useCallback(()=>{const x=g.collectionRef.current;if(!x)return[];const b=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(g.itemMap.values()).sort((E,T)=>b.indexOf(E.ref.current)-b.indexOf(T.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:a,Slot:c,ItemSlot:p},y,r]}var e7=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],nt=e7.reduce((t,e)=>{const n=al(`Primitive.${e}`),r=_.forwardRef((i,o)=>{const{asChild:a,...s}=i,l=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(l,{...s,ref:o})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function XM(t,e){t&&Bc.flushSync(()=>t.dispatchEvent(e))}function di(t){const e=_.useRef(t);return _.useEffect(()=>{e.current=t}),_.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function t7(t,e=globalThis==null?void 0:globalThis.document){const n=di(t);_.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var n7="DismissableLayer",aE="dismissableLayer.update",r7="dismissableLayer.pointerDownOutside",i7="dismissableLayer.focusOutside",YR,sU=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),zc=_.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:a,onDismiss:s,...l}=t,c=_.useContext(sU),[u,d]=_.useState(null),f=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=_.useState({}),y=Ot(e,T=>d(T)),v=Array.from(c.layers),[g]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),m=v.indexOf(g),x=u?v.indexOf(u):-1,b=c.layersWithOutsidePointerEventsDisabled.size>0,S=x>=m,w=a7(T=>{const A=T.target,M=[...c.branches].some(C=>C.contains(A));!S||M||(i==null||i(T),a==null||a(T),T.defaultPrevented||s==null||s())},f),E=s7(T=>{const A=T.target;[...c.branches].some(C=>C.contains(A))||(o==null||o(T),a==null||a(T),T.defaultPrevented||s==null||s())},f);return t7(T=>{x===c.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&s&&(T.preventDefault(),s()))},f),_.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(YR=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),JR(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=YR)}},[u,f,n,c]),_.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),JR())},[u,c]),_.useEffect(()=>{const T=()=>p({});return document.addEventListener(aE,T),()=>document.removeEventListener(aE,T)},[]),h.jsx(nt.div,{...l,ref:y,style:{pointerEvents:b?S?"auto":"none":void 0,...t.style},onFocusCapture:Oe(t.onFocusCapture,E.onFocusCapture),onBlurCapture:Oe(t.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Oe(t.onPointerDownCapture,w.onPointerDownCapture)})});zc.displayName=n7;var o7="DismissableLayerBranch",lU=_.forwardRef((t,e)=>{const n=_.useContext(sU),r=_.useRef(null),i=Ot(e,r);return _.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),h.jsx(nt.div,{...t,ref:i})});lU.displayName=o7;function a7(t,e=globalThis==null?void 0:globalThis.document){const n=di(t),r=_.useRef(!1),i=_.useRef(()=>{});return _.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let l=function(){cU(r7,n,c,{discrete:!0})};const c={originalEvent:s};s.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=l,e.addEventListener("click",i.current,{once:!0})):l()}else e.removeEventListener("click",i.current);r.current=!1},a=window.setTimeout(()=>{e.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),e.removeEventListener("pointerdown",o),e.removeEventListener("click",i.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function s7(t,e=globalThis==null?void 0:globalThis.document){const n=di(t),r=_.useRef(!1);return _.useEffect(()=>{const i=o=>{o.target&&!r.current&&cU(i7,n,{originalEvent:o},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function JR(){const t=new CustomEvent(aE);document.dispatchEvent(t)}function cU(t,e,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?XM(i,o):i.dispatchEvent(o)}var l7=zc,c7=lU,ur=globalThis!=null&&globalThis.document?_.useLayoutEffect:()=>{},u7="Portal",vf=_.forwardRef((t,e)=>{var s;const{container:n,...r}=t,[i,o]=_.useState(!1);ur(()=>o(!0),[]);const a=n||i&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return a?j3.createPortal(h.jsx(nt.div,{...r,ref:e}),a):null});vf.displayName=u7;function d7(t,e){return _.useReducer((n,r)=>e[n][r]??n,t)}var gi=t=>{const{present:e,children:n}=t,r=f7(e),i=typeof n=="function"?n({present:r.isPresent}):_.Children.only(n),o=Ot(r.ref,h7(i));return typeof n=="function"||r.isPresent?_.cloneElement(i,{ref:o}):null};gi.displayName="Presence";function f7(t){const[e,n]=_.useState(),r=_.useRef(null),i=_.useRef(t),o=_.useRef("none"),a=t?"mounted":"unmounted",[s,l]=d7(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const c=yg(r.current);o.current=s==="mounted"?c:"none"},[s]),ur(()=>{const c=r.current,u=i.current;if(u!==t){const f=o.current,p=yg(c);t?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&f!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,l]),ur(()=>{if(e){let c;const u=e.ownerDocument.defaultView??window,d=p=>{const v=yg(r.current).includes(p.animationName);if(p.target===e&&v&&(l("ANIMATION_END"),!i.current)){const g=e.style.animationFillMode;e.style.animationFillMode="forwards",c=u.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=g)})}},f=p=>{p.target===e&&(o.current=yg(r.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",d),e.addEventListener("animationend",d),()=>{u.clearTimeout(c),e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",d),e.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:_.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function yg(t){return(t==null?void 0:t.animationName)||"none"}function h7(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var p7=QT[" useInsertionEffect ".trim().toString()]||ur;function $o({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[i,o,a]=m7({defaultProp:e,onChange:n}),s=t!==void 0,l=s?t:i;{const u=_.useRef(t!==void 0);_.useEffect(()=>{const d=u.current;d!==s&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=s},[s,r])}const c=_.useCallback(u=>{var d;if(s){const f=g7(u)?u(t):u;f!==t&&((d=a.current)==null||d.call(a,f))}else o(u)},[s,t,o,a]);return[l,c]}function m7({defaultProp:t,onChange:e}){const[n,r]=_.useState(t),i=_.useRef(n),o=_.useRef(e);return p7(()=>{o.current=e},[e]),_.useEffect(()=>{var a;i.current!==n&&((a=o.current)==null||a.call(o,n),i.current=n)},[n,i]),[n,r,o]}function g7(t){return typeof t=="function"}var uU=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),v7="VisuallyHidden",nx=_.forwardRef((t,e)=>h.jsx(nt.span,{...t,ref:e,style:{...uU,...t.style}}));nx.displayName=v7;var y7=nx,qM="ToastProvider",[KM,x7,b7]=tx("Toast"),[dU,hDe]=mi("Toast",[b7]),[_7,rx]=dU(qM),fU=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:i="right",swipeThreshold:o=50,children:a}=t,[s,l]=_.useState(null),[c,u]=_.useState(0),d=_.useRef(!1),f=_.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${qM}\`. Expected non-empty \`string\`.`),h.jsx(KM.Provider,{scope:e,children:h.jsx(_7,{scope:e,label:n,duration:r,swipeDirection:i,swipeThreshold:o,toastCount:c,viewport:s,onViewportChange:l,onToastAdd:_.useCallback(()=>u(p=>p+1),[]),onToastRemove:_.useCallback(()=>u(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:a})})};fU.displayName=qM;var hU="ToastViewport",w7=["F8"],sE="toast.viewportPause",lE="toast.viewportResume",pU=_.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=w7,label:i="Notifications ({hotkey})",...o}=t,a=rx(hU,n),s=x7(n),l=_.useRef(null),c=_.useRef(null),u=_.useRef(null),d=_.useRef(null),f=Ot(e,d,a.onViewportChange),p=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),y=a.toastCount>0;_.useEffect(()=>{const g=m=>{var b;r.length!==0&&r.every(S=>m[S]||m.code===S)&&((b=d.current)==null||b.focus())};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[r]),_.useEffect(()=>{const g=l.current,m=d.current;if(y&&g&&m){const x=()=>{if(!a.isClosePausedRef.current){const E=new CustomEvent(sE);m.dispatchEvent(E),a.isClosePausedRef.current=!0}},b=()=>{if(a.isClosePausedRef.current){const E=new CustomEvent(lE);m.dispatchEvent(E),a.isClosePausedRef.current=!1}},S=E=>{!g.contains(E.relatedTarget)&&b()},w=()=>{g.contains(document.activeElement)||b()};return g.addEventListener("focusin",x),g.addEventListener("focusout",S),g.addEventListener("pointermove",x),g.addEventListener("pointerleave",w),window.addEventListener("blur",x),window.addEventListener("focus",b),()=>{g.removeEventListener("focusin",x),g.removeEventListener("focusout",S),g.removeEventListener("pointermove",x),g.removeEventListener("pointerleave",w),window.removeEventListener("blur",x),window.removeEventListener("focus",b)}}},[y,a.isClosePausedRef]);const v=_.useCallback(({tabbingDirection:g})=>{const x=s().map(b=>{const S=b.ref.current,w=[S,...L7(S)];return g==="forwards"?w:w.reverse()});return(g==="forwards"?x.reverse():x).flat()},[s]);return _.useEffect(()=>{const g=d.current;if(g){const m=x=>{var w,E,T;const b=x.altKey||x.ctrlKey||x.metaKey;if(x.key==="Tab"&&!b){const A=document.activeElement,M=x.shiftKey;if(x.target===g&&M){(w=c.current)==null||w.focus();return}const R=v({tabbingDirection:M?"backwards":"forwards"}),D=R.findIndex(k=>k===A);A_(R.slice(D+1))?x.preventDefault():M?(E=c.current)==null||E.focus():(T=u.current)==null||T.focus()}};return g.addEventListener("keydown",m),()=>g.removeEventListener("keydown",m)}},[s,v]),h.jsxs(c7,{ref:l,role:"region","aria-label":i.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:y?void 0:"none"},children:[y&&h.jsx(cE,{ref:c,onFocusFromOutsideViewport:()=>{const g=v({tabbingDirection:"forwards"});A_(g)}}),h.jsx(KM.Slot,{scope:n,children:h.jsx(nt.ol,{tabIndex:-1,...o,ref:f})}),y&&h.jsx(cE,{ref:u,onFocusFromOutsideViewport:()=>{const g=v({tabbingDirection:"backwards"});A_(g)}})]})});pU.displayName=hU;var mU="ToastFocusProxy",cE=_.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=t,o=rx(mU,n);return h.jsx(nx,{"aria-hidden":!0,tabIndex:0,...i,ref:e,style:{position:"fixed"},onFocus:a=>{var c;const s=a.relatedTarget;!((c=o.viewport)!=null&&c.contains(s))&&r()}})});cE.displayName=mU;var wm="Toast",S7="toast.swipeStart",E7="toast.swipeMove",T7="toast.swipeCancel",M7="toast.swipeEnd",gU=_.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:i,onOpenChange:o,...a}=t,[s,l]=$o({prop:r,defaultProp:i??!0,onChange:o,caller:wm});return h.jsx(gi,{present:n||s,children:h.jsx(P7,{open:s,...a,ref:e,onClose:()=>l(!1),onPause:di(t.onPause),onResume:di(t.onResume),onSwipeStart:Oe(t.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Oe(t.onSwipeMove,c=>{const{x:u,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${d}px`)}),onSwipeCancel:Oe(t.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Oe(t.onSwipeEnd,c=>{const{x:u,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${d}px`),l(!1)})})})});gU.displayName=wm;var[A7,C7]=dU(wm,{onClose(){}}),P7=_.forwardRef((t,e)=>{const{__scopeToast:n,type:r="foreground",duration:i,open:o,onClose:a,onEscapeKeyDown:s,onPause:l,onResume:c,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:p,...y}=t,v=rx(wm,n),[g,m]=_.useState(null),x=Ot(e,k=>m(k)),b=_.useRef(null),S=_.useRef(null),w=i||v.duration,E=_.useRef(0),T=_.useRef(w),A=_.useRef(0),{onToastAdd:M,onToastRemove:C}=v,P=di(()=>{var U;(g==null?void 0:g.contains(document.activeElement))&&((U=v.viewport)==null||U.focus()),a()}),R=_.useCallback(k=>{!k||k===1/0||(window.clearTimeout(A.current),E.current=new Date().getTime(),A.current=window.setTimeout(P,k))},[P]);_.useEffect(()=>{const k=v.viewport;if(k){const U=()=>{R(T.current),c==null||c()},O=()=>{const W=new Date().getTime()-E.current;T.current=T.current-W,window.clearTimeout(A.current),l==null||l()};return k.addEventListener(sE,O),k.addEventListener(lE,U),()=>{k.removeEventListener(sE,O),k.removeEventListener(lE,U)}}},[v.viewport,w,l,c,R]),_.useEffect(()=>{o&&!v.isClosePausedRef.current&&R(w)},[o,w,v.isClosePausedRef,R]),_.useEffect(()=>(M(),()=>C()),[M,C]);const D=_.useMemo(()=>g?SU(g):null,[g]);return v.viewport?h.jsxs(h.Fragment,{children:[D&&h.jsx(R7,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:D}),h.jsx(A7,{scope:n,onClose:P,children:Bc.createPortal(h.jsx(KM.ItemSlot,{scope:n,children:h.jsx(l7,{asChild:!0,onEscapeKeyDown:Oe(s,()=>{v.isFocusedToastEscapeKeyDownRef.current||P(),v.isFocusedToastEscapeKeyDownRef.current=!1}),children:h.jsx(nt.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":v.swipeDirection,...y,ref:x,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:Oe(t.onKeyDown,k=>{k.key==="Escape"&&(s==null||s(k.nativeEvent),k.nativeEvent.defaultPrevented||(v.isFocusedToastEscapeKeyDownRef.current=!0,P()))}),onPointerDown:Oe(t.onPointerDown,k=>{k.button===0&&(b.current={x:k.clientX,y:k.clientY})}),onPointerMove:Oe(t.onPointerMove,k=>{if(!b.current)return;const U=k.clientX-b.current.x,O=k.clientY-b.current.y,W=!!S.current,L=["left","right"].includes(v.swipeDirection),j=["left","up"].includes(v.swipeDirection)?Math.min:Math.max,X=L?j(0,U):0,K=L?0:j(0,O),F=k.pointerType==="touch"?10:2,Y={x:X,y:K},q={originalEvent:k,delta:Y};W?(S.current=Y,xg(E7,d,q,{discrete:!1})):ZR(Y,v.swipeDirection,F)?(S.current=Y,xg(S7,u,q,{discrete:!1}),k.target.setPointerCapture(k.pointerId)):(Math.abs(U)>F||Math.abs(O)>F)&&(b.current=null)}),onPointerUp:Oe(t.onPointerUp,k=>{const U=S.current,O=k.target;if(O.hasPointerCapture(k.pointerId)&&O.releasePointerCapture(k.pointerId),S.current=null,b.current=null,U){const W=k.currentTarget,L={originalEvent:k,delta:U};ZR(U,v.swipeDirection,v.swipeThreshold)?xg(M7,p,L,{discrete:!0}):xg(T7,f,L,{discrete:!0}),W.addEventListener("click",j=>j.preventDefault(),{once:!0})}})})})}),v.viewport)})]}):null}),R7=t=>{const{__scopeToast:e,children:n,...r}=t,i=rx(wm,e),[o,a]=_.useState(!1),[s,l]=_.useState(!1);return I7(()=>a(!0)),_.useEffect(()=>{const c=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(c)},[]),s?null:h.jsx(vf,{asChild:!0,children:h.jsx(nx,{...r,children:o&&h.jsxs(h.Fragment,{children:[i.label," ",n]})})})},N7="ToastTitle",vU=_.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return h.jsx(nt.div,{...r,ref:e})});vU.displayName=N7;var O7="ToastDescription",yU=_.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return h.jsx(nt.div,{...r,ref:e})});yU.displayName=O7;var xU="ToastAction",bU=_.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?h.jsx(wU,{altText:n,asChild:!0,children:h.jsx(YM,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${xU}\`. Expected non-empty \`string\`.`),null)});bU.displayName=xU;var _U="ToastClose",YM=_.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,i=C7(_U,n);return h.jsx(wU,{asChild:!0,children:h.jsx(nt.button,{type:"button",...r,ref:e,onClick:Oe(t.onClick,i.onClose)})})});YM.displayName=_U;var wU=_.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...i}=t;return h.jsx(nt.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...i,ref:e})});function SU(t){const e=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),D7(r)){const i=r.ariaHidden||r.hidden||r.style.display==="none",o=r.dataset.radixToastAnnounceExclude==="";if(!i)if(o){const a=r.dataset.radixToastAnnounceAlt;a&&e.push(a)}else e.push(...SU(r))}}),e}function xg(t,e,n,{discrete:r}){const i=n.originalEvent.currentTarget,o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?XM(i,o):i.dispatchEvent(o)}var ZR=(t,e,n=0)=>{const r=Math.abs(t.x),i=Math.abs(t.y),o=r>i;return e==="left"||e==="right"?o&&r>n:!o&&i>n};function I7(t=()=>{}){const e=di(t);ur(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}function D7(t){return t.nodeType===t.ELEMENT_NODE}function L7(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function A_(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var k7=fU,EU=pU,TU=gU,MU=vU,AU=yU,CU=bU,PU=YM;function RU(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;etypeof t=="boolean"?`${t}`:t===0?"0":t,eN=zt,Sm=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return eN(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=e,a=Object.keys(i).map(c=>{const u=n==null?void 0:n[c],d=o==null?void 0:o[c];if(u===null)return null;const f=QR(u)||QR(d);return i[c][f]}),s=n&&Object.entries(n).reduce((c,u)=>{let[d,f]=u;return f===void 0||(c[d]=f),c},{}),l=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:f,...p}=u;return Object.entries(p).every(y=>{let[v,g]=y;return Array.isArray(g)?g.includes({...o,...s}[v]):{...o,...s}[v]===g})?[...c,d,f]:c},[]);return eN(t,a,l,n==null?void 0:n.class,n==null?void 0:n.className)};/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const j7=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),NU=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */var U7={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const F7=_.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:a,...s},l)=>_.createElement("svg",{ref:l,...U7,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:NU("lucide",i),...s},[...a.map(([c,u])=>_.createElement(c,u)),...Array.isArray(o)?o:[o]]));/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Tt=(t,e)=>{const n=_.forwardRef(({className:r,...i},o)=>_.createElement(F7,{ref:o,iconNode:e,className:NU(`lucide-${j7(t)}`,r),...i}));return n.displayName=`${t}`,n};/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const $u=Tt("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const sl=Tt("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const B7=Tt("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const $7=Tt("Camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const yl=Tt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const hc=Tt("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const xp=Tt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const z7=Tt("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const JM=Tt("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const td=Tt("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const qi=Tt("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ZM=Tt("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const H7=Tt("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const nd=Tt("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const uE=Tt("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const dE=Tt("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const QM=Tt("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const V7=Tt("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const G7=Tt("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ll=Tt("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const W7=Tt("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const X7=Tt("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const q7=Tt("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const K7=Tt("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Y7=Tt("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const fi=Tt("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const J7=Tt("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Z7=Tt("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Tc=Tt("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const eA=Tt("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const OU=Tt("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Q7=Tt("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const tA=Tt("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Mh=Tt("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const eX=Tt("SkipForward",[["polygon",{points:"5 4 15 12 5 20 5 4",key:"16p6eg"}],["line",{x1:"19",x2:"19",y1:"5",y2:"19",key:"futhcm"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Od=Tt("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const tX=Tt("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const nA=Tt("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ia=Tt("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const IU=Tt("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const DU=Tt("VideoOff",[["path",{d:"M10.66 6H14a2 2 0 0 1 2 2v2.5l5.248-3.062A.5.5 0 0 1 22 7.87v8.196",key:"w8jjjt"}],["path",{d:"M16 16a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h2",key:"1xawa7"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const nX=Tt("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const rX=Tt("VolumeX",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ix=Tt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),rA="-",iX=t=>{const e=aX(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:a=>{const s=a.split(rA);return s[0]===""&&s.length!==1&&s.shift(),LU(s,e)||oX(a)},getConflictingClassGroupIds:(a,s)=>{const l=n[a]||[];return s&&r[a]?[...l,...r[a]]:l}}},LU=(t,e)=>{var a;if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),i=r?LU(t.slice(1),r):void 0;if(i)return i;if(e.validators.length===0)return;const o=t.join(rA);return(a=e.validators.find(({validator:s})=>s(o)))==null?void 0:a.classGroupId},tN=/^\[(.+)\]$/,oX=t=>{if(tN.test(t)){const e=tN.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},aX=t=>{const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return lX(Object.entries(t.classGroups),n).forEach(([o,a])=>{fE(a,r,o,e)}),r},fE=(t,e,n,r)=>{t.forEach(i=>{if(typeof i=="string"){const o=i===""?e:nN(e,i);o.classGroupId=n;return}if(typeof i=="function"){if(sX(i)){fE(i(r),e,n,r);return}e.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,a])=>{fE(a,nN(e,o),n,r)})})},nN=(t,e)=>{let n=t;return e.split(rA).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},sX=t=>t.isThemeGetter,lX=(t,e)=>e?t.map(([n,r])=>{const i=r.map(o=>typeof o=="string"?e+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([a,s])=>[e+a,s])):o);return[n,i]}):t,cX=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const i=(o,a)=>{n.set(o,a),e++,e>t&&(e=0,r=n,n=new Map)};return{get(o){let a=n.get(o);if(a!==void 0)return a;if((a=r.get(o))!==void 0)return i(o,a),a},set(o,a){n.has(o)?n.set(o,a):i(o,a)}}},kU="!",uX=t=>{const{separator:e,experimentalParseClassName:n}=t,r=e.length===1,i=e[0],o=e.length,a=s=>{const l=[];let c=0,u=0,d;for(let g=0;gu?d-u:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:y,maybePostfixModifierPosition:v}};return n?s=>n({className:s,parseClassName:a}):a},dX=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e},fX=t=>({cache:cX(t.cacheSize),parseClassName:uX(t),...iX(t)}),hX=/\s+/,pX=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=e,o=[],a=t.trim().split(hX);let s="";for(let l=a.length-1;l>=0;l-=1){const c=a[l],{modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(c);let y=!!p,v=r(y?f.substring(0,p):f);if(!v){if(!y){s=c+(s.length>0?" "+s:s);continue}if(v=r(f),!v){s=c+(s.length>0?" "+s:s);continue}y=!1}const g=dX(u).join(":"),m=d?g+kU:g,x=m+v;if(o.includes(x))continue;o.push(x);const b=i(v,y);for(let S=0;S0?" "+s:s)}return s};function mX(){let t=0,e,n,r="";for(;t{if(typeof t=="string")return t;let e,n="";for(let r=0;rd(u),t());return n=fX(c),r=n.cache.get,i=n.cache.set,o=s,s(l)}function s(l){const c=r(l);if(c)return c;const u=pX(l,n);return i(l,u),u}return function(){return o(mX.apply(null,arguments))}}const yn=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},UU=/^\[(?:([a-z-]+):)?(.+)\]$/i,vX=/^\d+\/\d+$/,yX=new Set(["px","full","screen"]),xX=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,bX=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,_X=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,wX=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,SX=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ta=t=>rd(t)||yX.has(t)||vX.test(t),ps=t=>yf(t,"length",NX),rd=t=>!!t&&!Number.isNaN(Number(t)),C_=t=>yf(t,"number",rd),Zf=t=>!!t&&Number.isInteger(Number(t)),EX=t=>t.endsWith("%")&&rd(t.slice(0,-1)),Ct=t=>UU.test(t),ms=t=>xX.test(t),TX=new Set(["length","size","percentage"]),MX=t=>yf(t,TX,FU),AX=t=>yf(t,"position",FU),CX=new Set(["image","url"]),PX=t=>yf(t,CX,IX),RX=t=>yf(t,"",OX),Qf=()=>!0,yf=(t,e,n)=>{const r=UU.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1},NX=t=>bX.test(t)&&!_X.test(t),FU=()=>!1,OX=t=>wX.test(t),IX=t=>SX.test(t),DX=()=>{const t=yn("colors"),e=yn("spacing"),n=yn("blur"),r=yn("brightness"),i=yn("borderColor"),o=yn("borderRadius"),a=yn("borderSpacing"),s=yn("borderWidth"),l=yn("contrast"),c=yn("grayscale"),u=yn("hueRotate"),d=yn("invert"),f=yn("gap"),p=yn("gradientColorStops"),y=yn("gradientColorStopPositions"),v=yn("inset"),g=yn("margin"),m=yn("opacity"),x=yn("padding"),b=yn("saturate"),S=yn("scale"),w=yn("sepia"),E=yn("skew"),T=yn("space"),A=yn("translate"),M=()=>["auto","contain","none"],C=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto",Ct,e],R=()=>[Ct,e],D=()=>["",Ta,ps],k=()=>["auto",rd,Ct],U=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],O=()=>["solid","dashed","dotted","double","none"],W=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],L=()=>["start","end","center","between","around","evenly","stretch"],j=()=>["","0",Ct],X=()=>["auto","avoid","all","avoid-page","page","left","right","column"],K=()=>[rd,Ct];return{cacheSize:500,separator:":",theme:{colors:[Qf],spacing:[Ta,ps],blur:["none","",ms,Ct],brightness:K(),borderColor:[t],borderRadius:["none","","full",ms,Ct],borderSpacing:R(),borderWidth:D(),contrast:K(),grayscale:j(),hueRotate:K(),invert:j(),gap:R(),gradientColorStops:[t],gradientColorStopPositions:[EX,ps],inset:P(),margin:P(),opacity:K(),padding:R(),saturate:K(),scale:K(),sepia:j(),skew:K(),space:R(),translate:R()},classGroups:{aspect:[{aspect:["auto","square","video",Ct]}],container:["container"],columns:[{columns:[ms]}],"break-after":[{"break-after":X()}],"break-before":[{"break-before":X()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...U(),Ct]}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Zf,Ct]}],basis:[{basis:P()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ct]}],grow:[{grow:j()}],shrink:[{shrink:j()}],order:[{order:["first","last","none",Zf,Ct]}],"grid-cols":[{"grid-cols":[Qf]}],"col-start-end":[{col:["auto",{span:["full",Zf,Ct]},Ct]}],"col-start":[{"col-start":k()}],"col-end":[{"col-end":k()}],"grid-rows":[{"grid-rows":[Qf]}],"row-start-end":[{row:["auto",{span:[Zf,Ct]},Ct]}],"row-start":[{"row-start":k()}],"row-end":[{"row-end":k()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ct]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ct]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...L()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...L(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...L(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ct,e]}],"min-w":[{"min-w":[Ct,e,"min","max","fit"]}],"max-w":[{"max-w":[Ct,e,"none","full","min","max","fit","prose",{screen:[ms]},ms]}],h:[{h:[Ct,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ct,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ct,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ct,e,"auto","min","max","fit"]}],"font-size":[{text:["base",ms,ps]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",C_]}],"font-family":[{font:[Qf]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Ct]}],"line-clamp":[{"line-clamp":["none",rd,C_]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ta,Ct]}],"list-image":[{"list-image":["none",Ct]}],"list-style-type":[{list:["none","disc","decimal",Ct]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[m]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[m]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...O(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ta,ps]}],"underline-offset":[{"underline-offset":["auto",Ta,Ct]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ct]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ct]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[m]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...U(),AX]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",MX]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},PX]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[m]}],"border-style":[{border:[...O(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[m]}],"divide-style":[{divide:O()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...O()]}],"outline-offset":[{"outline-offset":[Ta,Ct]}],"outline-w":[{outline:[Ta,ps]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:D()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[m]}],"ring-offset-w":[{"ring-offset":[Ta,ps]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",ms,RX]}],"shadow-color":[{shadow:[Qf]}],opacity:[{opacity:[m]}],"mix-blend":[{"mix-blend":[...W(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":W()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",ms,Ct]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[b]}],sepia:[{sepia:[w]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[m]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[w]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ct]}],duration:[{duration:K()}],ease:[{ease:["linear","in","out","in-out",Ct]}],delay:[{delay:K()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ct]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[Zf,Ct]}],"translate-x":[{"translate-x":[A]}],"translate-y":[{"translate-y":[A]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ct]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ct]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ct]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[Ta,ps,C_]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},LX=gX(DX);function He(...t){return LX(zt(t))}const kX=k7,BU=_.forwardRef(({className:t,...e},n)=>h.jsx(EU,{ref:n,className:He("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",t),...e}));BU.displayName=EU.displayName;const jX=Sm("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),$U=_.forwardRef(({className:t,variant:e,...n},r)=>h.jsx(TU,{ref:r,className:He(jX({variant:e}),t),...n}));$U.displayName=TU.displayName;const UX=_.forwardRef(({className:t,...e},n)=>h.jsx(CU,{ref:n,className:He("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",t),...e}));UX.displayName=CU.displayName;const zU=_.forwardRef(({className:t,...e},n)=>h.jsx(PU,{ref:n,className:He("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",t),"toast-close":"",...e,children:h.jsx(ix,{className:"h-4 w-4"})}));zU.displayName=PU.displayName;const HU=_.forwardRef(({className:t,...e},n)=>h.jsx(MU,{ref:n,className:He("text-sm font-semibold",t),...e}));HU.displayName=MU.displayName;const VU=_.forwardRef(({className:t,...e},n)=>h.jsx(AU,{ref:n,className:He("text-sm opacity-90",t),...e}));VU.displayName=AU.displayName;function FX(){const{toasts:t}=Dr();return h.jsxs(kX,{children:[t.map(function({id:e,title:n,description:r,action:i,...o}){return h.jsxs($U,{...o,children:[h.jsxs("div",{className:"grid gap-1",children:[n&&h.jsx(HU,{children:n}),r&&h.jsx(VU,{children:r})]}),i,h.jsx(zU,{})]},e)}),h.jsx(BU,{})]})}const iA=Sm("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),et=_.forwardRef(({className:t,variant:e,size:n,asChild:r=!1,...i},o)=>{const a=r?K9:"button";return h.jsx(a,{className:He(iA({variant:e,size:n,className:t})),ref:o,...i})});et.displayName="Button";const GU=_.createContext(void 0),P_="lelab.apiBaseUrl",R_="http://127.0.0.1:8000",BX=t=>t.replace(/^http(s?):/,"ws$1:"),$X=new Set(["http://localhost:8001","http://127.0.0.1:8001","http://localhost:8000","http://127.0.0.1:8000"]),zX=()=>{if(typeof window>"u")return R_;const t=new URLSearchParams(window.location.search).get("api");if(t)try{new URL(t);const n=t.replace(/\/$/,"");return window.localStorage.setItem(P_,n),n}catch{console.warn("Invalid `api` query param, ignoring:",t)}const e=window.localStorage.getItem(P_);return e&&!$X.has(e)?e:(e&&window.localStorage.setItem(P_,R_),R_)},HX=({children:t})=>{const[e]=_.useState(zX),n=BX(e),r=_.useCallback(async(o,a={})=>fetch(o,{...a,headers:{"Content-Type":"application/json",...a.headers}}),[]),i=_.useMemo(()=>({baseUrl:e,wsBaseUrl:n,fetchWithHeaders:r}),[e,n,r]);return h.jsx(GU.Provider,{value:i,children:t})},Ln=()=>{const t=_.useContext(GU);if(t===void 0)throw new Error("useApi must be used within an ApiProvider");return t},WU=_.createContext(void 0),VX=({children:t})=>{const{baseUrl:e,fetchWithHeaders:n}=Ln(),[r,i]=_.useState({status:"loading"}),o=_.useCallback(async()=>{i({status:"loading"});try{const l=await(await n(`${e}/hf-auth-status`)).json();l.authenticated?i({status:"authenticated",username:l.username,orgs:l.orgs??[]}):i({status:"unauthenticated",loginCommand:l.login_command??"hf auth login"})}catch(s){console.warn("HF auth status fetch failed:",s),i({status:"unauthenticated",loginCommand:"hf auth login"})}},[e,n]);_.useEffect(()=>{o()},[o]);const a=_.useMemo(()=>({auth:r,refetch:o}),[r,o]);return h.jsx(WU.Provider,{value:a,children:t})},xf=()=>{const t=_.useContext(WU);if(t===void 0)throw new Error("useHfAuth must be used within an HfAuthProvider");return t};var GX=QT[" useId ".trim().toString()]||(()=>{}),WX=0;function sr(t){const[e,n]=_.useState(GX());return ur(()=>{n(r=>r??String(WX++))},[t]),e?`radix-${e}`:""}var N_="focusScope.autoFocusOnMount",O_="focusScope.autoFocusOnUnmount",rN={bubbles:!1,cancelable:!0},XX="FocusScope",Em=_.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=t,[s,l]=_.useState(null),c=di(i),u=di(o),d=_.useRef(null),f=Ot(e,v=>l(v)),p=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(r){let v=function(b){if(p.paused||!s)return;const S=b.target;s.contains(S)?d.current=S:Ts(d.current,{select:!0})},g=function(b){if(p.paused||!s)return;const S=b.relatedTarget;S!==null&&(s.contains(S)||Ts(d.current,{select:!0}))},m=function(b){if(document.activeElement===document.body)for(const w of b)w.removedNodes.length>0&&Ts(s)};document.addEventListener("focusin",v),document.addEventListener("focusout",g);const x=new MutationObserver(m);return s&&x.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",g),x.disconnect()}}},[r,s,p.paused]),_.useEffect(()=>{if(s){oN.add(p);const v=document.activeElement;if(!s.contains(v)){const m=new CustomEvent(N_,rN);s.addEventListener(N_,c),s.dispatchEvent(m),m.defaultPrevented||(qX(QX(XU(s)),{select:!0}),document.activeElement===v&&Ts(s))}return()=>{s.removeEventListener(N_,c),setTimeout(()=>{const m=new CustomEvent(O_,rN);s.addEventListener(O_,u),s.dispatchEvent(m),m.defaultPrevented||Ts(v??document.body,{select:!0}),s.removeEventListener(O_,u),oN.remove(p)},0)}}},[s,c,u,p]);const y=_.useCallback(v=>{if(!n&&!r||p.paused)return;const g=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,m=document.activeElement;if(g&&m){const x=v.currentTarget,[b,S]=KX(x);b&&S?!v.shiftKey&&m===S?(v.preventDefault(),n&&Ts(b,{select:!0})):v.shiftKey&&m===b&&(v.preventDefault(),n&&Ts(S,{select:!0})):m===x&&v.preventDefault()}},[n,r,p.paused]);return h.jsx(nt.div,{tabIndex:-1,...a,ref:f,onKeyDown:y})});Em.displayName=XX;function qX(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Ts(r,{select:e}),document.activeElement!==n)return}function KX(t){const e=XU(t),n=iN(e,t),r=iN(e.reverse(),t);return[n,r]}function XU(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function iN(t,e){for(const n of t)if(!YX(n,{upTo:e}))return n}function YX(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function JX(t){return t instanceof HTMLInputElement&&"select"in t}function Ts(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&JX(t)&&e&&t.select()}}var oN=ZX();function ZX(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=aN(t,e),t.unshift(e)},remove(e){var n;t=aN(t,e),(n=t[0])==null||n.resume()}}}function aN(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function QX(t){return t.filter(e=>e.tagName!=="A")}var I_=0;function ox(){_.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??sN()),document.body.insertAdjacentElement("beforeend",t[1]??sN()),I_++,()=>{I_===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),I_--}},[])}function sN(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var ra=function(){return ra=Object.assign||function(e){for(var n,r=1,i=arguments.length;r"u")return gq;var e=vq(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},xq=JU(),id="data-scroll-locked",bq=function(t,e,n,r){var i=t.left,o=t.top,a=t.right,s=t.gap;return n===void 0&&(n="margin"),` - .`.concat(tq,` { - overflow: hidden `).concat(r,`; - padding-right: `).concat(s,"px ").concat(r,`; - } - body[`).concat(id,`] { - overflow: hidden `).concat(r,`; - overscroll-behavior: contain; - `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&` - padding-left: `.concat(i,`px; - padding-top: `).concat(o,`px; - padding-right: `).concat(a,`px; - margin-left:0; - margin-top:0; - margin-right: `).concat(s,"px ").concat(r,`; - `),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),` - } - - .`).concat(Dv,` { - right: `).concat(s,"px ").concat(r,`; - } - - .`).concat(Lv,` { - margin-right: `).concat(s,"px ").concat(r,`; - } - - .`).concat(Dv," .").concat(Dv,` { - right: 0 `).concat(r,`; - } - - .`).concat(Lv," .").concat(Lv,` { - margin-right: 0 `).concat(r,`; - } - - body[`).concat(id,`] { - `).concat(nq,": ").concat(s,`px; - } -`)},cN=function(){var t=parseInt(document.body.getAttribute(id)||"0",10);return isFinite(t)?t:0},_q=function(){_.useEffect(function(){return document.body.setAttribute(id,(cN()+1).toString()),function(){var t=cN()-1;t<=0?document.body.removeAttribute(id):document.body.setAttribute(id,t.toString())}},[])},wq=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,i=r===void 0?"margin":r;_q();var o=_.useMemo(function(){return yq(i)},[i]);return _.createElement(xq,{styles:bq(o,!e,i,n?"":"!important")})},hE=!1;if(typeof window<"u")try{var bg=Object.defineProperty({},"passive",{get:function(){return hE=!0,!0}});window.addEventListener("test",bg,bg),window.removeEventListener("test",bg,bg)}catch{hE=!1}var ru=hE?{passive:!1}:!1,Sq=function(t){return t.tagName==="TEXTAREA"},ZU=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!Sq(t)&&n[e]==="visible")},Eq=function(t){return ZU(t,"overflowY")},Tq=function(t){return ZU(t,"overflowX")},uN=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=QU(t,r);if(i){var o=eF(t,r),a=o[1],s=o[2];if(a>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Mq=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},Aq=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},QU=function(t,e){return t==="v"?Eq(e):Tq(e)},eF=function(t,e){return t==="v"?Mq(e):Aq(e)},Cq=function(t,e){return t==="h"&&e==="rtl"?-1:1},Pq=function(t,e,n,r,i){var o=Cq(t,window.getComputedStyle(e).direction),a=o*r,s=n.target,l=e.contains(s),c=!1,u=a>0,d=0,f=0;do{if(!s)break;var p=eF(t,s),y=p[0],v=p[1],g=p[2],m=v-g-o*y;(y||m)&&QU(t,s)&&(d+=m,f+=y);var x=s.parentNode;s=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}while(!l&&s!==document.body||l&&(e.contains(s)||e===s));return(u&&Math.abs(d)<1||!u&&Math.abs(f)<1)&&(c=!0),c},_g=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},dN=function(t){return[t.deltaX,t.deltaY]},fN=function(t){return t&&"current"in t?t.current:t},Rq=function(t,e){return t[0]===e[0]&&t[1]===e[1]},Nq=function(t){return` - .block-interactivity-`.concat(t,` {pointer-events: none;} - .allow-interactivity-`).concat(t,` {pointer-events: all;} -`)},Oq=0,iu=[];function Iq(t){var e=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),i=_.useState(Oq++)[0],o=_.useState(JU)[0],a=_.useRef(t);_.useEffect(function(){a.current=t},[t]),_.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var v=eq([t.lockRef.current],(t.shards||[]).map(fN),!0).filter(Boolean);return v.forEach(function(g){return g.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),v.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var s=_.useCallback(function(v,g){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!a.current.allowPinchZoom;var m=_g(v),x=n.current,b="deltaX"in v?v.deltaX:x[0]-m[0],S="deltaY"in v?v.deltaY:x[1]-m[1],w,E=v.target,T=Math.abs(b)>Math.abs(S)?"h":"v";if("touches"in v&&T==="h"&&E.type==="range")return!1;var A=uN(T,E);if(!A)return!0;if(A?w=T:(w=T==="v"?"h":"v",A=uN(T,E)),!A)return!1;if(!r.current&&"changedTouches"in v&&(b||S)&&(r.current=w),!w)return!0;var M=r.current||w;return Pq(M,g,v,M==="h"?b:S)},[]),l=_.useCallback(function(v){var g=v;if(!(!iu.length||iu[iu.length-1]!==o)){var m="deltaY"in g?dN(g):_g(g),x=e.current.filter(function(w){return w.name===g.type&&(w.target===g.target||g.target===w.shadowParent)&&Rq(w.delta,m)})[0];if(x&&x.should){g.cancelable&&g.preventDefault();return}if(!x){var b=(a.current.shards||[]).map(fN).filter(Boolean).filter(function(w){return w.contains(g.target)}),S=b.length>0?s(g,b[0]):!a.current.noIsolation;S&&g.cancelable&&g.preventDefault()}}},[]),c=_.useCallback(function(v,g,m,x){var b={name:v,delta:g,target:m,should:x,shadowParent:Dq(m)};e.current.push(b),setTimeout(function(){e.current=e.current.filter(function(S){return S!==b})},1)},[]),u=_.useCallback(function(v){n.current=_g(v),r.current=void 0},[]),d=_.useCallback(function(v){c(v.type,dN(v),v.target,s(v,t.lockRef.current))},[]),f=_.useCallback(function(v){c(v.type,_g(v),v.target,s(v,t.lockRef.current))},[]);_.useEffect(function(){return iu.push(o),t.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,ru),document.addEventListener("touchmove",l,ru),document.addEventListener("touchstart",u,ru),function(){iu=iu.filter(function(v){return v!==o}),document.removeEventListener("wheel",l,ru),document.removeEventListener("touchmove",l,ru),document.removeEventListener("touchstart",u,ru)}},[]);var p=t.removeScrollBar,y=t.inert;return _.createElement(_.Fragment,null,y?_.createElement(o,{styles:Nq(i)}):null,p?_.createElement(wq,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function Dq(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const Lq=cq(YU,Iq);var Tm=_.forwardRef(function(t,e){return _.createElement(ax,ra({},t,{ref:e,sideCar:Lq}))});Tm.classNames=ax.classNames;var kq=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},ou=new WeakMap,wg=new WeakMap,Sg={},j_=0,tF=function(t){return t&&(t.host||tF(t.parentNode))},jq=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=tF(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},Uq=function(t,e,n,r){var i=jq(e,Array.isArray(t)?t:[t]);Sg[n]||(Sg[n]=new WeakMap);var o=Sg[n],a=[],s=new Set,l=new Set(i),c=function(d){!d||s.has(d)||(s.add(d),c(d.parentNode))};i.forEach(c);var u=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(f){if(s.has(f))u(f);else try{var p=f.getAttribute(r),y=p!==null&&p!=="false",v=(ou.get(f)||0)+1,g=(o.get(f)||0)+1;ou.set(f,v),o.set(f,g),a.push(f),v===1&&y&&wg.set(f,!0),g===1&&f.setAttribute(n,"true"),y||f.setAttribute(r,"true")}catch(m){console.error("aria-hidden: cannot operate on ",f,m)}})};return u(e),s.clear(),j_++,function(){a.forEach(function(d){var f=ou.get(d)-1,p=o.get(d)-1;ou.set(d,f),o.set(d,p),f||(wg.has(d)||d.removeAttribute(r),wg.delete(d)),p||d.removeAttribute(n)}),j_--,j_||(ou=new WeakMap,ou=new WeakMap,wg=new WeakMap,Sg={})}},sx=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),i=kq(t);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),Uq(r,i,n,"aria-hidden")):function(){return null}},lx="Dialog",[nF,rF]=mi(lx),[Fq,Go]=nF(lx),iF=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:a=!0}=t,s=_.useRef(null),l=_.useRef(null),[c,u]=$o({prop:r,defaultProp:i??!1,onChange:o,caller:lx});return h.jsx(Fq,{scope:e,triggerRef:s,contentRef:l,contentId:sr(),titleId:sr(),descriptionId:sr(),open:c,onOpenChange:u,onOpenToggle:_.useCallback(()=>u(d=>!d),[u]),modal:a,children:n})};iF.displayName=lx;var oF="DialogTrigger",aF=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Go(oF,n),o=Ot(e,i.triggerRef);return h.jsx(nt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":sA(i.open),...r,ref:o,onClick:Oe(t.onClick,i.onOpenToggle)})});aF.displayName=oF;var oA="DialogPortal",[Bq,sF]=nF(oA,{forceMount:void 0}),lF=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:i}=t,o=Go(oA,e);return h.jsx(Bq,{scope:e,forceMount:n,children:_.Children.map(r,a=>h.jsx(gi,{present:n||o.open,children:h.jsx(vf,{asChild:!0,container:i,children:a})}))})};lF.displayName=oA;var yy="DialogOverlay",cF=_.forwardRef((t,e)=>{const n=sF(yy,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,o=Go(yy,t.__scopeDialog);return o.modal?h.jsx(gi,{present:r||o.open,children:h.jsx(zq,{...i,ref:e})}):null});cF.displayName=yy;var $q=al("DialogOverlay.RemoveScroll"),zq=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Go(yy,n);return h.jsx(Tm,{as:$q,allowPinchZoom:!0,shards:[i.contentRef],children:h.jsx(nt.div,{"data-state":sA(i.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),Mc="DialogContent",uF=_.forwardRef((t,e)=>{const n=sF(Mc,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,o=Go(Mc,t.__scopeDialog);return h.jsx(gi,{present:r||o.open,children:o.modal?h.jsx(Hq,{...i,ref:e}):h.jsx(Vq,{...i,ref:e})})});uF.displayName=Mc;var Hq=_.forwardRef((t,e)=>{const n=Go(Mc,t.__scopeDialog),r=_.useRef(null),i=Ot(e,n.contentRef,r);return _.useEffect(()=>{const o=r.current;if(o)return sx(o)},[]),h.jsx(dF,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Oe(t.onCloseAutoFocus,o=>{var a;o.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Oe(t.onPointerDownOutside,o=>{const a=o.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&o.preventDefault()}),onFocusOutside:Oe(t.onFocusOutside,o=>o.preventDefault())})}),Vq=_.forwardRef((t,e)=>{const n=Go(Mc,t.__scopeDialog),r=_.useRef(!1),i=_.useRef(!1);return h.jsx(dF,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var a,s;(a=t.onCloseAutoFocus)==null||a.call(t,o),o.defaultPrevented||(r.current||(s=n.triggerRef.current)==null||s.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var l,c;(l=t.onInteractOutside)==null||l.call(t,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=o.target;((c=n.triggerRef.current)==null?void 0:c.contains(a))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),dF=_.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...a}=t,s=Go(Mc,n),l=_.useRef(null),c=Ot(e,l);return ox(),h.jsxs(h.Fragment,{children:[h.jsx(Em,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:h.jsx(zc,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":sA(s.open),...a,ref:c,onDismiss:()=>s.onOpenChange(!1)})}),h.jsxs(h.Fragment,{children:[h.jsx(Wq,{titleId:s.titleId}),h.jsx(qq,{contentRef:l,descriptionId:s.descriptionId})]})]})}),aA="DialogTitle",fF=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Go(aA,n);return h.jsx(nt.h2,{id:i.titleId,...r,ref:e})});fF.displayName=aA;var hF="DialogDescription",pF=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Go(hF,n);return h.jsx(nt.p,{id:i.descriptionId,...r,ref:e})});pF.displayName=hF;var mF="DialogClose",gF=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Go(mF,n);return h.jsx(nt.button,{type:"button",...r,ref:e,onClick:Oe(t.onClick,()=>i.onOpenChange(!1))})});gF.displayName=mF;function sA(t){return t?"open":"closed"}var vF="DialogTitleWarning",[Gq,yF]=X9(vF,{contentName:Mc,titleName:aA,docsSlug:"dialog"}),Wq=({titleId:t})=>{const e=yF(vF),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users. - -If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component. - -For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return _.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},Xq="DialogDescriptionWarning",qq=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${yF(Xq).contentName}}.`;return _.useEffect(()=>{var o;const i=(o=t.current)==null?void 0:o.getAttribute("aria-describedby");e&&i&&(document.getElementById(e)||console.warn(r))},[r,t,e]),null},lA=iF,Kq=aF,cA=lF,cx=cF,ux=uF,uA=fF,dA=pF,fA=gF;const Hc=lA,Yq=cA,xF=_.forwardRef(({className:t,...e},n)=>h.jsx(cx,{ref:n,className:He("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e}));xF.displayName=cx.displayName;const xl=_.forwardRef(({className:t,children:e,hideClose:n,...r},i)=>h.jsxs(Yq,{children:[h.jsx(xF,{}),h.jsxs(ux,{ref:i,className:He("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...r,children:[e,!n&&h.jsxs(fA,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[h.jsx(ix,{className:"h-4 w-4"}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));xl.displayName=ux.displayName;const bl=({className:t,...e})=>h.jsx("div",{className:He("flex flex-col space-y-1.5 text-center sm:text-left",t),...e});bl.displayName="DialogHeader";const bF=({className:t,...e})=>h.jsx("div",{className:He("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});bF.displayName="DialogFooter";const _l=_.forwardRef(({className:t,...e},n)=>h.jsx(uA,{ref:n,className:He("text-lg font-semibold leading-none tracking-tight",t),...e}));_l.displayName=uA.displayName;const wl=_.forwardRef(({className:t,...e},n)=>h.jsx(dA,{ref:n,className:He("text-sm text-muted-foreground",t),...e}));wl.displayName=dA.displayName;const Jq=({open:t,onOpenChange:e})=>{const{auth:n,refetch:r}=xf(),[i,o]=_.useState(!1),[a,s]=_.useState(!1);if(n.status!=="unauthenticated")return null;const l=async()=>{try{await navigator.clipboard.writeText(n.loginCommand),o(!0),setTimeout(()=>o(!1),1500)}catch(u){console.warn("Clipboard write failed:",u)}},c=async()=>{s(!0);try{await r()}finally{s(!1)}};return h.jsx(Hc,{open:t,onOpenChange:e,children:h.jsxs(xl,{className:"bg-gray-900 border-gray-800 text-white",children:[h.jsxs(bl,{children:[h.jsx(_l,{className:"text-amber-200",children:"Hugging Face CLI not configured"}),h.jsx(wl,{className:"text-gray-400",children:"Uploads, training, and replay-from-Hub require a logged-in HF CLI. Run this in a terminal:"})]}),h.jsxs("pre",{className:"bg-gray-950 p-3 rounded border border-gray-700 text-xs sm:text-sm overflow-x-auto flex items-center justify-between gap-2",children:[h.jsx("code",{className:"text-green-400",children:n.loginCommand}),h.jsx("button",{type:"button",onClick:l,className:"flex-shrink-0 text-gray-400 hover:text-gray-200 transition-colors","aria-label":"Copy command",children:i?h.jsx(yl,{className:"w-4 h-4 text-green-400"}):h.jsx(QM,{className:"w-4 h-4"})})]}),h.jsxs(et,{variant:"outline",size:"sm",onClick:c,disabled:a,className:"border-amber-700 bg-transparent text-amber-100 hover:bg-amber-900/40 hover:text-amber-50",children:[h.jsx(OU,{className:`w-4 h-4 mr-2 ${a?"animate-spin":""}`}),"I've logged in โ€” recheck"]})]})})},Zq=()=>{const{auth:t}=xf(),[e,n]=_.useState(!1);return t.status==="loading"?h.jsxs("div",{className:"inline-flex items-center gap-2 rounded-full border border-gray-800 bg-gray-900/60 px-3 py-1 text-xs text-gray-400",children:[h.jsx(fi,{className:"w-3 h-3 animate-spin"}),h.jsx("span",{children:"Checking HFโ€ฆ"})]}):t.status==="authenticated"?h.jsxs("div",{className:"inline-flex items-center gap-2 rounded-full border border-gray-800 bg-gray-900/60 px-3 py-1 text-xs text-gray-200",title:"Hugging Face authenticated",children:[h.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-400","aria-hidden":"true"}),h.jsx("span",{children:t.username})]}):h.jsxs(h.Fragment,{children:[h.jsxs("button",{type:"button",onClick:()=>n(!0),className:"inline-flex items-center gap-2 rounded-full border border-amber-700/60 bg-amber-950/40 px-3 py-1 text-xs text-amber-100 hover:bg-amber-900/40 transition-colors","aria-label":"Hugging Face not configured โ€” show login instructions",children:[h.jsx("span",{className:"h-2 w-2 rounded-full bg-amber-400","aria-hidden":"true"}),h.jsx("span",{children:"HF not configured"})]}),h.jsx(Jq,{open:e,onOpenChange:n})]})},Qq=()=>h.jsx("header",{className:"sticky top-0 z-30 w-full border-b border-gray-800 bg-black/95 backdrop-blur supports-[backdrop-filter]:bg-black/70",children:h.jsxs("div",{className:"mx-auto flex h-12 max-w-7xl items-center justify-between px-4",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("img",{src:"/lovable-uploads/5e648747-34b7-4d8f-93fd-4dbd00aeeefc.png",alt:"LeLab",className:"h-7 w-7"}),h.jsx("span",{className:"text-base font-semibold tracking-tight text-white",children:"LeLab"})]}),h.jsx(Zq,{})]})}),eK=({className:t})=>h.jsx("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",className:t,children:h.jsx("path",{d:"M20.317 4.369A19.79 19.79 0 0 0 16.558 3.2a.07.07 0 0 0-.074.035c-.211.375-.444.864-.608 1.249a18.27 18.27 0 0 0-5.487 0 12.51 12.51 0 0 0-.617-1.249.077.077 0 0 0-.074-.035 19.736 19.736 0 0 0-3.76 1.169.07.07 0 0 0-.032.027C2.533 8.046 1.79 11.624 2.155 15.157a.082.082 0 0 0 .031.056 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.027c.462-.63.873-1.295 1.226-1.994a.076.076 0 0 0-.041-.105 13.13 13.13 0 0 1-1.873-.892.077.077 0 0 1-.008-.128c.126-.094.252-.192.372-.291a.074.074 0 0 1 .077-.01c3.927 1.793 8.18 1.793 12.061 0a.074.074 0 0 1 .078.009c.12.099.246.198.373.292a.077.077 0 0 1-.006.128 12.32 12.32 0 0 1-1.873.891.077.077 0 0 0-.04.106c.36.698.772 1.363 1.225 1.993a.076.076 0 0 0 .084.028 19.84 19.84 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-4.087-.838-7.636-3.548-10.787a.061.061 0 0 0-.031-.028zM8.02 12.997c-1.182 0-2.156-1.085-2.156-2.419 0-1.333.955-2.419 2.156-2.419 1.21 0 2.175 1.095 2.156 2.42 0 1.333-.955 2.418-2.156 2.418zm7.974 0c-1.182 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.175 1.095 2.156 2.42 0 1.333-.946 2.418-2.156 2.418z"})}),tK=[{href:"https://github.com/huggingface/lerobot",label:"GitHub",Icon:K7},{href:"https://huggingface.co/docs/lerobot",label:"Documentation",Icon:B7},{href:"https://discord.com/invite/s3KuuzsPFb",label:"Discord",Icon:eK}],nK=()=>h.jsx("footer",{className:"fixed inset-x-0 bottom-0 z-30 border-t border-gray-800 bg-black/95",children:h.jsxs("div",{className:"mx-auto flex max-w-7xl flex-col items-center justify-between gap-3 px-4 py-4 text-sm text-gray-400 sm:flex-row",children:[h.jsxs("span",{children:["Powered by"," ",h.jsx("a",{href:"https://github.com/huggingface/lerobot",target:"_blank",rel:"noopener noreferrer",className:"font-medium text-gray-200 hover:text-white",children:"LeRobot"})]}),h.jsx("nav",{className:"flex items-center gap-4",children:tK.map(({href:t,label:e,Icon:n})=>h.jsxs("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 text-gray-400 hover:text-white",children:[h.jsx(n,{className:"h-4 w-4"}),h.jsx("span",{children:e})]},e))})]})}),rK=["top","right","bottom","left"],cl=Math.min,Ti=Math.max,xy=Math.round,Eg=Math.floor,fa=t=>({x:t,y:t}),iK={left:"right",right:"left",bottom:"top",top:"bottom"},oK={start:"end",end:"start"};function pE(t,e,n){return Ti(t,cl(e,n))}function ns(t,e){return typeof t=="function"?t(e):t}function rs(t){return t.split("-")[0]}function bf(t){return t.split("-")[1]}function hA(t){return t==="x"?"y":"x"}function pA(t){return t==="y"?"height":"width"}function oa(t){return["top","bottom"].includes(rs(t))?"y":"x"}function mA(t){return hA(oa(t))}function aK(t,e,n){n===void 0&&(n=!1);const r=bf(t),i=mA(t),o=pA(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(a=by(a)),[a,by(a)]}function sK(t){const e=by(t);return[mE(t),e,mE(e)]}function mE(t){return t.replace(/start|end/g,e=>oK[e])}function lK(t,e,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],a=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:r:e?r:i;case"left":case"right":return e?o:a;default:return[]}}function cK(t,e,n,r){const i=bf(t);let o=lK(rs(t),n==="start",r);return i&&(o=o.map(a=>a+"-"+i),e&&(o=o.concat(o.map(mE)))),o}function by(t){return t.replace(/left|right|bottom|top/g,e=>iK[e])}function uK(t){return{top:0,right:0,bottom:0,left:0,...t}}function _F(t){return typeof t!="number"?uK(t):{top:t,right:t,bottom:t,left:t}}function _y(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function hN(t,e,n){let{reference:r,floating:i}=t;const o=oa(e),a=mA(e),s=pA(a),l=rs(e),c=o==="y",u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2;let p;switch(l){case"top":p={x:u,y:r.y-i.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(bf(e)){case"start":p[a]-=f*(n&&c?-1:1);break;case"end":p[a]+=f*(n&&c?-1:1);break}return p}const dK=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=o.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(e));let c=await a.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:d}=hN(c,r,l),f=r,p={},y=0;for(let v=0;v({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:o,platform:a,elements:s,middlewareData:l}=e,{element:c,padding:u=0}=ns(t,e)||{};if(c==null)return{};const d=_F(u),f={x:n,y:r},p=mA(i),y=pA(p),v=await a.getDimensions(c),g=p==="y",m=g?"top":"left",x=g?"bottom":"right",b=g?"clientHeight":"clientWidth",S=o.reference[y]+o.reference[p]-f[p]-o.floating[y],w=f[p]-o.reference[p],E=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c));let T=E?E[b]:0;(!T||!await(a.isElement==null?void 0:a.isElement(E)))&&(T=s.floating[b]||o.floating[y]);const A=S/2-w/2,M=T/2-v[y]/2-1,C=cl(d[m],M),P=cl(d[x],M),R=C,D=T-v[y]-P,k=T/2-v[y]/2+A,U=pE(R,k,D),O=!l.arrow&&bf(i)!=null&&k!==U&&o.reference[y]/2-(kk<=0)){var P,R;const k=(((P=o.flip)==null?void 0:P.index)||0)+1,U=T[k];if(U&&(!(d==="alignment"?x!==oa(U):!1)||C.every(L=>L.overflows[0]>0&&oa(L.placement)===x)))return{data:{index:k,overflows:C},reset:{placement:U}};let O=(R=C.filter(W=>W.overflows[0]<=0).sort((W,L)=>W.overflows[1]-L.overflows[1])[0])==null?void 0:R.placement;if(!O)switch(p){case"bestFit":{var D;const W=(D=C.filter(L=>{if(E){const j=oa(L.placement);return j===x||j==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(j=>j>0).reduce((j,X)=>j+X,0)]).sort((L,j)=>L[1]-j[1])[0])==null?void 0:D[0];W&&(O=W);break}case"initialPlacement":O=s;break}if(i!==O)return{reset:{placement:O}}}return{}}}};function pN(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function mN(t){return rK.some(e=>t[e]>=0)}const pK=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...i}=ns(t,e);switch(r){case"referenceHidden":{const o=await bp(e,{...i,elementContext:"reference"}),a=pN(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:mN(a)}}}case"escaped":{const o=await bp(e,{...i,altBoundary:!0}),a=pN(o,n.floating);return{data:{escapedOffsets:a,escaped:mN(a)}}}default:return{}}}}};async function mK(t,e){const{placement:n,platform:r,elements:i}=t,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=rs(n),s=bf(n),l=oa(n)==="y",c=["left","top"].includes(a)?-1:1,u=o&&l?-1:1,d=ns(e,t);let{mainAxis:f,crossAxis:p,alignmentAxis:y}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof y=="number"&&(p=s==="end"?y*-1:y),l?{x:p*u,y:f*c}:{x:f*c,y:p*u}}const gK=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:o,placement:a,middlewareData:s}=e,l=await mK(e,t);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:a}}}}},vK=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:g=>{let{x:m,y:x}=g;return{x:m,y:x}}},...l}=ns(t,e),c={x:n,y:r},u=await bp(e,l),d=oa(rs(i)),f=hA(d);let p=c[f],y=c[d];if(o){const g=f==="y"?"top":"left",m=f==="y"?"bottom":"right",x=p+u[g],b=p-u[m];p=pE(x,p,b)}if(a){const g=d==="y"?"top":"left",m=d==="y"?"bottom":"right",x=y+u[g],b=y-u[m];y=pE(x,y,b)}const v=s.fn({...e,[f]:p,[d]:y});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[f]:o,[d]:a}}}}}},yK=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=e,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=ns(t,e),u={x:n,y:r},d=oa(i),f=hA(d);let p=u[f],y=u[d];const v=ns(s,e),g=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(l){const b=f==="y"?"height":"width",S=o.reference[f]-o.floating[b]+g.mainAxis,w=o.reference[f]+o.reference[b]-g.mainAxis;pw&&(p=w)}if(c){var m,x;const b=f==="y"?"width":"height",S=["top","left"].includes(rs(i)),w=o.reference[d]-o.floating[b]+(S&&((m=a.offset)==null?void 0:m[d])||0)+(S?0:g.crossAxis),E=o.reference[d]+o.reference[b]+(S?0:((x=a.offset)==null?void 0:x[d])||0)-(S?g.crossAxis:0);yE&&(y=E)}return{[f]:p,[d]:y}}}},xK=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:o,platform:a,elements:s}=e,{apply:l=()=>{},...c}=ns(t,e),u=await bp(e,c),d=rs(i),f=bf(i),p=oa(i)==="y",{width:y,height:v}=o.floating;let g,m;d==="top"||d==="bottom"?(g=d,m=f===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(m=d,g=f==="end"?"top":"bottom");const x=v-u.top-u.bottom,b=y-u.left-u.right,S=cl(v-u[g],x),w=cl(y-u[m],b),E=!e.middlewareData.shift;let T=S,A=w;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(A=b),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(T=x),E&&!f){const C=Ti(u.left,0),P=Ti(u.right,0),R=Ti(u.top,0),D=Ti(u.bottom,0);p?A=y-2*(C!==0||P!==0?C+P:Ti(u.left,u.right)):T=v-2*(R!==0||D!==0?R+D:Ti(u.top,u.bottom))}await l({...e,availableWidth:A,availableHeight:T});const M=await a.getDimensions(s.floating);return y!==M.width||v!==M.height?{reset:{rects:!0}}:{}}}};function dx(){return typeof window<"u"}function _f(t){return wF(t)?(t.nodeName||"").toLowerCase():"#document"}function Ni(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function ba(t){var e;return(e=(wF(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function wF(t){return dx()?t instanceof Node||t instanceof Ni(t).Node:!1}function zo(t){return dx()?t instanceof Element||t instanceof Ni(t).Element:!1}function ga(t){return dx()?t instanceof HTMLElement||t instanceof Ni(t).HTMLElement:!1}function gN(t){return!dx()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Ni(t).ShadowRoot}function Mm(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=Ho(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function bK(t){return["table","td","th"].includes(_f(t))}function fx(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function gA(t){const e=vA(),n=zo(t)?Ho(t):t;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function _K(t){let e=ul(t);for(;ga(e)&&!Id(e);){if(gA(e))return e;if(fx(e))return null;e=ul(e)}return null}function vA(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Id(t){return["html","body","#document"].includes(_f(t))}function Ho(t){return Ni(t).getComputedStyle(t)}function hx(t){return zo(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ul(t){if(_f(t)==="html")return t;const e=t.assignedSlot||t.parentNode||gN(t)&&t.host||ba(t);return gN(e)?e.host:e}function SF(t){const e=ul(t);return Id(e)?t.ownerDocument?t.ownerDocument.body:t.body:ga(e)&&Mm(e)?e:SF(e)}function _p(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=SF(t),o=i===((r=t.ownerDocument)==null?void 0:r.body),a=Ni(i);if(o){const s=gE(a);return e.concat(a,a.visualViewport||[],Mm(i)?i:[],s&&n?_p(s):[])}return e.concat(i,_p(i,[],n))}function gE(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function EF(t){const e=Ho(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=ga(t),o=i?t.offsetWidth:n,a=i?t.offsetHeight:r,s=xy(n)!==o||xy(r)!==a;return s&&(n=o,r=a),{width:n,height:r,$:s}}function yA(t){return zo(t)?t:t.contextElement}function od(t){const e=yA(t);if(!ga(e))return fa(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:o}=EF(e);let a=(o?xy(n.width):n.width)/r,s=(o?xy(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const wK=fa(0);function TF(t){const e=Ni(t);return!vA()||!e.visualViewport?wK:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function SK(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Ni(t)?!1:e}function Ac(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),o=yA(t);let a=fa(1);e&&(r?zo(r)&&(a=od(r)):a=od(t));const s=SK(o,n,r)?TF(o):fa(0);let l=(i.left+s.x)/a.x,c=(i.top+s.y)/a.y,u=i.width/a.x,d=i.height/a.y;if(o){const f=Ni(o),p=r&&zo(r)?Ni(r):r;let y=f,v=gE(y);for(;v&&r&&p!==y;){const g=od(v),m=v.getBoundingClientRect(),x=Ho(v),b=m.left+(v.clientLeft+parseFloat(x.paddingLeft))*g.x,S=m.top+(v.clientTop+parseFloat(x.paddingTop))*g.y;l*=g.x,c*=g.y,u*=g.x,d*=g.y,l+=b,c+=S,y=Ni(v),v=gE(y)}}return _y({width:u,height:d,x:l,y:c})}function xA(t,e){const n=hx(t).scrollLeft;return e?e.left+n:Ac(ba(t)).left+n}function MF(t,e,n){n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=r.left+e.scrollLeft-(n?0:xA(t,r)),o=r.top+e.scrollTop;return{x:i,y:o}}function EK(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const o=i==="fixed",a=ba(r),s=e?fx(e.floating):!1;if(r===a||s&&o)return n;let l={scrollLeft:0,scrollTop:0},c=fa(1);const u=fa(0),d=ga(r);if((d||!d&&!o)&&((_f(r)!=="body"||Mm(a))&&(l=hx(r)),ga(r))){const p=Ac(r);c=od(r),u.x=p.x+r.clientLeft,u.y=p.y+r.clientTop}const f=a&&!d&&!o?MF(a,l,!0):fa(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}}function TK(t){return Array.from(t.getClientRects())}function MK(t){const e=ba(t),n=hx(t),r=t.ownerDocument.body,i=Ti(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=Ti(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+xA(t);const s=-n.scrollTop;return Ho(r).direction==="rtl"&&(a+=Ti(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:s}}function AK(t,e){const n=Ni(t),r=ba(t),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;const c=vA();(!c||c&&e==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s,y:l}}function CK(t,e){const n=Ac(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,o=ga(t)?od(t):fa(1),a=t.clientWidth*o.x,s=t.clientHeight*o.y,l=i*o.x,c=r*o.y;return{width:a,height:s,x:l,y:c}}function vN(t,e,n){let r;if(e==="viewport")r=AK(t,n);else if(e==="document")r=MK(ba(t));else if(zo(e))r=CK(e,n);else{const i=TF(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return _y(r)}function AF(t,e){const n=ul(t);return n===e||!zo(n)||Id(n)?!1:Ho(n).position==="fixed"||AF(n,e)}function PK(t,e){const n=e.get(t);if(n)return n;let r=_p(t,[],!1).filter(s=>zo(s)&&_f(s)!=="body"),i=null;const o=Ho(t).position==="fixed";let a=o?ul(t):t;for(;zo(a)&&!Id(a);){const s=Ho(a),l=gA(a);!l&&s.position==="fixed"&&(i=null),(o?!l&&!i:!l&&s.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Mm(a)&&!l&&AF(t,a))?r=r.filter(u=>u!==a):i=s,a=ul(a)}return e.set(t,r),r}function RK(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const a=[...n==="clippingAncestors"?fx(e)?[]:PK(e,this._c):[].concat(n),r],s=a[0],l=a.reduce((c,u)=>{const d=vN(e,u,i);return c.top=Ti(d.top,c.top),c.right=cl(d.right,c.right),c.bottom=cl(d.bottom,c.bottom),c.left=Ti(d.left,c.left),c},vN(e,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function NK(t){const{width:e,height:n}=EF(t);return{width:e,height:n}}function OK(t,e,n){const r=ga(e),i=ba(e),o=n==="fixed",a=Ac(t,!0,o,e);let s={scrollLeft:0,scrollTop:0};const l=fa(0);function c(){l.x=xA(i)}if(r||!r&&!o)if((_f(e)!=="body"||Mm(i))&&(s=hx(e)),r){const p=Ac(e,!0,o,e);l.x=p.x+e.clientLeft,l.y=p.y+e.clientTop}else i&&c();o&&!r&&i&&c();const u=i&&!r&&!o?MF(i,s):fa(0),d=a.left+s.scrollLeft-l.x-u.x,f=a.top+s.scrollTop-l.y-u.y;return{x:d,y:f,width:a.width,height:a.height}}function U_(t){return Ho(t).position==="static"}function yN(t,e){if(!ga(t)||Ho(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return ba(t)===n&&(n=n.ownerDocument.body),n}function CF(t,e){const n=Ni(t);if(fx(t))return n;if(!ga(t)){let i=ul(t);for(;i&&!Id(i);){if(zo(i)&&!U_(i))return i;i=ul(i)}return n}let r=yN(t,e);for(;r&&bK(r)&&U_(r);)r=yN(r,e);return r&&Id(r)&&U_(r)&&!gA(r)?n:r||_K(t)||n}const IK=async function(t){const e=this.getOffsetParent||CF,n=this.getDimensions,r=await n(t.floating);return{reference:OK(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function DK(t){return Ho(t).direction==="rtl"}const LK={convertOffsetParentRelativeRectToViewportRelativeRect:EK,getDocumentElement:ba,getClippingRect:RK,getOffsetParent:CF,getElementRects:IK,getClientRects:TK,getDimensions:NK,getScale:od,isElement:zo,isRTL:DK};function PF(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function kK(t,e){let n=null,r;const i=ba(t);function o(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function a(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),o();const c=t.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=c;if(s||e(),!f||!p)return;const y=Eg(d),v=Eg(i.clientWidth-(u+f)),g=Eg(i.clientHeight-(d+p)),m=Eg(u),b={rootMargin:-y+"px "+-v+"px "+-g+"px "+-m+"px",threshold:Ti(0,cl(1,l))||1};let S=!0;function w(E){const T=E[0].intersectionRatio;if(T!==l){if(!S)return a();T?a(!1,T):r=setTimeout(()=>{a(!1,1e-7)},1e3)}T===1&&!PF(c,t.getBoundingClientRect())&&a(),S=!1}try{n=new IntersectionObserver(w,{...b,root:i.ownerDocument})}catch{n=new IntersectionObserver(w,b)}n.observe(t)}return a(!0),o}function jK(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=yA(t),u=i||o?[...c?_p(c):[],..._p(e)]:[];u.forEach(m=>{i&&m.addEventListener("scroll",n,{passive:!0}),o&&m.addEventListener("resize",n)});const d=c&&s?kK(c,n):null;let f=-1,p=null;a&&(p=new ResizeObserver(m=>{let[x]=m;x&&x.target===c&&p&&(p.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var b;(b=p)==null||b.observe(e)})),n()}),c&&!l&&p.observe(c),p.observe(e));let y,v=l?Ac(t):null;l&&g();function g(){const m=Ac(t);v&&!PF(v,m)&&n(),v=m,y=requestAnimationFrame(g)}return n(),()=>{var m;u.forEach(x=>{i&&x.removeEventListener("scroll",n),o&&x.removeEventListener("resize",n)}),d==null||d(),(m=p)==null||m.disconnect(),p=null,l&&cancelAnimationFrame(y)}}const UK=gK,FK=vK,BK=hK,$K=xK,zK=pK,xN=fK,HK=yK,VK=(t,e,n)=>{const r=new Map,i={platform:LK,...n},o={...i.platform,_c:r};return dK(t,e,{...i,platform:o})};var GK=typeof document<"u",WK=function(){},kv=GK?_.useLayoutEffect:WK;function wy(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!wy(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&t.$$typeof)&&!wy(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function RF(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function bN(t,e){const n=RF(t);return Math.round(e*n)/n}function F_(t){const e=_.useRef(t);return kv(()=>{e.current=t}),e}function XK(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:a}={},transform:s=!0,whileElementsMounted:l,open:c}=t,[u,d]=_.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[f,p]=_.useState(r);wy(f,r)||p(r);const[y,v]=_.useState(null),[g,m]=_.useState(null),x=_.useCallback(L=>{L!==E.current&&(E.current=L,v(L))},[]),b=_.useCallback(L=>{L!==T.current&&(T.current=L,m(L))},[]),S=o||y,w=a||g,E=_.useRef(null),T=_.useRef(null),A=_.useRef(u),M=l!=null,C=F_(l),P=F_(i),R=F_(c),D=_.useCallback(()=>{if(!E.current||!T.current)return;const L={placement:e,strategy:n,middleware:f};P.current&&(L.platform=P.current),VK(E.current,T.current,L).then(j=>{const X={...j,isPositioned:R.current!==!1};k.current&&!wy(A.current,X)&&(A.current=X,Bc.flushSync(()=>{d(X)}))})},[f,e,n,P,R]);kv(()=>{c===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,d(L=>({...L,isPositioned:!1})))},[c]);const k=_.useRef(!1);kv(()=>(k.current=!0,()=>{k.current=!1}),[]),kv(()=>{if(S&&(E.current=S),w&&(T.current=w),S&&w){if(C.current)return C.current(S,w,D);D()}},[S,w,D,C,M]);const U=_.useMemo(()=>({reference:E,floating:T,setReference:x,setFloating:b}),[x,b]),O=_.useMemo(()=>({reference:S,floating:w}),[S,w]),W=_.useMemo(()=>{const L={position:n,left:0,top:0};if(!O.floating)return L;const j=bN(O.floating,u.x),X=bN(O.floating,u.y);return s?{...L,transform:"translate("+j+"px, "+X+"px)",...RF(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:j,top:X}},[n,s,O.floating,u.x,u.y]);return _.useMemo(()=>({...u,update:D,refs:U,elements:O,floatingStyles:W}),[u,D,U,O,W])}const qK=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:i}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?xN({element:r.current,padding:i}).fn(n):{}:r?xN({element:r,padding:i}).fn(n):{}}}},KK=(t,e)=>({...UK(t),options:[t,e]}),YK=(t,e)=>({...FK(t),options:[t,e]}),JK=(t,e)=>({...HK(t),options:[t,e]}),ZK=(t,e)=>({...BK(t),options:[t,e]}),QK=(t,e)=>({...$K(t),options:[t,e]}),eY=(t,e)=>({...zK(t),options:[t,e]}),tY=(t,e)=>({...qK(t),options:[t,e]});var nY="Arrow",NF=_.forwardRef((t,e)=>{const{children:n,width:r=10,height:i=5,...o}=t;return h.jsx(nt.svg,{...o,ref:e,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:h.jsx("polygon",{points:"0,0 30,0 15,10"})})});NF.displayName=nY;var rY=NF;function bA(t){const[e,n]=_.useState(void 0);return ur(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,s;if("borderBoxSize"in o){const l=o.borderBoxSize,c=Array.isArray(l)?l[0]:l;a=c.inlineSize,s=c.blockSize}else a=t.offsetWidth,s=t.offsetHeight;n({width:a,height:s})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var _A="Popper",[OF,Sl]=mi(_A),[iY,IF]=OF(_A),DF=t=>{const{__scopePopper:e,children:n}=t,[r,i]=_.useState(null);return h.jsx(iY,{scope:e,anchor:r,onAnchorChange:i,children:n})};DF.displayName=_A;var LF="PopperAnchor",kF=_.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...i}=t,o=IF(LF,n),a=_.useRef(null),s=Ot(e,a);return _.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:h.jsx(nt.div,{...i,ref:s})});kF.displayName=LF;var wA="PopperContent",[oY,aY]=OF(wA),jF=_.forwardRef((t,e)=>{var ee,ce,ae,fe,we,le;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:a=0,arrowPadding:s=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:y,...v}=t,g=IF(wA,n),[m,x]=_.useState(null),b=Ot(e,ie=>x(ie)),[S,w]=_.useState(null),E=bA(S),T=(E==null?void 0:E.width)??0,A=(E==null?void 0:E.height)??0,M=r+(o!=="center"?"-"+o:""),C=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},P=Array.isArray(c)?c:[c],R=P.length>0,D={padding:C,boundary:P.filter(lY),altBoundary:R},{refs:k,floatingStyles:U,placement:O,isPositioned:W,middlewareData:L}=XK({strategy:"fixed",placement:M,whileElementsMounted:(...ie)=>jK(...ie,{animationFrame:p==="always"}),elements:{reference:g.anchor},middleware:[KK({mainAxis:i+A,alignmentAxis:a}),l&&YK({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?JK():void 0,...D}),l&&ZK({...D}),QK({...D,apply:({elements:ie,rects:G,availableWidth:Ve,availableHeight:Ne})=>{const{width:st,height:Re}=G.reference,ct=ie.floating.style;ct.setProperty("--radix-popper-available-width",`${Ve}px`),ct.setProperty("--radix-popper-available-height",`${Ne}px`),ct.setProperty("--radix-popper-anchor-width",`${st}px`),ct.setProperty("--radix-popper-anchor-height",`${Re}px`)}}),S&&tY({element:S,padding:s}),cY({arrowWidth:T,arrowHeight:A}),f&&eY({strategy:"referenceHidden",...D})]}),[j,X]=BF(O),K=di(y);ur(()=>{W&&(K==null||K())},[W,K]);const F=(ee=L.arrow)==null?void 0:ee.x,Y=(ce=L.arrow)==null?void 0:ce.y,q=((ae=L.arrow)==null?void 0:ae.centerOffset)!==0,[Q,te]=_.useState();return ur(()=>{m&&te(window.getComputedStyle(m).zIndex)},[m]),h.jsx("div",{ref:k.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:W?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Q,"--radix-popper-transform-origin":[(fe=L.transformOrigin)==null?void 0:fe.x,(we=L.transformOrigin)==null?void 0:we.y].join(" "),...((le=L.hide)==null?void 0:le.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:h.jsx(oY,{scope:n,placedSide:j,onArrowChange:w,arrowX:F,arrowY:Y,shouldHideArrow:q,children:h.jsx(nt.div,{"data-side":j,"data-align":X,...v,ref:b,style:{...v.style,animation:W?void 0:"none"}})})})});jF.displayName=wA;var UF="PopperArrow",sY={top:"bottom",right:"left",bottom:"top",left:"right"},FF=_.forwardRef(function(e,n){const{__scopePopper:r,...i}=e,o=aY(UF,r),a=sY[o.placedSide];return h.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:h.jsx(rY,{...i,ref:n,style:{...i.style,display:"block"}})})});FF.displayName=UF;function lY(t){return t!==null}var cY=t=>({name:"transformOrigin",options:t,fn(e){var g,m,x;const{placement:n,rects:r,middlewareData:i}=e,a=((g=i.arrow)==null?void 0:g.centerOffset)!==0,s=a?0:t.arrowWidth,l=a?0:t.arrowHeight,[c,u]=BF(n),d={start:"0%",center:"50%",end:"100%"}[u],f=(((m=i.arrow)==null?void 0:m.x)??0)+s/2,p=(((x=i.arrow)==null?void 0:x.y)??0)+l/2;let y="",v="";return c==="bottom"?(y=a?d:`${f}px`,v=`${-l}px`):c==="top"?(y=a?d:`${f}px`,v=`${r.floating.height+l}px`):c==="right"?(y=`${-l}px`,v=a?d:`${p}px`):c==="left"&&(y=`${r.floating.width+l}px`,v=a?d:`${p}px`),{data:{x:y,y:v}}}});function BF(t){const[e,n="center"]=t.split("-");return[e,n]}var px=DF,Am=kF,mx=jF,gx=FF,[vx,pDe]=mi("Tooltip",[Sl]),yx=Sl(),$F="TooltipProvider",uY=700,vE="tooltip.open",[dY,SA]=vx($F),zF=t=>{const{__scopeTooltip:e,delayDuration:n=uY,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=t,a=_.useRef(!0),s=_.useRef(!1),l=_.useRef(0);return _.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),h.jsx(dY,{scope:e,isOpenDelayedRef:a,delayDuration:n,onOpen:_.useCallback(()=>{window.clearTimeout(l.current),a.current=!1},[]),onClose:_.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:_.useCallback(c=>{s.current=c},[]),disableHoverableContent:i,children:o})};zF.displayName=$F;var wp="Tooltip",[fY,xx]=vx(wp),HF=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:i,onOpenChange:o,disableHoverableContent:a,delayDuration:s}=t,l=SA(wp,t.__scopeTooltip),c=yx(e),[u,d]=_.useState(null),f=sr(),p=_.useRef(0),y=a??l.disableHoverableContent,v=s??l.delayDuration,g=_.useRef(!1),[m,x]=$o({prop:r,defaultProp:i??!1,onChange:T=>{T?(l.onOpen(),document.dispatchEvent(new CustomEvent(vE))):l.onClose(),o==null||o(T)},caller:wp}),b=_.useMemo(()=>m?g.current?"delayed-open":"instant-open":"closed",[m]),S=_.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,x(!0)},[x]),w=_.useCallback(()=>{window.clearTimeout(p.current),p.current=0,x(!1)},[x]),E=_.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,x(!0),p.current=0},v)},[v,x]);return _.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),h.jsx(px,{...c,children:h.jsx(fY,{scope:e,contentId:f,open:m,stateAttribute:b,trigger:u,onTriggerChange:d,onTriggerEnter:_.useCallback(()=>{l.isOpenDelayedRef.current?E():S()},[l.isOpenDelayedRef,E,S]),onTriggerLeave:_.useCallback(()=>{y?w():(window.clearTimeout(p.current),p.current=0)},[w,y]),onOpen:S,onClose:w,disableHoverableContent:y,children:n})})};HF.displayName=wp;var yE="TooltipTrigger",VF=_.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=xx(yE,n),o=SA(yE,n),a=yx(n),s=_.useRef(null),l=Ot(e,s,i.onTriggerChange),c=_.useRef(!1),u=_.useRef(!1),d=_.useCallback(()=>c.current=!1,[]);return _.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),h.jsx(Am,{asChild:!0,...a,children:h.jsx(nt.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:l,onPointerMove:Oe(t.onPointerMove,f=>{f.pointerType!=="touch"&&!u.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),u.current=!0)}),onPointerLeave:Oe(t.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:Oe(t.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Oe(t.onFocus,()=>{c.current||i.onOpen()}),onBlur:Oe(t.onBlur,i.onClose),onClick:Oe(t.onClick,i.onClose)})})});VF.displayName=yE;var hY="TooltipPortal",[mDe,pY]=vx(hY,{forceMount:void 0}),Dd="TooltipContent",GF=_.forwardRef((t,e)=>{const n=pY(Dd,t.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=t,a=xx(Dd,t.__scopeTooltip);return h.jsx(gi,{present:r||a.open,children:a.disableHoverableContent?h.jsx(WF,{side:i,...o,ref:e}):h.jsx(mY,{side:i,...o,ref:e})})}),mY=_.forwardRef((t,e)=>{const n=xx(Dd,t.__scopeTooltip),r=SA(Dd,t.__scopeTooltip),i=_.useRef(null),o=Ot(e,i),[a,s]=_.useState(null),{trigger:l,onClose:c}=n,u=i.current,{onPointerInTransitChange:d}=r,f=_.useCallback(()=>{s(null),d(!1)},[d]),p=_.useCallback((y,v)=>{const g=y.currentTarget,m={x:y.clientX,y:y.clientY},x=bY(m,g.getBoundingClientRect()),b=_Y(m,x),S=wY(v.getBoundingClientRect()),w=EY([...b,...S]);s(w),d(!0)},[d]);return _.useEffect(()=>()=>f(),[f]),_.useEffect(()=>{if(l&&u){const y=g=>p(g,u),v=g=>p(g,l);return l.addEventListener("pointerleave",y),u.addEventListener("pointerleave",v),()=>{l.removeEventListener("pointerleave",y),u.removeEventListener("pointerleave",v)}}},[l,u,p,f]),_.useEffect(()=>{if(a){const y=v=>{const g=v.target,m={x:v.clientX,y:v.clientY},x=(l==null?void 0:l.contains(g))||(u==null?void 0:u.contains(g)),b=!SY(m,a);x?f():b&&(f(),c())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[l,u,a,c,f]),h.jsx(WF,{...t,ref:o})}),[gY,vY]=vx(wp,{isInside:!1}),yY=aU("TooltipContent"),WF=_.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:a,...s}=t,l=xx(Dd,n),c=yx(n),{onClose:u}=l;return _.useEffect(()=>(document.addEventListener(vE,u),()=>document.removeEventListener(vE,u)),[u]),_.useEffect(()=>{if(l.trigger){const d=f=>{const p=f.target;p!=null&&p.contains(l.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,u]),h.jsx(zc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:h.jsxs(mx,{"data-state":l.stateAttribute,...c,...s,ref:e,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[h.jsx(yY,{children:r}),h.jsx(gY,{scope:n,isInside:!0,children:h.jsx(y7,{id:l.contentId,role:"tooltip",children:i||r})})]})})});GF.displayName=Dd;var XF="TooltipArrow",xY=_.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=yx(n);return vY(XF,n).isInside?null:h.jsx(gx,{...i,...r,ref:e})});xY.displayName=XF;function bY(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),i=Math.abs(e.right-t.x),o=Math.abs(e.left-t.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function _Y(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function wY(t){const{top:e,right:n,bottom:r,left:i}=t;return[{x:i,y:e},{x:n,y:e},{x:n,y:r},{x:i,y:r}]}function SY(t,e){const{x:n,y:r}=t;let i=!1;for(let o=0,a=e.length-1;or!=f>r&&n<(d-c)*(r-u)/(f-u)+c&&(i=!i)}return i}function EY(t){const e=t.slice();return e.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),TY(e)}function TY(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r=2;){const o=e[e.length-1],a=e[e.length-2];if((o.x-a.x)*(i.y-a.y)>=(o.y-a.y)*(i.x-a.x))e.pop();else break}e.push(i)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const i=t[r];for(;n.length>=2;){const o=n[n.length-1],a=n[n.length-2];if((o.x-a.x)*(i.y-a.y)>=(o.y-a.y)*(i.x-a.x))n.pop();else break}n.push(i)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var MY=HF,AY=VF,qF=GF;const jv=MY,Uv=AY,Vh=_.forwardRef(({className:t,sideOffset:e=4,...n},r)=>h.jsx(qF,{ref:r,sideOffset:e,className:He("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n}));Vh.displayName=qF.displayName;var bx="Popover",[KF,gDe]=mi(bx,[Sl]),Cm=Sl(),[CY,El]=KF(bx),YF=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:a=!1}=t,s=Cm(e),l=_.useRef(null),[c,u]=_.useState(!1),[d,f]=$o({prop:r,defaultProp:i??!1,onChange:o,caller:bx});return h.jsx(px,{...s,children:h.jsx(CY,{scope:e,contentId:sr(),triggerRef:l,open:d,onOpenChange:f,onOpenToggle:_.useCallback(()=>f(p=>!p),[f]),hasCustomAnchor:c,onCustomAnchorAdd:_.useCallback(()=>u(!0),[]),onCustomAnchorRemove:_.useCallback(()=>u(!1),[]),modal:a,children:n})})};YF.displayName=bx;var JF="PopoverAnchor",PY=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=El(JF,n),o=Cm(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:s}=i;return _.useEffect(()=>(a(),()=>s()),[a,s]),h.jsx(Am,{...o,...r,ref:e})});PY.displayName=JF;var ZF="PopoverTrigger",QF=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=El(ZF,n),o=Cm(n),a=Ot(e,i.triggerRef),s=h.jsx(nt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":iB(i.open),...r,ref:a,onClick:Oe(t.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:h.jsx(Am,{asChild:!0,...o,children:s})});QF.displayName=ZF;var EA="PopoverPortal",[RY,NY]=KF(EA,{forceMount:void 0}),eB=t=>{const{__scopePopover:e,forceMount:n,children:r,container:i}=t,o=El(EA,e);return h.jsx(RY,{scope:e,forceMount:n,children:h.jsx(gi,{present:n||o.open,children:h.jsx(vf,{asChild:!0,container:i,children:r})})})};eB.displayName=EA;var Ld="PopoverContent",tB=_.forwardRef((t,e)=>{const n=NY(Ld,t.__scopePopover),{forceMount:r=n.forceMount,...i}=t,o=El(Ld,t.__scopePopover);return h.jsx(gi,{present:r||o.open,children:o.modal?h.jsx(IY,{...i,ref:e}):h.jsx(DY,{...i,ref:e})})});tB.displayName=Ld;var OY=al("PopoverContent.RemoveScroll"),IY=_.forwardRef((t,e)=>{const n=El(Ld,t.__scopePopover),r=_.useRef(null),i=Ot(e,r),o=_.useRef(!1);return _.useEffect(()=>{const a=r.current;if(a)return sx(a)},[]),h.jsx(Tm,{as:OY,allowPinchZoom:!0,children:h.jsx(nB,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Oe(t.onCloseAutoFocus,a=>{var s;a.preventDefault(),o.current||(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:Oe(t.onPointerDownOutside,a=>{const s=a.detail.originalEvent,l=s.button===0&&s.ctrlKey===!0,c=s.button===2||l;o.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:Oe(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),DY=_.forwardRef((t,e)=>{const n=El(Ld,t.__scopePopover),r=_.useRef(!1),i=_.useRef(!1);return h.jsx(nB,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var a,s;(a=t.onCloseAutoFocus)==null||a.call(t,o),o.defaultPrevented||(r.current||(s=n.triggerRef.current)==null||s.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var l,c;(l=t.onInteractOutside)==null||l.call(t,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=o.target;((c=n.triggerRef.current)==null?void 0:c.contains(a))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),nB=_.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...d}=t,f=El(Ld,n),p=Cm(n);return ox(),h.jsx(Em,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:h.jsx(zc,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>f.onOpenChange(!1),children:h.jsx(mx,{"data-state":iB(f.open),role:"dialog",id:f.contentId,...p,...d,ref:e,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),rB="PopoverClose",LY=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=El(rB,n);return h.jsx(nt.button,{type:"button",...r,ref:e,onClick:Oe(t.onClick,()=>i.onOpenChange(!1))})});LY.displayName=rB;var kY="PopoverArrow",jY=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Cm(n);return h.jsx(gx,{...i,...r,ref:e})});jY.displayName=kY;function iB(t){return t?"open":"closed"}var UY=YF,FY=QF,BY=eB,oB=tB;const _x=UY,wx=FY,Pm=_.forwardRef(({className:t,align:e="center",sideOffset:n=4,...r},i)=>h.jsx(BY,{children:h.jsx(oB,{ref:i,align:e,sideOffset:n,className:He("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r})}));Pm.displayName=oB.displayName;var _N=1,$Y=.9,zY=.8,HY=.17,B_=.1,$_=.999,VY=.9999,GY=.99,WY=/[\\\/_+.#"@\[\(\{&]/,XY=/[\\\/_+.#"@\[\(\{&]/g,qY=/[\s-]/,aB=/[\s-]/g;function xE(t,e,n,r,i,o,a){if(o===e.length)return i===t.length?_N:GY;var s=`${i},${o}`;if(a[s]!==void 0)return a[s];for(var l=r.charAt(o),c=n.indexOf(l,i),u=0,d,f,p,y;c>=0;)d=xE(t,e,n,r,c+1,o+1,a),d>u&&(c===i?d*=_N:WY.test(t.charAt(c-1))?(d*=zY,p=t.slice(i,c-1).match(XY),p&&i>0&&(d*=Math.pow($_,p.length))):qY.test(t.charAt(c-1))?(d*=$Y,y=t.slice(i,c-1).match(aB),y&&i>0&&(d*=Math.pow($_,y.length))):(d*=HY,i>0&&(d*=Math.pow($_,c-i))),t.charAt(c)!==e.charAt(o)&&(d*=VY)),(dd&&(d=f*B_)),d>u&&(u=d),c=n.indexOf(l,c+1);return a[s]=u,u}function wN(t){return t.toLowerCase().replace(aB," ")}function KY(t,e,n){return t=n&&n.length>0?`${t+" "+n.join(" ")}`:t,xE(t,e,wN(t),wN(e),0,0,{})}var eh='[cmdk-group=""]',z_='[cmdk-group-items=""]',YY='[cmdk-group-heading=""]',sB='[cmdk-item=""]',SN=`${sB}:not([aria-disabled="true"])`,bE="cmdk-item-select",Mu="data-value",JY=(t,e,n)=>KY(t,e,n),lB=_.createContext(void 0),Rm=()=>_.useContext(lB),cB=_.createContext(void 0),TA=()=>_.useContext(cB),uB=_.createContext(void 0),dB=_.forwardRef((t,e)=>{let n=Au(()=>{var F,Y;return{search:"",value:(Y=(F=t.value)!=null?F:t.defaultValue)!=null?Y:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Au(()=>new Set),i=Au(()=>new Map),o=Au(()=>new Map),a=Au(()=>new Set),s=fB(t),{label:l,children:c,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:y,disablePointerSelection:v=!1,vimBindings:g=!0,...m}=t,x=sr(),b=sr(),S=sr(),w=_.useRef(null),E=lJ();Cc(()=>{if(u!==void 0){let F=u.trim();n.current.value=F,T.emit()}},[u]),Cc(()=>{E(6,D)},[]);let T=_.useMemo(()=>({subscribe:F=>(a.current.add(F),()=>a.current.delete(F)),snapshot:()=>n.current,setState:(F,Y,q)=>{var Q,te,ee,ce;if(!Object.is(n.current[F],Y)){if(n.current[F]=Y,F==="search")R(),C(),E(1,P);else if(F==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ae=document.getElementById(S);ae?ae.focus():(Q=document.getElementById(x))==null||Q.focus()}if(E(7,()=>{var ae;n.current.selectedItemId=(ae=k())==null?void 0:ae.id,T.emit()}),q||E(5,D),((te=s.current)==null?void 0:te.value)!==void 0){let ae=Y??"";(ce=(ee=s.current).onValueChange)==null||ce.call(ee,ae);return}}T.emit()}},emit:()=>{a.current.forEach(F=>F())}}),[]),A=_.useMemo(()=>({value:(F,Y,q)=>{var Q;Y!==((Q=o.current.get(F))==null?void 0:Q.value)&&(o.current.set(F,{value:Y,keywords:q}),n.current.filtered.items.set(F,M(Y,q)),E(2,()=>{C(),T.emit()}))},item:(F,Y)=>(r.current.add(F),Y&&(i.current.has(Y)?i.current.get(Y).add(F):i.current.set(Y,new Set([F]))),E(3,()=>{R(),C(),n.current.value||P(),T.emit()}),()=>{o.current.delete(F),r.current.delete(F),n.current.filtered.items.delete(F);let q=k();E(4,()=>{R(),(q==null?void 0:q.getAttribute("id"))===F&&P(),T.emit()})}),group:F=>(i.current.has(F)||i.current.set(F,new Set),()=>{o.current.delete(F),i.current.delete(F)}),filter:()=>s.current.shouldFilter,label:l||t["aria-label"],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:x,inputId:S,labelId:b,listInnerRef:w}),[]);function M(F,Y){var q,Q;let te=(Q=(q=s.current)==null?void 0:q.filter)!=null?Q:JY;return F?te(F,n.current.search,Y):0}function C(){if(!n.current.search||s.current.shouldFilter===!1)return;let F=n.current.filtered.items,Y=[];n.current.filtered.groups.forEach(Q=>{let te=i.current.get(Q),ee=0;te.forEach(ce=>{let ae=F.get(ce);ee=Math.max(ae,ee)}),Y.push([Q,ee])});let q=w.current;U().sort((Q,te)=>{var ee,ce;let ae=Q.getAttribute("id"),fe=te.getAttribute("id");return((ee=F.get(fe))!=null?ee:0)-((ce=F.get(ae))!=null?ce:0)}).forEach(Q=>{let te=Q.closest(z_);te?te.appendChild(Q.parentElement===te?Q:Q.closest(`${z_} > *`)):q.appendChild(Q.parentElement===q?Q:Q.closest(`${z_} > *`))}),Y.sort((Q,te)=>te[1]-Q[1]).forEach(Q=>{var te;let ee=(te=w.current)==null?void 0:te.querySelector(`${eh}[${Mu}="${encodeURIComponent(Q[0])}"]`);ee==null||ee.parentElement.appendChild(ee)})}function P(){let F=U().find(q=>q.getAttribute("aria-disabled")!=="true"),Y=F==null?void 0:F.getAttribute(Mu);T.setState("value",Y||void 0)}function R(){var F,Y,q,Q;if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let te=0;for(let ee of r.current){let ce=(Y=(F=o.current.get(ee))==null?void 0:F.value)!=null?Y:"",ae=(Q=(q=o.current.get(ee))==null?void 0:q.keywords)!=null?Q:[],fe=M(ce,ae);n.current.filtered.items.set(ee,fe),fe>0&&te++}for(let[ee,ce]of i.current)for(let ae of ce)if(n.current.filtered.items.get(ae)>0){n.current.filtered.groups.add(ee);break}n.current.filtered.count=te}function D(){var F,Y,q;let Q=k();Q&&(((F=Q.parentElement)==null?void 0:F.firstChild)===Q&&((q=(Y=Q.closest(eh))==null?void 0:Y.querySelector(YY))==null||q.scrollIntoView({block:"nearest"})),Q.scrollIntoView({block:"nearest"}))}function k(){var F;return(F=w.current)==null?void 0:F.querySelector(`${sB}[aria-selected="true"]`)}function U(){var F;return Array.from(((F=w.current)==null?void 0:F.querySelectorAll(SN))||[])}function O(F){let Y=U()[F];Y&&T.setState("value",Y.getAttribute(Mu))}function W(F){var Y;let q=k(),Q=U(),te=Q.findIndex(ce=>ce===q),ee=Q[te+F];(Y=s.current)!=null&&Y.loop&&(ee=te+F<0?Q[Q.length-1]:te+F===Q.length?Q[0]:Q[te+F]),ee&&T.setState("value",ee.getAttribute(Mu))}function L(F){let Y=k(),q=Y==null?void 0:Y.closest(eh),Q;for(;q&&!Q;)q=F>0?aJ(q,eh):sJ(q,eh),Q=q==null?void 0:q.querySelector(SN);Q?T.setState("value",Q.getAttribute(Mu)):W(F)}let j=()=>O(U().length-1),X=F=>{F.preventDefault(),F.metaKey?j():F.altKey?L(1):W(1)},K=F=>{F.preventDefault(),F.metaKey?O(0):F.altKey?L(-1):W(-1)};return _.createElement(nt.div,{ref:e,tabIndex:-1,...m,"cmdk-root":"",onKeyDown:F=>{var Y;(Y=m.onKeyDown)==null||Y.call(m,F);let q=F.nativeEvent.isComposing||F.keyCode===229;if(!(F.defaultPrevented||q))switch(F.key){case"n":case"j":{g&&F.ctrlKey&&X(F);break}case"ArrowDown":{X(F);break}case"p":case"k":{g&&F.ctrlKey&&K(F);break}case"ArrowUp":{K(F);break}case"Home":{F.preventDefault(),O(0);break}case"End":{F.preventDefault(),j();break}case"Enter":{F.preventDefault();let Q=k();if(Q){let te=new Event(bE);Q.dispatchEvent(te)}}}}},_.createElement("label",{"cmdk-label":"",htmlFor:A.inputId,id:A.labelId,style:uJ},l),Sx(t,F=>_.createElement(cB.Provider,{value:T},_.createElement(lB.Provider,{value:A},F))))}),ZY=_.forwardRef((t,e)=>{var n,r;let i=sr(),o=_.useRef(null),a=_.useContext(uB),s=Rm(),l=fB(t),c=(r=(n=l.current)==null?void 0:n.forceMount)!=null?r:a==null?void 0:a.forceMount;Cc(()=>{if(!c)return s.item(i,a==null?void 0:a.id)},[c]);let u=hB(i,o,[t.value,t.children,o],t.keywords),d=TA(),f=dl(E=>E.value&&E.value===u.current),p=dl(E=>c||s.filter()===!1?!0:E.search?E.filtered.items.get(i)>0:!0);_.useEffect(()=>{let E=o.current;if(!(!E||t.disabled))return E.addEventListener(bE,y),()=>E.removeEventListener(bE,y)},[p,t.onSelect,t.disabled]);function y(){var E,T;v(),(T=(E=l.current).onSelect)==null||T.call(E,u.current)}function v(){d.setState("value",u.current,!0)}if(!p)return null;let{disabled:g,value:m,onSelect:x,forceMount:b,keywords:S,...w}=t;return _.createElement(nt.div,{ref:ts(o,e),...w,id:i,"cmdk-item":"",role:"option","aria-disabled":!!g,"aria-selected":!!f,"data-disabled":!!g,"data-selected":!!f,onPointerMove:g||s.getDisablePointerSelection()?void 0:v,onClick:g?void 0:y},t.children)}),QY=_.forwardRef((t,e)=>{let{heading:n,children:r,forceMount:i,...o}=t,a=sr(),s=_.useRef(null),l=_.useRef(null),c=sr(),u=Rm(),d=dl(p=>i||u.filter()===!1?!0:p.search?p.filtered.groups.has(a):!0);Cc(()=>u.group(a),[]),hB(a,s,[t.value,t.heading,l]);let f=_.useMemo(()=>({id:a,forceMount:i}),[i]);return _.createElement(nt.div,{ref:ts(s,e),...o,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},n&&_.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:c},n),Sx(t,p=>_.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?c:void 0},_.createElement(uB.Provider,{value:f},p))))}),eJ=_.forwardRef((t,e)=>{let{alwaysRender:n,...r}=t,i=_.useRef(null),o=dl(a=>!a.search);return!n&&!o?null:_.createElement(nt.div,{ref:ts(i,e),...r,"cmdk-separator":"",role:"separator"})}),tJ=_.forwardRef((t,e)=>{let{onValueChange:n,...r}=t,i=t.value!=null,o=TA(),a=dl(c=>c.search),s=dl(c=>c.selectedItemId),l=Rm();return _.useEffect(()=>{t.value!=null&&o.setState("search",t.value)},[t.value]),_.createElement(nt.input,{ref:e,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":s,id:l.inputId,type:"text",value:i?t.value:a,onChange:c=>{i||o.setState("search",c.target.value),n==null||n(c.target.value)}})}),nJ=_.forwardRef((t,e)=>{let{children:n,label:r="Suggestions",...i}=t,o=_.useRef(null),a=_.useRef(null),s=dl(c=>c.selectedItemId),l=Rm();return _.useEffect(()=>{if(a.current&&o.current){let c=a.current,u=o.current,d,f=new ResizeObserver(()=>{d=requestAnimationFrame(()=>{let p=c.offsetHeight;u.style.setProperty("--cmdk-list-height",p.toFixed(1)+"px")})});return f.observe(c),()=>{cancelAnimationFrame(d),f.unobserve(c)}}},[]),_.createElement(nt.div,{ref:ts(o,e),...i,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:l.listId},Sx(t,c=>_.createElement("div",{ref:ts(a,l.listInnerRef),"cmdk-list-sizer":""},c)))}),rJ=_.forwardRef((t,e)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:o,container:a,...s}=t;return _.createElement(lA,{open:n,onOpenChange:r},_.createElement(cA,{container:a},_.createElement(cx,{"cmdk-overlay":"",className:i}),_.createElement(ux,{"aria-label":t.label,"cmdk-dialog":"",className:o},_.createElement(dB,{ref:e,...s}))))}),iJ=_.forwardRef((t,e)=>dl(n=>n.filtered.count===0)?_.createElement(nt.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),oJ=_.forwardRef((t,e)=>{let{progress:n,children:r,label:i="Loading...",...o}=t;return _.createElement(nt.div,{ref:e,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},Sx(t,a=>_.createElement("div",{"aria-hidden":!0},a)))}),vi=Object.assign(dB,{List:nJ,Item:ZY,Input:tJ,Group:QY,Separator:eJ,Dialog:rJ,Empty:iJ,Loading:oJ});function aJ(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function sJ(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function fB(t){let e=_.useRef(t);return Cc(()=>{e.current=t}),e}var Cc=typeof window>"u"?_.useEffect:_.useLayoutEffect;function Au(t){let e=_.useRef();return e.current===void 0&&(e.current=t()),e}function dl(t){let e=TA(),n=()=>t(e.snapshot());return _.useSyncExternalStore(e.subscribe,n,n)}function hB(t,e,n,r=[]){let i=_.useRef(),o=Rm();return Cc(()=>{var a;let s=(()=>{var c;for(let u of n){if(typeof u=="string")return u.trim();if(typeof u=="object"&&"current"in u)return u.current?(c=u.current.textContent)==null?void 0:c.trim():i.current}})(),l=r.map(c=>c.trim());o.value(t,s,l),(a=e.current)==null||a.setAttribute(Mu,s),i.current=s}),i}var lJ=()=>{let[t,e]=_.useState(),n=Au(()=>new Map);return Cc(()=>{n.current.forEach(r=>r()),n.current=new Map},[t]),(r,i)=>{n.current.set(r,i),e({})}};function cJ(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function Sx({asChild:t,children:e},n){return t&&_.isValidElement(e)?_.cloneElement(cJ(e),{ref:e.ref},n(e.props.children)):n(e)}var uJ={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Ex=_.forwardRef(({className:t,...e},n)=>h.jsx(vi,{ref:n,className:He("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...e}));Ex.displayName=vi.displayName;const Tx=_.forwardRef(({className:t,...e},n)=>h.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[h.jsx(tA,{className:"mr-2 h-4 w-4 shrink-0 text-slate-400"}),h.jsx(vi.Input,{ref:n,className:He("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",t),...e})]}));Tx.displayName=vi.Input.displayName;const Mx=_.forwardRef(({className:t,...e},n)=>h.jsx(vi.List,{ref:n,className:He("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...e}));Mx.displayName=vi.List.displayName;const Ax=_.forwardRef((t,e)=>h.jsx(vi.Empty,{ref:e,className:"py-6 text-center text-sm",...t}));Ax.displayName=vi.Empty.displayName;const Ys=_.forwardRef(({className:t,...e},n)=>h.jsx(vi.Group,{ref:n,className:He("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",t),...e}));Ys.displayName=vi.Group.displayName;const dJ=_.forwardRef(({className:t,...e},n)=>h.jsx(vi.Separator,{ref:n,className:He("-mx-1 h-px bg-border",t),...e}));dJ.displayName=vi.Separator.displayName;const kd=_.forwardRef(({className:t,...e},n)=>h.jsx(vi.Item,{ref:n,className:He("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",t),...e}));kd.displayName=vi.Item.displayName;const fJ=({selectedName:t,availableNames:e,onSelect:n,onCreateNew:r,isLoading:i})=>{const[o,a]=_.useState(!1),[s,l]=_.useState(""),c=s.trim(),u=e.some(m=>m.toLowerCase()===c.toLowerCase()),d=c.length>0&&!u,f=!d,p=u?"Already exists":c===""?"Create new robotโ€ฆ":`Create "${c}"`,y=()=>{l(""),a(!1)},v=m=>{n(m),y()},g=async()=>{if(!d)return;await r(c)&&y()};return h.jsxs(_x,{open:o,onOpenChange:a,children:[h.jsx(wx,{asChild:!0,children:h.jsxs(et,{variant:"outline",role:"combobox","aria-expanded":o,disabled:i,className:"w-full justify-between bg-gray-900 border-gray-700 text-white hover:bg-gray-700 hover:text-white font-normal",children:[h.jsx("span",{className:He("truncate",t?"":"text-gray-400"),children:i?"Loading...":t??"Select a robot or type a new name"}),h.jsx(JM,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),h.jsx(Pm,{className:"p-0 bg-gray-800 border-gray-700 text-white",style:{width:"var(--radix-popover-trigger-width)"},align:"start",children:h.jsxs(Ex,{className:"bg-gray-800",children:[h.jsx(Tx,{placeholder:"Search or type new name...",value:s,onValueChange:l,onKeyDown:m=>{m.key==="Enter"&&d&&(m.preventDefault(),g())},className:"text-white"}),h.jsxs(Mx,{children:[e.length===0&&h.jsx(Ax,{className:"py-4 text-sm text-gray-400 text-center",children:"No robots yet. Type a name to create one."}),e.length>0&&h.jsx(Ys,{heading:"Existing",children:e.map(m=>h.jsxs(kd,{value:m,onSelect:()=>v(m),className:"text-white aria-selected:bg-gray-700",children:[h.jsx(yl,{className:He("mr-2 h-4 w-4",t===m?"opacity-100":"opacity-0")}),m]},m))})]}),h.jsxs("button",{type:"button",onClick:g,disabled:f,className:"flex w-full items-center gap-2 border-t border-gray-700 px-3 py-2 text-sm text-white hover:bg-gray-700 disabled:cursor-not-allowed disabled:text-gray-500 disabled:hover:bg-transparent",children:[h.jsx(eA,{className:"h-4 w-4"}),p]})]})})]})},hJ=({robot:t,selectedName:e,availableNames:n,isLoading:r,onSelect:i,onCreateNew:o,onConfigure:a,onTeleop:s,onDelete:l})=>{const[c,u]=_.useState(!1),d=t?t.is_clean?"Ready":"Needs configuration":null,f=!t||!t.is_clean;return h.jsxs("div",{className:"bg-gray-800 rounded-lg border border-gray-700 p-3 flex flex-col gap-2 relative",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("div",{className:"flex-1 min-w-0",children:h.jsx(fJ,{selectedName:e,availableNames:n,onSelect:i,onCreateNew:o,isLoading:r})}),d&&h.jsx("p",{className:`text-xs truncate shrink-0 ${t.is_clean?"text-green-400":"text-amber-400"}`,children:d}),t&&h.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[h.jsxs(jv,{children:[h.jsx(Uv,{asChild:!0,children:h.jsx(et,{size:"icon",variant:"ghost",className:"h-8 w-8 text-gray-300 hover:text-white",onClick:()=>a(t.name),"aria-label":"Configure",children:h.jsx(Mh,{className:"w-4 h-4"})})}),h.jsx(Vh,{children:"Configure (calibrate)"})]}),h.jsxs(jv,{children:[h.jsx(Uv,{asChild:!0,children:h.jsx(et,{size:"icon",variant:"ghost",className:"h-8 w-8 text-red-400 hover:text-red-300 hover:bg-red-900/20",onClick:()=>u(!0),"aria-label":"Delete robot",children:h.jsx(nA,{className:"w-4 h-4"})})}),h.jsx(Vh,{children:"Delete robot config"})]})]})]}),t&&h.jsxs(jv,{children:[h.jsx(Uv,{asChild:!0,children:h.jsx("div",{className:"w-full",children:h.jsx(et,{onClick:()=>s(t),disabled:f,className:`w-full ${f?"bg-red-500/30 hover:bg-red-500/30 text-red-200 cursor-not-allowed":"bg-yellow-500 hover:bg-yellow-600 text-white"}`,children:"Teleoperation"})})}),f&&h.jsx(Vh,{children:"Configure the robot first."})]}),t&&h.jsx(Hc,{open:c,onOpenChange:u,children:h.jsxs(xl,{className:"bg-gray-900 border-gray-800 text-white",children:[h.jsxs(bl,{children:[h.jsx(_l,{children:"Delete robot config?"}),h.jsx(wl,{className:"text-gray-400",children:"This deletes the robot config file from disk. Calibration files are not removed. This cannot be undone."})]}),h.jsxs(bF,{className:"flex gap-2 justify-end",children:[h.jsx(et,{variant:"outline",className:"border-gray-600 text-gray-300",onClick:()=>u(!1),children:"Cancel"}),h.jsx(et,{className:"bg-red-500 hover:bg-red-600 text-white",onClick:async()=>{u(!1),await l(t.name)},children:"Delete"})]})]})})]})},pJ=({selectedName:t,selectedRecord:e,availableNames:n,isLoading:r,selectRobot:i,createRobot:o,deleteRobot:a})=>{const s=ji(),{baseUrl:l,fetchWithHeaders:c}=Ln(),{toast:u}=Dr(),d=p=>{s("/calibration",{state:{robot_name:p}})},f=async p=>{try{const y=await c(`${l}/move-arm`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({leader_port:p.leader_port,follower_port:p.follower_port,leader_config:p.leader_config,follower_config:p.follower_config})}),v=await y.json();y.ok?(u({title:"Teleoperation Started",description:v.message||`Started teleoperation for ${p.name}.`}),s("/teleoperation")):u({title:"Error Starting Teleoperation",description:v.message||"Failed to start.",variant:"destructive"})}catch{u({title:"Connection Error",description:"Could not connect to the backend server.",variant:"destructive"})}};return h.jsx(hJ,{robot:e,selectedName:t,availableNames:n,isLoading:r,onSelect:i,onCreateNew:o,onConfigure:d,onTeleop:f,onDelete:a})},hi=_.forwardRef(({className:t,type:e,...n},r)=>h.jsx("input",{type:e,className:He("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:r,...n}));hi.displayName="Input";const mr=_.forwardRef(({value:t,onChange:e,integer:n=!0,className:r,...i},o)=>{const[a,s]=_.useState(t==null?"":String(t)),l=_.useRef(t);return _.useEffect(()=>{t!==l.current&&(l.current=t,s(t==null?"":String(t)))},[t]),h.jsx(hi,{ref:o,type:"number",inputMode:n?"numeric":"decimal",value:a,onChange:c=>{const u=c.target.value;if(s(u),u===""){e(void 0);return}const d=n?parseInt(u,10):parseFloat(u);Number.isFinite(d)&&e(d)},className:He("[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:m-0 [&::-webkit-outer-spin-button]:m-0",r),...i})});mr.displayName="NumberInput";var mJ="Label",pB=_.forwardRef((t,e)=>h.jsx(nt.label,{...t,ref:e,onMouseDown:n=>{var i;n.target.closest("button, input, select, textarea")||((i=t.onMouseDown)==null||i.call(t,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));pB.displayName=mJ;var mB=pB;const gJ=Sm("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Nt=_.forwardRef(({className:t,...e},n)=>h.jsx(mB,{ref:n,className:He(gJ(),t),...e}));Nt.displayName=mB.displayName;function MA(t){const e=_.useRef({value:t,previous:t});return _.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var Cx="Checkbox",[vJ,vDe]=mi(Cx),[yJ,AA]=vJ(Cx);function xJ(t){const{__scopeCheckbox:e,checked:n,children:r,defaultChecked:i,disabled:o,form:a,name:s,onCheckedChange:l,required:c,value:u="on",internal_do_not_use_render:d}=t,[f,p]=$o({prop:n,defaultProp:i??!1,onChange:l,caller:Cx}),[y,v]=_.useState(null),[g,m]=_.useState(null),x=_.useRef(!1),b=y?!!a||!!y.closest("form"):!0,S={checked:f,disabled:o,setChecked:p,control:y,setControl:v,name:s,form:a,value:u,hasConsumerStoppedPropagationRef:x,required:c,defaultChecked:Js(i)?!1:i,isFormControl:b,bubbleInput:g,setBubbleInput:m};return h.jsx(yJ,{scope:e,...S,children:bJ(d)?d(S):r})}var gB="CheckboxTrigger",vB=_.forwardRef(({__scopeCheckbox:t,onKeyDown:e,onClick:n,...r},i)=>{const{control:o,value:a,disabled:s,checked:l,required:c,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,isFormControl:p,bubbleInput:y}=AA(gB,t),v=Ot(i,u),g=_.useRef(l);return _.useEffect(()=>{const m=o==null?void 0:o.form;if(m){const x=()=>d(g.current);return m.addEventListener("reset",x),()=>m.removeEventListener("reset",x)}},[o,d]),h.jsx(nt.button,{type:"button",role:"checkbox","aria-checked":Js(l)?"mixed":l,"aria-required":c,"data-state":wB(l),"data-disabled":s?"":void 0,disabled:s,value:a,...r,ref:v,onKeyDown:Oe(e,m=>{m.key==="Enter"&&m.preventDefault()}),onClick:Oe(n,m=>{d(x=>Js(x)?!0:!x),y&&p&&(f.current=m.isPropagationStopped(),f.current||m.stopPropagation())})})});vB.displayName=gB;var CA=_.forwardRef((t,e)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:o,required:a,disabled:s,value:l,onCheckedChange:c,form:u,...d}=t;return h.jsx(xJ,{__scopeCheckbox:n,checked:i,defaultChecked:o,disabled:s,required:a,onCheckedChange:c,name:r,form:u,value:l,internal_do_not_use_render:({isFormControl:f})=>h.jsxs(h.Fragment,{children:[h.jsx(vB,{...d,ref:e,__scopeCheckbox:n}),f&&h.jsx(_B,{__scopeCheckbox:n})]})})});CA.displayName=Cx;var yB="CheckboxIndicator",xB=_.forwardRef((t,e)=>{const{__scopeCheckbox:n,forceMount:r,...i}=t,o=AA(yB,n);return h.jsx(gi,{present:r||Js(o.checked)||o.checked===!0,children:h.jsx(nt.span,{"data-state":wB(o.checked),"data-disabled":o.disabled?"":void 0,...i,ref:e,style:{pointerEvents:"none",...t.style}})})});xB.displayName=yB;var bB="CheckboxBubbleInput",_B=_.forwardRef(({__scopeCheckbox:t,...e},n)=>{const{control:r,hasConsumerStoppedPropagationRef:i,checked:o,defaultChecked:a,required:s,disabled:l,name:c,value:u,form:d,bubbleInput:f,setBubbleInput:p}=AA(bB,t),y=Ot(n,p),v=MA(o),g=bA(r);_.useEffect(()=>{const x=f;if(!x)return;const b=window.HTMLInputElement.prototype,w=Object.getOwnPropertyDescriptor(b,"checked").set,E=!i.current;if(v!==o&&w){const T=new Event("click",{bubbles:E});x.indeterminate=Js(o),w.call(x,Js(o)?!1:o),x.dispatchEvent(T)}},[f,v,o,i]);const m=_.useRef(Js(o)?!1:o);return h.jsx(nt.input,{type:"checkbox","aria-hidden":!0,defaultChecked:a??m.current,required:s,disabled:l,name:c,value:u,form:d,...e,tabIndex:-1,ref:y,style:{...e.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});_B.displayName=bB;function bJ(t){return typeof t=="function"}function Js(t){return t==="indeterminate"}function wB(t){return Js(t)?"indeterminate":t?"checked":"unchecked"}const PA=_.forwardRef(({className:t,...e},n)=>h.jsx(CA,{ref:n,className:He("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",t),...e,children:h.jsx(xB,{className:He("flex items-center justify-center text-current"),children:h.jsx(yl,{className:"h-4 w-4"})})}));PA.displayName=CA.displayName;var Px="Collapsible",[_J,yDe]=mi(Px),[wJ,RA]=_J(Px),SB=_.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:a,...s}=t,[l,c]=$o({prop:r,defaultProp:i??!1,onChange:a,caller:Px});return h.jsx(wJ,{scope:n,disabled:o,contentId:sr(),open:l,onOpenToggle:_.useCallback(()=>c(u=>!u),[c]),children:h.jsx(nt.div,{"data-state":OA(l),"data-disabled":o?"":void 0,...s,ref:e})})});SB.displayName=Px;var EB="CollapsibleTrigger",TB=_.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,i=RA(EB,n);return h.jsx(nt.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":OA(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:e,onClick:Oe(t.onClick,i.onOpenToggle)})});TB.displayName=EB;var NA="CollapsibleContent",MB=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=RA(NA,t.__scopeCollapsible);return h.jsx(gi,{present:n||i.open,children:({present:o})=>h.jsx(SJ,{...r,ref:e,present:o})})});MB.displayName=NA;var SJ=_.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=t,a=RA(NA,n),[s,l]=_.useState(r),c=_.useRef(null),u=Ot(e,c),d=_.useRef(0),f=d.current,p=_.useRef(0),y=p.current,v=a.open||s,g=_.useRef(v),m=_.useRef(void 0);return _.useEffect(()=>{const x=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(x)},[]),ur(()=>{const x=c.current;if(x){m.current=m.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";const b=x.getBoundingClientRect();d.current=b.height,p.current=b.width,g.current||(x.style.transitionDuration=m.current.transitionDuration,x.style.animationName=m.current.animationName),l(r)}},[a.open,r]),h.jsx(nt.div,{"data-state":OA(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!v,...o,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":y?`${y}px`:void 0,...t.style},children:v&&i})});function OA(t){return t?"open":"closed"}var EJ=SB;const Sy=EJ,Ey=TB,Ty=MB,TJ=Sm("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Mi=_.forwardRef(({className:t,variant:e,...n},r)=>h.jsx("div",{ref:r,role:"alert",className:He(TJ({variant:e}),t),...n}));Mi.displayName="Alert";const MJ=_.forwardRef(({className:t,...e},n)=>h.jsx("h5",{ref:n,className:He("mb-1 font-medium leading-none tracking-tight",t),...e}));MJ.displayName="AlertTitle";const Ai=_.forwardRef(({className:t,...e},n)=>h.jsx("div",{ref:n,className:He("text-sm [&_p]:leading-relaxed",t),...e}));Ai.displayName="AlertDescription";function EN(t,[e,n]){return Math.min(n,Math.max(e,t))}var AJ=_.createContext(void 0);function IA(t){const e=_.useContext(AJ);return t||e||"ltr"}var CJ=[" ","Enter","ArrowUp","ArrowDown"],PJ=[" ","Enter"],Pc="Select",[Rx,Nx,RJ]=tx(Pc),[wf,xDe]=mi(Pc,[RJ,Sl]),Ox=Sl(),[NJ,Tl]=wf(Pc),[OJ,IJ]=wf(Pc),AB=t=>{const{__scopeSelect:e,children:n,open:r,defaultOpen:i,onOpenChange:o,value:a,defaultValue:s,onValueChange:l,dir:c,name:u,autoComplete:d,disabled:f,required:p,form:y}=t,v=Ox(e),[g,m]=_.useState(null),[x,b]=_.useState(null),[S,w]=_.useState(!1),E=IA(c),[T,A]=$o({prop:r,defaultProp:i??!1,onChange:o,caller:Pc}),[M,C]=$o({prop:a,defaultProp:s,onChange:l,caller:Pc}),P=_.useRef(null),R=g?y||!!g.closest("form"):!0,[D,k]=_.useState(new Set),U=Array.from(D).map(O=>O.props.value).join(";");return h.jsx(px,{...v,children:h.jsxs(NJ,{required:p,scope:e,trigger:g,onTriggerChange:m,valueNode:x,onValueNodeChange:b,valueNodeHasChildren:S,onValueNodeHasChildrenChange:w,contentId:sr(),value:M,onValueChange:C,open:T,onOpenChange:A,dir:E,triggerPointerDownPosRef:P,disabled:f,children:[h.jsx(Rx.Provider,{scope:e,children:h.jsx(OJ,{scope:t.__scopeSelect,onNativeOptionAdd:_.useCallback(O=>{k(W=>new Set(W).add(O))},[]),onNativeOptionRemove:_.useCallback(O=>{k(W=>{const L=new Set(W);return L.delete(O),L})},[]),children:n})}),R?h.jsxs(JB,{"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:d,value:M,onChange:O=>C(O.target.value),disabled:f,form:y,children:[M===void 0?h.jsx("option",{value:""}):null,Array.from(D)]},U):null]})})};AB.displayName=Pc;var CB="SelectTrigger",PB=_.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:r=!1,...i}=t,o=Ox(n),a=Tl(CB,n),s=a.disabled||r,l=Ot(e,a.onTriggerChange),c=Nx(n),u=_.useRef("touch"),[d,f,p]=QB(v=>{const g=c().filter(b=>!b.disabled),m=g.find(b=>b.value===a.value),x=e4(g,v,m);x!==void 0&&a.onValueChange(x.value)}),y=v=>{s||(a.onOpenChange(!0),p()),v&&(a.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})};return h.jsx(Am,{asChild:!0,...o,children:h.jsx(nt.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":ZB(a.value)?"":void 0,...i,ref:l,onClick:Oe(i.onClick,v=>{v.currentTarget.focus(),u.current!=="mouse"&&y(v)}),onPointerDown:Oe(i.onPointerDown,v=>{u.current=v.pointerType;const g=v.target;g.hasPointerCapture(v.pointerId)&&g.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(y(v),v.preventDefault())}),onKeyDown:Oe(i.onKeyDown,v=>{const g=d.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&f(v.key),!(g&&v.key===" ")&&CJ.includes(v.key)&&(y(),v.preventDefault())})})})});PB.displayName=CB;var RB="SelectValue",NB=_.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:a="",...s}=t,l=Tl(RB,n),{onValueNodeHasChildrenChange:c}=l,u=o!==void 0,d=Ot(e,l.onValueNodeChange);return ur(()=>{c(u)},[c,u]),h.jsx(nt.span,{...s,ref:d,style:{pointerEvents:"none"},children:ZB(l.value)?h.jsx(h.Fragment,{children:a}):o})});NB.displayName=RB;var DJ="SelectIcon",OB=_.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,...i}=t;return h.jsx(nt.span,{"aria-hidden":!0,...i,ref:e,children:r||"โ–ผ"})});OB.displayName=DJ;var LJ="SelectPortal",IB=t=>h.jsx(vf,{asChild:!0,...t});IB.displayName=LJ;var Rc="SelectContent",DB=_.forwardRef((t,e)=>{const n=Tl(Rc,t.__scopeSelect),[r,i]=_.useState();if(ur(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?Bc.createPortal(h.jsx(LB,{scope:t.__scopeSelect,children:h.jsx(Rx.Slot,{scope:t.__scopeSelect,children:h.jsx("div",{children:t.children})})}),o):null}return h.jsx(kB,{...t,ref:e})});DB.displayName=Rc;var vo=10,[LB,Ml]=wf(Rc),kJ="SelectContentImpl",jJ=al("SelectContent.RemoveScroll"),kB=_.forwardRef((t,e)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:a,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:y,hideWhenDetached:v,avoidCollisions:g,...m}=t,x=Tl(Rc,n),[b,S]=_.useState(null),[w,E]=_.useState(null),T=Ot(e,ee=>S(ee)),[A,M]=_.useState(null),[C,P]=_.useState(null),R=Nx(n),[D,k]=_.useState(!1),U=_.useRef(!1);_.useEffect(()=>{if(b)return sx(b)},[b]),ox();const O=_.useCallback(ee=>{const[ce,...ae]=R().map(le=>le.ref.current),[fe]=ae.slice(-1),we=document.activeElement;for(const le of ee)if(le===we||(le==null||le.scrollIntoView({block:"nearest"}),le===ce&&w&&(w.scrollTop=0),le===fe&&w&&(w.scrollTop=w.scrollHeight),le==null||le.focus(),document.activeElement!==we))return},[R,w]),W=_.useCallback(()=>O([A,b]),[O,A,b]);_.useEffect(()=>{D&&W()},[D,W]);const{onOpenChange:L,triggerPointerDownPosRef:j}=x;_.useEffect(()=>{if(b){let ee={x:0,y:0};const ce=fe=>{var we,le;ee={x:Math.abs(Math.round(fe.pageX)-(((we=j.current)==null?void 0:we.x)??0)),y:Math.abs(Math.round(fe.pageY)-(((le=j.current)==null?void 0:le.y)??0))}},ae=fe=>{ee.x<=10&&ee.y<=10?fe.preventDefault():b.contains(fe.target)||L(!1),document.removeEventListener("pointermove",ce),j.current=null};return j.current!==null&&(document.addEventListener("pointermove",ce),document.addEventListener("pointerup",ae,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ce),document.removeEventListener("pointerup",ae,{capture:!0})}}},[b,L,j]),_.useEffect(()=>{const ee=()=>L(!1);return window.addEventListener("blur",ee),window.addEventListener("resize",ee),()=>{window.removeEventListener("blur",ee),window.removeEventListener("resize",ee)}},[L]);const[X,K]=QB(ee=>{const ce=R().filter(we=>!we.disabled),ae=ce.find(we=>we.ref.current===document.activeElement),fe=e4(ce,ee,ae);fe&&setTimeout(()=>fe.ref.current.focus())}),F=_.useCallback((ee,ce,ae)=>{const fe=!U.current&&!ae;(x.value!==void 0&&x.value===ce||fe)&&(M(ee),fe&&(U.current=!0))},[x.value]),Y=_.useCallback(()=>b==null?void 0:b.focus(),[b]),q=_.useCallback((ee,ce,ae)=>{const fe=!U.current&&!ae;(x.value!==void 0&&x.value===ce||fe)&&P(ee)},[x.value]),Q=r==="popper"?_E:jB,te=Q===_E?{side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:y,hideWhenDetached:v,avoidCollisions:g}:{};return h.jsx(LB,{scope:n,content:b,viewport:w,onViewportChange:E,itemRefCallback:F,selectedItem:A,onItemLeave:Y,itemTextRefCallback:q,focusSelectedItem:W,selectedItemText:C,position:r,isPositioned:D,searchRef:X,children:h.jsx(Tm,{as:jJ,allowPinchZoom:!0,children:h.jsx(Em,{asChild:!0,trapped:x.open,onMountAutoFocus:ee=>{ee.preventDefault()},onUnmountAutoFocus:Oe(i,ee=>{var ce;(ce=x.trigger)==null||ce.focus({preventScroll:!0}),ee.preventDefault()}),children:h.jsx(zc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:ee=>ee.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:h.jsx(Q,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:ee=>ee.preventDefault(),...m,...te,onPlaced:()=>k(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...m.style},onKeyDown:Oe(m.onKeyDown,ee=>{const ce=ee.ctrlKey||ee.altKey||ee.metaKey;if(ee.key==="Tab"&&ee.preventDefault(),!ce&&ee.key.length===1&&K(ee.key),["ArrowUp","ArrowDown","Home","End"].includes(ee.key)){let fe=R().filter(we=>!we.disabled).map(we=>we.ref.current);if(["ArrowUp","End"].includes(ee.key)&&(fe=fe.slice().reverse()),["ArrowUp","ArrowDown"].includes(ee.key)){const we=ee.target,le=fe.indexOf(we);fe=fe.slice(le+1)}setTimeout(()=>O(fe)),ee.preventDefault()}})})})})})})});kB.displayName=kJ;var UJ="SelectItemAlignedPosition",jB=_.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:r,...i}=t,o=Tl(Rc,n),a=Ml(Rc,n),[s,l]=_.useState(null),[c,u]=_.useState(null),d=Ot(e,T=>u(T)),f=Nx(n),p=_.useRef(!1),y=_.useRef(!0),{viewport:v,selectedItem:g,selectedItemText:m,focusSelectedItem:x}=a,b=_.useCallback(()=>{if(o.trigger&&o.valueNode&&s&&c&&v&&g&&m){const T=o.trigger.getBoundingClientRect(),A=c.getBoundingClientRect(),M=o.valueNode.getBoundingClientRect(),C=m.getBoundingClientRect();if(o.dir!=="rtl"){const we=C.left-A.left,le=M.left-we,ie=T.left-le,G=T.width+ie,Ve=Math.max(G,A.width),Ne=window.innerWidth-vo,st=EN(le,[vo,Math.max(vo,Ne-Ve)]);s.style.minWidth=G+"px",s.style.left=st+"px"}else{const we=A.right-C.right,le=window.innerWidth-M.right-we,ie=window.innerWidth-T.right-le,G=T.width+ie,Ve=Math.max(G,A.width),Ne=window.innerWidth-vo,st=EN(le,[vo,Math.max(vo,Ne-Ve)]);s.style.minWidth=G+"px",s.style.right=st+"px"}const P=f(),R=window.innerHeight-vo*2,D=v.scrollHeight,k=window.getComputedStyle(c),U=parseInt(k.borderTopWidth,10),O=parseInt(k.paddingTop,10),W=parseInt(k.borderBottomWidth,10),L=parseInt(k.paddingBottom,10),j=U+O+D+L+W,X=Math.min(g.offsetHeight*5,j),K=window.getComputedStyle(v),F=parseInt(K.paddingTop,10),Y=parseInt(K.paddingBottom,10),q=T.top+T.height/2-vo,Q=R-q,te=g.offsetHeight/2,ee=g.offsetTop+te,ce=U+O+ee,ae=j-ce;if(ce<=q){const we=P.length>0&&g===P[P.length-1].ref.current;s.style.bottom="0px";const le=c.clientHeight-v.offsetTop-v.offsetHeight,ie=Math.max(Q,te+(we?Y:0)+le+W),G=ce+ie;s.style.height=G+"px"}else{const we=P.length>0&&g===P[0].ref.current;s.style.top="0px";const ie=Math.max(q,U+v.offsetTop+(we?F:0)+te)+ae;s.style.height=ie+"px",v.scrollTop=ce-q+v.offsetTop}s.style.margin=`${vo}px 0`,s.style.minHeight=X+"px",s.style.maxHeight=R+"px",r==null||r(),requestAnimationFrame(()=>p.current=!0)}},[f,o.trigger,o.valueNode,s,c,v,g,m,o.dir,r]);ur(()=>b(),[b]);const[S,w]=_.useState();ur(()=>{c&&w(window.getComputedStyle(c).zIndex)},[c]);const E=_.useCallback(T=>{T&&y.current===!0&&(b(),x==null||x(),y.current=!1)},[b,x]);return h.jsx(BJ,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:E,children:h.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:h.jsx(nt.div,{...i,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});jB.displayName=UJ;var FJ="SelectPopperPosition",_E=_.forwardRef((t,e)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=vo,...o}=t,a=Ox(n);return h.jsx(mx,{...a,...o,ref:e,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});_E.displayName=FJ;var[BJ,DA]=wf(Rc,{}),wE="SelectViewport",UB=_.forwardRef((t,e)=>{const{__scopeSelect:n,nonce:r,...i}=t,o=Ml(wE,n),a=DA(wE,n),s=Ot(e,o.onViewportChange),l=_.useRef(0);return h.jsxs(h.Fragment,{children:[h.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),h.jsx(Rx.Slot,{scope:n,children:h.jsx(nt.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Oe(i.onScroll,c=>{const u=c.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:f}=a;if(f!=null&&f.current&&d){const p=Math.abs(l.current-u.scrollTop);if(p>0){const y=window.innerHeight-vo*2,v=parseFloat(d.style.minHeight),g=parseFloat(d.style.height),m=Math.max(v,g);if(m0?S:0,d.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});UB.displayName=wE;var FB="SelectGroup",[$J,zJ]=wf(FB),HJ=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=sr();return h.jsx($J,{scope:n,id:i,children:h.jsx(nt.div,{role:"group","aria-labelledby":i,...r,ref:e})})});HJ.displayName=FB;var BB="SelectLabel",$B=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=zJ(BB,n);return h.jsx(nt.div,{id:i.id,...r,ref:e})});$B.displayName=BB;var My="SelectItem",[VJ,zB]=wf(My),HB=_.forwardRef((t,e)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...a}=t,s=Tl(My,n),l=Ml(My,n),c=s.value===r,[u,d]=_.useState(o??""),[f,p]=_.useState(!1),y=Ot(e,x=>{var b;return(b=l.itemRefCallback)==null?void 0:b.call(l,x,r,i)}),v=sr(),g=_.useRef("touch"),m=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return h.jsx(VJ,{scope:n,value:r,disabled:i,textId:v,isSelected:c,onItemTextChange:_.useCallback(x=>{d(b=>b||((x==null?void 0:x.textContent)??"").trim())},[]),children:h.jsx(Rx.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:h.jsx(nt.div,{role:"option","aria-labelledby":v,"data-highlighted":f?"":void 0,"aria-selected":c&&f,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...a,ref:y,onFocus:Oe(a.onFocus,()=>p(!0)),onBlur:Oe(a.onBlur,()=>p(!1)),onClick:Oe(a.onClick,()=>{g.current!=="mouse"&&m()}),onPointerUp:Oe(a.onPointerUp,()=>{g.current==="mouse"&&m()}),onPointerDown:Oe(a.onPointerDown,x=>{g.current=x.pointerType}),onPointerMove:Oe(a.onPointerMove,x=>{var b;g.current=x.pointerType,i?(b=l.onItemLeave)==null||b.call(l):g.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Oe(a.onPointerLeave,x=>{var b;x.currentTarget===document.activeElement&&((b=l.onItemLeave)==null||b.call(l))}),onKeyDown:Oe(a.onKeyDown,x=>{var S;((S=l.searchRef)==null?void 0:S.current)!==""&&x.key===" "||(PJ.includes(x.key)&&m(),x.key===" "&&x.preventDefault())})})})})});HB.displayName=My;var Ah="SelectItemText",VB=_.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:i,...o}=t,a=Tl(Ah,n),s=Ml(Ah,n),l=zB(Ah,n),c=IJ(Ah,n),[u,d]=_.useState(null),f=Ot(e,m=>d(m),l.onItemTextChange,m=>{var x;return(x=s.itemTextRefCallback)==null?void 0:x.call(s,m,l.value,l.disabled)}),p=u==null?void 0:u.textContent,y=_.useMemo(()=>h.jsx("option",{value:l.value,disabled:l.disabled,children:p},l.value),[l.disabled,l.value,p]),{onNativeOptionAdd:v,onNativeOptionRemove:g}=c;return ur(()=>(v(y),()=>g(y)),[v,g,y]),h.jsxs(h.Fragment,{children:[h.jsx(nt.span,{id:l.textId,...o,ref:f}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Bc.createPortal(o.children,a.valueNode):null]})});VB.displayName=Ah;var GB="SelectItemIndicator",WB=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return zB(GB,n).isSelected?h.jsx(nt.span,{"aria-hidden":!0,...r,ref:e}):null});WB.displayName=GB;var SE="SelectScrollUpButton",XB=_.forwardRef((t,e)=>{const n=Ml(SE,t.__scopeSelect),r=DA(SE,t.__scopeSelect),[i,o]=_.useState(!1),a=Ot(e,r.onScrollButtonChange);return ur(()=>{if(n.viewport&&n.isPositioned){let s=function(){const c=l.scrollTop>0;o(c)};const l=n.viewport;return s(),l.addEventListener("scroll",s),()=>l.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?h.jsx(KB,{...t,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop-l.offsetHeight)}}):null});XB.displayName=SE;var EE="SelectScrollDownButton",qB=_.forwardRef((t,e)=>{const n=Ml(EE,t.__scopeSelect),r=DA(EE,t.__scopeSelect),[i,o]=_.useState(!1),a=Ot(e,r.onScrollButtonChange);return ur(()=>{if(n.viewport&&n.isPositioned){let s=function(){const c=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)l.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?h.jsx(KB,{...t,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop+l.offsetHeight)}}):null});qB.displayName=EE;var KB=_.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=t,o=Ml("SelectScrollButton",n),a=_.useRef(null),s=Nx(n),l=_.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return _.useEffect(()=>()=>l(),[l]),ur(()=>{var u;const c=s().find(d=>d.ref.current===document.activeElement);(u=c==null?void 0:c.ref.current)==null||u.scrollIntoView({block:"nearest"})},[s]),h.jsx(nt.div,{"aria-hidden":!0,...i,ref:e,style:{flexShrink:0,...i.style},onPointerDown:Oe(i.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:Oe(i.onPointerMove,()=>{var c;(c=o.onItemLeave)==null||c.call(o),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:Oe(i.onPointerLeave,()=>{l()})})}),GJ="SelectSeparator",YB=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return h.jsx(nt.div,{"aria-hidden":!0,...r,ref:e})});YB.displayName=GJ;var TE="SelectArrow",WJ=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=Ox(n),o=Tl(TE,n),a=Ml(TE,n);return o.open&&a.position==="popper"?h.jsx(gx,{...i,...r,ref:e}):null});WJ.displayName=TE;var XJ="SelectBubbleInput",JB=_.forwardRef(({__scopeSelect:t,value:e,...n},r)=>{const i=_.useRef(null),o=Ot(r,i),a=MA(e);return _.useEffect(()=>{const s=i.current;if(!s)return;const l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==e&&u){const d=new Event("change",{bubbles:!0});u.call(s,e),s.dispatchEvent(d)}},[a,e]),h.jsx(nt.select,{...n,style:{...uU,...n.style},ref:o,defaultValue:e})});JB.displayName=XJ;function ZB(t){return t===""||t===void 0}function QB(t){const e=di(t),n=_.useRef(""),r=_.useRef(0),i=_.useCallback(a=>{const s=n.current+a;e(s),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(s)},[e]),o=_.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return _.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function e4(t,e,n){const i=e.length>1&&Array.from(e).every(c=>c===e[0])?e[0]:e,o=n?t.indexOf(n):-1;let a=qJ(t,Math.max(o,0));i.length===1&&(a=a.filter(c=>c!==n));const l=a.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function qJ(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var KJ=AB,t4=PB,YJ=NB,JJ=OB,ZJ=IB,n4=DB,QJ=UB,r4=$B,i4=HB,eZ=VB,tZ=WB,o4=XB,a4=qB,s4=YB;const Zs=KJ,Qs=YJ,Wa=_.forwardRef(({className:t,children:e,...n},r)=>h.jsxs(t4,{ref:r,className:He("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...n,children:[e,h.jsx(JJ,{asChild:!0,children:h.jsx(hc,{className:"h-4 w-4 text-slate-400"})})]}));Wa.displayName=t4.displayName;const l4=_.forwardRef(({className:t,...e},n)=>h.jsx(o4,{ref:n,className:He("flex cursor-default items-center justify-center py-1",t),...e,children:h.jsx(z7,{className:"h-4 w-4"})}));l4.displayName=o4.displayName;const c4=_.forwardRef(({className:t,...e},n)=>h.jsx(a4,{ref:n,className:He("flex cursor-default items-center justify-center py-1",t),...e,children:h.jsx(hc,{className:"h-4 w-4"})}));c4.displayName=a4.displayName;const Xa=_.forwardRef(({className:t,children:e,position:n="popper",...r},i)=>h.jsx(ZJ,{children:h.jsxs(n4,{ref:i,className:He("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:n,...r,children:[h.jsx(l4,{}),h.jsx(QJ,{className:He("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),h.jsx(c4,{})]})}));Xa.displayName=n4.displayName;const nZ=_.forwardRef(({className:t,...e},n)=>h.jsx(r4,{ref:n,className:He("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...e}));nZ.displayName=r4.displayName;const _n=_.forwardRef(({className:t,children:e,...n},r)=>h.jsxs(i4,{ref:r,className:He("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[h.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:h.jsx(tZ,{children:h.jsx(yl,{className:"h-4 w-4"})})}),h.jsx(eZ,{children:e})]}));_n.displayName=i4.displayName;const rZ=_.forwardRef(({className:t,...e},n)=>h.jsx(s4,{ref:n,className:He("-mx-1 my-1 h-px bg-muted",t),...e}));rZ.displayName=s4.displayName;const th=t=>t.toLowerCase().replace(/\s+/g," ").trim();function u4({enabled:t=!0}={}){const{baseUrl:e,fetchWithHeaders:n}=Ln(),[r,i]=_.useState([]),[o,a]=_.useState(!1),s=_.useCallback(async()=>{a(!0);try{try{(await navigator.mediaDevices.getUserMedia({video:!0})).getTracks().forEach(v=>v.stop())}catch{}const l=(await navigator.mediaDevices.enumerateDevices()).filter(y=>y.kind==="videoinput").map(y=>({deviceId:y.deviceId,label:y.label})),c=await n(`${e}/available-cameras`);if(!c.ok)return i([]),[];const d=(await c.json()).cameras??[],f=new Set,p=d.map(y=>{const v=y.name||`Camera ${y.index}`,g=th(v),m=l.filter(b=>!f.has(b.deviceId)&&b.label),x=m.find(b=>th(b.label)===g)||m.find(b=>th(b.label).startsWith(g))||m.find(b=>th(b.label).includes(g)||g.includes(th(b.label)));return x&&f.add(x.deviceId),{index:y.index,name:v,deviceId:(x==null?void 0:x.deviceId)??"",available:y.available}});return i(p),p}catch{return i([]),[]}finally{a(!1)}},[e,n]);return _.useEffect(()=>{if(!t)return;s();const l=()=>s();return navigator.mediaDevices.addEventListener("devicechange",l),()=>navigator.mediaDevices.removeEventListener("devicechange",l)},[t,s]),{cameras:r,isLoading:o,refresh:s}}function d4(t,e){const n=_.useRef(null),[r,i]=_.useState(!1);return _.useEffect(()=>{if(e||!t){t||i(!0);return}let o=!1,a=null;return i(!1),(async()=>{try{if(a=await navigator.mediaDevices.getUserMedia({video:{deviceId:{exact:t}}}),o){a.getTracks().forEach(s=>s.stop());return}n.current&&(n.current.srcObject=a,await n.current.play().catch(()=>{}))}catch{i(!0)}})(),()=>{o=!0,a&&a.getTracks().forEach(s=>s.stop())}},[t,e]),{videoRef:n,hasError:r}}const f4=({cameras:t,onCamerasChange:e,releaseStreamsRef:n})=>{const{toast:r}=Dr(),{cameras:i,isLoading:o}=u4(),[a,s]=_.useState(""),[l,c]=_.useState("");_.useEffect(()=>{if(i.length===0||t.length===0)return;let g=!1;const m=t.map(x=>{if(!x.device_id)return x;const b=i.find(S=>S.deviceId===x.device_id);return b&&b.index!==x.camera_index?(g=!0,{...x,camera_index:b.index}):x});g&&e(m)},[i]);const u=()=>{if(!a||!l.trim()){r({title:"Missing Information",description:"Please select a camera and provide a name.",variant:"destructive"});return}const g=parseInt(a),m=i.find(S=>S.index===g);if(!m){r({title:"Invalid Camera",description:"Selected camera is not available.",variant:"destructive"});return}if(t.some(S=>S.camera_index===m.index||m.deviceId&&S.device_id===m.deviceId)){r({title:"Camera Already Added",description:"This camera is already in the configuration.",variant:"destructive"});return}const b={id:`camera_${Date.now()}`,name:l.trim(),type:"opencv",camera_index:m.index,device_id:m.deviceId,width:640,height:480,fps:30};e([...t,b]),s(""),c(""),r({title:"Camera Added",description:`${b.name} has been added to the configuration.`})},d=g=>{e(t.filter(m=>m.id!==g)),r({title:"Camera Removed",description:"Camera has been removed from the configuration."})},f=(g,m)=>{e(t.map(x=>x.id===g?{...x,...m}:x))},[p,y]=_.useState(!1),v=_.useCallback(()=>{y(!0)},[]);return _.useEffect(()=>{n&&(n.current=v)},[n,v]),h.jsxs("div",{className:"space-y-4",children:[h.jsx("h3",{className:"text-lg font-semibold text-white border-b border-gray-700 pb-2",children:"Camera Configuration"}),h.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-4 space-y-4",children:[h.jsx("h4",{className:"text-md font-medium text-gray-300",children:"Add Camera"}),h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(Nt,{className:"text-sm font-medium text-gray-300",children:"Available Cameras"}),h.jsxs(Zs,{value:a,onValueChange:s,disabled:o,children:[h.jsx(Wa,{className:"bg-gray-800 border-gray-700 text-white",children:h.jsx(Qs,{placeholder:o?"Loading cameras...":"Select camera"})}),h.jsx(Xa,{className:"bg-gray-800 border-gray-700",children:i.map(g=>{const m=t.some(x=>x.camera_index===g.index||g.deviceId&&x.device_id===g.deviceId);return h.jsx(_n,{value:g.index.toString(),className:"text-white hover:bg-gray-700",disabled:!g.available||m,children:h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{className:"font-medium",children:g.name}),h.jsxs("span",{className:"text-xs text-gray-400",children:["Index ",g.index,m&&" ยท already added"]})]})},g.index)})})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(Nt,{className:"text-sm font-medium text-gray-300",children:"Camera Name"}),h.jsx(hi,{value:l,onChange:g=>c(g.target.value),placeholder:"e.g., workspace_cam",className:"bg-gray-800 border-gray-700 text-white"})]}),h.jsx("div",{className:"space-y-2 flex flex-col justify-end",children:h.jsxs(et,{onClick:u,className:"bg-blue-500 hover:bg-blue-600 text-white",disabled:!a||!l.trim(),children:[h.jsx(eA,{className:"w-4 h-4 mr-2"}),"Add Camera"]})})]})]}),t.length>0&&h.jsxs("div",{className:"space-y-4",children:[h.jsxs("h4",{className:"text-md font-medium text-gray-300",children:["Configured Cameras (",t.length,")"]}),h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-2 gap-4",children:t.map(g=>h.jsx(iZ,{camera:g,paused:p,onRemove:()=>d(g.id),onUpdate:m=>f(g.id,m)},g.id))})]}),t.length===0&&h.jsxs("div",{className:"text-center py-8 text-gray-500",children:[h.jsx($7,{className:"w-12 h-12 mx-auto mb-4 text-gray-600"}),h.jsx("p",{children:"No cameras configured. Add a camera to get started."})]})]})},iZ=({camera:t,paused:e,onRemove:n,onUpdate:r})=>{var s;const{videoRef:i,hasError:o}=d4(t.device_id,e),a=!e&&t.device_id&&!o;return h.jsxs("div",{className:"bg-gray-900 rounded-lg border border-gray-700 overflow-hidden",children:[h.jsx("div",{className:"aspect-[4/3] bg-gray-800 relative",children:a?h.jsx("video",{ref:i,autoPlay:!0,muted:!0,playsInline:!0,className:"w-full h-full object-cover"}):h.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center",children:[h.jsx(DU,{className:"w-8 h-8 text-gray-500 mb-2"}),h.jsx("span",{className:"text-gray-500 text-sm",children:e?"Preview paused":t.device_id?"Preview failed":"No browser match"})]})}),h.jsxs("div",{className:"p-3 space-y-2",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("h5",{className:"font-medium text-white truncate",children:t.name}),h.jsx(et,{onClick:n,size:"sm",variant:"ghost",className:"text-red-400 hover:text-red-300 hover:bg-red-900/20 p-1",children:h.jsx(ix,{className:"w-4 h-4"})})]}),h.jsxs("div",{className:"grid grid-cols-1 gap-2 text-xs text-gray-400",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"w-16",children:"Resolution:"}),h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx(mr,{value:t.width,onChange:l=>{l!==void 0&&r({width:l})},className:"bg-gray-800 border-gray-700 text-white text-xs h-6 px-2 w-16",min:"320",max:"1920"}),h.jsx("span",{className:"flex items-center",children:"ร—"}),h.jsx(mr,{value:t.height,onChange:l=>{l!==void 0&&r({height:l})},className:"bg-gray-800 border-gray-700 text-white text-xs h-6 px-2 w-16",min:"240",max:"1080"})]})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"w-16",children:"FPS:"}),h.jsx(mr,{value:t.fps??30,onChange:l=>{l!==void 0&&r({fps:l})},className:"bg-gray-800 border-gray-700 text-white text-xs h-6 px-2 w-16",min:"10",max:"60"})]})]}),h.jsxs("div",{className:"text-xs text-gray-500",children:["Type: ",t.type," | Device: ",(s=t.device_id)==null?void 0:s.substring(0,10),"..."]})]})]})},oZ=({open:t,onOpenChange:e,robot:n,datasetName:r,setDatasetName:i,singleTask:o,setSingleTask:a,numEpisodes:s,setNumEpisodes:l,episodeTimeS:c,setEpisodeTimeS:u,resetTimeS:d,setResetTimeS:f,streamingEncoding:p,setStreamingEncoding:y,cameras:v,setCameras:g,onStart:m,releaseStreamsRef:x})=>{const{auth:b}=xf(),S=!!n&&n.is_clean;return h.jsx(Hc,{open:t,onOpenChange:e,children:h.jsxs(xl,{className:"bg-gray-900 border-gray-800 text-white sm:max-w-[600px] p-8 max-h-[90vh] overflow-y-auto",children:[h.jsxs(bl,{children:[h.jsx("div",{className:"flex justify-center items-center mb-4",children:h.jsx("div",{className:"w-8 h-8 bg-red-500 rounded-full flex items-center justify-center",children:h.jsx("span",{className:"text-white font-bold text-sm",children:"REC"})})}),h.jsx(_l,{className:"text-white text-center text-2xl font-bold",children:"Configure Recording"})]}),h.jsxs("div",{className:"space-y-6 py-4",children:[h.jsx(wl,{className:"text-gray-400 text-base leading-relaxed text-center",children:"Pick a configured robot and dataset parameters for recording."}),h.jsxs("div",{className:"grid grid-cols-1 gap-6",children:[h.jsxs("div",{className:"space-y-4",children:[h.jsx("h3",{className:"text-lg font-semibold text-white border-b border-gray-700 pb-2",children:"Robot Configuration"}),n?n.is_clean?h.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[h.jsx(qi,{className:"w-4 h-4 text-green-400"}),h.jsxs("span",{className:"text-slate-200",children:["Recording with ",h.jsx("strong",{children:n.name})]})]}):h.jsxs(Mi,{className:"bg-amber-900/40 border-amber-700 text-amber-100",children:[h.jsx(ia,{className:"h-4 w-4"}),h.jsxs(Ai,{children:[h.jsx("strong",{children:n.name})," is missing a calibration. Configure it before recording."]})]}):h.jsxs(Mi,{className:"bg-amber-900/40 border-amber-700 text-amber-100",children:[h.jsx(ia,{className:"h-4 w-4"}),h.jsx(Ai,{children:"Select and configure a robot on the Landing page before recording."})]})]}),h.jsxs("div",{className:"space-y-4",children:[h.jsx("h3",{className:"text-lg font-semibold text-white border-b border-gray-700 pb-2",children:"Dataset Configuration"}),h.jsxs("div",{className:"grid grid-cols-1 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(Nt,{htmlFor:"datasetName",className:"text-sm font-medium text-gray-300",children:"Dataset Name *"}),h.jsx(hi,{id:"datasetName",value:r,onChange:w=>i(w.target.value.replace(/[^A-Za-z0-9._-]/g,"_")),placeholder:"my_dataset",className:"bg-gray-800 border-gray-700 text-white"}),h.jsxs("p",{className:"text-xs text-gray-500",children:["Letters, numbers, ",h.jsx("code",{children:"."})," ",h.jsx("code",{children:"_"})," ",h.jsx("code",{children:"-"})," only โ€” other characters become"," ",h.jsx("code",{children:"_"}),"."]}),r&&(b.status==="authenticated"?h.jsxs("p",{className:"text-xs text-gray-500",children:["Will be saved as"," ",h.jsxs("span",{className:"text-gray-300 font-mono",children:[b.username,"/",r]})]}):b.status==="unauthenticated"?h.jsx("p",{className:"text-xs text-amber-400/80",children:"Log in to Hugging Face to set the repository owner."}):null)]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(Nt,{htmlFor:"singleTask",className:"text-sm font-medium text-gray-300",children:"Task Description *"}),h.jsx(hi,{id:"singleTask",value:o,onChange:w=>a(w.target.value),placeholder:"e.g., pick up the red block and place it on the blue square",className:"bg-gray-800 border-gray-700 text-white"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(Nt,{htmlFor:"numEpisodes",className:"text-sm font-medium text-gray-300",children:"Number of Episodes"}),h.jsx(mr,{id:"numEpisodes",min:"1",max:"100",value:s,onChange:w=>{w!==void 0&&l(w)},className:"bg-gray-800 border-gray-700 text-white"})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(Nt,{htmlFor:"episodeTimeS",className:"text-sm font-medium text-gray-300",children:"Episode duration (seconds)"}),h.jsx(mr,{id:"episodeTimeS",min:"1",value:c,onChange:w=>{w!==void 0&&u(w)},className:"bg-gray-800 border-gray-700 text-white"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(Nt,{htmlFor:"resetTimeS",className:"text-sm font-medium text-gray-300",children:"Reset duration (seconds)"}),h.jsx(mr,{id:"resetTimeS",min:"1",value:d,onChange:w=>{w!==void 0&&f(w)},className:"bg-gray-800 border-gray-700 text-white"})]})]})]})]}),h.jsx("div",{className:"space-y-4",children:h.jsx(f4,{cameras:v,onCamerasChange:g,releaseStreamsRef:x})}),h.jsxs(Sy,{className:"space-y-4 group",children:[h.jsxs(Ey,{className:"flex items-center justify-between w-full text-lg font-semibold text-white border-b border-gray-700 pb-2",children:[h.jsx("span",{children:"Advanced Parameters"}),h.jsx(hc,{className:"w-4 h-4 transition-transform group-data-[state=open]:rotate-180"})]}),h.jsx(Ty,{className:"space-y-3",children:h.jsxs("div",{className:"flex items-start gap-3",children:[h.jsx(PA,{id:"streamingEncoding",checked:p,onCheckedChange:w=>y(w===!0),className:"mt-0.5 border-gray-500 data-[state=checked]:bg-red-500 data-[state=checked]:border-red-500"}),h.jsxs("div",{className:"space-y-1",children:[h.jsx(Nt,{htmlFor:"streamingEncoding",className:"text-sm font-medium text-gray-200 cursor-pointer",children:"Streaming video encoding"}),h.jsx("p",{className:"text-xs text-gray-500",children:"Encodes frames in real time during capture so each episode saves almost instantly. Uncheck to fall back to the slower PNG-then-encode flow."})]})]})})]})]}),h.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center pt-4",children:[h.jsx(et,{onClick:m,disabled:!S,className:"w-full sm:w-auto bg-red-500 hover:bg-red-600 text-white px-10 py-6 text-lg transition-all shadow-md shadow-red-500/30 hover:shadow-lg hover:shadow-red-500/40 disabled:opacity-40 disabled:cursor-not-allowed",children:"Start Recording"}),h.jsx(et,{onClick:()=>e(!1),variant:"outline",className:"w-full sm:w-auto border-gray-500 hover:border-gray-200 px-10 py-6 text-lg text-zinc-500 bg-zinc-900 hover:bg-zinc-800",children:"Cancel"})]})]})]})})},aZ=/^[\w.\-]+\/[\w.\-]+$/,sZ=/^[A-Za-z0-9._-]+$/,lZ=({datasets:t,loading:e,onPickExisting:n,onCreateNew:r,onOpenCustom:i,children:o})=>{const[a,s]=_.useState(!1),[l,c]=_.useState(""),u=l.trim(),d=t.some(C=>C.repo_id.toLowerCase()===u.toLowerCase()),f=aZ.test(u),p=sZ.test(u)&&!u.includes("/"),y=u.length>0&&p&&!d,v=f&&!d,g=d||u!==""&&!y,m=d?"Already exists":u===""?"Create new datasetโ€ฆ":y?`Create "${u}"`:'Use a name without "/"',x=()=>{g||(r(u),w())},b=t.filter(C=>C.source==="local"||C.source==="both"),S=t.filter(C=>C.source==="hub"),w=()=>{c(""),s(!1)},E=C=>{n(C),w()},T=()=>{y&&(r(u),w())},A=()=>{v&&(i(u),w())},M=C=>h.jsxs(kd,{value:C.repo_id,onSelect:()=>E(C),className:"text-white aria-selected:bg-gray-700",children:[h.jsx("span",{className:"flex-1 truncate",children:C.repo_id}),C.source==="both"&&h.jsx("span",{className:"text-xs text-gray-400 mr-2",children:"on Hub"}),C.private&&h.jsx("span",{className:"text-xs text-amber-400",children:"private"})]},C.repo_id);return h.jsxs(_x,{open:a,onOpenChange:s,children:[h.jsx(wx,{asChild:!0,children:o}),h.jsx(Pm,{className:"w-[320px] p-0 bg-gray-800 border-gray-700 text-white",align:"end",children:h.jsxs(Ex,{className:"bg-gray-800",children:[h.jsx(Tx,{placeholder:"Search, type a new name, or org/nameโ€ฆ",value:l,onValueChange:C=>c(C.replace(/[^A-Za-z0-9._\-/]/g,"_")),onKeyDown:C=>{C.key==="Enter"&&(y?(C.preventDefault(),T()):v&&(C.preventDefault(),A()))},className:"text-white"}),h.jsxs(Mx,{children:[t.length===0&&!y&&!v&&h.jsx(Ax,{className:"py-4 text-sm text-gray-400 text-center",children:e?"Loading datasetsโ€ฆ":"No datasets yet. Type a name to create one."}),b.length>0&&h.jsx(Ys,{heading:"Local",children:b.map(M)}),S.length>0&&h.jsx(Ys,{heading:"Hugging Face",children:S.map(M)}),v&&h.jsx(Ys,{heading:"Custom repo",children:h.jsxs(kd,{value:`__open__${u}`,onSelect:A,className:"text-white aria-selected:bg-gray-700",children:[h.jsx(ll,{className:"mr-2 h-4 w-4"}),'Open "',u,'" in viewer']})})]}),h.jsxs("button",{type:"button",onClick:x,disabled:g,className:"flex w-full items-center gap-2 border-t border-gray-700 px-3 py-2 text-sm text-white hover:bg-gray-700 disabled:cursor-not-allowed disabled:text-gray-500 disabled:hover:bg-transparent",children:[h.jsx(eA,{className:"h-4 w-4"}),m]})]})})]})},cZ=(t,e)=>{const{wsBaseUrl:n}=Ln(),r=_.useRef(t);r.current=t;const i=_.useRef(e);i.current=e,_.useEffect(()=>{let o=!1,a=null,s=null;const l=()=>{if(!o){try{a=new WebSocket(`${n}/ws/joint-data`)}catch{s=setTimeout(l,3e3);return}a.onmessage=c=>{try{const u=JSON.parse(c.data);(u==null?void 0:u.type)==="jobs_changed"?r.current():(u==null?void 0:u.type)==="job_progress"&&i.current&&Array.isArray(u==null?void 0:u.jobs)&&i.current(u.jobs)}catch{}},a.onclose=()=>{o||(s=setTimeout(l,3e3))}}};return l(),()=>{o=!0,s&&clearTimeout(s),a&&a.close()}},[n])};class Ix extends Error{constructor(n,r,i){super(n);Kb(this,"status");Kb(this,"detail");this.name="ApiError",this.status=r,this.detail=i}}async function er(t,e,n,{method:r="GET",body:i,signal:o,action:a}={}){const s={method:r,signal:o};i!==void 0&&(s.body=JSON.stringify(i));const l=`${t}${n}`,c=await e(l,s);if(!c.ok){let u=null;try{const f=await c.json();u=(f==null?void 0:f.detail)??(f==null?void 0:f.message)??null}catch{}const d=a||`${r} ${n}`;throw new Ix(`${d} failed: ${u??c.status}`,c.status,u)}if(c.status!==204)return c.json()}async function ME(t,e,n=10,r){return(await er(t,e,`/jobs?limit=${n}`,{signal:r,action:"List jobs"})).jobs}async function uZ(t,e,n,r){return er(t,e,`/jobs/${n}`,{signal:r,action:"Get job"})}async function dZ(t,e,n,r){return(await er(t,e,`/jobs/${n}/logs`,{signal:r,action:"Get job logs"})).logs}async function fZ(t,e,n,r){return(await er(t,e,`/jobs/${n}/log-file`,{signal:r,action:"Get job log file"})).logs}async function hZ(t,e,n,r){return(await er(t,e,`/jobs/${n}/metrics-history`,{signal:r,action:"Get job metrics history"})).points}async function pZ(t,e,n){const{target:r,...i}=n,o=r?{config:i,target:r}:i;try{return await er(t,e,"/jobs/training",{method:"POST",body:o,action:"Start training"})}catch(a){throw a instanceof Ix&&a.status===409?new Error("Another training is already running. Stop it first."):a}}async function h4(t,e,n){return er(t,e,`/jobs/${n}/stop`,{method:"POST",action:"Stop job"})}async function mZ(t,e,n,r){return er(t,e,`/jobs/providers/${encodeURIComponent(n)}/jobs/${encodeURIComponent(r)}/attach`,{method:"POST",action:"Attach provider job"})}async function p4(t,e,n){await er(t,e,`/jobs/${n}`,{method:"DELETE",action:"Delete job"})}const gZ={authenticated:!1,username:null,flavors:[],providers:[]};async function TN(t,e,n){try{const r=await er(t,e,"/jobs/runners/hardware",{signal:n,action:"List runner hardware"});return{authenticated:!!r.authenticated,username:r.username??null,flavors:Array.isArray(r.flavors)?r.flavors:[],providers:Array.isArray(r.providers)?r.providers.map(i=>({...i,flavors:Array.isArray(i.flavors)?i.flavors:[]})):[]}}catch(r){if(r instanceof Ix)return gZ;throw r}}async function vZ(t,e,n){return er(t,e,"/compute/seeed-cloud/config",{signal:n,action:"Get Seeed Cloud config"})}async function yZ(t,e,n){return er(t,e,"/compute/seeed-cloud/config",{method:"POST",body:n,action:"Save Seeed Cloud config"})}const xZ={authenticated:!1,jobs:[],models:[]};async function bZ(t,e,n){try{return await er(t,e,"/jobs/hub",{signal:n,action:"List hub jobs"})}catch(r){if(r instanceof Ix)return xZ;throw r}}const Gr=_.forwardRef(({className:t,...e},n)=>h.jsx("div",{ref:n,className:He("rounded-lg border bg-card text-card-foreground shadow-sm",t),...e}));Gr.displayName="Card";const jo=_.forwardRef(({className:t,...e},n)=>h.jsx("div",{ref:n,className:He("flex flex-col space-y-1.5 p-6",t),...e}));jo.displayName="CardHeader";const ha=_.forwardRef(({className:t,...e},n)=>h.jsx("h3",{ref:n,className:He("text-2xl font-semibold leading-none tracking-tight",t),...e}));ha.displayName="CardTitle";const _Z=_.forwardRef(({className:t,...e},n)=>h.jsx("p",{ref:n,className:He("text-sm text-muted-foreground",t),...e}));_Z.displayName="CardDescription";const Wr=_.forwardRef(({className:t,...e},n)=>h.jsx("div",{ref:n,className:He("p-6 pt-0",t),...e}));Wr.displayName="CardContent";const wZ=_.forwardRef(({className:t,...e},n)=>h.jsx("div",{ref:n,className:He("flex items-center p-6 pt-0",t),...e}));wZ.displayName="CardFooter";async function LA(t,e,n,r){return(await er(t,e,`/jobs/${n}/checkpoints`,{signal:r,action:"List checkpoints"})).checkpoints}async function SZ(t,e,n,r,i){return er(t,e,`/jobs/${n}/checkpoints/${r}/policy-config`,{signal:i,action:"Load policy config"})}const kA=({checkpoints:t,selectedStep:e,onChange:n,disabled:r,placeholder:i="Select checkpoint"})=>{const o=e!=null?String(e):void 0;return h.jsxs(Zs,{value:o,onValueChange:a=>n(Number(a)),disabled:r||t.length===0,children:[h.jsx(Wa,{className:"bg-slate-800 border-slate-700 text-white h-8 text-xs px-2 w-auto min-w-[110px]",onClick:a=>a.stopPropagation(),children:h.jsx(Qs,{placeholder:i})}),h.jsx(Xa,{className:"bg-slate-900 border-slate-700 text-white",children:t.map(a=>h.jsxs(_n,{value:String(a.step),onClick:s=>s.stopPropagation(),children:["step ",a.step]},a.step))})]})};function MN(t){const e=Math.max(0,Date.now()/1e3-t);return e<60?`${Math.floor(e)}s ago`:e<3600?`${Math.floor(e/60)}m ago`:e<86400?`${Math.floor(e/3600)}h ago`:`${Math.floor(e/86400)}d ago`}const EZ={running:{label:"Running",color:"text-green-400",Icon:fi},done:{label:"Done",color:"text-slate-400",Icon:ZM},failed:{label:"Failed",color:"text-red-400",Icon:nd},interrupted:{label:"Interrupted",color:"text-amber-400",Icon:ia}},Tg=({job:t,onStop:e,onDelete:n,onPlay:r})=>{const i=ji(),{baseUrl:o,fetchWithHeaders:a}=Ln(),s=EZ[t.state],l=s.Icon,c=t.state==="running",u=c&&t.metrics.total_steps===0,d=t.metrics.total_steps>0?Math.min(100,t.metrics.current_step/t.metrics.total_steps*100):0,f=u?"startingโ€ฆ":c?`started ${MN(t.started_at)}`:t.ended_at!=null?`ended ${MN(t.ended_at)}`:s.label.toLowerCase(),[p,y]=_.useState([]),[v,g]=_.useState(null);_.useEffect(()=>{if(t.checkpoint_count<=0){y([]),g(null);return}let w=!1;return LA(o,a,t.id).then(E=>{if(!w)if(y(E),E.length>0){const T=E[E.length-1].step;g(A=>A!=null&&E.some(M=>M.step===A)?A:T)}else g(null)}).catch(()=>{w||(y([]),g(null))}),()=>{w=!0}},[o,a,t.id,t.checkpoint_count]);const m=w=>{w.stopPropagation(),c?window.confirm("Stop this run?")&&e(t.id):window.confirm("Delete this run? This wipes the output directory.")&&n(t.id)},x=w=>{w.stopPropagation(),v!=null&&r(t,v)},b=c,S=p.length>0&&v!=null;return h.jsx(Gr,{onClick:()=>i(`/training/${t.id}`),className:"bg-slate-800/50 border-slate-700 rounded-xl cursor-pointer hover:border-slate-500 transition-colors",children:h.jsxs(Wr,{className:"p-4 space-y-3",children:[h.jsxs("div",{className:"flex items-start justify-between gap-2",children:[h.jsxs("div",{className:`flex items-center gap-1.5 text-xs font-semibold ${s.color}`,children:[h.jsx(l,{className:`w-3.5 h-3.5 ${c?"animate-spin":""}`}),s.label]}),t.runner==="hf_cloud"&&t.hf_job_url?h.jsx(et,{variant:"ghost",size:"icon",asChild:!0,className:"h-7 w-7 text-slate-400 hover:text-white","aria-label":"Open Hub job page",children:h.jsx("a",{href:t.hf_job_url,target:"_blank",rel:"noopener noreferrer",onClick:w=>w.stopPropagation(),children:h.jsx(ll,{className:"w-3.5 h-3.5"})})}):h.jsx(et,{variant:"ghost",size:"icon",onClick:m,className:"h-7 w-7 text-slate-400 hover:text-white","aria-label":c?"Stop job":"Delete job",children:c?h.jsx(Od,{className:"w-3.5 h-3.5"}):h.jsx(ix,{className:"w-3.5 h-3.5"})})]}),h.jsxs("div",{children:[h.jsx("div",{className:"text-white font-semibold truncate",title:t.name,children:t.name}),h.jsx("div",{className:"text-xs text-slate-400",children:f})]}),b?h.jsxs("div",{className:"relative h-5 w-full overflow-hidden rounded-md bg-slate-900 border border-slate-700",children:[h.jsx("div",{className:"h-full bg-gradient-to-r from-blue-500 to-sky-400 transition-[width] duration-500",style:{width:`${d}%`}}),h.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-xs font-semibold text-white tabular-nums drop-shadow",children:u?"Training startingโ€ฆ":`${d.toFixed(1)}%`})]}):null,S?h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(kA,{checkpoints:p,selectedStep:v,onChange:g}),h.jsx(et,{size:"icon",onClick:x,className:"h-8 w-8 bg-green-500 hover:bg-green-600 text-white","aria-label":"Run inference with this checkpoint",children:h.jsx(Tc,{className:"w-4 h-4"})})]}):null]})})};function TZ(t){if(!t)return"โ€”";const e=Date.parse(t);if(Number.isNaN(e))return"โ€”";const n=Math.max(0,(Date.now()-e)/1e3);return n<60?`${Math.floor(n)}s ago`:n<3600?`${Math.floor(n/60)}m ago`:n<86400?`${Math.floor(n/3600)}h ago`:`${Math.floor(n/86400)}d ago`}const MZ={RUNNING:{label:"Running",color:"text-green-400",Icon:fi,spin:!0},QUEUED:{label:"Queued",color:"text-amber-400",Icon:dE},SCHEDULING:{label:"Scheduling",color:"text-amber-400",Icon:dE},COMPLETED:{label:"Done",color:"text-slate-400",Icon:ZM},FAILED:{label:"Failed",color:"text-red-400",Icon:nd},CANCELED:{label:"Cancelled",color:"text-amber-400",Icon:ia},CANCELLED:{label:"Cancelled",color:"text-amber-400",Icon:ia}},AN=({job:t,onOpen:e,busy:n=!1})=>{var c,u,d;const r=((u=(c=t.status)==null?void 0:c.stage)==null?void 0:u.toUpperCase())??"",i=MZ[r]??{label:r||"Unknown",color:"text-slate-400",Icon:H7},o=i.Icon,a=t.docker_image??t.space_id??`Job ${t.id.slice(0,12)}โ€ฆ`,s=!!t.url,l=!!(e||s);return h.jsx(Gr,{onClick:()=>{if(!n){if(e){e(t);return}s&&window.open(t.url,"_blank","noopener,noreferrer")}},className:`bg-slate-800/50 border-slate-700 rounded-xl hover:border-slate-500 transition-colors ${l?"cursor-pointer":""}`,children:h.jsxs(Wr,{className:"p-4 space-y-3",children:[h.jsxs("div",{className:"flex items-start justify-between gap-2",children:[h.jsxs("div",{className:`flex items-center gap-1.5 text-xs font-semibold ${i.color}`,children:[h.jsx(o,{className:`w-3.5 h-3.5 ${i.spin||n?"animate-spin":""}`}),i.label]}),s?h.jsx(et,{variant:"ghost",size:"icon",asChild:!0,className:"h-7 w-7 text-slate-400 hover:text-white","aria-label":"View provider job",children:h.jsx("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",onClick:f=>f.stopPropagation(),children:h.jsx(ll,{className:"w-3.5 h-3.5"})})}):null]}),h.jsxs("div",{children:[h.jsx("div",{className:"text-white font-semibold truncate",title:a,children:a}),h.jsxs("div",{className:"text-xs text-slate-400 truncate",children:[t.flavor??"โ€”"," ยท ",TZ(t.created_at),t.owner?` ยท ${t.owner}`:""]})]}),(d=t.status)!=null&&d.message?h.jsx("div",{className:"text-xs text-slate-500 truncate",title:t.status.message,children:t.status.message}):null]})})};function AZ(t){if(!t)return"โ€”";const e=Date.parse(t);if(Number.isNaN(e))return"โ€”";const n=Math.max(0,(Date.now()-e)/1e3);return n<60?`${Math.floor(n)}s ago`:n<3600?`${Math.floor(n/60)}m ago`:n<86400?`${Math.floor(n/3600)}h ago`:`${Math.floor(n/86400)}d ago`}const CZ=({model:t})=>{const e=`https://huggingface.co/${t.repo_id}`,n=t.repo_id.includes("/")?t.repo_id.split("/").slice(1).join("/"):t.repo_id;return h.jsx(Gr,{onClick:()=>window.open(e,"_blank","noopener,noreferrer"),className:"bg-slate-800/50 border-slate-700 rounded-xl cursor-pointer hover:border-slate-500 transition-colors",children:h.jsxs(Wr,{className:"p-4 space-y-3",children:[h.jsxs("div",{className:"flex items-start justify-between gap-2",children:[h.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-semibold text-sky-400",children:[h.jsx(IU,{className:"w-3.5 h-3.5"}),"Uploaded"]}),h.jsx(et,{variant:"ghost",size:"icon",asChild:!0,className:"h-7 w-7 text-slate-400 hover:text-white","aria-label":"View on Hub",children:h.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",onClick:r=>r.stopPropagation(),children:h.jsx(ll,{className:"w-3.5 h-3.5"})})})]}),h.jsxs("div",{children:[h.jsxs("div",{className:"text-white font-semibold truncate flex items-center gap-1.5",title:t.repo_id,children:[t.private?h.jsx(J7,{className:"w-3.5 h-3.5 text-slate-400 shrink-0"}):null,h.jsx("span",{className:"truncate",children:n})]}),h.jsxs("div",{className:"text-xs text-slate-400 truncate",title:t.repo_id,children:[t.repo_id," ยท updated ",AZ(t.last_modified)]})]})]})})};async function PZ(t,e,n){return er(t,e,"/start-inference",{method:"POST",body:n,action:"Start inference"})}async function CN(t,e){return er(t,e,"/stop-inference",{method:"POST",action:"Stop inference"})}async function RZ(t,e,n){return er(t,e,"/inference-status",{signal:n,action:"Get inference status"})}const NZ=({deviceId:t,paused:e})=>{const{videoRef:n,hasError:r}=d4(t,e);return e||r||!t?h.jsxs("div",{className:"w-32 h-24 bg-gray-800 rounded border border-gray-700 flex flex-col items-center justify-center",children:[h.jsx(DU,{className:"w-5 h-5 text-gray-500 mb-1"}),h.jsx("span",{className:"text-[10px] text-gray-500",children:e?"Released":"No preview"})]}):h.jsx("video",{ref:n,autoPlay:!0,muted:!0,playsInline:!0,className:"w-32 h-24 object-cover rounded border border-gray-700 bg-black"})},OZ=30,m4=({open:t,onOpenChange:e,robot:n,jobId:r,initialStep:i})=>{var L;const{baseUrl:o,fetchWithHeaders:a}=Ln(),{toast:s}=Dr(),l=ji(),[c,u]=_.useState([]),[d,f]=_.useState(i),[p,y]=_.useState(""),[v,g]=_.useState(60),[m,x]=_.useState(!1),[b,S]=_.useState(null),[w,E]=_.useState(!1),[T,A]=_.useState(null),[M,C]=_.useState({}),{cameras:P}=u4({enabled:t});_.useEffect(()=>{if(!t)return;let j=!1;return LA(o,a,r).then(X=>{if(!j&&(u(X),X.length>0)){const K=X[X.length-1].step;f(F=>F??K)}}).catch(()=>{j||u([])}),()=>{j=!0}},[t,o,a,r]),_.useEffect(()=>{if(!t||d==null){S(null),A(null);return}let j=!1;return E(!0),A(null),SZ(o,a,r,d).then(X=>{j||(S(X),C(K=>{const F={};for(const Y of Object.keys(X.image_features))F[Y]=K[Y]??null;return F}))}).catch(X=>{j||(S(null),A(X instanceof Error?X.message:String(X)))}).finally(()=>{j||E(!1)}),()=>{j=!0}},[t,o,a,r,d]),_.useEffect(()=>{if(!b)return;const j=(n==null?void 0:n.cameras)??[];j.length===0||P.length===0||C(X=>{let K=!1;const F={...X};for(const Y of Object.keys(b.image_features)){if(F[Y]!=null)continue;const q=j.find(te=>te.name.toLowerCase()===Y.toLowerCase());if(!q)continue;const Q=q.device_id&&P.find(te=>te.deviceId===q.device_id)||P.find(te=>te.index===q.camera_index);Q&&(F[Y]=Q.index,K=!0)}return K?F:X})},[b,n,P]);const R=d!=null?((L=c.find(j=>j.step===d))==null?void 0:L.ref)??null:null,D=b?Object.keys(b.image_features):[],k=D.every(j=>M[j]!=null),U=!!n&&n.is_clean&&R!=null&&!!b&&k&&!m,O=async()=>{if(!n||R==null||!b)return;x(!0),await new Promise(X=>setTimeout(X,300));const j={};for(const[X,K]of Object.entries(b.image_features)){const F=M[X];F!=null&&(j[X]={type:"opencv",camera_index:F,width:K.width,height:K.height,fps:OZ})}try{await PZ(o,a,{follower_port:n.follower_port,follower_config:n.follower_config,policy_ref:R,task:p,cameras:j,duration_s:v}),e(!1),l("/inference")}catch(X){s({title:"Couldn't start inference",description:X instanceof Error?X.message:String(X),variant:"destructive"}),x(!1)}},W=(j,X)=>{const K=Number(X);C(F=>({...F,[j]:K}))};return h.jsx(Hc,{open:t,onOpenChange:e,children:h.jsxs(xl,{className:"bg-gray-900 border-gray-800 text-white sm:max-w-[600px] p-8 max-h-[90vh] overflow-y-auto",children:[h.jsxs(bl,{children:[h.jsx("div",{className:"flex justify-center items-center mb-4",children:h.jsx("div",{className:"w-8 h-8 bg-green-500 rounded-full flex items-center justify-center",children:h.jsx(Tc,{className:"w-4 h-4 text-white"})})}),h.jsx(_l,{className:"text-white text-center text-2xl font-bold",children:"Configure Inference"})]}),h.jsxs("div",{className:"space-y-6 py-4",children:[h.jsx(wl,{className:"text-gray-400 text-base leading-relaxed text-center",children:"Pick a checkpoint and confirm hardware. The selected policy will drive the follower autonomously for the configured duration."}),h.jsxs("div",{className:"space-y-4",children:[h.jsx("h3",{className:"text-lg font-semibold text-white border-b border-gray-700 pb-2",children:"Robot Configuration"}),n?n.is_clean?h.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[h.jsx(qi,{className:"w-4 h-4 text-green-400"}),h.jsxs("span",{className:"text-slate-200",children:["Running on ",h.jsx("strong",{children:n.name})]})]}):h.jsxs(Mi,{className:"bg-amber-900/40 border-amber-700 text-amber-100",children:[h.jsx(ia,{className:"h-4 w-4"}),h.jsxs(Ai,{children:[h.jsx("strong",{children:n.name})," is missing a calibration. Configure it before running inference."]})]}):h.jsxs(Mi,{className:"bg-amber-900/40 border-amber-700 text-amber-100",children:[h.jsx(ia,{className:"h-4 w-4"}),h.jsx(Ai,{children:"Select and configure a robot on the Landing page first."})]})]}),h.jsxs("div",{className:"space-y-4",children:[h.jsx("h3",{className:"text-lg font-semibold text-white border-b border-gray-700 pb-2",children:"Checkpoint"}),c.length===0?h.jsxs(Mi,{className:"bg-amber-900/40 border-amber-700 text-amber-100",children:[h.jsx(ia,{className:"h-4 w-4"}),h.jsx(Ai,{children:"No checkpoints available for this job yet."})]}):h.jsx(kA,{checkpoints:c,selectedStep:d,onChange:f})]}),h.jsxs("div",{className:"space-y-4",children:[h.jsx("h3",{className:"text-lg font-semibold text-white border-b border-gray-700 pb-2",children:"Run parameters"}),b!=null&&b.requires_task?h.jsxs("div",{className:"space-y-2",children:[h.jsx(Nt,{htmlFor:"task",className:"text-sm font-medium text-gray-300",children:"Task description"}),h.jsx(hi,{id:"task",value:p,onChange:j=>y(j.target.value),placeholder:"e.g., pick up the red block",className:"bg-gray-800 border-gray-700 text-white"}),h.jsxs("p",{className:"text-xs text-gray-500",children:["This policy is language-conditioned (",b.policy_type,")."]})]}):null,h.jsxs("div",{className:"space-y-2",children:[h.jsx(Nt,{htmlFor:"durationS",className:"text-sm font-medium text-gray-300",children:"Max duration (seconds)"}),h.jsx(mr,{id:"durationS",min:1,value:v,onChange:j=>{j!==void 0&&g(j)},className:"bg-gray-800 border-gray-700 text-white"})]})]}),h.jsxs("div",{className:"space-y-4",children:[h.jsx("h3",{className:"text-lg font-semibold text-white border-b border-gray-700 pb-2",children:"Cameras"}),w?h.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-400",children:[h.jsx(fi,{className:"w-4 h-4 animate-spin"}),"Reading policy configโ€ฆ"]}):T?h.jsxs(Mi,{className:"bg-red-900/40 border-red-700 text-red-100",children:[h.jsx(ia,{className:"h-4 w-4"}),h.jsxs(Ai,{children:["Couldn't load policy config: ",T]})]}):b?D.length===0?h.jsx("p",{className:"text-xs text-gray-500",children:"This policy doesn't use cameras."}):h.jsxs("div",{className:"space-y-3",children:[h.jsx("p",{className:"text-xs text-gray-500",children:"Bind a physical camera to each name the policy was trained with. Resolution comes from the checkpoint."}),D.map(j=>{const X=b.image_features[j],K=M[j],F=K!=null?P.find(Y=>Y.index===K):void 0;return h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs("div",{className:"flex-1",children:[h.jsx(Nt,{className:"text-sm font-medium text-gray-200",children:j}),h.jsxs("p",{className:"text-xs text-gray-500",children:[X.width,"ร—",X.height]})]}),h.jsxs(Zs,{value:K!=null?String(K):void 0,onValueChange:Y=>W(j,Y),children:[h.jsx(Wa,{className:"bg-gray-800 border-gray-700 text-white w-56",children:h.jsx(Qs,{placeholder:"Select a camera"})}),h.jsx(Xa,{className:"bg-gray-900 border-gray-700 text-white",children:P.length===0?h.jsx("div",{className:"px-2 py-1.5 text-xs text-gray-500",children:"No cameras detected"}):P.map(Y=>h.jsxs(_n,{value:String(Y.index),children:["#",Y.index," โ€” ",Y.name]},Y.index))})]}),h.jsx(NZ,{deviceId:(F==null?void 0:F.deviceId)??"",paused:m})]},j)})]}):null]}),h.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center pt-4",children:[h.jsxs(et,{onClick:O,disabled:!U,className:"w-full sm:w-auto bg-green-500 hover:bg-green-600 text-white px-10 py-6 text-lg disabled:opacity-40 disabled:cursor-not-allowed",children:[h.jsx(Tc,{className:"w-5 h-5 mr-2"}),m?"Startingโ€ฆ":"Start Inference"]}),h.jsx(et,{onClick:()=>e(!1),variant:"outline",className:"w-full sm:w-auto border-gray-500 hover:border-gray-200 px-10 py-6 text-lg text-zinc-500 bg-zinc-900 hover:bg-zinc-800",children:"Cancel"})]})]})]})})},AE="lelab.selectedRobot",IZ=()=>{try{const t=localStorage.getItem(AE);return t&&typeof t=="string"?t:null}catch{return null}},DZ=t=>{try{t?localStorage.setItem(AE,t):localStorage.removeItem(AE)}catch{}},jA=()=>{const{baseUrl:t,fetchWithHeaders:e}=Ln(),{toast:n}=Dr(),r=vl(),[i,o]=_.useState({}),[a,s]=_.useState(()=>IZ()),[l,c]=_.useState(!1);_.useEffect(()=>{let g=!1;return(async()=>{c(!0);try{const b=await(await e(`${t}/robots`)).json();if(g)return;const S={};for(const w of b.robots??[])S[w.name]=w;o(S),s(w=>w&&w in S?w:null)}catch(x){g||console.error("Failed to fetch robots:",x)}finally{g||c(!1)}})(),()=>{g=!0}},[t,e,r.key]),_.useEffect(()=>{DZ(a)},[a]);const u=_.useCallback(g=>{s(g)},[]),d=_.useCallback(()=>{s(null)},[]),f=_.useCallback(async g=>{const m=g.trim();if(!m)return n({title:"Missing name",description:"Robot name cannot be empty.",variant:"destructive"}),!1;if(/[/\\]|\.\./.test(m))return n({title:"Invalid name",description:"Robot names cannot contain '/', '\\', or '..'",variant:"destructive"}),!1;try{const x=await e(`${t}/robots/${encodeURIComponent(m)}?create=true`,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"});if(x.status===409)return n({title:"Already exists",description:`A robot named "${m}" already exists. Pick it from the dropdown or choose a different name.`,variant:"destructive"}),!1;if(!x.ok){const S=await x.text();return n({title:"Failed to create",description:S,variant:"destructive"}),!1}const b=await x.json();return b.robot&&(o(S=>({...S,[m]:b.robot})),s(m)),!0}catch(x){return n({title:"Network error",description:String(x),variant:"destructive"}),!1}},[t,e,n]),p=_.useCallback(async g=>{try{const m=await e(`${t}/robots/${encodeURIComponent(g)}`,{method:"DELETE"});if(!m.ok){const x=await m.text();return n({title:"Failed to delete",description:x,variant:"destructive"}),!1}return o(x=>{const{[g]:b,...S}=x;return S}),s(x=>x===g?null:x),!0}catch(m){return n({title:"Network error",description:String(m),variant:"destructive"}),!1}},[t,e,n]),y=_.useMemo(()=>a?i[a]??null:null,[a,i]),v=_.useMemo(()=>Object.keys(i).sort(),[i]);return{records:i,selectedName:a,selectedRecord:y,availableNames:v,isLoading:l,selectRobot:u,clearSelection:d,createRobot:f,deleteRobot:p}},LZ=10,kZ=new Set(["RUNNING","QUEUED","SCHEDULING"]),Mg=t=>t.state==="running"||t.checkpoint_count>0,PN=t=>{var e;return kZ.has((((e=t.status)==null?void 0:e.stage)??"").toUpperCase())},jZ=()=>{const{baseUrl:t,fetchWithHeaders:e}=Ln(),{toast:n}=Dr(),r=ji(),[i,o]=_.useState([]),[a,s]=_.useState([]),[l,c]=_.useState([]),[u,d]=_.useState(!1),[f,p]=_.useState(null),[y,v]=_.useState(""),[g,m]=_.useState(null),{selectedRecord:x}=jA(),[b,S]=_.useState(!1),[w,E]=_.useState(null),[T,A]=_.useState(null),M=_.useCallback(async()=>{try{const[ie,G]=await Promise.all([ME(t,e,LZ),bZ(t,e)]);o(ie),s(G.jobs),c(G.models),d(G.authenticated),p(null)}catch(ie){p(ie instanceof Error?ie.message:String(ie))}},[t,e]);_.useEffect(()=>{M();const ie=()=>{document.visibilityState==="visible"&&M()};return document.addEventListener("visibilitychange",ie),window.addEventListener("focus",M),()=>{document.removeEventListener("visibilitychange",ie),window.removeEventListener("focus",M)}},[M]);const C=_.useCallback(ie=>{ie.length!==0&&o(G=>{if(G.length===0)return G;const Ve=new Map(ie.map(Re=>[Re.id,Re]));let Ne=!1;const st=G.map(Re=>{const ct=Ve.get(Re.id);return ct?(Ne=!0,{...Re,state:ct.state,metrics:ct.metrics,wandb_run_url:ct.wandb_run_url,checkpoint_count:ct.checkpoint_count}):Re});return Ne?st:G})},[]);cZ(M,C);const P=async ie=>{try{await h4(t,e,ie),n({title:"Job stopping"}),M()}catch(G){n({title:"Stop failed",description:G instanceof Error?G.message:String(G),variant:"destructive"})}},R=(ie,G)=>{E(ie),A(G),S(!0)},D=async ie=>{try{await p4(t,e,ie),n({title:"Job removed"}),M()}catch(G){n({title:"Delete failed",description:G instanceof Error?G.message:String(G),variant:"destructive"})}},k=async ie=>{if(ie.provider!=="seeed_cloud"){ie.url&&window.open(ie.url,"_blank","noopener,noreferrer");return}try{m(ie.id);const G=await mZ(t,e,"seeed_cloud",ie.id);o(Ve=>Ve.some(Ne=>Ne.id===G.id)?Ve:[G,...Ve]),r(`/training/${G.id}`)}catch(G){n({title:"Attach failed",description:G instanceof Error?G.message:String(G),variant:"destructive"})}finally{m(null)}},U=y.trim().toLowerCase(),O=_.useCallback(ie=>!U||(ie??"").toLowerCase().includes(U),[U]),W=_.useMemo(()=>i.filter(ie=>O(ie.name)),[i,O]),L=_.useMemo(()=>a.filter(ie=>O(ie.docker_image??ie.space_id??ie.id)),[a,O]),j=_.useMemo(()=>l.filter(ie=>O(ie.repo_id)),[l,O]),X=_.useMemo(()=>W.filter(ie=>ie.runner==="local"),[W]),K=_.useMemo(()=>W.filter(ie=>ie.runner==="hf_cloud"||ie.runner==="seeed_cloud"),[W]),F=_.useMemo(()=>new Set(K.map(ie=>ie.hf_job_id).filter(ie=>!!ie)),[K]),Y=_.useMemo(()=>L.filter(ie=>ie.provider==="hf_cloud"?!F.has(ie.id):ie.provider==="seeed_cloud"?!K.some(G=>G.external_provider==="seeed_cloud"&&G.external_job_id===ie.id):!0),[L,K,F]),q=_.useMemo(()=>new Set(K.map(ie=>ie.hf_repo_id).filter(ie=>!!ie)),[K]),Q=_.useMemo(()=>j.filter(ie=>!q.has(ie.repo_id)),[j,q]),te=_.useMemo(()=>X.filter(Mg),[X]),ee=_.useMemo(()=>X.filter(ie=>!Mg(ie)),[X]),ce=_.useMemo(()=>K.filter(Mg),[K]),ae=_.useMemo(()=>K.filter(ie=>!Mg(ie)),[K]),fe=_.useMemo(()=>Y.filter(PN),[Y]),we=_.useMemo(()=>Y.filter(ie=>!PN(ie)),[Y]),le=ee.length+ae.length+we.length;return h.jsxs("section",{className:"space-y-6",children:[h.jsxs("div",{className:"flex items-center justify-between gap-3",children:[h.jsx("h2",{className:"text-lg font-semibold text-white",children:"Jobs"}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs("div",{className:"relative",children:[h.jsx(tA,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-slate-400 pointer-events-none"}),h.jsx(hi,{value:y,onChange:ie=>v(ie.target.value),placeholder:"Search jobs",className:"h-8 w-48 sm:w-60 pl-8 bg-slate-800/50 border-slate-700 text-sm text-white placeholder:text-slate-500","aria-label":"Search jobs"})]}),h.jsx(et,{variant:"ghost",size:"icon",onClick:M,className:"h-7 w-7 text-slate-400 hover:text-white","aria-label":"Refresh jobs",children:h.jsx(OU,{className:"w-4 h-4"})})]})]}),f?h.jsxs("p",{className:"text-sm text-red-300",children:["Couldn't load jobs: ",f]}):null,h.jsxs("div",{className:"space-y-3",children:[h.jsx("h3",{className:"text-sm font-semibold uppercase tracking-wide text-slate-400",children:"Local jobs"}),te.length===0?h.jsx("p",{className:"text-sm text-slate-500",children:U?"No local jobs match your search.":"No active local jobs. Start one from the Training page."}):h.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:te.map(ie=>h.jsx(Tg,{job:ie,onStop:P,onDelete:D,onPlay:R},ie.id))})]}),h.jsx("div",{className:"border-t border-slate-700"}),h.jsxs("div",{className:"space-y-3",children:[h.jsx("h3",{className:"text-sm font-semibold uppercase tracking-wide text-slate-400",children:"Online jobs"}),!u&&K.length===0?h.jsx("p",{className:"text-sm text-slate-500",children:"Sign in with Hugging Face to see your cloud jobs."}):ce.length===0&&fe.length===0&&Q.length===0?h.jsx("p",{className:"text-sm text-slate-500",children:U?"No online jobs match your search.":"No active cloud jobs."}):h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[ce.map(ie=>h.jsx(Tg,{job:ie,onStop:P,onDelete:D,onPlay:R},ie.id)),fe.map(ie=>h.jsx(AN,{job:ie,onOpen:k,busy:g===ie.id},ie.id)),Q.map(ie=>h.jsx(CZ,{model:ie},ie.repo_id))]})]}),le>0?h.jsxs(Sy,{children:[h.jsxs(Ey,{className:"group flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wide text-slate-400 hover:text-white transition-colors",children:[h.jsx(xp,{className:"w-3.5 h-3.5 transition-transform group-data-[state=open]:rotate-90"}),"Untracked (",le,")"]}),h.jsx(Ty,{className:"pt-3",children:h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[ee.map(ie=>h.jsx(Tg,{job:ie,onStop:P,onDelete:D,onPlay:R},ie.id)),ae.map(ie=>h.jsx(Tg,{job:ie,onStop:P,onDelete:D,onPlay:R},ie.id)),we.map(ie=>h.jsx(AN,{job:ie,onOpen:k,busy:g===ie.id},ie.id))]})})]}):null,w?h.jsx(m4,{open:b,onOpenChange:S,robot:x,jobId:w.id,initialStep:T}):null]})},RN="uv tool install git+https://github.com/huggingface/leLab.git && lelab",UZ="http://localhost:8000/",FZ=({open:t,onOpenChange:e,dismissible:n=!0})=>{const[r,i]=_.useState(!1),o=s=>{n||s.preventDefault()},a=async()=>{try{await navigator.clipboard.writeText(RN),i(!0),setTimeout(()=>i(!1),1500)}catch(s){console.warn("Clipboard write failed:",s)}};return h.jsx(Hc,{open:t,onOpenChange:n?e:()=>{},children:h.jsxs(xl,{className:"bg-gray-900 border-gray-700 text-gray-300 sm:max-w-xl",hideClose:!n,onEscapeKeyDown:o,onPointerDownOutside:o,onInteractOutside:o,children:[h.jsxs(bl,{className:"text-center sm:text-center min-w-0",children:[h.jsxs(_l,{className:"text-white flex items-center justify-center gap-2 text-xl",children:[h.jsx(tX,{className:"w-6 h-6"}),"Get Started with LeLab"]}),h.jsx(wl,{children:"LeLab runs on your machine. Click the command to copy it, then paste in a terminal:"})]}),h.jsxs("div",{className:"space-y-4 py-2 min-w-0",children:[h.jsxs("button",{type:"button",onClick:a,"aria-label":"Copy command to clipboard",className:"group relative w-full bg-gray-800 hover:bg-gray-750 rounded-lg border border-gray-700 hover:border-gray-600 text-left transition-colors cursor-pointer",children:[h.jsx("pre",{className:"p-4 pr-12 text-xs sm:text-sm overflow-x-auto whitespace-pre-wrap break-all",children:h.jsx("code",{className:"text-green-400",children:RN})}),h.jsx("span",{className:"absolute right-2 top-2 flex items-center gap-1 px-2 py-1 rounded text-xs text-gray-400 group-hover:text-white bg-gray-900/80",children:r?h.jsxs(h.Fragment,{children:[h.jsx(yl,{className:"w-3.5 h-3.5 text-green-400"}),"Copied"]}):h.jsxs(h.Fragment,{children:[h.jsx(QM,{className:"w-3.5 h-3.5"}),"Copy"]})})]}),h.jsx("p",{className:"text-gray-400 text-sm text-center",children:"After running, your browser will open the local LeLab app."}),h.jsx(et,{asChild:!0,className:"w-full bg-blue-600 hover:bg-blue-700 text-white",children:h.jsxs("a",{href:UZ,target:"_blank",rel:"noopener noreferrer",children:[h.jsx(ll,{className:"w-4 h-4 mr-2"}),"Open LeLab"]})})]})]})})};async function g4(t,e,n){return er(t,e,"/datasets",{signal:n,action:"List datasets"})}const BZ=()=>{const{baseUrl:t,fetchWithHeaders:e}=Ln(),[n,r]=_.useState([]),[i,o]=_.useState(!0),a=_.useCallback(()=>{o(!0),g4(t,e).then(r).catch(()=>r([])).finally(()=>o(!1))},[t,e]);return _.useEffect(()=>{a()},[a]),{datasets:n,loading:i,refresh:a}},$Z=()=>typeof window<"u"&&window.location.hostname.endsWith(".hf.space"),NN=$Z(),zZ=()=>{const[t,e]=_.useState(NN),{auth:n}=xf(),{selectedName:r,selectedRecord:i,availableNames:o,isLoading:a,selectRobot:s,createRobot:l,deleteRobot:c}=jA(),{datasets:u,loading:d}=BZ(),[f,p]=_.useState(!1),[y,v]=_.useState(""),[g,m]=_.useState(""),[x,b]=_.useState(5),[S,w]=_.useState(60),[E,T]=_.useState(15),[A,M]=_.useState(!0),[C,P]=_.useState([]),R=_.useRef(null),D=ji(),{toast:k}=Dr();_.useEffect(()=>{C.length>0&&(R.current&&R.current(),P([]))},[]),_.useEffect(()=>()=>{R.current&&R.current()},[]);const U=()=>{P(i?[...i.cameras??[]]:[]),p(!0)},O=Y=>{p(Y),!Y&&R.current&&R.current()},W=()=>D("/training"),L=(Y,q)=>{const Q=`/spaces/lerobot/visualize_dataset?path=${encodeURIComponent(`/${Y}`)}`,te=q?`https://huggingface.co/login?next=${encodeURIComponent(Q)}`:`https://huggingface.co${Q}`;window.open(te,"_blank","noopener,noreferrer")},j=Y=>{if(Y.source==="local"||Y.source==="both"){D("/upload",{state:{datasetInfo:{dataset_repo_id:Y.repo_id,source:Y.source}}});return}L(Y.repo_id,Y.private)},X=Y=>{L(Y,!0)},K=Y=>{v(Y),U()},F=async()=>{if(!i){k({title:"No robot selected",description:"Select or create a robot on the Landing page first.",variant:"destructive"});return}const Y=i;if(!Y.is_clean){k({title:"Robot not ready",description:`${Y.name} is missing a calibration. Configure it before recording.`,variant:"destructive"});return}if(!y||!g){k({title:"Missing dataset details",description:"Please enter a dataset name and task description.",variant:"destructive"});return}const q=n.status==="authenticated"?`${n.username}/${y}`:y;C.length>0&&R.current&&(k({title:"Preparing Camera Resources",description:`Releasing ${C.length} camera stream(s) for recording...`}),R.current(),await new Promise(ee=>setTimeout(ee,500)),k({title:"Camera Resources Ready",description:"Camera streams released successfully. Starting recording..."}));const Q=C.reduce((ee,ce)=>(ee[ce.name]={type:ce.type,camera_index:ce.camera_index,width:ce.width,height:ce.height,fps:ce.fps},ee),{}),te={leader_port:Y.leader_port,follower_port:Y.follower_port,leader_config:Y.leader_config,follower_config:Y.follower_config,dataset_repo_id:q,single_task:g,num_episodes:x,episode_time_s:S,reset_time_s:E,fps:30,video:!0,push_to_hub:!1,resume:!1,streaming_encoding:A,cameras:Q};p(!1),D("/recording",{state:{recordingConfig:te}})};return h.jsxs("div",{className:"min-h-screen bg-black text-white pb-16",style:{"--lelab-topbar-h":"48px"},children:[h.jsx(Qq,{}),h.jsx("div",{className:"sticky z-20 bg-black/95 backdrop-blur supports-[backdrop-filter]:bg-black/70 border-b border-gray-800",style:{top:"var(--lelab-topbar-h)"},children:h.jsxs("div",{className:"mx-auto max-w-7xl px-4 py-4 grid gap-4 grid-cols-1 lg:grid-cols-[1.2fr_2fr]",children:[h.jsx(pJ,{selectedName:r,selectedRecord:i,availableNames:o,isLoading:a,selectRobot:s,createRobot:l,deleteRobot:c}),h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[h.jsxs("div",{className:"bg-gray-800 rounded-lg border border-gray-700 p-3 flex flex-col gap-2",children:[h.jsx("h3",{className:"font-semibold text-lg text-left h-10 flex items-center",children:"Dataset"}),h.jsx(lZ,{datasets:u,loading:d,onPickExisting:j,onOpenCustom:X,onCreateNew:K,children:h.jsxs(et,{variant:"outline",role:"combobox",className:"w-full justify-between bg-gray-800 border-gray-600 text-white hover:bg-gray-700",children:[h.jsx("span",{className:"truncate text-gray-300",children:d?"Loading datasetsโ€ฆ":"Select or create a datasetโ€ฆ"}),h.jsx(JM,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})})]}),h.jsxs("div",{className:"bg-gray-800 rounded-lg border border-gray-700 p-3 flex flex-col gap-2",children:[h.jsx("h3",{className:"font-semibold text-lg text-left h-10 flex items-center",children:"Create a model"}),h.jsx(et,{onClick:W,className:"w-full bg-green-500 hover:bg-green-600 text-white",children:"Training"})]})]})]})}),h.jsx("main",{className:"mx-auto max-w-7xl px-4 py-6",children:h.jsx(jZ,{})}),h.jsx(nK,{}),h.jsx(FZ,{open:t,onOpenChange:e,dismissible:!NN}),h.jsx(oZ,{open:f,onOpenChange:O,robot:i,datasetName:y,setDatasetName:v,singleTask:g,setSingleTask:m,numEpisodes:x,setNumEpisodes:b,episodeTimeS:S,setEpisodeTimeS:w,resetTimeS:E,setResetTimeS:T,streamingEncoding:A,setStreamingEncoding:M,cameras:C,setCameras:P,onStart:F,releaseStreamsRef:R})]})};/** - * @license - * Copyright 2010-2025 Three.js Authors - * SPDX-License-Identifier: MIT - */const UA="177",ad={ROTATE:0,DOLLY:1,PAN:2},zu={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},HZ=0,ON=1,VZ=2,v4=1,y4=2,Da=3,va=0,ui=1,Ki=2,el=0,sd=1,IN=2,DN=3,LN=4,GZ=5,Xl=100,WZ=101,XZ=102,qZ=103,KZ=104,YZ=200,JZ=201,ZZ=202,QZ=203,CE=204,PE=205,eQ=206,tQ=207,nQ=208,rQ=209,iQ=210,oQ=211,aQ=212,sQ=213,lQ=214,RE=0,NE=1,OE=2,jd=3,IE=4,DE=5,LE=6,kE=7,Dx=0,cQ=1,uQ=2,tl=0,dQ=1,fQ=2,hQ=3,pQ=4,mQ=5,gQ=6,vQ=7,kN="attached",yQ="detached",x4=300,Ud=301,Fd=302,jE=303,UE=304,Lx=306,aa=1e3,Ji=1001,Ay=1002,Xr=1003,b4=1004,Ch=1005,Or=1006,Fv=1007,Oo=1008,ya=1009,_4=1010,w4=1011,Sp=1012,FA=1013,Nc=1014,Io=1015,Nm=1016,BA=1017,$A=1018,Ep=1020,S4=35902,E4=1021,T4=1022,Zi=1023,Tp=1026,Mp=1027,zA=1028,HA=1029,M4=1030,VA=1031,GA=1033,Bv=33776,$v=33777,zv=33778,Hv=33779,FE=35840,BE=35841,$E=35842,zE=35843,HE=36196,VE=37492,GE=37496,WE=37808,XE=37809,qE=37810,KE=37811,YE=37812,JE=37813,ZE=37814,QE=37815,e1=37816,t1=37817,n1=37818,r1=37819,i1=37820,o1=37821,Vv=36492,a1=36494,s1=36495,A4=36283,l1=36284,c1=36285,u1=36286,Ap=2300,Cp=2301,H_=2302,jN=2400,UN=2401,FN=2402,xQ=2500,bQ=0,C4=1,d1=2,_Q=3200,wQ=3201,kx=0,SQ=1,Ns="",Zt="srgb",Kr="srgb-linear",Cy="linear",an="srgb",au=7680,BN=519,EQ=512,TQ=513,MQ=514,P4=515,AQ=516,CQ=517,PQ=518,RQ=519,f1=35044,$N="300 es",za=2e3,Py=2001;class Vc{addEventListener(e,n){this._listeners===void 0&&(this._listeners={});const r=this._listeners;r[e]===void 0&&(r[e]=[]),r[e].indexOf(n)===-1&&r[e].push(n)}hasEventListener(e,n){const r=this._listeners;return r===void 0?!1:r[e]!==void 0&&r[e].indexOf(n)!==-1}removeEventListener(e,n){const r=this._listeners;if(r===void 0)return;const i=r[e];if(i!==void 0){const o=i.indexOf(n);o!==-1&&i.splice(o,1)}}dispatchEvent(e){const n=this._listeners;if(n===void 0)return;const r=n[e.type];if(r!==void 0){e.target=this;const i=r.slice(0);for(let o=0,a=i.length;o>8&255]+Mr[t>>16&255]+Mr[t>>24&255]+"-"+Mr[e&255]+Mr[e>>8&255]+"-"+Mr[e>>16&15|64]+Mr[e>>24&255]+"-"+Mr[n&63|128]+Mr[n>>8&255]+"-"+Mr[n>>16&255]+Mr[n>>24&255]+Mr[r&255]+Mr[r>>8&255]+Mr[r>>16&255]+Mr[r>>24&255]).toLowerCase()}function It(t,e,n){return Math.max(e,Math.min(n,t))}function WA(t,e){return(t%e+e)%e}function NQ(t,e,n,r,i){return r+(t-e)*(i-r)/(n-e)}function OQ(t,e,n){return t!==e?(n-t)/(e-t):0}function Wh(t,e,n){return(1-n)*t+n*e}function IQ(t,e,n,r){return Wh(t,e,1-Math.exp(-n*r))}function DQ(t,e=1){return e-Math.abs(WA(t,e*2)-e)}function LQ(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*(3-2*t))}function kQ(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*t*(t*(t*6-15)+10))}function jQ(t,e){return t+Math.floor(Math.random()*(e-t+1))}function UQ(t,e){return t+Math.random()*(e-t)}function FQ(t){return t*(.5-Math.random())}function BQ(t){t!==void 0&&(zN=t);let e=zN+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function $Q(t){return t*Gh}function zQ(t){return t*Bd}function HQ(t){return(t&t-1)===0&&t!==0}function VQ(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function GQ(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function WQ(t,e,n,r,i){const o=Math.cos,a=Math.sin,s=o(n/2),l=a(n/2),c=o((e+r)/2),u=a((e+r)/2),d=o((e-r)/2),f=a((e-r)/2),p=o((r-e)/2),y=a((r-e)/2);switch(i){case"XYX":t.set(s*u,l*d,l*f,s*c);break;case"YZY":t.set(l*f,s*u,l*d,s*c);break;case"ZXZ":t.set(l*d,l*f,s*u,s*c);break;case"XZX":t.set(s*u,l*y,l*p,s*c);break;case"YXY":t.set(l*p,s*u,l*y,s*c);break;case"ZYZ":t.set(l*y,l*p,s*u,s*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Po(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function tn(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(t*4294967295);case Uint16Array:return Math.round(t*65535);case Uint8Array:return Math.round(t*255);case Int32Array:return Math.round(t*2147483647);case Int16Array:return Math.round(t*32767);case Int8Array:return Math.round(t*127);default:throw new Error("Invalid component type.")}}const ql={DEG2RAD:Gh,RAD2DEG:Bd,generateUUID:Uo,clamp:It,euclideanModulo:WA,mapLinear:NQ,inverseLerp:OQ,lerp:Wh,damp:IQ,pingpong:DQ,smoothstep:LQ,smootherstep:kQ,randInt:jQ,randFloat:UQ,randFloatSpread:FQ,seededRandom:BQ,degToRad:$Q,radToDeg:zQ,isPowerOfTwo:HQ,ceilPowerOfTwo:VQ,floorPowerOfTwo:GQ,setQuaternionFromProperEuler:WQ,normalize:tn,denormalize:Po};class xt{constructor(e=0,n=0){xt.prototype.isVector2=!0,this.x=e,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,n){return this.x=e,this.y=n,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const n=this.x,r=this.y,i=e.elements;return this.x=i[0]*n+i[3]*r+i[6],this.y=i[1]*n+i[4]*r+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,n){return this.x=It(this.x,e.x,n.x),this.y=It(this.y,e.y,n.y),this}clampScalar(e,n){return this.x=It(this.x,e,n),this.y=It(this.y,e,n),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(It(r,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const r=this.dot(e)/n;return Math.acos(It(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y;return n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this}rotateAround(e,n){const r=Math.cos(n),i=Math.sin(n),o=this.x-e.x,a=this.y-e.y;return this.x=o*r-a*i+e.x,this.y=o*i+a*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Ii{constructor(e=0,n=0,r=0,i=1){this.isQuaternion=!0,this._x=e,this._y=n,this._z=r,this._w=i}static slerpFlat(e,n,r,i,o,a,s){let l=r[i+0],c=r[i+1],u=r[i+2],d=r[i+3];const f=o[a+0],p=o[a+1],y=o[a+2],v=o[a+3];if(s===0){e[n+0]=l,e[n+1]=c,e[n+2]=u,e[n+3]=d;return}if(s===1){e[n+0]=f,e[n+1]=p,e[n+2]=y,e[n+3]=v;return}if(d!==v||l!==f||c!==p||u!==y){let g=1-s;const m=l*f+c*p+u*y+d*v,x=m>=0?1:-1,b=1-m*m;if(b>Number.EPSILON){const w=Math.sqrt(b),E=Math.atan2(w,m*x);g=Math.sin(g*E)/w,s=Math.sin(s*E)/w}const S=s*x;if(l=l*g+f*S,c=c*g+p*S,u=u*g+y*S,d=d*g+v*S,g===1-s){const w=1/Math.sqrt(l*l+c*c+u*u+d*d);l*=w,c*=w,u*=w,d*=w}}e[n]=l,e[n+1]=c,e[n+2]=u,e[n+3]=d}static multiplyQuaternionsFlat(e,n,r,i,o,a){const s=r[i],l=r[i+1],c=r[i+2],u=r[i+3],d=o[a],f=o[a+1],p=o[a+2],y=o[a+3];return e[n]=s*y+u*d+l*p-c*f,e[n+1]=l*y+u*f+c*d-s*p,e[n+2]=c*y+u*p+s*f-l*d,e[n+3]=u*y-s*d-l*f-c*p,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,n,r,i){return this._x=e,this._y=n,this._z=r,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,n=!0){const r=e._x,i=e._y,o=e._z,a=e._order,s=Math.cos,l=Math.sin,c=s(r/2),u=s(i/2),d=s(o/2),f=l(r/2),p=l(i/2),y=l(o/2);switch(a){case"XYZ":this._x=f*u*d+c*p*y,this._y=c*p*d-f*u*y,this._z=c*u*y+f*p*d,this._w=c*u*d-f*p*y;break;case"YXZ":this._x=f*u*d+c*p*y,this._y=c*p*d-f*u*y,this._z=c*u*y-f*p*d,this._w=c*u*d+f*p*y;break;case"ZXY":this._x=f*u*d-c*p*y,this._y=c*p*d+f*u*y,this._z=c*u*y+f*p*d,this._w=c*u*d-f*p*y;break;case"ZYX":this._x=f*u*d-c*p*y,this._y=c*p*d+f*u*y,this._z=c*u*y-f*p*d,this._w=c*u*d+f*p*y;break;case"YZX":this._x=f*u*d+c*p*y,this._y=c*p*d+f*u*y,this._z=c*u*y-f*p*d,this._w=c*u*d-f*p*y;break;case"XZY":this._x=f*u*d-c*p*y,this._y=c*p*d-f*u*y,this._z=c*u*y+f*p*d,this._w=c*u*d+f*p*y;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return n===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,n){const r=n/2,i=Math.sin(r);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(e){const n=e.elements,r=n[0],i=n[4],o=n[8],a=n[1],s=n[5],l=n[9],c=n[2],u=n[6],d=n[10],f=r+s+d;if(f>0){const p=.5/Math.sqrt(f+1);this._w=.25/p,this._x=(u-l)*p,this._y=(o-c)*p,this._z=(a-i)*p}else if(r>s&&r>d){const p=2*Math.sqrt(1+r-s-d);this._w=(u-l)/p,this._x=.25*p,this._y=(i+a)/p,this._z=(o+c)/p}else if(s>d){const p=2*Math.sqrt(1+s-r-d);this._w=(o-c)/p,this._x=(i+a)/p,this._y=.25*p,this._z=(l+u)/p}else{const p=2*Math.sqrt(1+d-r-s);this._w=(a-i)/p,this._x=(o+c)/p,this._y=(l+u)/p,this._z=.25*p}return this._onChangeCallback(),this}setFromUnitVectors(e,n){let r=e.dot(n)+1;return rMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=r):(this._x=0,this._y=-e.z,this._z=e.y,this._w=r)):(this._x=e.y*n.z-e.z*n.y,this._y=e.z*n.x-e.x*n.z,this._z=e.x*n.y-e.y*n.x,this._w=r),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(It(this.dot(e),-1,1)))}rotateTowards(e,n){const r=this.angleTo(e);if(r===0)return this;const i=Math.min(1,n/r);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,n){const r=e._x,i=e._y,o=e._z,a=e._w,s=n._x,l=n._y,c=n._z,u=n._w;return this._x=r*u+a*s+i*c-o*l,this._y=i*u+a*l+o*s-r*c,this._z=o*u+a*c+r*l-i*s,this._w=a*u-r*s-i*l-o*c,this._onChangeCallback(),this}slerp(e,n){if(n===0)return this;if(n===1)return this.copy(e);const r=this._x,i=this._y,o=this._z,a=this._w;let s=a*e._w+r*e._x+i*e._y+o*e._z;if(s<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,s=-s):this.copy(e),s>=1)return this._w=a,this._x=r,this._y=i,this._z=o,this;const l=1-s*s;if(l<=Number.EPSILON){const p=1-n;return this._w=p*a+n*this._w,this._x=p*r+n*this._x,this._y=p*i+n*this._y,this._z=p*o+n*this._z,this.normalize(),this}const c=Math.sqrt(l),u=Math.atan2(c,s),d=Math.sin((1-n)*u)/c,f=Math.sin(n*u)/c;return this._w=a*d+this._w*f,this._x=r*d+this._x*f,this._y=i*d+this._y*f,this._z=o*d+this._z*f,this._onChangeCallback(),this}slerpQuaternions(e,n,r){return this.copy(e).slerp(n,r)}random(){const e=2*Math.PI*Math.random(),n=2*Math.PI*Math.random(),r=Math.random(),i=Math.sqrt(1-r),o=Math.sqrt(r);return this.set(i*Math.sin(e),i*Math.cos(e),o*Math.sin(n),o*Math.cos(n))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,n=0){return this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._w,e}fromBufferAttribute(e,n){return this._x=e.getX(n),this._y=e.getY(n),this._z=e.getZ(n),this._w=e.getW(n),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class ne{constructor(e=0,n=0,r=0){ne.prototype.isVector3=!0,this.x=e,this.y=n,this.z=r}set(e,n,r){return r===void 0&&(r=this.z),this.x=e,this.y=n,this.z=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,n){return this.x=e.x*n.x,this.y=e.y*n.y,this.z=e.z*n.z,this}applyEuler(e){return this.applyQuaternion(HN.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(HN.setFromAxisAngle(e,n))}applyMatrix3(e){const n=this.x,r=this.y,i=this.z,o=e.elements;return this.x=o[0]*n+o[3]*r+o[6]*i,this.y=o[1]*n+o[4]*r+o[7]*i,this.z=o[2]*n+o[5]*r+o[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const n=this.x,r=this.y,i=this.z,o=e.elements,a=1/(o[3]*n+o[7]*r+o[11]*i+o[15]);return this.x=(o[0]*n+o[4]*r+o[8]*i+o[12])*a,this.y=(o[1]*n+o[5]*r+o[9]*i+o[13])*a,this.z=(o[2]*n+o[6]*r+o[10]*i+o[14])*a,this}applyQuaternion(e){const n=this.x,r=this.y,i=this.z,o=e.x,a=e.y,s=e.z,l=e.w,c=2*(a*i-s*r),u=2*(s*n-o*i),d=2*(o*r-a*n);return this.x=n+l*c+a*d-s*u,this.y=r+l*u+s*c-o*d,this.z=i+l*d+o*u-a*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const n=this.x,r=this.y,i=this.z,o=e.elements;return this.x=o[0]*n+o[4]*r+o[8]*i,this.y=o[1]*n+o[5]*r+o[9]*i,this.z=o[2]*n+o[6]*r+o[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,n){return this.x=It(this.x,e.x,n.x),this.y=It(this.y,e.y,n.y),this.z=It(this.z,e.z,n.z),this}clampScalar(e,n){return this.x=It(this.x,e,n),this.y=It(this.y,e,n),this.z=It(this.z,e,n),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(It(r,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this.z=e.z+(n.z-e.z)*r,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,n){const r=e.x,i=e.y,o=e.z,a=n.x,s=n.y,l=n.z;return this.x=i*l-o*s,this.y=o*a-r*l,this.z=r*s-i*a,this}projectOnVector(e){const n=e.lengthSq();if(n===0)return this.set(0,0,0);const r=e.dot(this)/n;return this.copy(e).multiplyScalar(r)}projectOnPlane(e){return V_.copy(this).projectOnVector(e),this.sub(V_)}reflect(e){return this.sub(V_.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const r=this.dot(e)/n;return Math.acos(It(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y,i=this.z-e.z;return n*n+r*r+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,n,r){const i=Math.sin(n)*e;return this.x=i*Math.sin(r),this.y=Math.cos(n)*e,this.z=i*Math.cos(r),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,n,r){return this.x=e*Math.sin(n),this.y=r,this.z=e*Math.cos(n),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(e){const n=this.setFromMatrixColumn(e,0).length(),r=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=n,this.y=r,this.z=i,this}setFromMatrixColumn(e,n){return this.fromArray(e.elements,n*4)}setFromMatrix3Column(e,n){return this.fromArray(e.elements,n*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,n=Math.random()*2-1,r=Math.sqrt(1-n*n);return this.x=r*Math.cos(e),this.y=n,this.z=r*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const V_=new ne,HN=new Ii;class Pt{constructor(e,n,r,i,o,a,s,l,c){Pt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,n,r,i,o,a,s,l,c)}set(e,n,r,i,o,a,s,l,c){const u=this.elements;return u[0]=e,u[1]=i,u[2]=s,u[3]=n,u[4]=o,u[5]=l,u[6]=r,u[7]=a,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const n=this.elements,r=e.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],this}extractBasis(e,n,r){return e.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const n=e.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const r=e.elements,i=n.elements,o=this.elements,a=r[0],s=r[3],l=r[6],c=r[1],u=r[4],d=r[7],f=r[2],p=r[5],y=r[8],v=i[0],g=i[3],m=i[6],x=i[1],b=i[4],S=i[7],w=i[2],E=i[5],T=i[8];return o[0]=a*v+s*x+l*w,o[3]=a*g+s*b+l*E,o[6]=a*m+s*S+l*T,o[1]=c*v+u*x+d*w,o[4]=c*g+u*b+d*E,o[7]=c*m+u*S+d*T,o[2]=f*v+p*x+y*w,o[5]=f*g+p*b+y*E,o[8]=f*m+p*S+y*T,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=e,n[4]*=e,n[7]*=e,n[2]*=e,n[5]*=e,n[8]*=e,this}determinant(){const e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],u=e[8];return n*a*u-n*s*c-r*o*u+r*s*l+i*o*c-i*a*l}invert(){const e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],u=e[8],d=u*a-s*c,f=s*l-u*o,p=c*o-a*l,y=n*d+r*f+i*p;if(y===0)return this.set(0,0,0,0,0,0,0,0,0);const v=1/y;return e[0]=d*v,e[1]=(i*c-u*r)*v,e[2]=(s*r-i*a)*v,e[3]=f*v,e[4]=(u*n-i*l)*v,e[5]=(i*o-s*n)*v,e[6]=p*v,e[7]=(r*l-c*n)*v,e[8]=(a*n-r*o)*v,this}transpose(){let e;const n=this.elements;return e=n[1],n[1]=n[3],n[3]=e,e=n[2],n[2]=n[6],n[6]=e,e=n[5],n[5]=n[7],n[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const n=this.elements;return e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],this}setUvTransform(e,n,r,i,o,a,s){const l=Math.cos(o),c=Math.sin(o);return this.set(r*l,r*c,-r*(l*a+c*s)+a+e,-i*c,i*l,-i*(-c*a+l*s)+s+n,0,0,1),this}scale(e,n){return this.premultiply(G_.makeScale(e,n)),this}rotate(e){return this.premultiply(G_.makeRotation(-e)),this}translate(e,n){return this.premultiply(G_.makeTranslation(e,n)),this}makeTranslation(e,n){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,n,0,0,1),this}makeRotation(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,-r,0,r,n,0,0,0,1),this}makeScale(e,n){return this.set(e,0,0,0,n,0,0,0,1),this}equals(e){const n=this.elements,r=e.elements;for(let i=0;i<9;i++)if(n[i]!==r[i])return!1;return!0}fromArray(e,n=0){for(let r=0;r<9;r++)this.elements[r]=e[r+n];return this}toArray(e=[],n=0){const r=this.elements;return e[n]=r[0],e[n+1]=r[1],e[n+2]=r[2],e[n+3]=r[3],e[n+4]=r[4],e[n+5]=r[5],e[n+6]=r[6],e[n+7]=r[7],e[n+8]=r[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const G_=new Pt;function R4(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}function Pp(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function XQ(){const t=Pp("canvas");return t.style.display="block",t}const VN={};function ld(t){t in VN||(VN[t]=!0,console.warn(t))}function qQ(t,e,n){return new Promise(function(r,i){function o(){switch(t.clientWaitSync(e,t.SYNC_FLUSH_COMMANDS_BIT,0)){case t.WAIT_FAILED:i();break;case t.TIMEOUT_EXPIRED:setTimeout(o,n);break;default:r()}}setTimeout(o,n)})}function KQ(t){const e=t.elements;e[2]=.5*e[2]+.5*e[3],e[6]=.5*e[6]+.5*e[7],e[10]=.5*e[10]+.5*e[11],e[14]=.5*e[14]+.5*e[15]}function YQ(t){const e=t.elements;e[11]===-1?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=-e[14]+1)}const GN=new Pt().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),WN=new Pt().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function JQ(){const t={enabled:!0,workingColorSpace:Kr,spaces:{},convert:function(i,o,a){return this.enabled===!1||o===a||!o||!a||(this.spaces[o].transfer===an&&(i.r=qa(i.r),i.g=qa(i.g),i.b=qa(i.b)),this.spaces[o].primaries!==this.spaces[a].primaries&&(i.applyMatrix3(this.spaces[o].toXYZ),i.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===an&&(i.r=cd(i.r),i.g=cd(i.g),i.b=cd(i.b))),i},workingToColorSpace:function(i,o){return this.convert(i,this.workingColorSpace,o)},colorSpaceToWorking:function(i,o){return this.convert(i,o,this.workingColorSpace)},getPrimaries:function(i){return this.spaces[i].primaries},getTransfer:function(i){return i===Ns?Cy:this.spaces[i].transfer},getLuminanceCoefficients:function(i,o=this.workingColorSpace){return i.fromArray(this.spaces[o].luminanceCoefficients)},define:function(i){Object.assign(this.spaces,i)},_getMatrix:function(i,o,a){return i.copy(this.spaces[o].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(i){return this.spaces[i].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(i=this.workingColorSpace){return this.spaces[i].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(i,o){return ld("THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),t.workingToColorSpace(i,o)},toWorkingColorSpace:function(i,o){return ld("THREE.ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),t.colorSpaceToWorking(i,o)}},e=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],r=[.3127,.329];return t.define({[Kr]:{primaries:e,whitePoint:r,transfer:Cy,toXYZ:GN,fromXYZ:WN,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:Zt},outputColorSpaceConfig:{drawingBufferColorSpace:Zt}},[Zt]:{primaries:e,whitePoint:r,transfer:an,toXYZ:GN,fromXYZ:WN,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:Zt}}}),t}const Dt=JQ();function qa(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function cd(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}let su;class ZQ{static getDataURL(e,n="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let r;if(e instanceof HTMLCanvasElement)r=e;else{su===void 0&&(su=Pp("canvas")),su.width=e.width,su.height=e.height;const i=su.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),r=su}return r.toDataURL(n)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const n=Pp("canvas");n.width=e.width,n.height=e.height;const r=n.getContext("2d");r.drawImage(e,0,0,e.width,e.height);const i=r.getImageData(0,0,e.width,e.height),o=i.data;for(let a=0;a1),this.pmremVersion=0}get width(){return this.source.getSize(X_).x}get height(){return this.source.getSize(X_).y}get depth(){return this.source.getSize(X_).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const n in e){const r=e[n];if(r===void 0){console.warn(`THREE.Texture.setValues(): parameter '${n}' has value of undefined.`);continue}const i=this[n];if(i===void 0){console.warn(`THREE.Texture.setValues(): property '${n}' does not exist.`);continue}i&&r&&i.isVector2&&r.isVector2||i&&r&&i.isVector3&&r.isVector3||i&&r&&i.isMatrix3&&r.isMatrix3?i.copy(r):this[n]=r}}toJSON(e){const n=e===void 0||typeof e=="string";if(!n&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const r={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(r.userData=this.userData),n||(e.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==x4)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case aa:e.x=e.x-Math.floor(e.x);break;case Ji:e.x=e.x<0?0:1;break;case Ay:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case aa:e.y=e.y-Math.floor(e.y);break;case Ji:e.y=e.y<0?0:1;break;case Ay:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}lr.DEFAULT_IMAGE=null;lr.DEFAULT_MAPPING=x4;lr.DEFAULT_ANISOTROPY=1;class Yt{constructor(e=0,n=0,r=0,i=1){Yt.prototype.isVector4=!0,this.x=e,this.y=n,this.z=r,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,n,r,i){return this.x=e,this.y=n,this.z=r,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this.w=e.w+n.w,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this.w+=e.w*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this.w=e.w-n.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const n=this.x,r=this.y,i=this.z,o=this.w,a=e.elements;return this.x=a[0]*n+a[4]*r+a[8]*i+a[12]*o,this.y=a[1]*n+a[5]*r+a[9]*i+a[13]*o,this.z=a[2]*n+a[6]*r+a[10]*i+a[14]*o,this.w=a[3]*n+a[7]*r+a[11]*i+a[15]*o,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const n=Math.sqrt(1-e.w*e.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/n,this.y=e.y/n,this.z=e.z/n),this}setAxisAngleFromRotationMatrix(e){let n,r,i,o;const l=e.elements,c=l[0],u=l[4],d=l[8],f=l[1],p=l[5],y=l[9],v=l[2],g=l[6],m=l[10];if(Math.abs(u-f)<.01&&Math.abs(d-v)<.01&&Math.abs(y-g)<.01){if(Math.abs(u+f)<.1&&Math.abs(d+v)<.1&&Math.abs(y+g)<.1&&Math.abs(c+p+m-3)<.1)return this.set(1,0,0,0),this;n=Math.PI;const b=(c+1)/2,S=(p+1)/2,w=(m+1)/2,E=(u+f)/4,T=(d+v)/4,A=(y+g)/4;return b>S&&b>w?b<.01?(r=0,i=.707106781,o=.707106781):(r=Math.sqrt(b),i=E/r,o=T/r):S>w?S<.01?(r=.707106781,i=0,o=.707106781):(i=Math.sqrt(S),r=E/i,o=A/i):w<.01?(r=.707106781,i=.707106781,o=0):(o=Math.sqrt(w),r=T/o,i=A/o),this.set(r,i,o,n),this}let x=Math.sqrt((g-y)*(g-y)+(d-v)*(d-v)+(f-u)*(f-u));return Math.abs(x)<.001&&(x=1),this.x=(g-y)/x,this.y=(d-v)/x,this.z=(f-u)/x,this.w=Math.acos((c+p+m-1)/2),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this.w=n[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,n){return this.x=It(this.x,e.x,n.x),this.y=It(this.y,e.y,n.y),this.z=It(this.z,e.z,n.z),this.w=It(this.w,e.w,n.w),this}clampScalar(e,n){return this.x=It(this.x,e,n),this.y=It(this.y,e,n),this.z=It(this.z,e,n),this.w=It(this.w,e,n),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(It(r,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this.w+=(e.w-this.w)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this.z=e.z+(n.z-e.z)*r,this.w=e.w+(n.w-e.w)*r,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this.w=e[n+3],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e[n+3]=this.w,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this.w=e.getW(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class tee extends Vc{constructor(e=1,n=1,r={}){super(),r=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Or,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},r),this.isRenderTarget=!0,this.width=e,this.height=n,this.depth=r.depth,this.scissor=new Yt(0,0,e,n),this.scissorTest=!1,this.viewport=new Yt(0,0,e,n);const i={width:e,height:n,depth:r.depth},o=new lr(i);this.textures=[];const a=r.count;for(let s=0;s1;this.dispose()}this.viewport.set(0,0,e,n),this.scissor.set(0,0,e,n)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let n=0,r=e.textures.length;n=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,n){return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,fo),fo.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let n,r;return e.normal.x>0?(n=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(n=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(n+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(n+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(n+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(n+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),n<=-e.constant&&r>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(nh),Cg.subVectors(this.max,nh),lu.subVectors(e.a,nh),cu.subVectors(e.b,nh),uu.subVectors(e.c,nh),gs.subVectors(cu,lu),vs.subVectors(uu,cu),Ol.subVectors(lu,uu);let n=[0,-gs.z,gs.y,0,-vs.z,vs.y,0,-Ol.z,Ol.y,gs.z,0,-gs.x,vs.z,0,-vs.x,Ol.z,0,-Ol.x,-gs.y,gs.x,0,-vs.y,vs.x,0,-Ol.y,Ol.x,0];return!q_(n,lu,cu,uu,Cg)||(n=[1,0,0,0,1,0,0,0,1],!q_(n,lu,cu,uu,Cg))?!1:(Pg.crossVectors(gs,vs),n=[Pg.x,Pg.y,Pg.z],q_(n,lu,cu,uu,Cg))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,fo).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(fo).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Ma[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Ma[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Ma[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Ma[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Ma[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Ma[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Ma[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Ma[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Ma),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const Ma=[new ne,new ne,new ne,new ne,new ne,new ne,new ne,new ne],fo=new ne,Ag=new Wo,lu=new ne,cu=new ne,uu=new ne,gs=new ne,vs=new ne,Ol=new ne,nh=new ne,Cg=new ne,Pg=new ne,Il=new ne;function q_(t,e,n,r,i){for(let o=0,a=t.length-3;o<=a;o+=3){Il.fromArray(t,o);const s=i.x*Math.abs(Il.x)+i.y*Math.abs(Il.y)+i.z*Math.abs(Il.z),l=e.dot(Il),c=n.dot(Il),u=r.dot(Il);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>s)return!1}return!0}const ree=new Wo,rh=new ne,K_=new ne;class Xo{constructor(e=new ne,n=-1){this.isSphere=!0,this.center=e,this.radius=n}set(e,n){return this.center.copy(e),this.radius=n,this}setFromPoints(e,n){const r=this.center;n!==void 0?r.copy(n):ree.setFromPoints(e).getCenter(r);let i=0;for(let o=0,a=e.length;othis.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;rh.subVectors(e,this.center);const n=rh.lengthSq();if(n>this.radius*this.radius){const r=Math.sqrt(n),i=(r-this.radius)*.5;this.center.addScaledVector(rh,i/r),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(K_.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(rh.copy(e.center).add(K_)),this.expandByPoint(rh.copy(e.center).sub(K_))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}const Aa=new ne,Y_=new ne,Rg=new ne,ys=new ne,J_=new ne,Ng=new ne,Z_=new ne;class Sf{constructor(e=new ne,n=new ne(0,0,-1)){this.origin=e,this.direction=n}set(e,n){return this.origin.copy(e),this.direction.copy(n),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,n){return n.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Aa)),this}closestPointToPoint(e,n){n.subVectors(e,this.origin);const r=n.dot(this.direction);return r<0?n.copy(this.origin):n.copy(this.origin).addScaledVector(this.direction,r)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const n=Aa.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(Aa.copy(this.origin).addScaledVector(this.direction,n),Aa.distanceToSquared(e))}distanceSqToSegment(e,n,r,i){Y_.copy(e).add(n).multiplyScalar(.5),Rg.copy(n).sub(e).normalize(),ys.copy(this.origin).sub(Y_);const o=e.distanceTo(n)*.5,a=-this.direction.dot(Rg),s=ys.dot(this.direction),l=-ys.dot(Rg),c=ys.lengthSq(),u=Math.abs(1-a*a);let d,f,p,y;if(u>0)if(d=a*l-s,f=a*s-l,y=o*u,d>=0)if(f>=-y)if(f<=y){const v=1/u;d*=v,f*=v,p=d*(d+a*f+2*s)+f*(a*d+f+2*l)+c}else f=o,d=Math.max(0,-(a*f+s)),p=-d*d+f*(f+2*l)+c;else f=-o,d=Math.max(0,-(a*f+s)),p=-d*d+f*(f+2*l)+c;else f<=-y?(d=Math.max(0,-(-a*o+s)),f=d>0?-o:Math.min(Math.max(-o,-l),o),p=-d*d+f*(f+2*l)+c):f<=y?(d=0,f=Math.min(Math.max(-o,-l),o),p=f*(f+2*l)+c):(d=Math.max(0,-(a*o+s)),f=d>0?o:Math.min(Math.max(-o,-l),o),p=-d*d+f*(f+2*l)+c);else f=a>0?-o:o,d=Math.max(0,-(a*f+s)),p=-d*d+f*(f+2*l)+c;return r&&r.copy(this.origin).addScaledVector(this.direction,d),i&&i.copy(Y_).addScaledVector(Rg,f),p}intersectSphere(e,n){Aa.subVectors(e.center,this.origin);const r=Aa.dot(this.direction),i=Aa.dot(Aa)-r*r,o=e.radius*e.radius;if(i>o)return null;const a=Math.sqrt(o-i),s=r-a,l=r+a;return l<0?null:s<0?this.at(l,n):this.at(s,n)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const n=e.normal.dot(this.direction);if(n===0)return e.distanceToPoint(this.origin)===0?0:null;const r=-(this.origin.dot(e.normal)+e.constant)/n;return r>=0?r:null}intersectPlane(e,n){const r=this.distanceToPlane(e);return r===null?null:this.at(r,n)}intersectsPlane(e){const n=e.distanceToPoint(this.origin);return n===0||e.normal.dot(this.direction)*n<0}intersectBox(e,n){let r,i,o,a,s,l;const c=1/this.direction.x,u=1/this.direction.y,d=1/this.direction.z,f=this.origin;return c>=0?(r=(e.min.x-f.x)*c,i=(e.max.x-f.x)*c):(r=(e.max.x-f.x)*c,i=(e.min.x-f.x)*c),u>=0?(o=(e.min.y-f.y)*u,a=(e.max.y-f.y)*u):(o=(e.max.y-f.y)*u,a=(e.min.y-f.y)*u),r>a||o>i||((o>r||isNaN(r))&&(r=o),(a=0?(s=(e.min.z-f.z)*d,l=(e.max.z-f.z)*d):(s=(e.max.z-f.z)*d,l=(e.min.z-f.z)*d),r>l||s>i)||((s>r||r!==r)&&(r=s),(l=0?r:i,n)}intersectsBox(e){return this.intersectBox(e,Aa)!==null}intersectTriangle(e,n,r,i,o){J_.subVectors(n,e),Ng.subVectors(r,e),Z_.crossVectors(J_,Ng);let a=this.direction.dot(Z_),s;if(a>0){if(i)return null;s=1}else if(a<0)s=-1,a=-a;else return null;ys.subVectors(this.origin,e);const l=s*this.direction.dot(Ng.crossVectors(ys,Ng));if(l<0)return null;const c=s*this.direction.dot(J_.cross(ys));if(c<0||l+c>a)return null;const u=-s*ys.dot(Z_);return u<0?null:this.at(u/a,o)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class gt{constructor(e,n,r,i,o,a,s,l,c,u,d,f,p,y,v,g){gt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,n,r,i,o,a,s,l,c,u,d,f,p,y,v,g)}set(e,n,r,i,o,a,s,l,c,u,d,f,p,y,v,g){const m=this.elements;return m[0]=e,m[4]=n,m[8]=r,m[12]=i,m[1]=o,m[5]=a,m[9]=s,m[13]=l,m[2]=c,m[6]=u,m[10]=d,m[14]=f,m[3]=p,m[7]=y,m[11]=v,m[15]=g,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new gt().fromArray(this.elements)}copy(e){const n=this.elements,r=e.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],n[9]=r[9],n[10]=r[10],n[11]=r[11],n[12]=r[12],n[13]=r[13],n[14]=r[14],n[15]=r[15],this}copyPosition(e){const n=this.elements,r=e.elements;return n[12]=r[12],n[13]=r[13],n[14]=r[14],this}setFromMatrix3(e){const n=e.elements;return this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1),this}extractBasis(e,n,r){return e.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}makeBasis(e,n,r){return this.set(e.x,n.x,r.x,0,e.y,n.y,r.y,0,e.z,n.z,r.z,0,0,0,0,1),this}extractRotation(e){const n=this.elements,r=e.elements,i=1/du.setFromMatrixColumn(e,0).length(),o=1/du.setFromMatrixColumn(e,1).length(),a=1/du.setFromMatrixColumn(e,2).length();return n[0]=r[0]*i,n[1]=r[1]*i,n[2]=r[2]*i,n[3]=0,n[4]=r[4]*o,n[5]=r[5]*o,n[6]=r[6]*o,n[7]=0,n[8]=r[8]*a,n[9]=r[9]*a,n[10]=r[10]*a,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromEuler(e){const n=this.elements,r=e.x,i=e.y,o=e.z,a=Math.cos(r),s=Math.sin(r),l=Math.cos(i),c=Math.sin(i),u=Math.cos(o),d=Math.sin(o);if(e.order==="XYZ"){const f=a*u,p=a*d,y=s*u,v=s*d;n[0]=l*u,n[4]=-l*d,n[8]=c,n[1]=p+y*c,n[5]=f-v*c,n[9]=-s*l,n[2]=v-f*c,n[6]=y+p*c,n[10]=a*l}else if(e.order==="YXZ"){const f=l*u,p=l*d,y=c*u,v=c*d;n[0]=f+v*s,n[4]=y*s-p,n[8]=a*c,n[1]=a*d,n[5]=a*u,n[9]=-s,n[2]=p*s-y,n[6]=v+f*s,n[10]=a*l}else if(e.order==="ZXY"){const f=l*u,p=l*d,y=c*u,v=c*d;n[0]=f-v*s,n[4]=-a*d,n[8]=y+p*s,n[1]=p+y*s,n[5]=a*u,n[9]=v-f*s,n[2]=-a*c,n[6]=s,n[10]=a*l}else if(e.order==="ZYX"){const f=a*u,p=a*d,y=s*u,v=s*d;n[0]=l*u,n[4]=y*c-p,n[8]=f*c+v,n[1]=l*d,n[5]=v*c+f,n[9]=p*c-y,n[2]=-c,n[6]=s*l,n[10]=a*l}else if(e.order==="YZX"){const f=a*l,p=a*c,y=s*l,v=s*c;n[0]=l*u,n[4]=v-f*d,n[8]=y*d+p,n[1]=d,n[5]=a*u,n[9]=-s*u,n[2]=-c*u,n[6]=p*d+y,n[10]=f-v*d}else if(e.order==="XZY"){const f=a*l,p=a*c,y=s*l,v=s*c;n[0]=l*u,n[4]=-d,n[8]=c*u,n[1]=f*d+v,n[5]=a*u,n[9]=p*d-y,n[2]=y*d-p,n[6]=s*u,n[10]=v*d+f}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromQuaternion(e){return this.compose(iee,e,oee)}lookAt(e,n,r){const i=this.elements;return xi.subVectors(e,n),xi.lengthSq()===0&&(xi.z=1),xi.normalize(),xs.crossVectors(r,xi),xs.lengthSq()===0&&(Math.abs(r.z)===1?xi.x+=1e-4:xi.z+=1e-4,xi.normalize(),xs.crossVectors(r,xi)),xs.normalize(),Og.crossVectors(xi,xs),i[0]=xs.x,i[4]=Og.x,i[8]=xi.x,i[1]=xs.y,i[5]=Og.y,i[9]=xi.y,i[2]=xs.z,i[6]=Og.z,i[10]=xi.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const r=e.elements,i=n.elements,o=this.elements,a=r[0],s=r[4],l=r[8],c=r[12],u=r[1],d=r[5],f=r[9],p=r[13],y=r[2],v=r[6],g=r[10],m=r[14],x=r[3],b=r[7],S=r[11],w=r[15],E=i[0],T=i[4],A=i[8],M=i[12],C=i[1],P=i[5],R=i[9],D=i[13],k=i[2],U=i[6],O=i[10],W=i[14],L=i[3],j=i[7],X=i[11],K=i[15];return o[0]=a*E+s*C+l*k+c*L,o[4]=a*T+s*P+l*U+c*j,o[8]=a*A+s*R+l*O+c*X,o[12]=a*M+s*D+l*W+c*K,o[1]=u*E+d*C+f*k+p*L,o[5]=u*T+d*P+f*U+p*j,o[9]=u*A+d*R+f*O+p*X,o[13]=u*M+d*D+f*W+p*K,o[2]=y*E+v*C+g*k+m*L,o[6]=y*T+v*P+g*U+m*j,o[10]=y*A+v*R+g*O+m*X,o[14]=y*M+v*D+g*W+m*K,o[3]=x*E+b*C+S*k+w*L,o[7]=x*T+b*P+S*U+w*j,o[11]=x*A+b*R+S*O+w*X,o[15]=x*M+b*D+S*W+w*K,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[4]*=e,n[8]*=e,n[12]*=e,n[1]*=e,n[5]*=e,n[9]*=e,n[13]*=e,n[2]*=e,n[6]*=e,n[10]*=e,n[14]*=e,n[3]*=e,n[7]*=e,n[11]*=e,n[15]*=e,this}determinant(){const e=this.elements,n=e[0],r=e[4],i=e[8],o=e[12],a=e[1],s=e[5],l=e[9],c=e[13],u=e[2],d=e[6],f=e[10],p=e[14],y=e[3],v=e[7],g=e[11],m=e[15];return y*(+o*l*d-i*c*d-o*s*f+r*c*f+i*s*p-r*l*p)+v*(+n*l*p-n*c*f+o*a*f-i*a*p+i*c*u-o*l*u)+g*(+n*c*d-n*s*p-o*a*d+r*a*p+o*s*u-r*c*u)+m*(-i*s*u-n*l*d+n*s*f+i*a*d-r*a*f+r*l*u)}transpose(){const e=this.elements;let n;return n=e[1],e[1]=e[4],e[4]=n,n=e[2],e[2]=e[8],e[8]=n,n=e[6],e[6]=e[9],e[9]=n,n=e[3],e[3]=e[12],e[12]=n,n=e[7],e[7]=e[13],e[13]=n,n=e[11],e[11]=e[14],e[14]=n,this}setPosition(e,n,r){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=n,i[14]=r),this}invert(){const e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],u=e[8],d=e[9],f=e[10],p=e[11],y=e[12],v=e[13],g=e[14],m=e[15],x=d*g*c-v*f*c+v*l*p-s*g*p-d*l*m+s*f*m,b=y*f*c-u*g*c-y*l*p+a*g*p+u*l*m-a*f*m,S=u*v*c-y*d*c+y*s*p-a*v*p-u*s*m+a*d*m,w=y*d*l-u*v*l-y*s*f+a*v*f+u*s*g-a*d*g,E=n*x+r*b+i*S+o*w;if(E===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const T=1/E;return e[0]=x*T,e[1]=(v*f*o-d*g*o-v*i*p+r*g*p+d*i*m-r*f*m)*T,e[2]=(s*g*o-v*l*o+v*i*c-r*g*c-s*i*m+r*l*m)*T,e[3]=(d*l*o-s*f*o-d*i*c+r*f*c+s*i*p-r*l*p)*T,e[4]=b*T,e[5]=(u*g*o-y*f*o+y*i*p-n*g*p-u*i*m+n*f*m)*T,e[6]=(y*l*o-a*g*o-y*i*c+n*g*c+a*i*m-n*l*m)*T,e[7]=(a*f*o-u*l*o+u*i*c-n*f*c-a*i*p+n*l*p)*T,e[8]=S*T,e[9]=(y*d*o-u*v*o-y*r*p+n*v*p+u*r*m-n*d*m)*T,e[10]=(a*v*o-y*s*o+y*r*c-n*v*c-a*r*m+n*s*m)*T,e[11]=(u*s*o-a*d*o-u*r*c+n*d*c+a*r*p-n*s*p)*T,e[12]=w*T,e[13]=(u*v*i-y*d*i+y*r*f-n*v*f-u*r*g+n*d*g)*T,e[14]=(y*s*i-a*v*i-y*r*l+n*v*l+a*r*g-n*s*g)*T,e[15]=(a*d*i-u*s*i+u*r*l-n*d*l-a*r*f+n*s*f)*T,this}scale(e){const n=this.elements,r=e.x,i=e.y,o=e.z;return n[0]*=r,n[4]*=i,n[8]*=o,n[1]*=r,n[5]*=i,n[9]*=o,n[2]*=r,n[6]*=i,n[10]*=o,n[3]*=r,n[7]*=i,n[11]*=o,this}getMaxScaleOnAxis(){const e=this.elements,n=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(n,r,i))}makeTranslation(e,n,r){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,n,0,0,1,r,0,0,0,1),this}makeRotationX(e){const n=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,n,-r,0,0,r,n,0,0,0,0,1),this}makeRotationY(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,0,r,0,0,1,0,0,-r,0,n,0,0,0,0,1),this}makeRotationZ(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,-r,0,0,r,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,n){const r=Math.cos(n),i=Math.sin(n),o=1-r,a=e.x,s=e.y,l=e.z,c=o*a,u=o*s;return this.set(c*a+r,c*s-i*l,c*l+i*s,0,c*s+i*l,u*s+r,u*l-i*a,0,c*l-i*s,u*l+i*a,o*l*l+r,0,0,0,0,1),this}makeScale(e,n,r){return this.set(e,0,0,0,0,n,0,0,0,0,r,0,0,0,0,1),this}makeShear(e,n,r,i,o,a){return this.set(1,r,o,0,e,1,a,0,n,i,1,0,0,0,0,1),this}compose(e,n,r){const i=this.elements,o=n._x,a=n._y,s=n._z,l=n._w,c=o+o,u=a+a,d=s+s,f=o*c,p=o*u,y=o*d,v=a*u,g=a*d,m=s*d,x=l*c,b=l*u,S=l*d,w=r.x,E=r.y,T=r.z;return i[0]=(1-(v+m))*w,i[1]=(p+S)*w,i[2]=(y-b)*w,i[3]=0,i[4]=(p-S)*E,i[5]=(1-(f+m))*E,i[6]=(g+x)*E,i[7]=0,i[8]=(y+b)*T,i[9]=(g-x)*T,i[10]=(1-(f+v))*T,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,n,r){const i=this.elements;let o=du.set(i[0],i[1],i[2]).length();const a=du.set(i[4],i[5],i[6]).length(),s=du.set(i[8],i[9],i[10]).length();this.determinant()<0&&(o=-o),e.x=i[12],e.y=i[13],e.z=i[14],ho.copy(this);const c=1/o,u=1/a,d=1/s;return ho.elements[0]*=c,ho.elements[1]*=c,ho.elements[2]*=c,ho.elements[4]*=u,ho.elements[5]*=u,ho.elements[6]*=u,ho.elements[8]*=d,ho.elements[9]*=d,ho.elements[10]*=d,n.setFromRotationMatrix(ho),r.x=o,r.y=a,r.z=s,this}makePerspective(e,n,r,i,o,a,s=za){const l=this.elements,c=2*o/(n-e),u=2*o/(r-i),d=(n+e)/(n-e),f=(r+i)/(r-i);let p,y;if(s===za)p=-(a+o)/(a-o),y=-2*a*o/(a-o);else if(s===Py)p=-a/(a-o),y=-a*o/(a-o);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+s);return l[0]=c,l[4]=0,l[8]=d,l[12]=0,l[1]=0,l[5]=u,l[9]=f,l[13]=0,l[2]=0,l[6]=0,l[10]=p,l[14]=y,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,n,r,i,o,a,s=za){const l=this.elements,c=1/(n-e),u=1/(r-i),d=1/(a-o),f=(n+e)*c,p=(r+i)*u;let y,v;if(s===za)y=(a+o)*d,v=-2*d;else if(s===Py)y=o*d,v=-1*d;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+s);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-f,l[1]=0,l[5]=2*u,l[9]=0,l[13]=-p,l[2]=0,l[6]=0,l[10]=v,l[14]=-y,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const n=this.elements,r=e.elements;for(let i=0;i<16;i++)if(n[i]!==r[i])return!1;return!0}fromArray(e,n=0){for(let r=0;r<16;r++)this.elements[r]=e[r+n];return this}toArray(e=[],n=0){const r=this.elements;return e[n]=r[0],e[n+1]=r[1],e[n+2]=r[2],e[n+3]=r[3],e[n+4]=r[4],e[n+5]=r[5],e[n+6]=r[6],e[n+7]=r[7],e[n+8]=r[8],e[n+9]=r[9],e[n+10]=r[10],e[n+11]=r[11],e[n+12]=r[12],e[n+13]=r[13],e[n+14]=r[14],e[n+15]=r[15],e}}const du=new ne,ho=new gt,iee=new ne(0,0,0),oee=new ne(1,1,1),xs=new ne,Og=new ne,xi=new ne,XN=new gt,qN=new Ii;class pi{constructor(e=0,n=0,r=0,i=pi.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=n,this._z=r,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,n,r,i=this._order){return this._x=e,this._y=n,this._z=r,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,n=this._order,r=!0){const i=e.elements,o=i[0],a=i[4],s=i[8],l=i[1],c=i[5],u=i[9],d=i[2],f=i[6],p=i[10];switch(n){case"XYZ":this._y=Math.asin(It(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-u,p),this._z=Math.atan2(-a,o)):(this._x=Math.atan2(f,c),this._z=0);break;case"YXZ":this._x=Math.asin(-It(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(s,p),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-d,o),this._z=0);break;case"ZXY":this._x=Math.asin(It(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-d,p),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,o));break;case"ZYX":this._y=Math.asin(-It(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(f,p),this._z=Math.atan2(l,o)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(It(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-d,o)):(this._x=0,this._y=Math.atan2(s,p));break;case"XZY":this._z=Math.asin(-It(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(f,c),this._y=Math.atan2(s,o)):(this._x=Math.atan2(-u,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,r===!0&&this._onChangeCallback(),this}setFromQuaternion(e,n,r){return XN.makeRotationFromQuaternion(e),this.setFromRotationMatrix(XN,n,r)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return qN.setFromEuler(this),this.setFromQuaternion(qN,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}pi.DEFAULT_ORDER="XYZ";class qA{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let n=0;n1){for(let r=0;r0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.geometryInfo=this._geometryInfo.map(s=>({...s,boundingBox:s.boundingBox?s.boundingBox.toJSON():void 0,boundingSphere:s.boundingSphere?s.boundingSphere.toJSON():void 0})),i.instanceInfo=this._instanceInfo.map(s=>({...s})),i.availableInstanceIds=this._availableInstanceIds.slice(),i.availableGeometryIds=this._availableGeometryIds.slice(),i.nextIndexStart=this._nextIndexStart,i.nextVertexStart=this._nextVertexStart,i.geometryCount=this._geometryCount,i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.matricesTexture=this._matricesTexture.toJSON(e),i.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(i.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(i.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(i.boundingBox=this.boundingBox.toJSON()));function o(s,l){return s[l.uuid]===void 0&&(s[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=o(e.geometries,this.geometry);const s=this.geometry.parameters;if(s!==void 0&&s.shapes!==void 0){const l=s.shapes;if(Array.isArray(l))for(let c=0,u=l.length;c0){i.children=[];for(let s=0;s0){i.animations=[];for(let s=0;s0&&(r.geometries=s),l.length>0&&(r.materials=l),c.length>0&&(r.textures=c),u.length>0&&(r.images=u),d.length>0&&(r.shapes=d),f.length>0&&(r.skeletons=f),p.length>0&&(r.animations=p),y.length>0&&(r.nodes=y)}return r.object=i,r;function a(s){const l=[];for(const c in s){const u=s[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,n=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),n===!0)for(let r=0;r0?i.multiplyScalar(1/Math.sqrt(o)):i.set(0,0,0)}static getBarycoord(e,n,r,i,o){po.subVectors(i,n),Pa.subVectors(r,n),ew.subVectors(e,n);const a=po.dot(po),s=po.dot(Pa),l=po.dot(ew),c=Pa.dot(Pa),u=Pa.dot(ew),d=a*c-s*s;if(d===0)return o.set(0,0,0),null;const f=1/d,p=(c*l-s*u)*f,y=(a*u-s*l)*f;return o.set(1-p-y,y,p)}static containsPoint(e,n,r,i){return this.getBarycoord(e,n,r,i,Ra)===null?!1:Ra.x>=0&&Ra.y>=0&&Ra.x+Ra.y<=1}static getInterpolation(e,n,r,i,o,a,s,l){return this.getBarycoord(e,n,r,i,Ra)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(o,Ra.x),l.addScaledVector(a,Ra.y),l.addScaledVector(s,Ra.z),l)}static getInterpolatedAttribute(e,n,r,i,o,a){return iw.setScalar(0),ow.setScalar(0),aw.setScalar(0),iw.fromBufferAttribute(e,n),ow.fromBufferAttribute(e,r),aw.fromBufferAttribute(e,i),a.setScalar(0),a.addScaledVector(iw,o.x),a.addScaledVector(ow,o.y),a.addScaledVector(aw,o.z),a}static isFrontFacing(e,n,r,i){return po.subVectors(r,n),Pa.subVectors(e,n),po.cross(Pa).dot(i)<0}set(e,n,r){return this.a.copy(e),this.b.copy(n),this.c.copy(r),this}setFromPointsAndIndices(e,n,r,i){return this.a.copy(e[n]),this.b.copy(e[r]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,n,r,i){return this.a.fromBufferAttribute(e,n),this.b.fromBufferAttribute(e,r),this.c.fromBufferAttribute(e,i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return po.subVectors(this.c,this.b),Pa.subVectors(this.a,this.b),po.cross(Pa).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Ro.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return Ro.getBarycoord(e,this.a,this.b,this.c,n)}getInterpolation(e,n,r,i,o){return Ro.getInterpolation(e,this.a,this.b,this.c,n,r,i,o)}containsPoint(e){return Ro.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Ro.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,n){const r=this.a,i=this.b,o=this.c;let a,s;pu.subVectors(i,r),mu.subVectors(o,r),tw.subVectors(e,r);const l=pu.dot(tw),c=mu.dot(tw);if(l<=0&&c<=0)return n.copy(r);nw.subVectors(e,i);const u=pu.dot(nw),d=mu.dot(nw);if(u>=0&&d<=u)return n.copy(i);const f=l*d-u*c;if(f<=0&&l>=0&&u<=0)return a=l/(l-u),n.copy(r).addScaledVector(pu,a);rw.subVectors(e,o);const p=pu.dot(rw),y=mu.dot(rw);if(y>=0&&p<=y)return n.copy(o);const v=p*c-l*y;if(v<=0&&c>=0&&y<=0)return s=c/(c-y),n.copy(r).addScaledVector(mu,s);const g=u*y-p*d;if(g<=0&&d-u>=0&&p-y>=0)return eO.subVectors(o,i),s=(d-u)/(d-u+(p-y)),n.copy(i).addScaledVector(eO,s);const m=1/(g+v+f);return a=v*m,s=f*m,n.copy(r).addScaledVector(pu,a).addScaledVector(mu,s)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const O4={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},bs={h:0,s:0,l:0},Dg={h:0,s:0,l:0};function sw(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*6*(2/3-n):t}let ft=class{constructor(e,n,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,n,r)}set(e,n,r){if(n===void 0&&r===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,n,r);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,n=Zt){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Dt.colorSpaceToWorking(this,n),this}setRGB(e,n,r,i=Dt.workingColorSpace){return this.r=e,this.g=n,this.b=r,Dt.colorSpaceToWorking(this,i),this}setHSL(e,n,r,i=Dt.workingColorSpace){if(e=WA(e,1),n=It(n,0,1),r=It(r,0,1),n===0)this.r=this.g=this.b=r;else{const o=r<=.5?r*(1+n):r+n-r*n,a=2*r-o;this.r=sw(a,o,e+1/3),this.g=sw(a,o,e),this.b=sw(a,o,e-1/3)}return Dt.colorSpaceToWorking(this,i),this}setStyle(e,n=Zt){function r(o){o!==void 0&&parseFloat(o)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let o;const a=i[1],s=i[2];switch(a){case"rgb":case"rgba":if(o=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return r(o[4]),this.setRGB(Math.min(255,parseInt(o[1],10))/255,Math.min(255,parseInt(o[2],10))/255,Math.min(255,parseInt(o[3],10))/255,n);if(o=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return r(o[4]),this.setRGB(Math.min(100,parseInt(o[1],10))/100,Math.min(100,parseInt(o[2],10))/100,Math.min(100,parseInt(o[3],10))/100,n);break;case"hsl":case"hsla":if(o=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return r(o[4]),this.setHSL(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,n);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const o=i[1],a=o.length;if(a===3)return this.setRGB(parseInt(o.charAt(0),16)/15,parseInt(o.charAt(1),16)/15,parseInt(o.charAt(2),16)/15,n);if(a===6)return this.setHex(parseInt(o,16),n);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,n);return this}setColorName(e,n=Zt){const r=O4[e.toLowerCase()];return r!==void 0?this.setHex(r,n):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=qa(e.r),this.g=qa(e.g),this.b=qa(e.b),this}copyLinearToSRGB(e){return this.r=cd(e.r),this.g=cd(e.g),this.b=cd(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Zt){return Dt.workingToColorSpace(Ar.copy(this),e),Math.round(It(Ar.r*255,0,255))*65536+Math.round(It(Ar.g*255,0,255))*256+Math.round(It(Ar.b*255,0,255))}getHexString(e=Zt){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=Dt.workingColorSpace){Dt.workingToColorSpace(Ar.copy(this),n);const r=Ar.r,i=Ar.g,o=Ar.b,a=Math.max(r,i,o),s=Math.min(r,i,o);let l,c;const u=(s+a)/2;if(s===a)l=0,c=0;else{const d=a-s;switch(c=u<=.5?d/(a+s):d/(2-a-s),a){case r:l=(i-o)/d+(i0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const n in e){const r=e[n];if(r===void 0){console.warn(`THREE.Material: parameter '${n}' has value of undefined.`);continue}const i=this[n];if(i===void 0){console.warn(`THREE.Material: '${n}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(r):i&&i.isVector3&&r&&r.isVector3?i.copy(r):this[n]=r}}toJSON(e){const n=e===void 0||typeof e=="string";n&&(e={textures:{},images:{}});const r={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),this.roughness!==void 0&&(r.roughness=this.roughness),this.metalness!==void 0&&(r.metalness=this.metalness),this.sheen!==void 0&&(r.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(r.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(r.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(r.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(r.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(r.shininess=this.shininess),this.clearcoat!==void 0&&(r.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(r.dispersion=this.dispersion),this.iridescence!==void 0&&(r.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(r.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(r.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(r.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(r.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(r.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(r.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(e).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(e).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(e).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(e).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(e).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(r.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(r.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(r.combine=this.combine)),this.envMapRotation!==void 0&&(r.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(r.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(r.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(r.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(r.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(r.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(r.size=this.size),this.shadowSide!==null&&(r.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(r.sizeAttenuation=this.sizeAttenuation),this.blending!==sd&&(r.blending=this.blending),this.side!==va&&(r.side=this.side),this.vertexColors===!0&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),this.transparent===!0&&(r.transparent=!0),this.blendSrc!==CE&&(r.blendSrc=this.blendSrc),this.blendDst!==PE&&(r.blendDst=this.blendDst),this.blendEquation!==Xl&&(r.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(r.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(r.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(r.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(r.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(r.blendAlpha=this.blendAlpha),this.depthFunc!==jd&&(r.depthFunc=this.depthFunc),this.depthTest===!1&&(r.depthTest=this.depthTest),this.depthWrite===!1&&(r.depthWrite=this.depthWrite),this.colorWrite===!1&&(r.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(r.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==BN&&(r.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(r.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(r.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==au&&(r.stencilFail=this.stencilFail),this.stencilZFail!==au&&(r.stencilZFail=this.stencilZFail),this.stencilZPass!==au&&(r.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(r.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(r.rotation=this.rotation),this.polygonOffset===!0&&(r.polygonOffset=!0),this.polygonOffsetFactor!==0&&(r.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(r.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(r.linewidth=this.linewidth),this.dashSize!==void 0&&(r.dashSize=this.dashSize),this.gapSize!==void 0&&(r.gapSize=this.gapSize),this.scale!==void 0&&(r.scale=this.scale),this.dithering===!0&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),this.alphaHash===!0&&(r.alphaHash=!0),this.alphaToCoverage===!0&&(r.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(r.premultipliedAlpha=!0),this.forceSinglePass===!0&&(r.forceSinglePass=!0),this.wireframe===!0&&(r.wireframe=!0),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(r.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(r.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(r.flatShading=!0),this.visible===!1&&(r.visible=!1),this.toneMapped===!1&&(r.toneMapped=!1),this.fog===!1&&(r.fog=!1),Object.keys(this.userData).length>0&&(r.userData=this.userData);function i(o){const a=[];for(const s in o){const l=o[s];delete l.metadata,a.push(l)}return a}if(n){const o=i(e.textures),a=i(e.images);o.length>0&&(r.textures=o),a.length>0&&(r.images=a)}return r}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const n=e.clippingPlanes;let r=null;if(n!==null){const i=n.length;r=new Array(i);for(let o=0;o!==i;++o)r[o]=n[o].clone()}return this.clippingPlanes=r,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class sa extends qr{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new ft(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new pi,this.combine=Dx,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Bn=new ne,Lg=new xt;let dee=0;class cr{constructor(e,n,r=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:dee++}),this.name="",this.array=e,this.itemSize=n,this.count=e!==void 0?e.length/n:0,this.normalized=r,this.usage=f1,this.updateRanges=[],this.gpuType=Io,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,n,r){e*=this.itemSize,r*=n.itemSize;for(let i=0,o=this.itemSize;in.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),n.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Wo);const e=this.attributes.position,n=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new ne(-1/0,-1/0,-1/0),new ne(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),n)for(let r=0,i=n.length;r0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const n=this.index;n!==null&&(e.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});const r=this.attributes;for(const l in r){const c=r[l];e.data.attributes[l]=c.toJSON(e.data)}const i={};let o=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let d=0,f=c.length;d0&&(i[l]=u,o=!0)}o&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const s=this.boundingSphere;return s!==null&&(e.data.boundingSphere=s.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const n={};this.name=e.name;const r=e.index;r!==null&&this.setIndex(r.clone());const i=e.attributes;for(const c in i){const u=i[c];this.setAttribute(c,u.clone(n))}const o=e.morphAttributes;for(const c in o){const u=[],d=o[c];for(let f=0,p=d.length;f0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,a=i.length;o(e.far-e.near)**2))&&(tO.copy(o).invert(),Dl.copy(e.ray).applyMatrix4(tO),!(r.boundingBox!==null&&Dl.intersectsBox(r.boundingBox)===!1)&&this._computeIntersections(e,n,Dl)))}_computeIntersections(e,n,r){let i;const o=this.geometry,a=this.material,s=o.index,l=o.attributes.position,c=o.attributes.uv,u=o.attributes.uv1,d=o.attributes.normal,f=o.groups,p=o.drawRange;if(s!==null)if(Array.isArray(a))for(let y=0,v=f.length;yn.far?null:{distance:c,point:$g.clone(),object:t}}function zg(t,e,n,r,i,o,a,s,l,c){t.getVertexPosition(s,jg),t.getVertexPosition(l,Ug),t.getVertexPosition(c,Fg);const u=hee(t,e,n,r,jg,Ug,Fg,rO);if(u){const d=new ne;Ro.getBarycoord(rO,jg,Ug,Fg,d),i&&(u.uv=Ro.getInterpolatedAttribute(i,s,l,c,d,new xt)),o&&(u.uv1=Ro.getInterpolatedAttribute(o,s,l,c,d,new xt)),a&&(u.normal=Ro.getInterpolatedAttribute(a,s,l,c,d,new ne),u.normal.dot(r.direction)>0&&u.normal.multiplyScalar(-1));const f={a:s,b:l,c,normal:new ne,materialIndex:0};Ro.getNormal(jg,Ug,Fg,f.normal),u.face=f,u.barycoord=d}return u}class Gc extends br{constructor(e=1,n=1,r=1,i=1,o=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:n,depth:r,widthSegments:i,heightSegments:o,depthSegments:a};const s=this;i=Math.floor(i),o=Math.floor(o),a=Math.floor(a);const l=[],c=[],u=[],d=[];let f=0,p=0;y("z","y","x",-1,-1,r,n,e,a,o,0),y("z","y","x",1,-1,r,n,-e,a,o,1),y("x","z","y",1,1,e,r,n,i,a,2),y("x","z","y",1,-1,e,r,-n,i,a,3),y("x","y","z",1,-1,e,n,r,i,o,4),y("x","y","z",-1,-1,e,n,-r,i,o,5),this.setIndex(l),this.setAttribute("position",new Qt(c,3)),this.setAttribute("normal",new Qt(u,3)),this.setAttribute("uv",new Qt(d,2));function y(v,g,m,x,b,S,w,E,T,A,M){const C=S/T,P=w/A,R=S/2,D=w/2,k=E/2,U=T+1,O=A+1;let W=0,L=0;const j=new ne;for(let X=0;X0?1:-1,u.push(j.x,j.y,j.z),d.push(F/T),d.push(1-X/A),W+=1}}for(let X=0;X0&&(n.defines=this.defines),n.vertexShader=this.vertexShader,n.fragmentShader=this.fragmentShader,n.lights=this.lights,n.clipping=this.clipping;const r={};for(const i in this.extensions)this.extensions[i]===!0&&(r[i]=!0);return Object.keys(r).length>0&&(n.extensions=r),n}}class k4 extends vn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new gt,this.projectionMatrix=new gt,this.projectionMatrixInverse=new gt,this.coordinateSystem=za}copy(e,n){return super.copy(e,n),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,n){super.updateWorldMatrix(e,n),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const _s=new ne,iO=new xt,oO=new xt;class gr extends k4{constructor(e=50,n=1,r=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=r,this.far=i,this.focus=10,this.aspect=n,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const n=.5*this.getFilmHeight()/e;this.fov=Bd*2*Math.atan(n),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Gh*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Bd*2*Math.atan(Math.tan(Gh*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,n,r){_s.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(_s.x,_s.y).multiplyScalar(-e/_s.z),_s.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),r.set(_s.x,_s.y).multiplyScalar(-e/_s.z)}getViewSize(e,n){return this.getViewBounds(e,iO,oO),n.subVectors(oO,iO)}setViewOffset(e,n,r,i,o,a){this.aspect=e/n,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let n=e*Math.tan(Gh*.5*this.fov)/this.zoom,r=2*n,i=this.aspect*r,o=-.5*i;const a=this.view;if(this.view!==null&&this.view.enabled){const l=a.fullWidth,c=a.fullHeight;o+=a.offsetX*i/l,n-=a.offsetY*r/c,i*=a.width/l,r*=a.height/c}const s=this.filmOffset;s!==0&&(o+=e*s/this.getFilmWidth()),this.projectionMatrix.makePerspective(o,o+i,n,n-r,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.fov=this.fov,n.object.zoom=this.zoom,n.object.near=this.near,n.object.far=this.far,n.object.focus=this.focus,n.object.aspect=this.aspect,this.view!==null&&(n.object.view=Object.assign({},this.view)),n.object.filmGauge=this.filmGauge,n.object.filmOffset=this.filmOffset,n}}const vu=-90,yu=1;class yee extends vn{constructor(e,n,r){super(),this.type="CubeCamera",this.renderTarget=r,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new gr(vu,yu,e,n);i.layers=this.layers,this.add(i);const o=new gr(vu,yu,e,n);o.layers=this.layers,this.add(o);const a=new gr(vu,yu,e,n);a.layers=this.layers,this.add(a);const s=new gr(vu,yu,e,n);s.layers=this.layers,this.add(s);const l=new gr(vu,yu,e,n);l.layers=this.layers,this.add(l);const c=new gr(vu,yu,e,n);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,n=this.children.concat(),[r,i,o,a,s,l]=n;for(const c of n)this.remove(c);if(e===za)r.up.set(0,1,0),r.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),o.up.set(0,0,-1),o.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),s.up.set(0,1,0),s.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===Py)r.up.set(0,-1,0),r.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),o.up.set(0,0,1),o.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),s.up.set(0,-1,0),s.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const c of n)this.add(c),c.updateMatrixWorld()}update(e,n){this.parent===null&&this.updateMatrixWorld();const{renderTarget:r,activeMipmapLevel:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[o,a,s,l,c,u]=this.children,d=e.getRenderTarget(),f=e.getActiveCubeFace(),p=e.getActiveMipmapLevel(),y=e.xr.enabled;e.xr.enabled=!1;const v=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,e.setRenderTarget(r,0,i),e.render(n,o),e.setRenderTarget(r,1,i),e.render(n,a),e.setRenderTarget(r,2,i),e.render(n,s),e.setRenderTarget(r,3,i),e.render(n,l),e.setRenderTarget(r,4,i),e.render(n,c),r.texture.generateMipmaps=v,e.setRenderTarget(r,5,i),e.render(n,u),e.setRenderTarget(d,f,p),e.xr.enabled=y,r.texture.needsPMREMUpdate=!0}}class j4 extends lr{constructor(e=[],n=Ud,r,i,o,a,s,l,c,u){super(e,n,r,i,o,a,s,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class xee extends Oc{constructor(e=1,n={}){super(e,e,n),this.isWebGLCubeRenderTarget=!0;const r={width:e,height:e,depth:1},i=[r,r,r,r,r,r];this.texture=new j4(i),this._setTextureOptions(n),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(e,n){this.texture.type=n.type,this.texture.colorSpace=n.colorSpace,this.texture.generateMipmaps=n.generateMipmaps,this.texture.minFilter=n.minFilter,this.texture.magFilter=n.magFilter;const r={uniforms:{tEquirect:{value:null}},vertexShader:` - - varying vec3 vWorldDirection; - - vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); - - } - - void main() { - - vWorldDirection = transformDirection( position, modelMatrix ); - - #include - #include - - } - `,fragmentShader:` - - uniform sampler2D tEquirect; - - varying vec3 vWorldDirection; - - #include - - void main() { - - vec3 direction = normalize( vWorldDirection ); - - vec2 sampleUV = equirectUv( direction ); - - gl_FragColor = texture2D( tEquirect, sampleUV ); - - } - `},i=new Gc(5,5,5),o=new fl({name:"CubemapFromEquirect",uniforms:$d(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:ui,blending:el});o.uniforms.tEquirect.value=n;const a=new Mn(i,o),s=n.minFilter;return n.minFilter===Oo&&(n.minFilter=Or),new yee(1,10,this).update(e,a),n.minFilter=s,a.geometry.dispose(),a.material.dispose(),this}clear(e,n=!0,r=!0,i=!0){const o=e.getRenderTarget();for(let a=0;a<6;a++)e.setRenderTarget(this,a),e.clear(n,r,i);e.setRenderTarget(o)}}let la=class extends vn{constructor(){super(),this.isGroup=!0,this.type="Group"}};const bee={type:"move"};class uw{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new la,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new la,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new ne,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new ne),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new la,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new ne,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new ne),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const n=this._hand;if(n)for(const r of e.hand.values())this._getHandJoint(n,r)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,n,r){let i=null,o=null,a=null;const s=this._targetRay,l=this._grip,c=this._hand;if(e&&n.session.visibilityState!=="visible-blurred"){if(c&&e.hand){a=!0;for(const v of e.hand.values()){const g=n.getJointPose(v,r),m=this._getHandJoint(c,v);g!==null&&(m.matrix.fromArray(g.transform.matrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.matrixWorldNeedsUpdate=!0,m.jointRadius=g.radius),m.visible=g!==null}const u=c.joints["index-finger-tip"],d=c.joints["thumb-tip"],f=u.position.distanceTo(d.position),p=.02,y=.005;c.inputState.pinching&&f>p+y?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&f<=p-y&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(o=n.getPose(e.gripSpace,r),o!==null&&(l.matrix.fromArray(o.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,o.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(o.linearVelocity)):l.hasLinearVelocity=!1,o.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(o.angularVelocity)):l.hasAngularVelocity=!1));s!==null&&(i=n.getPose(e.targetRaySpace,r),i===null&&o!==null&&(i=o),i!==null&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(bee)))}return s!==null&&(s.visible=i!==null),l!==null&&(l.visible=o!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(e,n){if(e.joints[n.jointName]===void 0){const r=new la;r.matrixAutoUpdate=!1,r.visible=!1,e.joints[n.jointName]=r,e.add(r)}return e.joints[n.jointName]}}class U4 extends vn{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new pi,this.environmentIntensity=1,this.environmentRotation=new pi,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,n){return super.copy(e,n),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const n=super.toJSON(e);return this.fog!==null&&(n.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(n.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(n.object.backgroundIntensity=this.backgroundIntensity),n.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(n.object.environmentIntensity=this.environmentIntensity),n.object.environmentRotation=this.environmentRotation.toArray(),n}}class _ee{constructor(e,n){this.isInterleavedBuffer=!0,this.array=e,this.stride=n,this.count=e!==void 0?e.length/n:0,this.usage=f1,this.updateRanges=[],this.version=0,this.uuid=Uo()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,n,r){e*=this.stride,r*=n.stride;for(let i=0,o=this.stride;i1?null:n.copy(e.start).addScaledVector(r,o)}intersectsLine(e){const n=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return n<0&&r>0||r<0&&n>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,n){const r=n||Aee.getNormalMatrix(e),i=this.coplanarPoint(hw).applyMatrix4(e),o=this.normal.applyMatrix3(r).normalize();return this.constant=-i.dot(o),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Ll=new Xo,Gg=new ne;class ZA{constructor(e=new Ua,n=new Ua,r=new Ua,i=new Ua,o=new Ua,a=new Ua){this.planes=[e,n,r,i,o,a]}set(e,n,r,i,o,a){const s=this.planes;return s[0].copy(e),s[1].copy(n),s[2].copy(r),s[3].copy(i),s[4].copy(o),s[5].copy(a),this}copy(e){const n=this.planes;for(let r=0;r<6;r++)n[r].copy(e.planes[r]);return this}setFromProjectionMatrix(e,n=za){const r=this.planes,i=e.elements,o=i[0],a=i[1],s=i[2],l=i[3],c=i[4],u=i[5],d=i[6],f=i[7],p=i[8],y=i[9],v=i[10],g=i[11],m=i[12],x=i[13],b=i[14],S=i[15];if(r[0].setComponents(l-o,f-c,g-p,S-m).normalize(),r[1].setComponents(l+o,f+c,g+p,S+m).normalize(),r[2].setComponents(l+a,f+u,g+y,S+x).normalize(),r[3].setComponents(l-a,f-u,g-y,S-x).normalize(),r[4].setComponents(l-s,f-d,g-v,S-b).normalize(),n===za)r[5].setComponents(l+s,f+d,g+v,S+b).normalize();else if(n===Py)r[5].setComponents(s,d,v,b).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+n);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Ll.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const n=e.geometry;n.boundingSphere===null&&n.computeBoundingSphere(),Ll.copy(n.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Ll)}intersectsSprite(e){return Ll.center.set(0,0,0),Ll.radius=.7071067811865476,Ll.applyMatrix4(e.matrixWorld),this.intersectsSphere(Ll)}intersectsSphere(e){const n=this.planes,r=e.center,i=-e.radius;for(let o=0;o<6;o++)if(n[o].distanceToPoint(r)0?e.max.x:e.min.x,Gg.y=i.normal.y>0?e.max.y:e.min.y,Gg.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Gg)<0)return!1}return!0}containsPoint(e){const n=this.planes;for(let r=0;r<6;r++)if(n[r].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class pc extends qr{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new ft(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const Ry=new ne,Ny=new ne,pO=new gt,lh=new Sf,Wg=new Xo,pw=new ne,mO=new ne;let Ux=class extends vn{constructor(e=new br,n=new pc){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=n,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,n){return super.copy(e,n),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const n=e.attributes.position,r=[0];for(let i=1,o=n.count;i0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,a=i.length;or)return;pw.applyMatrix4(t.matrixWorld);const c=e.ray.origin.distanceTo(pw);if(!(ce.far))return{distance:c,point:mO.clone().applyMatrix4(t.matrixWorld),index:a,face:null,faceIndex:null,barycoord:null,object:t}}const gO=new ne,vO=new ne;class Oy extends Ux{constructor(e,n){super(e,n),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const n=e.attributes.position,r=[];for(let i=0,o=n.count;i0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,a=i.length;oi.far)return;o.push({distance:c,distanceToRay:Math.sqrt(s),point:l,index:e,face:null,faceIndex:null,barycoord:null,object:a})}}class B4 extends lr{constructor(e,n,r=Nc,i,o,a,s=Xr,l=Xr,c,u=Tp,d=1){if(u!==Tp&&u!==Mp)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const f={width:e,height:n,depth:d};super(f,i,o,a,s,l,u,r,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new XA(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const n=super.toJSON(e);return this.compareFunction!==null&&(n.compareFunction=this.compareFunction),n}}class QA extends br{constructor(e=1,n=1,r=1,i=32,o=1,a=!1,s=0,l=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:n,height:r,radialSegments:i,heightSegments:o,openEnded:a,thetaStart:s,thetaLength:l};const c=this;i=Math.floor(i),o=Math.floor(o);const u=[],d=[],f=[],p=[];let y=0;const v=[],g=r/2;let m=0;x(),a===!1&&(e>0&&b(!0),n>0&&b(!1)),this.setIndex(u),this.setAttribute("position",new Qt(d,3)),this.setAttribute("normal",new Qt(f,3)),this.setAttribute("uv",new Qt(p,2));function x(){const S=new ne,w=new ne;let E=0;const T=(n-e)/r;for(let A=0;A<=o;A++){const M=[],C=A/o,P=C*(n-e)+e;for(let R=0;R<=i;R++){const D=R/i,k=D*l+s,U=Math.sin(k),O=Math.cos(k);w.x=P*U,w.y=-C*r+g,w.z=P*O,d.push(w.x,w.y,w.z),S.set(U,T,O).normalize(),f.push(S.x,S.y,S.z),p.push(D,1-C),M.push(y++)}v.push(M)}for(let A=0;A0||M!==0)&&(u.push(C,P,D),E+=3),(n>0||M!==o-1)&&(u.push(P,R,D),E+=3)}c.addGroup(m,E,0),m+=E}function b(S){const w=y,E=new xt,T=new ne;let A=0;const M=S===!0?e:n,C=S===!0?1:-1;for(let R=1;R<=i;R++)d.push(0,g*C,0),f.push(0,C,0),p.push(.5,.5),y++;const P=y;for(let R=0;R<=i;R++){const k=R/i*l+s,U=Math.cos(k),O=Math.sin(k);T.x=M*O,T.y=g*C,T.z=M*U,d.push(T.x,T.y,T.z),f.push(0,C,0),E.x=U*.5+.5,E.y=O*.5*C+.5,p.push(E.x,E.y),y++}for(let R=0;R0)&&p.push(b,S,E),(m!==r-1||l0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class Fo extends qr{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new ft(16777215),this.specular=new ft(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ft(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=kx,this.normalScale=new xt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new pi,this.combine=Dx,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Ree extends qr{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new ft(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ft(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=kx,this.normalScale=new xt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new pi,this.combine=Dx,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Nee extends qr{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=_Q,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class Oee extends qr{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}function Yg(t,e){return!t||t.constructor===e?t:typeof e.BYTES_PER_ELEMENT=="number"?new e(t):Array.prototype.slice.call(t)}function Iee(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Dee(t){function e(i,o){return t[i]-t[o]}const n=t.length,r=new Array(n);for(let i=0;i!==n;++i)r[i]=i;return r.sort(e),r}function bO(t,e,n){const r=t.length,i=new t.constructor(r);for(let o=0,a=0;a!==r;++o){const s=n[o]*e;for(let l=0;l!==e;++l)i[a++]=t[s+l]}return i}function $4(t,e,n,r){let i=1,o=t[0];for(;o!==void 0&&o[r]===void 0;)o=t[i++];if(o===void 0)return;let a=o[r];if(a!==void 0)if(Array.isArray(a))do a=o[r],a!==void 0&&(e.push(o.time),n.push(...a)),o=t[i++];while(o!==void 0);else if(a.toArray!==void 0)do a=o[r],a!==void 0&&(e.push(o.time),a.toArray(n,n.length)),o=t[i++];while(o!==void 0);else do a=o[r],a!==void 0&&(e.push(o.time),n.push(a)),o=t[i++];while(o!==void 0)}class Im{constructor(e,n,r,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new n.constructor(r),this.sampleValues=n,this.valueSize=r,this.settings=null,this.DefaultSettings_={}}evaluate(e){const n=this.parameterPositions;let r=this._cachedIndex,i=n[r],o=n[r-1];e:{t:{let a;n:{r:if(!(e=o)){const s=n[1];e=o)break t}a=r,r=0;break n}break e}for(;r>>1;en;)--a;if(++a,o!==0||a!==i){o>=a&&(a=Math.max(a,1),o=a-1);const s=this.getValueSize();this.times=r.slice(o,a),this.values=this.values.slice(o*s,a*s)}return this}validate(){let e=!0;const n=this.getValueSize();n-Math.floor(n)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const r=this.times,i=this.values,o=r.length;o===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let a=null;for(let s=0;s!==o;s++){const l=r[s];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,s,l),e=!1;break}if(a!==null&&a>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,s,l,a),e=!1;break}a=l}if(i!==void 0&&Iee(i))for(let s=0,l=i.length;s!==l;++s){const c=i[s];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,s,c),e=!1;break}}return e}optimize(){const e=this.times.slice(),n=this.values.slice(),r=this.getValueSize(),i=this.getInterpolation()===H_,o=e.length-1;let a=1;for(let s=1;s0){e[a]=e[o];for(let s=o*r,l=a*r,c=0;c!==r;++c)n[l+c]=n[s+c];++a}return a!==e.length?(this.times=e.slice(0,a),this.values=n.slice(0,a*r)):(this.times=e,this.values=n),this}clone(){const e=this.times.slice(),n=this.values.slice(),r=this.constructor,i=new r(this.name,e,n);return i.createInterpolant=this.createInterpolant,i}}qo.prototype.ValueTypeName="";qo.prototype.TimeBufferType=Float32Array;qo.prototype.ValueBufferType=Float32Array;qo.prototype.DefaultInterpolation=Cp;class Ef extends qo{constructor(e,n,r){super(e,n,r)}}Ef.prototype.ValueTypeName="bool";Ef.prototype.ValueBufferType=Array;Ef.prototype.DefaultInterpolation=Ap;Ef.prototype.InterpolantFactoryMethodLinear=void 0;Ef.prototype.InterpolantFactoryMethodSmooth=void 0;class z4 extends qo{constructor(e,n,r,i){super(e,n,r,i)}}z4.prototype.ValueTypeName="color";class zd extends qo{constructor(e,n,r,i){super(e,n,r,i)}}zd.prototype.ValueTypeName="number";class Uee extends Im{constructor(e,n,r,i){super(e,n,r,i)}interpolate_(e,n,r,i){const o=this.resultBuffer,a=this.sampleValues,s=this.valueSize,l=(r-n)/(i-n);let c=e*s;for(let u=c+s;c!==u;c+=4)Ii.slerpFlat(o,0,a,c-s,a,c,l);return o}}class Ic extends qo{constructor(e,n,r,i){super(e,n,r,i)}InterpolantFactoryMethodLinear(e){return new Uee(this.times,this.values,this.getValueSize(),e)}}Ic.prototype.ValueTypeName="quaternion";Ic.prototype.InterpolantFactoryMethodSmooth=void 0;class Tf extends qo{constructor(e,n,r){super(e,n,r)}}Tf.prototype.ValueTypeName="string";Tf.prototype.ValueBufferType=Array;Tf.prototype.DefaultInterpolation=Ap;Tf.prototype.InterpolantFactoryMethodLinear=void 0;Tf.prototype.InterpolantFactoryMethodSmooth=void 0;class hl extends qo{constructor(e,n,r,i){super(e,n,r,i)}}hl.prototype.ValueTypeName="vector";class m1{constructor(e="",n=-1,r=[],i=xQ){this.name=e,this.tracks=r,this.duration=n,this.blendMode=i,this.uuid=Uo(),this.duration<0&&this.resetDuration()}static parse(e){const n=[],r=e.tracks,i=1/(e.fps||1);for(let a=0,s=r.length;a!==s;++a)n.push(Bee(r[a]).scale(i));const o=new this(e.name,e.duration,n,e.blendMode);return o.uuid=e.uuid,o}static toJSON(e){const n=[],r=e.tracks,i={name:e.name,duration:e.duration,tracks:n,uuid:e.uuid,blendMode:e.blendMode};for(let o=0,a=r.length;o!==a;++o)n.push(qo.toJSON(r[o]));return i}static CreateFromMorphTargetSequence(e,n,r,i){const o=n.length,a=[];for(let s=0;s1){const d=u[1];let f=i[d];f||(i[d]=f=[]),f.push(c)}}const a=[];for(const s in i)a.push(this.CreateFromMorphTargetSequence(s,i[s],n,r));return a}static parseAnimation(e,n){if(console.warn("THREE.AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const r=function(d,f,p,y,v){if(p.length!==0){const g=[],m=[];$4(p,g,m,y),g.length!==0&&v.push(new d(f,g,m))}},i=[],o=e.name||"default",a=e.fps||30,s=e.blendMode;let l=e.length||-1;const c=e.hierarchy||[];for(let d=0;d{n&&n(o),this.manager.itemEnd(e)},0),o;if(Na[e]!==void 0){Na[e].push({onLoad:n,onProgress:r,onError:i});return}Na[e]=[],Na[e].push({onLoad:n,onProgress:r,onError:i});const a=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),s=this.mimeType,l=this.responseType;fetch(a).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const u=Na[e],d=c.body.getReader(),f=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),p=f?parseInt(f):0,y=p!==0;let v=0;const g=new ReadableStream({start(m){x();function x(){d.read().then(({done:b,value:S})=>{if(b)m.close();else{v+=S.byteLength;const w=new ProgressEvent("progress",{lengthComputable:y,loaded:v,total:p});for(let E=0,T=u.length;E{m.error(b)})}}});return new Response(g)}else throw new $ee(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`,c)}).then(c=>{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(u=>new DOMParser().parseFromString(u,s));case"json":return c.json();default:if(s==="")return c.text();{const d=/charset="?([^;"\s]*)"?/i.exec(s),f=d&&d[1]?d[1].toLowerCase():void 0,p=new TextDecoder(f);return c.arrayBuffer().then(y=>p.decode(y))}}}).then(c=>{Bs.add(e,c);const u=Na[e];delete Na[e];for(let d=0,f=u.length;d{const u=Na[e];if(u===void 0)throw this.manager.itemError(e),c;delete Na[e];for(let d=0,f=u.length;d{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class zee extends Vo{constructor(e){super(e)}load(e,n,r,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,a=Bs.get(e);if(a!==void 0)return o.manager.itemStart(e),setTimeout(function(){n&&n(a),o.manager.itemEnd(e)},0),a;const s=Pp("img");function l(){u(),Bs.add(e,this),n&&n(this),o.manager.itemEnd(e)}function c(d){u(),i&&i(d),o.manager.itemError(e),o.manager.itemEnd(e)}function u(){s.removeEventListener("load",l,!1),s.removeEventListener("error",c,!1)}return s.addEventListener("load",l,!1),s.addEventListener("error",c,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(s.crossOrigin=this.crossOrigin),o.manager.itemStart(e),s.src=e,s}}class Hee extends Vo{constructor(e){super(e)}load(e,n,r,i){const o=this,a=new JA,s=new Mf(this.manager);return s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setPath(this.path),s.setWithCredentials(o.withCredentials),s.load(e,function(l){let c;try{c=o.parse(l)}catch(u){if(i!==void 0)i(u);else{console.error(u);return}}c.image!==void 0?a.image=c.image:c.data!==void 0&&(a.image.width=c.width,a.image.height=c.height,a.image.data=c.data),a.wrapS=c.wrapS!==void 0?c.wrapS:Ji,a.wrapT=c.wrapT!==void 0?c.wrapT:Ji,a.magFilter=c.magFilter!==void 0?c.magFilter:Or,a.minFilter=c.minFilter!==void 0?c.minFilter:Or,a.anisotropy=c.anisotropy!==void 0?c.anisotropy:1,c.colorSpace!==void 0&&(a.colorSpace=c.colorSpace),c.flipY!==void 0&&(a.flipY=c.flipY),c.format!==void 0&&(a.format=c.format),c.type!==void 0&&(a.type=c.type),c.mipmaps!==void 0&&(a.mipmaps=c.mipmaps,a.minFilter=Oo),c.mipmapCount===1&&(a.minFilter=Or),c.generateMipmaps!==void 0&&(a.generateMipmaps=c.generateMipmaps),a.needsUpdate=!0,n&&n(a,c)},r,i),a}}class nC extends Vo{constructor(e){super(e)}load(e,n,r,i){const o=new lr,a=new zee(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,function(s){o.image=s,o.needsUpdate=!0,n!==void 0&&n(o)},r,i),o}}class Dm extends vn{constructor(e,n=1){super(),this.isLight=!0,this.type="Light",this.color=new ft(e),this.intensity=n}dispose(){}copy(e,n){return super.copy(e,n),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const n=super.toJSON(e);return n.object.color=this.color.getHex(),n.object.intensity=this.intensity,this.groundColor!==void 0&&(n.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(n.object.distance=this.distance),this.angle!==void 0&&(n.object.angle=this.angle),this.decay!==void 0&&(n.object.decay=this.decay),this.penumbra!==void 0&&(n.object.penumbra=this.penumbra),this.shadow!==void 0&&(n.object.shadow=this.shadow.toJSON()),this.target!==void 0&&(n.object.target=this.target.uuid),n}}class Vee extends Dm{constructor(e,n,r){super(e,r),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(vn.DEFAULT_UP),this.updateMatrix(),this.groundColor=new ft(n)}copy(e,n){return super.copy(e,n),this.groundColor.copy(e.groundColor),this}}const mw=new gt,_O=new ne,wO=new ne;class rC{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new xt(512,512),this.mapType=ya,this.map=null,this.mapPass=null,this.matrix=new gt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new ZA,this._frameExtents=new xt(1,1),this._viewportCount=1,this._viewports=[new Yt(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const n=this.camera,r=this.matrix;_O.setFromMatrixPosition(e.matrixWorld),n.position.copy(_O),wO.setFromMatrixPosition(e.target.matrixWorld),n.lookAt(wO),n.updateMatrixWorld(),mw.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(mw),r.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),r.multiply(mw)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.autoUpdate=e.autoUpdate,this.needsUpdate=e.needsUpdate,this.normalBias=e.normalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.intensity!==1&&(e.intensity=this.intensity),this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class Gee extends rC{constructor(){super(new gr(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(e){const n=this.camera,r=Bd*2*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height*this.aspect,o=e.distance||n.far;(r!==n.fov||i!==n.aspect||o!==n.far)&&(n.fov=r,n.aspect=i,n.far=o,n.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class G4 extends Dm{constructor(e,n,r=0,i=Math.PI/3,o=0,a=2){super(e,n),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(vn.DEFAULT_UP),this.updateMatrix(),this.target=new vn,this.distance=r,this.angle=i,this.penumbra=o,this.decay=a,this.map=null,this.shadow=new Gee}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,n){return super.copy(e,n),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const SO=new gt,ch=new ne,gw=new ne;class Wee extends rC{constructor(){super(new gr(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new xt(4,2),this._viewportCount=6,this._viewports=[new Yt(2,1,1,1),new Yt(0,1,1,1),new Yt(3,1,1,1),new Yt(1,1,1,1),new Yt(3,0,1,1),new Yt(1,0,1,1)],this._cubeDirections=[new ne(1,0,0),new ne(-1,0,0),new ne(0,0,1),new ne(0,0,-1),new ne(0,1,0),new ne(0,-1,0)],this._cubeUps=[new ne(0,1,0),new ne(0,1,0),new ne(0,1,0),new ne(0,1,0),new ne(0,0,1),new ne(0,0,-1)]}updateMatrices(e,n=0){const r=this.camera,i=this.matrix,o=e.distance||r.far;o!==r.far&&(r.far=o,r.updateProjectionMatrix()),ch.setFromMatrixPosition(e.matrixWorld),r.position.copy(ch),gw.copy(r.position),gw.add(this._cubeDirections[n]),r.up.copy(this._cubeUps[n]),r.lookAt(gw),r.updateMatrixWorld(),i.makeTranslation(-ch.x,-ch.y,-ch.z),SO.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),this._frustum.setFromProjectionMatrix(SO)}}class W4 extends Dm{constructor(e,n,r=0,i=2){super(e,n),this.isPointLight=!0,this.type="PointLight",this.distance=r,this.decay=i,this.shadow=new Wee}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,n){return super.copy(e,n),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class Fx extends k4{constructor(e=-1,n=1,r=1,i=-1,o=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=n,this.top=r,this.bottom=i,this.near=o,this.far=a,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,n,r,i,o,a){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),n=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let o=r-e,a=r+e,s=i+n,l=i-n;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;o+=c*this.view.offsetX,a=o+c*this.view.width,s-=u*this.view.offsetY,l=s-u*this.view.height}this.projectionMatrix.makeOrthographic(o,a,s,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.zoom=this.zoom,n.object.left=this.left,n.object.right=this.right,n.object.top=this.top,n.object.bottom=this.bottom,n.object.near=this.near,n.object.far=this.far,this.view!==null&&(n.object.view=Object.assign({},this.view)),n}}class Xee extends rC{constructor(){super(new Fx(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class Bx extends Dm{constructor(e,n){super(e,n),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(vn.DEFAULT_UP),this.updateMatrix(),this.target=new vn,this.shadow=new Xee}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class X4 extends Dm{constructor(e,n){super(e,n),this.isAmbientLight=!0,this.type="AmbientLight"}}class mc{static extractUrlBase(e){const n=e.lastIndexOf("/");return n===-1?"./":e.slice(0,n+1)}static resolveURL(e,n){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(n)&&/^\//.test(e)&&(n=n.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:n+e)}}const vw=new WeakMap;class qee extends Vo{constructor(e){super(e),this.isImageBitmapLoader=!0,typeof createImageBitmap>"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,n,r,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,a=Bs.get(e);if(a!==void 0){if(o.manager.itemStart(e),a.then){a.then(c=>{if(vw.has(a)===!0)i&&i(vw.get(a)),o.manager.itemError(e),o.manager.itemEnd(e);else return n&&n(c),o.manager.itemEnd(e),c});return}return setTimeout(function(){n&&n(a),o.manager.itemEnd(e)},0),a}const s={};s.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",s.headers=this.requestHeader;const l=fetch(e,s).then(function(c){return c.blob()}).then(function(c){return createImageBitmap(c,Object.assign(o.options,{colorSpaceConversion:"none"}))}).then(function(c){return Bs.add(e,c),n&&n(c),o.manager.itemEnd(e),c}).catch(function(c){i&&i(c),vw.set(l,c),Bs.remove(e),o.manager.itemError(e),o.manager.itemEnd(e)});Bs.add(e,l),o.manager.itemStart(e)}}class Kee extends gr{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}const iC="\\[\\]\\.:\\/",Yee=new RegExp("["+iC+"]","g"),oC="[^"+iC+"]",Jee="[^"+iC.replace("\\.","")+"]",Zee=/((?:WC+[\/:])*)/.source.replace("WC",oC),Qee=/(WCOD+)?/.source.replace("WCOD",Jee),ete=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",oC),tte=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",oC),nte=new RegExp("^"+Zee+Qee+ete+tte+"$"),rte=["material","materials","bones","map"];class ite{constructor(e,n,r){const i=r||nn.parseTrackName(n);this._targetGroup=e,this._bindings=e.subscribe_(n,i)}getValue(e,n){this.bind();const r=this._targetGroup.nCachedObjects_,i=this._bindings[r];i!==void 0&&i.getValue(e,n)}setValue(e,n){const r=this._bindings;for(let i=this._targetGroup.nCachedObjects_,o=r.length;i!==o;++i)r[i].setValue(e,n)}bind(){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=e.length;n!==r;++n)e[n].bind()}unbind(){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=e.length;n!==r;++n)e[n].unbind()}}class nn{constructor(e,n,r){this.path=n,this.parsedPath=r||nn.parseTrackName(n),this.node=nn.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,n,r){return e&&e.isAnimationObjectGroup?new nn.Composite(e,n,r):new nn(e,n,r)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(Yee,"")}static parseTrackName(e){const n=nte.exec(e);if(n===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const r={nodeName:n[2],objectName:n[3],objectIndex:n[4],propertyName:n[5],propertyIndex:n[6]},i=r.nodeName&&r.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const o=r.nodeName.substring(i+1);rte.indexOf(o)!==-1&&(r.nodeName=r.nodeName.substring(0,i),r.objectName=o)}if(r.propertyName===null||r.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return r}static findNode(e,n){if(n===void 0||n===""||n==="."||n===-1||n===e.name||n===e.uuid)return e;if(e.skeleton){const r=e.skeleton.getBoneByName(n);if(r!==void 0)return r}if(e.children){const r=function(o){for(let a=0;ap.start-y.start);let f=0;for(let p=1;p 0 - vec4 plane; - #ifdef ALPHA_TO_COVERAGE - float distanceToPlane, distanceGradient; - float clipOpacity = 1.0; - #pragma unroll_loop_start - for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; - distanceGradient = fwidth( distanceToPlane ) / 2.0; - clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); - if ( clipOpacity == 0.0 ) discard; - } - #pragma unroll_loop_end - #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES - float unionClipOpacity = 1.0; - #pragma unroll_loop_start - for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; - distanceGradient = fwidth( distanceToPlane ) / 2.0; - unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); - } - #pragma unroll_loop_end - clipOpacity *= 1.0 - unionClipOpacity; - #endif - diffuseColor.a *= clipOpacity; - if ( diffuseColor.a == 0.0 ) discard; - #else - #pragma unroll_loop_start - for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; - } - #pragma unroll_loop_end - #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES - bool clipped = true; - #pragma unroll_loop_start - for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; - } - #pragma unroll_loop_end - if ( clipped ) discard; - #endif - #endif -#endif`,Ete=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; - uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; -#endif`,Tte=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; -#endif`,Mte=`#if NUM_CLIPPING_PLANES > 0 - vClipPosition = - mvPosition.xyz; -#endif`,Ate=`#if defined( USE_COLOR_ALPHA ) - diffuseColor *= vColor; -#elif defined( USE_COLOR ) - diffuseColor.rgb *= vColor; -#endif`,Cte=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) - varying vec3 vColor; -#endif`,Pte=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) - varying vec3 vColor; -#endif`,Rte=`#if defined( USE_COLOR_ALPHA ) - vColor = vec4( 1.0 ); -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) - vColor = vec3( 1.0 ); -#endif -#ifdef USE_COLOR - vColor *= color; -#endif -#ifdef USE_INSTANCING_COLOR - vColor.xyz *= instanceColor.xyz; -#endif -#ifdef USE_BATCHING_COLOR - vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) ); - vColor.xyz *= batchingColor.xyz; -#endif`,Nte=`#define PI 3.141592653589793 -#define PI2 6.283185307179586 -#define PI_HALF 1.5707963267948966 -#define RECIPROCAL_PI 0.3183098861837907 -#define RECIPROCAL_PI2 0.15915494309189535 -#define EPSILON 1e-6 -#ifndef saturate -#define saturate( a ) clamp( a, 0.0, 1.0 ) -#endif -#define whiteComplement( a ) ( 1.0 - saturate( a ) ) -float pow2( const in float x ) { return x*x; } -vec3 pow2( const in vec3 x ) { return x*x; } -float pow3( const in float x ) { return x*x*x; } -float pow4( const in float x ) { float x2 = x*x; return x2*x2; } -float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } -float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } -highp float rand( const in vec2 uv ) { - const highp float a = 12.9898, b = 78.233, c = 43758.5453; - highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); - return fract( sin( sn ) * c ); -} -#ifdef HIGH_PRECISION - float precisionSafeLength( vec3 v ) { return length( v ); } -#else - float precisionSafeLength( vec3 v ) { - float maxComponent = max3( abs( v ) ); - return length( v / maxComponent ) * maxComponent; - } -#endif -struct IncidentLight { - vec3 color; - vec3 direction; - bool visible; -}; -struct ReflectedLight { - vec3 directDiffuse; - vec3 directSpecular; - vec3 indirectDiffuse; - vec3 indirectSpecular; -}; -#ifdef USE_ALPHAHASH - varying vec3 vPosition; -#endif -vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); -} -vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); -} -mat3 transposeMat3( const in mat3 m ) { - mat3 tmp; - tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); - tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); - tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); - return tmp; -} -bool isPerspectiveMatrix( mat4 m ) { - return m[ 2 ][ 3 ] == - 1.0; -} -vec2 equirectUv( in vec3 dir ) { - float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; - float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; - return vec2( u, v ); -} -vec3 BRDF_Lambert( const in vec3 diffuseColor ) { - return RECIPROCAL_PI * diffuseColor; -} -vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { - float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); - return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); -} -float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { - float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); - return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); -} // validated`,Ote=`#ifdef ENVMAP_TYPE_CUBE_UV - #define cubeUV_minMipLevel 4.0 - #define cubeUV_minTileSize 16.0 - float getFace( vec3 direction ) { - vec3 absDirection = abs( direction ); - float face = - 1.0; - if ( absDirection.x > absDirection.z ) { - if ( absDirection.x > absDirection.y ) - face = direction.x > 0.0 ? 0.0 : 3.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } else { - if ( absDirection.z > absDirection.y ) - face = direction.z > 0.0 ? 2.0 : 5.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } - return face; - } - vec2 getUV( vec3 direction, float face ) { - vec2 uv; - if ( face == 0.0 ) { - uv = vec2( direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 1.0 ) { - uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); - } else if ( face == 2.0 ) { - uv = vec2( - direction.x, direction.y ) / abs( direction.z ); - } else if ( face == 3.0 ) { - uv = vec2( - direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 4.0 ) { - uv = vec2( - direction.x, direction.z ) / abs( direction.y ); - } else { - uv = vec2( direction.x, direction.y ) / abs( direction.z ); - } - return 0.5 * ( uv + 1.0 ); - } - vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { - float face = getFace( direction ); - float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); - mipInt = max( mipInt, cubeUV_minMipLevel ); - float faceSize = exp2( mipInt ); - highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; - if ( face > 2.0 ) { - uv.y += faceSize; - face -= 3.0; - } - uv.x += face * faceSize; - uv.x += filterInt * 3.0 * cubeUV_minTileSize; - uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); - uv.x *= CUBEUV_TEXEL_WIDTH; - uv.y *= CUBEUV_TEXEL_HEIGHT; - #ifdef texture2DGradEXT - return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; - #else - return texture2D( envMap, uv ).rgb; - #endif - } - #define cubeUV_r0 1.0 - #define cubeUV_m0 - 2.0 - #define cubeUV_r1 0.8 - #define cubeUV_m1 - 1.0 - #define cubeUV_r4 0.4 - #define cubeUV_m4 2.0 - #define cubeUV_r5 0.305 - #define cubeUV_m5 3.0 - #define cubeUV_r6 0.21 - #define cubeUV_m6 4.0 - float roughnessToMip( float roughness ) { - float mip = 0.0; - if ( roughness >= cubeUV_r1 ) { - mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; - } else if ( roughness >= cubeUV_r4 ) { - mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; - } else if ( roughness >= cubeUV_r5 ) { - mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; - } else if ( roughness >= cubeUV_r6 ) { - mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; - } else { - mip = - 2.0 * log2( 1.16 * roughness ); } - return mip; - } - vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { - float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); - float mipF = fract( mip ); - float mipInt = floor( mip ); - vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); - if ( mipF == 0.0 ) { - return vec4( color0, 1.0 ); - } else { - vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); - return vec4( mix( color0, color1, mipF ), 1.0 ); - } - } -#endif`,Ite=`vec3 transformedNormal = objectNormal; -#ifdef USE_TANGENT - vec3 transformedTangent = objectTangent; -#endif -#ifdef USE_BATCHING - mat3 bm = mat3( batchingMatrix ); - transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); - transformedNormal = bm * transformedNormal; - #ifdef USE_TANGENT - transformedTangent = bm * transformedTangent; - #endif -#endif -#ifdef USE_INSTANCING - mat3 im = mat3( instanceMatrix ); - transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); - transformedNormal = im * transformedNormal; - #ifdef USE_TANGENT - transformedTangent = im * transformedTangent; - #endif -#endif -transformedNormal = normalMatrix * transformedNormal; -#ifdef FLIP_SIDED - transformedNormal = - transformedNormal; -#endif -#ifdef USE_TANGENT - transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; - #ifdef FLIP_SIDED - transformedTangent = - transformedTangent; - #endif -#endif`,Dte=`#ifdef USE_DISPLACEMENTMAP - uniform sampler2D displacementMap; - uniform float displacementScale; - uniform float displacementBias; -#endif`,Lte=`#ifdef USE_DISPLACEMENTMAP - transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); -#endif`,kte=`#ifdef USE_EMISSIVEMAP - vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); - #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE - emissiveColor = sRGBTransferEOTF( emissiveColor ); - #endif - totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,jte=`#ifdef USE_EMISSIVEMAP - uniform sampler2D emissiveMap; -#endif`,Ute="gl_FragColor = linearToOutputTexel( gl_FragColor );",Fte=`vec4 LinearTransferOETF( in vec4 value ) { - return value; -} -vec4 sRGBTransferEOTF( in vec4 value ) { - return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); -} -vec4 sRGBTransferOETF( in vec4 value ) { - return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); -}`,Bte=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vec3 cameraToFrag; - if ( isOrthographic ) { - cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToFrag = normalize( vWorldPosition - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vec3 reflectVec = reflect( cameraToFrag, worldNormal ); - #else - vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); - #endif - #else - vec3 reflectVec = vReflect; - #endif - #ifdef ENVMAP_TYPE_CUBE - vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); - #else - vec4 envColor = vec4( 0.0 ); - #endif - #ifdef ENVMAP_BLENDING_MULTIPLY - outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_MIX ) - outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_ADD ) - outgoingLight += envColor.xyz * specularStrength * reflectivity; - #endif -#endif`,$te=`#ifdef USE_ENVMAP - uniform float envMapIntensity; - uniform float flipEnvMap; - uniform mat3 envMapRotation; - #ifdef ENVMAP_TYPE_CUBE - uniform samplerCube envMap; - #else - uniform sampler2D envMap; - #endif - -#endif`,zte=`#ifdef USE_ENVMAP - uniform float reflectivity; - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - varying vec3 vWorldPosition; - uniform float refractionRatio; - #else - varying vec3 vReflect; - #endif -#endif`,Hte=`#ifdef USE_ENVMAP - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - - varying vec3 vWorldPosition; - #else - varying vec3 vReflect; - uniform float refractionRatio; - #endif -#endif`,Vte=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vWorldPosition = worldPosition.xyz; - #else - vec3 cameraToVertex; - if ( isOrthographic ) { - cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vReflect = reflect( cameraToVertex, worldNormal ); - #else - vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); - #endif - #endif -#endif`,Gte=`#ifdef USE_FOG - vFogDepth = - mvPosition.z; -#endif`,Wte=`#ifdef USE_FOG - varying float vFogDepth; -#endif`,Xte=`#ifdef USE_FOG - #ifdef FOG_EXP2 - float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); - #else - float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); - #endif - gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); -#endif`,qte=`#ifdef USE_FOG - uniform vec3 fogColor; - varying float vFogDepth; - #ifdef FOG_EXP2 - uniform float fogDensity; - #else - uniform float fogNear; - uniform float fogFar; - #endif -#endif`,Kte=`#ifdef USE_GRADIENTMAP - uniform sampler2D gradientMap; -#endif -vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { - float dotNL = dot( normal, lightDirection ); - vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); - #ifdef USE_GRADIENTMAP - return vec3( texture2D( gradientMap, coord ).r ); - #else - vec2 fw = fwidth( coord ) * 0.5; - return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); - #endif -}`,Yte=`#ifdef USE_LIGHTMAP - uniform sampler2D lightMap; - uniform float lightMapIntensity; -#endif`,Jte=`LambertMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.specularStrength = specularStrength;`,Zte=`varying vec3 vViewPosition; -struct LambertMaterial { - vec3 diffuseColor; - float specularStrength; -}; -void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_Lambert -#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,Qte=`uniform bool receiveShadow; -uniform vec3 ambientLightColor; -#if defined( USE_LIGHT_PROBES ) - uniform vec3 lightProbe[ 9 ]; -#endif -vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { - float x = normal.x, y = normal.y, z = normal.z; - vec3 result = shCoefficients[ 0 ] * 0.886227; - result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; - result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; - result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; - result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; - result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; - result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); - result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; - result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); - return result; -} -vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); - return irradiance; -} -vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { - vec3 irradiance = ambientLightColor; - return irradiance; -} -float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { - float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); - if ( cutoffDistance > 0.0 ) { - distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); - } - return distanceFalloff; -} -float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { - return smoothstep( coneCosine, penumbraCosine, angleCosine ); -} -#if NUM_DIR_LIGHTS > 0 - struct DirectionalLight { - vec3 direction; - vec3 color; - }; - uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; - void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { - light.color = directionalLight.color; - light.direction = directionalLight.direction; - light.visible = true; - } -#endif -#if NUM_POINT_LIGHTS > 0 - struct PointLight { - vec3 position; - vec3 color; - float distance; - float decay; - }; - uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; - void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { - vec3 lVector = pointLight.position - geometryPosition; - light.direction = normalize( lVector ); - float lightDistance = length( lVector ); - light.color = pointLight.color; - light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); - light.visible = ( light.color != vec3( 0.0 ) ); - } -#endif -#if NUM_SPOT_LIGHTS > 0 - struct SpotLight { - vec3 position; - vec3 direction; - vec3 color; - float distance; - float decay; - float coneCos; - float penumbraCos; - }; - uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; - void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { - vec3 lVector = spotLight.position - geometryPosition; - light.direction = normalize( lVector ); - float angleCos = dot( light.direction, spotLight.direction ); - float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); - if ( spotAttenuation > 0.0 ) { - float lightDistance = length( lVector ); - light.color = spotLight.color * spotAttenuation; - light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); - light.visible = ( light.color != vec3( 0.0 ) ); - } else { - light.color = vec3( 0.0 ); - light.visible = false; - } - } -#endif -#if NUM_RECT_AREA_LIGHTS > 0 - struct RectAreaLight { - vec3 color; - vec3 position; - vec3 halfWidth; - vec3 halfHeight; - }; - uniform sampler2D ltc_1; uniform sampler2D ltc_2; - uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; -#endif -#if NUM_HEMI_LIGHTS > 0 - struct HemisphereLight { - vec3 direction; - vec3 skyColor; - vec3 groundColor; - }; - uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; - vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { - float dotNL = dot( normal, hemiLight.direction ); - float hemiDiffuseWeight = 0.5 * dotNL + 0.5; - vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); - return irradiance; - } -#endif`,ene=`#ifdef USE_ENVMAP - vec3 getIBLIrradiance( const in vec3 normal ) { - #ifdef ENVMAP_TYPE_CUBE_UV - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 ); - return PI * envMapColor.rgb * envMapIntensity; - #else - return vec3( 0.0 ); - #endif - } - vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { - #ifdef ENVMAP_TYPE_CUBE_UV - vec3 reflectVec = reflect( - viewDir, normal ); - reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); - reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); - vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness ); - return envMapColor.rgb * envMapIntensity; - #else - return vec3( 0.0 ); - #endif - } - #ifdef USE_ANISOTROPY - vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { - #ifdef ENVMAP_TYPE_CUBE_UV - vec3 bentNormal = cross( bitangent, viewDir ); - bentNormal = normalize( cross( bentNormal, bitangent ) ); - bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); - return getIBLRadiance( viewDir, bentNormal, roughness ); - #else - return vec3( 0.0 ); - #endif - } - #endif -#endif`,tne=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,nne=`varying vec3 vViewPosition; -struct ToonMaterial { - vec3 diffuseColor; -}; -void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_Toon -#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,rne=`BlinnPhongMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.specularColor = specular; -material.specularShininess = shininess; -material.specularStrength = specularStrength;`,ine=`varying vec3 vViewPosition; -struct BlinnPhongMaterial { - vec3 diffuseColor; - vec3 specularColor; - float specularShininess; - float specularStrength; -}; -void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); - reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; -} -void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_BlinnPhong -#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,one=`PhysicalMaterial material; -material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); -vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); -float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); -material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; -material.roughness = min( material.roughness, 1.0 ); -#ifdef IOR - material.ior = ior; - #ifdef USE_SPECULAR - float specularIntensityFactor = specularIntensity; - vec3 specularColorFactor = specularColor; - #ifdef USE_SPECULAR_COLORMAP - specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; - #endif - #ifdef USE_SPECULAR_INTENSITYMAP - specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; - #endif - material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); - #else - float specularIntensityFactor = 1.0; - vec3 specularColorFactor = vec3( 1.0 ); - material.specularF90 = 1.0; - #endif - material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); -#else - material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor ); - material.specularF90 = 1.0; -#endif -#ifdef USE_CLEARCOAT - material.clearcoat = clearcoat; - material.clearcoatRoughness = clearcoatRoughness; - material.clearcoatF0 = vec3( 0.04 ); - material.clearcoatF90 = 1.0; - #ifdef USE_CLEARCOATMAP - material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; - #endif - #ifdef USE_CLEARCOAT_ROUGHNESSMAP - material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; - #endif - material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); - material.clearcoatRoughness += geometryRoughness; - material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); -#endif -#ifdef USE_DISPERSION - material.dispersion = dispersion; -#endif -#ifdef USE_IRIDESCENCE - material.iridescence = iridescence; - material.iridescenceIOR = iridescenceIOR; - #ifdef USE_IRIDESCENCEMAP - material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; - #endif - #ifdef USE_IRIDESCENCE_THICKNESSMAP - material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; - #else - material.iridescenceThickness = iridescenceThicknessMaximum; - #endif -#endif -#ifdef USE_SHEEN - material.sheenColor = sheenColor; - #ifdef USE_SHEEN_COLORMAP - material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; - #endif - material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); - #ifdef USE_SHEEN_ROUGHNESSMAP - material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; - #endif -#endif -#ifdef USE_ANISOTROPY - #ifdef USE_ANISOTROPYMAP - mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); - vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; - vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; - #else - vec2 anisotropyV = anisotropyVector; - #endif - material.anisotropy = length( anisotropyV ); - if( material.anisotropy == 0.0 ) { - anisotropyV = vec2( 1.0, 0.0 ); - } else { - anisotropyV /= material.anisotropy; - material.anisotropy = saturate( material.anisotropy ); - } - material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); - material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; - material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; -#endif`,ane=`struct PhysicalMaterial { - vec3 diffuseColor; - float roughness; - vec3 specularColor; - float specularF90; - float dispersion; - #ifdef USE_CLEARCOAT - float clearcoat; - float clearcoatRoughness; - vec3 clearcoatF0; - float clearcoatF90; - #endif - #ifdef USE_IRIDESCENCE - float iridescence; - float iridescenceIOR; - float iridescenceThickness; - vec3 iridescenceFresnel; - vec3 iridescenceF0; - #endif - #ifdef USE_SHEEN - vec3 sheenColor; - float sheenRoughness; - #endif - #ifdef IOR - float ior; - #endif - #ifdef USE_TRANSMISSION - float transmission; - float transmissionAlpha; - float thickness; - float attenuationDistance; - vec3 attenuationColor; - #endif - #ifdef USE_ANISOTROPY - float anisotropy; - float alphaT; - vec3 anisotropyT; - vec3 anisotropyB; - #endif -}; -vec3 clearcoatSpecularDirect = vec3( 0.0 ); -vec3 clearcoatSpecularIndirect = vec3( 0.0 ); -vec3 sheenSpecularDirect = vec3( 0.0 ); -vec3 sheenSpecularIndirect = vec3(0.0 ); -vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { - float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); - float x2 = x * x; - float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); - return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); -} -float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { - float a2 = pow2( alpha ); - float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); - float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); - return 0.5 / max( gv + gl, EPSILON ); -} -float D_GGX( const in float alpha, const in float dotNH ) { - float a2 = pow2( alpha ); - float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; - return RECIPROCAL_PI * a2 / pow2( denom ); -} -#ifdef USE_ANISOTROPY - float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) { - float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); - float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); - float v = 0.5 / ( gv + gl ); - return saturate(v); - } - float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { - float a2 = alphaT * alphaB; - highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); - highp float v2 = dot( v, v ); - float w2 = a2 / v2; - return RECIPROCAL_PI * a2 * pow2 ( w2 ); - } -#endif -#ifdef USE_CLEARCOAT - vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { - vec3 f0 = material.clearcoatF0; - float f90 = material.clearcoatF90; - float roughness = material.clearcoatRoughness; - float alpha = pow2( roughness ); - vec3 halfDir = normalize( lightDir + viewDir ); - float dotNL = saturate( dot( normal, lightDir ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - float dotNH = saturate( dot( normal, halfDir ) ); - float dotVH = saturate( dot( viewDir, halfDir ) ); - vec3 F = F_Schlick( f0, f90, dotVH ); - float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); - float D = D_GGX( alpha, dotNH ); - return F * ( V * D ); - } -#endif -vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { - vec3 f0 = material.specularColor; - float f90 = material.specularF90; - float roughness = material.roughness; - float alpha = pow2( roughness ); - vec3 halfDir = normalize( lightDir + viewDir ); - float dotNL = saturate( dot( normal, lightDir ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - float dotNH = saturate( dot( normal, halfDir ) ); - float dotVH = saturate( dot( viewDir, halfDir ) ); - vec3 F = F_Schlick( f0, f90, dotVH ); - #ifdef USE_IRIDESCENCE - F = mix( F, material.iridescenceFresnel, material.iridescence ); - #endif - #ifdef USE_ANISOTROPY - float dotTL = dot( material.anisotropyT, lightDir ); - float dotTV = dot( material.anisotropyT, viewDir ); - float dotTH = dot( material.anisotropyT, halfDir ); - float dotBL = dot( material.anisotropyB, lightDir ); - float dotBV = dot( material.anisotropyB, viewDir ); - float dotBH = dot( material.anisotropyB, halfDir ); - float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); - float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); - #else - float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); - float D = D_GGX( alpha, dotNH ); - #endif - return F * ( V * D ); -} -vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { - const float LUT_SIZE = 64.0; - const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; - const float LUT_BIAS = 0.5 / LUT_SIZE; - float dotNV = saturate( dot( N, V ) ); - vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); - uv = uv * LUT_SCALE + LUT_BIAS; - return uv; -} -float LTC_ClippedSphereFormFactor( const in vec3 f ) { - float l = length( f ); - return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); -} -vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { - float x = dot( v1, v2 ); - float y = abs( x ); - float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; - float b = 3.4175940 + ( 4.1616724 + y ) * y; - float v = a / b; - float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; - return cross( v1, v2 ) * theta_sintheta; -} -vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { - vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; - vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; - vec3 lightNormal = cross( v1, v2 ); - if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); - vec3 T1, T2; - T1 = normalize( V - N * dot( V, N ) ); - T2 = - cross( N, T1 ); - mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); - vec3 coords[ 4 ]; - coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); - coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); - coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); - coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); - coords[ 0 ] = normalize( coords[ 0 ] ); - coords[ 1 ] = normalize( coords[ 1 ] ); - coords[ 2 ] = normalize( coords[ 2 ] ); - coords[ 3 ] = normalize( coords[ 3 ] ); - vec3 vectorFormFactor = vec3( 0.0 ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); - float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); - return vec3( result ); -} -#if defined( USE_SHEEN ) -float D_Charlie( float roughness, float dotNH ) { - float alpha = pow2( roughness ); - float invAlpha = 1.0 / alpha; - float cos2h = dotNH * dotNH; - float sin2h = max( 1.0 - cos2h, 0.0078125 ); - return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); -} -float V_Neubelt( float dotNV, float dotNL ) { - return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); -} -vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { - vec3 halfDir = normalize( lightDir + viewDir ); - float dotNL = saturate( dot( normal, lightDir ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - float dotNH = saturate( dot( normal, halfDir ) ); - float D = D_Charlie( sheenRoughness, dotNH ); - float V = V_Neubelt( dotNV, dotNL ); - return sheenColor * ( D * V ); -} -#endif -float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { - float dotNV = saturate( dot( normal, viewDir ) ); - float r2 = roughness * roughness; - float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; - float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; - float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); - return saturate( DG * RECIPROCAL_PI ); -} -vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { - float dotNV = saturate( dot( normal, viewDir ) ); - const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); - const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); - vec4 r = roughness * c0 + c1; - float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; - vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; - return fab; -} -vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { - vec2 fab = DFGApprox( normal, viewDir, roughness ); - return specularColor * fab.x + specularF90 * fab.y; -} -#ifdef USE_IRIDESCENCE -void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { -#else -void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { -#endif - vec2 fab = DFGApprox( normal, viewDir, roughness ); - #ifdef USE_IRIDESCENCE - vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); - #else - vec3 Fr = specularColor; - #endif - vec3 FssEss = Fr * fab.x + specularF90 * fab.y; - float Ess = fab.x + fab.y; - float Ems = 1.0 - Ess; - vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); - singleScatter += FssEss; - multiScatter += Fms * Ems; -} -#if NUM_RECT_AREA_LIGHTS > 0 - void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - vec3 normal = geometryNormal; - vec3 viewDir = geometryViewDir; - vec3 position = geometryPosition; - vec3 lightPos = rectAreaLight.position; - vec3 halfWidth = rectAreaLight.halfWidth; - vec3 halfHeight = rectAreaLight.halfHeight; - vec3 lightColor = rectAreaLight.color; - float roughness = material.roughness; - vec3 rectCoords[ 4 ]; - rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; - rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; - rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; - vec2 uv = LTC_Uv( normal, viewDir, roughness ); - vec4 t1 = texture2D( ltc_1, uv ); - vec4 t2 = texture2D( ltc_2, uv ); - mat3 mInv = mat3( - vec3( t1.x, 0, t1.y ), - vec3( 0, 1, 0 ), - vec3( t1.z, 0, t1.w ) - ); - vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); - reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); - reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); - } -#endif -void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - #ifdef USE_CLEARCOAT - float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); - vec3 ccIrradiance = dotNLcc * directLight.color; - clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); - #endif - #ifdef USE_SHEEN - sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); - #endif - reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material ); - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { - #ifdef USE_CLEARCOAT - clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); - #endif - #ifdef USE_SHEEN - sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); - #endif - vec3 singleScattering = vec3( 0.0 ); - vec3 multiScattering = vec3( 0.0 ); - vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; - #ifdef USE_IRIDESCENCE - computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); - #else - computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); - #endif - vec3 totalScattering = singleScattering + multiScattering; - vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); - reflectedLight.indirectSpecular += radiance * singleScattering; - reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; - reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; -} -#define RE_Direct RE_Direct_Physical -#define RE_Direct_RectArea RE_Direct_RectArea_Physical -#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical -#define RE_IndirectSpecular RE_IndirectSpecular_Physical -float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { - return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); -}`,sne=` -vec3 geometryPosition = - vViewPosition; -vec3 geometryNormal = normal; -vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); -vec3 geometryClearcoatNormal = vec3( 0.0 ); -#ifdef USE_CLEARCOAT - geometryClearcoatNormal = clearcoatNormal; -#endif -#ifdef USE_IRIDESCENCE - float dotNVi = saturate( dot( normal, geometryViewDir ) ); - if ( material.iridescenceThickness == 0.0 ) { - material.iridescence = 0.0; - } else { - material.iridescence = saturate( material.iridescence ); - } - if ( material.iridescence > 0.0 ) { - material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); - material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); - } -#endif -IncidentLight directLight; -#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) - PointLight pointLight; - #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - pointLight = pointLights[ i ]; - getPointLightInfo( pointLight, geometryPosition, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) - pointLightShadow = pointLightShadows[ i ]; - directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; - #endif - RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) - SpotLight spotLight; - vec4 spotColor; - vec3 spotLightCoord; - bool inSpotLightMap; - #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - spotLight = spotLights[ i ]; - getSpotLightInfo( spotLight, geometryPosition, directLight ); - #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) - #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX - #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS - #else - #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) - #endif - #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) - spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; - inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); - spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); - directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; - #endif - #undef SPOT_LIGHT_MAP_INDEX - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - spotLightShadow = spotLightShadows[ i ]; - directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) - DirectionalLight directionalLight; - #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - directionalLight = directionalLights[ i ]; - getDirectionalLightInfo( directionalLight, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) - directionalLightShadow = directionalLightShadows[ i ]; - directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) - RectAreaLight rectAreaLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { - rectAreaLight = rectAreaLights[ i ]; - RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if defined( RE_IndirectDiffuse ) - vec3 iblIrradiance = vec3( 0.0 ); - vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); - #if defined( USE_LIGHT_PROBES ) - irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); - #endif - #if ( NUM_HEMI_LIGHTS > 0 ) - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); - } - #pragma unroll_loop_end - #endif -#endif -#if defined( RE_IndirectSpecular ) - vec3 radiance = vec3( 0.0 ); - vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,lne=`#if defined( RE_IndirectDiffuse ) - #ifdef USE_LIGHTMAP - vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); - vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; - irradiance += lightMapIrradiance; - #endif - #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) - iblIrradiance += getIBLIrradiance( geometryNormal ); - #endif -#endif -#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) - #ifdef USE_ANISOTROPY - radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); - #else - radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); - #endif - #ifdef USE_CLEARCOAT - clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); - #endif -#endif`,cne=`#if defined( RE_IndirectDiffuse ) - RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); -#endif -#if defined( RE_IndirectSpecular ) - RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); -#endif`,une=`#if defined( USE_LOGDEPTHBUF ) - gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; -#endif`,dne=`#if defined( USE_LOGDEPTHBUF ) - uniform float logDepthBufFC; - varying float vFragDepth; - varying float vIsPerspective; -#endif`,fne=`#ifdef USE_LOGDEPTHBUF - varying float vFragDepth; - varying float vIsPerspective; -#endif`,hne=`#ifdef USE_LOGDEPTHBUF - vFragDepth = 1.0 + gl_Position.w; - vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); -#endif`,pne=`#ifdef USE_MAP - vec4 sampledDiffuseColor = texture2D( map, vMapUv ); - #ifdef DECODE_VIDEO_TEXTURE - sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor ); - #endif - diffuseColor *= sampledDiffuseColor; -#endif`,mne=`#ifdef USE_MAP - uniform sampler2D map; -#endif`,gne=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - #if defined( USE_POINTS_UV ) - vec2 uv = vUv; - #else - vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; - #endif -#endif -#ifdef USE_MAP - diffuseColor *= texture2D( map, uv ); -#endif -#ifdef USE_ALPHAMAP - diffuseColor.a *= texture2D( alphaMap, uv ).g; -#endif`,vne=`#if defined( USE_POINTS_UV ) - varying vec2 vUv; -#else - #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - uniform mat3 uvTransform; - #endif -#endif -#ifdef USE_MAP - uniform sampler2D map; -#endif -#ifdef USE_ALPHAMAP - uniform sampler2D alphaMap; -#endif`,yne=`float metalnessFactor = metalness; -#ifdef USE_METALNESSMAP - vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); - metalnessFactor *= texelMetalness.b; -#endif`,xne=`#ifdef USE_METALNESSMAP - uniform sampler2D metalnessMap; -#endif`,bne=`#ifdef USE_INSTANCING_MORPH - float morphTargetInfluences[ MORPHTARGETS_COUNT ]; - float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; - for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { - morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; - } -#endif`,_ne=`#if defined( USE_MORPHCOLORS ) - vColor *= morphTargetBaseInfluence; - for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { - #if defined( USE_COLOR_ALPHA ) - if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; - #elif defined( USE_COLOR ) - if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; - #endif - } -#endif`,wne=`#ifdef USE_MORPHNORMALS - objectNormal *= morphTargetBaseInfluence; - for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { - if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; - } -#endif`,Sne=`#ifdef USE_MORPHTARGETS - #ifndef USE_INSTANCING_MORPH - uniform float morphTargetBaseInfluence; - uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; - #endif - uniform sampler2DArray morphTargetsTexture; - uniform ivec2 morphTargetsTextureSize; - vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { - int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; - int y = texelIndex / morphTargetsTextureSize.x; - int x = texelIndex - y * morphTargetsTextureSize.x; - ivec3 morphUV = ivec3( x, y, morphTargetIndex ); - return texelFetch( morphTargetsTexture, morphUV, 0 ); - } -#endif`,Ene=`#ifdef USE_MORPHTARGETS - transformed *= morphTargetBaseInfluence; - for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { - if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; - } -#endif`,Tne=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; -#ifdef FLAT_SHADED - vec3 fdx = dFdx( vViewPosition ); - vec3 fdy = dFdy( vViewPosition ); - vec3 normal = normalize( cross( fdx, fdy ) ); -#else - vec3 normal = normalize( vNormal ); - #ifdef DOUBLE_SIDED - normal *= faceDirection; - #endif -#endif -#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) - #ifdef USE_TANGENT - mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); - #else - mat3 tbn = getTangentFrame( - vViewPosition, normal, - #if defined( USE_NORMALMAP ) - vNormalMapUv - #elif defined( USE_CLEARCOAT_NORMALMAP ) - vClearcoatNormalMapUv - #else - vUv - #endif - ); - #endif - #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) - tbn[0] *= faceDirection; - tbn[1] *= faceDirection; - #endif -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - #ifdef USE_TANGENT - mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); - #else - mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); - #endif - #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) - tbn2[0] *= faceDirection; - tbn2[1] *= faceDirection; - #endif -#endif -vec3 nonPerturbedNormal = normal;`,Mne=`#ifdef USE_NORMALMAP_OBJECTSPACE - normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; - #ifdef FLIP_SIDED - normal = - normal; - #endif - #ifdef DOUBLE_SIDED - normal = normal * faceDirection; - #endif - normal = normalize( normalMatrix * normal ); -#elif defined( USE_NORMALMAP_TANGENTSPACE ) - vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; - mapN.xy *= normalScale; - normal = normalize( tbn * mapN ); -#elif defined( USE_BUMPMAP ) - normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); -#endif`,Ane=`#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif`,Cne=`#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif`,Pne=`#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif -#endif`,Rne=`#ifdef USE_NORMALMAP - uniform sampler2D normalMap; - uniform vec2 normalScale; -#endif -#ifdef USE_NORMALMAP_OBJECTSPACE - uniform mat3 normalMatrix; -#endif -#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) - mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { - vec3 q0 = dFdx( eye_pos.xyz ); - vec3 q1 = dFdy( eye_pos.xyz ); - vec2 st0 = dFdx( uv.st ); - vec2 st1 = dFdy( uv.st ); - vec3 N = surf_norm; - vec3 q1perp = cross( q1, N ); - vec3 q0perp = cross( N, q0 ); - vec3 T = q1perp * st0.x + q0perp * st1.x; - vec3 B = q1perp * st0.y + q0perp * st1.y; - float det = max( dot( T, T ), dot( B, B ) ); - float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); - return mat3( T * scale, B * scale, N ); - } -#endif`,Nne=`#ifdef USE_CLEARCOAT - vec3 clearcoatNormal = nonPerturbedNormal; -#endif`,One=`#ifdef USE_CLEARCOAT_NORMALMAP - vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; - clearcoatMapN.xy *= clearcoatNormalScale; - clearcoatNormal = normalize( tbn2 * clearcoatMapN ); -#endif`,Ine=`#ifdef USE_CLEARCOATMAP - uniform sampler2D clearcoatMap; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - uniform sampler2D clearcoatNormalMap; - uniform vec2 clearcoatNormalScale; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - uniform sampler2D clearcoatRoughnessMap; -#endif`,Dne=`#ifdef USE_IRIDESCENCEMAP - uniform sampler2D iridescenceMap; -#endif -#ifdef USE_IRIDESCENCE_THICKNESSMAP - uniform sampler2D iridescenceThicknessMap; -#endif`,Lne=`#ifdef OPAQUE -diffuseColor.a = 1.0; -#endif -#ifdef USE_TRANSMISSION -diffuseColor.a *= material.transmissionAlpha; -#endif -gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,kne=`vec3 packNormalToRGB( const in vec3 normal ) { - return normalize( normal ) * 0.5 + 0.5; -} -vec3 unpackRGBToNormal( const in vec3 rgb ) { - return 2.0 * rgb.xyz - 1.0; -} -const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.; -const float Inv255 = 1. / 255.; -const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 ); -const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g ); -const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b ); -const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a ); -vec4 packDepthToRGBA( const in float v ) { - if( v <= 0.0 ) - return vec4( 0., 0., 0., 0. ); - if( v >= 1.0 ) - return vec4( 1., 1., 1., 1. ); - float vuf; - float af = modf( v * PackFactors.a, vuf ); - float bf = modf( vuf * ShiftRight8, vuf ); - float gf = modf( vuf * ShiftRight8, vuf ); - return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af ); -} -vec3 packDepthToRGB( const in float v ) { - if( v <= 0.0 ) - return vec3( 0., 0., 0. ); - if( v >= 1.0 ) - return vec3( 1., 1., 1. ); - float vuf; - float bf = modf( v * PackFactors.b, vuf ); - float gf = modf( vuf * ShiftRight8, vuf ); - return vec3( vuf * Inv255, gf * PackUpscale, bf ); -} -vec2 packDepthToRG( const in float v ) { - if( v <= 0.0 ) - return vec2( 0., 0. ); - if( v >= 1.0 ) - return vec2( 1., 1. ); - float vuf; - float gf = modf( v * 256., vuf ); - return vec2( vuf * Inv255, gf ); -} -float unpackRGBAToDepth( const in vec4 v ) { - return dot( v, UnpackFactors4 ); -} -float unpackRGBToDepth( const in vec3 v ) { - return dot( v, UnpackFactors3 ); -} -float unpackRGToDepth( const in vec2 v ) { - return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g; -} -vec4 pack2HalfToRGBA( const in vec2 v ) { - vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); - return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); -} -vec2 unpackRGBATo2Half( const in vec4 v ) { - return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); -} -float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { - return ( viewZ + near ) / ( near - far ); -} -float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { - return depth * ( near - far ) - near; -} -float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { - return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); -} -float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { - return ( near * far ) / ( ( far - near ) * depth - far ); -}`,jne=`#ifdef PREMULTIPLIED_ALPHA - gl_FragColor.rgb *= gl_FragColor.a; -#endif`,Une=`vec4 mvPosition = vec4( transformed, 1.0 ); -#ifdef USE_BATCHING - mvPosition = batchingMatrix * mvPosition; -#endif -#ifdef USE_INSTANCING - mvPosition = instanceMatrix * mvPosition; -#endif -mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,Fne=`#ifdef DITHERING - gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,Bne=`#ifdef DITHERING - vec3 dithering( vec3 color ) { - float grid_position = rand( gl_FragCoord.xy ); - vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); - dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); - return color + dither_shift_RGB; - } -#endif`,$ne=`float roughnessFactor = roughness; -#ifdef USE_ROUGHNESSMAP - vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); - roughnessFactor *= texelRoughness.g; -#endif`,zne=`#ifdef USE_ROUGHNESSMAP - uniform sampler2D roughnessMap; -#endif`,Hne=`#if NUM_SPOT_LIGHT_COORDS > 0 - varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; -#endif -#if NUM_SPOT_LIGHT_MAPS > 0 - uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; -#endif -#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowIntensity; - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; - struct SpotLightShadow { - float shadowIntensity; - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowIntensity; - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif - float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { - return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); - } - vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { - return unpackRGBATo2Half( texture2D( shadow, uv ) ); - } - float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ - float occlusion = 1.0; - vec2 distribution = texture2DDistribution( shadow, uv ); - float hard_shadow = step( compare , distribution.x ); - if (hard_shadow != 1.0 ) { - float distance = compare - distribution.x ; - float variance = max( 0.00000, distribution.y * distribution.y ); - float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); - } - return occlusion; - } - float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { - float shadow = 1.0; - shadowCoord.xyz /= shadowCoord.w; - shadowCoord.z += shadowBias; - bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; - bool frustumTest = inFrustum && shadowCoord.z <= 1.0; - if ( frustumTest ) { - #if defined( SHADOWMAP_TYPE_PCF ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx0 = - texelSize.x * shadowRadius; - float dy0 = - texelSize.y * shadowRadius; - float dx1 = + texelSize.x * shadowRadius; - float dy1 = + texelSize.y * shadowRadius; - float dx2 = dx0 / 2.0; - float dy2 = dy0 / 2.0; - float dx3 = dx1 / 2.0; - float dy3 = dy1 / 2.0; - shadow = ( - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) - ) * ( 1.0 / 17.0 ); - #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx = texelSize.x; - float dy = texelSize.y; - vec2 uv = shadowCoord.xy; - vec2 f = fract( uv * shadowMapSize + 0.5 ); - uv -= f * texelSize; - shadow = ( - texture2DCompare( shadowMap, uv, shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), - f.x ), - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), - f.x ), - f.y ) - ) * ( 1.0 / 9.0 ); - #elif defined( SHADOWMAP_TYPE_VSM ) - shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); - #else - shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); - #endif - } - return mix( 1.0, shadow, shadowIntensity ); - } - vec2 cubeToUV( vec3 v, float texelSizeY ) { - vec3 absV = abs( v ); - float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); - absV *= scaleToCube; - v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); - vec2 planar = v.xy; - float almostATexel = 1.5 * texelSizeY; - float almostOne = 1.0 - almostATexel; - if ( absV.z >= almostOne ) { - if ( v.z > 0.0 ) - planar.x = 4.0 - v.x; - } else if ( absV.x >= almostOne ) { - float signX = sign( v.x ); - planar.x = v.z * signX + 2.0 * signX; - } else if ( absV.y >= almostOne ) { - float signY = sign( v.y ); - planar.x = v.x + 2.0 * signY + 2.0; - planar.y = v.z * signY - 2.0; - } - return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); - } - float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { - float shadow = 1.0; - vec3 lightToPosition = shadowCoord.xyz; - - float lightToPositionLength = length( lightToPosition ); - if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) { - float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; - vec3 bd3D = normalize( lightToPosition ); - vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); - #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) - vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; - shadow = ( - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) - ) * ( 1.0 / 9.0 ); - #else - shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); - #endif - } - return mix( 1.0, shadow, shadowIntensity ); - } -#endif`,Vne=`#if NUM_SPOT_LIGHT_COORDS > 0 - uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; - varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; -#endif -#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowIntensity; - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - struct SpotLightShadow { - float shadowIntensity; - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowIntensity; - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif -#endif`,Gne=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) - vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - vec4 shadowWorldPosition; -#endif -#if defined( USE_SHADOWMAP ) - #if NUM_DIR_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); - vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); - vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif -#endif -#if NUM_SPOT_LIGHT_COORDS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { - shadowWorldPosition = worldPosition; - #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; - #endif - vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end -#endif`,Wne=`float getShadowMask() { - float shadow = 1.0; - #ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - directionalLight = directionalLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { - spotLight = spotLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - pointLight = pointLightShadows[ i ]; - shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; - } - #pragma unroll_loop_end - #endif - #endif - return shadow; -}`,Xne=`#ifdef USE_SKINNING - mat4 boneMatX = getBoneMatrix( skinIndex.x ); - mat4 boneMatY = getBoneMatrix( skinIndex.y ); - mat4 boneMatZ = getBoneMatrix( skinIndex.z ); - mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,qne=`#ifdef USE_SKINNING - uniform mat4 bindMatrix; - uniform mat4 bindMatrixInverse; - uniform highp sampler2D boneTexture; - mat4 getBoneMatrix( const in float i ) { - int size = textureSize( boneTexture, 0 ).x; - int j = int( i ) * 4; - int x = j % size; - int y = j / size; - vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); - vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); - vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); - vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); - return mat4( v1, v2, v3, v4 ); - } -#endif`,Kne=`#ifdef USE_SKINNING - vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); - vec4 skinned = vec4( 0.0 ); - skinned += boneMatX * skinVertex * skinWeight.x; - skinned += boneMatY * skinVertex * skinWeight.y; - skinned += boneMatZ * skinVertex * skinWeight.z; - skinned += boneMatW * skinVertex * skinWeight.w; - transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,Yne=`#ifdef USE_SKINNING - mat4 skinMatrix = mat4( 0.0 ); - skinMatrix += skinWeight.x * boneMatX; - skinMatrix += skinWeight.y * boneMatY; - skinMatrix += skinWeight.z * boneMatZ; - skinMatrix += skinWeight.w * boneMatW; - skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; - objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; - #ifdef USE_TANGENT - objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; - #endif -#endif`,Jne=`float specularStrength; -#ifdef USE_SPECULARMAP - vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); - specularStrength = texelSpecular.r; -#else - specularStrength = 1.0; -#endif`,Zne=`#ifdef USE_SPECULARMAP - uniform sampler2D specularMap; -#endif`,Qne=`#if defined( TONE_MAPPING ) - gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,ere=`#ifndef saturate -#define saturate( a ) clamp( a, 0.0, 1.0 ) -#endif -uniform float toneMappingExposure; -vec3 LinearToneMapping( vec3 color ) { - return saturate( toneMappingExposure * color ); -} -vec3 ReinhardToneMapping( vec3 color ) { - color *= toneMappingExposure; - return saturate( color / ( vec3( 1.0 ) + color ) ); -} -vec3 CineonToneMapping( vec3 color ) { - color *= toneMappingExposure; - color = max( vec3( 0.0 ), color - 0.004 ); - return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); -} -vec3 RRTAndODTFit( vec3 v ) { - vec3 a = v * ( v + 0.0245786 ) - 0.000090537; - vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; - return a / b; -} -vec3 ACESFilmicToneMapping( vec3 color ) { - const mat3 ACESInputMat = mat3( - vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), - vec3( 0.04823, 0.01566, 0.83777 ) - ); - const mat3 ACESOutputMat = mat3( - vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), - vec3( -0.07367, -0.00605, 1.07602 ) - ); - color *= toneMappingExposure / 0.6; - color = ACESInputMat * color; - color = RRTAndODTFit( color ); - color = ACESOutputMat * color; - return saturate( color ); -} -const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( - vec3( 1.6605, - 0.1246, - 0.0182 ), - vec3( - 0.5876, 1.1329, - 0.1006 ), - vec3( - 0.0728, - 0.0083, 1.1187 ) -); -const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( - vec3( 0.6274, 0.0691, 0.0164 ), - vec3( 0.3293, 0.9195, 0.0880 ), - vec3( 0.0433, 0.0113, 0.8956 ) -); -vec3 agxDefaultContrastApprox( vec3 x ) { - vec3 x2 = x * x; - vec3 x4 = x2 * x2; - return + 15.5 * x4 * x2 - - 40.14 * x4 * x - + 31.96 * x4 - - 6.868 * x2 * x - + 0.4298 * x2 - + 0.1191 * x - - 0.00232; -} -vec3 AgXToneMapping( vec3 color ) { - const mat3 AgXInsetMatrix = mat3( - vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), - vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), - vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) - ); - const mat3 AgXOutsetMatrix = mat3( - vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), - vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), - vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) - ); - const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; - color *= toneMappingExposure; - color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; - color = AgXInsetMatrix * color; - color = max( color, 1e-10 ); color = log2( color ); - color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); - color = clamp( color, 0.0, 1.0 ); - color = agxDefaultContrastApprox( color ); - color = AgXOutsetMatrix * color; - color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); - color = LINEAR_REC2020_TO_LINEAR_SRGB * color; - color = clamp( color, 0.0, 1.0 ); - return color; -} -vec3 NeutralToneMapping( vec3 color ) { - const float StartCompression = 0.8 - 0.04; - const float Desaturation = 0.15; - color *= toneMappingExposure; - float x = min( color.r, min( color.g, color.b ) ); - float offset = x < 0.08 ? x - 6.25 * x * x : 0.04; - color -= offset; - float peak = max( color.r, max( color.g, color.b ) ); - if ( peak < StartCompression ) return color; - float d = 1. - StartCompression; - float newPeak = 1. - d * d / ( peak + d - StartCompression ); - color *= newPeak / peak; - float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); - return mix( color, vec3( newPeak ), g ); -} -vec3 CustomToneMapping( vec3 color ) { return color; }`,tre=`#ifdef USE_TRANSMISSION - material.transmission = transmission; - material.transmissionAlpha = 1.0; - material.thickness = thickness; - material.attenuationDistance = attenuationDistance; - material.attenuationColor = attenuationColor; - #ifdef USE_TRANSMISSIONMAP - material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; - #endif - #ifdef USE_THICKNESSMAP - material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; - #endif - vec3 pos = vWorldPosition; - vec3 v = normalize( cameraPosition - pos ); - vec3 n = inverseTransformDirection( normal, viewMatrix ); - vec4 transmitted = getIBLVolumeRefraction( - n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, - pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness, - material.attenuationColor, material.attenuationDistance ); - material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); - totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); -#endif`,nre=`#ifdef USE_TRANSMISSION - uniform float transmission; - uniform float thickness; - uniform float attenuationDistance; - uniform vec3 attenuationColor; - #ifdef USE_TRANSMISSIONMAP - uniform sampler2D transmissionMap; - #endif - #ifdef USE_THICKNESSMAP - uniform sampler2D thicknessMap; - #endif - uniform vec2 transmissionSamplerSize; - uniform sampler2D transmissionSamplerMap; - uniform mat4 modelMatrix; - uniform mat4 projectionMatrix; - varying vec3 vWorldPosition; - float w0( float a ) { - return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); - } - float w1( float a ) { - return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); - } - float w2( float a ){ - return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); - } - float w3( float a ) { - return ( 1.0 / 6.0 ) * ( a * a * a ); - } - float g0( float a ) { - return w0( a ) + w1( a ); - } - float g1( float a ) { - return w2( a ) + w3( a ); - } - float h0( float a ) { - return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); - } - float h1( float a ) { - return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); - } - vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { - uv = uv * texelSize.zw + 0.5; - vec2 iuv = floor( uv ); - vec2 fuv = fract( uv ); - float g0x = g0( fuv.x ); - float g1x = g1( fuv.x ); - float h0x = h0( fuv.x ); - float h1x = h1( fuv.x ); - float h0y = h0( fuv.y ); - float h1y = h1( fuv.y ); - vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; - vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; - vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; - vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; - return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + - g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); - } - vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { - vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); - vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); - vec2 fLodSizeInv = 1.0 / fLodSize; - vec2 cLodSizeInv = 1.0 / cLodSize; - vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); - vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); - return mix( fSample, cSample, fract( lod ) ); - } - vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { - vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); - vec3 modelScale; - modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); - modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); - modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); - return normalize( refractionVector ) * thickness * modelScale; - } - float applyIorToRoughness( const in float roughness, const in float ior ) { - return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); - } - vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { - float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); - return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); - } - vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { - if ( isinf( attenuationDistance ) ) { - return vec3( 1.0 ); - } else { - vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; - vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; - } - } - vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, - const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, - const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness, - const in vec3 attenuationColor, const in float attenuationDistance ) { - vec4 transmittedLight; - vec3 transmittance; - #ifdef USE_DISPERSION - float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion; - vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread ); - for ( int i = 0; i < 3; i ++ ) { - vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix ); - vec3 refractedRayExit = position + transmissionRay; - vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] ); - transmittedLight[ i ] = transmissionSample[ i ]; - transmittedLight.a += transmissionSample.a; - transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ]; - } - transmittedLight.a /= 3.0; - #else - vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); - vec3 refractedRayExit = position + transmissionRay; - vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); - transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); - #endif - vec3 attenuatedColor = transmittance * transmittedLight.rgb; - vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); - float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; - return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); - } -#endif`,rre=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) - varying vec2 vUv; -#endif -#ifdef USE_MAP - varying vec2 vMapUv; -#endif -#ifdef USE_ALPHAMAP - varying vec2 vAlphaMapUv; -#endif -#ifdef USE_LIGHTMAP - varying vec2 vLightMapUv; -#endif -#ifdef USE_AOMAP - varying vec2 vAoMapUv; -#endif -#ifdef USE_BUMPMAP - varying vec2 vBumpMapUv; -#endif -#ifdef USE_NORMALMAP - varying vec2 vNormalMapUv; -#endif -#ifdef USE_EMISSIVEMAP - varying vec2 vEmissiveMapUv; -#endif -#ifdef USE_METALNESSMAP - varying vec2 vMetalnessMapUv; -#endif -#ifdef USE_ROUGHNESSMAP - varying vec2 vRoughnessMapUv; -#endif -#ifdef USE_ANISOTROPYMAP - varying vec2 vAnisotropyMapUv; -#endif -#ifdef USE_CLEARCOATMAP - varying vec2 vClearcoatMapUv; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - varying vec2 vClearcoatNormalMapUv; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - varying vec2 vClearcoatRoughnessMapUv; -#endif -#ifdef USE_IRIDESCENCEMAP - varying vec2 vIridescenceMapUv; -#endif -#ifdef USE_IRIDESCENCE_THICKNESSMAP - varying vec2 vIridescenceThicknessMapUv; -#endif -#ifdef USE_SHEEN_COLORMAP - varying vec2 vSheenColorMapUv; -#endif -#ifdef USE_SHEEN_ROUGHNESSMAP - varying vec2 vSheenRoughnessMapUv; -#endif -#ifdef USE_SPECULARMAP - varying vec2 vSpecularMapUv; -#endif -#ifdef USE_SPECULAR_COLORMAP - varying vec2 vSpecularColorMapUv; -#endif -#ifdef USE_SPECULAR_INTENSITYMAP - varying vec2 vSpecularIntensityMapUv; -#endif -#ifdef USE_TRANSMISSIONMAP - uniform mat3 transmissionMapTransform; - varying vec2 vTransmissionMapUv; -#endif -#ifdef USE_THICKNESSMAP - uniform mat3 thicknessMapTransform; - varying vec2 vThicknessMapUv; -#endif`,ire=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) - varying vec2 vUv; -#endif -#ifdef USE_MAP - uniform mat3 mapTransform; - varying vec2 vMapUv; -#endif -#ifdef USE_ALPHAMAP - uniform mat3 alphaMapTransform; - varying vec2 vAlphaMapUv; -#endif -#ifdef USE_LIGHTMAP - uniform mat3 lightMapTransform; - varying vec2 vLightMapUv; -#endif -#ifdef USE_AOMAP - uniform mat3 aoMapTransform; - varying vec2 vAoMapUv; -#endif -#ifdef USE_BUMPMAP - uniform mat3 bumpMapTransform; - varying vec2 vBumpMapUv; -#endif -#ifdef USE_NORMALMAP - uniform mat3 normalMapTransform; - varying vec2 vNormalMapUv; -#endif -#ifdef USE_DISPLACEMENTMAP - uniform mat3 displacementMapTransform; - varying vec2 vDisplacementMapUv; -#endif -#ifdef USE_EMISSIVEMAP - uniform mat3 emissiveMapTransform; - varying vec2 vEmissiveMapUv; -#endif -#ifdef USE_METALNESSMAP - uniform mat3 metalnessMapTransform; - varying vec2 vMetalnessMapUv; -#endif -#ifdef USE_ROUGHNESSMAP - uniform mat3 roughnessMapTransform; - varying vec2 vRoughnessMapUv; -#endif -#ifdef USE_ANISOTROPYMAP - uniform mat3 anisotropyMapTransform; - varying vec2 vAnisotropyMapUv; -#endif -#ifdef USE_CLEARCOATMAP - uniform mat3 clearcoatMapTransform; - varying vec2 vClearcoatMapUv; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - uniform mat3 clearcoatNormalMapTransform; - varying vec2 vClearcoatNormalMapUv; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - uniform mat3 clearcoatRoughnessMapTransform; - varying vec2 vClearcoatRoughnessMapUv; -#endif -#ifdef USE_SHEEN_COLORMAP - uniform mat3 sheenColorMapTransform; - varying vec2 vSheenColorMapUv; -#endif -#ifdef USE_SHEEN_ROUGHNESSMAP - uniform mat3 sheenRoughnessMapTransform; - varying vec2 vSheenRoughnessMapUv; -#endif -#ifdef USE_IRIDESCENCEMAP - uniform mat3 iridescenceMapTransform; - varying vec2 vIridescenceMapUv; -#endif -#ifdef USE_IRIDESCENCE_THICKNESSMAP - uniform mat3 iridescenceThicknessMapTransform; - varying vec2 vIridescenceThicknessMapUv; -#endif -#ifdef USE_SPECULARMAP - uniform mat3 specularMapTransform; - varying vec2 vSpecularMapUv; -#endif -#ifdef USE_SPECULAR_COLORMAP - uniform mat3 specularColorMapTransform; - varying vec2 vSpecularColorMapUv; -#endif -#ifdef USE_SPECULAR_INTENSITYMAP - uniform mat3 specularIntensityMapTransform; - varying vec2 vSpecularIntensityMapUv; -#endif -#ifdef USE_TRANSMISSIONMAP - uniform mat3 transmissionMapTransform; - varying vec2 vTransmissionMapUv; -#endif -#ifdef USE_THICKNESSMAP - uniform mat3 thicknessMapTransform; - varying vec2 vThicknessMapUv; -#endif`,ore=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) - vUv = vec3( uv, 1 ).xy; -#endif -#ifdef USE_MAP - vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; -#endif -#ifdef USE_ALPHAMAP - vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_LIGHTMAP - vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_AOMAP - vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_BUMPMAP - vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_NORMALMAP - vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_DISPLACEMENTMAP - vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_EMISSIVEMAP - vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_METALNESSMAP - vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_ROUGHNESSMAP - vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_ANISOTROPYMAP - vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_CLEARCOATMAP - vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_IRIDESCENCEMAP - vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_IRIDESCENCE_THICKNESSMAP - vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_SHEEN_COLORMAP - vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_SHEEN_ROUGHNESSMAP - vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_SPECULARMAP - vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_SPECULAR_COLORMAP - vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_SPECULAR_INTENSITYMAP - vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_TRANSMISSIONMAP - vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_THICKNESSMAP - vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; -#endif`,are=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 - vec4 worldPosition = vec4( transformed, 1.0 ); - #ifdef USE_BATCHING - worldPosition = batchingMatrix * worldPosition; - #endif - #ifdef USE_INSTANCING - worldPosition = instanceMatrix * worldPosition; - #endif - worldPosition = modelMatrix * worldPosition; -#endif`;const sre=`varying vec2 vUv; -uniform mat3 uvTransform; -void main() { - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; - gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,lre=`uniform sampler2D t2D; -uniform float backgroundIntensity; -varying vec2 vUv; -void main() { - vec4 texColor = texture2D( t2D, vUv ); - #ifdef DECODE_VIDEO_TEXTURE - texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w ); - #endif - texColor.rgb *= backgroundIntensity; - gl_FragColor = texColor; - #include - #include -}`,cre=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include - gl_Position.z = gl_Position.w; -}`,ure=`#ifdef ENVMAP_TYPE_CUBE - uniform samplerCube envMap; -#elif defined( ENVMAP_TYPE_CUBE_UV ) - uniform sampler2D envMap; -#endif -uniform float flipEnvMap; -uniform float backgroundBlurriness; -uniform float backgroundIntensity; -uniform mat3 backgroundRotation; -varying vec3 vWorldDirection; -#include -void main() { - #ifdef ENVMAP_TYPE_CUBE - vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness ); - #else - vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - #endif - texColor.rgb *= backgroundIntensity; - gl_FragColor = texColor; - #include - #include -}`,dre=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include - gl_Position.z = gl_Position.w; -}`,fre=`uniform samplerCube tCube; -uniform float tFlip; -uniform float opacity; -varying vec3 vWorldDirection; -void main() { - vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); - gl_FragColor = texColor; - gl_FragColor.a *= opacity; - #include - #include -}`,hre=`#include -#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - #include - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vHighPrecisionZW = gl_Position.zw; -}`,pre=`#if DEPTH_PACKING == 3200 - uniform float opacity; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - vec4 diffuseColor = vec4( 1.0 ); - #include - #if DEPTH_PACKING == 3200 - diffuseColor.a = opacity; - #endif - #include - #include - #include - #include - #include - float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; - #if DEPTH_PACKING == 3200 - gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); - #elif DEPTH_PACKING == 3201 - gl_FragColor = packDepthToRGBA( fragCoordZ ); - #elif DEPTH_PACKING == 3202 - gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 ); - #elif DEPTH_PACKING == 3203 - gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); - #endif -}`,mre=`#define DISTANCE -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vWorldPosition = worldPosition.xyz; -}`,gre=`#define DISTANCE -uniform vec3 referencePosition; -uniform float nearDistance; -uniform float farDistance; -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -#include -#include -void main () { - vec4 diffuseColor = vec4( 1.0 ); - #include - #include - #include - #include - #include - float dist = length( vWorldPosition - referencePosition ); - dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); - dist = saturate( dist ); - gl_FragColor = packDepthToRGBA( dist ); -}`,vre=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include -}`,yre=`uniform sampler2D tEquirect; -varying vec3 vWorldDirection; -#include -void main() { - vec3 direction = normalize( vWorldDirection ); - vec2 sampleUV = equirectUv( direction ); - gl_FragColor = texture2D( tEquirect, sampleUV ); - #include - #include -}`,xre=`uniform float scale; -attribute float lineDistance; -varying float vLineDistance; -#include -#include -#include -#include -#include -#include -#include -void main() { - vLineDistance = scale * lineDistance; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,bre=`uniform vec3 diffuse; -uniform float opacity; -uniform float dashSize; -uniform float totalSize; -varying float vLineDistance; -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - if ( mod( vLineDistance, totalSize ) > dashSize ) { - discard; - } - vec3 outgoingLight = vec3( 0.0 ); - #include - #include - #include - outgoingLight = diffuseColor.rgb; - #include - #include - #include - #include - #include -}`,_re=`#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) - #include - #include - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,wre=`uniform vec3 diffuse; -uniform float opacity; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - #include - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - #ifdef USE_LIGHTMAP - vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); - reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; - #else - reflectedLight.indirectDiffuse += vec3( 1.0 ); - #endif - #include - reflectedLight.indirectDiffuse *= diffuseColor.rgb; - vec3 outgoingLight = reflectedLight.indirectDiffuse; - #include - #include - #include - #include - #include - #include - #include -}`,Sre=`#define LAMBERT -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include - #include -}`,Ere=`#define LAMBERT -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - #include - #include - #include - #include - #include - #include - #include -}`,Tre=`#define MATCAP -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; -}`,Mre=`#define MATCAP -uniform vec3 diffuse; -uniform float opacity; -uniform sampler2D matcap; -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 viewDir = normalize( vViewPosition ); - vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); - vec3 y = cross( viewDir, x ); - vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; - #ifdef USE_MATCAP - vec4 matcapColor = texture2D( matcap, uv ); - #else - vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); - #endif - vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; - #include - #include - #include - #include - #include - #include -}`,Are=`#define NORMAL -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) - varying vec3 vViewPosition; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) - vViewPosition = - mvPosition.xyz; -#endif -}`,Cre=`#define NORMAL -uniform float opacity; -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) - varying vec3 vViewPosition; -#endif -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); - #include - #include - #include - #include - gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a ); - #ifdef OPAQUE - gl_FragColor.a = 1.0; - #endif -}`,Pre=`#define PHONG -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include - #include -}`,Rre=`#define PHONG -uniform vec3 diffuse; -uniform vec3 emissive; -uniform vec3 specular; -uniform float shininess; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; - #include - #include - #include - #include - #include - #include - #include -}`,Nre=`#define STANDARD -varying vec3 vViewPosition; -#ifdef USE_TRANSMISSION - varying vec3 vWorldPosition; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -#ifdef USE_TRANSMISSION - vWorldPosition = worldPosition.xyz; -#endif -}`,Ore=`#define STANDARD -#ifdef PHYSICAL - #define IOR - #define USE_SPECULAR -#endif -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float roughness; -uniform float metalness; -uniform float opacity; -#ifdef IOR - uniform float ior; -#endif -#ifdef USE_SPECULAR - uniform float specularIntensity; - uniform vec3 specularColor; - #ifdef USE_SPECULAR_COLORMAP - uniform sampler2D specularColorMap; - #endif - #ifdef USE_SPECULAR_INTENSITYMAP - uniform sampler2D specularIntensityMap; - #endif -#endif -#ifdef USE_CLEARCOAT - uniform float clearcoat; - uniform float clearcoatRoughness; -#endif -#ifdef USE_DISPERSION - uniform float dispersion; -#endif -#ifdef USE_IRIDESCENCE - uniform float iridescence; - uniform float iridescenceIOR; - uniform float iridescenceThicknessMinimum; - uniform float iridescenceThicknessMaximum; -#endif -#ifdef USE_SHEEN - uniform vec3 sheenColor; - uniform float sheenRoughness; - #ifdef USE_SHEEN_COLORMAP - uniform sampler2D sheenColorMap; - #endif - #ifdef USE_SHEEN_ROUGHNESSMAP - uniform sampler2D sheenRoughnessMap; - #endif -#endif -#ifdef USE_ANISOTROPY - uniform vec2 anisotropyVector; - #ifdef USE_ANISOTROPYMAP - uniform sampler2D anisotropyMap; - #endif -#endif -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; - vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; - #include - vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; - #ifdef USE_SHEEN - float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); - outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect; - #endif - #ifdef USE_CLEARCOAT - float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); - vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); - outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; - #endif - #include - #include - #include - #include - #include - #include -}`,Ire=`#define TOON -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -}`,Dre=`#define TOON -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - #include - #include - #include - #include - #include - #include -}`,Lre=`uniform float size; -uniform float scale; -#include -#include -#include -#include -#include -#include -#ifdef USE_POINTS_UV - varying vec2 vUv; - uniform mat3 uvTransform; -#endif -void main() { - #ifdef USE_POINTS_UV - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; - #endif - #include - #include - #include - #include - #include - #include - gl_PointSize = size; - #ifdef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); - #endif - #include - #include - #include - #include -}`,kre=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - vec3 outgoingLight = vec3( 0.0 ); - #include - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - #include - #include - #include - #include - #include -}`,jre=`#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,Ure=`uniform vec3 color; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); - #include - #include - #include -}`,Fre=`uniform float rotation; -uniform vec2 center; -#include -#include -#include -#include -#include -void main() { - #include - vec4 mvPosition = modelViewMatrix[ 3 ]; - vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) ); - #ifndef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) scale *= - mvPosition.z; - #endif - vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; - vec2 rotatedPosition; - rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; - rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; - mvPosition.xy += rotatedPosition; - gl_Position = projectionMatrix * mvPosition; - #include - #include - #include -}`,Bre=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - vec3 outgoingLight = vec3( 0.0 ); - #include - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - #include - #include - #include - #include -}`,Rt={alphahash_fragment:lte,alphahash_pars_fragment:cte,alphamap_fragment:ute,alphamap_pars_fragment:dte,alphatest_fragment:fte,alphatest_pars_fragment:hte,aomap_fragment:pte,aomap_pars_fragment:mte,batching_pars_vertex:gte,batching_vertex:vte,begin_vertex:yte,beginnormal_vertex:xte,bsdfs:bte,iridescence_fragment:_te,bumpmap_pars_fragment:wte,clipping_planes_fragment:Ste,clipping_planes_pars_fragment:Ete,clipping_planes_pars_vertex:Tte,clipping_planes_vertex:Mte,color_fragment:Ate,color_pars_fragment:Cte,color_pars_vertex:Pte,color_vertex:Rte,common:Nte,cube_uv_reflection_fragment:Ote,defaultnormal_vertex:Ite,displacementmap_pars_vertex:Dte,displacementmap_vertex:Lte,emissivemap_fragment:kte,emissivemap_pars_fragment:jte,colorspace_fragment:Ute,colorspace_pars_fragment:Fte,envmap_fragment:Bte,envmap_common_pars_fragment:$te,envmap_pars_fragment:zte,envmap_pars_vertex:Hte,envmap_physical_pars_fragment:ene,envmap_vertex:Vte,fog_vertex:Gte,fog_pars_vertex:Wte,fog_fragment:Xte,fog_pars_fragment:qte,gradientmap_pars_fragment:Kte,lightmap_pars_fragment:Yte,lights_lambert_fragment:Jte,lights_lambert_pars_fragment:Zte,lights_pars_begin:Qte,lights_toon_fragment:tne,lights_toon_pars_fragment:nne,lights_phong_fragment:rne,lights_phong_pars_fragment:ine,lights_physical_fragment:one,lights_physical_pars_fragment:ane,lights_fragment_begin:sne,lights_fragment_maps:lne,lights_fragment_end:cne,logdepthbuf_fragment:une,logdepthbuf_pars_fragment:dne,logdepthbuf_pars_vertex:fne,logdepthbuf_vertex:hne,map_fragment:pne,map_pars_fragment:mne,map_particle_fragment:gne,map_particle_pars_fragment:vne,metalnessmap_fragment:yne,metalnessmap_pars_fragment:xne,morphinstance_vertex:bne,morphcolor_vertex:_ne,morphnormal_vertex:wne,morphtarget_pars_vertex:Sne,morphtarget_vertex:Ene,normal_fragment_begin:Tne,normal_fragment_maps:Mne,normal_pars_fragment:Ane,normal_pars_vertex:Cne,normal_vertex:Pne,normalmap_pars_fragment:Rne,clearcoat_normal_fragment_begin:Nne,clearcoat_normal_fragment_maps:One,clearcoat_pars_fragment:Ine,iridescence_pars_fragment:Dne,opaque_fragment:Lne,packing:kne,premultiplied_alpha_fragment:jne,project_vertex:Une,dithering_fragment:Fne,dithering_pars_fragment:Bne,roughnessmap_fragment:$ne,roughnessmap_pars_fragment:zne,shadowmap_pars_fragment:Hne,shadowmap_pars_vertex:Vne,shadowmap_vertex:Gne,shadowmask_pars_fragment:Wne,skinbase_vertex:Xne,skinning_pars_vertex:qne,skinning_vertex:Kne,skinnormal_vertex:Yne,specularmap_fragment:Jne,specularmap_pars_fragment:Zne,tonemapping_fragment:Qne,tonemapping_pars_fragment:ere,transmission_fragment:tre,transmission_pars_fragment:nre,uv_pars_fragment:rre,uv_pars_vertex:ire,uv_vertex:ore,worldpos_vertex:are,background_vert:sre,background_frag:lre,backgroundCube_vert:cre,backgroundCube_frag:ure,cube_vert:dre,cube_frag:fre,depth_vert:hre,depth_frag:pre,distanceRGBA_vert:mre,distanceRGBA_frag:gre,equirect_vert:vre,equirect_frag:yre,linedashed_vert:xre,linedashed_frag:bre,meshbasic_vert:_re,meshbasic_frag:wre,meshlambert_vert:Sre,meshlambert_frag:Ere,meshmatcap_vert:Tre,meshmatcap_frag:Mre,meshnormal_vert:Are,meshnormal_frag:Cre,meshphong_vert:Pre,meshphong_frag:Rre,meshphysical_vert:Nre,meshphysical_frag:Ore,meshtoon_vert:Ire,meshtoon_frag:Dre,points_vert:Lre,points_frag:kre,shadow_vert:jre,shadow_frag:Ure,sprite_vert:Fre,sprite_frag:Bre},Fe={common:{diffuse:{value:new ft(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Pt},alphaMap:{value:null},alphaMapTransform:{value:new Pt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Pt}},envmap:{envMap:{value:null},envMapRotation:{value:new Pt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Pt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Pt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Pt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Pt},normalScale:{value:new xt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Pt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Pt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Pt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Pt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ft(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new ft(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Pt},alphaTest:{value:0},uvTransform:{value:new Pt}},sprite:{diffuse:{value:new ft(16777215)},opacity:{value:1},center:{value:new xt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Pt},alphaMap:{value:null},alphaMapTransform:{value:new Pt},alphaTest:{value:0}}},ta={basic:{uniforms:Fr([Fe.common,Fe.specularmap,Fe.envmap,Fe.aomap,Fe.lightmap,Fe.fog]),vertexShader:Rt.meshbasic_vert,fragmentShader:Rt.meshbasic_frag},lambert:{uniforms:Fr([Fe.common,Fe.specularmap,Fe.envmap,Fe.aomap,Fe.lightmap,Fe.emissivemap,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.fog,Fe.lights,{emissive:{value:new ft(0)}}]),vertexShader:Rt.meshlambert_vert,fragmentShader:Rt.meshlambert_frag},phong:{uniforms:Fr([Fe.common,Fe.specularmap,Fe.envmap,Fe.aomap,Fe.lightmap,Fe.emissivemap,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.fog,Fe.lights,{emissive:{value:new ft(0)},specular:{value:new ft(1118481)},shininess:{value:30}}]),vertexShader:Rt.meshphong_vert,fragmentShader:Rt.meshphong_frag},standard:{uniforms:Fr([Fe.common,Fe.envmap,Fe.aomap,Fe.lightmap,Fe.emissivemap,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.roughnessmap,Fe.metalnessmap,Fe.fog,Fe.lights,{emissive:{value:new ft(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Rt.meshphysical_vert,fragmentShader:Rt.meshphysical_frag},toon:{uniforms:Fr([Fe.common,Fe.aomap,Fe.lightmap,Fe.emissivemap,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.gradientmap,Fe.fog,Fe.lights,{emissive:{value:new ft(0)}}]),vertexShader:Rt.meshtoon_vert,fragmentShader:Rt.meshtoon_frag},matcap:{uniforms:Fr([Fe.common,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.fog,{matcap:{value:null}}]),vertexShader:Rt.meshmatcap_vert,fragmentShader:Rt.meshmatcap_frag},points:{uniforms:Fr([Fe.points,Fe.fog]),vertexShader:Rt.points_vert,fragmentShader:Rt.points_frag},dashed:{uniforms:Fr([Fe.common,Fe.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Rt.linedashed_vert,fragmentShader:Rt.linedashed_frag},depth:{uniforms:Fr([Fe.common,Fe.displacementmap]),vertexShader:Rt.depth_vert,fragmentShader:Rt.depth_frag},normal:{uniforms:Fr([Fe.common,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,{opacity:{value:1}}]),vertexShader:Rt.meshnormal_vert,fragmentShader:Rt.meshnormal_frag},sprite:{uniforms:Fr([Fe.sprite,Fe.fog]),vertexShader:Rt.sprite_vert,fragmentShader:Rt.sprite_frag},background:{uniforms:{uvTransform:{value:new Pt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Rt.background_vert,fragmentShader:Rt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Pt}},vertexShader:Rt.backgroundCube_vert,fragmentShader:Rt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Rt.cube_vert,fragmentShader:Rt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Rt.equirect_vert,fragmentShader:Rt.equirect_frag},distanceRGBA:{uniforms:Fr([Fe.common,Fe.displacementmap,{referencePosition:{value:new ne},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Rt.distanceRGBA_vert,fragmentShader:Rt.distanceRGBA_frag},shadow:{uniforms:Fr([Fe.lights,Fe.fog,{color:{value:new ft(0)},opacity:{value:1}}]),vertexShader:Rt.shadow_vert,fragmentShader:Rt.shadow_frag}};ta.physical={uniforms:Fr([ta.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Pt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Pt},clearcoatNormalScale:{value:new xt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Pt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Pt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Pt},sheen:{value:0},sheenColor:{value:new ft(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Pt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Pt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Pt},transmissionSamplerSize:{value:new xt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Pt},attenuationDistance:{value:0},attenuationColor:{value:new ft(0)},specularColor:{value:new ft(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Pt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Pt},anisotropyVector:{value:new xt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Pt}}]),vertexShader:Rt.meshphysical_vert,fragmentShader:Rt.meshphysical_frag};const Jg={r:0,b:0,g:0},kl=new pi,$re=new gt;function zre(t,e,n,r,i,o,a){const s=new ft(0);let l=o===!0?0:1,c,u,d=null,f=0,p=null;function y(b){let S=b.isScene===!0?b.background:null;return S&&S.isTexture&&(S=(b.backgroundBlurriness>0?n:e).get(S)),S}function v(b){let S=!1;const w=y(b);w===null?m(s,l):w&&w.isColor&&(m(w,1),S=!0);const E=t.xr.getEnvironmentBlendMode();E==="additive"?r.buffers.color.setClear(0,0,0,1,a):E==="alpha-blend"&&r.buffers.color.setClear(0,0,0,0,a),(t.autoClear||S)&&(r.buffers.depth.setTest(!0),r.buffers.depth.setMask(!0),r.buffers.color.setMask(!0),t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil))}function g(b,S){const w=y(S);w&&(w.isCubeTexture||w.mapping===Lx)?(u===void 0&&(u=new Mn(new Gc(1,1,1),new fl({name:"BackgroundCubeMaterial",uniforms:$d(ta.backgroundCube.uniforms),vertexShader:ta.backgroundCube.vertexShader,fragmentShader:ta.backgroundCube.fragmentShader,side:ui,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(E,T,A){this.matrixWorld.copyPosition(A.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(u)),kl.copy(S.backgroundRotation),kl.x*=-1,kl.y*=-1,kl.z*=-1,w.isCubeTexture&&w.isRenderTargetTexture===!1&&(kl.y*=-1,kl.z*=-1),u.material.uniforms.envMap.value=w,u.material.uniforms.flipEnvMap.value=w.isCubeTexture&&w.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=S.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=S.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4($re.makeRotationFromEuler(kl)),u.material.toneMapped=Dt.getTransfer(w.colorSpace)!==an,(d!==w||f!==w.version||p!==t.toneMapping)&&(u.material.needsUpdate=!0,d=w,f=w.version,p=t.toneMapping),u.layers.enableAll(),b.unshift(u,u.geometry,u.material,0,0,null)):w&&w.isTexture&&(c===void 0&&(c=new Mn(new Om(2,2),new fl({name:"BackgroundMaterial",uniforms:$d(ta.background.uniforms),vertexShader:ta.background.vertexShader,fragmentShader:ta.background.fragmentShader,side:va,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(c)),c.material.uniforms.t2D.value=w,c.material.uniforms.backgroundIntensity.value=S.backgroundIntensity,c.material.toneMapped=Dt.getTransfer(w.colorSpace)!==an,w.matrixAutoUpdate===!0&&w.updateMatrix(),c.material.uniforms.uvTransform.value.copy(w.matrix),(d!==w||f!==w.version||p!==t.toneMapping)&&(c.material.needsUpdate=!0,d=w,f=w.version,p=t.toneMapping),c.layers.enableAll(),b.unshift(c,c.geometry,c.material,0,0,null))}function m(b,S){b.getRGB(Jg,L4(t)),r.buffers.color.setClear(Jg.r,Jg.g,Jg.b,S,a)}function x(){u!==void 0&&(u.geometry.dispose(),u.material.dispose(),u=void 0),c!==void 0&&(c.geometry.dispose(),c.material.dispose(),c=void 0)}return{getClearColor:function(){return s},setClearColor:function(b,S=1){s.set(b),l=S,m(s,l)},getClearAlpha:function(){return l},setClearAlpha:function(b){l=b,m(s,l)},render:v,addToRenderList:g,dispose:x}}function Hre(t,e){const n=t.getParameter(t.MAX_VERTEX_ATTRIBS),r={},i=f(null);let o=i,a=!1;function s(C,P,R,D,k){let U=!1;const O=d(D,R,P);o!==O&&(o=O,c(o.object)),U=p(C,D,R,k),U&&y(C,D,R,k),k!==null&&e.update(k,t.ELEMENT_ARRAY_BUFFER),(U||a)&&(a=!1,S(C,P,R,D),k!==null&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e.get(k).buffer))}function l(){return t.createVertexArray()}function c(C){return t.bindVertexArray(C)}function u(C){return t.deleteVertexArray(C)}function d(C,P,R){const D=R.wireframe===!0;let k=r[C.id];k===void 0&&(k={},r[C.id]=k);let U=k[P.id];U===void 0&&(U={},k[P.id]=U);let O=U[D];return O===void 0&&(O=f(l()),U[D]=O),O}function f(C){const P=[],R=[],D=[];for(let k=0;k=0){const X=k[L];let K=U[L];if(K===void 0&&(L==="instanceMatrix"&&C.instanceMatrix&&(K=C.instanceMatrix),L==="instanceColor"&&C.instanceColor&&(K=C.instanceColor)),X===void 0||X.attribute!==K||K&&X.data!==K.data)return!0;O++}return o.attributesNum!==O||o.index!==D}function y(C,P,R,D){const k={},U=P.attributes;let O=0;const W=R.getAttributes();for(const L in W)if(W[L].location>=0){let X=U[L];X===void 0&&(L==="instanceMatrix"&&C.instanceMatrix&&(X=C.instanceMatrix),L==="instanceColor"&&C.instanceColor&&(X=C.instanceColor));const K={};K.attribute=X,X&&X.data&&(K.data=X.data),k[L]=K,O++}o.attributes=k,o.attributesNum=O,o.index=D}function v(){const C=o.newAttributes;for(let P=0,R=C.length;P=0){let j=k[W];if(j===void 0&&(W==="instanceMatrix"&&C.instanceMatrix&&(j=C.instanceMatrix),W==="instanceColor"&&C.instanceColor&&(j=C.instanceColor)),j!==void 0){const X=j.normalized,K=j.itemSize,F=e.get(j);if(F===void 0)continue;const Y=F.buffer,q=F.type,Q=F.bytesPerElement,te=q===t.INT||q===t.UNSIGNED_INT||j.gpuType===FA;if(j.isInterleavedBufferAttribute){const ee=j.data,ce=ee.stride,ae=j.offset;if(ee.isInstancedInterleavedBuffer){for(let fe=0;fe0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";T="mediump"}return T==="mediump"&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=n.precision!==void 0?n.precision:"highp";const u=l(c);u!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",u,"instead."),c=u);const d=n.logarithmicDepthBuffer===!0,f=n.reverseDepthBuffer===!0&&e.has("EXT_clip_control"),p=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),y=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),v=t.getParameter(t.MAX_TEXTURE_SIZE),g=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),m=t.getParameter(t.MAX_VERTEX_ATTRIBS),x=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),b=t.getParameter(t.MAX_VARYING_VECTORS),S=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),w=y>0,E=t.getParameter(t.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:o,getMaxPrecision:l,textureFormatReadable:a,textureTypeReadable:s,precision:c,logarithmicDepthBuffer:d,reverseDepthBuffer:f,maxTextures:p,maxVertexTextures:y,maxTextureSize:v,maxCubemapSize:g,maxAttributes:m,maxVertexUniforms:x,maxVaryings:b,maxFragmentUniforms:S,vertexTextures:w,maxSamples:E}}function Wre(t){const e=this;let n=null,r=0,i=!1,o=!1;const a=new Ua,s=new Pt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(d,f){const p=d.length!==0||f||r!==0||i;return i=f,r=d.length,p},this.beginShadows=function(){o=!0,u(null)},this.endShadows=function(){o=!1},this.setGlobalState=function(d,f){n=u(d,f,0)},this.setState=function(d,f,p){const y=d.clippingPlanes,v=d.clipIntersection,g=d.clipShadows,m=t.get(d);if(!i||y===null||y.length===0||o&&!g)o?u(null):c();else{const x=o?0:r,b=x*4;let S=m.clippingState||null;l.value=S,S=u(y,f,b,p);for(let w=0;w!==b;++w)S[w]=n[w];m.clippingState=S,this.numIntersection=v?this.numPlanes:0,this.numPlanes+=x}};function c(){l.value!==n&&(l.value=n,l.needsUpdate=r>0),e.numPlanes=r,e.numIntersection=0}function u(d,f,p,y){const v=d!==null?d.length:0;let g=null;if(v!==0){if(g=l.value,y!==!0||g===null){const m=p+v*4,x=f.matrixWorldInverse;s.getNormalMatrix(x),(g===null||g.length0){const c=new xee(l.height);return c.fromEquirectangularTexture(t,a),e.set(a,c),a.addEventListener("dispose",i),n(c.texture,a.mapping)}else return null}}return a}function i(a){const s=a.target;s.removeEventListener("dispose",i);const l=e.get(s);l!==void 0&&(e.delete(s),l.dispose())}function o(){e=new WeakMap}return{get:r,dispose:o}}const Vu=4,CO=[.125,.215,.35,.446,.526,.582],Kl=20,yw=new Fx,PO=new ft;let xw=null,bw=0,_w=0,ww=!1;const Hl=(1+Math.sqrt(5))/2,bu=1/Hl,RO=[new ne(-Hl,bu,0),new ne(Hl,bu,0),new ne(-bu,0,Hl),new ne(bu,0,Hl),new ne(0,Hl,-bu),new ne(0,Hl,bu),new ne(-1,1,-1),new ne(1,1,-1),new ne(-1,1,1),new ne(1,1,1)],qre=new ne;class NO{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,n=0,r=.1,i=100,o={}){const{size:a=256,position:s=qre}=o;xw=this._renderer.getRenderTarget(),bw=this._renderer.getActiveCubeFace(),_w=this._renderer.getActiveMipmapLevel(),ww=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(a);const l=this._allocateTargets();return l.depthBuffer=!0,this._sceneToCubeUV(e,r,i,l,s),n>0&&this._blur(l,0,0,n),this._applyPMREM(l),this._cleanup(l),l}fromEquirectangular(e,n=null){return this._fromTexture(e,n)}fromCubemap(e,n=null){return this._fromTexture(e,n)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=DO(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=IO(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?S:0,S,S),d.setRenderTarget(i),g&&d.render(v,l),d.render(e,l)}v.geometry.dispose(),v.material.dispose(),d.toneMapping=p,d.autoClear=f,e.background=m}_textureToCubeUV(e,n){const r=this._renderer,i=e.mapping===Ud||e.mapping===Fd;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=DO()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=IO());const o=i?this._cubemapMaterial:this._equirectMaterial,a=new Mn(this._lodPlanes[0],o),s=o.uniforms;s.envMap.value=e;const l=this._cubeSize;Zg(n,0,0,3*l,2*l),r.setRenderTarget(n),r.render(a,yw)}_applyPMREM(e){const n=this._renderer,r=n.autoClear;n.autoClear=!1;const i=this._lodPlanes.length;for(let o=1;oKl&&console.warn(`sigmaRadians, ${o}, is too large and will clip, as it requested ${g} samples when the maximum is set to ${Kl}`);const m=[];let x=0;for(let T=0;Tb-Vu?i-b+Vu:0),E=4*(this._cubeSize-S);Zg(n,w,E,3*S,2*S),l.setRenderTarget(n),l.render(d,yw)}}function Kre(t){const e=[],n=[],r=[];let i=t;const o=t-Vu+1+CO.length;for(let a=0;at-Vu?l=CO[a-t+Vu-1]:a===0&&(l=0),r.push(l);const c=1/(s-2),u=-c,d=1+c,f=[u,u,d,u,d,d,u,u,d,d,u,d],p=6,y=6,v=3,g=2,m=1,x=new Float32Array(v*y*p),b=new Float32Array(g*y*p),S=new Float32Array(m*y*p);for(let E=0;E2?0:-1,M=[T,A,0,T+2/3,A,0,T+2/3,A+1,0,T,A,0,T+2/3,A+1,0,T,A+1,0];x.set(M,v*y*E),b.set(f,g*y*E);const C=[E,E,E,E,E,E];S.set(C,m*y*E)}const w=new br;w.setAttribute("position",new cr(x,v)),w.setAttribute("uv",new cr(b,g)),w.setAttribute("faceIndex",new cr(S,m)),e.push(w),i>Vu&&i--}return{lodPlanes:e,sizeLods:n,sigmas:r}}function OO(t,e,n){const r=new Oc(t,e,n);return r.texture.mapping=Lx,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function Zg(t,e,n,r,i){t.viewport.set(e,n,r,i),t.scissor.set(e,n,r,i)}function Yre(t,e,n){const r=new Float32Array(Kl),i=new ne(0,1,0);return new fl({name:"SphericalGaussianBlur",defines:{n:Kl,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:aC(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform int samples; - uniform float weights[ n ]; - uniform bool latitudinal; - uniform float dTheta; - uniform float mipInt; - uniform vec3 poleAxis; - - #define ENVMAP_TYPE_CUBE_UV - #include - - vec3 getSample( float theta, vec3 axis ) { - - float cosTheta = cos( theta ); - // Rodrigues' axis-angle rotation - vec3 sampleDirection = vOutputDirection * cosTheta - + cross( axis, vOutputDirection ) * sin( theta ) - + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); - - return bilinearCubeUV( envMap, sampleDirection, mipInt ); - - } - - void main() { - - vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); - - if ( all( equal( axis, vec3( 0.0 ) ) ) ) { - - axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); - - } - - axis = normalize( axis ); - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); - - for ( int i = 1; i < n; i++ ) { - - if ( i >= samples ) { - - break; - - } - - float theta = dTheta * float( i ); - gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); - gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); - - } - - } - `,blending:el,depthTest:!1,depthWrite:!1})}function IO(){return new fl({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:aC(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - - #include - - void main() { - - vec3 outputDirection = normalize( vOutputDirection ); - vec2 uv = equirectUv( outputDirection ); - - gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); - - } - `,blending:el,depthTest:!1,depthWrite:!1})}function DO(){return new fl({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:aC(),fragmentShader:` - - precision mediump float; - precision mediump int; - - uniform float flipEnvMap; - - varying vec3 vOutputDirection; - - uniform samplerCube envMap; - - void main() { - - gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); - - } - `,blending:el,depthTest:!1,depthWrite:!1})}function aC(){return` - - precision mediump float; - precision mediump int; - - attribute float faceIndex; - - varying vec3 vOutputDirection; - - // RH coordinate system; PMREM face-indexing convention - vec3 getDirection( vec2 uv, float face ) { - - uv = 2.0 * uv - 1.0; - - vec3 direction = vec3( uv, 1.0 ); - - if ( face == 0.0 ) { - - direction = direction.zyx; // ( 1, v, u ) pos x - - } else if ( face == 1.0 ) { - - direction = direction.xzy; - direction.xz *= -1.0; // ( -u, 1, -v ) pos y - - } else if ( face == 2.0 ) { - - direction.x *= -1.0; // ( -u, v, 1 ) pos z - - } else if ( face == 3.0 ) { - - direction = direction.zyx; - direction.xz *= -1.0; // ( -1, v, -u ) neg x - - } else if ( face == 4.0 ) { - - direction = direction.xzy; - direction.xy *= -1.0; // ( -u, -1, v ) neg y - - } else if ( face == 5.0 ) { - - direction.z *= -1.0; // ( u, v, -1 ) neg z - - } - - return direction; - - } - - void main() { - - vOutputDirection = getDirection( uv, faceIndex ); - gl_Position = vec4( position, 1.0 ); - - } - `}function Jre(t){let e=new WeakMap,n=null;function r(s){if(s&&s.isTexture){const l=s.mapping,c=l===jE||l===UE,u=l===Ud||l===Fd;if(c||u){let d=e.get(s);const f=d!==void 0?d.texture.pmremVersion:0;if(s.isRenderTargetTexture&&s.pmremVersion!==f)return n===null&&(n=new NO(t)),d=c?n.fromEquirectangular(s,d):n.fromCubemap(s,d),d.texture.pmremVersion=s.pmremVersion,e.set(s,d),d.texture;if(d!==void 0)return d.texture;{const p=s.image;return c&&p&&p.height>0||u&&p&&i(p)?(n===null&&(n=new NO(t)),d=c?n.fromEquirectangular(s):n.fromCubemap(s),d.texture.pmremVersion=s.pmremVersion,e.set(s,d),s.addEventListener("dispose",o),d.texture):null}}}return s}function i(s){let l=0;const c=6;for(let u=0;ue.maxTextureSize&&(E=Math.ceil(w/e.maxTextureSize),w=e.maxTextureSize);const T=new Float32Array(w*E*4*d),A=new N4(T,w,E,d);A.type=Io,A.needsUpdate=!0;const M=S*4;for(let P=0;P0)return t;const i=e*n;let o=kO[i];if(o===void 0&&(o=new Float32Array(i),kO[i]=o),e!==0){r.toArray(o,0);for(let a=1,s=0;a!==e;++a)s+=n,t[a].toArray(o,s)}return o}function Zn(t,e){if(t.length!==e.length)return!1;for(let n=0,r=t.length;n":" "} ${s}: ${n[a]}`)}return r.join(` -`)}const HO=new Pt;function Jie(t){Dt._getMatrix(HO,Dt.workingColorSpace,t);const e=`mat3( ${HO.elements.map(n=>n.toFixed(4))} )`;switch(Dt.getTransfer(t)){case Cy:return[e,"LinearTransferOETF"];case an:return[e,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",t),[e,"LinearTransferOETF"]}}function VO(t,e,n){const r=t.getShaderParameter(e,t.COMPILE_STATUS),i=t.getShaderInfoLog(e).trim();if(r&&i==="")return"";const o=/ERROR: 0:(\d+)/.exec(i);if(o){const a=parseInt(o[1]);return n.toUpperCase()+` - -`+i+` - -`+Yie(t.getShaderSource(e),a)}else return i}function Zie(t,e){const n=Jie(e);return[`vec4 ${t}( vec4 value ) {`,` return ${n[1]}( vec4( value.rgb * ${n[0]}, value.a ) );`,"}"].join(` -`)}function Qie(t,e){let n;switch(e){case dQ:n="Linear";break;case fQ:n="Reinhard";break;case hQ:n="Cineon";break;case pQ:n="ACESFilmic";break;case gQ:n="AgX";break;case vQ:n="Neutral";break;case mQ:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}const Qg=new ne;function eoe(){Dt.getLuminanceCoefficients(Qg);const t=Qg.x.toFixed(4),e=Qg.y.toFixed(4),n=Qg.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${t}, ${e}, ${n} );`," return dot( weights, rgb );","}"].join(` -`)}function toe(t){return[t.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",t.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Ph).join(` -`)}function noe(t){const e=[];for(const n in t){const r=t[n];r!==!1&&e.push("#define "+n+" "+r)}return e.join(` -`)}function roe(t,e){const n={},r=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let i=0;i/gm;function v1(t){return t.replace(ioe,aoe)}const ooe=new Map;function aoe(t,e){let n=Rt[e];if(n===void 0){const r=ooe.get(e);if(r!==void 0)n=Rt[r],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,r);else throw new Error("Can not resolve #include <"+e+">")}return v1(n)}const soe=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function XO(t){return t.replace(soe,loe)}function loe(t,e,n,r){let i="";for(let o=parseInt(e);o0&&(g+=` -`),m=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,y].filter(Ph).join(` -`),m.length>0&&(m+=` -`)):(g=[qO(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,y,n.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",n.batching?"#define USE_BATCHING":"",n.batchingColor?"#define USE_BATCHING_COLOR":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.instancingMorph?"#define USE_INSTANCING_MORPH":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&n.flatShading===!1?"#define USE_MORPHNORMALS":"",n.morphColors?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` -`].filter(Ph).join(` -`),m=[qO(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,y,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.envMap?"#define "+u:"",n.envMap?"#define "+d:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.dispersion?"#define USE_DISPERSION":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor||n.batchingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==tl?"#define TONE_MAPPING":"",n.toneMapping!==tl?Rt.tonemapping_pars_fragment:"",n.toneMapping!==tl?Qie("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",Rt.colorspace_pars_fragment,Zie("linearToOutputTexel",n.outputColorSpace),eoe(),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"",` -`].filter(Ph).join(` -`)),a=v1(a),a=GO(a,n),a=WO(a,n),s=v1(s),s=GO(s,n),s=WO(s,n),a=XO(a),s=XO(s),n.isRawShaderMaterial!==!0&&(x=`#version 300 es -`,g=[p,"#define attribute in","#define varying out","#define texture2D texture"].join(` -`)+` -`+g,m=["#define varying in",n.glslVersion===$N?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===$N?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` -`)+` -`+m);const b=x+g+a,S=x+m+s,w=zO(i,i.VERTEX_SHADER,b),E=zO(i,i.FRAGMENT_SHADER,S);i.attachShader(v,w),i.attachShader(v,E),n.index0AttributeName!==void 0?i.bindAttribLocation(v,0,n.index0AttributeName):n.morphTargets===!0&&i.bindAttribLocation(v,0,"position"),i.linkProgram(v);function T(P){if(t.debug.checkShaderErrors){const R=i.getProgramInfoLog(v).trim(),D=i.getShaderInfoLog(w).trim(),k=i.getShaderInfoLog(E).trim();let U=!0,O=!0;if(i.getProgramParameter(v,i.LINK_STATUS)===!1)if(U=!1,typeof t.debug.onShaderError=="function")t.debug.onShaderError(i,v,w,E);else{const W=VO(i,w,"vertex"),L=VO(i,E,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(v,i.VALIDATE_STATUS)+` - -Material Name: `+P.name+` -Material Type: `+P.type+` - -Program Info Log: `+R+` -`+W+` -`+L)}else R!==""?console.warn("THREE.WebGLProgram: Program Info Log:",R):(D===""||k==="")&&(O=!1);O&&(P.diagnostics={runnable:U,programLog:R,vertexShader:{log:D,prefix:g},fragmentShader:{log:k,prefix:m}})}i.deleteShader(w),i.deleteShader(E),A=new Wv(i,v),M=roe(i,v)}let A;this.getUniforms=function(){return A===void 0&&T(this),A};let M;this.getAttributes=function(){return M===void 0&&T(this),M};let C=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return C===!1&&(C=i.getProgramParameter(v,qie)),C},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(v),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=Kie++,this.cacheKey=e,this.usedTimes=1,this.program=v,this.vertexShader=w,this.fragmentShader=E,this}let moe=0;class goe{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const n=e.vertexShader,r=e.fragmentShader,i=this._getShaderStage(n),o=this._getShaderStage(r),a=this._getShaderCacheForMaterial(e);return a.has(i)===!1&&(a.add(i),i.usedTimes++),a.has(o)===!1&&(a.add(o),o.usedTimes++),this}remove(e){const n=this.materialCache.get(e);for(const r of n)r.usedTimes--,r.usedTimes===0&&this.shaderCache.delete(r.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const n=this.materialCache;let r=n.get(e);return r===void 0&&(r=new Set,n.set(e,r)),r}_getShaderStage(e){const n=this.shaderCache;let r=n.get(e);return r===void 0&&(r=new voe(e),n.set(e,r)),r}}class voe{constructor(e){this.id=moe++,this.code=e,this.usedTimes=0}}function yoe(t,e,n,r,i,o,a){const s=new qA,l=new goe,c=new Set,u=[],d=i.logarithmicDepthBuffer,f=i.vertexTextures;let p=i.precision;const y={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function v(M){return c.add(M),M===0?"uv":`uv${M}`}function g(M,C,P,R,D){const k=R.fog,U=D.geometry,O=M.isMeshStandardMaterial?R.environment:null,W=(M.isMeshStandardMaterial?n:e).get(M.envMap||O),L=W&&W.mapping===Lx?W.image.height:null,j=y[M.type];M.precision!==null&&(p=i.getMaxPrecision(M.precision),p!==M.precision&&console.warn("THREE.WebGLProgram.getParameters:",M.precision,"not supported, using",p,"instead."));const X=U.morphAttributes.position||U.morphAttributes.normal||U.morphAttributes.color,K=X!==void 0?X.length:0;let F=0;U.morphAttributes.position!==void 0&&(F=1),U.morphAttributes.normal!==void 0&&(F=2),U.morphAttributes.color!==void 0&&(F=3);let Y,q,Q,te;if(j){const pt=ta[j];Y=pt.vertexShader,q=pt.fragmentShader}else Y=M.vertexShader,q=M.fragmentShader,l.update(M),Q=l.getVertexShaderID(M),te=l.getFragmentShaderID(M);const ee=t.getRenderTarget(),ce=t.state.buffers.depth.getReversed(),ae=D.isInstancedMesh===!0,fe=D.isBatchedMesh===!0,we=!!M.map,le=!!M.matcap,ie=!!W,G=!!M.aoMap,Ve=!!M.lightMap,Ne=!!M.bumpMap,st=!!M.normalMap,Re=!!M.displacementMap,ct=!!M.emissiveMap,Ye=!!M.metalnessMap,it=!!M.roughnessMap,Ft=M.anisotropy>0,J=M.clearcoat>0,B=M.dispersion>0,ue=M.iridescence>0,me=M.sheen>0,be=M.transmission>0,ge=Ft&&!!M.anisotropyMap,rt=J&&!!M.clearcoatMap,Ie=J&&!!M.clearcoatNormalMap,Je=J&&!!M.clearcoatRoughnessMap,tt=ue&&!!M.iridescenceMap,Ee=ue&&!!M.iridescenceThicknessMap,Be=me&&!!M.sheenColorMap,ht=me&&!!M.sheenRoughnessMap,ot=!!M.specularMap,Le=!!M.specularColorMap,_t=!!M.specularIntensityMap,re=be&&!!M.transmissionMap,ke=be&&!!M.thicknessMap,Me=!!M.gradientMap,Ge=!!M.alphaMap,Te=M.alphaTest>0,_e=!!M.alphaHash,Se=!!M.extensions;let je=tl;M.toneMapped&&(ee===null||ee.isXRRenderTarget===!0)&&(je=t.toneMapping);const vt={shaderID:j,shaderType:M.type,shaderName:M.name,vertexShader:Y,fragmentShader:q,defines:M.defines,customVertexShaderID:Q,customFragmentShaderID:te,isRawShaderMaterial:M.isRawShaderMaterial===!0,glslVersion:M.glslVersion,precision:p,batching:fe,batchingColor:fe&&D._colorsTexture!==null,instancing:ae,instancingColor:ae&&D.instanceColor!==null,instancingMorph:ae&&D.morphTexture!==null,supportsVertexTextures:f,outputColorSpace:ee===null?t.outputColorSpace:ee.isXRRenderTarget===!0?ee.texture.colorSpace:Kr,alphaToCoverage:!!M.alphaToCoverage,map:we,matcap:le,envMap:ie,envMapMode:ie&&W.mapping,envMapCubeUVHeight:L,aoMap:G,lightMap:Ve,bumpMap:Ne,normalMap:st,displacementMap:f&&Re,emissiveMap:ct,normalMapObjectSpace:st&&M.normalMapType===SQ,normalMapTangentSpace:st&&M.normalMapType===kx,metalnessMap:Ye,roughnessMap:it,anisotropy:Ft,anisotropyMap:ge,clearcoat:J,clearcoatMap:rt,clearcoatNormalMap:Ie,clearcoatRoughnessMap:Je,dispersion:B,iridescence:ue,iridescenceMap:tt,iridescenceThicknessMap:Ee,sheen:me,sheenColorMap:Be,sheenRoughnessMap:ht,specularMap:ot,specularColorMap:Le,specularIntensityMap:_t,transmission:be,transmissionMap:re,thicknessMap:ke,gradientMap:Me,opaque:M.transparent===!1&&M.blending===sd&&M.alphaToCoverage===!1,alphaMap:Ge,alphaTest:Te,alphaHash:_e,combine:M.combine,mapUv:we&&v(M.map.channel),aoMapUv:G&&v(M.aoMap.channel),lightMapUv:Ve&&v(M.lightMap.channel),bumpMapUv:Ne&&v(M.bumpMap.channel),normalMapUv:st&&v(M.normalMap.channel),displacementMapUv:Re&&v(M.displacementMap.channel),emissiveMapUv:ct&&v(M.emissiveMap.channel),metalnessMapUv:Ye&&v(M.metalnessMap.channel),roughnessMapUv:it&&v(M.roughnessMap.channel),anisotropyMapUv:ge&&v(M.anisotropyMap.channel),clearcoatMapUv:rt&&v(M.clearcoatMap.channel),clearcoatNormalMapUv:Ie&&v(M.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Je&&v(M.clearcoatRoughnessMap.channel),iridescenceMapUv:tt&&v(M.iridescenceMap.channel),iridescenceThicknessMapUv:Ee&&v(M.iridescenceThicknessMap.channel),sheenColorMapUv:Be&&v(M.sheenColorMap.channel),sheenRoughnessMapUv:ht&&v(M.sheenRoughnessMap.channel),specularMapUv:ot&&v(M.specularMap.channel),specularColorMapUv:Le&&v(M.specularColorMap.channel),specularIntensityMapUv:_t&&v(M.specularIntensityMap.channel),transmissionMapUv:re&&v(M.transmissionMap.channel),thicknessMapUv:ke&&v(M.thicknessMap.channel),alphaMapUv:Ge&&v(M.alphaMap.channel),vertexTangents:!!U.attributes.tangent&&(st||Ft),vertexColors:M.vertexColors,vertexAlphas:M.vertexColors===!0&&!!U.attributes.color&&U.attributes.color.itemSize===4,pointsUvs:D.isPoints===!0&&!!U.attributes.uv&&(we||Ge),fog:!!k,useFog:M.fog===!0,fogExp2:!!k&&k.isFogExp2,flatShading:M.flatShading===!0,sizeAttenuation:M.sizeAttenuation===!0,logarithmicDepthBuffer:d,reverseDepthBuffer:ce,skinning:D.isSkinnedMesh===!0,morphTargets:U.morphAttributes.position!==void 0,morphNormals:U.morphAttributes.normal!==void 0,morphColors:U.morphAttributes.color!==void 0,morphTargetsCount:K,morphTextureStride:F,numDirLights:C.directional.length,numPointLights:C.point.length,numSpotLights:C.spot.length,numSpotLightMaps:C.spotLightMap.length,numRectAreaLights:C.rectArea.length,numHemiLights:C.hemi.length,numDirLightShadows:C.directionalShadowMap.length,numPointLightShadows:C.pointShadowMap.length,numSpotLightShadows:C.spotShadowMap.length,numSpotLightShadowsWithMaps:C.numSpotLightShadowsWithMaps,numLightProbes:C.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:M.dithering,shadowMapEnabled:t.shadowMap.enabled&&P.length>0,shadowMapType:t.shadowMap.type,toneMapping:je,decodeVideoTexture:we&&M.map.isVideoTexture===!0&&Dt.getTransfer(M.map.colorSpace)===an,decodeVideoTextureEmissive:ct&&M.emissiveMap.isVideoTexture===!0&&Dt.getTransfer(M.emissiveMap.colorSpace)===an,premultipliedAlpha:M.premultipliedAlpha,doubleSided:M.side===Ki,flipSided:M.side===ui,useDepthPacking:M.depthPacking>=0,depthPacking:M.depthPacking||0,index0AttributeName:M.index0AttributeName,extensionClipCullDistance:Se&&M.extensions.clipCullDistance===!0&&r.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Se&&M.extensions.multiDraw===!0||fe)&&r.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:r.has("KHR_parallel_shader_compile"),customProgramCacheKey:M.customProgramCacheKey()};return vt.vertexUv1s=c.has(1),vt.vertexUv2s=c.has(2),vt.vertexUv3s=c.has(3),c.clear(),vt}function m(M){const C=[];if(M.shaderID?C.push(M.shaderID):(C.push(M.customVertexShaderID),C.push(M.customFragmentShaderID)),M.defines!==void 0)for(const P in M.defines)C.push(P),C.push(M.defines[P]);return M.isRawShaderMaterial===!1&&(x(C,M),b(C,M),C.push(t.outputColorSpace)),C.push(M.customProgramCacheKey),C.join()}function x(M,C){M.push(C.precision),M.push(C.outputColorSpace),M.push(C.envMapMode),M.push(C.envMapCubeUVHeight),M.push(C.mapUv),M.push(C.alphaMapUv),M.push(C.lightMapUv),M.push(C.aoMapUv),M.push(C.bumpMapUv),M.push(C.normalMapUv),M.push(C.displacementMapUv),M.push(C.emissiveMapUv),M.push(C.metalnessMapUv),M.push(C.roughnessMapUv),M.push(C.anisotropyMapUv),M.push(C.clearcoatMapUv),M.push(C.clearcoatNormalMapUv),M.push(C.clearcoatRoughnessMapUv),M.push(C.iridescenceMapUv),M.push(C.iridescenceThicknessMapUv),M.push(C.sheenColorMapUv),M.push(C.sheenRoughnessMapUv),M.push(C.specularMapUv),M.push(C.specularColorMapUv),M.push(C.specularIntensityMapUv),M.push(C.transmissionMapUv),M.push(C.thicknessMapUv),M.push(C.combine),M.push(C.fogExp2),M.push(C.sizeAttenuation),M.push(C.morphTargetsCount),M.push(C.morphAttributeCount),M.push(C.numDirLights),M.push(C.numPointLights),M.push(C.numSpotLights),M.push(C.numSpotLightMaps),M.push(C.numHemiLights),M.push(C.numRectAreaLights),M.push(C.numDirLightShadows),M.push(C.numPointLightShadows),M.push(C.numSpotLightShadows),M.push(C.numSpotLightShadowsWithMaps),M.push(C.numLightProbes),M.push(C.shadowMapType),M.push(C.toneMapping),M.push(C.numClippingPlanes),M.push(C.numClipIntersection),M.push(C.depthPacking)}function b(M,C){s.disableAll(),C.supportsVertexTextures&&s.enable(0),C.instancing&&s.enable(1),C.instancingColor&&s.enable(2),C.instancingMorph&&s.enable(3),C.matcap&&s.enable(4),C.envMap&&s.enable(5),C.normalMapObjectSpace&&s.enable(6),C.normalMapTangentSpace&&s.enable(7),C.clearcoat&&s.enable(8),C.iridescence&&s.enable(9),C.alphaTest&&s.enable(10),C.vertexColors&&s.enable(11),C.vertexAlphas&&s.enable(12),C.vertexUv1s&&s.enable(13),C.vertexUv2s&&s.enable(14),C.vertexUv3s&&s.enable(15),C.vertexTangents&&s.enable(16),C.anisotropy&&s.enable(17),C.alphaHash&&s.enable(18),C.batching&&s.enable(19),C.dispersion&&s.enable(20),C.batchingColor&&s.enable(21),M.push(s.mask),s.disableAll(),C.fog&&s.enable(0),C.useFog&&s.enable(1),C.flatShading&&s.enable(2),C.logarithmicDepthBuffer&&s.enable(3),C.reverseDepthBuffer&&s.enable(4),C.skinning&&s.enable(5),C.morphTargets&&s.enable(6),C.morphNormals&&s.enable(7),C.morphColors&&s.enable(8),C.premultipliedAlpha&&s.enable(9),C.shadowMapEnabled&&s.enable(10),C.doubleSided&&s.enable(11),C.flipSided&&s.enable(12),C.useDepthPacking&&s.enable(13),C.dithering&&s.enable(14),C.transmission&&s.enable(15),C.sheen&&s.enable(16),C.opaque&&s.enable(17),C.pointsUvs&&s.enable(18),C.decodeVideoTexture&&s.enable(19),C.decodeVideoTextureEmissive&&s.enable(20),C.alphaToCoverage&&s.enable(21),M.push(s.mask)}function S(M){const C=y[M.type];let P;if(C){const R=ta[C];P=mee.clone(R.uniforms)}else P=M.uniforms;return P}function w(M,C){let P;for(let R=0,D=u.length;R0?r.push(m):p.transparent===!0?i.push(m):n.push(m)}function l(d,f,p,y,v,g){const m=a(d,f,p,y,v,g);p.transmission>0?r.unshift(m):p.transparent===!0?i.unshift(m):n.unshift(m)}function c(d,f){n.length>1&&n.sort(d||boe),r.length>1&&r.sort(f||KO),i.length>1&&i.sort(f||KO)}function u(){for(let d=e,f=t.length;d=o.length?(a=new YO,o.push(a)):a=o[i],a}function n(){t=new WeakMap}return{get:e,dispose:n}}function woe(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new ne,color:new ft};break;case"SpotLight":n={position:new ne,direction:new ne,color:new ft,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new ne,color:new ft,distance:0,decay:0};break;case"HemisphereLight":n={direction:new ne,skyColor:new ft,groundColor:new ft};break;case"RectAreaLight":n={color:new ft,position:new ne,halfWidth:new ne,halfHeight:new ne};break}return t[e.id]=n,n}}}function Soe(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new xt};break;case"SpotLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new xt};break;case"PointLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new xt,shadowCameraNear:1,shadowCameraFar:1e3};break}return t[e.id]=n,n}}}let Eoe=0;function Toe(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function Moe(t){const e=new woe,n=Soe(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)r.probe.push(new ne);const i=new ne,o=new gt,a=new gt;function s(c){let u=0,d=0,f=0;for(let M=0;M<9;M++)r.probe[M].set(0,0,0);let p=0,y=0,v=0,g=0,m=0,x=0,b=0,S=0,w=0,E=0,T=0;c.sort(Toe);for(let M=0,C=c.length;M0&&(t.has("OES_texture_float_linear")===!0?(r.rectAreaLTC1=Fe.LTC_FLOAT_1,r.rectAreaLTC2=Fe.LTC_FLOAT_2):(r.rectAreaLTC1=Fe.LTC_HALF_1,r.rectAreaLTC2=Fe.LTC_HALF_2)),r.ambient[0]=u,r.ambient[1]=d,r.ambient[2]=f;const A=r.hash;(A.directionalLength!==p||A.pointLength!==y||A.spotLength!==v||A.rectAreaLength!==g||A.hemiLength!==m||A.numDirectionalShadows!==x||A.numPointShadows!==b||A.numSpotShadows!==S||A.numSpotMaps!==w||A.numLightProbes!==T)&&(r.directional.length=p,r.spot.length=v,r.rectArea.length=g,r.point.length=y,r.hemi.length=m,r.directionalShadow.length=x,r.directionalShadowMap.length=x,r.pointShadow.length=b,r.pointShadowMap.length=b,r.spotShadow.length=S,r.spotShadowMap.length=S,r.directionalShadowMatrix.length=x,r.pointShadowMatrix.length=b,r.spotLightMatrix.length=S+w-E,r.spotLightMap.length=w,r.numSpotLightShadowsWithMaps=E,r.numLightProbes=T,A.directionalLength=p,A.pointLength=y,A.spotLength=v,A.rectAreaLength=g,A.hemiLength=m,A.numDirectionalShadows=x,A.numPointShadows=b,A.numSpotShadows=S,A.numSpotMaps=w,A.numLightProbes=T,r.version=Eoe++)}function l(c,u){let d=0,f=0,p=0,y=0,v=0;const g=u.matrixWorldInverse;for(let m=0,x=c.length;m=a.length?(s=new JO(t),a.push(s)):s=a[o],s}function r(){e=new WeakMap}return{get:n,dispose:r}}const Coe=`void main() { - gl_Position = vec4( position, 1.0 ); -}`,Poe=`uniform sampler2D shadow_pass; -uniform vec2 resolution; -uniform float radius; -#include -void main() { - const float samples = float( VSM_SAMPLES ); - float mean = 0.0; - float squared_mean = 0.0; - float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); - float uvStart = samples <= 1.0 ? 0.0 : - 1.0; - for ( float i = 0.0; i < samples; i ++ ) { - float uvOffset = uvStart + i * uvStride; - #ifdef HORIZONTAL_PASS - vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); - mean += distribution.x; - squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; - #else - float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); - mean += depth; - squared_mean += depth * depth; - #endif - } - mean = mean / samples; - squared_mean = squared_mean / samples; - float std_dev = sqrt( squared_mean - mean * mean ); - gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`;function Roe(t,e,n){let r=new ZA;const i=new xt,o=new xt,a=new Yt,s=new Nee({depthPacking:wQ}),l=new Oee,c={},u=n.maxTextureSize,d={[va]:ui,[ui]:va,[Ki]:Ki},f=new fl({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new xt},radius:{value:4}},vertexShader:Coe,fragmentShader:Poe}),p=f.clone();p.defines.HORIZONTAL_PASS=1;const y=new br;y.setAttribute("position",new cr(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const v=new Mn(y,f),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=v4;let m=this.type;this.render=function(E,T,A){if(g.enabled===!1||g.autoUpdate===!1&&g.needsUpdate===!1||E.length===0)return;const M=t.getRenderTarget(),C=t.getActiveCubeFace(),P=t.getActiveMipmapLevel(),R=t.state;R.setBlending(el),R.buffers.color.setClear(1,1,1,1),R.buffers.depth.setTest(!0),R.setScissorTest(!1);const D=m!==Da&&this.type===Da,k=m===Da&&this.type!==Da;for(let U=0,O=E.length;Uu||i.y>u)&&(i.x>u&&(o.x=Math.floor(u/j.x),i.x=o.x*j.x,L.mapSize.x=o.x),i.y>u&&(o.y=Math.floor(u/j.y),i.y=o.y*j.y,L.mapSize.y=o.y)),L.map===null||D===!0||k===!0){const K=this.type!==Da?{minFilter:Xr,magFilter:Xr}:{};L.map!==null&&L.map.dispose(),L.map=new Oc(i.x,i.y,K),L.map.texture.name=W.name+".shadowMap",L.camera.updateProjectionMatrix()}t.setRenderTarget(L.map),t.clear();const X=L.getViewportCount();for(let K=0;K0||T.map&&T.alphaTest>0||T.alphaToCoverage===!0){const R=C.uuid,D=T.uuid;let k=c[R];k===void 0&&(k={},c[R]=k);let U=k[D];U===void 0&&(U=C.clone(),k[D]=U,T.addEventListener("dispose",w)),C=U}if(C.visible=T.visible,C.wireframe=T.wireframe,M===Da?C.side=T.shadowSide!==null?T.shadowSide:T.side:C.side=T.shadowSide!==null?T.shadowSide:d[T.side],C.alphaMap=T.alphaMap,C.alphaTest=T.alphaToCoverage===!0?.5:T.alphaTest,C.map=T.map,C.clipShadows=T.clipShadows,C.clippingPlanes=T.clippingPlanes,C.clipIntersection=T.clipIntersection,C.displacementMap=T.displacementMap,C.displacementScale=T.displacementScale,C.displacementBias=T.displacementBias,C.wireframeLinewidth=T.wireframeLinewidth,C.linewidth=T.linewidth,A.isPointLight===!0&&C.isMeshDistanceMaterial===!0){const R=t.properties.get(C);R.light=A}return C}function S(E,T,A,M,C){if(E.visible===!1)return;if(E.layers.test(T.layers)&&(E.isMesh||E.isLine||E.isPoints)&&(E.castShadow||E.receiveShadow&&C===Da)&&(!E.frustumCulled||r.intersectsObject(E))){E.modelViewMatrix.multiplyMatrices(A.matrixWorldInverse,E.matrixWorld);const D=e.update(E),k=E.material;if(Array.isArray(k)){const U=D.groups;for(let O=0,W=U.length;O=1):L.indexOf("OpenGL ES")!==-1&&(W=parseFloat(/^OpenGL ES (\d)/.exec(L)[1]),O=W>=2);let j=null,X={};const K=t.getParameter(t.SCISSOR_BOX),F=t.getParameter(t.VIEWPORT),Y=new Yt().fromArray(K),q=new Yt().fromArray(F);function Q(re,ke,Me,Ge){const Te=new Uint8Array(4),_e=t.createTexture();t.bindTexture(re,_e),t.texParameteri(re,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(re,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let Se=0;Se"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new xt,u=new WeakMap;let d;const f=new WeakMap;let p=!1;try{p=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function y(J,B){return p?new OffscreenCanvas(J,B):Pp("canvas")}function v(J,B,ue){let me=1;const be=Ft(J);if((be.width>ue||be.height>ue)&&(me=ue/Math.max(be.width,be.height)),me<1)if(typeof HTMLImageElement<"u"&&J instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&J instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&J instanceof ImageBitmap||typeof VideoFrame<"u"&&J instanceof VideoFrame){const ge=Math.floor(me*be.width),rt=Math.floor(me*be.height);d===void 0&&(d=y(ge,rt));const Ie=B?y(ge,rt):d;return Ie.width=ge,Ie.height=rt,Ie.getContext("2d").drawImage(J,0,0,ge,rt),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+be.width+"x"+be.height+") to ("+ge+"x"+rt+")."),Ie}else return"data"in J&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+be.width+"x"+be.height+")."),J;return J}function g(J){return J.generateMipmaps}function m(J){t.generateMipmap(J)}function x(J){return J.isWebGLCubeRenderTarget?t.TEXTURE_CUBE_MAP:J.isWebGL3DRenderTarget?t.TEXTURE_3D:J.isWebGLArrayRenderTarget||J.isCompressedArrayTexture?t.TEXTURE_2D_ARRAY:t.TEXTURE_2D}function b(J,B,ue,me,be=!1){if(J!==null){if(t[J]!==void 0)return t[J];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+J+"'")}let ge=B;if(B===t.RED&&(ue===t.FLOAT&&(ge=t.R32F),ue===t.HALF_FLOAT&&(ge=t.R16F),ue===t.UNSIGNED_BYTE&&(ge=t.R8)),B===t.RED_INTEGER&&(ue===t.UNSIGNED_BYTE&&(ge=t.R8UI),ue===t.UNSIGNED_SHORT&&(ge=t.R16UI),ue===t.UNSIGNED_INT&&(ge=t.R32UI),ue===t.BYTE&&(ge=t.R8I),ue===t.SHORT&&(ge=t.R16I),ue===t.INT&&(ge=t.R32I)),B===t.RG&&(ue===t.FLOAT&&(ge=t.RG32F),ue===t.HALF_FLOAT&&(ge=t.RG16F),ue===t.UNSIGNED_BYTE&&(ge=t.RG8)),B===t.RG_INTEGER&&(ue===t.UNSIGNED_BYTE&&(ge=t.RG8UI),ue===t.UNSIGNED_SHORT&&(ge=t.RG16UI),ue===t.UNSIGNED_INT&&(ge=t.RG32UI),ue===t.BYTE&&(ge=t.RG8I),ue===t.SHORT&&(ge=t.RG16I),ue===t.INT&&(ge=t.RG32I)),B===t.RGB_INTEGER&&(ue===t.UNSIGNED_BYTE&&(ge=t.RGB8UI),ue===t.UNSIGNED_SHORT&&(ge=t.RGB16UI),ue===t.UNSIGNED_INT&&(ge=t.RGB32UI),ue===t.BYTE&&(ge=t.RGB8I),ue===t.SHORT&&(ge=t.RGB16I),ue===t.INT&&(ge=t.RGB32I)),B===t.RGBA_INTEGER&&(ue===t.UNSIGNED_BYTE&&(ge=t.RGBA8UI),ue===t.UNSIGNED_SHORT&&(ge=t.RGBA16UI),ue===t.UNSIGNED_INT&&(ge=t.RGBA32UI),ue===t.BYTE&&(ge=t.RGBA8I),ue===t.SHORT&&(ge=t.RGBA16I),ue===t.INT&&(ge=t.RGBA32I)),B===t.RGB&&ue===t.UNSIGNED_INT_5_9_9_9_REV&&(ge=t.RGB9_E5),B===t.RGBA){const rt=be?Cy:Dt.getTransfer(me);ue===t.FLOAT&&(ge=t.RGBA32F),ue===t.HALF_FLOAT&&(ge=t.RGBA16F),ue===t.UNSIGNED_BYTE&&(ge=rt===an?t.SRGB8_ALPHA8:t.RGBA8),ue===t.UNSIGNED_SHORT_4_4_4_4&&(ge=t.RGBA4),ue===t.UNSIGNED_SHORT_5_5_5_1&&(ge=t.RGB5_A1)}return(ge===t.R16F||ge===t.R32F||ge===t.RG16F||ge===t.RG32F||ge===t.RGBA16F||ge===t.RGBA32F)&&e.get("EXT_color_buffer_float"),ge}function S(J,B){let ue;return J?B===null||B===Nc||B===Ep?ue=t.DEPTH24_STENCIL8:B===Io?ue=t.DEPTH32F_STENCIL8:B===Sp&&(ue=t.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):B===null||B===Nc||B===Ep?ue=t.DEPTH_COMPONENT24:B===Io?ue=t.DEPTH_COMPONENT32F:B===Sp&&(ue=t.DEPTH_COMPONENT16),ue}function w(J,B){return g(J)===!0||J.isFramebufferTexture&&J.minFilter!==Xr&&J.minFilter!==Or?Math.log2(Math.max(B.width,B.height))+1:J.mipmaps!==void 0&&J.mipmaps.length>0?J.mipmaps.length:J.isCompressedTexture&&Array.isArray(J.image)?B.mipmaps.length:1}function E(J){const B=J.target;B.removeEventListener("dispose",E),A(B),B.isVideoTexture&&u.delete(B)}function T(J){const B=J.target;B.removeEventListener("dispose",T),C(B)}function A(J){const B=r.get(J);if(B.__webglInit===void 0)return;const ue=J.source,me=f.get(ue);if(me){const be=me[B.__cacheKey];be.usedTimes--,be.usedTimes===0&&M(J),Object.keys(me).length===0&&f.delete(ue)}r.remove(J)}function M(J){const B=r.get(J);t.deleteTexture(B.__webglTexture);const ue=J.source,me=f.get(ue);delete me[B.__cacheKey],a.memory.textures--}function C(J){const B=r.get(J);if(J.depthTexture&&(J.depthTexture.dispose(),r.remove(J.depthTexture)),J.isWebGLCubeRenderTarget)for(let me=0;me<6;me++){if(Array.isArray(B.__webglFramebuffer[me]))for(let be=0;be=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+J+" texture units while this GPU supports only "+i.maxTextures),P+=1,J}function k(J){const B=[];return B.push(J.wrapS),B.push(J.wrapT),B.push(J.wrapR||0),B.push(J.magFilter),B.push(J.minFilter),B.push(J.anisotropy),B.push(J.internalFormat),B.push(J.format),B.push(J.type),B.push(J.generateMipmaps),B.push(J.premultiplyAlpha),B.push(J.flipY),B.push(J.unpackAlignment),B.push(J.colorSpace),B.join()}function U(J,B){const ue=r.get(J);if(J.isVideoTexture&&Ye(J),J.isRenderTargetTexture===!1&&J.version>0&&ue.__version!==J.version){const me=J.image;if(me===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(me.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{te(ue,J,B);return}}n.bindTexture(t.TEXTURE_2D,ue.__webglTexture,t.TEXTURE0+B)}function O(J,B){const ue=r.get(J);if(J.version>0&&ue.__version!==J.version){te(ue,J,B);return}n.bindTexture(t.TEXTURE_2D_ARRAY,ue.__webglTexture,t.TEXTURE0+B)}function W(J,B){const ue=r.get(J);if(J.version>0&&ue.__version!==J.version){te(ue,J,B);return}n.bindTexture(t.TEXTURE_3D,ue.__webglTexture,t.TEXTURE0+B)}function L(J,B){const ue=r.get(J);if(J.version>0&&ue.__version!==J.version){ee(ue,J,B);return}n.bindTexture(t.TEXTURE_CUBE_MAP,ue.__webglTexture,t.TEXTURE0+B)}const j={[aa]:t.REPEAT,[Ji]:t.CLAMP_TO_EDGE,[Ay]:t.MIRRORED_REPEAT},X={[Xr]:t.NEAREST,[b4]:t.NEAREST_MIPMAP_NEAREST,[Ch]:t.NEAREST_MIPMAP_LINEAR,[Or]:t.LINEAR,[Fv]:t.LINEAR_MIPMAP_NEAREST,[Oo]:t.LINEAR_MIPMAP_LINEAR},K={[EQ]:t.NEVER,[RQ]:t.ALWAYS,[TQ]:t.LESS,[P4]:t.LEQUAL,[MQ]:t.EQUAL,[PQ]:t.GEQUAL,[AQ]:t.GREATER,[CQ]:t.NOTEQUAL};function F(J,B){if(B.type===Io&&e.has("OES_texture_float_linear")===!1&&(B.magFilter===Or||B.magFilter===Fv||B.magFilter===Ch||B.magFilter===Oo||B.minFilter===Or||B.minFilter===Fv||B.minFilter===Ch||B.minFilter===Oo)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),t.texParameteri(J,t.TEXTURE_WRAP_S,j[B.wrapS]),t.texParameteri(J,t.TEXTURE_WRAP_T,j[B.wrapT]),(J===t.TEXTURE_3D||J===t.TEXTURE_2D_ARRAY)&&t.texParameteri(J,t.TEXTURE_WRAP_R,j[B.wrapR]),t.texParameteri(J,t.TEXTURE_MAG_FILTER,X[B.magFilter]),t.texParameteri(J,t.TEXTURE_MIN_FILTER,X[B.minFilter]),B.compareFunction&&(t.texParameteri(J,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(J,t.TEXTURE_COMPARE_FUNC,K[B.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(B.magFilter===Xr||B.minFilter!==Ch&&B.minFilter!==Oo||B.type===Io&&e.has("OES_texture_float_linear")===!1)return;if(B.anisotropy>1||r.get(B).__currentAnisotropy){const ue=e.get("EXT_texture_filter_anisotropic");t.texParameterf(J,ue.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(B.anisotropy,i.getMaxAnisotropy())),r.get(B).__currentAnisotropy=B.anisotropy}}}function Y(J,B){let ue=!1;J.__webglInit===void 0&&(J.__webglInit=!0,B.addEventListener("dispose",E));const me=B.source;let be=f.get(me);be===void 0&&(be={},f.set(me,be));const ge=k(B);if(ge!==J.__cacheKey){be[ge]===void 0&&(be[ge]={texture:t.createTexture(),usedTimes:0},a.memory.textures++,ue=!0),be[ge].usedTimes++;const rt=be[J.__cacheKey];rt!==void 0&&(be[J.__cacheKey].usedTimes--,rt.usedTimes===0&&M(B)),J.__cacheKey=ge,J.__webglTexture=be[ge].texture}return ue}function q(J,B,ue){return Math.floor(Math.floor(J/ue)/B)}function Q(J,B,ue,me){const ge=J.updateRanges;if(ge.length===0)n.texSubImage2D(t.TEXTURE_2D,0,0,0,B.width,B.height,ue,me,B.data);else{ge.sort((Ee,Be)=>Ee.start-Be.start);let rt=0;for(let Ee=1;Ee0){re&&ke&&n.texStorage2D(t.TEXTURE_2D,Ge,ot,_t[0].width,_t[0].height);for(let Te=0,_e=_t.length;Te<_e;Te++)Le=_t[Te],re?Me&&n.texSubImage2D(t.TEXTURE_2D,Te,0,0,Le.width,Le.height,Be,ht,Le.data):n.texImage2D(t.TEXTURE_2D,Te,ot,Le.width,Le.height,0,Be,ht,Le.data);B.generateMipmaps=!1}else re?(ke&&n.texStorage2D(t.TEXTURE_2D,Ge,ot,Ee.width,Ee.height),Me&&Q(B,Ee,Be,ht)):n.texImage2D(t.TEXTURE_2D,0,ot,Ee.width,Ee.height,0,Be,ht,Ee.data);else if(B.isCompressedTexture)if(B.isCompressedArrayTexture){re&&ke&&n.texStorage3D(t.TEXTURE_2D_ARRAY,Ge,ot,_t[0].width,_t[0].height,Ee.depth);for(let Te=0,_e=_t.length;Te<_e;Te++)if(Le=_t[Te],B.format!==Zi)if(Be!==null)if(re){if(Me)if(B.layerUpdates.size>0){const Se=AO(Le.width,Le.height,B.format,B.type);for(const je of B.layerUpdates){const vt=Le.data.subarray(je*Se/Le.data.BYTES_PER_ELEMENT,(je+1)*Se/Le.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,Te,0,0,je,Le.width,Le.height,1,Be,vt)}B.clearLayerUpdates()}else n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,Te,0,0,0,Le.width,Le.height,Ee.depth,Be,Le.data)}else n.compressedTexImage3D(t.TEXTURE_2D_ARRAY,Te,ot,Le.width,Le.height,Ee.depth,0,Le.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else re?Me&&n.texSubImage3D(t.TEXTURE_2D_ARRAY,Te,0,0,0,Le.width,Le.height,Ee.depth,Be,ht,Le.data):n.texImage3D(t.TEXTURE_2D_ARRAY,Te,ot,Le.width,Le.height,Ee.depth,0,Be,ht,Le.data)}else{re&&ke&&n.texStorage2D(t.TEXTURE_2D,Ge,ot,_t[0].width,_t[0].height);for(let Te=0,_e=_t.length;Te<_e;Te++)Le=_t[Te],B.format!==Zi?Be!==null?re?Me&&n.compressedTexSubImage2D(t.TEXTURE_2D,Te,0,0,Le.width,Le.height,Be,Le.data):n.compressedTexImage2D(t.TEXTURE_2D,Te,ot,Le.width,Le.height,0,Le.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):re?Me&&n.texSubImage2D(t.TEXTURE_2D,Te,0,0,Le.width,Le.height,Be,ht,Le.data):n.texImage2D(t.TEXTURE_2D,Te,ot,Le.width,Le.height,0,Be,ht,Le.data)}else if(B.isDataArrayTexture)if(re){if(ke&&n.texStorage3D(t.TEXTURE_2D_ARRAY,Ge,ot,Ee.width,Ee.height,Ee.depth),Me)if(B.layerUpdates.size>0){const Te=AO(Ee.width,Ee.height,B.format,B.type);for(const _e of B.layerUpdates){const Se=Ee.data.subarray(_e*Te/Ee.data.BYTES_PER_ELEMENT,(_e+1)*Te/Ee.data.BYTES_PER_ELEMENT);n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,_e,Ee.width,Ee.height,1,Be,ht,Se)}B.clearLayerUpdates()}else n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,0,Ee.width,Ee.height,Ee.depth,Be,ht,Ee.data)}else n.texImage3D(t.TEXTURE_2D_ARRAY,0,ot,Ee.width,Ee.height,Ee.depth,0,Be,ht,Ee.data);else if(B.isData3DTexture)re?(ke&&n.texStorage3D(t.TEXTURE_3D,Ge,ot,Ee.width,Ee.height,Ee.depth),Me&&n.texSubImage3D(t.TEXTURE_3D,0,0,0,0,Ee.width,Ee.height,Ee.depth,Be,ht,Ee.data)):n.texImage3D(t.TEXTURE_3D,0,ot,Ee.width,Ee.height,Ee.depth,0,Be,ht,Ee.data);else if(B.isFramebufferTexture){if(ke)if(re)n.texStorage2D(t.TEXTURE_2D,Ge,ot,Ee.width,Ee.height);else{let Te=Ee.width,_e=Ee.height;for(let Se=0;Se>=1,_e>>=1}}else if(_t.length>0){if(re&&ke){const Te=Ft(_t[0]);n.texStorage2D(t.TEXTURE_2D,Ge,ot,Te.width,Te.height)}for(let Te=0,_e=_t.length;Te<_e;Te++)Le=_t[Te],re?Me&&n.texSubImage2D(t.TEXTURE_2D,Te,0,0,Be,ht,Le):n.texImage2D(t.TEXTURE_2D,Te,ot,Be,ht,Le);B.generateMipmaps=!1}else if(re){if(ke){const Te=Ft(Ee);n.texStorage2D(t.TEXTURE_2D,Ge,ot,Te.width,Te.height)}Me&&n.texSubImage2D(t.TEXTURE_2D,0,0,0,Be,ht,Ee)}else n.texImage2D(t.TEXTURE_2D,0,ot,Be,ht,Ee);g(B)&&m(me),rt.__version=ge.version,B.onUpdate&&B.onUpdate(B)}J.__version=B.version}function ee(J,B,ue){if(B.image.length!==6)return;const me=Y(J,B),be=B.source;n.bindTexture(t.TEXTURE_CUBE_MAP,J.__webglTexture,t.TEXTURE0+ue);const ge=r.get(be);if(be.version!==ge.__version||me===!0){n.activeTexture(t.TEXTURE0+ue);const rt=Dt.getPrimaries(Dt.workingColorSpace),Ie=B.colorSpace===Ns?null:Dt.getPrimaries(B.colorSpace),Je=B.colorSpace===Ns||rt===Ie?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,B.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,B.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,B.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,Je);const tt=B.isCompressedTexture||B.image[0].isCompressedTexture,Ee=B.image[0]&&B.image[0].isDataTexture,Be=[];for(let _e=0;_e<6;_e++)!tt&&!Ee?Be[_e]=v(B.image[_e],!0,i.maxCubemapSize):Be[_e]=Ee?B.image[_e].image:B.image[_e],Be[_e]=it(B,Be[_e]);const ht=Be[0],ot=o.convert(B.format,B.colorSpace),Le=o.convert(B.type),_t=b(B.internalFormat,ot,Le,B.colorSpace),re=B.isVideoTexture!==!0,ke=ge.__version===void 0||me===!0,Me=be.dataReady;let Ge=w(B,ht);F(t.TEXTURE_CUBE_MAP,B);let Te;if(tt){re&&ke&&n.texStorage2D(t.TEXTURE_CUBE_MAP,Ge,_t,ht.width,ht.height);for(let _e=0;_e<6;_e++){Te=Be[_e].mipmaps;for(let Se=0;Se0&&Ge++;const _e=Ft(Be[0]);n.texStorage2D(t.TEXTURE_CUBE_MAP,Ge,_t,_e.width,_e.height)}for(let _e=0;_e<6;_e++)if(Ee){re?Me&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+_e,0,0,0,Be[_e].width,Be[_e].height,ot,Le,Be[_e].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+_e,0,_t,Be[_e].width,Be[_e].height,0,ot,Le,Be[_e].data);for(let Se=0;Se>ge),ht=Math.max(1,B.height>>ge);be===t.TEXTURE_3D||be===t.TEXTURE_2D_ARRAY?n.texImage3D(be,ge,Je,Be,ht,B.depth,0,rt,Ie,null):n.texImage2D(be,ge,Je,Be,ht,0,rt,Ie,null)}n.bindFramebuffer(t.FRAMEBUFFER,J),ct(B)?s.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,me,be,Ee.__webglTexture,0,Re(B)):(be===t.TEXTURE_2D||be>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&be<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,me,be,Ee.__webglTexture,ge),n.bindFramebuffer(t.FRAMEBUFFER,null)}function ae(J,B,ue){if(t.bindRenderbuffer(t.RENDERBUFFER,J),B.depthBuffer){const me=B.depthTexture,be=me&&me.isDepthTexture?me.type:null,ge=S(B.stencilBuffer,be),rt=B.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,Ie=Re(B);ct(B)?s.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,Ie,ge,B.width,B.height):ue?t.renderbufferStorageMultisample(t.RENDERBUFFER,Ie,ge,B.width,B.height):t.renderbufferStorage(t.RENDERBUFFER,ge,B.width,B.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,rt,t.RENDERBUFFER,J)}else{const me=B.textures;for(let be=0;be{delete B.__boundDepthTexture,delete B.__depthDisposeCallback,me.removeEventListener("dispose",be)};me.addEventListener("dispose",be),B.__depthDisposeCallback=be}B.__boundDepthTexture=me}if(J.depthTexture&&!B.__autoAllocateDepthBuffer){if(ue)throw new Error("target.depthTexture not supported in Cube render targets");const me=J.texture.mipmaps;me&&me.length>0?fe(B.__webglFramebuffer[0],J):fe(B.__webglFramebuffer,J)}else if(ue){B.__webglDepthbuffer=[];for(let me=0;me<6;me++)if(n.bindFramebuffer(t.FRAMEBUFFER,B.__webglFramebuffer[me]),B.__webglDepthbuffer[me]===void 0)B.__webglDepthbuffer[me]=t.createRenderbuffer(),ae(B.__webglDepthbuffer[me],J,!1);else{const be=J.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,ge=B.__webglDepthbuffer[me];t.bindRenderbuffer(t.RENDERBUFFER,ge),t.framebufferRenderbuffer(t.FRAMEBUFFER,be,t.RENDERBUFFER,ge)}}else{const me=J.texture.mipmaps;if(me&&me.length>0?n.bindFramebuffer(t.FRAMEBUFFER,B.__webglFramebuffer[0]):n.bindFramebuffer(t.FRAMEBUFFER,B.__webglFramebuffer),B.__webglDepthbuffer===void 0)B.__webglDepthbuffer=t.createRenderbuffer(),ae(B.__webglDepthbuffer,J,!1);else{const be=J.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,ge=B.__webglDepthbuffer;t.bindRenderbuffer(t.RENDERBUFFER,ge),t.framebufferRenderbuffer(t.FRAMEBUFFER,be,t.RENDERBUFFER,ge)}}n.bindFramebuffer(t.FRAMEBUFFER,null)}function le(J,B,ue){const me=r.get(J);B!==void 0&&ce(me.__webglFramebuffer,J,J.texture,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,0),ue!==void 0&&we(J)}function ie(J){const B=J.texture,ue=r.get(J),me=r.get(B);J.addEventListener("dispose",T);const be=J.textures,ge=J.isWebGLCubeRenderTarget===!0,rt=be.length>1;if(rt||(me.__webglTexture===void 0&&(me.__webglTexture=t.createTexture()),me.__version=B.version,a.memory.textures++),ge){ue.__webglFramebuffer=[];for(let Ie=0;Ie<6;Ie++)if(B.mipmaps&&B.mipmaps.length>0){ue.__webglFramebuffer[Ie]=[];for(let Je=0;Je0){ue.__webglFramebuffer=[];for(let Ie=0;Ie0&&ct(J)===!1){ue.__webglMultisampledFramebuffer=t.createFramebuffer(),ue.__webglColorRenderbuffer=[],n.bindFramebuffer(t.FRAMEBUFFER,ue.__webglMultisampledFramebuffer);for(let Ie=0;Ie0)for(let Je=0;Je0)for(let Je=0;Je0){if(ct(J)===!1){const B=J.textures,ue=J.width,me=J.height;let be=t.COLOR_BUFFER_BIT;const ge=J.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,rt=r.get(J),Ie=B.length>1;if(Ie)for(let tt=0;tt0?n.bindFramebuffer(t.DRAW_FRAMEBUFFER,rt.__webglFramebuffer[0]):n.bindFramebuffer(t.DRAW_FRAMEBUFFER,rt.__webglFramebuffer);for(let tt=0;tt0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&B.__useRenderToTexture!==!1}function Ye(J){const B=a.render.frame;u.get(J)!==B&&(u.set(J,B),J.update())}function it(J,B){const ue=J.colorSpace,me=J.format,be=J.type;return J.isCompressedTexture===!0||J.isVideoTexture===!0||ue!==Kr&&ue!==Ns&&(Dt.getTransfer(ue)===an?(me!==Zi||be!==ya)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",ue)),B}function Ft(J){return typeof HTMLImageElement<"u"&&J instanceof HTMLImageElement?(c.width=J.naturalWidth||J.width,c.height=J.naturalHeight||J.height):typeof VideoFrame<"u"&&J instanceof VideoFrame?(c.width=J.displayWidth,c.height=J.displayHeight):(c.width=J.width,c.height=J.height),c}this.allocateTextureUnit=D,this.resetTextureUnits=R,this.setTexture2D=U,this.setTexture2DArray=O,this.setTexture3D=W,this.setTextureCube=L,this.rebindTextures=le,this.setupRenderTarget=ie,this.updateRenderTargetMipmap=G,this.updateMultisampleRenderTarget=st,this.setupDepthRenderbuffer=we,this.setupFrameBufferTexture=ce,this.useMultisampledRTT=ct}function Doe(t,e){function n(r,i=Ns){let o;const a=Dt.getTransfer(i);if(r===ya)return t.UNSIGNED_BYTE;if(r===BA)return t.UNSIGNED_SHORT_4_4_4_4;if(r===$A)return t.UNSIGNED_SHORT_5_5_5_1;if(r===S4)return t.UNSIGNED_INT_5_9_9_9_REV;if(r===_4)return t.BYTE;if(r===w4)return t.SHORT;if(r===Sp)return t.UNSIGNED_SHORT;if(r===FA)return t.INT;if(r===Nc)return t.UNSIGNED_INT;if(r===Io)return t.FLOAT;if(r===Nm)return t.HALF_FLOAT;if(r===E4)return t.ALPHA;if(r===T4)return t.RGB;if(r===Zi)return t.RGBA;if(r===Tp)return t.DEPTH_COMPONENT;if(r===Mp)return t.DEPTH_STENCIL;if(r===zA)return t.RED;if(r===HA)return t.RED_INTEGER;if(r===M4)return t.RG;if(r===VA)return t.RG_INTEGER;if(r===GA)return t.RGBA_INTEGER;if(r===Bv||r===$v||r===zv||r===Hv)if(a===an)if(o=e.get("WEBGL_compressed_texture_s3tc_srgb"),o!==null){if(r===Bv)return o.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(r===$v)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(r===zv)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(r===Hv)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(o=e.get("WEBGL_compressed_texture_s3tc"),o!==null){if(r===Bv)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(r===$v)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(r===zv)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(r===Hv)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(r===FE||r===BE||r===$E||r===zE)if(o=e.get("WEBGL_compressed_texture_pvrtc"),o!==null){if(r===FE)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(r===BE)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(r===$E)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(r===zE)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(r===HE||r===VE||r===GE)if(o=e.get("WEBGL_compressed_texture_etc"),o!==null){if(r===HE||r===VE)return a===an?o.COMPRESSED_SRGB8_ETC2:o.COMPRESSED_RGB8_ETC2;if(r===GE)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:o.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(r===WE||r===XE||r===qE||r===KE||r===YE||r===JE||r===ZE||r===QE||r===e1||r===t1||r===n1||r===r1||r===i1||r===o1)if(o=e.get("WEBGL_compressed_texture_astc"),o!==null){if(r===WE)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:o.COMPRESSED_RGBA_ASTC_4x4_KHR;if(r===XE)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:o.COMPRESSED_RGBA_ASTC_5x4_KHR;if(r===qE)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:o.COMPRESSED_RGBA_ASTC_5x5_KHR;if(r===KE)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:o.COMPRESSED_RGBA_ASTC_6x5_KHR;if(r===YE)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:o.COMPRESSED_RGBA_ASTC_6x6_KHR;if(r===JE)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:o.COMPRESSED_RGBA_ASTC_8x5_KHR;if(r===ZE)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:o.COMPRESSED_RGBA_ASTC_8x6_KHR;if(r===QE)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:o.COMPRESSED_RGBA_ASTC_8x8_KHR;if(r===e1)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:o.COMPRESSED_RGBA_ASTC_10x5_KHR;if(r===t1)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:o.COMPRESSED_RGBA_ASTC_10x6_KHR;if(r===n1)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:o.COMPRESSED_RGBA_ASTC_10x8_KHR;if(r===r1)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:o.COMPRESSED_RGBA_ASTC_10x10_KHR;if(r===i1)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:o.COMPRESSED_RGBA_ASTC_12x10_KHR;if(r===o1)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:o.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(r===Vv||r===a1||r===s1)if(o=e.get("EXT_texture_compression_bptc"),o!==null){if(r===Vv)return a===an?o.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:o.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(r===a1)return o.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(r===s1)return o.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(r===A4||r===l1||r===c1||r===u1)if(o=e.get("EXT_texture_compression_rgtc"),o!==null){if(r===Vv)return o.COMPRESSED_RED_RGTC1_EXT;if(r===l1)return o.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(r===c1)return o.COMPRESSED_RED_GREEN_RGTC2_EXT;if(r===u1)return o.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return r===Ep?t.UNSIGNED_INT_24_8:t[r]!==void 0?t[r]:null}return{convert:n}}const Loe=` -void main() { - - gl_Position = vec4( position, 1.0 ); - -}`,koe=` -uniform sampler2DArray depthColor; -uniform float depthWidth; -uniform float depthHeight; - -void main() { - - vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); - - if ( coord.x >= 1.0 ) { - - gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; - - } else { - - gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; - - } - -}`;class joe{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,n,r){if(this.texture===null){const i=new lr,o=e.properties.get(i);o.__webglTexture=n.texture,(n.depthNear!==r.depthNear||n.depthFar!==r.depthFar)&&(this.depthNear=n.depthNear,this.depthFar=n.depthFar),this.texture=i}}getMesh(e){if(this.texture!==null&&this.mesh===null){const n=e.cameras[0].viewport,r=new fl({vertexShader:Loe,fragmentShader:koe,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new Mn(new Om(20,20),r)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class Uoe extends Vc{constructor(e,n){super();const r=this;let i=null,o=1,a=null,s="local-floor",l=1,c=null,u=null,d=null,f=null,p=null,y=null;const v=new joe,g=n.getContextAttributes();let m=null,x=null;const b=[],S=[],w=new xt;let E=null;const T=new gr;T.viewport=new Yt;const A=new gr;A.viewport=new Yt;const M=[T,A],C=new Kee;let P=null,R=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(q){let Q=b[q];return Q===void 0&&(Q=new uw,b[q]=Q),Q.getTargetRaySpace()},this.getControllerGrip=function(q){let Q=b[q];return Q===void 0&&(Q=new uw,b[q]=Q),Q.getGripSpace()},this.getHand=function(q){let Q=b[q];return Q===void 0&&(Q=new uw,b[q]=Q),Q.getHandSpace()};function D(q){const Q=S.indexOf(q.inputSource);if(Q===-1)return;const te=b[Q];te!==void 0&&(te.update(q.inputSource,q.frame,c||a),te.dispatchEvent({type:q.type,data:q.inputSource}))}function k(){i.removeEventListener("select",D),i.removeEventListener("selectstart",D),i.removeEventListener("selectend",D),i.removeEventListener("squeeze",D),i.removeEventListener("squeezestart",D),i.removeEventListener("squeezeend",D),i.removeEventListener("end",k),i.removeEventListener("inputsourceschange",U);for(let q=0;q=0&&(S[ee]=null,b[ee].disconnect(te))}for(let Q=0;Q=S.length){S.push(te),ee=ae;break}else if(S[ae]===null){S[ae]=te,ee=ae;break}if(ee===-1)break}const ce=b[ee];ce&&ce.connect(te)}}const O=new ne,W=new ne;function L(q,Q,te){O.setFromMatrixPosition(Q.matrixWorld),W.setFromMatrixPosition(te.matrixWorld);const ee=O.distanceTo(W),ce=Q.projectionMatrix.elements,ae=te.projectionMatrix.elements,fe=ce[14]/(ce[10]-1),we=ce[14]/(ce[10]+1),le=(ce[9]+1)/ce[5],ie=(ce[9]-1)/ce[5],G=(ce[8]-1)/ce[0],Ve=(ae[8]+1)/ae[0],Ne=fe*G,st=fe*Ve,Re=ee/(-G+Ve),ct=Re*-G;if(Q.matrixWorld.decompose(q.position,q.quaternion,q.scale),q.translateX(ct),q.translateZ(Re),q.matrixWorld.compose(q.position,q.quaternion,q.scale),q.matrixWorldInverse.copy(q.matrixWorld).invert(),ce[10]===-1)q.projectionMatrix.copy(Q.projectionMatrix),q.projectionMatrixInverse.copy(Q.projectionMatrixInverse);else{const Ye=fe+Re,it=we+Re,Ft=Ne-ct,J=st+(ee-ct),B=le*we/it*Ye,ue=ie*we/it*Ye;q.projectionMatrix.makePerspective(Ft,J,B,ue,Ye,it),q.projectionMatrixInverse.copy(q.projectionMatrix).invert()}}function j(q,Q){Q===null?q.matrixWorld.copy(q.matrix):q.matrixWorld.multiplyMatrices(Q.matrixWorld,q.matrix),q.matrixWorldInverse.copy(q.matrixWorld).invert()}this.updateCamera=function(q){if(i===null)return;let Q=q.near,te=q.far;v.texture!==null&&(v.depthNear>0&&(Q=v.depthNear),v.depthFar>0&&(te=v.depthFar)),C.near=A.near=T.near=Q,C.far=A.far=T.far=te,(P!==C.near||R!==C.far)&&(i.updateRenderState({depthNear:C.near,depthFar:C.far}),P=C.near,R=C.far),T.layers.mask=q.layers.mask|2,A.layers.mask=q.layers.mask|4,C.layers.mask=T.layers.mask|A.layers.mask;const ee=q.parent,ce=C.cameras;j(C,ee);for(let ae=0;ae0&&(g.alphaTest.value=m.alphaTest);const x=e.get(m),b=x.envMap,S=x.envMapRotation;b&&(g.envMap.value=b,jl.copy(S),jl.x*=-1,jl.y*=-1,jl.z*=-1,b.isCubeTexture&&b.isRenderTargetTexture===!1&&(jl.y*=-1,jl.z*=-1),g.envMapRotation.value.setFromMatrix4(Foe.makeRotationFromEuler(jl)),g.flipEnvMap.value=b.isCubeTexture&&b.isRenderTargetTexture===!1?-1:1,g.reflectivity.value=m.reflectivity,g.ior.value=m.ior,g.refractionRatio.value=m.refractionRatio),m.lightMap&&(g.lightMap.value=m.lightMap,g.lightMapIntensity.value=m.lightMapIntensity,n(m.lightMap,g.lightMapTransform)),m.aoMap&&(g.aoMap.value=m.aoMap,g.aoMapIntensity.value=m.aoMapIntensity,n(m.aoMap,g.aoMapTransform))}function a(g,m){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,m.map&&(g.map.value=m.map,n(m.map,g.mapTransform))}function s(g,m){g.dashSize.value=m.dashSize,g.totalSize.value=m.dashSize+m.gapSize,g.scale.value=m.scale}function l(g,m,x,b){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,g.size.value=m.size*x,g.scale.value=b*.5,m.map&&(g.map.value=m.map,n(m.map,g.uvTransform)),m.alphaMap&&(g.alphaMap.value=m.alphaMap,n(m.alphaMap,g.alphaMapTransform)),m.alphaTest>0&&(g.alphaTest.value=m.alphaTest)}function c(g,m){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,g.rotation.value=m.rotation,m.map&&(g.map.value=m.map,n(m.map,g.mapTransform)),m.alphaMap&&(g.alphaMap.value=m.alphaMap,n(m.alphaMap,g.alphaMapTransform)),m.alphaTest>0&&(g.alphaTest.value=m.alphaTest)}function u(g,m){g.specular.value.copy(m.specular),g.shininess.value=Math.max(m.shininess,1e-4)}function d(g,m){m.gradientMap&&(g.gradientMap.value=m.gradientMap)}function f(g,m){g.metalness.value=m.metalness,m.metalnessMap&&(g.metalnessMap.value=m.metalnessMap,n(m.metalnessMap,g.metalnessMapTransform)),g.roughness.value=m.roughness,m.roughnessMap&&(g.roughnessMap.value=m.roughnessMap,n(m.roughnessMap,g.roughnessMapTransform)),m.envMap&&(g.envMapIntensity.value=m.envMapIntensity)}function p(g,m,x){g.ior.value=m.ior,m.sheen>0&&(g.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),g.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(g.sheenColorMap.value=m.sheenColorMap,n(m.sheenColorMap,g.sheenColorMapTransform)),m.sheenRoughnessMap&&(g.sheenRoughnessMap.value=m.sheenRoughnessMap,n(m.sheenRoughnessMap,g.sheenRoughnessMapTransform))),m.clearcoat>0&&(g.clearcoat.value=m.clearcoat,g.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(g.clearcoatMap.value=m.clearcoatMap,n(m.clearcoatMap,g.clearcoatMapTransform)),m.clearcoatRoughnessMap&&(g.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap,n(m.clearcoatRoughnessMap,g.clearcoatRoughnessMapTransform)),m.clearcoatNormalMap&&(g.clearcoatNormalMap.value=m.clearcoatNormalMap,n(m.clearcoatNormalMap,g.clearcoatNormalMapTransform),g.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),m.side===ui&&g.clearcoatNormalScale.value.negate())),m.dispersion>0&&(g.dispersion.value=m.dispersion),m.iridescence>0&&(g.iridescence.value=m.iridescence,g.iridescenceIOR.value=m.iridescenceIOR,g.iridescenceThicknessMinimum.value=m.iridescenceThicknessRange[0],g.iridescenceThicknessMaximum.value=m.iridescenceThicknessRange[1],m.iridescenceMap&&(g.iridescenceMap.value=m.iridescenceMap,n(m.iridescenceMap,g.iridescenceMapTransform)),m.iridescenceThicknessMap&&(g.iridescenceThicknessMap.value=m.iridescenceThicknessMap,n(m.iridescenceThicknessMap,g.iridescenceThicknessMapTransform))),m.transmission>0&&(g.transmission.value=m.transmission,g.transmissionSamplerMap.value=x.texture,g.transmissionSamplerSize.value.set(x.width,x.height),m.transmissionMap&&(g.transmissionMap.value=m.transmissionMap,n(m.transmissionMap,g.transmissionMapTransform)),g.thickness.value=m.thickness,m.thicknessMap&&(g.thicknessMap.value=m.thicknessMap,n(m.thicknessMap,g.thicknessMapTransform)),g.attenuationDistance.value=m.attenuationDistance,g.attenuationColor.value.copy(m.attenuationColor)),m.anisotropy>0&&(g.anisotropyVector.value.set(m.anisotropy*Math.cos(m.anisotropyRotation),m.anisotropy*Math.sin(m.anisotropyRotation)),m.anisotropyMap&&(g.anisotropyMap.value=m.anisotropyMap,n(m.anisotropyMap,g.anisotropyMapTransform))),g.specularIntensity.value=m.specularIntensity,g.specularColor.value.copy(m.specularColor),m.specularColorMap&&(g.specularColorMap.value=m.specularColorMap,n(m.specularColorMap,g.specularColorMapTransform)),m.specularIntensityMap&&(g.specularIntensityMap.value=m.specularIntensityMap,n(m.specularIntensityMap,g.specularIntensityMapTransform))}function y(g,m){m.matcap&&(g.matcap.value=m.matcap)}function v(g,m){const x=e.get(m).light;g.referencePosition.value.setFromMatrixPosition(x.matrixWorld),g.nearDistance.value=x.shadow.camera.near,g.farDistance.value=x.shadow.camera.far}return{refreshFogUniforms:r,refreshMaterialUniforms:i}}function $oe(t,e,n,r){let i={},o={},a=[];const s=t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS);function l(x,b){const S=b.program;r.uniformBlockBinding(x,S)}function c(x,b){let S=i[x.id];S===void 0&&(y(x),S=u(x),i[x.id]=S,x.addEventListener("dispose",g));const w=b.program;r.updateUBOMapping(x,w);const E=e.render.frame;o[x.id]!==E&&(f(x),o[x.id]=E)}function u(x){const b=d();x.__bindingPointIndex=b;const S=t.createBuffer(),w=x.__size,E=x.usage;return t.bindBuffer(t.UNIFORM_BUFFER,S),t.bufferData(t.UNIFORM_BUFFER,w,E),t.bindBuffer(t.UNIFORM_BUFFER,null),t.bindBufferBase(t.UNIFORM_BUFFER,b,S),S}function d(){for(let x=0;x0&&(S+=w-E),x.__size=S,x.__cache={},this}function v(x){const b={boundary:0,storage:0};return typeof x=="number"||typeof x=="boolean"?(b.boundary=4,b.storage=4):x.isVector2?(b.boundary=8,b.storage=8):x.isVector3||x.isColor?(b.boundary=16,b.storage=12):x.isVector4?(b.boundary=16,b.storage=16):x.isMatrix3?(b.boundary=48,b.storage=48):x.isMatrix4?(b.boundary=64,b.storage=64):x.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",x),b}function g(x){const b=x.target;b.removeEventListener("dispose",g);const S=a.indexOf(b.__bindingPointIndex);a.splice(S,1),t.deleteBuffer(i[b.id]),delete i[b.id],delete o[b.id]}function m(){for(const x in i)t.deleteBuffer(i[x]);a=[],i={},o={}}return{bind:l,update:c,dispose:m}}class zoe{constructor(e={}){const{canvas:n=XQ(),context:r=null,depth:i=!0,stencil:o=!1,alpha:a=!1,antialias:s=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:d=!1,reverseDepthBuffer:f=!1}=e;this.isWebGLRenderer=!0;let p;if(r!==null){if(typeof WebGLRenderingContext<"u"&&r instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");p=r.getContextAttributes().alpha}else p=a;const y=new Uint32Array(4),v=new Int32Array(4);let g=null,m=null;const x=[],b=[];this.domElement=n,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=tl,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const S=this;let w=!1;this._outputColorSpace=Zt;let E=0,T=0,A=null,M=-1,C=null;const P=new Yt,R=new Yt;let D=null;const k=new ft(0);let U=0,O=n.width,W=n.height,L=1,j=null,X=null;const K=new Yt(0,0,O,W),F=new Yt(0,0,O,W);let Y=!1;const q=new ZA;let Q=!1,te=!1;const ee=new gt,ce=new gt,ae=new ne,fe=new Yt,we={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let le=!1;function ie(){return A===null?L:1}let G=r;function Ve(z,oe){return n.getContext(z,oe)}try{const z={alpha:!0,depth:i,stencil:o,antialias:s,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:d};if("setAttribute"in n&&n.setAttribute("data-engine",`three.js r${UA}`),n.addEventListener("webglcontextlost",Ge,!1),n.addEventListener("webglcontextrestored",Te,!1),n.addEventListener("webglcontextcreationerror",_e,!1),G===null){const oe="webgl2";if(G=Ve(oe,z),G===null)throw Ve(oe)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(z){throw console.error("THREE.WebGLRenderer: "+z.message),z}let Ne,st,Re,ct,Ye,it,Ft,J,B,ue,me,be,ge,rt,Ie,Je,tt,Ee,Be,ht,ot,Le,_t,re;function ke(){Ne=new Zre(G),Ne.init(),Le=new Doe(G,Ne),st=new Gre(G,Ne,e,Le),Re=new Ooe(G,Ne),st.reverseDepthBuffer&&f&&Re.buffers.depth.setReversed(!0),ct=new tie(G),Ye=new xoe,it=new Ioe(G,Ne,Re,Ye,st,Le,ct),Ft=new Xre(S),J=new Jre(S),B=new ste(G),_t=new Hre(G,B),ue=new Qre(G,B,ct,_t),me=new rie(G,ue,B,ct),Be=new nie(G,st,it),Je=new Wre(Ye),be=new yoe(S,Ft,J,Ne,st,_t,Je),ge=new Boe(S,Ye),rt=new _oe,Ie=new Aoe(Ne),Ee=new zre(S,Ft,J,Re,me,p,l),tt=new Roe(S,me,st),re=new $oe(G,ct,st,Re),ht=new Vre(G,Ne,ct),ot=new eie(G,Ne,ct),ct.programs=be.programs,S.capabilities=st,S.extensions=Ne,S.properties=Ye,S.renderLists=rt,S.shadowMap=tt,S.state=Re,S.info=ct}ke();const Me=new Uoe(S,G);this.xr=Me,this.getContext=function(){return G},this.getContextAttributes=function(){return G.getContextAttributes()},this.forceContextLoss=function(){const z=Ne.get("WEBGL_lose_context");z&&z.loseContext()},this.forceContextRestore=function(){const z=Ne.get("WEBGL_lose_context");z&&z.restoreContext()},this.getPixelRatio=function(){return L},this.setPixelRatio=function(z){z!==void 0&&(L=z,this.setSize(O,W,!1))},this.getSize=function(z){return z.set(O,W)},this.setSize=function(z,oe,de=!0){if(Me.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}O=z,W=oe,n.width=Math.floor(z*L),n.height=Math.floor(oe*L),de===!0&&(n.style.width=z+"px",n.style.height=oe+"px"),this.setViewport(0,0,z,oe)},this.getDrawingBufferSize=function(z){return z.set(O*L,W*L).floor()},this.setDrawingBufferSize=function(z,oe,de){O=z,W=oe,L=de,n.width=Math.floor(z*de),n.height=Math.floor(oe*de),this.setViewport(0,0,z,oe)},this.getCurrentViewport=function(z){return z.copy(P)},this.getViewport=function(z){return z.copy(K)},this.setViewport=function(z,oe,de,he){z.isVector4?K.set(z.x,z.y,z.z,z.w):K.set(z,oe,de,he),Re.viewport(P.copy(K).multiplyScalar(L).round())},this.getScissor=function(z){return z.copy(F)},this.setScissor=function(z,oe,de,he){z.isVector4?F.set(z.x,z.y,z.z,z.w):F.set(z,oe,de,he),Re.scissor(R.copy(F).multiplyScalar(L).round())},this.getScissorTest=function(){return Y},this.setScissorTest=function(z){Re.setScissorTest(Y=z)},this.setOpaqueSort=function(z){j=z},this.setTransparentSort=function(z){X=z},this.getClearColor=function(z){return z.copy(Ee.getClearColor())},this.setClearColor=function(){Ee.setClearColor(...arguments)},this.getClearAlpha=function(){return Ee.getClearAlpha()},this.setClearAlpha=function(){Ee.setClearAlpha(...arguments)},this.clear=function(z=!0,oe=!0,de=!0){let he=0;if(z){let se=!1;if(A!==null){const Pe=A.texture.format;se=Pe===GA||Pe===VA||Pe===HA}if(se){const Pe=A.texture.type,Ue=Pe===ya||Pe===Nc||Pe===Sp||Pe===Ep||Pe===BA||Pe===$A,Ze=Ee.getClearColor(),We=Ee.getClearAlpha(),wt=Ze.r,St=Ze.g,ut=Ze.b;Ue?(y[0]=wt,y[1]=St,y[2]=ut,y[3]=We,G.clearBufferuiv(G.COLOR,0,y)):(v[0]=wt,v[1]=St,v[2]=ut,v[3]=We,G.clearBufferiv(G.COLOR,0,v))}else he|=G.COLOR_BUFFER_BIT}oe&&(he|=G.DEPTH_BUFFER_BIT),de&&(he|=G.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),G.clear(he)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){n.removeEventListener("webglcontextlost",Ge,!1),n.removeEventListener("webglcontextrestored",Te,!1),n.removeEventListener("webglcontextcreationerror",_e,!1),Ee.dispose(),rt.dispose(),Ie.dispose(),Ye.dispose(),Ft.dispose(),J.dispose(),me.dispose(),_t.dispose(),re.dispose(),be.dispose(),Me.dispose(),Me.removeEventListener("sessionstart",Ui),Me.removeEventListener("sessionend",_r),nr.stop()};function Ge(z){z.preventDefault(),w=!0}function Te(){w=!1;const z=ct.autoReset,oe=tt.enabled,de=tt.autoUpdate,he=tt.needsUpdate,se=tt.type;ke(),ct.autoReset=z,tt.enabled=oe,tt.autoUpdate=de,tt.needsUpdate=he,tt.type=se}function _e(z){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",z.statusMessage)}function Se(z){const oe=z.target;oe.removeEventListener("dispose",Se),je(oe)}function je(z){vt(z),Ye.remove(z)}function vt(z){const oe=Ye.get(z).programs;oe!==void 0&&(oe.forEach(function(de){be.releaseProgram(de)}),z.isShaderMaterial&&be.releaseShaderCache(z))}this.renderBufferDirect=function(z,oe,de,he,se,Pe){oe===null&&(oe=we);const Ue=se.isMesh&&se.matrixWorld.determinant()<0,Ze=Hb(z,oe,de,he,se);Re.setMaterial(he,Ue);let We=de.index,wt=1;if(he.wireframe===!0){if(We=ue.getWireframeAttribute(de),We===void 0)return;wt=2}const St=de.drawRange,ut=de.attributes.position;let Mt=St.start*wt,Kt=(St.start+St.count)*wt;Pe!==null&&(Mt=Math.max(Mt,Pe.start*wt),Kt=Math.min(Kt,(Pe.start+Pe.count)*wt)),We!==null?(Mt=Math.max(Mt,0),Kt=Math.min(Kt,We.count)):ut!=null&&(Mt=Math.max(Mt,0),Kt=Math.min(Kt,ut.count));const hn=Kt-Mt;if(hn<0||hn===1/0)return;_t.setup(se,he,Ze,de,We);let En,Bt=ht;if(We!==null&&(En=B.get(We),Bt=ot,Bt.setIndex(En)),se.isMesh)he.wireframe===!0?(Re.setLineWidth(he.wireframeLinewidth*ie()),Bt.setMode(G.LINES)):Bt.setMode(G.TRIANGLES);else if(se.isLine){let mt=he.linewidth;mt===void 0&&(mt=1),Re.setLineWidth(mt*ie()),se.isLineSegments?Bt.setMode(G.LINES):se.isLineLoop?Bt.setMode(G.LINE_LOOP):Bt.setMode(G.LINE_STRIP)}else se.isPoints?Bt.setMode(G.POINTS):se.isSprite&&Bt.setMode(G.TRIANGLES);if(se.isBatchedMesh)if(se._multiDrawInstances!==null)ld("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),Bt.renderMultiDrawInstances(se._multiDrawStarts,se._multiDrawCounts,se._multiDrawCount,se._multiDrawInstances);else if(Ne.get("WEBGL_multi_draw"))Bt.renderMultiDraw(se._multiDrawStarts,se._multiDrawCounts,se._multiDrawCount);else{const mt=se._multiDrawStarts,Vn=se._multiDrawCounts,Vt=se._multiDrawCount,Qr=We?B.get(We).bytesPerElement:1,pn=Ye.get(he).currentProgram.getUniforms();for(let fr=0;fr{function Pe(){if(he.forEach(function(Ue){Ye.get(Ue).currentProgram.isReady()&&he.delete(Ue)}),he.size===0){se(z);return}setTimeout(Pe,10)}Ne.get("KHR_parallel_shader_compile")!==null?Pe():setTimeout(Pe,10)})};let fn=null;function Un(z){fn&&fn(z)}function Ui(){nr.stop()}function _r(){nr.start()}const nr=new K4;nr.setAnimationLoop(Un),typeof self<"u"&&nr.setContext(self),this.setAnimationLoop=function(z){fn=z,Me.setAnimationLoop(z),z===null?nr.stop():nr.start()},Me.addEventListener("sessionstart",Ui),Me.addEventListener("sessionend",_r),this.render=function(z,oe){if(oe!==void 0&&oe.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(w===!0)return;if(z.matrixWorldAutoUpdate===!0&&z.updateMatrixWorld(),oe.parent===null&&oe.matrixWorldAutoUpdate===!0&&oe.updateMatrixWorld(),Me.enabled===!0&&Me.isPresenting===!0&&(Me.cameraAutoUpdate===!0&&Me.updateCamera(oe),oe=Me.getCamera()),z.isScene===!0&&z.onBeforeRender(S,z,oe,A),m=Ie.get(z,b.length),m.init(oe),b.push(m),ce.multiplyMatrices(oe.projectionMatrix,oe.matrixWorldInverse),q.setFromProjectionMatrix(ce),te=this.localClippingEnabled,Q=Je.init(this.clippingPlanes,te),g=rt.get(z,x.length),g.init(),x.push(g),Me.enabled===!0&&Me.isPresenting===!0){const Pe=S.xr.getDepthSensingMesh();Pe!==null&&$f(Pe,oe,-1/0,S.sortObjects)}$f(z,oe,0,S.sortObjects),g.finish(),S.sortObjects===!0&&g.sort(j,X),le=Me.enabled===!1||Me.isPresenting===!1||Me.hasDepthSensing()===!1,le&&Ee.addToRenderList(g,z),this.info.render.frame++,Q===!0&&Je.beginShadows();const de=m.state.shadowsArray;tt.render(de,z,oe),Q===!0&&Je.endShadows(),this.info.autoReset===!0&&this.info.reset();const he=g.opaque,se=g.transmissive;if(m.setupLights(),oe.isArrayCamera){const Pe=oe.cameras;if(se.length>0)for(let Ue=0,Ze=Pe.length;Ue0&&zf(he,se,z,oe),le&&Ee.render(z),Xm(g,z,oe);A!==null&&T===0&&(it.updateMultisampleRenderTarget(A),it.updateRenderTargetMipmap(A)),z.isScene===!0&&z.onAfterRender(S,z,oe),_t.resetDefaultState(),M=-1,C=null,b.pop(),b.length>0?(m=b[b.length-1],Q===!0&&Je.setGlobalState(S.clippingPlanes,m.state.camera)):m=null,x.pop(),x.length>0?g=x[x.length-1]:g=null};function $f(z,oe,de,he){if(z.visible===!1)return;if(z.layers.test(oe.layers)){if(z.isGroup)de=z.renderOrder;else if(z.isLOD)z.autoUpdate===!0&&z.update(oe);else if(z.isLight)m.pushLight(z),z.castShadow&&m.pushShadow(z);else if(z.isSprite){if(!z.frustumCulled||q.intersectsSprite(z)){he&&fe.setFromMatrixPosition(z.matrixWorld).applyMatrix4(ce);const Ue=me.update(z),Ze=z.material;Ze.visible&&g.push(z,Ue,Ze,de,fe.z,null)}}else if((z.isMesh||z.isLine||z.isPoints)&&(!z.frustumCulled||q.intersectsObject(z))){const Ue=me.update(z),Ze=z.material;if(he&&(z.boundingSphere!==void 0?(z.boundingSphere===null&&z.computeBoundingSphere(),fe.copy(z.boundingSphere.center)):(Ue.boundingSphere===null&&Ue.computeBoundingSphere(),fe.copy(Ue.boundingSphere.center)),fe.applyMatrix4(z.matrixWorld).applyMatrix4(ce)),Array.isArray(Ze)){const We=Ue.groups;for(let wt=0,St=We.length;wt0&&Zc(se,oe,de),Pe.length>0&&Zc(Pe,oe,de),Ue.length>0&&Zc(Ue,oe,de),Re.buffers.depth.setTest(!0),Re.buffers.depth.setMask(!0),Re.buffers.color.setMask(!0),Re.setPolygonOffset(!1)}function zf(z,oe,de,he){if((de.isScene===!0?de.overrideMaterial:null)!==null)return;m.state.transmissionRenderTarget[he.id]===void 0&&(m.state.transmissionRenderTarget[he.id]=new Oc(1,1,{generateMipmaps:!0,type:Ne.has("EXT_color_buffer_half_float")||Ne.has("EXT_color_buffer_float")?Nm:ya,minFilter:Oo,samples:4,stencilBuffer:o,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Dt.workingColorSpace}));const Pe=m.state.transmissionRenderTarget[he.id],Ue=he.viewport||P;Pe.setSize(Ue.z*S.transmissionResolutionScale,Ue.w*S.transmissionResolutionScale);const Ze=S.getRenderTarget();S.setRenderTarget(Pe),S.getClearColor(k),U=S.getClearAlpha(),U<1&&S.setClearColor(16777215,.5),S.clear(),le&&Ee.render(de);const We=S.toneMapping;S.toneMapping=tl;const wt=he.viewport;if(he.viewport!==void 0&&(he.viewport=void 0),m.setupLightsView(he),Q===!0&&Je.setGlobalState(S.clippingPlanes,he),Zc(z,de,he),it.updateMultisampleRenderTarget(Pe),it.updateRenderTargetMipmap(Pe),Ne.has("WEBGL_multisampled_render_to_texture")===!1){let St=!1;for(let ut=0,Mt=oe.length;ut0),ut=!!de.morphAttributes.position,Mt=!!de.morphAttributes.normal,Kt=!!de.morphAttributes.color;let hn=tl;he.toneMapped&&(A===null||A.isXRRenderTarget===!0)&&(hn=S.toneMapping);const En=de.morphAttributes.position||de.morphAttributes.normal||de.morphAttributes.color,Bt=En!==void 0?En.length:0,mt=Ye.get(he),Vn=m.state.lights;if(Q===!0&&(te===!0||z!==C)){const Fn=z===C&&he.id===M;Je.setState(he,z,Fn)}let Vt=!1;he.version===mt.__version?(mt.needsLights&&mt.lightsStateVersion!==Vn.state.version||mt.outputColorSpace!==Ze||se.isBatchedMesh&&mt.batching===!1||!se.isBatchedMesh&&mt.batching===!0||se.isBatchedMesh&&mt.batchingColor===!0&&se.colorTexture===null||se.isBatchedMesh&&mt.batchingColor===!1&&se.colorTexture!==null||se.isInstancedMesh&&mt.instancing===!1||!se.isInstancedMesh&&mt.instancing===!0||se.isSkinnedMesh&&mt.skinning===!1||!se.isSkinnedMesh&&mt.skinning===!0||se.isInstancedMesh&&mt.instancingColor===!0&&se.instanceColor===null||se.isInstancedMesh&&mt.instancingColor===!1&&se.instanceColor!==null||se.isInstancedMesh&&mt.instancingMorph===!0&&se.morphTexture===null||se.isInstancedMesh&&mt.instancingMorph===!1&&se.morphTexture!==null||mt.envMap!==We||he.fog===!0&&mt.fog!==Pe||mt.numClippingPlanes!==void 0&&(mt.numClippingPlanes!==Je.numPlanes||mt.numIntersection!==Je.numIntersection)||mt.vertexAlphas!==wt||mt.vertexTangents!==St||mt.morphTargets!==ut||mt.morphNormals!==Mt||mt.morphColors!==Kt||mt.toneMapping!==hn||mt.morphTargetsCount!==Bt)&&(Vt=!0):(Vt=!0,mt.__version=he.version);let Qr=mt.currentProgram;Vt===!0&&(Qr=Qc(he,oe,se));let pn=!1,fr=!1,Nl=!1;const cn=Qr.getUniforms(),Lr=mt.uniforms;if(Re.useProgram(Qr.program)&&(pn=!0,fr=!0,Nl=!0),he.id!==M&&(M=he.id,fr=!0),pn||C!==z){Re.buffers.depth.getReversed()?(ee.copy(z.projectionMatrix),KQ(ee),YQ(ee),cn.setValue(G,"projectionMatrix",ee)):cn.setValue(G,"projectionMatrix",z.projectionMatrix),cn.setValue(G,"viewMatrix",z.matrixWorldInverse);const Gn=cn.map.cameraPosition;Gn!==void 0&&Gn.setValue(G,ae.setFromMatrixPosition(z.matrixWorld)),st.logarithmicDepthBuffer&&cn.setValue(G,"logDepthBufFC",2/(Math.log(z.far+1)/Math.LN2)),(he.isMeshPhongMaterial||he.isMeshToonMaterial||he.isMeshLambertMaterial||he.isMeshBasicMaterial||he.isMeshStandardMaterial||he.isShaderMaterial)&&cn.setValue(G,"isOrthographic",z.isOrthographicCamera===!0),C!==z&&(C=z,fr=!0,Nl=!0)}if(se.isSkinnedMesh){cn.setOptional(G,se,"bindMatrix"),cn.setOptional(G,se,"bindMatrixInverse");const Fn=se.skeleton;Fn&&(Fn.boneTexture===null&&Fn.computeBoneTexture(),cn.setValue(G,"boneTexture",Fn.boneTexture,it))}se.isBatchedMesh&&(cn.setOptional(G,se,"batchingTexture"),cn.setValue(G,"batchingTexture",se._matricesTexture,it),cn.setOptional(G,se,"batchingIdTexture"),cn.setValue(G,"batchingIdTexture",se._indirectTexture,it),cn.setOptional(G,se,"batchingColorTexture"),se._colorsTexture!==null&&cn.setValue(G,"batchingColorTexture",se._colorsTexture,it));const wr=de.morphAttributes;if((wr.position!==void 0||wr.normal!==void 0||wr.color!==void 0)&&Be.update(se,de,Qr),(fr||mt.receiveShadow!==se.receiveShadow)&&(mt.receiveShadow=se.receiveShadow,cn.setValue(G,"receiveShadow",se.receiveShadow)),he.isMeshGouraudMaterial&&he.envMap!==null&&(Lr.envMap.value=We,Lr.flipEnvMap.value=We.isCubeTexture&&We.isRenderTargetTexture===!1?-1:1),he.isMeshStandardMaterial&&he.envMap===null&&oe.environment!==null&&(Lr.envMapIntensity.value=oe.environmentIntensity),fr&&(cn.setValue(G,"toneMappingExposure",S.toneMappingExposure),mt.needsLights&&Vb(Lr,Nl),Pe&&he.fog===!0&&ge.refreshFogUniforms(Lr,Pe),ge.refreshMaterialUniforms(Lr,he,L,W,m.state.transmissionRenderTarget[z.id]),Wv.upload(G,qm(mt),Lr,it)),he.isShaderMaterial&&he.uniformsNeedUpdate===!0&&(Wv.upload(G,qm(mt),Lr,it),he.uniformsNeedUpdate=!1),he.isSpriteMaterial&&cn.setValue(G,"center",se.center),cn.setValue(G,"modelViewMatrix",se.modelViewMatrix),cn.setValue(G,"normalMatrix",se.normalMatrix),cn.setValue(G,"modelMatrix",se.matrixWorld),he.isShaderMaterial||he.isRawShaderMaterial){const Fn=he.uniformsGroups;for(let Gn=0,eu=Fn.length;Gn0&&it.useMultisampledRTT(z)===!1?se=Ye.get(z).__webglMultisampledFramebuffer:Array.isArray(St)?se=St[de]:se=St,P.copy(z.viewport),R.copy(z.scissor),D=z.scissorTest}else P.copy(K).multiplyScalar(L).floor(),R.copy(F).multiplyScalar(L).floor(),D=Y;if(de!==0&&(se=Wb),Re.bindFramebuffer(G.FRAMEBUFFER,se)&&he&&Re.drawBuffers(z,se),Re.viewport(P),Re.scissor(R),Re.setScissorTest(D),Pe){const We=Ye.get(z.texture);G.framebufferTexture2D(G.FRAMEBUFFER,G.COLOR_ATTACHMENT0,G.TEXTURE_CUBE_MAP_POSITIVE_X+oe,We.__webglTexture,de)}else if(Ue){const We=Ye.get(z.texture),wt=oe;G.framebufferTextureLayer(G.FRAMEBUFFER,G.COLOR_ATTACHMENT0,We.__webglTexture,de,wt)}else if(z!==null&&de!==0){const We=Ye.get(z.texture);G.framebufferTexture2D(G.FRAMEBUFFER,G.COLOR_ATTACHMENT0,G.TEXTURE_2D,We.__webglTexture,de)}M=-1},this.readRenderTargetPixels=function(z,oe,de,he,se,Pe,Ue,Ze=0){if(!(z&&z.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let We=Ye.get(z).__webglFramebuffer;if(z.isWebGLCubeRenderTarget&&Ue!==void 0&&(We=We[Ue]),We){Re.bindFramebuffer(G.FRAMEBUFFER,We);try{const wt=z.textures[Ze],St=wt.format,ut=wt.type;if(!st.textureFormatReadable(St)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!st.textureTypeReadable(ut)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}oe>=0&&oe<=z.width-he&&de>=0&&de<=z.height-se&&(z.textures.length>1&&G.readBuffer(G.COLOR_ATTACHMENT0+Ze),G.readPixels(oe,de,he,se,Le.convert(St),Le.convert(ut),Pe))}finally{const wt=A!==null?Ye.get(A).__webglFramebuffer:null;Re.bindFramebuffer(G.FRAMEBUFFER,wt)}}},this.readRenderTargetPixelsAsync=async function(z,oe,de,he,se,Pe,Ue,Ze=0){if(!(z&&z.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let We=Ye.get(z).__webglFramebuffer;if(z.isWebGLCubeRenderTarget&&Ue!==void 0&&(We=We[Ue]),We)if(oe>=0&&oe<=z.width-he&&de>=0&&de<=z.height-se){Re.bindFramebuffer(G.FRAMEBUFFER,We);const wt=z.textures[Ze],St=wt.format,ut=wt.type;if(!st.textureFormatReadable(St))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!st.textureTypeReadable(ut))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const Mt=G.createBuffer();G.bindBuffer(G.PIXEL_PACK_BUFFER,Mt),G.bufferData(G.PIXEL_PACK_BUFFER,Pe.byteLength,G.STREAM_READ),z.textures.length>1&&G.readBuffer(G.COLOR_ATTACHMENT0+Ze),G.readPixels(oe,de,he,se,Le.convert(St),Le.convert(ut),0);const Kt=A!==null?Ye.get(A).__webglFramebuffer:null;Re.bindFramebuffer(G.FRAMEBUFFER,Kt);const hn=G.fenceSync(G.SYNC_GPU_COMMANDS_COMPLETE,0);return G.flush(),await qQ(G,hn,4),G.bindBuffer(G.PIXEL_PACK_BUFFER,Mt),G.getBufferSubData(G.PIXEL_PACK_BUFFER,0,Pe),G.deleteBuffer(Mt),G.deleteSync(hn),Pe}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(z,oe=null,de=0){const he=Math.pow(2,-de),se=Math.floor(z.image.width*he),Pe=Math.floor(z.image.height*he),Ue=oe!==null?oe.x:0,Ze=oe!==null?oe.y:0;it.setTexture2D(z,0),G.copyTexSubImage2D(G.TEXTURE_2D,de,0,0,Ue,Ze,se,Pe),Re.unbindTexture()};const Xb=G.createFramebuffer(),qb=G.createFramebuffer();this.copyTextureToTexture=function(z,oe,de=null,he=null,se=0,Pe=null){Pe===null&&(se!==0?(ld("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),Pe=se,se=0):Pe=0);let Ue,Ze,We,wt,St,ut,Mt,Kt,hn;const En=z.isCompressedTexture?z.mipmaps[Pe]:z.image;if(de!==null)Ue=de.max.x-de.min.x,Ze=de.max.y-de.min.y,We=de.isBox3?de.max.z-de.min.z:1,wt=de.min.x,St=de.min.y,ut=de.isBox3?de.min.z:0;else{const wr=Math.pow(2,-se);Ue=Math.floor(En.width*wr),Ze=Math.floor(En.height*wr),z.isDataArrayTexture?We=En.depth:z.isData3DTexture?We=Math.floor(En.depth*wr):We=1,wt=0,St=0,ut=0}he!==null?(Mt=he.x,Kt=he.y,hn=he.z):(Mt=0,Kt=0,hn=0);const Bt=Le.convert(oe.format),mt=Le.convert(oe.type);let Vn;oe.isData3DTexture?(it.setTexture3D(oe,0),Vn=G.TEXTURE_3D):oe.isDataArrayTexture||oe.isCompressedArrayTexture?(it.setTexture2DArray(oe,0),Vn=G.TEXTURE_2D_ARRAY):(it.setTexture2D(oe,0),Vn=G.TEXTURE_2D),G.pixelStorei(G.UNPACK_FLIP_Y_WEBGL,oe.flipY),G.pixelStorei(G.UNPACK_PREMULTIPLY_ALPHA_WEBGL,oe.premultiplyAlpha),G.pixelStorei(G.UNPACK_ALIGNMENT,oe.unpackAlignment);const Vt=G.getParameter(G.UNPACK_ROW_LENGTH),Qr=G.getParameter(G.UNPACK_IMAGE_HEIGHT),pn=G.getParameter(G.UNPACK_SKIP_PIXELS),fr=G.getParameter(G.UNPACK_SKIP_ROWS),Nl=G.getParameter(G.UNPACK_SKIP_IMAGES);G.pixelStorei(G.UNPACK_ROW_LENGTH,En.width),G.pixelStorei(G.UNPACK_IMAGE_HEIGHT,En.height),G.pixelStorei(G.UNPACK_SKIP_PIXELS,wt),G.pixelStorei(G.UNPACK_SKIP_ROWS,St),G.pixelStorei(G.UNPACK_SKIP_IMAGES,ut);const cn=z.isDataArrayTexture||z.isData3DTexture,Lr=oe.isDataArrayTexture||oe.isData3DTexture;if(z.isDepthTexture){const wr=Ye.get(z),Fn=Ye.get(oe),Gn=Ye.get(wr.__renderTarget),eu=Ye.get(Fn.__renderTarget);Re.bindFramebuffer(G.READ_FRAMEBUFFER,Gn.__webglFramebuffer),Re.bindFramebuffer(G.DRAW_FRAMEBUFFER,eu.__webglFramebuffer);for(let Sa=0;SaMath.PI&&(r-=ti),i<-Math.PI?i+=ti:i>Math.PI&&(i-=ti),r<=i?this._spherical.theta=Math.max(r,Math.min(i,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(r+i)/2?Math.max(r,this._spherical.theta):Math.min(i,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let o=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const a=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),o=a!=this._spherical.radius}if(Wn.setFromSpherical(this._spherical),Wn.applyQuaternion(this._quatInverse),n.copy(this.target).add(Wn),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let a=null;if(this.object.isPerspectiveCamera){const s=Wn.length();a=this._clampDistance(s*this._scale);const l=s-a;this.object.position.addScaledVector(this._dollyDirection,l),this.object.updateMatrixWorld(),o=!!l}else if(this.object.isOrthographicCamera){const s=new ne(this._mouse.x,this._mouse.y,0);s.unproject(this.object);const l=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),o=l!==this.object.zoom;const c=new ne(this._mouse.x,this._mouse.y,0);c.unproject(this.object),this.object.position.sub(c).add(s),this.object.updateMatrixWorld(),a=Wn.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;a!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(a).add(this.object.position):(ev.origin.copy(this.object.position),ev.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(ev.direction))Ew||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Ew||this._lastTargetPosition.distanceToSquared(this.target)>Ew?(this.dispatchEvent(ZO),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(e){return e!==null?ti/60*this.autoRotateSpeed*e:ti/60/60*this.autoRotateSpeed}_getZoomScale(e){const n=Math.abs(e*.01);return Math.pow(.95,this.zoomSpeed*n)}_rotateLeft(e){this._sphericalDelta.theta-=e}_rotateUp(e){this._sphericalDelta.phi-=e}_panLeft(e,n){Wn.setFromMatrixColumn(n,0),Wn.multiplyScalar(-e),this._panOffset.add(Wn)}_panUp(e,n){this.screenSpacePanning===!0?Wn.setFromMatrixColumn(n,1):(Wn.setFromMatrixColumn(n,0),Wn.crossVectors(this.object.up,Wn)),Wn.multiplyScalar(e),this._panOffset.add(Wn)}_pan(e,n){const r=this.domElement;if(this.object.isPerspectiveCamera){const i=this.object.position;Wn.copy(i).sub(this.target);let o=Wn.length();o*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*e*o/r.clientHeight,this.object.matrix),this._panUp(2*n*o/r.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(e*(this.object.right-this.object.left)/this.object.zoom/r.clientWidth,this.object.matrix),this._panUp(n*(this.object.top-this.object.bottom)/this.object.zoom/r.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(e,n){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const r=this.domElement.getBoundingClientRect(),i=e-r.left,o=n-r.top,a=r.width,s=r.height;this._mouse.x=i/a*2-1,this._mouse.y=-(o/s)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(e){return Math.max(this.minDistance,Math.min(this.maxDistance,e))}_handleMouseDownRotate(e){this._rotateStart.set(e.clientX,e.clientY)}_handleMouseDownDolly(e){this._updateZoomParameters(e.clientX,e.clientX),this._dollyStart.set(e.clientX,e.clientY)}_handleMouseDownPan(e){this._panStart.set(e.clientX,e.clientY)}_handleMouseMoveRotate(e){this._rotateEnd.set(e.clientX,e.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const n=this.domElement;this._rotateLeft(ti*this._rotateDelta.x/n.clientHeight),this._rotateUp(ti*this._rotateDelta.y/n.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(e){this._dollyEnd.set(e.clientX,e.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(e){this._panEnd.set(e.clientX,e.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(e){this._updateZoomParameters(e.clientX,e.clientY),e.deltaY<0?this._dollyIn(this._getZoomScale(e.deltaY)):e.deltaY>0&&this._dollyOut(this._getZoomScale(e.deltaY)),this.update()}_handleKeyDown(e){let n=!1;switch(e.code){case this.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(ti*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),n=!0;break;case this.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(-ti*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),n=!0;break;case this.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(ti*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),n=!0;break;case this.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(-ti*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),n=!0;break}n&&(e.preventDefault(),this.update())}_handleTouchStartRotate(e){if(this._pointers.length===1)this._rotateStart.set(e.pageX,e.pageY);else{const n=this._getSecondPointerPosition(e),r=.5*(e.pageX+n.x),i=.5*(e.pageY+n.y);this._rotateStart.set(r,i)}}_handleTouchStartPan(e){if(this._pointers.length===1)this._panStart.set(e.pageX,e.pageY);else{const n=this._getSecondPointerPosition(e),r=.5*(e.pageX+n.x),i=.5*(e.pageY+n.y);this._panStart.set(r,i)}}_handleTouchStartDolly(e){const n=this._getSecondPointerPosition(e),r=e.pageX-n.x,i=e.pageY-n.y,o=Math.sqrt(r*r+i*i);this._dollyStart.set(0,o)}_handleTouchStartDollyPan(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enablePan&&this._handleTouchStartPan(e)}_handleTouchStartDollyRotate(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enableRotate&&this._handleTouchStartRotate(e)}_handleTouchMoveRotate(e){if(this._pointers.length==1)this._rotateEnd.set(e.pageX,e.pageY);else{const r=this._getSecondPointerPosition(e),i=.5*(e.pageX+r.x),o=.5*(e.pageY+r.y);this._rotateEnd.set(i,o)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const n=this.domElement;this._rotateLeft(ti*this._rotateDelta.x/n.clientHeight),this._rotateUp(ti*this._rotateDelta.y/n.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(e){if(this._pointers.length===1)this._panEnd.set(e.pageX,e.pageY);else{const n=this._getSecondPointerPosition(e),r=.5*(e.pageX+n.x),i=.5*(e.pageY+n.y);this._panEnd.set(r,i)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(e){const n=this._getSecondPointerPosition(e),r=e.pageX-n.x,i=e.pageY-n.y,o=Math.sqrt(r*r+i*i);this._dollyEnd.set(0,o),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const a=(e.pageX+n.x)*.5,s=(e.pageY+n.y)*.5;this._updateZoomParameters(a,s)}_handleTouchMoveDollyPan(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enablePan&&this._handleTouchMovePan(e)}_handleTouchMoveDollyRotate(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enableRotate&&this._handleTouchMoveRotate(e)}_addPointer(e){this._pointers.push(e.pointerId)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let n=0;n>5&31)/31,y=(O>>10&31)/31)}for(let O=1;O<=3;O++){const W=R+O*12,L=P*3*3+(O-1)*3;A[L]=u.getFloat32(W,!0),A[L+1]=u.getFloat32(W+4,!0),A[L+2]=u.getFloat32(W+8,!0),M[L]=D,M[L+1]=k,M[L+2]=U,v&&(C.setRGB(f,p,y,Zt),g[L]=C.r,g[L+1]=C.g,g[L+2]=C.b)}}return T.setAttribute("position",new cr(A,3)),T.setAttribute("normal",new cr(M,3)),v&&(T.setAttribute("color",new cr(g,3)),T.hasColors=!0,T.alpha=S),T}function o(c){const u=new br,d=/solid([\s\S]*?)endsolid/g,f=/facet([\s\S]*?)endfacet/g,p=/solid\s(.+)/;let y=0;const v=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,g=new RegExp("vertex"+v+v+v,"g"),m=new RegExp("normal"+v+v+v,"g"),x=[],b=[],S=[],w=new ne;let E,T=0,A=0,M=0;for(;(E=d.exec(c))!==null;){A=M;const C=E[0],P=(E=p.exec(C))!==null?E[1]:"";for(S.push(P);(E=f.exec(C))!==null;){let k=0,U=0;const O=E[0];for(;(E=m.exec(O))!==null;)w.x=parseFloat(E[1]),w.y=parseFloat(E[2]),w.z=parseFloat(E[3]),U++;for(;(E=g.exec(O))!==null;)x.push(parseFloat(E[1]),parseFloat(E[2]),parseFloat(E[3])),b.push(w.x,w.y,w.z),k++,M++;U!==1&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+y),k!==3&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+y),y++}const R=A,D=M-A;u.userData.groupNames=S,u.addGroup(R,D,T),T++}return u.setAttribute("position",new Qt(x,3)),u.setAttribute("normal",new Qt(b,3)),u}function a(c){return typeof c!="string"?new TextDecoder().decode(c):c}function s(c){if(typeof c=="string"){const u=new Uint8Array(c.length);for(let d=0;d256||O.colormap_size!==24||O.colormap_type!==1)throw new Error("THREE.TGALoader: Invalid type colormap data for indexed type.");break;case p:case y:case g:case m:if(O.colormap_type)throw new Error("THREE.TGALoader: Invalid type colormap data for colormap type.");break;case d:throw new Error("THREE.TGALoader: No data.");default:throw new Error("THREE.TGALoader: Invalid type "+O.image_type)}if(O.width<=0||O.height<=0)throw new Error("THREE.TGALoader: Invalid image size.");if(O.pixel_size!==8&&O.pixel_size!==16&&O.pixel_size!==24&&O.pixel_size!==32)throw new Error("THREE.TGALoader: Invalid pixel size "+O.pixel_size)}function r(O,W,L,j,X){let K,F;const Y=L.pixel_size>>3,q=L.width*L.height*Y;if(W&&(F=X.subarray(j,j+=L.colormap_length*(L.colormap_size>>3))),O){K=new Uint8Array(q);let Q,te,ee,ce=0;const ae=new Uint8Array(Y);for(;ce>7,O[(te+ce*ee)*4+1]=(q&992)>>2,O[(te+ce*ee)*4+2]=(q&31)<<3,O[(te+ce*ee)*4+3]=q&32768?0:255;return O}function a(O,W,L,j,X,K,F,Y){let q=0,Q,te;const ee=C.width;for(te=W;te!==j;te+=L)for(Q=X;Q!==F;Q+=K,q+=3)O[(Q+ee*te)*4+3]=255,O[(Q+ee*te)*4+2]=Y[q+0],O[(Q+ee*te)*4+1]=Y[q+1],O[(Q+ee*te)*4+0]=Y[q+2];return O}function s(O,W,L,j,X,K,F,Y){let q=0,Q,te;const ee=C.width;for(te=W;te!==j;te+=L)for(Q=X;Q!==F;Q+=K,q+=4)O[(Q+ee*te)*4+2]=Y[q+0],O[(Q+ee*te)*4+1]=Y[q+1],O[(Q+ee*te)*4+0]=Y[q+2],O[(Q+ee*te)*4+3]=Y[q+3];return O}function l(O,W,L,j,X,K,F,Y){let q,Q=0,te,ee;const ce=C.width;for(ee=W;ee!==j;ee+=L)for(te=X;te!==F;te+=K,Q++)q=Y[Q],O[(te+ce*ee)*4+0]=q,O[(te+ce*ee)*4+1]=q,O[(te+ce*ee)*4+2]=q,O[(te+ce*ee)*4+3]=255;return O}function c(O,W,L,j,X,K,F,Y){let q=0,Q,te;const ee=C.width;for(te=W;te!==j;te+=L)for(Q=X;Q!==F;Q+=K,q+=2)O[(Q+ee*te)*4+0]=Y[q+0],O[(Q+ee*te)*4+1]=Y[q+0],O[(Q+ee*te)*4+2]=Y[q+0],O[(Q+ee*te)*4+3]=Y[q+1];return O}function u(O,W,L,j,X){let K,F,Y,q,Q,te;switch((C.flags&x)>>b){default:case E:K=0,Y=1,Q=W,F=0,q=1,te=L;break;case S:K=0,Y=1,Q=W,F=L-1,q=-1,te=-1;break;case T:K=W-1,Y=-1,Q=-1,F=0,q=1,te=L;break;case w:K=W-1,Y=-1,Q=-1,F=L-1,q=-1,te=-1;break}if(D)switch(C.pixel_size){case 8:l(O,F,q,te,K,Y,Q,j);break;case 16:c(O,F,q,te,K,Y,Q,j);break;default:throw new Error("THREE.TGALoader: Format not supported.")}else switch(C.pixel_size){case 8:i(O,F,q,te,K,Y,Q,j,X);break;case 16:o(O,F,q,te,K,Y,Q,j);break;case 24:a(O,F,q,te,K,Y,Q,j);break;case 32:s(O,F,q,te,K,Y,Q,j);break;default:throw new Error("THREE.TGALoader: Format not supported.")}return O}const d=0,f=1,p=2,y=3,v=9,g=10,m=11,x=48,b=4,S=0,w=1,E=2,T=3;if(e.length<19)throw new Error("THREE.TGALoader: Not enough data to contain header.");let A=0;const M=new Uint8Array(e),C={id_length:M[A++],colormap_type:M[A++],image_type:M[A++],colormap_index:M[A++]|M[A++]<<8,colormap_length:M[A++]|M[A++]<<8,colormap_size:M[A++],origin:[M[A++]|M[A++]<<8,M[A++]|M[A++]<<8],width:M[A++]|M[A++]<<8,height:M[A++]|M[A++]<<8,pixel_size:M[A++],flags:M[A++]};if(n(C),C.id_length+A>e.length)throw new Error("THREE.TGALoader: No data.");A+=C.id_length;let P=!1,R=!1,D=!1;switch(C.image_type){case v:P=!0,R=!0;break;case f:R=!0;break;case g:P=!0;break;case p:break;case m:P=!0,D=!0;break;case y:D=!0;break}const k=new Uint8Array(C.width*C.height*4),U=r(P,R,C,A,M);return u(k,C.width,C.height,U.pixel_data,U.palettes),{data:k,width:C.width,height:C.height,flipY:!0,generateMipmaps:!0,minFilter:Oo}}}class n$ extends Vo{load(e,n,r,i){const o=this,a=o.path===""?mc.extractUrlBase(e):o.path,s=new Mf(o.manager);s.setPath(o.path),s.setRequestHeader(o.requestHeader),s.setWithCredentials(o.withCredentials),s.load(e,function(l){try{n(o.parse(l,a))}catch(c){i?i(c):console.error(c),o.manager.itemError(e)}},r,i)}parse(e,n){function r(I,N){const H=[],$=I.childNodes;for(let V=0,pe=$.length;V0&&N.push(new hl($+".position",V,pe)),ye.length>0&&N.push(new Ic($+".quaternion",V,ye)),Xe.length>0&&N.push(new hl($+".scale",V,Xe)),N}function P(I,N,H){let $,V=!0,pe,ye;for(pe=0,ye=I.length;pe=0;){const $=I[N];if($.value[H]!==null)return $;N--}return null}function k(I,N,H){for(;N>>0)+2);switch(H=H.toLowerCase(),H){case"tga":N=wr;break;default:N=Lr}return N}function be(I){const N=B(I.url),H=N.profile.technique;let $;switch(H.type){case"phong":case"blinn":$=new Fo;break;case"lambert":$=new Ree;break;default:$=new sa;break}$.name=I.name||"";function V(De,$e=null){const lt=N.profile.samplers[De.id];let Ae=null;if(lt!==void 0){const at=N.profile.surfaces[lt.source];Ae=ce(at.init_from)}else console.warn("THREE.ColladaLoader: Undefined sampler. Access image directly (see #12530)."),Ae=ce(De.id);if(Ae!==null){const at=me(Ae);if(at!==void 0){const Qe=at.load(Ae),yt=De.extra;if(yt!==void 0&&yt.technique!==void 0&&c(yt.technique)===!1){const dt=yt.technique;Qe.wrapS=dt.wrapU?aa:Ji,Qe.wrapT=dt.wrapV?aa:Ji,Qe.offset.set(dt.offsetU||0,dt.offsetV||0),Qe.repeat.set(dt.repeatU||1,dt.repeatV||1)}else Qe.wrapS=aa,Qe.wrapT=aa;return $e!==null&&(Qe.colorSpace=$e),Qe}else return console.warn("THREE.ColladaLoader: Loader for texture %s not found.",Ae),null}else return console.warn("THREE.ColladaLoader: Couldn't create texture with ID:",De.id),null}const pe=H.parameters;for(const De in pe){const $e=pe[De];switch(De){case"diffuse":$e.color&&$.color.fromArray($e.color),$e.texture&&($.map=V($e.texture,Zt));break;case"specular":$e.color&&$.specular&&$.specular.fromArray($e.color),$e.texture&&($.specularMap=V($e.texture));break;case"bump":$e.texture&&($.normalMap=V($e.texture));break;case"ambient":$e.texture&&($.lightMap=V($e.texture,Zt));break;case"shininess":$e.float&&$.shininess&&($.shininess=$e.float);break;case"emission":$e.color&&$.emissive&&$.emissive.fromArray($e.color),$e.texture&&($.emissiveMap=V($e.texture,Zt));break}}Dt.colorSpaceToWorking($.color,Zt),$.specular&&Dt.colorSpaceToWorking($.specular,Zt),$.emissive&&Dt.colorSpaceToWorking($.emissive,Zt);let ye=pe.transparent,Xe=pe.transparency;if(Xe===void 0&&ye&&(Xe={float:1}),ye===void 0&&Xe&&(ye={opaque:"A_ONE",data:{color:[1,1,1,1]}}),ye&&Xe)if(ye.data.texture)$.transparent=!0;else{const De=ye.data.color;switch(ye.opaque){case"A_ONE":$.opacity=De[3]*Xe.float;break;case"RGB_ZERO":$.opacity=1-De[0]*Xe.float;break;case"A_ZERO":$.opacity=1-De[3]*Xe.float;break;case"RGB_ONE":$.opacity=De[0]*Xe.float;break;default:console.warn('THREE.ColladaLoader: Invalid opaque type "%s" of transparent tag.',ye.opaque)}$.opacity<1&&($.transparent=!0)}if(H.extra!==void 0&&H.extra.technique!==void 0){const De=H.extra.technique;for(const $e in De){const lt=De[$e];switch($e){case"double_sided":$.side=lt===1?Ki:va;break;case"bump":$.normalMap=V(lt.texture),$.normalScale=new xt(1,1);break}}}return $}function ge(I){return v(Et.materials[I],be)}function rt(I){const N={name:I.getAttribute("name")};for(let H=0,$=I.childNodes.length;H<$;H++){const V=I.childNodes[H];if(V.nodeType===1)switch(V.nodeName){case"optics":N.optics=Ie(V);break}}Et.cameras[I.getAttribute("id")]=N}function Ie(I){for(let N=0;N0?ye+De:ye;N.inputs[$e]={id:pe,offset:Xe},N.stride=Math.max(N.stride,Xe+1),ye==="TEXCOORD"&&(N.hasUV=!0);break;case"vcount":N.vcount=a(V.textContent);break;case"p":N.p=a(V.textContent);break}}return N}function _e(I){const N={};for(let H=0;H0&&N0&&Ae.setAttribute("position",new Qt(V.array,V.stride)),pe.array.length>0&&Ae.setAttribute("normal",new Qt(pe.array,pe.stride)),De.array.length>0&&Ae.setAttribute("color",new Qt(De.array,De.stride)),ye.array.length>0&&Ae.setAttribute("uv",new Qt(ye.array,ye.stride)),Xe.array.length>0&&Ae.setAttribute("uv1",new Qt(Xe.array,Xe.stride)),$e.array.length>0&&Ae.setAttribute("skinIndex",new Qt($e.array,$e.stride)),lt.array.length>0&&Ae.setAttribute("skinWeight",new Qt(lt.array,lt.stride)),$.data=Ae,$.type=I[0].type,$.materialKeys=at,$}function pt(I,N,H,$,V=!1){const pe=I.p,ye=I.stride,Xe=I.vcount;function De(Ae){let at=pe[Ae+H]*lt;const Qe=at+lt;for(;at4)for(let dt=1,Cn=yt-2;dt<=Cn;dt++){const en=Ae+ye*0,Gt=Ae+ye*dt,Wt=Ae+ye*(dt+1);De(en),De(Gt),De(Wt)}Ae+=ye*yt}}else for(let Ae=0,at=pe.length;Ae=N.limits.max&&(N.static=!0),N.middlePosition=(N.limits.min+N.limits.max)/2,N}function zf(I){const N={sid:I.getAttribute("sid"),name:I.getAttribute("name")||"",attachments:[],transforms:[]};for(let H=0;HQe.limits.max||Aer===null?null:parseFloat(r)),(!this.origPosition||!this.origQuaternion)&&(this.origPosition=this.position.clone(),this.origQuaternion=this.quaternion.clone());let n=!1;switch(this.mimicJoints.forEach(r=>{n=r.updateFromMimickedJoint(...e)||n}),this.jointType){case"fixed":return n;case"continuous":case"revolute":{let r=e[0];return r==null||r===this.jointValue[0]?n:(!this.ignoreLimits&&this.jointType==="revolute"&&(r=Math.min(this.limit.upper,r),r=Math.max(this.limit.lower,r)),this.quaternion.setFromAxisAngle(this.axis,r).premultiply(this.origQuaternion),this.jointValue[0]!==r?(this.jointValue[0]=r,this.matrixWorldNeedsUpdate=!0,!0):n)}case"prismatic":{let r=e[0];return r==null||r===this.jointValue[0]?n:(this.ignoreLimits||(r=Math.min(this.limit.upper,r),r=Math.max(this.limit.lower,r)),this.position.copy(this.origPosition),t2.copy(this.axis).applyEuler(this.rotation),this.position.addScaledVector(t2,r),this.jointValue[0]!==r?(this.jointValue[0]=r,this.matrixWorldNeedsUpdate=!0,!0):n)}case"floating":return this.jointValue.every((r,i)=>e[i]===r||e[i]===null)?n:(this.jointValue[0]=e[0]!==null?e[0]:this.jointValue[0],this.jointValue[1]=e[1]!==null?e[1]:this.jointValue[1],this.jointValue[2]=e[2]!==null?e[2]:this.jointValue[2],this.jointValue[3]=e[3]!==null?e[3]:this.jointValue[3],this.jointValue[4]=e[4]!==null?e[4]:this.jointValue[4],this.jointValue[5]=e[5]!==null?e[5]:this.jointValue[5],ws.compose(this.origPosition,this.origQuaternion,rv),nv.setFromEuler(rae.set(this.jointValue[3],this.jointValue[4],this.jointValue[5],"XYZ")),iv.set(this.jointValue[0],this.jointValue[1],this.jointValue[2]),tv.compose(iv,nv,rv),ws.premultiply(tv),this.position.setFromMatrixPosition(ws),this.rotation.setFromRotationMatrix(ws),this.matrixWorldNeedsUpdate=!0,!0);case"planar":return this.jointValue.every((r,i)=>e[i]===r||e[i]===null)?n:(this.jointValue[0]=e[0]!==null?e[0]:this.jointValue[0],this.jointValue[1]=e[1]!==null?e[1]:this.jointValue[1],this.jointValue[2]=e[2]!==null?e[2]:this.jointValue[2],ws.compose(this.origPosition,this.origQuaternion,rv),nv.setFromAxisAngle(this.axis,this.jointValue[2]),iv.set(this.jointValue[0],this.jointValue[1],0),tv.compose(iv,nv,rv),ws.premultiply(tv),this.position.setFromMatrixPosition(ws),this.rotation.setFromRotationMatrix(ws),this.matrixWorldNeedsUpdate=!0,!0)}return n}}class n2 extends i${constructor(...e){super(...e),this.type="URDFMimicJoint",this.mimicJoint=null,this.offset=0,this.multiplier=1}updateFromMimickedJoint(...e){const n=e.map(r=>r*this.multiplier+this.offset);return super.setJointValue(...n)}copy(e,n){return super.copy(e,n),this.mimicJoint=e.mimicJoint,this.offset=e.offset,this.multiplier=e.multiplier,this}}class aae extends r${constructor(...e){super(...e),this.isURDFRobot=!0,this.urdfNode=null,this.urdfRobotNode=null,this.robotName=null,this.links=null,this.joints=null,this.colliders=null,this.visual=null,this.frames=null}copy(e,n){super.copy(e,n),this.urdfRobotNode=e.urdfRobotNode,this.robotName=e.robotName,this.links={},this.joints={},this.colliders={},this.visual={},this.traverse(r=>{r.isURDFJoint&&r.urdfName in e.joints&&(this.joints[r.urdfName]=r),r.isURDFLink&&r.urdfName in e.links&&(this.links[r.urdfName]=r),r.isURDFCollider&&r.urdfName in e.colliders&&(this.colliders[r.urdfName]=r),r.isURDFVisual&&r.urdfName in e.visual&&(this.visual[r.urdfName]=r)});for(const r in this.joints)this.joints[r].mimicJoints=this.joints[r].mimicJoints.map(i=>this.joints[i.name]);return this.frames={...this.colliders,...this.visual,...this.links,...this.joints},this}getFrame(e){return this.frames[e]}setJointValue(e,...n){const r=this.joints[e];return r?r.setJointValue(...n):!1}setJointValues(e){let n=!1;for(const r in e){const i=e[r];Array.isArray(i)?n=this.setJointValue(r,...i)||n:n=this.setJointValue(r,i)||n}return n}}const Tw=new Ii,r2=new pi;function _u(t){return t?t.trim().split(/\s+/g).map(e=>parseFloat(e)):[0,0,0]}function i2(t,e,n=!1){n||t.rotation.set(0,0,0),r2.set(e[0],e[1],e[2],"ZYX"),Tw.setFromEuler(r2),Tw.multiply(t.quaternion),t.quaternion.copy(Tw)}class sae{constructor(e){this.manager=e||V4,this.loadMeshCb=this.defaultMeshLoader.bind(this),this.parseVisual=!0,this.parseCollision=!1,this.packages="",this.workingPath="",this.fetchOptions={}}loadAsync(e){return new Promise((n,r)=>{this.load(e,n,null,r)})}load(e,n,r,i){const o=this.manager,a=mc.extractUrlBase(e),s=this.manager.resolveURL(e);o.itemStart(s),fetch(s,this.fetchOptions).then(l=>{if(l.ok)return r&&r(null),l.text();throw new Error(`URDFLoader: Failed to load url '${s}' with error code ${l.status} : ${l.statusText}.`)}).then(l=>{const c=this.parse(l,this.workingPath||a);n(c),o.itemEnd(s)}).catch(l=>{i?i(l):console.error("URDFLoader: Error loading file.",l),o.itemError(s),o.itemEnd(s)})}parse(e,n=this.workingPath){const r=this.packages,i=this.loadMeshCb,o=this.parseVisual,a=this.parseCollision,s=this.manager,l={},c={},u={};function d(x){if(!/^package:\/\//.test(x))return n?n+x:x;const[b,S]=x.replace(/^package:\/\//,"").split(/\/(.+)/);if(typeof r=="string")return r.endsWith(b)?r+"/"+S:r+"/"+b+"/"+S;if(r instanceof Function)return r(b)+"/"+S;if(typeof r=="object")return b in r?r[b]+"/"+S:(console.error(`URDFLoader : ${b} not found in provided package list.`),null)}function f(x){let b;x instanceof Document?b=[...x.children]:x instanceof Element?b=[x]:b=[...new DOMParser().parseFromString(x,"text/xml").children];const S=b.filter(w=>w.nodeName==="robot").pop();return p(S)}function p(x){const b=[...x.children],S=b.filter(P=>P.nodeName.toLowerCase()==="link"),w=b.filter(P=>P.nodeName.toLowerCase()==="joint"),E=b.filter(P=>P.nodeName.toLowerCase()==="material"),T=new aae;T.robotName=x.getAttribute("name"),T.urdfRobotNode=x,E.forEach(P=>{const R=P.getAttribute("name");u[R]=g(P)});const A={},M={};S.forEach(P=>{const R=P.getAttribute("name"),D=x.querySelector(`child[link="${R}"]`)===null;l[R]=v(P,A,M,D?T:null)}),w.forEach(P=>{const R=P.getAttribute("name");c[R]=y(P)}),T.joints=c,T.links=l,T.colliders=M,T.visual=A;const C=Object.values(c);return C.forEach(P=>{P instanceof n2&&c[P.mimicJoint].mimicJoints.push(P)}),C.forEach(P=>{const R=new Set,D=k=>{if(R.has(k))throw new Error("URDFLoader: Detected an infinite loop of mimic joints.");R.add(k),k.mimicJoints.forEach(U=>{D(U)})};D(P)}),T.frames={...M,...A,...l,...c},T}function y(x){const b=[...x.children],S=x.getAttribute("type");let w;const E=b.find(R=>R.nodeName.toLowerCase()==="mimic");E?(w=new n2,w.mimicJoint=E.getAttribute("joint"),w.multiplier=parseFloat(E.getAttribute("multiplier")||1),w.offset=parseFloat(E.getAttribute("offset")||0)):w=new i$,w.urdfNode=x,w.name=x.getAttribute("name"),w.urdfName=w.name,w.jointType=S;let T=null,A=null,M=[0,0,0],C=[0,0,0];b.forEach(R=>{const D=R.nodeName.toLowerCase();D==="origin"?(M=_u(R.getAttribute("xyz")),C=_u(R.getAttribute("rpy"))):D==="child"?A=l[R.getAttribute("link")]:D==="parent"?T=l[R.getAttribute("link")]:D==="limit"&&(w.limit.lower=parseFloat(R.getAttribute("lower")||w.limit.lower),w.limit.upper=parseFloat(R.getAttribute("upper")||w.limit.upper))}),T.add(w),w.add(A),i2(w,C),w.position.set(M[0],M[1],M[2]);const P=b.filter(R=>R.nodeName.toLowerCase()==="axis")[0];if(P){const R=P.getAttribute("xyz").split(/\s+/g).map(D=>parseFloat(D));w.axis=new ne(R[0],R[1],R[2]),w.axis.normalize()}return w}function v(x,b,S,w=null){w===null&&(w=new r$);const E=[...x.children];return w.name=x.getAttribute("name"),w.urdfName=w.name,w.urdfNode=x,o&&E.filter(A=>A.nodeName.toLowerCase()==="visual").forEach(A=>{const M=m(A,u);if(w.add(M),A.hasAttribute("name")){const C=A.getAttribute("name");M.name=C,M.urdfName=C,b[C]=M}}),a&&E.filter(A=>A.nodeName.toLowerCase()==="collision").forEach(A=>{const M=m(A);if(w.add(M),A.hasAttribute("name")){const C=A.getAttribute("name");M.name=C,M.urdfName=C,S[C]=M}}),w}function g(x){const b=[...x.children],S=new Fo;return S.name=x.getAttribute("name")||"",b.forEach(w=>{const E=w.nodeName.toLowerCase();if(E==="color"){const T=w.getAttribute("rgba").split(/\s/g).map(A=>parseFloat(A));S.color.setRGB(T[0],T[1],T[2]),S.opacity=T[3],S.transparent=T[3]<1,S.depthWrite=!S.transparent}else if(E==="texture"){const T=w.getAttribute("filename");if(T){const A=new nC(s),M=d(T);S.map=A.load(M),S.map.colorSpace=Zt}}}),S}function m(x,b={}){const S=x.nodeName.toLowerCase()==="collision",w=[...x.children];let E=null;const T=w.filter(M=>M.nodeName.toLowerCase()==="material")[0];if(T){const M=T.getAttribute("name");M&&M in b?E=b[M]:E=g(T)}else E=new Fo;const A=S?new iae:new oae;return A.urdfNode=x,w.forEach(M=>{const C=M.nodeName.toLowerCase();if(C==="geometry"){const P=M.children[0].nodeName.toLowerCase();if(P==="mesh"){const R=M.children[0].getAttribute("filename"),D=d(R);if(D!==null){const k=M.children[0].getAttribute("scale");if(k){const U=_u(k);A.scale.set(U[0],U[1],U[2])}i(D,s,(U,O)=>{O?console.error("URDFLoader: Error loading mesh.",O):U&&(U instanceof Mn&&(U.material=E),U.position.set(0,0,0),U.quaternion.identity(),A.add(U))})}}else if(P==="box"){const R=new Mn;R.geometry=new Gc(1,1,1),R.material=E;const D=_u(M.children[0].getAttribute("size"));R.scale.set(D[0],D[1],D[2]),A.add(R)}else if(P==="sphere"){const R=new Mn;R.geometry=new eC(1,30,30),R.material=E;const D=parseFloat(M.children[0].getAttribute("radius"))||0;R.scale.set(D,D,D),A.add(R)}else if(P==="cylinder"){const R=new Mn;R.geometry=new QA(1,1,1,30),R.material=E;const D=parseFloat(M.children[0].getAttribute("radius"))||0,k=parseFloat(M.children[0].getAttribute("length"))||0;R.scale.set(D,k,D),R.rotation.set(Math.PI/2,0,0),A.add(R)}}else if(C==="origin"){const P=_u(M.getAttribute("xyz")),R=_u(M.getAttribute("rpy"));A.position.set(P[0],P[1],P[2]),A.rotation.set(0,0,0),i2(A,R)}}),A}return f(e)}defaultMeshLoader(e,n,r){/\.stl$/i.test(e)?new t$(n).load(e,o=>{const a=new Mn(o,new Fo);r(a)}):/\.dae$/i.test(e)?new n$(n).load(e,o=>r(o.scene)):console.warn(`URDFLoader: Could not load model at ${e}. -No loader available`)}}const lae=new xt,cae=()=>{};class uae extends HTMLElement{static get observedAttributes(){return["package","urdf","up","display-shadow","ambient-color","ignore-limits","show-collision"]}get package(){return this.getAttribute("package")||""}set package(e){this.setAttribute("package",e)}get urdf(){return this.getAttribute("urdf")||""}set urdf(e){this.setAttribute("urdf",e)}get ignoreLimits(){return this.hasAttribute("ignore-limits")||!1}set ignoreLimits(e){e?this.setAttribute("ignore-limits",e):this.removeAttribute("ignore-limits")}get up(){return this.getAttribute("up")||"+Z"}set up(e){this.setAttribute("up",e)}get displayShadow(){return this.hasAttribute("display-shadow")||!1}set displayShadow(e){e?this.setAttribute("display-shadow",""):this.removeAttribute("display-shadow")}get ambientColor(){return this.getAttribute("ambient-color")||"#8ea0a8"}set ambientColor(e){e?this.setAttribute("ambient-color",e):this.removeAttribute("ambient-color")}get autoRedraw(){return this.hasAttribute("auto-redraw")||!1}set autoRedraw(e){e?this.setAttribute("auto-redraw",!0):this.removeAttribute("auto-redraw")}get noAutoRecenter(){return this.hasAttribute("no-auto-recenter")||!1}set noAutoRecenter(e){e?this.setAttribute("no-auto-recenter",!0):this.removeAttribute("no-auto-recenter")}get showCollision(){return this.hasAttribute("show-collision")||!1}set showCollision(e){e?this.setAttribute("show-collision",!0):this.removeAttribute("show-collision")}get jointValues(){const e={};if(this.robot)for(const n in this.robot.joints){const r=this.robot.joints[n];e[n]=r.jointValue.length===1?r.angle:[...r.jointValue]}return e}set jointValues(e){this.setJointValues(e)}get angles(){return this.jointValues}set angles(e){this.jointValues=e}constructor(){super(),this._requestId=0,this._dirty=!1,this._loadScheduled=!1,this.robot=null,this.loadMeshFunc=null,this.urlModifierFunc=null;const e=new U4,n=new Vee(this.ambientColor,"#000");n.groundColor.lerp(n.color,.5*Math.PI),n.intensity=.5,n.position.set(0,1,0),e.add(n);const r=new Bx(16777215,Math.PI);r.position.set(4,10,1),r.shadow.mapSize.width=2048,r.shadow.mapSize.height=2048,r.shadow.normalBias=.001,r.castShadow=!0,e.add(r),e.add(r.target);const i=new zoe({antialias:!0,alpha:!0});i.setClearColor(16777215),i.setClearAlpha(0),i.shadowMap.enabled=!0,i.shadowMap.type=y4,i.outputColorSpace=Zt;const o=new gr(75,1,.1,1e3);o.position.z=-10;const a=new vn;e.add(a);const s=new Mn(new Om(40,40),new Pee({side:Ki,transparent:!0,opacity:.25}));s.rotation.x=-Math.PI/2,s.position.y=-.5,s.receiveShadow=!0,s.scale.set(10,10,10),e.add(s);const l=new Voe(o,i.domElement);l.rotateSpeed=2,l.zoomSpeed=5,l.panSpeed=2,l.enableZoom=!0,l.enableDamping=!1,l.maxDistance=50,l.minDistance=.25,l.addEventListener("change",()=>this.recenter()),this.scene=e,this.world=a,this.renderer=i,this.camera=o,this.controls=l,this.plane=s,this.directionalLight=r,this.ambientLight=n,this._setUp(this.up),this._collisionMaterial=new Fo({transparent:!0,opacity:.35,shininess:2.5,premultipliedAlpha:!0,color:16760376,polygonOffset:!0,polygonOffsetFactor:-1,polygonOffsetUnits:-1});const c=()=>{this.parentNode&&(this.updateSize(),(this._dirty||this.autoRedraw)&&(this.noAutoRecenter||this._updateEnvironment(),this.renderer.render(e,o),this._dirty=!1),this.controls.update()),this._renderLoopId=requestAnimationFrame(c)};c()}connectedCallback(){if(!this.constructor._styletag){const e=document.createElement("style");e.innerHTML=` - ${this.tagName} { display: block; } - ${this.tagName} canvas { - width: 100%; - height: 100%; - } - `,document.head.appendChild(e),this.constructor._styletag=e}this.childElementCount===0&&this.appendChild(this.renderer.domElement),this.updateSize(),requestAnimationFrame(()=>this.updateSize())}disconnectedCallback(){cancelAnimationFrame(this._renderLoopId)}attributeChangedCallback(e,n,r){switch(this._updateCollisionVisibility(),this.noAutoRecenter||this.recenter(),e){case"package":case"urdf":{this._scheduleLoad();break}case"up":{this._setUp(this.up);break}case"ambient-color":{this.ambientLight.color.set(this.ambientColor),this.ambientLight.groundColor.set("#000").lerp(this.ambientLight.color,.5);break}case"ignore-limits":{this._setIgnoreLimits(this.ignoreLimits,!0);break}}}updateSize(){const e=this.renderer,n=this.clientWidth,r=this.clientHeight,i=e.getSize(lae);(i.width!==n||i.height!==r)&&this.recenter(),e.setPixelRatio(window.devicePixelRatio),e.setSize(n,r,!1),this.camera.aspect=n/r,this.camera.updateProjectionMatrix()}redraw(){this._dirty=!0}recenter(){this._updateEnvironment(),this.redraw()}setJointValue(e,...n){this.robot&&this.robot.joints[e]&&this.robot.joints[e].setJointValue(...n)&&(this.redraw(),this.dispatchEvent(new CustomEvent("angle-change",{bubbles:!0,cancelable:!0,detail:e})))}setJointValues(e){for(const n in e)this.setJointValue(n,e[n])}_updateEnvironment(){const e=this.robot;if(!e)return;this.world.updateMatrixWorld();const n=new Wo;n.makeEmpty(),e.traverse(o=>{o.isURDFVisual&&n.expandByObject(o)});const r=n.getCenter(new ne);this.controls.target.y=r.y,this.plane.position.y=n.min.y-.001;const i=this.directionalLight;if(i.castShadow=this.displayShadow,this.displayShadow){const a=n.getBoundingSphere(new Xo).radius,s=i.shadow.camera;s.left=s.bottom=-a,s.right=s.top=a;const l=i.position.clone().sub(i.target.position);i.target.position.copy(r),i.position.copy(r).add(l),s.updateProjectionMatrix()}}_scheduleLoad(){this._prevload!==`${this.package}|${this.urdf}`&&(this._prevload=`${this.package}|${this.urdf}`,!this._loadScheduled&&(this._loadScheduled=!0,this.robot&&(this.robot.traverse(e=>e.dispose&&e.dispose()),this.robot.parent.remove(this.robot),this.robot=null),requestAnimationFrame(()=>{this._loadUrdf(this.package,this.urdf),this._loadScheduled=!1})))}_loadUrdf(e,n){if(this.dispatchEvent(new CustomEvent("urdf-change",{bubbles:!0,cancelable:!0,composed:!0})),n){this._requestId++;const r=this._requestId,i=l=>{l.traverse(c=>{if(c.isMesh&&(c.castShadow=!0,c.receiveShadow=!0,c.material)){const u=(Array.isArray(c.material)?c.material:[c.material]).map(d=>(d instanceof sa&&(d=new Fo),d.map&&(d.map.colorSpace=Zt),d));c.material=u.length===1?u[0]:u}})};e.includes(":")&&e.split(":")[1].substring(0,2)!=="//"&&(e=e.split(",").reduce((l,c)=>{const u=c.split(/:/).filter(p=>!!p),d=u.shift().trim(),f=u.join(":").trim();return l[d]=f,l},{}));let o=null;const a=new H4;a.onLoad=()=>{if(this._requestId!==r){o.traverse(l=>l.dispose&&l.dispose());return}this.robot=o,this.world.add(o),i(o),this._setIgnoreLimits(this.ignoreLimits),this._updateCollisionVisibility(),this.dispatchEvent(new CustomEvent("urdf-processed",{bubbles:!0,cancelable:!0,composed:!0})),this.dispatchEvent(new CustomEvent("geometry-loaded",{bubbles:!0,cancelable:!0,composed:!0})),this.recenter()},this.urlModifierFunc&&a.setURLModifier(this.urlModifierFunc);const s=new sae(a);s.packages=e,s.loadMeshCb=this.loadMeshFunc,s.fetchOptions={mode:"cors",credentials:"same-origin"},s.parseCollision=!0,s.load(n,l=>o=l)}}_updateCollisionVisibility(){const e=this.showCollision,n=this._collisionMaterial,r=this.robot;if(r===null)return;const i=[];r.traverse(o=>{o.isURDFCollider&&(o.visible=e,i.push(o))}),i.forEach(o=>{o.traverse(a=>{a.isMesh&&(a.raycast=cae,a.material=n,a.castShadow=!1)})})}_setUp(e){e||(e="+Z"),e=e.toUpperCase();const n=e.replace(/[^-+]/g,"")[0]||"+",r=e.replace(/[^XYZ]/gi,"")[0]||"Z",i=Math.PI,o=i/2;r==="X"&&this.world.rotation.set(0,0,n==="+"?o:-o),r==="Z"&&this.world.rotation.set(n==="+"?-o:o,0,0),r==="Y"&&this.world.rotation.set(n==="+"?0:i,0,0)}_setIgnoreLimits(e,n=!1){this.robot&&Object.values(this.robot.joints).forEach(r=>{r.ignoreLimits=e,r.setJointValue(...r.jointValue)}),n&&this.dispatchEvent(new CustomEvent("ignore-limits-change",{bubbles:!0,cancelable:!0,composed:!0}))}}function dae(t){return t.isURDFJoint&&t.jointType!=="fixed"}function fae(t){let e=t;for(;e;){if(dae(e))return e;e=e.parent}return e}const Mw=new ne,Aw=new ne,Gu=new ne,ri=new ne,o2=new ne,Rh=new ne,Nh=new ne,Ao=new Ua;class hae{constructor(e){this.enabled=!0,this.scene=e,this.raycaster=new q4,this.initialGrabPoint=new ne,this.hitDistance=-1,this.hovered=null,this.manipulating=null}update(){const{raycaster:e,hovered:n,manipulating:r,scene:i}=this;if(r)return;let o=null;const a=e.intersectObject(i,!0);if(a.length!==0){const s=a[0];this.hitDistance=s.distance,o=fae(s.object),this.initialGrabPoint.copy(s.point)}o!==n&&(n&&this.onUnhover(n),this.hovered=o,o&&this.onHover(o))}updateJoint(e,n){e.setJointValue(n)}onDragStart(e){}onDragEnd(e){}onHover(e){}onUnhover(e){}getRevoluteDelta(e,n,r){return ri.copy(e.axis).transformDirection(e.matrixWorld).normalize(),Gu.set(0,0,0).applyMatrix4(e.matrixWorld),Ao.setFromNormalAndCoplanarPoint(ri,Gu),Ao.projectPoint(n,Rh),Ao.projectPoint(r,Nh),Rh.sub(Gu),Nh.sub(Gu),ri.crossVectors(Rh,Nh),Math.sign(ri.dot(Ao.normal))*Nh.angleTo(Rh)}getPrismaticDelta(e,n,r){return ri.subVectors(r,n),Ao.normal.copy(e.axis).transformDirection(e.parent.matrixWorld).normalize(),ri.dot(Ao.normal)}moveRay(e){const{raycaster:n,hitDistance:r,manipulating:i}=this,{ray:o}=n;if(i){o.at(r,Mw),e.at(r,Aw);let a=0;i.jointType==="revolute"||i.jointType==="continuous"?a=this.getRevoluteDelta(i,Mw,Aw):i.jointType==="prismatic"&&(a=this.getPrismaticDelta(i,Mw,Aw)),a&&this.updateJoint(i,i.angle+a)}this.raycaster.ray.copy(e),this.update()}setGrabbed(e){const{hovered:n,manipulating:r}=this;if(e){if(r!==null||n===null)return;this.manipulating=n,this.onDragStart(n)}else{if(this.manipulating===null)return;this.onDragEnd(this.manipulating),this.manipulating=null,this.update()}}}class pae extends hae{constructor(e,n,r){super(e),this.camera=n,this.domElement=r;const i=new q4,o=new xt;function a(s){const l=r.getBoundingClientRect();o.x=(s.clientX-l.left)/l.width*2-1,o.y=-((s.clientY-l.top)/l.height)*2+1}this._mouseDown=s=>{a(s),i.setFromCamera(o,this.camera),this.moveRay(i.ray),this.setGrabbed(!0)},this._mouseMove=s=>{a(s),i.setFromCamera(o,this.camera),this.moveRay(i.ray)},this._mouseUp=s=>{a(s),i.setFromCamera(o,this.camera),this.moveRay(i.ray),this.setGrabbed(!1)},r.addEventListener("mousedown",this._mouseDown),r.addEventListener("mousemove",this._mouseMove),r.addEventListener("mouseup",this._mouseUp)}getRevoluteDelta(e,n,r){const{camera:i,initialGrabPoint:o}=this;return ri.copy(e.axis).transformDirection(e.matrixWorld).normalize(),Gu.set(0,0,0).applyMatrix4(e.matrixWorld),Ao.setFromNormalAndCoplanarPoint(ri,Gu),ri.copy(i.position).sub(o).normalize(),Math.abs(ri.dot(Ao.normal))>.3?super.getRevoluteDelta(e,n,r):(ri.set(0,1,0).transformDirection(i.matrixWorld),Ao.projectPoint(n,Rh),Ao.projectPoint(r,Nh),ri.set(0,0,-1).transformDirection(i.matrixWorld),ri.cross(Ao.normal),o2.subVectors(r,n),ri.dot(o2))}dispose(){const{domElement:e}=this;e.removeEventListener("mousedown",this._mouseDown),e.removeEventListener("mousemove",this._mouseMove),e.removeEventListener("mouseup",this._mouseUp)}}class mae extends uae{static get observedAttributes(){return["highlight-color",...super.observedAttributes]}get disableDragging(){return this.hasAttribute("disable-dragging")}set disableDragging(e){e?this.setAttribute("disable-dragging",!!e):this.removeAttribute("disable-dragging")}get highlightColor(){return this.getAttribute("highlight-color")||"#FFFFFF"}set highlightColor(e){e?this.setAttribute("highlight-color",e):this.removeAttribute("highlight-color")}constructor(...e){super(...e),this.highlightMaterial=new Fo({shininess:10,color:this.highlightColor,emissive:this.highlightColor,emissiveIntensity:.25});const n=a=>a.isURDFJoint&&a.jointType!=="fixed",r=(a,s)=>{const l=c=>{if(c.type==="Mesh"&&(s?(c.material=c.__origMaterial,delete c.__origMaterial):(c.__origMaterial=c.material,c.material=this.highlightMaterial)),c===a||!n(c))for(let u=0;u{this.dispatchEvent(new CustomEvent("manipulate-start",{bubbles:!0,cancelable:!0,detail:a.name})),this.controls.enabled=!1,this.redraw()},o.onDragEnd=a=>{this.dispatchEvent(new CustomEvent("manipulate-end",{bubbles:!0,cancelable:!0,detail:a.name})),this.controls.enabled=!0,this.redraw()},o.updateJoint=(a,s)=>{this.setJointValue(a.name,s)},o.onHover=a=>{r(a,!1),this.dispatchEvent(new CustomEvent("joint-mouseover",{bubbles:!0,cancelable:!0,detail:a.name})),this.redraw()},o.onUnhover=a=>{r(a,!0),this.dispatchEvent(new CustomEvent("joint-mouseout",{bubbles:!0,cancelable:!0,detail:a.name})),this.redraw()},this.dragControls=o}disconnectedCallback(){super.disconnectedCallback(),this.dragControls.dispose()}attributeChangedCallback(e,n,r){switch(super.attributeChangedCallback(e,n,r),e){case"highlight-color":this.highlightMaterial.color.set(this.highlightColor),this.highlightMaterial.emissive.set(this.highlightColor);break}}}const a2=1e3,gae=3e4,vae=({viewerRef:t,enabled:e=!0,websocketUrl:n})=>{const{wsBaseUrl:r}=Ln(),i=n||`${r}/ws/joint-data`,o=_.useRef(null),a=_.useRef(null),s=_.useRef(a2),l=_.useRef(!1),[c,u]=_.useState(!1),d=_.useCallback(f=>{const p=t.current;!p||typeof p.setJointValue!="function"||Object.entries(f).forEach(([y,v])=>{try{p.setJointValue(y,v)}catch(g){console.warn(`Failed to set joint ${y}:`,g)}})},[t]);return _.useEffect(()=>{if(!e)return;l.current=!1;const f=()=>{if(l.current)return;let y;try{y=new WebSocket(i)}catch(v){console.error("Failed to create WebSocket:",v),p();return}o.current=y,y.onopen=()=>{u(!0),s.current=a2,a.current&&(clearTimeout(a.current),a.current=null)},y.onmessage=v=>{try{const g=JSON.parse(v.data);g.type==="joint_update"&&g.joints&&d(g.joints)}catch(g){console.error("Error parsing WebSocket message:",g)}},y.onclose=v=>{u(!1),o.current=null,!l.current&&v.code!==1e3&&p()},y.onerror=()=>{u(!1)}},p=()=>{if(a.current)return;const y=s.current;s.current=Math.min(y*2,gae),a.current=setTimeout(()=>{a.current=null,f()},y)};return f(),()=>{l.current=!0,a.current&&(clearTimeout(a.current),a.current=null),o.current&&(o.current.close(1e3),o.current=null),u(!1)}},[e,i,d]),{isConnected:c}};var s2=["light","dark"],yae="(prefers-color-scheme: dark)";_.createContext(void 0);_.memo(({forcedTheme:t,storageKey:e,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:o,value:a,attrs:s,nonce:l})=>{let c=o==="system",u=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${s.map(y=>`'${y}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,d=i?s2.includes(o)&&o?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${o}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",f=(y,v=!1,g=!0)=>{let m=a?a[y]:y,x=v?y+"|| ''":`'${m}'`,b="";return i&&g&&!v&&s2.includes(y)&&(b+=`d.style.colorScheme = '${y}';`),n==="class"?v||m?b+=`c.add(${x})`:b+="null":m&&(b+=`d[s](n,${x})`),b},p=t?`!function(){${u}${f(t)}}()`:r?`!function(){try{${u}var e=localStorage.getItem('${e}');if('system'===e||(!e&&${c})){var t='${yae}',m=window.matchMedia(t);if(m.media!==t||m.matches){${f("dark")}}else{${f("light")}}}else if(e){${a?`var x=${JSON.stringify(a)};`:""}${f(a?"x[e]":"e",!0)}}${c?"":"else{"+f(o,!1,!1)+"}"}${d}}catch(e){}}()`:`!function(){try{${u}var e=localStorage.getItem('${e}');if(e){${a?`var x=${JSON.stringify(a)};`:""}${f(a?"x[e]":"e",!0)}}else{${f(o,!1,!1)};}${d}}catch(t){}}();`;return _.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:p}})});function l2(t,e){if(e===bQ)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),t;if(e===d1||e===C4){let n=t.getIndex();if(n===null){const a=[],s=t.getAttribute("position");if(s!==void 0){for(let l=0;l=2.0 are supported."));return}const c=new Zae(o,{path:n||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u=0&&s[d]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+d+'".')}}c.setExtensions(a),c.setPlugins(s),c.parse(r,i)}parseAsync(e,n){const r=this;return new Promise(function(i,o){r.parse(e,n,i,o)})}}function bae(){let t={};return{get:function(e){return t[e]},add:function(e,n){t[e]=n},remove:function(e){delete t[e]},removeAll:function(){t={}}}}const Lt={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class _ae{constructor(e){this.parser=e,this.name=Lt.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,n=this.parser.json.nodes||[];for(let r=0,i=n.length;r=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return n.loadTextureImage(e,o.source,a)}}class Lae{constructor(e){this.parser=e,this.name=Lt.EXT_TEXTURE_WEBP}loadTexture(e){const n=this.name,r=this.parser,i=r.json,o=i.textures[e];if(!o.extensions||!o.extensions[n])return null;const a=o.extensions[n],s=i.images[a.source];let l=r.textureLoader;if(s.uri){const c=r.options.manager.getHandler(s.uri);c!==null&&(l=c)}return r.loadTextureImage(e,a.source,l)}}class kae{constructor(e){this.parser=e,this.name=Lt.EXT_TEXTURE_AVIF}loadTexture(e){const n=this.name,r=this.parser,i=r.json,o=i.textures[e];if(!o.extensions||!o.extensions[n])return null;const a=o.extensions[n],s=i.images[a.source];let l=r.textureLoader;if(s.uri){const c=r.options.manager.getHandler(s.uri);c!==null&&(l=c)}return r.loadTextureImage(e,a.source,l)}}class jae{constructor(e){this.name=Lt.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const n=this.parser.json,r=n.bufferViews[e];if(r.extensions&&r.extensions[this.name]){const i=r.extensions[this.name],o=this.parser.getDependency("buffer",i.buffer),a=this.parser.options.meshoptDecoder;if(!a||!a.supported){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return o.then(function(s){const l=i.byteOffset||0,c=i.byteLength||0,u=i.count,d=i.byteStride,f=new Uint8Array(s,l,c);return a.decodeGltfBufferAsync?a.decodeGltfBufferAsync(u,d,f,i.mode,i.filter).then(function(p){return p.buffer}):a.ready.then(function(){const p=new ArrayBuffer(u*d);return a.decodeGltfBuffer(new Uint8Array(p),u,d,f,i.mode,i.filter),p})})}else return null}}class Uae{constructor(e){this.name=Lt.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const n=this.parser.json,r=n.nodes[e];if(!r.extensions||!r.extensions[this.name]||r.mesh===void 0)return null;const i=n.meshes[r.mesh];for(const c of i.primitives)if(c.mode!==Vi.TRIANGLES&&c.mode!==Vi.TRIANGLE_STRIP&&c.mode!==Vi.TRIANGLE_FAN&&c.mode!==void 0)return null;const a=r.extensions[this.name].attributes,s=[],l={};for(const c in a)s.push(this.parser.getDependency("accessor",a[c]).then(u=>(l[c]=u,l[c])));return s.length<1?null:(s.push(this.parser.createNodeMesh(e)),Promise.all(s).then(c=>{const u=c.pop(),d=u.isGroup?u.children:[u],f=c[0].count,p=[];for(const y of d){const v=new gt,g=new ne,m=new Ii,x=new ne(1,1,1),b=new Tee(y.geometry,y.material,f);for(let S=0;S0||t.search(/^data\:image\/jpeg/)===0?"image/jpeg":t.search(/\.webp($|\?)/i)>0||t.search(/^data\:image\/webp/)===0?"image/webp":t.search(/\.ktx2($|\?)/i)>0||t.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const Jae=new gt;class Zae{constructor(e={},n={}){this.json=e,this.extensions={},this.plugins={},this.options=n,this.cache=new bae,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let r=!1,i=-1,o=!1,a=-1;if(typeof navigator<"u"){const s=navigator.userAgent;r=/^((?!chrome|android).)*safari/i.test(s)===!0;const l=s.match(/Version\/(\d+)/);i=r&&l?parseInt(l[1],10):-1,o=s.indexOf("Firefox")>-1,a=o?s.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||r&&i<17||o&&a<98?this.textureLoader=new nC(this.options.manager):this.textureLoader=new qee(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Mf(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,n){const r=this,i=this.json,o=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(a){return a._markDefs&&a._markDefs()}),Promise.all(this._invokeAll(function(a){return a.beforeRoot&&a.beforeRoot()})).then(function(){return Promise.all([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])}).then(function(a){const s={scene:a[0][i.scene||0],scenes:a[0],animations:a[1],cameras:a[2],asset:i.asset,parser:r,userData:{}};return Ul(o,s,i),ka(s,i),Promise.all(r._invokeAll(function(l){return l.afterRoot&&l.afterRoot(s)})).then(function(){for(const l of s.scenes)l.updateMatrixWorld();e(s)})}).catch(n)}_markDefs(){const e=this.json.nodes||[],n=this.json.skins||[],r=this.json.meshes||[];for(let i=0,o=n.length;i{const l=this.associations.get(a);l!=null&&this.associations.set(s,l);for(const[c,u]of a.children.entries())o(u,s.children[c])};return o(r,i),i.name+="_instance_"+e.uses[n]++,i}_invokeOne(e){const n=Object.values(this.plugins);n.push(this);for(let r=0;r=2&&g.setY(M,E[T*l+1]),l>=3&&g.setZ(M,E[T*l+2]),l>=4&&g.setW(M,E[T*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}g.normalized=y}return g})}loadTexture(e){const n=this.json,r=this.options,o=n.textures[e].source,a=n.images[o];let s=this.textureLoader;if(a.uri){const l=r.manager.getHandler(a.uri);l!==null&&(s=l)}return this.loadTextureImage(e,o,s)}loadTextureImage(e,n,r){const i=this,o=this.json,a=o.textures[e],s=o.images[n],l=(s.uri||s.bufferView)+":"+a.sampler;if(this.textureCache[l])return this.textureCache[l];const c=this.loadImageSource(n,r).then(function(u){u.flipY=!1,u.name=a.name||s.name||"",u.name===""&&typeof s.uri=="string"&&s.uri.startsWith("data:image/")===!1&&(u.name=s.uri);const f=(o.samplers||{})[a.sampler]||{};return u.magFilter=u2[f.magFilter]||Or,u.minFilter=u2[f.minFilter]||Oo,u.wrapS=d2[f.wrapS]||aa,u.wrapT=d2[f.wrapT]||aa,u.generateMipmaps=!u.isCompressedTexture&&u.minFilter!==Xr&&u.minFilter!==Or,i.associations.set(u,{textures:e}),u}).catch(function(){return null});return this.textureCache[l]=c,c}loadImageSource(e,n){const r=this,i=this.json,o=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(d=>d.clone());const a=i.images[e],s=self.URL||self.webkitURL;let l=a.uri||"",c=!1;if(a.bufferView!==void 0)l=r.getDependency("bufferView",a.bufferView).then(function(d){c=!0;const f=new Blob([d],{type:a.mimeType});return l=s.createObjectURL(f),l});else if(a.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const u=Promise.resolve(l).then(function(d){return new Promise(function(f,p){let y=f;n.isImageBitmapLoader===!0&&(y=function(v){const g=new lr(v);g.needsUpdate=!0,f(g)}),n.load(mc.resolveURL(d,o.path),y,void 0,p)})}).then(function(d){return c===!0&&s.revokeObjectURL(l),ka(d,a),d.userData.mimeType=a.mimeType||Yae(a.uri),d}).catch(function(d){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),d});return this.sourceCache[e]=u,u}assignTexture(e,n,r,i){const o=this;return this.getDependency("texture",r.index).then(function(a){if(!a)return null;if(r.texCoord!==void 0&&r.texCoord>0&&(a=a.clone(),a.channel=r.texCoord),o.extensions[Lt.KHR_TEXTURE_TRANSFORM]){const s=r.extensions!==void 0?r.extensions[Lt.KHR_TEXTURE_TRANSFORM]:void 0;if(s){const l=o.associations.get(a);a=o.extensions[Lt.KHR_TEXTURE_TRANSFORM].extendTexture(a,s),o.associations.set(a,l)}}return i!==void 0&&(a.colorSpace=i),e[n]=a,a})}assignFinalMaterial(e){const n=e.geometry;let r=e.material;const i=n.attributes.tangent===void 0,o=n.attributes.color!==void 0,a=n.attributes.normal===void 0;if(e.isPoints){const s="PointsMaterial:"+r.uuid;let l=this.cache.get(s);l||(l=new Hu,qr.prototype.copy.call(l,r),l.color.copy(r.color),l.map=r.map,l.sizeAttenuation=!1,this.cache.add(s,l)),r=l}else if(e.isLine){const s="LineBasicMaterial:"+r.uuid;let l=this.cache.get(s);l||(l=new pc,qr.prototype.copy.call(l,r),l.color.copy(r.color),l.map=r.map,this.cache.add(s,l)),r=l}if(i||o||a){let s="ClonedMaterial:"+r.uuid+":";i&&(s+="derivative-tangents:"),o&&(s+="vertex-colors:"),a&&(s+="flat-shading:");let l=this.cache.get(s);l||(l=r.clone(),o&&(l.vertexColors=!0),a&&(l.flatShading=!0),i&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(s,l),this.associations.set(l,this.associations.get(r))),r=l}e.material=r}getMaterialType(){return tC}loadMaterial(e){const n=this,r=this.json,i=this.extensions,o=r.materials[e];let a;const s={},l=o.extensions||{},c=[];if(l[Lt.KHR_MATERIALS_UNLIT]){const d=i[Lt.KHR_MATERIALS_UNLIT];a=d.getMaterialType(),c.push(d.extendParams(s,o,n))}else{const d=o.pbrMetallicRoughness||{};if(s.color=new ft(1,1,1),s.opacity=1,Array.isArray(d.baseColorFactor)){const f=d.baseColorFactor;s.color.setRGB(f[0],f[1],f[2],Kr),s.opacity=f[3]}d.baseColorTexture!==void 0&&c.push(n.assignTexture(s,"map",d.baseColorTexture,Zt)),s.metalness=d.metallicFactor!==void 0?d.metallicFactor:1,s.roughness=d.roughnessFactor!==void 0?d.roughnessFactor:1,d.metallicRoughnessTexture!==void 0&&(c.push(n.assignTexture(s,"metalnessMap",d.metallicRoughnessTexture)),c.push(n.assignTexture(s,"roughnessMap",d.metallicRoughnessTexture))),a=this._invokeOne(function(f){return f.getMaterialType&&f.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(f){return f.extendMaterialParams&&f.extendMaterialParams(e,s)})))}o.doubleSided===!0&&(s.side=Ki);const u=o.alphaMode||Pw.OPAQUE;if(u===Pw.BLEND?(s.transparent=!0,s.depthWrite=!1):(s.transparent=!1,u===Pw.MASK&&(s.alphaTest=o.alphaCutoff!==void 0?o.alphaCutoff:.5)),o.normalTexture!==void 0&&a!==sa&&(c.push(n.assignTexture(s,"normalMap",o.normalTexture)),s.normalScale=new xt(1,1),o.normalTexture.scale!==void 0)){const d=o.normalTexture.scale;s.normalScale.set(d,d)}if(o.occlusionTexture!==void 0&&a!==sa&&(c.push(n.assignTexture(s,"aoMap",o.occlusionTexture)),o.occlusionTexture.strength!==void 0&&(s.aoMapIntensity=o.occlusionTexture.strength)),o.emissiveFactor!==void 0&&a!==sa){const d=o.emissiveFactor;s.emissive=new ft().setRGB(d[0],d[1],d[2],Kr)}return o.emissiveTexture!==void 0&&a!==sa&&c.push(n.assignTexture(s,"emissiveMap",o.emissiveTexture,Zt)),Promise.all(c).then(function(){const d=new a(s);return o.name&&(d.name=o.name),ka(d,o),n.associations.set(d,{materials:e}),o.extensions&&Ul(i,d,o),d})}createUniqueName(e){const n=nn.sanitizeNodeName(e||"");return n in this.nodeNamesUsed?n+"_"+ ++this.nodeNamesUsed[n]:(this.nodeNamesUsed[n]=0,n)}loadGeometries(e){const n=this,r=this.extensions,i=this.primitiveCache;function o(s){return r[Lt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(s,n).then(function(l){return f2(l,s,n)})}const a=[];for(let s=0,l=e.length;s0&&qae(m,o),m.name=n.createUniqueName(o.name||"mesh_"+e),ka(m,o),g.extensions&&Ul(i,m,g),n.assignFinalMaterial(m),d.push(m)}for(let p=0,y=d.length;p1?u=new la:c.length===1?u=c[0]:u=new vn,u!==c[0])for(let d=0,f=c.length;d1){const d=i.associations.get(u);i.associations.set(u,{...d})}return i.associations.get(u).nodes=e,u}),this.nodeCache[e]}loadScene(e){const n=this.extensions,r=this.json.scenes[e],i=this,o=new la;r.name&&(o.name=i.createUniqueName(r.name)),ka(o,r),r.extensions&&Ul(n,o,r);const a=r.nodes||[],s=[];for(let l=0,c=a.length;l{const d=new Map;for(const[f,p]of i.associations)(f instanceof qr||f instanceof lr)&&d.set(f,p);return u.traverse(f=>{const p=i.associations.get(f);p!=null&&d.set(f,p)}),d};return i.associations=c(o),o})}_createAnimationTracks(e,n,r,i,o){const a=[],s=e.name?e.name:e.uuid,l=[];Ss[o.path]===Ss.weights?e.traverse(function(f){f.morphTargetInfluences&&l.push(f.name?f.name:f.uuid)}):l.push(s);let c;switch(Ss[o.path]){case Ss.weights:c=zd;break;case Ss.rotation:c=Ic;break;case Ss.translation:case Ss.scale:c=hl;break;default:switch(r.itemSize){case 1:c=zd;break;case 2:case 3:default:c=hl;break}break}const u=i.interpolation!==void 0?Gae[i.interpolation]:Cp,d=this._getArrayFromAccessor(r);for(let f=0,p=l.length;f0?o[o.length-1]:"",smooth:a!==void 0?a.smooth:this.smooth,groupStart:a!==void 0?a.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(l){const c={index:typeof l=="number"?l:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return c.clone=this.clone.bind(c),c}};return this.materials.push(s),s},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(i){const o=this.currentMaterial();if(o&&o.groupEnd===-1&&(o.groupEnd=this.geometry.vertices.length/3,o.groupCount=o.groupEnd-o.groupStart,o.inherited=!1),i&&this.materials.length>1)for(let a=this.materials.length-1;a>=0;a--)this.materials[a].groupCount<=0&&this.materials.splice(a,1);return i&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),o}},r&&r.name&&typeof r.clone=="function"){const i=r.clone(0);i.inherited=!0,this.object.materials.push(i)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(e,n){const r=parseInt(e,10);return(r>=0?r-1:r+n/3)*3},parseNormalIndex:function(e,n){const r=parseInt(e,10);return(r>=0?r-1:r+n/3)*3},parseUVIndex:function(e,n){const r=parseInt(e,10);return(r>=0?r-1:r+n/2)*2},addVertex:function(e,n,r){const i=this.vertices,o=this.object.geometry.vertices;o.push(i[e+0],i[e+1],i[e+2]),o.push(i[n+0],i[n+1],i[n+2]),o.push(i[r+0],i[r+1],i[r+2])},addVertexPoint:function(e){const n=this.vertices;this.object.geometry.vertices.push(n[e+0],n[e+1],n[e+2])},addVertexLine:function(e){const n=this.vertices;this.object.geometry.vertices.push(n[e+0],n[e+1],n[e+2])},addNormal:function(e,n,r){const i=this.normals,o=this.object.geometry.normals;o.push(i[e+0],i[e+1],i[e+2]),o.push(i[n+0],i[n+1],i[n+2]),o.push(i[r+0],i[r+1],i[r+2])},addFaceNormal:function(e,n,r){const i=this.vertices,o=this.object.geometry.normals;p2.fromArray(i,e),Nw.fromArray(i,n),m2.fromArray(i,r),Bi.subVectors(m2,Nw),g2.subVectors(p2,Nw),Bi.cross(g2),Bi.normalize(),o.push(Bi.x,Bi.y,Bi.z),o.push(Bi.x,Bi.y,Bi.z),o.push(Bi.x,Bi.y,Bi.z)},addColor:function(e,n,r){const i=this.colors,o=this.object.geometry.colors;i[e]!==void 0&&o.push(i[e+0],i[e+1],i[e+2]),i[n]!==void 0&&o.push(i[n+0],i[n+1],i[n+2]),i[r]!==void 0&&o.push(i[r+0],i[r+1],i[r+2])},addUV:function(e,n,r){const i=this.uvs,o=this.object.geometry.uvs;o.push(i[e+0],i[e+1]),o.push(i[n+0],i[n+1]),o.push(i[r+0],i[r+1])},addDefaultUV:function(){const e=this.object.geometry.uvs;e.push(0,0),e.push(0,0),e.push(0,0)},addUVLine:function(e){const n=this.uvs;this.object.geometry.uvs.push(n[e+0],n[e+1])},addFace:function(e,n,r,i,o,a,s,l,c){const u=this.vertices.length;let d=this.parseVertexIndex(e,u),f=this.parseVertexIndex(n,u),p=this.parseVertexIndex(r,u);if(this.addVertex(d,f,p),this.addColor(d,f,p),s!==void 0&&s!==""){const y=this.normals.length;d=this.parseNormalIndex(s,y),f=this.parseNormalIndex(l,y),p=this.parseNormalIndex(c,y),this.addNormal(d,f,p)}else this.addFaceNormal(d,f,p);if(i!==void 0&&i!==""){const y=this.uvs.length;d=this.parseUVIndex(i,y),f=this.parseUVIndex(o,y),p=this.parseUVIndex(a,y),this.addUV(d,f,p),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(e){this.object.geometry.type="Points";const n=this.vertices.length;for(let r=0,i=e.length;r=7?(ov.setRGB(parseFloat(d[4]),parseFloat(d[5]),parseFloat(d[6]),Zt),n.colors.push(ov.r,ov.g,ov.b)):n.colors.push(void 0,void 0,void 0);break;case"vn":n.normals.push(parseFloat(d[1]),parseFloat(d[2]),parseFloat(d[3]));break;case"vt":n.uvs.push(parseFloat(d[1]),parseFloat(d[2]));break}}else if(u==="f"){const f=c.slice(1).trim().split(h2),p=[];for(let v=0,g=f.length;v0){const x=m.split("/");p.push(x)}}const y=p[0];for(let v=1,g=p.length-1;v1){const f=i[1].trim().toLowerCase();n.object.smooth=f!=="0"&&f!=="off"}else n.object.smooth=!0;const d=n.object.currentMaterial();d&&(d.smooth=n.object.smooth)}else{if(c==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+c+'"')}}n.finalize();const o=new la;if(o.materialLibraries=[].concat(n.materialLibraries),!(n.objects.length===1&&n.objects[0].geometry.vertices.length===0)===!0)for(let s=0,l=n.objects.length;s0&&v.setAttribute("normal",new Qt(u.normals,3)),u.colors.length>0&&(y=!0,v.setAttribute("color",new Qt(u.colors,3))),u.hasUVIndices===!0&&v.setAttribute("uv",new Qt(u.uvs,2));const g=[];for(let x=0,b=d.length;x1){for(let x=0,b=d.length;x0){const s=new Hu({size:1,sizeAttenuation:!1}),l=new br;l.setAttribute("position",new Qt(n.vertices,3)),n.colors.length>0&&n.colors[0]!==void 0&&(l.setAttribute("color",new Qt(n.colors,3)),s.vertexColors=!0);const c=new Gv(l,s);o.add(c)}return o}}const ase=(t,e,n)=>{var i;let r=(i=t.split(/\./g).pop())==null?void 0:i.toLowerCase();if(t.startsWith("blob:")&&t.includes("#.")){const o=t.split("#.").pop();o&&(r=o.toLowerCase())}if(!r){console.error(`Could not determine file extension for: ${t}`),n(null,new Error(`Unsupported file format: ${t}`));return}switch(r){case"gltf":case"glb":new xae(e).load(t,o=>n(o.scene),void 0,o=>n(null,o));break;case"obj":new ose(e).load(t,o=>n(o),()=>{},o=>n(null,o));break;case"dae":new n$(e).load(t,o=>n(o.scene),void 0,o=>n(null,o));break;case"stl":new t$(e).load(t,o=>{const a=new Fo,s=new Mn(o,a);n(s)},o=>{},o=>{console.error(`โŒ STL loading failed: ${t}`,o);const a=new Gc(.05,.05,.05),s=new Fo({color:16739125,transparent:!0,opacity:.7}),l=new Mn(a,s);n(l)});break;default:n(null,new Error(`Unsupported file format: ${r}`))}};function sse(t,e){t.innerHTML="";const n=document.createElement("urdf-viewer");n.classList.add("w-full","h-full"),t.appendChild(n),n.setAttribute("up","Z"),dse(n,"#2c2b3a"),n.setAttribute("highlight-color","#df6dd4"),n.setAttribute("auto-redraw","true");const r=new X4(14079702,1);n.scene.add(r);const i=new Bx(16777215,.8);return i.position.set(5,30,5),i.castShadow=!0,n.scene.add(i),n}function lse(t,e){"loadMeshFunc"in t&&(t.loadMeshFunc=(n,r,i)=>{const o=e?e(n):n;try{ase(o,r,(a,s)=>{s?(console.warn(`Error loading mesh ${o}:`,s),i(null)):i(a)})}catch(a){console.error(`Exception loading mesh ${o}:`,a),i(null,a)}})}function cse(t,e){const n=i=>{e(i.detail)},r=()=>{e(null)};return t.addEventListener("joint-mouseover",n),t.addEventListener("joint-mouseout",r),()=>{t.removeEventListener("joint-mouseover",n),t.removeEventListener("joint-mouseout",r)}}function use(t,e,n,r,i=[]){const o=e.startsWith("blob:")&&!e.includes("#.")?e+"#.urdf":e;t.setAttribute("urdf",o),t.setAttribute("package",n);const a=()=>{if(i.length>0){const s=i[0];s&&(r(s),Ur.info("Trying alternative model...",{description:`First model failed to load. Trying ${s.split("/").pop()||"alternative model"}`,duration:2e3}))}};return t.addEventListener("error",a),()=>{t.removeEventListener("error",a)}}function dse(t,e){const n=t.parentElement;n&&(n.style.backgroundColor=e)}typeof window<"u"&&!customElements.get("urdf-viewer")&&customElements.define("urdf-viewer",mae);const fse=()=>{const t=_.useRef(null),[e,n]=_.useState(null),{registerUrdfProcessor:r,alternativeUrdfModels:i,isDefaultModel:o}=iU(),a=_.useRef(null),s=_.useRef(null),l=_.useRef(!1),{isConnected:c}=vae({viewerRef:s,enabled:o}),[u,d]=_.useState(null),[f,p]=_.useState(null),y=_.useRef(""),v=_.useMemo(()=>({loadUrdf:m=>{d(m)},setUrlModifierFunc:m=>{p(()=>m)},getPackage:()=>y.current}),[]);_.useEffect(()=>{r(v)},[r,v]);const g=_.useCallback(m=>m.startsWith("package://so_arm_description/meshes/")?m.replace("package://so_arm_description/meshes/","/so-101-urdf/meshes/"):m.includes("so_arm_description/meshes/")?m.replace(/.*so_arm_description\/meshes\//,"/so-101-urdf/meshes/"):m.includes("/so-101-urdf/so_arm_description/meshes/")?m.replace("/so-101-urdf/so_arm_description/meshes/","/so-101-urdf/meshes/"):m.endsWith(".stl")&&!m.startsWith("/")&&!m.startsWith("http")?`/so-101-urdf/meshes/${m}`:m,[]);return _.useEffect(()=>{if(!t.current)return;const m=sse(t.current);s.current=m,lse(m,o?g:f);const b=o?"/so-101-urdf/urdf/so101_new_calib.urdf":u||"";o&&(y.current="/");let S=()=>{};b&&(S=use(m,b,y.current,d,i));const w=cse(m,n),E=M=>{if(!(!M||!M.robot))try{const C=new Wo().setFromObject(M.robot),P=new ne;C.getCenter(P);const R=new ne;C.getSize(R);const D=Math.max(R.x,R.y,R.z);M.camera.position.copy(P);const k=new ne;M.up==="+Z"||M.up==="Z"||M.up==="+Y"||M.up,k.set(1,1,1),k.normalize().multiplyScalar(D*1.3),M.camera.position.add(k),M.controls.target.copy(P),M.controls.update(),M.redraw()}catch(C){console.error("[RobotViewer] Error fitting robot to view:",C)}},T=()=>{E(m)},A=()=>{l.current=!0,"setJointValue"in m&&a.current&&(a.current(),a.current=null),T()};return m.addEventListener("urdf-processed",A),()=>{a.current&&(a.current(),a.current=null),l.current=!1,w(),S(),m.removeEventListener("urdf-processed",A)}},[o,u,f,g,i]),h.jsxs("div",{className:He("w-full h-full transition-all duration-300 ease-in-out relative","bg-gradient-to-br from-gray-900 to-gray-800"),children:[h.jsx("div",{ref:t,className:"w-full h-full"}),e&&h.jsxs("div",{className:"absolute bottom-4 right-4 bg-black/70 text-white px-3 py-2 rounded-md text-sm font-mono z-10",children:["Joint: ",e]}),o&&h.jsx("div",{className:"absolute top-4 right-4 z-10",children:h.jsxs("div",{className:`flex items-center gap-2 px-3 py-2 rounded-md text-sm font-mono ${c?"bg-green-900/70 text-green-300":"bg-red-900/70 text-red-300"}`,children:[h.jsx("div",{className:`w-2 h-2 rounded-full ${c?"bg-green-400":"bg-red-400"}`}),c?"Live Robot Data":"Disconnected"]})})]})},hse=_.memo(fse),Hx=({className:t,iconOnly:e=!1})=>h.jsxs("div",{className:He("flex items-center gap-2",t),children:[h.jsx("img",{src:"/lovable-uploads/5e648747-34b7-4d8f-93fd-4dbd00aeeefc.png",alt:"LeLab Logo",className:"h-8 w-8"}),!e&&h.jsx("span",{className:"font-bold text-white text-2xl",children:"LeLab"})]}),pse=({onGoBack:t,className:e})=>h.jsx("div",{className:He("w-full p-2 sm:p-4 space-y-4 lg:space-y-0 lg:space-x-4 flex flex-col lg:flex-row",e),children:h.jsxs("div",{className:"bg-gray-900 rounded-lg p-4 flex-1 flex flex-col",children:[h.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[h.jsx(et,{variant:"ghost",size:"icon",onClick:t,className:"text-gray-400 hover:text-white hover:bg-gray-800 flex-shrink-0",children:h.jsx(sl,{className:"h-5 w-5"})}),h.jsx(Hx,{iconOnly:!0}),h.jsx("div",{className:"w-px h-6 bg-gray-700"}),h.jsx("h2",{className:"text-xl font-medium text-gray-200",children:"Teleoperation"})]}),h.jsx("div",{className:"flex-1 bg-black rounded border border-gray-800 min-h-[50vh] lg:min-h-0",children:h.jsx(hse,{})})]})}),mse=()=>{const t=ji(),{toast:e}=Dr(),{baseUrl:n,fetchWithHeaders:r}=Ln(),i=async()=>{try{const o=await r(`${n}/stop-teleoperation`,{method:"POST"});if(o.ok){const a=await o.json();a.message,e({title:"Teleoperation Stopped",description:a.message||"Robot teleoperation has been stopped successfully."})}else{const a=await o.text();console.warn("โš ๏ธ Failed to stop teleoperation:",o.status,a),e({title:"Warning",description:`Failed to stop teleoperation properly. Status: ${o.status}`,variant:"destructive"})}}catch(o){console.error("โŒ Error stopping teleoperation:",o),e({title:"Error",description:"Failed to communicate with the robot server.",variant:"destructive"})}finally{t("/")}};return h.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center p-2 sm:p-4",children:h.jsx("div",{className:"w-full h-[95vh] flex",children:h.jsx(pse,{onGoBack:i,className:"lg:w-full"})})})},gse=Sm("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function b1({className:t,variant:e,...n}){return h.jsx("div",{className:He(gse({variant:e}),t),...n})}var vse="Separator",v2="horizontal",yse=["horizontal","vertical"],s$=_.forwardRef((t,e)=>{const{decorative:n,orientation:r=v2,...i}=t,o=xse(r)?r:v2,s=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return h.jsx(nt.div,{"data-orientation":o,...s,...i,ref:e})});s$.displayName=vse;function xse(t){return yse.includes(t)}var l$=s$;const Yl=_.forwardRef(({className:t,orientation:e="horizontal",decorative:n=!0,...r},i)=>h.jsx(l$,{ref:i,decorative:n,orientation:e,className:He("shrink-0 bg-border",e==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...r}));Yl.displayName=l$.displayName;const bse=({onClick:t,robotType:e,className:n=""})=>h.jsxs(et,{type:"button",onClick:t,variant:"outline",size:"sm",className:` - h-8 px-2 - border-gray-600 hover:border-blue-500 - text-gray-400 hover:text-blue-400 - bg-gray-800 hover:bg-gray-700 - transition-all duration-200 - ${n} - `,title:`Find ${e||"robot"} port automatically`,children:[h.jsx(tA,{className:"w-3 h-3 mr-1"}),"Find"]}),_se=2e3,wse=({open:t,onOpenChange:e,robotType:n,onPortDetected:r})=>{const[i,o]=_.useState("detecting"),[a,s]=_.useState(""),[l,c]=_.useState(""),u=_.useRef(!1),d=_.useRef(null),f=_.useRef(null),{toast:p}=Dr(),{baseUrl:y,fetchWithHeaders:v}=Ln(),g=async()=>{try{d.current=new AbortController;const E=await(await v(`${y}/start-port-detection`,{method:"POST",body:JSON.stringify({robot_type:n}),signal:d.current.signal})).json();if(u.current)return;if(E.status!=="success")throw new Error(E.message||"Failed to start port detection");const T=E.data.ports_before;for(;!u.current;){d.current=new AbortController;const M=await(await v(`${y}/detect-port-after-disconnect`,{method:"POST",body:JSON.stringify({ports_before:T}),signal:d.current.signal})).json();if(u.current)return;if(M.status==="success"){if(s(M.port),await m(M.port),u.current)return;o("success"),p({title:"Port Detected Successfully",description:`${n} port detected: ${M.port}`}),f.current=window.setTimeout(()=>{u.current||(r(M.port),e(!1))},_se);return}const C=typeof M.message=="string"?M.message:"";if(!C.includes("Timed out"))throw new Error(C||"Failed to detect port")}}catch(w){if(u.current||w instanceof DOMException&&w.name==="AbortError")return;console.error("Port detection failed:",w),c(w instanceof Error?w.message:"Unknown error"),o("error")}},m=async w=>{try{await v(`${y}/save-robot-port`,{method:"POST",body:JSON.stringify({robot_type:n,port:w})})}catch(E){console.error("Error saving port:",E)}};_.useEffect(()=>{if(t)return u.current=!1,o("detecting"),c(""),s(""),g(),()=>{var w;u.current=!0,(w=d.current)==null||w.abort(),f.current!==null&&(window.clearTimeout(f.current),f.current=null)}},[t]);const x=()=>{e(!1)},b=()=>{var w;u.current=!1,(w=d.current)==null||w.abort(),o("detecting"),c(""),s(""),g()},S=()=>{switch(i){case"detecting":return h.jsxs("div",{className:"space-y-6 text-center",children:[h.jsx(fi,{className:"w-16 h-16 text-blue-500 mx-auto animate-spin"}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs("h3",{className:"text-lg font-semibold text-white",children:["Unplug the ",n," arm"]}),h.jsxs("p",{className:"text-gray-400",children:["Disconnect the ",n," robot arm from USB. The port will be detected automatically."]})]}),h.jsx("div",{className:"flex justify-center",children:h.jsx(et,{onClick:x,variant:"outline",className:"border-gray-500 hover:border-gray-200 text-gray-300 hover:text-white px-8 py-2",children:"Cancel"})})]});case"success":return h.jsxs("div",{className:"space-y-6 text-center",children:[h.jsx(qi,{className:"w-16 h-16 text-green-500 mx-auto"}),h.jsxs("div",{className:"space-y-2",children:[h.jsx("h3",{className:"text-lg font-semibold text-white",children:"Port Detected"}),h.jsx("p",{className:"text-xl font-mono text-green-400 bg-gray-800 px-4 py-2 rounded inline-block",children:a})]})]});case"error":return h.jsxs("div",{className:"space-y-6 text-center",children:[h.jsx(td,{className:"w-16 h-16 text-red-500 mx-auto"}),h.jsxs("div",{className:"space-y-2",children:[h.jsx("h3",{className:"text-lg font-semibold text-white",children:"Detection Failed"}),h.jsx("div",{className:"bg-red-900/20 border border-red-800 rounded-lg p-3",children:h.jsx("p",{className:"text-red-400 text-sm",children:l})})]}),h.jsxs("div",{className:"flex gap-4 justify-center",children:[h.jsx(et,{onClick:b,className:"bg-blue-500 hover:bg-blue-600 text-white px-8 py-2",children:"Try Again"}),h.jsx(et,{onClick:x,variant:"outline",className:"border-gray-500 hover:border-gray-200 text-gray-300 hover:text-white px-8 py-2",children:"Cancel"})]})]});default:return null}};return h.jsx(Hc,{open:t,onOpenChange:e,children:h.jsxs(xl,{className:"bg-gray-900 border-gray-800 text-white sm:max-w-[500px] p-8",children:[h.jsxs(bl,{children:[h.jsx(_l,{className:"text-white text-center text-xl font-bold",children:"Port Detection"}),h.jsxs(wl,{className:"text-gray-400 text-center",children:["Detect the USB port for your ",n," arm"]})]}),h.jsx("div",{className:"py-4",children:S()})]})})},Sse={shoulder_pan:2400,shoulder_lift:2300,elbow_flex:2150,wrist_flex:2250,wrist_roll:3700,gripper:1150},Ese={shoulder_pan:2400,shoulder_lift:2300,elbow_flex:2150,wrist_flex:2250,wrist_roll:3700,gripper:1400},Tse={teleop:Sse,robot:Ese},Mse=.98;function y2(t,e,n){var i;if(!t)return!1;const r=(i=Tse[t])==null?void 0:i[e];return r?n>=r*Mse:!1}const x2="Motor discontinuity detected",Ase=()=>{var X;const t=ji(),n=((X=vl().state)==null?void 0:X.robot_name)??null,{toast:r}=Dr(),{baseUrl:i,fetchWithHeaders:o}=Ln();_.useRef(null);const a=_.useRef(null),[s,l]=_.useState("teleop"),[c,u]=_.useState(""),[d,f]=_.useState(null),[p,y]=_.useState([]),v=_.useRef(null),g=_.useCallback(async()=>{if(!n)return null;try{const K=await o(`${i}/robots/${encodeURIComponent(n)}`);if(!K.ok)return null;const Y=(await K.json()).robot??null;return f(Y),Y}catch(K){return console.error("Failed to load robot record:",K),null}},[n,i,o]);_.useEffect(()=>{if(!n)return;let K=!1;return(async()=>{const F=await g();if(!F||K)return;const Y=F.leader_config?F.follower_config?"teleop":"robot":"teleop";l(Y),u(Y==="teleop"?F.leader_port||"":F.follower_port||""),y(F.cameras??[])})(),()=>{K=!0}},[n,g]);const m=K=>{y(K),n&&(v.current&&clearTimeout(v.current),v.current=setTimeout(async()=>{try{await o(`${i}/robots/${encodeURIComponent(n)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cameras:K})})}catch(F){console.error("Failed to save cameras to robot record:",F)}},500))};_.useEffect(()=>()=>{v.current&&clearTimeout(v.current)},[]);const[x,b]=_.useState(!1),[S,w]=_.useState("leader"),[E,T]=_.useState({calibration_active:!1,status:"idle",device_type:null,error:null,message:"",step:0,total_steps:1,current_positions:null,recorded_ranges:null}),[A,M]=_.useState(!1),C=_.useRef(!1);_.useEffect(()=>{C.current=E.calibration_active},[E.calibration_active]),_.useEffect(()=>()=>{C.current&&o(`${i}/stop-calibration`,{method:"POST"}).catch(K=>console.error("Failed to stop calibration on unmount:",K))},[i,o]);const P=async()=>{try{const K=await o(`${i}/calibration-status`);if(K.ok){const F=await K.json();T(F),!F.calibration_active&&(F.status==="completed"||F.status==="error"||F.status==="idle")&&M(!1)}}catch(K){console.error("Error polling status:",K)}},R=async()=>{if(!n){r({title:"No robot selected",description:"Open Calibration from a robot's gear icon on the Landing page.",variant:"destructive"});return}if(!c){r({title:"Missing port",description:"Set the device's serial port before starting.",variant:"destructive"});return}const K={device_type:s,port:c,config_file:n,robot_name:n};C.current=!0;try{const Y=await(await o(`${i}/start-calibration`,{method:"POST",body:JSON.stringify(K)})).json();Y.success?(r({title:"Calibration Started",description:`Calibration started for ${s}`}),M(!0)):(C.current=!1,r({title:"Calibration Failed",description:Y.message||"Failed to start calibration",variant:"destructive"}))}catch(F){C.current=!1,console.error("Error starting calibration:",F),r({title:"Error",description:"Failed to start calibration",variant:"destructive"})}},D=async()=>{try{const F=await(await o(`${i}/stop-calibration`,{method:"POST"})).json();F.success?r({title:"Calibration Stopped",description:"Calibration has been stopped"}):r({title:"Error",description:F.message||"Failed to stop calibration",variant:"destructive"})}catch(K){console.error("Error stopping calibration:",K),r({title:"Error",description:"Failed to stop calibration",variant:"destructive"})}},k=async()=>{if(E.calibration_active)try{const F=await(await o(`${i}/complete-calibration-step`,{method:"POST"})).json();F.success?r({title:"Step Completed",description:F.message}):r({title:"Step Failed",description:F.message||"Could not complete step",variant:"destructive"})}catch(K){console.error("Error completing step:",K),r({title:"Error",description:"Could not complete calibration step",variant:"destructive"})}};_.useEffect(()=>{var K,F;E.status==="error"&&((K=E.error)!=null&&K.startsWith(x2))&&((F=a.current)==null||F.scrollIntoView({behavior:"smooth",block:"center"}))},[E.status,E.error]),_.useEffect(()=>{if(!A)return;P();const K=setInterval(()=>{P()},200);return()=>clearInterval(K)},[A]),_.useEffect(()=>{(async()=>{if(s&&!n)try{const q=await(await o(`${i}/robot-port/${s==="robot"?"follower":"leader"}`)).json();if(q.status==="success"){const Q=q.saved_port||q.default_port;Q&&u(Q)}}catch(F){console.error("Error loading default port:",F)}})()},[s,n,i,o]);const U=K=>{l(K),d&&u(K==="teleop"?d.leader_port||"":d.follower_port||"")};_.useEffect(()=>{E.status==="completed"&&(async()=>{const K=await g();if(!K)return;const F=K.leader_config?K.follower_config?"teleop":"robot":"teleop";l(F),u(F==="teleop"?K.leader_port||"":K.follower_port||"")})()},[E.status,g]);const O=()=>{w(s==="robot"?"follower":"leader"),b(!0)},W=K=>{u(K)},j=(()=>{switch(E.status){case"idle":return{color:"bg-slate-500",icon:h.jsx(Mh,{className:"w-4 h-4"}),text:"Idle"};case"connecting":return{color:"bg-yellow-500",icon:h.jsx(fi,{className:"w-4 h-4 animate-spin"}),text:"Connecting"};case"recording":return{color:"bg-purple-500",icon:h.jsx($u,{className:"w-4 h-4"}),text:"Recording Ranges"};case"completed":return{color:"bg-green-500",icon:h.jsx(qi,{className:"w-4 h-4"}),text:"Completed"};case"error":return{color:"bg-red-500",icon:h.jsx(nd,{className:"w-4 h-4"}),text:"Error"};case"stopping":return{color:"bg-orange-500",icon:h.jsx(Od,{className:"w-4 h-4"}),text:"Stopping"};default:return{color:"bg-slate-500",icon:h.jsx(Mh,{className:"w-4 h-4"}),text:"Unknown"}}})();return h.jsxs("div",{className:"min-h-screen bg-slate-900 text-white p-4",children:[h.jsxs("div",{className:"max-w-4xl mx-auto",children:[h.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[h.jsx(et,{variant:"ghost",size:"icon",onClick:()=>t(-1),className:"text-slate-400 hover:text-white hover:bg-slate-800",children:h.jsx(sl,{className:"w-5 h-5"})}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx(Hx,{iconOnly:!0}),h.jsx("h1",{className:"text-3xl font-bold",children:n?`Calibrate "${n}"`:"Device Calibration"})]})]}),!n&&h.jsxs(Mi,{className:"mb-6 bg-amber-900/40 border-amber-700 text-amber-100",children:[h.jsx(td,{className:"h-4 w-4"}),h.jsx(Ai,{children:"Open Calibration from a robot's gear icon on the Landing page. Each robot has its own calibration; running this page directly is not supported."})]}),h.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[h.jsxs(Gr,{className:"bg-slate-800/60 border-slate-700 backdrop-blur-sm",children:[h.jsx(jo,{children:h.jsxs(ha,{className:"flex items-center gap-2 text-slate-200",children:[h.jsx(Mh,{className:"w-5 h-5 text-blue-400"}),"Configuration"]})}),h.jsxs(Wr,{className:"space-y-6",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(Nt,{htmlFor:"deviceType",className:"text-sm font-medium text-slate-300",children:"Device Type *"}),h.jsxs(Zs,{value:s,onValueChange:U,children:[h.jsx(Wa,{className:"bg-slate-700 border-slate-600 text-white rounded-md",children:h.jsx(Qs,{placeholder:"Select device type"})}),h.jsxs(Xa,{className:"bg-slate-800 border-slate-700 text-white",children:[h.jsx(_n,{value:"teleop",className:"hover:bg-slate-700",children:"Teleoperator (Leader)"}),h.jsx(_n,{value:"robot",className:"hover:bg-slate-700",children:"Robot (Follower)"})]})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(Nt,{htmlFor:"port",className:"text-sm font-medium text-slate-300",children:"Port *"}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx(hi,{id:"port",value:c,onChange:K=>u(K.target.value),placeholder:"/dev/tty.usbmodem...",className:"bg-slate-700 border-slate-600 text-white rounded-md flex-1"}),h.jsx(bse,{onClick:O,robotType:s==="robot"?"follower":"leader",className:"border-slate-600 hover:border-blue-500 text-slate-400 hover:text-blue-400 bg-slate-700 hover:bg-slate-600"})]})]}),h.jsx(Yl,{className:"bg-slate-700"}),h.jsx("div",{className:"flex flex-col gap-3",children:E.calibration_active?h.jsxs(et,{onClick:D,variant:"destructive",className:"w-full rounded-full py-6 text-lg",children:[h.jsx(Od,{className:"w-5 h-5 mr-2"}),"Cancel Calibration"]}):h.jsxs(et,{onClick:R,className:"w-full bg-blue-600 hover:bg-blue-700 text-white rounded-full py-6 text-lg",disabled:!n||!s||!c,children:[h.jsx(Tc,{className:"w-5 h-5 mr-2"}),"Start Calibration"]})}),d&&h.jsxs("div",{className:"space-y-2 pt-2",children:[h.jsx("div",{className:"text-sm font-medium text-slate-300",children:"Robot calibration"}),h.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[d.leader_config?h.jsx(qi,{className:"w-4 h-4 text-green-400"}):h.jsx(uE,{className:"w-4 h-4 text-slate-500"}),h.jsx("span",{className:d.leader_config?"text-slate-200":"text-slate-400",children:"Leader (Teleoperator)"})]}),h.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[d.follower_config?h.jsx(qi,{className:"w-4 h-4 text-green-400"}):h.jsx(uE,{className:"w-4 h-4 text-slate-500"}),h.jsx("span",{className:d.follower_config?"text-slate-200":"text-slate-400",children:"Follower (Robot)"})]})]})]})]}),h.jsxs(Gr,{className:"bg-slate-800/60 border-slate-700 backdrop-blur-sm",children:[h.jsx(jo,{children:h.jsxs(ha,{className:"flex items-center gap-2 text-slate-200",children:[h.jsx($u,{className:"w-5 h-5 text-teal-400"}),"Status"]})}),h.jsxs(Wr,{className:"space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between p-3 bg-slate-900/50 rounded-md",children:[h.jsx("span",{className:"text-slate-300",children:"Status:"}),h.jsxs(b1,{className:`${j.color} text-white rounded-md`,children:[j.icon,h.jsx("span",{className:"ml-2",children:j.text})]})]}),E.status==="recording"&&E.recorded_ranges&&h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx($u,{className:"w-4 h-4 text-purple-400"}),h.jsx("span",{className:"text-sm font-medium text-slate-300",children:"Live Position Data"})]}),h.jsx("div",{className:"bg-slate-800 rounded-lg p-4 border border-slate-700",children:h.jsx("div",{className:"space-y-3",children:Object.entries(E.recorded_ranges).map(([K,F])=>{const Y=F.max-F.min,q=F.current-F.min,Q=Y>0?q/Y*100:50,te=y2(E.device_type,K,Y);return h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-white font-semibold text-sm",children:K}),te&&h.jsx(qi,{className:"w-4 h-4 text-green-400","aria-label":"Range complete"})]}),h.jsx("span",{className:"text-slate-300 text-xs font-mono",children:F.current})]}),h.jsxs("div",{className:"relative",children:[h.jsx("div",{className:"w-full bg-slate-700 rounded-full h-3",children:h.jsx("div",{className:"bg-slate-600 h-3 rounded-full relative",style:{width:"100%"},children:h.jsx("div",{className:`absolute top-0 w-1 h-3 rounded-full transition-all duration-100 ${te?"bg-green-400":"bg-yellow-400"}`,style:{left:`${Math.max(0,Math.min(100,Q))}%`,transform:"translateX(-50%)"}})})}),h.jsxs("div",{className:"flex justify-between text-xs text-slate-400 mt-1",children:[h.jsx("span",{children:F.min}),h.jsx("span",{children:F.max})]})]})]},K)})})})]}),E.status==="connecting"&&h.jsxs(Mi,{className:"bg-yellow-900/50 border-yellow-700 text-yellow-200",children:[h.jsx(td,{className:"h-4 w-4"}),h.jsx(Ai,{children:"Connecting to the device. Please ensure it's connected."})]}),E.status==="recording"&&(()=>{const K=E.recorded_ranges??{},F=Object.entries(K),Y=F.length>0&&F.every(([q,Q])=>y2(E.device_type,q,Q.max-Q.min));return h.jsxs("div",{className:"space-y-3",children:[h.jsx("div",{className:"flex justify-center",children:h.jsxs(et,{onClick:k,disabled:!E.calibration_active,className:`px-8 py-3 rounded-full transition-colors ${Y?"bg-green-600 hover:bg-green-700":"bg-orange-500 hover:bg-orange-600"}`,children:[Y?h.jsx(qi,{className:"w-4 h-4 mr-2"}):h.jsx(td,{className:"w-4 h-4 mr-2"}),"Save Calibration"]})}),h.jsxs(Mi,{className:"bg-purple-900/50 border-purple-700 text-purple-200",children:[h.jsx($u,{className:"h-4 w-4"}),h.jsxs(Ai,{children:[h.jsx("strong",{children:"Important:"})," Move EACH joint through its full range. A check appears next to each joint once its range is wide enough."]})]})]})})(),E.status==="completed"&&h.jsxs(Mi,{className:"bg-green-900/50 border-green-700 text-green-200",children:[h.jsx(qi,{className:"h-4 w-4"}),h.jsx(Ai,{children:"Calibration completed successfully!"})]}),E.status==="error"&&E.error&&(E.error.startsWith(x2)?h.jsxs(Mi,{className:"bg-red-900/50 border-red-700 text-red-200",children:[h.jsx(nd,{className:"h-4 w-4"}),h.jsxs(Ai,{children:[h.jsx("div",{className:"font-semibold text-base mb-1",children:"Motor discontinuity detected"}),h.jsx("div",{children:"Make sure to start the calibration with the robot in a middle position โ€” all joints in the middle of their ranges. See the calibration demo below for the correct starting pose."})]})]}):h.jsxs(Mi,{className:"bg-red-900/50 border-red-700 text-red-200",children:[h.jsx(nd,{className:"h-4 w-4"}),h.jsxs(Ai,{children:[h.jsx("strong",{children:"Error:"})," ",E.error]})]})),h.jsxs("div",{ref:a,className:"bg-slate-900/50 p-4 rounded-lg border border-slate-700",children:[h.jsx("h4",{className:"font-semibold mb-3 text-slate-200",children:"Calibration Demo:"}),h.jsx("div",{className:"relative rounded-lg overflow-hidden bg-slate-800",children:h.jsxs("video",{className:"w-full h-auto rounded-md",controls:!0,preload:"auto",muted:!0,children:[h.jsx("source",{src:"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/lerobot/calibrate_so101_2.mp4",type:"video/mp4"}),h.jsxs("p",{className:"text-slate-400 text-sm text-center py-4",children:["Your browser does not support the video tag.",h.jsx("br",{}),h.jsx("a",{href:"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/lerobot/calibrate_so101_2.mp4",className:"text-blue-400 hover:text-blue-300 underline",target:"_blank",rel:"noopener noreferrer",children:"Click here to view the calibration video"})]})]})})]})]})]})]}),n&&h.jsxs(Gr,{className:"bg-slate-800/60 border-slate-700 backdrop-blur-sm mt-6",children:[h.jsx(jo,{children:h.jsxs(ha,{className:"flex items-center gap-2 text-slate-200",children:[h.jsx(Mh,{className:"w-5 h-5 text-blue-400"}),"Attached cameras"]})}),h.jsx(Wr,{children:h.jsx(f4,{cameras:p,onCamerasChange:m})})]})]}),h.jsx(wse,{open:x,onOpenChange:b,robotType:S,onPortDetected:W})]})};var Ow="rovingFocusGroup.onEntryFocus",Cse={bubbles:!1,cancelable:!0},Lm="RovingFocusGroup",[_1,c$,Pse]=tx(Lm),[Rse,u$]=mi(Lm,[Pse]),[Nse,Ose]=Rse(Lm),d$=_.forwardRef((t,e)=>h.jsx(_1.Provider,{scope:t.__scopeRovingFocusGroup,children:h.jsx(_1.Slot,{scope:t.__scopeRovingFocusGroup,children:h.jsx(Ise,{...t,ref:e})})}));d$.displayName=Lm;var Ise=_.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=t,f=_.useRef(null),p=Ot(e,f),y=IA(o),[v,g]=$o({prop:a,defaultProp:s??null,onChange:l,caller:Lm}),[m,x]=_.useState(!1),b=di(c),S=c$(n),w=_.useRef(!1),[E,T]=_.useState(0);return _.useEffect(()=>{const A=f.current;if(A)return A.addEventListener(Ow,b),()=>A.removeEventListener(Ow,b)},[b]),h.jsx(Nse,{scope:n,orientation:r,dir:y,loop:i,currentTabStopId:v,onItemFocus:_.useCallback(A=>g(A),[g]),onItemShiftTab:_.useCallback(()=>x(!0),[]),onFocusableItemAdd:_.useCallback(()=>T(A=>A+1),[]),onFocusableItemRemove:_.useCallback(()=>T(A=>A-1),[]),children:h.jsx(nt.div,{tabIndex:m||E===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:"none",...t.style},onMouseDown:Oe(t.onMouseDown,()=>{w.current=!0}),onFocus:Oe(t.onFocus,A=>{const M=!w.current;if(A.target===A.currentTarget&&M&&!m){const C=new CustomEvent(Ow,Cse);if(A.currentTarget.dispatchEvent(C),!C.defaultPrevented){const P=S().filter(O=>O.focusable),R=P.find(O=>O.active),D=P.find(O=>O.id===v),U=[R,D,...P].filter(Boolean).map(O=>O.ref.current);p$(U,u)}}w.current=!1}),onBlur:Oe(t.onBlur,()=>x(!1))})})}),f$="RovingFocusGroupItem",h$=_.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,children:a,...s}=t,l=sr(),c=o||l,u=Ose(f$,n),d=u.currentTabStopId===c,f=c$(n),{onFocusableItemAdd:p,onFocusableItemRemove:y,currentTabStopId:v}=u;return _.useEffect(()=>{if(r)return p(),()=>y()},[r,p,y]),h.jsx(_1.ItemSlot,{scope:n,id:c,focusable:r,active:i,children:h.jsx(nt.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:e,onMouseDown:Oe(t.onMouseDown,g=>{r?u.onItemFocus(c):g.preventDefault()}),onFocus:Oe(t.onFocus,()=>u.onItemFocus(c)),onKeyDown:Oe(t.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){u.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const m=kse(g,u.orientation,u.dir);if(m!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let b=f().filter(S=>S.focusable).map(S=>S.ref.current);if(m==="last")b.reverse();else if(m==="prev"||m==="next"){m==="prev"&&b.reverse();const S=b.indexOf(g.currentTarget);b=u.loop?jse(b,S+1):b.slice(S+1)}setTimeout(()=>p$(b))}}),children:typeof a=="function"?a({isCurrentTabStop:d,hasTabStop:v!=null}):a})})});h$.displayName=f$;var Dse={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Lse(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function kse(t,e,n){const r=Lse(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Dse[r]}function p$(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function jse(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var Use=d$,Fse=h$,w1=["Enter"," "],Bse=["ArrowDown","PageUp","Home"],m$=["ArrowUp","PageDown","End"],$se=[...Bse,...m$],zse={ltr:[...w1,"ArrowRight"],rtl:[...w1,"ArrowLeft"]},Hse={ltr:["ArrowLeft"],rtl:["ArrowRight"]},km="Menu",[Rp,Vse,Gse]=tx(km),[Wc,g$]=mi(km,[Gse,Sl,u$]),Vx=Sl(),v$=u$(),[Wse,Xc]=Wc(km),[Xse,jm]=Wc(km),y$=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:i,onOpenChange:o,modal:a=!0}=t,s=Vx(e),[l,c]=_.useState(null),u=_.useRef(!1),d=di(o),f=IA(i);return _.useEffect(()=>{const p=()=>{u.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>u.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),h.jsx(px,{...s,children:h.jsx(Wse,{scope:e,open:n,onOpenChange:d,content:l,onContentChange:c,children:h.jsx(Xse,{scope:e,onClose:_.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:a,children:r})})})};y$.displayName=km;var qse="MenuAnchor",lC=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,i=Vx(n);return h.jsx(Am,{...i,...r,ref:e})});lC.displayName=qse;var cC="MenuPortal",[Kse,x$]=Wc(cC,{forceMount:void 0}),b$=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:i}=t,o=Xc(cC,e);return h.jsx(Kse,{scope:e,forceMount:n,children:h.jsx(gi,{present:n||o.open,children:h.jsx(vf,{asChild:!0,container:i,children:r})})})};b$.displayName=cC;var to="MenuContent",[Yse,uC]=Wc(to),_$=_.forwardRef((t,e)=>{const n=x$(to,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,o=Xc(to,t.__scopeMenu),a=jm(to,t.__scopeMenu);return h.jsx(Rp.Provider,{scope:t.__scopeMenu,children:h.jsx(gi,{present:r||o.open,children:h.jsx(Rp.Slot,{scope:t.__scopeMenu,children:a.modal?h.jsx(Jse,{...i,ref:e}):h.jsx(Zse,{...i,ref:e})})})})}),Jse=_.forwardRef((t,e)=>{const n=Xc(to,t.__scopeMenu),r=_.useRef(null),i=Ot(e,r);return _.useEffect(()=>{const o=r.current;if(o)return sx(o)},[]),h.jsx(dC,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Oe(t.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Zse=_.forwardRef((t,e)=>{const n=Xc(to,t.__scopeMenu);return h.jsx(dC,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Qse=al("MenuContent.ScrollLock"),dC=_.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:y,...v}=t,g=Xc(to,n),m=jm(to,n),x=Vx(n),b=v$(n),S=Vse(n),[w,E]=_.useState(null),T=_.useRef(null),A=Ot(e,T,g.onContentChange),M=_.useRef(0),C=_.useRef(""),P=_.useRef(0),R=_.useRef(null),D=_.useRef("right"),k=_.useRef(0),U=y?Tm:_.Fragment,O=y?{as:Qse,allowPinchZoom:!0}:void 0,W=j=>{var ee,ce;const X=C.current+j,K=S().filter(ae=>!ae.disabled),F=document.activeElement,Y=(ee=K.find(ae=>ae.ref.current===F))==null?void 0:ee.textValue,q=K.map(ae=>ae.textValue),Q=dle(q,X,Y),te=(ce=K.find(ae=>ae.textValue===Q))==null?void 0:ce.ref.current;(function ae(fe){C.current=fe,window.clearTimeout(M.current),fe!==""&&(M.current=window.setTimeout(()=>ae(""),1e3))})(X),te&&setTimeout(()=>te.focus())};_.useEffect(()=>()=>window.clearTimeout(M.current),[]),ox();const L=_.useCallback(j=>{var K,F;return D.current===((K=R.current)==null?void 0:K.side)&&hle(j,(F=R.current)==null?void 0:F.area)},[]);return h.jsx(Yse,{scope:n,searchRef:C,onItemEnter:_.useCallback(j=>{L(j)&&j.preventDefault()},[L]),onItemLeave:_.useCallback(j=>{var X;L(j)||((X=T.current)==null||X.focus(),E(null))},[L]),onTriggerLeave:_.useCallback(j=>{L(j)&&j.preventDefault()},[L]),pointerGraceTimerRef:P,onPointerGraceIntentChange:_.useCallback(j=>{R.current=j},[]),children:h.jsx(U,{...O,children:h.jsx(Em,{asChild:!0,trapped:i,onMountAutoFocus:Oe(o,j=>{var X;j.preventDefault(),(X=T.current)==null||X.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:h.jsx(zc,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:h.jsx(Use,{asChild:!0,...b,dir:m.dir,orientation:"vertical",loop:r,currentTabStopId:w,onCurrentTabStopIdChange:E,onEntryFocus:Oe(l,j=>{m.isUsingKeyboardRef.current||j.preventDefault()}),preventScrollOnEntryFocus:!0,children:h.jsx(mx,{role:"menu","aria-orientation":"vertical","data-state":j$(g.open),"data-radix-menu-content":"",dir:m.dir,...x,...v,ref:A,style:{outline:"none",...v.style},onKeyDown:Oe(v.onKeyDown,j=>{const K=j.target.closest("[data-radix-menu-content]")===j.currentTarget,F=j.ctrlKey||j.altKey||j.metaKey,Y=j.key.length===1;K&&(j.key==="Tab"&&j.preventDefault(),!F&&Y&&W(j.key));const q=T.current;if(j.target!==q||!$se.includes(j.key))return;j.preventDefault();const te=S().filter(ee=>!ee.disabled).map(ee=>ee.ref.current);m$.includes(j.key)&&te.reverse(),cle(te)}),onBlur:Oe(t.onBlur,j=>{j.currentTarget.contains(j.target)||(window.clearTimeout(M.current),C.current="")}),onPointerMove:Oe(t.onPointerMove,Np(j=>{const X=j.target,K=k.current!==j.clientX;if(j.currentTarget.contains(X)&&K){const F=j.clientX>k.current?"right":"left";D.current=F,k.current=j.clientX}}))})})})})})})});_$.displayName=to;var ele="MenuGroup",fC=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return h.jsx(nt.div,{role:"group",...r,ref:e})});fC.displayName=ele;var tle="MenuLabel",w$=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return h.jsx(nt.div,{...r,ref:e})});w$.displayName=tle;var Iy="MenuItem",b2="menu.itemSelect",Gx=_.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...i}=t,o=_.useRef(null),a=jm(Iy,t.__scopeMenu),s=uC(Iy,t.__scopeMenu),l=Ot(e,o),c=_.useRef(!1),u=()=>{const d=o.current;if(!n&&d){const f=new CustomEvent(b2,{bubbles:!0,cancelable:!0});d.addEventListener(b2,p=>r==null?void 0:r(p),{once:!0}),XM(d,f),f.defaultPrevented?c.current=!1:a.onClose()}};return h.jsx(S$,{...i,ref:l,disabled:n,onClick:Oe(t.onClick,u),onPointerDown:d=>{var f;(f=t.onPointerDown)==null||f.call(t,d),c.current=!0},onPointerUp:Oe(t.onPointerUp,d=>{var f;c.current||(f=d.currentTarget)==null||f.click()}),onKeyDown:Oe(t.onKeyDown,d=>{const f=s.searchRef.current!=="";n||f&&d.key===" "||w1.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});Gx.displayName=Iy;var S$=_.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=t,a=uC(Iy,n),s=v$(n),l=_.useRef(null),c=Ot(e,l),[u,d]=_.useState(!1),[f,p]=_.useState("");return _.useEffect(()=>{const y=l.current;y&&p((y.textContent??"").trim())},[o.children]),h.jsx(Rp.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:h.jsx(Fse,{asChild:!0,...s,focusable:!r,children:h.jsx(nt.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:c,onPointerMove:Oe(t.onPointerMove,Np(y=>{r?a.onItemLeave(y):(a.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Oe(t.onPointerLeave,Np(y=>a.onItemLeave(y))),onFocus:Oe(t.onFocus,()=>d(!0)),onBlur:Oe(t.onBlur,()=>d(!1))})})})}),nle="MenuCheckboxItem",E$=_.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...i}=t;return h.jsx(P$,{scope:t.__scopeMenu,checked:n,children:h.jsx(Gx,{role:"menuitemcheckbox","aria-checked":Dy(n)?"mixed":n,...i,ref:e,"data-state":pC(n),onSelect:Oe(i.onSelect,()=>r==null?void 0:r(Dy(n)?!0:!n),{checkForDefaultPrevented:!1})})})});E$.displayName=nle;var T$="MenuRadioGroup",[rle,ile]=Wc(T$,{value:void 0,onValueChange:()=>{}}),M$=_.forwardRef((t,e)=>{const{value:n,onValueChange:r,...i}=t,o=di(r);return h.jsx(rle,{scope:t.__scopeMenu,value:n,onValueChange:o,children:h.jsx(fC,{...i,ref:e})})});M$.displayName=T$;var A$="MenuRadioItem",C$=_.forwardRef((t,e)=>{const{value:n,...r}=t,i=ile(A$,t.__scopeMenu),o=n===i.value;return h.jsx(P$,{scope:t.__scopeMenu,checked:o,children:h.jsx(Gx,{role:"menuitemradio","aria-checked":o,...r,ref:e,"data-state":pC(o),onSelect:Oe(r.onSelect,()=>{var a;return(a=i.onValueChange)==null?void 0:a.call(i,n)},{checkForDefaultPrevented:!1})})})});C$.displayName=A$;var hC="MenuItemIndicator",[P$,ole]=Wc(hC,{checked:!1}),R$=_.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...i}=t,o=ole(hC,n);return h.jsx(gi,{present:r||Dy(o.checked)||o.checked===!0,children:h.jsx(nt.span,{...i,ref:e,"data-state":pC(o.checked)})})});R$.displayName=hC;var ale="MenuSeparator",N$=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return h.jsx(nt.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});N$.displayName=ale;var sle="MenuArrow",O$=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,i=Vx(n);return h.jsx(gx,{...i,...r,ref:e})});O$.displayName=sle;var lle="MenuSub",[SDe,I$]=Wc(lle),Oh="MenuSubTrigger",D$=_.forwardRef((t,e)=>{const n=Xc(Oh,t.__scopeMenu),r=jm(Oh,t.__scopeMenu),i=I$(Oh,t.__scopeMenu),o=uC(Oh,t.__scopeMenu),a=_.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:l}=o,c={__scopeMenu:t.__scopeMenu},u=_.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return _.useEffect(()=>u,[u]),_.useEffect(()=>{const d=s.current;return()=>{window.clearTimeout(d),l(null)}},[s,l]),h.jsx(lC,{asChild:!0,...c,children:h.jsx(S$,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":j$(n.open),...t,ref:ts(e,i.onTriggerChange),onClick:d=>{var f;(f=t.onClick)==null||f.call(t,d),!(t.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Oe(t.onPointerMove,Np(d=>{o.onItemEnter(d),!d.defaultPrevented&&!t.disabled&&!n.open&&!a.current&&(o.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:Oe(t.onPointerLeave,Np(d=>{var p,y;u();const f=(p=n.content)==null?void 0:p.getBoundingClientRect();if(f){const v=(y=n.content)==null?void 0:y.dataset.side,g=v==="right",m=g?-5:5,x=f[g?"left":"right"],b=f[g?"right":"left"];o.onPointerGraceIntentChange({area:[{x:d.clientX+m,y:d.clientY},{x,y:f.top},{x:b,y:f.top},{x:b,y:f.bottom},{x,y:f.bottom}],side:v}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(d),d.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Oe(t.onKeyDown,d=>{var p;const f=o.searchRef.current!=="";t.disabled||f&&d.key===" "||zse[r.dir].includes(d.key)&&(n.onOpenChange(!0),(p=n.content)==null||p.focus(),d.preventDefault())})})})});D$.displayName=Oh;var L$="MenuSubContent",k$=_.forwardRef((t,e)=>{const n=x$(to,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,o=Xc(to,t.__scopeMenu),a=jm(to,t.__scopeMenu),s=I$(L$,t.__scopeMenu),l=_.useRef(null),c=Ot(e,l);return h.jsx(Rp.Provider,{scope:t.__scopeMenu,children:h.jsx(gi,{present:r||o.open,children:h.jsx(Rp.Slot,{scope:t.__scopeMenu,children:h.jsx(dC,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:c,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var d;a.isUsingKeyboardRef.current&&((d=l.current)==null||d.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:Oe(t.onFocusOutside,u=>{u.target!==s.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Oe(t.onEscapeKeyDown,u=>{a.onClose(),u.preventDefault()}),onKeyDown:Oe(t.onKeyDown,u=>{var p;const d=u.currentTarget.contains(u.target),f=Hse[a.dir].includes(u.key);d&&f&&(o.onOpenChange(!1),(p=s.trigger)==null||p.focus(),u.preventDefault())})})})})})});k$.displayName=L$;function j$(t){return t?"open":"closed"}function Dy(t){return t==="indeterminate"}function pC(t){return Dy(t)?"indeterminate":t?"checked":"unchecked"}function cle(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function ule(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function dle(t,e,n){const i=e.length>1&&Array.from(e).every(c=>c===e[0])?e[0]:e,o=n?t.indexOf(n):-1;let a=ule(t,Math.max(o,0));i.length===1&&(a=a.filter(c=>c!==n));const l=a.find(c=>c.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function fle(t,e){const{x:n,y:r}=t;let i=!1;for(let o=0,a=e.length-1;or!=f>r&&n<(d-c)*(r-u)/(f-u)+c&&(i=!i)}return i}function hle(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return fle(n,e)}function Np(t){return e=>e.pointerType==="mouse"?t(e):void 0}var ple=y$,mle=lC,gle=b$,vle=_$,yle=fC,xle=w$,ble=Gx,_le=E$,wle=M$,Sle=C$,Ele=R$,Tle=N$,Mle=O$,Ale=D$,Cle=k$,Wx="DropdownMenu",[Ple,EDe]=mi(Wx,[g$]),Zr=g$(),[Rle,U$]=Ple(Wx),F$=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:i,defaultOpen:o,onOpenChange:a,modal:s=!0}=t,l=Zr(e),c=_.useRef(null),[u,d]=$o({prop:i,defaultProp:o??!1,onChange:a,caller:Wx});return h.jsx(Rle,{scope:e,triggerId:sr(),triggerRef:c,contentId:sr(),open:u,onOpenChange:d,onOpenToggle:_.useCallback(()=>d(f=>!f),[d]),modal:s,children:h.jsx(ple,{...l,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};F$.displayName=Wx;var B$="DropdownMenuTrigger",$$=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=t,o=U$(B$,n),a=Zr(n);return h.jsx(mle,{asChild:!0,...a,children:h.jsx(nt.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:ts(e,o.triggerRef),onPointerDown:Oe(t.onPointerDown,s=>{!r&&s.button===0&&s.ctrlKey===!1&&(o.onOpenToggle(),o.open||s.preventDefault())}),onKeyDown:Oe(t.onKeyDown,s=>{r||(["Enter"," "].includes(s.key)&&o.onOpenToggle(),s.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})})});$$.displayName=B$;var Nle="DropdownMenuPortal",z$=t=>{const{__scopeDropdownMenu:e,...n}=t,r=Zr(e);return h.jsx(gle,{...r,...n})};z$.displayName=Nle;var H$="DropdownMenuContent",V$=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=U$(H$,n),o=Zr(n),a=_.useRef(!1);return h.jsx(vle,{id:i.contentId,"aria-labelledby":i.triggerId,...o,...r,ref:e,onCloseAutoFocus:Oe(t.onCloseAutoFocus,s=>{var l;a.current||(l=i.triggerRef.current)==null||l.focus(),a.current=!1,s.preventDefault()}),onInteractOutside:Oe(t.onInteractOutside,s=>{const l=s.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;(!i.modal||u)&&(a.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});V$.displayName=H$;var Ole="DropdownMenuGroup",Ile=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(yle,{...i,...r,ref:e})});Ile.displayName=Ole;var Dle="DropdownMenuLabel",G$=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(xle,{...i,...r,ref:e})});G$.displayName=Dle;var Lle="DropdownMenuItem",W$=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(ble,{...i,...r,ref:e})});W$.displayName=Lle;var kle="DropdownMenuCheckboxItem",X$=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(_le,{...i,...r,ref:e})});X$.displayName=kle;var jle="DropdownMenuRadioGroup",Ule=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(wle,{...i,...r,ref:e})});Ule.displayName=jle;var Fle="DropdownMenuRadioItem",q$=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(Sle,{...i,...r,ref:e})});q$.displayName=Fle;var Ble="DropdownMenuItemIndicator",K$=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(Ele,{...i,...r,ref:e})});K$.displayName=Ble;var $le="DropdownMenuSeparator",Y$=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(Tle,{...i,...r,ref:e})});Y$.displayName=$le;var zle="DropdownMenuArrow",Hle=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(Mle,{...i,...r,ref:e})});Hle.displayName=zle;var Vle="DropdownMenuSubTrigger",J$=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(Ale,{...i,...r,ref:e})});J$.displayName=Vle;var Gle="DropdownMenuSubContent",Z$=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(Cle,{...i,...r,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Z$.displayName=Gle;var Wle=F$,Xle=$$,qle=z$,Q$=V$,ez=G$,tz=W$,nz=X$,rz=q$,iz=K$,oz=Y$,az=J$,sz=Z$;const Kle=Wle,Yle=Xle,Jle=_.forwardRef(({className:t,inset:e,children:n,...r},i)=>h.jsxs(az,{ref:i,className:He("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",e&&"pl-8",t),...r,children:[n,h.jsx(xp,{className:"ml-auto h-4 w-4"})]}));Jle.displayName=az.displayName;const Zle=_.forwardRef(({className:t,...e},n)=>h.jsx(sz,{ref:n,className:He("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...e}));Zle.displayName=sz.displayName;const lz=_.forwardRef(({className:t,sideOffset:e=4,...n},r)=>h.jsx(qle,{children:h.jsx(Q$,{ref:r,sideOffset:e,className:He("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n})}));lz.displayName=Q$.displayName;const S1=_.forwardRef(({className:t,inset:e,...n},r)=>h.jsx(tz,{ref:r,className:He("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e&&"pl-8",t),...n}));S1.displayName=tz.displayName;const Qle=_.forwardRef(({className:t,children:e,checked:n,...r},i)=>h.jsxs(nz,{ref:i,className:He("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:n,...r,children:[h.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:h.jsx(iz,{children:h.jsx(yl,{className:"h-4 w-4"})})}),e]}));Qle.displayName=nz.displayName;const ece=_.forwardRef(({className:t,children:e,...n},r)=>h.jsxs(rz,{ref:r,className:He("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[h.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:h.jsx(iz,{children:h.jsx(uE,{className:"h-2 w-2 fill-current"})})}),e]}));ece.displayName=rz.displayName;const tce=_.forwardRef(({className:t,inset:e,...n},r)=>h.jsx(ez,{ref:r,className:He("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...n}));tce.displayName=ez.displayName;const nce=_.forwardRef(({className:t,...e},n)=>h.jsx(oz,{ref:n,className:He("-mx-1 my-1 h-px bg-muted",t),...e}));nce.displayName=oz.displayName;const cz="lelab.recording.muted";let Iw=null;const rce=()=>(Iw||(Iw=new AudioContext),Iw),uz=()=>localStorage.getItem(cz)==="1",ice=t=>{localStorage.setItem(cz,t?"1":"0")},gc=(t,e,n=0)=>{if(uz())return;const r=rce(),i=r.createOscillator(),o=r.createGain();i.frequency.value=t,i.type="sine",o.gain.value=0,i.connect(o),o.connect(r.destination);const a=r.currentTime+n/1e3,s=a+e/1e3;o.gain.setValueAtTime(0,a),o.gain.linearRampToValueAtTime(.2,a+.01),o.gain.setValueAtTime(.2,s-.02),o.gain.linearRampToValueAtTime(0,s),i.start(a),i.stop(s)},oce=()=>{gc(660,80,0),gc(880,80,90)},ace=()=>{gc(660,80,0),gc(440,80,90)},sce=()=>{gc(880,70,0),gc(880,70,1e3),gc(880,70,2e3)};var dz="AlertDialog",[lce,TDe]=mi(dz,[rF]),cs=rF(),fz=t=>{const{__scopeAlertDialog:e,...n}=t,r=cs(e);return h.jsx(lA,{...r,...n,modal:!0})};fz.displayName=dz;var cce="AlertDialogTrigger",uce=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=cs(n);return h.jsx(Kq,{...i,...r,ref:e})});uce.displayName=cce;var dce="AlertDialogPortal",hz=t=>{const{__scopeAlertDialog:e,...n}=t,r=cs(e);return h.jsx(cA,{...r,...n})};hz.displayName=dce;var fce="AlertDialogOverlay",pz=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=cs(n);return h.jsx(cx,{...i,...r,ref:e})});pz.displayName=fce;var dd="AlertDialogContent",[hce,pce]=lce(dd),mce=aU("AlertDialogContent"),mz=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,children:r,...i}=t,o=cs(n),a=_.useRef(null),s=Ot(e,a),l=_.useRef(null);return h.jsx(Gq,{contentName:dd,titleName:gz,docsSlug:"alert-dialog",children:h.jsx(hce,{scope:n,cancelRef:l,children:h.jsxs(ux,{role:"alertdialog",...o,...i,ref:s,onOpenAutoFocus:Oe(i.onOpenAutoFocus,c=>{var u;c.preventDefault(),(u=l.current)==null||u.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[h.jsx(mce,{children:r}),h.jsx(vce,{contentRef:a})]})})})});mz.displayName=dd;var gz="AlertDialogTitle",vz=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=cs(n);return h.jsx(uA,{...i,...r,ref:e})});vz.displayName=gz;var yz="AlertDialogDescription",xz=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=cs(n);return h.jsx(dA,{...i,...r,ref:e})});xz.displayName=yz;var gce="AlertDialogAction",bz=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=cs(n);return h.jsx(fA,{...i,...r,ref:e})});bz.displayName=gce;var _z="AlertDialogCancel",wz=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,{cancelRef:i}=pce(_z,n),o=cs(n),a=Ot(e,i);return h.jsx(fA,{...o,...r,ref:a})});wz.displayName=_z;var vce=({contentRef:t})=>{const e=`\`${dd}\` requires a description for the component to be accessible for screen reader users. - -You can add a description to the \`${dd}\` by passing a \`${yz}\` component as a child, which also benefits sighted users by adding visible context to the dialog. - -Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${dd}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. - -For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return _.useEffect(()=>{var r;document.getElementById((r=t.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(e)},[e,t]),null},yce=fz,xce=hz,Sz=pz,Ez=mz,Tz=bz,Mz=wz,Az=vz,Cz=xz;const mC=yce,bce=xce,Pz=_.forwardRef(({className:t,...e},n)=>h.jsx(Sz,{className:He("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e,ref:n}));Pz.displayName=Sz.displayName;const Xx=_.forwardRef(({className:t,...e},n)=>h.jsxs(bce,{children:[h.jsx(Pz,{}),h.jsx(Ez,{ref:n,className:He("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...e})]}));Xx.displayName=Ez.displayName;const qx=({className:t,...e})=>h.jsx("div",{className:He("flex flex-col space-y-2 text-center sm:text-left",t),...e});qx.displayName="AlertDialogHeader";const Kx=({className:t,...e})=>h.jsx("div",{className:He("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});Kx.displayName="AlertDialogFooter";const Yx=_.forwardRef(({className:t,...e},n)=>h.jsx(Az,{ref:n,className:He("text-lg font-semibold",t),...e}));Yx.displayName=Az.displayName;const Jx=_.forwardRef(({className:t,...e},n)=>h.jsx(Cz,{ref:n,className:He("text-sm text-muted-foreground",t),...e}));Jx.displayName=Cz.displayName;const Zx=_.forwardRef(({className:t,...e},n)=>h.jsx(Tz,{ref:n,className:He(iA(),t),...e}));Zx.displayName=Tz.displayName;const Qx=_.forwardRef(({className:t,...e},n)=>h.jsx(Mz,{ref:n,className:He(iA({variant:"outline"}),"mt-2 sm:mt-0",t),...e}));Qx.displayName=Mz.displayName;const _ce=()=>{var le;const t=vl(),e=ji(),{toast:n}=Dr(),{baseUrl:r,wsBaseUrl:i,fetchWithHeaders:o}=Ln(),a=(le=t.state)==null?void 0:le.recordingConfig,[s,l]=_.useState(null),[c,u]=_.useState(!1),[d,f]=_.useState(null),[p,y]=_.useState(!1),[v,g]=_.useState(()=>uz()),m=_.useRef(null),[x,b]=_.useState(0),S=_.useRef({phase:null,episode:null,tick:0}),w=_.useRef(!1),E=_.useRef(!1),T=_.useCallback(()=>{g(ie=>{const G=!ie;return ice(G),G})},[]);_.useEffect(()=>{a||(n({title:"No Configuration",description:"Please start recording from the main page.",variant:"destructive"}),e("/"))},[a,e,n]),_.useEffect(()=>{a&&!E.current&&(E.current=!0,P())},[a]);const A=_.useRef(d);A.current=d;const M=_.useRef(x);M.current=x,_.useEffect(()=>{if(!c)return;const ie=async()=>{try{const Ve=await o(`${r}/recording-status`);if(!Ve.ok)return;const Ne=await Ve.json();l(Ne);const st=A.current;st&&Ne.current_phase===st&&f(null);const Re=Ne.current_phase,ct=m.current;ct!==Re&&(Re==="recording"&&ct!==null?oce():Re==="resetting"&&ace(),m.current=Re,S.current={phase:null,episode:null,tick:0});const Ye=Ne.phase_elapsed_seconds||0,it=Ne.phase_time_limit_s||0,Ft=it>3&&Ye>=it-3,J=Ne.current_episode??null,B=M.current,ue=S.current;if(Ft&&st===null&&(ue.phase!==Re||ue.episode!==J||ue.tick!==B)&&(sce(),S.current={phase:Re,episode:J,tick:B}),!Ne.recording_active&&Ne.session_ended&&Ne.current_phase==="error"){w.current||(w.current=!0,u(!1),n({title:"Recording failed",description:Ne.error||Ne.message||"Check the robot connection and try again.",variant:"destructive"}));return}if(!Ne.recording_active&&Ne.session_ended){const me={dataset_repo_id:Ne.dataset_repo_id||a.dataset_repo_id,single_task:a.single_task,num_episodes:a.num_episodes,saved_episodes:Ne.saved_episodes||0,session_elapsed_seconds:Ne.session_elapsed_seconds||0};e("/upload",{state:{datasetInfo:me}})}}catch(Ve){console.error("Error polling recording status:",Ve)}};ie();const G=setInterval(ie,1e3);return()=>clearInterval(G)},[c,a,e,r,o]);const C=ie=>{const G=Math.floor(ie/60),Ve=ie%60;return`${G.toString().padStart(2,"0")}:${Ve.toString().padStart(2,"0")}`},P=async()=>{try{const ie=await o(`${r}/start-recording`,{method:"POST",body:JSON.stringify(a)}),G=await ie.json();ie.ok?(w.current=!1,u(!0),n({title:"Recording Started",description:`Started recording ${a.num_episodes} episodes`})):(n({title:"Error Starting Recording",description:G.message||"Failed to start recording session.",variant:"destructive"}),e("/"))}catch{n({title:"Connection Error",description:"Could not connect to the backend server.",variant:"destructive"}),e("/")}},R=_.useCallback(async()=>{if(!(s!=null&&s.available_controls.exit_early)||d!==null)return;const ie=s.current_phase,G=ie==="recording"?"resetting":ie==="resetting"?"recording":null;if(G){f(G);try{const Ve=await o(`${r}/recording-exit-early`,{method:"POST"});if(!Ve.ok){const Ne=await Ve.json();f(null),n({title:"Error",description:Ne.message,variant:"destructive"})}}catch{f(null),n({title:"Connection Error",description:"Could not connect to the backend server.",variant:"destructive"})}}},[s,d,r,o,n]),D=_.useCallback(async()=>{if(s!=null&&s.available_controls.rerecord_episode)try{const ie=await o(`${r}/recording-rerecord-episode`,{method:"POST"}),G=await ie.json();ie.ok?(b(Ve=>Ve+1),n({title:"Re-recording Episode",description:`Episode ${s.current_episode} will be re-recorded.`})):n({title:"Error",description:G.message,variant:"destructive"})}catch{n({title:"Connection Error",description:"Could not connect to the backend server.",variant:"destructive"})}},[s,r,o,n]),k=_.useCallback(async()=>{if(s!=null&&s.available_controls.stop_recording)try{await o(`${r}/stop-recording`,{method:"POST"}),n({title:"Stopping recording",description:"Finalizing datasetโ€ฆ"})}catch{n({title:"Error",description:"Failed to stop recording.",variant:"destructive"})}},[s,r,o,n]),U=_.useCallback(()=>{s!=null&&s.available_controls.stop_recording&&y(!0)},[s]),O=_.useCallback(async()=>{y(!1),await k()},[k]),W=_.useRef({handleExitEarly:R,handleRerecordEpisode:D,requestStopRecording:U,showStopConfirm:p});_.useEffect(()=>{W.current={handleExitEarly:R,handleRerecordEpisode:D,requestStopRecording:U,showStopConfirm:p}});const L=c&&s!==null;if(_.useEffect(()=>{if(!L)return;const ie=G=>{const Ve=G.target;if(!(Ve&&(Ve.tagName==="INPUT"||Ve.tagName==="TEXTAREA"||Ve.isContentEditable))){if(G.key===" "||G.code==="Space"||G.key==="ArrowRight")G.preventDefault(),W.current.handleExitEarly();else if(G.key==="ArrowLeft")G.preventDefault(),W.current.handleRerecordEpisode();else if(G.key==="Escape"){if(W.current.showStopConfirm)return;W.current.requestStopRecording()}}};return window.addEventListener("keydown",ie),()=>window.removeEventListener("keydown",ie)},[L]),!a)return h.jsx("div",{className:"min-h-screen bg-black text-white flex items-center justify-center",children:h.jsxs("div",{className:"text-center",children:[h.jsx("p",{className:"text-lg",children:"No recording configuration found."}),h.jsx(et,{onClick:()=>e("/"),className:"mt-4",children:"Return to Home"})]})});if(!s)return h.jsx("div",{className:"min-h-screen bg-black text-white flex items-center justify-center",children:h.jsxs("div",{className:"text-center",children:[h.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-red-500 mx-auto mb-4"}),h.jsx("p",{className:"text-lg",children:"Connecting to recording session..."})]})});const j=s.current_phase,X=d??j,K=s.current_episode??1,F=s.total_episodes??a.num_episodes,Y=d?0:s.phase_elapsed_seconds||0,q=X==="recording"?a.episode_time_s:X==="resetting"?a.reset_time_s:s.phase_time_limit_s||0,Q=s.session_elapsed_seconds||0,te=()=>X==="recording"?`RECORDING EPISODE ${K}`:X==="resetting"?"RESET โ€” GET READY":X==="preparing"?"PREPARING SESSION":X==="stopping"?"STOPPING RECORDING":X==="error"?"RECORDING ERROR":"SESSION COMPLETE",ee=X==="recording"?{dot:"bg-red-500",pill:"bg-red-500/15 text-red-300",timer:"text-green-400",bar:"bg-green-500",button:"bg-green-500 hover:bg-green-600"}:X==="resetting"?{dot:"bg-orange-500",pill:"bg-orange-500/15 text-orange-300",timer:"text-orange-400",bar:"bg-orange-500",button:"bg-orange-500 hover:bg-orange-600"}:{dot:"bg-gray-500",pill:"bg-gray-500/15 text-gray-300",timer:"text-gray-400",bar:"bg-gray-500",button:"bg-gray-500"},ce=X==="recording"?"End Episode":X==="resetting"?"Start Next Episode":X==="stopping"?"Stopping...":X==="error"?"Recording failed":"Advance",ae=X==="recording"?eX:Tc,fe=s.available_controls.exit_early&&d===null&&(X==="recording"||X==="resetting"),we=q>0?Math.min(Y/q*100,100):0;return h.jsxs("div",{className:"min-h-screen bg-black text-white p-8",children:[h.jsxs("div",{className:"max-w-2xl mx-auto",children:[h.jsx("div",{className:"mb-8",children:h.jsxs(et,{onClick:()=>e("/"),variant:"outline",className:"border-gray-500 hover:border-gray-200 text-gray-300 hover:text-white",children:[h.jsx(sl,{className:"w-4 h-4 mr-2"}),"Back to Home"]})}),h.jsxs("div",{className:"bg-gray-900 rounded-lg border border-gray-700 p-8",children:[h.jsxs("div",{className:"flex justify-end items-center gap-4 mb-6 text-sm text-gray-400",children:[h.jsxs("span",{"aria-label":`Episode ${K} of ${F}`,children:["Episode ",h.jsx("span",{className:"text-white font-semibold",children:K})," / ",F]}),h.jsx("span",{className:"font-mono","aria-label":`Total session time ${C(Q)}`,children:C(Q)}),h.jsx(et,{variant:"ghost",size:"icon",onClick:T,"aria-label":v?"Unmute":"Mute",className:"h-8 w-8 text-gray-400 hover:text-white hover:bg-gray-800",children:v?h.jsx(rX,{className:"w-5 h-5"}):h.jsx(nX,{className:"w-5 h-5"})}),h.jsxs(Kle,{children:[h.jsx(Yle,{asChild:!0,children:h.jsx(et,{variant:"ghost",size:"icon",className:"h-8 w-8 text-gray-400 hover:text-white hover:bg-gray-800","aria-label":"More actions",children:h.jsx(G7,{className:"w-5 h-5"})})}),h.jsxs(lz,{align:"end",onCloseAutoFocus:ie=>ie.preventDefault(),className:"bg-gray-900 border-gray-700 text-white",children:[h.jsxs(S1,{onClick:D,disabled:!s.available_controls.rerecord_episode,className:"focus:bg-gray-800 focus:text-white",children:[h.jsx(Q7,{className:"w-4 h-4 mr-2"}),"Re-record episode"]}),h.jsxs(S1,{onClick:U,disabled:!s.available_controls.stop_recording,className:"text-red-400 focus:bg-gray-800 focus:text-red-300",children:[h.jsx(Od,{className:"w-4 h-4 mr-2"}),"Stop recording"]})]})]})]}),h.jsx("div",{className:"text-center mb-6",children:h.jsxs("div",{role:"status","aria-live":"polite",className:`inline-flex items-center gap-2 px-3 py-1 rounded-full text-xs font-bold tracking-widest ${ee.pill}`,children:[h.jsx("span",{className:`w-2 h-2 rounded-full ${ee.dot} ${X!=="completed"?"animate-pulse":""}`}),te()]})}),h.jsxs("div",{className:"text-center mb-4",children:[h.jsx("div",{className:`text-7xl font-mono font-bold leading-none ${ee.timer}`,children:C(Y)}),h.jsxs("div",{className:"text-sm text-gray-500 mt-2",children:["/ ",C(q)]})]}),h.jsx("div",{className:"w-full bg-gray-800 rounded-full h-1.5 mb-8",children:h.jsx("div",{className:`h-1.5 rounded-full transition-all duration-500 ${ee.bar}`,style:{width:`${we}%`}})}),h.jsxs(et,{onClick:R,disabled:!fe,className:`w-full text-white font-semibold py-6 text-lg disabled:opacity-50 ${ee.button}`,children:[h.jsx(ae,{className:"w-5 h-5 mr-2"}),ce,(X==="recording"||X==="resetting")&&h.jsx("span",{className:"ml-3 px-2 py-0.5 rounded text-xs font-mono bg-black/30 text-white/70",children:"SPACE / โ†’"})]}),X==="completed"&&h.jsx("p",{className:"text-center text-sm text-gray-400 mt-6",children:"Recording complete โ€” redirecting to uploadโ€ฆ"})]})]}),h.jsx(mC,{open:p,onOpenChange:y,children:h.jsxs(Xx,{className:"bg-gray-900 border-gray-700 text-white",children:[h.jsxs(qx,{children:[h.jsx(Yx,{children:"Stop recording?"}),h.jsx(Jx,{className:"text-gray-400",children:"Saved episodes are kept. The session will end and you'll be taken to the upload page."})]}),h.jsxs(Kx,{children:[h.jsx(Qx,{className:"bg-gray-800 border-gray-700 text-white hover:bg-gray-700",children:"Keep recording"}),h.jsx(Zx,{onClick:O,className:"bg-red-500 hover:bg-red-600 text-white",children:"Stop"})]})]})})]})},Dw=()=>{const t=ji();return h.jsx("div",{className:"flex items-center justify-between mb-8",children:h.jsxs("div",{className:"flex items-center gap-4 text-3xl",children:[h.jsx(et,{variant:"ghost",size:"icon",onClick:()=>t("/"),className:"text-slate-400 hover:bg-slate-800 hover:text-white rounded-lg",children:h.jsx(sl,{className:"w-5 h-5"})}),h.jsx(Hx,{}),h.jsx("h1",{className:"font-bold text-white text-2xl",children:"Training"})]})})};var eb="Switch",[wce,MDe]=mi(eb),[Sce,Ece]=wce(eb),Rz=_.forwardRef((t,e)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:o,required:a,disabled:s,value:l="on",onCheckedChange:c,form:u,...d}=t,[f,p]=_.useState(null),y=Ot(e,b=>p(b)),v=_.useRef(!1),g=f?u||!!f.closest("form"):!0,[m,x]=$o({prop:i,defaultProp:o??!1,onChange:c,caller:eb});return h.jsxs(Sce,{scope:n,checked:m,disabled:s,children:[h.jsx(nt.button,{type:"button",role:"switch","aria-checked":m,"aria-required":a,"data-state":Dz(m),"data-disabled":s?"":void 0,disabled:s,value:l,...d,ref:y,onClick:Oe(t.onClick,b=>{x(S=>!S),g&&(v.current=b.isPropagationStopped(),v.current||b.stopPropagation())})}),g&&h.jsx(Iz,{control:f,bubbles:!v.current,name:r,value:l,checked:m,required:a,disabled:s,form:u,style:{transform:"translateX(-100%)"}})]})});Rz.displayName=eb;var Nz="SwitchThumb",Oz=_.forwardRef((t,e)=>{const{__scopeSwitch:n,...r}=t,i=Ece(Nz,n);return h.jsx(nt.span,{"data-state":Dz(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:e})});Oz.displayName=Nz;var Tce="SwitchBubbleInput",Iz=_.forwardRef(({__scopeSwitch:t,control:e,checked:n,bubbles:r=!0,...i},o)=>{const a=_.useRef(null),s=Ot(a,o),l=MA(n),c=bA(e);return _.useEffect(()=>{const u=a.current;if(!u)return;const d=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(d,"checked").set;if(l!==n&&p){const y=new Event("click",{bubbles:r});p.call(u,n),u.dispatchEvent(y)}},[l,n,r]),h.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...i.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Iz.displayName=Tce;function Dz(t){return t?"checked":"unchecked"}var Lz=Rz,Mce=Oz;const Jl=_.forwardRef(({className:t,...e},n)=>h.jsx(Lz,{className:He("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",t),...e,ref:n,children:h.jsx(Mce,{className:He("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));Jl.displayName=Lz.displayName;const _2=/^[\w.\-]+\/[\w.\-]+$/,Ace=({datasets:t,loading:e,value:n,onChange:r})=>{const[i,o]=Z.useState(!1),[a,s]=Z.useState(!1),[l,c]=Z.useState(""),u=()=>{const y=l.trim();_2.test(y)&&(r(y),s(!1))},d=t.filter(y=>y.source==="local"||y.source==="both"),f=t.filter(y=>y.source==="hub"),p=y=>h.jsxs(kd,{value:y.repo_id,onSelect:()=>{r(y.repo_id),o(!1)},className:"text-white aria-selected:bg-gray-700",children:[h.jsx(yl,{className:He("mr-2 h-4 w-4",n===y.repo_id?"opacity-100":"opacity-0")}),h.jsx("span",{className:"flex-1 truncate",children:y.repo_id}),y.source==="both"&&h.jsx("span",{className:"text-xs text-gray-400 mr-2",children:"on Hub"}),y.private&&h.jsx("span",{className:"text-xs text-amber-400",children:"private"})]},y.repo_id);return a?h.jsxs("div",{className:"flex gap-2",children:[h.jsx(hi,{autoFocus:!0,value:l,onChange:y=>c(y.target.value),onKeyDown:y=>{y.key==="Enter"&&u()},placeholder:"org/dataset-name",className:"bg-gray-800 border-gray-600 text-white"}),h.jsx(et,{onClick:u,disabled:!_2.test(l.trim()),children:"Use"}),h.jsx(et,{variant:"ghost",onClick:()=>s(!1),children:"Cancel"})]}):h.jsxs(_x,{open:i,onOpenChange:o,children:[h.jsx(wx,{asChild:!0,children:h.jsxs(et,{variant:"outline",role:"combobox","aria-expanded":i,className:"w-full justify-between bg-gray-800 border-gray-600 text-white hover:bg-gray-700",children:[n??(e?"Loading datasetsโ€ฆ":"Select a datasetโ€ฆ"),h.jsx(JM,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),h.jsx(Pm,{className:"w-[--radix-popover-trigger-width] p-0 bg-gray-800 border-gray-700",align:"start",children:h.jsxs(Ex,{className:"bg-gray-800 text-white",children:[h.jsx(Tx,{placeholder:"Search datasetsโ€ฆ",className:"text-white"}),h.jsxs(Mx,{children:[h.jsx(Ax,{children:e?"Loadingโ€ฆ":"No datasets."}),d.length>0&&h.jsx(Ys,{heading:"Local",children:d.map(p)}),f.length>0&&h.jsx(Ys,{heading:"Hugging Face",children:f.map(p)}),h.jsx(Ys,{children:h.jsxs(kd,{onSelect:()=>{s(!0),o(!1)},className:"text-purple-300 aria-selected:bg-gray-700",children:[h.jsx(Z7,{className:"mr-2 h-4 w-4"}),"Use custom repo IDโ€ฆ"]})})]})]})})]})},Cce=1500;function kz(t,e=!0){const{baseUrl:n,fetchWithHeaders:r}=Ln(),[i,o]=_.useState("idle"),[a,s]=_.useState(null),[l,c]=_.useState([]),u=_.useRef(null);_.useEffect(()=>{if(!e)return;let p=!1;return r(`${n}/${t}/install-status`).then(y=>y.json()).then(y=>{p||(o(y.state),s(y.error),y.logs.length>0&&c(y.logs))}).catch(()=>{}),()=>{p=!0}},[e,n,r,t]),_.useEffect(()=>{if(i!=="installing")return;const p=setInterval(async()=>{try{const y=await r(`${n}/${t}/install-status`);if(!y.ok)return;const v=await y.json();v.logs&&v.logs.length>0&&c(g=>[...g,...v.logs]),v.state!=="installing"&&(o(v.state),s(v.error))}catch{}},Cce);return()=>clearInterval(p)},[i,n,r,t]),_.useEffect(()=>{u.current&&(u.current.scrollTop=u.current.scrollHeight)},[l]);const d=_.useCallback(async()=>{o("installing"),s(null),c([]);try{const p=await r(`${n}/${t}/install`,{method:"POST"}),y=await p.json();if(!y.started&&p.ok)return;p.ok||(o("error"),s(y.message||`Install request failed (${p.status})`))}catch(p){o("error"),s(`Install request failed: ${p instanceof Error?p.message:String(p)}`)}},[n,r,t]),f=_.useCallback(()=>{o("idle"),s(null),c([])},[]);return{state:i,error:a,logs:l,logBoxRef:u,handleInstall:d,handleRetry:f}}function jz(t,e){switch(t){case"done":return"Install Complete";case"error":return"Install Failed";case"installing":return"Installingโ€ฆ";default:return e}}function Uz({state:t}){return t==="done"?h.jsx(ZM,{className:"w-6 h-6 text-green-400"}):t==="error"?h.jsx(nd,{className:"w-6 h-6 text-red-400"}):t==="installing"?h.jsx(fi,{className:"w-6 h-6 text-sky-400 animate-spin"}):h.jsx(ia,{className:"w-6 h-6 text-amber-400"})}const Fz=({state:t,error:e,logs:n,logBoxRef:r,onInstall:i,onRetry:o,installHint:a,packageName:s,idleDescription:l,doneDescription:c})=>{const{toast:u}=Dr(),d=async()=>{try{await navigator.clipboard.writeText(a),u({title:"Copied",description:a})}catch{u({title:"Copy failed",description:"Select the command and copy manually.",variant:"destructive"})}};return h.jsxs(h.Fragment,{children:[t==="idle"&&h.jsxs(h.Fragment,{children:[h.jsx("p",{className:"text-slate-300",children:l}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("code",{className:"flex-1 bg-slate-900 border border-slate-700 rounded-lg px-3 py-2 text-sm text-slate-200 font-mono",children:a}),h.jsx(et,{variant:"ghost",size:"icon",onClick:d,className:"text-slate-400 hover:text-white","aria-label":"Copy install command",children:h.jsx(QM,{className:"w-4 h-4"})})]}),h.jsx(et,{onClick:i,className:"bg-green-500 hover:bg-green-600 text-white font-semibold",children:"Install Now"})]}),t==="installing"&&h.jsxs("p",{className:"text-slate-300",children:["Installing"," ",h.jsx("code",{className:"px-1 py-0.5 rounded bg-slate-900 text-sky-300",children:s}),". This usually takes about 10 seconds."]}),t==="done"&&h.jsx("div",{className:"space-y-3 text-slate-300",children:c}),t==="error"&&h.jsxs(h.Fragment,{children:[h.jsx("p",{className:"text-red-300",children:e||"Install failed."}),h.jsx(et,{onClick:o,className:"bg-slate-700 hover:bg-slate-600 text-white",children:"Try again"})]}),t==="error"&&n.length>0&&h.jsx("div",{ref:r,className:"bg-slate-900 rounded-lg p-3 h-48 overflow-y-auto font-mono text-xs border border-slate-700 text-slate-300 whitespace-pre-wrap break-words",children:n.map((f,p)=>h.jsx("div",{children:f.message},p))})]})},Bz=({purpose:t})=>h.jsxs(h.Fragment,{children:[h.jsxs("p",{children:["Install complete. Restart"," ",h.jsx("code",{className:"px-1 py-0.5 rounded bg-slate-900 text-sky-300",children:"lelab"})," ","to enable ",t,":"]}),h.jsxs("ol",{className:"list-decimal list-inside space-y-2 pl-1",children:[h.jsxs("li",{children:["Press"," ",h.jsx("kbd",{className:"px-1.5 py-0.5 rounded bg-slate-900 border border-slate-600 text-xs font-mono text-slate-200",children:"Ctrl+C"})," ","in the terminal running"," ",h.jsx("code",{className:"px-1 py-0.5 rounded bg-slate-900 text-sky-300",children:"lelab"}),"."]}),h.jsxs("li",{children:["Run"," ",h.jsx("code",{className:"px-1 py-0.5 rounded bg-slate-900 text-sky-300",children:"lelab"})," ","again."]})]})]}),Pce=({open:t,onOpenChange:e,installHint:n})=>{const r=kz("system/wandb-extra",t);return h.jsx(Hc,{open:t,onOpenChange:e,children:h.jsxs(xl,{className:"bg-slate-800 border-slate-700 text-white max-w-2xl",children:[h.jsxs(bl,{children:[h.jsxs(_l,{className:"flex items-center gap-3 text-white",children:[h.jsx(Uz,{state:r.state}),jz(r.state,"Weights & Biases Not Installed")]}),h.jsx(wl,{className:"sr-only",children:"Install the wandb package to enable W&B logging."})]}),h.jsx("div",{className:"space-y-4",children:h.jsx(Fz,{state:r.state,error:r.error,logs:r.logs,logBoxRef:r.logBoxRef,onInstall:r.handleInstall,onRetry:r.handleRetry,installHint:n,packageName:"wandb",idleTitle:"Weights & Biases Not Installed",idleDescription:h.jsxs(h.Fragment,{children:["Enabling W&B logging requires the"," ",h.jsx("code",{className:"px-1 py-0.5 rounded bg-slate-900 text-sky-300",children:"wandb"})," ","package, which isn't installed in this environment. Install it to log this run to W&B."]}),doneDescription:h.jsx(Bz,{purpose:"W&B logging"})})})]})})},Rce=({config:t,updateConfig:e,datasets:n,datasetsLoading:r})=>{const{baseUrl:i,fetchWithHeaders:o}=Ln(),[a,s]=_.useState(!1),[l,c]=_.useState("pip install wandb"),u=t.target.runner==="seeed_cloud"||t.target.runner==="external",d=async f=>{if(!f){e("wandb_enable",!1);return}try{const y=await(await o(`${i}/system/wandb-extra`)).json();y.available?e("wandb_enable",!0):(c(y.install_hint),s(!0))}catch{e("wandb_enable",!0)}};return h.jsxs(Gr,{className:"bg-slate-800/50 border-slate-700 rounded-xl",children:[h.jsx(jo,{children:h.jsx(ha,{className:"text-white",children:"Run Configuration"})}),h.jsxs(Wr,{className:"space-y-6",children:[h.jsxs("div",{children:[h.jsx(Nt,{className:"text-slate-300",children:"Dataset Repository ID *"}),h.jsx("div",{className:"mt-1",children:h.jsx(Ace,{datasets:n,loading:r,value:t.dataset_repo_id||null,onChange:f=>{f&&e("dataset_repo_id",f)}})}),h.jsx("p",{className:"text-xs text-slate-500 mt-1",children:u?"LeLab dataset repository ID; Seeed Cloud also accepts an archive URL or SEEED_CLOUD_DATASET_URL override":"HuggingFace Hub dataset repository ID"})]}),h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[h.jsxs("div",{children:[h.jsx(Nt,{htmlFor:"policy_type",className:"text-slate-300",children:"Policy"}),h.jsxs(Zs,{value:t.policy_type,onValueChange:f=>e("policy_type",f),children:[h.jsx(Wa,{id:"policy_type",className:"bg-slate-900 border-slate-600 text-white rounded-lg",children:h.jsx(Qs,{})}),h.jsxs(Xa,{className:"bg-slate-800 border-slate-600 text-white",children:[h.jsx(_n,{value:"act",children:"ACT (Action Chunking Transformer)"}),h.jsx(_n,{value:"diffusion",children:"Diffusion Policy"}),h.jsx(_n,{value:"pi0",children:"PI0"}),h.jsx(_n,{value:"smolvla",children:"SmolVLA"}),h.jsx(_n,{value:"tdmpc",children:"TD-MPC"}),h.jsx(_n,{value:"vqbet",children:"VQ-BeT"}),h.jsx(_n,{value:"pi0fast",children:"PI0 Fast"}),h.jsx(_n,{value:"sac",children:"SAC"}),h.jsx(_n,{value:"reward_classifier",children:"Reward Classifier"})]})]})]}),h.jsxs("div",{children:[h.jsx(Nt,{htmlFor:"steps",className:"text-slate-300",children:"Training Steps"}),h.jsx(mr,{id:"steps",value:t.steps,onChange:f=>{f!==void 0&&e("steps",f)},className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]}),h.jsxs("div",{children:[h.jsx(Nt,{htmlFor:"batch_size",className:"text-slate-300",children:"Batch Size"}),h.jsx(mr,{id:"batch_size",value:t.batch_size,onChange:f=>{f!==void 0&&e("batch_size",f)},className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]}),h.jsxs("div",{className:"flex items-center space-x-3 pt-6",children:[h.jsx(Jl,{id:"wandb_enable",checked:t.wandb_enable,onCheckedChange:d,className:"data-[state=checked]:bg-green-500"}),h.jsx(Nt,{htmlFor:"wandb_enable",className:"text-slate-300",children:"Enable Weights & Biases"})]})]}),h.jsx(Pce,{open:a,onOpenChange:s,installHint:l}),t.wandb_enable&&h.jsxs("div",{children:[h.jsx(Nt,{htmlFor:"wandb_project",className:"text-slate-300",children:"W&B Project Name"}),h.jsx(hi,{id:"wandb_project",value:t.wandb_project||"",onChange:f=>e("wandb_project",f.target.value||void 0),placeholder:"my-robotics-project",className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]})]})]})},wu=({children:t})=>h.jsx("h4",{className:"text-xs font-semibold text-slate-400 uppercase tracking-wider",children:t}),Nce=({config:t,updateConfig:e})=>{const[n,r]=_.useState(!1);return h.jsxs(Gr,{className:"bg-slate-800/50 border-slate-700 rounded-xl",children:[h.jsxs(jo,{role:"button",tabIndex:0,"aria-expanded":n,onClick:()=>r(i=>!i),onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),r(o=>!o))},className:"cursor-pointer select-none flex flex-row items-center justify-between",children:[h.jsx("span",{className:"text-white font-semibold",children:"Advanced"}),h.jsxs("span",{className:"flex items-center gap-1 text-slate-400 text-sm",children:[n?h.jsx(hc,{className:"w-4 h-4"}):h.jsx(xp,{className:"w-4 h-4"}),n?"Hide":"Show"]})]}),n&&h.jsxs(Wr,{className:"space-y-8",children:[h.jsxs("section",{className:"space-y-4",children:[h.jsx(wu,{children:"Policy"}),h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[h.jsxs("div",{children:[h.jsx(Nt,{htmlFor:"policy_device",className:"text-slate-300",children:"Device"}),h.jsxs(Zs,{value:t.policy_device||"cuda",onValueChange:i=>e("policy_device",i),children:[h.jsx(Wa,{id:"policy_device",className:"bg-slate-900 border-slate-600 text-white rounded-lg",children:h.jsx(Qs,{})}),h.jsxs(Xa,{className:"bg-slate-800 border-slate-600 text-white",children:[h.jsx(_n,{value:"cuda",children:"CUDA (GPU)"}),h.jsx(_n,{value:"cpu",children:"CPU"}),h.jsx(_n,{value:"mps",children:"MPS (Apple Silicon)"})]})]})]}),h.jsxs("div",{className:"flex items-center space-x-3 pt-6",children:[h.jsx(Jl,{id:"policy_use_amp",checked:t.policy_use_amp,onCheckedChange:i=>e("policy_use_amp",i)}),h.jsx(Nt,{htmlFor:"policy_use_amp",className:"text-slate-300",children:"Use Automatic Mixed Precision"})]})]})]}),h.jsx(Yl,{className:"bg-slate-700"}),h.jsxs("section",{className:"space-y-4",children:[h.jsx(wu,{children:"Training"}),h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[h.jsxs("div",{children:[h.jsx(Nt,{htmlFor:"seed",className:"text-slate-300",children:"Random Seed"}),h.jsx(mr,{id:"seed",value:t.seed,onChange:i=>e("seed",i),className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]}),h.jsxs("div",{children:[h.jsx(Nt,{htmlFor:"num_workers",className:"text-slate-300",children:"Number of Workers"}),h.jsx(mr,{id:"num_workers",value:t.num_workers,onChange:i=>{i!==void 0&&e("num_workers",i)},className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]})]})]}),h.jsx(Yl,{className:"bg-slate-700"}),h.jsxs("section",{className:"space-y-4",children:[h.jsx(wu,{children:"Optimizer"}),h.jsxs("div",{children:[h.jsx(Nt,{htmlFor:"optimizer_type",className:"text-slate-300",children:"Optimizer"}),h.jsxs(Zs,{value:t.optimizer_type||"adam",onValueChange:i=>e("optimizer_type",i),children:[h.jsx(Wa,{id:"optimizer_type",className:"bg-slate-900 border-slate-600 text-white rounded-lg",children:h.jsx(Qs,{})}),h.jsxs(Xa,{className:"bg-slate-800 border-slate-600 text-white",children:[h.jsx(_n,{value:"adam",children:"Adam"}),h.jsx(_n,{value:"adamw",children:"AdamW"}),h.jsx(_n,{value:"sgd",children:"SGD"}),h.jsx(_n,{value:"multi_adam",children:"Multi Adam"})]})]})]}),h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[h.jsxs("div",{children:[h.jsx(Nt,{htmlFor:"optimizer_lr",className:"text-slate-300",children:"Learning Rate"}),h.jsx(mr,{id:"optimizer_lr",integer:!1,step:"0.0001",value:t.optimizer_lr,onChange:i=>e("optimizer_lr",i),placeholder:"Use policy default",className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]}),h.jsxs("div",{children:[h.jsx(Nt,{htmlFor:"optimizer_weight_decay",className:"text-slate-300",children:"Weight Decay"}),h.jsx(mr,{id:"optimizer_weight_decay",integer:!1,step:"0.0001",value:t.optimizer_weight_decay,onChange:i=>e("optimizer_weight_decay",i),placeholder:"Use policy default",className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]}),h.jsxs("div",{children:[h.jsx(Nt,{htmlFor:"optimizer_grad_clip_norm",className:"text-slate-300",children:"Gradient Clipping"}),h.jsx(mr,{id:"optimizer_grad_clip_norm",integer:!1,step:"0.0001",value:t.optimizer_grad_clip_norm,onChange:i=>e("optimizer_grad_clip_norm",i),placeholder:"Use policy default",className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]})]})]}),h.jsx(Yl,{className:"bg-slate-700"}),h.jsxs("section",{className:"space-y-4",children:[h.jsx(wu,{children:"Logging & Checkpointing"}),h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[h.jsxs("div",{children:[h.jsx(Nt,{htmlFor:"log_freq",className:"text-slate-300",children:"Log Frequency"}),h.jsx(mr,{id:"log_freq",value:t.log_freq,onChange:i=>{i!==void 0&&e("log_freq",i)},className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]}),h.jsxs("div",{children:[h.jsx(Nt,{htmlFor:"save_freq",className:"text-slate-300",children:"Save Frequency"}),h.jsx(mr,{id:"save_freq",value:t.save_freq,onChange:i=>{i!==void 0&&e("save_freq",i)},className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]})]}),h.jsxs("div",{className:"flex items-center space-x-3",children:[h.jsx(Jl,{id:"save_checkpoint",checked:t.save_checkpoint,onCheckedChange:i=>e("save_checkpoint",i)}),h.jsx(Nt,{htmlFor:"save_checkpoint",className:"text-slate-300",children:"Save Checkpoints"})]}),h.jsxs("div",{className:"flex items-center space-x-3",children:[h.jsx(Jl,{id:"resume",checked:t.resume,onCheckedChange:i=>e("resume",i)}),h.jsx(Nt,{htmlFor:"resume",className:"text-slate-300",children:"Resume from Checkpoint"})]})]}),t.wandb_enable&&h.jsxs(h.Fragment,{children:[h.jsx(Yl,{className:"bg-slate-700"}),h.jsxs("section",{className:"space-y-4",children:[h.jsx(wu,{children:"Weights & Biases"}),h.jsxs("div",{children:[h.jsx(Nt,{htmlFor:"wandb_entity",className:"text-slate-300",children:"W&B Entity (optional)"}),h.jsx(hi,{id:"wandb_entity",value:t.wandb_entity||"",onChange:i=>e("wandb_entity",i.target.value||void 0),placeholder:"your-username",className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]}),h.jsxs("div",{children:[h.jsx(Nt,{htmlFor:"wandb_notes",className:"text-slate-300",children:"W&B Notes (optional)"}),h.jsx(hi,{id:"wandb_notes",value:t.wandb_notes||"",onChange:i=>e("wandb_notes",i.target.value||void 0),placeholder:"Training run notes...",className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]}),h.jsxs("div",{children:[h.jsx(Nt,{htmlFor:"wandb_mode",className:"text-slate-300",children:"W&B Mode"}),h.jsxs(Zs,{value:t.wandb_mode||"online",onValueChange:i=>e("wandb_mode",i),children:[h.jsx(Wa,{id:"wandb_mode",className:"bg-slate-900 border-slate-600 text-white rounded-lg",children:h.jsx(Qs,{})}),h.jsxs(Xa,{className:"bg-slate-800 border-slate-600 text-white",children:[h.jsx(_n,{value:"online",children:"Online"}),h.jsx(_n,{value:"offline",children:"Offline"}),h.jsx(_n,{value:"disabled",children:"Disabled"})]})]})]}),h.jsxs("div",{className:"flex items-center space-x-3",children:[h.jsx(Jl,{id:"wandb_disable_artifact",checked:t.wandb_disable_artifact,onCheckedChange:i=>e("wandb_disable_artifact",i)}),h.jsx(Nt,{htmlFor:"wandb_disable_artifact",className:"text-slate-300",children:"Disable Artifacts"})]})]})]}),!t.wandb_enable&&h.jsx(Yl,{className:"bg-slate-700"}),h.jsxs("section",{className:"space-y-4",children:[h.jsx(wu,{children:"Misc"}),h.jsxs("div",{className:"flex items-center space-x-3",children:[h.jsx(Jl,{id:"use_policy_training_preset",checked:t.use_policy_training_preset,onCheckedChange:i=>e("use_policy_training_preset",i)}),h.jsx(Nt,{htmlFor:"use_policy_training_preset",className:"text-slate-300",children:"Use Policy Training Preset"})]})]})]})]})},Oce=(t,e)=>`$${(e==="minute"?t*60:t).toFixed(2)}/hr`,Ice=t=>{const e=t.accelerator;if(!e)return{manufacturer:"",model:t.cpu||t.pretty_name||t.name};if(typeof e=="string")return{manufacturer:/nvidia/i.test(e)?"":"Nvidia",model:e};const n=String(e.quantity??"").trim(),r=n&&n!=="1"?`${n}x `:"";return{manufacturer:e.manufacturer||"",model:`${r}${e.model||t.pretty_name||t.name}`}},Dce=t=>{const{manufacturer:e,model:n}=Ice(t);return[e,n].filter(Boolean).join(" ")},dh=(t,e)=>`${t} ${Dce(e)} - ${Oce(e.unit_cost_usd,e.unit_label)}`,w2=t=>{const e=[t.cpu,t.ram].filter(Boolean);return e.length>0?e.join(" ยท "):t.pretty_name},Fl="seeed_cloud",Lce=({config:t,updateConfig:e,authenticated:n,flavors:r,providers:i,loading:o,seeedConnecting:a,onConnectSeeedCloud:s})=>{const l=t.target,[c,u]=_.useState(!1),[d,f]=_.useState(!0),[p,y]=_.useState({[Fl]:!0}),v=_.useMemo(()=>i??[],[i]),g=_.useMemo(()=>r??[],[r]),m=v.find(A=>A.id===Fl),x=v.map(A=>({...A,open:p[A.id]??A.id===Fl,label:A.id===Fl?"Seeed Cloud":A.display_name})),b=_.useMemo(()=>{if(l.runner==="local")return"Local - your machine";if(l.runner==="hf_cloud"){const C=g.find(P=>P.name===l.flavor);return C?dh("HF",C):"Hugging Face"}if(l.runner==="seeed_cloud"){const C=m==null?void 0:m.flavors.find(P=>P.name===l.flavor);return C?dh("Seeed",C):"Seeed Cloud"}const A=v.find(C=>C.id===l.provider),M=A==null?void 0:A.flavors.find(C=>C.name===l.flavor);return M?dh((A==null?void 0:A.display_name)??"External",M):(A==null?void 0:A.display_name)??"External"},[g,v,m,l]),S=A=>{if(A==="local")e("target",{runner:"local"});else if(A.startsWith("hf:")){const M=A.slice(3);e("target",{runner:"hf_cloud",flavor:M})}else if(A.startsWith("seeed:")){const M=A.slice(6);e("target",{runner:"seeed_cloud",flavor:M})}else if(A.startsWith("external:")){const[,M,C]=A.split(":");e("target",{runner:"external",provider:M,flavor:C})}u(!1)},w=l.runner==="local"?"local":l.runner==="hf_cloud"?`hf:${l.flavor??""}`:l.runner==="seeed_cloud"?`seeed:${l.flavor??""}`:`external:${l.provider}:${l.flavor??""}`,E=(A,M,C,P)=>h.jsxs("button",{type:"button",disabled:P,onClick:()=>S(A),className:He("flex min-h-10 w-full items-center gap-3 rounded-md px-3 py-2 text-left text-sm transition-colors","hover:bg-slate-700/80 focus:bg-slate-700/80 focus:outline-none",P&&"cursor-not-allowed opacity-45 hover:bg-transparent"),children:[h.jsx(yl,{className:He("h-4 w-4 shrink-0 text-emerald-300",w===A?"opacity-100":"opacity-0")}),h.jsxs("span",{className:"min-w-0 flex-1",children:[h.jsx("span",{className:"block truncate text-slate-100",children:M}),C?h.jsx("span",{className:"block truncate text-xs text-slate-500",children:C}):null]})]},A),T=(A,M)=>{y(C=>({...C,[A]:M}))};return h.jsxs(Gr,{className:"bg-slate-800/50 border-slate-700 rounded-xl",children:[h.jsx(jo,{children:h.jsx(ha,{className:"text-white",children:"Compute target"})}),h.jsx(Wr,{className:"space-y-3",children:h.jsxs("div",{children:[h.jsx(Nt,{className:"text-slate-300",children:"Run training on"}),h.jsxs(_x,{open:c,onOpenChange:u,children:[h.jsx(wx,{asChild:!0,children:h.jsxs(et,{type:"button",variant:"outline",className:"mt-1 flex h-11 w-full justify-between border-slate-600 bg-slate-900 px-3 text-left text-white hover:bg-slate-900 hover:text-white",children:[h.jsx("span",{className:"min-w-0 flex-1 truncate",children:o?"Loading...":b}),h.jsx(hc,{className:"ml-3 h-4 w-4 shrink-0 text-slate-400"})]})}),h.jsx(Pm,{align:"start",className:"w-[min(560px,calc(100vw-2rem))] border-slate-700 bg-slate-800 p-2 text-white shadow-xl",children:h.jsxs("div",{className:"max-h-[440px] overflow-y-auto pr-1",children:[E("local","Local - your machine","Free",!1),h.jsxs(Sy,{open:d,onOpenChange:f,children:[h.jsxs(Ey,{className:"mt-1 flex h-10 w-full items-center gap-2 rounded-md px-3 text-left text-sm text-slate-200 hover:bg-slate-700/70",children:[d?h.jsx(hc,{className:"h-4 w-4 text-slate-400"}):h.jsx(xp,{className:"h-4 w-4 text-slate-400"}),h.jsx("span",{className:"font-medium",children:"Hugging Face"}),h.jsx(b1,{variant:"outline",className:"ml-auto border-slate-600 text-slate-300",children:n?`${g.length} flavors`:"Login required"})]}),h.jsx(Ty,{className:"ml-3 border-l border-slate-700 pl-2",children:n&&g.length>0?g.map(A=>E(`hf:${A.name}`,dh("HF",A),w2(A),!1)):h.jsx("div",{className:"px-8 py-3 text-xs text-slate-500",children:n?"No HF hardware flavors available.":"Log in to HF to unlock official flavors."})})]}),x.map(A=>h.jsxs(Sy,{open:A.open,onOpenChange:M=>T(A.id,M),children:[h.jsxs(Ey,{className:"mt-1 flex h-10 w-full items-center gap-2 rounded-md px-3 text-left text-sm text-slate-200 hover:bg-slate-700/70",children:[A.open?h.jsx(hc,{className:"h-4 w-4 text-slate-400"}):h.jsx(xp,{className:"h-4 w-4 text-slate-400"}),h.jsx("span",{className:"font-medium",children:A.label}),h.jsx(b1,{variant:"outline",className:He("ml-auto border-slate-600 text-slate-300",A.authenticated&&"border-emerald-500/50 text-emerald-200"),children:A.authenticated?`Connected ยท ${A.flavors.length} flavors`:"Connect required"})]}),h.jsxs(Ty,{className:"ml-3 border-l border-slate-700 pl-2",children:[!A.authenticated&&A.id===Fl?h.jsxs("div",{className:"flex items-center justify-between gap-3 px-3 py-2",children:[h.jsx("span",{className:"text-xs text-slate-500",children:"Connect to unlock Seeed Cloud flavors."}),h.jsxs(et,{type:"button",size:"sm",variant:"outline",disabled:a,onClick:s,className:"h-8 shrink-0 border-amber-400/60 bg-slate-900 text-amber-100 hover:bg-amber-500/20",children:[a?h.jsx(fi,{className:"mr-2 h-4 w-4 animate-spin"}):h.jsx(Y7,{className:"mr-2 h-4 w-4"}),"Connect"]})]}):null,A.flavors.length>0?A.flavors.map(M=>{const C=A.id===Fl?"Seeed":A.display_name,P=A.id===Fl?`seeed:${M.name}`:`external:${A.id}:${M.name}`;return E(P,dh(C,M),w2(M),!A.authenticated)}):h.jsx("div",{className:"px-8 py-3 text-xs text-slate-500",children:"No flavors available."})]})]},A.id))]})})]}),h.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Cost shown is per running hour. Final policy uploads to your HF account when training completes."})]})})]})},kce=({config:t,updateConfig:e,datasets:n,datasetsLoading:r,authenticated:i,flavors:o,providers:a,hardwareLoading:s,seeedConnecting:l,onConnectSeeedCloud:c})=>h.jsxs("div",{className:"max-w-3xl mx-auto space-y-6",children:[h.jsx(Lce,{config:t,updateConfig:e,authenticated:i,flavors:o,providers:a,loading:s,seeedConnecting:l,onConnectSeeedCloud:c}),h.jsx(Rce,{config:t,updateConfig:e,datasets:n,datasetsLoading:r}),h.jsx(Nce,{config:t,updateConfig:e})]});var jce=Array.isArray,yi=jce,Uce=typeof Zm=="object"&&Zm&&Zm.Object===Object&&Zm,$z=Uce,Fce=$z,Bce=typeof self=="object"&&self&&self.Object===Object&&self,$ce=Fce||Bce||Function("return this")(),wa=$ce,zce=wa,Hce=zce.Symbol,Um=Hce,S2=Um,zz=Object.prototype,Vce=zz.hasOwnProperty,Gce=zz.toString,fh=S2?S2.toStringTag:void 0;function Wce(t){var e=Vce.call(t,fh),n=t[fh];try{t[fh]=void 0;var r=!0}catch{}var i=Gce.call(t);return r&&(e?t[fh]=n:delete t[fh]),i}var Xce=Wce,qce=Object.prototype,Kce=qce.toString;function Yce(t){return Kce.call(t)}var Jce=Yce,E2=Um,Zce=Xce,Qce=Jce,eue="[object Null]",tue="[object Undefined]",T2=E2?E2.toStringTag:void 0;function nue(t){return t==null?t===void 0?tue:eue:T2&&T2 in Object(t)?Zce(t):Qce(t)}var us=nue;function rue(t){return t!=null&&typeof t=="object"}var ds=rue,iue=us,oue=ds,aue="[object Symbol]";function sue(t){return typeof t=="symbol"||oue(t)&&iue(t)==aue}var Cf=sue,lue=yi,cue=Cf,uue=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,due=/^\w*$/;function fue(t,e){if(lue(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||cue(t)?!0:due.test(t)||!uue.test(t)||e!=null&&t in Object(e)}var gC=fue;function hue(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Al=hue;const Pf=dn(Al);var pue=us,mue=Al,gue="[object AsyncFunction]",vue="[object Function]",yue="[object GeneratorFunction]",xue="[object Proxy]";function bue(t){if(!mue(t))return!1;var e=pue(t);return e==vue||e==yue||e==gue||e==xue}var vC=bue;const jt=dn(vC);var _ue=wa,wue=_ue["__core-js_shared__"],Sue=wue,Lw=Sue,M2=function(){var t=/[^.]+$/.exec(Lw&&Lw.keys&&Lw.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Eue(t){return!!M2&&M2 in t}var Tue=Eue,Mue=Function.prototype,Aue=Mue.toString;function Cue(t){if(t!=null){try{return Aue.call(t)}catch{}try{return t+""}catch{}}return""}var Hz=Cue,Pue=vC,Rue=Tue,Nue=Al,Oue=Hz,Iue=/[\\^$.*+?()[\]{}|]/g,Due=/^\[object .+?Constructor\]$/,Lue=Function.prototype,kue=Object.prototype,jue=Lue.toString,Uue=kue.hasOwnProperty,Fue=RegExp("^"+jue.call(Uue).replace(Iue,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Bue(t){if(!Nue(t)||Rue(t))return!1;var e=Pue(t)?Fue:Due;return e.test(Oue(t))}var $ue=Bue;function zue(t,e){return t==null?void 0:t[e]}var Hue=zue,Vue=$ue,Gue=Hue;function Wue(t,e){var n=Gue(t,e);return Vue(n)?n:void 0}var qc=Wue,Xue=qc,que=Xue(Object,"create"),tb=que,A2=tb;function Kue(){this.__data__=A2?A2(null):{},this.size=0}var Yue=Kue;function Jue(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Zue=Jue,Que=tb,ede="__lodash_hash_undefined__",tde=Object.prototype,nde=tde.hasOwnProperty;function rde(t){var e=this.__data__;if(Que){var n=e[t];return n===ede?void 0:n}return nde.call(e,t)?e[t]:void 0}var ide=rde,ode=tb,ade=Object.prototype,sde=ade.hasOwnProperty;function lde(t){var e=this.__data__;return ode?e[t]!==void 0:sde.call(e,t)}var cde=lde,ude=tb,dde="__lodash_hash_undefined__";function fde(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=ude&&e===void 0?dde:e,this}var hde=fde,pde=Yue,mde=Zue,gde=ide,vde=cde,yde=hde;function Rf(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e-1}var Lde=Dde,kde=nb;function jde(t,e){var n=this.__data__,r=kde(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var Ude=jde,Fde=_de,Bde=Pde,$de=Ode,zde=Lde,Hde=Ude;function Nf(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e0?1:-1},tc=function(e){return Dc(e)&&e.indexOf("%")===e.length-1},ze=function(e){return che(e)&&!Fm(e)},Yn=function(e){return ze(e)||Dc(e)},hhe=0,Bm=function(e){var n=++hhe;return"".concat(e||"").concat(n)},Lc=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!ze(e)&&!Dc(e))return r;var o;if(tc(e)){var a=e.indexOf("%");o=n*parseFloat(e.slice(0,a))/100}else o=+e;return Fm(o)&&(o=r),i&&o>n&&(o=n),o},Cu=function(e){if(!e)return null;var n=Object.keys(e);return n&&n.length?e[n[0]]:null},phe=function(e){if(!Array.isArray(e))return!1;for(var n=e.length,r={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function _he(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function T1(t){"@babel/helpers - typeof";return T1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},T1(t)}var D2={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Ka=function(e){return typeof e=="string"?e:e?e.displayName||e.name||"Component":""},L2=null,jw=null,AC=function t(e){if(e===L2&&Array.isArray(jw))return jw;var n=[];return _.Children.forEach(e,function(r){Ut(r)||(ihe.isFragment(r)?n=n.concat(t(r.props.children)):n.push(r))}),jw=n,L2=e,n};function ro(t,e){var n=[],r=[];return Array.isArray(e)?r=e.map(function(i){return Ka(i)}):r=[Ka(e)],AC(t).forEach(function(i){var o=no(i,"type.displayName")||no(i,"type.name");r.indexOf(o)!==-1&&n.push(i)}),n}function Ei(t,e){var n=ro(t,e);return n&&n[0]}var k2=function(e){if(!e||!e.props)return!1;var n=e.props,r=n.width,i=n.height;return!(!ze(r)||r<=0||!ze(i)||i<=0)},whe=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],She=function(e){return e&&e.type&&Dc(e.type)&&whe.indexOf(e.type)>=0},Ehe=function(e){return e&&T1(e)==="object"&&"clipDot"in e},The=function(e,n,r,i){var o,a=(o=kw==null?void 0:kw[i])!==null&&o!==void 0?o:[];return n.startsWith("data-")||!jt(e)&&(i&&a.includes(n)||vhe.includes(n))||r&&MC.includes(n)},$t=function(e,n,r){if(!e||typeof e=="function"||typeof e=="boolean")return null;var i=e;if(_.isValidElement(e)&&(i=e.props),!Pf(i))return null;var o={};return Object.keys(i).forEach(function(a){var s;The((s=i)===null||s===void 0?void 0:s[a],a,n,r)&&(o[a]=i[a])}),o},M1=function t(e,n){if(e===n)return!0;var r=_.Children.count(e);if(r!==_.Children.count(n))return!1;if(r===0)return!0;if(r===1)return j2(Array.isArray(e)?e[0]:e,Array.isArray(n)?n[0]:n);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Rhe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function C1(t){var e=t.children,n=t.width,r=t.height,i=t.viewBox,o=t.className,a=t.style,s=t.title,l=t.desc,c=Phe(t,Che),u=i||{width:n,height:r,x:0,y:0},d=zt("recharts-surface",o);return Z.createElement("svg",A1({},$t(c,!0,"svg"),{className:d,width:n,height:r,style:a,viewBox:"".concat(u.x," ").concat(u.y," ").concat(u.width," ").concat(u.height)}),Z.createElement("title",null,s),Z.createElement("desc",null,l),e)}var Nhe=["children","className"];function P1(){return P1=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Ihe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}var jn=Z.forwardRef(function(t,e){var n=t.children,r=t.className,i=Ohe(t,Nhe),o=zt("recharts-layer",r);return Z.createElement("g",P1({className:o},$t(i,!0),{ref:e}),n)}),vc=function(e,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;oi?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(i);++r=r?t:khe(t,e,n)}var Uhe=jhe,Fhe="\\ud800-\\udfff",Bhe="\\u0300-\\u036f",$he="\\ufe20-\\ufe2f",zhe="\\u20d0-\\u20ff",Hhe=Bhe+$he+zhe,Vhe="\\ufe0e\\ufe0f",Ghe="\\u200d",Whe=RegExp("["+Ghe+Fhe+Hhe+Vhe+"]");function Xhe(t){return Whe.test(t)}var Qz=Xhe;function qhe(t){return t.split("")}var Khe=qhe,e5="\\ud800-\\udfff",Yhe="\\u0300-\\u036f",Jhe="\\ufe20-\\ufe2f",Zhe="\\u20d0-\\u20ff",Qhe=Yhe+Jhe+Zhe,epe="\\ufe0e\\ufe0f",tpe="["+e5+"]",R1="["+Qhe+"]",N1="\\ud83c[\\udffb-\\udfff]",npe="(?:"+R1+"|"+N1+")",t5="[^"+e5+"]",n5="(?:\\ud83c[\\udde6-\\uddff]){2}",r5="[\\ud800-\\udbff][\\udc00-\\udfff]",rpe="\\u200d",i5=npe+"?",o5="["+epe+"]?",ipe="(?:"+rpe+"(?:"+[t5,n5,r5].join("|")+")"+o5+i5+")*",ope=o5+i5+ipe,ape="(?:"+[t5+R1+"?",R1,n5,r5,tpe].join("|")+")",spe=RegExp(N1+"(?="+N1+")|"+ape+ope,"g");function lpe(t){return t.match(spe)||[]}var cpe=lpe,upe=Khe,dpe=Qz,fpe=cpe;function hpe(t){return dpe(t)?fpe(t):upe(t)}var ppe=hpe,mpe=Uhe,gpe=Qz,vpe=ppe,ype=Xz;function xpe(t){return function(e){e=ype(e);var n=gpe(e)?vpe(e):void 0,r=n?n[0]:e.charAt(0),i=n?mpe(n,1).join(""):e.slice(1);return r[t]()+i}}var bpe=xpe,_pe=bpe,wpe=_pe("toUpperCase"),Spe=wpe;const gb=dn(Spe);function mn(t){return function(){return t}}const a5=Math.cos,Uy=Math.sin,Ko=Math.sqrt,Fy=Math.PI,vb=2*Fy,O1=Math.PI,I1=2*O1,Vl=1e-6,Epe=I1-Vl;function s5(t){this._+=t[0];for(let e=1,n=t.length;e=0))throw new Error(`invalid digits: ${t}`);if(e>15)return s5;const n=10**e;return function(r){this._+=r[0];for(let i=1,o=r.length;iVl)if(!(Math.abs(d*l-c*u)>Vl)||!o)this._append`L${this._x1=e},${this._y1=n}`;else{let p=r-a,y=i-s,v=l*l+c*c,g=p*p+y*y,m=Math.sqrt(v),x=Math.sqrt(f),b=o*Math.tan((O1-Math.acos((v+f-g)/(2*m*x)))/2),S=b/x,w=b/m;Math.abs(S-1)>Vl&&this._append`L${e+S*u},${n+S*d}`,this._append`A${o},${o},0,0,${+(d*p>u*y)},${this._x1=e+w*l},${this._y1=n+w*c}`}}arc(e,n,r,i,o,a){if(e=+e,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(i),l=r*Math.sin(i),c=e+s,u=n+l,d=1^a,f=a?i-o:o-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>Vl||Math.abs(this._y1-u)>Vl)&&this._append`L${c},${u}`,r&&(f<0&&(f=f%I1+I1),f>Epe?this._append`A${r},${r},0,1,${d},${e-s},${n-l}A${r},${r},0,1,${d},${this._x1=c},${this._y1=u}`:f>Vl&&this._append`A${r},${r},0,${+(f>=O1)},${d},${this._x1=e+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(e,n,r,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function CC(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(n==null)e=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);e=r}return t},()=>new Mpe(e)}function PC(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function l5(t){this._context=t}l5.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function yb(t){return new l5(t)}function c5(t){return t[0]}function u5(t){return t[1]}function d5(t,e){var n=mn(!0),r=null,i=yb,o=null,a=CC(s);t=typeof t=="function"?t:t===void 0?c5:mn(t),e=typeof e=="function"?e:e===void 0?u5:mn(e);function s(l){var c,u=(l=PC(l)).length,d,f=!1,p;for(r==null&&(o=i(p=a())),c=0;c<=u;++c)!(c=p;--y)s.point(b[y],S[y]);s.lineEnd(),s.areaEnd()}m&&(b[f]=+t(g,f,d),S[f]=+e(g,f,d),s.point(r?+r(g,f,d):b[f],n?+n(g,f,d):S[f]))}if(x)return s=null,x+""||null}function u(){return d5().defined(i).curve(a).context(o)}return c.x=function(d){return arguments.length?(t=typeof d=="function"?d:mn(+d),r=null,c):t},c.x0=function(d){return arguments.length?(t=typeof d=="function"?d:mn(+d),c):t},c.x1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:mn(+d),c):r},c.y=function(d){return arguments.length?(e=typeof d=="function"?d:mn(+d),n=null,c):e},c.y0=function(d){return arguments.length?(e=typeof d=="function"?d:mn(+d),c):e},c.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:mn(+d),c):n},c.lineX0=c.lineY0=function(){return u().x(t).y(e)},c.lineY1=function(){return u().x(t).y(n)},c.lineX1=function(){return u().x(r).y(e)},c.defined=function(d){return arguments.length?(i=typeof d=="function"?d:mn(!!d),c):i},c.curve=function(d){return arguments.length?(a=d,o!=null&&(s=a(o)),c):a},c.context=function(d){return arguments.length?(d==null?o=s=null:s=a(o=d),c):o},c}class f5{constructor(e,n){this._context=e,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,n){switch(e=+e,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,n):this._context.moveTo(e,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,n,e,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,e,this._y0,e,n);break}}this._x0=e,this._y0=n}}function Ape(t){return new f5(t,!0)}function Cpe(t){return new f5(t,!1)}const RC={draw(t,e){const n=Ko(e/Fy);t.moveTo(n,0),t.arc(0,0,n,0,vb)}},Ppe={draw(t,e){const n=Ko(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},h5=Ko(1/3),Rpe=h5*2,Npe={draw(t,e){const n=Ko(e/Rpe),r=n*h5;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},Ope={draw(t,e){const n=Ko(e),r=-n/2;t.rect(r,r,n,n)}},Ipe=.8908130915292852,p5=Uy(Fy/10)/Uy(7*Fy/10),Dpe=Uy(vb/10)*p5,Lpe=-a5(vb/10)*p5,kpe={draw(t,e){const n=Ko(e*Ipe),r=Dpe*n,i=Lpe*n;t.moveTo(0,-n),t.lineTo(r,i);for(let o=1;o<5;++o){const a=vb*o/5,s=a5(a),l=Uy(a);t.lineTo(l*n,-s*n),t.lineTo(s*r-l*i,l*r+s*i)}t.closePath()}},Uw=Ko(3),jpe={draw(t,e){const n=-Ko(e/(Uw*3));t.moveTo(0,n*2),t.lineTo(-Uw*n,-n),t.lineTo(Uw*n,-n),t.closePath()}},$i=-.5,zi=Ko(3)/2,D1=1/Ko(12),Upe=(D1/2+1)*3,Fpe={draw(t,e){const n=Ko(e/Upe),r=n/2,i=n*D1,o=r,a=n*D1+n,s=-o,l=a;t.moveTo(r,i),t.lineTo(o,a),t.lineTo(s,l),t.lineTo($i*r-zi*i,zi*r+$i*i),t.lineTo($i*o-zi*a,zi*o+$i*a),t.lineTo($i*s-zi*l,zi*s+$i*l),t.lineTo($i*r+zi*i,$i*i-zi*r),t.lineTo($i*o+zi*a,$i*a-zi*o),t.lineTo($i*s+zi*l,$i*l-zi*s),t.closePath()}};function Bpe(t,e){let n=null,r=CC(i);t=typeof t=="function"?t:mn(t||RC),e=typeof e=="function"?e:mn(e===void 0?64:+e);function i(){let o;if(n||(n=o=r()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),o)return n=null,o+""||null}return i.type=function(o){return arguments.length?(t=typeof o=="function"?o:mn(o),i):t},i.size=function(o){return arguments.length?(e=typeof o=="function"?o:mn(+o),i):e},i.context=function(o){return arguments.length?(n=o??null,i):n},i}function By(){}function $y(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function m5(t){this._context=t}m5.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:$y(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:$y(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function $pe(t){return new m5(t)}function g5(t){this._context=t}g5.prototype={areaStart:By,areaEnd:By,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:$y(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function zpe(t){return new g5(t)}function v5(t){this._context=t}v5.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:$y(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Hpe(t){return new v5(t)}function y5(t){this._context=t}y5.prototype={areaStart:By,areaEnd:By,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function Vpe(t){return new y5(t)}function F2(t){return t<0?-1:1}function B2(t,e,n){var r=t._x1-t._x0,i=e-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(n-t._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(F2(o)+F2(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function $2(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function Fw(t,e,n){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,s=(o-r)/3;t._context.bezierCurveTo(r+s,i+s*e,o-s,a-s*n,o,a)}function zy(t){this._context=t}zy.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Fw(this,this._t0,$2(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,Fw(this,$2(this,n=B2(this,t,e)),n);break;default:Fw(this,this._t0,n=B2(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function x5(t){this._context=new b5(t)}(x5.prototype=Object.create(zy.prototype)).point=function(t,e){zy.prototype.point.call(this,e,t)};function b5(t){this._context=t}b5.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,o){this._context.bezierCurveTo(e,t,r,n,o,i)}};function Gpe(t){return new zy(t)}function Wpe(t){return new x5(t)}function _5(t){this._context=t}_5.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),n===2)this._context.lineTo(t[1],e[1]);else for(var r=z2(t),i=z2(e),o=0,a=1;a=0;--e)i[e]=(a[e]-i[e+1])/o[e];for(o[n-1]=(t[n]+i[n-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}break}}this._x=t,this._y=e}};function qpe(t){return new xb(t,.5)}function Kpe(t){return new xb(t,0)}function Ype(t){return new xb(t,1)}function Hd(t,e){if((a=t.length)>1)for(var n=1,r,i,o=t[e[0]],a,s=o.length;n=0;)n[e]=e;return n}function Jpe(t,e){return t[e]}function Zpe(t){const e=[];return e.key=t,e}function Qpe(){var t=mn([]),e=L1,n=Hd,r=Jpe;function i(o){var a=Array.from(t.apply(this,arguments),Zpe),s,l=a.length,c=-1,u;for(const d of o)for(s=0,++c;s0){for(var n,r,i=0,o=t[0].length,a;i0){for(var n=0,r=t[e[0]],i,o=r.length;n0)||!((o=(i=t[e[0]]).length)>0))){for(var n=0,r=1,i,o,a;r=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function lme(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}var w5={symbolCircle:RC,symbolCross:Ppe,symbolDiamond:Npe,symbolSquare:Ope,symbolStar:kpe,symbolTriangle:jpe,symbolWye:Fpe},cme=Math.PI/180,ume=function(e){var n="symbol".concat(gb(e));return w5[n]||RC},dme=function(e,n,r){if(n==="area")return e;switch(r){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var i=18*cme;return 1.25*e*e*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},fme=function(e,n){w5["symbol".concat(gb(e))]=n},NC=function(e){var n=e.type,r=n===void 0?"circle":n,i=e.size,o=i===void 0?64:i,a=e.sizeType,s=a===void 0?"area":a,l=sme(e,rme),c=V2(V2({},l),{},{type:r,size:o,sizeType:s}),u=function(){var g=ume(r),m=Bpe().type(g).size(dme(o,s,r));return m()},d=c.className,f=c.cx,p=c.cy,y=$t(c,!0);return f===+f&&p===+p&&o===+o?Z.createElement("path",k1({},y,{className:zt("recharts-symbols",d),transform:"translate(".concat(f,", ").concat(p,")"),d:u()})):null};NC.registerSymbol=fme;function Vd(t){"@babel/helpers - typeof";return Vd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vd(t)}function j1(){return j1=Object.assign?Object.assign.bind():function(t){for(var e=1;e`);var x=p.inactive?c:p.color;return Z.createElement("li",j1({className:g,style:d,key:"legend-item-".concat(y)},jy(r.props,p,y)),Z.createElement(C1,{width:a,height:a,viewBox:u,style:f},r.renderIcon(p)),Z.createElement("span",{className:"recharts-legend-item-text",style:{color:x}},v?v(m,p,y):m))})}},{key:"render",value:function(){var r=this.props,i=r.payload,o=r.layout,a=r.align;if(!i||!i.length)return null;var s={padding:0,margin:0,textAlign:o==="horizontal"?a:"left"};return Z.createElement("ul",{className:"recharts-default-legend",style:s},this.renderItems())}}])}(_.PureComponent);Ip(OC,"displayName","Legend");Ip(OC,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var wme=rb;function Sme(){this.__data__=new wme,this.size=0}var Eme=Sme;function Tme(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}var Mme=Tme;function Ame(t){return this.__data__.get(t)}var Cme=Ame;function Pme(t){return this.__data__.has(t)}var Rme=Pme,Nme=rb,Ome=xC,Ime=bC,Dme=200;function Lme(t,e){var n=this.__data__;if(n instanceof Nme){var r=n.__data__;if(!Ome||r.lengths))return!1;var c=o.get(t),u=o.get(e);if(c&&u)return c==e&&u==t;var d=-1,f=!0,p=n&rge?new Qme:void 0;for(o.set(t,e),o.set(e,t);++d-1&&t%1==0&&t-1&&t%1==0&&t<=sve}var kC=lve,cve=us,uve=kC,dve=ds,fve="[object Arguments]",hve="[object Array]",pve="[object Boolean]",mve="[object Date]",gve="[object Error]",vve="[object Function]",yve="[object Map]",xve="[object Number]",bve="[object Object]",_ve="[object RegExp]",wve="[object Set]",Sve="[object String]",Eve="[object WeakMap]",Tve="[object ArrayBuffer]",Mve="[object DataView]",Ave="[object Float32Array]",Cve="[object Float64Array]",Pve="[object Int8Array]",Rve="[object Int16Array]",Nve="[object Int32Array]",Ove="[object Uint8Array]",Ive="[object Uint8ClampedArray]",Dve="[object Uint16Array]",Lve="[object Uint32Array]",bn={};bn[Ave]=bn[Cve]=bn[Pve]=bn[Rve]=bn[Nve]=bn[Ove]=bn[Ive]=bn[Dve]=bn[Lve]=!0;bn[fve]=bn[hve]=bn[Tve]=bn[pve]=bn[Mve]=bn[mve]=bn[gve]=bn[vve]=bn[yve]=bn[xve]=bn[bve]=bn[_ve]=bn[wve]=bn[Sve]=bn[Eve]=!1;function kve(t){return dve(t)&&uve(t.length)&&!!bn[cve(t)]}var jve=kve;function Uve(t){return function(e){return t(e)}}var I5=Uve,Wy={exports:{}};Wy.exports;(function(t,e){var n=$z,r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,o=i&&i.exports===r,a=o&&n.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||a&&a.binding&&a.binding("util")}catch{}}();t.exports=s})(Wy,Wy.exports);var Fve=Wy.exports,Bve=jve,$ve=I5,J2=Fve,Z2=J2&&J2.isTypedArray,zve=Z2?$ve(Z2):Bve,D5=zve,Hve=Wge,Vve=DC,Gve=yi,Wve=O5,Xve=LC,qve=D5,Kve=Object.prototype,Yve=Kve.hasOwnProperty;function Jve(t,e){var n=Gve(t),r=!n&&Vve(t),i=!n&&!r&&Wve(t),o=!n&&!r&&!i&&qve(t),a=n||r||i||o,s=a?Hve(t.length,String):[],l=s.length;for(var c in t)(e||Yve.call(t,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Xve(c,l)))&&s.push(c);return s}var Zve=Jve,Qve=Object.prototype;function eye(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||Qve;return t===n}var tye=eye;function nye(t,e){return function(n){return t(e(n))}}var L5=nye,rye=L5,iye=rye(Object.keys,Object),oye=iye,aye=tye,sye=oye,lye=Object.prototype,cye=lye.hasOwnProperty;function uye(t){if(!aye(t))return sye(t);var e=[];for(var n in Object(t))cye.call(t,n)&&n!="constructor"&&e.push(n);return e}var dye=uye,fye=vC,hye=kC;function pye(t){return t!=null&&hye(t.length)&&!fye(t)}var bb=pye,mye=Zve,gye=dye,vye=bb;function yye(t){return vye(t)?mye(t):gye(t)}var jC=yye,xye=Dge,bye=Vge,_ye=jC;function wye(t){return xye(t,_ye,bye)}var Sye=wye,Q2=Sye,Eye=1,Tye=Object.prototype,Mye=Tye.hasOwnProperty;function Aye(t,e,n,r,i,o){var a=n&Eye,s=Q2(t),l=s.length,c=Q2(e),u=c.length;if(l!=u&&!a)return!1;for(var d=l;d--;){var f=s[d];if(!(a?f in e:Mye.call(e,f)))return!1}var p=o.get(t),y=o.get(e);if(p&&y)return p==e&&y==t;var v=!0;o.set(t,e),o.set(e,t);for(var g=a;++d-1}var Mxe=Txe;function Axe(t,e,n){for(var r=-1,i=t==null?0:t.length;++r=zxe){var c=e?null:Bxe(t);if(c)return $xe(c);a=!1,i=Fxe,l=new kxe}else l=e?[]:s;e:for(;++r=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function ibe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function obe(t){return t.value}function abe(t,e){if(Z.isValidElement(t))return Z.cloneElement(t,e);if(typeof t=="function")return Z.createElement(t,e);e.ref;var n=rbe(e,Kxe);return Z.createElement(OC,n)}var mI=1,hd=function(t){function e(){var n;Yxe(this,e);for(var r=arguments.length,i=new Array(r),o=0;omI||Math.abs(i.height-this.lastBoundingBox.height)>mI)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,r&&r(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Oa({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var i=this.props,o=i.layout,a=i.align,s=i.verticalAlign,l=i.margin,c=i.chartWidth,u=i.chartHeight,d,f;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(a==="center"&&o==="vertical"){var p=this.getBBoxSnapshot();d={left:((c||0)-p.width)/2}}else d=a==="right"?{right:l&&l.right||0}:{left:l&&l.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(s==="middle"){var y=this.getBBoxSnapshot();f={top:((u||0)-y.height)/2}}else f=s==="bottom"?{bottom:l&&l.bottom||0}:{top:l&&l.top||0};return Oa(Oa({},d),f)}},{key:"render",value:function(){var r=this,i=this.props,o=i.content,a=i.width,s=i.height,l=i.wrapperStyle,c=i.payloadUniqBy,u=i.payload,d=Oa(Oa({position:"absolute",width:a||"auto",height:s||"auto"},this.getDefaultPosition(l)),l);return Z.createElement("div",{className:"recharts-legend-wrapper",style:d,ref:function(p){r.wrapperNode=p}},abe(o,Oa(Oa({},this.props),{},{payload:$5(u,c,obe)})))}}],[{key:"getWithHeight",value:function(r,i){var o=Oa(Oa({},this.defaultProps),r.props),a=o.layout;return a==="vertical"&&ze(r.props.height)?{height:r.props.height}:a==="horizontal"?{width:r.props.width||i}:null}}])}(_.PureComponent);_b(hd,"displayName","Legend");_b(hd,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var gI=Um,sbe=DC,lbe=yi,vI=gI?gI.isConcatSpreadable:void 0;function cbe(t){return lbe(t)||sbe(t)||!!(vI&&t&&t[vI])}var ube=cbe,dbe=R5,fbe=ube;function V5(t,e,n,r,i){var o=-1,a=t.length;for(n||(n=fbe),i||(i=[]);++o0&&n(s)?e>1?V5(s,e-1,n,r,i):dbe(i,s):r||(i[i.length]=s)}return i}var G5=V5;function hbe(t){return function(e,n,r){for(var i=-1,o=Object(e),a=r(e),s=a.length;s--;){var l=a[t?s:++i];if(n(o[l],l,o)===!1)break}return e}}var pbe=hbe,mbe=pbe,gbe=mbe(),vbe=gbe,ybe=vbe,xbe=jC;function bbe(t,e){return t&&ybe(t,e,xbe)}var W5=bbe,_be=bb;function wbe(t,e){return function(n,r){if(n==null)return n;if(!_be(n))return t(n,r);for(var i=n.length,o=e?i:-1,a=Object(n);(e?o--:++oe||o&&a&&l&&!s&&!c||r&&a&&l||!n&&l||!i)return 1;if(!r&&!o&&!c&&t=s)return l;var c=n[r];return l*(c=="desc"?-1:1)}}return t.index-e.index}var kbe=Lbe,Hw=wC,jbe=SC,Ube=kf,Fbe=X5,Bbe=Nbe,$be=I5,zbe=kbe,Hbe=Lf,Vbe=yi;function Gbe(t,e,n){e.length?e=Hw(e,function(o){return Vbe(o)?function(a){return jbe(a,o.length===1?o[0]:o)}:o}):e=[Hbe];var r=-1;e=Hw(e,$be(Ube));var i=Fbe(t,function(o,a,s){var l=Hw(e,function(c){return c(o)});return{criteria:l,index:++r,value:o}});return Bbe(i,function(o,a){return zbe(o,a,n)})}var Wbe=Gbe;function Xbe(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var qbe=Xbe,Kbe=qbe,xI=Math.max;function Ybe(t,e,n){return e=xI(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=xI(r.length-e,0),a=Array(o);++i0){if(++e>=a_e)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var u_e=c_e,d_e=o_e,f_e=u_e,h_e=f_e(d_e),p_e=h_e,m_e=Lf,g_e=Jbe,v_e=p_e;function y_e(t,e){return v_e(g_e(t,e,m_e),t+"")}var x_e=y_e,b_e=yC,__e=bb,w_e=LC,S_e=Al;function E_e(t,e,n){if(!S_e(n))return!1;var r=typeof e;return(r=="number"?__e(n)&&w_e(e,n.length):r=="string"&&e in n)?b_e(n[e],t):!1}var wb=E_e,T_e=G5,M_e=Wbe,A_e=x_e,_I=wb,C_e=A_e(function(t,e){if(t==null)return[];var n=e.length;return n>1&&_I(t,e[0],e[1])?e=[]:n>2&&_I(e[0],e[1],e[2])&&(e=[e[0]]),M_e(t,T_e(e,1),[])}),P_e=C_e;const BC=dn(P_e);function Dp(t){"@babel/helpers - typeof";return Dp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Dp(t)}function G1(){return G1=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=e.x),"".concat(hh,"-left"),ze(n)&&e&&ze(e.x)&&n=e.y),"".concat(hh,"-top"),ze(r)&&e&&ze(e.y)&&rv?Math.max(u,l[r]):Math.max(d,l[r])}function V_e(t){var e=t.translateX,n=t.translateY,r=t.useTranslate3d;return{transform:r?"translate3d(".concat(e,"px, ").concat(n,"px, 0)"):"translate(".concat(e,"px, ").concat(n,"px)")}}function G_e(t){var e=t.allowEscapeViewBox,n=t.coordinate,r=t.offsetTopLeft,i=t.position,o=t.reverseDirection,a=t.tooltipBox,s=t.useTranslate3d,l=t.viewBox,c,u,d;return a.height>0&&a.width>0&&n?(u=EI({allowEscapeViewBox:e,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:a.width,viewBox:l,viewBoxDimension:l.width}),d=EI({allowEscapeViewBox:e,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:a.height,viewBox:l,viewBoxDimension:l.height}),c=V_e({translateX:u,translateY:d,useTranslate3d:s})):c=z_e,{cssProperties:c,cssClasses:H_e({translateX:u,translateY:d,coordinate:n})}}function Wd(t){"@babel/helpers - typeof";return Wd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Wd(t)}function TI(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 MI(t){for(var e=1;eAI||Math.abs(r.height-this.state.lastBoundingBox.height)>AI)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,i=this.props,o=i.active,a=i.allowEscapeViewBox,s=i.animationDuration,l=i.animationEasing,c=i.children,u=i.coordinate,d=i.hasPayload,f=i.isAnimationActive,p=i.offset,y=i.position,v=i.reverseDirection,g=i.useTranslate3d,m=i.viewBox,x=i.wrapperStyle,b=G_e({allowEscapeViewBox:a,coordinate:u,offsetTopLeft:p,position:y,reverseDirection:v,tooltipBox:this.state.lastBoundingBox,useTranslate3d:g,viewBox:m}),S=b.cssClasses,w=b.cssProperties,E=MI(MI({transition:f&&o?"transform ".concat(s,"ms ").concat(l):void 0},w),{},{pointerEvents:"none",visibility:!this.state.dismissed&&o&&d?"visible":"hidden",position:"absolute",top:0,left:0},x);return Z.createElement("div",{tabIndex:-1,className:S,style:E,ref:function(A){r.wrapperNode=A}},c)}}])}(_.PureComponent),twe=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},jf={isSsr:twe()};function Xd(t){"@babel/helpers - typeof";return Xd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xd(t)}function CI(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 PI(t){for(var e=1;e0;return Z.createElement(ewe,{allowEscapeViewBox:a,animationDuration:s,animationEasing:l,isAnimationActive:f,active:o,coordinate:u,hasPayload:E,offset:p,position:g,reverseDirection:m,useTranslate3d:x,viewBox:b,wrapperStyle:S},dwe(c,PI(PI({},this.props),{},{payload:w})))}}])}(_.PureComponent);$C(So,"displayName","Tooltip");$C(So,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!jf.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var fwe=wa,hwe=function(){return fwe.Date.now()},pwe=hwe,mwe=/\s/;function gwe(t){for(var e=t.length;e--&&mwe.test(t.charAt(e)););return e}var vwe=gwe,ywe=vwe,xwe=/^\s+/;function bwe(t){return t&&t.slice(0,ywe(t)+1).replace(xwe,"")}var _we=bwe,wwe=_we,RI=Al,Swe=Cf,NI=NaN,Ewe=/^[-+]0x[0-9a-f]+$/i,Twe=/^0b[01]+$/i,Mwe=/^0o[0-7]+$/i,Awe=parseInt;function Cwe(t){if(typeof t=="number")return t;if(Swe(t))return NI;if(RI(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=RI(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=wwe(t);var n=Twe.test(t);return n||Mwe.test(t)?Awe(t.slice(2),n?2:8):Ewe.test(t)?NI:+t}var Q5=Cwe,Pwe=Al,Gw=pwe,OI=Q5,Rwe="Expected a function",Nwe=Math.max,Owe=Math.min;function Iwe(t,e,n){var r,i,o,a,s,l,c=0,u=!1,d=!1,f=!0;if(typeof t!="function")throw new TypeError(Rwe);e=OI(e)||0,Pwe(n)&&(u=!!n.leading,d="maxWait"in n,o=d?Nwe(OI(n.maxWait)||0,e):o,f="trailing"in n?!!n.trailing:f);function p(E){var T=r,A=i;return r=i=void 0,c=E,a=t.apply(A,T),a}function y(E){return c=E,s=setTimeout(m,e),u?p(E):a}function v(E){var T=E-l,A=E-c,M=e-T;return d?Owe(M,o-A):M}function g(E){var T=E-l,A=E-c;return l===void 0||T>=e||T<0||d&&A>=o}function m(){var E=Gw();if(g(E))return x(E);s=setTimeout(m,v(E))}function x(E){return s=void 0,f&&r?p(E):(r=i=void 0,a)}function b(){s!==void 0&&clearTimeout(s),c=0,r=l=i=s=void 0}function S(){return s===void 0?a:x(Gw())}function w(){var E=Gw(),T=g(E);if(r=arguments,i=this,l=E,T){if(s===void 0)return y(l);if(d)return clearTimeout(s),s=setTimeout(m,e),p(l)}return s===void 0&&(s=setTimeout(m,e)),a}return w.cancel=b,w.flush=S,w}var Dwe=Iwe,Lwe=Dwe,kwe=Al,jwe="Expected a function";function Uwe(t,e,n){var r=!0,i=!0;if(typeof t!="function")throw new TypeError(jwe);return kwe(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Lwe(t,e,{leading:r,maxWait:e,trailing:i})}var Fwe=Uwe;const eH=dn(Fwe);function kp(t){"@babel/helpers - typeof";return kp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},kp(t)}function II(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 cv(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&(D=eH(D,v,{trailing:!0,leading:!1}));var k=new ResizeObserver(D),U=w.current.getBoundingClientRect(),O=U.width,W=U.height;return P(O,W),k.observe(w.current),function(){k.disconnect()}},[P,v]);var R=_.useMemo(function(){var D=M.containerWidth,k=M.containerHeight;if(D<0||k<0)return null;vc(tc(a)||tc(l),`The width(%s) and height(%s) are both fixed numbers, - maybe you don't need to use a ResponsiveContainer.`,a,l),vc(!n||n>0,"The aspect(%s) must be greater than zero.",n);var U=tc(a)?D:a,O=tc(l)?k:l;n&&n>0&&(U?O=U/n:O&&(U=O*n),f&&O>f&&(O=f)),vc(U>0||O>0,`The width(%s) and height(%s) of chart should be greater than 0, - please check the style of container, or the props width(%s) and height(%s), - or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the - height and width.`,U,O,a,l,u,d,n);var W=!Array.isArray(p)&&Ka(p.type).endsWith("Chart");return Z.Children.map(p,function(L){return Z.isValidElement(L)?_.cloneElement(L,cv({width:U,height:O},W?{style:cv({height:"100%",width:"100%",maxHeight:O,maxWidth:U},L.props.style)}:{})):L})},[n,p,l,f,d,u,M,a]);return Z.createElement("div",{id:g?"".concat(g):void 0,className:zt("recharts-responsive-container",m),style:cv(cv({},S),{},{width:a,height:l,minWidth:u,minHeight:d,maxHeight:f}),ref:w},R)}),tH=function(e){return null};tH.displayName="Cell";function jp(t){"@babel/helpers - typeof";return jp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jp(t)}function kI(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 K1(t){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||jf.isSsr)return{width:0,height:0};var r=Qwe(n),i=JSON.stringify({text:e,copyStyle:r});if(Su.widthCache[i])return Su.widthCache[i];try{var o=document.getElementById(jI);o||(o=document.createElement("span"),o.setAttribute("id",jI),o.setAttribute("aria-hidden","true"),document.body.appendChild(o));var a=K1(K1({},Zwe),r);Object.assign(o.style,a),o.textContent="".concat(e);var s=o.getBoundingClientRect(),l={width:s.width,height:s.height};return Su.widthCache[i]=l,++Su.cacheCount>Jwe&&(Su.cacheCount=0,Su.widthCache={}),l}catch{return{width:0,height:0}}},eSe=function(e){return{top:e.top+window.scrollY-document.documentElement.clientTop,left:e.left+window.scrollX-document.documentElement.clientLeft}};function Up(t){"@babel/helpers - typeof";return Up=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Up(t)}function Yy(t,e){return iSe(t)||rSe(t,e)||nSe(t,e)||tSe()}function tSe(){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 nSe(t,e){if(t){if(typeof t=="string")return UI(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return UI(t,e)}}function UI(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function ySe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function VI(t,e){return wSe(t)||_Se(t,e)||bSe(t,e)||xSe()}function xSe(){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 bSe(t,e){if(t){if(typeof t=="string")return GI(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return GI(t,e)}}function GI(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&arguments[0]!==void 0?arguments[0]:[];return U.reduce(function(O,W){var L=W.word,j=W.width,X=O[O.length-1];if(X&&(i==null||o||X.width+j+rW.width?O:W})};if(!u)return p;for(var v="โ€ฆ",g=function(U){var O=d.slice(0,U),W=oH({breakAll:c,style:l,children:O+v}).wordsWithComputedWidth,L=f(W),j=L.length>a||y(L).width>Number(i);return[j,L]},m=0,x=d.length-1,b=0,S;m<=x&&b<=d.length-1;){var w=Math.floor((m+x)/2),E=w-1,T=g(E),A=VI(T,2),M=A[0],C=A[1],P=g(w),R=VI(P,1),D=R[0];if(!M&&!D&&(m=w+1),M&&D&&(x=w-1),!M&&D){S=C;break}b++}return S||p},WI=function(e){var n=Ut(e)?[]:e.toString().split(iH);return[{words:n}]},ESe=function(e){var n=e.width,r=e.scaleToFit,i=e.children,o=e.style,a=e.breakAll,s=e.maxLines;if((n||r)&&!jf.isSsr){var l,c,u=oH({breakAll:a,children:i,style:o});if(u){var d=u.wordsWithComputedWidth,f=u.spaceWidth;l=d,c=f}else return WI(i);return SSe({breakAll:a,children:i,maxLines:s,style:o},l,c,n,r)}return WI(i)},XI="#808080",Jy=function(e){var n=e.x,r=n===void 0?0:n,i=e.y,o=i===void 0?0:i,a=e.lineHeight,s=a===void 0?"1em":a,l=e.capHeight,c=l===void 0?"0.71em":l,u=e.scaleToFit,d=u===void 0?!1:u,f=e.textAnchor,p=f===void 0?"start":f,y=e.verticalAnchor,v=y===void 0?"end":y,g=e.fill,m=g===void 0?XI:g,x=HI(e,gSe),b=_.useMemo(function(){return ESe({breakAll:x.breakAll,children:x.children,maxLines:x.maxLines,scaleToFit:d,style:x.style,width:x.width})},[x.breakAll,x.children,x.maxLines,d,x.style,x.width]),S=x.dx,w=x.dy,E=x.angle,T=x.className,A=x.breakAll,M=HI(x,vSe);if(!Yn(r)||!Yn(o))return null;var C=r+(ze(S)?S:0),P=o+(ze(w)?w:0),R;switch(v){case"start":R=Ww("calc(".concat(c,")"));break;case"middle":R=Ww("calc(".concat((b.length-1)/2," * -").concat(s," + (").concat(c," / 2))"));break;default:R=Ww("calc(".concat(b.length-1," * -").concat(s,")"));break}var D=[];if(d){var k=b[0].width,U=x.width;D.push("scale(".concat((ze(U)?U/k:1)/k,")"))}return E&&D.push("rotate(".concat(E,", ").concat(C,", ").concat(P,")")),D.length&&(M.transform=D.join(" ")),Z.createElement("text",Y1({},$t(M,!0),{x:C,y:P,className:zt("recharts-text",T),textAnchor:p,fill:m.includes("url")?XI:m}),b.map(function(O,W){var L=O.words.join(A?"":" ");return Z.createElement("tspan",{x:C,dy:W===0?R:s,key:"".concat(L,"-").concat(W)},L)}))};function nl(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function TSe(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function zC(t){let e,n,r;t.length!==2?(e=nl,n=(s,l)=>nl(t(s),l),r=(s,l)=>t(s)-l):(e=t===nl||t===TSe?t:MSe,n=t,r=t);function i(s,l,c=0,u=s.length){if(c>>1;n(s[d],l)<0?c=d+1:u=d}while(c>>1;n(s[d],l)<=0?c=d+1:u=d}while(cc&&r(s[d-1],l)>-r(s[d],l)?d-1:d}return{left:i,center:a,right:o}}function MSe(){return 0}function aH(t){return t===null?NaN:+t}function*ASe(t,e){for(let n of t)n!=null&&(n=+n)>=n&&(yield n)}const CSe=zC(nl),$m=CSe.right;zC(aH).center;class qI extends Map{constructor(e,n=NSe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const[r,i]of e)this.set(r,i)}get(e){return super.get(KI(this,e))}has(e){return super.has(KI(this,e))}set(e,n){return super.set(PSe(this,e),n)}delete(e){return super.delete(RSe(this,e))}}function KI({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function PSe({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function RSe({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function NSe(t){return t!==null&&typeof t=="object"?t.valueOf():t}function OSe(t=nl){if(t===nl)return sH;if(typeof t!="function")throw new TypeError("compare is not a function");return(e,n)=>{const r=t(e,n);return r||r===0?r:(t(n,n)===0)-(t(e,e)===0)}}function sH(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(te?1:0)}const ISe=Math.sqrt(50),DSe=Math.sqrt(10),LSe=Math.sqrt(2);function Zy(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=ISe?10:o>=DSe?5:o>=LSe?2:1;let s,l,c;return i<0?(c=Math.pow(10,-i)/a,s=Math.round(t*c),l=Math.round(e*c),s/ce&&--l,c=-c):(c=Math.pow(10,i)*a,s=Math.round(t/c),l=Math.round(e/c),s*ce&&--l),l0))return[];if(t===e)return[t];const r=e=i))return[];const s=o-i+1,l=new Array(s);if(r)if(a<0)for(let c=0;c=r)&&(n=r);return n}function JI(t,e){let n;for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function lH(t,e,n=0,r=1/0,i){if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(t.length-1,r)),!(n<=e&&e<=r))return t;for(i=i===void 0?sH:OSe(i);r>n;){if(r-n>600){const l=r-n+1,c=e-n+1,u=Math.log(l),d=.5*Math.exp(2*u/3),f=.5*Math.sqrt(u*d*(l-d)/l)*(c-l/2<0?-1:1),p=Math.max(n,Math.floor(e-c*d/l+f)),y=Math.min(r,Math.floor(e+(l-c)*d/l+f));lH(t,e,p,y,i)}const o=t[e];let a=n,s=r;for(ph(t,n,e),i(t[r],o)>0&&ph(t,n,r);a0;)--s}i(t[n],o)===0?ph(t,n,s):(++s,ph(t,s,r)),s<=e&&(n=s+1),e<=s&&(r=s-1)}return t}function ph(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function kSe(t,e,n){if(t=Float64Array.from(ASe(t)),!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return JI(t);if(e>=1)return YI(t);var r,i=(r-1)*e,o=Math.floor(i),a=YI(lH(t,o).subarray(0,o+1)),s=JI(t.subarray(o+1));return a+(s-a)*(i-o)}}function jSe(t,e,n=aH){if(!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,o=Math.floor(i),a=+n(t[o],o,t),s=+n(t[o+1],o+1,t);return a+(s-a)*(i-o)}}function USe(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((e-t)/n))|0,o=new Array(i);++r>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?dv(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?dv(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=BSe.exec(t))?new ai(e[1],e[2],e[3],1):(e=$Se.exec(t))?new ai(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=zSe.exec(t))?dv(e[1],e[2],e[3],e[4]):(e=HSe.exec(t))?dv(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=VSe.exec(t))?iD(e[1],e[2]/100,e[3]/100,1):(e=GSe.exec(t))?iD(e[1],e[2]/100,e[3]/100,e[4]):ZI.hasOwnProperty(t)?tD(ZI[t]):t==="transparent"?new ai(NaN,NaN,NaN,0):null}function tD(t){return new ai(t>>16&255,t>>8&255,t&255,1)}function dv(t,e,n,r){return r<=0&&(t=e=n=NaN),new ai(t,e,n,r)}function qSe(t){return t instanceof zm||(t=zp(t)),t?(t=t.rgb(),new ai(t.r,t.g,t.b,t.opacity)):new ai}function tT(t,e,n,r){return arguments.length===1?qSe(t):new ai(t,e,n,r??1)}function ai(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}VC(ai,tT,uH(zm,{brighter(t){return t=t==null?Qy:Math.pow(Qy,t),new ai(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Bp:Math.pow(Bp,t),new ai(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new ai(yc(this.r),yc(this.g),yc(this.b),e0(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:nD,formatHex:nD,formatHex8:KSe,formatRgb:rD,toString:rD}));function nD(){return`#${nc(this.r)}${nc(this.g)}${nc(this.b)}`}function KSe(){return`#${nc(this.r)}${nc(this.g)}${nc(this.b)}${nc((isNaN(this.opacity)?1:this.opacity)*255)}`}function rD(){const t=e0(this.opacity);return`${t===1?"rgb(":"rgba("}${yc(this.r)}, ${yc(this.g)}, ${yc(this.b)}${t===1?")":`, ${t})`}`}function e0(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function yc(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function nc(t){return t=yc(t),(t<16?"0":"")+t.toString(16)}function iD(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new No(t,e,n,r)}function dH(t){if(t instanceof No)return new No(t.h,t.s,t.l,t.opacity);if(t instanceof zm||(t=zp(t)),!t)return new No;if(t instanceof No)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(e===o?a=(n-r)/s+(n0&&l<1?0:a,new No(a,s,l,t.opacity)}function YSe(t,e,n,r){return arguments.length===1?dH(t):new No(t,e,n,r??1)}function No(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}VC(No,YSe,uH(zm,{brighter(t){return t=t==null?Qy:Math.pow(Qy,t),new No(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Bp:Math.pow(Bp,t),new No(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 ai(Xw(t>=240?t-240:t+120,i,r),Xw(t,i,r),Xw(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new No(oD(this.h),fv(this.s),fv(this.l),e0(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=e0(this.opacity);return`${t===1?"hsl(":"hsla("}${oD(this.h)}, ${fv(this.s)*100}%, ${fv(this.l)*100}%${t===1?")":`, ${t})`}`}}));function oD(t){return t=(t||0)%360,t<0?t+360:t}function fv(t){return Math.max(0,Math.min(1,t||0))}function Xw(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 GC=t=>()=>t;function JSe(t,e){return function(n){return t+n*e}}function ZSe(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 QSe(t){return(t=+t)==1?fH:function(e,n){return n-e?ZSe(e,n,t):GC(isNaN(e)?n:e)}}function fH(t,e){var n=e-t;return n?JSe(t,n):GC(isNaN(t)?e:t)}const aD=function t(e){var n=QSe(e);function r(i,o){var a=n((i=tT(i)).r,(o=tT(o)).r),s=n(i.g,o.g),l=n(i.b,o.b),c=fH(i.opacity,o.opacity);return function(u){return i.r=a(u),i.g=s(u),i.b=l(u),i.opacity=c(u),i+""}}return r.gamma=t,r}(1);function eEe(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),i;return function(o){for(i=0;in&&(o=e.slice(n,o),s[a]?s[a]+=o:s[++a]=o),(r=r[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,l.push({i:a,x:t0(r,i)})),n=qw.lastIndex;return ne&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function dEe(t,e,n){var r=t[0],i=t[1],o=e[0],a=e[1];return i2?fEe:dEe,l=c=null,d}function d(f){return f==null||isNaN(f=+f)?o:(l||(l=s(t.map(r),e,n)))(r(a(f)))}return d.invert=function(f){return a(i((c||(c=s(e,t.map(r),t0)))(f)))},d.domain=function(f){return arguments.length?(t=Array.from(f,n0),u()):t.slice()},d.range=function(f){return arguments.length?(e=Array.from(f),u()):e.slice()},d.rangeRound=function(f){return e=Array.from(f),n=WC,u()},d.clamp=function(f){return arguments.length?(a=f?!0:Hr,u()):a!==Hr},d.interpolate=function(f){return arguments.length?(n=f,u()):n},d.unknown=function(f){return arguments.length?(o=f,d):o},function(f,p){return r=f,i=p,u()}}function XC(){return Sb()(Hr,Hr)}function hEe(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function r0(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 qd(t){return t=r0(Math.abs(t)),t?t[1]:NaN}function pEe(t,e){return function(n,r){for(var i=n.length,o=[],a=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),o.push(n.substring(i-=s,i+s)),!((l+=s+1)>r));)s=t[a=(a+1)%t.length];return o.reverse().join(e)}}function mEe(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var gEe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Hp(t){if(!(e=gEe.exec(t)))throw new Error("invalid format: "+t);var e;return new qC({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]})}Hp.prototype=qC.prototype;function qC(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+""}qC.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 vEe(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 hH;function yEe(t,e){var n=r0(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(hH=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+r0(t,Math.max(0,e+o-1))[0]}function lD(t,e){var n=r0(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 cD={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:hEe,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)=>lD(t*100,e),r:lD,s:yEe,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function uD(t){return t}var dD=Array.prototype.map,fD=["y","z","a","f","p","n","ยต","m","","k","M","G","T","P","E","Z","Y"];function xEe(t){var e=t.grouping===void 0||t.thousands===void 0?uD:pEe(dD.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+"",o=t.numerals===void 0?uD:mEe(dD.call(t.numerals,String)),a=t.percent===void 0?"%":t.percent+"",s=t.minus===void 0?"โˆ’":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function c(d){d=Hp(d);var f=d.fill,p=d.align,y=d.sign,v=d.symbol,g=d.zero,m=d.width,x=d.comma,b=d.precision,S=d.trim,w=d.type;w==="n"?(x=!0,w="g"):cD[w]||(b===void 0&&(b=12),S=!0,w="g"),(g||f==="0"&&p==="=")&&(g=!0,f="0",p="=");var E=v==="$"?n:v==="#"&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",T=v==="$"?r:/[%p]/.test(w)?a:"",A=cD[w],M=/[defgprs%]/.test(w);b=b===void 0?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b));function C(P){var R=E,D=T,k,U,O;if(w==="c")D=A(P)+D,P="";else{P=+P;var W=P<0||1/P<0;if(P=isNaN(P)?l:A(Math.abs(P),b),S&&(P=vEe(P)),W&&+P==0&&y!=="+"&&(W=!1),R=(W?y==="("?y:s:y==="-"||y==="("?"":y)+R,D=(w==="s"?fD[8+hH/3]:"")+D+(W&&y==="("?")":""),M){for(k=-1,U=P.length;++kO||O>57){D=(O===46?i+P.slice(k+1):P.slice(k))+D,P=P.slice(0,k);break}}}x&&!g&&(P=e(P,1/0));var L=R.length+P.length+D.length,j=L>1)+R+P+D+j.slice(L);break;default:P=j+R+P+D;break}return o(P)}return C.toString=function(){return d+""},C}function u(d,f){var p=c((d=Hp(d),d.type="f",d)),y=Math.max(-8,Math.min(8,Math.floor(qd(f)/3)))*3,v=Math.pow(10,-y),g=fD[8+y/3];return function(m){return p(v*m)+g}}return{format:c,formatPrefix:u}}var hv,KC,pH;bEe({thousands:",",grouping:[3],currency:["$",""]});function bEe(t){return hv=xEe(t),KC=hv.format,pH=hv.formatPrefix,hv}function _Ee(t){return Math.max(0,-qd(Math.abs(t)))}function wEe(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(qd(e)/3)))*3-qd(Math.abs(t)))}function SEe(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,qd(e)-qd(t))+1}function mH(t,e,n,r){var i=Q1(t,e,n),o;switch(r=Hp(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(o=wEe(i,a))&&(r.precision=o),pH(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=SEe(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=_Ee(i))&&(r.precision=o-(r.type==="%")*2);break}}return KC(r)}function Cl(t){var e=t.domain;return t.ticks=function(n){var r=e();return J1(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return mH(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,o=r.length-1,a=r[i],s=r[o],l,c,u=10;for(s0;){if(c=Z1(a,s,n),c===l)return r[i]=a,r[o]=s,e(r);if(c>0)a=Math.floor(a/c)*c,s=Math.ceil(s/c)*c;else if(c<0)a=Math.ceil(a*c)/c,s=Math.floor(s*c)/c;else break;l=c}return t},t}function i0(){var t=XC();return t.copy=function(){return Hm(t,i0())},lo.apply(t,arguments),Cl(t)}function gH(t){var e;function n(r){return r==null||isNaN(r=+r)?e:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(t=Array.from(r,n0),n):t.slice()},n.unknown=function(r){return arguments.length?(e=r,n):e},n.copy=function(){return gH(t).unknown(e)},t=arguments.length?Array.from(t,n0):[0,1],Cl(n)}function vH(t,e){t=t.slice();var n=0,r=t.length-1,i=t[n],o=t[r],a;return oMath.pow(t,e)}function CEe(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function mD(t){return(e,n)=>-t(-e,n)}function YC(t){const e=t(hD,pD),n=e.domain;let r=10,i,o;function a(){return i=CEe(r),o=AEe(r),n()[0]<0?(i=mD(i),o=mD(o),t(EEe,TEe)):t(hD,pD),e}return e.base=function(s){return arguments.length?(r=+s,a()):r},e.domain=function(s){return arguments.length?(n(s),a()):n()},e.ticks=s=>{const l=n();let c=l[0],u=l[l.length-1];const d=u0){for(;f<=p;++f)for(y=1;yu)break;m.push(v)}}else for(;f<=p;++f)for(y=r-1;y>=1;--y)if(v=f>0?y/o(-f):y*o(f),!(vu)break;m.push(v)}m.length*2{if(s==null&&(s=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=Hp(l)).precision==null&&(l.trim=!0),l=KC(l)),s===1/0)return l;const c=Math.max(1,r*s/e.ticks().length);return u=>{let d=u/o(Math.round(i(u)));return d*rn(vH(n(),{floor:s=>o(Math.floor(i(s))),ceil:s=>o(Math.ceil(i(s)))})),e}function yH(){const t=YC(Sb()).domain([1,10]);return t.copy=()=>Hm(t,yH()).base(t.base()),lo.apply(t,arguments),t}function gD(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function vD(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function JC(t){var e=1,n=t(gD(e),vD(e));return n.constant=function(r){return arguments.length?t(gD(e=+r),vD(e)):e},Cl(n)}function xH(){var t=JC(Sb());return t.copy=function(){return Hm(t,xH()).constant(t.constant())},lo.apply(t,arguments)}function yD(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function PEe(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function REe(t){return t<0?-t*t:t*t}function ZC(t){var e=t(Hr,Hr),n=1;function r(){return n===1?t(Hr,Hr):n===.5?t(PEe,REe):t(yD(n),yD(1/n))}return e.exponent=function(i){return arguments.length?(n=+i,r()):n},Cl(e)}function QC(){var t=ZC(Sb());return t.copy=function(){return Hm(t,QC()).exponent(t.exponent())},lo.apply(t,arguments),t}function NEe(){return QC.apply(null,arguments).exponent(.5)}function xD(t){return Math.sign(t)*t*t}function OEe(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}function bH(){var t=XC(),e=[0,1],n=!1,r;function i(o){var a=OEe(t(o));return isNaN(a)?r:n?Math.round(a):a}return i.invert=function(o){return t.invert(xD(o))},i.domain=function(o){return arguments.length?(t.domain(o),i):t.domain()},i.range=function(o){return arguments.length?(t.range((e=Array.from(o,n0)).map(xD)),i):e.slice()},i.rangeRound=function(o){return i.range(o).round(!0)},i.round=function(o){return arguments.length?(n=!!o,i):n},i.clamp=function(o){return arguments.length?(t.clamp(o),i):t.clamp()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return bH(t.domain(),e).round(n).clamp(t.clamp()).unknown(r)},lo.apply(i,arguments),Cl(i)}function _H(){var t=[],e=[],n=[],r;function i(){var a=0,s=Math.max(1,e.length);for(n=new Array(s-1);++a0?n[s-1]:t[0],s=n?[r[n-1],e]:[r[c-1],r[c]]},a.unknown=function(l){return arguments.length&&(o=l),a},a.thresholds=function(){return r.slice()},a.copy=function(){return wH().domain([t,e]).range(i).unknown(o)},lo.apply(Cl(a),arguments)}function SH(){var t=[.5],e=[0,1],n,r=1;function i(o){return o!=null&&o<=o?e[$m(t,o,0,r)]:n}return i.domain=function(o){return arguments.length?(t=Array.from(o),r=Math.min(t.length,e.length-1),i):t.slice()},i.range=function(o){return arguments.length?(e=Array.from(o),r=Math.min(t.length,e.length-1),i):e.slice()},i.invertExtent=function(o){var a=e.indexOf(o);return[t[a-1],t[a]]},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return SH().domain(t).range(e).unknown(n)},lo.apply(i,arguments)}const Kw=new Date,Yw=new Date;function tr(t,e,n,r){function i(o){return t(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(t(o=new Date(+o)),o),i.ceil=o=>(t(o=new Date(o-1)),e(o,1),t(o),o),i.round=o=>{const a=i(o),s=i.ceil(o);return o-a(e(o=new Date(+o),a==null?1:Math.floor(a)),o),i.range=(o,a,s)=>{const l=[];if(o=i.ceil(o),s=s==null?1:Math.floor(s),!(o0))return l;let c;do l.push(c=new Date(+o)),e(o,s),t(o);while(ctr(a=>{if(a>=a)for(;t(a),!o(a);)a.setTime(a-1)},(a,s)=>{if(a>=a)if(s<0)for(;++s<=0;)for(;e(a,-1),!o(a););else for(;--s>=0;)for(;e(a,1),!o(a););}),n&&(i.count=(o,a)=>(Kw.setTime(+o),Yw.setTime(+a),t(Kw),t(Yw),Math.floor(n(Kw,Yw))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?a=>r(a)%o===0:a=>i.count(0,a)%o===0):i)),i}const o0=tr(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);o0.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?tr(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):o0);o0.range;const Ha=1e3,Qi=Ha*60,Va=Qi*60,is=Va*24,eP=is*7,bD=is*30,Jw=is*365,rc=tr(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*Ha)},(t,e)=>(e-t)/Ha,t=>t.getUTCSeconds());rc.range;const tP=tr(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Ha)},(t,e)=>{t.setTime(+t+e*Qi)},(t,e)=>(e-t)/Qi,t=>t.getMinutes());tP.range;const nP=tr(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*Qi)},(t,e)=>(e-t)/Qi,t=>t.getUTCMinutes());nP.range;const rP=tr(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Ha-t.getMinutes()*Qi)},(t,e)=>{t.setTime(+t+e*Va)},(t,e)=>(e-t)/Va,t=>t.getHours());rP.range;const iP=tr(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*Va)},(t,e)=>(e-t)/Va,t=>t.getUTCHours());iP.range;const Vm=tr(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Qi)/is,t=>t.getDate()-1);Vm.range;const Eb=tr(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/is,t=>t.getUTCDate()-1);Eb.range;const EH=tr(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/is,t=>Math.floor(t/is));EH.range;function Kc(t){return tr(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*Qi)/eP)}const Tb=Kc(0),a0=Kc(1),IEe=Kc(2),DEe=Kc(3),Kd=Kc(4),LEe=Kc(5),kEe=Kc(6);Tb.range;a0.range;IEe.range;DEe.range;Kd.range;LEe.range;kEe.range;function Yc(t){return tr(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/eP)}const Mb=Yc(0),s0=Yc(1),jEe=Yc(2),UEe=Yc(3),Yd=Yc(4),FEe=Yc(5),BEe=Yc(6);Mb.range;s0.range;jEe.range;UEe.range;Yd.range;FEe.range;BEe.range;const oP=tr(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());oP.range;const aP=tr(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());aP.range;const os=tr(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());os.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:tr(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});os.range;const as=tr(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());as.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:tr(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});as.range;function TH(t,e,n,r,i,o){const a=[[rc,1,Ha],[rc,5,5*Ha],[rc,15,15*Ha],[rc,30,30*Ha],[o,1,Qi],[o,5,5*Qi],[o,15,15*Qi],[o,30,30*Qi],[i,1,Va],[i,3,3*Va],[i,6,6*Va],[i,12,12*Va],[r,1,is],[r,2,2*is],[n,1,eP],[e,1,bD],[e,3,3*bD],[t,1,Jw]];function s(c,u,d){const f=ug).right(a,f);if(p===a.length)return t.every(Q1(c/Jw,u/Jw,d));if(p===0)return o0.every(Math.max(Q1(c,u,d),1));const[y,v]=a[f/a[p-1][2]53)return null;"w"in le||(le.w=1),"Z"in le?(G=Qw(mh(le.y,0,1)),Ve=G.getUTCDay(),G=Ve>4||Ve===0?s0.ceil(G):s0(G),G=Eb.offset(G,(le.V-1)*7),le.y=G.getUTCFullYear(),le.m=G.getUTCMonth(),le.d=G.getUTCDate()+(le.w+6)%7):(G=Zw(mh(le.y,0,1)),Ve=G.getDay(),G=Ve>4||Ve===0?a0.ceil(G):a0(G),G=Vm.offset(G,(le.V-1)*7),le.y=G.getFullYear(),le.m=G.getMonth(),le.d=G.getDate()+(le.w+6)%7)}else("W"in le||"U"in le)&&("w"in le||(le.w="u"in le?le.u%7:"W"in le?1:0),Ve="Z"in le?Qw(mh(le.y,0,1)).getUTCDay():Zw(mh(le.y,0,1)).getDay(),le.m=0,le.d="W"in le?(le.w+6)%7+le.W*7-(Ve+5)%7:le.w+le.U*7-(Ve+6)%7);return"Z"in le?(le.H+=le.Z/100|0,le.M+=le.Z%100,Qw(le)):Zw(le)}}function A(ae,fe,we,le){for(var ie=0,G=fe.length,Ve=we.length,Ne,st;ie=Ve)return-1;if(Ne=fe.charCodeAt(ie++),Ne===37){if(Ne=fe.charAt(ie++),st=w[Ne in _D?fe.charAt(ie++):Ne],!st||(le=st(ae,we,le))<0)return-1}else if(Ne!=we.charCodeAt(le++))return-1}return le}function M(ae,fe,we){var le=c.exec(fe.slice(we));return le?(ae.p=u.get(le[0].toLowerCase()),we+le[0].length):-1}function C(ae,fe,we){var le=p.exec(fe.slice(we));return le?(ae.w=y.get(le[0].toLowerCase()),we+le[0].length):-1}function P(ae,fe,we){var le=d.exec(fe.slice(we));return le?(ae.w=f.get(le[0].toLowerCase()),we+le[0].length):-1}function R(ae,fe,we){var le=m.exec(fe.slice(we));return le?(ae.m=x.get(le[0].toLowerCase()),we+le[0].length):-1}function D(ae,fe,we){var le=v.exec(fe.slice(we));return le?(ae.m=g.get(le[0].toLowerCase()),we+le[0].length):-1}function k(ae,fe,we){return A(ae,e,fe,we)}function U(ae,fe,we){return A(ae,n,fe,we)}function O(ae,fe,we){return A(ae,r,fe,we)}function W(ae){return a[ae.getDay()]}function L(ae){return o[ae.getDay()]}function j(ae){return l[ae.getMonth()]}function X(ae){return s[ae.getMonth()]}function K(ae){return i[+(ae.getHours()>=12)]}function F(ae){return 1+~~(ae.getMonth()/3)}function Y(ae){return a[ae.getUTCDay()]}function q(ae){return o[ae.getUTCDay()]}function Q(ae){return l[ae.getUTCMonth()]}function te(ae){return s[ae.getUTCMonth()]}function ee(ae){return i[+(ae.getUTCHours()>=12)]}function ce(ae){return 1+~~(ae.getUTCMonth()/3)}return{format:function(ae){var fe=E(ae+="",b);return fe.toString=function(){return ae},fe},parse:function(ae){var fe=T(ae+="",!1);return fe.toString=function(){return ae},fe},utcFormat:function(ae){var fe=E(ae+="",S);return fe.toString=function(){return ae},fe},utcParse:function(ae){var fe=T(ae+="",!0);return fe.toString=function(){return ae},fe}}}var _D={"-":"",_:" ",0:"0"},dr=/^\s*\d+/,WEe=/^%/,XEe=/[\\^$*+?|[\]().{}]/g;function qt(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o[e.toLowerCase(),n]))}function KEe(t,e,n){var r=dr.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function YEe(t,e,n){var r=dr.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function JEe(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function ZEe(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function QEe(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function wD(t,e,n){var r=dr.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function SD(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function e1e(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function t1e(t,e,n){var r=dr.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function n1e(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function ED(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function r1e(t,e,n){var r=dr.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function TD(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function i1e(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function o1e(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function a1e(t,e,n){var r=dr.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function s1e(t,e,n){var r=dr.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function l1e(t,e,n){var r=WEe.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function c1e(t,e,n){var r=dr.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function u1e(t,e,n){var r=dr.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function MD(t,e){return qt(t.getDate(),e,2)}function d1e(t,e){return qt(t.getHours(),e,2)}function f1e(t,e){return qt(t.getHours()%12||12,e,2)}function h1e(t,e){return qt(1+Vm.count(os(t),t),e,3)}function MH(t,e){return qt(t.getMilliseconds(),e,3)}function p1e(t,e){return MH(t,e)+"000"}function m1e(t,e){return qt(t.getMonth()+1,e,2)}function g1e(t,e){return qt(t.getMinutes(),e,2)}function v1e(t,e){return qt(t.getSeconds(),e,2)}function y1e(t){var e=t.getDay();return e===0?7:e}function x1e(t,e){return qt(Tb.count(os(t)-1,t),e,2)}function AH(t){var e=t.getDay();return e>=4||e===0?Kd(t):Kd.ceil(t)}function b1e(t,e){return t=AH(t),qt(Kd.count(os(t),t)+(os(t).getDay()===4),e,2)}function _1e(t){return t.getDay()}function w1e(t,e){return qt(a0.count(os(t)-1,t),e,2)}function S1e(t,e){return qt(t.getFullYear()%100,e,2)}function E1e(t,e){return t=AH(t),qt(t.getFullYear()%100,e,2)}function T1e(t,e){return qt(t.getFullYear()%1e4,e,4)}function M1e(t,e){var n=t.getDay();return t=n>=4||n===0?Kd(t):Kd.ceil(t),qt(t.getFullYear()%1e4,e,4)}function A1e(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+qt(e/60|0,"0",2)+qt(e%60,"0",2)}function AD(t,e){return qt(t.getUTCDate(),e,2)}function C1e(t,e){return qt(t.getUTCHours(),e,2)}function P1e(t,e){return qt(t.getUTCHours()%12||12,e,2)}function R1e(t,e){return qt(1+Eb.count(as(t),t),e,3)}function CH(t,e){return qt(t.getUTCMilliseconds(),e,3)}function N1e(t,e){return CH(t,e)+"000"}function O1e(t,e){return qt(t.getUTCMonth()+1,e,2)}function I1e(t,e){return qt(t.getUTCMinutes(),e,2)}function D1e(t,e){return qt(t.getUTCSeconds(),e,2)}function L1e(t){var e=t.getUTCDay();return e===0?7:e}function k1e(t,e){return qt(Mb.count(as(t)-1,t),e,2)}function PH(t){var e=t.getUTCDay();return e>=4||e===0?Yd(t):Yd.ceil(t)}function j1e(t,e){return t=PH(t),qt(Yd.count(as(t),t)+(as(t).getUTCDay()===4),e,2)}function U1e(t){return t.getUTCDay()}function F1e(t,e){return qt(s0.count(as(t)-1,t),e,2)}function B1e(t,e){return qt(t.getUTCFullYear()%100,e,2)}function $1e(t,e){return t=PH(t),qt(t.getUTCFullYear()%100,e,2)}function z1e(t,e){return qt(t.getUTCFullYear()%1e4,e,4)}function H1e(t,e){var n=t.getUTCDay();return t=n>=4||n===0?Yd(t):Yd.ceil(t),qt(t.getUTCFullYear()%1e4,e,4)}function V1e(){return"+0000"}function CD(){return"%"}function PD(t){return+t}function RD(t){return Math.floor(+t/1e3)}var Eu,RH,NH;G1e({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function G1e(t){return Eu=GEe(t),RH=Eu.format,Eu.parse,NH=Eu.utcFormat,Eu.utcParse,Eu}function W1e(t){return new Date(t)}function X1e(t){return t instanceof Date?+t:+new Date(+t)}function sP(t,e,n,r,i,o,a,s,l,c){var u=XC(),d=u.invert,f=u.domain,p=c(".%L"),y=c(":%S"),v=c("%I:%M"),g=c("%I %p"),m=c("%a %d"),x=c("%b %d"),b=c("%B"),S=c("%Y");function w(E){return(l(E)e(i/(t.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,o)=>kSe(t,o/r))},n.copy=function(){return LH(e).domain(t)},fs.apply(n,arguments)}function Cb(){var t=0,e=.5,n=1,r=1,i,o,a,s,l,c=Hr,u,d=!1,f;function p(v){return isNaN(v=+v)?f:(v=.5+((v=+u(v))-o)*(r*ve}var tTe=eTe,nTe=FH,rTe=tTe,iTe=Lf;function oTe(t){return t&&t.length?nTe(t,iTe,rTe):void 0}var aTe=oTe;const Pb=dn(aTe);function sTe(t,e){return tt.e^o.s<0?1:-1;for(r=o.d.length,i=t.d.length,e=0,n=rt.d[e]^o.s<0?1:-1;return r===i?0:r>i^o.s<0?1:-1};Ke.decimalPlaces=Ke.dp=function(){var t=this,e=t.d.length-1,n=(e-t.e)*wn;if(e=t.d[e],e)for(;e%10==0;e/=10)n--;return n<0?0:n};Ke.dividedBy=Ke.div=function(t){return Ya(this,new this.constructor(t))};Ke.dividedToIntegerBy=Ke.idiv=function(t){var e=this,n=e.constructor;return un(Ya(e,new n(t),0,1),n.precision)};Ke.equals=Ke.eq=function(t){return!this.cmp(t)};Ke.exponent=function(){return Hn(this)};Ke.greaterThan=Ke.gt=function(t){return this.cmp(t)>0};Ke.greaterThanOrEqualTo=Ke.gte=function(t){return this.cmp(t)>=0};Ke.isInteger=Ke.isint=function(){return this.e>this.d.length-2};Ke.isNegative=Ke.isneg=function(){return this.s<0};Ke.isPositive=Ke.ispos=function(){return this.s>0};Ke.isZero=function(){return this.s===0};Ke.lessThan=Ke.lt=function(t){return this.cmp(t)<0};Ke.lessThanOrEqualTo=Ke.lte=function(t){return this.cmp(t)<1};Ke.logarithm=Ke.log=function(t){var e,n=this,r=n.constructor,i=r.precision,o=i+5;if(t===void 0)t=new r(10);else if(t=new r(t),t.s<1||t.eq(Ci))throw Error(ao+"NaN");if(n.s<1)throw Error(ao+(n.s?"NaN":"-Infinity"));return n.eq(Ci)?new r(0):(An=!1,e=Ya(Vp(n,o),Vp(t,o),o),An=!0,un(e,i))};Ke.minus=Ke.sub=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?HH(e,t):$H(e,(t.s=-t.s,t))};Ke.modulo=Ke.mod=function(t){var e,n=this,r=n.constructor,i=r.precision;if(t=new r(t),!t.s)throw Error(ao+"NaN");return n.s?(An=!1,e=Ya(n,t,0,1).times(t),An=!0,n.minus(e)):un(new r(n),i)};Ke.naturalExponential=Ke.exp=function(){return zH(this)};Ke.naturalLogarithm=Ke.ln=function(){return Vp(this)};Ke.negated=Ke.neg=function(){var t=new this.constructor(this);return t.s=-t.s||0,t};Ke.plus=Ke.add=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?$H(e,t):HH(e,(t.s=-t.s,t))};Ke.precision=Ke.sd=function(t){var e,n,r,i=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(xc+t);if(e=Hn(i)+1,r=i.d.length-1,n=r*wn+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return t&&e>n?e:n};Ke.squareRoot=Ke.sqrt=function(){var t,e,n,r,i,o,a,s=this,l=s.constructor;if(s.s<1){if(!s.s)return new l(0);throw Error(ao+"NaN")}for(t=Hn(s),An=!1,i=Math.sqrt(+s),i==0||i==1/0?(e=ca(s.d),(e.length+t)%2==0&&(e+="0"),i=Math.sqrt(e),t=Bf((t+1)/2)-(t<0||t%2),i==1/0?e="5e"+t:(e=i.toExponential(),e=e.slice(0,e.indexOf("e")+1)+t),r=new l(e)):r=new l(i.toString()),n=l.precision,i=a=n+3;;)if(o=r,r=o.plus(Ya(s,o,a+2)).times(.5),ca(o.d).slice(0,a)===(e=ca(r.d)).slice(0,a)){if(e=e.slice(a-3,a+1),i==a&&e=="4999"){if(un(o,n+1,0),o.times(o).eq(s)){r=o;break}}else if(e!="9999")break;a+=4}return An=!0,un(r,n)};Ke.times=Ke.mul=function(t){var e,n,r,i,o,a,s,l,c,u=this,d=u.constructor,f=u.d,p=(t=new d(t)).d;if(!u.s||!t.s)return new d(0);for(t.s*=u.s,n=u.e+t.e,l=f.length,c=p.length,l=0;){for(e=0,i=l+r;i>r;)s=o[i]+p[r]*f[i-r-1]+e,o[i--]=s%ir|0,e=s/ir|0;o[i]=(o[i]+e)%ir|0}for(;!o[--a];)o.pop();return e?++n:o.shift(),t.d=o,t.e=n,An?un(t,d.precision):t};Ke.toDecimalPlaces=Ke.todp=function(t,e){var n=this,r=n.constructor;return n=new r(n),t===void 0?n:(xa(t,0,Ff),e===void 0?e=r.rounding:xa(e,0,8),un(n,t+Hn(n)+1,e))};Ke.toExponential=function(t,e){var n,r=this,i=r.constructor;return t===void 0?n=kc(r,!0):(xa(t,0,Ff),e===void 0?e=i.rounding:xa(e,0,8),r=un(new i(r),t+1,e),n=kc(r,!0,t+1)),n};Ke.toFixed=function(t,e){var n,r,i=this,o=i.constructor;return t===void 0?kc(i):(xa(t,0,Ff),e===void 0?e=o.rounding:xa(e,0,8),r=un(new o(i),t+Hn(i)+1,e),n=kc(r.abs(),!1,t+Hn(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};Ke.toInteger=Ke.toint=function(){var t=this,e=t.constructor;return un(new e(t),Hn(t)+1,e.rounding)};Ke.toNumber=function(){return+this};Ke.toPower=Ke.pow=function(t){var e,n,r,i,o,a,s=this,l=s.constructor,c=12,u=+(t=new l(t));if(!t.s)return new l(Ci);if(s=new l(s),!s.s){if(t.s<1)throw Error(ao+"Infinity");return s}if(s.eq(Ci))return s;if(r=l.precision,t.eq(Ci))return un(s,r);if(e=t.e,n=t.d.length-1,a=e>=n,o=s.s,a){if((n=u<0?-u:u)<=BH){for(i=new l(Ci),e=Math.ceil(r/wn+4),An=!1;n%2&&(i=i.times(s),ID(i.d,e)),n=Bf(n/2),n!==0;)s=s.times(s),ID(s.d,e);return An=!0,t.s<0?new l(Ci).div(i):un(i,r)}}else if(o<0)throw Error(ao+"NaN");return o=o<0&&t.d[Math.max(e,n)]&1?-1:1,s.s=1,An=!1,i=t.times(Vp(s,r+c)),An=!0,i=zH(i),i.s=o,i};Ke.toPrecision=function(t,e){var n,r,i=this,o=i.constructor;return t===void 0?(n=Hn(i),r=kc(i,n<=o.toExpNeg||n>=o.toExpPos)):(xa(t,1,Ff),e===void 0?e=o.rounding:xa(e,0,8),i=un(new o(i),t,e),n=Hn(i),r=kc(i,t<=n||n<=o.toExpNeg,t)),r};Ke.toSignificantDigits=Ke.tosd=function(t,e){var n=this,r=n.constructor;return t===void 0?(t=r.precision,e=r.rounding):(xa(t,1,Ff),e===void 0?e=r.rounding:xa(e,0,8)),un(new r(n),t,e)};Ke.toString=Ke.valueOf=Ke.val=Ke.toJSON=Ke[Symbol.for("nodejs.util.inspect.custom")]=function(){var t=this,e=Hn(t),n=t.constructor;return kc(t,e<=n.toExpNeg||e>=n.toExpPos)};function $H(t,e){var n,r,i,o,a,s,l,c,u=t.constructor,d=u.precision;if(!t.s||!e.s)return e.s||(e=new u(t)),An?un(e,d):e;if(l=t.d,c=e.d,a=t.e,i=e.e,l=l.slice(),o=a-i,o){for(o<0?(r=l,o=-o,s=c.length):(r=c,i=a,s=l.length),a=Math.ceil(d/wn),s=a>s?a+1:s+1,o>s&&(o=s,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(s=l.length,o=c.length,s-o<0&&(o=s,r=c,c=l,l=r),n=0;o;)n=(l[--o]=l[o]+c[o]+n)/ir|0,l[o]%=ir;for(n&&(l.unshift(n),++i),s=l.length;l[--s]==0;)l.pop();return e.d=l,e.e=i,An?un(e,d):e}function xa(t,e,n){if(t!==~~t||tn)throw Error(xc+t)}function ca(t){var e,n,r,i=t.length-1,o="",a=t[0];if(i>0){for(o+=a,e=1;ea?1:-1;else for(s=l=0;si[s]?1:-1;break}return l}function n(r,i,o){for(var a=0;o--;)r[o]-=a,a=r[o]1;)r.shift()}return function(r,i,o,a){var s,l,c,u,d,f,p,y,v,g,m,x,b,S,w,E,T,A,M=r.constructor,C=r.s==i.s?1:-1,P=r.d,R=i.d;if(!r.s)return new M(r);if(!i.s)throw Error(ao+"Division by zero");for(l=r.e-i.e,T=R.length,w=P.length,p=new M(C),y=p.d=[],c=0;R[c]==(P[c]||0);)++c;if(R[c]>(P[c]||0)&&--l,o==null?x=o=M.precision:a?x=o+(Hn(r)-Hn(i))+1:x=o,x<0)return new M(0);if(x=x/wn+2|0,c=0,T==1)for(u=0,R=R[0],x++;(c1&&(R=t(R,u),P=t(P,u),T=R.length,w=P.length),S=T,v=P.slice(0,T),g=v.length;g=ir/2&&++E;do u=0,s=e(R,v,T,g),s<0?(m=v[0],T!=g&&(m=m*ir+(v[1]||0)),u=m/E|0,u>1?(u>=ir&&(u=ir-1),d=t(R,u),f=d.length,g=v.length,s=e(d,v,f,g),s==1&&(u--,n(d,T16)throw Error(uP+Hn(t));if(!t.s)return new u(Ci);for(An=!1,s=d,a=new u(.03125);t.abs().gte(.1);)t=t.times(a),c+=5;for(r=Math.log(Wl(2,c))/Math.LN10*2+5|0,s+=r,n=i=o=new u(Ci),u.precision=s;;){if(i=un(i.times(t),s),n=n.times(++l),a=o.plus(Ya(i,n,s)),ca(a.d).slice(0,s)===ca(o.d).slice(0,s)){for(;c--;)o=un(o.times(o),s);return u.precision=d,e==null?(An=!0,un(o,d)):o}o=a}}function Hn(t){for(var e=t.e*wn,n=t.d[0];n>=10;n/=10)e++;return e}function eS(t,e,n){if(e>t.LN10.sd())throw An=!0,n&&(t.precision=n),Error(ao+"LN10 precision limit exceeded");return un(new t(t.LN10),e)}function Cs(t){for(var e="";t--;)e+="0";return e}function Vp(t,e){var n,r,i,o,a,s,l,c,u,d=1,f=10,p=t,y=p.d,v=p.constructor,g=v.precision;if(p.s<1)throw Error(ao+(p.s?"NaN":"-Infinity"));if(p.eq(Ci))return new v(0);if(e==null?(An=!1,c=g):c=e,p.eq(10))return e==null&&(An=!0),eS(v,c);if(c+=f,v.precision=c,n=ca(y),r=n.charAt(0),o=Hn(p),Math.abs(o)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)p=p.times(t),n=ca(p.d),r=n.charAt(0),d++;o=Hn(p),r>1?(p=new v("0."+n),o++):p=new v(r+"."+n.slice(1))}else return l=eS(v,c+2,g).times(o+""),p=Vp(new v(r+"."+n.slice(1)),c-f).plus(l),v.precision=g,e==null?(An=!0,un(p,g)):p;for(s=a=p=Ya(p.minus(Ci),p.plus(Ci),c),u=un(p.times(p),c),i=3;;){if(a=un(a.times(u),c),l=s.plus(Ya(a,new v(i),c)),ca(l.d).slice(0,c)===ca(s.d).slice(0,c))return s=s.times(2),o!==0&&(s=s.plus(eS(v,c+2,g).times(o+""))),s=Ya(s,new v(d),c),v.precision=g,e==null?(An=!0,un(s,g)):s;s=l,i+=2}}function OD(t,e){var n,r,i;for((n=e.indexOf("."))>-1&&(e=e.replace(".","")),(r=e.search(/e/i))>0?(n<0&&(n=r),n+=+e.slice(r+1),e=e.substring(0,r)):n<0&&(n=e.length),r=0;e.charCodeAt(r)===48;)++r;for(i=e.length;e.charCodeAt(i-1)===48;)--i;if(e=e.slice(r,i),e){if(i-=r,n=n-r-1,t.e=Bf(n/wn),t.d=[],r=(n+1)%wn,n<0&&(r+=wn),rl0||t.e<-l0))throw Error(uP+n)}else t.s=0,t.e=0,t.d=[0];return t}function un(t,e,n){var r,i,o,a,s,l,c,u,d=t.d;for(a=1,o=d[0];o>=10;o/=10)a++;if(r=e-a,r<0)r+=wn,i=e,c=d[u=0];else{if(u=Math.ceil((r+1)/wn),o=d.length,u>=o)return t;for(c=o=d[u],a=1;o>=10;o/=10)a++;r%=wn,i=r-wn+a}if(n!==void 0&&(o=Wl(10,a-i-1),s=c/o%10|0,l=e<0||d[u+1]!==void 0||c%o,l=n<4?(s||l)&&(n==0||n==(t.s<0?3:2)):s>5||s==5&&(n==4||l||n==6&&(r>0?i>0?c/Wl(10,a-i):0:d[u-1])%10&1||n==(t.s<0?8:7))),e<1||!d[0])return l?(o=Hn(t),d.length=1,e=e-o-1,d[0]=Wl(10,(wn-e%wn)%wn),t.e=Bf(-e/wn)||0):(d.length=1,d[0]=t.e=t.s=0),t;if(r==0?(d.length=u,o=1,u--):(d.length=u+1,o=Wl(10,wn-r),d[u]=i>0?(c/Wl(10,a-i)%Wl(10,i)|0)*o:0),l)for(;;)if(u==0){(d[0]+=o)==ir&&(d[0]=1,++t.e);break}else{if(d[u]+=o,d[u]!=ir)break;d[u--]=0,o=1}for(r=d.length;d[--r]===0;)d.pop();if(An&&(t.e>l0||t.e<-l0))throw Error(uP+Hn(t));return t}function HH(t,e){var n,r,i,o,a,s,l,c,u,d,f=t.constructor,p=f.precision;if(!t.s||!e.s)return e.s?e.s=-e.s:e=new f(t),An?un(e,p):e;if(l=t.d,d=e.d,r=e.e,c=t.e,l=l.slice(),a=c-r,a){for(u=a<0,u?(n=l,a=-a,s=d.length):(n=d,r=c,s=l.length),i=Math.max(Math.ceil(p/wn),s)+2,a>i&&(a=i,n.length=1),n.reverse(),i=a;i--;)n.push(0);n.reverse()}else{for(i=l.length,s=d.length,u=i0;--i)l[s++]=0;for(i=d.length;i>a;){if(l[--i]0?o=o.charAt(0)+"."+o.slice(1)+Cs(r):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+Cs(-i-1)+o,n&&(r=n-a)>0&&(o+=Cs(r))):i>=a?(o+=Cs(i+1-a),n&&(r=n-i-1)>0&&(o=o+"."+Cs(r))):((r=i+1)0&&(i+1===a&&(o+="."),o+=Cs(r))),t.s<0?"-"+o:o}function ID(t,e){if(t.length>e)return t.length=e,!0}function VH(t){var e,n,r;function i(o){var a=this;if(!(a instanceof i))return new i(o);if(a.constructor=i,o instanceof i){a.s=o.s,a.e=o.e,a.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(xc+o);if(o>0)a.s=1;else if(o<0)o=-o,a.s=-1;else{a.s=0,a.e=0,a.d=[0];return}if(o===~~o&&o<1e7){a.e=0,a.d=[o];return}return OD(a,o.toString())}else if(typeof o!="string")throw Error(xc+o);if(o.charCodeAt(0)===45?(o=o.slice(1),a.s=-1):a.s=1,PTe.test(o))OD(a,o);else throw Error(xc+o)}if(i.prototype=Ke,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=VH,i.config=i.set=RTe,t===void 0&&(t={}),t)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],e=0;e=i[e+1]&&r<=i[e+2])this[n]=r;else throw Error(xc+n+": "+r);if((r=t[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(xc+n+": "+r);return this}var dP=VH(CTe);Ci=new dP(1);const sn=dP;function NTe(t){return LTe(t)||DTe(t)||ITe(t)||OTe()}function OTe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ITe(t,e){if(t){if(typeof t=="string")return iT(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return iT(t,e)}}function DTe(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function LTe(t){if(Array.isArray(t))return iT(t)}function iT(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=e?n.apply(void 0,i):t(e-a,DD(function(){for(var s=arguments.length,l=new Array(s),c=0;ct.length)&&(e=t.length);for(var n=0,r=new Array(e);n"u"||!(Symbol.iterator in Object(t)))){var n=[],r=!0,i=!1,o=void 0;try{for(var a=t[Symbol.iterator](),s;!(r=(s=a.next()).done)&&(n.push(s.value),!(e&&n.length===e));r=!0);}catch(l){i=!0,o=l}finally{try{!r&&a.return!=null&&a.return()}finally{if(i)throw o}}return n}}function YTe(t){if(Array.isArray(t))return t}function KH(t){var e=Gp(t,2),n=e[0],r=e[1],i=n,o=r;return n>r&&(i=r,o=n),[i,o]}function YH(t,e,n){if(t.lte(0))return new sn(0);var r=Ib.getDigitCount(t.toNumber()),i=new sn(10).pow(r),o=t.div(i),a=r!==1?.05:.1,s=new sn(Math.ceil(o.div(a).toNumber())).add(n).mul(a),l=s.mul(i);return e?l:new sn(Math.ceil(l))}function JTe(t,e,n){var r=1,i=new sn(t);if(!i.isint()&&n){var o=Math.abs(t);o<1?(r=new sn(10).pow(Ib.getDigitCount(t)-1),i=new sn(Math.floor(i.div(r).toNumber())).mul(r)):o>1&&(i=new sn(Math.floor(t)))}else t===0?i=new sn(Math.floor((e-1)/2)):n||(i=new sn(Math.floor(t)));var a=Math.floor((e-1)/2),s=FTe(UTe(function(l){return i.add(new sn(l-a).mul(r)).toNumber()}),oT);return s(0,e)}function JH(t,e,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((e-t)/(n-1)))return{step:new sn(0),tickMin:new sn(0),tickMax:new sn(0)};var o=YH(new sn(e).sub(t).div(n-1),r,i),a;t<=0&&e>=0?a=new sn(0):(a=new sn(t).add(e).div(2),a=a.sub(new sn(a).mod(o)));var s=Math.ceil(a.sub(t).div(o).toNumber()),l=Math.ceil(new sn(e).sub(a).div(o).toNumber()),c=s+l+1;return c>n?JH(t,e,n,r,i+1):(c0?l+(n-c):l,s=e>0?s:s+(n-c)),{step:o,tickMin:a.sub(new sn(s).mul(o)),tickMax:a.add(new sn(l).mul(o))})}function ZTe(t){var e=Gp(t,2),n=e[0],r=e[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=Math.max(i,2),s=KH([n,r]),l=Gp(s,2),c=l[0],u=l[1];if(c===-1/0||u===1/0){var d=u===1/0?[c].concat(sT(oT(0,i-1).map(function(){return 1/0}))):[].concat(sT(oT(0,i-1).map(function(){return-1/0})),[u]);return n>r?aT(d):d}if(c===u)return JTe(c,i,o);var f=JH(c,u,a,o),p=f.step,y=f.tickMin,v=f.tickMax,g=Ib.rangeStep(y,v.add(new sn(.1).mul(p)),p);return n>r?aT(g):g}function QTe(t,e){var n=Gp(t,2),r=n[0],i=n[1],o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=KH([r,i]),s=Gp(a,2),l=s[0],c=s[1];if(l===-1/0||c===1/0)return[r,i];if(l===c)return[l];var u=Math.max(e,2),d=YH(new sn(c).sub(l).div(u-1),o,0),f=[].concat(sT(Ib.rangeStep(new sn(l),new sn(c).sub(new sn(.99).mul(d)),d)),[c]);return r>i?aT(f):f}var eMe=XH(ZTe),tMe=XH(QTe),nMe="Invariant failed";function jc(t,e){throw new Error(nMe)}var rMe=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Jd(t){"@babel/helpers - typeof";return Jd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jd(t)}function c0(){return c0=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function uMe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function dMe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function fMe(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,a=-1,s=(n=r==null?void 0:r.length)!==null&&n!==void 0?n:0;if(s<=1)return 0;if(o&&o.axisType==="angleAxis"&&Math.abs(Math.abs(o.range[1]-o.range[0])-360)<=1e-6)for(var l=o.range,c=0;c0?i[c-1].coordinate:i[s-1].coordinate,d=i[c].coordinate,f=c>=s-1?i[0].coordinate:i[c+1].coordinate,p=void 0;if(Do(d-u)!==Do(f-d)){var y=[];if(Do(f-d)===Do(l[1]-l[0])){p=f;var v=d+l[1]-l[0];y[0]=Math.min(v,(v+u)/2),y[1]=Math.max(v,(v+u)/2)}else{p=u;var g=f+l[1]-l[0];y[0]=Math.min(d,(g+d)/2),y[1]=Math.max(d,(g+d)/2)}var m=[Math.min(d,(p+d)/2),Math.max(d,(p+d)/2)];if(e>m[0]&&e<=m[1]||e>=y[0]&&e<=y[1]){a=i[c].index;break}}else{var x=Math.min(u,f),b=Math.max(u,f);if(e>(x+d)/2&&e<=(b+d)/2){a=i[c].index;break}}}else for(var S=0;S0&&S(r[S].coordinate+r[S-1].coordinate)/2&&e<=(r[S].coordinate+r[S+1].coordinate)/2||S===s-1&&e>(r[S].coordinate+r[S-1].coordinate)/2){a=r[S].index;break}return a},fP=function(e){var n,r=e,i=r.type.displayName,o=(n=e.type)!==null&&n!==void 0&&n.defaultProps?Dn(Dn({},e.type.defaultProps),e.props):e.props,a=o.stroke,s=o.fill,l;switch(i){case"Line":l=a;break;case"Area":case"Radar":l=a&&a!=="none"?a:s;break;default:l=s;break}return l},PMe=function(e){var n=e.barSize,r=e.totalSize,i=e.stackGroups,o=i===void 0?{}:i;if(!o)return{};for(var a={},s=Object.keys(o),l=0,c=s.length;l=0});if(m&&m.length){var x=m[0].type.defaultProps,b=x!==void 0?Dn(Dn({},x),m[0].props):m[0].props,S=b.barSize,w=b[g];a[w]||(a[w]=[]);var E=Ut(S)?n:S;a[w].push({item:m[0],stackList:m.slice(1),barSize:Ut(E)?void 0:Lc(E,r,0)})}}return a},RMe=function(e){var n=e.barGap,r=e.barCategoryGap,i=e.bandSize,o=e.sizeList,a=o===void 0?[]:o,s=e.maxBarSize,l=a.length;if(l<1)return null;var c=Lc(n,i,0,!0),u,d=[];if(a[0].barSize===+a[0].barSize){var f=!1,p=i/l,y=a.reduce(function(S,w){return S+w.barSize||0},0);y+=(l-1)*c,y>=i&&(y-=(l-1)*c,c=0),y>=i&&p>0&&(f=!0,p*=.9,y=l*p);var v=(i-y)/2>>0,g={offset:v-c,size:0};u=a.reduce(function(S,w){var E={item:w.item,position:{offset:g.offset+g.size+c,size:f?p:w.barSize}},T=[].concat(jD(S),[E]);return g=T[T.length-1].position,w.stackList&&w.stackList.length&&w.stackList.forEach(function(A){T.push({item:A,position:g})}),T},d)}else{var m=Lc(r,i,0,!0);i-2*m-(l-1)*c<=0&&(c=0);var x=(i-2*m-(l-1)*c)/l;x>1&&(x>>=0);var b=s===+s?Math.min(x,s):x;u=a.reduce(function(S,w,E){var T=[].concat(jD(S),[{item:w.item,position:{offset:m+(x+c)*E+(x-b)/2,size:b}}]);return w.stackList&&w.stackList.length&&w.stackList.forEach(function(A){T.push({item:A,position:T[T.length-1].position})}),T},d)}return u},NMe=function(e,n,r,i){var o=r.children,a=r.width,s=r.margin,l=a-(s.left||0)-(s.right||0),c=tV({children:o,legendWidth:l});if(c){var u=i||{},d=u.width,f=u.height,p=c.align,y=c.verticalAlign,v=c.layout;if((v==="vertical"||v==="horizontal"&&y==="middle")&&p!=="center"&&ze(e[p]))return Dn(Dn({},e),{},md({},p,e[p]+(d||0)));if((v==="horizontal"||v==="vertical"&&p==="center")&&y!=="middle"&&ze(e[y]))return Dn(Dn({},e),{},md({},y,e[y]+(f||0)))}return e},OMe=function(e,n,r){return Ut(n)?!0:e==="horizontal"?n==="yAxis":e==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},nV=function(e,n,r,i,o){var a=n.props.children,s=ro(a,Gm).filter(function(c){return OMe(i,o,c.props.direction)});if(s&&s.length){var l=s.map(function(c){return c.props.dataKey});return e.reduce(function(c,u){var d=Di(u,r);if(Ut(d))return c;var f=Array.isArray(d)?[Rb(d),Pb(d)]:[d,d],p=l.reduce(function(y,v){var g=Di(u,v,0),m=f[0]-Math.abs(Array.isArray(g)?g[0]:g),x=f[1]+Math.abs(Array.isArray(g)?g[1]:g);return[Math.min(m,y[0]),Math.max(x,y[1])]},[1/0,-1/0]);return[Math.min(p[0],c[0]),Math.max(p[1],c[1])]},[1/0,-1/0])}return null},IMe=function(e,n,r,i,o){var a=n.map(function(s){return nV(e,s,r,o,i)}).filter(function(s){return!Ut(s)});return a&&a.length?a.reduce(function(s,l){return[Math.min(s[0],l[0]),Math.max(s[1],l[1])]},[1/0,-1/0]):null},rV=function(e,n,r,i,o){var a=n.map(function(l){var c=l.props.dataKey;return r==="number"&&c&&nV(e,l,c,i)||Kh(e,c,r,o)});if(r==="number")return a.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]);var s={};return a.reduce(function(l,c){for(var u=0,d=c.length;u=2?Do(s[0]-s[1])*2*c:c,n&&(e.ticks||e.niceTicks)){var u=(e.ticks||e.niceTicks).map(function(d){var f=o?o.indexOf(d):d;return{coordinate:i(f)+c,value:d,offset:c}});return u.filter(function(d){return!Fm(d.coordinate)})}return e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map(function(d,f){return{coordinate:i(d)+c,value:d,index:f,offset:c}}):i.ticks&&!r?i.ticks(e.tickCount).map(function(d){return{coordinate:i(d)+c,value:d,offset:c}}):i.domain().map(function(d,f){return{coordinate:i(d)+c,value:o?o[d]:d,index:f,offset:c}})},tS=new WeakMap,pv=function(e,n){if(typeof n!="function")return e;tS.has(e)||tS.set(e,new WeakMap);var r=tS.get(e);if(r.has(n))return r.get(n);var i=function(){e.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,i),i},DMe=function(e,n,r){var i=e.scale,o=e.type,a=e.layout,s=e.axisType;if(i==="auto")return a==="radial"&&s==="radiusAxis"?{scale:Fp(),realScaleType:"band"}:a==="radial"&&s==="angleAxis"?{scale:i0(),realScaleType:"linear"}:o==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:qh(),realScaleType:"point"}:o==="category"?{scale:Fp(),realScaleType:"band"}:{scale:i0(),realScaleType:"linear"};if(Dc(i)){var l="scale".concat(gb(i));return{scale:(ND[l]||qh)(),realScaleType:ND[l]?l:"point"}}return jt(i)?{scale:i}:{scale:qh(),realScaleType:"point"}},FD=1e-4,LMe=function(e){var n=e.domain();if(!(!n||n.length<=2)){var r=n.length,i=e.range(),o=Math.min(i[0],i[1])-FD,a=Math.max(i[0],i[1])+FD,s=e(n[0]),l=e(n[r-1]);(sa||la)&&e.domain([n[0],n[r-1]])}},kMe=function(e,n){if(!e)return null;for(var r=0,i=e.length;ri)&&(o[1]=i),o[0]>i&&(o[0]=i),o[1]=0?(e[s][r][0]=o,e[s][r][1]=o+l,o=e[s][r][1]):(e[s][r][0]=a,e[s][r][1]=a+l,a=e[s][r][1])}},FMe=function(e){var n=e.length;if(!(n<=0))for(var r=0,i=e[0].length;r=0?(e[a][r][0]=o,e[a][r][1]=o+s,o=e[a][r][1]):(e[a][r][0]=0,e[a][r][1]=0)}},BMe={sign:UMe,expand:eme,none:Hd,silhouette:tme,wiggle:nme,positive:FMe},$Me=function(e,n,r){var i=n.map(function(s){return s.props.dataKey}),o=BMe[r],a=Qpe().keys(i).value(function(s,l){return+Di(s,l,0)}).order(L1).offset(o);return a(e)},zMe=function(e,n,r,i,o,a){if(!e)return null;var s=a?n.reverse():n,l={},c=s.reduce(function(d,f){var p,y=(p=f.type)!==null&&p!==void 0&&p.defaultProps?Dn(Dn({},f.type.defaultProps),f.props):f.props,v=y.stackId,g=y.hide;if(g)return d;var m=y[r],x=d[m]||{hasStack:!1,stackGroups:{}};if(Yn(v)){var b=x.stackGroups[v]||{numericAxisId:r,cateAxisId:i,items:[]};b.items.push(f),x.hasStack=!0,x.stackGroups[v]=b}else x.stackGroups[Bm("_stackId_")]={numericAxisId:r,cateAxisId:i,items:[f]};return Dn(Dn({},d),{},md({},m,x))},l),u={};return Object.keys(c).reduce(function(d,f){var p=c[f];if(p.hasStack){var y={};p.stackGroups=Object.keys(p.stackGroups).reduce(function(v,g){var m=p.stackGroups[g];return Dn(Dn({},v),{},md({},g,{numericAxisId:r,cateAxisId:i,items:m.items,stackedData:$Me(e,m.items,o)}))},y)}return Dn(Dn({},d),{},md({},f,p))},u)},HMe=function(e,n){var r=n.realScaleType,i=n.type,o=n.tickCount,a=n.originalDomain,s=n.allowDecimals,l=r||n.scale;if(l!=="auto"&&l!=="linear")return null;if(o&&i==="number"&&a&&(a[0]==="auto"||a[1]==="auto")){var c=e.domain();if(!c.length)return null;var u=eMe(c,o,s);return e.domain([Rb(u),Pb(u)]),{niceTicks:u}}if(o&&i==="number"){var d=e.domain(),f=tMe(d,o,s);return{niceTicks:f}}return null};function BD(t){var e=t.axis,n=t.ticks,r=t.bandSize,i=t.entry,o=t.index,a=t.dataKey;if(e.type==="category"){if(!e.allowDuplicatedCategory&&e.dataKey&&!Ut(i[e.dataKey])){var s=Ly(n,"value",i[e.dataKey]);if(s)return s.coordinate+r/2}return n[o]?n[o].coordinate+r/2:null}var l=Di(i,Ut(a)?e.dataKey:a);return Ut(l)?null:e.scale(l)}var $D=function(e){var n=e.axis,r=e.ticks,i=e.offset,o=e.bandSize,a=e.entry,s=e.index;if(n.type==="category")return r[s]?r[s].coordinate+i:null;var l=Di(a,n.dataKey,n.domain[s]);return Ut(l)?null:n.scale(l)-o/2+i},VMe=function(e){var n=e.numericAxis,r=n.scale.domain();if(n.type==="number"){var i=Math.min(r[0],r[1]),o=Math.max(r[0],r[1]);return i<=0&&o>=0?0:o<0?o:i}return r[0]},GMe=function(e,n){var r,i=(r=e.type)!==null&&r!==void 0&&r.defaultProps?Dn(Dn({},e.type.defaultProps),e.props):e.props,o=i.stackId;if(Yn(o)){var a=n[o];if(a){var s=a.items.indexOf(e);return s>=0?a.stackedData[s]:null}}return null},WMe=function(e){return e.reduce(function(n,r){return[Rb(r.concat([n[0]]).filter(ze)),Pb(r.concat([n[1]]).filter(ze))]},[1/0,-1/0])},oV=function(e,n,r){return Object.keys(e).reduce(function(i,o){var a=e[o],s=a.stackedData,l=s.reduce(function(c,u){var d=WMe(u.slice(n,r+1));return[Math.min(c[0],d[0]),Math.max(c[1],d[1])]},[1/0,-1/0]);return[Math.min(l[0],i[0]),Math.max(l[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},zD=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,HD=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,dT=function(e,n,r){if(jt(e))return e(n,r);if(!Array.isArray(e))return n;var i=[];if(ze(e[0]))i[0]=r?e[0]:Math.min(e[0],n[0]);else if(zD.test(e[0])){var o=+zD.exec(e[0])[1];i[0]=n[0]-o}else jt(e[0])?i[0]=e[0](n[0]):i[0]=n[0];if(ze(e[1]))i[1]=r?e[1]:Math.max(e[1],n[1]);else if(HD.test(e[1])){var a=+HD.exec(e[1])[1];i[1]=n[1]+a}else jt(e[1])?i[1]=e[1](n[1]):i[1]=n[1];return i},d0=function(e,n,r){if(e&&e.scale&&e.scale.bandwidth){var i=e.scale.bandwidth();if(!r||i>0)return i}if(e&&n&&n.length>=2){for(var o=BC(n,function(d){return d.coordinate}),a=1/0,s=1,l=o.length;sa&&(c=2*Math.PI-c),{radius:s,angle:YMe(c),angleInRadian:c}},QMe=function(e){var n=e.startAngle,r=e.endAngle,i=Math.floor(n/360),o=Math.floor(r/360),a=Math.min(i,o);return{startAngle:n-a*360,endAngle:r-a*360}},eAe=function(e,n){var r=n.startAngle,i=n.endAngle,o=Math.floor(r/360),a=Math.floor(i/360),s=Math.min(o,a);return e+s*360},XD=function(e,n){var r=e.x,i=e.y,o=ZMe({x:r,y:i},n),a=o.radius,s=o.angle,l=n.innerRadius,c=n.outerRadius;if(ac)return!1;if(a===0)return!0;var u=QMe(n),d=u.startAngle,f=u.endAngle,p=s,y;if(d<=f){for(;p>f;)p-=360;for(;p=d&&p<=f}else{for(;p>d;)p-=360;for(;p=f&&p<=d}return y?WD(WD({},n),{},{radius:a,angle:eAe(p,n)}):null};function Kp(t){"@babel/helpers - typeof";return Kp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Kp(t)}var tAe=["offset"];function nAe(t){return aAe(t)||oAe(t)||iAe(t)||rAe()}function rAe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function iAe(t,e){if(t){if(typeof t=="string")return fT(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fT(t,e)}}function oAe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function aAe(t){if(Array.isArray(t))return fT(t)}function fT(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function lAe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function qD(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 Xn(t){for(var e=1;e=0?1:-1,b,S;i==="insideStart"?(b=p+x*a,S=v):i==="insideEnd"?(b=y-x*a,S=!v):i==="end"&&(b=y+x*a,S=v),S=m<=0?S:!S;var w=vr(c,u,g,b),E=vr(c,u,g,b+(S?1:-1)*359),T="M".concat(w.x,",").concat(w.y,` - A`).concat(g,",").concat(g,",0,1,").concat(S?0:1,`, - `).concat(E.x,",").concat(E.y),A=Ut(e.id)?Bm("recharts-radial-line-"):e.id;return Z.createElement("text",Yp({},r,{dominantBaseline:"central",className:zt("recharts-radial-bar-label",s)}),Z.createElement("defs",null,Z.createElement("path",{id:A,d:T})),Z.createElement("textPath",{xlinkHref:"#".concat(A)},n))},mAe=function(e){var n=e.viewBox,r=e.offset,i=e.position,o=n,a=o.cx,s=o.cy,l=o.innerRadius,c=o.outerRadius,u=o.startAngle,d=o.endAngle,f=(u+d)/2;if(i==="outside"){var p=vr(a,s,c+r,f),y=p.x,v=p.y;return{x:y,y:v,textAnchor:y>=a?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"end"};var g=(l+c)/2,m=vr(a,s,g,f),x=m.x,b=m.y;return{x,y:b,textAnchor:"middle",verticalAnchor:"middle"}},gAe=function(e){var n=e.viewBox,r=e.parentViewBox,i=e.offset,o=e.position,a=n,s=a.x,l=a.y,c=a.width,u=a.height,d=u>=0?1:-1,f=d*i,p=d>0?"end":"start",y=d>0?"start":"end",v=c>=0?1:-1,g=v*i,m=v>0?"end":"start",x=v>0?"start":"end";if(o==="top"){var b={x:s+c/2,y:l-d*i,textAnchor:"middle",verticalAnchor:p};return Xn(Xn({},b),r?{height:Math.max(l-r.y,0),width:c}:{})}if(o==="bottom"){var S={x:s+c/2,y:l+u+f,textAnchor:"middle",verticalAnchor:y};return Xn(Xn({},S),r?{height:Math.max(r.y+r.height-(l+u),0),width:c}:{})}if(o==="left"){var w={x:s-g,y:l+u/2,textAnchor:m,verticalAnchor:"middle"};return Xn(Xn({},w),r?{width:Math.max(w.x-r.x,0),height:u}:{})}if(o==="right"){var E={x:s+c+g,y:l+u/2,textAnchor:x,verticalAnchor:"middle"};return Xn(Xn({},E),r?{width:Math.max(r.x+r.width-E.x,0),height:u}:{})}var T=r?{width:c,height:u}:{};return o==="insideLeft"?Xn({x:s+g,y:l+u/2,textAnchor:x,verticalAnchor:"middle"},T):o==="insideRight"?Xn({x:s+c-g,y:l+u/2,textAnchor:m,verticalAnchor:"middle"},T):o==="insideTop"?Xn({x:s+c/2,y:l+f,textAnchor:"middle",verticalAnchor:y},T):o==="insideBottom"?Xn({x:s+c/2,y:l+u-f,textAnchor:"middle",verticalAnchor:p},T):o==="insideTopLeft"?Xn({x:s+g,y:l+f,textAnchor:x,verticalAnchor:y},T):o==="insideTopRight"?Xn({x:s+c-g,y:l+f,textAnchor:m,verticalAnchor:y},T):o==="insideBottomLeft"?Xn({x:s+g,y:l+u-f,textAnchor:x,verticalAnchor:p},T):o==="insideBottomRight"?Xn({x:s+c-g,y:l+u-f,textAnchor:m,verticalAnchor:p},T):Pf(o)&&(ze(o.x)||tc(o.x))&&(ze(o.y)||tc(o.y))?Xn({x:s+Lc(o.x,c),y:l+Lc(o.y,u),textAnchor:"end",verticalAnchor:"end"},T):Xn({x:s+c/2,y:l+u/2,textAnchor:"middle",verticalAnchor:"middle"},T)},vAe=function(e){return"cx"in e&&ze(e.cx)};function Nr(t){var e=t.offset,n=e===void 0?5:e,r=sAe(t,tAe),i=Xn({offset:n},r),o=i.viewBox,a=i.position,s=i.value,l=i.children,c=i.content,u=i.className,d=u===void 0?"":u,f=i.textBreakAll;if(!o||Ut(s)&&Ut(l)&&!_.isValidElement(c)&&!jt(c))return null;if(_.isValidElement(c))return _.cloneElement(c,i);var p;if(jt(c)){if(p=_.createElement(c,i),_.isValidElement(p))return p}else p=fAe(i);var y=vAe(o),v=$t(i,!0);if(y&&(a==="insideStart"||a==="insideEnd"||a==="end"))return pAe(i,p,v);var g=y?mAe(i):gAe(i);return Z.createElement(Jy,Yp({className:zt("recharts-label",d)},v,g,{breakAll:f}),p)}Nr.displayName="Label";var sV=function(e){var n=e.cx,r=e.cy,i=e.angle,o=e.startAngle,a=e.endAngle,s=e.r,l=e.radius,c=e.innerRadius,u=e.outerRadius,d=e.x,f=e.y,p=e.top,y=e.left,v=e.width,g=e.height,m=e.clockWise,x=e.labelViewBox;if(x)return x;if(ze(v)&&ze(g)){if(ze(d)&&ze(f))return{x:d,y:f,width:v,height:g};if(ze(p)&&ze(y))return{x:p,y,width:v,height:g}}return ze(d)&&ze(f)?{x:d,y:f,width:0,height:0}:ze(n)&&ze(r)?{cx:n,cy:r,startAngle:o||i||0,endAngle:a||i||0,innerRadius:c||0,outerRadius:u||l||s||0,clockWise:m}:e.viewBox?e.viewBox:{}},yAe=function(e,n){return e?e===!0?Z.createElement(Nr,{key:"label-implicit",viewBox:n}):Yn(e)?Z.createElement(Nr,{key:"label-implicit",viewBox:n,value:e}):_.isValidElement(e)?e.type===Nr?_.cloneElement(e,{key:"label-implicit",viewBox:n}):Z.createElement(Nr,{key:"label-implicit",content:e,viewBox:n}):jt(e)?Z.createElement(Nr,{key:"label-implicit",content:e,viewBox:n}):Pf(e)?Z.createElement(Nr,Yp({viewBox:n},e,{key:"label-implicit"})):null:null},xAe=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var i=e.children,o=sV(e),a=ro(i,Nr).map(function(l,c){return _.cloneElement(l,{viewBox:n||o,key:"label-".concat(c)})});if(!r)return a;var s=yAe(e.label,n||o);return[s].concat(nAe(a))};Nr.parseViewBox=sV;Nr.renderCallByParent=xAe;function bAe(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var _Ae=bAe;const wAe=dn(_Ae);function Jp(t){"@babel/helpers - typeof";return Jp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jp(t)}var SAe=["valueAccessor"],EAe=["data","dataKey","clockWise","id","textBreakAll"];function TAe(t){return PAe(t)||CAe(t)||AAe(t)||MAe()}function MAe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function AAe(t,e){if(t){if(typeof t=="string")return hT(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return hT(t,e)}}function CAe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function PAe(t){if(Array.isArray(t))return hT(t)}function hT(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function IAe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}var DAe=function(e){return Array.isArray(e.value)?wAe(e.value):e.value};function rl(t){var e=t.valueAccessor,n=e===void 0?DAe:e,r=JD(t,SAe),i=r.data,o=r.dataKey,a=r.clockWise,s=r.id,l=r.textBreakAll,c=JD(r,EAe);return!i||!i.length?null:Z.createElement(jn,{className:"recharts-label-list"},i.map(function(u,d){var f=Ut(o)?n(u,d):Di(u&&u.payload,o),p=Ut(s)?{}:{id:"".concat(s,"-").concat(d)};return Z.createElement(Nr,h0({},$t(u,!0),c,p,{parentViewBox:u.parentViewBox,value:f,textBreakAll:l,viewBox:Nr.parseViewBox(Ut(a)?u:YD(YD({},u),{},{clockWise:a})),key:"label-".concat(d),index:d}))}))}rl.displayName="LabelList";function LAe(t,e){return t?t===!0?Z.createElement(rl,{key:"labelList-implicit",data:e}):Z.isValidElement(t)||jt(t)?Z.createElement(rl,{key:"labelList-implicit",data:e,content:t}):Pf(t)?Z.createElement(rl,h0({data:e},t,{key:"labelList-implicit"})):null:null}function kAe(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var r=t.children,i=ro(r,rl).map(function(a,s){return _.cloneElement(a,{data:e,key:"labelList-".concat(s)})});if(!n)return i;var o=LAe(t.label,e);return[o].concat(TAe(i))}rl.renderCallByParent=kAe;function Zp(t){"@babel/helpers - typeof";return Zp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zp(t)}function pT(){return pT=Object.assign?Object.assign.bind():function(t){for(var e=1;e180),",").concat(+(a>c),`, - `).concat(d.x,",").concat(d.y,` - `);if(i>0){var p=vr(n,r,i,a),y=vr(n,r,i,c);f+="L ".concat(y.x,",").concat(y.y,` - A `).concat(i,",").concat(i,`,0, - `).concat(+(Math.abs(l)>180),",").concat(+(a<=c),`, - `).concat(p.x,",").concat(p.y," Z")}else f+="L ".concat(n,",").concat(r," Z");return f},$Ae=function(e){var n=e.cx,r=e.cy,i=e.innerRadius,o=e.outerRadius,a=e.cornerRadius,s=e.forceCornerRadius,l=e.cornerIsExternal,c=e.startAngle,u=e.endAngle,d=Do(u-c),f=mv({cx:n,cy:r,radius:o,angle:c,sign:d,cornerRadius:a,cornerIsExternal:l}),p=f.circleTangency,y=f.lineTangency,v=f.theta,g=mv({cx:n,cy:r,radius:o,angle:u,sign:-d,cornerRadius:a,cornerIsExternal:l}),m=g.circleTangency,x=g.lineTangency,b=g.theta,S=l?Math.abs(c-u):Math.abs(c-u)-v-b;if(S<0)return s?"M ".concat(y.x,",").concat(y.y,` - a`).concat(a,",").concat(a,",0,0,1,").concat(a*2,`,0 - a`).concat(a,",").concat(a,",0,0,1,").concat(-a*2,`,0 - `):lV({cx:n,cy:r,innerRadius:i,outerRadius:o,startAngle:c,endAngle:u});var w="M ".concat(y.x,",").concat(y.y,` - A`).concat(a,",").concat(a,",0,0,").concat(+(d<0),",").concat(p.x,",").concat(p.y,` - A`).concat(o,",").concat(o,",0,").concat(+(S>180),",").concat(+(d<0),",").concat(m.x,",").concat(m.y,` - A`).concat(a,",").concat(a,",0,0,").concat(+(d<0),",").concat(x.x,",").concat(x.y,` - `);if(i>0){var E=mv({cx:n,cy:r,radius:i,angle:c,sign:d,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),T=E.circleTangency,A=E.lineTangency,M=E.theta,C=mv({cx:n,cy:r,radius:i,angle:u,sign:-d,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),P=C.circleTangency,R=C.lineTangency,D=C.theta,k=l?Math.abs(c-u):Math.abs(c-u)-M-D;if(k<0&&a===0)return"".concat(w,"L").concat(n,",").concat(r,"Z");w+="L".concat(R.x,",").concat(R.y,` - A`).concat(a,",").concat(a,",0,0,").concat(+(d<0),",").concat(P.x,",").concat(P.y,` - A`).concat(i,",").concat(i,",0,").concat(+(k>180),",").concat(+(d>0),",").concat(T.x,",").concat(T.y,` - A`).concat(a,",").concat(a,",0,0,").concat(+(d<0),",").concat(A.x,",").concat(A.y,"Z")}else w+="L".concat(n,",").concat(r,"Z");return w},zAe={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},cV=function(e){var n=QD(QD({},zAe),e),r=n.cx,i=n.cy,o=n.innerRadius,a=n.outerRadius,s=n.cornerRadius,l=n.forceCornerRadius,c=n.cornerIsExternal,u=n.startAngle,d=n.endAngle,f=n.className;if(a0&&Math.abs(u-d)<360?g=$Ae({cx:r,cy:i,innerRadius:o,outerRadius:a,cornerRadius:Math.min(v,y/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:d}):g=lV({cx:r,cy:i,innerRadius:o,outerRadius:a,startAngle:u,endAngle:d}),Z.createElement("path",pT({},$t(n,!0),{className:p,d:g,role:"img"}))};function Qp(t){"@babel/helpers - typeof";return Qp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qp(t)}function mT(){return mT=Object.assign?Object.assign.bind():function(t){for(var e=1;e0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function sCe(t,e){return Jc(t.getTime(),e.getTime())}function lCe(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function cCe(t,e){return t===e}function sL(t,e,n){var r=t.size;if(r!==e.size)return!1;if(!r)return!0;for(var i=new Array(r),o=t.entries(),a,s,l=0;(a=o.next())&&!a.done;){for(var c=e.entries(),u=!1,d=0;(s=c.next())&&!s.done;){if(i[d]){d++;continue}var f=a.value,p=s.value;if(n.equals(f[0],p[0],l,d,t,e,n)&&n.equals(f[1],p[1],f[0],p[0],t,e,n)){u=i[d]=!0;break}d++}if(!u)return!1;l++}return!0}var uCe=Jc;function dCe(t,e,n){var r=aL(t),i=r.length;if(aL(e).length!==i)return!1;for(;i-- >0;)if(!hV(t,e,n,r[i]))return!1;return!0}function bh(t,e,n){var r=iL(t),i=r.length;if(iL(e).length!==i)return!1;for(var o,a,s;i-- >0;)if(o=r[i],!hV(t,e,n,o)||(a=oL(t,o),s=oL(e,o),(a||s)&&(!a||!s||a.configurable!==s.configurable||a.enumerable!==s.enumerable||a.writable!==s.writable)))return!1;return!0}function fCe(t,e){return Jc(t.valueOf(),e.valueOf())}function hCe(t,e){return t.source===e.source&&t.flags===e.flags}function lL(t,e,n){var r=t.size;if(r!==e.size)return!1;if(!r)return!0;for(var i=new Array(r),o=t.values(),a,s;(a=o.next())&&!a.done;){for(var l=e.values(),c=!1,u=0;(s=l.next())&&!s.done;){if(!i[u]&&n.equals(a.value,s.value,a.value,s.value,t,e,n)){c=i[u]=!0;break}u++}if(!c)return!1}return!0}function pCe(t,e){var n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}function mCe(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function hV(t,e,n,r){return(r===oCe||r===iCe||r===rCe)&&(t.$$typeof||e.$$typeof)?!0:nCe(e,r)&&n.equals(t[r],e[r],r,r,t,e,n)}var gCe="[object Arguments]",vCe="[object Boolean]",yCe="[object Date]",xCe="[object Error]",bCe="[object Map]",_Ce="[object Number]",wCe="[object Object]",SCe="[object RegExp]",ECe="[object Set]",TCe="[object String]",MCe="[object URL]",ACe=Array.isArray,cL=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,uL=Object.assign,CCe=Object.prototype.toString.call.bind(Object.prototype.toString);function PCe(t){var e=t.areArraysEqual,n=t.areDatesEqual,r=t.areErrorsEqual,i=t.areFunctionsEqual,o=t.areMapsEqual,a=t.areNumbersEqual,s=t.areObjectsEqual,l=t.arePrimitiveWrappersEqual,c=t.areRegExpsEqual,u=t.areSetsEqual,d=t.areTypedArraysEqual,f=t.areUrlsEqual;return function(y,v,g){if(y===v)return!0;if(y==null||v==null)return!1;var m=typeof y;if(m!==typeof v)return!1;if(m!=="object")return m==="number"?a(y,v,g):m==="function"?i(y,v,g):!1;var x=y.constructor;if(x!==v.constructor)return!1;if(x===Object)return s(y,v,g);if(ACe(y))return e(y,v,g);if(cL!=null&&cL(y))return d(y,v,g);if(x===Date)return n(y,v,g);if(x===RegExp)return c(y,v,g);if(x===Map)return o(y,v,g);if(x===Set)return u(y,v,g);var b=CCe(y);return b===yCe?n(y,v,g):b===SCe?c(y,v,g):b===bCe?o(y,v,g):b===ECe?u(y,v,g):b===wCe?typeof y.then!="function"&&typeof v.then!="function"&&s(y,v,g):b===MCe?f(y,v,g):b===xCe?r(y,v,g):b===gCe?s(y,v,g):b===vCe||b===_Ce||b===TCe?l(y,v,g):!1}}function RCe(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,i={areArraysEqual:r?bh:aCe,areDatesEqual:sCe,areErrorsEqual:lCe,areFunctionsEqual:cCe,areMapsEqual:r?rL(sL,bh):sL,areNumbersEqual:uCe,areObjectsEqual:r?bh:dCe,arePrimitiveWrappersEqual:fCe,areRegExpsEqual:hCe,areSetsEqual:r?rL(lL,bh):lL,areTypedArraysEqual:r?bh:pCe,areUrlsEqual:mCe};if(n&&(i=uL({},i,n(i))),e){var o=vv(i.areArraysEqual),a=vv(i.areMapsEqual),s=vv(i.areObjectsEqual),l=vv(i.areSetsEqual);i=uL({},i,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:s,areSetsEqual:l})}return i}function NCe(t){return function(e,n,r,i,o,a,s){return t(e,n,s)}}function OCe(t){var e=t.circular,n=t.comparator,r=t.createState,i=t.equals,o=t.strict;if(r)return function(l,c){var u=r(),d=u.cache,f=d===void 0?e?new WeakMap:void 0:d,p=u.meta;return n(l,c,{cache:f,equals:i,meta:p,strict:o})};if(e)return function(l,c){return n(l,c,{cache:new WeakMap,equals:i,meta:void 0,strict:o})};var a={cache:void 0,equals:i,meta:void 0,strict:o};return function(l,c){return n(l,c,a)}}var ICe=Rl();Rl({strict:!0});Rl({circular:!0});Rl({circular:!0,strict:!0});Rl({createInternalComparator:function(){return Jc}});Rl({strict:!0,createInternalComparator:function(){return Jc}});Rl({circular:!0,createInternalComparator:function(){return Jc}});Rl({circular:!0,createInternalComparator:function(){return Jc},strict:!0});function Rl(t){t===void 0&&(t={});var e=t.circular,n=e===void 0?!1:e,r=t.createInternalComparator,i=t.createState,o=t.strict,a=o===void 0?!1:o,s=RCe(t),l=PCe(s),c=r?r(l):NCe(l);return OCe({circular:n,comparator:l,createState:i,equals:c,strict:a})}function DCe(t){typeof requestAnimationFrame<"u"&&requestAnimationFrame(t)}function dL(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function i(o){n<0&&(n=o),o-n>e?(t(o),n=-1):DCe(i)};requestAnimationFrame(r)}function vT(t){"@babel/helpers - typeof";return vT=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vT(t)}function LCe(t){return FCe(t)||UCe(t)||jCe(t)||kCe()}function kCe(){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 jCe(t,e){if(t){if(typeof t=="string")return fL(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fL(t,e)}}function fL(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n1?1:m<0?0:m},v=function(m){for(var x=m>1?1:m,b=x,S=0;S<8;++S){var w=d(b)-x,E=p(b);if(Math.abs(w-x)0&&arguments[0]!==void 0?arguments[0]:{},n=e.stiff,r=n===void 0?100:n,i=e.damping,o=i===void 0?8:i,a=e.dt,s=a===void 0?17:a,l=function(u,d,f){var p=-(u-d)*r,y=f*o,v=f+(p-y)*s/1e3,g=f*s/1e3+u;return Math.abs(g-d)t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function gPe(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function nS(t){return bPe(t)||xPe(t)||yPe(t)||vPe()}function vPe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yPe(t,e){if(t){if(typeof t=="string")return wT(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return wT(t,e)}}function xPe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function bPe(t){if(Array.isArray(t))return wT(t)}function wT(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function g0(t){return g0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},g0(t)}var ss=function(t){TPe(n,t);var e=MPe(n);function n(r,i){var o;_Pe(this,n),o=e.call(this,r,i);var a=o.props,s=a.isActive,l=a.attributeName,c=a.from,u=a.to,d=a.steps,f=a.children,p=a.duration;if(o.handleStyleChange=o.handleStyleChange.bind(TT(o)),o.changeStyle=o.changeStyle.bind(TT(o)),!s||p<=0)return o.state={style:{}},typeof f=="function"&&(o.state={style:u}),ET(o);if(d&&d.length)o.state={style:d[0].style};else if(c){if(typeof f=="function")return o.state={style:c},ET(o);o.state={style:l?Ih({},l,c):c}}else o.state={style:{}};return o}return SPe(n,[{key:"componentDidMount",value:function(){var i=this.props,o=i.isActive,a=i.canBegin;this.mounted=!0,!(!o||!a)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var o=this.props,a=o.isActive,s=o.canBegin,l=o.attributeName,c=o.shouldReAnimate,u=o.to,d=o.from,f=this.state.style;if(s){if(!a){var p={style:l?Ih({},l,u):u};this.state&&f&&(l&&f[l]!==u||!l&&f!==u)&&this.setState(p);return}if(!(ICe(i.to,u)&&i.canBegin&&i.isActive)){var y=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var v=y||c?d:i.to;if(this.state&&f){var g={style:l?Ih({},l,v):v};(l&&f[l]!==v||!l&&f!==v)&&this.setState(g)}this.runAnimation(mo(mo({},this.props),{},{from:v,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var o=this,a=i.from,s=i.to,l=i.duration,c=i.easing,u=i.begin,d=i.onAnimationEnd,f=i.onAnimationStart,p=hPe(a,s,nPe(c),l,this.changeStyle),y=function(){o.stopJSAnimation=p()};this.manager.start([f,u,y,l,d])}},{key:"runStepAnimation",value:function(i){var o=this,a=i.steps,s=i.begin,l=i.onAnimationStart,c=a[0],u=c.style,d=c.duration,f=d===void 0?0:d,p=function(v,g,m){if(m===0)return v;var x=g.duration,b=g.easing,S=b===void 0?"ease":b,w=g.style,E=g.properties,T=g.onAnimationEnd,A=m>0?a[m-1]:g,M=E||Object.keys(w);if(typeof S=="function"||S==="spring")return[].concat(nS(v),[o.runJSAnimation.bind(o,{from:A.style,to:w,duration:x,easing:S}),x]);var C=mL(M,x,S),P=mo(mo(mo({},A.style),w),{},{transition:C});return[].concat(nS(v),[P,x,T]).filter(VCe)};return this.manager.start([l].concat(nS(a.reduce(p,[u,Math.max(f,s)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=BCe());var o=i.begin,a=i.duration,s=i.attributeName,l=i.to,c=i.easing,u=i.onAnimationStart,d=i.onAnimationEnd,f=i.steps,p=i.children,y=this.manager;if(this.unSubscribe=y.subscribe(this.handleStyleChange),typeof c=="function"||typeof p=="function"||c==="spring"){this.runJSAnimation(i);return}if(f.length>1){this.runStepAnimation(i);return}var v=s?Ih({},s,l):l,g=mL(Object.keys(v),a,c);y.start([u,o,mo(mo({},v),{},{transition:g}),a,d])}},{key:"render",value:function(){var i=this.props,o=i.children;i.begin;var a=i.duration;i.attributeName,i.easing;var s=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var l=mPe(i,pPe),c=_.Children.count(o),u=this.state.style;if(typeof o=="function")return o(u);if(!s||c===0||a<=0)return o;var d=function(p){var y=p.props,v=y.style,g=v===void 0?{}:v,m=y.className,x=_.cloneElement(p,mo(mo({},l),{},{style:mo(mo({},g),u),className:m}));return x};return c===1?d(_.Children.only(o)):Z.createElement("div",null,_.Children.map(o,function(f){return d(f)}))}}]),n}(_.PureComponent);ss.displayName="Animate";ss.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};ss.propTypes={from:Jt.oneOfType([Jt.object,Jt.string]),to:Jt.oneOfType([Jt.object,Jt.string]),attributeName:Jt.string,duration:Jt.number,begin:Jt.number,easing:Jt.oneOfType([Jt.string,Jt.func]),steps:Jt.arrayOf(Jt.shape({duration:Jt.number.isRequired,style:Jt.object.isRequired,easing:Jt.oneOfType([Jt.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Jt.func]),properties:Jt.arrayOf("string"),onAnimationEnd:Jt.func})),children:Jt.oneOfType([Jt.node,Jt.func]),isActive:Jt.bool,canBegin:Jt.bool,onAnimationEnd:Jt.func,shouldReAnimate:Jt.bool,onAnimationStart:Jt.func,onAnimationReStart:Jt.func};function nm(t){"@babel/helpers - typeof";return nm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nm(t)}function v0(){return v0=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0?1:-1,l=r>=0?1:-1,c=i>=0&&r>=0||i<0&&r<0?1:0,u;if(a>0&&o instanceof Array){for(var d=[0,0,0,0],f=0,p=4;fa?a:o[f];u="M".concat(e,",").concat(n+s*d[0]),d[0]>0&&(u+="A ".concat(d[0],",").concat(d[0],",0,0,").concat(c,",").concat(e+l*d[0],",").concat(n)),u+="L ".concat(e+r-l*d[1],",").concat(n),d[1]>0&&(u+="A ".concat(d[1],",").concat(d[1],",0,0,").concat(c,`, - `).concat(e+r,",").concat(n+s*d[1])),u+="L ".concat(e+r,",").concat(n+i-s*d[2]),d[2]>0&&(u+="A ".concat(d[2],",").concat(d[2],",0,0,").concat(c,`, - `).concat(e+r-l*d[2],",").concat(n+i)),u+="L ".concat(e+l*d[3],",").concat(n+i),d[3]>0&&(u+="A ".concat(d[3],",").concat(d[3],",0,0,").concat(c,`, - `).concat(e,",").concat(n+i-s*d[3])),u+="Z"}else if(a>0&&o===+o&&o>0){var y=Math.min(a,o);u="M ".concat(e,",").concat(n+s*y,` - A `).concat(y,",").concat(y,",0,0,").concat(c,",").concat(e+l*y,",").concat(n,` - L `).concat(e+r-l*y,",").concat(n,` - A `).concat(y,",").concat(y,",0,0,").concat(c,",").concat(e+r,",").concat(n+s*y,` - L `).concat(e+r,",").concat(n+i-s*y,` - A `).concat(y,",").concat(y,",0,0,").concat(c,",").concat(e+r-l*y,",").concat(n+i,` - L `).concat(e+l*y,",").concat(n+i,` - A `).concat(y,",").concat(y,",0,0,").concat(c,",").concat(e,",").concat(n+i-s*y," Z")}else u="M ".concat(e,",").concat(n," h ").concat(r," v ").concat(i," h ").concat(-r," Z");return u},kPe=function(e,n){if(!e||!n)return!1;var r=e.x,i=e.y,o=n.x,a=n.y,s=n.width,l=n.height;if(Math.abs(s)>0&&Math.abs(l)>0){var c=Math.min(o,o+s),u=Math.max(o,o+s),d=Math.min(a,a+l),f=Math.max(a,a+l);return r>=c&&r<=u&&i>=d&&i<=f}return!1},jPe={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},hP=function(e){var n=SL(SL({},jPe),e),r=_.useRef(),i=_.useState(-1),o=CPe(i,2),a=o[0],s=o[1];_.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var S=r.current.getTotalLength();S&&s(S)}catch{}},[]);var l=n.x,c=n.y,u=n.width,d=n.height,f=n.radius,p=n.className,y=n.animationEasing,v=n.animationDuration,g=n.animationBegin,m=n.isAnimationActive,x=n.isUpdateAnimationActive;if(l!==+l||c!==+c||u!==+u||d!==+d||u===0||d===0)return null;var b=zt("recharts-rectangle",p);return x?Z.createElement(ss,{canBegin:a>0,from:{width:u,height:d,x:l,y:c},to:{width:u,height:d,x:l,y:c},duration:v,animationEasing:y,isActive:x},function(S){var w=S.width,E=S.height,T=S.x,A=S.y;return Z.createElement(ss,{canBegin:a>0,from:"0px ".concat(a===-1?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:v,isActive:m,easing:y},Z.createElement("path",v0({},$t(n,!0),{className:b,d:EL(T,A,w,E,f),ref:r})))}):Z.createElement("path",v0({},$t(n,!0),{className:b,d:EL(l,c,u,d,f)}))};function MT(){return MT=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function VPe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}var GPe=function(e,n,r,i,o,a){return"M".concat(e,",").concat(o,"v").concat(i,"M").concat(a,",").concat(n,"h").concat(r)},WPe=function(e){var n=e.x,r=n===void 0?0:n,i=e.y,o=i===void 0?0:i,a=e.top,s=a===void 0?0:a,l=e.left,c=l===void 0?0:l,u=e.width,d=u===void 0?0:u,f=e.height,p=f===void 0?0:f,y=e.className,v=HPe(e,UPe),g=FPe({x:r,y:o,top:s,left:c,width:d,height:p},v);return!ze(r)||!ze(o)||!ze(d)||!ze(p)||!ze(s)||!ze(c)?null:Z.createElement("path",AT({},$t(g,!0),{className:zt("recharts-cross",y),d:GPe(r,o,d,p,s,c)}))},XPe=L5,qPe=XPe(Object.getPrototypeOf,Object),KPe=qPe,YPe=us,JPe=KPe,ZPe=ds,QPe="[object Object]",eRe=Function.prototype,tRe=Object.prototype,bV=eRe.toString,nRe=tRe.hasOwnProperty,rRe=bV.call(Object);function iRe(t){if(!ZPe(t)||YPe(t)!=QPe)return!1;var e=JPe(t);if(e===null)return!0;var n=nRe.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&bV.call(n)==rRe}var oRe=iRe;const aRe=dn(oRe);var sRe=us,lRe=ds,cRe="[object Boolean]";function uRe(t){return t===!0||t===!1||lRe(t)&&sRe(t)==cRe}var dRe=uRe;const fRe=dn(dRe);function im(t){"@babel/helpers - typeof";return im=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},im(t)}function y0(){return y0=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n0,from:{upperWidth:0,lowerWidth:0,height:f,x:l,y:c},to:{upperWidth:u,lowerWidth:d,height:f,x:l,y:c},duration:v,animationEasing:y,isActive:m},function(b){var S=b.upperWidth,w=b.lowerWidth,E=b.height,T=b.x,A=b.y;return Z.createElement(ss,{canBegin:a>0,from:"0px ".concat(a===-1?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:v,easing:y},Z.createElement("path",y0({},$t(n,!0),{className:x,d:PL(T,A,S,w,E),ref:r})))}):Z.createElement("g",null,Z.createElement("path",y0({},$t(n,!0),{className:x,d:PL(l,c,u,d,f)})))},SRe=["option","shapeType","propTransformer","activeClassName","isActive"];function om(t){"@babel/helpers - typeof";return om=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},om(t)}function ERe(t,e){if(t==null)return{};var n=TRe(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function TRe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function RL(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 x0(t){for(var e=1;e0&&r.handleDrag(i.changedTouches[0])}),wi(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=r.props,o=i.endIndex,a=i.onDragEnd,s=i.startIndex;a==null||a({endIndex:o,startIndex:s})}),r.detachDragEndListener()}),wi(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),wi(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),wi(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),wi(r,"handleSlideDragStart",function(i){var o=jL(i)?i.changedTouches[0]:i;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:o.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return uNe(e,t),aNe(e,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var i=r.startX,o=r.endX,a=this.state.scaleValues,s=this.props,l=s.gap,c=s.data,u=c.length-1,d=Math.min(i,o),f=Math.max(i,o),p=e.getIndexInRange(a,d),y=e.getIndexInRange(a,f);return{startIndex:p-p%l,endIndex:y===u?u:y-y%l}}},{key:"getTextOfTick",value:function(r){var i=this.props,o=i.data,a=i.tickFormatter,s=i.dataKey,l=Di(o[r],s,r);return jt(a)?a(l,r):l}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var i=this.state,o=i.slideMoveStartX,a=i.startX,s=i.endX,l=this.props,c=l.x,u=l.width,d=l.travellerWidth,f=l.startIndex,p=l.endIndex,y=l.onChange,v=r.pageX-o;v>0?v=Math.min(v,c+u-d-s,c+u-d-a):v<0&&(v=Math.max(v,c-a,c-s));var g=this.getIndex({startX:a+v,endX:s+v});(g.startIndex!==f||g.endIndex!==p)&&y&&y(g),this.setState({startX:a+v,endX:s+v,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,i){var o=jL(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:o.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var i=this.state,o=i.brushMoveStartX,a=i.movingTravellerId,s=i.endX,l=i.startX,c=this.state[a],u=this.props,d=u.x,f=u.width,p=u.travellerWidth,y=u.onChange,v=u.gap,g=u.data,m={startX:this.state.startX,endX:this.state.endX},x=r.pageX-o;x>0?x=Math.min(x,d+f-p-c):x<0&&(x=Math.max(x,d-c)),m[a]=c+x;var b=this.getIndex(m),S=b.startIndex,w=b.endIndex,E=function(){var A=g.length-1;return a==="startX"&&(s>l?S%v===0:w%v===0)||sl?w%v===0:S%v===0)||s>l&&w===A};this.setState(wi(wi({},a,c+x),"brushMoveStartX",r.pageX),function(){y&&E()&&y(b)})}},{key:"handleTravellerMoveKeyboard",value:function(r,i){var o=this,a=this.state,s=a.scaleValues,l=a.startX,c=a.endX,u=this.state[i],d=s.indexOf(u);if(d!==-1){var f=d+r;if(!(f===-1||f>=s.length)){var p=s[f];i==="startX"&&p>=c||i==="endX"&&p<=l||this.setState(wi({},i,p),function(){o.props.onChange(o.getIndex({startX:o.state.startX,endX:o.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,i=r.x,o=r.y,a=r.width,s=r.height,l=r.fill,c=r.stroke;return Z.createElement("rect",{stroke:c,fill:l,x:i,y:o,width:a,height:s})}},{key:"renderPanorama",value:function(){var r=this.props,i=r.x,o=r.y,a=r.width,s=r.height,l=r.data,c=r.children,u=r.padding,d=_.Children.only(c);return d?Z.cloneElement(d,{x:i,y:o,width:a,height:s,margin:u,compact:!0,data:l}):null}},{key:"renderTravellerLayer",value:function(r,i){var o,a,s=this,l=this.props,c=l.y,u=l.travellerWidth,d=l.height,f=l.traveller,p=l.ariaLabel,y=l.data,v=l.startIndex,g=l.endIndex,m=Math.max(r,this.props.x),x=iS(iS({},$t(this.props,!1)),{},{x:m,y:c,width:u,height:d}),b=p||"Min value: ".concat((o=y[v])===null||o===void 0?void 0:o.name,", Max value: ").concat((a=y[g])===null||a===void 0?void 0:a.name);return Z.createElement(jn,{tabIndex:0,role:"slider","aria-label":b,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(w){["ArrowLeft","ArrowRight"].includes(w.key)&&(w.preventDefault(),w.stopPropagation(),s.handleTravellerMoveKeyboard(w.key==="ArrowRight"?1:-1,i))},onFocus:function(){s.setState({isTravellerFocused:!0})},onBlur:function(){s.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},e.renderTraveller(f,x))}},{key:"renderSlide",value:function(r,i){var o=this.props,a=o.y,s=o.height,l=o.stroke,c=o.travellerWidth,u=Math.min(r,i)+c,d=Math.max(Math.abs(i-r)-c,0);return Z.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:l,fillOpacity:.2,x:u,y:a,width:d,height:s})}},{key:"renderText",value:function(){var r=this.props,i=r.startIndex,o=r.endIndex,a=r.y,s=r.height,l=r.travellerWidth,c=r.stroke,u=this.state,d=u.startX,f=u.endX,p=5,y={pointerEvents:"none",fill:c};return Z.createElement(jn,{className:"recharts-brush-texts"},Z.createElement(Jy,_0({textAnchor:"end",verticalAnchor:"middle",x:Math.min(d,f)-p,y:a+s/2},y),this.getTextOfTick(i)),Z.createElement(Jy,_0({textAnchor:"start",verticalAnchor:"middle",x:Math.max(d,f)+l+p,y:a+s/2},y),this.getTextOfTick(o)))}},{key:"render",value:function(){var r=this.props,i=r.data,o=r.className,a=r.children,s=r.x,l=r.y,c=r.width,u=r.height,d=r.alwaysShowText,f=this.state,p=f.startX,y=f.endX,v=f.isTextActive,g=f.isSlideMoving,m=f.isTravellerMoving,x=f.isTravellerFocused;if(!i||!i.length||!ze(s)||!ze(l)||!ze(c)||!ze(u)||c<=0||u<=0)return null;var b=zt("recharts-brush",o),S=Z.Children.count(a)===1,w=iNe("userSelect","none");return Z.createElement(jn,{className:b,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:w},this.renderBackground(),S&&this.renderPanorama(),this.renderSlide(p,y),this.renderTravellerLayer(p,"startX"),this.renderTravellerLayer(y,"endX"),(v||g||m||x||d)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var i=r.x,o=r.y,a=r.width,s=r.height,l=r.stroke,c=Math.floor(o+s/2)-1;return Z.createElement(Z.Fragment,null,Z.createElement("rect",{x:i,y:o,width:a,height:s,fill:l,stroke:"none"}),Z.createElement("line",{x1:i+1,y1:c,x2:i+a-1,y2:c,fill:"none",stroke:"#fff"}),Z.createElement("line",{x1:i+1,y1:c+2,x2:i+a-1,y2:c+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,i){var o;return Z.isValidElement(r)?o=Z.cloneElement(r,i):jt(r)?o=r(i):o=e.renderDefaultTraveller(i),o}},{key:"getDerivedStateFromProps",value:function(r,i){var o=r.data,a=r.width,s=r.x,l=r.travellerWidth,c=r.updateId,u=r.startIndex,d=r.endIndex;if(o!==i.prevData||c!==i.prevUpdateId)return iS({prevData:o,prevTravellerWidth:l,prevUpdateId:c,prevX:s,prevWidth:a},o&&o.length?fNe({data:o,width:a,x:s,travellerWidth:l,startIndex:u,endIndex:d}):{scale:null,scaleValues:null});if(i.scale&&(a!==i.prevWidth||s!==i.prevX||l!==i.prevTravellerWidth)){i.scale.range([s,s+a-l]);var f=i.scale.domain().map(function(p){return i.scale(p)});return{prevData:o,prevTravellerWidth:l,prevUpdateId:c,prevX:s,prevWidth:a,startX:i.scale(r.startIndex),endX:i.scale(r.endIndex),scaleValues:f}}return null}},{key:"getIndexInRange",value:function(r,i){for(var o=r.length,a=0,s=o-1;s-a>1;){var l=Math.floor((a+s)/2);r[l]>i?s=l:a=l}return i>=r[s]?s:a}}])}(_.PureComponent);wi(ef,"displayName","Brush");wi(ef,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var hNe=FC;function pNe(t,e){var n;return hNe(t,function(r,i,o){return n=e(r,i,o),!n}),!!n}var mNe=pNe,gNe=A5,vNe=kf,yNe=mNe,xNe=yi,bNe=wb;function _Ne(t,e,n){var r=xNe(t)?gNe:yNe;return n&&bNe(t,e,n)&&(e=void 0),r(t,vNe(e))}var wNe=_Ne;const SNe=dn(wNe);var ma=function(e,n){var r=e.alwaysShow,i=e.ifOverflow;return r&&(i="extendDomain"),i===n},UL=q5;function ENe(t,e,n){e=="__proto__"&&UL?UL(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var TNe=ENe,MNe=TNe,ANe=W5,CNe=kf;function PNe(t,e){var n={};return e=CNe(e),ANe(t,function(r,i,o){MNe(n,i,e(r,i,o))}),n}var RNe=PNe;const NNe=dn(RNe);function ONe(t,e){for(var n=-1,r=t==null?0:t.length;++n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function YNe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function JNe(t,e){var n=t.x,r=t.y,i=KNe(t,GNe),o="".concat(n),a=parseInt(o,10),s="".concat(r),l=parseInt(s,10),c="".concat(e.height||i.height),u=parseInt(c,10),d="".concat(e.width||i.width),f=parseInt(d,10);return _h(_h(_h(_h(_h({},e),i),a?{x:a}:{}),l?{y:l}:{}),{},{height:u,width:f,name:e.name,radius:e.radius})}function BL(t){return Z.createElement(ORe,PT({shapeType:"rectangle",propTransformer:JNe,activeClassName:"recharts-active-bar"},t))}var ZNe=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,i){if(typeof e=="number")return e;var o=typeof r=="number";return o?e(r,i):(o||jc(),n)}},QNe=["value","background"],EV;function tf(t){"@babel/helpers - typeof";return tf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tf(t)}function eOe(t,e){if(t==null)return{};var n=tOe(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function tOe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function S0(){return S0=Object.assign?Object.assign.bind():function(t){for(var e=1;e0&&Math.abs(U)0&&Math.abs(k)0&&(D=Math.min((q||0)-(k[Q-1]||0),D))}),Number.isFinite(D)){var U=D/R,O=v.layout==="vertical"?r.height:r.width;if(v.padding==="gap"&&(T=U*O/2),v.padding==="no-gap"){var W=Lc(e.barCategoryGap,U*O),L=U*O/2;T=L-W-(L-W)/O*W}}}i==="xAxis"?A=[r.left+(b.left||0)+(T||0),r.left+r.width-(b.right||0)-(T||0)]:i==="yAxis"?A=l==="horizontal"?[r.top+r.height-(b.bottom||0),r.top+(b.top||0)]:[r.top+(b.top||0)+(T||0),r.top+r.height-(b.bottom||0)-(T||0)]:A=v.range,w&&(A=[A[1],A[0]]);var j=DMe(v,o,f),X=j.scale,K=j.realScaleType;X.domain(m).range(A),LMe(X);var F=HMe(X,Eo(Eo({},v),{},{realScaleType:K}));i==="xAxis"?(P=g==="top"&&!S||g==="bottom"&&S,M=r.left,C=d[E]-P*v.height):i==="yAxis"&&(P=g==="left"&&!S||g==="right"&&S,M=d[E]-P*v.width,C=r.top);var Y=Eo(Eo(Eo({},v),F),{},{realScaleType:K,x:M,y:C,scale:X,width:i==="xAxis"?r.width:v.width,height:i==="yAxis"?r.height:v.height});return Y.bandSize=d0(Y,F),!v.hide&&i==="xAxis"?d[E]+=(P?-1:1)*Y.height:v.hide||(d[E]+=(P?-1:1)*Y.width),Eo(Eo({},p),{},kb({},y,Y))},{})},CV=function(e,n){var r=e.x,i=e.y,o=n.x,a=n.y;return{x:Math.min(r,o),y:Math.min(i,a),width:Math.abs(o-r),height:Math.abs(a-i)}},hOe=function(e){var n=e.x1,r=e.y1,i=e.x2,o=e.y2;return CV({x:n,y:r},{x:i,y:o})},PV=function(){function t(e){cOe(this,t),this.scale=e}return uOe(t,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.bandAware,o=r.position;if(n!==void 0){if(o)switch(o){case"start":return this.scale(n);case"middle":{var a=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+a}case"end":{var s=this.bandwidth?this.bandwidth():0;return this.scale(n)+s}default:return this.scale(n)}if(i){var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+l}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),i=r[0],o=r[r.length-1];return i<=o?n>=i&&n<=o:n>=o&&n<=i}}],[{key:"create",value:function(n){return new t(n)}}])}();kb(PV,"EPS",1e-4);var mP=function(e){var n=Object.keys(e).reduce(function(r,i){return Eo(Eo({},r),{},kb({},i,PV.create(e[i])))},{});return Eo(Eo({},n),{},{apply:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=o.bandAware,s=o.position;return NNe(i,function(l,c){return n[c].apply(l,{bandAware:a,position:s})})},isInRange:function(i){return VNe(i,function(o,a){return n[a].isInRange(o)})}})};function pOe(t){return(t%180+180)%180}var mOe=function(e){var n=e.width,r=e.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=pOe(i),a=o*Math.PI/180,s=Math.atan(r/n),l=a>s&&at.length)&&(e=t.length);for(var n=0,r=new Array(e);nt*i)return!1;var o=n();return t*(e-t*o/2-r)>=0&&t*(e+t*o/2-i)<=0}function n2e(t,e){return WV(t,e+1)}function r2e(t,e,n,r,i){for(var o=(r||[]).slice(),a=e.start,s=e.end,l=0,c=1,u=a,d=function(){var y=r==null?void 0:r[l];if(y===void 0)return{v:WV(r,c)};var v=l,g,m=function(){return g===void 0&&(g=n(y,v)),g},x=y.coordinate,b=l===0||C0(t,x,m,u,s);b||(l=0,u=a,c+=1),b&&(u=x+t*(m()/2+i),l+=c)},f;c<=o.length;)if(f=d(),f)return f.v;return[]}function um(t){"@babel/helpers - typeof";return um=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},um(t)}function QL(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 Pr(t){for(var e=1;e0?p.coordinate-g*t:p.coordinate})}else o[f]=p=Pr(Pr({},p),{},{tickCoord:p.coordinate});var m=C0(t,p.tickCoord,v,s,l);m&&(l=p.tickCoord-t*(v()/2+i),o[f]=Pr(Pr({},p),{},{isShow:!0}))},u=a-1;u>=0;u--)c(u);return o}function l2e(t,e,n,r,i,o){var a=(r||[]).slice(),s=a.length,l=e.start,c=e.end;if(o){var u=r[s-1],d=n(u,s-1),f=t*(u.coordinate+t*d/2-c);a[s-1]=u=Pr(Pr({},u),{},{tickCoord:f>0?u.coordinate-f*t:u.coordinate});var p=C0(t,u.tickCoord,function(){return d},l,c);p&&(c=u.tickCoord-t*(d/2+i),a[s-1]=Pr(Pr({},u),{},{isShow:!0}))}for(var y=o?s-1:s,v=function(x){var b=a[x],S,w=function(){return S===void 0&&(S=n(b,x)),S};if(x===0){var E=t*(b.coordinate-t*w()/2-l);a[x]=b=Pr(Pr({},b),{},{tickCoord:E<0?b.coordinate-E*t:b.coordinate})}else a[x]=b=Pr(Pr({},b),{},{tickCoord:b.coordinate});var T=C0(t,b.tickCoord,w,l,c);T&&(l=b.tickCoord+t*(w()/2+i),a[x]=Pr(Pr({},b),{},{isShow:!0}))},g=0;g=2?Do(i[1].coordinate-i[0].coordinate):1,m=t2e(o,g,p);return l==="equidistantPreserveStart"?r2e(g,m,v,i,a):(l==="preserveStart"||l==="preserveStartEnd"?f=l2e(g,m,v,i,a,l==="preserveStartEnd"):f=s2e(g,m,v,i,a),f.filter(function(x){return x.isShow}))}var u2e=["viewBox"],d2e=["viewBox"],f2e=["ticks"];function af(t){"@babel/helpers - typeof";return af=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},af(t)}function Xu(){return Xu=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function h2e(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function p2e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function tk(t,e){for(var n=0;n0?l(this.props):l(p)),a<=0||s<=0||!y||!y.length?null:Z.createElement(jn,{className:zt("recharts-cartesian-axis",c),ref:function(g){r.layerReference=g}},o&&this.renderAxisLine(),this.renderTicks(y,this.state.fontSize,this.state.letterSpacing),Nr.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,i,o){var a;return Z.isValidElement(r)?a=Z.cloneElement(r,i):jt(r)?a=r(i):a=Z.createElement(Jy,Xu({},i,{className:"recharts-cartesian-axis-tick-value"}),o),a}}])}(_.Component);yP($b,"displayName","CartesianAxis");yP($b,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var _2e=["type","layout","connectNulls","ref"],w2e=["key"];function sf(t){"@babel/helpers - typeof";return sf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},sf(t)}function nk(t,e){if(t==null)return{};var n=S2e(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function S2e(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function Jh(){return Jh=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);nd){p=[].concat(Tu(l.slice(0,y)),[d-v]);break}var g=p.length%2===0?[0,f]:[f];return[].concat(Tu(e.repeat(l,u)),Tu(p),g).map(function(m){return"".concat(m,"px")}).join(", ")}),To(n,"id",Bm("recharts-line-")),To(n,"pathRef",function(a){n.mainCurve=a}),To(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),To(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return I2e(e,t),P2e(e,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();this.setState({totalLength:r})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();r!==this.state.totalLength&&this.setState({totalLength:r})}}},{key:"getTotalLength",value:function(){var r=this.mainCurve;try{return r&&r.getTotalLength&&r.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(r,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,a=o.points,s=o.xAxis,l=o.yAxis,c=o.layout,u=o.children,d=ro(u,Gm);if(!d)return null;var f=function(v,g){return{x:v.x,y:v.y,value:v.value,errorVal:Di(v.payload,g)}},p={clipPath:r?"url(#clipPath-".concat(i,")"):null};return Z.createElement(jn,p,d.map(function(y){return Z.cloneElement(y,{key:"bar-".concat(y.props.dataKey),data:a,xAxis:s,yAxis:l,layout:c,dataPointFormatter:f})}))}},{key:"renderDots",value:function(r,i,o){var a=this.props.isAnimationActive;if(a&&!this.state.isAnimationFinished)return null;var s=this.props,l=s.dot,c=s.points,u=s.dataKey,d=$t(this.props,!1),f=$t(l,!0),p=c.map(function(v,g){var m=_i(_i(_i({key:"dot-".concat(g),r:3},d),f),{},{index:g,cx:v.x,cy:v.y,value:v.value,dataKey:u,payload:v.payload,points:c});return e.renderDotItem(l,m)}),y={clipPath:r?"url(#clipPath-".concat(i?"":"dots-").concat(o,")"):null};return Z.createElement(jn,Jh({className:"recharts-line-dots",key:"dots"},y),p)}},{key:"renderCurveStatically",value:function(r,i,o,a){var s=this.props,l=s.type,c=s.layout,u=s.connectNulls;s.ref;var d=nk(s,_2e),f=_i(_i(_i({},$t(d,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(o,")"):null,points:r},a),{},{type:l,layout:c,connectNulls:u});return Z.createElement(gT,Jh({},f,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,i){var o=this,a=this.props,s=a.points,l=a.strokeDasharray,c=a.isAnimationActive,u=a.animationBegin,d=a.animationDuration,f=a.animationEasing,p=a.animationId,y=a.animateNewValues,v=a.width,g=a.height,m=this.state,x=m.prevPoints,b=m.totalLength;return Z.createElement(ss,{begin:u,duration:d,isActive:c,easing:f,from:{t:0},to:{t:1},key:"line-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(S){var w=S.t;if(x){var E=x.length/s.length,T=s.map(function(R,D){var k=Math.floor(D*E);if(x[k]){var U=x[k],O=Co(U.x,R.x),W=Co(U.y,R.y);return _i(_i({},R),{},{x:O(w),y:W(w)})}if(y){var L=Co(v*2,R.x),j=Co(g/2,R.y);return _i(_i({},R),{},{x:L(w),y:j(w)})}return _i(_i({},R),{},{x:R.x,y:R.y})});return o.renderCurveStatically(T,r,i)}var A=Co(0,b),M=A(w),C;if(l){var P="".concat(l).split(/[,\s]+/gim).map(function(R){return parseFloat(R)});C=o.getStrokeDasharray(M,b,P)}else C=o.generateSimpleStrokeDasharray(b,M);return o.renderCurveStatically(s,r,i,{strokeDasharray:C})})}},{key:"renderCurve",value:function(r,i){var o=this.props,a=o.points,s=o.isAnimationActive,l=this.state,c=l.prevPoints,u=l.totalLength;return s&&a&&a.length&&(!c&&u>0||!Nb(c,a))?this.renderCurveWithAnimation(r,i):this.renderCurveStatically(a,r,i)}},{key:"render",value:function(){var r,i=this.props,o=i.hide,a=i.dot,s=i.points,l=i.className,c=i.xAxis,u=i.yAxis,d=i.top,f=i.left,p=i.width,y=i.height,v=i.isAnimationActive,g=i.id;if(o||!s||!s.length)return null;var m=this.state.isAnimationFinished,x=s.length===1,b=zt("recharts-line",l),S=c&&c.allowDataOverflow,w=u&&u.allowDataOverflow,E=S||w,T=Ut(g)?this.id:g,A=(r=$t(a,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},M=A.r,C=M===void 0?3:M,P=A.strokeWidth,R=P===void 0?2:P,D=Ehe(a)?a:{},k=D.clipDot,U=k===void 0?!0:k,O=C*2+R;return Z.createElement(jn,{className:b},S||w?Z.createElement("defs",null,Z.createElement("clipPath",{id:"clipPath-".concat(T)},Z.createElement("rect",{x:S?f:f-p/2,y:w?d:d-y/2,width:S?p:p*2,height:w?y:y*2})),!U&&Z.createElement("clipPath",{id:"clipPath-dots-".concat(T)},Z.createElement("rect",{x:f-O/2,y:d-O/2,width:p+O,height:y+O}))):null,!x&&this.renderCurve(E,T),this.renderErrorBar(E,T),(x||a)&&this.renderDots(E,U,T),(!v||m)&&rl.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:i.curPoints}:r.points!==i.curPoints?{curPoints:r.points}:null}},{key:"repeat",value:function(r,i){for(var o=r.length%2!==0?[].concat(Tu(r),[0]):r,a=[],s=0;st.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function wIe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function SIe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function EIe(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n0?a:e&&e.length&&ze(i)&&ze(o)?e.slice(i,o+1):[]};function uG(t){return t==="number"?[0,"auto"]:void 0}var qT=function(e,n,r,i){var o=e.graphicalItems,a=e.tooltipAxis,s=zb(n,e);return r<0||!o||!o.length||r>=s.length?null:o.reduce(function(l,c){var u,d=(u=c.props.data)!==null&&u!==void 0?u:n;d&&e.dataStartIndex+e.dataEndIndex!==0&&e.dataEndIndex-e.dataStartIndex>=r&&(d=d.slice(e.dataStartIndex,e.dataEndIndex+1));var f;if(a.dataKey&&!a.allowDuplicatedCategory){var p=d===void 0?s:d;f=Ly(p,a.dataKey,i)}else f=d&&d[r]||s[r];return f?[].concat(ff(l),[aV(c,f)]):l},[])},uk=function(e,n,r,i){var o=i||{x:e.chartX,y:e.chartY},a=kIe(o,r),s=e.orderedTooltipTicks,l=e.tooltipAxis,c=e.tooltipTicks,u=CMe(a,s,c,l);if(u>=0&&c){var d=c[u]&&c[u].value,f=qT(e,n,u,d),p=jIe(r,s,u,o);return{activeTooltipIndex:u,activeLabel:d,activePayload:f,activeCoordinate:p}}return null},UIe=function(e,n){var r=n.axes,i=n.graphicalItems,o=n.axisType,a=n.axisIdKey,s=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=e.layout,d=e.children,f=e.stackOffset,p=iV(u,o);return r.reduce(function(y,v){var g,m=v.type.defaultProps!==void 0?ve(ve({},v.type.defaultProps),v.props):v.props,x=m.type,b=m.dataKey,S=m.allowDataOverflow,w=m.allowDuplicatedCategory,E=m.scale,T=m.ticks,A=m.includeHidden,M=m[a];if(y[M])return y;var C=zb(e.data,{graphicalItems:i.filter(function(F){var Y,q=a in F.props?F.props[a]:(Y=F.type.defaultProps)===null||Y===void 0?void 0:Y[a];return q===M}),dataStartIndex:l,dataEndIndex:c}),P=C.length,R,D,k;uIe(m.domain,S,x)&&(R=dT(m.domain,null,S),p&&(x==="number"||E!=="auto")&&(k=Kh(C,b,"category")));var U=uG(x);if(!R||R.length===0){var O,W=(O=m.domain)!==null&&O!==void 0?O:U;if(b){if(R=Kh(C,b,x),x==="category"&&p){var L=phe(R);w&&L?(D=R,R=b0(0,P)):w||(R=VD(W,R,v).reduce(function(F,Y){return F.indexOf(Y)>=0?F:[].concat(ff(F),[Y])},[]))}else if(x==="category")w?R=R.filter(function(F){return F!==""&&!Ut(F)}):R=VD(W,R,v).reduce(function(F,Y){return F.indexOf(Y)>=0||Y===""||Ut(Y)?F:[].concat(ff(F),[Y])},[]);else if(x==="number"){var j=IMe(C,i.filter(function(F){var Y,q,Q=a in F.props?F.props[a]:(Y=F.type.defaultProps)===null||Y===void 0?void 0:Y[a],te="hide"in F.props?F.props.hide:(q=F.type.defaultProps)===null||q===void 0?void 0:q.hide;return Q===M&&(A||!te)}),b,o,u);j&&(R=j)}p&&(x==="number"||E!=="auto")&&(k=Kh(C,b,"category"))}else p?R=b0(0,P):s&&s[M]&&s[M].hasStack&&x==="number"?R=f==="expand"?[0,1]:oV(s[M].stackGroups,l,c):R=rV(C,i.filter(function(F){var Y=a in F.props?F.props[a]:F.type.defaultProps[a],q="hide"in F.props?F.props.hide:F.type.defaultProps.hide;return Y===M&&(A||!q)}),x,u,!0);if(x==="number")R=GT(d,R,M,o,T),W&&(R=dT(W,R,S));else if(x==="category"&&W){var X=W,K=R.every(function(F){return X.indexOf(F)>=0});K&&(R=X)}}return ve(ve({},y),{},bt({},M,ve(ve({},m),{},{axisType:o,domain:R,categoricalDomain:k,duplicateDomain:D,originalDomain:(g=m.domain)!==null&&g!==void 0?g:U,isCategorical:p,layout:u})))},{})},FIe=function(e,n){var r=n.graphicalItems,i=n.Axis,o=n.axisType,a=n.axisIdKey,s=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=e.layout,d=e.children,f=zb(e.data,{graphicalItems:r,dataStartIndex:l,dataEndIndex:c}),p=f.length,y=iV(u,o),v=-1;return r.reduce(function(g,m){var x=m.type.defaultProps!==void 0?ve(ve({},m.type.defaultProps),m.props):m.props,b=x[a],S=uG("number");if(!g[b]){v++;var w;return y?w=b0(0,p):s&&s[b]&&s[b].hasStack?(w=oV(s[b].stackGroups,l,c),w=GT(d,w,b,o)):(w=dT(S,rV(f,r.filter(function(E){var T,A,M=a in E.props?E.props[a]:(T=E.type.defaultProps)===null||T===void 0?void 0:T[a],C="hide"in E.props?E.props.hide:(A=E.type.defaultProps)===null||A===void 0?void 0:A.hide;return M===b&&!C}),"number",u),i.defaultProps.allowDataOverflow),w=GT(d,w,b,o)),ve(ve({},g),{},bt({},b,ve(ve({axisType:o},i.defaultProps),{},{hide:!0,orientation:no(DIe,"".concat(o,".").concat(v%2),null),domain:w,originalDomain:S,isCategorical:y,layout:u})))}return g},{})},BIe=function(e,n){var r=n.axisType,i=r===void 0?"xAxis":r,o=n.AxisComp,a=n.graphicalItems,s=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=e.children,d="".concat(i,"Id"),f=ro(u,o),p={};return f&&f.length?p=UIe(e,{axes:f,graphicalItems:a,axisType:i,axisIdKey:d,stackGroups:s,dataStartIndex:l,dataEndIndex:c}):a&&a.length&&(p=FIe(e,{Axis:o,graphicalItems:a,axisType:i,axisIdKey:d,stackGroups:s,dataStartIndex:l,dataEndIndex:c})),p},$Ie=function(e){var n=Cu(e),r=ic(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:BC(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:d0(n,r)}},dk=function(e){var n=e.children,r=e.defaultShowTooltip,i=Ei(n,ef),o=0,a=0;return e.data&&e.data.length!==0&&(a=e.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(o=i.props.startIndex),i.props.endIndex>=0&&(a=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:a,activeTooltipIndex:-1,isTooltipActive:!!r}},zIe=function(e){return!e||!e.length?!1:e.some(function(n){var r=Ka(n&&n.type);return r&&r.indexOf("Bar")>=0})},fk=function(e){return e==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:e==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:e==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},HIe=function(e,n){var r=e.props,i=e.graphicalItems,o=e.xAxisMap,a=o===void 0?{}:o,s=e.yAxisMap,l=s===void 0?{}:s,c=r.width,u=r.height,d=r.children,f=r.margin||{},p=Ei(d,ef),y=Ei(d,hd),v=Object.keys(l).reduce(function(w,E){var T=l[E],A=T.orientation;return!T.mirror&&!T.hide?ve(ve({},w),{},bt({},A,w[A]+T.width)):w},{left:f.left||0,right:f.right||0}),g=Object.keys(a).reduce(function(w,E){var T=a[E],A=T.orientation;return!T.mirror&&!T.hide?ve(ve({},w),{},bt({},A,no(w,"".concat(A))+T.height)):w},{top:f.top||0,bottom:f.bottom||0}),m=ve(ve({},g),v),x=m.bottom;p&&(m.bottom+=p.props.height||ef.defaultProps.height),y&&n&&(m=NMe(m,i,r,n));var b=c-m.left-m.right,S=u-m.top-m.bottom;return ve(ve({brushBottom:x},m),{},{width:Math.max(b,0),height:Math.max(S,0)})},VIe=function(e,n){if(n==="xAxis")return e[n].width;if(n==="yAxis")return e[n].height},GIe=function(e){var n=e.chartName,r=e.GraphicalChild,i=e.defaultTooltipEventType,o=i===void 0?"axis":i,a=e.validateTooltipEventTypes,s=a===void 0?["axis"]:a,l=e.axisComponents,c=e.legendContent,u=e.formatAxisMap,d=e.defaultProps,f=function(m,x){var b=x.graphicalItems,S=x.stackGroups,w=x.offset,E=x.updateId,T=x.dataStartIndex,A=x.dataEndIndex,M=m.barSize,C=m.layout,P=m.barGap,R=m.barCategoryGap,D=m.maxBarSize,k=fk(C),U=k.numericAxisName,O=k.cateAxisName,W=zIe(b),L=[];return b.forEach(function(j,X){var K=zb(m.data,{graphicalItems:[j],dataStartIndex:T,dataEndIndex:A}),F=j.type.defaultProps!==void 0?ve(ve({},j.type.defaultProps),j.props):j.props,Y=F.dataKey,q=F.maxBarSize,Q=F["".concat(U,"Id")],te=F["".concat(O,"Id")],ee={},ce=l.reduce(function(it,Ft){var J=x["".concat(Ft.axisType,"Map")],B=F["".concat(Ft.axisType,"Id")];J&&J[B]||Ft.axisType==="zAxis"||jc();var ue=J[B];return ve(ve({},it),{},bt(bt({},Ft.axisType,ue),"".concat(Ft.axisType,"Ticks"),ic(ue)))},ee),ae=ce[O],fe=ce["".concat(O,"Ticks")],we=S&&S[Q]&&S[Q].hasStack&&GMe(j,S[Q].stackGroups),le=Ka(j.type).indexOf("Bar")>=0,ie=d0(ae,fe),G=[],Ve=W&&PMe({barSize:M,stackGroups:S,totalSize:VIe(ce,O)});if(le){var Ne,st,Re=Ut(q)?D:q,ct=(Ne=(st=d0(ae,fe,!0))!==null&&st!==void 0?st:Re)!==null&&Ne!==void 0?Ne:0;G=RMe({barGap:P,barCategoryGap:R,bandSize:ct!==ie?ct:ie,sizeList:Ve[te],maxBarSize:Re}),ct!==ie&&(G=G.map(function(it){return ve(ve({},it),{},{position:ve(ve({},it.position),{},{offset:it.position.offset-ct/2})})}))}var Ye=j&&j.type&&j.type.getComposedData;Ye&&L.push({props:ve(ve({},Ye(ve(ve({},ce),{},{displayedData:K,props:m,dataKey:Y,item:j,bandSize:ie,barPosition:G,offset:w,stackedData:we,layout:C,dataStartIndex:T,dataEndIndex:A}))),{},bt(bt(bt({key:j.key||"item-".concat(X)},U,ce[U]),O,ce[O]),"animationId",E)),childIndex:Ahe(j,m.children),item:j})}),L},p=function(m,x){var b=m.props,S=m.dataStartIndex,w=m.dataEndIndex,E=m.updateId;if(!k2({props:b}))return null;var T=b.children,A=b.layout,M=b.stackOffset,C=b.data,P=b.reverseStackOrder,R=fk(A),D=R.numericAxisName,k=R.cateAxisName,U=ro(T,r),O=zMe(C,U,"".concat(D,"Id"),"".concat(k,"Id"),M,P),W=l.reduce(function(F,Y){var q="".concat(Y.axisType,"Map");return ve(ve({},F),{},bt({},q,BIe(b,ve(ve({},Y),{},{graphicalItems:U,stackGroups:Y.axisType===D&&O,dataStartIndex:S,dataEndIndex:w}))))},{}),L=HIe(ve(ve({},W),{},{props:b,graphicalItems:U}),x==null?void 0:x.legendBBox);Object.keys(W).forEach(function(F){W[F]=u(b,W[F],L,F.replace("Map",""),n)});var j=W["".concat(k,"Map")],X=$Ie(j),K=f(b,ve(ve({},W),{},{dataStartIndex:S,dataEndIndex:w,updateId:E,graphicalItems:U,stackGroups:O,offset:L}));return ve(ve({formattedGraphicalItems:K,graphicalItems:U,offset:L,stackGroups:O},X),W)},y=function(g){function m(x){var b,S,w;return SIe(this,m),w=MIe(this,m,[x]),bt(w,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),bt(w,"accessibilityManager",new cIe),bt(w,"handleLegendBBoxUpdate",function(E){if(E){var T=w.state,A=T.dataStartIndex,M=T.dataEndIndex,C=T.updateId;w.setState(ve({legendBBox:E},p({props:w.props,dataStartIndex:A,dataEndIndex:M,updateId:C},ve(ve({},w.state),{},{legendBBox:E}))))}}),bt(w,"handleReceiveSyncEvent",function(E,T,A){if(w.props.syncId===E){if(A===w.eventEmitterSymbol&&typeof w.props.syncMethod!="function")return;w.applySyncEvent(T)}}),bt(w,"handleBrushChange",function(E){var T=E.startIndex,A=E.endIndex;if(T!==w.state.dataStartIndex||A!==w.state.dataEndIndex){var M=w.state.updateId;w.setState(function(){return ve({dataStartIndex:T,dataEndIndex:A},p({props:w.props,dataStartIndex:T,dataEndIndex:A,updateId:M},w.state))}),w.triggerSyncEvent({dataStartIndex:T,dataEndIndex:A})}}),bt(w,"handleMouseEnter",function(E){var T=w.getMouseInfo(E);if(T){var A=ve(ve({},T),{},{isTooltipActive:!0});w.setState(A),w.triggerSyncEvent(A);var M=w.props.onMouseEnter;jt(M)&&M(A,E)}}),bt(w,"triggeredAfterMouseMove",function(E){var T=w.getMouseInfo(E),A=T?ve(ve({},T),{},{isTooltipActive:!0}):{isTooltipActive:!1};w.setState(A),w.triggerSyncEvent(A);var M=w.props.onMouseMove;jt(M)&&M(A,E)}),bt(w,"handleItemMouseEnter",function(E){w.setState(function(){return{isTooltipActive:!0,activeItem:E,activePayload:E.tooltipPayload,activeCoordinate:E.tooltipPosition||{x:E.cx,y:E.cy}}})}),bt(w,"handleItemMouseLeave",function(){w.setState(function(){return{isTooltipActive:!1}})}),bt(w,"handleMouseMove",function(E){E.persist(),w.throttleTriggeredAfterMouseMove(E)}),bt(w,"handleMouseLeave",function(E){w.throttleTriggeredAfterMouseMove.cancel();var T={isTooltipActive:!1};w.setState(T),w.triggerSyncEvent(T);var A=w.props.onMouseLeave;jt(A)&&A(T,E)}),bt(w,"handleOuterEvent",function(E){var T=Mhe(E),A=no(w.props,"".concat(T));if(T&&jt(A)){var M,C;/.*touch.*/i.test(T)?C=w.getMouseInfo(E.changedTouches[0]):C=w.getMouseInfo(E),A((M=C)!==null&&M!==void 0?M:{},E)}}),bt(w,"handleClick",function(E){var T=w.getMouseInfo(E);if(T){var A=ve(ve({},T),{},{isTooltipActive:!0});w.setState(A),w.triggerSyncEvent(A);var M=w.props.onClick;jt(M)&&M(A,E)}}),bt(w,"handleMouseDown",function(E){var T=w.props.onMouseDown;if(jt(T)){var A=w.getMouseInfo(E);T(A,E)}}),bt(w,"handleMouseUp",function(E){var T=w.props.onMouseUp;if(jt(T)){var A=w.getMouseInfo(E);T(A,E)}}),bt(w,"handleTouchMove",function(E){E.changedTouches!=null&&E.changedTouches.length>0&&w.throttleTriggeredAfterMouseMove(E.changedTouches[0])}),bt(w,"handleTouchStart",function(E){E.changedTouches!=null&&E.changedTouches.length>0&&w.handleMouseDown(E.changedTouches[0])}),bt(w,"handleTouchEnd",function(E){E.changedTouches!=null&&E.changedTouches.length>0&&w.handleMouseUp(E.changedTouches[0])}),bt(w,"handleDoubleClick",function(E){var T=w.props.onDoubleClick;if(jt(T)){var A=w.getMouseInfo(E);T(A,E)}}),bt(w,"handleContextMenu",function(E){var T=w.props.onContextMenu;if(jt(T)){var A=w.getMouseInfo(E);T(A,E)}}),bt(w,"triggerSyncEvent",function(E){w.props.syncId!==void 0&&aS.emit(sS,w.props.syncId,E,w.eventEmitterSymbol)}),bt(w,"applySyncEvent",function(E){var T=w.props,A=T.layout,M=T.syncMethod,C=w.state.updateId,P=E.dataStartIndex,R=E.dataEndIndex;if(E.dataStartIndex!==void 0||E.dataEndIndex!==void 0)w.setState(ve({dataStartIndex:P,dataEndIndex:R},p({props:w.props,dataStartIndex:P,dataEndIndex:R,updateId:C},w.state)));else if(E.activeTooltipIndex!==void 0){var D=E.chartX,k=E.chartY,U=E.activeTooltipIndex,O=w.state,W=O.offset,L=O.tooltipTicks;if(!W)return;if(typeof M=="function")U=M(L,E);else if(M==="value"){U=-1;for(var j=0;j=0){var we,le;if(D.dataKey&&!D.allowDuplicatedCategory){var ie=typeof D.dataKey=="function"?fe:"payload.".concat(D.dataKey.toString());we=Ly(j,ie,U),le=X&&K&&Ly(K,ie,U)}else we=j==null?void 0:j[k],le=X&&K&&K[k];if(te||Q){var G=E.props.activeIndex!==void 0?E.props.activeIndex:k;return[_.cloneElement(E,ve(ve(ve({},M.props),ce),{},{activeIndex:G})),null,null]}if(!Ut(we))return[ae].concat(ff(w.renderActivePoints({item:M,activePoint:we,basePoint:le,childIndex:k,isRange:X})))}else{var Ve,Ne=(Ve=w.getItemByXY(w.state.activeCoordinate))!==null&&Ve!==void 0?Ve:{graphicalItem:ae},st=Ne.graphicalItem,Re=st.item,ct=Re===void 0?E:Re,Ye=st.childIndex,it=ve(ve(ve({},M.props),ce),{},{activeIndex:Ye});return[_.cloneElement(ct,it),null,null]}return X?[ae,null,null]:[ae,null]}),bt(w,"renderCustomized",function(E,T,A){return _.cloneElement(E,ve(ve({key:"recharts-customized-".concat(A)},w.props),w.state))}),bt(w,"renderMap",{CartesianGrid:{handler:xv,once:!0},ReferenceArea:{handler:w.renderReferenceElement},ReferenceLine:{handler:xv},ReferenceDot:{handler:w.renderReferenceElement},XAxis:{handler:xv},YAxis:{handler:xv},Brush:{handler:w.renderBrush,once:!0},Bar:{handler:w.renderGraphicChild},Line:{handler:w.renderGraphicChild},Area:{handler:w.renderGraphicChild},Radar:{handler:w.renderGraphicChild},RadialBar:{handler:w.renderGraphicChild},Scatter:{handler:w.renderGraphicChild},Pie:{handler:w.renderGraphicChild},Funnel:{handler:w.renderGraphicChild},Tooltip:{handler:w.renderCursor,once:!0},PolarGrid:{handler:w.renderPolarGrid,once:!0},PolarAngleAxis:{handler:w.renderPolarAxis},PolarRadiusAxis:{handler:w.renderPolarAxis},Customized:{handler:w.renderCustomized}}),w.clipPathId="".concat((b=x.id)!==null&&b!==void 0?b:Bm("recharts"),"-clip"),w.throttleTriggeredAfterMouseMove=eH(w.triggeredAfterMouseMove,(S=x.throttleDelay)!==null&&S!==void 0?S:1e3/60),w.state={},w}return PIe(m,g),TIe(m,[{key:"componentDidMount",value:function(){var b,S;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(b=this.props.margin.left)!==null&&b!==void 0?b:0,top:(S=this.props.margin.top)!==null&&S!==void 0?S:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var b=this.props,S=b.children,w=b.data,E=b.height,T=b.layout,A=Ei(S,So);if(A){var M=A.props.defaultIndex;if(!(typeof M!="number"||M<0||M>this.state.tooltipTicks.length-1)){var C=this.state.tooltipTicks[M]&&this.state.tooltipTicks[M].value,P=qT(this.state,w,M,C),R=this.state.tooltipTicks[M].coordinate,D=(this.state.offset.top+E)/2,k=T==="horizontal",U=k?{x:R,y:D}:{y:R,x:D},O=this.state.formattedGraphicalItems.find(function(L){var j=L.item;return j.type.name==="Scatter"});O&&(U=ve(ve({},U),O.props.points[M].tooltipPosition),P=O.props.points[M].tooltipPayload);var W={activeTooltipIndex:M,isTooltipActive:!0,activeLabel:C,activePayload:P,activeCoordinate:U};this.setState(W),this.renderCursor(A),this.accessibilityManager.setIndex(M)}}}},{key:"getSnapshotBeforeUpdate",value:function(b,S){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==S.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==b.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==b.margin){var w,E;this.accessibilityManager.setDetails({offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(E=this.props.margin.top)!==null&&E!==void 0?E:0}})}return null}},{key:"componentDidUpdate",value:function(b){M1([Ei(b.children,So)],[Ei(this.props.children,So)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var b=Ei(this.props.children,So);if(b&&typeof b.props.shared=="boolean"){var S=b.props.shared?"axis":"item";return s.indexOf(S)>=0?S:o}return o}},{key:"getMouseInfo",value:function(b){if(!this.container)return null;var S=this.container,w=S.getBoundingClientRect(),E=eSe(w),T={chartX:Math.round(b.pageX-E.left),chartY:Math.round(b.pageY-E.top)},A=w.width/S.offsetWidth||1,M=this.inRange(T.chartX,T.chartY,A);if(!M)return null;var C=this.state,P=C.xAxisMap,R=C.yAxisMap,D=this.getTooltipEventType(),k=uk(this.state,this.props.data,this.props.layout,M);if(D!=="axis"&&P&&R){var U=Cu(P).scale,O=Cu(R).scale,W=U&&U.invert?U.invert(T.chartX):null,L=O&&O.invert?O.invert(T.chartY):null;return ve(ve({},T),{},{xValue:W,yValue:L},k)}return k?ve(ve({},T),k):null}},{key:"inRange",value:function(b,S){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,E=this.props.layout,T=b/w,A=S/w;if(E==="horizontal"||E==="vertical"){var M=this.state.offset,C=T>=M.left&&T<=M.left+M.width&&A>=M.top&&A<=M.top+M.height;return C?{x:T,y:A}:null}var P=this.state,R=P.angleAxisMap,D=P.radiusAxisMap;if(R&&D){var k=Cu(R);return XD({x:T,y:A},k)}return null}},{key:"parseEventsOfWrapper",value:function(){var b=this.props.children,S=this.getTooltipEventType(),w=Ei(b,So),E={};w&&S==="axis"&&(w.props.trigger==="click"?E={onClick:this.handleClick}:E={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var T=ky(this.props,this.handleOuterEvent);return ve(ve({},T),E)}},{key:"addListener",value:function(){aS.on(sS,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){aS.removeListener(sS,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(b,S,w){for(var E=this.state.formattedGraphicalItems,T=0,A=E.length;T{var v,g;const[i,o]=_.useState([]),[a,s]=_.useState([]),l=_.useRef(0),{baseUrl:c,fetchWithHeaders:u}=Ln();_.useEffect(()=>{let m=!1;return hZ(c,u,t).then(x=>{var E;if(m||x.length===0)return;const b=x.filter(T=>T.loss!=null).map(T=>({step:T.step,loss:T.loss})).slice(-2e3),S=x.filter(T=>T.lr!=null).map(T=>({step:T.step,lr:T.lr})).slice(-2e3);o(b),s(S);const w=((E=x[x.length-1])==null?void 0:E.step)??0;l.current=w}).catch(()=>{}),()=>{m=!0}},[c,u,t]),_.useEffect(()=>{const m=e.current_step;if(m0&&e.current_loss!=null){const x=e.current_loss;o(b=>{const S=b[b.length-1];return S&&S.step===m?b:[...b,{step:m,loss:x}].slice(-2e3)})}if(m>0&&e.current_lr!=null){const x=e.current_lr;s(b=>{const S=b[b.length-1];return S&&S.step===m?b:[...b,{step:m,lr:x}].slice(-2e3)})}},[e.current_step,e.current_loss,e.current_lr]);const d=n(),f=e.training_active&&e.total_steps===0,p=f?"Training startingโ€ฆ":`${e.current_step.toLocaleString()} / ${e.total_steps.toLocaleString()}`,y=e.eta_seconds!=null?r(e.eta_seconds):"โ€”";return h.jsxs("div",{className:"space-y-6",children:[h.jsx(Gr,{className:"bg-slate-800/50 border-slate-700 rounded-xl",children:h.jsxs(Wr,{className:"p-6",children:[h.jsxs("div",{className:"flex items-baseline justify-between mb-3",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg bg-blue-500/20 text-blue-400",children:h.jsx($u,{className:"w-5 h-5"})}),h.jsxs("div",{children:[h.jsx("h3",{className:"text-sm text-slate-400",children:"Progress"}),h.jsx("div",{className:"text-base font-semibold text-white",children:p})]})]}),h.jsxs("div",{className:"flex items-center gap-2 text-slate-300",children:[h.jsx(dE,{className:"w-4 h-4 text-purple-400"}),h.jsxs("span",{className:"text-sm",children:["ETA ",h.jsx("span",{className:"font-semibold text-white",children:y})]})]})]}),h.jsxs("div",{className:"relative h-8 w-full overflow-hidden rounded-md bg-slate-900 border border-slate-700",children:[h.jsx("div",{className:"h-full bg-gradient-to-r from-blue-500 to-sky-400 transition-[width] duration-500",style:{width:`${d}%`}}),h.jsx("div",{className:"absolute inset-0 flex items-center justify-center font-semibold text-white text-sm tabular-nums drop-shadow",children:f?"warming upโ€ฆ":`${d.toFixed(1)}%`})]})]})}),h.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[h.jsxs(Gr,{className:"bg-slate-800/50 border-slate-700 rounded-xl",children:[h.jsx(jo,{className:"pb-2",children:h.jsxs(ha,{className:"flex items-center gap-3 text-white text-base",children:[h.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-green-500/20 text-green-400",children:h.jsx(qi,{className:"w-4 h-4"})}),h.jsxs("span",{children:["Loss"," ",h.jsxs("span",{className:"text-slate-400 text-sm font-normal",children:["(",((v=e.current_loss)==null?void 0:v.toFixed(4))??"โ€”",")"]})]})]})}),h.jsx(Wr,{className:"pt-0",children:h.jsx("div",{className:"h-48",children:i.length===0?h.jsx("div",{className:"flex h-full items-center justify-center text-slate-500 text-sm",children:"Waiting for first metric tickโ€ฆ"}):h.jsx(LI,{width:"100%",height:"100%",children:h.jsxs(hk,{data:i,margin:{top:8,right:12,left:0,bottom:0},children:[h.jsx(dm,{dataKey:"step",tick:{fill:"#94a3b8",fontSize:11},stroke:"#475569"}),h.jsx(fm,{tick:{fill:"#94a3b8",fontSize:11},stroke:"#475569",width:48}),h.jsx(So,{contentStyle:{background:"#1e293b",border:"1px solid #475569",borderRadius:8},labelStyle:{color:"#cbd5e1"},itemStyle:{color:"#34d399"},formatter:m=>m.toFixed(4)}),h.jsx(lf,{type:"monotone",dataKey:"loss",stroke:"#34d399",strokeWidth:2,dot:!1,isAnimationActive:!1})]})})})})]}),h.jsxs(Gr,{className:"bg-slate-800/50 border-slate-700 rounded-xl",children:[h.jsx(jo,{className:"pb-2",children:h.jsxs(ha,{className:"flex items-center gap-3 text-white text-base",children:[h.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-orange-500/20 text-orange-400",children:h.jsx($u,{className:"w-4 h-4"})}),h.jsxs("span",{children:["Learning Rate"," ",h.jsxs("span",{className:"text-slate-400 text-sm font-normal",children:["(",((g=e.current_lr)==null?void 0:g.toExponential(2))??"โ€”",")"]})]})]})}),h.jsx(Wr,{className:"pt-0",children:h.jsx("div",{className:"h-48",children:a.length===0?h.jsx("div",{className:"flex h-full items-center justify-center text-slate-500 text-sm",children:"Waiting for first metric tickโ€ฆ"}):h.jsx(LI,{width:"100%",height:"100%",children:h.jsxs(hk,{data:a,margin:{top:8,right:12,left:0,bottom:0},children:[h.jsx(dm,{dataKey:"step",tick:{fill:"#94a3b8",fontSize:11},stroke:"#475569"}),h.jsx(fm,{tick:{fill:"#94a3b8",fontSize:11},stroke:"#475569",width:48,tickFormatter:m=>m.toExponential(0)}),h.jsx(So,{contentStyle:{background:"#1e293b",border:"1px solid #475569",borderRadius:8},labelStyle:{color:"#cbd5e1"},itemStyle:{color:"#fb923c"},formatter:m=>m.toExponential(2)}),h.jsx(lf,{type:"monotone",dataKey:"lr",stroke:"#fb923c",strokeWidth:2,dot:!1,isAnimationActive:!1})]})})})})]})]})]})},XIe=({logs:t,logContainerRef:e})=>h.jsxs(Gr,{className:"bg-slate-800/50 border-slate-700 rounded-xl",children:[h.jsx(jo,{children:h.jsxs(ha,{className:"flex items-center gap-3 text-white",children:[h.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-slate-700",children:h.jsx(q7,{className:"w-5 h-5 text-sky-400"})}),"Training Logs"]})}),h.jsx(Wr,{children:h.jsx("div",{ref:e,className:"bg-slate-900 rounded-lg p-4 h-96 overflow-y-auto font-mono text-sm border border-slate-700",children:t.length===0?h.jsx("div",{className:"text-slate-500 py-8",children:"No training logs yet. Start training to see output."}):t.map((n,r)=>h.jsxs("div",{className:"text-slate-300 break-words whitespace-pre-wrap",children:[h.jsx("span",{className:"text-slate-500 mr-2 select-none",children:new Date(n.timestamp*1e3).toLocaleTimeString()}),n.message]},r))})})]}),qIe=({installHint:t})=>{const e=kz("system/training-extra");return h.jsx("div",{className:"max-w-3xl mx-auto",children:h.jsxs(Gr,{className:"bg-slate-800/50 border-slate-700 rounded-xl",children:[h.jsx(jo,{children:h.jsxs(ha,{className:"flex items-center gap-3 text-white",children:[h.jsx(Uz,{state:e.state}),jz(e.state,"Training Extra Not Installed")]})}),h.jsx(Wr,{className:"space-y-4",children:h.jsx(Fz,{state:e.state,error:e.error,logs:e.logs,logBoxRef:e.logBoxRef,onInstall:e.handleInstall,onRetry:e.handleRetry,installHint:t,packageName:"accelerate",idleTitle:"Training Extra Not Installed",idleDescription:h.jsxs(h.Fragment,{children:["Training requires the"," ",h.jsx("code",{className:"px-1 py-0.5 rounded bg-slate-900 text-sky-300",children:"accelerate"})," ","package, which isn't installed in this environment. Install it to enable the Training page."]}),doneDescription:h.jsx(Bz,{purpose:"training"})})})]})})},KIe=()=>{const{auth:t,refetch:e}=xf(),{baseUrl:n,fetchWithHeaders:r}=Ln(),[i,o]=_.useState(""),[a,s]=_.useState(!1),[l,c]=_.useState(null);if(t.status==="authenticated"||t.status==="loading")return null;const u=async()=>{const d=i.trim();if(d){s(!0),c(null);try{const f=await r(`${n}/hf-auth/login`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:d})});if(!f.ok){const p=await f.json().catch(()=>({}));throw new Error(p.detail||`HTTP ${f.status}`)}o(""),await e()}catch(f){c(f instanceof Error?f.message:String(f))}finally{s(!1)}}};return h.jsx("div",{className:"bg-amber-950/40 border border-amber-700/60 rounded-lg p-4 mb-6",children:h.jsxs("div",{className:"flex items-start gap-3",children:[h.jsx(td,{className:"w-5 h-5 text-amber-400 flex-shrink-0 mt-0.5"}),h.jsxs("div",{className:"flex-1 space-y-3",children:[h.jsxs("div",{children:[h.jsx("p",{className:"text-sm text-amber-100 font-medium",children:"Hugging Face access required for cloud training"}),h.jsxs("p",{className:"text-xs text-amber-200/80 mt-1",children:["Create a token at"," ",h.jsxs("a",{href:"https://huggingface.co/settings/tokens",target:"_blank",rel:"noreferrer",className:"underline hover:text-amber-50 inline-flex items-center gap-1",children:["huggingface.co/settings/tokens",h.jsx(ll,{className:"w-3 h-3"})]})," ","with ",h.jsx("span",{className:"font-mono",children:"Write"})," access (so trained policies can upload to your account), then paste it below."]})]}),h.jsxs("form",{onSubmit:d=>{d.preventDefault(),u()},className:"flex gap-2",children:[h.jsx(hi,{type:"password",placeholder:"hf_...",value:i,onChange:d=>o(d.target.value),className:"bg-slate-900 border-slate-600 text-white placeholder:text-slate-500",disabled:a,autoComplete:"off"}),h.jsx(et,{type:"submit",disabled:a||!i.trim(),className:"bg-amber-600 hover:bg-amber-700 text-white",children:a?h.jsxs(h.Fragment,{children:[h.jsx(fi,{className:"w-4 h-4 mr-2 animate-spin"}),"Savingโ€ฆ"]}):"Save token"})]}),l&&h.jsx("p",{className:"text-xs text-red-300",children:l})]})]})})},YIe=1e3,pk=5e3;function JIe(t,e){return t?{training_active:t.state==="running",current_step:t.metrics.current_step,total_steps:t.metrics.total_steps,current_loss:t.metrics.current_loss??void 0,current_lr:t.metrics.current_lr??void 0,grad_norm:t.metrics.grad_norm??void 0,eta_seconds:t.metrics.eta_seconds??void 0,available_controls:{stop_training:t.state==="running",pause_training:!1,resume_training:!1}}:{training_active:e,current_step:0,total_steps:0,available_controls:{stop_training:!1,pause_training:!1,resume_training:!1}}}function ZIe(t){return{target:t.target,dataset_repo_id:t.dataset_repo_id,policy_type:t.policy_type,steps:t.steps,batch_size:t.batch_size,seed:t.seed,num_workers:t.num_workers,log_freq:t.log_freq,save_freq:t.save_freq,save_checkpoint:t.save_checkpoint,resume:t.resume,wandb_enable:t.wandb_enable,wandb_project:t.wandb_project,wandb_entity:t.wandb_entity,wandb_notes:t.wandb_notes,wandb_mode:t.wandb_mode,wandb_disable_artifact:t.wandb_disable_artifact,policy_device:t.policy_device,policy_use_amp:t.policy_use_amp,optimizer_type:t.optimizer_type,optimizer_lr:t.optimizer_lr,optimizer_weight_decay:t.optimizer_weight_decay,optimizer_grad_clip_norm:t.optimizer_grad_clip_norm,use_policy_training_preset:t.use_policy_training_preset}}const QIe=()=>{var Q;const{baseUrl:t,fetchWithHeaders:e}=Ln(),{auth:n}=xf(),{toast:r}=Dr(),i=ji(),a=((Q=vl().state)==null?void 0:Q.datasetRepoId)??"",[s,l]=_.useState({target:{runner:"local"},dataset_repo_id:a,policy_type:"act",steps:1e4,batch_size:8,seed:1e3,num_workers:4,log_freq:250,save_freq:1e3,save_checkpoint:!0,resume:!1,wandb_enable:!1,wandb_mode:"online",wandb_disable_artifact:!1,policy_device:"cuda",policy_use_amp:!1,optimizer_type:"adam",use_policy_training_preset:!0}),[c,u]=_.useState([]),[d,f]=_.useState(!0),[p,y]=_.useState(null),[v,g]=_.useState("pip install accelerate"),[m,x]=_.useState(!1),[b,S]=_.useState(!1),[w,E]=_.useState(!1),[T,A]=_.useState([]),[M,C]=_.useState([]),[P,R]=_.useState(!0),[D,k]=_.useState("https://sensecraft-gpu.seeed.cc/lelab/connect"),[U,O]=_.useState(!1);_.useEffect(()=>{f(!0),g4(t,e).then(u).catch(()=>u([])).finally(()=>f(!1))},[t,e]),_.useEffect(()=>{e(`${t}/system/training-extra`).then(te=>te.json()).then(te=>{y(te.available),g(te.install_hint)}).catch(()=>y(!0))},[t,e]),_.useEffect(()=>{ME(t,e,200).then(te=>x(te.some(ee=>ee.runner==="local"&&ee.state==="running"))).catch(()=>x(!1))},[t,e]),_.useEffect(()=>{R(!0),TN(t,e).then(te=>{E(te.authenticated),A(te.flavors??[]),C(te.providers??[])}).catch(()=>{E(!1),A([]),C([])}).finally(()=>R(!1))},[t,e,n.status]),_.useEffect(()=>{vZ(t,e).then(te=>{const ee=te.web_url||"https://sensecraft-gpu.seeed.cc";k(`${ee.replace(/\/$/,"")}/lelab/connect`)}).catch(()=>k("https://sensecraft-gpu.seeed.cc/lelab/connect"))},[t,e]);const W=(te,ee)=>{l(ce=>({...ce,[te]:ee}))},L=async()=>{if(!s.dataset_repo_id.trim()){r({title:"Error",description:"Dataset repository ID is required",variant:"destructive"});return}S(!0);try{const te=await pZ(t,e,ZIe(s));r({title:"Training Started",description:te.name}),i(`/training/${te.id}`)}catch(te){const ee=te instanceof Error?te.message:String(te);r({title:"Error",description:ee,variant:"destructive"}),ME(t,e,200).then(ce=>x(ce.some(ae=>ae.runner==="local"&&ae.state==="running"))).catch(()=>{})}finally{S(!1)}},j=()=>{O(!0);const te=window.open(D,"lelab-seeed-cloud","width=520,height=720");if(!te){O(!1),r({title:"Seeed Cloud",description:"Browser blocked the connection window.",variant:"destructive"});return}const ee=window.setTimeout(()=>{window.removeEventListener("message",ae),O(!1)},12e4),ce=async(fe,we,le)=>{try{await yZ(t,e,{token:fe,api_url:we,web_url:le});const ie=await TN(t,e);E(ie.authenticated),A(ie.flavors??[]),C(ie.providers??[]),r({title:"Seeed Cloud connected",description:"GPU flavors are available now."})}catch(ie){const G=ie instanceof Error?ie.message:String(ie);r({title:"Seeed Cloud",description:G,variant:"destructive"})}finally{window.clearTimeout(ee),window.removeEventListener("message",ae),O(!1),te.close()}};function ae(fe){const we=new URL(D).origin;if(fe.origin!==we)return;const le=fe.data;(le==null?void 0:le.type)!=="seeed-cloud-token"||!le.token||ce(le.token,le.apiUrl,le.webUrl)}window.addEventListener("message",ae)};if(p===null)return h.jsx("div",{className:"min-h-screen bg-slate-900 text-white p-4",children:h.jsxs("div",{className:"max-w-7xl mx-auto",children:[h.jsx(Dw,{}),h.jsxs("div",{className:"flex items-center justify-center py-24 text-slate-400",children:[h.jsx(fi,{className:"w-6 h-6 animate-spin mr-3"}),"Checking training environmentโ€ฆ"]})]})});if(p===!1)return h.jsx("div",{className:"min-h-screen bg-slate-900 text-white p-4",children:h.jsxs("div",{className:"max-w-7xl mx-auto",children:[h.jsx(Dw,{}),h.jsx(qIe,{installHint:v})]})});const X=s.target.runner==="hf_cloud",K=(s.target.runner==="hf_cloud"||s.target.runner==="seeed_cloud"||s.target.runner==="external")&&!s.target.flavor,F=s.target.runner==="local"&&m,Y=b||!s.dataset_repo_id.trim()||F||X&&!w||K,q=F?"Another local training is already running":X&&!w?"Log in to Hugging Face to use cloud compute":K?"Select a hardware flavor":void 0;return h.jsx("div",{className:"min-h-screen bg-slate-900 text-white p-4",children:h.jsxs("div",{className:"max-w-7xl mx-auto",children:[h.jsx(Dw,{}),h.jsx(KIe,{}),h.jsx(kce,{config:s,updateConfig:W,datasets:c,datasetsLoading:d,authenticated:w,flavors:T,providers:M,hardwareLoading:P,seeedConnecting:U,onConnectSeeedCloud:j}),h.jsx("div",{className:"max-w-3xl mx-auto mt-6 flex justify-end",children:(()=>{const te=h.jsx(et,{onClick:L,disabled:Y,size:"lg",className:"bg-green-500 hover:bg-green-600 text-white font-semibold px-6",children:b?h.jsxs(h.Fragment,{children:[h.jsx(fi,{className:"w-5 h-5 mr-2 animate-spin"})," Startingโ€ฆ"]}):h.jsxs(h.Fragment,{children:[h.jsx(Tc,{className:"w-5 h-5 mr-2"})," Start Training"]})});return q?h.jsxs(jv,{children:[h.jsx(Uv,{asChild:!0,children:h.jsx("span",{tabIndex:0,children:te})}),h.jsx(Vh,{children:q})]}):te})()})]})})},eDe=({jobId:t})=>{const{baseUrl:e,fetchWithHeaders:n}=Ln(),{toast:r}=Dr(),i=ji(),{selectedRecord:o}=jA(),[a,s]=_.useState(null),[l,c]=_.useState(null),[u,d]=_.useState([]),f=_.useRef(null),[p,y]=_.useState([]),[v,g]=_.useState(null),[m,x]=_.useState(!1);_.useEffect(()=>{let M=!1;return fZ(e,n,t).then(C=>{!M&&C.length>0&&d(C)}).catch(()=>{}),()=>{M=!0}},[e,n,t]);const b=_.useRef(a==null?void 0:a.state);b.current=a==null?void 0:a.state,_.useEffect(()=>{let M=!1;const C=()=>{LA(e,n,t).then(R=>{if(!M)if(y(R),R.length>0){const D=R[R.length-1].step;g(k=>k!=null&&R.some(U=>U.step===k)?k:D)}else g(null)}).catch(()=>{M||(y([]),g(null))})};C();const P=setInterval(()=>{M||b.current&&b.current!=="running"||C()},5e3);return()=>{M=!0,clearInterval(P)}},[e,n,t]),_.useEffect(()=>{let M=!1;const C=async()=>{try{const R=await uZ(e,n,t);if(M)return;if(s(R),R.state==="running"){const D=await dZ(e,n,t);!M&&D.length>0&&d(k=>{const U=[...k,...D];return U.length>pk?U.slice(U.length-pk):U})}}catch(R){M||c(R instanceof Error?R.message:String(R))}};C();const P=setInterval(()=>{M||b.current&&b.current!=="running"||C()},YIe);return()=>{M=!0,clearInterval(P)}},[e,n,t]),_.useEffect(()=>{f.current&&(f.current.scrollTop=f.current.scrollHeight)},[u]);const S=M=>{const C=Math.floor(M/3600),P=Math.floor(M%3600/60),R=Math.floor(M%60);return`${C.toString().padStart(2,"0")}:${P.toString().padStart(2,"0")}:${R.toString().padStart(2,"0")}`},w=()=>!a||a.metrics.total_steps===0?0:a.metrics.current_step/a.metrics.total_steps*100,E=async()=>{if(a&&window.confirm("Stop this run?"))try{const M=await h4(e,n,a.id);s(M),r({title:"Stoppingโ€ฆ"})}catch(M){r({title:"Stop failed",description:M instanceof Error?M.message:String(M),variant:"destructive"})}},T=async()=>{if(a&&window.confirm("Delete this run? This wipes the output directory."))try{await p4(e,n,a.id),r({title:"Job removed"}),i("/")}catch(M){r({title:"Delete failed",description:M instanceof Error?M.message:String(M),variant:"destructive"})}};if(l&&!a)return h.jsx("div",{className:"min-h-screen bg-slate-900 text-white p-4",children:h.jsxs("div",{className:"max-w-7xl mx-auto space-y-4",children:[h.jsxs(et,{variant:"ghost",onClick:()=>i("/"),className:"text-slate-400",children:[h.jsx(sl,{className:"w-4 h-4 mr-2"})," Back to Jobs"]}),h.jsxs("p",{className:"text-red-300",children:["Couldn't load job ",t,": ",l]})]})});if(!a)return h.jsx("div",{className:"min-h-screen bg-slate-900 text-white p-4",children:h.jsxs("div",{className:"max-w-7xl mx-auto flex items-center justify-center py-24 text-slate-400",children:[h.jsx(fi,{className:"w-6 h-6 animate-spin mr-3"})," Loading jobโ€ฆ"]})});const A=a.state==="running";return h.jsx("div",{className:"min-h-screen bg-slate-900 text-white p-4",children:h.jsxs("div",{className:"max-w-7xl mx-auto space-y-6",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs(et,{variant:"ghost",onClick:()=>i("/"),className:"text-slate-400 hover:text-white",children:[h.jsx(sl,{className:"w-4 h-4 mr-2"})," Jobs"]}),h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("h1",{className:"text-xl font-semibold text-white",children:a.name}),a.runner==="hf_cloud"?h.jsxs("span",{className:"text-xs px-2 py-0.5 rounded bg-amber-900/40 text-amber-200 border border-amber-700",children:["HF ยท ",a.hf_flavor??"cloud"]}):a.runner==="seeed_cloud"||a.runner==="external"?h.jsxs("span",{className:"text-xs px-2 py-0.5 rounded bg-emerald-900/40 text-emerald-200 border border-emerald-700",children:[a.runner==="seeed_cloud"?"Seeed":a.external_provider??"External"," ยท"," ",a.external_flavor??"GPU"]}):h.jsx("span",{className:"text-xs px-2 py-0.5 rounded bg-slate-700 text-slate-200 border border-slate-600",children:"Local"}),a.runner==="hf_cloud"&&a.hf_repo_id&&a.state==="done"&&h.jsx("a",{href:`https://huggingface.co/${a.hf_repo_id}`,target:"_blank",rel:"noreferrer",className:"text-xs text-amber-300 hover:text-amber-200 underline",children:"View on Hub โ†—"}),(a.runner==="seeed_cloud"||a.runner==="external")&&a.external_job_url&&h.jsx("a",{href:a.external_job_url,target:"_blank",rel:"noreferrer",className:"text-xs text-emerald-300 hover:text-emerald-200 underline",children:"View provider job โ†—"}),a.wandb_run_url&&h.jsx("a",{href:a.wandb_run_url,target:"_blank",rel:"noreferrer",className:"text-xs text-yellow-300 hover:text-yellow-200 underline",children:"View on W&B โ†—"})]}),h.jsxs("p",{className:"text-xs text-slate-400",children:[a.state,a.error_message?` โ€” ${a.error_message}`:""]})]})]}),A?h.jsxs(et,{onClick:E,className:"bg-red-500 hover:bg-red-600 text-white",children:[h.jsx(Od,{className:"w-4 h-4 mr-2"})," Stop"]}):h.jsxs(et,{onClick:T,variant:"ghost",className:"text-slate-400 hover:text-white",children:[h.jsx(nA,{className:"w-4 h-4 mr-2"})," Delete"]})]}),h.jsx(WIe,{jobId:t,trainingStatus:JIe(a,!1),getProgressPercentage:w,formatTime:S}),h.jsxs("div",{className:"bg-slate-800/40 border border-slate-700 rounded-lg p-4 flex items-center gap-3",children:[h.jsx("span",{className:"text-sm font-semibold text-slate-300",children:"Run inference"}),p.length===0?h.jsx("span",{className:"text-xs text-slate-500",children:"No checkpoints yet โ€” wait for the first save."}):h.jsxs(h.Fragment,{children:[h.jsx(kA,{checkpoints:p,selectedStep:v,onChange:g}),h.jsxs(et,{onClick:()=>x(!0),disabled:v==null,className:"bg-green-500 hover:bg-green-600 text-white",children:[h.jsx(Tc,{className:"w-4 h-4 mr-2"}),"Run on robot"]})]})]}),h.jsx(m4,{open:m,onOpenChange:x,robot:o,jobId:t,initialStep:v}),h.jsx(XIe,{logs:u,logContainerRef:f})]})})},mk=()=>{const{jobId:t}=g6();return t?h.jsx(eDe,{jobId:t}):h.jsx(QIe,{})},tDe=1e3;function gk(t){const e=Math.max(0,Math.floor(t)),n=Math.floor(e/60),r=e%60;return`${String(n).padStart(2,"0")}:${String(r).padStart(2,"0")}`}const nDe=()=>{const t=ji(),{baseUrl:e,fetchWithHeaders:n}=Ln(),{toast:r}=Dr(),[i,o]=_.useState(null),[a,s]=_.useState(!1),l=_.useRef(!1),c=_.useRef(!1);_.useEffect(()=>{let b=!1;const S=async()=>{try{await CN(e,n)}catch{}},w=async()=>{try{const T=await RZ(e,n);if(b)return;if(o(T),!T.inference_active&&!l.current){l.current=!0,T.exited&&r({title:"Inference finished",description:T.exit_code===0?"Run completed.":`Exit code ${T.exit_code}. See ${T.log_path}.`,variant:T.exit_code===0?"default":"destructive"}),t("/");return}T.inference_active&&T.rollout_started_at!=null&&T.duration_s!=null&&T.duration_s>0&&T.rollout_elapsed_s>T.duration_s+10&&!c.current&&(c.current=!0,r({title:"Inference seems hung",description:`Rollout past duration by ${Math.round(T.rollout_elapsed_s-T.duration_s)}s. Stopping.`,variant:"destructive"}),S())}catch(T){b||r({title:"Lost connection to backend",description:T instanceof Error?T.message:String(T),variant:"destructive"})}};w();const E=setInterval(w,tDe);return()=>{b=!0,clearInterval(E)}},[e,n,t,r]);const u=async()=>{s(!1);try{await CN(e,n)}catch(b){r({title:"Stop failed",description:b instanceof Error?b.message:String(b),variant:"destructive"})}};if(!i)return h.jsxs("div",{className:"min-h-screen bg-black text-white flex items-center justify-center",children:[h.jsx(fi,{className:"w-6 h-6 animate-spin mr-3"})," Connecting to inferenceโ€ฆ"]});const d=i.elapsed_s??0,f=i.rollout_elapsed_s??0,p=i.duration_s??0,y=i.inference_active&&i.rollout_started_at==null,v=i.inference_active&&i.rollout_started_at!=null,g=v&&p>0?Math.min(100,f/p*100):0,m=y?"SETTING UP":v?"RUNNING":"FINISHED",x=v?f:d;return h.jsxs("div",{className:"min-h-screen bg-black text-white flex flex-col p-4 sm:p-6 lg:p-8",children:[h.jsxs("div",{className:"flex items-center gap-4 mb-8",children:[h.jsx(et,{variant:"ghost",size:"icon",onClick:()=>t("/"),className:"text-slate-400 hover:bg-slate-800 hover:text-white rounded-lg",children:h.jsx(sl,{className:"w-5 h-5"})}),h.jsx(Hx,{}),h.jsx("h1",{className:"font-bold text-white text-2xl",children:"Inference"})]}),h.jsx("div",{className:"flex-1 flex items-center justify-center",children:h.jsxs("div",{className:"bg-gray-900 rounded-lg border border-gray-700 p-8 w-full max-w-xl",children:[h.jsx("div",{className:"text-center mb-6",children:h.jsxs("div",{className:`inline-flex items-center gap-2 px-3 py-1 rounded-full text-xs font-bold tracking-widest ${y?"bg-amber-500/15 text-amber-300":"bg-green-500/15 text-green-300"}`,children:[h.jsx("span",{className:`w-2 h-2 rounded-full ${y?"bg-amber-500":"bg-green-500"} animate-pulse`}),m]})}),h.jsxs("div",{className:"text-center mb-4",children:[h.jsx("div",{className:`text-7xl font-mono font-bold leading-none ${y?"text-amber-400":"text-green-400"}`,children:gk(x)}),h.jsx("div",{className:"text-sm text-gray-500 mt-2",children:y?"Loading policy & connecting hardwareโ€ฆ":`/ ${gk(p)}`})]}),h.jsx("div",{className:"w-full bg-gray-800 rounded-full h-1.5 mb-8",children:h.jsx("div",{className:`h-1.5 rounded-full transition-all duration-500 ${y?"bg-amber-500/40 animate-pulse w-full":"bg-green-500"}`,style:y?void 0:{width:`${g}%`}})}),h.jsxs("div",{className:"text-xs text-slate-500 break-all mb-6",children:["policy: ",i.policy_ref??"(unknown)"]}),h.jsxs(et,{onClick:()=>s(!0),disabled:!i.inference_active,className:"w-full bg-red-500 hover:bg-red-600 text-white font-semibold py-6 text-lg disabled:opacity-50",children:[h.jsx(Od,{className:"w-5 h-5 mr-2"}),"Stop"]})]})}),h.jsx(mC,{open:a,onOpenChange:s,children:h.jsxs(Xx,{className:"bg-gray-900 border-gray-700 text-white",children:[h.jsxs(qx,{children:[h.jsx(Yx,{children:"Stop inference?"}),h.jsx(Jx,{className:"text-gray-400",children:"The follower will hold its current pose. You can launch another run from the job tile."})]}),h.jsxs(Kx,{children:[h.jsx(Qx,{className:"bg-gray-800 border-gray-700 text-white hover:bg-gray-700",children:"Keep running"}),h.jsx(Zx,{onClick:u,className:"bg-red-500 hover:bg-red-600 text-white",children:"Stop"})]})]})})]})},rDe=()=>h.jsxs("div",{className:"min-h-screen bg-black text-white flex flex-col items-center justify-center p-4",children:[h.jsx("h1",{className:"text-5xl font-bold tracking-tight",children:"Edit Dataset"}),h.jsx("p",{className:"mt-4 text-xl text-gray-400",children:"This page is under construction."})]}),iDe=()=>{var R;const t=vl(),e=ji(),{toast:n}=Dr(),{baseUrl:r,fetchWithHeaders:i}=Ln(),o=(R=t.state)==null?void 0:R.datasetInfo,[a,s]=_.useState(null),[l,c]=_.useState(!0),[u,d]=_.useState({tags:["robotics","lerobot"],private:!1}),[f,p]=_.useState(u.tags.join(", ")),[y,v]=_.useState(!1),[g,m]=_.useState(!1),[x,b]=_.useState(!1),[S,w]=_.useState(!1);Z.useEffect(()=>{(async()=>{if(!(o!=null&&o.dataset_repo_id)){n({title:"No Dataset Information",description:"Please complete a recording session first.",variant:"destructive"}),e("/");return}try{const k=await i(`${r}/dataset-info`,{method:"POST",body:JSON.stringify({dataset_repo_id:o.dataset_repo_id})}),U=await k.json();k.ok&&U.success?s({...U,saved_episodes:U.num_episodes,session_elapsed_seconds:o.session_elapsed_seconds||0,source:o.source}):(n({title:"Warning",description:"Could not load complete dataset information. Using session data.",variant:"destructive"}),s(o))}catch(k){console.error("Error loading dataset info:",k),n({title:"Warning",description:"Could not connect to backend. Using session data.",variant:"destructive"}),s(o)}finally{c(!1)}})()},[o,e,n]);const E=D=>{const k=`/spaces/lerobot/visualize_dataset?path=${encodeURIComponent(`/${D}`)}`,U=`https://huggingface.co/login?next=${encodeURIComponent(k)}`;window.open(U,"_blank","noopener,noreferrer")},T=D=>{const k=Math.floor(D/3600),U=Math.floor(D%3600/60),O=D%60;return k>0?`${k}h ${U}m ${O}s`:U>0?`${U}m ${O}s`:`${O}s`},A=async()=>{if(a){v(!0);try{const D=f.split(",").map(O=>O.trim()).filter(O=>O.length>0),k=await i(`${r}/upload-dataset`,{method:"POST",body:JSON.stringify({dataset_repo_id:a.dataset_repo_id,tags:D,private:u.private})}),U=await k.json();if(k.ok&&U.success)m(!0),n({title:"Upload Successful!",description:`Dataset ${a.dataset_repo_id} has been uploaded to HuggingFace Hub.`});else{const O="Failed to upload dataset to HuggingFace Hub.";n({title:"Upload Failed",description:U.docs_url?h.jsxs("span",{children:[U.message||O," ",h.jsx("a",{href:U.docs_url,target:"_blank",rel:"noopener noreferrer",className:"underline font-medium",children:"Open setup guide"})]}):U.message||O,variant:"destructive"})}}catch(D){console.error("Error uploading dataset:",D),n({title:"Connection Error",description:"Could not connect to the backend server.",variant:"destructive"})}finally{v(!1)}}},M=()=>{n({title:"Upload Skipped",description:"Dataset saved locally. You can upload it manually later."}),e("/")},C=async()=>{if(a){w(!0);try{const D=await i(`${r}/delete-dataset`,{method:"POST",body:JSON.stringify({dataset_repo_id:a.dataset_repo_id})}),k=await D.json();D.ok&&k.success?(n({title:"Dataset Deleted",description:`${a.dataset_repo_id} has been removed from disk.`}),e("/")):n({title:"Delete Failed",description:k.message||"Could not delete the dataset.",variant:"destructive"})}catch{n({title:"Connection Error",description:"Could not connect to the backend server.",variant:"destructive"})}finally{w(!1),b(!1)}}};if(l||!a)return h.jsx("div",{className:"min-h-screen bg-black text-white flex items-center justify-center",children:h.jsxs("div",{className:"text-center",children:[h.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-500 mx-auto mb-4"}),h.jsx("p",{className:"text-lg",children:"Loading dataset information..."})]})});const P=a.source==="both";return h.jsxs("div",{className:"min-h-screen bg-black text-white p-8",children:[h.jsxs("div",{className:"max-w-4xl mx-auto",children:[h.jsxs("div",{className:"flex items-center justify-between mb-8",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs(et,{onClick:()=>e("/"),variant:"outline",className:"border-gray-500 hover:border-gray-200 text-gray-300 hover:text-white",children:[h.jsx(sl,{className:"w-4 h-4 mr-2"}),"Back to Home"]}),h.jsx(et,{onClick:()=>b(!0),variant:"outline",size:"icon",disabled:S,"aria-label":"Delete dataset from disk",className:"border-red-500/40 text-red-400 hover:border-red-400 hover:text-red-300 hover:bg-red-500/10",children:h.jsx(nA,{className:"w-4 h-4"})})]}),h.jsxs("div",{className:"flex items-center gap-3",children:[g?h.jsx(qi,{className:"w-8 h-8 text-green-500"}):h.jsx(V7,{className:"w-8 h-8 text-blue-500"}),h.jsx("h1",{className:"text-3xl font-bold",children:g?"Upload Complete":"Dataset Upload"})]})]}),g&&h.jsxs("div",{className:"bg-green-900/20 border border-green-600 rounded-lg p-6 mb-8",children:[h.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[h.jsx(qi,{className:"w-6 h-6 text-green-500"}),h.jsx("h2",{className:"text-xl font-semibold text-green-400",children:"Successfully Uploaded!"})]}),h.jsx("p",{className:"text-gray-300 mb-4",children:"Your dataset has been uploaded to HuggingFace Hub and is now available for training and sharing."}),h.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[h.jsxs(et,{onClick:()=>{const D=`/spaces/lerobot/visualize_dataset?path=${encodeURIComponent(`/${a.dataset_repo_id}`)}`,k=u.private?`https://huggingface.co/login?next=${encodeURIComponent(D)}`:`https://huggingface.co${D}`;window.open(k,"_blank","noopener,noreferrer")},className:"bg-blue-500 hover:bg-blue-600 text-white",children:[h.jsx(ll,{className:"w-4 h-4 mr-2"}),"View on HuggingFace Hub"]}),h.jsx(et,{onClick:()=>e("/training",{state:{datasetRepoId:a.dataset_repo_id}}),className:"bg-purple-500 hover:bg-purple-600 text-white",children:"Start Training"})]})]}),!g&&h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"bg-gray-900 rounded-lg p-6 border border-gray-700 mb-8",children:[h.jsx("h2",{className:"text-xl font-semibold text-white mb-4",children:"Dataset Summary"}),h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-400",children:"Repository ID:"}),h.jsx("p",{className:"text-white font-mono text-lg",children:a.dataset_repo_id})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-400",children:"Task:"}),h.jsx("p",{className:"text-white",children:a.single_task})]})]}),h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-400",children:"Episodes Recorded:"}),h.jsx("p",{className:"text-white text-2xl font-bold text-green-400",children:a.saved_episodes||a.num_episodes}),a.total_frames&&h.jsxs("p",{className:"text-gray-400 text-sm",children:[a.total_frames," total frames"]})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-400",children:"Session Duration:"}),h.jsx("p",{className:"text-white",children:T(a.session_elapsed_seconds||0)}),a.fps&&h.jsxs("p",{className:"text-gray-400 text-sm",children:[a.fps," FPS"]})]})]})]})]}),!P&&h.jsxs("div",{className:"bg-gray-900 rounded-lg p-6 border border-gray-700 mb-8",children:[h.jsx("h2",{className:"text-xl font-semibold text-white mb-6",children:"Upload Configuration"}),h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{children:[h.jsx(Nt,{htmlFor:"tags",className:"text-gray-300 mb-2 block",children:"Tags (comma-separated)"}),h.jsx(hi,{id:"tags",value:f,onChange:D=>p(D.target.value),placeholder:"robotics, lerobot, manipulation",className:"bg-gray-800 border-gray-600 text-white"}),h.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Tags help others discover your dataset on HuggingFace Hub"})]}),h.jsxs("div",{className:"flex items-center space-x-3",children:[h.jsx(PA,{id:"private",checked:u.private,onCheckedChange:D=>d({...u,private:D})}),h.jsxs("div",{className:"flex items-center gap-2",children:[u.private?h.jsx(W7,{className:"w-4 h-4 text-gray-400"}):h.jsx(X7,{className:"w-4 h-4 text-gray-400"}),h.jsx(Nt,{htmlFor:"private",className:"text-gray-300",children:"Make dataset private"})]})]}),h.jsx("p",{className:"text-sm text-gray-500 ml-6",children:u.private?"Only you will be able to access this dataset":"Dataset will be publicly accessible on HuggingFace Hub"})]})]}),h.jsx("div",{className:"flex flex-col sm:flex-row gap-4 justify-center",children:P?h.jsxs(et,{onClick:()=>E(a.dataset_repo_id),className:"bg-blue-500 hover:bg-blue-600 text-white font-semibold py-4 px-8 text-lg",children:[h.jsx(ll,{className:"w-5 h-5 mr-2"}),"View on Hugging Face Hub"]}):h.jsxs(h.Fragment,{children:[h.jsx(et,{onClick:A,disabled:y,className:"bg-blue-500 hover:bg-blue-600 text-white font-semibold py-4 px-8 text-lg",children:y?h.jsxs(h.Fragment,{children:[h.jsx(fi,{className:"w-5 h-5 mr-2 animate-spin"}),"Uploading to Hub..."]}):h.jsxs(h.Fragment,{children:[h.jsx(IU,{className:"w-5 h-5 mr-2"}),"Upload to HuggingFace Hub"]})}),h.jsx(et,{onClick:M,disabled:y,variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-800 hover:text-white py-4 px-8 text-lg",children:"Skip Upload"})]})}),!P&&h.jsx("div",{className:"mt-8 p-4 bg-blue-900/20 border border-blue-600 rounded-lg",children:h.jsxs("div",{className:"flex items-start gap-3",children:[h.jsx(td,{className:"w-5 h-5 text-blue-400 mt-0.5"}),h.jsxs("div",{children:[h.jsx("h3",{className:"font-semibold text-blue-400 mb-2",children:"About HuggingFace Hub Upload"}),h.jsxs("ul",{className:"text-sm text-gray-300 space-y-1",children:[h.jsx("li",{children:"โ€ข Your dataset will be uploaded to HuggingFace Hub for sharing and collaboration"}),h.jsx("li",{children:"โ€ข You need to be logged in to HuggingFace CLI on the server"}),h.jsx("li",{children:"โ€ข Uploaded datasets can be used for training models and sharing with the community"}),h.jsx("li",{children:"โ€ข You can always upload manually later using the HuggingFace CLI"})]})]})]})})]})]}),h.jsx(mC,{open:x,onOpenChange:b,children:h.jsxs(Xx,{className:"bg-gray-900 border-gray-700 text-white",children:[h.jsxs(qx,{children:[h.jsx(Yx,{children:"Delete dataset from disk?"}),h.jsxs(Jx,{className:"text-gray-400",children:["This permanently removes ",h.jsx("span",{className:"font-mono text-white",children:a.dataset_repo_id})," from your local cache. This action cannot be undone."]})]}),h.jsxs(Kx,{children:[h.jsx(Qx,{className:"bg-gray-800 border-gray-700 text-white hover:bg-gray-700",children:"Keep dataset"}),h.jsx(Zx,{onClick:C,disabled:S,className:"bg-red-500 hover:bg-red-600 text-white",children:S?"Deletingโ€ฆ":"Delete"})]})]})})]})},oDe=()=>{const t=vl();return _.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",t.pathname)},[t.pathname]),h.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-100",children:h.jsxs("div",{className:"text-center",children:[h.jsx("h1",{className:"text-4xl font-bold mb-4",children:"404"}),h.jsx("p",{className:"text-xl text-gray-600 mb-4",children:"Oops! Page not found"}),h.jsx("a",{href:"/",className:"text-blue-500 hover:text-blue-700 underline",children:"Return to Home"})]})})},aDe="lelab-tabs-v1",sDe=1e3,lDe=3e3,cDe=({children:t})=>{const[e,n]=_.useState(!0),r=_.useRef(new Map),i=_.useRef(""),o=_.useRef(0),a=_.useRef(null),s=_.useCallback(()=>{const c=r.current,u=Date.now()-lDe;for(const[p,y]of c)y.lastSeen{if(typeof window>"u"||typeof BroadcastChannel>"u")return;i.current=crypto.randomUUID(),o.current=Date.now();const c=new BroadcastChannel(aDe);a.current=c;const u=p=>{c.postMessage({type:p,id:i.current,openedAt:o.current})};c.onmessage=p=>{const y=p.data;if(!y||y.id===i.current)return;const v=r.current;y.type==="HEARTBEAT"?v.set(y.id,{id:y.id,openedAt:y.openedAt,lastSeen:Date.now()}):y.type==="RELEASE"?v.delete(y.id):y.type==="TAKEOVER"&&(v.set(y.id,{id:y.id,openedAt:y.openedAt,lastSeen:Date.now()}),o.current<=y.openedAt&&(o.current=y.openedAt+1)),s()},u("HEARTBEAT");const d=setInterval(()=>{u("HEARTBEAT"),s()},sDe),f=()=>u("RELEASE");return window.addEventListener("beforeunload",f),()=>{window.removeEventListener("beforeunload",f),clearInterval(d),u("RELEASE"),c.close(),a.current=null}},[s]);const l=_.useCallback(()=>{var c;o.current=0,(c=a.current)==null||c.postMessage({type:"TAKEOVER",id:i.current,openedAt:0}),s()},[s]);return h.jsxs(h.Fragment,{children:[t,!e&&h.jsx("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center bg-black/80 backdrop-blur-sm",role:"dialog","aria-modal":"true",children:h.jsxs("div",{className:"mx-4 max-w-md space-y-4 rounded-lg border bg-background p-6 text-center shadow-lg",children:[h.jsx("h2",{className:"text-lg font-semibold",children:"LeLab is already open in another tab"}),h.jsx("p",{className:"text-sm text-muted-foreground",children:"Only one tab can control the robot at a time. Switch back to the original tab, or take over here โ€” the other tab will lock."}),h.jsx(et,{onClick:l,children:"Use this tab"})]})})]})},uDe=new i9;function dDe(){return h.jsx(a9,{client:uDe,children:h.jsx(zF,{children:h.jsx(c9,{children:h.jsx(HX,{children:h.jsx(VX,{children:h.jsx(F9,{children:h.jsx($9,{children:h.jsxs(L6,{children:[h.jsx(cDe,{children:h.jsxs(O6,{children:[h.jsx(go,{path:"/",element:h.jsx(zZ,{})}),h.jsx(go,{path:"/teleoperation",element:h.jsx(mse,{})}),h.jsx(go,{path:"/recording",element:h.jsx(_ce,{})}),h.jsx(go,{path:"/upload",element:h.jsx(iDe,{})}),h.jsx(go,{path:"/training",element:h.jsx(mk,{})}),h.jsx(go,{path:"/training/:jobId",element:h.jsx(mk,{})}),h.jsx(go,{path:"/inference",element:h.jsx(nDe,{})}),h.jsx(go,{path:"/calibration",element:h.jsx(Ase,{})}),h.jsx(go,{path:"/edit-dataset",element:h.jsx(rDe,{})}),h.jsx(go,{path:"*",element:h.jsx(oDe,{})})]})}),h.jsx(FX,{})]})})})})})})})})}U3(document.getElementById("root")).render(h.jsx(dDe,{})); diff --git a/frontend/dist/assets/index-DIKndiT6.js b/frontend/dist/assets/index-DIKndiT6.js new file mode 100644 index 0000000..dc6862c --- /dev/null +++ b/frontend/dist/assets/index-DIKndiT6.js @@ -0,0 +1,4272 @@ +var vG=Object.defineProperty;var EP=t=>{throw TypeError(t)};var yG=(t,e,n)=>e in t?vG(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Jb=(t,e,n)=>yG(t,typeof e!="symbol"?e+"":e,n),Zb=(t,e,n)=>e.has(t)||EP("Cannot "+n);var xe=(t,e,n)=>(Zb(t,e,"read from private field"),n?n.call(t):e.get(t)),Xt=(t,e,n)=>e.has(t)?EP("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Ct=(t,e,n,r)=>(Zb(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Sr=(t,e,n)=>(Zb(t,e,"access private method"),n);var Zm=(t,e,n,r)=>({set _(i){Ct(t,e,i,n)},get _(){return xe(t,e,r)}});function xG(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 o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var Qm=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function dn(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Pk={exports:{}},k0={},Rk={exports:{}},kt={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var ym=Symbol.for("react.element"),bG=Symbol.for("react.portal"),_G=Symbol.for("react.fragment"),wG=Symbol.for("react.strict_mode"),SG=Symbol.for("react.profiler"),EG=Symbol.for("react.provider"),TG=Symbol.for("react.context"),MG=Symbol.for("react.forward_ref"),AG=Symbol.for("react.suspense"),CG=Symbol.for("react.memo"),PG=Symbol.for("react.lazy"),TP=Symbol.iterator;function RG(t){return t===null||typeof t!="object"?null:(t=TP&&t[TP]||t["@@iterator"],typeof t=="function"?t:null)}var Nk={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Ok=Object.assign,Ik={};function hf(t,e,n){this.props=t,this.context=e,this.refs=Ik,this.updater=n||Nk}hf.prototype.isReactComponent={};hf.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};hf.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function Dk(){}Dk.prototype=hf.prototype;function QT(t,e,n){this.props=t,this.context=e,this.refs=Ik,this.updater=n||Nk}var eM=QT.prototype=new Dk;eM.constructor=QT;Ok(eM,hf.prototype);eM.isPureReactComponent=!0;var MP=Array.isArray,Lk=Object.prototype.hasOwnProperty,tM={current:null},kk={key:!0,ref:!0,__self:!0,__source:!0};function jk(t,e,n){var r,i={},o=null,a=null;if(e!=null)for(r in e.ref!==void 0&&(a=e.ref),e.key!==void 0&&(o=""+e.key),e)Lk.call(e,r)&&!kk.hasOwnProperty(r)&&(i[r]=e[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1>>1,F=L[K];if(0>>1;Ki(ee,X))tei(Q,ee)?(L[K]=Q,L[te]=X,K=te):(L[K]=ee,L[q]=X,K=q);else if(tei(Q,X))L[K]=Q,L[te]=X,K=te;else break e}}return j}function i(L,j){var X=L.sortIndex-j.sortIndex;return X!==0?X:L.id-j.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var a=Date,s=a.now();t.unstable_now=function(){return a.now()-s}}var l=[],c=[],u=1,d=null,f=3,p=!1,y=!1,v=!1,g=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(L){for(var j=n(c);j!==null;){if(j.callback===null)r(c);else if(j.startTime<=L)r(c),j.sortIndex=j.expirationTime,e(l,j);else break;j=n(c)}}function S(L){if(v=!1,b(L),!y)if(n(l)!==null)y=!0,O(w);else{var j=n(c);j!==null&&W(S,j.startTime-L)}}function w(L,j){y=!1,v&&(v=!1,m(A),A=-1),p=!0;var X=f;try{for(b(j),d=n(l);d!==null&&(!(d.expirationTime>j)||L&&!P());){var K=d.callback;if(typeof K=="function"){d.callback=null,f=d.priorityLevel;var F=K(d.expirationTime<=j);j=t.unstable_now(),typeof F=="function"?d.callback=F:d===n(l)&&r(l),b(j)}else r(l);d=n(l)}if(d!==null)var Y=!0;else{var q=n(c);q!==null&&W(S,q.startTime-j),Y=!1}return Y}finally{d=null,f=X,p=!1}}var E=!1,T=null,A=-1,M=5,C=-1;function P(){return!(t.unstable_now()-CL||125K?(L.sortIndex=X,e(c,L),n(l)===null&&L===n(c)&&(v?(m(A),A=-1):v=!0,W(S,X-K))):(L.sortIndex=F,e(l,L),y||p||(y=!0,O(w))),L},t.unstable_shouldYield=P,t.unstable_wrapCallback=function(L){var j=f;return function(){var X=f;f=j;try{return L.apply(this,arguments)}finally{f=X}}}})(zk);$k.exports=zk;var $G=$k.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var zG=_,Oi=$G;function Ce(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),dS=Object.prototype.hasOwnProperty,HG=/^[: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]*$/,CP={},PP={};function VG(t){return dS.call(PP,t)?!0:dS.call(CP,t)?!1:HG.test(t)?PP[t]=!0:(CP[t]=!0,!1)}function GG(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function WG(t,e,n,r){if(e===null||typeof e>"u"||GG(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Jr(t,e,n,r,i,o,a){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=o,this.removeEmptyString=a}var xr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){xr[t]=new Jr(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];xr[e]=new Jr(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){xr[t]=new Jr(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){xr[t]=new Jr(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){xr[t]=new Jr(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){xr[t]=new Jr(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){xr[t]=new Jr(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){xr[t]=new Jr(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){xr[t]=new Jr(t,5,!1,t.toLowerCase(),null,!1,!1)});var iM=/[\-:]([a-z])/g;function oM(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(iM,oM);xr[e]=new Jr(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(iM,oM);xr[e]=new Jr(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(iM,oM);xr[e]=new Jr(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){xr[t]=new Jr(t,1,!1,t.toLowerCase(),null,!1,!1)});xr.xlinkHref=new Jr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){xr[t]=new Jr(t,1,!1,t.toLowerCase(),null,!0,!0)});function aM(t,e,n,r){var i=xr.hasOwnProperty(e)?xr[e]:null;(i!==null?i.type!==0:r||!(2s||i[a]!==o[s]){var l=` +`+i[a].replace(" at new "," at ");return t.displayName&&l.includes("")&&(l=l.replace("",t.displayName)),l}while(1<=a&&0<=s);break}}}finally{t_=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?wh(t):""}function XG(t){switch(t.tag){case 5:return wh(t.type);case 16:return wh("Lazy");case 13:return wh("Suspense");case 19:return wh("SuspenseList");case 0:case 2:case 15:return t=n_(t.type,!1),t;case 11:return t=n_(t.type.render,!1),t;case 1:return t=n_(t.type,!0),t;default:return""}}function mS(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Ru:return"Fragment";case Pu:return"Portal";case fS:return"Profiler";case sM:return"StrictMode";case hS:return"Suspense";case pS:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case Gk:return(t.displayName||"Context")+".Consumer";case Vk:return(t._context.displayName||"Context")+".Provider";case lM:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case cM:return e=t.displayName||null,e!==null?e:mS(t.type)||"Memo";case Ps:e=t._payload,t=t._init;try{return mS(t(e))}catch{}}return null}function qG(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return mS(e);case 8:return e===sM?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function ol(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Xk(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function KG(t){var e=Xk(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,o.call(this,a)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function ng(t){t._valueTracker||(t._valueTracker=KG(t))}function qk(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=Xk(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function Kv(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function gS(t,e){var n=e.checked;return Rn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function NP(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=ol(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function Kk(t,e){e=e.checked,e!=null&&aM(t,"checked",e,!1)}function vS(t,e){Kk(t,e);var n=ol(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?yS(t,e.type,n):e.hasOwnProperty("defaultValue")&&yS(t,e.type,ol(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function OP(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function yS(t,e,n){(e!=="number"||Kv(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var Sh=Array.isArray;function Ku(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=rg.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function ep(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var Lh={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},YG=["Webkit","ms","Moz","O"];Object.keys(Lh).forEach(function(t){YG.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Lh[e]=Lh[t]})});function Qk(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||Lh.hasOwnProperty(t)&&Lh[t]?(""+e).trim():e+"px"}function ej(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Qk(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var JG=Rn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function _S(t,e){if(e){if(JG[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Ce(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Ce(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Ce(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Ce(62))}}function wS(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var SS=null;function uM(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var ES=null,Yu=null,Ju=null;function LP(t){if(t=_m(t)){if(typeof ES!="function")throw Error(Ce(280));var e=t.stateNode;e&&(e=$0(e),ES(t.stateNode,t.type,e))}}function tj(t){Yu?Ju?Ju.push(t):Ju=[t]:Yu=t}function nj(){if(Yu){var t=Yu,e=Ju;if(Ju=Yu=null,LP(t),e)for(t=0;t>>=0,t===0?32:31-(l8(t)/c8|0)|0}var ig=64,og=4194304;function Eh(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Qv(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,o=t.pingedLanes,a=n&268435455;if(a!==0){var s=a&~i;s!==0?r=Eh(s):(o&=a,o!==0&&(r=Eh(o)))}else a=n&~i,a!==0?r=Eh(a):o!==0&&(r=Eh(o));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,o=e&-e,i>=o||i===16&&(o&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0n;n++)e.push(t);return e}function xm(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Lo(e),t[e]=n}function h8(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0=jh),VP=" ",GP=!1;function wj(t,e){switch(t){case"keyup":return $8.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Sj(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Nu=!1;function H8(t,e){switch(t){case"compositionend":return Sj(e);case"keypress":return e.which!==32?null:(GP=!0,VP);case"textInput":return t=e.data,t===VP&&GP?null:t;default:return null}}function V8(t,e){if(Nu)return t==="compositionend"||!yM&&wj(t,e)?(t=bj(),Tv=mM=Bs=null,Nu=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=KP(n)}}function Aj(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Aj(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Cj(){for(var t=window,e=Kv();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Kv(t.document)}return e}function xM(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function Q8(t){var e=Cj(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&Aj(n.ownerDocument.documentElement,n)){if(r!==null&&xM(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!t.extend&&o>r&&(i=r,r=o,o=i),i=YP(n,o);var a=YP(n,r);i&&a&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==a.node||t.focusOffset!==a.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),o>r?(t.addRange(e),t.extend(a.node,a.offset)):(e.setEnd(a.node,a.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Ou=null,RS=null,Fh=null,NS=!1;function JP(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;NS||Ou==null||Ou!==Kv(r)||(r=Ou,"selectionStart"in r&&xM(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Fh&&ap(Fh,r)||(Fh=r,r=ny(RS,"onSelect"),0Lu||(t.current=jS[Lu],jS[Lu]=null,Lu--)}function gn(t,e){Lu++,jS[Lu]=t.current,t.current=e}var al={},Ir=gl(al),si=gl(!1),bc=al;function Md(t,e){var n=t.type.contextTypes;if(!n)return al;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=e[o];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function li(t){return t=t.childContextTypes,t!=null}function iy(){wn(si),wn(Ir)}function iR(t,e,n){if(Ir.current!==al)throw Error(Ce(168));gn(Ir,e),gn(si,n)}function jj(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(Ce(108,qG(t)||"Unknown",i));return Rn({},n,r)}function oy(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||al,bc=Ir.current,gn(Ir,t),gn(si,si.current),!0}function oR(t,e,n){var r=t.stateNode;if(!r)throw Error(Ce(169));n?(t=jj(t,e,bc),r.__reactInternalMemoizedMergedChildContext=t,wn(si),wn(Ir),gn(Ir,t)):wn(si),gn(si,n)}var Ba=null,z0=!1,g_=!1;function Uj(t){Ba===null?Ba=[t]:Ba.push(t)}function d6(t){z0=!0,Uj(t)}function vl(){if(!g_&&Ba!==null){g_=!0;var t=0,e=rn;try{var n=Ba;for(rn=1;t>=a,i-=a,Ha=1<<32-Lo(e)+i|n<A?(M=T,T=null):M=T.sibling;var C=f(m,T,b[A],S);if(C===null){T===null&&(T=M);break}t&&T&&C.alternate===null&&e(m,T),x=o(C,x,A),E===null?w=C:E.sibling=C,E=C,T=M}if(A===b.length)return n(m,T),En&&zl(m,A),w;if(T===null){for(;AA?(M=T,T=null):M=T.sibling;var P=f(m,T,C.value,S);if(P===null){T===null&&(T=M);break}t&&T&&P.alternate===null&&e(m,T),x=o(P,x,A),E===null?w=P:E.sibling=P,E=P,T=M}if(C.done)return n(m,T),En&&zl(m,A),w;if(T===null){for(;!C.done;A++,C=b.next())C=d(m,C.value,S),C!==null&&(x=o(C,x,A),E===null?w=C:E.sibling=C,E=C);return En&&zl(m,A),w}for(T=r(m,T);!C.done;A++,C=b.next())C=p(T,m,A,C.value,S),C!==null&&(t&&C.alternate!==null&&T.delete(C.key===null?A:C.key),x=o(C,x,A),E===null?w=C:E.sibling=C,E=C);return t&&T.forEach(function(R){return e(m,R)}),En&&zl(m,A),w}function g(m,x,b,S){if(typeof b=="object"&&b!==null&&b.type===Ru&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case tg:e:{for(var w=b.key,E=x;E!==null;){if(E.key===w){if(w=b.type,w===Ru){if(E.tag===7){n(m,E.sibling),x=i(E,b.props.children),x.return=m,m=x;break e}}else if(E.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Ps&&lR(w)===E.type){n(m,E.sibling),x=i(E,b.props),x.ref=Kf(m,E,b),x.return=m,m=x;break e}n(m,E);break}else e(m,E);E=E.sibling}b.type===Ru?(x=dc(b.props.children,m.mode,S,b.key),x.return=m,m=x):(S=Iv(b.type,b.key,b.props,null,m.mode,S),S.ref=Kf(m,x,b),S.return=m,m=S)}return a(m);case Pu:e:{for(E=b.key;x!==null;){if(x.key===E)if(x.tag===4&&x.stateNode.containerInfo===b.containerInfo&&x.stateNode.implementation===b.implementation){n(m,x.sibling),x=i(x,b.children||[]),x.return=m,m=x;break e}else{n(m,x);break}else e(m,x);x=x.sibling}x=E_(b,m.mode,S),x.return=m,m=x}return a(m);case Ps:return E=b._init,g(m,x,E(b._payload),S)}if(Sh(b))return y(m,x,b,S);if(Vf(b))return v(m,x,b,S);fg(m,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,x!==null&&x.tag===6?(n(m,x.sibling),x=i(x,b),x.return=m,m=x):(n(m,x),x=S_(b,m.mode,S),x.return=m,m=x),a(m)):n(m,x)}return g}var Cd=zj(!0),Hj=zj(!1),ly=gl(null),cy=null,Uu=null,SM=null;function EM(){SM=Uu=cy=null}function TM(t){var e=ly.current;wn(ly),t._currentValue=e}function BS(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function Qu(t,e){cy=t,SM=Uu=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(oi=!0),t.firstContext=null)}function io(t){var e=t._currentValue;if(SM!==t)if(t={context:t,memoizedValue:e,next:null},Uu===null){if(cy===null)throw Error(Ce(308));Uu=t,cy.dependencies={lanes:0,firstContext:t}}else Uu=Uu.next=t;return e}var Ql=null;function MM(t){Ql===null?Ql=[t]:Ql.push(t)}function Vj(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,MM(e)):(n.next=i.next,i.next=n),e.interleaved=n,ns(t,r)}function ns(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var Rs=!1;function AM(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Gj(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Ya(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Ks(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,Ht&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,ns(t,n)}return i=r.interleaved,i===null?(e.next=e,MM(r)):(e.next=i.next,i.next=e),r.interleaved=e,ns(t,n)}function Av(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,fM(t,n)}}function cR(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=a:o=o.next=a,n=n.next}while(n!==null);o===null?i=o=e:o=o.next=e}else i=o=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function uy(t,e,n,r){var i=t.updateQueue;Rs=!1;var o=i.firstBaseUpdate,a=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var l=s,c=l.next;l.next=null,a===null?o=c:a.next=c,a=l;var u=t.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==a&&(s===null?u.firstBaseUpdate=c:s.next=c,u.lastBaseUpdate=l))}if(o!==null){var d=i.baseState;a=0,u=c=l=null,s=o;do{var f=s.lane,p=s.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var y=t,v=s;switch(f=e,p=n,v.tag){case 1:if(y=v.payload,typeof y=="function"){d=y.call(p,d,f);break e}d=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=v.payload,f=typeof y=="function"?y.call(p,d,f):y,f==null)break e;d=Rn({},d,f);break e;case 2:Rs=!0}}s.callback!==null&&s.lane!==0&&(t.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else p={eventTime:p,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(c=u=p,l=d):u=u.next=p,a|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(u===null&&(l=d),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,e=i.shared.interleaved,e!==null){i=e;do a|=i.lane,i=i.next;while(i!==e)}else o===null&&(i.shared.lanes=0);Sc|=a,t.lanes=a,t.memoizedState=d}}function uR(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;en?n:4,t(!0);var r=y_.transition;y_.transition={};try{t(!1),e()}finally{rn=n,y_.transition=r}}function l3(){return oo().memoizedState}function m6(t,e,n){var r=Js(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},c3(t))u3(e,n);else if(n=Vj(t,e,n,r),n!==null){var i=Vr();ko(n,t,r,i),d3(n,e,r)}}function g6(t,e,n){var r=Js(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(c3(t))u3(e,i);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var a=e.lastRenderedState,s=o(a,n);if(i.hasEagerState=!0,i.eagerState=s,Bo(s,a)){var l=e.interleaved;l===null?(i.next=i,MM(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}n=Vj(t,e,i,r),n!==null&&(i=Vr(),ko(n,t,r,i),d3(n,e,r))}}function c3(t){var e=t.alternate;return t===Pn||e!==null&&e===Pn}function u3(t,e){Bh=fy=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function d3(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,fM(t,n)}}var hy={readContext:io,useCallback:Er,useContext:Er,useEffect:Er,useImperativeHandle:Er,useInsertionEffect:Er,useLayoutEffect:Er,useMemo:Er,useReducer:Er,useRef:Er,useState:Er,useDebugValue:Er,useDeferredValue:Er,useTransition:Er,useMutableSource:Er,useSyncExternalStore:Er,useId:Er,unstable_isNewReconciler:!1},v6={readContext:io,useCallback:function(t,e){return Jo().memoizedState=[t,e===void 0?null:e],t},useContext:io,useEffect:fR,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Pv(4194308,4,r3.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Pv(4194308,4,t,e)},useInsertionEffect:function(t,e){return Pv(4,2,t,e)},useMemo:function(t,e){var n=Jo();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Jo();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=m6.bind(null,Pn,t),[r.memoizedState,t]},useRef:function(t){var e=Jo();return t={current:t},e.memoizedState=t},useState:dR,useDebugValue:LM,useDeferredValue:function(t){return Jo().memoizedState=t},useTransition:function(){var t=dR(!1),e=t[0];return t=p6.bind(null,t[1]),Jo().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Pn,i=Jo();if(En){if(n===void 0)throw Error(Ce(407));n=n()}else{if(n=e(),ar===null)throw Error(Ce(349));wc&30||Kj(r,e,n)}i.memoizedState=n;var o={value:n,getSnapshot:e};return i.queue=o,fR(Jj.bind(null,r,o,t),[t]),r.flags|=2048,pp(9,Yj.bind(null,r,o,n,e),void 0,null),n},useId:function(){var t=Jo(),e=ar.identifierPrefix;if(En){var n=Va,r=Ha;n=(r&~(1<<32-Lo(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=fp++,0<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=a.createElement(n,{is:r.is}):(t=a.createElement(n),n==="select"&&(a=t,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):t=a.createElementNS(t,n),t[ra]=e,t[cp]=r,_3(t,e,!1,!1),e.stateNode=t;e:{switch(a=wS(n,r),n){case"dialog":xn("cancel",t),xn("close",t),i=r;break;case"iframe":case"object":case"embed":xn("load",t),i=r;break;case"video":case"audio":for(i=0;iNd&&(e.flags|=128,r=!0,Yf(o,!1),e.lanes=4194304)}else{if(!r)if(t=dy(a),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),Yf(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!En)return Tr(e),null}else 2*Ln()-o.renderingStartTime>Nd&&n!==1073741824&&(e.flags|=128,r=!0,Yf(o,!1),e.lanes=4194304);o.isBackwards?(a.sibling=e.child,e.child=a):(n=o.last,n!==null?n.sibling=a:e.child=a,o.last=a)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=Ln(),e.sibling=null,n=Cn.current,gn(Cn,r?n&1|2:n&1),e):(Tr(e),null);case 22:case 23:return $M(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Si&1073741824&&(Tr(e),e.subtreeFlags&6&&(e.flags|=8192)):Tr(e),null;case 24:return null;case 25:return null}throw Error(Ce(156,e.tag))}function T6(t,e){switch(_M(e),e.tag){case 1:return li(e.type)&&iy(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Pd(),wn(si),wn(Ir),RM(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return PM(e),null;case 13:if(wn(Cn),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(Ce(340));Ad()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return wn(Cn),null;case 4:return Pd(),null;case 10:return TM(e.type._context),null;case 22:case 23:return $M(),null;case 24:return null;default:return null}}var pg=!1,Rr=!1,M6=typeof WeakSet=="function"?WeakSet:Set,qe=null;function Fu(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){On(t,e,r)}else n.current=null}function KS(t,e,n){try{n()}catch(r){On(t,e,r)}}var SR=!1;function A6(t,e){if(OS=ey,t=Cj(),xM(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var a=0,s=-1,l=-1,c=0,u=0,d=t,f=null;t:for(;;){for(var p;d!==n||i!==0&&d.nodeType!==3||(s=a+i),d!==o||r!==0&&d.nodeType!==3||(l=a+r),d.nodeType===3&&(a+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===t)break t;if(f===n&&++c===i&&(s=a),f===o&&++u===r&&(l=a),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(IS={focusedElem:t,selectionRange:n},ey=!1,qe=e;qe!==null;)if(e=qe,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,qe=t;else for(;qe!==null;){e=qe;try{var y=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var v=y.memoizedProps,g=y.memoizedState,m=e.stateNode,x=m.getSnapshotBeforeUpdate(e.elementType===e.type?v:yo(e.type,v),g);m.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var b=e.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Ce(163))}}catch(S){On(e,e.return,S)}if(t=e.sibling,t!==null){t.return=e.return,qe=t;break}qe=e.return}return y=SR,SR=!1,y}function $h(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var o=i.destroy;i.destroy=void 0,o!==void 0&&KS(e,n,o)}i=i.next}while(i!==r)}}function G0(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function YS(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function E3(t){var e=t.alternate;e!==null&&(t.alternate=null,E3(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[ra],delete e[cp],delete e[kS],delete e[c6],delete e[u6])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function T3(t){return t.tag===5||t.tag===3||t.tag===4}function ER(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||T3(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function JS(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=ry));else if(r!==4&&(t=t.child,t!==null))for(JS(t,e,n),t=t.sibling;t!==null;)JS(t,e,n),t=t.sibling}function ZS(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(ZS(t,e,n),t=t.sibling;t!==null;)ZS(t,e,n),t=t.sibling}var pr=null,wo=!1;function gs(t,e,n){for(n=n.child;n!==null;)M3(t,e,n),n=n.sibling}function M3(t,e,n){if(ha&&typeof ha.onCommitFiberUnmount=="function")try{ha.onCommitFiberUnmount(j0,n)}catch{}switch(n.tag){case 5:Rr||Fu(n,e);case 6:var r=pr,i=wo;pr=null,gs(t,e,n),pr=r,wo=i,pr!==null&&(wo?(t=pr,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):pr.removeChild(n.stateNode));break;case 18:pr!==null&&(wo?(t=pr,n=n.stateNode,t.nodeType===8?m_(t.parentNode,n):t.nodeType===1&&m_(t,n),ip(t)):m_(pr,n.stateNode));break;case 4:r=pr,i=wo,pr=n.stateNode.containerInfo,wo=!0,gs(t,e,n),pr=r,wo=i;break;case 0:case 11:case 14:case 15:if(!Rr&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&KS(n,e,a),i=i.next}while(i!==r)}gs(t,e,n);break;case 1:if(!Rr&&(Fu(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){On(n,e,s)}gs(t,e,n);break;case 21:gs(t,e,n);break;case 22:n.mode&1?(Rr=(r=Rr)||n.memoizedState!==null,gs(t,e,n),Rr=r):gs(t,e,n);break;default:gs(t,e,n)}}function TR(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new M6),e.forEach(function(r){var i=k6.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function co(t,e){var n=e.deletions;if(n!==null)for(var r=0;ri&&(i=a),r&=~o}if(r=i,r=Ln()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*P6(r/1960))-r,10t?16:t,$s===null)var r=!1;else{if(t=$s,$s=null,gy=0,Ht&6)throw Error(Ce(331));var i=Ht;for(Ht|=4,qe=t.current;qe!==null;){var o=qe,a=o.child;if(qe.flags&16){var s=o.deletions;if(s!==null){for(var l=0;lLn()-FM?uc(t,0):UM|=n),ci(t,e)}function D3(t,e){e===0&&(t.mode&1?(e=og,og<<=1,!(og&130023424)&&(og=4194304)):e=1);var n=Vr();t=ns(t,e),t!==null&&(xm(t,e,n),ci(t,n))}function L6(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),D3(t,n)}function k6(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(Ce(314))}r!==null&&r.delete(e),D3(t,n)}var L3;L3=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||si.current)oi=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return oi=!1,S6(t,e,n);oi=!!(t.flags&131072)}else oi=!1,En&&e.flags&1048576&&Fj(e,sy,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Rv(t,e),t=e.pendingProps;var i=Md(e,Ir.current);Qu(e,n),i=OM(null,e,r,t,i,n);var o=IM();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,li(r)?(o=!0,oy(e)):o=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,AM(e),i.updater=V0,e.stateNode=i,i._reactInternals=e,zS(e,r,t,n),e=GS(null,e,r,!0,o,n)):(e.tag=0,En&&o&&bM(e),$r(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(Rv(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=U6(r),t=yo(r,t),i){case 0:e=VS(null,e,r,t,n);break e;case 1:e=bR(null,e,r,t,n);break e;case 11:e=yR(null,e,r,t,n);break e;case 14:e=xR(null,e,r,yo(r.type,t),n);break e}throw Error(Ce(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:yo(r,i),VS(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:yo(r,i),bR(t,e,r,i,n);case 3:e:{if(y3(e),t===null)throw Error(Ce(387));r=e.pendingProps,o=e.memoizedState,i=o.element,Gj(t,e),uy(e,r,null,n);var a=e.memoizedState;if(r=a.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){i=Rd(Error(Ce(423)),e),e=_R(t,e,r,n,i);break e}else if(r!==i){i=Rd(Error(Ce(424)),e),e=_R(t,e,r,n,i);break e}else for(Pi=qs(e.stateNode.containerInfo.firstChild),Ri=e,En=!0,Mo=null,n=Hj(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ad(),r===i){e=rs(t,e,n);break e}$r(t,e,r,n)}e=e.child}return e;case 5:return Wj(e),t===null&&FS(e),r=e.type,i=e.pendingProps,o=t!==null?t.memoizedProps:null,a=i.children,DS(r,i)?a=null:o!==null&&DS(r,o)&&(e.flags|=32),v3(t,e),$r(t,e,a,n),e.child;case 6:return t===null&&FS(e),null;case 13:return x3(t,e,n);case 4:return CM(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Cd(e,null,r,n):$r(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:yo(r,i),yR(t,e,r,i,n);case 7:return $r(t,e,e.pendingProps,n),e.child;case 8:return $r(t,e,e.pendingProps.children,n),e.child;case 12:return $r(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,o=e.memoizedProps,a=i.value,gn(ly,r._currentValue),r._currentValue=a,o!==null)if(Bo(o.value,a)){if(o.children===i.children&&!si.current){e=rs(t,e,n);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var s=o.dependencies;if(s!==null){a=o.child;for(var l=s.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=Ya(-1,n&-n),l.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),BS(o.return,n,e),s.lanes|=n;break}l=l.next}}else if(o.tag===10)a=o.type===e.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(Ce(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),BS(a,n,e),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===e){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}$r(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,Qu(e,n),i=io(i),r=r(i),e.flags|=1,$r(t,e,r,n),e.child;case 14:return r=e.type,i=yo(r,e.pendingProps),i=yo(r.type,i),xR(t,e,r,i,n);case 15:return m3(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:yo(r,i),Rv(t,e),e.tag=1,li(r)?(t=!0,oy(e)):t=!1,Qu(e,n),f3(e,r,i),zS(e,r,i,n),GS(null,e,r,!0,t,n);case 19:return b3(t,e,n);case 22:return g3(t,e,n)}throw Error(Ce(156,e.tag))};function k3(t,e){return cj(t,e)}function j6(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Yi(t,e,n,r){return new j6(t,e,n,r)}function HM(t){return t=t.prototype,!(!t||!t.isReactComponent)}function U6(t){if(typeof t=="function")return HM(t)?1:0;if(t!=null){if(t=t.$$typeof,t===lM)return 11;if(t===cM)return 14}return 2}function Zs(t,e){var n=t.alternate;return n===null?(n=Yi(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Iv(t,e,n,r,i,o){var a=2;if(r=t,typeof t=="function")HM(t)&&(a=1);else if(typeof t=="string")a=5;else e:switch(t){case Ru:return dc(n.children,i,o,e);case sM:a=8,i|=8;break;case fS:return t=Yi(12,n,e,i|2),t.elementType=fS,t.lanes=o,t;case hS:return t=Yi(13,n,e,i),t.elementType=hS,t.lanes=o,t;case pS:return t=Yi(19,n,e,i),t.elementType=pS,t.lanes=o,t;case Wk:return X0(n,i,o,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Vk:a=10;break e;case Gk:a=9;break e;case lM:a=11;break e;case cM:a=14;break e;case Ps:a=16,r=null;break e}throw Error(Ce(130,t==null?t:typeof t,""))}return e=Yi(a,n,e,i),e.elementType=t,e.type=r,e.lanes=o,e}function dc(t,e,n,r){return t=Yi(7,t,r,e),t.lanes=n,t}function X0(t,e,n,r){return t=Yi(22,t,r,e),t.elementType=Wk,t.lanes=n,t.stateNode={isHidden:!1},t}function S_(t,e,n){return t=Yi(6,t,null,e),t.lanes=n,t}function E_(t,e,n){return e=Yi(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function F6(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=i_(0),this.expirationTimes=i_(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=i_(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function VM(t,e,n,r,i,o,a,s,l){return t=new F6(t,e,n,s,l),e===1?(e=1,o===!0&&(e|=8)):e=0,o=Yi(3,null,null,e),t.current=o,o.stateNode=t,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},AM(o),t}function B6(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(B3)}catch(t){console.error(t)}}B3(),Bk.exports=Li;var Bc=Bk.exports;const $3=dn(Bc);var z3,IR=Bc;z3=IR.createRoot,IR.hydrateRoot;/** + * @remix-run/router v1.23.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function gp(){return gp=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function H3(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function W6(){return Math.random().toString(36).substr(2,8)}function LR(t,e){return{usr:t.state,key:t.key,idx:e}}function rE(t,e,n,r){return n===void 0&&(n=null),gp({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?gf(e):e,{state:n,key:e&&e.key||r||W6()})}function V3(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function gf(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function X6(t,e,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,a=i.history,s=zs.Pop,l=null,c=u();c==null&&(c=0,a.replaceState(gp({},a.state,{idx:c}),""));function u(){return(a.state||{idx:null}).idx}function d(){s=zs.Pop;let g=u(),m=g==null?null:g-c;c=g,l&&l({action:s,location:v.location,delta:m})}function f(g,m){s=zs.Push;let x=rE(v.location,g,m);c=u()+1;let b=LR(x,c),S=v.createHref(x);try{a.pushState(b,"",S)}catch(w){if(w instanceof DOMException&&w.name==="DataCloneError")throw w;i.location.assign(S)}o&&l&&l({action:s,location:v.location,delta:1})}function p(g,m){s=zs.Replace;let x=rE(v.location,g,m);c=u();let b=LR(x,c),S=v.createHref(x);a.replaceState(b,"",S),o&&l&&l({action:s,location:v.location,delta:0})}function y(g){let m=i.location.origin!=="null"?i.location.origin:i.location.href,x=typeof g=="string"?g:V3(g);return x=x.replace(/ $/,"%20"),Jn(m,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,m)}let v={get action(){return s},get location(){return t(i,a)},listen(g){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(DR,d),l=g,()=>{i.removeEventListener(DR,d),l=null}},createHref(g){return e(i,g)},createURL:y,encodeLocation(g){let m=y(g);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:f,replace:p,go(g){return a.go(g)}};return v}var kR;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(kR||(kR={}));function q6(t,e,n){return n===void 0&&(n="/"),K6(t,e,n)}function K6(t,e,n,r){let i=typeof e=="string"?gf(e):e,o=X3(i.pathname||"/",n);if(o==null)return null;let a=G3(t);Y6(a);let s=null;for(let l=0;s==null&&l{let l={relativePath:s===void 0?o.path||"":s,caseSensitive:o.caseSensitive===!0,childrenIndex:a,route:o};l.relativePath.startsWith("/")&&(Jn(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let c=fc([r,l.relativePath]),u=n.concat(l);o.children&&o.children.length>0&&(Jn(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),G3(o.children,e,u,c)),!(o.path==null&&!o.index)&&e.push({path:c,score:rW(c,o.index),routesMeta:u})};return t.forEach((o,a)=>{var s;if(o.path===""||!((s=o.path)!=null&&s.includes("?")))i(o,a);else for(let l of W3(o.path))i(o,a,l)}),e}function W3(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let a=W3(r.join("/")),s=[];return s.push(...a.map(l=>l===""?o:[o,l].join("/"))),i&&s.push(...a),s.map(l=>t.startsWith("/")&&l===""?"/":l)}function Y6(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:iW(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const J6=/^:[\w-]+$/,Z6=3,Q6=2,eW=1,tW=10,nW=-2,jR=t=>t==="*";function rW(t,e){let n=t.split("/"),r=n.length;return n.some(jR)&&(r+=nW),e&&(r+=Q6),n.filter(i=>!jR(i)).reduce((i,o)=>i+(J6.test(o)?Z6:o===""?eW:tW),r)}function iW(t,e){return t.length===e.length&&t.slice(0,-1).every((r,i)=>r===e[i])?t[t.length-1]-e[e.length-1]:0}function oW(t,e,n){let{routesMeta:r}=t,i={},o="/",a=[];for(let s=0;s{let{paramName:f,isOptional:p}=u;if(f==="*"){let v=s[d]||"";a=o.slice(0,o.length-v.length).replace(/(.)\/+$/,"$1")}const y=s[d];return p&&!y?c[f]=void 0:c[f]=(y||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:a,pattern:t}}function sW(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),H3(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,s,l)=>(r.push({paramName:s,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function lW(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return H3(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function X3(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function cW(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:i=""}=typeof t=="string"?gf(t):t;return{pathname:n?n.startsWith("/")?n:uW(n,e):e,search:mW(r),hash:gW(i)}}function uW(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function T_(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function dW(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function fW(t,e){let n=dW(t);return e?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function hW(t,e,n,r){r===void 0&&(r=!1);let i;typeof t=="string"?i=gf(t):(i=gp({},t),Jn(!i.pathname||!i.pathname.includes("?"),T_("?","pathname","search",i)),Jn(!i.pathname||!i.pathname.includes("#"),T_("#","pathname","hash",i)),Jn(!i.search||!i.search.includes("#"),T_("#","search","hash",i)));let o=t===""||i.pathname==="",a=o?"/":i.pathname,s;if(a==null)s=n;else{let d=e.length-1;if(!r&&a.startsWith("..")){let f=a.split("/");for(;f[0]==="..";)f.shift(),d-=1;i.pathname=f.join("/")}s=d>=0?e[d]:"/"}let l=cW(i,s),c=a&&a!=="/"&&a.endsWith("/"),u=(o||a===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}const fc=t=>t.join("/").replace(/\/\/+/g,"/"),pW=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),mW=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,gW=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function vW(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const q3=["post","put","patch","delete"];new Set(q3);const yW=["get",...q3];new Set(yW);/** + * React Router v6.30.1 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function vp(){return vp=Object.assign?Object.assign.bind():function(t){for(var e=1;e{s.current=!0}),_.useCallback(function(c,u){if(u===void 0&&(u={}),!s.current)return;if(typeof c=="number"){r.go(c);return}let d=hW(c,JSON.parse(a),o,u.relative==="path");t==null&&e!=="/"&&(d.pathname=d.pathname==="/"?e:fc([e,d.pathname])),(u.replace?r.replace:r.push)(d,u.state,u)},[e,r,a,o,t])}function _W(){let{matches:t}=_.useContext($c),e=t[t.length-1];return e?e.params:{}}function wW(t,e){return SW(t,e)}function SW(t,e,n,r){ex()||Jn(!1);let{navigator:i}=_.useContext(Z0),{matches:o}=_.useContext($c),a=o[o.length-1],s=a?a.params:{};a&&a.pathname;let l=a?a.pathnameBase:"/";a&&a.route;let c=yl(),u;if(e){var d;let g=typeof e=="string"?gf(e):e;l==="/"||(d=g.pathname)!=null&&d.startsWith(l)||Jn(!1),u=g}else u=c;let f=u.pathname||"/",p=f;if(l!=="/"){let g=l.replace(/^\//,"").split("/");p="/"+f.replace(/^\//,"").split("/").slice(g.length).join("/")}let y=q6(t,{pathname:p}),v=CW(y&&y.map(g=>Object.assign({},g,{params:Object.assign({},s,g.params),pathname:fc([l,i.encodeLocation?i.encodeLocation(g.pathname).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?l:fc([l,i.encodeLocation?i.encodeLocation(g.pathnameBase).pathname:g.pathnameBase])})),o,n,r);return e&&v?_.createElement(Q0.Provider,{value:{location:vp({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:zs.Pop}},v):v}function EW(){let t=OW(),e=vW(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return _.createElement(_.Fragment,null,_.createElement("h2",null,"Unexpected Application Error!"),_.createElement("h3",{style:{fontStyle:"italic"}},e),n?_.createElement("pre",{style:i},n):null,null)}const TW=_.createElement(EW,null);class MW extends _.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?_.createElement($c.Provider,{value:this.props.routeContext},_.createElement(K3.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function AW(t){let{routeContext:e,match:n,children:r}=t,i=_.useContext(qM);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),_.createElement($c.Provider,{value:e},r)}function CW(t,e,n,r){var i;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var o;if(!n)return null;if(n.errors)t=n.matches;else if((o=r)!=null&&o.v7_partialHydration&&e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let a=t,s=(i=n)==null?void 0:i.errors;if(s!=null){let u=a.findIndex(d=>d.route.id&&(s==null?void 0:s[d.route.id])!==void 0);u>=0||Jn(!1),a=a.slice(0,Math.min(a.length,u+1))}let l=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let u=0;u=0?a=a.slice(0,c+1):a=[a[0]];break}}}return a.reduceRight((u,d,f)=>{let p,y=!1,v=null,g=null;n&&(p=s&&d.route.id?s[d.route.id]:void 0,v=d.route.errorElement||TW,l&&(c<0&&f===0?(DW("route-fallback"),y=!0,g=null):c===f&&(y=!0,g=d.route.hydrateFallbackElement||null)));let m=e.concat(a.slice(0,f+1)),x=()=>{let b;return p?b=v:y?b=g:d.route.Component?b=_.createElement(d.route.Component,null):d.route.element?b=d.route.element:b=u,_.createElement(AW,{match:d,routeContext:{outlet:u,matches:m,isDataRoute:n!=null},children:b})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?_.createElement(MW,{location:n.location,revalidation:n.revalidation,component:v,error:p,children:x(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):x()},null)}var J3=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(J3||{}),Z3=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(Z3||{});function PW(t){let e=_.useContext(qM);return e||Jn(!1),e}function RW(t){let e=_.useContext(xW);return e||Jn(!1),e}function NW(t){let e=_.useContext($c);return e||Jn(!1),e}function Q3(t){let e=NW(),n=e.matches[e.matches.length-1];return n.route.id||Jn(!1),n.route.id}function OW(){var t;let e=_.useContext(K3),n=RW(),r=Q3();return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function IW(){let{router:t}=PW(J3.UseNavigateStable),e=Q3(Z3.UseNavigateStable),n=_.useRef(!1);return Y3(()=>{n.current=!0}),_.useCallback(function(i,o){o===void 0&&(o={}),n.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,vp({fromRouteId:e},o)))},[t,e])}const UR={};function DW(t,e,n){UR[t]||(UR[t]=!0)}function LW(t,e){t==null||t.v7_startTransition,t==null||t.v7_relativeSplatPath}function go(t){Jn(!1)}function kW(t){let{basename:e="/",children:n=null,location:r,navigationType:i=zs.Pop,navigator:o,static:a=!1,future:s}=t;ex()&&Jn(!1);let l=e.replace(/^\/*/,"/"),c=_.useMemo(()=>({basename:l,navigator:o,static:a,future:vp({v7_relativeSplatPath:!1},s)}),[l,s,o,a]);typeof r=="string"&&(r=gf(r));let{pathname:u="/",search:d="",hash:f="",state:p=null,key:y="default"}=r,v=_.useMemo(()=>{let g=X3(u,l);return g==null?null:{location:{pathname:g,search:d,hash:f,state:p,key:y},navigationType:i}},[l,u,d,f,p,y,i]);return v==null?null:_.createElement(Z0.Provider,{value:c},_.createElement(Q0.Provider,{children:n,value:v}))}function jW(t){let{children:e,location:n}=t;return wW(iE(e),n)}new Promise(()=>{});function iE(t,e){e===void 0&&(e=[]);let n=[];return _.Children.forEach(t,(r,i)=>{if(!_.isValidElement(r))return;let o=[...e,i];if(r.type===_.Fragment){n.push.apply(n,iE(r.props.children,o));return}r.type!==go&&Jn(!1),!r.props.index||!r.props.children||Jn(!1);let a={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(a.children=iE(r.props.children,o)),n.push(a)}),n}/** + * React Router DOM v6.30.1 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */const UW="6";try{window.__reactRouterVersion=UW}catch{}const FW="startTransition",FR=rM[FW];function BW(t){let{basename:e,children:n,future:r,window:i}=t,o=_.useRef();o.current==null&&(o.current=G6({window:i,v5Compat:!0}));let a=o.current,[s,l]=_.useState({action:a.action,location:a.location}),{v7_startTransition:c}=r||{},u=_.useCallback(d=>{c&&FR?FR(()=>l(d)):l(d)},[l,c]);return _.useLayoutEffect(()=>a.listen(u),[a,u]),_.useEffect(()=>LW(r),[r]),_.createElement(kW,{basename:e,children:n,location:s.location,navigationType:s.action,navigator:a,future:r})}var BR;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(BR||(BR={}));var $R;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})($R||($R={}));var tx=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(){}},nx=typeof window>"u"||"Deno"in globalThis;function xo(){}function $W(t,e){return typeof t=="function"?t(e):t}function zW(t){return typeof t=="number"&&t>=0&&t!==1/0}function HW(t,e){return Math.max(t+(e||0)-Date.now(),0)}function oE(t,e){return typeof t=="function"?t(e):t}function VW(t,e){return typeof t=="function"?t(e):t}function zR(t,e){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:a,stale:s}=t;if(a){if(r){if(e.queryHash!==KM(a,e.options))return!1}else if(!xp(e.queryKey,a))return!1}if(n!=="all"){const l=e.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof s=="boolean"&&e.isStale()!==s||i&&i!==e.state.fetchStatus||o&&!o(e))}function HR(t,e){const{exact:n,status:r,predicate:i,mutationKey:o}=t;if(o){if(!e.options.mutationKey)return!1;if(n){if(yp(e.options.mutationKey)!==yp(o))return!1}else if(!xp(e.options.mutationKey,o))return!1}return!(r&&e.state.status!==r||i&&!i(e))}function KM(t,e){return((e==null?void 0:e.queryKeyHashFn)||yp)(t)}function yp(t){return JSON.stringify(t,(e,n)=>aE(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function xp(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>xp(t[n],e[n])):!1}function eU(t,e){if(t===e)return t;const n=VR(t)&&VR(e);if(n||aE(t)&&aE(e)){const r=n?t:Object.keys(t),i=r.length,o=n?e:Object.keys(e),a=o.length,s=n?[]:{},l=new Set(r);let c=0;for(let u=0;u{setTimeout(e,t)})}function WW(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?eU(t,e):e}function XW(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function qW(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var YM=Symbol();function tU(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===YM?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var oc,Ls,gd,_k,KW=(_k=class extends tx{constructor(){super();Xt(this,oc);Xt(this,Ls);Xt(this,gd);Ct(this,gd,e=>{if(!nx&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){xe(this,Ls)||this.setEventListener(xe(this,gd))}onUnsubscribe(){var e;this.hasListeners()||((e=xe(this,Ls))==null||e.call(this),Ct(this,Ls,void 0))}setEventListener(e){var n;Ct(this,gd,e),(n=xe(this,Ls))==null||n.call(this),Ct(this,Ls,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){xe(this,oc)!==e&&(Ct(this,oc,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof xe(this,oc)=="boolean"?xe(this,oc):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},oc=new WeakMap,Ls=new WeakMap,gd=new WeakMap,_k),nU=new KW,vd,ks,yd,wk,YW=(wk=class extends tx{constructor(){super();Xt(this,vd,!0);Xt(this,ks);Xt(this,yd);Ct(this,yd,e=>{if(!nx&&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(){xe(this,ks)||this.setEventListener(xe(this,yd))}onUnsubscribe(){var e;this.hasListeners()||((e=xe(this,ks))==null||e.call(this),Ct(this,ks,void 0))}setEventListener(e){var n;Ct(this,yd,e),(n=xe(this,ks))==null||n.call(this),Ct(this,ks,e(this.setOnline.bind(this)))}setOnline(e){xe(this,vd)!==e&&(Ct(this,vd,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return xe(this,vd)}},vd=new WeakMap,ks=new WeakMap,yd=new WeakMap,wk),xy=new YW;function JW(){let t,e;const n=new Promise((i,o)=>{t=i,e=o});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 ZW(t){return Math.min(1e3*2**t,3e4)}function rU(t){return(t??"online")==="online"?xy.isOnline():!0}var iU=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function M_(t){return t instanceof iU}function oU(t){let e=!1,n=0,r=!1,i;const o=JW(),a=v=>{var g;r||(f(new iU(v)),(g=t.abort)==null||g.call(t))},s=()=>{e=!0},l=()=>{e=!1},c=()=>nU.isFocused()&&(t.networkMode==="always"||xy.isOnline())&&t.canRun(),u=()=>rU(t.networkMode)&&t.canRun(),d=v=>{var g;r||(r=!0,(g=t.onSuccess)==null||g.call(t,v),i==null||i(),o.resolve(v))},f=v=>{var g;r||(r=!0,(g=t.onError)==null||g.call(t,v),i==null||i(),o.reject(v))},p=()=>new Promise(v=>{var g;i=m=>{(r||c())&&v(m)},(g=t.onPause)==null||g.call(t)}).then(()=>{var v;i=void 0,r||(v=t.onContinue)==null||v.call(t)}),y=()=>{if(r)return;let v;const g=n===0?t.initialPromise:void 0;try{v=g??t.fn()}catch(m){v=Promise.reject(m)}Promise.resolve(v).then(d).catch(m=>{var E;if(r)return;const x=t.retry??(nx?0:3),b=t.retryDelay??ZW,S=typeof b=="function"?b(n,m):b,w=x===!0||typeof x=="number"&&nc()?void 0:p()).then(()=>{e?f(m):y()})})};return{promise:o,cancel:a,continue:()=>(i==null||i(),o),cancelRetry:s,continueRetry:l,canStart:u,start:()=>(u()?y():p().then(y),o)}}var QW=t=>setTimeout(t,0);function e9(){let t=[],e=0,n=s=>{s()},r=s=>{s()},i=QW;const o=s=>{e?t.push(s):i(()=>{n(s)})},a=()=>{const s=t;t=[],s.length&&i(()=>{r(()=>{s.forEach(l=>{n(l)})})})};return{batch:s=>{let l;e++;try{l=s()}finally{e--,e||a()}return l},batchCalls:s=>(...l)=>{o(()=>{s(...l)})},schedule:o,setNotifyFunction:s=>{n=s},setBatchNotifyFunction:s=>{r=s},setScheduler:s=>{i=s}}}var zr=e9(),ac,Sk,aU=(Sk=class{constructor(){Xt(this,ac)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),zW(this.gcTime)&&Ct(this,ac,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(nx?1/0:5*60*1e3))}clearGcTimeout(){xe(this,ac)&&(clearTimeout(xe(this,ac)),Ct(this,ac,void 0))}},ac=new WeakMap,Sk),xd,bd,Gi,sc,Cr,gm,lc,bo,ka,Ek,t9=(Ek=class extends aU{constructor(e){super();Xt(this,bo);Xt(this,xd);Xt(this,bd);Xt(this,Gi);Xt(this,sc);Xt(this,Cr);Xt(this,gm);Xt(this,lc);Ct(this,lc,!1),Ct(this,gm,e.defaultOptions),this.setOptions(e.options),this.observers=[],Ct(this,sc,e.client),Ct(this,Gi,xe(this,sc).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Ct(this,xd,r9(this.options)),this.state=e.state??xe(this,xd),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=xe(this,Cr))==null?void 0:e.promise}setOptions(e){this.options={...xe(this,gm),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&xe(this,Gi).remove(this)}setData(e,n){const r=WW(this.state.data,e,this.options);return Sr(this,bo,ka).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){Sr(this,bo,ka).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var r,i;const n=(r=xe(this,Cr))==null?void 0:r.promise;return(i=xe(this,Cr))==null||i.cancel(e),n?n.then(xo).catch(xo):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(xe(this,xd))}isActive(){return this.observers.some(e=>VW(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===YM||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>oE(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!HW(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=xe(this,Cr))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=xe(this,Cr))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),xe(this,Gi).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(xe(this,Cr)&&(xe(this,lc)?xe(this,Cr).cancel({revert:!0}):xe(this,Cr).cancelRetry()),this.scheduleGc()),xe(this,Gi).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Sr(this,bo,ka).call(this,{type:"invalidate"})}fetch(e,n){var c,u,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(xe(this,Cr))return xe(this,Cr).continueRetry(),xe(this,Cr).promise}if(e&&this.setOptions(e),!this.options.queryFn){const f=this.observers.find(p=>p.options.queryFn);f&&this.setOptions(f.options)}const r=new AbortController,i=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(Ct(this,lc,!0),r.signal)})},o=()=>{const f=tU(this.options,n),y=(()=>{const v={client:xe(this,sc),queryKey:this.queryKey,meta:this.meta};return i(v),v})();return Ct(this,lc,!1),this.options.persister?this.options.persister(f,y,this):f(y)},s=(()=>{const f={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:xe(this,sc),state:this.state,fetchFn:o};return i(f),f})();(c=this.options.behavior)==null||c.onFetch(s,this),Ct(this,bd,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=s.fetchOptions)==null?void 0:u.meta))&&Sr(this,bo,ka).call(this,{type:"fetch",meta:(d=s.fetchOptions)==null?void 0:d.meta});const l=f=>{var p,y,v,g;M_(f)&&f.silent||Sr(this,bo,ka).call(this,{type:"error",error:f}),M_(f)||((y=(p=xe(this,Gi).config).onError)==null||y.call(p,f,this),(g=(v=xe(this,Gi).config).onSettled)==null||g.call(v,this.state.data,f,this)),this.scheduleGc()};return Ct(this,Cr,oU({initialPromise:n==null?void 0:n.initialPromise,fn:s.fetchFn,abort:r.abort.bind(r),onSuccess:f=>{var p,y,v,g;if(f===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(m){l(m);return}(y=(p=xe(this,Gi).config).onSuccess)==null||y.call(p,f,this),(g=(v=xe(this,Gi).config).onSettled)==null||g.call(v,f,this.state.error,this),this.scheduleGc()},onError:l,onFail:(f,p)=>{Sr(this,bo,ka).call(this,{type:"failed",failureCount:f,error:p})},onPause:()=>{Sr(this,bo,ka).call(this,{type:"pause"})},onContinue:()=>{Sr(this,bo,ka).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0})),xe(this,Cr).start()}},xd=new WeakMap,bd=new WeakMap,Gi=new WeakMap,sc=new WeakMap,Cr=new WeakMap,gm=new WeakMap,lc=new WeakMap,bo=new WeakSet,ka=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,...n9(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 M_(i)&&i.revert&&xe(this,bd)?{...xe(this,bd),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),zr.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),xe(this,Gi).notify({query:this,type:"updated",action:e})})},Ek);function n9(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:rU(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function r9(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 Qo,Tk,i9=(Tk=class extends tx{constructor(e={}){super();Xt(this,Qo);this.config=e,Ct(this,Qo,new Map)}build(e,n,r){const i=n.queryKey,o=n.queryHash??KM(i,n);let a=this.get(o);return a||(a=new t9({client:e,queryKey:i,queryHash:o,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(a)),a}add(e){xe(this,Qo).has(e.queryHash)||(xe(this,Qo).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=xe(this,Qo).get(e.queryHash);n&&(e.destroy(),n===e&&xe(this,Qo).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){zr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return xe(this,Qo).get(e)}getAll(){return[...xe(this,Qo).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>zR(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>zR(e,r)):n}notify(e){zr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){zr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){zr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Qo=new WeakMap,Tk),ea,Br,cc,ta,As,Mk,o9=(Mk=class extends aU{constructor(e){super();Xt(this,ta);Xt(this,ea);Xt(this,Br);Xt(this,cc);this.mutationId=e.mutationId,Ct(this,Br,e.mutationCache),Ct(this,ea,[]),this.state=e.state||a9(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){xe(this,ea).includes(e)||(xe(this,ea).push(e),this.clearGcTimeout(),xe(this,Br).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Ct(this,ea,xe(this,ea).filter(n=>n!==e)),this.scheduleGc(),xe(this,Br).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){xe(this,ea).length||(this.state.status==="pending"?this.scheduleGc():xe(this,Br).remove(this))}continue(){var e;return((e=xe(this,cc))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var o,a,s,l,c,u,d,f,p,y,v,g,m,x,b,S,w,E,T,A;const n=()=>{Sr(this,ta,As).call(this,{type:"continue"})};Ct(this,cc,oU({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(M,C)=>{Sr(this,ta,As).call(this,{type:"failed",failureCount:M,error:C})},onPause:()=>{Sr(this,ta,As).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>xe(this,Br).canRun(this)}));const r=this.state.status==="pending",i=!xe(this,cc).canStart();try{if(r)n();else{Sr(this,ta,As).call(this,{type:"pending",variables:e,isPaused:i}),await((a=(o=xe(this,Br).config).onMutate)==null?void 0:a.call(o,e,this));const C=await((l=(s=this.options).onMutate)==null?void 0:l.call(s,e));C!==this.state.context&&Sr(this,ta,As).call(this,{type:"pending",context:C,variables:e,isPaused:i})}const M=await xe(this,cc).start();return await((u=(c=xe(this,Br).config).onSuccess)==null?void 0:u.call(c,M,e,this.state.context,this)),await((f=(d=this.options).onSuccess)==null?void 0:f.call(d,M,e,this.state.context)),await((y=(p=xe(this,Br).config).onSettled)==null?void 0:y.call(p,M,null,this.state.variables,this.state.context,this)),await((g=(v=this.options).onSettled)==null?void 0:g.call(v,M,null,e,this.state.context)),Sr(this,ta,As).call(this,{type:"success",data:M}),M}catch(M){try{throw await((x=(m=xe(this,Br).config).onError)==null?void 0:x.call(m,M,e,this.state.context,this)),await((S=(b=this.options).onError)==null?void 0:S.call(b,M,e,this.state.context)),await((E=(w=xe(this,Br).config).onSettled)==null?void 0:E.call(w,void 0,M,this.state.variables,this.state.context,this)),await((A=(T=this.options).onSettled)==null?void 0:A.call(T,void 0,M,e,this.state.context)),M}finally{Sr(this,ta,As).call(this,{type:"error",error:M})}}finally{xe(this,Br).runNext(this)}}},ea=new WeakMap,Br=new WeakMap,cc=new WeakMap,ta=new WeakSet,As=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),zr.batch(()=>{xe(this,ea).forEach(r=>{r.onMutationUpdate(e)}),xe(this,Br).notify({mutation:this,type:"updated",action:e})})},Mk);function a9(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var za,_o,vm,Ak,s9=(Ak=class extends tx{constructor(e={}){super();Xt(this,za);Xt(this,_o);Xt(this,vm);this.config=e,Ct(this,za,new Set),Ct(this,_o,new Map),Ct(this,vm,0)}build(e,n,r){const i=new o9({mutationCache:this,mutationId:++Zm(this,vm)._,options:e.defaultMutationOptions(n),state:r});return this.add(i),i}add(e){xe(this,za).add(e);const n=vg(e);if(typeof n=="string"){const r=xe(this,_o).get(n);r?r.push(e):xe(this,_o).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(xe(this,za).delete(e)){const n=vg(e);if(typeof n=="string"){const r=xe(this,_o).get(n);if(r)if(r.length>1){const i=r.indexOf(e);i!==-1&&r.splice(i,1)}else r[0]===e&&xe(this,_o).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=vg(e);if(typeof n=="string"){const r=xe(this,_o).get(n),i=r==null?void 0:r.find(o=>o.state.status==="pending");return!i||i===e}else return!0}runNext(e){var r;const n=vg(e);if(typeof n=="string"){const i=(r=xe(this,_o).get(n))==null?void 0:r.find(o=>o!==e&&o.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){zr.batch(()=>{xe(this,za).forEach(e=>{this.notify({type:"removed",mutation:e})}),xe(this,za).clear(),xe(this,_o).clear()})}getAll(){return Array.from(xe(this,za))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>HR(n,r))}findAll(e={}){return this.getAll().filter(n=>HR(e,n))}notify(e){zr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return zr.batch(()=>Promise.all(e.map(n=>n.continue().catch(xo))))}},za=new WeakMap,_o=new WeakMap,vm=new WeakMap,Ak);function vg(t){var e;return(e=t.options.scope)==null?void 0:e.id}function WR(t){return{onFetch:(e,n)=>{var u,d,f,p,y;const r=e.options,i=(f=(d=(u=e.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,o=((p=e.state.data)==null?void 0:p.pages)||[],a=((y=e.state.data)==null?void 0:y.pageParams)||[];let s={pages:[],pageParams:[]},l=0;const c=async()=>{let v=!1;const g=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(e.signal.aborted?v=!0:e.signal.addEventListener("abort",()=>{v=!0}),e.signal)})},m=tU(e.options,e.fetchOptions),x=async(b,S,w)=>{if(v)return Promise.reject();if(S==null&&b.pages.length)return Promise.resolve(b);const T=(()=>{const P={client:e.client,queryKey:e.queryKey,pageParam:S,direction:w?"backward":"forward",meta:e.options.meta};return g(P),P})(),A=await m(T),{maxPages:M}=e.options,C=w?qW:XW;return{pages:C(b.pages,A,M),pageParams:C(b.pageParams,S,M)}};if(i&&o.length){const b=i==="backward",S=b?l9:XR,w={pages:o,pageParams:a},E=S(r,w);s=await x(w,E,b)}else{const b=t??o.length;do{const S=l===0?a[0]??r.initialPageParam:XR(r,s);if(l>0&&S==null)break;s=await x(s,S),l++}while(l{var v,g;return(g=(v=e.options).persister)==null?void 0:g.call(v,c,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=c}}}function XR(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 l9(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 Nn,js,Us,_d,wd,Fs,Sd,Ed,Ck,c9=(Ck=class{constructor(t={}){Xt(this,Nn);Xt(this,js);Xt(this,Us);Xt(this,_d);Xt(this,wd);Xt(this,Fs);Xt(this,Sd);Xt(this,Ed);Ct(this,Nn,t.queryCache||new i9),Ct(this,js,t.mutationCache||new s9),Ct(this,Us,t.defaultOptions||{}),Ct(this,_d,new Map),Ct(this,wd,new Map),Ct(this,Fs,0)}mount(){Zm(this,Fs)._++,xe(this,Fs)===1&&(Ct(this,Sd,nU.subscribe(async t=>{t&&(await this.resumePausedMutations(),xe(this,Nn).onFocus())})),Ct(this,Ed,xy.subscribe(async t=>{t&&(await this.resumePausedMutations(),xe(this,Nn).onOnline())})))}unmount(){var t,e;Zm(this,Fs)._--,xe(this,Fs)===0&&((t=xe(this,Sd))==null||t.call(this),Ct(this,Sd,void 0),(e=xe(this,Ed))==null||e.call(this),Ct(this,Ed,void 0))}isFetching(t){return xe(this,Nn).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return xe(this,js).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=xe(this,Nn).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=xe(this,Nn).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(oE(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return xe(this,Nn).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=xe(this,Nn).get(r.queryHash),o=i==null?void 0:i.state.data,a=$W(e,o);if(a!==void 0)return xe(this,Nn).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(t,e,n){return zr.batch(()=>xe(this,Nn).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=xe(this,Nn).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=xe(this,Nn);zr.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=xe(this,Nn);return zr.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=zr.batch(()=>xe(this,Nn).findAll(t).map(i=>i.cancel(n)));return Promise.all(r).then(xo).catch(xo)}invalidateQueries(t,e={}){return zr.batch(()=>(xe(this,Nn).findAll(t).forEach(n=>{n.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=zr.batch(()=>xe(this,Nn).findAll(t).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(xo)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(xo)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=xe(this,Nn).build(this,e);return n.isStaleByTime(oE(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(xo).catch(xo)}fetchInfiniteQuery(t){return t.behavior=WR(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(xo).catch(xo)}ensureInfiniteQueryData(t){return t.behavior=WR(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return xy.isOnline()?xe(this,js).resumePausedMutations():Promise.resolve()}getQueryCache(){return xe(this,Nn)}getMutationCache(){return xe(this,js)}getDefaultOptions(){return xe(this,Us)}setDefaultOptions(t){Ct(this,Us,t)}setQueryDefaults(t,e){xe(this,_d).set(yp(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...xe(this,_d).values()],n={};return e.forEach(r=>{xp(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){xe(this,wd).set(yp(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...xe(this,wd).values()],n={};return e.forEach(r=>{xp(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...xe(this,Us).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=KM(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===YM&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...xe(this,Us).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){xe(this,Nn).clear(),xe(this,js).clear()}},Nn=new WeakMap,js=new WeakMap,Us=new WeakMap,_d=new WeakMap,wd=new WeakMap,Fs=new WeakMap,Sd=new WeakMap,Ed=new WeakMap,Ck),u9=_.createContext(void 0),d9=({client:t,children:e})=>(_.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),h.jsx(u9.Provider,{value:t,children:e}));const f9={theme:"system",setTheme:()=>null},h9=_.createContext(f9);function p9({children:t,defaultTheme:e="system",storageKey:n="vite-ui-theme",...r}){const[i,o]=_.useState(()=>localStorage.getItem(n)||e);_.useEffect(()=>{const l=window.document.documentElement;if(l.classList.remove("light","dark"),i==="system"){const c=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";l.classList.add(c);return}l.classList.add(i)},[i]);const a=_.useCallback(l=>{localStorage.setItem(n,l),o(l)},[n]),s=_.useMemo(()=>({theme:i,setTheme:a}),[i,a]);return h.jsx(h9.Provider,{...r,value:s,children:t})}var m9=t=>{switch(t){case"success":return y9;case"info":return b9;case"warning":return x9;case"error":return _9;default:return null}},g9=Array(12).fill(0),v9=({visible:t,className:e})=>Z.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},Z.createElement("div",{className:"sonner-spinner"},g9.map((n,r)=>Z.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),y9=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Z.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),x9=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Z.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),b9=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Z.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),_9=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Z.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),w9=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},Z.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Z.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),S9=()=>{let[t,e]=Z.useState(document.hidden);return Z.useEffect(()=>{let n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t},sE=1,E9=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let e=this.subscribers.indexOf(t);this.subscribers.splice(e,1)}),this.publish=t=>{this.subscribers.forEach(e=>e(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var e;let{message:n,...r}=t,i=typeof(t==null?void 0:t.id)=="number"||((e=t.id)==null?void 0:e.length)>0?t.id:sE++,o=this.toasts.find(s=>s.id===i),a=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),o?this.toasts=this.toasts.map(s=>s.id===i?(this.publish({...s,...t,id:i,title:n}),{...s,...t,id:i,dismissible:a,title:n}):s):this.addToast({title:n,...r,dismissible:a,id:i}),i},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(e=>{this.subscribers.forEach(n=>n({id:e.id,dismiss:!0}))}),this.subscribers.forEach(e=>e({id:t,dismiss:!0})),t),this.message=(t,e)=>this.create({...e,message:t}),this.error=(t,e)=>this.create({...e,message:t,type:"error"}),this.success=(t,e)=>this.create({...e,type:"success",message:t}),this.info=(t,e)=>this.create({...e,type:"info",message:t}),this.warning=(t,e)=>this.create({...e,type:"warning",message:t}),this.loading=(t,e)=>this.create({...e,type:"loading",message:t}),this.promise=(t,e)=>{if(!e)return;let n;e.loading!==void 0&&(n=this.create({...e,promise:t,type:"loading",message:e.loading,description:typeof e.description!="function"?e.description:void 0}));let r=t instanceof Promise?t:t(),i=n!==void 0,o,a=r.then(async l=>{if(o=["resolve",l],Z.isValidElement(l))i=!1,this.create({id:n,type:"default",message:l});else if(M9(l)&&!l.ok){i=!1;let c=typeof e.error=="function"?await e.error(`HTTP error! status: ${l.status}`):e.error,u=typeof e.description=="function"?await e.description(`HTTP error! status: ${l.status}`):e.description;this.create({id:n,type:"error",message:c,description:u})}else if(e.success!==void 0){i=!1;let c=typeof e.success=="function"?await e.success(l):e.success,u=typeof e.description=="function"?await e.description(l):e.description;this.create({id:n,type:"success",message:c,description:u})}}).catch(async l=>{if(o=["reject",l],e.error!==void 0){i=!1;let c=typeof e.error=="function"?await e.error(l):e.error,u=typeof e.description=="function"?await e.description(l):e.description;this.create({id:n,type:"error",message:c,description:u})}}).finally(()=>{var l;i&&(this.dismiss(n),n=void 0),(l=e.finally)==null||l.call(e)}),s=()=>new Promise((l,c)=>a.then(()=>o[0]==="reject"?c(o[1]):l(o[1])).catch(c));return typeof n!="string"&&typeof n!="number"?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(t,e)=>{let n=(e==null?void 0:e.id)||sE++;return this.create({jsx:t(n),id:n,...e}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},ni=new E9,T9=(t,e)=>{let n=(e==null?void 0:e.id)||sE++;return ni.addToast({title:t,...e,id:n}),n},M9=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",A9=T9,C9=()=>ni.toasts,P9=()=>ni.getActiveToasts(),Ur=Object.assign(A9,{success:ni.success,info:ni.info,warning:ni.warning,error:ni.error,custom:ni.custom,message:ni.message,promise:ni.promise,dismiss:ni.dismiss,loading:ni.loading},{getHistory:C9,getToasts:P9});function R9(t,{insertAt:e}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}R9(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-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;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)} +`);function yg(t){return t.label!==void 0}var N9=3,O9="32px",I9="16px",qR=4e3,D9=356,L9=14,k9=20,j9=200;function uo(...t){return t.filter(Boolean).join(" ")}function U9(t){let[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}var F9=t=>{var e,n,r,i,o,a,s,l,c,u,d;let{invert:f,toast:p,unstyled:y,interacting:v,setHeights:g,visibleToasts:m,heights:x,index:b,toasts:S,expanded:w,removeToast:E,defaultRichColors:T,closeButton:A,style:M,cancelButtonStyle:C,actionButtonStyle:P,className:R="",descriptionClassName:D="",duration:k,position:U,gap:O,loadingIcon:W,expandByDefault:L,classNames:j,icons:X,closeButtonAriaLabel:K="Close toast",pauseWhenPageIsHidden:F}=t,[Y,q]=Z.useState(null),[ee,te]=Z.useState(null),[Q,ce]=Z.useState(!1),[ae,fe]=Z.useState(!1),[we,le]=Z.useState(!1),[ie,G]=Z.useState(!1),[Ve,Ne]=Z.useState(!1),[st,Re]=Z.useState(0),[ct,Ye]=Z.useState(0),it=Z.useRef(p.duration||k||qR),Ft=Z.useRef(null),J=Z.useRef(null),B=b===0,ue=b+1<=m,me=p.type,be=p.dismissible!==!1,ge=p.className||"",rt=p.descriptionClassName||"",Ie=Z.useMemo(()=>x.findIndex(Se=>Se.toastId===p.id)||0,[x,p.id]),Je=Z.useMemo(()=>{var Se;return(Se=p.closeButton)!=null?Se:A},[p.closeButton,A]),tt=Z.useMemo(()=>p.duration||k||qR,[p.duration,k]),Ee=Z.useRef(0),Be=Z.useRef(0),ht=Z.useRef(0),ot=Z.useRef(null),[Le,_t]=U.split("-"),re=Z.useMemo(()=>x.reduce((Se,je,vt)=>vt>=Ie?Se:Se+je.height,0),[x,Ie]),ke=S9(),Me=p.invert||f,Ge=me==="loading";Be.current=Z.useMemo(()=>Ie*O+re,[Ie,re]),Z.useEffect(()=>{it.current=tt},[tt]),Z.useEffect(()=>{ce(!0)},[]),Z.useEffect(()=>{let Se=J.current;if(Se){let je=Se.getBoundingClientRect().height;return Ye(je),g(vt=>[{toastId:p.id,height:je,position:p.position},...vt]),()=>g(vt=>vt.filter(pt=>pt.toastId!==p.id))}},[g,p.id]),Z.useLayoutEffect(()=>{if(!Q)return;let Se=J.current,je=Se.style.height;Se.style.height="auto";let vt=Se.getBoundingClientRect().height;Se.style.height=je,Ye(vt),g(pt=>pt.find(fn=>fn.toastId===p.id)?pt.map(fn=>fn.toastId===p.id?{...fn,height:vt}:fn):[{toastId:p.id,height:vt,position:p.position},...pt])},[Q,p.title,p.description,g,p.id]);let Te=Z.useCallback(()=>{fe(!0),Re(Be.current),g(Se=>Se.filter(je=>je.toastId!==p.id)),setTimeout(()=>{E(p)},j9)},[p,E,g,Be]);Z.useEffect(()=>{if(p.promise&&me==="loading"||p.duration===1/0||p.type==="loading")return;let Se;return w||v||F&&ke?(()=>{if(ht.current{var je;(je=p.onAutoClose)==null||je.call(p,p),Te()},it.current)),()=>clearTimeout(Se)},[w,v,p,me,F,ke,Te]),Z.useEffect(()=>{p.delete&&Te()},[Te,p.delete]);function _e(){var Se,je,vt;return X!=null&&X.loading?Z.createElement("div",{className:uo(j==null?void 0:j.loader,(Se=p==null?void 0:p.classNames)==null?void 0:Se.loader,"sonner-loader"),"data-visible":me==="loading"},X.loading):W?Z.createElement("div",{className:uo(j==null?void 0:j.loader,(je=p==null?void 0:p.classNames)==null?void 0:je.loader,"sonner-loader"),"data-visible":me==="loading"},W):Z.createElement(v9,{className:uo(j==null?void 0:j.loader,(vt=p==null?void 0:p.classNames)==null?void 0:vt.loader),visible:me==="loading"})}return Z.createElement("li",{tabIndex:0,ref:J,className:uo(R,ge,j==null?void 0:j.toast,(e=p==null?void 0:p.classNames)==null?void 0:e.toast,j==null?void 0:j.default,j==null?void 0:j[me],(n=p==null?void 0:p.classNames)==null?void 0:n[me]),"data-sonner-toast":"","data-rich-colors":(r=p.richColors)!=null?r:T,"data-styled":!(p.jsx||p.unstyled||y),"data-mounted":Q,"data-promise":!!p.promise,"data-swiped":Ve,"data-removed":ae,"data-visible":ue,"data-y-position":Le,"data-x-position":_t,"data-index":b,"data-front":B,"data-swiping":we,"data-dismissible":be,"data-type":me,"data-invert":Me,"data-swipe-out":ie,"data-swipe-direction":ee,"data-expanded":!!(w||L&&Q),style:{"--index":b,"--toasts-before":b,"--z-index":S.length-b,"--offset":`${ae?st:Be.current}px`,"--initial-height":L?"auto":`${ct}px`,...M,...p.style},onDragEnd:()=>{le(!1),q(null),ot.current=null},onPointerDown:Se=>{Ge||!be||(Ft.current=new Date,Re(Be.current),Se.target.setPointerCapture(Se.pointerId),Se.target.tagName!=="BUTTON"&&(le(!0),ot.current={x:Se.clientX,y:Se.clientY}))},onPointerUp:()=>{var Se,je,vt,pt;if(ie||!be)return;ot.current=null;let fn=Number(((Se=J.current)==null?void 0:Se.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),jn=Number(((je=J.current)==null?void 0:je.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ui=new Date().getTime()-((vt=Ft.current)==null?void 0:vt.getTime()),_r=Y==="x"?fn:jn,nr=Math.abs(_r)/Ui;if(Math.abs(_r)>=k9||nr>.11){Re(Be.current),(pt=p.onDismiss)==null||pt.call(p,p),te(Y==="x"?fn>0?"right":"left":jn>0?"down":"up"),Te(),G(!0),Ne(!1);return}le(!1),q(null)},onPointerMove:Se=>{var je,vt,pt,fn;if(!ot.current||!be||((je=window.getSelection())==null?void 0:je.toString().length)>0)return;let jn=Se.clientY-ot.current.y,Ui=Se.clientX-ot.current.x,_r=(vt=t.swipeDirections)!=null?vt:U9(U);!Y&&(Math.abs(Ui)>1||Math.abs(jn)>1)&&q(Math.abs(Ui)>Math.abs(jn)?"x":"y");let nr={x:0,y:0};Y==="y"?(_r.includes("top")||_r.includes("bottom"))&&(_r.includes("top")&&jn<0||_r.includes("bottom")&&jn>0)&&(nr.y=jn):Y==="x"&&(_r.includes("left")||_r.includes("right"))&&(_r.includes("left")&&Ui<0||_r.includes("right")&&Ui>0)&&(nr.x=Ui),(Math.abs(nr.x)>0||Math.abs(nr.y)>0)&&Ne(!0),(pt=J.current)==null||pt.style.setProperty("--swipe-amount-x",`${nr.x}px`),(fn=J.current)==null||fn.style.setProperty("--swipe-amount-y",`${nr.y}px`)}},Je&&!p.jsx?Z.createElement("button",{"aria-label":K,"data-disabled":Ge,"data-close-button":!0,onClick:Ge||!be?()=>{}:()=>{var Se;Te(),(Se=p.onDismiss)==null||Se.call(p,p)},className:uo(j==null?void 0:j.closeButton,(i=p==null?void 0:p.classNames)==null?void 0:i.closeButton)},(o=X==null?void 0:X.close)!=null?o:w9):null,p.jsx||_.isValidElement(p.title)?p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title:Z.createElement(Z.Fragment,null,me||p.icon||p.promise?Z.createElement("div",{"data-icon":"",className:uo(j==null?void 0:j.icon,(a=p==null?void 0:p.classNames)==null?void 0:a.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||_e():null,p.type!=="loading"?p.icon||(X==null?void 0:X[me])||m9(me):null):null,Z.createElement("div",{"data-content":"",className:uo(j==null?void 0:j.content,(s=p==null?void 0:p.classNames)==null?void 0:s.content)},Z.createElement("div",{"data-title":"",className:uo(j==null?void 0:j.title,(l=p==null?void 0:p.classNames)==null?void 0:l.title)},typeof p.title=="function"?p.title():p.title),p.description?Z.createElement("div",{"data-description":"",className:uo(D,rt,j==null?void 0:j.description,(c=p==null?void 0:p.classNames)==null?void 0:c.description)},typeof p.description=="function"?p.description():p.description):null),_.isValidElement(p.cancel)?p.cancel:p.cancel&&yg(p.cancel)?Z.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||C,onClick:Se=>{var je,vt;yg(p.cancel)&&be&&((vt=(je=p.cancel).onClick)==null||vt.call(je,Se),Te())},className:uo(j==null?void 0:j.cancelButton,(u=p==null?void 0:p.classNames)==null?void 0:u.cancelButton)},p.cancel.label):null,_.isValidElement(p.action)?p.action:p.action&&yg(p.action)?Z.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||P,onClick:Se=>{var je,vt;yg(p.action)&&((vt=(je=p.action).onClick)==null||vt.call(je,Se),!Se.defaultPrevented&&Te())},className:uo(j==null?void 0:j.actionButton,(d=p==null?void 0:p.classNames)==null?void 0:d.actionButton)},p.action.label):null))};function KR(){if(typeof window>"u"||typeof document>"u")return"ltr";let t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function B9(t,e){let n={};return[t,e].forEach((r,i)=>{let o=i===1,a=o?"--mobile-offset":"--offset",s=o?I9:O9;function l(c){["top","right","bottom","left"].forEach(u=>{n[`${a}-${u}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{r[c]===void 0?n[`${a}-${c}`]=s:n[`${a}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):l(s)}),n}_.forwardRef(function(t,e){let{invert:n,position:r="bottom-right",hotkey:i=["altKey","KeyT"],expand:o,closeButton:a,className:s,offset:l,mobileOffset:c,theme:u="light",richColors:d,duration:f,style:p,visibleToasts:y=N9,toastOptions:v,dir:g=KR(),gap:m=L9,loadingIcon:x,icons:b,containerAriaLabel:S="Notifications",pauseWhenPageIsHidden:w}=t,[E,T]=Z.useState([]),A=Z.useMemo(()=>Array.from(new Set([r].concat(E.filter(F=>F.position).map(F=>F.position)))),[E,r]),[M,C]=Z.useState([]),[P,R]=Z.useState(!1),[D,k]=Z.useState(!1),[U,O]=Z.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),W=Z.useRef(null),L=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),j=Z.useRef(null),X=Z.useRef(!1),K=Z.useCallback(F=>{T(Y=>{var q;return(q=Y.find(ee=>ee.id===F.id))!=null&&q.delete||ni.dismiss(F.id),Y.filter(({id:ee})=>ee!==F.id)})},[]);return Z.useEffect(()=>ni.subscribe(F=>{if(F.dismiss){T(Y=>Y.map(q=>q.id===F.id?{...q,delete:!0}:q));return}setTimeout(()=>{$3.flushSync(()=>{T(Y=>{let q=Y.findIndex(ee=>ee.id===F.id);return q!==-1?[...Y.slice(0,q),{...Y[q],...F},...Y.slice(q+1)]:[F,...Y]})})})}),[]),Z.useEffect(()=>{if(u!=="system"){O(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?O("dark"):O("light")),typeof window>"u")return;let F=window.matchMedia("(prefers-color-scheme: dark)");try{F.addEventListener("change",({matches:Y})=>{O(Y?"dark":"light")})}catch{F.addListener(({matches:q})=>{try{O(q?"dark":"light")}catch(ee){console.error(ee)}})}},[u]),Z.useEffect(()=>{E.length<=1&&R(!1)},[E]),Z.useEffect(()=>{let F=Y=>{var q,ee;i.every(te=>Y[te]||Y.code===te)&&(R(!0),(q=W.current)==null||q.focus()),Y.code==="Escape"&&(document.activeElement===W.current||(ee=W.current)!=null&&ee.contains(document.activeElement))&&R(!1)};return document.addEventListener("keydown",F),()=>document.removeEventListener("keydown",F)},[i]),Z.useEffect(()=>{if(W.current)return()=>{j.current&&(j.current.focus({preventScroll:!0}),j.current=null,X.current=!1)}},[W.current]),Z.createElement("section",{ref:e,"aria-label":`${S} ${L}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},A.map((F,Y)=>{var q;let[ee,te]=F.split("-");return E.length?Z.createElement("ol",{key:F,dir:g==="auto"?KR():g,tabIndex:-1,ref:W,className:s,"data-sonner-toaster":!0,"data-theme":U,"data-y-position":ee,"data-lifted":P&&E.length>1&&!o,"data-x-position":te,style:{"--front-toast-height":`${((q=M[0])==null?void 0:q.height)||0}px`,"--width":`${D9}px`,"--gap":`${m}px`,...p,...B9(l,c)},onBlur:Q=>{X.current&&!Q.currentTarget.contains(Q.relatedTarget)&&(X.current=!1,j.current&&(j.current.focus({preventScroll:!0}),j.current=null))},onFocus:Q=>{Q.target instanceof HTMLElement&&Q.target.dataset.dismissible==="false"||X.current||(X.current=!0,j.current=Q.relatedTarget)},onMouseEnter:()=>R(!0),onMouseMove:()=>R(!0),onMouseLeave:()=>{D||R(!1)},onDragEnd:()=>R(!1),onPointerDown:Q=>{Q.target instanceof HTMLElement&&Q.target.dataset.dismissible==="false"||k(!0)},onPointerUp:()=>k(!1)},E.filter(Q=>!Q.position&&Y===0||Q.position===F).map((Q,ce)=>{var ae,fe;return Z.createElement(F9,{key:Q.id,icons:b,index:ce,toast:Q,defaultRichColors:d,duration:(ae=v==null?void 0:v.duration)!=null?ae:f,className:v==null?void 0:v.className,descriptionClassName:v==null?void 0:v.descriptionClassName,invert:n,visibleToasts:y,closeButton:(fe=v==null?void 0:v.closeButton)!=null?fe:a,interacting:D,position:F,style:v==null?void 0:v.style,unstyled:v==null?void 0:v.unstyled,classNames:v==null?void 0:v.classNames,cancelButtonStyle:v==null?void 0:v.cancelButtonStyle,actionButtonStyle:v==null?void 0:v.actionButtonStyle,removeToast:K,toasts:E.filter(we=>we.position==Q.position),heights:M.filter(we=>we.position==Q.position),setHeights:C,expandByDefault:o,gap:m,loadingIcon:x,expanded:P,pauseWhenPageIsHidden:w,swipeDirections:t.swipeDirections})})):null}))});function $9(t){if(!(t instanceof DataTransfer))throw new Error('Data must be of type "DataTransfer"');const e={};function n(r){const i=a=>a!==null&&typeof a=="object"&&"isFile"in a&&typeof a.file=="function"&&"fullPath"in a,o=a=>a!==null&&typeof a=="object"&&"isFile"in a&&typeof a.createReader=="function";if(i(r)&&r.isFile)return new Promise(a=>{r.file(s=>{e[r.fullPath]=s,a()})});if(o(r)&&!r.isFile){const a=r.createReader();return new Promise(s=>{const l=[];function c(){a.readEntries(u=>{u.length===0?Promise.all(l).then(()=>s()):(u.forEach(d=>{l.push(n(d))}),c())})}c()})}return Promise.resolve()}return new Promise(r=>{const i=t.items&&Array.from(t.items),o=Array.from(t.files);if(i&&i.length&&"webkitGetAsEntry"in i[0]){const a=[];for(let s=0;sr(e))}else o.filter(a=>a.size!==0).forEach(a=>e["/"+a.name]=a),r(e)})}function YR(t){return t.replace(/\\/g,"/").split(/\//g).reduce((e,n)=>(n===".."?e.pop():n!=="."&&e.push(n),e),[]).join("/")}function JR(t){return new Promise((e,n)=>{const r=new FileReader;r.onload=i=>{i.target&&i.target.result?e(i.target.result):n(new Error("Failed to read Urdf file content"))},r.onerror=()=>n(new Error("Error reading Urdf file")),r.readAsText(t)})}async function z9(t,e){const n=await $9(t),r=Object.keys(n).map(a=>YR(a)),i=r.filter(a=>/urdf$/i.test(a)),o={};if(i.forEach(a=>{o[a]=URL.createObjectURL(n[a])}),i.length>0){const s=i[0].match(/^(\/[^/]+\/)/);s&&s[1]&&s[1]}return e.setUrlModifierFunc(a=>{var u;const l=YR(a).split("/").pop()||"";let c=r.find(d=>d.endsWith(l));if(!c&&l.includes(".")){const d="."+l.split(".").pop();c=r.find(f=>f.endsWith(d))}if(c!=null){const d=((u=c.split(".").pop())==null?void 0:u.toLowerCase())||"",f=new Blob([n[c]],{type:H9(d)}),p=URL.createObjectURL(f)+"#."+d;return setTimeout(()=>URL.revokeObjectURL(p),5e3),p}return console.warn(`No matching file found for: ${a}`),a}),{files:n,availableModels:i,blobUrls:o}}function H9(t){switch(t.toLowerCase()){case"stl":return"model/stl";case"obj":return"model/obj";case"gltf":case"glb":return"model/gltf+json";case"dae":return"model/vnd.collada+xml";case"urdf":return"application/xml";default:return"application/octet-stream"}}const sU=_.createContext(void 0),V9=({children:t})=>{const[e,n]=_.useState(null),[r,i]=_.useState({}),[o,a]=_.useState([]),[s,l]=_.useState(!1),[c,u]=_.useState([]),[d,f]=_.useState(!0),[p,y]=_.useState(null),[v,g]=_.useState(null);_.useEffect(()=>{if(!d||p)return;let P=!1;return(async()=>{try{const R=await fetch("/so-101-urdf/urdf/so101_new_calib.urdf");if(!R.ok)throw new Error(`Failed to fetch default Urdf: ${R.statusText}`);const D=await R.text();P||y(D)}catch(R){P||console.error("Error loading default Urdf content:",R)}})(),()=>{P=!0}},[d,p]);const m=_.useRef([]),x=_.useCallback(()=>{f(!0),y(null),g(null),Ur.info("Switched to default model",{description:"The default ARM100 robot model is now displayed."})},[]),b=_.useCallback(P=>(m.current.push(P),()=>{m.current=m.current.filter(R=>R!==P)}),[]),S=_.useCallback(P=>{n(P)},[]),w=_.useCallback(P=>{P.hasUrdf?f(!1):x(),m.current.forEach(R=>R(P))},[x]),E=_.useCallback(async P=>{var k;if(!e)return;const R=Object.values(r).filter(U=>U===P.blobUrl).map(U=>{const O=Object.keys(r).find(W=>r[W]===U);return O?{path:O,url:U}:null}).filter(U=>U!==null);if(R.length===0){console.error("โŒ Could not find file for selected Urdf model");return}const D=Ur.loading("Loading Urdf model...",{description:"Preparing 3D visualization",duration:5e3});try{const U=(k=R[0])==null?void 0:k.path;if(!U||!r[U])throw new Error("File not found in records");const W=await(await fetch(P.blobUrl)).blob(),L=new File([W],U.split("/").pop()||"model.urdf",{type:"application/xml"}),j=await JR(L);y(j),Ur.dismiss(D),f(!1);const X=P.name||P.path.split("/").pop()||"Unknown";Ur.success("Urdf model loaded successfully",{description:`Model: ${X}`,duration:3e3}),w({hasUrdf:!0,modelName:X})}catch(U){console.error("โŒ Error processing selected Urdf:",U),Ur.dismiss(D),Ur.error("Error loading Urdf",{description:`Error: ${U instanceof Error?U.message:String(U)}`,duration:3e3})}},[r,e,w]),T=_.useCallback(P=>{var D;if(!e){console.error("โŒ No Urdf processor available");return}l(!1);const R=P.name||((D=P.path.split("/").pop())==null?void 0:D.replace(/\.urdf$/i,""))||"Unknown";e.loadUrdf(P.blobUrl),f(!1),Ur.info(`Loading model: ${R}`,{description:"Preparing 3D visualization",duration:2e3}),w({hasUrdf:!0,modelName:R}),E(P)},[e,w,E]),A=_.useCallback(async(P,R)=>{Object.values(r).forEach(URL.revokeObjectURL),i({}),a([]),u([]);try{if(R.length>0&&e){const D={};R.forEach(U=>{P[U]&&(D[U]=URL.createObjectURL(P[U]))}),i(D),a(R);const k=R.map(U=>{const W=(U.split("/").pop()||"").replace(/\.urdf$/i,"");return{path:U,blobUrl:D[U],name:W}});if(u(k),R.length===1){const O=(R[0].split("/").pop()||"").replace(/\.urdf$/i,""),W=D[R[0]];if(W)if(e.loadUrdf(W),f(!1),P[R[0]]){const L=Ur.loading("Loading Urdf model...",{description:"Preparing 3D visualization",duration:5e3});try{const j=await JR(P[R[0]]);y(j),Ur.dismiss(L),Ur.success("Urdf model loaded successfully",{description:`Model: ${O}`,duration:3e3}),w({hasUrdf:!0,modelName:O})}catch(j){console.error("Error loading Urdf:",j),Ur.dismiss(L),Ur.error("Error loading Urdf",{description:`Error: ${j instanceof Error?j.message:String(j)}`,duration:3e3}),w({hasUrdf:!0,modelName:O})}}else console.error("Could not find file for Urdf model:",R[0]),w({hasUrdf:!0,modelName:O});else console.warn(`No blob URL found for ${R[0]}, using path directly`),e.loadUrdf(R[0]),f(!1),w({hasUrdf:!0,modelName:O})}else l(!0),w({hasUrdf:!0,modelName:"Multiple models available"})}else w({hasUrdf:!1}),x(),Ur.error("No Urdf file found",{description:"Please upload a folder containing a .urdf file.",duration:3e3})}catch(D){console.error("Error processing Urdf files:",D),Ur.error("Error processing files",{description:`Error: ${D instanceof Error?D.message:String(D)}`,duration:3e3}),x()}},[w,r,e,x]),M=_.useRef(r);M.current=r,_.useEffect(()=>()=>{Object.values(M.current).forEach(URL.revokeObjectURL)},[]);const C=_.useMemo(()=>({urdfProcessor:e,registerUrdfProcessor:S,onUrdfDetected:b,processUrdfFiles:A,urdfBlobUrls:r,alternativeUrdfModels:o,isSelectionModalOpen:s,setIsSelectionModalOpen:l,urdfModelOptions:c,selectUrdfModel:T,isDefaultModel:d,setIsDefaultModel:f,resetToDefaultModel:x,urdfContent:p,currentAnimationConfig:v,setCurrentAnimationConfig:g}),[e,S,b,A,r,o,s,c,T,d,x,p,v]);return h.jsx(sU.Provider,{value:C,children:t})},lU=()=>{const t=_.useContext(sU);if(t===void 0)throw new Error("useUrdf must be used within a UrdfProvider");return t},G9=_.createContext(void 0),W9=({children:t})=>{const[e,n]=_.useState(!1),{urdfProcessor:r,processUrdfFiles:i}=lU(),o=u=>{u.preventDefault(),u.stopPropagation()},a=u=>{u.preventDefault(),u.stopPropagation(),n(!0)},s=u=>{u.preventDefault(),u.stopPropagation(),(!u.relatedTarget||!u.relatedTarget.closest("html"))&&n(!1)},l=_.useCallback(async u=>{if(u.preventDefault(),u.stopPropagation(),n(!1),!(!u.dataTransfer||!r))try{const{availableModels:d,files:f}=await z9(u.dataTransfer,r);await i(f,d)}catch(d){console.error("Error in handleDrop:",d)}},[r,i]);_.useEffect(()=>(document.addEventListener("dragover",o),document.addEventListener("dragenter",a),document.addEventListener("dragleave",s),document.addEventListener("drop",l),()=>{document.removeEventListener("dragover",o),document.removeEventListener("dragenter",a),document.removeEventListener("dragleave",s),document.removeEventListener("drop",l)}),[l]);const c=_.useMemo(()=>({isDragging:e,setIsDragging:n,handleDrop:l}),[e,l]);return h.jsxs(G9.Provider,{value:c,children:[t,e&&h.jsx("div",{className:"fixed inset-0 bg-primary/10 pointer-events-none z-50 flex items-center justify-center",children:h.jsxs("div",{className:"bg-background p-8 rounded-lg shadow-lg text-center",children:[h.jsx("div",{className:"text-3xl font-bold mb-4",children:"Drop Urdf Files Here"}),h.jsx("p",{className:"text-muted-foreground",children:"Release to upload your robot model"})]})})]})},X9=1,q9=1e6;let A_=0;function K9(){return A_=(A_+1)%Number.MAX_SAFE_INTEGER,A_.toString()}const C_=new Map,ZR=t=>{if(C_.has(t))return;const e=setTimeout(()=>{C_.delete(t),Vh({type:"REMOVE_TOAST",toastId:t})},q9);C_.set(t,e)},Y9=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,X9)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(n=>n.id===e.toast.id?{...n,...e.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=e;return n?ZR(n):t.toasts.forEach(r=>{ZR(r.id)}),{...t,toasts:t.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(n=>n.id!==e.toastId)}}},Dv=[];let Lv={toasts:[]};function Vh(t){Lv=Y9(Lv,t),Dv.forEach(e=>{e(Lv)})}function J9({...t}){const e=K9(),n=i=>Vh({type:"UPDATE_TOAST",toast:{...i,id:e}}),r=()=>Vh({type:"DISMISS_TOAST",toastId:e});return Vh({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:i=>{i||r()}}}),{id:e,dismiss:r,update:n}}function Dr(){const[t,e]=_.useState(Lv);return _.useEffect(()=>(Dv.push(e),()=>{const n=Dv.indexOf(e);n>-1&&Dv.splice(n,1)}),[t]),{...t,toast:J9,dismiss:n=>Vh({type:"DISMISS_TOAST",toastId:n})}}function Oe(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t==null||t(i),n===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function QR(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function is(...t){return e=>{let n=!1;const r=t.map(i=>{const o=QR(i,e);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i{const{children:a,...s}=o,l=_.useMemo(()=>s,Object.values(s));return h.jsx(n.Provider,{value:l,children:a})};r.displayName=t+"Provider";function i(o){const a=_.useContext(n);if(a)return a;if(e!==void 0)return e;throw new Error(`\`${o}\` must be used within \`${t}\``)}return[r,i]}function mi(t,e=[]){let n=[];function r(o,a){const s=_.createContext(a),l=n.length;n=[...n,a];const c=d=>{var m;const{scope:f,children:p,...y}=d,v=((m=f==null?void 0:f[t])==null?void 0:m[l])||s,g=_.useMemo(()=>y,Object.values(y));return h.jsx(v.Provider,{value:g,children:p})};c.displayName=o+"Provider";function u(d,f){var v;const p=((v=f==null?void 0:f[t])==null?void 0:v[l])||s,y=_.useContext(p);if(y)return y;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${o}\``)}return[c,u]}const i=()=>{const o=n.map(a=>_.createContext(a));return function(s){const l=(s==null?void 0:s[t])||o;return _.useMemo(()=>({[`__scope${t}`]:{...s,[t]:l}}),[s,l])}};return i.scopeName=t,[r,Q9(i,...e)]}function Q9(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((s,{useScope:l,scopeName:c})=>{const d=l(o)[`__scope${c}`];return{...s,...d}},{});return _.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}function sl(t){const e=t7(t),n=_.forwardRef((r,i)=>{const{children:o,...a}=r,s=_.Children.toArray(o),l=s.find(n7);if(l){const c=l.props.children,u=s.map(d=>d===l?_.Children.count(c)>1?_.Children.only(null):_.isValidElement(c)?c.props.children:null:d);return h.jsx(e,{...a,ref:i,children:_.isValidElement(c)?_.cloneElement(c,void 0,u):null})}return h.jsx(e,{...a,ref:i,children:o})});return n.displayName=`${t}.Slot`,n}var e7=sl("Slot");function t7(t){const e=_.forwardRef((n,r)=>{const{children:i,...o}=n;if(_.isValidElement(i)){const a=i7(i),s=r7(o,i.props);return i.type!==_.Fragment&&(s.ref=r?is(r,a):a),_.cloneElement(i,s)}return _.Children.count(i)>1?_.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var cU=Symbol("radix.slottable");function uU(t){const e=({children:n})=>h.jsx(h.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=cU,e}function n7(t){return _.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===cU}function r7(t,e){const n={...e};for(const r in e){const i=t[r],o=e[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{const l=o(...s);return i(...s),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...t,...n}}function i7(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function rx(t){const e=t+"CollectionProvider",[n,r]=mi(e),[i,o]=n(e,{collectionRef:{current:null},itemMap:new Map}),a=v=>{const{scope:g,children:m}=v,x=Z.useRef(null),b=Z.useRef(new Map).current;return h.jsx(i,{scope:g,itemMap:b,collectionRef:x,children:m})};a.displayName=e;const s=t+"CollectionSlot",l=sl(s),c=Z.forwardRef((v,g)=>{const{scope:m,children:x}=v,b=o(s,m),S=Ot(g,b.collectionRef);return h.jsx(l,{ref:S,children:x})});c.displayName=s;const u=t+"CollectionItemSlot",d="data-radix-collection-item",f=sl(u),p=Z.forwardRef((v,g)=>{const{scope:m,children:x,...b}=v,S=Z.useRef(null),w=Ot(g,S),E=o(u,m);return Z.useEffect(()=>(E.itemMap.set(S,{ref:S,...b}),()=>void E.itemMap.delete(S))),h.jsx(f,{[d]:"",ref:w,children:x})});p.displayName=u;function y(v){const g=o(t+"CollectionConsumer",v);return Z.useCallback(()=>{const x=g.collectionRef.current;if(!x)return[];const b=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(g.itemMap.values()).sort((E,T)=>b.indexOf(E.ref.current)-b.indexOf(T.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:a,Slot:c,ItemSlot:p},y,r]}var o7=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],nt=o7.reduce((t,e)=>{const n=sl(`Primitive.${e}`),r=_.forwardRef((i,o)=>{const{asChild:a,...s}=i,l=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(l,{...s,ref:o})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function JM(t,e){t&&Bc.flushSync(()=>t.dispatchEvent(e))}function di(t){const e=_.useRef(t);return _.useEffect(()=>{e.current=t}),_.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function a7(t,e=globalThis==null?void 0:globalThis.document){const n=di(t);_.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var s7="DismissableLayer",lE="dismissableLayer.update",l7="dismissableLayer.pointerDownOutside",c7="dismissableLayer.focusOutside",eN,dU=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),zc=_.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:a,onDismiss:s,...l}=t,c=_.useContext(dU),[u,d]=_.useState(null),f=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=_.useState({}),y=Ot(e,T=>d(T)),v=Array.from(c.layers),[g]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),m=v.indexOf(g),x=u?v.indexOf(u):-1,b=c.layersWithOutsidePointerEventsDisabled.size>0,S=x>=m,w=d7(T=>{const A=T.target,M=[...c.branches].some(C=>C.contains(A));!S||M||(i==null||i(T),a==null||a(T),T.defaultPrevented||s==null||s())},f),E=f7(T=>{const A=T.target;[...c.branches].some(C=>C.contains(A))||(o==null||o(T),a==null||a(T),T.defaultPrevented||s==null||s())},f);return a7(T=>{x===c.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&s&&(T.preventDefault(),s()))},f),_.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(eN=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),tN(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=eN)}},[u,f,n,c]),_.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),tN())},[u,c]),_.useEffect(()=>{const T=()=>p({});return document.addEventListener(lE,T),()=>document.removeEventListener(lE,T)},[]),h.jsx(nt.div,{...l,ref:y,style:{pointerEvents:b?S?"auto":"none":void 0,...t.style},onFocusCapture:Oe(t.onFocusCapture,E.onFocusCapture),onBlurCapture:Oe(t.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Oe(t.onPointerDownCapture,w.onPointerDownCapture)})});zc.displayName=s7;var u7="DismissableLayerBranch",fU=_.forwardRef((t,e)=>{const n=_.useContext(dU),r=_.useRef(null),i=Ot(e,r);return _.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),h.jsx(nt.div,{...t,ref:i})});fU.displayName=u7;function d7(t,e=globalThis==null?void 0:globalThis.document){const n=di(t),r=_.useRef(!1),i=_.useRef(()=>{});return _.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let l=function(){hU(l7,n,c,{discrete:!0})};const c={originalEvent:s};s.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=l,e.addEventListener("click",i.current,{once:!0})):l()}else e.removeEventListener("click",i.current);r.current=!1},a=window.setTimeout(()=>{e.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),e.removeEventListener("pointerdown",o),e.removeEventListener("click",i.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function f7(t,e=globalThis==null?void 0:globalThis.document){const n=di(t),r=_.useRef(!1);return _.useEffect(()=>{const i=o=>{o.target&&!r.current&&hU(c7,n,{originalEvent:o},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function tN(){const t=new CustomEvent(lE);document.dispatchEvent(t)}function hU(t,e,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?JM(i,o):i.dispatchEvent(o)}var h7=zc,p7=fU,ur=globalThis!=null&&globalThis.document?_.useLayoutEffect:()=>{},m7="Portal",vf=_.forwardRef((t,e)=>{var s;const{container:n,...r}=t,[i,o]=_.useState(!1);ur(()=>o(!0),[]);const a=n||i&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return a?$3.createPortal(h.jsx(nt.div,{...r,ref:e}),a):null});vf.displayName=m7;function g7(t,e){return _.useReducer((n,r)=>e[n][r]??n,t)}var gi=t=>{const{present:e,children:n}=t,r=v7(e),i=typeof n=="function"?n({present:r.isPresent}):_.Children.only(n),o=Ot(r.ref,y7(i));return typeof n=="function"||r.isPresent?_.cloneElement(i,{ref:o}):null};gi.displayName="Presence";function v7(t){const[e,n]=_.useState(),r=_.useRef(null),i=_.useRef(t),o=_.useRef("none"),a=t?"mounted":"unmounted",[s,l]=g7(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const c=xg(r.current);o.current=s==="mounted"?c:"none"},[s]),ur(()=>{const c=r.current,u=i.current;if(u!==t){const f=o.current,p=xg(c);t?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&f!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,l]),ur(()=>{if(e){let c;const u=e.ownerDocument.defaultView??window,d=p=>{const v=xg(r.current).includes(p.animationName);if(p.target===e&&v&&(l("ANIMATION_END"),!i.current)){const g=e.style.animationFillMode;e.style.animationFillMode="forwards",c=u.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=g)})}},f=p=>{p.target===e&&(o.current=xg(r.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",d),e.addEventListener("animationend",d),()=>{u.clearTimeout(c),e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",d),e.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:_.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function xg(t){return(t==null?void 0:t.animationName)||"none"}function y7(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var x7=rM[" useInsertionEffect ".trim().toString()]||ur;function $o({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[i,o,a]=b7({defaultProp:e,onChange:n}),s=t!==void 0,l=s?t:i;{const u=_.useRef(t!==void 0);_.useEffect(()=>{const d=u.current;d!==s&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=s},[s,r])}const c=_.useCallback(u=>{var d;if(s){const f=_7(u)?u(t):u;f!==t&&((d=a.current)==null||d.call(a,f))}else o(u)},[s,t,o,a]);return[l,c]}function b7({defaultProp:t,onChange:e}){const[n,r]=_.useState(t),i=_.useRef(n),o=_.useRef(e);return x7(()=>{o.current=e},[e]),_.useEffect(()=>{var a;i.current!==n&&((a=o.current)==null||a.call(o,n),i.current=n)},[n,i]),[n,r,o]}function _7(t){return typeof t=="function"}var pU=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),w7="VisuallyHidden",ix=_.forwardRef((t,e)=>h.jsx(nt.span,{...t,ref:e,style:{...pU,...t.style}}));ix.displayName=w7;var S7=ix,ZM="ToastProvider",[QM,E7,T7]=rx("Toast"),[mU,bDe]=mi("Toast",[T7]),[M7,ox]=mU(ZM),gU=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:i="right",swipeThreshold:o=50,children:a}=t,[s,l]=_.useState(null),[c,u]=_.useState(0),d=_.useRef(!1),f=_.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${ZM}\`. Expected non-empty \`string\`.`),h.jsx(QM.Provider,{scope:e,children:h.jsx(M7,{scope:e,label:n,duration:r,swipeDirection:i,swipeThreshold:o,toastCount:c,viewport:s,onViewportChange:l,onToastAdd:_.useCallback(()=>u(p=>p+1),[]),onToastRemove:_.useCallback(()=>u(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:a})})};gU.displayName=ZM;var vU="ToastViewport",A7=["F8"],cE="toast.viewportPause",uE="toast.viewportResume",yU=_.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=A7,label:i="Notifications ({hotkey})",...o}=t,a=ox(vU,n),s=E7(n),l=_.useRef(null),c=_.useRef(null),u=_.useRef(null),d=_.useRef(null),f=Ot(e,d,a.onViewportChange),p=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),y=a.toastCount>0;_.useEffect(()=>{const g=m=>{var b;r.length!==0&&r.every(S=>m[S]||m.code===S)&&((b=d.current)==null||b.focus())};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[r]),_.useEffect(()=>{const g=l.current,m=d.current;if(y&&g&&m){const x=()=>{if(!a.isClosePausedRef.current){const E=new CustomEvent(cE);m.dispatchEvent(E),a.isClosePausedRef.current=!0}},b=()=>{if(a.isClosePausedRef.current){const E=new CustomEvent(uE);m.dispatchEvent(E),a.isClosePausedRef.current=!1}},S=E=>{!g.contains(E.relatedTarget)&&b()},w=()=>{g.contains(document.activeElement)||b()};return g.addEventListener("focusin",x),g.addEventListener("focusout",S),g.addEventListener("pointermove",x),g.addEventListener("pointerleave",w),window.addEventListener("blur",x),window.addEventListener("focus",b),()=>{g.removeEventListener("focusin",x),g.removeEventListener("focusout",S),g.removeEventListener("pointermove",x),g.removeEventListener("pointerleave",w),window.removeEventListener("blur",x),window.removeEventListener("focus",b)}}},[y,a.isClosePausedRef]);const v=_.useCallback(({tabbingDirection:g})=>{const x=s().map(b=>{const S=b.ref.current,w=[S,...B7(S)];return g==="forwards"?w:w.reverse()});return(g==="forwards"?x.reverse():x).flat()},[s]);return _.useEffect(()=>{const g=d.current;if(g){const m=x=>{var w,E,T;const b=x.altKey||x.ctrlKey||x.metaKey;if(x.key==="Tab"&&!b){const A=document.activeElement,M=x.shiftKey;if(x.target===g&&M){(w=c.current)==null||w.focus();return}const R=v({tabbingDirection:M?"backwards":"forwards"}),D=R.findIndex(k=>k===A);P_(R.slice(D+1))?x.preventDefault():M?(E=c.current)==null||E.focus():(T=u.current)==null||T.focus()}};return g.addEventListener("keydown",m),()=>g.removeEventListener("keydown",m)}},[s,v]),h.jsxs(p7,{ref:l,role:"region","aria-label":i.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:y?void 0:"none"},children:[y&&h.jsx(dE,{ref:c,onFocusFromOutsideViewport:()=>{const g=v({tabbingDirection:"forwards"});P_(g)}}),h.jsx(QM.Slot,{scope:n,children:h.jsx(nt.ol,{tabIndex:-1,...o,ref:f})}),y&&h.jsx(dE,{ref:u,onFocusFromOutsideViewport:()=>{const g=v({tabbingDirection:"backwards"});P_(g)}})]})});yU.displayName=vU;var xU="ToastFocusProxy",dE=_.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=t,o=ox(xU,n);return h.jsx(ix,{"aria-hidden":!0,tabIndex:0,...i,ref:e,style:{position:"fixed"},onFocus:a=>{var c;const s=a.relatedTarget;!((c=o.viewport)!=null&&c.contains(s))&&r()}})});dE.displayName=xU;var Sm="Toast",C7="toast.swipeStart",P7="toast.swipeMove",R7="toast.swipeCancel",N7="toast.swipeEnd",bU=_.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:i,onOpenChange:o,...a}=t,[s,l]=$o({prop:r,defaultProp:i??!0,onChange:o,caller:Sm});return h.jsx(gi,{present:n||s,children:h.jsx(D7,{open:s,...a,ref:e,onClose:()=>l(!1),onPause:di(t.onPause),onResume:di(t.onResume),onSwipeStart:Oe(t.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Oe(t.onSwipeMove,c=>{const{x:u,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${d}px`)}),onSwipeCancel:Oe(t.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Oe(t.onSwipeEnd,c=>{const{x:u,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${d}px`),l(!1)})})})});bU.displayName=Sm;var[O7,I7]=mU(Sm,{onClose(){}}),D7=_.forwardRef((t,e)=>{const{__scopeToast:n,type:r="foreground",duration:i,open:o,onClose:a,onEscapeKeyDown:s,onPause:l,onResume:c,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:p,...y}=t,v=ox(Sm,n),[g,m]=_.useState(null),x=Ot(e,k=>m(k)),b=_.useRef(null),S=_.useRef(null),w=i||v.duration,E=_.useRef(0),T=_.useRef(w),A=_.useRef(0),{onToastAdd:M,onToastRemove:C}=v,P=di(()=>{var U;(g==null?void 0:g.contains(document.activeElement))&&((U=v.viewport)==null||U.focus()),a()}),R=_.useCallback(k=>{!k||k===1/0||(window.clearTimeout(A.current),E.current=new Date().getTime(),A.current=window.setTimeout(P,k))},[P]);_.useEffect(()=>{const k=v.viewport;if(k){const U=()=>{R(T.current),c==null||c()},O=()=>{const W=new Date().getTime()-E.current;T.current=T.current-W,window.clearTimeout(A.current),l==null||l()};return k.addEventListener(cE,O),k.addEventListener(uE,U),()=>{k.removeEventListener(cE,O),k.removeEventListener(uE,U)}}},[v.viewport,w,l,c,R]),_.useEffect(()=>{o&&!v.isClosePausedRef.current&&R(w)},[o,w,v.isClosePausedRef,R]),_.useEffect(()=>(M(),()=>C()),[M,C]);const D=_.useMemo(()=>g?AU(g):null,[g]);return v.viewport?h.jsxs(h.Fragment,{children:[D&&h.jsx(L7,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:D}),h.jsx(O7,{scope:n,onClose:P,children:Bc.createPortal(h.jsx(QM.ItemSlot,{scope:n,children:h.jsx(h7,{asChild:!0,onEscapeKeyDown:Oe(s,()=>{v.isFocusedToastEscapeKeyDownRef.current||P(),v.isFocusedToastEscapeKeyDownRef.current=!1}),children:h.jsx(nt.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":v.swipeDirection,...y,ref:x,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:Oe(t.onKeyDown,k=>{k.key==="Escape"&&(s==null||s(k.nativeEvent),k.nativeEvent.defaultPrevented||(v.isFocusedToastEscapeKeyDownRef.current=!0,P()))}),onPointerDown:Oe(t.onPointerDown,k=>{k.button===0&&(b.current={x:k.clientX,y:k.clientY})}),onPointerMove:Oe(t.onPointerMove,k=>{if(!b.current)return;const U=k.clientX-b.current.x,O=k.clientY-b.current.y,W=!!S.current,L=["left","right"].includes(v.swipeDirection),j=["left","up"].includes(v.swipeDirection)?Math.min:Math.max,X=L?j(0,U):0,K=L?0:j(0,O),F=k.pointerType==="touch"?10:2,Y={x:X,y:K},q={originalEvent:k,delta:Y};W?(S.current=Y,bg(P7,d,q,{discrete:!1})):nN(Y,v.swipeDirection,F)?(S.current=Y,bg(C7,u,q,{discrete:!1}),k.target.setPointerCapture(k.pointerId)):(Math.abs(U)>F||Math.abs(O)>F)&&(b.current=null)}),onPointerUp:Oe(t.onPointerUp,k=>{const U=S.current,O=k.target;if(O.hasPointerCapture(k.pointerId)&&O.releasePointerCapture(k.pointerId),S.current=null,b.current=null,U){const W=k.currentTarget,L={originalEvent:k,delta:U};nN(U,v.swipeDirection,v.swipeThreshold)?bg(N7,p,L,{discrete:!0}):bg(R7,f,L,{discrete:!0}),W.addEventListener("click",j=>j.preventDefault(),{once:!0})}})})})}),v.viewport)})]}):null}),L7=t=>{const{__scopeToast:e,children:n,...r}=t,i=ox(Sm,e),[o,a]=_.useState(!1),[s,l]=_.useState(!1);return U7(()=>a(!0)),_.useEffect(()=>{const c=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(c)},[]),s?null:h.jsx(vf,{asChild:!0,children:h.jsx(ix,{...r,children:o&&h.jsxs(h.Fragment,{children:[i.label," ",n]})})})},k7="ToastTitle",_U=_.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return h.jsx(nt.div,{...r,ref:e})});_U.displayName=k7;var j7="ToastDescription",wU=_.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return h.jsx(nt.div,{...r,ref:e})});wU.displayName=j7;var SU="ToastAction",EU=_.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?h.jsx(MU,{altText:n,asChild:!0,children:h.jsx(eA,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${SU}\`. Expected non-empty \`string\`.`),null)});EU.displayName=SU;var TU="ToastClose",eA=_.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,i=I7(TU,n);return h.jsx(MU,{asChild:!0,children:h.jsx(nt.button,{type:"button",...r,ref:e,onClick:Oe(t.onClick,i.onClose)})})});eA.displayName=TU;var MU=_.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...i}=t;return h.jsx(nt.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...i,ref:e})});function AU(t){const e=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),F7(r)){const i=r.ariaHidden||r.hidden||r.style.display==="none",o=r.dataset.radixToastAnnounceExclude==="";if(!i)if(o){const a=r.dataset.radixToastAnnounceAlt;a&&e.push(a)}else e.push(...AU(r))}}),e}function bg(t,e,n,{discrete:r}){const i=n.originalEvent.currentTarget,o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?JM(i,o):i.dispatchEvent(o)}var nN=(t,e,n=0)=>{const r=Math.abs(t.x),i=Math.abs(t.y),o=r>i;return e==="left"||e==="right"?o&&r>n:!o&&i>n};function U7(t=()=>{}){const e=di(t);ur(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}function F7(t){return t.nodeType===t.ELEMENT_NODE}function B7(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function P_(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var $7=gU,CU=yU,PU=bU,RU=_U,NU=wU,OU=EU,IU=eA;function DU(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;etypeof t=="boolean"?`${t}`:t===0?"0":t,iN=zt,Em=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return iN(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=e,a=Object.keys(i).map(c=>{const u=n==null?void 0:n[c],d=o==null?void 0:o[c];if(u===null)return null;const f=rN(u)||rN(d);return i[c][f]}),s=n&&Object.entries(n).reduce((c,u)=>{let[d,f]=u;return f===void 0||(c[d]=f),c},{}),l=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:f,...p}=u;return Object.entries(p).every(y=>{let[v,g]=y;return Array.isArray(g)?g.includes({...o,...s}[v]):{...o,...s}[v]===g})?[...c,d,f]:c},[]);return iN(t,a,l,n==null?void 0:n.class,n==null?void 0:n.className)};/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const z7=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),LU=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var H7={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const V7=_.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:a,...s},l)=>_.createElement("svg",{ref:l,...H7,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:LU("lucide",i),...s},[...a.map(([c,u])=>_.createElement(c,u)),...Array.isArray(o)?o:[o]]));/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Mt=(t,e)=>{const n=_.forwardRef(({className:r,...i},o)=>_.createElement(V7,{ref:o,iconNode:e,className:LU(`lucide-${z7(t)}`,r),...i}));return n.displayName=`${t}`,n};/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $u=Mt("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ll=Mt("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const G7=Mt("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const W7=Mt("Camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const xl=Mt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const hc=Mt("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const bp=Mt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const X7=Mt("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const tA=Mt("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const td=Mt("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const qi=Mt("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const nA=Mt("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const q7=Mt("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const nd=Mt("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const fE=Mt("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const hE=Mt("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const rA=Mt("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const K7=Mt("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Y7=Mt("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const cl=Mt("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const J7=Mt("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Z7=Mt("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Q7=Mt("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const eX=Mt("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const tX=Mt("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const fi=Mt("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const nX=Mt("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const rX=Mt("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Tc=Mt("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const iA=Mt("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const kU=Mt("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const iX=Mt("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const oA=Mt("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Mh=Mt("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const oX=Mt("SkipForward",[["polygon",{points:"5 4 15 12 5 20 5 4",key:"16p6eg"}],["line",{x1:"19",x2:"19",y1:"5",y2:"19",key:"futhcm"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Od=Mt("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const aX=Mt("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const aA=Mt("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const oa=Mt("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const jU=Mt("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const UU=Mt("VideoOff",[["path",{d:"M10.66 6H14a2 2 0 0 1 2 2v2.5l5.248-3.062A.5.5 0 0 1 22 7.87v8.196",key:"w8jjjt"}],["path",{d:"M16 16a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h2",key:"1xawa7"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const sX=Mt("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const lX=Mt("VolumeX",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ax=Mt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),sA="-",cX=t=>{const e=dX(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:a=>{const s=a.split(sA);return s[0]===""&&s.length!==1&&s.shift(),FU(s,e)||uX(a)},getConflictingClassGroupIds:(a,s)=>{const l=n[a]||[];return s&&r[a]?[...l,...r[a]]:l}}},FU=(t,e)=>{var a;if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),i=r?FU(t.slice(1),r):void 0;if(i)return i;if(e.validators.length===0)return;const o=t.join(sA);return(a=e.validators.find(({validator:s})=>s(o)))==null?void 0:a.classGroupId},oN=/^\[(.+)\]$/,uX=t=>{if(oN.test(t)){const e=oN.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},dX=t=>{const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return hX(Object.entries(t.classGroups),n).forEach(([o,a])=>{pE(a,r,o,e)}),r},pE=(t,e,n,r)=>{t.forEach(i=>{if(typeof i=="string"){const o=i===""?e:aN(e,i);o.classGroupId=n;return}if(typeof i=="function"){if(fX(i)){pE(i(r),e,n,r);return}e.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,a])=>{pE(a,aN(e,o),n,r)})})},aN=(t,e)=>{let n=t;return e.split(sA).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},fX=t=>t.isThemeGetter,hX=(t,e)=>e?t.map(([n,r])=>{const i=r.map(o=>typeof o=="string"?e+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([a,s])=>[e+a,s])):o);return[n,i]}):t,pX=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const i=(o,a)=>{n.set(o,a),e++,e>t&&(e=0,r=n,n=new Map)};return{get(o){let a=n.get(o);if(a!==void 0)return a;if((a=r.get(o))!==void 0)return i(o,a),a},set(o,a){n.has(o)?n.set(o,a):i(o,a)}}},BU="!",mX=t=>{const{separator:e,experimentalParseClassName:n}=t,r=e.length===1,i=e[0],o=e.length,a=s=>{const l=[];let c=0,u=0,d;for(let g=0;gu?d-u:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:y,maybePostfixModifierPosition:v}};return n?s=>n({className:s,parseClassName:a}):a},gX=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e},vX=t=>({cache:pX(t.cacheSize),parseClassName:mX(t),...cX(t)}),yX=/\s+/,xX=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=e,o=[],a=t.trim().split(yX);let s="";for(let l=a.length-1;l>=0;l-=1){const c=a[l],{modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(c);let y=!!p,v=r(y?f.substring(0,p):f);if(!v){if(!y){s=c+(s.length>0?" "+s:s);continue}if(v=r(f),!v){s=c+(s.length>0?" "+s:s);continue}y=!1}const g=gX(u).join(":"),m=d?g+BU:g,x=m+v;if(o.includes(x))continue;o.push(x);const b=i(v,y);for(let S=0;S0?" "+s:s)}return s};function bX(){let t=0,e,n,r="";for(;t{if(typeof t=="string")return t;let e,n="";for(let r=0;rd(u),t());return n=vX(c),r=n.cache.get,i=n.cache.set,o=s,s(l)}function s(l){const c=r(l);if(c)return c;const u=xX(l,n);return i(l,u),u}return function(){return o(bX.apply(null,arguments))}}const yn=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},zU=/^\[(?:([a-z-]+):)?(.+)\]$/i,wX=/^\d+\/\d+$/,SX=new Set(["px","full","screen"]),EX=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,TX=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,MX=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,AX=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,CX=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ca=t=>rd(t)||SX.has(t)||wX.test(t),vs=t=>yf(t,"length",kX),rd=t=>!!t&&!Number.isNaN(Number(t)),R_=t=>yf(t,"number",rd),Zf=t=>!!t&&Number.isInteger(Number(t)),PX=t=>t.endsWith("%")&&rd(t.slice(0,-1)),Pt=t=>zU.test(t),ys=t=>EX.test(t),RX=new Set(["length","size","percentage"]),NX=t=>yf(t,RX,HU),OX=t=>yf(t,"position",HU),IX=new Set(["image","url"]),DX=t=>yf(t,IX,UX),LX=t=>yf(t,"",jX),Qf=()=>!0,yf=(t,e,n)=>{const r=zU.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1},kX=t=>TX.test(t)&&!MX.test(t),HU=()=>!1,jX=t=>AX.test(t),UX=t=>CX.test(t),FX=()=>{const t=yn("colors"),e=yn("spacing"),n=yn("blur"),r=yn("brightness"),i=yn("borderColor"),o=yn("borderRadius"),a=yn("borderSpacing"),s=yn("borderWidth"),l=yn("contrast"),c=yn("grayscale"),u=yn("hueRotate"),d=yn("invert"),f=yn("gap"),p=yn("gradientColorStops"),y=yn("gradientColorStopPositions"),v=yn("inset"),g=yn("margin"),m=yn("opacity"),x=yn("padding"),b=yn("saturate"),S=yn("scale"),w=yn("sepia"),E=yn("skew"),T=yn("space"),A=yn("translate"),M=()=>["auto","contain","none"],C=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto",Pt,e],R=()=>[Pt,e],D=()=>["",Ca,vs],k=()=>["auto",rd,Pt],U=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],O=()=>["solid","dashed","dotted","double","none"],W=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],L=()=>["start","end","center","between","around","evenly","stretch"],j=()=>["","0",Pt],X=()=>["auto","avoid","all","avoid-page","page","left","right","column"],K=()=>[rd,Pt];return{cacheSize:500,separator:":",theme:{colors:[Qf],spacing:[Ca,vs],blur:["none","",ys,Pt],brightness:K(),borderColor:[t],borderRadius:["none","","full",ys,Pt],borderSpacing:R(),borderWidth:D(),contrast:K(),grayscale:j(),hueRotate:K(),invert:j(),gap:R(),gradientColorStops:[t],gradientColorStopPositions:[PX,vs],inset:P(),margin:P(),opacity:K(),padding:R(),saturate:K(),scale:K(),sepia:j(),skew:K(),space:R(),translate:R()},classGroups:{aspect:[{aspect:["auto","square","video",Pt]}],container:["container"],columns:[{columns:[ys]}],"break-after":[{"break-after":X()}],"break-before":[{"break-before":X()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...U(),Pt]}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Zf,Pt]}],basis:[{basis:P()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Pt]}],grow:[{grow:j()}],shrink:[{shrink:j()}],order:[{order:["first","last","none",Zf,Pt]}],"grid-cols":[{"grid-cols":[Qf]}],"col-start-end":[{col:["auto",{span:["full",Zf,Pt]},Pt]}],"col-start":[{"col-start":k()}],"col-end":[{"col-end":k()}],"grid-rows":[{"grid-rows":[Qf]}],"row-start-end":[{row:["auto",{span:[Zf,Pt]},Pt]}],"row-start":[{"row-start":k()}],"row-end":[{"row-end":k()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Pt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Pt]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...L()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...L(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...L(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Pt,e]}],"min-w":[{"min-w":[Pt,e,"min","max","fit"]}],"max-w":[{"max-w":[Pt,e,"none","full","min","max","fit","prose",{screen:[ys]},ys]}],h:[{h:[Pt,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Pt,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Pt,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Pt,e,"auto","min","max","fit"]}],"font-size":[{text:["base",ys,vs]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",R_]}],"font-family":[{font:[Qf]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Pt]}],"line-clamp":[{"line-clamp":["none",rd,R_]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ca,Pt]}],"list-image":[{"list-image":["none",Pt]}],"list-style-type":[{list:["none","disc","decimal",Pt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[m]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[m]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...O(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ca,vs]}],"underline-offset":[{"underline-offset":["auto",Ca,Pt]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Pt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Pt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[m]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...U(),OX]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",NX]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},DX]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[m]}],"border-style":[{border:[...O(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[m]}],"divide-style":[{divide:O()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...O()]}],"outline-offset":[{"outline-offset":[Ca,Pt]}],"outline-w":[{outline:[Ca,vs]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:D()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[m]}],"ring-offset-w":[{"ring-offset":[Ca,vs]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",ys,LX]}],"shadow-color":[{shadow:[Qf]}],opacity:[{opacity:[m]}],"mix-blend":[{"mix-blend":[...W(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":W()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",ys,Pt]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[b]}],sepia:[{sepia:[w]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[m]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[w]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Pt]}],duration:[{duration:K()}],ease:[{ease:["linear","in","out","in-out",Pt]}],delay:[{delay:K()}],animate:[{animate:["none","spin","ping","pulse","bounce",Pt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[Zf,Pt]}],"translate-x":[{"translate-x":[A]}],"translate-y":[{"translate-y":[A]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Pt]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Pt]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Pt]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[Ca,vs,R_]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},BX=_X(FX);function He(...t){return BX(zt(t))}const $X=$7,VU=_.forwardRef(({className:t,...e},n)=>h.jsx(CU,{ref:n,className:He("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",t),...e}));VU.displayName=CU.displayName;const zX=Em("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),GU=_.forwardRef(({className:t,variant:e,...n},r)=>h.jsx(PU,{ref:r,className:He(zX({variant:e}),t),...n}));GU.displayName=PU.displayName;const HX=_.forwardRef(({className:t,...e},n)=>h.jsx(OU,{ref:n,className:He("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",t),...e}));HX.displayName=OU.displayName;const WU=_.forwardRef(({className:t,...e},n)=>h.jsx(IU,{ref:n,className:He("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",t),"toast-close":"",...e,children:h.jsx(ax,{className:"h-4 w-4"})}));WU.displayName=IU.displayName;const XU=_.forwardRef(({className:t,...e},n)=>h.jsx(RU,{ref:n,className:He("text-sm font-semibold",t),...e}));XU.displayName=RU.displayName;const qU=_.forwardRef(({className:t,...e},n)=>h.jsx(NU,{ref:n,className:He("text-sm opacity-90",t),...e}));qU.displayName=NU.displayName;function VX(){const{toasts:t}=Dr();return h.jsxs($X,{children:[t.map(function({id:e,title:n,description:r,action:i,...o}){return h.jsxs(GU,{...o,children:[h.jsxs("div",{className:"grid gap-1",children:[n&&h.jsx(XU,{children:n}),r&&h.jsx(qU,{children:r})]}),i,h.jsx(WU,{})]},e)}),h.jsx(VU,{})]})}const lA=Em("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),et=_.forwardRef(({className:t,variant:e,size:n,asChild:r=!1,...i},o)=>{const a=r?e7:"button";return h.jsx(a,{className:He(lA({variant:e,size:n,className:t})),ref:o,...i})});et.displayName="Button";const KU=_.createContext(void 0),N_="lelab.apiBaseUrl",O_="http://127.0.0.1:8000",GX=t=>t.replace(/^http(s?):/,"ws$1:"),WX=new Set(["http://localhost:8001","http://127.0.0.1:8001","http://localhost:8000","http://127.0.0.1:8000"]),XX=()=>{if(typeof window>"u")return O_;const t=new URLSearchParams(window.location.search).get("api");if(t)try{new URL(t);const n=t.replace(/\/$/,"");return window.localStorage.setItem(N_,n),n}catch{console.warn("Invalid `api` query param, ignoring:",t)}const e=window.localStorage.getItem(N_);return e&&!WX.has(e)?e:(e&&window.localStorage.setItem(N_,O_),O_)},qX=({children:t})=>{const[e]=_.useState(XX),n=GX(e),r=_.useCallback(async(o,a={})=>fetch(o,{...a,headers:{"Content-Type":"application/json",...a.headers}}),[]),i=_.useMemo(()=>({baseUrl:e,wsBaseUrl:n,fetchWithHeaders:r}),[e,n,r]);return h.jsx(KU.Provider,{value:i,children:t})},Dn=()=>{const t=_.useContext(KU);if(t===void 0)throw new Error("useApi must be used within an ApiProvider");return t},YU=_.createContext(void 0),KX=({children:t})=>{const{baseUrl:e,fetchWithHeaders:n}=Dn(),[r,i]=_.useState({status:"loading"}),o=_.useCallback(async()=>{i({status:"loading"});try{const l=await(await n(`${e}/hf-auth-status`)).json();l.authenticated?i({status:"authenticated",username:l.username,orgs:l.orgs??[]}):i({status:"unauthenticated",loginCommand:l.login_command??"hf auth login"})}catch(s){console.warn("HF auth status fetch failed:",s),i({status:"unauthenticated",loginCommand:"hf auth login"})}},[e,n]);_.useEffect(()=>{o()},[o]);const a=_.useMemo(()=>({auth:r,refetch:o}),[r,o]);return h.jsx(YU.Provider,{value:a,children:t})},xf=()=>{const t=_.useContext(YU);if(t===void 0)throw new Error("useHfAuth must be used within an HfAuthProvider");return t};var YX=rM[" useId ".trim().toString()]||(()=>{}),JX=0;function sr(t){const[e,n]=_.useState(YX());return ur(()=>{n(r=>r??String(JX++))},[t]),e?`radix-${e}`:""}var I_="focusScope.autoFocusOnMount",D_="focusScope.autoFocusOnUnmount",sN={bubbles:!1,cancelable:!0},ZX="FocusScope",Tm=_.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=t,[s,l]=_.useState(null),c=di(i),u=di(o),d=_.useRef(null),f=Ot(e,v=>l(v)),p=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(r){let v=function(b){if(p.paused||!s)return;const S=b.target;s.contains(S)?d.current=S:Cs(d.current,{select:!0})},g=function(b){if(p.paused||!s)return;const S=b.relatedTarget;S!==null&&(s.contains(S)||Cs(d.current,{select:!0}))},m=function(b){if(document.activeElement===document.body)for(const w of b)w.removedNodes.length>0&&Cs(s)};document.addEventListener("focusin",v),document.addEventListener("focusout",g);const x=new MutationObserver(m);return s&&x.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",g),x.disconnect()}}},[r,s,p.paused]),_.useEffect(()=>{if(s){cN.add(p);const v=document.activeElement;if(!s.contains(v)){const m=new CustomEvent(I_,sN);s.addEventListener(I_,c),s.dispatchEvent(m),m.defaultPrevented||(QX(iq(JU(s)),{select:!0}),document.activeElement===v&&Cs(s))}return()=>{s.removeEventListener(I_,c),setTimeout(()=>{const m=new CustomEvent(D_,sN);s.addEventListener(D_,u),s.dispatchEvent(m),m.defaultPrevented||Cs(v??document.body,{select:!0}),s.removeEventListener(D_,u),cN.remove(p)},0)}}},[s,c,u,p]);const y=_.useCallback(v=>{if(!n&&!r||p.paused)return;const g=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,m=document.activeElement;if(g&&m){const x=v.currentTarget,[b,S]=eq(x);b&&S?!v.shiftKey&&m===S?(v.preventDefault(),n&&Cs(b,{select:!0})):v.shiftKey&&m===b&&(v.preventDefault(),n&&Cs(S,{select:!0})):m===x&&v.preventDefault()}},[n,r,p.paused]);return h.jsx(nt.div,{tabIndex:-1,...a,ref:f,onKeyDown:y})});Tm.displayName=ZX;function QX(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Cs(r,{select:e}),document.activeElement!==n)return}function eq(t){const e=JU(t),n=lN(e,t),r=lN(e.reverse(),t);return[n,r]}function JU(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function lN(t,e){for(const n of t)if(!tq(n,{upTo:e}))return n}function tq(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function nq(t){return t instanceof HTMLInputElement&&"select"in t}function Cs(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&nq(t)&&e&&t.select()}}var cN=rq();function rq(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=uN(t,e),t.unshift(e)},remove(e){var n;t=uN(t,e),(n=t[0])==null||n.resume()}}}function uN(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function iq(t){return t.filter(e=>e.tagName!=="A")}var L_=0;function sx(){_.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??dN()),document.body.insertAdjacentElement("beforeend",t[1]??dN()),L_++,()=>{L_===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),L_--}},[])}function dN(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var ia=function(){return ia=Object.assign||function(e){for(var n,r=1,i=arguments.length;r"u")return _q;var e=wq(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},Eq=tF(),id="data-scroll-locked",Tq=function(t,e,n,r){var i=t.left,o=t.top,a=t.right,s=t.gap;return n===void 0&&(n="margin"),` + .`.concat(aq,` { + overflow: hidden `).concat(r,`; + padding-right: `).concat(s,"px ").concat(r,`; + } + body[`).concat(id,`] { + overflow: hidden `).concat(r,`; + overscroll-behavior: contain; + `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&` + padding-left: `.concat(i,`px; + padding-top: `).concat(o,`px; + padding-right: `).concat(a,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(s,"px ").concat(r,`; + `),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),` + } + + .`).concat(kv,` { + right: `).concat(s,"px ").concat(r,`; + } + + .`).concat(jv,` { + margin-right: `).concat(s,"px ").concat(r,`; + } + + .`).concat(kv," .").concat(kv,` { + right: 0 `).concat(r,`; + } + + .`).concat(jv," .").concat(jv,` { + margin-right: 0 `).concat(r,`; + } + + body[`).concat(id,`] { + `).concat(sq,": ").concat(s,`px; + } +`)},hN=function(){var t=parseInt(document.body.getAttribute(id)||"0",10);return isFinite(t)?t:0},Mq=function(){_.useEffect(function(){return document.body.setAttribute(id,(hN()+1).toString()),function(){var t=hN()-1;t<=0?document.body.removeAttribute(id):document.body.setAttribute(id,t.toString())}},[])},Aq=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,i=r===void 0?"margin":r;Mq();var o=_.useMemo(function(){return Sq(i)},[i]);return _.createElement(Eq,{styles:Tq(o,!e,i,n?"":"!important")})},mE=!1;if(typeof window<"u")try{var _g=Object.defineProperty({},"passive",{get:function(){return mE=!0,!0}});window.addEventListener("test",_g,_g),window.removeEventListener("test",_g,_g)}catch{mE=!1}var ru=mE?{passive:!1}:!1,Cq=function(t){return t.tagName==="TEXTAREA"},nF=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!Cq(t)&&n[e]==="visible")},Pq=function(t){return nF(t,"overflowY")},Rq=function(t){return nF(t,"overflowX")},pN=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=rF(t,r);if(i){var o=iF(t,r),a=o[1],s=o[2];if(a>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Nq=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},Oq=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},rF=function(t,e){return t==="v"?Pq(e):Rq(e)},iF=function(t,e){return t==="v"?Nq(e):Oq(e)},Iq=function(t,e){return t==="h"&&e==="rtl"?-1:1},Dq=function(t,e,n,r,i){var o=Iq(t,window.getComputedStyle(e).direction),a=o*r,s=n.target,l=e.contains(s),c=!1,u=a>0,d=0,f=0;do{if(!s)break;var p=iF(t,s),y=p[0],v=p[1],g=p[2],m=v-g-o*y;(y||m)&&rF(t,s)&&(d+=m,f+=y);var x=s.parentNode;s=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}while(!l&&s!==document.body||l&&(e.contains(s)||e===s));return(u&&Math.abs(d)<1||!u&&Math.abs(f)<1)&&(c=!0),c},wg=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},mN=function(t){return[t.deltaX,t.deltaY]},gN=function(t){return t&&"current"in t?t.current:t},Lq=function(t,e){return t[0]===e[0]&&t[1]===e[1]},kq=function(t){return` + .block-interactivity-`.concat(t,` {pointer-events: none;} + .allow-interactivity-`).concat(t,` {pointer-events: all;} +`)},jq=0,iu=[];function Uq(t){var e=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),i=_.useState(jq++)[0],o=_.useState(tF)[0],a=_.useRef(t);_.useEffect(function(){a.current=t},[t]),_.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var v=oq([t.lockRef.current],(t.shards||[]).map(gN),!0).filter(Boolean);return v.forEach(function(g){return g.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),v.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var s=_.useCallback(function(v,g){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!a.current.allowPinchZoom;var m=wg(v),x=n.current,b="deltaX"in v?v.deltaX:x[0]-m[0],S="deltaY"in v?v.deltaY:x[1]-m[1],w,E=v.target,T=Math.abs(b)>Math.abs(S)?"h":"v";if("touches"in v&&T==="h"&&E.type==="range")return!1;var A=pN(T,E);if(!A)return!0;if(A?w=T:(w=T==="v"?"h":"v",A=pN(T,E)),!A)return!1;if(!r.current&&"changedTouches"in v&&(b||S)&&(r.current=w),!w)return!0;var M=r.current||w;return Dq(M,g,v,M==="h"?b:S)},[]),l=_.useCallback(function(v){var g=v;if(!(!iu.length||iu[iu.length-1]!==o)){var m="deltaY"in g?mN(g):wg(g),x=e.current.filter(function(w){return w.name===g.type&&(w.target===g.target||g.target===w.shadowParent)&&Lq(w.delta,m)})[0];if(x&&x.should){g.cancelable&&g.preventDefault();return}if(!x){var b=(a.current.shards||[]).map(gN).filter(Boolean).filter(function(w){return w.contains(g.target)}),S=b.length>0?s(g,b[0]):!a.current.noIsolation;S&&g.cancelable&&g.preventDefault()}}},[]),c=_.useCallback(function(v,g,m,x){var b={name:v,delta:g,target:m,should:x,shadowParent:Fq(m)};e.current.push(b),setTimeout(function(){e.current=e.current.filter(function(S){return S!==b})},1)},[]),u=_.useCallback(function(v){n.current=wg(v),r.current=void 0},[]),d=_.useCallback(function(v){c(v.type,mN(v),v.target,s(v,t.lockRef.current))},[]),f=_.useCallback(function(v){c(v.type,wg(v),v.target,s(v,t.lockRef.current))},[]);_.useEffect(function(){return iu.push(o),t.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,ru),document.addEventListener("touchmove",l,ru),document.addEventListener("touchstart",u,ru),function(){iu=iu.filter(function(v){return v!==o}),document.removeEventListener("wheel",l,ru),document.removeEventListener("touchmove",l,ru),document.removeEventListener("touchstart",u,ru)}},[]);var p=t.removeScrollBar,y=t.inert;return _.createElement(_.Fragment,null,y?_.createElement(o,{styles:kq(i)}):null,p?_.createElement(Aq,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function Fq(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const Bq=pq(eF,Uq);var Mm=_.forwardRef(function(t,e){return _.createElement(lx,ia({},t,{ref:e,sideCar:Bq}))});Mm.classNames=lx.classNames;var $q=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},ou=new WeakMap,Sg=new WeakMap,Eg={},F_=0,oF=function(t){return t&&(t.host||oF(t.parentNode))},zq=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=oF(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},Hq=function(t,e,n,r){var i=zq(e,Array.isArray(t)?t:[t]);Eg[n]||(Eg[n]=new WeakMap);var o=Eg[n],a=[],s=new Set,l=new Set(i),c=function(d){!d||s.has(d)||(s.add(d),c(d.parentNode))};i.forEach(c);var u=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(f){if(s.has(f))u(f);else try{var p=f.getAttribute(r),y=p!==null&&p!=="false",v=(ou.get(f)||0)+1,g=(o.get(f)||0)+1;ou.set(f,v),o.set(f,g),a.push(f),v===1&&y&&Sg.set(f,!0),g===1&&f.setAttribute(n,"true"),y||f.setAttribute(r,"true")}catch(m){console.error("aria-hidden: cannot operate on ",f,m)}})};return u(e),s.clear(),F_++,function(){a.forEach(function(d){var f=ou.get(d)-1,p=o.get(d)-1;ou.set(d,f),o.set(d,p),f||(Sg.has(d)||d.removeAttribute(r),Sg.delete(d)),p||d.removeAttribute(n)}),F_--,F_||(ou=new WeakMap,ou=new WeakMap,Sg=new WeakMap,Eg={})}},cx=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),i=$q(t);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),Hq(r,i,n,"aria-hidden")):function(){return null}},ux="Dialog",[aF,sF]=mi(ux),[Vq,Go]=aF(ux),lF=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:a=!0}=t,s=_.useRef(null),l=_.useRef(null),[c,u]=$o({prop:r,defaultProp:i??!1,onChange:o,caller:ux});return h.jsx(Vq,{scope:e,triggerRef:s,contentRef:l,contentId:sr(),titleId:sr(),descriptionId:sr(),open:c,onOpenChange:u,onOpenToggle:_.useCallback(()=>u(d=>!d),[u]),modal:a,children:n})};lF.displayName=ux;var cF="DialogTrigger",uF=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Go(cF,n),o=Ot(e,i.triggerRef);return h.jsx(nt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":dA(i.open),...r,ref:o,onClick:Oe(t.onClick,i.onOpenToggle)})});uF.displayName=cF;var cA="DialogPortal",[Gq,dF]=aF(cA,{forceMount:void 0}),fF=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:i}=t,o=Go(cA,e);return h.jsx(Gq,{scope:e,forceMount:n,children:_.Children.map(r,a=>h.jsx(gi,{present:n||o.open,children:h.jsx(vf,{asChild:!0,container:i,children:a})}))})};fF.displayName=cA;var by="DialogOverlay",hF=_.forwardRef((t,e)=>{const n=dF(by,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,o=Go(by,t.__scopeDialog);return o.modal?h.jsx(gi,{present:r||o.open,children:h.jsx(Xq,{...i,ref:e})}):null});hF.displayName=by;var Wq=sl("DialogOverlay.RemoveScroll"),Xq=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Go(by,n);return h.jsx(Mm,{as:Wq,allowPinchZoom:!0,shards:[i.contentRef],children:h.jsx(nt.div,{"data-state":dA(i.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),Mc="DialogContent",pF=_.forwardRef((t,e)=>{const n=dF(Mc,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,o=Go(Mc,t.__scopeDialog);return h.jsx(gi,{present:r||o.open,children:o.modal?h.jsx(qq,{...i,ref:e}):h.jsx(Kq,{...i,ref:e})})});pF.displayName=Mc;var qq=_.forwardRef((t,e)=>{const n=Go(Mc,t.__scopeDialog),r=_.useRef(null),i=Ot(e,n.contentRef,r);return _.useEffect(()=>{const o=r.current;if(o)return cx(o)},[]),h.jsx(mF,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Oe(t.onCloseAutoFocus,o=>{var a;o.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Oe(t.onPointerDownOutside,o=>{const a=o.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&o.preventDefault()}),onFocusOutside:Oe(t.onFocusOutside,o=>o.preventDefault())})}),Kq=_.forwardRef((t,e)=>{const n=Go(Mc,t.__scopeDialog),r=_.useRef(!1),i=_.useRef(!1);return h.jsx(mF,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var a,s;(a=t.onCloseAutoFocus)==null||a.call(t,o),o.defaultPrevented||(r.current||(s=n.triggerRef.current)==null||s.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var l,c;(l=t.onInteractOutside)==null||l.call(t,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=o.target;((c=n.triggerRef.current)==null?void 0:c.contains(a))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),mF=_.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...a}=t,s=Go(Mc,n),l=_.useRef(null),c=Ot(e,l);return sx(),h.jsxs(h.Fragment,{children:[h.jsx(Tm,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:h.jsx(zc,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":dA(s.open),...a,ref:c,onDismiss:()=>s.onOpenChange(!1)})}),h.jsxs(h.Fragment,{children:[h.jsx(Jq,{titleId:s.titleId}),h.jsx(Qq,{contentRef:l,descriptionId:s.descriptionId})]})]})}),uA="DialogTitle",gF=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Go(uA,n);return h.jsx(nt.h2,{id:i.titleId,...r,ref:e})});gF.displayName=uA;var vF="DialogDescription",yF=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Go(vF,n);return h.jsx(nt.p,{id:i.descriptionId,...r,ref:e})});yF.displayName=vF;var xF="DialogClose",bF=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Go(xF,n);return h.jsx(nt.button,{type:"button",...r,ref:e,onClick:Oe(t.onClick,()=>i.onOpenChange(!1))})});bF.displayName=xF;function dA(t){return t?"open":"closed"}var _F="DialogTitleWarning",[Yq,wF]=Z9(_F,{contentName:Mc,titleName:uA,docsSlug:"dialog"}),Jq=({titleId:t})=>{const e=wF(_F),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users. + +If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component. + +For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return _.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},Zq="DialogDescriptionWarning",Qq=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${wF(Zq).contentName}}.`;return _.useEffect(()=>{var o;const i=(o=t.current)==null?void 0:o.getAttribute("aria-describedby");e&&i&&(document.getElementById(e)||console.warn(r))},[r,t,e]),null},fA=lF,eK=uF,hA=fF,dx=hF,fx=pF,pA=gF,mA=yF,gA=bF;const Hc=fA,tK=hA,SF=_.forwardRef(({className:t,...e},n)=>h.jsx(dx,{ref:n,className:He("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e}));SF.displayName=dx.displayName;const bl=_.forwardRef(({className:t,children:e,hideClose:n,...r},i)=>h.jsxs(tK,{children:[h.jsx(SF,{}),h.jsxs(fx,{ref:i,className:He("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...r,children:[e,!n&&h.jsxs(gA,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[h.jsx(ax,{className:"h-4 w-4"}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));bl.displayName=fx.displayName;const _l=({className:t,...e})=>h.jsx("div",{className:He("flex flex-col space-y-1.5 text-center sm:text-left",t),...e});_l.displayName="DialogHeader";const EF=({className:t,...e})=>h.jsx("div",{className:He("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});EF.displayName="DialogFooter";const wl=_.forwardRef(({className:t,...e},n)=>h.jsx(pA,{ref:n,className:He("text-lg font-semibold leading-none tracking-tight",t),...e}));wl.displayName=pA.displayName;const Sl=_.forwardRef(({className:t,...e},n)=>h.jsx(mA,{ref:n,className:He("text-sm text-muted-foreground",t),...e}));Sl.displayName=mA.displayName;const nK=({open:t,onOpenChange:e})=>{const{auth:n,refetch:r}=xf(),[i,o]=_.useState(!1),[a,s]=_.useState(!1);if(n.status!=="unauthenticated")return null;const l=async()=>{try{await navigator.clipboard.writeText(n.loginCommand),o(!0),setTimeout(()=>o(!1),1500)}catch(u){console.warn("Clipboard write failed:",u)}},c=async()=>{s(!0);try{await r()}finally{s(!1)}};return h.jsx(Hc,{open:t,onOpenChange:e,children:h.jsxs(bl,{className:"bg-gray-900 border-gray-800 text-white",children:[h.jsxs(_l,{children:[h.jsx(wl,{className:"text-amber-200",children:"Hugging Face CLI not configured"}),h.jsx(Sl,{className:"text-gray-400",children:"Uploads, training, and replay-from-Hub require a logged-in HF CLI. Run this in a terminal:"})]}),h.jsxs("pre",{className:"bg-gray-950 p-3 rounded border border-gray-700 text-xs sm:text-sm overflow-x-auto flex items-center justify-between gap-2",children:[h.jsx("code",{className:"text-green-400",children:n.loginCommand}),h.jsx("button",{type:"button",onClick:l,className:"flex-shrink-0 text-gray-400 hover:text-gray-200 transition-colors","aria-label":"Copy command",children:i?h.jsx(xl,{className:"w-4 h-4 text-green-400"}):h.jsx(rA,{className:"w-4 h-4"})})]}),h.jsxs(et,{variant:"outline",size:"sm",onClick:c,disabled:a,className:"border-amber-700 bg-transparent text-amber-100 hover:bg-amber-900/40 hover:text-amber-50",children:[h.jsx(kU,{className:`w-4 h-4 mr-2 ${a?"animate-spin":""}`}),"I've logged in โ€” recheck"]})]})})},rK=()=>{const{auth:t}=xf(),[e,n]=_.useState(!1);return t.status==="loading"?h.jsxs("div",{className:"inline-flex items-center gap-2 rounded-full border border-gray-800 bg-gray-900/60 px-3 py-1 text-xs text-gray-400",children:[h.jsx(fi,{className:"w-3 h-3 animate-spin"}),h.jsx("span",{children:"Checking HFโ€ฆ"})]}):t.status==="authenticated"?h.jsxs("div",{className:"inline-flex items-center gap-2 rounded-full border border-gray-800 bg-gray-900/60 px-3 py-1 text-xs text-gray-200",title:"Hugging Face authenticated",children:[h.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-400","aria-hidden":"true"}),h.jsx("span",{children:t.username})]}):h.jsxs(h.Fragment,{children:[h.jsxs("button",{type:"button",onClick:()=>n(!0),className:"inline-flex items-center gap-2 rounded-full border border-amber-700/60 bg-amber-950/40 px-3 py-1 text-xs text-amber-100 hover:bg-amber-900/40 transition-colors","aria-label":"Hugging Face not configured โ€” show login instructions",children:[h.jsx("span",{className:"h-2 w-2 rounded-full bg-amber-400","aria-hidden":"true"}),h.jsx("span",{children:"HF not configured"})]}),h.jsx(nK,{open:e,onOpenChange:n})]})},iK=()=>h.jsx("header",{className:"sticky top-0 z-30 w-full border-b border-gray-800 bg-black/95 backdrop-blur supports-[backdrop-filter]:bg-black/70",children:h.jsxs("div",{className:"mx-auto flex h-12 max-w-7xl items-center justify-between px-4",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("img",{src:"/lovable-uploads/5e648747-34b7-4d8f-93fd-4dbd00aeeefc.png",alt:"LeLab",className:"h-7 w-7"}),h.jsx("span",{className:"text-base font-semibold tracking-tight text-white",children:"LeLab"})]}),h.jsx(rK,{})]})}),oK=({className:t})=>h.jsx("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",className:t,children:h.jsx("path",{d:"M20.317 4.369A19.79 19.79 0 0 0 16.558 3.2a.07.07 0 0 0-.074.035c-.211.375-.444.864-.608 1.249a18.27 18.27 0 0 0-5.487 0 12.51 12.51 0 0 0-.617-1.249.077.077 0 0 0-.074-.035 19.736 19.736 0 0 0-3.76 1.169.07.07 0 0 0-.032.027C2.533 8.046 1.79 11.624 2.155 15.157a.082.082 0 0 0 .031.056 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.027c.462-.63.873-1.295 1.226-1.994a.076.076 0 0 0-.041-.105 13.13 13.13 0 0 1-1.873-.892.077.077 0 0 1-.008-.128c.126-.094.252-.192.372-.291a.074.074 0 0 1 .077-.01c3.927 1.793 8.18 1.793 12.061 0a.074.074 0 0 1 .078.009c.12.099.246.198.373.292a.077.077 0 0 1-.006.128 12.32 12.32 0 0 1-1.873.891.077.077 0 0 0-.04.106c.36.698.772 1.363 1.225 1.993a.076.076 0 0 0 .084.028 19.84 19.84 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-4.087-.838-7.636-3.548-10.787a.061.061 0 0 0-.031-.028zM8.02 12.997c-1.182 0-2.156-1.085-2.156-2.419 0-1.333.955-2.419 2.156-2.419 1.21 0 2.175 1.095 2.156 2.42 0 1.333-.955 2.418-2.156 2.418zm7.974 0c-1.182 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.175 1.095 2.156 2.42 0 1.333-.946 2.418-2.156 2.418z"})}),aK=[{href:"https://github.com/huggingface/lerobot",label:"GitHub",Icon:eX},{href:"https://huggingface.co/docs/lerobot",label:"Documentation",Icon:G7},{href:"https://discord.com/invite/s3KuuzsPFb",label:"Discord",Icon:oK}],sK=()=>h.jsx("footer",{className:"fixed inset-x-0 bottom-0 z-30 border-t border-gray-800 bg-black/95",children:h.jsxs("div",{className:"mx-auto flex max-w-7xl flex-col items-center justify-between gap-3 px-4 py-4 text-sm text-gray-400 sm:flex-row",children:[h.jsxs("span",{children:["Powered by"," ",h.jsx("a",{href:"https://github.com/huggingface/lerobot",target:"_blank",rel:"noopener noreferrer",className:"font-medium text-gray-200 hover:text-white",children:"LeRobot"})]}),h.jsx("nav",{className:"flex items-center gap-4",children:aK.map(({href:t,label:e,Icon:n})=>h.jsxs("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 text-gray-400 hover:text-white",children:[h.jsx(n,{className:"h-4 w-4"}),h.jsx("span",{children:e})]},e))})]})}),lK=["top","right","bottom","left"],ul=Math.min,Ti=Math.max,_y=Math.round,Tg=Math.floor,ma=t=>({x:t,y:t}),cK={left:"right",right:"left",bottom:"top",top:"bottom"},uK={start:"end",end:"start"};function gE(t,e,n){return Ti(t,ul(e,n))}function os(t,e){return typeof t=="function"?t(e):t}function as(t){return t.split("-")[0]}function bf(t){return t.split("-")[1]}function vA(t){return t==="x"?"y":"x"}function yA(t){return t==="y"?"height":"width"}function aa(t){return["top","bottom"].includes(as(t))?"y":"x"}function xA(t){return vA(aa(t))}function dK(t,e,n){n===void 0&&(n=!1);const r=bf(t),i=xA(t),o=yA(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(a=wy(a)),[a,wy(a)]}function fK(t){const e=wy(t);return[vE(t),e,vE(e)]}function vE(t){return t.replace(/start|end/g,e=>uK[e])}function hK(t,e,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],a=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:r:e?r:i;case"left":case"right":return e?o:a;default:return[]}}function pK(t,e,n,r){const i=bf(t);let o=hK(as(t),n==="start",r);return i&&(o=o.map(a=>a+"-"+i),e&&(o=o.concat(o.map(vE)))),o}function wy(t){return t.replace(/left|right|bottom|top/g,e=>cK[e])}function mK(t){return{top:0,right:0,bottom:0,left:0,...t}}function TF(t){return typeof t!="number"?mK(t):{top:t,right:t,bottom:t,left:t}}function Sy(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function vN(t,e,n){let{reference:r,floating:i}=t;const o=aa(e),a=xA(e),s=yA(a),l=as(e),c=o==="y",u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2;let p;switch(l){case"top":p={x:u,y:r.y-i.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(bf(e)){case"start":p[a]-=f*(n&&c?-1:1);break;case"end":p[a]+=f*(n&&c?-1:1);break}return p}const gK=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=o.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(e));let c=await a.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:d}=vN(c,r,l),f=r,p={},y=0;for(let v=0;v({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:o,platform:a,elements:s,middlewareData:l}=e,{element:c,padding:u=0}=os(t,e)||{};if(c==null)return{};const d=TF(u),f={x:n,y:r},p=xA(i),y=yA(p),v=await a.getDimensions(c),g=p==="y",m=g?"top":"left",x=g?"bottom":"right",b=g?"clientHeight":"clientWidth",S=o.reference[y]+o.reference[p]-f[p]-o.floating[y],w=f[p]-o.reference[p],E=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c));let T=E?E[b]:0;(!T||!await(a.isElement==null?void 0:a.isElement(E)))&&(T=s.floating[b]||o.floating[y]);const A=S/2-w/2,M=T/2-v[y]/2-1,C=ul(d[m],M),P=ul(d[x],M),R=C,D=T-v[y]-P,k=T/2-v[y]/2+A,U=gE(R,k,D),O=!l.arrow&&bf(i)!=null&&k!==U&&o.reference[y]/2-(kk<=0)){var P,R;const k=(((P=o.flip)==null?void 0:P.index)||0)+1,U=T[k];if(U&&(!(d==="alignment"?x!==aa(U):!1)||C.every(L=>L.overflows[0]>0&&aa(L.placement)===x)))return{data:{index:k,overflows:C},reset:{placement:U}};let O=(R=C.filter(W=>W.overflows[0]<=0).sort((W,L)=>W.overflows[1]-L.overflows[1])[0])==null?void 0:R.placement;if(!O)switch(p){case"bestFit":{var D;const W=(D=C.filter(L=>{if(E){const j=aa(L.placement);return j===x||j==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(j=>j>0).reduce((j,X)=>j+X,0)]).sort((L,j)=>L[1]-j[1])[0])==null?void 0:D[0];W&&(O=W);break}case"initialPlacement":O=s;break}if(i!==O)return{reset:{placement:O}}}return{}}}};function yN(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function xN(t){return lK.some(e=>t[e]>=0)}const xK=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...i}=os(t,e);switch(r){case"referenceHidden":{const o=await _p(e,{...i,elementContext:"reference"}),a=yN(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:xN(a)}}}case"escaped":{const o=await _p(e,{...i,altBoundary:!0}),a=yN(o,n.floating);return{data:{escapedOffsets:a,escaped:xN(a)}}}default:return{}}}}};async function bK(t,e){const{placement:n,platform:r,elements:i}=t,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=as(n),s=bf(n),l=aa(n)==="y",c=["left","top"].includes(a)?-1:1,u=o&&l?-1:1,d=os(e,t);let{mainAxis:f,crossAxis:p,alignmentAxis:y}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof y=="number"&&(p=s==="end"?y*-1:y),l?{x:p*u,y:f*c}:{x:f*c,y:p*u}}const _K=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:o,placement:a,middlewareData:s}=e,l=await bK(e,t);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:a}}}}},wK=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:g=>{let{x:m,y:x}=g;return{x:m,y:x}}},...l}=os(t,e),c={x:n,y:r},u=await _p(e,l),d=aa(as(i)),f=vA(d);let p=c[f],y=c[d];if(o){const g=f==="y"?"top":"left",m=f==="y"?"bottom":"right",x=p+u[g],b=p-u[m];p=gE(x,p,b)}if(a){const g=d==="y"?"top":"left",m=d==="y"?"bottom":"right",x=y+u[g],b=y-u[m];y=gE(x,y,b)}const v=s.fn({...e,[f]:p,[d]:y});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[f]:o,[d]:a}}}}}},SK=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=e,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=os(t,e),u={x:n,y:r},d=aa(i),f=vA(d);let p=u[f],y=u[d];const v=os(s,e),g=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(l){const b=f==="y"?"height":"width",S=o.reference[f]-o.floating[b]+g.mainAxis,w=o.reference[f]+o.reference[b]-g.mainAxis;pw&&(p=w)}if(c){var m,x;const b=f==="y"?"width":"height",S=["top","left"].includes(as(i)),w=o.reference[d]-o.floating[b]+(S&&((m=a.offset)==null?void 0:m[d])||0)+(S?0:g.crossAxis),E=o.reference[d]+o.reference[b]+(S?0:((x=a.offset)==null?void 0:x[d])||0)-(S?g.crossAxis:0);yE&&(y=E)}return{[f]:p,[d]:y}}}},EK=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:o,platform:a,elements:s}=e,{apply:l=()=>{},...c}=os(t,e),u=await _p(e,c),d=as(i),f=bf(i),p=aa(i)==="y",{width:y,height:v}=o.floating;let g,m;d==="top"||d==="bottom"?(g=d,m=f===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(m=d,g=f==="end"?"top":"bottom");const x=v-u.top-u.bottom,b=y-u.left-u.right,S=ul(v-u[g],x),w=ul(y-u[m],b),E=!e.middlewareData.shift;let T=S,A=w;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(A=b),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(T=x),E&&!f){const C=Ti(u.left,0),P=Ti(u.right,0),R=Ti(u.top,0),D=Ti(u.bottom,0);p?A=y-2*(C!==0||P!==0?C+P:Ti(u.left,u.right)):T=v-2*(R!==0||D!==0?R+D:Ti(u.top,u.bottom))}await l({...e,availableWidth:A,availableHeight:T});const M=await a.getDimensions(s.floating);return y!==M.width||v!==M.height?{reset:{rects:!0}}:{}}}};function hx(){return typeof window<"u"}function _f(t){return MF(t)?(t.nodeName||"").toLowerCase():"#document"}function Ni(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Sa(t){var e;return(e=(MF(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function MF(t){return hx()?t instanceof Node||t instanceof Ni(t).Node:!1}function zo(t){return hx()?t instanceof Element||t instanceof Ni(t).Element:!1}function xa(t){return hx()?t instanceof HTMLElement||t instanceof Ni(t).HTMLElement:!1}function bN(t){return!hx()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Ni(t).ShadowRoot}function Am(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=Ho(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function TK(t){return["table","td","th"].includes(_f(t))}function px(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function bA(t){const e=_A(),n=zo(t)?Ho(t):t;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function MK(t){let e=dl(t);for(;xa(e)&&!Id(e);){if(bA(e))return e;if(px(e))return null;e=dl(e)}return null}function _A(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Id(t){return["html","body","#document"].includes(_f(t))}function Ho(t){return Ni(t).getComputedStyle(t)}function mx(t){return zo(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function dl(t){if(_f(t)==="html")return t;const e=t.assignedSlot||t.parentNode||bN(t)&&t.host||Sa(t);return bN(e)?e.host:e}function AF(t){const e=dl(t);return Id(e)?t.ownerDocument?t.ownerDocument.body:t.body:xa(e)&&Am(e)?e:AF(e)}function wp(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=AF(t),o=i===((r=t.ownerDocument)==null?void 0:r.body),a=Ni(i);if(o){const s=yE(a);return e.concat(a,a.visualViewport||[],Am(i)?i:[],s&&n?wp(s):[])}return e.concat(i,wp(i,[],n))}function yE(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function CF(t){const e=Ho(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=xa(t),o=i?t.offsetWidth:n,a=i?t.offsetHeight:r,s=_y(n)!==o||_y(r)!==a;return s&&(n=o,r=a),{width:n,height:r,$:s}}function wA(t){return zo(t)?t:t.contextElement}function od(t){const e=wA(t);if(!xa(e))return ma(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:o}=CF(e);let a=(o?_y(n.width):n.width)/r,s=(o?_y(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const AK=ma(0);function PF(t){const e=Ni(t);return!_A()||!e.visualViewport?AK:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function CK(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Ni(t)?!1:e}function Ac(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),o=wA(t);let a=ma(1);e&&(r?zo(r)&&(a=od(r)):a=od(t));const s=CK(o,n,r)?PF(o):ma(0);let l=(i.left+s.x)/a.x,c=(i.top+s.y)/a.y,u=i.width/a.x,d=i.height/a.y;if(o){const f=Ni(o),p=r&&zo(r)?Ni(r):r;let y=f,v=yE(y);for(;v&&r&&p!==y;){const g=od(v),m=v.getBoundingClientRect(),x=Ho(v),b=m.left+(v.clientLeft+parseFloat(x.paddingLeft))*g.x,S=m.top+(v.clientTop+parseFloat(x.paddingTop))*g.y;l*=g.x,c*=g.y,u*=g.x,d*=g.y,l+=b,c+=S,y=Ni(v),v=yE(y)}}return Sy({width:u,height:d,x:l,y:c})}function SA(t,e){const n=mx(t).scrollLeft;return e?e.left+n:Ac(Sa(t)).left+n}function RF(t,e,n){n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=r.left+e.scrollLeft-(n?0:SA(t,r)),o=r.top+e.scrollTop;return{x:i,y:o}}function PK(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const o=i==="fixed",a=Sa(r),s=e?px(e.floating):!1;if(r===a||s&&o)return n;let l={scrollLeft:0,scrollTop:0},c=ma(1);const u=ma(0),d=xa(r);if((d||!d&&!o)&&((_f(r)!=="body"||Am(a))&&(l=mx(r)),xa(r))){const p=Ac(r);c=od(r),u.x=p.x+r.clientLeft,u.y=p.y+r.clientTop}const f=a&&!d&&!o?RF(a,l,!0):ma(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}}function RK(t){return Array.from(t.getClientRects())}function NK(t){const e=Sa(t),n=mx(t),r=t.ownerDocument.body,i=Ti(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=Ti(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+SA(t);const s=-n.scrollTop;return Ho(r).direction==="rtl"&&(a+=Ti(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:s}}function OK(t,e){const n=Ni(t),r=Sa(t),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;const c=_A();(!c||c&&e==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s,y:l}}function IK(t,e){const n=Ac(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,o=xa(t)?od(t):ma(1),a=t.clientWidth*o.x,s=t.clientHeight*o.y,l=i*o.x,c=r*o.y;return{width:a,height:s,x:l,y:c}}function _N(t,e,n){let r;if(e==="viewport")r=OK(t,n);else if(e==="document")r=NK(Sa(t));else if(zo(e))r=IK(e,n);else{const i=PF(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Sy(r)}function NF(t,e){const n=dl(t);return n===e||!zo(n)||Id(n)?!1:Ho(n).position==="fixed"||NF(n,e)}function DK(t,e){const n=e.get(t);if(n)return n;let r=wp(t,[],!1).filter(s=>zo(s)&&_f(s)!=="body"),i=null;const o=Ho(t).position==="fixed";let a=o?dl(t):t;for(;zo(a)&&!Id(a);){const s=Ho(a),l=bA(a);!l&&s.position==="fixed"&&(i=null),(o?!l&&!i:!l&&s.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Am(a)&&!l&&NF(t,a))?r=r.filter(u=>u!==a):i=s,a=dl(a)}return e.set(t,r),r}function LK(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const a=[...n==="clippingAncestors"?px(e)?[]:DK(e,this._c):[].concat(n),r],s=a[0],l=a.reduce((c,u)=>{const d=_N(e,u,i);return c.top=Ti(d.top,c.top),c.right=ul(d.right,c.right),c.bottom=ul(d.bottom,c.bottom),c.left=Ti(d.left,c.left),c},_N(e,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function kK(t){const{width:e,height:n}=CF(t);return{width:e,height:n}}function jK(t,e,n){const r=xa(e),i=Sa(e),o=n==="fixed",a=Ac(t,!0,o,e);let s={scrollLeft:0,scrollTop:0};const l=ma(0);function c(){l.x=SA(i)}if(r||!r&&!o)if((_f(e)!=="body"||Am(i))&&(s=mx(e)),r){const p=Ac(e,!0,o,e);l.x=p.x+e.clientLeft,l.y=p.y+e.clientTop}else i&&c();o&&!r&&i&&c();const u=i&&!r&&!o?RF(i,s):ma(0),d=a.left+s.scrollLeft-l.x-u.x,f=a.top+s.scrollTop-l.y-u.y;return{x:d,y:f,width:a.width,height:a.height}}function B_(t){return Ho(t).position==="static"}function wN(t,e){if(!xa(t)||Ho(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Sa(t)===n&&(n=n.ownerDocument.body),n}function OF(t,e){const n=Ni(t);if(px(t))return n;if(!xa(t)){let i=dl(t);for(;i&&!Id(i);){if(zo(i)&&!B_(i))return i;i=dl(i)}return n}let r=wN(t,e);for(;r&&TK(r)&&B_(r);)r=wN(r,e);return r&&Id(r)&&B_(r)&&!bA(r)?n:r||MK(t)||n}const UK=async function(t){const e=this.getOffsetParent||OF,n=this.getDimensions,r=await n(t.floating);return{reference:jK(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function FK(t){return Ho(t).direction==="rtl"}const BK={convertOffsetParentRelativeRectToViewportRelativeRect:PK,getDocumentElement:Sa,getClippingRect:LK,getOffsetParent:OF,getElementRects:UK,getClientRects:RK,getDimensions:kK,getScale:od,isElement:zo,isRTL:FK};function IF(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function $K(t,e){let n=null,r;const i=Sa(t);function o(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function a(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),o();const c=t.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=c;if(s||e(),!f||!p)return;const y=Tg(d),v=Tg(i.clientWidth-(u+f)),g=Tg(i.clientHeight-(d+p)),m=Tg(u),b={rootMargin:-y+"px "+-v+"px "+-g+"px "+-m+"px",threshold:Ti(0,ul(1,l))||1};let S=!0;function w(E){const T=E[0].intersectionRatio;if(T!==l){if(!S)return a();T?a(!1,T):r=setTimeout(()=>{a(!1,1e-7)},1e3)}T===1&&!IF(c,t.getBoundingClientRect())&&a(),S=!1}try{n=new IntersectionObserver(w,{...b,root:i.ownerDocument})}catch{n=new IntersectionObserver(w,b)}n.observe(t)}return a(!0),o}function zK(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=wA(t),u=i||o?[...c?wp(c):[],...wp(e)]:[];u.forEach(m=>{i&&m.addEventListener("scroll",n,{passive:!0}),o&&m.addEventListener("resize",n)});const d=c&&s?$K(c,n):null;let f=-1,p=null;a&&(p=new ResizeObserver(m=>{let[x]=m;x&&x.target===c&&p&&(p.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var b;(b=p)==null||b.observe(e)})),n()}),c&&!l&&p.observe(c),p.observe(e));let y,v=l?Ac(t):null;l&&g();function g(){const m=Ac(t);v&&!IF(v,m)&&n(),v=m,y=requestAnimationFrame(g)}return n(),()=>{var m;u.forEach(x=>{i&&x.removeEventListener("scroll",n),o&&x.removeEventListener("resize",n)}),d==null||d(),(m=p)==null||m.disconnect(),p=null,l&&cancelAnimationFrame(y)}}const HK=_K,VK=wK,GK=yK,WK=EK,XK=xK,SN=vK,qK=SK,KK=(t,e,n)=>{const r=new Map,i={platform:BK,...n},o={...i.platform,_c:r};return gK(t,e,{...i,platform:o})};var YK=typeof document<"u",JK=function(){},Uv=YK?_.useLayoutEffect:JK;function Ey(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!Ey(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&t.$$typeof)&&!Ey(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function DF(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function EN(t,e){const n=DF(t);return Math.round(e*n)/n}function $_(t){const e=_.useRef(t);return Uv(()=>{e.current=t}),e}function ZK(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:a}={},transform:s=!0,whileElementsMounted:l,open:c}=t,[u,d]=_.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[f,p]=_.useState(r);Ey(f,r)||p(r);const[y,v]=_.useState(null),[g,m]=_.useState(null),x=_.useCallback(L=>{L!==E.current&&(E.current=L,v(L))},[]),b=_.useCallback(L=>{L!==T.current&&(T.current=L,m(L))},[]),S=o||y,w=a||g,E=_.useRef(null),T=_.useRef(null),A=_.useRef(u),M=l!=null,C=$_(l),P=$_(i),R=$_(c),D=_.useCallback(()=>{if(!E.current||!T.current)return;const L={placement:e,strategy:n,middleware:f};P.current&&(L.platform=P.current),KK(E.current,T.current,L).then(j=>{const X={...j,isPositioned:R.current!==!1};k.current&&!Ey(A.current,X)&&(A.current=X,Bc.flushSync(()=>{d(X)}))})},[f,e,n,P,R]);Uv(()=>{c===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,d(L=>({...L,isPositioned:!1})))},[c]);const k=_.useRef(!1);Uv(()=>(k.current=!0,()=>{k.current=!1}),[]),Uv(()=>{if(S&&(E.current=S),w&&(T.current=w),S&&w){if(C.current)return C.current(S,w,D);D()}},[S,w,D,C,M]);const U=_.useMemo(()=>({reference:E,floating:T,setReference:x,setFloating:b}),[x,b]),O=_.useMemo(()=>({reference:S,floating:w}),[S,w]),W=_.useMemo(()=>{const L={position:n,left:0,top:0};if(!O.floating)return L;const j=EN(O.floating,u.x),X=EN(O.floating,u.y);return s?{...L,transform:"translate("+j+"px, "+X+"px)",...DF(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:j,top:X}},[n,s,O.floating,u.x,u.y]);return _.useMemo(()=>({...u,update:D,refs:U,elements:O,floatingStyles:W}),[u,D,U,O,W])}const QK=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:i}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?SN({element:r.current,padding:i}).fn(n):{}:r?SN({element:r,padding:i}).fn(n):{}}}},eY=(t,e)=>({...HK(t),options:[t,e]}),tY=(t,e)=>({...VK(t),options:[t,e]}),nY=(t,e)=>({...qK(t),options:[t,e]}),rY=(t,e)=>({...GK(t),options:[t,e]}),iY=(t,e)=>({...WK(t),options:[t,e]}),oY=(t,e)=>({...XK(t),options:[t,e]}),aY=(t,e)=>({...QK(t),options:[t,e]});var sY="Arrow",LF=_.forwardRef((t,e)=>{const{children:n,width:r=10,height:i=5,...o}=t;return h.jsx(nt.svg,{...o,ref:e,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:h.jsx("polygon",{points:"0,0 30,0 15,10"})})});LF.displayName=sY;var lY=LF;function EA(t){const[e,n]=_.useState(void 0);return ur(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,s;if("borderBoxSize"in o){const l=o.borderBoxSize,c=Array.isArray(l)?l[0]:l;a=c.inlineSize,s=c.blockSize}else a=t.offsetWidth,s=t.offsetHeight;n({width:a,height:s})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var TA="Popper",[kF,El]=mi(TA),[cY,jF]=kF(TA),UF=t=>{const{__scopePopper:e,children:n}=t,[r,i]=_.useState(null);return h.jsx(cY,{scope:e,anchor:r,onAnchorChange:i,children:n})};UF.displayName=TA;var FF="PopperAnchor",BF=_.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...i}=t,o=jF(FF,n),a=_.useRef(null),s=Ot(e,a);return _.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:h.jsx(nt.div,{...i,ref:s})});BF.displayName=FF;var MA="PopperContent",[uY,dY]=kF(MA),$F=_.forwardRef((t,e)=>{var Q,ce,ae,fe,we,le;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:a=0,arrowPadding:s=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:y,...v}=t,g=jF(MA,n),[m,x]=_.useState(null),b=Ot(e,ie=>x(ie)),[S,w]=_.useState(null),E=EA(S),T=(E==null?void 0:E.width)??0,A=(E==null?void 0:E.height)??0,M=r+(o!=="center"?"-"+o:""),C=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},P=Array.isArray(c)?c:[c],R=P.length>0,D={padding:C,boundary:P.filter(hY),altBoundary:R},{refs:k,floatingStyles:U,placement:O,isPositioned:W,middlewareData:L}=ZK({strategy:"fixed",placement:M,whileElementsMounted:(...ie)=>zK(...ie,{animationFrame:p==="always"}),elements:{reference:g.anchor},middleware:[eY({mainAxis:i+A,alignmentAxis:a}),l&&tY({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?nY():void 0,...D}),l&&rY({...D}),iY({...D,apply:({elements:ie,rects:G,availableWidth:Ve,availableHeight:Ne})=>{const{width:st,height:Re}=G.reference,ct=ie.floating.style;ct.setProperty("--radix-popper-available-width",`${Ve}px`),ct.setProperty("--radix-popper-available-height",`${Ne}px`),ct.setProperty("--radix-popper-anchor-width",`${st}px`),ct.setProperty("--radix-popper-anchor-height",`${Re}px`)}}),S&&aY({element:S,padding:s}),pY({arrowWidth:T,arrowHeight:A}),f&&oY({strategy:"referenceHidden",...D})]}),[j,X]=VF(O),K=di(y);ur(()=>{W&&(K==null||K())},[W,K]);const F=(Q=L.arrow)==null?void 0:Q.x,Y=(ce=L.arrow)==null?void 0:ce.y,q=((ae=L.arrow)==null?void 0:ae.centerOffset)!==0,[ee,te]=_.useState();return ur(()=>{m&&te(window.getComputedStyle(m).zIndex)},[m]),h.jsx("div",{ref:k.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:W?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ee,"--radix-popper-transform-origin":[(fe=L.transformOrigin)==null?void 0:fe.x,(we=L.transformOrigin)==null?void 0:we.y].join(" "),...((le=L.hide)==null?void 0:le.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:h.jsx(uY,{scope:n,placedSide:j,onArrowChange:w,arrowX:F,arrowY:Y,shouldHideArrow:q,children:h.jsx(nt.div,{"data-side":j,"data-align":X,...v,ref:b,style:{...v.style,animation:W?void 0:"none"}})})})});$F.displayName=MA;var zF="PopperArrow",fY={top:"bottom",right:"left",bottom:"top",left:"right"},HF=_.forwardRef(function(e,n){const{__scopePopper:r,...i}=e,o=dY(zF,r),a=fY[o.placedSide];return h.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:h.jsx(lY,{...i,ref:n,style:{...i.style,display:"block"}})})});HF.displayName=zF;function hY(t){return t!==null}var pY=t=>({name:"transformOrigin",options:t,fn(e){var g,m,x;const{placement:n,rects:r,middlewareData:i}=e,a=((g=i.arrow)==null?void 0:g.centerOffset)!==0,s=a?0:t.arrowWidth,l=a?0:t.arrowHeight,[c,u]=VF(n),d={start:"0%",center:"50%",end:"100%"}[u],f=(((m=i.arrow)==null?void 0:m.x)??0)+s/2,p=(((x=i.arrow)==null?void 0:x.y)??0)+l/2;let y="",v="";return c==="bottom"?(y=a?d:`${f}px`,v=`${-l}px`):c==="top"?(y=a?d:`${f}px`,v=`${r.floating.height+l}px`):c==="right"?(y=`${-l}px`,v=a?d:`${p}px`):c==="left"&&(y=`${r.floating.width+l}px`,v=a?d:`${p}px`),{data:{x:y,y:v}}}});function VF(t){const[e,n="center"]=t.split("-");return[e,n]}var gx=UF,Cm=BF,vx=$F,yx=HF,[xx,_De]=mi("Tooltip",[El]),bx=El(),GF="TooltipProvider",mY=700,xE="tooltip.open",[gY,AA]=xx(GF),WF=t=>{const{__scopeTooltip:e,delayDuration:n=mY,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=t,a=_.useRef(!0),s=_.useRef(!1),l=_.useRef(0);return _.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),h.jsx(gY,{scope:e,isOpenDelayedRef:a,delayDuration:n,onOpen:_.useCallback(()=>{window.clearTimeout(l.current),a.current=!1},[]),onClose:_.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:_.useCallback(c=>{s.current=c},[]),disableHoverableContent:i,children:o})};WF.displayName=GF;var Sp="Tooltip",[vY,_x]=xx(Sp),XF=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:i,onOpenChange:o,disableHoverableContent:a,delayDuration:s}=t,l=AA(Sp,t.__scopeTooltip),c=bx(e),[u,d]=_.useState(null),f=sr(),p=_.useRef(0),y=a??l.disableHoverableContent,v=s??l.delayDuration,g=_.useRef(!1),[m,x]=$o({prop:r,defaultProp:i??!1,onChange:T=>{T?(l.onOpen(),document.dispatchEvent(new CustomEvent(xE))):l.onClose(),o==null||o(T)},caller:Sp}),b=_.useMemo(()=>m?g.current?"delayed-open":"instant-open":"closed",[m]),S=_.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,x(!0)},[x]),w=_.useCallback(()=>{window.clearTimeout(p.current),p.current=0,x(!1)},[x]),E=_.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,x(!0),p.current=0},v)},[v,x]);return _.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),h.jsx(gx,{...c,children:h.jsx(vY,{scope:e,contentId:f,open:m,stateAttribute:b,trigger:u,onTriggerChange:d,onTriggerEnter:_.useCallback(()=>{l.isOpenDelayedRef.current?E():S()},[l.isOpenDelayedRef,E,S]),onTriggerLeave:_.useCallback(()=>{y?w():(window.clearTimeout(p.current),p.current=0)},[w,y]),onOpen:S,onClose:w,disableHoverableContent:y,children:n})})};XF.displayName=Sp;var bE="TooltipTrigger",qF=_.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=_x(bE,n),o=AA(bE,n),a=bx(n),s=_.useRef(null),l=Ot(e,s,i.onTriggerChange),c=_.useRef(!1),u=_.useRef(!1),d=_.useCallback(()=>c.current=!1,[]);return _.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),h.jsx(Cm,{asChild:!0,...a,children:h.jsx(nt.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:l,onPointerMove:Oe(t.onPointerMove,f=>{f.pointerType!=="touch"&&!u.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),u.current=!0)}),onPointerLeave:Oe(t.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:Oe(t.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Oe(t.onFocus,()=>{c.current||i.onOpen()}),onBlur:Oe(t.onBlur,i.onClose),onClick:Oe(t.onClick,i.onClose)})})});qF.displayName=bE;var yY="TooltipPortal",[wDe,xY]=xx(yY,{forceMount:void 0}),Dd="TooltipContent",KF=_.forwardRef((t,e)=>{const n=xY(Dd,t.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=t,a=_x(Dd,t.__scopeTooltip);return h.jsx(gi,{present:r||a.open,children:a.disableHoverableContent?h.jsx(YF,{side:i,...o,ref:e}):h.jsx(bY,{side:i,...o,ref:e})})}),bY=_.forwardRef((t,e)=>{const n=_x(Dd,t.__scopeTooltip),r=AA(Dd,t.__scopeTooltip),i=_.useRef(null),o=Ot(e,i),[a,s]=_.useState(null),{trigger:l,onClose:c}=n,u=i.current,{onPointerInTransitChange:d}=r,f=_.useCallback(()=>{s(null),d(!1)},[d]),p=_.useCallback((y,v)=>{const g=y.currentTarget,m={x:y.clientX,y:y.clientY},x=TY(m,g.getBoundingClientRect()),b=MY(m,x),S=AY(v.getBoundingClientRect()),w=PY([...b,...S]);s(w),d(!0)},[d]);return _.useEffect(()=>()=>f(),[f]),_.useEffect(()=>{if(l&&u){const y=g=>p(g,u),v=g=>p(g,l);return l.addEventListener("pointerleave",y),u.addEventListener("pointerleave",v),()=>{l.removeEventListener("pointerleave",y),u.removeEventListener("pointerleave",v)}}},[l,u,p,f]),_.useEffect(()=>{if(a){const y=v=>{const g=v.target,m={x:v.clientX,y:v.clientY},x=(l==null?void 0:l.contains(g))||(u==null?void 0:u.contains(g)),b=!CY(m,a);x?f():b&&(f(),c())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[l,u,a,c,f]),h.jsx(YF,{...t,ref:o})}),[_Y,wY]=xx(Sp,{isInside:!1}),SY=uU("TooltipContent"),YF=_.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:a,...s}=t,l=_x(Dd,n),c=bx(n),{onClose:u}=l;return _.useEffect(()=>(document.addEventListener(xE,u),()=>document.removeEventListener(xE,u)),[u]),_.useEffect(()=>{if(l.trigger){const d=f=>{const p=f.target;p!=null&&p.contains(l.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,u]),h.jsx(zc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:h.jsxs(vx,{"data-state":l.stateAttribute,...c,...s,ref:e,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[h.jsx(SY,{children:r}),h.jsx(_Y,{scope:n,isInside:!0,children:h.jsx(S7,{id:l.contentId,role:"tooltip",children:i||r})})]})})});KF.displayName=Dd;var JF="TooltipArrow",EY=_.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=bx(n);return wY(JF,n).isInside?null:h.jsx(yx,{...i,...r,ref:e})});EY.displayName=JF;function TY(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),i=Math.abs(e.right-t.x),o=Math.abs(e.left-t.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function MY(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function AY(t){const{top:e,right:n,bottom:r,left:i}=t;return[{x:i,y:e},{x:n,y:e},{x:n,y:r},{x:i,y:r}]}function CY(t,e){const{x:n,y:r}=t;let i=!1;for(let o=0,a=e.length-1;or!=f>r&&n<(d-c)*(r-u)/(f-u)+c&&(i=!i)}return i}function PY(t){const e=t.slice();return e.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),RY(e)}function RY(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r=2;){const o=e[e.length-1],a=e[e.length-2];if((o.x-a.x)*(i.y-a.y)>=(o.y-a.y)*(i.x-a.x))e.pop();else break}e.push(i)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const i=t[r];for(;n.length>=2;){const o=n[n.length-1],a=n[n.length-2];if((o.x-a.x)*(i.y-a.y)>=(o.y-a.y)*(i.x-a.x))n.pop();else break}n.push(i)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var NY=XF,OY=qF,ZF=KF;const Fv=NY,Bv=OY,Gh=_.forwardRef(({className:t,sideOffset:e=4,...n},r)=>h.jsx(ZF,{ref:r,sideOffset:e,className:He("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n}));Gh.displayName=ZF.displayName;var wx="Popover",[QF,SDe]=mi(wx,[El]),Pm=El(),[IY,Tl]=QF(wx),eB=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:a=!1}=t,s=Pm(e),l=_.useRef(null),[c,u]=_.useState(!1),[d,f]=$o({prop:r,defaultProp:i??!1,onChange:o,caller:wx});return h.jsx(gx,{...s,children:h.jsx(IY,{scope:e,contentId:sr(),triggerRef:l,open:d,onOpenChange:f,onOpenToggle:_.useCallback(()=>f(p=>!p),[f]),hasCustomAnchor:c,onCustomAnchorAdd:_.useCallback(()=>u(!0),[]),onCustomAnchorRemove:_.useCallback(()=>u(!1),[]),modal:a,children:n})})};eB.displayName=wx;var tB="PopoverAnchor",DY=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Tl(tB,n),o=Pm(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:s}=i;return _.useEffect(()=>(a(),()=>s()),[a,s]),h.jsx(Cm,{...o,...r,ref:e})});DY.displayName=tB;var nB="PopoverTrigger",rB=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Tl(nB,n),o=Pm(n),a=Ot(e,i.triggerRef),s=h.jsx(nt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":lB(i.open),...r,ref:a,onClick:Oe(t.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:h.jsx(Cm,{asChild:!0,...o,children:s})});rB.displayName=nB;var CA="PopoverPortal",[LY,kY]=QF(CA,{forceMount:void 0}),iB=t=>{const{__scopePopover:e,forceMount:n,children:r,container:i}=t,o=Tl(CA,e);return h.jsx(LY,{scope:e,forceMount:n,children:h.jsx(gi,{present:n||o.open,children:h.jsx(vf,{asChild:!0,container:i,children:r})})})};iB.displayName=CA;var Ld="PopoverContent",oB=_.forwardRef((t,e)=>{const n=kY(Ld,t.__scopePopover),{forceMount:r=n.forceMount,...i}=t,o=Tl(Ld,t.__scopePopover);return h.jsx(gi,{present:r||o.open,children:o.modal?h.jsx(UY,{...i,ref:e}):h.jsx(FY,{...i,ref:e})})});oB.displayName=Ld;var jY=sl("PopoverContent.RemoveScroll"),UY=_.forwardRef((t,e)=>{const n=Tl(Ld,t.__scopePopover),r=_.useRef(null),i=Ot(e,r),o=_.useRef(!1);return _.useEffect(()=>{const a=r.current;if(a)return cx(a)},[]),h.jsx(Mm,{as:jY,allowPinchZoom:!0,children:h.jsx(aB,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Oe(t.onCloseAutoFocus,a=>{var s;a.preventDefault(),o.current||(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:Oe(t.onPointerDownOutside,a=>{const s=a.detail.originalEvent,l=s.button===0&&s.ctrlKey===!0,c=s.button===2||l;o.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:Oe(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),FY=_.forwardRef((t,e)=>{const n=Tl(Ld,t.__scopePopover),r=_.useRef(!1),i=_.useRef(!1);return h.jsx(aB,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var a,s;(a=t.onCloseAutoFocus)==null||a.call(t,o),o.defaultPrevented||(r.current||(s=n.triggerRef.current)==null||s.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var l,c;(l=t.onInteractOutside)==null||l.call(t,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=o.target;((c=n.triggerRef.current)==null?void 0:c.contains(a))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),aB=_.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...d}=t,f=Tl(Ld,n),p=Pm(n);return sx(),h.jsx(Tm,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:h.jsx(zc,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>f.onOpenChange(!1),children:h.jsx(vx,{"data-state":lB(f.open),role:"dialog",id:f.contentId,...p,...d,ref:e,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),sB="PopoverClose",BY=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Tl(sB,n);return h.jsx(nt.button,{type:"button",...r,ref:e,onClick:Oe(t.onClick,()=>i.onOpenChange(!1))})});BY.displayName=sB;var $Y="PopoverArrow",zY=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Pm(n);return h.jsx(yx,{...i,...r,ref:e})});zY.displayName=$Y;function lB(t){return t?"open":"closed"}var HY=eB,VY=rB,GY=iB,cB=oB;const Sx=HY,Ex=VY,Rm=_.forwardRef(({className:t,align:e="center",sideOffset:n=4,...r},i)=>h.jsx(GY,{children:h.jsx(cB,{ref:i,align:e,sideOffset:n,className:He("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r})}));Rm.displayName=cB.displayName;var TN=1,WY=.9,XY=.8,qY=.17,z_=.1,H_=.999,KY=.9999,YY=.99,JY=/[\\\/_+.#"@\[\(\{&]/,ZY=/[\\\/_+.#"@\[\(\{&]/g,QY=/[\s-]/,uB=/[\s-]/g;function _E(t,e,n,r,i,o,a){if(o===e.length)return i===t.length?TN:YY;var s=`${i},${o}`;if(a[s]!==void 0)return a[s];for(var l=r.charAt(o),c=n.indexOf(l,i),u=0,d,f,p,y;c>=0;)d=_E(t,e,n,r,c+1,o+1,a),d>u&&(c===i?d*=TN:JY.test(t.charAt(c-1))?(d*=XY,p=t.slice(i,c-1).match(ZY),p&&i>0&&(d*=Math.pow(H_,p.length))):QY.test(t.charAt(c-1))?(d*=WY,y=t.slice(i,c-1).match(uB),y&&i>0&&(d*=Math.pow(H_,y.length))):(d*=qY,i>0&&(d*=Math.pow(H_,c-i))),t.charAt(c)!==e.charAt(o)&&(d*=KY)),(dd&&(d=f*z_)),d>u&&(u=d),c=n.indexOf(l,c+1);return a[s]=u,u}function MN(t){return t.toLowerCase().replace(uB," ")}function eJ(t,e,n){return t=n&&n.length>0?`${t+" "+n.join(" ")}`:t,_E(t,e,MN(t),MN(e),0,0,{})}var eh='[cmdk-group=""]',V_='[cmdk-group-items=""]',tJ='[cmdk-group-heading=""]',dB='[cmdk-item=""]',AN=`${dB}:not([aria-disabled="true"])`,wE="cmdk-item-select",Mu="data-value",nJ=(t,e,n)=>eJ(t,e,n),fB=_.createContext(void 0),Nm=()=>_.useContext(fB),hB=_.createContext(void 0),PA=()=>_.useContext(hB),pB=_.createContext(void 0),mB=_.forwardRef((t,e)=>{let n=Au(()=>{var F,Y;return{search:"",value:(Y=(F=t.value)!=null?F:t.defaultValue)!=null?Y:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Au(()=>new Set),i=Au(()=>new Map),o=Au(()=>new Map),a=Au(()=>new Set),s=gB(t),{label:l,children:c,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:y,disablePointerSelection:v=!1,vimBindings:g=!0,...m}=t,x=sr(),b=sr(),S=sr(),w=_.useRef(null),E=hJ();Cc(()=>{if(u!==void 0){let F=u.trim();n.current.value=F,T.emit()}},[u]),Cc(()=>{E(6,D)},[]);let T=_.useMemo(()=>({subscribe:F=>(a.current.add(F),()=>a.current.delete(F)),snapshot:()=>n.current,setState:(F,Y,q)=>{var ee,te,Q,ce;if(!Object.is(n.current[F],Y)){if(n.current[F]=Y,F==="search")R(),C(),E(1,P);else if(F==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ae=document.getElementById(S);ae?ae.focus():(ee=document.getElementById(x))==null||ee.focus()}if(E(7,()=>{var ae;n.current.selectedItemId=(ae=k())==null?void 0:ae.id,T.emit()}),q||E(5,D),((te=s.current)==null?void 0:te.value)!==void 0){let ae=Y??"";(ce=(Q=s.current).onValueChange)==null||ce.call(Q,ae);return}}T.emit()}},emit:()=>{a.current.forEach(F=>F())}}),[]),A=_.useMemo(()=>({value:(F,Y,q)=>{var ee;Y!==((ee=o.current.get(F))==null?void 0:ee.value)&&(o.current.set(F,{value:Y,keywords:q}),n.current.filtered.items.set(F,M(Y,q)),E(2,()=>{C(),T.emit()}))},item:(F,Y)=>(r.current.add(F),Y&&(i.current.has(Y)?i.current.get(Y).add(F):i.current.set(Y,new Set([F]))),E(3,()=>{R(),C(),n.current.value||P(),T.emit()}),()=>{o.current.delete(F),r.current.delete(F),n.current.filtered.items.delete(F);let q=k();E(4,()=>{R(),(q==null?void 0:q.getAttribute("id"))===F&&P(),T.emit()})}),group:F=>(i.current.has(F)||i.current.set(F,new Set),()=>{o.current.delete(F),i.current.delete(F)}),filter:()=>s.current.shouldFilter,label:l||t["aria-label"],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:x,inputId:S,labelId:b,listInnerRef:w}),[]);function M(F,Y){var q,ee;let te=(ee=(q=s.current)==null?void 0:q.filter)!=null?ee:nJ;return F?te(F,n.current.search,Y):0}function C(){if(!n.current.search||s.current.shouldFilter===!1)return;let F=n.current.filtered.items,Y=[];n.current.filtered.groups.forEach(ee=>{let te=i.current.get(ee),Q=0;te.forEach(ce=>{let ae=F.get(ce);Q=Math.max(ae,Q)}),Y.push([ee,Q])});let q=w.current;U().sort((ee,te)=>{var Q,ce;let ae=ee.getAttribute("id"),fe=te.getAttribute("id");return((Q=F.get(fe))!=null?Q:0)-((ce=F.get(ae))!=null?ce:0)}).forEach(ee=>{let te=ee.closest(V_);te?te.appendChild(ee.parentElement===te?ee:ee.closest(`${V_} > *`)):q.appendChild(ee.parentElement===q?ee:ee.closest(`${V_} > *`))}),Y.sort((ee,te)=>te[1]-ee[1]).forEach(ee=>{var te;let Q=(te=w.current)==null?void 0:te.querySelector(`${eh}[${Mu}="${encodeURIComponent(ee[0])}"]`);Q==null||Q.parentElement.appendChild(Q)})}function P(){let F=U().find(q=>q.getAttribute("aria-disabled")!=="true"),Y=F==null?void 0:F.getAttribute(Mu);T.setState("value",Y||void 0)}function R(){var F,Y,q,ee;if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let te=0;for(let Q of r.current){let ce=(Y=(F=o.current.get(Q))==null?void 0:F.value)!=null?Y:"",ae=(ee=(q=o.current.get(Q))==null?void 0:q.keywords)!=null?ee:[],fe=M(ce,ae);n.current.filtered.items.set(Q,fe),fe>0&&te++}for(let[Q,ce]of i.current)for(let ae of ce)if(n.current.filtered.items.get(ae)>0){n.current.filtered.groups.add(Q);break}n.current.filtered.count=te}function D(){var F,Y,q;let ee=k();ee&&(((F=ee.parentElement)==null?void 0:F.firstChild)===ee&&((q=(Y=ee.closest(eh))==null?void 0:Y.querySelector(tJ))==null||q.scrollIntoView({block:"nearest"})),ee.scrollIntoView({block:"nearest"}))}function k(){var F;return(F=w.current)==null?void 0:F.querySelector(`${dB}[aria-selected="true"]`)}function U(){var F;return Array.from(((F=w.current)==null?void 0:F.querySelectorAll(AN))||[])}function O(F){let Y=U()[F];Y&&T.setState("value",Y.getAttribute(Mu))}function W(F){var Y;let q=k(),ee=U(),te=ee.findIndex(ce=>ce===q),Q=ee[te+F];(Y=s.current)!=null&&Y.loop&&(Q=te+F<0?ee[ee.length-1]:te+F===ee.length?ee[0]:ee[te+F]),Q&&T.setState("value",Q.getAttribute(Mu))}function L(F){let Y=k(),q=Y==null?void 0:Y.closest(eh),ee;for(;q&&!ee;)q=F>0?dJ(q,eh):fJ(q,eh),ee=q==null?void 0:q.querySelector(AN);ee?T.setState("value",ee.getAttribute(Mu)):W(F)}let j=()=>O(U().length-1),X=F=>{F.preventDefault(),F.metaKey?j():F.altKey?L(1):W(1)},K=F=>{F.preventDefault(),F.metaKey?O(0):F.altKey?L(-1):W(-1)};return _.createElement(nt.div,{ref:e,tabIndex:-1,...m,"cmdk-root":"",onKeyDown:F=>{var Y;(Y=m.onKeyDown)==null||Y.call(m,F);let q=F.nativeEvent.isComposing||F.keyCode===229;if(!(F.defaultPrevented||q))switch(F.key){case"n":case"j":{g&&F.ctrlKey&&X(F);break}case"ArrowDown":{X(F);break}case"p":case"k":{g&&F.ctrlKey&&K(F);break}case"ArrowUp":{K(F);break}case"Home":{F.preventDefault(),O(0);break}case"End":{F.preventDefault(),j();break}case"Enter":{F.preventDefault();let ee=k();if(ee){let te=new Event(wE);ee.dispatchEvent(te)}}}}},_.createElement("label",{"cmdk-label":"",htmlFor:A.inputId,id:A.labelId,style:mJ},l),Tx(t,F=>_.createElement(hB.Provider,{value:T},_.createElement(fB.Provider,{value:A},F))))}),rJ=_.forwardRef((t,e)=>{var n,r;let i=sr(),o=_.useRef(null),a=_.useContext(pB),s=Nm(),l=gB(t),c=(r=(n=l.current)==null?void 0:n.forceMount)!=null?r:a==null?void 0:a.forceMount;Cc(()=>{if(!c)return s.item(i,a==null?void 0:a.id)},[c]);let u=vB(i,o,[t.value,t.children,o],t.keywords),d=PA(),f=fl(E=>E.value&&E.value===u.current),p=fl(E=>c||s.filter()===!1?!0:E.search?E.filtered.items.get(i)>0:!0);_.useEffect(()=>{let E=o.current;if(!(!E||t.disabled))return E.addEventListener(wE,y),()=>E.removeEventListener(wE,y)},[p,t.onSelect,t.disabled]);function y(){var E,T;v(),(T=(E=l.current).onSelect)==null||T.call(E,u.current)}function v(){d.setState("value",u.current,!0)}if(!p)return null;let{disabled:g,value:m,onSelect:x,forceMount:b,keywords:S,...w}=t;return _.createElement(nt.div,{ref:is(o,e),...w,id:i,"cmdk-item":"",role:"option","aria-disabled":!!g,"aria-selected":!!f,"data-disabled":!!g,"data-selected":!!f,onPointerMove:g||s.getDisablePointerSelection()?void 0:v,onClick:g?void 0:y},t.children)}),iJ=_.forwardRef((t,e)=>{let{heading:n,children:r,forceMount:i,...o}=t,a=sr(),s=_.useRef(null),l=_.useRef(null),c=sr(),u=Nm(),d=fl(p=>i||u.filter()===!1?!0:p.search?p.filtered.groups.has(a):!0);Cc(()=>u.group(a),[]),vB(a,s,[t.value,t.heading,l]);let f=_.useMemo(()=>({id:a,forceMount:i}),[i]);return _.createElement(nt.div,{ref:is(s,e),...o,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},n&&_.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:c},n),Tx(t,p=>_.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?c:void 0},_.createElement(pB.Provider,{value:f},p))))}),oJ=_.forwardRef((t,e)=>{let{alwaysRender:n,...r}=t,i=_.useRef(null),o=fl(a=>!a.search);return!n&&!o?null:_.createElement(nt.div,{ref:is(i,e),...r,"cmdk-separator":"",role:"separator"})}),aJ=_.forwardRef((t,e)=>{let{onValueChange:n,...r}=t,i=t.value!=null,o=PA(),a=fl(c=>c.search),s=fl(c=>c.selectedItemId),l=Nm();return _.useEffect(()=>{t.value!=null&&o.setState("search",t.value)},[t.value]),_.createElement(nt.input,{ref:e,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":s,id:l.inputId,type:"text",value:i?t.value:a,onChange:c=>{i||o.setState("search",c.target.value),n==null||n(c.target.value)}})}),sJ=_.forwardRef((t,e)=>{let{children:n,label:r="Suggestions",...i}=t,o=_.useRef(null),a=_.useRef(null),s=fl(c=>c.selectedItemId),l=Nm();return _.useEffect(()=>{if(a.current&&o.current){let c=a.current,u=o.current,d,f=new ResizeObserver(()=>{d=requestAnimationFrame(()=>{let p=c.offsetHeight;u.style.setProperty("--cmdk-list-height",p.toFixed(1)+"px")})});return f.observe(c),()=>{cancelAnimationFrame(d),f.unobserve(c)}}},[]),_.createElement(nt.div,{ref:is(o,e),...i,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:l.listId},Tx(t,c=>_.createElement("div",{ref:is(a,l.listInnerRef),"cmdk-list-sizer":""},c)))}),lJ=_.forwardRef((t,e)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:o,container:a,...s}=t;return _.createElement(fA,{open:n,onOpenChange:r},_.createElement(hA,{container:a},_.createElement(dx,{"cmdk-overlay":"",className:i}),_.createElement(fx,{"aria-label":t.label,"cmdk-dialog":"",className:o},_.createElement(mB,{ref:e,...s}))))}),cJ=_.forwardRef((t,e)=>fl(n=>n.filtered.count===0)?_.createElement(nt.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),uJ=_.forwardRef((t,e)=>{let{progress:n,children:r,label:i="Loading...",...o}=t;return _.createElement(nt.div,{ref:e,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},Tx(t,a=>_.createElement("div",{"aria-hidden":!0},a)))}),vi=Object.assign(mB,{List:sJ,Item:rJ,Input:aJ,Group:iJ,Separator:oJ,Dialog:lJ,Empty:cJ,Loading:uJ});function dJ(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function fJ(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function gB(t){let e=_.useRef(t);return Cc(()=>{e.current=t}),e}var Cc=typeof window>"u"?_.useEffect:_.useLayoutEffect;function Au(t){let e=_.useRef();return e.current===void 0&&(e.current=t()),e}function fl(t){let e=PA(),n=()=>t(e.snapshot());return _.useSyncExternalStore(e.subscribe,n,n)}function vB(t,e,n,r=[]){let i=_.useRef(),o=Nm();return Cc(()=>{var a;let s=(()=>{var c;for(let u of n){if(typeof u=="string")return u.trim();if(typeof u=="object"&&"current"in u)return u.current?(c=u.current.textContent)==null?void 0:c.trim():i.current}})(),l=r.map(c=>c.trim());o.value(t,s,l),(a=e.current)==null||a.setAttribute(Mu,s),i.current=s}),i}var hJ=()=>{let[t,e]=_.useState(),n=Au(()=>new Map);return Cc(()=>{n.current.forEach(r=>r()),n.current=new Map},[t]),(r,i)=>{n.current.set(r,i),e({})}};function pJ(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function Tx({asChild:t,children:e},n){return t&&_.isValidElement(e)?_.cloneElement(pJ(e),{ref:e.ref},n(e.props.children)):n(e)}var mJ={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Mx=_.forwardRef(({className:t,...e},n)=>h.jsx(vi,{ref:n,className:He("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...e}));Mx.displayName=vi.displayName;const Ax=_.forwardRef(({className:t,...e},n)=>h.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[h.jsx(oA,{className:"mr-2 h-4 w-4 shrink-0 text-slate-400"}),h.jsx(vi.Input,{ref:n,className:He("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",t),...e})]}));Ax.displayName=vi.Input.displayName;const Cx=_.forwardRef(({className:t,...e},n)=>h.jsx(vi.List,{ref:n,className:He("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...e}));Cx.displayName=vi.List.displayName;const Px=_.forwardRef((t,e)=>h.jsx(vi.Empty,{ref:e,className:"py-6 text-center text-sm",...t}));Px.displayName=vi.Empty.displayName;const Qs=_.forwardRef(({className:t,...e},n)=>h.jsx(vi.Group,{ref:n,className:He("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",t),...e}));Qs.displayName=vi.Group.displayName;const gJ=_.forwardRef(({className:t,...e},n)=>h.jsx(vi.Separator,{ref:n,className:He("-mx-1 h-px bg-border",t),...e}));gJ.displayName=vi.Separator.displayName;const kd=_.forwardRef(({className:t,...e},n)=>h.jsx(vi.Item,{ref:n,className:He("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",t),...e}));kd.displayName=vi.Item.displayName;const vJ=({selectedName:t,availableNames:e,onSelect:n,onCreateNew:r,isLoading:i})=>{const[o,a]=_.useState(!1),[s,l]=_.useState(""),c=s.trim(),u=e.some(m=>m.toLowerCase()===c.toLowerCase()),d=c.length>0&&!u,f=!d,p=u?"Already exists":c===""?"Create new robotโ€ฆ":`Create "${c}"`,y=()=>{l(""),a(!1)},v=m=>{n(m),y()},g=async()=>{if(!d)return;await r(c)&&y()};return h.jsxs(Sx,{open:o,onOpenChange:a,children:[h.jsx(Ex,{asChild:!0,children:h.jsxs(et,{variant:"outline",role:"combobox","aria-expanded":o,disabled:i,className:"w-full justify-between bg-gray-900 border-gray-700 text-white hover:bg-gray-700 hover:text-white font-normal",children:[h.jsx("span",{className:He("truncate",t?"":"text-gray-400"),children:i?"Loading...":t??"Select a robot or type a new name"}),h.jsx(tA,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),h.jsx(Rm,{className:"p-0 bg-gray-800 border-gray-700 text-white",style:{width:"var(--radix-popover-trigger-width)"},align:"start",children:h.jsxs(Mx,{className:"bg-gray-800",children:[h.jsx(Ax,{placeholder:"Search or type new name...",value:s,onValueChange:l,onKeyDown:m=>{m.key==="Enter"&&d&&(m.preventDefault(),g())},className:"text-white"}),h.jsxs(Cx,{children:[e.length===0&&h.jsx(Px,{className:"py-4 text-sm text-gray-400 text-center",children:"No robots yet. Type a name to create one."}),e.length>0&&h.jsx(Qs,{heading:"Existing",children:e.map(m=>h.jsxs(kd,{value:m,onSelect:()=>v(m),className:"text-white aria-selected:bg-gray-700",children:[h.jsx(xl,{className:He("mr-2 h-4 w-4",t===m?"opacity-100":"opacity-0")}),m]},m))})]}),h.jsxs("button",{type:"button",onClick:g,disabled:f,className:"flex w-full items-center gap-2 border-t border-gray-700 px-3 py-2 text-sm text-white hover:bg-gray-700 disabled:cursor-not-allowed disabled:text-gray-500 disabled:hover:bg-transparent",children:[h.jsx(iA,{className:"h-4 w-4"}),p]})]})})]})},yJ=({robot:t,selectedName:e,availableNames:n,isLoading:r,onSelect:i,onCreateNew:o,onConfigure:a,onTeleop:s,onDelete:l})=>{const[c,u]=_.useState(!1),d=t?t.is_clean?"Ready":"Needs configuration":null,f=!t||!t.is_clean;return h.jsxs("div",{className:"bg-gray-800 rounded-lg border border-gray-700 p-3 flex flex-col gap-2 relative",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("div",{className:"flex-1 min-w-0",children:h.jsx(vJ,{selectedName:e,availableNames:n,onSelect:i,onCreateNew:o,isLoading:r})}),d&&h.jsx("p",{className:`text-xs truncate shrink-0 ${t.is_clean?"text-green-400":"text-amber-400"}`,children:d}),t&&h.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[h.jsxs(Fv,{children:[h.jsx(Bv,{asChild:!0,children:h.jsx(et,{size:"icon",variant:"ghost",className:"h-8 w-8 text-gray-300 hover:text-white",onClick:()=>a(t.name),"aria-label":"Configure",children:h.jsx(Mh,{className:"w-4 h-4"})})}),h.jsx(Gh,{children:"Configure (calibrate)"})]}),h.jsxs(Fv,{children:[h.jsx(Bv,{asChild:!0,children:h.jsx(et,{size:"icon",variant:"ghost",className:"h-8 w-8 text-red-400 hover:text-red-300 hover:bg-red-900/20",onClick:()=>u(!0),"aria-label":"Delete robot",children:h.jsx(aA,{className:"w-4 h-4"})})}),h.jsx(Gh,{children:"Delete robot config"})]})]})]}),t&&h.jsxs(Fv,{children:[h.jsx(Bv,{asChild:!0,children:h.jsx("div",{className:"w-full",children:h.jsx(et,{onClick:()=>s(t),disabled:f,className:`w-full ${f?"bg-red-500/30 hover:bg-red-500/30 text-red-200 cursor-not-allowed":"bg-yellow-500 hover:bg-yellow-600 text-white"}`,children:"Teleoperation"})})}),f&&h.jsx(Gh,{children:"Configure the robot first."})]}),t&&h.jsx(Hc,{open:c,onOpenChange:u,children:h.jsxs(bl,{className:"bg-gray-900 border-gray-800 text-white",children:[h.jsxs(_l,{children:[h.jsx(wl,{children:"Delete robot config?"}),h.jsx(Sl,{className:"text-gray-400",children:"This deletes the robot config file from disk. Calibration files are not removed. This cannot be undone."})]}),h.jsxs(EF,{className:"flex gap-2 justify-end",children:[h.jsx(et,{variant:"outline",className:"border-gray-600 text-gray-300",onClick:()=>u(!1),children:"Cancel"}),h.jsx(et,{className:"bg-red-500 hover:bg-red-600 text-white",onClick:async()=>{u(!1),await l(t.name)},children:"Delete"})]})]})})]})},xJ=({selectedName:t,selectedRecord:e,availableNames:n,isLoading:r,selectRobot:i,createRobot:o,deleteRobot:a})=>{const s=ji(),{baseUrl:l,fetchWithHeaders:c}=Dn(),{toast:u}=Dr(),d=p=>{s("/calibration",{state:{robot_name:p}})},f=async p=>{try{const y=await c(`${l}/move-arm`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({leader_port:p.leader_port,follower_port:p.follower_port,leader_config:p.leader_config,follower_config:p.follower_config})}),v=await y.json();y.ok?(u({title:"Teleoperation Started",description:v.message||`Started teleoperation for ${p.name}.`}),s("/teleoperation")):u({title:"Error Starting Teleoperation",description:v.message||"Failed to start.",variant:"destructive"})}catch{u({title:"Connection Error",description:"Could not connect to the backend server.",variant:"destructive"})}};return h.jsx(yJ,{robot:e,selectedName:t,availableNames:n,isLoading:r,onSelect:i,onCreateNew:o,onConfigure:d,onTeleop:f,onDelete:a})},hi=_.forwardRef(({className:t,type:e,...n},r)=>h.jsx("input",{type:e,className:He("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:r,...n}));hi.displayName="Input";const mr=_.forwardRef(({value:t,onChange:e,integer:n=!0,className:r,...i},o)=>{const[a,s]=_.useState(t==null?"":String(t)),l=_.useRef(t);return _.useEffect(()=>{t!==l.current&&(l.current=t,s(t==null?"":String(t)))},[t]),h.jsx(hi,{ref:o,type:"number",inputMode:n?"numeric":"decimal",value:a,onChange:c=>{const u=c.target.value;if(s(u),u===""){e(void 0);return}const d=n?parseInt(u,10):parseFloat(u);Number.isFinite(d)&&e(d)},className:He("[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:m-0 [&::-webkit-outer-spin-button]:m-0",r),...i})});mr.displayName="NumberInput";var bJ="Label",yB=_.forwardRef((t,e)=>h.jsx(nt.label,{...t,ref:e,onMouseDown:n=>{var i;n.target.closest("button, input, select, textarea")||((i=t.onMouseDown)==null||i.call(t,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));yB.displayName=bJ;var xB=yB;const _J=Em("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Tt=_.forwardRef(({className:t,...e},n)=>h.jsx(xB,{ref:n,className:He(_J(),t),...e}));Tt.displayName=xB.displayName;function RA(t){const e=_.useRef({value:t,previous:t});return _.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var Rx="Checkbox",[wJ,EDe]=mi(Rx),[SJ,NA]=wJ(Rx);function EJ(t){const{__scopeCheckbox:e,checked:n,children:r,defaultChecked:i,disabled:o,form:a,name:s,onCheckedChange:l,required:c,value:u="on",internal_do_not_use_render:d}=t,[f,p]=$o({prop:n,defaultProp:i??!1,onChange:l,caller:Rx}),[y,v]=_.useState(null),[g,m]=_.useState(null),x=_.useRef(!1),b=y?!!a||!!y.closest("form"):!0,S={checked:f,disabled:o,setChecked:p,control:y,setControl:v,name:s,form:a,value:u,hasConsumerStoppedPropagationRef:x,required:c,defaultChecked:el(i)?!1:i,isFormControl:b,bubbleInput:g,setBubbleInput:m};return h.jsx(SJ,{scope:e,...S,children:TJ(d)?d(S):r})}var bB="CheckboxTrigger",_B=_.forwardRef(({__scopeCheckbox:t,onKeyDown:e,onClick:n,...r},i)=>{const{control:o,value:a,disabled:s,checked:l,required:c,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,isFormControl:p,bubbleInput:y}=NA(bB,t),v=Ot(i,u),g=_.useRef(l);return _.useEffect(()=>{const m=o==null?void 0:o.form;if(m){const x=()=>d(g.current);return m.addEventListener("reset",x),()=>m.removeEventListener("reset",x)}},[o,d]),h.jsx(nt.button,{type:"button",role:"checkbox","aria-checked":el(l)?"mixed":l,"aria-required":c,"data-state":MB(l),"data-disabled":s?"":void 0,disabled:s,value:a,...r,ref:v,onKeyDown:Oe(e,m=>{m.key==="Enter"&&m.preventDefault()}),onClick:Oe(n,m=>{d(x=>el(x)?!0:!x),y&&p&&(f.current=m.isPropagationStopped(),f.current||m.stopPropagation())})})});_B.displayName=bB;var OA=_.forwardRef((t,e)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:o,required:a,disabled:s,value:l,onCheckedChange:c,form:u,...d}=t;return h.jsx(EJ,{__scopeCheckbox:n,checked:i,defaultChecked:o,disabled:s,required:a,onCheckedChange:c,name:r,form:u,value:l,internal_do_not_use_render:({isFormControl:f})=>h.jsxs(h.Fragment,{children:[h.jsx(_B,{...d,ref:e,__scopeCheckbox:n}),f&&h.jsx(TB,{__scopeCheckbox:n})]})})});OA.displayName=Rx;var wB="CheckboxIndicator",SB=_.forwardRef((t,e)=>{const{__scopeCheckbox:n,forceMount:r,...i}=t,o=NA(wB,n);return h.jsx(gi,{present:r||el(o.checked)||o.checked===!0,children:h.jsx(nt.span,{"data-state":MB(o.checked),"data-disabled":o.disabled?"":void 0,...i,ref:e,style:{pointerEvents:"none",...t.style}})})});SB.displayName=wB;var EB="CheckboxBubbleInput",TB=_.forwardRef(({__scopeCheckbox:t,...e},n)=>{const{control:r,hasConsumerStoppedPropagationRef:i,checked:o,defaultChecked:a,required:s,disabled:l,name:c,value:u,form:d,bubbleInput:f,setBubbleInput:p}=NA(EB,t),y=Ot(n,p),v=RA(o),g=EA(r);_.useEffect(()=>{const x=f;if(!x)return;const b=window.HTMLInputElement.prototype,w=Object.getOwnPropertyDescriptor(b,"checked").set,E=!i.current;if(v!==o&&w){const T=new Event("click",{bubbles:E});x.indeterminate=el(o),w.call(x,el(o)?!1:o),x.dispatchEvent(T)}},[f,v,o,i]);const m=_.useRef(el(o)?!1:o);return h.jsx(nt.input,{type:"checkbox","aria-hidden":!0,defaultChecked:a??m.current,required:s,disabled:l,name:c,value:u,form:d,...e,tabIndex:-1,ref:y,style:{...e.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});TB.displayName=EB;function TJ(t){return typeof t=="function"}function el(t){return t==="indeterminate"}function MB(t){return el(t)?"indeterminate":t?"checked":"unchecked"}const IA=_.forwardRef(({className:t,...e},n)=>h.jsx(OA,{ref:n,className:He("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",t),...e,children:h.jsx(SB,{className:He("flex items-center justify-center text-current"),children:h.jsx(xl,{className:"h-4 w-4"})})}));IA.displayName=OA.displayName;var Nx="Collapsible",[MJ,TDe]=mi(Nx),[AJ,DA]=MJ(Nx),AB=_.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:a,...s}=t,[l,c]=$o({prop:r,defaultProp:i??!1,onChange:a,caller:Nx});return h.jsx(AJ,{scope:n,disabled:o,contentId:sr(),open:l,onOpenToggle:_.useCallback(()=>c(u=>!u),[c]),children:h.jsx(nt.div,{"data-state":kA(l),"data-disabled":o?"":void 0,...s,ref:e})})});AB.displayName=Nx;var CB="CollapsibleTrigger",PB=_.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,i=DA(CB,n);return h.jsx(nt.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":kA(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:e,onClick:Oe(t.onClick,i.onOpenToggle)})});PB.displayName=CB;var LA="CollapsibleContent",RB=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=DA(LA,t.__scopeCollapsible);return h.jsx(gi,{present:n||i.open,children:({present:o})=>h.jsx(CJ,{...r,ref:e,present:o})})});RB.displayName=LA;var CJ=_.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=t,a=DA(LA,n),[s,l]=_.useState(r),c=_.useRef(null),u=Ot(e,c),d=_.useRef(0),f=d.current,p=_.useRef(0),y=p.current,v=a.open||s,g=_.useRef(v),m=_.useRef(void 0);return _.useEffect(()=>{const x=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(x)},[]),ur(()=>{const x=c.current;if(x){m.current=m.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";const b=x.getBoundingClientRect();d.current=b.height,p.current=b.width,g.current||(x.style.transitionDuration=m.current.transitionDuration,x.style.animationName=m.current.animationName),l(r)}},[a.open,r]),h.jsx(nt.div,{"data-state":kA(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!v,...o,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":y?`${y}px`:void 0,...t.style},children:v&&i})});function kA(t){return t?"open":"closed"}var PJ=AB;const Ty=PJ,My=PB,Ay=RB,RJ=Em("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Mi=_.forwardRef(({className:t,variant:e,...n},r)=>h.jsx("div",{ref:r,role:"alert",className:He(RJ({variant:e}),t),...n}));Mi.displayName="Alert";const NJ=_.forwardRef(({className:t,...e},n)=>h.jsx("h5",{ref:n,className:He("mb-1 font-medium leading-none tracking-tight",t),...e}));NJ.displayName="AlertTitle";const Ai=_.forwardRef(({className:t,...e},n)=>h.jsx("div",{ref:n,className:He("text-sm [&_p]:leading-relaxed",t),...e}));Ai.displayName="AlertDescription";function CN(t,[e,n]){return Math.min(n,Math.max(e,t))}var OJ=_.createContext(void 0);function jA(t){const e=_.useContext(OJ);return t||e||"ltr"}var IJ=[" ","Enter","ArrowUp","ArrowDown"],DJ=[" ","Enter"],Pc="Select",[Ox,Ix,LJ]=rx(Pc),[wf,MDe]=mi(Pc,[LJ,El]),Dx=El(),[kJ,Ml]=wf(Pc),[jJ,UJ]=wf(Pc),NB=t=>{const{__scopeSelect:e,children:n,open:r,defaultOpen:i,onOpenChange:o,value:a,defaultValue:s,onValueChange:l,dir:c,name:u,autoComplete:d,disabled:f,required:p,form:y}=t,v=Dx(e),[g,m]=_.useState(null),[x,b]=_.useState(null),[S,w]=_.useState(!1),E=jA(c),[T,A]=$o({prop:r,defaultProp:i??!1,onChange:o,caller:Pc}),[M,C]=$o({prop:a,defaultProp:s,onChange:l,caller:Pc}),P=_.useRef(null),R=g?y||!!g.closest("form"):!0,[D,k]=_.useState(new Set),U=Array.from(D).map(O=>O.props.value).join(";");return h.jsx(gx,{...v,children:h.jsxs(kJ,{required:p,scope:e,trigger:g,onTriggerChange:m,valueNode:x,onValueNodeChange:b,valueNodeHasChildren:S,onValueNodeHasChildrenChange:w,contentId:sr(),value:M,onValueChange:C,open:T,onOpenChange:A,dir:E,triggerPointerDownPosRef:P,disabled:f,children:[h.jsx(Ox.Provider,{scope:e,children:h.jsx(jJ,{scope:t.__scopeSelect,onNativeOptionAdd:_.useCallback(O=>{k(W=>new Set(W).add(O))},[]),onNativeOptionRemove:_.useCallback(O=>{k(W=>{const L=new Set(W);return L.delete(O),L})},[]),children:n})}),R?h.jsxs(t4,{"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:d,value:M,onChange:O=>C(O.target.value),disabled:f,form:y,children:[M===void 0?h.jsx("option",{value:""}):null,Array.from(D)]},U):null]})})};NB.displayName=Pc;var OB="SelectTrigger",IB=_.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:r=!1,...i}=t,o=Dx(n),a=Ml(OB,n),s=a.disabled||r,l=Ot(e,a.onTriggerChange),c=Ix(n),u=_.useRef("touch"),[d,f,p]=r4(v=>{const g=c().filter(b=>!b.disabled),m=g.find(b=>b.value===a.value),x=i4(g,v,m);x!==void 0&&a.onValueChange(x.value)}),y=v=>{s||(a.onOpenChange(!0),p()),v&&(a.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})};return h.jsx(Cm,{asChild:!0,...o,children:h.jsx(nt.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":n4(a.value)?"":void 0,...i,ref:l,onClick:Oe(i.onClick,v=>{v.currentTarget.focus(),u.current!=="mouse"&&y(v)}),onPointerDown:Oe(i.onPointerDown,v=>{u.current=v.pointerType;const g=v.target;g.hasPointerCapture(v.pointerId)&&g.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(y(v),v.preventDefault())}),onKeyDown:Oe(i.onKeyDown,v=>{const g=d.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&f(v.key),!(g&&v.key===" ")&&IJ.includes(v.key)&&(y(),v.preventDefault())})})})});IB.displayName=OB;var DB="SelectValue",LB=_.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:a="",...s}=t,l=Ml(DB,n),{onValueNodeHasChildrenChange:c}=l,u=o!==void 0,d=Ot(e,l.onValueNodeChange);return ur(()=>{c(u)},[c,u]),h.jsx(nt.span,{...s,ref:d,style:{pointerEvents:"none"},children:n4(l.value)?h.jsx(h.Fragment,{children:a}):o})});LB.displayName=DB;var FJ="SelectIcon",kB=_.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,...i}=t;return h.jsx(nt.span,{"aria-hidden":!0,...i,ref:e,children:r||"โ–ผ"})});kB.displayName=FJ;var BJ="SelectPortal",jB=t=>h.jsx(vf,{asChild:!0,...t});jB.displayName=BJ;var Rc="SelectContent",UB=_.forwardRef((t,e)=>{const n=Ml(Rc,t.__scopeSelect),[r,i]=_.useState();if(ur(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?Bc.createPortal(h.jsx(FB,{scope:t.__scopeSelect,children:h.jsx(Ox.Slot,{scope:t.__scopeSelect,children:h.jsx("div",{children:t.children})})}),o):null}return h.jsx(BB,{...t,ref:e})});UB.displayName=Rc;var vo=10,[FB,Al]=wf(Rc),$J="SelectContentImpl",zJ=sl("SelectContent.RemoveScroll"),BB=_.forwardRef((t,e)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:a,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:y,hideWhenDetached:v,avoidCollisions:g,...m}=t,x=Ml(Rc,n),[b,S]=_.useState(null),[w,E]=_.useState(null),T=Ot(e,Q=>S(Q)),[A,M]=_.useState(null),[C,P]=_.useState(null),R=Ix(n),[D,k]=_.useState(!1),U=_.useRef(!1);_.useEffect(()=>{if(b)return cx(b)},[b]),sx();const O=_.useCallback(Q=>{const[ce,...ae]=R().map(le=>le.ref.current),[fe]=ae.slice(-1),we=document.activeElement;for(const le of Q)if(le===we||(le==null||le.scrollIntoView({block:"nearest"}),le===ce&&w&&(w.scrollTop=0),le===fe&&w&&(w.scrollTop=w.scrollHeight),le==null||le.focus(),document.activeElement!==we))return},[R,w]),W=_.useCallback(()=>O([A,b]),[O,A,b]);_.useEffect(()=>{D&&W()},[D,W]);const{onOpenChange:L,triggerPointerDownPosRef:j}=x;_.useEffect(()=>{if(b){let Q={x:0,y:0};const ce=fe=>{var we,le;Q={x:Math.abs(Math.round(fe.pageX)-(((we=j.current)==null?void 0:we.x)??0)),y:Math.abs(Math.round(fe.pageY)-(((le=j.current)==null?void 0:le.y)??0))}},ae=fe=>{Q.x<=10&&Q.y<=10?fe.preventDefault():b.contains(fe.target)||L(!1),document.removeEventListener("pointermove",ce),j.current=null};return j.current!==null&&(document.addEventListener("pointermove",ce),document.addEventListener("pointerup",ae,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ce),document.removeEventListener("pointerup",ae,{capture:!0})}}},[b,L,j]),_.useEffect(()=>{const Q=()=>L(!1);return window.addEventListener("blur",Q),window.addEventListener("resize",Q),()=>{window.removeEventListener("blur",Q),window.removeEventListener("resize",Q)}},[L]);const[X,K]=r4(Q=>{const ce=R().filter(we=>!we.disabled),ae=ce.find(we=>we.ref.current===document.activeElement),fe=i4(ce,Q,ae);fe&&setTimeout(()=>fe.ref.current.focus())}),F=_.useCallback((Q,ce,ae)=>{const fe=!U.current&&!ae;(x.value!==void 0&&x.value===ce||fe)&&(M(Q),fe&&(U.current=!0))},[x.value]),Y=_.useCallback(()=>b==null?void 0:b.focus(),[b]),q=_.useCallback((Q,ce,ae)=>{const fe=!U.current&&!ae;(x.value!==void 0&&x.value===ce||fe)&&P(Q)},[x.value]),ee=r==="popper"?SE:$B,te=ee===SE?{side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:y,hideWhenDetached:v,avoidCollisions:g}:{};return h.jsx(FB,{scope:n,content:b,viewport:w,onViewportChange:E,itemRefCallback:F,selectedItem:A,onItemLeave:Y,itemTextRefCallback:q,focusSelectedItem:W,selectedItemText:C,position:r,isPositioned:D,searchRef:X,children:h.jsx(Mm,{as:zJ,allowPinchZoom:!0,children:h.jsx(Tm,{asChild:!0,trapped:x.open,onMountAutoFocus:Q=>{Q.preventDefault()},onUnmountAutoFocus:Oe(i,Q=>{var ce;(ce=x.trigger)==null||ce.focus({preventScroll:!0}),Q.preventDefault()}),children:h.jsx(zc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:Q=>Q.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:h.jsx(ee,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:Q=>Q.preventDefault(),...m,...te,onPlaced:()=>k(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...m.style},onKeyDown:Oe(m.onKeyDown,Q=>{const ce=Q.ctrlKey||Q.altKey||Q.metaKey;if(Q.key==="Tab"&&Q.preventDefault(),!ce&&Q.key.length===1&&K(Q.key),["ArrowUp","ArrowDown","Home","End"].includes(Q.key)){let fe=R().filter(we=>!we.disabled).map(we=>we.ref.current);if(["ArrowUp","End"].includes(Q.key)&&(fe=fe.slice().reverse()),["ArrowUp","ArrowDown"].includes(Q.key)){const we=Q.target,le=fe.indexOf(we);fe=fe.slice(le+1)}setTimeout(()=>O(fe)),Q.preventDefault()}})})})})})})});BB.displayName=$J;var HJ="SelectItemAlignedPosition",$B=_.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:r,...i}=t,o=Ml(Rc,n),a=Al(Rc,n),[s,l]=_.useState(null),[c,u]=_.useState(null),d=Ot(e,T=>u(T)),f=Ix(n),p=_.useRef(!1),y=_.useRef(!0),{viewport:v,selectedItem:g,selectedItemText:m,focusSelectedItem:x}=a,b=_.useCallback(()=>{if(o.trigger&&o.valueNode&&s&&c&&v&&g&&m){const T=o.trigger.getBoundingClientRect(),A=c.getBoundingClientRect(),M=o.valueNode.getBoundingClientRect(),C=m.getBoundingClientRect();if(o.dir!=="rtl"){const we=C.left-A.left,le=M.left-we,ie=T.left-le,G=T.width+ie,Ve=Math.max(G,A.width),Ne=window.innerWidth-vo,st=CN(le,[vo,Math.max(vo,Ne-Ve)]);s.style.minWidth=G+"px",s.style.left=st+"px"}else{const we=A.right-C.right,le=window.innerWidth-M.right-we,ie=window.innerWidth-T.right-le,G=T.width+ie,Ve=Math.max(G,A.width),Ne=window.innerWidth-vo,st=CN(le,[vo,Math.max(vo,Ne-Ve)]);s.style.minWidth=G+"px",s.style.right=st+"px"}const P=f(),R=window.innerHeight-vo*2,D=v.scrollHeight,k=window.getComputedStyle(c),U=parseInt(k.borderTopWidth,10),O=parseInt(k.paddingTop,10),W=parseInt(k.borderBottomWidth,10),L=parseInt(k.paddingBottom,10),j=U+O+D+L+W,X=Math.min(g.offsetHeight*5,j),K=window.getComputedStyle(v),F=parseInt(K.paddingTop,10),Y=parseInt(K.paddingBottom,10),q=T.top+T.height/2-vo,ee=R-q,te=g.offsetHeight/2,Q=g.offsetTop+te,ce=U+O+Q,ae=j-ce;if(ce<=q){const we=P.length>0&&g===P[P.length-1].ref.current;s.style.bottom="0px";const le=c.clientHeight-v.offsetTop-v.offsetHeight,ie=Math.max(ee,te+(we?Y:0)+le+W),G=ce+ie;s.style.height=G+"px"}else{const we=P.length>0&&g===P[0].ref.current;s.style.top="0px";const ie=Math.max(q,U+v.offsetTop+(we?F:0)+te)+ae;s.style.height=ie+"px",v.scrollTop=ce-q+v.offsetTop}s.style.margin=`${vo}px 0`,s.style.minHeight=X+"px",s.style.maxHeight=R+"px",r==null||r(),requestAnimationFrame(()=>p.current=!0)}},[f,o.trigger,o.valueNode,s,c,v,g,m,o.dir,r]);ur(()=>b(),[b]);const[S,w]=_.useState();ur(()=>{c&&w(window.getComputedStyle(c).zIndex)},[c]);const E=_.useCallback(T=>{T&&y.current===!0&&(b(),x==null||x(),y.current=!1)},[b,x]);return h.jsx(GJ,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:E,children:h.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:h.jsx(nt.div,{...i,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});$B.displayName=HJ;var VJ="SelectPopperPosition",SE=_.forwardRef((t,e)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=vo,...o}=t,a=Dx(n);return h.jsx(vx,{...a,...o,ref:e,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});SE.displayName=VJ;var[GJ,UA]=wf(Rc,{}),EE="SelectViewport",zB=_.forwardRef((t,e)=>{const{__scopeSelect:n,nonce:r,...i}=t,o=Al(EE,n),a=UA(EE,n),s=Ot(e,o.onViewportChange),l=_.useRef(0);return h.jsxs(h.Fragment,{children:[h.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),h.jsx(Ox.Slot,{scope:n,children:h.jsx(nt.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Oe(i.onScroll,c=>{const u=c.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:f}=a;if(f!=null&&f.current&&d){const p=Math.abs(l.current-u.scrollTop);if(p>0){const y=window.innerHeight-vo*2,v=parseFloat(d.style.minHeight),g=parseFloat(d.style.height),m=Math.max(v,g);if(m0?S:0,d.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});zB.displayName=EE;var HB="SelectGroup",[WJ,XJ]=wf(HB),qJ=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=sr();return h.jsx(WJ,{scope:n,id:i,children:h.jsx(nt.div,{role:"group","aria-labelledby":i,...r,ref:e})})});qJ.displayName=HB;var VB="SelectLabel",GB=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=XJ(VB,n);return h.jsx(nt.div,{id:i.id,...r,ref:e})});GB.displayName=VB;var Cy="SelectItem",[KJ,WB]=wf(Cy),XB=_.forwardRef((t,e)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...a}=t,s=Ml(Cy,n),l=Al(Cy,n),c=s.value===r,[u,d]=_.useState(o??""),[f,p]=_.useState(!1),y=Ot(e,x=>{var b;return(b=l.itemRefCallback)==null?void 0:b.call(l,x,r,i)}),v=sr(),g=_.useRef("touch"),m=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return h.jsx(KJ,{scope:n,value:r,disabled:i,textId:v,isSelected:c,onItemTextChange:_.useCallback(x=>{d(b=>b||((x==null?void 0:x.textContent)??"").trim())},[]),children:h.jsx(Ox.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:h.jsx(nt.div,{role:"option","aria-labelledby":v,"data-highlighted":f?"":void 0,"aria-selected":c&&f,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...a,ref:y,onFocus:Oe(a.onFocus,()=>p(!0)),onBlur:Oe(a.onBlur,()=>p(!1)),onClick:Oe(a.onClick,()=>{g.current!=="mouse"&&m()}),onPointerUp:Oe(a.onPointerUp,()=>{g.current==="mouse"&&m()}),onPointerDown:Oe(a.onPointerDown,x=>{g.current=x.pointerType}),onPointerMove:Oe(a.onPointerMove,x=>{var b;g.current=x.pointerType,i?(b=l.onItemLeave)==null||b.call(l):g.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Oe(a.onPointerLeave,x=>{var b;x.currentTarget===document.activeElement&&((b=l.onItemLeave)==null||b.call(l))}),onKeyDown:Oe(a.onKeyDown,x=>{var S;((S=l.searchRef)==null?void 0:S.current)!==""&&x.key===" "||(DJ.includes(x.key)&&m(),x.key===" "&&x.preventDefault())})})})})});XB.displayName=Cy;var Ah="SelectItemText",qB=_.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:i,...o}=t,a=Ml(Ah,n),s=Al(Ah,n),l=WB(Ah,n),c=UJ(Ah,n),[u,d]=_.useState(null),f=Ot(e,m=>d(m),l.onItemTextChange,m=>{var x;return(x=s.itemTextRefCallback)==null?void 0:x.call(s,m,l.value,l.disabled)}),p=u==null?void 0:u.textContent,y=_.useMemo(()=>h.jsx("option",{value:l.value,disabled:l.disabled,children:p},l.value),[l.disabled,l.value,p]),{onNativeOptionAdd:v,onNativeOptionRemove:g}=c;return ur(()=>(v(y),()=>g(y)),[v,g,y]),h.jsxs(h.Fragment,{children:[h.jsx(nt.span,{id:l.textId,...o,ref:f}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Bc.createPortal(o.children,a.valueNode):null]})});qB.displayName=Ah;var KB="SelectItemIndicator",YB=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return WB(KB,n).isSelected?h.jsx(nt.span,{"aria-hidden":!0,...r,ref:e}):null});YB.displayName=KB;var TE="SelectScrollUpButton",JB=_.forwardRef((t,e)=>{const n=Al(TE,t.__scopeSelect),r=UA(TE,t.__scopeSelect),[i,o]=_.useState(!1),a=Ot(e,r.onScrollButtonChange);return ur(()=>{if(n.viewport&&n.isPositioned){let s=function(){const c=l.scrollTop>0;o(c)};const l=n.viewport;return s(),l.addEventListener("scroll",s),()=>l.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?h.jsx(QB,{...t,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop-l.offsetHeight)}}):null});JB.displayName=TE;var ME="SelectScrollDownButton",ZB=_.forwardRef((t,e)=>{const n=Al(ME,t.__scopeSelect),r=UA(ME,t.__scopeSelect),[i,o]=_.useState(!1),a=Ot(e,r.onScrollButtonChange);return ur(()=>{if(n.viewport&&n.isPositioned){let s=function(){const c=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)l.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?h.jsx(QB,{...t,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop+l.offsetHeight)}}):null});ZB.displayName=ME;var QB=_.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=t,o=Al("SelectScrollButton",n),a=_.useRef(null),s=Ix(n),l=_.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return _.useEffect(()=>()=>l(),[l]),ur(()=>{var u;const c=s().find(d=>d.ref.current===document.activeElement);(u=c==null?void 0:c.ref.current)==null||u.scrollIntoView({block:"nearest"})},[s]),h.jsx(nt.div,{"aria-hidden":!0,...i,ref:e,style:{flexShrink:0,...i.style},onPointerDown:Oe(i.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:Oe(i.onPointerMove,()=>{var c;(c=o.onItemLeave)==null||c.call(o),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:Oe(i.onPointerLeave,()=>{l()})})}),YJ="SelectSeparator",e4=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return h.jsx(nt.div,{"aria-hidden":!0,...r,ref:e})});e4.displayName=YJ;var AE="SelectArrow",JJ=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=Dx(n),o=Ml(AE,n),a=Al(AE,n);return o.open&&a.position==="popper"?h.jsx(yx,{...i,...r,ref:e}):null});JJ.displayName=AE;var ZJ="SelectBubbleInput",t4=_.forwardRef(({__scopeSelect:t,value:e,...n},r)=>{const i=_.useRef(null),o=Ot(r,i),a=RA(e);return _.useEffect(()=>{const s=i.current;if(!s)return;const l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==e&&u){const d=new Event("change",{bubbles:!0});u.call(s,e),s.dispatchEvent(d)}},[a,e]),h.jsx(nt.select,{...n,style:{...pU,...n.style},ref:o,defaultValue:e})});t4.displayName=ZJ;function n4(t){return t===""||t===void 0}function r4(t){const e=di(t),n=_.useRef(""),r=_.useRef(0),i=_.useCallback(a=>{const s=n.current+a;e(s),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(s)},[e]),o=_.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return _.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function i4(t,e,n){const i=e.length>1&&Array.from(e).every(c=>c===e[0])?e[0]:e,o=n?t.indexOf(n):-1;let a=QJ(t,Math.max(o,0));i.length===1&&(a=a.filter(c=>c!==n));const l=a.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function QJ(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var eZ=NB,o4=IB,tZ=LB,nZ=kB,rZ=jB,a4=UB,iZ=zB,s4=GB,l4=XB,oZ=qB,aZ=YB,c4=JB,u4=ZB,d4=e4;const Ga=eZ,Wa=tZ,sa=_.forwardRef(({className:t,children:e,...n},r)=>h.jsxs(o4,{ref:r,className:He("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...n,children:[e,h.jsx(nZ,{asChild:!0,children:h.jsx(hc,{className:"h-4 w-4 text-slate-400"})})]}));sa.displayName=o4.displayName;const f4=_.forwardRef(({className:t,...e},n)=>h.jsx(c4,{ref:n,className:He("flex cursor-default items-center justify-center py-1",t),...e,children:h.jsx(X7,{className:"h-4 w-4"})}));f4.displayName=c4.displayName;const h4=_.forwardRef(({className:t,...e},n)=>h.jsx(u4,{ref:n,className:He("flex cursor-default items-center justify-center py-1",t),...e,children:h.jsx(hc,{className:"h-4 w-4"})}));h4.displayName=u4.displayName;const la=_.forwardRef(({className:t,children:e,position:n="popper",...r},i)=>h.jsx(rZ,{children:h.jsxs(a4,{ref:i,className:He("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:n,...r,children:[h.jsx(f4,{}),h.jsx(iZ,{className:He("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),h.jsx(h4,{})]})}));la.displayName=a4.displayName;const sZ=_.forwardRef(({className:t,...e},n)=>h.jsx(s4,{ref:n,className:He("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...e}));sZ.displayName=s4.displayName;const $n=_.forwardRef(({className:t,children:e,...n},r)=>h.jsxs(l4,{ref:r,className:He("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[h.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:h.jsx(aZ,{children:h.jsx(xl,{className:"h-4 w-4"})})}),h.jsx(oZ,{children:e})]}));$n.displayName=l4.displayName;const lZ=_.forwardRef(({className:t,...e},n)=>h.jsx(d4,{ref:n,className:He("-mx-1 my-1 h-px bg-muted",t),...e}));lZ.displayName=d4.displayName;const th=t=>t.toLowerCase().replace(/\s+/g," ").trim();function p4({enabled:t=!0}={}){const{baseUrl:e,fetchWithHeaders:n}=Dn(),[r,i]=_.useState([]),[o,a]=_.useState(!1),s=_.useCallback(async()=>{a(!0);try{try{(await navigator.mediaDevices.getUserMedia({video:!0})).getTracks().forEach(v=>v.stop())}catch{}const l=(await navigator.mediaDevices.enumerateDevices()).filter(y=>y.kind==="videoinput").map(y=>({deviceId:y.deviceId,label:y.label})),c=await n(`${e}/available-cameras`);if(!c.ok)return i([]),[];const d=(await c.json()).cameras??[],f=new Set,p=d.map(y=>{const v=y.name||`Camera ${y.index}`,g=th(v),m=l.filter(b=>!f.has(b.deviceId)&&b.label),x=m.find(b=>th(b.label)===g)||m.find(b=>th(b.label).startsWith(g))||m.find(b=>th(b.label).includes(g)||g.includes(th(b.label)));return x&&f.add(x.deviceId),{index:y.index,name:v,deviceId:(x==null?void 0:x.deviceId)??"",available:y.available}});return i(p),p}catch{return i([]),[]}finally{a(!1)}},[e,n]);return _.useEffect(()=>{if(!t)return;s();const l=()=>s();return navigator.mediaDevices.addEventListener("devicechange",l),()=>navigator.mediaDevices.removeEventListener("devicechange",l)},[t,s]),{cameras:r,isLoading:o,refresh:s}}function m4(t,e){const n=_.useRef(null),[r,i]=_.useState(!1);return _.useEffect(()=>{if(e||!t){t||i(!0);return}let o=!1,a=null;return i(!1),(async()=>{try{if(a=await navigator.mediaDevices.getUserMedia({video:{deviceId:{exact:t}}}),o){a.getTracks().forEach(s=>s.stop());return}n.current&&(n.current.srcObject=a,await n.current.play().catch(()=>{}))}catch{i(!0)}})(),()=>{o=!0,a&&a.getTracks().forEach(s=>s.stop())}},[t,e]),{videoRef:n,hasError:r}}const g4=({cameras:t,onCamerasChange:e,releaseStreamsRef:n})=>{const{toast:r}=Dr(),{cameras:i,isLoading:o}=p4(),[a,s]=_.useState(""),[l,c]=_.useState("");_.useEffect(()=>{if(i.length===0||t.length===0)return;let g=!1;const m=t.map(x=>{if(!x.device_id)return x;const b=i.find(S=>S.deviceId===x.device_id);return b&&b.index!==x.camera_index?(g=!0,{...x,camera_index:b.index}):x});g&&e(m)},[i]);const u=()=>{if(!a||!l.trim()){r({title:"Missing Information",description:"Please select a camera and provide a name.",variant:"destructive"});return}const g=parseInt(a),m=i.find(S=>S.index===g);if(!m){r({title:"Invalid Camera",description:"Selected camera is not available.",variant:"destructive"});return}if(t.some(S=>S.camera_index===m.index||m.deviceId&&S.device_id===m.deviceId)){r({title:"Camera Already Added",description:"This camera is already in the configuration.",variant:"destructive"});return}const b={id:`camera_${Date.now()}`,name:l.trim(),type:"opencv",camera_index:m.index,device_id:m.deviceId,width:640,height:480,fps:30};e([...t,b]),s(""),c(""),r({title:"Camera Added",description:`${b.name} has been added to the configuration.`})},d=g=>{e(t.filter(m=>m.id!==g)),r({title:"Camera Removed",description:"Camera has been removed from the configuration."})},f=(g,m)=>{e(t.map(x=>x.id===g?{...x,...m}:x))},[p,y]=_.useState(!1),v=_.useCallback(()=>{y(!0)},[]);return _.useEffect(()=>{n&&(n.current=v)},[n,v]),h.jsxs("div",{className:"space-y-4",children:[h.jsx("h3",{className:"text-lg font-semibold text-white border-b border-gray-700 pb-2",children:"Camera Configuration"}),h.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-4 space-y-4",children:[h.jsx("h4",{className:"text-md font-medium text-gray-300",children:"Add Camera"}),h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(Tt,{className:"text-sm font-medium text-gray-300",children:"Available Cameras"}),h.jsxs(Ga,{value:a,onValueChange:s,disabled:o,children:[h.jsx(sa,{className:"bg-gray-800 border-gray-700 text-white",children:h.jsx(Wa,{placeholder:o?"Loading cameras...":"Select camera"})}),h.jsx(la,{className:"bg-gray-800 border-gray-700",children:i.map(g=>{const m=t.some(x=>x.camera_index===g.index||g.deviceId&&x.device_id===g.deviceId);return h.jsx($n,{value:g.index.toString(),className:"text-white hover:bg-gray-700",disabled:!g.available||m,children:h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{className:"font-medium",children:g.name}),h.jsxs("span",{className:"text-xs text-gray-400",children:["Index ",g.index,m&&" ยท already added"]})]})},g.index)})})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(Tt,{className:"text-sm font-medium text-gray-300",children:"Camera Name"}),h.jsx(hi,{value:l,onChange:g=>c(g.target.value),placeholder:"e.g., workspace_cam",className:"bg-gray-800 border-gray-700 text-white"})]}),h.jsx("div",{className:"space-y-2 flex flex-col justify-end",children:h.jsxs(et,{onClick:u,className:"bg-blue-500 hover:bg-blue-600 text-white",disabled:!a||!l.trim(),children:[h.jsx(iA,{className:"w-4 h-4 mr-2"}),"Add Camera"]})})]})]}),t.length>0&&h.jsxs("div",{className:"space-y-4",children:[h.jsxs("h4",{className:"text-md font-medium text-gray-300",children:["Configured Cameras (",t.length,")"]}),h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-2 gap-4",children:t.map(g=>h.jsx(cZ,{camera:g,paused:p,onRemove:()=>d(g.id),onUpdate:m=>f(g.id,m)},g.id))})]}),t.length===0&&h.jsxs("div",{className:"text-center py-8 text-gray-500",children:[h.jsx(W7,{className:"w-12 h-12 mx-auto mb-4 text-gray-600"}),h.jsx("p",{children:"No cameras configured. Add a camera to get started."})]})]})},cZ=({camera:t,paused:e,onRemove:n,onUpdate:r})=>{var s;const{videoRef:i,hasError:o}=m4(t.device_id,e),a=!e&&t.device_id&&!o;return h.jsxs("div",{className:"bg-gray-900 rounded-lg border border-gray-700 overflow-hidden",children:[h.jsx("div",{className:"aspect-[4/3] bg-gray-800 relative",children:a?h.jsx("video",{ref:i,autoPlay:!0,muted:!0,playsInline:!0,className:"w-full h-full object-cover"}):h.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center",children:[h.jsx(UU,{className:"w-8 h-8 text-gray-500 mb-2"}),h.jsx("span",{className:"text-gray-500 text-sm",children:e?"Preview paused":t.device_id?"Preview failed":"No browser match"})]})}),h.jsxs("div",{className:"p-3 space-y-2",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("h5",{className:"font-medium text-white truncate",children:t.name}),h.jsx(et,{onClick:n,size:"sm",variant:"ghost",className:"text-red-400 hover:text-red-300 hover:bg-red-900/20 p-1",children:h.jsx(ax,{className:"w-4 h-4"})})]}),h.jsxs("div",{className:"grid grid-cols-1 gap-2 text-xs text-gray-400",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"w-16",children:"Resolution:"}),h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx(mr,{value:t.width,onChange:l=>{l!==void 0&&r({width:l})},className:"bg-gray-800 border-gray-700 text-white text-xs h-6 px-2 w-16",min:"320",max:"1920"}),h.jsx("span",{className:"flex items-center",children:"ร—"}),h.jsx(mr,{value:t.height,onChange:l=>{l!==void 0&&r({height:l})},className:"bg-gray-800 border-gray-700 text-white text-xs h-6 px-2 w-16",min:"240",max:"1080"})]})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"w-16",children:"FPS:"}),h.jsx(mr,{value:t.fps??30,onChange:l=>{l!==void 0&&r({fps:l})},className:"bg-gray-800 border-gray-700 text-white text-xs h-6 px-2 w-16",min:"10",max:"60"})]})]}),h.jsxs("div",{className:"text-xs text-gray-500",children:["Type: ",t.type," | Device: ",(s=t.device_id)==null?void 0:s.substring(0,10),"..."]})]})]})},uZ=({open:t,onOpenChange:e,robot:n,datasetName:r,setDatasetName:i,singleTask:o,setSingleTask:a,numEpisodes:s,setNumEpisodes:l,episodeTimeS:c,setEpisodeTimeS:u,resetTimeS:d,setResetTimeS:f,streamingEncoding:p,setStreamingEncoding:y,cameras:v,setCameras:g,onStart:m,releaseStreamsRef:x})=>{const{auth:b}=xf(),S=!!n&&n.is_clean;return h.jsx(Hc,{open:t,onOpenChange:e,children:h.jsxs(bl,{className:"bg-gray-900 border-gray-800 text-white sm:max-w-[600px] p-8 max-h-[90vh] overflow-y-auto",children:[h.jsxs(_l,{children:[h.jsx("div",{className:"flex justify-center items-center mb-4",children:h.jsx("div",{className:"w-8 h-8 bg-red-500 rounded-full flex items-center justify-center",children:h.jsx("span",{className:"text-white font-bold text-sm",children:"REC"})})}),h.jsx(wl,{className:"text-white text-center text-2xl font-bold",children:"Configure Recording"})]}),h.jsxs("div",{className:"space-y-6 py-4",children:[h.jsx(Sl,{className:"text-gray-400 text-base leading-relaxed text-center",children:"Pick a configured robot and dataset parameters for recording."}),h.jsxs("div",{className:"grid grid-cols-1 gap-6",children:[h.jsxs("div",{className:"space-y-4",children:[h.jsx("h3",{className:"text-lg font-semibold text-white border-b border-gray-700 pb-2",children:"Robot Configuration"}),n?n.is_clean?h.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[h.jsx(qi,{className:"w-4 h-4 text-green-400"}),h.jsxs("span",{className:"text-slate-200",children:["Recording with ",h.jsx("strong",{children:n.name})]})]}):h.jsxs(Mi,{className:"bg-amber-900/40 border-amber-700 text-amber-100",children:[h.jsx(oa,{className:"h-4 w-4"}),h.jsxs(Ai,{children:[h.jsx("strong",{children:n.name})," is missing a calibration. Configure it before recording."]})]}):h.jsxs(Mi,{className:"bg-amber-900/40 border-amber-700 text-amber-100",children:[h.jsx(oa,{className:"h-4 w-4"}),h.jsx(Ai,{children:"Select and configure a robot on the Landing page before recording."})]})]}),h.jsxs("div",{className:"space-y-4",children:[h.jsx("h3",{className:"text-lg font-semibold text-white border-b border-gray-700 pb-2",children:"Dataset Configuration"}),h.jsxs("div",{className:"grid grid-cols-1 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(Tt,{htmlFor:"datasetName",className:"text-sm font-medium text-gray-300",children:"Dataset Name *"}),h.jsx(hi,{id:"datasetName",value:r,onChange:w=>i(w.target.value.replace(/[^A-Za-z0-9._-]/g,"_")),placeholder:"my_dataset",className:"bg-gray-800 border-gray-700 text-white"}),h.jsxs("p",{className:"text-xs text-gray-500",children:["Letters, numbers, ",h.jsx("code",{children:"."})," ",h.jsx("code",{children:"_"})," ",h.jsx("code",{children:"-"})," only โ€” other characters become"," ",h.jsx("code",{children:"_"}),"."]}),r&&(b.status==="authenticated"?h.jsxs("p",{className:"text-xs text-gray-500",children:["Will be saved as"," ",h.jsxs("span",{className:"text-gray-300 font-mono",children:[b.username,"/",r]})]}):b.status==="unauthenticated"?h.jsx("p",{className:"text-xs text-amber-400/80",children:"Log in to Hugging Face to set the repository owner."}):null)]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(Tt,{htmlFor:"singleTask",className:"text-sm font-medium text-gray-300",children:"Task Description *"}),h.jsx(hi,{id:"singleTask",value:o,onChange:w=>a(w.target.value),placeholder:"e.g., pick up the red block and place it on the blue square",className:"bg-gray-800 border-gray-700 text-white"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(Tt,{htmlFor:"numEpisodes",className:"text-sm font-medium text-gray-300",children:"Number of Episodes"}),h.jsx(mr,{id:"numEpisodes",min:"1",max:"100",value:s,onChange:w=>{w!==void 0&&l(w)},className:"bg-gray-800 border-gray-700 text-white"})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(Tt,{htmlFor:"episodeTimeS",className:"text-sm font-medium text-gray-300",children:"Episode duration (seconds)"}),h.jsx(mr,{id:"episodeTimeS",min:"1",value:c,onChange:w=>{w!==void 0&&u(w)},className:"bg-gray-800 border-gray-700 text-white"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(Tt,{htmlFor:"resetTimeS",className:"text-sm font-medium text-gray-300",children:"Reset duration (seconds)"}),h.jsx(mr,{id:"resetTimeS",min:"1",value:d,onChange:w=>{w!==void 0&&f(w)},className:"bg-gray-800 border-gray-700 text-white"})]})]})]})]}),h.jsx("div",{className:"space-y-4",children:h.jsx(g4,{cameras:v,onCamerasChange:g,releaseStreamsRef:x})}),h.jsxs(Ty,{className:"space-y-4 group",children:[h.jsxs(My,{className:"flex items-center justify-between w-full text-lg font-semibold text-white border-b border-gray-700 pb-2",children:[h.jsx("span",{children:"Advanced Parameters"}),h.jsx(hc,{className:"w-4 h-4 transition-transform group-data-[state=open]:rotate-180"})]}),h.jsx(Ay,{className:"space-y-3",children:h.jsxs("div",{className:"flex items-start gap-3",children:[h.jsx(IA,{id:"streamingEncoding",checked:p,onCheckedChange:w=>y(w===!0),className:"mt-0.5 border-gray-500 data-[state=checked]:bg-red-500 data-[state=checked]:border-red-500"}),h.jsxs("div",{className:"space-y-1",children:[h.jsx(Tt,{htmlFor:"streamingEncoding",className:"text-sm font-medium text-gray-200 cursor-pointer",children:"Streaming video encoding"}),h.jsx("p",{className:"text-xs text-gray-500",children:"Encodes frames in real time during capture so each episode saves almost instantly. Uncheck to fall back to the slower PNG-then-encode flow."})]})]})})]})]}),h.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center pt-4",children:[h.jsx(et,{onClick:m,disabled:!S,className:"w-full sm:w-auto bg-red-500 hover:bg-red-600 text-white px-10 py-6 text-lg transition-all shadow-md shadow-red-500/30 hover:shadow-lg hover:shadow-red-500/40 disabled:opacity-40 disabled:cursor-not-allowed",children:"Start Recording"}),h.jsx(et,{onClick:()=>e(!1),variant:"outline",className:"w-full sm:w-auto border-gray-500 hover:border-gray-200 px-10 py-6 text-lg text-zinc-500 bg-zinc-900 hover:bg-zinc-800",children:"Cancel"})]})]})]})})},dZ=/^[\w.\-]+\/[\w.\-]+$/,fZ=/^[A-Za-z0-9._-]+$/,hZ=({datasets:t,loading:e,onPickExisting:n,onCreateNew:r,onOpenCustom:i,children:o})=>{const[a,s]=_.useState(!1),[l,c]=_.useState(""),u=l.trim(),d=t.some(C=>C.repo_id.toLowerCase()===u.toLowerCase()),f=dZ.test(u),p=fZ.test(u)&&!u.includes("/"),y=u.length>0&&p&&!d,v=f&&!d,g=d||u!==""&&!y,m=d?"Already exists":u===""?"Create new datasetโ€ฆ":y?`Create "${u}"`:'Use a name without "/"',x=()=>{g||(r(u),w())},b=t.filter(C=>C.source==="local"||C.source==="both"),S=t.filter(C=>C.source==="hub"),w=()=>{c(""),s(!1)},E=C=>{n(C),w()},T=()=>{y&&(r(u),w())},A=()=>{v&&(i(u),w())},M=C=>h.jsxs(kd,{value:C.repo_id,onSelect:()=>E(C),className:"text-white aria-selected:bg-gray-700",children:[h.jsx("span",{className:"flex-1 truncate",children:C.repo_id}),C.source==="both"&&h.jsx("span",{className:"text-xs text-gray-400 mr-2",children:"on Hub"}),C.private&&h.jsx("span",{className:"text-xs text-amber-400",children:"private"})]},C.repo_id);return h.jsxs(Sx,{open:a,onOpenChange:s,children:[h.jsx(Ex,{asChild:!0,children:o}),h.jsx(Rm,{className:"w-[320px] p-0 bg-gray-800 border-gray-700 text-white",align:"end",children:h.jsxs(Mx,{className:"bg-gray-800",children:[h.jsx(Ax,{placeholder:"Search, type a new name, or org/nameโ€ฆ",value:l,onValueChange:C=>c(C.replace(/[^A-Za-z0-9._\-/]/g,"_")),onKeyDown:C=>{C.key==="Enter"&&(y?(C.preventDefault(),T()):v&&(C.preventDefault(),A()))},className:"text-white"}),h.jsxs(Cx,{children:[t.length===0&&!y&&!v&&h.jsx(Px,{className:"py-4 text-sm text-gray-400 text-center",children:e?"Loading datasetsโ€ฆ":"No datasets yet. Type a name to create one."}),b.length>0&&h.jsx(Qs,{heading:"Local",children:b.map(M)}),S.length>0&&h.jsx(Qs,{heading:"Hugging Face",children:S.map(M)}),v&&h.jsx(Qs,{heading:"Custom repo",children:h.jsxs(kd,{value:`__open__${u}`,onSelect:A,className:"text-white aria-selected:bg-gray-700",children:[h.jsx(cl,{className:"mr-2 h-4 w-4"}),'Open "',u,'" in viewer']})})]}),h.jsxs("button",{type:"button",onClick:x,disabled:g,className:"flex w-full items-center gap-2 border-t border-gray-700 px-3 py-2 text-sm text-white hover:bg-gray-700 disabled:cursor-not-allowed disabled:text-gray-500 disabled:hover:bg-transparent",children:[h.jsx(iA,{className:"h-4 w-4"}),m]})]})})]})},pZ=(t,e)=>{const{wsBaseUrl:n}=Dn(),r=_.useRef(t);r.current=t;const i=_.useRef(e);i.current=e,_.useEffect(()=>{let o=!1,a=null,s=null;const l=()=>{if(!o){try{a=new WebSocket(`${n}/ws/joint-data`)}catch{s=setTimeout(l,3e3);return}a.onmessage=c=>{try{const u=JSON.parse(c.data);(u==null?void 0:u.type)==="jobs_changed"?r.current():(u==null?void 0:u.type)==="job_progress"&&i.current&&Array.isArray(u==null?void 0:u.jobs)&&i.current(u.jobs)}catch{}},a.onclose=()=>{o||(s=setTimeout(l,3e3))}}};return l(),()=>{o=!0,s&&clearTimeout(s),a&&a.close()}},[n])};class Lx extends Error{constructor(n,r,i){super(n);Jb(this,"status");Jb(this,"detail");this.name="ApiError",this.status=r,this.detail=i}}async function er(t,e,n,{method:r="GET",body:i,signal:o,action:a}={}){const s={method:r,signal:o};i!==void 0&&(s.body=JSON.stringify(i));const l=`${t}${n}`,c=await e(l,s);if(!c.ok){let u=null;try{const f=await c.json();u=(f==null?void 0:f.detail)??(f==null?void 0:f.message)??null}catch{}const d=a||`${r} ${n}`;throw new Lx(`${d} failed: ${u??c.status}`,c.status,u)}if(c.status!==204)return c.json()}async function CE(t,e,n=10,r){return(await er(t,e,`/jobs?limit=${n}`,{signal:r,action:"List jobs"})).jobs}async function mZ(t,e,n,r){return er(t,e,`/jobs/${n}`,{signal:r,action:"Get job"})}async function gZ(t,e,n,r){return(await er(t,e,`/jobs/${n}/logs`,{signal:r,action:"Get job logs"})).logs}async function vZ(t,e,n,r){return(await er(t,e,`/jobs/${n}/log-file`,{signal:r,action:"Get job log file"})).logs}async function yZ(t,e,n,r){return(await er(t,e,`/jobs/${n}/metrics-history`,{signal:r,action:"Get job metrics history"})).points}async function xZ(t,e,n){const{target:r,...i}=n,o=r?{config:i,target:r}:i;try{return await er(t,e,"/jobs/training",{method:"POST",body:o,action:"Start training"})}catch(a){throw a instanceof Lx&&a.status===409?new Error("Another training is already running. Stop it first."):a}}async function v4(t,e,n){return er(t,e,`/jobs/${n}/stop`,{method:"POST",action:"Stop job"})}async function bZ(t,e,n,r){return er(t,e,`/jobs/providers/${encodeURIComponent(n)}/jobs/${encodeURIComponent(r)}/attach`,{method:"POST",action:"Attach provider job"})}async function y4(t,e,n){await er(t,e,`/jobs/${n}`,{method:"DELETE",action:"Delete job"})}const _Z={authenticated:!1,username:null,flavors:[],providers:[]};async function PN(t,e,n){try{const r=await er(t,e,"/jobs/runners/hardware",{signal:n,action:"List runner hardware"});return{authenticated:!!r.authenticated,username:r.username??null,flavors:Array.isArray(r.flavors)?r.flavors:[],providers:Array.isArray(r.providers)?r.providers.map(i=>({...i,flavors:Array.isArray(i.flavors)?i.flavors:[]})):[]}}catch(r){if(r instanceof Lx)return _Z;throw r}}async function wZ(t,e,n){return er(t,e,"/compute/seeed-cloud/config",{signal:n,action:"Get Seeed Cloud config"})}async function SZ(t,e,n){return er(t,e,"/compute/seeed-cloud/config",{method:"POST",body:n,action:"Save Seeed Cloud config"})}const EZ={authenticated:!1,jobs:[],models:[]};async function TZ(t,e,n){try{return await er(t,e,"/jobs/hub",{signal:n,action:"List hub jobs"})}catch(r){if(r instanceof Lx)return EZ;throw r}}const Gr=_.forwardRef(({className:t,...e},n)=>h.jsx("div",{ref:n,className:He("rounded-lg border bg-card text-card-foreground shadow-sm",t),...e}));Gr.displayName="Card";const jo=_.forwardRef(({className:t,...e},n)=>h.jsx("div",{ref:n,className:He("flex flex-col space-y-1.5 p-6",t),...e}));jo.displayName="CardHeader";const ga=_.forwardRef(({className:t,...e},n)=>h.jsx("h3",{ref:n,className:He("text-2xl font-semibold leading-none tracking-tight",t),...e}));ga.displayName="CardTitle";const MZ=_.forwardRef(({className:t,...e},n)=>h.jsx("p",{ref:n,className:He("text-sm text-muted-foreground",t),...e}));MZ.displayName="CardDescription";const Wr=_.forwardRef(({className:t,...e},n)=>h.jsx("div",{ref:n,className:He("p-6 pt-0",t),...e}));Wr.displayName="CardContent";const AZ=_.forwardRef(({className:t,...e},n)=>h.jsx("div",{ref:n,className:He("flex items-center p-6 pt-0",t),...e}));AZ.displayName="CardFooter";async function FA(t,e,n,r){return(await er(t,e,`/jobs/${n}/checkpoints`,{signal:r,action:"List checkpoints"})).checkpoints}async function CZ(t,e,n,r,i){return er(t,e,`/jobs/${n}/checkpoints/${r}/policy-config`,{signal:i,action:"Load policy config"})}const BA=({checkpoints:t,selectedStep:e,onChange:n,disabled:r,placeholder:i="Select checkpoint"})=>{const o=e!=null?String(e):void 0;return h.jsxs(Ga,{value:o,onValueChange:a=>n(Number(a)),disabled:r||t.length===0,children:[h.jsx(sa,{className:"bg-slate-800 border-slate-700 text-white h-8 text-xs px-2 w-auto min-w-[110px]",onClick:a=>a.stopPropagation(),children:h.jsx(Wa,{placeholder:i})}),h.jsx(la,{className:"bg-slate-900 border-slate-700 text-white",children:t.map(a=>h.jsxs($n,{value:String(a.step),onClick:s=>s.stopPropagation(),children:["step ",a.step]},a.step))})]})};function RN(t){const e=Math.max(0,Date.now()/1e3-t);return e<60?`${Math.floor(e)}s ago`:e<3600?`${Math.floor(e/60)}m ago`:e<86400?`${Math.floor(e/3600)}h ago`:`${Math.floor(e/86400)}d ago`}const PZ={running:{label:"Running",color:"text-green-400",Icon:fi},done:{label:"Done",color:"text-slate-400",Icon:nA},failed:{label:"Failed",color:"text-red-400",Icon:nd},interrupted:{label:"Interrupted",color:"text-amber-400",Icon:oa}},Mg=({job:t,onStop:e,onDelete:n,onPlay:r})=>{const i=ji(),{baseUrl:o,fetchWithHeaders:a}=Dn(),s=PZ[t.state],l=s.Icon,c=t.state==="running",u=c&&t.metrics.total_steps===0,d=t.metrics.total_steps>0?Math.min(100,t.metrics.current_step/t.metrics.total_steps*100):0,f=u?"startingโ€ฆ":c?`started ${RN(t.started_at)}`:t.ended_at!=null?`ended ${RN(t.ended_at)}`:s.label.toLowerCase(),[p,y]=_.useState([]),[v,g]=_.useState(null);_.useEffect(()=>{if(t.checkpoint_count<=0){y([]),g(null);return}let w=!1;return FA(o,a,t.id).then(E=>{if(!w)if(y(E),E.length>0){const T=E[E.length-1].step;g(A=>A!=null&&E.some(M=>M.step===A)?A:T)}else g(null)}).catch(()=>{w||(y([]),g(null))}),()=>{w=!0}},[o,a,t.id,t.checkpoint_count]);const m=w=>{w.stopPropagation(),c?window.confirm("Stop this run?")&&e(t.id):window.confirm("Delete this run? This wipes the output directory.")&&n(t.id)},x=w=>{w.stopPropagation(),v!=null&&r(t,v)},b=c,S=p.length>0&&v!=null;return h.jsx(Gr,{onClick:()=>i(`/training/${t.id}`),className:"bg-slate-800/50 border-slate-700 rounded-xl cursor-pointer hover:border-slate-500 transition-colors",children:h.jsxs(Wr,{className:"p-4 space-y-3",children:[h.jsxs("div",{className:"flex items-start justify-between gap-2",children:[h.jsxs("div",{className:`flex items-center gap-1.5 text-xs font-semibold ${s.color}`,children:[h.jsx(l,{className:`w-3.5 h-3.5 ${c?"animate-spin":""}`}),s.label]}),t.runner==="hf_cloud"&&t.hf_job_url?h.jsx(et,{variant:"ghost",size:"icon",asChild:!0,className:"h-7 w-7 text-slate-400 hover:text-white","aria-label":"Open Hub job page",children:h.jsx("a",{href:t.hf_job_url,target:"_blank",rel:"noopener noreferrer",onClick:w=>w.stopPropagation(),children:h.jsx(cl,{className:"w-3.5 h-3.5"})})}):h.jsx(et,{variant:"ghost",size:"icon",onClick:m,className:"h-7 w-7 text-slate-400 hover:text-white","aria-label":c?"Stop job":"Delete job",children:c?h.jsx(Od,{className:"w-3.5 h-3.5"}):h.jsx(ax,{className:"w-3.5 h-3.5"})})]}),h.jsxs("div",{children:[h.jsx("div",{className:"text-white font-semibold truncate",title:t.name,children:t.name}),h.jsx("div",{className:"text-xs text-slate-400",children:f})]}),b?h.jsxs("div",{className:"relative h-5 w-full overflow-hidden rounded-md bg-slate-900 border border-slate-700",children:[h.jsx("div",{className:"h-full bg-gradient-to-r from-blue-500 to-sky-400 transition-[width] duration-500",style:{width:`${d}%`}}),h.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-xs font-semibold text-white tabular-nums drop-shadow",children:u?"Training startingโ€ฆ":`${d.toFixed(1)}%`})]}):null,S?h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(BA,{checkpoints:p,selectedStep:v,onChange:g}),h.jsx(et,{size:"icon",onClick:x,className:"h-8 w-8 bg-green-500 hover:bg-green-600 text-white","aria-label":"Run inference with this checkpoint",children:h.jsx(Tc,{className:"w-4 h-4"})})]}):null]})})};function RZ(t){if(!t)return"โ€”";const e=Date.parse(t);if(Number.isNaN(e))return"โ€”";const n=Math.max(0,(Date.now()-e)/1e3);return n<60?`${Math.floor(n)}s ago`:n<3600?`${Math.floor(n/60)}m ago`:n<86400?`${Math.floor(n/3600)}h ago`:`${Math.floor(n/86400)}d ago`}const NZ={RUNNING:{label:"Running",color:"text-green-400",Icon:fi,spin:!0},QUEUED:{label:"Queued",color:"text-amber-400",Icon:hE},SCHEDULING:{label:"Scheduling",color:"text-amber-400",Icon:hE},COMPLETED:{label:"Done",color:"text-slate-400",Icon:nA},FAILED:{label:"Failed",color:"text-red-400",Icon:nd},CANCELED:{label:"Cancelled",color:"text-amber-400",Icon:oa},CANCELLED:{label:"Cancelled",color:"text-amber-400",Icon:oa}},NN=({job:t,onOpen:e,busy:n=!1})=>{var c,u,d;const r=((u=(c=t.status)==null?void 0:c.stage)==null?void 0:u.toUpperCase())??"",i=NZ[r]??{label:r||"Unknown",color:"text-slate-400",Icon:q7},o=i.Icon,a=t.docker_image??t.space_id??`Job ${t.id.slice(0,12)}โ€ฆ`,s=!!t.url,l=!!(e||s);return h.jsx(Gr,{onClick:()=>{if(!n){if(e){e(t);return}s&&window.open(t.url,"_blank","noopener,noreferrer")}},className:`bg-slate-800/50 border-slate-700 rounded-xl hover:border-slate-500 transition-colors ${l?"cursor-pointer":""}`,children:h.jsxs(Wr,{className:"p-4 space-y-3",children:[h.jsxs("div",{className:"flex items-start justify-between gap-2",children:[h.jsxs("div",{className:`flex items-center gap-1.5 text-xs font-semibold ${i.color}`,children:[h.jsx(o,{className:`w-3.5 h-3.5 ${i.spin||n?"animate-spin":""}`}),i.label]}),s?h.jsx(et,{variant:"ghost",size:"icon",asChild:!0,className:"h-7 w-7 text-slate-400 hover:text-white","aria-label":"View provider job",children:h.jsx("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",onClick:f=>f.stopPropagation(),children:h.jsx(cl,{className:"w-3.5 h-3.5"})})}):null]}),h.jsxs("div",{children:[h.jsx("div",{className:"text-white font-semibold truncate",title:a,children:a}),h.jsxs("div",{className:"text-xs text-slate-400 truncate",children:[t.flavor??"โ€”"," ยท ",RZ(t.created_at),t.owner?` ยท ${t.owner}`:""]})]}),(d=t.status)!=null&&d.message?h.jsx("div",{className:"text-xs text-slate-500 truncate",title:t.status.message,children:t.status.message}):null]})})};function OZ(t){if(!t)return"โ€”";const e=Date.parse(t);if(Number.isNaN(e))return"โ€”";const n=Math.max(0,(Date.now()-e)/1e3);return n<60?`${Math.floor(n)}s ago`:n<3600?`${Math.floor(n/60)}m ago`:n<86400?`${Math.floor(n/3600)}h ago`:`${Math.floor(n/86400)}d ago`}const IZ=({model:t})=>{const e=`https://huggingface.co/${t.repo_id}`,n=t.repo_id.includes("/")?t.repo_id.split("/").slice(1).join("/"):t.repo_id;return h.jsx(Gr,{onClick:()=>window.open(e,"_blank","noopener,noreferrer"),className:"bg-slate-800/50 border-slate-700 rounded-xl cursor-pointer hover:border-slate-500 transition-colors",children:h.jsxs(Wr,{className:"p-4 space-y-3",children:[h.jsxs("div",{className:"flex items-start justify-between gap-2",children:[h.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-semibold text-sky-400",children:[h.jsx(jU,{className:"w-3.5 h-3.5"}),"Uploaded"]}),h.jsx(et,{variant:"ghost",size:"icon",asChild:!0,className:"h-7 w-7 text-slate-400 hover:text-white","aria-label":"View on Hub",children:h.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",onClick:r=>r.stopPropagation(),children:h.jsx(cl,{className:"w-3.5 h-3.5"})})})]}),h.jsxs("div",{children:[h.jsxs("div",{className:"text-white font-semibold truncate flex items-center gap-1.5",title:t.repo_id,children:[t.private?h.jsx(nX,{className:"w-3.5 h-3.5 text-slate-400 shrink-0"}):null,h.jsx("span",{className:"truncate",children:n})]}),h.jsxs("div",{className:"text-xs text-slate-400 truncate",title:t.repo_id,children:[t.repo_id," ยท updated ",OZ(t.last_modified)]})]})]})})};async function DZ(t,e,n){return er(t,e,"/start-inference",{method:"POST",body:n,action:"Start inference"})}async function ON(t,e){return er(t,e,"/stop-inference",{method:"POST",action:"Stop inference"})}async function LZ(t,e,n){return er(t,e,"/inference-status",{signal:n,action:"Get inference status"})}const kZ=({deviceId:t,paused:e})=>{const{videoRef:n,hasError:r}=m4(t,e);return e||r||!t?h.jsxs("div",{className:"w-32 h-24 bg-gray-800 rounded border border-gray-700 flex flex-col items-center justify-center",children:[h.jsx(UU,{className:"w-5 h-5 text-gray-500 mb-1"}),h.jsx("span",{className:"text-[10px] text-gray-500",children:e?"Released":"No preview"})]}):h.jsx("video",{ref:n,autoPlay:!0,muted:!0,playsInline:!0,className:"w-32 h-24 object-cover rounded border border-gray-700 bg-black"})},jZ=30,x4=({open:t,onOpenChange:e,robot:n,jobId:r,initialStep:i})=>{var L;const{baseUrl:o,fetchWithHeaders:a}=Dn(),{toast:s}=Dr(),l=ji(),[c,u]=_.useState([]),[d,f]=_.useState(i),[p,y]=_.useState(""),[v,g]=_.useState(60),[m,x]=_.useState(!1),[b,S]=_.useState(null),[w,E]=_.useState(!1),[T,A]=_.useState(null),[M,C]=_.useState({}),{cameras:P}=p4({enabled:t});_.useEffect(()=>{if(!t)return;let j=!1;return FA(o,a,r).then(X=>{if(!j&&(u(X),X.length>0)){const K=X[X.length-1].step;f(F=>F??K)}}).catch(()=>{j||u([])}),()=>{j=!0}},[t,o,a,r]),_.useEffect(()=>{if(!t||d==null){S(null),A(null);return}let j=!1;return E(!0),A(null),CZ(o,a,r,d).then(X=>{j||(S(X),C(K=>{const F={};for(const Y of Object.keys(X.image_features))F[Y]=K[Y]??null;return F}))}).catch(X=>{j||(S(null),A(X instanceof Error?X.message:String(X)))}).finally(()=>{j||E(!1)}),()=>{j=!0}},[t,o,a,r,d]),_.useEffect(()=>{if(!b)return;const j=(n==null?void 0:n.cameras)??[];j.length===0||P.length===0||C(X=>{let K=!1;const F={...X};for(const Y of Object.keys(b.image_features)){if(F[Y]!=null)continue;const q=j.find(te=>te.name.toLowerCase()===Y.toLowerCase());if(!q)continue;const ee=q.device_id&&P.find(te=>te.deviceId===q.device_id)||P.find(te=>te.index===q.camera_index);ee&&(F[Y]=ee.index,K=!0)}return K?F:X})},[b,n,P]);const R=d!=null?((L=c.find(j=>j.step===d))==null?void 0:L.ref)??null:null,D=b?Object.keys(b.image_features):[],k=D.every(j=>M[j]!=null),U=!!n&&n.is_clean&&R!=null&&!!b&&k&&!m,O=async()=>{if(!n||R==null||!b)return;x(!0),await new Promise(X=>setTimeout(X,300));const j={};for(const[X,K]of Object.entries(b.image_features)){const F=M[X];F!=null&&(j[X]={type:"opencv",camera_index:F,width:K.width,height:K.height,fps:jZ})}try{await DZ(o,a,{follower_port:n.follower_port,follower_config:n.follower_config,policy_ref:R,task:p,cameras:j,duration_s:v}),e(!1),l("/inference")}catch(X){s({title:"Couldn't start inference",description:X instanceof Error?X.message:String(X),variant:"destructive"}),x(!1)}},W=(j,X)=>{const K=Number(X);C(F=>({...F,[j]:K}))};return h.jsx(Hc,{open:t,onOpenChange:e,children:h.jsxs(bl,{className:"bg-gray-900 border-gray-800 text-white sm:max-w-[600px] p-8 max-h-[90vh] overflow-y-auto",children:[h.jsxs(_l,{children:[h.jsx("div",{className:"flex justify-center items-center mb-4",children:h.jsx("div",{className:"w-8 h-8 bg-green-500 rounded-full flex items-center justify-center",children:h.jsx(Tc,{className:"w-4 h-4 text-white"})})}),h.jsx(wl,{className:"text-white text-center text-2xl font-bold",children:"Configure Inference"})]}),h.jsxs("div",{className:"space-y-6 py-4",children:[h.jsx(Sl,{className:"text-gray-400 text-base leading-relaxed text-center",children:"Pick a checkpoint and confirm hardware. The selected policy will drive the follower autonomously for the configured duration."}),h.jsxs("div",{className:"space-y-4",children:[h.jsx("h3",{className:"text-lg font-semibold text-white border-b border-gray-700 pb-2",children:"Robot Configuration"}),n?n.is_clean?h.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[h.jsx(qi,{className:"w-4 h-4 text-green-400"}),h.jsxs("span",{className:"text-slate-200",children:["Running on ",h.jsx("strong",{children:n.name})]})]}):h.jsxs(Mi,{className:"bg-amber-900/40 border-amber-700 text-amber-100",children:[h.jsx(oa,{className:"h-4 w-4"}),h.jsxs(Ai,{children:[h.jsx("strong",{children:n.name})," is missing a calibration. Configure it before running inference."]})]}):h.jsxs(Mi,{className:"bg-amber-900/40 border-amber-700 text-amber-100",children:[h.jsx(oa,{className:"h-4 w-4"}),h.jsx(Ai,{children:"Select and configure a robot on the Landing page first."})]})]}),h.jsxs("div",{className:"space-y-4",children:[h.jsx("h3",{className:"text-lg font-semibold text-white border-b border-gray-700 pb-2",children:"Checkpoint"}),c.length===0?h.jsxs(Mi,{className:"bg-amber-900/40 border-amber-700 text-amber-100",children:[h.jsx(oa,{className:"h-4 w-4"}),h.jsx(Ai,{children:"No checkpoints available for this job yet."})]}):h.jsx(BA,{checkpoints:c,selectedStep:d,onChange:f})]}),h.jsxs("div",{className:"space-y-4",children:[h.jsx("h3",{className:"text-lg font-semibold text-white border-b border-gray-700 pb-2",children:"Run parameters"}),b!=null&&b.requires_task?h.jsxs("div",{className:"space-y-2",children:[h.jsx(Tt,{htmlFor:"task",className:"text-sm font-medium text-gray-300",children:"Task description"}),h.jsx(hi,{id:"task",value:p,onChange:j=>y(j.target.value),placeholder:"e.g., pick up the red block",className:"bg-gray-800 border-gray-700 text-white"}),h.jsxs("p",{className:"text-xs text-gray-500",children:["This policy is language-conditioned (",b.policy_type,")."]})]}):null,h.jsxs("div",{className:"space-y-2",children:[h.jsx(Tt,{htmlFor:"durationS",className:"text-sm font-medium text-gray-300",children:"Max duration (seconds)"}),h.jsx(mr,{id:"durationS",min:1,value:v,onChange:j=>{j!==void 0&&g(j)},className:"bg-gray-800 border-gray-700 text-white"})]})]}),h.jsxs("div",{className:"space-y-4",children:[h.jsx("h3",{className:"text-lg font-semibold text-white border-b border-gray-700 pb-2",children:"Cameras"}),w?h.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-400",children:[h.jsx(fi,{className:"w-4 h-4 animate-spin"}),"Reading policy configโ€ฆ"]}):T?h.jsxs(Mi,{className:"bg-red-900/40 border-red-700 text-red-100",children:[h.jsx(oa,{className:"h-4 w-4"}),h.jsxs(Ai,{children:["Couldn't load policy config: ",T]})]}):b?D.length===0?h.jsx("p",{className:"text-xs text-gray-500",children:"This policy doesn't use cameras."}):h.jsxs("div",{className:"space-y-3",children:[h.jsx("p",{className:"text-xs text-gray-500",children:"Bind a physical camera to each name the policy was trained with. Resolution comes from the checkpoint."}),D.map(j=>{const X=b.image_features[j],K=M[j],F=K!=null?P.find(Y=>Y.index===K):void 0;return h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs("div",{className:"flex-1",children:[h.jsx(Tt,{className:"text-sm font-medium text-gray-200",children:j}),h.jsxs("p",{className:"text-xs text-gray-500",children:[X.width,"ร—",X.height]})]}),h.jsxs(Ga,{value:K!=null?String(K):void 0,onValueChange:Y=>W(j,Y),children:[h.jsx(sa,{className:"bg-gray-800 border-gray-700 text-white w-56",children:h.jsx(Wa,{placeholder:"Select a camera"})}),h.jsx(la,{className:"bg-gray-900 border-gray-700 text-white",children:P.length===0?h.jsx("div",{className:"px-2 py-1.5 text-xs text-gray-500",children:"No cameras detected"}):P.map(Y=>h.jsxs($n,{value:String(Y.index),children:["#",Y.index," โ€” ",Y.name]},Y.index))})]}),h.jsx(kZ,{deviceId:(F==null?void 0:F.deviceId)??"",paused:m})]},j)})]}):null]}),h.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center pt-4",children:[h.jsxs(et,{onClick:O,disabled:!U,className:"w-full sm:w-auto bg-green-500 hover:bg-green-600 text-white px-10 py-6 text-lg disabled:opacity-40 disabled:cursor-not-allowed",children:[h.jsx(Tc,{className:"w-5 h-5 mr-2"}),m?"Startingโ€ฆ":"Start Inference"]}),h.jsx(et,{onClick:()=>e(!1),variant:"outline",className:"w-full sm:w-auto border-gray-500 hover:border-gray-200 px-10 py-6 text-lg text-zinc-500 bg-zinc-900 hover:bg-zinc-800",children:"Cancel"})]})]})]})})},PE="lelab.selectedRobot",UZ=()=>{try{const t=localStorage.getItem(PE);return t&&typeof t=="string"?t:null}catch{return null}},FZ=t=>{try{t?localStorage.setItem(PE,t):localStorage.removeItem(PE)}catch{}},$A=()=>{const{baseUrl:t,fetchWithHeaders:e}=Dn(),{toast:n}=Dr(),r=yl(),[i,o]=_.useState({}),[a,s]=_.useState(()=>UZ()),[l,c]=_.useState(!1);_.useEffect(()=>{let g=!1;return(async()=>{c(!0);try{const b=await(await e(`${t}/robots`)).json();if(g)return;const S={};for(const w of b.robots??[])S[w.name]=w;o(S),s(w=>w&&w in S?w:null)}catch(x){g||console.error("Failed to fetch robots:",x)}finally{g||c(!1)}})(),()=>{g=!0}},[t,e,r.key]),_.useEffect(()=>{FZ(a)},[a]);const u=_.useCallback(g=>{s(g)},[]),d=_.useCallback(()=>{s(null)},[]),f=_.useCallback(async g=>{const m=g.trim();if(!m)return n({title:"Missing name",description:"Robot name cannot be empty.",variant:"destructive"}),!1;if(/[/\\]|\.\./.test(m))return n({title:"Invalid name",description:"Robot names cannot contain '/', '\\', or '..'",variant:"destructive"}),!1;try{const x=await e(`${t}/robots/${encodeURIComponent(m)}?create=true`,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"});if(x.status===409)return n({title:"Already exists",description:`A robot named "${m}" already exists. Pick it from the dropdown or choose a different name.`,variant:"destructive"}),!1;if(!x.ok){const S=await x.text();return n({title:"Failed to create",description:S,variant:"destructive"}),!1}const b=await x.json();return b.robot&&(o(S=>({...S,[m]:b.robot})),s(m)),!0}catch(x){return n({title:"Network error",description:String(x),variant:"destructive"}),!1}},[t,e,n]),p=_.useCallback(async g=>{try{const m=await e(`${t}/robots/${encodeURIComponent(g)}`,{method:"DELETE"});if(!m.ok){const x=await m.text();return n({title:"Failed to delete",description:x,variant:"destructive"}),!1}return o(x=>{const{[g]:b,...S}=x;return S}),s(x=>x===g?null:x),!0}catch(m){return n({title:"Network error",description:String(m),variant:"destructive"}),!1}},[t,e,n]),y=_.useMemo(()=>a?i[a]??null:null,[a,i]),v=_.useMemo(()=>Object.keys(i).sort(),[i]);return{records:i,selectedName:a,selectedRecord:y,availableNames:v,isLoading:l,selectRobot:u,clearSelection:d,createRobot:f,deleteRobot:p}},BZ=10,$Z=new Set(["RUNNING","QUEUED","SCHEDULING"]),Ag=t=>t.state==="running"||t.checkpoint_count>0,IN=t=>{var e;return $Z.has((((e=t.status)==null?void 0:e.stage)??"").toUpperCase())},zZ=()=>{const{baseUrl:t,fetchWithHeaders:e}=Dn(),{toast:n}=Dr(),r=ji(),[i,o]=_.useState([]),[a,s]=_.useState([]),[l,c]=_.useState([]),[u,d]=_.useState(!1),[f,p]=_.useState(null),[y,v]=_.useState(""),[g,m]=_.useState(null),{selectedRecord:x}=$A(),[b,S]=_.useState(!1),[w,E]=_.useState(null),[T,A]=_.useState(null),M=_.useCallback(async()=>{try{const[ie,G]=await Promise.all([CE(t,e,BZ),TZ(t,e)]);o(ie),s(G.jobs),c(G.models),d(G.authenticated),p(null)}catch(ie){p(ie instanceof Error?ie.message:String(ie))}},[t,e]);_.useEffect(()=>{M();const ie=()=>{document.visibilityState==="visible"&&M()};return document.addEventListener("visibilitychange",ie),window.addEventListener("focus",M),()=>{document.removeEventListener("visibilitychange",ie),window.removeEventListener("focus",M)}},[M]);const C=_.useCallback(ie=>{ie.length!==0&&o(G=>{if(G.length===0)return G;const Ve=new Map(ie.map(Re=>[Re.id,Re]));let Ne=!1;const st=G.map(Re=>{const ct=Ve.get(Re.id);return ct?(Ne=!0,{...Re,state:ct.state,metrics:ct.metrics,wandb_run_url:ct.wandb_run_url,checkpoint_count:ct.checkpoint_count}):Re});return Ne?st:G})},[]);pZ(M,C);const P=async ie=>{try{await v4(t,e,ie),n({title:"Job stopping"}),M()}catch(G){n({title:"Stop failed",description:G instanceof Error?G.message:String(G),variant:"destructive"})}},R=(ie,G)=>{E(ie),A(G),S(!0)},D=async ie=>{try{await y4(t,e,ie),n({title:"Job removed"}),M()}catch(G){n({title:"Delete failed",description:G instanceof Error?G.message:String(G),variant:"destructive"})}},k=async ie=>{if(ie.provider!=="seeed_cloud"){ie.url&&window.open(ie.url,"_blank","noopener,noreferrer");return}try{m(ie.id);const G=await bZ(t,e,"seeed_cloud",ie.id);o(Ve=>Ve.some(Ne=>Ne.id===G.id)?Ve:[G,...Ve]),r(`/training/${G.id}`)}catch(G){n({title:"Attach failed",description:G instanceof Error?G.message:String(G),variant:"destructive"})}finally{m(null)}},U=y.trim().toLowerCase(),O=_.useCallback(ie=>!U||(ie??"").toLowerCase().includes(U),[U]),W=_.useMemo(()=>i.filter(ie=>O(ie.name)),[i,O]),L=_.useMemo(()=>a.filter(ie=>O(ie.docker_image??ie.space_id??ie.id)),[a,O]),j=_.useMemo(()=>l.filter(ie=>O(ie.repo_id)),[l,O]),X=_.useMemo(()=>W.filter(ie=>ie.runner==="local"),[W]),K=_.useMemo(()=>W.filter(ie=>ie.runner==="hf_cloud"||ie.runner==="seeed_cloud"),[W]),F=_.useMemo(()=>new Set(K.map(ie=>ie.hf_job_id).filter(ie=>!!ie)),[K]),Y=_.useMemo(()=>L.filter(ie=>ie.provider==="hf_cloud"?!F.has(ie.id):ie.provider==="seeed_cloud"?!K.some(G=>G.external_provider==="seeed_cloud"&&G.external_job_id===ie.id):!0),[L,K,F]),q=_.useMemo(()=>new Set(K.map(ie=>ie.hf_repo_id).filter(ie=>!!ie)),[K]),ee=_.useMemo(()=>j.filter(ie=>!q.has(ie.repo_id)),[j,q]),te=_.useMemo(()=>X.filter(Ag),[X]),Q=_.useMemo(()=>X.filter(ie=>!Ag(ie)),[X]),ce=_.useMemo(()=>K.filter(Ag),[K]),ae=_.useMemo(()=>K.filter(ie=>!Ag(ie)),[K]),fe=_.useMemo(()=>Y.filter(IN),[Y]),we=_.useMemo(()=>Y.filter(ie=>!IN(ie)),[Y]),le=Q.length+ae.length+we.length;return h.jsxs("section",{className:"space-y-6",children:[h.jsxs("div",{className:"flex items-center justify-between gap-3",children:[h.jsx("h2",{className:"text-lg font-semibold text-white",children:"Jobs"}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs("div",{className:"relative",children:[h.jsx(oA,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-slate-400 pointer-events-none"}),h.jsx(hi,{value:y,onChange:ie=>v(ie.target.value),placeholder:"Search jobs",className:"h-8 w-48 sm:w-60 pl-8 bg-slate-800/50 border-slate-700 text-sm text-white placeholder:text-slate-500","aria-label":"Search jobs"})]}),h.jsx(et,{variant:"ghost",size:"icon",onClick:M,className:"h-7 w-7 text-slate-400 hover:text-white","aria-label":"Refresh jobs",children:h.jsx(kU,{className:"w-4 h-4"})})]})]}),f?h.jsxs("p",{className:"text-sm text-red-300",children:["Couldn't load jobs: ",f]}):null,h.jsxs("div",{className:"space-y-3",children:[h.jsx("h3",{className:"text-sm font-semibold uppercase tracking-wide text-slate-400",children:"Local jobs"}),te.length===0?h.jsx("p",{className:"text-sm text-slate-500",children:U?"No local jobs match your search.":"No active local jobs. Start one from the Training page."}):h.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:te.map(ie=>h.jsx(Mg,{job:ie,onStop:P,onDelete:D,onPlay:R},ie.id))})]}),h.jsx("div",{className:"border-t border-slate-700"}),h.jsxs("div",{className:"space-y-3",children:[h.jsx("h3",{className:"text-sm font-semibold uppercase tracking-wide text-slate-400",children:"Online jobs"}),!u&&K.length===0?h.jsx("p",{className:"text-sm text-slate-500",children:"Sign in with Hugging Face to see your cloud jobs."}):ce.length===0&&fe.length===0&&ee.length===0?h.jsx("p",{className:"text-sm text-slate-500",children:U?"No online jobs match your search.":"No active cloud jobs."}):h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[ce.map(ie=>h.jsx(Mg,{job:ie,onStop:P,onDelete:D,onPlay:R},ie.id)),fe.map(ie=>h.jsx(NN,{job:ie,onOpen:k,busy:g===ie.id},ie.id)),ee.map(ie=>h.jsx(IZ,{model:ie},ie.repo_id))]})]}),le>0?h.jsxs(Ty,{children:[h.jsxs(My,{className:"group flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wide text-slate-400 hover:text-white transition-colors",children:[h.jsx(bp,{className:"w-3.5 h-3.5 transition-transform group-data-[state=open]:rotate-90"}),"Untracked (",le,")"]}),h.jsx(Ay,{className:"pt-3",children:h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[Q.map(ie=>h.jsx(Mg,{job:ie,onStop:P,onDelete:D,onPlay:R},ie.id)),ae.map(ie=>h.jsx(Mg,{job:ie,onStop:P,onDelete:D,onPlay:R},ie.id)),we.map(ie=>h.jsx(NN,{job:ie,onOpen:k,busy:g===ie.id},ie.id))]})})]}):null,w?h.jsx(x4,{open:b,onOpenChange:S,robot:x,jobId:w.id,initialStep:T}):null]})},DN="uv tool install git+https://github.com/huggingface/leLab.git && lelab",HZ="http://localhost:8000/",VZ=({open:t,onOpenChange:e,dismissible:n=!0})=>{const[r,i]=_.useState(!1),o=s=>{n||s.preventDefault()},a=async()=>{try{await navigator.clipboard.writeText(DN),i(!0),setTimeout(()=>i(!1),1500)}catch(s){console.warn("Clipboard write failed:",s)}};return h.jsx(Hc,{open:t,onOpenChange:n?e:()=>{},children:h.jsxs(bl,{className:"bg-gray-900 border-gray-700 text-gray-300 sm:max-w-xl",hideClose:!n,onEscapeKeyDown:o,onPointerDownOutside:o,onInteractOutside:o,children:[h.jsxs(_l,{className:"text-center sm:text-center min-w-0",children:[h.jsxs(wl,{className:"text-white flex items-center justify-center gap-2 text-xl",children:[h.jsx(aX,{className:"w-6 h-6"}),"Get Started with LeLab"]}),h.jsx(Sl,{children:"LeLab runs on your machine. Click the command to copy it, then paste in a terminal:"})]}),h.jsxs("div",{className:"space-y-4 py-2 min-w-0",children:[h.jsxs("button",{type:"button",onClick:a,"aria-label":"Copy command to clipboard",className:"group relative w-full bg-gray-800 hover:bg-gray-750 rounded-lg border border-gray-700 hover:border-gray-600 text-left transition-colors cursor-pointer",children:[h.jsx("pre",{className:"p-4 pr-12 text-xs sm:text-sm overflow-x-auto whitespace-pre-wrap break-all",children:h.jsx("code",{className:"text-green-400",children:DN})}),h.jsx("span",{className:"absolute right-2 top-2 flex items-center gap-1 px-2 py-1 rounded text-xs text-gray-400 group-hover:text-white bg-gray-900/80",children:r?h.jsxs(h.Fragment,{children:[h.jsx(xl,{className:"w-3.5 h-3.5 text-green-400"}),"Copied"]}):h.jsxs(h.Fragment,{children:[h.jsx(rA,{className:"w-3.5 h-3.5"}),"Copy"]})})]}),h.jsx("p",{className:"text-gray-400 text-sm text-center",children:"After running, your browser will open the local LeLab app."}),h.jsx(et,{asChild:!0,className:"w-full bg-blue-600 hover:bg-blue-700 text-white",children:h.jsxs("a",{href:HZ,target:"_blank",rel:"noopener noreferrer",children:[h.jsx(cl,{className:"w-4 h-4 mr-2"}),"Open LeLab"]})})]})]})})};async function b4(t,e,n){return er(t,e,"/datasets",{signal:n,action:"List datasets"})}const GZ=()=>{const{baseUrl:t,fetchWithHeaders:e}=Dn(),[n,r]=_.useState([]),[i,o]=_.useState(!0),a=_.useCallback(()=>{o(!0),b4(t,e).then(r).catch(()=>r([])).finally(()=>o(!1))},[t,e]);return _.useEffect(()=>{a()},[a]),{datasets:n,loading:i,refresh:a}},WZ=()=>typeof window<"u"&&window.location.hostname.endsWith(".hf.space"),LN=WZ(),XZ=()=>{const[t,e]=_.useState(LN),{auth:n}=xf(),{selectedName:r,selectedRecord:i,availableNames:o,isLoading:a,selectRobot:s,createRobot:l,deleteRobot:c}=$A(),{datasets:u,loading:d}=GZ(),[f,p]=_.useState(!1),[y,v]=_.useState(""),[g,m]=_.useState(""),[x,b]=_.useState(5),[S,w]=_.useState(60),[E,T]=_.useState(15),[A,M]=_.useState(!0),[C,P]=_.useState([]),R=_.useRef(null),D=ji(),{toast:k}=Dr();_.useEffect(()=>{C.length>0&&(R.current&&R.current(),P([]))},[]),_.useEffect(()=>()=>{R.current&&R.current()},[]);const U=()=>{P(i?[...i.cameras??[]]:[]),p(!0)},O=Y=>{p(Y),!Y&&R.current&&R.current()},W=()=>D("/training"),L=(Y,q)=>{const ee=`/spaces/lerobot/visualize_dataset?path=${encodeURIComponent(`/${Y}`)}`,te=q?`https://huggingface.co/login?next=${encodeURIComponent(ee)}`:`https://huggingface.co${ee}`;window.open(te,"_blank","noopener,noreferrer")},j=Y=>{if(Y.source==="local"||Y.source==="both"){D("/upload",{state:{datasetInfo:{dataset_repo_id:Y.repo_id,source:Y.source}}});return}L(Y.repo_id,Y.private)},X=Y=>{L(Y,!0)},K=Y=>{v(Y),U()},F=async()=>{if(!i){k({title:"No robot selected",description:"Select or create a robot on the Landing page first.",variant:"destructive"});return}const Y=i;if(!Y.is_clean){k({title:"Robot not ready",description:`${Y.name} is missing a calibration. Configure it before recording.`,variant:"destructive"});return}if(!y||!g){k({title:"Missing dataset details",description:"Please enter a dataset name and task description.",variant:"destructive"});return}const q=n.status==="authenticated"?`${n.username}/${y}`:y;C.length>0&&R.current&&(k({title:"Preparing Camera Resources",description:`Releasing ${C.length} camera stream(s) for recording...`}),R.current(),await new Promise(Q=>setTimeout(Q,500)),k({title:"Camera Resources Ready",description:"Camera streams released successfully. Starting recording..."}));const ee=C.reduce((Q,ce)=>(Q[ce.name]={type:ce.type,camera_index:ce.camera_index,width:ce.width,height:ce.height,fps:ce.fps},Q),{}),te={leader_port:Y.leader_port,follower_port:Y.follower_port,leader_config:Y.leader_config,follower_config:Y.follower_config,dataset_repo_id:q,single_task:g,num_episodes:x,episode_time_s:S,reset_time_s:E,fps:30,video:!0,push_to_hub:!1,resume:!1,streaming_encoding:A,cameras:ee};p(!1),D("/recording",{state:{recordingConfig:te}})};return h.jsxs("div",{className:"min-h-screen bg-black text-white pb-16",style:{"--lelab-topbar-h":"48px"},children:[h.jsx(iK,{}),h.jsx("div",{className:"sticky z-20 bg-black/95 backdrop-blur supports-[backdrop-filter]:bg-black/70 border-b border-gray-800",style:{top:"var(--lelab-topbar-h)"},children:h.jsxs("div",{className:"mx-auto max-w-7xl px-4 py-4 grid gap-4 grid-cols-1 lg:grid-cols-[1.2fr_2fr]",children:[h.jsx(xJ,{selectedName:r,selectedRecord:i,availableNames:o,isLoading:a,selectRobot:s,createRobot:l,deleteRobot:c}),h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[h.jsxs("div",{className:"bg-gray-800 rounded-lg border border-gray-700 p-3 flex flex-col gap-2",children:[h.jsx("h3",{className:"font-semibold text-lg text-left h-10 flex items-center",children:"Dataset"}),h.jsx(hZ,{datasets:u,loading:d,onPickExisting:j,onOpenCustom:X,onCreateNew:K,children:h.jsxs(et,{variant:"outline",role:"combobox",className:"w-full justify-between bg-gray-800 border-gray-600 text-white hover:bg-gray-700",children:[h.jsx("span",{className:"truncate text-gray-300",children:d?"Loading datasetsโ€ฆ":"Select or create a datasetโ€ฆ"}),h.jsx(tA,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})})]}),h.jsxs("div",{className:"bg-gray-800 rounded-lg border border-gray-700 p-3 flex flex-col gap-2",children:[h.jsx("h3",{className:"font-semibold text-lg text-left h-10 flex items-center",children:"Create a model"}),h.jsx(et,{onClick:W,className:"w-full bg-green-500 hover:bg-green-600 text-white",children:"Training"})]})]})]})}),h.jsx("main",{className:"mx-auto max-w-7xl px-4 py-6",children:h.jsx(zZ,{})}),h.jsx(sK,{}),h.jsx(VZ,{open:t,onOpenChange:e,dismissible:!LN}),h.jsx(uZ,{open:f,onOpenChange:O,robot:i,datasetName:y,setDatasetName:v,singleTask:g,setSingleTask:m,numEpisodes:x,setNumEpisodes:b,episodeTimeS:S,setEpisodeTimeS:w,resetTimeS:E,setResetTimeS:T,streamingEncoding:A,setStreamingEncoding:M,cameras:C,setCameras:P,onStart:F,releaseStreamsRef:R})]})};/** + * @license + * Copyright 2010-2025 Three.js Authors + * SPDX-License-Identifier: MIT + */const zA="177",ad={ROTATE:0,DOLLY:1,PAN:2},zu={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},qZ=0,kN=1,KZ=2,_4=1,w4=2,ja=3,ba=0,ui=1,Ki=2,tl=0,sd=1,jN=2,UN=3,FN=4,YZ=5,ql=100,JZ=101,ZZ=102,QZ=103,eQ=104,tQ=200,nQ=201,rQ=202,iQ=203,RE=204,NE=205,oQ=206,aQ=207,sQ=208,lQ=209,cQ=210,uQ=211,dQ=212,fQ=213,hQ=214,OE=0,IE=1,DE=2,jd=3,LE=4,kE=5,jE=6,UE=7,kx=0,pQ=1,mQ=2,nl=0,gQ=1,vQ=2,yQ=3,xQ=4,bQ=5,_Q=6,wQ=7,BN="attached",SQ="detached",S4=300,Ud=301,Fd=302,FE=303,BE=304,jx=306,ca=1e3,Ji=1001,Py=1002,Xr=1003,E4=1004,Ch=1005,Or=1006,$v=1007,Oo=1008,_a=1009,T4=1010,M4=1011,Ep=1012,HA=1013,Nc=1014,Io=1015,Om=1016,VA=1017,GA=1018,Tp=1020,A4=35902,C4=1021,P4=1022,Zi=1023,Mp=1026,Ap=1027,WA=1028,XA=1029,R4=1030,qA=1031,KA=1033,zv=33776,Hv=33777,Vv=33778,Gv=33779,$E=35840,zE=35841,HE=35842,VE=35843,GE=36196,WE=37492,XE=37496,qE=37808,KE=37809,YE=37810,JE=37811,ZE=37812,QE=37813,e1=37814,t1=37815,n1=37816,r1=37817,i1=37818,o1=37819,a1=37820,s1=37821,Wv=36492,l1=36494,c1=36495,N4=36283,u1=36284,d1=36285,f1=36286,Cp=2300,Pp=2301,G_=2302,$N=2400,zN=2401,HN=2402,EQ=2500,TQ=0,O4=1,h1=2,MQ=3200,AQ=3201,Ux=0,CQ=1,Ds="",Zt="srgb",Kr="srgb-linear",Ry="linear",an="srgb",au=7680,VN=519,PQ=512,RQ=513,NQ=514,I4=515,OQ=516,IQ=517,DQ=518,LQ=519,p1=35044,GN="300 es",Xa=2e3,Ny=2001;class Vc{addEventListener(e,n){this._listeners===void 0&&(this._listeners={});const r=this._listeners;r[e]===void 0&&(r[e]=[]),r[e].indexOf(n)===-1&&r[e].push(n)}hasEventListener(e,n){const r=this._listeners;return r===void 0?!1:r[e]!==void 0&&r[e].indexOf(n)!==-1}removeEventListener(e,n){const r=this._listeners;if(r===void 0)return;const i=r[e];if(i!==void 0){const o=i.indexOf(n);o!==-1&&i.splice(o,1)}}dispatchEvent(e){const n=this._listeners;if(n===void 0)return;const r=n[e.type];if(r!==void 0){e.target=this;const i=r.slice(0);for(let o=0,a=i.length;o>8&255]+Mr[t>>16&255]+Mr[t>>24&255]+"-"+Mr[e&255]+Mr[e>>8&255]+"-"+Mr[e>>16&15|64]+Mr[e>>24&255]+"-"+Mr[n&63|128]+Mr[n>>8&255]+"-"+Mr[n>>16&255]+Mr[n>>24&255]+Mr[r&255]+Mr[r>>8&255]+Mr[r>>16&255]+Mr[r>>24&255]).toLowerCase()}function It(t,e,n){return Math.max(e,Math.min(n,t))}function YA(t,e){return(t%e+e)%e}function kQ(t,e,n,r,i){return r+(t-e)*(i-r)/(n-e)}function jQ(t,e,n){return t!==e?(n-t)/(e-t):0}function Xh(t,e,n){return(1-n)*t+n*e}function UQ(t,e,n,r){return Xh(t,e,1-Math.exp(-n*r))}function FQ(t,e=1){return e-Math.abs(YA(t,e*2)-e)}function BQ(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*(3-2*t))}function $Q(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*t*(t*(t*6-15)+10))}function zQ(t,e){return t+Math.floor(Math.random()*(e-t+1))}function HQ(t,e){return t+Math.random()*(e-t)}function VQ(t){return t*(.5-Math.random())}function GQ(t){t!==void 0&&(WN=t);let e=WN+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function WQ(t){return t*Wh}function XQ(t){return t*Bd}function qQ(t){return(t&t-1)===0&&t!==0}function KQ(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function YQ(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function JQ(t,e,n,r,i){const o=Math.cos,a=Math.sin,s=o(n/2),l=a(n/2),c=o((e+r)/2),u=a((e+r)/2),d=o((e-r)/2),f=a((e-r)/2),p=o((r-e)/2),y=a((r-e)/2);switch(i){case"XYX":t.set(s*u,l*d,l*f,s*c);break;case"YZY":t.set(l*f,s*u,l*d,s*c);break;case"ZXZ":t.set(l*d,l*f,s*u,s*c);break;case"XZX":t.set(s*u,l*y,l*p,s*c);break;case"YXY":t.set(l*p,s*u,l*y,s*c);break;case"ZYZ":t.set(l*y,l*p,s*u,s*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Po(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function tn(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(t*4294967295);case Uint16Array:return Math.round(t*65535);case Uint8Array:return Math.round(t*255);case Int32Array:return Math.round(t*2147483647);case Int16Array:return Math.round(t*32767);case Int8Array:return Math.round(t*127);default:throw new Error("Invalid component type.")}}const Kl={DEG2RAD:Wh,RAD2DEG:Bd,generateUUID:Uo,clamp:It,euclideanModulo:YA,mapLinear:kQ,inverseLerp:jQ,lerp:Xh,damp:UQ,pingpong:FQ,smoothstep:BQ,smootherstep:$Q,randInt:zQ,randFloat:HQ,randFloatSpread:VQ,seededRandom:GQ,degToRad:WQ,radToDeg:XQ,isPowerOfTwo:qQ,ceilPowerOfTwo:KQ,floorPowerOfTwo:YQ,setQuaternionFromProperEuler:JQ,normalize:tn,denormalize:Po};class xt{constructor(e=0,n=0){xt.prototype.isVector2=!0,this.x=e,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,n){return this.x=e,this.y=n,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const n=this.x,r=this.y,i=e.elements;return this.x=i[0]*n+i[3]*r+i[6],this.y=i[1]*n+i[4]*r+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,n){return this.x=It(this.x,e.x,n.x),this.y=It(this.y,e.y,n.y),this}clampScalar(e,n){return this.x=It(this.x,e,n),this.y=It(this.y,e,n),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(It(r,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const r=this.dot(e)/n;return Math.acos(It(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y;return n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this}rotateAround(e,n){const r=Math.cos(n),i=Math.sin(n),o=this.x-e.x,a=this.y-e.y;return this.x=o*r-a*i+e.x,this.y=o*i+a*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Ii{constructor(e=0,n=0,r=0,i=1){this.isQuaternion=!0,this._x=e,this._y=n,this._z=r,this._w=i}static slerpFlat(e,n,r,i,o,a,s){let l=r[i+0],c=r[i+1],u=r[i+2],d=r[i+3];const f=o[a+0],p=o[a+1],y=o[a+2],v=o[a+3];if(s===0){e[n+0]=l,e[n+1]=c,e[n+2]=u,e[n+3]=d;return}if(s===1){e[n+0]=f,e[n+1]=p,e[n+2]=y,e[n+3]=v;return}if(d!==v||l!==f||c!==p||u!==y){let g=1-s;const m=l*f+c*p+u*y+d*v,x=m>=0?1:-1,b=1-m*m;if(b>Number.EPSILON){const w=Math.sqrt(b),E=Math.atan2(w,m*x);g=Math.sin(g*E)/w,s=Math.sin(s*E)/w}const S=s*x;if(l=l*g+f*S,c=c*g+p*S,u=u*g+y*S,d=d*g+v*S,g===1-s){const w=1/Math.sqrt(l*l+c*c+u*u+d*d);l*=w,c*=w,u*=w,d*=w}}e[n]=l,e[n+1]=c,e[n+2]=u,e[n+3]=d}static multiplyQuaternionsFlat(e,n,r,i,o,a){const s=r[i],l=r[i+1],c=r[i+2],u=r[i+3],d=o[a],f=o[a+1],p=o[a+2],y=o[a+3];return e[n]=s*y+u*d+l*p-c*f,e[n+1]=l*y+u*f+c*d-s*p,e[n+2]=c*y+u*p+s*f-l*d,e[n+3]=u*y-s*d-l*f-c*p,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,n,r,i){return this._x=e,this._y=n,this._z=r,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,n=!0){const r=e._x,i=e._y,o=e._z,a=e._order,s=Math.cos,l=Math.sin,c=s(r/2),u=s(i/2),d=s(o/2),f=l(r/2),p=l(i/2),y=l(o/2);switch(a){case"XYZ":this._x=f*u*d+c*p*y,this._y=c*p*d-f*u*y,this._z=c*u*y+f*p*d,this._w=c*u*d-f*p*y;break;case"YXZ":this._x=f*u*d+c*p*y,this._y=c*p*d-f*u*y,this._z=c*u*y-f*p*d,this._w=c*u*d+f*p*y;break;case"ZXY":this._x=f*u*d-c*p*y,this._y=c*p*d+f*u*y,this._z=c*u*y+f*p*d,this._w=c*u*d-f*p*y;break;case"ZYX":this._x=f*u*d-c*p*y,this._y=c*p*d+f*u*y,this._z=c*u*y-f*p*d,this._w=c*u*d+f*p*y;break;case"YZX":this._x=f*u*d+c*p*y,this._y=c*p*d+f*u*y,this._z=c*u*y-f*p*d,this._w=c*u*d-f*p*y;break;case"XZY":this._x=f*u*d-c*p*y,this._y=c*p*d-f*u*y,this._z=c*u*y+f*p*d,this._w=c*u*d+f*p*y;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return n===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,n){const r=n/2,i=Math.sin(r);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(e){const n=e.elements,r=n[0],i=n[4],o=n[8],a=n[1],s=n[5],l=n[9],c=n[2],u=n[6],d=n[10],f=r+s+d;if(f>0){const p=.5/Math.sqrt(f+1);this._w=.25/p,this._x=(u-l)*p,this._y=(o-c)*p,this._z=(a-i)*p}else if(r>s&&r>d){const p=2*Math.sqrt(1+r-s-d);this._w=(u-l)/p,this._x=.25*p,this._y=(i+a)/p,this._z=(o+c)/p}else if(s>d){const p=2*Math.sqrt(1+s-r-d);this._w=(o-c)/p,this._x=(i+a)/p,this._y=.25*p,this._z=(l+u)/p}else{const p=2*Math.sqrt(1+d-r-s);this._w=(a-i)/p,this._x=(o+c)/p,this._y=(l+u)/p,this._z=.25*p}return this._onChangeCallback(),this}setFromUnitVectors(e,n){let r=e.dot(n)+1;return rMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=r):(this._x=0,this._y=-e.z,this._z=e.y,this._w=r)):(this._x=e.y*n.z-e.z*n.y,this._y=e.z*n.x-e.x*n.z,this._z=e.x*n.y-e.y*n.x,this._w=r),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(It(this.dot(e),-1,1)))}rotateTowards(e,n){const r=this.angleTo(e);if(r===0)return this;const i=Math.min(1,n/r);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,n){const r=e._x,i=e._y,o=e._z,a=e._w,s=n._x,l=n._y,c=n._z,u=n._w;return this._x=r*u+a*s+i*c-o*l,this._y=i*u+a*l+o*s-r*c,this._z=o*u+a*c+r*l-i*s,this._w=a*u-r*s-i*l-o*c,this._onChangeCallback(),this}slerp(e,n){if(n===0)return this;if(n===1)return this.copy(e);const r=this._x,i=this._y,o=this._z,a=this._w;let s=a*e._w+r*e._x+i*e._y+o*e._z;if(s<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,s=-s):this.copy(e),s>=1)return this._w=a,this._x=r,this._y=i,this._z=o,this;const l=1-s*s;if(l<=Number.EPSILON){const p=1-n;return this._w=p*a+n*this._w,this._x=p*r+n*this._x,this._y=p*i+n*this._y,this._z=p*o+n*this._z,this.normalize(),this}const c=Math.sqrt(l),u=Math.atan2(c,s),d=Math.sin((1-n)*u)/c,f=Math.sin(n*u)/c;return this._w=a*d+this._w*f,this._x=r*d+this._x*f,this._y=i*d+this._y*f,this._z=o*d+this._z*f,this._onChangeCallback(),this}slerpQuaternions(e,n,r){return this.copy(e).slerp(n,r)}random(){const e=2*Math.PI*Math.random(),n=2*Math.PI*Math.random(),r=Math.random(),i=Math.sqrt(1-r),o=Math.sqrt(r);return this.set(i*Math.sin(e),i*Math.cos(e),o*Math.sin(n),o*Math.cos(n))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,n=0){return this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._w,e}fromBufferAttribute(e,n){return this._x=e.getX(n),this._y=e.getY(n),this._z=e.getZ(n),this._w=e.getW(n),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class ne{constructor(e=0,n=0,r=0){ne.prototype.isVector3=!0,this.x=e,this.y=n,this.z=r}set(e,n,r){return r===void 0&&(r=this.z),this.x=e,this.y=n,this.z=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,n){return this.x=e.x*n.x,this.y=e.y*n.y,this.z=e.z*n.z,this}applyEuler(e){return this.applyQuaternion(XN.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(XN.setFromAxisAngle(e,n))}applyMatrix3(e){const n=this.x,r=this.y,i=this.z,o=e.elements;return this.x=o[0]*n+o[3]*r+o[6]*i,this.y=o[1]*n+o[4]*r+o[7]*i,this.z=o[2]*n+o[5]*r+o[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const n=this.x,r=this.y,i=this.z,o=e.elements,a=1/(o[3]*n+o[7]*r+o[11]*i+o[15]);return this.x=(o[0]*n+o[4]*r+o[8]*i+o[12])*a,this.y=(o[1]*n+o[5]*r+o[9]*i+o[13])*a,this.z=(o[2]*n+o[6]*r+o[10]*i+o[14])*a,this}applyQuaternion(e){const n=this.x,r=this.y,i=this.z,o=e.x,a=e.y,s=e.z,l=e.w,c=2*(a*i-s*r),u=2*(s*n-o*i),d=2*(o*r-a*n);return this.x=n+l*c+a*d-s*u,this.y=r+l*u+s*c-o*d,this.z=i+l*d+o*u-a*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const n=this.x,r=this.y,i=this.z,o=e.elements;return this.x=o[0]*n+o[4]*r+o[8]*i,this.y=o[1]*n+o[5]*r+o[9]*i,this.z=o[2]*n+o[6]*r+o[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,n){return this.x=It(this.x,e.x,n.x),this.y=It(this.y,e.y,n.y),this.z=It(this.z,e.z,n.z),this}clampScalar(e,n){return this.x=It(this.x,e,n),this.y=It(this.y,e,n),this.z=It(this.z,e,n),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(It(r,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this.z=e.z+(n.z-e.z)*r,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,n){const r=e.x,i=e.y,o=e.z,a=n.x,s=n.y,l=n.z;return this.x=i*l-o*s,this.y=o*a-r*l,this.z=r*s-i*a,this}projectOnVector(e){const n=e.lengthSq();if(n===0)return this.set(0,0,0);const r=e.dot(this)/n;return this.copy(e).multiplyScalar(r)}projectOnPlane(e){return W_.copy(this).projectOnVector(e),this.sub(W_)}reflect(e){return this.sub(W_.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const r=this.dot(e)/n;return Math.acos(It(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y,i=this.z-e.z;return n*n+r*r+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,n,r){const i=Math.sin(n)*e;return this.x=i*Math.sin(r),this.y=Math.cos(n)*e,this.z=i*Math.cos(r),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,n,r){return this.x=e*Math.sin(n),this.y=r,this.z=e*Math.cos(n),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(e){const n=this.setFromMatrixColumn(e,0).length(),r=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=n,this.y=r,this.z=i,this}setFromMatrixColumn(e,n){return this.fromArray(e.elements,n*4)}setFromMatrix3Column(e,n){return this.fromArray(e.elements,n*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,n=Math.random()*2-1,r=Math.sqrt(1-n*n);return this.x=r*Math.cos(e),this.y=n,this.z=r*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const W_=new ne,XN=new Ii;class Rt{constructor(e,n,r,i,o,a,s,l,c){Rt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,n,r,i,o,a,s,l,c)}set(e,n,r,i,o,a,s,l,c){const u=this.elements;return u[0]=e,u[1]=i,u[2]=s,u[3]=n,u[4]=o,u[5]=l,u[6]=r,u[7]=a,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const n=this.elements,r=e.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],this}extractBasis(e,n,r){return e.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const n=e.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const r=e.elements,i=n.elements,o=this.elements,a=r[0],s=r[3],l=r[6],c=r[1],u=r[4],d=r[7],f=r[2],p=r[5],y=r[8],v=i[0],g=i[3],m=i[6],x=i[1],b=i[4],S=i[7],w=i[2],E=i[5],T=i[8];return o[0]=a*v+s*x+l*w,o[3]=a*g+s*b+l*E,o[6]=a*m+s*S+l*T,o[1]=c*v+u*x+d*w,o[4]=c*g+u*b+d*E,o[7]=c*m+u*S+d*T,o[2]=f*v+p*x+y*w,o[5]=f*g+p*b+y*E,o[8]=f*m+p*S+y*T,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=e,n[4]*=e,n[7]*=e,n[2]*=e,n[5]*=e,n[8]*=e,this}determinant(){const e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],u=e[8];return n*a*u-n*s*c-r*o*u+r*s*l+i*o*c-i*a*l}invert(){const e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],u=e[8],d=u*a-s*c,f=s*l-u*o,p=c*o-a*l,y=n*d+r*f+i*p;if(y===0)return this.set(0,0,0,0,0,0,0,0,0);const v=1/y;return e[0]=d*v,e[1]=(i*c-u*r)*v,e[2]=(s*r-i*a)*v,e[3]=f*v,e[4]=(u*n-i*l)*v,e[5]=(i*o-s*n)*v,e[6]=p*v,e[7]=(r*l-c*n)*v,e[8]=(a*n-r*o)*v,this}transpose(){let e;const n=this.elements;return e=n[1],n[1]=n[3],n[3]=e,e=n[2],n[2]=n[6],n[6]=e,e=n[5],n[5]=n[7],n[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const n=this.elements;return e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],this}setUvTransform(e,n,r,i,o,a,s){const l=Math.cos(o),c=Math.sin(o);return this.set(r*l,r*c,-r*(l*a+c*s)+a+e,-i*c,i*l,-i*(-c*a+l*s)+s+n,0,0,1),this}scale(e,n){return this.premultiply(X_.makeScale(e,n)),this}rotate(e){return this.premultiply(X_.makeRotation(-e)),this}translate(e,n){return this.premultiply(X_.makeTranslation(e,n)),this}makeTranslation(e,n){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,n,0,0,1),this}makeRotation(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,-r,0,r,n,0,0,0,1),this}makeScale(e,n){return this.set(e,0,0,0,n,0,0,0,1),this}equals(e){const n=this.elements,r=e.elements;for(let i=0;i<9;i++)if(n[i]!==r[i])return!1;return!0}fromArray(e,n=0){for(let r=0;r<9;r++)this.elements[r]=e[r+n];return this}toArray(e=[],n=0){const r=this.elements;return e[n]=r[0],e[n+1]=r[1],e[n+2]=r[2],e[n+3]=r[3],e[n+4]=r[4],e[n+5]=r[5],e[n+6]=r[6],e[n+7]=r[7],e[n+8]=r[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const X_=new Rt;function D4(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}function Rp(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function ZQ(){const t=Rp("canvas");return t.style.display="block",t}const qN={};function ld(t){t in qN||(qN[t]=!0,console.warn(t))}function QQ(t,e,n){return new Promise(function(r,i){function o(){switch(t.clientWaitSync(e,t.SYNC_FLUSH_COMMANDS_BIT,0)){case t.WAIT_FAILED:i();break;case t.TIMEOUT_EXPIRED:setTimeout(o,n);break;default:r()}}setTimeout(o,n)})}function eee(t){const e=t.elements;e[2]=.5*e[2]+.5*e[3],e[6]=.5*e[6]+.5*e[7],e[10]=.5*e[10]+.5*e[11],e[14]=.5*e[14]+.5*e[15]}function tee(t){const e=t.elements;e[11]===-1?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=-e[14]+1)}const KN=new Rt().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),YN=new Rt().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function nee(){const t={enabled:!0,workingColorSpace:Kr,spaces:{},convert:function(i,o,a){return this.enabled===!1||o===a||!o||!a||(this.spaces[o].transfer===an&&(i.r=Ja(i.r),i.g=Ja(i.g),i.b=Ja(i.b)),this.spaces[o].primaries!==this.spaces[a].primaries&&(i.applyMatrix3(this.spaces[o].toXYZ),i.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===an&&(i.r=cd(i.r),i.g=cd(i.g),i.b=cd(i.b))),i},workingToColorSpace:function(i,o){return this.convert(i,this.workingColorSpace,o)},colorSpaceToWorking:function(i,o){return this.convert(i,o,this.workingColorSpace)},getPrimaries:function(i){return this.spaces[i].primaries},getTransfer:function(i){return i===Ds?Ry:this.spaces[i].transfer},getLuminanceCoefficients:function(i,o=this.workingColorSpace){return i.fromArray(this.spaces[o].luminanceCoefficients)},define:function(i){Object.assign(this.spaces,i)},_getMatrix:function(i,o,a){return i.copy(this.spaces[o].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(i){return this.spaces[i].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(i=this.workingColorSpace){return this.spaces[i].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(i,o){return ld("THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),t.workingToColorSpace(i,o)},toWorkingColorSpace:function(i,o){return ld("THREE.ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),t.colorSpaceToWorking(i,o)}},e=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],r=[.3127,.329];return t.define({[Kr]:{primaries:e,whitePoint:r,transfer:Ry,toXYZ:KN,fromXYZ:YN,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:Zt},outputColorSpaceConfig:{drawingBufferColorSpace:Zt}},[Zt]:{primaries:e,whitePoint:r,transfer:an,toXYZ:KN,fromXYZ:YN,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:Zt}}}),t}const Dt=nee();function Ja(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function cd(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}let su;class ree{static getDataURL(e,n="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let r;if(e instanceof HTMLCanvasElement)r=e;else{su===void 0&&(su=Rp("canvas")),su.width=e.width,su.height=e.height;const i=su.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),r=su}return r.toDataURL(n)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const n=Rp("canvas");n.width=e.width,n.height=e.height;const r=n.getContext("2d");r.drawImage(e,0,0,e.width,e.height);const i=r.getImageData(0,0,e.width,e.height),o=i.data;for(let a=0;a1),this.pmremVersion=0}get width(){return this.source.getSize(K_).x}get height(){return this.source.getSize(K_).y}get depth(){return this.source.getSize(K_).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const n in e){const r=e[n];if(r===void 0){console.warn(`THREE.Texture.setValues(): parameter '${n}' has value of undefined.`);continue}const i=this[n];if(i===void 0){console.warn(`THREE.Texture.setValues(): property '${n}' does not exist.`);continue}i&&r&&i.isVector2&&r.isVector2||i&&r&&i.isVector3&&r.isVector3||i&&r&&i.isMatrix3&&r.isMatrix3?i.copy(r):this[n]=r}}toJSON(e){const n=e===void 0||typeof e=="string";if(!n&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const r={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(r.userData=this.userData),n||(e.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==S4)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case ca:e.x=e.x-Math.floor(e.x);break;case Ji:e.x=e.x<0?0:1;break;case Py:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case ca:e.y=e.y-Math.floor(e.y);break;case Ji:e.y=e.y<0?0:1;break;case Py:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}lr.DEFAULT_IMAGE=null;lr.DEFAULT_MAPPING=S4;lr.DEFAULT_ANISOTROPY=1;class Yt{constructor(e=0,n=0,r=0,i=1){Yt.prototype.isVector4=!0,this.x=e,this.y=n,this.z=r,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,n,r,i){return this.x=e,this.y=n,this.z=r,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this.w=e.w+n.w,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this.w+=e.w*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this.w=e.w-n.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const n=this.x,r=this.y,i=this.z,o=this.w,a=e.elements;return this.x=a[0]*n+a[4]*r+a[8]*i+a[12]*o,this.y=a[1]*n+a[5]*r+a[9]*i+a[13]*o,this.z=a[2]*n+a[6]*r+a[10]*i+a[14]*o,this.w=a[3]*n+a[7]*r+a[11]*i+a[15]*o,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const n=Math.sqrt(1-e.w*e.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/n,this.y=e.y/n,this.z=e.z/n),this}setAxisAngleFromRotationMatrix(e){let n,r,i,o;const l=e.elements,c=l[0],u=l[4],d=l[8],f=l[1],p=l[5],y=l[9],v=l[2],g=l[6],m=l[10];if(Math.abs(u-f)<.01&&Math.abs(d-v)<.01&&Math.abs(y-g)<.01){if(Math.abs(u+f)<.1&&Math.abs(d+v)<.1&&Math.abs(y+g)<.1&&Math.abs(c+p+m-3)<.1)return this.set(1,0,0,0),this;n=Math.PI;const b=(c+1)/2,S=(p+1)/2,w=(m+1)/2,E=(u+f)/4,T=(d+v)/4,A=(y+g)/4;return b>S&&b>w?b<.01?(r=0,i=.707106781,o=.707106781):(r=Math.sqrt(b),i=E/r,o=T/r):S>w?S<.01?(r=.707106781,i=0,o=.707106781):(i=Math.sqrt(S),r=E/i,o=A/i):w<.01?(r=.707106781,i=.707106781,o=0):(o=Math.sqrt(w),r=T/o,i=A/o),this.set(r,i,o,n),this}let x=Math.sqrt((g-y)*(g-y)+(d-v)*(d-v)+(f-u)*(f-u));return Math.abs(x)<.001&&(x=1),this.x=(g-y)/x,this.y=(d-v)/x,this.z=(f-u)/x,this.w=Math.acos((c+p+m-1)/2),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this.w=n[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,n){return this.x=It(this.x,e.x,n.x),this.y=It(this.y,e.y,n.y),this.z=It(this.z,e.z,n.z),this.w=It(this.w,e.w,n.w),this}clampScalar(e,n){return this.x=It(this.x,e,n),this.y=It(this.y,e,n),this.z=It(this.z,e,n),this.w=It(this.w,e,n),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(It(r,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this.w+=(e.w-this.w)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this.z=e.z+(n.z-e.z)*r,this.w=e.w+(n.w-e.w)*r,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this.w=e[n+3],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e[n+3]=this.w,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this.w=e.getW(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class aee extends Vc{constructor(e=1,n=1,r={}){super(),r=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Or,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},r),this.isRenderTarget=!0,this.width=e,this.height=n,this.depth=r.depth,this.scissor=new Yt(0,0,e,n),this.scissorTest=!1,this.viewport=new Yt(0,0,e,n);const i={width:e,height:n,depth:r.depth},o=new lr(i);this.textures=[];const a=r.count;for(let s=0;s1;this.dispose()}this.viewport.set(0,0,e,n),this.scissor.set(0,0,e,n)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let n=0,r=e.textures.length;n=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,n){return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,fo),fo.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let n,r;return e.normal.x>0?(n=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(n=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(n+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(n+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(n+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(n+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),n<=-e.constant&&r>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(nh),Pg.subVectors(this.max,nh),lu.subVectors(e.a,nh),cu.subVectors(e.b,nh),uu.subVectors(e.c,nh),xs.subVectors(cu,lu),bs.subVectors(uu,cu),Il.subVectors(lu,uu);let n=[0,-xs.z,xs.y,0,-bs.z,bs.y,0,-Il.z,Il.y,xs.z,0,-xs.x,bs.z,0,-bs.x,Il.z,0,-Il.x,-xs.y,xs.x,0,-bs.y,bs.x,0,-Il.y,Il.x,0];return!Y_(n,lu,cu,uu,Pg)||(n=[1,0,0,0,1,0,0,0,1],!Y_(n,lu,cu,uu,Pg))?!1:(Rg.crossVectors(xs,bs),n=[Rg.x,Rg.y,Rg.z],Y_(n,lu,cu,uu,Pg))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,fo).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(fo).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Pa[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Pa[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Pa[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Pa[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Pa[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Pa[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Pa[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Pa[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Pa),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const Pa=[new ne,new ne,new ne,new ne,new ne,new ne,new ne,new ne],fo=new ne,Cg=new Wo,lu=new ne,cu=new ne,uu=new ne,xs=new ne,bs=new ne,Il=new ne,nh=new ne,Pg=new ne,Rg=new ne,Dl=new ne;function Y_(t,e,n,r,i){for(let o=0,a=t.length-3;o<=a;o+=3){Dl.fromArray(t,o);const s=i.x*Math.abs(Dl.x)+i.y*Math.abs(Dl.y)+i.z*Math.abs(Dl.z),l=e.dot(Dl),c=n.dot(Dl),u=r.dot(Dl);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>s)return!1}return!0}const lee=new Wo,rh=new ne,J_=new ne;class Xo{constructor(e=new ne,n=-1){this.isSphere=!0,this.center=e,this.radius=n}set(e,n){return this.center.copy(e),this.radius=n,this}setFromPoints(e,n){const r=this.center;n!==void 0?r.copy(n):lee.setFromPoints(e).getCenter(r);let i=0;for(let o=0,a=e.length;othis.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;rh.subVectors(e,this.center);const n=rh.lengthSq();if(n>this.radius*this.radius){const r=Math.sqrt(n),i=(r-this.radius)*.5;this.center.addScaledVector(rh,i/r),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(J_.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(rh.copy(e.center).add(J_)),this.expandByPoint(rh.copy(e.center).sub(J_))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}const Ra=new ne,Z_=new ne,Ng=new ne,_s=new ne,Q_=new ne,Og=new ne,ew=new ne;class Sf{constructor(e=new ne,n=new ne(0,0,-1)){this.origin=e,this.direction=n}set(e,n){return this.origin.copy(e),this.direction.copy(n),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,n){return n.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Ra)),this}closestPointToPoint(e,n){n.subVectors(e,this.origin);const r=n.dot(this.direction);return r<0?n.copy(this.origin):n.copy(this.origin).addScaledVector(this.direction,r)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const n=Ra.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(Ra.copy(this.origin).addScaledVector(this.direction,n),Ra.distanceToSquared(e))}distanceSqToSegment(e,n,r,i){Z_.copy(e).add(n).multiplyScalar(.5),Ng.copy(n).sub(e).normalize(),_s.copy(this.origin).sub(Z_);const o=e.distanceTo(n)*.5,a=-this.direction.dot(Ng),s=_s.dot(this.direction),l=-_s.dot(Ng),c=_s.lengthSq(),u=Math.abs(1-a*a);let d,f,p,y;if(u>0)if(d=a*l-s,f=a*s-l,y=o*u,d>=0)if(f>=-y)if(f<=y){const v=1/u;d*=v,f*=v,p=d*(d+a*f+2*s)+f*(a*d+f+2*l)+c}else f=o,d=Math.max(0,-(a*f+s)),p=-d*d+f*(f+2*l)+c;else f=-o,d=Math.max(0,-(a*f+s)),p=-d*d+f*(f+2*l)+c;else f<=-y?(d=Math.max(0,-(-a*o+s)),f=d>0?-o:Math.min(Math.max(-o,-l),o),p=-d*d+f*(f+2*l)+c):f<=y?(d=0,f=Math.min(Math.max(-o,-l),o),p=f*(f+2*l)+c):(d=Math.max(0,-(a*o+s)),f=d>0?o:Math.min(Math.max(-o,-l),o),p=-d*d+f*(f+2*l)+c);else f=a>0?-o:o,d=Math.max(0,-(a*f+s)),p=-d*d+f*(f+2*l)+c;return r&&r.copy(this.origin).addScaledVector(this.direction,d),i&&i.copy(Z_).addScaledVector(Ng,f),p}intersectSphere(e,n){Ra.subVectors(e.center,this.origin);const r=Ra.dot(this.direction),i=Ra.dot(Ra)-r*r,o=e.radius*e.radius;if(i>o)return null;const a=Math.sqrt(o-i),s=r-a,l=r+a;return l<0?null:s<0?this.at(l,n):this.at(s,n)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const n=e.normal.dot(this.direction);if(n===0)return e.distanceToPoint(this.origin)===0?0:null;const r=-(this.origin.dot(e.normal)+e.constant)/n;return r>=0?r:null}intersectPlane(e,n){const r=this.distanceToPlane(e);return r===null?null:this.at(r,n)}intersectsPlane(e){const n=e.distanceToPoint(this.origin);return n===0||e.normal.dot(this.direction)*n<0}intersectBox(e,n){let r,i,o,a,s,l;const c=1/this.direction.x,u=1/this.direction.y,d=1/this.direction.z,f=this.origin;return c>=0?(r=(e.min.x-f.x)*c,i=(e.max.x-f.x)*c):(r=(e.max.x-f.x)*c,i=(e.min.x-f.x)*c),u>=0?(o=(e.min.y-f.y)*u,a=(e.max.y-f.y)*u):(o=(e.max.y-f.y)*u,a=(e.min.y-f.y)*u),r>a||o>i||((o>r||isNaN(r))&&(r=o),(a=0?(s=(e.min.z-f.z)*d,l=(e.max.z-f.z)*d):(s=(e.max.z-f.z)*d,l=(e.min.z-f.z)*d),r>l||s>i)||((s>r||r!==r)&&(r=s),(l=0?r:i,n)}intersectsBox(e){return this.intersectBox(e,Ra)!==null}intersectTriangle(e,n,r,i,o){Q_.subVectors(n,e),Og.subVectors(r,e),ew.crossVectors(Q_,Og);let a=this.direction.dot(ew),s;if(a>0){if(i)return null;s=1}else if(a<0)s=-1,a=-a;else return null;_s.subVectors(this.origin,e);const l=s*this.direction.dot(Og.crossVectors(_s,Og));if(l<0)return null;const c=s*this.direction.dot(Q_.cross(_s));if(c<0||l+c>a)return null;const u=-s*_s.dot(ew);return u<0?null:this.at(u/a,o)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class gt{constructor(e,n,r,i,o,a,s,l,c,u,d,f,p,y,v,g){gt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,n,r,i,o,a,s,l,c,u,d,f,p,y,v,g)}set(e,n,r,i,o,a,s,l,c,u,d,f,p,y,v,g){const m=this.elements;return m[0]=e,m[4]=n,m[8]=r,m[12]=i,m[1]=o,m[5]=a,m[9]=s,m[13]=l,m[2]=c,m[6]=u,m[10]=d,m[14]=f,m[3]=p,m[7]=y,m[11]=v,m[15]=g,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new gt().fromArray(this.elements)}copy(e){const n=this.elements,r=e.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],n[9]=r[9],n[10]=r[10],n[11]=r[11],n[12]=r[12],n[13]=r[13],n[14]=r[14],n[15]=r[15],this}copyPosition(e){const n=this.elements,r=e.elements;return n[12]=r[12],n[13]=r[13],n[14]=r[14],this}setFromMatrix3(e){const n=e.elements;return this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1),this}extractBasis(e,n,r){return e.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}makeBasis(e,n,r){return this.set(e.x,n.x,r.x,0,e.y,n.y,r.y,0,e.z,n.z,r.z,0,0,0,0,1),this}extractRotation(e){const n=this.elements,r=e.elements,i=1/du.setFromMatrixColumn(e,0).length(),o=1/du.setFromMatrixColumn(e,1).length(),a=1/du.setFromMatrixColumn(e,2).length();return n[0]=r[0]*i,n[1]=r[1]*i,n[2]=r[2]*i,n[3]=0,n[4]=r[4]*o,n[5]=r[5]*o,n[6]=r[6]*o,n[7]=0,n[8]=r[8]*a,n[9]=r[9]*a,n[10]=r[10]*a,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromEuler(e){const n=this.elements,r=e.x,i=e.y,o=e.z,a=Math.cos(r),s=Math.sin(r),l=Math.cos(i),c=Math.sin(i),u=Math.cos(o),d=Math.sin(o);if(e.order==="XYZ"){const f=a*u,p=a*d,y=s*u,v=s*d;n[0]=l*u,n[4]=-l*d,n[8]=c,n[1]=p+y*c,n[5]=f-v*c,n[9]=-s*l,n[2]=v-f*c,n[6]=y+p*c,n[10]=a*l}else if(e.order==="YXZ"){const f=l*u,p=l*d,y=c*u,v=c*d;n[0]=f+v*s,n[4]=y*s-p,n[8]=a*c,n[1]=a*d,n[5]=a*u,n[9]=-s,n[2]=p*s-y,n[6]=v+f*s,n[10]=a*l}else if(e.order==="ZXY"){const f=l*u,p=l*d,y=c*u,v=c*d;n[0]=f-v*s,n[4]=-a*d,n[8]=y+p*s,n[1]=p+y*s,n[5]=a*u,n[9]=v-f*s,n[2]=-a*c,n[6]=s,n[10]=a*l}else if(e.order==="ZYX"){const f=a*u,p=a*d,y=s*u,v=s*d;n[0]=l*u,n[4]=y*c-p,n[8]=f*c+v,n[1]=l*d,n[5]=v*c+f,n[9]=p*c-y,n[2]=-c,n[6]=s*l,n[10]=a*l}else if(e.order==="YZX"){const f=a*l,p=a*c,y=s*l,v=s*c;n[0]=l*u,n[4]=v-f*d,n[8]=y*d+p,n[1]=d,n[5]=a*u,n[9]=-s*u,n[2]=-c*u,n[6]=p*d+y,n[10]=f-v*d}else if(e.order==="XZY"){const f=a*l,p=a*c,y=s*l,v=s*c;n[0]=l*u,n[4]=-d,n[8]=c*u,n[1]=f*d+v,n[5]=a*u,n[9]=p*d-y,n[2]=y*d-p,n[6]=s*u,n[10]=v*d+f}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromQuaternion(e){return this.compose(cee,e,uee)}lookAt(e,n,r){const i=this.elements;return xi.subVectors(e,n),xi.lengthSq()===0&&(xi.z=1),xi.normalize(),ws.crossVectors(r,xi),ws.lengthSq()===0&&(Math.abs(r.z)===1?xi.x+=1e-4:xi.z+=1e-4,xi.normalize(),ws.crossVectors(r,xi)),ws.normalize(),Ig.crossVectors(xi,ws),i[0]=ws.x,i[4]=Ig.x,i[8]=xi.x,i[1]=ws.y,i[5]=Ig.y,i[9]=xi.y,i[2]=ws.z,i[6]=Ig.z,i[10]=xi.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const r=e.elements,i=n.elements,o=this.elements,a=r[0],s=r[4],l=r[8],c=r[12],u=r[1],d=r[5],f=r[9],p=r[13],y=r[2],v=r[6],g=r[10],m=r[14],x=r[3],b=r[7],S=r[11],w=r[15],E=i[0],T=i[4],A=i[8],M=i[12],C=i[1],P=i[5],R=i[9],D=i[13],k=i[2],U=i[6],O=i[10],W=i[14],L=i[3],j=i[7],X=i[11],K=i[15];return o[0]=a*E+s*C+l*k+c*L,o[4]=a*T+s*P+l*U+c*j,o[8]=a*A+s*R+l*O+c*X,o[12]=a*M+s*D+l*W+c*K,o[1]=u*E+d*C+f*k+p*L,o[5]=u*T+d*P+f*U+p*j,o[9]=u*A+d*R+f*O+p*X,o[13]=u*M+d*D+f*W+p*K,o[2]=y*E+v*C+g*k+m*L,o[6]=y*T+v*P+g*U+m*j,o[10]=y*A+v*R+g*O+m*X,o[14]=y*M+v*D+g*W+m*K,o[3]=x*E+b*C+S*k+w*L,o[7]=x*T+b*P+S*U+w*j,o[11]=x*A+b*R+S*O+w*X,o[15]=x*M+b*D+S*W+w*K,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[4]*=e,n[8]*=e,n[12]*=e,n[1]*=e,n[5]*=e,n[9]*=e,n[13]*=e,n[2]*=e,n[6]*=e,n[10]*=e,n[14]*=e,n[3]*=e,n[7]*=e,n[11]*=e,n[15]*=e,this}determinant(){const e=this.elements,n=e[0],r=e[4],i=e[8],o=e[12],a=e[1],s=e[5],l=e[9],c=e[13],u=e[2],d=e[6],f=e[10],p=e[14],y=e[3],v=e[7],g=e[11],m=e[15];return y*(+o*l*d-i*c*d-o*s*f+r*c*f+i*s*p-r*l*p)+v*(+n*l*p-n*c*f+o*a*f-i*a*p+i*c*u-o*l*u)+g*(+n*c*d-n*s*p-o*a*d+r*a*p+o*s*u-r*c*u)+m*(-i*s*u-n*l*d+n*s*f+i*a*d-r*a*f+r*l*u)}transpose(){const e=this.elements;let n;return n=e[1],e[1]=e[4],e[4]=n,n=e[2],e[2]=e[8],e[8]=n,n=e[6],e[6]=e[9],e[9]=n,n=e[3],e[3]=e[12],e[12]=n,n=e[7],e[7]=e[13],e[13]=n,n=e[11],e[11]=e[14],e[14]=n,this}setPosition(e,n,r){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=n,i[14]=r),this}invert(){const e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],u=e[8],d=e[9],f=e[10],p=e[11],y=e[12],v=e[13],g=e[14],m=e[15],x=d*g*c-v*f*c+v*l*p-s*g*p-d*l*m+s*f*m,b=y*f*c-u*g*c-y*l*p+a*g*p+u*l*m-a*f*m,S=u*v*c-y*d*c+y*s*p-a*v*p-u*s*m+a*d*m,w=y*d*l-u*v*l-y*s*f+a*v*f+u*s*g-a*d*g,E=n*x+r*b+i*S+o*w;if(E===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const T=1/E;return e[0]=x*T,e[1]=(v*f*o-d*g*o-v*i*p+r*g*p+d*i*m-r*f*m)*T,e[2]=(s*g*o-v*l*o+v*i*c-r*g*c-s*i*m+r*l*m)*T,e[3]=(d*l*o-s*f*o-d*i*c+r*f*c+s*i*p-r*l*p)*T,e[4]=b*T,e[5]=(u*g*o-y*f*o+y*i*p-n*g*p-u*i*m+n*f*m)*T,e[6]=(y*l*o-a*g*o-y*i*c+n*g*c+a*i*m-n*l*m)*T,e[7]=(a*f*o-u*l*o+u*i*c-n*f*c-a*i*p+n*l*p)*T,e[8]=S*T,e[9]=(y*d*o-u*v*o-y*r*p+n*v*p+u*r*m-n*d*m)*T,e[10]=(a*v*o-y*s*o+y*r*c-n*v*c-a*r*m+n*s*m)*T,e[11]=(u*s*o-a*d*o-u*r*c+n*d*c+a*r*p-n*s*p)*T,e[12]=w*T,e[13]=(u*v*i-y*d*i+y*r*f-n*v*f-u*r*g+n*d*g)*T,e[14]=(y*s*i-a*v*i-y*r*l+n*v*l+a*r*g-n*s*g)*T,e[15]=(a*d*i-u*s*i+u*r*l-n*d*l-a*r*f+n*s*f)*T,this}scale(e){const n=this.elements,r=e.x,i=e.y,o=e.z;return n[0]*=r,n[4]*=i,n[8]*=o,n[1]*=r,n[5]*=i,n[9]*=o,n[2]*=r,n[6]*=i,n[10]*=o,n[3]*=r,n[7]*=i,n[11]*=o,this}getMaxScaleOnAxis(){const e=this.elements,n=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(n,r,i))}makeTranslation(e,n,r){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,n,0,0,1,r,0,0,0,1),this}makeRotationX(e){const n=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,n,-r,0,0,r,n,0,0,0,0,1),this}makeRotationY(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,0,r,0,0,1,0,0,-r,0,n,0,0,0,0,1),this}makeRotationZ(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,-r,0,0,r,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,n){const r=Math.cos(n),i=Math.sin(n),o=1-r,a=e.x,s=e.y,l=e.z,c=o*a,u=o*s;return this.set(c*a+r,c*s-i*l,c*l+i*s,0,c*s+i*l,u*s+r,u*l-i*a,0,c*l-i*s,u*l+i*a,o*l*l+r,0,0,0,0,1),this}makeScale(e,n,r){return this.set(e,0,0,0,0,n,0,0,0,0,r,0,0,0,0,1),this}makeShear(e,n,r,i,o,a){return this.set(1,r,o,0,e,1,a,0,n,i,1,0,0,0,0,1),this}compose(e,n,r){const i=this.elements,o=n._x,a=n._y,s=n._z,l=n._w,c=o+o,u=a+a,d=s+s,f=o*c,p=o*u,y=o*d,v=a*u,g=a*d,m=s*d,x=l*c,b=l*u,S=l*d,w=r.x,E=r.y,T=r.z;return i[0]=(1-(v+m))*w,i[1]=(p+S)*w,i[2]=(y-b)*w,i[3]=0,i[4]=(p-S)*E,i[5]=(1-(f+m))*E,i[6]=(g+x)*E,i[7]=0,i[8]=(y+b)*T,i[9]=(g-x)*T,i[10]=(1-(f+v))*T,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,n,r){const i=this.elements;let o=du.set(i[0],i[1],i[2]).length();const a=du.set(i[4],i[5],i[6]).length(),s=du.set(i[8],i[9],i[10]).length();this.determinant()<0&&(o=-o),e.x=i[12],e.y=i[13],e.z=i[14],ho.copy(this);const c=1/o,u=1/a,d=1/s;return ho.elements[0]*=c,ho.elements[1]*=c,ho.elements[2]*=c,ho.elements[4]*=u,ho.elements[5]*=u,ho.elements[6]*=u,ho.elements[8]*=d,ho.elements[9]*=d,ho.elements[10]*=d,n.setFromRotationMatrix(ho),r.x=o,r.y=a,r.z=s,this}makePerspective(e,n,r,i,o,a,s=Xa){const l=this.elements,c=2*o/(n-e),u=2*o/(r-i),d=(n+e)/(n-e),f=(r+i)/(r-i);let p,y;if(s===Xa)p=-(a+o)/(a-o),y=-2*a*o/(a-o);else if(s===Ny)p=-a/(a-o),y=-a*o/(a-o);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+s);return l[0]=c,l[4]=0,l[8]=d,l[12]=0,l[1]=0,l[5]=u,l[9]=f,l[13]=0,l[2]=0,l[6]=0,l[10]=p,l[14]=y,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,n,r,i,o,a,s=Xa){const l=this.elements,c=1/(n-e),u=1/(r-i),d=1/(a-o),f=(n+e)*c,p=(r+i)*u;let y,v;if(s===Xa)y=(a+o)*d,v=-2*d;else if(s===Ny)y=o*d,v=-1*d;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+s);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-f,l[1]=0,l[5]=2*u,l[9]=0,l[13]=-p,l[2]=0,l[6]=0,l[10]=v,l[14]=-y,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const n=this.elements,r=e.elements;for(let i=0;i<16;i++)if(n[i]!==r[i])return!1;return!0}fromArray(e,n=0){for(let r=0;r<16;r++)this.elements[r]=e[r+n];return this}toArray(e=[],n=0){const r=this.elements;return e[n]=r[0],e[n+1]=r[1],e[n+2]=r[2],e[n+3]=r[3],e[n+4]=r[4],e[n+5]=r[5],e[n+6]=r[6],e[n+7]=r[7],e[n+8]=r[8],e[n+9]=r[9],e[n+10]=r[10],e[n+11]=r[11],e[n+12]=r[12],e[n+13]=r[13],e[n+14]=r[14],e[n+15]=r[15],e}}const du=new ne,ho=new gt,cee=new ne(0,0,0),uee=new ne(1,1,1),ws=new ne,Ig=new ne,xi=new ne,JN=new gt,ZN=new Ii;class pi{constructor(e=0,n=0,r=0,i=pi.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=n,this._z=r,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,n,r,i=this._order){return this._x=e,this._y=n,this._z=r,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,n=this._order,r=!0){const i=e.elements,o=i[0],a=i[4],s=i[8],l=i[1],c=i[5],u=i[9],d=i[2],f=i[6],p=i[10];switch(n){case"XYZ":this._y=Math.asin(It(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-u,p),this._z=Math.atan2(-a,o)):(this._x=Math.atan2(f,c),this._z=0);break;case"YXZ":this._x=Math.asin(-It(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(s,p),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-d,o),this._z=0);break;case"ZXY":this._x=Math.asin(It(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-d,p),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,o));break;case"ZYX":this._y=Math.asin(-It(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(f,p),this._z=Math.atan2(l,o)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(It(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-d,o)):(this._x=0,this._y=Math.atan2(s,p));break;case"XZY":this._z=Math.asin(-It(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(f,c),this._y=Math.atan2(s,o)):(this._x=Math.atan2(-u,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,r===!0&&this._onChangeCallback(),this}setFromQuaternion(e,n,r){return JN.makeRotationFromQuaternion(e),this.setFromRotationMatrix(JN,n,r)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return ZN.setFromEuler(this),this.setFromQuaternion(ZN,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}pi.DEFAULT_ORDER="XYZ";class ZA{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let n=0;n1){for(let r=0;r0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.geometryInfo=this._geometryInfo.map(s=>({...s,boundingBox:s.boundingBox?s.boundingBox.toJSON():void 0,boundingSphere:s.boundingSphere?s.boundingSphere.toJSON():void 0})),i.instanceInfo=this._instanceInfo.map(s=>({...s})),i.availableInstanceIds=this._availableInstanceIds.slice(),i.availableGeometryIds=this._availableGeometryIds.slice(),i.nextIndexStart=this._nextIndexStart,i.nextVertexStart=this._nextVertexStart,i.geometryCount=this._geometryCount,i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.matricesTexture=this._matricesTexture.toJSON(e),i.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(i.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(i.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(i.boundingBox=this.boundingBox.toJSON()));function o(s,l){return s[l.uuid]===void 0&&(s[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=o(e.geometries,this.geometry);const s=this.geometry.parameters;if(s!==void 0&&s.shapes!==void 0){const l=s.shapes;if(Array.isArray(l))for(let c=0,u=l.length;c0){i.children=[];for(let s=0;s0){i.animations=[];for(let s=0;s0&&(r.geometries=s),l.length>0&&(r.materials=l),c.length>0&&(r.textures=c),u.length>0&&(r.images=u),d.length>0&&(r.shapes=d),f.length>0&&(r.skeletons=f),p.length>0&&(r.animations=p),y.length>0&&(r.nodes=y)}return r.object=i,r;function a(s){const l=[];for(const c in s){const u=s[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,n=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),n===!0)for(let r=0;r0?i.multiplyScalar(1/Math.sqrt(o)):i.set(0,0,0)}static getBarycoord(e,n,r,i,o){po.subVectors(i,n),Oa.subVectors(r,n),nw.subVectors(e,n);const a=po.dot(po),s=po.dot(Oa),l=po.dot(nw),c=Oa.dot(Oa),u=Oa.dot(nw),d=a*c-s*s;if(d===0)return o.set(0,0,0),null;const f=1/d,p=(c*l-s*u)*f,y=(a*u-s*l)*f;return o.set(1-p-y,y,p)}static containsPoint(e,n,r,i){return this.getBarycoord(e,n,r,i,Ia)===null?!1:Ia.x>=0&&Ia.y>=0&&Ia.x+Ia.y<=1}static getInterpolation(e,n,r,i,o,a,s,l){return this.getBarycoord(e,n,r,i,Ia)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(o,Ia.x),l.addScaledVector(a,Ia.y),l.addScaledVector(s,Ia.z),l)}static getInterpolatedAttribute(e,n,r,i,o,a){return aw.setScalar(0),sw.setScalar(0),lw.setScalar(0),aw.fromBufferAttribute(e,n),sw.fromBufferAttribute(e,r),lw.fromBufferAttribute(e,i),a.setScalar(0),a.addScaledVector(aw,o.x),a.addScaledVector(sw,o.y),a.addScaledVector(lw,o.z),a}static isFrontFacing(e,n,r,i){return po.subVectors(r,n),Oa.subVectors(e,n),po.cross(Oa).dot(i)<0}set(e,n,r){return this.a.copy(e),this.b.copy(n),this.c.copy(r),this}setFromPointsAndIndices(e,n,r,i){return this.a.copy(e[n]),this.b.copy(e[r]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,n,r,i){return this.a.fromBufferAttribute(e,n),this.b.fromBufferAttribute(e,r),this.c.fromBufferAttribute(e,i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return po.subVectors(this.c,this.b),Oa.subVectors(this.a,this.b),po.cross(Oa).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Ro.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return Ro.getBarycoord(e,this.a,this.b,this.c,n)}getInterpolation(e,n,r,i,o){return Ro.getInterpolation(e,this.a,this.b,this.c,n,r,i,o)}containsPoint(e){return Ro.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Ro.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,n){const r=this.a,i=this.b,o=this.c;let a,s;pu.subVectors(i,r),mu.subVectors(o,r),rw.subVectors(e,r);const l=pu.dot(rw),c=mu.dot(rw);if(l<=0&&c<=0)return n.copy(r);iw.subVectors(e,i);const u=pu.dot(iw),d=mu.dot(iw);if(u>=0&&d<=u)return n.copy(i);const f=l*d-u*c;if(f<=0&&l>=0&&u<=0)return a=l/(l-u),n.copy(r).addScaledVector(pu,a);ow.subVectors(e,o);const p=pu.dot(ow),y=mu.dot(ow);if(y>=0&&p<=y)return n.copy(o);const v=p*c-l*y;if(v<=0&&c>=0&&y<=0)return s=c/(c-y),n.copy(r).addScaledVector(mu,s);const g=u*y-p*d;if(g<=0&&d-u>=0&&p-y>=0)return iO.subVectors(o,i),s=(d-u)/(d-u+(p-y)),n.copy(i).addScaledVector(iO,s);const m=1/(g+v+f);return a=v*m,s=f*m,n.copy(r).addScaledVector(pu,a).addScaledVector(mu,s)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const k4={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ss={h:0,s:0,l:0},Lg={h:0,s:0,l:0};function cw(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*6*(2/3-n):t}let ft=class{constructor(e,n,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,n,r)}set(e,n,r){if(n===void 0&&r===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,n,r);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,n=Zt){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Dt.colorSpaceToWorking(this,n),this}setRGB(e,n,r,i=Dt.workingColorSpace){return this.r=e,this.g=n,this.b=r,Dt.colorSpaceToWorking(this,i),this}setHSL(e,n,r,i=Dt.workingColorSpace){if(e=YA(e,1),n=It(n,0,1),r=It(r,0,1),n===0)this.r=this.g=this.b=r;else{const o=r<=.5?r*(1+n):r+n-r*n,a=2*r-o;this.r=cw(a,o,e+1/3),this.g=cw(a,o,e),this.b=cw(a,o,e-1/3)}return Dt.colorSpaceToWorking(this,i),this}setStyle(e,n=Zt){function r(o){o!==void 0&&parseFloat(o)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let o;const a=i[1],s=i[2];switch(a){case"rgb":case"rgba":if(o=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return r(o[4]),this.setRGB(Math.min(255,parseInt(o[1],10))/255,Math.min(255,parseInt(o[2],10))/255,Math.min(255,parseInt(o[3],10))/255,n);if(o=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return r(o[4]),this.setRGB(Math.min(100,parseInt(o[1],10))/100,Math.min(100,parseInt(o[2],10))/100,Math.min(100,parseInt(o[3],10))/100,n);break;case"hsl":case"hsla":if(o=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return r(o[4]),this.setHSL(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,n);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const o=i[1],a=o.length;if(a===3)return this.setRGB(parseInt(o.charAt(0),16)/15,parseInt(o.charAt(1),16)/15,parseInt(o.charAt(2),16)/15,n);if(a===6)return this.setHex(parseInt(o,16),n);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,n);return this}setColorName(e,n=Zt){const r=k4[e.toLowerCase()];return r!==void 0?this.setHex(r,n):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Ja(e.r),this.g=Ja(e.g),this.b=Ja(e.b),this}copyLinearToSRGB(e){return this.r=cd(e.r),this.g=cd(e.g),this.b=cd(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Zt){return Dt.workingToColorSpace(Ar.copy(this),e),Math.round(It(Ar.r*255,0,255))*65536+Math.round(It(Ar.g*255,0,255))*256+Math.round(It(Ar.b*255,0,255))}getHexString(e=Zt){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=Dt.workingColorSpace){Dt.workingToColorSpace(Ar.copy(this),n);const r=Ar.r,i=Ar.g,o=Ar.b,a=Math.max(r,i,o),s=Math.min(r,i,o);let l,c;const u=(s+a)/2;if(s===a)l=0,c=0;else{const d=a-s;switch(c=u<=.5?d/(a+s):d/(2-a-s),a){case r:l=(i-o)/d+(i0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const n in e){const r=e[n];if(r===void 0){console.warn(`THREE.Material: parameter '${n}' has value of undefined.`);continue}const i=this[n];if(i===void 0){console.warn(`THREE.Material: '${n}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(r):i&&i.isVector3&&r&&r.isVector3?i.copy(r):this[n]=r}}toJSON(e){const n=e===void 0||typeof e=="string";n&&(e={textures:{},images:{}});const r={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),this.roughness!==void 0&&(r.roughness=this.roughness),this.metalness!==void 0&&(r.metalness=this.metalness),this.sheen!==void 0&&(r.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(r.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(r.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(r.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(r.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(r.shininess=this.shininess),this.clearcoat!==void 0&&(r.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(r.dispersion=this.dispersion),this.iridescence!==void 0&&(r.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(r.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(r.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(r.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(r.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(r.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(r.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(e).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(e).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(e).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(e).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(e).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(r.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(r.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(r.combine=this.combine)),this.envMapRotation!==void 0&&(r.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(r.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(r.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(r.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(r.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(r.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(r.size=this.size),this.shadowSide!==null&&(r.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(r.sizeAttenuation=this.sizeAttenuation),this.blending!==sd&&(r.blending=this.blending),this.side!==ba&&(r.side=this.side),this.vertexColors===!0&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),this.transparent===!0&&(r.transparent=!0),this.blendSrc!==RE&&(r.blendSrc=this.blendSrc),this.blendDst!==NE&&(r.blendDst=this.blendDst),this.blendEquation!==ql&&(r.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(r.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(r.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(r.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(r.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(r.blendAlpha=this.blendAlpha),this.depthFunc!==jd&&(r.depthFunc=this.depthFunc),this.depthTest===!1&&(r.depthTest=this.depthTest),this.depthWrite===!1&&(r.depthWrite=this.depthWrite),this.colorWrite===!1&&(r.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(r.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==VN&&(r.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(r.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(r.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==au&&(r.stencilFail=this.stencilFail),this.stencilZFail!==au&&(r.stencilZFail=this.stencilZFail),this.stencilZPass!==au&&(r.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(r.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(r.rotation=this.rotation),this.polygonOffset===!0&&(r.polygonOffset=!0),this.polygonOffsetFactor!==0&&(r.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(r.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(r.linewidth=this.linewidth),this.dashSize!==void 0&&(r.dashSize=this.dashSize),this.gapSize!==void 0&&(r.gapSize=this.gapSize),this.scale!==void 0&&(r.scale=this.scale),this.dithering===!0&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),this.alphaHash===!0&&(r.alphaHash=!0),this.alphaToCoverage===!0&&(r.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(r.premultipliedAlpha=!0),this.forceSinglePass===!0&&(r.forceSinglePass=!0),this.wireframe===!0&&(r.wireframe=!0),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(r.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(r.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(r.flatShading=!0),this.visible===!1&&(r.visible=!1),this.toneMapped===!1&&(r.toneMapped=!1),this.fog===!1&&(r.fog=!1),Object.keys(this.userData).length>0&&(r.userData=this.userData);function i(o){const a=[];for(const s in o){const l=o[s];delete l.metadata,a.push(l)}return a}if(n){const o=i(e.textures),a=i(e.images);o.length>0&&(r.textures=o),a.length>0&&(r.images=a)}return r}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const n=e.clippingPlanes;let r=null;if(n!==null){const i=n.length;r=new Array(i);for(let o=0;o!==i;++o)r[o]=n[o].clone()}return this.clippingPlanes=r,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class ua extends qr{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new ft(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new pi,this.combine=kx,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Fn=new ne,kg=new xt;let gee=0;class cr{constructor(e,n,r=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:gee++}),this.name="",this.array=e,this.itemSize=n,this.count=e!==void 0?e.length/n:0,this.normalized=r,this.usage=p1,this.updateRanges=[],this.gpuType=Io,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,n,r){e*=this.itemSize,r*=n.itemSize;for(let i=0,o=this.itemSize;in.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),n.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Wo);const e=this.attributes.position,n=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new ne(-1/0,-1/0,-1/0),new ne(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),n)for(let r=0,i=n.length;r0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const n=this.index;n!==null&&(e.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});const r=this.attributes;for(const l in r){const c=r[l];e.data.attributes[l]=c.toJSON(e.data)}const i={};let o=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let d=0,f=c.length;d0&&(i[l]=u,o=!0)}o&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const s=this.boundingSphere;return s!==null&&(e.data.boundingSphere=s.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const n={};this.name=e.name;const r=e.index;r!==null&&this.setIndex(r.clone());const i=e.attributes;for(const c in i){const u=i[c];this.setAttribute(c,u.clone(n))}const o=e.morphAttributes;for(const c in o){const u=[],d=o[c];for(let f=0,p=d.length;f0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,a=i.length;o(e.far-e.near)**2))&&(oO.copy(o).invert(),Ll.copy(e.ray).applyMatrix4(oO),!(r.boundingBox!==null&&Ll.intersectsBox(r.boundingBox)===!1)&&this._computeIntersections(e,n,Ll)))}_computeIntersections(e,n,r){let i;const o=this.geometry,a=this.material,s=o.index,l=o.attributes.position,c=o.attributes.uv,u=o.attributes.uv1,d=o.attributes.normal,f=o.groups,p=o.drawRange;if(s!==null)if(Array.isArray(a))for(let y=0,v=f.length;yn.far?null:{distance:c,point:zg.clone(),object:t}}function Hg(t,e,n,r,i,o,a,s,l,c){t.getVertexPosition(s,Ug),t.getVertexPosition(l,Fg),t.getVertexPosition(c,Bg);const u=yee(t,e,n,r,Ug,Fg,Bg,sO);if(u){const d=new ne;Ro.getBarycoord(sO,Ug,Fg,Bg,d),i&&(u.uv=Ro.getInterpolatedAttribute(i,s,l,c,d,new xt)),o&&(u.uv1=Ro.getInterpolatedAttribute(o,s,l,c,d,new xt)),a&&(u.normal=Ro.getInterpolatedAttribute(a,s,l,c,d,new ne),u.normal.dot(r.direction)>0&&u.normal.multiplyScalar(-1));const f={a:s,b:l,c,normal:new ne,materialIndex:0};Ro.getNormal(Ug,Fg,Bg,f.normal),u.face=f,u.barycoord=d}return u}class Gc extends br{constructor(e=1,n=1,r=1,i=1,o=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:n,depth:r,widthSegments:i,heightSegments:o,depthSegments:a};const s=this;i=Math.floor(i),o=Math.floor(o),a=Math.floor(a);const l=[],c=[],u=[],d=[];let f=0,p=0;y("z","y","x",-1,-1,r,n,e,a,o,0),y("z","y","x",1,-1,r,n,-e,a,o,1),y("x","z","y",1,1,e,r,n,i,a,2),y("x","z","y",1,-1,e,r,-n,i,a,3),y("x","y","z",1,-1,e,n,r,i,o,4),y("x","y","z",-1,-1,e,n,-r,i,o,5),this.setIndex(l),this.setAttribute("position",new Qt(c,3)),this.setAttribute("normal",new Qt(u,3)),this.setAttribute("uv",new Qt(d,2));function y(v,g,m,x,b,S,w,E,T,A,M){const C=S/T,P=w/A,R=S/2,D=w/2,k=E/2,U=T+1,O=A+1;let W=0,L=0;const j=new ne;for(let X=0;X0?1:-1,u.push(j.x,j.y,j.z),d.push(F/T),d.push(1-X/A),W+=1}}for(let X=0;X0&&(n.defines=this.defines),n.vertexShader=this.vertexShader,n.fragmentShader=this.fragmentShader,n.lights=this.lights,n.clipping=this.clipping;const r={};for(const i in this.extensions)this.extensions[i]===!0&&(r[i]=!0);return Object.keys(r).length>0&&(n.extensions=r),n}}class B4 extends vn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new gt,this.projectionMatrix=new gt,this.projectionMatrixInverse=new gt,this.coordinateSystem=Xa}copy(e,n){return super.copy(e,n),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,n){super.updateWorldMatrix(e,n),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const Es=new ne,lO=new xt,cO=new xt;class gr extends B4{constructor(e=50,n=1,r=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=r,this.far=i,this.focus=10,this.aspect=n,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const n=.5*this.getFilmHeight()/e;this.fov=Bd*2*Math.atan(n),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Wh*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Bd*2*Math.atan(Math.tan(Wh*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,n,r){Es.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(Es.x,Es.y).multiplyScalar(-e/Es.z),Es.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),r.set(Es.x,Es.y).multiplyScalar(-e/Es.z)}getViewSize(e,n){return this.getViewBounds(e,lO,cO),n.subVectors(cO,lO)}setViewOffset(e,n,r,i,o,a){this.aspect=e/n,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let n=e*Math.tan(Wh*.5*this.fov)/this.zoom,r=2*n,i=this.aspect*r,o=-.5*i;const a=this.view;if(this.view!==null&&this.view.enabled){const l=a.fullWidth,c=a.fullHeight;o+=a.offsetX*i/l,n-=a.offsetY*r/c,i*=a.width/l,r*=a.height/c}const s=this.filmOffset;s!==0&&(o+=e*s/this.getFilmWidth()),this.projectionMatrix.makePerspective(o,o+i,n,n-r,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.fov=this.fov,n.object.zoom=this.zoom,n.object.near=this.near,n.object.far=this.far,n.object.focus=this.focus,n.object.aspect=this.aspect,this.view!==null&&(n.object.view=Object.assign({},this.view)),n.object.filmGauge=this.filmGauge,n.object.filmOffset=this.filmOffset,n}}const vu=-90,yu=1;class See extends vn{constructor(e,n,r){super(),this.type="CubeCamera",this.renderTarget=r,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new gr(vu,yu,e,n);i.layers=this.layers,this.add(i);const o=new gr(vu,yu,e,n);o.layers=this.layers,this.add(o);const a=new gr(vu,yu,e,n);a.layers=this.layers,this.add(a);const s=new gr(vu,yu,e,n);s.layers=this.layers,this.add(s);const l=new gr(vu,yu,e,n);l.layers=this.layers,this.add(l);const c=new gr(vu,yu,e,n);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,n=this.children.concat(),[r,i,o,a,s,l]=n;for(const c of n)this.remove(c);if(e===Xa)r.up.set(0,1,0),r.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),o.up.set(0,0,-1),o.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),s.up.set(0,1,0),s.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===Ny)r.up.set(0,-1,0),r.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),o.up.set(0,0,1),o.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),s.up.set(0,-1,0),s.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const c of n)this.add(c),c.updateMatrixWorld()}update(e,n){this.parent===null&&this.updateMatrixWorld();const{renderTarget:r,activeMipmapLevel:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[o,a,s,l,c,u]=this.children,d=e.getRenderTarget(),f=e.getActiveCubeFace(),p=e.getActiveMipmapLevel(),y=e.xr.enabled;e.xr.enabled=!1;const v=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,e.setRenderTarget(r,0,i),e.render(n,o),e.setRenderTarget(r,1,i),e.render(n,a),e.setRenderTarget(r,2,i),e.render(n,s),e.setRenderTarget(r,3,i),e.render(n,l),e.setRenderTarget(r,4,i),e.render(n,c),r.texture.generateMipmaps=v,e.setRenderTarget(r,5,i),e.render(n,u),e.setRenderTarget(d,f,p),e.xr.enabled=y,r.texture.needsPMREMUpdate=!0}}class $4 extends lr{constructor(e=[],n=Ud,r,i,o,a,s,l,c,u){super(e,n,r,i,o,a,s,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class Eee extends Oc{constructor(e=1,n={}){super(e,e,n),this.isWebGLCubeRenderTarget=!0;const r={width:e,height:e,depth:1},i=[r,r,r,r,r,r];this.texture=new $4(i),this._setTextureOptions(n),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(e,n){this.texture.type=n.type,this.texture.colorSpace=n.colorSpace,this.texture.generateMipmaps=n.generateMipmaps,this.texture.minFilter=n.minFilter,this.texture.magFilter=n.magFilter;const r={uniforms:{tEquirect:{value:null}},vertexShader:` + + varying vec3 vWorldDirection; + + vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); + + } + + void main() { + + vWorldDirection = transformDirection( position, modelMatrix ); + + #include + #include + + } + `,fragmentShader:` + + uniform sampler2D tEquirect; + + varying vec3 vWorldDirection; + + #include + + void main() { + + vec3 direction = normalize( vWorldDirection ); + + vec2 sampleUV = equirectUv( direction ); + + gl_FragColor = texture2D( tEquirect, sampleUV ); + + } + `},i=new Gc(5,5,5),o=new hl({name:"CubemapFromEquirect",uniforms:$d(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:ui,blending:tl});o.uniforms.tEquirect.value=n;const a=new Tn(i,o),s=n.minFilter;return n.minFilter===Oo&&(n.minFilter=Or),new See(1,10,this).update(e,a),n.minFilter=s,a.geometry.dispose(),a.material.dispose(),this}clear(e,n=!0,r=!0,i=!0){const o=e.getRenderTarget();for(let a=0;a<6;a++)e.setRenderTarget(this,a),e.clear(n,r,i);e.setRenderTarget(o)}}let da=class extends vn{constructor(){super(),this.isGroup=!0,this.type="Group"}};const Tee={type:"move"};class fw{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new da,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new da,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new ne,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new ne),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new da,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new ne,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new ne),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const n=this._hand;if(n)for(const r of e.hand.values())this._getHandJoint(n,r)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,n,r){let i=null,o=null,a=null;const s=this._targetRay,l=this._grip,c=this._hand;if(e&&n.session.visibilityState!=="visible-blurred"){if(c&&e.hand){a=!0;for(const v of e.hand.values()){const g=n.getJointPose(v,r),m=this._getHandJoint(c,v);g!==null&&(m.matrix.fromArray(g.transform.matrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.matrixWorldNeedsUpdate=!0,m.jointRadius=g.radius),m.visible=g!==null}const u=c.joints["index-finger-tip"],d=c.joints["thumb-tip"],f=u.position.distanceTo(d.position),p=.02,y=.005;c.inputState.pinching&&f>p+y?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&f<=p-y&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(o=n.getPose(e.gripSpace,r),o!==null&&(l.matrix.fromArray(o.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,o.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(o.linearVelocity)):l.hasLinearVelocity=!1,o.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(o.angularVelocity)):l.hasAngularVelocity=!1));s!==null&&(i=n.getPose(e.targetRaySpace,r),i===null&&o!==null&&(i=o),i!==null&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(Tee)))}return s!==null&&(s.visible=i!==null),l!==null&&(l.visible=o!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(e,n){if(e.joints[n.jointName]===void 0){const r=new da;r.matrixAutoUpdate=!1,r.visible=!1,e.joints[n.jointName]=r,e.add(r)}return e.joints[n.jointName]}}class z4 extends vn{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new pi,this.environmentIntensity=1,this.environmentRotation=new pi,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,n){return super.copy(e,n),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const n=super.toJSON(e);return this.fog!==null&&(n.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(n.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(n.object.backgroundIntensity=this.backgroundIntensity),n.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(n.object.environmentIntensity=this.environmentIntensity),n.object.environmentRotation=this.environmentRotation.toArray(),n}}class Mee{constructor(e,n){this.isInterleavedBuffer=!0,this.array=e,this.stride=n,this.count=e!==void 0?e.length/n:0,this.usage=p1,this.updateRanges=[],this.version=0,this.uuid=Uo()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,n,r){e*=this.stride,r*=n.stride;for(let i=0,o=this.stride;i1?null:n.copy(e.start).addScaledVector(r,o)}intersectsLine(e){const n=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return n<0&&r>0||r<0&&n>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,n){const r=n||Oee.getNormalMatrix(e),i=this.coplanarPoint(mw).applyMatrix4(e),o=this.normal.applyMatrix3(r).normalize();return this.constant=-i.dot(o),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const kl=new Xo,Wg=new ne;class nC{constructor(e=new $a,n=new $a,r=new $a,i=new $a,o=new $a,a=new $a){this.planes=[e,n,r,i,o,a]}set(e,n,r,i,o,a){const s=this.planes;return s[0].copy(e),s[1].copy(n),s[2].copy(r),s[3].copy(i),s[4].copy(o),s[5].copy(a),this}copy(e){const n=this.planes;for(let r=0;r<6;r++)n[r].copy(e.planes[r]);return this}setFromProjectionMatrix(e,n=Xa){const r=this.planes,i=e.elements,o=i[0],a=i[1],s=i[2],l=i[3],c=i[4],u=i[5],d=i[6],f=i[7],p=i[8],y=i[9],v=i[10],g=i[11],m=i[12],x=i[13],b=i[14],S=i[15];if(r[0].setComponents(l-o,f-c,g-p,S-m).normalize(),r[1].setComponents(l+o,f+c,g+p,S+m).normalize(),r[2].setComponents(l+a,f+u,g+y,S+x).normalize(),r[3].setComponents(l-a,f-u,g-y,S-x).normalize(),r[4].setComponents(l-s,f-d,g-v,S-b).normalize(),n===Xa)r[5].setComponents(l+s,f+d,g+v,S+b).normalize();else if(n===Ny)r[5].setComponents(s,d,v,b).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+n);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),kl.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const n=e.geometry;n.boundingSphere===null&&n.computeBoundingSphere(),kl.copy(n.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(kl)}intersectsSprite(e){return kl.center.set(0,0,0),kl.radius=.7071067811865476,kl.applyMatrix4(e.matrixWorld),this.intersectsSphere(kl)}intersectsSphere(e){const n=this.planes,r=e.center,i=-e.radius;for(let o=0;o<6;o++)if(n[o].distanceToPoint(r)0?e.max.x:e.min.x,Wg.y=i.normal.y>0?e.max.y:e.min.y,Wg.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Wg)<0)return!1}return!0}containsPoint(e){const n=this.planes;for(let r=0;r<6;r++)if(n[r].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class pc extends qr{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new ft(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const Oy=new ne,Iy=new ne,yO=new gt,lh=new Sf,Xg=new Xo,gw=new ne,xO=new ne;let Bx=class extends vn{constructor(e=new br,n=new pc){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=n,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,n){return super.copy(e,n),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const n=e.attributes.position,r=[0];for(let i=1,o=n.count;i0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,a=i.length;or)return;gw.applyMatrix4(t.matrixWorld);const c=e.ray.origin.distanceTo(gw);if(!(ce.far))return{distance:c,point:xO.clone().applyMatrix4(t.matrixWorld),index:a,face:null,faceIndex:null,barycoord:null,object:t}}const bO=new ne,_O=new ne;class Dy extends Bx{constructor(e,n){super(e,n),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const n=e.attributes.position,r=[];for(let i=0,o=n.count;i0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,a=i.length;oi.far)return;o.push({distance:c,distanceToRay:Math.sqrt(s),point:l,index:e,face:null,faceIndex:null,barycoord:null,object:a})}}class V4 extends lr{constructor(e,n,r=Nc,i,o,a,s=Xr,l=Xr,c,u=Mp,d=1){if(u!==Mp&&u!==Ap)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const f={width:e,height:n,depth:d};super(f,i,o,a,s,l,u,r,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new JA(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const n=super.toJSON(e);return this.compareFunction!==null&&(n.compareFunction=this.compareFunction),n}}class rC extends br{constructor(e=1,n=1,r=1,i=32,o=1,a=!1,s=0,l=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:n,height:r,radialSegments:i,heightSegments:o,openEnded:a,thetaStart:s,thetaLength:l};const c=this;i=Math.floor(i),o=Math.floor(o);const u=[],d=[],f=[],p=[];let y=0;const v=[],g=r/2;let m=0;x(),a===!1&&(e>0&&b(!0),n>0&&b(!1)),this.setIndex(u),this.setAttribute("position",new Qt(d,3)),this.setAttribute("normal",new Qt(f,3)),this.setAttribute("uv",new Qt(p,2));function x(){const S=new ne,w=new ne;let E=0;const T=(n-e)/r;for(let A=0;A<=o;A++){const M=[],C=A/o,P=C*(n-e)+e;for(let R=0;R<=i;R++){const D=R/i,k=D*l+s,U=Math.sin(k),O=Math.cos(k);w.x=P*U,w.y=-C*r+g,w.z=P*O,d.push(w.x,w.y,w.z),S.set(U,T,O).normalize(),f.push(S.x,S.y,S.z),p.push(D,1-C),M.push(y++)}v.push(M)}for(let A=0;A0||M!==0)&&(u.push(C,P,D),E+=3),(n>0||M!==o-1)&&(u.push(P,R,D),E+=3)}c.addGroup(m,E,0),m+=E}function b(S){const w=y,E=new xt,T=new ne;let A=0;const M=S===!0?e:n,C=S===!0?1:-1;for(let R=1;R<=i;R++)d.push(0,g*C,0),f.push(0,C,0),p.push(.5,.5),y++;const P=y;for(let R=0;R<=i;R++){const k=R/i*l+s,U=Math.cos(k),O=Math.sin(k);T.x=M*O,T.y=g*C,T.z=M*U,d.push(T.x,T.y,T.z),f.push(0,C,0),E.x=U*.5+.5,E.y=O*.5*C+.5,p.push(E.x,E.y),y++}for(let R=0;R0)&&p.push(b,S,E),(m!==r-1||l0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class Fo extends qr{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new ft(16777215),this.specular=new ft(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ft(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ux,this.normalScale=new xt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new pi,this.combine=kx,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Lee extends qr{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new ft(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ft(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ux,this.normalScale=new xt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new pi,this.combine=kx,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class kee extends qr{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=MQ,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class jee extends qr{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}function Jg(t,e){return!t||t.constructor===e?t:typeof e.BYTES_PER_ELEMENT=="number"?new e(t):Array.prototype.slice.call(t)}function Uee(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Fee(t){function e(i,o){return t[i]-t[o]}const n=t.length,r=new Array(n);for(let i=0;i!==n;++i)r[i]=i;return r.sort(e),r}function EO(t,e,n){const r=t.length,i=new t.constructor(r);for(let o=0,a=0;a!==r;++o){const s=n[o]*e;for(let l=0;l!==e;++l)i[a++]=t[s+l]}return i}function G4(t,e,n,r){let i=1,o=t[0];for(;o!==void 0&&o[r]===void 0;)o=t[i++];if(o===void 0)return;let a=o[r];if(a!==void 0)if(Array.isArray(a))do a=o[r],a!==void 0&&(e.push(o.time),n.push(...a)),o=t[i++];while(o!==void 0);else if(a.toArray!==void 0)do a=o[r],a!==void 0&&(e.push(o.time),a.toArray(n,n.length)),o=t[i++];while(o!==void 0);else do a=o[r],a!==void 0&&(e.push(o.time),n.push(a)),o=t[i++];while(o!==void 0)}class Dm{constructor(e,n,r,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new n.constructor(r),this.sampleValues=n,this.valueSize=r,this.settings=null,this.DefaultSettings_={}}evaluate(e){const n=this.parameterPositions;let r=this._cachedIndex,i=n[r],o=n[r-1];e:{t:{let a;n:{r:if(!(e=o)){const s=n[1];e=o)break t}a=r,r=0;break n}break e}for(;r>>1;en;)--a;if(++a,o!==0||a!==i){o>=a&&(a=Math.max(a,1),o=a-1);const s=this.getValueSize();this.times=r.slice(o,a),this.values=this.values.slice(o*s,a*s)}return this}validate(){let e=!0;const n=this.getValueSize();n-Math.floor(n)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const r=this.times,i=this.values,o=r.length;o===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let a=null;for(let s=0;s!==o;s++){const l=r[s];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,s,l),e=!1;break}if(a!==null&&a>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,s,l,a),e=!1;break}a=l}if(i!==void 0&&Uee(i))for(let s=0,l=i.length;s!==l;++s){const c=i[s];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,s,c),e=!1;break}}return e}optimize(){const e=this.times.slice(),n=this.values.slice(),r=this.getValueSize(),i=this.getInterpolation()===G_,o=e.length-1;let a=1;for(let s=1;s0){e[a]=e[o];for(let s=o*r,l=a*r,c=0;c!==r;++c)n[l+c]=n[s+c];++a}return a!==e.length?(this.times=e.slice(0,a),this.values=n.slice(0,a*r)):(this.times=e,this.values=n),this}clone(){const e=this.times.slice(),n=this.values.slice(),r=this.constructor,i=new r(this.name,e,n);return i.createInterpolant=this.createInterpolant,i}}qo.prototype.ValueTypeName="";qo.prototype.TimeBufferType=Float32Array;qo.prototype.ValueBufferType=Float32Array;qo.prototype.DefaultInterpolation=Pp;class Ef extends qo{constructor(e,n,r){super(e,n,r)}}Ef.prototype.ValueTypeName="bool";Ef.prototype.ValueBufferType=Array;Ef.prototype.DefaultInterpolation=Cp;Ef.prototype.InterpolantFactoryMethodLinear=void 0;Ef.prototype.InterpolantFactoryMethodSmooth=void 0;class W4 extends qo{constructor(e,n,r,i){super(e,n,r,i)}}W4.prototype.ValueTypeName="color";class zd extends qo{constructor(e,n,r,i){super(e,n,r,i)}}zd.prototype.ValueTypeName="number";class Hee extends Dm{constructor(e,n,r,i){super(e,n,r,i)}interpolate_(e,n,r,i){const o=this.resultBuffer,a=this.sampleValues,s=this.valueSize,l=(r-n)/(i-n);let c=e*s;for(let u=c+s;c!==u;c+=4)Ii.slerpFlat(o,0,a,c-s,a,c,l);return o}}class Ic extends qo{constructor(e,n,r,i){super(e,n,r,i)}InterpolantFactoryMethodLinear(e){return new Hee(this.times,this.values,this.getValueSize(),e)}}Ic.prototype.ValueTypeName="quaternion";Ic.prototype.InterpolantFactoryMethodSmooth=void 0;class Tf extends qo{constructor(e,n,r){super(e,n,r)}}Tf.prototype.ValueTypeName="string";Tf.prototype.ValueBufferType=Array;Tf.prototype.DefaultInterpolation=Cp;Tf.prototype.InterpolantFactoryMethodLinear=void 0;Tf.prototype.InterpolantFactoryMethodSmooth=void 0;class pl extends qo{constructor(e,n,r,i){super(e,n,r,i)}}pl.prototype.ValueTypeName="vector";class v1{constructor(e="",n=-1,r=[],i=EQ){this.name=e,this.tracks=r,this.duration=n,this.blendMode=i,this.uuid=Uo(),this.duration<0&&this.resetDuration()}static parse(e){const n=[],r=e.tracks,i=1/(e.fps||1);for(let a=0,s=r.length;a!==s;++a)n.push(Gee(r[a]).scale(i));const o=new this(e.name,e.duration,n,e.blendMode);return o.uuid=e.uuid,o}static toJSON(e){const n=[],r=e.tracks,i={name:e.name,duration:e.duration,tracks:n,uuid:e.uuid,blendMode:e.blendMode};for(let o=0,a=r.length;o!==a;++o)n.push(qo.toJSON(r[o]));return i}static CreateFromMorphTargetSequence(e,n,r,i){const o=n.length,a=[];for(let s=0;s1){const d=u[1];let f=i[d];f||(i[d]=f=[]),f.push(c)}}const a=[];for(const s in i)a.push(this.CreateFromMorphTargetSequence(s,i[s],n,r));return a}static parseAnimation(e,n){if(console.warn("THREE.AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const r=function(d,f,p,y,v){if(p.length!==0){const g=[],m=[];G4(p,g,m,y),g.length!==0&&v.push(new d(f,g,m))}},i=[],o=e.name||"default",a=e.fps||30,s=e.blendMode;let l=e.length||-1;const c=e.hierarchy||[];for(let d=0;d{n&&n(o),this.manager.itemEnd(e)},0),o;if(Da[e]!==void 0){Da[e].push({onLoad:n,onProgress:r,onError:i});return}Da[e]=[],Da[e].push({onLoad:n,onProgress:r,onError:i});const a=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),s=this.mimeType,l=this.responseType;fetch(a).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const u=Da[e],d=c.body.getReader(),f=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),p=f?parseInt(f):0,y=p!==0;let v=0;const g=new ReadableStream({start(m){x();function x(){d.read().then(({done:b,value:S})=>{if(b)m.close();else{v+=S.byteLength;const w=new ProgressEvent("progress",{lengthComputable:y,loaded:v,total:p});for(let E=0,T=u.length;E{m.error(b)})}}});return new Response(g)}else throw new Wee(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`,c)}).then(c=>{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(u=>new DOMParser().parseFromString(u,s));case"json":return c.json();default:if(s==="")return c.text();{const d=/charset="?([^;"\s]*)"?/i.exec(s),f=d&&d[1]?d[1].toLowerCase():void 0,p=new TextDecoder(f);return c.arrayBuffer().then(y=>p.decode(y))}}}).then(c=>{Hs.add(e,c);const u=Da[e];delete Da[e];for(let d=0,f=u.length;d{const u=Da[e];if(u===void 0)throw this.manager.itemError(e),c;delete Da[e];for(let d=0,f=u.length;d{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class Xee extends Vo{constructor(e){super(e)}load(e,n,r,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,a=Hs.get(e);if(a!==void 0)return o.manager.itemStart(e),setTimeout(function(){n&&n(a),o.manager.itemEnd(e)},0),a;const s=Rp("img");function l(){u(),Hs.add(e,this),n&&n(this),o.manager.itemEnd(e)}function c(d){u(),i&&i(d),o.manager.itemError(e),o.manager.itemEnd(e)}function u(){s.removeEventListener("load",l,!1),s.removeEventListener("error",c,!1)}return s.addEventListener("load",l,!1),s.addEventListener("error",c,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(s.crossOrigin=this.crossOrigin),o.manager.itemStart(e),s.src=e,s}}class qee extends Vo{constructor(e){super(e)}load(e,n,r,i){const o=this,a=new tC,s=new Mf(this.manager);return s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setPath(this.path),s.setWithCredentials(o.withCredentials),s.load(e,function(l){let c;try{c=o.parse(l)}catch(u){if(i!==void 0)i(u);else{console.error(u);return}}c.image!==void 0?a.image=c.image:c.data!==void 0&&(a.image.width=c.width,a.image.height=c.height,a.image.data=c.data),a.wrapS=c.wrapS!==void 0?c.wrapS:Ji,a.wrapT=c.wrapT!==void 0?c.wrapT:Ji,a.magFilter=c.magFilter!==void 0?c.magFilter:Or,a.minFilter=c.minFilter!==void 0?c.minFilter:Or,a.anisotropy=c.anisotropy!==void 0?c.anisotropy:1,c.colorSpace!==void 0&&(a.colorSpace=c.colorSpace),c.flipY!==void 0&&(a.flipY=c.flipY),c.format!==void 0&&(a.format=c.format),c.type!==void 0&&(a.type=c.type),c.mipmaps!==void 0&&(a.mipmaps=c.mipmaps,a.minFilter=Oo),c.mipmapCount===1&&(a.minFilter=Or),c.generateMipmaps!==void 0&&(a.generateMipmaps=c.generateMipmaps),a.needsUpdate=!0,n&&n(a,c)},r,i),a}}class aC extends Vo{constructor(e){super(e)}load(e,n,r,i){const o=new lr,a=new Xee(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,function(s){o.image=s,o.needsUpdate=!0,n!==void 0&&n(o)},r,i),o}}class Lm extends vn{constructor(e,n=1){super(),this.isLight=!0,this.type="Light",this.color=new ft(e),this.intensity=n}dispose(){}copy(e,n){return super.copy(e,n),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const n=super.toJSON(e);return n.object.color=this.color.getHex(),n.object.intensity=this.intensity,this.groundColor!==void 0&&(n.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(n.object.distance=this.distance),this.angle!==void 0&&(n.object.angle=this.angle),this.decay!==void 0&&(n.object.decay=this.decay),this.penumbra!==void 0&&(n.object.penumbra=this.penumbra),this.shadow!==void 0&&(n.object.shadow=this.shadow.toJSON()),this.target!==void 0&&(n.object.target=this.target.uuid),n}}class Kee extends Lm{constructor(e,n,r){super(e,r),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(vn.DEFAULT_UP),this.updateMatrix(),this.groundColor=new ft(n)}copy(e,n){return super.copy(e,n),this.groundColor.copy(e.groundColor),this}}const vw=new gt,TO=new ne,MO=new ne;class sC{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new xt(512,512),this.mapType=_a,this.map=null,this.mapPass=null,this.matrix=new gt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new nC,this._frameExtents=new xt(1,1),this._viewportCount=1,this._viewports=[new Yt(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const n=this.camera,r=this.matrix;TO.setFromMatrixPosition(e.matrixWorld),n.position.copy(TO),MO.setFromMatrixPosition(e.target.matrixWorld),n.lookAt(MO),n.updateMatrixWorld(),vw.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(vw),r.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),r.multiply(vw)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.autoUpdate=e.autoUpdate,this.needsUpdate=e.needsUpdate,this.normalBias=e.normalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.intensity!==1&&(e.intensity=this.intensity),this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class Yee extends sC{constructor(){super(new gr(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(e){const n=this.camera,r=Bd*2*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height*this.aspect,o=e.distance||n.far;(r!==n.fov||i!==n.aspect||o!==n.far)&&(n.fov=r,n.aspect=i,n.far=o,n.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class K4 extends Lm{constructor(e,n,r=0,i=Math.PI/3,o=0,a=2){super(e,n),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(vn.DEFAULT_UP),this.updateMatrix(),this.target=new vn,this.distance=r,this.angle=i,this.penumbra=o,this.decay=a,this.map=null,this.shadow=new Yee}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,n){return super.copy(e,n),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const AO=new gt,ch=new ne,yw=new ne;class Jee extends sC{constructor(){super(new gr(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new xt(4,2),this._viewportCount=6,this._viewports=[new Yt(2,1,1,1),new Yt(0,1,1,1),new Yt(3,1,1,1),new Yt(1,1,1,1),new Yt(3,0,1,1),new Yt(1,0,1,1)],this._cubeDirections=[new ne(1,0,0),new ne(-1,0,0),new ne(0,0,1),new ne(0,0,-1),new ne(0,1,0),new ne(0,-1,0)],this._cubeUps=[new ne(0,1,0),new ne(0,1,0),new ne(0,1,0),new ne(0,1,0),new ne(0,0,1),new ne(0,0,-1)]}updateMatrices(e,n=0){const r=this.camera,i=this.matrix,o=e.distance||r.far;o!==r.far&&(r.far=o,r.updateProjectionMatrix()),ch.setFromMatrixPosition(e.matrixWorld),r.position.copy(ch),yw.copy(r.position),yw.add(this._cubeDirections[n]),r.up.copy(this._cubeUps[n]),r.lookAt(yw),r.updateMatrixWorld(),i.makeTranslation(-ch.x,-ch.y,-ch.z),AO.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),this._frustum.setFromProjectionMatrix(AO)}}class Y4 extends Lm{constructor(e,n,r=0,i=2){super(e,n),this.isPointLight=!0,this.type="PointLight",this.distance=r,this.decay=i,this.shadow=new Jee}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,n){return super.copy(e,n),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class $x extends B4{constructor(e=-1,n=1,r=1,i=-1,o=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=n,this.top=r,this.bottom=i,this.near=o,this.far=a,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,n,r,i,o,a){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),n=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let o=r-e,a=r+e,s=i+n,l=i-n;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;o+=c*this.view.offsetX,a=o+c*this.view.width,s-=u*this.view.offsetY,l=s-u*this.view.height}this.projectionMatrix.makeOrthographic(o,a,s,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.zoom=this.zoom,n.object.left=this.left,n.object.right=this.right,n.object.top=this.top,n.object.bottom=this.bottom,n.object.near=this.near,n.object.far=this.far,this.view!==null&&(n.object.view=Object.assign({},this.view)),n}}class Zee extends sC{constructor(){super(new $x(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class zx extends Lm{constructor(e,n){super(e,n),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(vn.DEFAULT_UP),this.updateMatrix(),this.target=new vn,this.shadow=new Zee}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class J4 extends Lm{constructor(e,n){super(e,n),this.isAmbientLight=!0,this.type="AmbientLight"}}class mc{static extractUrlBase(e){const n=e.lastIndexOf("/");return n===-1?"./":e.slice(0,n+1)}static resolveURL(e,n){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(n)&&/^\//.test(e)&&(n=n.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:n+e)}}const xw=new WeakMap;class Qee extends Vo{constructor(e){super(e),this.isImageBitmapLoader=!0,typeof createImageBitmap>"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,n,r,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,a=Hs.get(e);if(a!==void 0){if(o.manager.itemStart(e),a.then){a.then(c=>{if(xw.has(a)===!0)i&&i(xw.get(a)),o.manager.itemError(e),o.manager.itemEnd(e);else return n&&n(c),o.manager.itemEnd(e),c});return}return setTimeout(function(){n&&n(a),o.manager.itemEnd(e)},0),a}const s={};s.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",s.headers=this.requestHeader;const l=fetch(e,s).then(function(c){return c.blob()}).then(function(c){return createImageBitmap(c,Object.assign(o.options,{colorSpaceConversion:"none"}))}).then(function(c){return Hs.add(e,c),n&&n(c),o.manager.itemEnd(e),c}).catch(function(c){i&&i(c),xw.set(l,c),Hs.remove(e),o.manager.itemError(e),o.manager.itemEnd(e)});Hs.add(e,l),o.manager.itemStart(e)}}class ete extends gr{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}const lC="\\[\\]\\.:\\/",tte=new RegExp("["+lC+"]","g"),cC="[^"+lC+"]",nte="[^"+lC.replace("\\.","")+"]",rte=/((?:WC+[\/:])*)/.source.replace("WC",cC),ite=/(WCOD+)?/.source.replace("WCOD",nte),ote=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",cC),ate=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",cC),ste=new RegExp("^"+rte+ite+ote+ate+"$"),lte=["material","materials","bones","map"];class cte{constructor(e,n,r){const i=r||nn.parseTrackName(n);this._targetGroup=e,this._bindings=e.subscribe_(n,i)}getValue(e,n){this.bind();const r=this._targetGroup.nCachedObjects_,i=this._bindings[r];i!==void 0&&i.getValue(e,n)}setValue(e,n){const r=this._bindings;for(let i=this._targetGroup.nCachedObjects_,o=r.length;i!==o;++i)r[i].setValue(e,n)}bind(){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=e.length;n!==r;++n)e[n].bind()}unbind(){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=e.length;n!==r;++n)e[n].unbind()}}class nn{constructor(e,n,r){this.path=n,this.parsedPath=r||nn.parseTrackName(n),this.node=nn.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,n,r){return e&&e.isAnimationObjectGroup?new nn.Composite(e,n,r):new nn(e,n,r)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(tte,"")}static parseTrackName(e){const n=ste.exec(e);if(n===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const r={nodeName:n[2],objectName:n[3],objectIndex:n[4],propertyName:n[5],propertyIndex:n[6]},i=r.nodeName&&r.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const o=r.nodeName.substring(i+1);lte.indexOf(o)!==-1&&(r.nodeName=r.nodeName.substring(0,i),r.objectName=o)}if(r.propertyName===null||r.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return r}static findNode(e,n){if(n===void 0||n===""||n==="."||n===-1||n===e.name||n===e.uuid)return e;if(e.skeleton){const r=e.skeleton.getBoneByName(n);if(r!==void 0)return r}if(e.children){const r=function(o){for(let a=0;ap.start-y.start);let f=0;for(let p=1;p 0 + vec4 plane; + #ifdef ALPHA_TO_COVERAGE + float distanceToPlane, distanceGradient; + float clipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + if ( clipOpacity == 0.0 ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + float unionClipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + } + #pragma unroll_loop_end + clipOpacity *= 1.0 - unionClipOpacity; + #endif + diffuseColor.a *= clipOpacity; + if ( diffuseColor.a == 0.0 ) discard; + #else + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + bool clipped = true; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; + } + #pragma unroll_loop_end + if ( clipped ) discard; + #endif + #endif +#endif`,Pte=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; + uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; +#endif`,Rte=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; +#endif`,Nte=`#if NUM_CLIPPING_PLANES > 0 + vClipPosition = - mvPosition.xyz; +#endif`,Ote=`#if defined( USE_COLOR_ALPHA ) + diffuseColor *= vColor; +#elif defined( USE_COLOR ) + diffuseColor.rgb *= vColor; +#endif`,Ite=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) + varying vec3 vColor; +#endif`,Dte=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) + varying vec3 vColor; +#endif`,Lte=`#if defined( USE_COLOR_ALPHA ) + vColor = vec4( 1.0 ); +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) + vColor = vec3( 1.0 ); +#endif +#ifdef USE_COLOR + vColor *= color; +#endif +#ifdef USE_INSTANCING_COLOR + vColor.xyz *= instanceColor.xyz; +#endif +#ifdef USE_BATCHING_COLOR + vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) ); + vColor.xyz *= batchingColor.xyz; +#endif`,kte=`#define PI 3.141592653589793 +#define PI2 6.283185307179586 +#define PI_HALF 1.5707963267948966 +#define RECIPROCAL_PI 0.3183098861837907 +#define RECIPROCAL_PI2 0.15915494309189535 +#define EPSILON 1e-6 +#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +#define whiteComplement( a ) ( 1.0 - saturate( a ) ) +float pow2( const in float x ) { return x*x; } +vec3 pow2( const in vec3 x ) { return x*x; } +float pow3( const in float x ) { return x*x*x; } +float pow4( const in float x ) { float x2 = x*x; return x2*x2; } +float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } +float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } +highp float rand( const in vec2 uv ) { + const highp float a = 12.9898, b = 78.233, c = 43758.5453; + highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); + return fract( sin( sn ) * c ); +} +#ifdef HIGH_PRECISION + float precisionSafeLength( vec3 v ) { return length( v ); } +#else + float precisionSafeLength( vec3 v ) { + float maxComponent = max3( abs( v ) ); + return length( v / maxComponent ) * maxComponent; + } +#endif +struct IncidentLight { + vec3 color; + vec3 direction; + bool visible; +}; +struct ReflectedLight { + vec3 directDiffuse; + vec3 directSpecular; + vec3 indirectDiffuse; + vec3 indirectSpecular; +}; +#ifdef USE_ALPHAHASH + varying vec3 vPosition; +#endif +vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); +} +vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); +} +mat3 transposeMat3( const in mat3 m ) { + mat3 tmp; + tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); + tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); + tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); + return tmp; +} +bool isPerspectiveMatrix( mat4 m ) { + return m[ 2 ][ 3 ] == - 1.0; +} +vec2 equirectUv( in vec3 dir ) { + float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; + float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; + return vec2( u, v ); +} +vec3 BRDF_Lambert( const in vec3 diffuseColor ) { + return RECIPROCAL_PI * diffuseColor; +} +vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} +float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} // validated`,jte=`#ifdef ENVMAP_TYPE_CUBE_UV + #define cubeUV_minMipLevel 4.0 + #define cubeUV_minTileSize 16.0 + float getFace( vec3 direction ) { + vec3 absDirection = abs( direction ); + float face = - 1.0; + if ( absDirection.x > absDirection.z ) { + if ( absDirection.x > absDirection.y ) + face = direction.x > 0.0 ? 0.0 : 3.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } else { + if ( absDirection.z > absDirection.y ) + face = direction.z > 0.0 ? 2.0 : 5.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } + return face; + } + vec2 getUV( vec3 direction, float face ) { + vec2 uv; + if ( face == 0.0 ) { + uv = vec2( direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 1.0 ) { + uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); + } else if ( face == 2.0 ) { + uv = vec2( - direction.x, direction.y ) / abs( direction.z ); + } else if ( face == 3.0 ) { + uv = vec2( - direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 4.0 ) { + uv = vec2( - direction.x, direction.z ) / abs( direction.y ); + } else { + uv = vec2( direction.x, direction.y ) / abs( direction.z ); + } + return 0.5 * ( uv + 1.0 ); + } + vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { + float face = getFace( direction ); + float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); + mipInt = max( mipInt, cubeUV_minMipLevel ); + float faceSize = exp2( mipInt ); + highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; + if ( face > 2.0 ) { + uv.y += faceSize; + face -= 3.0; + } + uv.x += face * faceSize; + uv.x += filterInt * 3.0 * cubeUV_minTileSize; + uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); + uv.x *= CUBEUV_TEXEL_WIDTH; + uv.y *= CUBEUV_TEXEL_HEIGHT; + #ifdef texture2DGradEXT + return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; + #else + return texture2D( envMap, uv ).rgb; + #endif + } + #define cubeUV_r0 1.0 + #define cubeUV_m0 - 2.0 + #define cubeUV_r1 0.8 + #define cubeUV_m1 - 1.0 + #define cubeUV_r4 0.4 + #define cubeUV_m4 2.0 + #define cubeUV_r5 0.305 + #define cubeUV_m5 3.0 + #define cubeUV_r6 0.21 + #define cubeUV_m6 4.0 + float roughnessToMip( float roughness ) { + float mip = 0.0; + if ( roughness >= cubeUV_r1 ) { + mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; + } else if ( roughness >= cubeUV_r4 ) { + mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; + } else if ( roughness >= cubeUV_r5 ) { + mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; + } else if ( roughness >= cubeUV_r6 ) { + mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; + } else { + mip = - 2.0 * log2( 1.16 * roughness ); } + return mip; + } + vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { + float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); + float mipF = fract( mip ); + float mipInt = floor( mip ); + vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); + if ( mipF == 0.0 ) { + return vec4( color0, 1.0 ); + } else { + vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); + return vec4( mix( color0, color1, mipF ), 1.0 ); + } + } +#endif`,Ute=`vec3 transformedNormal = objectNormal; +#ifdef USE_TANGENT + vec3 transformedTangent = objectTangent; +#endif +#ifdef USE_BATCHING + mat3 bm = mat3( batchingMatrix ); + transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); + transformedNormal = bm * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = bm * transformedTangent; + #endif +#endif +#ifdef USE_INSTANCING + mat3 im = mat3( instanceMatrix ); + transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); + transformedNormal = im * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = im * transformedTangent; + #endif +#endif +transformedNormal = normalMatrix * transformedNormal; +#ifdef FLIP_SIDED + transformedNormal = - transformedNormal; +#endif +#ifdef USE_TANGENT + transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; + #ifdef FLIP_SIDED + transformedTangent = - transformedTangent; + #endif +#endif`,Fte=`#ifdef USE_DISPLACEMENTMAP + uniform sampler2D displacementMap; + uniform float displacementScale; + uniform float displacementBias; +#endif`,Bte=`#ifdef USE_DISPLACEMENTMAP + transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); +#endif`,$te=`#ifdef USE_EMISSIVEMAP + vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); + #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE + emissiveColor = sRGBTransferEOTF( emissiveColor ); + #endif + totalEmissiveRadiance *= emissiveColor.rgb; +#endif`,zte=`#ifdef USE_EMISSIVEMAP + uniform sampler2D emissiveMap; +#endif`,Hte="gl_FragColor = linearToOutputTexel( gl_FragColor );",Vte=`vec4 LinearTransferOETF( in vec4 value ) { + return value; +} +vec4 sRGBTransferEOTF( in vec4 value ) { + return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); +} +vec4 sRGBTransferOETF( in vec4 value ) { + return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); +}`,Gte=`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vec3 cameraToFrag; + if ( isOrthographic ) { + cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToFrag = normalize( vWorldPosition - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vec3 reflectVec = reflect( cameraToFrag, worldNormal ); + #else + vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); + #endif + #else + vec3 reflectVec = vReflect; + #endif + #ifdef ENVMAP_TYPE_CUBE + vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); + #else + vec4 envColor = vec4( 0.0 ); + #endif + #ifdef ENVMAP_BLENDING_MULTIPLY + outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_MIX ) + outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_ADD ) + outgoingLight += envColor.xyz * specularStrength * reflectivity; + #endif +#endif`,Wte=`#ifdef USE_ENVMAP + uniform float envMapIntensity; + uniform float flipEnvMap; + uniform mat3 envMapRotation; + #ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; + #else + uniform sampler2D envMap; + #endif + +#endif`,Xte=`#ifdef USE_ENVMAP + uniform float reflectivity; + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + varying vec3 vWorldPosition; + uniform float refractionRatio; + #else + varying vec3 vReflect; + #endif +#endif`,qte=`#ifdef USE_ENVMAP + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + + varying vec3 vWorldPosition; + #else + varying vec3 vReflect; + uniform float refractionRatio; + #endif +#endif`,Kte=`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vWorldPosition = worldPosition.xyz; + #else + vec3 cameraToVertex; + if ( isOrthographic ) { + cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vReflect = reflect( cameraToVertex, worldNormal ); + #else + vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); + #endif + #endif +#endif`,Yte=`#ifdef USE_FOG + vFogDepth = - mvPosition.z; +#endif`,Jte=`#ifdef USE_FOG + varying float vFogDepth; +#endif`,Zte=`#ifdef USE_FOG + #ifdef FOG_EXP2 + float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); + #else + float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); + #endif + gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); +#endif`,Qte=`#ifdef USE_FOG + uniform vec3 fogColor; + varying float vFogDepth; + #ifdef FOG_EXP2 + uniform float fogDensity; + #else + uniform float fogNear; + uniform float fogFar; + #endif +#endif`,ene=`#ifdef USE_GRADIENTMAP + uniform sampler2D gradientMap; +#endif +vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { + float dotNL = dot( normal, lightDirection ); + vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); + #ifdef USE_GRADIENTMAP + return vec3( texture2D( gradientMap, coord ).r ); + #else + vec2 fw = fwidth( coord ) * 0.5; + return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); + #endif +}`,tne=`#ifdef USE_LIGHTMAP + uniform sampler2D lightMap; + uniform float lightMapIntensity; +#endif`,nne=`LambertMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularStrength = specularStrength;`,rne=`varying vec3 vViewPosition; +struct LambertMaterial { + vec3 diffuseColor; + float specularStrength; +}; +void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Lambert +#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,ine=`uniform bool receiveShadow; +uniform vec3 ambientLightColor; +#if defined( USE_LIGHT_PROBES ) + uniform vec3 lightProbe[ 9 ]; +#endif +vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { + float x = normal.x, y = normal.y, z = normal.z; + vec3 result = shCoefficients[ 0 ] * 0.886227; + result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; + result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; + result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; + result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; + result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; + result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); + result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; + result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); + return result; +} +vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); + return irradiance; +} +vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { + vec3 irradiance = ambientLightColor; + return irradiance; +} +float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { + float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); + if ( cutoffDistance > 0.0 ) { + distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); + } + return distanceFalloff; +} +float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { + return smoothstep( coneCosine, penumbraCosine, angleCosine ); +} +#if NUM_DIR_LIGHTS > 0 + struct DirectionalLight { + vec3 direction; + vec3 color; + }; + uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; + void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { + light.color = directionalLight.color; + light.direction = directionalLight.direction; + light.visible = true; + } +#endif +#if NUM_POINT_LIGHTS > 0 + struct PointLight { + vec3 position; + vec3 color; + float distance; + float decay; + }; + uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; + void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = pointLight.position - geometryPosition; + light.direction = normalize( lVector ); + float lightDistance = length( lVector ); + light.color = pointLight.color; + light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } +#endif +#if NUM_SPOT_LIGHTS > 0 + struct SpotLight { + vec3 position; + vec3 direction; + vec3 color; + float distance; + float decay; + float coneCos; + float penumbraCos; + }; + uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; + void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = spotLight.position - geometryPosition; + light.direction = normalize( lVector ); + float angleCos = dot( light.direction, spotLight.direction ); + float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); + if ( spotAttenuation > 0.0 ) { + float lightDistance = length( lVector ); + light.color = spotLight.color * spotAttenuation; + light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } else { + light.color = vec3( 0.0 ); + light.visible = false; + } + } +#endif +#if NUM_RECT_AREA_LIGHTS > 0 + struct RectAreaLight { + vec3 color; + vec3 position; + vec3 halfWidth; + vec3 halfHeight; + }; + uniform sampler2D ltc_1; uniform sampler2D ltc_2; + uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; +#endif +#if NUM_HEMI_LIGHTS > 0 + struct HemisphereLight { + vec3 direction; + vec3 skyColor; + vec3 groundColor; + }; + uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; + vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { + float dotNL = dot( normal, hemiLight.direction ); + float hemiDiffuseWeight = 0.5 * dotNL + 0.5; + vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); + return irradiance; + } +#endif`,one=`#ifdef USE_ENVMAP + vec3 getIBLIrradiance( const in vec3 normal ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 ); + return PI * envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 reflectVec = reflect( - viewDir, normal ); + reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); + reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness ); + return envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + #ifdef USE_ANISOTROPY + vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 bentNormal = cross( bitangent, viewDir ); + bentNormal = normalize( cross( bentNormal, bitangent ) ); + bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); + return getIBLRadiance( viewDir, bentNormal, roughness ); + #else + return vec3( 0.0 ); + #endif + } + #endif +#endif`,ane=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,sne=`varying vec3 vViewPosition; +struct ToonMaterial { + vec3 diffuseColor; +}; +void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Toon +#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,lne=`BlinnPhongMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularColor = specular; +material.specularShininess = shininess; +material.specularStrength = specularStrength;`,cne=`varying vec3 vViewPosition; +struct BlinnPhongMaterial { + vec3 diffuseColor; + vec3 specularColor; + float specularShininess; + float specularStrength; +}; +void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); + reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; +} +void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_BlinnPhong +#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,une=`PhysicalMaterial material; +material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); +vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); +float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); +material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; +material.roughness = min( material.roughness, 1.0 ); +#ifdef IOR + material.ior = ior; + #ifdef USE_SPECULAR + float specularIntensityFactor = specularIntensity; + vec3 specularColorFactor = specularColor; + #ifdef USE_SPECULAR_COLORMAP + specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; + #endif + material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); + #else + float specularIntensityFactor = 1.0; + vec3 specularColorFactor = vec3( 1.0 ); + material.specularF90 = 1.0; + #endif + material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); +#else + material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor ); + material.specularF90 = 1.0; +#endif +#ifdef USE_CLEARCOAT + material.clearcoat = clearcoat; + material.clearcoatRoughness = clearcoatRoughness; + material.clearcoatF0 = vec3( 0.04 ); + material.clearcoatF90 = 1.0; + #ifdef USE_CLEARCOATMAP + material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; + #endif + #ifdef USE_CLEARCOAT_ROUGHNESSMAP + material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; + #endif + material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); + material.clearcoatRoughness += geometryRoughness; + material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); +#endif +#ifdef USE_DISPERSION + material.dispersion = dispersion; +#endif +#ifdef USE_IRIDESCENCE + material.iridescence = iridescence; + material.iridescenceIOR = iridescenceIOR; + #ifdef USE_IRIDESCENCEMAP + material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; + #endif + #ifdef USE_IRIDESCENCE_THICKNESSMAP + material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; + #else + material.iridescenceThickness = iridescenceThicknessMaximum; + #endif +#endif +#ifdef USE_SHEEN + material.sheenColor = sheenColor; + #ifdef USE_SHEEN_COLORMAP + material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; + #endif + material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); + #ifdef USE_SHEEN_ROUGHNESSMAP + material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; + #endif +#endif +#ifdef USE_ANISOTROPY + #ifdef USE_ANISOTROPYMAP + mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); + vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; + vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; + #else + vec2 anisotropyV = anisotropyVector; + #endif + material.anisotropy = length( anisotropyV ); + if( material.anisotropy == 0.0 ) { + anisotropyV = vec2( 1.0, 0.0 ); + } else { + anisotropyV /= material.anisotropy; + material.anisotropy = saturate( material.anisotropy ); + } + material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); + material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; + material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; +#endif`,dne=`struct PhysicalMaterial { + vec3 diffuseColor; + float roughness; + vec3 specularColor; + float specularF90; + float dispersion; + #ifdef USE_CLEARCOAT + float clearcoat; + float clearcoatRoughness; + vec3 clearcoatF0; + float clearcoatF90; + #endif + #ifdef USE_IRIDESCENCE + float iridescence; + float iridescenceIOR; + float iridescenceThickness; + vec3 iridescenceFresnel; + vec3 iridescenceF0; + #endif + #ifdef USE_SHEEN + vec3 sheenColor; + float sheenRoughness; + #endif + #ifdef IOR + float ior; + #endif + #ifdef USE_TRANSMISSION + float transmission; + float transmissionAlpha; + float thickness; + float attenuationDistance; + vec3 attenuationColor; + #endif + #ifdef USE_ANISOTROPY + float anisotropy; + float alphaT; + vec3 anisotropyT; + vec3 anisotropyB; + #endif +}; +vec3 clearcoatSpecularDirect = vec3( 0.0 ); +vec3 clearcoatSpecularIndirect = vec3( 0.0 ); +vec3 sheenSpecularDirect = vec3( 0.0 ); +vec3 sheenSpecularIndirect = vec3(0.0 ); +vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { + float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); + float x2 = x * x; + float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); + return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); +} +float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { + float a2 = pow2( alpha ); + float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); + float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); + return 0.5 / max( gv + gl, EPSILON ); +} +float D_GGX( const in float alpha, const in float dotNH ) { + float a2 = pow2( alpha ); + float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; + return RECIPROCAL_PI * a2 / pow2( denom ); +} +#ifdef USE_ANISOTROPY + float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) { + float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); + float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); + float v = 0.5 / ( gv + gl ); + return saturate(v); + } + float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { + float a2 = alphaT * alphaB; + highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); + highp float v2 = dot( v, v ); + float w2 = a2 / v2; + return RECIPROCAL_PI * a2 * pow2 ( w2 ); + } +#endif +#ifdef USE_CLEARCOAT + vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { + vec3 f0 = material.clearcoatF0; + float f90 = material.clearcoatF90; + float roughness = material.clearcoatRoughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + return F * ( V * D ); + } +#endif +vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { + vec3 f0 = material.specularColor; + float f90 = material.specularF90; + float roughness = material.roughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + #ifdef USE_IRIDESCENCE + F = mix( F, material.iridescenceFresnel, material.iridescence ); + #endif + #ifdef USE_ANISOTROPY + float dotTL = dot( material.anisotropyT, lightDir ); + float dotTV = dot( material.anisotropyT, viewDir ); + float dotTH = dot( material.anisotropyT, halfDir ); + float dotBL = dot( material.anisotropyB, lightDir ); + float dotBV = dot( material.anisotropyB, viewDir ); + float dotBH = dot( material.anisotropyB, halfDir ); + float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); + float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); + #else + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + #endif + return F * ( V * D ); +} +vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { + const float LUT_SIZE = 64.0; + const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; + const float LUT_BIAS = 0.5 / LUT_SIZE; + float dotNV = saturate( dot( N, V ) ); + vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); + uv = uv * LUT_SCALE + LUT_BIAS; + return uv; +} +float LTC_ClippedSphereFormFactor( const in vec3 f ) { + float l = length( f ); + return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); +} +vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { + float x = dot( v1, v2 ); + float y = abs( x ); + float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; + float b = 3.4175940 + ( 4.1616724 + y ) * y; + float v = a / b; + float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; + return cross( v1, v2 ) * theta_sintheta; +} +vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { + vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; + vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; + vec3 lightNormal = cross( v1, v2 ); + if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); + vec3 T1, T2; + T1 = normalize( V - N * dot( V, N ) ); + T2 = - cross( N, T1 ); + mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); + vec3 coords[ 4 ]; + coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); + coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); + coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); + coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); + coords[ 0 ] = normalize( coords[ 0 ] ); + coords[ 1 ] = normalize( coords[ 1 ] ); + coords[ 2 ] = normalize( coords[ 2 ] ); + coords[ 3 ] = normalize( coords[ 3 ] ); + vec3 vectorFormFactor = vec3( 0.0 ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); + float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); + return vec3( result ); +} +#if defined( USE_SHEEN ) +float D_Charlie( float roughness, float dotNH ) { + float alpha = pow2( roughness ); + float invAlpha = 1.0 / alpha; + float cos2h = dotNH * dotNH; + float sin2h = max( 1.0 - cos2h, 0.0078125 ); + return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); +} +float V_Neubelt( float dotNV, float dotNL ) { + return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); +} +vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float D = D_Charlie( sheenRoughness, dotNH ); + float V = V_Neubelt( dotNV, dotNL ); + return sheenColor * ( D * V ); +} +#endif +float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + float r2 = roughness * roughness; + float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; + float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; + float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); + return saturate( DG * RECIPROCAL_PI ); +} +vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); + const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); + vec4 r = roughness * c0 + c1; + float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; + vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; + return fab; +} +vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { + vec2 fab = DFGApprox( normal, viewDir, roughness ); + return specularColor * fab.x + specularF90 * fab.y; +} +#ifdef USE_IRIDESCENCE +void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#else +void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#endif + vec2 fab = DFGApprox( normal, viewDir, roughness ); + #ifdef USE_IRIDESCENCE + vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); + #else + vec3 Fr = specularColor; + #endif + vec3 FssEss = Fr * fab.x + specularF90 * fab.y; + float Ess = fab.x + fab.y; + float Ems = 1.0 - Ess; + vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); + singleScatter += FssEss; + multiScatter += Fms * Ems; +} +#if NUM_RECT_AREA_LIGHTS > 0 + void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + vec3 normal = geometryNormal; + vec3 viewDir = geometryViewDir; + vec3 position = geometryPosition; + vec3 lightPos = rectAreaLight.position; + vec3 halfWidth = rectAreaLight.halfWidth; + vec3 halfHeight = rectAreaLight.halfHeight; + vec3 lightColor = rectAreaLight.color; + float roughness = material.roughness; + vec3 rectCoords[ 4 ]; + rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; + rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; + rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; + vec2 uv = LTC_Uv( normal, viewDir, roughness ); + vec4 t1 = texture2D( ltc_1, uv ); + vec4 t2 = texture2D( ltc_2, uv ); + mat3 mInv = mat3( + vec3( t1.x, 0, t1.y ), + vec3( 0, 1, 0 ), + vec3( t1.z, 0, t1.w ) + ); + vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); + reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); + reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); + } +#endif +void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + #ifdef USE_CLEARCOAT + float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); + vec3 ccIrradiance = dotNLcc * directLight.color; + clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); + #endif + #ifdef USE_SHEEN + sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); + #endif + reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material ); + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { + #ifdef USE_CLEARCOAT + clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); + #endif + #ifdef USE_SHEEN + sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); + #endif + vec3 singleScattering = vec3( 0.0 ); + vec3 multiScattering = vec3( 0.0 ); + vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; + #ifdef USE_IRIDESCENCE + computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); + #else + computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); + #endif + vec3 totalScattering = singleScattering + multiScattering; + vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); + reflectedLight.indirectSpecular += radiance * singleScattering; + reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; + reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; +} +#define RE_Direct RE_Direct_Physical +#define RE_Direct_RectArea RE_Direct_RectArea_Physical +#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical +#define RE_IndirectSpecular RE_IndirectSpecular_Physical +float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { + return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); +}`,fne=` +vec3 geometryPosition = - vViewPosition; +vec3 geometryNormal = normal; +vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); +vec3 geometryClearcoatNormal = vec3( 0.0 ); +#ifdef USE_CLEARCOAT + geometryClearcoatNormal = clearcoatNormal; +#endif +#ifdef USE_IRIDESCENCE + float dotNVi = saturate( dot( normal, geometryViewDir ) ); + if ( material.iridescenceThickness == 0.0 ) { + material.iridescence = 0.0; + } else { + material.iridescence = saturate( material.iridescence ); + } + if ( material.iridescence > 0.0 ) { + material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); + material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); + } +#endif +IncidentLight directLight; +#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) + PointLight pointLight; + #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { + pointLight = pointLights[ i ]; + getPointLightInfo( pointLight, geometryPosition, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) + pointLightShadow = pointLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) + SpotLight spotLight; + vec4 spotColor; + vec3 spotLightCoord; + bool inSpotLightMap; + #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { + spotLight = spotLights[ i ]; + getSpotLightInfo( spotLight, geometryPosition, directLight ); + #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX + #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS + #else + #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #endif + #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) + spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; + inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); + spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); + directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; + #endif + #undef SPOT_LIGHT_MAP_INDEX + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + spotLightShadow = spotLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) + DirectionalLight directionalLight; + #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { + directionalLight = directionalLights[ i ]; + getDirectionalLightInfo( directionalLight, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) + directionalLightShadow = directionalLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) + RectAreaLight rectAreaLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { + rectAreaLight = rectAreaLights[ i ]; + RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if defined( RE_IndirectDiffuse ) + vec3 iblIrradiance = vec3( 0.0 ); + vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); + #if defined( USE_LIGHT_PROBES ) + irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); + #endif + #if ( NUM_HEMI_LIGHTS > 0 ) + #pragma unroll_loop_start + for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { + irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); + } + #pragma unroll_loop_end + #endif +#endif +#if defined( RE_IndirectSpecular ) + vec3 radiance = vec3( 0.0 ); + vec3 clearcoatRadiance = vec3( 0.0 ); +#endif`,hne=`#if defined( RE_IndirectDiffuse ) + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; + irradiance += lightMapIrradiance; + #endif + #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) + iblIrradiance += getIBLIrradiance( geometryNormal ); + #endif +#endif +#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) + #ifdef USE_ANISOTROPY + radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); + #else + radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); + #endif + #ifdef USE_CLEARCOAT + clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); + #endif +#endif`,pne=`#if defined( RE_IndirectDiffuse ) + RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); +#endif +#if defined( RE_IndirectSpecular ) + RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); +#endif`,mne=`#if defined( USE_LOGDEPTHBUF ) + gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; +#endif`,gne=`#if defined( USE_LOGDEPTHBUF ) + uniform float logDepthBufFC; + varying float vFragDepth; + varying float vIsPerspective; +#endif`,vne=`#ifdef USE_LOGDEPTHBUF + varying float vFragDepth; + varying float vIsPerspective; +#endif`,yne=`#ifdef USE_LOGDEPTHBUF + vFragDepth = 1.0 + gl_Position.w; + vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); +#endif`,xne=`#ifdef USE_MAP + vec4 sampledDiffuseColor = texture2D( map, vMapUv ); + #ifdef DECODE_VIDEO_TEXTURE + sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor ); + #endif + diffuseColor *= sampledDiffuseColor; +#endif`,bne=`#ifdef USE_MAP + uniform sampler2D map; +#endif`,_ne=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + #if defined( USE_POINTS_UV ) + vec2 uv = vUv; + #else + vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; + #endif +#endif +#ifdef USE_MAP + diffuseColor *= texture2D( map, uv ); +#endif +#ifdef USE_ALPHAMAP + diffuseColor.a *= texture2D( alphaMap, uv ).g; +#endif`,wne=`#if defined( USE_POINTS_UV ) + varying vec2 vUv; +#else + #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + uniform mat3 uvTransform; + #endif +#endif +#ifdef USE_MAP + uniform sampler2D map; +#endif +#ifdef USE_ALPHAMAP + uniform sampler2D alphaMap; +#endif`,Sne=`float metalnessFactor = metalness; +#ifdef USE_METALNESSMAP + vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); + metalnessFactor *= texelMetalness.b; +#endif`,Ene=`#ifdef USE_METALNESSMAP + uniform sampler2D metalnessMap; +#endif`,Tne=`#ifdef USE_INSTANCING_MORPH + float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; + } +#endif`,Mne=`#if defined( USE_MORPHCOLORS ) + vColor *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + #if defined( USE_COLOR_ALPHA ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; + #elif defined( USE_COLOR ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; + #endif + } +#endif`,Ane=`#ifdef USE_MORPHNORMALS + objectNormal *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; + } +#endif`,Cne=`#ifdef USE_MORPHTARGETS + #ifndef USE_INSTANCING_MORPH + uniform float morphTargetBaseInfluence; + uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + #endif + uniform sampler2DArray morphTargetsTexture; + uniform ivec2 morphTargetsTextureSize; + vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { + int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; + int y = texelIndex / morphTargetsTextureSize.x; + int x = texelIndex - y * morphTargetsTextureSize.x; + ivec3 morphUV = ivec3( x, y, morphTargetIndex ); + return texelFetch( morphTargetsTexture, morphUV, 0 ); + } +#endif`,Pne=`#ifdef USE_MORPHTARGETS + transformed *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; + } +#endif`,Rne=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; +#ifdef FLAT_SHADED + vec3 fdx = dFdx( vViewPosition ); + vec3 fdy = dFdy( vViewPosition ); + vec3 normal = normalize( cross( fdx, fdy ) ); +#else + vec3 normal = normalize( vNormal ); + #ifdef DOUBLE_SIDED + normal *= faceDirection; + #endif +#endif +#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) + #ifdef USE_TANGENT + mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn = getTangentFrame( - vViewPosition, normal, + #if defined( USE_NORMALMAP ) + vNormalMapUv + #elif defined( USE_CLEARCOAT_NORMALMAP ) + vClearcoatNormalMapUv + #else + vUv + #endif + ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn[0] *= faceDirection; + tbn[1] *= faceDirection; + #endif +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + #ifdef USE_TANGENT + mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn2[0] *= faceDirection; + tbn2[1] *= faceDirection; + #endif +#endif +vec3 nonPerturbedNormal = normal;`,Nne=`#ifdef USE_NORMALMAP_OBJECTSPACE + normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + #ifdef FLIP_SIDED + normal = - normal; + #endif + #ifdef DOUBLE_SIDED + normal = normal * faceDirection; + #endif + normal = normalize( normalMatrix * normal ); +#elif defined( USE_NORMALMAP_TANGENTSPACE ) + vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + mapN.xy *= normalScale; + normal = normalize( tbn * mapN ); +#elif defined( USE_BUMPMAP ) + normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); +#endif`,One=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,Ine=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,Dne=`#ifndef FLAT_SHADED + vNormal = normalize( transformedNormal ); + #ifdef USE_TANGENT + vTangent = normalize( transformedTangent ); + vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); + #endif +#endif`,Lne=`#ifdef USE_NORMALMAP + uniform sampler2D normalMap; + uniform vec2 normalScale; +#endif +#ifdef USE_NORMALMAP_OBJECTSPACE + uniform mat3 normalMatrix; +#endif +#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) + mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { + vec3 q0 = dFdx( eye_pos.xyz ); + vec3 q1 = dFdy( eye_pos.xyz ); + vec2 st0 = dFdx( uv.st ); + vec2 st1 = dFdy( uv.st ); + vec3 N = surf_norm; + vec3 q1perp = cross( q1, N ); + vec3 q0perp = cross( N, q0 ); + vec3 T = q1perp * st0.x + q0perp * st1.x; + vec3 B = q1perp * st0.y + q0perp * st1.y; + float det = max( dot( T, T ), dot( B, B ) ); + float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); + return mat3( T * scale, B * scale, N ); + } +#endif`,kne=`#ifdef USE_CLEARCOAT + vec3 clearcoatNormal = nonPerturbedNormal; +#endif`,jne=`#ifdef USE_CLEARCOAT_NORMALMAP + vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; + clearcoatMapN.xy *= clearcoatNormalScale; + clearcoatNormal = normalize( tbn2 * clearcoatMapN ); +#endif`,Une=`#ifdef USE_CLEARCOATMAP + uniform sampler2D clearcoatMap; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform sampler2D clearcoatNormalMap; + uniform vec2 clearcoatNormalScale; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform sampler2D clearcoatRoughnessMap; +#endif`,Fne=`#ifdef USE_IRIDESCENCEMAP + uniform sampler2D iridescenceMap; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform sampler2D iridescenceThicknessMap; +#endif`,Bne=`#ifdef OPAQUE +diffuseColor.a = 1.0; +#endif +#ifdef USE_TRANSMISSION +diffuseColor.a *= material.transmissionAlpha; +#endif +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,$ne=`vec3 packNormalToRGB( const in vec3 normal ) { + return normalize( normal ) * 0.5 + 0.5; +} +vec3 unpackRGBToNormal( const in vec3 rgb ) { + return 2.0 * rgb.xyz - 1.0; +} +const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.; +const float Inv255 = 1. / 255.; +const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 ); +const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g ); +const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b ); +const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a ); +vec4 packDepthToRGBA( const in float v ) { + if( v <= 0.0 ) + return vec4( 0., 0., 0., 0. ); + if( v >= 1.0 ) + return vec4( 1., 1., 1., 1. ); + float vuf; + float af = modf( v * PackFactors.a, vuf ); + float bf = modf( vuf * ShiftRight8, vuf ); + float gf = modf( vuf * ShiftRight8, vuf ); + return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af ); +} +vec3 packDepthToRGB( const in float v ) { + if( v <= 0.0 ) + return vec3( 0., 0., 0. ); + if( v >= 1.0 ) + return vec3( 1., 1., 1. ); + float vuf; + float bf = modf( v * PackFactors.b, vuf ); + float gf = modf( vuf * ShiftRight8, vuf ); + return vec3( vuf * Inv255, gf * PackUpscale, bf ); +} +vec2 packDepthToRG( const in float v ) { + if( v <= 0.0 ) + return vec2( 0., 0. ); + if( v >= 1.0 ) + return vec2( 1., 1. ); + float vuf; + float gf = modf( v * 256., vuf ); + return vec2( vuf * Inv255, gf ); +} +float unpackRGBAToDepth( const in vec4 v ) { + return dot( v, UnpackFactors4 ); +} +float unpackRGBToDepth( const in vec3 v ) { + return dot( v, UnpackFactors3 ); +} +float unpackRGToDepth( const in vec2 v ) { + return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g; +} +vec4 pack2HalfToRGBA( const in vec2 v ) { + vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); + return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); +} +vec2 unpackRGBATo2Half( const in vec4 v ) { + return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); +} +float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { + return ( viewZ + near ) / ( near - far ); +} +float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { + return depth * ( near - far ) - near; +} +float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { + return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); +} +float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { + return ( near * far ) / ( ( far - near ) * depth - far ); +}`,zne=`#ifdef PREMULTIPLIED_ALPHA + gl_FragColor.rgb *= gl_FragColor.a; +#endif`,Hne=`vec4 mvPosition = vec4( transformed, 1.0 ); +#ifdef USE_BATCHING + mvPosition = batchingMatrix * mvPosition; +#endif +#ifdef USE_INSTANCING + mvPosition = instanceMatrix * mvPosition; +#endif +mvPosition = modelViewMatrix * mvPosition; +gl_Position = projectionMatrix * mvPosition;`,Vne=`#ifdef DITHERING + gl_FragColor.rgb = dithering( gl_FragColor.rgb ); +#endif`,Gne=`#ifdef DITHERING + vec3 dithering( vec3 color ) { + float grid_position = rand( gl_FragCoord.xy ); + vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); + dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); + return color + dither_shift_RGB; + } +#endif`,Wne=`float roughnessFactor = roughness; +#ifdef USE_ROUGHNESSMAP + vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); + roughnessFactor *= texelRoughness.g; +#endif`,Xne=`#ifdef USE_ROUGHNESSMAP + uniform sampler2D roughnessMap; +#endif`,qne=`#if NUM_SPOT_LIGHT_COORDS > 0 + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#if NUM_SPOT_LIGHT_MAPS > 0 + uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; + struct SpotLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif + float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { + return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); + } + vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { + return unpackRGBATo2Half( texture2D( shadow, uv ) ); + } + float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ + float occlusion = 1.0; + vec2 distribution = texture2DDistribution( shadow, uv ); + float hard_shadow = step( compare , distribution.x ); + if (hard_shadow != 1.0 ) { + float distance = compare - distribution.x ; + float variance = max( 0.00000, distribution.y * distribution.y ); + float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); + } + return occlusion; + } + float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { + float shadow = 1.0; + shadowCoord.xyz /= shadowCoord.w; + shadowCoord.z += shadowBias; + bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; + bool frustumTest = inFrustum && shadowCoord.z <= 1.0; + if ( frustumTest ) { + #if defined( SHADOWMAP_TYPE_PCF ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx0 = - texelSize.x * shadowRadius; + float dy0 = - texelSize.y * shadowRadius; + float dx1 = + texelSize.x * shadowRadius; + float dy1 = + texelSize.y * shadowRadius; + float dx2 = dx0 / 2.0; + float dy2 = dy0 / 2.0; + float dx3 = dx1 / 2.0; + float dy3 = dy1 / 2.0; + shadow = ( + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) + ) * ( 1.0 / 17.0 ); + #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx = texelSize.x; + float dy = texelSize.y; + vec2 uv = shadowCoord.xy; + vec2 f = fract( uv * shadowMapSize + 0.5 ); + uv -= f * texelSize; + shadow = ( + texture2DCompare( shadowMap, uv, shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), + f.x ), + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), + f.x ), + f.y ) + ) * ( 1.0 / 9.0 ); + #elif defined( SHADOWMAP_TYPE_VSM ) + shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); + #else + shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); + #endif + } + return mix( 1.0, shadow, shadowIntensity ); + } + vec2 cubeToUV( vec3 v, float texelSizeY ) { + vec3 absV = abs( v ); + float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); + absV *= scaleToCube; + v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); + vec2 planar = v.xy; + float almostATexel = 1.5 * texelSizeY; + float almostOne = 1.0 - almostATexel; + if ( absV.z >= almostOne ) { + if ( v.z > 0.0 ) + planar.x = 4.0 - v.x; + } else if ( absV.x >= almostOne ) { + float signX = sign( v.x ); + planar.x = v.z * signX + 2.0 * signX; + } else if ( absV.y >= almostOne ) { + float signY = sign( v.y ); + planar.x = v.x + 2.0 * signY + 2.0; + planar.y = v.z * signY - 2.0; + } + return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); + } + float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { + float shadow = 1.0; + vec3 lightToPosition = shadowCoord.xyz; + + float lightToPositionLength = length( lightToPosition ); + if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) { + float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; + vec3 bd3D = normalize( lightToPosition ); + vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); + #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) + vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; + shadow = ( + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) + ) * ( 1.0 / 9.0 ); + #else + shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); + #endif + } + return mix( 1.0, shadow, shadowIntensity ); + } +#endif`,Kne=`#if NUM_SPOT_LIGHT_COORDS > 0 + uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + struct SpotLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif +#endif`,Yne=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) + vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); + vec4 shadowWorldPosition; +#endif +#if defined( USE_SHADOWMAP ) + #if NUM_DIR_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); + vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); + vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif +#endif +#if NUM_SPOT_LIGHT_COORDS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { + shadowWorldPosition = worldPosition; + #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; + #endif + vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end +#endif`,Jne=`float getShadowMask() { + float shadow = 1.0; + #ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + directionalLight = directionalLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { + spotLight = spotLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + pointLight = pointLightShadows[ i ]; + shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; + } + #pragma unroll_loop_end + #endif + #endif + return shadow; +}`,Zne=`#ifdef USE_SKINNING + mat4 boneMatX = getBoneMatrix( skinIndex.x ); + mat4 boneMatY = getBoneMatrix( skinIndex.y ); + mat4 boneMatZ = getBoneMatrix( skinIndex.z ); + mat4 boneMatW = getBoneMatrix( skinIndex.w ); +#endif`,Qne=`#ifdef USE_SKINNING + uniform mat4 bindMatrix; + uniform mat4 bindMatrixInverse; + uniform highp sampler2D boneTexture; + mat4 getBoneMatrix( const in float i ) { + int size = textureSize( boneTexture, 0 ).x; + int j = int( i ) * 4; + int x = j % size; + int y = j / size; + vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); + vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); + vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); + vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); + return mat4( v1, v2, v3, v4 ); + } +#endif`,ere=`#ifdef USE_SKINNING + vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); + vec4 skinned = vec4( 0.0 ); + skinned += boneMatX * skinVertex * skinWeight.x; + skinned += boneMatY * skinVertex * skinWeight.y; + skinned += boneMatZ * skinVertex * skinWeight.z; + skinned += boneMatW * skinVertex * skinWeight.w; + transformed = ( bindMatrixInverse * skinned ).xyz; +#endif`,tre=`#ifdef USE_SKINNING + mat4 skinMatrix = mat4( 0.0 ); + skinMatrix += skinWeight.x * boneMatX; + skinMatrix += skinWeight.y * boneMatY; + skinMatrix += skinWeight.z * boneMatZ; + skinMatrix += skinWeight.w * boneMatW; + skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; + objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; + #ifdef USE_TANGENT + objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; + #endif +#endif`,nre=`float specularStrength; +#ifdef USE_SPECULARMAP + vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); + specularStrength = texelSpecular.r; +#else + specularStrength = 1.0; +#endif`,rre=`#ifdef USE_SPECULARMAP + uniform sampler2D specularMap; +#endif`,ire=`#if defined( TONE_MAPPING ) + gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); +#endif`,ore=`#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +uniform float toneMappingExposure; +vec3 LinearToneMapping( vec3 color ) { + return saturate( toneMappingExposure * color ); +} +vec3 ReinhardToneMapping( vec3 color ) { + color *= toneMappingExposure; + return saturate( color / ( vec3( 1.0 ) + color ) ); +} +vec3 CineonToneMapping( vec3 color ) { + color *= toneMappingExposure; + color = max( vec3( 0.0 ), color - 0.004 ); + return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); +} +vec3 RRTAndODTFit( vec3 v ) { + vec3 a = v * ( v + 0.0245786 ) - 0.000090537; + vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; + return a / b; +} +vec3 ACESFilmicToneMapping( vec3 color ) { + const mat3 ACESInputMat = mat3( + vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), + vec3( 0.04823, 0.01566, 0.83777 ) + ); + const mat3 ACESOutputMat = mat3( + vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), + vec3( -0.07367, -0.00605, 1.07602 ) + ); + color *= toneMappingExposure / 0.6; + color = ACESInputMat * color; + color = RRTAndODTFit( color ); + color = ACESOutputMat * color; + return saturate( color ); +} +const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( + vec3( 1.6605, - 0.1246, - 0.0182 ), + vec3( - 0.5876, 1.1329, - 0.1006 ), + vec3( - 0.0728, - 0.0083, 1.1187 ) +); +const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( + vec3( 0.6274, 0.0691, 0.0164 ), + vec3( 0.3293, 0.9195, 0.0880 ), + vec3( 0.0433, 0.0113, 0.8956 ) +); +vec3 agxDefaultContrastApprox( vec3 x ) { + vec3 x2 = x * x; + vec3 x4 = x2 * x2; + return + 15.5 * x4 * x2 + - 40.14 * x4 * x + + 31.96 * x4 + - 6.868 * x2 * x + + 0.4298 * x2 + + 0.1191 * x + - 0.00232; +} +vec3 AgXToneMapping( vec3 color ) { + const mat3 AgXInsetMatrix = mat3( + vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), + vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), + vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) + ); + const mat3 AgXOutsetMatrix = mat3( + vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), + vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), + vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) + ); + const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; + color *= toneMappingExposure; + color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; + color = AgXInsetMatrix * color; + color = max( color, 1e-10 ); color = log2( color ); + color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); + color = clamp( color, 0.0, 1.0 ); + color = agxDefaultContrastApprox( color ); + color = AgXOutsetMatrix * color; + color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); + color = LINEAR_REC2020_TO_LINEAR_SRGB * color; + color = clamp( color, 0.0, 1.0 ); + return color; +} +vec3 NeutralToneMapping( vec3 color ) { + const float StartCompression = 0.8 - 0.04; + const float Desaturation = 0.15; + color *= toneMappingExposure; + float x = min( color.r, min( color.g, color.b ) ); + float offset = x < 0.08 ? x - 6.25 * x * x : 0.04; + color -= offset; + float peak = max( color.r, max( color.g, color.b ) ); + if ( peak < StartCompression ) return color; + float d = 1. - StartCompression; + float newPeak = 1. - d * d / ( peak + d - StartCompression ); + color *= newPeak / peak; + float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); + return mix( color, vec3( newPeak ), g ); +} +vec3 CustomToneMapping( vec3 color ) { return color; }`,are=`#ifdef USE_TRANSMISSION + material.transmission = transmission; + material.transmissionAlpha = 1.0; + material.thickness = thickness; + material.attenuationDistance = attenuationDistance; + material.attenuationColor = attenuationColor; + #ifdef USE_TRANSMISSIONMAP + material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; + #endif + #ifdef USE_THICKNESSMAP + material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; + #endif + vec3 pos = vWorldPosition; + vec3 v = normalize( cameraPosition - pos ); + vec3 n = inverseTransformDirection( normal, viewMatrix ); + vec4 transmitted = getIBLVolumeRefraction( + n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, + pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness, + material.attenuationColor, material.attenuationDistance ); + material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); + totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); +#endif`,sre=`#ifdef USE_TRANSMISSION + uniform float transmission; + uniform float thickness; + uniform float attenuationDistance; + uniform vec3 attenuationColor; + #ifdef USE_TRANSMISSIONMAP + uniform sampler2D transmissionMap; + #endif + #ifdef USE_THICKNESSMAP + uniform sampler2D thicknessMap; + #endif + uniform vec2 transmissionSamplerSize; + uniform sampler2D transmissionSamplerMap; + uniform mat4 modelMatrix; + uniform mat4 projectionMatrix; + varying vec3 vWorldPosition; + float w0( float a ) { + return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); + } + float w1( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); + } + float w2( float a ){ + return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); + } + float w3( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * a ); + } + float g0( float a ) { + return w0( a ) + w1( a ); + } + float g1( float a ) { + return w2( a ) + w3( a ); + } + float h0( float a ) { + return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); + } + float h1( float a ) { + return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); + } + vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { + uv = uv * texelSize.zw + 0.5; + vec2 iuv = floor( uv ); + vec2 fuv = fract( uv ); + float g0x = g0( fuv.x ); + float g1x = g1( fuv.x ); + float h0x = h0( fuv.x ); + float h1x = h1( fuv.x ); + float h0y = h0( fuv.y ); + float h1y = h1( fuv.y ); + vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + + g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); + } + vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { + vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); + vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); + vec2 fLodSizeInv = 1.0 / fLodSize; + vec2 cLodSizeInv = 1.0 / cLodSize; + vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); + vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); + return mix( fSample, cSample, fract( lod ) ); + } + vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { + vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); + vec3 modelScale; + modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); + modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); + modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); + return normalize( refractionVector ) * thickness * modelScale; + } + float applyIorToRoughness( const in float roughness, const in float ior ) { + return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); + } + vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { + float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); + return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); + } + vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { + if ( isinf( attenuationDistance ) ) { + return vec3( 1.0 ); + } else { + vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; + vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; + } + } + vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, + const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, + const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness, + const in vec3 attenuationColor, const in float attenuationDistance ) { + vec4 transmittedLight; + vec3 transmittance; + #ifdef USE_DISPERSION + float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion; + vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread ); + for ( int i = 0; i < 3; i ++ ) { + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] ); + transmittedLight[ i ] = transmissionSample[ i ]; + transmittedLight.a += transmissionSample.a; + transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ]; + } + transmittedLight.a /= 3.0; + #else + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); + transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); + #endif + vec3 attenuatedColor = transmittance * transmittedLight.rgb; + vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); + float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; + return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); + } +#endif`,lre=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + varying vec2 vNormalMapUv; +#endif +#ifdef USE_EMISSIVEMAP + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_SPECULARMAP + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,cre=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + uniform mat3 mapTransform; + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + uniform mat3 alphaMapTransform; + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + uniform mat3 lightMapTransform; + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + uniform mat3 aoMapTransform; + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + uniform mat3 bumpMapTransform; + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + uniform mat3 normalMapTransform; + varying vec2 vNormalMapUv; +#endif +#ifdef USE_DISPLACEMENTMAP + uniform mat3 displacementMapTransform; + varying vec2 vDisplacementMapUv; +#endif +#ifdef USE_EMISSIVEMAP + uniform mat3 emissiveMapTransform; + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + uniform mat3 metalnessMapTransform; + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + uniform mat3 roughnessMapTransform; + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + uniform mat3 anisotropyMapTransform; + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + uniform mat3 clearcoatMapTransform; + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform mat3 clearcoatNormalMapTransform; + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform mat3 clearcoatRoughnessMapTransform; + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + uniform mat3 sheenColorMapTransform; + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + uniform mat3 sheenRoughnessMapTransform; + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + uniform mat3 iridescenceMapTransform; + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform mat3 iridescenceThicknessMapTransform; + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SPECULARMAP + uniform mat3 specularMapTransform; + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + uniform mat3 specularColorMapTransform; + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + uniform mat3 specularIntensityMapTransform; + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,ure=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + vUv = vec3( uv, 1 ).xy; +#endif +#ifdef USE_MAP + vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ALPHAMAP + vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_LIGHTMAP + vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_AOMAP + vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_BUMPMAP + vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_NORMALMAP + vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_DISPLACEMENTMAP + vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_EMISSIVEMAP + vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_METALNESSMAP + vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ROUGHNESSMAP + vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ANISOTROPYMAP + vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOATMAP + vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCEMAP + vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_COLORMAP + vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULARMAP + vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_COLORMAP + vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_TRANSMISSIONMAP + vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_THICKNESSMAP + vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; +#endif`,dre=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 + vec4 worldPosition = vec4( transformed, 1.0 ); + #ifdef USE_BATCHING + worldPosition = batchingMatrix * worldPosition; + #endif + #ifdef USE_INSTANCING + worldPosition = instanceMatrix * worldPosition; + #endif + worldPosition = modelMatrix * worldPosition; +#endif`;const fre=`varying vec2 vUv; +uniform mat3 uvTransform; +void main() { + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + gl_Position = vec4( position.xy, 1.0, 1.0 ); +}`,hre=`uniform sampler2D t2D; +uniform float backgroundIntensity; +varying vec2 vUv; +void main() { + vec4 texColor = texture2D( t2D, vUv ); + #ifdef DECODE_VIDEO_TEXTURE + texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,pre=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,mre=`#ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; +#elif defined( ENVMAP_TYPE_CUBE_UV ) + uniform sampler2D envMap; +#endif +uniform float flipEnvMap; +uniform float backgroundBlurriness; +uniform float backgroundIntensity; +uniform mat3 backgroundRotation; +varying vec3 vWorldDirection; +#include +void main() { + #ifdef ENVMAP_TYPE_CUBE + vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); + #elif defined( ENVMAP_TYPE_CUBE_UV ) + vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness ); + #else + vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,gre=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,vre=`uniform samplerCube tCube; +uniform float tFlip; +uniform float opacity; +varying vec3 vWorldDirection; +void main() { + vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); + gl_FragColor = texColor; + gl_FragColor.a *= opacity; + #include + #include +}`,yre=`#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + #include + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vHighPrecisionZW = gl_Position.zw; +}`,xre=`#if DEPTH_PACKING == 3200 + uniform float opacity; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + vec4 diffuseColor = vec4( 1.0 ); + #include + #if DEPTH_PACKING == 3200 + diffuseColor.a = opacity; + #endif + #include + #include + #include + #include + #include + float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; + #if DEPTH_PACKING == 3200 + gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); + #elif DEPTH_PACKING == 3201 + gl_FragColor = packDepthToRGBA( fragCoordZ ); + #elif DEPTH_PACKING == 3202 + gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 ); + #elif DEPTH_PACKING == 3203 + gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); + #endif +}`,bre=`#define DISTANCE +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vWorldPosition = worldPosition.xyz; +}`,_re=`#define DISTANCE +uniform vec3 referencePosition; +uniform float nearDistance; +uniform float farDistance; +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +#include +void main () { + vec4 diffuseColor = vec4( 1.0 ); + #include + #include + #include + #include + #include + float dist = length( vWorldPosition - referencePosition ); + dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); + dist = saturate( dist ); + gl_FragColor = packDepthToRGBA( dist ); +}`,wre=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include +}`,Sre=`uniform sampler2D tEquirect; +varying vec3 vWorldDirection; +#include +void main() { + vec3 direction = normalize( vWorldDirection ); + vec2 sampleUV = equirectUv( direction ); + gl_FragColor = texture2D( tEquirect, sampleUV ); + #include + #include +}`,Ere=`uniform float scale; +attribute float lineDistance; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vLineDistance = scale * lineDistance; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,Tre=`uniform vec3 diffuse; +uniform float opacity; +uniform float dashSize; +uniform float totalSize; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + if ( mod( vLineDistance, totalSize ) > dashSize ) { + discard; + } + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,Mre=`#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) + #include + #include + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,Are=`uniform vec3 diffuse; +uniform float opacity; +#ifndef FLAT_SHADED + varying vec3 vNormal; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; + #else + reflectedLight.indirectDiffuse += vec3( 1.0 ); + #endif + #include + reflectedLight.indirectDiffuse *= diffuseColor.rgb; + vec3 outgoingLight = reflectedLight.indirectDiffuse; + #include + #include + #include + #include + #include + #include + #include +}`,Cre=`#define LAMBERT +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,Pre=`#define LAMBERT +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,Rre=`#define MATCAP +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; +}`,Nre=`#define MATCAP +uniform vec3 diffuse; +uniform float opacity; +uniform sampler2D matcap; +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 viewDir = normalize( vViewPosition ); + vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); + vec3 y = cross( viewDir, x ); + vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; + #ifdef USE_MATCAP + vec4 matcapColor = texture2D( matcap, uv ); + #else + vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); + #endif + vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; + #include + #include + #include + #include + #include + #include +}`,Ore=`#define NORMAL +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + vViewPosition = - mvPosition.xyz; +#endif +}`,Ire=`#define NORMAL +uniform float opacity; +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); + #include + #include + #include + #include + gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a ); + #ifdef OPAQUE + gl_FragColor.a = 1.0; + #endif +}`,Dre=`#define PHONG +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,Lre=`#define PHONG +uniform vec3 diffuse; +uniform vec3 emissive; +uniform vec3 specular; +uniform float shininess; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,kre=`#define STANDARD +varying vec3 vViewPosition; +#ifdef USE_TRANSMISSION + varying vec3 vWorldPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +#ifdef USE_TRANSMISSION + vWorldPosition = worldPosition.xyz; +#endif +}`,jre=`#define STANDARD +#ifdef PHYSICAL + #define IOR + #define USE_SPECULAR +#endif +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float roughness; +uniform float metalness; +uniform float opacity; +#ifdef IOR + uniform float ior; +#endif +#ifdef USE_SPECULAR + uniform float specularIntensity; + uniform vec3 specularColor; + #ifdef USE_SPECULAR_COLORMAP + uniform sampler2D specularColorMap; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + uniform sampler2D specularIntensityMap; + #endif +#endif +#ifdef USE_CLEARCOAT + uniform float clearcoat; + uniform float clearcoatRoughness; +#endif +#ifdef USE_DISPERSION + uniform float dispersion; +#endif +#ifdef USE_IRIDESCENCE + uniform float iridescence; + uniform float iridescenceIOR; + uniform float iridescenceThicknessMinimum; + uniform float iridescenceThicknessMaximum; +#endif +#ifdef USE_SHEEN + uniform vec3 sheenColor; + uniform float sheenRoughness; + #ifdef USE_SHEEN_COLORMAP + uniform sampler2D sheenColorMap; + #endif + #ifdef USE_SHEEN_ROUGHNESSMAP + uniform sampler2D sheenRoughnessMap; + #endif +#endif +#ifdef USE_ANISOTROPY + uniform vec2 anisotropyVector; + #ifdef USE_ANISOTROPYMAP + uniform sampler2D anisotropyMap; + #endif +#endif +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; + vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; + #include + vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; + #ifdef USE_SHEEN + float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); + outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect; + #endif + #ifdef USE_CLEARCOAT + float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); + vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); + outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; + #endif + #include + #include + #include + #include + #include + #include +}`,Ure=`#define TOON +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +}`,Fre=`#define TOON +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include +}`,Bre=`uniform float size; +uniform float scale; +#include +#include +#include +#include +#include +#include +#ifdef USE_POINTS_UV + varying vec2 vUv; + uniform mat3 uvTransform; +#endif +void main() { + #ifdef USE_POINTS_UV + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + #endif + #include + #include + #include + #include + #include + #include + gl_PointSize = size; + #ifdef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); + #endif + #include + #include + #include + #include +}`,$re=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,zre=`#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,Hre=`uniform vec3 color; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); + #include + #include + #include +}`,Vre=`uniform float rotation; +uniform vec2 center; +#include +#include +#include +#include +#include +void main() { + #include + vec4 mvPosition = modelViewMatrix[ 3 ]; + vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) ); + #ifndef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) scale *= - mvPosition.z; + #endif + vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; + vec2 rotatedPosition; + rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; + rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; + mvPosition.xy += rotatedPosition; + gl_Position = projectionMatrix * mvPosition; + #include + #include + #include +}`,Gre=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include +}`,Nt={alphahash_fragment:hte,alphahash_pars_fragment:pte,alphamap_fragment:mte,alphamap_pars_fragment:gte,alphatest_fragment:vte,alphatest_pars_fragment:yte,aomap_fragment:xte,aomap_pars_fragment:bte,batching_pars_vertex:_te,batching_vertex:wte,begin_vertex:Ste,beginnormal_vertex:Ete,bsdfs:Tte,iridescence_fragment:Mte,bumpmap_pars_fragment:Ate,clipping_planes_fragment:Cte,clipping_planes_pars_fragment:Pte,clipping_planes_pars_vertex:Rte,clipping_planes_vertex:Nte,color_fragment:Ote,color_pars_fragment:Ite,color_pars_vertex:Dte,color_vertex:Lte,common:kte,cube_uv_reflection_fragment:jte,defaultnormal_vertex:Ute,displacementmap_pars_vertex:Fte,displacementmap_vertex:Bte,emissivemap_fragment:$te,emissivemap_pars_fragment:zte,colorspace_fragment:Hte,colorspace_pars_fragment:Vte,envmap_fragment:Gte,envmap_common_pars_fragment:Wte,envmap_pars_fragment:Xte,envmap_pars_vertex:qte,envmap_physical_pars_fragment:one,envmap_vertex:Kte,fog_vertex:Yte,fog_pars_vertex:Jte,fog_fragment:Zte,fog_pars_fragment:Qte,gradientmap_pars_fragment:ene,lightmap_pars_fragment:tne,lights_lambert_fragment:nne,lights_lambert_pars_fragment:rne,lights_pars_begin:ine,lights_toon_fragment:ane,lights_toon_pars_fragment:sne,lights_phong_fragment:lne,lights_phong_pars_fragment:cne,lights_physical_fragment:une,lights_physical_pars_fragment:dne,lights_fragment_begin:fne,lights_fragment_maps:hne,lights_fragment_end:pne,logdepthbuf_fragment:mne,logdepthbuf_pars_fragment:gne,logdepthbuf_pars_vertex:vne,logdepthbuf_vertex:yne,map_fragment:xne,map_pars_fragment:bne,map_particle_fragment:_ne,map_particle_pars_fragment:wne,metalnessmap_fragment:Sne,metalnessmap_pars_fragment:Ene,morphinstance_vertex:Tne,morphcolor_vertex:Mne,morphnormal_vertex:Ane,morphtarget_pars_vertex:Cne,morphtarget_vertex:Pne,normal_fragment_begin:Rne,normal_fragment_maps:Nne,normal_pars_fragment:One,normal_pars_vertex:Ine,normal_vertex:Dne,normalmap_pars_fragment:Lne,clearcoat_normal_fragment_begin:kne,clearcoat_normal_fragment_maps:jne,clearcoat_pars_fragment:Une,iridescence_pars_fragment:Fne,opaque_fragment:Bne,packing:$ne,premultiplied_alpha_fragment:zne,project_vertex:Hne,dithering_fragment:Vne,dithering_pars_fragment:Gne,roughnessmap_fragment:Wne,roughnessmap_pars_fragment:Xne,shadowmap_pars_fragment:qne,shadowmap_pars_vertex:Kne,shadowmap_vertex:Yne,shadowmask_pars_fragment:Jne,skinbase_vertex:Zne,skinning_pars_vertex:Qne,skinning_vertex:ere,skinnormal_vertex:tre,specularmap_fragment:nre,specularmap_pars_fragment:rre,tonemapping_fragment:ire,tonemapping_pars_fragment:ore,transmission_fragment:are,transmission_pars_fragment:sre,uv_pars_fragment:lre,uv_pars_vertex:cre,uv_vertex:ure,worldpos_vertex:dre,background_vert:fre,background_frag:hre,backgroundCube_vert:pre,backgroundCube_frag:mre,cube_vert:gre,cube_frag:vre,depth_vert:yre,depth_frag:xre,distanceRGBA_vert:bre,distanceRGBA_frag:_re,equirect_vert:wre,equirect_frag:Sre,linedashed_vert:Ere,linedashed_frag:Tre,meshbasic_vert:Mre,meshbasic_frag:Are,meshlambert_vert:Cre,meshlambert_frag:Pre,meshmatcap_vert:Rre,meshmatcap_frag:Nre,meshnormal_vert:Ore,meshnormal_frag:Ire,meshphong_vert:Dre,meshphong_frag:Lre,meshphysical_vert:kre,meshphysical_frag:jre,meshtoon_vert:Ure,meshtoon_frag:Fre,points_vert:Bre,points_frag:$re,shadow_vert:zre,shadow_frag:Hre,sprite_vert:Vre,sprite_frag:Gre},Fe={common:{diffuse:{value:new ft(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Rt},alphaMap:{value:null},alphaMapTransform:{value:new Rt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Rt}},envmap:{envMap:{value:null},envMapRotation:{value:new Rt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Rt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Rt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Rt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Rt},normalScale:{value:new xt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Rt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Rt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Rt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Rt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ft(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new ft(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Rt},alphaTest:{value:0},uvTransform:{value:new Rt}},sprite:{diffuse:{value:new ft(16777215)},opacity:{value:1},center:{value:new xt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Rt},alphaMap:{value:null},alphaMapTransform:{value:new Rt},alphaTest:{value:0}}},na={basic:{uniforms:Fr([Fe.common,Fe.specularmap,Fe.envmap,Fe.aomap,Fe.lightmap,Fe.fog]),vertexShader:Nt.meshbasic_vert,fragmentShader:Nt.meshbasic_frag},lambert:{uniforms:Fr([Fe.common,Fe.specularmap,Fe.envmap,Fe.aomap,Fe.lightmap,Fe.emissivemap,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.fog,Fe.lights,{emissive:{value:new ft(0)}}]),vertexShader:Nt.meshlambert_vert,fragmentShader:Nt.meshlambert_frag},phong:{uniforms:Fr([Fe.common,Fe.specularmap,Fe.envmap,Fe.aomap,Fe.lightmap,Fe.emissivemap,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.fog,Fe.lights,{emissive:{value:new ft(0)},specular:{value:new ft(1118481)},shininess:{value:30}}]),vertexShader:Nt.meshphong_vert,fragmentShader:Nt.meshphong_frag},standard:{uniforms:Fr([Fe.common,Fe.envmap,Fe.aomap,Fe.lightmap,Fe.emissivemap,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.roughnessmap,Fe.metalnessmap,Fe.fog,Fe.lights,{emissive:{value:new ft(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Nt.meshphysical_vert,fragmentShader:Nt.meshphysical_frag},toon:{uniforms:Fr([Fe.common,Fe.aomap,Fe.lightmap,Fe.emissivemap,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.gradientmap,Fe.fog,Fe.lights,{emissive:{value:new ft(0)}}]),vertexShader:Nt.meshtoon_vert,fragmentShader:Nt.meshtoon_frag},matcap:{uniforms:Fr([Fe.common,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.fog,{matcap:{value:null}}]),vertexShader:Nt.meshmatcap_vert,fragmentShader:Nt.meshmatcap_frag},points:{uniforms:Fr([Fe.points,Fe.fog]),vertexShader:Nt.points_vert,fragmentShader:Nt.points_frag},dashed:{uniforms:Fr([Fe.common,Fe.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Nt.linedashed_vert,fragmentShader:Nt.linedashed_frag},depth:{uniforms:Fr([Fe.common,Fe.displacementmap]),vertexShader:Nt.depth_vert,fragmentShader:Nt.depth_frag},normal:{uniforms:Fr([Fe.common,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,{opacity:{value:1}}]),vertexShader:Nt.meshnormal_vert,fragmentShader:Nt.meshnormal_frag},sprite:{uniforms:Fr([Fe.sprite,Fe.fog]),vertexShader:Nt.sprite_vert,fragmentShader:Nt.sprite_frag},background:{uniforms:{uvTransform:{value:new Rt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Nt.background_vert,fragmentShader:Nt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Rt}},vertexShader:Nt.backgroundCube_vert,fragmentShader:Nt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Nt.cube_vert,fragmentShader:Nt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Nt.equirect_vert,fragmentShader:Nt.equirect_frag},distanceRGBA:{uniforms:Fr([Fe.common,Fe.displacementmap,{referencePosition:{value:new ne},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Nt.distanceRGBA_vert,fragmentShader:Nt.distanceRGBA_frag},shadow:{uniforms:Fr([Fe.lights,Fe.fog,{color:{value:new ft(0)},opacity:{value:1}}]),vertexShader:Nt.shadow_vert,fragmentShader:Nt.shadow_frag}};na.physical={uniforms:Fr([na.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Rt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Rt},clearcoatNormalScale:{value:new xt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Rt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Rt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Rt},sheen:{value:0},sheenColor:{value:new ft(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Rt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Rt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Rt},transmissionSamplerSize:{value:new xt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Rt},attenuationDistance:{value:0},attenuationColor:{value:new ft(0)},specularColor:{value:new ft(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Rt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Rt},anisotropyVector:{value:new xt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Rt}}]),vertexShader:Nt.meshphysical_vert,fragmentShader:Nt.meshphysical_frag};const Zg={r:0,b:0,g:0},jl=new pi,Wre=new gt;function Xre(t,e,n,r,i,o,a){const s=new ft(0);let l=o===!0?0:1,c,u,d=null,f=0,p=null;function y(b){let S=b.isScene===!0?b.background:null;return S&&S.isTexture&&(S=(b.backgroundBlurriness>0?n:e).get(S)),S}function v(b){let S=!1;const w=y(b);w===null?m(s,l):w&&w.isColor&&(m(w,1),S=!0);const E=t.xr.getEnvironmentBlendMode();E==="additive"?r.buffers.color.setClear(0,0,0,1,a):E==="alpha-blend"&&r.buffers.color.setClear(0,0,0,0,a),(t.autoClear||S)&&(r.buffers.depth.setTest(!0),r.buffers.depth.setMask(!0),r.buffers.color.setMask(!0),t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil))}function g(b,S){const w=y(S);w&&(w.isCubeTexture||w.mapping===jx)?(u===void 0&&(u=new Tn(new Gc(1,1,1),new hl({name:"BackgroundCubeMaterial",uniforms:$d(na.backgroundCube.uniforms),vertexShader:na.backgroundCube.vertexShader,fragmentShader:na.backgroundCube.fragmentShader,side:ui,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(E,T,A){this.matrixWorld.copyPosition(A.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(u)),jl.copy(S.backgroundRotation),jl.x*=-1,jl.y*=-1,jl.z*=-1,w.isCubeTexture&&w.isRenderTargetTexture===!1&&(jl.y*=-1,jl.z*=-1),u.material.uniforms.envMap.value=w,u.material.uniforms.flipEnvMap.value=w.isCubeTexture&&w.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=S.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=S.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(Wre.makeRotationFromEuler(jl)),u.material.toneMapped=Dt.getTransfer(w.colorSpace)!==an,(d!==w||f!==w.version||p!==t.toneMapping)&&(u.material.needsUpdate=!0,d=w,f=w.version,p=t.toneMapping),u.layers.enableAll(),b.unshift(u,u.geometry,u.material,0,0,null)):w&&w.isTexture&&(c===void 0&&(c=new Tn(new Im(2,2),new hl({name:"BackgroundMaterial",uniforms:$d(na.background.uniforms),vertexShader:na.background.vertexShader,fragmentShader:na.background.fragmentShader,side:ba,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(c)),c.material.uniforms.t2D.value=w,c.material.uniforms.backgroundIntensity.value=S.backgroundIntensity,c.material.toneMapped=Dt.getTransfer(w.colorSpace)!==an,w.matrixAutoUpdate===!0&&w.updateMatrix(),c.material.uniforms.uvTransform.value.copy(w.matrix),(d!==w||f!==w.version||p!==t.toneMapping)&&(c.material.needsUpdate=!0,d=w,f=w.version,p=t.toneMapping),c.layers.enableAll(),b.unshift(c,c.geometry,c.material,0,0,null))}function m(b,S){b.getRGB(Zg,F4(t)),r.buffers.color.setClear(Zg.r,Zg.g,Zg.b,S,a)}function x(){u!==void 0&&(u.geometry.dispose(),u.material.dispose(),u=void 0),c!==void 0&&(c.geometry.dispose(),c.material.dispose(),c=void 0)}return{getClearColor:function(){return s},setClearColor:function(b,S=1){s.set(b),l=S,m(s,l)},getClearAlpha:function(){return l},setClearAlpha:function(b){l=b,m(s,l)},render:v,addToRenderList:g,dispose:x}}function qre(t,e){const n=t.getParameter(t.MAX_VERTEX_ATTRIBS),r={},i=f(null);let o=i,a=!1;function s(C,P,R,D,k){let U=!1;const O=d(D,R,P);o!==O&&(o=O,c(o.object)),U=p(C,D,R,k),U&&y(C,D,R,k),k!==null&&e.update(k,t.ELEMENT_ARRAY_BUFFER),(U||a)&&(a=!1,S(C,P,R,D),k!==null&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e.get(k).buffer))}function l(){return t.createVertexArray()}function c(C){return t.bindVertexArray(C)}function u(C){return t.deleteVertexArray(C)}function d(C,P,R){const D=R.wireframe===!0;let k=r[C.id];k===void 0&&(k={},r[C.id]=k);let U=k[P.id];U===void 0&&(U={},k[P.id]=U);let O=U[D];return O===void 0&&(O=f(l()),U[D]=O),O}function f(C){const P=[],R=[],D=[];for(let k=0;k=0){const X=k[L];let K=U[L];if(K===void 0&&(L==="instanceMatrix"&&C.instanceMatrix&&(K=C.instanceMatrix),L==="instanceColor"&&C.instanceColor&&(K=C.instanceColor)),X===void 0||X.attribute!==K||K&&X.data!==K.data)return!0;O++}return o.attributesNum!==O||o.index!==D}function y(C,P,R,D){const k={},U=P.attributes;let O=0;const W=R.getAttributes();for(const L in W)if(W[L].location>=0){let X=U[L];X===void 0&&(L==="instanceMatrix"&&C.instanceMatrix&&(X=C.instanceMatrix),L==="instanceColor"&&C.instanceColor&&(X=C.instanceColor));const K={};K.attribute=X,X&&X.data&&(K.data=X.data),k[L]=K,O++}o.attributes=k,o.attributesNum=O,o.index=D}function v(){const C=o.newAttributes;for(let P=0,R=C.length;P=0){let j=k[W];if(j===void 0&&(W==="instanceMatrix"&&C.instanceMatrix&&(j=C.instanceMatrix),W==="instanceColor"&&C.instanceColor&&(j=C.instanceColor)),j!==void 0){const X=j.normalized,K=j.itemSize,F=e.get(j);if(F===void 0)continue;const Y=F.buffer,q=F.type,ee=F.bytesPerElement,te=q===t.INT||q===t.UNSIGNED_INT||j.gpuType===HA;if(j.isInterleavedBufferAttribute){const Q=j.data,ce=Q.stride,ae=j.offset;if(Q.isInstancedInterleavedBuffer){for(let fe=0;fe0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";T="mediump"}return T==="mediump"&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=n.precision!==void 0?n.precision:"highp";const u=l(c);u!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",u,"instead."),c=u);const d=n.logarithmicDepthBuffer===!0,f=n.reverseDepthBuffer===!0&&e.has("EXT_clip_control"),p=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),y=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),v=t.getParameter(t.MAX_TEXTURE_SIZE),g=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),m=t.getParameter(t.MAX_VERTEX_ATTRIBS),x=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),b=t.getParameter(t.MAX_VARYING_VECTORS),S=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),w=y>0,E=t.getParameter(t.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:o,getMaxPrecision:l,textureFormatReadable:a,textureTypeReadable:s,precision:c,logarithmicDepthBuffer:d,reverseDepthBuffer:f,maxTextures:p,maxVertexTextures:y,maxTextureSize:v,maxCubemapSize:g,maxAttributes:m,maxVertexUniforms:x,maxVaryings:b,maxFragmentUniforms:S,vertexTextures:w,maxSamples:E}}function Jre(t){const e=this;let n=null,r=0,i=!1,o=!1;const a=new $a,s=new Rt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(d,f){const p=d.length!==0||f||r!==0||i;return i=f,r=d.length,p},this.beginShadows=function(){o=!0,u(null)},this.endShadows=function(){o=!1},this.setGlobalState=function(d,f){n=u(d,f,0)},this.setState=function(d,f,p){const y=d.clippingPlanes,v=d.clipIntersection,g=d.clipShadows,m=t.get(d);if(!i||y===null||y.length===0||o&&!g)o?u(null):c();else{const x=o?0:r,b=x*4;let S=m.clippingState||null;l.value=S,S=u(y,f,b,p);for(let w=0;w!==b;++w)S[w]=n[w];m.clippingState=S,this.numIntersection=v?this.numPlanes:0,this.numPlanes+=x}};function c(){l.value!==n&&(l.value=n,l.needsUpdate=r>0),e.numPlanes=r,e.numIntersection=0}function u(d,f,p,y){const v=d!==null?d.length:0;let g=null;if(v!==0){if(g=l.value,y!==!0||g===null){const m=p+v*4,x=f.matrixWorldInverse;s.getNormalMatrix(x),(g===null||g.length0){const c=new Eee(l.height);return c.fromEquirectangularTexture(t,a),e.set(a,c),a.addEventListener("dispose",i),n(c.texture,a.mapping)}else return null}}return a}function i(a){const s=a.target;s.removeEventListener("dispose",i);const l=e.get(s);l!==void 0&&(e.delete(s),l.dispose())}function o(){e=new WeakMap}return{get:r,dispose:o}}const Vu=4,OO=[.125,.215,.35,.446,.526,.582],Yl=20,bw=new $x,IO=new ft;let _w=null,ww=0,Sw=0,Ew=!1;const Vl=(1+Math.sqrt(5))/2,bu=1/Vl,DO=[new ne(-Vl,bu,0),new ne(Vl,bu,0),new ne(-bu,0,Vl),new ne(bu,0,Vl),new ne(0,Vl,-bu),new ne(0,Vl,bu),new ne(-1,1,-1),new ne(1,1,-1),new ne(-1,1,1),new ne(1,1,1)],Qre=new ne;class LO{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,n=0,r=.1,i=100,o={}){const{size:a=256,position:s=Qre}=o;_w=this._renderer.getRenderTarget(),ww=this._renderer.getActiveCubeFace(),Sw=this._renderer.getActiveMipmapLevel(),Ew=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(a);const l=this._allocateTargets();return l.depthBuffer=!0,this._sceneToCubeUV(e,r,i,l,s),n>0&&this._blur(l,0,0,n),this._applyPMREM(l),this._cleanup(l),l}fromEquirectangular(e,n=null){return this._fromTexture(e,n)}fromCubemap(e,n=null){return this._fromTexture(e,n)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=UO(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=jO(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?S:0,S,S),d.setRenderTarget(i),g&&d.render(v,l),d.render(e,l)}v.geometry.dispose(),v.material.dispose(),d.toneMapping=p,d.autoClear=f,e.background=m}_textureToCubeUV(e,n){const r=this._renderer,i=e.mapping===Ud||e.mapping===Fd;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=UO()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=jO());const o=i?this._cubemapMaterial:this._equirectMaterial,a=new Tn(this._lodPlanes[0],o),s=o.uniforms;s.envMap.value=e;const l=this._cubeSize;Qg(n,0,0,3*l,2*l),r.setRenderTarget(n),r.render(a,bw)}_applyPMREM(e){const n=this._renderer,r=n.autoClear;n.autoClear=!1;const i=this._lodPlanes.length;for(let o=1;oYl&&console.warn(`sigmaRadians, ${o}, is too large and will clip, as it requested ${g} samples when the maximum is set to ${Yl}`);const m=[];let x=0;for(let T=0;Tb-Vu?i-b+Vu:0),E=4*(this._cubeSize-S);Qg(n,w,E,3*S,2*S),l.setRenderTarget(n),l.render(d,bw)}}function eie(t){const e=[],n=[],r=[];let i=t;const o=t-Vu+1+OO.length;for(let a=0;at-Vu?l=OO[a-t+Vu-1]:a===0&&(l=0),r.push(l);const c=1/(s-2),u=-c,d=1+c,f=[u,u,d,u,d,d,u,u,d,d,u,d],p=6,y=6,v=3,g=2,m=1,x=new Float32Array(v*y*p),b=new Float32Array(g*y*p),S=new Float32Array(m*y*p);for(let E=0;E2?0:-1,M=[T,A,0,T+2/3,A,0,T+2/3,A+1,0,T,A,0,T+2/3,A+1,0,T,A+1,0];x.set(M,v*y*E),b.set(f,g*y*E);const C=[E,E,E,E,E,E];S.set(C,m*y*E)}const w=new br;w.setAttribute("position",new cr(x,v)),w.setAttribute("uv",new cr(b,g)),w.setAttribute("faceIndex",new cr(S,m)),e.push(w),i>Vu&&i--}return{lodPlanes:e,sizeLods:n,sigmas:r}}function kO(t,e,n){const r=new Oc(t,e,n);return r.texture.mapping=jx,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function Qg(t,e,n,r,i){t.viewport.set(e,n,r,i),t.scissor.set(e,n,r,i)}function tie(t,e,n){const r=new Float32Array(Yl),i=new ne(0,1,0);return new hl({name:"SphericalGaussianBlur",defines:{n:Yl,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:uC(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + uniform int samples; + uniform float weights[ n ]; + uniform bool latitudinal; + uniform float dTheta; + uniform float mipInt; + uniform vec3 poleAxis; + + #define ENVMAP_TYPE_CUBE_UV + #include + + vec3 getSample( float theta, vec3 axis ) { + + float cosTheta = cos( theta ); + // Rodrigues' axis-angle rotation + vec3 sampleDirection = vOutputDirection * cosTheta + + cross( axis, vOutputDirection ) * sin( theta ) + + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); + + return bilinearCubeUV( envMap, sampleDirection, mipInt ); + + } + + void main() { + + vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); + + if ( all( equal( axis, vec3( 0.0 ) ) ) ) { + + axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); + + } + + axis = normalize( axis ); + + gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); + + for ( int i = 1; i < n; i++ ) { + + if ( i >= samples ) { + + break; + + } + + float theta = dTheta * float( i ); + gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); + gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); + + } + + } + `,blending:tl,depthTest:!1,depthWrite:!1})}function jO(){return new hl({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:uC(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + + #include + + void main() { + + vec3 outputDirection = normalize( vOutputDirection ); + vec2 uv = equirectUv( outputDirection ); + + gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); + + } + `,blending:tl,depthTest:!1,depthWrite:!1})}function UO(){return new hl({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:uC(),fragmentShader:` + + precision mediump float; + precision mediump int; + + uniform float flipEnvMap; + + varying vec3 vOutputDirection; + + uniform samplerCube envMap; + + void main() { + + gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); + + } + `,blending:tl,depthTest:!1,depthWrite:!1})}function uC(){return` + + precision mediump float; + precision mediump int; + + attribute float faceIndex; + + varying vec3 vOutputDirection; + + // RH coordinate system; PMREM face-indexing convention + vec3 getDirection( vec2 uv, float face ) { + + uv = 2.0 * uv - 1.0; + + vec3 direction = vec3( uv, 1.0 ); + + if ( face == 0.0 ) { + + direction = direction.zyx; // ( 1, v, u ) pos x + + } else if ( face == 1.0 ) { + + direction = direction.xzy; + direction.xz *= -1.0; // ( -u, 1, -v ) pos y + + } else if ( face == 2.0 ) { + + direction.x *= -1.0; // ( -u, v, 1 ) pos z + + } else if ( face == 3.0 ) { + + direction = direction.zyx; + direction.xz *= -1.0; // ( -1, v, -u ) neg x + + } else if ( face == 4.0 ) { + + direction = direction.xzy; + direction.xy *= -1.0; // ( -u, -1, v ) neg y + + } else if ( face == 5.0 ) { + + direction.z *= -1.0; // ( u, v, -1 ) neg z + + } + + return direction; + + } + + void main() { + + vOutputDirection = getDirection( uv, faceIndex ); + gl_Position = vec4( position, 1.0 ); + + } + `}function nie(t){let e=new WeakMap,n=null;function r(s){if(s&&s.isTexture){const l=s.mapping,c=l===FE||l===BE,u=l===Ud||l===Fd;if(c||u){let d=e.get(s);const f=d!==void 0?d.texture.pmremVersion:0;if(s.isRenderTargetTexture&&s.pmremVersion!==f)return n===null&&(n=new LO(t)),d=c?n.fromEquirectangular(s,d):n.fromCubemap(s,d),d.texture.pmremVersion=s.pmremVersion,e.set(s,d),d.texture;if(d!==void 0)return d.texture;{const p=s.image;return c&&p&&p.height>0||u&&p&&i(p)?(n===null&&(n=new LO(t)),d=c?n.fromEquirectangular(s):n.fromCubemap(s),d.texture.pmremVersion=s.pmremVersion,e.set(s,d),s.addEventListener("dispose",o),d.texture):null}}}return s}function i(s){let l=0;const c=6;for(let u=0;ue.maxTextureSize&&(E=Math.ceil(w/e.maxTextureSize),w=e.maxTextureSize);const T=new Float32Array(w*E*4*d),A=new L4(T,w,E,d);A.type=Io,A.needsUpdate=!0;const M=S*4;for(let P=0;P0)return t;const i=e*n;let o=BO[i];if(o===void 0&&(o=new Float32Array(i),BO[i]=o),e!==0){r.toArray(o,0);for(let a=1,s=0;a!==e;++a)s+=n,t[a].toArray(o,s)}return o}function Zn(t,e){if(t.length!==e.length)return!1;for(let n=0,r=t.length;n":" "} ${s}: ${n[a]}`)}return r.join(` +`)}const XO=new Rt;function noe(t){Dt._getMatrix(XO,Dt.workingColorSpace,t);const e=`mat3( ${XO.elements.map(n=>n.toFixed(4))} )`;switch(Dt.getTransfer(t)){case Ry:return[e,"LinearTransferOETF"];case an:return[e,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",t),[e,"LinearTransferOETF"]}}function qO(t,e,n){const r=t.getShaderParameter(e,t.COMPILE_STATUS),i=t.getShaderInfoLog(e).trim();if(r&&i==="")return"";const o=/ERROR: 0:(\d+)/.exec(i);if(o){const a=parseInt(o[1]);return n.toUpperCase()+` + +`+i+` + +`+toe(t.getShaderSource(e),a)}else return i}function roe(t,e){const n=noe(e);return[`vec4 ${t}( vec4 value ) {`,` return ${n[1]}( vec4( value.rgb * ${n[0]}, value.a ) );`,"}"].join(` +`)}function ioe(t,e){let n;switch(e){case gQ:n="Linear";break;case vQ:n="Reinhard";break;case yQ:n="Cineon";break;case xQ:n="ACESFilmic";break;case _Q:n="AgX";break;case wQ:n="Neutral";break;case bQ:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}const ev=new ne;function ooe(){Dt.getLuminanceCoefficients(ev);const t=ev.x.toFixed(4),e=ev.y.toFixed(4),n=ev.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${t}, ${e}, ${n} );`," return dot( weights, rgb );","}"].join(` +`)}function aoe(t){return[t.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",t.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Ph).join(` +`)}function soe(t){const e=[];for(const n in t){const r=t[n];r!==!1&&e.push("#define "+n+" "+r)}return e.join(` +`)}function loe(t,e){const n={},r=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let i=0;i/gm;function x1(t){return t.replace(coe,doe)}const uoe=new Map;function doe(t,e){let n=Nt[e];if(n===void 0){const r=uoe.get(e);if(r!==void 0)n=Nt[r],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,r);else throw new Error("Can not resolve #include <"+e+">")}return x1(n)}const foe=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function JO(t){return t.replace(foe,hoe)}function hoe(t,e,n,r){let i="";for(let o=parseInt(e);o0&&(g+=` +`),m=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,y].filter(Ph).join(` +`),m.length>0&&(m+=` +`)):(g=[ZO(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,y,n.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",n.batching?"#define USE_BATCHING":"",n.batchingColor?"#define USE_BATCHING_COLOR":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.instancingMorph?"#define USE_INSTANCING_MORPH":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&n.flatShading===!1?"#define USE_MORPHNORMALS":"",n.morphColors?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` +`].filter(Ph).join(` +`),m=[ZO(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,y,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.envMap?"#define "+u:"",n.envMap?"#define "+d:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.dispersion?"#define USE_DISPERSION":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor||n.batchingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==nl?"#define TONE_MAPPING":"",n.toneMapping!==nl?Nt.tonemapping_pars_fragment:"",n.toneMapping!==nl?ioe("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",Nt.colorspace_pars_fragment,roe("linearToOutputTexel",n.outputColorSpace),ooe(),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"",` +`].filter(Ph).join(` +`)),a=x1(a),a=KO(a,n),a=YO(a,n),s=x1(s),s=KO(s,n),s=YO(s,n),a=JO(a),s=JO(s),n.isRawShaderMaterial!==!0&&(x=`#version 300 es +`,g=[p,"#define attribute in","#define varying out","#define texture2D texture"].join(` +`)+` +`+g,m=["#define varying in",n.glslVersion===GN?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===GN?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` +`)+` +`+m);const b=x+g+a,S=x+m+s,w=WO(i,i.VERTEX_SHADER,b),E=WO(i,i.FRAGMENT_SHADER,S);i.attachShader(v,w),i.attachShader(v,E),n.index0AttributeName!==void 0?i.bindAttribLocation(v,0,n.index0AttributeName):n.morphTargets===!0&&i.bindAttribLocation(v,0,"position"),i.linkProgram(v);function T(P){if(t.debug.checkShaderErrors){const R=i.getProgramInfoLog(v).trim(),D=i.getShaderInfoLog(w).trim(),k=i.getShaderInfoLog(E).trim();let U=!0,O=!0;if(i.getProgramParameter(v,i.LINK_STATUS)===!1)if(U=!1,typeof t.debug.onShaderError=="function")t.debug.onShaderError(i,v,w,E);else{const W=qO(i,w,"vertex"),L=qO(i,E,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(v,i.VALIDATE_STATUS)+` + +Material Name: `+P.name+` +Material Type: `+P.type+` + +Program Info Log: `+R+` +`+W+` +`+L)}else R!==""?console.warn("THREE.WebGLProgram: Program Info Log:",R):(D===""||k==="")&&(O=!1);O&&(P.diagnostics={runnable:U,programLog:R,vertexShader:{log:D,prefix:g},fragmentShader:{log:k,prefix:m}})}i.deleteShader(w),i.deleteShader(E),A=new qv(i,v),M=loe(i,v)}let A;this.getUniforms=function(){return A===void 0&&T(this),A};let M;this.getAttributes=function(){return M===void 0&&T(this),M};let C=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return C===!1&&(C=i.getProgramParameter(v,Qie)),C},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(v),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=eoe++,this.cacheKey=e,this.usedTimes=1,this.program=v,this.vertexShader=w,this.fragmentShader=E,this}let boe=0;class _oe{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const n=e.vertexShader,r=e.fragmentShader,i=this._getShaderStage(n),o=this._getShaderStage(r),a=this._getShaderCacheForMaterial(e);return a.has(i)===!1&&(a.add(i),i.usedTimes++),a.has(o)===!1&&(a.add(o),o.usedTimes++),this}remove(e){const n=this.materialCache.get(e);for(const r of n)r.usedTimes--,r.usedTimes===0&&this.shaderCache.delete(r.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const n=this.materialCache;let r=n.get(e);return r===void 0&&(r=new Set,n.set(e,r)),r}_getShaderStage(e){const n=this.shaderCache;let r=n.get(e);return r===void 0&&(r=new woe(e),n.set(e,r)),r}}class woe{constructor(e){this.id=boe++,this.code=e,this.usedTimes=0}}function Soe(t,e,n,r,i,o,a){const s=new ZA,l=new _oe,c=new Set,u=[],d=i.logarithmicDepthBuffer,f=i.vertexTextures;let p=i.precision;const y={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function v(M){return c.add(M),M===0?"uv":`uv${M}`}function g(M,C,P,R,D){const k=R.fog,U=D.geometry,O=M.isMeshStandardMaterial?R.environment:null,W=(M.isMeshStandardMaterial?n:e).get(M.envMap||O),L=W&&W.mapping===jx?W.image.height:null,j=y[M.type];M.precision!==null&&(p=i.getMaxPrecision(M.precision),p!==M.precision&&console.warn("THREE.WebGLProgram.getParameters:",M.precision,"not supported, using",p,"instead."));const X=U.morphAttributes.position||U.morphAttributes.normal||U.morphAttributes.color,K=X!==void 0?X.length:0;let F=0;U.morphAttributes.position!==void 0&&(F=1),U.morphAttributes.normal!==void 0&&(F=2),U.morphAttributes.color!==void 0&&(F=3);let Y,q,ee,te;if(j){const pt=na[j];Y=pt.vertexShader,q=pt.fragmentShader}else Y=M.vertexShader,q=M.fragmentShader,l.update(M),ee=l.getVertexShaderID(M),te=l.getFragmentShaderID(M);const Q=t.getRenderTarget(),ce=t.state.buffers.depth.getReversed(),ae=D.isInstancedMesh===!0,fe=D.isBatchedMesh===!0,we=!!M.map,le=!!M.matcap,ie=!!W,G=!!M.aoMap,Ve=!!M.lightMap,Ne=!!M.bumpMap,st=!!M.normalMap,Re=!!M.displacementMap,ct=!!M.emissiveMap,Ye=!!M.metalnessMap,it=!!M.roughnessMap,Ft=M.anisotropy>0,J=M.clearcoat>0,B=M.dispersion>0,ue=M.iridescence>0,me=M.sheen>0,be=M.transmission>0,ge=Ft&&!!M.anisotropyMap,rt=J&&!!M.clearcoatMap,Ie=J&&!!M.clearcoatNormalMap,Je=J&&!!M.clearcoatRoughnessMap,tt=ue&&!!M.iridescenceMap,Ee=ue&&!!M.iridescenceThicknessMap,Be=me&&!!M.sheenColorMap,ht=me&&!!M.sheenRoughnessMap,ot=!!M.specularMap,Le=!!M.specularColorMap,_t=!!M.specularIntensityMap,re=be&&!!M.transmissionMap,ke=be&&!!M.thicknessMap,Me=!!M.gradientMap,Ge=!!M.alphaMap,Te=M.alphaTest>0,_e=!!M.alphaHash,Se=!!M.extensions;let je=nl;M.toneMapped&&(Q===null||Q.isXRRenderTarget===!0)&&(je=t.toneMapping);const vt={shaderID:j,shaderType:M.type,shaderName:M.name,vertexShader:Y,fragmentShader:q,defines:M.defines,customVertexShaderID:ee,customFragmentShaderID:te,isRawShaderMaterial:M.isRawShaderMaterial===!0,glslVersion:M.glslVersion,precision:p,batching:fe,batchingColor:fe&&D._colorsTexture!==null,instancing:ae,instancingColor:ae&&D.instanceColor!==null,instancingMorph:ae&&D.morphTexture!==null,supportsVertexTextures:f,outputColorSpace:Q===null?t.outputColorSpace:Q.isXRRenderTarget===!0?Q.texture.colorSpace:Kr,alphaToCoverage:!!M.alphaToCoverage,map:we,matcap:le,envMap:ie,envMapMode:ie&&W.mapping,envMapCubeUVHeight:L,aoMap:G,lightMap:Ve,bumpMap:Ne,normalMap:st,displacementMap:f&&Re,emissiveMap:ct,normalMapObjectSpace:st&&M.normalMapType===CQ,normalMapTangentSpace:st&&M.normalMapType===Ux,metalnessMap:Ye,roughnessMap:it,anisotropy:Ft,anisotropyMap:ge,clearcoat:J,clearcoatMap:rt,clearcoatNormalMap:Ie,clearcoatRoughnessMap:Je,dispersion:B,iridescence:ue,iridescenceMap:tt,iridescenceThicknessMap:Ee,sheen:me,sheenColorMap:Be,sheenRoughnessMap:ht,specularMap:ot,specularColorMap:Le,specularIntensityMap:_t,transmission:be,transmissionMap:re,thicknessMap:ke,gradientMap:Me,opaque:M.transparent===!1&&M.blending===sd&&M.alphaToCoverage===!1,alphaMap:Ge,alphaTest:Te,alphaHash:_e,combine:M.combine,mapUv:we&&v(M.map.channel),aoMapUv:G&&v(M.aoMap.channel),lightMapUv:Ve&&v(M.lightMap.channel),bumpMapUv:Ne&&v(M.bumpMap.channel),normalMapUv:st&&v(M.normalMap.channel),displacementMapUv:Re&&v(M.displacementMap.channel),emissiveMapUv:ct&&v(M.emissiveMap.channel),metalnessMapUv:Ye&&v(M.metalnessMap.channel),roughnessMapUv:it&&v(M.roughnessMap.channel),anisotropyMapUv:ge&&v(M.anisotropyMap.channel),clearcoatMapUv:rt&&v(M.clearcoatMap.channel),clearcoatNormalMapUv:Ie&&v(M.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Je&&v(M.clearcoatRoughnessMap.channel),iridescenceMapUv:tt&&v(M.iridescenceMap.channel),iridescenceThicknessMapUv:Ee&&v(M.iridescenceThicknessMap.channel),sheenColorMapUv:Be&&v(M.sheenColorMap.channel),sheenRoughnessMapUv:ht&&v(M.sheenRoughnessMap.channel),specularMapUv:ot&&v(M.specularMap.channel),specularColorMapUv:Le&&v(M.specularColorMap.channel),specularIntensityMapUv:_t&&v(M.specularIntensityMap.channel),transmissionMapUv:re&&v(M.transmissionMap.channel),thicknessMapUv:ke&&v(M.thicknessMap.channel),alphaMapUv:Ge&&v(M.alphaMap.channel),vertexTangents:!!U.attributes.tangent&&(st||Ft),vertexColors:M.vertexColors,vertexAlphas:M.vertexColors===!0&&!!U.attributes.color&&U.attributes.color.itemSize===4,pointsUvs:D.isPoints===!0&&!!U.attributes.uv&&(we||Ge),fog:!!k,useFog:M.fog===!0,fogExp2:!!k&&k.isFogExp2,flatShading:M.flatShading===!0,sizeAttenuation:M.sizeAttenuation===!0,logarithmicDepthBuffer:d,reverseDepthBuffer:ce,skinning:D.isSkinnedMesh===!0,morphTargets:U.morphAttributes.position!==void 0,morphNormals:U.morphAttributes.normal!==void 0,morphColors:U.morphAttributes.color!==void 0,morphTargetsCount:K,morphTextureStride:F,numDirLights:C.directional.length,numPointLights:C.point.length,numSpotLights:C.spot.length,numSpotLightMaps:C.spotLightMap.length,numRectAreaLights:C.rectArea.length,numHemiLights:C.hemi.length,numDirLightShadows:C.directionalShadowMap.length,numPointLightShadows:C.pointShadowMap.length,numSpotLightShadows:C.spotShadowMap.length,numSpotLightShadowsWithMaps:C.numSpotLightShadowsWithMaps,numLightProbes:C.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:M.dithering,shadowMapEnabled:t.shadowMap.enabled&&P.length>0,shadowMapType:t.shadowMap.type,toneMapping:je,decodeVideoTexture:we&&M.map.isVideoTexture===!0&&Dt.getTransfer(M.map.colorSpace)===an,decodeVideoTextureEmissive:ct&&M.emissiveMap.isVideoTexture===!0&&Dt.getTransfer(M.emissiveMap.colorSpace)===an,premultipliedAlpha:M.premultipliedAlpha,doubleSided:M.side===Ki,flipSided:M.side===ui,useDepthPacking:M.depthPacking>=0,depthPacking:M.depthPacking||0,index0AttributeName:M.index0AttributeName,extensionClipCullDistance:Se&&M.extensions.clipCullDistance===!0&&r.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Se&&M.extensions.multiDraw===!0||fe)&&r.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:r.has("KHR_parallel_shader_compile"),customProgramCacheKey:M.customProgramCacheKey()};return vt.vertexUv1s=c.has(1),vt.vertexUv2s=c.has(2),vt.vertexUv3s=c.has(3),c.clear(),vt}function m(M){const C=[];if(M.shaderID?C.push(M.shaderID):(C.push(M.customVertexShaderID),C.push(M.customFragmentShaderID)),M.defines!==void 0)for(const P in M.defines)C.push(P),C.push(M.defines[P]);return M.isRawShaderMaterial===!1&&(x(C,M),b(C,M),C.push(t.outputColorSpace)),C.push(M.customProgramCacheKey),C.join()}function x(M,C){M.push(C.precision),M.push(C.outputColorSpace),M.push(C.envMapMode),M.push(C.envMapCubeUVHeight),M.push(C.mapUv),M.push(C.alphaMapUv),M.push(C.lightMapUv),M.push(C.aoMapUv),M.push(C.bumpMapUv),M.push(C.normalMapUv),M.push(C.displacementMapUv),M.push(C.emissiveMapUv),M.push(C.metalnessMapUv),M.push(C.roughnessMapUv),M.push(C.anisotropyMapUv),M.push(C.clearcoatMapUv),M.push(C.clearcoatNormalMapUv),M.push(C.clearcoatRoughnessMapUv),M.push(C.iridescenceMapUv),M.push(C.iridescenceThicknessMapUv),M.push(C.sheenColorMapUv),M.push(C.sheenRoughnessMapUv),M.push(C.specularMapUv),M.push(C.specularColorMapUv),M.push(C.specularIntensityMapUv),M.push(C.transmissionMapUv),M.push(C.thicknessMapUv),M.push(C.combine),M.push(C.fogExp2),M.push(C.sizeAttenuation),M.push(C.morphTargetsCount),M.push(C.morphAttributeCount),M.push(C.numDirLights),M.push(C.numPointLights),M.push(C.numSpotLights),M.push(C.numSpotLightMaps),M.push(C.numHemiLights),M.push(C.numRectAreaLights),M.push(C.numDirLightShadows),M.push(C.numPointLightShadows),M.push(C.numSpotLightShadows),M.push(C.numSpotLightShadowsWithMaps),M.push(C.numLightProbes),M.push(C.shadowMapType),M.push(C.toneMapping),M.push(C.numClippingPlanes),M.push(C.numClipIntersection),M.push(C.depthPacking)}function b(M,C){s.disableAll(),C.supportsVertexTextures&&s.enable(0),C.instancing&&s.enable(1),C.instancingColor&&s.enable(2),C.instancingMorph&&s.enable(3),C.matcap&&s.enable(4),C.envMap&&s.enable(5),C.normalMapObjectSpace&&s.enable(6),C.normalMapTangentSpace&&s.enable(7),C.clearcoat&&s.enable(8),C.iridescence&&s.enable(9),C.alphaTest&&s.enable(10),C.vertexColors&&s.enable(11),C.vertexAlphas&&s.enable(12),C.vertexUv1s&&s.enable(13),C.vertexUv2s&&s.enable(14),C.vertexUv3s&&s.enable(15),C.vertexTangents&&s.enable(16),C.anisotropy&&s.enable(17),C.alphaHash&&s.enable(18),C.batching&&s.enable(19),C.dispersion&&s.enable(20),C.batchingColor&&s.enable(21),M.push(s.mask),s.disableAll(),C.fog&&s.enable(0),C.useFog&&s.enable(1),C.flatShading&&s.enable(2),C.logarithmicDepthBuffer&&s.enable(3),C.reverseDepthBuffer&&s.enable(4),C.skinning&&s.enable(5),C.morphTargets&&s.enable(6),C.morphNormals&&s.enable(7),C.morphColors&&s.enable(8),C.premultipliedAlpha&&s.enable(9),C.shadowMapEnabled&&s.enable(10),C.doubleSided&&s.enable(11),C.flipSided&&s.enable(12),C.useDepthPacking&&s.enable(13),C.dithering&&s.enable(14),C.transmission&&s.enable(15),C.sheen&&s.enable(16),C.opaque&&s.enable(17),C.pointsUvs&&s.enable(18),C.decodeVideoTexture&&s.enable(19),C.decodeVideoTextureEmissive&&s.enable(20),C.alphaToCoverage&&s.enable(21),M.push(s.mask)}function S(M){const C=y[M.type];let P;if(C){const R=na[C];P=bee.clone(R.uniforms)}else P=M.uniforms;return P}function w(M,C){let P;for(let R=0,D=u.length;R0?r.push(m):p.transparent===!0?i.push(m):n.push(m)}function l(d,f,p,y,v,g){const m=a(d,f,p,y,v,g);p.transmission>0?r.unshift(m):p.transparent===!0?i.unshift(m):n.unshift(m)}function c(d,f){n.length>1&&n.sort(d||Toe),r.length>1&&r.sort(f||QO),i.length>1&&i.sort(f||QO)}function u(){for(let d=e,f=t.length;d=o.length?(a=new e2,o.push(a)):a=o[i],a}function n(){t=new WeakMap}return{get:e,dispose:n}}function Aoe(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new ne,color:new ft};break;case"SpotLight":n={position:new ne,direction:new ne,color:new ft,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new ne,color:new ft,distance:0,decay:0};break;case"HemisphereLight":n={direction:new ne,skyColor:new ft,groundColor:new ft};break;case"RectAreaLight":n={color:new ft,position:new ne,halfWidth:new ne,halfHeight:new ne};break}return t[e.id]=n,n}}}function Coe(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new xt};break;case"SpotLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new xt};break;case"PointLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new xt,shadowCameraNear:1,shadowCameraFar:1e3};break}return t[e.id]=n,n}}}let Poe=0;function Roe(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function Noe(t){const e=new Aoe,n=Coe(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)r.probe.push(new ne);const i=new ne,o=new gt,a=new gt;function s(c){let u=0,d=0,f=0;for(let M=0;M<9;M++)r.probe[M].set(0,0,0);let p=0,y=0,v=0,g=0,m=0,x=0,b=0,S=0,w=0,E=0,T=0;c.sort(Roe);for(let M=0,C=c.length;M0&&(t.has("OES_texture_float_linear")===!0?(r.rectAreaLTC1=Fe.LTC_FLOAT_1,r.rectAreaLTC2=Fe.LTC_FLOAT_2):(r.rectAreaLTC1=Fe.LTC_HALF_1,r.rectAreaLTC2=Fe.LTC_HALF_2)),r.ambient[0]=u,r.ambient[1]=d,r.ambient[2]=f;const A=r.hash;(A.directionalLength!==p||A.pointLength!==y||A.spotLength!==v||A.rectAreaLength!==g||A.hemiLength!==m||A.numDirectionalShadows!==x||A.numPointShadows!==b||A.numSpotShadows!==S||A.numSpotMaps!==w||A.numLightProbes!==T)&&(r.directional.length=p,r.spot.length=v,r.rectArea.length=g,r.point.length=y,r.hemi.length=m,r.directionalShadow.length=x,r.directionalShadowMap.length=x,r.pointShadow.length=b,r.pointShadowMap.length=b,r.spotShadow.length=S,r.spotShadowMap.length=S,r.directionalShadowMatrix.length=x,r.pointShadowMatrix.length=b,r.spotLightMatrix.length=S+w-E,r.spotLightMap.length=w,r.numSpotLightShadowsWithMaps=E,r.numLightProbes=T,A.directionalLength=p,A.pointLength=y,A.spotLength=v,A.rectAreaLength=g,A.hemiLength=m,A.numDirectionalShadows=x,A.numPointShadows=b,A.numSpotShadows=S,A.numSpotMaps=w,A.numLightProbes=T,r.version=Poe++)}function l(c,u){let d=0,f=0,p=0,y=0,v=0;const g=u.matrixWorldInverse;for(let m=0,x=c.length;m=a.length?(s=new t2(t),a.push(s)):s=a[o],s}function r(){e=new WeakMap}return{get:n,dispose:r}}const Ioe=`void main() { + gl_Position = vec4( position, 1.0 ); +}`,Doe=`uniform sampler2D shadow_pass; +uniform vec2 resolution; +uniform float radius; +#include +void main() { + const float samples = float( VSM_SAMPLES ); + float mean = 0.0; + float squared_mean = 0.0; + float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); + float uvStart = samples <= 1.0 ? 0.0 : - 1.0; + for ( float i = 0.0; i < samples; i ++ ) { + float uvOffset = uvStart + i * uvStride; + #ifdef HORIZONTAL_PASS + vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); + mean += distribution.x; + squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; + #else + float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); + mean += depth; + squared_mean += depth * depth; + #endif + } + mean = mean / samples; + squared_mean = squared_mean / samples; + float std_dev = sqrt( squared_mean - mean * mean ); + gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); +}`;function Loe(t,e,n){let r=new nC;const i=new xt,o=new xt,a=new Yt,s=new kee({depthPacking:AQ}),l=new jee,c={},u=n.maxTextureSize,d={[ba]:ui,[ui]:ba,[Ki]:Ki},f=new hl({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new xt},radius:{value:4}},vertexShader:Ioe,fragmentShader:Doe}),p=f.clone();p.defines.HORIZONTAL_PASS=1;const y=new br;y.setAttribute("position",new cr(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const v=new Tn(y,f),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=_4;let m=this.type;this.render=function(E,T,A){if(g.enabled===!1||g.autoUpdate===!1&&g.needsUpdate===!1||E.length===0)return;const M=t.getRenderTarget(),C=t.getActiveCubeFace(),P=t.getActiveMipmapLevel(),R=t.state;R.setBlending(tl),R.buffers.color.setClear(1,1,1,1),R.buffers.depth.setTest(!0),R.setScissorTest(!1);const D=m!==ja&&this.type===ja,k=m===ja&&this.type!==ja;for(let U=0,O=E.length;Uu||i.y>u)&&(i.x>u&&(o.x=Math.floor(u/j.x),i.x=o.x*j.x,L.mapSize.x=o.x),i.y>u&&(o.y=Math.floor(u/j.y),i.y=o.y*j.y,L.mapSize.y=o.y)),L.map===null||D===!0||k===!0){const K=this.type!==ja?{minFilter:Xr,magFilter:Xr}:{};L.map!==null&&L.map.dispose(),L.map=new Oc(i.x,i.y,K),L.map.texture.name=W.name+".shadowMap",L.camera.updateProjectionMatrix()}t.setRenderTarget(L.map),t.clear();const X=L.getViewportCount();for(let K=0;K0||T.map&&T.alphaTest>0||T.alphaToCoverage===!0){const R=C.uuid,D=T.uuid;let k=c[R];k===void 0&&(k={},c[R]=k);let U=k[D];U===void 0&&(U=C.clone(),k[D]=U,T.addEventListener("dispose",w)),C=U}if(C.visible=T.visible,C.wireframe=T.wireframe,M===ja?C.side=T.shadowSide!==null?T.shadowSide:T.side:C.side=T.shadowSide!==null?T.shadowSide:d[T.side],C.alphaMap=T.alphaMap,C.alphaTest=T.alphaToCoverage===!0?.5:T.alphaTest,C.map=T.map,C.clipShadows=T.clipShadows,C.clippingPlanes=T.clippingPlanes,C.clipIntersection=T.clipIntersection,C.displacementMap=T.displacementMap,C.displacementScale=T.displacementScale,C.displacementBias=T.displacementBias,C.wireframeLinewidth=T.wireframeLinewidth,C.linewidth=T.linewidth,A.isPointLight===!0&&C.isMeshDistanceMaterial===!0){const R=t.properties.get(C);R.light=A}return C}function S(E,T,A,M,C){if(E.visible===!1)return;if(E.layers.test(T.layers)&&(E.isMesh||E.isLine||E.isPoints)&&(E.castShadow||E.receiveShadow&&C===ja)&&(!E.frustumCulled||r.intersectsObject(E))){E.modelViewMatrix.multiplyMatrices(A.matrixWorldInverse,E.matrixWorld);const D=e.update(E),k=E.material;if(Array.isArray(k)){const U=D.groups;for(let O=0,W=U.length;O=1):L.indexOf("OpenGL ES")!==-1&&(W=parseFloat(/^OpenGL ES (\d)/.exec(L)[1]),O=W>=2);let j=null,X={};const K=t.getParameter(t.SCISSOR_BOX),F=t.getParameter(t.VIEWPORT),Y=new Yt().fromArray(K),q=new Yt().fromArray(F);function ee(re,ke,Me,Ge){const Te=new Uint8Array(4),_e=t.createTexture();t.bindTexture(re,_e),t.texParameteri(re,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(re,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let Se=0;Se"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new xt,u=new WeakMap;let d;const f=new WeakMap;let p=!1;try{p=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function y(J,B){return p?new OffscreenCanvas(J,B):Rp("canvas")}function v(J,B,ue){let me=1;const be=Ft(J);if((be.width>ue||be.height>ue)&&(me=ue/Math.max(be.width,be.height)),me<1)if(typeof HTMLImageElement<"u"&&J instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&J instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&J instanceof ImageBitmap||typeof VideoFrame<"u"&&J instanceof VideoFrame){const ge=Math.floor(me*be.width),rt=Math.floor(me*be.height);d===void 0&&(d=y(ge,rt));const Ie=B?y(ge,rt):d;return Ie.width=ge,Ie.height=rt,Ie.getContext("2d").drawImage(J,0,0,ge,rt),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+be.width+"x"+be.height+") to ("+ge+"x"+rt+")."),Ie}else return"data"in J&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+be.width+"x"+be.height+")."),J;return J}function g(J){return J.generateMipmaps}function m(J){t.generateMipmap(J)}function x(J){return J.isWebGLCubeRenderTarget?t.TEXTURE_CUBE_MAP:J.isWebGL3DRenderTarget?t.TEXTURE_3D:J.isWebGLArrayRenderTarget||J.isCompressedArrayTexture?t.TEXTURE_2D_ARRAY:t.TEXTURE_2D}function b(J,B,ue,me,be=!1){if(J!==null){if(t[J]!==void 0)return t[J];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+J+"'")}let ge=B;if(B===t.RED&&(ue===t.FLOAT&&(ge=t.R32F),ue===t.HALF_FLOAT&&(ge=t.R16F),ue===t.UNSIGNED_BYTE&&(ge=t.R8)),B===t.RED_INTEGER&&(ue===t.UNSIGNED_BYTE&&(ge=t.R8UI),ue===t.UNSIGNED_SHORT&&(ge=t.R16UI),ue===t.UNSIGNED_INT&&(ge=t.R32UI),ue===t.BYTE&&(ge=t.R8I),ue===t.SHORT&&(ge=t.R16I),ue===t.INT&&(ge=t.R32I)),B===t.RG&&(ue===t.FLOAT&&(ge=t.RG32F),ue===t.HALF_FLOAT&&(ge=t.RG16F),ue===t.UNSIGNED_BYTE&&(ge=t.RG8)),B===t.RG_INTEGER&&(ue===t.UNSIGNED_BYTE&&(ge=t.RG8UI),ue===t.UNSIGNED_SHORT&&(ge=t.RG16UI),ue===t.UNSIGNED_INT&&(ge=t.RG32UI),ue===t.BYTE&&(ge=t.RG8I),ue===t.SHORT&&(ge=t.RG16I),ue===t.INT&&(ge=t.RG32I)),B===t.RGB_INTEGER&&(ue===t.UNSIGNED_BYTE&&(ge=t.RGB8UI),ue===t.UNSIGNED_SHORT&&(ge=t.RGB16UI),ue===t.UNSIGNED_INT&&(ge=t.RGB32UI),ue===t.BYTE&&(ge=t.RGB8I),ue===t.SHORT&&(ge=t.RGB16I),ue===t.INT&&(ge=t.RGB32I)),B===t.RGBA_INTEGER&&(ue===t.UNSIGNED_BYTE&&(ge=t.RGBA8UI),ue===t.UNSIGNED_SHORT&&(ge=t.RGBA16UI),ue===t.UNSIGNED_INT&&(ge=t.RGBA32UI),ue===t.BYTE&&(ge=t.RGBA8I),ue===t.SHORT&&(ge=t.RGBA16I),ue===t.INT&&(ge=t.RGBA32I)),B===t.RGB&&ue===t.UNSIGNED_INT_5_9_9_9_REV&&(ge=t.RGB9_E5),B===t.RGBA){const rt=be?Ry:Dt.getTransfer(me);ue===t.FLOAT&&(ge=t.RGBA32F),ue===t.HALF_FLOAT&&(ge=t.RGBA16F),ue===t.UNSIGNED_BYTE&&(ge=rt===an?t.SRGB8_ALPHA8:t.RGBA8),ue===t.UNSIGNED_SHORT_4_4_4_4&&(ge=t.RGBA4),ue===t.UNSIGNED_SHORT_5_5_5_1&&(ge=t.RGB5_A1)}return(ge===t.R16F||ge===t.R32F||ge===t.RG16F||ge===t.RG32F||ge===t.RGBA16F||ge===t.RGBA32F)&&e.get("EXT_color_buffer_float"),ge}function S(J,B){let ue;return J?B===null||B===Nc||B===Tp?ue=t.DEPTH24_STENCIL8:B===Io?ue=t.DEPTH32F_STENCIL8:B===Ep&&(ue=t.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):B===null||B===Nc||B===Tp?ue=t.DEPTH_COMPONENT24:B===Io?ue=t.DEPTH_COMPONENT32F:B===Ep&&(ue=t.DEPTH_COMPONENT16),ue}function w(J,B){return g(J)===!0||J.isFramebufferTexture&&J.minFilter!==Xr&&J.minFilter!==Or?Math.log2(Math.max(B.width,B.height))+1:J.mipmaps!==void 0&&J.mipmaps.length>0?J.mipmaps.length:J.isCompressedTexture&&Array.isArray(J.image)?B.mipmaps.length:1}function E(J){const B=J.target;B.removeEventListener("dispose",E),A(B),B.isVideoTexture&&u.delete(B)}function T(J){const B=J.target;B.removeEventListener("dispose",T),C(B)}function A(J){const B=r.get(J);if(B.__webglInit===void 0)return;const ue=J.source,me=f.get(ue);if(me){const be=me[B.__cacheKey];be.usedTimes--,be.usedTimes===0&&M(J),Object.keys(me).length===0&&f.delete(ue)}r.remove(J)}function M(J){const B=r.get(J);t.deleteTexture(B.__webglTexture);const ue=J.source,me=f.get(ue);delete me[B.__cacheKey],a.memory.textures--}function C(J){const B=r.get(J);if(J.depthTexture&&(J.depthTexture.dispose(),r.remove(J.depthTexture)),J.isWebGLCubeRenderTarget)for(let me=0;me<6;me++){if(Array.isArray(B.__webglFramebuffer[me]))for(let be=0;be=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+J+" texture units while this GPU supports only "+i.maxTextures),P+=1,J}function k(J){const B=[];return B.push(J.wrapS),B.push(J.wrapT),B.push(J.wrapR||0),B.push(J.magFilter),B.push(J.minFilter),B.push(J.anisotropy),B.push(J.internalFormat),B.push(J.format),B.push(J.type),B.push(J.generateMipmaps),B.push(J.premultiplyAlpha),B.push(J.flipY),B.push(J.unpackAlignment),B.push(J.colorSpace),B.join()}function U(J,B){const ue=r.get(J);if(J.isVideoTexture&&Ye(J),J.isRenderTargetTexture===!1&&J.version>0&&ue.__version!==J.version){const me=J.image;if(me===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(me.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{te(ue,J,B);return}}n.bindTexture(t.TEXTURE_2D,ue.__webglTexture,t.TEXTURE0+B)}function O(J,B){const ue=r.get(J);if(J.version>0&&ue.__version!==J.version){te(ue,J,B);return}n.bindTexture(t.TEXTURE_2D_ARRAY,ue.__webglTexture,t.TEXTURE0+B)}function W(J,B){const ue=r.get(J);if(J.version>0&&ue.__version!==J.version){te(ue,J,B);return}n.bindTexture(t.TEXTURE_3D,ue.__webglTexture,t.TEXTURE0+B)}function L(J,B){const ue=r.get(J);if(J.version>0&&ue.__version!==J.version){Q(ue,J,B);return}n.bindTexture(t.TEXTURE_CUBE_MAP,ue.__webglTexture,t.TEXTURE0+B)}const j={[ca]:t.REPEAT,[Ji]:t.CLAMP_TO_EDGE,[Py]:t.MIRRORED_REPEAT},X={[Xr]:t.NEAREST,[E4]:t.NEAREST_MIPMAP_NEAREST,[Ch]:t.NEAREST_MIPMAP_LINEAR,[Or]:t.LINEAR,[$v]:t.LINEAR_MIPMAP_NEAREST,[Oo]:t.LINEAR_MIPMAP_LINEAR},K={[PQ]:t.NEVER,[LQ]:t.ALWAYS,[RQ]:t.LESS,[I4]:t.LEQUAL,[NQ]:t.EQUAL,[DQ]:t.GEQUAL,[OQ]:t.GREATER,[IQ]:t.NOTEQUAL};function F(J,B){if(B.type===Io&&e.has("OES_texture_float_linear")===!1&&(B.magFilter===Or||B.magFilter===$v||B.magFilter===Ch||B.magFilter===Oo||B.minFilter===Or||B.minFilter===$v||B.minFilter===Ch||B.minFilter===Oo)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),t.texParameteri(J,t.TEXTURE_WRAP_S,j[B.wrapS]),t.texParameteri(J,t.TEXTURE_WRAP_T,j[B.wrapT]),(J===t.TEXTURE_3D||J===t.TEXTURE_2D_ARRAY)&&t.texParameteri(J,t.TEXTURE_WRAP_R,j[B.wrapR]),t.texParameteri(J,t.TEXTURE_MAG_FILTER,X[B.magFilter]),t.texParameteri(J,t.TEXTURE_MIN_FILTER,X[B.minFilter]),B.compareFunction&&(t.texParameteri(J,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(J,t.TEXTURE_COMPARE_FUNC,K[B.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(B.magFilter===Xr||B.minFilter!==Ch&&B.minFilter!==Oo||B.type===Io&&e.has("OES_texture_float_linear")===!1)return;if(B.anisotropy>1||r.get(B).__currentAnisotropy){const ue=e.get("EXT_texture_filter_anisotropic");t.texParameterf(J,ue.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(B.anisotropy,i.getMaxAnisotropy())),r.get(B).__currentAnisotropy=B.anisotropy}}}function Y(J,B){let ue=!1;J.__webglInit===void 0&&(J.__webglInit=!0,B.addEventListener("dispose",E));const me=B.source;let be=f.get(me);be===void 0&&(be={},f.set(me,be));const ge=k(B);if(ge!==J.__cacheKey){be[ge]===void 0&&(be[ge]={texture:t.createTexture(),usedTimes:0},a.memory.textures++,ue=!0),be[ge].usedTimes++;const rt=be[J.__cacheKey];rt!==void 0&&(be[J.__cacheKey].usedTimes--,rt.usedTimes===0&&M(B)),J.__cacheKey=ge,J.__webglTexture=be[ge].texture}return ue}function q(J,B,ue){return Math.floor(Math.floor(J/ue)/B)}function ee(J,B,ue,me){const ge=J.updateRanges;if(ge.length===0)n.texSubImage2D(t.TEXTURE_2D,0,0,0,B.width,B.height,ue,me,B.data);else{ge.sort((Ee,Be)=>Ee.start-Be.start);let rt=0;for(let Ee=1;Ee0){re&&ke&&n.texStorage2D(t.TEXTURE_2D,Ge,ot,_t[0].width,_t[0].height);for(let Te=0,_e=_t.length;Te<_e;Te++)Le=_t[Te],re?Me&&n.texSubImage2D(t.TEXTURE_2D,Te,0,0,Le.width,Le.height,Be,ht,Le.data):n.texImage2D(t.TEXTURE_2D,Te,ot,Le.width,Le.height,0,Be,ht,Le.data);B.generateMipmaps=!1}else re?(ke&&n.texStorage2D(t.TEXTURE_2D,Ge,ot,Ee.width,Ee.height),Me&&ee(B,Ee,Be,ht)):n.texImage2D(t.TEXTURE_2D,0,ot,Ee.width,Ee.height,0,Be,ht,Ee.data);else if(B.isCompressedTexture)if(B.isCompressedArrayTexture){re&&ke&&n.texStorage3D(t.TEXTURE_2D_ARRAY,Ge,ot,_t[0].width,_t[0].height,Ee.depth);for(let Te=0,_e=_t.length;Te<_e;Te++)if(Le=_t[Te],B.format!==Zi)if(Be!==null)if(re){if(Me)if(B.layerUpdates.size>0){const Se=NO(Le.width,Le.height,B.format,B.type);for(const je of B.layerUpdates){const vt=Le.data.subarray(je*Se/Le.data.BYTES_PER_ELEMENT,(je+1)*Se/Le.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,Te,0,0,je,Le.width,Le.height,1,Be,vt)}B.clearLayerUpdates()}else n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,Te,0,0,0,Le.width,Le.height,Ee.depth,Be,Le.data)}else n.compressedTexImage3D(t.TEXTURE_2D_ARRAY,Te,ot,Le.width,Le.height,Ee.depth,0,Le.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else re?Me&&n.texSubImage3D(t.TEXTURE_2D_ARRAY,Te,0,0,0,Le.width,Le.height,Ee.depth,Be,ht,Le.data):n.texImage3D(t.TEXTURE_2D_ARRAY,Te,ot,Le.width,Le.height,Ee.depth,0,Be,ht,Le.data)}else{re&&ke&&n.texStorage2D(t.TEXTURE_2D,Ge,ot,_t[0].width,_t[0].height);for(let Te=0,_e=_t.length;Te<_e;Te++)Le=_t[Te],B.format!==Zi?Be!==null?re?Me&&n.compressedTexSubImage2D(t.TEXTURE_2D,Te,0,0,Le.width,Le.height,Be,Le.data):n.compressedTexImage2D(t.TEXTURE_2D,Te,ot,Le.width,Le.height,0,Le.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):re?Me&&n.texSubImage2D(t.TEXTURE_2D,Te,0,0,Le.width,Le.height,Be,ht,Le.data):n.texImage2D(t.TEXTURE_2D,Te,ot,Le.width,Le.height,0,Be,ht,Le.data)}else if(B.isDataArrayTexture)if(re){if(ke&&n.texStorage3D(t.TEXTURE_2D_ARRAY,Ge,ot,Ee.width,Ee.height,Ee.depth),Me)if(B.layerUpdates.size>0){const Te=NO(Ee.width,Ee.height,B.format,B.type);for(const _e of B.layerUpdates){const Se=Ee.data.subarray(_e*Te/Ee.data.BYTES_PER_ELEMENT,(_e+1)*Te/Ee.data.BYTES_PER_ELEMENT);n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,_e,Ee.width,Ee.height,1,Be,ht,Se)}B.clearLayerUpdates()}else n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,0,Ee.width,Ee.height,Ee.depth,Be,ht,Ee.data)}else n.texImage3D(t.TEXTURE_2D_ARRAY,0,ot,Ee.width,Ee.height,Ee.depth,0,Be,ht,Ee.data);else if(B.isData3DTexture)re?(ke&&n.texStorage3D(t.TEXTURE_3D,Ge,ot,Ee.width,Ee.height,Ee.depth),Me&&n.texSubImage3D(t.TEXTURE_3D,0,0,0,0,Ee.width,Ee.height,Ee.depth,Be,ht,Ee.data)):n.texImage3D(t.TEXTURE_3D,0,ot,Ee.width,Ee.height,Ee.depth,0,Be,ht,Ee.data);else if(B.isFramebufferTexture){if(ke)if(re)n.texStorage2D(t.TEXTURE_2D,Ge,ot,Ee.width,Ee.height);else{let Te=Ee.width,_e=Ee.height;for(let Se=0;Se>=1,_e>>=1}}else if(_t.length>0){if(re&&ke){const Te=Ft(_t[0]);n.texStorage2D(t.TEXTURE_2D,Ge,ot,Te.width,Te.height)}for(let Te=0,_e=_t.length;Te<_e;Te++)Le=_t[Te],re?Me&&n.texSubImage2D(t.TEXTURE_2D,Te,0,0,Be,ht,Le):n.texImage2D(t.TEXTURE_2D,Te,ot,Be,ht,Le);B.generateMipmaps=!1}else if(re){if(ke){const Te=Ft(Ee);n.texStorage2D(t.TEXTURE_2D,Ge,ot,Te.width,Te.height)}Me&&n.texSubImage2D(t.TEXTURE_2D,0,0,0,Be,ht,Ee)}else n.texImage2D(t.TEXTURE_2D,0,ot,Be,ht,Ee);g(B)&&m(me),rt.__version=ge.version,B.onUpdate&&B.onUpdate(B)}J.__version=B.version}function Q(J,B,ue){if(B.image.length!==6)return;const me=Y(J,B),be=B.source;n.bindTexture(t.TEXTURE_CUBE_MAP,J.__webglTexture,t.TEXTURE0+ue);const ge=r.get(be);if(be.version!==ge.__version||me===!0){n.activeTexture(t.TEXTURE0+ue);const rt=Dt.getPrimaries(Dt.workingColorSpace),Ie=B.colorSpace===Ds?null:Dt.getPrimaries(B.colorSpace),Je=B.colorSpace===Ds||rt===Ie?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,B.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,B.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,B.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,Je);const tt=B.isCompressedTexture||B.image[0].isCompressedTexture,Ee=B.image[0]&&B.image[0].isDataTexture,Be=[];for(let _e=0;_e<6;_e++)!tt&&!Ee?Be[_e]=v(B.image[_e],!0,i.maxCubemapSize):Be[_e]=Ee?B.image[_e].image:B.image[_e],Be[_e]=it(B,Be[_e]);const ht=Be[0],ot=o.convert(B.format,B.colorSpace),Le=o.convert(B.type),_t=b(B.internalFormat,ot,Le,B.colorSpace),re=B.isVideoTexture!==!0,ke=ge.__version===void 0||me===!0,Me=be.dataReady;let Ge=w(B,ht);F(t.TEXTURE_CUBE_MAP,B);let Te;if(tt){re&&ke&&n.texStorage2D(t.TEXTURE_CUBE_MAP,Ge,_t,ht.width,ht.height);for(let _e=0;_e<6;_e++){Te=Be[_e].mipmaps;for(let Se=0;Se0&&Ge++;const _e=Ft(Be[0]);n.texStorage2D(t.TEXTURE_CUBE_MAP,Ge,_t,_e.width,_e.height)}for(let _e=0;_e<6;_e++)if(Ee){re?Me&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+_e,0,0,0,Be[_e].width,Be[_e].height,ot,Le,Be[_e].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+_e,0,_t,Be[_e].width,Be[_e].height,0,ot,Le,Be[_e].data);for(let Se=0;Se>ge),ht=Math.max(1,B.height>>ge);be===t.TEXTURE_3D||be===t.TEXTURE_2D_ARRAY?n.texImage3D(be,ge,Je,Be,ht,B.depth,0,rt,Ie,null):n.texImage2D(be,ge,Je,Be,ht,0,rt,Ie,null)}n.bindFramebuffer(t.FRAMEBUFFER,J),ct(B)?s.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,me,be,Ee.__webglTexture,0,Re(B)):(be===t.TEXTURE_2D||be>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&be<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,me,be,Ee.__webglTexture,ge),n.bindFramebuffer(t.FRAMEBUFFER,null)}function ae(J,B,ue){if(t.bindRenderbuffer(t.RENDERBUFFER,J),B.depthBuffer){const me=B.depthTexture,be=me&&me.isDepthTexture?me.type:null,ge=S(B.stencilBuffer,be),rt=B.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,Ie=Re(B);ct(B)?s.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,Ie,ge,B.width,B.height):ue?t.renderbufferStorageMultisample(t.RENDERBUFFER,Ie,ge,B.width,B.height):t.renderbufferStorage(t.RENDERBUFFER,ge,B.width,B.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,rt,t.RENDERBUFFER,J)}else{const me=B.textures;for(let be=0;be{delete B.__boundDepthTexture,delete B.__depthDisposeCallback,me.removeEventListener("dispose",be)};me.addEventListener("dispose",be),B.__depthDisposeCallback=be}B.__boundDepthTexture=me}if(J.depthTexture&&!B.__autoAllocateDepthBuffer){if(ue)throw new Error("target.depthTexture not supported in Cube render targets");const me=J.texture.mipmaps;me&&me.length>0?fe(B.__webglFramebuffer[0],J):fe(B.__webglFramebuffer,J)}else if(ue){B.__webglDepthbuffer=[];for(let me=0;me<6;me++)if(n.bindFramebuffer(t.FRAMEBUFFER,B.__webglFramebuffer[me]),B.__webglDepthbuffer[me]===void 0)B.__webglDepthbuffer[me]=t.createRenderbuffer(),ae(B.__webglDepthbuffer[me],J,!1);else{const be=J.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,ge=B.__webglDepthbuffer[me];t.bindRenderbuffer(t.RENDERBUFFER,ge),t.framebufferRenderbuffer(t.FRAMEBUFFER,be,t.RENDERBUFFER,ge)}}else{const me=J.texture.mipmaps;if(me&&me.length>0?n.bindFramebuffer(t.FRAMEBUFFER,B.__webglFramebuffer[0]):n.bindFramebuffer(t.FRAMEBUFFER,B.__webglFramebuffer),B.__webglDepthbuffer===void 0)B.__webglDepthbuffer=t.createRenderbuffer(),ae(B.__webglDepthbuffer,J,!1);else{const be=J.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,ge=B.__webglDepthbuffer;t.bindRenderbuffer(t.RENDERBUFFER,ge),t.framebufferRenderbuffer(t.FRAMEBUFFER,be,t.RENDERBUFFER,ge)}}n.bindFramebuffer(t.FRAMEBUFFER,null)}function le(J,B,ue){const me=r.get(J);B!==void 0&&ce(me.__webglFramebuffer,J,J.texture,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,0),ue!==void 0&&we(J)}function ie(J){const B=J.texture,ue=r.get(J),me=r.get(B);J.addEventListener("dispose",T);const be=J.textures,ge=J.isWebGLCubeRenderTarget===!0,rt=be.length>1;if(rt||(me.__webglTexture===void 0&&(me.__webglTexture=t.createTexture()),me.__version=B.version,a.memory.textures++),ge){ue.__webglFramebuffer=[];for(let Ie=0;Ie<6;Ie++)if(B.mipmaps&&B.mipmaps.length>0){ue.__webglFramebuffer[Ie]=[];for(let Je=0;Je0){ue.__webglFramebuffer=[];for(let Ie=0;Ie0&&ct(J)===!1){ue.__webglMultisampledFramebuffer=t.createFramebuffer(),ue.__webglColorRenderbuffer=[],n.bindFramebuffer(t.FRAMEBUFFER,ue.__webglMultisampledFramebuffer);for(let Ie=0;Ie0)for(let Je=0;Je0)for(let Je=0;Je0){if(ct(J)===!1){const B=J.textures,ue=J.width,me=J.height;let be=t.COLOR_BUFFER_BIT;const ge=J.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,rt=r.get(J),Ie=B.length>1;if(Ie)for(let tt=0;tt0?n.bindFramebuffer(t.DRAW_FRAMEBUFFER,rt.__webglFramebuffer[0]):n.bindFramebuffer(t.DRAW_FRAMEBUFFER,rt.__webglFramebuffer);for(let tt=0;tt0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&B.__useRenderToTexture!==!1}function Ye(J){const B=a.render.frame;u.get(J)!==B&&(u.set(J,B),J.update())}function it(J,B){const ue=J.colorSpace,me=J.format,be=J.type;return J.isCompressedTexture===!0||J.isVideoTexture===!0||ue!==Kr&&ue!==Ds&&(Dt.getTransfer(ue)===an?(me!==Zi||be!==_a)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",ue)),B}function Ft(J){return typeof HTMLImageElement<"u"&&J instanceof HTMLImageElement?(c.width=J.naturalWidth||J.width,c.height=J.naturalHeight||J.height):typeof VideoFrame<"u"&&J instanceof VideoFrame?(c.width=J.displayWidth,c.height=J.displayHeight):(c.width=J.width,c.height=J.height),c}this.allocateTextureUnit=D,this.resetTextureUnits=R,this.setTexture2D=U,this.setTexture2DArray=O,this.setTexture3D=W,this.setTextureCube=L,this.rebindTextures=le,this.setupRenderTarget=ie,this.updateRenderTargetMipmap=G,this.updateMultisampleRenderTarget=st,this.setupDepthRenderbuffer=we,this.setupFrameBufferTexture=ce,this.useMultisampledRTT=ct}function Foe(t,e){function n(r,i=Ds){let o;const a=Dt.getTransfer(i);if(r===_a)return t.UNSIGNED_BYTE;if(r===VA)return t.UNSIGNED_SHORT_4_4_4_4;if(r===GA)return t.UNSIGNED_SHORT_5_5_5_1;if(r===A4)return t.UNSIGNED_INT_5_9_9_9_REV;if(r===T4)return t.BYTE;if(r===M4)return t.SHORT;if(r===Ep)return t.UNSIGNED_SHORT;if(r===HA)return t.INT;if(r===Nc)return t.UNSIGNED_INT;if(r===Io)return t.FLOAT;if(r===Om)return t.HALF_FLOAT;if(r===C4)return t.ALPHA;if(r===P4)return t.RGB;if(r===Zi)return t.RGBA;if(r===Mp)return t.DEPTH_COMPONENT;if(r===Ap)return t.DEPTH_STENCIL;if(r===WA)return t.RED;if(r===XA)return t.RED_INTEGER;if(r===R4)return t.RG;if(r===qA)return t.RG_INTEGER;if(r===KA)return t.RGBA_INTEGER;if(r===zv||r===Hv||r===Vv||r===Gv)if(a===an)if(o=e.get("WEBGL_compressed_texture_s3tc_srgb"),o!==null){if(r===zv)return o.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(r===Hv)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(r===Vv)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(r===Gv)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(o=e.get("WEBGL_compressed_texture_s3tc"),o!==null){if(r===zv)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(r===Hv)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(r===Vv)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(r===Gv)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(r===$E||r===zE||r===HE||r===VE)if(o=e.get("WEBGL_compressed_texture_pvrtc"),o!==null){if(r===$E)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(r===zE)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(r===HE)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(r===VE)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(r===GE||r===WE||r===XE)if(o=e.get("WEBGL_compressed_texture_etc"),o!==null){if(r===GE||r===WE)return a===an?o.COMPRESSED_SRGB8_ETC2:o.COMPRESSED_RGB8_ETC2;if(r===XE)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:o.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(r===qE||r===KE||r===YE||r===JE||r===ZE||r===QE||r===e1||r===t1||r===n1||r===r1||r===i1||r===o1||r===a1||r===s1)if(o=e.get("WEBGL_compressed_texture_astc"),o!==null){if(r===qE)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:o.COMPRESSED_RGBA_ASTC_4x4_KHR;if(r===KE)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:o.COMPRESSED_RGBA_ASTC_5x4_KHR;if(r===YE)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:o.COMPRESSED_RGBA_ASTC_5x5_KHR;if(r===JE)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:o.COMPRESSED_RGBA_ASTC_6x5_KHR;if(r===ZE)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:o.COMPRESSED_RGBA_ASTC_6x6_KHR;if(r===QE)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:o.COMPRESSED_RGBA_ASTC_8x5_KHR;if(r===e1)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:o.COMPRESSED_RGBA_ASTC_8x6_KHR;if(r===t1)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:o.COMPRESSED_RGBA_ASTC_8x8_KHR;if(r===n1)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:o.COMPRESSED_RGBA_ASTC_10x5_KHR;if(r===r1)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:o.COMPRESSED_RGBA_ASTC_10x6_KHR;if(r===i1)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:o.COMPRESSED_RGBA_ASTC_10x8_KHR;if(r===o1)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:o.COMPRESSED_RGBA_ASTC_10x10_KHR;if(r===a1)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:o.COMPRESSED_RGBA_ASTC_12x10_KHR;if(r===s1)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:o.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(r===Wv||r===l1||r===c1)if(o=e.get("EXT_texture_compression_bptc"),o!==null){if(r===Wv)return a===an?o.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:o.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(r===l1)return o.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(r===c1)return o.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(r===N4||r===u1||r===d1||r===f1)if(o=e.get("EXT_texture_compression_rgtc"),o!==null){if(r===Wv)return o.COMPRESSED_RED_RGTC1_EXT;if(r===u1)return o.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(r===d1)return o.COMPRESSED_RED_GREEN_RGTC2_EXT;if(r===f1)return o.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return r===Tp?t.UNSIGNED_INT_24_8:t[r]!==void 0?t[r]:null}return{convert:n}}const Boe=` +void main() { + + gl_Position = vec4( position, 1.0 ); + +}`,$oe=` +uniform sampler2DArray depthColor; +uniform float depthWidth; +uniform float depthHeight; + +void main() { + + vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); + + if ( coord.x >= 1.0 ) { + + gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; + + } else { + + gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; + + } + +}`;class zoe{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,n,r){if(this.texture===null){const i=new lr,o=e.properties.get(i);o.__webglTexture=n.texture,(n.depthNear!==r.depthNear||n.depthFar!==r.depthFar)&&(this.depthNear=n.depthNear,this.depthFar=n.depthFar),this.texture=i}}getMesh(e){if(this.texture!==null&&this.mesh===null){const n=e.cameras[0].viewport,r=new hl({vertexShader:Boe,fragmentShader:$oe,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new Tn(new Im(20,20),r)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class Hoe extends Vc{constructor(e,n){super();const r=this;let i=null,o=1,a=null,s="local-floor",l=1,c=null,u=null,d=null,f=null,p=null,y=null;const v=new zoe,g=n.getContextAttributes();let m=null,x=null;const b=[],S=[],w=new xt;let E=null;const T=new gr;T.viewport=new Yt;const A=new gr;A.viewport=new Yt;const M=[T,A],C=new ete;let P=null,R=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(q){let ee=b[q];return ee===void 0&&(ee=new fw,b[q]=ee),ee.getTargetRaySpace()},this.getControllerGrip=function(q){let ee=b[q];return ee===void 0&&(ee=new fw,b[q]=ee),ee.getGripSpace()},this.getHand=function(q){let ee=b[q];return ee===void 0&&(ee=new fw,b[q]=ee),ee.getHandSpace()};function D(q){const ee=S.indexOf(q.inputSource);if(ee===-1)return;const te=b[ee];te!==void 0&&(te.update(q.inputSource,q.frame,c||a),te.dispatchEvent({type:q.type,data:q.inputSource}))}function k(){i.removeEventListener("select",D),i.removeEventListener("selectstart",D),i.removeEventListener("selectend",D),i.removeEventListener("squeeze",D),i.removeEventListener("squeezestart",D),i.removeEventListener("squeezeend",D),i.removeEventListener("end",k),i.removeEventListener("inputsourceschange",U);for(let q=0;q=0&&(S[Q]=null,b[Q].disconnect(te))}for(let ee=0;ee=S.length){S.push(te),Q=ae;break}else if(S[ae]===null){S[ae]=te,Q=ae;break}if(Q===-1)break}const ce=b[Q];ce&&ce.connect(te)}}const O=new ne,W=new ne;function L(q,ee,te){O.setFromMatrixPosition(ee.matrixWorld),W.setFromMatrixPosition(te.matrixWorld);const Q=O.distanceTo(W),ce=ee.projectionMatrix.elements,ae=te.projectionMatrix.elements,fe=ce[14]/(ce[10]-1),we=ce[14]/(ce[10]+1),le=(ce[9]+1)/ce[5],ie=(ce[9]-1)/ce[5],G=(ce[8]-1)/ce[0],Ve=(ae[8]+1)/ae[0],Ne=fe*G,st=fe*Ve,Re=Q/(-G+Ve),ct=Re*-G;if(ee.matrixWorld.decompose(q.position,q.quaternion,q.scale),q.translateX(ct),q.translateZ(Re),q.matrixWorld.compose(q.position,q.quaternion,q.scale),q.matrixWorldInverse.copy(q.matrixWorld).invert(),ce[10]===-1)q.projectionMatrix.copy(ee.projectionMatrix),q.projectionMatrixInverse.copy(ee.projectionMatrixInverse);else{const Ye=fe+Re,it=we+Re,Ft=Ne-ct,J=st+(Q-ct),B=le*we/it*Ye,ue=ie*we/it*Ye;q.projectionMatrix.makePerspective(Ft,J,B,ue,Ye,it),q.projectionMatrixInverse.copy(q.projectionMatrix).invert()}}function j(q,ee){ee===null?q.matrixWorld.copy(q.matrix):q.matrixWorld.multiplyMatrices(ee.matrixWorld,q.matrix),q.matrixWorldInverse.copy(q.matrixWorld).invert()}this.updateCamera=function(q){if(i===null)return;let ee=q.near,te=q.far;v.texture!==null&&(v.depthNear>0&&(ee=v.depthNear),v.depthFar>0&&(te=v.depthFar)),C.near=A.near=T.near=ee,C.far=A.far=T.far=te,(P!==C.near||R!==C.far)&&(i.updateRenderState({depthNear:C.near,depthFar:C.far}),P=C.near,R=C.far),T.layers.mask=q.layers.mask|2,A.layers.mask=q.layers.mask|4,C.layers.mask=T.layers.mask|A.layers.mask;const Q=q.parent,ce=C.cameras;j(C,Q);for(let ae=0;ae0&&(g.alphaTest.value=m.alphaTest);const x=e.get(m),b=x.envMap,S=x.envMapRotation;b&&(g.envMap.value=b,Ul.copy(S),Ul.x*=-1,Ul.y*=-1,Ul.z*=-1,b.isCubeTexture&&b.isRenderTargetTexture===!1&&(Ul.y*=-1,Ul.z*=-1),g.envMapRotation.value.setFromMatrix4(Voe.makeRotationFromEuler(Ul)),g.flipEnvMap.value=b.isCubeTexture&&b.isRenderTargetTexture===!1?-1:1,g.reflectivity.value=m.reflectivity,g.ior.value=m.ior,g.refractionRatio.value=m.refractionRatio),m.lightMap&&(g.lightMap.value=m.lightMap,g.lightMapIntensity.value=m.lightMapIntensity,n(m.lightMap,g.lightMapTransform)),m.aoMap&&(g.aoMap.value=m.aoMap,g.aoMapIntensity.value=m.aoMapIntensity,n(m.aoMap,g.aoMapTransform))}function a(g,m){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,m.map&&(g.map.value=m.map,n(m.map,g.mapTransform))}function s(g,m){g.dashSize.value=m.dashSize,g.totalSize.value=m.dashSize+m.gapSize,g.scale.value=m.scale}function l(g,m,x,b){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,g.size.value=m.size*x,g.scale.value=b*.5,m.map&&(g.map.value=m.map,n(m.map,g.uvTransform)),m.alphaMap&&(g.alphaMap.value=m.alphaMap,n(m.alphaMap,g.alphaMapTransform)),m.alphaTest>0&&(g.alphaTest.value=m.alphaTest)}function c(g,m){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,g.rotation.value=m.rotation,m.map&&(g.map.value=m.map,n(m.map,g.mapTransform)),m.alphaMap&&(g.alphaMap.value=m.alphaMap,n(m.alphaMap,g.alphaMapTransform)),m.alphaTest>0&&(g.alphaTest.value=m.alphaTest)}function u(g,m){g.specular.value.copy(m.specular),g.shininess.value=Math.max(m.shininess,1e-4)}function d(g,m){m.gradientMap&&(g.gradientMap.value=m.gradientMap)}function f(g,m){g.metalness.value=m.metalness,m.metalnessMap&&(g.metalnessMap.value=m.metalnessMap,n(m.metalnessMap,g.metalnessMapTransform)),g.roughness.value=m.roughness,m.roughnessMap&&(g.roughnessMap.value=m.roughnessMap,n(m.roughnessMap,g.roughnessMapTransform)),m.envMap&&(g.envMapIntensity.value=m.envMapIntensity)}function p(g,m,x){g.ior.value=m.ior,m.sheen>0&&(g.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),g.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(g.sheenColorMap.value=m.sheenColorMap,n(m.sheenColorMap,g.sheenColorMapTransform)),m.sheenRoughnessMap&&(g.sheenRoughnessMap.value=m.sheenRoughnessMap,n(m.sheenRoughnessMap,g.sheenRoughnessMapTransform))),m.clearcoat>0&&(g.clearcoat.value=m.clearcoat,g.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(g.clearcoatMap.value=m.clearcoatMap,n(m.clearcoatMap,g.clearcoatMapTransform)),m.clearcoatRoughnessMap&&(g.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap,n(m.clearcoatRoughnessMap,g.clearcoatRoughnessMapTransform)),m.clearcoatNormalMap&&(g.clearcoatNormalMap.value=m.clearcoatNormalMap,n(m.clearcoatNormalMap,g.clearcoatNormalMapTransform),g.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),m.side===ui&&g.clearcoatNormalScale.value.negate())),m.dispersion>0&&(g.dispersion.value=m.dispersion),m.iridescence>0&&(g.iridescence.value=m.iridescence,g.iridescenceIOR.value=m.iridescenceIOR,g.iridescenceThicknessMinimum.value=m.iridescenceThicknessRange[0],g.iridescenceThicknessMaximum.value=m.iridescenceThicknessRange[1],m.iridescenceMap&&(g.iridescenceMap.value=m.iridescenceMap,n(m.iridescenceMap,g.iridescenceMapTransform)),m.iridescenceThicknessMap&&(g.iridescenceThicknessMap.value=m.iridescenceThicknessMap,n(m.iridescenceThicknessMap,g.iridescenceThicknessMapTransform))),m.transmission>0&&(g.transmission.value=m.transmission,g.transmissionSamplerMap.value=x.texture,g.transmissionSamplerSize.value.set(x.width,x.height),m.transmissionMap&&(g.transmissionMap.value=m.transmissionMap,n(m.transmissionMap,g.transmissionMapTransform)),g.thickness.value=m.thickness,m.thicknessMap&&(g.thicknessMap.value=m.thicknessMap,n(m.thicknessMap,g.thicknessMapTransform)),g.attenuationDistance.value=m.attenuationDistance,g.attenuationColor.value.copy(m.attenuationColor)),m.anisotropy>0&&(g.anisotropyVector.value.set(m.anisotropy*Math.cos(m.anisotropyRotation),m.anisotropy*Math.sin(m.anisotropyRotation)),m.anisotropyMap&&(g.anisotropyMap.value=m.anisotropyMap,n(m.anisotropyMap,g.anisotropyMapTransform))),g.specularIntensity.value=m.specularIntensity,g.specularColor.value.copy(m.specularColor),m.specularColorMap&&(g.specularColorMap.value=m.specularColorMap,n(m.specularColorMap,g.specularColorMapTransform)),m.specularIntensityMap&&(g.specularIntensityMap.value=m.specularIntensityMap,n(m.specularIntensityMap,g.specularIntensityMapTransform))}function y(g,m){m.matcap&&(g.matcap.value=m.matcap)}function v(g,m){const x=e.get(m).light;g.referencePosition.value.setFromMatrixPosition(x.matrixWorld),g.nearDistance.value=x.shadow.camera.near,g.farDistance.value=x.shadow.camera.far}return{refreshFogUniforms:r,refreshMaterialUniforms:i}}function Woe(t,e,n,r){let i={},o={},a=[];const s=t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS);function l(x,b){const S=b.program;r.uniformBlockBinding(x,S)}function c(x,b){let S=i[x.id];S===void 0&&(y(x),S=u(x),i[x.id]=S,x.addEventListener("dispose",g));const w=b.program;r.updateUBOMapping(x,w);const E=e.render.frame;o[x.id]!==E&&(f(x),o[x.id]=E)}function u(x){const b=d();x.__bindingPointIndex=b;const S=t.createBuffer(),w=x.__size,E=x.usage;return t.bindBuffer(t.UNIFORM_BUFFER,S),t.bufferData(t.UNIFORM_BUFFER,w,E),t.bindBuffer(t.UNIFORM_BUFFER,null),t.bindBufferBase(t.UNIFORM_BUFFER,b,S),S}function d(){for(let x=0;x0&&(S+=w-E),x.__size=S,x.__cache={},this}function v(x){const b={boundary:0,storage:0};return typeof x=="number"||typeof x=="boolean"?(b.boundary=4,b.storage=4):x.isVector2?(b.boundary=8,b.storage=8):x.isVector3||x.isColor?(b.boundary=16,b.storage=12):x.isVector4?(b.boundary=16,b.storage=16):x.isMatrix3?(b.boundary=48,b.storage=48):x.isMatrix4?(b.boundary=64,b.storage=64):x.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",x),b}function g(x){const b=x.target;b.removeEventListener("dispose",g);const S=a.indexOf(b.__bindingPointIndex);a.splice(S,1),t.deleteBuffer(i[b.id]),delete i[b.id],delete o[b.id]}function m(){for(const x in i)t.deleteBuffer(i[x]);a=[],i={},o={}}return{bind:l,update:c,dispose:m}}class Xoe{constructor(e={}){const{canvas:n=ZQ(),context:r=null,depth:i=!0,stencil:o=!1,alpha:a=!1,antialias:s=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:d=!1,reverseDepthBuffer:f=!1}=e;this.isWebGLRenderer=!0;let p;if(r!==null){if(typeof WebGLRenderingContext<"u"&&r instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");p=r.getContextAttributes().alpha}else p=a;const y=new Uint32Array(4),v=new Int32Array(4);let g=null,m=null;const x=[],b=[];this.domElement=n,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=nl,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const S=this;let w=!1;this._outputColorSpace=Zt;let E=0,T=0,A=null,M=-1,C=null;const P=new Yt,R=new Yt;let D=null;const k=new ft(0);let U=0,O=n.width,W=n.height,L=1,j=null,X=null;const K=new Yt(0,0,O,W),F=new Yt(0,0,O,W);let Y=!1;const q=new nC;let ee=!1,te=!1;const Q=new gt,ce=new gt,ae=new ne,fe=new Yt,we={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let le=!1;function ie(){return A===null?L:1}let G=r;function Ve(z,oe){return n.getContext(z,oe)}try{const z={alpha:!0,depth:i,stencil:o,antialias:s,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:d};if("setAttribute"in n&&n.setAttribute("data-engine",`three.js r${zA}`),n.addEventListener("webglcontextlost",Ge,!1),n.addEventListener("webglcontextrestored",Te,!1),n.addEventListener("webglcontextcreationerror",_e,!1),G===null){const oe="webgl2";if(G=Ve(oe,z),G===null)throw Ve(oe)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(z){throw console.error("THREE.WebGLRenderer: "+z.message),z}let Ne,st,Re,ct,Ye,it,Ft,J,B,ue,me,be,ge,rt,Ie,Je,tt,Ee,Be,ht,ot,Le,_t,re;function ke(){Ne=new rie(G),Ne.init(),Le=new Foe(G,Ne),st=new Yre(G,Ne,e,Le),Re=new joe(G,Ne),st.reverseDepthBuffer&&f&&Re.buffers.depth.setReversed(!0),ct=new aie(G),Ye=new Eoe,it=new Uoe(G,Ne,Re,Ye,st,Le,ct),Ft=new Zre(S),J=new nie(S),B=new fte(G),_t=new qre(G,B),ue=new iie(G,B,ct,_t),me=new lie(G,ue,B,ct),Be=new sie(G,st,it),Je=new Jre(Ye),be=new Soe(S,Ft,J,Ne,st,_t,Je),ge=new Goe(S,Ye),rt=new Moe,Ie=new Ooe(Ne),Ee=new Xre(S,Ft,J,Re,me,p,l),tt=new Loe(S,me,st),re=new Woe(G,ct,st,Re),ht=new Kre(G,Ne,ct),ot=new oie(G,Ne,ct),ct.programs=be.programs,S.capabilities=st,S.extensions=Ne,S.properties=Ye,S.renderLists=rt,S.shadowMap=tt,S.state=Re,S.info=ct}ke();const Me=new Hoe(S,G);this.xr=Me,this.getContext=function(){return G},this.getContextAttributes=function(){return G.getContextAttributes()},this.forceContextLoss=function(){const z=Ne.get("WEBGL_lose_context");z&&z.loseContext()},this.forceContextRestore=function(){const z=Ne.get("WEBGL_lose_context");z&&z.restoreContext()},this.getPixelRatio=function(){return L},this.setPixelRatio=function(z){z!==void 0&&(L=z,this.setSize(O,W,!1))},this.getSize=function(z){return z.set(O,W)},this.setSize=function(z,oe,de=!0){if(Me.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}O=z,W=oe,n.width=Math.floor(z*L),n.height=Math.floor(oe*L),de===!0&&(n.style.width=z+"px",n.style.height=oe+"px"),this.setViewport(0,0,z,oe)},this.getDrawingBufferSize=function(z){return z.set(O*L,W*L).floor()},this.setDrawingBufferSize=function(z,oe,de){O=z,W=oe,L=de,n.width=Math.floor(z*de),n.height=Math.floor(oe*de),this.setViewport(0,0,z,oe)},this.getCurrentViewport=function(z){return z.copy(P)},this.getViewport=function(z){return z.copy(K)},this.setViewport=function(z,oe,de,he){z.isVector4?K.set(z.x,z.y,z.z,z.w):K.set(z,oe,de,he),Re.viewport(P.copy(K).multiplyScalar(L).round())},this.getScissor=function(z){return z.copy(F)},this.setScissor=function(z,oe,de,he){z.isVector4?F.set(z.x,z.y,z.z,z.w):F.set(z,oe,de,he),Re.scissor(R.copy(F).multiplyScalar(L).round())},this.getScissorTest=function(){return Y},this.setScissorTest=function(z){Re.setScissorTest(Y=z)},this.setOpaqueSort=function(z){j=z},this.setTransparentSort=function(z){X=z},this.getClearColor=function(z){return z.copy(Ee.getClearColor())},this.setClearColor=function(){Ee.setClearColor(...arguments)},this.getClearAlpha=function(){return Ee.getClearAlpha()},this.setClearAlpha=function(){Ee.setClearAlpha(...arguments)},this.clear=function(z=!0,oe=!0,de=!0){let he=0;if(z){let se=!1;if(A!==null){const Pe=A.texture.format;se=Pe===KA||Pe===qA||Pe===XA}if(se){const Pe=A.texture.type,Ue=Pe===_a||Pe===Nc||Pe===Ep||Pe===Tp||Pe===VA||Pe===GA,Ze=Ee.getClearColor(),We=Ee.getClearAlpha(),wt=Ze.r,St=Ze.g,ut=Ze.b;Ue?(y[0]=wt,y[1]=St,y[2]=ut,y[3]=We,G.clearBufferuiv(G.COLOR,0,y)):(v[0]=wt,v[1]=St,v[2]=ut,v[3]=We,G.clearBufferiv(G.COLOR,0,v))}else he|=G.COLOR_BUFFER_BIT}oe&&(he|=G.DEPTH_BUFFER_BIT),de&&(he|=G.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),G.clear(he)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){n.removeEventListener("webglcontextlost",Ge,!1),n.removeEventListener("webglcontextrestored",Te,!1),n.removeEventListener("webglcontextcreationerror",_e,!1),Ee.dispose(),rt.dispose(),Ie.dispose(),Ye.dispose(),Ft.dispose(),J.dispose(),me.dispose(),_t.dispose(),re.dispose(),be.dispose(),Me.dispose(),Me.removeEventListener("sessionstart",Ui),Me.removeEventListener("sessionend",_r),nr.stop()};function Ge(z){z.preventDefault(),w=!0}function Te(){w=!1;const z=ct.autoReset,oe=tt.enabled,de=tt.autoUpdate,he=tt.needsUpdate,se=tt.type;ke(),ct.autoReset=z,tt.enabled=oe,tt.autoUpdate=de,tt.needsUpdate=he,tt.type=se}function _e(z){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",z.statusMessage)}function Se(z){const oe=z.target;oe.removeEventListener("dispose",Se),je(oe)}function je(z){vt(z),Ye.remove(z)}function vt(z){const oe=Ye.get(z).programs;oe!==void 0&&(oe.forEach(function(de){be.releaseProgram(de)}),z.isShaderMaterial&&be.releaseShaderCache(z))}this.renderBufferDirect=function(z,oe,de,he,se,Pe){oe===null&&(oe=we);const Ue=se.isMesh&&se.matrixWorld.determinant()<0,Ze=Gb(z,oe,de,he,se);Re.setMaterial(he,Ue);let We=de.index,wt=1;if(he.wireframe===!0){if(We=ue.getWireframeAttribute(de),We===void 0)return;wt=2}const St=de.drawRange,ut=de.attributes.position;let At=St.start*wt,Kt=(St.start+St.count)*wt;Pe!==null&&(At=Math.max(At,Pe.start*wt),Kt=Math.min(Kt,(Pe.start+Pe.count)*wt)),We!==null?(At=Math.max(At,0),Kt=Math.min(Kt,We.count)):ut!=null&&(At=Math.max(At,0),Kt=Math.min(Kt,ut.count));const hn=Kt-At;if(hn<0||hn===1/0)return;_t.setup(se,he,Ze,de,We);let Sn,Bt=ht;if(We!==null&&(Sn=B.get(We),Bt=ot,Bt.setIndex(Sn)),se.isMesh)he.wireframe===!0?(Re.setLineWidth(he.wireframeLinewidth*ie()),Bt.setMode(G.LINES)):Bt.setMode(G.TRIANGLES);else if(se.isLine){let mt=he.linewidth;mt===void 0&&(mt=1),Re.setLineWidth(mt*ie()),se.isLineSegments?Bt.setMode(G.LINES):se.isLineLoop?Bt.setMode(G.LINE_LOOP):Bt.setMode(G.LINE_STRIP)}else se.isPoints?Bt.setMode(G.POINTS):se.isSprite&&Bt.setMode(G.TRIANGLES);if(se.isBatchedMesh)if(se._multiDrawInstances!==null)ld("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),Bt.renderMultiDrawInstances(se._multiDrawStarts,se._multiDrawCounts,se._multiDrawCount,se._multiDrawInstances);else if(Ne.get("WEBGL_multi_draw"))Bt.renderMultiDraw(se._multiDrawStarts,se._multiDrawCounts,se._multiDrawCount);else{const mt=se._multiDrawStarts,Vn=se._multiDrawCounts,Vt=se._multiDrawCount,Qr=We?B.get(We).bytesPerElement:1,pn=Ye.get(he).currentProgram.getUniforms();for(let fr=0;fr{function Pe(){if(he.forEach(function(Ue){Ye.get(Ue).currentProgram.isReady()&&he.delete(Ue)}),he.size===0){se(z);return}setTimeout(Pe,10)}Ne.get("KHR_parallel_shader_compile")!==null?Pe():setTimeout(Pe,10)})};let fn=null;function jn(z){fn&&fn(z)}function Ui(){nr.stop()}function _r(){nr.start()}const nr=new Q4;nr.setAnimationLoop(jn),typeof self<"u"&&nr.setContext(self),this.setAnimationLoop=function(z){fn=z,Me.setAnimationLoop(z),z===null?nr.stop():nr.start()},Me.addEventListener("sessionstart",Ui),Me.addEventListener("sessionend",_r),this.render=function(z,oe){if(oe!==void 0&&oe.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(w===!0)return;if(z.matrixWorldAutoUpdate===!0&&z.updateMatrixWorld(),oe.parent===null&&oe.matrixWorldAutoUpdate===!0&&oe.updateMatrixWorld(),Me.enabled===!0&&Me.isPresenting===!0&&(Me.cameraAutoUpdate===!0&&Me.updateCamera(oe),oe=Me.getCamera()),z.isScene===!0&&z.onBeforeRender(S,z,oe,A),m=Ie.get(z,b.length),m.init(oe),b.push(m),ce.multiplyMatrices(oe.projectionMatrix,oe.matrixWorldInverse),q.setFromProjectionMatrix(ce),te=this.localClippingEnabled,ee=Je.init(this.clippingPlanes,te),g=rt.get(z,x.length),g.init(),x.push(g),Me.enabled===!0&&Me.isPresenting===!0){const Pe=S.xr.getDepthSensingMesh();Pe!==null&&$f(Pe,oe,-1/0,S.sortObjects)}$f(z,oe,0,S.sortObjects),g.finish(),S.sortObjects===!0&&g.sort(j,X),le=Me.enabled===!1||Me.isPresenting===!1||Me.hasDepthSensing()===!1,le&&Ee.addToRenderList(g,z),this.info.render.frame++,ee===!0&&Je.beginShadows();const de=m.state.shadowsArray;tt.render(de,z,oe),ee===!0&&Je.endShadows(),this.info.autoReset===!0&&this.info.reset();const he=g.opaque,se=g.transmissive;if(m.setupLights(),oe.isArrayCamera){const Pe=oe.cameras;if(se.length>0)for(let Ue=0,Ze=Pe.length;Ue0&&zf(he,se,z,oe),le&&Ee.render(z),qm(g,z,oe);A!==null&&T===0&&(it.updateMultisampleRenderTarget(A),it.updateRenderTargetMipmap(A)),z.isScene===!0&&z.onAfterRender(S,z,oe),_t.resetDefaultState(),M=-1,C=null,b.pop(),b.length>0?(m=b[b.length-1],ee===!0&&Je.setGlobalState(S.clippingPlanes,m.state.camera)):m=null,x.pop(),x.length>0?g=x[x.length-1]:g=null};function $f(z,oe,de,he){if(z.visible===!1)return;if(z.layers.test(oe.layers)){if(z.isGroup)de=z.renderOrder;else if(z.isLOD)z.autoUpdate===!0&&z.update(oe);else if(z.isLight)m.pushLight(z),z.castShadow&&m.pushShadow(z);else if(z.isSprite){if(!z.frustumCulled||q.intersectsSprite(z)){he&&fe.setFromMatrixPosition(z.matrixWorld).applyMatrix4(ce);const Ue=me.update(z),Ze=z.material;Ze.visible&&g.push(z,Ue,Ze,de,fe.z,null)}}else if((z.isMesh||z.isLine||z.isPoints)&&(!z.frustumCulled||q.intersectsObject(z))){const Ue=me.update(z),Ze=z.material;if(he&&(z.boundingSphere!==void 0?(z.boundingSphere===null&&z.computeBoundingSphere(),fe.copy(z.boundingSphere.center)):(Ue.boundingSphere===null&&Ue.computeBoundingSphere(),fe.copy(Ue.boundingSphere.center)),fe.applyMatrix4(z.matrixWorld).applyMatrix4(ce)),Array.isArray(Ze)){const We=Ue.groups;for(let wt=0,St=We.length;wt0&&Zc(se,oe,de),Pe.length>0&&Zc(Pe,oe,de),Ue.length>0&&Zc(Ue,oe,de),Re.buffers.depth.setTest(!0),Re.buffers.depth.setMask(!0),Re.buffers.color.setMask(!0),Re.setPolygonOffset(!1)}function zf(z,oe,de,he){if((de.isScene===!0?de.overrideMaterial:null)!==null)return;m.state.transmissionRenderTarget[he.id]===void 0&&(m.state.transmissionRenderTarget[he.id]=new Oc(1,1,{generateMipmaps:!0,type:Ne.has("EXT_color_buffer_half_float")||Ne.has("EXT_color_buffer_float")?Om:_a,minFilter:Oo,samples:4,stencilBuffer:o,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Dt.workingColorSpace}));const Pe=m.state.transmissionRenderTarget[he.id],Ue=he.viewport||P;Pe.setSize(Ue.z*S.transmissionResolutionScale,Ue.w*S.transmissionResolutionScale);const Ze=S.getRenderTarget();S.setRenderTarget(Pe),S.getClearColor(k),U=S.getClearAlpha(),U<1&&S.setClearColor(16777215,.5),S.clear(),le&&Ee.render(de);const We=S.toneMapping;S.toneMapping=nl;const wt=he.viewport;if(he.viewport!==void 0&&(he.viewport=void 0),m.setupLightsView(he),ee===!0&&Je.setGlobalState(S.clippingPlanes,he),Zc(z,de,he),it.updateMultisampleRenderTarget(Pe),it.updateRenderTargetMipmap(Pe),Ne.has("WEBGL_multisampled_render_to_texture")===!1){let St=!1;for(let ut=0,At=oe.length;ut0),ut=!!de.morphAttributes.position,At=!!de.morphAttributes.normal,Kt=!!de.morphAttributes.color;let hn=nl;he.toneMapped&&(A===null||A.isXRRenderTarget===!0)&&(hn=S.toneMapping);const Sn=de.morphAttributes.position||de.morphAttributes.normal||de.morphAttributes.color,Bt=Sn!==void 0?Sn.length:0,mt=Ye.get(he),Vn=m.state.lights;if(ee===!0&&(te===!0||z!==C)){const Un=z===C&&he.id===M;Je.setState(he,z,Un)}let Vt=!1;he.version===mt.__version?(mt.needsLights&&mt.lightsStateVersion!==Vn.state.version||mt.outputColorSpace!==Ze||se.isBatchedMesh&&mt.batching===!1||!se.isBatchedMesh&&mt.batching===!0||se.isBatchedMesh&&mt.batchingColor===!0&&se.colorTexture===null||se.isBatchedMesh&&mt.batchingColor===!1&&se.colorTexture!==null||se.isInstancedMesh&&mt.instancing===!1||!se.isInstancedMesh&&mt.instancing===!0||se.isSkinnedMesh&&mt.skinning===!1||!se.isSkinnedMesh&&mt.skinning===!0||se.isInstancedMesh&&mt.instancingColor===!0&&se.instanceColor===null||se.isInstancedMesh&&mt.instancingColor===!1&&se.instanceColor!==null||se.isInstancedMesh&&mt.instancingMorph===!0&&se.morphTexture===null||se.isInstancedMesh&&mt.instancingMorph===!1&&se.morphTexture!==null||mt.envMap!==We||he.fog===!0&&mt.fog!==Pe||mt.numClippingPlanes!==void 0&&(mt.numClippingPlanes!==Je.numPlanes||mt.numIntersection!==Je.numIntersection)||mt.vertexAlphas!==wt||mt.vertexTangents!==St||mt.morphTargets!==ut||mt.morphNormals!==At||mt.morphColors!==Kt||mt.toneMapping!==hn||mt.morphTargetsCount!==Bt)&&(Vt=!0):(Vt=!0,mt.__version=he.version);let Qr=mt.currentProgram;Vt===!0&&(Qr=Qc(he,oe,se));let pn=!1,fr=!1,Ol=!1;const cn=Qr.getUniforms(),Lr=mt.uniforms;if(Re.useProgram(Qr.program)&&(pn=!0,fr=!0,Ol=!0),he.id!==M&&(M=he.id,fr=!0),pn||C!==z){Re.buffers.depth.getReversed()?(Q.copy(z.projectionMatrix),eee(Q),tee(Q),cn.setValue(G,"projectionMatrix",Q)):cn.setValue(G,"projectionMatrix",z.projectionMatrix),cn.setValue(G,"viewMatrix",z.matrixWorldInverse);const Gn=cn.map.cameraPosition;Gn!==void 0&&Gn.setValue(G,ae.setFromMatrixPosition(z.matrixWorld)),st.logarithmicDepthBuffer&&cn.setValue(G,"logDepthBufFC",2/(Math.log(z.far+1)/Math.LN2)),(he.isMeshPhongMaterial||he.isMeshToonMaterial||he.isMeshLambertMaterial||he.isMeshBasicMaterial||he.isMeshStandardMaterial||he.isShaderMaterial)&&cn.setValue(G,"isOrthographic",z.isOrthographicCamera===!0),C!==z&&(C=z,fr=!0,Ol=!0)}if(se.isSkinnedMesh){cn.setOptional(G,se,"bindMatrix"),cn.setOptional(G,se,"bindMatrixInverse");const Un=se.skeleton;Un&&(Un.boneTexture===null&&Un.computeBoneTexture(),cn.setValue(G,"boneTexture",Un.boneTexture,it))}se.isBatchedMesh&&(cn.setOptional(G,se,"batchingTexture"),cn.setValue(G,"batchingTexture",se._matricesTexture,it),cn.setOptional(G,se,"batchingIdTexture"),cn.setValue(G,"batchingIdTexture",se._indirectTexture,it),cn.setOptional(G,se,"batchingColorTexture"),se._colorsTexture!==null&&cn.setValue(G,"batchingColorTexture",se._colorsTexture,it));const wr=de.morphAttributes;if((wr.position!==void 0||wr.normal!==void 0||wr.color!==void 0)&&Be.update(se,de,Qr),(fr||mt.receiveShadow!==se.receiveShadow)&&(mt.receiveShadow=se.receiveShadow,cn.setValue(G,"receiveShadow",se.receiveShadow)),he.isMeshGouraudMaterial&&he.envMap!==null&&(Lr.envMap.value=We,Lr.flipEnvMap.value=We.isCubeTexture&&We.isRenderTargetTexture===!1?-1:1),he.isMeshStandardMaterial&&he.envMap===null&&oe.environment!==null&&(Lr.envMapIntensity.value=oe.environmentIntensity),fr&&(cn.setValue(G,"toneMappingExposure",S.toneMappingExposure),mt.needsLights&&Wb(Lr,Ol),Pe&&he.fog===!0&&ge.refreshFogUniforms(Lr,Pe),ge.refreshMaterialUniforms(Lr,he,L,W,m.state.transmissionRenderTarget[z.id]),qv.upload(G,Km(mt),Lr,it)),he.isShaderMaterial&&he.uniformsNeedUpdate===!0&&(qv.upload(G,Km(mt),Lr,it),he.uniformsNeedUpdate=!1),he.isSpriteMaterial&&cn.setValue(G,"center",se.center),cn.setValue(G,"modelViewMatrix",se.modelViewMatrix),cn.setValue(G,"normalMatrix",se.normalMatrix),cn.setValue(G,"modelMatrix",se.matrixWorld),he.isShaderMaterial||he.isRawShaderMaterial){const Un=he.uniformsGroups;for(let Gn=0,eu=Un.length;Gn0&&it.useMultisampledRTT(z)===!1?se=Ye.get(z).__webglMultisampledFramebuffer:Array.isArray(St)?se=St[de]:se=St,P.copy(z.viewport),R.copy(z.scissor),D=z.scissorTest}else P.copy(K).multiplyScalar(L).floor(),R.copy(F).multiplyScalar(L).floor(),D=Y;if(de!==0&&(se=qb),Re.bindFramebuffer(G.FRAMEBUFFER,se)&&he&&Re.drawBuffers(z,se),Re.viewport(P),Re.scissor(R),Re.setScissorTest(D),Pe){const We=Ye.get(z.texture);G.framebufferTexture2D(G.FRAMEBUFFER,G.COLOR_ATTACHMENT0,G.TEXTURE_CUBE_MAP_POSITIVE_X+oe,We.__webglTexture,de)}else if(Ue){const We=Ye.get(z.texture),wt=oe;G.framebufferTextureLayer(G.FRAMEBUFFER,G.COLOR_ATTACHMENT0,We.__webglTexture,de,wt)}else if(z!==null&&de!==0){const We=Ye.get(z.texture);G.framebufferTexture2D(G.FRAMEBUFFER,G.COLOR_ATTACHMENT0,G.TEXTURE_2D,We.__webglTexture,de)}M=-1},this.readRenderTargetPixels=function(z,oe,de,he,se,Pe,Ue,Ze=0){if(!(z&&z.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let We=Ye.get(z).__webglFramebuffer;if(z.isWebGLCubeRenderTarget&&Ue!==void 0&&(We=We[Ue]),We){Re.bindFramebuffer(G.FRAMEBUFFER,We);try{const wt=z.textures[Ze],St=wt.format,ut=wt.type;if(!st.textureFormatReadable(St)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!st.textureTypeReadable(ut)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}oe>=0&&oe<=z.width-he&&de>=0&&de<=z.height-se&&(z.textures.length>1&&G.readBuffer(G.COLOR_ATTACHMENT0+Ze),G.readPixels(oe,de,he,se,Le.convert(St),Le.convert(ut),Pe))}finally{const wt=A!==null?Ye.get(A).__webglFramebuffer:null;Re.bindFramebuffer(G.FRAMEBUFFER,wt)}}},this.readRenderTargetPixelsAsync=async function(z,oe,de,he,se,Pe,Ue,Ze=0){if(!(z&&z.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let We=Ye.get(z).__webglFramebuffer;if(z.isWebGLCubeRenderTarget&&Ue!==void 0&&(We=We[Ue]),We)if(oe>=0&&oe<=z.width-he&&de>=0&&de<=z.height-se){Re.bindFramebuffer(G.FRAMEBUFFER,We);const wt=z.textures[Ze],St=wt.format,ut=wt.type;if(!st.textureFormatReadable(St))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!st.textureTypeReadable(ut))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const At=G.createBuffer();G.bindBuffer(G.PIXEL_PACK_BUFFER,At),G.bufferData(G.PIXEL_PACK_BUFFER,Pe.byteLength,G.STREAM_READ),z.textures.length>1&&G.readBuffer(G.COLOR_ATTACHMENT0+Ze),G.readPixels(oe,de,he,se,Le.convert(St),Le.convert(ut),0);const Kt=A!==null?Ye.get(A).__webglFramebuffer:null;Re.bindFramebuffer(G.FRAMEBUFFER,Kt);const hn=G.fenceSync(G.SYNC_GPU_COMMANDS_COMPLETE,0);return G.flush(),await QQ(G,hn,4),G.bindBuffer(G.PIXEL_PACK_BUFFER,At),G.getBufferSubData(G.PIXEL_PACK_BUFFER,0,Pe),G.deleteBuffer(At),G.deleteSync(hn),Pe}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(z,oe=null,de=0){const he=Math.pow(2,-de),se=Math.floor(z.image.width*he),Pe=Math.floor(z.image.height*he),Ue=oe!==null?oe.x:0,Ze=oe!==null?oe.y:0;it.setTexture2D(z,0),G.copyTexSubImage2D(G.TEXTURE_2D,de,0,0,Ue,Ze,se,Pe),Re.unbindTexture()};const Kb=G.createFramebuffer(),Yb=G.createFramebuffer();this.copyTextureToTexture=function(z,oe,de=null,he=null,se=0,Pe=null){Pe===null&&(se!==0?(ld("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),Pe=se,se=0):Pe=0);let Ue,Ze,We,wt,St,ut,At,Kt,hn;const Sn=z.isCompressedTexture?z.mipmaps[Pe]:z.image;if(de!==null)Ue=de.max.x-de.min.x,Ze=de.max.y-de.min.y,We=de.isBox3?de.max.z-de.min.z:1,wt=de.min.x,St=de.min.y,ut=de.isBox3?de.min.z:0;else{const wr=Math.pow(2,-se);Ue=Math.floor(Sn.width*wr),Ze=Math.floor(Sn.height*wr),z.isDataArrayTexture?We=Sn.depth:z.isData3DTexture?We=Math.floor(Sn.depth*wr):We=1,wt=0,St=0,ut=0}he!==null?(At=he.x,Kt=he.y,hn=he.z):(At=0,Kt=0,hn=0);const Bt=Le.convert(oe.format),mt=Le.convert(oe.type);let Vn;oe.isData3DTexture?(it.setTexture3D(oe,0),Vn=G.TEXTURE_3D):oe.isDataArrayTexture||oe.isCompressedArrayTexture?(it.setTexture2DArray(oe,0),Vn=G.TEXTURE_2D_ARRAY):(it.setTexture2D(oe,0),Vn=G.TEXTURE_2D),G.pixelStorei(G.UNPACK_FLIP_Y_WEBGL,oe.flipY),G.pixelStorei(G.UNPACK_PREMULTIPLY_ALPHA_WEBGL,oe.premultiplyAlpha),G.pixelStorei(G.UNPACK_ALIGNMENT,oe.unpackAlignment);const Vt=G.getParameter(G.UNPACK_ROW_LENGTH),Qr=G.getParameter(G.UNPACK_IMAGE_HEIGHT),pn=G.getParameter(G.UNPACK_SKIP_PIXELS),fr=G.getParameter(G.UNPACK_SKIP_ROWS),Ol=G.getParameter(G.UNPACK_SKIP_IMAGES);G.pixelStorei(G.UNPACK_ROW_LENGTH,Sn.width),G.pixelStorei(G.UNPACK_IMAGE_HEIGHT,Sn.height),G.pixelStorei(G.UNPACK_SKIP_PIXELS,wt),G.pixelStorei(G.UNPACK_SKIP_ROWS,St),G.pixelStorei(G.UNPACK_SKIP_IMAGES,ut);const cn=z.isDataArrayTexture||z.isData3DTexture,Lr=oe.isDataArrayTexture||oe.isData3DTexture;if(z.isDepthTexture){const wr=Ye.get(z),Un=Ye.get(oe),Gn=Ye.get(wr.__renderTarget),eu=Ye.get(Un.__renderTarget);Re.bindFramebuffer(G.READ_FRAMEBUFFER,Gn.__webglFramebuffer),Re.bindFramebuffer(G.DRAW_FRAMEBUFFER,eu.__webglFramebuffer);for(let Ma=0;MaMath.PI&&(r-=ti),i<-Math.PI?i+=ti:i>Math.PI&&(i-=ti),r<=i?this._spherical.theta=Math.max(r,Math.min(i,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(r+i)/2?Math.max(r,this._spherical.theta):Math.min(i,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let o=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const a=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),o=a!=this._spherical.radius}if(Wn.setFromSpherical(this._spherical),Wn.applyQuaternion(this._quatInverse),n.copy(this.target).add(Wn),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let a=null;if(this.object.isPerspectiveCamera){const s=Wn.length();a=this._clampDistance(s*this._scale);const l=s-a;this.object.position.addScaledVector(this._dollyDirection,l),this.object.updateMatrixWorld(),o=!!l}else if(this.object.isOrthographicCamera){const s=new ne(this._mouse.x,this._mouse.y,0);s.unproject(this.object);const l=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),o=l!==this.object.zoom;const c=new ne(this._mouse.x,this._mouse.y,0);c.unproject(this.object),this.object.position.sub(c).add(s),this.object.updateMatrixWorld(),a=Wn.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;a!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(a).add(this.object.position):(tv.origin.copy(this.object.position),tv.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(tv.direction))Mw||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Mw||this._lastTargetPosition.distanceToSquared(this.target)>Mw?(this.dispatchEvent(n2),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(e){return e!==null?ti/60*this.autoRotateSpeed*e:ti/60/60*this.autoRotateSpeed}_getZoomScale(e){const n=Math.abs(e*.01);return Math.pow(.95,this.zoomSpeed*n)}_rotateLeft(e){this._sphericalDelta.theta-=e}_rotateUp(e){this._sphericalDelta.phi-=e}_panLeft(e,n){Wn.setFromMatrixColumn(n,0),Wn.multiplyScalar(-e),this._panOffset.add(Wn)}_panUp(e,n){this.screenSpacePanning===!0?Wn.setFromMatrixColumn(n,1):(Wn.setFromMatrixColumn(n,0),Wn.crossVectors(this.object.up,Wn)),Wn.multiplyScalar(e),this._panOffset.add(Wn)}_pan(e,n){const r=this.domElement;if(this.object.isPerspectiveCamera){const i=this.object.position;Wn.copy(i).sub(this.target);let o=Wn.length();o*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*e*o/r.clientHeight,this.object.matrix),this._panUp(2*n*o/r.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(e*(this.object.right-this.object.left)/this.object.zoom/r.clientWidth,this.object.matrix),this._panUp(n*(this.object.top-this.object.bottom)/this.object.zoom/r.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(e,n){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const r=this.domElement.getBoundingClientRect(),i=e-r.left,o=n-r.top,a=r.width,s=r.height;this._mouse.x=i/a*2-1,this._mouse.y=-(o/s)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(e){return Math.max(this.minDistance,Math.min(this.maxDistance,e))}_handleMouseDownRotate(e){this._rotateStart.set(e.clientX,e.clientY)}_handleMouseDownDolly(e){this._updateZoomParameters(e.clientX,e.clientX),this._dollyStart.set(e.clientX,e.clientY)}_handleMouseDownPan(e){this._panStart.set(e.clientX,e.clientY)}_handleMouseMoveRotate(e){this._rotateEnd.set(e.clientX,e.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const n=this.domElement;this._rotateLeft(ti*this._rotateDelta.x/n.clientHeight),this._rotateUp(ti*this._rotateDelta.y/n.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(e){this._dollyEnd.set(e.clientX,e.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(e){this._panEnd.set(e.clientX,e.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(e){this._updateZoomParameters(e.clientX,e.clientY),e.deltaY<0?this._dollyIn(this._getZoomScale(e.deltaY)):e.deltaY>0&&this._dollyOut(this._getZoomScale(e.deltaY)),this.update()}_handleKeyDown(e){let n=!1;switch(e.code){case this.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(ti*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),n=!0;break;case this.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(-ti*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),n=!0;break;case this.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(ti*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),n=!0;break;case this.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(-ti*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),n=!0;break}n&&(e.preventDefault(),this.update())}_handleTouchStartRotate(e){if(this._pointers.length===1)this._rotateStart.set(e.pageX,e.pageY);else{const n=this._getSecondPointerPosition(e),r=.5*(e.pageX+n.x),i=.5*(e.pageY+n.y);this._rotateStart.set(r,i)}}_handleTouchStartPan(e){if(this._pointers.length===1)this._panStart.set(e.pageX,e.pageY);else{const n=this._getSecondPointerPosition(e),r=.5*(e.pageX+n.x),i=.5*(e.pageY+n.y);this._panStart.set(r,i)}}_handleTouchStartDolly(e){const n=this._getSecondPointerPosition(e),r=e.pageX-n.x,i=e.pageY-n.y,o=Math.sqrt(r*r+i*i);this._dollyStart.set(0,o)}_handleTouchStartDollyPan(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enablePan&&this._handleTouchStartPan(e)}_handleTouchStartDollyRotate(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enableRotate&&this._handleTouchStartRotate(e)}_handleTouchMoveRotate(e){if(this._pointers.length==1)this._rotateEnd.set(e.pageX,e.pageY);else{const r=this._getSecondPointerPosition(e),i=.5*(e.pageX+r.x),o=.5*(e.pageY+r.y);this._rotateEnd.set(i,o)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const n=this.domElement;this._rotateLeft(ti*this._rotateDelta.x/n.clientHeight),this._rotateUp(ti*this._rotateDelta.y/n.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(e){if(this._pointers.length===1)this._panEnd.set(e.pageX,e.pageY);else{const n=this._getSecondPointerPosition(e),r=.5*(e.pageX+n.x),i=.5*(e.pageY+n.y);this._panEnd.set(r,i)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(e){const n=this._getSecondPointerPosition(e),r=e.pageX-n.x,i=e.pageY-n.y,o=Math.sqrt(r*r+i*i);this._dollyEnd.set(0,o),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const a=(e.pageX+n.x)*.5,s=(e.pageY+n.y)*.5;this._updateZoomParameters(a,s)}_handleTouchMoveDollyPan(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enablePan&&this._handleTouchMovePan(e)}_handleTouchMoveDollyRotate(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enableRotate&&this._handleTouchMoveRotate(e)}_addPointer(e){this._pointers.push(e.pointerId)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let n=0;n>5&31)/31,y=(O>>10&31)/31)}for(let O=1;O<=3;O++){const W=R+O*12,L=P*3*3+(O-1)*3;A[L]=u.getFloat32(W,!0),A[L+1]=u.getFloat32(W+4,!0),A[L+2]=u.getFloat32(W+8,!0),M[L]=D,M[L+1]=k,M[L+2]=U,v&&(C.setRGB(f,p,y,Zt),g[L]=C.r,g[L+1]=C.g,g[L+2]=C.b)}}return T.setAttribute("position",new cr(A,3)),T.setAttribute("normal",new cr(M,3)),v&&(T.setAttribute("color",new cr(g,3)),T.hasColors=!0,T.alpha=S),T}function o(c){const u=new br,d=/solid([\s\S]*?)endsolid/g,f=/facet([\s\S]*?)endfacet/g,p=/solid\s(.+)/;let y=0;const v=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,g=new RegExp("vertex"+v+v+v,"g"),m=new RegExp("normal"+v+v+v,"g"),x=[],b=[],S=[],w=new ne;let E,T=0,A=0,M=0;for(;(E=d.exec(c))!==null;){A=M;const C=E[0],P=(E=p.exec(C))!==null?E[1]:"";for(S.push(P);(E=f.exec(C))!==null;){let k=0,U=0;const O=E[0];for(;(E=m.exec(O))!==null;)w.x=parseFloat(E[1]),w.y=parseFloat(E[2]),w.z=parseFloat(E[3]),U++;for(;(E=g.exec(O))!==null;)x.push(parseFloat(E[1]),parseFloat(E[2]),parseFloat(E[3])),b.push(w.x,w.y,w.z),k++,M++;U!==1&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+y),k!==3&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+y),y++}const R=A,D=M-A;u.userData.groupNames=S,u.addGroup(R,D,T),T++}return u.setAttribute("position",new Qt(x,3)),u.setAttribute("normal",new Qt(b,3)),u}function a(c){return typeof c!="string"?new TextDecoder().decode(c):c}function s(c){if(typeof c=="string"){const u=new Uint8Array(c.length);for(let d=0;d256||O.colormap_size!==24||O.colormap_type!==1)throw new Error("THREE.TGALoader: Invalid type colormap data for indexed type.");break;case p:case y:case g:case m:if(O.colormap_type)throw new Error("THREE.TGALoader: Invalid type colormap data for colormap type.");break;case d:throw new Error("THREE.TGALoader: No data.");default:throw new Error("THREE.TGALoader: Invalid type "+O.image_type)}if(O.width<=0||O.height<=0)throw new Error("THREE.TGALoader: Invalid image size.");if(O.pixel_size!==8&&O.pixel_size!==16&&O.pixel_size!==24&&O.pixel_size!==32)throw new Error("THREE.TGALoader: Invalid pixel size "+O.pixel_size)}function r(O,W,L,j,X){let K,F;const Y=L.pixel_size>>3,q=L.width*L.height*Y;if(W&&(F=X.subarray(j,j+=L.colormap_length*(L.colormap_size>>3))),O){K=new Uint8Array(q);let ee,te,Q,ce=0;const ae=new Uint8Array(Y);for(;ce>7,O[(te+ce*Q)*4+1]=(q&992)>>2,O[(te+ce*Q)*4+2]=(q&31)<<3,O[(te+ce*Q)*4+3]=q&32768?0:255;return O}function a(O,W,L,j,X,K,F,Y){let q=0,ee,te;const Q=C.width;for(te=W;te!==j;te+=L)for(ee=X;ee!==F;ee+=K,q+=3)O[(ee+Q*te)*4+3]=255,O[(ee+Q*te)*4+2]=Y[q+0],O[(ee+Q*te)*4+1]=Y[q+1],O[(ee+Q*te)*4+0]=Y[q+2];return O}function s(O,W,L,j,X,K,F,Y){let q=0,ee,te;const Q=C.width;for(te=W;te!==j;te+=L)for(ee=X;ee!==F;ee+=K,q+=4)O[(ee+Q*te)*4+2]=Y[q+0],O[(ee+Q*te)*4+1]=Y[q+1],O[(ee+Q*te)*4+0]=Y[q+2],O[(ee+Q*te)*4+3]=Y[q+3];return O}function l(O,W,L,j,X,K,F,Y){let q,ee=0,te,Q;const ce=C.width;for(Q=W;Q!==j;Q+=L)for(te=X;te!==F;te+=K,ee++)q=Y[ee],O[(te+ce*Q)*4+0]=q,O[(te+ce*Q)*4+1]=q,O[(te+ce*Q)*4+2]=q,O[(te+ce*Q)*4+3]=255;return O}function c(O,W,L,j,X,K,F,Y){let q=0,ee,te;const Q=C.width;for(te=W;te!==j;te+=L)for(ee=X;ee!==F;ee+=K,q+=2)O[(ee+Q*te)*4+0]=Y[q+0],O[(ee+Q*te)*4+1]=Y[q+0],O[(ee+Q*te)*4+2]=Y[q+0],O[(ee+Q*te)*4+3]=Y[q+1];return O}function u(O,W,L,j,X){let K,F,Y,q,ee,te;switch((C.flags&x)>>b){default:case E:K=0,Y=1,ee=W,F=0,q=1,te=L;break;case S:K=0,Y=1,ee=W,F=L-1,q=-1,te=-1;break;case T:K=W-1,Y=-1,ee=-1,F=0,q=1,te=L;break;case w:K=W-1,Y=-1,ee=-1,F=L-1,q=-1,te=-1;break}if(D)switch(C.pixel_size){case 8:l(O,F,q,te,K,Y,ee,j);break;case 16:c(O,F,q,te,K,Y,ee,j);break;default:throw new Error("THREE.TGALoader: Format not supported.")}else switch(C.pixel_size){case 8:i(O,F,q,te,K,Y,ee,j,X);break;case 16:o(O,F,q,te,K,Y,ee,j);break;case 24:a(O,F,q,te,K,Y,ee,j);break;case 32:s(O,F,q,te,K,Y,ee,j);break;default:throw new Error("THREE.TGALoader: Format not supported.")}return O}const d=0,f=1,p=2,y=3,v=9,g=10,m=11,x=48,b=4,S=0,w=1,E=2,T=3;if(e.length<19)throw new Error("THREE.TGALoader: Not enough data to contain header.");let A=0;const M=new Uint8Array(e),C={id_length:M[A++],colormap_type:M[A++],image_type:M[A++],colormap_index:M[A++]|M[A++]<<8,colormap_length:M[A++]|M[A++]<<8,colormap_size:M[A++],origin:[M[A++]|M[A++]<<8,M[A++]|M[A++]<<8],width:M[A++]|M[A++]<<8,height:M[A++]|M[A++]<<8,pixel_size:M[A++],flags:M[A++]};if(n(C),C.id_length+A>e.length)throw new Error("THREE.TGALoader: No data.");A+=C.id_length;let P=!1,R=!1,D=!1;switch(C.image_type){case v:P=!0,R=!0;break;case f:R=!0;break;case g:P=!0;break;case p:break;case m:P=!0,D=!0;break;case y:D=!0;break}const k=new Uint8Array(C.width*C.height*4),U=r(P,R,C,A,M);return u(k,C.width,C.height,U.pixel_data,U.palettes),{data:k,width:C.width,height:C.height,flipY:!0,generateMipmaps:!0,minFilter:Oo}}}class a$ extends Vo{load(e,n,r,i){const o=this,a=o.path===""?mc.extractUrlBase(e):o.path,s=new Mf(o.manager);s.setPath(o.path),s.setRequestHeader(o.requestHeader),s.setWithCredentials(o.withCredentials),s.load(e,function(l){try{n(o.parse(l,a))}catch(c){i?i(c):console.error(c),o.manager.itemError(e)}},r,i)}parse(e,n){function r(I,N){const H=[],$=I.childNodes;for(let V=0,pe=$.length;V0&&N.push(new pl($+".position",V,pe)),ye.length>0&&N.push(new Ic($+".quaternion",V,ye)),Xe.length>0&&N.push(new pl($+".scale",V,Xe)),N}function P(I,N,H){let $,V=!0,pe,ye;for(pe=0,ye=I.length;pe=0;){const $=I[N];if($.value[H]!==null)return $;N--}return null}function k(I,N,H){for(;N>>0)+2);switch(H=H.toLowerCase(),H){case"tga":N=wr;break;default:N=Lr}return N}function be(I){const N=B(I.url),H=N.profile.technique;let $;switch(H.type){case"phong":case"blinn":$=new Fo;break;case"lambert":$=new Lee;break;default:$=new ua;break}$.name=I.name||"";function V(De,$e=null){const lt=N.profile.samplers[De.id];let Ae=null;if(lt!==void 0){const at=N.profile.surfaces[lt.source];Ae=ce(at.init_from)}else console.warn("THREE.ColladaLoader: Undefined sampler. Access image directly (see #12530)."),Ae=ce(De.id);if(Ae!==null){const at=me(Ae);if(at!==void 0){const Qe=at.load(Ae),yt=De.extra;if(yt!==void 0&&yt.technique!==void 0&&c(yt.technique)===!1){const dt=yt.technique;Qe.wrapS=dt.wrapU?ca:Ji,Qe.wrapT=dt.wrapV?ca:Ji,Qe.offset.set(dt.offsetU||0,dt.offsetV||0),Qe.repeat.set(dt.repeatU||1,dt.repeatV||1)}else Qe.wrapS=ca,Qe.wrapT=ca;return $e!==null&&(Qe.colorSpace=$e),Qe}else return console.warn("THREE.ColladaLoader: Loader for texture %s not found.",Ae),null}else return console.warn("THREE.ColladaLoader: Couldn't create texture with ID:",De.id),null}const pe=H.parameters;for(const De in pe){const $e=pe[De];switch(De){case"diffuse":$e.color&&$.color.fromArray($e.color),$e.texture&&($.map=V($e.texture,Zt));break;case"specular":$e.color&&$.specular&&$.specular.fromArray($e.color),$e.texture&&($.specularMap=V($e.texture));break;case"bump":$e.texture&&($.normalMap=V($e.texture));break;case"ambient":$e.texture&&($.lightMap=V($e.texture,Zt));break;case"shininess":$e.float&&$.shininess&&($.shininess=$e.float);break;case"emission":$e.color&&$.emissive&&$.emissive.fromArray($e.color),$e.texture&&($.emissiveMap=V($e.texture,Zt));break}}Dt.colorSpaceToWorking($.color,Zt),$.specular&&Dt.colorSpaceToWorking($.specular,Zt),$.emissive&&Dt.colorSpaceToWorking($.emissive,Zt);let ye=pe.transparent,Xe=pe.transparency;if(Xe===void 0&&ye&&(Xe={float:1}),ye===void 0&&Xe&&(ye={opaque:"A_ONE",data:{color:[1,1,1,1]}}),ye&&Xe)if(ye.data.texture)$.transparent=!0;else{const De=ye.data.color;switch(ye.opaque){case"A_ONE":$.opacity=De[3]*Xe.float;break;case"RGB_ZERO":$.opacity=1-De[0]*Xe.float;break;case"A_ZERO":$.opacity=1-De[3]*Xe.float;break;case"RGB_ONE":$.opacity=De[0]*Xe.float;break;default:console.warn('THREE.ColladaLoader: Invalid opaque type "%s" of transparent tag.',ye.opaque)}$.opacity<1&&($.transparent=!0)}if(H.extra!==void 0&&H.extra.technique!==void 0){const De=H.extra.technique;for(const $e in De){const lt=De[$e];switch($e){case"double_sided":$.side=lt===1?Ki:ba;break;case"bump":$.normalMap=V(lt.texture),$.normalScale=new xt(1,1);break}}}return $}function ge(I){return v(Et.materials[I],be)}function rt(I){const N={name:I.getAttribute("name")};for(let H=0,$=I.childNodes.length;H<$;H++){const V=I.childNodes[H];if(V.nodeType===1)switch(V.nodeName){case"optics":N.optics=Ie(V);break}}Et.cameras[I.getAttribute("id")]=N}function Ie(I){for(let N=0;N0?ye+De:ye;N.inputs[$e]={id:pe,offset:Xe},N.stride=Math.max(N.stride,Xe+1),ye==="TEXCOORD"&&(N.hasUV=!0);break;case"vcount":N.vcount=a(V.textContent);break;case"p":N.p=a(V.textContent);break}}return N}function _e(I){const N={};for(let H=0;H0&&N0&&Ae.setAttribute("position",new Qt(V.array,V.stride)),pe.array.length>0&&Ae.setAttribute("normal",new Qt(pe.array,pe.stride)),De.array.length>0&&Ae.setAttribute("color",new Qt(De.array,De.stride)),ye.array.length>0&&Ae.setAttribute("uv",new Qt(ye.array,ye.stride)),Xe.array.length>0&&Ae.setAttribute("uv1",new Qt(Xe.array,Xe.stride)),$e.array.length>0&&Ae.setAttribute("skinIndex",new Qt($e.array,$e.stride)),lt.array.length>0&&Ae.setAttribute("skinWeight",new Qt(lt.array,lt.stride)),$.data=Ae,$.type=I[0].type,$.materialKeys=at,$}function pt(I,N,H,$,V=!1){const pe=I.p,ye=I.stride,Xe=I.vcount;function De(Ae){let at=pe[Ae+H]*lt;const Qe=at+lt;for(;at4)for(let dt=1,An=yt-2;dt<=An;dt++){const en=Ae+ye*0,Gt=Ae+ye*dt,Wt=Ae+ye*(dt+1);De(en),De(Gt),De(Wt)}Ae+=ye*yt}}else for(let Ae=0,at=pe.length;Ae=N.limits.max&&(N.static=!0),N.middlePosition=(N.limits.min+N.limits.max)/2,N}function zf(I){const N={sid:I.getAttribute("sid"),name:I.getAttribute("name")||"",attachments:[],transforms:[]};for(let H=0;HQe.limits.max||Aer===null?null:parseFloat(r)),(!this.origPosition||!this.origQuaternion)&&(this.origPosition=this.position.clone(),this.origQuaternion=this.quaternion.clone());let n=!1;switch(this.mimicJoints.forEach(r=>{n=r.updateFromMimickedJoint(...e)||n}),this.jointType){case"fixed":return n;case"continuous":case"revolute":{let r=e[0];return r==null||r===this.jointValue[0]?n:(!this.ignoreLimits&&this.jointType==="revolute"&&(r=Math.min(this.limit.upper,r),r=Math.max(this.limit.lower,r)),this.quaternion.setFromAxisAngle(this.axis,r).premultiply(this.origQuaternion),this.jointValue[0]!==r?(this.jointValue[0]=r,this.matrixWorldNeedsUpdate=!0,!0):n)}case"prismatic":{let r=e[0];return r==null||r===this.jointValue[0]?n:(this.ignoreLimits||(r=Math.min(this.limit.upper,r),r=Math.max(this.limit.lower,r)),this.position.copy(this.origPosition),o2.copy(this.axis).applyEuler(this.rotation),this.position.addScaledVector(o2,r),this.jointValue[0]!==r?(this.jointValue[0]=r,this.matrixWorldNeedsUpdate=!0,!0):n)}case"floating":return this.jointValue.every((r,i)=>e[i]===r||e[i]===null)?n:(this.jointValue[0]=e[0]!==null?e[0]:this.jointValue[0],this.jointValue[1]=e[1]!==null?e[1]:this.jointValue[1],this.jointValue[2]=e[2]!==null?e[2]:this.jointValue[2],this.jointValue[3]=e[3]!==null?e[3]:this.jointValue[3],this.jointValue[4]=e[4]!==null?e[4]:this.jointValue[4],this.jointValue[5]=e[5]!==null?e[5]:this.jointValue[5],Ts.compose(this.origPosition,this.origQuaternion,iv),rv.setFromEuler(lae.set(this.jointValue[3],this.jointValue[4],this.jointValue[5],"XYZ")),ov.set(this.jointValue[0],this.jointValue[1],this.jointValue[2]),nv.compose(ov,rv,iv),Ts.premultiply(nv),this.position.setFromMatrixPosition(Ts),this.rotation.setFromRotationMatrix(Ts),this.matrixWorldNeedsUpdate=!0,!0);case"planar":return this.jointValue.every((r,i)=>e[i]===r||e[i]===null)?n:(this.jointValue[0]=e[0]!==null?e[0]:this.jointValue[0],this.jointValue[1]=e[1]!==null?e[1]:this.jointValue[1],this.jointValue[2]=e[2]!==null?e[2]:this.jointValue[2],Ts.compose(this.origPosition,this.origQuaternion,iv),rv.setFromAxisAngle(this.axis,this.jointValue[2]),ov.set(this.jointValue[0],this.jointValue[1],0),nv.compose(ov,rv,iv),Ts.premultiply(nv),this.position.setFromMatrixPosition(Ts),this.rotation.setFromRotationMatrix(Ts),this.matrixWorldNeedsUpdate=!0,!0)}return n}}class a2 extends l${constructor(...e){super(...e),this.type="URDFMimicJoint",this.mimicJoint=null,this.offset=0,this.multiplier=1}updateFromMimickedJoint(...e){const n=e.map(r=>r*this.multiplier+this.offset);return super.setJointValue(...n)}copy(e,n){return super.copy(e,n),this.mimicJoint=e.mimicJoint,this.offset=e.offset,this.multiplier=e.multiplier,this}}class dae extends s${constructor(...e){super(...e),this.isURDFRobot=!0,this.urdfNode=null,this.urdfRobotNode=null,this.robotName=null,this.links=null,this.joints=null,this.colliders=null,this.visual=null,this.frames=null}copy(e,n){super.copy(e,n),this.urdfRobotNode=e.urdfRobotNode,this.robotName=e.robotName,this.links={},this.joints={},this.colliders={},this.visual={},this.traverse(r=>{r.isURDFJoint&&r.urdfName in e.joints&&(this.joints[r.urdfName]=r),r.isURDFLink&&r.urdfName in e.links&&(this.links[r.urdfName]=r),r.isURDFCollider&&r.urdfName in e.colliders&&(this.colliders[r.urdfName]=r),r.isURDFVisual&&r.urdfName in e.visual&&(this.visual[r.urdfName]=r)});for(const r in this.joints)this.joints[r].mimicJoints=this.joints[r].mimicJoints.map(i=>this.joints[i.name]);return this.frames={...this.colliders,...this.visual,...this.links,...this.joints},this}getFrame(e){return this.frames[e]}setJointValue(e,...n){const r=this.joints[e];return r?r.setJointValue(...n):!1}setJointValues(e){let n=!1;for(const r in e){const i=e[r];Array.isArray(i)?n=this.setJointValue(r,...i)||n:n=this.setJointValue(r,i)||n}return n}}const Aw=new Ii,s2=new pi;function _u(t){return t?t.trim().split(/\s+/g).map(e=>parseFloat(e)):[0,0,0]}function l2(t,e,n=!1){n||t.rotation.set(0,0,0),s2.set(e[0],e[1],e[2],"ZYX"),Aw.setFromEuler(s2),Aw.multiply(t.quaternion),t.quaternion.copy(Aw)}class fae{constructor(e){this.manager=e||q4,this.loadMeshCb=this.defaultMeshLoader.bind(this),this.parseVisual=!0,this.parseCollision=!1,this.packages="",this.workingPath="",this.fetchOptions={}}loadAsync(e){return new Promise((n,r)=>{this.load(e,n,null,r)})}load(e,n,r,i){const o=this.manager,a=mc.extractUrlBase(e),s=this.manager.resolveURL(e);o.itemStart(s),fetch(s,this.fetchOptions).then(l=>{if(l.ok)return r&&r(null),l.text();throw new Error(`URDFLoader: Failed to load url '${s}' with error code ${l.status} : ${l.statusText}.`)}).then(l=>{const c=this.parse(l,this.workingPath||a);n(c),o.itemEnd(s)}).catch(l=>{i?i(l):console.error("URDFLoader: Error loading file.",l),o.itemError(s),o.itemEnd(s)})}parse(e,n=this.workingPath){const r=this.packages,i=this.loadMeshCb,o=this.parseVisual,a=this.parseCollision,s=this.manager,l={},c={},u={};function d(x){if(!/^package:\/\//.test(x))return n?n+x:x;const[b,S]=x.replace(/^package:\/\//,"").split(/\/(.+)/);if(typeof r=="string")return r.endsWith(b)?r+"/"+S:r+"/"+b+"/"+S;if(r instanceof Function)return r(b)+"/"+S;if(typeof r=="object")return b in r?r[b]+"/"+S:(console.error(`URDFLoader : ${b} not found in provided package list.`),null)}function f(x){let b;x instanceof Document?b=[...x.children]:x instanceof Element?b=[x]:b=[...new DOMParser().parseFromString(x,"text/xml").children];const S=b.filter(w=>w.nodeName==="robot").pop();return p(S)}function p(x){const b=[...x.children],S=b.filter(P=>P.nodeName.toLowerCase()==="link"),w=b.filter(P=>P.nodeName.toLowerCase()==="joint"),E=b.filter(P=>P.nodeName.toLowerCase()==="material"),T=new dae;T.robotName=x.getAttribute("name"),T.urdfRobotNode=x,E.forEach(P=>{const R=P.getAttribute("name");u[R]=g(P)});const A={},M={};S.forEach(P=>{const R=P.getAttribute("name"),D=x.querySelector(`child[link="${R}"]`)===null;l[R]=v(P,A,M,D?T:null)}),w.forEach(P=>{const R=P.getAttribute("name");c[R]=y(P)}),T.joints=c,T.links=l,T.colliders=M,T.visual=A;const C=Object.values(c);return C.forEach(P=>{P instanceof a2&&c[P.mimicJoint].mimicJoints.push(P)}),C.forEach(P=>{const R=new Set,D=k=>{if(R.has(k))throw new Error("URDFLoader: Detected an infinite loop of mimic joints.");R.add(k),k.mimicJoints.forEach(U=>{D(U)})};D(P)}),T.frames={...M,...A,...l,...c},T}function y(x){const b=[...x.children],S=x.getAttribute("type");let w;const E=b.find(R=>R.nodeName.toLowerCase()==="mimic");E?(w=new a2,w.mimicJoint=E.getAttribute("joint"),w.multiplier=parseFloat(E.getAttribute("multiplier")||1),w.offset=parseFloat(E.getAttribute("offset")||0)):w=new l$,w.urdfNode=x,w.name=x.getAttribute("name"),w.urdfName=w.name,w.jointType=S;let T=null,A=null,M=[0,0,0],C=[0,0,0];b.forEach(R=>{const D=R.nodeName.toLowerCase();D==="origin"?(M=_u(R.getAttribute("xyz")),C=_u(R.getAttribute("rpy"))):D==="child"?A=l[R.getAttribute("link")]:D==="parent"?T=l[R.getAttribute("link")]:D==="limit"&&(w.limit.lower=parseFloat(R.getAttribute("lower")||w.limit.lower),w.limit.upper=parseFloat(R.getAttribute("upper")||w.limit.upper))}),T.add(w),w.add(A),l2(w,C),w.position.set(M[0],M[1],M[2]);const P=b.filter(R=>R.nodeName.toLowerCase()==="axis")[0];if(P){const R=P.getAttribute("xyz").split(/\s+/g).map(D=>parseFloat(D));w.axis=new ne(R[0],R[1],R[2]),w.axis.normalize()}return w}function v(x,b,S,w=null){w===null&&(w=new s$);const E=[...x.children];return w.name=x.getAttribute("name"),w.urdfName=w.name,w.urdfNode=x,o&&E.filter(A=>A.nodeName.toLowerCase()==="visual").forEach(A=>{const M=m(A,u);if(w.add(M),A.hasAttribute("name")){const C=A.getAttribute("name");M.name=C,M.urdfName=C,b[C]=M}}),a&&E.filter(A=>A.nodeName.toLowerCase()==="collision").forEach(A=>{const M=m(A);if(w.add(M),A.hasAttribute("name")){const C=A.getAttribute("name");M.name=C,M.urdfName=C,S[C]=M}}),w}function g(x){const b=[...x.children],S=new Fo;return S.name=x.getAttribute("name")||"",b.forEach(w=>{const E=w.nodeName.toLowerCase();if(E==="color"){const T=w.getAttribute("rgba").split(/\s/g).map(A=>parseFloat(A));S.color.setRGB(T[0],T[1],T[2]),S.opacity=T[3],S.transparent=T[3]<1,S.depthWrite=!S.transparent}else if(E==="texture"){const T=w.getAttribute("filename");if(T){const A=new aC(s),M=d(T);S.map=A.load(M),S.map.colorSpace=Zt}}}),S}function m(x,b={}){const S=x.nodeName.toLowerCase()==="collision",w=[...x.children];let E=null;const T=w.filter(M=>M.nodeName.toLowerCase()==="material")[0];if(T){const M=T.getAttribute("name");M&&M in b?E=b[M]:E=g(T)}else E=new Fo;const A=S?new cae:new uae;return A.urdfNode=x,w.forEach(M=>{const C=M.nodeName.toLowerCase();if(C==="geometry"){const P=M.children[0].nodeName.toLowerCase();if(P==="mesh"){const R=M.children[0].getAttribute("filename"),D=d(R);if(D!==null){const k=M.children[0].getAttribute("scale");if(k){const U=_u(k);A.scale.set(U[0],U[1],U[2])}i(D,s,(U,O)=>{O?console.error("URDFLoader: Error loading mesh.",O):U&&(U instanceof Tn&&(U.material=E),U.position.set(0,0,0),U.quaternion.identity(),A.add(U))})}}else if(P==="box"){const R=new Tn;R.geometry=new Gc(1,1,1),R.material=E;const D=_u(M.children[0].getAttribute("size"));R.scale.set(D[0],D[1],D[2]),A.add(R)}else if(P==="sphere"){const R=new Tn;R.geometry=new iC(1,30,30),R.material=E;const D=parseFloat(M.children[0].getAttribute("radius"))||0;R.scale.set(D,D,D),A.add(R)}else if(P==="cylinder"){const R=new Tn;R.geometry=new rC(1,1,1,30),R.material=E;const D=parseFloat(M.children[0].getAttribute("radius"))||0,k=parseFloat(M.children[0].getAttribute("length"))||0;R.scale.set(D,k,D),R.rotation.set(Math.PI/2,0,0),A.add(R)}}else if(C==="origin"){const P=_u(M.getAttribute("xyz")),R=_u(M.getAttribute("rpy"));A.position.set(P[0],P[1],P[2]),A.rotation.set(0,0,0),l2(A,R)}}),A}return f(e)}defaultMeshLoader(e,n,r){/\.stl$/i.test(e)?new o$(n).load(e,o=>{const a=new Tn(o,new Fo);r(a)}):/\.dae$/i.test(e)?new a$(n).load(e,o=>r(o.scene)):console.warn(`URDFLoader: Could not load model at ${e}. +No loader available`)}}const hae=new xt,pae=()=>{};class mae extends HTMLElement{static get observedAttributes(){return["package","urdf","up","display-shadow","ambient-color","ignore-limits","show-collision"]}get package(){return this.getAttribute("package")||""}set package(e){this.setAttribute("package",e)}get urdf(){return this.getAttribute("urdf")||""}set urdf(e){this.setAttribute("urdf",e)}get ignoreLimits(){return this.hasAttribute("ignore-limits")||!1}set ignoreLimits(e){e?this.setAttribute("ignore-limits",e):this.removeAttribute("ignore-limits")}get up(){return this.getAttribute("up")||"+Z"}set up(e){this.setAttribute("up",e)}get displayShadow(){return this.hasAttribute("display-shadow")||!1}set displayShadow(e){e?this.setAttribute("display-shadow",""):this.removeAttribute("display-shadow")}get ambientColor(){return this.getAttribute("ambient-color")||"#8ea0a8"}set ambientColor(e){e?this.setAttribute("ambient-color",e):this.removeAttribute("ambient-color")}get autoRedraw(){return this.hasAttribute("auto-redraw")||!1}set autoRedraw(e){e?this.setAttribute("auto-redraw",!0):this.removeAttribute("auto-redraw")}get noAutoRecenter(){return this.hasAttribute("no-auto-recenter")||!1}set noAutoRecenter(e){e?this.setAttribute("no-auto-recenter",!0):this.removeAttribute("no-auto-recenter")}get showCollision(){return this.hasAttribute("show-collision")||!1}set showCollision(e){e?this.setAttribute("show-collision",!0):this.removeAttribute("show-collision")}get jointValues(){const e={};if(this.robot)for(const n in this.robot.joints){const r=this.robot.joints[n];e[n]=r.jointValue.length===1?r.angle:[...r.jointValue]}return e}set jointValues(e){this.setJointValues(e)}get angles(){return this.jointValues}set angles(e){this.jointValues=e}constructor(){super(),this._requestId=0,this._dirty=!1,this._loadScheduled=!1,this.robot=null,this.loadMeshFunc=null,this.urlModifierFunc=null;const e=new z4,n=new Kee(this.ambientColor,"#000");n.groundColor.lerp(n.color,.5*Math.PI),n.intensity=.5,n.position.set(0,1,0),e.add(n);const r=new zx(16777215,Math.PI);r.position.set(4,10,1),r.shadow.mapSize.width=2048,r.shadow.mapSize.height=2048,r.shadow.normalBias=.001,r.castShadow=!0,e.add(r),e.add(r.target);const i=new Xoe({antialias:!0,alpha:!0});i.setClearColor(16777215),i.setClearAlpha(0),i.shadowMap.enabled=!0,i.shadowMap.type=w4,i.outputColorSpace=Zt;const o=new gr(75,1,.1,1e3);o.position.z=-10;const a=new vn;e.add(a);const s=new Tn(new Im(40,40),new Dee({side:Ki,transparent:!0,opacity:.25}));s.rotation.x=-Math.PI/2,s.position.y=-.5,s.receiveShadow=!0,s.scale.set(10,10,10),e.add(s);const l=new Koe(o,i.domElement);l.rotateSpeed=2,l.zoomSpeed=5,l.panSpeed=2,l.enableZoom=!0,l.enableDamping=!1,l.maxDistance=50,l.minDistance=.25,l.addEventListener("change",()=>this.recenter()),this.scene=e,this.world=a,this.renderer=i,this.camera=o,this.controls=l,this.plane=s,this.directionalLight=r,this.ambientLight=n,this._setUp(this.up),this._collisionMaterial=new Fo({transparent:!0,opacity:.35,shininess:2.5,premultipliedAlpha:!0,color:16760376,polygonOffset:!0,polygonOffsetFactor:-1,polygonOffsetUnits:-1});const c=()=>{this.parentNode&&(this.updateSize(),(this._dirty||this.autoRedraw)&&(this.noAutoRecenter||this._updateEnvironment(),this.renderer.render(e,o),this._dirty=!1),this.controls.update()),this._renderLoopId=requestAnimationFrame(c)};c()}connectedCallback(){if(!this.constructor._styletag){const e=document.createElement("style");e.innerHTML=` + ${this.tagName} { display: block; } + ${this.tagName} canvas { + width: 100%; + height: 100%; + } + `,document.head.appendChild(e),this.constructor._styletag=e}this.childElementCount===0&&this.appendChild(this.renderer.domElement),this.updateSize(),requestAnimationFrame(()=>this.updateSize())}disconnectedCallback(){cancelAnimationFrame(this._renderLoopId)}attributeChangedCallback(e,n,r){switch(this._updateCollisionVisibility(),this.noAutoRecenter||this.recenter(),e){case"package":case"urdf":{this._scheduleLoad();break}case"up":{this._setUp(this.up);break}case"ambient-color":{this.ambientLight.color.set(this.ambientColor),this.ambientLight.groundColor.set("#000").lerp(this.ambientLight.color,.5);break}case"ignore-limits":{this._setIgnoreLimits(this.ignoreLimits,!0);break}}}updateSize(){const e=this.renderer,n=this.clientWidth,r=this.clientHeight,i=e.getSize(hae);(i.width!==n||i.height!==r)&&this.recenter(),e.setPixelRatio(window.devicePixelRatio),e.setSize(n,r,!1),this.camera.aspect=n/r,this.camera.updateProjectionMatrix()}redraw(){this._dirty=!0}recenter(){this._updateEnvironment(),this.redraw()}setJointValue(e,...n){this.robot&&this.robot.joints[e]&&this.robot.joints[e].setJointValue(...n)&&(this.redraw(),this.dispatchEvent(new CustomEvent("angle-change",{bubbles:!0,cancelable:!0,detail:e})))}setJointValues(e){for(const n in e)this.setJointValue(n,e[n])}_updateEnvironment(){const e=this.robot;if(!e)return;this.world.updateMatrixWorld();const n=new Wo;n.makeEmpty(),e.traverse(o=>{o.isURDFVisual&&n.expandByObject(o)});const r=n.getCenter(new ne);this.controls.target.y=r.y,this.plane.position.y=n.min.y-.001;const i=this.directionalLight;if(i.castShadow=this.displayShadow,this.displayShadow){const a=n.getBoundingSphere(new Xo).radius,s=i.shadow.camera;s.left=s.bottom=-a,s.right=s.top=a;const l=i.position.clone().sub(i.target.position);i.target.position.copy(r),i.position.copy(r).add(l),s.updateProjectionMatrix()}}_scheduleLoad(){this._prevload!==`${this.package}|${this.urdf}`&&(this._prevload=`${this.package}|${this.urdf}`,!this._loadScheduled&&(this._loadScheduled=!0,this.robot&&(this.robot.traverse(e=>e.dispose&&e.dispose()),this.robot.parent.remove(this.robot),this.robot=null),requestAnimationFrame(()=>{this._loadUrdf(this.package,this.urdf),this._loadScheduled=!1})))}_loadUrdf(e,n){if(this.dispatchEvent(new CustomEvent("urdf-change",{bubbles:!0,cancelable:!0,composed:!0})),n){this._requestId++;const r=this._requestId,i=l=>{l.traverse(c=>{if(c.isMesh&&(c.castShadow=!0,c.receiveShadow=!0,c.material)){const u=(Array.isArray(c.material)?c.material:[c.material]).map(d=>(d instanceof ua&&(d=new Fo),d.map&&(d.map.colorSpace=Zt),d));c.material=u.length===1?u[0]:u}})};e.includes(":")&&e.split(":")[1].substring(0,2)!=="//"&&(e=e.split(",").reduce((l,c)=>{const u=c.split(/:/).filter(p=>!!p),d=u.shift().trim(),f=u.join(":").trim();return l[d]=f,l},{}));let o=null;const a=new X4;a.onLoad=()=>{if(this._requestId!==r){o.traverse(l=>l.dispose&&l.dispose());return}this.robot=o,this.world.add(o),i(o),this._setIgnoreLimits(this.ignoreLimits),this._updateCollisionVisibility(),this.dispatchEvent(new CustomEvent("urdf-processed",{bubbles:!0,cancelable:!0,composed:!0})),this.dispatchEvent(new CustomEvent("geometry-loaded",{bubbles:!0,cancelable:!0,composed:!0})),this.recenter()},this.urlModifierFunc&&a.setURLModifier(this.urlModifierFunc);const s=new fae(a);s.packages=e,s.loadMeshCb=this.loadMeshFunc,s.fetchOptions={mode:"cors",credentials:"same-origin"},s.parseCollision=!0,s.load(n,l=>o=l)}}_updateCollisionVisibility(){const e=this.showCollision,n=this._collisionMaterial,r=this.robot;if(r===null)return;const i=[];r.traverse(o=>{o.isURDFCollider&&(o.visible=e,i.push(o))}),i.forEach(o=>{o.traverse(a=>{a.isMesh&&(a.raycast=pae,a.material=n,a.castShadow=!1)})})}_setUp(e){e||(e="+Z"),e=e.toUpperCase();const n=e.replace(/[^-+]/g,"")[0]||"+",r=e.replace(/[^XYZ]/gi,"")[0]||"Z",i=Math.PI,o=i/2;r==="X"&&this.world.rotation.set(0,0,n==="+"?o:-o),r==="Z"&&this.world.rotation.set(n==="+"?-o:o,0,0),r==="Y"&&this.world.rotation.set(n==="+"?0:i,0,0)}_setIgnoreLimits(e,n=!1){this.robot&&Object.values(this.robot.joints).forEach(r=>{r.ignoreLimits=e,r.setJointValue(...r.jointValue)}),n&&this.dispatchEvent(new CustomEvent("ignore-limits-change",{bubbles:!0,cancelable:!0,composed:!0}))}}function gae(t){return t.isURDFJoint&&t.jointType!=="fixed"}function vae(t){let e=t;for(;e;){if(gae(e))return e;e=e.parent}return e}const Cw=new ne,Pw=new ne,Gu=new ne,ri=new ne,c2=new ne,Rh=new ne,Nh=new ne,Ao=new $a;class yae{constructor(e){this.enabled=!0,this.scene=e,this.raycaster=new Z4,this.initialGrabPoint=new ne,this.hitDistance=-1,this.hovered=null,this.manipulating=null}update(){const{raycaster:e,hovered:n,manipulating:r,scene:i}=this;if(r)return;let o=null;const a=e.intersectObject(i,!0);if(a.length!==0){const s=a[0];this.hitDistance=s.distance,o=vae(s.object),this.initialGrabPoint.copy(s.point)}o!==n&&(n&&this.onUnhover(n),this.hovered=o,o&&this.onHover(o))}updateJoint(e,n){e.setJointValue(n)}onDragStart(e){}onDragEnd(e){}onHover(e){}onUnhover(e){}getRevoluteDelta(e,n,r){return ri.copy(e.axis).transformDirection(e.matrixWorld).normalize(),Gu.set(0,0,0).applyMatrix4(e.matrixWorld),Ao.setFromNormalAndCoplanarPoint(ri,Gu),Ao.projectPoint(n,Rh),Ao.projectPoint(r,Nh),Rh.sub(Gu),Nh.sub(Gu),ri.crossVectors(Rh,Nh),Math.sign(ri.dot(Ao.normal))*Nh.angleTo(Rh)}getPrismaticDelta(e,n,r){return ri.subVectors(r,n),Ao.normal.copy(e.axis).transformDirection(e.parent.matrixWorld).normalize(),ri.dot(Ao.normal)}moveRay(e){const{raycaster:n,hitDistance:r,manipulating:i}=this,{ray:o}=n;if(i){o.at(r,Cw),e.at(r,Pw);let a=0;i.jointType==="revolute"||i.jointType==="continuous"?a=this.getRevoluteDelta(i,Cw,Pw):i.jointType==="prismatic"&&(a=this.getPrismaticDelta(i,Cw,Pw)),a&&this.updateJoint(i,i.angle+a)}this.raycaster.ray.copy(e),this.update()}setGrabbed(e){const{hovered:n,manipulating:r}=this;if(e){if(r!==null||n===null)return;this.manipulating=n,this.onDragStart(n)}else{if(this.manipulating===null)return;this.onDragEnd(this.manipulating),this.manipulating=null,this.update()}}}class xae extends yae{constructor(e,n,r){super(e),this.camera=n,this.domElement=r;const i=new Z4,o=new xt;function a(s){const l=r.getBoundingClientRect();o.x=(s.clientX-l.left)/l.width*2-1,o.y=-((s.clientY-l.top)/l.height)*2+1}this._mouseDown=s=>{a(s),i.setFromCamera(o,this.camera),this.moveRay(i.ray),this.setGrabbed(!0)},this._mouseMove=s=>{a(s),i.setFromCamera(o,this.camera),this.moveRay(i.ray)},this._mouseUp=s=>{a(s),i.setFromCamera(o,this.camera),this.moveRay(i.ray),this.setGrabbed(!1)},r.addEventListener("mousedown",this._mouseDown),r.addEventListener("mousemove",this._mouseMove),r.addEventListener("mouseup",this._mouseUp)}getRevoluteDelta(e,n,r){const{camera:i,initialGrabPoint:o}=this;return ri.copy(e.axis).transformDirection(e.matrixWorld).normalize(),Gu.set(0,0,0).applyMatrix4(e.matrixWorld),Ao.setFromNormalAndCoplanarPoint(ri,Gu),ri.copy(i.position).sub(o).normalize(),Math.abs(ri.dot(Ao.normal))>.3?super.getRevoluteDelta(e,n,r):(ri.set(0,1,0).transformDirection(i.matrixWorld),Ao.projectPoint(n,Rh),Ao.projectPoint(r,Nh),ri.set(0,0,-1).transformDirection(i.matrixWorld),ri.cross(Ao.normal),c2.subVectors(r,n),ri.dot(c2))}dispose(){const{domElement:e}=this;e.removeEventListener("mousedown",this._mouseDown),e.removeEventListener("mousemove",this._mouseMove),e.removeEventListener("mouseup",this._mouseUp)}}class bae extends mae{static get observedAttributes(){return["highlight-color",...super.observedAttributes]}get disableDragging(){return this.hasAttribute("disable-dragging")}set disableDragging(e){e?this.setAttribute("disable-dragging",!!e):this.removeAttribute("disable-dragging")}get highlightColor(){return this.getAttribute("highlight-color")||"#FFFFFF"}set highlightColor(e){e?this.setAttribute("highlight-color",e):this.removeAttribute("highlight-color")}constructor(...e){super(...e),this.highlightMaterial=new Fo({shininess:10,color:this.highlightColor,emissive:this.highlightColor,emissiveIntensity:.25});const n=a=>a.isURDFJoint&&a.jointType!=="fixed",r=(a,s)=>{const l=c=>{if(c.type==="Mesh"&&(s?(c.material=c.__origMaterial,delete c.__origMaterial):(c.__origMaterial=c.material,c.material=this.highlightMaterial)),c===a||!n(c))for(let u=0;u{this.dispatchEvent(new CustomEvent("manipulate-start",{bubbles:!0,cancelable:!0,detail:a.name})),this.controls.enabled=!1,this.redraw()},o.onDragEnd=a=>{this.dispatchEvent(new CustomEvent("manipulate-end",{bubbles:!0,cancelable:!0,detail:a.name})),this.controls.enabled=!0,this.redraw()},o.updateJoint=(a,s)=>{this.setJointValue(a.name,s)},o.onHover=a=>{r(a,!1),this.dispatchEvent(new CustomEvent("joint-mouseover",{bubbles:!0,cancelable:!0,detail:a.name})),this.redraw()},o.onUnhover=a=>{r(a,!0),this.dispatchEvent(new CustomEvent("joint-mouseout",{bubbles:!0,cancelable:!0,detail:a.name})),this.redraw()},this.dragControls=o}disconnectedCallback(){super.disconnectedCallback(),this.dragControls.dispose()}attributeChangedCallback(e,n,r){switch(super.attributeChangedCallback(e,n,r),e){case"highlight-color":this.highlightMaterial.color.set(this.highlightColor),this.highlightMaterial.emissive.set(this.highlightColor);break}}}const u2=1e3,_ae=3e4,wae=({viewerRef:t,enabled:e=!0,websocketUrl:n})=>{const{wsBaseUrl:r}=Dn(),i=n||`${r}/ws/joint-data`,o=_.useRef(null),a=_.useRef(null),s=_.useRef(u2),l=_.useRef(!1),[c,u]=_.useState(!1),d=_.useCallback(f=>{const p=t.current;!p||typeof p.setJointValue!="function"||Object.entries(f).forEach(([y,v])=>{try{p.setJointValue(y,v)}catch(g){console.warn(`Failed to set joint ${y}:`,g)}})},[t]);return _.useEffect(()=>{if(!e)return;l.current=!1;const f=()=>{if(l.current)return;let y;try{y=new WebSocket(i)}catch(v){console.error("Failed to create WebSocket:",v),p();return}o.current=y,y.onopen=()=>{u(!0),s.current=u2,a.current&&(clearTimeout(a.current),a.current=null)},y.onmessage=v=>{try{const g=JSON.parse(v.data);g.type==="joint_update"&&g.joints&&d(g.joints)}catch(g){console.error("Error parsing WebSocket message:",g)}},y.onclose=v=>{u(!1),o.current=null,!l.current&&v.code!==1e3&&p()},y.onerror=()=>{u(!1)}},p=()=>{if(a.current)return;const y=s.current;s.current=Math.min(y*2,_ae),a.current=setTimeout(()=>{a.current=null,f()},y)};return f(),()=>{l.current=!0,a.current&&(clearTimeout(a.current),a.current=null),o.current&&(o.current.close(1e3),o.current=null),u(!1)}},[e,i,d]),{isConnected:c}};var d2=["light","dark"],Sae="(prefers-color-scheme: dark)";_.createContext(void 0);_.memo(({forcedTheme:t,storageKey:e,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:o,value:a,attrs:s,nonce:l})=>{let c=o==="system",u=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${s.map(y=>`'${y}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,d=i?d2.includes(o)&&o?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${o}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",f=(y,v=!1,g=!0)=>{let m=a?a[y]:y,x=v?y+"|| ''":`'${m}'`,b="";return i&&g&&!v&&d2.includes(y)&&(b+=`d.style.colorScheme = '${y}';`),n==="class"?v||m?b+=`c.add(${x})`:b+="null":m&&(b+=`d[s](n,${x})`),b},p=t?`!function(){${u}${f(t)}}()`:r?`!function(){try{${u}var e=localStorage.getItem('${e}');if('system'===e||(!e&&${c})){var t='${Sae}',m=window.matchMedia(t);if(m.media!==t||m.matches){${f("dark")}}else{${f("light")}}}else if(e){${a?`var x=${JSON.stringify(a)};`:""}${f(a?"x[e]":"e",!0)}}${c?"":"else{"+f(o,!1,!1)+"}"}${d}}catch(e){}}()`:`!function(){try{${u}var e=localStorage.getItem('${e}');if(e){${a?`var x=${JSON.stringify(a)};`:""}${f(a?"x[e]":"e",!0)}}else{${f(o,!1,!1)};}${d}}catch(t){}}();`;return _.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:p}})});function f2(t,e){if(e===TQ)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),t;if(e===h1||e===O4){let n=t.getIndex();if(n===null){const a=[],s=t.getAttribute("position");if(s!==void 0){for(let l=0;l=2.0 are supported."));return}const c=new rse(o,{path:n||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u=0&&s[d]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+d+'".')}}c.setExtensions(a),c.setPlugins(s),c.parse(r,i)}parseAsync(e,n){const r=this;return new Promise(function(i,o){r.parse(e,n,i,o)})}}function Tae(){let t={};return{get:function(e){return t[e]},add:function(e,n){t[e]=n},remove:function(e){delete t[e]},removeAll:function(){t={}}}}const Lt={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class Mae{constructor(e){this.parser=e,this.name=Lt.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,n=this.parser.json.nodes||[];for(let r=0,i=n.length;r=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return n.loadTextureImage(e,o.source,a)}}class Bae{constructor(e){this.parser=e,this.name=Lt.EXT_TEXTURE_WEBP}loadTexture(e){const n=this.name,r=this.parser,i=r.json,o=i.textures[e];if(!o.extensions||!o.extensions[n])return null;const a=o.extensions[n],s=i.images[a.source];let l=r.textureLoader;if(s.uri){const c=r.options.manager.getHandler(s.uri);c!==null&&(l=c)}return r.loadTextureImage(e,a.source,l)}}class $ae{constructor(e){this.parser=e,this.name=Lt.EXT_TEXTURE_AVIF}loadTexture(e){const n=this.name,r=this.parser,i=r.json,o=i.textures[e];if(!o.extensions||!o.extensions[n])return null;const a=o.extensions[n],s=i.images[a.source];let l=r.textureLoader;if(s.uri){const c=r.options.manager.getHandler(s.uri);c!==null&&(l=c)}return r.loadTextureImage(e,a.source,l)}}class zae{constructor(e){this.name=Lt.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const n=this.parser.json,r=n.bufferViews[e];if(r.extensions&&r.extensions[this.name]){const i=r.extensions[this.name],o=this.parser.getDependency("buffer",i.buffer),a=this.parser.options.meshoptDecoder;if(!a||!a.supported){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return o.then(function(s){const l=i.byteOffset||0,c=i.byteLength||0,u=i.count,d=i.byteStride,f=new Uint8Array(s,l,c);return a.decodeGltfBufferAsync?a.decodeGltfBufferAsync(u,d,f,i.mode,i.filter).then(function(p){return p.buffer}):a.ready.then(function(){const p=new ArrayBuffer(u*d);return a.decodeGltfBuffer(new Uint8Array(p),u,d,f,i.mode,i.filter),p})})}else return null}}class Hae{constructor(e){this.name=Lt.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const n=this.parser.json,r=n.nodes[e];if(!r.extensions||!r.extensions[this.name]||r.mesh===void 0)return null;const i=n.meshes[r.mesh];for(const c of i.primitives)if(c.mode!==Vi.TRIANGLES&&c.mode!==Vi.TRIANGLE_STRIP&&c.mode!==Vi.TRIANGLE_FAN&&c.mode!==void 0)return null;const a=r.extensions[this.name].attributes,s=[],l={};for(const c in a)s.push(this.parser.getDependency("accessor",a[c]).then(u=>(l[c]=u,l[c])));return s.length<1?null:(s.push(this.parser.createNodeMesh(e)),Promise.all(s).then(c=>{const u=c.pop(),d=u.isGroup?u.children:[u],f=c[0].count,p=[];for(const y of d){const v=new gt,g=new ne,m=new Ii,x=new ne(1,1,1),b=new Ree(y.geometry,y.material,f);for(let S=0;S0||t.search(/^data\:image\/jpeg/)===0?"image/jpeg":t.search(/\.webp($|\?)/i)>0||t.search(/^data\:image\/webp/)===0?"image/webp":t.search(/\.ktx2($|\?)/i)>0||t.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const nse=new gt;class rse{constructor(e={},n={}){this.json=e,this.extensions={},this.plugins={},this.options=n,this.cache=new Tae,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let r=!1,i=-1,o=!1,a=-1;if(typeof navigator<"u"){const s=navigator.userAgent;r=/^((?!chrome|android).)*safari/i.test(s)===!0;const l=s.match(/Version\/(\d+)/);i=r&&l?parseInt(l[1],10):-1,o=s.indexOf("Firefox")>-1,a=o?s.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||r&&i<17||o&&a<98?this.textureLoader=new aC(this.options.manager):this.textureLoader=new Qee(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Mf(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,n){const r=this,i=this.json,o=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(a){return a._markDefs&&a._markDefs()}),Promise.all(this._invokeAll(function(a){return a.beforeRoot&&a.beforeRoot()})).then(function(){return Promise.all([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])}).then(function(a){const s={scene:a[0][i.scene||0],scenes:a[0],animations:a[1],cameras:a[2],asset:i.asset,parser:r,userData:{}};return Fl(o,s,i),Fa(s,i),Promise.all(r._invokeAll(function(l){return l.afterRoot&&l.afterRoot(s)})).then(function(){for(const l of s.scenes)l.updateMatrixWorld();e(s)})}).catch(n)}_markDefs(){const e=this.json.nodes||[],n=this.json.skins||[],r=this.json.meshes||[];for(let i=0,o=n.length;i{const l=this.associations.get(a);l!=null&&this.associations.set(s,l);for(const[c,u]of a.children.entries())o(u,s.children[c])};return o(r,i),i.name+="_instance_"+e.uses[n]++,i}_invokeOne(e){const n=Object.values(this.plugins);n.push(this);for(let r=0;r=2&&g.setY(M,E[T*l+1]),l>=3&&g.setZ(M,E[T*l+2]),l>=4&&g.setW(M,E[T*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}g.normalized=y}return g})}loadTexture(e){const n=this.json,r=this.options,o=n.textures[e].source,a=n.images[o];let s=this.textureLoader;if(a.uri){const l=r.manager.getHandler(a.uri);l!==null&&(s=l)}return this.loadTextureImage(e,o,s)}loadTextureImage(e,n,r){const i=this,o=this.json,a=o.textures[e],s=o.images[n],l=(s.uri||s.bufferView)+":"+a.sampler;if(this.textureCache[l])return this.textureCache[l];const c=this.loadImageSource(n,r).then(function(u){u.flipY=!1,u.name=a.name||s.name||"",u.name===""&&typeof s.uri=="string"&&s.uri.startsWith("data:image/")===!1&&(u.name=s.uri);const f=(o.samplers||{})[a.sampler]||{};return u.magFilter=p2[f.magFilter]||Or,u.minFilter=p2[f.minFilter]||Oo,u.wrapS=m2[f.wrapS]||ca,u.wrapT=m2[f.wrapT]||ca,u.generateMipmaps=!u.isCompressedTexture&&u.minFilter!==Xr&&u.minFilter!==Or,i.associations.set(u,{textures:e}),u}).catch(function(){return null});return this.textureCache[l]=c,c}loadImageSource(e,n){const r=this,i=this.json,o=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(d=>d.clone());const a=i.images[e],s=self.URL||self.webkitURL;let l=a.uri||"",c=!1;if(a.bufferView!==void 0)l=r.getDependency("bufferView",a.bufferView).then(function(d){c=!0;const f=new Blob([d],{type:a.mimeType});return l=s.createObjectURL(f),l});else if(a.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const u=Promise.resolve(l).then(function(d){return new Promise(function(f,p){let y=f;n.isImageBitmapLoader===!0&&(y=function(v){const g=new lr(v);g.needsUpdate=!0,f(g)}),n.load(mc.resolveURL(d,o.path),y,void 0,p)})}).then(function(d){return c===!0&&s.revokeObjectURL(l),Fa(d,a),d.userData.mimeType=a.mimeType||tse(a.uri),d}).catch(function(d){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),d});return this.sourceCache[e]=u,u}assignTexture(e,n,r,i){const o=this;return this.getDependency("texture",r.index).then(function(a){if(!a)return null;if(r.texCoord!==void 0&&r.texCoord>0&&(a=a.clone(),a.channel=r.texCoord),o.extensions[Lt.KHR_TEXTURE_TRANSFORM]){const s=r.extensions!==void 0?r.extensions[Lt.KHR_TEXTURE_TRANSFORM]:void 0;if(s){const l=o.associations.get(a);a=o.extensions[Lt.KHR_TEXTURE_TRANSFORM].extendTexture(a,s),o.associations.set(a,l)}}return i!==void 0&&(a.colorSpace=i),e[n]=a,a})}assignFinalMaterial(e){const n=e.geometry;let r=e.material;const i=n.attributes.tangent===void 0,o=n.attributes.color!==void 0,a=n.attributes.normal===void 0;if(e.isPoints){const s="PointsMaterial:"+r.uuid;let l=this.cache.get(s);l||(l=new Hu,qr.prototype.copy.call(l,r),l.color.copy(r.color),l.map=r.map,l.sizeAttenuation=!1,this.cache.add(s,l)),r=l}else if(e.isLine){const s="LineBasicMaterial:"+r.uuid;let l=this.cache.get(s);l||(l=new pc,qr.prototype.copy.call(l,r),l.color.copy(r.color),l.map=r.map,this.cache.add(s,l)),r=l}if(i||o||a){let s="ClonedMaterial:"+r.uuid+":";i&&(s+="derivative-tangents:"),o&&(s+="vertex-colors:"),a&&(s+="flat-shading:");let l=this.cache.get(s);l||(l=r.clone(),o&&(l.vertexColors=!0),a&&(l.flatShading=!0),i&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(s,l),this.associations.set(l,this.associations.get(r))),r=l}e.material=r}getMaterialType(){return oC}loadMaterial(e){const n=this,r=this.json,i=this.extensions,o=r.materials[e];let a;const s={},l=o.extensions||{},c=[];if(l[Lt.KHR_MATERIALS_UNLIT]){const d=i[Lt.KHR_MATERIALS_UNLIT];a=d.getMaterialType(),c.push(d.extendParams(s,o,n))}else{const d=o.pbrMetallicRoughness||{};if(s.color=new ft(1,1,1),s.opacity=1,Array.isArray(d.baseColorFactor)){const f=d.baseColorFactor;s.color.setRGB(f[0],f[1],f[2],Kr),s.opacity=f[3]}d.baseColorTexture!==void 0&&c.push(n.assignTexture(s,"map",d.baseColorTexture,Zt)),s.metalness=d.metallicFactor!==void 0?d.metallicFactor:1,s.roughness=d.roughnessFactor!==void 0?d.roughnessFactor:1,d.metallicRoughnessTexture!==void 0&&(c.push(n.assignTexture(s,"metalnessMap",d.metallicRoughnessTexture)),c.push(n.assignTexture(s,"roughnessMap",d.metallicRoughnessTexture))),a=this._invokeOne(function(f){return f.getMaterialType&&f.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(f){return f.extendMaterialParams&&f.extendMaterialParams(e,s)})))}o.doubleSided===!0&&(s.side=Ki);const u=o.alphaMode||Nw.OPAQUE;if(u===Nw.BLEND?(s.transparent=!0,s.depthWrite=!1):(s.transparent=!1,u===Nw.MASK&&(s.alphaTest=o.alphaCutoff!==void 0?o.alphaCutoff:.5)),o.normalTexture!==void 0&&a!==ua&&(c.push(n.assignTexture(s,"normalMap",o.normalTexture)),s.normalScale=new xt(1,1),o.normalTexture.scale!==void 0)){const d=o.normalTexture.scale;s.normalScale.set(d,d)}if(o.occlusionTexture!==void 0&&a!==ua&&(c.push(n.assignTexture(s,"aoMap",o.occlusionTexture)),o.occlusionTexture.strength!==void 0&&(s.aoMapIntensity=o.occlusionTexture.strength)),o.emissiveFactor!==void 0&&a!==ua){const d=o.emissiveFactor;s.emissive=new ft().setRGB(d[0],d[1],d[2],Kr)}return o.emissiveTexture!==void 0&&a!==ua&&c.push(n.assignTexture(s,"emissiveMap",o.emissiveTexture,Zt)),Promise.all(c).then(function(){const d=new a(s);return o.name&&(d.name=o.name),Fa(d,o),n.associations.set(d,{materials:e}),o.extensions&&Fl(i,d,o),d})}createUniqueName(e){const n=nn.sanitizeNodeName(e||"");return n in this.nodeNamesUsed?n+"_"+ ++this.nodeNamesUsed[n]:(this.nodeNamesUsed[n]=0,n)}loadGeometries(e){const n=this,r=this.extensions,i=this.primitiveCache;function o(s){return r[Lt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(s,n).then(function(l){return g2(l,s,n)})}const a=[];for(let s=0,l=e.length;s0&&Qae(m,o),m.name=n.createUniqueName(o.name||"mesh_"+e),Fa(m,o),g.extensions&&Fl(i,m,g),n.assignFinalMaterial(m),d.push(m)}for(let p=0,y=d.length;p1?u=new da:c.length===1?u=c[0]:u=new vn,u!==c[0])for(let d=0,f=c.length;d1){const d=i.associations.get(u);i.associations.set(u,{...d})}return i.associations.get(u).nodes=e,u}),this.nodeCache[e]}loadScene(e){const n=this.extensions,r=this.json.scenes[e],i=this,o=new da;r.name&&(o.name=i.createUniqueName(r.name)),Fa(o,r),r.extensions&&Fl(n,o,r);const a=r.nodes||[],s=[];for(let l=0,c=a.length;l{const d=new Map;for(const[f,p]of i.associations)(f instanceof qr||f instanceof lr)&&d.set(f,p);return u.traverse(f=>{const p=i.associations.get(f);p!=null&&d.set(f,p)}),d};return i.associations=c(o),o})}_createAnimationTracks(e,n,r,i,o){const a=[],s=e.name?e.name:e.uuid,l=[];Ms[o.path]===Ms.weights?e.traverse(function(f){f.morphTargetInfluences&&l.push(f.name?f.name:f.uuid)}):l.push(s);let c;switch(Ms[o.path]){case Ms.weights:c=zd;break;case Ms.rotation:c=Ic;break;case Ms.translation:case Ms.scale:c=pl;break;default:switch(r.itemSize){case 1:c=zd;break;case 2:case 3:default:c=pl;break}break}const u=i.interpolation!==void 0?Yae[i.interpolation]:Pp,d=this._getArrayFromAccessor(r);for(let f=0,p=l.length;f0?o[o.length-1]:"",smooth:a!==void 0?a.smooth:this.smooth,groupStart:a!==void 0?a.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(l){const c={index:typeof l=="number"?l:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return c.clone=this.clone.bind(c),c}};return this.materials.push(s),s},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(i){const o=this.currentMaterial();if(o&&o.groupEnd===-1&&(o.groupEnd=this.geometry.vertices.length/3,o.groupCount=o.groupEnd-o.groupStart,o.inherited=!1),i&&this.materials.length>1)for(let a=this.materials.length-1;a>=0;a--)this.materials[a].groupCount<=0&&this.materials.splice(a,1);return i&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),o}},r&&r.name&&typeof r.clone=="function"){const i=r.clone(0);i.inherited=!0,this.object.materials.push(i)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(e,n){const r=parseInt(e,10);return(r>=0?r-1:r+n/3)*3},parseNormalIndex:function(e,n){const r=parseInt(e,10);return(r>=0?r-1:r+n/3)*3},parseUVIndex:function(e,n){const r=parseInt(e,10);return(r>=0?r-1:r+n/2)*2},addVertex:function(e,n,r){const i=this.vertices,o=this.object.geometry.vertices;o.push(i[e+0],i[e+1],i[e+2]),o.push(i[n+0],i[n+1],i[n+2]),o.push(i[r+0],i[r+1],i[r+2])},addVertexPoint:function(e){const n=this.vertices;this.object.geometry.vertices.push(n[e+0],n[e+1],n[e+2])},addVertexLine:function(e){const n=this.vertices;this.object.geometry.vertices.push(n[e+0],n[e+1],n[e+2])},addNormal:function(e,n,r){const i=this.normals,o=this.object.geometry.normals;o.push(i[e+0],i[e+1],i[e+2]),o.push(i[n+0],i[n+1],i[n+2]),o.push(i[r+0],i[r+1],i[r+2])},addFaceNormal:function(e,n,r){const i=this.vertices,o=this.object.geometry.normals;y2.fromArray(i,e),Iw.fromArray(i,n),x2.fromArray(i,r),Bi.subVectors(x2,Iw),b2.subVectors(y2,Iw),Bi.cross(b2),Bi.normalize(),o.push(Bi.x,Bi.y,Bi.z),o.push(Bi.x,Bi.y,Bi.z),o.push(Bi.x,Bi.y,Bi.z)},addColor:function(e,n,r){const i=this.colors,o=this.object.geometry.colors;i[e]!==void 0&&o.push(i[e+0],i[e+1],i[e+2]),i[n]!==void 0&&o.push(i[n+0],i[n+1],i[n+2]),i[r]!==void 0&&o.push(i[r+0],i[r+1],i[r+2])},addUV:function(e,n,r){const i=this.uvs,o=this.object.geometry.uvs;o.push(i[e+0],i[e+1]),o.push(i[n+0],i[n+1]),o.push(i[r+0],i[r+1])},addDefaultUV:function(){const e=this.object.geometry.uvs;e.push(0,0),e.push(0,0),e.push(0,0)},addUVLine:function(e){const n=this.uvs;this.object.geometry.uvs.push(n[e+0],n[e+1])},addFace:function(e,n,r,i,o,a,s,l,c){const u=this.vertices.length;let d=this.parseVertexIndex(e,u),f=this.parseVertexIndex(n,u),p=this.parseVertexIndex(r,u);if(this.addVertex(d,f,p),this.addColor(d,f,p),s!==void 0&&s!==""){const y=this.normals.length;d=this.parseNormalIndex(s,y),f=this.parseNormalIndex(l,y),p=this.parseNormalIndex(c,y),this.addNormal(d,f,p)}else this.addFaceNormal(d,f,p);if(i!==void 0&&i!==""){const y=this.uvs.length;d=this.parseUVIndex(i,y),f=this.parseUVIndex(o,y),p=this.parseUVIndex(a,y),this.addUV(d,f,p),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(e){this.object.geometry.type="Points";const n=this.vertices.length;for(let r=0,i=e.length;r=7?(av.setRGB(parseFloat(d[4]),parseFloat(d[5]),parseFloat(d[6]),Zt),n.colors.push(av.r,av.g,av.b)):n.colors.push(void 0,void 0,void 0);break;case"vn":n.normals.push(parseFloat(d[1]),parseFloat(d[2]),parseFloat(d[3]));break;case"vt":n.uvs.push(parseFloat(d[1]),parseFloat(d[2]));break}}else if(u==="f"){const f=c.slice(1).trim().split(v2),p=[];for(let v=0,g=f.length;v0){const x=m.split("/");p.push(x)}}const y=p[0];for(let v=1,g=p.length-1;v1){const f=i[1].trim().toLowerCase();n.object.smooth=f!=="0"&&f!=="off"}else n.object.smooth=!0;const d=n.object.currentMaterial();d&&(d.smooth=n.object.smooth)}else{if(c==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+c+'"')}}n.finalize();const o=new da;if(o.materialLibraries=[].concat(n.materialLibraries),!(n.objects.length===1&&n.objects[0].geometry.vertices.length===0)===!0)for(let s=0,l=n.objects.length;s0&&v.setAttribute("normal",new Qt(u.normals,3)),u.colors.length>0&&(y=!0,v.setAttribute("color",new Qt(u.colors,3))),u.hasUVIndices===!0&&v.setAttribute("uv",new Qt(u.uvs,2));const g=[];for(let x=0,b=d.length;x1){for(let x=0,b=d.length;x0){const s=new Hu({size:1,sizeAttenuation:!1}),l=new br;l.setAttribute("position",new Qt(n.vertices,3)),n.colors.length>0&&n.colors[0]!==void 0&&(l.setAttribute("color",new Qt(n.colors,3)),s.vertexColors=!0);const c=new Xv(l,s);o.add(c)}return o}}const dse=(t,e,n)=>{var i;let r=(i=t.split(/\./g).pop())==null?void 0:i.toLowerCase();if(t.startsWith("blob:")&&t.includes("#.")){const o=t.split("#.").pop();o&&(r=o.toLowerCase())}if(!r){console.error(`Could not determine file extension for: ${t}`),n(null,new Error(`Unsupported file format: ${t}`));return}switch(r){case"gltf":case"glb":new Eae(e).load(t,o=>n(o.scene),void 0,o=>n(null,o));break;case"obj":new use(e).load(t,o=>n(o),()=>{},o=>n(null,o));break;case"dae":new a$(e).load(t,o=>n(o.scene),void 0,o=>n(null,o));break;case"stl":new o$(e).load(t,o=>{const a=new Fo,s=new Tn(o,a);n(s)},o=>{},o=>{console.error(`โŒ STL loading failed: ${t}`,o);const a=new Gc(.05,.05,.05),s=new Fo({color:16739125,transparent:!0,opacity:.7}),l=new Tn(a,s);n(l)});break;default:n(null,new Error(`Unsupported file format: ${r}`))}};function fse(t,e){t.innerHTML="";const n=document.createElement("urdf-viewer");n.classList.add("w-full","h-full"),t.appendChild(n),n.setAttribute("up","Z"),gse(n,"#2c2b3a"),n.setAttribute("highlight-color","#df6dd4"),n.setAttribute("auto-redraw","true");const r=new J4(14079702,1);n.scene.add(r);const i=new zx(16777215,.8);return i.position.set(5,30,5),i.castShadow=!0,n.scene.add(i),n}function hse(t,e){"loadMeshFunc"in t&&(t.loadMeshFunc=(n,r,i)=>{const o=e?e(n):n;try{dse(o,r,(a,s)=>{s?(console.warn(`Error loading mesh ${o}:`,s),i(null)):i(a)})}catch(a){console.error(`Exception loading mesh ${o}:`,a),i(null,a)}})}function pse(t,e){const n=i=>{e(i.detail)},r=()=>{e(null)};return t.addEventListener("joint-mouseover",n),t.addEventListener("joint-mouseout",r),()=>{t.removeEventListener("joint-mouseover",n),t.removeEventListener("joint-mouseout",r)}}function mse(t,e,n,r,i=[]){const o=e.startsWith("blob:")&&!e.includes("#.")?e+"#.urdf":e;t.setAttribute("urdf",o),t.setAttribute("package",n);const a=()=>{if(i.length>0){const s=i[0];s&&(r(s),Ur.info("Trying alternative model...",{description:`First model failed to load. Trying ${s.split("/").pop()||"alternative model"}`,duration:2e3}))}};return t.addEventListener("error",a),()=>{t.removeEventListener("error",a)}}function gse(t,e){const n=t.parentElement;n&&(n.style.backgroundColor=e)}typeof window<"u"&&!customElements.get("urdf-viewer")&&customElements.define("urdf-viewer",bae);const vse=()=>{const t=_.useRef(null),[e,n]=_.useState(null),{registerUrdfProcessor:r,alternativeUrdfModels:i,isDefaultModel:o}=lU(),a=_.useRef(null),s=_.useRef(null),l=_.useRef(!1),{isConnected:c}=wae({viewerRef:s,enabled:o}),[u,d]=_.useState(null),[f,p]=_.useState(null),y=_.useRef(""),v=_.useMemo(()=>({loadUrdf:m=>{d(m)},setUrlModifierFunc:m=>{p(()=>m)},getPackage:()=>y.current}),[]);_.useEffect(()=>{r(v)},[r,v]);const g=_.useCallback(m=>m.startsWith("package://so_arm_description/meshes/")?m.replace("package://so_arm_description/meshes/","/so-101-urdf/meshes/"):m.includes("so_arm_description/meshes/")?m.replace(/.*so_arm_description\/meshes\//,"/so-101-urdf/meshes/"):m.includes("/so-101-urdf/so_arm_description/meshes/")?m.replace("/so-101-urdf/so_arm_description/meshes/","/so-101-urdf/meshes/"):m.endsWith(".stl")&&!m.startsWith("/")&&!m.startsWith("http")?`/so-101-urdf/meshes/${m}`:m,[]);return _.useEffect(()=>{if(!t.current)return;const m=fse(t.current);s.current=m,hse(m,o?g:f);const b=o?"/so-101-urdf/urdf/so101_new_calib.urdf":u||"";o&&(y.current="/");let S=()=>{};b&&(S=mse(m,b,y.current,d,i));const w=pse(m,n),E=M=>{if(!(!M||!M.robot))try{const C=new Wo().setFromObject(M.robot),P=new ne;C.getCenter(P);const R=new ne;C.getSize(R);const D=Math.max(R.x,R.y,R.z);M.camera.position.copy(P);const k=new ne;M.up==="+Z"||M.up==="Z"||M.up==="+Y"||M.up,k.set(1,1,1),k.normalize().multiplyScalar(D*1.3),M.camera.position.add(k),M.controls.target.copy(P),M.controls.update(),M.redraw()}catch(C){console.error("[RobotViewer] Error fitting robot to view:",C)}},T=()=>{E(m)},A=()=>{l.current=!0,"setJointValue"in m&&a.current&&(a.current(),a.current=null),T()};return m.addEventListener("urdf-processed",A),()=>{a.current&&(a.current(),a.current=null),l.current=!1,w(),S(),m.removeEventListener("urdf-processed",A)}},[o,u,f,g,i]),h.jsxs("div",{className:He("w-full h-full transition-all duration-300 ease-in-out relative","bg-gradient-to-br from-gray-900 to-gray-800"),children:[h.jsx("div",{ref:t,className:"w-full h-full"}),e&&h.jsxs("div",{className:"absolute bottom-4 right-4 bg-black/70 text-white px-3 py-2 rounded-md text-sm font-mono z-10",children:["Joint: ",e]}),o&&h.jsx("div",{className:"absolute top-4 right-4 z-10",children:h.jsxs("div",{className:`flex items-center gap-2 px-3 py-2 rounded-md text-sm font-mono ${c?"bg-green-900/70 text-green-300":"bg-red-900/70 text-red-300"}`,children:[h.jsx("div",{className:`w-2 h-2 rounded-full ${c?"bg-green-400":"bg-red-400"}`}),c?"Live Robot Data":"Disconnected"]})})]})},yse=_.memo(vse),Gx=({className:t,iconOnly:e=!1})=>h.jsxs("div",{className:He("flex items-center gap-2",t),children:[h.jsx("img",{src:"/lovable-uploads/5e648747-34b7-4d8f-93fd-4dbd00aeeefc.png",alt:"LeLab Logo",className:"h-8 w-8"}),!e&&h.jsx("span",{className:"font-bold text-white text-2xl",children:"LeLab"})]}),xse=({onGoBack:t,className:e})=>h.jsx("div",{className:He("w-full p-2 sm:p-4 space-y-4 lg:space-y-0 lg:space-x-4 flex flex-col lg:flex-row",e),children:h.jsxs("div",{className:"bg-gray-900 rounded-lg p-4 flex-1 flex flex-col",children:[h.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[h.jsx(et,{variant:"ghost",size:"icon",onClick:t,className:"text-gray-400 hover:text-white hover:bg-gray-800 flex-shrink-0",children:h.jsx(ll,{className:"h-5 w-5"})}),h.jsx(Gx,{iconOnly:!0}),h.jsx("div",{className:"w-px h-6 bg-gray-700"}),h.jsx("h2",{className:"text-xl font-medium text-gray-200",children:"Teleoperation"})]}),h.jsx("div",{className:"flex-1 bg-black rounded border border-gray-800 min-h-[50vh] lg:min-h-0",children:h.jsx(yse,{})})]})}),bse=()=>{const t=ji(),{toast:e}=Dr(),{baseUrl:n,fetchWithHeaders:r}=Dn(),i=async()=>{try{const o=await r(`${n}/stop-teleoperation`,{method:"POST"});if(o.ok){const a=await o.json();a.message,e({title:"Teleoperation Stopped",description:a.message||"Robot teleoperation has been stopped successfully."})}else{const a=await o.text();console.warn("โš ๏ธ Failed to stop teleoperation:",o.status,a),e({title:"Warning",description:`Failed to stop teleoperation properly. Status: ${o.status}`,variant:"destructive"})}}catch(o){console.error("โŒ Error stopping teleoperation:",o),e({title:"Error",description:"Failed to communicate with the robot server.",variant:"destructive"})}finally{t("/")}};return h.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center p-2 sm:p-4",children:h.jsx("div",{className:"w-full h-[95vh] flex",children:h.jsx(xse,{onGoBack:i,className:"lg:w-full"})})})},_se=Em("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function w1({className:t,variant:e,...n}){return h.jsx("div",{className:He(_se({variant:e}),t),...n})}var wse="Separator",_2="horizontal",Sse=["horizontal","vertical"],d$=_.forwardRef((t,e)=>{const{decorative:n,orientation:r=_2,...i}=t,o=Ese(r)?r:_2,s=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return h.jsx(nt.div,{"data-orientation":o,...s,...i,ref:e})});d$.displayName=wse;function Ese(t){return Sse.includes(t)}var f$=d$;const Jl=_.forwardRef(({className:t,orientation:e="horizontal",decorative:n=!0,...r},i)=>h.jsx(f$,{ref:i,decorative:n,orientation:e,className:He("shrink-0 bg-border",e==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...r}));Jl.displayName=f$.displayName;const Tse=({onClick:t,robotType:e,className:n=""})=>h.jsxs(et,{type:"button",onClick:t,variant:"outline",size:"sm",className:` + h-8 px-2 + border-gray-600 hover:border-blue-500 + text-gray-400 hover:text-blue-400 + bg-gray-800 hover:bg-gray-700 + transition-all duration-200 + ${n} + `,title:`Find ${e||"robot"} port automatically`,children:[h.jsx(oA,{className:"w-3 h-3 mr-1"}),"Find"]}),Mse=2e3,Ase=({open:t,onOpenChange:e,robotType:n,onPortDetected:r})=>{const[i,o]=_.useState("detecting"),[a,s]=_.useState(""),[l,c]=_.useState(""),u=_.useRef(!1),d=_.useRef(null),f=_.useRef(null),{toast:p}=Dr(),{baseUrl:y,fetchWithHeaders:v}=Dn(),g=async()=>{try{d.current=new AbortController;const E=await(await v(`${y}/start-port-detection`,{method:"POST",body:JSON.stringify({robot_type:n}),signal:d.current.signal})).json();if(u.current)return;if(E.status!=="success")throw new Error(E.message||"Failed to start port detection");const T=E.data.ports_before;for(;!u.current;){d.current=new AbortController;const M=await(await v(`${y}/detect-port-after-disconnect`,{method:"POST",body:JSON.stringify({ports_before:T}),signal:d.current.signal})).json();if(u.current)return;if(M.status==="success"){if(s(M.port),await m(M.port),u.current)return;o("success"),p({title:"Port Detected Successfully",description:`${n} port detected: ${M.port}`}),f.current=window.setTimeout(()=>{u.current||(r(M.port),e(!1))},Mse);return}const C=typeof M.message=="string"?M.message:"";if(!C.includes("Timed out"))throw new Error(C||"Failed to detect port")}}catch(w){if(u.current||w instanceof DOMException&&w.name==="AbortError")return;console.error("Port detection failed:",w),c(w instanceof Error?w.message:"Unknown error"),o("error")}},m=async w=>{try{await v(`${y}/save-robot-port`,{method:"POST",body:JSON.stringify({robot_type:n,port:w})})}catch(E){console.error("Error saving port:",E)}};_.useEffect(()=>{if(t)return u.current=!1,o("detecting"),c(""),s(""),g(),()=>{var w;u.current=!0,(w=d.current)==null||w.abort(),f.current!==null&&(window.clearTimeout(f.current),f.current=null)}},[t]);const x=()=>{e(!1)},b=()=>{var w;u.current=!1,(w=d.current)==null||w.abort(),o("detecting"),c(""),s(""),g()},S=()=>{switch(i){case"detecting":return h.jsxs("div",{className:"space-y-6 text-center",children:[h.jsx(fi,{className:"w-16 h-16 text-blue-500 mx-auto animate-spin"}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs("h3",{className:"text-lg font-semibold text-white",children:["Unplug the ",n," arm"]}),h.jsxs("p",{className:"text-gray-400",children:["Disconnect the ",n," robot arm from USB. The port will be detected automatically."]})]}),h.jsx("div",{className:"flex justify-center",children:h.jsx(et,{onClick:x,variant:"outline",className:"border-gray-500 hover:border-gray-200 text-gray-300 hover:text-white px-8 py-2",children:"Cancel"})})]});case"success":return h.jsxs("div",{className:"space-y-6 text-center",children:[h.jsx(qi,{className:"w-16 h-16 text-green-500 mx-auto"}),h.jsxs("div",{className:"space-y-2",children:[h.jsx("h3",{className:"text-lg font-semibold text-white",children:"Port Detected"}),h.jsx("p",{className:"text-xl font-mono text-green-400 bg-gray-800 px-4 py-2 rounded inline-block",children:a})]})]});case"error":return h.jsxs("div",{className:"space-y-6 text-center",children:[h.jsx(td,{className:"w-16 h-16 text-red-500 mx-auto"}),h.jsxs("div",{className:"space-y-2",children:[h.jsx("h3",{className:"text-lg font-semibold text-white",children:"Detection Failed"}),h.jsx("div",{className:"bg-red-900/20 border border-red-800 rounded-lg p-3",children:h.jsx("p",{className:"text-red-400 text-sm",children:l})})]}),h.jsxs("div",{className:"flex gap-4 justify-center",children:[h.jsx(et,{onClick:b,className:"bg-blue-500 hover:bg-blue-600 text-white px-8 py-2",children:"Try Again"}),h.jsx(et,{onClick:x,variant:"outline",className:"border-gray-500 hover:border-gray-200 text-gray-300 hover:text-white px-8 py-2",children:"Cancel"})]})]});default:return null}};return h.jsx(Hc,{open:t,onOpenChange:e,children:h.jsxs(bl,{className:"bg-gray-900 border-gray-800 text-white sm:max-w-[500px] p-8",children:[h.jsxs(_l,{children:[h.jsx(wl,{className:"text-white text-center text-xl font-bold",children:"Port Detection"}),h.jsxs(Sl,{className:"text-gray-400 text-center",children:["Detect the USB port for your ",n," arm"]})]}),h.jsx("div",{className:"py-4",children:S()})]})})},Cse={shoulder_pan:2400,shoulder_lift:2300,elbow_flex:2150,wrist_flex:2250,wrist_roll:3700,gripper:1150},Pse={shoulder_pan:2400,shoulder_lift:2300,elbow_flex:2150,wrist_flex:2250,wrist_roll:3700,gripper:1400},Rse={teleop:Cse,robot:Pse},Nse=.98;function w2(t,e,n){var i;if(!t)return!1;const r=(i=Rse[t])==null?void 0:i[e];return r?n>=r*Nse:!1}const S2="Motor discontinuity detected",Ose=()=>{var X;const t=ji(),n=((X=yl().state)==null?void 0:X.robot_name)??null,{toast:r}=Dr(),{baseUrl:i,fetchWithHeaders:o}=Dn();_.useRef(null);const a=_.useRef(null),[s,l]=_.useState("teleop"),[c,u]=_.useState(""),[d,f]=_.useState(null),[p,y]=_.useState([]),v=_.useRef(null),g=_.useCallback(async()=>{if(!n)return null;try{const K=await o(`${i}/robots/${encodeURIComponent(n)}`);if(!K.ok)return null;const Y=(await K.json()).robot??null;return f(Y),Y}catch(K){return console.error("Failed to load robot record:",K),null}},[n,i,o]);_.useEffect(()=>{if(!n)return;let K=!1;return(async()=>{const F=await g();if(!F||K)return;const Y=F.leader_config?F.follower_config?"teleop":"robot":"teleop";l(Y),u(Y==="teleop"?F.leader_port||"":F.follower_port||""),y(F.cameras??[])})(),()=>{K=!0}},[n,g]);const m=K=>{y(K),n&&(v.current&&clearTimeout(v.current),v.current=setTimeout(async()=>{try{await o(`${i}/robots/${encodeURIComponent(n)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cameras:K})})}catch(F){console.error("Failed to save cameras to robot record:",F)}},500))};_.useEffect(()=>()=>{v.current&&clearTimeout(v.current)},[]);const[x,b]=_.useState(!1),[S,w]=_.useState("leader"),[E,T]=_.useState({calibration_active:!1,status:"idle",device_type:null,error:null,message:"",step:0,total_steps:1,current_positions:null,recorded_ranges:null}),[A,M]=_.useState(!1),C=_.useRef(!1);_.useEffect(()=>{C.current=E.calibration_active},[E.calibration_active]),_.useEffect(()=>()=>{C.current&&o(`${i}/stop-calibration`,{method:"POST"}).catch(K=>console.error("Failed to stop calibration on unmount:",K))},[i,o]);const P=async()=>{try{const K=await o(`${i}/calibration-status`);if(K.ok){const F=await K.json();T(F),!F.calibration_active&&(F.status==="completed"||F.status==="error"||F.status==="idle")&&M(!1)}}catch(K){console.error("Error polling status:",K)}},R=async()=>{if(!n){r({title:"No robot selected",description:"Open Calibration from a robot's gear icon on the Landing page.",variant:"destructive"});return}if(!c){r({title:"Missing port",description:"Set the device's serial port before starting.",variant:"destructive"});return}const K={device_type:s,port:c,config_file:n,robot_name:n};C.current=!0;try{const Y=await(await o(`${i}/start-calibration`,{method:"POST",body:JSON.stringify(K)})).json();Y.success?(r({title:"Calibration Started",description:`Calibration started for ${s}`}),M(!0)):(C.current=!1,r({title:"Calibration Failed",description:Y.message||"Failed to start calibration",variant:"destructive"}))}catch(F){C.current=!1,console.error("Error starting calibration:",F),r({title:"Error",description:"Failed to start calibration",variant:"destructive"})}},D=async()=>{try{const F=await(await o(`${i}/stop-calibration`,{method:"POST"})).json();F.success?r({title:"Calibration Stopped",description:"Calibration has been stopped"}):r({title:"Error",description:F.message||"Failed to stop calibration",variant:"destructive"})}catch(K){console.error("Error stopping calibration:",K),r({title:"Error",description:"Failed to stop calibration",variant:"destructive"})}},k=async()=>{if(E.calibration_active)try{const F=await(await o(`${i}/complete-calibration-step`,{method:"POST"})).json();F.success?r({title:"Step Completed",description:F.message}):r({title:"Step Failed",description:F.message||"Could not complete step",variant:"destructive"})}catch(K){console.error("Error completing step:",K),r({title:"Error",description:"Could not complete calibration step",variant:"destructive"})}};_.useEffect(()=>{var K,F;E.status==="error"&&((K=E.error)!=null&&K.startsWith(S2))&&((F=a.current)==null||F.scrollIntoView({behavior:"smooth",block:"center"}))},[E.status,E.error]),_.useEffect(()=>{if(!A)return;P();const K=setInterval(()=>{P()},200);return()=>clearInterval(K)},[A]),_.useEffect(()=>{(async()=>{if(s&&!n)try{const q=await(await o(`${i}/robot-port/${s==="robot"?"follower":"leader"}`)).json();if(q.status==="success"){const ee=q.saved_port||q.default_port;ee&&u(ee)}}catch(F){console.error("Error loading default port:",F)}})()},[s,n,i,o]);const U=K=>{l(K),d&&u(K==="teleop"?d.leader_port||"":d.follower_port||"")};_.useEffect(()=>{E.status==="completed"&&(async()=>{const K=await g();if(!K)return;const F=K.leader_config?K.follower_config?"teleop":"robot":"teleop";l(F),u(F==="teleop"?K.leader_port||"":K.follower_port||"")})()},[E.status,g]);const O=()=>{w(s==="robot"?"follower":"leader"),b(!0)},W=K=>{u(K)},j=(()=>{switch(E.status){case"idle":return{color:"bg-slate-500",icon:h.jsx(Mh,{className:"w-4 h-4"}),text:"Idle"};case"connecting":return{color:"bg-yellow-500",icon:h.jsx(fi,{className:"w-4 h-4 animate-spin"}),text:"Connecting"};case"recording":return{color:"bg-purple-500",icon:h.jsx($u,{className:"w-4 h-4"}),text:"Recording Ranges"};case"completed":return{color:"bg-green-500",icon:h.jsx(qi,{className:"w-4 h-4"}),text:"Completed"};case"error":return{color:"bg-red-500",icon:h.jsx(nd,{className:"w-4 h-4"}),text:"Error"};case"stopping":return{color:"bg-orange-500",icon:h.jsx(Od,{className:"w-4 h-4"}),text:"Stopping"};default:return{color:"bg-slate-500",icon:h.jsx(Mh,{className:"w-4 h-4"}),text:"Unknown"}}})();return h.jsxs("div",{className:"min-h-screen bg-slate-900 text-white p-4",children:[h.jsxs("div",{className:"max-w-4xl mx-auto",children:[h.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[h.jsx(et,{variant:"ghost",size:"icon",onClick:()=>t(-1),className:"text-slate-400 hover:text-white hover:bg-slate-800",children:h.jsx(ll,{className:"w-5 h-5"})}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx(Gx,{iconOnly:!0}),h.jsx("h1",{className:"text-3xl font-bold",children:n?`Calibrate "${n}"`:"Device Calibration"})]})]}),!n&&h.jsxs(Mi,{className:"mb-6 bg-amber-900/40 border-amber-700 text-amber-100",children:[h.jsx(td,{className:"h-4 w-4"}),h.jsx(Ai,{children:"Open Calibration from a robot's gear icon on the Landing page. Each robot has its own calibration; running this page directly is not supported."})]}),h.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[h.jsxs(Gr,{className:"bg-slate-800/60 border-slate-700 backdrop-blur-sm",children:[h.jsx(jo,{children:h.jsxs(ga,{className:"flex items-center gap-2 text-slate-200",children:[h.jsx(Mh,{className:"w-5 h-5 text-blue-400"}),"Configuration"]})}),h.jsxs(Wr,{className:"space-y-6",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(Tt,{htmlFor:"deviceType",className:"text-sm font-medium text-slate-300",children:"Device Type *"}),h.jsxs(Ga,{value:s,onValueChange:U,children:[h.jsx(sa,{className:"bg-slate-700 border-slate-600 text-white rounded-md",children:h.jsx(Wa,{placeholder:"Select device type"})}),h.jsxs(la,{className:"bg-slate-800 border-slate-700 text-white",children:[h.jsx($n,{value:"teleop",className:"hover:bg-slate-700",children:"Teleoperator (Leader)"}),h.jsx($n,{value:"robot",className:"hover:bg-slate-700",children:"Robot (Follower)"})]})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(Tt,{htmlFor:"port",className:"text-sm font-medium text-slate-300",children:"Port *"}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx(hi,{id:"port",value:c,onChange:K=>u(K.target.value),placeholder:"/dev/tty.usbmodem...",className:"bg-slate-700 border-slate-600 text-white rounded-md flex-1"}),h.jsx(Tse,{onClick:O,robotType:s==="robot"?"follower":"leader",className:"border-slate-600 hover:border-blue-500 text-slate-400 hover:text-blue-400 bg-slate-700 hover:bg-slate-600"})]})]}),h.jsx(Jl,{className:"bg-slate-700"}),h.jsx("div",{className:"flex flex-col gap-3",children:E.calibration_active?h.jsxs(et,{onClick:D,variant:"destructive",className:"w-full rounded-full py-6 text-lg",children:[h.jsx(Od,{className:"w-5 h-5 mr-2"}),"Cancel Calibration"]}):h.jsxs(et,{onClick:R,className:"w-full bg-blue-600 hover:bg-blue-700 text-white rounded-full py-6 text-lg",disabled:!n||!s||!c,children:[h.jsx(Tc,{className:"w-5 h-5 mr-2"}),"Start Calibration"]})}),d&&h.jsxs("div",{className:"space-y-2 pt-2",children:[h.jsx("div",{className:"text-sm font-medium text-slate-300",children:"Robot calibration"}),h.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[d.leader_config?h.jsx(qi,{className:"w-4 h-4 text-green-400"}):h.jsx(fE,{className:"w-4 h-4 text-slate-500"}),h.jsx("span",{className:d.leader_config?"text-slate-200":"text-slate-400",children:"Leader (Teleoperator)"})]}),h.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[d.follower_config?h.jsx(qi,{className:"w-4 h-4 text-green-400"}):h.jsx(fE,{className:"w-4 h-4 text-slate-500"}),h.jsx("span",{className:d.follower_config?"text-slate-200":"text-slate-400",children:"Follower (Robot)"})]})]})]})]}),h.jsxs(Gr,{className:"bg-slate-800/60 border-slate-700 backdrop-blur-sm",children:[h.jsx(jo,{children:h.jsxs(ga,{className:"flex items-center gap-2 text-slate-200",children:[h.jsx($u,{className:"w-5 h-5 text-teal-400"}),"Status"]})}),h.jsxs(Wr,{className:"space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between p-3 bg-slate-900/50 rounded-md",children:[h.jsx("span",{className:"text-slate-300",children:"Status:"}),h.jsxs(w1,{className:`${j.color} text-white rounded-md`,children:[j.icon,h.jsx("span",{className:"ml-2",children:j.text})]})]}),E.status==="recording"&&E.recorded_ranges&&h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx($u,{className:"w-4 h-4 text-purple-400"}),h.jsx("span",{className:"text-sm font-medium text-slate-300",children:"Live Position Data"})]}),h.jsx("div",{className:"bg-slate-800 rounded-lg p-4 border border-slate-700",children:h.jsx("div",{className:"space-y-3",children:Object.entries(E.recorded_ranges).map(([K,F])=>{const Y=F.max-F.min,q=F.current-F.min,ee=Y>0?q/Y*100:50,te=w2(E.device_type,K,Y);return h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-white font-semibold text-sm",children:K}),te&&h.jsx(qi,{className:"w-4 h-4 text-green-400","aria-label":"Range complete"})]}),h.jsx("span",{className:"text-slate-300 text-xs font-mono",children:F.current})]}),h.jsxs("div",{className:"relative",children:[h.jsx("div",{className:"w-full bg-slate-700 rounded-full h-3",children:h.jsx("div",{className:"bg-slate-600 h-3 rounded-full relative",style:{width:"100%"},children:h.jsx("div",{className:`absolute top-0 w-1 h-3 rounded-full transition-all duration-100 ${te?"bg-green-400":"bg-yellow-400"}`,style:{left:`${Math.max(0,Math.min(100,ee))}%`,transform:"translateX(-50%)"}})})}),h.jsxs("div",{className:"flex justify-between text-xs text-slate-400 mt-1",children:[h.jsx("span",{children:F.min}),h.jsx("span",{children:F.max})]})]})]},K)})})})]}),E.status==="connecting"&&h.jsxs(Mi,{className:"bg-yellow-900/50 border-yellow-700 text-yellow-200",children:[h.jsx(td,{className:"h-4 w-4"}),h.jsx(Ai,{children:"Connecting to the device. Please ensure it's connected."})]}),E.status==="recording"&&(()=>{const K=E.recorded_ranges??{},F=Object.entries(K),Y=F.length>0&&F.every(([q,ee])=>w2(E.device_type,q,ee.max-ee.min));return h.jsxs("div",{className:"space-y-3",children:[h.jsx("div",{className:"flex justify-center",children:h.jsxs(et,{onClick:k,disabled:!E.calibration_active,className:`px-8 py-3 rounded-full transition-colors ${Y?"bg-green-600 hover:bg-green-700":"bg-orange-500 hover:bg-orange-600"}`,children:[Y?h.jsx(qi,{className:"w-4 h-4 mr-2"}):h.jsx(td,{className:"w-4 h-4 mr-2"}),"Save Calibration"]})}),h.jsxs(Mi,{className:"bg-purple-900/50 border-purple-700 text-purple-200",children:[h.jsx($u,{className:"h-4 w-4"}),h.jsxs(Ai,{children:[h.jsx("strong",{children:"Important:"})," Move EACH joint through its full range. A check appears next to each joint once its range is wide enough."]})]})]})})(),E.status==="completed"&&h.jsxs(Mi,{className:"bg-green-900/50 border-green-700 text-green-200",children:[h.jsx(qi,{className:"h-4 w-4"}),h.jsx(Ai,{children:"Calibration completed successfully!"})]}),E.status==="error"&&E.error&&(E.error.startsWith(S2)?h.jsxs(Mi,{className:"bg-red-900/50 border-red-700 text-red-200",children:[h.jsx(nd,{className:"h-4 w-4"}),h.jsxs(Ai,{children:[h.jsx("div",{className:"font-semibold text-base mb-1",children:"Motor discontinuity detected"}),h.jsx("div",{children:"Make sure to start the calibration with the robot in a middle position โ€” all joints in the middle of their ranges. See the calibration demo below for the correct starting pose."})]})]}):h.jsxs(Mi,{className:"bg-red-900/50 border-red-700 text-red-200",children:[h.jsx(nd,{className:"h-4 w-4"}),h.jsxs(Ai,{children:[h.jsx("strong",{children:"Error:"})," ",E.error]})]})),h.jsxs("div",{ref:a,className:"bg-slate-900/50 p-4 rounded-lg border border-slate-700",children:[h.jsx("h4",{className:"font-semibold mb-3 text-slate-200",children:"Calibration Demo:"}),h.jsx("div",{className:"relative rounded-lg overflow-hidden bg-slate-800",children:h.jsxs("video",{className:"w-full h-auto rounded-md",controls:!0,preload:"auto",muted:!0,children:[h.jsx("source",{src:"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/lerobot/calibrate_so101_2.mp4",type:"video/mp4"}),h.jsxs("p",{className:"text-slate-400 text-sm text-center py-4",children:["Your browser does not support the video tag.",h.jsx("br",{}),h.jsx("a",{href:"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/lerobot/calibrate_so101_2.mp4",className:"text-blue-400 hover:text-blue-300 underline",target:"_blank",rel:"noopener noreferrer",children:"Click here to view the calibration video"})]})]})})]})]})]})]}),n&&h.jsxs(Gr,{className:"bg-slate-800/60 border-slate-700 backdrop-blur-sm mt-6",children:[h.jsx(jo,{children:h.jsxs(ga,{className:"flex items-center gap-2 text-slate-200",children:[h.jsx(Mh,{className:"w-5 h-5 text-blue-400"}),"Attached cameras"]})}),h.jsx(Wr,{children:h.jsx(g4,{cameras:p,onCamerasChange:m})})]})]}),h.jsx(Ase,{open:x,onOpenChange:b,robotType:S,onPortDetected:W})]})};var Dw="rovingFocusGroup.onEntryFocus",Ise={bubbles:!1,cancelable:!0},km="RovingFocusGroup",[S1,h$,Dse]=rx(km),[Lse,p$]=mi(km,[Dse]),[kse,jse]=Lse(km),m$=_.forwardRef((t,e)=>h.jsx(S1.Provider,{scope:t.__scopeRovingFocusGroup,children:h.jsx(S1.Slot,{scope:t.__scopeRovingFocusGroup,children:h.jsx(Use,{...t,ref:e})})}));m$.displayName=km;var Use=_.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=t,f=_.useRef(null),p=Ot(e,f),y=jA(o),[v,g]=$o({prop:a,defaultProp:s??null,onChange:l,caller:km}),[m,x]=_.useState(!1),b=di(c),S=h$(n),w=_.useRef(!1),[E,T]=_.useState(0);return _.useEffect(()=>{const A=f.current;if(A)return A.addEventListener(Dw,b),()=>A.removeEventListener(Dw,b)},[b]),h.jsx(kse,{scope:n,orientation:r,dir:y,loop:i,currentTabStopId:v,onItemFocus:_.useCallback(A=>g(A),[g]),onItemShiftTab:_.useCallback(()=>x(!0),[]),onFocusableItemAdd:_.useCallback(()=>T(A=>A+1),[]),onFocusableItemRemove:_.useCallback(()=>T(A=>A-1),[]),children:h.jsx(nt.div,{tabIndex:m||E===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:"none",...t.style},onMouseDown:Oe(t.onMouseDown,()=>{w.current=!0}),onFocus:Oe(t.onFocus,A=>{const M=!w.current;if(A.target===A.currentTarget&&M&&!m){const C=new CustomEvent(Dw,Ise);if(A.currentTarget.dispatchEvent(C),!C.defaultPrevented){const P=S().filter(O=>O.focusable),R=P.find(O=>O.active),D=P.find(O=>O.id===v),U=[R,D,...P].filter(Boolean).map(O=>O.ref.current);y$(U,u)}}w.current=!1}),onBlur:Oe(t.onBlur,()=>x(!1))})})}),g$="RovingFocusGroupItem",v$=_.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,children:a,...s}=t,l=sr(),c=o||l,u=jse(g$,n),d=u.currentTabStopId===c,f=h$(n),{onFocusableItemAdd:p,onFocusableItemRemove:y,currentTabStopId:v}=u;return _.useEffect(()=>{if(r)return p(),()=>y()},[r,p,y]),h.jsx(S1.ItemSlot,{scope:n,id:c,focusable:r,active:i,children:h.jsx(nt.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:e,onMouseDown:Oe(t.onMouseDown,g=>{r?u.onItemFocus(c):g.preventDefault()}),onFocus:Oe(t.onFocus,()=>u.onItemFocus(c)),onKeyDown:Oe(t.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){u.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const m=$se(g,u.orientation,u.dir);if(m!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let b=f().filter(S=>S.focusable).map(S=>S.ref.current);if(m==="last")b.reverse();else if(m==="prev"||m==="next"){m==="prev"&&b.reverse();const S=b.indexOf(g.currentTarget);b=u.loop?zse(b,S+1):b.slice(S+1)}setTimeout(()=>y$(b))}}),children:typeof a=="function"?a({isCurrentTabStop:d,hasTabStop:v!=null}):a})})});v$.displayName=g$;var Fse={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Bse(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function $se(t,e,n){const r=Bse(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Fse[r]}function y$(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function zse(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var Hse=m$,Vse=v$,E1=["Enter"," "],Gse=["ArrowDown","PageUp","Home"],x$=["ArrowUp","PageDown","End"],Wse=[...Gse,...x$],Xse={ltr:[...E1,"ArrowRight"],rtl:[...E1,"ArrowLeft"]},qse={ltr:["ArrowLeft"],rtl:["ArrowRight"]},jm="Menu",[Np,Kse,Yse]=rx(jm),[Wc,b$]=mi(jm,[Yse,El,p$]),Wx=El(),_$=p$(),[Jse,Xc]=Wc(jm),[Zse,Um]=Wc(jm),w$=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:i,onOpenChange:o,modal:a=!0}=t,s=Wx(e),[l,c]=_.useState(null),u=_.useRef(!1),d=di(o),f=jA(i);return _.useEffect(()=>{const p=()=>{u.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>u.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),h.jsx(gx,{...s,children:h.jsx(Jse,{scope:e,open:n,onOpenChange:d,content:l,onContentChange:c,children:h.jsx(Zse,{scope:e,onClose:_.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:a,children:r})})})};w$.displayName=jm;var Qse="MenuAnchor",fC=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,i=Wx(n);return h.jsx(Cm,{...i,...r,ref:e})});fC.displayName=Qse;var hC="MenuPortal",[ele,S$]=Wc(hC,{forceMount:void 0}),E$=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:i}=t,o=Xc(hC,e);return h.jsx(ele,{scope:e,forceMount:n,children:h.jsx(gi,{present:n||o.open,children:h.jsx(vf,{asChild:!0,container:i,children:r})})})};E$.displayName=hC;var to="MenuContent",[tle,pC]=Wc(to),T$=_.forwardRef((t,e)=>{const n=S$(to,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,o=Xc(to,t.__scopeMenu),a=Um(to,t.__scopeMenu);return h.jsx(Np.Provider,{scope:t.__scopeMenu,children:h.jsx(gi,{present:r||o.open,children:h.jsx(Np.Slot,{scope:t.__scopeMenu,children:a.modal?h.jsx(nle,{...i,ref:e}):h.jsx(rle,{...i,ref:e})})})})}),nle=_.forwardRef((t,e)=>{const n=Xc(to,t.__scopeMenu),r=_.useRef(null),i=Ot(e,r);return _.useEffect(()=>{const o=r.current;if(o)return cx(o)},[]),h.jsx(mC,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Oe(t.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),rle=_.forwardRef((t,e)=>{const n=Xc(to,t.__scopeMenu);return h.jsx(mC,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),ile=sl("MenuContent.ScrollLock"),mC=_.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:y,...v}=t,g=Xc(to,n),m=Um(to,n),x=Wx(n),b=_$(n),S=Kse(n),[w,E]=_.useState(null),T=_.useRef(null),A=Ot(e,T,g.onContentChange),M=_.useRef(0),C=_.useRef(""),P=_.useRef(0),R=_.useRef(null),D=_.useRef("right"),k=_.useRef(0),U=y?Mm:_.Fragment,O=y?{as:ile,allowPinchZoom:!0}:void 0,W=j=>{var Q,ce;const X=C.current+j,K=S().filter(ae=>!ae.disabled),F=document.activeElement,Y=(Q=K.find(ae=>ae.ref.current===F))==null?void 0:Q.textValue,q=K.map(ae=>ae.textValue),ee=gle(q,X,Y),te=(ce=K.find(ae=>ae.textValue===ee))==null?void 0:ce.ref.current;(function ae(fe){C.current=fe,window.clearTimeout(M.current),fe!==""&&(M.current=window.setTimeout(()=>ae(""),1e3))})(X),te&&setTimeout(()=>te.focus())};_.useEffect(()=>()=>window.clearTimeout(M.current),[]),sx();const L=_.useCallback(j=>{var K,F;return D.current===((K=R.current)==null?void 0:K.side)&&yle(j,(F=R.current)==null?void 0:F.area)},[]);return h.jsx(tle,{scope:n,searchRef:C,onItemEnter:_.useCallback(j=>{L(j)&&j.preventDefault()},[L]),onItemLeave:_.useCallback(j=>{var X;L(j)||((X=T.current)==null||X.focus(),E(null))},[L]),onTriggerLeave:_.useCallback(j=>{L(j)&&j.preventDefault()},[L]),pointerGraceTimerRef:P,onPointerGraceIntentChange:_.useCallback(j=>{R.current=j},[]),children:h.jsx(U,{...O,children:h.jsx(Tm,{asChild:!0,trapped:i,onMountAutoFocus:Oe(o,j=>{var X;j.preventDefault(),(X=T.current)==null||X.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:h.jsx(zc,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:h.jsx(Hse,{asChild:!0,...b,dir:m.dir,orientation:"vertical",loop:r,currentTabStopId:w,onCurrentTabStopIdChange:E,onEntryFocus:Oe(l,j=>{m.isUsingKeyboardRef.current||j.preventDefault()}),preventScrollOnEntryFocus:!0,children:h.jsx(vx,{role:"menu","aria-orientation":"vertical","data-state":$$(g.open),"data-radix-menu-content":"",dir:m.dir,...x,...v,ref:A,style:{outline:"none",...v.style},onKeyDown:Oe(v.onKeyDown,j=>{const K=j.target.closest("[data-radix-menu-content]")===j.currentTarget,F=j.ctrlKey||j.altKey||j.metaKey,Y=j.key.length===1;K&&(j.key==="Tab"&&j.preventDefault(),!F&&Y&&W(j.key));const q=T.current;if(j.target!==q||!Wse.includes(j.key))return;j.preventDefault();const te=S().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);x$.includes(j.key)&&te.reverse(),ple(te)}),onBlur:Oe(t.onBlur,j=>{j.currentTarget.contains(j.target)||(window.clearTimeout(M.current),C.current="")}),onPointerMove:Oe(t.onPointerMove,Op(j=>{const X=j.target,K=k.current!==j.clientX;if(j.currentTarget.contains(X)&&K){const F=j.clientX>k.current?"right":"left";D.current=F,k.current=j.clientX}}))})})})})})})});T$.displayName=to;var ole="MenuGroup",gC=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return h.jsx(nt.div,{role:"group",...r,ref:e})});gC.displayName=ole;var ale="MenuLabel",M$=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return h.jsx(nt.div,{...r,ref:e})});M$.displayName=ale;var Ly="MenuItem",E2="menu.itemSelect",Xx=_.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...i}=t,o=_.useRef(null),a=Um(Ly,t.__scopeMenu),s=pC(Ly,t.__scopeMenu),l=Ot(e,o),c=_.useRef(!1),u=()=>{const d=o.current;if(!n&&d){const f=new CustomEvent(E2,{bubbles:!0,cancelable:!0});d.addEventListener(E2,p=>r==null?void 0:r(p),{once:!0}),JM(d,f),f.defaultPrevented?c.current=!1:a.onClose()}};return h.jsx(A$,{...i,ref:l,disabled:n,onClick:Oe(t.onClick,u),onPointerDown:d=>{var f;(f=t.onPointerDown)==null||f.call(t,d),c.current=!0},onPointerUp:Oe(t.onPointerUp,d=>{var f;c.current||(f=d.currentTarget)==null||f.click()}),onKeyDown:Oe(t.onKeyDown,d=>{const f=s.searchRef.current!=="";n||f&&d.key===" "||E1.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});Xx.displayName=Ly;var A$=_.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=t,a=pC(Ly,n),s=_$(n),l=_.useRef(null),c=Ot(e,l),[u,d]=_.useState(!1),[f,p]=_.useState("");return _.useEffect(()=>{const y=l.current;y&&p((y.textContent??"").trim())},[o.children]),h.jsx(Np.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:h.jsx(Vse,{asChild:!0,...s,focusable:!r,children:h.jsx(nt.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:c,onPointerMove:Oe(t.onPointerMove,Op(y=>{r?a.onItemLeave(y):(a.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Oe(t.onPointerLeave,Op(y=>a.onItemLeave(y))),onFocus:Oe(t.onFocus,()=>d(!0)),onBlur:Oe(t.onBlur,()=>d(!1))})})})}),sle="MenuCheckboxItem",C$=_.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...i}=t;return h.jsx(I$,{scope:t.__scopeMenu,checked:n,children:h.jsx(Xx,{role:"menuitemcheckbox","aria-checked":ky(n)?"mixed":n,...i,ref:e,"data-state":yC(n),onSelect:Oe(i.onSelect,()=>r==null?void 0:r(ky(n)?!0:!n),{checkForDefaultPrevented:!1})})})});C$.displayName=sle;var P$="MenuRadioGroup",[lle,cle]=Wc(P$,{value:void 0,onValueChange:()=>{}}),R$=_.forwardRef((t,e)=>{const{value:n,onValueChange:r,...i}=t,o=di(r);return h.jsx(lle,{scope:t.__scopeMenu,value:n,onValueChange:o,children:h.jsx(gC,{...i,ref:e})})});R$.displayName=P$;var N$="MenuRadioItem",O$=_.forwardRef((t,e)=>{const{value:n,...r}=t,i=cle(N$,t.__scopeMenu),o=n===i.value;return h.jsx(I$,{scope:t.__scopeMenu,checked:o,children:h.jsx(Xx,{role:"menuitemradio","aria-checked":o,...r,ref:e,"data-state":yC(o),onSelect:Oe(r.onSelect,()=>{var a;return(a=i.onValueChange)==null?void 0:a.call(i,n)},{checkForDefaultPrevented:!1})})})});O$.displayName=N$;var vC="MenuItemIndicator",[I$,ule]=Wc(vC,{checked:!1}),D$=_.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...i}=t,o=ule(vC,n);return h.jsx(gi,{present:r||ky(o.checked)||o.checked===!0,children:h.jsx(nt.span,{...i,ref:e,"data-state":yC(o.checked)})})});D$.displayName=vC;var dle="MenuSeparator",L$=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return h.jsx(nt.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});L$.displayName=dle;var fle="MenuArrow",k$=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,i=Wx(n);return h.jsx(yx,{...i,...r,ref:e})});k$.displayName=fle;var hle="MenuSub",[RDe,j$]=Wc(hle),Oh="MenuSubTrigger",U$=_.forwardRef((t,e)=>{const n=Xc(Oh,t.__scopeMenu),r=Um(Oh,t.__scopeMenu),i=j$(Oh,t.__scopeMenu),o=pC(Oh,t.__scopeMenu),a=_.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:l}=o,c={__scopeMenu:t.__scopeMenu},u=_.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return _.useEffect(()=>u,[u]),_.useEffect(()=>{const d=s.current;return()=>{window.clearTimeout(d),l(null)}},[s,l]),h.jsx(fC,{asChild:!0,...c,children:h.jsx(A$,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":$$(n.open),...t,ref:is(e,i.onTriggerChange),onClick:d=>{var f;(f=t.onClick)==null||f.call(t,d),!(t.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Oe(t.onPointerMove,Op(d=>{o.onItemEnter(d),!d.defaultPrevented&&!t.disabled&&!n.open&&!a.current&&(o.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:Oe(t.onPointerLeave,Op(d=>{var p,y;u();const f=(p=n.content)==null?void 0:p.getBoundingClientRect();if(f){const v=(y=n.content)==null?void 0:y.dataset.side,g=v==="right",m=g?-5:5,x=f[g?"left":"right"],b=f[g?"right":"left"];o.onPointerGraceIntentChange({area:[{x:d.clientX+m,y:d.clientY},{x,y:f.top},{x:b,y:f.top},{x:b,y:f.bottom},{x,y:f.bottom}],side:v}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(d),d.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Oe(t.onKeyDown,d=>{var p;const f=o.searchRef.current!=="";t.disabled||f&&d.key===" "||Xse[r.dir].includes(d.key)&&(n.onOpenChange(!0),(p=n.content)==null||p.focus(),d.preventDefault())})})})});U$.displayName=Oh;var F$="MenuSubContent",B$=_.forwardRef((t,e)=>{const n=S$(to,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,o=Xc(to,t.__scopeMenu),a=Um(to,t.__scopeMenu),s=j$(F$,t.__scopeMenu),l=_.useRef(null),c=Ot(e,l);return h.jsx(Np.Provider,{scope:t.__scopeMenu,children:h.jsx(gi,{present:r||o.open,children:h.jsx(Np.Slot,{scope:t.__scopeMenu,children:h.jsx(mC,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:c,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var d;a.isUsingKeyboardRef.current&&((d=l.current)==null||d.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:Oe(t.onFocusOutside,u=>{u.target!==s.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Oe(t.onEscapeKeyDown,u=>{a.onClose(),u.preventDefault()}),onKeyDown:Oe(t.onKeyDown,u=>{var p;const d=u.currentTarget.contains(u.target),f=qse[a.dir].includes(u.key);d&&f&&(o.onOpenChange(!1),(p=s.trigger)==null||p.focus(),u.preventDefault())})})})})})});B$.displayName=F$;function $$(t){return t?"open":"closed"}function ky(t){return t==="indeterminate"}function yC(t){return ky(t)?"indeterminate":t?"checked":"unchecked"}function ple(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function mle(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function gle(t,e,n){const i=e.length>1&&Array.from(e).every(c=>c===e[0])?e[0]:e,o=n?t.indexOf(n):-1;let a=mle(t,Math.max(o,0));i.length===1&&(a=a.filter(c=>c!==n));const l=a.find(c=>c.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function vle(t,e){const{x:n,y:r}=t;let i=!1;for(let o=0,a=e.length-1;or!=f>r&&n<(d-c)*(r-u)/(f-u)+c&&(i=!i)}return i}function yle(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return vle(n,e)}function Op(t){return e=>e.pointerType==="mouse"?t(e):void 0}var xle=w$,ble=fC,_le=E$,wle=T$,Sle=gC,Ele=M$,Tle=Xx,Mle=C$,Ale=R$,Cle=O$,Ple=D$,Rle=L$,Nle=k$,Ole=U$,Ile=B$,qx="DropdownMenu",[Dle,NDe]=mi(qx,[b$]),Zr=b$(),[Lle,z$]=Dle(qx),H$=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:i,defaultOpen:o,onOpenChange:a,modal:s=!0}=t,l=Zr(e),c=_.useRef(null),[u,d]=$o({prop:i,defaultProp:o??!1,onChange:a,caller:qx});return h.jsx(Lle,{scope:e,triggerId:sr(),triggerRef:c,contentId:sr(),open:u,onOpenChange:d,onOpenToggle:_.useCallback(()=>d(f=>!f),[d]),modal:s,children:h.jsx(xle,{...l,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};H$.displayName=qx;var V$="DropdownMenuTrigger",G$=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=t,o=z$(V$,n),a=Zr(n);return h.jsx(ble,{asChild:!0,...a,children:h.jsx(nt.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:is(e,o.triggerRef),onPointerDown:Oe(t.onPointerDown,s=>{!r&&s.button===0&&s.ctrlKey===!1&&(o.onOpenToggle(),o.open||s.preventDefault())}),onKeyDown:Oe(t.onKeyDown,s=>{r||(["Enter"," "].includes(s.key)&&o.onOpenToggle(),s.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})})});G$.displayName=V$;var kle="DropdownMenuPortal",W$=t=>{const{__scopeDropdownMenu:e,...n}=t,r=Zr(e);return h.jsx(_le,{...r,...n})};W$.displayName=kle;var X$="DropdownMenuContent",q$=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=z$(X$,n),o=Zr(n),a=_.useRef(!1);return h.jsx(wle,{id:i.contentId,"aria-labelledby":i.triggerId,...o,...r,ref:e,onCloseAutoFocus:Oe(t.onCloseAutoFocus,s=>{var l;a.current||(l=i.triggerRef.current)==null||l.focus(),a.current=!1,s.preventDefault()}),onInteractOutside:Oe(t.onInteractOutside,s=>{const l=s.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;(!i.modal||u)&&(a.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});q$.displayName=X$;var jle="DropdownMenuGroup",Ule=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(Sle,{...i,...r,ref:e})});Ule.displayName=jle;var Fle="DropdownMenuLabel",K$=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(Ele,{...i,...r,ref:e})});K$.displayName=Fle;var Ble="DropdownMenuItem",Y$=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(Tle,{...i,...r,ref:e})});Y$.displayName=Ble;var $le="DropdownMenuCheckboxItem",J$=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(Mle,{...i,...r,ref:e})});J$.displayName=$le;var zle="DropdownMenuRadioGroup",Hle=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(Ale,{...i,...r,ref:e})});Hle.displayName=zle;var Vle="DropdownMenuRadioItem",Z$=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(Cle,{...i,...r,ref:e})});Z$.displayName=Vle;var Gle="DropdownMenuItemIndicator",Q$=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(Ple,{...i,...r,ref:e})});Q$.displayName=Gle;var Wle="DropdownMenuSeparator",ez=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(Rle,{...i,...r,ref:e})});ez.displayName=Wle;var Xle="DropdownMenuArrow",qle=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(Nle,{...i,...r,ref:e})});qle.displayName=Xle;var Kle="DropdownMenuSubTrigger",tz=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(Ole,{...i,...r,ref:e})});tz.displayName=Kle;var Yle="DropdownMenuSubContent",nz=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(Ile,{...i,...r,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});nz.displayName=Yle;var Jle=H$,Zle=G$,Qle=W$,rz=q$,iz=K$,oz=Y$,az=J$,sz=Z$,lz=Q$,cz=ez,uz=tz,dz=nz;const ece=Jle,tce=Zle,nce=_.forwardRef(({className:t,inset:e,children:n,...r},i)=>h.jsxs(uz,{ref:i,className:He("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",e&&"pl-8",t),...r,children:[n,h.jsx(bp,{className:"ml-auto h-4 w-4"})]}));nce.displayName=uz.displayName;const rce=_.forwardRef(({className:t,...e},n)=>h.jsx(dz,{ref:n,className:He("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...e}));rce.displayName=dz.displayName;const fz=_.forwardRef(({className:t,sideOffset:e=4,...n},r)=>h.jsx(Qle,{children:h.jsx(rz,{ref:r,sideOffset:e,className:He("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n})}));fz.displayName=rz.displayName;const T1=_.forwardRef(({className:t,inset:e,...n},r)=>h.jsx(oz,{ref:r,className:He("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e&&"pl-8",t),...n}));T1.displayName=oz.displayName;const ice=_.forwardRef(({className:t,children:e,checked:n,...r},i)=>h.jsxs(az,{ref:i,className:He("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:n,...r,children:[h.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:h.jsx(lz,{children:h.jsx(xl,{className:"h-4 w-4"})})}),e]}));ice.displayName=az.displayName;const oce=_.forwardRef(({className:t,children:e,...n},r)=>h.jsxs(sz,{ref:r,className:He("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[h.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:h.jsx(lz,{children:h.jsx(fE,{className:"h-2 w-2 fill-current"})})}),e]}));oce.displayName=sz.displayName;const ace=_.forwardRef(({className:t,inset:e,...n},r)=>h.jsx(iz,{ref:r,className:He("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...n}));ace.displayName=iz.displayName;const sce=_.forwardRef(({className:t,...e},n)=>h.jsx(cz,{ref:n,className:He("-mx-1 my-1 h-px bg-muted",t),...e}));sce.displayName=cz.displayName;const hz="lelab.recording.muted";let Lw=null;const lce=()=>(Lw||(Lw=new AudioContext),Lw),pz=()=>localStorage.getItem(hz)==="1",cce=t=>{localStorage.setItem(hz,t?"1":"0")},gc=(t,e,n=0)=>{if(pz())return;const r=lce(),i=r.createOscillator(),o=r.createGain();i.frequency.value=t,i.type="sine",o.gain.value=0,i.connect(o),o.connect(r.destination);const a=r.currentTime+n/1e3,s=a+e/1e3;o.gain.setValueAtTime(0,a),o.gain.linearRampToValueAtTime(.2,a+.01),o.gain.setValueAtTime(.2,s-.02),o.gain.linearRampToValueAtTime(0,s),i.start(a),i.stop(s)},uce=()=>{gc(660,80,0),gc(880,80,90)},dce=()=>{gc(660,80,0),gc(440,80,90)},fce=()=>{gc(880,70,0),gc(880,70,1e3),gc(880,70,2e3)};var mz="AlertDialog",[hce,ODe]=mi(mz,[sF]),fs=sF(),gz=t=>{const{__scopeAlertDialog:e,...n}=t,r=fs(e);return h.jsx(fA,{...r,...n,modal:!0})};gz.displayName=mz;var pce="AlertDialogTrigger",mce=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=fs(n);return h.jsx(eK,{...i,...r,ref:e})});mce.displayName=pce;var gce="AlertDialogPortal",vz=t=>{const{__scopeAlertDialog:e,...n}=t,r=fs(e);return h.jsx(hA,{...r,...n})};vz.displayName=gce;var vce="AlertDialogOverlay",yz=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=fs(n);return h.jsx(dx,{...i,...r,ref:e})});yz.displayName=vce;var dd="AlertDialogContent",[yce,xce]=hce(dd),bce=uU("AlertDialogContent"),xz=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,children:r,...i}=t,o=fs(n),a=_.useRef(null),s=Ot(e,a),l=_.useRef(null);return h.jsx(Yq,{contentName:dd,titleName:bz,docsSlug:"alert-dialog",children:h.jsx(yce,{scope:n,cancelRef:l,children:h.jsxs(fx,{role:"alertdialog",...o,...i,ref:s,onOpenAutoFocus:Oe(i.onOpenAutoFocus,c=>{var u;c.preventDefault(),(u=l.current)==null||u.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[h.jsx(bce,{children:r}),h.jsx(wce,{contentRef:a})]})})})});xz.displayName=dd;var bz="AlertDialogTitle",_z=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=fs(n);return h.jsx(pA,{...i,...r,ref:e})});_z.displayName=bz;var wz="AlertDialogDescription",Sz=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=fs(n);return h.jsx(mA,{...i,...r,ref:e})});Sz.displayName=wz;var _ce="AlertDialogAction",Ez=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=fs(n);return h.jsx(gA,{...i,...r,ref:e})});Ez.displayName=_ce;var Tz="AlertDialogCancel",Mz=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,{cancelRef:i}=xce(Tz,n),o=fs(n),a=Ot(e,i);return h.jsx(gA,{...o,...r,ref:a})});Mz.displayName=Tz;var wce=({contentRef:t})=>{const e=`\`${dd}\` requires a description for the component to be accessible for screen reader users. + +You can add a description to the \`${dd}\` by passing a \`${wz}\` component as a child, which also benefits sighted users by adding visible context to the dialog. + +Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${dd}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. + +For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return _.useEffect(()=>{var r;document.getElementById((r=t.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(e)},[e,t]),null},Sce=gz,Ece=vz,Az=yz,Cz=xz,Pz=Ez,Rz=Mz,Nz=_z,Oz=Sz;const xC=Sce,Tce=Ece,Iz=_.forwardRef(({className:t,...e},n)=>h.jsx(Az,{className:He("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e,ref:n}));Iz.displayName=Az.displayName;const Kx=_.forwardRef(({className:t,...e},n)=>h.jsxs(Tce,{children:[h.jsx(Iz,{}),h.jsx(Cz,{ref:n,className:He("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...e})]}));Kx.displayName=Cz.displayName;const Yx=({className:t,...e})=>h.jsx("div",{className:He("flex flex-col space-y-2 text-center sm:text-left",t),...e});Yx.displayName="AlertDialogHeader";const Jx=({className:t,...e})=>h.jsx("div",{className:He("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});Jx.displayName="AlertDialogFooter";const Zx=_.forwardRef(({className:t,...e},n)=>h.jsx(Nz,{ref:n,className:He("text-lg font-semibold",t),...e}));Zx.displayName=Nz.displayName;const Qx=_.forwardRef(({className:t,...e},n)=>h.jsx(Oz,{ref:n,className:He("text-sm text-muted-foreground",t),...e}));Qx.displayName=Oz.displayName;const eb=_.forwardRef(({className:t,...e},n)=>h.jsx(Pz,{ref:n,className:He(lA(),t),...e}));eb.displayName=Pz.displayName;const tb=_.forwardRef(({className:t,...e},n)=>h.jsx(Rz,{ref:n,className:He(lA({variant:"outline"}),"mt-2 sm:mt-0",t),...e}));tb.displayName=Rz.displayName;const Mce=()=>{var le;const t=yl(),e=ji(),{toast:n}=Dr(),{baseUrl:r,wsBaseUrl:i,fetchWithHeaders:o}=Dn(),a=(le=t.state)==null?void 0:le.recordingConfig,[s,l]=_.useState(null),[c,u]=_.useState(!1),[d,f]=_.useState(null),[p,y]=_.useState(!1),[v,g]=_.useState(()=>pz()),m=_.useRef(null),[x,b]=_.useState(0),S=_.useRef({phase:null,episode:null,tick:0}),w=_.useRef(!1),E=_.useRef(!1),T=_.useCallback(()=>{g(ie=>{const G=!ie;return cce(G),G})},[]);_.useEffect(()=>{a||(n({title:"No Configuration",description:"Please start recording from the main page.",variant:"destructive"}),e("/"))},[a,e,n]),_.useEffect(()=>{a&&!E.current&&(E.current=!0,P())},[a]);const A=_.useRef(d);A.current=d;const M=_.useRef(x);M.current=x,_.useEffect(()=>{if(!c)return;const ie=async()=>{try{const Ve=await o(`${r}/recording-status`);if(!Ve.ok)return;const Ne=await Ve.json();l(Ne);const st=A.current;st&&Ne.current_phase===st&&f(null);const Re=Ne.current_phase,ct=m.current;ct!==Re&&(Re==="recording"&&ct!==null?uce():Re==="resetting"&&dce(),m.current=Re,S.current={phase:null,episode:null,tick:0});const Ye=Ne.phase_elapsed_seconds||0,it=Ne.phase_time_limit_s||0,Ft=it>3&&Ye>=it-3,J=Ne.current_episode??null,B=M.current,ue=S.current;if(Ft&&st===null&&(ue.phase!==Re||ue.episode!==J||ue.tick!==B)&&(fce(),S.current={phase:Re,episode:J,tick:B}),!Ne.recording_active&&Ne.session_ended&&Ne.current_phase==="error"){w.current||(w.current=!0,u(!1),n({title:"Recording failed",description:Ne.error||Ne.message||"Check the robot connection and try again.",variant:"destructive"}));return}if(!Ne.recording_active&&Ne.session_ended){const me={dataset_repo_id:Ne.dataset_repo_id||a.dataset_repo_id,single_task:a.single_task,num_episodes:a.num_episodes,saved_episodes:Ne.saved_episodes||0,session_elapsed_seconds:Ne.session_elapsed_seconds||0};e("/upload",{state:{datasetInfo:me}})}}catch(Ve){console.error("Error polling recording status:",Ve)}};ie();const G=setInterval(ie,1e3);return()=>clearInterval(G)},[c,a,e,r,o]);const C=ie=>{const G=Math.floor(ie/60),Ve=ie%60;return`${G.toString().padStart(2,"0")}:${Ve.toString().padStart(2,"0")}`},P=async()=>{try{const ie=await o(`${r}/start-recording`,{method:"POST",body:JSON.stringify(a)}),G=await ie.json();ie.ok?(w.current=!1,u(!0),n({title:"Recording Started",description:`Started recording ${a.num_episodes} episodes`})):(n({title:"Error Starting Recording",description:G.message||"Failed to start recording session.",variant:"destructive"}),e("/"))}catch{n({title:"Connection Error",description:"Could not connect to the backend server.",variant:"destructive"}),e("/")}},R=_.useCallback(async()=>{if(!(s!=null&&s.available_controls.exit_early)||d!==null)return;const ie=s.current_phase,G=ie==="recording"?"resetting":ie==="resetting"?"recording":null;if(G){f(G);try{const Ve=await o(`${r}/recording-exit-early`,{method:"POST"});if(!Ve.ok){const Ne=await Ve.json();f(null),n({title:"Error",description:Ne.message,variant:"destructive"})}}catch{f(null),n({title:"Connection Error",description:"Could not connect to the backend server.",variant:"destructive"})}}},[s,d,r,o,n]),D=_.useCallback(async()=>{if(s!=null&&s.available_controls.rerecord_episode)try{const ie=await o(`${r}/recording-rerecord-episode`,{method:"POST"}),G=await ie.json();ie.ok?(b(Ve=>Ve+1),n({title:"Re-recording Episode",description:`Episode ${s.current_episode} will be re-recorded.`})):n({title:"Error",description:G.message,variant:"destructive"})}catch{n({title:"Connection Error",description:"Could not connect to the backend server.",variant:"destructive"})}},[s,r,o,n]),k=_.useCallback(async()=>{if(s!=null&&s.available_controls.stop_recording)try{await o(`${r}/stop-recording`,{method:"POST"}),n({title:"Stopping recording",description:"Finalizing datasetโ€ฆ"})}catch{n({title:"Error",description:"Failed to stop recording.",variant:"destructive"})}},[s,r,o,n]),U=_.useCallback(()=>{s!=null&&s.available_controls.stop_recording&&y(!0)},[s]),O=_.useCallback(async()=>{y(!1),await k()},[k]),W=_.useRef({handleExitEarly:R,handleRerecordEpisode:D,requestStopRecording:U,showStopConfirm:p});_.useEffect(()=>{W.current={handleExitEarly:R,handleRerecordEpisode:D,requestStopRecording:U,showStopConfirm:p}});const L=c&&s!==null;if(_.useEffect(()=>{if(!L)return;const ie=G=>{const Ve=G.target;if(!(Ve&&(Ve.tagName==="INPUT"||Ve.tagName==="TEXTAREA"||Ve.isContentEditable))){if(G.key===" "||G.code==="Space"||G.key==="ArrowRight")G.preventDefault(),W.current.handleExitEarly();else if(G.key==="ArrowLeft")G.preventDefault(),W.current.handleRerecordEpisode();else if(G.key==="Escape"){if(W.current.showStopConfirm)return;W.current.requestStopRecording()}}};return window.addEventListener("keydown",ie),()=>window.removeEventListener("keydown",ie)},[L]),!a)return h.jsx("div",{className:"min-h-screen bg-black text-white flex items-center justify-center",children:h.jsxs("div",{className:"text-center",children:[h.jsx("p",{className:"text-lg",children:"No recording configuration found."}),h.jsx(et,{onClick:()=>e("/"),className:"mt-4",children:"Return to Home"})]})});if(!s)return h.jsx("div",{className:"min-h-screen bg-black text-white flex items-center justify-center",children:h.jsxs("div",{className:"text-center",children:[h.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-red-500 mx-auto mb-4"}),h.jsx("p",{className:"text-lg",children:"Connecting to recording session..."})]})});const j=s.current_phase,X=d??j,K=s.current_episode??1,F=s.total_episodes??a.num_episodes,Y=d?0:s.phase_elapsed_seconds||0,q=X==="recording"?a.episode_time_s:X==="resetting"?a.reset_time_s:s.phase_time_limit_s||0,ee=s.session_elapsed_seconds||0,te=()=>X==="recording"?`RECORDING EPISODE ${K}`:X==="resetting"?"RESET โ€” GET READY":X==="preparing"?"PREPARING SESSION":X==="stopping"?"STOPPING RECORDING":X==="error"?"RECORDING ERROR":"SESSION COMPLETE",Q=X==="recording"?{dot:"bg-red-500",pill:"bg-red-500/15 text-red-300",timer:"text-green-400",bar:"bg-green-500",button:"bg-green-500 hover:bg-green-600"}:X==="resetting"?{dot:"bg-orange-500",pill:"bg-orange-500/15 text-orange-300",timer:"text-orange-400",bar:"bg-orange-500",button:"bg-orange-500 hover:bg-orange-600"}:{dot:"bg-gray-500",pill:"bg-gray-500/15 text-gray-300",timer:"text-gray-400",bar:"bg-gray-500",button:"bg-gray-500"},ce=X==="recording"?"End Episode":X==="resetting"?"Start Next Episode":X==="stopping"?"Stopping...":X==="error"?"Recording failed":"Advance",ae=X==="recording"?oX:Tc,fe=s.available_controls.exit_early&&d===null&&(X==="recording"||X==="resetting"),we=q>0?Math.min(Y/q*100,100):0;return h.jsxs("div",{className:"min-h-screen bg-black text-white p-8",children:[h.jsxs("div",{className:"max-w-2xl mx-auto",children:[h.jsx("div",{className:"mb-8",children:h.jsxs(et,{onClick:()=>e("/"),variant:"outline",className:"border-gray-500 hover:border-gray-200 text-gray-300 hover:text-white",children:[h.jsx(ll,{className:"w-4 h-4 mr-2"}),"Back to Home"]})}),h.jsxs("div",{className:"bg-gray-900 rounded-lg border border-gray-700 p-8",children:[h.jsxs("div",{className:"flex justify-end items-center gap-4 mb-6 text-sm text-gray-400",children:[h.jsxs("span",{"aria-label":`Episode ${K} of ${F}`,children:["Episode ",h.jsx("span",{className:"text-white font-semibold",children:K})," / ",F]}),h.jsx("span",{className:"font-mono","aria-label":`Total session time ${C(ee)}`,children:C(ee)}),h.jsx(et,{variant:"ghost",size:"icon",onClick:T,"aria-label":v?"Unmute":"Mute",className:"h-8 w-8 text-gray-400 hover:text-white hover:bg-gray-800",children:v?h.jsx(lX,{className:"w-5 h-5"}):h.jsx(sX,{className:"w-5 h-5"})}),h.jsxs(ece,{children:[h.jsx(tce,{asChild:!0,children:h.jsx(et,{variant:"ghost",size:"icon",className:"h-8 w-8 text-gray-400 hover:text-white hover:bg-gray-800","aria-label":"More actions",children:h.jsx(Y7,{className:"w-5 h-5"})})}),h.jsxs(fz,{align:"end",onCloseAutoFocus:ie=>ie.preventDefault(),className:"bg-gray-900 border-gray-700 text-white",children:[h.jsxs(T1,{onClick:D,disabled:!s.available_controls.rerecord_episode,className:"focus:bg-gray-800 focus:text-white",children:[h.jsx(iX,{className:"w-4 h-4 mr-2"}),"Re-record episode"]}),h.jsxs(T1,{onClick:U,disabled:!s.available_controls.stop_recording,className:"text-red-400 focus:bg-gray-800 focus:text-red-300",children:[h.jsx(Od,{className:"w-4 h-4 mr-2"}),"Stop recording"]})]})]})]}),h.jsx("div",{className:"text-center mb-6",children:h.jsxs("div",{role:"status","aria-live":"polite",className:`inline-flex items-center gap-2 px-3 py-1 rounded-full text-xs font-bold tracking-widest ${Q.pill}`,children:[h.jsx("span",{className:`w-2 h-2 rounded-full ${Q.dot} ${X!=="completed"?"animate-pulse":""}`}),te()]})}),h.jsxs("div",{className:"text-center mb-4",children:[h.jsx("div",{className:`text-7xl font-mono font-bold leading-none ${Q.timer}`,children:C(Y)}),h.jsxs("div",{className:"text-sm text-gray-500 mt-2",children:["/ ",C(q)]})]}),h.jsx("div",{className:"w-full bg-gray-800 rounded-full h-1.5 mb-8",children:h.jsx("div",{className:`h-1.5 rounded-full transition-all duration-500 ${Q.bar}`,style:{width:`${we}%`}})}),h.jsxs(et,{onClick:R,disabled:!fe,className:`w-full text-white font-semibold py-6 text-lg disabled:opacity-50 ${Q.button}`,children:[h.jsx(ae,{className:"w-5 h-5 mr-2"}),ce,(X==="recording"||X==="resetting")&&h.jsx("span",{className:"ml-3 px-2 py-0.5 rounded text-xs font-mono bg-black/30 text-white/70",children:"SPACE / โ†’"})]}),X==="completed"&&h.jsx("p",{className:"text-center text-sm text-gray-400 mt-6",children:"Recording complete โ€” redirecting to uploadโ€ฆ"})]})]}),h.jsx(xC,{open:p,onOpenChange:y,children:h.jsxs(Kx,{className:"bg-gray-900 border-gray-700 text-white",children:[h.jsxs(Yx,{children:[h.jsx(Zx,{children:"Stop recording?"}),h.jsx(Qx,{className:"text-gray-400",children:"Saved episodes are kept. The session will end and you'll be taken to the upload page."})]}),h.jsxs(Jx,{children:[h.jsx(tb,{className:"bg-gray-800 border-gray-700 text-white hover:bg-gray-700",children:"Keep recording"}),h.jsx(eb,{onClick:O,className:"bg-red-500 hover:bg-red-600 text-white",children:"Stop"})]})]})})]})},Ace=[{value:"act",label:"ACT (Action Chunking Transformer)"},{value:"diffusion",label:"Diffusion Policy"},{value:"pi0",label:"PI0"},{value:"pi05",label:"PI0.5"},{value:"pi0_fast",label:"PI0 Fast"},{value:"smolvla",label:"SmolVLA"},{value:"vqbet",label:"VQ-BeT"}],Ih=new Set(["pi0","pi05"]),M1=new Set(["pi0_fast"]),A1=new Set(["smolvla"]);function Dz(t){return{dtype:Ih.has(t)||M1.has(t),gradientCheckpointing:Ih.has(t)||M1.has(t),freezeVisionEncoder:Ih.has(t)||A1.has(t),trainExpertOnly:Ih.has(t)||A1.has(t)}}const sv={policy_dtype:void 0,policy_gradient_checkpointing:void 0,policy_freeze_vision_encoder:void 0,policy_train_expert_only:void 0};function Cce(t,e){return Ih.has(t)?{...sv,batch_size:Math.min(e.batch_size||1,1),policy_use_amp:!0,policy_dtype:"bfloat16",policy_gradient_checkpointing:!0,policy_freeze_vision_encoder:!0,policy_train_expert_only:!0}:M1.has(t)?{...sv,batch_size:Math.min(e.batch_size||1,1),policy_use_amp:!0,policy_dtype:"bfloat16",policy_gradient_checkpointing:!0}:A1.has(t)?{...sv,batch_size:Math.min(e.batch_size||1,1),policy_use_amp:!0,policy_freeze_vision_encoder:!0,policy_train_expert_only:!0}:{...sv,policy_use_amp:!1}}const kw=()=>{const t=ji();return h.jsx("div",{className:"flex items-center justify-between mb-8",children:h.jsxs("div",{className:"flex items-center gap-4 text-3xl",children:[h.jsx(et,{variant:"ghost",size:"icon",onClick:()=>t("/"),className:"text-slate-400 hover:bg-slate-800 hover:text-white rounded-lg",children:h.jsx(ll,{className:"w-5 h-5"})}),h.jsx(Gx,{}),h.jsx("h1",{className:"font-bold text-white text-2xl",children:"Training"})]})})};var nb="Switch",[Pce,IDe]=mi(nb),[Rce,Nce]=Pce(nb),Lz=_.forwardRef((t,e)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:o,required:a,disabled:s,value:l="on",onCheckedChange:c,form:u,...d}=t,[f,p]=_.useState(null),y=Ot(e,b=>p(b)),v=_.useRef(!1),g=f?u||!!f.closest("form"):!0,[m,x]=$o({prop:i,defaultProp:o??!1,onChange:c,caller:nb});return h.jsxs(Rce,{scope:n,checked:m,disabled:s,children:[h.jsx(nt.button,{type:"button",role:"switch","aria-checked":m,"aria-required":a,"data-state":Fz(m),"data-disabled":s?"":void 0,disabled:s,value:l,...d,ref:y,onClick:Oe(t.onClick,b=>{x(S=>!S),g&&(v.current=b.isPropagationStopped(),v.current||b.stopPropagation())})}),g&&h.jsx(Uz,{control:f,bubbles:!v.current,name:r,value:l,checked:m,required:a,disabled:s,form:u,style:{transform:"translateX(-100%)"}})]})});Lz.displayName=nb;var kz="SwitchThumb",jz=_.forwardRef((t,e)=>{const{__scopeSwitch:n,...r}=t,i=Nce(kz,n);return h.jsx(nt.span,{"data-state":Fz(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:e})});jz.displayName=kz;var Oce="SwitchBubbleInput",Uz=_.forwardRef(({__scopeSwitch:t,control:e,checked:n,bubbles:r=!0,...i},o)=>{const a=_.useRef(null),s=Ot(a,o),l=RA(n),c=EA(e);return _.useEffect(()=>{const u=a.current;if(!u)return;const d=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(d,"checked").set;if(l!==n&&p){const y=new Event("click",{bubbles:r});p.call(u,n),u.dispatchEvent(y)}},[l,n,r]),h.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...i.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Uz.displayName=Oce;function Fz(t){return t?"checked":"unchecked"}var Bz=Lz,Ice=jz;const Zo=_.forwardRef(({className:t,...e},n)=>h.jsx(Bz,{className:He("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",t),...e,ref:n,children:h.jsx(Ice,{className:He("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));Zo.displayName=Bz.displayName;const T2=/^[\w.\-]+\/[\w.\-]+$/,Dce=({datasets:t,loading:e,value:n,onChange:r})=>{const[i,o]=Z.useState(!1),[a,s]=Z.useState(!1),[l,c]=Z.useState(""),u=()=>{const y=l.trim();T2.test(y)&&(r(y),s(!1))},d=t.filter(y=>y.source==="local"||y.source==="both"),f=t.filter(y=>y.source==="hub"),p=y=>h.jsxs(kd,{value:y.repo_id,onSelect:()=>{r(y.repo_id),o(!1)},className:"text-white aria-selected:bg-gray-700",children:[h.jsx(xl,{className:He("mr-2 h-4 w-4",n===y.repo_id?"opacity-100":"opacity-0")}),h.jsx("span",{className:"flex-1 truncate",children:y.repo_id}),y.source==="both"&&h.jsx("span",{className:"text-xs text-gray-400 mr-2",children:"on Hub"}),y.private&&h.jsx("span",{className:"text-xs text-amber-400",children:"private"})]},y.repo_id);return a?h.jsxs("div",{className:"flex gap-2",children:[h.jsx(hi,{autoFocus:!0,value:l,onChange:y=>c(y.target.value),onKeyDown:y=>{y.key==="Enter"&&u()},placeholder:"org/dataset-name",className:"bg-gray-800 border-gray-600 text-white"}),h.jsx(et,{onClick:u,disabled:!T2.test(l.trim()),children:"Use"}),h.jsx(et,{variant:"ghost",onClick:()=>s(!1),children:"Cancel"})]}):h.jsxs(Sx,{open:i,onOpenChange:o,children:[h.jsx(Ex,{asChild:!0,children:h.jsxs(et,{variant:"outline",role:"combobox","aria-expanded":i,className:"w-full justify-between bg-gray-800 border-gray-600 text-white hover:bg-gray-700",children:[n??(e?"Loading datasetsโ€ฆ":"Select a datasetโ€ฆ"),h.jsx(tA,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),h.jsx(Rm,{className:"w-[--radix-popover-trigger-width] p-0 bg-gray-800 border-gray-700",align:"start",children:h.jsxs(Mx,{className:"bg-gray-800 text-white",children:[h.jsx(Ax,{placeholder:"Search datasetsโ€ฆ",className:"text-white"}),h.jsxs(Cx,{children:[h.jsx(Px,{children:e?"Loadingโ€ฆ":"No datasets."}),d.length>0&&h.jsx(Qs,{heading:"Local",children:d.map(p)}),f.length>0&&h.jsx(Qs,{heading:"Hugging Face",children:f.map(p)}),h.jsx(Qs,{children:h.jsxs(kd,{onSelect:()=>{s(!0),o(!1)},className:"text-purple-300 aria-selected:bg-gray-700",children:[h.jsx(rX,{className:"mr-2 h-4 w-4"}),"Use custom repo IDโ€ฆ"]})})]})]})})]})},Lce=1500;function $z(t,e=!0){const{baseUrl:n,fetchWithHeaders:r}=Dn(),[i,o]=_.useState("idle"),[a,s]=_.useState(null),[l,c]=_.useState([]),u=_.useRef(null);_.useEffect(()=>{if(!e)return;let p=!1;return r(`${n}/${t}/install-status`).then(y=>y.json()).then(y=>{p||(o(y.state),s(y.error),y.logs.length>0&&c(y.logs))}).catch(()=>{}),()=>{p=!0}},[e,n,r,t]),_.useEffect(()=>{if(i!=="installing")return;const p=setInterval(async()=>{try{const y=await r(`${n}/${t}/install-status`);if(!y.ok)return;const v=await y.json();v.logs&&v.logs.length>0&&c(g=>[...g,...v.logs]),v.state!=="installing"&&(o(v.state),s(v.error))}catch{}},Lce);return()=>clearInterval(p)},[i,n,r,t]),_.useEffect(()=>{u.current&&(u.current.scrollTop=u.current.scrollHeight)},[l]);const d=_.useCallback(async()=>{o("installing"),s(null),c([]);try{const p=await r(`${n}/${t}/install`,{method:"POST"}),y=await p.json();if(!y.started&&p.ok)return;p.ok||(o("error"),s(y.message||`Install request failed (${p.status})`))}catch(p){o("error"),s(`Install request failed: ${p instanceof Error?p.message:String(p)}`)}},[n,r,t]),f=_.useCallback(()=>{o("idle"),s(null),c([])},[]);return{state:i,error:a,logs:l,logBoxRef:u,handleInstall:d,handleRetry:f}}function zz(t,e){switch(t){case"done":return"Install Complete";case"error":return"Install Failed";case"installing":return"Installingโ€ฆ";default:return e}}function Hz({state:t}){return t==="done"?h.jsx(nA,{className:"w-6 h-6 text-green-400"}):t==="error"?h.jsx(nd,{className:"w-6 h-6 text-red-400"}):t==="installing"?h.jsx(fi,{className:"w-6 h-6 text-sky-400 animate-spin"}):h.jsx(oa,{className:"w-6 h-6 text-amber-400"})}const Vz=({state:t,error:e,logs:n,logBoxRef:r,onInstall:i,onRetry:o,installHint:a,packageName:s,idleDescription:l,doneDescription:c})=>{const{toast:u}=Dr(),d=async()=>{try{await navigator.clipboard.writeText(a),u({title:"Copied",description:a})}catch{u({title:"Copy failed",description:"Select the command and copy manually.",variant:"destructive"})}};return h.jsxs(h.Fragment,{children:[t==="idle"&&h.jsxs(h.Fragment,{children:[h.jsx("p",{className:"text-slate-300",children:l}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("code",{className:"flex-1 bg-slate-900 border border-slate-700 rounded-lg px-3 py-2 text-sm text-slate-200 font-mono",children:a}),h.jsx(et,{variant:"ghost",size:"icon",onClick:d,className:"text-slate-400 hover:text-white","aria-label":"Copy install command",children:h.jsx(rA,{className:"w-4 h-4"})})]}),h.jsx(et,{onClick:i,className:"bg-green-500 hover:bg-green-600 text-white font-semibold",children:"Install Now"})]}),t==="installing"&&h.jsxs("p",{className:"text-slate-300",children:["Installing"," ",h.jsx("code",{className:"px-1 py-0.5 rounded bg-slate-900 text-sky-300",children:s}),". This usually takes about 10 seconds."]}),t==="done"&&h.jsx("div",{className:"space-y-3 text-slate-300",children:c}),t==="error"&&h.jsxs(h.Fragment,{children:[h.jsx("p",{className:"text-red-300",children:e||"Install failed."}),h.jsx(et,{onClick:o,className:"bg-slate-700 hover:bg-slate-600 text-white",children:"Try again"})]}),t==="error"&&n.length>0&&h.jsx("div",{ref:r,className:"bg-slate-900 rounded-lg p-3 h-48 overflow-y-auto font-mono text-xs border border-slate-700 text-slate-300 whitespace-pre-wrap break-words",children:n.map((f,p)=>h.jsx("div",{children:f.message},p))})]})},Gz=({purpose:t})=>h.jsxs(h.Fragment,{children:[h.jsxs("p",{children:["Install complete. Restart"," ",h.jsx("code",{className:"px-1 py-0.5 rounded bg-slate-900 text-sky-300",children:"lelab"})," ","to enable ",t,":"]}),h.jsxs("ol",{className:"list-decimal list-inside space-y-2 pl-1",children:[h.jsxs("li",{children:["Press"," ",h.jsx("kbd",{className:"px-1.5 py-0.5 rounded bg-slate-900 border border-slate-600 text-xs font-mono text-slate-200",children:"Ctrl+C"})," ","in the terminal running"," ",h.jsx("code",{className:"px-1 py-0.5 rounded bg-slate-900 text-sky-300",children:"lelab"}),"."]}),h.jsxs("li",{children:["Run"," ",h.jsx("code",{className:"px-1 py-0.5 rounded bg-slate-900 text-sky-300",children:"lelab"})," ","again."]})]})]}),kce=({open:t,onOpenChange:e,installHint:n})=>{const r=$z("system/wandb-extra",t);return h.jsx(Hc,{open:t,onOpenChange:e,children:h.jsxs(bl,{className:"bg-slate-800 border-slate-700 text-white max-w-2xl",children:[h.jsxs(_l,{children:[h.jsxs(wl,{className:"flex items-center gap-3 text-white",children:[h.jsx(Hz,{state:r.state}),zz(r.state,"Weights & Biases Not Installed")]}),h.jsx(Sl,{className:"sr-only",children:"Install the wandb package to enable W&B logging."})]}),h.jsx("div",{className:"space-y-4",children:h.jsx(Vz,{state:r.state,error:r.error,logs:r.logs,logBoxRef:r.logBoxRef,onInstall:r.handleInstall,onRetry:r.handleRetry,installHint:n,packageName:"wandb",idleTitle:"Weights & Biases Not Installed",idleDescription:h.jsxs(h.Fragment,{children:["Enabling W&B logging requires the"," ",h.jsx("code",{className:"px-1 py-0.5 rounded bg-slate-900 text-sky-300",children:"wandb"})," ","package, which isn't installed in this environment. Install it to log this run to W&B."]}),doneDescription:h.jsx(Gz,{purpose:"W&B logging"})})})]})})},jce=({config:t,updateConfig:e,datasets:n,datasetsLoading:r})=>{const{baseUrl:i,fetchWithHeaders:o}=Dn(),[a,s]=_.useState(!1),[l,c]=_.useState("pip install wandb"),u=t.target.runner==="seeed_cloud"||t.target.runner==="external",d=async f=>{if(!f){e("wandb_enable",!1);return}try{const y=await(await o(`${i}/system/wandb-extra`)).json();y.available?e("wandb_enable",!0):(c(y.install_hint),s(!0))}catch{e("wandb_enable",!0)}};return h.jsxs(Gr,{className:"bg-slate-800/50 border-slate-700 rounded-xl",children:[h.jsx(jo,{children:h.jsx(ga,{className:"text-white",children:"Run Configuration"})}),h.jsxs(Wr,{className:"space-y-6",children:[h.jsxs("div",{children:[h.jsx(Tt,{className:"text-slate-300",children:"Dataset Repository ID *"}),h.jsx("div",{className:"mt-1",children:h.jsx(Dce,{datasets:n,loading:r,value:t.dataset_repo_id||null,onChange:f=>{f&&e("dataset_repo_id",f)}})}),h.jsx("p",{className:"text-xs text-slate-500 mt-1",children:u?"LeLab dataset repository ID; Seeed Cloud also accepts an archive URL or SEEED_CLOUD_DATASET_URL override":"HuggingFace Hub dataset repository ID"})]}),h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"policy_type",className:"text-slate-300",children:"Policy"}),h.jsxs(Ga,{value:t.policy_type,onValueChange:f=>e("policy_type",f),children:[h.jsx(sa,{id:"policy_type",className:"bg-slate-900 border-slate-600 text-white rounded-lg",children:h.jsx(Wa,{})}),h.jsx(la,{className:"bg-slate-800 border-slate-600 text-white",children:Ace.map(f=>h.jsx($n,{value:f.value,children:f.label},f.value))})]})]}),h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"steps",className:"text-slate-300",children:"Training Steps"}),h.jsx(mr,{id:"steps",value:t.steps,onChange:f=>{f!==void 0&&e("steps",f)},className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]}),h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"batch_size",className:"text-slate-300",children:"Batch Size"}),h.jsx(mr,{id:"batch_size",value:t.batch_size,onChange:f=>{f!==void 0&&e("batch_size",f)},className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]}),h.jsxs("div",{className:"flex items-center space-x-3 pt-6",children:[h.jsx(Zo,{id:"wandb_enable",checked:t.wandb_enable,onCheckedChange:d,className:"data-[state=checked]:bg-green-500"}),h.jsx(Tt,{htmlFor:"wandb_enable",className:"text-slate-300",children:"Enable Weights & Biases"})]})]}),h.jsx(kce,{open:a,onOpenChange:s,installHint:l}),t.wandb_enable&&h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"wandb_project",className:"text-slate-300",children:"W&B Project Name"}),h.jsx(hi,{id:"wandb_project",value:t.wandb_project||"",onChange:f=>e("wandb_project",f.target.value||void 0),placeholder:"my-robotics-project",className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]})]})]})},wu=({children:t})=>h.jsx("h4",{className:"text-xs font-semibold text-slate-400 uppercase tracking-wider",children:t}),Uce=({config:t,updateConfig:e})=>{const[n,r]=_.useState(!1),i=Dz(t.policy_type);return h.jsxs(Gr,{className:"bg-slate-800/50 border-slate-700 rounded-xl",children:[h.jsxs(jo,{role:"button",tabIndex:0,"aria-expanded":n,onClick:()=>r(o=>!o),onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),r(a=>!a))},className:"cursor-pointer select-none flex flex-row items-center justify-between",children:[h.jsx("span",{className:"text-white font-semibold",children:"Advanced"}),h.jsxs("span",{className:"flex items-center gap-1 text-slate-400 text-sm",children:[n?h.jsx(hc,{className:"w-4 h-4"}):h.jsx(bp,{className:"w-4 h-4"}),n?"Hide":"Show"]})]}),n&&h.jsxs(Wr,{className:"space-y-8",children:[h.jsxs("section",{className:"space-y-4",children:[h.jsx(wu,{children:"Policy"}),h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"policy_device",className:"text-slate-300",children:"Device"}),h.jsxs(Ga,{value:t.policy_device||"cuda",onValueChange:o=>e("policy_device",o),children:[h.jsx(sa,{id:"policy_device",className:"bg-slate-900 border-slate-600 text-white rounded-lg",children:h.jsx(Wa,{})}),h.jsxs(la,{className:"bg-slate-800 border-slate-600 text-white",children:[h.jsx($n,{value:"cuda",children:"CUDA (GPU)"}),h.jsx($n,{value:"cpu",children:"CPU"}),h.jsx($n,{value:"mps",children:"MPS (Apple Silicon)"})]})]})]}),h.jsxs("div",{className:"flex items-center space-x-3 pt-6",children:[h.jsx(Zo,{id:"policy_use_amp",checked:t.policy_use_amp,onCheckedChange:o=>e("policy_use_amp",o)}),h.jsx(Tt,{htmlFor:"policy_use_amp",className:"text-slate-300",children:"Use Automatic Mixed Precision"})]}),i.dtype&&h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"policy_dtype",className:"text-slate-300",children:"Policy dtype"}),h.jsxs(Ga,{value:t.policy_dtype||"default",onValueChange:o=>e("policy_dtype",o==="default"?void 0:o),children:[h.jsx(sa,{id:"policy_dtype",className:"bg-slate-900 border-slate-600 text-white rounded-lg",children:h.jsx(Wa,{})}),h.jsxs(la,{className:"bg-slate-800 border-slate-600 text-white",children:[h.jsx($n,{value:"default",children:"Policy default"}),h.jsx($n,{value:"bfloat16",children:"bfloat16"}),h.jsx($n,{value:"float32",children:"float32"})]})]})]}),i.gradientCheckpointing&&h.jsxs("div",{className:"flex items-center space-x-3 pt-6",children:[h.jsx(Zo,{id:"policy_gradient_checkpointing",checked:!!t.policy_gradient_checkpointing,onCheckedChange:o=>e("policy_gradient_checkpointing",o)}),h.jsx(Tt,{htmlFor:"policy_gradient_checkpointing",className:"text-slate-300",children:"Gradient checkpointing"})]}),i.freezeVisionEncoder&&h.jsxs("div",{className:"flex items-center space-x-3 pt-6",children:[h.jsx(Zo,{id:"policy_freeze_vision_encoder",checked:!!t.policy_freeze_vision_encoder,onCheckedChange:o=>e("policy_freeze_vision_encoder",o)}),h.jsx(Tt,{htmlFor:"policy_freeze_vision_encoder",className:"text-slate-300",children:"Freeze vision encoder"})]}),i.trainExpertOnly&&h.jsxs("div",{className:"flex items-center space-x-3 pt-6",children:[h.jsx(Zo,{id:"policy_train_expert_only",checked:!!t.policy_train_expert_only,onCheckedChange:o=>e("policy_train_expert_only",o)}),h.jsx(Tt,{htmlFor:"policy_train_expert_only",className:"text-slate-300",children:"Train expert only"})]})]})]}),h.jsx(Jl,{className:"bg-slate-700"}),h.jsxs("section",{className:"space-y-4",children:[h.jsx(wu,{children:"Training"}),h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"seed",className:"text-slate-300",children:"Random Seed"}),h.jsx(mr,{id:"seed",value:t.seed,onChange:o=>e("seed",o),className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]}),h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"num_workers",className:"text-slate-300",children:"Number of Workers"}),h.jsx(mr,{id:"num_workers",value:t.num_workers,onChange:o=>{o!==void 0&&e("num_workers",o)},className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]})]})]}),h.jsx(Jl,{className:"bg-slate-700"}),h.jsxs("section",{className:"space-y-4",children:[h.jsx(wu,{children:"Optimizer"}),h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"optimizer_type",className:"text-slate-300",children:"Optimizer"}),h.jsxs(Ga,{value:t.optimizer_type||"adam",onValueChange:o=>e("optimizer_type",o),children:[h.jsx(sa,{id:"optimizer_type",className:"bg-slate-900 border-slate-600 text-white rounded-lg",children:h.jsx(Wa,{})}),h.jsxs(la,{className:"bg-slate-800 border-slate-600 text-white",children:[h.jsx($n,{value:"adam",children:"Adam"}),h.jsx($n,{value:"adamw",children:"AdamW"}),h.jsx($n,{value:"sgd",children:"SGD"}),h.jsx($n,{value:"multi_adam",children:"Multi Adam"})]})]})]}),h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"optimizer_lr",className:"text-slate-300",children:"Learning Rate"}),h.jsx(mr,{id:"optimizer_lr",integer:!1,step:"0.0001",value:t.optimizer_lr,onChange:o=>e("optimizer_lr",o),placeholder:"Use policy default",className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]}),h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"optimizer_weight_decay",className:"text-slate-300",children:"Weight Decay"}),h.jsx(mr,{id:"optimizer_weight_decay",integer:!1,step:"0.0001",value:t.optimizer_weight_decay,onChange:o=>e("optimizer_weight_decay",o),placeholder:"Use policy default",className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]}),h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"optimizer_grad_clip_norm",className:"text-slate-300",children:"Gradient Clipping"}),h.jsx(mr,{id:"optimizer_grad_clip_norm",integer:!1,step:"0.0001",value:t.optimizer_grad_clip_norm,onChange:o=>e("optimizer_grad_clip_norm",o),placeholder:"Use policy default",className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]})]})]}),h.jsx(Jl,{className:"bg-slate-700"}),h.jsxs("section",{className:"space-y-4",children:[h.jsx(wu,{children:"Logging & Checkpointing"}),h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"log_freq",className:"text-slate-300",children:"Log Frequency"}),h.jsx(mr,{id:"log_freq",value:t.log_freq,onChange:o=>{o!==void 0&&e("log_freq",o)},className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]}),h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"save_freq",className:"text-slate-300",children:"Save Frequency"}),h.jsx(mr,{id:"save_freq",value:t.save_freq,onChange:o=>{o!==void 0&&e("save_freq",o)},className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]})]}),h.jsxs("div",{className:"flex items-center space-x-3",children:[h.jsx(Zo,{id:"save_checkpoint",checked:t.save_checkpoint,onCheckedChange:o=>e("save_checkpoint",o)}),h.jsx(Tt,{htmlFor:"save_checkpoint",className:"text-slate-300",children:"Save Checkpoints"})]}),h.jsxs("div",{className:"flex items-center space-x-3",children:[h.jsx(Zo,{id:"resume",checked:t.resume,onCheckedChange:o=>e("resume",o)}),h.jsx(Tt,{htmlFor:"resume",className:"text-slate-300",children:"Resume from Checkpoint"})]})]}),t.wandb_enable&&h.jsxs(h.Fragment,{children:[h.jsx(Jl,{className:"bg-slate-700"}),h.jsxs("section",{className:"space-y-4",children:[h.jsx(wu,{children:"Weights & Biases"}),h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"wandb_entity",className:"text-slate-300",children:"W&B Entity (optional)"}),h.jsx(hi,{id:"wandb_entity",value:t.wandb_entity||"",onChange:o=>e("wandb_entity",o.target.value||void 0),placeholder:"your-username",className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]}),h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"wandb_notes",className:"text-slate-300",children:"W&B Notes (optional)"}),h.jsx(hi,{id:"wandb_notes",value:t.wandb_notes||"",onChange:o=>e("wandb_notes",o.target.value||void 0),placeholder:"Training run notes...",className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]}),h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"wandb_mode",className:"text-slate-300",children:"W&B Mode"}),h.jsxs(Ga,{value:t.wandb_mode||"online",onValueChange:o=>e("wandb_mode",o),children:[h.jsx(sa,{id:"wandb_mode",className:"bg-slate-900 border-slate-600 text-white rounded-lg",children:h.jsx(Wa,{})}),h.jsxs(la,{className:"bg-slate-800 border-slate-600 text-white",children:[h.jsx($n,{value:"online",children:"Online"}),h.jsx($n,{value:"offline",children:"Offline"}),h.jsx($n,{value:"disabled",children:"Disabled"})]})]})]}),h.jsxs("div",{className:"flex items-center space-x-3",children:[h.jsx(Zo,{id:"wandb_disable_artifact",checked:t.wandb_disable_artifact,onCheckedChange:o=>e("wandb_disable_artifact",o)}),h.jsx(Tt,{htmlFor:"wandb_disable_artifact",className:"text-slate-300",children:"Disable Artifacts"})]})]})]}),!t.wandb_enable&&h.jsx(Jl,{className:"bg-slate-700"}),h.jsxs("section",{className:"space-y-4",children:[h.jsx(wu,{children:"Misc"}),h.jsxs("div",{className:"flex items-center space-x-3",children:[h.jsx(Zo,{id:"use_policy_training_preset",checked:t.use_policy_training_preset,onCheckedChange:o=>e("use_policy_training_preset",o)}),h.jsx(Tt,{htmlFor:"use_policy_training_preset",className:"text-slate-300",children:"Use Policy Training Preset"})]})]})]})]})},Fce=(t,e)=>`$${(e==="minute"?t*60:t).toFixed(2)}/hr`,Bce=t=>{const e=t.accelerator;if(!e)return{manufacturer:"",model:t.cpu||t.pretty_name||t.name};if(typeof e=="string")return{manufacturer:/nvidia/i.test(e)?"":"Nvidia",model:e};const n=String(e.quantity??"").trim(),r=n&&n!=="1"?`${n}x `:"";return{manufacturer:e.manufacturer||"",model:`${r}${e.model||t.pretty_name||t.name}`}},$ce=t=>{const{manufacturer:e,model:n}=Bce(t);return[e,n].filter(Boolean).join(" ")},dh=(t,e)=>`${t} ${$ce(e)} - ${Fce(e.unit_cost_usd,e.unit_label)}`,M2=t=>{const e=[t.cpu,t.ram].filter(Boolean);return e.length>0?e.join(" ยท "):t.pretty_name},Bl="seeed_cloud",zce=({config:t,updateConfig:e,authenticated:n,flavors:r,providers:i,loading:o,seeedConnecting:a,onConnectSeeedCloud:s})=>{const l=t.target,[c,u]=_.useState(!1),[d,f]=_.useState(!0),[p,y]=_.useState({[Bl]:!0}),v=_.useMemo(()=>i??[],[i]),g=_.useMemo(()=>r??[],[r]),m=v.find(A=>A.id===Bl),x=v.map(A=>({...A,open:p[A.id]??A.id===Bl,label:A.id===Bl?"Seeed Cloud":A.display_name})),b=_.useMemo(()=>{if(l.runner==="local")return"Local - your machine";if(l.runner==="hf_cloud"){const C=g.find(P=>P.name===l.flavor);return C?dh("HF",C):"Hugging Face"}if(l.runner==="seeed_cloud"){const C=m==null?void 0:m.flavors.find(P=>P.name===l.flavor);return C?dh("Seeed",C):"Seeed Cloud"}const A=v.find(C=>C.id===l.provider),M=A==null?void 0:A.flavors.find(C=>C.name===l.flavor);return M?dh((A==null?void 0:A.display_name)??"External",M):(A==null?void 0:A.display_name)??"External"},[g,v,m,l]),S=A=>{if(A==="local")e("target",{runner:"local"});else if(A.startsWith("hf:")){const M=A.slice(3);e("target",{runner:"hf_cloud",flavor:M})}else if(A.startsWith("seeed:")){const M=A.slice(6);e("target",{runner:"seeed_cloud",flavor:M})}else if(A.startsWith("external:")){const[,M,C]=A.split(":");e("target",{runner:"external",provider:M,flavor:C})}u(!1)},w=l.runner==="local"?"local":l.runner==="hf_cloud"?`hf:${l.flavor??""}`:l.runner==="seeed_cloud"?`seeed:${l.flavor??""}`:`external:${l.provider}:${l.flavor??""}`,E=(A,M,C,P)=>h.jsxs("button",{type:"button",disabled:P,onClick:()=>S(A),className:He("flex min-h-10 w-full items-center gap-3 rounded-md px-3 py-2 text-left text-sm transition-colors","hover:bg-slate-700/80 focus:bg-slate-700/80 focus:outline-none",P&&"cursor-not-allowed opacity-45 hover:bg-transparent"),children:[h.jsx(xl,{className:He("h-4 w-4 shrink-0 text-emerald-300",w===A?"opacity-100":"opacity-0")}),h.jsxs("span",{className:"min-w-0 flex-1",children:[h.jsx("span",{className:"block truncate text-slate-100",children:M}),C?h.jsx("span",{className:"block truncate text-xs text-slate-500",children:C}):null]})]},A),T=(A,M)=>{y(C=>({...C,[A]:M}))};return h.jsxs(Gr,{className:"bg-slate-800/50 border-slate-700 rounded-xl",children:[h.jsx(jo,{children:h.jsx(ga,{className:"text-white",children:"Compute target"})}),h.jsx(Wr,{className:"space-y-3",children:h.jsxs("div",{children:[h.jsx(Tt,{className:"text-slate-300",children:"Run training on"}),h.jsxs(Sx,{open:c,onOpenChange:u,children:[h.jsx(Ex,{asChild:!0,children:h.jsxs(et,{type:"button",variant:"outline",className:"mt-1 flex h-11 w-full justify-between border-slate-600 bg-slate-900 px-3 text-left text-white hover:bg-slate-900 hover:text-white",children:[h.jsx("span",{className:"min-w-0 flex-1 truncate",children:o?"Loading...":b}),h.jsx(hc,{className:"ml-3 h-4 w-4 shrink-0 text-slate-400"})]})}),h.jsx(Rm,{align:"start",className:"w-[min(560px,calc(100vw-2rem))] border-slate-700 bg-slate-800 p-2 text-white shadow-xl",children:h.jsxs("div",{className:"max-h-[440px] overflow-y-auto pr-1",children:[E("local","Local - your machine","Free",!1),h.jsxs(Ty,{open:d,onOpenChange:f,children:[h.jsxs(My,{className:"mt-1 flex h-10 w-full items-center gap-2 rounded-md px-3 text-left text-sm text-slate-200 hover:bg-slate-700/70",children:[d?h.jsx(hc,{className:"h-4 w-4 text-slate-400"}):h.jsx(bp,{className:"h-4 w-4 text-slate-400"}),h.jsx("span",{className:"font-medium",children:"Hugging Face"}),h.jsx(w1,{variant:"outline",className:"ml-auto border-slate-600 text-slate-300",children:n?`${g.length} flavors`:"Login required"})]}),h.jsx(Ay,{className:"ml-3 border-l border-slate-700 pl-2",children:n&&g.length>0?g.map(A=>E(`hf:${A.name}`,dh("HF",A),M2(A),!1)):h.jsx("div",{className:"px-8 py-3 text-xs text-slate-500",children:n?"No HF hardware flavors available.":"Log in to HF to unlock official flavors."})})]}),x.map(A=>h.jsxs(Ty,{open:A.open,onOpenChange:M=>T(A.id,M),children:[h.jsxs(My,{className:"mt-1 flex h-10 w-full items-center gap-2 rounded-md px-3 text-left text-sm text-slate-200 hover:bg-slate-700/70",children:[A.open?h.jsx(hc,{className:"h-4 w-4 text-slate-400"}):h.jsx(bp,{className:"h-4 w-4 text-slate-400"}),h.jsx("span",{className:"font-medium",children:A.label}),h.jsx(w1,{variant:"outline",className:He("ml-auto border-slate-600 text-slate-300",A.authenticated&&"border-emerald-500/50 text-emerald-200"),children:A.authenticated?`Connected ยท ${A.flavors.length} flavors`:"Connect required"})]}),h.jsxs(Ay,{className:"ml-3 border-l border-slate-700 pl-2",children:[!A.authenticated&&A.id===Bl?h.jsxs("div",{className:"flex items-center justify-between gap-3 px-3 py-2",children:[h.jsx("span",{className:"text-xs text-slate-500",children:"Connect to unlock Seeed Cloud flavors."}),h.jsxs(et,{type:"button",size:"sm",variant:"outline",disabled:a,onClick:s,className:"h-8 shrink-0 border-amber-400/60 bg-slate-900 text-amber-100 hover:bg-amber-500/20",children:[a?h.jsx(fi,{className:"mr-2 h-4 w-4 animate-spin"}):h.jsx(tX,{className:"mr-2 h-4 w-4"}),"Connect"]})]}):null,A.flavors.length>0?A.flavors.map(M=>{const C=A.id===Bl?"Seeed":A.display_name,P=A.id===Bl?`seeed:${M.name}`:`external:${A.id}:${M.name}`;return E(P,dh(C,M),M2(M),!A.authenticated)}):h.jsx("div",{className:"px-8 py-3 text-xs text-slate-500",children:"No flavors available."})]})]},A.id))]})})]}),h.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Cost shown is per running hour. Final policy uploads to your HF account when training completes."})]})})]})},Hce=({config:t,updateConfig:e,datasets:n,datasetsLoading:r,authenticated:i,flavors:o,providers:a,hardwareLoading:s,seeedConnecting:l,onConnectSeeedCloud:c})=>h.jsxs("div",{className:"max-w-3xl mx-auto space-y-6",children:[h.jsx(zce,{config:t,updateConfig:e,authenticated:i,flavors:o,providers:a,loading:s,seeedConnecting:l,onConnectSeeedCloud:c}),h.jsx(jce,{config:t,updateConfig:e,datasets:n,datasetsLoading:r}),h.jsx(Uce,{config:t,updateConfig:e})]});var Vce=Array.isArray,yi=Vce,Gce=typeof Qm=="object"&&Qm&&Qm.Object===Object&&Qm,Wz=Gce,Wce=Wz,Xce=typeof self=="object"&&self&&self.Object===Object&&self,qce=Wce||Xce||Function("return this")(),Ta=qce,Kce=Ta,Yce=Kce.Symbol,Fm=Yce,A2=Fm,Xz=Object.prototype,Jce=Xz.hasOwnProperty,Zce=Xz.toString,fh=A2?A2.toStringTag:void 0;function Qce(t){var e=Jce.call(t,fh),n=t[fh];try{t[fh]=void 0;var r=!0}catch{}var i=Zce.call(t);return r&&(e?t[fh]=n:delete t[fh]),i}var eue=Qce,tue=Object.prototype,nue=tue.toString;function rue(t){return nue.call(t)}var iue=rue,C2=Fm,oue=eue,aue=iue,sue="[object Null]",lue="[object Undefined]",P2=C2?C2.toStringTag:void 0;function cue(t){return t==null?t===void 0?lue:sue:P2&&P2 in Object(t)?oue(t):aue(t)}var hs=cue;function uue(t){return t!=null&&typeof t=="object"}var ps=uue,due=hs,fue=ps,hue="[object Symbol]";function pue(t){return typeof t=="symbol"||fue(t)&&due(t)==hue}var Cf=pue,mue=yi,gue=Cf,vue=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,yue=/^\w*$/;function xue(t,e){if(mue(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||gue(t)?!0:yue.test(t)||!vue.test(t)||e!=null&&t in Object(e)}var bC=xue;function bue(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Cl=bue;const Pf=dn(Cl);var _ue=hs,wue=Cl,Sue="[object AsyncFunction]",Eue="[object Function]",Tue="[object GeneratorFunction]",Mue="[object Proxy]";function Aue(t){if(!wue(t))return!1;var e=_ue(t);return e==Eue||e==Tue||e==Sue||e==Mue}var _C=Aue;const jt=dn(_C);var Cue=Ta,Pue=Cue["__core-js_shared__"],Rue=Pue,jw=Rue,R2=function(){var t=/[^.]+$/.exec(jw&&jw.keys&&jw.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Nue(t){return!!R2&&R2 in t}var Oue=Nue,Iue=Function.prototype,Due=Iue.toString;function Lue(t){if(t!=null){try{return Due.call(t)}catch{}try{return t+""}catch{}}return""}var qz=Lue,kue=_C,jue=Oue,Uue=Cl,Fue=qz,Bue=/[\\^$.*+?()[\]{}|]/g,$ue=/^\[object .+?Constructor\]$/,zue=Function.prototype,Hue=Object.prototype,Vue=zue.toString,Gue=Hue.hasOwnProperty,Wue=RegExp("^"+Vue.call(Gue).replace(Bue,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Xue(t){if(!Uue(t)||jue(t))return!1;var e=kue(t)?Wue:$ue;return e.test(Fue(t))}var que=Xue;function Kue(t,e){return t==null?void 0:t[e]}var Yue=Kue,Jue=que,Zue=Yue;function Que(t,e){var n=Zue(t,e);return Jue(n)?n:void 0}var qc=Que,ede=qc,tde=ede(Object,"create"),rb=tde,N2=rb;function nde(){this.__data__=N2?N2(null):{},this.size=0}var rde=nde;function ide(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var ode=ide,ade=rb,sde="__lodash_hash_undefined__",lde=Object.prototype,cde=lde.hasOwnProperty;function ude(t){var e=this.__data__;if(ade){var n=e[t];return n===sde?void 0:n}return cde.call(e,t)?e[t]:void 0}var dde=ude,fde=rb,hde=Object.prototype,pde=hde.hasOwnProperty;function mde(t){var e=this.__data__;return fde?e[t]!==void 0:pde.call(e,t)}var gde=mde,vde=rb,yde="__lodash_hash_undefined__";function xde(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=vde&&e===void 0?yde:e,this}var bde=xde,_de=rde,wde=ode,Sde=dde,Ede=gde,Tde=bde;function Rf(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e-1}var zde=$de,Hde=ib;function Vde(t,e){var n=this.__data__,r=Hde(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var Gde=Vde,Wde=Cde,Xde=kde,qde=Fde,Kde=zde,Yde=Gde;function Nf(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e0?1:-1},tc=function(e){return Dc(e)&&e.indexOf("%")===e.length-1},ze=function(e){return ghe(e)&&!Bm(e)},Yn=function(e){return ze(e)||Dc(e)},bhe=0,$m=function(e){var n=++bhe;return"".concat(e||"").concat(n)},Lc=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!ze(e)&&!Dc(e))return r;var o;if(tc(e)){var a=e.indexOf("%");o=n*parseFloat(e.slice(0,a))/100}else o=+e;return Bm(o)&&(o=r),i&&o>n&&(o=n),o},Cu=function(e){if(!e)return null;var n=Object.keys(e);return n&&n.length?e[n[0]]:null},_he=function(e){if(!Array.isArray(e))return!1;for(var n=e.length,r={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Che(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function P1(t){"@babel/helpers - typeof";return P1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},P1(t)}var U2={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Za=function(e){return typeof e=="string"?e:e?e.displayName||e.name||"Component":""},F2=null,Fw=null,NC=function t(e){if(e===F2&&Array.isArray(Fw))return Fw;var n=[];return _.Children.forEach(e,function(r){Ut(r)||(dhe.isFragment(r)?n=n.concat(t(r.props.children)):n.push(r))}),Fw=n,F2=e,n};function ro(t,e){var n=[],r=[];return Array.isArray(e)?r=e.map(function(i){return Za(i)}):r=[Za(e)],NC(t).forEach(function(i){var o=no(i,"type.displayName")||no(i,"type.name");r.indexOf(o)!==-1&&n.push(i)}),n}function Ei(t,e){var n=ro(t,e);return n&&n[0]}var B2=function(e){if(!e||!e.props)return!1;var n=e.props,r=n.width,i=n.height;return!(!ze(r)||r<=0||!ze(i)||i<=0)},Phe=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],Rhe=function(e){return e&&e.type&&Dc(e.type)&&Phe.indexOf(e.type)>=0},Nhe=function(e){return e&&P1(e)==="object"&&"clipDot"in e},Ohe=function(e,n,r,i){var o,a=(o=Uw==null?void 0:Uw[i])!==null&&o!==void 0?o:[];return n.startsWith("data-")||!jt(e)&&(i&&a.includes(n)||Ehe.includes(n))||r&&RC.includes(n)},$t=function(e,n,r){if(!e||typeof e=="function"||typeof e=="boolean")return null;var i=e;if(_.isValidElement(e)&&(i=e.props),!Pf(i))return null;var o={};return Object.keys(i).forEach(function(a){var s;Ohe((s=i)===null||s===void 0?void 0:s[a],a,n,r)&&(o[a]=i[a])}),o},R1=function t(e,n){if(e===n)return!0;var r=_.Children.count(e);if(r!==_.Children.count(n))return!1;if(r===0)return!0;if(r===1)return $2(Array.isArray(e)?e[0]:e,Array.isArray(n)?n[0]:n);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function jhe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function O1(t){var e=t.children,n=t.width,r=t.height,i=t.viewBox,o=t.className,a=t.style,s=t.title,l=t.desc,c=khe(t,Lhe),u=i||{width:n,height:r,x:0,y:0},d=zt("recharts-surface",o);return Z.createElement("svg",N1({},$t(c,!0,"svg"),{className:d,width:n,height:r,style:a,viewBox:"".concat(u.x," ").concat(u.y," ").concat(u.width," ").concat(u.height)}),Z.createElement("title",null,s),Z.createElement("desc",null,l),e)}var Uhe=["children","className"];function I1(){return I1=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Bhe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}var kn=Z.forwardRef(function(t,e){var n=t.children,r=t.className,i=Fhe(t,Uhe),o=zt("recharts-layer",r);return Z.createElement("g",I1({className:o},$t(i,!0),{ref:e}),n)}),vc=function(e,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;oi?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(i);++r=r?t:Hhe(t,e,n)}var Ghe=Vhe,Whe="\\ud800-\\udfff",Xhe="\\u0300-\\u036f",qhe="\\ufe20-\\ufe2f",Khe="\\u20d0-\\u20ff",Yhe=Xhe+qhe+Khe,Jhe="\\ufe0e\\ufe0f",Zhe="\\u200d",Qhe=RegExp("["+Zhe+Whe+Yhe+Jhe+"]");function epe(t){return Qhe.test(t)}var i5=epe;function tpe(t){return t.split("")}var npe=tpe,o5="\\ud800-\\udfff",rpe="\\u0300-\\u036f",ipe="\\ufe20-\\ufe2f",ope="\\u20d0-\\u20ff",ape=rpe+ipe+ope,spe="\\ufe0e\\ufe0f",lpe="["+o5+"]",D1="["+ape+"]",L1="\\ud83c[\\udffb-\\udfff]",cpe="(?:"+D1+"|"+L1+")",a5="[^"+o5+"]",s5="(?:\\ud83c[\\udde6-\\uddff]){2}",l5="[\\ud800-\\udbff][\\udc00-\\udfff]",upe="\\u200d",c5=cpe+"?",u5="["+spe+"]?",dpe="(?:"+upe+"(?:"+[a5,s5,l5].join("|")+")"+u5+c5+")*",fpe=u5+c5+dpe,hpe="(?:"+[a5+D1+"?",D1,s5,l5,lpe].join("|")+")",ppe=RegExp(L1+"(?="+L1+")|"+hpe+fpe,"g");function mpe(t){return t.match(ppe)||[]}var gpe=mpe,vpe=npe,ype=i5,xpe=gpe;function bpe(t){return ype(t)?xpe(t):vpe(t)}var _pe=bpe,wpe=Ghe,Spe=i5,Epe=_pe,Tpe=Zz;function Mpe(t){return function(e){e=Tpe(e);var n=Spe(e)?Epe(e):void 0,r=n?n[0]:e.charAt(0),i=n?wpe(n,1).join(""):e.slice(1);return r[t]()+i}}var Ape=Mpe,Cpe=Ape,Ppe=Cpe("toUpperCase"),Rpe=Ppe;const yb=dn(Rpe);function mn(t){return function(){return t}}const d5=Math.cos,By=Math.sin,Ko=Math.sqrt,$y=Math.PI,xb=2*$y,k1=Math.PI,j1=2*k1,Gl=1e-6,Npe=j1-Gl;function f5(t){this._+=t[0];for(let e=1,n=t.length;e=0))throw new Error(`invalid digits: ${t}`);if(e>15)return f5;const n=10**e;return function(r){this._+=r[0];for(let i=1,o=r.length;iGl)if(!(Math.abs(d*l-c*u)>Gl)||!o)this._append`L${this._x1=e},${this._y1=n}`;else{let p=r-a,y=i-s,v=l*l+c*c,g=p*p+y*y,m=Math.sqrt(v),x=Math.sqrt(f),b=o*Math.tan((k1-Math.acos((v+f-g)/(2*m*x)))/2),S=b/x,w=b/m;Math.abs(S-1)>Gl&&this._append`L${e+S*u},${n+S*d}`,this._append`A${o},${o},0,0,${+(d*p>u*y)},${this._x1=e+w*l},${this._y1=n+w*c}`}}arc(e,n,r,i,o,a){if(e=+e,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(i),l=r*Math.sin(i),c=e+s,u=n+l,d=1^a,f=a?i-o:o-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>Gl||Math.abs(this._y1-u)>Gl)&&this._append`L${c},${u}`,r&&(f<0&&(f=f%j1+j1),f>Npe?this._append`A${r},${r},0,1,${d},${e-s},${n-l}A${r},${r},0,1,${d},${this._x1=c},${this._y1=u}`:f>Gl&&this._append`A${r},${r},0,${+(f>=k1)},${d},${this._x1=e+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(e,n,r,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function OC(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(n==null)e=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);e=r}return t},()=>new Ipe(e)}function IC(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function h5(t){this._context=t}h5.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function bb(t){return new h5(t)}function p5(t){return t[0]}function m5(t){return t[1]}function g5(t,e){var n=mn(!0),r=null,i=bb,o=null,a=OC(s);t=typeof t=="function"?t:t===void 0?p5:mn(t),e=typeof e=="function"?e:e===void 0?m5:mn(e);function s(l){var c,u=(l=IC(l)).length,d,f=!1,p;for(r==null&&(o=i(p=a())),c=0;c<=u;++c)!(c=p;--y)s.point(b[y],S[y]);s.lineEnd(),s.areaEnd()}m&&(b[f]=+t(g,f,d),S[f]=+e(g,f,d),s.point(r?+r(g,f,d):b[f],n?+n(g,f,d):S[f]))}if(x)return s=null,x+""||null}function u(){return g5().defined(i).curve(a).context(o)}return c.x=function(d){return arguments.length?(t=typeof d=="function"?d:mn(+d),r=null,c):t},c.x0=function(d){return arguments.length?(t=typeof d=="function"?d:mn(+d),c):t},c.x1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:mn(+d),c):r},c.y=function(d){return arguments.length?(e=typeof d=="function"?d:mn(+d),n=null,c):e},c.y0=function(d){return arguments.length?(e=typeof d=="function"?d:mn(+d),c):e},c.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:mn(+d),c):n},c.lineX0=c.lineY0=function(){return u().x(t).y(e)},c.lineY1=function(){return u().x(t).y(n)},c.lineX1=function(){return u().x(r).y(e)},c.defined=function(d){return arguments.length?(i=typeof d=="function"?d:mn(!!d),c):i},c.curve=function(d){return arguments.length?(a=d,o!=null&&(s=a(o)),c):a},c.context=function(d){return arguments.length?(d==null?o=s=null:s=a(o=d),c):o},c}class v5{constructor(e,n){this._context=e,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,n){switch(e=+e,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,n):this._context.moveTo(e,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,n,e,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,e,this._y0,e,n);break}}this._x0=e,this._y0=n}}function Dpe(t){return new v5(t,!0)}function Lpe(t){return new v5(t,!1)}const DC={draw(t,e){const n=Ko(e/$y);t.moveTo(n,0),t.arc(0,0,n,0,xb)}},kpe={draw(t,e){const n=Ko(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},y5=Ko(1/3),jpe=y5*2,Upe={draw(t,e){const n=Ko(e/jpe),r=n*y5;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},Fpe={draw(t,e){const n=Ko(e),r=-n/2;t.rect(r,r,n,n)}},Bpe=.8908130915292852,x5=By($y/10)/By(7*$y/10),$pe=By(xb/10)*x5,zpe=-d5(xb/10)*x5,Hpe={draw(t,e){const n=Ko(e*Bpe),r=$pe*n,i=zpe*n;t.moveTo(0,-n),t.lineTo(r,i);for(let o=1;o<5;++o){const a=xb*o/5,s=d5(a),l=By(a);t.lineTo(l*n,-s*n),t.lineTo(s*r-l*i,l*r+s*i)}t.closePath()}},Bw=Ko(3),Vpe={draw(t,e){const n=-Ko(e/(Bw*3));t.moveTo(0,n*2),t.lineTo(-Bw*n,-n),t.lineTo(Bw*n,-n),t.closePath()}},$i=-.5,zi=Ko(3)/2,U1=1/Ko(12),Gpe=(U1/2+1)*3,Wpe={draw(t,e){const n=Ko(e/Gpe),r=n/2,i=n*U1,o=r,a=n*U1+n,s=-o,l=a;t.moveTo(r,i),t.lineTo(o,a),t.lineTo(s,l),t.lineTo($i*r-zi*i,zi*r+$i*i),t.lineTo($i*o-zi*a,zi*o+$i*a),t.lineTo($i*s-zi*l,zi*s+$i*l),t.lineTo($i*r+zi*i,$i*i-zi*r),t.lineTo($i*o+zi*a,$i*a-zi*o),t.lineTo($i*s+zi*l,$i*l-zi*s),t.closePath()}};function Xpe(t,e){let n=null,r=OC(i);t=typeof t=="function"?t:mn(t||DC),e=typeof e=="function"?e:mn(e===void 0?64:+e);function i(){let o;if(n||(n=o=r()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),o)return n=null,o+""||null}return i.type=function(o){return arguments.length?(t=typeof o=="function"?o:mn(o),i):t},i.size=function(o){return arguments.length?(e=typeof o=="function"?o:mn(+o),i):e},i.context=function(o){return arguments.length?(n=o??null,i):n},i}function zy(){}function Hy(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function b5(t){this._context=t}b5.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Hy(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Hy(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function qpe(t){return new b5(t)}function _5(t){this._context=t}_5.prototype={areaStart:zy,areaEnd:zy,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:Hy(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Kpe(t){return new _5(t)}function w5(t){this._context=t}w5.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Hy(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Ype(t){return new w5(t)}function S5(t){this._context=t}S5.prototype={areaStart:zy,areaEnd:zy,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function Jpe(t){return new S5(t)}function H2(t){return t<0?-1:1}function V2(t,e,n){var r=t._x1-t._x0,i=e-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(n-t._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(H2(o)+H2(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function G2(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function $w(t,e,n){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,s=(o-r)/3;t._context.bezierCurveTo(r+s,i+s*e,o-s,a-s*n,o,a)}function Vy(t){this._context=t}Vy.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:$w(this,this._t0,G2(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,$w(this,G2(this,n=V2(this,t,e)),n);break;default:$w(this,this._t0,n=V2(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function E5(t){this._context=new T5(t)}(E5.prototype=Object.create(Vy.prototype)).point=function(t,e){Vy.prototype.point.call(this,e,t)};function T5(t){this._context=t}T5.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,o){this._context.bezierCurveTo(e,t,r,n,o,i)}};function Zpe(t){return new Vy(t)}function Qpe(t){return new E5(t)}function M5(t){this._context=t}M5.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),n===2)this._context.lineTo(t[1],e[1]);else for(var r=W2(t),i=W2(e),o=0,a=1;a=0;--e)i[e]=(a[e]-i[e+1])/o[e];for(o[n-1]=(t[n]+i[n-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}break}}this._x=t,this._y=e}};function tme(t){return new _b(t,.5)}function nme(t){return new _b(t,0)}function rme(t){return new _b(t,1)}function Hd(t,e){if((a=t.length)>1)for(var n=1,r,i,o=t[e[0]],a,s=o.length;n=0;)n[e]=e;return n}function ime(t,e){return t[e]}function ome(t){const e=[];return e.key=t,e}function ame(){var t=mn([]),e=F1,n=Hd,r=ime;function i(o){var a=Array.from(t.apply(this,arguments),ome),s,l=a.length,c=-1,u;for(const d of o)for(s=0,++c;s0){for(var n,r,i=0,o=t[0].length,a;i0){for(var n=0,r=t[e[0]],i,o=r.length;n0)||!((o=(i=t[e[0]]).length)>0))){for(var n=0,r=1,i,o,a;r=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function mme(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}var A5={symbolCircle:DC,symbolCross:kpe,symbolDiamond:Upe,symbolSquare:Fpe,symbolStar:Hpe,symbolTriangle:Vpe,symbolWye:Wpe},gme=Math.PI/180,vme=function(e){var n="symbol".concat(yb(e));return A5[n]||DC},yme=function(e,n,r){if(n==="area")return e;switch(r){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var i=18*gme;return 1.25*e*e*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},xme=function(e,n){A5["symbol".concat(yb(e))]=n},LC=function(e){var n=e.type,r=n===void 0?"circle":n,i=e.size,o=i===void 0?64:i,a=e.sizeType,s=a===void 0?"area":a,l=pme(e,ume),c=q2(q2({},l),{},{type:r,size:o,sizeType:s}),u=function(){var g=vme(r),m=Xpe().type(g).size(yme(o,s,r));return m()},d=c.className,f=c.cx,p=c.cy,y=$t(c,!0);return f===+f&&p===+p&&o===+o?Z.createElement("path",B1({},y,{className:zt("recharts-symbols",d),transform:"translate(".concat(f,", ").concat(p,")"),d:u()})):null};LC.registerSymbol=xme;function Vd(t){"@babel/helpers - typeof";return Vd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vd(t)}function $1(){return $1=Object.assign?Object.assign.bind():function(t){for(var e=1;e`);var x=p.inactive?c:p.color;return Z.createElement("li",$1({className:g,style:d,key:"legend-item-".concat(y)},Fy(r.props,p,y)),Z.createElement(O1,{width:a,height:a,viewBox:u,style:f},r.renderIcon(p)),Z.createElement("span",{className:"recharts-legend-item-text",style:{color:x}},v?v(m,p,y):m))})}},{key:"render",value:function(){var r=this.props,i=r.payload,o=r.layout,a=r.align;if(!i||!i.length)return null;var s={padding:0,margin:0,textAlign:o==="horizontal"?a:"left"};return Z.createElement("ul",{className:"recharts-default-legend",style:s},this.renderItems())}}])}(_.PureComponent);Dp(kC,"displayName","Legend");Dp(kC,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Pme=ob;function Rme(){this.__data__=new Pme,this.size=0}var Nme=Rme;function Ome(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}var Ime=Ome;function Dme(t){return this.__data__.get(t)}var Lme=Dme;function kme(t){return this.__data__.has(t)}var jme=kme,Ume=ob,Fme=SC,Bme=EC,$me=200;function zme(t,e){var n=this.__data__;if(n instanceof Ume){var r=n.__data__;if(!Fme||r.length<$me-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Bme(r)}return n.set(t,e),this.size=n.size,this}var Hme=zme,Vme=ob,Gme=Nme,Wme=Ime,Xme=Lme,qme=jme,Kme=Hme;function If(t){var e=this.__data__=new Vme(t);this.size=e.size}If.prototype.clear=Gme;If.prototype.delete=Wme;If.prototype.get=Xme;If.prototype.has=qme;If.prototype.set=Kme;var R5=If,Yme="__lodash_hash_undefined__";function Jme(t){return this.__data__.set(t,Yme),this}var Zme=Jme;function Qme(t){return this.__data__.has(t)}var ege=Qme,tge=EC,nge=Zme,rge=ege;function Wy(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new tge;++es))return!1;var c=o.get(t),u=o.get(e);if(c&&u)return c==e&&u==t;var d=-1,f=!0,p=n&uge?new age:void 0;for(o.set(t,e),o.set(e,t);++d-1&&t%1==0&&t-1&&t%1==0&&t<=pve}var BC=mve,gve=hs,vve=BC,yve=ps,xve="[object Arguments]",bve="[object Array]",_ve="[object Boolean]",wve="[object Date]",Sve="[object Error]",Eve="[object Function]",Tve="[object Map]",Mve="[object Number]",Ave="[object Object]",Cve="[object RegExp]",Pve="[object Set]",Rve="[object String]",Nve="[object WeakMap]",Ove="[object ArrayBuffer]",Ive="[object DataView]",Dve="[object Float32Array]",Lve="[object Float64Array]",kve="[object Int8Array]",jve="[object Int16Array]",Uve="[object Int32Array]",Fve="[object Uint8Array]",Bve="[object Uint8ClampedArray]",$ve="[object Uint16Array]",zve="[object Uint32Array]",bn={};bn[Dve]=bn[Lve]=bn[kve]=bn[jve]=bn[Uve]=bn[Fve]=bn[Bve]=bn[$ve]=bn[zve]=!0;bn[xve]=bn[bve]=bn[Ove]=bn[_ve]=bn[Ive]=bn[wve]=bn[Sve]=bn[Eve]=bn[Tve]=bn[Mve]=bn[Ave]=bn[Cve]=bn[Pve]=bn[Rve]=bn[Nve]=!1;function Hve(t){return yve(t)&&vve(t.length)&&!!bn[gve(t)]}var Vve=Hve;function Gve(t){return function(e){return t(e)}}var U5=Gve,qy={exports:{}};qy.exports;(function(t,e){var n=Wz,r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,o=i&&i.exports===r,a=o&&n.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||a&&a.binding&&a.binding("util")}catch{}}();t.exports=s})(qy,qy.exports);var Wve=qy.exports,Xve=Vve,qve=U5,tI=Wve,nI=tI&&tI.isTypedArray,Kve=nI?qve(nI):Xve,F5=Kve,Yve=Qge,Jve=UC,Zve=yi,Qve=j5,eye=FC,tye=F5,nye=Object.prototype,rye=nye.hasOwnProperty;function iye(t,e){var n=Zve(t),r=!n&&Jve(t),i=!n&&!r&&Qve(t),o=!n&&!r&&!i&&tye(t),a=n||r||i||o,s=a?Yve(t.length,String):[],l=s.length;for(var c in t)(e||rye.call(t,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||eye(c,l)))&&s.push(c);return s}var oye=iye,aye=Object.prototype;function sye(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||aye;return t===n}var lye=sye;function cye(t,e){return function(n){return t(e(n))}}var B5=cye,uye=B5,dye=uye(Object.keys,Object),fye=dye,hye=lye,pye=fye,mye=Object.prototype,gye=mye.hasOwnProperty;function vye(t){if(!hye(t))return pye(t);var e=[];for(var n in Object(t))gye.call(t,n)&&n!="constructor"&&e.push(n);return e}var yye=vye,xye=_C,bye=BC;function _ye(t){return t!=null&&bye(t.length)&&!xye(t)}var wb=_ye,wye=oye,Sye=yye,Eye=wb;function Tye(t){return Eye(t)?wye(t):Sye(t)}var $C=Tye,Mye=$ge,Aye=Jge,Cye=$C;function Pye(t){return Mye(t,Cye,Aye)}var Rye=Pye,rI=Rye,Nye=1,Oye=Object.prototype,Iye=Oye.hasOwnProperty;function Dye(t,e,n,r,i,o){var a=n&Nye,s=rI(t),l=s.length,c=rI(e),u=c.length;if(l!=u&&!a)return!1;for(var d=l;d--;){var f=s[d];if(!(a?f in e:Iye.call(e,f)))return!1}var p=o.get(t),y=o.get(e);if(p&&y)return p==e&&y==t;var v=!0;o.set(t,e),o.set(e,t);for(var g=a;++d-1}var Ixe=Oxe;function Dxe(t,e,n){for(var r=-1,i=t==null?0:t.length;++r=Kxe){var c=e?null:Xxe(t);if(c)return qxe(c);a=!1,i=Wxe,l=new Hxe}else l=e?[]:s;e:for(;++r=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function dbe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function fbe(t){return t.value}function hbe(t,e){if(Z.isValidElement(t))return Z.cloneElement(t,e);if(typeof t=="function")return Z.createElement(t,e);e.ref;var n=ube(e,nbe);return Z.createElement(kC,n)}var xI=1,hd=function(t){function e(){var n;rbe(this,e);for(var r=arguments.length,i=new Array(r),o=0;oxI||Math.abs(i.height-this.lastBoundingBox.height)>xI)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,r&&r(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?La({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var i=this.props,o=i.layout,a=i.align,s=i.verticalAlign,l=i.margin,c=i.chartWidth,u=i.chartHeight,d,f;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(a==="center"&&o==="vertical"){var p=this.getBBoxSnapshot();d={left:((c||0)-p.width)/2}}else d=a==="right"?{right:l&&l.right||0}:{left:l&&l.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(s==="middle"){var y=this.getBBoxSnapshot();f={top:((u||0)-y.height)/2}}else f=s==="bottom"?{bottom:l&&l.bottom||0}:{top:l&&l.top||0};return La(La({},d),f)}},{key:"render",value:function(){var r=this,i=this.props,o=i.content,a=i.width,s=i.height,l=i.wrapperStyle,c=i.payloadUniqBy,u=i.payload,d=La(La({position:"absolute",width:a||"auto",height:s||"auto"},this.getDefaultPosition(l)),l);return Z.createElement("div",{className:"recharts-legend-wrapper",style:d,ref:function(p){r.wrapperNode=p}},hbe(o,La(La({},this.props),{},{payload:W5(u,c,fbe)})))}}],[{key:"getWithHeight",value:function(r,i){var o=La(La({},this.defaultProps),r.props),a=o.layout;return a==="vertical"&&ze(r.props.height)?{height:r.props.height}:a==="horizontal"?{width:r.props.width||i}:null}}])}(_.PureComponent);Sb(hd,"displayName","Legend");Sb(hd,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var bI=Fm,pbe=UC,mbe=yi,_I=bI?bI.isConcatSpreadable:void 0;function gbe(t){return mbe(t)||pbe(t)||!!(_I&&t&&t[_I])}var vbe=gbe,ybe=L5,xbe=vbe;function K5(t,e,n,r,i){var o=-1,a=t.length;for(n||(n=xbe),i||(i=[]);++o0&&n(s)?e>1?K5(s,e-1,n,r,i):ybe(i,s):r||(i[i.length]=s)}return i}var Y5=K5;function bbe(t){return function(e,n,r){for(var i=-1,o=Object(e),a=r(e),s=a.length;s--;){var l=a[t?s:++i];if(n(o[l],l,o)===!1)break}return e}}var _be=bbe,wbe=_be,Sbe=wbe(),Ebe=Sbe,Tbe=Ebe,Mbe=$C;function Abe(t,e){return t&&Tbe(t,e,Mbe)}var J5=Abe,Cbe=wb;function Pbe(t,e){return function(n,r){if(n==null)return n;if(!Cbe(n))return t(n,r);for(var i=n.length,o=e?i:-1,a=Object(n);(e?o--:++oe||o&&a&&l&&!s&&!c||r&&a&&l||!n&&l||!i)return 1;if(!r&&!o&&!c&&t=s)return l;var c=n[r];return l*(c=="desc"?-1:1)}}return t.index-e.index}var Hbe=zbe,Gw=MC,Vbe=AC,Gbe=kf,Wbe=Z5,Xbe=Ube,qbe=U5,Kbe=Hbe,Ybe=Lf,Jbe=yi;function Zbe(t,e,n){e.length?e=Gw(e,function(o){return Jbe(o)?function(a){return Vbe(a,o.length===1?o[0]:o)}:o}):e=[Ybe];var r=-1;e=Gw(e,qbe(Gbe));var i=Wbe(t,function(o,a,s){var l=Gw(e,function(c){return c(o)});return{criteria:l,index:++r,value:o}});return Xbe(i,function(o,a){return Kbe(o,a,n)})}var Qbe=Zbe;function e_e(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var t_e=e_e,n_e=t_e,SI=Math.max;function r_e(t,e,n){return e=SI(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=SI(r.length-e,0),a=Array(o);++i0){if(++e>=h_e)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var v_e=g_e,y_e=f_e,x_e=v_e,b_e=x_e(y_e),__e=b_e,w_e=Lf,S_e=i_e,E_e=__e;function T_e(t,e){return E_e(S_e(t,e,w_e),t+"")}var M_e=T_e,A_e=wC,C_e=wb,P_e=FC,R_e=Cl;function N_e(t,e,n){if(!R_e(n))return!1;var r=typeof e;return(r=="number"?C_e(n)&&P_e(e,n.length):r=="string"&&e in n)?A_e(n[e],t):!1}var Eb=N_e,O_e=Y5,I_e=Qbe,D_e=M_e,TI=Eb,L_e=D_e(function(t,e){if(t==null)return[];var n=e.length;return n>1&&TI(t,e[0],e[1])?e=[]:n>2&&TI(e[0],e[1],e[2])&&(e=[e[0]]),I_e(t,O_e(e,1),[])}),k_e=L_e;const VC=dn(k_e);function Lp(t){"@babel/helpers - typeof";return Lp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Lp(t)}function K1(){return K1=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=e.x),"".concat(hh,"-left"),ze(n)&&e&&ze(e.x)&&n=e.y),"".concat(hh,"-top"),ze(r)&&e&&ze(e.y)&&rv?Math.max(u,l[r]):Math.max(d,l[r])}function J_e(t){var e=t.translateX,n=t.translateY,r=t.useTranslate3d;return{transform:r?"translate3d(".concat(e,"px, ").concat(n,"px, 0)"):"translate(".concat(e,"px, ").concat(n,"px)")}}function Z_e(t){var e=t.allowEscapeViewBox,n=t.coordinate,r=t.offsetTopLeft,i=t.position,o=t.reverseDirection,a=t.tooltipBox,s=t.useTranslate3d,l=t.viewBox,c,u,d;return a.height>0&&a.width>0&&n?(u=CI({allowEscapeViewBox:e,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:a.width,viewBox:l,viewBoxDimension:l.width}),d=CI({allowEscapeViewBox:e,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:a.height,viewBox:l,viewBoxDimension:l.height}),c=J_e({translateX:u,translateY:d,useTranslate3d:s})):c=K_e,{cssProperties:c,cssClasses:Y_e({translateX:u,translateY:d,coordinate:n})}}function Wd(t){"@babel/helpers - typeof";return Wd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Wd(t)}function PI(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 RI(t){for(var e=1;eNI||Math.abs(r.height-this.state.lastBoundingBox.height)>NI)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,i=this.props,o=i.active,a=i.allowEscapeViewBox,s=i.animationDuration,l=i.animationEasing,c=i.children,u=i.coordinate,d=i.hasPayload,f=i.isAnimationActive,p=i.offset,y=i.position,v=i.reverseDirection,g=i.useTranslate3d,m=i.viewBox,x=i.wrapperStyle,b=Z_e({allowEscapeViewBox:a,coordinate:u,offsetTopLeft:p,position:y,reverseDirection:v,tooltipBox:this.state.lastBoundingBox,useTranslate3d:g,viewBox:m}),S=b.cssClasses,w=b.cssProperties,E=RI(RI({transition:f&&o?"transform ".concat(s,"ms ").concat(l):void 0},w),{},{pointerEvents:"none",visibility:!this.state.dismissed&&o&&d?"visible":"hidden",position:"absolute",top:0,left:0},x);return Z.createElement("div",{tabIndex:-1,className:S,style:E,ref:function(A){r.wrapperNode=A}},c)}}])}(_.PureComponent),lwe=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},jf={isSsr:lwe()};function Xd(t){"@babel/helpers - typeof";return Xd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xd(t)}function OI(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 II(t){for(var e=1;e0;return Z.createElement(swe,{allowEscapeViewBox:a,animationDuration:s,animationEasing:l,isAnimationActive:f,active:o,coordinate:u,hasPayload:E,offset:p,position:g,reverseDirection:m,useTranslate3d:x,viewBox:b,wrapperStyle:S},ywe(c,II(II({},this.props),{},{payload:w})))}}])}(_.PureComponent);GC(So,"displayName","Tooltip");GC(So,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!jf.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var xwe=Ta,bwe=function(){return xwe.Date.now()},_we=bwe,wwe=/\s/;function Swe(t){for(var e=t.length;e--&&wwe.test(t.charAt(e)););return e}var Ewe=Swe,Twe=Ewe,Mwe=/^\s+/;function Awe(t){return t&&t.slice(0,Twe(t)+1).replace(Mwe,"")}var Cwe=Awe,Pwe=Cwe,DI=Cl,Rwe=Cf,LI=NaN,Nwe=/^[-+]0x[0-9a-f]+$/i,Owe=/^0b[01]+$/i,Iwe=/^0o[0-7]+$/i,Dwe=parseInt;function Lwe(t){if(typeof t=="number")return t;if(Rwe(t))return LI;if(DI(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=DI(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=Pwe(t);var n=Owe.test(t);return n||Iwe.test(t)?Dwe(t.slice(2),n?2:8):Nwe.test(t)?LI:+t}var iH=Lwe,kwe=Cl,Xw=_we,kI=iH,jwe="Expected a function",Uwe=Math.max,Fwe=Math.min;function Bwe(t,e,n){var r,i,o,a,s,l,c=0,u=!1,d=!1,f=!0;if(typeof t!="function")throw new TypeError(jwe);e=kI(e)||0,kwe(n)&&(u=!!n.leading,d="maxWait"in n,o=d?Uwe(kI(n.maxWait)||0,e):o,f="trailing"in n?!!n.trailing:f);function p(E){var T=r,A=i;return r=i=void 0,c=E,a=t.apply(A,T),a}function y(E){return c=E,s=setTimeout(m,e),u?p(E):a}function v(E){var T=E-l,A=E-c,M=e-T;return d?Fwe(M,o-A):M}function g(E){var T=E-l,A=E-c;return l===void 0||T>=e||T<0||d&&A>=o}function m(){var E=Xw();if(g(E))return x(E);s=setTimeout(m,v(E))}function x(E){return s=void 0,f&&r?p(E):(r=i=void 0,a)}function b(){s!==void 0&&clearTimeout(s),c=0,r=l=i=s=void 0}function S(){return s===void 0?a:x(Xw())}function w(){var E=Xw(),T=g(E);if(r=arguments,i=this,l=E,T){if(s===void 0)return y(l);if(d)return clearTimeout(s),s=setTimeout(m,e),p(l)}return s===void 0&&(s=setTimeout(m,e)),a}return w.cancel=b,w.flush=S,w}var $we=Bwe,zwe=$we,Hwe=Cl,Vwe="Expected a function";function Gwe(t,e,n){var r=!0,i=!0;if(typeof t!="function")throw new TypeError(Vwe);return Hwe(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),zwe(t,e,{leading:r,maxWait:e,trailing:i})}var Wwe=Gwe;const oH=dn(Wwe);function jp(t){"@babel/helpers - typeof";return jp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jp(t)}function jI(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 dv(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&(D=oH(D,v,{trailing:!0,leading:!1}));var k=new ResizeObserver(D),U=w.current.getBoundingClientRect(),O=U.width,W=U.height;return P(O,W),k.observe(w.current),function(){k.disconnect()}},[P,v]);var R=_.useMemo(function(){var D=M.containerWidth,k=M.containerHeight;if(D<0||k<0)return null;vc(tc(a)||tc(l),`The width(%s) and height(%s) are both fixed numbers, + maybe you don't need to use a ResponsiveContainer.`,a,l),vc(!n||n>0,"The aspect(%s) must be greater than zero.",n);var U=tc(a)?D:a,O=tc(l)?k:l;n&&n>0&&(U?O=U/n:O&&(U=O*n),f&&O>f&&(O=f)),vc(U>0||O>0,`The width(%s) and height(%s) of chart should be greater than 0, + please check the style of container, or the props width(%s) and height(%s), + or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the + height and width.`,U,O,a,l,u,d,n);var W=!Array.isArray(p)&&Za(p.type).endsWith("Chart");return Z.Children.map(p,function(L){return Z.isValidElement(L)?_.cloneElement(L,dv({width:U,height:O},W?{style:dv({height:"100%",width:"100%",maxHeight:O,maxWidth:U},L.props.style)}:{})):L})},[n,p,l,f,d,u,M,a]);return Z.createElement("div",{id:g?"".concat(g):void 0,className:zt("recharts-responsive-container",m),style:dv(dv({},S),{},{width:a,height:l,minWidth:u,minHeight:d,maxHeight:f}),ref:w},R)}),aH=function(e){return null};aH.displayName="Cell";function Up(t){"@babel/helpers - typeof";return Up=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Up(t)}function BI(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 Q1(t){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||jf.isSsr)return{width:0,height:0};var r=aSe(n),i=JSON.stringify({text:e,copyStyle:r});if(Su.widthCache[i])return Su.widthCache[i];try{var o=document.getElementById($I);o||(o=document.createElement("span"),o.setAttribute("id",$I),o.setAttribute("aria-hidden","true"),document.body.appendChild(o));var a=Q1(Q1({},oSe),r);Object.assign(o.style,a),o.textContent="".concat(e);var s=o.getBoundingClientRect(),l={width:s.width,height:s.height};return Su.widthCache[i]=l,++Su.cacheCount>iSe&&(Su.cacheCount=0,Su.widthCache={}),l}catch{return{width:0,height:0}}},sSe=function(e){return{top:e.top+window.scrollY-document.documentElement.clientTop,left:e.left+window.scrollX-document.documentElement.clientLeft}};function Fp(t){"@babel/helpers - typeof";return Fp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fp(t)}function Zy(t,e){return dSe(t)||uSe(t,e)||cSe(t,e)||lSe()}function lSe(){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 cSe(t,e){if(t){if(typeof t=="string")return zI(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zI(t,e)}}function zI(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function TSe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function qI(t,e){return PSe(t)||CSe(t,e)||ASe(t,e)||MSe()}function MSe(){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 ASe(t,e){if(t){if(typeof t=="string")return KI(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return KI(t,e)}}function KI(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&arguments[0]!==void 0?arguments[0]:[];return U.reduce(function(O,W){var L=W.word,j=W.width,X=O[O.length-1];if(X&&(i==null||o||X.width+j+rW.width?O:W})};if(!u)return p;for(var v="โ€ฆ",g=function(U){var O=d.slice(0,U),W=uH({breakAll:c,style:l,children:O+v}).wordsWithComputedWidth,L=f(W),j=L.length>a||y(L).width>Number(i);return[j,L]},m=0,x=d.length-1,b=0,S;m<=x&&b<=d.length-1;){var w=Math.floor((m+x)/2),E=w-1,T=g(E),A=qI(T,2),M=A[0],C=A[1],P=g(w),R=qI(P,1),D=R[0];if(!M&&!D&&(m=w+1),M&&D&&(x=w-1),!M&&D){S=C;break}b++}return S||p},YI=function(e){var n=Ut(e)?[]:e.toString().split(cH);return[{words:n}]},NSe=function(e){var n=e.width,r=e.scaleToFit,i=e.children,o=e.style,a=e.breakAll,s=e.maxLines;if((n||r)&&!jf.isSsr){var l,c,u=uH({breakAll:a,children:i,style:o});if(u){var d=u.wordsWithComputedWidth,f=u.spaceWidth;l=d,c=f}else return YI(i);return RSe({breakAll:a,children:i,maxLines:s,style:o},l,c,n,r)}return YI(i)},JI="#808080",Qy=function(e){var n=e.x,r=n===void 0?0:n,i=e.y,o=i===void 0?0:i,a=e.lineHeight,s=a===void 0?"1em":a,l=e.capHeight,c=l===void 0?"0.71em":l,u=e.scaleToFit,d=u===void 0?!1:u,f=e.textAnchor,p=f===void 0?"start":f,y=e.verticalAnchor,v=y===void 0?"end":y,g=e.fill,m=g===void 0?JI:g,x=XI(e,SSe),b=_.useMemo(function(){return NSe({breakAll:x.breakAll,children:x.children,maxLines:x.maxLines,scaleToFit:d,style:x.style,width:x.width})},[x.breakAll,x.children,x.maxLines,d,x.style,x.width]),S=x.dx,w=x.dy,E=x.angle,T=x.className,A=x.breakAll,M=XI(x,ESe);if(!Yn(r)||!Yn(o))return null;var C=r+(ze(S)?S:0),P=o+(ze(w)?w:0),R;switch(v){case"start":R=qw("calc(".concat(c,")"));break;case"middle":R=qw("calc(".concat((b.length-1)/2," * -").concat(s," + (").concat(c," / 2))"));break;default:R=qw("calc(".concat(b.length-1," * -").concat(s,")"));break}var D=[];if(d){var k=b[0].width,U=x.width;D.push("scale(".concat((ze(U)?U/k:1)/k,")"))}return E&&D.push("rotate(".concat(E,", ").concat(C,", ").concat(P,")")),D.length&&(M.transform=D.join(" ")),Z.createElement("text",eT({},$t(M,!0),{x:C,y:P,className:zt("recharts-text",T),textAnchor:p,fill:m.includes("url")?JI:m}),b.map(function(O,W){var L=O.words.join(A?"":" ");return Z.createElement("tspan",{x:C,dy:W===0?R:s,key:"".concat(L,"-").concat(W)},L)}))};function rl(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function OSe(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function WC(t){let e,n,r;t.length!==2?(e=rl,n=(s,l)=>rl(t(s),l),r=(s,l)=>t(s)-l):(e=t===rl||t===OSe?t:ISe,n=t,r=t);function i(s,l,c=0,u=s.length){if(c>>1;n(s[d],l)<0?c=d+1:u=d}while(c>>1;n(s[d],l)<=0?c=d+1:u=d}while(cc&&r(s[d-1],l)>-r(s[d],l)?d-1:d}return{left:i,center:a,right:o}}function ISe(){return 0}function dH(t){return t===null?NaN:+t}function*DSe(t,e){for(let n of t)n!=null&&(n=+n)>=n&&(yield n)}const LSe=WC(rl),zm=LSe.right;WC(dH).center;class ZI extends Map{constructor(e,n=USe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const[r,i]of e)this.set(r,i)}get(e){return super.get(QI(this,e))}has(e){return super.has(QI(this,e))}set(e,n){return super.set(kSe(this,e),n)}delete(e){return super.delete(jSe(this,e))}}function QI({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function kSe({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function jSe({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function USe(t){return t!==null&&typeof t=="object"?t.valueOf():t}function FSe(t=rl){if(t===rl)return fH;if(typeof t!="function")throw new TypeError("compare is not a function");return(e,n)=>{const r=t(e,n);return r||r===0?r:(t(n,n)===0)-(t(e,e)===0)}}function fH(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(te?1:0)}const BSe=Math.sqrt(50),$Se=Math.sqrt(10),zSe=Math.sqrt(2);function e0(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=BSe?10:o>=$Se?5:o>=zSe?2:1;let s,l,c;return i<0?(c=Math.pow(10,-i)/a,s=Math.round(t*c),l=Math.round(e*c),s/ce&&--l,c=-c):(c=Math.pow(10,i)*a,s=Math.round(t/c),l=Math.round(e/c),s*ce&&--l),l0))return[];if(t===e)return[t];const r=e=i))return[];const s=o-i+1,l=new Array(s);if(r)if(a<0)for(let c=0;c=r)&&(n=r);return n}function tD(t,e){let n;for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function hH(t,e,n=0,r=1/0,i){if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(t.length-1,r)),!(n<=e&&e<=r))return t;for(i=i===void 0?fH:FSe(i);r>n;){if(r-n>600){const l=r-n+1,c=e-n+1,u=Math.log(l),d=.5*Math.exp(2*u/3),f=.5*Math.sqrt(u*d*(l-d)/l)*(c-l/2<0?-1:1),p=Math.max(n,Math.floor(e-c*d/l+f)),y=Math.min(r,Math.floor(e+(l-c)*d/l+f));hH(t,e,p,y,i)}const o=t[e];let a=n,s=r;for(ph(t,n,e),i(t[r],o)>0&&ph(t,n,r);a0;)--s}i(t[n],o)===0?ph(t,n,s):(++s,ph(t,s,r)),s<=e&&(n=s+1),e<=s&&(r=s-1)}return t}function ph(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function HSe(t,e,n){if(t=Float64Array.from(DSe(t)),!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return tD(t);if(e>=1)return eD(t);var r,i=(r-1)*e,o=Math.floor(i),a=eD(hH(t,o).subarray(0,o+1)),s=tD(t.subarray(o+1));return a+(s-a)*(i-o)}}function VSe(t,e,n=dH){if(!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,o=Math.floor(i),a=+n(t[o],o,t),s=+n(t[o+1],o+1,t);return a+(s-a)*(i-o)}}function GSe(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((e-t)/n))|0,o=new Array(i);++r>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?hv(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?hv(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=XSe.exec(t))?new ai(e[1],e[2],e[3],1):(e=qSe.exec(t))?new ai(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=KSe.exec(t))?hv(e[1],e[2],e[3],e[4]):(e=YSe.exec(t))?hv(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=JSe.exec(t))?lD(e[1],e[2]/100,e[3]/100,1):(e=ZSe.exec(t))?lD(e[1],e[2]/100,e[3]/100,e[4]):nD.hasOwnProperty(t)?oD(nD[t]):t==="transparent"?new ai(NaN,NaN,NaN,0):null}function oD(t){return new ai(t>>16&255,t>>8&255,t&255,1)}function hv(t,e,n,r){return r<=0&&(t=e=n=NaN),new ai(t,e,n,r)}function tEe(t){return t instanceof Hm||(t=Hp(t)),t?(t=t.rgb(),new ai(t.r,t.g,t.b,t.opacity)):new ai}function oT(t,e,n,r){return arguments.length===1?tEe(t):new ai(t,e,n,r??1)}function ai(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}qC(ai,oT,mH(Hm,{brighter(t){return t=t==null?t0:Math.pow(t0,t),new ai(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?$p:Math.pow($p,t),new ai(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new ai(yc(this.r),yc(this.g),yc(this.b),n0(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:aD,formatHex:aD,formatHex8:nEe,formatRgb:sD,toString:sD}));function aD(){return`#${nc(this.r)}${nc(this.g)}${nc(this.b)}`}function nEe(){return`#${nc(this.r)}${nc(this.g)}${nc(this.b)}${nc((isNaN(this.opacity)?1:this.opacity)*255)}`}function sD(){const t=n0(this.opacity);return`${t===1?"rgb(":"rgba("}${yc(this.r)}, ${yc(this.g)}, ${yc(this.b)}${t===1?")":`, ${t})`}`}function n0(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function yc(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function nc(t){return t=yc(t),(t<16?"0":"")+t.toString(16)}function lD(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new No(t,e,n,r)}function gH(t){if(t instanceof No)return new No(t.h,t.s,t.l,t.opacity);if(t instanceof Hm||(t=Hp(t)),!t)return new No;if(t instanceof No)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(e===o?a=(n-r)/s+(n0&&l<1?0:a,new No(a,s,l,t.opacity)}function rEe(t,e,n,r){return arguments.length===1?gH(t):new No(t,e,n,r??1)}function No(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}qC(No,rEe,mH(Hm,{brighter(t){return t=t==null?t0:Math.pow(t0,t),new No(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?$p:Math.pow($p,t),new No(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 ai(Kw(t>=240?t-240:t+120,i,r),Kw(t,i,r),Kw(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new No(cD(this.h),pv(this.s),pv(this.l),n0(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=n0(this.opacity);return`${t===1?"hsl(":"hsla("}${cD(this.h)}, ${pv(this.s)*100}%, ${pv(this.l)*100}%${t===1?")":`, ${t})`}`}}));function cD(t){return t=(t||0)%360,t<0?t+360:t}function pv(t){return Math.max(0,Math.min(1,t||0))}function Kw(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 KC=t=>()=>t;function iEe(t,e){return function(n){return t+n*e}}function oEe(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 aEe(t){return(t=+t)==1?vH:function(e,n){return n-e?oEe(e,n,t):KC(isNaN(e)?n:e)}}function vH(t,e){var n=e-t;return n?iEe(t,n):KC(isNaN(t)?e:t)}const uD=function t(e){var n=aEe(e);function r(i,o){var a=n((i=oT(i)).r,(o=oT(o)).r),s=n(i.g,o.g),l=n(i.b,o.b),c=vH(i.opacity,o.opacity);return function(u){return i.r=a(u),i.g=s(u),i.b=l(u),i.opacity=c(u),i+""}}return r.gamma=t,r}(1);function sEe(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),i;return function(o){for(i=0;in&&(o=e.slice(n,o),s[a]?s[a]+=o:s[++a]=o),(r=r[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,l.push({i:a,x:r0(r,i)})),n=Yw.lastIndex;return ne&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function yEe(t,e,n){var r=t[0],i=t[1],o=e[0],a=e[1];return i2?xEe:yEe,l=c=null,d}function d(f){return f==null||isNaN(f=+f)?o:(l||(l=s(t.map(r),e,n)))(r(a(f)))}return d.invert=function(f){return a(i((c||(c=s(e,t.map(r),r0)))(f)))},d.domain=function(f){return arguments.length?(t=Array.from(f,i0),u()):t.slice()},d.range=function(f){return arguments.length?(e=Array.from(f),u()):e.slice()},d.rangeRound=function(f){return e=Array.from(f),n=YC,u()},d.clamp=function(f){return arguments.length?(a=f?!0:Hr,u()):a!==Hr},d.interpolate=function(f){return arguments.length?(n=f,u()):n},d.unknown=function(f){return arguments.length?(o=f,d):o},function(f,p){return r=f,i=p,u()}}function JC(){return Tb()(Hr,Hr)}function bEe(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function o0(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 qd(t){return t=o0(Math.abs(t)),t?t[1]:NaN}function _Ee(t,e){return function(n,r){for(var i=n.length,o=[],a=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),o.push(n.substring(i-=s,i+s)),!((l+=s+1)>r));)s=t[a=(a+1)%t.length];return o.reverse().join(e)}}function wEe(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var SEe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Vp(t){if(!(e=SEe.exec(t)))throw new Error("invalid format: "+t);var e;return new ZC({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]})}Vp.prototype=ZC.prototype;function ZC(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+""}ZC.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 EEe(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 yH;function TEe(t,e){var n=o0(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(yH=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+o0(t,Math.max(0,e+o-1))[0]}function fD(t,e){var n=o0(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 hD={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:bEe,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)=>fD(t*100,e),r:fD,s:TEe,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function pD(t){return t}var mD=Array.prototype.map,gD=["y","z","a","f","p","n","ยต","m","","k","M","G","T","P","E","Z","Y"];function MEe(t){var e=t.grouping===void 0||t.thousands===void 0?pD:_Ee(mD.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+"",o=t.numerals===void 0?pD:wEe(mD.call(t.numerals,String)),a=t.percent===void 0?"%":t.percent+"",s=t.minus===void 0?"โˆ’":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function c(d){d=Vp(d);var f=d.fill,p=d.align,y=d.sign,v=d.symbol,g=d.zero,m=d.width,x=d.comma,b=d.precision,S=d.trim,w=d.type;w==="n"?(x=!0,w="g"):hD[w]||(b===void 0&&(b=12),S=!0,w="g"),(g||f==="0"&&p==="=")&&(g=!0,f="0",p="=");var E=v==="$"?n:v==="#"&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",T=v==="$"?r:/[%p]/.test(w)?a:"",A=hD[w],M=/[defgprs%]/.test(w);b=b===void 0?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b));function C(P){var R=E,D=T,k,U,O;if(w==="c")D=A(P)+D,P="";else{P=+P;var W=P<0||1/P<0;if(P=isNaN(P)?l:A(Math.abs(P),b),S&&(P=EEe(P)),W&&+P==0&&y!=="+"&&(W=!1),R=(W?y==="("?y:s:y==="-"||y==="("?"":y)+R,D=(w==="s"?gD[8+yH/3]:"")+D+(W&&y==="("?")":""),M){for(k=-1,U=P.length;++kO||O>57){D=(O===46?i+P.slice(k+1):P.slice(k))+D,P=P.slice(0,k);break}}}x&&!g&&(P=e(P,1/0));var L=R.length+P.length+D.length,j=L>1)+R+P+D+j.slice(L);break;default:P=j+R+P+D;break}return o(P)}return C.toString=function(){return d+""},C}function u(d,f){var p=c((d=Vp(d),d.type="f",d)),y=Math.max(-8,Math.min(8,Math.floor(qd(f)/3)))*3,v=Math.pow(10,-y),g=gD[8+y/3];return function(m){return p(v*m)+g}}return{format:c,formatPrefix:u}}var mv,QC,xH;AEe({thousands:",",grouping:[3],currency:["$",""]});function AEe(t){return mv=MEe(t),QC=mv.format,xH=mv.formatPrefix,mv}function CEe(t){return Math.max(0,-qd(Math.abs(t)))}function PEe(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(qd(e)/3)))*3-qd(Math.abs(t)))}function REe(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,qd(e)-qd(t))+1}function bH(t,e,n,r){var i=rT(t,e,n),o;switch(r=Vp(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(o=PEe(i,a))&&(r.precision=o),xH(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=REe(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=CEe(i))&&(r.precision=o-(r.type==="%")*2);break}}return QC(r)}function Pl(t){var e=t.domain;return t.ticks=function(n){var r=e();return tT(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return bH(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,o=r.length-1,a=r[i],s=r[o],l,c,u=10;for(s0;){if(c=nT(a,s,n),c===l)return r[i]=a,r[o]=s,e(r);if(c>0)a=Math.floor(a/c)*c,s=Math.ceil(s/c)*c;else if(c<0)a=Math.ceil(a*c)/c,s=Math.floor(s*c)/c;else break;l=c}return t},t}function a0(){var t=JC();return t.copy=function(){return Vm(t,a0())},lo.apply(t,arguments),Pl(t)}function _H(t){var e;function n(r){return r==null||isNaN(r=+r)?e:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(t=Array.from(r,i0),n):t.slice()},n.unknown=function(r){return arguments.length?(e=r,n):e},n.copy=function(){return _H(t).unknown(e)},t=arguments.length?Array.from(t,i0):[0,1],Pl(n)}function wH(t,e){t=t.slice();var n=0,r=t.length-1,i=t[n],o=t[r],a;return oMath.pow(t,e)}function LEe(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function xD(t){return(e,n)=>-t(-e,n)}function eP(t){const e=t(vD,yD),n=e.domain;let r=10,i,o;function a(){return i=LEe(r),o=DEe(r),n()[0]<0?(i=xD(i),o=xD(o),t(NEe,OEe)):t(vD,yD),e}return e.base=function(s){return arguments.length?(r=+s,a()):r},e.domain=function(s){return arguments.length?(n(s),a()):n()},e.ticks=s=>{const l=n();let c=l[0],u=l[l.length-1];const d=u0){for(;f<=p;++f)for(y=1;yu)break;m.push(v)}}else for(;f<=p;++f)for(y=r-1;y>=1;--y)if(v=f>0?y/o(-f):y*o(f),!(vu)break;m.push(v)}m.length*2{if(s==null&&(s=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=Vp(l)).precision==null&&(l.trim=!0),l=QC(l)),s===1/0)return l;const c=Math.max(1,r*s/e.ticks().length);return u=>{let d=u/o(Math.round(i(u)));return d*rn(wH(n(),{floor:s=>o(Math.floor(i(s))),ceil:s=>o(Math.ceil(i(s)))})),e}function SH(){const t=eP(Tb()).domain([1,10]);return t.copy=()=>Vm(t,SH()).base(t.base()),lo.apply(t,arguments),t}function bD(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function _D(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function tP(t){var e=1,n=t(bD(e),_D(e));return n.constant=function(r){return arguments.length?t(bD(e=+r),_D(e)):e},Pl(n)}function EH(){var t=tP(Tb());return t.copy=function(){return Vm(t,EH()).constant(t.constant())},lo.apply(t,arguments)}function wD(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function kEe(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function jEe(t){return t<0?-t*t:t*t}function nP(t){var e=t(Hr,Hr),n=1;function r(){return n===1?t(Hr,Hr):n===.5?t(kEe,jEe):t(wD(n),wD(1/n))}return e.exponent=function(i){return arguments.length?(n=+i,r()):n},Pl(e)}function rP(){var t=nP(Tb());return t.copy=function(){return Vm(t,rP()).exponent(t.exponent())},lo.apply(t,arguments),t}function UEe(){return rP.apply(null,arguments).exponent(.5)}function SD(t){return Math.sign(t)*t*t}function FEe(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}function TH(){var t=JC(),e=[0,1],n=!1,r;function i(o){var a=FEe(t(o));return isNaN(a)?r:n?Math.round(a):a}return i.invert=function(o){return t.invert(SD(o))},i.domain=function(o){return arguments.length?(t.domain(o),i):t.domain()},i.range=function(o){return arguments.length?(t.range((e=Array.from(o,i0)).map(SD)),i):e.slice()},i.rangeRound=function(o){return i.range(o).round(!0)},i.round=function(o){return arguments.length?(n=!!o,i):n},i.clamp=function(o){return arguments.length?(t.clamp(o),i):t.clamp()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return TH(t.domain(),e).round(n).clamp(t.clamp()).unknown(r)},lo.apply(i,arguments),Pl(i)}function MH(){var t=[],e=[],n=[],r;function i(){var a=0,s=Math.max(1,e.length);for(n=new Array(s-1);++a0?n[s-1]:t[0],s=n?[r[n-1],e]:[r[c-1],r[c]]},a.unknown=function(l){return arguments.length&&(o=l),a},a.thresholds=function(){return r.slice()},a.copy=function(){return AH().domain([t,e]).range(i).unknown(o)},lo.apply(Pl(a),arguments)}function CH(){var t=[.5],e=[0,1],n,r=1;function i(o){return o!=null&&o<=o?e[zm(t,o,0,r)]:n}return i.domain=function(o){return arguments.length?(t=Array.from(o),r=Math.min(t.length,e.length-1),i):t.slice()},i.range=function(o){return arguments.length?(e=Array.from(o),r=Math.min(t.length,e.length-1),i):e.slice()},i.invertExtent=function(o){var a=e.indexOf(o);return[t[a-1],t[a]]},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return CH().domain(t).range(e).unknown(n)},lo.apply(i,arguments)}const Jw=new Date,Zw=new Date;function tr(t,e,n,r){function i(o){return t(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(t(o=new Date(+o)),o),i.ceil=o=>(t(o=new Date(o-1)),e(o,1),t(o),o),i.round=o=>{const a=i(o),s=i.ceil(o);return o-a(e(o=new Date(+o),a==null?1:Math.floor(a)),o),i.range=(o,a,s)=>{const l=[];if(o=i.ceil(o),s=s==null?1:Math.floor(s),!(o0))return l;let c;do l.push(c=new Date(+o)),e(o,s),t(o);while(ctr(a=>{if(a>=a)for(;t(a),!o(a);)a.setTime(a-1)},(a,s)=>{if(a>=a)if(s<0)for(;++s<=0;)for(;e(a,-1),!o(a););else for(;--s>=0;)for(;e(a,1),!o(a););}),n&&(i.count=(o,a)=>(Jw.setTime(+o),Zw.setTime(+a),t(Jw),t(Zw),Math.floor(n(Jw,Zw))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?a=>r(a)%o===0:a=>i.count(0,a)%o===0):i)),i}const s0=tr(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);s0.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?tr(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):s0);s0.range;const qa=1e3,Qi=qa*60,Ka=Qi*60,ss=Ka*24,iP=ss*7,ED=ss*30,Qw=ss*365,rc=tr(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*qa)},(t,e)=>(e-t)/qa,t=>t.getUTCSeconds());rc.range;const oP=tr(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*qa)},(t,e)=>{t.setTime(+t+e*Qi)},(t,e)=>(e-t)/Qi,t=>t.getMinutes());oP.range;const aP=tr(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*Qi)},(t,e)=>(e-t)/Qi,t=>t.getUTCMinutes());aP.range;const sP=tr(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*qa-t.getMinutes()*Qi)},(t,e)=>{t.setTime(+t+e*Ka)},(t,e)=>(e-t)/Ka,t=>t.getHours());sP.range;const lP=tr(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*Ka)},(t,e)=>(e-t)/Ka,t=>t.getUTCHours());lP.range;const Gm=tr(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Qi)/ss,t=>t.getDate()-1);Gm.range;const Mb=tr(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/ss,t=>t.getUTCDate()-1);Mb.range;const PH=tr(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/ss,t=>Math.floor(t/ss));PH.range;function Kc(t){return tr(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*Qi)/iP)}const Ab=Kc(0),l0=Kc(1),BEe=Kc(2),$Ee=Kc(3),Kd=Kc(4),zEe=Kc(5),HEe=Kc(6);Ab.range;l0.range;BEe.range;$Ee.range;Kd.range;zEe.range;HEe.range;function Yc(t){return tr(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/iP)}const Cb=Yc(0),c0=Yc(1),VEe=Yc(2),GEe=Yc(3),Yd=Yc(4),WEe=Yc(5),XEe=Yc(6);Cb.range;c0.range;VEe.range;GEe.range;Yd.range;WEe.range;XEe.range;const cP=tr(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());cP.range;const uP=tr(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());uP.range;const ls=tr(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());ls.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:tr(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});ls.range;const cs=tr(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());cs.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:tr(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});cs.range;function RH(t,e,n,r,i,o){const a=[[rc,1,qa],[rc,5,5*qa],[rc,15,15*qa],[rc,30,30*qa],[o,1,Qi],[o,5,5*Qi],[o,15,15*Qi],[o,30,30*Qi],[i,1,Ka],[i,3,3*Ka],[i,6,6*Ka],[i,12,12*Ka],[r,1,ss],[r,2,2*ss],[n,1,iP],[e,1,ED],[e,3,3*ED],[t,1,Qw]];function s(c,u,d){const f=ug).right(a,f);if(p===a.length)return t.every(rT(c/Qw,u/Qw,d));if(p===0)return s0.every(Math.max(rT(c,u,d),1));const[y,v]=a[f/a[p-1][2]53)return null;"w"in le||(le.w=1),"Z"in le?(G=tS(mh(le.y,0,1)),Ve=G.getUTCDay(),G=Ve>4||Ve===0?c0.ceil(G):c0(G),G=Mb.offset(G,(le.V-1)*7),le.y=G.getUTCFullYear(),le.m=G.getUTCMonth(),le.d=G.getUTCDate()+(le.w+6)%7):(G=eS(mh(le.y,0,1)),Ve=G.getDay(),G=Ve>4||Ve===0?l0.ceil(G):l0(G),G=Gm.offset(G,(le.V-1)*7),le.y=G.getFullYear(),le.m=G.getMonth(),le.d=G.getDate()+(le.w+6)%7)}else("W"in le||"U"in le)&&("w"in le||(le.w="u"in le?le.u%7:"W"in le?1:0),Ve="Z"in le?tS(mh(le.y,0,1)).getUTCDay():eS(mh(le.y,0,1)).getDay(),le.m=0,le.d="W"in le?(le.w+6)%7+le.W*7-(Ve+5)%7:le.w+le.U*7-(Ve+6)%7);return"Z"in le?(le.H+=le.Z/100|0,le.M+=le.Z%100,tS(le)):eS(le)}}function A(ae,fe,we,le){for(var ie=0,G=fe.length,Ve=we.length,Ne,st;ie=Ve)return-1;if(Ne=fe.charCodeAt(ie++),Ne===37){if(Ne=fe.charAt(ie++),st=w[Ne in TD?fe.charAt(ie++):Ne],!st||(le=st(ae,we,le))<0)return-1}else if(Ne!=we.charCodeAt(le++))return-1}return le}function M(ae,fe,we){var le=c.exec(fe.slice(we));return le?(ae.p=u.get(le[0].toLowerCase()),we+le[0].length):-1}function C(ae,fe,we){var le=p.exec(fe.slice(we));return le?(ae.w=y.get(le[0].toLowerCase()),we+le[0].length):-1}function P(ae,fe,we){var le=d.exec(fe.slice(we));return le?(ae.w=f.get(le[0].toLowerCase()),we+le[0].length):-1}function R(ae,fe,we){var le=m.exec(fe.slice(we));return le?(ae.m=x.get(le[0].toLowerCase()),we+le[0].length):-1}function D(ae,fe,we){var le=v.exec(fe.slice(we));return le?(ae.m=g.get(le[0].toLowerCase()),we+le[0].length):-1}function k(ae,fe,we){return A(ae,e,fe,we)}function U(ae,fe,we){return A(ae,n,fe,we)}function O(ae,fe,we){return A(ae,r,fe,we)}function W(ae){return a[ae.getDay()]}function L(ae){return o[ae.getDay()]}function j(ae){return l[ae.getMonth()]}function X(ae){return s[ae.getMonth()]}function K(ae){return i[+(ae.getHours()>=12)]}function F(ae){return 1+~~(ae.getMonth()/3)}function Y(ae){return a[ae.getUTCDay()]}function q(ae){return o[ae.getUTCDay()]}function ee(ae){return l[ae.getUTCMonth()]}function te(ae){return s[ae.getUTCMonth()]}function Q(ae){return i[+(ae.getUTCHours()>=12)]}function ce(ae){return 1+~~(ae.getUTCMonth()/3)}return{format:function(ae){var fe=E(ae+="",b);return fe.toString=function(){return ae},fe},parse:function(ae){var fe=T(ae+="",!1);return fe.toString=function(){return ae},fe},utcFormat:function(ae){var fe=E(ae+="",S);return fe.toString=function(){return ae},fe},utcParse:function(ae){var fe=T(ae+="",!0);return fe.toString=function(){return ae},fe}}}var TD={"-":"",_:" ",0:"0"},dr=/^\s*\d+/,QEe=/^%/,e1e=/[\\^$*+?|[\]().{}]/g;function qt(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o[e.toLowerCase(),n]))}function n1e(t,e,n){var r=dr.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function r1e(t,e,n){var r=dr.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function i1e(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function o1e(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function a1e(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function MD(t,e,n){var r=dr.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function AD(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function s1e(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function l1e(t,e,n){var r=dr.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function c1e(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function CD(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function u1e(t,e,n){var r=dr.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function PD(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function d1e(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function f1e(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function h1e(t,e,n){var r=dr.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function p1e(t,e,n){var r=dr.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function m1e(t,e,n){var r=QEe.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function g1e(t,e,n){var r=dr.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function v1e(t,e,n){var r=dr.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function RD(t,e){return qt(t.getDate(),e,2)}function y1e(t,e){return qt(t.getHours(),e,2)}function x1e(t,e){return qt(t.getHours()%12||12,e,2)}function b1e(t,e){return qt(1+Gm.count(ls(t),t),e,3)}function NH(t,e){return qt(t.getMilliseconds(),e,3)}function _1e(t,e){return NH(t,e)+"000"}function w1e(t,e){return qt(t.getMonth()+1,e,2)}function S1e(t,e){return qt(t.getMinutes(),e,2)}function E1e(t,e){return qt(t.getSeconds(),e,2)}function T1e(t){var e=t.getDay();return e===0?7:e}function M1e(t,e){return qt(Ab.count(ls(t)-1,t),e,2)}function OH(t){var e=t.getDay();return e>=4||e===0?Kd(t):Kd.ceil(t)}function A1e(t,e){return t=OH(t),qt(Kd.count(ls(t),t)+(ls(t).getDay()===4),e,2)}function C1e(t){return t.getDay()}function P1e(t,e){return qt(l0.count(ls(t)-1,t),e,2)}function R1e(t,e){return qt(t.getFullYear()%100,e,2)}function N1e(t,e){return t=OH(t),qt(t.getFullYear()%100,e,2)}function O1e(t,e){return qt(t.getFullYear()%1e4,e,4)}function I1e(t,e){var n=t.getDay();return t=n>=4||n===0?Kd(t):Kd.ceil(t),qt(t.getFullYear()%1e4,e,4)}function D1e(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+qt(e/60|0,"0",2)+qt(e%60,"0",2)}function ND(t,e){return qt(t.getUTCDate(),e,2)}function L1e(t,e){return qt(t.getUTCHours(),e,2)}function k1e(t,e){return qt(t.getUTCHours()%12||12,e,2)}function j1e(t,e){return qt(1+Mb.count(cs(t),t),e,3)}function IH(t,e){return qt(t.getUTCMilliseconds(),e,3)}function U1e(t,e){return IH(t,e)+"000"}function F1e(t,e){return qt(t.getUTCMonth()+1,e,2)}function B1e(t,e){return qt(t.getUTCMinutes(),e,2)}function $1e(t,e){return qt(t.getUTCSeconds(),e,2)}function z1e(t){var e=t.getUTCDay();return e===0?7:e}function H1e(t,e){return qt(Cb.count(cs(t)-1,t),e,2)}function DH(t){var e=t.getUTCDay();return e>=4||e===0?Yd(t):Yd.ceil(t)}function V1e(t,e){return t=DH(t),qt(Yd.count(cs(t),t)+(cs(t).getUTCDay()===4),e,2)}function G1e(t){return t.getUTCDay()}function W1e(t,e){return qt(c0.count(cs(t)-1,t),e,2)}function X1e(t,e){return qt(t.getUTCFullYear()%100,e,2)}function q1e(t,e){return t=DH(t),qt(t.getUTCFullYear()%100,e,2)}function K1e(t,e){return qt(t.getUTCFullYear()%1e4,e,4)}function Y1e(t,e){var n=t.getUTCDay();return t=n>=4||n===0?Yd(t):Yd.ceil(t),qt(t.getUTCFullYear()%1e4,e,4)}function J1e(){return"+0000"}function OD(){return"%"}function ID(t){return+t}function DD(t){return Math.floor(+t/1e3)}var Eu,LH,kH;Z1e({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Z1e(t){return Eu=ZEe(t),LH=Eu.format,Eu.parse,kH=Eu.utcFormat,Eu.utcParse,Eu}function Q1e(t){return new Date(t)}function eTe(t){return t instanceof Date?+t:+new Date(+t)}function dP(t,e,n,r,i,o,a,s,l,c){var u=JC(),d=u.invert,f=u.domain,p=c(".%L"),y=c(":%S"),v=c("%I:%M"),g=c("%I %p"),m=c("%a %d"),x=c("%b %d"),b=c("%B"),S=c("%Y");function w(E){return(l(E)e(i/(t.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,o)=>HSe(t,o/r))},n.copy=function(){return BH(e).domain(t)},ms.apply(n,arguments)}function Rb(){var t=0,e=.5,n=1,r=1,i,o,a,s,l,c=Hr,u,d=!1,f;function p(v){return isNaN(v=+v)?f:(v=.5+((v=+u(v))-o)*(r*ve}var lTe=sTe,cTe=VH,uTe=lTe,dTe=Lf;function fTe(t){return t&&t.length?cTe(t,dTe,uTe):void 0}var hTe=fTe;const Nb=dn(hTe);function pTe(t,e){return tt.e^o.s<0?1:-1;for(r=o.d.length,i=t.d.length,e=0,n=rt.d[e]^o.s<0?1:-1;return r===i?0:r>i^o.s<0?1:-1};Ke.decimalPlaces=Ke.dp=function(){var t=this,e=t.d.length-1,n=(e-t.e)*_n;if(e=t.d[e],e)for(;e%10==0;e/=10)n--;return n<0?0:n};Ke.dividedBy=Ke.div=function(t){return Qa(this,new this.constructor(t))};Ke.dividedToIntegerBy=Ke.idiv=function(t){var e=this,n=e.constructor;return un(Qa(e,new n(t),0,1),n.precision)};Ke.equals=Ke.eq=function(t){return!this.cmp(t)};Ke.exponent=function(){return Hn(this)};Ke.greaterThan=Ke.gt=function(t){return this.cmp(t)>0};Ke.greaterThanOrEqualTo=Ke.gte=function(t){return this.cmp(t)>=0};Ke.isInteger=Ke.isint=function(){return this.e>this.d.length-2};Ke.isNegative=Ke.isneg=function(){return this.s<0};Ke.isPositive=Ke.ispos=function(){return this.s>0};Ke.isZero=function(){return this.s===0};Ke.lessThan=Ke.lt=function(t){return this.cmp(t)<0};Ke.lessThanOrEqualTo=Ke.lte=function(t){return this.cmp(t)<1};Ke.logarithm=Ke.log=function(t){var e,n=this,r=n.constructor,i=r.precision,o=i+5;if(t===void 0)t=new r(10);else if(t=new r(t),t.s<1||t.eq(Ci))throw Error(ao+"NaN");if(n.s<1)throw Error(ao+(n.s?"NaN":"-Infinity"));return n.eq(Ci)?new r(0):(Mn=!1,e=Qa(Gp(n,o),Gp(t,o),o),Mn=!0,un(e,i))};Ke.minus=Ke.sub=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?qH(e,t):WH(e,(t.s=-t.s,t))};Ke.modulo=Ke.mod=function(t){var e,n=this,r=n.constructor,i=r.precision;if(t=new r(t),!t.s)throw Error(ao+"NaN");return n.s?(Mn=!1,e=Qa(n,t,0,1).times(t),Mn=!0,n.minus(e)):un(new r(n),i)};Ke.naturalExponential=Ke.exp=function(){return XH(this)};Ke.naturalLogarithm=Ke.ln=function(){return Gp(this)};Ke.negated=Ke.neg=function(){var t=new this.constructor(this);return t.s=-t.s||0,t};Ke.plus=Ke.add=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?WH(e,t):qH(e,(t.s=-t.s,t))};Ke.precision=Ke.sd=function(t){var e,n,r,i=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(xc+t);if(e=Hn(i)+1,r=i.d.length-1,n=r*_n+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return t&&e>n?e:n};Ke.squareRoot=Ke.sqrt=function(){var t,e,n,r,i,o,a,s=this,l=s.constructor;if(s.s<1){if(!s.s)return new l(0);throw Error(ao+"NaN")}for(t=Hn(s),Mn=!1,i=Math.sqrt(+s),i==0||i==1/0?(e=fa(s.d),(e.length+t)%2==0&&(e+="0"),i=Math.sqrt(e),t=Bf((t+1)/2)-(t<0||t%2),i==1/0?e="5e"+t:(e=i.toExponential(),e=e.slice(0,e.indexOf("e")+1)+t),r=new l(e)):r=new l(i.toString()),n=l.precision,i=a=n+3;;)if(o=r,r=o.plus(Qa(s,o,a+2)).times(.5),fa(o.d).slice(0,a)===(e=fa(r.d)).slice(0,a)){if(e=e.slice(a-3,a+1),i==a&&e=="4999"){if(un(o,n+1,0),o.times(o).eq(s)){r=o;break}}else if(e!="9999")break;a+=4}return Mn=!0,un(r,n)};Ke.times=Ke.mul=function(t){var e,n,r,i,o,a,s,l,c,u=this,d=u.constructor,f=u.d,p=(t=new d(t)).d;if(!u.s||!t.s)return new d(0);for(t.s*=u.s,n=u.e+t.e,l=f.length,c=p.length,l=0;){for(e=0,i=l+r;i>r;)s=o[i]+p[r]*f[i-r-1]+e,o[i--]=s%ir|0,e=s/ir|0;o[i]=(o[i]+e)%ir|0}for(;!o[--a];)o.pop();return e?++n:o.shift(),t.d=o,t.e=n,Mn?un(t,d.precision):t};Ke.toDecimalPlaces=Ke.todp=function(t,e){var n=this,r=n.constructor;return n=new r(n),t===void 0?n:(wa(t,0,Ff),e===void 0?e=r.rounding:wa(e,0,8),un(n,t+Hn(n)+1,e))};Ke.toExponential=function(t,e){var n,r=this,i=r.constructor;return t===void 0?n=kc(r,!0):(wa(t,0,Ff),e===void 0?e=i.rounding:wa(e,0,8),r=un(new i(r),t+1,e),n=kc(r,!0,t+1)),n};Ke.toFixed=function(t,e){var n,r,i=this,o=i.constructor;return t===void 0?kc(i):(wa(t,0,Ff),e===void 0?e=o.rounding:wa(e,0,8),r=un(new o(i),t+Hn(i)+1,e),n=kc(r.abs(),!1,t+Hn(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};Ke.toInteger=Ke.toint=function(){var t=this,e=t.constructor;return un(new e(t),Hn(t)+1,e.rounding)};Ke.toNumber=function(){return+this};Ke.toPower=Ke.pow=function(t){var e,n,r,i,o,a,s=this,l=s.constructor,c=12,u=+(t=new l(t));if(!t.s)return new l(Ci);if(s=new l(s),!s.s){if(t.s<1)throw Error(ao+"Infinity");return s}if(s.eq(Ci))return s;if(r=l.precision,t.eq(Ci))return un(s,r);if(e=t.e,n=t.d.length-1,a=e>=n,o=s.s,a){if((n=u<0?-u:u)<=GH){for(i=new l(Ci),e=Math.ceil(r/_n+4),Mn=!1;n%2&&(i=i.times(s),jD(i.d,e)),n=Bf(n/2),n!==0;)s=s.times(s),jD(s.d,e);return Mn=!0,t.s<0?new l(Ci).div(i):un(i,r)}}else if(o<0)throw Error(ao+"NaN");return o=o<0&&t.d[Math.max(e,n)]&1?-1:1,s.s=1,Mn=!1,i=t.times(Gp(s,r+c)),Mn=!0,i=XH(i),i.s=o,i};Ke.toPrecision=function(t,e){var n,r,i=this,o=i.constructor;return t===void 0?(n=Hn(i),r=kc(i,n<=o.toExpNeg||n>=o.toExpPos)):(wa(t,1,Ff),e===void 0?e=o.rounding:wa(e,0,8),i=un(new o(i),t,e),n=Hn(i),r=kc(i,t<=n||n<=o.toExpNeg,t)),r};Ke.toSignificantDigits=Ke.tosd=function(t,e){var n=this,r=n.constructor;return t===void 0?(t=r.precision,e=r.rounding):(wa(t,1,Ff),e===void 0?e=r.rounding:wa(e,0,8)),un(new r(n),t,e)};Ke.toString=Ke.valueOf=Ke.val=Ke.toJSON=Ke[Symbol.for("nodejs.util.inspect.custom")]=function(){var t=this,e=Hn(t),n=t.constructor;return kc(t,e<=n.toExpNeg||e>=n.toExpPos)};function WH(t,e){var n,r,i,o,a,s,l,c,u=t.constructor,d=u.precision;if(!t.s||!e.s)return e.s||(e=new u(t)),Mn?un(e,d):e;if(l=t.d,c=e.d,a=t.e,i=e.e,l=l.slice(),o=a-i,o){for(o<0?(r=l,o=-o,s=c.length):(r=c,i=a,s=l.length),a=Math.ceil(d/_n),s=a>s?a+1:s+1,o>s&&(o=s,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(s=l.length,o=c.length,s-o<0&&(o=s,r=c,c=l,l=r),n=0;o;)n=(l[--o]=l[o]+c[o]+n)/ir|0,l[o]%=ir;for(n&&(l.unshift(n),++i),s=l.length;l[--s]==0;)l.pop();return e.d=l,e.e=i,Mn?un(e,d):e}function wa(t,e,n){if(t!==~~t||tn)throw Error(xc+t)}function fa(t){var e,n,r,i=t.length-1,o="",a=t[0];if(i>0){for(o+=a,e=1;ea?1:-1;else for(s=l=0;si[s]?1:-1;break}return l}function n(r,i,o){for(var a=0;o--;)r[o]-=a,a=r[o]1;)r.shift()}return function(r,i,o,a){var s,l,c,u,d,f,p,y,v,g,m,x,b,S,w,E,T,A,M=r.constructor,C=r.s==i.s?1:-1,P=r.d,R=i.d;if(!r.s)return new M(r);if(!i.s)throw Error(ao+"Division by zero");for(l=r.e-i.e,T=R.length,w=P.length,p=new M(C),y=p.d=[],c=0;R[c]==(P[c]||0);)++c;if(R[c]>(P[c]||0)&&--l,o==null?x=o=M.precision:a?x=o+(Hn(r)-Hn(i))+1:x=o,x<0)return new M(0);if(x=x/_n+2|0,c=0,T==1)for(u=0,R=R[0],x++;(c1&&(R=t(R,u),P=t(P,u),T=R.length,w=P.length),S=T,v=P.slice(0,T),g=v.length;g=ir/2&&++E;do u=0,s=e(R,v,T,g),s<0?(m=v[0],T!=g&&(m=m*ir+(v[1]||0)),u=m/E|0,u>1?(u>=ir&&(u=ir-1),d=t(R,u),f=d.length,g=v.length,s=e(d,v,f,g),s==1&&(u--,n(d,T16)throw Error(pP+Hn(t));if(!t.s)return new u(Ci);for(Mn=!1,s=d,a=new u(.03125);t.abs().gte(.1);)t=t.times(a),c+=5;for(r=Math.log(Xl(2,c))/Math.LN10*2+5|0,s+=r,n=i=o=new u(Ci),u.precision=s;;){if(i=un(i.times(t),s),n=n.times(++l),a=o.plus(Qa(i,n,s)),fa(a.d).slice(0,s)===fa(o.d).slice(0,s)){for(;c--;)o=un(o.times(o),s);return u.precision=d,e==null?(Mn=!0,un(o,d)):o}o=a}}function Hn(t){for(var e=t.e*_n,n=t.d[0];n>=10;n/=10)e++;return e}function nS(t,e,n){if(e>t.LN10.sd())throw Mn=!0,n&&(t.precision=n),Error(ao+"LN10 precision limit exceeded");return un(new t(t.LN10),e)}function Ns(t){for(var e="";t--;)e+="0";return e}function Gp(t,e){var n,r,i,o,a,s,l,c,u,d=1,f=10,p=t,y=p.d,v=p.constructor,g=v.precision;if(p.s<1)throw Error(ao+(p.s?"NaN":"-Infinity"));if(p.eq(Ci))return new v(0);if(e==null?(Mn=!1,c=g):c=e,p.eq(10))return e==null&&(Mn=!0),nS(v,c);if(c+=f,v.precision=c,n=fa(y),r=n.charAt(0),o=Hn(p),Math.abs(o)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)p=p.times(t),n=fa(p.d),r=n.charAt(0),d++;o=Hn(p),r>1?(p=new v("0."+n),o++):p=new v(r+"."+n.slice(1))}else return l=nS(v,c+2,g).times(o+""),p=Gp(new v(r+"."+n.slice(1)),c-f).plus(l),v.precision=g,e==null?(Mn=!0,un(p,g)):p;for(s=a=p=Qa(p.minus(Ci),p.plus(Ci),c),u=un(p.times(p),c),i=3;;){if(a=un(a.times(u),c),l=s.plus(Qa(a,new v(i),c)),fa(l.d).slice(0,c)===fa(s.d).slice(0,c))return s=s.times(2),o!==0&&(s=s.plus(nS(v,c+2,g).times(o+""))),s=Qa(s,new v(d),c),v.precision=g,e==null?(Mn=!0,un(s,g)):s;s=l,i+=2}}function kD(t,e){var n,r,i;for((n=e.indexOf("."))>-1&&(e=e.replace(".","")),(r=e.search(/e/i))>0?(n<0&&(n=r),n+=+e.slice(r+1),e=e.substring(0,r)):n<0&&(n=e.length),r=0;e.charCodeAt(r)===48;)++r;for(i=e.length;e.charCodeAt(i-1)===48;)--i;if(e=e.slice(r,i),e){if(i-=r,n=n-r-1,t.e=Bf(n/_n),t.d=[],r=(n+1)%_n,n<0&&(r+=_n),ru0||t.e<-u0))throw Error(pP+n)}else t.s=0,t.e=0,t.d=[0];return t}function un(t,e,n){var r,i,o,a,s,l,c,u,d=t.d;for(a=1,o=d[0];o>=10;o/=10)a++;if(r=e-a,r<0)r+=_n,i=e,c=d[u=0];else{if(u=Math.ceil((r+1)/_n),o=d.length,u>=o)return t;for(c=o=d[u],a=1;o>=10;o/=10)a++;r%=_n,i=r-_n+a}if(n!==void 0&&(o=Xl(10,a-i-1),s=c/o%10|0,l=e<0||d[u+1]!==void 0||c%o,l=n<4?(s||l)&&(n==0||n==(t.s<0?3:2)):s>5||s==5&&(n==4||l||n==6&&(r>0?i>0?c/Xl(10,a-i):0:d[u-1])%10&1||n==(t.s<0?8:7))),e<1||!d[0])return l?(o=Hn(t),d.length=1,e=e-o-1,d[0]=Xl(10,(_n-e%_n)%_n),t.e=Bf(-e/_n)||0):(d.length=1,d[0]=t.e=t.s=0),t;if(r==0?(d.length=u,o=1,u--):(d.length=u+1,o=Xl(10,_n-r),d[u]=i>0?(c/Xl(10,a-i)%Xl(10,i)|0)*o:0),l)for(;;)if(u==0){(d[0]+=o)==ir&&(d[0]=1,++t.e);break}else{if(d[u]+=o,d[u]!=ir)break;d[u--]=0,o=1}for(r=d.length;d[--r]===0;)d.pop();if(Mn&&(t.e>u0||t.e<-u0))throw Error(pP+Hn(t));return t}function qH(t,e){var n,r,i,o,a,s,l,c,u,d,f=t.constructor,p=f.precision;if(!t.s||!e.s)return e.s?e.s=-e.s:e=new f(t),Mn?un(e,p):e;if(l=t.d,d=e.d,r=e.e,c=t.e,l=l.slice(),a=c-r,a){for(u=a<0,u?(n=l,a=-a,s=d.length):(n=d,r=c,s=l.length),i=Math.max(Math.ceil(p/_n),s)+2,a>i&&(a=i,n.length=1),n.reverse(),i=a;i--;)n.push(0);n.reverse()}else{for(i=l.length,s=d.length,u=i0;--i)l[s++]=0;for(i=d.length;i>a;){if(l[--i]0?o=o.charAt(0)+"."+o.slice(1)+Ns(r):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+Ns(-i-1)+o,n&&(r=n-a)>0&&(o+=Ns(r))):i>=a?(o+=Ns(i+1-a),n&&(r=n-i-1)>0&&(o=o+"."+Ns(r))):((r=i+1)0&&(i+1===a&&(o+="."),o+=Ns(r))),t.s<0?"-"+o:o}function jD(t,e){if(t.length>e)return t.length=e,!0}function KH(t){var e,n,r;function i(o){var a=this;if(!(a instanceof i))return new i(o);if(a.constructor=i,o instanceof i){a.s=o.s,a.e=o.e,a.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(xc+o);if(o>0)a.s=1;else if(o<0)o=-o,a.s=-1;else{a.s=0,a.e=0,a.d=[0];return}if(o===~~o&&o<1e7){a.e=0,a.d=[o];return}return kD(a,o.toString())}else if(typeof o!="string")throw Error(xc+o);if(o.charCodeAt(0)===45?(o=o.slice(1),a.s=-1):a.s=1,kTe.test(o))kD(a,o);else throw Error(xc+o)}if(i.prototype=Ke,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=KH,i.config=i.set=jTe,t===void 0&&(t={}),t)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],e=0;e=i[e+1]&&r<=i[e+2])this[n]=r;else throw Error(xc+n+": "+r);if((r=t[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(xc+n+": "+r);return this}var mP=KH(LTe);Ci=new mP(1);const sn=mP;function UTe(t){return zTe(t)||$Te(t)||BTe(t)||FTe()}function FTe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function BTe(t,e){if(t){if(typeof t=="string")return lT(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return lT(t,e)}}function $Te(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function zTe(t){if(Array.isArray(t))return lT(t)}function lT(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=e?n.apply(void 0,i):t(e-a,UD(function(){for(var s=arguments.length,l=new Array(s),c=0;ct.length)&&(e=t.length);for(var n=0,r=new Array(e);n"u"||!(Symbol.iterator in Object(t)))){var n=[],r=!0,i=!1,o=void 0;try{for(var a=t[Symbol.iterator](),s;!(r=(s=a.next()).done)&&(n.push(s.value),!(e&&n.length===e));r=!0);}catch(l){i=!0,o=l}finally{try{!r&&a.return!=null&&a.return()}finally{if(i)throw o}}return n}}function rMe(t){if(Array.isArray(t))return t}function eV(t){var e=Wp(t,2),n=e[0],r=e[1],i=n,o=r;return n>r&&(i=r,o=n),[i,o]}function tV(t,e,n){if(t.lte(0))return new sn(0);var r=Lb.getDigitCount(t.toNumber()),i=new sn(10).pow(r),o=t.div(i),a=r!==1?.05:.1,s=new sn(Math.ceil(o.div(a).toNumber())).add(n).mul(a),l=s.mul(i);return e?l:new sn(Math.ceil(l))}function iMe(t,e,n){var r=1,i=new sn(t);if(!i.isint()&&n){var o=Math.abs(t);o<1?(r=new sn(10).pow(Lb.getDigitCount(t)-1),i=new sn(Math.floor(i.div(r).toNumber())).mul(r)):o>1&&(i=new sn(Math.floor(t)))}else t===0?i=new sn(Math.floor((e-1)/2)):n||(i=new sn(Math.floor(t)));var a=Math.floor((e-1)/2),s=WTe(GTe(function(l){return i.add(new sn(l-a).mul(r)).toNumber()}),cT);return s(0,e)}function nV(t,e,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((e-t)/(n-1)))return{step:new sn(0),tickMin:new sn(0),tickMax:new sn(0)};var o=tV(new sn(e).sub(t).div(n-1),r,i),a;t<=0&&e>=0?a=new sn(0):(a=new sn(t).add(e).div(2),a=a.sub(new sn(a).mod(o)));var s=Math.ceil(a.sub(t).div(o).toNumber()),l=Math.ceil(new sn(e).sub(a).div(o).toNumber()),c=s+l+1;return c>n?nV(t,e,n,r,i+1):(c0?l+(n-c):l,s=e>0?s:s+(n-c)),{step:o,tickMin:a.sub(new sn(s).mul(o)),tickMax:a.add(new sn(l).mul(o))})}function oMe(t){var e=Wp(t,2),n=e[0],r=e[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=Math.max(i,2),s=eV([n,r]),l=Wp(s,2),c=l[0],u=l[1];if(c===-1/0||u===1/0){var d=u===1/0?[c].concat(dT(cT(0,i-1).map(function(){return 1/0}))):[].concat(dT(cT(0,i-1).map(function(){return-1/0})),[u]);return n>r?uT(d):d}if(c===u)return iMe(c,i,o);var f=nV(c,u,a,o),p=f.step,y=f.tickMin,v=f.tickMax,g=Lb.rangeStep(y,v.add(new sn(.1).mul(p)),p);return n>r?uT(g):g}function aMe(t,e){var n=Wp(t,2),r=n[0],i=n[1],o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=eV([r,i]),s=Wp(a,2),l=s[0],c=s[1];if(l===-1/0||c===1/0)return[r,i];if(l===c)return[l];var u=Math.max(e,2),d=tV(new sn(c).sub(l).div(u-1),o,0),f=[].concat(dT(Lb.rangeStep(new sn(l),new sn(c).sub(new sn(.99).mul(d)),d)),[c]);return r>i?uT(f):f}var sMe=ZH(oMe),lMe=ZH(aMe),cMe="Invariant failed";function jc(t,e){throw new Error(cMe)}var uMe=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Jd(t){"@babel/helpers - typeof";return Jd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jd(t)}function d0(){return d0=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function vMe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function yMe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function xMe(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,a=-1,s=(n=r==null?void 0:r.length)!==null&&n!==void 0?n:0;if(s<=1)return 0;if(o&&o.axisType==="angleAxis"&&Math.abs(Math.abs(o.range[1]-o.range[0])-360)<=1e-6)for(var l=o.range,c=0;c0?i[c-1].coordinate:i[s-1].coordinate,d=i[c].coordinate,f=c>=s-1?i[0].coordinate:i[c+1].coordinate,p=void 0;if(Do(d-u)!==Do(f-d)){var y=[];if(Do(f-d)===Do(l[1]-l[0])){p=f;var v=d+l[1]-l[0];y[0]=Math.min(v,(v+u)/2),y[1]=Math.max(v,(v+u)/2)}else{p=u;var g=f+l[1]-l[0];y[0]=Math.min(d,(g+d)/2),y[1]=Math.max(d,(g+d)/2)}var m=[Math.min(d,(p+d)/2),Math.max(d,(p+d)/2)];if(e>m[0]&&e<=m[1]||e>=y[0]&&e<=y[1]){a=i[c].index;break}}else{var x=Math.min(u,f),b=Math.max(u,f);if(e>(x+d)/2&&e<=(b+d)/2){a=i[c].index;break}}}else for(var S=0;S0&&S(r[S].coordinate+r[S-1].coordinate)/2&&e<=(r[S].coordinate+r[S+1].coordinate)/2||S===s-1&&e>(r[S].coordinate+r[S-1].coordinate)/2){a=r[S].index;break}return a},gP=function(e){var n,r=e,i=r.type.displayName,o=(n=e.type)!==null&&n!==void 0&&n.defaultProps?In(In({},e.type.defaultProps),e.props):e.props,a=o.stroke,s=o.fill,l;switch(i){case"Line":l=a;break;case"Area":case"Radar":l=a&&a!=="none"?a:s;break;default:l=s;break}return l},kMe=function(e){var n=e.barSize,r=e.totalSize,i=e.stackGroups,o=i===void 0?{}:i;if(!o)return{};for(var a={},s=Object.keys(o),l=0,c=s.length;l=0});if(m&&m.length){var x=m[0].type.defaultProps,b=x!==void 0?In(In({},x),m[0].props):m[0].props,S=b.barSize,w=b[g];a[w]||(a[w]=[]);var E=Ut(S)?n:S;a[w].push({item:m[0],stackList:m.slice(1),barSize:Ut(E)?void 0:Lc(E,r,0)})}}return a},jMe=function(e){var n=e.barGap,r=e.barCategoryGap,i=e.bandSize,o=e.sizeList,a=o===void 0?[]:o,s=e.maxBarSize,l=a.length;if(l<1)return null;var c=Lc(n,i,0,!0),u,d=[];if(a[0].barSize===+a[0].barSize){var f=!1,p=i/l,y=a.reduce(function(S,w){return S+w.barSize||0},0);y+=(l-1)*c,y>=i&&(y-=(l-1)*c,c=0),y>=i&&p>0&&(f=!0,p*=.9,y=l*p);var v=(i-y)/2>>0,g={offset:v-c,size:0};u=a.reduce(function(S,w){var E={item:w.item,position:{offset:g.offset+g.size+c,size:f?p:w.barSize}},T=[].concat($D(S),[E]);return g=T[T.length-1].position,w.stackList&&w.stackList.length&&w.stackList.forEach(function(A){T.push({item:A,position:g})}),T},d)}else{var m=Lc(r,i,0,!0);i-2*m-(l-1)*c<=0&&(c=0);var x=(i-2*m-(l-1)*c)/l;x>1&&(x>>=0);var b=s===+s?Math.min(x,s):x;u=a.reduce(function(S,w,E){var T=[].concat($D(S),[{item:w.item,position:{offset:m+(x+c)*E+(x-b)/2,size:b}}]);return w.stackList&&w.stackList.length&&w.stackList.forEach(function(A){T.push({item:A,position:T[T.length-1].position})}),T},d)}return u},UMe=function(e,n,r,i){var o=r.children,a=r.width,s=r.margin,l=a-(s.left||0)-(s.right||0),c=aV({children:o,legendWidth:l});if(c){var u=i||{},d=u.width,f=u.height,p=c.align,y=c.verticalAlign,v=c.layout;if((v==="vertical"||v==="horizontal"&&y==="middle")&&p!=="center"&&ze(e[p]))return In(In({},e),{},md({},p,e[p]+(d||0)));if((v==="horizontal"||v==="vertical"&&p==="center")&&y!=="middle"&&ze(e[y]))return In(In({},e),{},md({},y,e[y]+(f||0)))}return e},FMe=function(e,n,r){return Ut(n)?!0:e==="horizontal"?n==="yAxis":e==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},sV=function(e,n,r,i,o){var a=n.props.children,s=ro(a,Wm).filter(function(c){return FMe(i,o,c.props.direction)});if(s&&s.length){var l=s.map(function(c){return c.props.dataKey});return e.reduce(function(c,u){var d=Di(u,r);if(Ut(d))return c;var f=Array.isArray(d)?[Ob(d),Nb(d)]:[d,d],p=l.reduce(function(y,v){var g=Di(u,v,0),m=f[0]-Math.abs(Array.isArray(g)?g[0]:g),x=f[1]+Math.abs(Array.isArray(g)?g[1]:g);return[Math.min(m,y[0]),Math.max(x,y[1])]},[1/0,-1/0]);return[Math.min(p[0],c[0]),Math.max(p[1],c[1])]},[1/0,-1/0])}return null},BMe=function(e,n,r,i,o){var a=n.map(function(s){return sV(e,s,r,o,i)}).filter(function(s){return!Ut(s)});return a&&a.length?a.reduce(function(s,l){return[Math.min(s[0],l[0]),Math.max(s[1],l[1])]},[1/0,-1/0]):null},lV=function(e,n,r,i,o){var a=n.map(function(l){var c=l.props.dataKey;return r==="number"&&c&&sV(e,l,c,i)||Yh(e,c,r,o)});if(r==="number")return a.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]);var s={};return a.reduce(function(l,c){for(var u=0,d=c.length;u=2?Do(s[0]-s[1])*2*c:c,n&&(e.ticks||e.niceTicks)){var u=(e.ticks||e.niceTicks).map(function(d){var f=o?o.indexOf(d):d;return{coordinate:i(f)+c,value:d,offset:c}});return u.filter(function(d){return!Bm(d.coordinate)})}return e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map(function(d,f){return{coordinate:i(d)+c,value:d,index:f,offset:c}}):i.ticks&&!r?i.ticks(e.tickCount).map(function(d){return{coordinate:i(d)+c,value:d,offset:c}}):i.domain().map(function(d,f){return{coordinate:i(d)+c,value:o?o[d]:d,index:f,offset:c}})},rS=new WeakMap,gv=function(e,n){if(typeof n!="function")return e;rS.has(e)||rS.set(e,new WeakMap);var r=rS.get(e);if(r.has(n))return r.get(n);var i=function(){e.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,i),i},$Me=function(e,n,r){var i=e.scale,o=e.type,a=e.layout,s=e.axisType;if(i==="auto")return a==="radial"&&s==="radiusAxis"?{scale:Bp(),realScaleType:"band"}:a==="radial"&&s==="angleAxis"?{scale:a0(),realScaleType:"linear"}:o==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:Kh(),realScaleType:"point"}:o==="category"?{scale:Bp(),realScaleType:"band"}:{scale:a0(),realScaleType:"linear"};if(Dc(i)){var l="scale".concat(yb(i));return{scale:(LD[l]||Kh)(),realScaleType:LD[l]?l:"point"}}return jt(i)?{scale:i}:{scale:Kh(),realScaleType:"point"}},HD=1e-4,zMe=function(e){var n=e.domain();if(!(!n||n.length<=2)){var r=n.length,i=e.range(),o=Math.min(i[0],i[1])-HD,a=Math.max(i[0],i[1])+HD,s=e(n[0]),l=e(n[r-1]);(sa||la)&&e.domain([n[0],n[r-1]])}},HMe=function(e,n){if(!e)return null;for(var r=0,i=e.length;ri)&&(o[1]=i),o[0]>i&&(o[0]=i),o[1]=0?(e[s][r][0]=o,e[s][r][1]=o+l,o=e[s][r][1]):(e[s][r][0]=a,e[s][r][1]=a+l,a=e[s][r][1])}},WMe=function(e){var n=e.length;if(!(n<=0))for(var r=0,i=e[0].length;r=0?(e[a][r][0]=o,e[a][r][1]=o+s,o=e[a][r][1]):(e[a][r][0]=0,e[a][r][1]=0)}},XMe={sign:GMe,expand:sme,none:Hd,silhouette:lme,wiggle:cme,positive:WMe},qMe=function(e,n,r){var i=n.map(function(s){return s.props.dataKey}),o=XMe[r],a=ame().keys(i).value(function(s,l){return+Di(s,l,0)}).order(F1).offset(o);return a(e)},KMe=function(e,n,r,i,o,a){if(!e)return null;var s=a?n.reverse():n,l={},c=s.reduce(function(d,f){var p,y=(p=f.type)!==null&&p!==void 0&&p.defaultProps?In(In({},f.type.defaultProps),f.props):f.props,v=y.stackId,g=y.hide;if(g)return d;var m=y[r],x=d[m]||{hasStack:!1,stackGroups:{}};if(Yn(v)){var b=x.stackGroups[v]||{numericAxisId:r,cateAxisId:i,items:[]};b.items.push(f),x.hasStack=!0,x.stackGroups[v]=b}else x.stackGroups[$m("_stackId_")]={numericAxisId:r,cateAxisId:i,items:[f]};return In(In({},d),{},md({},m,x))},l),u={};return Object.keys(c).reduce(function(d,f){var p=c[f];if(p.hasStack){var y={};p.stackGroups=Object.keys(p.stackGroups).reduce(function(v,g){var m=p.stackGroups[g];return In(In({},v),{},md({},g,{numericAxisId:r,cateAxisId:i,items:m.items,stackedData:qMe(e,m.items,o)}))},y)}return In(In({},d),{},md({},f,p))},u)},YMe=function(e,n){var r=n.realScaleType,i=n.type,o=n.tickCount,a=n.originalDomain,s=n.allowDecimals,l=r||n.scale;if(l!=="auto"&&l!=="linear")return null;if(o&&i==="number"&&a&&(a[0]==="auto"||a[1]==="auto")){var c=e.domain();if(!c.length)return null;var u=sMe(c,o,s);return e.domain([Ob(u),Nb(u)]),{niceTicks:u}}if(o&&i==="number"){var d=e.domain(),f=lMe(d,o,s);return{niceTicks:f}}return null};function VD(t){var e=t.axis,n=t.ticks,r=t.bandSize,i=t.entry,o=t.index,a=t.dataKey;if(e.type==="category"){if(!e.allowDuplicatedCategory&&e.dataKey&&!Ut(i[e.dataKey])){var s=jy(n,"value",i[e.dataKey]);if(s)return s.coordinate+r/2}return n[o]?n[o].coordinate+r/2:null}var l=Di(i,Ut(a)?e.dataKey:a);return Ut(l)?null:e.scale(l)}var GD=function(e){var n=e.axis,r=e.ticks,i=e.offset,o=e.bandSize,a=e.entry,s=e.index;if(n.type==="category")return r[s]?r[s].coordinate+i:null;var l=Di(a,n.dataKey,n.domain[s]);return Ut(l)?null:n.scale(l)-o/2+i},JMe=function(e){var n=e.numericAxis,r=n.scale.domain();if(n.type==="number"){var i=Math.min(r[0],r[1]),o=Math.max(r[0],r[1]);return i<=0&&o>=0?0:o<0?o:i}return r[0]},ZMe=function(e,n){var r,i=(r=e.type)!==null&&r!==void 0&&r.defaultProps?In(In({},e.type.defaultProps),e.props):e.props,o=i.stackId;if(Yn(o)){var a=n[o];if(a){var s=a.items.indexOf(e);return s>=0?a.stackedData[s]:null}}return null},QMe=function(e){return e.reduce(function(n,r){return[Ob(r.concat([n[0]]).filter(ze)),Nb(r.concat([n[1]]).filter(ze))]},[1/0,-1/0])},uV=function(e,n,r){return Object.keys(e).reduce(function(i,o){var a=e[o],s=a.stackedData,l=s.reduce(function(c,u){var d=QMe(u.slice(n,r+1));return[Math.min(c[0],d[0]),Math.max(c[1],d[1])]},[1/0,-1/0]);return[Math.min(l[0],i[0]),Math.max(l[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},WD=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,XD=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,mT=function(e,n,r){if(jt(e))return e(n,r);if(!Array.isArray(e))return n;var i=[];if(ze(e[0]))i[0]=r?e[0]:Math.min(e[0],n[0]);else if(WD.test(e[0])){var o=+WD.exec(e[0])[1];i[0]=n[0]-o}else jt(e[0])?i[0]=e[0](n[0]):i[0]=n[0];if(ze(e[1]))i[1]=r?e[1]:Math.max(e[1],n[1]);else if(XD.test(e[1])){var a=+XD.exec(e[1])[1];i[1]=n[1]+a}else jt(e[1])?i[1]=e[1](n[1]):i[1]=n[1];return i},h0=function(e,n,r){if(e&&e.scale&&e.scale.bandwidth){var i=e.scale.bandwidth();if(!r||i>0)return i}if(e&&n&&n.length>=2){for(var o=VC(n,function(d){return d.coordinate}),a=1/0,s=1,l=o.length;sa&&(c=2*Math.PI-c),{radius:s,angle:rAe(c),angleInRadian:c}},aAe=function(e){var n=e.startAngle,r=e.endAngle,i=Math.floor(n/360),o=Math.floor(r/360),a=Math.min(i,o);return{startAngle:n-a*360,endAngle:r-a*360}},sAe=function(e,n){var r=n.startAngle,i=n.endAngle,o=Math.floor(r/360),a=Math.floor(i/360),s=Math.min(o,a);return e+s*360},JD=function(e,n){var r=e.x,i=e.y,o=oAe({x:r,y:i},n),a=o.radius,s=o.angle,l=n.innerRadius,c=n.outerRadius;if(ac)return!1;if(a===0)return!0;var u=aAe(n),d=u.startAngle,f=u.endAngle,p=s,y;if(d<=f){for(;p>f;)p-=360;for(;p=d&&p<=f}else{for(;p>d;)p-=360;for(;p=f&&p<=d}return y?YD(YD({},n),{},{radius:a,angle:sAe(p,n)}):null};function Yp(t){"@babel/helpers - typeof";return Yp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Yp(t)}var lAe=["offset"];function cAe(t){return hAe(t)||fAe(t)||dAe(t)||uAe()}function uAe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dAe(t,e){if(t){if(typeof t=="string")return gT(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return gT(t,e)}}function fAe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function hAe(t){if(Array.isArray(t))return gT(t)}function gT(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function mAe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function ZD(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 Xn(t){for(var e=1;e=0?1:-1,b,S;i==="insideStart"?(b=p+x*a,S=v):i==="insideEnd"?(b=y-x*a,S=!v):i==="end"&&(b=y+x*a,S=v),S=m<=0?S:!S;var w=vr(c,u,g,b),E=vr(c,u,g,b+(S?1:-1)*359),T="M".concat(w.x,",").concat(w.y,` + A`).concat(g,",").concat(g,",0,1,").concat(S?0:1,`, + `).concat(E.x,",").concat(E.y),A=Ut(e.id)?$m("recharts-radial-line-"):e.id;return Z.createElement("text",Jp({},r,{dominantBaseline:"central",className:zt("recharts-radial-bar-label",s)}),Z.createElement("defs",null,Z.createElement("path",{id:A,d:T})),Z.createElement("textPath",{xlinkHref:"#".concat(A)},n))},wAe=function(e){var n=e.viewBox,r=e.offset,i=e.position,o=n,a=o.cx,s=o.cy,l=o.innerRadius,c=o.outerRadius,u=o.startAngle,d=o.endAngle,f=(u+d)/2;if(i==="outside"){var p=vr(a,s,c+r,f),y=p.x,v=p.y;return{x:y,y:v,textAnchor:y>=a?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"end"};var g=(l+c)/2,m=vr(a,s,g,f),x=m.x,b=m.y;return{x,y:b,textAnchor:"middle",verticalAnchor:"middle"}},SAe=function(e){var n=e.viewBox,r=e.parentViewBox,i=e.offset,o=e.position,a=n,s=a.x,l=a.y,c=a.width,u=a.height,d=u>=0?1:-1,f=d*i,p=d>0?"end":"start",y=d>0?"start":"end",v=c>=0?1:-1,g=v*i,m=v>0?"end":"start",x=v>0?"start":"end";if(o==="top"){var b={x:s+c/2,y:l-d*i,textAnchor:"middle",verticalAnchor:p};return Xn(Xn({},b),r?{height:Math.max(l-r.y,0),width:c}:{})}if(o==="bottom"){var S={x:s+c/2,y:l+u+f,textAnchor:"middle",verticalAnchor:y};return Xn(Xn({},S),r?{height:Math.max(r.y+r.height-(l+u),0),width:c}:{})}if(o==="left"){var w={x:s-g,y:l+u/2,textAnchor:m,verticalAnchor:"middle"};return Xn(Xn({},w),r?{width:Math.max(w.x-r.x,0),height:u}:{})}if(o==="right"){var E={x:s+c+g,y:l+u/2,textAnchor:x,verticalAnchor:"middle"};return Xn(Xn({},E),r?{width:Math.max(r.x+r.width-E.x,0),height:u}:{})}var T=r?{width:c,height:u}:{};return o==="insideLeft"?Xn({x:s+g,y:l+u/2,textAnchor:x,verticalAnchor:"middle"},T):o==="insideRight"?Xn({x:s+c-g,y:l+u/2,textAnchor:m,verticalAnchor:"middle"},T):o==="insideTop"?Xn({x:s+c/2,y:l+f,textAnchor:"middle",verticalAnchor:y},T):o==="insideBottom"?Xn({x:s+c/2,y:l+u-f,textAnchor:"middle",verticalAnchor:p},T):o==="insideTopLeft"?Xn({x:s+g,y:l+f,textAnchor:x,verticalAnchor:y},T):o==="insideTopRight"?Xn({x:s+c-g,y:l+f,textAnchor:m,verticalAnchor:y},T):o==="insideBottomLeft"?Xn({x:s+g,y:l+u-f,textAnchor:x,verticalAnchor:p},T):o==="insideBottomRight"?Xn({x:s+c-g,y:l+u-f,textAnchor:m,verticalAnchor:p},T):Pf(o)&&(ze(o.x)||tc(o.x))&&(ze(o.y)||tc(o.y))?Xn({x:s+Lc(o.x,c),y:l+Lc(o.y,u),textAnchor:"end",verticalAnchor:"end"},T):Xn({x:s+c/2,y:l+u/2,textAnchor:"middle",verticalAnchor:"middle"},T)},EAe=function(e){return"cx"in e&&ze(e.cx)};function Nr(t){var e=t.offset,n=e===void 0?5:e,r=pAe(t,lAe),i=Xn({offset:n},r),o=i.viewBox,a=i.position,s=i.value,l=i.children,c=i.content,u=i.className,d=u===void 0?"":u,f=i.textBreakAll;if(!o||Ut(s)&&Ut(l)&&!_.isValidElement(c)&&!jt(c))return null;if(_.isValidElement(c))return _.cloneElement(c,i);var p;if(jt(c)){if(p=_.createElement(c,i),_.isValidElement(p))return p}else p=xAe(i);var y=EAe(o),v=$t(i,!0);if(y&&(a==="insideStart"||a==="insideEnd"||a==="end"))return _Ae(i,p,v);var g=y?wAe(i):SAe(i);return Z.createElement(Qy,Jp({className:zt("recharts-label",d)},v,g,{breakAll:f}),p)}Nr.displayName="Label";var fV=function(e){var n=e.cx,r=e.cy,i=e.angle,o=e.startAngle,a=e.endAngle,s=e.r,l=e.radius,c=e.innerRadius,u=e.outerRadius,d=e.x,f=e.y,p=e.top,y=e.left,v=e.width,g=e.height,m=e.clockWise,x=e.labelViewBox;if(x)return x;if(ze(v)&&ze(g)){if(ze(d)&&ze(f))return{x:d,y:f,width:v,height:g};if(ze(p)&&ze(y))return{x:p,y,width:v,height:g}}return ze(d)&&ze(f)?{x:d,y:f,width:0,height:0}:ze(n)&&ze(r)?{cx:n,cy:r,startAngle:o||i||0,endAngle:a||i||0,innerRadius:c||0,outerRadius:u||l||s||0,clockWise:m}:e.viewBox?e.viewBox:{}},TAe=function(e,n){return e?e===!0?Z.createElement(Nr,{key:"label-implicit",viewBox:n}):Yn(e)?Z.createElement(Nr,{key:"label-implicit",viewBox:n,value:e}):_.isValidElement(e)?e.type===Nr?_.cloneElement(e,{key:"label-implicit",viewBox:n}):Z.createElement(Nr,{key:"label-implicit",content:e,viewBox:n}):jt(e)?Z.createElement(Nr,{key:"label-implicit",content:e,viewBox:n}):Pf(e)?Z.createElement(Nr,Jp({viewBox:n},e,{key:"label-implicit"})):null:null},MAe=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var i=e.children,o=fV(e),a=ro(i,Nr).map(function(l,c){return _.cloneElement(l,{viewBox:n||o,key:"label-".concat(c)})});if(!r)return a;var s=TAe(e.label,n||o);return[s].concat(cAe(a))};Nr.parseViewBox=fV;Nr.renderCallByParent=MAe;function AAe(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var CAe=AAe;const PAe=dn(CAe);function Zp(t){"@babel/helpers - typeof";return Zp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zp(t)}var RAe=["valueAccessor"],NAe=["data","dataKey","clockWise","id","textBreakAll"];function OAe(t){return kAe(t)||LAe(t)||DAe(t)||IAe()}function IAe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function DAe(t,e){if(t){if(typeof t=="string")return vT(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vT(t,e)}}function LAe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function kAe(t){if(Array.isArray(t))return vT(t)}function vT(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function BAe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}var $Ae=function(e){return Array.isArray(e.value)?PAe(e.value):e.value};function il(t){var e=t.valueAccessor,n=e===void 0?$Ae:e,r=tL(t,RAe),i=r.data,o=r.dataKey,a=r.clockWise,s=r.id,l=r.textBreakAll,c=tL(r,NAe);return!i||!i.length?null:Z.createElement(kn,{className:"recharts-label-list"},i.map(function(u,d){var f=Ut(o)?n(u,d):Di(u&&u.payload,o),p=Ut(s)?{}:{id:"".concat(s,"-").concat(d)};return Z.createElement(Nr,m0({},$t(u,!0),c,p,{parentViewBox:u.parentViewBox,value:f,textBreakAll:l,viewBox:Nr.parseViewBox(Ut(a)?u:eL(eL({},u),{},{clockWise:a})),key:"label-".concat(d),index:d}))}))}il.displayName="LabelList";function zAe(t,e){return t?t===!0?Z.createElement(il,{key:"labelList-implicit",data:e}):Z.isValidElement(t)||jt(t)?Z.createElement(il,{key:"labelList-implicit",data:e,content:t}):Pf(t)?Z.createElement(il,m0({data:e},t,{key:"labelList-implicit"})):null:null}function HAe(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var r=t.children,i=ro(r,il).map(function(a,s){return _.cloneElement(a,{data:e,key:"labelList-".concat(s)})});if(!n)return i;var o=zAe(t.label,e);return[o].concat(OAe(i))}il.renderCallByParent=HAe;function Qp(t){"@babel/helpers - typeof";return Qp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qp(t)}function yT(){return yT=Object.assign?Object.assign.bind():function(t){for(var e=1;e180),",").concat(+(a>c),`, + `).concat(d.x,",").concat(d.y,` + `);if(i>0){var p=vr(n,r,i,a),y=vr(n,r,i,c);f+="L ".concat(y.x,",").concat(y.y,` + A `).concat(i,",").concat(i,`,0, + `).concat(+(Math.abs(l)>180),",").concat(+(a<=c),`, + `).concat(p.x,",").concat(p.y," Z")}else f+="L ".concat(n,",").concat(r," Z");return f},qAe=function(e){var n=e.cx,r=e.cy,i=e.innerRadius,o=e.outerRadius,a=e.cornerRadius,s=e.forceCornerRadius,l=e.cornerIsExternal,c=e.startAngle,u=e.endAngle,d=Do(u-c),f=vv({cx:n,cy:r,radius:o,angle:c,sign:d,cornerRadius:a,cornerIsExternal:l}),p=f.circleTangency,y=f.lineTangency,v=f.theta,g=vv({cx:n,cy:r,radius:o,angle:u,sign:-d,cornerRadius:a,cornerIsExternal:l}),m=g.circleTangency,x=g.lineTangency,b=g.theta,S=l?Math.abs(c-u):Math.abs(c-u)-v-b;if(S<0)return s?"M ".concat(y.x,",").concat(y.y,` + a`).concat(a,",").concat(a,",0,0,1,").concat(a*2,`,0 + a`).concat(a,",").concat(a,",0,0,1,").concat(-a*2,`,0 + `):hV({cx:n,cy:r,innerRadius:i,outerRadius:o,startAngle:c,endAngle:u});var w="M ".concat(y.x,",").concat(y.y,` + A`).concat(a,",").concat(a,",0,0,").concat(+(d<0),",").concat(p.x,",").concat(p.y,` + A`).concat(o,",").concat(o,",0,").concat(+(S>180),",").concat(+(d<0),",").concat(m.x,",").concat(m.y,` + A`).concat(a,",").concat(a,",0,0,").concat(+(d<0),",").concat(x.x,",").concat(x.y,` + `);if(i>0){var E=vv({cx:n,cy:r,radius:i,angle:c,sign:d,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),T=E.circleTangency,A=E.lineTangency,M=E.theta,C=vv({cx:n,cy:r,radius:i,angle:u,sign:-d,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),P=C.circleTangency,R=C.lineTangency,D=C.theta,k=l?Math.abs(c-u):Math.abs(c-u)-M-D;if(k<0&&a===0)return"".concat(w,"L").concat(n,",").concat(r,"Z");w+="L".concat(R.x,",").concat(R.y,` + A`).concat(a,",").concat(a,",0,0,").concat(+(d<0),",").concat(P.x,",").concat(P.y,` + A`).concat(i,",").concat(i,",0,").concat(+(k>180),",").concat(+(d>0),",").concat(T.x,",").concat(T.y,` + A`).concat(a,",").concat(a,",0,0,").concat(+(d<0),",").concat(A.x,",").concat(A.y,"Z")}else w+="L".concat(n,",").concat(r,"Z");return w},KAe={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},pV=function(e){var n=rL(rL({},KAe),e),r=n.cx,i=n.cy,o=n.innerRadius,a=n.outerRadius,s=n.cornerRadius,l=n.forceCornerRadius,c=n.cornerIsExternal,u=n.startAngle,d=n.endAngle,f=n.className;if(a0&&Math.abs(u-d)<360?g=qAe({cx:r,cy:i,innerRadius:o,outerRadius:a,cornerRadius:Math.min(v,y/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:d}):g=hV({cx:r,cy:i,innerRadius:o,outerRadius:a,startAngle:u,endAngle:d}),Z.createElement("path",yT({},$t(n,!0),{className:p,d:g,role:"img"}))};function em(t){"@babel/helpers - typeof";return em=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},em(t)}function xT(){return xT=Object.assign?Object.assign.bind():function(t){for(var e=1;e0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function pCe(t,e){return Jc(t.getTime(),e.getTime())}function mCe(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function gCe(t,e){return t===e}function dL(t,e,n){var r=t.size;if(r!==e.size)return!1;if(!r)return!0;for(var i=new Array(r),o=t.entries(),a,s,l=0;(a=o.next())&&!a.done;){for(var c=e.entries(),u=!1,d=0;(s=c.next())&&!s.done;){if(i[d]){d++;continue}var f=a.value,p=s.value;if(n.equals(f[0],p[0],l,d,t,e,n)&&n.equals(f[1],p[1],f[0],p[0],t,e,n)){u=i[d]=!0;break}d++}if(!u)return!1;l++}return!0}var vCe=Jc;function yCe(t,e,n){var r=uL(t),i=r.length;if(uL(e).length!==i)return!1;for(;i-- >0;)if(!yV(t,e,n,r[i]))return!1;return!0}function bh(t,e,n){var r=lL(t),i=r.length;if(lL(e).length!==i)return!1;for(var o,a,s;i-- >0;)if(o=r[i],!yV(t,e,n,o)||(a=cL(t,o),s=cL(e,o),(a||s)&&(!a||!s||a.configurable!==s.configurable||a.enumerable!==s.enumerable||a.writable!==s.writable)))return!1;return!0}function xCe(t,e){return Jc(t.valueOf(),e.valueOf())}function bCe(t,e){return t.source===e.source&&t.flags===e.flags}function fL(t,e,n){var r=t.size;if(r!==e.size)return!1;if(!r)return!0;for(var i=new Array(r),o=t.values(),a,s;(a=o.next())&&!a.done;){for(var l=e.values(),c=!1,u=0;(s=l.next())&&!s.done;){if(!i[u]&&n.equals(a.value,s.value,a.value,s.value,t,e,n)){c=i[u]=!0;break}u++}if(!c)return!1}return!0}function _Ce(t,e){var n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}function wCe(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function yV(t,e,n,r){return(r===fCe||r===dCe||r===uCe)&&(t.$$typeof||e.$$typeof)?!0:cCe(e,r)&&n.equals(t[r],e[r],r,r,t,e,n)}var SCe="[object Arguments]",ECe="[object Boolean]",TCe="[object Date]",MCe="[object Error]",ACe="[object Map]",CCe="[object Number]",PCe="[object Object]",RCe="[object RegExp]",NCe="[object Set]",OCe="[object String]",ICe="[object URL]",DCe=Array.isArray,hL=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,pL=Object.assign,LCe=Object.prototype.toString.call.bind(Object.prototype.toString);function kCe(t){var e=t.areArraysEqual,n=t.areDatesEqual,r=t.areErrorsEqual,i=t.areFunctionsEqual,o=t.areMapsEqual,a=t.areNumbersEqual,s=t.areObjectsEqual,l=t.arePrimitiveWrappersEqual,c=t.areRegExpsEqual,u=t.areSetsEqual,d=t.areTypedArraysEqual,f=t.areUrlsEqual;return function(y,v,g){if(y===v)return!0;if(y==null||v==null)return!1;var m=typeof y;if(m!==typeof v)return!1;if(m!=="object")return m==="number"?a(y,v,g):m==="function"?i(y,v,g):!1;var x=y.constructor;if(x!==v.constructor)return!1;if(x===Object)return s(y,v,g);if(DCe(y))return e(y,v,g);if(hL!=null&&hL(y))return d(y,v,g);if(x===Date)return n(y,v,g);if(x===RegExp)return c(y,v,g);if(x===Map)return o(y,v,g);if(x===Set)return u(y,v,g);var b=LCe(y);return b===TCe?n(y,v,g):b===RCe?c(y,v,g):b===ACe?o(y,v,g):b===NCe?u(y,v,g):b===PCe?typeof y.then!="function"&&typeof v.then!="function"&&s(y,v,g):b===ICe?f(y,v,g):b===MCe?r(y,v,g):b===SCe?s(y,v,g):b===ECe||b===CCe||b===OCe?l(y,v,g):!1}}function jCe(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,i={areArraysEqual:r?bh:hCe,areDatesEqual:pCe,areErrorsEqual:mCe,areFunctionsEqual:gCe,areMapsEqual:r?sL(dL,bh):dL,areNumbersEqual:vCe,areObjectsEqual:r?bh:yCe,arePrimitiveWrappersEqual:xCe,areRegExpsEqual:bCe,areSetsEqual:r?sL(fL,bh):fL,areTypedArraysEqual:r?bh:_Ce,areUrlsEqual:wCe};if(n&&(i=pL({},i,n(i))),e){var o=xv(i.areArraysEqual),a=xv(i.areMapsEqual),s=xv(i.areObjectsEqual),l=xv(i.areSetsEqual);i=pL({},i,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:s,areSetsEqual:l})}return i}function UCe(t){return function(e,n,r,i,o,a,s){return t(e,n,s)}}function FCe(t){var e=t.circular,n=t.comparator,r=t.createState,i=t.equals,o=t.strict;if(r)return function(l,c){var u=r(),d=u.cache,f=d===void 0?e?new WeakMap:void 0:d,p=u.meta;return n(l,c,{cache:f,equals:i,meta:p,strict:o})};if(e)return function(l,c){return n(l,c,{cache:new WeakMap,equals:i,meta:void 0,strict:o})};var a={cache:void 0,equals:i,meta:void 0,strict:o};return function(l,c){return n(l,c,a)}}var BCe=Nl();Nl({strict:!0});Nl({circular:!0});Nl({circular:!0,strict:!0});Nl({createInternalComparator:function(){return Jc}});Nl({strict:!0,createInternalComparator:function(){return Jc}});Nl({circular:!0,createInternalComparator:function(){return Jc}});Nl({circular:!0,createInternalComparator:function(){return Jc},strict:!0});function Nl(t){t===void 0&&(t={});var e=t.circular,n=e===void 0?!1:e,r=t.createInternalComparator,i=t.createState,o=t.strict,a=o===void 0?!1:o,s=jCe(t),l=kCe(s),c=r?r(l):UCe(l);return FCe({circular:n,comparator:l,createState:i,equals:c,strict:a})}function $Ce(t){typeof requestAnimationFrame<"u"&&requestAnimationFrame(t)}function mL(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function i(o){n<0&&(n=o),o-n>e?(t(o),n=-1):$Ce(i)};requestAnimationFrame(r)}function _T(t){"@babel/helpers - typeof";return _T=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_T(t)}function zCe(t){return WCe(t)||GCe(t)||VCe(t)||HCe()}function HCe(){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 VCe(t,e){if(t){if(typeof t=="string")return gL(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return gL(t,e)}}function gL(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n1?1:m<0?0:m},v=function(m){for(var x=m>1?1:m,b=x,S=0;S<8;++S){var w=d(b)-x,E=p(b);if(Math.abs(w-x)0&&arguments[0]!==void 0?arguments[0]:{},n=e.stiff,r=n===void 0?100:n,i=e.damping,o=i===void 0?8:i,a=e.dt,s=a===void 0?17:a,l=function(u,d,f){var p=-(u-d)*r,y=f*o,v=f+(p-y)*s/1e3,g=f*s/1e3+u;return Math.abs(g-d)t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function SPe(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function iS(t){return APe(t)||MPe(t)||TPe(t)||EPe()}function EPe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function TPe(t,e){if(t){if(typeof t=="string")return MT(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return MT(t,e)}}function MPe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function APe(t){if(Array.isArray(t))return MT(t)}function MT(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function y0(t){return y0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},y0(t)}var us=function(t){OPe(n,t);var e=IPe(n);function n(r,i){var o;CPe(this,n),o=e.call(this,r,i);var a=o.props,s=a.isActive,l=a.attributeName,c=a.from,u=a.to,d=a.steps,f=a.children,p=a.duration;if(o.handleStyleChange=o.handleStyleChange.bind(PT(o)),o.changeStyle=o.changeStyle.bind(PT(o)),!s||p<=0)return o.state={style:{}},typeof f=="function"&&(o.state={style:u}),CT(o);if(d&&d.length)o.state={style:d[0].style};else if(c){if(typeof f=="function")return o.state={style:c},CT(o);o.state={style:l?Dh({},l,c):c}}else o.state={style:{}};return o}return RPe(n,[{key:"componentDidMount",value:function(){var i=this.props,o=i.isActive,a=i.canBegin;this.mounted=!0,!(!o||!a)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var o=this.props,a=o.isActive,s=o.canBegin,l=o.attributeName,c=o.shouldReAnimate,u=o.to,d=o.from,f=this.state.style;if(s){if(!a){var p={style:l?Dh({},l,u):u};this.state&&f&&(l&&f[l]!==u||!l&&f!==u)&&this.setState(p);return}if(!(BCe(i.to,u)&&i.canBegin&&i.isActive)){var y=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var v=y||c?d:i.to;if(this.state&&f){var g={style:l?Dh({},l,v):v};(l&&f[l]!==v||!l&&f!==v)&&this.setState(g)}this.runAnimation(mo(mo({},this.props),{},{from:v,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var o=this,a=i.from,s=i.to,l=i.duration,c=i.easing,u=i.begin,d=i.onAnimationEnd,f=i.onAnimationStart,p=bPe(a,s,cPe(c),l,this.changeStyle),y=function(){o.stopJSAnimation=p()};this.manager.start([f,u,y,l,d])}},{key:"runStepAnimation",value:function(i){var o=this,a=i.steps,s=i.begin,l=i.onAnimationStart,c=a[0],u=c.style,d=c.duration,f=d===void 0?0:d,p=function(v,g,m){if(m===0)return v;var x=g.duration,b=g.easing,S=b===void 0?"ease":b,w=g.style,E=g.properties,T=g.onAnimationEnd,A=m>0?a[m-1]:g,M=E||Object.keys(w);if(typeof S=="function"||S==="spring")return[].concat(iS(v),[o.runJSAnimation.bind(o,{from:A.style,to:w,duration:x,easing:S}),x]);var C=xL(M,x,S),P=mo(mo(mo({},A.style),w),{},{transition:C});return[].concat(iS(v),[P,x,T]).filter(JCe)};return this.manager.start([l].concat(iS(a.reduce(p,[u,Math.max(f,s)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=XCe());var o=i.begin,a=i.duration,s=i.attributeName,l=i.to,c=i.easing,u=i.onAnimationStart,d=i.onAnimationEnd,f=i.steps,p=i.children,y=this.manager;if(this.unSubscribe=y.subscribe(this.handleStyleChange),typeof c=="function"||typeof p=="function"||c==="spring"){this.runJSAnimation(i);return}if(f.length>1){this.runStepAnimation(i);return}var v=s?Dh({},s,l):l,g=xL(Object.keys(v),a,c);y.start([u,o,mo(mo({},v),{},{transition:g}),a,d])}},{key:"render",value:function(){var i=this.props,o=i.children;i.begin;var a=i.duration;i.attributeName,i.easing;var s=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var l=wPe(i,_Pe),c=_.Children.count(o),u=this.state.style;if(typeof o=="function")return o(u);if(!s||c===0||a<=0)return o;var d=function(p){var y=p.props,v=y.style,g=v===void 0?{}:v,m=y.className,x=_.cloneElement(p,mo(mo({},l),{},{style:mo(mo({},g),u),className:m}));return x};return c===1?d(_.Children.only(o)):Z.createElement("div",null,_.Children.map(o,function(f){return d(f)}))}}]),n}(_.PureComponent);us.displayName="Animate";us.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};us.propTypes={from:Jt.oneOfType([Jt.object,Jt.string]),to:Jt.oneOfType([Jt.object,Jt.string]),attributeName:Jt.string,duration:Jt.number,begin:Jt.number,easing:Jt.oneOfType([Jt.string,Jt.func]),steps:Jt.arrayOf(Jt.shape({duration:Jt.number.isRequired,style:Jt.object.isRequired,easing:Jt.oneOfType([Jt.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Jt.func]),properties:Jt.arrayOf("string"),onAnimationEnd:Jt.func})),children:Jt.oneOfType([Jt.node,Jt.func]),isActive:Jt.bool,canBegin:Jt.bool,onAnimationEnd:Jt.func,shouldReAnimate:Jt.bool,onAnimationStart:Jt.func,onAnimationReStart:Jt.func};function rm(t){"@babel/helpers - typeof";return rm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rm(t)}function x0(){return x0=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0?1:-1,l=r>=0?1:-1,c=i>=0&&r>=0||i<0&&r<0?1:0,u;if(a>0&&o instanceof Array){for(var d=[0,0,0,0],f=0,p=4;fa?a:o[f];u="M".concat(e,",").concat(n+s*d[0]),d[0]>0&&(u+="A ".concat(d[0],",").concat(d[0],",0,0,").concat(c,",").concat(e+l*d[0],",").concat(n)),u+="L ".concat(e+r-l*d[1],",").concat(n),d[1]>0&&(u+="A ".concat(d[1],",").concat(d[1],",0,0,").concat(c,`, + `).concat(e+r,",").concat(n+s*d[1])),u+="L ".concat(e+r,",").concat(n+i-s*d[2]),d[2]>0&&(u+="A ".concat(d[2],",").concat(d[2],",0,0,").concat(c,`, + `).concat(e+r-l*d[2],",").concat(n+i)),u+="L ".concat(e+l*d[3],",").concat(n+i),d[3]>0&&(u+="A ".concat(d[3],",").concat(d[3],",0,0,").concat(c,`, + `).concat(e,",").concat(n+i-s*d[3])),u+="Z"}else if(a>0&&o===+o&&o>0){var y=Math.min(a,o);u="M ".concat(e,",").concat(n+s*y,` + A `).concat(y,",").concat(y,",0,0,").concat(c,",").concat(e+l*y,",").concat(n,` + L `).concat(e+r-l*y,",").concat(n,` + A `).concat(y,",").concat(y,",0,0,").concat(c,",").concat(e+r,",").concat(n+s*y,` + L `).concat(e+r,",").concat(n+i-s*y,` + A `).concat(y,",").concat(y,",0,0,").concat(c,",").concat(e+r-l*y,",").concat(n+i,` + L `).concat(e+l*y,",").concat(n+i,` + A `).concat(y,",").concat(y,",0,0,").concat(c,",").concat(e,",").concat(n+i-s*y," Z")}else u="M ".concat(e,",").concat(n," h ").concat(r," v ").concat(i," h ").concat(-r," Z");return u},HPe=function(e,n){if(!e||!n)return!1;var r=e.x,i=e.y,o=n.x,a=n.y,s=n.width,l=n.height;if(Math.abs(s)>0&&Math.abs(l)>0){var c=Math.min(o,o+s),u=Math.max(o,o+s),d=Math.min(a,a+l),f=Math.max(a,a+l);return r>=c&&r<=u&&i>=d&&i<=f}return!1},VPe={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},vP=function(e){var n=AL(AL({},VPe),e),r=_.useRef(),i=_.useState(-1),o=LPe(i,2),a=o[0],s=o[1];_.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var S=r.current.getTotalLength();S&&s(S)}catch{}},[]);var l=n.x,c=n.y,u=n.width,d=n.height,f=n.radius,p=n.className,y=n.animationEasing,v=n.animationDuration,g=n.animationBegin,m=n.isAnimationActive,x=n.isUpdateAnimationActive;if(l!==+l||c!==+c||u!==+u||d!==+d||u===0||d===0)return null;var b=zt("recharts-rectangle",p);return x?Z.createElement(us,{canBegin:a>0,from:{width:u,height:d,x:l,y:c},to:{width:u,height:d,x:l,y:c},duration:v,animationEasing:y,isActive:x},function(S){var w=S.width,E=S.height,T=S.x,A=S.y;return Z.createElement(us,{canBegin:a>0,from:"0px ".concat(a===-1?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:v,isActive:m,easing:y},Z.createElement("path",x0({},$t(n,!0),{className:b,d:CL(T,A,w,E,f),ref:r})))}):Z.createElement("path",x0({},$t(n,!0),{className:b,d:CL(l,c,u,d,f)}))};function RT(){return RT=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function JPe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}var ZPe=function(e,n,r,i,o,a){return"M".concat(e,",").concat(o,"v").concat(i,"M").concat(a,",").concat(n,"h").concat(r)},QPe=function(e){var n=e.x,r=n===void 0?0:n,i=e.y,o=i===void 0?0:i,a=e.top,s=a===void 0?0:a,l=e.left,c=l===void 0?0:l,u=e.width,d=u===void 0?0:u,f=e.height,p=f===void 0?0:f,y=e.className,v=YPe(e,GPe),g=WPe({x:r,y:o,top:s,left:c,width:d,height:p},v);return!ze(r)||!ze(o)||!ze(d)||!ze(p)||!ze(s)||!ze(c)?null:Z.createElement("path",NT({},$t(g,!0),{className:zt("recharts-cross",y),d:ZPe(r,o,d,p,s,c)}))},eRe=B5,tRe=eRe(Object.getPrototypeOf,Object),nRe=tRe,rRe=hs,iRe=nRe,oRe=ps,aRe="[object Object]",sRe=Function.prototype,lRe=Object.prototype,TV=sRe.toString,cRe=lRe.hasOwnProperty,uRe=TV.call(Object);function dRe(t){if(!oRe(t)||rRe(t)!=aRe)return!1;var e=iRe(t);if(e===null)return!0;var n=cRe.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&TV.call(n)==uRe}var fRe=dRe;const hRe=dn(fRe);var pRe=hs,mRe=ps,gRe="[object Boolean]";function vRe(t){return t===!0||t===!1||mRe(t)&&pRe(t)==gRe}var yRe=vRe;const xRe=dn(yRe);function om(t){"@babel/helpers - typeof";return om=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},om(t)}function b0(){return b0=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n0,from:{upperWidth:0,lowerWidth:0,height:f,x:l,y:c},to:{upperWidth:u,lowerWidth:d,height:f,x:l,y:c},duration:v,animationEasing:y,isActive:m},function(b){var S=b.upperWidth,w=b.lowerWidth,E=b.height,T=b.x,A=b.y;return Z.createElement(us,{canBegin:a>0,from:"0px ".concat(a===-1?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:v,easing:y},Z.createElement("path",b0({},$t(n,!0),{className:x,d:IL(T,A,S,w,E),ref:r})))}):Z.createElement("g",null,Z.createElement("path",b0({},$t(n,!0),{className:x,d:IL(l,c,u,d,f)})))},RRe=["option","shapeType","propTransformer","activeClassName","isActive"];function am(t){"@babel/helpers - typeof";return am=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},am(t)}function NRe(t,e){if(t==null)return{};var n=ORe(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function ORe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function DL(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 _0(t){for(var e=1;e0&&r.handleDrag(i.changedTouches[0])}),wi(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=r.props,o=i.endIndex,a=i.onDragEnd,s=i.startIndex;a==null||a({endIndex:o,startIndex:s})}),r.detachDragEndListener()}),wi(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),wi(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),wi(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),wi(r,"handleSlideDragStart",function(i){var o=$L(i)?i.changedTouches[0]:i;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:o.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return vNe(e,t),hNe(e,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var i=r.startX,o=r.endX,a=this.state.scaleValues,s=this.props,l=s.gap,c=s.data,u=c.length-1,d=Math.min(i,o),f=Math.max(i,o),p=e.getIndexInRange(a,d),y=e.getIndexInRange(a,f);return{startIndex:p-p%l,endIndex:y===u?u:y-y%l}}},{key:"getTextOfTick",value:function(r){var i=this.props,o=i.data,a=i.tickFormatter,s=i.dataKey,l=Di(o[r],s,r);return jt(a)?a(l,r):l}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var i=this.state,o=i.slideMoveStartX,a=i.startX,s=i.endX,l=this.props,c=l.x,u=l.width,d=l.travellerWidth,f=l.startIndex,p=l.endIndex,y=l.onChange,v=r.pageX-o;v>0?v=Math.min(v,c+u-d-s,c+u-d-a):v<0&&(v=Math.max(v,c-a,c-s));var g=this.getIndex({startX:a+v,endX:s+v});(g.startIndex!==f||g.endIndex!==p)&&y&&y(g),this.setState({startX:a+v,endX:s+v,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,i){var o=$L(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:o.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var i=this.state,o=i.brushMoveStartX,a=i.movingTravellerId,s=i.endX,l=i.startX,c=this.state[a],u=this.props,d=u.x,f=u.width,p=u.travellerWidth,y=u.onChange,v=u.gap,g=u.data,m={startX:this.state.startX,endX:this.state.endX},x=r.pageX-o;x>0?x=Math.min(x,d+f-p-c):x<0&&(x=Math.max(x,d-c)),m[a]=c+x;var b=this.getIndex(m),S=b.startIndex,w=b.endIndex,E=function(){var A=g.length-1;return a==="startX"&&(s>l?S%v===0:w%v===0)||sl?w%v===0:S%v===0)||s>l&&w===A};this.setState(wi(wi({},a,c+x),"brushMoveStartX",r.pageX),function(){y&&E()&&y(b)})}},{key:"handleTravellerMoveKeyboard",value:function(r,i){var o=this,a=this.state,s=a.scaleValues,l=a.startX,c=a.endX,u=this.state[i],d=s.indexOf(u);if(d!==-1){var f=d+r;if(!(f===-1||f>=s.length)){var p=s[f];i==="startX"&&p>=c||i==="endX"&&p<=l||this.setState(wi({},i,p),function(){o.props.onChange(o.getIndex({startX:o.state.startX,endX:o.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,i=r.x,o=r.y,a=r.width,s=r.height,l=r.fill,c=r.stroke;return Z.createElement("rect",{stroke:c,fill:l,x:i,y:o,width:a,height:s})}},{key:"renderPanorama",value:function(){var r=this.props,i=r.x,o=r.y,a=r.width,s=r.height,l=r.data,c=r.children,u=r.padding,d=_.Children.only(c);return d?Z.cloneElement(d,{x:i,y:o,width:a,height:s,margin:u,compact:!0,data:l}):null}},{key:"renderTravellerLayer",value:function(r,i){var o,a,s=this,l=this.props,c=l.y,u=l.travellerWidth,d=l.height,f=l.traveller,p=l.ariaLabel,y=l.data,v=l.startIndex,g=l.endIndex,m=Math.max(r,this.props.x),x=aS(aS({},$t(this.props,!1)),{},{x:m,y:c,width:u,height:d}),b=p||"Min value: ".concat((o=y[v])===null||o===void 0?void 0:o.name,", Max value: ").concat((a=y[g])===null||a===void 0?void 0:a.name);return Z.createElement(kn,{tabIndex:0,role:"slider","aria-label":b,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(w){["ArrowLeft","ArrowRight"].includes(w.key)&&(w.preventDefault(),w.stopPropagation(),s.handleTravellerMoveKeyboard(w.key==="ArrowRight"?1:-1,i))},onFocus:function(){s.setState({isTravellerFocused:!0})},onBlur:function(){s.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},e.renderTraveller(f,x))}},{key:"renderSlide",value:function(r,i){var o=this.props,a=o.y,s=o.height,l=o.stroke,c=o.travellerWidth,u=Math.min(r,i)+c,d=Math.max(Math.abs(i-r)-c,0);return Z.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:l,fillOpacity:.2,x:u,y:a,width:d,height:s})}},{key:"renderText",value:function(){var r=this.props,i=r.startIndex,o=r.endIndex,a=r.y,s=r.height,l=r.travellerWidth,c=r.stroke,u=this.state,d=u.startX,f=u.endX,p=5,y={pointerEvents:"none",fill:c};return Z.createElement(kn,{className:"recharts-brush-texts"},Z.createElement(Qy,S0({textAnchor:"end",verticalAnchor:"middle",x:Math.min(d,f)-p,y:a+s/2},y),this.getTextOfTick(i)),Z.createElement(Qy,S0({textAnchor:"start",verticalAnchor:"middle",x:Math.max(d,f)+l+p,y:a+s/2},y),this.getTextOfTick(o)))}},{key:"render",value:function(){var r=this.props,i=r.data,o=r.className,a=r.children,s=r.x,l=r.y,c=r.width,u=r.height,d=r.alwaysShowText,f=this.state,p=f.startX,y=f.endX,v=f.isTextActive,g=f.isSlideMoving,m=f.isTravellerMoving,x=f.isTravellerFocused;if(!i||!i.length||!ze(s)||!ze(l)||!ze(c)||!ze(u)||c<=0||u<=0)return null;var b=zt("recharts-brush",o),S=Z.Children.count(a)===1,w=dNe("userSelect","none");return Z.createElement(kn,{className:b,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:w},this.renderBackground(),S&&this.renderPanorama(),this.renderSlide(p,y),this.renderTravellerLayer(p,"startX"),this.renderTravellerLayer(y,"endX"),(v||g||m||x||d)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var i=r.x,o=r.y,a=r.width,s=r.height,l=r.stroke,c=Math.floor(o+s/2)-1;return Z.createElement(Z.Fragment,null,Z.createElement("rect",{x:i,y:o,width:a,height:s,fill:l,stroke:"none"}),Z.createElement("line",{x1:i+1,y1:c,x2:i+a-1,y2:c,fill:"none",stroke:"#fff"}),Z.createElement("line",{x1:i+1,y1:c+2,x2:i+a-1,y2:c+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,i){var o;return Z.isValidElement(r)?o=Z.cloneElement(r,i):jt(r)?o=r(i):o=e.renderDefaultTraveller(i),o}},{key:"getDerivedStateFromProps",value:function(r,i){var o=r.data,a=r.width,s=r.x,l=r.travellerWidth,c=r.updateId,u=r.startIndex,d=r.endIndex;if(o!==i.prevData||c!==i.prevUpdateId)return aS({prevData:o,prevTravellerWidth:l,prevUpdateId:c,prevX:s,prevWidth:a},o&&o.length?xNe({data:o,width:a,x:s,travellerWidth:l,startIndex:u,endIndex:d}):{scale:null,scaleValues:null});if(i.scale&&(a!==i.prevWidth||s!==i.prevX||l!==i.prevTravellerWidth)){i.scale.range([s,s+a-l]);var f=i.scale.domain().map(function(p){return i.scale(p)});return{prevData:o,prevTravellerWidth:l,prevUpdateId:c,prevX:s,prevWidth:a,startX:i.scale(r.startIndex),endX:i.scale(r.endIndex),scaleValues:f}}return null}},{key:"getIndexInRange",value:function(r,i){for(var o=r.length,a=0,s=o-1;s-a>1;){var l=Math.floor((a+s)/2);r[l]>i?s=l:a=l}return i>=r[s]?s:a}}])}(_.PureComponent);wi(ef,"displayName","Brush");wi(ef,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var bNe=HC;function _Ne(t,e){var n;return bNe(t,function(r,i,o){return n=e(r,i,o),!n}),!!n}var wNe=_Ne,SNe=O5,ENe=kf,TNe=wNe,MNe=yi,ANe=Eb;function CNe(t,e,n){var r=MNe(t)?SNe:TNe;return n&&ANe(t,e,n)&&(e=void 0),r(t,ENe(e))}var PNe=CNe;const RNe=dn(PNe);var ya=function(e,n){var r=e.alwaysShow,i=e.ifOverflow;return r&&(i="extendDomain"),i===n},zL=Q5;function NNe(t,e,n){e=="__proto__"&&zL?zL(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var ONe=NNe,INe=ONe,DNe=J5,LNe=kf;function kNe(t,e){var n={};return e=LNe(e),DNe(t,function(r,i,o){INe(n,i,e(r,i,o))}),n}var jNe=kNe;const UNe=dn(jNe);function FNe(t,e){for(var n=-1,r=t==null?0:t.length;++n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function rOe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function iOe(t,e){var n=t.x,r=t.y,i=nOe(t,ZNe),o="".concat(n),a=parseInt(o,10),s="".concat(r),l=parseInt(s,10),c="".concat(e.height||i.height),u=parseInt(c,10),d="".concat(e.width||i.width),f=parseInt(d,10);return _h(_h(_h(_h(_h({},e),i),a?{x:a}:{}),l?{y:l}:{}),{},{height:u,width:f,name:e.name,radius:e.radius})}function VL(t){return Z.createElement(FRe,IT({shapeType:"rectangle",propTransformer:iOe,activeClassName:"recharts-active-bar"},t))}var oOe=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,i){if(typeof e=="number")return e;var o=typeof r=="number";return o?e(r,i):(o||jc(),n)}},aOe=["value","background"],PV;function tf(t){"@babel/helpers - typeof";return tf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tf(t)}function sOe(t,e){if(t==null)return{};var n=lOe(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function lOe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function T0(){return T0=Object.assign?Object.assign.bind():function(t){for(var e=1;e0&&Math.abs(U)0&&Math.abs(k)0&&(D=Math.min((q||0)-(k[ee-1]||0),D))}),Number.isFinite(D)){var U=D/R,O=v.layout==="vertical"?r.height:r.width;if(v.padding==="gap"&&(T=U*O/2),v.padding==="no-gap"){var W=Lc(e.barCategoryGap,U*O),L=U*O/2;T=L-W-(L-W)/O*W}}}i==="xAxis"?A=[r.left+(b.left||0)+(T||0),r.left+r.width-(b.right||0)-(T||0)]:i==="yAxis"?A=l==="horizontal"?[r.top+r.height-(b.bottom||0),r.top+(b.top||0)]:[r.top+(b.top||0)+(T||0),r.top+r.height-(b.bottom||0)-(T||0)]:A=v.range,w&&(A=[A[1],A[0]]);var j=$Me(v,o,f),X=j.scale,K=j.realScaleType;X.domain(m).range(A),zMe(X);var F=YMe(X,Eo(Eo({},v),{},{realScaleType:K}));i==="xAxis"?(P=g==="top"&&!S||g==="bottom"&&S,M=r.left,C=d[E]-P*v.height):i==="yAxis"&&(P=g==="left"&&!S||g==="right"&&S,M=d[E]-P*v.width,C=r.top);var Y=Eo(Eo(Eo({},v),F),{},{realScaleType:K,x:M,y:C,scale:X,width:i==="xAxis"?r.width:v.width,height:i==="yAxis"?r.height:v.height});return Y.bandSize=h0(Y,F),!v.hide&&i==="xAxis"?d[E]+=(P?-1:1)*Y.height:v.hide||(d[E]+=(P?-1:1)*Y.width),Eo(Eo({},p),{},Ub({},y,Y))},{})},IV=function(e,n){var r=e.x,i=e.y,o=n.x,a=n.y;return{x:Math.min(r,o),y:Math.min(i,a),width:Math.abs(o-r),height:Math.abs(a-i)}},bOe=function(e){var n=e.x1,r=e.y1,i=e.x2,o=e.y2;return IV({x:n,y:r},{x:i,y:o})},DV=function(){function t(e){gOe(this,t),this.scale=e}return vOe(t,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.bandAware,o=r.position;if(n!==void 0){if(o)switch(o){case"start":return this.scale(n);case"middle":{var a=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+a}case"end":{var s=this.bandwidth?this.bandwidth():0;return this.scale(n)+s}default:return this.scale(n)}if(i){var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+l}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),i=r[0],o=r[r.length-1];return i<=o?n>=i&&n<=o:n>=o&&n<=i}}],[{key:"create",value:function(n){return new t(n)}}])}();Ub(DV,"EPS",1e-4);var xP=function(e){var n=Object.keys(e).reduce(function(r,i){return Eo(Eo({},r),{},Ub({},i,DV.create(e[i])))},{});return Eo(Eo({},n),{},{apply:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=o.bandAware,s=o.position;return UNe(i,function(l,c){return n[c].apply(l,{bandAware:a,position:s})})},isInRange:function(i){return JNe(i,function(o,a){return n[a].isInRange(o)})}})};function _Oe(t){return(t%180+180)%180}var wOe=function(e){var n=e.width,r=e.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=_Oe(i),a=o*Math.PI/180,s=Math.atan(r/n),l=a>s&&at.length)&&(e=t.length);for(var n=0,r=new Array(e);nt*i)return!1;var o=n();return t*(e-t*o/2-r)>=0&&t*(e+t*o/2-i)<=0}function c2e(t,e){return JV(t,e+1)}function u2e(t,e,n,r,i){for(var o=(r||[]).slice(),a=e.start,s=e.end,l=0,c=1,u=a,d=function(){var y=r==null?void 0:r[l];if(y===void 0)return{v:JV(r,c)};var v=l,g,m=function(){return g===void 0&&(g=n(y,v)),g},x=y.coordinate,b=l===0||R0(t,x,m,u,s);b||(l=0,u=a,c+=1),b&&(u=x+t*(m()/2+i),l+=c)},f;c<=o.length;)if(f=d(),f)return f.v;return[]}function dm(t){"@babel/helpers - typeof";return dm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},dm(t)}function rk(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 Pr(t){for(var e=1;e0?p.coordinate-g*t:p.coordinate})}else o[f]=p=Pr(Pr({},p),{},{tickCoord:p.coordinate});var m=R0(t,p.tickCoord,v,s,l);m&&(l=p.tickCoord-t*(v()/2+i),o[f]=Pr(Pr({},p),{},{isShow:!0}))},u=a-1;u>=0;u--)c(u);return o}function m2e(t,e,n,r,i,o){var a=(r||[]).slice(),s=a.length,l=e.start,c=e.end;if(o){var u=r[s-1],d=n(u,s-1),f=t*(u.coordinate+t*d/2-c);a[s-1]=u=Pr(Pr({},u),{},{tickCoord:f>0?u.coordinate-f*t:u.coordinate});var p=R0(t,u.tickCoord,function(){return d},l,c);p&&(c=u.tickCoord-t*(d/2+i),a[s-1]=Pr(Pr({},u),{},{isShow:!0}))}for(var y=o?s-1:s,v=function(x){var b=a[x],S,w=function(){return S===void 0&&(S=n(b,x)),S};if(x===0){var E=t*(b.coordinate-t*w()/2-l);a[x]=b=Pr(Pr({},b),{},{tickCoord:E<0?b.coordinate-E*t:b.coordinate})}else a[x]=b=Pr(Pr({},b),{},{tickCoord:b.coordinate});var T=R0(t,b.tickCoord,w,l,c);T&&(l=b.tickCoord+t*(w()/2+i),a[x]=Pr(Pr({},b),{},{isShow:!0}))},g=0;g=2?Do(i[1].coordinate-i[0].coordinate):1,m=l2e(o,g,p);return l==="equidistantPreserveStart"?u2e(g,m,v,i,a):(l==="preserveStart"||l==="preserveStartEnd"?f=m2e(g,m,v,i,a,l==="preserveStartEnd"):f=p2e(g,m,v,i,a),f.filter(function(x){return x.isShow}))}var v2e=["viewBox"],y2e=["viewBox"],x2e=["ticks"];function af(t){"@babel/helpers - typeof";return af=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},af(t)}function Xu(){return Xu=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function b2e(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function _2e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ok(t,e){for(var n=0;n0?l(this.props):l(p)),a<=0||s<=0||!y||!y.length?null:Z.createElement(kn,{className:zt("recharts-cartesian-axis",c),ref:function(g){r.layerReference=g}},o&&this.renderAxisLine(),this.renderTicks(y,this.state.fontSize,this.state.letterSpacing),Nr.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,i,o){var a;return Z.isValidElement(r)?a=Z.cloneElement(r,i):jt(r)?a=r(i):a=Z.createElement(Qy,Xu({},i,{className:"recharts-cartesian-axis-tick-value"}),o),a}}])}(_.Component);wP(Hb,"displayName","CartesianAxis");wP(Hb,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var C2e=["type","layout","connectNulls","ref"],P2e=["key"];function sf(t){"@babel/helpers - typeof";return sf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},sf(t)}function ak(t,e){if(t==null)return{};var n=R2e(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function R2e(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function Zh(){return Zh=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);nd){p=[].concat(Tu(l.slice(0,y)),[d-v]);break}var g=p.length%2===0?[0,f]:[f];return[].concat(Tu(e.repeat(l,u)),Tu(p),g).map(function(m){return"".concat(m,"px")}).join(", ")}),To(n,"id",$m("recharts-line-")),To(n,"pathRef",function(a){n.mainCurve=a}),To(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),To(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return B2e(e,t),k2e(e,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();this.setState({totalLength:r})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();r!==this.state.totalLength&&this.setState({totalLength:r})}}},{key:"getTotalLength",value:function(){var r=this.mainCurve;try{return r&&r.getTotalLength&&r.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(r,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,a=o.points,s=o.xAxis,l=o.yAxis,c=o.layout,u=o.children,d=ro(u,Wm);if(!d)return null;var f=function(v,g){return{x:v.x,y:v.y,value:v.value,errorVal:Di(v.payload,g)}},p={clipPath:r?"url(#clipPath-".concat(i,")"):null};return Z.createElement(kn,p,d.map(function(y){return Z.cloneElement(y,{key:"bar-".concat(y.props.dataKey),data:a,xAxis:s,yAxis:l,layout:c,dataPointFormatter:f})}))}},{key:"renderDots",value:function(r,i,o){var a=this.props.isAnimationActive;if(a&&!this.state.isAnimationFinished)return null;var s=this.props,l=s.dot,c=s.points,u=s.dataKey,d=$t(this.props,!1),f=$t(l,!0),p=c.map(function(v,g){var m=_i(_i(_i({key:"dot-".concat(g),r:3},d),f),{},{index:g,cx:v.x,cy:v.y,value:v.value,dataKey:u,payload:v.payload,points:c});return e.renderDotItem(l,m)}),y={clipPath:r?"url(#clipPath-".concat(i?"":"dots-").concat(o,")"):null};return Z.createElement(kn,Zh({className:"recharts-line-dots",key:"dots"},y),p)}},{key:"renderCurveStatically",value:function(r,i,o,a){var s=this.props,l=s.type,c=s.layout,u=s.connectNulls;s.ref;var d=ak(s,C2e),f=_i(_i(_i({},$t(d,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(o,")"):null,points:r},a),{},{type:l,layout:c,connectNulls:u});return Z.createElement(bT,Zh({},f,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,i){var o=this,a=this.props,s=a.points,l=a.strokeDasharray,c=a.isAnimationActive,u=a.animationBegin,d=a.animationDuration,f=a.animationEasing,p=a.animationId,y=a.animateNewValues,v=a.width,g=a.height,m=this.state,x=m.prevPoints,b=m.totalLength;return Z.createElement(us,{begin:u,duration:d,isActive:c,easing:f,from:{t:0},to:{t:1},key:"line-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(S){var w=S.t;if(x){var E=x.length/s.length,T=s.map(function(R,D){var k=Math.floor(D*E);if(x[k]){var U=x[k],O=Co(U.x,R.x),W=Co(U.y,R.y);return _i(_i({},R),{},{x:O(w),y:W(w)})}if(y){var L=Co(v*2,R.x),j=Co(g/2,R.y);return _i(_i({},R),{},{x:L(w),y:j(w)})}return _i(_i({},R),{},{x:R.x,y:R.y})});return o.renderCurveStatically(T,r,i)}var A=Co(0,b),M=A(w),C;if(l){var P="".concat(l).split(/[,\s]+/gim).map(function(R){return parseFloat(R)});C=o.getStrokeDasharray(M,b,P)}else C=o.generateSimpleStrokeDasharray(b,M);return o.renderCurveStatically(s,r,i,{strokeDasharray:C})})}},{key:"renderCurve",value:function(r,i){var o=this.props,a=o.points,s=o.isAnimationActive,l=this.state,c=l.prevPoints,u=l.totalLength;return s&&a&&a.length&&(!c&&u>0||!Ib(c,a))?this.renderCurveWithAnimation(r,i):this.renderCurveStatically(a,r,i)}},{key:"render",value:function(){var r,i=this.props,o=i.hide,a=i.dot,s=i.points,l=i.className,c=i.xAxis,u=i.yAxis,d=i.top,f=i.left,p=i.width,y=i.height,v=i.isAnimationActive,g=i.id;if(o||!s||!s.length)return null;var m=this.state.isAnimationFinished,x=s.length===1,b=zt("recharts-line",l),S=c&&c.allowDataOverflow,w=u&&u.allowDataOverflow,E=S||w,T=Ut(g)?this.id:g,A=(r=$t(a,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},M=A.r,C=M===void 0?3:M,P=A.strokeWidth,R=P===void 0?2:P,D=Nhe(a)?a:{},k=D.clipDot,U=k===void 0?!0:k,O=C*2+R;return Z.createElement(kn,{className:b},S||w?Z.createElement("defs",null,Z.createElement("clipPath",{id:"clipPath-".concat(T)},Z.createElement("rect",{x:S?f:f-p/2,y:w?d:d-y/2,width:S?p:p*2,height:w?y:y*2})),!U&&Z.createElement("clipPath",{id:"clipPath-dots-".concat(T)},Z.createElement("rect",{x:f-O/2,y:d-O/2,width:p+O,height:y+O}))):null,!x&&this.renderCurve(E,T),this.renderErrorBar(E,T),(x||a)&&this.renderDots(E,U,T),(!v||m)&&il.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:i.curPoints}:r.points!==i.curPoints?{curPoints:r.points}:null}},{key:"repeat",value:function(r,i){for(var o=r.length%2!==0?[].concat(Tu(r),[0]):r,a=[],s=0;st.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function PIe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function RIe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function NIe(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n0?a:e&&e.length&&ze(i)&&ze(o)?e.slice(i,o+1):[]};function mG(t){return t==="number"?[0,"auto"]:void 0}var ZT=function(e,n,r,i){var o=e.graphicalItems,a=e.tooltipAxis,s=Vb(n,e);return r<0||!o||!o.length||r>=s.length?null:o.reduce(function(l,c){var u,d=(u=c.props.data)!==null&&u!==void 0?u:n;d&&e.dataStartIndex+e.dataEndIndex!==0&&e.dataEndIndex-e.dataStartIndex>=r&&(d=d.slice(e.dataStartIndex,e.dataEndIndex+1));var f;if(a.dataKey&&!a.allowDuplicatedCategory){var p=d===void 0?s:d;f=jy(p,a.dataKey,i)}else f=d&&d[r]||s[r];return f?[].concat(ff(l),[dV(c,f)]):l},[])},pk=function(e,n,r,i){var o=i||{x:e.chartX,y:e.chartY},a=HIe(o,r),s=e.orderedTooltipTicks,l=e.tooltipAxis,c=e.tooltipTicks,u=LMe(a,s,c,l);if(u>=0&&c){var d=c[u]&&c[u].value,f=ZT(e,n,u,d),p=VIe(r,s,u,o);return{activeTooltipIndex:u,activeLabel:d,activePayload:f,activeCoordinate:p}}return null},GIe=function(e,n){var r=n.axes,i=n.graphicalItems,o=n.axisType,a=n.axisIdKey,s=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=e.layout,d=e.children,f=e.stackOffset,p=cV(u,o);return r.reduce(function(y,v){var g,m=v.type.defaultProps!==void 0?ve(ve({},v.type.defaultProps),v.props):v.props,x=m.type,b=m.dataKey,S=m.allowDataOverflow,w=m.allowDuplicatedCategory,E=m.scale,T=m.ticks,A=m.includeHidden,M=m[a];if(y[M])return y;var C=Vb(e.data,{graphicalItems:i.filter(function(F){var Y,q=a in F.props?F.props[a]:(Y=F.type.defaultProps)===null||Y===void 0?void 0:Y[a];return q===M}),dataStartIndex:l,dataEndIndex:c}),P=C.length,R,D,k;vIe(m.domain,S,x)&&(R=mT(m.domain,null,S),p&&(x==="number"||E!=="auto")&&(k=Yh(C,b,"category")));var U=mG(x);if(!R||R.length===0){var O,W=(O=m.domain)!==null&&O!==void 0?O:U;if(b){if(R=Yh(C,b,x),x==="category"&&p){var L=_he(R);w&&L?(D=R,R=w0(0,P)):w||(R=qD(W,R,v).reduce(function(F,Y){return F.indexOf(Y)>=0?F:[].concat(ff(F),[Y])},[]))}else if(x==="category")w?R=R.filter(function(F){return F!==""&&!Ut(F)}):R=qD(W,R,v).reduce(function(F,Y){return F.indexOf(Y)>=0||Y===""||Ut(Y)?F:[].concat(ff(F),[Y])},[]);else if(x==="number"){var j=BMe(C,i.filter(function(F){var Y,q,ee=a in F.props?F.props[a]:(Y=F.type.defaultProps)===null||Y===void 0?void 0:Y[a],te="hide"in F.props?F.props.hide:(q=F.type.defaultProps)===null||q===void 0?void 0:q.hide;return ee===M&&(A||!te)}),b,o,u);j&&(R=j)}p&&(x==="number"||E!=="auto")&&(k=Yh(C,b,"category"))}else p?R=w0(0,P):s&&s[M]&&s[M].hasStack&&x==="number"?R=f==="expand"?[0,1]:uV(s[M].stackGroups,l,c):R=lV(C,i.filter(function(F){var Y=a in F.props?F.props[a]:F.type.defaultProps[a],q="hide"in F.props?F.props.hide:F.type.defaultProps.hide;return Y===M&&(A||!q)}),x,u,!0);if(x==="number")R=KT(d,R,M,o,T),W&&(R=mT(W,R,S));else if(x==="category"&&W){var X=W,K=R.every(function(F){return X.indexOf(F)>=0});K&&(R=X)}}return ve(ve({},y),{},bt({},M,ve(ve({},m),{},{axisType:o,domain:R,categoricalDomain:k,duplicateDomain:D,originalDomain:(g=m.domain)!==null&&g!==void 0?g:U,isCategorical:p,layout:u})))},{})},WIe=function(e,n){var r=n.graphicalItems,i=n.Axis,o=n.axisType,a=n.axisIdKey,s=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=e.layout,d=e.children,f=Vb(e.data,{graphicalItems:r,dataStartIndex:l,dataEndIndex:c}),p=f.length,y=cV(u,o),v=-1;return r.reduce(function(g,m){var x=m.type.defaultProps!==void 0?ve(ve({},m.type.defaultProps),m.props):m.props,b=x[a],S=mG("number");if(!g[b]){v++;var w;return y?w=w0(0,p):s&&s[b]&&s[b].hasStack?(w=uV(s[b].stackGroups,l,c),w=KT(d,w,b,o)):(w=mT(S,lV(f,r.filter(function(E){var T,A,M=a in E.props?E.props[a]:(T=E.type.defaultProps)===null||T===void 0?void 0:T[a],C="hide"in E.props?E.props.hide:(A=E.type.defaultProps)===null||A===void 0?void 0:A.hide;return M===b&&!C}),"number",u),i.defaultProps.allowDataOverflow),w=KT(d,w,b,o)),ve(ve({},g),{},bt({},b,ve(ve({axisType:o},i.defaultProps),{},{hide:!0,orientation:no($Ie,"".concat(o,".").concat(v%2),null),domain:w,originalDomain:S,isCategorical:y,layout:u})))}return g},{})},XIe=function(e,n){var r=n.axisType,i=r===void 0?"xAxis":r,o=n.AxisComp,a=n.graphicalItems,s=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=e.children,d="".concat(i,"Id"),f=ro(u,o),p={};return f&&f.length?p=GIe(e,{axes:f,graphicalItems:a,axisType:i,axisIdKey:d,stackGroups:s,dataStartIndex:l,dataEndIndex:c}):a&&a.length&&(p=WIe(e,{Axis:o,graphicalItems:a,axisType:i,axisIdKey:d,stackGroups:s,dataStartIndex:l,dataEndIndex:c})),p},qIe=function(e){var n=Cu(e),r=ic(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:VC(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:h0(n,r)}},mk=function(e){var n=e.children,r=e.defaultShowTooltip,i=Ei(n,ef),o=0,a=0;return e.data&&e.data.length!==0&&(a=e.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(o=i.props.startIndex),i.props.endIndex>=0&&(a=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:a,activeTooltipIndex:-1,isTooltipActive:!!r}},KIe=function(e){return!e||!e.length?!1:e.some(function(n){var r=Za(n&&n.type);return r&&r.indexOf("Bar")>=0})},gk=function(e){return e==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:e==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:e==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},YIe=function(e,n){var r=e.props,i=e.graphicalItems,o=e.xAxisMap,a=o===void 0?{}:o,s=e.yAxisMap,l=s===void 0?{}:s,c=r.width,u=r.height,d=r.children,f=r.margin||{},p=Ei(d,ef),y=Ei(d,hd),v=Object.keys(l).reduce(function(w,E){var T=l[E],A=T.orientation;return!T.mirror&&!T.hide?ve(ve({},w),{},bt({},A,w[A]+T.width)):w},{left:f.left||0,right:f.right||0}),g=Object.keys(a).reduce(function(w,E){var T=a[E],A=T.orientation;return!T.mirror&&!T.hide?ve(ve({},w),{},bt({},A,no(w,"".concat(A))+T.height)):w},{top:f.top||0,bottom:f.bottom||0}),m=ve(ve({},g),v),x=m.bottom;p&&(m.bottom+=p.props.height||ef.defaultProps.height),y&&n&&(m=UMe(m,i,r,n));var b=c-m.left-m.right,S=u-m.top-m.bottom;return ve(ve({brushBottom:x},m),{},{width:Math.max(b,0),height:Math.max(S,0)})},JIe=function(e,n){if(n==="xAxis")return e[n].width;if(n==="yAxis")return e[n].height},ZIe=function(e){var n=e.chartName,r=e.GraphicalChild,i=e.defaultTooltipEventType,o=i===void 0?"axis":i,a=e.validateTooltipEventTypes,s=a===void 0?["axis"]:a,l=e.axisComponents,c=e.legendContent,u=e.formatAxisMap,d=e.defaultProps,f=function(m,x){var b=x.graphicalItems,S=x.stackGroups,w=x.offset,E=x.updateId,T=x.dataStartIndex,A=x.dataEndIndex,M=m.barSize,C=m.layout,P=m.barGap,R=m.barCategoryGap,D=m.maxBarSize,k=gk(C),U=k.numericAxisName,O=k.cateAxisName,W=KIe(b),L=[];return b.forEach(function(j,X){var K=Vb(m.data,{graphicalItems:[j],dataStartIndex:T,dataEndIndex:A}),F=j.type.defaultProps!==void 0?ve(ve({},j.type.defaultProps),j.props):j.props,Y=F.dataKey,q=F.maxBarSize,ee=F["".concat(U,"Id")],te=F["".concat(O,"Id")],Q={},ce=l.reduce(function(it,Ft){var J=x["".concat(Ft.axisType,"Map")],B=F["".concat(Ft.axisType,"Id")];J&&J[B]||Ft.axisType==="zAxis"||jc();var ue=J[B];return ve(ve({},it),{},bt(bt({},Ft.axisType,ue),"".concat(Ft.axisType,"Ticks"),ic(ue)))},Q),ae=ce[O],fe=ce["".concat(O,"Ticks")],we=S&&S[ee]&&S[ee].hasStack&&ZMe(j,S[ee].stackGroups),le=Za(j.type).indexOf("Bar")>=0,ie=h0(ae,fe),G=[],Ve=W&&kMe({barSize:M,stackGroups:S,totalSize:JIe(ce,O)});if(le){var Ne,st,Re=Ut(q)?D:q,ct=(Ne=(st=h0(ae,fe,!0))!==null&&st!==void 0?st:Re)!==null&&Ne!==void 0?Ne:0;G=jMe({barGap:P,barCategoryGap:R,bandSize:ct!==ie?ct:ie,sizeList:Ve[te],maxBarSize:Re}),ct!==ie&&(G=G.map(function(it){return ve(ve({},it),{},{position:ve(ve({},it.position),{},{offset:it.position.offset-ct/2})})}))}var Ye=j&&j.type&&j.type.getComposedData;Ye&&L.push({props:ve(ve({},Ye(ve(ve({},ce),{},{displayedData:K,props:m,dataKey:Y,item:j,bandSize:ie,barPosition:G,offset:w,stackedData:we,layout:C,dataStartIndex:T,dataEndIndex:A}))),{},bt(bt(bt({key:j.key||"item-".concat(X)},U,ce[U]),O,ce[O]),"animationId",E)),childIndex:Dhe(j,m.children),item:j})}),L},p=function(m,x){var b=m.props,S=m.dataStartIndex,w=m.dataEndIndex,E=m.updateId;if(!B2({props:b}))return null;var T=b.children,A=b.layout,M=b.stackOffset,C=b.data,P=b.reverseStackOrder,R=gk(A),D=R.numericAxisName,k=R.cateAxisName,U=ro(T,r),O=KMe(C,U,"".concat(D,"Id"),"".concat(k,"Id"),M,P),W=l.reduce(function(F,Y){var q="".concat(Y.axisType,"Map");return ve(ve({},F),{},bt({},q,XIe(b,ve(ve({},Y),{},{graphicalItems:U,stackGroups:Y.axisType===D&&O,dataStartIndex:S,dataEndIndex:w}))))},{}),L=YIe(ve(ve({},W),{},{props:b,graphicalItems:U}),x==null?void 0:x.legendBBox);Object.keys(W).forEach(function(F){W[F]=u(b,W[F],L,F.replace("Map",""),n)});var j=W["".concat(k,"Map")],X=qIe(j),K=f(b,ve(ve({},W),{},{dataStartIndex:S,dataEndIndex:w,updateId:E,graphicalItems:U,stackGroups:O,offset:L}));return ve(ve({formattedGraphicalItems:K,graphicalItems:U,offset:L,stackGroups:O},X),W)},y=function(g){function m(x){var b,S,w;return RIe(this,m),w=IIe(this,m,[x]),bt(w,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),bt(w,"accessibilityManager",new gIe),bt(w,"handleLegendBBoxUpdate",function(E){if(E){var T=w.state,A=T.dataStartIndex,M=T.dataEndIndex,C=T.updateId;w.setState(ve({legendBBox:E},p({props:w.props,dataStartIndex:A,dataEndIndex:M,updateId:C},ve(ve({},w.state),{},{legendBBox:E}))))}}),bt(w,"handleReceiveSyncEvent",function(E,T,A){if(w.props.syncId===E){if(A===w.eventEmitterSymbol&&typeof w.props.syncMethod!="function")return;w.applySyncEvent(T)}}),bt(w,"handleBrushChange",function(E){var T=E.startIndex,A=E.endIndex;if(T!==w.state.dataStartIndex||A!==w.state.dataEndIndex){var M=w.state.updateId;w.setState(function(){return ve({dataStartIndex:T,dataEndIndex:A},p({props:w.props,dataStartIndex:T,dataEndIndex:A,updateId:M},w.state))}),w.triggerSyncEvent({dataStartIndex:T,dataEndIndex:A})}}),bt(w,"handleMouseEnter",function(E){var T=w.getMouseInfo(E);if(T){var A=ve(ve({},T),{},{isTooltipActive:!0});w.setState(A),w.triggerSyncEvent(A);var M=w.props.onMouseEnter;jt(M)&&M(A,E)}}),bt(w,"triggeredAfterMouseMove",function(E){var T=w.getMouseInfo(E),A=T?ve(ve({},T),{},{isTooltipActive:!0}):{isTooltipActive:!1};w.setState(A),w.triggerSyncEvent(A);var M=w.props.onMouseMove;jt(M)&&M(A,E)}),bt(w,"handleItemMouseEnter",function(E){w.setState(function(){return{isTooltipActive:!0,activeItem:E,activePayload:E.tooltipPayload,activeCoordinate:E.tooltipPosition||{x:E.cx,y:E.cy}}})}),bt(w,"handleItemMouseLeave",function(){w.setState(function(){return{isTooltipActive:!1}})}),bt(w,"handleMouseMove",function(E){E.persist(),w.throttleTriggeredAfterMouseMove(E)}),bt(w,"handleMouseLeave",function(E){w.throttleTriggeredAfterMouseMove.cancel();var T={isTooltipActive:!1};w.setState(T),w.triggerSyncEvent(T);var A=w.props.onMouseLeave;jt(A)&&A(T,E)}),bt(w,"handleOuterEvent",function(E){var T=Ihe(E),A=no(w.props,"".concat(T));if(T&&jt(A)){var M,C;/.*touch.*/i.test(T)?C=w.getMouseInfo(E.changedTouches[0]):C=w.getMouseInfo(E),A((M=C)!==null&&M!==void 0?M:{},E)}}),bt(w,"handleClick",function(E){var T=w.getMouseInfo(E);if(T){var A=ve(ve({},T),{},{isTooltipActive:!0});w.setState(A),w.triggerSyncEvent(A);var M=w.props.onClick;jt(M)&&M(A,E)}}),bt(w,"handleMouseDown",function(E){var T=w.props.onMouseDown;if(jt(T)){var A=w.getMouseInfo(E);T(A,E)}}),bt(w,"handleMouseUp",function(E){var T=w.props.onMouseUp;if(jt(T)){var A=w.getMouseInfo(E);T(A,E)}}),bt(w,"handleTouchMove",function(E){E.changedTouches!=null&&E.changedTouches.length>0&&w.throttleTriggeredAfterMouseMove(E.changedTouches[0])}),bt(w,"handleTouchStart",function(E){E.changedTouches!=null&&E.changedTouches.length>0&&w.handleMouseDown(E.changedTouches[0])}),bt(w,"handleTouchEnd",function(E){E.changedTouches!=null&&E.changedTouches.length>0&&w.handleMouseUp(E.changedTouches[0])}),bt(w,"handleDoubleClick",function(E){var T=w.props.onDoubleClick;if(jt(T)){var A=w.getMouseInfo(E);T(A,E)}}),bt(w,"handleContextMenu",function(E){var T=w.props.onContextMenu;if(jt(T)){var A=w.getMouseInfo(E);T(A,E)}}),bt(w,"triggerSyncEvent",function(E){w.props.syncId!==void 0&&lS.emit(cS,w.props.syncId,E,w.eventEmitterSymbol)}),bt(w,"applySyncEvent",function(E){var T=w.props,A=T.layout,M=T.syncMethod,C=w.state.updateId,P=E.dataStartIndex,R=E.dataEndIndex;if(E.dataStartIndex!==void 0||E.dataEndIndex!==void 0)w.setState(ve({dataStartIndex:P,dataEndIndex:R},p({props:w.props,dataStartIndex:P,dataEndIndex:R,updateId:C},w.state)));else if(E.activeTooltipIndex!==void 0){var D=E.chartX,k=E.chartY,U=E.activeTooltipIndex,O=w.state,W=O.offset,L=O.tooltipTicks;if(!W)return;if(typeof M=="function")U=M(L,E);else if(M==="value"){U=-1;for(var j=0;j=0){var we,le;if(D.dataKey&&!D.allowDuplicatedCategory){var ie=typeof D.dataKey=="function"?fe:"payload.".concat(D.dataKey.toString());we=jy(j,ie,U),le=X&&K&&jy(K,ie,U)}else we=j==null?void 0:j[k],le=X&&K&&K[k];if(te||ee){var G=E.props.activeIndex!==void 0?E.props.activeIndex:k;return[_.cloneElement(E,ve(ve(ve({},M.props),ce),{},{activeIndex:G})),null,null]}if(!Ut(we))return[ae].concat(ff(w.renderActivePoints({item:M,activePoint:we,basePoint:le,childIndex:k,isRange:X})))}else{var Ve,Ne=(Ve=w.getItemByXY(w.state.activeCoordinate))!==null&&Ve!==void 0?Ve:{graphicalItem:ae},st=Ne.graphicalItem,Re=st.item,ct=Re===void 0?E:Re,Ye=st.childIndex,it=ve(ve(ve({},M.props),ce),{},{activeIndex:Ye});return[_.cloneElement(ct,it),null,null]}return X?[ae,null,null]:[ae,null]}),bt(w,"renderCustomized",function(E,T,A){return _.cloneElement(E,ve(ve({key:"recharts-customized-".concat(A)},w.props),w.state))}),bt(w,"renderMap",{CartesianGrid:{handler:_v,once:!0},ReferenceArea:{handler:w.renderReferenceElement},ReferenceLine:{handler:_v},ReferenceDot:{handler:w.renderReferenceElement},XAxis:{handler:_v},YAxis:{handler:_v},Brush:{handler:w.renderBrush,once:!0},Bar:{handler:w.renderGraphicChild},Line:{handler:w.renderGraphicChild},Area:{handler:w.renderGraphicChild},Radar:{handler:w.renderGraphicChild},RadialBar:{handler:w.renderGraphicChild},Scatter:{handler:w.renderGraphicChild},Pie:{handler:w.renderGraphicChild},Funnel:{handler:w.renderGraphicChild},Tooltip:{handler:w.renderCursor,once:!0},PolarGrid:{handler:w.renderPolarGrid,once:!0},PolarAngleAxis:{handler:w.renderPolarAxis},PolarRadiusAxis:{handler:w.renderPolarAxis},Customized:{handler:w.renderCustomized}}),w.clipPathId="".concat((b=x.id)!==null&&b!==void 0?b:$m("recharts"),"-clip"),w.throttleTriggeredAfterMouseMove=oH(w.triggeredAfterMouseMove,(S=x.throttleDelay)!==null&&S!==void 0?S:1e3/60),w.state={},w}return kIe(m,g),OIe(m,[{key:"componentDidMount",value:function(){var b,S;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(b=this.props.margin.left)!==null&&b!==void 0?b:0,top:(S=this.props.margin.top)!==null&&S!==void 0?S:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var b=this.props,S=b.children,w=b.data,E=b.height,T=b.layout,A=Ei(S,So);if(A){var M=A.props.defaultIndex;if(!(typeof M!="number"||M<0||M>this.state.tooltipTicks.length-1)){var C=this.state.tooltipTicks[M]&&this.state.tooltipTicks[M].value,P=ZT(this.state,w,M,C),R=this.state.tooltipTicks[M].coordinate,D=(this.state.offset.top+E)/2,k=T==="horizontal",U=k?{x:R,y:D}:{y:R,x:D},O=this.state.formattedGraphicalItems.find(function(L){var j=L.item;return j.type.name==="Scatter"});O&&(U=ve(ve({},U),O.props.points[M].tooltipPosition),P=O.props.points[M].tooltipPayload);var W={activeTooltipIndex:M,isTooltipActive:!0,activeLabel:C,activePayload:P,activeCoordinate:U};this.setState(W),this.renderCursor(A),this.accessibilityManager.setIndex(M)}}}},{key:"getSnapshotBeforeUpdate",value:function(b,S){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==S.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==b.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==b.margin){var w,E;this.accessibilityManager.setDetails({offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(E=this.props.margin.top)!==null&&E!==void 0?E:0}})}return null}},{key:"componentDidUpdate",value:function(b){R1([Ei(b.children,So)],[Ei(this.props.children,So)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var b=Ei(this.props.children,So);if(b&&typeof b.props.shared=="boolean"){var S=b.props.shared?"axis":"item";return s.indexOf(S)>=0?S:o}return o}},{key:"getMouseInfo",value:function(b){if(!this.container)return null;var S=this.container,w=S.getBoundingClientRect(),E=sSe(w),T={chartX:Math.round(b.pageX-E.left),chartY:Math.round(b.pageY-E.top)},A=w.width/S.offsetWidth||1,M=this.inRange(T.chartX,T.chartY,A);if(!M)return null;var C=this.state,P=C.xAxisMap,R=C.yAxisMap,D=this.getTooltipEventType(),k=pk(this.state,this.props.data,this.props.layout,M);if(D!=="axis"&&P&&R){var U=Cu(P).scale,O=Cu(R).scale,W=U&&U.invert?U.invert(T.chartX):null,L=O&&O.invert?O.invert(T.chartY):null;return ve(ve({},T),{},{xValue:W,yValue:L},k)}return k?ve(ve({},T),k):null}},{key:"inRange",value:function(b,S){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,E=this.props.layout,T=b/w,A=S/w;if(E==="horizontal"||E==="vertical"){var M=this.state.offset,C=T>=M.left&&T<=M.left+M.width&&A>=M.top&&A<=M.top+M.height;return C?{x:T,y:A}:null}var P=this.state,R=P.angleAxisMap,D=P.radiusAxisMap;if(R&&D){var k=Cu(R);return JD({x:T,y:A},k)}return null}},{key:"parseEventsOfWrapper",value:function(){var b=this.props.children,S=this.getTooltipEventType(),w=Ei(b,So),E={};w&&S==="axis"&&(w.props.trigger==="click"?E={onClick:this.handleClick}:E={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var T=Uy(this.props,this.handleOuterEvent);return ve(ve({},T),E)}},{key:"addListener",value:function(){lS.on(cS,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){lS.removeListener(cS,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(b,S,w){for(var E=this.state.formattedGraphicalItems,T=0,A=E.length;T{var v,g;const[i,o]=_.useState([]),[a,s]=_.useState([]),l=_.useRef(0),{baseUrl:c,fetchWithHeaders:u}=Dn();_.useEffect(()=>{let m=!1;return yZ(c,u,t).then(x=>{var E;if(m||x.length===0)return;const b=x.filter(T=>T.loss!=null).map(T=>({step:T.step,loss:T.loss})).slice(-2e3),S=x.filter(T=>T.lr!=null).map(T=>({step:T.step,lr:T.lr})).slice(-2e3);o(b),s(S);const w=((E=x[x.length-1])==null?void 0:E.step)??0;l.current=w}).catch(()=>{}),()=>{m=!0}},[c,u,t]),_.useEffect(()=>{const m=e.current_step;if(m0&&e.current_loss!=null){const x=e.current_loss;o(b=>{const S=b[b.length-1];return S&&S.step===m?b:[...b,{step:m,loss:x}].slice(-2e3)})}if(m>0&&e.current_lr!=null){const x=e.current_lr;s(b=>{const S=b[b.length-1];return S&&S.step===m?b:[...b,{step:m,lr:x}].slice(-2e3)})}},[e.current_step,e.current_loss,e.current_lr]);const d=n(),f=e.training_active&&e.total_steps===0,p=f?"Training startingโ€ฆ":`${e.current_step.toLocaleString()} / ${e.total_steps.toLocaleString()}`,y=e.eta_seconds!=null?r(e.eta_seconds):"โ€”";return h.jsxs("div",{className:"space-y-6",children:[h.jsx(Gr,{className:"bg-slate-800/50 border-slate-700 rounded-xl",children:h.jsxs(Wr,{className:"p-6",children:[h.jsxs("div",{className:"flex items-baseline justify-between mb-3",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg bg-blue-500/20 text-blue-400",children:h.jsx($u,{className:"w-5 h-5"})}),h.jsxs("div",{children:[h.jsx("h3",{className:"text-sm text-slate-400",children:"Progress"}),h.jsx("div",{className:"text-base font-semibold text-white",children:p})]})]}),h.jsxs("div",{className:"flex items-center gap-2 text-slate-300",children:[h.jsx(hE,{className:"w-4 h-4 text-purple-400"}),h.jsxs("span",{className:"text-sm",children:["ETA ",h.jsx("span",{className:"font-semibold text-white",children:y})]})]})]}),h.jsxs("div",{className:"relative h-8 w-full overflow-hidden rounded-md bg-slate-900 border border-slate-700",children:[h.jsx("div",{className:"h-full bg-gradient-to-r from-blue-500 to-sky-400 transition-[width] duration-500",style:{width:`${d}%`}}),h.jsx("div",{className:"absolute inset-0 flex items-center justify-center font-semibold text-white text-sm tabular-nums drop-shadow",children:f?"warming upโ€ฆ":`${d.toFixed(1)}%`})]})]})}),h.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[h.jsxs(Gr,{className:"bg-slate-800/50 border-slate-700 rounded-xl",children:[h.jsx(jo,{className:"pb-2",children:h.jsxs(ga,{className:"flex items-center gap-3 text-white text-base",children:[h.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-green-500/20 text-green-400",children:h.jsx(qi,{className:"w-4 h-4"})}),h.jsxs("span",{children:["Loss"," ",h.jsxs("span",{className:"text-slate-400 text-sm font-normal",children:["(",((v=e.current_loss)==null?void 0:v.toFixed(4))??"โ€”",")"]})]})]})}),h.jsx(Wr,{className:"pt-0",children:h.jsx("div",{className:"h-48",children:i.length===0?h.jsx("div",{className:"flex h-full items-center justify-center text-slate-500 text-sm",children:"Waiting for first metric tickโ€ฆ"}):h.jsx(FI,{width:"100%",height:"100%",children:h.jsxs(vk,{data:i,margin:{top:8,right:12,left:0,bottom:0},children:[h.jsx(fm,{dataKey:"step",tick:{fill:"#94a3b8",fontSize:11},stroke:"#475569"}),h.jsx(hm,{tick:{fill:"#94a3b8",fontSize:11},stroke:"#475569",width:48}),h.jsx(So,{contentStyle:{background:"#1e293b",border:"1px solid #475569",borderRadius:8},labelStyle:{color:"#cbd5e1"},itemStyle:{color:"#34d399"},formatter:m=>m.toFixed(4)}),h.jsx(lf,{type:"monotone",dataKey:"loss",stroke:"#34d399",strokeWidth:2,dot:!1,isAnimationActive:!1})]})})})})]}),h.jsxs(Gr,{className:"bg-slate-800/50 border-slate-700 rounded-xl",children:[h.jsx(jo,{className:"pb-2",children:h.jsxs(ga,{className:"flex items-center gap-3 text-white text-base",children:[h.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-orange-500/20 text-orange-400",children:h.jsx($u,{className:"w-4 h-4"})}),h.jsxs("span",{children:["Learning Rate"," ",h.jsxs("span",{className:"text-slate-400 text-sm font-normal",children:["(",((g=e.current_lr)==null?void 0:g.toExponential(2))??"โ€”",")"]})]})]})}),h.jsx(Wr,{className:"pt-0",children:h.jsx("div",{className:"h-48",children:a.length===0?h.jsx("div",{className:"flex h-full items-center justify-center text-slate-500 text-sm",children:"Waiting for first metric tickโ€ฆ"}):h.jsx(FI,{width:"100%",height:"100%",children:h.jsxs(vk,{data:a,margin:{top:8,right:12,left:0,bottom:0},children:[h.jsx(fm,{dataKey:"step",tick:{fill:"#94a3b8",fontSize:11},stroke:"#475569"}),h.jsx(hm,{tick:{fill:"#94a3b8",fontSize:11},stroke:"#475569",width:48,tickFormatter:m=>m.toExponential(0)}),h.jsx(So,{contentStyle:{background:"#1e293b",border:"1px solid #475569",borderRadius:8},labelStyle:{color:"#cbd5e1"},itemStyle:{color:"#fb923c"},formatter:m=>m.toExponential(2)}),h.jsx(lf,{type:"monotone",dataKey:"lr",stroke:"#fb923c",strokeWidth:2,dot:!1,isAnimationActive:!1})]})})})})]})]})]})},eDe=({logs:t,logContainerRef:e})=>h.jsxs(Gr,{className:"bg-slate-800/50 border-slate-700 rounded-xl",children:[h.jsx(jo,{children:h.jsxs(ga,{className:"flex items-center gap-3 text-white",children:[h.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-slate-700",children:h.jsx(Q7,{className:"w-5 h-5 text-sky-400"})}),"Training Logs"]})}),h.jsx(Wr,{children:h.jsx("div",{ref:e,className:"bg-slate-900 rounded-lg p-4 h-96 overflow-y-auto font-mono text-sm border border-slate-700",children:t.length===0?h.jsx("div",{className:"text-slate-500 py-8",children:"No training logs yet. Start training to see output."}):t.map((n,r)=>h.jsxs("div",{className:"text-slate-300 break-words whitespace-pre-wrap",children:[h.jsx("span",{className:"text-slate-500 mr-2 select-none",children:new Date(n.timestamp*1e3).toLocaleTimeString()}),n.message]},r))})})]}),tDe=({installHint:t})=>{const e=$z("system/training-extra");return h.jsx("div",{className:"max-w-3xl mx-auto",children:h.jsxs(Gr,{className:"bg-slate-800/50 border-slate-700 rounded-xl",children:[h.jsx(jo,{children:h.jsxs(ga,{className:"flex items-center gap-3 text-white",children:[h.jsx(Hz,{state:e.state}),zz(e.state,"Training Extra Not Installed")]})}),h.jsx(Wr,{className:"space-y-4",children:h.jsx(Vz,{state:e.state,error:e.error,logs:e.logs,logBoxRef:e.logBoxRef,onInstall:e.handleInstall,onRetry:e.handleRetry,installHint:t,packageName:"accelerate",idleTitle:"Training Extra Not Installed",idleDescription:h.jsxs(h.Fragment,{children:["Training requires the"," ",h.jsx("code",{className:"px-1 py-0.5 rounded bg-slate-900 text-sky-300",children:"accelerate"})," ","package, which isn't installed in this environment. Install it to enable the Training page."]}),doneDescription:h.jsx(Gz,{purpose:"training"})})})]})})},nDe=()=>{const{auth:t,refetch:e}=xf(),{baseUrl:n,fetchWithHeaders:r}=Dn(),[i,o]=_.useState(""),[a,s]=_.useState(!1),[l,c]=_.useState(null);if(t.status==="authenticated"||t.status==="loading")return null;const u=async()=>{const d=i.trim();if(d){s(!0),c(null);try{const f=await r(`${n}/hf-auth/login`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:d})});if(!f.ok){const p=await f.json().catch(()=>({}));throw new Error(p.detail||`HTTP ${f.status}`)}o(""),await e()}catch(f){c(f instanceof Error?f.message:String(f))}finally{s(!1)}}};return h.jsx("div",{className:"bg-amber-950/40 border border-amber-700/60 rounded-lg p-4 mb-6",children:h.jsxs("div",{className:"flex items-start gap-3",children:[h.jsx(td,{className:"w-5 h-5 text-amber-400 flex-shrink-0 mt-0.5"}),h.jsxs("div",{className:"flex-1 space-y-3",children:[h.jsxs("div",{children:[h.jsx("p",{className:"text-sm text-amber-100 font-medium",children:"Hugging Face access required for cloud training"}),h.jsxs("p",{className:"text-xs text-amber-200/80 mt-1",children:["Create a token at"," ",h.jsxs("a",{href:"https://huggingface.co/settings/tokens",target:"_blank",rel:"noreferrer",className:"underline hover:text-amber-50 inline-flex items-center gap-1",children:["huggingface.co/settings/tokens",h.jsx(cl,{className:"w-3 h-3"})]})," ","with ",h.jsx("span",{className:"font-mono",children:"Write"})," access (so trained policies can upload to your account), then paste it below."]})]}),h.jsxs("form",{onSubmit:d=>{d.preventDefault(),u()},className:"flex gap-2",children:[h.jsx(hi,{type:"password",placeholder:"hf_...",value:i,onChange:d=>o(d.target.value),className:"bg-slate-900 border-slate-600 text-white placeholder:text-slate-500",disabled:a,autoComplete:"off"}),h.jsx(et,{type:"submit",disabled:a||!i.trim(),className:"bg-amber-600 hover:bg-amber-700 text-white",children:a?h.jsxs(h.Fragment,{children:[h.jsx(fi,{className:"w-4 h-4 mr-2 animate-spin"}),"Savingโ€ฆ"]}):"Save token"})]}),l&&h.jsx("p",{className:"text-xs text-red-300",children:l})]})]})})},rDe=1e3,yk=5e3;function iDe(t,e){return t?{training_active:t.state==="running",current_step:t.metrics.current_step,total_steps:t.metrics.total_steps,current_loss:t.metrics.current_loss??void 0,current_lr:t.metrics.current_lr??void 0,grad_norm:t.metrics.grad_norm??void 0,eta_seconds:t.metrics.eta_seconds??void 0,available_controls:{stop_training:t.state==="running",pause_training:!1,resume_training:!1}}:{training_active:e,current_step:0,total_steps:0,available_controls:{stop_training:!1,pause_training:!1,resume_training:!1}}}function oDe(t){const e=Dz(t.policy_type);return{target:t.target,dataset_repo_id:t.dataset_repo_id,policy_type:t.policy_type,steps:t.steps,batch_size:t.batch_size,seed:t.seed,num_workers:t.num_workers,log_freq:t.log_freq,save_freq:t.save_freq,save_checkpoint:t.save_checkpoint,resume:t.resume,wandb_enable:t.wandb_enable,wandb_project:t.wandb_project,wandb_entity:t.wandb_entity,wandb_notes:t.wandb_notes,wandb_mode:t.wandb_mode,wandb_disable_artifact:t.wandb_disable_artifact,policy_device:t.policy_device,policy_use_amp:t.policy_use_amp,policy_dtype:e.dtype?t.policy_dtype:void 0,policy_gradient_checkpointing:e.gradientCheckpointing?t.policy_gradient_checkpointing:void 0,policy_freeze_vision_encoder:e.freezeVisionEncoder?t.policy_freeze_vision_encoder:void 0,policy_train_expert_only:e.trainExpertOnly?t.policy_train_expert_only:void 0,optimizer_type:t.optimizer_type,optimizer_lr:t.optimizer_lr,optimizer_weight_decay:t.optimizer_weight_decay,optimizer_grad_clip_norm:t.optimizer_grad_clip_norm,use_policy_training_preset:t.use_policy_training_preset}}const aDe=()=>{var ee;const{baseUrl:t,fetchWithHeaders:e}=Dn(),{auth:n}=xf(),{toast:r}=Dr(),i=ji(),a=((ee=yl().state)==null?void 0:ee.datasetRepoId)??"",[s,l]=_.useState({target:{runner:"local"},dataset_repo_id:a,policy_type:"act",steps:1e4,batch_size:8,seed:1e3,num_workers:4,log_freq:250,save_freq:1e3,save_checkpoint:!0,resume:!1,wandb_enable:!1,wandb_mode:"online",wandb_disable_artifact:!1,policy_device:"cuda",policy_use_amp:!1,policy_dtype:void 0,policy_gradient_checkpointing:void 0,policy_freeze_vision_encoder:void 0,policy_train_expert_only:void 0,optimizer_type:"adam",use_policy_training_preset:!0}),[c,u]=_.useState([]),[d,f]=_.useState(!0),[p,y]=_.useState(null),[v,g]=_.useState("pip install accelerate"),[m,x]=_.useState(!1),[b,S]=_.useState(!1),[w,E]=_.useState(!1),[T,A]=_.useState([]),[M,C]=_.useState([]),[P,R]=_.useState(!0),[D,k]=_.useState("https://sensecraft-gpu.seeed.cc/lelab/connect"),[U,O]=_.useState(!1);_.useEffect(()=>{f(!0),b4(t,e).then(u).catch(()=>u([])).finally(()=>f(!1))},[t,e]),_.useEffect(()=>{e(`${t}/system/training-extra`).then(te=>te.json()).then(te=>{y(te.available),g(te.install_hint)}).catch(()=>y(!0))},[t,e]),_.useEffect(()=>{CE(t,e,200).then(te=>x(te.some(Q=>Q.runner==="local"&&Q.state==="running"))).catch(()=>x(!1))},[t,e]),_.useEffect(()=>{R(!0),PN(t,e).then(te=>{E(te.authenticated),A(te.flavors??[]),C(te.providers??[])}).catch(()=>{E(!1),A([]),C([])}).finally(()=>R(!1))},[t,e,n.status]),_.useEffect(()=>{wZ(t,e).then(te=>{const Q=te.web_url||"https://sensecraft-gpu.seeed.cc";k(`${Q.replace(/\/$/,"")}/lelab/connect`)}).catch(()=>k("https://sensecraft-gpu.seeed.cc/lelab/connect"))},[t,e]);const W=(te,Q)=>{l(ce=>{const ae={...ce,[te]:Q};return te==="policy_type"&&typeof Q=="string"?{...ae,...Cce(Q,ce)}:ae})},L=async()=>{if(!s.dataset_repo_id.trim()){r({title:"Error",description:"Dataset repository ID is required",variant:"destructive"});return}S(!0);try{const te=await xZ(t,e,oDe(s));r({title:"Training Started",description:te.name}),i(`/training/${te.id}`)}catch(te){const Q=te instanceof Error?te.message:String(te);r({title:"Error",description:Q,variant:"destructive"}),CE(t,e,200).then(ce=>x(ce.some(ae=>ae.runner==="local"&&ae.state==="running"))).catch(()=>{})}finally{S(!1)}},j=()=>{O(!0);const te=window.open(D,"lelab-seeed-cloud","width=520,height=720");if(!te){O(!1),r({title:"Seeed Cloud",description:"Browser blocked the connection window.",variant:"destructive"});return}const Q=window.setTimeout(()=>{window.removeEventListener("message",ae),O(!1)},12e4),ce=async(fe,we,le)=>{try{await SZ(t,e,{token:fe,api_url:we,web_url:le});const ie=await PN(t,e);E(ie.authenticated),A(ie.flavors??[]),C(ie.providers??[]),r({title:"Seeed Cloud connected",description:"GPU flavors are available now."})}catch(ie){const G=ie instanceof Error?ie.message:String(ie);r({title:"Seeed Cloud",description:G,variant:"destructive"})}finally{window.clearTimeout(Q),window.removeEventListener("message",ae),O(!1),te.close()}};function ae(fe){const we=new URL(D).origin;if(fe.origin!==we)return;const le=fe.data;(le==null?void 0:le.type)!=="seeed-cloud-token"||!le.token||ce(le.token,le.apiUrl,le.webUrl)}window.addEventListener("message",ae)};if(p===null)return h.jsx("div",{className:"min-h-screen bg-slate-900 text-white p-4",children:h.jsxs("div",{className:"max-w-7xl mx-auto",children:[h.jsx(kw,{}),h.jsxs("div",{className:"flex items-center justify-center py-24 text-slate-400",children:[h.jsx(fi,{className:"w-6 h-6 animate-spin mr-3"}),"Checking training environmentโ€ฆ"]})]})});if(p===!1)return h.jsx("div",{className:"min-h-screen bg-slate-900 text-white p-4",children:h.jsxs("div",{className:"max-w-7xl mx-auto",children:[h.jsx(kw,{}),h.jsx(tDe,{installHint:v})]})});const X=s.target.runner==="hf_cloud",K=(s.target.runner==="hf_cloud"||s.target.runner==="seeed_cloud"||s.target.runner==="external")&&!s.target.flavor,F=s.target.runner==="local"&&m,Y=b||!s.dataset_repo_id.trim()||F||X&&!w||K,q=F?"Another local training is already running":X&&!w?"Log in to Hugging Face to use cloud compute":K?"Select a hardware flavor":void 0;return h.jsx("div",{className:"min-h-screen bg-slate-900 text-white p-4",children:h.jsxs("div",{className:"max-w-7xl mx-auto",children:[h.jsx(kw,{}),h.jsx(nDe,{}),h.jsx(Hce,{config:s,updateConfig:W,datasets:c,datasetsLoading:d,authenticated:w,flavors:T,providers:M,hardwareLoading:P,seeedConnecting:U,onConnectSeeedCloud:j}),h.jsx("div",{className:"max-w-3xl mx-auto mt-6 flex justify-end",children:(()=>{const te=h.jsx(et,{onClick:L,disabled:Y,size:"lg",className:"bg-green-500 hover:bg-green-600 text-white font-semibold px-6",children:b?h.jsxs(h.Fragment,{children:[h.jsx(fi,{className:"w-5 h-5 mr-2 animate-spin"})," Startingโ€ฆ"]}):h.jsxs(h.Fragment,{children:[h.jsx(Tc,{className:"w-5 h-5 mr-2"})," Start Training"]})});return q?h.jsxs(Fv,{children:[h.jsx(Bv,{asChild:!0,children:h.jsx("span",{tabIndex:0,children:te})}),h.jsx(Gh,{children:q})]}):te})()})]})})},sDe=({jobId:t})=>{const{baseUrl:e,fetchWithHeaders:n}=Dn(),{toast:r}=Dr(),i=ji(),{selectedRecord:o}=$A(),[a,s]=_.useState(null),[l,c]=_.useState(null),[u,d]=_.useState([]),f=_.useRef(null),[p,y]=_.useState([]),[v,g]=_.useState(null),[m,x]=_.useState(!1);_.useEffect(()=>{let M=!1;return vZ(e,n,t).then(C=>{!M&&C.length>0&&d(C)}).catch(()=>{}),()=>{M=!0}},[e,n,t]);const b=_.useRef(a==null?void 0:a.state);b.current=a==null?void 0:a.state,_.useEffect(()=>{let M=!1;const C=()=>{FA(e,n,t).then(R=>{if(!M)if(y(R),R.length>0){const D=R[R.length-1].step;g(k=>k!=null&&R.some(U=>U.step===k)?k:D)}else g(null)}).catch(()=>{M||(y([]),g(null))})};C();const P=setInterval(()=>{M||b.current&&b.current!=="running"||C()},5e3);return()=>{M=!0,clearInterval(P)}},[e,n,t]),_.useEffect(()=>{let M=!1;const C=async()=>{try{const R=await mZ(e,n,t);if(M)return;if(s(R),R.state==="running"){const D=await gZ(e,n,t);!M&&D.length>0&&d(k=>{const U=[...k,...D];return U.length>yk?U.slice(U.length-yk):U})}}catch(R){M||c(R instanceof Error?R.message:String(R))}};C();const P=setInterval(()=>{M||b.current&&b.current!=="running"||C()},rDe);return()=>{M=!0,clearInterval(P)}},[e,n,t]),_.useEffect(()=>{f.current&&(f.current.scrollTop=f.current.scrollHeight)},[u]);const S=M=>{const C=Math.floor(M/3600),P=Math.floor(M%3600/60),R=Math.floor(M%60);return`${C.toString().padStart(2,"0")}:${P.toString().padStart(2,"0")}:${R.toString().padStart(2,"0")}`},w=()=>!a||a.metrics.total_steps===0?0:a.metrics.current_step/a.metrics.total_steps*100,E=async()=>{if(a&&window.confirm("Stop this run?"))try{const M=await v4(e,n,a.id);s(M),r({title:"Stoppingโ€ฆ"})}catch(M){r({title:"Stop failed",description:M instanceof Error?M.message:String(M),variant:"destructive"})}},T=async()=>{if(a&&window.confirm("Delete this run? This wipes the output directory."))try{await y4(e,n,a.id),r({title:"Job removed"}),i("/")}catch(M){r({title:"Delete failed",description:M instanceof Error?M.message:String(M),variant:"destructive"})}};if(l&&!a)return h.jsx("div",{className:"min-h-screen bg-slate-900 text-white p-4",children:h.jsxs("div",{className:"max-w-7xl mx-auto space-y-4",children:[h.jsxs(et,{variant:"ghost",onClick:()=>i("/"),className:"text-slate-400",children:[h.jsx(ll,{className:"w-4 h-4 mr-2"})," Back to Jobs"]}),h.jsxs("p",{className:"text-red-300",children:["Couldn't load job ",t,": ",l]})]})});if(!a)return h.jsx("div",{className:"min-h-screen bg-slate-900 text-white p-4",children:h.jsxs("div",{className:"max-w-7xl mx-auto flex items-center justify-center py-24 text-slate-400",children:[h.jsx(fi,{className:"w-6 h-6 animate-spin mr-3"})," Loading jobโ€ฆ"]})});const A=a.state==="running";return h.jsx("div",{className:"min-h-screen bg-slate-900 text-white p-4",children:h.jsxs("div",{className:"max-w-7xl mx-auto space-y-6",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs(et,{variant:"ghost",onClick:()=>i("/"),className:"text-slate-400 hover:text-white",children:[h.jsx(ll,{className:"w-4 h-4 mr-2"})," Jobs"]}),h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("h1",{className:"text-xl font-semibold text-white",children:a.name}),a.runner==="hf_cloud"?h.jsxs("span",{className:"text-xs px-2 py-0.5 rounded bg-amber-900/40 text-amber-200 border border-amber-700",children:["HF ยท ",a.hf_flavor??"cloud"]}):a.runner==="seeed_cloud"||a.runner==="external"?h.jsxs("span",{className:"text-xs px-2 py-0.5 rounded bg-emerald-900/40 text-emerald-200 border border-emerald-700",children:[a.runner==="seeed_cloud"?"Seeed":a.external_provider??"External"," ยท"," ",a.external_flavor??"GPU"]}):h.jsx("span",{className:"text-xs px-2 py-0.5 rounded bg-slate-700 text-slate-200 border border-slate-600",children:"Local"}),a.runner==="hf_cloud"&&a.hf_repo_id&&a.state==="done"&&h.jsx("a",{href:`https://huggingface.co/${a.hf_repo_id}`,target:"_blank",rel:"noreferrer",className:"text-xs text-amber-300 hover:text-amber-200 underline",children:"View on Hub โ†—"}),(a.runner==="seeed_cloud"||a.runner==="external")&&a.external_job_url&&h.jsx("a",{href:a.external_job_url,target:"_blank",rel:"noreferrer",className:"text-xs text-emerald-300 hover:text-emerald-200 underline",children:"View provider job โ†—"}),a.wandb_run_url&&h.jsx("a",{href:a.wandb_run_url,target:"_blank",rel:"noreferrer",className:"text-xs text-yellow-300 hover:text-yellow-200 underline",children:"View on W&B โ†—"})]}),h.jsxs("p",{className:"text-xs text-slate-400",children:[a.state,a.error_message?` โ€” ${a.error_message}`:""]})]})]}),A?h.jsxs(et,{onClick:E,className:"bg-red-500 hover:bg-red-600 text-white",children:[h.jsx(Od,{className:"w-4 h-4 mr-2"})," Stop"]}):h.jsxs(et,{onClick:T,variant:"ghost",className:"text-slate-400 hover:text-white",children:[h.jsx(aA,{className:"w-4 h-4 mr-2"})," Delete"]})]}),h.jsx(QIe,{jobId:t,trainingStatus:iDe(a,!1),getProgressPercentage:w,formatTime:S}),h.jsxs("div",{className:"bg-slate-800/40 border border-slate-700 rounded-lg p-4 flex items-center gap-3",children:[h.jsx("span",{className:"text-sm font-semibold text-slate-300",children:"Run inference"}),p.length===0?h.jsx("span",{className:"text-xs text-slate-500",children:"No checkpoints yet โ€” wait for the first save."}):h.jsxs(h.Fragment,{children:[h.jsx(BA,{checkpoints:p,selectedStep:v,onChange:g}),h.jsxs(et,{onClick:()=>x(!0),disabled:v==null,className:"bg-green-500 hover:bg-green-600 text-white",children:[h.jsx(Tc,{className:"w-4 h-4 mr-2"}),"Run on robot"]})]})]}),h.jsx(x4,{open:m,onOpenChange:x,robot:o,jobId:t,initialStep:v}),h.jsx(eDe,{logs:u,logContainerRef:f})]})})},xk=()=>{const{jobId:t}=_W();return t?h.jsx(sDe,{jobId:t}):h.jsx(aDe,{})},lDe=1e3;function bk(t){const e=Math.max(0,Math.floor(t)),n=Math.floor(e/60),r=e%60;return`${String(n).padStart(2,"0")}:${String(r).padStart(2,"0")}`}const cDe=()=>{const t=ji(),{baseUrl:e,fetchWithHeaders:n}=Dn(),{toast:r}=Dr(),[i,o]=_.useState(null),[a,s]=_.useState(!1),l=_.useRef(!1),c=_.useRef(!1);_.useEffect(()=>{let b=!1;const S=async()=>{try{await ON(e,n)}catch{}},w=async()=>{try{const T=await LZ(e,n);if(b)return;if(o(T),!T.inference_active&&!l.current){l.current=!0,T.exited&&r({title:"Inference finished",description:T.exit_code===0?"Run completed.":`Exit code ${T.exit_code}. See ${T.log_path}.`,variant:T.exit_code===0?"default":"destructive"}),t("/");return}T.inference_active&&T.rollout_started_at!=null&&T.duration_s!=null&&T.duration_s>0&&T.rollout_elapsed_s>T.duration_s+10&&!c.current&&(c.current=!0,r({title:"Inference seems hung",description:`Rollout past duration by ${Math.round(T.rollout_elapsed_s-T.duration_s)}s. Stopping.`,variant:"destructive"}),S())}catch(T){b||r({title:"Lost connection to backend",description:T instanceof Error?T.message:String(T),variant:"destructive"})}};w();const E=setInterval(w,lDe);return()=>{b=!0,clearInterval(E)}},[e,n,t,r]);const u=async()=>{s(!1);try{await ON(e,n)}catch(b){r({title:"Stop failed",description:b instanceof Error?b.message:String(b),variant:"destructive"})}};if(!i)return h.jsxs("div",{className:"min-h-screen bg-black text-white flex items-center justify-center",children:[h.jsx(fi,{className:"w-6 h-6 animate-spin mr-3"})," Connecting to inferenceโ€ฆ"]});const d=i.elapsed_s??0,f=i.rollout_elapsed_s??0,p=i.duration_s??0,y=i.inference_active&&i.rollout_started_at==null,v=i.inference_active&&i.rollout_started_at!=null,g=v&&p>0?Math.min(100,f/p*100):0,m=y?"SETTING UP":v?"RUNNING":"FINISHED",x=v?f:d;return h.jsxs("div",{className:"min-h-screen bg-black text-white flex flex-col p-4 sm:p-6 lg:p-8",children:[h.jsxs("div",{className:"flex items-center gap-4 mb-8",children:[h.jsx(et,{variant:"ghost",size:"icon",onClick:()=>t("/"),className:"text-slate-400 hover:bg-slate-800 hover:text-white rounded-lg",children:h.jsx(ll,{className:"w-5 h-5"})}),h.jsx(Gx,{}),h.jsx("h1",{className:"font-bold text-white text-2xl",children:"Inference"})]}),h.jsx("div",{className:"flex-1 flex items-center justify-center",children:h.jsxs("div",{className:"bg-gray-900 rounded-lg border border-gray-700 p-8 w-full max-w-xl",children:[h.jsx("div",{className:"text-center mb-6",children:h.jsxs("div",{className:`inline-flex items-center gap-2 px-3 py-1 rounded-full text-xs font-bold tracking-widest ${y?"bg-amber-500/15 text-amber-300":"bg-green-500/15 text-green-300"}`,children:[h.jsx("span",{className:`w-2 h-2 rounded-full ${y?"bg-amber-500":"bg-green-500"} animate-pulse`}),m]})}),h.jsxs("div",{className:"text-center mb-4",children:[h.jsx("div",{className:`text-7xl font-mono font-bold leading-none ${y?"text-amber-400":"text-green-400"}`,children:bk(x)}),h.jsx("div",{className:"text-sm text-gray-500 mt-2",children:y?"Loading policy & connecting hardwareโ€ฆ":`/ ${bk(p)}`})]}),h.jsx("div",{className:"w-full bg-gray-800 rounded-full h-1.5 mb-8",children:h.jsx("div",{className:`h-1.5 rounded-full transition-all duration-500 ${y?"bg-amber-500/40 animate-pulse w-full":"bg-green-500"}`,style:y?void 0:{width:`${g}%`}})}),h.jsxs("div",{className:"text-xs text-slate-500 break-all mb-6",children:["policy: ",i.policy_ref??"(unknown)"]}),h.jsxs(et,{onClick:()=>s(!0),disabled:!i.inference_active,className:"w-full bg-red-500 hover:bg-red-600 text-white font-semibold py-6 text-lg disabled:opacity-50",children:[h.jsx(Od,{className:"w-5 h-5 mr-2"}),"Stop"]})]})}),h.jsx(xC,{open:a,onOpenChange:s,children:h.jsxs(Kx,{className:"bg-gray-900 border-gray-700 text-white",children:[h.jsxs(Yx,{children:[h.jsx(Zx,{children:"Stop inference?"}),h.jsx(Qx,{className:"text-gray-400",children:"The follower will hold its current pose. You can launch another run from the job tile."})]}),h.jsxs(Jx,{children:[h.jsx(tb,{className:"bg-gray-800 border-gray-700 text-white hover:bg-gray-700",children:"Keep running"}),h.jsx(eb,{onClick:u,className:"bg-red-500 hover:bg-red-600 text-white",children:"Stop"})]})]})})]})},uDe=()=>h.jsxs("div",{className:"min-h-screen bg-black text-white flex flex-col items-center justify-center p-4",children:[h.jsx("h1",{className:"text-5xl font-bold tracking-tight",children:"Edit Dataset"}),h.jsx("p",{className:"mt-4 text-xl text-gray-400",children:"This page is under construction."})]}),dDe=()=>{var R;const t=yl(),e=ji(),{toast:n}=Dr(),{baseUrl:r,fetchWithHeaders:i}=Dn(),o=(R=t.state)==null?void 0:R.datasetInfo,[a,s]=_.useState(null),[l,c]=_.useState(!0),[u,d]=_.useState({tags:["robotics","lerobot"],private:!1}),[f,p]=_.useState(u.tags.join(", ")),[y,v]=_.useState(!1),[g,m]=_.useState(!1),[x,b]=_.useState(!1),[S,w]=_.useState(!1);Z.useEffect(()=>{(async()=>{if(!(o!=null&&o.dataset_repo_id)){n({title:"No Dataset Information",description:"Please complete a recording session first.",variant:"destructive"}),e("/");return}try{const k=await i(`${r}/dataset-info`,{method:"POST",body:JSON.stringify({dataset_repo_id:o.dataset_repo_id})}),U=await k.json();k.ok&&U.success?s({...U,saved_episodes:U.num_episodes,session_elapsed_seconds:o.session_elapsed_seconds||0,source:o.source}):(n({title:"Warning",description:"Could not load complete dataset information. Using session data.",variant:"destructive"}),s(o))}catch(k){console.error("Error loading dataset info:",k),n({title:"Warning",description:"Could not connect to backend. Using session data.",variant:"destructive"}),s(o)}finally{c(!1)}})()},[o,e,n]);const E=D=>{const k=`/spaces/lerobot/visualize_dataset?path=${encodeURIComponent(`/${D}`)}`,U=`https://huggingface.co/login?next=${encodeURIComponent(k)}`;window.open(U,"_blank","noopener,noreferrer")},T=D=>{const k=Math.floor(D/3600),U=Math.floor(D%3600/60),O=D%60;return k>0?`${k}h ${U}m ${O}s`:U>0?`${U}m ${O}s`:`${O}s`},A=async()=>{if(a){v(!0);try{const D=f.split(",").map(O=>O.trim()).filter(O=>O.length>0),k=await i(`${r}/upload-dataset`,{method:"POST",body:JSON.stringify({dataset_repo_id:a.dataset_repo_id,tags:D,private:u.private})}),U=await k.json();if(k.ok&&U.success)m(!0),n({title:"Upload Successful!",description:`Dataset ${a.dataset_repo_id} has been uploaded to HuggingFace Hub.`});else{const O="Failed to upload dataset to HuggingFace Hub.";n({title:"Upload Failed",description:U.docs_url?h.jsxs("span",{children:[U.message||O," ",h.jsx("a",{href:U.docs_url,target:"_blank",rel:"noopener noreferrer",className:"underline font-medium",children:"Open setup guide"})]}):U.message||O,variant:"destructive"})}}catch(D){console.error("Error uploading dataset:",D),n({title:"Connection Error",description:"Could not connect to the backend server.",variant:"destructive"})}finally{v(!1)}}},M=()=>{n({title:"Upload Skipped",description:"Dataset saved locally. You can upload it manually later."}),e("/")},C=async()=>{if(a){w(!0);try{const D=await i(`${r}/delete-dataset`,{method:"POST",body:JSON.stringify({dataset_repo_id:a.dataset_repo_id})}),k=await D.json();D.ok&&k.success?(n({title:"Dataset Deleted",description:`${a.dataset_repo_id} has been removed from disk.`}),e("/")):n({title:"Delete Failed",description:k.message||"Could not delete the dataset.",variant:"destructive"})}catch{n({title:"Connection Error",description:"Could not connect to the backend server.",variant:"destructive"})}finally{w(!1),b(!1)}}};if(l||!a)return h.jsx("div",{className:"min-h-screen bg-black text-white flex items-center justify-center",children:h.jsxs("div",{className:"text-center",children:[h.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-500 mx-auto mb-4"}),h.jsx("p",{className:"text-lg",children:"Loading dataset information..."})]})});const P=a.source==="both";return h.jsxs("div",{className:"min-h-screen bg-black text-white p-8",children:[h.jsxs("div",{className:"max-w-4xl mx-auto",children:[h.jsxs("div",{className:"flex items-center justify-between mb-8",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs(et,{onClick:()=>e("/"),variant:"outline",className:"border-gray-500 hover:border-gray-200 text-gray-300 hover:text-white",children:[h.jsx(ll,{className:"w-4 h-4 mr-2"}),"Back to Home"]}),h.jsx(et,{onClick:()=>b(!0),variant:"outline",size:"icon",disabled:S,"aria-label":"Delete dataset from disk",className:"border-red-500/40 text-red-400 hover:border-red-400 hover:text-red-300 hover:bg-red-500/10",children:h.jsx(aA,{className:"w-4 h-4"})})]}),h.jsxs("div",{className:"flex items-center gap-3",children:[g?h.jsx(qi,{className:"w-8 h-8 text-green-500"}):h.jsx(K7,{className:"w-8 h-8 text-blue-500"}),h.jsx("h1",{className:"text-3xl font-bold",children:g?"Upload Complete":"Dataset Upload"})]})]}),g&&h.jsxs("div",{className:"bg-green-900/20 border border-green-600 rounded-lg p-6 mb-8",children:[h.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[h.jsx(qi,{className:"w-6 h-6 text-green-500"}),h.jsx("h2",{className:"text-xl font-semibold text-green-400",children:"Successfully Uploaded!"})]}),h.jsx("p",{className:"text-gray-300 mb-4",children:"Your dataset has been uploaded to HuggingFace Hub and is now available for training and sharing."}),h.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[h.jsxs(et,{onClick:()=>{const D=`/spaces/lerobot/visualize_dataset?path=${encodeURIComponent(`/${a.dataset_repo_id}`)}`,k=u.private?`https://huggingface.co/login?next=${encodeURIComponent(D)}`:`https://huggingface.co${D}`;window.open(k,"_blank","noopener,noreferrer")},className:"bg-blue-500 hover:bg-blue-600 text-white",children:[h.jsx(cl,{className:"w-4 h-4 mr-2"}),"View on HuggingFace Hub"]}),h.jsx(et,{onClick:()=>e("/training",{state:{datasetRepoId:a.dataset_repo_id}}),className:"bg-purple-500 hover:bg-purple-600 text-white",children:"Start Training"})]})]}),!g&&h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"bg-gray-900 rounded-lg p-6 border border-gray-700 mb-8",children:[h.jsx("h2",{className:"text-xl font-semibold text-white mb-4",children:"Dataset Summary"}),h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-400",children:"Repository ID:"}),h.jsx("p",{className:"text-white font-mono text-lg",children:a.dataset_repo_id})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-400",children:"Task:"}),h.jsx("p",{className:"text-white",children:a.single_task})]})]}),h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-400",children:"Episodes Recorded:"}),h.jsx("p",{className:"text-white text-2xl font-bold text-green-400",children:a.saved_episodes||a.num_episodes}),a.total_frames&&h.jsxs("p",{className:"text-gray-400 text-sm",children:[a.total_frames," total frames"]})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-400",children:"Session Duration:"}),h.jsx("p",{className:"text-white",children:T(a.session_elapsed_seconds||0)}),a.fps&&h.jsxs("p",{className:"text-gray-400 text-sm",children:[a.fps," FPS"]})]})]})]})]}),!P&&h.jsxs("div",{className:"bg-gray-900 rounded-lg p-6 border border-gray-700 mb-8",children:[h.jsx("h2",{className:"text-xl font-semibold text-white mb-6",children:"Upload Configuration"}),h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"tags",className:"text-gray-300 mb-2 block",children:"Tags (comma-separated)"}),h.jsx(hi,{id:"tags",value:f,onChange:D=>p(D.target.value),placeholder:"robotics, lerobot, manipulation",className:"bg-gray-800 border-gray-600 text-white"}),h.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Tags help others discover your dataset on HuggingFace Hub"})]}),h.jsxs("div",{className:"flex items-center space-x-3",children:[h.jsx(IA,{id:"private",checked:u.private,onCheckedChange:D=>d({...u,private:D})}),h.jsxs("div",{className:"flex items-center gap-2",children:[u.private?h.jsx(J7,{className:"w-4 h-4 text-gray-400"}):h.jsx(Z7,{className:"w-4 h-4 text-gray-400"}),h.jsx(Tt,{htmlFor:"private",className:"text-gray-300",children:"Make dataset private"})]})]}),h.jsx("p",{className:"text-sm text-gray-500 ml-6",children:u.private?"Only you will be able to access this dataset":"Dataset will be publicly accessible on HuggingFace Hub"})]})]}),h.jsx("div",{className:"flex flex-col sm:flex-row gap-4 justify-center",children:P?h.jsxs(et,{onClick:()=>E(a.dataset_repo_id),className:"bg-blue-500 hover:bg-blue-600 text-white font-semibold py-4 px-8 text-lg",children:[h.jsx(cl,{className:"w-5 h-5 mr-2"}),"View on Hugging Face Hub"]}):h.jsxs(h.Fragment,{children:[h.jsx(et,{onClick:A,disabled:y,className:"bg-blue-500 hover:bg-blue-600 text-white font-semibold py-4 px-8 text-lg",children:y?h.jsxs(h.Fragment,{children:[h.jsx(fi,{className:"w-5 h-5 mr-2 animate-spin"}),"Uploading to Hub..."]}):h.jsxs(h.Fragment,{children:[h.jsx(jU,{className:"w-5 h-5 mr-2"}),"Upload to HuggingFace Hub"]})}),h.jsx(et,{onClick:M,disabled:y,variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-800 hover:text-white py-4 px-8 text-lg",children:"Skip Upload"})]})}),!P&&h.jsx("div",{className:"mt-8 p-4 bg-blue-900/20 border border-blue-600 rounded-lg",children:h.jsxs("div",{className:"flex items-start gap-3",children:[h.jsx(td,{className:"w-5 h-5 text-blue-400 mt-0.5"}),h.jsxs("div",{children:[h.jsx("h3",{className:"font-semibold text-blue-400 mb-2",children:"About HuggingFace Hub Upload"}),h.jsxs("ul",{className:"text-sm text-gray-300 space-y-1",children:[h.jsx("li",{children:"โ€ข Your dataset will be uploaded to HuggingFace Hub for sharing and collaboration"}),h.jsx("li",{children:"โ€ข You need to be logged in to HuggingFace CLI on the server"}),h.jsx("li",{children:"โ€ข Uploaded datasets can be used for training models and sharing with the community"}),h.jsx("li",{children:"โ€ข You can always upload manually later using the HuggingFace CLI"})]})]})]})})]})]}),h.jsx(xC,{open:x,onOpenChange:b,children:h.jsxs(Kx,{className:"bg-gray-900 border-gray-700 text-white",children:[h.jsxs(Yx,{children:[h.jsx(Zx,{children:"Delete dataset from disk?"}),h.jsxs(Qx,{className:"text-gray-400",children:["This permanently removes ",h.jsx("span",{className:"font-mono text-white",children:a.dataset_repo_id})," from your local cache. This action cannot be undone."]})]}),h.jsxs(Jx,{children:[h.jsx(tb,{className:"bg-gray-800 border-gray-700 text-white hover:bg-gray-700",children:"Keep dataset"}),h.jsx(eb,{onClick:C,disabled:S,className:"bg-red-500 hover:bg-red-600 text-white",children:S?"Deletingโ€ฆ":"Delete"})]})]})})]})},fDe=()=>{const t=yl();return _.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",t.pathname)},[t.pathname]),h.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-100",children:h.jsxs("div",{className:"text-center",children:[h.jsx("h1",{className:"text-4xl font-bold mb-4",children:"404"}),h.jsx("p",{className:"text-xl text-gray-600 mb-4",children:"Oops! Page not found"}),h.jsx("a",{href:"/",className:"text-blue-500 hover:text-blue-700 underline",children:"Return to Home"})]})})},hDe="lelab-tabs-v1",pDe=1e3,mDe=3e3,gDe=({children:t})=>{const[e,n]=_.useState(!0),r=_.useRef(new Map),i=_.useRef(""),o=_.useRef(0),a=_.useRef(null),s=_.useCallback(()=>{const c=r.current,u=Date.now()-mDe;for(const[p,y]of c)y.lastSeen{if(typeof window>"u"||typeof BroadcastChannel>"u")return;i.current=crypto.randomUUID(),o.current=Date.now();const c=new BroadcastChannel(hDe);a.current=c;const u=p=>{c.postMessage({type:p,id:i.current,openedAt:o.current})};c.onmessage=p=>{const y=p.data;if(!y||y.id===i.current)return;const v=r.current;y.type==="HEARTBEAT"?v.set(y.id,{id:y.id,openedAt:y.openedAt,lastSeen:Date.now()}):y.type==="RELEASE"?v.delete(y.id):y.type==="TAKEOVER"&&(v.set(y.id,{id:y.id,openedAt:y.openedAt,lastSeen:Date.now()}),o.current<=y.openedAt&&(o.current=y.openedAt+1)),s()},u("HEARTBEAT");const d=setInterval(()=>{u("HEARTBEAT"),s()},pDe),f=()=>u("RELEASE");return window.addEventListener("beforeunload",f),()=>{window.removeEventListener("beforeunload",f),clearInterval(d),u("RELEASE"),c.close(),a.current=null}},[s]);const l=_.useCallback(()=>{var c;o.current=0,(c=a.current)==null||c.postMessage({type:"TAKEOVER",id:i.current,openedAt:0}),s()},[s]);return h.jsxs(h.Fragment,{children:[t,!e&&h.jsx("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center bg-black/80 backdrop-blur-sm",role:"dialog","aria-modal":"true",children:h.jsxs("div",{className:"mx-4 max-w-md space-y-4 rounded-lg border bg-background p-6 text-center shadow-lg",children:[h.jsx("h2",{className:"text-lg font-semibold",children:"LeLab is already open in another tab"}),h.jsx("p",{className:"text-sm text-muted-foreground",children:"Only one tab can control the robot at a time. Switch back to the original tab, or take over here โ€” the other tab will lock."}),h.jsx(et,{onClick:l,children:"Use this tab"})]})})]})},vDe=new c9;function yDe(){return h.jsx(d9,{client:vDe,children:h.jsx(WF,{children:h.jsx(p9,{children:h.jsx(qX,{children:h.jsx(KX,{children:h.jsx(V9,{children:h.jsx(W9,{children:h.jsxs(BW,{children:[h.jsx(gDe,{children:h.jsxs(jW,{children:[h.jsx(go,{path:"/",element:h.jsx(XZ,{})}),h.jsx(go,{path:"/teleoperation",element:h.jsx(bse,{})}),h.jsx(go,{path:"/recording",element:h.jsx(Mce,{})}),h.jsx(go,{path:"/upload",element:h.jsx(dDe,{})}),h.jsx(go,{path:"/training",element:h.jsx(xk,{})}),h.jsx(go,{path:"/training/:jobId",element:h.jsx(xk,{})}),h.jsx(go,{path:"/inference",element:h.jsx(cDe,{})}),h.jsx(go,{path:"/calibration",element:h.jsx(Ose,{})}),h.jsx(go,{path:"/edit-dataset",element:h.jsx(uDe,{})}),h.jsx(go,{path:"*",element:h.jsx(fDe,{})})]})}),h.jsx(VX,{})]})})})})})})})})}z3(document.getElementById("root")).render(h.jsx(yDe,{})); diff --git a/frontend/dist/index.html b/frontend/dist/index.html index 5f65fc7..5ce2e20 100644 --- a/frontend/dist/index.html +++ b/frontend/dist/index.html @@ -10,7 +10,7 @@ - + diff --git a/frontend/src/components/training/config/AdvancedCard.tsx b/frontend/src/components/training/config/AdvancedCard.tsx index 0556303..d7ae909 100644 --- a/frontend/src/components/training/config/AdvancedCard.tsx +++ b/frontend/src/components/training/config/AdvancedCard.tsx @@ -14,6 +14,7 @@ import { import { Separator } from '@/components/ui/separator'; import { ChevronDown, ChevronRight } from 'lucide-react'; import { ConfigComponentProps } from '../types'; +import { policyAdvancedCapabilities } from '../trainingPolicies'; const SectionHeading: React.FC<{ children: React.ReactNode }> = ({ children }) => (

@@ -23,6 +24,7 @@ const SectionHeading: React.FC<{ children: React.ReactNode }> = ({ children }) = const AdvancedCard: React.FC = ({ config, updateConfig }) => { const [expanded, setExpanded] = useState(false); + const policyCapabilities = policyAdvancedCapabilities(config.policy_type); return ( @@ -84,6 +86,70 @@ const AdvancedCard: React.FC = ({ config, updateConfig }) Use Automatic Mixed Precision

+ {policyCapabilities.dtype && ( +
+ + +
+ )} + {policyCapabilities.gradientCheckpointing && ( +
+ + updateConfig('policy_gradient_checkpointing', checked) + } + /> + +
+ )} + {policyCapabilities.freezeVisionEncoder && ( +
+ + updateConfig('policy_freeze_vision_encoder', checked) + } + /> + +
+ )} + {policyCapabilities.trainExpertOnly && ( +
+ + updateConfig('policy_train_expert_only', checked) + } + /> + +
+ )}
diff --git a/frontend/src/components/training/config/EssentialsCard.tsx b/frontend/src/components/training/config/EssentialsCard.tsx index 5c8e650..b5acc6a 100644 --- a/frontend/src/components/training/config/EssentialsCard.tsx +++ b/frontend/src/components/training/config/EssentialsCard.tsx @@ -16,6 +16,7 @@ import DatasetCombobox from '@/components/replay/DatasetCombobox'; import { DatasetItem } from '@/lib/replayApi'; import WandbInstallDialog from '../WandbInstallDialog'; import { useApi } from '@/contexts/ApiContext'; +import { OFFLINE_TRAINING_POLICY_OPTIONS } from '../trainingPolicies'; interface EssentialsCardProps extends ConfigComponentProps { datasets: DatasetItem[]; @@ -91,15 +92,11 @@ const EssentialsCard: React.FC = ({ config, updateConfig, d - ACT (Action Chunking Transformer) - Diffusion Policy - PI0 - SmolVLA - TD-MPC - VQ-BeT - PI0 Fast - SAC - Reward Classifier + {OFFLINE_TRAINING_POLICY_OPTIONS.map((policy) => ( + + {policy.label} + + ))}
diff --git a/frontend/src/components/training/trainingPolicies.ts b/frontend/src/components/training/trainingPolicies.ts new file mode 100644 index 0000000..6a76b5d --- /dev/null +++ b/frontend/src/components/training/trainingPolicies.ts @@ -0,0 +1,74 @@ +import { TrainingConfig } from "./types"; + +export const OFFLINE_TRAINING_POLICY_OPTIONS = [ + { value: "act", label: "ACT (Action Chunking Transformer)" }, + { value: "diffusion", label: "Diffusion Policy" }, + { value: "pi0", label: "PI0" }, + { value: "pi05", label: "PI0.5" }, + { value: "pi0_fast", label: "PI0 Fast" }, + { value: "smolvla", label: "SmolVLA" }, + { value: "vqbet", label: "VQ-BeT" }, +] as const; + +const PI0_POLICY_TYPES = new Set(["pi0", "pi05"]); +const PI0_FAST_POLICY_TYPES = new Set(["pi0_fast"]); +const SMOLVLA_POLICY_TYPES = new Set(["smolvla"]); + +export function policyAdvancedCapabilities(policyType: string) { + return { + dtype: PI0_POLICY_TYPES.has(policyType) || PI0_FAST_POLICY_TYPES.has(policyType), + gradientCheckpointing: + PI0_POLICY_TYPES.has(policyType) || PI0_FAST_POLICY_TYPES.has(policyType), + freezeVisionEncoder: PI0_POLICY_TYPES.has(policyType) || SMOLVLA_POLICY_TYPES.has(policyType), + trainExpertOnly: PI0_POLICY_TYPES.has(policyType) || SMOLVLA_POLICY_TYPES.has(policyType), + }; +} + +const resetPolicyAdvancedOptions = { + policy_dtype: undefined, + policy_gradient_checkpointing: undefined, + policy_freeze_vision_encoder: undefined, + policy_train_expert_only: undefined, +}; + +export function defaultsForPolicy( + policyType: string, + current: TrainingConfig, +): Partial { + if (PI0_POLICY_TYPES.has(policyType)) { + return { + ...resetPolicyAdvancedOptions, + batch_size: Math.min(current.batch_size || 1, 1), + policy_use_amp: true, + policy_dtype: "bfloat16", + policy_gradient_checkpointing: true, + policy_freeze_vision_encoder: true, + policy_train_expert_only: true, + }; + } + + if (PI0_FAST_POLICY_TYPES.has(policyType)) { + return { + ...resetPolicyAdvancedOptions, + batch_size: Math.min(current.batch_size || 1, 1), + policy_use_amp: true, + policy_dtype: "bfloat16", + policy_gradient_checkpointing: true, + }; + } + + if (SMOLVLA_POLICY_TYPES.has(policyType)) { + return { + ...resetPolicyAdvancedOptions, + batch_size: Math.min(current.batch_size || 1, 1), + policy_use_amp: true, + policy_freeze_vision_encoder: true, + policy_train_expert_only: true, + }; + } + + return { + ...resetPolicyAdvancedOptions, + policy_use_amp: false, + }; +} diff --git a/frontend/src/components/training/types.ts b/frontend/src/components/training/types.ts index 03114a2..1de5f7d 100644 --- a/frontend/src/components/training/types.ts +++ b/frontend/src/components/training/types.ts @@ -34,6 +34,10 @@ export interface TrainingConfig { // Policy-specific parameters policy_device?: string; policy_use_amp: boolean; + policy_dtype?: string; + policy_gradient_checkpointing?: boolean; + policy_freeze_vision_encoder?: boolean; + policy_train_expert_only?: boolean; // Optimizer parameters optimizer_type?: string; diff --git a/frontend/src/lib/jobsApi.ts b/frontend/src/lib/jobsApi.ts index 0b6088b..98eded8 100644 --- a/frontend/src/lib/jobsApi.ts +++ b/frontend/src/lib/jobsApi.ts @@ -49,6 +49,10 @@ export interface TrainingRequest { wandb_disable_artifact: boolean; policy_device?: string; policy_use_amp: boolean; + policy_dtype?: string; + policy_gradient_checkpointing?: boolean; + policy_freeze_vision_encoder?: boolean; + policy_train_expert_only?: boolean; optimizer_type?: string; optimizer_lr?: number; optimizer_weight_decay?: number; diff --git a/frontend/src/pages/Training.tsx b/frontend/src/pages/Training.tsx index b4a5654..dca53b7 100644 --- a/frontend/src/pages/Training.tsx +++ b/frontend/src/pages/Training.tsx @@ -5,6 +5,10 @@ import { useApi } from "@/contexts/ApiContext"; import { useHfAuth } from "@/contexts/HfAuthContext"; import { TrainingConfig, TrainingStatus, LogEntry } from "@/components/training/types"; +import { + defaultsForPolicy, + policyAdvancedCapabilities, +} from "@/components/training/trainingPolicies"; import TrainingHeader from "@/components/training/TrainingHeader"; import ConfigurationTab from "@/components/training/ConfigurationTab"; import MonitoringStats from "@/components/training/monitoring/MonitoringStats"; @@ -70,6 +74,7 @@ function jobToStatus(job: JobRecord | null, isStarting: boolean): TrainingStatus function configToRequest(c: TrainingConfig): TrainingRequest { // The backend's TrainingRequest has more optional fields; the form covers // the user-meaningful subset. + const policyCapabilities = policyAdvancedCapabilities(c.policy_type); return { target: c.target, dataset_repo_id: c.dataset_repo_id, @@ -90,6 +95,16 @@ function configToRequest(c: TrainingConfig): TrainingRequest { wandb_disable_artifact: c.wandb_disable_artifact, policy_device: c.policy_device, policy_use_amp: c.policy_use_amp, + policy_dtype: policyCapabilities.dtype ? c.policy_dtype : undefined, + policy_gradient_checkpointing: policyCapabilities.gradientCheckpointing + ? c.policy_gradient_checkpointing + : undefined, + policy_freeze_vision_encoder: policyCapabilities.freezeVisionEncoder + ? c.policy_freeze_vision_encoder + : undefined, + policy_train_expert_only: policyCapabilities.trainExpertOnly + ? c.policy_train_expert_only + : undefined, optimizer_type: c.optimizer_type, optimizer_lr: c.optimizer_lr, optimizer_weight_decay: c.optimizer_weight_decay, @@ -124,6 +139,10 @@ const ConfigurationMode: React.FC = () => { wandb_disable_artifact: false, policy_device: "cuda", policy_use_amp: false, + policy_dtype: undefined, + policy_gradient_checkpointing: undefined, + policy_freeze_vision_encoder: undefined, + policy_train_expert_only: undefined, optimizer_type: "adam", use_policy_training_preset: true, }); @@ -200,7 +219,13 @@ const ConfigurationMode: React.FC = () => { }, [baseUrl, fetchWithHeaders]); const updateConfig = (key: T, value: TrainingConfig[T]) => { - setTrainingConfig((prev) => ({ ...prev, [key]: value })); + setTrainingConfig((prev) => { + const next = { ...prev, [key]: value }; + if (key === "policy_type" && typeof value === "string") { + return { ...next, ...defaultsForPolicy(value, prev) }; + } + return next; + }); }; const handleStart = async () => { diff --git a/lelab/train.py b/lelab/train.py index d6da4b1..b43b753 100644 --- a/lelab/train.py +++ b/lelab/train.py @@ -20,10 +20,27 @@ import re -from pydantic import BaseModel +from pydantic import BaseModel, field_validator, model_validator _SLUG_RE = re.compile(r"[^a-zA-Z0-9._-]+") +OFFLINE_TRAINING_POLICY_TYPES = ( + "act", + "diffusion", + "pi0", + "pi05", + "pi0_fast", + "smolvla", + "vqbet", +) +_OFFLINE_TRAINING_POLICY_TYPE_SET = set(OFFLINE_TRAINING_POLICY_TYPES) +_POLICY_OPTION_SUPPORT = { + "policy_dtype": {"pi0", "pi05", "pi0_fast"}, + "policy_gradient_checkpointing": {"pi0", "pi05", "pi0_fast"}, + "policy_freeze_vision_encoder": {"pi0", "pi05", "smolvla"}, + "policy_train_expert_only": {"pi0", "pi05", "smolvla"}, +} + class TrainingRequest(BaseModel): # Dataset configuration @@ -35,6 +52,17 @@ class TrainingRequest(BaseModel): # Policy configuration policy_type: str = "act" + @field_validator("policy_type") + @classmethod + def _validate_policy_type(cls, value: str) -> str: + if value not in _OFFLINE_TRAINING_POLICY_TYPE_SET: + supported = ", ".join(OFFLINE_TRAINING_POLICY_TYPES) + raise ValueError( + f"policy_type {value!r} is not supported by this offline training flow; " + f"supported policies: {supported}" + ) + return value + # Core training parameters steps: int = 10000 batch_size: int = 8 @@ -71,6 +99,10 @@ class TrainingRequest(BaseModel): # Policy-specific policy_device: str | None = "cuda" policy_use_amp: bool = False + policy_dtype: str | None = None + policy_gradient_checkpointing: bool | None = None + policy_freeze_vision_encoder: bool | None = None + policy_train_expert_only: bool | None = None # Hub upload (set by HfCloudJobRunner; not exposed in the form) policy_push_to_hub: bool = False policy_repo_id: str | None = None @@ -85,6 +117,19 @@ class TrainingRequest(BaseModel): use_policy_training_preset: bool = True config_path: str | None = None + @model_validator(mode="after") + def _validate_policy_specific_options(self) -> "TrainingRequest": + for field_name, supported_policies in _POLICY_OPTION_SUPPORT.items(): + if getattr(self, field_name) is None: + continue + if self.policy_type not in supported_policies: + supported = ", ".join(sorted(supported_policies)) + raise ValueError( + f"policy_type {self.policy_type!r} does not support {field_name}; " + f"supported policies: {supported}" + ) + return self + def build_training_command( request: TrainingRequest, output_dir: str, python_executable: str = "python" @@ -126,6 +171,29 @@ def build_training_command( if request.policy_device: cmd.extend(["--policy.device", request.policy_device]) cmd.extend(["--policy.use_amp", "true" if request.policy_use_amp else "false"]) + if request.policy_dtype: + cmd.extend(["--policy.dtype", request.policy_dtype]) + if request.policy_gradient_checkpointing is not None: + cmd.extend( + [ + "--policy.gradient_checkpointing", + "true" if request.policy_gradient_checkpointing else "false", + ] + ) + if request.policy_freeze_vision_encoder is not None: + cmd.extend( + [ + "--policy.freeze_vision_encoder", + "true" if request.policy_freeze_vision_encoder else "false", + ] + ) + if request.policy_train_expert_only is not None: + cmd.extend( + [ + "--policy.train_expert_only", + "true" if request.policy_train_expert_only else "false", + ] + ) # LeRobot defaults push_to_hub=True and demands --policy.repo_id when so. # Local jobs keep it off; HF Cloud jobs flip it on via the runner. cmd.extend(["--policy.push_to_hub", "true" if request.policy_push_to_hub else "false"]) diff --git a/tests/test_train.py b/tests/test_train.py index 588c256..6b6ae8d 100644 --- a/tests/test_train.py +++ b/tests/test_train.py @@ -124,6 +124,25 @@ def test_seed_omitted_when_none() -> None: assert _arg_value(cmd2, "--seed") == "42" +def test_pi0_memory_options_are_forwarded() -> None: + from lelab.train import TrainingRequest, build_training_command + + req = TrainingRequest( + dataset_repo_id="x", + policy_type="pi0", + policy_dtype="bfloat16", + policy_gradient_checkpointing=True, + policy_freeze_vision_encoder=True, + policy_train_expert_only=True, + ) + cmd = build_training_command(req, "/tmp/out") + + assert _arg_value(cmd, "--policy.dtype") == "bfloat16" + assert _arg_value(cmd, "--policy.gradient_checkpointing") == "true" + assert _arg_value(cmd, "--policy.freeze_vision_encoder") == "true" + assert _arg_value(cmd, "--policy.train_expert_only") == "true" + + def test_training_request_validates_required_field() -> None: from pydantic import ValidationError @@ -131,3 +150,51 @@ def test_training_request_validates_required_field() -> None: with pytest.raises(ValidationError): TrainingRequest() # dataset_repo_id is required + + +def test_training_request_accepts_offline_training_policies() -> None: + from lelab.train import OFFLINE_TRAINING_POLICY_TYPES, TrainingRequest + + assert OFFLINE_TRAINING_POLICY_TYPES == ( + "act", + "diffusion", + "pi0", + "pi05", + "pi0_fast", + "smolvla", + "vqbet", + ) + for policy_type in OFFLINE_TRAINING_POLICY_TYPES: + req = TrainingRequest(dataset_repo_id="x", policy_type=policy_type) + assert req.policy_type == policy_type + + +def test_training_request_rejects_non_offline_training_policies() -> None: + from pydantic import ValidationError + + from lelab.train import TrainingRequest + + for policy_type in ("tdmpc", "sac", "reward_classifier"): + with pytest.raises(ValidationError, match="not supported by this offline training flow"): + TrainingRequest(dataset_repo_id="x", policy_type=policy_type) + + +def test_training_request_rejects_policy_options_that_policy_does_not_support() -> None: + from pydantic import ValidationError + + from lelab.train import TrainingRequest + + TrainingRequest(dataset_repo_id="x", policy_type="smolvla", policy_freeze_vision_encoder=True) + TrainingRequest(dataset_repo_id="x", policy_type="smolvla", policy_train_expert_only=True) + TrainingRequest(dataset_repo_id="x", policy_type="pi0_fast", policy_dtype="bfloat16") + TrainingRequest(dataset_repo_id="x", policy_type="pi0_fast", policy_gradient_checkpointing=True) + + for kwargs in ( + {"policy_type": "smolvla", "policy_dtype": "bfloat16"}, + {"policy_type": "smolvla", "policy_gradient_checkpointing": True}, + {"policy_type": "pi0_fast", "policy_freeze_vision_encoder": True}, + {"policy_type": "pi0_fast", "policy_train_expert_only": True}, + {"policy_type": "act", "policy_dtype": "bfloat16"}, + ): + with pytest.raises(ValidationError, match="does not support"): + TrainingRequest(dataset_repo_id="x", **kwargs) From 3e1e47e2b99d65652af324bf09937754f435b4c4 Mon Sep 17 00:00:00 2001 From: links Date: Fri, 12 Jun 2026 16:44:13 +0800 Subject: [PATCH 3/7] chore: refresh generated artifacts after merge --- frontend/dist/assets/index-CKfgS6qV.css | 1 - .../{index-DIKndiT6.js => index-DD3QRr1z.js} | 509 +++++++++--------- frontend/dist/assets/index-Ds5-5MuP.css | 1 + frontend/dist/index.html | 4 +- uv.lock | 24 + 5 files changed, 284 insertions(+), 255 deletions(-) delete mode 100644 frontend/dist/assets/index-CKfgS6qV.css rename frontend/dist/assets/{index-DIKndiT6.js => index-DD3QRr1z.js} (50%) create mode 100644 frontend/dist/assets/index-Ds5-5MuP.css diff --git a/frontend/dist/assets/index-CKfgS6qV.css b/frontend/dist/assets/index-CKfgS6qV.css deleted file mode 100644 index 7ba9c4b..0000000 --- a/frontend/dist/assets/index-CKfgS6qV.css +++ /dev/null @@ -1 +0,0 @@ -*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--background: 0 0% 100%;--foreground: 222.2 84% 4.9%;--card: 0 0% 100%;--card-foreground: 222.2 84% 4.9%;--popover: 0 0% 100%;--popover-foreground: 222.2 84% 4.9%;--primary: 222.2 47.4% 11.2%;--primary-foreground: 210 40% 98%;--secondary: 210 40% 96.1%;--secondary-foreground: 222.2 47.4% 11.2%;--muted: 210 40% 96.1%;--muted-foreground: 215.4 16.3% 46.9%;--accent: 210 40% 96.1%;--accent-foreground: 222.2 47.4% 11.2%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 210 40% 98%;--border: 214.3 31.8% 91.4%;--input: 214.3 31.8% 91.4%;--ring: 222.2 84% 4.9%;--radius: .5rem;--sidebar-background: 0 0% 98%;--sidebar-foreground: 240 5.3% 26.1%;--sidebar-primary: 240 5.9% 10%;--sidebar-primary-foreground: 0 0% 98%;--sidebar-accent: 240 4.8% 95.9%;--sidebar-accent-foreground: 240 5.9% 10%;--sidebar-border: 220 13% 91%;--sidebar-ring: 217.2 91.2% 59.8%}.dark{--background: 222.2 84% 4.9%;--foreground: 210 40% 98%;--card: 222.2 84% 4.9%;--card-foreground: 210 40% 98%;--popover: 222.2 84% 4.9%;--popover-foreground: 210 40% 98%;--primary: 210 40% 98%;--primary-foreground: 222.2 47.4% 11.2%;--secondary: 217.2 32.6% 17.5%;--secondary-foreground: 210 40% 98%;--muted: 217.2 32.6% 17.5%;--muted-foreground: 215 20.2% 65.1%;--accent: 217.2 32.6% 17.5%;--accent-foreground: 210 40% 98%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 210 40% 98%;--border: 217.2 32.6% 17.5%;--input: 217.2 32.6% 17.5%;--ring: 212.7 26.8% 83.9%;--sidebar-background: 240 5.9% 10%;--sidebar-foreground: 240 4.8% 95.9%;--sidebar-primary: 224.3 76.3% 48%;--sidebar-primary-foreground: 0 0% 100%;--sidebar-accent: 240 3.7% 15.9%;--sidebar-accent-foreground: 240 4.8% 95.9%;--sidebar-border: 240 3.7% 15.9%;--sidebar-ring: 217.2 91.2% 59.8%}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground))}.container{width:100%;margin-right:auto;margin-left:auto;padding-right:2rem;padding-left:2rem}@media (min-width: 1400px){.container{max-width:1400px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{left:0;right:0}.bottom-0{bottom:0}.bottom-4{bottom:1rem}.left-2{left:.5rem}.left-2\.5{left:.625rem}.left-\[50\%\]{left:50%}.right-2{right:.5rem}.right-4{right:1rem}.top-0{top:0}.top-1\/2{top:50%}.top-2{top:.5rem}.top-4{top:1rem}.top-\[50\%\]{top:50%}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-50{z-index:50}.z-\[100\]{z-index:100}.z-\[9999\]{z-index:9999}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-6{margin-left:1.5rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.contents{display:contents}.hidden{display:none}.aspect-\[4\/3\]{aspect-ratio:4/3}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-16{height:4rem}.h-2{height:.5rem}.h-24{height:6rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-40{height:10rem}.h-48{height:12rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-64{height:16rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-96{height:24rem}.h-\[1px\]{height:1px}.h-\[95vh\]{height:95vh}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.max-h-96{max-height:24rem}.max-h-\[300px\]{max-height:300px}.max-h-\[440px\]{max-height:440px}.max-h-\[90vh\]{max-height:90vh}.max-h-screen{max-height:100vh}.min-h-10{min-height:2.5rem}.min-h-\[120px\]{min-height:120px}.min-h-\[50vh\]{min-height:50vh}.min-h-screen{min-height:100vh}.w-1{width:.25rem}.w-1\.5{width:.375rem}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-32{width:8rem}.w-4{width:1rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-56{width:14rem}.w-6{width:1.5rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-\[--radix-popover-trigger-width\]{width:var(--radix-popover-trigger-width)}.w-\[1px\]{width:1px}.w-\[320px\]{width:320px}.w-\[min\(560px\,calc\(100vw-2rem\)\)\]{width:min(560px,calc(100vw - 2rem))}.w-auto{width:auto}.w-full{width:100%}.w-px{width:1px}.min-w-0{min-width:0px}.min-w-\[110px\]{min-width:110px}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-4xl{max-width:56rem}.max-w-7xl{max-width:80rem}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-xl{max-width:36rem}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\[-50\%\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\[-50\%\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-px{gap:1px}.space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.75rem * var(--tw-space-x-reverse));margin-left:calc(.75rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.self-stretch{align-self:stretch}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.rounded-t-lg{border-top-left-radius:var(--radius);border-top-right-radius:var(--radius)}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-t{border-top-width:1px}.border-amber-400\/60{border-color:#fbbf2499}.border-amber-700{--tw-border-opacity: 1;border-color:rgb(180 83 9 / var(--tw-border-opacity, 1))}.border-amber-700\/60{border-color:#b4530999}.border-blue-500{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.border-blue-600{--tw-border-opacity: 1;border-color:rgb(37 99 235 / var(--tw-border-opacity, 1))}.border-destructive{border-color:hsl(var(--destructive))}.border-destructive\/50{border-color:hsl(var(--destructive) / .5)}.border-emerald-500\/50{border-color:#10b98180}.border-emerald-700{--tw-border-opacity: 1;border-color:rgb(4 120 87 / var(--tw-border-opacity, 1))}.border-gray-500{--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity, 1))}.border-gray-600{--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1))}.border-gray-700{--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))}.border-gray-800{--tw-border-opacity: 1;border-color:rgb(31 41 55 / var(--tw-border-opacity, 1))}.border-green-600{--tw-border-opacity: 1;border-color:rgb(22 163 74 / var(--tw-border-opacity, 1))}.border-green-700{--tw-border-opacity: 1;border-color:rgb(21 128 61 / var(--tw-border-opacity, 1))}.border-input{border-color:hsl(var(--input))}.border-primary{border-color:hsl(var(--primary))}.border-purple-700{--tw-border-opacity: 1;border-color:rgb(126 34 206 / var(--tw-border-opacity, 1))}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.border-red-500\/40{border-color:#ef444466}.border-red-700{--tw-border-opacity: 1;border-color:rgb(185 28 28 / var(--tw-border-opacity, 1))}.border-red-800{--tw-border-opacity: 1;border-color:rgb(153 27 27 / var(--tw-border-opacity, 1))}.border-slate-600{--tw-border-opacity: 1;border-color:rgb(71 85 105 / var(--tw-border-opacity, 1))}.border-slate-700{--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-yellow-700{--tw-border-opacity: 1;border-color:rgb(161 98 7 / var(--tw-border-opacity, 1))}.bg-accent{background-color:hsl(var(--accent))}.bg-amber-400{--tw-bg-opacity: 1;background-color:rgb(251 191 36 / var(--tw-bg-opacity, 1))}.bg-amber-500{--tw-bg-opacity: 1;background-color:rgb(245 158 11 / var(--tw-bg-opacity, 1))}.bg-amber-500\/15{background-color:#f59e0b26}.bg-amber-500\/40{background-color:#f59e0b66}.bg-amber-600{--tw-bg-opacity: 1;background-color:rgb(217 119 6 / var(--tw-bg-opacity, 1))}.bg-amber-900\/40{background-color:#78350f66}.bg-amber-950\/40{background-color:#451a0366}.bg-background{background-color:hsl(var(--background))}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-black\/30{background-color:#0000004d}.bg-black\/70{background-color:#000000b3}.bg-black\/80{background-color:#000c}.bg-black\/95{background-color:#000000f2}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-blue-500\/20{background-color:#3b82f633}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.bg-blue-900\/20{background-color:#1e3a8a33}.bg-border{background-color:hsl(var(--border))}.bg-card{background-color:hsl(var(--card))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-emerald-400{--tw-bg-opacity: 1;background-color:rgb(52 211 153 / var(--tw-bg-opacity, 1))}.bg-emerald-900\/40{background-color:#064e3b66}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-500{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity, 1))}.bg-gray-500\/15{background-color:#6b728026}.bg-gray-600{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.bg-gray-700{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.bg-gray-800\/50{background-color:#1f293780}.bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.bg-gray-900\/60{background-color:#11182799}.bg-gray-900\/80{background-color:#111827cc}.bg-gray-950{--tw-bg-opacity: 1;background-color:rgb(3 7 18 / var(--tw-bg-opacity, 1))}.bg-green-400{--tw-bg-opacity: 1;background-color:rgb(74 222 128 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-green-500\/15{background-color:#22c55e26}.bg-green-500\/20{background-color:#22c55e33}.bg-green-600{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity, 1))}.bg-green-900\/20{background-color:#14532d33}.bg-green-900\/50{background-color:#14532d80}.bg-green-900\/70{background-color:#14532db3}.bg-muted{background-color:hsl(var(--muted))}.bg-orange-500{--tw-bg-opacity: 1;background-color:rgb(249 115 22 / var(--tw-bg-opacity, 1))}.bg-orange-500\/15{background-color:#f9731626}.bg-orange-500\/20{background-color:#f9731633}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-primary\/10{background-color:hsl(var(--primary) / .1)}.bg-purple-500{--tw-bg-opacity: 1;background-color:rgb(168 85 247 / var(--tw-bg-opacity, 1))}.bg-purple-900\/50{background-color:#581c8780}.bg-red-400{--tw-bg-opacity: 1;background-color:rgb(248 113 113 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-500\/15{background-color:#ef444426}.bg-red-500\/30{background-color:#ef44444d}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-red-900\/20{background-color:#7f1d1d33}.bg-red-900\/40{background-color:#7f1d1d66}.bg-red-900\/50{background-color:#7f1d1d80}.bg-red-900\/70{background-color:#7f1d1db3}.bg-secondary{background-color:hsl(var(--secondary))}.bg-slate-500{--tw-bg-opacity: 1;background-color:rgb(100 116 139 / var(--tw-bg-opacity, 1))}.bg-slate-600{--tw-bg-opacity: 1;background-color:rgb(71 85 105 / var(--tw-bg-opacity, 1))}.bg-slate-700{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity, 1))}.bg-slate-800{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1))}.bg-slate-800\/40{background-color:#1e293b66}.bg-slate-800\/50{background-color:#1e293b80}.bg-slate-800\/60{background-color:#1e293b99}.bg-slate-900{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.bg-slate-900\/50{background-color:#0f172a80}.bg-transparent{background-color:transparent}.bg-yellow-400{--tw-bg-opacity: 1;background-color:rgb(250 204 21 / var(--tw-bg-opacity, 1))}.bg-yellow-500{--tw-bg-opacity: 1;background-color:rgb(234 179 8 / var(--tw-bg-opacity, 1))}.bg-yellow-900\/50{background-color:#713f1280}.bg-zinc-900{--tw-bg-opacity: 1;background-color:rgb(24 24 27 / var(--tw-bg-opacity, 1))}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-blue-500{--tw-gradient-from: #3b82f6 var(--tw-gradient-from-position);--tw-gradient-to: rgb(59 130 246 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-gray-900{--tw-gradient-from: #111827 var(--tw-gradient-from-position);--tw-gradient-to: rgb(17 24 39 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-gray-800{--tw-gradient-to: #1f2937 var(--tw-gradient-to-position)}.to-sky-400{--tw-gradient-to: #38bdf8 var(--tw-gradient-to-position)}.fill-current{fill:currentColor}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-10{padding-left:2.5rem;padding-right:2.5rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-24{padding-top:6rem;padding-bottom:6rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-16{padding-bottom:4rem}.pb-2{padding-bottom:.5rem}.pl-1{padding-left:.25rem}.pl-2{padding-left:.5rem}.pl-8{padding-left:2rem}.pr-1{padding-right:.25rem}.pr-12{padding-right:3rem}.pr-2{padding-right:.5rem}.pr-8{padding-right:2rem}.pt-0{padding-top:0}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.pt-6{padding-top:1.5rem}.text-left{text-align:left}.text-center{text-align:center}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-5xl{font-size:3rem;line-height:1}.text-7xl{font-size:4.5rem;line-height:1}.text-\[10px\]{font-size:10px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-amber-100{--tw-text-opacity: 1;color:rgb(254 243 199 / var(--tw-text-opacity, 1))}.text-amber-200{--tw-text-opacity: 1;color:rgb(253 230 138 / var(--tw-text-opacity, 1))}.text-amber-200\/80{color:#fde68acc}.text-amber-300{--tw-text-opacity: 1;color:rgb(252 211 77 / var(--tw-text-opacity, 1))}.text-amber-400{--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.text-amber-400\/80{color:#fbbf24cc}.text-blue-400{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-card-foreground{color:hsl(var(--card-foreground))}.text-current{color:currentColor}.text-destructive{color:hsl(var(--destructive))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-emerald-200{--tw-text-opacity: 1;color:rgb(167 243 208 / var(--tw-text-opacity, 1))}.text-emerald-300{--tw-text-opacity: 1;color:rgb(110 231 183 / var(--tw-text-opacity, 1))}.text-foreground{color:hsl(var(--foreground))}.text-foreground\/50{color:hsl(var(--foreground) / .5)}.text-gray-200{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-green-200{--tw-text-opacity: 1;color:rgb(187 247 208 / var(--tw-text-opacity, 1))}.text-green-300{--tw-text-opacity: 1;color:rgb(134 239 172 / var(--tw-text-opacity, 1))}.text-green-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-orange-300{--tw-text-opacity: 1;color:rgb(253 186 116 / var(--tw-text-opacity, 1))}.text-orange-400{--tw-text-opacity: 1;color:rgb(251 146 60 / var(--tw-text-opacity, 1))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-purple-200{--tw-text-opacity: 1;color:rgb(233 213 255 / var(--tw-text-opacity, 1))}.text-purple-300{--tw-text-opacity: 1;color:rgb(216 180 254 / var(--tw-text-opacity, 1))}.text-purple-400{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.text-red-100{--tw-text-opacity: 1;color:rgb(254 226 226 / var(--tw-text-opacity, 1))}.text-red-200{--tw-text-opacity: 1;color:rgb(254 202 202 / var(--tw-text-opacity, 1))}.text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-sky-300{--tw-text-opacity: 1;color:rgb(125 211 252 / var(--tw-text-opacity, 1))}.text-sky-400{--tw-text-opacity: 1;color:rgb(56 189 248 / var(--tw-text-opacity, 1))}.text-slate-100{--tw-text-opacity: 1;color:rgb(241 245 249 / var(--tw-text-opacity, 1))}.text-slate-200{--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.text-slate-300{--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-teal-400{--tw-text-opacity: 1;color:rgb(45 212 191 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-white\/70{color:#ffffffb3}.text-yellow-200{--tw-text-opacity: 1;color:rgb(254 240 138 / var(--tw-text-opacity, 1))}.text-yellow-300{--tw-text-opacity: 1;color:rgb(253 224 71 / var(--tw-text-opacity, 1))}.text-zinc-500{--tw-text-opacity: 1;color:rgb(113 113 122 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.placeholder-gray-400::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}.placeholder-gray-400::placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-45{opacity:.45}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-90{opacity:.9}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-red-500\/30{--tw-shadow-color: rgb(239 68 68 / .3);--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.drop-shadow{--tw-drop-shadow: drop-shadow(0 1px 2px rgb(0 0 0 / .1)) drop-shadow(0 1px 1px rgb(0 0 0 / .06));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur{--tw-backdrop-blur: blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[width\]{transition-property:width;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-100{transition-duration:.1s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.duration-75{transition-duration:75ms}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in-0{--tw-enter-opacity: 0}.zoom-in-95{--tw-enter-scale: .95}.duration-100{animation-duration:.1s}.duration-200{animation-duration:.2s}.duration-300{animation-duration:.3s}.duration-500{animation-duration:.5s}.duration-75{animation-duration:75ms}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.running{animation-play-state:running}.\!paused{animation-play-state:paused!important}.paused{animation-play-state:paused}.\[appearance\:textfield\]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.file\:text-foreground::file-selector-button{color:hsl(var(--foreground))}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-slate-500::-moz-placeholder{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.placeholder\:text-slate-500::placeholder{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.hover\:border-blue-500:hover{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.hover\:border-gray-200:hover{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.hover\:border-gray-600:hover{--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1))}.hover\:border-red-400:hover{--tw-border-opacity: 1;border-color:rgb(248 113 113 / var(--tw-border-opacity, 1))}.hover\:border-slate-500:hover{--tw-border-opacity: 1;border-color:rgb(100 116 139 / var(--tw-border-opacity, 1))}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-amber-500\/20:hover{background-color:#f59e0b33}.hover\:bg-amber-700:hover{--tw-bg-opacity: 1;background-color:rgb(180 83 9 / var(--tw-bg-opacity, 1))}.hover\:bg-amber-900\/40:hover{background-color:#78350f66}.hover\:bg-blue-600:hover{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.hover\:bg-blue-700:hover{--tw-bg-opacity: 1;background-color:rgb(29 78 216 / var(--tw-bg-opacity, 1))}.hover\:bg-destructive\/80:hover{background-color:hsl(var(--destructive) / .8)}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-gray-500:hover{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-600:hover{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-700:hover{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-800:hover{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.hover\:bg-green-600:hover{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity, 1))}.hover\:bg-green-700:hover{--tw-bg-opacity: 1;background-color:rgb(21 128 61 / var(--tw-bg-opacity, 1))}.hover\:bg-orange-600:hover{--tw-bg-opacity: 1;background-color:rgb(234 88 12 / var(--tw-bg-opacity, 1))}.hover\:bg-primary\/80:hover{background-color:hsl(var(--primary) / .8)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-purple-600:hover{--tw-bg-opacity: 1;background-color:rgb(147 51 234 / var(--tw-bg-opacity, 1))}.hover\:bg-red-500\/10:hover{background-color:#ef44441a}.hover\:bg-red-500\/30:hover{background-color:#ef44444d}.hover\:bg-red-600:hover{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.hover\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity, 1))}.hover\:bg-red-900\/20:hover{background-color:#7f1d1d33}.hover\:bg-secondary:hover{background-color:hsl(var(--secondary))}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:bg-slate-600:hover{--tw-bg-opacity: 1;background-color:rgb(71 85 105 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-700:hover{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-700\/70:hover{background-color:#334155b3}.hover\:bg-slate-700\/80:hover{background-color:#334155cc}.hover\:bg-slate-800:hover{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-900:hover{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.hover\:bg-transparent:hover{background-color:transparent}.hover\:bg-yellow-600:hover{--tw-bg-opacity: 1;background-color:rgb(202 138 4 / var(--tw-bg-opacity, 1))}.hover\:bg-zinc-800:hover{--tw-bg-opacity: 1;background-color:rgb(39 39 42 / var(--tw-bg-opacity, 1))}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-amber-200:hover{--tw-text-opacity: 1;color:rgb(253 230 138 / var(--tw-text-opacity, 1))}.hover\:text-amber-50:hover{--tw-text-opacity: 1;color:rgb(255 251 235 / var(--tw-text-opacity, 1))}.hover\:text-blue-300:hover{--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.hover\:text-blue-400:hover{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.hover\:text-blue-700:hover{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.hover\:text-emerald-200:hover{--tw-text-opacity: 1;color:rgb(167 243 208 / var(--tw-text-opacity, 1))}.hover\:text-foreground:hover{color:hsl(var(--foreground))}.hover\:text-gray-200:hover{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.hover\:text-red-300:hover{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.hover\:text-yellow-200:hover{--tw-text-opacity: 1;color:rgb(254 240 138 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-lg:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-red-500\/40:hover{--tw-shadow-color: rgb(239 68 68 / .4);--tw-shadow: var(--tw-shadow-colored)}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:bg-gray-800:focus{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.focus\:bg-slate-700\/80:focus{background-color:#334155cc}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:text-red-300:focus{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.focus\:text-white:focus{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.focus\:opacity-100:focus{opacity:1}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--background))}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:text-gray-500:disabled{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.disabled\:hover\:bg-transparent:hover:disabled{background-color:transparent}.group:hover .group-hover\:text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.group:hover .group-hover\:opacity-100{opacity:1}.group.destructive .group-\[\.destructive\]\:border-muted\/40{border-color:hsl(var(--muted) / .4)}.group.toaster .group-\[\.toaster\]\:border-border{border-color:hsl(var(--border))}.group.toast .group-\[\.toast\]\:bg-muted{background-color:hsl(var(--muted))}.group.toast .group-\[\.toast\]\:bg-primary{background-color:hsl(var(--primary))}.group.toaster .group-\[\.toaster\]\:bg-background{background-color:hsl(var(--background))}.group.destructive .group-\[\.destructive\]\:text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.group.toast .group-\[\.toast\]\:text-muted-foreground{color:hsl(var(--muted-foreground))}.group.toast .group-\[\.toast\]\:text-primary-foreground{color:hsl(var(--primary-foreground))}.group.toaster .group-\[\.toaster\]\:text-foreground{color:hsl(var(--foreground))}.group.toaster .group-\[\.toaster\]\:shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.group.destructive .group-\[\.destructive\]\:hover\:border-destructive\/30:hover{border-color:hsl(var(--destructive) / .3)}.group.destructive .group-\[\.destructive\]\:hover\:bg-destructive:hover{background-color:hsl(var(--destructive))}.group.destructive .group-\[\.destructive\]\:hover\:text-destructive-foreground:hover{color:hsl(var(--destructive-foreground))}.group.destructive .group-\[\.destructive\]\:hover\:text-red-50:hover{--tw-text-opacity: 1;color:rgb(254 242 242 / var(--tw-text-opacity, 1))}.group.destructive .group-\[\.destructive\]\:focus\:ring-destructive:focus{--tw-ring-color: hsl(var(--destructive))}.group.destructive .group-\[\.destructive\]\:focus\:ring-red-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(248 113 113 / var(--tw-ring-opacity, 1))}.group.destructive .group-\[\.destructive\]\:focus\:ring-offset-red-600:focus{--tw-ring-offset-color: #dc2626}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.aria-selected\:bg-gray-700[aria-selected=true]{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.data-\[disabled\=true\]\:pointer-events-none[data-disabled=true],.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=checked\]\:translate-x-5[data-state=checked]{--tw-translate-x: 1.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked],.data-\[swipe\=cancel\]\:translate-x-0[data-swipe=cancel]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=end\]\:translate-x-\[var\(--radix-toast-swipe-end-x\)\][data-swipe=end]{--tw-translate-x: var(--radix-toast-swipe-end-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=move\]\:translate-x-\[var\(--radix-toast-swipe-move-x\)\][data-swipe=move]{--tw-translate-x: var(--radix-toast-swipe-move-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=checked\]\:border-red-500[data-state=checked]{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.data-\[selected\=\'true\'\]\:bg-accent[data-selected=true]{background-color:hsl(var(--accent))}.data-\[state\=checked\]\:bg-green-500[data-state=checked]{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:hsl(var(--primary))}.data-\[state\=checked\]\:bg-red-500[data-state=checked]{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\[state\=unchecked\]\:bg-input[data-state=unchecked]{background-color:hsl(var(--input))}.data-\[selected\=true\]\:text-accent-foreground[data-selected=true]{color:hsl(var(--accent-foreground))}.data-\[state\=checked\]\:text-primary-foreground[data-state=checked]{color:hsl(var(--primary-foreground))}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\[disabled\=true\]\:opacity-50[data-disabled=true],.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[swipe\=move\]\:transition-none[data-swipe=move]{transition-property:none}.data-\[state\=open\]\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\[state\=closed\]\:animate-out[data-state=closed],.data-\[swipe\=end\]\:animate-out[data-swipe=end]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\[state\=closed\]\:fade-out-80[data-state=closed]{--tw-exit-opacity: .8}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}.data-\[state\=closed\]\:slide-out-to-left-1\/2[data-state=closed]{--tw-exit-translate-x: -50%}.data-\[state\=closed\]\:slide-out-to-right-full[data-state=closed]{--tw-exit-translate-x: 100%}.data-\[state\=closed\]\:slide-out-to-top-\[48\%\][data-state=closed]{--tw-exit-translate-y: -48%}.data-\[state\=open\]\:slide-in-from-left-1\/2[data-state=open]{--tw-enter-translate-x: -50%}.data-\[state\=open\]\:slide-in-from-top-\[48\%\][data-state=open]{--tw-enter-translate-y: -48%}.data-\[state\=open\]\:slide-in-from-top-full[data-state=open]{--tw-enter-translate-y: -100%}.group[data-state=open] .group-data-\[state\=open\]\:rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-state=open] .group-data-\[state\=open\]\:rotate-90{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@supports ((-webkit-backdrop-filter: var(--tw)) or (backdrop-filter: var(--tw))){.supports-\[backdrop-filter\]\:bg-black\/70{background-color:#000000b3}}.dark\:border-destructive:is(.dark *){border-color:hsl(var(--destructive))}@media (min-width: 640px){.sm\:bottom-0{bottom:0}.sm\:right-0{right:0}.sm\:top-auto{top:auto}.sm\:mt-0{margin-top:0}.sm\:w-60{width:15rem}.sm\:w-auto{width:auto}.sm\:max-w-\[500px\]{max-width:500px}.sm\:max-w-\[600px\]{max-width:600px}.sm\:max-w-xl{max-width:36rem}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:flex-col{flex-direction:column}.sm\:justify-end{justify-content:flex-end}.sm\:gap-4{gap:1rem}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:self-auto{align-self:auto}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:p-4{padding:1rem}.sm\:p-6{padding:1.5rem}.sm\:text-left{text-align:left}.sm\:text-center{text-align:center}.sm\:text-base{font-size:1rem;line-height:1.5rem}.sm\:text-sm{font-size:.875rem;line-height:1.25rem}.data-\[state\=open\]\:sm\:slide-in-from-bottom-full[data-state=open]{--tw-enter-translate-y: 100%}}@media (min-width: 768px){.md\:max-w-\[420px\]{max-width:420px}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:text-sm{font-size:.875rem;line-height:1.25rem}}@media (min-width: 1024px){.lg\:min-h-0{min-height:0px}.lg\:w-1\/2{width:50%}.lg\:w-full{width:100%}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-\[1\.2fr_2fr\]{grid-template-columns:1.2fr 2fr}.lg\:flex-row{flex-direction:row}.lg\:space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.lg\:space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.lg\:p-8{padding:2rem}}.\[\&\:\:-webkit-inner-spin-button\]\:m-0::-webkit-inner-spin-button{margin:0}.\[\&\:\:-webkit-inner-spin-button\]\:appearance-none::-webkit-inner-spin-button{-webkit-appearance:none;-moz-appearance:none;appearance:none}.\[\&\:\:-webkit-outer-spin-button\]\:m-0::-webkit-outer-spin-button{margin:0}.\[\&\:\:-webkit-outer-spin-button\]\:appearance-none::-webkit-outer-spin-button{-webkit-appearance:none;-moz-appearance:none;appearance:none}.\[\&\>span\]\:line-clamp-1>span{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\[\&\>svg\+div\]\:translate-y-\[-3px\]>svg+div{--tw-translate-y: -3px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\>svg\]\:absolute>svg{position:absolute}.\[\&\>svg\]\:left-4>svg{left:1rem}.\[\&\>svg\]\:top-4>svg{top:1rem}.\[\&\>svg\]\:text-destructive>svg{color:hsl(var(--destructive))}.\[\&\>svg\]\:text-foreground>svg{color:hsl(var(--foreground))}.\[\&\>svg\~\*\]\:pl-7>svg~*{padding-left:1.75rem}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-top:.375rem;padding-bottom:.375rem}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:.75rem;line-height:1rem}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{font-weight:500}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:hsl(var(--muted-foreground))}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:1.25rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:1.25rem}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:3rem}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-top:.75rem;padding-bottom:.75rem}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:1.25rem}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:1.25rem}.\[\&_p\]\:leading-relaxed p{line-height:1.625}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:size-4 svg{width:1rem;height:1rem}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0} diff --git a/frontend/dist/assets/index-DIKndiT6.js b/frontend/dist/assets/index-DD3QRr1z.js similarity index 50% rename from frontend/dist/assets/index-DIKndiT6.js rename to frontend/dist/assets/index-DD3QRr1z.js index dc6862c..66b0db0 100644 --- a/frontend/dist/assets/index-DIKndiT6.js +++ b/frontend/dist/assets/index-DD3QRr1z.js @@ -1,4 +1,4 @@ -var vG=Object.defineProperty;var EP=t=>{throw TypeError(t)};var yG=(t,e,n)=>e in t?vG(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Jb=(t,e,n)=>yG(t,typeof e!="symbol"?e+"":e,n),Zb=(t,e,n)=>e.has(t)||EP("Cannot "+n);var xe=(t,e,n)=>(Zb(t,e,"read from private field"),n?n.call(t):e.get(t)),Xt=(t,e,n)=>e.has(t)?EP("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Ct=(t,e,n,r)=>(Zb(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Sr=(t,e,n)=>(Zb(t,e,"access private method"),n);var Zm=(t,e,n,r)=>({set _(i){Ct(t,e,i,n)},get _(){return xe(t,e,r)}});function xG(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 o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var Qm=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function dn(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Pk={exports:{}},k0={},Rk={exports:{}},kt={};/** +var xG=Object.defineProperty;var TP=t=>{throw TypeError(t)};var bG=(t,e,n)=>e in t?xG(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Jb=(t,e,n)=>bG(t,typeof e!="symbol"?e+"":e,n),Zb=(t,e,n)=>e.has(t)||TP("Cannot "+n);var xe=(t,e,n)=>(Zb(t,e,"read from private field"),n?n.call(t):e.get(t)),Xt=(t,e,n)=>e.has(t)?TP("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Ct=(t,e,n,r)=>(Zb(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Er=(t,e,n)=>(Zb(t,e,"access private method"),n);var Zm=(t,e,n,r)=>({set _(i){Ct(t,e,i,n)},get _(){return xe(t,e,r)}});function _G(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 o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var Qm=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function dn(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Nk={exports:{}},k0={},Ok={exports:{}},kt={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ var vG=Object.defineProperty;var EP=t=>{throw TypeError(t)};var yG=(t,e,n)=>e in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var ym=Symbol.for("react.element"),bG=Symbol.for("react.portal"),_G=Symbol.for("react.fragment"),wG=Symbol.for("react.strict_mode"),SG=Symbol.for("react.profiler"),EG=Symbol.for("react.provider"),TG=Symbol.for("react.context"),MG=Symbol.for("react.forward_ref"),AG=Symbol.for("react.suspense"),CG=Symbol.for("react.memo"),PG=Symbol.for("react.lazy"),TP=Symbol.iterator;function RG(t){return t===null||typeof t!="object"?null:(t=TP&&t[TP]||t["@@iterator"],typeof t=="function"?t:null)}var Nk={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Ok=Object.assign,Ik={};function hf(t,e,n){this.props=t,this.context=e,this.refs=Ik,this.updater=n||Nk}hf.prototype.isReactComponent={};hf.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};hf.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function Dk(){}Dk.prototype=hf.prototype;function QT(t,e,n){this.props=t,this.context=e,this.refs=Ik,this.updater=n||Nk}var eM=QT.prototype=new Dk;eM.constructor=QT;Ok(eM,hf.prototype);eM.isPureReactComponent=!0;var MP=Array.isArray,Lk=Object.prototype.hasOwnProperty,tM={current:null},kk={key:!0,ref:!0,__self:!0,__source:!0};function jk(t,e,n){var r,i={},o=null,a=null;if(e!=null)for(r in e.ref!==void 0&&(a=e.ref),e.key!==void 0&&(o=""+e.key),e)Lk.call(e,r)&&!kk.hasOwnProperty(r)&&(i[r]=e[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1{throw TypeError(t)};var yG=(t,e,n)=>e in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var LG=_,kG=Symbol.for("react.element"),jG=Symbol.for("react.fragment"),UG=Object.prototype.hasOwnProperty,FG=LG.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,BG={key:!0,ref:!0,__self:!0,__source:!0};function Fk(t,e,n){var r,i={},o=null,a=null;n!==void 0&&(o=""+n),e.key!==void 0&&(o=""+e.key),e.ref!==void 0&&(a=e.ref);for(r in e)UG.call(e,r)&&!BG.hasOwnProperty(r)&&(i[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)i[r]===void 0&&(i[r]=e[r]);return{$$typeof:kG,type:t,key:o,ref:a,props:i,_owner:FG.current}}k0.Fragment=jG;k0.jsx=Fk;k0.jsxs=Fk;Pk.exports=k0;var h=Pk.exports,Bk={exports:{}},Li={},$k={exports:{}},zk={};/** + */var jG=_,UG=Symbol.for("react.element"),FG=Symbol.for("react.fragment"),BG=Object.prototype.hasOwnProperty,$G=jG.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,zG={key:!0,ref:!0,__self:!0,__source:!0};function $k(t,e,n){var r,i={},o=null,a=null;n!==void 0&&(o=""+n),e.key!==void 0&&(o=""+e.key),e.ref!==void 0&&(a=e.ref);for(r in e)BG.call(e,r)&&!zG.hasOwnProperty(r)&&(i[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)i[r]===void 0&&(i[r]=e[r]);return{$$typeof:UG,type:t,key:o,ref:a,props:i,_owner:$G.current}}k0.Fragment=FG;k0.jsx=$k;k0.jsxs=$k;Nk.exports=k0;var h=Nk.exports,zk={exports:{}},Li={},Hk={exports:{}},Vk={};/** * @license React * scheduler.production.min.js * @@ -22,7 +22,7 @@ var vG=Object.defineProperty;var EP=t=>{throw TypeError(t)};var yG=(t,e,n)=>e in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(t){function e(L,j){var X=L.length;L.push(j);e:for(;0>>1,F=L[K];if(0>>1;Ki(ee,X))tei(Q,ee)?(L[K]=Q,L[te]=X,K=te):(L[K]=ee,L[q]=X,K=q);else if(tei(Q,X))L[K]=Q,L[te]=X,K=te;else break e}}return j}function i(L,j){var X=L.sortIndex-j.sortIndex;return X!==0?X:L.id-j.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var a=Date,s=a.now();t.unstable_now=function(){return a.now()-s}}var l=[],c=[],u=1,d=null,f=3,p=!1,y=!1,v=!1,g=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(L){for(var j=n(c);j!==null;){if(j.callback===null)r(c);else if(j.startTime<=L)r(c),j.sortIndex=j.expirationTime,e(l,j);else break;j=n(c)}}function S(L){if(v=!1,b(L),!y)if(n(l)!==null)y=!0,O(w);else{var j=n(c);j!==null&&W(S,j.startTime-L)}}function w(L,j){y=!1,v&&(v=!1,m(A),A=-1),p=!0;var X=f;try{for(b(j),d=n(l);d!==null&&(!(d.expirationTime>j)||L&&!P());){var K=d.callback;if(typeof K=="function"){d.callback=null,f=d.priorityLevel;var F=K(d.expirationTime<=j);j=t.unstable_now(),typeof F=="function"?d.callback=F:d===n(l)&&r(l),b(j)}else r(l);d=n(l)}if(d!==null)var Y=!0;else{var q=n(c);q!==null&&W(S,q.startTime-j),Y=!1}return Y}finally{d=null,f=X,p=!1}}var E=!1,T=null,A=-1,M=5,C=-1;function P(){return!(t.unstable_now()-CL||125K?(L.sortIndex=X,e(c,L),n(l)===null&&L===n(c)&&(v?(m(A),A=-1):v=!0,W(S,X-K))):(L.sortIndex=F,e(l,L),y||p||(y=!0,O(w))),L},t.unstable_shouldYield=P,t.unstable_wrapCallback=function(L){var j=f;return function(){var X=f;f=j;try{return L.apply(this,arguments)}finally{f=X}}}})(zk);$k.exports=zk;var $G=$k.exports;/** + */(function(t){function e(L,j){var K=L.length;L.push(j);e:for(;0>>1,H=L[te];if(0>>1;tei(Y,K))eei(J,Y)?(L[te]=J,L[ee]=K,te=ee):(L[te]=Y,L[$]=K,te=$);else if(eei(J,K))L[te]=J,L[ee]=K,te=ee;else break e}}return j}function i(L,j){var K=L.sortIndex-j.sortIndex;return K!==0?K:L.id-j.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var a=Date,s=a.now();t.unstable_now=function(){return a.now()-s}}var l=[],c=[],u=1,d=null,f=3,p=!1,y=!1,v=!1,g=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(L){for(var j=n(c);j!==null;){if(j.callback===null)r(c);else if(j.startTime<=L)r(c),j.sortIndex=j.expirationTime,e(l,j);else break;j=n(c)}}function S(L){if(v=!1,b(L),!y)if(n(l)!==null)y=!0,O(w);else{var j=n(c);j!==null&&X(S,j.startTime-L)}}function w(L,j){y=!1,v&&(v=!1,m(A),A=-1),p=!0;var K=f;try{for(b(j),d=n(l);d!==null&&(!(d.expirationTime>j)||L&&!P());){var te=d.callback;if(typeof te=="function"){d.callback=null,f=d.priorityLevel;var H=te(d.expirationTime<=j);j=t.unstable_now(),typeof H=="function"?d.callback=H:d===n(l)&&r(l),b(j)}else r(l);d=n(l)}if(d!==null)var q=!0;else{var $=n(c);$!==null&&X(S,$.startTime-j),q=!1}return q}finally{d=null,f=K,p=!1}}var E=!1,T=null,A=-1,M=5,C=-1;function P(){return!(t.unstable_now()-CL||125te?(L.sortIndex=K,e(c,L),n(l)===null&&L===n(c)&&(v?(m(A),A=-1):v=!0,X(S,K-te))):(L.sortIndex=H,e(l,L),y||p||(y=!0,O(w))),L},t.unstable_shouldYield=P,t.unstable_wrapCallback=function(L){var j=f;return function(){var K=f;f=j;try{return L.apply(this,arguments)}finally{f=K}}}})(Vk);Hk.exports=Vk;var HG=Hk.exports;/** * @license React * react-dom.production.min.js * @@ -30,14 +30,14 @@ var vG=Object.defineProperty;var EP=t=>{throw TypeError(t)};var yG=(t,e,n)=>e in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var zG=_,Oi=$G;function Ce(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),dS=Object.prototype.hasOwnProperty,HG=/^[: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]*$/,CP={},PP={};function VG(t){return dS.call(PP,t)?!0:dS.call(CP,t)?!1:HG.test(t)?PP[t]=!0:(CP[t]=!0,!1)}function GG(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function WG(t,e,n,r){if(e===null||typeof e>"u"||GG(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Jr(t,e,n,r,i,o,a){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=o,this.removeEmptyString=a}var xr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){xr[t]=new Jr(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];xr[e]=new Jr(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){xr[t]=new Jr(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){xr[t]=new Jr(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){xr[t]=new Jr(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){xr[t]=new Jr(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){xr[t]=new Jr(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){xr[t]=new Jr(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){xr[t]=new Jr(t,5,!1,t.toLowerCase(),null,!1,!1)});var iM=/[\-:]([a-z])/g;function oM(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(iM,oM);xr[e]=new Jr(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(iM,oM);xr[e]=new Jr(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(iM,oM);xr[e]=new Jr(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){xr[t]=new Jr(t,1,!1,t.toLowerCase(),null,!1,!1)});xr.xlinkHref=new Jr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){xr[t]=new Jr(t,1,!1,t.toLowerCase(),null,!0,!0)});function aM(t,e,n,r){var i=xr.hasOwnProperty(e)?xr[e]:null;(i!==null?i.type!==0:r||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),dS=Object.prototype.hasOwnProperty,GG=/^[: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]*$/,PP={},RP={};function WG(t){return dS.call(RP,t)?!0:dS.call(PP,t)?!1:GG.test(t)?RP[t]=!0:(PP[t]=!0,!1)}function XG(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function qG(t,e,n,r){if(e===null||typeof e>"u"||XG(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Jr(t,e,n,r,i,o,a){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=o,this.removeEmptyString=a}var xr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){xr[t]=new Jr(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];xr[e]=new Jr(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){xr[t]=new Jr(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){xr[t]=new Jr(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){xr[t]=new Jr(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){xr[t]=new Jr(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){xr[t]=new Jr(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){xr[t]=new Jr(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){xr[t]=new Jr(t,5,!1,t.toLowerCase(),null,!1,!1)});var iM=/[\-:]([a-z])/g;function oM(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(iM,oM);xr[e]=new Jr(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(iM,oM);xr[e]=new Jr(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(iM,oM);xr[e]=new Jr(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){xr[t]=new Jr(t,1,!1,t.toLowerCase(),null,!1,!1)});xr.xlinkHref=new Jr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){xr[t]=new Jr(t,1,!1,t.toLowerCase(),null,!0,!0)});function aM(t,e,n,r){var i=xr.hasOwnProperty(e)?xr[e]:null;(i!==null?i.type!==0:r||!(2s||i[a]!==o[s]){var l=` -`+i[a].replace(" at new "," at ");return t.displayName&&l.includes("")&&(l=l.replace("",t.displayName)),l}while(1<=a&&0<=s);break}}}finally{t_=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?wh(t):""}function XG(t){switch(t.tag){case 5:return wh(t.type);case 16:return wh("Lazy");case 13:return wh("Suspense");case 19:return wh("SuspenseList");case 0:case 2:case 15:return t=n_(t.type,!1),t;case 11:return t=n_(t.type.render,!1),t;case 1:return t=n_(t.type,!0),t;default:return""}}function mS(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Ru:return"Fragment";case Pu:return"Portal";case fS:return"Profiler";case sM:return"StrictMode";case hS:return"Suspense";case pS:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case Gk:return(t.displayName||"Context")+".Consumer";case Vk:return(t._context.displayName||"Context")+".Provider";case lM:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case cM:return e=t.displayName||null,e!==null?e:mS(t.type)||"Memo";case Ps:e=t._payload,t=t._init;try{return mS(t(e))}catch{}}return null}function qG(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return mS(e);case 8:return e===sM?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function ol(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Xk(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function KG(t){var e=Xk(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,o.call(this,a)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function ng(t){t._valueTracker||(t._valueTracker=KG(t))}function qk(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=Xk(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function Kv(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function gS(t,e){var n=e.checked;return Rn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function NP(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=ol(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function Kk(t,e){e=e.checked,e!=null&&aM(t,"checked",e,!1)}function vS(t,e){Kk(t,e);var n=ol(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?yS(t,e.type,n):e.hasOwnProperty("defaultValue")&&yS(t,e.type,ol(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function OP(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function yS(t,e,n){(e!=="number"||Kv(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var Sh=Array.isArray;function Ku(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=rg.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function ep(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var Lh={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},YG=["Webkit","ms","Moz","O"];Object.keys(Lh).forEach(function(t){YG.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Lh[e]=Lh[t]})});function Qk(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||Lh.hasOwnProperty(t)&&Lh[t]?(""+e).trim():e+"px"}function ej(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Qk(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var JG=Rn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function _S(t,e){if(e){if(JG[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Ce(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Ce(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Ce(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Ce(62))}}function wS(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var SS=null;function uM(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var ES=null,Yu=null,Ju=null;function LP(t){if(t=_m(t)){if(typeof ES!="function")throw Error(Ce(280));var e=t.stateNode;e&&(e=$0(e),ES(t.stateNode,t.type,e))}}function tj(t){Yu?Ju?Ju.push(t):Ju=[t]:Yu=t}function nj(){if(Yu){var t=Yu,e=Ju;if(Ju=Yu=null,LP(t),e)for(t=0;t>>=0,t===0?32:31-(l8(t)/c8|0)|0}var ig=64,og=4194304;function Eh(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Qv(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,o=t.pingedLanes,a=n&268435455;if(a!==0){var s=a&~i;s!==0?r=Eh(s):(o&=a,o!==0&&(r=Eh(o)))}else a=n&~i,a!==0?r=Eh(a):o!==0&&(r=Eh(o));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,o=e&-e,i>=o||i===16&&(o&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0n;n++)e.push(t);return e}function xm(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Lo(e),t[e]=n}function h8(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0=jh),VP=" ",GP=!1;function wj(t,e){switch(t){case"keyup":return $8.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Sj(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Nu=!1;function H8(t,e){switch(t){case"compositionend":return Sj(e);case"keypress":return e.which!==32?null:(GP=!0,VP);case"textInput":return t=e.data,t===VP&&GP?null:t;default:return null}}function V8(t,e){if(Nu)return t==="compositionend"||!yM&&wj(t,e)?(t=bj(),Tv=mM=Bs=null,Nu=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=KP(n)}}function Aj(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Aj(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Cj(){for(var t=window,e=Kv();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Kv(t.document)}return e}function xM(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function Q8(t){var e=Cj(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&Aj(n.ownerDocument.documentElement,n)){if(r!==null&&xM(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!t.extend&&o>r&&(i=r,r=o,o=i),i=YP(n,o);var a=YP(n,r);i&&a&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==a.node||t.focusOffset!==a.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),o>r?(t.addRange(e),t.extend(a.node,a.offset)):(e.setEnd(a.node,a.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Ou=null,RS=null,Fh=null,NS=!1;function JP(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;NS||Ou==null||Ou!==Kv(r)||(r=Ou,"selectionStart"in r&&xM(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Fh&&ap(Fh,r)||(Fh=r,r=ny(RS,"onSelect"),0Lu||(t.current=jS[Lu],jS[Lu]=null,Lu--)}function gn(t,e){Lu++,jS[Lu]=t.current,t.current=e}var al={},Ir=gl(al),si=gl(!1),bc=al;function Md(t,e){var n=t.type.contextTypes;if(!n)return al;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=e[o];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function li(t){return t=t.childContextTypes,t!=null}function iy(){wn(si),wn(Ir)}function iR(t,e,n){if(Ir.current!==al)throw Error(Ce(168));gn(Ir,e),gn(si,n)}function jj(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(Ce(108,qG(t)||"Unknown",i));return Rn({},n,r)}function oy(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||al,bc=Ir.current,gn(Ir,t),gn(si,si.current),!0}function oR(t,e,n){var r=t.stateNode;if(!r)throw Error(Ce(169));n?(t=jj(t,e,bc),r.__reactInternalMemoizedMergedChildContext=t,wn(si),wn(Ir),gn(Ir,t)):wn(si),gn(si,n)}var Ba=null,z0=!1,g_=!1;function Uj(t){Ba===null?Ba=[t]:Ba.push(t)}function d6(t){z0=!0,Uj(t)}function vl(){if(!g_&&Ba!==null){g_=!0;var t=0,e=rn;try{var n=Ba;for(rn=1;t>=a,i-=a,Ha=1<<32-Lo(e)+i|n<A?(M=T,T=null):M=T.sibling;var C=f(m,T,b[A],S);if(C===null){T===null&&(T=M);break}t&&T&&C.alternate===null&&e(m,T),x=o(C,x,A),E===null?w=C:E.sibling=C,E=C,T=M}if(A===b.length)return n(m,T),En&&zl(m,A),w;if(T===null){for(;AA?(M=T,T=null):M=T.sibling;var P=f(m,T,C.value,S);if(P===null){T===null&&(T=M);break}t&&T&&P.alternate===null&&e(m,T),x=o(P,x,A),E===null?w=P:E.sibling=P,E=P,T=M}if(C.done)return n(m,T),En&&zl(m,A),w;if(T===null){for(;!C.done;A++,C=b.next())C=d(m,C.value,S),C!==null&&(x=o(C,x,A),E===null?w=C:E.sibling=C,E=C);return En&&zl(m,A),w}for(T=r(m,T);!C.done;A++,C=b.next())C=p(T,m,A,C.value,S),C!==null&&(t&&C.alternate!==null&&T.delete(C.key===null?A:C.key),x=o(C,x,A),E===null?w=C:E.sibling=C,E=C);return t&&T.forEach(function(R){return e(m,R)}),En&&zl(m,A),w}function g(m,x,b,S){if(typeof b=="object"&&b!==null&&b.type===Ru&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case tg:e:{for(var w=b.key,E=x;E!==null;){if(E.key===w){if(w=b.type,w===Ru){if(E.tag===7){n(m,E.sibling),x=i(E,b.props.children),x.return=m,m=x;break e}}else if(E.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Ps&&lR(w)===E.type){n(m,E.sibling),x=i(E,b.props),x.ref=Kf(m,E,b),x.return=m,m=x;break e}n(m,E);break}else e(m,E);E=E.sibling}b.type===Ru?(x=dc(b.props.children,m.mode,S,b.key),x.return=m,m=x):(S=Iv(b.type,b.key,b.props,null,m.mode,S),S.ref=Kf(m,x,b),S.return=m,m=S)}return a(m);case Pu:e:{for(E=b.key;x!==null;){if(x.key===E)if(x.tag===4&&x.stateNode.containerInfo===b.containerInfo&&x.stateNode.implementation===b.implementation){n(m,x.sibling),x=i(x,b.children||[]),x.return=m,m=x;break e}else{n(m,x);break}else e(m,x);x=x.sibling}x=E_(b,m.mode,S),x.return=m,m=x}return a(m);case Ps:return E=b._init,g(m,x,E(b._payload),S)}if(Sh(b))return y(m,x,b,S);if(Vf(b))return v(m,x,b,S);fg(m,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,x!==null&&x.tag===6?(n(m,x.sibling),x=i(x,b),x.return=m,m=x):(n(m,x),x=S_(b,m.mode,S),x.return=m,m=x),a(m)):n(m,x)}return g}var Cd=zj(!0),Hj=zj(!1),ly=gl(null),cy=null,Uu=null,SM=null;function EM(){SM=Uu=cy=null}function TM(t){var e=ly.current;wn(ly),t._currentValue=e}function BS(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function Qu(t,e){cy=t,SM=Uu=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(oi=!0),t.firstContext=null)}function io(t){var e=t._currentValue;if(SM!==t)if(t={context:t,memoizedValue:e,next:null},Uu===null){if(cy===null)throw Error(Ce(308));Uu=t,cy.dependencies={lanes:0,firstContext:t}}else Uu=Uu.next=t;return e}var Ql=null;function MM(t){Ql===null?Ql=[t]:Ql.push(t)}function Vj(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,MM(e)):(n.next=i.next,i.next=n),e.interleaved=n,ns(t,r)}function ns(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var Rs=!1;function AM(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Gj(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Ya(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Ks(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,Ht&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,ns(t,n)}return i=r.interleaved,i===null?(e.next=e,MM(r)):(e.next=i.next,i.next=e),r.interleaved=e,ns(t,n)}function Av(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,fM(t,n)}}function cR(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=a:o=o.next=a,n=n.next}while(n!==null);o===null?i=o=e:o=o.next=e}else i=o=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function uy(t,e,n,r){var i=t.updateQueue;Rs=!1;var o=i.firstBaseUpdate,a=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var l=s,c=l.next;l.next=null,a===null?o=c:a.next=c,a=l;var u=t.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==a&&(s===null?u.firstBaseUpdate=c:s.next=c,u.lastBaseUpdate=l))}if(o!==null){var d=i.baseState;a=0,u=c=l=null,s=o;do{var f=s.lane,p=s.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var y=t,v=s;switch(f=e,p=n,v.tag){case 1:if(y=v.payload,typeof y=="function"){d=y.call(p,d,f);break e}d=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=v.payload,f=typeof y=="function"?y.call(p,d,f):y,f==null)break e;d=Rn({},d,f);break e;case 2:Rs=!0}}s.callback!==null&&s.lane!==0&&(t.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else p={eventTime:p,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(c=u=p,l=d):u=u.next=p,a|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(u===null&&(l=d),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,e=i.shared.interleaved,e!==null){i=e;do a|=i.lane,i=i.next;while(i!==e)}else o===null&&(i.shared.lanes=0);Sc|=a,t.lanes=a,t.memoizedState=d}}function uR(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;en?n:4,t(!0);var r=y_.transition;y_.transition={};try{t(!1),e()}finally{rn=n,y_.transition=r}}function l3(){return oo().memoizedState}function m6(t,e,n){var r=Js(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},c3(t))u3(e,n);else if(n=Vj(t,e,n,r),n!==null){var i=Vr();ko(n,t,r,i),d3(n,e,r)}}function g6(t,e,n){var r=Js(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(c3(t))u3(e,i);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var a=e.lastRenderedState,s=o(a,n);if(i.hasEagerState=!0,i.eagerState=s,Bo(s,a)){var l=e.interleaved;l===null?(i.next=i,MM(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}n=Vj(t,e,i,r),n!==null&&(i=Vr(),ko(n,t,r,i),d3(n,e,r))}}function c3(t){var e=t.alternate;return t===Pn||e!==null&&e===Pn}function u3(t,e){Bh=fy=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function d3(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,fM(t,n)}}var hy={readContext:io,useCallback:Er,useContext:Er,useEffect:Er,useImperativeHandle:Er,useInsertionEffect:Er,useLayoutEffect:Er,useMemo:Er,useReducer:Er,useRef:Er,useState:Er,useDebugValue:Er,useDeferredValue:Er,useTransition:Er,useMutableSource:Er,useSyncExternalStore:Er,useId:Er,unstable_isNewReconciler:!1},v6={readContext:io,useCallback:function(t,e){return Jo().memoizedState=[t,e===void 0?null:e],t},useContext:io,useEffect:fR,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Pv(4194308,4,r3.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Pv(4194308,4,t,e)},useInsertionEffect:function(t,e){return Pv(4,2,t,e)},useMemo:function(t,e){var n=Jo();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Jo();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=m6.bind(null,Pn,t),[r.memoizedState,t]},useRef:function(t){var e=Jo();return t={current:t},e.memoizedState=t},useState:dR,useDebugValue:LM,useDeferredValue:function(t){return Jo().memoizedState=t},useTransition:function(){var t=dR(!1),e=t[0];return t=p6.bind(null,t[1]),Jo().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Pn,i=Jo();if(En){if(n===void 0)throw Error(Ce(407));n=n()}else{if(n=e(),ar===null)throw Error(Ce(349));wc&30||Kj(r,e,n)}i.memoizedState=n;var o={value:n,getSnapshot:e};return i.queue=o,fR(Jj.bind(null,r,o,t),[t]),r.flags|=2048,pp(9,Yj.bind(null,r,o,n,e),void 0,null),n},useId:function(){var t=Jo(),e=ar.identifierPrefix;if(En){var n=Va,r=Ha;n=(r&~(1<<32-Lo(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=fp++,0")&&(l=l.replace("",t.displayName)),l}while(1<=a&&0<=s);break}}}finally{t_=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?wh(t):""}function KG(t){switch(t.tag){case 5:return wh(t.type);case 16:return wh("Lazy");case 13:return wh("Suspense");case 19:return wh("SuspenseList");case 0:case 2:case 15:return t=n_(t.type,!1),t;case 11:return t=n_(t.type.render,!1),t;case 1:return t=n_(t.type,!0),t;default:return""}}function mS(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Ru:return"Fragment";case Pu:return"Portal";case fS:return"Profiler";case sM:return"StrictMode";case hS:return"Suspense";case pS:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case Xk:return(t.displayName||"Context")+".Consumer";case Wk:return(t._context.displayName||"Context")+".Provider";case lM:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case cM:return e=t.displayName||null,e!==null?e:mS(t.type)||"Memo";case Ps:e=t._payload,t=t._init;try{return mS(t(e))}catch{}}return null}function YG(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return mS(e);case 8:return e===sM?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function ol(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Kk(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function JG(t){var e=Kk(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,o.call(this,a)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function ng(t){t._valueTracker||(t._valueTracker=JG(t))}function Yk(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=Kk(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function Kv(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function gS(t,e){var n=e.checked;return Rn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function OP(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=ol(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function Jk(t,e){e=e.checked,e!=null&&aM(t,"checked",e,!1)}function vS(t,e){Jk(t,e);var n=ol(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?yS(t,e.type,n):e.hasOwnProperty("defaultValue")&&yS(t,e.type,ol(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function IP(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function yS(t,e,n){(e!=="number"||Kv(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var Sh=Array.isArray;function Ku(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=rg.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function ep(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var Lh={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ZG=["Webkit","ms","Moz","O"];Object.keys(Lh).forEach(function(t){ZG.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Lh[e]=Lh[t]})});function tj(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||Lh.hasOwnProperty(t)&&Lh[t]?(""+e).trim():e+"px"}function nj(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=tj(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var QG=Rn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function _S(t,e){if(e){if(QG[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Ce(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Ce(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Ce(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Ce(62))}}function wS(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var SS=null;function uM(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var ES=null,Yu=null,Ju=null;function kP(t){if(t=_m(t)){if(typeof ES!="function")throw Error(Ce(280));var e=t.stateNode;e&&(e=$0(e),ES(t.stateNode,t.type,e))}}function rj(t){Yu?Ju?Ju.push(t):Ju=[t]:Yu=t}function ij(){if(Yu){var t=Yu,e=Ju;if(Ju=Yu=null,kP(t),e)for(t=0;t>>=0,t===0?32:31-(u8(t)/d8|0)|0}var ig=64,og=4194304;function Eh(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Qv(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,o=t.pingedLanes,a=n&268435455;if(a!==0){var s=a&~i;s!==0?r=Eh(s):(o&=a,o!==0&&(r=Eh(o)))}else a=n&~i,a!==0?r=Eh(a):o!==0&&(r=Eh(o));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,o=e&-e,i>=o||i===16&&(o&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0n;n++)e.push(t);return e}function xm(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-ko(e),t[e]=n}function m8(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0=jh),GP=" ",WP=!1;function Ej(t,e){switch(t){case"keyup":return H8.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Tj(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Nu=!1;function G8(t,e){switch(t){case"compositionend":return Tj(e);case"keypress":return e.which!==32?null:(WP=!0,GP);case"textInput":return t=e.data,t===GP&&WP?null:t;default:return null}}function W8(t,e){if(Nu)return t==="compositionend"||!yM&&Ej(t,e)?(t=wj(),Tv=mM=Bs=null,Nu=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=YP(n)}}function Pj(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Pj(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Rj(){for(var t=window,e=Kv();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Kv(t.document)}return e}function xM(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function t6(t){var e=Rj(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&Pj(n.ownerDocument.documentElement,n)){if(r!==null&&xM(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!t.extend&&o>r&&(i=r,r=o,o=i),i=JP(n,o);var a=JP(n,r);i&&a&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==a.node||t.focusOffset!==a.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),o>r?(t.addRange(e),t.extend(a.node,a.offset)):(e.setEnd(a.node,a.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Ou=null,RS=null,Fh=null,NS=!1;function ZP(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;NS||Ou==null||Ou!==Kv(r)||(r=Ou,"selectionStart"in r&&xM(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Fh&&ap(Fh,r)||(Fh=r,r=ny(RS,"onSelect"),0Lu||(t.current=jS[Lu],jS[Lu]=null,Lu--)}function gn(t,e){Lu++,jS[Lu]=t.current,t.current=e}var al={},Dr=gl(al),si=gl(!1),bc=al;function Md(t,e){var n=t.type.contextTypes;if(!n)return al;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=e[o];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function li(t){return t=t.childContextTypes,t!=null}function iy(){wn(si),wn(Dr)}function oR(t,e,n){if(Dr.current!==al)throw Error(Ce(168));gn(Dr,e),gn(si,n)}function Fj(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(Ce(108,YG(t)||"Unknown",i));return Rn({},n,r)}function oy(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||al,bc=Dr.current,gn(Dr,t),gn(si,si.current),!0}function aR(t,e,n){var r=t.stateNode;if(!r)throw Error(Ce(169));n?(t=Fj(t,e,bc),r.__reactInternalMemoizedMergedChildContext=t,wn(si),wn(Dr),gn(Dr,t)):wn(si),gn(si,n)}var Ba=null,z0=!1,g_=!1;function Bj(t){Ba===null?Ba=[t]:Ba.push(t)}function h6(t){z0=!0,Bj(t)}function vl(){if(!g_&&Ba!==null){g_=!0;var t=0,e=rn;try{var n=Ba;for(rn=1;t>=a,i-=a,Ha=1<<32-ko(e)+i|n<A?(M=T,T=null):M=T.sibling;var C=f(m,T,b[A],S);if(C===null){T===null&&(T=M);break}t&&T&&C.alternate===null&&e(m,T),x=o(C,x,A),E===null?w=C:E.sibling=C,E=C,T=M}if(A===b.length)return n(m,T),En&&zl(m,A),w;if(T===null){for(;AA?(M=T,T=null):M=T.sibling;var P=f(m,T,C.value,S);if(P===null){T===null&&(T=M);break}t&&T&&P.alternate===null&&e(m,T),x=o(P,x,A),E===null?w=P:E.sibling=P,E=P,T=M}if(C.done)return n(m,T),En&&zl(m,A),w;if(T===null){for(;!C.done;A++,C=b.next())C=d(m,C.value,S),C!==null&&(x=o(C,x,A),E===null?w=C:E.sibling=C,E=C);return En&&zl(m,A),w}for(T=r(m,T);!C.done;A++,C=b.next())C=p(T,m,A,C.value,S),C!==null&&(t&&C.alternate!==null&&T.delete(C.key===null?A:C.key),x=o(C,x,A),E===null?w=C:E.sibling=C,E=C);return t&&T.forEach(function(R){return e(m,R)}),En&&zl(m,A),w}function g(m,x,b,S){if(typeof b=="object"&&b!==null&&b.type===Ru&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case tg:e:{for(var w=b.key,E=x;E!==null;){if(E.key===w){if(w=b.type,w===Ru){if(E.tag===7){n(m,E.sibling),x=i(E,b.props.children),x.return=m,m=x;break e}}else if(E.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Ps&&cR(w)===E.type){n(m,E.sibling),x=i(E,b.props),x.ref=Kf(m,E,b),x.return=m,m=x;break e}n(m,E);break}else e(m,E);E=E.sibling}b.type===Ru?(x=dc(b.props.children,m.mode,S,b.key),x.return=m,m=x):(S=Iv(b.type,b.key,b.props,null,m.mode,S),S.ref=Kf(m,x,b),S.return=m,m=S)}return a(m);case Pu:e:{for(E=b.key;x!==null;){if(x.key===E)if(x.tag===4&&x.stateNode.containerInfo===b.containerInfo&&x.stateNode.implementation===b.implementation){n(m,x.sibling),x=i(x,b.children||[]),x.return=m,m=x;break e}else{n(m,x);break}else e(m,x);x=x.sibling}x=E_(b,m.mode,S),x.return=m,m=x}return a(m);case Ps:return E=b._init,g(m,x,E(b._payload),S)}if(Sh(b))return y(m,x,b,S);if(Vf(b))return v(m,x,b,S);fg(m,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,x!==null&&x.tag===6?(n(m,x.sibling),x=i(x,b),x.return=m,m=x):(n(m,x),x=S_(b,m.mode,S),x.return=m,m=x),a(m)):n(m,x)}return g}var Cd=Vj(!0),Gj=Vj(!1),ly=gl(null),cy=null,Uu=null,SM=null;function EM(){SM=Uu=cy=null}function TM(t){var e=ly.current;wn(ly),t._currentValue=e}function BS(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function Qu(t,e){cy=t,SM=Uu=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(oi=!0),t.firstContext=null)}function io(t){var e=t._currentValue;if(SM!==t)if(t={context:t,memoizedValue:e,next:null},Uu===null){if(cy===null)throw Error(Ce(308));Uu=t,cy.dependencies={lanes:0,firstContext:t}}else Uu=Uu.next=t;return e}var Ql=null;function MM(t){Ql===null?Ql=[t]:Ql.push(t)}function Wj(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,MM(e)):(n.next=i.next,i.next=n),e.interleaved=n,ns(t,r)}function ns(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var Rs=!1;function AM(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Xj(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Ya(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Ks(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,Ht&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,ns(t,n)}return i=r.interleaved,i===null?(e.next=e,MM(r)):(e.next=i.next,i.next=e),r.interleaved=e,ns(t,n)}function Av(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,fM(t,n)}}function uR(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=a:o=o.next=a,n=n.next}while(n!==null);o===null?i=o=e:o=o.next=e}else i=o=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function uy(t,e,n,r){var i=t.updateQueue;Rs=!1;var o=i.firstBaseUpdate,a=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var l=s,c=l.next;l.next=null,a===null?o=c:a.next=c,a=l;var u=t.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==a&&(s===null?u.firstBaseUpdate=c:s.next=c,u.lastBaseUpdate=l))}if(o!==null){var d=i.baseState;a=0,u=c=l=null,s=o;do{var f=s.lane,p=s.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var y=t,v=s;switch(f=e,p=n,v.tag){case 1:if(y=v.payload,typeof y=="function"){d=y.call(p,d,f);break e}d=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=v.payload,f=typeof y=="function"?y.call(p,d,f):y,f==null)break e;d=Rn({},d,f);break e;case 2:Rs=!0}}s.callback!==null&&s.lane!==0&&(t.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else p={eventTime:p,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(c=u=p,l=d):u=u.next=p,a|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(u===null&&(l=d),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,e=i.shared.interleaved,e!==null){i=e;do a|=i.lane,i=i.next;while(i!==e)}else o===null&&(i.shared.lanes=0);Sc|=a,t.lanes=a,t.memoizedState=d}}function dR(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;en?n:4,t(!0);var r=y_.transition;y_.transition={};try{t(!1),e()}finally{rn=n,y_.transition=r}}function u3(){return oo().memoizedState}function v6(t,e,n){var r=Js(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},d3(t))f3(e,n);else if(n=Wj(t,e,n,r),n!==null){var i=Vr();jo(n,t,r,i),h3(n,e,r)}}function y6(t,e,n){var r=Js(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(d3(t))f3(e,i);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var a=e.lastRenderedState,s=o(a,n);if(i.hasEagerState=!0,i.eagerState=s,$o(s,a)){var l=e.interleaved;l===null?(i.next=i,MM(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}n=Wj(t,e,i,r),n!==null&&(i=Vr(),jo(n,t,r,i),h3(n,e,r))}}function d3(t){var e=t.alternate;return t===Pn||e!==null&&e===Pn}function f3(t,e){Bh=fy=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function h3(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,fM(t,n)}}var hy={readContext:io,useCallback:Tr,useContext:Tr,useEffect:Tr,useImperativeHandle:Tr,useInsertionEffect:Tr,useLayoutEffect:Tr,useMemo:Tr,useReducer:Tr,useRef:Tr,useState:Tr,useDebugValue:Tr,useDeferredValue:Tr,useTransition:Tr,useMutableSource:Tr,useSyncExternalStore:Tr,useId:Tr,unstable_isNewReconciler:!1},x6={readContext:io,useCallback:function(t,e){return Zo().memoizedState=[t,e===void 0?null:e],t},useContext:io,useEffect:hR,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Pv(4194308,4,o3.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Pv(4194308,4,t,e)},useInsertionEffect:function(t,e){return Pv(4,2,t,e)},useMemo:function(t,e){var n=Zo();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Zo();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=v6.bind(null,Pn,t),[r.memoizedState,t]},useRef:function(t){var e=Zo();return t={current:t},e.memoizedState=t},useState:fR,useDebugValue:LM,useDeferredValue:function(t){return Zo().memoizedState=t},useTransition:function(){var t=fR(!1),e=t[0];return t=g6.bind(null,t[1]),Zo().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Pn,i=Zo();if(En){if(n===void 0)throw Error(Ce(407));n=n()}else{if(n=e(),ar===null)throw Error(Ce(349));wc&30||Jj(r,e,n)}i.memoizedState=n;var o={value:n,getSnapshot:e};return i.queue=o,hR(Qj.bind(null,r,o,t),[t]),r.flags|=2048,pp(9,Zj.bind(null,r,o,n,e),void 0,null),n},useId:function(){var t=Zo(),e=ar.identifierPrefix;if(En){var n=Va,r=Ha;n=(r&~(1<<32-ko(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=fp++,0<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=a.createElement(n,{is:r.is}):(t=a.createElement(n),n==="select"&&(a=t,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):t=a.createElementNS(t,n),t[ra]=e,t[cp]=r,_3(t,e,!1,!1),e.stateNode=t;e:{switch(a=wS(n,r),n){case"dialog":xn("cancel",t),xn("close",t),i=r;break;case"iframe":case"object":case"embed":xn("load",t),i=r;break;case"video":case"audio":for(i=0;iNd&&(e.flags|=128,r=!0,Yf(o,!1),e.lanes=4194304)}else{if(!r)if(t=dy(a),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),Yf(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!En)return Tr(e),null}else 2*Ln()-o.renderingStartTime>Nd&&n!==1073741824&&(e.flags|=128,r=!0,Yf(o,!1),e.lanes=4194304);o.isBackwards?(a.sibling=e.child,e.child=a):(n=o.last,n!==null?n.sibling=a:e.child=a,o.last=a)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=Ln(),e.sibling=null,n=Cn.current,gn(Cn,r?n&1|2:n&1),e):(Tr(e),null);case 22:case 23:return $M(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Si&1073741824&&(Tr(e),e.subtreeFlags&6&&(e.flags|=8192)):Tr(e),null;case 24:return null;case 25:return null}throw Error(Ce(156,e.tag))}function T6(t,e){switch(_M(e),e.tag){case 1:return li(e.type)&&iy(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Pd(),wn(si),wn(Ir),RM(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return PM(e),null;case 13:if(wn(Cn),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(Ce(340));Ad()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return wn(Cn),null;case 4:return Pd(),null;case 10:return TM(e.type._context),null;case 22:case 23:return $M(),null;case 24:return null;default:return null}}var pg=!1,Rr=!1,M6=typeof WeakSet=="function"?WeakSet:Set,qe=null;function Fu(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){On(t,e,r)}else n.current=null}function KS(t,e,n){try{n()}catch(r){On(t,e,r)}}var SR=!1;function A6(t,e){if(OS=ey,t=Cj(),xM(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var a=0,s=-1,l=-1,c=0,u=0,d=t,f=null;t:for(;;){for(var p;d!==n||i!==0&&d.nodeType!==3||(s=a+i),d!==o||r!==0&&d.nodeType!==3||(l=a+r),d.nodeType===3&&(a+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===t)break t;if(f===n&&++c===i&&(s=a),f===o&&++u===r&&(l=a),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(IS={focusedElem:t,selectionRange:n},ey=!1,qe=e;qe!==null;)if(e=qe,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,qe=t;else for(;qe!==null;){e=qe;try{var y=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var v=y.memoizedProps,g=y.memoizedState,m=e.stateNode,x=m.getSnapshotBeforeUpdate(e.elementType===e.type?v:yo(e.type,v),g);m.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var b=e.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Ce(163))}}catch(S){On(e,e.return,S)}if(t=e.sibling,t!==null){t.return=e.return,qe=t;break}qe=e.return}return y=SR,SR=!1,y}function $h(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var o=i.destroy;i.destroy=void 0,o!==void 0&&KS(e,n,o)}i=i.next}while(i!==r)}}function G0(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function YS(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function E3(t){var e=t.alternate;e!==null&&(t.alternate=null,E3(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[ra],delete e[cp],delete e[kS],delete e[c6],delete e[u6])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function T3(t){return t.tag===5||t.tag===3||t.tag===4}function ER(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||T3(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function JS(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=ry));else if(r!==4&&(t=t.child,t!==null))for(JS(t,e,n),t=t.sibling;t!==null;)JS(t,e,n),t=t.sibling}function ZS(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(ZS(t,e,n),t=t.sibling;t!==null;)ZS(t,e,n),t=t.sibling}var pr=null,wo=!1;function gs(t,e,n){for(n=n.child;n!==null;)M3(t,e,n),n=n.sibling}function M3(t,e,n){if(ha&&typeof ha.onCommitFiberUnmount=="function")try{ha.onCommitFiberUnmount(j0,n)}catch{}switch(n.tag){case 5:Rr||Fu(n,e);case 6:var r=pr,i=wo;pr=null,gs(t,e,n),pr=r,wo=i,pr!==null&&(wo?(t=pr,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):pr.removeChild(n.stateNode));break;case 18:pr!==null&&(wo?(t=pr,n=n.stateNode,t.nodeType===8?m_(t.parentNode,n):t.nodeType===1&&m_(t,n),ip(t)):m_(pr,n.stateNode));break;case 4:r=pr,i=wo,pr=n.stateNode.containerInfo,wo=!0,gs(t,e,n),pr=r,wo=i;break;case 0:case 11:case 14:case 15:if(!Rr&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&KS(n,e,a),i=i.next}while(i!==r)}gs(t,e,n);break;case 1:if(!Rr&&(Fu(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){On(n,e,s)}gs(t,e,n);break;case 21:gs(t,e,n);break;case 22:n.mode&1?(Rr=(r=Rr)||n.memoizedState!==null,gs(t,e,n),Rr=r):gs(t,e,n);break;default:gs(t,e,n)}}function TR(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new M6),e.forEach(function(r){var i=k6.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function co(t,e){var n=e.deletions;if(n!==null)for(var r=0;ri&&(i=a),r&=~o}if(r=i,r=Ln()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*P6(r/1960))-r,10t?16:t,$s===null)var r=!1;else{if(t=$s,$s=null,gy=0,Ht&6)throw Error(Ce(331));var i=Ht;for(Ht|=4,qe=t.current;qe!==null;){var o=qe,a=o.child;if(qe.flags&16){var s=o.deletions;if(s!==null){for(var l=0;lLn()-FM?uc(t,0):UM|=n),ci(t,e)}function D3(t,e){e===0&&(t.mode&1?(e=og,og<<=1,!(og&130023424)&&(og=4194304)):e=1);var n=Vr();t=ns(t,e),t!==null&&(xm(t,e,n),ci(t,n))}function L6(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),D3(t,n)}function k6(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(Ce(314))}r!==null&&r.delete(e),D3(t,n)}var L3;L3=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||si.current)oi=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return oi=!1,S6(t,e,n);oi=!!(t.flags&131072)}else oi=!1,En&&e.flags&1048576&&Fj(e,sy,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Rv(t,e),t=e.pendingProps;var i=Md(e,Ir.current);Qu(e,n),i=OM(null,e,r,t,i,n);var o=IM();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,li(r)?(o=!0,oy(e)):o=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,AM(e),i.updater=V0,e.stateNode=i,i._reactInternals=e,zS(e,r,t,n),e=GS(null,e,r,!0,o,n)):(e.tag=0,En&&o&&bM(e),$r(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(Rv(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=U6(r),t=yo(r,t),i){case 0:e=VS(null,e,r,t,n);break e;case 1:e=bR(null,e,r,t,n);break e;case 11:e=yR(null,e,r,t,n);break e;case 14:e=xR(null,e,r,yo(r.type,t),n);break e}throw Error(Ce(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:yo(r,i),VS(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:yo(r,i),bR(t,e,r,i,n);case 3:e:{if(y3(e),t===null)throw Error(Ce(387));r=e.pendingProps,o=e.memoizedState,i=o.element,Gj(t,e),uy(e,r,null,n);var a=e.memoizedState;if(r=a.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){i=Rd(Error(Ce(423)),e),e=_R(t,e,r,n,i);break e}else if(r!==i){i=Rd(Error(Ce(424)),e),e=_R(t,e,r,n,i);break e}else for(Pi=qs(e.stateNode.containerInfo.firstChild),Ri=e,En=!0,Mo=null,n=Hj(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ad(),r===i){e=rs(t,e,n);break e}$r(t,e,r,n)}e=e.child}return e;case 5:return Wj(e),t===null&&FS(e),r=e.type,i=e.pendingProps,o=t!==null?t.memoizedProps:null,a=i.children,DS(r,i)?a=null:o!==null&&DS(r,o)&&(e.flags|=32),v3(t,e),$r(t,e,a,n),e.child;case 6:return t===null&&FS(e),null;case 13:return x3(t,e,n);case 4:return CM(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Cd(e,null,r,n):$r(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:yo(r,i),yR(t,e,r,i,n);case 7:return $r(t,e,e.pendingProps,n),e.child;case 8:return $r(t,e,e.pendingProps.children,n),e.child;case 12:return $r(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,o=e.memoizedProps,a=i.value,gn(ly,r._currentValue),r._currentValue=a,o!==null)if(Bo(o.value,a)){if(o.children===i.children&&!si.current){e=rs(t,e,n);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var s=o.dependencies;if(s!==null){a=o.child;for(var l=s.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=Ya(-1,n&-n),l.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),BS(o.return,n,e),s.lanes|=n;break}l=l.next}}else if(o.tag===10)a=o.type===e.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(Ce(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),BS(a,n,e),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===e){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}$r(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,Qu(e,n),i=io(i),r=r(i),e.flags|=1,$r(t,e,r,n),e.child;case 14:return r=e.type,i=yo(r,e.pendingProps),i=yo(r.type,i),xR(t,e,r,i,n);case 15:return m3(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:yo(r,i),Rv(t,e),e.tag=1,li(r)?(t=!0,oy(e)):t=!1,Qu(e,n),f3(e,r,i),zS(e,r,i,n),GS(null,e,r,!0,t,n);case 19:return b3(t,e,n);case 22:return g3(t,e,n)}throw Error(Ce(156,e.tag))};function k3(t,e){return cj(t,e)}function j6(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Yi(t,e,n,r){return new j6(t,e,n,r)}function HM(t){return t=t.prototype,!(!t||!t.isReactComponent)}function U6(t){if(typeof t=="function")return HM(t)?1:0;if(t!=null){if(t=t.$$typeof,t===lM)return 11;if(t===cM)return 14}return 2}function Zs(t,e){var n=t.alternate;return n===null?(n=Yi(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Iv(t,e,n,r,i,o){var a=2;if(r=t,typeof t=="function")HM(t)&&(a=1);else if(typeof t=="string")a=5;else e:switch(t){case Ru:return dc(n.children,i,o,e);case sM:a=8,i|=8;break;case fS:return t=Yi(12,n,e,i|2),t.elementType=fS,t.lanes=o,t;case hS:return t=Yi(13,n,e,i),t.elementType=hS,t.lanes=o,t;case pS:return t=Yi(19,n,e,i),t.elementType=pS,t.lanes=o,t;case Wk:return X0(n,i,o,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Vk:a=10;break e;case Gk:a=9;break e;case lM:a=11;break e;case cM:a=14;break e;case Ps:a=16,r=null;break e}throw Error(Ce(130,t==null?t:typeof t,""))}return e=Yi(a,n,e,i),e.elementType=t,e.type=r,e.lanes=o,e}function dc(t,e,n,r){return t=Yi(7,t,r,e),t.lanes=n,t}function X0(t,e,n,r){return t=Yi(22,t,r,e),t.elementType=Wk,t.lanes=n,t.stateNode={isHidden:!1},t}function S_(t,e,n){return t=Yi(6,t,null,e),t.lanes=n,t}function E_(t,e,n){return e=Yi(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function F6(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=i_(0),this.expirationTimes=i_(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=i_(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function VM(t,e,n,r,i,o,a,s,l){return t=new F6(t,e,n,s,l),e===1?(e=1,o===!0&&(e|=8)):e=0,o=Yi(3,null,null,e),t.current=o,o.stateNode=t,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},AM(o),t}function B6(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(B3)}catch(t){console.error(t)}}B3(),Bk.exports=Li;var Bc=Bk.exports;const $3=dn(Bc);var z3,IR=Bc;z3=IR.createRoot,IR.hydrateRoot;/** +`+o.stack}return{value:t,source:e,stack:i,digest:null}}function __(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function HS(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var w6=typeof WeakMap=="function"?WeakMap:Map;function m3(t,e,n){n=Ya(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){my||(my=!0,QS=r),HS(t,e)},n}function g3(t,e,n){n=Ya(-1,n),n.tag=3;var r=t.type.getDerivedStateFromError;if(typeof r=="function"){var i=e.value;n.payload=function(){return r(i)},n.callback=function(){HS(t,e)}}var o=t.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){HS(t,e),typeof r!="function"&&(Ys===null?Ys=new Set([this]):Ys.add(this));var a=e.stack;this.componentDidCatch(e.value,{componentStack:a!==null?a:""})}),n}function gR(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new w6;var i=new Set;r.set(e,i)}else i=r.get(e),i===void 0&&(i=new Set,r.set(e,i));i.has(n)||(i.add(n),t=k6.bind(null,t,e,n),e.then(t,t))}function vR(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function yR(t,e,n,r,i){return t.mode&1?(t.flags|=65536,t.lanes=i,t):(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(e=Ya(-1,1),e.tag=2,Ks(n,e,1))),n.lanes|=1),t)}var S6=ds.ReactCurrentOwner,oi=!1;function $r(t,e,n,r){e.child=t===null?Gj(e,null,n,r):Cd(e,t.child,n,r)}function xR(t,e,n,r,i){n=n.render;var o=e.ref;return Qu(e,i),r=OM(t,e,n,r,o,i),n=IM(),t!==null&&!oi?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,rs(t,e,i)):(En&&n&&bM(e),e.flags|=1,$r(t,e,r,i),e.child)}function bR(t,e,n,r,i){if(t===null){var o=n.type;return typeof o=="function"&&!HM(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=o,v3(t,e,o,r,i)):(t=Iv(n.type,null,r,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(o=t.child,!(t.lanes&i)){var a=o.memoizedProps;if(n=n.compare,n=n!==null?n:ap,n(a,r)&&t.ref===e.ref)return rs(t,e,i)}return e.flags|=1,t=Zs(o,r),t.ref=e.ref,t.return=e,e.child=t}function v3(t,e,n,r,i){if(t!==null){var o=t.memoizedProps;if(ap(o,r)&&t.ref===e.ref)if(oi=!1,e.pendingProps=r=o,(t.lanes&i)!==0)t.flags&131072&&(oi=!0);else return e.lanes=t.lanes,rs(t,e,i)}return VS(t,e,n,r,i)}function y3(t,e,n){var r=e.pendingProps,i=r.children,o=t!==null?t.memoizedState:null;if(r.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},gn(Bu,Si),Si|=n;else{if(!(n&1073741824))return t=o!==null?o.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,gn(Bu,Si),Si|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,gn(Bu,Si),Si|=r}else o!==null?(r=o.baseLanes|n,e.memoizedState=null):r=n,gn(Bu,Si),Si|=r;return $r(t,e,i,n),e.child}function x3(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function VS(t,e,n,r,i){var o=li(n)?bc:Dr.current;return o=Md(e,o),Qu(e,i),n=OM(t,e,n,r,o,i),r=IM(),t!==null&&!oi?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,rs(t,e,i)):(En&&r&&bM(e),e.flags|=1,$r(t,e,n,i),e.child)}function _R(t,e,n,r,i){if(li(n)){var o=!0;oy(e)}else o=!1;if(Qu(e,i),e.stateNode===null)Rv(t,e),p3(e,n,r),zS(e,n,r,i),r=!0;else if(t===null){var a=e.stateNode,s=e.memoizedProps;a.props=s;var l=a.context,c=n.contextType;typeof c=="object"&&c!==null?c=io(c):(c=li(n)?bc:Dr.current,c=Md(e,c));var u=n.getDerivedStateFromProps,d=typeof u=="function"||typeof a.getSnapshotBeforeUpdate=="function";d||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s!==r||l!==c)&&mR(e,a,r,c),Rs=!1;var f=e.memoizedState;a.state=f,uy(e,r,a,i),l=e.memoizedState,s!==r||f!==l||si.current||Rs?(typeof u=="function"&&($S(e,n,u,r),l=e.memoizedState),(s=Rs||pR(e,n,s,r,f,l,c))?(d||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(e.flags|=4194308)):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=l),a.props=r,a.state=l,a.context=c,r=s):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{a=e.stateNode,Xj(t,e),s=e.memoizedProps,c=e.type===e.elementType?s:yo(e.type,s),a.props=c,d=e.pendingProps,f=a.context,l=n.contextType,typeof l=="object"&&l!==null?l=io(l):(l=li(n)?bc:Dr.current,l=Md(e,l));var p=n.getDerivedStateFromProps;(u=typeof p=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s!==d||f!==l)&&mR(e,a,r,l),Rs=!1,f=e.memoizedState,a.state=f,uy(e,r,a,i);var y=e.memoizedState;s!==d||f!==y||si.current||Rs?(typeof p=="function"&&($S(e,n,p,r),y=e.memoizedState),(c=Rs||pR(e,n,c,r,f,y,l)||!1)?(u||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,y,l),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,y,l)),typeof a.componentDidUpdate=="function"&&(e.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof a.componentDidUpdate!="function"||s===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=y),a.props=r,a.state=y,a.context=l,r=c):(typeof a.componentDidUpdate!="function"||s===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),r=!1)}return GS(t,e,n,r,o,i)}function GS(t,e,n,r,i,o){x3(t,e);var a=(e.flags&128)!==0;if(!r&&!a)return i&&aR(e,n,!1),rs(t,e,o);r=e.stateNode,S6.current=e;var s=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,t!==null&&a?(e.child=Cd(e,t.child,null,o),e.child=Cd(e,null,s,o)):$r(t,e,s,o),e.memoizedState=r.state,i&&aR(e,n,!0),e.child}function b3(t){var e=t.stateNode;e.pendingContext?oR(t,e.pendingContext,e.pendingContext!==e.context):e.context&&oR(t,e.context,!1),CM(t,e.containerInfo)}function wR(t,e,n,r,i){return Ad(),wM(i),e.flags|=256,$r(t,e,n,r),e.child}var WS={dehydrated:null,treeContext:null,retryLane:0};function XS(t){return{baseLanes:t,cachePool:null,transitions:null}}function _3(t,e,n){var r=e.pendingProps,i=Cn.current,o=!1,a=(e.flags&128)!==0,s;if((s=a)||(s=t!==null&&t.memoizedState===null?!1:(i&2)!==0),s?(o=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(i|=1),gn(Cn,i&1),t===null)return FS(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(a=r.children,t=r.fallback,o?(r=e.mode,o=e.child,a={mode:"hidden",children:a},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=a):o=X0(a,r,0,null),t=dc(t,r,n,null),o.return=e,t.return=e,o.sibling=t,e.child=o,e.child.memoizedState=XS(n),e.memoizedState=WS,t):kM(e,a));if(i=t.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return E6(t,e,a,r,s,i,n);if(o){o=r.fallback,a=e.mode,i=t.child,s=i.sibling;var l={mode:"hidden",children:r.children};return!(a&1)&&e.child!==i?(r=e.child,r.childLanes=0,r.pendingProps=l,e.deletions=null):(r=Zs(i,l),r.subtreeFlags=i.subtreeFlags&14680064),s!==null?o=Zs(s,o):(o=dc(o,a,n,null),o.flags|=2),o.return=e,r.return=e,r.sibling=o,e.child=r,r=o,o=e.child,a=t.child.memoizedState,a=a===null?XS(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},o.memoizedState=a,o.childLanes=t.childLanes&~n,e.memoizedState=WS,r}return o=t.child,t=o.sibling,r=Zs(o,{mode:"visible",children:r.children}),!(e.mode&1)&&(r.lanes=n),r.return=e,r.sibling=null,t!==null&&(n=e.deletions,n===null?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=r,e.memoizedState=null,r}function kM(t,e){return e=X0({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function hg(t,e,n,r){return r!==null&&wM(r),Cd(e,t.child,null,n),t=kM(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function E6(t,e,n,r,i,o,a){if(n)return e.flags&256?(e.flags&=-257,r=__(Error(Ce(422))),hg(t,e,a,r)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(o=r.fallback,i=e.mode,r=X0({mode:"visible",children:r.children},i,0,null),o=dc(o,i,a,null),o.flags|=2,r.return=e,o.return=e,r.sibling=o,e.child=r,e.mode&1&&Cd(e,t.child,null,a),e.child.memoizedState=XS(a),e.memoizedState=WS,o);if(!(e.mode&1))return hg(t,e,a,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var s=r.dgst;return r=s,o=Error(Ce(419)),r=__(o,r,void 0),hg(t,e,a,r)}if(s=(a&t.childLanes)!==0,oi||s){if(r=ar,r!==null){switch(a&-a){case 4:i=2;break;case 16:i=8;break;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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|a)?0:i,i!==0&&i!==o.retryLane&&(o.retryLane=i,ns(t,i),jo(r,t,i,-1))}return zM(),r=__(Error(Ce(421))),hg(t,e,a,r)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=j6.bind(null,t),i._reactRetry=e,null):(t=o.treeContext,Pi=qs(i.nextSibling),Ri=e,En=!0,Ao=null,t!==null&&(Wi[Xi++]=Ha,Wi[Xi++]=Va,Wi[Xi++]=_c,Ha=t.id,Va=t.overflow,_c=e),e=kM(e,r.children),e.flags|=4096,e)}function SR(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),BS(t.return,e,n)}function w_(t,e,n,r,i){var o=t.memoizedState;o===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=e,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function w3(t,e,n){var r=e.pendingProps,i=r.revealOrder,o=r.tail;if($r(t,e,r.children,n),r=Cn.current,r&2)r=r&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&SR(t,n,e);else if(t.tag===19)SR(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}r&=1}if(gn(Cn,r),!(e.mode&1))e.memoizedState=null;else switch(i){case"forwards":for(n=e.child,i=null;n!==null;)t=n.alternate,t!==null&&dy(t)===null&&(i=n),n=n.sibling;n=i,n===null?(i=e.child,e.child=null):(i=n.sibling,n.sibling=null),w_(e,!1,i,n,o);break;case"backwards":for(n=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&dy(t)===null){e.child=i;break}t=i.sibling,i.sibling=n,n=i,i=t}w_(e,!0,n,null,o);break;case"together":w_(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function Rv(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function rs(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Sc|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(Ce(153));if(e.child!==null){for(t=e.child,n=Zs(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=Zs(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function T6(t,e,n){switch(e.tag){case 3:b3(e),Ad();break;case 5:qj(e);break;case 1:li(e.type)&&oy(e);break;case 4:CM(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,i=e.memoizedProps.value;gn(ly,r._currentValue),r._currentValue=i;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(gn(Cn,Cn.current&1),e.flags|=128,null):n&e.child.childLanes?_3(t,e,n):(gn(Cn,Cn.current&1),t=rs(t,e,n),t!==null?t.sibling:null);gn(Cn,Cn.current&1);break;case 19:if(r=(n&e.childLanes)!==0,t.flags&128){if(r)return w3(t,e,n);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),gn(Cn,Cn.current),r)break;return null;case 22:case 23:return e.lanes=0,y3(t,e,n)}return rs(t,e,n)}var S3,qS,E3,T3;S3=function(t,e){for(var n=e.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};qS=function(){};E3=function(t,e,n,r){var i=t.memoizedProps;if(i!==r){t=e.stateNode,ec(pa.current);var o=null;switch(n){case"input":i=gS(t,i),r=gS(t,r),o=[];break;case"select":i=Rn({},i,{value:void 0}),r=Rn({},r,{value:void 0}),o=[];break;case"textarea":i=xS(t,i),r=xS(t,r),o=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(t.onclick=ry)}_S(n,r);var a;n=null;for(c in i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var s=i[c];for(a in s)s.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Qh.hasOwnProperty(c)?o||(o=[]):(o=o||[]).push(c,null));for(c in r){var l=r[c];if(s=i!=null?i[c]:void 0,r.hasOwnProperty(c)&&l!==s&&(l!=null||s!=null))if(c==="style")if(s){for(a in s)!s.hasOwnProperty(a)||l&&l.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in l)l.hasOwnProperty(a)&&s[a]!==l[a]&&(n||(n={}),n[a]=l[a])}else n||(o||(o=[]),o.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,s=s?s.__html:void 0,l!=null&&s!==l&&(o=o||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(o=o||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Qh.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&xn("scroll",t),o||s===l||(o=[])):(o=o||[]).push(c,l))}n&&(o=o||[]).push("style",n);var c=o;(e.updateQueue=c)&&(e.flags|=4)}};T3=function(t,e,n,r){n!==r&&(e.flags|=4)};function Yf(t,e){if(!En)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function Mr(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,r=0;if(e)for(var i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=t,i=i.sibling;else for(i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=r,t.childLanes=n,e}function M6(t,e,n){var r=e.pendingProps;switch(_M(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Mr(e),null;case 1:return li(e.type)&&iy(),Mr(e),null;case 3:return r=e.stateNode,Pd(),wn(si),wn(Dr),RM(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(dg(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Ao!==null&&(nE(Ao),Ao=null))),qS(t,e),Mr(e),null;case 5:PM(e);var i=ec(dp.current);if(n=e.type,t!==null&&e.stateNode!=null)E3(t,e,n,r,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(Ce(166));return Mr(e),null}if(t=ec(pa.current),dg(e)){r=e.stateNode,n=e.type;var o=e.memoizedProps;switch(r[ra]=e,r[cp]=o,t=(e.mode&1)!==0,n){case"dialog":xn("cancel",r),xn("close",r);break;case"iframe":case"object":case"embed":xn("load",r);break;case"video":case"audio":for(i=0;i<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=a.createElement(n,{is:r.is}):(t=a.createElement(n),n==="select"&&(a=t,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):t=a.createElementNS(t,n),t[ra]=e,t[cp]=r,S3(t,e,!1,!1),e.stateNode=t;e:{switch(a=wS(n,r),n){case"dialog":xn("cancel",t),xn("close",t),i=r;break;case"iframe":case"object":case"embed":xn("load",t),i=r;break;case"video":case"audio":for(i=0;iNd&&(e.flags|=128,r=!0,Yf(o,!1),e.lanes=4194304)}else{if(!r)if(t=dy(a),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),Yf(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!En)return Mr(e),null}else 2*Ln()-o.renderingStartTime>Nd&&n!==1073741824&&(e.flags|=128,r=!0,Yf(o,!1),e.lanes=4194304);o.isBackwards?(a.sibling=e.child,e.child=a):(n=o.last,n!==null?n.sibling=a:e.child=a,o.last=a)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=Ln(),e.sibling=null,n=Cn.current,gn(Cn,r?n&1|2:n&1),e):(Mr(e),null);case 22:case 23:return $M(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Si&1073741824&&(Mr(e),e.subtreeFlags&6&&(e.flags|=8192)):Mr(e),null;case 24:return null;case 25:return null}throw Error(Ce(156,e.tag))}function A6(t,e){switch(_M(e),e.tag){case 1:return li(e.type)&&iy(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Pd(),wn(si),wn(Dr),RM(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return PM(e),null;case 13:if(wn(Cn),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(Ce(340));Ad()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return wn(Cn),null;case 4:return Pd(),null;case 10:return TM(e.type._context),null;case 22:case 23:return $M(),null;case 24:return null;default:return null}}var pg=!1,Nr=!1,C6=typeof WeakSet=="function"?WeakSet:Set,qe=null;function Fu(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){On(t,e,r)}else n.current=null}function KS(t,e,n){try{n()}catch(r){On(t,e,r)}}var ER=!1;function P6(t,e){if(OS=ey,t=Rj(),xM(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var a=0,s=-1,l=-1,c=0,u=0,d=t,f=null;t:for(;;){for(var p;d!==n||i!==0&&d.nodeType!==3||(s=a+i),d!==o||r!==0&&d.nodeType!==3||(l=a+r),d.nodeType===3&&(a+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===t)break t;if(f===n&&++c===i&&(s=a),f===o&&++u===r&&(l=a),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(IS={focusedElem:t,selectionRange:n},ey=!1,qe=e;qe!==null;)if(e=qe,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,qe=t;else for(;qe!==null;){e=qe;try{var y=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var v=y.memoizedProps,g=y.memoizedState,m=e.stateNode,x=m.getSnapshotBeforeUpdate(e.elementType===e.type?v:yo(e.type,v),g);m.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var b=e.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Ce(163))}}catch(S){On(e,e.return,S)}if(t=e.sibling,t!==null){t.return=e.return,qe=t;break}qe=e.return}return y=ER,ER=!1,y}function $h(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var o=i.destroy;i.destroy=void 0,o!==void 0&&KS(e,n,o)}i=i.next}while(i!==r)}}function G0(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function YS(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function M3(t){var e=t.alternate;e!==null&&(t.alternate=null,M3(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[ra],delete e[cp],delete e[kS],delete e[d6],delete e[f6])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function A3(t){return t.tag===5||t.tag===3||t.tag===4}function TR(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||A3(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function JS(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=ry));else if(r!==4&&(t=t.child,t!==null))for(JS(t,e,n),t=t.sibling;t!==null;)JS(t,e,n),t=t.sibling}function ZS(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(ZS(t,e,n),t=t.sibling;t!==null;)ZS(t,e,n),t=t.sibling}var pr=null,So=!1;function gs(t,e,n){for(n=n.child;n!==null;)C3(t,e,n),n=n.sibling}function C3(t,e,n){if(ha&&typeof ha.onCommitFiberUnmount=="function")try{ha.onCommitFiberUnmount(j0,n)}catch{}switch(n.tag){case 5:Nr||Fu(n,e);case 6:var r=pr,i=So;pr=null,gs(t,e,n),pr=r,So=i,pr!==null&&(So?(t=pr,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):pr.removeChild(n.stateNode));break;case 18:pr!==null&&(So?(t=pr,n=n.stateNode,t.nodeType===8?m_(t.parentNode,n):t.nodeType===1&&m_(t,n),ip(t)):m_(pr,n.stateNode));break;case 4:r=pr,i=So,pr=n.stateNode.containerInfo,So=!0,gs(t,e,n),pr=r,So=i;break;case 0:case 11:case 14:case 15:if(!Nr&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&KS(n,e,a),i=i.next}while(i!==r)}gs(t,e,n);break;case 1:if(!Nr&&(Fu(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){On(n,e,s)}gs(t,e,n);break;case 21:gs(t,e,n);break;case 22:n.mode&1?(Nr=(r=Nr)||n.memoizedState!==null,gs(t,e,n),Nr=r):gs(t,e,n);break;default:gs(t,e,n)}}function MR(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new C6),e.forEach(function(r){var i=U6.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function co(t,e){var n=e.deletions;if(n!==null)for(var r=0;ri&&(i=a),r&=~o}if(r=i,r=Ln()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*N6(r/1960))-r,10t?16:t,$s===null)var r=!1;else{if(t=$s,$s=null,gy=0,Ht&6)throw Error(Ce(331));var i=Ht;for(Ht|=4,qe=t.current;qe!==null;){var o=qe,a=o.child;if(qe.flags&16){var s=o.deletions;if(s!==null){for(var l=0;lLn()-FM?uc(t,0):UM|=n),ci(t,e)}function k3(t,e){e===0&&(t.mode&1?(e=og,og<<=1,!(og&130023424)&&(og=4194304)):e=1);var n=Vr();t=ns(t,e),t!==null&&(xm(t,e,n),ci(t,n))}function j6(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),k3(t,n)}function U6(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(Ce(314))}r!==null&&r.delete(e),k3(t,n)}var j3;j3=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||si.current)oi=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return oi=!1,T6(t,e,n);oi=!!(t.flags&131072)}else oi=!1,En&&e.flags&1048576&&$j(e,sy,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Rv(t,e),t=e.pendingProps;var i=Md(e,Dr.current);Qu(e,n),i=OM(null,e,r,t,i,n);var o=IM();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,li(r)?(o=!0,oy(e)):o=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,AM(e),i.updater=V0,e.stateNode=i,i._reactInternals=e,zS(e,r,t,n),e=GS(null,e,r,!0,o,n)):(e.tag=0,En&&o&&bM(e),$r(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(Rv(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=B6(r),t=yo(r,t),i){case 0:e=VS(null,e,r,t,n);break e;case 1:e=_R(null,e,r,t,n);break e;case 11:e=xR(null,e,r,t,n);break e;case 14:e=bR(null,e,r,yo(r.type,t),n);break e}throw Error(Ce(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:yo(r,i),VS(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:yo(r,i),_R(t,e,r,i,n);case 3:e:{if(b3(e),t===null)throw Error(Ce(387));r=e.pendingProps,o=e.memoizedState,i=o.element,Xj(t,e),uy(e,r,null,n);var a=e.memoizedState;if(r=a.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){i=Rd(Error(Ce(423)),e),e=wR(t,e,r,n,i);break e}else if(r!==i){i=Rd(Error(Ce(424)),e),e=wR(t,e,r,n,i);break e}else for(Pi=qs(e.stateNode.containerInfo.firstChild),Ri=e,En=!0,Ao=null,n=Gj(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ad(),r===i){e=rs(t,e,n);break e}$r(t,e,r,n)}e=e.child}return e;case 5:return qj(e),t===null&&FS(e),r=e.type,i=e.pendingProps,o=t!==null?t.memoizedProps:null,a=i.children,DS(r,i)?a=null:o!==null&&DS(r,o)&&(e.flags|=32),x3(t,e),$r(t,e,a,n),e.child;case 6:return t===null&&FS(e),null;case 13:return _3(t,e,n);case 4:return CM(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Cd(e,null,r,n):$r(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:yo(r,i),xR(t,e,r,i,n);case 7:return $r(t,e,e.pendingProps,n),e.child;case 8:return $r(t,e,e.pendingProps.children,n),e.child;case 12:return $r(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,o=e.memoizedProps,a=i.value,gn(ly,r._currentValue),r._currentValue=a,o!==null)if($o(o.value,a)){if(o.children===i.children&&!si.current){e=rs(t,e,n);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var s=o.dependencies;if(s!==null){a=o.child;for(var l=s.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=Ya(-1,n&-n),l.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),BS(o.return,n,e),s.lanes|=n;break}l=l.next}}else if(o.tag===10)a=o.type===e.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(Ce(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),BS(a,n,e),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===e){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}$r(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,Qu(e,n),i=io(i),r=r(i),e.flags|=1,$r(t,e,r,n),e.child;case 14:return r=e.type,i=yo(r,e.pendingProps),i=yo(r.type,i),bR(t,e,r,i,n);case 15:return v3(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:yo(r,i),Rv(t,e),e.tag=1,li(r)?(t=!0,oy(e)):t=!1,Qu(e,n),p3(e,r,i),zS(e,r,i,n),GS(null,e,r,!0,t,n);case 19:return w3(t,e,n);case 22:return y3(t,e,n)}throw Error(Ce(156,e.tag))};function U3(t,e){return dj(t,e)}function F6(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Yi(t,e,n,r){return new F6(t,e,n,r)}function HM(t){return t=t.prototype,!(!t||!t.isReactComponent)}function B6(t){if(typeof t=="function")return HM(t)?1:0;if(t!=null){if(t=t.$$typeof,t===lM)return 11;if(t===cM)return 14}return 2}function Zs(t,e){var n=t.alternate;return n===null?(n=Yi(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Iv(t,e,n,r,i,o){var a=2;if(r=t,typeof t=="function")HM(t)&&(a=1);else if(typeof t=="string")a=5;else e:switch(t){case Ru:return dc(n.children,i,o,e);case sM:a=8,i|=8;break;case fS:return t=Yi(12,n,e,i|2),t.elementType=fS,t.lanes=o,t;case hS:return t=Yi(13,n,e,i),t.elementType=hS,t.lanes=o,t;case pS:return t=Yi(19,n,e,i),t.elementType=pS,t.lanes=o,t;case qk:return X0(n,i,o,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Wk:a=10;break e;case Xk:a=9;break e;case lM:a=11;break e;case cM:a=14;break e;case Ps:a=16,r=null;break e}throw Error(Ce(130,t==null?t:typeof t,""))}return e=Yi(a,n,e,i),e.elementType=t,e.type=r,e.lanes=o,e}function dc(t,e,n,r){return t=Yi(7,t,r,e),t.lanes=n,t}function X0(t,e,n,r){return t=Yi(22,t,r,e),t.elementType=qk,t.lanes=n,t.stateNode={isHidden:!1},t}function S_(t,e,n){return t=Yi(6,t,null,e),t.lanes=n,t}function E_(t,e,n){return e=Yi(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function $6(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=i_(0),this.expirationTimes=i_(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=i_(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function VM(t,e,n,r,i,o,a,s,l){return t=new $6(t,e,n,s,l),e===1?(e=1,o===!0&&(e|=8)):e=0,o=Yi(3,null,null,e),t.current=o,o.stateNode=t,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},AM(o),t}function z6(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(z3)}catch(t){console.error(t)}}z3(),zk.exports=Li;var Bc=zk.exports;const H3=dn(Bc);var V3,DR=Bc;V3=DR.createRoot,DR.hydrateRoot;/** * @remix-run/router v1.23.0 * * Copyright (c) Remix Software Inc. @@ -46,7 +46,7 @@ Error generating stack: `+o.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function gp(){return gp=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function H3(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function W6(){return Math.random().toString(36).substr(2,8)}function LR(t,e){return{usr:t.state,key:t.key,idx:e}}function rE(t,e,n,r){return n===void 0&&(n=null),gp({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?gf(e):e,{state:n,key:e&&e.key||r||W6()})}function V3(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function gf(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function X6(t,e,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,a=i.history,s=zs.Pop,l=null,c=u();c==null&&(c=0,a.replaceState(gp({},a.state,{idx:c}),""));function u(){return(a.state||{idx:null}).idx}function d(){s=zs.Pop;let g=u(),m=g==null?null:g-c;c=g,l&&l({action:s,location:v.location,delta:m})}function f(g,m){s=zs.Push;let x=rE(v.location,g,m);c=u()+1;let b=LR(x,c),S=v.createHref(x);try{a.pushState(b,"",S)}catch(w){if(w instanceof DOMException&&w.name==="DataCloneError")throw w;i.location.assign(S)}o&&l&&l({action:s,location:v.location,delta:1})}function p(g,m){s=zs.Replace;let x=rE(v.location,g,m);c=u();let b=LR(x,c),S=v.createHref(x);a.replaceState(b,"",S),o&&l&&l({action:s,location:v.location,delta:0})}function y(g){let m=i.location.origin!=="null"?i.location.origin:i.location.href,x=typeof g=="string"?g:V3(g);return x=x.replace(/ $/,"%20"),Jn(m,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,m)}let v={get action(){return s},get location(){return t(i,a)},listen(g){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(DR,d),l=g,()=>{i.removeEventListener(DR,d),l=null}},createHref(g){return e(i,g)},createURL:y,encodeLocation(g){let m=y(g);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:f,replace:p,go(g){return a.go(g)}};return v}var kR;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(kR||(kR={}));function q6(t,e,n){return n===void 0&&(n="/"),K6(t,e,n)}function K6(t,e,n,r){let i=typeof e=="string"?gf(e):e,o=X3(i.pathname||"/",n);if(o==null)return null;let a=G3(t);Y6(a);let s=null;for(let l=0;s==null&&l{let l={relativePath:s===void 0?o.path||"":s,caseSensitive:o.caseSensitive===!0,childrenIndex:a,route:o};l.relativePath.startsWith("/")&&(Jn(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let c=fc([r,l.relativePath]),u=n.concat(l);o.children&&o.children.length>0&&(Jn(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),G3(o.children,e,u,c)),!(o.path==null&&!o.index)&&e.push({path:c,score:rW(c,o.index),routesMeta:u})};return t.forEach((o,a)=>{var s;if(o.path===""||!((s=o.path)!=null&&s.includes("?")))i(o,a);else for(let l of W3(o.path))i(o,a,l)}),e}function W3(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let a=W3(r.join("/")),s=[];return s.push(...a.map(l=>l===""?o:[o,l].join("/"))),i&&s.push(...a),s.map(l=>t.startsWith("/")&&l===""?"/":l)}function Y6(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:iW(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const J6=/^:[\w-]+$/,Z6=3,Q6=2,eW=1,tW=10,nW=-2,jR=t=>t==="*";function rW(t,e){let n=t.split("/"),r=n.length;return n.some(jR)&&(r+=nW),e&&(r+=Q6),n.filter(i=>!jR(i)).reduce((i,o)=>i+(J6.test(o)?Z6:o===""?eW:tW),r)}function iW(t,e){return t.length===e.length&&t.slice(0,-1).every((r,i)=>r===e[i])?t[t.length-1]-e[e.length-1]:0}function oW(t,e,n){let{routesMeta:r}=t,i={},o="/",a=[];for(let s=0;s{let{paramName:f,isOptional:p}=u;if(f==="*"){let v=s[d]||"";a=o.slice(0,o.length-v.length).replace(/(.)\/+$/,"$1")}const y=s[d];return p&&!y?c[f]=void 0:c[f]=(y||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:a,pattern:t}}function sW(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),H3(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,s,l)=>(r.push({paramName:s,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function lW(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return H3(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function X3(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function cW(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:i=""}=typeof t=="string"?gf(t):t;return{pathname:n?n.startsWith("/")?n:uW(n,e):e,search:mW(r),hash:gW(i)}}function uW(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function T_(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function dW(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function fW(t,e){let n=dW(t);return e?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function hW(t,e,n,r){r===void 0&&(r=!1);let i;typeof t=="string"?i=gf(t):(i=gp({},t),Jn(!i.pathname||!i.pathname.includes("?"),T_("?","pathname","search",i)),Jn(!i.pathname||!i.pathname.includes("#"),T_("#","pathname","hash",i)),Jn(!i.search||!i.search.includes("#"),T_("#","search","hash",i)));let o=t===""||i.pathname==="",a=o?"/":i.pathname,s;if(a==null)s=n;else{let d=e.length-1;if(!r&&a.startsWith("..")){let f=a.split("/");for(;f[0]==="..";)f.shift(),d-=1;i.pathname=f.join("/")}s=d>=0?e[d]:"/"}let l=cW(i,s),c=a&&a!=="/"&&a.endsWith("/"),u=(o||a===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}const fc=t=>t.join("/").replace(/\/\/+/g,"/"),pW=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),mW=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,gW=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function vW(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const q3=["post","put","patch","delete"];new Set(q3);const yW=["get",...q3];new Set(yW);/** + */function gp(){return gp=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function G3(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function q6(){return Math.random().toString(36).substr(2,8)}function kR(t,e){return{usr:t.state,key:t.key,idx:e}}function rE(t,e,n,r){return n===void 0&&(n=null),gp({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?gf(e):e,{state:n,key:e&&e.key||r||q6()})}function W3(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function gf(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function K6(t,e,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,a=i.history,s=zs.Pop,l=null,c=u();c==null&&(c=0,a.replaceState(gp({},a.state,{idx:c}),""));function u(){return(a.state||{idx:null}).idx}function d(){s=zs.Pop;let g=u(),m=g==null?null:g-c;c=g,l&&l({action:s,location:v.location,delta:m})}function f(g,m){s=zs.Push;let x=rE(v.location,g,m);c=u()+1;let b=kR(x,c),S=v.createHref(x);try{a.pushState(b,"",S)}catch(w){if(w instanceof DOMException&&w.name==="DataCloneError")throw w;i.location.assign(S)}o&&l&&l({action:s,location:v.location,delta:1})}function p(g,m){s=zs.Replace;let x=rE(v.location,g,m);c=u();let b=kR(x,c),S=v.createHref(x);a.replaceState(b,"",S),o&&l&&l({action:s,location:v.location,delta:0})}function y(g){let m=i.location.origin!=="null"?i.location.origin:i.location.href,x=typeof g=="string"?g:W3(g);return x=x.replace(/ $/,"%20"),Jn(m,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,m)}let v={get action(){return s},get location(){return t(i,a)},listen(g){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(LR,d),l=g,()=>{i.removeEventListener(LR,d),l=null}},createHref(g){return e(i,g)},createURL:y,encodeLocation(g){let m=y(g);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:f,replace:p,go(g){return a.go(g)}};return v}var jR;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(jR||(jR={}));function Y6(t,e,n){return n===void 0&&(n="/"),J6(t,e,n)}function J6(t,e,n,r){let i=typeof e=="string"?gf(e):e,o=K3(i.pathname||"/",n);if(o==null)return null;let a=X3(t);Z6(a);let s=null;for(let l=0;s==null&&l{let l={relativePath:s===void 0?o.path||"":s,caseSensitive:o.caseSensitive===!0,childrenIndex:a,route:o};l.relativePath.startsWith("/")&&(Jn(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let c=fc([r,l.relativePath]),u=n.concat(l);o.children&&o.children.length>0&&(Jn(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),X3(o.children,e,u,c)),!(o.path==null&&!o.index)&&e.push({path:c,score:oW(c,o.index),routesMeta:u})};return t.forEach((o,a)=>{var s;if(o.path===""||!((s=o.path)!=null&&s.includes("?")))i(o,a);else for(let l of q3(o.path))i(o,a,l)}),e}function q3(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let a=q3(r.join("/")),s=[];return s.push(...a.map(l=>l===""?o:[o,l].join("/"))),i&&s.push(...a),s.map(l=>t.startsWith("/")&&l===""?"/":l)}function Z6(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:aW(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Q6=/^:[\w-]+$/,eW=3,tW=2,nW=1,rW=10,iW=-2,UR=t=>t==="*";function oW(t,e){let n=t.split("/"),r=n.length;return n.some(UR)&&(r+=iW),e&&(r+=tW),n.filter(i=>!UR(i)).reduce((i,o)=>i+(Q6.test(o)?eW:o===""?nW:rW),r)}function aW(t,e){return t.length===e.length&&t.slice(0,-1).every((r,i)=>r===e[i])?t[t.length-1]-e[e.length-1]:0}function sW(t,e,n){let{routesMeta:r}=t,i={},o="/",a=[];for(let s=0;s{let{paramName:f,isOptional:p}=u;if(f==="*"){let v=s[d]||"";a=o.slice(0,o.length-v.length).replace(/(.)\/+$/,"$1")}const y=s[d];return p&&!y?c[f]=void 0:c[f]=(y||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:a,pattern:t}}function cW(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),G3(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,s,l)=>(r.push({paramName:s,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function uW(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return G3(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function K3(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function dW(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:i=""}=typeof t=="string"?gf(t):t;return{pathname:n?n.startsWith("/")?n:fW(n,e):e,search:vW(r),hash:yW(i)}}function fW(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function T_(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function hW(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function pW(t,e){let n=hW(t);return e?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function mW(t,e,n,r){r===void 0&&(r=!1);let i;typeof t=="string"?i=gf(t):(i=gp({},t),Jn(!i.pathname||!i.pathname.includes("?"),T_("?","pathname","search",i)),Jn(!i.pathname||!i.pathname.includes("#"),T_("#","pathname","hash",i)),Jn(!i.search||!i.search.includes("#"),T_("#","search","hash",i)));let o=t===""||i.pathname==="",a=o?"/":i.pathname,s;if(a==null)s=n;else{let d=e.length-1;if(!r&&a.startsWith("..")){let f=a.split("/");for(;f[0]==="..";)f.shift(),d-=1;i.pathname=f.join("/")}s=d>=0?e[d]:"/"}let l=dW(i,s),c=a&&a!=="/"&&a.endsWith("/"),u=(o||a===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}const fc=t=>t.join("/").replace(/\/\/+/g,"/"),gW=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),vW=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,yW=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function xW(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const Y3=["post","put","patch","delete"];new Set(Y3);const bW=["get",...Y3];new Set(bW);/** * React Router v6.30.1 * * Copyright (c) Remix Software Inc. @@ -55,7 +55,7 @@ Error generating stack: `+o.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function vp(){return vp=Object.assign?Object.assign.bind():function(t){for(var e=1;e{s.current=!0}),_.useCallback(function(c,u){if(u===void 0&&(u={}),!s.current)return;if(typeof c=="number"){r.go(c);return}let d=hW(c,JSON.parse(a),o,u.relative==="path");t==null&&e!=="/"&&(d.pathname=d.pathname==="/"?e:fc([e,d.pathname])),(u.replace?r.replace:r.push)(d,u.state,u)},[e,r,a,o,t])}function _W(){let{matches:t}=_.useContext($c),e=t[t.length-1];return e?e.params:{}}function wW(t,e){return SW(t,e)}function SW(t,e,n,r){ex()||Jn(!1);let{navigator:i}=_.useContext(Z0),{matches:o}=_.useContext($c),a=o[o.length-1],s=a?a.params:{};a&&a.pathname;let l=a?a.pathnameBase:"/";a&&a.route;let c=yl(),u;if(e){var d;let g=typeof e=="string"?gf(e):e;l==="/"||(d=g.pathname)!=null&&d.startsWith(l)||Jn(!1),u=g}else u=c;let f=u.pathname||"/",p=f;if(l!=="/"){let g=l.replace(/^\//,"").split("/");p="/"+f.replace(/^\//,"").split("/").slice(g.length).join("/")}let y=q6(t,{pathname:p}),v=CW(y&&y.map(g=>Object.assign({},g,{params:Object.assign({},s,g.params),pathname:fc([l,i.encodeLocation?i.encodeLocation(g.pathname).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?l:fc([l,i.encodeLocation?i.encodeLocation(g.pathnameBase).pathname:g.pathnameBase])})),o,n,r);return e&&v?_.createElement(Q0.Provider,{value:{location:vp({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:zs.Pop}},v):v}function EW(){let t=OW(),e=vW(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return _.createElement(_.Fragment,null,_.createElement("h2",null,"Unexpected Application Error!"),_.createElement("h3",{style:{fontStyle:"italic"}},e),n?_.createElement("pre",{style:i},n):null,null)}const TW=_.createElement(EW,null);class MW extends _.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?_.createElement($c.Provider,{value:this.props.routeContext},_.createElement(K3.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function AW(t){let{routeContext:e,match:n,children:r}=t,i=_.useContext(qM);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),_.createElement($c.Provider,{value:e},r)}function CW(t,e,n,r){var i;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var o;if(!n)return null;if(n.errors)t=n.matches;else if((o=r)!=null&&o.v7_partialHydration&&e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let a=t,s=(i=n)==null?void 0:i.errors;if(s!=null){let u=a.findIndex(d=>d.route.id&&(s==null?void 0:s[d.route.id])!==void 0);u>=0||Jn(!1),a=a.slice(0,Math.min(a.length,u+1))}let l=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let u=0;u=0?a=a.slice(0,c+1):a=[a[0]];break}}}return a.reduceRight((u,d,f)=>{let p,y=!1,v=null,g=null;n&&(p=s&&d.route.id?s[d.route.id]:void 0,v=d.route.errorElement||TW,l&&(c<0&&f===0?(DW("route-fallback"),y=!0,g=null):c===f&&(y=!0,g=d.route.hydrateFallbackElement||null)));let m=e.concat(a.slice(0,f+1)),x=()=>{let b;return p?b=v:y?b=g:d.route.Component?b=_.createElement(d.route.Component,null):d.route.element?b=d.route.element:b=u,_.createElement(AW,{match:d,routeContext:{outlet:u,matches:m,isDataRoute:n!=null},children:b})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?_.createElement(MW,{location:n.location,revalidation:n.revalidation,component:v,error:p,children:x(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):x()},null)}var J3=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(J3||{}),Z3=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(Z3||{});function PW(t){let e=_.useContext(qM);return e||Jn(!1),e}function RW(t){let e=_.useContext(xW);return e||Jn(!1),e}function NW(t){let e=_.useContext($c);return e||Jn(!1),e}function Q3(t){let e=NW(),n=e.matches[e.matches.length-1];return n.route.id||Jn(!1),n.route.id}function OW(){var t;let e=_.useContext(K3),n=RW(),r=Q3();return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function IW(){let{router:t}=PW(J3.UseNavigateStable),e=Q3(Z3.UseNavigateStable),n=_.useRef(!1);return Y3(()=>{n.current=!0}),_.useCallback(function(i,o){o===void 0&&(o={}),n.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,vp({fromRouteId:e},o)))},[t,e])}const UR={};function DW(t,e,n){UR[t]||(UR[t]=!0)}function LW(t,e){t==null||t.v7_startTransition,t==null||t.v7_relativeSplatPath}function go(t){Jn(!1)}function kW(t){let{basename:e="/",children:n=null,location:r,navigationType:i=zs.Pop,navigator:o,static:a=!1,future:s}=t;ex()&&Jn(!1);let l=e.replace(/^\/*/,"/"),c=_.useMemo(()=>({basename:l,navigator:o,static:a,future:vp({v7_relativeSplatPath:!1},s)}),[l,s,o,a]);typeof r=="string"&&(r=gf(r));let{pathname:u="/",search:d="",hash:f="",state:p=null,key:y="default"}=r,v=_.useMemo(()=>{let g=X3(u,l);return g==null?null:{location:{pathname:g,search:d,hash:f,state:p,key:y},navigationType:i}},[l,u,d,f,p,y,i]);return v==null?null:_.createElement(Z0.Provider,{value:c},_.createElement(Q0.Provider,{children:n,value:v}))}function jW(t){let{children:e,location:n}=t;return wW(iE(e),n)}new Promise(()=>{});function iE(t,e){e===void 0&&(e=[]);let n=[];return _.Children.forEach(t,(r,i)=>{if(!_.isValidElement(r))return;let o=[...e,i];if(r.type===_.Fragment){n.push.apply(n,iE(r.props.children,o));return}r.type!==go&&Jn(!1),!r.props.index||!r.props.children||Jn(!1);let a={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(a.children=iE(r.props.children,o)),n.push(a)}),n}/** + */function vp(){return vp=Object.assign?Object.assign.bind():function(t){for(var e=1;e{s.current=!0}),_.useCallback(function(c,u){if(u===void 0&&(u={}),!s.current)return;if(typeof c=="number"){r.go(c);return}let d=mW(c,JSON.parse(a),o,u.relative==="path");t==null&&e!=="/"&&(d.pathname=d.pathname==="/"?e:fc([e,d.pathname])),(u.replace?r.replace:r.push)(d,u.state,u)},[e,r,a,o,t])}function SW(){let{matches:t}=_.useContext($c),e=t[t.length-1];return e?e.params:{}}function EW(t,e){return TW(t,e)}function TW(t,e,n,r){ex()||Jn(!1);let{navigator:i}=_.useContext(Z0),{matches:o}=_.useContext($c),a=o[o.length-1],s=a?a.params:{};a&&a.pathname;let l=a?a.pathnameBase:"/";a&&a.route;let c=yl(),u;if(e){var d;let g=typeof e=="string"?gf(e):e;l==="/"||(d=g.pathname)!=null&&d.startsWith(l)||Jn(!1),u=g}else u=c;let f=u.pathname||"/",p=f;if(l!=="/"){let g=l.replace(/^\//,"").split("/");p="/"+f.replace(/^\//,"").split("/").slice(g.length).join("/")}let y=Y6(t,{pathname:p}),v=RW(y&&y.map(g=>Object.assign({},g,{params:Object.assign({},s,g.params),pathname:fc([l,i.encodeLocation?i.encodeLocation(g.pathname).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?l:fc([l,i.encodeLocation?i.encodeLocation(g.pathnameBase).pathname:g.pathnameBase])})),o,n,r);return e&&v?_.createElement(Q0.Provider,{value:{location:vp({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:zs.Pop}},v):v}function MW(){let t=DW(),e=xW(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return _.createElement(_.Fragment,null,_.createElement("h2",null,"Unexpected Application Error!"),_.createElement("h3",{style:{fontStyle:"italic"}},e),n?_.createElement("pre",{style:i},n):null,null)}const AW=_.createElement(MW,null);class CW extends _.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?_.createElement($c.Provider,{value:this.props.routeContext},_.createElement(J3.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function PW(t){let{routeContext:e,match:n,children:r}=t,i=_.useContext(qM);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),_.createElement($c.Provider,{value:e},r)}function RW(t,e,n,r){var i;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var o;if(!n)return null;if(n.errors)t=n.matches;else if((o=r)!=null&&o.v7_partialHydration&&e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let a=t,s=(i=n)==null?void 0:i.errors;if(s!=null){let u=a.findIndex(d=>d.route.id&&(s==null?void 0:s[d.route.id])!==void 0);u>=0||Jn(!1),a=a.slice(0,Math.min(a.length,u+1))}let l=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let u=0;u=0?a=a.slice(0,c+1):a=[a[0]];break}}}return a.reduceRight((u,d,f)=>{let p,y=!1,v=null,g=null;n&&(p=s&&d.route.id?s[d.route.id]:void 0,v=d.route.errorElement||AW,l&&(c<0&&f===0?(kW("route-fallback"),y=!0,g=null):c===f&&(y=!0,g=d.route.hydrateFallbackElement||null)));let m=e.concat(a.slice(0,f+1)),x=()=>{let b;return p?b=v:y?b=g:d.route.Component?b=_.createElement(d.route.Component,null):d.route.element?b=d.route.element:b=u,_.createElement(PW,{match:d,routeContext:{outlet:u,matches:m,isDataRoute:n!=null},children:b})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?_.createElement(CW,{location:n.location,revalidation:n.revalidation,component:v,error:p,children:x(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):x()},null)}var Q3=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(Q3||{}),eU=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(eU||{});function NW(t){let e=_.useContext(qM);return e||Jn(!1),e}function OW(t){let e=_.useContext(_W);return e||Jn(!1),e}function IW(t){let e=_.useContext($c);return e||Jn(!1),e}function tU(t){let e=IW(),n=e.matches[e.matches.length-1];return n.route.id||Jn(!1),n.route.id}function DW(){var t;let e=_.useContext(J3),n=OW(),r=tU();return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function LW(){let{router:t}=NW(Q3.UseNavigateStable),e=tU(eU.UseNavigateStable),n=_.useRef(!1);return Z3(()=>{n.current=!0}),_.useCallback(function(i,o){o===void 0&&(o={}),n.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,vp({fromRouteId:e},o)))},[t,e])}const FR={};function kW(t,e,n){FR[t]||(FR[t]=!0)}function jW(t,e){t==null||t.v7_startTransition,t==null||t.v7_relativeSplatPath}function go(t){Jn(!1)}function UW(t){let{basename:e="/",children:n=null,location:r,navigationType:i=zs.Pop,navigator:o,static:a=!1,future:s}=t;ex()&&Jn(!1);let l=e.replace(/^\/*/,"/"),c=_.useMemo(()=>({basename:l,navigator:o,static:a,future:vp({v7_relativeSplatPath:!1},s)}),[l,s,o,a]);typeof r=="string"&&(r=gf(r));let{pathname:u="/",search:d="",hash:f="",state:p=null,key:y="default"}=r,v=_.useMemo(()=>{let g=K3(u,l);return g==null?null:{location:{pathname:g,search:d,hash:f,state:p,key:y},navigationType:i}},[l,u,d,f,p,y,i]);return v==null?null:_.createElement(Z0.Provider,{value:c},_.createElement(Q0.Provider,{children:n,value:v}))}function FW(t){let{children:e,location:n}=t;return EW(iE(e),n)}new Promise(()=>{});function iE(t,e){e===void 0&&(e=[]);let n=[];return _.Children.forEach(t,(r,i)=>{if(!_.isValidElement(r))return;let o=[...e,i];if(r.type===_.Fragment){n.push.apply(n,iE(r.props.children,o));return}r.type!==go&&Jn(!1),!r.props.index||!r.props.children||Jn(!1);let a={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(a.children=iE(r.props.children,o)),n.push(a)}),n}/** * React Router DOM v6.30.1 * * Copyright (c) Remix Software Inc. @@ -64,28 +64,28 @@ Error generating stack: `+o.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */const UW="6";try{window.__reactRouterVersion=UW}catch{}const FW="startTransition",FR=rM[FW];function BW(t){let{basename:e,children:n,future:r,window:i}=t,o=_.useRef();o.current==null&&(o.current=G6({window:i,v5Compat:!0}));let a=o.current,[s,l]=_.useState({action:a.action,location:a.location}),{v7_startTransition:c}=r||{},u=_.useCallback(d=>{c&&FR?FR(()=>l(d)):l(d)},[l,c]);return _.useLayoutEffect(()=>a.listen(u),[a,u]),_.useEffect(()=>LW(r),[r]),_.createElement(kW,{basename:e,children:n,location:s.location,navigationType:s.action,navigator:a,future:r})}var BR;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(BR||(BR={}));var $R;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})($R||($R={}));var tx=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(){}},nx=typeof window>"u"||"Deno"in globalThis;function xo(){}function $W(t,e){return typeof t=="function"?t(e):t}function zW(t){return typeof t=="number"&&t>=0&&t!==1/0}function HW(t,e){return Math.max(t+(e||0)-Date.now(),0)}function oE(t,e){return typeof t=="function"?t(e):t}function VW(t,e){return typeof t=="function"?t(e):t}function zR(t,e){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:a,stale:s}=t;if(a){if(r){if(e.queryHash!==KM(a,e.options))return!1}else if(!xp(e.queryKey,a))return!1}if(n!=="all"){const l=e.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof s=="boolean"&&e.isStale()!==s||i&&i!==e.state.fetchStatus||o&&!o(e))}function HR(t,e){const{exact:n,status:r,predicate:i,mutationKey:o}=t;if(o){if(!e.options.mutationKey)return!1;if(n){if(yp(e.options.mutationKey)!==yp(o))return!1}else if(!xp(e.options.mutationKey,o))return!1}return!(r&&e.state.status!==r||i&&!i(e))}function KM(t,e){return((e==null?void 0:e.queryKeyHashFn)||yp)(t)}function yp(t){return JSON.stringify(t,(e,n)=>aE(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function xp(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>xp(t[n],e[n])):!1}function eU(t,e){if(t===e)return t;const n=VR(t)&&VR(e);if(n||aE(t)&&aE(e)){const r=n?t:Object.keys(t),i=r.length,o=n?e:Object.keys(e),a=o.length,s=n?[]:{},l=new Set(r);let c=0;for(let u=0;u{setTimeout(e,t)})}function WW(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?eU(t,e):e}function XW(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function qW(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var YM=Symbol();function tU(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===YM?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var oc,Ls,gd,_k,KW=(_k=class extends tx{constructor(){super();Xt(this,oc);Xt(this,Ls);Xt(this,gd);Ct(this,gd,e=>{if(!nx&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){xe(this,Ls)||this.setEventListener(xe(this,gd))}onUnsubscribe(){var e;this.hasListeners()||((e=xe(this,Ls))==null||e.call(this),Ct(this,Ls,void 0))}setEventListener(e){var n;Ct(this,gd,e),(n=xe(this,Ls))==null||n.call(this),Ct(this,Ls,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){xe(this,oc)!==e&&(Ct(this,oc,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof xe(this,oc)=="boolean"?xe(this,oc):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},oc=new WeakMap,Ls=new WeakMap,gd=new WeakMap,_k),nU=new KW,vd,ks,yd,wk,YW=(wk=class extends tx{constructor(){super();Xt(this,vd,!0);Xt(this,ks);Xt(this,yd);Ct(this,yd,e=>{if(!nx&&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(){xe(this,ks)||this.setEventListener(xe(this,yd))}onUnsubscribe(){var e;this.hasListeners()||((e=xe(this,ks))==null||e.call(this),Ct(this,ks,void 0))}setEventListener(e){var n;Ct(this,yd,e),(n=xe(this,ks))==null||n.call(this),Ct(this,ks,e(this.setOnline.bind(this)))}setOnline(e){xe(this,vd)!==e&&(Ct(this,vd,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return xe(this,vd)}},vd=new WeakMap,ks=new WeakMap,yd=new WeakMap,wk),xy=new YW;function JW(){let t,e;const n=new Promise((i,o)=>{t=i,e=o});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 ZW(t){return Math.min(1e3*2**t,3e4)}function rU(t){return(t??"online")==="online"?xy.isOnline():!0}var iU=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function M_(t){return t instanceof iU}function oU(t){let e=!1,n=0,r=!1,i;const o=JW(),a=v=>{var g;r||(f(new iU(v)),(g=t.abort)==null||g.call(t))},s=()=>{e=!0},l=()=>{e=!1},c=()=>nU.isFocused()&&(t.networkMode==="always"||xy.isOnline())&&t.canRun(),u=()=>rU(t.networkMode)&&t.canRun(),d=v=>{var g;r||(r=!0,(g=t.onSuccess)==null||g.call(t,v),i==null||i(),o.resolve(v))},f=v=>{var g;r||(r=!0,(g=t.onError)==null||g.call(t,v),i==null||i(),o.reject(v))},p=()=>new Promise(v=>{var g;i=m=>{(r||c())&&v(m)},(g=t.onPause)==null||g.call(t)}).then(()=>{var v;i=void 0,r||(v=t.onContinue)==null||v.call(t)}),y=()=>{if(r)return;let v;const g=n===0?t.initialPromise:void 0;try{v=g??t.fn()}catch(m){v=Promise.reject(m)}Promise.resolve(v).then(d).catch(m=>{var E;if(r)return;const x=t.retry??(nx?0:3),b=t.retryDelay??ZW,S=typeof b=="function"?b(n,m):b,w=x===!0||typeof x=="number"&&nc()?void 0:p()).then(()=>{e?f(m):y()})})};return{promise:o,cancel:a,continue:()=>(i==null||i(),o),cancelRetry:s,continueRetry:l,canStart:u,start:()=>(u()?y():p().then(y),o)}}var QW=t=>setTimeout(t,0);function e9(){let t=[],e=0,n=s=>{s()},r=s=>{s()},i=QW;const o=s=>{e?t.push(s):i(()=>{n(s)})},a=()=>{const s=t;t=[],s.length&&i(()=>{r(()=>{s.forEach(l=>{n(l)})})})};return{batch:s=>{let l;e++;try{l=s()}finally{e--,e||a()}return l},batchCalls:s=>(...l)=>{o(()=>{s(...l)})},schedule:o,setNotifyFunction:s=>{n=s},setBatchNotifyFunction:s=>{r=s},setScheduler:s=>{i=s}}}var zr=e9(),ac,Sk,aU=(Sk=class{constructor(){Xt(this,ac)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),zW(this.gcTime)&&Ct(this,ac,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(nx?1/0:5*60*1e3))}clearGcTimeout(){xe(this,ac)&&(clearTimeout(xe(this,ac)),Ct(this,ac,void 0))}},ac=new WeakMap,Sk),xd,bd,Gi,sc,Cr,gm,lc,bo,ka,Ek,t9=(Ek=class extends aU{constructor(e){super();Xt(this,bo);Xt(this,xd);Xt(this,bd);Xt(this,Gi);Xt(this,sc);Xt(this,Cr);Xt(this,gm);Xt(this,lc);Ct(this,lc,!1),Ct(this,gm,e.defaultOptions),this.setOptions(e.options),this.observers=[],Ct(this,sc,e.client),Ct(this,Gi,xe(this,sc).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Ct(this,xd,r9(this.options)),this.state=e.state??xe(this,xd),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=xe(this,Cr))==null?void 0:e.promise}setOptions(e){this.options={...xe(this,gm),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&xe(this,Gi).remove(this)}setData(e,n){const r=WW(this.state.data,e,this.options);return Sr(this,bo,ka).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){Sr(this,bo,ka).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var r,i;const n=(r=xe(this,Cr))==null?void 0:r.promise;return(i=xe(this,Cr))==null||i.cancel(e),n?n.then(xo).catch(xo):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(xe(this,xd))}isActive(){return this.observers.some(e=>VW(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===YM||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>oE(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!HW(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=xe(this,Cr))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=xe(this,Cr))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),xe(this,Gi).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(xe(this,Cr)&&(xe(this,lc)?xe(this,Cr).cancel({revert:!0}):xe(this,Cr).cancelRetry()),this.scheduleGc()),xe(this,Gi).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Sr(this,bo,ka).call(this,{type:"invalidate"})}fetch(e,n){var c,u,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(xe(this,Cr))return xe(this,Cr).continueRetry(),xe(this,Cr).promise}if(e&&this.setOptions(e),!this.options.queryFn){const f=this.observers.find(p=>p.options.queryFn);f&&this.setOptions(f.options)}const r=new AbortController,i=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(Ct(this,lc,!0),r.signal)})},o=()=>{const f=tU(this.options,n),y=(()=>{const v={client:xe(this,sc),queryKey:this.queryKey,meta:this.meta};return i(v),v})();return Ct(this,lc,!1),this.options.persister?this.options.persister(f,y,this):f(y)},s=(()=>{const f={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:xe(this,sc),state:this.state,fetchFn:o};return i(f),f})();(c=this.options.behavior)==null||c.onFetch(s,this),Ct(this,bd,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=s.fetchOptions)==null?void 0:u.meta))&&Sr(this,bo,ka).call(this,{type:"fetch",meta:(d=s.fetchOptions)==null?void 0:d.meta});const l=f=>{var p,y,v,g;M_(f)&&f.silent||Sr(this,bo,ka).call(this,{type:"error",error:f}),M_(f)||((y=(p=xe(this,Gi).config).onError)==null||y.call(p,f,this),(g=(v=xe(this,Gi).config).onSettled)==null||g.call(v,this.state.data,f,this)),this.scheduleGc()};return Ct(this,Cr,oU({initialPromise:n==null?void 0:n.initialPromise,fn:s.fetchFn,abort:r.abort.bind(r),onSuccess:f=>{var p,y,v,g;if(f===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(m){l(m);return}(y=(p=xe(this,Gi).config).onSuccess)==null||y.call(p,f,this),(g=(v=xe(this,Gi).config).onSettled)==null||g.call(v,f,this.state.error,this),this.scheduleGc()},onError:l,onFail:(f,p)=>{Sr(this,bo,ka).call(this,{type:"failed",failureCount:f,error:p})},onPause:()=>{Sr(this,bo,ka).call(this,{type:"pause"})},onContinue:()=>{Sr(this,bo,ka).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0})),xe(this,Cr).start()}},xd=new WeakMap,bd=new WeakMap,Gi=new WeakMap,sc=new WeakMap,Cr=new WeakMap,gm=new WeakMap,lc=new WeakMap,bo=new WeakSet,ka=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,...n9(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 M_(i)&&i.revert&&xe(this,bd)?{...xe(this,bd),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),zr.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),xe(this,Gi).notify({query:this,type:"updated",action:e})})},Ek);function n9(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:rU(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function r9(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 Qo,Tk,i9=(Tk=class extends tx{constructor(e={}){super();Xt(this,Qo);this.config=e,Ct(this,Qo,new Map)}build(e,n,r){const i=n.queryKey,o=n.queryHash??KM(i,n);let a=this.get(o);return a||(a=new t9({client:e,queryKey:i,queryHash:o,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(a)),a}add(e){xe(this,Qo).has(e.queryHash)||(xe(this,Qo).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=xe(this,Qo).get(e.queryHash);n&&(e.destroy(),n===e&&xe(this,Qo).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){zr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return xe(this,Qo).get(e)}getAll(){return[...xe(this,Qo).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>zR(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>zR(e,r)):n}notify(e){zr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){zr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){zr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Qo=new WeakMap,Tk),ea,Br,cc,ta,As,Mk,o9=(Mk=class extends aU{constructor(e){super();Xt(this,ta);Xt(this,ea);Xt(this,Br);Xt(this,cc);this.mutationId=e.mutationId,Ct(this,Br,e.mutationCache),Ct(this,ea,[]),this.state=e.state||a9(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){xe(this,ea).includes(e)||(xe(this,ea).push(e),this.clearGcTimeout(),xe(this,Br).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Ct(this,ea,xe(this,ea).filter(n=>n!==e)),this.scheduleGc(),xe(this,Br).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){xe(this,ea).length||(this.state.status==="pending"?this.scheduleGc():xe(this,Br).remove(this))}continue(){var e;return((e=xe(this,cc))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var o,a,s,l,c,u,d,f,p,y,v,g,m,x,b,S,w,E,T,A;const n=()=>{Sr(this,ta,As).call(this,{type:"continue"})};Ct(this,cc,oU({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(M,C)=>{Sr(this,ta,As).call(this,{type:"failed",failureCount:M,error:C})},onPause:()=>{Sr(this,ta,As).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>xe(this,Br).canRun(this)}));const r=this.state.status==="pending",i=!xe(this,cc).canStart();try{if(r)n();else{Sr(this,ta,As).call(this,{type:"pending",variables:e,isPaused:i}),await((a=(o=xe(this,Br).config).onMutate)==null?void 0:a.call(o,e,this));const C=await((l=(s=this.options).onMutate)==null?void 0:l.call(s,e));C!==this.state.context&&Sr(this,ta,As).call(this,{type:"pending",context:C,variables:e,isPaused:i})}const M=await xe(this,cc).start();return await((u=(c=xe(this,Br).config).onSuccess)==null?void 0:u.call(c,M,e,this.state.context,this)),await((f=(d=this.options).onSuccess)==null?void 0:f.call(d,M,e,this.state.context)),await((y=(p=xe(this,Br).config).onSettled)==null?void 0:y.call(p,M,null,this.state.variables,this.state.context,this)),await((g=(v=this.options).onSettled)==null?void 0:g.call(v,M,null,e,this.state.context)),Sr(this,ta,As).call(this,{type:"success",data:M}),M}catch(M){try{throw await((x=(m=xe(this,Br).config).onError)==null?void 0:x.call(m,M,e,this.state.context,this)),await((S=(b=this.options).onError)==null?void 0:S.call(b,M,e,this.state.context)),await((E=(w=xe(this,Br).config).onSettled)==null?void 0:E.call(w,void 0,M,this.state.variables,this.state.context,this)),await((A=(T=this.options).onSettled)==null?void 0:A.call(T,void 0,M,e,this.state.context)),M}finally{Sr(this,ta,As).call(this,{type:"error",error:M})}}finally{xe(this,Br).runNext(this)}}},ea=new WeakMap,Br=new WeakMap,cc=new WeakMap,ta=new WeakSet,As=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),zr.batch(()=>{xe(this,ea).forEach(r=>{r.onMutationUpdate(e)}),xe(this,Br).notify({mutation:this,type:"updated",action:e})})},Mk);function a9(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var za,_o,vm,Ak,s9=(Ak=class extends tx{constructor(e={}){super();Xt(this,za);Xt(this,_o);Xt(this,vm);this.config=e,Ct(this,za,new Set),Ct(this,_o,new Map),Ct(this,vm,0)}build(e,n,r){const i=new o9({mutationCache:this,mutationId:++Zm(this,vm)._,options:e.defaultMutationOptions(n),state:r});return this.add(i),i}add(e){xe(this,za).add(e);const n=vg(e);if(typeof n=="string"){const r=xe(this,_o).get(n);r?r.push(e):xe(this,_o).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(xe(this,za).delete(e)){const n=vg(e);if(typeof n=="string"){const r=xe(this,_o).get(n);if(r)if(r.length>1){const i=r.indexOf(e);i!==-1&&r.splice(i,1)}else r[0]===e&&xe(this,_o).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=vg(e);if(typeof n=="string"){const r=xe(this,_o).get(n),i=r==null?void 0:r.find(o=>o.state.status==="pending");return!i||i===e}else return!0}runNext(e){var r;const n=vg(e);if(typeof n=="string"){const i=(r=xe(this,_o).get(n))==null?void 0:r.find(o=>o!==e&&o.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){zr.batch(()=>{xe(this,za).forEach(e=>{this.notify({type:"removed",mutation:e})}),xe(this,za).clear(),xe(this,_o).clear()})}getAll(){return Array.from(xe(this,za))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>HR(n,r))}findAll(e={}){return this.getAll().filter(n=>HR(e,n))}notify(e){zr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return zr.batch(()=>Promise.all(e.map(n=>n.continue().catch(xo))))}},za=new WeakMap,_o=new WeakMap,vm=new WeakMap,Ak);function vg(t){var e;return(e=t.options.scope)==null?void 0:e.id}function WR(t){return{onFetch:(e,n)=>{var u,d,f,p,y;const r=e.options,i=(f=(d=(u=e.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,o=((p=e.state.data)==null?void 0:p.pages)||[],a=((y=e.state.data)==null?void 0:y.pageParams)||[];let s={pages:[],pageParams:[]},l=0;const c=async()=>{let v=!1;const g=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(e.signal.aborted?v=!0:e.signal.addEventListener("abort",()=>{v=!0}),e.signal)})},m=tU(e.options,e.fetchOptions),x=async(b,S,w)=>{if(v)return Promise.reject();if(S==null&&b.pages.length)return Promise.resolve(b);const T=(()=>{const P={client:e.client,queryKey:e.queryKey,pageParam:S,direction:w?"backward":"forward",meta:e.options.meta};return g(P),P})(),A=await m(T),{maxPages:M}=e.options,C=w?qW:XW;return{pages:C(b.pages,A,M),pageParams:C(b.pageParams,S,M)}};if(i&&o.length){const b=i==="backward",S=b?l9:XR,w={pages:o,pageParams:a},E=S(r,w);s=await x(w,E,b)}else{const b=t??o.length;do{const S=l===0?a[0]??r.initialPageParam:XR(r,s);if(l>0&&S==null)break;s=await x(s,S),l++}while(l{var v,g;return(g=(v=e.options).persister)==null?void 0:g.call(v,c,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=c}}}function XR(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 l9(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 Nn,js,Us,_d,wd,Fs,Sd,Ed,Ck,c9=(Ck=class{constructor(t={}){Xt(this,Nn);Xt(this,js);Xt(this,Us);Xt(this,_d);Xt(this,wd);Xt(this,Fs);Xt(this,Sd);Xt(this,Ed);Ct(this,Nn,t.queryCache||new i9),Ct(this,js,t.mutationCache||new s9),Ct(this,Us,t.defaultOptions||{}),Ct(this,_d,new Map),Ct(this,wd,new Map),Ct(this,Fs,0)}mount(){Zm(this,Fs)._++,xe(this,Fs)===1&&(Ct(this,Sd,nU.subscribe(async t=>{t&&(await this.resumePausedMutations(),xe(this,Nn).onFocus())})),Ct(this,Ed,xy.subscribe(async t=>{t&&(await this.resumePausedMutations(),xe(this,Nn).onOnline())})))}unmount(){var t,e;Zm(this,Fs)._--,xe(this,Fs)===0&&((t=xe(this,Sd))==null||t.call(this),Ct(this,Sd,void 0),(e=xe(this,Ed))==null||e.call(this),Ct(this,Ed,void 0))}isFetching(t){return xe(this,Nn).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return xe(this,js).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=xe(this,Nn).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=xe(this,Nn).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(oE(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return xe(this,Nn).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=xe(this,Nn).get(r.queryHash),o=i==null?void 0:i.state.data,a=$W(e,o);if(a!==void 0)return xe(this,Nn).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(t,e,n){return zr.batch(()=>xe(this,Nn).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=xe(this,Nn).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=xe(this,Nn);zr.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=xe(this,Nn);return zr.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=zr.batch(()=>xe(this,Nn).findAll(t).map(i=>i.cancel(n)));return Promise.all(r).then(xo).catch(xo)}invalidateQueries(t,e={}){return zr.batch(()=>(xe(this,Nn).findAll(t).forEach(n=>{n.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=zr.batch(()=>xe(this,Nn).findAll(t).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(xo)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(xo)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=xe(this,Nn).build(this,e);return n.isStaleByTime(oE(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(xo).catch(xo)}fetchInfiniteQuery(t){return t.behavior=WR(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(xo).catch(xo)}ensureInfiniteQueryData(t){return t.behavior=WR(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return xy.isOnline()?xe(this,js).resumePausedMutations():Promise.resolve()}getQueryCache(){return xe(this,Nn)}getMutationCache(){return xe(this,js)}getDefaultOptions(){return xe(this,Us)}setDefaultOptions(t){Ct(this,Us,t)}setQueryDefaults(t,e){xe(this,_d).set(yp(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...xe(this,_d).values()],n={};return e.forEach(r=>{xp(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){xe(this,wd).set(yp(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...xe(this,wd).values()],n={};return e.forEach(r=>{xp(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...xe(this,Us).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=KM(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===YM&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...xe(this,Us).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){xe(this,Nn).clear(),xe(this,js).clear()}},Nn=new WeakMap,js=new WeakMap,Us=new WeakMap,_d=new WeakMap,wd=new WeakMap,Fs=new WeakMap,Sd=new WeakMap,Ed=new WeakMap,Ck),u9=_.createContext(void 0),d9=({client:t,children:e})=>(_.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),h.jsx(u9.Provider,{value:t,children:e}));const f9={theme:"system",setTheme:()=>null},h9=_.createContext(f9);function p9({children:t,defaultTheme:e="system",storageKey:n="vite-ui-theme",...r}){const[i,o]=_.useState(()=>localStorage.getItem(n)||e);_.useEffect(()=>{const l=window.document.documentElement;if(l.classList.remove("light","dark"),i==="system"){const c=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";l.classList.add(c);return}l.classList.add(i)},[i]);const a=_.useCallback(l=>{localStorage.setItem(n,l),o(l)},[n]),s=_.useMemo(()=>({theme:i,setTheme:a}),[i,a]);return h.jsx(h9.Provider,{...r,value:s,children:t})}var m9=t=>{switch(t){case"success":return y9;case"info":return b9;case"warning":return x9;case"error":return _9;default:return null}},g9=Array(12).fill(0),v9=({visible:t,className:e})=>Z.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},Z.createElement("div",{className:"sonner-spinner"},g9.map((n,r)=>Z.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),y9=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Z.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),x9=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Z.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),b9=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Z.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),_9=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Z.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),w9=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},Z.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Z.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),S9=()=>{let[t,e]=Z.useState(document.hidden);return Z.useEffect(()=>{let n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t},sE=1,E9=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let e=this.subscribers.indexOf(t);this.subscribers.splice(e,1)}),this.publish=t=>{this.subscribers.forEach(e=>e(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var e;let{message:n,...r}=t,i=typeof(t==null?void 0:t.id)=="number"||((e=t.id)==null?void 0:e.length)>0?t.id:sE++,o=this.toasts.find(s=>s.id===i),a=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),o?this.toasts=this.toasts.map(s=>s.id===i?(this.publish({...s,...t,id:i,title:n}),{...s,...t,id:i,dismissible:a,title:n}):s):this.addToast({title:n,...r,dismissible:a,id:i}),i},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(e=>{this.subscribers.forEach(n=>n({id:e.id,dismiss:!0}))}),this.subscribers.forEach(e=>e({id:t,dismiss:!0})),t),this.message=(t,e)=>this.create({...e,message:t}),this.error=(t,e)=>this.create({...e,message:t,type:"error"}),this.success=(t,e)=>this.create({...e,type:"success",message:t}),this.info=(t,e)=>this.create({...e,type:"info",message:t}),this.warning=(t,e)=>this.create({...e,type:"warning",message:t}),this.loading=(t,e)=>this.create({...e,type:"loading",message:t}),this.promise=(t,e)=>{if(!e)return;let n;e.loading!==void 0&&(n=this.create({...e,promise:t,type:"loading",message:e.loading,description:typeof e.description!="function"?e.description:void 0}));let r=t instanceof Promise?t:t(),i=n!==void 0,o,a=r.then(async l=>{if(o=["resolve",l],Z.isValidElement(l))i=!1,this.create({id:n,type:"default",message:l});else if(M9(l)&&!l.ok){i=!1;let c=typeof e.error=="function"?await e.error(`HTTP error! status: ${l.status}`):e.error,u=typeof e.description=="function"?await e.description(`HTTP error! status: ${l.status}`):e.description;this.create({id:n,type:"error",message:c,description:u})}else if(e.success!==void 0){i=!1;let c=typeof e.success=="function"?await e.success(l):e.success,u=typeof e.description=="function"?await e.description(l):e.description;this.create({id:n,type:"success",message:c,description:u})}}).catch(async l=>{if(o=["reject",l],e.error!==void 0){i=!1;let c=typeof e.error=="function"?await e.error(l):e.error,u=typeof e.description=="function"?await e.description(l):e.description;this.create({id:n,type:"error",message:c,description:u})}}).finally(()=>{var l;i&&(this.dismiss(n),n=void 0),(l=e.finally)==null||l.call(e)}),s=()=>new Promise((l,c)=>a.then(()=>o[0]==="reject"?c(o[1]):l(o[1])).catch(c));return typeof n!="string"&&typeof n!="number"?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(t,e)=>{let n=(e==null?void 0:e.id)||sE++;return this.create({jsx:t(n),id:n,...e}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},ni=new E9,T9=(t,e)=>{let n=(e==null?void 0:e.id)||sE++;return ni.addToast({title:t,...e,id:n}),n},M9=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",A9=T9,C9=()=>ni.toasts,P9=()=>ni.getActiveToasts(),Ur=Object.assign(A9,{success:ni.success,info:ni.info,warning:ni.warning,error:ni.error,custom:ni.custom,message:ni.message,promise:ni.promise,dismiss:ni.dismiss,loading:ni.loading},{getHistory:C9,getToasts:P9});function R9(t,{insertAt:e}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}R9(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-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;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)} -`);function yg(t){return t.label!==void 0}var N9=3,O9="32px",I9="16px",qR=4e3,D9=356,L9=14,k9=20,j9=200;function uo(...t){return t.filter(Boolean).join(" ")}function U9(t){let[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}var F9=t=>{var e,n,r,i,o,a,s,l,c,u,d;let{invert:f,toast:p,unstyled:y,interacting:v,setHeights:g,visibleToasts:m,heights:x,index:b,toasts:S,expanded:w,removeToast:E,defaultRichColors:T,closeButton:A,style:M,cancelButtonStyle:C,actionButtonStyle:P,className:R="",descriptionClassName:D="",duration:k,position:U,gap:O,loadingIcon:W,expandByDefault:L,classNames:j,icons:X,closeButtonAriaLabel:K="Close toast",pauseWhenPageIsHidden:F}=t,[Y,q]=Z.useState(null),[ee,te]=Z.useState(null),[Q,ce]=Z.useState(!1),[ae,fe]=Z.useState(!1),[we,le]=Z.useState(!1),[ie,G]=Z.useState(!1),[Ve,Ne]=Z.useState(!1),[st,Re]=Z.useState(0),[ct,Ye]=Z.useState(0),it=Z.useRef(p.duration||k||qR),Ft=Z.useRef(null),J=Z.useRef(null),B=b===0,ue=b+1<=m,me=p.type,be=p.dismissible!==!1,ge=p.className||"",rt=p.descriptionClassName||"",Ie=Z.useMemo(()=>x.findIndex(Se=>Se.toastId===p.id)||0,[x,p.id]),Je=Z.useMemo(()=>{var Se;return(Se=p.closeButton)!=null?Se:A},[p.closeButton,A]),tt=Z.useMemo(()=>p.duration||k||qR,[p.duration,k]),Ee=Z.useRef(0),Be=Z.useRef(0),ht=Z.useRef(0),ot=Z.useRef(null),[Le,_t]=U.split("-"),re=Z.useMemo(()=>x.reduce((Se,je,vt)=>vt>=Ie?Se:Se+je.height,0),[x,Ie]),ke=S9(),Me=p.invert||f,Ge=me==="loading";Be.current=Z.useMemo(()=>Ie*O+re,[Ie,re]),Z.useEffect(()=>{it.current=tt},[tt]),Z.useEffect(()=>{ce(!0)},[]),Z.useEffect(()=>{let Se=J.current;if(Se){let je=Se.getBoundingClientRect().height;return Ye(je),g(vt=>[{toastId:p.id,height:je,position:p.position},...vt]),()=>g(vt=>vt.filter(pt=>pt.toastId!==p.id))}},[g,p.id]),Z.useLayoutEffect(()=>{if(!Q)return;let Se=J.current,je=Se.style.height;Se.style.height="auto";let vt=Se.getBoundingClientRect().height;Se.style.height=je,Ye(vt),g(pt=>pt.find(fn=>fn.toastId===p.id)?pt.map(fn=>fn.toastId===p.id?{...fn,height:vt}:fn):[{toastId:p.id,height:vt,position:p.position},...pt])},[Q,p.title,p.description,g,p.id]);let Te=Z.useCallback(()=>{fe(!0),Re(Be.current),g(Se=>Se.filter(je=>je.toastId!==p.id)),setTimeout(()=>{E(p)},j9)},[p,E,g,Be]);Z.useEffect(()=>{if(p.promise&&me==="loading"||p.duration===1/0||p.type==="loading")return;let Se;return w||v||F&&ke?(()=>{if(ht.current{var je;(je=p.onAutoClose)==null||je.call(p,p),Te()},it.current)),()=>clearTimeout(Se)},[w,v,p,me,F,ke,Te]),Z.useEffect(()=>{p.delete&&Te()},[Te,p.delete]);function _e(){var Se,je,vt;return X!=null&&X.loading?Z.createElement("div",{className:uo(j==null?void 0:j.loader,(Se=p==null?void 0:p.classNames)==null?void 0:Se.loader,"sonner-loader"),"data-visible":me==="loading"},X.loading):W?Z.createElement("div",{className:uo(j==null?void 0:j.loader,(je=p==null?void 0:p.classNames)==null?void 0:je.loader,"sonner-loader"),"data-visible":me==="loading"},W):Z.createElement(v9,{className:uo(j==null?void 0:j.loader,(vt=p==null?void 0:p.classNames)==null?void 0:vt.loader),visible:me==="loading"})}return Z.createElement("li",{tabIndex:0,ref:J,className:uo(R,ge,j==null?void 0:j.toast,(e=p==null?void 0:p.classNames)==null?void 0:e.toast,j==null?void 0:j.default,j==null?void 0:j[me],(n=p==null?void 0:p.classNames)==null?void 0:n[me]),"data-sonner-toast":"","data-rich-colors":(r=p.richColors)!=null?r:T,"data-styled":!(p.jsx||p.unstyled||y),"data-mounted":Q,"data-promise":!!p.promise,"data-swiped":Ve,"data-removed":ae,"data-visible":ue,"data-y-position":Le,"data-x-position":_t,"data-index":b,"data-front":B,"data-swiping":we,"data-dismissible":be,"data-type":me,"data-invert":Me,"data-swipe-out":ie,"data-swipe-direction":ee,"data-expanded":!!(w||L&&Q),style:{"--index":b,"--toasts-before":b,"--z-index":S.length-b,"--offset":`${ae?st:Be.current}px`,"--initial-height":L?"auto":`${ct}px`,...M,...p.style},onDragEnd:()=>{le(!1),q(null),ot.current=null},onPointerDown:Se=>{Ge||!be||(Ft.current=new Date,Re(Be.current),Se.target.setPointerCapture(Se.pointerId),Se.target.tagName!=="BUTTON"&&(le(!0),ot.current={x:Se.clientX,y:Se.clientY}))},onPointerUp:()=>{var Se,je,vt,pt;if(ie||!be)return;ot.current=null;let fn=Number(((Se=J.current)==null?void 0:Se.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),jn=Number(((je=J.current)==null?void 0:je.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ui=new Date().getTime()-((vt=Ft.current)==null?void 0:vt.getTime()),_r=Y==="x"?fn:jn,nr=Math.abs(_r)/Ui;if(Math.abs(_r)>=k9||nr>.11){Re(Be.current),(pt=p.onDismiss)==null||pt.call(p,p),te(Y==="x"?fn>0?"right":"left":jn>0?"down":"up"),Te(),G(!0),Ne(!1);return}le(!1),q(null)},onPointerMove:Se=>{var je,vt,pt,fn;if(!ot.current||!be||((je=window.getSelection())==null?void 0:je.toString().length)>0)return;let jn=Se.clientY-ot.current.y,Ui=Se.clientX-ot.current.x,_r=(vt=t.swipeDirections)!=null?vt:U9(U);!Y&&(Math.abs(Ui)>1||Math.abs(jn)>1)&&q(Math.abs(Ui)>Math.abs(jn)?"x":"y");let nr={x:0,y:0};Y==="y"?(_r.includes("top")||_r.includes("bottom"))&&(_r.includes("top")&&jn<0||_r.includes("bottom")&&jn>0)&&(nr.y=jn):Y==="x"&&(_r.includes("left")||_r.includes("right"))&&(_r.includes("left")&&Ui<0||_r.includes("right")&&Ui>0)&&(nr.x=Ui),(Math.abs(nr.x)>0||Math.abs(nr.y)>0)&&Ne(!0),(pt=J.current)==null||pt.style.setProperty("--swipe-amount-x",`${nr.x}px`),(fn=J.current)==null||fn.style.setProperty("--swipe-amount-y",`${nr.y}px`)}},Je&&!p.jsx?Z.createElement("button",{"aria-label":K,"data-disabled":Ge,"data-close-button":!0,onClick:Ge||!be?()=>{}:()=>{var Se;Te(),(Se=p.onDismiss)==null||Se.call(p,p)},className:uo(j==null?void 0:j.closeButton,(i=p==null?void 0:p.classNames)==null?void 0:i.closeButton)},(o=X==null?void 0:X.close)!=null?o:w9):null,p.jsx||_.isValidElement(p.title)?p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title:Z.createElement(Z.Fragment,null,me||p.icon||p.promise?Z.createElement("div",{"data-icon":"",className:uo(j==null?void 0:j.icon,(a=p==null?void 0:p.classNames)==null?void 0:a.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||_e():null,p.type!=="loading"?p.icon||(X==null?void 0:X[me])||m9(me):null):null,Z.createElement("div",{"data-content":"",className:uo(j==null?void 0:j.content,(s=p==null?void 0:p.classNames)==null?void 0:s.content)},Z.createElement("div",{"data-title":"",className:uo(j==null?void 0:j.title,(l=p==null?void 0:p.classNames)==null?void 0:l.title)},typeof p.title=="function"?p.title():p.title),p.description?Z.createElement("div",{"data-description":"",className:uo(D,rt,j==null?void 0:j.description,(c=p==null?void 0:p.classNames)==null?void 0:c.description)},typeof p.description=="function"?p.description():p.description):null),_.isValidElement(p.cancel)?p.cancel:p.cancel&&yg(p.cancel)?Z.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||C,onClick:Se=>{var je,vt;yg(p.cancel)&&be&&((vt=(je=p.cancel).onClick)==null||vt.call(je,Se),Te())},className:uo(j==null?void 0:j.cancelButton,(u=p==null?void 0:p.classNames)==null?void 0:u.cancelButton)},p.cancel.label):null,_.isValidElement(p.action)?p.action:p.action&&yg(p.action)?Z.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||P,onClick:Se=>{var je,vt;yg(p.action)&&((vt=(je=p.action).onClick)==null||vt.call(je,Se),!Se.defaultPrevented&&Te())},className:uo(j==null?void 0:j.actionButton,(d=p==null?void 0:p.classNames)==null?void 0:d.actionButton)},p.action.label):null))};function KR(){if(typeof window>"u"||typeof document>"u")return"ltr";let t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function B9(t,e){let n={};return[t,e].forEach((r,i)=>{let o=i===1,a=o?"--mobile-offset":"--offset",s=o?I9:O9;function l(c){["top","right","bottom","left"].forEach(u=>{n[`${a}-${u}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{r[c]===void 0?n[`${a}-${c}`]=s:n[`${a}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):l(s)}),n}_.forwardRef(function(t,e){let{invert:n,position:r="bottom-right",hotkey:i=["altKey","KeyT"],expand:o,closeButton:a,className:s,offset:l,mobileOffset:c,theme:u="light",richColors:d,duration:f,style:p,visibleToasts:y=N9,toastOptions:v,dir:g=KR(),gap:m=L9,loadingIcon:x,icons:b,containerAriaLabel:S="Notifications",pauseWhenPageIsHidden:w}=t,[E,T]=Z.useState([]),A=Z.useMemo(()=>Array.from(new Set([r].concat(E.filter(F=>F.position).map(F=>F.position)))),[E,r]),[M,C]=Z.useState([]),[P,R]=Z.useState(!1),[D,k]=Z.useState(!1),[U,O]=Z.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),W=Z.useRef(null),L=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),j=Z.useRef(null),X=Z.useRef(!1),K=Z.useCallback(F=>{T(Y=>{var q;return(q=Y.find(ee=>ee.id===F.id))!=null&&q.delete||ni.dismiss(F.id),Y.filter(({id:ee})=>ee!==F.id)})},[]);return Z.useEffect(()=>ni.subscribe(F=>{if(F.dismiss){T(Y=>Y.map(q=>q.id===F.id?{...q,delete:!0}:q));return}setTimeout(()=>{$3.flushSync(()=>{T(Y=>{let q=Y.findIndex(ee=>ee.id===F.id);return q!==-1?[...Y.slice(0,q),{...Y[q],...F},...Y.slice(q+1)]:[F,...Y]})})})}),[]),Z.useEffect(()=>{if(u!=="system"){O(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?O("dark"):O("light")),typeof window>"u")return;let F=window.matchMedia("(prefers-color-scheme: dark)");try{F.addEventListener("change",({matches:Y})=>{O(Y?"dark":"light")})}catch{F.addListener(({matches:q})=>{try{O(q?"dark":"light")}catch(ee){console.error(ee)}})}},[u]),Z.useEffect(()=>{E.length<=1&&R(!1)},[E]),Z.useEffect(()=>{let F=Y=>{var q,ee;i.every(te=>Y[te]||Y.code===te)&&(R(!0),(q=W.current)==null||q.focus()),Y.code==="Escape"&&(document.activeElement===W.current||(ee=W.current)!=null&&ee.contains(document.activeElement))&&R(!1)};return document.addEventListener("keydown",F),()=>document.removeEventListener("keydown",F)},[i]),Z.useEffect(()=>{if(W.current)return()=>{j.current&&(j.current.focus({preventScroll:!0}),j.current=null,X.current=!1)}},[W.current]),Z.createElement("section",{ref:e,"aria-label":`${S} ${L}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},A.map((F,Y)=>{var q;let[ee,te]=F.split("-");return E.length?Z.createElement("ol",{key:F,dir:g==="auto"?KR():g,tabIndex:-1,ref:W,className:s,"data-sonner-toaster":!0,"data-theme":U,"data-y-position":ee,"data-lifted":P&&E.length>1&&!o,"data-x-position":te,style:{"--front-toast-height":`${((q=M[0])==null?void 0:q.height)||0}px`,"--width":`${D9}px`,"--gap":`${m}px`,...p,...B9(l,c)},onBlur:Q=>{X.current&&!Q.currentTarget.contains(Q.relatedTarget)&&(X.current=!1,j.current&&(j.current.focus({preventScroll:!0}),j.current=null))},onFocus:Q=>{Q.target instanceof HTMLElement&&Q.target.dataset.dismissible==="false"||X.current||(X.current=!0,j.current=Q.relatedTarget)},onMouseEnter:()=>R(!0),onMouseMove:()=>R(!0),onMouseLeave:()=>{D||R(!1)},onDragEnd:()=>R(!1),onPointerDown:Q=>{Q.target instanceof HTMLElement&&Q.target.dataset.dismissible==="false"||k(!0)},onPointerUp:()=>k(!1)},E.filter(Q=>!Q.position&&Y===0||Q.position===F).map((Q,ce)=>{var ae,fe;return Z.createElement(F9,{key:Q.id,icons:b,index:ce,toast:Q,defaultRichColors:d,duration:(ae=v==null?void 0:v.duration)!=null?ae:f,className:v==null?void 0:v.className,descriptionClassName:v==null?void 0:v.descriptionClassName,invert:n,visibleToasts:y,closeButton:(fe=v==null?void 0:v.closeButton)!=null?fe:a,interacting:D,position:F,style:v==null?void 0:v.style,unstyled:v==null?void 0:v.unstyled,classNames:v==null?void 0:v.classNames,cancelButtonStyle:v==null?void 0:v.cancelButtonStyle,actionButtonStyle:v==null?void 0:v.actionButtonStyle,removeToast:K,toasts:E.filter(we=>we.position==Q.position),heights:M.filter(we=>we.position==Q.position),setHeights:C,expandByDefault:o,gap:m,loadingIcon:x,expanded:P,pauseWhenPageIsHidden:w,swipeDirections:t.swipeDirections})})):null}))});function $9(t){if(!(t instanceof DataTransfer))throw new Error('Data must be of type "DataTransfer"');const e={};function n(r){const i=a=>a!==null&&typeof a=="object"&&"isFile"in a&&typeof a.file=="function"&&"fullPath"in a,o=a=>a!==null&&typeof a=="object"&&"isFile"in a&&typeof a.createReader=="function";if(i(r)&&r.isFile)return new Promise(a=>{r.file(s=>{e[r.fullPath]=s,a()})});if(o(r)&&!r.isFile){const a=r.createReader();return new Promise(s=>{const l=[];function c(){a.readEntries(u=>{u.length===0?Promise.all(l).then(()=>s()):(u.forEach(d=>{l.push(n(d))}),c())})}c()})}return Promise.resolve()}return new Promise(r=>{const i=t.items&&Array.from(t.items),o=Array.from(t.files);if(i&&i.length&&"webkitGetAsEntry"in i[0]){const a=[];for(let s=0;sr(e))}else o.filter(a=>a.size!==0).forEach(a=>e["/"+a.name]=a),r(e)})}function YR(t){return t.replace(/\\/g,"/").split(/\//g).reduce((e,n)=>(n===".."?e.pop():n!=="."&&e.push(n),e),[]).join("/")}function JR(t){return new Promise((e,n)=>{const r=new FileReader;r.onload=i=>{i.target&&i.target.result?e(i.target.result):n(new Error("Failed to read Urdf file content"))},r.onerror=()=>n(new Error("Error reading Urdf file")),r.readAsText(t)})}async function z9(t,e){const n=await $9(t),r=Object.keys(n).map(a=>YR(a)),i=r.filter(a=>/urdf$/i.test(a)),o={};if(i.forEach(a=>{o[a]=URL.createObjectURL(n[a])}),i.length>0){const s=i[0].match(/^(\/[^/]+\/)/);s&&s[1]&&s[1]}return e.setUrlModifierFunc(a=>{var u;const l=YR(a).split("/").pop()||"";let c=r.find(d=>d.endsWith(l));if(!c&&l.includes(".")){const d="."+l.split(".").pop();c=r.find(f=>f.endsWith(d))}if(c!=null){const d=((u=c.split(".").pop())==null?void 0:u.toLowerCase())||"",f=new Blob([n[c]],{type:H9(d)}),p=URL.createObjectURL(f)+"#."+d;return setTimeout(()=>URL.revokeObjectURL(p),5e3),p}return console.warn(`No matching file found for: ${a}`),a}),{files:n,availableModels:i,blobUrls:o}}function H9(t){switch(t.toLowerCase()){case"stl":return"model/stl";case"obj":return"model/obj";case"gltf":case"glb":return"model/gltf+json";case"dae":return"model/vnd.collada+xml";case"urdf":return"application/xml";default:return"application/octet-stream"}}const sU=_.createContext(void 0),V9=({children:t})=>{const[e,n]=_.useState(null),[r,i]=_.useState({}),[o,a]=_.useState([]),[s,l]=_.useState(!1),[c,u]=_.useState([]),[d,f]=_.useState(!0),[p,y]=_.useState(null),[v,g]=_.useState(null);_.useEffect(()=>{if(!d||p)return;let P=!1;return(async()=>{try{const R=await fetch("/so-101-urdf/urdf/so101_new_calib.urdf");if(!R.ok)throw new Error(`Failed to fetch default Urdf: ${R.statusText}`);const D=await R.text();P||y(D)}catch(R){P||console.error("Error loading default Urdf content:",R)}})(),()=>{P=!0}},[d,p]);const m=_.useRef([]),x=_.useCallback(()=>{f(!0),y(null),g(null),Ur.info("Switched to default model",{description:"The default ARM100 robot model is now displayed."})},[]),b=_.useCallback(P=>(m.current.push(P),()=>{m.current=m.current.filter(R=>R!==P)}),[]),S=_.useCallback(P=>{n(P)},[]),w=_.useCallback(P=>{P.hasUrdf?f(!1):x(),m.current.forEach(R=>R(P))},[x]),E=_.useCallback(async P=>{var k;if(!e)return;const R=Object.values(r).filter(U=>U===P.blobUrl).map(U=>{const O=Object.keys(r).find(W=>r[W]===U);return O?{path:O,url:U}:null}).filter(U=>U!==null);if(R.length===0){console.error("โŒ Could not find file for selected Urdf model");return}const D=Ur.loading("Loading Urdf model...",{description:"Preparing 3D visualization",duration:5e3});try{const U=(k=R[0])==null?void 0:k.path;if(!U||!r[U])throw new Error("File not found in records");const W=await(await fetch(P.blobUrl)).blob(),L=new File([W],U.split("/").pop()||"model.urdf",{type:"application/xml"}),j=await JR(L);y(j),Ur.dismiss(D),f(!1);const X=P.name||P.path.split("/").pop()||"Unknown";Ur.success("Urdf model loaded successfully",{description:`Model: ${X}`,duration:3e3}),w({hasUrdf:!0,modelName:X})}catch(U){console.error("โŒ Error processing selected Urdf:",U),Ur.dismiss(D),Ur.error("Error loading Urdf",{description:`Error: ${U instanceof Error?U.message:String(U)}`,duration:3e3})}},[r,e,w]),T=_.useCallback(P=>{var D;if(!e){console.error("โŒ No Urdf processor available");return}l(!1);const R=P.name||((D=P.path.split("/").pop())==null?void 0:D.replace(/\.urdf$/i,""))||"Unknown";e.loadUrdf(P.blobUrl),f(!1),Ur.info(`Loading model: ${R}`,{description:"Preparing 3D visualization",duration:2e3}),w({hasUrdf:!0,modelName:R}),E(P)},[e,w,E]),A=_.useCallback(async(P,R)=>{Object.values(r).forEach(URL.revokeObjectURL),i({}),a([]),u([]);try{if(R.length>0&&e){const D={};R.forEach(U=>{P[U]&&(D[U]=URL.createObjectURL(P[U]))}),i(D),a(R);const k=R.map(U=>{const W=(U.split("/").pop()||"").replace(/\.urdf$/i,"");return{path:U,blobUrl:D[U],name:W}});if(u(k),R.length===1){const O=(R[0].split("/").pop()||"").replace(/\.urdf$/i,""),W=D[R[0]];if(W)if(e.loadUrdf(W),f(!1),P[R[0]]){const L=Ur.loading("Loading Urdf model...",{description:"Preparing 3D visualization",duration:5e3});try{const j=await JR(P[R[0]]);y(j),Ur.dismiss(L),Ur.success("Urdf model loaded successfully",{description:`Model: ${O}`,duration:3e3}),w({hasUrdf:!0,modelName:O})}catch(j){console.error("Error loading Urdf:",j),Ur.dismiss(L),Ur.error("Error loading Urdf",{description:`Error: ${j instanceof Error?j.message:String(j)}`,duration:3e3}),w({hasUrdf:!0,modelName:O})}}else console.error("Could not find file for Urdf model:",R[0]),w({hasUrdf:!0,modelName:O});else console.warn(`No blob URL found for ${R[0]}, using path directly`),e.loadUrdf(R[0]),f(!1),w({hasUrdf:!0,modelName:O})}else l(!0),w({hasUrdf:!0,modelName:"Multiple models available"})}else w({hasUrdf:!1}),x(),Ur.error("No Urdf file found",{description:"Please upload a folder containing a .urdf file.",duration:3e3})}catch(D){console.error("Error processing Urdf files:",D),Ur.error("Error processing files",{description:`Error: ${D instanceof Error?D.message:String(D)}`,duration:3e3}),x()}},[w,r,e,x]),M=_.useRef(r);M.current=r,_.useEffect(()=>()=>{Object.values(M.current).forEach(URL.revokeObjectURL)},[]);const C=_.useMemo(()=>({urdfProcessor:e,registerUrdfProcessor:S,onUrdfDetected:b,processUrdfFiles:A,urdfBlobUrls:r,alternativeUrdfModels:o,isSelectionModalOpen:s,setIsSelectionModalOpen:l,urdfModelOptions:c,selectUrdfModel:T,isDefaultModel:d,setIsDefaultModel:f,resetToDefaultModel:x,urdfContent:p,currentAnimationConfig:v,setCurrentAnimationConfig:g}),[e,S,b,A,r,o,s,c,T,d,x,p,v]);return h.jsx(sU.Provider,{value:C,children:t})},lU=()=>{const t=_.useContext(sU);if(t===void 0)throw new Error("useUrdf must be used within a UrdfProvider");return t},G9=_.createContext(void 0),W9=({children:t})=>{const[e,n]=_.useState(!1),{urdfProcessor:r,processUrdfFiles:i}=lU(),o=u=>{u.preventDefault(),u.stopPropagation()},a=u=>{u.preventDefault(),u.stopPropagation(),n(!0)},s=u=>{u.preventDefault(),u.stopPropagation(),(!u.relatedTarget||!u.relatedTarget.closest("html"))&&n(!1)},l=_.useCallback(async u=>{if(u.preventDefault(),u.stopPropagation(),n(!1),!(!u.dataTransfer||!r))try{const{availableModels:d,files:f}=await z9(u.dataTransfer,r);await i(f,d)}catch(d){console.error("Error in handleDrop:",d)}},[r,i]);_.useEffect(()=>(document.addEventListener("dragover",o),document.addEventListener("dragenter",a),document.addEventListener("dragleave",s),document.addEventListener("drop",l),()=>{document.removeEventListener("dragover",o),document.removeEventListener("dragenter",a),document.removeEventListener("dragleave",s),document.removeEventListener("drop",l)}),[l]);const c=_.useMemo(()=>({isDragging:e,setIsDragging:n,handleDrop:l}),[e,l]);return h.jsxs(G9.Provider,{value:c,children:[t,e&&h.jsx("div",{className:"fixed inset-0 bg-primary/10 pointer-events-none z-50 flex items-center justify-center",children:h.jsxs("div",{className:"bg-background p-8 rounded-lg shadow-lg text-center",children:[h.jsx("div",{className:"text-3xl font-bold mb-4",children:"Drop Urdf Files Here"}),h.jsx("p",{className:"text-muted-foreground",children:"Release to upload your robot model"})]})})]})},X9=1,q9=1e6;let A_=0;function K9(){return A_=(A_+1)%Number.MAX_SAFE_INTEGER,A_.toString()}const C_=new Map,ZR=t=>{if(C_.has(t))return;const e=setTimeout(()=>{C_.delete(t),Vh({type:"REMOVE_TOAST",toastId:t})},q9);C_.set(t,e)},Y9=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,X9)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(n=>n.id===e.toast.id?{...n,...e.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=e;return n?ZR(n):t.toasts.forEach(r=>{ZR(r.id)}),{...t,toasts:t.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(n=>n.id!==e.toastId)}}},Dv=[];let Lv={toasts:[]};function Vh(t){Lv=Y9(Lv,t),Dv.forEach(e=>{e(Lv)})}function J9({...t}){const e=K9(),n=i=>Vh({type:"UPDATE_TOAST",toast:{...i,id:e}}),r=()=>Vh({type:"DISMISS_TOAST",toastId:e});return Vh({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:i=>{i||r()}}}),{id:e,dismiss:r,update:n}}function Dr(){const[t,e]=_.useState(Lv);return _.useEffect(()=>(Dv.push(e),()=>{const n=Dv.indexOf(e);n>-1&&Dv.splice(n,1)}),[t]),{...t,toast:J9,dismiss:n=>Vh({type:"DISMISS_TOAST",toastId:n})}}function Oe(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t==null||t(i),n===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function QR(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function is(...t){return e=>{let n=!1;const r=t.map(i=>{const o=QR(i,e);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i{const{children:a,...s}=o,l=_.useMemo(()=>s,Object.values(s));return h.jsx(n.Provider,{value:l,children:a})};r.displayName=t+"Provider";function i(o){const a=_.useContext(n);if(a)return a;if(e!==void 0)return e;throw new Error(`\`${o}\` must be used within \`${t}\``)}return[r,i]}function mi(t,e=[]){let n=[];function r(o,a){const s=_.createContext(a),l=n.length;n=[...n,a];const c=d=>{var m;const{scope:f,children:p,...y}=d,v=((m=f==null?void 0:f[t])==null?void 0:m[l])||s,g=_.useMemo(()=>y,Object.values(y));return h.jsx(v.Provider,{value:g,children:p})};c.displayName=o+"Provider";function u(d,f){var v;const p=((v=f==null?void 0:f[t])==null?void 0:v[l])||s,y=_.useContext(p);if(y)return y;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${o}\``)}return[c,u]}const i=()=>{const o=n.map(a=>_.createContext(a));return function(s){const l=(s==null?void 0:s[t])||o;return _.useMemo(()=>({[`__scope${t}`]:{...s,[t]:l}}),[s,l])}};return i.scopeName=t,[r,Q9(i,...e)]}function Q9(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((s,{useScope:l,scopeName:c})=>{const d=l(o)[`__scope${c}`];return{...s,...d}},{});return _.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}function sl(t){const e=t7(t),n=_.forwardRef((r,i)=>{const{children:o,...a}=r,s=_.Children.toArray(o),l=s.find(n7);if(l){const c=l.props.children,u=s.map(d=>d===l?_.Children.count(c)>1?_.Children.only(null):_.isValidElement(c)?c.props.children:null:d);return h.jsx(e,{...a,ref:i,children:_.isValidElement(c)?_.cloneElement(c,void 0,u):null})}return h.jsx(e,{...a,ref:i,children:o})});return n.displayName=`${t}.Slot`,n}var e7=sl("Slot");function t7(t){const e=_.forwardRef((n,r)=>{const{children:i,...o}=n;if(_.isValidElement(i)){const a=i7(i),s=r7(o,i.props);return i.type!==_.Fragment&&(s.ref=r?is(r,a):a),_.cloneElement(i,s)}return _.Children.count(i)>1?_.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var cU=Symbol("radix.slottable");function uU(t){const e=({children:n})=>h.jsx(h.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=cU,e}function n7(t){return _.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===cU}function r7(t,e){const n={...e};for(const r in e){const i=t[r],o=e[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{const l=o(...s);return i(...s),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...t,...n}}function i7(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function rx(t){const e=t+"CollectionProvider",[n,r]=mi(e),[i,o]=n(e,{collectionRef:{current:null},itemMap:new Map}),a=v=>{const{scope:g,children:m}=v,x=Z.useRef(null),b=Z.useRef(new Map).current;return h.jsx(i,{scope:g,itemMap:b,collectionRef:x,children:m})};a.displayName=e;const s=t+"CollectionSlot",l=sl(s),c=Z.forwardRef((v,g)=>{const{scope:m,children:x}=v,b=o(s,m),S=Ot(g,b.collectionRef);return h.jsx(l,{ref:S,children:x})});c.displayName=s;const u=t+"CollectionItemSlot",d="data-radix-collection-item",f=sl(u),p=Z.forwardRef((v,g)=>{const{scope:m,children:x,...b}=v,S=Z.useRef(null),w=Ot(g,S),E=o(u,m);return Z.useEffect(()=>(E.itemMap.set(S,{ref:S,...b}),()=>void E.itemMap.delete(S))),h.jsx(f,{[d]:"",ref:w,children:x})});p.displayName=u;function y(v){const g=o(t+"CollectionConsumer",v);return Z.useCallback(()=>{const x=g.collectionRef.current;if(!x)return[];const b=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(g.itemMap.values()).sort((E,T)=>b.indexOf(E.ref.current)-b.indexOf(T.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:a,Slot:c,ItemSlot:p},y,r]}var o7=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],nt=o7.reduce((t,e)=>{const n=sl(`Primitive.${e}`),r=_.forwardRef((i,o)=>{const{asChild:a,...s}=i,l=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(l,{...s,ref:o})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function JM(t,e){t&&Bc.flushSync(()=>t.dispatchEvent(e))}function di(t){const e=_.useRef(t);return _.useEffect(()=>{e.current=t}),_.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function a7(t,e=globalThis==null?void 0:globalThis.document){const n=di(t);_.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var s7="DismissableLayer",lE="dismissableLayer.update",l7="dismissableLayer.pointerDownOutside",c7="dismissableLayer.focusOutside",eN,dU=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),zc=_.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:a,onDismiss:s,...l}=t,c=_.useContext(dU),[u,d]=_.useState(null),f=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=_.useState({}),y=Ot(e,T=>d(T)),v=Array.from(c.layers),[g]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),m=v.indexOf(g),x=u?v.indexOf(u):-1,b=c.layersWithOutsidePointerEventsDisabled.size>0,S=x>=m,w=d7(T=>{const A=T.target,M=[...c.branches].some(C=>C.contains(A));!S||M||(i==null||i(T),a==null||a(T),T.defaultPrevented||s==null||s())},f),E=f7(T=>{const A=T.target;[...c.branches].some(C=>C.contains(A))||(o==null||o(T),a==null||a(T),T.defaultPrevented||s==null||s())},f);return a7(T=>{x===c.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&s&&(T.preventDefault(),s()))},f),_.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(eN=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),tN(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=eN)}},[u,f,n,c]),_.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),tN())},[u,c]),_.useEffect(()=>{const T=()=>p({});return document.addEventListener(lE,T),()=>document.removeEventListener(lE,T)},[]),h.jsx(nt.div,{...l,ref:y,style:{pointerEvents:b?S?"auto":"none":void 0,...t.style},onFocusCapture:Oe(t.onFocusCapture,E.onFocusCapture),onBlurCapture:Oe(t.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Oe(t.onPointerDownCapture,w.onPointerDownCapture)})});zc.displayName=s7;var u7="DismissableLayerBranch",fU=_.forwardRef((t,e)=>{const n=_.useContext(dU),r=_.useRef(null),i=Ot(e,r);return _.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),h.jsx(nt.div,{...t,ref:i})});fU.displayName=u7;function d7(t,e=globalThis==null?void 0:globalThis.document){const n=di(t),r=_.useRef(!1),i=_.useRef(()=>{});return _.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let l=function(){hU(l7,n,c,{discrete:!0})};const c={originalEvent:s};s.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=l,e.addEventListener("click",i.current,{once:!0})):l()}else e.removeEventListener("click",i.current);r.current=!1},a=window.setTimeout(()=>{e.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),e.removeEventListener("pointerdown",o),e.removeEventListener("click",i.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function f7(t,e=globalThis==null?void 0:globalThis.document){const n=di(t),r=_.useRef(!1);return _.useEffect(()=>{const i=o=>{o.target&&!r.current&&hU(c7,n,{originalEvent:o},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function tN(){const t=new CustomEvent(lE);document.dispatchEvent(t)}function hU(t,e,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?JM(i,o):i.dispatchEvent(o)}var h7=zc,p7=fU,ur=globalThis!=null&&globalThis.document?_.useLayoutEffect:()=>{},m7="Portal",vf=_.forwardRef((t,e)=>{var s;const{container:n,...r}=t,[i,o]=_.useState(!1);ur(()=>o(!0),[]);const a=n||i&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return a?$3.createPortal(h.jsx(nt.div,{...r,ref:e}),a):null});vf.displayName=m7;function g7(t,e){return _.useReducer((n,r)=>e[n][r]??n,t)}var gi=t=>{const{present:e,children:n}=t,r=v7(e),i=typeof n=="function"?n({present:r.isPresent}):_.Children.only(n),o=Ot(r.ref,y7(i));return typeof n=="function"||r.isPresent?_.cloneElement(i,{ref:o}):null};gi.displayName="Presence";function v7(t){const[e,n]=_.useState(),r=_.useRef(null),i=_.useRef(t),o=_.useRef("none"),a=t?"mounted":"unmounted",[s,l]=g7(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const c=xg(r.current);o.current=s==="mounted"?c:"none"},[s]),ur(()=>{const c=r.current,u=i.current;if(u!==t){const f=o.current,p=xg(c);t?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&f!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,l]),ur(()=>{if(e){let c;const u=e.ownerDocument.defaultView??window,d=p=>{const v=xg(r.current).includes(p.animationName);if(p.target===e&&v&&(l("ANIMATION_END"),!i.current)){const g=e.style.animationFillMode;e.style.animationFillMode="forwards",c=u.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=g)})}},f=p=>{p.target===e&&(o.current=xg(r.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",d),e.addEventListener("animationend",d),()=>{u.clearTimeout(c),e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",d),e.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:_.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function xg(t){return(t==null?void 0:t.animationName)||"none"}function y7(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var x7=rM[" useInsertionEffect ".trim().toString()]||ur;function $o({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[i,o,a]=b7({defaultProp:e,onChange:n}),s=t!==void 0,l=s?t:i;{const u=_.useRef(t!==void 0);_.useEffect(()=>{const d=u.current;d!==s&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=s},[s,r])}const c=_.useCallback(u=>{var d;if(s){const f=_7(u)?u(t):u;f!==t&&((d=a.current)==null||d.call(a,f))}else o(u)},[s,t,o,a]);return[l,c]}function b7({defaultProp:t,onChange:e}){const[n,r]=_.useState(t),i=_.useRef(n),o=_.useRef(e);return x7(()=>{o.current=e},[e]),_.useEffect(()=>{var a;i.current!==n&&((a=o.current)==null||a.call(o,n),i.current=n)},[n,i]),[n,r,o]}function _7(t){return typeof t=="function"}var pU=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),w7="VisuallyHidden",ix=_.forwardRef((t,e)=>h.jsx(nt.span,{...t,ref:e,style:{...pU,...t.style}}));ix.displayName=w7;var S7=ix,ZM="ToastProvider",[QM,E7,T7]=rx("Toast"),[mU,bDe]=mi("Toast",[T7]),[M7,ox]=mU(ZM),gU=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:i="right",swipeThreshold:o=50,children:a}=t,[s,l]=_.useState(null),[c,u]=_.useState(0),d=_.useRef(!1),f=_.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${ZM}\`. Expected non-empty \`string\`.`),h.jsx(QM.Provider,{scope:e,children:h.jsx(M7,{scope:e,label:n,duration:r,swipeDirection:i,swipeThreshold:o,toastCount:c,viewport:s,onViewportChange:l,onToastAdd:_.useCallback(()=>u(p=>p+1),[]),onToastRemove:_.useCallback(()=>u(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:a})})};gU.displayName=ZM;var vU="ToastViewport",A7=["F8"],cE="toast.viewportPause",uE="toast.viewportResume",yU=_.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=A7,label:i="Notifications ({hotkey})",...o}=t,a=ox(vU,n),s=E7(n),l=_.useRef(null),c=_.useRef(null),u=_.useRef(null),d=_.useRef(null),f=Ot(e,d,a.onViewportChange),p=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),y=a.toastCount>0;_.useEffect(()=>{const g=m=>{var b;r.length!==0&&r.every(S=>m[S]||m.code===S)&&((b=d.current)==null||b.focus())};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[r]),_.useEffect(()=>{const g=l.current,m=d.current;if(y&&g&&m){const x=()=>{if(!a.isClosePausedRef.current){const E=new CustomEvent(cE);m.dispatchEvent(E),a.isClosePausedRef.current=!0}},b=()=>{if(a.isClosePausedRef.current){const E=new CustomEvent(uE);m.dispatchEvent(E),a.isClosePausedRef.current=!1}},S=E=>{!g.contains(E.relatedTarget)&&b()},w=()=>{g.contains(document.activeElement)||b()};return g.addEventListener("focusin",x),g.addEventListener("focusout",S),g.addEventListener("pointermove",x),g.addEventListener("pointerleave",w),window.addEventListener("blur",x),window.addEventListener("focus",b),()=>{g.removeEventListener("focusin",x),g.removeEventListener("focusout",S),g.removeEventListener("pointermove",x),g.removeEventListener("pointerleave",w),window.removeEventListener("blur",x),window.removeEventListener("focus",b)}}},[y,a.isClosePausedRef]);const v=_.useCallback(({tabbingDirection:g})=>{const x=s().map(b=>{const S=b.ref.current,w=[S,...B7(S)];return g==="forwards"?w:w.reverse()});return(g==="forwards"?x.reverse():x).flat()},[s]);return _.useEffect(()=>{const g=d.current;if(g){const m=x=>{var w,E,T;const b=x.altKey||x.ctrlKey||x.metaKey;if(x.key==="Tab"&&!b){const A=document.activeElement,M=x.shiftKey;if(x.target===g&&M){(w=c.current)==null||w.focus();return}const R=v({tabbingDirection:M?"backwards":"forwards"}),D=R.findIndex(k=>k===A);P_(R.slice(D+1))?x.preventDefault():M?(E=c.current)==null||E.focus():(T=u.current)==null||T.focus()}};return g.addEventListener("keydown",m),()=>g.removeEventListener("keydown",m)}},[s,v]),h.jsxs(p7,{ref:l,role:"region","aria-label":i.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:y?void 0:"none"},children:[y&&h.jsx(dE,{ref:c,onFocusFromOutsideViewport:()=>{const g=v({tabbingDirection:"forwards"});P_(g)}}),h.jsx(QM.Slot,{scope:n,children:h.jsx(nt.ol,{tabIndex:-1,...o,ref:f})}),y&&h.jsx(dE,{ref:u,onFocusFromOutsideViewport:()=>{const g=v({tabbingDirection:"backwards"});P_(g)}})]})});yU.displayName=vU;var xU="ToastFocusProxy",dE=_.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=t,o=ox(xU,n);return h.jsx(ix,{"aria-hidden":!0,tabIndex:0,...i,ref:e,style:{position:"fixed"},onFocus:a=>{var c;const s=a.relatedTarget;!((c=o.viewport)!=null&&c.contains(s))&&r()}})});dE.displayName=xU;var Sm="Toast",C7="toast.swipeStart",P7="toast.swipeMove",R7="toast.swipeCancel",N7="toast.swipeEnd",bU=_.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:i,onOpenChange:o,...a}=t,[s,l]=$o({prop:r,defaultProp:i??!0,onChange:o,caller:Sm});return h.jsx(gi,{present:n||s,children:h.jsx(D7,{open:s,...a,ref:e,onClose:()=>l(!1),onPause:di(t.onPause),onResume:di(t.onResume),onSwipeStart:Oe(t.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Oe(t.onSwipeMove,c=>{const{x:u,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${d}px`)}),onSwipeCancel:Oe(t.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Oe(t.onSwipeEnd,c=>{const{x:u,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${d}px`),l(!1)})})})});bU.displayName=Sm;var[O7,I7]=mU(Sm,{onClose(){}}),D7=_.forwardRef((t,e)=>{const{__scopeToast:n,type:r="foreground",duration:i,open:o,onClose:a,onEscapeKeyDown:s,onPause:l,onResume:c,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:p,...y}=t,v=ox(Sm,n),[g,m]=_.useState(null),x=Ot(e,k=>m(k)),b=_.useRef(null),S=_.useRef(null),w=i||v.duration,E=_.useRef(0),T=_.useRef(w),A=_.useRef(0),{onToastAdd:M,onToastRemove:C}=v,P=di(()=>{var U;(g==null?void 0:g.contains(document.activeElement))&&((U=v.viewport)==null||U.focus()),a()}),R=_.useCallback(k=>{!k||k===1/0||(window.clearTimeout(A.current),E.current=new Date().getTime(),A.current=window.setTimeout(P,k))},[P]);_.useEffect(()=>{const k=v.viewport;if(k){const U=()=>{R(T.current),c==null||c()},O=()=>{const W=new Date().getTime()-E.current;T.current=T.current-W,window.clearTimeout(A.current),l==null||l()};return k.addEventListener(cE,O),k.addEventListener(uE,U),()=>{k.removeEventListener(cE,O),k.removeEventListener(uE,U)}}},[v.viewport,w,l,c,R]),_.useEffect(()=>{o&&!v.isClosePausedRef.current&&R(w)},[o,w,v.isClosePausedRef,R]),_.useEffect(()=>(M(),()=>C()),[M,C]);const D=_.useMemo(()=>g?AU(g):null,[g]);return v.viewport?h.jsxs(h.Fragment,{children:[D&&h.jsx(L7,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:D}),h.jsx(O7,{scope:n,onClose:P,children:Bc.createPortal(h.jsx(QM.ItemSlot,{scope:n,children:h.jsx(h7,{asChild:!0,onEscapeKeyDown:Oe(s,()=>{v.isFocusedToastEscapeKeyDownRef.current||P(),v.isFocusedToastEscapeKeyDownRef.current=!1}),children:h.jsx(nt.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":v.swipeDirection,...y,ref:x,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:Oe(t.onKeyDown,k=>{k.key==="Escape"&&(s==null||s(k.nativeEvent),k.nativeEvent.defaultPrevented||(v.isFocusedToastEscapeKeyDownRef.current=!0,P()))}),onPointerDown:Oe(t.onPointerDown,k=>{k.button===0&&(b.current={x:k.clientX,y:k.clientY})}),onPointerMove:Oe(t.onPointerMove,k=>{if(!b.current)return;const U=k.clientX-b.current.x,O=k.clientY-b.current.y,W=!!S.current,L=["left","right"].includes(v.swipeDirection),j=["left","up"].includes(v.swipeDirection)?Math.min:Math.max,X=L?j(0,U):0,K=L?0:j(0,O),F=k.pointerType==="touch"?10:2,Y={x:X,y:K},q={originalEvent:k,delta:Y};W?(S.current=Y,bg(P7,d,q,{discrete:!1})):nN(Y,v.swipeDirection,F)?(S.current=Y,bg(C7,u,q,{discrete:!1}),k.target.setPointerCapture(k.pointerId)):(Math.abs(U)>F||Math.abs(O)>F)&&(b.current=null)}),onPointerUp:Oe(t.onPointerUp,k=>{const U=S.current,O=k.target;if(O.hasPointerCapture(k.pointerId)&&O.releasePointerCapture(k.pointerId),S.current=null,b.current=null,U){const W=k.currentTarget,L={originalEvent:k,delta:U};nN(U,v.swipeDirection,v.swipeThreshold)?bg(N7,p,L,{discrete:!0}):bg(R7,f,L,{discrete:!0}),W.addEventListener("click",j=>j.preventDefault(),{once:!0})}})})})}),v.viewport)})]}):null}),L7=t=>{const{__scopeToast:e,children:n,...r}=t,i=ox(Sm,e),[o,a]=_.useState(!1),[s,l]=_.useState(!1);return U7(()=>a(!0)),_.useEffect(()=>{const c=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(c)},[]),s?null:h.jsx(vf,{asChild:!0,children:h.jsx(ix,{...r,children:o&&h.jsxs(h.Fragment,{children:[i.label," ",n]})})})},k7="ToastTitle",_U=_.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return h.jsx(nt.div,{...r,ref:e})});_U.displayName=k7;var j7="ToastDescription",wU=_.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return h.jsx(nt.div,{...r,ref:e})});wU.displayName=j7;var SU="ToastAction",EU=_.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?h.jsx(MU,{altText:n,asChild:!0,children:h.jsx(eA,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${SU}\`. Expected non-empty \`string\`.`),null)});EU.displayName=SU;var TU="ToastClose",eA=_.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,i=I7(TU,n);return h.jsx(MU,{asChild:!0,children:h.jsx(nt.button,{type:"button",...r,ref:e,onClick:Oe(t.onClick,i.onClose)})})});eA.displayName=TU;var MU=_.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...i}=t;return h.jsx(nt.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...i,ref:e})});function AU(t){const e=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),F7(r)){const i=r.ariaHidden||r.hidden||r.style.display==="none",o=r.dataset.radixToastAnnounceExclude==="";if(!i)if(o){const a=r.dataset.radixToastAnnounceAlt;a&&e.push(a)}else e.push(...AU(r))}}),e}function bg(t,e,n,{discrete:r}){const i=n.originalEvent.currentTarget,o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?JM(i,o):i.dispatchEvent(o)}var nN=(t,e,n=0)=>{const r=Math.abs(t.x),i=Math.abs(t.y),o=r>i;return e==="left"||e==="right"?o&&r>n:!o&&i>n};function U7(t=()=>{}){const e=di(t);ur(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}function F7(t){return t.nodeType===t.ELEMENT_NODE}function B7(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function P_(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var $7=gU,CU=yU,PU=bU,RU=_U,NU=wU,OU=EU,IU=eA;function DU(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;etypeof t=="boolean"?`${t}`:t===0?"0":t,iN=zt,Em=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return iN(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=e,a=Object.keys(i).map(c=>{const u=n==null?void 0:n[c],d=o==null?void 0:o[c];if(u===null)return null;const f=rN(u)||rN(d);return i[c][f]}),s=n&&Object.entries(n).reduce((c,u)=>{let[d,f]=u;return f===void 0||(c[d]=f),c},{}),l=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:f,...p}=u;return Object.entries(p).every(y=>{let[v,g]=y;return Array.isArray(g)?g.includes({...o,...s}[v]):{...o,...s}[v]===g})?[...c,d,f]:c},[]);return iN(t,a,l,n==null?void 0:n.class,n==null?void 0:n.className)};/** + */const BW="6";try{window.__reactRouterVersion=BW}catch{}const $W="startTransition",BR=rM[$W];function zW(t){let{basename:e,children:n,future:r,window:i}=t,o=_.useRef();o.current==null&&(o.current=X6({window:i,v5Compat:!0}));let a=o.current,[s,l]=_.useState({action:a.action,location:a.location}),{v7_startTransition:c}=r||{},u=_.useCallback(d=>{c&&BR?BR(()=>l(d)):l(d)},[l,c]);return _.useLayoutEffect(()=>a.listen(u),[a,u]),_.useEffect(()=>jW(r),[r]),_.createElement(UW,{basename:e,children:n,location:s.location,navigationType:s.action,navigator:a,future:r})}var $R;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})($R||($R={}));var zR;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(zR||(zR={}));var tx=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(){}},nx=typeof window>"u"||"Deno"in globalThis;function xo(){}function HW(t,e){return typeof t=="function"?t(e):t}function VW(t){return typeof t=="number"&&t>=0&&t!==1/0}function GW(t,e){return Math.max(t+(e||0)-Date.now(),0)}function oE(t,e){return typeof t=="function"?t(e):t}function WW(t,e){return typeof t=="function"?t(e):t}function HR(t,e){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:a,stale:s}=t;if(a){if(r){if(e.queryHash!==KM(a,e.options))return!1}else if(!xp(e.queryKey,a))return!1}if(n!=="all"){const l=e.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof s=="boolean"&&e.isStale()!==s||i&&i!==e.state.fetchStatus||o&&!o(e))}function VR(t,e){const{exact:n,status:r,predicate:i,mutationKey:o}=t;if(o){if(!e.options.mutationKey)return!1;if(n){if(yp(e.options.mutationKey)!==yp(o))return!1}else if(!xp(e.options.mutationKey,o))return!1}return!(r&&e.state.status!==r||i&&!i(e))}function KM(t,e){return((e==null?void 0:e.queryKeyHashFn)||yp)(t)}function yp(t){return JSON.stringify(t,(e,n)=>aE(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function xp(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>xp(t[n],e[n])):!1}function nU(t,e){if(t===e)return t;const n=GR(t)&&GR(e);if(n||aE(t)&&aE(e)){const r=n?t:Object.keys(t),i=r.length,o=n?e:Object.keys(e),a=o.length,s=n?[]:{},l=new Set(r);let c=0;for(let u=0;u{setTimeout(e,t)})}function qW(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?nU(t,e):e}function KW(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function YW(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var YM=Symbol();function rU(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===YM?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var oc,Ls,gd,Sk,JW=(Sk=class extends tx{constructor(){super();Xt(this,oc);Xt(this,Ls);Xt(this,gd);Ct(this,gd,e=>{if(!nx&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){xe(this,Ls)||this.setEventListener(xe(this,gd))}onUnsubscribe(){var e;this.hasListeners()||((e=xe(this,Ls))==null||e.call(this),Ct(this,Ls,void 0))}setEventListener(e){var n;Ct(this,gd,e),(n=xe(this,Ls))==null||n.call(this),Ct(this,Ls,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){xe(this,oc)!==e&&(Ct(this,oc,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof xe(this,oc)=="boolean"?xe(this,oc):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},oc=new WeakMap,Ls=new WeakMap,gd=new WeakMap,Sk),iU=new JW,vd,ks,yd,Ek,ZW=(Ek=class extends tx{constructor(){super();Xt(this,vd,!0);Xt(this,ks);Xt(this,yd);Ct(this,yd,e=>{if(!nx&&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(){xe(this,ks)||this.setEventListener(xe(this,yd))}onUnsubscribe(){var e;this.hasListeners()||((e=xe(this,ks))==null||e.call(this),Ct(this,ks,void 0))}setEventListener(e){var n;Ct(this,yd,e),(n=xe(this,ks))==null||n.call(this),Ct(this,ks,e(this.setOnline.bind(this)))}setOnline(e){xe(this,vd)!==e&&(Ct(this,vd,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return xe(this,vd)}},vd=new WeakMap,ks=new WeakMap,yd=new WeakMap,Ek),xy=new ZW;function QW(){let t,e;const n=new Promise((i,o)=>{t=i,e=o});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 e7(t){return Math.min(1e3*2**t,3e4)}function oU(t){return(t??"online")==="online"?xy.isOnline():!0}var aU=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function M_(t){return t instanceof aU}function sU(t){let e=!1,n=0,r=!1,i;const o=QW(),a=v=>{var g;r||(f(new aU(v)),(g=t.abort)==null||g.call(t))},s=()=>{e=!0},l=()=>{e=!1},c=()=>iU.isFocused()&&(t.networkMode==="always"||xy.isOnline())&&t.canRun(),u=()=>oU(t.networkMode)&&t.canRun(),d=v=>{var g;r||(r=!0,(g=t.onSuccess)==null||g.call(t,v),i==null||i(),o.resolve(v))},f=v=>{var g;r||(r=!0,(g=t.onError)==null||g.call(t,v),i==null||i(),o.reject(v))},p=()=>new Promise(v=>{var g;i=m=>{(r||c())&&v(m)},(g=t.onPause)==null||g.call(t)}).then(()=>{var v;i=void 0,r||(v=t.onContinue)==null||v.call(t)}),y=()=>{if(r)return;let v;const g=n===0?t.initialPromise:void 0;try{v=g??t.fn()}catch(m){v=Promise.reject(m)}Promise.resolve(v).then(d).catch(m=>{var E;if(r)return;const x=t.retry??(nx?0:3),b=t.retryDelay??e7,S=typeof b=="function"?b(n,m):b,w=x===!0||typeof x=="number"&&nc()?void 0:p()).then(()=>{e?f(m):y()})})};return{promise:o,cancel:a,continue:()=>(i==null||i(),o),cancelRetry:s,continueRetry:l,canStart:u,start:()=>(u()?y():p().then(y),o)}}var t7=t=>setTimeout(t,0);function n7(){let t=[],e=0,n=s=>{s()},r=s=>{s()},i=t7;const o=s=>{e?t.push(s):i(()=>{n(s)})},a=()=>{const s=t;t=[],s.length&&i(()=>{r(()=>{s.forEach(l=>{n(l)})})})};return{batch:s=>{let l;e++;try{l=s()}finally{e--,e||a()}return l},batchCalls:s=>(...l)=>{o(()=>{s(...l)})},schedule:o,setNotifyFunction:s=>{n=s},setBatchNotifyFunction:s=>{r=s},setScheduler:s=>{i=s}}}var zr=n7(),ac,Tk,lU=(Tk=class{constructor(){Xt(this,ac)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),VW(this.gcTime)&&Ct(this,ac,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(nx?1/0:5*60*1e3))}clearGcTimeout(){xe(this,ac)&&(clearTimeout(xe(this,ac)),Ct(this,ac,void 0))}},ac=new WeakMap,Tk),xd,bd,Gi,sc,Pr,gm,lc,_o,ka,Mk,r7=(Mk=class extends lU{constructor(e){super();Xt(this,_o);Xt(this,xd);Xt(this,bd);Xt(this,Gi);Xt(this,sc);Xt(this,Pr);Xt(this,gm);Xt(this,lc);Ct(this,lc,!1),Ct(this,gm,e.defaultOptions),this.setOptions(e.options),this.observers=[],Ct(this,sc,e.client),Ct(this,Gi,xe(this,sc).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Ct(this,xd,o7(this.options)),this.state=e.state??xe(this,xd),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=xe(this,Pr))==null?void 0:e.promise}setOptions(e){this.options={...xe(this,gm),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&xe(this,Gi).remove(this)}setData(e,n){const r=qW(this.state.data,e,this.options);return Er(this,_o,ka).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){Er(this,_o,ka).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var r,i;const n=(r=xe(this,Pr))==null?void 0:r.promise;return(i=xe(this,Pr))==null||i.cancel(e),n?n.then(xo).catch(xo):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(xe(this,xd))}isActive(){return this.observers.some(e=>WW(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===YM||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>oE(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!GW(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=xe(this,Pr))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=xe(this,Pr))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),xe(this,Gi).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(xe(this,Pr)&&(xe(this,lc)?xe(this,Pr).cancel({revert:!0}):xe(this,Pr).cancelRetry()),this.scheduleGc()),xe(this,Gi).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Er(this,_o,ka).call(this,{type:"invalidate"})}fetch(e,n){var c,u,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(xe(this,Pr))return xe(this,Pr).continueRetry(),xe(this,Pr).promise}if(e&&this.setOptions(e),!this.options.queryFn){const f=this.observers.find(p=>p.options.queryFn);f&&this.setOptions(f.options)}const r=new AbortController,i=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(Ct(this,lc,!0),r.signal)})},o=()=>{const f=rU(this.options,n),y=(()=>{const v={client:xe(this,sc),queryKey:this.queryKey,meta:this.meta};return i(v),v})();return Ct(this,lc,!1),this.options.persister?this.options.persister(f,y,this):f(y)},s=(()=>{const f={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:xe(this,sc),state:this.state,fetchFn:o};return i(f),f})();(c=this.options.behavior)==null||c.onFetch(s,this),Ct(this,bd,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=s.fetchOptions)==null?void 0:u.meta))&&Er(this,_o,ka).call(this,{type:"fetch",meta:(d=s.fetchOptions)==null?void 0:d.meta});const l=f=>{var p,y,v,g;M_(f)&&f.silent||Er(this,_o,ka).call(this,{type:"error",error:f}),M_(f)||((y=(p=xe(this,Gi).config).onError)==null||y.call(p,f,this),(g=(v=xe(this,Gi).config).onSettled)==null||g.call(v,this.state.data,f,this)),this.scheduleGc()};return Ct(this,Pr,sU({initialPromise:n==null?void 0:n.initialPromise,fn:s.fetchFn,abort:r.abort.bind(r),onSuccess:f=>{var p,y,v,g;if(f===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(m){l(m);return}(y=(p=xe(this,Gi).config).onSuccess)==null||y.call(p,f,this),(g=(v=xe(this,Gi).config).onSettled)==null||g.call(v,f,this.state.error,this),this.scheduleGc()},onError:l,onFail:(f,p)=>{Er(this,_o,ka).call(this,{type:"failed",failureCount:f,error:p})},onPause:()=>{Er(this,_o,ka).call(this,{type:"pause"})},onContinue:()=>{Er(this,_o,ka).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0})),xe(this,Pr).start()}},xd=new WeakMap,bd=new WeakMap,Gi=new WeakMap,sc=new WeakMap,Pr=new WeakMap,gm=new WeakMap,lc=new WeakMap,_o=new WeakSet,ka=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,...i7(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 M_(i)&&i.revert&&xe(this,bd)?{...xe(this,bd),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),zr.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),xe(this,Gi).notify({query:this,type:"updated",action:e})})},Mk);function i7(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:oU(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function o7(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 Qo,Ak,a7=(Ak=class extends tx{constructor(e={}){super();Xt(this,Qo);this.config=e,Ct(this,Qo,new Map)}build(e,n,r){const i=n.queryKey,o=n.queryHash??KM(i,n);let a=this.get(o);return a||(a=new r7({client:e,queryKey:i,queryHash:o,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(a)),a}add(e){xe(this,Qo).has(e.queryHash)||(xe(this,Qo).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=xe(this,Qo).get(e.queryHash);n&&(e.destroy(),n===e&&xe(this,Qo).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){zr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return xe(this,Qo).get(e)}getAll(){return[...xe(this,Qo).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>HR(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>HR(e,r)):n}notify(e){zr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){zr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){zr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Qo=new WeakMap,Ak),ea,Br,cc,ta,As,Ck,s7=(Ck=class extends lU{constructor(e){super();Xt(this,ta);Xt(this,ea);Xt(this,Br);Xt(this,cc);this.mutationId=e.mutationId,Ct(this,Br,e.mutationCache),Ct(this,ea,[]),this.state=e.state||l7(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){xe(this,ea).includes(e)||(xe(this,ea).push(e),this.clearGcTimeout(),xe(this,Br).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Ct(this,ea,xe(this,ea).filter(n=>n!==e)),this.scheduleGc(),xe(this,Br).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){xe(this,ea).length||(this.state.status==="pending"?this.scheduleGc():xe(this,Br).remove(this))}continue(){var e;return((e=xe(this,cc))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var o,a,s,l,c,u,d,f,p,y,v,g,m,x,b,S,w,E,T,A;const n=()=>{Er(this,ta,As).call(this,{type:"continue"})};Ct(this,cc,sU({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(M,C)=>{Er(this,ta,As).call(this,{type:"failed",failureCount:M,error:C})},onPause:()=>{Er(this,ta,As).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>xe(this,Br).canRun(this)}));const r=this.state.status==="pending",i=!xe(this,cc).canStart();try{if(r)n();else{Er(this,ta,As).call(this,{type:"pending",variables:e,isPaused:i}),await((a=(o=xe(this,Br).config).onMutate)==null?void 0:a.call(o,e,this));const C=await((l=(s=this.options).onMutate)==null?void 0:l.call(s,e));C!==this.state.context&&Er(this,ta,As).call(this,{type:"pending",context:C,variables:e,isPaused:i})}const M=await xe(this,cc).start();return await((u=(c=xe(this,Br).config).onSuccess)==null?void 0:u.call(c,M,e,this.state.context,this)),await((f=(d=this.options).onSuccess)==null?void 0:f.call(d,M,e,this.state.context)),await((y=(p=xe(this,Br).config).onSettled)==null?void 0:y.call(p,M,null,this.state.variables,this.state.context,this)),await((g=(v=this.options).onSettled)==null?void 0:g.call(v,M,null,e,this.state.context)),Er(this,ta,As).call(this,{type:"success",data:M}),M}catch(M){try{throw await((x=(m=xe(this,Br).config).onError)==null?void 0:x.call(m,M,e,this.state.context,this)),await((S=(b=this.options).onError)==null?void 0:S.call(b,M,e,this.state.context)),await((E=(w=xe(this,Br).config).onSettled)==null?void 0:E.call(w,void 0,M,this.state.variables,this.state.context,this)),await((A=(T=this.options).onSettled)==null?void 0:A.call(T,void 0,M,e,this.state.context)),M}finally{Er(this,ta,As).call(this,{type:"error",error:M})}}finally{xe(this,Br).runNext(this)}}},ea=new WeakMap,Br=new WeakMap,cc=new WeakMap,ta=new WeakSet,As=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),zr.batch(()=>{xe(this,ea).forEach(r=>{r.onMutationUpdate(e)}),xe(this,Br).notify({mutation:this,type:"updated",action:e})})},Ck);function l7(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var za,wo,vm,Pk,c7=(Pk=class extends tx{constructor(e={}){super();Xt(this,za);Xt(this,wo);Xt(this,vm);this.config=e,Ct(this,za,new Set),Ct(this,wo,new Map),Ct(this,vm,0)}build(e,n,r){const i=new s7({mutationCache:this,mutationId:++Zm(this,vm)._,options:e.defaultMutationOptions(n),state:r});return this.add(i),i}add(e){xe(this,za).add(e);const n=vg(e);if(typeof n=="string"){const r=xe(this,wo).get(n);r?r.push(e):xe(this,wo).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(xe(this,za).delete(e)){const n=vg(e);if(typeof n=="string"){const r=xe(this,wo).get(n);if(r)if(r.length>1){const i=r.indexOf(e);i!==-1&&r.splice(i,1)}else r[0]===e&&xe(this,wo).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=vg(e);if(typeof n=="string"){const r=xe(this,wo).get(n),i=r==null?void 0:r.find(o=>o.state.status==="pending");return!i||i===e}else return!0}runNext(e){var r;const n=vg(e);if(typeof n=="string"){const i=(r=xe(this,wo).get(n))==null?void 0:r.find(o=>o!==e&&o.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){zr.batch(()=>{xe(this,za).forEach(e=>{this.notify({type:"removed",mutation:e})}),xe(this,za).clear(),xe(this,wo).clear()})}getAll(){return Array.from(xe(this,za))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>VR(n,r))}findAll(e={}){return this.getAll().filter(n=>VR(e,n))}notify(e){zr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return zr.batch(()=>Promise.all(e.map(n=>n.continue().catch(xo))))}},za=new WeakMap,wo=new WeakMap,vm=new WeakMap,Pk);function vg(t){var e;return(e=t.options.scope)==null?void 0:e.id}function XR(t){return{onFetch:(e,n)=>{var u,d,f,p,y;const r=e.options,i=(f=(d=(u=e.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,o=((p=e.state.data)==null?void 0:p.pages)||[],a=((y=e.state.data)==null?void 0:y.pageParams)||[];let s={pages:[],pageParams:[]},l=0;const c=async()=>{let v=!1;const g=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(e.signal.aborted?v=!0:e.signal.addEventListener("abort",()=>{v=!0}),e.signal)})},m=rU(e.options,e.fetchOptions),x=async(b,S,w)=>{if(v)return Promise.reject();if(S==null&&b.pages.length)return Promise.resolve(b);const T=(()=>{const P={client:e.client,queryKey:e.queryKey,pageParam:S,direction:w?"backward":"forward",meta:e.options.meta};return g(P),P})(),A=await m(T),{maxPages:M}=e.options,C=w?YW:KW;return{pages:C(b.pages,A,M),pageParams:C(b.pageParams,S,M)}};if(i&&o.length){const b=i==="backward",S=b?u7:qR,w={pages:o,pageParams:a},E=S(r,w);s=await x(w,E,b)}else{const b=t??o.length;do{const S=l===0?a[0]??r.initialPageParam:qR(r,s);if(l>0&&S==null)break;s=await x(s,S),l++}while(l{var v,g;return(g=(v=e.options).persister)==null?void 0:g.call(v,c,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=c}}}function qR(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 u7(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 Nn,js,Us,_d,wd,Fs,Sd,Ed,Rk,d7=(Rk=class{constructor(t={}){Xt(this,Nn);Xt(this,js);Xt(this,Us);Xt(this,_d);Xt(this,wd);Xt(this,Fs);Xt(this,Sd);Xt(this,Ed);Ct(this,Nn,t.queryCache||new a7),Ct(this,js,t.mutationCache||new c7),Ct(this,Us,t.defaultOptions||{}),Ct(this,_d,new Map),Ct(this,wd,new Map),Ct(this,Fs,0)}mount(){Zm(this,Fs)._++,xe(this,Fs)===1&&(Ct(this,Sd,iU.subscribe(async t=>{t&&(await this.resumePausedMutations(),xe(this,Nn).onFocus())})),Ct(this,Ed,xy.subscribe(async t=>{t&&(await this.resumePausedMutations(),xe(this,Nn).onOnline())})))}unmount(){var t,e;Zm(this,Fs)._--,xe(this,Fs)===0&&((t=xe(this,Sd))==null||t.call(this),Ct(this,Sd,void 0),(e=xe(this,Ed))==null||e.call(this),Ct(this,Ed,void 0))}isFetching(t){return xe(this,Nn).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return xe(this,js).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=xe(this,Nn).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=xe(this,Nn).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(oE(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return xe(this,Nn).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=xe(this,Nn).get(r.queryHash),o=i==null?void 0:i.state.data,a=HW(e,o);if(a!==void 0)return xe(this,Nn).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(t,e,n){return zr.batch(()=>xe(this,Nn).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=xe(this,Nn).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=xe(this,Nn);zr.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=xe(this,Nn);return zr.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=zr.batch(()=>xe(this,Nn).findAll(t).map(i=>i.cancel(n)));return Promise.all(r).then(xo).catch(xo)}invalidateQueries(t,e={}){return zr.batch(()=>(xe(this,Nn).findAll(t).forEach(n=>{n.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=zr.batch(()=>xe(this,Nn).findAll(t).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(xo)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(xo)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=xe(this,Nn).build(this,e);return n.isStaleByTime(oE(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(xo).catch(xo)}fetchInfiniteQuery(t){return t.behavior=XR(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(xo).catch(xo)}ensureInfiniteQueryData(t){return t.behavior=XR(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return xy.isOnline()?xe(this,js).resumePausedMutations():Promise.resolve()}getQueryCache(){return xe(this,Nn)}getMutationCache(){return xe(this,js)}getDefaultOptions(){return xe(this,Us)}setDefaultOptions(t){Ct(this,Us,t)}setQueryDefaults(t,e){xe(this,_d).set(yp(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...xe(this,_d).values()],n={};return e.forEach(r=>{xp(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){xe(this,wd).set(yp(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...xe(this,wd).values()],n={};return e.forEach(r=>{xp(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...xe(this,Us).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=KM(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===YM&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...xe(this,Us).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){xe(this,Nn).clear(),xe(this,js).clear()}},Nn=new WeakMap,js=new WeakMap,Us=new WeakMap,_d=new WeakMap,wd=new WeakMap,Fs=new WeakMap,Sd=new WeakMap,Ed=new WeakMap,Rk),f7=_.createContext(void 0),h7=({client:t,children:e})=>(_.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),h.jsx(f7.Provider,{value:t,children:e}));const p7={theme:"system",setTheme:()=>null},m7=_.createContext(p7);function g7({children:t,defaultTheme:e="system",storageKey:n="vite-ui-theme",...r}){const[i,o]=_.useState(()=>localStorage.getItem(n)||e);_.useEffect(()=>{const l=window.document.documentElement;if(l.classList.remove("light","dark"),i==="system"){const c=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";l.classList.add(c);return}l.classList.add(i)},[i]);const a=_.useCallback(l=>{localStorage.setItem(n,l),o(l)},[n]),s=_.useMemo(()=>({theme:i,setTheme:a}),[i,a]);return h.jsx(m7.Provider,{...r,value:s,children:t})}var v7=t=>{switch(t){case"success":return b7;case"info":return w7;case"warning":return _7;case"error":return S7;default:return null}},y7=Array(12).fill(0),x7=({visible:t,className:e})=>Q.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},Q.createElement("div",{className:"sonner-spinner"},y7.map((n,r)=>Q.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),b7=Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Q.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),_7=Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Q.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),w7=Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Q.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),S7=Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Q.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),E7=Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},Q.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Q.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),T7=()=>{let[t,e]=Q.useState(document.hidden);return Q.useEffect(()=>{let n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t},sE=1,M7=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let e=this.subscribers.indexOf(t);this.subscribers.splice(e,1)}),this.publish=t=>{this.subscribers.forEach(e=>e(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var e;let{message:n,...r}=t,i=typeof(t==null?void 0:t.id)=="number"||((e=t.id)==null?void 0:e.length)>0?t.id:sE++,o=this.toasts.find(s=>s.id===i),a=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),o?this.toasts=this.toasts.map(s=>s.id===i?(this.publish({...s,...t,id:i,title:n}),{...s,...t,id:i,dismissible:a,title:n}):s):this.addToast({title:n,...r,dismissible:a,id:i}),i},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(e=>{this.subscribers.forEach(n=>n({id:e.id,dismiss:!0}))}),this.subscribers.forEach(e=>e({id:t,dismiss:!0})),t),this.message=(t,e)=>this.create({...e,message:t}),this.error=(t,e)=>this.create({...e,message:t,type:"error"}),this.success=(t,e)=>this.create({...e,type:"success",message:t}),this.info=(t,e)=>this.create({...e,type:"info",message:t}),this.warning=(t,e)=>this.create({...e,type:"warning",message:t}),this.loading=(t,e)=>this.create({...e,type:"loading",message:t}),this.promise=(t,e)=>{if(!e)return;let n;e.loading!==void 0&&(n=this.create({...e,promise:t,type:"loading",message:e.loading,description:typeof e.description!="function"?e.description:void 0}));let r=t instanceof Promise?t:t(),i=n!==void 0,o,a=r.then(async l=>{if(o=["resolve",l],Q.isValidElement(l))i=!1,this.create({id:n,type:"default",message:l});else if(C7(l)&&!l.ok){i=!1;let c=typeof e.error=="function"?await e.error(`HTTP error! status: ${l.status}`):e.error,u=typeof e.description=="function"?await e.description(`HTTP error! status: ${l.status}`):e.description;this.create({id:n,type:"error",message:c,description:u})}else if(e.success!==void 0){i=!1;let c=typeof e.success=="function"?await e.success(l):e.success,u=typeof e.description=="function"?await e.description(l):e.description;this.create({id:n,type:"success",message:c,description:u})}}).catch(async l=>{if(o=["reject",l],e.error!==void 0){i=!1;let c=typeof e.error=="function"?await e.error(l):e.error,u=typeof e.description=="function"?await e.description(l):e.description;this.create({id:n,type:"error",message:c,description:u})}}).finally(()=>{var l;i&&(this.dismiss(n),n=void 0),(l=e.finally)==null||l.call(e)}),s=()=>new Promise((l,c)=>a.then(()=>o[0]==="reject"?c(o[1]):l(o[1])).catch(c));return typeof n!="string"&&typeof n!="number"?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(t,e)=>{let n=(e==null?void 0:e.id)||sE++;return this.create({jsx:t(n),id:n,...e}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},ni=new M7,A7=(t,e)=>{let n=(e==null?void 0:e.id)||sE++;return ni.addToast({title:t,...e,id:n}),n},C7=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",P7=A7,R7=()=>ni.toasts,N7=()=>ni.getActiveToasts(),Ur=Object.assign(P7,{success:ni.success,info:ni.info,warning:ni.warning,error:ni.error,custom:ni.custom,message:ni.message,promise:ni.promise,dismiss:ni.dismiss,loading:ni.loading},{getHistory:R7,getToasts:N7});function O7(t,{insertAt:e}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}O7(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-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;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)} +`);function yg(t){return t.label!==void 0}var I7=3,D7="32px",L7="16px",KR=4e3,k7=356,j7=14,U7=20,F7=200;function uo(...t){return t.filter(Boolean).join(" ")}function B7(t){let[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}var $7=t=>{var e,n,r,i,o,a,s,l,c,u,d;let{invert:f,toast:p,unstyled:y,interacting:v,setHeights:g,visibleToasts:m,heights:x,index:b,toasts:S,expanded:w,removeToast:E,defaultRichColors:T,closeButton:A,style:M,cancelButtonStyle:C,actionButtonStyle:P,className:R="",descriptionClassName:D="",duration:k,position:U,gap:O,loadingIcon:X,expandByDefault:L,classNames:j,icons:K,closeButtonAriaLabel:te="Close toast",pauseWhenPageIsHidden:H}=t,[q,$]=Q.useState(null),[Y,ee]=Q.useState(null),[J,ce]=Q.useState(!1),[ae,fe]=Q.useState(!1),[we,le]=Q.useState(!1),[ie,W]=Q.useState(!1),[Ve,Ne]=Q.useState(!1),[st,Re]=Q.useState(0),[ct,Ye]=Q.useState(0),it=Q.useRef(p.duration||k||KR),Ft=Q.useRef(null),Z=Q.useRef(null),F=b===0,ue=b+1<=m,me=p.type,be=p.dismissible!==!1,ge=p.className||"",rt=p.descriptionClassName||"",Ie=Q.useMemo(()=>x.findIndex(Se=>Se.toastId===p.id)||0,[x,p.id]),Ze=Q.useMemo(()=>{var Se;return(Se=p.closeButton)!=null?Se:A},[p.closeButton,A]),tt=Q.useMemo(()=>p.duration||k||KR,[p.duration,k]),Ee=Q.useRef(0),Be=Q.useRef(0),ht=Q.useRef(0),ot=Q.useRef(null),[Le,_t]=U.split("-"),re=Q.useMemo(()=>x.reduce((Se,je,vt)=>vt>=Ie?Se:Se+je.height,0),[x,Ie]),ke=T7(),Me=p.invert||f,Ge=me==="loading";Be.current=Q.useMemo(()=>Ie*O+re,[Ie,re]),Q.useEffect(()=>{it.current=tt},[tt]),Q.useEffect(()=>{ce(!0)},[]),Q.useEffect(()=>{let Se=Z.current;if(Se){let je=Se.getBoundingClientRect().height;return Ye(je),g(vt=>[{toastId:p.id,height:je,position:p.position},...vt]),()=>g(vt=>vt.filter(pt=>pt.toastId!==p.id))}},[g,p.id]),Q.useLayoutEffect(()=>{if(!J)return;let Se=Z.current,je=Se.style.height;Se.style.height="auto";let vt=Se.getBoundingClientRect().height;Se.style.height=je,Ye(vt),g(pt=>pt.find(fn=>fn.toastId===p.id)?pt.map(fn=>fn.toastId===p.id?{...fn,height:vt}:fn):[{toastId:p.id,height:vt,position:p.position},...pt])},[J,p.title,p.description,g,p.id]);let Te=Q.useCallback(()=>{fe(!0),Re(Be.current),g(Se=>Se.filter(je=>je.toastId!==p.id)),setTimeout(()=>{E(p)},F7)},[p,E,g,Be]);Q.useEffect(()=>{if(p.promise&&me==="loading"||p.duration===1/0||p.type==="loading")return;let Se;return w||v||H&&ke?(()=>{if(ht.current{var je;(je=p.onAutoClose)==null||je.call(p,p),Te()},it.current)),()=>clearTimeout(Se)},[w,v,p,me,H,ke,Te]),Q.useEffect(()=>{p.delete&&Te()},[Te,p.delete]);function _e(){var Se,je,vt;return K!=null&&K.loading?Q.createElement("div",{className:uo(j==null?void 0:j.loader,(Se=p==null?void 0:p.classNames)==null?void 0:Se.loader,"sonner-loader"),"data-visible":me==="loading"},K.loading):X?Q.createElement("div",{className:uo(j==null?void 0:j.loader,(je=p==null?void 0:p.classNames)==null?void 0:je.loader,"sonner-loader"),"data-visible":me==="loading"},X):Q.createElement(x7,{className:uo(j==null?void 0:j.loader,(vt=p==null?void 0:p.classNames)==null?void 0:vt.loader),visible:me==="loading"})}return Q.createElement("li",{tabIndex:0,ref:Z,className:uo(R,ge,j==null?void 0:j.toast,(e=p==null?void 0:p.classNames)==null?void 0:e.toast,j==null?void 0:j.default,j==null?void 0:j[me],(n=p==null?void 0:p.classNames)==null?void 0:n[me]),"data-sonner-toast":"","data-rich-colors":(r=p.richColors)!=null?r:T,"data-styled":!(p.jsx||p.unstyled||y),"data-mounted":J,"data-promise":!!p.promise,"data-swiped":Ve,"data-removed":ae,"data-visible":ue,"data-y-position":Le,"data-x-position":_t,"data-index":b,"data-front":F,"data-swiping":we,"data-dismissible":be,"data-type":me,"data-invert":Me,"data-swipe-out":ie,"data-swipe-direction":Y,"data-expanded":!!(w||L&&J),style:{"--index":b,"--toasts-before":b,"--z-index":S.length-b,"--offset":`${ae?st:Be.current}px`,"--initial-height":L?"auto":`${ct}px`,...M,...p.style},onDragEnd:()=>{le(!1),$(null),ot.current=null},onPointerDown:Se=>{Ge||!be||(Ft.current=new Date,Re(Be.current),Se.target.setPointerCapture(Se.pointerId),Se.target.tagName!=="BUTTON"&&(le(!0),ot.current={x:Se.clientX,y:Se.clientY}))},onPointerUp:()=>{var Se,je,vt,pt;if(ie||!be)return;ot.current=null;let fn=Number(((Se=Z.current)==null?void 0:Se.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),jn=Number(((je=Z.current)==null?void 0:je.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ui=new Date().getTime()-((vt=Ft.current)==null?void 0:vt.getTime()),wr=q==="x"?fn:jn,nr=Math.abs(wr)/Ui;if(Math.abs(wr)>=U7||nr>.11){Re(Be.current),(pt=p.onDismiss)==null||pt.call(p,p),ee(q==="x"?fn>0?"right":"left":jn>0?"down":"up"),Te(),W(!0),Ne(!1);return}le(!1),$(null)},onPointerMove:Se=>{var je,vt,pt,fn;if(!ot.current||!be||((je=window.getSelection())==null?void 0:je.toString().length)>0)return;let jn=Se.clientY-ot.current.y,Ui=Se.clientX-ot.current.x,wr=(vt=t.swipeDirections)!=null?vt:B7(U);!q&&(Math.abs(Ui)>1||Math.abs(jn)>1)&&$(Math.abs(Ui)>Math.abs(jn)?"x":"y");let nr={x:0,y:0};q==="y"?(wr.includes("top")||wr.includes("bottom"))&&(wr.includes("top")&&jn<0||wr.includes("bottom")&&jn>0)&&(nr.y=jn):q==="x"&&(wr.includes("left")||wr.includes("right"))&&(wr.includes("left")&&Ui<0||wr.includes("right")&&Ui>0)&&(nr.x=Ui),(Math.abs(nr.x)>0||Math.abs(nr.y)>0)&&Ne(!0),(pt=Z.current)==null||pt.style.setProperty("--swipe-amount-x",`${nr.x}px`),(fn=Z.current)==null||fn.style.setProperty("--swipe-amount-y",`${nr.y}px`)}},Ze&&!p.jsx?Q.createElement("button",{"aria-label":te,"data-disabled":Ge,"data-close-button":!0,onClick:Ge||!be?()=>{}:()=>{var Se;Te(),(Se=p.onDismiss)==null||Se.call(p,p)},className:uo(j==null?void 0:j.closeButton,(i=p==null?void 0:p.classNames)==null?void 0:i.closeButton)},(o=K==null?void 0:K.close)!=null?o:E7):null,p.jsx||_.isValidElement(p.title)?p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title:Q.createElement(Q.Fragment,null,me||p.icon||p.promise?Q.createElement("div",{"data-icon":"",className:uo(j==null?void 0:j.icon,(a=p==null?void 0:p.classNames)==null?void 0:a.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||_e():null,p.type!=="loading"?p.icon||(K==null?void 0:K[me])||v7(me):null):null,Q.createElement("div",{"data-content":"",className:uo(j==null?void 0:j.content,(s=p==null?void 0:p.classNames)==null?void 0:s.content)},Q.createElement("div",{"data-title":"",className:uo(j==null?void 0:j.title,(l=p==null?void 0:p.classNames)==null?void 0:l.title)},typeof p.title=="function"?p.title():p.title),p.description?Q.createElement("div",{"data-description":"",className:uo(D,rt,j==null?void 0:j.description,(c=p==null?void 0:p.classNames)==null?void 0:c.description)},typeof p.description=="function"?p.description():p.description):null),_.isValidElement(p.cancel)?p.cancel:p.cancel&&yg(p.cancel)?Q.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||C,onClick:Se=>{var je,vt;yg(p.cancel)&&be&&((vt=(je=p.cancel).onClick)==null||vt.call(je,Se),Te())},className:uo(j==null?void 0:j.cancelButton,(u=p==null?void 0:p.classNames)==null?void 0:u.cancelButton)},p.cancel.label):null,_.isValidElement(p.action)?p.action:p.action&&yg(p.action)?Q.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||P,onClick:Se=>{var je,vt;yg(p.action)&&((vt=(je=p.action).onClick)==null||vt.call(je,Se),!Se.defaultPrevented&&Te())},className:uo(j==null?void 0:j.actionButton,(d=p==null?void 0:p.classNames)==null?void 0:d.actionButton)},p.action.label):null))};function YR(){if(typeof window>"u"||typeof document>"u")return"ltr";let t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function z7(t,e){let n={};return[t,e].forEach((r,i)=>{let o=i===1,a=o?"--mobile-offset":"--offset",s=o?L7:D7;function l(c){["top","right","bottom","left"].forEach(u=>{n[`${a}-${u}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{r[c]===void 0?n[`${a}-${c}`]=s:n[`${a}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):l(s)}),n}_.forwardRef(function(t,e){let{invert:n,position:r="bottom-right",hotkey:i=["altKey","KeyT"],expand:o,closeButton:a,className:s,offset:l,mobileOffset:c,theme:u="light",richColors:d,duration:f,style:p,visibleToasts:y=I7,toastOptions:v,dir:g=YR(),gap:m=j7,loadingIcon:x,icons:b,containerAriaLabel:S="Notifications",pauseWhenPageIsHidden:w}=t,[E,T]=Q.useState([]),A=Q.useMemo(()=>Array.from(new Set([r].concat(E.filter(H=>H.position).map(H=>H.position)))),[E,r]),[M,C]=Q.useState([]),[P,R]=Q.useState(!1),[D,k]=Q.useState(!1),[U,O]=Q.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),X=Q.useRef(null),L=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),j=Q.useRef(null),K=Q.useRef(!1),te=Q.useCallback(H=>{T(q=>{var $;return($=q.find(Y=>Y.id===H.id))!=null&&$.delete||ni.dismiss(H.id),q.filter(({id:Y})=>Y!==H.id)})},[]);return Q.useEffect(()=>ni.subscribe(H=>{if(H.dismiss){T(q=>q.map($=>$.id===H.id?{...$,delete:!0}:$));return}setTimeout(()=>{H3.flushSync(()=>{T(q=>{let $=q.findIndex(Y=>Y.id===H.id);return $!==-1?[...q.slice(0,$),{...q[$],...H},...q.slice($+1)]:[H,...q]})})})}),[]),Q.useEffect(()=>{if(u!=="system"){O(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?O("dark"):O("light")),typeof window>"u")return;let H=window.matchMedia("(prefers-color-scheme: dark)");try{H.addEventListener("change",({matches:q})=>{O(q?"dark":"light")})}catch{H.addListener(({matches:$})=>{try{O($?"dark":"light")}catch(Y){console.error(Y)}})}},[u]),Q.useEffect(()=>{E.length<=1&&R(!1)},[E]),Q.useEffect(()=>{let H=q=>{var $,Y;i.every(ee=>q[ee]||q.code===ee)&&(R(!0),($=X.current)==null||$.focus()),q.code==="Escape"&&(document.activeElement===X.current||(Y=X.current)!=null&&Y.contains(document.activeElement))&&R(!1)};return document.addEventListener("keydown",H),()=>document.removeEventListener("keydown",H)},[i]),Q.useEffect(()=>{if(X.current)return()=>{j.current&&(j.current.focus({preventScroll:!0}),j.current=null,K.current=!1)}},[X.current]),Q.createElement("section",{ref:e,"aria-label":`${S} ${L}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},A.map((H,q)=>{var $;let[Y,ee]=H.split("-");return E.length?Q.createElement("ol",{key:H,dir:g==="auto"?YR():g,tabIndex:-1,ref:X,className:s,"data-sonner-toaster":!0,"data-theme":U,"data-y-position":Y,"data-lifted":P&&E.length>1&&!o,"data-x-position":ee,style:{"--front-toast-height":`${(($=M[0])==null?void 0:$.height)||0}px`,"--width":`${k7}px`,"--gap":`${m}px`,...p,...z7(l,c)},onBlur:J=>{K.current&&!J.currentTarget.contains(J.relatedTarget)&&(K.current=!1,j.current&&(j.current.focus({preventScroll:!0}),j.current=null))},onFocus:J=>{J.target instanceof HTMLElement&&J.target.dataset.dismissible==="false"||K.current||(K.current=!0,j.current=J.relatedTarget)},onMouseEnter:()=>R(!0),onMouseMove:()=>R(!0),onMouseLeave:()=>{D||R(!1)},onDragEnd:()=>R(!1),onPointerDown:J=>{J.target instanceof HTMLElement&&J.target.dataset.dismissible==="false"||k(!0)},onPointerUp:()=>k(!1)},E.filter(J=>!J.position&&q===0||J.position===H).map((J,ce)=>{var ae,fe;return Q.createElement($7,{key:J.id,icons:b,index:ce,toast:J,defaultRichColors:d,duration:(ae=v==null?void 0:v.duration)!=null?ae:f,className:v==null?void 0:v.className,descriptionClassName:v==null?void 0:v.descriptionClassName,invert:n,visibleToasts:y,closeButton:(fe=v==null?void 0:v.closeButton)!=null?fe:a,interacting:D,position:H,style:v==null?void 0:v.style,unstyled:v==null?void 0:v.unstyled,classNames:v==null?void 0:v.classNames,cancelButtonStyle:v==null?void 0:v.cancelButtonStyle,actionButtonStyle:v==null?void 0:v.actionButtonStyle,removeToast:te,toasts:E.filter(we=>we.position==J.position),heights:M.filter(we=>we.position==J.position),setHeights:C,expandByDefault:o,gap:m,loadingIcon:x,expanded:P,pauseWhenPageIsHidden:w,swipeDirections:t.swipeDirections})})):null}))});function H7(t){if(!(t instanceof DataTransfer))throw new Error('Data must be of type "DataTransfer"');const e={};function n(r){const i=a=>a!==null&&typeof a=="object"&&"isFile"in a&&typeof a.file=="function"&&"fullPath"in a,o=a=>a!==null&&typeof a=="object"&&"isFile"in a&&typeof a.createReader=="function";if(i(r)&&r.isFile)return new Promise(a=>{r.file(s=>{e[r.fullPath]=s,a()})});if(o(r)&&!r.isFile){const a=r.createReader();return new Promise(s=>{const l=[];function c(){a.readEntries(u=>{u.length===0?Promise.all(l).then(()=>s()):(u.forEach(d=>{l.push(n(d))}),c())})}c()})}return Promise.resolve()}return new Promise(r=>{const i=t.items&&Array.from(t.items),o=Array.from(t.files);if(i&&i.length&&"webkitGetAsEntry"in i[0]){const a=[];for(let s=0;sr(e))}else o.filter(a=>a.size!==0).forEach(a=>e["/"+a.name]=a),r(e)})}function JR(t){return t.replace(/\\/g,"/").split(/\//g).reduce((e,n)=>(n===".."?e.pop():n!=="."&&e.push(n),e),[]).join("/")}function ZR(t){return new Promise((e,n)=>{const r=new FileReader;r.onload=i=>{i.target&&i.target.result?e(i.target.result):n(new Error("Failed to read Urdf file content"))},r.onerror=()=>n(new Error("Error reading Urdf file")),r.readAsText(t)})}async function V7(t,e){const n=await H7(t),r=Object.keys(n).map(a=>JR(a)),i=r.filter(a=>/urdf$/i.test(a)),o={};if(i.forEach(a=>{o[a]=URL.createObjectURL(n[a])}),i.length>0){const s=i[0].match(/^(\/[^/]+\/)/);s&&s[1]&&s[1]}return e.setUrlModifierFunc(a=>{var u;const l=JR(a).split("/").pop()||"";let c=r.find(d=>d.endsWith(l));if(!c&&l.includes(".")){const d="."+l.split(".").pop();c=r.find(f=>f.endsWith(d))}if(c!=null){const d=((u=c.split(".").pop())==null?void 0:u.toLowerCase())||"",f=new Blob([n[c]],{type:G7(d)}),p=URL.createObjectURL(f)+"#."+d;return setTimeout(()=>URL.revokeObjectURL(p),5e3),p}return console.warn(`No matching file found for: ${a}`),a}),{files:n,availableModels:i,blobUrls:o}}function G7(t){switch(t.toLowerCase()){case"stl":return"model/stl";case"obj":return"model/obj";case"gltf":case"glb":return"model/gltf+json";case"dae":return"model/vnd.collada+xml";case"urdf":return"application/xml";default:return"application/octet-stream"}}const cU=_.createContext(void 0),W7=({children:t})=>{const[e,n]=_.useState(null),[r,i]=_.useState({}),[o,a]=_.useState([]),[s,l]=_.useState(!1),[c,u]=_.useState([]),[d,f]=_.useState(!0),[p,y]=_.useState(null),[v,g]=_.useState(null);_.useEffect(()=>{if(!d||p)return;let P=!1;return(async()=>{try{const R=await fetch("/so-101-urdf/urdf/so101_new_calib.urdf");if(!R.ok)throw new Error(`Failed to fetch default Urdf: ${R.statusText}`);const D=await R.text();P||y(D)}catch(R){P||console.error("Error loading default Urdf content:",R)}})(),()=>{P=!0}},[d,p]);const m=_.useRef([]),x=_.useCallback(()=>{f(!0),y(null),g(null),Ur.info("Switched to default model",{description:"The default ARM100 robot model is now displayed."})},[]),b=_.useCallback(P=>(m.current.push(P),()=>{m.current=m.current.filter(R=>R!==P)}),[]),S=_.useCallback(P=>{n(P)},[]),w=_.useCallback(P=>{P.hasUrdf?f(!1):x(),m.current.forEach(R=>R(P))},[x]),E=_.useCallback(async P=>{var k;if(!e)return;const R=Object.values(r).filter(U=>U===P.blobUrl).map(U=>{const O=Object.keys(r).find(X=>r[X]===U);return O?{path:O,url:U}:null}).filter(U=>U!==null);if(R.length===0){console.error("โŒ Could not find file for selected Urdf model");return}const D=Ur.loading("Loading Urdf model...",{description:"Preparing 3D visualization",duration:5e3});try{const U=(k=R[0])==null?void 0:k.path;if(!U||!r[U])throw new Error("File not found in records");const X=await(await fetch(P.blobUrl)).blob(),L=new File([X],U.split("/").pop()||"model.urdf",{type:"application/xml"}),j=await ZR(L);y(j),Ur.dismiss(D),f(!1);const K=P.name||P.path.split("/").pop()||"Unknown";Ur.success("Urdf model loaded successfully",{description:`Model: ${K}`,duration:3e3}),w({hasUrdf:!0,modelName:K})}catch(U){console.error("โŒ Error processing selected Urdf:",U),Ur.dismiss(D),Ur.error("Error loading Urdf",{description:`Error: ${U instanceof Error?U.message:String(U)}`,duration:3e3})}},[r,e,w]),T=_.useCallback(P=>{var D;if(!e){console.error("โŒ No Urdf processor available");return}l(!1);const R=P.name||((D=P.path.split("/").pop())==null?void 0:D.replace(/\.urdf$/i,""))||"Unknown";e.loadUrdf(P.blobUrl),f(!1),Ur.info(`Loading model: ${R}`,{description:"Preparing 3D visualization",duration:2e3}),w({hasUrdf:!0,modelName:R}),E(P)},[e,w,E]),A=_.useCallback(async(P,R)=>{Object.values(r).forEach(URL.revokeObjectURL),i({}),a([]),u([]);try{if(R.length>0&&e){const D={};R.forEach(U=>{P[U]&&(D[U]=URL.createObjectURL(P[U]))}),i(D),a(R);const k=R.map(U=>{const X=(U.split("/").pop()||"").replace(/\.urdf$/i,"");return{path:U,blobUrl:D[U],name:X}});if(u(k),R.length===1){const O=(R[0].split("/").pop()||"").replace(/\.urdf$/i,""),X=D[R[0]];if(X)if(e.loadUrdf(X),f(!1),P[R[0]]){const L=Ur.loading("Loading Urdf model...",{description:"Preparing 3D visualization",duration:5e3});try{const j=await ZR(P[R[0]]);y(j),Ur.dismiss(L),Ur.success("Urdf model loaded successfully",{description:`Model: ${O}`,duration:3e3}),w({hasUrdf:!0,modelName:O})}catch(j){console.error("Error loading Urdf:",j),Ur.dismiss(L),Ur.error("Error loading Urdf",{description:`Error: ${j instanceof Error?j.message:String(j)}`,duration:3e3}),w({hasUrdf:!0,modelName:O})}}else console.error("Could not find file for Urdf model:",R[0]),w({hasUrdf:!0,modelName:O});else console.warn(`No blob URL found for ${R[0]}, using path directly`),e.loadUrdf(R[0]),f(!1),w({hasUrdf:!0,modelName:O})}else l(!0),w({hasUrdf:!0,modelName:"Multiple models available"})}else w({hasUrdf:!1}),x(),Ur.error("No Urdf file found",{description:"Please upload a folder containing a .urdf file.",duration:3e3})}catch(D){console.error("Error processing Urdf files:",D),Ur.error("Error processing files",{description:`Error: ${D instanceof Error?D.message:String(D)}`,duration:3e3}),x()}},[w,r,e,x]),M=_.useRef(r);M.current=r,_.useEffect(()=>()=>{Object.values(M.current).forEach(URL.revokeObjectURL)},[]);const C=_.useMemo(()=>({urdfProcessor:e,registerUrdfProcessor:S,onUrdfDetected:b,processUrdfFiles:A,urdfBlobUrls:r,alternativeUrdfModels:o,isSelectionModalOpen:s,setIsSelectionModalOpen:l,urdfModelOptions:c,selectUrdfModel:T,isDefaultModel:d,setIsDefaultModel:f,resetToDefaultModel:x,urdfContent:p,currentAnimationConfig:v,setCurrentAnimationConfig:g}),[e,S,b,A,r,o,s,c,T,d,x,p,v]);return h.jsx(cU.Provider,{value:C,children:t})},uU=()=>{const t=_.useContext(cU);if(t===void 0)throw new Error("useUrdf must be used within a UrdfProvider");return t},X7=_.createContext(void 0),q7=({children:t})=>{const[e,n]=_.useState(!1),{urdfProcessor:r,processUrdfFiles:i}=uU(),o=u=>{u.preventDefault(),u.stopPropagation()},a=u=>{u.preventDefault(),u.stopPropagation(),n(!0)},s=u=>{u.preventDefault(),u.stopPropagation(),(!u.relatedTarget||!u.relatedTarget.closest("html"))&&n(!1)},l=_.useCallback(async u=>{if(u.preventDefault(),u.stopPropagation(),n(!1),!(!u.dataTransfer||!r))try{const{availableModels:d,files:f}=await V7(u.dataTransfer,r);await i(f,d)}catch(d){console.error("Error in handleDrop:",d)}},[r,i]);_.useEffect(()=>(document.addEventListener("dragover",o),document.addEventListener("dragenter",a),document.addEventListener("dragleave",s),document.addEventListener("drop",l),()=>{document.removeEventListener("dragover",o),document.removeEventListener("dragenter",a),document.removeEventListener("dragleave",s),document.removeEventListener("drop",l)}),[l]);const c=_.useMemo(()=>({isDragging:e,setIsDragging:n,handleDrop:l}),[e,l]);return h.jsxs(X7.Provider,{value:c,children:[t,e&&h.jsx("div",{className:"fixed inset-0 bg-primary/10 pointer-events-none z-50 flex items-center justify-center",children:h.jsxs("div",{className:"bg-background p-8 rounded-lg shadow-lg text-center",children:[h.jsx("div",{className:"text-3xl font-bold mb-4",children:"Drop Urdf Files Here"}),h.jsx("p",{className:"text-muted-foreground",children:"Release to upload your robot model"})]})})]})},K7=1,Y7=1e6;let A_=0;function J7(){return A_=(A_+1)%Number.MAX_SAFE_INTEGER,A_.toString()}const C_=new Map,QR=t=>{if(C_.has(t))return;const e=setTimeout(()=>{C_.delete(t),Vh({type:"REMOVE_TOAST",toastId:t})},Y7);C_.set(t,e)},Z7=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,K7)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(n=>n.id===e.toast.id?{...n,...e.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=e;return n?QR(n):t.toasts.forEach(r=>{QR(r.id)}),{...t,toasts:t.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(n=>n.id!==e.toastId)}}},Dv=[];let Lv={toasts:[]};function Vh(t){Lv=Z7(Lv,t),Dv.forEach(e=>{e(Lv)})}function Q7({...t}){const e=J7(),n=i=>Vh({type:"UPDATE_TOAST",toast:{...i,id:e}}),r=()=>Vh({type:"DISMISS_TOAST",toastId:e});return Vh({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:i=>{i||r()}}}),{id:e,dismiss:r,update:n}}function _r(){const[t,e]=_.useState(Lv);return _.useEffect(()=>(Dv.push(e),()=>{const n=Dv.indexOf(e);n>-1&&Dv.splice(n,1)}),[t]),{...t,toast:Q7,dismiss:n=>Vh({type:"DISMISS_TOAST",toastId:n})}}function Oe(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t==null||t(i),n===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function eN(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function is(...t){return e=>{let n=!1;const r=t.map(i=>{const o=eN(i,e);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i{const{children:a,...s}=o,l=_.useMemo(()=>s,Object.values(s));return h.jsx(n.Provider,{value:l,children:a})};r.displayName=t+"Provider";function i(o){const a=_.useContext(n);if(a)return a;if(e!==void 0)return e;throw new Error(`\`${o}\` must be used within \`${t}\``)}return[r,i]}function mi(t,e=[]){let n=[];function r(o,a){const s=_.createContext(a),l=n.length;n=[...n,a];const c=d=>{var m;const{scope:f,children:p,...y}=d,v=((m=f==null?void 0:f[t])==null?void 0:m[l])||s,g=_.useMemo(()=>y,Object.values(y));return h.jsx(v.Provider,{value:g,children:p})};c.displayName=o+"Provider";function u(d,f){var v;const p=((v=f==null?void 0:f[t])==null?void 0:v[l])||s,y=_.useContext(p);if(y)return y;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${o}\``)}return[c,u]}const i=()=>{const o=n.map(a=>_.createContext(a));return function(s){const l=(s==null?void 0:s[t])||o;return _.useMemo(()=>({[`__scope${t}`]:{...s,[t]:l}}),[s,l])}};return i.scopeName=t,[r,t9(i,...e)]}function t9(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((s,{useScope:l,scopeName:c})=>{const d=l(o)[`__scope${c}`];return{...s,...d}},{});return _.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}function sl(t){const e=r9(t),n=_.forwardRef((r,i)=>{const{children:o,...a}=r,s=_.Children.toArray(o),l=s.find(i9);if(l){const c=l.props.children,u=s.map(d=>d===l?_.Children.count(c)>1?_.Children.only(null):_.isValidElement(c)?c.props.children:null:d);return h.jsx(e,{...a,ref:i,children:_.isValidElement(c)?_.cloneElement(c,void 0,u):null})}return h.jsx(e,{...a,ref:i,children:o})});return n.displayName=`${t}.Slot`,n}var n9=sl("Slot");function r9(t){const e=_.forwardRef((n,r)=>{const{children:i,...o}=n;if(_.isValidElement(i)){const a=a9(i),s=o9(o,i.props);return i.type!==_.Fragment&&(s.ref=r?is(r,a):a),_.cloneElement(i,s)}return _.Children.count(i)>1?_.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var dU=Symbol("radix.slottable");function fU(t){const e=({children:n})=>h.jsx(h.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=dU,e}function i9(t){return _.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===dU}function o9(t,e){const n={...e};for(const r in e){const i=t[r],o=e[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{const l=o(...s);return i(...s),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...t,...n}}function a9(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function rx(t){const e=t+"CollectionProvider",[n,r]=mi(e),[i,o]=n(e,{collectionRef:{current:null},itemMap:new Map}),a=v=>{const{scope:g,children:m}=v,x=Q.useRef(null),b=Q.useRef(new Map).current;return h.jsx(i,{scope:g,itemMap:b,collectionRef:x,children:m})};a.displayName=e;const s=t+"CollectionSlot",l=sl(s),c=Q.forwardRef((v,g)=>{const{scope:m,children:x}=v,b=o(s,m),S=Ot(g,b.collectionRef);return h.jsx(l,{ref:S,children:x})});c.displayName=s;const u=t+"CollectionItemSlot",d="data-radix-collection-item",f=sl(u),p=Q.forwardRef((v,g)=>{const{scope:m,children:x,...b}=v,S=Q.useRef(null),w=Ot(g,S),E=o(u,m);return Q.useEffect(()=>(E.itemMap.set(S,{ref:S,...b}),()=>void E.itemMap.delete(S))),h.jsx(f,{[d]:"",ref:w,children:x})});p.displayName=u;function y(v){const g=o(t+"CollectionConsumer",v);return Q.useCallback(()=>{const x=g.collectionRef.current;if(!x)return[];const b=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(g.itemMap.values()).sort((E,T)=>b.indexOf(E.ref.current)-b.indexOf(T.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:a,Slot:c,ItemSlot:p},y,r]}var s9=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],nt=s9.reduce((t,e)=>{const n=sl(`Primitive.${e}`),r=_.forwardRef((i,o)=>{const{asChild:a,...s}=i,l=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(l,{...s,ref:o})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function JM(t,e){t&&Bc.flushSync(()=>t.dispatchEvent(e))}function di(t){const e=_.useRef(t);return _.useEffect(()=>{e.current=t}),_.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function l9(t,e=globalThis==null?void 0:globalThis.document){const n=di(t);_.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var c9="DismissableLayer",lE="dismissableLayer.update",u9="dismissableLayer.pointerDownOutside",d9="dismissableLayer.focusOutside",tN,hU=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),zc=_.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:a,onDismiss:s,...l}=t,c=_.useContext(hU),[u,d]=_.useState(null),f=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=_.useState({}),y=Ot(e,T=>d(T)),v=Array.from(c.layers),[g]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),m=v.indexOf(g),x=u?v.indexOf(u):-1,b=c.layersWithOutsidePointerEventsDisabled.size>0,S=x>=m,w=h9(T=>{const A=T.target,M=[...c.branches].some(C=>C.contains(A));!S||M||(i==null||i(T),a==null||a(T),T.defaultPrevented||s==null||s())},f),E=p9(T=>{const A=T.target;[...c.branches].some(C=>C.contains(A))||(o==null||o(T),a==null||a(T),T.defaultPrevented||s==null||s())},f);return l9(T=>{x===c.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&s&&(T.preventDefault(),s()))},f),_.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(tN=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),nN(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=tN)}},[u,f,n,c]),_.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),nN())},[u,c]),_.useEffect(()=>{const T=()=>p({});return document.addEventListener(lE,T),()=>document.removeEventListener(lE,T)},[]),h.jsx(nt.div,{...l,ref:y,style:{pointerEvents:b?S?"auto":"none":void 0,...t.style},onFocusCapture:Oe(t.onFocusCapture,E.onFocusCapture),onBlurCapture:Oe(t.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Oe(t.onPointerDownCapture,w.onPointerDownCapture)})});zc.displayName=c9;var f9="DismissableLayerBranch",pU=_.forwardRef((t,e)=>{const n=_.useContext(hU),r=_.useRef(null),i=Ot(e,r);return _.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),h.jsx(nt.div,{...t,ref:i})});pU.displayName=f9;function h9(t,e=globalThis==null?void 0:globalThis.document){const n=di(t),r=_.useRef(!1),i=_.useRef(()=>{});return _.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let l=function(){mU(u9,n,c,{discrete:!0})};const c={originalEvent:s};s.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=l,e.addEventListener("click",i.current,{once:!0})):l()}else e.removeEventListener("click",i.current);r.current=!1},a=window.setTimeout(()=>{e.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),e.removeEventListener("pointerdown",o),e.removeEventListener("click",i.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function p9(t,e=globalThis==null?void 0:globalThis.document){const n=di(t),r=_.useRef(!1);return _.useEffect(()=>{const i=o=>{o.target&&!r.current&&mU(d9,n,{originalEvent:o},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function nN(){const t=new CustomEvent(lE);document.dispatchEvent(t)}function mU(t,e,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?JM(i,o):i.dispatchEvent(o)}var m9=zc,g9=pU,ur=globalThis!=null&&globalThis.document?_.useLayoutEffect:()=>{},v9="Portal",vf=_.forwardRef((t,e)=>{var s;const{container:n,...r}=t,[i,o]=_.useState(!1);ur(()=>o(!0),[]);const a=n||i&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return a?H3.createPortal(h.jsx(nt.div,{...r,ref:e}),a):null});vf.displayName=v9;function y9(t,e){return _.useReducer((n,r)=>e[n][r]??n,t)}var gi=t=>{const{present:e,children:n}=t,r=x9(e),i=typeof n=="function"?n({present:r.isPresent}):_.Children.only(n),o=Ot(r.ref,b9(i));return typeof n=="function"||r.isPresent?_.cloneElement(i,{ref:o}):null};gi.displayName="Presence";function x9(t){const[e,n]=_.useState(),r=_.useRef(null),i=_.useRef(t),o=_.useRef("none"),a=t?"mounted":"unmounted",[s,l]=y9(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const c=xg(r.current);o.current=s==="mounted"?c:"none"},[s]),ur(()=>{const c=r.current,u=i.current;if(u!==t){const f=o.current,p=xg(c);t?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&f!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,l]),ur(()=>{if(e){let c;const u=e.ownerDocument.defaultView??window,d=p=>{const v=xg(r.current).includes(p.animationName);if(p.target===e&&v&&(l("ANIMATION_END"),!i.current)){const g=e.style.animationFillMode;e.style.animationFillMode="forwards",c=u.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=g)})}},f=p=>{p.target===e&&(o.current=xg(r.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",d),e.addEventListener("animationend",d),()=>{u.clearTimeout(c),e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",d),e.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:_.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function xg(t){return(t==null?void 0:t.animationName)||"none"}function b9(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var _9=rM[" useInsertionEffect ".trim().toString()]||ur;function zo({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[i,o,a]=w9({defaultProp:e,onChange:n}),s=t!==void 0,l=s?t:i;{const u=_.useRef(t!==void 0);_.useEffect(()=>{const d=u.current;d!==s&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=s},[s,r])}const c=_.useCallback(u=>{var d;if(s){const f=S9(u)?u(t):u;f!==t&&((d=a.current)==null||d.call(a,f))}else o(u)},[s,t,o,a]);return[l,c]}function w9({defaultProp:t,onChange:e}){const[n,r]=_.useState(t),i=_.useRef(n),o=_.useRef(e);return _9(()=>{o.current=e},[e]),_.useEffect(()=>{var a;i.current!==n&&((a=o.current)==null||a.call(o,n),i.current=n)},[n,i]),[n,r,o]}function S9(t){return typeof t=="function"}var gU=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),E9="VisuallyHidden",ix=_.forwardRef((t,e)=>h.jsx(nt.span,{...t,ref:e,style:{...gU,...t.style}}));ix.displayName=E9;var T9=ix,ZM="ToastProvider",[QM,M9,A9]=rx("Toast"),[vU,SDe]=mi("Toast",[A9]),[C9,ox]=vU(ZM),yU=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:i="right",swipeThreshold:o=50,children:a}=t,[s,l]=_.useState(null),[c,u]=_.useState(0),d=_.useRef(!1),f=_.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${ZM}\`. Expected non-empty \`string\`.`),h.jsx(QM.Provider,{scope:e,children:h.jsx(C9,{scope:e,label:n,duration:r,swipeDirection:i,swipeThreshold:o,toastCount:c,viewport:s,onViewportChange:l,onToastAdd:_.useCallback(()=>u(p=>p+1),[]),onToastRemove:_.useCallback(()=>u(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:a})})};yU.displayName=ZM;var xU="ToastViewport",P9=["F8"],cE="toast.viewportPause",uE="toast.viewportResume",bU=_.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=P9,label:i="Notifications ({hotkey})",...o}=t,a=ox(xU,n),s=M9(n),l=_.useRef(null),c=_.useRef(null),u=_.useRef(null),d=_.useRef(null),f=Ot(e,d,a.onViewportChange),p=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),y=a.toastCount>0;_.useEffect(()=>{const g=m=>{var b;r.length!==0&&r.every(S=>m[S]||m.code===S)&&((b=d.current)==null||b.focus())};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[r]),_.useEffect(()=>{const g=l.current,m=d.current;if(y&&g&&m){const x=()=>{if(!a.isClosePausedRef.current){const E=new CustomEvent(cE);m.dispatchEvent(E),a.isClosePausedRef.current=!0}},b=()=>{if(a.isClosePausedRef.current){const E=new CustomEvent(uE);m.dispatchEvent(E),a.isClosePausedRef.current=!1}},S=E=>{!g.contains(E.relatedTarget)&&b()},w=()=>{g.contains(document.activeElement)||b()};return g.addEventListener("focusin",x),g.addEventListener("focusout",S),g.addEventListener("pointermove",x),g.addEventListener("pointerleave",w),window.addEventListener("blur",x),window.addEventListener("focus",b),()=>{g.removeEventListener("focusin",x),g.removeEventListener("focusout",S),g.removeEventListener("pointermove",x),g.removeEventListener("pointerleave",w),window.removeEventListener("blur",x),window.removeEventListener("focus",b)}}},[y,a.isClosePausedRef]);const v=_.useCallback(({tabbingDirection:g})=>{const x=s().map(b=>{const S=b.ref.current,w=[S,...z9(S)];return g==="forwards"?w:w.reverse()});return(g==="forwards"?x.reverse():x).flat()},[s]);return _.useEffect(()=>{const g=d.current;if(g){const m=x=>{var w,E,T;const b=x.altKey||x.ctrlKey||x.metaKey;if(x.key==="Tab"&&!b){const A=document.activeElement,M=x.shiftKey;if(x.target===g&&M){(w=c.current)==null||w.focus();return}const R=v({tabbingDirection:M?"backwards":"forwards"}),D=R.findIndex(k=>k===A);P_(R.slice(D+1))?x.preventDefault():M?(E=c.current)==null||E.focus():(T=u.current)==null||T.focus()}};return g.addEventListener("keydown",m),()=>g.removeEventListener("keydown",m)}},[s,v]),h.jsxs(g9,{ref:l,role:"region","aria-label":i.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:y?void 0:"none"},children:[y&&h.jsx(dE,{ref:c,onFocusFromOutsideViewport:()=>{const g=v({tabbingDirection:"forwards"});P_(g)}}),h.jsx(QM.Slot,{scope:n,children:h.jsx(nt.ol,{tabIndex:-1,...o,ref:f})}),y&&h.jsx(dE,{ref:u,onFocusFromOutsideViewport:()=>{const g=v({tabbingDirection:"backwards"});P_(g)}})]})});bU.displayName=xU;var _U="ToastFocusProxy",dE=_.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=t,o=ox(_U,n);return h.jsx(ix,{"aria-hidden":!0,tabIndex:0,...i,ref:e,style:{position:"fixed"},onFocus:a=>{var c;const s=a.relatedTarget;!((c=o.viewport)!=null&&c.contains(s))&&r()}})});dE.displayName=_U;var Sm="Toast",R9="toast.swipeStart",N9="toast.swipeMove",O9="toast.swipeCancel",I9="toast.swipeEnd",wU=_.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:i,onOpenChange:o,...a}=t,[s,l]=zo({prop:r,defaultProp:i??!0,onChange:o,caller:Sm});return h.jsx(gi,{present:n||s,children:h.jsx(k9,{open:s,...a,ref:e,onClose:()=>l(!1),onPause:di(t.onPause),onResume:di(t.onResume),onSwipeStart:Oe(t.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Oe(t.onSwipeMove,c=>{const{x:u,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${d}px`)}),onSwipeCancel:Oe(t.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Oe(t.onSwipeEnd,c=>{const{x:u,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${d}px`),l(!1)})})})});wU.displayName=Sm;var[D9,L9]=vU(Sm,{onClose(){}}),k9=_.forwardRef((t,e)=>{const{__scopeToast:n,type:r="foreground",duration:i,open:o,onClose:a,onEscapeKeyDown:s,onPause:l,onResume:c,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:p,...y}=t,v=ox(Sm,n),[g,m]=_.useState(null),x=Ot(e,k=>m(k)),b=_.useRef(null),S=_.useRef(null),w=i||v.duration,E=_.useRef(0),T=_.useRef(w),A=_.useRef(0),{onToastAdd:M,onToastRemove:C}=v,P=di(()=>{var U;(g==null?void 0:g.contains(document.activeElement))&&((U=v.viewport)==null||U.focus()),a()}),R=_.useCallback(k=>{!k||k===1/0||(window.clearTimeout(A.current),E.current=new Date().getTime(),A.current=window.setTimeout(P,k))},[P]);_.useEffect(()=>{const k=v.viewport;if(k){const U=()=>{R(T.current),c==null||c()},O=()=>{const X=new Date().getTime()-E.current;T.current=T.current-X,window.clearTimeout(A.current),l==null||l()};return k.addEventListener(cE,O),k.addEventListener(uE,U),()=>{k.removeEventListener(cE,O),k.removeEventListener(uE,U)}}},[v.viewport,w,l,c,R]),_.useEffect(()=>{o&&!v.isClosePausedRef.current&&R(w)},[o,w,v.isClosePausedRef,R]),_.useEffect(()=>(M(),()=>C()),[M,C]);const D=_.useMemo(()=>g?PU(g):null,[g]);return v.viewport?h.jsxs(h.Fragment,{children:[D&&h.jsx(j9,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:D}),h.jsx(D9,{scope:n,onClose:P,children:Bc.createPortal(h.jsx(QM.ItemSlot,{scope:n,children:h.jsx(m9,{asChild:!0,onEscapeKeyDown:Oe(s,()=>{v.isFocusedToastEscapeKeyDownRef.current||P(),v.isFocusedToastEscapeKeyDownRef.current=!1}),children:h.jsx(nt.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":v.swipeDirection,...y,ref:x,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:Oe(t.onKeyDown,k=>{k.key==="Escape"&&(s==null||s(k.nativeEvent),k.nativeEvent.defaultPrevented||(v.isFocusedToastEscapeKeyDownRef.current=!0,P()))}),onPointerDown:Oe(t.onPointerDown,k=>{k.button===0&&(b.current={x:k.clientX,y:k.clientY})}),onPointerMove:Oe(t.onPointerMove,k=>{if(!b.current)return;const U=k.clientX-b.current.x,O=k.clientY-b.current.y,X=!!S.current,L=["left","right"].includes(v.swipeDirection),j=["left","up"].includes(v.swipeDirection)?Math.min:Math.max,K=L?j(0,U):0,te=L?0:j(0,O),H=k.pointerType==="touch"?10:2,q={x:K,y:te},$={originalEvent:k,delta:q};X?(S.current=q,bg(N9,d,$,{discrete:!1})):rN(q,v.swipeDirection,H)?(S.current=q,bg(R9,u,$,{discrete:!1}),k.target.setPointerCapture(k.pointerId)):(Math.abs(U)>H||Math.abs(O)>H)&&(b.current=null)}),onPointerUp:Oe(t.onPointerUp,k=>{const U=S.current,O=k.target;if(O.hasPointerCapture(k.pointerId)&&O.releasePointerCapture(k.pointerId),S.current=null,b.current=null,U){const X=k.currentTarget,L={originalEvent:k,delta:U};rN(U,v.swipeDirection,v.swipeThreshold)?bg(I9,p,L,{discrete:!0}):bg(O9,f,L,{discrete:!0}),X.addEventListener("click",j=>j.preventDefault(),{once:!0})}})})})}),v.viewport)})]}):null}),j9=t=>{const{__scopeToast:e,children:n,...r}=t,i=ox(Sm,e),[o,a]=_.useState(!1),[s,l]=_.useState(!1);return B9(()=>a(!0)),_.useEffect(()=>{const c=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(c)},[]),s?null:h.jsx(vf,{asChild:!0,children:h.jsx(ix,{...r,children:o&&h.jsxs(h.Fragment,{children:[i.label," ",n]})})})},U9="ToastTitle",SU=_.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return h.jsx(nt.div,{...r,ref:e})});SU.displayName=U9;var F9="ToastDescription",EU=_.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return h.jsx(nt.div,{...r,ref:e})});EU.displayName=F9;var TU="ToastAction",MU=_.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?h.jsx(CU,{altText:n,asChild:!0,children:h.jsx(eA,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${TU}\`. Expected non-empty \`string\`.`),null)});MU.displayName=TU;var AU="ToastClose",eA=_.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,i=L9(AU,n);return h.jsx(CU,{asChild:!0,children:h.jsx(nt.button,{type:"button",...r,ref:e,onClick:Oe(t.onClick,i.onClose)})})});eA.displayName=AU;var CU=_.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...i}=t;return h.jsx(nt.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...i,ref:e})});function PU(t){const e=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),$9(r)){const i=r.ariaHidden||r.hidden||r.style.display==="none",o=r.dataset.radixToastAnnounceExclude==="";if(!i)if(o){const a=r.dataset.radixToastAnnounceAlt;a&&e.push(a)}else e.push(...PU(r))}}),e}function bg(t,e,n,{discrete:r}){const i=n.originalEvent.currentTarget,o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?JM(i,o):i.dispatchEvent(o)}var rN=(t,e,n=0)=>{const r=Math.abs(t.x),i=Math.abs(t.y),o=r>i;return e==="left"||e==="right"?o&&r>n:!o&&i>n};function B9(t=()=>{}){const e=di(t);ur(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}function $9(t){return t.nodeType===t.ELEMENT_NODE}function z9(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function P_(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var H9=yU,RU=bU,NU=wU,OU=SU,IU=EU,DU=MU,LU=eA;function kU(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;etypeof t=="boolean"?`${t}`:t===0?"0":t,oN=zt,Em=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return oN(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=e,a=Object.keys(i).map(c=>{const u=n==null?void 0:n[c],d=o==null?void 0:o[c];if(u===null)return null;const f=iN(u)||iN(d);return i[c][f]}),s=n&&Object.entries(n).reduce((c,u)=>{let[d,f]=u;return f===void 0||(c[d]=f),c},{}),l=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:f,...p}=u;return Object.entries(p).every(y=>{let[v,g]=y;return Array.isArray(g)?g.includes({...o,...s}[v]):{...o,...s}[v]===g})?[...c,d,f]:c},[]);return oN(t,a,l,n==null?void 0:n.class,n==null?void 0:n.className)};/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const z7=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),LU=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/** + */const V9=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),jU=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */var H7={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + */var G9={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const V7=_.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:a,...s},l)=>_.createElement("svg",{ref:l,...H7,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:LU("lucide",i),...s},[...a.map(([c,u])=>_.createElement(c,u)),...Array.isArray(o)?o:[o]]));/** + */const W9=_.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:a,...s},l)=>_.createElement("svg",{ref:l,...G9,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:jU("lucide",i),...s},[...a.map(([c,u])=>_.createElement(c,u)),...Array.isArray(o)?o:[o]]));/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Mt=(t,e)=>{const n=_.forwardRef(({className:r,...i},o)=>_.createElement(V7,{ref:o,iconNode:e,className:LU(`lucide-${z7(t)}`,r),...i}));return n.displayName=`${t}`,n};/** + */const Mt=(t,e)=>{const n=_.forwardRef(({className:r,...i},o)=>_.createElement(W9,{ref:o,iconNode:e,className:jU(`lucide-${V9(t)}`,r),...i}));return n.displayName=`${t}`,n};/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. @@ -100,12 +100,12 @@ Error generating stack: `+o.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const G7=Mt("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/** + */const X9=Mt("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const W7=Mt("Camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);/** + */const UU=Mt("Camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. @@ -125,7 +125,7 @@ Error generating stack: `+o.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const X7=Mt("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** + */const q9=Mt("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. @@ -150,7 +150,7 @@ Error generating stack: `+o.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const q7=Mt("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** + */const K9=Mt("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. @@ -175,12 +175,12 @@ Error generating stack: `+o.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const K7=Mt("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/** + */const Y9=Mt("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Y7=Mt("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/** + */const J9=Mt("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. @@ -190,27 +190,27 @@ Error generating stack: `+o.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const J7=Mt("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** + */const Z9=Mt("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Z7=Mt("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + */const Q9=Mt("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Q7=Mt("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** + */const eX=Mt("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const eX=Mt("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/** + */const tX=Mt("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const tX=Mt("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/** + */const nX=Mt("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. @@ -220,12 +220,12 @@ Error generating stack: `+o.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const nX=Mt("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/** + */const rX=Mt("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const rX=Mt("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/** + */const iX=Mt("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. @@ -240,17 +240,17 @@ Error generating stack: `+o.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const kU=Mt("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** + */const oA=Mt("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const iX=Mt("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** + */const oX=Mt("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const oA=Mt("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** + */const aA=Mt("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. @@ -260,7 +260,12 @@ Error generating stack: `+o.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const oX=Mt("SkipForward",[["polygon",{points:"5 4 15 12 5 20 5 4",key:"16p6eg"}],["line",{x1:"19",x2:"19",y1:"5",y2:"19",key:"futhcm"}]]);/** + */const aX=Mt("ShieldQuestion",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const sX=Mt("SkipForward",[["polygon",{points:"5 4 15 12 5 20 5 4",key:"16p6eg"}],["line",{x1:"19",x2:"19",y1:"5",y2:"19",key:"futhcm"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. @@ -270,12 +275,12 @@ Error generating stack: `+o.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const aX=Mt("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/** + */const lX=Mt("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const aA=Mt("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** + */const sA=Mt("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. @@ -285,28 +290,28 @@ Error generating stack: `+o.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const jU=Mt("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/** + */const FU=Mt("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const UU=Mt("VideoOff",[["path",{d:"M10.66 6H14a2 2 0 0 1 2 2v2.5l5.248-3.062A.5.5 0 0 1 22 7.87v8.196",key:"w8jjjt"}],["path",{d:"M16 16a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h2",key:"1xawa7"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** + */const BU=Mt("VideoOff",[["path",{d:"M10.66 6H14a2 2 0 0 1 2 2v2.5l5.248-3.062A.5.5 0 0 1 22 7.87v8.196",key:"w8jjjt"}],["path",{d:"M16 16a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h2",key:"1xawa7"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const sX=Mt("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/** + */const cX=Mt("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const lX=Mt("VolumeX",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);/** + */const uX=Mt("VolumeX",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ax=Mt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),sA="-",cX=t=>{const e=dX(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:a=>{const s=a.split(sA);return s[0]===""&&s.length!==1&&s.shift(),FU(s,e)||uX(a)},getConflictingClassGroupIds:(a,s)=>{const l=n[a]||[];return s&&r[a]?[...l,...r[a]]:l}}},FU=(t,e)=>{var a;if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),i=r?FU(t.slice(1),r):void 0;if(i)return i;if(e.validators.length===0)return;const o=t.join(sA);return(a=e.validators.find(({validator:s})=>s(o)))==null?void 0:a.classGroupId},oN=/^\[(.+)\]$/,uX=t=>{if(oN.test(t)){const e=oN.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},dX=t=>{const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return hX(Object.entries(t.classGroups),n).forEach(([o,a])=>{pE(a,r,o,e)}),r},pE=(t,e,n,r)=>{t.forEach(i=>{if(typeof i=="string"){const o=i===""?e:aN(e,i);o.classGroupId=n;return}if(typeof i=="function"){if(fX(i)){pE(i(r),e,n,r);return}e.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,a])=>{pE(a,aN(e,o),n,r)})})},aN=(t,e)=>{let n=t;return e.split(sA).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},fX=t=>t.isThemeGetter,hX=(t,e)=>e?t.map(([n,r])=>{const i=r.map(o=>typeof o=="string"?e+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([a,s])=>[e+a,s])):o);return[n,i]}):t,pX=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const i=(o,a)=>{n.set(o,a),e++,e>t&&(e=0,r=n,n=new Map)};return{get(o){let a=n.get(o);if(a!==void 0)return a;if((a=r.get(o))!==void 0)return i(o,a),a},set(o,a){n.has(o)?n.set(o,a):i(o,a)}}},BU="!",mX=t=>{const{separator:e,experimentalParseClassName:n}=t,r=e.length===1,i=e[0],o=e.length,a=s=>{const l=[];let c=0,u=0,d;for(let g=0;gu?d-u:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:y,maybePostfixModifierPosition:v}};return n?s=>n({className:s,parseClassName:a}):a},gX=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e},vX=t=>({cache:pX(t.cacheSize),parseClassName:mX(t),...cX(t)}),yX=/\s+/,xX=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=e,o=[],a=t.trim().split(yX);let s="";for(let l=a.length-1;l>=0;l-=1){const c=a[l],{modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(c);let y=!!p,v=r(y?f.substring(0,p):f);if(!v){if(!y){s=c+(s.length>0?" "+s:s);continue}if(v=r(f),!v){s=c+(s.length>0?" "+s:s);continue}y=!1}const g=gX(u).join(":"),m=d?g+BU:g,x=m+v;if(o.includes(x))continue;o.push(x);const b=i(v,y);for(let S=0;S0?" "+s:s)}return s};function bX(){let t=0,e,n,r="";for(;t{if(typeof t=="string")return t;let e,n="";for(let r=0;rd(u),t());return n=vX(c),r=n.cache.get,i=n.cache.set,o=s,s(l)}function s(l){const c=r(l);if(c)return c;const u=xX(l,n);return i(l,u),u}return function(){return o(bX.apply(null,arguments))}}const yn=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},zU=/^\[(?:([a-z-]+):)?(.+)\]$/i,wX=/^\d+\/\d+$/,SX=new Set(["px","full","screen"]),EX=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,TX=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,MX=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,AX=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,CX=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ca=t=>rd(t)||SX.has(t)||wX.test(t),vs=t=>yf(t,"length",kX),rd=t=>!!t&&!Number.isNaN(Number(t)),R_=t=>yf(t,"number",rd),Zf=t=>!!t&&Number.isInteger(Number(t)),PX=t=>t.endsWith("%")&&rd(t.slice(0,-1)),Pt=t=>zU.test(t),ys=t=>EX.test(t),RX=new Set(["length","size","percentage"]),NX=t=>yf(t,RX,HU),OX=t=>yf(t,"position",HU),IX=new Set(["image","url"]),DX=t=>yf(t,IX,UX),LX=t=>yf(t,"",jX),Qf=()=>!0,yf=(t,e,n)=>{const r=zU.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1},kX=t=>TX.test(t)&&!MX.test(t),HU=()=>!1,jX=t=>AX.test(t),UX=t=>CX.test(t),FX=()=>{const t=yn("colors"),e=yn("spacing"),n=yn("blur"),r=yn("brightness"),i=yn("borderColor"),o=yn("borderRadius"),a=yn("borderSpacing"),s=yn("borderWidth"),l=yn("contrast"),c=yn("grayscale"),u=yn("hueRotate"),d=yn("invert"),f=yn("gap"),p=yn("gradientColorStops"),y=yn("gradientColorStopPositions"),v=yn("inset"),g=yn("margin"),m=yn("opacity"),x=yn("padding"),b=yn("saturate"),S=yn("scale"),w=yn("sepia"),E=yn("skew"),T=yn("space"),A=yn("translate"),M=()=>["auto","contain","none"],C=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto",Pt,e],R=()=>[Pt,e],D=()=>["",Ca,vs],k=()=>["auto",rd,Pt],U=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],O=()=>["solid","dashed","dotted","double","none"],W=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],L=()=>["start","end","center","between","around","evenly","stretch"],j=()=>["","0",Pt],X=()=>["auto","avoid","all","avoid-page","page","left","right","column"],K=()=>[rd,Pt];return{cacheSize:500,separator:":",theme:{colors:[Qf],spacing:[Ca,vs],blur:["none","",ys,Pt],brightness:K(),borderColor:[t],borderRadius:["none","","full",ys,Pt],borderSpacing:R(),borderWidth:D(),contrast:K(),grayscale:j(),hueRotate:K(),invert:j(),gap:R(),gradientColorStops:[t],gradientColorStopPositions:[PX,vs],inset:P(),margin:P(),opacity:K(),padding:R(),saturate:K(),scale:K(),sepia:j(),skew:K(),space:R(),translate:R()},classGroups:{aspect:[{aspect:["auto","square","video",Pt]}],container:["container"],columns:[{columns:[ys]}],"break-after":[{"break-after":X()}],"break-before":[{"break-before":X()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...U(),Pt]}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Zf,Pt]}],basis:[{basis:P()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Pt]}],grow:[{grow:j()}],shrink:[{shrink:j()}],order:[{order:["first","last","none",Zf,Pt]}],"grid-cols":[{"grid-cols":[Qf]}],"col-start-end":[{col:["auto",{span:["full",Zf,Pt]},Pt]}],"col-start":[{"col-start":k()}],"col-end":[{"col-end":k()}],"grid-rows":[{"grid-rows":[Qf]}],"row-start-end":[{row:["auto",{span:[Zf,Pt]},Pt]}],"row-start":[{"row-start":k()}],"row-end":[{"row-end":k()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Pt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Pt]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...L()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...L(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...L(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Pt,e]}],"min-w":[{"min-w":[Pt,e,"min","max","fit"]}],"max-w":[{"max-w":[Pt,e,"none","full","min","max","fit","prose",{screen:[ys]},ys]}],h:[{h:[Pt,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Pt,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Pt,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Pt,e,"auto","min","max","fit"]}],"font-size":[{text:["base",ys,vs]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",R_]}],"font-family":[{font:[Qf]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Pt]}],"line-clamp":[{"line-clamp":["none",rd,R_]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ca,Pt]}],"list-image":[{"list-image":["none",Pt]}],"list-style-type":[{list:["none","disc","decimal",Pt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[m]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[m]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...O(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ca,vs]}],"underline-offset":[{"underline-offset":["auto",Ca,Pt]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Pt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Pt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[m]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...U(),OX]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",NX]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},DX]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[m]}],"border-style":[{border:[...O(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[m]}],"divide-style":[{divide:O()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...O()]}],"outline-offset":[{"outline-offset":[Ca,Pt]}],"outline-w":[{outline:[Ca,vs]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:D()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[m]}],"ring-offset-w":[{"ring-offset":[Ca,vs]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",ys,LX]}],"shadow-color":[{shadow:[Qf]}],opacity:[{opacity:[m]}],"mix-blend":[{"mix-blend":[...W(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":W()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",ys,Pt]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[b]}],sepia:[{sepia:[w]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[m]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[w]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Pt]}],duration:[{duration:K()}],ease:[{ease:["linear","in","out","in-out",Pt]}],delay:[{delay:K()}],animate:[{animate:["none","spin","ping","pulse","bounce",Pt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[Zf,Pt]}],"translate-x":[{"translate-x":[A]}],"translate-y":[{"translate-y":[A]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Pt]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Pt]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Pt]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[Ca,vs,R_]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},BX=_X(FX);function He(...t){return BX(zt(t))}const $X=$7,VU=_.forwardRef(({className:t,...e},n)=>h.jsx(CU,{ref:n,className:He("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",t),...e}));VU.displayName=CU.displayName;const zX=Em("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),GU=_.forwardRef(({className:t,variant:e,...n},r)=>h.jsx(PU,{ref:r,className:He(zX({variant:e}),t),...n}));GU.displayName=PU.displayName;const HX=_.forwardRef(({className:t,...e},n)=>h.jsx(OU,{ref:n,className:He("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",t),...e}));HX.displayName=OU.displayName;const WU=_.forwardRef(({className:t,...e},n)=>h.jsx(IU,{ref:n,className:He("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",t),"toast-close":"",...e,children:h.jsx(ax,{className:"h-4 w-4"})}));WU.displayName=IU.displayName;const XU=_.forwardRef(({className:t,...e},n)=>h.jsx(RU,{ref:n,className:He("text-sm font-semibold",t),...e}));XU.displayName=RU.displayName;const qU=_.forwardRef(({className:t,...e},n)=>h.jsx(NU,{ref:n,className:He("text-sm opacity-90",t),...e}));qU.displayName=NU.displayName;function VX(){const{toasts:t}=Dr();return h.jsxs($X,{children:[t.map(function({id:e,title:n,description:r,action:i,...o}){return h.jsxs(GU,{...o,children:[h.jsxs("div",{className:"grid gap-1",children:[n&&h.jsx(XU,{children:n}),r&&h.jsx(qU,{children:r})]}),i,h.jsx(WU,{})]},e)}),h.jsx(VU,{})]})}const lA=Em("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),et=_.forwardRef(({className:t,variant:e,size:n,asChild:r=!1,...i},o)=>{const a=r?e7:"button";return h.jsx(a,{className:He(lA({variant:e,size:n,className:t})),ref:o,...i})});et.displayName="Button";const KU=_.createContext(void 0),N_="lelab.apiBaseUrl",O_="http://127.0.0.1:8000",GX=t=>t.replace(/^http(s?):/,"ws$1:"),WX=new Set(["http://localhost:8001","http://127.0.0.1:8001","http://localhost:8000","http://127.0.0.1:8000"]),XX=()=>{if(typeof window>"u")return O_;const t=new URLSearchParams(window.location.search).get("api");if(t)try{new URL(t);const n=t.replace(/\/$/,"");return window.localStorage.setItem(N_,n),n}catch{console.warn("Invalid `api` query param, ignoring:",t)}const e=window.localStorage.getItem(N_);return e&&!WX.has(e)?e:(e&&window.localStorage.setItem(N_,O_),O_)},qX=({children:t})=>{const[e]=_.useState(XX),n=GX(e),r=_.useCallback(async(o,a={})=>fetch(o,{...a,headers:{"Content-Type":"application/json",...a.headers}}),[]),i=_.useMemo(()=>({baseUrl:e,wsBaseUrl:n,fetchWithHeaders:r}),[e,n,r]);return h.jsx(KU.Provider,{value:i,children:t})},Dn=()=>{const t=_.useContext(KU);if(t===void 0)throw new Error("useApi must be used within an ApiProvider");return t},YU=_.createContext(void 0),KX=({children:t})=>{const{baseUrl:e,fetchWithHeaders:n}=Dn(),[r,i]=_.useState({status:"loading"}),o=_.useCallback(async()=>{i({status:"loading"});try{const l=await(await n(`${e}/hf-auth-status`)).json();l.authenticated?i({status:"authenticated",username:l.username,orgs:l.orgs??[]}):i({status:"unauthenticated",loginCommand:l.login_command??"hf auth login"})}catch(s){console.warn("HF auth status fetch failed:",s),i({status:"unauthenticated",loginCommand:"hf auth login"})}},[e,n]);_.useEffect(()=>{o()},[o]);const a=_.useMemo(()=>({auth:r,refetch:o}),[r,o]);return h.jsx(YU.Provider,{value:a,children:t})},xf=()=>{const t=_.useContext(YU);if(t===void 0)throw new Error("useHfAuth must be used within an HfAuthProvider");return t};var YX=rM[" useId ".trim().toString()]||(()=>{}),JX=0;function sr(t){const[e,n]=_.useState(YX());return ur(()=>{n(r=>r??String(JX++))},[t]),e?`radix-${e}`:""}var I_="focusScope.autoFocusOnMount",D_="focusScope.autoFocusOnUnmount",sN={bubbles:!1,cancelable:!0},ZX="FocusScope",Tm=_.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=t,[s,l]=_.useState(null),c=di(i),u=di(o),d=_.useRef(null),f=Ot(e,v=>l(v)),p=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(r){let v=function(b){if(p.paused||!s)return;const S=b.target;s.contains(S)?d.current=S:Cs(d.current,{select:!0})},g=function(b){if(p.paused||!s)return;const S=b.relatedTarget;S!==null&&(s.contains(S)||Cs(d.current,{select:!0}))},m=function(b){if(document.activeElement===document.body)for(const w of b)w.removedNodes.length>0&&Cs(s)};document.addEventListener("focusin",v),document.addEventListener("focusout",g);const x=new MutationObserver(m);return s&&x.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",g),x.disconnect()}}},[r,s,p.paused]),_.useEffect(()=>{if(s){cN.add(p);const v=document.activeElement;if(!s.contains(v)){const m=new CustomEvent(I_,sN);s.addEventListener(I_,c),s.dispatchEvent(m),m.defaultPrevented||(QX(iq(JU(s)),{select:!0}),document.activeElement===v&&Cs(s))}return()=>{s.removeEventListener(I_,c),setTimeout(()=>{const m=new CustomEvent(D_,sN);s.addEventListener(D_,u),s.dispatchEvent(m),m.defaultPrevented||Cs(v??document.body,{select:!0}),s.removeEventListener(D_,u),cN.remove(p)},0)}}},[s,c,u,p]);const y=_.useCallback(v=>{if(!n&&!r||p.paused)return;const g=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,m=document.activeElement;if(g&&m){const x=v.currentTarget,[b,S]=eq(x);b&&S?!v.shiftKey&&m===S?(v.preventDefault(),n&&Cs(b,{select:!0})):v.shiftKey&&m===b&&(v.preventDefault(),n&&Cs(S,{select:!0})):m===x&&v.preventDefault()}},[n,r,p.paused]);return h.jsx(nt.div,{tabIndex:-1,...a,ref:f,onKeyDown:y})});Tm.displayName=ZX;function QX(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Cs(r,{select:e}),document.activeElement!==n)return}function eq(t){const e=JU(t),n=lN(e,t),r=lN(e.reverse(),t);return[n,r]}function JU(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function lN(t,e){for(const n of t)if(!tq(n,{upTo:e}))return n}function tq(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function nq(t){return t instanceof HTMLInputElement&&"select"in t}function Cs(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&nq(t)&&e&&t.select()}}var cN=rq();function rq(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=uN(t,e),t.unshift(e)},remove(e){var n;t=uN(t,e),(n=t[0])==null||n.resume()}}}function uN(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function iq(t){return t.filter(e=>e.tagName!=="A")}var L_=0;function sx(){_.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??dN()),document.body.insertAdjacentElement("beforeend",t[1]??dN()),L_++,()=>{L_===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),L_--}},[])}function dN(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var ia=function(){return ia=Object.assign||function(e){for(var n,r=1,i=arguments.length;r"u")return _q;var e=wq(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},Eq=tF(),id="data-scroll-locked",Tq=function(t,e,n,r){var i=t.left,o=t.top,a=t.right,s=t.gap;return n===void 0&&(n="margin"),` - .`.concat(aq,` { + */const ax=Mt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),lA="-",dX=t=>{const e=hX(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:a=>{const s=a.split(lA);return s[0]===""&&s.length!==1&&s.shift(),$U(s,e)||fX(a)},getConflictingClassGroupIds:(a,s)=>{const l=n[a]||[];return s&&r[a]?[...l,...r[a]]:l}}},$U=(t,e)=>{var a;if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),i=r?$U(t.slice(1),r):void 0;if(i)return i;if(e.validators.length===0)return;const o=t.join(lA);return(a=e.validators.find(({validator:s})=>s(o)))==null?void 0:a.classGroupId},aN=/^\[(.+)\]$/,fX=t=>{if(aN.test(t)){const e=aN.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},hX=t=>{const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return mX(Object.entries(t.classGroups),n).forEach(([o,a])=>{pE(a,r,o,e)}),r},pE=(t,e,n,r)=>{t.forEach(i=>{if(typeof i=="string"){const o=i===""?e:sN(e,i);o.classGroupId=n;return}if(typeof i=="function"){if(pX(i)){pE(i(r),e,n,r);return}e.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,a])=>{pE(a,sN(e,o),n,r)})})},sN=(t,e)=>{let n=t;return e.split(lA).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},pX=t=>t.isThemeGetter,mX=(t,e)=>e?t.map(([n,r])=>{const i=r.map(o=>typeof o=="string"?e+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([a,s])=>[e+a,s])):o);return[n,i]}):t,gX=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const i=(o,a)=>{n.set(o,a),e++,e>t&&(e=0,r=n,n=new Map)};return{get(o){let a=n.get(o);if(a!==void 0)return a;if((a=r.get(o))!==void 0)return i(o,a),a},set(o,a){n.has(o)?n.set(o,a):i(o,a)}}},zU="!",vX=t=>{const{separator:e,experimentalParseClassName:n}=t,r=e.length===1,i=e[0],o=e.length,a=s=>{const l=[];let c=0,u=0,d;for(let g=0;gu?d-u:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:y,maybePostfixModifierPosition:v}};return n?s=>n({className:s,parseClassName:a}):a},yX=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e},xX=t=>({cache:gX(t.cacheSize),parseClassName:vX(t),...dX(t)}),bX=/\s+/,_X=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=e,o=[],a=t.trim().split(bX);let s="";for(let l=a.length-1;l>=0;l-=1){const c=a[l],{modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(c);let y=!!p,v=r(y?f.substring(0,p):f);if(!v){if(!y){s=c+(s.length>0?" "+s:s);continue}if(v=r(f),!v){s=c+(s.length>0?" "+s:s);continue}y=!1}const g=yX(u).join(":"),m=d?g+zU:g,x=m+v;if(o.includes(x))continue;o.push(x);const b=i(v,y);for(let S=0;S0?" "+s:s)}return s};function wX(){let t=0,e,n,r="";for(;t{if(typeof t=="string")return t;let e,n="";for(let r=0;rd(u),t());return n=xX(c),r=n.cache.get,i=n.cache.set,o=s,s(l)}function s(l){const c=r(l);if(c)return c;const u=_X(l,n);return i(l,u),u}return function(){return o(wX.apply(null,arguments))}}const yn=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},VU=/^\[(?:([a-z-]+):)?(.+)\]$/i,EX=/^\d+\/\d+$/,TX=new Set(["px","full","screen"]),MX=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,AX=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,CX=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,PX=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,RX=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ca=t=>rd(t)||TX.has(t)||EX.test(t),vs=t=>yf(t,"length",UX),rd=t=>!!t&&!Number.isNaN(Number(t)),R_=t=>yf(t,"number",rd),Zf=t=>!!t&&Number.isInteger(Number(t)),NX=t=>t.endsWith("%")&&rd(t.slice(0,-1)),Pt=t=>VU.test(t),ys=t=>MX.test(t),OX=new Set(["length","size","percentage"]),IX=t=>yf(t,OX,GU),DX=t=>yf(t,"position",GU),LX=new Set(["image","url"]),kX=t=>yf(t,LX,BX),jX=t=>yf(t,"",FX),Qf=()=>!0,yf=(t,e,n)=>{const r=VU.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1},UX=t=>AX.test(t)&&!CX.test(t),GU=()=>!1,FX=t=>PX.test(t),BX=t=>RX.test(t),$X=()=>{const t=yn("colors"),e=yn("spacing"),n=yn("blur"),r=yn("brightness"),i=yn("borderColor"),o=yn("borderRadius"),a=yn("borderSpacing"),s=yn("borderWidth"),l=yn("contrast"),c=yn("grayscale"),u=yn("hueRotate"),d=yn("invert"),f=yn("gap"),p=yn("gradientColorStops"),y=yn("gradientColorStopPositions"),v=yn("inset"),g=yn("margin"),m=yn("opacity"),x=yn("padding"),b=yn("saturate"),S=yn("scale"),w=yn("sepia"),E=yn("skew"),T=yn("space"),A=yn("translate"),M=()=>["auto","contain","none"],C=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto",Pt,e],R=()=>[Pt,e],D=()=>["",Ca,vs],k=()=>["auto",rd,Pt],U=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],O=()=>["solid","dashed","dotted","double","none"],X=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],L=()=>["start","end","center","between","around","evenly","stretch"],j=()=>["","0",Pt],K=()=>["auto","avoid","all","avoid-page","page","left","right","column"],te=()=>[rd,Pt];return{cacheSize:500,separator:":",theme:{colors:[Qf],spacing:[Ca,vs],blur:["none","",ys,Pt],brightness:te(),borderColor:[t],borderRadius:["none","","full",ys,Pt],borderSpacing:R(),borderWidth:D(),contrast:te(),grayscale:j(),hueRotate:te(),invert:j(),gap:R(),gradientColorStops:[t],gradientColorStopPositions:[NX,vs],inset:P(),margin:P(),opacity:te(),padding:R(),saturate:te(),scale:te(),sepia:j(),skew:te(),space:R(),translate:R()},classGroups:{aspect:[{aspect:["auto","square","video",Pt]}],container:["container"],columns:[{columns:[ys]}],"break-after":[{"break-after":K()}],"break-before":[{"break-before":K()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...U(),Pt]}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Zf,Pt]}],basis:[{basis:P()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Pt]}],grow:[{grow:j()}],shrink:[{shrink:j()}],order:[{order:["first","last","none",Zf,Pt]}],"grid-cols":[{"grid-cols":[Qf]}],"col-start-end":[{col:["auto",{span:["full",Zf,Pt]},Pt]}],"col-start":[{"col-start":k()}],"col-end":[{"col-end":k()}],"grid-rows":[{"grid-rows":[Qf]}],"row-start-end":[{row:["auto",{span:[Zf,Pt]},Pt]}],"row-start":[{"row-start":k()}],"row-end":[{"row-end":k()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Pt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Pt]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...L()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...L(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...L(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Pt,e]}],"min-w":[{"min-w":[Pt,e,"min","max","fit"]}],"max-w":[{"max-w":[Pt,e,"none","full","min","max","fit","prose",{screen:[ys]},ys]}],h:[{h:[Pt,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Pt,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Pt,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Pt,e,"auto","min","max","fit"]}],"font-size":[{text:["base",ys,vs]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",R_]}],"font-family":[{font:[Qf]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Pt]}],"line-clamp":[{"line-clamp":["none",rd,R_]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ca,Pt]}],"list-image":[{"list-image":["none",Pt]}],"list-style-type":[{list:["none","disc","decimal",Pt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[m]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[m]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...O(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ca,vs]}],"underline-offset":[{"underline-offset":["auto",Ca,Pt]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Pt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Pt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[m]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...U(),DX]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",IX]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},kX]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[m]}],"border-style":[{border:[...O(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[m]}],"divide-style":[{divide:O()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...O()]}],"outline-offset":[{"outline-offset":[Ca,Pt]}],"outline-w":[{outline:[Ca,vs]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:D()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[m]}],"ring-offset-w":[{"ring-offset":[Ca,vs]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",ys,jX]}],"shadow-color":[{shadow:[Qf]}],opacity:[{opacity:[m]}],"mix-blend":[{"mix-blend":[...X(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":X()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",ys,Pt]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[b]}],sepia:[{sepia:[w]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[m]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[w]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Pt]}],duration:[{duration:te()}],ease:[{ease:["linear","in","out","in-out",Pt]}],delay:[{delay:te()}],animate:[{animate:["none","spin","ping","pulse","bounce",Pt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[Zf,Pt]}],"translate-x":[{"translate-x":[A]}],"translate-y":[{"translate-y":[A]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Pt]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Pt]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Pt]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[Ca,vs,R_]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},zX=SX($X);function He(...t){return zX(zt(t))}const HX=H9,WU=_.forwardRef(({className:t,...e},n)=>h.jsx(RU,{ref:n,className:He("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",t),...e}));WU.displayName=RU.displayName;const VX=Em("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),XU=_.forwardRef(({className:t,variant:e,...n},r)=>h.jsx(NU,{ref:r,className:He(VX({variant:e}),t),...n}));XU.displayName=NU.displayName;const GX=_.forwardRef(({className:t,...e},n)=>h.jsx(DU,{ref:n,className:He("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",t),...e}));GX.displayName=DU.displayName;const qU=_.forwardRef(({className:t,...e},n)=>h.jsx(LU,{ref:n,className:He("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",t),"toast-close":"",...e,children:h.jsx(ax,{className:"h-4 w-4"})}));qU.displayName=LU.displayName;const KU=_.forwardRef(({className:t,...e},n)=>h.jsx(OU,{ref:n,className:He("text-sm font-semibold",t),...e}));KU.displayName=OU.displayName;const YU=_.forwardRef(({className:t,...e},n)=>h.jsx(IU,{ref:n,className:He("text-sm opacity-90",t),...e}));YU.displayName=IU.displayName;function WX(){const{toasts:t}=_r();return h.jsxs(HX,{children:[t.map(function({id:e,title:n,description:r,action:i,...o}){return h.jsxs(XU,{...o,children:[h.jsxs("div",{className:"grid gap-1",children:[n&&h.jsx(KU,{children:n}),r&&h.jsx(YU,{children:r})]}),i,h.jsx(qU,{})]},e)}),h.jsx(WU,{})]})}const cA=Em("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Je=_.forwardRef(({className:t,variant:e,size:n,asChild:r=!1,...i},o)=>{const a=r?n9:"button";return h.jsx(a,{className:He(cA({variant:e,size:n,className:t})),ref:o,...i})});Je.displayName="Button";const JU=_.createContext(void 0),N_="lelab.apiBaseUrl",O_="http://127.0.0.1:8000",XX=t=>t.replace(/^http(s?):/,"ws$1:"),qX=new Set(["http://localhost:8001","http://127.0.0.1:8001","http://localhost:8000","http://127.0.0.1:8000"]),KX=()=>{if(typeof window>"u")return O_;const t=new URLSearchParams(window.location.search).get("api");if(t)try{new URL(t);const n=t.replace(/\/$/,"");return window.localStorage.setItem(N_,n),n}catch{console.warn("Invalid `api` query param, ignoring:",t)}const e=window.localStorage.getItem(N_);return e&&!qX.has(e)?e:(e&&window.localStorage.setItem(N_,O_),O_)},YX=({children:t})=>{const[e]=_.useState(KX),n=XX(e),r=_.useCallback(async(o,a={})=>fetch(o,{...a,headers:{"Content-Type":"application/json",...a.headers}}),[]),i=_.useMemo(()=>({baseUrl:e,wsBaseUrl:n,fetchWithHeaders:r}),[e,n,r]);return h.jsx(JU.Provider,{value:i,children:t})},Dn=()=>{const t=_.useContext(JU);if(t===void 0)throw new Error("useApi must be used within an ApiProvider");return t},ZU=_.createContext(void 0),JX=({children:t})=>{const{baseUrl:e,fetchWithHeaders:n}=Dn(),[r,i]=_.useState({status:"loading"}),o=_.useCallback(async()=>{i({status:"loading"});try{const l=await(await n(`${e}/hf-auth-status`)).json();l.authenticated?i({status:"authenticated",username:l.username,orgs:l.orgs??[]}):i({status:"unauthenticated",loginCommand:l.login_command??"hf auth login"})}catch(s){console.warn("HF auth status fetch failed:",s),i({status:"unauthenticated",loginCommand:"hf auth login"})}},[e,n]);_.useEffect(()=>{o()},[o]);const a=_.useMemo(()=>({auth:r,refetch:o}),[r,o]);return h.jsx(ZU.Provider,{value:a,children:t})},xf=()=>{const t=_.useContext(ZU);if(t===void 0)throw new Error("useHfAuth must be used within an HfAuthProvider");return t};var ZX=rM[" useId ".trim().toString()]||(()=>{}),QX=0;function sr(t){const[e,n]=_.useState(ZX());return ur(()=>{n(r=>r??String(QX++))},[t]),e?`radix-${e}`:""}var I_="focusScope.autoFocusOnMount",D_="focusScope.autoFocusOnUnmount",lN={bubbles:!1,cancelable:!0},eq="FocusScope",Tm=_.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=t,[s,l]=_.useState(null),c=di(i),u=di(o),d=_.useRef(null),f=Ot(e,v=>l(v)),p=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(r){let v=function(b){if(p.paused||!s)return;const S=b.target;s.contains(S)?d.current=S:Cs(d.current,{select:!0})},g=function(b){if(p.paused||!s)return;const S=b.relatedTarget;S!==null&&(s.contains(S)||Cs(d.current,{select:!0}))},m=function(b){if(document.activeElement===document.body)for(const w of b)w.removedNodes.length>0&&Cs(s)};document.addEventListener("focusin",v),document.addEventListener("focusout",g);const x=new MutationObserver(m);return s&&x.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",g),x.disconnect()}}},[r,s,p.paused]),_.useEffect(()=>{if(s){uN.add(p);const v=document.activeElement;if(!s.contains(v)){const m=new CustomEvent(I_,lN);s.addEventListener(I_,c),s.dispatchEvent(m),m.defaultPrevented||(tq(aq(QU(s)),{select:!0}),document.activeElement===v&&Cs(s))}return()=>{s.removeEventListener(I_,c),setTimeout(()=>{const m=new CustomEvent(D_,lN);s.addEventListener(D_,u),s.dispatchEvent(m),m.defaultPrevented||Cs(v??document.body,{select:!0}),s.removeEventListener(D_,u),uN.remove(p)},0)}}},[s,c,u,p]);const y=_.useCallback(v=>{if(!n&&!r||p.paused)return;const g=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,m=document.activeElement;if(g&&m){const x=v.currentTarget,[b,S]=nq(x);b&&S?!v.shiftKey&&m===S?(v.preventDefault(),n&&Cs(b,{select:!0})):v.shiftKey&&m===b&&(v.preventDefault(),n&&Cs(S,{select:!0})):m===x&&v.preventDefault()}},[n,r,p.paused]);return h.jsx(nt.div,{tabIndex:-1,...a,ref:f,onKeyDown:y})});Tm.displayName=eq;function tq(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Cs(r,{select:e}),document.activeElement!==n)return}function nq(t){const e=QU(t),n=cN(e,t),r=cN(e.reverse(),t);return[n,r]}function QU(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function cN(t,e){for(const n of t)if(!rq(n,{upTo:e}))return n}function rq(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function iq(t){return t instanceof HTMLInputElement&&"select"in t}function Cs(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&iq(t)&&e&&t.select()}}var uN=oq();function oq(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=dN(t,e),t.unshift(e)},remove(e){var n;t=dN(t,e),(n=t[0])==null||n.resume()}}}function dN(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function aq(t){return t.filter(e=>e.tagName!=="A")}var L_=0;function sx(){_.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??fN()),document.body.insertAdjacentElement("beforeend",t[1]??fN()),L_++,()=>{L_===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),L_--}},[])}function fN(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var ia=function(){return ia=Object.assign||function(e){for(var n,r=1,i=arguments.length;r"u")return Sq;var e=Eq(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},Mq=rF(),id="data-scroll-locked",Aq=function(t,e,n,r){var i=t.left,o=t.top,a=t.right,s=t.gap;return n===void 0&&(n="margin"),` + .`.concat(lq,` { overflow: hidden `).concat(r,`; padding-right: `).concat(s,"px ").concat(r,`; } @@ -340,24 +345,24 @@ Error generating stack: `+o.message+` } body[`).concat(id,`] { - `).concat(sq,": ").concat(s,`px; + `).concat(cq,": ").concat(s,`px; } -`)},hN=function(){var t=parseInt(document.body.getAttribute(id)||"0",10);return isFinite(t)?t:0},Mq=function(){_.useEffect(function(){return document.body.setAttribute(id,(hN()+1).toString()),function(){var t=hN()-1;t<=0?document.body.removeAttribute(id):document.body.setAttribute(id,t.toString())}},[])},Aq=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,i=r===void 0?"margin":r;Mq();var o=_.useMemo(function(){return Sq(i)},[i]);return _.createElement(Eq,{styles:Tq(o,!e,i,n?"":"!important")})},mE=!1;if(typeof window<"u")try{var _g=Object.defineProperty({},"passive",{get:function(){return mE=!0,!0}});window.addEventListener("test",_g,_g),window.removeEventListener("test",_g,_g)}catch{mE=!1}var ru=mE?{passive:!1}:!1,Cq=function(t){return t.tagName==="TEXTAREA"},nF=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!Cq(t)&&n[e]==="visible")},Pq=function(t){return nF(t,"overflowY")},Rq=function(t){return nF(t,"overflowX")},pN=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=rF(t,r);if(i){var o=iF(t,r),a=o[1],s=o[2];if(a>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Nq=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},Oq=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},rF=function(t,e){return t==="v"?Pq(e):Rq(e)},iF=function(t,e){return t==="v"?Nq(e):Oq(e)},Iq=function(t,e){return t==="h"&&e==="rtl"?-1:1},Dq=function(t,e,n,r,i){var o=Iq(t,window.getComputedStyle(e).direction),a=o*r,s=n.target,l=e.contains(s),c=!1,u=a>0,d=0,f=0;do{if(!s)break;var p=iF(t,s),y=p[0],v=p[1],g=p[2],m=v-g-o*y;(y||m)&&rF(t,s)&&(d+=m,f+=y);var x=s.parentNode;s=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}while(!l&&s!==document.body||l&&(e.contains(s)||e===s));return(u&&Math.abs(d)<1||!u&&Math.abs(f)<1)&&(c=!0),c},wg=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},mN=function(t){return[t.deltaX,t.deltaY]},gN=function(t){return t&&"current"in t?t.current:t},Lq=function(t,e){return t[0]===e[0]&&t[1]===e[1]},kq=function(t){return` +`)},pN=function(){var t=parseInt(document.body.getAttribute(id)||"0",10);return isFinite(t)?t:0},Cq=function(){_.useEffect(function(){return document.body.setAttribute(id,(pN()+1).toString()),function(){var t=pN()-1;t<=0?document.body.removeAttribute(id):document.body.setAttribute(id,t.toString())}},[])},Pq=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,i=r===void 0?"margin":r;Cq();var o=_.useMemo(function(){return Tq(i)},[i]);return _.createElement(Mq,{styles:Aq(o,!e,i,n?"":"!important")})},mE=!1;if(typeof window<"u")try{var _g=Object.defineProperty({},"passive",{get:function(){return mE=!0,!0}});window.addEventListener("test",_g,_g),window.removeEventListener("test",_g,_g)}catch{mE=!1}var ru=mE?{passive:!1}:!1,Rq=function(t){return t.tagName==="TEXTAREA"},iF=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!Rq(t)&&n[e]==="visible")},Nq=function(t){return iF(t,"overflowY")},Oq=function(t){return iF(t,"overflowX")},mN=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=oF(t,r);if(i){var o=aF(t,r),a=o[1],s=o[2];if(a>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Iq=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},Dq=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},oF=function(t,e){return t==="v"?Nq(e):Oq(e)},aF=function(t,e){return t==="v"?Iq(e):Dq(e)},Lq=function(t,e){return t==="h"&&e==="rtl"?-1:1},kq=function(t,e,n,r,i){var o=Lq(t,window.getComputedStyle(e).direction),a=o*r,s=n.target,l=e.contains(s),c=!1,u=a>0,d=0,f=0;do{if(!s)break;var p=aF(t,s),y=p[0],v=p[1],g=p[2],m=v-g-o*y;(y||m)&&oF(t,s)&&(d+=m,f+=y);var x=s.parentNode;s=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}while(!l&&s!==document.body||l&&(e.contains(s)||e===s));return(u&&Math.abs(d)<1||!u&&Math.abs(f)<1)&&(c=!0),c},wg=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},gN=function(t){return[t.deltaX,t.deltaY]},vN=function(t){return t&&"current"in t?t.current:t},jq=function(t,e){return t[0]===e[0]&&t[1]===e[1]},Uq=function(t){return` .block-interactivity-`.concat(t,` {pointer-events: none;} .allow-interactivity-`).concat(t,` {pointer-events: all;} -`)},jq=0,iu=[];function Uq(t){var e=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),i=_.useState(jq++)[0],o=_.useState(tF)[0],a=_.useRef(t);_.useEffect(function(){a.current=t},[t]),_.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var v=oq([t.lockRef.current],(t.shards||[]).map(gN),!0).filter(Boolean);return v.forEach(function(g){return g.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),v.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var s=_.useCallback(function(v,g){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!a.current.allowPinchZoom;var m=wg(v),x=n.current,b="deltaX"in v?v.deltaX:x[0]-m[0],S="deltaY"in v?v.deltaY:x[1]-m[1],w,E=v.target,T=Math.abs(b)>Math.abs(S)?"h":"v";if("touches"in v&&T==="h"&&E.type==="range")return!1;var A=pN(T,E);if(!A)return!0;if(A?w=T:(w=T==="v"?"h":"v",A=pN(T,E)),!A)return!1;if(!r.current&&"changedTouches"in v&&(b||S)&&(r.current=w),!w)return!0;var M=r.current||w;return Dq(M,g,v,M==="h"?b:S)},[]),l=_.useCallback(function(v){var g=v;if(!(!iu.length||iu[iu.length-1]!==o)){var m="deltaY"in g?mN(g):wg(g),x=e.current.filter(function(w){return w.name===g.type&&(w.target===g.target||g.target===w.shadowParent)&&Lq(w.delta,m)})[0];if(x&&x.should){g.cancelable&&g.preventDefault();return}if(!x){var b=(a.current.shards||[]).map(gN).filter(Boolean).filter(function(w){return w.contains(g.target)}),S=b.length>0?s(g,b[0]):!a.current.noIsolation;S&&g.cancelable&&g.preventDefault()}}},[]),c=_.useCallback(function(v,g,m,x){var b={name:v,delta:g,target:m,should:x,shadowParent:Fq(m)};e.current.push(b),setTimeout(function(){e.current=e.current.filter(function(S){return S!==b})},1)},[]),u=_.useCallback(function(v){n.current=wg(v),r.current=void 0},[]),d=_.useCallback(function(v){c(v.type,mN(v),v.target,s(v,t.lockRef.current))},[]),f=_.useCallback(function(v){c(v.type,wg(v),v.target,s(v,t.lockRef.current))},[]);_.useEffect(function(){return iu.push(o),t.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,ru),document.addEventListener("touchmove",l,ru),document.addEventListener("touchstart",u,ru),function(){iu=iu.filter(function(v){return v!==o}),document.removeEventListener("wheel",l,ru),document.removeEventListener("touchmove",l,ru),document.removeEventListener("touchstart",u,ru)}},[]);var p=t.removeScrollBar,y=t.inert;return _.createElement(_.Fragment,null,y?_.createElement(o,{styles:kq(i)}):null,p?_.createElement(Aq,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function Fq(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const Bq=pq(eF,Uq);var Mm=_.forwardRef(function(t,e){return _.createElement(lx,ia({},t,{ref:e,sideCar:Bq}))});Mm.classNames=lx.classNames;var $q=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},ou=new WeakMap,Sg=new WeakMap,Eg={},F_=0,oF=function(t){return t&&(t.host||oF(t.parentNode))},zq=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=oF(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},Hq=function(t,e,n,r){var i=zq(e,Array.isArray(t)?t:[t]);Eg[n]||(Eg[n]=new WeakMap);var o=Eg[n],a=[],s=new Set,l=new Set(i),c=function(d){!d||s.has(d)||(s.add(d),c(d.parentNode))};i.forEach(c);var u=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(f){if(s.has(f))u(f);else try{var p=f.getAttribute(r),y=p!==null&&p!=="false",v=(ou.get(f)||0)+1,g=(o.get(f)||0)+1;ou.set(f,v),o.set(f,g),a.push(f),v===1&&y&&Sg.set(f,!0),g===1&&f.setAttribute(n,"true"),y||f.setAttribute(r,"true")}catch(m){console.error("aria-hidden: cannot operate on ",f,m)}})};return u(e),s.clear(),F_++,function(){a.forEach(function(d){var f=ou.get(d)-1,p=o.get(d)-1;ou.set(d,f),o.set(d,p),f||(Sg.has(d)||d.removeAttribute(r),Sg.delete(d)),p||d.removeAttribute(n)}),F_--,F_||(ou=new WeakMap,ou=new WeakMap,Sg=new WeakMap,Eg={})}},cx=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),i=$q(t);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),Hq(r,i,n,"aria-hidden")):function(){return null}},ux="Dialog",[aF,sF]=mi(ux),[Vq,Go]=aF(ux),lF=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:a=!0}=t,s=_.useRef(null),l=_.useRef(null),[c,u]=$o({prop:r,defaultProp:i??!1,onChange:o,caller:ux});return h.jsx(Vq,{scope:e,triggerRef:s,contentRef:l,contentId:sr(),titleId:sr(),descriptionId:sr(),open:c,onOpenChange:u,onOpenToggle:_.useCallback(()=>u(d=>!d),[u]),modal:a,children:n})};lF.displayName=ux;var cF="DialogTrigger",uF=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Go(cF,n),o=Ot(e,i.triggerRef);return h.jsx(nt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":dA(i.open),...r,ref:o,onClick:Oe(t.onClick,i.onOpenToggle)})});uF.displayName=cF;var cA="DialogPortal",[Gq,dF]=aF(cA,{forceMount:void 0}),fF=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:i}=t,o=Go(cA,e);return h.jsx(Gq,{scope:e,forceMount:n,children:_.Children.map(r,a=>h.jsx(gi,{present:n||o.open,children:h.jsx(vf,{asChild:!0,container:i,children:a})}))})};fF.displayName=cA;var by="DialogOverlay",hF=_.forwardRef((t,e)=>{const n=dF(by,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,o=Go(by,t.__scopeDialog);return o.modal?h.jsx(gi,{present:r||o.open,children:h.jsx(Xq,{...i,ref:e})}):null});hF.displayName=by;var Wq=sl("DialogOverlay.RemoveScroll"),Xq=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Go(by,n);return h.jsx(Mm,{as:Wq,allowPinchZoom:!0,shards:[i.contentRef],children:h.jsx(nt.div,{"data-state":dA(i.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),Mc="DialogContent",pF=_.forwardRef((t,e)=>{const n=dF(Mc,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,o=Go(Mc,t.__scopeDialog);return h.jsx(gi,{present:r||o.open,children:o.modal?h.jsx(qq,{...i,ref:e}):h.jsx(Kq,{...i,ref:e})})});pF.displayName=Mc;var qq=_.forwardRef((t,e)=>{const n=Go(Mc,t.__scopeDialog),r=_.useRef(null),i=Ot(e,n.contentRef,r);return _.useEffect(()=>{const o=r.current;if(o)return cx(o)},[]),h.jsx(mF,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Oe(t.onCloseAutoFocus,o=>{var a;o.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Oe(t.onPointerDownOutside,o=>{const a=o.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&o.preventDefault()}),onFocusOutside:Oe(t.onFocusOutside,o=>o.preventDefault())})}),Kq=_.forwardRef((t,e)=>{const n=Go(Mc,t.__scopeDialog),r=_.useRef(!1),i=_.useRef(!1);return h.jsx(mF,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var a,s;(a=t.onCloseAutoFocus)==null||a.call(t,o),o.defaultPrevented||(r.current||(s=n.triggerRef.current)==null||s.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var l,c;(l=t.onInteractOutside)==null||l.call(t,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=o.target;((c=n.triggerRef.current)==null?void 0:c.contains(a))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),mF=_.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...a}=t,s=Go(Mc,n),l=_.useRef(null),c=Ot(e,l);return sx(),h.jsxs(h.Fragment,{children:[h.jsx(Tm,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:h.jsx(zc,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":dA(s.open),...a,ref:c,onDismiss:()=>s.onOpenChange(!1)})}),h.jsxs(h.Fragment,{children:[h.jsx(Jq,{titleId:s.titleId}),h.jsx(Qq,{contentRef:l,descriptionId:s.descriptionId})]})]})}),uA="DialogTitle",gF=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Go(uA,n);return h.jsx(nt.h2,{id:i.titleId,...r,ref:e})});gF.displayName=uA;var vF="DialogDescription",yF=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Go(vF,n);return h.jsx(nt.p,{id:i.descriptionId,...r,ref:e})});yF.displayName=vF;var xF="DialogClose",bF=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Go(xF,n);return h.jsx(nt.button,{type:"button",...r,ref:e,onClick:Oe(t.onClick,()=>i.onOpenChange(!1))})});bF.displayName=xF;function dA(t){return t?"open":"closed"}var _F="DialogTitleWarning",[Yq,wF]=Z9(_F,{contentName:Mc,titleName:uA,docsSlug:"dialog"}),Jq=({titleId:t})=>{const e=wF(_F),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users. +`)},Fq=0,iu=[];function Bq(t){var e=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),i=_.useState(Fq++)[0],o=_.useState(rF)[0],a=_.useRef(t);_.useEffect(function(){a.current=t},[t]),_.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var v=sq([t.lockRef.current],(t.shards||[]).map(vN),!0).filter(Boolean);return v.forEach(function(g){return g.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),v.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var s=_.useCallback(function(v,g){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!a.current.allowPinchZoom;var m=wg(v),x=n.current,b="deltaX"in v?v.deltaX:x[0]-m[0],S="deltaY"in v?v.deltaY:x[1]-m[1],w,E=v.target,T=Math.abs(b)>Math.abs(S)?"h":"v";if("touches"in v&&T==="h"&&E.type==="range")return!1;var A=mN(T,E);if(!A)return!0;if(A?w=T:(w=T==="v"?"h":"v",A=mN(T,E)),!A)return!1;if(!r.current&&"changedTouches"in v&&(b||S)&&(r.current=w),!w)return!0;var M=r.current||w;return kq(M,g,v,M==="h"?b:S)},[]),l=_.useCallback(function(v){var g=v;if(!(!iu.length||iu[iu.length-1]!==o)){var m="deltaY"in g?gN(g):wg(g),x=e.current.filter(function(w){return w.name===g.type&&(w.target===g.target||g.target===w.shadowParent)&&jq(w.delta,m)})[0];if(x&&x.should){g.cancelable&&g.preventDefault();return}if(!x){var b=(a.current.shards||[]).map(vN).filter(Boolean).filter(function(w){return w.contains(g.target)}),S=b.length>0?s(g,b[0]):!a.current.noIsolation;S&&g.cancelable&&g.preventDefault()}}},[]),c=_.useCallback(function(v,g,m,x){var b={name:v,delta:g,target:m,should:x,shadowParent:$q(m)};e.current.push(b),setTimeout(function(){e.current=e.current.filter(function(S){return S!==b})},1)},[]),u=_.useCallback(function(v){n.current=wg(v),r.current=void 0},[]),d=_.useCallback(function(v){c(v.type,gN(v),v.target,s(v,t.lockRef.current))},[]),f=_.useCallback(function(v){c(v.type,wg(v),v.target,s(v,t.lockRef.current))},[]);_.useEffect(function(){return iu.push(o),t.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,ru),document.addEventListener("touchmove",l,ru),document.addEventListener("touchstart",u,ru),function(){iu=iu.filter(function(v){return v!==o}),document.removeEventListener("wheel",l,ru),document.removeEventListener("touchmove",l,ru),document.removeEventListener("touchstart",u,ru)}},[]);var p=t.removeScrollBar,y=t.inert;return _.createElement(_.Fragment,null,y?_.createElement(o,{styles:Uq(i)}):null,p?_.createElement(Pq,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function $q(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const zq=gq(nF,Bq);var Mm=_.forwardRef(function(t,e){return _.createElement(lx,ia({},t,{ref:e,sideCar:zq}))});Mm.classNames=lx.classNames;var Hq=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},ou=new WeakMap,Sg=new WeakMap,Eg={},F_=0,sF=function(t){return t&&(t.host||sF(t.parentNode))},Vq=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=sF(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},Gq=function(t,e,n,r){var i=Vq(e,Array.isArray(t)?t:[t]);Eg[n]||(Eg[n]=new WeakMap);var o=Eg[n],a=[],s=new Set,l=new Set(i),c=function(d){!d||s.has(d)||(s.add(d),c(d.parentNode))};i.forEach(c);var u=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(f){if(s.has(f))u(f);else try{var p=f.getAttribute(r),y=p!==null&&p!=="false",v=(ou.get(f)||0)+1,g=(o.get(f)||0)+1;ou.set(f,v),o.set(f,g),a.push(f),v===1&&y&&Sg.set(f,!0),g===1&&f.setAttribute(n,"true"),y||f.setAttribute(r,"true")}catch(m){console.error("aria-hidden: cannot operate on ",f,m)}})};return u(e),s.clear(),F_++,function(){a.forEach(function(d){var f=ou.get(d)-1,p=o.get(d)-1;ou.set(d,f),o.set(d,p),f||(Sg.has(d)||d.removeAttribute(r),Sg.delete(d)),p||d.removeAttribute(n)}),F_--,F_||(ou=new WeakMap,ou=new WeakMap,Sg=new WeakMap,Eg={})}},cx=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),i=Hq(t);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),Gq(r,i,n,"aria-hidden")):function(){return null}},ux="Dialog",[lF,cF]=mi(ux),[Wq,Wo]=lF(ux),uF=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:a=!0}=t,s=_.useRef(null),l=_.useRef(null),[c,u]=zo({prop:r,defaultProp:i??!1,onChange:o,caller:ux});return h.jsx(Wq,{scope:e,triggerRef:s,contentRef:l,contentId:sr(),titleId:sr(),descriptionId:sr(),open:c,onOpenChange:u,onOpenToggle:_.useCallback(()=>u(d=>!d),[u]),modal:a,children:n})};uF.displayName=ux;var dF="DialogTrigger",fF=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Wo(dF,n),o=Ot(e,i.triggerRef);return h.jsx(nt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":fA(i.open),...r,ref:o,onClick:Oe(t.onClick,i.onOpenToggle)})});fF.displayName=dF;var uA="DialogPortal",[Xq,hF]=lF(uA,{forceMount:void 0}),pF=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:i}=t,o=Wo(uA,e);return h.jsx(Xq,{scope:e,forceMount:n,children:_.Children.map(r,a=>h.jsx(gi,{present:n||o.open,children:h.jsx(vf,{asChild:!0,container:i,children:a})}))})};pF.displayName=uA;var by="DialogOverlay",mF=_.forwardRef((t,e)=>{const n=hF(by,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,o=Wo(by,t.__scopeDialog);return o.modal?h.jsx(gi,{present:r||o.open,children:h.jsx(Kq,{...i,ref:e})}):null});mF.displayName=by;var qq=sl("DialogOverlay.RemoveScroll"),Kq=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Wo(by,n);return h.jsx(Mm,{as:qq,allowPinchZoom:!0,shards:[i.contentRef],children:h.jsx(nt.div,{"data-state":fA(i.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),Mc="DialogContent",gF=_.forwardRef((t,e)=>{const n=hF(Mc,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,o=Wo(Mc,t.__scopeDialog);return h.jsx(gi,{present:r||o.open,children:o.modal?h.jsx(Yq,{...i,ref:e}):h.jsx(Jq,{...i,ref:e})})});gF.displayName=Mc;var Yq=_.forwardRef((t,e)=>{const n=Wo(Mc,t.__scopeDialog),r=_.useRef(null),i=Ot(e,n.contentRef,r);return _.useEffect(()=>{const o=r.current;if(o)return cx(o)},[]),h.jsx(vF,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Oe(t.onCloseAutoFocus,o=>{var a;o.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Oe(t.onPointerDownOutside,o=>{const a=o.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&o.preventDefault()}),onFocusOutside:Oe(t.onFocusOutside,o=>o.preventDefault())})}),Jq=_.forwardRef((t,e)=>{const n=Wo(Mc,t.__scopeDialog),r=_.useRef(!1),i=_.useRef(!1);return h.jsx(vF,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var a,s;(a=t.onCloseAutoFocus)==null||a.call(t,o),o.defaultPrevented||(r.current||(s=n.triggerRef.current)==null||s.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var l,c;(l=t.onInteractOutside)==null||l.call(t,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=o.target;((c=n.triggerRef.current)==null?void 0:c.contains(a))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),vF=_.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...a}=t,s=Wo(Mc,n),l=_.useRef(null),c=Ot(e,l);return sx(),h.jsxs(h.Fragment,{children:[h.jsx(Tm,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:h.jsx(zc,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":fA(s.open),...a,ref:c,onDismiss:()=>s.onOpenChange(!1)})}),h.jsxs(h.Fragment,{children:[h.jsx(Qq,{titleId:s.titleId}),h.jsx(tK,{contentRef:l,descriptionId:s.descriptionId})]})]})}),dA="DialogTitle",yF=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Wo(dA,n);return h.jsx(nt.h2,{id:i.titleId,...r,ref:e})});yF.displayName=dA;var xF="DialogDescription",bF=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Wo(xF,n);return h.jsx(nt.p,{id:i.descriptionId,...r,ref:e})});bF.displayName=xF;var _F="DialogClose",wF=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Wo(_F,n);return h.jsx(nt.button,{type:"button",...r,ref:e,onClick:Oe(t.onClick,()=>i.onOpenChange(!1))})});wF.displayName=_F;function fA(t){return t?"open":"closed"}var SF="DialogTitleWarning",[Zq,EF]=e9(SF,{contentName:Mc,titleName:dA,docsSlug:"dialog"}),Qq=({titleId:t})=>{const e=EF(SF),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users. If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component. -For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return _.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},Zq="DialogDescriptionWarning",Qq=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${wF(Zq).contentName}}.`;return _.useEffect(()=>{var o;const i=(o=t.current)==null?void 0:o.getAttribute("aria-describedby");e&&i&&(document.getElementById(e)||console.warn(r))},[r,t,e]),null},fA=lF,eK=uF,hA=fF,dx=hF,fx=pF,pA=gF,mA=yF,gA=bF;const Hc=fA,tK=hA,SF=_.forwardRef(({className:t,...e},n)=>h.jsx(dx,{ref:n,className:He("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e}));SF.displayName=dx.displayName;const bl=_.forwardRef(({className:t,children:e,hideClose:n,...r},i)=>h.jsxs(tK,{children:[h.jsx(SF,{}),h.jsxs(fx,{ref:i,className:He("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...r,children:[e,!n&&h.jsxs(gA,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[h.jsx(ax,{className:"h-4 w-4"}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));bl.displayName=fx.displayName;const _l=({className:t,...e})=>h.jsx("div",{className:He("flex flex-col space-y-1.5 text-center sm:text-left",t),...e});_l.displayName="DialogHeader";const EF=({className:t,...e})=>h.jsx("div",{className:He("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});EF.displayName="DialogFooter";const wl=_.forwardRef(({className:t,...e},n)=>h.jsx(pA,{ref:n,className:He("text-lg font-semibold leading-none tracking-tight",t),...e}));wl.displayName=pA.displayName;const Sl=_.forwardRef(({className:t,...e},n)=>h.jsx(mA,{ref:n,className:He("text-sm text-muted-foreground",t),...e}));Sl.displayName=mA.displayName;const nK=({open:t,onOpenChange:e})=>{const{auth:n,refetch:r}=xf(),[i,o]=_.useState(!1),[a,s]=_.useState(!1);if(n.status!=="unauthenticated")return null;const l=async()=>{try{await navigator.clipboard.writeText(n.loginCommand),o(!0),setTimeout(()=>o(!1),1500)}catch(u){console.warn("Clipboard write failed:",u)}},c=async()=>{s(!0);try{await r()}finally{s(!1)}};return h.jsx(Hc,{open:t,onOpenChange:e,children:h.jsxs(bl,{className:"bg-gray-900 border-gray-800 text-white",children:[h.jsxs(_l,{children:[h.jsx(wl,{className:"text-amber-200",children:"Hugging Face CLI not configured"}),h.jsx(Sl,{className:"text-gray-400",children:"Uploads, training, and replay-from-Hub require a logged-in HF CLI. Run this in a terminal:"})]}),h.jsxs("pre",{className:"bg-gray-950 p-3 rounded border border-gray-700 text-xs sm:text-sm overflow-x-auto flex items-center justify-between gap-2",children:[h.jsx("code",{className:"text-green-400",children:n.loginCommand}),h.jsx("button",{type:"button",onClick:l,className:"flex-shrink-0 text-gray-400 hover:text-gray-200 transition-colors","aria-label":"Copy command",children:i?h.jsx(xl,{className:"w-4 h-4 text-green-400"}):h.jsx(rA,{className:"w-4 h-4"})})]}),h.jsxs(et,{variant:"outline",size:"sm",onClick:c,disabled:a,className:"border-amber-700 bg-transparent text-amber-100 hover:bg-amber-900/40 hover:text-amber-50",children:[h.jsx(kU,{className:`w-4 h-4 mr-2 ${a?"animate-spin":""}`}),"I've logged in โ€” recheck"]})]})})},rK=()=>{const{auth:t}=xf(),[e,n]=_.useState(!1);return t.status==="loading"?h.jsxs("div",{className:"inline-flex items-center gap-2 rounded-full border border-gray-800 bg-gray-900/60 px-3 py-1 text-xs text-gray-400",children:[h.jsx(fi,{className:"w-3 h-3 animate-spin"}),h.jsx("span",{children:"Checking HFโ€ฆ"})]}):t.status==="authenticated"?h.jsxs("div",{className:"inline-flex items-center gap-2 rounded-full border border-gray-800 bg-gray-900/60 px-3 py-1 text-xs text-gray-200",title:"Hugging Face authenticated",children:[h.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-400","aria-hidden":"true"}),h.jsx("span",{children:t.username})]}):h.jsxs(h.Fragment,{children:[h.jsxs("button",{type:"button",onClick:()=>n(!0),className:"inline-flex items-center gap-2 rounded-full border border-amber-700/60 bg-amber-950/40 px-3 py-1 text-xs text-amber-100 hover:bg-amber-900/40 transition-colors","aria-label":"Hugging Face not configured โ€” show login instructions",children:[h.jsx("span",{className:"h-2 w-2 rounded-full bg-amber-400","aria-hidden":"true"}),h.jsx("span",{children:"HF not configured"})]}),h.jsx(nK,{open:e,onOpenChange:n})]})},iK=()=>h.jsx("header",{className:"sticky top-0 z-30 w-full border-b border-gray-800 bg-black/95 backdrop-blur supports-[backdrop-filter]:bg-black/70",children:h.jsxs("div",{className:"mx-auto flex h-12 max-w-7xl items-center justify-between px-4",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("img",{src:"/lovable-uploads/5e648747-34b7-4d8f-93fd-4dbd00aeeefc.png",alt:"LeLab",className:"h-7 w-7"}),h.jsx("span",{className:"text-base font-semibold tracking-tight text-white",children:"LeLab"})]}),h.jsx(rK,{})]})}),oK=({className:t})=>h.jsx("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",className:t,children:h.jsx("path",{d:"M20.317 4.369A19.79 19.79 0 0 0 16.558 3.2a.07.07 0 0 0-.074.035c-.211.375-.444.864-.608 1.249a18.27 18.27 0 0 0-5.487 0 12.51 12.51 0 0 0-.617-1.249.077.077 0 0 0-.074-.035 19.736 19.736 0 0 0-3.76 1.169.07.07 0 0 0-.032.027C2.533 8.046 1.79 11.624 2.155 15.157a.082.082 0 0 0 .031.056 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.027c.462-.63.873-1.295 1.226-1.994a.076.076 0 0 0-.041-.105 13.13 13.13 0 0 1-1.873-.892.077.077 0 0 1-.008-.128c.126-.094.252-.192.372-.291a.074.074 0 0 1 .077-.01c3.927 1.793 8.18 1.793 12.061 0a.074.074 0 0 1 .078.009c.12.099.246.198.373.292a.077.077 0 0 1-.006.128 12.32 12.32 0 0 1-1.873.891.077.077 0 0 0-.04.106c.36.698.772 1.363 1.225 1.993a.076.076 0 0 0 .084.028 19.84 19.84 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-4.087-.838-7.636-3.548-10.787a.061.061 0 0 0-.031-.028zM8.02 12.997c-1.182 0-2.156-1.085-2.156-2.419 0-1.333.955-2.419 2.156-2.419 1.21 0 2.175 1.095 2.156 2.42 0 1.333-.955 2.418-2.156 2.418zm7.974 0c-1.182 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.175 1.095 2.156 2.42 0 1.333-.946 2.418-2.156 2.418z"})}),aK=[{href:"https://github.com/huggingface/lerobot",label:"GitHub",Icon:eX},{href:"https://huggingface.co/docs/lerobot",label:"Documentation",Icon:G7},{href:"https://discord.com/invite/s3KuuzsPFb",label:"Discord",Icon:oK}],sK=()=>h.jsx("footer",{className:"fixed inset-x-0 bottom-0 z-30 border-t border-gray-800 bg-black/95",children:h.jsxs("div",{className:"mx-auto flex max-w-7xl flex-col items-center justify-between gap-3 px-4 py-4 text-sm text-gray-400 sm:flex-row",children:[h.jsxs("span",{children:["Powered by"," ",h.jsx("a",{href:"https://github.com/huggingface/lerobot",target:"_blank",rel:"noopener noreferrer",className:"font-medium text-gray-200 hover:text-white",children:"LeRobot"})]}),h.jsx("nav",{className:"flex items-center gap-4",children:aK.map(({href:t,label:e,Icon:n})=>h.jsxs("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 text-gray-400 hover:text-white",children:[h.jsx(n,{className:"h-4 w-4"}),h.jsx("span",{children:e})]},e))})]})}),lK=["top","right","bottom","left"],ul=Math.min,Ti=Math.max,_y=Math.round,Tg=Math.floor,ma=t=>({x:t,y:t}),cK={left:"right",right:"left",bottom:"top",top:"bottom"},uK={start:"end",end:"start"};function gE(t,e,n){return Ti(t,ul(e,n))}function os(t,e){return typeof t=="function"?t(e):t}function as(t){return t.split("-")[0]}function bf(t){return t.split("-")[1]}function vA(t){return t==="x"?"y":"x"}function yA(t){return t==="y"?"height":"width"}function aa(t){return["top","bottom"].includes(as(t))?"y":"x"}function xA(t){return vA(aa(t))}function dK(t,e,n){n===void 0&&(n=!1);const r=bf(t),i=xA(t),o=yA(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(a=wy(a)),[a,wy(a)]}function fK(t){const e=wy(t);return[vE(t),e,vE(e)]}function vE(t){return t.replace(/start|end/g,e=>uK[e])}function hK(t,e,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],a=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:r:e?r:i;case"left":case"right":return e?o:a;default:return[]}}function pK(t,e,n,r){const i=bf(t);let o=hK(as(t),n==="start",r);return i&&(o=o.map(a=>a+"-"+i),e&&(o=o.concat(o.map(vE)))),o}function wy(t){return t.replace(/left|right|bottom|top/g,e=>cK[e])}function mK(t){return{top:0,right:0,bottom:0,left:0,...t}}function TF(t){return typeof t!="number"?mK(t):{top:t,right:t,bottom:t,left:t}}function Sy(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function vN(t,e,n){let{reference:r,floating:i}=t;const o=aa(e),a=xA(e),s=yA(a),l=as(e),c=o==="y",u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2;let p;switch(l){case"top":p={x:u,y:r.y-i.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(bf(e)){case"start":p[a]-=f*(n&&c?-1:1);break;case"end":p[a]+=f*(n&&c?-1:1);break}return p}const gK=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=o.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(e));let c=await a.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:d}=vN(c,r,l),f=r,p={},y=0;for(let v=0;v({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:o,platform:a,elements:s,middlewareData:l}=e,{element:c,padding:u=0}=os(t,e)||{};if(c==null)return{};const d=TF(u),f={x:n,y:r},p=xA(i),y=yA(p),v=await a.getDimensions(c),g=p==="y",m=g?"top":"left",x=g?"bottom":"right",b=g?"clientHeight":"clientWidth",S=o.reference[y]+o.reference[p]-f[p]-o.floating[y],w=f[p]-o.reference[p],E=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c));let T=E?E[b]:0;(!T||!await(a.isElement==null?void 0:a.isElement(E)))&&(T=s.floating[b]||o.floating[y]);const A=S/2-w/2,M=T/2-v[y]/2-1,C=ul(d[m],M),P=ul(d[x],M),R=C,D=T-v[y]-P,k=T/2-v[y]/2+A,U=gE(R,k,D),O=!l.arrow&&bf(i)!=null&&k!==U&&o.reference[y]/2-(kk<=0)){var P,R;const k=(((P=o.flip)==null?void 0:P.index)||0)+1,U=T[k];if(U&&(!(d==="alignment"?x!==aa(U):!1)||C.every(L=>L.overflows[0]>0&&aa(L.placement)===x)))return{data:{index:k,overflows:C},reset:{placement:U}};let O=(R=C.filter(W=>W.overflows[0]<=0).sort((W,L)=>W.overflows[1]-L.overflows[1])[0])==null?void 0:R.placement;if(!O)switch(p){case"bestFit":{var D;const W=(D=C.filter(L=>{if(E){const j=aa(L.placement);return j===x||j==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(j=>j>0).reduce((j,X)=>j+X,0)]).sort((L,j)=>L[1]-j[1])[0])==null?void 0:D[0];W&&(O=W);break}case"initialPlacement":O=s;break}if(i!==O)return{reset:{placement:O}}}return{}}}};function yN(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function xN(t){return lK.some(e=>t[e]>=0)}const xK=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...i}=os(t,e);switch(r){case"referenceHidden":{const o=await _p(e,{...i,elementContext:"reference"}),a=yN(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:xN(a)}}}case"escaped":{const o=await _p(e,{...i,altBoundary:!0}),a=yN(o,n.floating);return{data:{escapedOffsets:a,escaped:xN(a)}}}default:return{}}}}};async function bK(t,e){const{placement:n,platform:r,elements:i}=t,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=as(n),s=bf(n),l=aa(n)==="y",c=["left","top"].includes(a)?-1:1,u=o&&l?-1:1,d=os(e,t);let{mainAxis:f,crossAxis:p,alignmentAxis:y}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof y=="number"&&(p=s==="end"?y*-1:y),l?{x:p*u,y:f*c}:{x:f*c,y:p*u}}const _K=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:o,placement:a,middlewareData:s}=e,l=await bK(e,t);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:a}}}}},wK=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:g=>{let{x:m,y:x}=g;return{x:m,y:x}}},...l}=os(t,e),c={x:n,y:r},u=await _p(e,l),d=aa(as(i)),f=vA(d);let p=c[f],y=c[d];if(o){const g=f==="y"?"top":"left",m=f==="y"?"bottom":"right",x=p+u[g],b=p-u[m];p=gE(x,p,b)}if(a){const g=d==="y"?"top":"left",m=d==="y"?"bottom":"right",x=y+u[g],b=y-u[m];y=gE(x,y,b)}const v=s.fn({...e,[f]:p,[d]:y});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[f]:o,[d]:a}}}}}},SK=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=e,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=os(t,e),u={x:n,y:r},d=aa(i),f=vA(d);let p=u[f],y=u[d];const v=os(s,e),g=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(l){const b=f==="y"?"height":"width",S=o.reference[f]-o.floating[b]+g.mainAxis,w=o.reference[f]+o.reference[b]-g.mainAxis;pw&&(p=w)}if(c){var m,x;const b=f==="y"?"width":"height",S=["top","left"].includes(as(i)),w=o.reference[d]-o.floating[b]+(S&&((m=a.offset)==null?void 0:m[d])||0)+(S?0:g.crossAxis),E=o.reference[d]+o.reference[b]+(S?0:((x=a.offset)==null?void 0:x[d])||0)-(S?g.crossAxis:0);yE&&(y=E)}return{[f]:p,[d]:y}}}},EK=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:o,platform:a,elements:s}=e,{apply:l=()=>{},...c}=os(t,e),u=await _p(e,c),d=as(i),f=bf(i),p=aa(i)==="y",{width:y,height:v}=o.floating;let g,m;d==="top"||d==="bottom"?(g=d,m=f===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(m=d,g=f==="end"?"top":"bottom");const x=v-u.top-u.bottom,b=y-u.left-u.right,S=ul(v-u[g],x),w=ul(y-u[m],b),E=!e.middlewareData.shift;let T=S,A=w;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(A=b),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(T=x),E&&!f){const C=Ti(u.left,0),P=Ti(u.right,0),R=Ti(u.top,0),D=Ti(u.bottom,0);p?A=y-2*(C!==0||P!==0?C+P:Ti(u.left,u.right)):T=v-2*(R!==0||D!==0?R+D:Ti(u.top,u.bottom))}await l({...e,availableWidth:A,availableHeight:T});const M=await a.getDimensions(s.floating);return y!==M.width||v!==M.height?{reset:{rects:!0}}:{}}}};function hx(){return typeof window<"u"}function _f(t){return MF(t)?(t.nodeName||"").toLowerCase():"#document"}function Ni(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Sa(t){var e;return(e=(MF(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function MF(t){return hx()?t instanceof Node||t instanceof Ni(t).Node:!1}function zo(t){return hx()?t instanceof Element||t instanceof Ni(t).Element:!1}function xa(t){return hx()?t instanceof HTMLElement||t instanceof Ni(t).HTMLElement:!1}function bN(t){return!hx()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Ni(t).ShadowRoot}function Am(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=Ho(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function TK(t){return["table","td","th"].includes(_f(t))}function px(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function bA(t){const e=_A(),n=zo(t)?Ho(t):t;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function MK(t){let e=dl(t);for(;xa(e)&&!Id(e);){if(bA(e))return e;if(px(e))return null;e=dl(e)}return null}function _A(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Id(t){return["html","body","#document"].includes(_f(t))}function Ho(t){return Ni(t).getComputedStyle(t)}function mx(t){return zo(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function dl(t){if(_f(t)==="html")return t;const e=t.assignedSlot||t.parentNode||bN(t)&&t.host||Sa(t);return bN(e)?e.host:e}function AF(t){const e=dl(t);return Id(e)?t.ownerDocument?t.ownerDocument.body:t.body:xa(e)&&Am(e)?e:AF(e)}function wp(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=AF(t),o=i===((r=t.ownerDocument)==null?void 0:r.body),a=Ni(i);if(o){const s=yE(a);return e.concat(a,a.visualViewport||[],Am(i)?i:[],s&&n?wp(s):[])}return e.concat(i,wp(i,[],n))}function yE(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function CF(t){const e=Ho(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=xa(t),o=i?t.offsetWidth:n,a=i?t.offsetHeight:r,s=_y(n)!==o||_y(r)!==a;return s&&(n=o,r=a),{width:n,height:r,$:s}}function wA(t){return zo(t)?t:t.contextElement}function od(t){const e=wA(t);if(!xa(e))return ma(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:o}=CF(e);let a=(o?_y(n.width):n.width)/r,s=(o?_y(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const AK=ma(0);function PF(t){const e=Ni(t);return!_A()||!e.visualViewport?AK:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function CK(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Ni(t)?!1:e}function Ac(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),o=wA(t);let a=ma(1);e&&(r?zo(r)&&(a=od(r)):a=od(t));const s=CK(o,n,r)?PF(o):ma(0);let l=(i.left+s.x)/a.x,c=(i.top+s.y)/a.y,u=i.width/a.x,d=i.height/a.y;if(o){const f=Ni(o),p=r&&zo(r)?Ni(r):r;let y=f,v=yE(y);for(;v&&r&&p!==y;){const g=od(v),m=v.getBoundingClientRect(),x=Ho(v),b=m.left+(v.clientLeft+parseFloat(x.paddingLeft))*g.x,S=m.top+(v.clientTop+parseFloat(x.paddingTop))*g.y;l*=g.x,c*=g.y,u*=g.x,d*=g.y,l+=b,c+=S,y=Ni(v),v=yE(y)}}return Sy({width:u,height:d,x:l,y:c})}function SA(t,e){const n=mx(t).scrollLeft;return e?e.left+n:Ac(Sa(t)).left+n}function RF(t,e,n){n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=r.left+e.scrollLeft-(n?0:SA(t,r)),o=r.top+e.scrollTop;return{x:i,y:o}}function PK(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const o=i==="fixed",a=Sa(r),s=e?px(e.floating):!1;if(r===a||s&&o)return n;let l={scrollLeft:0,scrollTop:0},c=ma(1);const u=ma(0),d=xa(r);if((d||!d&&!o)&&((_f(r)!=="body"||Am(a))&&(l=mx(r)),xa(r))){const p=Ac(r);c=od(r),u.x=p.x+r.clientLeft,u.y=p.y+r.clientTop}const f=a&&!d&&!o?RF(a,l,!0):ma(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}}function RK(t){return Array.from(t.getClientRects())}function NK(t){const e=Sa(t),n=mx(t),r=t.ownerDocument.body,i=Ti(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=Ti(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+SA(t);const s=-n.scrollTop;return Ho(r).direction==="rtl"&&(a+=Ti(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:s}}function OK(t,e){const n=Ni(t),r=Sa(t),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;const c=_A();(!c||c&&e==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s,y:l}}function IK(t,e){const n=Ac(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,o=xa(t)?od(t):ma(1),a=t.clientWidth*o.x,s=t.clientHeight*o.y,l=i*o.x,c=r*o.y;return{width:a,height:s,x:l,y:c}}function _N(t,e,n){let r;if(e==="viewport")r=OK(t,n);else if(e==="document")r=NK(Sa(t));else if(zo(e))r=IK(e,n);else{const i=PF(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Sy(r)}function NF(t,e){const n=dl(t);return n===e||!zo(n)||Id(n)?!1:Ho(n).position==="fixed"||NF(n,e)}function DK(t,e){const n=e.get(t);if(n)return n;let r=wp(t,[],!1).filter(s=>zo(s)&&_f(s)!=="body"),i=null;const o=Ho(t).position==="fixed";let a=o?dl(t):t;for(;zo(a)&&!Id(a);){const s=Ho(a),l=bA(a);!l&&s.position==="fixed"&&(i=null),(o?!l&&!i:!l&&s.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Am(a)&&!l&&NF(t,a))?r=r.filter(u=>u!==a):i=s,a=dl(a)}return e.set(t,r),r}function LK(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const a=[...n==="clippingAncestors"?px(e)?[]:DK(e,this._c):[].concat(n),r],s=a[0],l=a.reduce((c,u)=>{const d=_N(e,u,i);return c.top=Ti(d.top,c.top),c.right=ul(d.right,c.right),c.bottom=ul(d.bottom,c.bottom),c.left=Ti(d.left,c.left),c},_N(e,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function kK(t){const{width:e,height:n}=CF(t);return{width:e,height:n}}function jK(t,e,n){const r=xa(e),i=Sa(e),o=n==="fixed",a=Ac(t,!0,o,e);let s={scrollLeft:0,scrollTop:0};const l=ma(0);function c(){l.x=SA(i)}if(r||!r&&!o)if((_f(e)!=="body"||Am(i))&&(s=mx(e)),r){const p=Ac(e,!0,o,e);l.x=p.x+e.clientLeft,l.y=p.y+e.clientTop}else i&&c();o&&!r&&i&&c();const u=i&&!r&&!o?RF(i,s):ma(0),d=a.left+s.scrollLeft-l.x-u.x,f=a.top+s.scrollTop-l.y-u.y;return{x:d,y:f,width:a.width,height:a.height}}function B_(t){return Ho(t).position==="static"}function wN(t,e){if(!xa(t)||Ho(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Sa(t)===n&&(n=n.ownerDocument.body),n}function OF(t,e){const n=Ni(t);if(px(t))return n;if(!xa(t)){let i=dl(t);for(;i&&!Id(i);){if(zo(i)&&!B_(i))return i;i=dl(i)}return n}let r=wN(t,e);for(;r&&TK(r)&&B_(r);)r=wN(r,e);return r&&Id(r)&&B_(r)&&!bA(r)?n:r||MK(t)||n}const UK=async function(t){const e=this.getOffsetParent||OF,n=this.getDimensions,r=await n(t.floating);return{reference:jK(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function FK(t){return Ho(t).direction==="rtl"}const BK={convertOffsetParentRelativeRectToViewportRelativeRect:PK,getDocumentElement:Sa,getClippingRect:LK,getOffsetParent:OF,getElementRects:UK,getClientRects:RK,getDimensions:kK,getScale:od,isElement:zo,isRTL:FK};function IF(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function $K(t,e){let n=null,r;const i=Sa(t);function o(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function a(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),o();const c=t.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=c;if(s||e(),!f||!p)return;const y=Tg(d),v=Tg(i.clientWidth-(u+f)),g=Tg(i.clientHeight-(d+p)),m=Tg(u),b={rootMargin:-y+"px "+-v+"px "+-g+"px "+-m+"px",threshold:Ti(0,ul(1,l))||1};let S=!0;function w(E){const T=E[0].intersectionRatio;if(T!==l){if(!S)return a();T?a(!1,T):r=setTimeout(()=>{a(!1,1e-7)},1e3)}T===1&&!IF(c,t.getBoundingClientRect())&&a(),S=!1}try{n=new IntersectionObserver(w,{...b,root:i.ownerDocument})}catch{n=new IntersectionObserver(w,b)}n.observe(t)}return a(!0),o}function zK(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=wA(t),u=i||o?[...c?wp(c):[],...wp(e)]:[];u.forEach(m=>{i&&m.addEventListener("scroll",n,{passive:!0}),o&&m.addEventListener("resize",n)});const d=c&&s?$K(c,n):null;let f=-1,p=null;a&&(p=new ResizeObserver(m=>{let[x]=m;x&&x.target===c&&p&&(p.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var b;(b=p)==null||b.observe(e)})),n()}),c&&!l&&p.observe(c),p.observe(e));let y,v=l?Ac(t):null;l&&g();function g(){const m=Ac(t);v&&!IF(v,m)&&n(),v=m,y=requestAnimationFrame(g)}return n(),()=>{var m;u.forEach(x=>{i&&x.removeEventListener("scroll",n),o&&x.removeEventListener("resize",n)}),d==null||d(),(m=p)==null||m.disconnect(),p=null,l&&cancelAnimationFrame(y)}}const HK=_K,VK=wK,GK=yK,WK=EK,XK=xK,SN=vK,qK=SK,KK=(t,e,n)=>{const r=new Map,i={platform:BK,...n},o={...i.platform,_c:r};return gK(t,e,{...i,platform:o})};var YK=typeof document<"u",JK=function(){},Uv=YK?_.useLayoutEffect:JK;function Ey(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!Ey(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&t.$$typeof)&&!Ey(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function DF(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function EN(t,e){const n=DF(t);return Math.round(e*n)/n}function $_(t){const e=_.useRef(t);return Uv(()=>{e.current=t}),e}function ZK(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:a}={},transform:s=!0,whileElementsMounted:l,open:c}=t,[u,d]=_.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[f,p]=_.useState(r);Ey(f,r)||p(r);const[y,v]=_.useState(null),[g,m]=_.useState(null),x=_.useCallback(L=>{L!==E.current&&(E.current=L,v(L))},[]),b=_.useCallback(L=>{L!==T.current&&(T.current=L,m(L))},[]),S=o||y,w=a||g,E=_.useRef(null),T=_.useRef(null),A=_.useRef(u),M=l!=null,C=$_(l),P=$_(i),R=$_(c),D=_.useCallback(()=>{if(!E.current||!T.current)return;const L={placement:e,strategy:n,middleware:f};P.current&&(L.platform=P.current),KK(E.current,T.current,L).then(j=>{const X={...j,isPositioned:R.current!==!1};k.current&&!Ey(A.current,X)&&(A.current=X,Bc.flushSync(()=>{d(X)}))})},[f,e,n,P,R]);Uv(()=>{c===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,d(L=>({...L,isPositioned:!1})))},[c]);const k=_.useRef(!1);Uv(()=>(k.current=!0,()=>{k.current=!1}),[]),Uv(()=>{if(S&&(E.current=S),w&&(T.current=w),S&&w){if(C.current)return C.current(S,w,D);D()}},[S,w,D,C,M]);const U=_.useMemo(()=>({reference:E,floating:T,setReference:x,setFloating:b}),[x,b]),O=_.useMemo(()=>({reference:S,floating:w}),[S,w]),W=_.useMemo(()=>{const L={position:n,left:0,top:0};if(!O.floating)return L;const j=EN(O.floating,u.x),X=EN(O.floating,u.y);return s?{...L,transform:"translate("+j+"px, "+X+"px)",...DF(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:j,top:X}},[n,s,O.floating,u.x,u.y]);return _.useMemo(()=>({...u,update:D,refs:U,elements:O,floatingStyles:W}),[u,D,U,O,W])}const QK=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:i}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?SN({element:r.current,padding:i}).fn(n):{}:r?SN({element:r,padding:i}).fn(n):{}}}},eY=(t,e)=>({...HK(t),options:[t,e]}),tY=(t,e)=>({...VK(t),options:[t,e]}),nY=(t,e)=>({...qK(t),options:[t,e]}),rY=(t,e)=>({...GK(t),options:[t,e]}),iY=(t,e)=>({...WK(t),options:[t,e]}),oY=(t,e)=>({...XK(t),options:[t,e]}),aY=(t,e)=>({...QK(t),options:[t,e]});var sY="Arrow",LF=_.forwardRef((t,e)=>{const{children:n,width:r=10,height:i=5,...o}=t;return h.jsx(nt.svg,{...o,ref:e,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:h.jsx("polygon",{points:"0,0 30,0 15,10"})})});LF.displayName=sY;var lY=LF;function EA(t){const[e,n]=_.useState(void 0);return ur(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,s;if("borderBoxSize"in o){const l=o.borderBoxSize,c=Array.isArray(l)?l[0]:l;a=c.inlineSize,s=c.blockSize}else a=t.offsetWidth,s=t.offsetHeight;n({width:a,height:s})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var TA="Popper",[kF,El]=mi(TA),[cY,jF]=kF(TA),UF=t=>{const{__scopePopper:e,children:n}=t,[r,i]=_.useState(null);return h.jsx(cY,{scope:e,anchor:r,onAnchorChange:i,children:n})};UF.displayName=TA;var FF="PopperAnchor",BF=_.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...i}=t,o=jF(FF,n),a=_.useRef(null),s=Ot(e,a);return _.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:h.jsx(nt.div,{...i,ref:s})});BF.displayName=FF;var MA="PopperContent",[uY,dY]=kF(MA),$F=_.forwardRef((t,e)=>{var Q,ce,ae,fe,we,le;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:a=0,arrowPadding:s=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:y,...v}=t,g=jF(MA,n),[m,x]=_.useState(null),b=Ot(e,ie=>x(ie)),[S,w]=_.useState(null),E=EA(S),T=(E==null?void 0:E.width)??0,A=(E==null?void 0:E.height)??0,M=r+(o!=="center"?"-"+o:""),C=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},P=Array.isArray(c)?c:[c],R=P.length>0,D={padding:C,boundary:P.filter(hY),altBoundary:R},{refs:k,floatingStyles:U,placement:O,isPositioned:W,middlewareData:L}=ZK({strategy:"fixed",placement:M,whileElementsMounted:(...ie)=>zK(...ie,{animationFrame:p==="always"}),elements:{reference:g.anchor},middleware:[eY({mainAxis:i+A,alignmentAxis:a}),l&&tY({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?nY():void 0,...D}),l&&rY({...D}),iY({...D,apply:({elements:ie,rects:G,availableWidth:Ve,availableHeight:Ne})=>{const{width:st,height:Re}=G.reference,ct=ie.floating.style;ct.setProperty("--radix-popper-available-width",`${Ve}px`),ct.setProperty("--radix-popper-available-height",`${Ne}px`),ct.setProperty("--radix-popper-anchor-width",`${st}px`),ct.setProperty("--radix-popper-anchor-height",`${Re}px`)}}),S&&aY({element:S,padding:s}),pY({arrowWidth:T,arrowHeight:A}),f&&oY({strategy:"referenceHidden",...D})]}),[j,X]=VF(O),K=di(y);ur(()=>{W&&(K==null||K())},[W,K]);const F=(Q=L.arrow)==null?void 0:Q.x,Y=(ce=L.arrow)==null?void 0:ce.y,q=((ae=L.arrow)==null?void 0:ae.centerOffset)!==0,[ee,te]=_.useState();return ur(()=>{m&&te(window.getComputedStyle(m).zIndex)},[m]),h.jsx("div",{ref:k.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:W?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ee,"--radix-popper-transform-origin":[(fe=L.transformOrigin)==null?void 0:fe.x,(we=L.transformOrigin)==null?void 0:we.y].join(" "),...((le=L.hide)==null?void 0:le.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:h.jsx(uY,{scope:n,placedSide:j,onArrowChange:w,arrowX:F,arrowY:Y,shouldHideArrow:q,children:h.jsx(nt.div,{"data-side":j,"data-align":X,...v,ref:b,style:{...v.style,animation:W?void 0:"none"}})})})});$F.displayName=MA;var zF="PopperArrow",fY={top:"bottom",right:"left",bottom:"top",left:"right"},HF=_.forwardRef(function(e,n){const{__scopePopper:r,...i}=e,o=dY(zF,r),a=fY[o.placedSide];return h.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:h.jsx(lY,{...i,ref:n,style:{...i.style,display:"block"}})})});HF.displayName=zF;function hY(t){return t!==null}var pY=t=>({name:"transformOrigin",options:t,fn(e){var g,m,x;const{placement:n,rects:r,middlewareData:i}=e,a=((g=i.arrow)==null?void 0:g.centerOffset)!==0,s=a?0:t.arrowWidth,l=a?0:t.arrowHeight,[c,u]=VF(n),d={start:"0%",center:"50%",end:"100%"}[u],f=(((m=i.arrow)==null?void 0:m.x)??0)+s/2,p=(((x=i.arrow)==null?void 0:x.y)??0)+l/2;let y="",v="";return c==="bottom"?(y=a?d:`${f}px`,v=`${-l}px`):c==="top"?(y=a?d:`${f}px`,v=`${r.floating.height+l}px`):c==="right"?(y=`${-l}px`,v=a?d:`${p}px`):c==="left"&&(y=`${r.floating.width+l}px`,v=a?d:`${p}px`),{data:{x:y,y:v}}}});function VF(t){const[e,n="center"]=t.split("-");return[e,n]}var gx=UF,Cm=BF,vx=$F,yx=HF,[xx,_De]=mi("Tooltip",[El]),bx=El(),GF="TooltipProvider",mY=700,xE="tooltip.open",[gY,AA]=xx(GF),WF=t=>{const{__scopeTooltip:e,delayDuration:n=mY,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=t,a=_.useRef(!0),s=_.useRef(!1),l=_.useRef(0);return _.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),h.jsx(gY,{scope:e,isOpenDelayedRef:a,delayDuration:n,onOpen:_.useCallback(()=>{window.clearTimeout(l.current),a.current=!1},[]),onClose:_.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:_.useCallback(c=>{s.current=c},[]),disableHoverableContent:i,children:o})};WF.displayName=GF;var Sp="Tooltip",[vY,_x]=xx(Sp),XF=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:i,onOpenChange:o,disableHoverableContent:a,delayDuration:s}=t,l=AA(Sp,t.__scopeTooltip),c=bx(e),[u,d]=_.useState(null),f=sr(),p=_.useRef(0),y=a??l.disableHoverableContent,v=s??l.delayDuration,g=_.useRef(!1),[m,x]=$o({prop:r,defaultProp:i??!1,onChange:T=>{T?(l.onOpen(),document.dispatchEvent(new CustomEvent(xE))):l.onClose(),o==null||o(T)},caller:Sp}),b=_.useMemo(()=>m?g.current?"delayed-open":"instant-open":"closed",[m]),S=_.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,x(!0)},[x]),w=_.useCallback(()=>{window.clearTimeout(p.current),p.current=0,x(!1)},[x]),E=_.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,x(!0),p.current=0},v)},[v,x]);return _.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),h.jsx(gx,{...c,children:h.jsx(vY,{scope:e,contentId:f,open:m,stateAttribute:b,trigger:u,onTriggerChange:d,onTriggerEnter:_.useCallback(()=>{l.isOpenDelayedRef.current?E():S()},[l.isOpenDelayedRef,E,S]),onTriggerLeave:_.useCallback(()=>{y?w():(window.clearTimeout(p.current),p.current=0)},[w,y]),onOpen:S,onClose:w,disableHoverableContent:y,children:n})})};XF.displayName=Sp;var bE="TooltipTrigger",qF=_.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=_x(bE,n),o=AA(bE,n),a=bx(n),s=_.useRef(null),l=Ot(e,s,i.onTriggerChange),c=_.useRef(!1),u=_.useRef(!1),d=_.useCallback(()=>c.current=!1,[]);return _.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),h.jsx(Cm,{asChild:!0,...a,children:h.jsx(nt.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:l,onPointerMove:Oe(t.onPointerMove,f=>{f.pointerType!=="touch"&&!u.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),u.current=!0)}),onPointerLeave:Oe(t.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:Oe(t.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Oe(t.onFocus,()=>{c.current||i.onOpen()}),onBlur:Oe(t.onBlur,i.onClose),onClick:Oe(t.onClick,i.onClose)})})});qF.displayName=bE;var yY="TooltipPortal",[wDe,xY]=xx(yY,{forceMount:void 0}),Dd="TooltipContent",KF=_.forwardRef((t,e)=>{const n=xY(Dd,t.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=t,a=_x(Dd,t.__scopeTooltip);return h.jsx(gi,{present:r||a.open,children:a.disableHoverableContent?h.jsx(YF,{side:i,...o,ref:e}):h.jsx(bY,{side:i,...o,ref:e})})}),bY=_.forwardRef((t,e)=>{const n=_x(Dd,t.__scopeTooltip),r=AA(Dd,t.__scopeTooltip),i=_.useRef(null),o=Ot(e,i),[a,s]=_.useState(null),{trigger:l,onClose:c}=n,u=i.current,{onPointerInTransitChange:d}=r,f=_.useCallback(()=>{s(null),d(!1)},[d]),p=_.useCallback((y,v)=>{const g=y.currentTarget,m={x:y.clientX,y:y.clientY},x=TY(m,g.getBoundingClientRect()),b=MY(m,x),S=AY(v.getBoundingClientRect()),w=PY([...b,...S]);s(w),d(!0)},[d]);return _.useEffect(()=>()=>f(),[f]),_.useEffect(()=>{if(l&&u){const y=g=>p(g,u),v=g=>p(g,l);return l.addEventListener("pointerleave",y),u.addEventListener("pointerleave",v),()=>{l.removeEventListener("pointerleave",y),u.removeEventListener("pointerleave",v)}}},[l,u,p,f]),_.useEffect(()=>{if(a){const y=v=>{const g=v.target,m={x:v.clientX,y:v.clientY},x=(l==null?void 0:l.contains(g))||(u==null?void 0:u.contains(g)),b=!CY(m,a);x?f():b&&(f(),c())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[l,u,a,c,f]),h.jsx(YF,{...t,ref:o})}),[_Y,wY]=xx(Sp,{isInside:!1}),SY=uU("TooltipContent"),YF=_.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:a,...s}=t,l=_x(Dd,n),c=bx(n),{onClose:u}=l;return _.useEffect(()=>(document.addEventListener(xE,u),()=>document.removeEventListener(xE,u)),[u]),_.useEffect(()=>{if(l.trigger){const d=f=>{const p=f.target;p!=null&&p.contains(l.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,u]),h.jsx(zc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:h.jsxs(vx,{"data-state":l.stateAttribute,...c,...s,ref:e,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[h.jsx(SY,{children:r}),h.jsx(_Y,{scope:n,isInside:!0,children:h.jsx(S7,{id:l.contentId,role:"tooltip",children:i||r})})]})})});KF.displayName=Dd;var JF="TooltipArrow",EY=_.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=bx(n);return wY(JF,n).isInside?null:h.jsx(yx,{...i,...r,ref:e})});EY.displayName=JF;function TY(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),i=Math.abs(e.right-t.x),o=Math.abs(e.left-t.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function MY(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function AY(t){const{top:e,right:n,bottom:r,left:i}=t;return[{x:i,y:e},{x:n,y:e},{x:n,y:r},{x:i,y:r}]}function CY(t,e){const{x:n,y:r}=t;let i=!1;for(let o=0,a=e.length-1;or!=f>r&&n<(d-c)*(r-u)/(f-u)+c&&(i=!i)}return i}function PY(t){const e=t.slice();return e.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),RY(e)}function RY(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r=2;){const o=e[e.length-1],a=e[e.length-2];if((o.x-a.x)*(i.y-a.y)>=(o.y-a.y)*(i.x-a.x))e.pop();else break}e.push(i)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const i=t[r];for(;n.length>=2;){const o=n[n.length-1],a=n[n.length-2];if((o.x-a.x)*(i.y-a.y)>=(o.y-a.y)*(i.x-a.x))n.pop();else break}n.push(i)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var NY=XF,OY=qF,ZF=KF;const Fv=NY,Bv=OY,Gh=_.forwardRef(({className:t,sideOffset:e=4,...n},r)=>h.jsx(ZF,{ref:r,sideOffset:e,className:He("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n}));Gh.displayName=ZF.displayName;var wx="Popover",[QF,SDe]=mi(wx,[El]),Pm=El(),[IY,Tl]=QF(wx),eB=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:a=!1}=t,s=Pm(e),l=_.useRef(null),[c,u]=_.useState(!1),[d,f]=$o({prop:r,defaultProp:i??!1,onChange:o,caller:wx});return h.jsx(gx,{...s,children:h.jsx(IY,{scope:e,contentId:sr(),triggerRef:l,open:d,onOpenChange:f,onOpenToggle:_.useCallback(()=>f(p=>!p),[f]),hasCustomAnchor:c,onCustomAnchorAdd:_.useCallback(()=>u(!0),[]),onCustomAnchorRemove:_.useCallback(()=>u(!1),[]),modal:a,children:n})})};eB.displayName=wx;var tB="PopoverAnchor",DY=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Tl(tB,n),o=Pm(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:s}=i;return _.useEffect(()=>(a(),()=>s()),[a,s]),h.jsx(Cm,{...o,...r,ref:e})});DY.displayName=tB;var nB="PopoverTrigger",rB=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Tl(nB,n),o=Pm(n),a=Ot(e,i.triggerRef),s=h.jsx(nt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":lB(i.open),...r,ref:a,onClick:Oe(t.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:h.jsx(Cm,{asChild:!0,...o,children:s})});rB.displayName=nB;var CA="PopoverPortal",[LY,kY]=QF(CA,{forceMount:void 0}),iB=t=>{const{__scopePopover:e,forceMount:n,children:r,container:i}=t,o=Tl(CA,e);return h.jsx(LY,{scope:e,forceMount:n,children:h.jsx(gi,{present:n||o.open,children:h.jsx(vf,{asChild:!0,container:i,children:r})})})};iB.displayName=CA;var Ld="PopoverContent",oB=_.forwardRef((t,e)=>{const n=kY(Ld,t.__scopePopover),{forceMount:r=n.forceMount,...i}=t,o=Tl(Ld,t.__scopePopover);return h.jsx(gi,{present:r||o.open,children:o.modal?h.jsx(UY,{...i,ref:e}):h.jsx(FY,{...i,ref:e})})});oB.displayName=Ld;var jY=sl("PopoverContent.RemoveScroll"),UY=_.forwardRef((t,e)=>{const n=Tl(Ld,t.__scopePopover),r=_.useRef(null),i=Ot(e,r),o=_.useRef(!1);return _.useEffect(()=>{const a=r.current;if(a)return cx(a)},[]),h.jsx(Mm,{as:jY,allowPinchZoom:!0,children:h.jsx(aB,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Oe(t.onCloseAutoFocus,a=>{var s;a.preventDefault(),o.current||(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:Oe(t.onPointerDownOutside,a=>{const s=a.detail.originalEvent,l=s.button===0&&s.ctrlKey===!0,c=s.button===2||l;o.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:Oe(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),FY=_.forwardRef((t,e)=>{const n=Tl(Ld,t.__scopePopover),r=_.useRef(!1),i=_.useRef(!1);return h.jsx(aB,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var a,s;(a=t.onCloseAutoFocus)==null||a.call(t,o),o.defaultPrevented||(r.current||(s=n.triggerRef.current)==null||s.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var l,c;(l=t.onInteractOutside)==null||l.call(t,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=o.target;((c=n.triggerRef.current)==null?void 0:c.contains(a))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),aB=_.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...d}=t,f=Tl(Ld,n),p=Pm(n);return sx(),h.jsx(Tm,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:h.jsx(zc,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>f.onOpenChange(!1),children:h.jsx(vx,{"data-state":lB(f.open),role:"dialog",id:f.contentId,...p,...d,ref:e,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),sB="PopoverClose",BY=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Tl(sB,n);return h.jsx(nt.button,{type:"button",...r,ref:e,onClick:Oe(t.onClick,()=>i.onOpenChange(!1))})});BY.displayName=sB;var $Y="PopoverArrow",zY=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Pm(n);return h.jsx(yx,{...i,...r,ref:e})});zY.displayName=$Y;function lB(t){return t?"open":"closed"}var HY=eB,VY=rB,GY=iB,cB=oB;const Sx=HY,Ex=VY,Rm=_.forwardRef(({className:t,align:e="center",sideOffset:n=4,...r},i)=>h.jsx(GY,{children:h.jsx(cB,{ref:i,align:e,sideOffset:n,className:He("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r})}));Rm.displayName=cB.displayName;var TN=1,WY=.9,XY=.8,qY=.17,z_=.1,H_=.999,KY=.9999,YY=.99,JY=/[\\\/_+.#"@\[\(\{&]/,ZY=/[\\\/_+.#"@\[\(\{&]/g,QY=/[\s-]/,uB=/[\s-]/g;function _E(t,e,n,r,i,o,a){if(o===e.length)return i===t.length?TN:YY;var s=`${i},${o}`;if(a[s]!==void 0)return a[s];for(var l=r.charAt(o),c=n.indexOf(l,i),u=0,d,f,p,y;c>=0;)d=_E(t,e,n,r,c+1,o+1,a),d>u&&(c===i?d*=TN:JY.test(t.charAt(c-1))?(d*=XY,p=t.slice(i,c-1).match(ZY),p&&i>0&&(d*=Math.pow(H_,p.length))):QY.test(t.charAt(c-1))?(d*=WY,y=t.slice(i,c-1).match(uB),y&&i>0&&(d*=Math.pow(H_,y.length))):(d*=qY,i>0&&(d*=Math.pow(H_,c-i))),t.charAt(c)!==e.charAt(o)&&(d*=KY)),(dd&&(d=f*z_)),d>u&&(u=d),c=n.indexOf(l,c+1);return a[s]=u,u}function MN(t){return t.toLowerCase().replace(uB," ")}function eJ(t,e,n){return t=n&&n.length>0?`${t+" "+n.join(" ")}`:t,_E(t,e,MN(t),MN(e),0,0,{})}var eh='[cmdk-group=""]',V_='[cmdk-group-items=""]',tJ='[cmdk-group-heading=""]',dB='[cmdk-item=""]',AN=`${dB}:not([aria-disabled="true"])`,wE="cmdk-item-select",Mu="data-value",nJ=(t,e,n)=>eJ(t,e,n),fB=_.createContext(void 0),Nm=()=>_.useContext(fB),hB=_.createContext(void 0),PA=()=>_.useContext(hB),pB=_.createContext(void 0),mB=_.forwardRef((t,e)=>{let n=Au(()=>{var F,Y;return{search:"",value:(Y=(F=t.value)!=null?F:t.defaultValue)!=null?Y:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Au(()=>new Set),i=Au(()=>new Map),o=Au(()=>new Map),a=Au(()=>new Set),s=gB(t),{label:l,children:c,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:y,disablePointerSelection:v=!1,vimBindings:g=!0,...m}=t,x=sr(),b=sr(),S=sr(),w=_.useRef(null),E=hJ();Cc(()=>{if(u!==void 0){let F=u.trim();n.current.value=F,T.emit()}},[u]),Cc(()=>{E(6,D)},[]);let T=_.useMemo(()=>({subscribe:F=>(a.current.add(F),()=>a.current.delete(F)),snapshot:()=>n.current,setState:(F,Y,q)=>{var ee,te,Q,ce;if(!Object.is(n.current[F],Y)){if(n.current[F]=Y,F==="search")R(),C(),E(1,P);else if(F==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ae=document.getElementById(S);ae?ae.focus():(ee=document.getElementById(x))==null||ee.focus()}if(E(7,()=>{var ae;n.current.selectedItemId=(ae=k())==null?void 0:ae.id,T.emit()}),q||E(5,D),((te=s.current)==null?void 0:te.value)!==void 0){let ae=Y??"";(ce=(Q=s.current).onValueChange)==null||ce.call(Q,ae);return}}T.emit()}},emit:()=>{a.current.forEach(F=>F())}}),[]),A=_.useMemo(()=>({value:(F,Y,q)=>{var ee;Y!==((ee=o.current.get(F))==null?void 0:ee.value)&&(o.current.set(F,{value:Y,keywords:q}),n.current.filtered.items.set(F,M(Y,q)),E(2,()=>{C(),T.emit()}))},item:(F,Y)=>(r.current.add(F),Y&&(i.current.has(Y)?i.current.get(Y).add(F):i.current.set(Y,new Set([F]))),E(3,()=>{R(),C(),n.current.value||P(),T.emit()}),()=>{o.current.delete(F),r.current.delete(F),n.current.filtered.items.delete(F);let q=k();E(4,()=>{R(),(q==null?void 0:q.getAttribute("id"))===F&&P(),T.emit()})}),group:F=>(i.current.has(F)||i.current.set(F,new Set),()=>{o.current.delete(F),i.current.delete(F)}),filter:()=>s.current.shouldFilter,label:l||t["aria-label"],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:x,inputId:S,labelId:b,listInnerRef:w}),[]);function M(F,Y){var q,ee;let te=(ee=(q=s.current)==null?void 0:q.filter)!=null?ee:nJ;return F?te(F,n.current.search,Y):0}function C(){if(!n.current.search||s.current.shouldFilter===!1)return;let F=n.current.filtered.items,Y=[];n.current.filtered.groups.forEach(ee=>{let te=i.current.get(ee),Q=0;te.forEach(ce=>{let ae=F.get(ce);Q=Math.max(ae,Q)}),Y.push([ee,Q])});let q=w.current;U().sort((ee,te)=>{var Q,ce;let ae=ee.getAttribute("id"),fe=te.getAttribute("id");return((Q=F.get(fe))!=null?Q:0)-((ce=F.get(ae))!=null?ce:0)}).forEach(ee=>{let te=ee.closest(V_);te?te.appendChild(ee.parentElement===te?ee:ee.closest(`${V_} > *`)):q.appendChild(ee.parentElement===q?ee:ee.closest(`${V_} > *`))}),Y.sort((ee,te)=>te[1]-ee[1]).forEach(ee=>{var te;let Q=(te=w.current)==null?void 0:te.querySelector(`${eh}[${Mu}="${encodeURIComponent(ee[0])}"]`);Q==null||Q.parentElement.appendChild(Q)})}function P(){let F=U().find(q=>q.getAttribute("aria-disabled")!=="true"),Y=F==null?void 0:F.getAttribute(Mu);T.setState("value",Y||void 0)}function R(){var F,Y,q,ee;if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let te=0;for(let Q of r.current){let ce=(Y=(F=o.current.get(Q))==null?void 0:F.value)!=null?Y:"",ae=(ee=(q=o.current.get(Q))==null?void 0:q.keywords)!=null?ee:[],fe=M(ce,ae);n.current.filtered.items.set(Q,fe),fe>0&&te++}for(let[Q,ce]of i.current)for(let ae of ce)if(n.current.filtered.items.get(ae)>0){n.current.filtered.groups.add(Q);break}n.current.filtered.count=te}function D(){var F,Y,q;let ee=k();ee&&(((F=ee.parentElement)==null?void 0:F.firstChild)===ee&&((q=(Y=ee.closest(eh))==null?void 0:Y.querySelector(tJ))==null||q.scrollIntoView({block:"nearest"})),ee.scrollIntoView({block:"nearest"}))}function k(){var F;return(F=w.current)==null?void 0:F.querySelector(`${dB}[aria-selected="true"]`)}function U(){var F;return Array.from(((F=w.current)==null?void 0:F.querySelectorAll(AN))||[])}function O(F){let Y=U()[F];Y&&T.setState("value",Y.getAttribute(Mu))}function W(F){var Y;let q=k(),ee=U(),te=ee.findIndex(ce=>ce===q),Q=ee[te+F];(Y=s.current)!=null&&Y.loop&&(Q=te+F<0?ee[ee.length-1]:te+F===ee.length?ee[0]:ee[te+F]),Q&&T.setState("value",Q.getAttribute(Mu))}function L(F){let Y=k(),q=Y==null?void 0:Y.closest(eh),ee;for(;q&&!ee;)q=F>0?dJ(q,eh):fJ(q,eh),ee=q==null?void 0:q.querySelector(AN);ee?T.setState("value",ee.getAttribute(Mu)):W(F)}let j=()=>O(U().length-1),X=F=>{F.preventDefault(),F.metaKey?j():F.altKey?L(1):W(1)},K=F=>{F.preventDefault(),F.metaKey?O(0):F.altKey?L(-1):W(-1)};return _.createElement(nt.div,{ref:e,tabIndex:-1,...m,"cmdk-root":"",onKeyDown:F=>{var Y;(Y=m.onKeyDown)==null||Y.call(m,F);let q=F.nativeEvent.isComposing||F.keyCode===229;if(!(F.defaultPrevented||q))switch(F.key){case"n":case"j":{g&&F.ctrlKey&&X(F);break}case"ArrowDown":{X(F);break}case"p":case"k":{g&&F.ctrlKey&&K(F);break}case"ArrowUp":{K(F);break}case"Home":{F.preventDefault(),O(0);break}case"End":{F.preventDefault(),j();break}case"Enter":{F.preventDefault();let ee=k();if(ee){let te=new Event(wE);ee.dispatchEvent(te)}}}}},_.createElement("label",{"cmdk-label":"",htmlFor:A.inputId,id:A.labelId,style:mJ},l),Tx(t,F=>_.createElement(hB.Provider,{value:T},_.createElement(fB.Provider,{value:A},F))))}),rJ=_.forwardRef((t,e)=>{var n,r;let i=sr(),o=_.useRef(null),a=_.useContext(pB),s=Nm(),l=gB(t),c=(r=(n=l.current)==null?void 0:n.forceMount)!=null?r:a==null?void 0:a.forceMount;Cc(()=>{if(!c)return s.item(i,a==null?void 0:a.id)},[c]);let u=vB(i,o,[t.value,t.children,o],t.keywords),d=PA(),f=fl(E=>E.value&&E.value===u.current),p=fl(E=>c||s.filter()===!1?!0:E.search?E.filtered.items.get(i)>0:!0);_.useEffect(()=>{let E=o.current;if(!(!E||t.disabled))return E.addEventListener(wE,y),()=>E.removeEventListener(wE,y)},[p,t.onSelect,t.disabled]);function y(){var E,T;v(),(T=(E=l.current).onSelect)==null||T.call(E,u.current)}function v(){d.setState("value",u.current,!0)}if(!p)return null;let{disabled:g,value:m,onSelect:x,forceMount:b,keywords:S,...w}=t;return _.createElement(nt.div,{ref:is(o,e),...w,id:i,"cmdk-item":"",role:"option","aria-disabled":!!g,"aria-selected":!!f,"data-disabled":!!g,"data-selected":!!f,onPointerMove:g||s.getDisablePointerSelection()?void 0:v,onClick:g?void 0:y},t.children)}),iJ=_.forwardRef((t,e)=>{let{heading:n,children:r,forceMount:i,...o}=t,a=sr(),s=_.useRef(null),l=_.useRef(null),c=sr(),u=Nm(),d=fl(p=>i||u.filter()===!1?!0:p.search?p.filtered.groups.has(a):!0);Cc(()=>u.group(a),[]),vB(a,s,[t.value,t.heading,l]);let f=_.useMemo(()=>({id:a,forceMount:i}),[i]);return _.createElement(nt.div,{ref:is(s,e),...o,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},n&&_.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:c},n),Tx(t,p=>_.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?c:void 0},_.createElement(pB.Provider,{value:f},p))))}),oJ=_.forwardRef((t,e)=>{let{alwaysRender:n,...r}=t,i=_.useRef(null),o=fl(a=>!a.search);return!n&&!o?null:_.createElement(nt.div,{ref:is(i,e),...r,"cmdk-separator":"",role:"separator"})}),aJ=_.forwardRef((t,e)=>{let{onValueChange:n,...r}=t,i=t.value!=null,o=PA(),a=fl(c=>c.search),s=fl(c=>c.selectedItemId),l=Nm();return _.useEffect(()=>{t.value!=null&&o.setState("search",t.value)},[t.value]),_.createElement(nt.input,{ref:e,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":s,id:l.inputId,type:"text",value:i?t.value:a,onChange:c=>{i||o.setState("search",c.target.value),n==null||n(c.target.value)}})}),sJ=_.forwardRef((t,e)=>{let{children:n,label:r="Suggestions",...i}=t,o=_.useRef(null),a=_.useRef(null),s=fl(c=>c.selectedItemId),l=Nm();return _.useEffect(()=>{if(a.current&&o.current){let c=a.current,u=o.current,d,f=new ResizeObserver(()=>{d=requestAnimationFrame(()=>{let p=c.offsetHeight;u.style.setProperty("--cmdk-list-height",p.toFixed(1)+"px")})});return f.observe(c),()=>{cancelAnimationFrame(d),f.unobserve(c)}}},[]),_.createElement(nt.div,{ref:is(o,e),...i,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:l.listId},Tx(t,c=>_.createElement("div",{ref:is(a,l.listInnerRef),"cmdk-list-sizer":""},c)))}),lJ=_.forwardRef((t,e)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:o,container:a,...s}=t;return _.createElement(fA,{open:n,onOpenChange:r},_.createElement(hA,{container:a},_.createElement(dx,{"cmdk-overlay":"",className:i}),_.createElement(fx,{"aria-label":t.label,"cmdk-dialog":"",className:o},_.createElement(mB,{ref:e,...s}))))}),cJ=_.forwardRef((t,e)=>fl(n=>n.filtered.count===0)?_.createElement(nt.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),uJ=_.forwardRef((t,e)=>{let{progress:n,children:r,label:i="Loading...",...o}=t;return _.createElement(nt.div,{ref:e,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},Tx(t,a=>_.createElement("div",{"aria-hidden":!0},a)))}),vi=Object.assign(mB,{List:sJ,Item:rJ,Input:aJ,Group:iJ,Separator:oJ,Dialog:lJ,Empty:cJ,Loading:uJ});function dJ(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function fJ(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function gB(t){let e=_.useRef(t);return Cc(()=>{e.current=t}),e}var Cc=typeof window>"u"?_.useEffect:_.useLayoutEffect;function Au(t){let e=_.useRef();return e.current===void 0&&(e.current=t()),e}function fl(t){let e=PA(),n=()=>t(e.snapshot());return _.useSyncExternalStore(e.subscribe,n,n)}function vB(t,e,n,r=[]){let i=_.useRef(),o=Nm();return Cc(()=>{var a;let s=(()=>{var c;for(let u of n){if(typeof u=="string")return u.trim();if(typeof u=="object"&&"current"in u)return u.current?(c=u.current.textContent)==null?void 0:c.trim():i.current}})(),l=r.map(c=>c.trim());o.value(t,s,l),(a=e.current)==null||a.setAttribute(Mu,s),i.current=s}),i}var hJ=()=>{let[t,e]=_.useState(),n=Au(()=>new Map);return Cc(()=>{n.current.forEach(r=>r()),n.current=new Map},[t]),(r,i)=>{n.current.set(r,i),e({})}};function pJ(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function Tx({asChild:t,children:e},n){return t&&_.isValidElement(e)?_.cloneElement(pJ(e),{ref:e.ref},n(e.props.children)):n(e)}var mJ={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Mx=_.forwardRef(({className:t,...e},n)=>h.jsx(vi,{ref:n,className:He("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...e}));Mx.displayName=vi.displayName;const Ax=_.forwardRef(({className:t,...e},n)=>h.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[h.jsx(oA,{className:"mr-2 h-4 w-4 shrink-0 text-slate-400"}),h.jsx(vi.Input,{ref:n,className:He("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",t),...e})]}));Ax.displayName=vi.Input.displayName;const Cx=_.forwardRef(({className:t,...e},n)=>h.jsx(vi.List,{ref:n,className:He("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...e}));Cx.displayName=vi.List.displayName;const Px=_.forwardRef((t,e)=>h.jsx(vi.Empty,{ref:e,className:"py-6 text-center text-sm",...t}));Px.displayName=vi.Empty.displayName;const Qs=_.forwardRef(({className:t,...e},n)=>h.jsx(vi.Group,{ref:n,className:He("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",t),...e}));Qs.displayName=vi.Group.displayName;const gJ=_.forwardRef(({className:t,...e},n)=>h.jsx(vi.Separator,{ref:n,className:He("-mx-1 h-px bg-border",t),...e}));gJ.displayName=vi.Separator.displayName;const kd=_.forwardRef(({className:t,...e},n)=>h.jsx(vi.Item,{ref:n,className:He("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",t),...e}));kd.displayName=vi.Item.displayName;const vJ=({selectedName:t,availableNames:e,onSelect:n,onCreateNew:r,isLoading:i})=>{const[o,a]=_.useState(!1),[s,l]=_.useState(""),c=s.trim(),u=e.some(m=>m.toLowerCase()===c.toLowerCase()),d=c.length>0&&!u,f=!d,p=u?"Already exists":c===""?"Create new robotโ€ฆ":`Create "${c}"`,y=()=>{l(""),a(!1)},v=m=>{n(m),y()},g=async()=>{if(!d)return;await r(c)&&y()};return h.jsxs(Sx,{open:o,onOpenChange:a,children:[h.jsx(Ex,{asChild:!0,children:h.jsxs(et,{variant:"outline",role:"combobox","aria-expanded":o,disabled:i,className:"w-full justify-between bg-gray-900 border-gray-700 text-white hover:bg-gray-700 hover:text-white font-normal",children:[h.jsx("span",{className:He("truncate",t?"":"text-gray-400"),children:i?"Loading...":t??"Select a robot or type a new name"}),h.jsx(tA,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),h.jsx(Rm,{className:"p-0 bg-gray-800 border-gray-700 text-white",style:{width:"var(--radix-popover-trigger-width)"},align:"start",children:h.jsxs(Mx,{className:"bg-gray-800",children:[h.jsx(Ax,{placeholder:"Search or type new name...",value:s,onValueChange:l,onKeyDown:m=>{m.key==="Enter"&&d&&(m.preventDefault(),g())},className:"text-white"}),h.jsxs(Cx,{children:[e.length===0&&h.jsx(Px,{className:"py-4 text-sm text-gray-400 text-center",children:"No robots yet. Type a name to create one."}),e.length>0&&h.jsx(Qs,{heading:"Existing",children:e.map(m=>h.jsxs(kd,{value:m,onSelect:()=>v(m),className:"text-white aria-selected:bg-gray-700",children:[h.jsx(xl,{className:He("mr-2 h-4 w-4",t===m?"opacity-100":"opacity-0")}),m]},m))})]}),h.jsxs("button",{type:"button",onClick:g,disabled:f,className:"flex w-full items-center gap-2 border-t border-gray-700 px-3 py-2 text-sm text-white hover:bg-gray-700 disabled:cursor-not-allowed disabled:text-gray-500 disabled:hover:bg-transparent",children:[h.jsx(iA,{className:"h-4 w-4"}),p]})]})})]})},yJ=({robot:t,selectedName:e,availableNames:n,isLoading:r,onSelect:i,onCreateNew:o,onConfigure:a,onTeleop:s,onDelete:l})=>{const[c,u]=_.useState(!1),d=t?t.is_clean?"Ready":"Needs configuration":null,f=!t||!t.is_clean;return h.jsxs("div",{className:"bg-gray-800 rounded-lg border border-gray-700 p-3 flex flex-col gap-2 relative",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("div",{className:"flex-1 min-w-0",children:h.jsx(vJ,{selectedName:e,availableNames:n,onSelect:i,onCreateNew:o,isLoading:r})}),d&&h.jsx("p",{className:`text-xs truncate shrink-0 ${t.is_clean?"text-green-400":"text-amber-400"}`,children:d}),t&&h.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[h.jsxs(Fv,{children:[h.jsx(Bv,{asChild:!0,children:h.jsx(et,{size:"icon",variant:"ghost",className:"h-8 w-8 text-gray-300 hover:text-white",onClick:()=>a(t.name),"aria-label":"Configure",children:h.jsx(Mh,{className:"w-4 h-4"})})}),h.jsx(Gh,{children:"Configure (calibrate)"})]}),h.jsxs(Fv,{children:[h.jsx(Bv,{asChild:!0,children:h.jsx(et,{size:"icon",variant:"ghost",className:"h-8 w-8 text-red-400 hover:text-red-300 hover:bg-red-900/20",onClick:()=>u(!0),"aria-label":"Delete robot",children:h.jsx(aA,{className:"w-4 h-4"})})}),h.jsx(Gh,{children:"Delete robot config"})]})]})]}),t&&h.jsxs(Fv,{children:[h.jsx(Bv,{asChild:!0,children:h.jsx("div",{className:"w-full",children:h.jsx(et,{onClick:()=>s(t),disabled:f,className:`w-full ${f?"bg-red-500/30 hover:bg-red-500/30 text-red-200 cursor-not-allowed":"bg-yellow-500 hover:bg-yellow-600 text-white"}`,children:"Teleoperation"})})}),f&&h.jsx(Gh,{children:"Configure the robot first."})]}),t&&h.jsx(Hc,{open:c,onOpenChange:u,children:h.jsxs(bl,{className:"bg-gray-900 border-gray-800 text-white",children:[h.jsxs(_l,{children:[h.jsx(wl,{children:"Delete robot config?"}),h.jsx(Sl,{className:"text-gray-400",children:"This deletes the robot config file from disk. Calibration files are not removed. This cannot be undone."})]}),h.jsxs(EF,{className:"flex gap-2 justify-end",children:[h.jsx(et,{variant:"outline",className:"border-gray-600 text-gray-300",onClick:()=>u(!1),children:"Cancel"}),h.jsx(et,{className:"bg-red-500 hover:bg-red-600 text-white",onClick:async()=>{u(!1),await l(t.name)},children:"Delete"})]})]})})]})},xJ=({selectedName:t,selectedRecord:e,availableNames:n,isLoading:r,selectRobot:i,createRobot:o,deleteRobot:a})=>{const s=ji(),{baseUrl:l,fetchWithHeaders:c}=Dn(),{toast:u}=Dr(),d=p=>{s("/calibration",{state:{robot_name:p}})},f=async p=>{try{const y=await c(`${l}/move-arm`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({leader_port:p.leader_port,follower_port:p.follower_port,leader_config:p.leader_config,follower_config:p.follower_config})}),v=await y.json();y.ok?(u({title:"Teleoperation Started",description:v.message||`Started teleoperation for ${p.name}.`}),s("/teleoperation")):u({title:"Error Starting Teleoperation",description:v.message||"Failed to start.",variant:"destructive"})}catch{u({title:"Connection Error",description:"Could not connect to the backend server.",variant:"destructive"})}};return h.jsx(yJ,{robot:e,selectedName:t,availableNames:n,isLoading:r,onSelect:i,onCreateNew:o,onConfigure:d,onTeleop:f,onDelete:a})},hi=_.forwardRef(({className:t,type:e,...n},r)=>h.jsx("input",{type:e,className:He("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:r,...n}));hi.displayName="Input";const mr=_.forwardRef(({value:t,onChange:e,integer:n=!0,className:r,...i},o)=>{const[a,s]=_.useState(t==null?"":String(t)),l=_.useRef(t);return _.useEffect(()=>{t!==l.current&&(l.current=t,s(t==null?"":String(t)))},[t]),h.jsx(hi,{ref:o,type:"number",inputMode:n?"numeric":"decimal",value:a,onChange:c=>{const u=c.target.value;if(s(u),u===""){e(void 0);return}const d=n?parseInt(u,10):parseFloat(u);Number.isFinite(d)&&e(d)},className:He("[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:m-0 [&::-webkit-outer-spin-button]:m-0",r),...i})});mr.displayName="NumberInput";var bJ="Label",yB=_.forwardRef((t,e)=>h.jsx(nt.label,{...t,ref:e,onMouseDown:n=>{var i;n.target.closest("button, input, select, textarea")||((i=t.onMouseDown)==null||i.call(t,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));yB.displayName=bJ;var xB=yB;const _J=Em("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Tt=_.forwardRef(({className:t,...e},n)=>h.jsx(xB,{ref:n,className:He(_J(),t),...e}));Tt.displayName=xB.displayName;function RA(t){const e=_.useRef({value:t,previous:t});return _.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var Rx="Checkbox",[wJ,EDe]=mi(Rx),[SJ,NA]=wJ(Rx);function EJ(t){const{__scopeCheckbox:e,checked:n,children:r,defaultChecked:i,disabled:o,form:a,name:s,onCheckedChange:l,required:c,value:u="on",internal_do_not_use_render:d}=t,[f,p]=$o({prop:n,defaultProp:i??!1,onChange:l,caller:Rx}),[y,v]=_.useState(null),[g,m]=_.useState(null),x=_.useRef(!1),b=y?!!a||!!y.closest("form"):!0,S={checked:f,disabled:o,setChecked:p,control:y,setControl:v,name:s,form:a,value:u,hasConsumerStoppedPropagationRef:x,required:c,defaultChecked:el(i)?!1:i,isFormControl:b,bubbleInput:g,setBubbleInput:m};return h.jsx(SJ,{scope:e,...S,children:TJ(d)?d(S):r})}var bB="CheckboxTrigger",_B=_.forwardRef(({__scopeCheckbox:t,onKeyDown:e,onClick:n,...r},i)=>{const{control:o,value:a,disabled:s,checked:l,required:c,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,isFormControl:p,bubbleInput:y}=NA(bB,t),v=Ot(i,u),g=_.useRef(l);return _.useEffect(()=>{const m=o==null?void 0:o.form;if(m){const x=()=>d(g.current);return m.addEventListener("reset",x),()=>m.removeEventListener("reset",x)}},[o,d]),h.jsx(nt.button,{type:"button",role:"checkbox","aria-checked":el(l)?"mixed":l,"aria-required":c,"data-state":MB(l),"data-disabled":s?"":void 0,disabled:s,value:a,...r,ref:v,onKeyDown:Oe(e,m=>{m.key==="Enter"&&m.preventDefault()}),onClick:Oe(n,m=>{d(x=>el(x)?!0:!x),y&&p&&(f.current=m.isPropagationStopped(),f.current||m.stopPropagation())})})});_B.displayName=bB;var OA=_.forwardRef((t,e)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:o,required:a,disabled:s,value:l,onCheckedChange:c,form:u,...d}=t;return h.jsx(EJ,{__scopeCheckbox:n,checked:i,defaultChecked:o,disabled:s,required:a,onCheckedChange:c,name:r,form:u,value:l,internal_do_not_use_render:({isFormControl:f})=>h.jsxs(h.Fragment,{children:[h.jsx(_B,{...d,ref:e,__scopeCheckbox:n}),f&&h.jsx(TB,{__scopeCheckbox:n})]})})});OA.displayName=Rx;var wB="CheckboxIndicator",SB=_.forwardRef((t,e)=>{const{__scopeCheckbox:n,forceMount:r,...i}=t,o=NA(wB,n);return h.jsx(gi,{present:r||el(o.checked)||o.checked===!0,children:h.jsx(nt.span,{"data-state":MB(o.checked),"data-disabled":o.disabled?"":void 0,...i,ref:e,style:{pointerEvents:"none",...t.style}})})});SB.displayName=wB;var EB="CheckboxBubbleInput",TB=_.forwardRef(({__scopeCheckbox:t,...e},n)=>{const{control:r,hasConsumerStoppedPropagationRef:i,checked:o,defaultChecked:a,required:s,disabled:l,name:c,value:u,form:d,bubbleInput:f,setBubbleInput:p}=NA(EB,t),y=Ot(n,p),v=RA(o),g=EA(r);_.useEffect(()=>{const x=f;if(!x)return;const b=window.HTMLInputElement.prototype,w=Object.getOwnPropertyDescriptor(b,"checked").set,E=!i.current;if(v!==o&&w){const T=new Event("click",{bubbles:E});x.indeterminate=el(o),w.call(x,el(o)?!1:o),x.dispatchEvent(T)}},[f,v,o,i]);const m=_.useRef(el(o)?!1:o);return h.jsx(nt.input,{type:"checkbox","aria-hidden":!0,defaultChecked:a??m.current,required:s,disabled:l,name:c,value:u,form:d,...e,tabIndex:-1,ref:y,style:{...e.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});TB.displayName=EB;function TJ(t){return typeof t=="function"}function el(t){return t==="indeterminate"}function MB(t){return el(t)?"indeterminate":t?"checked":"unchecked"}const IA=_.forwardRef(({className:t,...e},n)=>h.jsx(OA,{ref:n,className:He("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",t),...e,children:h.jsx(SB,{className:He("flex items-center justify-center text-current"),children:h.jsx(xl,{className:"h-4 w-4"})})}));IA.displayName=OA.displayName;var Nx="Collapsible",[MJ,TDe]=mi(Nx),[AJ,DA]=MJ(Nx),AB=_.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:a,...s}=t,[l,c]=$o({prop:r,defaultProp:i??!1,onChange:a,caller:Nx});return h.jsx(AJ,{scope:n,disabled:o,contentId:sr(),open:l,onOpenToggle:_.useCallback(()=>c(u=>!u),[c]),children:h.jsx(nt.div,{"data-state":kA(l),"data-disabled":o?"":void 0,...s,ref:e})})});AB.displayName=Nx;var CB="CollapsibleTrigger",PB=_.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,i=DA(CB,n);return h.jsx(nt.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":kA(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:e,onClick:Oe(t.onClick,i.onOpenToggle)})});PB.displayName=CB;var LA="CollapsibleContent",RB=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=DA(LA,t.__scopeCollapsible);return h.jsx(gi,{present:n||i.open,children:({present:o})=>h.jsx(CJ,{...r,ref:e,present:o})})});RB.displayName=LA;var CJ=_.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=t,a=DA(LA,n),[s,l]=_.useState(r),c=_.useRef(null),u=Ot(e,c),d=_.useRef(0),f=d.current,p=_.useRef(0),y=p.current,v=a.open||s,g=_.useRef(v),m=_.useRef(void 0);return _.useEffect(()=>{const x=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(x)},[]),ur(()=>{const x=c.current;if(x){m.current=m.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";const b=x.getBoundingClientRect();d.current=b.height,p.current=b.width,g.current||(x.style.transitionDuration=m.current.transitionDuration,x.style.animationName=m.current.animationName),l(r)}},[a.open,r]),h.jsx(nt.div,{"data-state":kA(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!v,...o,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":y?`${y}px`:void 0,...t.style},children:v&&i})});function kA(t){return t?"open":"closed"}var PJ=AB;const Ty=PJ,My=PB,Ay=RB,RJ=Em("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Mi=_.forwardRef(({className:t,variant:e,...n},r)=>h.jsx("div",{ref:r,role:"alert",className:He(RJ({variant:e}),t),...n}));Mi.displayName="Alert";const NJ=_.forwardRef(({className:t,...e},n)=>h.jsx("h5",{ref:n,className:He("mb-1 font-medium leading-none tracking-tight",t),...e}));NJ.displayName="AlertTitle";const Ai=_.forwardRef(({className:t,...e},n)=>h.jsx("div",{ref:n,className:He("text-sm [&_p]:leading-relaxed",t),...e}));Ai.displayName="AlertDescription";function CN(t,[e,n]){return Math.min(n,Math.max(e,t))}var OJ=_.createContext(void 0);function jA(t){const e=_.useContext(OJ);return t||e||"ltr"}var IJ=[" ","Enter","ArrowUp","ArrowDown"],DJ=[" ","Enter"],Pc="Select",[Ox,Ix,LJ]=rx(Pc),[wf,MDe]=mi(Pc,[LJ,El]),Dx=El(),[kJ,Ml]=wf(Pc),[jJ,UJ]=wf(Pc),NB=t=>{const{__scopeSelect:e,children:n,open:r,defaultOpen:i,onOpenChange:o,value:a,defaultValue:s,onValueChange:l,dir:c,name:u,autoComplete:d,disabled:f,required:p,form:y}=t,v=Dx(e),[g,m]=_.useState(null),[x,b]=_.useState(null),[S,w]=_.useState(!1),E=jA(c),[T,A]=$o({prop:r,defaultProp:i??!1,onChange:o,caller:Pc}),[M,C]=$o({prop:a,defaultProp:s,onChange:l,caller:Pc}),P=_.useRef(null),R=g?y||!!g.closest("form"):!0,[D,k]=_.useState(new Set),U=Array.from(D).map(O=>O.props.value).join(";");return h.jsx(gx,{...v,children:h.jsxs(kJ,{required:p,scope:e,trigger:g,onTriggerChange:m,valueNode:x,onValueNodeChange:b,valueNodeHasChildren:S,onValueNodeHasChildrenChange:w,contentId:sr(),value:M,onValueChange:C,open:T,onOpenChange:A,dir:E,triggerPointerDownPosRef:P,disabled:f,children:[h.jsx(Ox.Provider,{scope:e,children:h.jsx(jJ,{scope:t.__scopeSelect,onNativeOptionAdd:_.useCallback(O=>{k(W=>new Set(W).add(O))},[]),onNativeOptionRemove:_.useCallback(O=>{k(W=>{const L=new Set(W);return L.delete(O),L})},[]),children:n})}),R?h.jsxs(t4,{"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:d,value:M,onChange:O=>C(O.target.value),disabled:f,form:y,children:[M===void 0?h.jsx("option",{value:""}):null,Array.from(D)]},U):null]})})};NB.displayName=Pc;var OB="SelectTrigger",IB=_.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:r=!1,...i}=t,o=Dx(n),a=Ml(OB,n),s=a.disabled||r,l=Ot(e,a.onTriggerChange),c=Ix(n),u=_.useRef("touch"),[d,f,p]=r4(v=>{const g=c().filter(b=>!b.disabled),m=g.find(b=>b.value===a.value),x=i4(g,v,m);x!==void 0&&a.onValueChange(x.value)}),y=v=>{s||(a.onOpenChange(!0),p()),v&&(a.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})};return h.jsx(Cm,{asChild:!0,...o,children:h.jsx(nt.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":n4(a.value)?"":void 0,...i,ref:l,onClick:Oe(i.onClick,v=>{v.currentTarget.focus(),u.current!=="mouse"&&y(v)}),onPointerDown:Oe(i.onPointerDown,v=>{u.current=v.pointerType;const g=v.target;g.hasPointerCapture(v.pointerId)&&g.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(y(v),v.preventDefault())}),onKeyDown:Oe(i.onKeyDown,v=>{const g=d.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&f(v.key),!(g&&v.key===" ")&&IJ.includes(v.key)&&(y(),v.preventDefault())})})})});IB.displayName=OB;var DB="SelectValue",LB=_.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:a="",...s}=t,l=Ml(DB,n),{onValueNodeHasChildrenChange:c}=l,u=o!==void 0,d=Ot(e,l.onValueNodeChange);return ur(()=>{c(u)},[c,u]),h.jsx(nt.span,{...s,ref:d,style:{pointerEvents:"none"},children:n4(l.value)?h.jsx(h.Fragment,{children:a}):o})});LB.displayName=DB;var FJ="SelectIcon",kB=_.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,...i}=t;return h.jsx(nt.span,{"aria-hidden":!0,...i,ref:e,children:r||"โ–ผ"})});kB.displayName=FJ;var BJ="SelectPortal",jB=t=>h.jsx(vf,{asChild:!0,...t});jB.displayName=BJ;var Rc="SelectContent",UB=_.forwardRef((t,e)=>{const n=Ml(Rc,t.__scopeSelect),[r,i]=_.useState();if(ur(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?Bc.createPortal(h.jsx(FB,{scope:t.__scopeSelect,children:h.jsx(Ox.Slot,{scope:t.__scopeSelect,children:h.jsx("div",{children:t.children})})}),o):null}return h.jsx(BB,{...t,ref:e})});UB.displayName=Rc;var vo=10,[FB,Al]=wf(Rc),$J="SelectContentImpl",zJ=sl("SelectContent.RemoveScroll"),BB=_.forwardRef((t,e)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:a,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:y,hideWhenDetached:v,avoidCollisions:g,...m}=t,x=Ml(Rc,n),[b,S]=_.useState(null),[w,E]=_.useState(null),T=Ot(e,Q=>S(Q)),[A,M]=_.useState(null),[C,P]=_.useState(null),R=Ix(n),[D,k]=_.useState(!1),U=_.useRef(!1);_.useEffect(()=>{if(b)return cx(b)},[b]),sx();const O=_.useCallback(Q=>{const[ce,...ae]=R().map(le=>le.ref.current),[fe]=ae.slice(-1),we=document.activeElement;for(const le of Q)if(le===we||(le==null||le.scrollIntoView({block:"nearest"}),le===ce&&w&&(w.scrollTop=0),le===fe&&w&&(w.scrollTop=w.scrollHeight),le==null||le.focus(),document.activeElement!==we))return},[R,w]),W=_.useCallback(()=>O([A,b]),[O,A,b]);_.useEffect(()=>{D&&W()},[D,W]);const{onOpenChange:L,triggerPointerDownPosRef:j}=x;_.useEffect(()=>{if(b){let Q={x:0,y:0};const ce=fe=>{var we,le;Q={x:Math.abs(Math.round(fe.pageX)-(((we=j.current)==null?void 0:we.x)??0)),y:Math.abs(Math.round(fe.pageY)-(((le=j.current)==null?void 0:le.y)??0))}},ae=fe=>{Q.x<=10&&Q.y<=10?fe.preventDefault():b.contains(fe.target)||L(!1),document.removeEventListener("pointermove",ce),j.current=null};return j.current!==null&&(document.addEventListener("pointermove",ce),document.addEventListener("pointerup",ae,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ce),document.removeEventListener("pointerup",ae,{capture:!0})}}},[b,L,j]),_.useEffect(()=>{const Q=()=>L(!1);return window.addEventListener("blur",Q),window.addEventListener("resize",Q),()=>{window.removeEventListener("blur",Q),window.removeEventListener("resize",Q)}},[L]);const[X,K]=r4(Q=>{const ce=R().filter(we=>!we.disabled),ae=ce.find(we=>we.ref.current===document.activeElement),fe=i4(ce,Q,ae);fe&&setTimeout(()=>fe.ref.current.focus())}),F=_.useCallback((Q,ce,ae)=>{const fe=!U.current&&!ae;(x.value!==void 0&&x.value===ce||fe)&&(M(Q),fe&&(U.current=!0))},[x.value]),Y=_.useCallback(()=>b==null?void 0:b.focus(),[b]),q=_.useCallback((Q,ce,ae)=>{const fe=!U.current&&!ae;(x.value!==void 0&&x.value===ce||fe)&&P(Q)},[x.value]),ee=r==="popper"?SE:$B,te=ee===SE?{side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:y,hideWhenDetached:v,avoidCollisions:g}:{};return h.jsx(FB,{scope:n,content:b,viewport:w,onViewportChange:E,itemRefCallback:F,selectedItem:A,onItemLeave:Y,itemTextRefCallback:q,focusSelectedItem:W,selectedItemText:C,position:r,isPositioned:D,searchRef:X,children:h.jsx(Mm,{as:zJ,allowPinchZoom:!0,children:h.jsx(Tm,{asChild:!0,trapped:x.open,onMountAutoFocus:Q=>{Q.preventDefault()},onUnmountAutoFocus:Oe(i,Q=>{var ce;(ce=x.trigger)==null||ce.focus({preventScroll:!0}),Q.preventDefault()}),children:h.jsx(zc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:Q=>Q.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:h.jsx(ee,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:Q=>Q.preventDefault(),...m,...te,onPlaced:()=>k(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...m.style},onKeyDown:Oe(m.onKeyDown,Q=>{const ce=Q.ctrlKey||Q.altKey||Q.metaKey;if(Q.key==="Tab"&&Q.preventDefault(),!ce&&Q.key.length===1&&K(Q.key),["ArrowUp","ArrowDown","Home","End"].includes(Q.key)){let fe=R().filter(we=>!we.disabled).map(we=>we.ref.current);if(["ArrowUp","End"].includes(Q.key)&&(fe=fe.slice().reverse()),["ArrowUp","ArrowDown"].includes(Q.key)){const we=Q.target,le=fe.indexOf(we);fe=fe.slice(le+1)}setTimeout(()=>O(fe)),Q.preventDefault()}})})})})})})});BB.displayName=$J;var HJ="SelectItemAlignedPosition",$B=_.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:r,...i}=t,o=Ml(Rc,n),a=Al(Rc,n),[s,l]=_.useState(null),[c,u]=_.useState(null),d=Ot(e,T=>u(T)),f=Ix(n),p=_.useRef(!1),y=_.useRef(!0),{viewport:v,selectedItem:g,selectedItemText:m,focusSelectedItem:x}=a,b=_.useCallback(()=>{if(o.trigger&&o.valueNode&&s&&c&&v&&g&&m){const T=o.trigger.getBoundingClientRect(),A=c.getBoundingClientRect(),M=o.valueNode.getBoundingClientRect(),C=m.getBoundingClientRect();if(o.dir!=="rtl"){const we=C.left-A.left,le=M.left-we,ie=T.left-le,G=T.width+ie,Ve=Math.max(G,A.width),Ne=window.innerWidth-vo,st=CN(le,[vo,Math.max(vo,Ne-Ve)]);s.style.minWidth=G+"px",s.style.left=st+"px"}else{const we=A.right-C.right,le=window.innerWidth-M.right-we,ie=window.innerWidth-T.right-le,G=T.width+ie,Ve=Math.max(G,A.width),Ne=window.innerWidth-vo,st=CN(le,[vo,Math.max(vo,Ne-Ve)]);s.style.minWidth=G+"px",s.style.right=st+"px"}const P=f(),R=window.innerHeight-vo*2,D=v.scrollHeight,k=window.getComputedStyle(c),U=parseInt(k.borderTopWidth,10),O=parseInt(k.paddingTop,10),W=parseInt(k.borderBottomWidth,10),L=parseInt(k.paddingBottom,10),j=U+O+D+L+W,X=Math.min(g.offsetHeight*5,j),K=window.getComputedStyle(v),F=parseInt(K.paddingTop,10),Y=parseInt(K.paddingBottom,10),q=T.top+T.height/2-vo,ee=R-q,te=g.offsetHeight/2,Q=g.offsetTop+te,ce=U+O+Q,ae=j-ce;if(ce<=q){const we=P.length>0&&g===P[P.length-1].ref.current;s.style.bottom="0px";const le=c.clientHeight-v.offsetTop-v.offsetHeight,ie=Math.max(ee,te+(we?Y:0)+le+W),G=ce+ie;s.style.height=G+"px"}else{const we=P.length>0&&g===P[0].ref.current;s.style.top="0px";const ie=Math.max(q,U+v.offsetTop+(we?F:0)+te)+ae;s.style.height=ie+"px",v.scrollTop=ce-q+v.offsetTop}s.style.margin=`${vo}px 0`,s.style.minHeight=X+"px",s.style.maxHeight=R+"px",r==null||r(),requestAnimationFrame(()=>p.current=!0)}},[f,o.trigger,o.valueNode,s,c,v,g,m,o.dir,r]);ur(()=>b(),[b]);const[S,w]=_.useState();ur(()=>{c&&w(window.getComputedStyle(c).zIndex)},[c]);const E=_.useCallback(T=>{T&&y.current===!0&&(b(),x==null||x(),y.current=!1)},[b,x]);return h.jsx(GJ,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:E,children:h.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:h.jsx(nt.div,{...i,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});$B.displayName=HJ;var VJ="SelectPopperPosition",SE=_.forwardRef((t,e)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=vo,...o}=t,a=Dx(n);return h.jsx(vx,{...a,...o,ref:e,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});SE.displayName=VJ;var[GJ,UA]=wf(Rc,{}),EE="SelectViewport",zB=_.forwardRef((t,e)=>{const{__scopeSelect:n,nonce:r,...i}=t,o=Al(EE,n),a=UA(EE,n),s=Ot(e,o.onViewportChange),l=_.useRef(0);return h.jsxs(h.Fragment,{children:[h.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),h.jsx(Ox.Slot,{scope:n,children:h.jsx(nt.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Oe(i.onScroll,c=>{const u=c.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:f}=a;if(f!=null&&f.current&&d){const p=Math.abs(l.current-u.scrollTop);if(p>0){const y=window.innerHeight-vo*2,v=parseFloat(d.style.minHeight),g=parseFloat(d.style.height),m=Math.max(v,g);if(m0?S:0,d.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});zB.displayName=EE;var HB="SelectGroup",[WJ,XJ]=wf(HB),qJ=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=sr();return h.jsx(WJ,{scope:n,id:i,children:h.jsx(nt.div,{role:"group","aria-labelledby":i,...r,ref:e})})});qJ.displayName=HB;var VB="SelectLabel",GB=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=XJ(VB,n);return h.jsx(nt.div,{id:i.id,...r,ref:e})});GB.displayName=VB;var Cy="SelectItem",[KJ,WB]=wf(Cy),XB=_.forwardRef((t,e)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...a}=t,s=Ml(Cy,n),l=Al(Cy,n),c=s.value===r,[u,d]=_.useState(o??""),[f,p]=_.useState(!1),y=Ot(e,x=>{var b;return(b=l.itemRefCallback)==null?void 0:b.call(l,x,r,i)}),v=sr(),g=_.useRef("touch"),m=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return h.jsx(KJ,{scope:n,value:r,disabled:i,textId:v,isSelected:c,onItemTextChange:_.useCallback(x=>{d(b=>b||((x==null?void 0:x.textContent)??"").trim())},[]),children:h.jsx(Ox.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:h.jsx(nt.div,{role:"option","aria-labelledby":v,"data-highlighted":f?"":void 0,"aria-selected":c&&f,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...a,ref:y,onFocus:Oe(a.onFocus,()=>p(!0)),onBlur:Oe(a.onBlur,()=>p(!1)),onClick:Oe(a.onClick,()=>{g.current!=="mouse"&&m()}),onPointerUp:Oe(a.onPointerUp,()=>{g.current==="mouse"&&m()}),onPointerDown:Oe(a.onPointerDown,x=>{g.current=x.pointerType}),onPointerMove:Oe(a.onPointerMove,x=>{var b;g.current=x.pointerType,i?(b=l.onItemLeave)==null||b.call(l):g.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Oe(a.onPointerLeave,x=>{var b;x.currentTarget===document.activeElement&&((b=l.onItemLeave)==null||b.call(l))}),onKeyDown:Oe(a.onKeyDown,x=>{var S;((S=l.searchRef)==null?void 0:S.current)!==""&&x.key===" "||(DJ.includes(x.key)&&m(),x.key===" "&&x.preventDefault())})})})})});XB.displayName=Cy;var Ah="SelectItemText",qB=_.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:i,...o}=t,a=Ml(Ah,n),s=Al(Ah,n),l=WB(Ah,n),c=UJ(Ah,n),[u,d]=_.useState(null),f=Ot(e,m=>d(m),l.onItemTextChange,m=>{var x;return(x=s.itemTextRefCallback)==null?void 0:x.call(s,m,l.value,l.disabled)}),p=u==null?void 0:u.textContent,y=_.useMemo(()=>h.jsx("option",{value:l.value,disabled:l.disabled,children:p},l.value),[l.disabled,l.value,p]),{onNativeOptionAdd:v,onNativeOptionRemove:g}=c;return ur(()=>(v(y),()=>g(y)),[v,g,y]),h.jsxs(h.Fragment,{children:[h.jsx(nt.span,{id:l.textId,...o,ref:f}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Bc.createPortal(o.children,a.valueNode):null]})});qB.displayName=Ah;var KB="SelectItemIndicator",YB=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return WB(KB,n).isSelected?h.jsx(nt.span,{"aria-hidden":!0,...r,ref:e}):null});YB.displayName=KB;var TE="SelectScrollUpButton",JB=_.forwardRef((t,e)=>{const n=Al(TE,t.__scopeSelect),r=UA(TE,t.__scopeSelect),[i,o]=_.useState(!1),a=Ot(e,r.onScrollButtonChange);return ur(()=>{if(n.viewport&&n.isPositioned){let s=function(){const c=l.scrollTop>0;o(c)};const l=n.viewport;return s(),l.addEventListener("scroll",s),()=>l.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?h.jsx(QB,{...t,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop-l.offsetHeight)}}):null});JB.displayName=TE;var ME="SelectScrollDownButton",ZB=_.forwardRef((t,e)=>{const n=Al(ME,t.__scopeSelect),r=UA(ME,t.__scopeSelect),[i,o]=_.useState(!1),a=Ot(e,r.onScrollButtonChange);return ur(()=>{if(n.viewport&&n.isPositioned){let s=function(){const c=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)l.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?h.jsx(QB,{...t,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop+l.offsetHeight)}}):null});ZB.displayName=ME;var QB=_.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=t,o=Al("SelectScrollButton",n),a=_.useRef(null),s=Ix(n),l=_.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return _.useEffect(()=>()=>l(),[l]),ur(()=>{var u;const c=s().find(d=>d.ref.current===document.activeElement);(u=c==null?void 0:c.ref.current)==null||u.scrollIntoView({block:"nearest"})},[s]),h.jsx(nt.div,{"aria-hidden":!0,...i,ref:e,style:{flexShrink:0,...i.style},onPointerDown:Oe(i.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:Oe(i.onPointerMove,()=>{var c;(c=o.onItemLeave)==null||c.call(o),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:Oe(i.onPointerLeave,()=>{l()})})}),YJ="SelectSeparator",e4=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return h.jsx(nt.div,{"aria-hidden":!0,...r,ref:e})});e4.displayName=YJ;var AE="SelectArrow",JJ=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=Dx(n),o=Ml(AE,n),a=Al(AE,n);return o.open&&a.position==="popper"?h.jsx(yx,{...i,...r,ref:e}):null});JJ.displayName=AE;var ZJ="SelectBubbleInput",t4=_.forwardRef(({__scopeSelect:t,value:e,...n},r)=>{const i=_.useRef(null),o=Ot(r,i),a=RA(e);return _.useEffect(()=>{const s=i.current;if(!s)return;const l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==e&&u){const d=new Event("change",{bubbles:!0});u.call(s,e),s.dispatchEvent(d)}},[a,e]),h.jsx(nt.select,{...n,style:{...pU,...n.style},ref:o,defaultValue:e})});t4.displayName=ZJ;function n4(t){return t===""||t===void 0}function r4(t){const e=di(t),n=_.useRef(""),r=_.useRef(0),i=_.useCallback(a=>{const s=n.current+a;e(s),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(s)},[e]),o=_.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return _.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function i4(t,e,n){const i=e.length>1&&Array.from(e).every(c=>c===e[0])?e[0]:e,o=n?t.indexOf(n):-1;let a=QJ(t,Math.max(o,0));i.length===1&&(a=a.filter(c=>c!==n));const l=a.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function QJ(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var eZ=NB,o4=IB,tZ=LB,nZ=kB,rZ=jB,a4=UB,iZ=zB,s4=GB,l4=XB,oZ=qB,aZ=YB,c4=JB,u4=ZB,d4=e4;const Ga=eZ,Wa=tZ,sa=_.forwardRef(({className:t,children:e,...n},r)=>h.jsxs(o4,{ref:r,className:He("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...n,children:[e,h.jsx(nZ,{asChild:!0,children:h.jsx(hc,{className:"h-4 w-4 text-slate-400"})})]}));sa.displayName=o4.displayName;const f4=_.forwardRef(({className:t,...e},n)=>h.jsx(c4,{ref:n,className:He("flex cursor-default items-center justify-center py-1",t),...e,children:h.jsx(X7,{className:"h-4 w-4"})}));f4.displayName=c4.displayName;const h4=_.forwardRef(({className:t,...e},n)=>h.jsx(u4,{ref:n,className:He("flex cursor-default items-center justify-center py-1",t),...e,children:h.jsx(hc,{className:"h-4 w-4"})}));h4.displayName=u4.displayName;const la=_.forwardRef(({className:t,children:e,position:n="popper",...r},i)=>h.jsx(rZ,{children:h.jsxs(a4,{ref:i,className:He("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:n,...r,children:[h.jsx(f4,{}),h.jsx(iZ,{className:He("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),h.jsx(h4,{})]})}));la.displayName=a4.displayName;const sZ=_.forwardRef(({className:t,...e},n)=>h.jsx(s4,{ref:n,className:He("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...e}));sZ.displayName=s4.displayName;const $n=_.forwardRef(({className:t,children:e,...n},r)=>h.jsxs(l4,{ref:r,className:He("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[h.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:h.jsx(aZ,{children:h.jsx(xl,{className:"h-4 w-4"})})}),h.jsx(oZ,{children:e})]}));$n.displayName=l4.displayName;const lZ=_.forwardRef(({className:t,...e},n)=>h.jsx(d4,{ref:n,className:He("-mx-1 my-1 h-px bg-muted",t),...e}));lZ.displayName=d4.displayName;const th=t=>t.toLowerCase().replace(/\s+/g," ").trim();function p4({enabled:t=!0}={}){const{baseUrl:e,fetchWithHeaders:n}=Dn(),[r,i]=_.useState([]),[o,a]=_.useState(!1),s=_.useCallback(async()=>{a(!0);try{try{(await navigator.mediaDevices.getUserMedia({video:!0})).getTracks().forEach(v=>v.stop())}catch{}const l=(await navigator.mediaDevices.enumerateDevices()).filter(y=>y.kind==="videoinput").map(y=>({deviceId:y.deviceId,label:y.label})),c=await n(`${e}/available-cameras`);if(!c.ok)return i([]),[];const d=(await c.json()).cameras??[],f=new Set,p=d.map(y=>{const v=y.name||`Camera ${y.index}`,g=th(v),m=l.filter(b=>!f.has(b.deviceId)&&b.label),x=m.find(b=>th(b.label)===g)||m.find(b=>th(b.label).startsWith(g))||m.find(b=>th(b.label).includes(g)||g.includes(th(b.label)));return x&&f.add(x.deviceId),{index:y.index,name:v,deviceId:(x==null?void 0:x.deviceId)??"",available:y.available}});return i(p),p}catch{return i([]),[]}finally{a(!1)}},[e,n]);return _.useEffect(()=>{if(!t)return;s();const l=()=>s();return navigator.mediaDevices.addEventListener("devicechange",l),()=>navigator.mediaDevices.removeEventListener("devicechange",l)},[t,s]),{cameras:r,isLoading:o,refresh:s}}function m4(t,e){const n=_.useRef(null),[r,i]=_.useState(!1);return _.useEffect(()=>{if(e||!t){t||i(!0);return}let o=!1,a=null;return i(!1),(async()=>{try{if(a=await navigator.mediaDevices.getUserMedia({video:{deviceId:{exact:t}}}),o){a.getTracks().forEach(s=>s.stop());return}n.current&&(n.current.srcObject=a,await n.current.play().catch(()=>{}))}catch{i(!0)}})(),()=>{o=!0,a&&a.getTracks().forEach(s=>s.stop())}},[t,e]),{videoRef:n,hasError:r}}const g4=({cameras:t,onCamerasChange:e,releaseStreamsRef:n})=>{const{toast:r}=Dr(),{cameras:i,isLoading:o}=p4(),[a,s]=_.useState(""),[l,c]=_.useState("");_.useEffect(()=>{if(i.length===0||t.length===0)return;let g=!1;const m=t.map(x=>{if(!x.device_id)return x;const b=i.find(S=>S.deviceId===x.device_id);return b&&b.index!==x.camera_index?(g=!0,{...x,camera_index:b.index}):x});g&&e(m)},[i]);const u=()=>{if(!a||!l.trim()){r({title:"Missing Information",description:"Please select a camera and provide a name.",variant:"destructive"});return}const g=parseInt(a),m=i.find(S=>S.index===g);if(!m){r({title:"Invalid Camera",description:"Selected camera is not available.",variant:"destructive"});return}if(t.some(S=>S.camera_index===m.index||m.deviceId&&S.device_id===m.deviceId)){r({title:"Camera Already Added",description:"This camera is already in the configuration.",variant:"destructive"});return}const b={id:`camera_${Date.now()}`,name:l.trim(),type:"opencv",camera_index:m.index,device_id:m.deviceId,width:640,height:480,fps:30};e([...t,b]),s(""),c(""),r({title:"Camera Added",description:`${b.name} has been added to the configuration.`})},d=g=>{e(t.filter(m=>m.id!==g)),r({title:"Camera Removed",description:"Camera has been removed from the configuration."})},f=(g,m)=>{e(t.map(x=>x.id===g?{...x,...m}:x))},[p,y]=_.useState(!1),v=_.useCallback(()=>{y(!0)},[]);return _.useEffect(()=>{n&&(n.current=v)},[n,v]),h.jsxs("div",{className:"space-y-4",children:[h.jsx("h3",{className:"text-lg font-semibold text-white border-b border-gray-700 pb-2",children:"Camera Configuration"}),h.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-4 space-y-4",children:[h.jsx("h4",{className:"text-md font-medium text-gray-300",children:"Add Camera"}),h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(Tt,{className:"text-sm font-medium text-gray-300",children:"Available Cameras"}),h.jsxs(Ga,{value:a,onValueChange:s,disabled:o,children:[h.jsx(sa,{className:"bg-gray-800 border-gray-700 text-white",children:h.jsx(Wa,{placeholder:o?"Loading cameras...":"Select camera"})}),h.jsx(la,{className:"bg-gray-800 border-gray-700",children:i.map(g=>{const m=t.some(x=>x.camera_index===g.index||g.deviceId&&x.device_id===g.deviceId);return h.jsx($n,{value:g.index.toString(),className:"text-white hover:bg-gray-700",disabled:!g.available||m,children:h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{className:"font-medium",children:g.name}),h.jsxs("span",{className:"text-xs text-gray-400",children:["Index ",g.index,m&&" ยท already added"]})]})},g.index)})})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(Tt,{className:"text-sm font-medium text-gray-300",children:"Camera Name"}),h.jsx(hi,{value:l,onChange:g=>c(g.target.value),placeholder:"e.g., workspace_cam",className:"bg-gray-800 border-gray-700 text-white"})]}),h.jsx("div",{className:"space-y-2 flex flex-col justify-end",children:h.jsxs(et,{onClick:u,className:"bg-blue-500 hover:bg-blue-600 text-white",disabled:!a||!l.trim(),children:[h.jsx(iA,{className:"w-4 h-4 mr-2"}),"Add Camera"]})})]})]}),t.length>0&&h.jsxs("div",{className:"space-y-4",children:[h.jsxs("h4",{className:"text-md font-medium text-gray-300",children:["Configured Cameras (",t.length,")"]}),h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-2 gap-4",children:t.map(g=>h.jsx(cZ,{camera:g,paused:p,onRemove:()=>d(g.id),onUpdate:m=>f(g.id,m)},g.id))})]}),t.length===0&&h.jsxs("div",{className:"text-center py-8 text-gray-500",children:[h.jsx(W7,{className:"w-12 h-12 mx-auto mb-4 text-gray-600"}),h.jsx("p",{children:"No cameras configured. Add a camera to get started."})]})]})},cZ=({camera:t,paused:e,onRemove:n,onUpdate:r})=>{var s;const{videoRef:i,hasError:o}=m4(t.device_id,e),a=!e&&t.device_id&&!o;return h.jsxs("div",{className:"bg-gray-900 rounded-lg border border-gray-700 overflow-hidden",children:[h.jsx("div",{className:"aspect-[4/3] bg-gray-800 relative",children:a?h.jsx("video",{ref:i,autoPlay:!0,muted:!0,playsInline:!0,className:"w-full h-full object-cover"}):h.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center",children:[h.jsx(UU,{className:"w-8 h-8 text-gray-500 mb-2"}),h.jsx("span",{className:"text-gray-500 text-sm",children:e?"Preview paused":t.device_id?"Preview failed":"No browser match"})]})}),h.jsxs("div",{className:"p-3 space-y-2",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("h5",{className:"font-medium text-white truncate",children:t.name}),h.jsx(et,{onClick:n,size:"sm",variant:"ghost",className:"text-red-400 hover:text-red-300 hover:bg-red-900/20 p-1",children:h.jsx(ax,{className:"w-4 h-4"})})]}),h.jsxs("div",{className:"grid grid-cols-1 gap-2 text-xs text-gray-400",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"w-16",children:"Resolution:"}),h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx(mr,{value:t.width,onChange:l=>{l!==void 0&&r({width:l})},className:"bg-gray-800 border-gray-700 text-white text-xs h-6 px-2 w-16",min:"320",max:"1920"}),h.jsx("span",{className:"flex items-center",children:"ร—"}),h.jsx(mr,{value:t.height,onChange:l=>{l!==void 0&&r({height:l})},className:"bg-gray-800 border-gray-700 text-white text-xs h-6 px-2 w-16",min:"240",max:"1080"})]})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"w-16",children:"FPS:"}),h.jsx(mr,{value:t.fps??30,onChange:l=>{l!==void 0&&r({fps:l})},className:"bg-gray-800 border-gray-700 text-white text-xs h-6 px-2 w-16",min:"10",max:"60"})]})]}),h.jsxs("div",{className:"text-xs text-gray-500",children:["Type: ",t.type," | Device: ",(s=t.device_id)==null?void 0:s.substring(0,10),"..."]})]})]})},uZ=({open:t,onOpenChange:e,robot:n,datasetName:r,setDatasetName:i,singleTask:o,setSingleTask:a,numEpisodes:s,setNumEpisodes:l,episodeTimeS:c,setEpisodeTimeS:u,resetTimeS:d,setResetTimeS:f,streamingEncoding:p,setStreamingEncoding:y,cameras:v,setCameras:g,onStart:m,releaseStreamsRef:x})=>{const{auth:b}=xf(),S=!!n&&n.is_clean;return h.jsx(Hc,{open:t,onOpenChange:e,children:h.jsxs(bl,{className:"bg-gray-900 border-gray-800 text-white sm:max-w-[600px] p-8 max-h-[90vh] overflow-y-auto",children:[h.jsxs(_l,{children:[h.jsx("div",{className:"flex justify-center items-center mb-4",children:h.jsx("div",{className:"w-8 h-8 bg-red-500 rounded-full flex items-center justify-center",children:h.jsx("span",{className:"text-white font-bold text-sm",children:"REC"})})}),h.jsx(wl,{className:"text-white text-center text-2xl font-bold",children:"Configure Recording"})]}),h.jsxs("div",{className:"space-y-6 py-4",children:[h.jsx(Sl,{className:"text-gray-400 text-base leading-relaxed text-center",children:"Pick a configured robot and dataset parameters for recording."}),h.jsxs("div",{className:"grid grid-cols-1 gap-6",children:[h.jsxs("div",{className:"space-y-4",children:[h.jsx("h3",{className:"text-lg font-semibold text-white border-b border-gray-700 pb-2",children:"Robot Configuration"}),n?n.is_clean?h.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[h.jsx(qi,{className:"w-4 h-4 text-green-400"}),h.jsxs("span",{className:"text-slate-200",children:["Recording with ",h.jsx("strong",{children:n.name})]})]}):h.jsxs(Mi,{className:"bg-amber-900/40 border-amber-700 text-amber-100",children:[h.jsx(oa,{className:"h-4 w-4"}),h.jsxs(Ai,{children:[h.jsx("strong",{children:n.name})," is missing a calibration. Configure it before recording."]})]}):h.jsxs(Mi,{className:"bg-amber-900/40 border-amber-700 text-amber-100",children:[h.jsx(oa,{className:"h-4 w-4"}),h.jsx(Ai,{children:"Select and configure a robot on the Landing page before recording."})]})]}),h.jsxs("div",{className:"space-y-4",children:[h.jsx("h3",{className:"text-lg font-semibold text-white border-b border-gray-700 pb-2",children:"Dataset Configuration"}),h.jsxs("div",{className:"grid grid-cols-1 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(Tt,{htmlFor:"datasetName",className:"text-sm font-medium text-gray-300",children:"Dataset Name *"}),h.jsx(hi,{id:"datasetName",value:r,onChange:w=>i(w.target.value.replace(/[^A-Za-z0-9._-]/g,"_")),placeholder:"my_dataset",className:"bg-gray-800 border-gray-700 text-white"}),h.jsxs("p",{className:"text-xs text-gray-500",children:["Letters, numbers, ",h.jsx("code",{children:"."})," ",h.jsx("code",{children:"_"})," ",h.jsx("code",{children:"-"})," only โ€” other characters become"," ",h.jsx("code",{children:"_"}),"."]}),r&&(b.status==="authenticated"?h.jsxs("p",{className:"text-xs text-gray-500",children:["Will be saved as"," ",h.jsxs("span",{className:"text-gray-300 font-mono",children:[b.username,"/",r]})]}):b.status==="unauthenticated"?h.jsx("p",{className:"text-xs text-amber-400/80",children:"Log in to Hugging Face to set the repository owner."}):null)]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(Tt,{htmlFor:"singleTask",className:"text-sm font-medium text-gray-300",children:"Task Description *"}),h.jsx(hi,{id:"singleTask",value:o,onChange:w=>a(w.target.value),placeholder:"e.g., pick up the red block and place it on the blue square",className:"bg-gray-800 border-gray-700 text-white"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(Tt,{htmlFor:"numEpisodes",className:"text-sm font-medium text-gray-300",children:"Number of Episodes"}),h.jsx(mr,{id:"numEpisodes",min:"1",max:"100",value:s,onChange:w=>{w!==void 0&&l(w)},className:"bg-gray-800 border-gray-700 text-white"})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(Tt,{htmlFor:"episodeTimeS",className:"text-sm font-medium text-gray-300",children:"Episode duration (seconds)"}),h.jsx(mr,{id:"episodeTimeS",min:"1",value:c,onChange:w=>{w!==void 0&&u(w)},className:"bg-gray-800 border-gray-700 text-white"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(Tt,{htmlFor:"resetTimeS",className:"text-sm font-medium text-gray-300",children:"Reset duration (seconds)"}),h.jsx(mr,{id:"resetTimeS",min:"1",value:d,onChange:w=>{w!==void 0&&f(w)},className:"bg-gray-800 border-gray-700 text-white"})]})]})]})]}),h.jsx("div",{className:"space-y-4",children:h.jsx(g4,{cameras:v,onCamerasChange:g,releaseStreamsRef:x})}),h.jsxs(Ty,{className:"space-y-4 group",children:[h.jsxs(My,{className:"flex items-center justify-between w-full text-lg font-semibold text-white border-b border-gray-700 pb-2",children:[h.jsx("span",{children:"Advanced Parameters"}),h.jsx(hc,{className:"w-4 h-4 transition-transform group-data-[state=open]:rotate-180"})]}),h.jsx(Ay,{className:"space-y-3",children:h.jsxs("div",{className:"flex items-start gap-3",children:[h.jsx(IA,{id:"streamingEncoding",checked:p,onCheckedChange:w=>y(w===!0),className:"mt-0.5 border-gray-500 data-[state=checked]:bg-red-500 data-[state=checked]:border-red-500"}),h.jsxs("div",{className:"space-y-1",children:[h.jsx(Tt,{htmlFor:"streamingEncoding",className:"text-sm font-medium text-gray-200 cursor-pointer",children:"Streaming video encoding"}),h.jsx("p",{className:"text-xs text-gray-500",children:"Encodes frames in real time during capture so each episode saves almost instantly. Uncheck to fall back to the slower PNG-then-encode flow."})]})]})})]})]}),h.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center pt-4",children:[h.jsx(et,{onClick:m,disabled:!S,className:"w-full sm:w-auto bg-red-500 hover:bg-red-600 text-white px-10 py-6 text-lg transition-all shadow-md shadow-red-500/30 hover:shadow-lg hover:shadow-red-500/40 disabled:opacity-40 disabled:cursor-not-allowed",children:"Start Recording"}),h.jsx(et,{onClick:()=>e(!1),variant:"outline",className:"w-full sm:w-auto border-gray-500 hover:border-gray-200 px-10 py-6 text-lg text-zinc-500 bg-zinc-900 hover:bg-zinc-800",children:"Cancel"})]})]})]})})},dZ=/^[\w.\-]+\/[\w.\-]+$/,fZ=/^[A-Za-z0-9._-]+$/,hZ=({datasets:t,loading:e,onPickExisting:n,onCreateNew:r,onOpenCustom:i,children:o})=>{const[a,s]=_.useState(!1),[l,c]=_.useState(""),u=l.trim(),d=t.some(C=>C.repo_id.toLowerCase()===u.toLowerCase()),f=dZ.test(u),p=fZ.test(u)&&!u.includes("/"),y=u.length>0&&p&&!d,v=f&&!d,g=d||u!==""&&!y,m=d?"Already exists":u===""?"Create new datasetโ€ฆ":y?`Create "${u}"`:'Use a name without "/"',x=()=>{g||(r(u),w())},b=t.filter(C=>C.source==="local"||C.source==="both"),S=t.filter(C=>C.source==="hub"),w=()=>{c(""),s(!1)},E=C=>{n(C),w()},T=()=>{y&&(r(u),w())},A=()=>{v&&(i(u),w())},M=C=>h.jsxs(kd,{value:C.repo_id,onSelect:()=>E(C),className:"text-white aria-selected:bg-gray-700",children:[h.jsx("span",{className:"flex-1 truncate",children:C.repo_id}),C.source==="both"&&h.jsx("span",{className:"text-xs text-gray-400 mr-2",children:"on Hub"}),C.private&&h.jsx("span",{className:"text-xs text-amber-400",children:"private"})]},C.repo_id);return h.jsxs(Sx,{open:a,onOpenChange:s,children:[h.jsx(Ex,{asChild:!0,children:o}),h.jsx(Rm,{className:"w-[320px] p-0 bg-gray-800 border-gray-700 text-white",align:"end",children:h.jsxs(Mx,{className:"bg-gray-800",children:[h.jsx(Ax,{placeholder:"Search, type a new name, or org/nameโ€ฆ",value:l,onValueChange:C=>c(C.replace(/[^A-Za-z0-9._\-/]/g,"_")),onKeyDown:C=>{C.key==="Enter"&&(y?(C.preventDefault(),T()):v&&(C.preventDefault(),A()))},className:"text-white"}),h.jsxs(Cx,{children:[t.length===0&&!y&&!v&&h.jsx(Px,{className:"py-4 text-sm text-gray-400 text-center",children:e?"Loading datasetsโ€ฆ":"No datasets yet. Type a name to create one."}),b.length>0&&h.jsx(Qs,{heading:"Local",children:b.map(M)}),S.length>0&&h.jsx(Qs,{heading:"Hugging Face",children:S.map(M)}),v&&h.jsx(Qs,{heading:"Custom repo",children:h.jsxs(kd,{value:`__open__${u}`,onSelect:A,className:"text-white aria-selected:bg-gray-700",children:[h.jsx(cl,{className:"mr-2 h-4 w-4"}),'Open "',u,'" in viewer']})})]}),h.jsxs("button",{type:"button",onClick:x,disabled:g,className:"flex w-full items-center gap-2 border-t border-gray-700 px-3 py-2 text-sm text-white hover:bg-gray-700 disabled:cursor-not-allowed disabled:text-gray-500 disabled:hover:bg-transparent",children:[h.jsx(iA,{className:"h-4 w-4"}),m]})]})})]})},pZ=(t,e)=>{const{wsBaseUrl:n}=Dn(),r=_.useRef(t);r.current=t;const i=_.useRef(e);i.current=e,_.useEffect(()=>{let o=!1,a=null,s=null;const l=()=>{if(!o){try{a=new WebSocket(`${n}/ws/joint-data`)}catch{s=setTimeout(l,3e3);return}a.onmessage=c=>{try{const u=JSON.parse(c.data);(u==null?void 0:u.type)==="jobs_changed"?r.current():(u==null?void 0:u.type)==="job_progress"&&i.current&&Array.isArray(u==null?void 0:u.jobs)&&i.current(u.jobs)}catch{}},a.onclose=()=>{o||(s=setTimeout(l,3e3))}}};return l(),()=>{o=!0,s&&clearTimeout(s),a&&a.close()}},[n])};class Lx extends Error{constructor(n,r,i){super(n);Jb(this,"status");Jb(this,"detail");this.name="ApiError",this.status=r,this.detail=i}}async function er(t,e,n,{method:r="GET",body:i,signal:o,action:a}={}){const s={method:r,signal:o};i!==void 0&&(s.body=JSON.stringify(i));const l=`${t}${n}`,c=await e(l,s);if(!c.ok){let u=null;try{const f=await c.json();u=(f==null?void 0:f.detail)??(f==null?void 0:f.message)??null}catch{}const d=a||`${r} ${n}`;throw new Lx(`${d} failed: ${u??c.status}`,c.status,u)}if(c.status!==204)return c.json()}async function CE(t,e,n=10,r){return(await er(t,e,`/jobs?limit=${n}`,{signal:r,action:"List jobs"})).jobs}async function mZ(t,e,n,r){return er(t,e,`/jobs/${n}`,{signal:r,action:"Get job"})}async function gZ(t,e,n,r){return(await er(t,e,`/jobs/${n}/logs`,{signal:r,action:"Get job logs"})).logs}async function vZ(t,e,n,r){return(await er(t,e,`/jobs/${n}/log-file`,{signal:r,action:"Get job log file"})).logs}async function yZ(t,e,n,r){return(await er(t,e,`/jobs/${n}/metrics-history`,{signal:r,action:"Get job metrics history"})).points}async function xZ(t,e,n){const{target:r,...i}=n,o=r?{config:i,target:r}:i;try{return await er(t,e,"/jobs/training",{method:"POST",body:o,action:"Start training"})}catch(a){throw a instanceof Lx&&a.status===409?new Error("Another training is already running. Stop it first."):a}}async function v4(t,e,n){return er(t,e,`/jobs/${n}/stop`,{method:"POST",action:"Stop job"})}async function bZ(t,e,n,r){return er(t,e,`/jobs/providers/${encodeURIComponent(n)}/jobs/${encodeURIComponent(r)}/attach`,{method:"POST",action:"Attach provider job"})}async function y4(t,e,n){await er(t,e,`/jobs/${n}`,{method:"DELETE",action:"Delete job"})}const _Z={authenticated:!1,username:null,flavors:[],providers:[]};async function PN(t,e,n){try{const r=await er(t,e,"/jobs/runners/hardware",{signal:n,action:"List runner hardware"});return{authenticated:!!r.authenticated,username:r.username??null,flavors:Array.isArray(r.flavors)?r.flavors:[],providers:Array.isArray(r.providers)?r.providers.map(i=>({...i,flavors:Array.isArray(i.flavors)?i.flavors:[]})):[]}}catch(r){if(r instanceof Lx)return _Z;throw r}}async function wZ(t,e,n){return er(t,e,"/compute/seeed-cloud/config",{signal:n,action:"Get Seeed Cloud config"})}async function SZ(t,e,n){return er(t,e,"/compute/seeed-cloud/config",{method:"POST",body:n,action:"Save Seeed Cloud config"})}const EZ={authenticated:!1,jobs:[],models:[]};async function TZ(t,e,n){try{return await er(t,e,"/jobs/hub",{signal:n,action:"List hub jobs"})}catch(r){if(r instanceof Lx)return EZ;throw r}}const Gr=_.forwardRef(({className:t,...e},n)=>h.jsx("div",{ref:n,className:He("rounded-lg border bg-card text-card-foreground shadow-sm",t),...e}));Gr.displayName="Card";const jo=_.forwardRef(({className:t,...e},n)=>h.jsx("div",{ref:n,className:He("flex flex-col space-y-1.5 p-6",t),...e}));jo.displayName="CardHeader";const ga=_.forwardRef(({className:t,...e},n)=>h.jsx("h3",{ref:n,className:He("text-2xl font-semibold leading-none tracking-tight",t),...e}));ga.displayName="CardTitle";const MZ=_.forwardRef(({className:t,...e},n)=>h.jsx("p",{ref:n,className:He("text-sm text-muted-foreground",t),...e}));MZ.displayName="CardDescription";const Wr=_.forwardRef(({className:t,...e},n)=>h.jsx("div",{ref:n,className:He("p-6 pt-0",t),...e}));Wr.displayName="CardContent";const AZ=_.forwardRef(({className:t,...e},n)=>h.jsx("div",{ref:n,className:He("flex items-center p-6 pt-0",t),...e}));AZ.displayName="CardFooter";async function FA(t,e,n,r){return(await er(t,e,`/jobs/${n}/checkpoints`,{signal:r,action:"List checkpoints"})).checkpoints}async function CZ(t,e,n,r,i){return er(t,e,`/jobs/${n}/checkpoints/${r}/policy-config`,{signal:i,action:"Load policy config"})}const BA=({checkpoints:t,selectedStep:e,onChange:n,disabled:r,placeholder:i="Select checkpoint"})=>{const o=e!=null?String(e):void 0;return h.jsxs(Ga,{value:o,onValueChange:a=>n(Number(a)),disabled:r||t.length===0,children:[h.jsx(sa,{className:"bg-slate-800 border-slate-700 text-white h-8 text-xs px-2 w-auto min-w-[110px]",onClick:a=>a.stopPropagation(),children:h.jsx(Wa,{placeholder:i})}),h.jsx(la,{className:"bg-slate-900 border-slate-700 text-white",children:t.map(a=>h.jsxs($n,{value:String(a.step),onClick:s=>s.stopPropagation(),children:["step ",a.step]},a.step))})]})};function RN(t){const e=Math.max(0,Date.now()/1e3-t);return e<60?`${Math.floor(e)}s ago`:e<3600?`${Math.floor(e/60)}m ago`:e<86400?`${Math.floor(e/3600)}h ago`:`${Math.floor(e/86400)}d ago`}const PZ={running:{label:"Running",color:"text-green-400",Icon:fi},done:{label:"Done",color:"text-slate-400",Icon:nA},failed:{label:"Failed",color:"text-red-400",Icon:nd},interrupted:{label:"Interrupted",color:"text-amber-400",Icon:oa}},Mg=({job:t,onStop:e,onDelete:n,onPlay:r})=>{const i=ji(),{baseUrl:o,fetchWithHeaders:a}=Dn(),s=PZ[t.state],l=s.Icon,c=t.state==="running",u=c&&t.metrics.total_steps===0,d=t.metrics.total_steps>0?Math.min(100,t.metrics.current_step/t.metrics.total_steps*100):0,f=u?"startingโ€ฆ":c?`started ${RN(t.started_at)}`:t.ended_at!=null?`ended ${RN(t.ended_at)}`:s.label.toLowerCase(),[p,y]=_.useState([]),[v,g]=_.useState(null);_.useEffect(()=>{if(t.checkpoint_count<=0){y([]),g(null);return}let w=!1;return FA(o,a,t.id).then(E=>{if(!w)if(y(E),E.length>0){const T=E[E.length-1].step;g(A=>A!=null&&E.some(M=>M.step===A)?A:T)}else g(null)}).catch(()=>{w||(y([]),g(null))}),()=>{w=!0}},[o,a,t.id,t.checkpoint_count]);const m=w=>{w.stopPropagation(),c?window.confirm("Stop this run?")&&e(t.id):window.confirm("Delete this run? This wipes the output directory.")&&n(t.id)},x=w=>{w.stopPropagation(),v!=null&&r(t,v)},b=c,S=p.length>0&&v!=null;return h.jsx(Gr,{onClick:()=>i(`/training/${t.id}`),className:"bg-slate-800/50 border-slate-700 rounded-xl cursor-pointer hover:border-slate-500 transition-colors",children:h.jsxs(Wr,{className:"p-4 space-y-3",children:[h.jsxs("div",{className:"flex items-start justify-between gap-2",children:[h.jsxs("div",{className:`flex items-center gap-1.5 text-xs font-semibold ${s.color}`,children:[h.jsx(l,{className:`w-3.5 h-3.5 ${c?"animate-spin":""}`}),s.label]}),t.runner==="hf_cloud"&&t.hf_job_url?h.jsx(et,{variant:"ghost",size:"icon",asChild:!0,className:"h-7 w-7 text-slate-400 hover:text-white","aria-label":"Open Hub job page",children:h.jsx("a",{href:t.hf_job_url,target:"_blank",rel:"noopener noreferrer",onClick:w=>w.stopPropagation(),children:h.jsx(cl,{className:"w-3.5 h-3.5"})})}):h.jsx(et,{variant:"ghost",size:"icon",onClick:m,className:"h-7 w-7 text-slate-400 hover:text-white","aria-label":c?"Stop job":"Delete job",children:c?h.jsx(Od,{className:"w-3.5 h-3.5"}):h.jsx(ax,{className:"w-3.5 h-3.5"})})]}),h.jsxs("div",{children:[h.jsx("div",{className:"text-white font-semibold truncate",title:t.name,children:t.name}),h.jsx("div",{className:"text-xs text-slate-400",children:f})]}),b?h.jsxs("div",{className:"relative h-5 w-full overflow-hidden rounded-md bg-slate-900 border border-slate-700",children:[h.jsx("div",{className:"h-full bg-gradient-to-r from-blue-500 to-sky-400 transition-[width] duration-500",style:{width:`${d}%`}}),h.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-xs font-semibold text-white tabular-nums drop-shadow",children:u?"Training startingโ€ฆ":`${d.toFixed(1)}%`})]}):null,S?h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(BA,{checkpoints:p,selectedStep:v,onChange:g}),h.jsx(et,{size:"icon",onClick:x,className:"h-8 w-8 bg-green-500 hover:bg-green-600 text-white","aria-label":"Run inference with this checkpoint",children:h.jsx(Tc,{className:"w-4 h-4"})})]}):null]})})};function RZ(t){if(!t)return"โ€”";const e=Date.parse(t);if(Number.isNaN(e))return"โ€”";const n=Math.max(0,(Date.now()-e)/1e3);return n<60?`${Math.floor(n)}s ago`:n<3600?`${Math.floor(n/60)}m ago`:n<86400?`${Math.floor(n/3600)}h ago`:`${Math.floor(n/86400)}d ago`}const NZ={RUNNING:{label:"Running",color:"text-green-400",Icon:fi,spin:!0},QUEUED:{label:"Queued",color:"text-amber-400",Icon:hE},SCHEDULING:{label:"Scheduling",color:"text-amber-400",Icon:hE},COMPLETED:{label:"Done",color:"text-slate-400",Icon:nA},FAILED:{label:"Failed",color:"text-red-400",Icon:nd},CANCELED:{label:"Cancelled",color:"text-amber-400",Icon:oa},CANCELLED:{label:"Cancelled",color:"text-amber-400",Icon:oa}},NN=({job:t,onOpen:e,busy:n=!1})=>{var c,u,d;const r=((u=(c=t.status)==null?void 0:c.stage)==null?void 0:u.toUpperCase())??"",i=NZ[r]??{label:r||"Unknown",color:"text-slate-400",Icon:q7},o=i.Icon,a=t.docker_image??t.space_id??`Job ${t.id.slice(0,12)}โ€ฆ`,s=!!t.url,l=!!(e||s);return h.jsx(Gr,{onClick:()=>{if(!n){if(e){e(t);return}s&&window.open(t.url,"_blank","noopener,noreferrer")}},className:`bg-slate-800/50 border-slate-700 rounded-xl hover:border-slate-500 transition-colors ${l?"cursor-pointer":""}`,children:h.jsxs(Wr,{className:"p-4 space-y-3",children:[h.jsxs("div",{className:"flex items-start justify-between gap-2",children:[h.jsxs("div",{className:`flex items-center gap-1.5 text-xs font-semibold ${i.color}`,children:[h.jsx(o,{className:`w-3.5 h-3.5 ${i.spin||n?"animate-spin":""}`}),i.label]}),s?h.jsx(et,{variant:"ghost",size:"icon",asChild:!0,className:"h-7 w-7 text-slate-400 hover:text-white","aria-label":"View provider job",children:h.jsx("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",onClick:f=>f.stopPropagation(),children:h.jsx(cl,{className:"w-3.5 h-3.5"})})}):null]}),h.jsxs("div",{children:[h.jsx("div",{className:"text-white font-semibold truncate",title:a,children:a}),h.jsxs("div",{className:"text-xs text-slate-400 truncate",children:[t.flavor??"โ€”"," ยท ",RZ(t.created_at),t.owner?` ยท ${t.owner}`:""]})]}),(d=t.status)!=null&&d.message?h.jsx("div",{className:"text-xs text-slate-500 truncate",title:t.status.message,children:t.status.message}):null]})})};function OZ(t){if(!t)return"โ€”";const e=Date.parse(t);if(Number.isNaN(e))return"โ€”";const n=Math.max(0,(Date.now()-e)/1e3);return n<60?`${Math.floor(n)}s ago`:n<3600?`${Math.floor(n/60)}m ago`:n<86400?`${Math.floor(n/3600)}h ago`:`${Math.floor(n/86400)}d ago`}const IZ=({model:t})=>{const e=`https://huggingface.co/${t.repo_id}`,n=t.repo_id.includes("/")?t.repo_id.split("/").slice(1).join("/"):t.repo_id;return h.jsx(Gr,{onClick:()=>window.open(e,"_blank","noopener,noreferrer"),className:"bg-slate-800/50 border-slate-700 rounded-xl cursor-pointer hover:border-slate-500 transition-colors",children:h.jsxs(Wr,{className:"p-4 space-y-3",children:[h.jsxs("div",{className:"flex items-start justify-between gap-2",children:[h.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-semibold text-sky-400",children:[h.jsx(jU,{className:"w-3.5 h-3.5"}),"Uploaded"]}),h.jsx(et,{variant:"ghost",size:"icon",asChild:!0,className:"h-7 w-7 text-slate-400 hover:text-white","aria-label":"View on Hub",children:h.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",onClick:r=>r.stopPropagation(),children:h.jsx(cl,{className:"w-3.5 h-3.5"})})})]}),h.jsxs("div",{children:[h.jsxs("div",{className:"text-white font-semibold truncate flex items-center gap-1.5",title:t.repo_id,children:[t.private?h.jsx(nX,{className:"w-3.5 h-3.5 text-slate-400 shrink-0"}):null,h.jsx("span",{className:"truncate",children:n})]}),h.jsxs("div",{className:"text-xs text-slate-400 truncate",title:t.repo_id,children:[t.repo_id," ยท updated ",OZ(t.last_modified)]})]})]})})};async function DZ(t,e,n){return er(t,e,"/start-inference",{method:"POST",body:n,action:"Start inference"})}async function ON(t,e){return er(t,e,"/stop-inference",{method:"POST",action:"Stop inference"})}async function LZ(t,e,n){return er(t,e,"/inference-status",{signal:n,action:"Get inference status"})}const kZ=({deviceId:t,paused:e})=>{const{videoRef:n,hasError:r}=m4(t,e);return e||r||!t?h.jsxs("div",{className:"w-32 h-24 bg-gray-800 rounded border border-gray-700 flex flex-col items-center justify-center",children:[h.jsx(UU,{className:"w-5 h-5 text-gray-500 mb-1"}),h.jsx("span",{className:"text-[10px] text-gray-500",children:e?"Released":"No preview"})]}):h.jsx("video",{ref:n,autoPlay:!0,muted:!0,playsInline:!0,className:"w-32 h-24 object-cover rounded border border-gray-700 bg-black"})},jZ=30,x4=({open:t,onOpenChange:e,robot:n,jobId:r,initialStep:i})=>{var L;const{baseUrl:o,fetchWithHeaders:a}=Dn(),{toast:s}=Dr(),l=ji(),[c,u]=_.useState([]),[d,f]=_.useState(i),[p,y]=_.useState(""),[v,g]=_.useState(60),[m,x]=_.useState(!1),[b,S]=_.useState(null),[w,E]=_.useState(!1),[T,A]=_.useState(null),[M,C]=_.useState({}),{cameras:P}=p4({enabled:t});_.useEffect(()=>{if(!t)return;let j=!1;return FA(o,a,r).then(X=>{if(!j&&(u(X),X.length>0)){const K=X[X.length-1].step;f(F=>F??K)}}).catch(()=>{j||u([])}),()=>{j=!0}},[t,o,a,r]),_.useEffect(()=>{if(!t||d==null){S(null),A(null);return}let j=!1;return E(!0),A(null),CZ(o,a,r,d).then(X=>{j||(S(X),C(K=>{const F={};for(const Y of Object.keys(X.image_features))F[Y]=K[Y]??null;return F}))}).catch(X=>{j||(S(null),A(X instanceof Error?X.message:String(X)))}).finally(()=>{j||E(!1)}),()=>{j=!0}},[t,o,a,r,d]),_.useEffect(()=>{if(!b)return;const j=(n==null?void 0:n.cameras)??[];j.length===0||P.length===0||C(X=>{let K=!1;const F={...X};for(const Y of Object.keys(b.image_features)){if(F[Y]!=null)continue;const q=j.find(te=>te.name.toLowerCase()===Y.toLowerCase());if(!q)continue;const ee=q.device_id&&P.find(te=>te.deviceId===q.device_id)||P.find(te=>te.index===q.camera_index);ee&&(F[Y]=ee.index,K=!0)}return K?F:X})},[b,n,P]);const R=d!=null?((L=c.find(j=>j.step===d))==null?void 0:L.ref)??null:null,D=b?Object.keys(b.image_features):[],k=D.every(j=>M[j]!=null),U=!!n&&n.is_clean&&R!=null&&!!b&&k&&!m,O=async()=>{if(!n||R==null||!b)return;x(!0),await new Promise(X=>setTimeout(X,300));const j={};for(const[X,K]of Object.entries(b.image_features)){const F=M[X];F!=null&&(j[X]={type:"opencv",camera_index:F,width:K.width,height:K.height,fps:jZ})}try{await DZ(o,a,{follower_port:n.follower_port,follower_config:n.follower_config,policy_ref:R,task:p,cameras:j,duration_s:v}),e(!1),l("/inference")}catch(X){s({title:"Couldn't start inference",description:X instanceof Error?X.message:String(X),variant:"destructive"}),x(!1)}},W=(j,X)=>{const K=Number(X);C(F=>({...F,[j]:K}))};return h.jsx(Hc,{open:t,onOpenChange:e,children:h.jsxs(bl,{className:"bg-gray-900 border-gray-800 text-white sm:max-w-[600px] p-8 max-h-[90vh] overflow-y-auto",children:[h.jsxs(_l,{children:[h.jsx("div",{className:"flex justify-center items-center mb-4",children:h.jsx("div",{className:"w-8 h-8 bg-green-500 rounded-full flex items-center justify-center",children:h.jsx(Tc,{className:"w-4 h-4 text-white"})})}),h.jsx(wl,{className:"text-white text-center text-2xl font-bold",children:"Configure Inference"})]}),h.jsxs("div",{className:"space-y-6 py-4",children:[h.jsx(Sl,{className:"text-gray-400 text-base leading-relaxed text-center",children:"Pick a checkpoint and confirm hardware. The selected policy will drive the follower autonomously for the configured duration."}),h.jsxs("div",{className:"space-y-4",children:[h.jsx("h3",{className:"text-lg font-semibold text-white border-b border-gray-700 pb-2",children:"Robot Configuration"}),n?n.is_clean?h.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[h.jsx(qi,{className:"w-4 h-4 text-green-400"}),h.jsxs("span",{className:"text-slate-200",children:["Running on ",h.jsx("strong",{children:n.name})]})]}):h.jsxs(Mi,{className:"bg-amber-900/40 border-amber-700 text-amber-100",children:[h.jsx(oa,{className:"h-4 w-4"}),h.jsxs(Ai,{children:[h.jsx("strong",{children:n.name})," is missing a calibration. Configure it before running inference."]})]}):h.jsxs(Mi,{className:"bg-amber-900/40 border-amber-700 text-amber-100",children:[h.jsx(oa,{className:"h-4 w-4"}),h.jsx(Ai,{children:"Select and configure a robot on the Landing page first."})]})]}),h.jsxs("div",{className:"space-y-4",children:[h.jsx("h3",{className:"text-lg font-semibold text-white border-b border-gray-700 pb-2",children:"Checkpoint"}),c.length===0?h.jsxs(Mi,{className:"bg-amber-900/40 border-amber-700 text-amber-100",children:[h.jsx(oa,{className:"h-4 w-4"}),h.jsx(Ai,{children:"No checkpoints available for this job yet."})]}):h.jsx(BA,{checkpoints:c,selectedStep:d,onChange:f})]}),h.jsxs("div",{className:"space-y-4",children:[h.jsx("h3",{className:"text-lg font-semibold text-white border-b border-gray-700 pb-2",children:"Run parameters"}),b!=null&&b.requires_task?h.jsxs("div",{className:"space-y-2",children:[h.jsx(Tt,{htmlFor:"task",className:"text-sm font-medium text-gray-300",children:"Task description"}),h.jsx(hi,{id:"task",value:p,onChange:j=>y(j.target.value),placeholder:"e.g., pick up the red block",className:"bg-gray-800 border-gray-700 text-white"}),h.jsxs("p",{className:"text-xs text-gray-500",children:["This policy is language-conditioned (",b.policy_type,")."]})]}):null,h.jsxs("div",{className:"space-y-2",children:[h.jsx(Tt,{htmlFor:"durationS",className:"text-sm font-medium text-gray-300",children:"Max duration (seconds)"}),h.jsx(mr,{id:"durationS",min:1,value:v,onChange:j=>{j!==void 0&&g(j)},className:"bg-gray-800 border-gray-700 text-white"})]})]}),h.jsxs("div",{className:"space-y-4",children:[h.jsx("h3",{className:"text-lg font-semibold text-white border-b border-gray-700 pb-2",children:"Cameras"}),w?h.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-400",children:[h.jsx(fi,{className:"w-4 h-4 animate-spin"}),"Reading policy configโ€ฆ"]}):T?h.jsxs(Mi,{className:"bg-red-900/40 border-red-700 text-red-100",children:[h.jsx(oa,{className:"h-4 w-4"}),h.jsxs(Ai,{children:["Couldn't load policy config: ",T]})]}):b?D.length===0?h.jsx("p",{className:"text-xs text-gray-500",children:"This policy doesn't use cameras."}):h.jsxs("div",{className:"space-y-3",children:[h.jsx("p",{className:"text-xs text-gray-500",children:"Bind a physical camera to each name the policy was trained with. Resolution comes from the checkpoint."}),D.map(j=>{const X=b.image_features[j],K=M[j],F=K!=null?P.find(Y=>Y.index===K):void 0;return h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs("div",{className:"flex-1",children:[h.jsx(Tt,{className:"text-sm font-medium text-gray-200",children:j}),h.jsxs("p",{className:"text-xs text-gray-500",children:[X.width,"ร—",X.height]})]}),h.jsxs(Ga,{value:K!=null?String(K):void 0,onValueChange:Y=>W(j,Y),children:[h.jsx(sa,{className:"bg-gray-800 border-gray-700 text-white w-56",children:h.jsx(Wa,{placeholder:"Select a camera"})}),h.jsx(la,{className:"bg-gray-900 border-gray-700 text-white",children:P.length===0?h.jsx("div",{className:"px-2 py-1.5 text-xs text-gray-500",children:"No cameras detected"}):P.map(Y=>h.jsxs($n,{value:String(Y.index),children:["#",Y.index," โ€” ",Y.name]},Y.index))})]}),h.jsx(kZ,{deviceId:(F==null?void 0:F.deviceId)??"",paused:m})]},j)})]}):null]}),h.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center pt-4",children:[h.jsxs(et,{onClick:O,disabled:!U,className:"w-full sm:w-auto bg-green-500 hover:bg-green-600 text-white px-10 py-6 text-lg disabled:opacity-40 disabled:cursor-not-allowed",children:[h.jsx(Tc,{className:"w-5 h-5 mr-2"}),m?"Startingโ€ฆ":"Start Inference"]}),h.jsx(et,{onClick:()=>e(!1),variant:"outline",className:"w-full sm:w-auto border-gray-500 hover:border-gray-200 px-10 py-6 text-lg text-zinc-500 bg-zinc-900 hover:bg-zinc-800",children:"Cancel"})]})]})]})})},PE="lelab.selectedRobot",UZ=()=>{try{const t=localStorage.getItem(PE);return t&&typeof t=="string"?t:null}catch{return null}},FZ=t=>{try{t?localStorage.setItem(PE,t):localStorage.removeItem(PE)}catch{}},$A=()=>{const{baseUrl:t,fetchWithHeaders:e}=Dn(),{toast:n}=Dr(),r=yl(),[i,o]=_.useState({}),[a,s]=_.useState(()=>UZ()),[l,c]=_.useState(!1);_.useEffect(()=>{let g=!1;return(async()=>{c(!0);try{const b=await(await e(`${t}/robots`)).json();if(g)return;const S={};for(const w of b.robots??[])S[w.name]=w;o(S),s(w=>w&&w in S?w:null)}catch(x){g||console.error("Failed to fetch robots:",x)}finally{g||c(!1)}})(),()=>{g=!0}},[t,e,r.key]),_.useEffect(()=>{FZ(a)},[a]);const u=_.useCallback(g=>{s(g)},[]),d=_.useCallback(()=>{s(null)},[]),f=_.useCallback(async g=>{const m=g.trim();if(!m)return n({title:"Missing name",description:"Robot name cannot be empty.",variant:"destructive"}),!1;if(/[/\\]|\.\./.test(m))return n({title:"Invalid name",description:"Robot names cannot contain '/', '\\', or '..'",variant:"destructive"}),!1;try{const x=await e(`${t}/robots/${encodeURIComponent(m)}?create=true`,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"});if(x.status===409)return n({title:"Already exists",description:`A robot named "${m}" already exists. Pick it from the dropdown or choose a different name.`,variant:"destructive"}),!1;if(!x.ok){const S=await x.text();return n({title:"Failed to create",description:S,variant:"destructive"}),!1}const b=await x.json();return b.robot&&(o(S=>({...S,[m]:b.robot})),s(m)),!0}catch(x){return n({title:"Network error",description:String(x),variant:"destructive"}),!1}},[t,e,n]),p=_.useCallback(async g=>{try{const m=await e(`${t}/robots/${encodeURIComponent(g)}`,{method:"DELETE"});if(!m.ok){const x=await m.text();return n({title:"Failed to delete",description:x,variant:"destructive"}),!1}return o(x=>{const{[g]:b,...S}=x;return S}),s(x=>x===g?null:x),!0}catch(m){return n({title:"Network error",description:String(m),variant:"destructive"}),!1}},[t,e,n]),y=_.useMemo(()=>a?i[a]??null:null,[a,i]),v=_.useMemo(()=>Object.keys(i).sort(),[i]);return{records:i,selectedName:a,selectedRecord:y,availableNames:v,isLoading:l,selectRobot:u,clearSelection:d,createRobot:f,deleteRobot:p}},BZ=10,$Z=new Set(["RUNNING","QUEUED","SCHEDULING"]),Ag=t=>t.state==="running"||t.checkpoint_count>0,IN=t=>{var e;return $Z.has((((e=t.status)==null?void 0:e.stage)??"").toUpperCase())},zZ=()=>{const{baseUrl:t,fetchWithHeaders:e}=Dn(),{toast:n}=Dr(),r=ji(),[i,o]=_.useState([]),[a,s]=_.useState([]),[l,c]=_.useState([]),[u,d]=_.useState(!1),[f,p]=_.useState(null),[y,v]=_.useState(""),[g,m]=_.useState(null),{selectedRecord:x}=$A(),[b,S]=_.useState(!1),[w,E]=_.useState(null),[T,A]=_.useState(null),M=_.useCallback(async()=>{try{const[ie,G]=await Promise.all([CE(t,e,BZ),TZ(t,e)]);o(ie),s(G.jobs),c(G.models),d(G.authenticated),p(null)}catch(ie){p(ie instanceof Error?ie.message:String(ie))}},[t,e]);_.useEffect(()=>{M();const ie=()=>{document.visibilityState==="visible"&&M()};return document.addEventListener("visibilitychange",ie),window.addEventListener("focus",M),()=>{document.removeEventListener("visibilitychange",ie),window.removeEventListener("focus",M)}},[M]);const C=_.useCallback(ie=>{ie.length!==0&&o(G=>{if(G.length===0)return G;const Ve=new Map(ie.map(Re=>[Re.id,Re]));let Ne=!1;const st=G.map(Re=>{const ct=Ve.get(Re.id);return ct?(Ne=!0,{...Re,state:ct.state,metrics:ct.metrics,wandb_run_url:ct.wandb_run_url,checkpoint_count:ct.checkpoint_count}):Re});return Ne?st:G})},[]);pZ(M,C);const P=async ie=>{try{await v4(t,e,ie),n({title:"Job stopping"}),M()}catch(G){n({title:"Stop failed",description:G instanceof Error?G.message:String(G),variant:"destructive"})}},R=(ie,G)=>{E(ie),A(G),S(!0)},D=async ie=>{try{await y4(t,e,ie),n({title:"Job removed"}),M()}catch(G){n({title:"Delete failed",description:G instanceof Error?G.message:String(G),variant:"destructive"})}},k=async ie=>{if(ie.provider!=="seeed_cloud"){ie.url&&window.open(ie.url,"_blank","noopener,noreferrer");return}try{m(ie.id);const G=await bZ(t,e,"seeed_cloud",ie.id);o(Ve=>Ve.some(Ne=>Ne.id===G.id)?Ve:[G,...Ve]),r(`/training/${G.id}`)}catch(G){n({title:"Attach failed",description:G instanceof Error?G.message:String(G),variant:"destructive"})}finally{m(null)}},U=y.trim().toLowerCase(),O=_.useCallback(ie=>!U||(ie??"").toLowerCase().includes(U),[U]),W=_.useMemo(()=>i.filter(ie=>O(ie.name)),[i,O]),L=_.useMemo(()=>a.filter(ie=>O(ie.docker_image??ie.space_id??ie.id)),[a,O]),j=_.useMemo(()=>l.filter(ie=>O(ie.repo_id)),[l,O]),X=_.useMemo(()=>W.filter(ie=>ie.runner==="local"),[W]),K=_.useMemo(()=>W.filter(ie=>ie.runner==="hf_cloud"||ie.runner==="seeed_cloud"),[W]),F=_.useMemo(()=>new Set(K.map(ie=>ie.hf_job_id).filter(ie=>!!ie)),[K]),Y=_.useMemo(()=>L.filter(ie=>ie.provider==="hf_cloud"?!F.has(ie.id):ie.provider==="seeed_cloud"?!K.some(G=>G.external_provider==="seeed_cloud"&&G.external_job_id===ie.id):!0),[L,K,F]),q=_.useMemo(()=>new Set(K.map(ie=>ie.hf_repo_id).filter(ie=>!!ie)),[K]),ee=_.useMemo(()=>j.filter(ie=>!q.has(ie.repo_id)),[j,q]),te=_.useMemo(()=>X.filter(Ag),[X]),Q=_.useMemo(()=>X.filter(ie=>!Ag(ie)),[X]),ce=_.useMemo(()=>K.filter(Ag),[K]),ae=_.useMemo(()=>K.filter(ie=>!Ag(ie)),[K]),fe=_.useMemo(()=>Y.filter(IN),[Y]),we=_.useMemo(()=>Y.filter(ie=>!IN(ie)),[Y]),le=Q.length+ae.length+we.length;return h.jsxs("section",{className:"space-y-6",children:[h.jsxs("div",{className:"flex items-center justify-between gap-3",children:[h.jsx("h2",{className:"text-lg font-semibold text-white",children:"Jobs"}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs("div",{className:"relative",children:[h.jsx(oA,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-slate-400 pointer-events-none"}),h.jsx(hi,{value:y,onChange:ie=>v(ie.target.value),placeholder:"Search jobs",className:"h-8 w-48 sm:w-60 pl-8 bg-slate-800/50 border-slate-700 text-sm text-white placeholder:text-slate-500","aria-label":"Search jobs"})]}),h.jsx(et,{variant:"ghost",size:"icon",onClick:M,className:"h-7 w-7 text-slate-400 hover:text-white","aria-label":"Refresh jobs",children:h.jsx(kU,{className:"w-4 h-4"})})]})]}),f?h.jsxs("p",{className:"text-sm text-red-300",children:["Couldn't load jobs: ",f]}):null,h.jsxs("div",{className:"space-y-3",children:[h.jsx("h3",{className:"text-sm font-semibold uppercase tracking-wide text-slate-400",children:"Local jobs"}),te.length===0?h.jsx("p",{className:"text-sm text-slate-500",children:U?"No local jobs match your search.":"No active local jobs. Start one from the Training page."}):h.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:te.map(ie=>h.jsx(Mg,{job:ie,onStop:P,onDelete:D,onPlay:R},ie.id))})]}),h.jsx("div",{className:"border-t border-slate-700"}),h.jsxs("div",{className:"space-y-3",children:[h.jsx("h3",{className:"text-sm font-semibold uppercase tracking-wide text-slate-400",children:"Online jobs"}),!u&&K.length===0?h.jsx("p",{className:"text-sm text-slate-500",children:"Sign in with Hugging Face to see your cloud jobs."}):ce.length===0&&fe.length===0&&ee.length===0?h.jsx("p",{className:"text-sm text-slate-500",children:U?"No online jobs match your search.":"No active cloud jobs."}):h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[ce.map(ie=>h.jsx(Mg,{job:ie,onStop:P,onDelete:D,onPlay:R},ie.id)),fe.map(ie=>h.jsx(NN,{job:ie,onOpen:k,busy:g===ie.id},ie.id)),ee.map(ie=>h.jsx(IZ,{model:ie},ie.repo_id))]})]}),le>0?h.jsxs(Ty,{children:[h.jsxs(My,{className:"group flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wide text-slate-400 hover:text-white transition-colors",children:[h.jsx(bp,{className:"w-3.5 h-3.5 transition-transform group-data-[state=open]:rotate-90"}),"Untracked (",le,")"]}),h.jsx(Ay,{className:"pt-3",children:h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[Q.map(ie=>h.jsx(Mg,{job:ie,onStop:P,onDelete:D,onPlay:R},ie.id)),ae.map(ie=>h.jsx(Mg,{job:ie,onStop:P,onDelete:D,onPlay:R},ie.id)),we.map(ie=>h.jsx(NN,{job:ie,onOpen:k,busy:g===ie.id},ie.id))]})})]}):null,w?h.jsx(x4,{open:b,onOpenChange:S,robot:x,jobId:w.id,initialStep:T}):null]})},DN="uv tool install git+https://github.com/huggingface/leLab.git && lelab",HZ="http://localhost:8000/",VZ=({open:t,onOpenChange:e,dismissible:n=!0})=>{const[r,i]=_.useState(!1),o=s=>{n||s.preventDefault()},a=async()=>{try{await navigator.clipboard.writeText(DN),i(!0),setTimeout(()=>i(!1),1500)}catch(s){console.warn("Clipboard write failed:",s)}};return h.jsx(Hc,{open:t,onOpenChange:n?e:()=>{},children:h.jsxs(bl,{className:"bg-gray-900 border-gray-700 text-gray-300 sm:max-w-xl",hideClose:!n,onEscapeKeyDown:o,onPointerDownOutside:o,onInteractOutside:o,children:[h.jsxs(_l,{className:"text-center sm:text-center min-w-0",children:[h.jsxs(wl,{className:"text-white flex items-center justify-center gap-2 text-xl",children:[h.jsx(aX,{className:"w-6 h-6"}),"Get Started with LeLab"]}),h.jsx(Sl,{children:"LeLab runs on your machine. Click the command to copy it, then paste in a terminal:"})]}),h.jsxs("div",{className:"space-y-4 py-2 min-w-0",children:[h.jsxs("button",{type:"button",onClick:a,"aria-label":"Copy command to clipboard",className:"group relative w-full bg-gray-800 hover:bg-gray-750 rounded-lg border border-gray-700 hover:border-gray-600 text-left transition-colors cursor-pointer",children:[h.jsx("pre",{className:"p-4 pr-12 text-xs sm:text-sm overflow-x-auto whitespace-pre-wrap break-all",children:h.jsx("code",{className:"text-green-400",children:DN})}),h.jsx("span",{className:"absolute right-2 top-2 flex items-center gap-1 px-2 py-1 rounded text-xs text-gray-400 group-hover:text-white bg-gray-900/80",children:r?h.jsxs(h.Fragment,{children:[h.jsx(xl,{className:"w-3.5 h-3.5 text-green-400"}),"Copied"]}):h.jsxs(h.Fragment,{children:[h.jsx(rA,{className:"w-3.5 h-3.5"}),"Copy"]})})]}),h.jsx("p",{className:"text-gray-400 text-sm text-center",children:"After running, your browser will open the local LeLab app."}),h.jsx(et,{asChild:!0,className:"w-full bg-blue-600 hover:bg-blue-700 text-white",children:h.jsxs("a",{href:HZ,target:"_blank",rel:"noopener noreferrer",children:[h.jsx(cl,{className:"w-4 h-4 mr-2"}),"Open LeLab"]})})]})]})})};async function b4(t,e,n){return er(t,e,"/datasets",{signal:n,action:"List datasets"})}const GZ=()=>{const{baseUrl:t,fetchWithHeaders:e}=Dn(),[n,r]=_.useState([]),[i,o]=_.useState(!0),a=_.useCallback(()=>{o(!0),b4(t,e).then(r).catch(()=>r([])).finally(()=>o(!1))},[t,e]);return _.useEffect(()=>{a()},[a]),{datasets:n,loading:i,refresh:a}},WZ=()=>typeof window<"u"&&window.location.hostname.endsWith(".hf.space"),LN=WZ(),XZ=()=>{const[t,e]=_.useState(LN),{auth:n}=xf(),{selectedName:r,selectedRecord:i,availableNames:o,isLoading:a,selectRobot:s,createRobot:l,deleteRobot:c}=$A(),{datasets:u,loading:d}=GZ(),[f,p]=_.useState(!1),[y,v]=_.useState(""),[g,m]=_.useState(""),[x,b]=_.useState(5),[S,w]=_.useState(60),[E,T]=_.useState(15),[A,M]=_.useState(!0),[C,P]=_.useState([]),R=_.useRef(null),D=ji(),{toast:k}=Dr();_.useEffect(()=>{C.length>0&&(R.current&&R.current(),P([]))},[]),_.useEffect(()=>()=>{R.current&&R.current()},[]);const U=()=>{P(i?[...i.cameras??[]]:[]),p(!0)},O=Y=>{p(Y),!Y&&R.current&&R.current()},W=()=>D("/training"),L=(Y,q)=>{const ee=`/spaces/lerobot/visualize_dataset?path=${encodeURIComponent(`/${Y}`)}`,te=q?`https://huggingface.co/login?next=${encodeURIComponent(ee)}`:`https://huggingface.co${ee}`;window.open(te,"_blank","noopener,noreferrer")},j=Y=>{if(Y.source==="local"||Y.source==="both"){D("/upload",{state:{datasetInfo:{dataset_repo_id:Y.repo_id,source:Y.source}}});return}L(Y.repo_id,Y.private)},X=Y=>{L(Y,!0)},K=Y=>{v(Y),U()},F=async()=>{if(!i){k({title:"No robot selected",description:"Select or create a robot on the Landing page first.",variant:"destructive"});return}const Y=i;if(!Y.is_clean){k({title:"Robot not ready",description:`${Y.name} is missing a calibration. Configure it before recording.`,variant:"destructive"});return}if(!y||!g){k({title:"Missing dataset details",description:"Please enter a dataset name and task description.",variant:"destructive"});return}const q=n.status==="authenticated"?`${n.username}/${y}`:y;C.length>0&&R.current&&(k({title:"Preparing Camera Resources",description:`Releasing ${C.length} camera stream(s) for recording...`}),R.current(),await new Promise(Q=>setTimeout(Q,500)),k({title:"Camera Resources Ready",description:"Camera streams released successfully. Starting recording..."}));const ee=C.reduce((Q,ce)=>(Q[ce.name]={type:ce.type,camera_index:ce.camera_index,width:ce.width,height:ce.height,fps:ce.fps},Q),{}),te={leader_port:Y.leader_port,follower_port:Y.follower_port,leader_config:Y.leader_config,follower_config:Y.follower_config,dataset_repo_id:q,single_task:g,num_episodes:x,episode_time_s:S,reset_time_s:E,fps:30,video:!0,push_to_hub:!1,resume:!1,streaming_encoding:A,cameras:ee};p(!1),D("/recording",{state:{recordingConfig:te}})};return h.jsxs("div",{className:"min-h-screen bg-black text-white pb-16",style:{"--lelab-topbar-h":"48px"},children:[h.jsx(iK,{}),h.jsx("div",{className:"sticky z-20 bg-black/95 backdrop-blur supports-[backdrop-filter]:bg-black/70 border-b border-gray-800",style:{top:"var(--lelab-topbar-h)"},children:h.jsxs("div",{className:"mx-auto max-w-7xl px-4 py-4 grid gap-4 grid-cols-1 lg:grid-cols-[1.2fr_2fr]",children:[h.jsx(xJ,{selectedName:r,selectedRecord:i,availableNames:o,isLoading:a,selectRobot:s,createRobot:l,deleteRobot:c}),h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[h.jsxs("div",{className:"bg-gray-800 rounded-lg border border-gray-700 p-3 flex flex-col gap-2",children:[h.jsx("h3",{className:"font-semibold text-lg text-left h-10 flex items-center",children:"Dataset"}),h.jsx(hZ,{datasets:u,loading:d,onPickExisting:j,onOpenCustom:X,onCreateNew:K,children:h.jsxs(et,{variant:"outline",role:"combobox",className:"w-full justify-between bg-gray-800 border-gray-600 text-white hover:bg-gray-700",children:[h.jsx("span",{className:"truncate text-gray-300",children:d?"Loading datasetsโ€ฆ":"Select or create a datasetโ€ฆ"}),h.jsx(tA,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})})]}),h.jsxs("div",{className:"bg-gray-800 rounded-lg border border-gray-700 p-3 flex flex-col gap-2",children:[h.jsx("h3",{className:"font-semibold text-lg text-left h-10 flex items-center",children:"Create a model"}),h.jsx(et,{onClick:W,className:"w-full bg-green-500 hover:bg-green-600 text-white",children:"Training"})]})]})]})}),h.jsx("main",{className:"mx-auto max-w-7xl px-4 py-6",children:h.jsx(zZ,{})}),h.jsx(sK,{}),h.jsx(VZ,{open:t,onOpenChange:e,dismissible:!LN}),h.jsx(uZ,{open:f,onOpenChange:O,robot:i,datasetName:y,setDatasetName:v,singleTask:g,setSingleTask:m,numEpisodes:x,setNumEpisodes:b,episodeTimeS:S,setEpisodeTimeS:w,resetTimeS:E,setResetTimeS:T,streamingEncoding:A,setStreamingEncoding:M,cameras:C,setCameras:P,onStart:F,releaseStreamsRef:R})]})};/** +For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return _.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},eK="DialogDescriptionWarning",tK=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${EF(eK).contentName}}.`;return _.useEffect(()=>{var o;const i=(o=t.current)==null?void 0:o.getAttribute("aria-describedby");e&&i&&(document.getElementById(e)||console.warn(r))},[r,t,e]),null},hA=uF,nK=fF,pA=pF,dx=mF,fx=gF,mA=yF,gA=bF,vA=wF;const Hc=hA,rK=pA,TF=_.forwardRef(({className:t,...e},n)=>h.jsx(dx,{ref:n,className:He("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e}));TF.displayName=dx.displayName;const bl=_.forwardRef(({className:t,children:e,hideClose:n,...r},i)=>h.jsxs(rK,{children:[h.jsx(TF,{}),h.jsxs(fx,{ref:i,className:He("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...r,children:[e,!n&&h.jsxs(vA,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[h.jsx(ax,{className:"h-4 w-4"}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));bl.displayName=fx.displayName;const _l=({className:t,...e})=>h.jsx("div",{className:He("flex flex-col space-y-1.5 text-center sm:text-left",t),...e});_l.displayName="DialogHeader";const MF=({className:t,...e})=>h.jsx("div",{className:He("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});MF.displayName="DialogFooter";const wl=_.forwardRef(({className:t,...e},n)=>h.jsx(mA,{ref:n,className:He("text-lg font-semibold leading-none tracking-tight",t),...e}));wl.displayName=mA.displayName;const Sl=_.forwardRef(({className:t,...e},n)=>h.jsx(gA,{ref:n,className:He("text-sm text-muted-foreground",t),...e}));Sl.displayName=gA.displayName;const iK=({open:t,onOpenChange:e})=>{const{auth:n,refetch:r}=xf(),[i,o]=_.useState(!1),[a,s]=_.useState(!1);if(n.status!=="unauthenticated")return null;const l=async()=>{try{await navigator.clipboard.writeText(n.loginCommand),o(!0),setTimeout(()=>o(!1),1500)}catch(u){console.warn("Clipboard write failed:",u)}},c=async()=>{s(!0);try{await r()}finally{s(!1)}};return h.jsx(Hc,{open:t,onOpenChange:e,children:h.jsxs(bl,{className:"bg-gray-900 border-gray-800 text-white",children:[h.jsxs(_l,{children:[h.jsx(wl,{className:"text-amber-200",children:"Hugging Face CLI not configured"}),h.jsx(Sl,{className:"text-gray-400",children:"Uploads, training, and replay-from-Hub require a logged-in HF CLI. Run this in a terminal:"})]}),h.jsxs("pre",{className:"bg-gray-950 p-3 rounded border border-gray-700 text-xs sm:text-sm overflow-x-auto flex items-center justify-between gap-2",children:[h.jsx("code",{className:"text-green-400",children:n.loginCommand}),h.jsx("button",{type:"button",onClick:l,className:"flex-shrink-0 text-gray-400 hover:text-gray-200 transition-colors","aria-label":"Copy command",children:i?h.jsx(xl,{className:"w-4 h-4 text-green-400"}):h.jsx(rA,{className:"w-4 h-4"})})]}),h.jsxs(Je,{variant:"outline",size:"sm",onClick:c,disabled:a,className:"border-amber-700 bg-transparent text-amber-100 hover:bg-amber-900/40 hover:text-amber-50",children:[h.jsx(oA,{className:`w-4 h-4 mr-2 ${a?"animate-spin":""}`}),"I've logged in โ€” recheck"]})]})})},oK=()=>{const{auth:t}=xf(),[e,n]=_.useState(!1);return t.status==="loading"?h.jsxs("div",{className:"inline-flex items-center gap-2 rounded-full border border-gray-800 bg-gray-900/60 px-3 py-1 text-xs text-gray-400",children:[h.jsx(fi,{className:"w-3 h-3 animate-spin"}),h.jsx("span",{children:"Checking HFโ€ฆ"})]}):t.status==="authenticated"?h.jsxs("div",{className:"inline-flex items-center gap-2 rounded-full border border-gray-800 bg-gray-900/60 px-3 py-1 text-xs text-gray-200",title:"Hugging Face authenticated",children:[h.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-400","aria-hidden":"true"}),h.jsx("span",{children:t.username})]}):h.jsxs(h.Fragment,{children:[h.jsxs("button",{type:"button",onClick:()=>n(!0),className:"inline-flex items-center gap-2 rounded-full border border-amber-700/60 bg-amber-950/40 px-3 py-1 text-xs text-amber-100 hover:bg-amber-900/40 transition-colors","aria-label":"Hugging Face not configured โ€” show login instructions",children:[h.jsx("span",{className:"h-2 w-2 rounded-full bg-amber-400","aria-hidden":"true"}),h.jsx("span",{children:"HF not configured"})]}),h.jsx(iK,{open:e,onOpenChange:n})]})},aK=()=>h.jsx("header",{className:"sticky top-0 z-30 w-full border-b border-gray-800 bg-black/95 backdrop-blur supports-[backdrop-filter]:bg-black/70",children:h.jsxs("div",{className:"mx-auto flex h-12 max-w-7xl items-center justify-between px-4",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("img",{src:"/lovable-uploads/5e648747-34b7-4d8f-93fd-4dbd00aeeefc.png",alt:"LeLab",className:"h-7 w-7"}),h.jsx("span",{className:"text-base font-semibold tracking-tight text-white",children:"LeLab"})]}),h.jsx(oK,{})]})}),sK=({className:t})=>h.jsx("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",className:t,children:h.jsx("path",{d:"M20.317 4.369A19.79 19.79 0 0 0 16.558 3.2a.07.07 0 0 0-.074.035c-.211.375-.444.864-.608 1.249a18.27 18.27 0 0 0-5.487 0 12.51 12.51 0 0 0-.617-1.249.077.077 0 0 0-.074-.035 19.736 19.736 0 0 0-3.76 1.169.07.07 0 0 0-.032.027C2.533 8.046 1.79 11.624 2.155 15.157a.082.082 0 0 0 .031.056 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.027c.462-.63.873-1.295 1.226-1.994a.076.076 0 0 0-.041-.105 13.13 13.13 0 0 1-1.873-.892.077.077 0 0 1-.008-.128c.126-.094.252-.192.372-.291a.074.074 0 0 1 .077-.01c3.927 1.793 8.18 1.793 12.061 0a.074.074 0 0 1 .078.009c.12.099.246.198.373.292a.077.077 0 0 1-.006.128 12.32 12.32 0 0 1-1.873.891.077.077 0 0 0-.04.106c.36.698.772 1.363 1.225 1.993a.076.076 0 0 0 .084.028 19.84 19.84 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-4.087-.838-7.636-3.548-10.787a.061.061 0 0 0-.031-.028zM8.02 12.997c-1.182 0-2.156-1.085-2.156-2.419 0-1.333.955-2.419 2.156-2.419 1.21 0 2.175 1.095 2.156 2.42 0 1.333-.955 2.418-2.156 2.418zm7.974 0c-1.182 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.175 1.095 2.156 2.42 0 1.333-.946 2.418-2.156 2.418z"})}),lK=[{href:"https://github.com/huggingface/lerobot",label:"GitHub",Icon:tX},{href:"https://huggingface.co/docs/lerobot",label:"Documentation",Icon:X9},{href:"https://discord.com/invite/s3KuuzsPFb",label:"Discord",Icon:sK}],cK=()=>h.jsx("footer",{className:"fixed inset-x-0 bottom-0 z-30 border-t border-gray-800 bg-black/95",children:h.jsxs("div",{className:"mx-auto flex max-w-7xl flex-col items-center justify-between gap-3 px-4 py-4 text-sm text-gray-400 sm:flex-row",children:[h.jsxs("span",{children:["Powered by"," ",h.jsx("a",{href:"https://github.com/huggingface/lerobot",target:"_blank",rel:"noopener noreferrer",className:"font-medium text-gray-200 hover:text-white",children:"LeRobot"})]}),h.jsx("nav",{className:"flex items-center gap-4",children:lK.map(({href:t,label:e,Icon:n})=>h.jsxs("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 text-gray-400 hover:text-white",children:[h.jsx(n,{className:"h-4 w-4"}),h.jsx("span",{children:e})]},e))})]})}),uK=["top","right","bottom","left"],ul=Math.min,Ti=Math.max,_y=Math.round,Tg=Math.floor,ma=t=>({x:t,y:t}),dK={left:"right",right:"left",bottom:"top",top:"bottom"},fK={start:"end",end:"start"};function gE(t,e,n){return Ti(t,ul(e,n))}function os(t,e){return typeof t=="function"?t(e):t}function as(t){return t.split("-")[0]}function bf(t){return t.split("-")[1]}function yA(t){return t==="x"?"y":"x"}function xA(t){return t==="y"?"height":"width"}function aa(t){return["top","bottom"].includes(as(t))?"y":"x"}function bA(t){return yA(aa(t))}function hK(t,e,n){n===void 0&&(n=!1);const r=bf(t),i=bA(t),o=xA(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(a=wy(a)),[a,wy(a)]}function pK(t){const e=wy(t);return[vE(t),e,vE(e)]}function vE(t){return t.replace(/start|end/g,e=>fK[e])}function mK(t,e,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],a=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:r:e?r:i;case"left":case"right":return e?o:a;default:return[]}}function gK(t,e,n,r){const i=bf(t);let o=mK(as(t),n==="start",r);return i&&(o=o.map(a=>a+"-"+i),e&&(o=o.concat(o.map(vE)))),o}function wy(t){return t.replace(/left|right|bottom|top/g,e=>dK[e])}function vK(t){return{top:0,right:0,bottom:0,left:0,...t}}function AF(t){return typeof t!="number"?vK(t):{top:t,right:t,bottom:t,left:t}}function Sy(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function yN(t,e,n){let{reference:r,floating:i}=t;const o=aa(e),a=bA(e),s=xA(a),l=as(e),c=o==="y",u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2;let p;switch(l){case"top":p={x:u,y:r.y-i.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(bf(e)){case"start":p[a]-=f*(n&&c?-1:1);break;case"end":p[a]+=f*(n&&c?-1:1);break}return p}const yK=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=o.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(e));let c=await a.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:d}=yN(c,r,l),f=r,p={},y=0;for(let v=0;v({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:o,platform:a,elements:s,middlewareData:l}=e,{element:c,padding:u=0}=os(t,e)||{};if(c==null)return{};const d=AF(u),f={x:n,y:r},p=bA(i),y=xA(p),v=await a.getDimensions(c),g=p==="y",m=g?"top":"left",x=g?"bottom":"right",b=g?"clientHeight":"clientWidth",S=o.reference[y]+o.reference[p]-f[p]-o.floating[y],w=f[p]-o.reference[p],E=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c));let T=E?E[b]:0;(!T||!await(a.isElement==null?void 0:a.isElement(E)))&&(T=s.floating[b]||o.floating[y]);const A=S/2-w/2,M=T/2-v[y]/2-1,C=ul(d[m],M),P=ul(d[x],M),R=C,D=T-v[y]-P,k=T/2-v[y]/2+A,U=gE(R,k,D),O=!l.arrow&&bf(i)!=null&&k!==U&&o.reference[y]/2-(kk<=0)){var P,R;const k=(((P=o.flip)==null?void 0:P.index)||0)+1,U=T[k];if(U&&(!(d==="alignment"?x!==aa(U):!1)||C.every(L=>L.overflows[0]>0&&aa(L.placement)===x)))return{data:{index:k,overflows:C},reset:{placement:U}};let O=(R=C.filter(X=>X.overflows[0]<=0).sort((X,L)=>X.overflows[1]-L.overflows[1])[0])==null?void 0:R.placement;if(!O)switch(p){case"bestFit":{var D;const X=(D=C.filter(L=>{if(E){const j=aa(L.placement);return j===x||j==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(j=>j>0).reduce((j,K)=>j+K,0)]).sort((L,j)=>L[1]-j[1])[0])==null?void 0:D[0];X&&(O=X);break}case"initialPlacement":O=s;break}if(i!==O)return{reset:{placement:O}}}return{}}}};function xN(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function bN(t){return uK.some(e=>t[e]>=0)}const _K=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...i}=os(t,e);switch(r){case"referenceHidden":{const o=await _p(e,{...i,elementContext:"reference"}),a=xN(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:bN(a)}}}case"escaped":{const o=await _p(e,{...i,altBoundary:!0}),a=xN(o,n.floating);return{data:{escapedOffsets:a,escaped:bN(a)}}}default:return{}}}}};async function wK(t,e){const{placement:n,platform:r,elements:i}=t,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=as(n),s=bf(n),l=aa(n)==="y",c=["left","top"].includes(a)?-1:1,u=o&&l?-1:1,d=os(e,t);let{mainAxis:f,crossAxis:p,alignmentAxis:y}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof y=="number"&&(p=s==="end"?y*-1:y),l?{x:p*u,y:f*c}:{x:f*c,y:p*u}}const SK=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:o,placement:a,middlewareData:s}=e,l=await wK(e,t);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:a}}}}},EK=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:g=>{let{x:m,y:x}=g;return{x:m,y:x}}},...l}=os(t,e),c={x:n,y:r},u=await _p(e,l),d=aa(as(i)),f=yA(d);let p=c[f],y=c[d];if(o){const g=f==="y"?"top":"left",m=f==="y"?"bottom":"right",x=p+u[g],b=p-u[m];p=gE(x,p,b)}if(a){const g=d==="y"?"top":"left",m=d==="y"?"bottom":"right",x=y+u[g],b=y-u[m];y=gE(x,y,b)}const v=s.fn({...e,[f]:p,[d]:y});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[f]:o,[d]:a}}}}}},TK=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=e,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=os(t,e),u={x:n,y:r},d=aa(i),f=yA(d);let p=u[f],y=u[d];const v=os(s,e),g=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(l){const b=f==="y"?"height":"width",S=o.reference[f]-o.floating[b]+g.mainAxis,w=o.reference[f]+o.reference[b]-g.mainAxis;pw&&(p=w)}if(c){var m,x;const b=f==="y"?"width":"height",S=["top","left"].includes(as(i)),w=o.reference[d]-o.floating[b]+(S&&((m=a.offset)==null?void 0:m[d])||0)+(S?0:g.crossAxis),E=o.reference[d]+o.reference[b]+(S?0:((x=a.offset)==null?void 0:x[d])||0)-(S?g.crossAxis:0);yE&&(y=E)}return{[f]:p,[d]:y}}}},MK=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:o,platform:a,elements:s}=e,{apply:l=()=>{},...c}=os(t,e),u=await _p(e,c),d=as(i),f=bf(i),p=aa(i)==="y",{width:y,height:v}=o.floating;let g,m;d==="top"||d==="bottom"?(g=d,m=f===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(m=d,g=f==="end"?"top":"bottom");const x=v-u.top-u.bottom,b=y-u.left-u.right,S=ul(v-u[g],x),w=ul(y-u[m],b),E=!e.middlewareData.shift;let T=S,A=w;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(A=b),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(T=x),E&&!f){const C=Ti(u.left,0),P=Ti(u.right,0),R=Ti(u.top,0),D=Ti(u.bottom,0);p?A=y-2*(C!==0||P!==0?C+P:Ti(u.left,u.right)):T=v-2*(R!==0||D!==0?R+D:Ti(u.top,u.bottom))}await l({...e,availableWidth:A,availableHeight:T});const M=await a.getDimensions(s.floating);return y!==M.width||v!==M.height?{reset:{rects:!0}}:{}}}};function hx(){return typeof window<"u"}function _f(t){return CF(t)?(t.nodeName||"").toLowerCase():"#document"}function Ni(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Sa(t){var e;return(e=(CF(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function CF(t){return hx()?t instanceof Node||t instanceof Ni(t).Node:!1}function Ho(t){return hx()?t instanceof Element||t instanceof Ni(t).Element:!1}function xa(t){return hx()?t instanceof HTMLElement||t instanceof Ni(t).HTMLElement:!1}function _N(t){return!hx()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Ni(t).ShadowRoot}function Am(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=Vo(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function AK(t){return["table","td","th"].includes(_f(t))}function px(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function _A(t){const e=wA(),n=Ho(t)?Vo(t):t;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function CK(t){let e=dl(t);for(;xa(e)&&!Id(e);){if(_A(e))return e;if(px(e))return null;e=dl(e)}return null}function wA(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Id(t){return["html","body","#document"].includes(_f(t))}function Vo(t){return Ni(t).getComputedStyle(t)}function mx(t){return Ho(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function dl(t){if(_f(t)==="html")return t;const e=t.assignedSlot||t.parentNode||_N(t)&&t.host||Sa(t);return _N(e)?e.host:e}function PF(t){const e=dl(t);return Id(e)?t.ownerDocument?t.ownerDocument.body:t.body:xa(e)&&Am(e)?e:PF(e)}function wp(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=PF(t),o=i===((r=t.ownerDocument)==null?void 0:r.body),a=Ni(i);if(o){const s=yE(a);return e.concat(a,a.visualViewport||[],Am(i)?i:[],s&&n?wp(s):[])}return e.concat(i,wp(i,[],n))}function yE(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function RF(t){const e=Vo(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=xa(t),o=i?t.offsetWidth:n,a=i?t.offsetHeight:r,s=_y(n)!==o||_y(r)!==a;return s&&(n=o,r=a),{width:n,height:r,$:s}}function SA(t){return Ho(t)?t:t.contextElement}function od(t){const e=SA(t);if(!xa(e))return ma(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:o}=RF(e);let a=(o?_y(n.width):n.width)/r,s=(o?_y(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const PK=ma(0);function NF(t){const e=Ni(t);return!wA()||!e.visualViewport?PK:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function RK(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Ni(t)?!1:e}function Ac(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),o=SA(t);let a=ma(1);e&&(r?Ho(r)&&(a=od(r)):a=od(t));const s=RK(o,n,r)?NF(o):ma(0);let l=(i.left+s.x)/a.x,c=(i.top+s.y)/a.y,u=i.width/a.x,d=i.height/a.y;if(o){const f=Ni(o),p=r&&Ho(r)?Ni(r):r;let y=f,v=yE(y);for(;v&&r&&p!==y;){const g=od(v),m=v.getBoundingClientRect(),x=Vo(v),b=m.left+(v.clientLeft+parseFloat(x.paddingLeft))*g.x,S=m.top+(v.clientTop+parseFloat(x.paddingTop))*g.y;l*=g.x,c*=g.y,u*=g.x,d*=g.y,l+=b,c+=S,y=Ni(v),v=yE(y)}}return Sy({width:u,height:d,x:l,y:c})}function EA(t,e){const n=mx(t).scrollLeft;return e?e.left+n:Ac(Sa(t)).left+n}function OF(t,e,n){n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=r.left+e.scrollLeft-(n?0:EA(t,r)),o=r.top+e.scrollTop;return{x:i,y:o}}function NK(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const o=i==="fixed",a=Sa(r),s=e?px(e.floating):!1;if(r===a||s&&o)return n;let l={scrollLeft:0,scrollTop:0},c=ma(1);const u=ma(0),d=xa(r);if((d||!d&&!o)&&((_f(r)!=="body"||Am(a))&&(l=mx(r)),xa(r))){const p=Ac(r);c=od(r),u.x=p.x+r.clientLeft,u.y=p.y+r.clientTop}const f=a&&!d&&!o?OF(a,l,!0):ma(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}}function OK(t){return Array.from(t.getClientRects())}function IK(t){const e=Sa(t),n=mx(t),r=t.ownerDocument.body,i=Ti(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=Ti(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+EA(t);const s=-n.scrollTop;return Vo(r).direction==="rtl"&&(a+=Ti(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:s}}function DK(t,e){const n=Ni(t),r=Sa(t),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;const c=wA();(!c||c&&e==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s,y:l}}function LK(t,e){const n=Ac(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,o=xa(t)?od(t):ma(1),a=t.clientWidth*o.x,s=t.clientHeight*o.y,l=i*o.x,c=r*o.y;return{width:a,height:s,x:l,y:c}}function wN(t,e,n){let r;if(e==="viewport")r=DK(t,n);else if(e==="document")r=IK(Sa(t));else if(Ho(e))r=LK(e,n);else{const i=NF(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Sy(r)}function IF(t,e){const n=dl(t);return n===e||!Ho(n)||Id(n)?!1:Vo(n).position==="fixed"||IF(n,e)}function kK(t,e){const n=e.get(t);if(n)return n;let r=wp(t,[],!1).filter(s=>Ho(s)&&_f(s)!=="body"),i=null;const o=Vo(t).position==="fixed";let a=o?dl(t):t;for(;Ho(a)&&!Id(a);){const s=Vo(a),l=_A(a);!l&&s.position==="fixed"&&(i=null),(o?!l&&!i:!l&&s.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Am(a)&&!l&&IF(t,a))?r=r.filter(u=>u!==a):i=s,a=dl(a)}return e.set(t,r),r}function jK(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const a=[...n==="clippingAncestors"?px(e)?[]:kK(e,this._c):[].concat(n),r],s=a[0],l=a.reduce((c,u)=>{const d=wN(e,u,i);return c.top=Ti(d.top,c.top),c.right=ul(d.right,c.right),c.bottom=ul(d.bottom,c.bottom),c.left=Ti(d.left,c.left),c},wN(e,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function UK(t){const{width:e,height:n}=RF(t);return{width:e,height:n}}function FK(t,e,n){const r=xa(e),i=Sa(e),o=n==="fixed",a=Ac(t,!0,o,e);let s={scrollLeft:0,scrollTop:0};const l=ma(0);function c(){l.x=EA(i)}if(r||!r&&!o)if((_f(e)!=="body"||Am(i))&&(s=mx(e)),r){const p=Ac(e,!0,o,e);l.x=p.x+e.clientLeft,l.y=p.y+e.clientTop}else i&&c();o&&!r&&i&&c();const u=i&&!r&&!o?OF(i,s):ma(0),d=a.left+s.scrollLeft-l.x-u.x,f=a.top+s.scrollTop-l.y-u.y;return{x:d,y:f,width:a.width,height:a.height}}function B_(t){return Vo(t).position==="static"}function SN(t,e){if(!xa(t)||Vo(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Sa(t)===n&&(n=n.ownerDocument.body),n}function DF(t,e){const n=Ni(t);if(px(t))return n;if(!xa(t)){let i=dl(t);for(;i&&!Id(i);){if(Ho(i)&&!B_(i))return i;i=dl(i)}return n}let r=SN(t,e);for(;r&&AK(r)&&B_(r);)r=SN(r,e);return r&&Id(r)&&B_(r)&&!_A(r)?n:r||CK(t)||n}const BK=async function(t){const e=this.getOffsetParent||DF,n=this.getDimensions,r=await n(t.floating);return{reference:FK(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function $K(t){return Vo(t).direction==="rtl"}const zK={convertOffsetParentRelativeRectToViewportRelativeRect:NK,getDocumentElement:Sa,getClippingRect:jK,getOffsetParent:DF,getElementRects:BK,getClientRects:OK,getDimensions:UK,getScale:od,isElement:Ho,isRTL:$K};function LF(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function HK(t,e){let n=null,r;const i=Sa(t);function o(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function a(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),o();const c=t.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=c;if(s||e(),!f||!p)return;const y=Tg(d),v=Tg(i.clientWidth-(u+f)),g=Tg(i.clientHeight-(d+p)),m=Tg(u),b={rootMargin:-y+"px "+-v+"px "+-g+"px "+-m+"px",threshold:Ti(0,ul(1,l))||1};let S=!0;function w(E){const T=E[0].intersectionRatio;if(T!==l){if(!S)return a();T?a(!1,T):r=setTimeout(()=>{a(!1,1e-7)},1e3)}T===1&&!LF(c,t.getBoundingClientRect())&&a(),S=!1}try{n=new IntersectionObserver(w,{...b,root:i.ownerDocument})}catch{n=new IntersectionObserver(w,b)}n.observe(t)}return a(!0),o}function VK(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=SA(t),u=i||o?[...c?wp(c):[],...wp(e)]:[];u.forEach(m=>{i&&m.addEventListener("scroll",n,{passive:!0}),o&&m.addEventListener("resize",n)});const d=c&&s?HK(c,n):null;let f=-1,p=null;a&&(p=new ResizeObserver(m=>{let[x]=m;x&&x.target===c&&p&&(p.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var b;(b=p)==null||b.observe(e)})),n()}),c&&!l&&p.observe(c),p.observe(e));let y,v=l?Ac(t):null;l&&g();function g(){const m=Ac(t);v&&!LF(v,m)&&n(),v=m,y=requestAnimationFrame(g)}return n(),()=>{var m;u.forEach(x=>{i&&x.removeEventListener("scroll",n),o&&x.removeEventListener("resize",n)}),d==null||d(),(m=p)==null||m.disconnect(),p=null,l&&cancelAnimationFrame(y)}}const GK=SK,WK=EK,XK=bK,qK=MK,KK=_K,EN=xK,YK=TK,JK=(t,e,n)=>{const r=new Map,i={platform:zK,...n},o={...i.platform,_c:r};return yK(t,e,{...i,platform:o})};var ZK=typeof document<"u",QK=function(){},Uv=ZK?_.useLayoutEffect:QK;function Ey(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!Ey(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&t.$$typeof)&&!Ey(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function kF(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function TN(t,e){const n=kF(t);return Math.round(e*n)/n}function $_(t){const e=_.useRef(t);return Uv(()=>{e.current=t}),e}function eY(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:a}={},transform:s=!0,whileElementsMounted:l,open:c}=t,[u,d]=_.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[f,p]=_.useState(r);Ey(f,r)||p(r);const[y,v]=_.useState(null),[g,m]=_.useState(null),x=_.useCallback(L=>{L!==E.current&&(E.current=L,v(L))},[]),b=_.useCallback(L=>{L!==T.current&&(T.current=L,m(L))},[]),S=o||y,w=a||g,E=_.useRef(null),T=_.useRef(null),A=_.useRef(u),M=l!=null,C=$_(l),P=$_(i),R=$_(c),D=_.useCallback(()=>{if(!E.current||!T.current)return;const L={placement:e,strategy:n,middleware:f};P.current&&(L.platform=P.current),JK(E.current,T.current,L).then(j=>{const K={...j,isPositioned:R.current!==!1};k.current&&!Ey(A.current,K)&&(A.current=K,Bc.flushSync(()=>{d(K)}))})},[f,e,n,P,R]);Uv(()=>{c===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,d(L=>({...L,isPositioned:!1})))},[c]);const k=_.useRef(!1);Uv(()=>(k.current=!0,()=>{k.current=!1}),[]),Uv(()=>{if(S&&(E.current=S),w&&(T.current=w),S&&w){if(C.current)return C.current(S,w,D);D()}},[S,w,D,C,M]);const U=_.useMemo(()=>({reference:E,floating:T,setReference:x,setFloating:b}),[x,b]),O=_.useMemo(()=>({reference:S,floating:w}),[S,w]),X=_.useMemo(()=>{const L={position:n,left:0,top:0};if(!O.floating)return L;const j=TN(O.floating,u.x),K=TN(O.floating,u.y);return s?{...L,transform:"translate("+j+"px, "+K+"px)",...kF(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:j,top:K}},[n,s,O.floating,u.x,u.y]);return _.useMemo(()=>({...u,update:D,refs:U,elements:O,floatingStyles:X}),[u,D,U,O,X])}const tY=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:i}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?EN({element:r.current,padding:i}).fn(n):{}:r?EN({element:r,padding:i}).fn(n):{}}}},nY=(t,e)=>({...GK(t),options:[t,e]}),rY=(t,e)=>({...WK(t),options:[t,e]}),iY=(t,e)=>({...YK(t),options:[t,e]}),oY=(t,e)=>({...XK(t),options:[t,e]}),aY=(t,e)=>({...qK(t),options:[t,e]}),sY=(t,e)=>({...KK(t),options:[t,e]}),lY=(t,e)=>({...tY(t),options:[t,e]});var cY="Arrow",jF=_.forwardRef((t,e)=>{const{children:n,width:r=10,height:i=5,...o}=t;return h.jsx(nt.svg,{...o,ref:e,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:h.jsx("polygon",{points:"0,0 30,0 15,10"})})});jF.displayName=cY;var uY=jF;function TA(t){const[e,n]=_.useState(void 0);return ur(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,s;if("borderBoxSize"in o){const l=o.borderBoxSize,c=Array.isArray(l)?l[0]:l;a=c.inlineSize,s=c.blockSize}else a=t.offsetWidth,s=t.offsetHeight;n({width:a,height:s})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var MA="Popper",[UF,El]=mi(MA),[dY,FF]=UF(MA),BF=t=>{const{__scopePopper:e,children:n}=t,[r,i]=_.useState(null);return h.jsx(dY,{scope:e,anchor:r,onAnchorChange:i,children:n})};BF.displayName=MA;var $F="PopperAnchor",zF=_.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...i}=t,o=FF($F,n),a=_.useRef(null),s=Ot(e,a);return _.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:h.jsx(nt.div,{...i,ref:s})});zF.displayName=$F;var AA="PopperContent",[fY,hY]=UF(AA),HF=_.forwardRef((t,e)=>{var J,ce,ae,fe,we,le;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:a=0,arrowPadding:s=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:y,...v}=t,g=FF(AA,n),[m,x]=_.useState(null),b=Ot(e,ie=>x(ie)),[S,w]=_.useState(null),E=TA(S),T=(E==null?void 0:E.width)??0,A=(E==null?void 0:E.height)??0,M=r+(o!=="center"?"-"+o:""),C=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},P=Array.isArray(c)?c:[c],R=P.length>0,D={padding:C,boundary:P.filter(mY),altBoundary:R},{refs:k,floatingStyles:U,placement:O,isPositioned:X,middlewareData:L}=eY({strategy:"fixed",placement:M,whileElementsMounted:(...ie)=>VK(...ie,{animationFrame:p==="always"}),elements:{reference:g.anchor},middleware:[nY({mainAxis:i+A,alignmentAxis:a}),l&&rY({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?iY():void 0,...D}),l&&oY({...D}),aY({...D,apply:({elements:ie,rects:W,availableWidth:Ve,availableHeight:Ne})=>{const{width:st,height:Re}=W.reference,ct=ie.floating.style;ct.setProperty("--radix-popper-available-width",`${Ve}px`),ct.setProperty("--radix-popper-available-height",`${Ne}px`),ct.setProperty("--radix-popper-anchor-width",`${st}px`),ct.setProperty("--radix-popper-anchor-height",`${Re}px`)}}),S&&lY({element:S,padding:s}),gY({arrowWidth:T,arrowHeight:A}),f&&sY({strategy:"referenceHidden",...D})]}),[j,K]=WF(O),te=di(y);ur(()=>{X&&(te==null||te())},[X,te]);const H=(J=L.arrow)==null?void 0:J.x,q=(ce=L.arrow)==null?void 0:ce.y,$=((ae=L.arrow)==null?void 0:ae.centerOffset)!==0,[Y,ee]=_.useState();return ur(()=>{m&&ee(window.getComputedStyle(m).zIndex)},[m]),h.jsx("div",{ref:k.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:X?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Y,"--radix-popper-transform-origin":[(fe=L.transformOrigin)==null?void 0:fe.x,(we=L.transformOrigin)==null?void 0:we.y].join(" "),...((le=L.hide)==null?void 0:le.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:h.jsx(fY,{scope:n,placedSide:j,onArrowChange:w,arrowX:H,arrowY:q,shouldHideArrow:$,children:h.jsx(nt.div,{"data-side":j,"data-align":K,...v,ref:b,style:{...v.style,animation:X?void 0:"none"}})})})});HF.displayName=AA;var VF="PopperArrow",pY={top:"bottom",right:"left",bottom:"top",left:"right"},GF=_.forwardRef(function(e,n){const{__scopePopper:r,...i}=e,o=hY(VF,r),a=pY[o.placedSide];return h.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:h.jsx(uY,{...i,ref:n,style:{...i.style,display:"block"}})})});GF.displayName=VF;function mY(t){return t!==null}var gY=t=>({name:"transformOrigin",options:t,fn(e){var g,m,x;const{placement:n,rects:r,middlewareData:i}=e,a=((g=i.arrow)==null?void 0:g.centerOffset)!==0,s=a?0:t.arrowWidth,l=a?0:t.arrowHeight,[c,u]=WF(n),d={start:"0%",center:"50%",end:"100%"}[u],f=(((m=i.arrow)==null?void 0:m.x)??0)+s/2,p=(((x=i.arrow)==null?void 0:x.y)??0)+l/2;let y="",v="";return c==="bottom"?(y=a?d:`${f}px`,v=`${-l}px`):c==="top"?(y=a?d:`${f}px`,v=`${r.floating.height+l}px`):c==="right"?(y=`${-l}px`,v=a?d:`${p}px`):c==="left"&&(y=`${r.floating.width+l}px`,v=a?d:`${p}px`),{data:{x:y,y:v}}}});function WF(t){const[e,n="center"]=t.split("-");return[e,n]}var gx=BF,Cm=zF,vx=HF,yx=GF,[xx,EDe]=mi("Tooltip",[El]),bx=El(),XF="TooltipProvider",vY=700,xE="tooltip.open",[yY,CA]=xx(XF),qF=t=>{const{__scopeTooltip:e,delayDuration:n=vY,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=t,a=_.useRef(!0),s=_.useRef(!1),l=_.useRef(0);return _.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),h.jsx(yY,{scope:e,isOpenDelayedRef:a,delayDuration:n,onOpen:_.useCallback(()=>{window.clearTimeout(l.current),a.current=!1},[]),onClose:_.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:_.useCallback(c=>{s.current=c},[]),disableHoverableContent:i,children:o})};qF.displayName=XF;var Sp="Tooltip",[xY,_x]=xx(Sp),KF=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:i,onOpenChange:o,disableHoverableContent:a,delayDuration:s}=t,l=CA(Sp,t.__scopeTooltip),c=bx(e),[u,d]=_.useState(null),f=sr(),p=_.useRef(0),y=a??l.disableHoverableContent,v=s??l.delayDuration,g=_.useRef(!1),[m,x]=zo({prop:r,defaultProp:i??!1,onChange:T=>{T?(l.onOpen(),document.dispatchEvent(new CustomEvent(xE))):l.onClose(),o==null||o(T)},caller:Sp}),b=_.useMemo(()=>m?g.current?"delayed-open":"instant-open":"closed",[m]),S=_.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,x(!0)},[x]),w=_.useCallback(()=>{window.clearTimeout(p.current),p.current=0,x(!1)},[x]),E=_.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,x(!0),p.current=0},v)},[v,x]);return _.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),h.jsx(gx,{...c,children:h.jsx(xY,{scope:e,contentId:f,open:m,stateAttribute:b,trigger:u,onTriggerChange:d,onTriggerEnter:_.useCallback(()=>{l.isOpenDelayedRef.current?E():S()},[l.isOpenDelayedRef,E,S]),onTriggerLeave:_.useCallback(()=>{y?w():(window.clearTimeout(p.current),p.current=0)},[w,y]),onOpen:S,onClose:w,disableHoverableContent:y,children:n})})};KF.displayName=Sp;var bE="TooltipTrigger",YF=_.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=_x(bE,n),o=CA(bE,n),a=bx(n),s=_.useRef(null),l=Ot(e,s,i.onTriggerChange),c=_.useRef(!1),u=_.useRef(!1),d=_.useCallback(()=>c.current=!1,[]);return _.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),h.jsx(Cm,{asChild:!0,...a,children:h.jsx(nt.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:l,onPointerMove:Oe(t.onPointerMove,f=>{f.pointerType!=="touch"&&!u.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),u.current=!0)}),onPointerLeave:Oe(t.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:Oe(t.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Oe(t.onFocus,()=>{c.current||i.onOpen()}),onBlur:Oe(t.onBlur,i.onClose),onClick:Oe(t.onClick,i.onClose)})})});YF.displayName=bE;var bY="TooltipPortal",[TDe,_Y]=xx(bY,{forceMount:void 0}),Dd="TooltipContent",JF=_.forwardRef((t,e)=>{const n=_Y(Dd,t.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=t,a=_x(Dd,t.__scopeTooltip);return h.jsx(gi,{present:r||a.open,children:a.disableHoverableContent?h.jsx(ZF,{side:i,...o,ref:e}):h.jsx(wY,{side:i,...o,ref:e})})}),wY=_.forwardRef((t,e)=>{const n=_x(Dd,t.__scopeTooltip),r=CA(Dd,t.__scopeTooltip),i=_.useRef(null),o=Ot(e,i),[a,s]=_.useState(null),{trigger:l,onClose:c}=n,u=i.current,{onPointerInTransitChange:d}=r,f=_.useCallback(()=>{s(null),d(!1)},[d]),p=_.useCallback((y,v)=>{const g=y.currentTarget,m={x:y.clientX,y:y.clientY},x=AY(m,g.getBoundingClientRect()),b=CY(m,x),S=PY(v.getBoundingClientRect()),w=NY([...b,...S]);s(w),d(!0)},[d]);return _.useEffect(()=>()=>f(),[f]),_.useEffect(()=>{if(l&&u){const y=g=>p(g,u),v=g=>p(g,l);return l.addEventListener("pointerleave",y),u.addEventListener("pointerleave",v),()=>{l.removeEventListener("pointerleave",y),u.removeEventListener("pointerleave",v)}}},[l,u,p,f]),_.useEffect(()=>{if(a){const y=v=>{const g=v.target,m={x:v.clientX,y:v.clientY},x=(l==null?void 0:l.contains(g))||(u==null?void 0:u.contains(g)),b=!RY(m,a);x?f():b&&(f(),c())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[l,u,a,c,f]),h.jsx(ZF,{...t,ref:o})}),[SY,EY]=xx(Sp,{isInside:!1}),TY=fU("TooltipContent"),ZF=_.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:a,...s}=t,l=_x(Dd,n),c=bx(n),{onClose:u}=l;return _.useEffect(()=>(document.addEventListener(xE,u),()=>document.removeEventListener(xE,u)),[u]),_.useEffect(()=>{if(l.trigger){const d=f=>{const p=f.target;p!=null&&p.contains(l.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,u]),h.jsx(zc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:h.jsxs(vx,{"data-state":l.stateAttribute,...c,...s,ref:e,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[h.jsx(TY,{children:r}),h.jsx(SY,{scope:n,isInside:!0,children:h.jsx(T9,{id:l.contentId,role:"tooltip",children:i||r})})]})})});JF.displayName=Dd;var QF="TooltipArrow",MY=_.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=bx(n);return EY(QF,n).isInside?null:h.jsx(yx,{...i,...r,ref:e})});MY.displayName=QF;function AY(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),i=Math.abs(e.right-t.x),o=Math.abs(e.left-t.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function CY(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function PY(t){const{top:e,right:n,bottom:r,left:i}=t;return[{x:i,y:e},{x:n,y:e},{x:n,y:r},{x:i,y:r}]}function RY(t,e){const{x:n,y:r}=t;let i=!1;for(let o=0,a=e.length-1;or!=f>r&&n<(d-c)*(r-u)/(f-u)+c&&(i=!i)}return i}function NY(t){const e=t.slice();return e.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),OY(e)}function OY(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r=2;){const o=e[e.length-1],a=e[e.length-2];if((o.x-a.x)*(i.y-a.y)>=(o.y-a.y)*(i.x-a.x))e.pop();else break}e.push(i)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const i=t[r];for(;n.length>=2;){const o=n[n.length-1],a=n[n.length-2];if((o.x-a.x)*(i.y-a.y)>=(o.y-a.y)*(i.x-a.x))n.pop();else break}n.push(i)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var IY=KF,DY=YF,eB=JF;const Fv=IY,Bv=DY,Gh=_.forwardRef(({className:t,sideOffset:e=4,...n},r)=>h.jsx(eB,{ref:r,sideOffset:e,className:He("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n}));Gh.displayName=eB.displayName;var wx="Popover",[tB,MDe]=mi(wx,[El]),Pm=El(),[LY,Tl]=tB(wx),nB=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:a=!1}=t,s=Pm(e),l=_.useRef(null),[c,u]=_.useState(!1),[d,f]=zo({prop:r,defaultProp:i??!1,onChange:o,caller:wx});return h.jsx(gx,{...s,children:h.jsx(LY,{scope:e,contentId:sr(),triggerRef:l,open:d,onOpenChange:f,onOpenToggle:_.useCallback(()=>f(p=>!p),[f]),hasCustomAnchor:c,onCustomAnchorAdd:_.useCallback(()=>u(!0),[]),onCustomAnchorRemove:_.useCallback(()=>u(!1),[]),modal:a,children:n})})};nB.displayName=wx;var rB="PopoverAnchor",kY=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Tl(rB,n),o=Pm(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:s}=i;return _.useEffect(()=>(a(),()=>s()),[a,s]),h.jsx(Cm,{...o,...r,ref:e})});kY.displayName=rB;var iB="PopoverTrigger",oB=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Tl(iB,n),o=Pm(n),a=Ot(e,i.triggerRef),s=h.jsx(nt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":uB(i.open),...r,ref:a,onClick:Oe(t.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:h.jsx(Cm,{asChild:!0,...o,children:s})});oB.displayName=iB;var PA="PopoverPortal",[jY,UY]=tB(PA,{forceMount:void 0}),aB=t=>{const{__scopePopover:e,forceMount:n,children:r,container:i}=t,o=Tl(PA,e);return h.jsx(jY,{scope:e,forceMount:n,children:h.jsx(gi,{present:n||o.open,children:h.jsx(vf,{asChild:!0,container:i,children:r})})})};aB.displayName=PA;var Ld="PopoverContent",sB=_.forwardRef((t,e)=>{const n=UY(Ld,t.__scopePopover),{forceMount:r=n.forceMount,...i}=t,o=Tl(Ld,t.__scopePopover);return h.jsx(gi,{present:r||o.open,children:o.modal?h.jsx(BY,{...i,ref:e}):h.jsx($Y,{...i,ref:e})})});sB.displayName=Ld;var FY=sl("PopoverContent.RemoveScroll"),BY=_.forwardRef((t,e)=>{const n=Tl(Ld,t.__scopePopover),r=_.useRef(null),i=Ot(e,r),o=_.useRef(!1);return _.useEffect(()=>{const a=r.current;if(a)return cx(a)},[]),h.jsx(Mm,{as:FY,allowPinchZoom:!0,children:h.jsx(lB,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Oe(t.onCloseAutoFocus,a=>{var s;a.preventDefault(),o.current||(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:Oe(t.onPointerDownOutside,a=>{const s=a.detail.originalEvent,l=s.button===0&&s.ctrlKey===!0,c=s.button===2||l;o.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:Oe(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),$Y=_.forwardRef((t,e)=>{const n=Tl(Ld,t.__scopePopover),r=_.useRef(!1),i=_.useRef(!1);return h.jsx(lB,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var a,s;(a=t.onCloseAutoFocus)==null||a.call(t,o),o.defaultPrevented||(r.current||(s=n.triggerRef.current)==null||s.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var l,c;(l=t.onInteractOutside)==null||l.call(t,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=o.target;((c=n.triggerRef.current)==null?void 0:c.contains(a))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),lB=_.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...d}=t,f=Tl(Ld,n),p=Pm(n);return sx(),h.jsx(Tm,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:h.jsx(zc,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>f.onOpenChange(!1),children:h.jsx(vx,{"data-state":uB(f.open),role:"dialog",id:f.contentId,...p,...d,ref:e,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),cB="PopoverClose",zY=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Tl(cB,n);return h.jsx(nt.button,{type:"button",...r,ref:e,onClick:Oe(t.onClick,()=>i.onOpenChange(!1))})});zY.displayName=cB;var HY="PopoverArrow",VY=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Pm(n);return h.jsx(yx,{...i,...r,ref:e})});VY.displayName=HY;function uB(t){return t?"open":"closed"}var GY=nB,WY=oB,XY=aB,dB=sB;const Sx=GY,Ex=WY,Rm=_.forwardRef(({className:t,align:e="center",sideOffset:n=4,...r},i)=>h.jsx(XY,{children:h.jsx(dB,{ref:i,align:e,sideOffset:n,className:He("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r})}));Rm.displayName=dB.displayName;var MN=1,qY=.9,KY=.8,YY=.17,z_=.1,H_=.999,JY=.9999,ZY=.99,QY=/[\\\/_+.#"@\[\(\{&]/,eJ=/[\\\/_+.#"@\[\(\{&]/g,tJ=/[\s-]/,fB=/[\s-]/g;function _E(t,e,n,r,i,o,a){if(o===e.length)return i===t.length?MN:ZY;var s=`${i},${o}`;if(a[s]!==void 0)return a[s];for(var l=r.charAt(o),c=n.indexOf(l,i),u=0,d,f,p,y;c>=0;)d=_E(t,e,n,r,c+1,o+1,a),d>u&&(c===i?d*=MN:QY.test(t.charAt(c-1))?(d*=KY,p=t.slice(i,c-1).match(eJ),p&&i>0&&(d*=Math.pow(H_,p.length))):tJ.test(t.charAt(c-1))?(d*=qY,y=t.slice(i,c-1).match(fB),y&&i>0&&(d*=Math.pow(H_,y.length))):(d*=YY,i>0&&(d*=Math.pow(H_,c-i))),t.charAt(c)!==e.charAt(o)&&(d*=JY)),(dd&&(d=f*z_)),d>u&&(u=d),c=n.indexOf(l,c+1);return a[s]=u,u}function AN(t){return t.toLowerCase().replace(fB," ")}function nJ(t,e,n){return t=n&&n.length>0?`${t+" "+n.join(" ")}`:t,_E(t,e,AN(t),AN(e),0,0,{})}var eh='[cmdk-group=""]',V_='[cmdk-group-items=""]',rJ='[cmdk-group-heading=""]',hB='[cmdk-item=""]',CN=`${hB}:not([aria-disabled="true"])`,wE="cmdk-item-select",Mu="data-value",iJ=(t,e,n)=>nJ(t,e,n),pB=_.createContext(void 0),Nm=()=>_.useContext(pB),mB=_.createContext(void 0),RA=()=>_.useContext(mB),gB=_.createContext(void 0),vB=_.forwardRef((t,e)=>{let n=Au(()=>{var H,q;return{search:"",value:(q=(H=t.value)!=null?H:t.defaultValue)!=null?q:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Au(()=>new Set),i=Au(()=>new Map),o=Au(()=>new Map),a=Au(()=>new Set),s=yB(t),{label:l,children:c,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:y,disablePointerSelection:v=!1,vimBindings:g=!0,...m}=t,x=sr(),b=sr(),S=sr(),w=_.useRef(null),E=mJ();Cc(()=>{if(u!==void 0){let H=u.trim();n.current.value=H,T.emit()}},[u]),Cc(()=>{E(6,D)},[]);let T=_.useMemo(()=>({subscribe:H=>(a.current.add(H),()=>a.current.delete(H)),snapshot:()=>n.current,setState:(H,q,$)=>{var Y,ee,J,ce;if(!Object.is(n.current[H],q)){if(n.current[H]=q,H==="search")R(),C(),E(1,P);else if(H==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ae=document.getElementById(S);ae?ae.focus():(Y=document.getElementById(x))==null||Y.focus()}if(E(7,()=>{var ae;n.current.selectedItemId=(ae=k())==null?void 0:ae.id,T.emit()}),$||E(5,D),((ee=s.current)==null?void 0:ee.value)!==void 0){let ae=q??"";(ce=(J=s.current).onValueChange)==null||ce.call(J,ae);return}}T.emit()}},emit:()=>{a.current.forEach(H=>H())}}),[]),A=_.useMemo(()=>({value:(H,q,$)=>{var Y;q!==((Y=o.current.get(H))==null?void 0:Y.value)&&(o.current.set(H,{value:q,keywords:$}),n.current.filtered.items.set(H,M(q,$)),E(2,()=>{C(),T.emit()}))},item:(H,q)=>(r.current.add(H),q&&(i.current.has(q)?i.current.get(q).add(H):i.current.set(q,new Set([H]))),E(3,()=>{R(),C(),n.current.value||P(),T.emit()}),()=>{o.current.delete(H),r.current.delete(H),n.current.filtered.items.delete(H);let $=k();E(4,()=>{R(),($==null?void 0:$.getAttribute("id"))===H&&P(),T.emit()})}),group:H=>(i.current.has(H)||i.current.set(H,new Set),()=>{o.current.delete(H),i.current.delete(H)}),filter:()=>s.current.shouldFilter,label:l||t["aria-label"],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:x,inputId:S,labelId:b,listInnerRef:w}),[]);function M(H,q){var $,Y;let ee=(Y=($=s.current)==null?void 0:$.filter)!=null?Y:iJ;return H?ee(H,n.current.search,q):0}function C(){if(!n.current.search||s.current.shouldFilter===!1)return;let H=n.current.filtered.items,q=[];n.current.filtered.groups.forEach(Y=>{let ee=i.current.get(Y),J=0;ee.forEach(ce=>{let ae=H.get(ce);J=Math.max(ae,J)}),q.push([Y,J])});let $=w.current;U().sort((Y,ee)=>{var J,ce;let ae=Y.getAttribute("id"),fe=ee.getAttribute("id");return((J=H.get(fe))!=null?J:0)-((ce=H.get(ae))!=null?ce:0)}).forEach(Y=>{let ee=Y.closest(V_);ee?ee.appendChild(Y.parentElement===ee?Y:Y.closest(`${V_} > *`)):$.appendChild(Y.parentElement===$?Y:Y.closest(`${V_} > *`))}),q.sort((Y,ee)=>ee[1]-Y[1]).forEach(Y=>{var ee;let J=(ee=w.current)==null?void 0:ee.querySelector(`${eh}[${Mu}="${encodeURIComponent(Y[0])}"]`);J==null||J.parentElement.appendChild(J)})}function P(){let H=U().find($=>$.getAttribute("aria-disabled")!=="true"),q=H==null?void 0:H.getAttribute(Mu);T.setState("value",q||void 0)}function R(){var H,q,$,Y;if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let ee=0;for(let J of r.current){let ce=(q=(H=o.current.get(J))==null?void 0:H.value)!=null?q:"",ae=(Y=($=o.current.get(J))==null?void 0:$.keywords)!=null?Y:[],fe=M(ce,ae);n.current.filtered.items.set(J,fe),fe>0&&ee++}for(let[J,ce]of i.current)for(let ae of ce)if(n.current.filtered.items.get(ae)>0){n.current.filtered.groups.add(J);break}n.current.filtered.count=ee}function D(){var H,q,$;let Y=k();Y&&(((H=Y.parentElement)==null?void 0:H.firstChild)===Y&&(($=(q=Y.closest(eh))==null?void 0:q.querySelector(rJ))==null||$.scrollIntoView({block:"nearest"})),Y.scrollIntoView({block:"nearest"}))}function k(){var H;return(H=w.current)==null?void 0:H.querySelector(`${hB}[aria-selected="true"]`)}function U(){var H;return Array.from(((H=w.current)==null?void 0:H.querySelectorAll(CN))||[])}function O(H){let q=U()[H];q&&T.setState("value",q.getAttribute(Mu))}function X(H){var q;let $=k(),Y=U(),ee=Y.findIndex(ce=>ce===$),J=Y[ee+H];(q=s.current)!=null&&q.loop&&(J=ee+H<0?Y[Y.length-1]:ee+H===Y.length?Y[0]:Y[ee+H]),J&&T.setState("value",J.getAttribute(Mu))}function L(H){let q=k(),$=q==null?void 0:q.closest(eh),Y;for(;$&&!Y;)$=H>0?hJ($,eh):pJ($,eh),Y=$==null?void 0:$.querySelector(CN);Y?T.setState("value",Y.getAttribute(Mu)):X(H)}let j=()=>O(U().length-1),K=H=>{H.preventDefault(),H.metaKey?j():H.altKey?L(1):X(1)},te=H=>{H.preventDefault(),H.metaKey?O(0):H.altKey?L(-1):X(-1)};return _.createElement(nt.div,{ref:e,tabIndex:-1,...m,"cmdk-root":"",onKeyDown:H=>{var q;(q=m.onKeyDown)==null||q.call(m,H);let $=H.nativeEvent.isComposing||H.keyCode===229;if(!(H.defaultPrevented||$))switch(H.key){case"n":case"j":{g&&H.ctrlKey&&K(H);break}case"ArrowDown":{K(H);break}case"p":case"k":{g&&H.ctrlKey&&te(H);break}case"ArrowUp":{te(H);break}case"Home":{H.preventDefault(),O(0);break}case"End":{H.preventDefault(),j();break}case"Enter":{H.preventDefault();let Y=k();if(Y){let ee=new Event(wE);Y.dispatchEvent(ee)}}}}},_.createElement("label",{"cmdk-label":"",htmlFor:A.inputId,id:A.labelId,style:vJ},l),Tx(t,H=>_.createElement(mB.Provider,{value:T},_.createElement(pB.Provider,{value:A},H))))}),oJ=_.forwardRef((t,e)=>{var n,r;let i=sr(),o=_.useRef(null),a=_.useContext(gB),s=Nm(),l=yB(t),c=(r=(n=l.current)==null?void 0:n.forceMount)!=null?r:a==null?void 0:a.forceMount;Cc(()=>{if(!c)return s.item(i,a==null?void 0:a.id)},[c]);let u=xB(i,o,[t.value,t.children,o],t.keywords),d=RA(),f=fl(E=>E.value&&E.value===u.current),p=fl(E=>c||s.filter()===!1?!0:E.search?E.filtered.items.get(i)>0:!0);_.useEffect(()=>{let E=o.current;if(!(!E||t.disabled))return E.addEventListener(wE,y),()=>E.removeEventListener(wE,y)},[p,t.onSelect,t.disabled]);function y(){var E,T;v(),(T=(E=l.current).onSelect)==null||T.call(E,u.current)}function v(){d.setState("value",u.current,!0)}if(!p)return null;let{disabled:g,value:m,onSelect:x,forceMount:b,keywords:S,...w}=t;return _.createElement(nt.div,{ref:is(o,e),...w,id:i,"cmdk-item":"",role:"option","aria-disabled":!!g,"aria-selected":!!f,"data-disabled":!!g,"data-selected":!!f,onPointerMove:g||s.getDisablePointerSelection()?void 0:v,onClick:g?void 0:y},t.children)}),aJ=_.forwardRef((t,e)=>{let{heading:n,children:r,forceMount:i,...o}=t,a=sr(),s=_.useRef(null),l=_.useRef(null),c=sr(),u=Nm(),d=fl(p=>i||u.filter()===!1?!0:p.search?p.filtered.groups.has(a):!0);Cc(()=>u.group(a),[]),xB(a,s,[t.value,t.heading,l]);let f=_.useMemo(()=>({id:a,forceMount:i}),[i]);return _.createElement(nt.div,{ref:is(s,e),...o,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},n&&_.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:c},n),Tx(t,p=>_.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?c:void 0},_.createElement(gB.Provider,{value:f},p))))}),sJ=_.forwardRef((t,e)=>{let{alwaysRender:n,...r}=t,i=_.useRef(null),o=fl(a=>!a.search);return!n&&!o?null:_.createElement(nt.div,{ref:is(i,e),...r,"cmdk-separator":"",role:"separator"})}),lJ=_.forwardRef((t,e)=>{let{onValueChange:n,...r}=t,i=t.value!=null,o=RA(),a=fl(c=>c.search),s=fl(c=>c.selectedItemId),l=Nm();return _.useEffect(()=>{t.value!=null&&o.setState("search",t.value)},[t.value]),_.createElement(nt.input,{ref:e,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":s,id:l.inputId,type:"text",value:i?t.value:a,onChange:c=>{i||o.setState("search",c.target.value),n==null||n(c.target.value)}})}),cJ=_.forwardRef((t,e)=>{let{children:n,label:r="Suggestions",...i}=t,o=_.useRef(null),a=_.useRef(null),s=fl(c=>c.selectedItemId),l=Nm();return _.useEffect(()=>{if(a.current&&o.current){let c=a.current,u=o.current,d,f=new ResizeObserver(()=>{d=requestAnimationFrame(()=>{let p=c.offsetHeight;u.style.setProperty("--cmdk-list-height",p.toFixed(1)+"px")})});return f.observe(c),()=>{cancelAnimationFrame(d),f.unobserve(c)}}},[]),_.createElement(nt.div,{ref:is(o,e),...i,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:l.listId},Tx(t,c=>_.createElement("div",{ref:is(a,l.listInnerRef),"cmdk-list-sizer":""},c)))}),uJ=_.forwardRef((t,e)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:o,container:a,...s}=t;return _.createElement(hA,{open:n,onOpenChange:r},_.createElement(pA,{container:a},_.createElement(dx,{"cmdk-overlay":"",className:i}),_.createElement(fx,{"aria-label":t.label,"cmdk-dialog":"",className:o},_.createElement(vB,{ref:e,...s}))))}),dJ=_.forwardRef((t,e)=>fl(n=>n.filtered.count===0)?_.createElement(nt.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),fJ=_.forwardRef((t,e)=>{let{progress:n,children:r,label:i="Loading...",...o}=t;return _.createElement(nt.div,{ref:e,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},Tx(t,a=>_.createElement("div",{"aria-hidden":!0},a)))}),vi=Object.assign(vB,{List:cJ,Item:oJ,Input:lJ,Group:aJ,Separator:sJ,Dialog:uJ,Empty:dJ,Loading:fJ});function hJ(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function pJ(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function yB(t){let e=_.useRef(t);return Cc(()=>{e.current=t}),e}var Cc=typeof window>"u"?_.useEffect:_.useLayoutEffect;function Au(t){let e=_.useRef();return e.current===void 0&&(e.current=t()),e}function fl(t){let e=RA(),n=()=>t(e.snapshot());return _.useSyncExternalStore(e.subscribe,n,n)}function xB(t,e,n,r=[]){let i=_.useRef(),o=Nm();return Cc(()=>{var a;let s=(()=>{var c;for(let u of n){if(typeof u=="string")return u.trim();if(typeof u=="object"&&"current"in u)return u.current?(c=u.current.textContent)==null?void 0:c.trim():i.current}})(),l=r.map(c=>c.trim());o.value(t,s,l),(a=e.current)==null||a.setAttribute(Mu,s),i.current=s}),i}var mJ=()=>{let[t,e]=_.useState(),n=Au(()=>new Map);return Cc(()=>{n.current.forEach(r=>r()),n.current=new Map},[t]),(r,i)=>{n.current.set(r,i),e({})}};function gJ(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function Tx({asChild:t,children:e},n){return t&&_.isValidElement(e)?_.cloneElement(gJ(e),{ref:e.ref},n(e.props.children)):n(e)}var vJ={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Mx=_.forwardRef(({className:t,...e},n)=>h.jsx(vi,{ref:n,className:He("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...e}));Mx.displayName=vi.displayName;const Ax=_.forwardRef(({className:t,...e},n)=>h.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[h.jsx(aA,{className:"mr-2 h-4 w-4 shrink-0 text-slate-400"}),h.jsx(vi.Input,{ref:n,className:He("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",t),...e})]}));Ax.displayName=vi.Input.displayName;const Cx=_.forwardRef(({className:t,...e},n)=>h.jsx(vi.List,{ref:n,className:He("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...e}));Cx.displayName=vi.List.displayName;const Px=_.forwardRef((t,e)=>h.jsx(vi.Empty,{ref:e,className:"py-6 text-center text-sm",...t}));Px.displayName=vi.Empty.displayName;const Qs=_.forwardRef(({className:t,...e},n)=>h.jsx(vi.Group,{ref:n,className:He("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",t),...e}));Qs.displayName=vi.Group.displayName;const yJ=_.forwardRef(({className:t,...e},n)=>h.jsx(vi.Separator,{ref:n,className:He("-mx-1 h-px bg-border",t),...e}));yJ.displayName=vi.Separator.displayName;const kd=_.forwardRef(({className:t,...e},n)=>h.jsx(vi.Item,{ref:n,className:He("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",t),...e}));kd.displayName=vi.Item.displayName;const xJ=({selectedName:t,availableNames:e,onSelect:n,onCreateNew:r,isLoading:i})=>{const[o,a]=_.useState(!1),[s,l]=_.useState(""),c=s.trim(),u=e.some(m=>m.toLowerCase()===c.toLowerCase()),d=c.length>0&&!u,f=!d,p=u?"Already exists":c===""?"Create new robotโ€ฆ":`Create "${c}"`,y=()=>{l(""),a(!1)},v=m=>{n(m),y()},g=async()=>{if(!d)return;await r(c)&&y()};return h.jsxs(Sx,{open:o,onOpenChange:a,children:[h.jsx(Ex,{asChild:!0,children:h.jsxs(Je,{variant:"outline",role:"combobox","aria-expanded":o,disabled:i,className:"w-full justify-between bg-gray-900 border-gray-700 text-white hover:bg-gray-700 hover:text-white font-normal",children:[h.jsx("span",{className:He("truncate",t?"":"text-gray-400"),children:i?"Loading...":t??"Select a robot or type a new name"}),h.jsx(tA,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),h.jsx(Rm,{className:"p-0 bg-gray-800 border-gray-700 text-white",style:{width:"var(--radix-popover-trigger-width)"},align:"start",children:h.jsxs(Mx,{className:"bg-gray-800",children:[h.jsx(Ax,{placeholder:"Search or type new name...",value:s,onValueChange:l,onKeyDown:m=>{m.key==="Enter"&&d&&(m.preventDefault(),g())},className:"text-white"}),h.jsxs(Cx,{children:[e.length===0&&h.jsx(Px,{className:"py-4 text-sm text-gray-400 text-center",children:"No robots yet. Type a name to create one."}),e.length>0&&h.jsx(Qs,{heading:"Existing",children:e.map(m=>h.jsxs(kd,{value:m,onSelect:()=>v(m),className:"text-white aria-selected:bg-gray-700",children:[h.jsx(xl,{className:He("mr-2 h-4 w-4",t===m?"opacity-100":"opacity-0")}),m]},m))})]}),h.jsxs("button",{type:"button",onClick:g,disabled:f,className:"flex w-full items-center gap-2 border-t border-gray-700 px-3 py-2 text-sm text-white hover:bg-gray-700 disabled:cursor-not-allowed disabled:text-gray-500 disabled:hover:bg-transparent",children:[h.jsx(iA,{className:"h-4 w-4"}),p]})]})})]})},bJ=({robot:t,selectedName:e,availableNames:n,isLoading:r,onSelect:i,onCreateNew:o,onConfigure:a,onTeleop:s,onDelete:l})=>{const[c,u]=_.useState(!1),d=t?t.is_clean?"Ready":"Needs configuration":null,f=!t||!t.is_clean;return h.jsxs("div",{className:"bg-gray-800 rounded-lg border border-gray-700 p-3 flex flex-col gap-2 relative",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("div",{className:"flex-1 min-w-0",children:h.jsx(xJ,{selectedName:e,availableNames:n,onSelect:i,onCreateNew:o,isLoading:r})}),d&&h.jsx("p",{className:`text-xs truncate shrink-0 ${t.is_clean?"text-green-400":"text-amber-400"}`,children:d}),t&&h.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[h.jsxs(Fv,{children:[h.jsx(Bv,{asChild:!0,children:h.jsx(Je,{size:"icon",variant:"ghost",className:"h-8 w-8 text-gray-300 hover:text-white",onClick:()=>a(t.name),"aria-label":"Configure",children:h.jsx(Mh,{className:"w-4 h-4"})})}),h.jsx(Gh,{children:"Configure (calibrate)"})]}),h.jsxs(Fv,{children:[h.jsx(Bv,{asChild:!0,children:h.jsx(Je,{size:"icon",variant:"ghost",className:"h-8 w-8 text-red-400 hover:text-red-300 hover:bg-red-900/20",onClick:()=>u(!0),"aria-label":"Delete robot",children:h.jsx(sA,{className:"w-4 h-4"})})}),h.jsx(Gh,{children:"Delete robot config"})]})]})]}),t&&h.jsxs(Fv,{children:[h.jsx(Bv,{asChild:!0,children:h.jsx("div",{className:"w-full",children:h.jsx(Je,{onClick:()=>s(t),disabled:f,className:`w-full ${f?"bg-red-500/30 hover:bg-red-500/30 text-red-200 cursor-not-allowed":"bg-yellow-500 hover:bg-yellow-600 text-white"}`,children:"Teleoperation"})})}),f&&h.jsx(Gh,{children:"Configure the robot first."})]}),t&&h.jsx(Hc,{open:c,onOpenChange:u,children:h.jsxs(bl,{className:"bg-gray-900 border-gray-800 text-white",children:[h.jsxs(_l,{children:[h.jsx(wl,{children:"Delete robot config?"}),h.jsx(Sl,{className:"text-gray-400",children:"This deletes the robot config file from disk. Calibration files are not removed. This cannot be undone."})]}),h.jsxs(MF,{className:"flex gap-2 justify-end",children:[h.jsx(Je,{variant:"outline",className:"border-gray-600 text-gray-300",onClick:()=>u(!1),children:"Cancel"}),h.jsx(Je,{className:"bg-red-500 hover:bg-red-600 text-white",onClick:async()=>{u(!1),await l(t.name)},children:"Delete"})]})]})})]})},_J=({selectedName:t,selectedRecord:e,availableNames:n,isLoading:r,selectRobot:i,createRobot:o,deleteRobot:a})=>{const s=ji(),{baseUrl:l,fetchWithHeaders:c}=Dn(),{toast:u}=_r(),d=p=>{s("/calibration",{state:{robot_name:p}})},f=async p=>{try{const y=await c(`${l}/move-arm`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({leader_port:p.leader_port,follower_port:p.follower_port,leader_config:p.leader_config,follower_config:p.follower_config})}),v=await y.json();y.ok&&v.success?(u({title:"Teleoperation Started",description:v.message||`Started teleoperation for ${p.name}.`}),s("/teleoperation")):u({title:"Error Starting Teleoperation",description:v.message||"Failed to start.",variant:"destructive"})}catch{u({title:"Connection Error",description:"Could not connect to the backend server.",variant:"destructive"})}};return h.jsx(bJ,{robot:e,selectedName:t,availableNames:n,isLoading:r,onSelect:i,onCreateNew:o,onConfigure:d,onTeleop:f,onDelete:a})},hi=_.forwardRef(({className:t,type:e,...n},r)=>h.jsx("input",{type:e,className:He("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:r,...n}));hi.displayName="Input";const mr=_.forwardRef(({value:t,onChange:e,integer:n=!0,className:r,...i},o)=>{const[a,s]=_.useState(t==null?"":String(t)),l=_.useRef(t);return _.useEffect(()=>{t!==l.current&&(l.current=t,s(t==null?"":String(t)))},[t]),h.jsx(hi,{ref:o,type:"number",inputMode:n?"numeric":"decimal",value:a,onChange:c=>{const u=c.target.value;if(s(u),u===""){e(void 0);return}const d=n?parseInt(u,10):parseFloat(u);Number.isFinite(d)&&e(d)},className:He("[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:m-0 [&::-webkit-outer-spin-button]:m-0",r),...i})});mr.displayName="NumberInput";var wJ="Label",bB=_.forwardRef((t,e)=>h.jsx(nt.label,{...t,ref:e,onMouseDown:n=>{var i;n.target.closest("button, input, select, textarea")||((i=t.onMouseDown)==null||i.call(t,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));bB.displayName=wJ;var _B=bB;const SJ=Em("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Tt=_.forwardRef(({className:t,...e},n)=>h.jsx(_B,{ref:n,className:He(SJ(),t),...e}));Tt.displayName=_B.displayName;function NA(t){const e=_.useRef({value:t,previous:t});return _.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var Rx="Checkbox",[EJ,ADe]=mi(Rx),[TJ,OA]=EJ(Rx);function MJ(t){const{__scopeCheckbox:e,checked:n,children:r,defaultChecked:i,disabled:o,form:a,name:s,onCheckedChange:l,required:c,value:u="on",internal_do_not_use_render:d}=t,[f,p]=zo({prop:n,defaultProp:i??!1,onChange:l,caller:Rx}),[y,v]=_.useState(null),[g,m]=_.useState(null),x=_.useRef(!1),b=y?!!a||!!y.closest("form"):!0,S={checked:f,disabled:o,setChecked:p,control:y,setControl:v,name:s,form:a,value:u,hasConsumerStoppedPropagationRef:x,required:c,defaultChecked:el(i)?!1:i,isFormControl:b,bubbleInput:g,setBubbleInput:m};return h.jsx(TJ,{scope:e,...S,children:AJ(d)?d(S):r})}var wB="CheckboxTrigger",SB=_.forwardRef(({__scopeCheckbox:t,onKeyDown:e,onClick:n,...r},i)=>{const{control:o,value:a,disabled:s,checked:l,required:c,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,isFormControl:p,bubbleInput:y}=OA(wB,t),v=Ot(i,u),g=_.useRef(l);return _.useEffect(()=>{const m=o==null?void 0:o.form;if(m){const x=()=>d(g.current);return m.addEventListener("reset",x),()=>m.removeEventListener("reset",x)}},[o,d]),h.jsx(nt.button,{type:"button",role:"checkbox","aria-checked":el(l)?"mixed":l,"aria-required":c,"data-state":CB(l),"data-disabled":s?"":void 0,disabled:s,value:a,...r,ref:v,onKeyDown:Oe(e,m=>{m.key==="Enter"&&m.preventDefault()}),onClick:Oe(n,m=>{d(x=>el(x)?!0:!x),y&&p&&(f.current=m.isPropagationStopped(),f.current||m.stopPropagation())})})});SB.displayName=wB;var IA=_.forwardRef((t,e)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:o,required:a,disabled:s,value:l,onCheckedChange:c,form:u,...d}=t;return h.jsx(MJ,{__scopeCheckbox:n,checked:i,defaultChecked:o,disabled:s,required:a,onCheckedChange:c,name:r,form:u,value:l,internal_do_not_use_render:({isFormControl:f})=>h.jsxs(h.Fragment,{children:[h.jsx(SB,{...d,ref:e,__scopeCheckbox:n}),f&&h.jsx(AB,{__scopeCheckbox:n})]})})});IA.displayName=Rx;var EB="CheckboxIndicator",TB=_.forwardRef((t,e)=>{const{__scopeCheckbox:n,forceMount:r,...i}=t,o=OA(EB,n);return h.jsx(gi,{present:r||el(o.checked)||o.checked===!0,children:h.jsx(nt.span,{"data-state":CB(o.checked),"data-disabled":o.disabled?"":void 0,...i,ref:e,style:{pointerEvents:"none",...t.style}})})});TB.displayName=EB;var MB="CheckboxBubbleInput",AB=_.forwardRef(({__scopeCheckbox:t,...e},n)=>{const{control:r,hasConsumerStoppedPropagationRef:i,checked:o,defaultChecked:a,required:s,disabled:l,name:c,value:u,form:d,bubbleInput:f,setBubbleInput:p}=OA(MB,t),y=Ot(n,p),v=NA(o),g=TA(r);_.useEffect(()=>{const x=f;if(!x)return;const b=window.HTMLInputElement.prototype,w=Object.getOwnPropertyDescriptor(b,"checked").set,E=!i.current;if(v!==o&&w){const T=new Event("click",{bubbles:E});x.indeterminate=el(o),w.call(x,el(o)?!1:o),x.dispatchEvent(T)}},[f,v,o,i]);const m=_.useRef(el(o)?!1:o);return h.jsx(nt.input,{type:"checkbox","aria-hidden":!0,defaultChecked:a??m.current,required:s,disabled:l,name:c,value:u,form:d,...e,tabIndex:-1,ref:y,style:{...e.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});AB.displayName=MB;function AJ(t){return typeof t=="function"}function el(t){return t==="indeterminate"}function CB(t){return el(t)?"indeterminate":t?"checked":"unchecked"}const DA=_.forwardRef(({className:t,...e},n)=>h.jsx(IA,{ref:n,className:He("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",t),...e,children:h.jsx(TB,{className:He("flex items-center justify-center text-current"),children:h.jsx(xl,{className:"h-4 w-4"})})}));DA.displayName=IA.displayName;var Nx="Collapsible",[CJ,CDe]=mi(Nx),[PJ,LA]=CJ(Nx),PB=_.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:a,...s}=t,[l,c]=zo({prop:r,defaultProp:i??!1,onChange:a,caller:Nx});return h.jsx(PJ,{scope:n,disabled:o,contentId:sr(),open:l,onOpenToggle:_.useCallback(()=>c(u=>!u),[c]),children:h.jsx(nt.div,{"data-state":jA(l),"data-disabled":o?"":void 0,...s,ref:e})})});PB.displayName=Nx;var RB="CollapsibleTrigger",NB=_.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,i=LA(RB,n);return h.jsx(nt.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":jA(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:e,onClick:Oe(t.onClick,i.onOpenToggle)})});NB.displayName=RB;var kA="CollapsibleContent",OB=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=LA(kA,t.__scopeCollapsible);return h.jsx(gi,{present:n||i.open,children:({present:o})=>h.jsx(RJ,{...r,ref:e,present:o})})});OB.displayName=kA;var RJ=_.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=t,a=LA(kA,n),[s,l]=_.useState(r),c=_.useRef(null),u=Ot(e,c),d=_.useRef(0),f=d.current,p=_.useRef(0),y=p.current,v=a.open||s,g=_.useRef(v),m=_.useRef(void 0);return _.useEffect(()=>{const x=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(x)},[]),ur(()=>{const x=c.current;if(x){m.current=m.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";const b=x.getBoundingClientRect();d.current=b.height,p.current=b.width,g.current||(x.style.transitionDuration=m.current.transitionDuration,x.style.animationName=m.current.animationName),l(r)}},[a.open,r]),h.jsx(nt.div,{"data-state":jA(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!v,...o,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":y?`${y}px`:void 0,...t.style},children:v&&i})});function jA(t){return t?"open":"closed"}var NJ=PB;const Ty=NJ,My=NB,Ay=OB,OJ=Em("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Mi=_.forwardRef(({className:t,variant:e,...n},r)=>h.jsx("div",{ref:r,role:"alert",className:He(OJ({variant:e}),t),...n}));Mi.displayName="Alert";const IJ=_.forwardRef(({className:t,...e},n)=>h.jsx("h5",{ref:n,className:He("mb-1 font-medium leading-none tracking-tight",t),...e}));IJ.displayName="AlertTitle";const Ai=_.forwardRef(({className:t,...e},n)=>h.jsx("div",{ref:n,className:He("text-sm [&_p]:leading-relaxed",t),...e}));Ai.displayName="AlertDescription";function PN(t,[e,n]){return Math.min(n,Math.max(e,t))}var DJ=_.createContext(void 0);function UA(t){const e=_.useContext(DJ);return t||e||"ltr"}var LJ=[" ","Enter","ArrowUp","ArrowDown"],kJ=[" ","Enter"],Pc="Select",[Ox,Ix,jJ]=rx(Pc),[wf,PDe]=mi(Pc,[jJ,El]),Dx=El(),[UJ,Ml]=wf(Pc),[FJ,BJ]=wf(Pc),IB=t=>{const{__scopeSelect:e,children:n,open:r,defaultOpen:i,onOpenChange:o,value:a,defaultValue:s,onValueChange:l,dir:c,name:u,autoComplete:d,disabled:f,required:p,form:y}=t,v=Dx(e),[g,m]=_.useState(null),[x,b]=_.useState(null),[S,w]=_.useState(!1),E=UA(c),[T,A]=zo({prop:r,defaultProp:i??!1,onChange:o,caller:Pc}),[M,C]=zo({prop:a,defaultProp:s,onChange:l,caller:Pc}),P=_.useRef(null),R=g?y||!!g.closest("form"):!0,[D,k]=_.useState(new Set),U=Array.from(D).map(O=>O.props.value).join(";");return h.jsx(gx,{...v,children:h.jsxs(UJ,{required:p,scope:e,trigger:g,onTriggerChange:m,valueNode:x,onValueNodeChange:b,valueNodeHasChildren:S,onValueNodeHasChildrenChange:w,contentId:sr(),value:M,onValueChange:C,open:T,onOpenChange:A,dir:E,triggerPointerDownPosRef:P,disabled:f,children:[h.jsx(Ox.Provider,{scope:e,children:h.jsx(FJ,{scope:t.__scopeSelect,onNativeOptionAdd:_.useCallback(O=>{k(X=>new Set(X).add(O))},[]),onNativeOptionRemove:_.useCallback(O=>{k(X=>{const L=new Set(X);return L.delete(O),L})},[]),children:n})}),R?h.jsxs(r4,{"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:d,value:M,onChange:O=>C(O.target.value),disabled:f,form:y,children:[M===void 0?h.jsx("option",{value:""}):null,Array.from(D)]},U):null]})})};IB.displayName=Pc;var DB="SelectTrigger",LB=_.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:r=!1,...i}=t,o=Dx(n),a=Ml(DB,n),s=a.disabled||r,l=Ot(e,a.onTriggerChange),c=Ix(n),u=_.useRef("touch"),[d,f,p]=o4(v=>{const g=c().filter(b=>!b.disabled),m=g.find(b=>b.value===a.value),x=a4(g,v,m);x!==void 0&&a.onValueChange(x.value)}),y=v=>{s||(a.onOpenChange(!0),p()),v&&(a.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})};return h.jsx(Cm,{asChild:!0,...o,children:h.jsx(nt.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":i4(a.value)?"":void 0,...i,ref:l,onClick:Oe(i.onClick,v=>{v.currentTarget.focus(),u.current!=="mouse"&&y(v)}),onPointerDown:Oe(i.onPointerDown,v=>{u.current=v.pointerType;const g=v.target;g.hasPointerCapture(v.pointerId)&&g.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(y(v),v.preventDefault())}),onKeyDown:Oe(i.onKeyDown,v=>{const g=d.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&f(v.key),!(g&&v.key===" ")&&LJ.includes(v.key)&&(y(),v.preventDefault())})})})});LB.displayName=DB;var kB="SelectValue",jB=_.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:a="",...s}=t,l=Ml(kB,n),{onValueNodeHasChildrenChange:c}=l,u=o!==void 0,d=Ot(e,l.onValueNodeChange);return ur(()=>{c(u)},[c,u]),h.jsx(nt.span,{...s,ref:d,style:{pointerEvents:"none"},children:i4(l.value)?h.jsx(h.Fragment,{children:a}):o})});jB.displayName=kB;var $J="SelectIcon",UB=_.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,...i}=t;return h.jsx(nt.span,{"aria-hidden":!0,...i,ref:e,children:r||"โ–ผ"})});UB.displayName=$J;var zJ="SelectPortal",FB=t=>h.jsx(vf,{asChild:!0,...t});FB.displayName=zJ;var Rc="SelectContent",BB=_.forwardRef((t,e)=>{const n=Ml(Rc,t.__scopeSelect),[r,i]=_.useState();if(ur(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?Bc.createPortal(h.jsx($B,{scope:t.__scopeSelect,children:h.jsx(Ox.Slot,{scope:t.__scopeSelect,children:h.jsx("div",{children:t.children})})}),o):null}return h.jsx(zB,{...t,ref:e})});BB.displayName=Rc;var vo=10,[$B,Al]=wf(Rc),HJ="SelectContentImpl",VJ=sl("SelectContent.RemoveScroll"),zB=_.forwardRef((t,e)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:a,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:y,hideWhenDetached:v,avoidCollisions:g,...m}=t,x=Ml(Rc,n),[b,S]=_.useState(null),[w,E]=_.useState(null),T=Ot(e,J=>S(J)),[A,M]=_.useState(null),[C,P]=_.useState(null),R=Ix(n),[D,k]=_.useState(!1),U=_.useRef(!1);_.useEffect(()=>{if(b)return cx(b)},[b]),sx();const O=_.useCallback(J=>{const[ce,...ae]=R().map(le=>le.ref.current),[fe]=ae.slice(-1),we=document.activeElement;for(const le of J)if(le===we||(le==null||le.scrollIntoView({block:"nearest"}),le===ce&&w&&(w.scrollTop=0),le===fe&&w&&(w.scrollTop=w.scrollHeight),le==null||le.focus(),document.activeElement!==we))return},[R,w]),X=_.useCallback(()=>O([A,b]),[O,A,b]);_.useEffect(()=>{D&&X()},[D,X]);const{onOpenChange:L,triggerPointerDownPosRef:j}=x;_.useEffect(()=>{if(b){let J={x:0,y:0};const ce=fe=>{var we,le;J={x:Math.abs(Math.round(fe.pageX)-(((we=j.current)==null?void 0:we.x)??0)),y:Math.abs(Math.round(fe.pageY)-(((le=j.current)==null?void 0:le.y)??0))}},ae=fe=>{J.x<=10&&J.y<=10?fe.preventDefault():b.contains(fe.target)||L(!1),document.removeEventListener("pointermove",ce),j.current=null};return j.current!==null&&(document.addEventListener("pointermove",ce),document.addEventListener("pointerup",ae,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ce),document.removeEventListener("pointerup",ae,{capture:!0})}}},[b,L,j]),_.useEffect(()=>{const J=()=>L(!1);return window.addEventListener("blur",J),window.addEventListener("resize",J),()=>{window.removeEventListener("blur",J),window.removeEventListener("resize",J)}},[L]);const[K,te]=o4(J=>{const ce=R().filter(we=>!we.disabled),ae=ce.find(we=>we.ref.current===document.activeElement),fe=a4(ce,J,ae);fe&&setTimeout(()=>fe.ref.current.focus())}),H=_.useCallback((J,ce,ae)=>{const fe=!U.current&&!ae;(x.value!==void 0&&x.value===ce||fe)&&(M(J),fe&&(U.current=!0))},[x.value]),q=_.useCallback(()=>b==null?void 0:b.focus(),[b]),$=_.useCallback((J,ce,ae)=>{const fe=!U.current&&!ae;(x.value!==void 0&&x.value===ce||fe)&&P(J)},[x.value]),Y=r==="popper"?SE:HB,ee=Y===SE?{side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:y,hideWhenDetached:v,avoidCollisions:g}:{};return h.jsx($B,{scope:n,content:b,viewport:w,onViewportChange:E,itemRefCallback:H,selectedItem:A,onItemLeave:q,itemTextRefCallback:$,focusSelectedItem:X,selectedItemText:C,position:r,isPositioned:D,searchRef:K,children:h.jsx(Mm,{as:VJ,allowPinchZoom:!0,children:h.jsx(Tm,{asChild:!0,trapped:x.open,onMountAutoFocus:J=>{J.preventDefault()},onUnmountAutoFocus:Oe(i,J=>{var ce;(ce=x.trigger)==null||ce.focus({preventScroll:!0}),J.preventDefault()}),children:h.jsx(zc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:J=>J.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:h.jsx(Y,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:J=>J.preventDefault(),...m,...ee,onPlaced:()=>k(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...m.style},onKeyDown:Oe(m.onKeyDown,J=>{const ce=J.ctrlKey||J.altKey||J.metaKey;if(J.key==="Tab"&&J.preventDefault(),!ce&&J.key.length===1&&te(J.key),["ArrowUp","ArrowDown","Home","End"].includes(J.key)){let fe=R().filter(we=>!we.disabled).map(we=>we.ref.current);if(["ArrowUp","End"].includes(J.key)&&(fe=fe.slice().reverse()),["ArrowUp","ArrowDown"].includes(J.key)){const we=J.target,le=fe.indexOf(we);fe=fe.slice(le+1)}setTimeout(()=>O(fe)),J.preventDefault()}})})})})})})});zB.displayName=HJ;var GJ="SelectItemAlignedPosition",HB=_.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:r,...i}=t,o=Ml(Rc,n),a=Al(Rc,n),[s,l]=_.useState(null),[c,u]=_.useState(null),d=Ot(e,T=>u(T)),f=Ix(n),p=_.useRef(!1),y=_.useRef(!0),{viewport:v,selectedItem:g,selectedItemText:m,focusSelectedItem:x}=a,b=_.useCallback(()=>{if(o.trigger&&o.valueNode&&s&&c&&v&&g&&m){const T=o.trigger.getBoundingClientRect(),A=c.getBoundingClientRect(),M=o.valueNode.getBoundingClientRect(),C=m.getBoundingClientRect();if(o.dir!=="rtl"){const we=C.left-A.left,le=M.left-we,ie=T.left-le,W=T.width+ie,Ve=Math.max(W,A.width),Ne=window.innerWidth-vo,st=PN(le,[vo,Math.max(vo,Ne-Ve)]);s.style.minWidth=W+"px",s.style.left=st+"px"}else{const we=A.right-C.right,le=window.innerWidth-M.right-we,ie=window.innerWidth-T.right-le,W=T.width+ie,Ve=Math.max(W,A.width),Ne=window.innerWidth-vo,st=PN(le,[vo,Math.max(vo,Ne-Ve)]);s.style.minWidth=W+"px",s.style.right=st+"px"}const P=f(),R=window.innerHeight-vo*2,D=v.scrollHeight,k=window.getComputedStyle(c),U=parseInt(k.borderTopWidth,10),O=parseInt(k.paddingTop,10),X=parseInt(k.borderBottomWidth,10),L=parseInt(k.paddingBottom,10),j=U+O+D+L+X,K=Math.min(g.offsetHeight*5,j),te=window.getComputedStyle(v),H=parseInt(te.paddingTop,10),q=parseInt(te.paddingBottom,10),$=T.top+T.height/2-vo,Y=R-$,ee=g.offsetHeight/2,J=g.offsetTop+ee,ce=U+O+J,ae=j-ce;if(ce<=$){const we=P.length>0&&g===P[P.length-1].ref.current;s.style.bottom="0px";const le=c.clientHeight-v.offsetTop-v.offsetHeight,ie=Math.max(Y,ee+(we?q:0)+le+X),W=ce+ie;s.style.height=W+"px"}else{const we=P.length>0&&g===P[0].ref.current;s.style.top="0px";const ie=Math.max($,U+v.offsetTop+(we?H:0)+ee)+ae;s.style.height=ie+"px",v.scrollTop=ce-$+v.offsetTop}s.style.margin=`${vo}px 0`,s.style.minHeight=K+"px",s.style.maxHeight=R+"px",r==null||r(),requestAnimationFrame(()=>p.current=!0)}},[f,o.trigger,o.valueNode,s,c,v,g,m,o.dir,r]);ur(()=>b(),[b]);const[S,w]=_.useState();ur(()=>{c&&w(window.getComputedStyle(c).zIndex)},[c]);const E=_.useCallback(T=>{T&&y.current===!0&&(b(),x==null||x(),y.current=!1)},[b,x]);return h.jsx(XJ,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:E,children:h.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:h.jsx(nt.div,{...i,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});HB.displayName=GJ;var WJ="SelectPopperPosition",SE=_.forwardRef((t,e)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=vo,...o}=t,a=Dx(n);return h.jsx(vx,{...a,...o,ref:e,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});SE.displayName=WJ;var[XJ,FA]=wf(Rc,{}),EE="SelectViewport",VB=_.forwardRef((t,e)=>{const{__scopeSelect:n,nonce:r,...i}=t,o=Al(EE,n),a=FA(EE,n),s=Ot(e,o.onViewportChange),l=_.useRef(0);return h.jsxs(h.Fragment,{children:[h.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),h.jsx(Ox.Slot,{scope:n,children:h.jsx(nt.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Oe(i.onScroll,c=>{const u=c.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:f}=a;if(f!=null&&f.current&&d){const p=Math.abs(l.current-u.scrollTop);if(p>0){const y=window.innerHeight-vo*2,v=parseFloat(d.style.minHeight),g=parseFloat(d.style.height),m=Math.max(v,g);if(m0?S:0,d.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});VB.displayName=EE;var GB="SelectGroup",[qJ,KJ]=wf(GB),YJ=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=sr();return h.jsx(qJ,{scope:n,id:i,children:h.jsx(nt.div,{role:"group","aria-labelledby":i,...r,ref:e})})});YJ.displayName=GB;var WB="SelectLabel",XB=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=KJ(WB,n);return h.jsx(nt.div,{id:i.id,...r,ref:e})});XB.displayName=WB;var Cy="SelectItem",[JJ,qB]=wf(Cy),KB=_.forwardRef((t,e)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...a}=t,s=Ml(Cy,n),l=Al(Cy,n),c=s.value===r,[u,d]=_.useState(o??""),[f,p]=_.useState(!1),y=Ot(e,x=>{var b;return(b=l.itemRefCallback)==null?void 0:b.call(l,x,r,i)}),v=sr(),g=_.useRef("touch"),m=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return h.jsx(JJ,{scope:n,value:r,disabled:i,textId:v,isSelected:c,onItemTextChange:_.useCallback(x=>{d(b=>b||((x==null?void 0:x.textContent)??"").trim())},[]),children:h.jsx(Ox.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:h.jsx(nt.div,{role:"option","aria-labelledby":v,"data-highlighted":f?"":void 0,"aria-selected":c&&f,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...a,ref:y,onFocus:Oe(a.onFocus,()=>p(!0)),onBlur:Oe(a.onBlur,()=>p(!1)),onClick:Oe(a.onClick,()=>{g.current!=="mouse"&&m()}),onPointerUp:Oe(a.onPointerUp,()=>{g.current==="mouse"&&m()}),onPointerDown:Oe(a.onPointerDown,x=>{g.current=x.pointerType}),onPointerMove:Oe(a.onPointerMove,x=>{var b;g.current=x.pointerType,i?(b=l.onItemLeave)==null||b.call(l):g.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Oe(a.onPointerLeave,x=>{var b;x.currentTarget===document.activeElement&&((b=l.onItemLeave)==null||b.call(l))}),onKeyDown:Oe(a.onKeyDown,x=>{var S;((S=l.searchRef)==null?void 0:S.current)!==""&&x.key===" "||(kJ.includes(x.key)&&m(),x.key===" "&&x.preventDefault())})})})})});KB.displayName=Cy;var Ah="SelectItemText",YB=_.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:i,...o}=t,a=Ml(Ah,n),s=Al(Ah,n),l=qB(Ah,n),c=BJ(Ah,n),[u,d]=_.useState(null),f=Ot(e,m=>d(m),l.onItemTextChange,m=>{var x;return(x=s.itemTextRefCallback)==null?void 0:x.call(s,m,l.value,l.disabled)}),p=u==null?void 0:u.textContent,y=_.useMemo(()=>h.jsx("option",{value:l.value,disabled:l.disabled,children:p},l.value),[l.disabled,l.value,p]),{onNativeOptionAdd:v,onNativeOptionRemove:g}=c;return ur(()=>(v(y),()=>g(y)),[v,g,y]),h.jsxs(h.Fragment,{children:[h.jsx(nt.span,{id:l.textId,...o,ref:f}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Bc.createPortal(o.children,a.valueNode):null]})});YB.displayName=Ah;var JB="SelectItemIndicator",ZB=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return qB(JB,n).isSelected?h.jsx(nt.span,{"aria-hidden":!0,...r,ref:e}):null});ZB.displayName=JB;var TE="SelectScrollUpButton",QB=_.forwardRef((t,e)=>{const n=Al(TE,t.__scopeSelect),r=FA(TE,t.__scopeSelect),[i,o]=_.useState(!1),a=Ot(e,r.onScrollButtonChange);return ur(()=>{if(n.viewport&&n.isPositioned){let s=function(){const c=l.scrollTop>0;o(c)};const l=n.viewport;return s(),l.addEventListener("scroll",s),()=>l.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?h.jsx(t4,{...t,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop-l.offsetHeight)}}):null});QB.displayName=TE;var ME="SelectScrollDownButton",e4=_.forwardRef((t,e)=>{const n=Al(ME,t.__scopeSelect),r=FA(ME,t.__scopeSelect),[i,o]=_.useState(!1),a=Ot(e,r.onScrollButtonChange);return ur(()=>{if(n.viewport&&n.isPositioned){let s=function(){const c=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)l.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?h.jsx(t4,{...t,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop+l.offsetHeight)}}):null});e4.displayName=ME;var t4=_.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=t,o=Al("SelectScrollButton",n),a=_.useRef(null),s=Ix(n),l=_.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return _.useEffect(()=>()=>l(),[l]),ur(()=>{var u;const c=s().find(d=>d.ref.current===document.activeElement);(u=c==null?void 0:c.ref.current)==null||u.scrollIntoView({block:"nearest"})},[s]),h.jsx(nt.div,{"aria-hidden":!0,...i,ref:e,style:{flexShrink:0,...i.style},onPointerDown:Oe(i.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:Oe(i.onPointerMove,()=>{var c;(c=o.onItemLeave)==null||c.call(o),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:Oe(i.onPointerLeave,()=>{l()})})}),ZJ="SelectSeparator",n4=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return h.jsx(nt.div,{"aria-hidden":!0,...r,ref:e})});n4.displayName=ZJ;var AE="SelectArrow",QJ=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=Dx(n),o=Ml(AE,n),a=Al(AE,n);return o.open&&a.position==="popper"?h.jsx(yx,{...i,...r,ref:e}):null});QJ.displayName=AE;var eZ="SelectBubbleInput",r4=_.forwardRef(({__scopeSelect:t,value:e,...n},r)=>{const i=_.useRef(null),o=Ot(r,i),a=NA(e);return _.useEffect(()=>{const s=i.current;if(!s)return;const l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==e&&u){const d=new Event("change",{bubbles:!0});u.call(s,e),s.dispatchEvent(d)}},[a,e]),h.jsx(nt.select,{...n,style:{...gU,...n.style},ref:o,defaultValue:e})});r4.displayName=eZ;function i4(t){return t===""||t===void 0}function o4(t){const e=di(t),n=_.useRef(""),r=_.useRef(0),i=_.useCallback(a=>{const s=n.current+a;e(s),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(s)},[e]),o=_.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return _.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function a4(t,e,n){const i=e.length>1&&Array.from(e).every(c=>c===e[0])?e[0]:e,o=n?t.indexOf(n):-1;let a=tZ(t,Math.max(o,0));i.length===1&&(a=a.filter(c=>c!==n));const l=a.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function tZ(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var nZ=IB,s4=LB,rZ=jB,iZ=UB,oZ=FB,l4=BB,aZ=VB,c4=XB,u4=KB,sZ=YB,lZ=ZB,d4=QB,f4=e4,h4=n4;const Ga=nZ,Wa=rZ,sa=_.forwardRef(({className:t,children:e,...n},r)=>h.jsxs(s4,{ref:r,className:He("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...n,children:[e,h.jsx(iZ,{asChild:!0,children:h.jsx(hc,{className:"h-4 w-4 text-slate-400"})})]}));sa.displayName=s4.displayName;const p4=_.forwardRef(({className:t,...e},n)=>h.jsx(d4,{ref:n,className:He("flex cursor-default items-center justify-center py-1",t),...e,children:h.jsx(q9,{className:"h-4 w-4"})}));p4.displayName=d4.displayName;const m4=_.forwardRef(({className:t,...e},n)=>h.jsx(f4,{ref:n,className:He("flex cursor-default items-center justify-center py-1",t),...e,children:h.jsx(hc,{className:"h-4 w-4"})}));m4.displayName=f4.displayName;const la=_.forwardRef(({className:t,children:e,position:n="popper",...r},i)=>h.jsx(oZ,{children:h.jsxs(l4,{ref:i,className:He("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:n,...r,children:[h.jsx(p4,{}),h.jsx(aZ,{className:He("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),h.jsx(m4,{})]})}));la.displayName=l4.displayName;const cZ=_.forwardRef(({className:t,...e},n)=>h.jsx(c4,{ref:n,className:He("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...e}));cZ.displayName=c4.displayName;const $n=_.forwardRef(({className:t,children:e,...n},r)=>h.jsxs(u4,{ref:r,className:He("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[h.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:h.jsx(lZ,{children:h.jsx(xl,{className:"h-4 w-4"})})}),h.jsx(sZ,{children:e})]}));$n.displayName=u4.displayName;const uZ=_.forwardRef(({className:t,...e},n)=>h.jsx(h4,{ref:n,className:He("-mx-1 my-1 h-px bg-muted",t),...e}));uZ.displayName=h4.displayName;const th=t=>t.toLowerCase().replace(/\s+/g," ").trim();function g4({enabled:t=!0}={}){const{baseUrl:e,fetchWithHeaders:n}=Dn(),[r,i]=_.useState([]),[o,a]=_.useState(!1),s=_.useCallback(async()=>{a(!0);try{try{(await navigator.mediaDevices.getUserMedia({video:!0})).getTracks().forEach(v=>v.stop())}catch{}const l=(await navigator.mediaDevices.enumerateDevices()).filter(y=>y.kind==="videoinput").map(y=>({deviceId:y.deviceId,label:y.label})),c=await n(`${e}/available-cameras`);if(!c.ok)return i([]),[];const d=(await c.json()).cameras??[],f=new Set,p=d.map(y=>{const v=y.name||`Camera ${y.index}`,g=th(v),m=l.filter(b=>!f.has(b.deviceId)&&b.label),x=m.find(b=>th(b.label)===g)||m.find(b=>th(b.label).startsWith(g))||m.find(b=>th(b.label).includes(g)||g.includes(th(b.label)));return x&&f.add(x.deviceId),{index:y.index,name:v,deviceId:(x==null?void 0:x.deviceId)??"",available:y.available}});return i(p),p}catch{return i([]),[]}finally{a(!1)}},[e,n]);return _.useEffect(()=>{if(!t)return;s();const l=()=>s();return navigator.mediaDevices.addEventListener("devicechange",l),()=>navigator.mediaDevices.removeEventListener("devicechange",l)},[t,s]),{cameras:r,isLoading:o,refresh:s}}function v4(t,e){const n=_.useRef(null),[r,i]=_.useState(!1);return _.useEffect(()=>{if(e||!t){t||i(!0);return}let o=!1,a=null;return i(!1),(async()=>{try{if(a=await navigator.mediaDevices.getUserMedia({video:{deviceId:{exact:t}}}),o){a.getTracks().forEach(s=>s.stop());return}n.current&&(n.current.srcObject=a,await n.current.play().catch(()=>{}))}catch{i(!0)}})(),()=>{o=!0,a&&a.getTracks().forEach(s=>s.stop())}},[t,e]),{videoRef:n,hasError:r}}const y4=({cameras:t,onCamerasChange:e,releaseStreamsRef:n})=>{const{toast:r}=_r(),{cameras:i,isLoading:o,refresh:a}=g4(),[s,l]=_.useState(""),[c,u]=_.useState("");_.useEffect(()=>{if(i.length===0||t.length===0)return;let m=!1;const x=t.map(b=>{if(!b.device_id)return b;const S=i.find(w=>w.deviceId===b.device_id);return S&&S.index!==b.camera_index?(m=!0,{...b,camera_index:S.index}):b});m&&e(x)},[i]);const d=()=>{if(!s||!c.trim()){r({title:"Missing Information",description:"Please select a camera and provide a name.",variant:"destructive"});return}const m=parseInt(s),x=i.find(w=>w.index===m);if(!x){r({title:"Invalid Camera",description:"Selected camera is not available.",variant:"destructive"});return}if(t.some(w=>w.camera_index===x.index||x.deviceId&&w.device_id===x.deviceId)){r({title:"Camera Already Added",description:"This camera is already in the configuration.",variant:"destructive"});return}const S={id:`camera_${Date.now()}`,name:c.trim(),type:"opencv",camera_index:x.index,device_id:x.deviceId,width:640,height:480,fps:30};e([...t,S]),l(""),u(""),r({title:"Camera Added",description:`${S.name} has been added to the configuration.`})},f=m=>{e(t.filter(x=>x.id!==m)),r({title:"Camera Removed",description:"Camera has been removed from the configuration."})},p=(m,x)=>{e(t.map(b=>b.id===m?{...b,...x}:b))},[y,v]=_.useState(!1),g=_.useCallback(()=>{v(!0)},[]);return _.useEffect(()=>{n&&(n.current=g)},[n,g]),h.jsxs("div",{className:"space-y-4",children:[h.jsx("h3",{className:"text-lg font-semibold text-white border-b border-gray-700 pb-2",children:"Camera Configuration"}),h.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-4 space-y-4",children:[h.jsx("h4",{className:"text-md font-medium text-gray-300",children:"Add Camera"}),h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx(Tt,{className:"text-sm font-medium text-gray-300",children:"Available Cameras"}),h.jsx(Je,{type:"button",variant:"ghost",size:"icon",onClick:()=>a(),disabled:o,className:"h-6 w-6 text-gray-400 hover:text-white",title:"Rescan for cameras (e.g. after plugging in a new USB camera)","aria-label":"Rescan for cameras",children:h.jsx(oA,{className:`w-3.5 h-3.5 ${o?"animate-spin":""}`})})]}),h.jsxs(Ga,{value:s,onValueChange:l,disabled:o,children:[h.jsx(sa,{className:"bg-gray-800 border-gray-700 text-white",children:h.jsx(Wa,{placeholder:o?"Loading cameras...":"Select camera"})}),h.jsx(la,{className:"bg-gray-800 border-gray-700",children:i.map(m=>{const x=t.some(b=>b.camera_index===m.index||m.deviceId&&b.device_id===m.deviceId);return h.jsx($n,{value:m.index.toString(),className:"text-white hover:bg-gray-700",disabled:!m.available||x,children:h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{className:"font-medium",children:m.name}),h.jsxs("span",{className:"text-xs text-gray-400",children:["Index ",m.index,x&&" ยท already added"]})]})},m.index)})})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(Tt,{className:"text-sm font-medium text-gray-300",children:"Camera Name"}),h.jsx(hi,{value:c,onChange:m=>u(m.target.value),placeholder:"e.g., workspace_cam",className:"bg-gray-800 border-gray-700 text-white"})]}),h.jsx("div",{className:"space-y-2 flex flex-col justify-end",children:h.jsxs(Je,{onClick:d,className:"bg-blue-500 hover:bg-blue-600 text-white",disabled:!s||!c.trim(),children:[h.jsx(iA,{className:"w-4 h-4 mr-2"}),"Add Camera"]})})]})]}),t.length>0&&h.jsxs("div",{className:"space-y-4",children:[h.jsxs("h4",{className:"text-md font-medium text-gray-300",children:["Configured Cameras (",t.length,")"]}),h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-2 gap-4",children:t.map(m=>h.jsx(dZ,{camera:m,paused:y,onRemove:()=>f(m.id),onUpdate:x=>p(m.id,x)},m.id))})]}),t.length===0&&h.jsxs("div",{className:"text-center py-8 text-gray-500",children:[h.jsx(UU,{className:"w-12 h-12 mx-auto mb-4 text-gray-600"}),h.jsx("p",{children:"No cameras configured. Add a camera to get started."})]})]})},dZ=({camera:t,paused:e,onRemove:n,onUpdate:r})=>{var s;const{videoRef:i,hasError:o}=v4(t.device_id,e),a=!e&&t.device_id&&!o;return h.jsxs("div",{className:"bg-gray-900 rounded-lg border border-gray-700 overflow-hidden",children:[h.jsx("div",{className:"aspect-[4/3] bg-gray-800 relative",children:a?h.jsx("video",{ref:i,autoPlay:!0,muted:!0,playsInline:!0,className:"w-full h-full object-cover"}):h.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center",children:[h.jsx(BU,{className:"w-8 h-8 text-gray-500 mb-2"}),h.jsx("span",{className:"text-gray-500 text-sm",children:e?"Preview paused":t.device_id?"Preview failed":"No browser match"})]})}),h.jsxs("div",{className:"p-3 space-y-2",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("h5",{className:"font-medium text-white truncate",children:t.name}),h.jsx(Je,{onClick:n,size:"sm",variant:"ghost",className:"text-red-400 hover:text-red-300 hover:bg-red-900/20 p-1",children:h.jsx(ax,{className:"w-4 h-4"})})]}),h.jsxs("div",{className:"grid grid-cols-1 gap-2 text-xs text-gray-400",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"w-16",children:"Resolution:"}),h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx(mr,{value:t.width,onChange:l=>{l!==void 0&&r({width:l})},className:"bg-gray-800 border-gray-700 text-white text-xs h-6 px-2 w-16",min:"320",max:"1920"}),h.jsx("span",{className:"flex items-center",children:"ร—"}),h.jsx(mr,{value:t.height,onChange:l=>{l!==void 0&&r({height:l})},className:"bg-gray-800 border-gray-700 text-white text-xs h-6 px-2 w-16",min:"240",max:"1080"})]})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"w-16",children:"FPS:"}),h.jsx(mr,{value:t.fps??30,onChange:l=>{l!==void 0&&r({fps:l})},className:"bg-gray-800 border-gray-700 text-white text-xs h-6 px-2 w-16",min:"10",max:"60"})]})]}),h.jsxs("div",{className:"text-xs text-gray-500",children:["Type: ",t.type," | Device: ",(s=t.device_id)==null?void 0:s.substring(0,10),"..."]})]})]})},fZ=({open:t,onOpenChange:e,robot:n,datasetName:r,setDatasetName:i,singleTask:o,setSingleTask:a,numEpisodes:s,setNumEpisodes:l,episodeTimeS:c,setEpisodeTimeS:u,resetTimeS:d,setResetTimeS:f,streamingEncoding:p,setStreamingEncoding:y,cameras:v,setCameras:g,onStart:m,releaseStreamsRef:x})=>{const{auth:b}=xf(),S=!!n&&n.is_clean;return h.jsx(Hc,{open:t,onOpenChange:e,children:h.jsxs(bl,{className:"bg-gray-900 border-gray-800 text-white sm:max-w-[600px] p-8 max-h-[90vh] overflow-y-auto",children:[h.jsxs(_l,{children:[h.jsx("div",{className:"flex justify-center items-center mb-4",children:h.jsx("div",{className:"w-8 h-8 bg-red-500 rounded-full flex items-center justify-center",children:h.jsx("span",{className:"text-white font-bold text-sm",children:"REC"})})}),h.jsx(wl,{className:"text-white text-center text-2xl font-bold",children:"Configure Recording"})]}),h.jsxs("div",{className:"space-y-6 py-4",children:[h.jsx(Sl,{className:"text-gray-400 text-base leading-relaxed text-center",children:"Pick a configured robot and dataset parameters for recording."}),h.jsxs("div",{className:"grid grid-cols-1 gap-6",children:[h.jsxs("div",{className:"space-y-4",children:[h.jsx("h3",{className:"text-lg font-semibold text-white border-b border-gray-700 pb-2",children:"Robot Configuration"}),n?n.is_clean?h.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[h.jsx(qi,{className:"w-4 h-4 text-green-400"}),h.jsxs("span",{className:"text-slate-200",children:["Recording with ",h.jsx("strong",{children:n.name})]})]}):h.jsxs(Mi,{className:"bg-amber-900/40 border-amber-700 text-amber-100",children:[h.jsx(oa,{className:"h-4 w-4"}),h.jsxs(Ai,{children:[h.jsx("strong",{children:n.name})," is missing a calibration. Configure it before recording."]})]}):h.jsxs(Mi,{className:"bg-amber-900/40 border-amber-700 text-amber-100",children:[h.jsx(oa,{className:"h-4 w-4"}),h.jsx(Ai,{children:"Select and configure a robot on the Landing page before recording."})]})]}),h.jsxs("div",{className:"space-y-4",children:[h.jsx("h3",{className:"text-lg font-semibold text-white border-b border-gray-700 pb-2",children:"Dataset Configuration"}),h.jsxs("div",{className:"grid grid-cols-1 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(Tt,{htmlFor:"datasetName",className:"text-sm font-medium text-gray-300",children:"Dataset Name *"}),h.jsx(hi,{id:"datasetName",value:r,onChange:w=>i(w.target.value.replace(/[^A-Za-z0-9._-]/g,"_")),placeholder:"my_dataset",className:"bg-gray-800 border-gray-700 text-white"}),h.jsxs("p",{className:"text-xs text-gray-500",children:["Letters, numbers, ",h.jsx("code",{children:"."})," ",h.jsx("code",{children:"_"})," ",h.jsx("code",{children:"-"})," only โ€” other characters become"," ",h.jsx("code",{children:"_"}),"."]}),r&&(b.status==="authenticated"?h.jsxs("p",{className:"text-xs text-gray-500",children:["Will be saved as"," ",h.jsxs("span",{className:"text-gray-300 font-mono",children:[b.username,"/",r]})]}):b.status==="unauthenticated"?h.jsx("p",{className:"text-xs text-amber-400/80",children:"Log in to Hugging Face to set the repository owner."}):null)]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(Tt,{htmlFor:"singleTask",className:"text-sm font-medium text-gray-300",children:"Task Description *"}),h.jsx(hi,{id:"singleTask",value:o,onChange:w=>a(w.target.value),placeholder:"e.g., pick up the red block and place it on the blue square",className:"bg-gray-800 border-gray-700 text-white"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(Tt,{htmlFor:"numEpisodes",className:"text-sm font-medium text-gray-300",children:"Number of Episodes"}),h.jsx(mr,{id:"numEpisodes",min:"1",max:"100",value:s,onChange:w=>{w!==void 0&&l(w)},className:"bg-gray-800 border-gray-700 text-white"})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(Tt,{htmlFor:"episodeTimeS",className:"text-sm font-medium text-gray-300",children:"Episode duration (seconds)"}),h.jsx(mr,{id:"episodeTimeS",min:"1",value:c,onChange:w=>{w!==void 0&&u(w)},className:"bg-gray-800 border-gray-700 text-white"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(Tt,{htmlFor:"resetTimeS",className:"text-sm font-medium text-gray-300",children:"Reset duration (seconds)"}),h.jsx(mr,{id:"resetTimeS",min:"1",value:d,onChange:w=>{w!==void 0&&f(w)},className:"bg-gray-800 border-gray-700 text-white"})]})]})]})]}),h.jsx("div",{className:"space-y-4",children:h.jsx(y4,{cameras:v,onCamerasChange:g,releaseStreamsRef:x})}),h.jsxs(Ty,{className:"space-y-4 group",children:[h.jsxs(My,{className:"flex items-center justify-between w-full text-lg font-semibold text-white border-b border-gray-700 pb-2",children:[h.jsx("span",{children:"Advanced Parameters"}),h.jsx(hc,{className:"w-4 h-4 transition-transform group-data-[state=open]:rotate-180"})]}),h.jsx(Ay,{className:"space-y-3",children:h.jsxs("div",{className:"flex items-start gap-3",children:[h.jsx(DA,{id:"streamingEncoding",checked:p,onCheckedChange:w=>y(w===!0),className:"mt-0.5 border-gray-500 data-[state=checked]:bg-red-500 data-[state=checked]:border-red-500"}),h.jsxs("div",{className:"space-y-1",children:[h.jsx(Tt,{htmlFor:"streamingEncoding",className:"text-sm font-medium text-gray-200 cursor-pointer",children:"Streaming video encoding"}),h.jsx("p",{className:"text-xs text-gray-500",children:"Encodes frames in real time during capture so each episode saves almost instantly. Uncheck to fall back to the slower PNG-then-encode flow."})]})]})})]})]}),h.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center pt-4",children:[h.jsx(Je,{onClick:m,disabled:!S,className:"w-full sm:w-auto bg-red-500 hover:bg-red-600 text-white px-10 py-6 text-lg transition-all shadow-md shadow-red-500/30 hover:shadow-lg hover:shadow-red-500/40 disabled:opacity-40 disabled:cursor-not-allowed",children:"Start Recording"}),h.jsx(Je,{onClick:()=>e(!1),variant:"outline",className:"w-full sm:w-auto border-gray-500 hover:border-gray-200 px-10 py-6 text-lg text-zinc-500 bg-zinc-900 hover:bg-zinc-800",children:"Cancel"})]})]})]})})},hZ=/^[\w.\-]+\/[\w.\-]+$/,pZ=/^[A-Za-z0-9._-]+$/,mZ=({datasets:t,loading:e,onPickExisting:n,onCreateNew:r,onOpenCustom:i,children:o})=>{const[a,s]=_.useState(!1),[l,c]=_.useState(""),u=l.trim(),d=t.some(C=>C.repo_id.toLowerCase()===u.toLowerCase()),f=hZ.test(u),p=pZ.test(u)&&!u.includes("/"),y=u.length>0&&p&&!d,v=f&&!d,g=d||u!==""&&!y,m=d?"Already exists":u===""?"Create new datasetโ€ฆ":y?`Create "${u}"`:'Use a name without "/"',x=()=>{g||(r(u),w())},b=t.filter(C=>C.source==="local"||C.source==="both"),S=t.filter(C=>C.source==="hub"),w=()=>{c(""),s(!1)},E=C=>{n(C),w()},T=()=>{y&&(r(u),w())},A=()=>{v&&(i(u),w())},M=C=>h.jsxs(kd,{value:C.repo_id,onSelect:()=>E(C),className:"text-white aria-selected:bg-gray-700",children:[h.jsx("span",{className:"flex-1 truncate",children:C.repo_id}),C.source==="both"&&h.jsx("span",{className:"text-xs text-gray-400 mr-2",children:"on Hub"}),C.private&&h.jsx("span",{className:"text-xs text-amber-400",children:"private"})]},C.repo_id);return h.jsxs(Sx,{open:a,onOpenChange:s,children:[h.jsx(Ex,{asChild:!0,children:o}),h.jsx(Rm,{className:"w-[320px] p-0 bg-gray-800 border-gray-700 text-white",align:"end",children:h.jsxs(Mx,{className:"bg-gray-800",children:[h.jsx(Ax,{placeholder:"Search, type a new name, or org/nameโ€ฆ",value:l,onValueChange:C=>c(C.replace(/[^A-Za-z0-9._\-/]/g,"_")),onKeyDown:C=>{C.key==="Enter"&&(y?(C.preventDefault(),T()):v&&(C.preventDefault(),A()))},className:"text-white"}),h.jsxs(Cx,{children:[t.length===0&&!y&&!v&&h.jsx(Px,{className:"py-4 text-sm text-gray-400 text-center",children:e?"Loading datasetsโ€ฆ":"No datasets yet. Type a name to create one."}),b.length>0&&h.jsx(Qs,{heading:"Local",children:b.map(M)}),S.length>0&&h.jsx(Qs,{heading:"Hugging Face",children:S.map(M)}),v&&h.jsx(Qs,{heading:"Custom repo",children:h.jsxs(kd,{value:`__open__${u}`,onSelect:A,className:"text-white aria-selected:bg-gray-700",children:[h.jsx(cl,{className:"mr-2 h-4 w-4"}),'Open "',u,'" in viewer']})})]}),h.jsxs("button",{type:"button",onClick:x,disabled:g,className:"flex w-full items-center gap-2 border-t border-gray-700 px-3 py-2 text-sm text-white hover:bg-gray-700 disabled:cursor-not-allowed disabled:text-gray-500 disabled:hover:bg-transparent",children:[h.jsx(iA,{className:"h-4 w-4"}),m]})]})})]})},gZ=(t,e)=>{const{wsBaseUrl:n}=Dn(),r=_.useRef(t);r.current=t;const i=_.useRef(e);i.current=e,_.useEffect(()=>{let o=!1,a=null,s=null;const l=()=>{if(!o){try{a=new WebSocket(`${n}/ws/joint-data`)}catch{s=setTimeout(l,3e3);return}a.onmessage=c=>{try{const u=JSON.parse(c.data);(u==null?void 0:u.type)==="jobs_changed"?r.current():(u==null?void 0:u.type)==="job_progress"&&i.current&&Array.isArray(u==null?void 0:u.jobs)&&i.current(u.jobs)}catch{}},a.onclose=()=>{o||(s=setTimeout(l,3e3))}}};return l(),()=>{o=!0,s&&clearTimeout(s),a&&a.close()}},[n])};class Lx extends Error{constructor(n,r,i){super(n);Jb(this,"status");Jb(this,"detail");this.name="ApiError",this.status=r,this.detail=i}}async function er(t,e,n,{method:r="GET",body:i,signal:o,action:a}={}){const s={method:r,signal:o};i!==void 0&&(s.body=JSON.stringify(i));const l=`${t}${n}`,c=await e(l,s);if(!c.ok){let u=null;try{const f=await c.json();u=(f==null?void 0:f.detail)??(f==null?void 0:f.message)??null}catch{}const d=a||`${r} ${n}`;throw new Lx(`${d} failed: ${u??c.status}`,c.status,u)}if(c.status!==204)return c.json()}async function CE(t,e,n=10,r){return(await er(t,e,`/jobs?limit=${n}`,{signal:r,action:"List jobs"})).jobs}async function vZ(t,e,n,r){return er(t,e,`/jobs/${n}`,{signal:r,action:"Get job"})}async function yZ(t,e,n,r){return(await er(t,e,`/jobs/${n}/logs`,{signal:r,action:"Get job logs"})).logs}async function xZ(t,e,n,r){return(await er(t,e,`/jobs/${n}/log-file`,{signal:r,action:"Get job log file"})).logs}async function bZ(t,e,n,r){return(await er(t,e,`/jobs/${n}/metrics-history`,{signal:r,action:"Get job metrics history"})).points}async function _Z(t,e,n){const{target:r,...i}=n,o=r?{config:i,target:r}:i;try{return await er(t,e,"/jobs/training",{method:"POST",body:o,action:"Start training"})}catch(a){throw a instanceof Lx&&a.status===409?new Error("Another training is already running. Stop it first."):a}}async function x4(t,e,n){return er(t,e,`/jobs/${n}/stop`,{method:"POST",action:"Stop job"})}async function wZ(t,e,n,r){return er(t,e,`/jobs/providers/${encodeURIComponent(n)}/jobs/${encodeURIComponent(r)}/attach`,{method:"POST",action:"Attach provider job"})}async function b4(t,e,n){await er(t,e,`/jobs/${n}`,{method:"DELETE",action:"Delete job"})}const SZ={authenticated:!1,username:null,flavors:[],providers:[]};async function RN(t,e,n){try{const r=await er(t,e,"/jobs/runners/hardware",{signal:n,action:"List runner hardware"});return{authenticated:!!r.authenticated,username:r.username??null,flavors:Array.isArray(r.flavors)?r.flavors:[],providers:Array.isArray(r.providers)?r.providers.map(i=>({...i,flavors:Array.isArray(i.flavors)?i.flavors:[]})):[]}}catch(r){if(r instanceof Lx)return SZ;throw r}}async function EZ(t,e,n){return er(t,e,"/compute/seeed-cloud/config",{signal:n,action:"Get Seeed Cloud config"})}async function TZ(t,e,n){return er(t,e,"/compute/seeed-cloud/config",{method:"POST",body:n,action:"Save Seeed Cloud config"})}const MZ={authenticated:!1,jobs:[],models:[]};async function AZ(t,e,n){try{return await er(t,e,"/jobs/hub",{signal:n,action:"List hub jobs"})}catch(r){if(r instanceof Lx)return MZ;throw r}}const Gr=_.forwardRef(({className:t,...e},n)=>h.jsx("div",{ref:n,className:He("rounded-lg border bg-card text-card-foreground shadow-sm",t),...e}));Gr.displayName="Card";const Uo=_.forwardRef(({className:t,...e},n)=>h.jsx("div",{ref:n,className:He("flex flex-col space-y-1.5 p-6",t),...e}));Uo.displayName="CardHeader";const ga=_.forwardRef(({className:t,...e},n)=>h.jsx("h3",{ref:n,className:He("text-2xl font-semibold leading-none tracking-tight",t),...e}));ga.displayName="CardTitle";const CZ=_.forwardRef(({className:t,...e},n)=>h.jsx("p",{ref:n,className:He("text-sm text-muted-foreground",t),...e}));CZ.displayName="CardDescription";const Wr=_.forwardRef(({className:t,...e},n)=>h.jsx("div",{ref:n,className:He("p-6 pt-0",t),...e}));Wr.displayName="CardContent";const PZ=_.forwardRef(({className:t,...e},n)=>h.jsx("div",{ref:n,className:He("flex items-center p-6 pt-0",t),...e}));PZ.displayName="CardFooter";async function BA(t,e,n,r){return(await er(t,e,`/jobs/${n}/checkpoints`,{signal:r,action:"List checkpoints"})).checkpoints}async function RZ(t,e,n,r,i){return er(t,e,`/jobs/${n}/checkpoints/${r}/policy-config`,{signal:i,action:"Load policy config"})}const $A=({checkpoints:t,selectedStep:e,onChange:n,disabled:r,placeholder:i="Select checkpoint"})=>{const o=e!=null?String(e):void 0;return h.jsxs(Ga,{value:o,onValueChange:a=>n(Number(a)),disabled:r||t.length===0,children:[h.jsx(sa,{className:"bg-slate-800 border-slate-700 text-white h-8 text-xs px-2 w-auto min-w-[110px]",onClick:a=>a.stopPropagation(),children:h.jsx(Wa,{placeholder:i})}),h.jsx(la,{className:"bg-slate-900 border-slate-700 text-white",children:t.map(a=>h.jsxs($n,{value:String(a.step),onClick:s=>s.stopPropagation(),children:["step ",a.step]},a.step))})]})};function NN(t){const e=Math.max(0,Date.now()/1e3-t);return e<60?`${Math.floor(e)}s ago`:e<3600?`${Math.floor(e/60)}m ago`:e<86400?`${Math.floor(e/3600)}h ago`:`${Math.floor(e/86400)}d ago`}const NZ={running:{label:"Running",color:"text-green-400",Icon:fi},done:{label:"Done",color:"text-slate-400",Icon:nA},failed:{label:"Failed",color:"text-red-400",Icon:nd},interrupted:{label:"Interrupted",color:"text-amber-400",Icon:oa}},Mg=({job:t,onStop:e,onDelete:n,onPlay:r})=>{const i=ji(),{baseUrl:o,fetchWithHeaders:a}=Dn(),s=NZ[t.state],l=s.Icon,c=t.state==="running",u=c&&t.metrics.total_steps===0,d=t.metrics.total_steps>0?Math.min(100,t.metrics.current_step/t.metrics.total_steps*100):0,f=u?"startingโ€ฆ":c?`started ${NN(t.started_at)}`:t.ended_at!=null?`ended ${NN(t.ended_at)}`:s.label.toLowerCase(),[p,y]=_.useState([]),[v,g]=_.useState(null);_.useEffect(()=>{if(t.checkpoint_count<=0){y([]),g(null);return}let w=!1;return BA(o,a,t.id).then(E=>{if(!w)if(y(E),E.length>0){const T=E[E.length-1].step;g(A=>A!=null&&E.some(M=>M.step===A)?A:T)}else g(null)}).catch(()=>{w||(y([]),g(null))}),()=>{w=!0}},[o,a,t.id,t.checkpoint_count]);const m=w=>{w.stopPropagation(),c?window.confirm("Stop this run?")&&e(t.id):window.confirm("Delete this run? This wipes the output directory.")&&n(t.id)},x=w=>{w.stopPropagation(),v!=null&&r(t,v)},b=c,S=p.length>0&&v!=null;return h.jsx(Gr,{onClick:()=>i(`/training/${t.id}`),className:"bg-slate-800/50 border-slate-700 rounded-xl cursor-pointer hover:border-slate-500 transition-colors",children:h.jsxs(Wr,{className:"p-4 space-y-3",children:[h.jsxs("div",{className:"flex items-start justify-between gap-2",children:[h.jsxs("div",{className:`flex items-center gap-1.5 text-xs font-semibold ${s.color}`,children:[h.jsx(l,{className:`w-3.5 h-3.5 ${c?"animate-spin":""}`}),s.label]}),t.runner==="hf_cloud"&&t.hf_job_url?h.jsx(Je,{variant:"ghost",size:"icon",asChild:!0,className:"h-7 w-7 text-slate-400 hover:text-white","aria-label":"Open Hub job page",children:h.jsx("a",{href:t.hf_job_url,target:"_blank",rel:"noopener noreferrer",onClick:w=>w.stopPropagation(),children:h.jsx(cl,{className:"w-3.5 h-3.5"})})}):h.jsx(Je,{variant:"ghost",size:"icon",onClick:m,className:"h-7 w-7 text-slate-400 hover:text-white","aria-label":c?"Stop job":"Delete job",children:c?h.jsx(Od,{className:"w-3.5 h-3.5"}):h.jsx(ax,{className:"w-3.5 h-3.5"})})]}),h.jsxs("div",{children:[h.jsx("div",{className:"text-white font-semibold truncate",title:t.name,children:t.name}),h.jsx("div",{className:"text-xs text-slate-400",children:f})]}),b?h.jsxs("div",{className:"relative h-5 w-full overflow-hidden rounded-md bg-slate-900 border border-slate-700",children:[h.jsx("div",{className:"h-full bg-gradient-to-r from-blue-500 to-sky-400 transition-[width] duration-500",style:{width:`${d}%`}}),h.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-xs font-semibold text-white tabular-nums drop-shadow",children:u?"Training startingโ€ฆ":`${d.toFixed(1)}%`})]}):null,S?h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx($A,{checkpoints:p,selectedStep:v,onChange:g}),h.jsx(Je,{size:"icon",onClick:x,className:"h-8 w-8 bg-green-500 hover:bg-green-600 text-white","aria-label":"Run inference with this checkpoint",children:h.jsx(Tc,{className:"w-4 h-4"})})]}):null]})})};function OZ(t){if(!t)return"โ€”";const e=Date.parse(t);if(Number.isNaN(e))return"โ€”";const n=Math.max(0,(Date.now()-e)/1e3);return n<60?`${Math.floor(n)}s ago`:n<3600?`${Math.floor(n/60)}m ago`:n<86400?`${Math.floor(n/3600)}h ago`:`${Math.floor(n/86400)}d ago`}const IZ={RUNNING:{label:"Running",color:"text-green-400",Icon:fi,spin:!0},QUEUED:{label:"Queued",color:"text-amber-400",Icon:hE},SCHEDULING:{label:"Scheduling",color:"text-amber-400",Icon:hE},COMPLETED:{label:"Done",color:"text-slate-400",Icon:nA},FAILED:{label:"Failed",color:"text-red-400",Icon:nd},CANCELED:{label:"Cancelled",color:"text-amber-400",Icon:oa},CANCELLED:{label:"Cancelled",color:"text-amber-400",Icon:oa}},ON=({job:t,onOpen:e,busy:n=!1})=>{var c,u,d;const r=((u=(c=t.status)==null?void 0:c.stage)==null?void 0:u.toUpperCase())??"",i=IZ[r]??{label:r||"Unknown",color:"text-slate-400",Icon:K9},o=i.Icon,a=t.docker_image??t.space_id??`Job ${t.id.slice(0,12)}โ€ฆ`,s=!!t.url,l=!!(e||s);return h.jsx(Gr,{onClick:()=>{if(!n){if(e){e(t);return}s&&window.open(t.url,"_blank","noopener,noreferrer")}},className:`bg-slate-800/50 border-slate-700 rounded-xl hover:border-slate-500 transition-colors ${l?"cursor-pointer":""}`,children:h.jsxs(Wr,{className:"p-4 space-y-3",children:[h.jsxs("div",{className:"flex items-start justify-between gap-2",children:[h.jsxs("div",{className:`flex items-center gap-1.5 text-xs font-semibold ${i.color}`,children:[h.jsx(o,{className:`w-3.5 h-3.5 ${i.spin||n?"animate-spin":""}`}),i.label]}),s?h.jsx(Je,{variant:"ghost",size:"icon",asChild:!0,className:"h-7 w-7 text-slate-400 hover:text-white","aria-label":"View provider job",children:h.jsx("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",onClick:f=>f.stopPropagation(),children:h.jsx(cl,{className:"w-3.5 h-3.5"})})}):null]}),h.jsxs("div",{children:[h.jsx("div",{className:"text-white font-semibold truncate",title:a,children:a}),h.jsxs("div",{className:"text-xs text-slate-400 truncate",children:[t.flavor??"โ€”"," ยท ",OZ(t.created_at),t.owner?` ยท ${t.owner}`:""]})]}),(d=t.status)!=null&&d.message?h.jsx("div",{className:"text-xs text-slate-500 truncate",title:t.status.message,children:t.status.message}):null]})})};function DZ(t){if(!t)return"โ€”";const e=Date.parse(t);if(Number.isNaN(e))return"โ€”";const n=Math.max(0,(Date.now()-e)/1e3);return n<60?`${Math.floor(n)}s ago`:n<3600?`${Math.floor(n/60)}m ago`:n<86400?`${Math.floor(n/3600)}h ago`:`${Math.floor(n/86400)}d ago`}const LZ=({model:t})=>{const e=`https://huggingface.co/${t.repo_id}`,n=t.repo_id.includes("/")?t.repo_id.split("/").slice(1).join("/"):t.repo_id;return h.jsx(Gr,{onClick:()=>window.open(e,"_blank","noopener,noreferrer"),className:"bg-slate-800/50 border-slate-700 rounded-xl cursor-pointer hover:border-slate-500 transition-colors",children:h.jsxs(Wr,{className:"p-4 space-y-3",children:[h.jsxs("div",{className:"flex items-start justify-between gap-2",children:[h.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-semibold text-sky-400",children:[h.jsx(FU,{className:"w-3.5 h-3.5"}),"Uploaded"]}),h.jsx(Je,{variant:"ghost",size:"icon",asChild:!0,className:"h-7 w-7 text-slate-400 hover:text-white","aria-label":"View on Hub",children:h.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",onClick:r=>r.stopPropagation(),children:h.jsx(cl,{className:"w-3.5 h-3.5"})})})]}),h.jsxs("div",{children:[h.jsxs("div",{className:"text-white font-semibold truncate flex items-center gap-1.5",title:t.repo_id,children:[t.private?h.jsx(rX,{className:"w-3.5 h-3.5 text-slate-400 shrink-0"}):null,h.jsx("span",{className:"truncate",children:n})]}),h.jsxs("div",{className:"text-xs text-slate-400 truncate",title:t.repo_id,children:[t.repo_id," ยท updated ",DZ(t.last_modified)]})]})]})})};async function kZ(t,e,n){return er(t,e,"/start-inference",{method:"POST",body:n,action:"Start inference"})}async function IN(t,e){return er(t,e,"/stop-inference",{method:"POST",action:"Stop inference"})}async function jZ(t,e,n){return er(t,e,"/inference-status",{signal:n,action:"Get inference status"})}const UZ=({deviceId:t,paused:e})=>{const{videoRef:n,hasError:r}=v4(t,e);return e||r||!t?h.jsxs("div",{className:"w-32 h-24 bg-gray-800 rounded border border-gray-700 flex flex-col items-center justify-center",children:[h.jsx(BU,{className:"w-5 h-5 text-gray-500 mb-1"}),h.jsx("span",{className:"text-[10px] text-gray-500",children:e?"Released":"No preview"})]}):h.jsx("video",{ref:n,autoPlay:!0,muted:!0,playsInline:!0,className:"w-32 h-24 object-cover rounded border border-gray-700 bg-black"})},FZ=30,_4=({open:t,onOpenChange:e,robot:n,jobId:r,initialStep:i})=>{var L;const{baseUrl:o,fetchWithHeaders:a}=Dn(),{toast:s}=_r(),l=ji(),[c,u]=_.useState([]),[d,f]=_.useState(i),[p,y]=_.useState(""),[v,g]=_.useState(60),[m,x]=_.useState(!1),[b,S]=_.useState(null),[w,E]=_.useState(!1),[T,A]=_.useState(null),[M,C]=_.useState({}),{cameras:P}=g4({enabled:t});_.useEffect(()=>{if(!t)return;let j=!1;return BA(o,a,r).then(K=>{if(!j&&(u(K),K.length>0)){const te=K[K.length-1].step;f(H=>H??te)}}).catch(()=>{j||u([])}),()=>{j=!0}},[t,o,a,r]),_.useEffect(()=>{if(!t||d==null){S(null),A(null);return}let j=!1;return E(!0),A(null),RZ(o,a,r,d).then(K=>{j||(S(K),C(te=>{const H={};for(const q of Object.keys(K.image_features))H[q]=te[q]??null;return H}))}).catch(K=>{j||(S(null),A(K instanceof Error?K.message:String(K)))}).finally(()=>{j||E(!1)}),()=>{j=!0}},[t,o,a,r,d]),_.useEffect(()=>{if(!b)return;const j=(n==null?void 0:n.cameras)??[];j.length===0||P.length===0||C(K=>{let te=!1;const H={...K};for(const q of Object.keys(b.image_features)){if(H[q]!=null)continue;const $=j.find(ee=>ee.name.toLowerCase()===q.toLowerCase());if(!$)continue;const Y=$.device_id&&P.find(ee=>ee.deviceId===$.device_id)||P.find(ee=>ee.index===$.camera_index);Y&&(H[q]=Y.index,te=!0)}return te?H:K})},[b,n,P]);const R=d!=null?((L=c.find(j=>j.step===d))==null?void 0:L.ref)??null:null,D=b?Object.keys(b.image_features):[],k=D.every(j=>M[j]!=null),U=!!n&&n.is_clean&&R!=null&&!!b&&k&&!m,O=async()=>{if(!n||R==null||!b)return;x(!0),await new Promise(K=>setTimeout(K,300));const j={};for(const[K,te]of Object.entries(b.image_features)){const H=M[K];H!=null&&(j[K]={type:"opencv",camera_index:H,width:te.width,height:te.height,fps:FZ})}try{await kZ(o,a,{follower_port:n.follower_port,follower_config:n.follower_config,policy_ref:R,task:p,cameras:j,duration_s:v}),e(!1),l("/inference")}catch(K){s({title:"Couldn't start inference",description:K instanceof Error?K.message:String(K),variant:"destructive"}),x(!1)}},X=(j,K)=>{const te=Number(K);C(H=>({...H,[j]:te}))};return h.jsx(Hc,{open:t,onOpenChange:e,children:h.jsxs(bl,{className:"bg-gray-900 border-gray-800 text-white sm:max-w-[600px] p-8 max-h-[90vh] overflow-y-auto",children:[h.jsxs(_l,{children:[h.jsx("div",{className:"flex justify-center items-center mb-4",children:h.jsx("div",{className:"w-8 h-8 bg-green-500 rounded-full flex items-center justify-center",children:h.jsx(Tc,{className:"w-4 h-4 text-white"})})}),h.jsx(wl,{className:"text-white text-center text-2xl font-bold",children:"Configure Inference"})]}),h.jsxs("div",{className:"space-y-6 py-4",children:[h.jsx(Sl,{className:"text-gray-400 text-base leading-relaxed text-center",children:"Pick a checkpoint and confirm hardware. The selected policy will drive the follower autonomously for the configured duration."}),h.jsxs("div",{className:"space-y-4",children:[h.jsx("h3",{className:"text-lg font-semibold text-white border-b border-gray-700 pb-2",children:"Robot Configuration"}),n?n.is_clean?h.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[h.jsx(qi,{className:"w-4 h-4 text-green-400"}),h.jsxs("span",{className:"text-slate-200",children:["Running on ",h.jsx("strong",{children:n.name})]})]}):h.jsxs(Mi,{className:"bg-amber-900/40 border-amber-700 text-amber-100",children:[h.jsx(oa,{className:"h-4 w-4"}),h.jsxs(Ai,{children:[h.jsx("strong",{children:n.name})," is missing a calibration. Configure it before running inference."]})]}):h.jsxs(Mi,{className:"bg-amber-900/40 border-amber-700 text-amber-100",children:[h.jsx(oa,{className:"h-4 w-4"}),h.jsx(Ai,{children:"Select and configure a robot on the Landing page first."})]})]}),h.jsxs("div",{className:"space-y-4",children:[h.jsx("h3",{className:"text-lg font-semibold text-white border-b border-gray-700 pb-2",children:"Checkpoint"}),c.length===0?h.jsxs(Mi,{className:"bg-amber-900/40 border-amber-700 text-amber-100",children:[h.jsx(oa,{className:"h-4 w-4"}),h.jsx(Ai,{children:"No checkpoints available for this job yet."})]}):h.jsx($A,{checkpoints:c,selectedStep:d,onChange:f})]}),h.jsxs("div",{className:"space-y-4",children:[h.jsx("h3",{className:"text-lg font-semibold text-white border-b border-gray-700 pb-2",children:"Run parameters"}),b!=null&&b.requires_task?h.jsxs("div",{className:"space-y-2",children:[h.jsx(Tt,{htmlFor:"task",className:"text-sm font-medium text-gray-300",children:"Task description"}),h.jsx(hi,{id:"task",value:p,onChange:j=>y(j.target.value),placeholder:"e.g., pick up the red block",className:"bg-gray-800 border-gray-700 text-white"}),h.jsxs("p",{className:"text-xs text-gray-500",children:["This policy is language-conditioned (",b.policy_type,")."]})]}):null,h.jsxs("div",{className:"space-y-2",children:[h.jsx(Tt,{htmlFor:"durationS",className:"text-sm font-medium text-gray-300",children:"Max duration (seconds)"}),h.jsx(mr,{id:"durationS",min:1,value:v,onChange:j=>{j!==void 0&&g(j)},className:"bg-gray-800 border-gray-700 text-white"})]})]}),h.jsxs("div",{className:"space-y-4",children:[h.jsx("h3",{className:"text-lg font-semibold text-white border-b border-gray-700 pb-2",children:"Cameras"}),w?h.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-400",children:[h.jsx(fi,{className:"w-4 h-4 animate-spin"}),"Reading policy configโ€ฆ"]}):T?h.jsxs(Mi,{className:"bg-red-900/40 border-red-700 text-red-100",children:[h.jsx(oa,{className:"h-4 w-4"}),h.jsxs(Ai,{children:["Couldn't load policy config: ",T]})]}):b?D.length===0?h.jsx("p",{className:"text-xs text-gray-500",children:"This policy doesn't use cameras."}):h.jsxs("div",{className:"space-y-3",children:[h.jsx("p",{className:"text-xs text-gray-500",children:"Bind a physical camera to each name the policy was trained with. Resolution comes from the checkpoint."}),D.map(j=>{const K=b.image_features[j],te=M[j],H=te!=null?P.find(q=>q.index===te):void 0;return h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs("div",{className:"flex-1",children:[h.jsx(Tt,{className:"text-sm font-medium text-gray-200",children:j}),h.jsxs("p",{className:"text-xs text-gray-500",children:[K.width,"ร—",K.height]})]}),h.jsxs(Ga,{value:te!=null?String(te):void 0,onValueChange:q=>X(j,q),children:[h.jsx(sa,{className:"bg-gray-800 border-gray-700 text-white w-56",children:h.jsx(Wa,{placeholder:"Select a camera"})}),h.jsx(la,{className:"bg-gray-900 border-gray-700 text-white",children:P.length===0?h.jsx("div",{className:"px-2 py-1.5 text-xs text-gray-500",children:"No cameras detected"}):P.map(q=>h.jsxs($n,{value:String(q.index),children:["#",q.index," โ€” ",q.name]},q.index))})]}),h.jsx(UZ,{deviceId:(H==null?void 0:H.deviceId)??"",paused:m})]},j)})]}):null]}),h.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center pt-4",children:[h.jsxs(Je,{onClick:O,disabled:!U,className:"w-full sm:w-auto bg-green-500 hover:bg-green-600 text-white px-10 py-6 text-lg disabled:opacity-40 disabled:cursor-not-allowed",children:[h.jsx(Tc,{className:"w-5 h-5 mr-2"}),m?"Startingโ€ฆ":"Start Inference"]}),h.jsx(Je,{onClick:()=>e(!1),variant:"outline",className:"w-full sm:w-auto border-gray-500 hover:border-gray-200 px-10 py-6 text-lg text-zinc-500 bg-zinc-900 hover:bg-zinc-800",children:"Cancel"})]})]})]})})},PE="lelab.selectedRobot",BZ=()=>{try{const t=localStorage.getItem(PE);return t&&typeof t=="string"?t:null}catch{return null}},$Z=t=>{try{t?localStorage.setItem(PE,t):localStorage.removeItem(PE)}catch{}},zA=()=>{const{baseUrl:t,fetchWithHeaders:e}=Dn(),{toast:n}=_r(),r=yl(),[i,o]=_.useState({}),[a,s]=_.useState(()=>BZ()),[l,c]=_.useState(!1);_.useEffect(()=>{let g=!1;return(async()=>{c(!0);try{const b=await(await e(`${t}/robots`)).json();if(g)return;const S={};for(const w of b.robots??[])S[w.name]=w;o(S),s(w=>w&&w in S?w:null)}catch(x){g||console.error("Failed to fetch robots:",x)}finally{g||c(!1)}})(),()=>{g=!0}},[t,e,r.key]),_.useEffect(()=>{$Z(a)},[a]);const u=_.useCallback(g=>{s(g)},[]),d=_.useCallback(()=>{s(null)},[]),f=_.useCallback(async g=>{const m=g.trim();if(!m)return n({title:"Missing name",description:"Robot name cannot be empty.",variant:"destructive"}),!1;if(/[/\\]|\.\./.test(m))return n({title:"Invalid name",description:"Robot names cannot contain '/', '\\', or '..'",variant:"destructive"}),!1;try{const x=await e(`${t}/robots/${encodeURIComponent(m)}?create=true`,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"});if(x.status===409)return n({title:"Already exists",description:`A robot named "${m}" already exists. Pick it from the dropdown or choose a different name.`,variant:"destructive"}),!1;if(!x.ok){const S=await x.text();return n({title:"Failed to create",description:S,variant:"destructive"}),!1}const b=await x.json();return b.robot&&(o(S=>({...S,[m]:b.robot})),s(m)),!0}catch(x){return n({title:"Network error",description:String(x),variant:"destructive"}),!1}},[t,e,n]),p=_.useCallback(async g=>{try{const m=await e(`${t}/robots/${encodeURIComponent(g)}`,{method:"DELETE"});if(!m.ok){const x=await m.text();return n({title:"Failed to delete",description:x,variant:"destructive"}),!1}return o(x=>{const{[g]:b,...S}=x;return S}),s(x=>x===g?null:x),!0}catch(m){return n({title:"Network error",description:String(m),variant:"destructive"}),!1}},[t,e,n]),y=_.useMemo(()=>a?i[a]??null:null,[a,i]),v=_.useMemo(()=>Object.keys(i).sort(),[i]);return{records:i,selectedName:a,selectedRecord:y,availableNames:v,isLoading:l,selectRobot:u,clearSelection:d,createRobot:f,deleteRobot:p}},zZ=10,HZ=new Set(["RUNNING","QUEUED","SCHEDULING"]),Ag=t=>t.state==="running"||t.checkpoint_count>0,DN=t=>{var e;return HZ.has((((e=t.status)==null?void 0:e.stage)??"").toUpperCase())},VZ=()=>{const{baseUrl:t,fetchWithHeaders:e}=Dn(),{toast:n}=_r(),r=ji(),[i,o]=_.useState([]),[a,s]=_.useState([]),[l,c]=_.useState([]),[u,d]=_.useState(!1),[f,p]=_.useState(null),[y,v]=_.useState(""),[g,m]=_.useState(null),{selectedRecord:x}=zA(),[b,S]=_.useState(!1),[w,E]=_.useState(null),[T,A]=_.useState(null),M=_.useCallback(async()=>{try{const[ie,W]=await Promise.all([CE(t,e,zZ),AZ(t,e)]);o(ie),s(W.jobs),c(W.models),d(W.authenticated),p(null)}catch(ie){p(ie instanceof Error?ie.message:String(ie))}},[t,e]);_.useEffect(()=>{M();const ie=()=>{document.visibilityState==="visible"&&M()};return document.addEventListener("visibilitychange",ie),window.addEventListener("focus",M),()=>{document.removeEventListener("visibilitychange",ie),window.removeEventListener("focus",M)}},[M]);const C=_.useCallback(ie=>{ie.length!==0&&o(W=>{if(W.length===0)return W;const Ve=new Map(ie.map(Re=>[Re.id,Re]));let Ne=!1;const st=W.map(Re=>{const ct=Ve.get(Re.id);return ct?(Ne=!0,{...Re,state:ct.state,metrics:ct.metrics,wandb_run_url:ct.wandb_run_url,checkpoint_count:ct.checkpoint_count}):Re});return Ne?st:W})},[]);gZ(M,C);const P=async ie=>{try{await x4(t,e,ie),n({title:"Job stopping"}),M()}catch(W){n({title:"Stop failed",description:W instanceof Error?W.message:String(W),variant:"destructive"})}},R=(ie,W)=>{E(ie),A(W),S(!0)},D=async ie=>{try{await b4(t,e,ie),n({title:"Job removed"}),M()}catch(W){n({title:"Delete failed",description:W instanceof Error?W.message:String(W),variant:"destructive"})}},k=async ie=>{if(ie.provider!=="seeed_cloud"){ie.url&&window.open(ie.url,"_blank","noopener,noreferrer");return}try{m(ie.id);const W=await wZ(t,e,"seeed_cloud",ie.id);o(Ve=>Ve.some(Ne=>Ne.id===W.id)?Ve:[W,...Ve]),r(`/training/${W.id}`)}catch(W){n({title:"Attach failed",description:W instanceof Error?W.message:String(W),variant:"destructive"})}finally{m(null)}},U=y.trim().toLowerCase(),O=_.useCallback(ie=>!U||(ie??"").toLowerCase().includes(U),[U]),X=_.useMemo(()=>i.filter(ie=>O(ie.name)),[i,O]),L=_.useMemo(()=>a.filter(ie=>O(ie.docker_image??ie.space_id??ie.id)),[a,O]),j=_.useMemo(()=>l.filter(ie=>O(ie.repo_id)),[l,O]),K=_.useMemo(()=>X.filter(ie=>ie.runner==="local"),[X]),te=_.useMemo(()=>X.filter(ie=>ie.runner==="hf_cloud"||ie.runner==="seeed_cloud"),[X]),H=_.useMemo(()=>new Set(te.map(ie=>ie.hf_job_id).filter(ie=>!!ie)),[te]),q=_.useMemo(()=>L.filter(ie=>ie.provider==="hf_cloud"?!H.has(ie.id):ie.provider==="seeed_cloud"?!te.some(W=>W.external_provider==="seeed_cloud"&&W.external_job_id===ie.id):!0),[L,te,H]),$=_.useMemo(()=>new Set(te.map(ie=>ie.hf_repo_id).filter(ie=>!!ie)),[te]),Y=_.useMemo(()=>j.filter(ie=>!$.has(ie.repo_id)),[j,$]),ee=_.useMemo(()=>K.filter(Ag),[K]),J=_.useMemo(()=>K.filter(ie=>!Ag(ie)),[K]),ce=_.useMemo(()=>te.filter(Ag),[te]),ae=_.useMemo(()=>te.filter(ie=>!Ag(ie)),[te]),fe=_.useMemo(()=>q.filter(DN),[q]),we=_.useMemo(()=>q.filter(ie=>!DN(ie)),[q]),le=J.length+ae.length+we.length;return h.jsxs("section",{className:"space-y-6",children:[h.jsxs("div",{className:"flex items-center justify-between gap-3",children:[h.jsx("h2",{className:"text-lg font-semibold text-white",children:"Jobs"}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs("div",{className:"relative",children:[h.jsx(aA,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-slate-400 pointer-events-none"}),h.jsx(hi,{value:y,onChange:ie=>v(ie.target.value),placeholder:"Search jobs",className:"h-8 w-48 sm:w-60 pl-8 bg-slate-800/50 border-slate-700 text-sm text-white placeholder:text-slate-500","aria-label":"Search jobs"})]}),h.jsx(Je,{variant:"ghost",size:"icon",onClick:M,className:"h-7 w-7 text-slate-400 hover:text-white","aria-label":"Refresh jobs",children:h.jsx(oA,{className:"w-4 h-4"})})]})]}),f?h.jsxs("p",{className:"text-sm text-red-300",children:["Couldn't load jobs: ",f]}):null,h.jsxs("div",{className:"space-y-3",children:[h.jsx("h3",{className:"text-sm font-semibold uppercase tracking-wide text-slate-400",children:"Local jobs"}),ee.length===0?h.jsx("p",{className:"text-sm text-slate-500",children:U?"No local jobs match your search.":"No active local jobs. Start one from the Training page."}):h.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:ee.map(ie=>h.jsx(Mg,{job:ie,onStop:P,onDelete:D,onPlay:R},ie.id))})]}),h.jsx("div",{className:"border-t border-slate-700"}),h.jsxs("div",{className:"space-y-3",children:[h.jsx("h3",{className:"text-sm font-semibold uppercase tracking-wide text-slate-400",children:"Online jobs"}),!u&&te.length===0?h.jsx("p",{className:"text-sm text-slate-500",children:"Sign in with Hugging Face to see your cloud jobs."}):ce.length===0&&fe.length===0&&Y.length===0?h.jsx("p",{className:"text-sm text-slate-500",children:U?"No online jobs match your search.":"No active cloud jobs."}):h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[ce.map(ie=>h.jsx(Mg,{job:ie,onStop:P,onDelete:D,onPlay:R},ie.id)),fe.map(ie=>h.jsx(ON,{job:ie,onOpen:k,busy:g===ie.id},ie.id)),Y.map(ie=>h.jsx(LZ,{model:ie},ie.repo_id))]})]}),le>0?h.jsxs(Ty,{children:[h.jsxs(My,{className:"group flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wide text-slate-400 hover:text-white transition-colors",children:[h.jsx(bp,{className:"w-3.5 h-3.5 transition-transform group-data-[state=open]:rotate-90"}),"Untracked (",le,")"]}),h.jsx(Ay,{className:"pt-3",children:h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[J.map(ie=>h.jsx(Mg,{job:ie,onStop:P,onDelete:D,onPlay:R},ie.id)),ae.map(ie=>h.jsx(Mg,{job:ie,onStop:P,onDelete:D,onPlay:R},ie.id)),we.map(ie=>h.jsx(ON,{job:ie,onOpen:k,busy:g===ie.id},ie.id))]})})]}):null,w?h.jsx(_4,{open:b,onOpenChange:S,robot:x,jobId:w.id,initialStep:T}):null]})},LN="uv tool install git+https://github.com/huggingface/leLab.git && lelab",GZ="http://localhost:8000/",WZ=({open:t,onOpenChange:e,dismissible:n=!0})=>{const[r,i]=_.useState(!1),o=s=>{n||s.preventDefault()},a=async()=>{try{await navigator.clipboard.writeText(LN),i(!0),setTimeout(()=>i(!1),1500)}catch(s){console.warn("Clipboard write failed:",s)}};return h.jsx(Hc,{open:t,onOpenChange:n?e:()=>{},children:h.jsxs(bl,{className:"bg-gray-900 border-gray-700 text-gray-300 sm:max-w-xl",hideClose:!n,onEscapeKeyDown:o,onPointerDownOutside:o,onInteractOutside:o,children:[h.jsxs(_l,{className:"text-center sm:text-center min-w-0",children:[h.jsxs(wl,{className:"text-white flex items-center justify-center gap-2 text-xl",children:[h.jsx(lX,{className:"w-6 h-6"}),"Get Started with LeLab"]}),h.jsx(Sl,{children:"LeLab runs on your machine. Click the command to copy it, then paste in a terminal:"})]}),h.jsxs("div",{className:"space-y-4 py-2 min-w-0",children:[h.jsxs("button",{type:"button",onClick:a,"aria-label":"Copy command to clipboard",className:"group relative w-full bg-gray-800 hover:bg-gray-750 rounded-lg border border-gray-700 hover:border-gray-600 text-left transition-colors cursor-pointer",children:[h.jsx("pre",{className:"p-4 pr-12 text-xs sm:text-sm overflow-x-auto whitespace-pre-wrap break-all",children:h.jsx("code",{className:"text-green-400",children:LN})}),h.jsx("span",{className:"absolute right-2 top-2 flex items-center gap-1 px-2 py-1 rounded text-xs text-gray-400 group-hover:text-white bg-gray-900/80",children:r?h.jsxs(h.Fragment,{children:[h.jsx(xl,{className:"w-3.5 h-3.5 text-green-400"}),"Copied"]}):h.jsxs(h.Fragment,{children:[h.jsx(rA,{className:"w-3.5 h-3.5"}),"Copy"]})})]}),h.jsx("p",{className:"text-gray-400 text-sm text-center",children:"After running, your browser will open the local LeLab app."}),h.jsx(Je,{asChild:!0,className:"w-full bg-blue-600 hover:bg-blue-700 text-white",children:h.jsxs("a",{href:GZ,target:"_blank",rel:"noopener noreferrer",children:[h.jsx(cl,{className:"w-4 h-4 mr-2"}),"Open LeLab"]})})]})]})})};async function w4(t,e,n){return er(t,e,"/datasets",{signal:n,action:"List datasets"})}const XZ=()=>{const{baseUrl:t,fetchWithHeaders:e}=Dn(),[n,r]=_.useState([]),[i,o]=_.useState(!0),a=_.useCallback(()=>{o(!0),w4(t,e).then(r).catch(()=>r([])).finally(()=>o(!1))},[t,e]);return _.useEffect(()=>{a()},[a]),{datasets:n,loading:i,refresh:a}},qZ=()=>typeof window<"u"&&window.location.hostname.endsWith(".hf.space"),kN=qZ(),KZ=()=>{const[t,e]=_.useState(kN),{auth:n}=xf(),{selectedName:r,selectedRecord:i,availableNames:o,isLoading:a,selectRobot:s,createRobot:l,deleteRobot:c}=zA(),{datasets:u,loading:d}=XZ(),[f,p]=_.useState(!1),[y,v]=_.useState(""),[g,m]=_.useState(""),[x,b]=_.useState(5),[S,w]=_.useState(60),[E,T]=_.useState(15),[A,M]=_.useState(!0),[C,P]=_.useState([]),R=_.useRef(null),D=ji(),{toast:k}=_r();_.useEffect(()=>{C.length>0&&(R.current&&R.current(),P([]))},[]),_.useEffect(()=>()=>{R.current&&R.current()},[]);const U=()=>{P(i?[...i.cameras??[]]:[]),p(!0)},O=q=>{p(q),!q&&R.current&&R.current()},X=()=>D("/training"),L=(q,$)=>{const Y=`/spaces/lerobot/visualize_dataset?path=${encodeURIComponent(`/${q}`)}`,ee=$?`https://huggingface.co/login?next=${encodeURIComponent(Y)}`:`https://huggingface.co${Y}`;window.open(ee,"_blank","noopener,noreferrer")},j=q=>{if(q.source==="local"||q.source==="both"){D("/upload",{state:{datasetInfo:{dataset_repo_id:q.repo_id,source:q.source}}});return}L(q.repo_id,q.private)},K=q=>{L(q,!0)},te=q=>{v(q),U()},H=async()=>{if(!i){k({title:"No robot selected",description:"Select or create a robot on the Landing page first.",variant:"destructive"});return}const q=i;if(!q.is_clean){k({title:"Robot not ready",description:`${q.name} is missing a calibration. Configure it before recording.`,variant:"destructive"});return}if(!y||!g){k({title:"Missing dataset details",description:"Please enter a dataset name and task description.",variant:"destructive"});return}const $=n.status==="authenticated"?`${n.username}/${y}`:y;C.length>0&&R.current&&(k({title:"Preparing Camera Resources",description:`Releasing ${C.length} camera stream(s) for recording...`}),R.current(),await new Promise(J=>setTimeout(J,500)),k({title:"Camera Resources Ready",description:"Camera streams released successfully. Starting recording..."}));const Y=C.reduce((J,ce)=>(J[ce.name]={type:ce.type,camera_index:ce.camera_index,width:ce.width,height:ce.height,fps:ce.fps},J),{}),ee={leader_port:q.leader_port,follower_port:q.follower_port,leader_config:q.leader_config,follower_config:q.follower_config,dataset_repo_id:$,single_task:g,num_episodes:x,episode_time_s:S,reset_time_s:E,fps:30,video:!0,push_to_hub:!1,resume:!1,streaming_encoding:A,cameras:Y};p(!1),D("/recording",{state:{recordingConfig:ee}})};return h.jsxs("div",{className:"min-h-screen bg-black text-white pb-16",style:{"--lelab-topbar-h":"48px"},children:[h.jsx(aK,{}),h.jsx("div",{className:"sticky z-20 bg-black/95 backdrop-blur supports-[backdrop-filter]:bg-black/70 border-b border-gray-800",style:{top:"var(--lelab-topbar-h)"},children:h.jsxs("div",{className:"mx-auto max-w-7xl px-4 py-4 grid gap-4 grid-cols-1 lg:grid-cols-[1.2fr_2fr]",children:[h.jsx(_J,{selectedName:r,selectedRecord:i,availableNames:o,isLoading:a,selectRobot:s,createRobot:l,deleteRobot:c}),h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[h.jsxs("div",{className:"bg-gray-800 rounded-lg border border-gray-700 p-3 flex flex-col gap-2",children:[h.jsx("h3",{className:"font-semibold text-lg text-left h-10 flex items-center",children:"Dataset"}),h.jsx(mZ,{datasets:u,loading:d,onPickExisting:j,onOpenCustom:K,onCreateNew:te,children:h.jsxs(Je,{variant:"outline",role:"combobox",className:"w-full justify-between bg-gray-800 border-gray-600 text-white hover:bg-gray-700",children:[h.jsx("span",{className:"truncate text-gray-300",children:d?"Loading datasetsโ€ฆ":"Select or create a datasetโ€ฆ"}),h.jsx(tA,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})})]}),h.jsxs("div",{className:"bg-gray-800 rounded-lg border border-gray-700 p-3 flex flex-col gap-2",children:[h.jsx("h3",{className:"font-semibold text-lg text-left h-10 flex items-center",children:"Create a model"}),h.jsx(Je,{onClick:X,className:"w-full bg-green-500 hover:bg-green-600 text-white",children:"Training"})]})]})]})}),h.jsx("main",{className:"mx-auto max-w-7xl px-4 py-6",children:h.jsx(VZ,{})}),h.jsx(cK,{}),h.jsx(WZ,{open:t,onOpenChange:e,dismissible:!kN}),h.jsx(fZ,{open:f,onOpenChange:O,robot:i,datasetName:y,setDatasetName:v,singleTask:g,setSingleTask:m,numEpisodes:x,setNumEpisodes:b,episodeTimeS:S,setEpisodeTimeS:w,resetTimeS:E,setResetTimeS:T,streamingEncoding:A,setStreamingEncoding:M,cameras:C,setCameras:P,onStart:H,releaseStreamsRef:R})]})};/** * @license * Copyright 2010-2025 Three.js Authors * SPDX-License-Identifier: MIT - */const zA="177",ad={ROTATE:0,DOLLY:1,PAN:2},zu={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},qZ=0,kN=1,KZ=2,_4=1,w4=2,ja=3,ba=0,ui=1,Ki=2,tl=0,sd=1,jN=2,UN=3,FN=4,YZ=5,ql=100,JZ=101,ZZ=102,QZ=103,eQ=104,tQ=200,nQ=201,rQ=202,iQ=203,RE=204,NE=205,oQ=206,aQ=207,sQ=208,lQ=209,cQ=210,uQ=211,dQ=212,fQ=213,hQ=214,OE=0,IE=1,DE=2,jd=3,LE=4,kE=5,jE=6,UE=7,kx=0,pQ=1,mQ=2,nl=0,gQ=1,vQ=2,yQ=3,xQ=4,bQ=5,_Q=6,wQ=7,BN="attached",SQ="detached",S4=300,Ud=301,Fd=302,FE=303,BE=304,jx=306,ca=1e3,Ji=1001,Py=1002,Xr=1003,E4=1004,Ch=1005,Or=1006,$v=1007,Oo=1008,_a=1009,T4=1010,M4=1011,Ep=1012,HA=1013,Nc=1014,Io=1015,Om=1016,VA=1017,GA=1018,Tp=1020,A4=35902,C4=1021,P4=1022,Zi=1023,Mp=1026,Ap=1027,WA=1028,XA=1029,R4=1030,qA=1031,KA=1033,zv=33776,Hv=33777,Vv=33778,Gv=33779,$E=35840,zE=35841,HE=35842,VE=35843,GE=36196,WE=37492,XE=37496,qE=37808,KE=37809,YE=37810,JE=37811,ZE=37812,QE=37813,e1=37814,t1=37815,n1=37816,r1=37817,i1=37818,o1=37819,a1=37820,s1=37821,Wv=36492,l1=36494,c1=36495,N4=36283,u1=36284,d1=36285,f1=36286,Cp=2300,Pp=2301,G_=2302,$N=2400,zN=2401,HN=2402,EQ=2500,TQ=0,O4=1,h1=2,MQ=3200,AQ=3201,Ux=0,CQ=1,Ds="",Zt="srgb",Kr="srgb-linear",Ry="linear",an="srgb",au=7680,VN=519,PQ=512,RQ=513,NQ=514,I4=515,OQ=516,IQ=517,DQ=518,LQ=519,p1=35044,GN="300 es",Xa=2e3,Ny=2001;class Vc{addEventListener(e,n){this._listeners===void 0&&(this._listeners={});const r=this._listeners;r[e]===void 0&&(r[e]=[]),r[e].indexOf(n)===-1&&r[e].push(n)}hasEventListener(e,n){const r=this._listeners;return r===void 0?!1:r[e]!==void 0&&r[e].indexOf(n)!==-1}removeEventListener(e,n){const r=this._listeners;if(r===void 0)return;const i=r[e];if(i!==void 0){const o=i.indexOf(n);o!==-1&&i.splice(o,1)}}dispatchEvent(e){const n=this._listeners;if(n===void 0)return;const r=n[e.type];if(r!==void 0){e.target=this;const i=r.slice(0);for(let o=0,a=i.length;o>8&255]+Mr[t>>16&255]+Mr[t>>24&255]+"-"+Mr[e&255]+Mr[e>>8&255]+"-"+Mr[e>>16&15|64]+Mr[e>>24&255]+"-"+Mr[n&63|128]+Mr[n>>8&255]+"-"+Mr[n>>16&255]+Mr[n>>24&255]+Mr[r&255]+Mr[r>>8&255]+Mr[r>>16&255]+Mr[r>>24&255]).toLowerCase()}function It(t,e,n){return Math.max(e,Math.min(n,t))}function YA(t,e){return(t%e+e)%e}function kQ(t,e,n,r,i){return r+(t-e)*(i-r)/(n-e)}function jQ(t,e,n){return t!==e?(n-t)/(e-t):0}function Xh(t,e,n){return(1-n)*t+n*e}function UQ(t,e,n,r){return Xh(t,e,1-Math.exp(-n*r))}function FQ(t,e=1){return e-Math.abs(YA(t,e*2)-e)}function BQ(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*(3-2*t))}function $Q(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*t*(t*(t*6-15)+10))}function zQ(t,e){return t+Math.floor(Math.random()*(e-t+1))}function HQ(t,e){return t+Math.random()*(e-t)}function VQ(t){return t*(.5-Math.random())}function GQ(t){t!==void 0&&(WN=t);let e=WN+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function WQ(t){return t*Wh}function XQ(t){return t*Bd}function qQ(t){return(t&t-1)===0&&t!==0}function KQ(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function YQ(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function JQ(t,e,n,r,i){const o=Math.cos,a=Math.sin,s=o(n/2),l=a(n/2),c=o((e+r)/2),u=a((e+r)/2),d=o((e-r)/2),f=a((e-r)/2),p=o((r-e)/2),y=a((r-e)/2);switch(i){case"XYX":t.set(s*u,l*d,l*f,s*c);break;case"YZY":t.set(l*f,s*u,l*d,s*c);break;case"ZXZ":t.set(l*d,l*f,s*u,s*c);break;case"XZX":t.set(s*u,l*y,l*p,s*c);break;case"YXY":t.set(l*p,s*u,l*y,s*c);break;case"ZYZ":t.set(l*y,l*p,s*u,s*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Po(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function tn(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(t*4294967295);case Uint16Array:return Math.round(t*65535);case Uint8Array:return Math.round(t*255);case Int32Array:return Math.round(t*2147483647);case Int16Array:return Math.round(t*32767);case Int8Array:return Math.round(t*127);default:throw new Error("Invalid component type.")}}const Kl={DEG2RAD:Wh,RAD2DEG:Bd,generateUUID:Uo,clamp:It,euclideanModulo:YA,mapLinear:kQ,inverseLerp:jQ,lerp:Xh,damp:UQ,pingpong:FQ,smoothstep:BQ,smootherstep:$Q,randInt:zQ,randFloat:HQ,randFloatSpread:VQ,seededRandom:GQ,degToRad:WQ,radToDeg:XQ,isPowerOfTwo:qQ,ceilPowerOfTwo:KQ,floorPowerOfTwo:YQ,setQuaternionFromProperEuler:JQ,normalize:tn,denormalize:Po};class xt{constructor(e=0,n=0){xt.prototype.isVector2=!0,this.x=e,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,n){return this.x=e,this.y=n,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const n=this.x,r=this.y,i=e.elements;return this.x=i[0]*n+i[3]*r+i[6],this.y=i[1]*n+i[4]*r+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,n){return this.x=It(this.x,e.x,n.x),this.y=It(this.y,e.y,n.y),this}clampScalar(e,n){return this.x=It(this.x,e,n),this.y=It(this.y,e,n),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(It(r,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const r=this.dot(e)/n;return Math.acos(It(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y;return n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this}rotateAround(e,n){const r=Math.cos(n),i=Math.sin(n),o=this.x-e.x,a=this.y-e.y;return this.x=o*r-a*i+e.x,this.y=o*i+a*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Ii{constructor(e=0,n=0,r=0,i=1){this.isQuaternion=!0,this._x=e,this._y=n,this._z=r,this._w=i}static slerpFlat(e,n,r,i,o,a,s){let l=r[i+0],c=r[i+1],u=r[i+2],d=r[i+3];const f=o[a+0],p=o[a+1],y=o[a+2],v=o[a+3];if(s===0){e[n+0]=l,e[n+1]=c,e[n+2]=u,e[n+3]=d;return}if(s===1){e[n+0]=f,e[n+1]=p,e[n+2]=y,e[n+3]=v;return}if(d!==v||l!==f||c!==p||u!==y){let g=1-s;const m=l*f+c*p+u*y+d*v,x=m>=0?1:-1,b=1-m*m;if(b>Number.EPSILON){const w=Math.sqrt(b),E=Math.atan2(w,m*x);g=Math.sin(g*E)/w,s=Math.sin(s*E)/w}const S=s*x;if(l=l*g+f*S,c=c*g+p*S,u=u*g+y*S,d=d*g+v*S,g===1-s){const w=1/Math.sqrt(l*l+c*c+u*u+d*d);l*=w,c*=w,u*=w,d*=w}}e[n]=l,e[n+1]=c,e[n+2]=u,e[n+3]=d}static multiplyQuaternionsFlat(e,n,r,i,o,a){const s=r[i],l=r[i+1],c=r[i+2],u=r[i+3],d=o[a],f=o[a+1],p=o[a+2],y=o[a+3];return e[n]=s*y+u*d+l*p-c*f,e[n+1]=l*y+u*f+c*d-s*p,e[n+2]=c*y+u*p+s*f-l*d,e[n+3]=u*y-s*d-l*f-c*p,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,n,r,i){return this._x=e,this._y=n,this._z=r,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,n=!0){const r=e._x,i=e._y,o=e._z,a=e._order,s=Math.cos,l=Math.sin,c=s(r/2),u=s(i/2),d=s(o/2),f=l(r/2),p=l(i/2),y=l(o/2);switch(a){case"XYZ":this._x=f*u*d+c*p*y,this._y=c*p*d-f*u*y,this._z=c*u*y+f*p*d,this._w=c*u*d-f*p*y;break;case"YXZ":this._x=f*u*d+c*p*y,this._y=c*p*d-f*u*y,this._z=c*u*y-f*p*d,this._w=c*u*d+f*p*y;break;case"ZXY":this._x=f*u*d-c*p*y,this._y=c*p*d+f*u*y,this._z=c*u*y+f*p*d,this._w=c*u*d-f*p*y;break;case"ZYX":this._x=f*u*d-c*p*y,this._y=c*p*d+f*u*y,this._z=c*u*y-f*p*d,this._w=c*u*d+f*p*y;break;case"YZX":this._x=f*u*d+c*p*y,this._y=c*p*d+f*u*y,this._z=c*u*y-f*p*d,this._w=c*u*d-f*p*y;break;case"XZY":this._x=f*u*d-c*p*y,this._y=c*p*d-f*u*y,this._z=c*u*y+f*p*d,this._w=c*u*d+f*p*y;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return n===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,n){const r=n/2,i=Math.sin(r);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(e){const n=e.elements,r=n[0],i=n[4],o=n[8],a=n[1],s=n[5],l=n[9],c=n[2],u=n[6],d=n[10],f=r+s+d;if(f>0){const p=.5/Math.sqrt(f+1);this._w=.25/p,this._x=(u-l)*p,this._y=(o-c)*p,this._z=(a-i)*p}else if(r>s&&r>d){const p=2*Math.sqrt(1+r-s-d);this._w=(u-l)/p,this._x=.25*p,this._y=(i+a)/p,this._z=(o+c)/p}else if(s>d){const p=2*Math.sqrt(1+s-r-d);this._w=(o-c)/p,this._x=(i+a)/p,this._y=.25*p,this._z=(l+u)/p}else{const p=2*Math.sqrt(1+d-r-s);this._w=(a-i)/p,this._x=(o+c)/p,this._y=(l+u)/p,this._z=.25*p}return this._onChangeCallback(),this}setFromUnitVectors(e,n){let r=e.dot(n)+1;return rMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=r):(this._x=0,this._y=-e.z,this._z=e.y,this._w=r)):(this._x=e.y*n.z-e.z*n.y,this._y=e.z*n.x-e.x*n.z,this._z=e.x*n.y-e.y*n.x,this._w=r),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(It(this.dot(e),-1,1)))}rotateTowards(e,n){const r=this.angleTo(e);if(r===0)return this;const i=Math.min(1,n/r);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,n){const r=e._x,i=e._y,o=e._z,a=e._w,s=n._x,l=n._y,c=n._z,u=n._w;return this._x=r*u+a*s+i*c-o*l,this._y=i*u+a*l+o*s-r*c,this._z=o*u+a*c+r*l-i*s,this._w=a*u-r*s-i*l-o*c,this._onChangeCallback(),this}slerp(e,n){if(n===0)return this;if(n===1)return this.copy(e);const r=this._x,i=this._y,o=this._z,a=this._w;let s=a*e._w+r*e._x+i*e._y+o*e._z;if(s<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,s=-s):this.copy(e),s>=1)return this._w=a,this._x=r,this._y=i,this._z=o,this;const l=1-s*s;if(l<=Number.EPSILON){const p=1-n;return this._w=p*a+n*this._w,this._x=p*r+n*this._x,this._y=p*i+n*this._y,this._z=p*o+n*this._z,this.normalize(),this}const c=Math.sqrt(l),u=Math.atan2(c,s),d=Math.sin((1-n)*u)/c,f=Math.sin(n*u)/c;return this._w=a*d+this._w*f,this._x=r*d+this._x*f,this._y=i*d+this._y*f,this._z=o*d+this._z*f,this._onChangeCallback(),this}slerpQuaternions(e,n,r){return this.copy(e).slerp(n,r)}random(){const e=2*Math.PI*Math.random(),n=2*Math.PI*Math.random(),r=Math.random(),i=Math.sqrt(1-r),o=Math.sqrt(r);return this.set(i*Math.sin(e),i*Math.cos(e),o*Math.sin(n),o*Math.cos(n))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,n=0){return this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._w,e}fromBufferAttribute(e,n){return this._x=e.getX(n),this._y=e.getY(n),this._z=e.getZ(n),this._w=e.getW(n),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class ne{constructor(e=0,n=0,r=0){ne.prototype.isVector3=!0,this.x=e,this.y=n,this.z=r}set(e,n,r){return r===void 0&&(r=this.z),this.x=e,this.y=n,this.z=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,n){return this.x=e.x*n.x,this.y=e.y*n.y,this.z=e.z*n.z,this}applyEuler(e){return this.applyQuaternion(XN.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(XN.setFromAxisAngle(e,n))}applyMatrix3(e){const n=this.x,r=this.y,i=this.z,o=e.elements;return this.x=o[0]*n+o[3]*r+o[6]*i,this.y=o[1]*n+o[4]*r+o[7]*i,this.z=o[2]*n+o[5]*r+o[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const n=this.x,r=this.y,i=this.z,o=e.elements,a=1/(o[3]*n+o[7]*r+o[11]*i+o[15]);return this.x=(o[0]*n+o[4]*r+o[8]*i+o[12])*a,this.y=(o[1]*n+o[5]*r+o[9]*i+o[13])*a,this.z=(o[2]*n+o[6]*r+o[10]*i+o[14])*a,this}applyQuaternion(e){const n=this.x,r=this.y,i=this.z,o=e.x,a=e.y,s=e.z,l=e.w,c=2*(a*i-s*r),u=2*(s*n-o*i),d=2*(o*r-a*n);return this.x=n+l*c+a*d-s*u,this.y=r+l*u+s*c-o*d,this.z=i+l*d+o*u-a*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const n=this.x,r=this.y,i=this.z,o=e.elements;return this.x=o[0]*n+o[4]*r+o[8]*i,this.y=o[1]*n+o[5]*r+o[9]*i,this.z=o[2]*n+o[6]*r+o[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,n){return this.x=It(this.x,e.x,n.x),this.y=It(this.y,e.y,n.y),this.z=It(this.z,e.z,n.z),this}clampScalar(e,n){return this.x=It(this.x,e,n),this.y=It(this.y,e,n),this.z=It(this.z,e,n),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(It(r,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this.z=e.z+(n.z-e.z)*r,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,n){const r=e.x,i=e.y,o=e.z,a=n.x,s=n.y,l=n.z;return this.x=i*l-o*s,this.y=o*a-r*l,this.z=r*s-i*a,this}projectOnVector(e){const n=e.lengthSq();if(n===0)return this.set(0,0,0);const r=e.dot(this)/n;return this.copy(e).multiplyScalar(r)}projectOnPlane(e){return W_.copy(this).projectOnVector(e),this.sub(W_)}reflect(e){return this.sub(W_.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const r=this.dot(e)/n;return Math.acos(It(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y,i=this.z-e.z;return n*n+r*r+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,n,r){const i=Math.sin(n)*e;return this.x=i*Math.sin(r),this.y=Math.cos(n)*e,this.z=i*Math.cos(r),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,n,r){return this.x=e*Math.sin(n),this.y=r,this.z=e*Math.cos(n),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(e){const n=this.setFromMatrixColumn(e,0).length(),r=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=n,this.y=r,this.z=i,this}setFromMatrixColumn(e,n){return this.fromArray(e.elements,n*4)}setFromMatrix3Column(e,n){return this.fromArray(e.elements,n*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,n=Math.random()*2-1,r=Math.sqrt(1-n*n);return this.x=r*Math.cos(e),this.y=n,this.z=r*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const W_=new ne,XN=new Ii;class Rt{constructor(e,n,r,i,o,a,s,l,c){Rt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,n,r,i,o,a,s,l,c)}set(e,n,r,i,o,a,s,l,c){const u=this.elements;return u[0]=e,u[1]=i,u[2]=s,u[3]=n,u[4]=o,u[5]=l,u[6]=r,u[7]=a,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const n=this.elements,r=e.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],this}extractBasis(e,n,r){return e.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const n=e.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const r=e.elements,i=n.elements,o=this.elements,a=r[0],s=r[3],l=r[6],c=r[1],u=r[4],d=r[7],f=r[2],p=r[5],y=r[8],v=i[0],g=i[3],m=i[6],x=i[1],b=i[4],S=i[7],w=i[2],E=i[5],T=i[8];return o[0]=a*v+s*x+l*w,o[3]=a*g+s*b+l*E,o[6]=a*m+s*S+l*T,o[1]=c*v+u*x+d*w,o[4]=c*g+u*b+d*E,o[7]=c*m+u*S+d*T,o[2]=f*v+p*x+y*w,o[5]=f*g+p*b+y*E,o[8]=f*m+p*S+y*T,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=e,n[4]*=e,n[7]*=e,n[2]*=e,n[5]*=e,n[8]*=e,this}determinant(){const e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],u=e[8];return n*a*u-n*s*c-r*o*u+r*s*l+i*o*c-i*a*l}invert(){const e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],u=e[8],d=u*a-s*c,f=s*l-u*o,p=c*o-a*l,y=n*d+r*f+i*p;if(y===0)return this.set(0,0,0,0,0,0,0,0,0);const v=1/y;return e[0]=d*v,e[1]=(i*c-u*r)*v,e[2]=(s*r-i*a)*v,e[3]=f*v,e[4]=(u*n-i*l)*v,e[5]=(i*o-s*n)*v,e[6]=p*v,e[7]=(r*l-c*n)*v,e[8]=(a*n-r*o)*v,this}transpose(){let e;const n=this.elements;return e=n[1],n[1]=n[3],n[3]=e,e=n[2],n[2]=n[6],n[6]=e,e=n[5],n[5]=n[7],n[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const n=this.elements;return e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],this}setUvTransform(e,n,r,i,o,a,s){const l=Math.cos(o),c=Math.sin(o);return this.set(r*l,r*c,-r*(l*a+c*s)+a+e,-i*c,i*l,-i*(-c*a+l*s)+s+n,0,0,1),this}scale(e,n){return this.premultiply(X_.makeScale(e,n)),this}rotate(e){return this.premultiply(X_.makeRotation(-e)),this}translate(e,n){return this.premultiply(X_.makeTranslation(e,n)),this}makeTranslation(e,n){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,n,0,0,1),this}makeRotation(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,-r,0,r,n,0,0,0,1),this}makeScale(e,n){return this.set(e,0,0,0,n,0,0,0,1),this}equals(e){const n=this.elements,r=e.elements;for(let i=0;i<9;i++)if(n[i]!==r[i])return!1;return!0}fromArray(e,n=0){for(let r=0;r<9;r++)this.elements[r]=e[r+n];return this}toArray(e=[],n=0){const r=this.elements;return e[n]=r[0],e[n+1]=r[1],e[n+2]=r[2],e[n+3]=r[3],e[n+4]=r[4],e[n+5]=r[5],e[n+6]=r[6],e[n+7]=r[7],e[n+8]=r[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const X_=new Rt;function D4(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}function Rp(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function ZQ(){const t=Rp("canvas");return t.style.display="block",t}const qN={};function ld(t){t in qN||(qN[t]=!0,console.warn(t))}function QQ(t,e,n){return new Promise(function(r,i){function o(){switch(t.clientWaitSync(e,t.SYNC_FLUSH_COMMANDS_BIT,0)){case t.WAIT_FAILED:i();break;case t.TIMEOUT_EXPIRED:setTimeout(o,n);break;default:r()}}setTimeout(o,n)})}function eee(t){const e=t.elements;e[2]=.5*e[2]+.5*e[3],e[6]=.5*e[6]+.5*e[7],e[10]=.5*e[10]+.5*e[11],e[14]=.5*e[14]+.5*e[15]}function tee(t){const e=t.elements;e[11]===-1?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=-e[14]+1)}const KN=new Rt().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),YN=new Rt().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function nee(){const t={enabled:!0,workingColorSpace:Kr,spaces:{},convert:function(i,o,a){return this.enabled===!1||o===a||!o||!a||(this.spaces[o].transfer===an&&(i.r=Ja(i.r),i.g=Ja(i.g),i.b=Ja(i.b)),this.spaces[o].primaries!==this.spaces[a].primaries&&(i.applyMatrix3(this.spaces[o].toXYZ),i.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===an&&(i.r=cd(i.r),i.g=cd(i.g),i.b=cd(i.b))),i},workingToColorSpace:function(i,o){return this.convert(i,this.workingColorSpace,o)},colorSpaceToWorking:function(i,o){return this.convert(i,o,this.workingColorSpace)},getPrimaries:function(i){return this.spaces[i].primaries},getTransfer:function(i){return i===Ds?Ry:this.spaces[i].transfer},getLuminanceCoefficients:function(i,o=this.workingColorSpace){return i.fromArray(this.spaces[o].luminanceCoefficients)},define:function(i){Object.assign(this.spaces,i)},_getMatrix:function(i,o,a){return i.copy(this.spaces[o].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(i){return this.spaces[i].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(i=this.workingColorSpace){return this.spaces[i].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(i,o){return ld("THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),t.workingToColorSpace(i,o)},toWorkingColorSpace:function(i,o){return ld("THREE.ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),t.colorSpaceToWorking(i,o)}},e=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],r=[.3127,.329];return t.define({[Kr]:{primaries:e,whitePoint:r,transfer:Ry,toXYZ:KN,fromXYZ:YN,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:Zt},outputColorSpaceConfig:{drawingBufferColorSpace:Zt}},[Zt]:{primaries:e,whitePoint:r,transfer:an,toXYZ:KN,fromXYZ:YN,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:Zt}}}),t}const Dt=nee();function Ja(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function cd(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}let su;class ree{static getDataURL(e,n="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let r;if(e instanceof HTMLCanvasElement)r=e;else{su===void 0&&(su=Rp("canvas")),su.width=e.width,su.height=e.height;const i=su.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),r=su}return r.toDataURL(n)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const n=Rp("canvas");n.width=e.width,n.height=e.height;const r=n.getContext("2d");r.drawImage(e,0,0,e.width,e.height);const i=r.getImageData(0,0,e.width,e.height),o=i.data;for(let a=0;a1),this.pmremVersion=0}get width(){return this.source.getSize(K_).x}get height(){return this.source.getSize(K_).y}get depth(){return this.source.getSize(K_).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const n in e){const r=e[n];if(r===void 0){console.warn(`THREE.Texture.setValues(): parameter '${n}' has value of undefined.`);continue}const i=this[n];if(i===void 0){console.warn(`THREE.Texture.setValues(): property '${n}' does not exist.`);continue}i&&r&&i.isVector2&&r.isVector2||i&&r&&i.isVector3&&r.isVector3||i&&r&&i.isMatrix3&&r.isMatrix3?i.copy(r):this[n]=r}}toJSON(e){const n=e===void 0||typeof e=="string";if(!n&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const r={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(r.userData=this.userData),n||(e.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==S4)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case ca:e.x=e.x-Math.floor(e.x);break;case Ji:e.x=e.x<0?0:1;break;case Py:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case ca:e.y=e.y-Math.floor(e.y);break;case Ji:e.y=e.y<0?0:1;break;case Py:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}lr.DEFAULT_IMAGE=null;lr.DEFAULT_MAPPING=S4;lr.DEFAULT_ANISOTROPY=1;class Yt{constructor(e=0,n=0,r=0,i=1){Yt.prototype.isVector4=!0,this.x=e,this.y=n,this.z=r,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,n,r,i){return this.x=e,this.y=n,this.z=r,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this.w=e.w+n.w,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this.w+=e.w*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this.w=e.w-n.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const n=this.x,r=this.y,i=this.z,o=this.w,a=e.elements;return this.x=a[0]*n+a[4]*r+a[8]*i+a[12]*o,this.y=a[1]*n+a[5]*r+a[9]*i+a[13]*o,this.z=a[2]*n+a[6]*r+a[10]*i+a[14]*o,this.w=a[3]*n+a[7]*r+a[11]*i+a[15]*o,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const n=Math.sqrt(1-e.w*e.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/n,this.y=e.y/n,this.z=e.z/n),this}setAxisAngleFromRotationMatrix(e){let n,r,i,o;const l=e.elements,c=l[0],u=l[4],d=l[8],f=l[1],p=l[5],y=l[9],v=l[2],g=l[6],m=l[10];if(Math.abs(u-f)<.01&&Math.abs(d-v)<.01&&Math.abs(y-g)<.01){if(Math.abs(u+f)<.1&&Math.abs(d+v)<.1&&Math.abs(y+g)<.1&&Math.abs(c+p+m-3)<.1)return this.set(1,0,0,0),this;n=Math.PI;const b=(c+1)/2,S=(p+1)/2,w=(m+1)/2,E=(u+f)/4,T=(d+v)/4,A=(y+g)/4;return b>S&&b>w?b<.01?(r=0,i=.707106781,o=.707106781):(r=Math.sqrt(b),i=E/r,o=T/r):S>w?S<.01?(r=.707106781,i=0,o=.707106781):(i=Math.sqrt(S),r=E/i,o=A/i):w<.01?(r=.707106781,i=.707106781,o=0):(o=Math.sqrt(w),r=T/o,i=A/o),this.set(r,i,o,n),this}let x=Math.sqrt((g-y)*(g-y)+(d-v)*(d-v)+(f-u)*(f-u));return Math.abs(x)<.001&&(x=1),this.x=(g-y)/x,this.y=(d-v)/x,this.z=(f-u)/x,this.w=Math.acos((c+p+m-1)/2),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this.w=n[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,n){return this.x=It(this.x,e.x,n.x),this.y=It(this.y,e.y,n.y),this.z=It(this.z,e.z,n.z),this.w=It(this.w,e.w,n.w),this}clampScalar(e,n){return this.x=It(this.x,e,n),this.y=It(this.y,e,n),this.z=It(this.z,e,n),this.w=It(this.w,e,n),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(It(r,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this.w+=(e.w-this.w)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this.z=e.z+(n.z-e.z)*r,this.w=e.w+(n.w-e.w)*r,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this.w=e[n+3],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e[n+3]=this.w,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this.w=e.getW(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class aee extends Vc{constructor(e=1,n=1,r={}){super(),r=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Or,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},r),this.isRenderTarget=!0,this.width=e,this.height=n,this.depth=r.depth,this.scissor=new Yt(0,0,e,n),this.scissorTest=!1,this.viewport=new Yt(0,0,e,n);const i={width:e,height:n,depth:r.depth},o=new lr(i);this.textures=[];const a=r.count;for(let s=0;s1;this.dispose()}this.viewport.set(0,0,e,n),this.scissor.set(0,0,e,n)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let n=0,r=e.textures.length;n=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,n){return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,fo),fo.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let n,r;return e.normal.x>0?(n=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(n=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(n+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(n+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(n+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(n+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),n<=-e.constant&&r>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(nh),Pg.subVectors(this.max,nh),lu.subVectors(e.a,nh),cu.subVectors(e.b,nh),uu.subVectors(e.c,nh),xs.subVectors(cu,lu),bs.subVectors(uu,cu),Il.subVectors(lu,uu);let n=[0,-xs.z,xs.y,0,-bs.z,bs.y,0,-Il.z,Il.y,xs.z,0,-xs.x,bs.z,0,-bs.x,Il.z,0,-Il.x,-xs.y,xs.x,0,-bs.y,bs.x,0,-Il.y,Il.x,0];return!Y_(n,lu,cu,uu,Pg)||(n=[1,0,0,0,1,0,0,0,1],!Y_(n,lu,cu,uu,Pg))?!1:(Rg.crossVectors(xs,bs),n=[Rg.x,Rg.y,Rg.z],Y_(n,lu,cu,uu,Pg))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,fo).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(fo).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Pa[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Pa[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Pa[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Pa[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Pa[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Pa[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Pa[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Pa[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Pa),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const Pa=[new ne,new ne,new ne,new ne,new ne,new ne,new ne,new ne],fo=new ne,Cg=new Wo,lu=new ne,cu=new ne,uu=new ne,xs=new ne,bs=new ne,Il=new ne,nh=new ne,Pg=new ne,Rg=new ne,Dl=new ne;function Y_(t,e,n,r,i){for(let o=0,a=t.length-3;o<=a;o+=3){Dl.fromArray(t,o);const s=i.x*Math.abs(Dl.x)+i.y*Math.abs(Dl.y)+i.z*Math.abs(Dl.z),l=e.dot(Dl),c=n.dot(Dl),u=r.dot(Dl);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>s)return!1}return!0}const lee=new Wo,rh=new ne,J_=new ne;class Xo{constructor(e=new ne,n=-1){this.isSphere=!0,this.center=e,this.radius=n}set(e,n){return this.center.copy(e),this.radius=n,this}setFromPoints(e,n){const r=this.center;n!==void 0?r.copy(n):lee.setFromPoints(e).getCenter(r);let i=0;for(let o=0,a=e.length;othis.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;rh.subVectors(e,this.center);const n=rh.lengthSq();if(n>this.radius*this.radius){const r=Math.sqrt(n),i=(r-this.radius)*.5;this.center.addScaledVector(rh,i/r),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(J_.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(rh.copy(e.center).add(J_)),this.expandByPoint(rh.copy(e.center).sub(J_))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}const Ra=new ne,Z_=new ne,Ng=new ne,_s=new ne,Q_=new ne,Og=new ne,ew=new ne;class Sf{constructor(e=new ne,n=new ne(0,0,-1)){this.origin=e,this.direction=n}set(e,n){return this.origin.copy(e),this.direction.copy(n),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,n){return n.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Ra)),this}closestPointToPoint(e,n){n.subVectors(e,this.origin);const r=n.dot(this.direction);return r<0?n.copy(this.origin):n.copy(this.origin).addScaledVector(this.direction,r)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const n=Ra.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(Ra.copy(this.origin).addScaledVector(this.direction,n),Ra.distanceToSquared(e))}distanceSqToSegment(e,n,r,i){Z_.copy(e).add(n).multiplyScalar(.5),Ng.copy(n).sub(e).normalize(),_s.copy(this.origin).sub(Z_);const o=e.distanceTo(n)*.5,a=-this.direction.dot(Ng),s=_s.dot(this.direction),l=-_s.dot(Ng),c=_s.lengthSq(),u=Math.abs(1-a*a);let d,f,p,y;if(u>0)if(d=a*l-s,f=a*s-l,y=o*u,d>=0)if(f>=-y)if(f<=y){const v=1/u;d*=v,f*=v,p=d*(d+a*f+2*s)+f*(a*d+f+2*l)+c}else f=o,d=Math.max(0,-(a*f+s)),p=-d*d+f*(f+2*l)+c;else f=-o,d=Math.max(0,-(a*f+s)),p=-d*d+f*(f+2*l)+c;else f<=-y?(d=Math.max(0,-(-a*o+s)),f=d>0?-o:Math.min(Math.max(-o,-l),o),p=-d*d+f*(f+2*l)+c):f<=y?(d=0,f=Math.min(Math.max(-o,-l),o),p=f*(f+2*l)+c):(d=Math.max(0,-(a*o+s)),f=d>0?o:Math.min(Math.max(-o,-l),o),p=-d*d+f*(f+2*l)+c);else f=a>0?-o:o,d=Math.max(0,-(a*f+s)),p=-d*d+f*(f+2*l)+c;return r&&r.copy(this.origin).addScaledVector(this.direction,d),i&&i.copy(Z_).addScaledVector(Ng,f),p}intersectSphere(e,n){Ra.subVectors(e.center,this.origin);const r=Ra.dot(this.direction),i=Ra.dot(Ra)-r*r,o=e.radius*e.radius;if(i>o)return null;const a=Math.sqrt(o-i),s=r-a,l=r+a;return l<0?null:s<0?this.at(l,n):this.at(s,n)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const n=e.normal.dot(this.direction);if(n===0)return e.distanceToPoint(this.origin)===0?0:null;const r=-(this.origin.dot(e.normal)+e.constant)/n;return r>=0?r:null}intersectPlane(e,n){const r=this.distanceToPlane(e);return r===null?null:this.at(r,n)}intersectsPlane(e){const n=e.distanceToPoint(this.origin);return n===0||e.normal.dot(this.direction)*n<0}intersectBox(e,n){let r,i,o,a,s,l;const c=1/this.direction.x,u=1/this.direction.y,d=1/this.direction.z,f=this.origin;return c>=0?(r=(e.min.x-f.x)*c,i=(e.max.x-f.x)*c):(r=(e.max.x-f.x)*c,i=(e.min.x-f.x)*c),u>=0?(o=(e.min.y-f.y)*u,a=(e.max.y-f.y)*u):(o=(e.max.y-f.y)*u,a=(e.min.y-f.y)*u),r>a||o>i||((o>r||isNaN(r))&&(r=o),(a=0?(s=(e.min.z-f.z)*d,l=(e.max.z-f.z)*d):(s=(e.max.z-f.z)*d,l=(e.min.z-f.z)*d),r>l||s>i)||((s>r||r!==r)&&(r=s),(l=0?r:i,n)}intersectsBox(e){return this.intersectBox(e,Ra)!==null}intersectTriangle(e,n,r,i,o){Q_.subVectors(n,e),Og.subVectors(r,e),ew.crossVectors(Q_,Og);let a=this.direction.dot(ew),s;if(a>0){if(i)return null;s=1}else if(a<0)s=-1,a=-a;else return null;_s.subVectors(this.origin,e);const l=s*this.direction.dot(Og.crossVectors(_s,Og));if(l<0)return null;const c=s*this.direction.dot(Q_.cross(_s));if(c<0||l+c>a)return null;const u=-s*_s.dot(ew);return u<0?null:this.at(u/a,o)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class gt{constructor(e,n,r,i,o,a,s,l,c,u,d,f,p,y,v,g){gt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,n,r,i,o,a,s,l,c,u,d,f,p,y,v,g)}set(e,n,r,i,o,a,s,l,c,u,d,f,p,y,v,g){const m=this.elements;return m[0]=e,m[4]=n,m[8]=r,m[12]=i,m[1]=o,m[5]=a,m[9]=s,m[13]=l,m[2]=c,m[6]=u,m[10]=d,m[14]=f,m[3]=p,m[7]=y,m[11]=v,m[15]=g,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new gt().fromArray(this.elements)}copy(e){const n=this.elements,r=e.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],n[9]=r[9],n[10]=r[10],n[11]=r[11],n[12]=r[12],n[13]=r[13],n[14]=r[14],n[15]=r[15],this}copyPosition(e){const n=this.elements,r=e.elements;return n[12]=r[12],n[13]=r[13],n[14]=r[14],this}setFromMatrix3(e){const n=e.elements;return this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1),this}extractBasis(e,n,r){return e.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}makeBasis(e,n,r){return this.set(e.x,n.x,r.x,0,e.y,n.y,r.y,0,e.z,n.z,r.z,0,0,0,0,1),this}extractRotation(e){const n=this.elements,r=e.elements,i=1/du.setFromMatrixColumn(e,0).length(),o=1/du.setFromMatrixColumn(e,1).length(),a=1/du.setFromMatrixColumn(e,2).length();return n[0]=r[0]*i,n[1]=r[1]*i,n[2]=r[2]*i,n[3]=0,n[4]=r[4]*o,n[5]=r[5]*o,n[6]=r[6]*o,n[7]=0,n[8]=r[8]*a,n[9]=r[9]*a,n[10]=r[10]*a,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromEuler(e){const n=this.elements,r=e.x,i=e.y,o=e.z,a=Math.cos(r),s=Math.sin(r),l=Math.cos(i),c=Math.sin(i),u=Math.cos(o),d=Math.sin(o);if(e.order==="XYZ"){const f=a*u,p=a*d,y=s*u,v=s*d;n[0]=l*u,n[4]=-l*d,n[8]=c,n[1]=p+y*c,n[5]=f-v*c,n[9]=-s*l,n[2]=v-f*c,n[6]=y+p*c,n[10]=a*l}else if(e.order==="YXZ"){const f=l*u,p=l*d,y=c*u,v=c*d;n[0]=f+v*s,n[4]=y*s-p,n[8]=a*c,n[1]=a*d,n[5]=a*u,n[9]=-s,n[2]=p*s-y,n[6]=v+f*s,n[10]=a*l}else if(e.order==="ZXY"){const f=l*u,p=l*d,y=c*u,v=c*d;n[0]=f-v*s,n[4]=-a*d,n[8]=y+p*s,n[1]=p+y*s,n[5]=a*u,n[9]=v-f*s,n[2]=-a*c,n[6]=s,n[10]=a*l}else if(e.order==="ZYX"){const f=a*u,p=a*d,y=s*u,v=s*d;n[0]=l*u,n[4]=y*c-p,n[8]=f*c+v,n[1]=l*d,n[5]=v*c+f,n[9]=p*c-y,n[2]=-c,n[6]=s*l,n[10]=a*l}else if(e.order==="YZX"){const f=a*l,p=a*c,y=s*l,v=s*c;n[0]=l*u,n[4]=v-f*d,n[8]=y*d+p,n[1]=d,n[5]=a*u,n[9]=-s*u,n[2]=-c*u,n[6]=p*d+y,n[10]=f-v*d}else if(e.order==="XZY"){const f=a*l,p=a*c,y=s*l,v=s*c;n[0]=l*u,n[4]=-d,n[8]=c*u,n[1]=f*d+v,n[5]=a*u,n[9]=p*d-y,n[2]=y*d-p,n[6]=s*u,n[10]=v*d+f}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromQuaternion(e){return this.compose(cee,e,uee)}lookAt(e,n,r){const i=this.elements;return xi.subVectors(e,n),xi.lengthSq()===0&&(xi.z=1),xi.normalize(),ws.crossVectors(r,xi),ws.lengthSq()===0&&(Math.abs(r.z)===1?xi.x+=1e-4:xi.z+=1e-4,xi.normalize(),ws.crossVectors(r,xi)),ws.normalize(),Ig.crossVectors(xi,ws),i[0]=ws.x,i[4]=Ig.x,i[8]=xi.x,i[1]=ws.y,i[5]=Ig.y,i[9]=xi.y,i[2]=ws.z,i[6]=Ig.z,i[10]=xi.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const r=e.elements,i=n.elements,o=this.elements,a=r[0],s=r[4],l=r[8],c=r[12],u=r[1],d=r[5],f=r[9],p=r[13],y=r[2],v=r[6],g=r[10],m=r[14],x=r[3],b=r[7],S=r[11],w=r[15],E=i[0],T=i[4],A=i[8],M=i[12],C=i[1],P=i[5],R=i[9],D=i[13],k=i[2],U=i[6],O=i[10],W=i[14],L=i[3],j=i[7],X=i[11],K=i[15];return o[0]=a*E+s*C+l*k+c*L,o[4]=a*T+s*P+l*U+c*j,o[8]=a*A+s*R+l*O+c*X,o[12]=a*M+s*D+l*W+c*K,o[1]=u*E+d*C+f*k+p*L,o[5]=u*T+d*P+f*U+p*j,o[9]=u*A+d*R+f*O+p*X,o[13]=u*M+d*D+f*W+p*K,o[2]=y*E+v*C+g*k+m*L,o[6]=y*T+v*P+g*U+m*j,o[10]=y*A+v*R+g*O+m*X,o[14]=y*M+v*D+g*W+m*K,o[3]=x*E+b*C+S*k+w*L,o[7]=x*T+b*P+S*U+w*j,o[11]=x*A+b*R+S*O+w*X,o[15]=x*M+b*D+S*W+w*K,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[4]*=e,n[8]*=e,n[12]*=e,n[1]*=e,n[5]*=e,n[9]*=e,n[13]*=e,n[2]*=e,n[6]*=e,n[10]*=e,n[14]*=e,n[3]*=e,n[7]*=e,n[11]*=e,n[15]*=e,this}determinant(){const e=this.elements,n=e[0],r=e[4],i=e[8],o=e[12],a=e[1],s=e[5],l=e[9],c=e[13],u=e[2],d=e[6],f=e[10],p=e[14],y=e[3],v=e[7],g=e[11],m=e[15];return y*(+o*l*d-i*c*d-o*s*f+r*c*f+i*s*p-r*l*p)+v*(+n*l*p-n*c*f+o*a*f-i*a*p+i*c*u-o*l*u)+g*(+n*c*d-n*s*p-o*a*d+r*a*p+o*s*u-r*c*u)+m*(-i*s*u-n*l*d+n*s*f+i*a*d-r*a*f+r*l*u)}transpose(){const e=this.elements;let n;return n=e[1],e[1]=e[4],e[4]=n,n=e[2],e[2]=e[8],e[8]=n,n=e[6],e[6]=e[9],e[9]=n,n=e[3],e[3]=e[12],e[12]=n,n=e[7],e[7]=e[13],e[13]=n,n=e[11],e[11]=e[14],e[14]=n,this}setPosition(e,n,r){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=n,i[14]=r),this}invert(){const e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],u=e[8],d=e[9],f=e[10],p=e[11],y=e[12],v=e[13],g=e[14],m=e[15],x=d*g*c-v*f*c+v*l*p-s*g*p-d*l*m+s*f*m,b=y*f*c-u*g*c-y*l*p+a*g*p+u*l*m-a*f*m,S=u*v*c-y*d*c+y*s*p-a*v*p-u*s*m+a*d*m,w=y*d*l-u*v*l-y*s*f+a*v*f+u*s*g-a*d*g,E=n*x+r*b+i*S+o*w;if(E===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const T=1/E;return e[0]=x*T,e[1]=(v*f*o-d*g*o-v*i*p+r*g*p+d*i*m-r*f*m)*T,e[2]=(s*g*o-v*l*o+v*i*c-r*g*c-s*i*m+r*l*m)*T,e[3]=(d*l*o-s*f*o-d*i*c+r*f*c+s*i*p-r*l*p)*T,e[4]=b*T,e[5]=(u*g*o-y*f*o+y*i*p-n*g*p-u*i*m+n*f*m)*T,e[6]=(y*l*o-a*g*o-y*i*c+n*g*c+a*i*m-n*l*m)*T,e[7]=(a*f*o-u*l*o+u*i*c-n*f*c-a*i*p+n*l*p)*T,e[8]=S*T,e[9]=(y*d*o-u*v*o-y*r*p+n*v*p+u*r*m-n*d*m)*T,e[10]=(a*v*o-y*s*o+y*r*c-n*v*c-a*r*m+n*s*m)*T,e[11]=(u*s*o-a*d*o-u*r*c+n*d*c+a*r*p-n*s*p)*T,e[12]=w*T,e[13]=(u*v*i-y*d*i+y*r*f-n*v*f-u*r*g+n*d*g)*T,e[14]=(y*s*i-a*v*i-y*r*l+n*v*l+a*r*g-n*s*g)*T,e[15]=(a*d*i-u*s*i+u*r*l-n*d*l-a*r*f+n*s*f)*T,this}scale(e){const n=this.elements,r=e.x,i=e.y,o=e.z;return n[0]*=r,n[4]*=i,n[8]*=o,n[1]*=r,n[5]*=i,n[9]*=o,n[2]*=r,n[6]*=i,n[10]*=o,n[3]*=r,n[7]*=i,n[11]*=o,this}getMaxScaleOnAxis(){const e=this.elements,n=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(n,r,i))}makeTranslation(e,n,r){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,n,0,0,1,r,0,0,0,1),this}makeRotationX(e){const n=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,n,-r,0,0,r,n,0,0,0,0,1),this}makeRotationY(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,0,r,0,0,1,0,0,-r,0,n,0,0,0,0,1),this}makeRotationZ(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,-r,0,0,r,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,n){const r=Math.cos(n),i=Math.sin(n),o=1-r,a=e.x,s=e.y,l=e.z,c=o*a,u=o*s;return this.set(c*a+r,c*s-i*l,c*l+i*s,0,c*s+i*l,u*s+r,u*l-i*a,0,c*l-i*s,u*l+i*a,o*l*l+r,0,0,0,0,1),this}makeScale(e,n,r){return this.set(e,0,0,0,0,n,0,0,0,0,r,0,0,0,0,1),this}makeShear(e,n,r,i,o,a){return this.set(1,r,o,0,e,1,a,0,n,i,1,0,0,0,0,1),this}compose(e,n,r){const i=this.elements,o=n._x,a=n._y,s=n._z,l=n._w,c=o+o,u=a+a,d=s+s,f=o*c,p=o*u,y=o*d,v=a*u,g=a*d,m=s*d,x=l*c,b=l*u,S=l*d,w=r.x,E=r.y,T=r.z;return i[0]=(1-(v+m))*w,i[1]=(p+S)*w,i[2]=(y-b)*w,i[3]=0,i[4]=(p-S)*E,i[5]=(1-(f+m))*E,i[6]=(g+x)*E,i[7]=0,i[8]=(y+b)*T,i[9]=(g-x)*T,i[10]=(1-(f+v))*T,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,n,r){const i=this.elements;let o=du.set(i[0],i[1],i[2]).length();const a=du.set(i[4],i[5],i[6]).length(),s=du.set(i[8],i[9],i[10]).length();this.determinant()<0&&(o=-o),e.x=i[12],e.y=i[13],e.z=i[14],ho.copy(this);const c=1/o,u=1/a,d=1/s;return ho.elements[0]*=c,ho.elements[1]*=c,ho.elements[2]*=c,ho.elements[4]*=u,ho.elements[5]*=u,ho.elements[6]*=u,ho.elements[8]*=d,ho.elements[9]*=d,ho.elements[10]*=d,n.setFromRotationMatrix(ho),r.x=o,r.y=a,r.z=s,this}makePerspective(e,n,r,i,o,a,s=Xa){const l=this.elements,c=2*o/(n-e),u=2*o/(r-i),d=(n+e)/(n-e),f=(r+i)/(r-i);let p,y;if(s===Xa)p=-(a+o)/(a-o),y=-2*a*o/(a-o);else if(s===Ny)p=-a/(a-o),y=-a*o/(a-o);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+s);return l[0]=c,l[4]=0,l[8]=d,l[12]=0,l[1]=0,l[5]=u,l[9]=f,l[13]=0,l[2]=0,l[6]=0,l[10]=p,l[14]=y,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,n,r,i,o,a,s=Xa){const l=this.elements,c=1/(n-e),u=1/(r-i),d=1/(a-o),f=(n+e)*c,p=(r+i)*u;let y,v;if(s===Xa)y=(a+o)*d,v=-2*d;else if(s===Ny)y=o*d,v=-1*d;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+s);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-f,l[1]=0,l[5]=2*u,l[9]=0,l[13]=-p,l[2]=0,l[6]=0,l[10]=v,l[14]=-y,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const n=this.elements,r=e.elements;for(let i=0;i<16;i++)if(n[i]!==r[i])return!1;return!0}fromArray(e,n=0){for(let r=0;r<16;r++)this.elements[r]=e[r+n];return this}toArray(e=[],n=0){const r=this.elements;return e[n]=r[0],e[n+1]=r[1],e[n+2]=r[2],e[n+3]=r[3],e[n+4]=r[4],e[n+5]=r[5],e[n+6]=r[6],e[n+7]=r[7],e[n+8]=r[8],e[n+9]=r[9],e[n+10]=r[10],e[n+11]=r[11],e[n+12]=r[12],e[n+13]=r[13],e[n+14]=r[14],e[n+15]=r[15],e}}const du=new ne,ho=new gt,cee=new ne(0,0,0),uee=new ne(1,1,1),ws=new ne,Ig=new ne,xi=new ne,JN=new gt,ZN=new Ii;class pi{constructor(e=0,n=0,r=0,i=pi.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=n,this._z=r,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,n,r,i=this._order){return this._x=e,this._y=n,this._z=r,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,n=this._order,r=!0){const i=e.elements,o=i[0],a=i[4],s=i[8],l=i[1],c=i[5],u=i[9],d=i[2],f=i[6],p=i[10];switch(n){case"XYZ":this._y=Math.asin(It(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-u,p),this._z=Math.atan2(-a,o)):(this._x=Math.atan2(f,c),this._z=0);break;case"YXZ":this._x=Math.asin(-It(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(s,p),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-d,o),this._z=0);break;case"ZXY":this._x=Math.asin(It(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-d,p),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,o));break;case"ZYX":this._y=Math.asin(-It(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(f,p),this._z=Math.atan2(l,o)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(It(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-d,o)):(this._x=0,this._y=Math.atan2(s,p));break;case"XZY":this._z=Math.asin(-It(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(f,c),this._y=Math.atan2(s,o)):(this._x=Math.atan2(-u,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,r===!0&&this._onChangeCallback(),this}setFromQuaternion(e,n,r){return JN.makeRotationFromQuaternion(e),this.setFromRotationMatrix(JN,n,r)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return ZN.setFromEuler(this),this.setFromQuaternion(ZN,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}pi.DEFAULT_ORDER="XYZ";class ZA{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let n=0;n1){for(let r=0;r0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.geometryInfo=this._geometryInfo.map(s=>({...s,boundingBox:s.boundingBox?s.boundingBox.toJSON():void 0,boundingSphere:s.boundingSphere?s.boundingSphere.toJSON():void 0})),i.instanceInfo=this._instanceInfo.map(s=>({...s})),i.availableInstanceIds=this._availableInstanceIds.slice(),i.availableGeometryIds=this._availableGeometryIds.slice(),i.nextIndexStart=this._nextIndexStart,i.nextVertexStart=this._nextVertexStart,i.geometryCount=this._geometryCount,i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.matricesTexture=this._matricesTexture.toJSON(e),i.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(i.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(i.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(i.boundingBox=this.boundingBox.toJSON()));function o(s,l){return s[l.uuid]===void 0&&(s[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=o(e.geometries,this.geometry);const s=this.geometry.parameters;if(s!==void 0&&s.shapes!==void 0){const l=s.shapes;if(Array.isArray(l))for(let c=0,u=l.length;c0){i.children=[];for(let s=0;s0){i.animations=[];for(let s=0;s0&&(r.geometries=s),l.length>0&&(r.materials=l),c.length>0&&(r.textures=c),u.length>0&&(r.images=u),d.length>0&&(r.shapes=d),f.length>0&&(r.skeletons=f),p.length>0&&(r.animations=p),y.length>0&&(r.nodes=y)}return r.object=i,r;function a(s){const l=[];for(const c in s){const u=s[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,n=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),n===!0)for(let r=0;r0?i.multiplyScalar(1/Math.sqrt(o)):i.set(0,0,0)}static getBarycoord(e,n,r,i,o){po.subVectors(i,n),Oa.subVectors(r,n),nw.subVectors(e,n);const a=po.dot(po),s=po.dot(Oa),l=po.dot(nw),c=Oa.dot(Oa),u=Oa.dot(nw),d=a*c-s*s;if(d===0)return o.set(0,0,0),null;const f=1/d,p=(c*l-s*u)*f,y=(a*u-s*l)*f;return o.set(1-p-y,y,p)}static containsPoint(e,n,r,i){return this.getBarycoord(e,n,r,i,Ia)===null?!1:Ia.x>=0&&Ia.y>=0&&Ia.x+Ia.y<=1}static getInterpolation(e,n,r,i,o,a,s,l){return this.getBarycoord(e,n,r,i,Ia)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(o,Ia.x),l.addScaledVector(a,Ia.y),l.addScaledVector(s,Ia.z),l)}static getInterpolatedAttribute(e,n,r,i,o,a){return aw.setScalar(0),sw.setScalar(0),lw.setScalar(0),aw.fromBufferAttribute(e,n),sw.fromBufferAttribute(e,r),lw.fromBufferAttribute(e,i),a.setScalar(0),a.addScaledVector(aw,o.x),a.addScaledVector(sw,o.y),a.addScaledVector(lw,o.z),a}static isFrontFacing(e,n,r,i){return po.subVectors(r,n),Oa.subVectors(e,n),po.cross(Oa).dot(i)<0}set(e,n,r){return this.a.copy(e),this.b.copy(n),this.c.copy(r),this}setFromPointsAndIndices(e,n,r,i){return this.a.copy(e[n]),this.b.copy(e[r]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,n,r,i){return this.a.fromBufferAttribute(e,n),this.b.fromBufferAttribute(e,r),this.c.fromBufferAttribute(e,i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return po.subVectors(this.c,this.b),Oa.subVectors(this.a,this.b),po.cross(Oa).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Ro.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return Ro.getBarycoord(e,this.a,this.b,this.c,n)}getInterpolation(e,n,r,i,o){return Ro.getInterpolation(e,this.a,this.b,this.c,n,r,i,o)}containsPoint(e){return Ro.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Ro.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,n){const r=this.a,i=this.b,o=this.c;let a,s;pu.subVectors(i,r),mu.subVectors(o,r),rw.subVectors(e,r);const l=pu.dot(rw),c=mu.dot(rw);if(l<=0&&c<=0)return n.copy(r);iw.subVectors(e,i);const u=pu.dot(iw),d=mu.dot(iw);if(u>=0&&d<=u)return n.copy(i);const f=l*d-u*c;if(f<=0&&l>=0&&u<=0)return a=l/(l-u),n.copy(r).addScaledVector(pu,a);ow.subVectors(e,o);const p=pu.dot(ow),y=mu.dot(ow);if(y>=0&&p<=y)return n.copy(o);const v=p*c-l*y;if(v<=0&&c>=0&&y<=0)return s=c/(c-y),n.copy(r).addScaledVector(mu,s);const g=u*y-p*d;if(g<=0&&d-u>=0&&p-y>=0)return iO.subVectors(o,i),s=(d-u)/(d-u+(p-y)),n.copy(i).addScaledVector(iO,s);const m=1/(g+v+f);return a=v*m,s=f*m,n.copy(r).addScaledVector(pu,a).addScaledVector(mu,s)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const k4={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ss={h:0,s:0,l:0},Lg={h:0,s:0,l:0};function cw(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*6*(2/3-n):t}let ft=class{constructor(e,n,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,n,r)}set(e,n,r){if(n===void 0&&r===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,n,r);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,n=Zt){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Dt.colorSpaceToWorking(this,n),this}setRGB(e,n,r,i=Dt.workingColorSpace){return this.r=e,this.g=n,this.b=r,Dt.colorSpaceToWorking(this,i),this}setHSL(e,n,r,i=Dt.workingColorSpace){if(e=YA(e,1),n=It(n,0,1),r=It(r,0,1),n===0)this.r=this.g=this.b=r;else{const o=r<=.5?r*(1+n):r+n-r*n,a=2*r-o;this.r=cw(a,o,e+1/3),this.g=cw(a,o,e),this.b=cw(a,o,e-1/3)}return Dt.colorSpaceToWorking(this,i),this}setStyle(e,n=Zt){function r(o){o!==void 0&&parseFloat(o)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let o;const a=i[1],s=i[2];switch(a){case"rgb":case"rgba":if(o=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return r(o[4]),this.setRGB(Math.min(255,parseInt(o[1],10))/255,Math.min(255,parseInt(o[2],10))/255,Math.min(255,parseInt(o[3],10))/255,n);if(o=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return r(o[4]),this.setRGB(Math.min(100,parseInt(o[1],10))/100,Math.min(100,parseInt(o[2],10))/100,Math.min(100,parseInt(o[3],10))/100,n);break;case"hsl":case"hsla":if(o=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return r(o[4]),this.setHSL(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,n);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const o=i[1],a=o.length;if(a===3)return this.setRGB(parseInt(o.charAt(0),16)/15,parseInt(o.charAt(1),16)/15,parseInt(o.charAt(2),16)/15,n);if(a===6)return this.setHex(parseInt(o,16),n);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,n);return this}setColorName(e,n=Zt){const r=k4[e.toLowerCase()];return r!==void 0?this.setHex(r,n):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Ja(e.r),this.g=Ja(e.g),this.b=Ja(e.b),this}copyLinearToSRGB(e){return this.r=cd(e.r),this.g=cd(e.g),this.b=cd(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Zt){return Dt.workingToColorSpace(Ar.copy(this),e),Math.round(It(Ar.r*255,0,255))*65536+Math.round(It(Ar.g*255,0,255))*256+Math.round(It(Ar.b*255,0,255))}getHexString(e=Zt){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=Dt.workingColorSpace){Dt.workingToColorSpace(Ar.copy(this),n);const r=Ar.r,i=Ar.g,o=Ar.b,a=Math.max(r,i,o),s=Math.min(r,i,o);let l,c;const u=(s+a)/2;if(s===a)l=0,c=0;else{const d=a-s;switch(c=u<=.5?d/(a+s):d/(2-a-s),a){case r:l=(i-o)/d+(i0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const n in e){const r=e[n];if(r===void 0){console.warn(`THREE.Material: parameter '${n}' has value of undefined.`);continue}const i=this[n];if(i===void 0){console.warn(`THREE.Material: '${n}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(r):i&&i.isVector3&&r&&r.isVector3?i.copy(r):this[n]=r}}toJSON(e){const n=e===void 0||typeof e=="string";n&&(e={textures:{},images:{}});const r={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),this.roughness!==void 0&&(r.roughness=this.roughness),this.metalness!==void 0&&(r.metalness=this.metalness),this.sheen!==void 0&&(r.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(r.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(r.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(r.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(r.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(r.shininess=this.shininess),this.clearcoat!==void 0&&(r.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(r.dispersion=this.dispersion),this.iridescence!==void 0&&(r.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(r.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(r.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(r.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(r.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(r.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(r.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(e).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(e).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(e).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(e).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(e).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(r.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(r.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(r.combine=this.combine)),this.envMapRotation!==void 0&&(r.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(r.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(r.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(r.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(r.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(r.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(r.size=this.size),this.shadowSide!==null&&(r.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(r.sizeAttenuation=this.sizeAttenuation),this.blending!==sd&&(r.blending=this.blending),this.side!==ba&&(r.side=this.side),this.vertexColors===!0&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),this.transparent===!0&&(r.transparent=!0),this.blendSrc!==RE&&(r.blendSrc=this.blendSrc),this.blendDst!==NE&&(r.blendDst=this.blendDst),this.blendEquation!==ql&&(r.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(r.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(r.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(r.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(r.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(r.blendAlpha=this.blendAlpha),this.depthFunc!==jd&&(r.depthFunc=this.depthFunc),this.depthTest===!1&&(r.depthTest=this.depthTest),this.depthWrite===!1&&(r.depthWrite=this.depthWrite),this.colorWrite===!1&&(r.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(r.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==VN&&(r.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(r.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(r.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==au&&(r.stencilFail=this.stencilFail),this.stencilZFail!==au&&(r.stencilZFail=this.stencilZFail),this.stencilZPass!==au&&(r.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(r.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(r.rotation=this.rotation),this.polygonOffset===!0&&(r.polygonOffset=!0),this.polygonOffsetFactor!==0&&(r.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(r.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(r.linewidth=this.linewidth),this.dashSize!==void 0&&(r.dashSize=this.dashSize),this.gapSize!==void 0&&(r.gapSize=this.gapSize),this.scale!==void 0&&(r.scale=this.scale),this.dithering===!0&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),this.alphaHash===!0&&(r.alphaHash=!0),this.alphaToCoverage===!0&&(r.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(r.premultipliedAlpha=!0),this.forceSinglePass===!0&&(r.forceSinglePass=!0),this.wireframe===!0&&(r.wireframe=!0),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(r.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(r.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(r.flatShading=!0),this.visible===!1&&(r.visible=!1),this.toneMapped===!1&&(r.toneMapped=!1),this.fog===!1&&(r.fog=!1),Object.keys(this.userData).length>0&&(r.userData=this.userData);function i(o){const a=[];for(const s in o){const l=o[s];delete l.metadata,a.push(l)}return a}if(n){const o=i(e.textures),a=i(e.images);o.length>0&&(r.textures=o),a.length>0&&(r.images=a)}return r}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const n=e.clippingPlanes;let r=null;if(n!==null){const i=n.length;r=new Array(i);for(let o=0;o!==i;++o)r[o]=n[o].clone()}return this.clippingPlanes=r,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class ua extends qr{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new ft(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new pi,this.combine=kx,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Fn=new ne,kg=new xt;let gee=0;class cr{constructor(e,n,r=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:gee++}),this.name="",this.array=e,this.itemSize=n,this.count=e!==void 0?e.length/n:0,this.normalized=r,this.usage=p1,this.updateRanges=[],this.gpuType=Io,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,n,r){e*=this.itemSize,r*=n.itemSize;for(let i=0,o=this.itemSize;in.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),n.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Wo);const e=this.attributes.position,n=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new ne(-1/0,-1/0,-1/0),new ne(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),n)for(let r=0,i=n.length;r0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const n=this.index;n!==null&&(e.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});const r=this.attributes;for(const l in r){const c=r[l];e.data.attributes[l]=c.toJSON(e.data)}const i={};let o=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let d=0,f=c.length;d0&&(i[l]=u,o=!0)}o&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const s=this.boundingSphere;return s!==null&&(e.data.boundingSphere=s.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const n={};this.name=e.name;const r=e.index;r!==null&&this.setIndex(r.clone());const i=e.attributes;for(const c in i){const u=i[c];this.setAttribute(c,u.clone(n))}const o=e.morphAttributes;for(const c in o){const u=[],d=o[c];for(let f=0,p=d.length;f0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,a=i.length;o(e.far-e.near)**2))&&(oO.copy(o).invert(),Ll.copy(e.ray).applyMatrix4(oO),!(r.boundingBox!==null&&Ll.intersectsBox(r.boundingBox)===!1)&&this._computeIntersections(e,n,Ll)))}_computeIntersections(e,n,r){let i;const o=this.geometry,a=this.material,s=o.index,l=o.attributes.position,c=o.attributes.uv,u=o.attributes.uv1,d=o.attributes.normal,f=o.groups,p=o.drawRange;if(s!==null)if(Array.isArray(a))for(let y=0,v=f.length;yn.far?null:{distance:c,point:zg.clone(),object:t}}function Hg(t,e,n,r,i,o,a,s,l,c){t.getVertexPosition(s,Ug),t.getVertexPosition(l,Fg),t.getVertexPosition(c,Bg);const u=yee(t,e,n,r,Ug,Fg,Bg,sO);if(u){const d=new ne;Ro.getBarycoord(sO,Ug,Fg,Bg,d),i&&(u.uv=Ro.getInterpolatedAttribute(i,s,l,c,d,new xt)),o&&(u.uv1=Ro.getInterpolatedAttribute(o,s,l,c,d,new xt)),a&&(u.normal=Ro.getInterpolatedAttribute(a,s,l,c,d,new ne),u.normal.dot(r.direction)>0&&u.normal.multiplyScalar(-1));const f={a:s,b:l,c,normal:new ne,materialIndex:0};Ro.getNormal(Ug,Fg,Bg,f.normal),u.face=f,u.barycoord=d}return u}class Gc extends br{constructor(e=1,n=1,r=1,i=1,o=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:n,depth:r,widthSegments:i,heightSegments:o,depthSegments:a};const s=this;i=Math.floor(i),o=Math.floor(o),a=Math.floor(a);const l=[],c=[],u=[],d=[];let f=0,p=0;y("z","y","x",-1,-1,r,n,e,a,o,0),y("z","y","x",1,-1,r,n,-e,a,o,1),y("x","z","y",1,1,e,r,n,i,a,2),y("x","z","y",1,-1,e,r,-n,i,a,3),y("x","y","z",1,-1,e,n,r,i,o,4),y("x","y","z",-1,-1,e,n,-r,i,o,5),this.setIndex(l),this.setAttribute("position",new Qt(c,3)),this.setAttribute("normal",new Qt(u,3)),this.setAttribute("uv",new Qt(d,2));function y(v,g,m,x,b,S,w,E,T,A,M){const C=S/T,P=w/A,R=S/2,D=w/2,k=E/2,U=T+1,O=A+1;let W=0,L=0;const j=new ne;for(let X=0;X0?1:-1,u.push(j.x,j.y,j.z),d.push(F/T),d.push(1-X/A),W+=1}}for(let X=0;X>8&255]+Ar[t>>16&255]+Ar[t>>24&255]+"-"+Ar[e&255]+Ar[e>>8&255]+"-"+Ar[e>>16&15|64]+Ar[e>>24&255]+"-"+Ar[n&63|128]+Ar[n>>8&255]+"-"+Ar[n>>16&255]+Ar[n>>24&255]+Ar[r&255]+Ar[r>>8&255]+Ar[r>>16&255]+Ar[r>>24&255]).toLowerCase()}function It(t,e,n){return Math.max(e,Math.min(n,t))}function JA(t,e){return(t%e+e)%e}function UQ(t,e,n,r,i){return r+(t-e)*(i-r)/(n-e)}function FQ(t,e,n){return t!==e?(n-t)/(e-t):0}function Xh(t,e,n){return(1-n)*t+n*e}function BQ(t,e,n,r){return Xh(t,e,1-Math.exp(-n*r))}function $Q(t,e=1){return e-Math.abs(JA(t,e*2)-e)}function zQ(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*(3-2*t))}function HQ(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*t*(t*(t*6-15)+10))}function VQ(t,e){return t+Math.floor(Math.random()*(e-t+1))}function GQ(t,e){return t+Math.random()*(e-t)}function WQ(t){return t*(.5-Math.random())}function XQ(t){t!==void 0&&(XN=t);let e=XN+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function qQ(t){return t*Wh}function KQ(t){return t*Bd}function YQ(t){return(t&t-1)===0&&t!==0}function JQ(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function ZQ(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function QQ(t,e,n,r,i){const o=Math.cos,a=Math.sin,s=o(n/2),l=a(n/2),c=o((e+r)/2),u=a((e+r)/2),d=o((e-r)/2),f=a((e-r)/2),p=o((r-e)/2),y=a((r-e)/2);switch(i){case"XYX":t.set(s*u,l*d,l*f,s*c);break;case"YZY":t.set(l*f,s*u,l*d,s*c);break;case"ZXZ":t.set(l*d,l*f,s*u,s*c);break;case"XZX":t.set(s*u,l*y,l*p,s*c);break;case"YXY":t.set(l*p,s*u,l*y,s*c);break;case"ZYZ":t.set(l*y,l*p,s*u,s*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Ro(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function tn(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(t*4294967295);case Uint16Array:return Math.round(t*65535);case Uint8Array:return Math.round(t*255);case Int32Array:return Math.round(t*2147483647);case Int16Array:return Math.round(t*32767);case Int8Array:return Math.round(t*127);default:throw new Error("Invalid component type.")}}const Kl={DEG2RAD:Wh,RAD2DEG:Bd,generateUUID:Fo,clamp:It,euclideanModulo:JA,mapLinear:UQ,inverseLerp:FQ,lerp:Xh,damp:BQ,pingpong:$Q,smoothstep:zQ,smootherstep:HQ,randInt:VQ,randFloat:GQ,randFloatSpread:WQ,seededRandom:XQ,degToRad:qQ,radToDeg:KQ,isPowerOfTwo:YQ,ceilPowerOfTwo:JQ,floorPowerOfTwo:ZQ,setQuaternionFromProperEuler:QQ,normalize:tn,denormalize:Ro};class xt{constructor(e=0,n=0){xt.prototype.isVector2=!0,this.x=e,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,n){return this.x=e,this.y=n,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const n=this.x,r=this.y,i=e.elements;return this.x=i[0]*n+i[3]*r+i[6],this.y=i[1]*n+i[4]*r+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,n){return this.x=It(this.x,e.x,n.x),this.y=It(this.y,e.y,n.y),this}clampScalar(e,n){return this.x=It(this.x,e,n),this.y=It(this.y,e,n),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(It(r,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const r=this.dot(e)/n;return Math.acos(It(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y;return n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this}rotateAround(e,n){const r=Math.cos(n),i=Math.sin(n),o=this.x-e.x,a=this.y-e.y;return this.x=o*r-a*i+e.x,this.y=o*i+a*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Ii{constructor(e=0,n=0,r=0,i=1){this.isQuaternion=!0,this._x=e,this._y=n,this._z=r,this._w=i}static slerpFlat(e,n,r,i,o,a,s){let l=r[i+0],c=r[i+1],u=r[i+2],d=r[i+3];const f=o[a+0],p=o[a+1],y=o[a+2],v=o[a+3];if(s===0){e[n+0]=l,e[n+1]=c,e[n+2]=u,e[n+3]=d;return}if(s===1){e[n+0]=f,e[n+1]=p,e[n+2]=y,e[n+3]=v;return}if(d!==v||l!==f||c!==p||u!==y){let g=1-s;const m=l*f+c*p+u*y+d*v,x=m>=0?1:-1,b=1-m*m;if(b>Number.EPSILON){const w=Math.sqrt(b),E=Math.atan2(w,m*x);g=Math.sin(g*E)/w,s=Math.sin(s*E)/w}const S=s*x;if(l=l*g+f*S,c=c*g+p*S,u=u*g+y*S,d=d*g+v*S,g===1-s){const w=1/Math.sqrt(l*l+c*c+u*u+d*d);l*=w,c*=w,u*=w,d*=w}}e[n]=l,e[n+1]=c,e[n+2]=u,e[n+3]=d}static multiplyQuaternionsFlat(e,n,r,i,o,a){const s=r[i],l=r[i+1],c=r[i+2],u=r[i+3],d=o[a],f=o[a+1],p=o[a+2],y=o[a+3];return e[n]=s*y+u*d+l*p-c*f,e[n+1]=l*y+u*f+c*d-s*p,e[n+2]=c*y+u*p+s*f-l*d,e[n+3]=u*y-s*d-l*f-c*p,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,n,r,i){return this._x=e,this._y=n,this._z=r,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,n=!0){const r=e._x,i=e._y,o=e._z,a=e._order,s=Math.cos,l=Math.sin,c=s(r/2),u=s(i/2),d=s(o/2),f=l(r/2),p=l(i/2),y=l(o/2);switch(a){case"XYZ":this._x=f*u*d+c*p*y,this._y=c*p*d-f*u*y,this._z=c*u*y+f*p*d,this._w=c*u*d-f*p*y;break;case"YXZ":this._x=f*u*d+c*p*y,this._y=c*p*d-f*u*y,this._z=c*u*y-f*p*d,this._w=c*u*d+f*p*y;break;case"ZXY":this._x=f*u*d-c*p*y,this._y=c*p*d+f*u*y,this._z=c*u*y+f*p*d,this._w=c*u*d-f*p*y;break;case"ZYX":this._x=f*u*d-c*p*y,this._y=c*p*d+f*u*y,this._z=c*u*y-f*p*d,this._w=c*u*d+f*p*y;break;case"YZX":this._x=f*u*d+c*p*y,this._y=c*p*d+f*u*y,this._z=c*u*y-f*p*d,this._w=c*u*d-f*p*y;break;case"XZY":this._x=f*u*d-c*p*y,this._y=c*p*d-f*u*y,this._z=c*u*y+f*p*d,this._w=c*u*d+f*p*y;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return n===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,n){const r=n/2,i=Math.sin(r);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(e){const n=e.elements,r=n[0],i=n[4],o=n[8],a=n[1],s=n[5],l=n[9],c=n[2],u=n[6],d=n[10],f=r+s+d;if(f>0){const p=.5/Math.sqrt(f+1);this._w=.25/p,this._x=(u-l)*p,this._y=(o-c)*p,this._z=(a-i)*p}else if(r>s&&r>d){const p=2*Math.sqrt(1+r-s-d);this._w=(u-l)/p,this._x=.25*p,this._y=(i+a)/p,this._z=(o+c)/p}else if(s>d){const p=2*Math.sqrt(1+s-r-d);this._w=(o-c)/p,this._x=(i+a)/p,this._y=.25*p,this._z=(l+u)/p}else{const p=2*Math.sqrt(1+d-r-s);this._w=(a-i)/p,this._x=(o+c)/p,this._y=(l+u)/p,this._z=.25*p}return this._onChangeCallback(),this}setFromUnitVectors(e,n){let r=e.dot(n)+1;return rMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=r):(this._x=0,this._y=-e.z,this._z=e.y,this._w=r)):(this._x=e.y*n.z-e.z*n.y,this._y=e.z*n.x-e.x*n.z,this._z=e.x*n.y-e.y*n.x,this._w=r),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(It(this.dot(e),-1,1)))}rotateTowards(e,n){const r=this.angleTo(e);if(r===0)return this;const i=Math.min(1,n/r);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,n){const r=e._x,i=e._y,o=e._z,a=e._w,s=n._x,l=n._y,c=n._z,u=n._w;return this._x=r*u+a*s+i*c-o*l,this._y=i*u+a*l+o*s-r*c,this._z=o*u+a*c+r*l-i*s,this._w=a*u-r*s-i*l-o*c,this._onChangeCallback(),this}slerp(e,n){if(n===0)return this;if(n===1)return this.copy(e);const r=this._x,i=this._y,o=this._z,a=this._w;let s=a*e._w+r*e._x+i*e._y+o*e._z;if(s<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,s=-s):this.copy(e),s>=1)return this._w=a,this._x=r,this._y=i,this._z=o,this;const l=1-s*s;if(l<=Number.EPSILON){const p=1-n;return this._w=p*a+n*this._w,this._x=p*r+n*this._x,this._y=p*i+n*this._y,this._z=p*o+n*this._z,this.normalize(),this}const c=Math.sqrt(l),u=Math.atan2(c,s),d=Math.sin((1-n)*u)/c,f=Math.sin(n*u)/c;return this._w=a*d+this._w*f,this._x=r*d+this._x*f,this._y=i*d+this._y*f,this._z=o*d+this._z*f,this._onChangeCallback(),this}slerpQuaternions(e,n,r){return this.copy(e).slerp(n,r)}random(){const e=2*Math.PI*Math.random(),n=2*Math.PI*Math.random(),r=Math.random(),i=Math.sqrt(1-r),o=Math.sqrt(r);return this.set(i*Math.sin(e),i*Math.cos(e),o*Math.sin(n),o*Math.cos(n))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,n=0){return this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._w,e}fromBufferAttribute(e,n){return this._x=e.getX(n),this._y=e.getY(n),this._z=e.getZ(n),this._w=e.getW(n),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class ne{constructor(e=0,n=0,r=0){ne.prototype.isVector3=!0,this.x=e,this.y=n,this.z=r}set(e,n,r){return r===void 0&&(r=this.z),this.x=e,this.y=n,this.z=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,n){return this.x=e.x*n.x,this.y=e.y*n.y,this.z=e.z*n.z,this}applyEuler(e){return this.applyQuaternion(qN.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(qN.setFromAxisAngle(e,n))}applyMatrix3(e){const n=this.x,r=this.y,i=this.z,o=e.elements;return this.x=o[0]*n+o[3]*r+o[6]*i,this.y=o[1]*n+o[4]*r+o[7]*i,this.z=o[2]*n+o[5]*r+o[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const n=this.x,r=this.y,i=this.z,o=e.elements,a=1/(o[3]*n+o[7]*r+o[11]*i+o[15]);return this.x=(o[0]*n+o[4]*r+o[8]*i+o[12])*a,this.y=(o[1]*n+o[5]*r+o[9]*i+o[13])*a,this.z=(o[2]*n+o[6]*r+o[10]*i+o[14])*a,this}applyQuaternion(e){const n=this.x,r=this.y,i=this.z,o=e.x,a=e.y,s=e.z,l=e.w,c=2*(a*i-s*r),u=2*(s*n-o*i),d=2*(o*r-a*n);return this.x=n+l*c+a*d-s*u,this.y=r+l*u+s*c-o*d,this.z=i+l*d+o*u-a*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const n=this.x,r=this.y,i=this.z,o=e.elements;return this.x=o[0]*n+o[4]*r+o[8]*i,this.y=o[1]*n+o[5]*r+o[9]*i,this.z=o[2]*n+o[6]*r+o[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,n){return this.x=It(this.x,e.x,n.x),this.y=It(this.y,e.y,n.y),this.z=It(this.z,e.z,n.z),this}clampScalar(e,n){return this.x=It(this.x,e,n),this.y=It(this.y,e,n),this.z=It(this.z,e,n),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(It(r,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this.z=e.z+(n.z-e.z)*r,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,n){const r=e.x,i=e.y,o=e.z,a=n.x,s=n.y,l=n.z;return this.x=i*l-o*s,this.y=o*a-r*l,this.z=r*s-i*a,this}projectOnVector(e){const n=e.lengthSq();if(n===0)return this.set(0,0,0);const r=e.dot(this)/n;return this.copy(e).multiplyScalar(r)}projectOnPlane(e){return W_.copy(this).projectOnVector(e),this.sub(W_)}reflect(e){return this.sub(W_.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const r=this.dot(e)/n;return Math.acos(It(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y,i=this.z-e.z;return n*n+r*r+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,n,r){const i=Math.sin(n)*e;return this.x=i*Math.sin(r),this.y=Math.cos(n)*e,this.z=i*Math.cos(r),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,n,r){return this.x=e*Math.sin(n),this.y=r,this.z=e*Math.cos(n),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(e){const n=this.setFromMatrixColumn(e,0).length(),r=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=n,this.y=r,this.z=i,this}setFromMatrixColumn(e,n){return this.fromArray(e.elements,n*4)}setFromMatrix3Column(e,n){return this.fromArray(e.elements,n*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,n=Math.random()*2-1,r=Math.sqrt(1-n*n);return this.x=r*Math.cos(e),this.y=n,this.z=r*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const W_=new ne,qN=new Ii;class Rt{constructor(e,n,r,i,o,a,s,l,c){Rt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,n,r,i,o,a,s,l,c)}set(e,n,r,i,o,a,s,l,c){const u=this.elements;return u[0]=e,u[1]=i,u[2]=s,u[3]=n,u[4]=o,u[5]=l,u[6]=r,u[7]=a,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const n=this.elements,r=e.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],this}extractBasis(e,n,r){return e.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const n=e.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const r=e.elements,i=n.elements,o=this.elements,a=r[0],s=r[3],l=r[6],c=r[1],u=r[4],d=r[7],f=r[2],p=r[5],y=r[8],v=i[0],g=i[3],m=i[6],x=i[1],b=i[4],S=i[7],w=i[2],E=i[5],T=i[8];return o[0]=a*v+s*x+l*w,o[3]=a*g+s*b+l*E,o[6]=a*m+s*S+l*T,o[1]=c*v+u*x+d*w,o[4]=c*g+u*b+d*E,o[7]=c*m+u*S+d*T,o[2]=f*v+p*x+y*w,o[5]=f*g+p*b+y*E,o[8]=f*m+p*S+y*T,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=e,n[4]*=e,n[7]*=e,n[2]*=e,n[5]*=e,n[8]*=e,this}determinant(){const e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],u=e[8];return n*a*u-n*s*c-r*o*u+r*s*l+i*o*c-i*a*l}invert(){const e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],u=e[8],d=u*a-s*c,f=s*l-u*o,p=c*o-a*l,y=n*d+r*f+i*p;if(y===0)return this.set(0,0,0,0,0,0,0,0,0);const v=1/y;return e[0]=d*v,e[1]=(i*c-u*r)*v,e[2]=(s*r-i*a)*v,e[3]=f*v,e[4]=(u*n-i*l)*v,e[5]=(i*o-s*n)*v,e[6]=p*v,e[7]=(r*l-c*n)*v,e[8]=(a*n-r*o)*v,this}transpose(){let e;const n=this.elements;return e=n[1],n[1]=n[3],n[3]=e,e=n[2],n[2]=n[6],n[6]=e,e=n[5],n[5]=n[7],n[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const n=this.elements;return e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],this}setUvTransform(e,n,r,i,o,a,s){const l=Math.cos(o),c=Math.sin(o);return this.set(r*l,r*c,-r*(l*a+c*s)+a+e,-i*c,i*l,-i*(-c*a+l*s)+s+n,0,0,1),this}scale(e,n){return this.premultiply(X_.makeScale(e,n)),this}rotate(e){return this.premultiply(X_.makeRotation(-e)),this}translate(e,n){return this.premultiply(X_.makeTranslation(e,n)),this}makeTranslation(e,n){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,n,0,0,1),this}makeRotation(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,-r,0,r,n,0,0,0,1),this}makeScale(e,n){return this.set(e,0,0,0,n,0,0,0,1),this}equals(e){const n=this.elements,r=e.elements;for(let i=0;i<9;i++)if(n[i]!==r[i])return!1;return!0}fromArray(e,n=0){for(let r=0;r<9;r++)this.elements[r]=e[r+n];return this}toArray(e=[],n=0){const r=this.elements;return e[n]=r[0],e[n+1]=r[1],e[n+2]=r[2],e[n+3]=r[3],e[n+4]=r[4],e[n+5]=r[5],e[n+6]=r[6],e[n+7]=r[7],e[n+8]=r[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const X_=new Rt;function k4(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}function Rp(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function eee(){const t=Rp("canvas");return t.style.display="block",t}const KN={};function ld(t){t in KN||(KN[t]=!0,console.warn(t))}function tee(t,e,n){return new Promise(function(r,i){function o(){switch(t.clientWaitSync(e,t.SYNC_FLUSH_COMMANDS_BIT,0)){case t.WAIT_FAILED:i();break;case t.TIMEOUT_EXPIRED:setTimeout(o,n);break;default:r()}}setTimeout(o,n)})}function nee(t){const e=t.elements;e[2]=.5*e[2]+.5*e[3],e[6]=.5*e[6]+.5*e[7],e[10]=.5*e[10]+.5*e[11],e[14]=.5*e[14]+.5*e[15]}function ree(t){const e=t.elements;e[11]===-1?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=-e[14]+1)}const YN=new Rt().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),JN=new Rt().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function iee(){const t={enabled:!0,workingColorSpace:Kr,spaces:{},convert:function(i,o,a){return this.enabled===!1||o===a||!o||!a||(this.spaces[o].transfer===an&&(i.r=Ja(i.r),i.g=Ja(i.g),i.b=Ja(i.b)),this.spaces[o].primaries!==this.spaces[a].primaries&&(i.applyMatrix3(this.spaces[o].toXYZ),i.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===an&&(i.r=cd(i.r),i.g=cd(i.g),i.b=cd(i.b))),i},workingToColorSpace:function(i,o){return this.convert(i,this.workingColorSpace,o)},colorSpaceToWorking:function(i,o){return this.convert(i,o,this.workingColorSpace)},getPrimaries:function(i){return this.spaces[i].primaries},getTransfer:function(i){return i===Ds?Ry:this.spaces[i].transfer},getLuminanceCoefficients:function(i,o=this.workingColorSpace){return i.fromArray(this.spaces[o].luminanceCoefficients)},define:function(i){Object.assign(this.spaces,i)},_getMatrix:function(i,o,a){return i.copy(this.spaces[o].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(i){return this.spaces[i].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(i=this.workingColorSpace){return this.spaces[i].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(i,o){return ld("THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),t.workingToColorSpace(i,o)},toWorkingColorSpace:function(i,o){return ld("THREE.ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),t.colorSpaceToWorking(i,o)}},e=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],r=[.3127,.329];return t.define({[Kr]:{primaries:e,whitePoint:r,transfer:Ry,toXYZ:YN,fromXYZ:JN,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:Zt},outputColorSpaceConfig:{drawingBufferColorSpace:Zt}},[Zt]:{primaries:e,whitePoint:r,transfer:an,toXYZ:YN,fromXYZ:JN,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:Zt}}}),t}const Dt=iee();function Ja(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function cd(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}let su;class oee{static getDataURL(e,n="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let r;if(e instanceof HTMLCanvasElement)r=e;else{su===void 0&&(su=Rp("canvas")),su.width=e.width,su.height=e.height;const i=su.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),r=su}return r.toDataURL(n)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const n=Rp("canvas");n.width=e.width,n.height=e.height;const r=n.getContext("2d");r.drawImage(e,0,0,e.width,e.height);const i=r.getImageData(0,0,e.width,e.height),o=i.data;for(let a=0;a1),this.pmremVersion=0}get width(){return this.source.getSize(K_).x}get height(){return this.source.getSize(K_).y}get depth(){return this.source.getSize(K_).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const n in e){const r=e[n];if(r===void 0){console.warn(`THREE.Texture.setValues(): parameter '${n}' has value of undefined.`);continue}const i=this[n];if(i===void 0){console.warn(`THREE.Texture.setValues(): property '${n}' does not exist.`);continue}i&&r&&i.isVector2&&r.isVector2||i&&r&&i.isVector3&&r.isVector3||i&&r&&i.isMatrix3&&r.isMatrix3?i.copy(r):this[n]=r}}toJSON(e){const n=e===void 0||typeof e=="string";if(!n&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const r={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(r.userData=this.userData),n||(e.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==T4)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case ca:e.x=e.x-Math.floor(e.x);break;case Ji:e.x=e.x<0?0:1;break;case Py:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case ca:e.y=e.y-Math.floor(e.y);break;case Ji:e.y=e.y<0?0:1;break;case Py:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}lr.DEFAULT_IMAGE=null;lr.DEFAULT_MAPPING=T4;lr.DEFAULT_ANISOTROPY=1;class Yt{constructor(e=0,n=0,r=0,i=1){Yt.prototype.isVector4=!0,this.x=e,this.y=n,this.z=r,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,n,r,i){return this.x=e,this.y=n,this.z=r,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this.w=e.w+n.w,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this.w+=e.w*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this.w=e.w-n.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const n=this.x,r=this.y,i=this.z,o=this.w,a=e.elements;return this.x=a[0]*n+a[4]*r+a[8]*i+a[12]*o,this.y=a[1]*n+a[5]*r+a[9]*i+a[13]*o,this.z=a[2]*n+a[6]*r+a[10]*i+a[14]*o,this.w=a[3]*n+a[7]*r+a[11]*i+a[15]*o,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const n=Math.sqrt(1-e.w*e.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/n,this.y=e.y/n,this.z=e.z/n),this}setAxisAngleFromRotationMatrix(e){let n,r,i,o;const l=e.elements,c=l[0],u=l[4],d=l[8],f=l[1],p=l[5],y=l[9],v=l[2],g=l[6],m=l[10];if(Math.abs(u-f)<.01&&Math.abs(d-v)<.01&&Math.abs(y-g)<.01){if(Math.abs(u+f)<.1&&Math.abs(d+v)<.1&&Math.abs(y+g)<.1&&Math.abs(c+p+m-3)<.1)return this.set(1,0,0,0),this;n=Math.PI;const b=(c+1)/2,S=(p+1)/2,w=(m+1)/2,E=(u+f)/4,T=(d+v)/4,A=(y+g)/4;return b>S&&b>w?b<.01?(r=0,i=.707106781,o=.707106781):(r=Math.sqrt(b),i=E/r,o=T/r):S>w?S<.01?(r=.707106781,i=0,o=.707106781):(i=Math.sqrt(S),r=E/i,o=A/i):w<.01?(r=.707106781,i=.707106781,o=0):(o=Math.sqrt(w),r=T/o,i=A/o),this.set(r,i,o,n),this}let x=Math.sqrt((g-y)*(g-y)+(d-v)*(d-v)+(f-u)*(f-u));return Math.abs(x)<.001&&(x=1),this.x=(g-y)/x,this.y=(d-v)/x,this.z=(f-u)/x,this.w=Math.acos((c+p+m-1)/2),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this.w=n[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,n){return this.x=It(this.x,e.x,n.x),this.y=It(this.y,e.y,n.y),this.z=It(this.z,e.z,n.z),this.w=It(this.w,e.w,n.w),this}clampScalar(e,n){return this.x=It(this.x,e,n),this.y=It(this.y,e,n),this.z=It(this.z,e,n),this.w=It(this.w,e,n),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(It(r,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this.w+=(e.w-this.w)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this.z=e.z+(n.z-e.z)*r,this.w=e.w+(n.w-e.w)*r,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this.w=e[n+3],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e[n+3]=this.w,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this.w=e.getW(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class lee extends Vc{constructor(e=1,n=1,r={}){super(),r=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Ir,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},r),this.isRenderTarget=!0,this.width=e,this.height=n,this.depth=r.depth,this.scissor=new Yt(0,0,e,n),this.scissorTest=!1,this.viewport=new Yt(0,0,e,n);const i={width:e,height:n,depth:r.depth},o=new lr(i);this.textures=[];const a=r.count;for(let s=0;s1;this.dispose()}this.viewport.set(0,0,e,n),this.scissor.set(0,0,e,n)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let n=0,r=e.textures.length;n=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,n){return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,fo),fo.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let n,r;return e.normal.x>0?(n=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(n=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(n+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(n+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(n+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(n+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),n<=-e.constant&&r>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(nh),Pg.subVectors(this.max,nh),lu.subVectors(e.a,nh),cu.subVectors(e.b,nh),uu.subVectors(e.c,nh),xs.subVectors(cu,lu),bs.subVectors(uu,cu),Il.subVectors(lu,uu);let n=[0,-xs.z,xs.y,0,-bs.z,bs.y,0,-Il.z,Il.y,xs.z,0,-xs.x,bs.z,0,-bs.x,Il.z,0,-Il.x,-xs.y,xs.x,0,-bs.y,bs.x,0,-Il.y,Il.x,0];return!Y_(n,lu,cu,uu,Pg)||(n=[1,0,0,0,1,0,0,0,1],!Y_(n,lu,cu,uu,Pg))?!1:(Rg.crossVectors(xs,bs),n=[Rg.x,Rg.y,Rg.z],Y_(n,lu,cu,uu,Pg))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,fo).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(fo).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Pa[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Pa[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Pa[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Pa[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Pa[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Pa[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Pa[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Pa[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Pa),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const Pa=[new ne,new ne,new ne,new ne,new ne,new ne,new ne,new ne],fo=new ne,Cg=new Xo,lu=new ne,cu=new ne,uu=new ne,xs=new ne,bs=new ne,Il=new ne,nh=new ne,Pg=new ne,Rg=new ne,Dl=new ne;function Y_(t,e,n,r,i){for(let o=0,a=t.length-3;o<=a;o+=3){Dl.fromArray(t,o);const s=i.x*Math.abs(Dl.x)+i.y*Math.abs(Dl.y)+i.z*Math.abs(Dl.z),l=e.dot(Dl),c=n.dot(Dl),u=r.dot(Dl);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>s)return!1}return!0}const uee=new Xo,rh=new ne,J_=new ne;class qo{constructor(e=new ne,n=-1){this.isSphere=!0,this.center=e,this.radius=n}set(e,n){return this.center.copy(e),this.radius=n,this}setFromPoints(e,n){const r=this.center;n!==void 0?r.copy(n):uee.setFromPoints(e).getCenter(r);let i=0;for(let o=0,a=e.length;othis.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;rh.subVectors(e,this.center);const n=rh.lengthSq();if(n>this.radius*this.radius){const r=Math.sqrt(n),i=(r-this.radius)*.5;this.center.addScaledVector(rh,i/r),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(J_.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(rh.copy(e.center).add(J_)),this.expandByPoint(rh.copy(e.center).sub(J_))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}const Ra=new ne,Z_=new ne,Ng=new ne,_s=new ne,Q_=new ne,Og=new ne,ew=new ne;class Sf{constructor(e=new ne,n=new ne(0,0,-1)){this.origin=e,this.direction=n}set(e,n){return this.origin.copy(e),this.direction.copy(n),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,n){return n.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Ra)),this}closestPointToPoint(e,n){n.subVectors(e,this.origin);const r=n.dot(this.direction);return r<0?n.copy(this.origin):n.copy(this.origin).addScaledVector(this.direction,r)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const n=Ra.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(Ra.copy(this.origin).addScaledVector(this.direction,n),Ra.distanceToSquared(e))}distanceSqToSegment(e,n,r,i){Z_.copy(e).add(n).multiplyScalar(.5),Ng.copy(n).sub(e).normalize(),_s.copy(this.origin).sub(Z_);const o=e.distanceTo(n)*.5,a=-this.direction.dot(Ng),s=_s.dot(this.direction),l=-_s.dot(Ng),c=_s.lengthSq(),u=Math.abs(1-a*a);let d,f,p,y;if(u>0)if(d=a*l-s,f=a*s-l,y=o*u,d>=0)if(f>=-y)if(f<=y){const v=1/u;d*=v,f*=v,p=d*(d+a*f+2*s)+f*(a*d+f+2*l)+c}else f=o,d=Math.max(0,-(a*f+s)),p=-d*d+f*(f+2*l)+c;else f=-o,d=Math.max(0,-(a*f+s)),p=-d*d+f*(f+2*l)+c;else f<=-y?(d=Math.max(0,-(-a*o+s)),f=d>0?-o:Math.min(Math.max(-o,-l),o),p=-d*d+f*(f+2*l)+c):f<=y?(d=0,f=Math.min(Math.max(-o,-l),o),p=f*(f+2*l)+c):(d=Math.max(0,-(a*o+s)),f=d>0?o:Math.min(Math.max(-o,-l),o),p=-d*d+f*(f+2*l)+c);else f=a>0?-o:o,d=Math.max(0,-(a*f+s)),p=-d*d+f*(f+2*l)+c;return r&&r.copy(this.origin).addScaledVector(this.direction,d),i&&i.copy(Z_).addScaledVector(Ng,f),p}intersectSphere(e,n){Ra.subVectors(e.center,this.origin);const r=Ra.dot(this.direction),i=Ra.dot(Ra)-r*r,o=e.radius*e.radius;if(i>o)return null;const a=Math.sqrt(o-i),s=r-a,l=r+a;return l<0?null:s<0?this.at(l,n):this.at(s,n)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const n=e.normal.dot(this.direction);if(n===0)return e.distanceToPoint(this.origin)===0?0:null;const r=-(this.origin.dot(e.normal)+e.constant)/n;return r>=0?r:null}intersectPlane(e,n){const r=this.distanceToPlane(e);return r===null?null:this.at(r,n)}intersectsPlane(e){const n=e.distanceToPoint(this.origin);return n===0||e.normal.dot(this.direction)*n<0}intersectBox(e,n){let r,i,o,a,s,l;const c=1/this.direction.x,u=1/this.direction.y,d=1/this.direction.z,f=this.origin;return c>=0?(r=(e.min.x-f.x)*c,i=(e.max.x-f.x)*c):(r=(e.max.x-f.x)*c,i=(e.min.x-f.x)*c),u>=0?(o=(e.min.y-f.y)*u,a=(e.max.y-f.y)*u):(o=(e.max.y-f.y)*u,a=(e.min.y-f.y)*u),r>a||o>i||((o>r||isNaN(r))&&(r=o),(a=0?(s=(e.min.z-f.z)*d,l=(e.max.z-f.z)*d):(s=(e.max.z-f.z)*d,l=(e.min.z-f.z)*d),r>l||s>i)||((s>r||r!==r)&&(r=s),(l=0?r:i,n)}intersectsBox(e){return this.intersectBox(e,Ra)!==null}intersectTriangle(e,n,r,i,o){Q_.subVectors(n,e),Og.subVectors(r,e),ew.crossVectors(Q_,Og);let a=this.direction.dot(ew),s;if(a>0){if(i)return null;s=1}else if(a<0)s=-1,a=-a;else return null;_s.subVectors(this.origin,e);const l=s*this.direction.dot(Og.crossVectors(_s,Og));if(l<0)return null;const c=s*this.direction.dot(Q_.cross(_s));if(c<0||l+c>a)return null;const u=-s*_s.dot(ew);return u<0?null:this.at(u/a,o)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class gt{constructor(e,n,r,i,o,a,s,l,c,u,d,f,p,y,v,g){gt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,n,r,i,o,a,s,l,c,u,d,f,p,y,v,g)}set(e,n,r,i,o,a,s,l,c,u,d,f,p,y,v,g){const m=this.elements;return m[0]=e,m[4]=n,m[8]=r,m[12]=i,m[1]=o,m[5]=a,m[9]=s,m[13]=l,m[2]=c,m[6]=u,m[10]=d,m[14]=f,m[3]=p,m[7]=y,m[11]=v,m[15]=g,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new gt().fromArray(this.elements)}copy(e){const n=this.elements,r=e.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],n[9]=r[9],n[10]=r[10],n[11]=r[11],n[12]=r[12],n[13]=r[13],n[14]=r[14],n[15]=r[15],this}copyPosition(e){const n=this.elements,r=e.elements;return n[12]=r[12],n[13]=r[13],n[14]=r[14],this}setFromMatrix3(e){const n=e.elements;return this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1),this}extractBasis(e,n,r){return e.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}makeBasis(e,n,r){return this.set(e.x,n.x,r.x,0,e.y,n.y,r.y,0,e.z,n.z,r.z,0,0,0,0,1),this}extractRotation(e){const n=this.elements,r=e.elements,i=1/du.setFromMatrixColumn(e,0).length(),o=1/du.setFromMatrixColumn(e,1).length(),a=1/du.setFromMatrixColumn(e,2).length();return n[0]=r[0]*i,n[1]=r[1]*i,n[2]=r[2]*i,n[3]=0,n[4]=r[4]*o,n[5]=r[5]*o,n[6]=r[6]*o,n[7]=0,n[8]=r[8]*a,n[9]=r[9]*a,n[10]=r[10]*a,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromEuler(e){const n=this.elements,r=e.x,i=e.y,o=e.z,a=Math.cos(r),s=Math.sin(r),l=Math.cos(i),c=Math.sin(i),u=Math.cos(o),d=Math.sin(o);if(e.order==="XYZ"){const f=a*u,p=a*d,y=s*u,v=s*d;n[0]=l*u,n[4]=-l*d,n[8]=c,n[1]=p+y*c,n[5]=f-v*c,n[9]=-s*l,n[2]=v-f*c,n[6]=y+p*c,n[10]=a*l}else if(e.order==="YXZ"){const f=l*u,p=l*d,y=c*u,v=c*d;n[0]=f+v*s,n[4]=y*s-p,n[8]=a*c,n[1]=a*d,n[5]=a*u,n[9]=-s,n[2]=p*s-y,n[6]=v+f*s,n[10]=a*l}else if(e.order==="ZXY"){const f=l*u,p=l*d,y=c*u,v=c*d;n[0]=f-v*s,n[4]=-a*d,n[8]=y+p*s,n[1]=p+y*s,n[5]=a*u,n[9]=v-f*s,n[2]=-a*c,n[6]=s,n[10]=a*l}else if(e.order==="ZYX"){const f=a*u,p=a*d,y=s*u,v=s*d;n[0]=l*u,n[4]=y*c-p,n[8]=f*c+v,n[1]=l*d,n[5]=v*c+f,n[9]=p*c-y,n[2]=-c,n[6]=s*l,n[10]=a*l}else if(e.order==="YZX"){const f=a*l,p=a*c,y=s*l,v=s*c;n[0]=l*u,n[4]=v-f*d,n[8]=y*d+p,n[1]=d,n[5]=a*u,n[9]=-s*u,n[2]=-c*u,n[6]=p*d+y,n[10]=f-v*d}else if(e.order==="XZY"){const f=a*l,p=a*c,y=s*l,v=s*c;n[0]=l*u,n[4]=-d,n[8]=c*u,n[1]=f*d+v,n[5]=a*u,n[9]=p*d-y,n[2]=y*d-p,n[6]=s*u,n[10]=v*d+f}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromQuaternion(e){return this.compose(dee,e,fee)}lookAt(e,n,r){const i=this.elements;return xi.subVectors(e,n),xi.lengthSq()===0&&(xi.z=1),xi.normalize(),ws.crossVectors(r,xi),ws.lengthSq()===0&&(Math.abs(r.z)===1?xi.x+=1e-4:xi.z+=1e-4,xi.normalize(),ws.crossVectors(r,xi)),ws.normalize(),Ig.crossVectors(xi,ws),i[0]=ws.x,i[4]=Ig.x,i[8]=xi.x,i[1]=ws.y,i[5]=Ig.y,i[9]=xi.y,i[2]=ws.z,i[6]=Ig.z,i[10]=xi.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const r=e.elements,i=n.elements,o=this.elements,a=r[0],s=r[4],l=r[8],c=r[12],u=r[1],d=r[5],f=r[9],p=r[13],y=r[2],v=r[6],g=r[10],m=r[14],x=r[3],b=r[7],S=r[11],w=r[15],E=i[0],T=i[4],A=i[8],M=i[12],C=i[1],P=i[5],R=i[9],D=i[13],k=i[2],U=i[6],O=i[10],X=i[14],L=i[3],j=i[7],K=i[11],te=i[15];return o[0]=a*E+s*C+l*k+c*L,o[4]=a*T+s*P+l*U+c*j,o[8]=a*A+s*R+l*O+c*K,o[12]=a*M+s*D+l*X+c*te,o[1]=u*E+d*C+f*k+p*L,o[5]=u*T+d*P+f*U+p*j,o[9]=u*A+d*R+f*O+p*K,o[13]=u*M+d*D+f*X+p*te,o[2]=y*E+v*C+g*k+m*L,o[6]=y*T+v*P+g*U+m*j,o[10]=y*A+v*R+g*O+m*K,o[14]=y*M+v*D+g*X+m*te,o[3]=x*E+b*C+S*k+w*L,o[7]=x*T+b*P+S*U+w*j,o[11]=x*A+b*R+S*O+w*K,o[15]=x*M+b*D+S*X+w*te,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[4]*=e,n[8]*=e,n[12]*=e,n[1]*=e,n[5]*=e,n[9]*=e,n[13]*=e,n[2]*=e,n[6]*=e,n[10]*=e,n[14]*=e,n[3]*=e,n[7]*=e,n[11]*=e,n[15]*=e,this}determinant(){const e=this.elements,n=e[0],r=e[4],i=e[8],o=e[12],a=e[1],s=e[5],l=e[9],c=e[13],u=e[2],d=e[6],f=e[10],p=e[14],y=e[3],v=e[7],g=e[11],m=e[15];return y*(+o*l*d-i*c*d-o*s*f+r*c*f+i*s*p-r*l*p)+v*(+n*l*p-n*c*f+o*a*f-i*a*p+i*c*u-o*l*u)+g*(+n*c*d-n*s*p-o*a*d+r*a*p+o*s*u-r*c*u)+m*(-i*s*u-n*l*d+n*s*f+i*a*d-r*a*f+r*l*u)}transpose(){const e=this.elements;let n;return n=e[1],e[1]=e[4],e[4]=n,n=e[2],e[2]=e[8],e[8]=n,n=e[6],e[6]=e[9],e[9]=n,n=e[3],e[3]=e[12],e[12]=n,n=e[7],e[7]=e[13],e[13]=n,n=e[11],e[11]=e[14],e[14]=n,this}setPosition(e,n,r){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=n,i[14]=r),this}invert(){const e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],u=e[8],d=e[9],f=e[10],p=e[11],y=e[12],v=e[13],g=e[14],m=e[15],x=d*g*c-v*f*c+v*l*p-s*g*p-d*l*m+s*f*m,b=y*f*c-u*g*c-y*l*p+a*g*p+u*l*m-a*f*m,S=u*v*c-y*d*c+y*s*p-a*v*p-u*s*m+a*d*m,w=y*d*l-u*v*l-y*s*f+a*v*f+u*s*g-a*d*g,E=n*x+r*b+i*S+o*w;if(E===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const T=1/E;return e[0]=x*T,e[1]=(v*f*o-d*g*o-v*i*p+r*g*p+d*i*m-r*f*m)*T,e[2]=(s*g*o-v*l*o+v*i*c-r*g*c-s*i*m+r*l*m)*T,e[3]=(d*l*o-s*f*o-d*i*c+r*f*c+s*i*p-r*l*p)*T,e[4]=b*T,e[5]=(u*g*o-y*f*o+y*i*p-n*g*p-u*i*m+n*f*m)*T,e[6]=(y*l*o-a*g*o-y*i*c+n*g*c+a*i*m-n*l*m)*T,e[7]=(a*f*o-u*l*o+u*i*c-n*f*c-a*i*p+n*l*p)*T,e[8]=S*T,e[9]=(y*d*o-u*v*o-y*r*p+n*v*p+u*r*m-n*d*m)*T,e[10]=(a*v*o-y*s*o+y*r*c-n*v*c-a*r*m+n*s*m)*T,e[11]=(u*s*o-a*d*o-u*r*c+n*d*c+a*r*p-n*s*p)*T,e[12]=w*T,e[13]=(u*v*i-y*d*i+y*r*f-n*v*f-u*r*g+n*d*g)*T,e[14]=(y*s*i-a*v*i-y*r*l+n*v*l+a*r*g-n*s*g)*T,e[15]=(a*d*i-u*s*i+u*r*l-n*d*l-a*r*f+n*s*f)*T,this}scale(e){const n=this.elements,r=e.x,i=e.y,o=e.z;return n[0]*=r,n[4]*=i,n[8]*=o,n[1]*=r,n[5]*=i,n[9]*=o,n[2]*=r,n[6]*=i,n[10]*=o,n[3]*=r,n[7]*=i,n[11]*=o,this}getMaxScaleOnAxis(){const e=this.elements,n=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(n,r,i))}makeTranslation(e,n,r){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,n,0,0,1,r,0,0,0,1),this}makeRotationX(e){const n=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,n,-r,0,0,r,n,0,0,0,0,1),this}makeRotationY(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,0,r,0,0,1,0,0,-r,0,n,0,0,0,0,1),this}makeRotationZ(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,-r,0,0,r,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,n){const r=Math.cos(n),i=Math.sin(n),o=1-r,a=e.x,s=e.y,l=e.z,c=o*a,u=o*s;return this.set(c*a+r,c*s-i*l,c*l+i*s,0,c*s+i*l,u*s+r,u*l-i*a,0,c*l-i*s,u*l+i*a,o*l*l+r,0,0,0,0,1),this}makeScale(e,n,r){return this.set(e,0,0,0,0,n,0,0,0,0,r,0,0,0,0,1),this}makeShear(e,n,r,i,o,a){return this.set(1,r,o,0,e,1,a,0,n,i,1,0,0,0,0,1),this}compose(e,n,r){const i=this.elements,o=n._x,a=n._y,s=n._z,l=n._w,c=o+o,u=a+a,d=s+s,f=o*c,p=o*u,y=o*d,v=a*u,g=a*d,m=s*d,x=l*c,b=l*u,S=l*d,w=r.x,E=r.y,T=r.z;return i[0]=(1-(v+m))*w,i[1]=(p+S)*w,i[2]=(y-b)*w,i[3]=0,i[4]=(p-S)*E,i[5]=(1-(f+m))*E,i[6]=(g+x)*E,i[7]=0,i[8]=(y+b)*T,i[9]=(g-x)*T,i[10]=(1-(f+v))*T,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,n,r){const i=this.elements;let o=du.set(i[0],i[1],i[2]).length();const a=du.set(i[4],i[5],i[6]).length(),s=du.set(i[8],i[9],i[10]).length();this.determinant()<0&&(o=-o),e.x=i[12],e.y=i[13],e.z=i[14],ho.copy(this);const c=1/o,u=1/a,d=1/s;return ho.elements[0]*=c,ho.elements[1]*=c,ho.elements[2]*=c,ho.elements[4]*=u,ho.elements[5]*=u,ho.elements[6]*=u,ho.elements[8]*=d,ho.elements[9]*=d,ho.elements[10]*=d,n.setFromRotationMatrix(ho),r.x=o,r.y=a,r.z=s,this}makePerspective(e,n,r,i,o,a,s=Xa){const l=this.elements,c=2*o/(n-e),u=2*o/(r-i),d=(n+e)/(n-e),f=(r+i)/(r-i);let p,y;if(s===Xa)p=-(a+o)/(a-o),y=-2*a*o/(a-o);else if(s===Ny)p=-a/(a-o),y=-a*o/(a-o);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+s);return l[0]=c,l[4]=0,l[8]=d,l[12]=0,l[1]=0,l[5]=u,l[9]=f,l[13]=0,l[2]=0,l[6]=0,l[10]=p,l[14]=y,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,n,r,i,o,a,s=Xa){const l=this.elements,c=1/(n-e),u=1/(r-i),d=1/(a-o),f=(n+e)*c,p=(r+i)*u;let y,v;if(s===Xa)y=(a+o)*d,v=-2*d;else if(s===Ny)y=o*d,v=-1*d;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+s);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-f,l[1]=0,l[5]=2*u,l[9]=0,l[13]=-p,l[2]=0,l[6]=0,l[10]=v,l[14]=-y,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const n=this.elements,r=e.elements;for(let i=0;i<16;i++)if(n[i]!==r[i])return!1;return!0}fromArray(e,n=0){for(let r=0;r<16;r++)this.elements[r]=e[r+n];return this}toArray(e=[],n=0){const r=this.elements;return e[n]=r[0],e[n+1]=r[1],e[n+2]=r[2],e[n+3]=r[3],e[n+4]=r[4],e[n+5]=r[5],e[n+6]=r[6],e[n+7]=r[7],e[n+8]=r[8],e[n+9]=r[9],e[n+10]=r[10],e[n+11]=r[11],e[n+12]=r[12],e[n+13]=r[13],e[n+14]=r[14],e[n+15]=r[15],e}}const du=new ne,ho=new gt,dee=new ne(0,0,0),fee=new ne(1,1,1),ws=new ne,Ig=new ne,xi=new ne,ZN=new gt,QN=new Ii;class pi{constructor(e=0,n=0,r=0,i=pi.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=n,this._z=r,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,n,r,i=this._order){return this._x=e,this._y=n,this._z=r,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,n=this._order,r=!0){const i=e.elements,o=i[0],a=i[4],s=i[8],l=i[1],c=i[5],u=i[9],d=i[2],f=i[6],p=i[10];switch(n){case"XYZ":this._y=Math.asin(It(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-u,p),this._z=Math.atan2(-a,o)):(this._x=Math.atan2(f,c),this._z=0);break;case"YXZ":this._x=Math.asin(-It(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(s,p),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-d,o),this._z=0);break;case"ZXY":this._x=Math.asin(It(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-d,p),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,o));break;case"ZYX":this._y=Math.asin(-It(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(f,p),this._z=Math.atan2(l,o)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(It(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-d,o)):(this._x=0,this._y=Math.atan2(s,p));break;case"XZY":this._z=Math.asin(-It(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(f,c),this._y=Math.atan2(s,o)):(this._x=Math.atan2(-u,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,r===!0&&this._onChangeCallback(),this}setFromQuaternion(e,n,r){return ZN.makeRotationFromQuaternion(e),this.setFromRotationMatrix(ZN,n,r)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return QN.setFromEuler(this),this.setFromQuaternion(QN,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}pi.DEFAULT_ORDER="XYZ";class QA{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let n=0;n1){for(let r=0;r0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.geometryInfo=this._geometryInfo.map(s=>({...s,boundingBox:s.boundingBox?s.boundingBox.toJSON():void 0,boundingSphere:s.boundingSphere?s.boundingSphere.toJSON():void 0})),i.instanceInfo=this._instanceInfo.map(s=>({...s})),i.availableInstanceIds=this._availableInstanceIds.slice(),i.availableGeometryIds=this._availableGeometryIds.slice(),i.nextIndexStart=this._nextIndexStart,i.nextVertexStart=this._nextVertexStart,i.geometryCount=this._geometryCount,i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.matricesTexture=this._matricesTexture.toJSON(e),i.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(i.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(i.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(i.boundingBox=this.boundingBox.toJSON()));function o(s,l){return s[l.uuid]===void 0&&(s[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=o(e.geometries,this.geometry);const s=this.geometry.parameters;if(s!==void 0&&s.shapes!==void 0){const l=s.shapes;if(Array.isArray(l))for(let c=0,u=l.length;c0){i.children=[];for(let s=0;s0){i.animations=[];for(let s=0;s0&&(r.geometries=s),l.length>0&&(r.materials=l),c.length>0&&(r.textures=c),u.length>0&&(r.images=u),d.length>0&&(r.shapes=d),f.length>0&&(r.skeletons=f),p.length>0&&(r.animations=p),y.length>0&&(r.nodes=y)}return r.object=i,r;function a(s){const l=[];for(const c in s){const u=s[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,n=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),n===!0)for(let r=0;r0?i.multiplyScalar(1/Math.sqrt(o)):i.set(0,0,0)}static getBarycoord(e,n,r,i,o){po.subVectors(i,n),Oa.subVectors(r,n),nw.subVectors(e,n);const a=po.dot(po),s=po.dot(Oa),l=po.dot(nw),c=Oa.dot(Oa),u=Oa.dot(nw),d=a*c-s*s;if(d===0)return o.set(0,0,0),null;const f=1/d,p=(c*l-s*u)*f,y=(a*u-s*l)*f;return o.set(1-p-y,y,p)}static containsPoint(e,n,r,i){return this.getBarycoord(e,n,r,i,Ia)===null?!1:Ia.x>=0&&Ia.y>=0&&Ia.x+Ia.y<=1}static getInterpolation(e,n,r,i,o,a,s,l){return this.getBarycoord(e,n,r,i,Ia)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(o,Ia.x),l.addScaledVector(a,Ia.y),l.addScaledVector(s,Ia.z),l)}static getInterpolatedAttribute(e,n,r,i,o,a){return aw.setScalar(0),sw.setScalar(0),lw.setScalar(0),aw.fromBufferAttribute(e,n),sw.fromBufferAttribute(e,r),lw.fromBufferAttribute(e,i),a.setScalar(0),a.addScaledVector(aw,o.x),a.addScaledVector(sw,o.y),a.addScaledVector(lw,o.z),a}static isFrontFacing(e,n,r,i){return po.subVectors(r,n),Oa.subVectors(e,n),po.cross(Oa).dot(i)<0}set(e,n,r){return this.a.copy(e),this.b.copy(n),this.c.copy(r),this}setFromPointsAndIndices(e,n,r,i){return this.a.copy(e[n]),this.b.copy(e[r]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,n,r,i){return this.a.fromBufferAttribute(e,n),this.b.fromBufferAttribute(e,r),this.c.fromBufferAttribute(e,i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return po.subVectors(this.c,this.b),Oa.subVectors(this.a,this.b),po.cross(Oa).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return No.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return No.getBarycoord(e,this.a,this.b,this.c,n)}getInterpolation(e,n,r,i,o){return No.getInterpolation(e,this.a,this.b,this.c,n,r,i,o)}containsPoint(e){return No.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return No.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,n){const r=this.a,i=this.b,o=this.c;let a,s;pu.subVectors(i,r),mu.subVectors(o,r),rw.subVectors(e,r);const l=pu.dot(rw),c=mu.dot(rw);if(l<=0&&c<=0)return n.copy(r);iw.subVectors(e,i);const u=pu.dot(iw),d=mu.dot(iw);if(u>=0&&d<=u)return n.copy(i);const f=l*d-u*c;if(f<=0&&l>=0&&u<=0)return a=l/(l-u),n.copy(r).addScaledVector(pu,a);ow.subVectors(e,o);const p=pu.dot(ow),y=mu.dot(ow);if(y>=0&&p<=y)return n.copy(o);const v=p*c-l*y;if(v<=0&&c>=0&&y<=0)return s=c/(c-y),n.copy(r).addScaledVector(mu,s);const g=u*y-p*d;if(g<=0&&d-u>=0&&p-y>=0)return oO.subVectors(o,i),s=(d-u)/(d-u+(p-y)),n.copy(i).addScaledVector(oO,s);const m=1/(g+v+f);return a=v*m,s=f*m,n.copy(r).addScaledVector(pu,a).addScaledVector(mu,s)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const U4={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ss={h:0,s:0,l:0},Lg={h:0,s:0,l:0};function cw(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*6*(2/3-n):t}let ft=class{constructor(e,n,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,n,r)}set(e,n,r){if(n===void 0&&r===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,n,r);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,n=Zt){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Dt.colorSpaceToWorking(this,n),this}setRGB(e,n,r,i=Dt.workingColorSpace){return this.r=e,this.g=n,this.b=r,Dt.colorSpaceToWorking(this,i),this}setHSL(e,n,r,i=Dt.workingColorSpace){if(e=JA(e,1),n=It(n,0,1),r=It(r,0,1),n===0)this.r=this.g=this.b=r;else{const o=r<=.5?r*(1+n):r+n-r*n,a=2*r-o;this.r=cw(a,o,e+1/3),this.g=cw(a,o,e),this.b=cw(a,o,e-1/3)}return Dt.colorSpaceToWorking(this,i),this}setStyle(e,n=Zt){function r(o){o!==void 0&&parseFloat(o)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let o;const a=i[1],s=i[2];switch(a){case"rgb":case"rgba":if(o=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return r(o[4]),this.setRGB(Math.min(255,parseInt(o[1],10))/255,Math.min(255,parseInt(o[2],10))/255,Math.min(255,parseInt(o[3],10))/255,n);if(o=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return r(o[4]),this.setRGB(Math.min(100,parseInt(o[1],10))/100,Math.min(100,parseInt(o[2],10))/100,Math.min(100,parseInt(o[3],10))/100,n);break;case"hsl":case"hsla":if(o=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return r(o[4]),this.setHSL(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,n);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const o=i[1],a=o.length;if(a===3)return this.setRGB(parseInt(o.charAt(0),16)/15,parseInt(o.charAt(1),16)/15,parseInt(o.charAt(2),16)/15,n);if(a===6)return this.setHex(parseInt(o,16),n);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,n);return this}setColorName(e,n=Zt){const r=U4[e.toLowerCase()];return r!==void 0?this.setHex(r,n):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Ja(e.r),this.g=Ja(e.g),this.b=Ja(e.b),this}copyLinearToSRGB(e){return this.r=cd(e.r),this.g=cd(e.g),this.b=cd(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Zt){return Dt.workingToColorSpace(Cr.copy(this),e),Math.round(It(Cr.r*255,0,255))*65536+Math.round(It(Cr.g*255,0,255))*256+Math.round(It(Cr.b*255,0,255))}getHexString(e=Zt){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=Dt.workingColorSpace){Dt.workingToColorSpace(Cr.copy(this),n);const r=Cr.r,i=Cr.g,o=Cr.b,a=Math.max(r,i,o),s=Math.min(r,i,o);let l,c;const u=(s+a)/2;if(s===a)l=0,c=0;else{const d=a-s;switch(c=u<=.5?d/(a+s):d/(2-a-s),a){case r:l=(i-o)/d+(i0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const n in e){const r=e[n];if(r===void 0){console.warn(`THREE.Material: parameter '${n}' has value of undefined.`);continue}const i=this[n];if(i===void 0){console.warn(`THREE.Material: '${n}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(r):i&&i.isVector3&&r&&r.isVector3?i.copy(r):this[n]=r}}toJSON(e){const n=e===void 0||typeof e=="string";n&&(e={textures:{},images:{}});const r={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),this.roughness!==void 0&&(r.roughness=this.roughness),this.metalness!==void 0&&(r.metalness=this.metalness),this.sheen!==void 0&&(r.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(r.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(r.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(r.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(r.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(r.shininess=this.shininess),this.clearcoat!==void 0&&(r.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(r.dispersion=this.dispersion),this.iridescence!==void 0&&(r.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(r.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(r.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(r.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(r.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(r.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(r.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(e).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(e).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(e).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(e).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(e).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(r.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(r.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(r.combine=this.combine)),this.envMapRotation!==void 0&&(r.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(r.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(r.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(r.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(r.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(r.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(r.size=this.size),this.shadowSide!==null&&(r.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(r.sizeAttenuation=this.sizeAttenuation),this.blending!==sd&&(r.blending=this.blending),this.side!==ba&&(r.side=this.side),this.vertexColors===!0&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),this.transparent===!0&&(r.transparent=!0),this.blendSrc!==RE&&(r.blendSrc=this.blendSrc),this.blendDst!==NE&&(r.blendDst=this.blendDst),this.blendEquation!==ql&&(r.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(r.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(r.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(r.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(r.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(r.blendAlpha=this.blendAlpha),this.depthFunc!==jd&&(r.depthFunc=this.depthFunc),this.depthTest===!1&&(r.depthTest=this.depthTest),this.depthWrite===!1&&(r.depthWrite=this.depthWrite),this.colorWrite===!1&&(r.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(r.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==GN&&(r.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(r.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(r.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==au&&(r.stencilFail=this.stencilFail),this.stencilZFail!==au&&(r.stencilZFail=this.stencilZFail),this.stencilZPass!==au&&(r.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(r.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(r.rotation=this.rotation),this.polygonOffset===!0&&(r.polygonOffset=!0),this.polygonOffsetFactor!==0&&(r.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(r.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(r.linewidth=this.linewidth),this.dashSize!==void 0&&(r.dashSize=this.dashSize),this.gapSize!==void 0&&(r.gapSize=this.gapSize),this.scale!==void 0&&(r.scale=this.scale),this.dithering===!0&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),this.alphaHash===!0&&(r.alphaHash=!0),this.alphaToCoverage===!0&&(r.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(r.premultipliedAlpha=!0),this.forceSinglePass===!0&&(r.forceSinglePass=!0),this.wireframe===!0&&(r.wireframe=!0),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(r.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(r.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(r.flatShading=!0),this.visible===!1&&(r.visible=!1),this.toneMapped===!1&&(r.toneMapped=!1),this.fog===!1&&(r.fog=!1),Object.keys(this.userData).length>0&&(r.userData=this.userData);function i(o){const a=[];for(const s in o){const l=o[s];delete l.metadata,a.push(l)}return a}if(n){const o=i(e.textures),a=i(e.images);o.length>0&&(r.textures=o),a.length>0&&(r.images=a)}return r}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const n=e.clippingPlanes;let r=null;if(n!==null){const i=n.length;r=new Array(i);for(let o=0;o!==i;++o)r[o]=n[o].clone()}return this.clippingPlanes=r,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class ua extends qr{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new ft(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new pi,this.combine=kx,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Fn=new ne,kg=new xt;let yee=0;class cr{constructor(e,n,r=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:yee++}),this.name="",this.array=e,this.itemSize=n,this.count=e!==void 0?e.length/n:0,this.normalized=r,this.usage=p1,this.updateRanges=[],this.gpuType=Do,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,n,r){e*=this.itemSize,r*=n.itemSize;for(let i=0,o=this.itemSize;in.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),n.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Xo);const e=this.attributes.position,n=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new ne(-1/0,-1/0,-1/0),new ne(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),n)for(let r=0,i=n.length;r0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const n=this.index;n!==null&&(e.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});const r=this.attributes;for(const l in r){const c=r[l];e.data.attributes[l]=c.toJSON(e.data)}const i={};let o=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let d=0,f=c.length;d0&&(i[l]=u,o=!0)}o&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const s=this.boundingSphere;return s!==null&&(e.data.boundingSphere=s.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const n={};this.name=e.name;const r=e.index;r!==null&&this.setIndex(r.clone());const i=e.attributes;for(const c in i){const u=i[c];this.setAttribute(c,u.clone(n))}const o=e.morphAttributes;for(const c in o){const u=[],d=o[c];for(let f=0,p=d.length;f0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,a=i.length;o(e.far-e.near)**2))&&(aO.copy(o).invert(),Ll.copy(e.ray).applyMatrix4(aO),!(r.boundingBox!==null&&Ll.intersectsBox(r.boundingBox)===!1)&&this._computeIntersections(e,n,Ll)))}_computeIntersections(e,n,r){let i;const o=this.geometry,a=this.material,s=o.index,l=o.attributes.position,c=o.attributes.uv,u=o.attributes.uv1,d=o.attributes.normal,f=o.groups,p=o.drawRange;if(s!==null)if(Array.isArray(a))for(let y=0,v=f.length;yn.far?null:{distance:c,point:zg.clone(),object:t}}function Hg(t,e,n,r,i,o,a,s,l,c){t.getVertexPosition(s,Ug),t.getVertexPosition(l,Fg),t.getVertexPosition(c,Bg);const u=bee(t,e,n,r,Ug,Fg,Bg,lO);if(u){const d=new ne;No.getBarycoord(lO,Ug,Fg,Bg,d),i&&(u.uv=No.getInterpolatedAttribute(i,s,l,c,d,new xt)),o&&(u.uv1=No.getInterpolatedAttribute(o,s,l,c,d,new xt)),a&&(u.normal=No.getInterpolatedAttribute(a,s,l,c,d,new ne),u.normal.dot(r.direction)>0&&u.normal.multiplyScalar(-1));const f={a:s,b:l,c,normal:new ne,materialIndex:0};No.getNormal(Ug,Fg,Bg,f.normal),u.face=f,u.barycoord=d}return u}class Gc extends br{constructor(e=1,n=1,r=1,i=1,o=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:n,depth:r,widthSegments:i,heightSegments:o,depthSegments:a};const s=this;i=Math.floor(i),o=Math.floor(o),a=Math.floor(a);const l=[],c=[],u=[],d=[];let f=0,p=0;y("z","y","x",-1,-1,r,n,e,a,o,0),y("z","y","x",1,-1,r,n,-e,a,o,1),y("x","z","y",1,1,e,r,n,i,a,2),y("x","z","y",1,-1,e,r,-n,i,a,3),y("x","y","z",1,-1,e,n,r,i,o,4),y("x","y","z",-1,-1,e,n,-r,i,o,5),this.setIndex(l),this.setAttribute("position",new Qt(c,3)),this.setAttribute("normal",new Qt(u,3)),this.setAttribute("uv",new Qt(d,2));function y(v,g,m,x,b,S,w,E,T,A,M){const C=S/T,P=w/A,R=S/2,D=w/2,k=E/2,U=T+1,O=A+1;let X=0,L=0;const j=new ne;for(let K=0;K0?1:-1,u.push(j.x,j.y,j.z),d.push(H/T),d.push(1-K/A),X+=1}}for(let K=0;K0&&(n.defines=this.defines),n.vertexShader=this.vertexShader,n.fragmentShader=this.fragmentShader,n.lights=this.lights,n.clipping=this.clipping;const r={};for(const i in this.extensions)this.extensions[i]===!0&&(r[i]=!0);return Object.keys(r).length>0&&(n.extensions=r),n}}class B4 extends vn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new gt,this.projectionMatrix=new gt,this.projectionMatrixInverse=new gt,this.coordinateSystem=Xa}copy(e,n){return super.copy(e,n),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,n){super.updateWorldMatrix(e,n),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const Es=new ne,lO=new xt,cO=new xt;class gr extends B4{constructor(e=50,n=1,r=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=r,this.far=i,this.focus=10,this.aspect=n,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const n=.5*this.getFilmHeight()/e;this.fov=Bd*2*Math.atan(n),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Wh*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Bd*2*Math.atan(Math.tan(Wh*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,n,r){Es.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(Es.x,Es.y).multiplyScalar(-e/Es.z),Es.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),r.set(Es.x,Es.y).multiplyScalar(-e/Es.z)}getViewSize(e,n){return this.getViewBounds(e,lO,cO),n.subVectors(cO,lO)}setViewOffset(e,n,r,i,o,a){this.aspect=e/n,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let n=e*Math.tan(Wh*.5*this.fov)/this.zoom,r=2*n,i=this.aspect*r,o=-.5*i;const a=this.view;if(this.view!==null&&this.view.enabled){const l=a.fullWidth,c=a.fullHeight;o+=a.offsetX*i/l,n-=a.offsetY*r/c,i*=a.width/l,r*=a.height/c}const s=this.filmOffset;s!==0&&(o+=e*s/this.getFilmWidth()),this.projectionMatrix.makePerspective(o,o+i,n,n-r,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.fov=this.fov,n.object.zoom=this.zoom,n.object.near=this.near,n.object.far=this.far,n.object.focus=this.focus,n.object.aspect=this.aspect,this.view!==null&&(n.object.view=Object.assign({},this.view)),n.object.filmGauge=this.filmGauge,n.object.filmOffset=this.filmOffset,n}}const vu=-90,yu=1;class See extends vn{constructor(e,n,r){super(),this.type="CubeCamera",this.renderTarget=r,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new gr(vu,yu,e,n);i.layers=this.layers,this.add(i);const o=new gr(vu,yu,e,n);o.layers=this.layers,this.add(o);const a=new gr(vu,yu,e,n);a.layers=this.layers,this.add(a);const s=new gr(vu,yu,e,n);s.layers=this.layers,this.add(s);const l=new gr(vu,yu,e,n);l.layers=this.layers,this.add(l);const c=new gr(vu,yu,e,n);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,n=this.children.concat(),[r,i,o,a,s,l]=n;for(const c of n)this.remove(c);if(e===Xa)r.up.set(0,1,0),r.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),o.up.set(0,0,-1),o.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),s.up.set(0,1,0),s.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===Ny)r.up.set(0,-1,0),r.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),o.up.set(0,0,1),o.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),s.up.set(0,-1,0),s.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const c of n)this.add(c),c.updateMatrixWorld()}update(e,n){this.parent===null&&this.updateMatrixWorld();const{renderTarget:r,activeMipmapLevel:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[o,a,s,l,c,u]=this.children,d=e.getRenderTarget(),f=e.getActiveCubeFace(),p=e.getActiveMipmapLevel(),y=e.xr.enabled;e.xr.enabled=!1;const v=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,e.setRenderTarget(r,0,i),e.render(n,o),e.setRenderTarget(r,1,i),e.render(n,a),e.setRenderTarget(r,2,i),e.render(n,s),e.setRenderTarget(r,3,i),e.render(n,l),e.setRenderTarget(r,4,i),e.render(n,c),r.texture.generateMipmaps=v,e.setRenderTarget(r,5,i),e.render(n,u),e.setRenderTarget(d,f,p),e.xr.enabled=y,r.texture.needsPMREMUpdate=!0}}class $4 extends lr{constructor(e=[],n=Ud,r,i,o,a,s,l,c,u){super(e,n,r,i,o,a,s,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class Eee extends Oc{constructor(e=1,n={}){super(e,e,n),this.isWebGLCubeRenderTarget=!0;const r={width:e,height:e,depth:1},i=[r,r,r,r,r,r];this.texture=new $4(i),this._setTextureOptions(n),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(e,n){this.texture.type=n.type,this.texture.colorSpace=n.colorSpace,this.texture.generateMipmaps=n.generateMipmaps,this.texture.minFilter=n.minFilter,this.texture.magFilter=n.magFilter;const r={uniforms:{tEquirect:{value:null}},vertexShader:` +}`;class hl extends qr{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=See,this.fragmentShader=Eee,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=$d(e.uniforms),this.uniformsGroups=_ee(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const n=super.toJSON(e);n.glslVersion=this.glslVersion,n.uniforms={};for(const i in this.uniforms){const a=this.uniforms[i].value;a&&a.isTexture?n.uniforms[i]={type:"t",value:a.toJSON(e).uuid}:a&&a.isColor?n.uniforms[i]={type:"c",value:a.getHex()}:a&&a.isVector2?n.uniforms[i]={type:"v2",value:a.toArray()}:a&&a.isVector3?n.uniforms[i]={type:"v3",value:a.toArray()}:a&&a.isVector4?n.uniforms[i]={type:"v4",value:a.toArray()}:a&&a.isMatrix3?n.uniforms[i]={type:"m3",value:a.toArray()}:a&&a.isMatrix4?n.uniforms[i]={type:"m4",value:a.toArray()}:n.uniforms[i]={value:a}}Object.keys(this.defines).length>0&&(n.defines=this.defines),n.vertexShader=this.vertexShader,n.fragmentShader=this.fragmentShader,n.lights=this.lights,n.clipping=this.clipping;const r={};for(const i in this.extensions)this.extensions[i]===!0&&(r[i]=!0);return Object.keys(r).length>0&&(n.extensions=r),n}}class z4 extends vn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new gt,this.projectionMatrix=new gt,this.projectionMatrixInverse=new gt,this.coordinateSystem=Xa}copy(e,n){return super.copy(e,n),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,n){super.updateWorldMatrix(e,n),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const Es=new ne,cO=new xt,uO=new xt;class gr extends z4{constructor(e=50,n=1,r=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=r,this.far=i,this.focus=10,this.aspect=n,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const n=.5*this.getFilmHeight()/e;this.fov=Bd*2*Math.atan(n),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Wh*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Bd*2*Math.atan(Math.tan(Wh*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,n,r){Es.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(Es.x,Es.y).multiplyScalar(-e/Es.z),Es.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),r.set(Es.x,Es.y).multiplyScalar(-e/Es.z)}getViewSize(e,n){return this.getViewBounds(e,cO,uO),n.subVectors(uO,cO)}setViewOffset(e,n,r,i,o,a){this.aspect=e/n,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let n=e*Math.tan(Wh*.5*this.fov)/this.zoom,r=2*n,i=this.aspect*r,o=-.5*i;const a=this.view;if(this.view!==null&&this.view.enabled){const l=a.fullWidth,c=a.fullHeight;o+=a.offsetX*i/l,n-=a.offsetY*r/c,i*=a.width/l,r*=a.height/c}const s=this.filmOffset;s!==0&&(o+=e*s/this.getFilmWidth()),this.projectionMatrix.makePerspective(o,o+i,n,n-r,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.fov=this.fov,n.object.zoom=this.zoom,n.object.near=this.near,n.object.far=this.far,n.object.focus=this.focus,n.object.aspect=this.aspect,this.view!==null&&(n.object.view=Object.assign({},this.view)),n.object.filmGauge=this.filmGauge,n.object.filmOffset=this.filmOffset,n}}const vu=-90,yu=1;class Tee extends vn{constructor(e,n,r){super(),this.type="CubeCamera",this.renderTarget=r,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new gr(vu,yu,e,n);i.layers=this.layers,this.add(i);const o=new gr(vu,yu,e,n);o.layers=this.layers,this.add(o);const a=new gr(vu,yu,e,n);a.layers=this.layers,this.add(a);const s=new gr(vu,yu,e,n);s.layers=this.layers,this.add(s);const l=new gr(vu,yu,e,n);l.layers=this.layers,this.add(l);const c=new gr(vu,yu,e,n);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,n=this.children.concat(),[r,i,o,a,s,l]=n;for(const c of n)this.remove(c);if(e===Xa)r.up.set(0,1,0),r.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),o.up.set(0,0,-1),o.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),s.up.set(0,1,0),s.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===Ny)r.up.set(0,-1,0),r.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),o.up.set(0,0,1),o.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),s.up.set(0,-1,0),s.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const c of n)this.add(c),c.updateMatrixWorld()}update(e,n){this.parent===null&&this.updateMatrixWorld();const{renderTarget:r,activeMipmapLevel:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[o,a,s,l,c,u]=this.children,d=e.getRenderTarget(),f=e.getActiveCubeFace(),p=e.getActiveMipmapLevel(),y=e.xr.enabled;e.xr.enabled=!1;const v=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,e.setRenderTarget(r,0,i),e.render(n,o),e.setRenderTarget(r,1,i),e.render(n,a),e.setRenderTarget(r,2,i),e.render(n,s),e.setRenderTarget(r,3,i),e.render(n,l),e.setRenderTarget(r,4,i),e.render(n,c),r.texture.generateMipmaps=v,e.setRenderTarget(r,5,i),e.render(n,u),e.setRenderTarget(d,f,p),e.xr.enabled=y,r.texture.needsPMREMUpdate=!0}}class H4 extends lr{constructor(e=[],n=Ud,r,i,o,a,s,l,c,u){super(e,n,r,i,o,a,s,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class Mee extends Oc{constructor(e=1,n={}){super(e,e,n),this.isWebGLCubeRenderTarget=!0;const r={width:e,height:e,depth:1},i=[r,r,r,r,r,r];this.texture=new H4(i),this._setTextureOptions(n),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(e,n){this.texture.type=n.type,this.texture.colorSpace=n.colorSpace,this.texture.generateMipmaps=n.generateMipmaps,this.texture.minFilter=n.minFilter,this.texture.magFilter=n.magFilter;const r={uniforms:{tEquirect:{value:null}},vertexShader:` varying vec3 vWorldDirection; @@ -392,13 +397,13 @@ For more information, see https://radix-ui.com/primitives/docs/components/${e.do gl_FragColor = texture2D( tEquirect, sampleUV ); } - `},i=new Gc(5,5,5),o=new hl({name:"CubemapFromEquirect",uniforms:$d(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:ui,blending:tl});o.uniforms.tEquirect.value=n;const a=new Tn(i,o),s=n.minFilter;return n.minFilter===Oo&&(n.minFilter=Or),new See(1,10,this).update(e,a),n.minFilter=s,a.geometry.dispose(),a.material.dispose(),this}clear(e,n=!0,r=!0,i=!0){const o=e.getRenderTarget();for(let a=0;a<6;a++)e.setRenderTarget(this,a),e.clear(n,r,i);e.setRenderTarget(o)}}let da=class extends vn{constructor(){super(),this.isGroup=!0,this.type="Group"}};const Tee={type:"move"};class fw{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new da,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new da,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new ne,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new ne),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new da,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new ne,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new ne),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const n=this._hand;if(n)for(const r of e.hand.values())this._getHandJoint(n,r)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,n,r){let i=null,o=null,a=null;const s=this._targetRay,l=this._grip,c=this._hand;if(e&&n.session.visibilityState!=="visible-blurred"){if(c&&e.hand){a=!0;for(const v of e.hand.values()){const g=n.getJointPose(v,r),m=this._getHandJoint(c,v);g!==null&&(m.matrix.fromArray(g.transform.matrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.matrixWorldNeedsUpdate=!0,m.jointRadius=g.radius),m.visible=g!==null}const u=c.joints["index-finger-tip"],d=c.joints["thumb-tip"],f=u.position.distanceTo(d.position),p=.02,y=.005;c.inputState.pinching&&f>p+y?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&f<=p-y&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(o=n.getPose(e.gripSpace,r),o!==null&&(l.matrix.fromArray(o.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,o.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(o.linearVelocity)):l.hasLinearVelocity=!1,o.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(o.angularVelocity)):l.hasAngularVelocity=!1));s!==null&&(i=n.getPose(e.targetRaySpace,r),i===null&&o!==null&&(i=o),i!==null&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(Tee)))}return s!==null&&(s.visible=i!==null),l!==null&&(l.visible=o!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(e,n){if(e.joints[n.jointName]===void 0){const r=new da;r.matrixAutoUpdate=!1,r.visible=!1,e.joints[n.jointName]=r,e.add(r)}return e.joints[n.jointName]}}class z4 extends vn{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new pi,this.environmentIntensity=1,this.environmentRotation=new pi,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,n){return super.copy(e,n),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const n=super.toJSON(e);return this.fog!==null&&(n.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(n.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(n.object.backgroundIntensity=this.backgroundIntensity),n.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(n.object.environmentIntensity=this.environmentIntensity),n.object.environmentRotation=this.environmentRotation.toArray(),n}}class Mee{constructor(e,n){this.isInterleavedBuffer=!0,this.array=e,this.stride=n,this.count=e!==void 0?e.length/n:0,this.usage=p1,this.updateRanges=[],this.version=0,this.uuid=Uo()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,n,r){e*=this.stride,r*=n.stride;for(let i=0,o=this.stride;i1?null:n.copy(e.start).addScaledVector(r,o)}intersectsLine(e){const n=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return n<0&&r>0||r<0&&n>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,n){const r=n||Oee.getNormalMatrix(e),i=this.coplanarPoint(mw).applyMatrix4(e),o=this.normal.applyMatrix3(r).normalize();return this.constant=-i.dot(o),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const kl=new Xo,Wg=new ne;class nC{constructor(e=new $a,n=new $a,r=new $a,i=new $a,o=new $a,a=new $a){this.planes=[e,n,r,i,o,a]}set(e,n,r,i,o,a){const s=this.planes;return s[0].copy(e),s[1].copy(n),s[2].copy(r),s[3].copy(i),s[4].copy(o),s[5].copy(a),this}copy(e){const n=this.planes;for(let r=0;r<6;r++)n[r].copy(e.planes[r]);return this}setFromProjectionMatrix(e,n=Xa){const r=this.planes,i=e.elements,o=i[0],a=i[1],s=i[2],l=i[3],c=i[4],u=i[5],d=i[6],f=i[7],p=i[8],y=i[9],v=i[10],g=i[11],m=i[12],x=i[13],b=i[14],S=i[15];if(r[0].setComponents(l-o,f-c,g-p,S-m).normalize(),r[1].setComponents(l+o,f+c,g+p,S+m).normalize(),r[2].setComponents(l+a,f+u,g+y,S+x).normalize(),r[3].setComponents(l-a,f-u,g-y,S-x).normalize(),r[4].setComponents(l-s,f-d,g-v,S-b).normalize(),n===Xa)r[5].setComponents(l+s,f+d,g+v,S+b).normalize();else if(n===Ny)r[5].setComponents(s,d,v,b).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+n);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),kl.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const n=e.geometry;n.boundingSphere===null&&n.computeBoundingSphere(),kl.copy(n.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(kl)}intersectsSprite(e){return kl.center.set(0,0,0),kl.radius=.7071067811865476,kl.applyMatrix4(e.matrixWorld),this.intersectsSphere(kl)}intersectsSphere(e){const n=this.planes,r=e.center,i=-e.radius;for(let o=0;o<6;o++)if(n[o].distanceToPoint(r)0?e.max.x:e.min.x,Wg.y=i.normal.y>0?e.max.y:e.min.y,Wg.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Wg)<0)return!1}return!0}containsPoint(e){const n=this.planes;for(let r=0;r<6;r++)if(n[r].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class pc extends qr{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new ft(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const Oy=new ne,Iy=new ne,yO=new gt,lh=new Sf,Xg=new Xo,gw=new ne,xO=new ne;let Bx=class extends vn{constructor(e=new br,n=new pc){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=n,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,n){return super.copy(e,n),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const n=e.attributes.position,r=[0];for(let i=1,o=n.count;i0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,a=i.length;or)return;gw.applyMatrix4(t.matrixWorld);const c=e.ray.origin.distanceTo(gw);if(!(ce.far))return{distance:c,point:xO.clone().applyMatrix4(t.matrixWorld),index:a,face:null,faceIndex:null,barycoord:null,object:t}}const bO=new ne,_O=new ne;class Dy extends Bx{constructor(e,n){super(e,n),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const n=e.attributes.position,r=[];for(let i=0,o=n.count;i0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,a=i.length;oi.far)return;o.push({distance:c,distanceToRay:Math.sqrt(s),point:l,index:e,face:null,faceIndex:null,barycoord:null,object:a})}}class V4 extends lr{constructor(e,n,r=Nc,i,o,a,s=Xr,l=Xr,c,u=Mp,d=1){if(u!==Mp&&u!==Ap)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const f={width:e,height:n,depth:d};super(f,i,o,a,s,l,u,r,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new JA(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const n=super.toJSON(e);return this.compareFunction!==null&&(n.compareFunction=this.compareFunction),n}}class rC extends br{constructor(e=1,n=1,r=1,i=32,o=1,a=!1,s=0,l=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:n,height:r,radialSegments:i,heightSegments:o,openEnded:a,thetaStart:s,thetaLength:l};const c=this;i=Math.floor(i),o=Math.floor(o);const u=[],d=[],f=[],p=[];let y=0;const v=[],g=r/2;let m=0;x(),a===!1&&(e>0&&b(!0),n>0&&b(!1)),this.setIndex(u),this.setAttribute("position",new Qt(d,3)),this.setAttribute("normal",new Qt(f,3)),this.setAttribute("uv",new Qt(p,2));function x(){const S=new ne,w=new ne;let E=0;const T=(n-e)/r;for(let A=0;A<=o;A++){const M=[],C=A/o,P=C*(n-e)+e;for(let R=0;R<=i;R++){const D=R/i,k=D*l+s,U=Math.sin(k),O=Math.cos(k);w.x=P*U,w.y=-C*r+g,w.z=P*O,d.push(w.x,w.y,w.z),S.set(U,T,O).normalize(),f.push(S.x,S.y,S.z),p.push(D,1-C),M.push(y++)}v.push(M)}for(let A=0;A0||M!==0)&&(u.push(C,P,D),E+=3),(n>0||M!==o-1)&&(u.push(P,R,D),E+=3)}c.addGroup(m,E,0),m+=E}function b(S){const w=y,E=new xt,T=new ne;let A=0;const M=S===!0?e:n,C=S===!0?1:-1;for(let R=1;R<=i;R++)d.push(0,g*C,0),f.push(0,C,0),p.push(.5,.5),y++;const P=y;for(let R=0;R<=i;R++){const k=R/i*l+s,U=Math.cos(k),O=Math.sin(k);T.x=M*O,T.y=g*C,T.z=M*U,d.push(T.x,T.y,T.z),f.push(0,C,0),E.x=U*.5+.5,E.y=O*.5*C+.5,p.push(E.x,E.y),y++}for(let R=0;R0)&&p.push(b,S,E),(m!==r-1||l0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class Fo extends qr{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new ft(16777215),this.specular=new ft(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ft(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ux,this.normalScale=new xt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new pi,this.combine=kx,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Lee extends qr{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new ft(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ft(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ux,this.normalScale=new xt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new pi,this.combine=kx,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class kee extends qr{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=MQ,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class jee extends qr{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}function Jg(t,e){return!t||t.constructor===e?t:typeof e.BYTES_PER_ELEMENT=="number"?new e(t):Array.prototype.slice.call(t)}function Uee(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Fee(t){function e(i,o){return t[i]-t[o]}const n=t.length,r=new Array(n);for(let i=0;i!==n;++i)r[i]=i;return r.sort(e),r}function EO(t,e,n){const r=t.length,i=new t.constructor(r);for(let o=0,a=0;a!==r;++o){const s=n[o]*e;for(let l=0;l!==e;++l)i[a++]=t[s+l]}return i}function G4(t,e,n,r){let i=1,o=t[0];for(;o!==void 0&&o[r]===void 0;)o=t[i++];if(o===void 0)return;let a=o[r];if(a!==void 0)if(Array.isArray(a))do a=o[r],a!==void 0&&(e.push(o.time),n.push(...a)),o=t[i++];while(o!==void 0);else if(a.toArray!==void 0)do a=o[r],a!==void 0&&(e.push(o.time),a.toArray(n,n.length)),o=t[i++];while(o!==void 0);else do a=o[r],a!==void 0&&(e.push(o.time),n.push(a)),o=t[i++];while(o!==void 0)}class Dm{constructor(e,n,r,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new n.constructor(r),this.sampleValues=n,this.valueSize=r,this.settings=null,this.DefaultSettings_={}}evaluate(e){const n=this.parameterPositions;let r=this._cachedIndex,i=n[r],o=n[r-1];e:{t:{let a;n:{r:if(!(e=o)){const s=n[1];e=o)break t}a=r,r=0;break n}break e}for(;r>>1;en;)--a;if(++a,o!==0||a!==i){o>=a&&(a=Math.max(a,1),o=a-1);const s=this.getValueSize();this.times=r.slice(o,a),this.values=this.values.slice(o*s,a*s)}return this}validate(){let e=!0;const n=this.getValueSize();n-Math.floor(n)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const r=this.times,i=this.values,o=r.length;o===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let a=null;for(let s=0;s!==o;s++){const l=r[s];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,s,l),e=!1;break}if(a!==null&&a>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,s,l,a),e=!1;break}a=l}if(i!==void 0&&Uee(i))for(let s=0,l=i.length;s!==l;++s){const c=i[s];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,s,c),e=!1;break}}return e}optimize(){const e=this.times.slice(),n=this.values.slice(),r=this.getValueSize(),i=this.getInterpolation()===G_,o=e.length-1;let a=1;for(let s=1;s0){e[a]=e[o];for(let s=o*r,l=a*r,c=0;c!==r;++c)n[l+c]=n[s+c];++a}return a!==e.length?(this.times=e.slice(0,a),this.values=n.slice(0,a*r)):(this.times=e,this.values=n),this}clone(){const e=this.times.slice(),n=this.values.slice(),r=this.constructor,i=new r(this.name,e,n);return i.createInterpolant=this.createInterpolant,i}}qo.prototype.ValueTypeName="";qo.prototype.TimeBufferType=Float32Array;qo.prototype.ValueBufferType=Float32Array;qo.prototype.DefaultInterpolation=Pp;class Ef extends qo{constructor(e,n,r){super(e,n,r)}}Ef.prototype.ValueTypeName="bool";Ef.prototype.ValueBufferType=Array;Ef.prototype.DefaultInterpolation=Cp;Ef.prototype.InterpolantFactoryMethodLinear=void 0;Ef.prototype.InterpolantFactoryMethodSmooth=void 0;class W4 extends qo{constructor(e,n,r,i){super(e,n,r,i)}}W4.prototype.ValueTypeName="color";class zd extends qo{constructor(e,n,r,i){super(e,n,r,i)}}zd.prototype.ValueTypeName="number";class Hee extends Dm{constructor(e,n,r,i){super(e,n,r,i)}interpolate_(e,n,r,i){const o=this.resultBuffer,a=this.sampleValues,s=this.valueSize,l=(r-n)/(i-n);let c=e*s;for(let u=c+s;c!==u;c+=4)Ii.slerpFlat(o,0,a,c-s,a,c,l);return o}}class Ic extends qo{constructor(e,n,r,i){super(e,n,r,i)}InterpolantFactoryMethodLinear(e){return new Hee(this.times,this.values,this.getValueSize(),e)}}Ic.prototype.ValueTypeName="quaternion";Ic.prototype.InterpolantFactoryMethodSmooth=void 0;class Tf extends qo{constructor(e,n,r){super(e,n,r)}}Tf.prototype.ValueTypeName="string";Tf.prototype.ValueBufferType=Array;Tf.prototype.DefaultInterpolation=Cp;Tf.prototype.InterpolantFactoryMethodLinear=void 0;Tf.prototype.InterpolantFactoryMethodSmooth=void 0;class pl extends qo{constructor(e,n,r,i){super(e,n,r,i)}}pl.prototype.ValueTypeName="vector";class v1{constructor(e="",n=-1,r=[],i=EQ){this.name=e,this.tracks=r,this.duration=n,this.blendMode=i,this.uuid=Uo(),this.duration<0&&this.resetDuration()}static parse(e){const n=[],r=e.tracks,i=1/(e.fps||1);for(let a=0,s=r.length;a!==s;++a)n.push(Gee(r[a]).scale(i));const o=new this(e.name,e.duration,n,e.blendMode);return o.uuid=e.uuid,o}static toJSON(e){const n=[],r=e.tracks,i={name:e.name,duration:e.duration,tracks:n,uuid:e.uuid,blendMode:e.blendMode};for(let o=0,a=r.length;o!==a;++o)n.push(qo.toJSON(r[o]));return i}static CreateFromMorphTargetSequence(e,n,r,i){const o=n.length,a=[];for(let s=0;s1){const d=u[1];let f=i[d];f||(i[d]=f=[]),f.push(c)}}const a=[];for(const s in i)a.push(this.CreateFromMorphTargetSequence(s,i[s],n,r));return a}static parseAnimation(e,n){if(console.warn("THREE.AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const r=function(d,f,p,y,v){if(p.length!==0){const g=[],m=[];G4(p,g,m,y),g.length!==0&&v.push(new d(f,g,m))}},i=[],o=e.name||"default",a=e.fps||30,s=e.blendMode;let l=e.length||-1;const c=e.hierarchy||[];for(let d=0;d{n&&n(o),this.manager.itemEnd(e)},0),o;if(Da[e]!==void 0){Da[e].push({onLoad:n,onProgress:r,onError:i});return}Da[e]=[],Da[e].push({onLoad:n,onProgress:r,onError:i});const a=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),s=this.mimeType,l=this.responseType;fetch(a).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const u=Da[e],d=c.body.getReader(),f=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),p=f?parseInt(f):0,y=p!==0;let v=0;const g=new ReadableStream({start(m){x();function x(){d.read().then(({done:b,value:S})=>{if(b)m.close();else{v+=S.byteLength;const w=new ProgressEvent("progress",{lengthComputable:y,loaded:v,total:p});for(let E=0,T=u.length;E{m.error(b)})}}});return new Response(g)}else throw new Wee(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`,c)}).then(c=>{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(u=>new DOMParser().parseFromString(u,s));case"json":return c.json();default:if(s==="")return c.text();{const d=/charset="?([^;"\s]*)"?/i.exec(s),f=d&&d[1]?d[1].toLowerCase():void 0,p=new TextDecoder(f);return c.arrayBuffer().then(y=>p.decode(y))}}}).then(c=>{Hs.add(e,c);const u=Da[e];delete Da[e];for(let d=0,f=u.length;d{const u=Da[e];if(u===void 0)throw this.manager.itemError(e),c;delete Da[e];for(let d=0,f=u.length;d{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class Xee extends Vo{constructor(e){super(e)}load(e,n,r,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,a=Hs.get(e);if(a!==void 0)return o.manager.itemStart(e),setTimeout(function(){n&&n(a),o.manager.itemEnd(e)},0),a;const s=Rp("img");function l(){u(),Hs.add(e,this),n&&n(this),o.manager.itemEnd(e)}function c(d){u(),i&&i(d),o.manager.itemError(e),o.manager.itemEnd(e)}function u(){s.removeEventListener("load",l,!1),s.removeEventListener("error",c,!1)}return s.addEventListener("load",l,!1),s.addEventListener("error",c,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(s.crossOrigin=this.crossOrigin),o.manager.itemStart(e),s.src=e,s}}class qee extends Vo{constructor(e){super(e)}load(e,n,r,i){const o=this,a=new tC,s=new Mf(this.manager);return s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setPath(this.path),s.setWithCredentials(o.withCredentials),s.load(e,function(l){let c;try{c=o.parse(l)}catch(u){if(i!==void 0)i(u);else{console.error(u);return}}c.image!==void 0?a.image=c.image:c.data!==void 0&&(a.image.width=c.width,a.image.height=c.height,a.image.data=c.data),a.wrapS=c.wrapS!==void 0?c.wrapS:Ji,a.wrapT=c.wrapT!==void 0?c.wrapT:Ji,a.magFilter=c.magFilter!==void 0?c.magFilter:Or,a.minFilter=c.minFilter!==void 0?c.minFilter:Or,a.anisotropy=c.anisotropy!==void 0?c.anisotropy:1,c.colorSpace!==void 0&&(a.colorSpace=c.colorSpace),c.flipY!==void 0&&(a.flipY=c.flipY),c.format!==void 0&&(a.format=c.format),c.type!==void 0&&(a.type=c.type),c.mipmaps!==void 0&&(a.mipmaps=c.mipmaps,a.minFilter=Oo),c.mipmapCount===1&&(a.minFilter=Or),c.generateMipmaps!==void 0&&(a.generateMipmaps=c.generateMipmaps),a.needsUpdate=!0,n&&n(a,c)},r,i),a}}class aC extends Vo{constructor(e){super(e)}load(e,n,r,i){const o=new lr,a=new Xee(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,function(s){o.image=s,o.needsUpdate=!0,n!==void 0&&n(o)},r,i),o}}class Lm extends vn{constructor(e,n=1){super(),this.isLight=!0,this.type="Light",this.color=new ft(e),this.intensity=n}dispose(){}copy(e,n){return super.copy(e,n),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const n=super.toJSON(e);return n.object.color=this.color.getHex(),n.object.intensity=this.intensity,this.groundColor!==void 0&&(n.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(n.object.distance=this.distance),this.angle!==void 0&&(n.object.angle=this.angle),this.decay!==void 0&&(n.object.decay=this.decay),this.penumbra!==void 0&&(n.object.penumbra=this.penumbra),this.shadow!==void 0&&(n.object.shadow=this.shadow.toJSON()),this.target!==void 0&&(n.object.target=this.target.uuid),n}}class Kee extends Lm{constructor(e,n,r){super(e,r),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(vn.DEFAULT_UP),this.updateMatrix(),this.groundColor=new ft(n)}copy(e,n){return super.copy(e,n),this.groundColor.copy(e.groundColor),this}}const vw=new gt,TO=new ne,MO=new ne;class sC{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new xt(512,512),this.mapType=_a,this.map=null,this.mapPass=null,this.matrix=new gt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new nC,this._frameExtents=new xt(1,1),this._viewportCount=1,this._viewports=[new Yt(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const n=this.camera,r=this.matrix;TO.setFromMatrixPosition(e.matrixWorld),n.position.copy(TO),MO.setFromMatrixPosition(e.target.matrixWorld),n.lookAt(MO),n.updateMatrixWorld(),vw.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(vw),r.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),r.multiply(vw)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.autoUpdate=e.autoUpdate,this.needsUpdate=e.needsUpdate,this.normalBias=e.normalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.intensity!==1&&(e.intensity=this.intensity),this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class Yee extends sC{constructor(){super(new gr(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(e){const n=this.camera,r=Bd*2*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height*this.aspect,o=e.distance||n.far;(r!==n.fov||i!==n.aspect||o!==n.far)&&(n.fov=r,n.aspect=i,n.far=o,n.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class K4 extends Lm{constructor(e,n,r=0,i=Math.PI/3,o=0,a=2){super(e,n),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(vn.DEFAULT_UP),this.updateMatrix(),this.target=new vn,this.distance=r,this.angle=i,this.penumbra=o,this.decay=a,this.map=null,this.shadow=new Yee}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,n){return super.copy(e,n),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const AO=new gt,ch=new ne,yw=new ne;class Jee extends sC{constructor(){super(new gr(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new xt(4,2),this._viewportCount=6,this._viewports=[new Yt(2,1,1,1),new Yt(0,1,1,1),new Yt(3,1,1,1),new Yt(1,1,1,1),new Yt(3,0,1,1),new Yt(1,0,1,1)],this._cubeDirections=[new ne(1,0,0),new ne(-1,0,0),new ne(0,0,1),new ne(0,0,-1),new ne(0,1,0),new ne(0,-1,0)],this._cubeUps=[new ne(0,1,0),new ne(0,1,0),new ne(0,1,0),new ne(0,1,0),new ne(0,0,1),new ne(0,0,-1)]}updateMatrices(e,n=0){const r=this.camera,i=this.matrix,o=e.distance||r.far;o!==r.far&&(r.far=o,r.updateProjectionMatrix()),ch.setFromMatrixPosition(e.matrixWorld),r.position.copy(ch),yw.copy(r.position),yw.add(this._cubeDirections[n]),r.up.copy(this._cubeUps[n]),r.lookAt(yw),r.updateMatrixWorld(),i.makeTranslation(-ch.x,-ch.y,-ch.z),AO.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),this._frustum.setFromProjectionMatrix(AO)}}class Y4 extends Lm{constructor(e,n,r=0,i=2){super(e,n),this.isPointLight=!0,this.type="PointLight",this.distance=r,this.decay=i,this.shadow=new Jee}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,n){return super.copy(e,n),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class $x extends B4{constructor(e=-1,n=1,r=1,i=-1,o=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=n,this.top=r,this.bottom=i,this.near=o,this.far=a,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,n,r,i,o,a){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),n=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let o=r-e,a=r+e,s=i+n,l=i-n;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;o+=c*this.view.offsetX,a=o+c*this.view.width,s-=u*this.view.offsetY,l=s-u*this.view.height}this.projectionMatrix.makeOrthographic(o,a,s,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.zoom=this.zoom,n.object.left=this.left,n.object.right=this.right,n.object.top=this.top,n.object.bottom=this.bottom,n.object.near=this.near,n.object.far=this.far,this.view!==null&&(n.object.view=Object.assign({},this.view)),n}}class Zee extends sC{constructor(){super(new $x(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class zx extends Lm{constructor(e,n){super(e,n),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(vn.DEFAULT_UP),this.updateMatrix(),this.target=new vn,this.shadow=new Zee}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class J4 extends Lm{constructor(e,n){super(e,n),this.isAmbientLight=!0,this.type="AmbientLight"}}class mc{static extractUrlBase(e){const n=e.lastIndexOf("/");return n===-1?"./":e.slice(0,n+1)}static resolveURL(e,n){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(n)&&/^\//.test(e)&&(n=n.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:n+e)}}const xw=new WeakMap;class Qee extends Vo{constructor(e){super(e),this.isImageBitmapLoader=!0,typeof createImageBitmap>"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,n,r,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,a=Hs.get(e);if(a!==void 0){if(o.manager.itemStart(e),a.then){a.then(c=>{if(xw.has(a)===!0)i&&i(xw.get(a)),o.manager.itemError(e),o.manager.itemEnd(e);else return n&&n(c),o.manager.itemEnd(e),c});return}return setTimeout(function(){n&&n(a),o.manager.itemEnd(e)},0),a}const s={};s.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",s.headers=this.requestHeader;const l=fetch(e,s).then(function(c){return c.blob()}).then(function(c){return createImageBitmap(c,Object.assign(o.options,{colorSpaceConversion:"none"}))}).then(function(c){return Hs.add(e,c),n&&n(c),o.manager.itemEnd(e),c}).catch(function(c){i&&i(c),xw.set(l,c),Hs.remove(e),o.manager.itemError(e),o.manager.itemEnd(e)});Hs.add(e,l),o.manager.itemStart(e)}}class ete extends gr{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}const lC="\\[\\]\\.:\\/",tte=new RegExp("["+lC+"]","g"),cC="[^"+lC+"]",nte="[^"+lC.replace("\\.","")+"]",rte=/((?:WC+[\/:])*)/.source.replace("WC",cC),ite=/(WCOD+)?/.source.replace("WCOD",nte),ote=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",cC),ate=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",cC),ste=new RegExp("^"+rte+ite+ote+ate+"$"),lte=["material","materials","bones","map"];class cte{constructor(e,n,r){const i=r||nn.parseTrackName(n);this._targetGroup=e,this._bindings=e.subscribe_(n,i)}getValue(e,n){this.bind();const r=this._targetGroup.nCachedObjects_,i=this._bindings[r];i!==void 0&&i.getValue(e,n)}setValue(e,n){const r=this._bindings;for(let i=this._targetGroup.nCachedObjects_,o=r.length;i!==o;++i)r[i].setValue(e,n)}bind(){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=e.length;n!==r;++n)e[n].bind()}unbind(){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=e.length;n!==r;++n)e[n].unbind()}}class nn{constructor(e,n,r){this.path=n,this.parsedPath=r||nn.parseTrackName(n),this.node=nn.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,n,r){return e&&e.isAnimationObjectGroup?new nn.Composite(e,n,r):new nn(e,n,r)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(tte,"")}static parseTrackName(e){const n=ste.exec(e);if(n===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const r={nodeName:n[2],objectName:n[3],objectIndex:n[4],propertyName:n[5],propertyIndex:n[6]},i=r.nodeName&&r.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const o=r.nodeName.substring(i+1);lte.indexOf(o)!==-1&&(r.nodeName=r.nodeName.substring(0,i),r.objectName=o)}if(r.propertyName===null||r.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return r}static findNode(e,n){if(n===void 0||n===""||n==="."||n===-1||n===e.name||n===e.uuid)return e;if(e.skeleton){const r=e.skeleton.getBoneByName(n);if(r!==void 0)return r}if(e.children){const r=function(o){for(let a=0;ap+y?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&f<=p-y&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(o=n.getPose(e.gripSpace,r),o!==null&&(l.matrix.fromArray(o.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,o.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(o.linearVelocity)):l.hasLinearVelocity=!1,o.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(o.angularVelocity)):l.hasAngularVelocity=!1));s!==null&&(i=n.getPose(e.targetRaySpace,r),i===null&&o!==null&&(i=o),i!==null&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(Aee)))}return s!==null&&(s.visible=i!==null),l!==null&&(l.visible=o!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(e,n){if(e.joints[n.jointName]===void 0){const r=new da;r.matrixAutoUpdate=!1,r.visible=!1,e.joints[n.jointName]=r,e.add(r)}return e.joints[n.jointName]}}class V4 extends vn{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new pi,this.environmentIntensity=1,this.environmentRotation=new pi,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,n){return super.copy(e,n),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const n=super.toJSON(e);return this.fog!==null&&(n.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(n.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(n.object.backgroundIntensity=this.backgroundIntensity),n.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(n.object.environmentIntensity=this.environmentIntensity),n.object.environmentRotation=this.environmentRotation.toArray(),n}}class Cee{constructor(e,n){this.isInterleavedBuffer=!0,this.array=e,this.stride=n,this.count=e!==void 0?e.length/n:0,this.usage=p1,this.updateRanges=[],this.version=0,this.uuid=Fo()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,n,r){e*=this.stride,r*=n.stride;for(let i=0,o=this.stride;i1?null:n.copy(e.start).addScaledVector(r,o)}intersectsLine(e){const n=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return n<0&&r>0||r<0&&n>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,n){const r=n||Dee.getNormalMatrix(e),i=this.coplanarPoint(mw).applyMatrix4(e),o=this.normal.applyMatrix3(r).normalize();return this.constant=-i.dot(o),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const kl=new qo,Wg=new ne;class rC{constructor(e=new $a,n=new $a,r=new $a,i=new $a,o=new $a,a=new $a){this.planes=[e,n,r,i,o,a]}set(e,n,r,i,o,a){const s=this.planes;return s[0].copy(e),s[1].copy(n),s[2].copy(r),s[3].copy(i),s[4].copy(o),s[5].copy(a),this}copy(e){const n=this.planes;for(let r=0;r<6;r++)n[r].copy(e.planes[r]);return this}setFromProjectionMatrix(e,n=Xa){const r=this.planes,i=e.elements,o=i[0],a=i[1],s=i[2],l=i[3],c=i[4],u=i[5],d=i[6],f=i[7],p=i[8],y=i[9],v=i[10],g=i[11],m=i[12],x=i[13],b=i[14],S=i[15];if(r[0].setComponents(l-o,f-c,g-p,S-m).normalize(),r[1].setComponents(l+o,f+c,g+p,S+m).normalize(),r[2].setComponents(l+a,f+u,g+y,S+x).normalize(),r[3].setComponents(l-a,f-u,g-y,S-x).normalize(),r[4].setComponents(l-s,f-d,g-v,S-b).normalize(),n===Xa)r[5].setComponents(l+s,f+d,g+v,S+b).normalize();else if(n===Ny)r[5].setComponents(s,d,v,b).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+n);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),kl.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const n=e.geometry;n.boundingSphere===null&&n.computeBoundingSphere(),kl.copy(n.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(kl)}intersectsSprite(e){return kl.center.set(0,0,0),kl.radius=.7071067811865476,kl.applyMatrix4(e.matrixWorld),this.intersectsSphere(kl)}intersectsSphere(e){const n=this.planes,r=e.center,i=-e.radius;for(let o=0;o<6;o++)if(n[o].distanceToPoint(r)0?e.max.x:e.min.x,Wg.y=i.normal.y>0?e.max.y:e.min.y,Wg.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Wg)<0)return!1}return!0}containsPoint(e){const n=this.planes;for(let r=0;r<6;r++)if(n[r].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class pc extends qr{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new ft(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const Oy=new ne,Iy=new ne,xO=new gt,lh=new Sf,Xg=new qo,gw=new ne,bO=new ne;let Bx=class extends vn{constructor(e=new br,n=new pc){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=n,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,n){return super.copy(e,n),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const n=e.attributes.position,r=[0];for(let i=1,o=n.count;i0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,a=i.length;or)return;gw.applyMatrix4(t.matrixWorld);const c=e.ray.origin.distanceTo(gw);if(!(ce.far))return{distance:c,point:bO.clone().applyMatrix4(t.matrixWorld),index:a,face:null,faceIndex:null,barycoord:null,object:t}}const _O=new ne,wO=new ne;class Dy extends Bx{constructor(e,n){super(e,n),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const n=e.attributes.position,r=[];for(let i=0,o=n.count;i0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,a=i.length;oi.far)return;o.push({distance:c,distanceToRay:Math.sqrt(s),point:l,index:e,face:null,faceIndex:null,barycoord:null,object:a})}}class W4 extends lr{constructor(e,n,r=Nc,i,o,a,s=Xr,l=Xr,c,u=Mp,d=1){if(u!==Mp&&u!==Ap)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const f={width:e,height:n,depth:d};super(f,i,o,a,s,l,u,r,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new ZA(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const n=super.toJSON(e);return this.compareFunction!==null&&(n.compareFunction=this.compareFunction),n}}class iC extends br{constructor(e=1,n=1,r=1,i=32,o=1,a=!1,s=0,l=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:n,height:r,radialSegments:i,heightSegments:o,openEnded:a,thetaStart:s,thetaLength:l};const c=this;i=Math.floor(i),o=Math.floor(o);const u=[],d=[],f=[],p=[];let y=0;const v=[],g=r/2;let m=0;x(),a===!1&&(e>0&&b(!0),n>0&&b(!1)),this.setIndex(u),this.setAttribute("position",new Qt(d,3)),this.setAttribute("normal",new Qt(f,3)),this.setAttribute("uv",new Qt(p,2));function x(){const S=new ne,w=new ne;let E=0;const T=(n-e)/r;for(let A=0;A<=o;A++){const M=[],C=A/o,P=C*(n-e)+e;for(let R=0;R<=i;R++){const D=R/i,k=D*l+s,U=Math.sin(k),O=Math.cos(k);w.x=P*U,w.y=-C*r+g,w.z=P*O,d.push(w.x,w.y,w.z),S.set(U,T,O).normalize(),f.push(S.x,S.y,S.z),p.push(D,1-C),M.push(y++)}v.push(M)}for(let A=0;A0||M!==0)&&(u.push(C,P,D),E+=3),(n>0||M!==o-1)&&(u.push(P,R,D),E+=3)}c.addGroup(m,E,0),m+=E}function b(S){const w=y,E=new xt,T=new ne;let A=0;const M=S===!0?e:n,C=S===!0?1:-1;for(let R=1;R<=i;R++)d.push(0,g*C,0),f.push(0,C,0),p.push(.5,.5),y++;const P=y;for(let R=0;R<=i;R++){const k=R/i*l+s,U=Math.cos(k),O=Math.sin(k);T.x=M*O,T.y=g*C,T.z=M*U,d.push(T.x,T.y,T.z),f.push(0,C,0),E.x=U*.5+.5,E.y=O*.5*C+.5,p.push(E.x,E.y),y++}for(let R=0;R0)&&p.push(b,S,E),(m!==r-1||l0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class Bo extends qr{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new ft(16777215),this.specular=new ft(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ft(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ux,this.normalScale=new xt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new pi,this.combine=kx,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class jee extends qr{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new ft(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ft(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ux,this.normalScale=new xt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new pi,this.combine=kx,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Uee extends qr{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=CQ,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class Fee extends qr{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}function Jg(t,e){return!t||t.constructor===e?t:typeof e.BYTES_PER_ELEMENT=="number"?new e(t):Array.prototype.slice.call(t)}function Bee(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function $ee(t){function e(i,o){return t[i]-t[o]}const n=t.length,r=new Array(n);for(let i=0;i!==n;++i)r[i]=i;return r.sort(e),r}function TO(t,e,n){const r=t.length,i=new t.constructor(r);for(let o=0,a=0;a!==r;++o){const s=n[o]*e;for(let l=0;l!==e;++l)i[a++]=t[s+l]}return i}function X4(t,e,n,r){let i=1,o=t[0];for(;o!==void 0&&o[r]===void 0;)o=t[i++];if(o===void 0)return;let a=o[r];if(a!==void 0)if(Array.isArray(a))do a=o[r],a!==void 0&&(e.push(o.time),n.push(...a)),o=t[i++];while(o!==void 0);else if(a.toArray!==void 0)do a=o[r],a!==void 0&&(e.push(o.time),a.toArray(n,n.length)),o=t[i++];while(o!==void 0);else do a=o[r],a!==void 0&&(e.push(o.time),n.push(a)),o=t[i++];while(o!==void 0)}class Dm{constructor(e,n,r,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new n.constructor(r),this.sampleValues=n,this.valueSize=r,this.settings=null,this.DefaultSettings_={}}evaluate(e){const n=this.parameterPositions;let r=this._cachedIndex,i=n[r],o=n[r-1];e:{t:{let a;n:{r:if(!(e=o)){const s=n[1];e=o)break t}a=r,r=0;break n}break e}for(;r>>1;en;)--a;if(++a,o!==0||a!==i){o>=a&&(a=Math.max(a,1),o=a-1);const s=this.getValueSize();this.times=r.slice(o,a),this.values=this.values.slice(o*s,a*s)}return this}validate(){let e=!0;const n=this.getValueSize();n-Math.floor(n)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const r=this.times,i=this.values,o=r.length;o===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let a=null;for(let s=0;s!==o;s++){const l=r[s];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,s,l),e=!1;break}if(a!==null&&a>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,s,l,a),e=!1;break}a=l}if(i!==void 0&&Bee(i))for(let s=0,l=i.length;s!==l;++s){const c=i[s];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,s,c),e=!1;break}}return e}optimize(){const e=this.times.slice(),n=this.values.slice(),r=this.getValueSize(),i=this.getInterpolation()===G_,o=e.length-1;let a=1;for(let s=1;s0){e[a]=e[o];for(let s=o*r,l=a*r,c=0;c!==r;++c)n[l+c]=n[s+c];++a}return a!==e.length?(this.times=e.slice(0,a),this.values=n.slice(0,a*r)):(this.times=e,this.values=n),this}clone(){const e=this.times.slice(),n=this.values.slice(),r=this.constructor,i=new r(this.name,e,n);return i.createInterpolant=this.createInterpolant,i}}Ko.prototype.ValueTypeName="";Ko.prototype.TimeBufferType=Float32Array;Ko.prototype.ValueBufferType=Float32Array;Ko.prototype.DefaultInterpolation=Pp;class Ef extends Ko{constructor(e,n,r){super(e,n,r)}}Ef.prototype.ValueTypeName="bool";Ef.prototype.ValueBufferType=Array;Ef.prototype.DefaultInterpolation=Cp;Ef.prototype.InterpolantFactoryMethodLinear=void 0;Ef.prototype.InterpolantFactoryMethodSmooth=void 0;class q4 extends Ko{constructor(e,n,r,i){super(e,n,r,i)}}q4.prototype.ValueTypeName="color";class zd extends Ko{constructor(e,n,r,i){super(e,n,r,i)}}zd.prototype.ValueTypeName="number";class Gee extends Dm{constructor(e,n,r,i){super(e,n,r,i)}interpolate_(e,n,r,i){const o=this.resultBuffer,a=this.sampleValues,s=this.valueSize,l=(r-n)/(i-n);let c=e*s;for(let u=c+s;c!==u;c+=4)Ii.slerpFlat(o,0,a,c-s,a,c,l);return o}}class Ic extends Ko{constructor(e,n,r,i){super(e,n,r,i)}InterpolantFactoryMethodLinear(e){return new Gee(this.times,this.values,this.getValueSize(),e)}}Ic.prototype.ValueTypeName="quaternion";Ic.prototype.InterpolantFactoryMethodSmooth=void 0;class Tf extends Ko{constructor(e,n,r){super(e,n,r)}}Tf.prototype.ValueTypeName="string";Tf.prototype.ValueBufferType=Array;Tf.prototype.DefaultInterpolation=Cp;Tf.prototype.InterpolantFactoryMethodLinear=void 0;Tf.prototype.InterpolantFactoryMethodSmooth=void 0;class pl extends Ko{constructor(e,n,r,i){super(e,n,r,i)}}pl.prototype.ValueTypeName="vector";class v1{constructor(e="",n=-1,r=[],i=MQ){this.name=e,this.tracks=r,this.duration=n,this.blendMode=i,this.uuid=Fo(),this.duration<0&&this.resetDuration()}static parse(e){const n=[],r=e.tracks,i=1/(e.fps||1);for(let a=0,s=r.length;a!==s;++a)n.push(Xee(r[a]).scale(i));const o=new this(e.name,e.duration,n,e.blendMode);return o.uuid=e.uuid,o}static toJSON(e){const n=[],r=e.tracks,i={name:e.name,duration:e.duration,tracks:n,uuid:e.uuid,blendMode:e.blendMode};for(let o=0,a=r.length;o!==a;++o)n.push(Ko.toJSON(r[o]));return i}static CreateFromMorphTargetSequence(e,n,r,i){const o=n.length,a=[];for(let s=0;s1){const d=u[1];let f=i[d];f||(i[d]=f=[]),f.push(c)}}const a=[];for(const s in i)a.push(this.CreateFromMorphTargetSequence(s,i[s],n,r));return a}static parseAnimation(e,n){if(console.warn("THREE.AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const r=function(d,f,p,y,v){if(p.length!==0){const g=[],m=[];X4(p,g,m,y),g.length!==0&&v.push(new d(f,g,m))}},i=[],o=e.name||"default",a=e.fps||30,s=e.blendMode;let l=e.length||-1;const c=e.hierarchy||[];for(let d=0;d{n&&n(o),this.manager.itemEnd(e)},0),o;if(Da[e]!==void 0){Da[e].push({onLoad:n,onProgress:r,onError:i});return}Da[e]=[],Da[e].push({onLoad:n,onProgress:r,onError:i});const a=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),s=this.mimeType,l=this.responseType;fetch(a).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const u=Da[e],d=c.body.getReader(),f=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),p=f?parseInt(f):0,y=p!==0;let v=0;const g=new ReadableStream({start(m){x();function x(){d.read().then(({done:b,value:S})=>{if(b)m.close();else{v+=S.byteLength;const w=new ProgressEvent("progress",{lengthComputable:y,loaded:v,total:p});for(let E=0,T=u.length;E{m.error(b)})}}});return new Response(g)}else throw new qee(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`,c)}).then(c=>{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(u=>new DOMParser().parseFromString(u,s));case"json":return c.json();default:if(s==="")return c.text();{const d=/charset="?([^;"\s]*)"?/i.exec(s),f=d&&d[1]?d[1].toLowerCase():void 0,p=new TextDecoder(f);return c.arrayBuffer().then(y=>p.decode(y))}}}).then(c=>{Hs.add(e,c);const u=Da[e];delete Da[e];for(let d=0,f=u.length;d{const u=Da[e];if(u===void 0)throw this.manager.itemError(e),c;delete Da[e];for(let d=0,f=u.length;d{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class Kee extends Go{constructor(e){super(e)}load(e,n,r,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,a=Hs.get(e);if(a!==void 0)return o.manager.itemStart(e),setTimeout(function(){n&&n(a),o.manager.itemEnd(e)},0),a;const s=Rp("img");function l(){u(),Hs.add(e,this),n&&n(this),o.manager.itemEnd(e)}function c(d){u(),i&&i(d),o.manager.itemError(e),o.manager.itemEnd(e)}function u(){s.removeEventListener("load",l,!1),s.removeEventListener("error",c,!1)}return s.addEventListener("load",l,!1),s.addEventListener("error",c,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(s.crossOrigin=this.crossOrigin),o.manager.itemStart(e),s.src=e,s}}class Yee extends Go{constructor(e){super(e)}load(e,n,r,i){const o=this,a=new nC,s=new Mf(this.manager);return s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setPath(this.path),s.setWithCredentials(o.withCredentials),s.load(e,function(l){let c;try{c=o.parse(l)}catch(u){if(i!==void 0)i(u);else{console.error(u);return}}c.image!==void 0?a.image=c.image:c.data!==void 0&&(a.image.width=c.width,a.image.height=c.height,a.image.data=c.data),a.wrapS=c.wrapS!==void 0?c.wrapS:Ji,a.wrapT=c.wrapT!==void 0?c.wrapT:Ji,a.magFilter=c.magFilter!==void 0?c.magFilter:Ir,a.minFilter=c.minFilter!==void 0?c.minFilter:Ir,a.anisotropy=c.anisotropy!==void 0?c.anisotropy:1,c.colorSpace!==void 0&&(a.colorSpace=c.colorSpace),c.flipY!==void 0&&(a.flipY=c.flipY),c.format!==void 0&&(a.format=c.format),c.type!==void 0&&(a.type=c.type),c.mipmaps!==void 0&&(a.mipmaps=c.mipmaps,a.minFilter=Io),c.mipmapCount===1&&(a.minFilter=Ir),c.generateMipmaps!==void 0&&(a.generateMipmaps=c.generateMipmaps),a.needsUpdate=!0,n&&n(a,c)},r,i),a}}class sC extends Go{constructor(e){super(e)}load(e,n,r,i){const o=new lr,a=new Kee(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,function(s){o.image=s,o.needsUpdate=!0,n!==void 0&&n(o)},r,i),o}}class Lm extends vn{constructor(e,n=1){super(),this.isLight=!0,this.type="Light",this.color=new ft(e),this.intensity=n}dispose(){}copy(e,n){return super.copy(e,n),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const n=super.toJSON(e);return n.object.color=this.color.getHex(),n.object.intensity=this.intensity,this.groundColor!==void 0&&(n.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(n.object.distance=this.distance),this.angle!==void 0&&(n.object.angle=this.angle),this.decay!==void 0&&(n.object.decay=this.decay),this.penumbra!==void 0&&(n.object.penumbra=this.penumbra),this.shadow!==void 0&&(n.object.shadow=this.shadow.toJSON()),this.target!==void 0&&(n.object.target=this.target.uuid),n}}class Jee extends Lm{constructor(e,n,r){super(e,r),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(vn.DEFAULT_UP),this.updateMatrix(),this.groundColor=new ft(n)}copy(e,n){return super.copy(e,n),this.groundColor.copy(e.groundColor),this}}const vw=new gt,MO=new ne,AO=new ne;class lC{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new xt(512,512),this.mapType=_a,this.map=null,this.mapPass=null,this.matrix=new gt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new rC,this._frameExtents=new xt(1,1),this._viewportCount=1,this._viewports=[new Yt(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const n=this.camera,r=this.matrix;MO.setFromMatrixPosition(e.matrixWorld),n.position.copy(MO),AO.setFromMatrixPosition(e.target.matrixWorld),n.lookAt(AO),n.updateMatrixWorld(),vw.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(vw),r.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),r.multiply(vw)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.autoUpdate=e.autoUpdate,this.needsUpdate=e.needsUpdate,this.normalBias=e.normalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.intensity!==1&&(e.intensity=this.intensity),this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class Zee extends lC{constructor(){super(new gr(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(e){const n=this.camera,r=Bd*2*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height*this.aspect,o=e.distance||n.far;(r!==n.fov||i!==n.aspect||o!==n.far)&&(n.fov=r,n.aspect=i,n.far=o,n.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class J4 extends Lm{constructor(e,n,r=0,i=Math.PI/3,o=0,a=2){super(e,n),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(vn.DEFAULT_UP),this.updateMatrix(),this.target=new vn,this.distance=r,this.angle=i,this.penumbra=o,this.decay=a,this.map=null,this.shadow=new Zee}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,n){return super.copy(e,n),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const CO=new gt,ch=new ne,yw=new ne;class Qee extends lC{constructor(){super(new gr(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new xt(4,2),this._viewportCount=6,this._viewports=[new Yt(2,1,1,1),new Yt(0,1,1,1),new Yt(3,1,1,1),new Yt(1,1,1,1),new Yt(3,0,1,1),new Yt(1,0,1,1)],this._cubeDirections=[new ne(1,0,0),new ne(-1,0,0),new ne(0,0,1),new ne(0,0,-1),new ne(0,1,0),new ne(0,-1,0)],this._cubeUps=[new ne(0,1,0),new ne(0,1,0),new ne(0,1,0),new ne(0,1,0),new ne(0,0,1),new ne(0,0,-1)]}updateMatrices(e,n=0){const r=this.camera,i=this.matrix,o=e.distance||r.far;o!==r.far&&(r.far=o,r.updateProjectionMatrix()),ch.setFromMatrixPosition(e.matrixWorld),r.position.copy(ch),yw.copy(r.position),yw.add(this._cubeDirections[n]),r.up.copy(this._cubeUps[n]),r.lookAt(yw),r.updateMatrixWorld(),i.makeTranslation(-ch.x,-ch.y,-ch.z),CO.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),this._frustum.setFromProjectionMatrix(CO)}}class Z4 extends Lm{constructor(e,n,r=0,i=2){super(e,n),this.isPointLight=!0,this.type="PointLight",this.distance=r,this.decay=i,this.shadow=new Qee}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,n){return super.copy(e,n),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class $x extends z4{constructor(e=-1,n=1,r=1,i=-1,o=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=n,this.top=r,this.bottom=i,this.near=o,this.far=a,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,n,r,i,o,a){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),n=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let o=r-e,a=r+e,s=i+n,l=i-n;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;o+=c*this.view.offsetX,a=o+c*this.view.width,s-=u*this.view.offsetY,l=s-u*this.view.height}this.projectionMatrix.makeOrthographic(o,a,s,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.zoom=this.zoom,n.object.left=this.left,n.object.right=this.right,n.object.top=this.top,n.object.bottom=this.bottom,n.object.near=this.near,n.object.far=this.far,this.view!==null&&(n.object.view=Object.assign({},this.view)),n}}class ete extends lC{constructor(){super(new $x(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class zx extends Lm{constructor(e,n){super(e,n),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(vn.DEFAULT_UP),this.updateMatrix(),this.target=new vn,this.shadow=new ete}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class Q4 extends Lm{constructor(e,n){super(e,n),this.isAmbientLight=!0,this.type="AmbientLight"}}class mc{static extractUrlBase(e){const n=e.lastIndexOf("/");return n===-1?"./":e.slice(0,n+1)}static resolveURL(e,n){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(n)&&/^\//.test(e)&&(n=n.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:n+e)}}const xw=new WeakMap;class tte extends Go{constructor(e){super(e),this.isImageBitmapLoader=!0,typeof createImageBitmap>"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,n,r,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,a=Hs.get(e);if(a!==void 0){if(o.manager.itemStart(e),a.then){a.then(c=>{if(xw.has(a)===!0)i&&i(xw.get(a)),o.manager.itemError(e),o.manager.itemEnd(e);else return n&&n(c),o.manager.itemEnd(e),c});return}return setTimeout(function(){n&&n(a),o.manager.itemEnd(e)},0),a}const s={};s.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",s.headers=this.requestHeader;const l=fetch(e,s).then(function(c){return c.blob()}).then(function(c){return createImageBitmap(c,Object.assign(o.options,{colorSpaceConversion:"none"}))}).then(function(c){return Hs.add(e,c),n&&n(c),o.manager.itemEnd(e),c}).catch(function(c){i&&i(c),xw.set(l,c),Hs.remove(e),o.manager.itemError(e),o.manager.itemEnd(e)});Hs.add(e,l),o.manager.itemStart(e)}}class nte extends gr{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}const cC="\\[\\]\\.:\\/",rte=new RegExp("["+cC+"]","g"),uC="[^"+cC+"]",ite="[^"+cC.replace("\\.","")+"]",ote=/((?:WC+[\/:])*)/.source.replace("WC",uC),ate=/(WCOD+)?/.source.replace("WCOD",ite),ste=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",uC),lte=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",uC),cte=new RegExp("^"+ote+ate+ste+lte+"$"),ute=["material","materials","bones","map"];class dte{constructor(e,n,r){const i=r||nn.parseTrackName(n);this._targetGroup=e,this._bindings=e.subscribe_(n,i)}getValue(e,n){this.bind();const r=this._targetGroup.nCachedObjects_,i=this._bindings[r];i!==void 0&&i.getValue(e,n)}setValue(e,n){const r=this._bindings;for(let i=this._targetGroup.nCachedObjects_,o=r.length;i!==o;++i)r[i].setValue(e,n)}bind(){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=e.length;n!==r;++n)e[n].bind()}unbind(){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=e.length;n!==r;++n)e[n].unbind()}}class nn{constructor(e,n,r){this.path=n,this.parsedPath=r||nn.parseTrackName(n),this.node=nn.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,n,r){return e&&e.isAnimationObjectGroup?new nn.Composite(e,n,r):new nn(e,n,r)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(rte,"")}static parseTrackName(e){const n=cte.exec(e);if(n===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const r={nodeName:n[2],objectName:n[3],objectIndex:n[4],propertyName:n[5],propertyIndex:n[6]},i=r.nodeName&&r.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const o=r.nodeName.substring(i+1);ute.indexOf(o)!==-1&&(r.nodeName=r.nodeName.substring(0,i),r.objectName=o)}if(r.propertyName===null||r.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return r}static findNode(e,n){if(n===void 0||n===""||n==="."||n===-1||n===e.name||n===e.uuid)return e;if(e.skeleton){const r=e.skeleton.getBoneByName(n);if(r!==void 0)return r}if(e.children){const r=function(o){for(let a=0;ap.start-y.start);let f=0;for(let p=1;pp.start-y.start);let f=0;for(let p=1;p 0 +#endif`,Rte=`#if NUM_CLIPPING_PLANES > 0 vec4 plane; #ifdef ALPHA_TO_COVERAGE float distanceToPlane, distanceGradient; @@ -648,26 +653,26 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve if ( clipped ) discard; #endif #endif -#endif`,Pte=`#if NUM_CLIPPING_PLANES > 0 +#endif`,Nte=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; -#endif`,Rte=`#if NUM_CLIPPING_PLANES > 0 +#endif`,Ote=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; -#endif`,Nte=`#if NUM_CLIPPING_PLANES > 0 +#endif`,Ite=`#if NUM_CLIPPING_PLANES > 0 vClipPosition = - mvPosition.xyz; -#endif`,Ote=`#if defined( USE_COLOR_ALPHA ) +#endif`,Dte=`#if defined( USE_COLOR_ALPHA ) diffuseColor *= vColor; #elif defined( USE_COLOR ) diffuseColor.rgb *= vColor; -#endif`,Ite=`#if defined( USE_COLOR_ALPHA ) +#endif`,Lte=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) varying vec3 vColor; -#endif`,Dte=`#if defined( USE_COLOR_ALPHA ) +#endif`,kte=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) varying vec3 vColor; -#endif`,Lte=`#if defined( USE_COLOR_ALPHA ) +#endif`,jte=`#if defined( USE_COLOR_ALPHA ) vColor = vec4( 1.0 ); #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) vColor = vec3( 1.0 ); @@ -681,7 +686,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve #ifdef USE_BATCHING_COLOR vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) ); vColor.xyz *= batchingColor.xyz; -#endif`,kte=`#define PI 3.141592653589793 +#endif`,Ute=`#define PI 3.141592653589793 #define PI2 6.283185307179586 #define PI_HALF 1.5707963267948966 #define RECIPROCAL_PI 0.3183098861837907 @@ -755,7 +760,7 @@ vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); -} // validated`,jte=`#ifdef ENVMAP_TYPE_CUBE_UV +} // validated`,Fte=`#ifdef ENVMAP_TYPE_CUBE_UV #define cubeUV_minMipLevel 4.0 #define cubeUV_minTileSize 16.0 float getFace( vec3 direction ) { @@ -848,7 +853,7 @@ float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { return vec4( mix( color0, color1, mipF ), 1.0 ); } } -#endif`,Ute=`vec3 transformedNormal = objectNormal; +#endif`,Bte=`vec3 transformedNormal = objectNormal; #ifdef USE_TANGENT vec3 transformedTangent = objectTangent; #endif @@ -877,21 +882,21 @@ transformedNormal = normalMatrix * transformedNormal; #ifdef FLIP_SIDED transformedTangent = - transformedTangent; #endif -#endif`,Fte=`#ifdef USE_DISPLACEMENTMAP +#endif`,$te=`#ifdef USE_DISPLACEMENTMAP uniform sampler2D displacementMap; uniform float displacementScale; uniform float displacementBias; -#endif`,Bte=`#ifdef USE_DISPLACEMENTMAP +#endif`,zte=`#ifdef USE_DISPLACEMENTMAP transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); -#endif`,$te=`#ifdef USE_EMISSIVEMAP +#endif`,Hte=`#ifdef USE_EMISSIVEMAP vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE emissiveColor = sRGBTransferEOTF( emissiveColor ); #endif totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,zte=`#ifdef USE_EMISSIVEMAP +#endif`,Vte=`#ifdef USE_EMISSIVEMAP uniform sampler2D emissiveMap; -#endif`,Hte="gl_FragColor = linearToOutputTexel( gl_FragColor );",Vte=`vec4 LinearTransferOETF( in vec4 value ) { +#endif`,Gte="gl_FragColor = linearToOutputTexel( gl_FragColor );",Wte=`vec4 LinearTransferOETF( in vec4 value ) { return value; } vec4 sRGBTransferEOTF( in vec4 value ) { @@ -899,7 +904,7 @@ vec4 sRGBTransferEOTF( in vec4 value ) { } vec4 sRGBTransferOETF( in vec4 value ) { return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); -}`,Gte=`#ifdef USE_ENVMAP +}`,Xte=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vec3 cameraToFrag; if ( isOrthographic ) { @@ -928,7 +933,7 @@ vec4 sRGBTransferOETF( in vec4 value ) { #elif defined( ENVMAP_BLENDING_ADD ) outgoingLight += envColor.xyz * specularStrength * reflectivity; #endif -#endif`,Wte=`#ifdef USE_ENVMAP +#endif`,qte=`#ifdef USE_ENVMAP uniform float envMapIntensity; uniform float flipEnvMap; uniform mat3 envMapRotation; @@ -938,7 +943,7 @@ vec4 sRGBTransferOETF( in vec4 value ) { uniform sampler2D envMap; #endif -#endif`,Xte=`#ifdef USE_ENVMAP +#endif`,Kte=`#ifdef USE_ENVMAP uniform float reflectivity; #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS @@ -949,7 +954,7 @@ vec4 sRGBTransferOETF( in vec4 value ) { #else varying vec3 vReflect; #endif -#endif`,qte=`#ifdef USE_ENVMAP +#endif`,Yte=`#ifdef USE_ENVMAP #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS #endif @@ -960,7 +965,7 @@ vec4 sRGBTransferOETF( in vec4 value ) { varying vec3 vReflect; uniform float refractionRatio; #endif -#endif`,Kte=`#ifdef USE_ENVMAP +#endif`,Jte=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vWorldPosition = worldPosition.xyz; #else @@ -977,18 +982,18 @@ vec4 sRGBTransferOETF( in vec4 value ) { vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); #endif #endif -#endif`,Yte=`#ifdef USE_FOG +#endif`,Zte=`#ifdef USE_FOG vFogDepth = - mvPosition.z; -#endif`,Jte=`#ifdef USE_FOG +#endif`,Qte=`#ifdef USE_FOG varying float vFogDepth; -#endif`,Zte=`#ifdef USE_FOG +#endif`,ene=`#ifdef USE_FOG #ifdef FOG_EXP2 float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); #else float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); #endif gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); -#endif`,Qte=`#ifdef USE_FOG +#endif`,tne=`#ifdef USE_FOG uniform vec3 fogColor; varying float vFogDepth; #ifdef FOG_EXP2 @@ -997,7 +1002,7 @@ vec4 sRGBTransferOETF( in vec4 value ) { uniform float fogNear; uniform float fogFar; #endif -#endif`,ene=`#ifdef USE_GRADIENTMAP +#endif`,nne=`#ifdef USE_GRADIENTMAP uniform sampler2D gradientMap; #endif vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { @@ -1009,12 +1014,12 @@ vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { vec2 fw = fwidth( coord ) * 0.5; return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); #endif -}`,tne=`#ifdef USE_LIGHTMAP +}`,rne=`#ifdef USE_LIGHTMAP uniform sampler2D lightMap; uniform float lightMapIntensity; -#endif`,nne=`LambertMaterial material; +#endif`,ine=`LambertMaterial material; material.diffuseColor = diffuseColor.rgb; -material.specularStrength = specularStrength;`,rne=`varying vec3 vViewPosition; +material.specularStrength = specularStrength;`,one=`varying vec3 vViewPosition; struct LambertMaterial { vec3 diffuseColor; float specularStrength; @@ -1028,7 +1033,7 @@ void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometr reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_Lambert -#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,ine=`uniform bool receiveShadow; +#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,ane=`uniform bool receiveShadow; uniform vec3 ambientLightColor; #if defined( USE_LIGHT_PROBES ) uniform vec3 lightProbe[ 9 ]; @@ -1144,7 +1149,7 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); return irradiance; } -#endif`,one=`#ifdef USE_ENVMAP +#endif`,sne=`#ifdef USE_ENVMAP vec3 getIBLIrradiance( const in vec3 normal ) { #ifdef ENVMAP_TYPE_CUBE_UV vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); @@ -1177,8 +1182,8 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi #endif } #endif -#endif`,ane=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,sne=`varying vec3 vViewPosition; +#endif`,lne=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,cne=`varying vec3 vViewPosition; struct ToonMaterial { vec3 diffuseColor; }; @@ -1190,11 +1195,11 @@ void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPo reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_Toon -#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,lne=`BlinnPhongMaterial material; +#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,une=`BlinnPhongMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularColor = specular; material.specularShininess = shininess; -material.specularStrength = specularStrength;`,cne=`varying vec3 vViewPosition; +material.specularStrength = specularStrength;`,dne=`varying vec3 vViewPosition; struct BlinnPhongMaterial { vec3 diffuseColor; vec3 specularColor; @@ -1211,7 +1216,7 @@ void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geom reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_BlinnPhong -#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,une=`PhysicalMaterial material; +#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,fne=`PhysicalMaterial material; material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); @@ -1297,7 +1302,7 @@ material.roughness = min( material.roughness, 1.0 ); material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; -#endif`,dne=`struct PhysicalMaterial { +#endif`,hne=`struct PhysicalMaterial { vec3 diffuseColor; float roughness; vec3 specularColor; @@ -1598,7 +1603,7 @@ void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradia #define RE_IndirectSpecular RE_IndirectSpecular_Physical float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); -}`,fne=` +}`,pne=` vec3 geometryPosition = - vViewPosition; vec3 geometryNormal = normal; vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); @@ -1713,7 +1718,7 @@ IncidentLight directLight; #if defined( RE_IndirectSpecular ) vec3 radiance = vec3( 0.0 ); vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,hne=`#if defined( RE_IndirectDiffuse ) +#endif`,mne=`#if defined( RE_IndirectDiffuse ) #ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; @@ -1732,32 +1737,32 @@ IncidentLight directLight; #ifdef USE_CLEARCOAT clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); #endif -#endif`,pne=`#if defined( RE_IndirectDiffuse ) +#endif`,gne=`#if defined( RE_IndirectDiffuse ) RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); #endif #if defined( RE_IndirectSpecular ) RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); -#endif`,mne=`#if defined( USE_LOGDEPTHBUF ) +#endif`,vne=`#if defined( USE_LOGDEPTHBUF ) gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; -#endif`,gne=`#if defined( USE_LOGDEPTHBUF ) +#endif`,yne=`#if defined( USE_LOGDEPTHBUF ) uniform float logDepthBufFC; varying float vFragDepth; varying float vIsPerspective; -#endif`,vne=`#ifdef USE_LOGDEPTHBUF +#endif`,xne=`#ifdef USE_LOGDEPTHBUF varying float vFragDepth; varying float vIsPerspective; -#endif`,yne=`#ifdef USE_LOGDEPTHBUF +#endif`,bne=`#ifdef USE_LOGDEPTHBUF vFragDepth = 1.0 + gl_Position.w; vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); -#endif`,xne=`#ifdef USE_MAP +#endif`,_ne=`#ifdef USE_MAP vec4 sampledDiffuseColor = texture2D( map, vMapUv ); #ifdef DECODE_VIDEO_TEXTURE sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor ); #endif diffuseColor *= sampledDiffuseColor; -#endif`,bne=`#ifdef USE_MAP +#endif`,wne=`#ifdef USE_MAP uniform sampler2D map; -#endif`,_ne=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) +#endif`,Sne=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) #if defined( USE_POINTS_UV ) vec2 uv = vUv; #else @@ -1769,7 +1774,7 @@ IncidentLight directLight; #endif #ifdef USE_ALPHAMAP diffuseColor.a *= texture2D( alphaMap, uv ).g; -#endif`,wne=`#if defined( USE_POINTS_UV ) +#endif`,Ene=`#if defined( USE_POINTS_UV ) varying vec2 vUv; #else #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) @@ -1781,19 +1786,19 @@ IncidentLight directLight; #endif #ifdef USE_ALPHAMAP uniform sampler2D alphaMap; -#endif`,Sne=`float metalnessFactor = metalness; +#endif`,Tne=`float metalnessFactor = metalness; #ifdef USE_METALNESSMAP vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); metalnessFactor *= texelMetalness.b; -#endif`,Ene=`#ifdef USE_METALNESSMAP +#endif`,Mne=`#ifdef USE_METALNESSMAP uniform sampler2D metalnessMap; -#endif`,Tne=`#ifdef USE_INSTANCING_MORPH +#endif`,Ane=`#ifdef USE_INSTANCING_MORPH float morphTargetInfluences[ MORPHTARGETS_COUNT ]; float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; } -#endif`,Mne=`#if defined( USE_MORPHCOLORS ) +#endif`,Cne=`#if defined( USE_MORPHCOLORS ) vColor *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { #if defined( USE_COLOR_ALPHA ) @@ -1802,12 +1807,12 @@ IncidentLight directLight; if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; #endif } -#endif`,Ane=`#ifdef USE_MORPHNORMALS +#endif`,Pne=`#ifdef USE_MORPHNORMALS objectNormal *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; } -#endif`,Cne=`#ifdef USE_MORPHTARGETS +#endif`,Rne=`#ifdef USE_MORPHTARGETS #ifndef USE_INSTANCING_MORPH uniform float morphTargetBaseInfluence; uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; @@ -1821,12 +1826,12 @@ IncidentLight directLight; ivec3 morphUV = ivec3( x, y, morphTargetIndex ); return texelFetch( morphTargetsTexture, morphUV, 0 ); } -#endif`,Pne=`#ifdef USE_MORPHTARGETS +#endif`,Nne=`#ifdef USE_MORPHTARGETS transformed *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; } -#endif`,Rne=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; +#endif`,One=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; #ifdef FLAT_SHADED vec3 fdx = dFdx( vViewPosition ); vec3 fdy = dFdy( vViewPosition ); @@ -1867,7 +1872,7 @@ IncidentLight directLight; tbn2[1] *= faceDirection; #endif #endif -vec3 nonPerturbedNormal = normal;`,Nne=`#ifdef USE_NORMALMAP_OBJECTSPACE +vec3 nonPerturbedNormal = normal;`,Ine=`#ifdef USE_NORMALMAP_OBJECTSPACE normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; #ifdef FLIP_SIDED normal = - normal; @@ -1882,25 +1887,25 @@ vec3 nonPerturbedNormal = normal;`,Nne=`#ifdef USE_NORMALMAP_OBJECTSPACE normal = normalize( tbn * mapN ); #elif defined( USE_BUMPMAP ) normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); -#endif`,One=`#ifndef FLAT_SHADED +#endif`,Dne=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif -#endif`,Ine=`#ifndef FLAT_SHADED +#endif`,Lne=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif -#endif`,Dne=`#ifndef FLAT_SHADED +#endif`,kne=`#ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #ifdef USE_TANGENT vTangent = normalize( transformedTangent ); vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); #endif -#endif`,Lne=`#ifdef USE_NORMALMAP +#endif`,jne=`#ifdef USE_NORMALMAP uniform sampler2D normalMap; uniform vec2 normalScale; #endif @@ -1922,13 +1927,13 @@ vec3 nonPerturbedNormal = normal;`,Nne=`#ifdef USE_NORMALMAP_OBJECTSPACE float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); return mat3( T * scale, B * scale, N ); } -#endif`,kne=`#ifdef USE_CLEARCOAT +#endif`,Une=`#ifdef USE_CLEARCOAT vec3 clearcoatNormal = nonPerturbedNormal; -#endif`,jne=`#ifdef USE_CLEARCOAT_NORMALMAP +#endif`,Fne=`#ifdef USE_CLEARCOAT_NORMALMAP vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; clearcoatMapN.xy *= clearcoatNormalScale; clearcoatNormal = normalize( tbn2 * clearcoatMapN ); -#endif`,Une=`#ifdef USE_CLEARCOATMAP +#endif`,Bne=`#ifdef USE_CLEARCOATMAP uniform sampler2D clearcoatMap; #endif #ifdef USE_CLEARCOAT_NORMALMAP @@ -1937,18 +1942,18 @@ vec3 nonPerturbedNormal = normal;`,Nne=`#ifdef USE_NORMALMAP_OBJECTSPACE #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP uniform sampler2D clearcoatRoughnessMap; -#endif`,Fne=`#ifdef USE_IRIDESCENCEMAP +#endif`,$ne=`#ifdef USE_IRIDESCENCEMAP uniform sampler2D iridescenceMap; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP uniform sampler2D iridescenceThicknessMap; -#endif`,Bne=`#ifdef OPAQUE +#endif`,zne=`#ifdef OPAQUE diffuseColor.a = 1.0; #endif #ifdef USE_TRANSMISSION diffuseColor.a *= material.transmissionAlpha; #endif -gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,$ne=`vec3 packNormalToRGB( const in vec3 normal ) { +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,Hne=`vec3 packNormalToRGB( const in vec3 normal ) { return normalize( normal ) * 0.5 + 0.5; } vec3 unpackRGBToNormal( const in vec3 rgb ) { @@ -2017,9 +2022,9 @@ float viewZToPerspectiveDepth( const in float viewZ, const in float near, const } float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { return ( near * far ) / ( ( far - near ) * depth - far ); -}`,zne=`#ifdef PREMULTIPLIED_ALPHA +}`,Vne=`#ifdef PREMULTIPLIED_ALPHA gl_FragColor.rgb *= gl_FragColor.a; -#endif`,Hne=`vec4 mvPosition = vec4( transformed, 1.0 ); +#endif`,Gne=`vec4 mvPosition = vec4( transformed, 1.0 ); #ifdef USE_BATCHING mvPosition = batchingMatrix * mvPosition; #endif @@ -2027,22 +2032,22 @@ float perspectiveDepthToViewZ( const in float depth, const in float near, const mvPosition = instanceMatrix * mvPosition; #endif mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,Vne=`#ifdef DITHERING +gl_Position = projectionMatrix * mvPosition;`,Wne=`#ifdef DITHERING gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,Gne=`#ifdef DITHERING +#endif`,Xne=`#ifdef DITHERING vec3 dithering( vec3 color ) { float grid_position = rand( gl_FragCoord.xy ); vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); return color + dither_shift_RGB; } -#endif`,Wne=`float roughnessFactor = roughness; +#endif`,qne=`float roughnessFactor = roughness; #ifdef USE_ROUGHNESSMAP vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); roughnessFactor *= texelRoughness.g; -#endif`,Xne=`#ifdef USE_ROUGHNESSMAP +#endif`,Kne=`#ifdef USE_ROUGHNESSMAP uniform sampler2D roughnessMap; -#endif`,qne=`#if NUM_SPOT_LIGHT_COORDS > 0 +#endif`,Yne=`#if NUM_SPOT_LIGHT_COORDS > 0 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif #if NUM_SPOT_LIGHT_MAPS > 0 @@ -2228,7 +2233,7 @@ gl_Position = projectionMatrix * mvPosition;`,Vne=`#ifdef DITHERING } return mix( 1.0, shadow, shadowIntensity ); } -#endif`,Kne=`#if NUM_SPOT_LIGHT_COORDS > 0 +#endif`,Jne=`#if NUM_SPOT_LIGHT_COORDS > 0 uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif @@ -2269,7 +2274,7 @@ gl_Position = projectionMatrix * mvPosition;`,Vne=`#ifdef DITHERING }; uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; #endif -#endif`,Yne=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) +#endif`,Zne=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); vec4 shadowWorldPosition; #endif @@ -2301,7 +2306,7 @@ gl_Position = projectionMatrix * mvPosition;`,Vne=`#ifdef DITHERING vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end -#endif`,Jne=`float getShadowMask() { +#endif`,Qne=`float getShadowMask() { float shadow = 1.0; #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 @@ -2333,12 +2338,12 @@ gl_Position = projectionMatrix * mvPosition;`,Vne=`#ifdef DITHERING #endif #endif return shadow; -}`,Zne=`#ifdef USE_SKINNING +}`,ere=`#ifdef USE_SKINNING mat4 boneMatX = getBoneMatrix( skinIndex.x ); mat4 boneMatY = getBoneMatrix( skinIndex.y ); mat4 boneMatZ = getBoneMatrix( skinIndex.z ); mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,Qne=`#ifdef USE_SKINNING +#endif`,tre=`#ifdef USE_SKINNING uniform mat4 bindMatrix; uniform mat4 bindMatrixInverse; uniform highp sampler2D boneTexture; @@ -2353,7 +2358,7 @@ gl_Position = projectionMatrix * mvPosition;`,Vne=`#ifdef DITHERING vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); return mat4( v1, v2, v3, v4 ); } -#endif`,ere=`#ifdef USE_SKINNING +#endif`,nre=`#ifdef USE_SKINNING vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); vec4 skinned = vec4( 0.0 ); skinned += boneMatX * skinVertex * skinWeight.x; @@ -2361,7 +2366,7 @@ gl_Position = projectionMatrix * mvPosition;`,Vne=`#ifdef DITHERING skinned += boneMatZ * skinVertex * skinWeight.z; skinned += boneMatW * skinVertex * skinWeight.w; transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,tre=`#ifdef USE_SKINNING +#endif`,rre=`#ifdef USE_SKINNING mat4 skinMatrix = mat4( 0.0 ); skinMatrix += skinWeight.x * boneMatX; skinMatrix += skinWeight.y * boneMatY; @@ -2372,17 +2377,17 @@ gl_Position = projectionMatrix * mvPosition;`,Vne=`#ifdef DITHERING #ifdef USE_TANGENT objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; #endif -#endif`,nre=`float specularStrength; +#endif`,ire=`float specularStrength; #ifdef USE_SPECULARMAP vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); specularStrength = texelSpecular.r; #else specularStrength = 1.0; -#endif`,rre=`#ifdef USE_SPECULARMAP +#endif`,ore=`#ifdef USE_SPECULARMAP uniform sampler2D specularMap; -#endif`,ire=`#if defined( TONE_MAPPING ) +#endif`,are=`#if defined( TONE_MAPPING ) gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,ore=`#ifndef saturate +#endif`,sre=`#ifndef saturate #define saturate( a ) clamp( a, 0.0, 1.0 ) #endif uniform float toneMappingExposure; @@ -2479,7 +2484,7 @@ vec3 NeutralToneMapping( vec3 color ) { float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); return mix( color, vec3( newPeak ), g ); } -vec3 CustomToneMapping( vec3 color ) { return color; }`,are=`#ifdef USE_TRANSMISSION +vec3 CustomToneMapping( vec3 color ) { return color; }`,lre=`#ifdef USE_TRANSMISSION material.transmission = transmission; material.transmissionAlpha = 1.0; material.thickness = thickness; @@ -2500,7 +2505,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,are=`#ifdef USE_TRANSMIS material.attenuationColor, material.attenuationDistance ); material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); -#endif`,sre=`#ifdef USE_TRANSMISSION +#endif`,cre=`#ifdef USE_TRANSMISSION uniform float transmission; uniform float thickness; uniform float attenuationDistance; @@ -2626,7 +2631,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,are=`#ifdef USE_TRANSMIS float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); } -#endif`,lre=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,ure=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; #endif #ifdef USE_MAP @@ -2696,7 +2701,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,are=`#ifdef USE_TRANSMIS #ifdef USE_THICKNESSMAP uniform mat3 thicknessMapTransform; varying vec2 vThicknessMapUv; -#endif`,cre=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,dre=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; #endif #ifdef USE_MAP @@ -2790,7 +2795,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,are=`#ifdef USE_TRANSMIS #ifdef USE_THICKNESSMAP uniform mat3 thicknessMapTransform; varying vec2 vThicknessMapUv; -#endif`,ure=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,fre=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) vUv = vec3( uv, 1 ).xy; #endif #ifdef USE_MAP @@ -2861,7 +2866,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,are=`#ifdef USE_TRANSMIS #endif #ifdef USE_THICKNESSMAP vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; -#endif`,dre=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 +#endif`,hre=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 vec4 worldPosition = vec4( transformed, 1.0 ); #ifdef USE_BATCHING worldPosition = batchingMatrix * worldPosition; @@ -2870,12 +2875,12 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,are=`#ifdef USE_TRANSMIS worldPosition = instanceMatrix * worldPosition; #endif worldPosition = modelMatrix * worldPosition; -#endif`;const fre=`varying vec2 vUv; +#endif`;const pre=`varying vec2 vUv; uniform mat3 uvTransform; void main() { vUv = ( uvTransform * vec3( uv, 1 ) ).xy; gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,hre=`uniform sampler2D t2D; +}`,mre=`uniform sampler2D t2D; uniform float backgroundIntensity; varying vec2 vUv; void main() { @@ -2887,14 +2892,14 @@ void main() { gl_FragColor = texColor; #include #include -}`,pre=`varying vec3 vWorldDirection; +}`,gre=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; -}`,mre=`#ifdef ENVMAP_TYPE_CUBE +}`,vre=`#ifdef ENVMAP_TYPE_CUBE uniform samplerCube envMap; #elif defined( ENVMAP_TYPE_CUBE_UV ) uniform sampler2D envMap; @@ -2917,14 +2922,14 @@ void main() { gl_FragColor = texColor; #include #include -}`,gre=`varying vec3 vWorldDirection; +}`,yre=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; -}`,vre=`uniform samplerCube tCube; +}`,xre=`uniform samplerCube tCube; uniform float tFlip; uniform float opacity; varying vec3 vWorldDirection; @@ -2934,7 +2939,7 @@ void main() { gl_FragColor.a *= opacity; #include #include -}`,yre=`#include +}`,bre=`#include #include #include #include @@ -2961,7 +2966,7 @@ void main() { #include #include vHighPrecisionZW = gl_Position.zw; -}`,xre=`#if DEPTH_PACKING == 3200 +}`,_re=`#if DEPTH_PACKING == 3200 uniform float opacity; #endif #include @@ -2995,7 +3000,7 @@ void main() { #elif DEPTH_PACKING == 3203 gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); #endif -}`,bre=`#define DISTANCE +}`,wre=`#define DISTANCE varying vec3 vWorldPosition; #include #include @@ -3022,7 +3027,7 @@ void main() { #include #include vWorldPosition = worldPosition.xyz; -}`,_re=`#define DISTANCE +}`,Sre=`#define DISTANCE uniform vec3 referencePosition; uniform float nearDistance; uniform float farDistance; @@ -3046,13 +3051,13 @@ void main () { dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); dist = saturate( dist ); gl_FragColor = packDepthToRGBA( dist ); -}`,wre=`varying vec3 vWorldDirection; +}`,Ere=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include -}`,Sre=`uniform sampler2D tEquirect; +}`,Tre=`uniform sampler2D tEquirect; varying vec3 vWorldDirection; #include void main() { @@ -3061,7 +3066,7 @@ void main() { gl_FragColor = texture2D( tEquirect, sampleUV ); #include #include -}`,Ere=`uniform float scale; +}`,Mre=`uniform float scale; attribute float lineDistance; varying float vLineDistance; #include @@ -3083,7 +3088,7 @@ void main() { #include #include #include -}`,Tre=`uniform vec3 diffuse; +}`,Are=`uniform vec3 diffuse; uniform float opacity; uniform float dashSize; uniform float totalSize; @@ -3111,7 +3116,7 @@ void main() { #include #include #include -}`,Mre=`#include +}`,Cre=`#include #include #include #include @@ -3143,7 +3148,7 @@ void main() { #include #include #include -}`,Are=`uniform vec3 diffuse; +}`,Pre=`uniform vec3 diffuse; uniform float opacity; #ifndef FLAT_SHADED varying vec3 vNormal; @@ -3191,7 +3196,7 @@ void main() { #include #include #include -}`,Cre=`#define LAMBERT +}`,Rre=`#define LAMBERT varying vec3 vViewPosition; #include #include @@ -3230,7 +3235,7 @@ void main() { #include #include #include -}`,Pre=`#define LAMBERT +}`,Nre=`#define LAMBERT uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; @@ -3287,7 +3292,7 @@ void main() { #include #include #include -}`,Rre=`#define MATCAP +}`,Ore=`#define MATCAP varying vec3 vViewPosition; #include #include @@ -3321,7 +3326,7 @@ void main() { #include #include vViewPosition = - mvPosition.xyz; -}`,Nre=`#define MATCAP +}`,Ire=`#define MATCAP uniform vec3 diffuse; uniform float opacity; uniform sampler2D matcap; @@ -3367,7 +3372,7 @@ void main() { #include #include #include -}`,Ore=`#define NORMAL +}`,Dre=`#define NORMAL #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; #endif @@ -3400,7 +3405,7 @@ void main() { #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) vViewPosition = - mvPosition.xyz; #endif -}`,Ire=`#define NORMAL +}`,Lre=`#define NORMAL uniform float opacity; #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; @@ -3422,7 +3427,7 @@ void main() { #ifdef OPAQUE gl_FragColor.a = 1.0; #endif -}`,Dre=`#define PHONG +}`,kre=`#define PHONG varying vec3 vViewPosition; #include #include @@ -3461,7 +3466,7 @@ void main() { #include #include #include -}`,Lre=`#define PHONG +}`,jre=`#define PHONG uniform vec3 diffuse; uniform vec3 emissive; uniform vec3 specular; @@ -3520,7 +3525,7 @@ void main() { #include #include #include -}`,kre=`#define STANDARD +}`,Ure=`#define STANDARD varying vec3 vViewPosition; #ifdef USE_TRANSMISSION varying vec3 vWorldPosition; @@ -3563,7 +3568,7 @@ void main() { #ifdef USE_TRANSMISSION vWorldPosition = worldPosition.xyz; #endif -}`,jre=`#define STANDARD +}`,Fre=`#define STANDARD #ifdef PHYSICAL #define IOR #define USE_SPECULAR @@ -3688,7 +3693,7 @@ void main() { #include #include #include -}`,Ure=`#define TOON +}`,Bre=`#define TOON varying vec3 vViewPosition; #include #include @@ -3725,7 +3730,7 @@ void main() { #include #include #include -}`,Fre=`#define TOON +}`,$re=`#define TOON uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; @@ -3778,7 +3783,7 @@ void main() { #include #include #include -}`,Bre=`uniform float size; +}`,zre=`uniform float size; uniform float scale; #include #include @@ -3809,7 +3814,7 @@ void main() { #include #include #include -}`,$re=`uniform vec3 diffuse; +}`,Hre=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -3834,7 +3839,7 @@ void main() { #include #include #include -}`,zre=`#include +}`,Vre=`#include #include #include #include @@ -3857,7 +3862,7 @@ void main() { #include #include #include -}`,Hre=`uniform vec3 color; +}`,Gre=`uniform vec3 color; uniform float opacity; #include #include @@ -3873,7 +3878,7 @@ void main() { #include #include #include -}`,Vre=`uniform float rotation; +}`,Wre=`uniform float rotation; uniform vec2 center; #include #include @@ -3897,7 +3902,7 @@ void main() { #include #include #include -}`,Gre=`uniform vec3 diffuse; +}`,Xre=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -3922,7 +3927,7 @@ void main() { #include #include #include -}`,Nt={alphahash_fragment:hte,alphahash_pars_fragment:pte,alphamap_fragment:mte,alphamap_pars_fragment:gte,alphatest_fragment:vte,alphatest_pars_fragment:yte,aomap_fragment:xte,aomap_pars_fragment:bte,batching_pars_vertex:_te,batching_vertex:wte,begin_vertex:Ste,beginnormal_vertex:Ete,bsdfs:Tte,iridescence_fragment:Mte,bumpmap_pars_fragment:Ate,clipping_planes_fragment:Cte,clipping_planes_pars_fragment:Pte,clipping_planes_pars_vertex:Rte,clipping_planes_vertex:Nte,color_fragment:Ote,color_pars_fragment:Ite,color_pars_vertex:Dte,color_vertex:Lte,common:kte,cube_uv_reflection_fragment:jte,defaultnormal_vertex:Ute,displacementmap_pars_vertex:Fte,displacementmap_vertex:Bte,emissivemap_fragment:$te,emissivemap_pars_fragment:zte,colorspace_fragment:Hte,colorspace_pars_fragment:Vte,envmap_fragment:Gte,envmap_common_pars_fragment:Wte,envmap_pars_fragment:Xte,envmap_pars_vertex:qte,envmap_physical_pars_fragment:one,envmap_vertex:Kte,fog_vertex:Yte,fog_pars_vertex:Jte,fog_fragment:Zte,fog_pars_fragment:Qte,gradientmap_pars_fragment:ene,lightmap_pars_fragment:tne,lights_lambert_fragment:nne,lights_lambert_pars_fragment:rne,lights_pars_begin:ine,lights_toon_fragment:ane,lights_toon_pars_fragment:sne,lights_phong_fragment:lne,lights_phong_pars_fragment:cne,lights_physical_fragment:une,lights_physical_pars_fragment:dne,lights_fragment_begin:fne,lights_fragment_maps:hne,lights_fragment_end:pne,logdepthbuf_fragment:mne,logdepthbuf_pars_fragment:gne,logdepthbuf_pars_vertex:vne,logdepthbuf_vertex:yne,map_fragment:xne,map_pars_fragment:bne,map_particle_fragment:_ne,map_particle_pars_fragment:wne,metalnessmap_fragment:Sne,metalnessmap_pars_fragment:Ene,morphinstance_vertex:Tne,morphcolor_vertex:Mne,morphnormal_vertex:Ane,morphtarget_pars_vertex:Cne,morphtarget_vertex:Pne,normal_fragment_begin:Rne,normal_fragment_maps:Nne,normal_pars_fragment:One,normal_pars_vertex:Ine,normal_vertex:Dne,normalmap_pars_fragment:Lne,clearcoat_normal_fragment_begin:kne,clearcoat_normal_fragment_maps:jne,clearcoat_pars_fragment:Une,iridescence_pars_fragment:Fne,opaque_fragment:Bne,packing:$ne,premultiplied_alpha_fragment:zne,project_vertex:Hne,dithering_fragment:Vne,dithering_pars_fragment:Gne,roughnessmap_fragment:Wne,roughnessmap_pars_fragment:Xne,shadowmap_pars_fragment:qne,shadowmap_pars_vertex:Kne,shadowmap_vertex:Yne,shadowmask_pars_fragment:Jne,skinbase_vertex:Zne,skinning_pars_vertex:Qne,skinning_vertex:ere,skinnormal_vertex:tre,specularmap_fragment:nre,specularmap_pars_fragment:rre,tonemapping_fragment:ire,tonemapping_pars_fragment:ore,transmission_fragment:are,transmission_pars_fragment:sre,uv_pars_fragment:lre,uv_pars_vertex:cre,uv_vertex:ure,worldpos_vertex:dre,background_vert:fre,background_frag:hre,backgroundCube_vert:pre,backgroundCube_frag:mre,cube_vert:gre,cube_frag:vre,depth_vert:yre,depth_frag:xre,distanceRGBA_vert:bre,distanceRGBA_frag:_re,equirect_vert:wre,equirect_frag:Sre,linedashed_vert:Ere,linedashed_frag:Tre,meshbasic_vert:Mre,meshbasic_frag:Are,meshlambert_vert:Cre,meshlambert_frag:Pre,meshmatcap_vert:Rre,meshmatcap_frag:Nre,meshnormal_vert:Ore,meshnormal_frag:Ire,meshphong_vert:Dre,meshphong_frag:Lre,meshphysical_vert:kre,meshphysical_frag:jre,meshtoon_vert:Ure,meshtoon_frag:Fre,points_vert:Bre,points_frag:$re,shadow_vert:zre,shadow_frag:Hre,sprite_vert:Vre,sprite_frag:Gre},Fe={common:{diffuse:{value:new ft(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Rt},alphaMap:{value:null},alphaMapTransform:{value:new Rt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Rt}},envmap:{envMap:{value:null},envMapRotation:{value:new Rt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Rt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Rt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Rt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Rt},normalScale:{value:new xt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Rt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Rt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Rt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Rt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ft(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new ft(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Rt},alphaTest:{value:0},uvTransform:{value:new Rt}},sprite:{diffuse:{value:new ft(16777215)},opacity:{value:1},center:{value:new xt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Rt},alphaMap:{value:null},alphaMapTransform:{value:new Rt},alphaTest:{value:0}}},na={basic:{uniforms:Fr([Fe.common,Fe.specularmap,Fe.envmap,Fe.aomap,Fe.lightmap,Fe.fog]),vertexShader:Nt.meshbasic_vert,fragmentShader:Nt.meshbasic_frag},lambert:{uniforms:Fr([Fe.common,Fe.specularmap,Fe.envmap,Fe.aomap,Fe.lightmap,Fe.emissivemap,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.fog,Fe.lights,{emissive:{value:new ft(0)}}]),vertexShader:Nt.meshlambert_vert,fragmentShader:Nt.meshlambert_frag},phong:{uniforms:Fr([Fe.common,Fe.specularmap,Fe.envmap,Fe.aomap,Fe.lightmap,Fe.emissivemap,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.fog,Fe.lights,{emissive:{value:new ft(0)},specular:{value:new ft(1118481)},shininess:{value:30}}]),vertexShader:Nt.meshphong_vert,fragmentShader:Nt.meshphong_frag},standard:{uniforms:Fr([Fe.common,Fe.envmap,Fe.aomap,Fe.lightmap,Fe.emissivemap,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.roughnessmap,Fe.metalnessmap,Fe.fog,Fe.lights,{emissive:{value:new ft(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Nt.meshphysical_vert,fragmentShader:Nt.meshphysical_frag},toon:{uniforms:Fr([Fe.common,Fe.aomap,Fe.lightmap,Fe.emissivemap,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.gradientmap,Fe.fog,Fe.lights,{emissive:{value:new ft(0)}}]),vertexShader:Nt.meshtoon_vert,fragmentShader:Nt.meshtoon_frag},matcap:{uniforms:Fr([Fe.common,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.fog,{matcap:{value:null}}]),vertexShader:Nt.meshmatcap_vert,fragmentShader:Nt.meshmatcap_frag},points:{uniforms:Fr([Fe.points,Fe.fog]),vertexShader:Nt.points_vert,fragmentShader:Nt.points_frag},dashed:{uniforms:Fr([Fe.common,Fe.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Nt.linedashed_vert,fragmentShader:Nt.linedashed_frag},depth:{uniforms:Fr([Fe.common,Fe.displacementmap]),vertexShader:Nt.depth_vert,fragmentShader:Nt.depth_frag},normal:{uniforms:Fr([Fe.common,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,{opacity:{value:1}}]),vertexShader:Nt.meshnormal_vert,fragmentShader:Nt.meshnormal_frag},sprite:{uniforms:Fr([Fe.sprite,Fe.fog]),vertexShader:Nt.sprite_vert,fragmentShader:Nt.sprite_frag},background:{uniforms:{uvTransform:{value:new Rt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Nt.background_vert,fragmentShader:Nt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Rt}},vertexShader:Nt.backgroundCube_vert,fragmentShader:Nt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Nt.cube_vert,fragmentShader:Nt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Nt.equirect_vert,fragmentShader:Nt.equirect_frag},distanceRGBA:{uniforms:Fr([Fe.common,Fe.displacementmap,{referencePosition:{value:new ne},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Nt.distanceRGBA_vert,fragmentShader:Nt.distanceRGBA_frag},shadow:{uniforms:Fr([Fe.lights,Fe.fog,{color:{value:new ft(0)},opacity:{value:1}}]),vertexShader:Nt.shadow_vert,fragmentShader:Nt.shadow_frag}};na.physical={uniforms:Fr([na.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Rt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Rt},clearcoatNormalScale:{value:new xt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Rt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Rt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Rt},sheen:{value:0},sheenColor:{value:new ft(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Rt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Rt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Rt},transmissionSamplerSize:{value:new xt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Rt},attenuationDistance:{value:0},attenuationColor:{value:new ft(0)},specularColor:{value:new ft(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Rt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Rt},anisotropyVector:{value:new xt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Rt}}]),vertexShader:Nt.meshphysical_vert,fragmentShader:Nt.meshphysical_frag};const Zg={r:0,b:0,g:0},jl=new pi,Wre=new gt;function Xre(t,e,n,r,i,o,a){const s=new ft(0);let l=o===!0?0:1,c,u,d=null,f=0,p=null;function y(b){let S=b.isScene===!0?b.background:null;return S&&S.isTexture&&(S=(b.backgroundBlurriness>0?n:e).get(S)),S}function v(b){let S=!1;const w=y(b);w===null?m(s,l):w&&w.isColor&&(m(w,1),S=!0);const E=t.xr.getEnvironmentBlendMode();E==="additive"?r.buffers.color.setClear(0,0,0,1,a):E==="alpha-blend"&&r.buffers.color.setClear(0,0,0,0,a),(t.autoClear||S)&&(r.buffers.depth.setTest(!0),r.buffers.depth.setMask(!0),r.buffers.color.setMask(!0),t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil))}function g(b,S){const w=y(S);w&&(w.isCubeTexture||w.mapping===jx)?(u===void 0&&(u=new Tn(new Gc(1,1,1),new hl({name:"BackgroundCubeMaterial",uniforms:$d(na.backgroundCube.uniforms),vertexShader:na.backgroundCube.vertexShader,fragmentShader:na.backgroundCube.fragmentShader,side:ui,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(E,T,A){this.matrixWorld.copyPosition(A.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(u)),jl.copy(S.backgroundRotation),jl.x*=-1,jl.y*=-1,jl.z*=-1,w.isCubeTexture&&w.isRenderTargetTexture===!1&&(jl.y*=-1,jl.z*=-1),u.material.uniforms.envMap.value=w,u.material.uniforms.flipEnvMap.value=w.isCubeTexture&&w.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=S.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=S.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(Wre.makeRotationFromEuler(jl)),u.material.toneMapped=Dt.getTransfer(w.colorSpace)!==an,(d!==w||f!==w.version||p!==t.toneMapping)&&(u.material.needsUpdate=!0,d=w,f=w.version,p=t.toneMapping),u.layers.enableAll(),b.unshift(u,u.geometry,u.material,0,0,null)):w&&w.isTexture&&(c===void 0&&(c=new Tn(new Im(2,2),new hl({name:"BackgroundMaterial",uniforms:$d(na.background.uniforms),vertexShader:na.background.vertexShader,fragmentShader:na.background.fragmentShader,side:ba,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(c)),c.material.uniforms.t2D.value=w,c.material.uniforms.backgroundIntensity.value=S.backgroundIntensity,c.material.toneMapped=Dt.getTransfer(w.colorSpace)!==an,w.matrixAutoUpdate===!0&&w.updateMatrix(),c.material.uniforms.uvTransform.value.copy(w.matrix),(d!==w||f!==w.version||p!==t.toneMapping)&&(c.material.needsUpdate=!0,d=w,f=w.version,p=t.toneMapping),c.layers.enableAll(),b.unshift(c,c.geometry,c.material,0,0,null))}function m(b,S){b.getRGB(Zg,F4(t)),r.buffers.color.setClear(Zg.r,Zg.g,Zg.b,S,a)}function x(){u!==void 0&&(u.geometry.dispose(),u.material.dispose(),u=void 0),c!==void 0&&(c.geometry.dispose(),c.material.dispose(),c=void 0)}return{getClearColor:function(){return s},setClearColor:function(b,S=1){s.set(b),l=S,m(s,l)},getClearAlpha:function(){return l},setClearAlpha:function(b){l=b,m(s,l)},render:v,addToRenderList:g,dispose:x}}function qre(t,e){const n=t.getParameter(t.MAX_VERTEX_ATTRIBS),r={},i=f(null);let o=i,a=!1;function s(C,P,R,D,k){let U=!1;const O=d(D,R,P);o!==O&&(o=O,c(o.object)),U=p(C,D,R,k),U&&y(C,D,R,k),k!==null&&e.update(k,t.ELEMENT_ARRAY_BUFFER),(U||a)&&(a=!1,S(C,P,R,D),k!==null&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e.get(k).buffer))}function l(){return t.createVertexArray()}function c(C){return t.bindVertexArray(C)}function u(C){return t.deleteVertexArray(C)}function d(C,P,R){const D=R.wireframe===!0;let k=r[C.id];k===void 0&&(k={},r[C.id]=k);let U=k[P.id];U===void 0&&(U={},k[P.id]=U);let O=U[D];return O===void 0&&(O=f(l()),U[D]=O),O}function f(C){const P=[],R=[],D=[];for(let k=0;k=0){const X=k[L];let K=U[L];if(K===void 0&&(L==="instanceMatrix"&&C.instanceMatrix&&(K=C.instanceMatrix),L==="instanceColor"&&C.instanceColor&&(K=C.instanceColor)),X===void 0||X.attribute!==K||K&&X.data!==K.data)return!0;O++}return o.attributesNum!==O||o.index!==D}function y(C,P,R,D){const k={},U=P.attributes;let O=0;const W=R.getAttributes();for(const L in W)if(W[L].location>=0){let X=U[L];X===void 0&&(L==="instanceMatrix"&&C.instanceMatrix&&(X=C.instanceMatrix),L==="instanceColor"&&C.instanceColor&&(X=C.instanceColor));const K={};K.attribute=X,X&&X.data&&(K.data=X.data),k[L]=K,O++}o.attributes=k,o.attributesNum=O,o.index=D}function v(){const C=o.newAttributes;for(let P=0,R=C.length;P=0){let j=k[W];if(j===void 0&&(W==="instanceMatrix"&&C.instanceMatrix&&(j=C.instanceMatrix),W==="instanceColor"&&C.instanceColor&&(j=C.instanceColor)),j!==void 0){const X=j.normalized,K=j.itemSize,F=e.get(j);if(F===void 0)continue;const Y=F.buffer,q=F.type,ee=F.bytesPerElement,te=q===t.INT||q===t.UNSIGNED_INT||j.gpuType===HA;if(j.isInterleavedBufferAttribute){const Q=j.data,ce=Q.stride,ae=j.offset;if(Q.isInstancedInterleavedBuffer){for(let fe=0;fe0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";T="mediump"}return T==="mediump"&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=n.precision!==void 0?n.precision:"highp";const u=l(c);u!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",u,"instead."),c=u);const d=n.logarithmicDepthBuffer===!0,f=n.reverseDepthBuffer===!0&&e.has("EXT_clip_control"),p=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),y=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),v=t.getParameter(t.MAX_TEXTURE_SIZE),g=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),m=t.getParameter(t.MAX_VERTEX_ATTRIBS),x=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),b=t.getParameter(t.MAX_VARYING_VECTORS),S=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),w=y>0,E=t.getParameter(t.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:o,getMaxPrecision:l,textureFormatReadable:a,textureTypeReadable:s,precision:c,logarithmicDepthBuffer:d,reverseDepthBuffer:f,maxTextures:p,maxVertexTextures:y,maxTextureSize:v,maxCubemapSize:g,maxAttributes:m,maxVertexUniforms:x,maxVaryings:b,maxFragmentUniforms:S,vertexTextures:w,maxSamples:E}}function Jre(t){const e=this;let n=null,r=0,i=!1,o=!1;const a=new $a,s=new Rt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(d,f){const p=d.length!==0||f||r!==0||i;return i=f,r=d.length,p},this.beginShadows=function(){o=!0,u(null)},this.endShadows=function(){o=!1},this.setGlobalState=function(d,f){n=u(d,f,0)},this.setState=function(d,f,p){const y=d.clippingPlanes,v=d.clipIntersection,g=d.clipShadows,m=t.get(d);if(!i||y===null||y.length===0||o&&!g)o?u(null):c();else{const x=o?0:r,b=x*4;let S=m.clippingState||null;l.value=S,S=u(y,f,b,p);for(let w=0;w!==b;++w)S[w]=n[w];m.clippingState=S,this.numIntersection=v?this.numPlanes:0,this.numPlanes+=x}};function c(){l.value!==n&&(l.value=n,l.needsUpdate=r>0),e.numPlanes=r,e.numIntersection=0}function u(d,f,p,y){const v=d!==null?d.length:0;let g=null;if(v!==0){if(g=l.value,y!==!0||g===null){const m=p+v*4,x=f.matrixWorldInverse;s.getNormalMatrix(x),(g===null||g.length0){const c=new Eee(l.height);return c.fromEquirectangularTexture(t,a),e.set(a,c),a.addEventListener("dispose",i),n(c.texture,a.mapping)}else return null}}return a}function i(a){const s=a.target;s.removeEventListener("dispose",i);const l=e.get(s);l!==void 0&&(e.delete(s),l.dispose())}function o(){e=new WeakMap}return{get:r,dispose:o}}const Vu=4,OO=[.125,.215,.35,.446,.526,.582],Yl=20,bw=new $x,IO=new ft;let _w=null,ww=0,Sw=0,Ew=!1;const Vl=(1+Math.sqrt(5))/2,bu=1/Vl,DO=[new ne(-Vl,bu,0),new ne(Vl,bu,0),new ne(-bu,0,Vl),new ne(bu,0,Vl),new ne(0,Vl,-bu),new ne(0,Vl,bu),new ne(-1,1,-1),new ne(1,1,-1),new ne(-1,1,1),new ne(1,1,1)],Qre=new ne;class LO{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,n=0,r=.1,i=100,o={}){const{size:a=256,position:s=Qre}=o;_w=this._renderer.getRenderTarget(),ww=this._renderer.getActiveCubeFace(),Sw=this._renderer.getActiveMipmapLevel(),Ew=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(a);const l=this._allocateTargets();return l.depthBuffer=!0,this._sceneToCubeUV(e,r,i,l,s),n>0&&this._blur(l,0,0,n),this._applyPMREM(l),this._cleanup(l),l}fromEquirectangular(e,n=null){return this._fromTexture(e,n)}fromCubemap(e,n=null){return this._fromTexture(e,n)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=UO(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=jO(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?S:0,S,S),d.setRenderTarget(i),g&&d.render(v,l),d.render(e,l)}v.geometry.dispose(),v.material.dispose(),d.toneMapping=p,d.autoClear=f,e.background=m}_textureToCubeUV(e,n){const r=this._renderer,i=e.mapping===Ud||e.mapping===Fd;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=UO()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=jO());const o=i?this._cubemapMaterial:this._equirectMaterial,a=new Tn(this._lodPlanes[0],o),s=o.uniforms;s.envMap.value=e;const l=this._cubeSize;Qg(n,0,0,3*l,2*l),r.setRenderTarget(n),r.render(a,bw)}_applyPMREM(e){const n=this._renderer,r=n.autoClear;n.autoClear=!1;const i=this._lodPlanes.length;for(let o=1;oYl&&console.warn(`sigmaRadians, ${o}, is too large and will clip, as it requested ${g} samples when the maximum is set to ${Yl}`);const m=[];let x=0;for(let T=0;Tb-Vu?i-b+Vu:0),E=4*(this._cubeSize-S);Qg(n,w,E,3*S,2*S),l.setRenderTarget(n),l.render(d,bw)}}function eie(t){const e=[],n=[],r=[];let i=t;const o=t-Vu+1+OO.length;for(let a=0;at-Vu?l=OO[a-t+Vu-1]:a===0&&(l=0),r.push(l);const c=1/(s-2),u=-c,d=1+c,f=[u,u,d,u,d,d,u,u,d,d,u,d],p=6,y=6,v=3,g=2,m=1,x=new Float32Array(v*y*p),b=new Float32Array(g*y*p),S=new Float32Array(m*y*p);for(let E=0;E2?0:-1,M=[T,A,0,T+2/3,A,0,T+2/3,A+1,0,T,A,0,T+2/3,A+1,0,T,A+1,0];x.set(M,v*y*E),b.set(f,g*y*E);const C=[E,E,E,E,E,E];S.set(C,m*y*E)}const w=new br;w.setAttribute("position",new cr(x,v)),w.setAttribute("uv",new cr(b,g)),w.setAttribute("faceIndex",new cr(S,m)),e.push(w),i>Vu&&i--}return{lodPlanes:e,sizeLods:n,sigmas:r}}function kO(t,e,n){const r=new Oc(t,e,n);return r.texture.mapping=jx,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function Qg(t,e,n,r,i){t.viewport.set(e,n,r,i),t.scissor.set(e,n,r,i)}function tie(t,e,n){const r=new Float32Array(Yl),i=new ne(0,1,0);return new hl({name:"SphericalGaussianBlur",defines:{n:Yl,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:uC(),fragmentShader:` +}`,Nt={alphahash_fragment:mte,alphahash_pars_fragment:gte,alphamap_fragment:vte,alphamap_pars_fragment:yte,alphatest_fragment:xte,alphatest_pars_fragment:bte,aomap_fragment:_te,aomap_pars_fragment:wte,batching_pars_vertex:Ste,batching_vertex:Ete,begin_vertex:Tte,beginnormal_vertex:Mte,bsdfs:Ate,iridescence_fragment:Cte,bumpmap_pars_fragment:Pte,clipping_planes_fragment:Rte,clipping_planes_pars_fragment:Nte,clipping_planes_pars_vertex:Ote,clipping_planes_vertex:Ite,color_fragment:Dte,color_pars_fragment:Lte,color_pars_vertex:kte,color_vertex:jte,common:Ute,cube_uv_reflection_fragment:Fte,defaultnormal_vertex:Bte,displacementmap_pars_vertex:$te,displacementmap_vertex:zte,emissivemap_fragment:Hte,emissivemap_pars_fragment:Vte,colorspace_fragment:Gte,colorspace_pars_fragment:Wte,envmap_fragment:Xte,envmap_common_pars_fragment:qte,envmap_pars_fragment:Kte,envmap_pars_vertex:Yte,envmap_physical_pars_fragment:sne,envmap_vertex:Jte,fog_vertex:Zte,fog_pars_vertex:Qte,fog_fragment:ene,fog_pars_fragment:tne,gradientmap_pars_fragment:nne,lightmap_pars_fragment:rne,lights_lambert_fragment:ine,lights_lambert_pars_fragment:one,lights_pars_begin:ane,lights_toon_fragment:lne,lights_toon_pars_fragment:cne,lights_phong_fragment:une,lights_phong_pars_fragment:dne,lights_physical_fragment:fne,lights_physical_pars_fragment:hne,lights_fragment_begin:pne,lights_fragment_maps:mne,lights_fragment_end:gne,logdepthbuf_fragment:vne,logdepthbuf_pars_fragment:yne,logdepthbuf_pars_vertex:xne,logdepthbuf_vertex:bne,map_fragment:_ne,map_pars_fragment:wne,map_particle_fragment:Sne,map_particle_pars_fragment:Ene,metalnessmap_fragment:Tne,metalnessmap_pars_fragment:Mne,morphinstance_vertex:Ane,morphcolor_vertex:Cne,morphnormal_vertex:Pne,morphtarget_pars_vertex:Rne,morphtarget_vertex:Nne,normal_fragment_begin:One,normal_fragment_maps:Ine,normal_pars_fragment:Dne,normal_pars_vertex:Lne,normal_vertex:kne,normalmap_pars_fragment:jne,clearcoat_normal_fragment_begin:Une,clearcoat_normal_fragment_maps:Fne,clearcoat_pars_fragment:Bne,iridescence_pars_fragment:$ne,opaque_fragment:zne,packing:Hne,premultiplied_alpha_fragment:Vne,project_vertex:Gne,dithering_fragment:Wne,dithering_pars_fragment:Xne,roughnessmap_fragment:qne,roughnessmap_pars_fragment:Kne,shadowmap_pars_fragment:Yne,shadowmap_pars_vertex:Jne,shadowmap_vertex:Zne,shadowmask_pars_fragment:Qne,skinbase_vertex:ere,skinning_pars_vertex:tre,skinning_vertex:nre,skinnormal_vertex:rre,specularmap_fragment:ire,specularmap_pars_fragment:ore,tonemapping_fragment:are,tonemapping_pars_fragment:sre,transmission_fragment:lre,transmission_pars_fragment:cre,uv_pars_fragment:ure,uv_pars_vertex:dre,uv_vertex:fre,worldpos_vertex:hre,background_vert:pre,background_frag:mre,backgroundCube_vert:gre,backgroundCube_frag:vre,cube_vert:yre,cube_frag:xre,depth_vert:bre,depth_frag:_re,distanceRGBA_vert:wre,distanceRGBA_frag:Sre,equirect_vert:Ere,equirect_frag:Tre,linedashed_vert:Mre,linedashed_frag:Are,meshbasic_vert:Cre,meshbasic_frag:Pre,meshlambert_vert:Rre,meshlambert_frag:Nre,meshmatcap_vert:Ore,meshmatcap_frag:Ire,meshnormal_vert:Dre,meshnormal_frag:Lre,meshphong_vert:kre,meshphong_frag:jre,meshphysical_vert:Ure,meshphysical_frag:Fre,meshtoon_vert:Bre,meshtoon_frag:$re,points_vert:zre,points_frag:Hre,shadow_vert:Vre,shadow_frag:Gre,sprite_vert:Wre,sprite_frag:Xre},Fe={common:{diffuse:{value:new ft(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Rt},alphaMap:{value:null},alphaMapTransform:{value:new Rt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Rt}},envmap:{envMap:{value:null},envMapRotation:{value:new Rt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Rt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Rt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Rt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Rt},normalScale:{value:new xt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Rt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Rt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Rt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Rt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ft(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new ft(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Rt},alphaTest:{value:0},uvTransform:{value:new Rt}},sprite:{diffuse:{value:new ft(16777215)},opacity:{value:1},center:{value:new xt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Rt},alphaMap:{value:null},alphaMapTransform:{value:new Rt},alphaTest:{value:0}}},na={basic:{uniforms:Fr([Fe.common,Fe.specularmap,Fe.envmap,Fe.aomap,Fe.lightmap,Fe.fog]),vertexShader:Nt.meshbasic_vert,fragmentShader:Nt.meshbasic_frag},lambert:{uniforms:Fr([Fe.common,Fe.specularmap,Fe.envmap,Fe.aomap,Fe.lightmap,Fe.emissivemap,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.fog,Fe.lights,{emissive:{value:new ft(0)}}]),vertexShader:Nt.meshlambert_vert,fragmentShader:Nt.meshlambert_frag},phong:{uniforms:Fr([Fe.common,Fe.specularmap,Fe.envmap,Fe.aomap,Fe.lightmap,Fe.emissivemap,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.fog,Fe.lights,{emissive:{value:new ft(0)},specular:{value:new ft(1118481)},shininess:{value:30}}]),vertexShader:Nt.meshphong_vert,fragmentShader:Nt.meshphong_frag},standard:{uniforms:Fr([Fe.common,Fe.envmap,Fe.aomap,Fe.lightmap,Fe.emissivemap,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.roughnessmap,Fe.metalnessmap,Fe.fog,Fe.lights,{emissive:{value:new ft(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Nt.meshphysical_vert,fragmentShader:Nt.meshphysical_frag},toon:{uniforms:Fr([Fe.common,Fe.aomap,Fe.lightmap,Fe.emissivemap,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.gradientmap,Fe.fog,Fe.lights,{emissive:{value:new ft(0)}}]),vertexShader:Nt.meshtoon_vert,fragmentShader:Nt.meshtoon_frag},matcap:{uniforms:Fr([Fe.common,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.fog,{matcap:{value:null}}]),vertexShader:Nt.meshmatcap_vert,fragmentShader:Nt.meshmatcap_frag},points:{uniforms:Fr([Fe.points,Fe.fog]),vertexShader:Nt.points_vert,fragmentShader:Nt.points_frag},dashed:{uniforms:Fr([Fe.common,Fe.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Nt.linedashed_vert,fragmentShader:Nt.linedashed_frag},depth:{uniforms:Fr([Fe.common,Fe.displacementmap]),vertexShader:Nt.depth_vert,fragmentShader:Nt.depth_frag},normal:{uniforms:Fr([Fe.common,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,{opacity:{value:1}}]),vertexShader:Nt.meshnormal_vert,fragmentShader:Nt.meshnormal_frag},sprite:{uniforms:Fr([Fe.sprite,Fe.fog]),vertexShader:Nt.sprite_vert,fragmentShader:Nt.sprite_frag},background:{uniforms:{uvTransform:{value:new Rt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Nt.background_vert,fragmentShader:Nt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Rt}},vertexShader:Nt.backgroundCube_vert,fragmentShader:Nt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Nt.cube_vert,fragmentShader:Nt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Nt.equirect_vert,fragmentShader:Nt.equirect_frag},distanceRGBA:{uniforms:Fr([Fe.common,Fe.displacementmap,{referencePosition:{value:new ne},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Nt.distanceRGBA_vert,fragmentShader:Nt.distanceRGBA_frag},shadow:{uniforms:Fr([Fe.lights,Fe.fog,{color:{value:new ft(0)},opacity:{value:1}}]),vertexShader:Nt.shadow_vert,fragmentShader:Nt.shadow_frag}};na.physical={uniforms:Fr([na.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Rt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Rt},clearcoatNormalScale:{value:new xt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Rt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Rt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Rt},sheen:{value:0},sheenColor:{value:new ft(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Rt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Rt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Rt},transmissionSamplerSize:{value:new xt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Rt},attenuationDistance:{value:0},attenuationColor:{value:new ft(0)},specularColor:{value:new ft(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Rt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Rt},anisotropyVector:{value:new xt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Rt}}]),vertexShader:Nt.meshphysical_vert,fragmentShader:Nt.meshphysical_frag};const Zg={r:0,b:0,g:0},jl=new pi,qre=new gt;function Kre(t,e,n,r,i,o,a){const s=new ft(0);let l=o===!0?0:1,c,u,d=null,f=0,p=null;function y(b){let S=b.isScene===!0?b.background:null;return S&&S.isTexture&&(S=(b.backgroundBlurriness>0?n:e).get(S)),S}function v(b){let S=!1;const w=y(b);w===null?m(s,l):w&&w.isColor&&(m(w,1),S=!0);const E=t.xr.getEnvironmentBlendMode();E==="additive"?r.buffers.color.setClear(0,0,0,1,a):E==="alpha-blend"&&r.buffers.color.setClear(0,0,0,0,a),(t.autoClear||S)&&(r.buffers.depth.setTest(!0),r.buffers.depth.setMask(!0),r.buffers.color.setMask(!0),t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil))}function g(b,S){const w=y(S);w&&(w.isCubeTexture||w.mapping===jx)?(u===void 0&&(u=new Tn(new Gc(1,1,1),new hl({name:"BackgroundCubeMaterial",uniforms:$d(na.backgroundCube.uniforms),vertexShader:na.backgroundCube.vertexShader,fragmentShader:na.backgroundCube.fragmentShader,side:ui,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(E,T,A){this.matrixWorld.copyPosition(A.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(u)),jl.copy(S.backgroundRotation),jl.x*=-1,jl.y*=-1,jl.z*=-1,w.isCubeTexture&&w.isRenderTargetTexture===!1&&(jl.y*=-1,jl.z*=-1),u.material.uniforms.envMap.value=w,u.material.uniforms.flipEnvMap.value=w.isCubeTexture&&w.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=S.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=S.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(qre.makeRotationFromEuler(jl)),u.material.toneMapped=Dt.getTransfer(w.colorSpace)!==an,(d!==w||f!==w.version||p!==t.toneMapping)&&(u.material.needsUpdate=!0,d=w,f=w.version,p=t.toneMapping),u.layers.enableAll(),b.unshift(u,u.geometry,u.material,0,0,null)):w&&w.isTexture&&(c===void 0&&(c=new Tn(new Im(2,2),new hl({name:"BackgroundMaterial",uniforms:$d(na.background.uniforms),vertexShader:na.background.vertexShader,fragmentShader:na.background.fragmentShader,side:ba,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(c)),c.material.uniforms.t2D.value=w,c.material.uniforms.backgroundIntensity.value=S.backgroundIntensity,c.material.toneMapped=Dt.getTransfer(w.colorSpace)!==an,w.matrixAutoUpdate===!0&&w.updateMatrix(),c.material.uniforms.uvTransform.value.copy(w.matrix),(d!==w||f!==w.version||p!==t.toneMapping)&&(c.material.needsUpdate=!0,d=w,f=w.version,p=t.toneMapping),c.layers.enableAll(),b.unshift(c,c.geometry,c.material,0,0,null))}function m(b,S){b.getRGB(Zg,$4(t)),r.buffers.color.setClear(Zg.r,Zg.g,Zg.b,S,a)}function x(){u!==void 0&&(u.geometry.dispose(),u.material.dispose(),u=void 0),c!==void 0&&(c.geometry.dispose(),c.material.dispose(),c=void 0)}return{getClearColor:function(){return s},setClearColor:function(b,S=1){s.set(b),l=S,m(s,l)},getClearAlpha:function(){return l},setClearAlpha:function(b){l=b,m(s,l)},render:v,addToRenderList:g,dispose:x}}function Yre(t,e){const n=t.getParameter(t.MAX_VERTEX_ATTRIBS),r={},i=f(null);let o=i,a=!1;function s(C,P,R,D,k){let U=!1;const O=d(D,R,P);o!==O&&(o=O,c(o.object)),U=p(C,D,R,k),U&&y(C,D,R,k),k!==null&&e.update(k,t.ELEMENT_ARRAY_BUFFER),(U||a)&&(a=!1,S(C,P,R,D),k!==null&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e.get(k).buffer))}function l(){return t.createVertexArray()}function c(C){return t.bindVertexArray(C)}function u(C){return t.deleteVertexArray(C)}function d(C,P,R){const D=R.wireframe===!0;let k=r[C.id];k===void 0&&(k={},r[C.id]=k);let U=k[P.id];U===void 0&&(U={},k[P.id]=U);let O=U[D];return O===void 0&&(O=f(l()),U[D]=O),O}function f(C){const P=[],R=[],D=[];for(let k=0;k=0){const K=k[L];let te=U[L];if(te===void 0&&(L==="instanceMatrix"&&C.instanceMatrix&&(te=C.instanceMatrix),L==="instanceColor"&&C.instanceColor&&(te=C.instanceColor)),K===void 0||K.attribute!==te||te&&K.data!==te.data)return!0;O++}return o.attributesNum!==O||o.index!==D}function y(C,P,R,D){const k={},U=P.attributes;let O=0;const X=R.getAttributes();for(const L in X)if(X[L].location>=0){let K=U[L];K===void 0&&(L==="instanceMatrix"&&C.instanceMatrix&&(K=C.instanceMatrix),L==="instanceColor"&&C.instanceColor&&(K=C.instanceColor));const te={};te.attribute=K,K&&K.data&&(te.data=K.data),k[L]=te,O++}o.attributes=k,o.attributesNum=O,o.index=D}function v(){const C=o.newAttributes;for(let P=0,R=C.length;P=0){let j=k[X];if(j===void 0&&(X==="instanceMatrix"&&C.instanceMatrix&&(j=C.instanceMatrix),X==="instanceColor"&&C.instanceColor&&(j=C.instanceColor)),j!==void 0){const K=j.normalized,te=j.itemSize,H=e.get(j);if(H===void 0)continue;const q=H.buffer,$=H.type,Y=H.bytesPerElement,ee=$===t.INT||$===t.UNSIGNED_INT||j.gpuType===VA;if(j.isInterleavedBufferAttribute){const J=j.data,ce=J.stride,ae=j.offset;if(J.isInstancedInterleavedBuffer){for(let fe=0;fe0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";T="mediump"}return T==="mediump"&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=n.precision!==void 0?n.precision:"highp";const u=l(c);u!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",u,"instead."),c=u);const d=n.logarithmicDepthBuffer===!0,f=n.reverseDepthBuffer===!0&&e.has("EXT_clip_control"),p=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),y=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),v=t.getParameter(t.MAX_TEXTURE_SIZE),g=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),m=t.getParameter(t.MAX_VERTEX_ATTRIBS),x=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),b=t.getParameter(t.MAX_VARYING_VECTORS),S=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),w=y>0,E=t.getParameter(t.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:o,getMaxPrecision:l,textureFormatReadable:a,textureTypeReadable:s,precision:c,logarithmicDepthBuffer:d,reverseDepthBuffer:f,maxTextures:p,maxVertexTextures:y,maxTextureSize:v,maxCubemapSize:g,maxAttributes:m,maxVertexUniforms:x,maxVaryings:b,maxFragmentUniforms:S,vertexTextures:w,maxSamples:E}}function Qre(t){const e=this;let n=null,r=0,i=!1,o=!1;const a=new $a,s=new Rt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(d,f){const p=d.length!==0||f||r!==0||i;return i=f,r=d.length,p},this.beginShadows=function(){o=!0,u(null)},this.endShadows=function(){o=!1},this.setGlobalState=function(d,f){n=u(d,f,0)},this.setState=function(d,f,p){const y=d.clippingPlanes,v=d.clipIntersection,g=d.clipShadows,m=t.get(d);if(!i||y===null||y.length===0||o&&!g)o?u(null):c();else{const x=o?0:r,b=x*4;let S=m.clippingState||null;l.value=S,S=u(y,f,b,p);for(let w=0;w!==b;++w)S[w]=n[w];m.clippingState=S,this.numIntersection=v?this.numPlanes:0,this.numPlanes+=x}};function c(){l.value!==n&&(l.value=n,l.needsUpdate=r>0),e.numPlanes=r,e.numIntersection=0}function u(d,f,p,y){const v=d!==null?d.length:0;let g=null;if(v!==0){if(g=l.value,y!==!0||g===null){const m=p+v*4,x=f.matrixWorldInverse;s.getNormalMatrix(x),(g===null||g.length0){const c=new Mee(l.height);return c.fromEquirectangularTexture(t,a),e.set(a,c),a.addEventListener("dispose",i),n(c.texture,a.mapping)}else return null}}return a}function i(a){const s=a.target;s.removeEventListener("dispose",i);const l=e.get(s);l!==void 0&&(e.delete(s),l.dispose())}function o(){e=new WeakMap}return{get:r,dispose:o}}const Vu=4,IO=[.125,.215,.35,.446,.526,.582],Yl=20,bw=new $x,DO=new ft;let _w=null,ww=0,Sw=0,Ew=!1;const Vl=(1+Math.sqrt(5))/2,bu=1/Vl,LO=[new ne(-Vl,bu,0),new ne(Vl,bu,0),new ne(-bu,0,Vl),new ne(bu,0,Vl),new ne(0,Vl,-bu),new ne(0,Vl,bu),new ne(-1,1,-1),new ne(1,1,-1),new ne(-1,1,1),new ne(1,1,1)],tie=new ne;class kO{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,n=0,r=.1,i=100,o={}){const{size:a=256,position:s=tie}=o;_w=this._renderer.getRenderTarget(),ww=this._renderer.getActiveCubeFace(),Sw=this._renderer.getActiveMipmapLevel(),Ew=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(a);const l=this._allocateTargets();return l.depthBuffer=!0,this._sceneToCubeUV(e,r,i,l,s),n>0&&this._blur(l,0,0,n),this._applyPMREM(l),this._cleanup(l),l}fromEquirectangular(e,n=null){return this._fromTexture(e,n)}fromCubemap(e,n=null){return this._fromTexture(e,n)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=FO(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=UO(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?S:0,S,S),d.setRenderTarget(i),g&&d.render(v,l),d.render(e,l)}v.geometry.dispose(),v.material.dispose(),d.toneMapping=p,d.autoClear=f,e.background=m}_textureToCubeUV(e,n){const r=this._renderer,i=e.mapping===Ud||e.mapping===Fd;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=FO()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=UO());const o=i?this._cubemapMaterial:this._equirectMaterial,a=new Tn(this._lodPlanes[0],o),s=o.uniforms;s.envMap.value=e;const l=this._cubeSize;Qg(n,0,0,3*l,2*l),r.setRenderTarget(n),r.render(a,bw)}_applyPMREM(e){const n=this._renderer,r=n.autoClear;n.autoClear=!1;const i=this._lodPlanes.length;for(let o=1;oYl&&console.warn(`sigmaRadians, ${o}, is too large and will clip, as it requested ${g} samples when the maximum is set to ${Yl}`);const m=[];let x=0;for(let T=0;Tb-Vu?i-b+Vu:0),E=4*(this._cubeSize-S);Qg(n,w,E,3*S,2*S),l.setRenderTarget(n),l.render(d,bw)}}function nie(t){const e=[],n=[],r=[];let i=t;const o=t-Vu+1+IO.length;for(let a=0;at-Vu?l=IO[a-t+Vu-1]:a===0&&(l=0),r.push(l);const c=1/(s-2),u=-c,d=1+c,f=[u,u,d,u,d,d,u,u,d,d,u,d],p=6,y=6,v=3,g=2,m=1,x=new Float32Array(v*y*p),b=new Float32Array(g*y*p),S=new Float32Array(m*y*p);for(let E=0;E2?0:-1,M=[T,A,0,T+2/3,A,0,T+2/3,A+1,0,T,A,0,T+2/3,A+1,0,T,A+1,0];x.set(M,v*y*E),b.set(f,g*y*E);const C=[E,E,E,E,E,E];S.set(C,m*y*E)}const w=new br;w.setAttribute("position",new cr(x,v)),w.setAttribute("uv",new cr(b,g)),w.setAttribute("faceIndex",new cr(S,m)),e.push(w),i>Vu&&i--}return{lodPlanes:e,sizeLods:n,sigmas:r}}function jO(t,e,n){const r=new Oc(t,e,n);return r.texture.mapping=jx,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function Qg(t,e,n,r,i){t.viewport.set(e,n,r,i),t.scissor.set(e,n,r,i)}function rie(t,e,n){const r=new Float32Array(Yl),i=new ne(0,1,0);return new hl({name:"SphericalGaussianBlur",defines:{n:Yl,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:dC(),fragmentShader:` precision mediump float; precision mediump int; @@ -3982,7 +3987,7 @@ void main() { } } - `,blending:tl,depthTest:!1,depthWrite:!1})}function jO(){return new hl({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:uC(),fragmentShader:` + `,blending:tl,depthTest:!1,depthWrite:!1})}function UO(){return new hl({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:dC(),fragmentShader:` precision mediump float; precision mediump int; @@ -4001,7 +4006,7 @@ void main() { gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); } - `,blending:tl,depthTest:!1,depthWrite:!1})}function UO(){return new hl({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:uC(),fragmentShader:` + `,blending:tl,depthTest:!1,depthWrite:!1})}function FO(){return new hl({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:dC(),fragmentShader:` precision mediump float; precision mediump int; @@ -4017,7 +4022,7 @@ void main() { gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); } - `,blending:tl,depthTest:!1,depthWrite:!1})}function uC(){return` + `,blending:tl,depthTest:!1,depthWrite:!1})}function dC(){return` precision mediump float; precision mediump int; @@ -4072,17 +4077,17 @@ void main() { gl_Position = vec4( position, 1.0 ); } - `}function nie(t){let e=new WeakMap,n=null;function r(s){if(s&&s.isTexture){const l=s.mapping,c=l===FE||l===BE,u=l===Ud||l===Fd;if(c||u){let d=e.get(s);const f=d!==void 0?d.texture.pmremVersion:0;if(s.isRenderTargetTexture&&s.pmremVersion!==f)return n===null&&(n=new LO(t)),d=c?n.fromEquirectangular(s,d):n.fromCubemap(s,d),d.texture.pmremVersion=s.pmremVersion,e.set(s,d),d.texture;if(d!==void 0)return d.texture;{const p=s.image;return c&&p&&p.height>0||u&&p&&i(p)?(n===null&&(n=new LO(t)),d=c?n.fromEquirectangular(s):n.fromCubemap(s),d.texture.pmremVersion=s.pmremVersion,e.set(s,d),s.addEventListener("dispose",o),d.texture):null}}}return s}function i(s){let l=0;const c=6;for(let u=0;ue.maxTextureSize&&(E=Math.ceil(w/e.maxTextureSize),w=e.maxTextureSize);const T=new Float32Array(w*E*4*d),A=new L4(T,w,E,d);A.type=Io,A.needsUpdate=!0;const M=S*4;for(let P=0;P0)return t;const i=e*n;let o=BO[i];if(o===void 0&&(o=new Float32Array(i),BO[i]=o),e!==0){r.toArray(o,0);for(let a=1,s=0;a!==e;++a)s+=n,t[a].toArray(o,s)}return o}function Zn(t,e){if(t.length!==e.length)return!1;for(let n=0,r=t.length;n0||u&&p&&i(p)?(n===null&&(n=new kO(t)),d=c?n.fromEquirectangular(s):n.fromCubemap(s),d.texture.pmremVersion=s.pmremVersion,e.set(s,d),s.addEventListener("dispose",o),d.texture):null}}}return s}function i(s){let l=0;const c=6;for(let u=0;ue.maxTextureSize&&(E=Math.ceil(w/e.maxTextureSize),w=e.maxTextureSize);const T=new Float32Array(w*E*4*d),A=new j4(T,w,E,d);A.type=Do,A.needsUpdate=!0;const M=S*4;for(let P=0;P0)return t;const i=e*n;let o=$O[i];if(o===void 0&&(o=new Float32Array(i),$O[i]=o),e!==0){r.toArray(o,0);for(let a=1,s=0;a!==e;++a)s+=n,t[a].toArray(o,s)}return o}function Zn(t,e){if(t.length!==e.length)return!1;for(let n=0,r=t.length;n":" "} ${s}: ${n[a]}`)}return r.join(` -`)}const XO=new Rt;function noe(t){Dt._getMatrix(XO,Dt.workingColorSpace,t);const e=`mat3( ${XO.elements.map(n=>n.toFixed(4))} )`;switch(Dt.getTransfer(t)){case Ry:return[e,"LinearTransferOETF"];case an:return[e,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",t),[e,"LinearTransferOETF"]}}function qO(t,e,n){const r=t.getShaderParameter(e,t.COMPILE_STATUS),i=t.getShaderInfoLog(e).trim();if(r&&i==="")return"";const o=/ERROR: 0:(\d+)/.exec(i);if(o){const a=parseInt(o[1]);return n.toUpperCase()+` +`)}const qO=new Rt;function ioe(t){Dt._getMatrix(qO,Dt.workingColorSpace,t);const e=`mat3( ${qO.elements.map(n=>n.toFixed(4))} )`;switch(Dt.getTransfer(t)){case Ry:return[e,"LinearTransferOETF"];case an:return[e,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",t),[e,"LinearTransferOETF"]}}function KO(t,e,n){const r=t.getShaderParameter(e,t.COMPILE_STATUS),i=t.getShaderInfoLog(e).trim();if(r&&i==="")return"";const o=/ERROR: 0:(\d+)/.exec(i);if(o){const a=parseInt(o[1]);return n.toUpperCase()+` `+i+` -`+toe(t.getShaderSource(e),a)}else return i}function roe(t,e){const n=noe(e);return[`vec4 ${t}( vec4 value ) {`,` return ${n[1]}( vec4( value.rgb * ${n[0]}, value.a ) );`,"}"].join(` -`)}function ioe(t,e){let n;switch(e){case gQ:n="Linear";break;case vQ:n="Reinhard";break;case yQ:n="Cineon";break;case xQ:n="ACESFilmic";break;case _Q:n="AgX";break;case wQ:n="Neutral";break;case bQ:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}const ev=new ne;function ooe(){Dt.getLuminanceCoefficients(ev);const t=ev.x.toFixed(4),e=ev.y.toFixed(4),n=ev.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${t}, ${e}, ${n} );`," return dot( weights, rgb );","}"].join(` -`)}function aoe(t){return[t.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",t.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Ph).join(` -`)}function soe(t){const e=[];for(const n in t){const r=t[n];r!==!1&&e.push("#define "+n+" "+r)}return e.join(` -`)}function loe(t,e){const n={},r=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let i=0;i/gm;function x1(t){return t.replace(coe,doe)}const uoe=new Map;function doe(t,e){let n=Nt[e];if(n===void 0){const r=uoe.get(e);if(r!==void 0)n=Nt[r],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,r);else throw new Error("Can not resolve #include <"+e+">")}return x1(n)}const foe=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function JO(t){return t.replace(foe,hoe)}function hoe(t,e,n,r){let i="";for(let o=parseInt(e);o/gm;function x1(t){return t.replace(doe,hoe)}const foe=new Map;function hoe(t,e){let n=Nt[e];if(n===void 0){const r=foe.get(e);if(r!==void 0)n=Nt[r],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,r);else throw new Error("Can not resolve #include <"+e+">")}return x1(n)}const poe=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function ZO(t){return t.replace(poe,moe)}function moe(t,e,n,r){let i="";for(let o=parseInt(e);o0&&(g+=` `),m=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,y].filter(Ph).join(` `),m.length>0&&(m+=` -`)):(g=[ZO(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,y,n.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",n.batching?"#define USE_BATCHING":"",n.batchingColor?"#define USE_BATCHING_COLOR":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.instancingMorph?"#define USE_INSTANCING_MORPH":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&n.flatShading===!1?"#define USE_MORPHNORMALS":"",n.morphColors?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` +`)):(g=[QO(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,y,n.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",n.batching?"#define USE_BATCHING":"",n.batchingColor?"#define USE_BATCHING_COLOR":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.instancingMorph?"#define USE_INSTANCING_MORPH":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&n.flatShading===!1?"#define USE_MORPHNORMALS":"",n.morphColors?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` `].filter(Ph).join(` -`),m=[ZO(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,y,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.envMap?"#define "+u:"",n.envMap?"#define "+d:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.dispersion?"#define USE_DISPERSION":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor||n.batchingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==nl?"#define TONE_MAPPING":"",n.toneMapping!==nl?Nt.tonemapping_pars_fragment:"",n.toneMapping!==nl?ioe("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",Nt.colorspace_pars_fragment,roe("linearToOutputTexel",n.outputColorSpace),ooe(),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"",` +`),m=[QO(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,y,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.envMap?"#define "+u:"",n.envMap?"#define "+d:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.dispersion?"#define USE_DISPERSION":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor||n.batchingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==nl?"#define TONE_MAPPING":"",n.toneMapping!==nl?Nt.tonemapping_pars_fragment:"",n.toneMapping!==nl?aoe("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",Nt.colorspace_pars_fragment,ooe("linearToOutputTexel",n.outputColorSpace),soe(),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"",` `].filter(Ph).join(` -`)),a=x1(a),a=KO(a,n),a=YO(a,n),s=x1(s),s=KO(s,n),s=YO(s,n),a=JO(a),s=JO(s),n.isRawShaderMaterial!==!0&&(x=`#version 300 es +`)),a=x1(a),a=YO(a,n),a=JO(a,n),s=x1(s),s=YO(s,n),s=JO(s,n),a=ZO(a),s=ZO(s),n.isRawShaderMaterial!==!0&&(x=`#version 300 es `,g=[p,"#define attribute in","#define varying out","#define texture2D texture"].join(` `)+` -`+g,m=["#define varying in",n.glslVersion===GN?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===GN?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` +`+g,m=["#define varying in",n.glslVersion===WN?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===WN?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` `)+` -`+m);const b=x+g+a,S=x+m+s,w=WO(i,i.VERTEX_SHADER,b),E=WO(i,i.FRAGMENT_SHADER,S);i.attachShader(v,w),i.attachShader(v,E),n.index0AttributeName!==void 0?i.bindAttribLocation(v,0,n.index0AttributeName):n.morphTargets===!0&&i.bindAttribLocation(v,0,"position"),i.linkProgram(v);function T(P){if(t.debug.checkShaderErrors){const R=i.getProgramInfoLog(v).trim(),D=i.getShaderInfoLog(w).trim(),k=i.getShaderInfoLog(E).trim();let U=!0,O=!0;if(i.getProgramParameter(v,i.LINK_STATUS)===!1)if(U=!1,typeof t.debug.onShaderError=="function")t.debug.onShaderError(i,v,w,E);else{const W=qO(i,w,"vertex"),L=qO(i,E,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(v,i.VALIDATE_STATUS)+` +`+m);const b=x+g+a,S=x+m+s,w=XO(i,i.VERTEX_SHADER,b),E=XO(i,i.FRAGMENT_SHADER,S);i.attachShader(v,w),i.attachShader(v,E),n.index0AttributeName!==void 0?i.bindAttribLocation(v,0,n.index0AttributeName):n.morphTargets===!0&&i.bindAttribLocation(v,0,"position"),i.linkProgram(v);function T(P){if(t.debug.checkShaderErrors){const R=i.getProgramInfoLog(v).trim(),D=i.getShaderInfoLog(w).trim(),k=i.getShaderInfoLog(E).trim();let U=!0,O=!0;if(i.getProgramParameter(v,i.LINK_STATUS)===!1)if(U=!1,typeof t.debug.onShaderError=="function")t.debug.onShaderError(i,v,w,E);else{const X=KO(i,w,"vertex"),L=KO(i,E,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(v,i.VALIDATE_STATUS)+` Material Name: `+P.name+` Material Type: `+P.type+` Program Info Log: `+R+` -`+W+` -`+L)}else R!==""?console.warn("THREE.WebGLProgram: Program Info Log:",R):(D===""||k==="")&&(O=!1);O&&(P.diagnostics={runnable:U,programLog:R,vertexShader:{log:D,prefix:g},fragmentShader:{log:k,prefix:m}})}i.deleteShader(w),i.deleteShader(E),A=new qv(i,v),M=loe(i,v)}let A;this.getUniforms=function(){return A===void 0&&T(this),A};let M;this.getAttributes=function(){return M===void 0&&T(this),M};let C=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return C===!1&&(C=i.getProgramParameter(v,Qie)),C},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(v),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=eoe++,this.cacheKey=e,this.usedTimes=1,this.program=v,this.vertexShader=w,this.fragmentShader=E,this}let boe=0;class _oe{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const n=e.vertexShader,r=e.fragmentShader,i=this._getShaderStage(n),o=this._getShaderStage(r),a=this._getShaderCacheForMaterial(e);return a.has(i)===!1&&(a.add(i),i.usedTimes++),a.has(o)===!1&&(a.add(o),o.usedTimes++),this}remove(e){const n=this.materialCache.get(e);for(const r of n)r.usedTimes--,r.usedTimes===0&&this.shaderCache.delete(r.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const n=this.materialCache;let r=n.get(e);return r===void 0&&(r=new Set,n.set(e,r)),r}_getShaderStage(e){const n=this.shaderCache;let r=n.get(e);return r===void 0&&(r=new woe(e),n.set(e,r)),r}}class woe{constructor(e){this.id=boe++,this.code=e,this.usedTimes=0}}function Soe(t,e,n,r,i,o,a){const s=new ZA,l=new _oe,c=new Set,u=[],d=i.logarithmicDepthBuffer,f=i.vertexTextures;let p=i.precision;const y={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function v(M){return c.add(M),M===0?"uv":`uv${M}`}function g(M,C,P,R,D){const k=R.fog,U=D.geometry,O=M.isMeshStandardMaterial?R.environment:null,W=(M.isMeshStandardMaterial?n:e).get(M.envMap||O),L=W&&W.mapping===jx?W.image.height:null,j=y[M.type];M.precision!==null&&(p=i.getMaxPrecision(M.precision),p!==M.precision&&console.warn("THREE.WebGLProgram.getParameters:",M.precision,"not supported, using",p,"instead."));const X=U.morphAttributes.position||U.morphAttributes.normal||U.morphAttributes.color,K=X!==void 0?X.length:0;let F=0;U.morphAttributes.position!==void 0&&(F=1),U.morphAttributes.normal!==void 0&&(F=2),U.morphAttributes.color!==void 0&&(F=3);let Y,q,ee,te;if(j){const pt=na[j];Y=pt.vertexShader,q=pt.fragmentShader}else Y=M.vertexShader,q=M.fragmentShader,l.update(M),ee=l.getVertexShaderID(M),te=l.getFragmentShaderID(M);const Q=t.getRenderTarget(),ce=t.state.buffers.depth.getReversed(),ae=D.isInstancedMesh===!0,fe=D.isBatchedMesh===!0,we=!!M.map,le=!!M.matcap,ie=!!W,G=!!M.aoMap,Ve=!!M.lightMap,Ne=!!M.bumpMap,st=!!M.normalMap,Re=!!M.displacementMap,ct=!!M.emissiveMap,Ye=!!M.metalnessMap,it=!!M.roughnessMap,Ft=M.anisotropy>0,J=M.clearcoat>0,B=M.dispersion>0,ue=M.iridescence>0,me=M.sheen>0,be=M.transmission>0,ge=Ft&&!!M.anisotropyMap,rt=J&&!!M.clearcoatMap,Ie=J&&!!M.clearcoatNormalMap,Je=J&&!!M.clearcoatRoughnessMap,tt=ue&&!!M.iridescenceMap,Ee=ue&&!!M.iridescenceThicknessMap,Be=me&&!!M.sheenColorMap,ht=me&&!!M.sheenRoughnessMap,ot=!!M.specularMap,Le=!!M.specularColorMap,_t=!!M.specularIntensityMap,re=be&&!!M.transmissionMap,ke=be&&!!M.thicknessMap,Me=!!M.gradientMap,Ge=!!M.alphaMap,Te=M.alphaTest>0,_e=!!M.alphaHash,Se=!!M.extensions;let je=nl;M.toneMapped&&(Q===null||Q.isXRRenderTarget===!0)&&(je=t.toneMapping);const vt={shaderID:j,shaderType:M.type,shaderName:M.name,vertexShader:Y,fragmentShader:q,defines:M.defines,customVertexShaderID:ee,customFragmentShaderID:te,isRawShaderMaterial:M.isRawShaderMaterial===!0,glslVersion:M.glslVersion,precision:p,batching:fe,batchingColor:fe&&D._colorsTexture!==null,instancing:ae,instancingColor:ae&&D.instanceColor!==null,instancingMorph:ae&&D.morphTexture!==null,supportsVertexTextures:f,outputColorSpace:Q===null?t.outputColorSpace:Q.isXRRenderTarget===!0?Q.texture.colorSpace:Kr,alphaToCoverage:!!M.alphaToCoverage,map:we,matcap:le,envMap:ie,envMapMode:ie&&W.mapping,envMapCubeUVHeight:L,aoMap:G,lightMap:Ve,bumpMap:Ne,normalMap:st,displacementMap:f&&Re,emissiveMap:ct,normalMapObjectSpace:st&&M.normalMapType===CQ,normalMapTangentSpace:st&&M.normalMapType===Ux,metalnessMap:Ye,roughnessMap:it,anisotropy:Ft,anisotropyMap:ge,clearcoat:J,clearcoatMap:rt,clearcoatNormalMap:Ie,clearcoatRoughnessMap:Je,dispersion:B,iridescence:ue,iridescenceMap:tt,iridescenceThicknessMap:Ee,sheen:me,sheenColorMap:Be,sheenRoughnessMap:ht,specularMap:ot,specularColorMap:Le,specularIntensityMap:_t,transmission:be,transmissionMap:re,thicknessMap:ke,gradientMap:Me,opaque:M.transparent===!1&&M.blending===sd&&M.alphaToCoverage===!1,alphaMap:Ge,alphaTest:Te,alphaHash:_e,combine:M.combine,mapUv:we&&v(M.map.channel),aoMapUv:G&&v(M.aoMap.channel),lightMapUv:Ve&&v(M.lightMap.channel),bumpMapUv:Ne&&v(M.bumpMap.channel),normalMapUv:st&&v(M.normalMap.channel),displacementMapUv:Re&&v(M.displacementMap.channel),emissiveMapUv:ct&&v(M.emissiveMap.channel),metalnessMapUv:Ye&&v(M.metalnessMap.channel),roughnessMapUv:it&&v(M.roughnessMap.channel),anisotropyMapUv:ge&&v(M.anisotropyMap.channel),clearcoatMapUv:rt&&v(M.clearcoatMap.channel),clearcoatNormalMapUv:Ie&&v(M.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Je&&v(M.clearcoatRoughnessMap.channel),iridescenceMapUv:tt&&v(M.iridescenceMap.channel),iridescenceThicknessMapUv:Ee&&v(M.iridescenceThicknessMap.channel),sheenColorMapUv:Be&&v(M.sheenColorMap.channel),sheenRoughnessMapUv:ht&&v(M.sheenRoughnessMap.channel),specularMapUv:ot&&v(M.specularMap.channel),specularColorMapUv:Le&&v(M.specularColorMap.channel),specularIntensityMapUv:_t&&v(M.specularIntensityMap.channel),transmissionMapUv:re&&v(M.transmissionMap.channel),thicknessMapUv:ke&&v(M.thicknessMap.channel),alphaMapUv:Ge&&v(M.alphaMap.channel),vertexTangents:!!U.attributes.tangent&&(st||Ft),vertexColors:M.vertexColors,vertexAlphas:M.vertexColors===!0&&!!U.attributes.color&&U.attributes.color.itemSize===4,pointsUvs:D.isPoints===!0&&!!U.attributes.uv&&(we||Ge),fog:!!k,useFog:M.fog===!0,fogExp2:!!k&&k.isFogExp2,flatShading:M.flatShading===!0,sizeAttenuation:M.sizeAttenuation===!0,logarithmicDepthBuffer:d,reverseDepthBuffer:ce,skinning:D.isSkinnedMesh===!0,morphTargets:U.morphAttributes.position!==void 0,morphNormals:U.morphAttributes.normal!==void 0,morphColors:U.morphAttributes.color!==void 0,morphTargetsCount:K,morphTextureStride:F,numDirLights:C.directional.length,numPointLights:C.point.length,numSpotLights:C.spot.length,numSpotLightMaps:C.spotLightMap.length,numRectAreaLights:C.rectArea.length,numHemiLights:C.hemi.length,numDirLightShadows:C.directionalShadowMap.length,numPointLightShadows:C.pointShadowMap.length,numSpotLightShadows:C.spotShadowMap.length,numSpotLightShadowsWithMaps:C.numSpotLightShadowsWithMaps,numLightProbes:C.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:M.dithering,shadowMapEnabled:t.shadowMap.enabled&&P.length>0,shadowMapType:t.shadowMap.type,toneMapping:je,decodeVideoTexture:we&&M.map.isVideoTexture===!0&&Dt.getTransfer(M.map.colorSpace)===an,decodeVideoTextureEmissive:ct&&M.emissiveMap.isVideoTexture===!0&&Dt.getTransfer(M.emissiveMap.colorSpace)===an,premultipliedAlpha:M.premultipliedAlpha,doubleSided:M.side===Ki,flipSided:M.side===ui,useDepthPacking:M.depthPacking>=0,depthPacking:M.depthPacking||0,index0AttributeName:M.index0AttributeName,extensionClipCullDistance:Se&&M.extensions.clipCullDistance===!0&&r.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Se&&M.extensions.multiDraw===!0||fe)&&r.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:r.has("KHR_parallel_shader_compile"),customProgramCacheKey:M.customProgramCacheKey()};return vt.vertexUv1s=c.has(1),vt.vertexUv2s=c.has(2),vt.vertexUv3s=c.has(3),c.clear(),vt}function m(M){const C=[];if(M.shaderID?C.push(M.shaderID):(C.push(M.customVertexShaderID),C.push(M.customFragmentShaderID)),M.defines!==void 0)for(const P in M.defines)C.push(P),C.push(M.defines[P]);return M.isRawShaderMaterial===!1&&(x(C,M),b(C,M),C.push(t.outputColorSpace)),C.push(M.customProgramCacheKey),C.join()}function x(M,C){M.push(C.precision),M.push(C.outputColorSpace),M.push(C.envMapMode),M.push(C.envMapCubeUVHeight),M.push(C.mapUv),M.push(C.alphaMapUv),M.push(C.lightMapUv),M.push(C.aoMapUv),M.push(C.bumpMapUv),M.push(C.normalMapUv),M.push(C.displacementMapUv),M.push(C.emissiveMapUv),M.push(C.metalnessMapUv),M.push(C.roughnessMapUv),M.push(C.anisotropyMapUv),M.push(C.clearcoatMapUv),M.push(C.clearcoatNormalMapUv),M.push(C.clearcoatRoughnessMapUv),M.push(C.iridescenceMapUv),M.push(C.iridescenceThicknessMapUv),M.push(C.sheenColorMapUv),M.push(C.sheenRoughnessMapUv),M.push(C.specularMapUv),M.push(C.specularColorMapUv),M.push(C.specularIntensityMapUv),M.push(C.transmissionMapUv),M.push(C.thicknessMapUv),M.push(C.combine),M.push(C.fogExp2),M.push(C.sizeAttenuation),M.push(C.morphTargetsCount),M.push(C.morphAttributeCount),M.push(C.numDirLights),M.push(C.numPointLights),M.push(C.numSpotLights),M.push(C.numSpotLightMaps),M.push(C.numHemiLights),M.push(C.numRectAreaLights),M.push(C.numDirLightShadows),M.push(C.numPointLightShadows),M.push(C.numSpotLightShadows),M.push(C.numSpotLightShadowsWithMaps),M.push(C.numLightProbes),M.push(C.shadowMapType),M.push(C.toneMapping),M.push(C.numClippingPlanes),M.push(C.numClipIntersection),M.push(C.depthPacking)}function b(M,C){s.disableAll(),C.supportsVertexTextures&&s.enable(0),C.instancing&&s.enable(1),C.instancingColor&&s.enable(2),C.instancingMorph&&s.enable(3),C.matcap&&s.enable(4),C.envMap&&s.enable(5),C.normalMapObjectSpace&&s.enable(6),C.normalMapTangentSpace&&s.enable(7),C.clearcoat&&s.enable(8),C.iridescence&&s.enable(9),C.alphaTest&&s.enable(10),C.vertexColors&&s.enable(11),C.vertexAlphas&&s.enable(12),C.vertexUv1s&&s.enable(13),C.vertexUv2s&&s.enable(14),C.vertexUv3s&&s.enable(15),C.vertexTangents&&s.enable(16),C.anisotropy&&s.enable(17),C.alphaHash&&s.enable(18),C.batching&&s.enable(19),C.dispersion&&s.enable(20),C.batchingColor&&s.enable(21),M.push(s.mask),s.disableAll(),C.fog&&s.enable(0),C.useFog&&s.enable(1),C.flatShading&&s.enable(2),C.logarithmicDepthBuffer&&s.enable(3),C.reverseDepthBuffer&&s.enable(4),C.skinning&&s.enable(5),C.morphTargets&&s.enable(6),C.morphNormals&&s.enable(7),C.morphColors&&s.enable(8),C.premultipliedAlpha&&s.enable(9),C.shadowMapEnabled&&s.enable(10),C.doubleSided&&s.enable(11),C.flipSided&&s.enable(12),C.useDepthPacking&&s.enable(13),C.dithering&&s.enable(14),C.transmission&&s.enable(15),C.sheen&&s.enable(16),C.opaque&&s.enable(17),C.pointsUvs&&s.enable(18),C.decodeVideoTexture&&s.enable(19),C.decodeVideoTextureEmissive&&s.enable(20),C.alphaToCoverage&&s.enable(21),M.push(s.mask)}function S(M){const C=y[M.type];let P;if(C){const R=na[C];P=bee.clone(R.uniforms)}else P=M.uniforms;return P}function w(M,C){let P;for(let R=0,D=u.length;R0?r.push(m):p.transparent===!0?i.push(m):n.push(m)}function l(d,f,p,y,v,g){const m=a(d,f,p,y,v,g);p.transmission>0?r.unshift(m):p.transparent===!0?i.unshift(m):n.unshift(m)}function c(d,f){n.length>1&&n.sort(d||Toe),r.length>1&&r.sort(f||QO),i.length>1&&i.sort(f||QO)}function u(){for(let d=e,f=t.length;d=o.length?(a=new e2,o.push(a)):a=o[i],a}function n(){t=new WeakMap}return{get:e,dispose:n}}function Aoe(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new ne,color:new ft};break;case"SpotLight":n={position:new ne,direction:new ne,color:new ft,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new ne,color:new ft,distance:0,decay:0};break;case"HemisphereLight":n={direction:new ne,skyColor:new ft,groundColor:new ft};break;case"RectAreaLight":n={color:new ft,position:new ne,halfWidth:new ne,halfHeight:new ne};break}return t[e.id]=n,n}}}function Coe(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new xt};break;case"SpotLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new xt};break;case"PointLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new xt,shadowCameraNear:1,shadowCameraFar:1e3};break}return t[e.id]=n,n}}}let Poe=0;function Roe(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function Noe(t){const e=new Aoe,n=Coe(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)r.probe.push(new ne);const i=new ne,o=new gt,a=new gt;function s(c){let u=0,d=0,f=0;for(let M=0;M<9;M++)r.probe[M].set(0,0,0);let p=0,y=0,v=0,g=0,m=0,x=0,b=0,S=0,w=0,E=0,T=0;c.sort(Roe);for(let M=0,C=c.length;M0&&(t.has("OES_texture_float_linear")===!0?(r.rectAreaLTC1=Fe.LTC_FLOAT_1,r.rectAreaLTC2=Fe.LTC_FLOAT_2):(r.rectAreaLTC1=Fe.LTC_HALF_1,r.rectAreaLTC2=Fe.LTC_HALF_2)),r.ambient[0]=u,r.ambient[1]=d,r.ambient[2]=f;const A=r.hash;(A.directionalLength!==p||A.pointLength!==y||A.spotLength!==v||A.rectAreaLength!==g||A.hemiLength!==m||A.numDirectionalShadows!==x||A.numPointShadows!==b||A.numSpotShadows!==S||A.numSpotMaps!==w||A.numLightProbes!==T)&&(r.directional.length=p,r.spot.length=v,r.rectArea.length=g,r.point.length=y,r.hemi.length=m,r.directionalShadow.length=x,r.directionalShadowMap.length=x,r.pointShadow.length=b,r.pointShadowMap.length=b,r.spotShadow.length=S,r.spotShadowMap.length=S,r.directionalShadowMatrix.length=x,r.pointShadowMatrix.length=b,r.spotLightMatrix.length=S+w-E,r.spotLightMap.length=w,r.numSpotLightShadowsWithMaps=E,r.numLightProbes=T,A.directionalLength=p,A.pointLength=y,A.spotLength=v,A.rectAreaLength=g,A.hemiLength=m,A.numDirectionalShadows=x,A.numPointShadows=b,A.numSpotShadows=S,A.numSpotMaps=w,A.numLightProbes=T,r.version=Poe++)}function l(c,u){let d=0,f=0,p=0,y=0,v=0;const g=u.matrixWorldInverse;for(let m=0,x=c.length;m=a.length?(s=new t2(t),a.push(s)):s=a[o],s}function r(){e=new WeakMap}return{get:n,dispose:r}}const Ioe=`void main() { +`+X+` +`+L)}else R!==""?console.warn("THREE.WebGLProgram: Program Info Log:",R):(D===""||k==="")&&(O=!1);O&&(P.diagnostics={runnable:U,programLog:R,vertexShader:{log:D,prefix:g},fragmentShader:{log:k,prefix:m}})}i.deleteShader(w),i.deleteShader(E),A=new qv(i,v),M=uoe(i,v)}let A;this.getUniforms=function(){return A===void 0&&T(this),A};let M;this.getAttributes=function(){return M===void 0&&T(this),M};let C=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return C===!1&&(C=i.getProgramParameter(v,toe)),C},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(v),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=noe++,this.cacheKey=e,this.usedTimes=1,this.program=v,this.vertexShader=w,this.fragmentShader=E,this}let woe=0;class Soe{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const n=e.vertexShader,r=e.fragmentShader,i=this._getShaderStage(n),o=this._getShaderStage(r),a=this._getShaderCacheForMaterial(e);return a.has(i)===!1&&(a.add(i),i.usedTimes++),a.has(o)===!1&&(a.add(o),o.usedTimes++),this}remove(e){const n=this.materialCache.get(e);for(const r of n)r.usedTimes--,r.usedTimes===0&&this.shaderCache.delete(r.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const n=this.materialCache;let r=n.get(e);return r===void 0&&(r=new Set,n.set(e,r)),r}_getShaderStage(e){const n=this.shaderCache;let r=n.get(e);return r===void 0&&(r=new Eoe(e),n.set(e,r)),r}}class Eoe{constructor(e){this.id=woe++,this.code=e,this.usedTimes=0}}function Toe(t,e,n,r,i,o,a){const s=new QA,l=new Soe,c=new Set,u=[],d=i.logarithmicDepthBuffer,f=i.vertexTextures;let p=i.precision;const y={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function v(M){return c.add(M),M===0?"uv":`uv${M}`}function g(M,C,P,R,D){const k=R.fog,U=D.geometry,O=M.isMeshStandardMaterial?R.environment:null,X=(M.isMeshStandardMaterial?n:e).get(M.envMap||O),L=X&&X.mapping===jx?X.image.height:null,j=y[M.type];M.precision!==null&&(p=i.getMaxPrecision(M.precision),p!==M.precision&&console.warn("THREE.WebGLProgram.getParameters:",M.precision,"not supported, using",p,"instead."));const K=U.morphAttributes.position||U.morphAttributes.normal||U.morphAttributes.color,te=K!==void 0?K.length:0;let H=0;U.morphAttributes.position!==void 0&&(H=1),U.morphAttributes.normal!==void 0&&(H=2),U.morphAttributes.color!==void 0&&(H=3);let q,$,Y,ee;if(j){const pt=na[j];q=pt.vertexShader,$=pt.fragmentShader}else q=M.vertexShader,$=M.fragmentShader,l.update(M),Y=l.getVertexShaderID(M),ee=l.getFragmentShaderID(M);const J=t.getRenderTarget(),ce=t.state.buffers.depth.getReversed(),ae=D.isInstancedMesh===!0,fe=D.isBatchedMesh===!0,we=!!M.map,le=!!M.matcap,ie=!!X,W=!!M.aoMap,Ve=!!M.lightMap,Ne=!!M.bumpMap,st=!!M.normalMap,Re=!!M.displacementMap,ct=!!M.emissiveMap,Ye=!!M.metalnessMap,it=!!M.roughnessMap,Ft=M.anisotropy>0,Z=M.clearcoat>0,F=M.dispersion>0,ue=M.iridescence>0,me=M.sheen>0,be=M.transmission>0,ge=Ft&&!!M.anisotropyMap,rt=Z&&!!M.clearcoatMap,Ie=Z&&!!M.clearcoatNormalMap,Ze=Z&&!!M.clearcoatRoughnessMap,tt=ue&&!!M.iridescenceMap,Ee=ue&&!!M.iridescenceThicknessMap,Be=me&&!!M.sheenColorMap,ht=me&&!!M.sheenRoughnessMap,ot=!!M.specularMap,Le=!!M.specularColorMap,_t=!!M.specularIntensityMap,re=be&&!!M.transmissionMap,ke=be&&!!M.thicknessMap,Me=!!M.gradientMap,Ge=!!M.alphaMap,Te=M.alphaTest>0,_e=!!M.alphaHash,Se=!!M.extensions;let je=nl;M.toneMapped&&(J===null||J.isXRRenderTarget===!0)&&(je=t.toneMapping);const vt={shaderID:j,shaderType:M.type,shaderName:M.name,vertexShader:q,fragmentShader:$,defines:M.defines,customVertexShaderID:Y,customFragmentShaderID:ee,isRawShaderMaterial:M.isRawShaderMaterial===!0,glslVersion:M.glslVersion,precision:p,batching:fe,batchingColor:fe&&D._colorsTexture!==null,instancing:ae,instancingColor:ae&&D.instanceColor!==null,instancingMorph:ae&&D.morphTexture!==null,supportsVertexTextures:f,outputColorSpace:J===null?t.outputColorSpace:J.isXRRenderTarget===!0?J.texture.colorSpace:Kr,alphaToCoverage:!!M.alphaToCoverage,map:we,matcap:le,envMap:ie,envMapMode:ie&&X.mapping,envMapCubeUVHeight:L,aoMap:W,lightMap:Ve,bumpMap:Ne,normalMap:st,displacementMap:f&&Re,emissiveMap:ct,normalMapObjectSpace:st&&M.normalMapType===RQ,normalMapTangentSpace:st&&M.normalMapType===Ux,metalnessMap:Ye,roughnessMap:it,anisotropy:Ft,anisotropyMap:ge,clearcoat:Z,clearcoatMap:rt,clearcoatNormalMap:Ie,clearcoatRoughnessMap:Ze,dispersion:F,iridescence:ue,iridescenceMap:tt,iridescenceThicknessMap:Ee,sheen:me,sheenColorMap:Be,sheenRoughnessMap:ht,specularMap:ot,specularColorMap:Le,specularIntensityMap:_t,transmission:be,transmissionMap:re,thicknessMap:ke,gradientMap:Me,opaque:M.transparent===!1&&M.blending===sd&&M.alphaToCoverage===!1,alphaMap:Ge,alphaTest:Te,alphaHash:_e,combine:M.combine,mapUv:we&&v(M.map.channel),aoMapUv:W&&v(M.aoMap.channel),lightMapUv:Ve&&v(M.lightMap.channel),bumpMapUv:Ne&&v(M.bumpMap.channel),normalMapUv:st&&v(M.normalMap.channel),displacementMapUv:Re&&v(M.displacementMap.channel),emissiveMapUv:ct&&v(M.emissiveMap.channel),metalnessMapUv:Ye&&v(M.metalnessMap.channel),roughnessMapUv:it&&v(M.roughnessMap.channel),anisotropyMapUv:ge&&v(M.anisotropyMap.channel),clearcoatMapUv:rt&&v(M.clearcoatMap.channel),clearcoatNormalMapUv:Ie&&v(M.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Ze&&v(M.clearcoatRoughnessMap.channel),iridescenceMapUv:tt&&v(M.iridescenceMap.channel),iridescenceThicknessMapUv:Ee&&v(M.iridescenceThicknessMap.channel),sheenColorMapUv:Be&&v(M.sheenColorMap.channel),sheenRoughnessMapUv:ht&&v(M.sheenRoughnessMap.channel),specularMapUv:ot&&v(M.specularMap.channel),specularColorMapUv:Le&&v(M.specularColorMap.channel),specularIntensityMapUv:_t&&v(M.specularIntensityMap.channel),transmissionMapUv:re&&v(M.transmissionMap.channel),thicknessMapUv:ke&&v(M.thicknessMap.channel),alphaMapUv:Ge&&v(M.alphaMap.channel),vertexTangents:!!U.attributes.tangent&&(st||Ft),vertexColors:M.vertexColors,vertexAlphas:M.vertexColors===!0&&!!U.attributes.color&&U.attributes.color.itemSize===4,pointsUvs:D.isPoints===!0&&!!U.attributes.uv&&(we||Ge),fog:!!k,useFog:M.fog===!0,fogExp2:!!k&&k.isFogExp2,flatShading:M.flatShading===!0,sizeAttenuation:M.sizeAttenuation===!0,logarithmicDepthBuffer:d,reverseDepthBuffer:ce,skinning:D.isSkinnedMesh===!0,morphTargets:U.morphAttributes.position!==void 0,morphNormals:U.morphAttributes.normal!==void 0,morphColors:U.morphAttributes.color!==void 0,morphTargetsCount:te,morphTextureStride:H,numDirLights:C.directional.length,numPointLights:C.point.length,numSpotLights:C.spot.length,numSpotLightMaps:C.spotLightMap.length,numRectAreaLights:C.rectArea.length,numHemiLights:C.hemi.length,numDirLightShadows:C.directionalShadowMap.length,numPointLightShadows:C.pointShadowMap.length,numSpotLightShadows:C.spotShadowMap.length,numSpotLightShadowsWithMaps:C.numSpotLightShadowsWithMaps,numLightProbes:C.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:M.dithering,shadowMapEnabled:t.shadowMap.enabled&&P.length>0,shadowMapType:t.shadowMap.type,toneMapping:je,decodeVideoTexture:we&&M.map.isVideoTexture===!0&&Dt.getTransfer(M.map.colorSpace)===an,decodeVideoTextureEmissive:ct&&M.emissiveMap.isVideoTexture===!0&&Dt.getTransfer(M.emissiveMap.colorSpace)===an,premultipliedAlpha:M.premultipliedAlpha,doubleSided:M.side===Ki,flipSided:M.side===ui,useDepthPacking:M.depthPacking>=0,depthPacking:M.depthPacking||0,index0AttributeName:M.index0AttributeName,extensionClipCullDistance:Se&&M.extensions.clipCullDistance===!0&&r.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Se&&M.extensions.multiDraw===!0||fe)&&r.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:r.has("KHR_parallel_shader_compile"),customProgramCacheKey:M.customProgramCacheKey()};return vt.vertexUv1s=c.has(1),vt.vertexUv2s=c.has(2),vt.vertexUv3s=c.has(3),c.clear(),vt}function m(M){const C=[];if(M.shaderID?C.push(M.shaderID):(C.push(M.customVertexShaderID),C.push(M.customFragmentShaderID)),M.defines!==void 0)for(const P in M.defines)C.push(P),C.push(M.defines[P]);return M.isRawShaderMaterial===!1&&(x(C,M),b(C,M),C.push(t.outputColorSpace)),C.push(M.customProgramCacheKey),C.join()}function x(M,C){M.push(C.precision),M.push(C.outputColorSpace),M.push(C.envMapMode),M.push(C.envMapCubeUVHeight),M.push(C.mapUv),M.push(C.alphaMapUv),M.push(C.lightMapUv),M.push(C.aoMapUv),M.push(C.bumpMapUv),M.push(C.normalMapUv),M.push(C.displacementMapUv),M.push(C.emissiveMapUv),M.push(C.metalnessMapUv),M.push(C.roughnessMapUv),M.push(C.anisotropyMapUv),M.push(C.clearcoatMapUv),M.push(C.clearcoatNormalMapUv),M.push(C.clearcoatRoughnessMapUv),M.push(C.iridescenceMapUv),M.push(C.iridescenceThicknessMapUv),M.push(C.sheenColorMapUv),M.push(C.sheenRoughnessMapUv),M.push(C.specularMapUv),M.push(C.specularColorMapUv),M.push(C.specularIntensityMapUv),M.push(C.transmissionMapUv),M.push(C.thicknessMapUv),M.push(C.combine),M.push(C.fogExp2),M.push(C.sizeAttenuation),M.push(C.morphTargetsCount),M.push(C.morphAttributeCount),M.push(C.numDirLights),M.push(C.numPointLights),M.push(C.numSpotLights),M.push(C.numSpotLightMaps),M.push(C.numHemiLights),M.push(C.numRectAreaLights),M.push(C.numDirLightShadows),M.push(C.numPointLightShadows),M.push(C.numSpotLightShadows),M.push(C.numSpotLightShadowsWithMaps),M.push(C.numLightProbes),M.push(C.shadowMapType),M.push(C.toneMapping),M.push(C.numClippingPlanes),M.push(C.numClipIntersection),M.push(C.depthPacking)}function b(M,C){s.disableAll(),C.supportsVertexTextures&&s.enable(0),C.instancing&&s.enable(1),C.instancingColor&&s.enable(2),C.instancingMorph&&s.enable(3),C.matcap&&s.enable(4),C.envMap&&s.enable(5),C.normalMapObjectSpace&&s.enable(6),C.normalMapTangentSpace&&s.enable(7),C.clearcoat&&s.enable(8),C.iridescence&&s.enable(9),C.alphaTest&&s.enable(10),C.vertexColors&&s.enable(11),C.vertexAlphas&&s.enable(12),C.vertexUv1s&&s.enable(13),C.vertexUv2s&&s.enable(14),C.vertexUv3s&&s.enable(15),C.vertexTangents&&s.enable(16),C.anisotropy&&s.enable(17),C.alphaHash&&s.enable(18),C.batching&&s.enable(19),C.dispersion&&s.enable(20),C.batchingColor&&s.enable(21),M.push(s.mask),s.disableAll(),C.fog&&s.enable(0),C.useFog&&s.enable(1),C.flatShading&&s.enable(2),C.logarithmicDepthBuffer&&s.enable(3),C.reverseDepthBuffer&&s.enable(4),C.skinning&&s.enable(5),C.morphTargets&&s.enable(6),C.morphNormals&&s.enable(7),C.morphColors&&s.enable(8),C.premultipliedAlpha&&s.enable(9),C.shadowMapEnabled&&s.enable(10),C.doubleSided&&s.enable(11),C.flipSided&&s.enable(12),C.useDepthPacking&&s.enable(13),C.dithering&&s.enable(14),C.transmission&&s.enable(15),C.sheen&&s.enable(16),C.opaque&&s.enable(17),C.pointsUvs&&s.enable(18),C.decodeVideoTexture&&s.enable(19),C.decodeVideoTextureEmissive&&s.enable(20),C.alphaToCoverage&&s.enable(21),M.push(s.mask)}function S(M){const C=y[M.type];let P;if(C){const R=na[C];P=wee.clone(R.uniforms)}else P=M.uniforms;return P}function w(M,C){let P;for(let R=0,D=u.length;R0?r.push(m):p.transparent===!0?i.push(m):n.push(m)}function l(d,f,p,y,v,g){const m=a(d,f,p,y,v,g);p.transmission>0?r.unshift(m):p.transparent===!0?i.unshift(m):n.unshift(m)}function c(d,f){n.length>1&&n.sort(d||Aoe),r.length>1&&r.sort(f||e2),i.length>1&&i.sort(f||e2)}function u(){for(let d=e,f=t.length;d=o.length?(a=new t2,o.push(a)):a=o[i],a}function n(){t=new WeakMap}return{get:e,dispose:n}}function Poe(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new ne,color:new ft};break;case"SpotLight":n={position:new ne,direction:new ne,color:new ft,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new ne,color:new ft,distance:0,decay:0};break;case"HemisphereLight":n={direction:new ne,skyColor:new ft,groundColor:new ft};break;case"RectAreaLight":n={color:new ft,position:new ne,halfWidth:new ne,halfHeight:new ne};break}return t[e.id]=n,n}}}function Roe(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new xt};break;case"SpotLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new xt};break;case"PointLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new xt,shadowCameraNear:1,shadowCameraFar:1e3};break}return t[e.id]=n,n}}}let Noe=0;function Ooe(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function Ioe(t){const e=new Poe,n=Roe(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)r.probe.push(new ne);const i=new ne,o=new gt,a=new gt;function s(c){let u=0,d=0,f=0;for(let M=0;M<9;M++)r.probe[M].set(0,0,0);let p=0,y=0,v=0,g=0,m=0,x=0,b=0,S=0,w=0,E=0,T=0;c.sort(Ooe);for(let M=0,C=c.length;M0&&(t.has("OES_texture_float_linear")===!0?(r.rectAreaLTC1=Fe.LTC_FLOAT_1,r.rectAreaLTC2=Fe.LTC_FLOAT_2):(r.rectAreaLTC1=Fe.LTC_HALF_1,r.rectAreaLTC2=Fe.LTC_HALF_2)),r.ambient[0]=u,r.ambient[1]=d,r.ambient[2]=f;const A=r.hash;(A.directionalLength!==p||A.pointLength!==y||A.spotLength!==v||A.rectAreaLength!==g||A.hemiLength!==m||A.numDirectionalShadows!==x||A.numPointShadows!==b||A.numSpotShadows!==S||A.numSpotMaps!==w||A.numLightProbes!==T)&&(r.directional.length=p,r.spot.length=v,r.rectArea.length=g,r.point.length=y,r.hemi.length=m,r.directionalShadow.length=x,r.directionalShadowMap.length=x,r.pointShadow.length=b,r.pointShadowMap.length=b,r.spotShadow.length=S,r.spotShadowMap.length=S,r.directionalShadowMatrix.length=x,r.pointShadowMatrix.length=b,r.spotLightMatrix.length=S+w-E,r.spotLightMap.length=w,r.numSpotLightShadowsWithMaps=E,r.numLightProbes=T,A.directionalLength=p,A.pointLength=y,A.spotLength=v,A.rectAreaLength=g,A.hemiLength=m,A.numDirectionalShadows=x,A.numPointShadows=b,A.numSpotShadows=S,A.numSpotMaps=w,A.numLightProbes=T,r.version=Noe++)}function l(c,u){let d=0,f=0,p=0,y=0,v=0;const g=u.matrixWorldInverse;for(let m=0,x=c.length;m=a.length?(s=new n2(t),a.push(s)):s=a[o],s}function r(){e=new WeakMap}return{get:n,dispose:r}}const Loe=`void main() { gl_Position = vec4( position, 1.0 ); -}`,Doe=`uniform sampler2D shadow_pass; +}`,koe=`uniform sampler2D shadow_pass; uniform vec2 resolution; uniform float radius; #include @@ -4151,12 +4156,12 @@ void main() { squared_mean = squared_mean / samples; float std_dev = sqrt( squared_mean - mean * mean ); gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`;function Loe(t,e,n){let r=new nC;const i=new xt,o=new xt,a=new Yt,s=new kee({depthPacking:AQ}),l=new jee,c={},u=n.maxTextureSize,d={[ba]:ui,[ui]:ba,[Ki]:Ki},f=new hl({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new xt},radius:{value:4}},vertexShader:Ioe,fragmentShader:Doe}),p=f.clone();p.defines.HORIZONTAL_PASS=1;const y=new br;y.setAttribute("position",new cr(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const v=new Tn(y,f),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=_4;let m=this.type;this.render=function(E,T,A){if(g.enabled===!1||g.autoUpdate===!1&&g.needsUpdate===!1||E.length===0)return;const M=t.getRenderTarget(),C=t.getActiveCubeFace(),P=t.getActiveMipmapLevel(),R=t.state;R.setBlending(tl),R.buffers.color.setClear(1,1,1,1),R.buffers.depth.setTest(!0),R.setScissorTest(!1);const D=m!==ja&&this.type===ja,k=m===ja&&this.type!==ja;for(let U=0,O=E.length;Uu||i.y>u)&&(i.x>u&&(o.x=Math.floor(u/j.x),i.x=o.x*j.x,L.mapSize.x=o.x),i.y>u&&(o.y=Math.floor(u/j.y),i.y=o.y*j.y,L.mapSize.y=o.y)),L.map===null||D===!0||k===!0){const K=this.type!==ja?{minFilter:Xr,magFilter:Xr}:{};L.map!==null&&L.map.dispose(),L.map=new Oc(i.x,i.y,K),L.map.texture.name=W.name+".shadowMap",L.camera.updateProjectionMatrix()}t.setRenderTarget(L.map),t.clear();const X=L.getViewportCount();for(let K=0;K0||T.map&&T.alphaTest>0||T.alphaToCoverage===!0){const R=C.uuid,D=T.uuid;let k=c[R];k===void 0&&(k={},c[R]=k);let U=k[D];U===void 0&&(U=C.clone(),k[D]=U,T.addEventListener("dispose",w)),C=U}if(C.visible=T.visible,C.wireframe=T.wireframe,M===ja?C.side=T.shadowSide!==null?T.shadowSide:T.side:C.side=T.shadowSide!==null?T.shadowSide:d[T.side],C.alphaMap=T.alphaMap,C.alphaTest=T.alphaToCoverage===!0?.5:T.alphaTest,C.map=T.map,C.clipShadows=T.clipShadows,C.clippingPlanes=T.clippingPlanes,C.clipIntersection=T.clipIntersection,C.displacementMap=T.displacementMap,C.displacementScale=T.displacementScale,C.displacementBias=T.displacementBias,C.wireframeLinewidth=T.wireframeLinewidth,C.linewidth=T.linewidth,A.isPointLight===!0&&C.isMeshDistanceMaterial===!0){const R=t.properties.get(C);R.light=A}return C}function S(E,T,A,M,C){if(E.visible===!1)return;if(E.layers.test(T.layers)&&(E.isMesh||E.isLine||E.isPoints)&&(E.castShadow||E.receiveShadow&&C===ja)&&(!E.frustumCulled||r.intersectsObject(E))){E.modelViewMatrix.multiplyMatrices(A.matrixWorldInverse,E.matrixWorld);const D=e.update(E),k=E.material;if(Array.isArray(k)){const U=D.groups;for(let O=0,W=U.length;O=1):L.indexOf("OpenGL ES")!==-1&&(W=parseFloat(/^OpenGL ES (\d)/.exec(L)[1]),O=W>=2);let j=null,X={};const K=t.getParameter(t.SCISSOR_BOX),F=t.getParameter(t.VIEWPORT),Y=new Yt().fromArray(K),q=new Yt().fromArray(F);function ee(re,ke,Me,Ge){const Te=new Uint8Array(4),_e=t.createTexture();t.bindTexture(re,_e),t.texParameteri(re,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(re,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let Se=0;Se"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new xt,u=new WeakMap;let d;const f=new WeakMap;let p=!1;try{p=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function y(J,B){return p?new OffscreenCanvas(J,B):Rp("canvas")}function v(J,B,ue){let me=1;const be=Ft(J);if((be.width>ue||be.height>ue)&&(me=ue/Math.max(be.width,be.height)),me<1)if(typeof HTMLImageElement<"u"&&J instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&J instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&J instanceof ImageBitmap||typeof VideoFrame<"u"&&J instanceof VideoFrame){const ge=Math.floor(me*be.width),rt=Math.floor(me*be.height);d===void 0&&(d=y(ge,rt));const Ie=B?y(ge,rt):d;return Ie.width=ge,Ie.height=rt,Ie.getContext("2d").drawImage(J,0,0,ge,rt),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+be.width+"x"+be.height+") to ("+ge+"x"+rt+")."),Ie}else return"data"in J&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+be.width+"x"+be.height+")."),J;return J}function g(J){return J.generateMipmaps}function m(J){t.generateMipmap(J)}function x(J){return J.isWebGLCubeRenderTarget?t.TEXTURE_CUBE_MAP:J.isWebGL3DRenderTarget?t.TEXTURE_3D:J.isWebGLArrayRenderTarget||J.isCompressedArrayTexture?t.TEXTURE_2D_ARRAY:t.TEXTURE_2D}function b(J,B,ue,me,be=!1){if(J!==null){if(t[J]!==void 0)return t[J];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+J+"'")}let ge=B;if(B===t.RED&&(ue===t.FLOAT&&(ge=t.R32F),ue===t.HALF_FLOAT&&(ge=t.R16F),ue===t.UNSIGNED_BYTE&&(ge=t.R8)),B===t.RED_INTEGER&&(ue===t.UNSIGNED_BYTE&&(ge=t.R8UI),ue===t.UNSIGNED_SHORT&&(ge=t.R16UI),ue===t.UNSIGNED_INT&&(ge=t.R32UI),ue===t.BYTE&&(ge=t.R8I),ue===t.SHORT&&(ge=t.R16I),ue===t.INT&&(ge=t.R32I)),B===t.RG&&(ue===t.FLOAT&&(ge=t.RG32F),ue===t.HALF_FLOAT&&(ge=t.RG16F),ue===t.UNSIGNED_BYTE&&(ge=t.RG8)),B===t.RG_INTEGER&&(ue===t.UNSIGNED_BYTE&&(ge=t.RG8UI),ue===t.UNSIGNED_SHORT&&(ge=t.RG16UI),ue===t.UNSIGNED_INT&&(ge=t.RG32UI),ue===t.BYTE&&(ge=t.RG8I),ue===t.SHORT&&(ge=t.RG16I),ue===t.INT&&(ge=t.RG32I)),B===t.RGB_INTEGER&&(ue===t.UNSIGNED_BYTE&&(ge=t.RGB8UI),ue===t.UNSIGNED_SHORT&&(ge=t.RGB16UI),ue===t.UNSIGNED_INT&&(ge=t.RGB32UI),ue===t.BYTE&&(ge=t.RGB8I),ue===t.SHORT&&(ge=t.RGB16I),ue===t.INT&&(ge=t.RGB32I)),B===t.RGBA_INTEGER&&(ue===t.UNSIGNED_BYTE&&(ge=t.RGBA8UI),ue===t.UNSIGNED_SHORT&&(ge=t.RGBA16UI),ue===t.UNSIGNED_INT&&(ge=t.RGBA32UI),ue===t.BYTE&&(ge=t.RGBA8I),ue===t.SHORT&&(ge=t.RGBA16I),ue===t.INT&&(ge=t.RGBA32I)),B===t.RGB&&ue===t.UNSIGNED_INT_5_9_9_9_REV&&(ge=t.RGB9_E5),B===t.RGBA){const rt=be?Ry:Dt.getTransfer(me);ue===t.FLOAT&&(ge=t.RGBA32F),ue===t.HALF_FLOAT&&(ge=t.RGBA16F),ue===t.UNSIGNED_BYTE&&(ge=rt===an?t.SRGB8_ALPHA8:t.RGBA8),ue===t.UNSIGNED_SHORT_4_4_4_4&&(ge=t.RGBA4),ue===t.UNSIGNED_SHORT_5_5_5_1&&(ge=t.RGB5_A1)}return(ge===t.R16F||ge===t.R32F||ge===t.RG16F||ge===t.RG32F||ge===t.RGBA16F||ge===t.RGBA32F)&&e.get("EXT_color_buffer_float"),ge}function S(J,B){let ue;return J?B===null||B===Nc||B===Tp?ue=t.DEPTH24_STENCIL8:B===Io?ue=t.DEPTH32F_STENCIL8:B===Ep&&(ue=t.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):B===null||B===Nc||B===Tp?ue=t.DEPTH_COMPONENT24:B===Io?ue=t.DEPTH_COMPONENT32F:B===Ep&&(ue=t.DEPTH_COMPONENT16),ue}function w(J,B){return g(J)===!0||J.isFramebufferTexture&&J.minFilter!==Xr&&J.minFilter!==Or?Math.log2(Math.max(B.width,B.height))+1:J.mipmaps!==void 0&&J.mipmaps.length>0?J.mipmaps.length:J.isCompressedTexture&&Array.isArray(J.image)?B.mipmaps.length:1}function E(J){const B=J.target;B.removeEventListener("dispose",E),A(B),B.isVideoTexture&&u.delete(B)}function T(J){const B=J.target;B.removeEventListener("dispose",T),C(B)}function A(J){const B=r.get(J);if(B.__webglInit===void 0)return;const ue=J.source,me=f.get(ue);if(me){const be=me[B.__cacheKey];be.usedTimes--,be.usedTimes===0&&M(J),Object.keys(me).length===0&&f.delete(ue)}r.remove(J)}function M(J){const B=r.get(J);t.deleteTexture(B.__webglTexture);const ue=J.source,me=f.get(ue);delete me[B.__cacheKey],a.memory.textures--}function C(J){const B=r.get(J);if(J.depthTexture&&(J.depthTexture.dispose(),r.remove(J.depthTexture)),J.isWebGLCubeRenderTarget)for(let me=0;me<6;me++){if(Array.isArray(B.__webglFramebuffer[me]))for(let be=0;be=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+J+" texture units while this GPU supports only "+i.maxTextures),P+=1,J}function k(J){const B=[];return B.push(J.wrapS),B.push(J.wrapT),B.push(J.wrapR||0),B.push(J.magFilter),B.push(J.minFilter),B.push(J.anisotropy),B.push(J.internalFormat),B.push(J.format),B.push(J.type),B.push(J.generateMipmaps),B.push(J.premultiplyAlpha),B.push(J.flipY),B.push(J.unpackAlignment),B.push(J.colorSpace),B.join()}function U(J,B){const ue=r.get(J);if(J.isVideoTexture&&Ye(J),J.isRenderTargetTexture===!1&&J.version>0&&ue.__version!==J.version){const me=J.image;if(me===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(me.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{te(ue,J,B);return}}n.bindTexture(t.TEXTURE_2D,ue.__webglTexture,t.TEXTURE0+B)}function O(J,B){const ue=r.get(J);if(J.version>0&&ue.__version!==J.version){te(ue,J,B);return}n.bindTexture(t.TEXTURE_2D_ARRAY,ue.__webglTexture,t.TEXTURE0+B)}function W(J,B){const ue=r.get(J);if(J.version>0&&ue.__version!==J.version){te(ue,J,B);return}n.bindTexture(t.TEXTURE_3D,ue.__webglTexture,t.TEXTURE0+B)}function L(J,B){const ue=r.get(J);if(J.version>0&&ue.__version!==J.version){Q(ue,J,B);return}n.bindTexture(t.TEXTURE_CUBE_MAP,ue.__webglTexture,t.TEXTURE0+B)}const j={[ca]:t.REPEAT,[Ji]:t.CLAMP_TO_EDGE,[Py]:t.MIRRORED_REPEAT},X={[Xr]:t.NEAREST,[E4]:t.NEAREST_MIPMAP_NEAREST,[Ch]:t.NEAREST_MIPMAP_LINEAR,[Or]:t.LINEAR,[$v]:t.LINEAR_MIPMAP_NEAREST,[Oo]:t.LINEAR_MIPMAP_LINEAR},K={[PQ]:t.NEVER,[LQ]:t.ALWAYS,[RQ]:t.LESS,[I4]:t.LEQUAL,[NQ]:t.EQUAL,[DQ]:t.GEQUAL,[OQ]:t.GREATER,[IQ]:t.NOTEQUAL};function F(J,B){if(B.type===Io&&e.has("OES_texture_float_linear")===!1&&(B.magFilter===Or||B.magFilter===$v||B.magFilter===Ch||B.magFilter===Oo||B.minFilter===Or||B.minFilter===$v||B.minFilter===Ch||B.minFilter===Oo)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),t.texParameteri(J,t.TEXTURE_WRAP_S,j[B.wrapS]),t.texParameteri(J,t.TEXTURE_WRAP_T,j[B.wrapT]),(J===t.TEXTURE_3D||J===t.TEXTURE_2D_ARRAY)&&t.texParameteri(J,t.TEXTURE_WRAP_R,j[B.wrapR]),t.texParameteri(J,t.TEXTURE_MAG_FILTER,X[B.magFilter]),t.texParameteri(J,t.TEXTURE_MIN_FILTER,X[B.minFilter]),B.compareFunction&&(t.texParameteri(J,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(J,t.TEXTURE_COMPARE_FUNC,K[B.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(B.magFilter===Xr||B.minFilter!==Ch&&B.minFilter!==Oo||B.type===Io&&e.has("OES_texture_float_linear")===!1)return;if(B.anisotropy>1||r.get(B).__currentAnisotropy){const ue=e.get("EXT_texture_filter_anisotropic");t.texParameterf(J,ue.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(B.anisotropy,i.getMaxAnisotropy())),r.get(B).__currentAnisotropy=B.anisotropy}}}function Y(J,B){let ue=!1;J.__webglInit===void 0&&(J.__webglInit=!0,B.addEventListener("dispose",E));const me=B.source;let be=f.get(me);be===void 0&&(be={},f.set(me,be));const ge=k(B);if(ge!==J.__cacheKey){be[ge]===void 0&&(be[ge]={texture:t.createTexture(),usedTimes:0},a.memory.textures++,ue=!0),be[ge].usedTimes++;const rt=be[J.__cacheKey];rt!==void 0&&(be[J.__cacheKey].usedTimes--,rt.usedTimes===0&&M(B)),J.__cacheKey=ge,J.__webglTexture=be[ge].texture}return ue}function q(J,B,ue){return Math.floor(Math.floor(J/ue)/B)}function ee(J,B,ue,me){const ge=J.updateRanges;if(ge.length===0)n.texSubImage2D(t.TEXTURE_2D,0,0,0,B.width,B.height,ue,me,B.data);else{ge.sort((Ee,Be)=>Ee.start-Be.start);let rt=0;for(let Ee=1;Ee0){re&&ke&&n.texStorage2D(t.TEXTURE_2D,Ge,ot,_t[0].width,_t[0].height);for(let Te=0,_e=_t.length;Te<_e;Te++)Le=_t[Te],re?Me&&n.texSubImage2D(t.TEXTURE_2D,Te,0,0,Le.width,Le.height,Be,ht,Le.data):n.texImage2D(t.TEXTURE_2D,Te,ot,Le.width,Le.height,0,Be,ht,Le.data);B.generateMipmaps=!1}else re?(ke&&n.texStorage2D(t.TEXTURE_2D,Ge,ot,Ee.width,Ee.height),Me&&ee(B,Ee,Be,ht)):n.texImage2D(t.TEXTURE_2D,0,ot,Ee.width,Ee.height,0,Be,ht,Ee.data);else if(B.isCompressedTexture)if(B.isCompressedArrayTexture){re&&ke&&n.texStorage3D(t.TEXTURE_2D_ARRAY,Ge,ot,_t[0].width,_t[0].height,Ee.depth);for(let Te=0,_e=_t.length;Te<_e;Te++)if(Le=_t[Te],B.format!==Zi)if(Be!==null)if(re){if(Me)if(B.layerUpdates.size>0){const Se=NO(Le.width,Le.height,B.format,B.type);for(const je of B.layerUpdates){const vt=Le.data.subarray(je*Se/Le.data.BYTES_PER_ELEMENT,(je+1)*Se/Le.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,Te,0,0,je,Le.width,Le.height,1,Be,vt)}B.clearLayerUpdates()}else n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,Te,0,0,0,Le.width,Le.height,Ee.depth,Be,Le.data)}else n.compressedTexImage3D(t.TEXTURE_2D_ARRAY,Te,ot,Le.width,Le.height,Ee.depth,0,Le.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else re?Me&&n.texSubImage3D(t.TEXTURE_2D_ARRAY,Te,0,0,0,Le.width,Le.height,Ee.depth,Be,ht,Le.data):n.texImage3D(t.TEXTURE_2D_ARRAY,Te,ot,Le.width,Le.height,Ee.depth,0,Be,ht,Le.data)}else{re&&ke&&n.texStorage2D(t.TEXTURE_2D,Ge,ot,_t[0].width,_t[0].height);for(let Te=0,_e=_t.length;Te<_e;Te++)Le=_t[Te],B.format!==Zi?Be!==null?re?Me&&n.compressedTexSubImage2D(t.TEXTURE_2D,Te,0,0,Le.width,Le.height,Be,Le.data):n.compressedTexImage2D(t.TEXTURE_2D,Te,ot,Le.width,Le.height,0,Le.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):re?Me&&n.texSubImage2D(t.TEXTURE_2D,Te,0,0,Le.width,Le.height,Be,ht,Le.data):n.texImage2D(t.TEXTURE_2D,Te,ot,Le.width,Le.height,0,Be,ht,Le.data)}else if(B.isDataArrayTexture)if(re){if(ke&&n.texStorage3D(t.TEXTURE_2D_ARRAY,Ge,ot,Ee.width,Ee.height,Ee.depth),Me)if(B.layerUpdates.size>0){const Te=NO(Ee.width,Ee.height,B.format,B.type);for(const _e of B.layerUpdates){const Se=Ee.data.subarray(_e*Te/Ee.data.BYTES_PER_ELEMENT,(_e+1)*Te/Ee.data.BYTES_PER_ELEMENT);n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,_e,Ee.width,Ee.height,1,Be,ht,Se)}B.clearLayerUpdates()}else n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,0,Ee.width,Ee.height,Ee.depth,Be,ht,Ee.data)}else n.texImage3D(t.TEXTURE_2D_ARRAY,0,ot,Ee.width,Ee.height,Ee.depth,0,Be,ht,Ee.data);else if(B.isData3DTexture)re?(ke&&n.texStorage3D(t.TEXTURE_3D,Ge,ot,Ee.width,Ee.height,Ee.depth),Me&&n.texSubImage3D(t.TEXTURE_3D,0,0,0,0,Ee.width,Ee.height,Ee.depth,Be,ht,Ee.data)):n.texImage3D(t.TEXTURE_3D,0,ot,Ee.width,Ee.height,Ee.depth,0,Be,ht,Ee.data);else if(B.isFramebufferTexture){if(ke)if(re)n.texStorage2D(t.TEXTURE_2D,Ge,ot,Ee.width,Ee.height);else{let Te=Ee.width,_e=Ee.height;for(let Se=0;Se>=1,_e>>=1}}else if(_t.length>0){if(re&&ke){const Te=Ft(_t[0]);n.texStorage2D(t.TEXTURE_2D,Ge,ot,Te.width,Te.height)}for(let Te=0,_e=_t.length;Te<_e;Te++)Le=_t[Te],re?Me&&n.texSubImage2D(t.TEXTURE_2D,Te,0,0,Be,ht,Le):n.texImage2D(t.TEXTURE_2D,Te,ot,Be,ht,Le);B.generateMipmaps=!1}else if(re){if(ke){const Te=Ft(Ee);n.texStorage2D(t.TEXTURE_2D,Ge,ot,Te.width,Te.height)}Me&&n.texSubImage2D(t.TEXTURE_2D,0,0,0,Be,ht,Ee)}else n.texImage2D(t.TEXTURE_2D,0,ot,Be,ht,Ee);g(B)&&m(me),rt.__version=ge.version,B.onUpdate&&B.onUpdate(B)}J.__version=B.version}function Q(J,B,ue){if(B.image.length!==6)return;const me=Y(J,B),be=B.source;n.bindTexture(t.TEXTURE_CUBE_MAP,J.__webglTexture,t.TEXTURE0+ue);const ge=r.get(be);if(be.version!==ge.__version||me===!0){n.activeTexture(t.TEXTURE0+ue);const rt=Dt.getPrimaries(Dt.workingColorSpace),Ie=B.colorSpace===Ds?null:Dt.getPrimaries(B.colorSpace),Je=B.colorSpace===Ds||rt===Ie?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,B.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,B.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,B.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,Je);const tt=B.isCompressedTexture||B.image[0].isCompressedTexture,Ee=B.image[0]&&B.image[0].isDataTexture,Be=[];for(let _e=0;_e<6;_e++)!tt&&!Ee?Be[_e]=v(B.image[_e],!0,i.maxCubemapSize):Be[_e]=Ee?B.image[_e].image:B.image[_e],Be[_e]=it(B,Be[_e]);const ht=Be[0],ot=o.convert(B.format,B.colorSpace),Le=o.convert(B.type),_t=b(B.internalFormat,ot,Le,B.colorSpace),re=B.isVideoTexture!==!0,ke=ge.__version===void 0||me===!0,Me=be.dataReady;let Ge=w(B,ht);F(t.TEXTURE_CUBE_MAP,B);let Te;if(tt){re&&ke&&n.texStorage2D(t.TEXTURE_CUBE_MAP,Ge,_t,ht.width,ht.height);for(let _e=0;_e<6;_e++){Te=Be[_e].mipmaps;for(let Se=0;Se0&&Ge++;const _e=Ft(Be[0]);n.texStorage2D(t.TEXTURE_CUBE_MAP,Ge,_t,_e.width,_e.height)}for(let _e=0;_e<6;_e++)if(Ee){re?Me&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+_e,0,0,0,Be[_e].width,Be[_e].height,ot,Le,Be[_e].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+_e,0,_t,Be[_e].width,Be[_e].height,0,ot,Le,Be[_e].data);for(let Se=0;Se>ge),ht=Math.max(1,B.height>>ge);be===t.TEXTURE_3D||be===t.TEXTURE_2D_ARRAY?n.texImage3D(be,ge,Je,Be,ht,B.depth,0,rt,Ie,null):n.texImage2D(be,ge,Je,Be,ht,0,rt,Ie,null)}n.bindFramebuffer(t.FRAMEBUFFER,J),ct(B)?s.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,me,be,Ee.__webglTexture,0,Re(B)):(be===t.TEXTURE_2D||be>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&be<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,me,be,Ee.__webglTexture,ge),n.bindFramebuffer(t.FRAMEBUFFER,null)}function ae(J,B,ue){if(t.bindRenderbuffer(t.RENDERBUFFER,J),B.depthBuffer){const me=B.depthTexture,be=me&&me.isDepthTexture?me.type:null,ge=S(B.stencilBuffer,be),rt=B.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,Ie=Re(B);ct(B)?s.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,Ie,ge,B.width,B.height):ue?t.renderbufferStorageMultisample(t.RENDERBUFFER,Ie,ge,B.width,B.height):t.renderbufferStorage(t.RENDERBUFFER,ge,B.width,B.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,rt,t.RENDERBUFFER,J)}else{const me=B.textures;for(let be=0;be{delete B.__boundDepthTexture,delete B.__depthDisposeCallback,me.removeEventListener("dispose",be)};me.addEventListener("dispose",be),B.__depthDisposeCallback=be}B.__boundDepthTexture=me}if(J.depthTexture&&!B.__autoAllocateDepthBuffer){if(ue)throw new Error("target.depthTexture not supported in Cube render targets");const me=J.texture.mipmaps;me&&me.length>0?fe(B.__webglFramebuffer[0],J):fe(B.__webglFramebuffer,J)}else if(ue){B.__webglDepthbuffer=[];for(let me=0;me<6;me++)if(n.bindFramebuffer(t.FRAMEBUFFER,B.__webglFramebuffer[me]),B.__webglDepthbuffer[me]===void 0)B.__webglDepthbuffer[me]=t.createRenderbuffer(),ae(B.__webglDepthbuffer[me],J,!1);else{const be=J.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,ge=B.__webglDepthbuffer[me];t.bindRenderbuffer(t.RENDERBUFFER,ge),t.framebufferRenderbuffer(t.FRAMEBUFFER,be,t.RENDERBUFFER,ge)}}else{const me=J.texture.mipmaps;if(me&&me.length>0?n.bindFramebuffer(t.FRAMEBUFFER,B.__webglFramebuffer[0]):n.bindFramebuffer(t.FRAMEBUFFER,B.__webglFramebuffer),B.__webglDepthbuffer===void 0)B.__webglDepthbuffer=t.createRenderbuffer(),ae(B.__webglDepthbuffer,J,!1);else{const be=J.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,ge=B.__webglDepthbuffer;t.bindRenderbuffer(t.RENDERBUFFER,ge),t.framebufferRenderbuffer(t.FRAMEBUFFER,be,t.RENDERBUFFER,ge)}}n.bindFramebuffer(t.FRAMEBUFFER,null)}function le(J,B,ue){const me=r.get(J);B!==void 0&&ce(me.__webglFramebuffer,J,J.texture,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,0),ue!==void 0&&we(J)}function ie(J){const B=J.texture,ue=r.get(J),me=r.get(B);J.addEventListener("dispose",T);const be=J.textures,ge=J.isWebGLCubeRenderTarget===!0,rt=be.length>1;if(rt||(me.__webglTexture===void 0&&(me.__webglTexture=t.createTexture()),me.__version=B.version,a.memory.textures++),ge){ue.__webglFramebuffer=[];for(let Ie=0;Ie<6;Ie++)if(B.mipmaps&&B.mipmaps.length>0){ue.__webglFramebuffer[Ie]=[];for(let Je=0;Je0){ue.__webglFramebuffer=[];for(let Ie=0;Ie0&&ct(J)===!1){ue.__webglMultisampledFramebuffer=t.createFramebuffer(),ue.__webglColorRenderbuffer=[],n.bindFramebuffer(t.FRAMEBUFFER,ue.__webglMultisampledFramebuffer);for(let Ie=0;Ie0)for(let Je=0;Je0)for(let Je=0;Je0){if(ct(J)===!1){const B=J.textures,ue=J.width,me=J.height;let be=t.COLOR_BUFFER_BIT;const ge=J.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,rt=r.get(J),Ie=B.length>1;if(Ie)for(let tt=0;tt0?n.bindFramebuffer(t.DRAW_FRAMEBUFFER,rt.__webglFramebuffer[0]):n.bindFramebuffer(t.DRAW_FRAMEBUFFER,rt.__webglFramebuffer);for(let tt=0;tt0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&B.__useRenderToTexture!==!1}function Ye(J){const B=a.render.frame;u.get(J)!==B&&(u.set(J,B),J.update())}function it(J,B){const ue=J.colorSpace,me=J.format,be=J.type;return J.isCompressedTexture===!0||J.isVideoTexture===!0||ue!==Kr&&ue!==Ds&&(Dt.getTransfer(ue)===an?(me!==Zi||be!==_a)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",ue)),B}function Ft(J){return typeof HTMLImageElement<"u"&&J instanceof HTMLImageElement?(c.width=J.naturalWidth||J.width,c.height=J.naturalHeight||J.height):typeof VideoFrame<"u"&&J instanceof VideoFrame?(c.width=J.displayWidth,c.height=J.displayHeight):(c.width=J.width,c.height=J.height),c}this.allocateTextureUnit=D,this.resetTextureUnits=R,this.setTexture2D=U,this.setTexture2DArray=O,this.setTexture3D=W,this.setTextureCube=L,this.rebindTextures=le,this.setupRenderTarget=ie,this.updateRenderTargetMipmap=G,this.updateMultisampleRenderTarget=st,this.setupDepthRenderbuffer=we,this.setupFrameBufferTexture=ce,this.useMultisampledRTT=ct}function Foe(t,e){function n(r,i=Ds){let o;const a=Dt.getTransfer(i);if(r===_a)return t.UNSIGNED_BYTE;if(r===VA)return t.UNSIGNED_SHORT_4_4_4_4;if(r===GA)return t.UNSIGNED_SHORT_5_5_5_1;if(r===A4)return t.UNSIGNED_INT_5_9_9_9_REV;if(r===T4)return t.BYTE;if(r===M4)return t.SHORT;if(r===Ep)return t.UNSIGNED_SHORT;if(r===HA)return t.INT;if(r===Nc)return t.UNSIGNED_INT;if(r===Io)return t.FLOAT;if(r===Om)return t.HALF_FLOAT;if(r===C4)return t.ALPHA;if(r===P4)return t.RGB;if(r===Zi)return t.RGBA;if(r===Mp)return t.DEPTH_COMPONENT;if(r===Ap)return t.DEPTH_STENCIL;if(r===WA)return t.RED;if(r===XA)return t.RED_INTEGER;if(r===R4)return t.RG;if(r===qA)return t.RG_INTEGER;if(r===KA)return t.RGBA_INTEGER;if(r===zv||r===Hv||r===Vv||r===Gv)if(a===an)if(o=e.get("WEBGL_compressed_texture_s3tc_srgb"),o!==null){if(r===zv)return o.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(r===Hv)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(r===Vv)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(r===Gv)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(o=e.get("WEBGL_compressed_texture_s3tc"),o!==null){if(r===zv)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(r===Hv)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(r===Vv)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(r===Gv)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(r===$E||r===zE||r===HE||r===VE)if(o=e.get("WEBGL_compressed_texture_pvrtc"),o!==null){if(r===$E)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(r===zE)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(r===HE)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(r===VE)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(r===GE||r===WE||r===XE)if(o=e.get("WEBGL_compressed_texture_etc"),o!==null){if(r===GE||r===WE)return a===an?o.COMPRESSED_SRGB8_ETC2:o.COMPRESSED_RGB8_ETC2;if(r===XE)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:o.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(r===qE||r===KE||r===YE||r===JE||r===ZE||r===QE||r===e1||r===t1||r===n1||r===r1||r===i1||r===o1||r===a1||r===s1)if(o=e.get("WEBGL_compressed_texture_astc"),o!==null){if(r===qE)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:o.COMPRESSED_RGBA_ASTC_4x4_KHR;if(r===KE)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:o.COMPRESSED_RGBA_ASTC_5x4_KHR;if(r===YE)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:o.COMPRESSED_RGBA_ASTC_5x5_KHR;if(r===JE)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:o.COMPRESSED_RGBA_ASTC_6x5_KHR;if(r===ZE)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:o.COMPRESSED_RGBA_ASTC_6x6_KHR;if(r===QE)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:o.COMPRESSED_RGBA_ASTC_8x5_KHR;if(r===e1)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:o.COMPRESSED_RGBA_ASTC_8x6_KHR;if(r===t1)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:o.COMPRESSED_RGBA_ASTC_8x8_KHR;if(r===n1)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:o.COMPRESSED_RGBA_ASTC_10x5_KHR;if(r===r1)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:o.COMPRESSED_RGBA_ASTC_10x6_KHR;if(r===i1)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:o.COMPRESSED_RGBA_ASTC_10x8_KHR;if(r===o1)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:o.COMPRESSED_RGBA_ASTC_10x10_KHR;if(r===a1)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:o.COMPRESSED_RGBA_ASTC_12x10_KHR;if(r===s1)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:o.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(r===Wv||r===l1||r===c1)if(o=e.get("EXT_texture_compression_bptc"),o!==null){if(r===Wv)return a===an?o.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:o.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(r===l1)return o.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(r===c1)return o.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(r===N4||r===u1||r===d1||r===f1)if(o=e.get("EXT_texture_compression_rgtc"),o!==null){if(r===Wv)return o.COMPRESSED_RED_RGTC1_EXT;if(r===u1)return o.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(r===d1)return o.COMPRESSED_RED_GREEN_RGTC2_EXT;if(r===f1)return o.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return r===Tp?t.UNSIGNED_INT_24_8:t[r]!==void 0?t[r]:null}return{convert:n}}const Boe=` +}`;function joe(t,e,n){let r=new rC;const i=new xt,o=new xt,a=new Yt,s=new Uee({depthPacking:PQ}),l=new Fee,c={},u=n.maxTextureSize,d={[ba]:ui,[ui]:ba,[Ki]:Ki},f=new hl({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new xt},radius:{value:4}},vertexShader:Loe,fragmentShader:koe}),p=f.clone();p.defines.HORIZONTAL_PASS=1;const y=new br;y.setAttribute("position",new cr(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const v=new Tn(y,f),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=S4;let m=this.type;this.render=function(E,T,A){if(g.enabled===!1||g.autoUpdate===!1&&g.needsUpdate===!1||E.length===0)return;const M=t.getRenderTarget(),C=t.getActiveCubeFace(),P=t.getActiveMipmapLevel(),R=t.state;R.setBlending(tl),R.buffers.color.setClear(1,1,1,1),R.buffers.depth.setTest(!0),R.setScissorTest(!1);const D=m!==ja&&this.type===ja,k=m===ja&&this.type!==ja;for(let U=0,O=E.length;Uu||i.y>u)&&(i.x>u&&(o.x=Math.floor(u/j.x),i.x=o.x*j.x,L.mapSize.x=o.x),i.y>u&&(o.y=Math.floor(u/j.y),i.y=o.y*j.y,L.mapSize.y=o.y)),L.map===null||D===!0||k===!0){const te=this.type!==ja?{minFilter:Xr,magFilter:Xr}:{};L.map!==null&&L.map.dispose(),L.map=new Oc(i.x,i.y,te),L.map.texture.name=X.name+".shadowMap",L.camera.updateProjectionMatrix()}t.setRenderTarget(L.map),t.clear();const K=L.getViewportCount();for(let te=0;te0||T.map&&T.alphaTest>0||T.alphaToCoverage===!0){const R=C.uuid,D=T.uuid;let k=c[R];k===void 0&&(k={},c[R]=k);let U=k[D];U===void 0&&(U=C.clone(),k[D]=U,T.addEventListener("dispose",w)),C=U}if(C.visible=T.visible,C.wireframe=T.wireframe,M===ja?C.side=T.shadowSide!==null?T.shadowSide:T.side:C.side=T.shadowSide!==null?T.shadowSide:d[T.side],C.alphaMap=T.alphaMap,C.alphaTest=T.alphaToCoverage===!0?.5:T.alphaTest,C.map=T.map,C.clipShadows=T.clipShadows,C.clippingPlanes=T.clippingPlanes,C.clipIntersection=T.clipIntersection,C.displacementMap=T.displacementMap,C.displacementScale=T.displacementScale,C.displacementBias=T.displacementBias,C.wireframeLinewidth=T.wireframeLinewidth,C.linewidth=T.linewidth,A.isPointLight===!0&&C.isMeshDistanceMaterial===!0){const R=t.properties.get(C);R.light=A}return C}function S(E,T,A,M,C){if(E.visible===!1)return;if(E.layers.test(T.layers)&&(E.isMesh||E.isLine||E.isPoints)&&(E.castShadow||E.receiveShadow&&C===ja)&&(!E.frustumCulled||r.intersectsObject(E))){E.modelViewMatrix.multiplyMatrices(A.matrixWorldInverse,E.matrixWorld);const D=e.update(E),k=E.material;if(Array.isArray(k)){const U=D.groups;for(let O=0,X=U.length;O=1):L.indexOf("OpenGL ES")!==-1&&(X=parseFloat(/^OpenGL ES (\d)/.exec(L)[1]),O=X>=2);let j=null,K={};const te=t.getParameter(t.SCISSOR_BOX),H=t.getParameter(t.VIEWPORT),q=new Yt().fromArray(te),$=new Yt().fromArray(H);function Y(re,ke,Me,Ge){const Te=new Uint8Array(4),_e=t.createTexture();t.bindTexture(re,_e),t.texParameteri(re,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(re,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let Se=0;Se"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new xt,u=new WeakMap;let d;const f=new WeakMap;let p=!1;try{p=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function y(Z,F){return p?new OffscreenCanvas(Z,F):Rp("canvas")}function v(Z,F,ue){let me=1;const be=Ft(Z);if((be.width>ue||be.height>ue)&&(me=ue/Math.max(be.width,be.height)),me<1)if(typeof HTMLImageElement<"u"&&Z instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&Z instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&Z instanceof ImageBitmap||typeof VideoFrame<"u"&&Z instanceof VideoFrame){const ge=Math.floor(me*be.width),rt=Math.floor(me*be.height);d===void 0&&(d=y(ge,rt));const Ie=F?y(ge,rt):d;return Ie.width=ge,Ie.height=rt,Ie.getContext("2d").drawImage(Z,0,0,ge,rt),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+be.width+"x"+be.height+") to ("+ge+"x"+rt+")."),Ie}else return"data"in Z&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+be.width+"x"+be.height+")."),Z;return Z}function g(Z){return Z.generateMipmaps}function m(Z){t.generateMipmap(Z)}function x(Z){return Z.isWebGLCubeRenderTarget?t.TEXTURE_CUBE_MAP:Z.isWebGL3DRenderTarget?t.TEXTURE_3D:Z.isWebGLArrayRenderTarget||Z.isCompressedArrayTexture?t.TEXTURE_2D_ARRAY:t.TEXTURE_2D}function b(Z,F,ue,me,be=!1){if(Z!==null){if(t[Z]!==void 0)return t[Z];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+Z+"'")}let ge=F;if(F===t.RED&&(ue===t.FLOAT&&(ge=t.R32F),ue===t.HALF_FLOAT&&(ge=t.R16F),ue===t.UNSIGNED_BYTE&&(ge=t.R8)),F===t.RED_INTEGER&&(ue===t.UNSIGNED_BYTE&&(ge=t.R8UI),ue===t.UNSIGNED_SHORT&&(ge=t.R16UI),ue===t.UNSIGNED_INT&&(ge=t.R32UI),ue===t.BYTE&&(ge=t.R8I),ue===t.SHORT&&(ge=t.R16I),ue===t.INT&&(ge=t.R32I)),F===t.RG&&(ue===t.FLOAT&&(ge=t.RG32F),ue===t.HALF_FLOAT&&(ge=t.RG16F),ue===t.UNSIGNED_BYTE&&(ge=t.RG8)),F===t.RG_INTEGER&&(ue===t.UNSIGNED_BYTE&&(ge=t.RG8UI),ue===t.UNSIGNED_SHORT&&(ge=t.RG16UI),ue===t.UNSIGNED_INT&&(ge=t.RG32UI),ue===t.BYTE&&(ge=t.RG8I),ue===t.SHORT&&(ge=t.RG16I),ue===t.INT&&(ge=t.RG32I)),F===t.RGB_INTEGER&&(ue===t.UNSIGNED_BYTE&&(ge=t.RGB8UI),ue===t.UNSIGNED_SHORT&&(ge=t.RGB16UI),ue===t.UNSIGNED_INT&&(ge=t.RGB32UI),ue===t.BYTE&&(ge=t.RGB8I),ue===t.SHORT&&(ge=t.RGB16I),ue===t.INT&&(ge=t.RGB32I)),F===t.RGBA_INTEGER&&(ue===t.UNSIGNED_BYTE&&(ge=t.RGBA8UI),ue===t.UNSIGNED_SHORT&&(ge=t.RGBA16UI),ue===t.UNSIGNED_INT&&(ge=t.RGBA32UI),ue===t.BYTE&&(ge=t.RGBA8I),ue===t.SHORT&&(ge=t.RGBA16I),ue===t.INT&&(ge=t.RGBA32I)),F===t.RGB&&ue===t.UNSIGNED_INT_5_9_9_9_REV&&(ge=t.RGB9_E5),F===t.RGBA){const rt=be?Ry:Dt.getTransfer(me);ue===t.FLOAT&&(ge=t.RGBA32F),ue===t.HALF_FLOAT&&(ge=t.RGBA16F),ue===t.UNSIGNED_BYTE&&(ge=rt===an?t.SRGB8_ALPHA8:t.RGBA8),ue===t.UNSIGNED_SHORT_4_4_4_4&&(ge=t.RGBA4),ue===t.UNSIGNED_SHORT_5_5_5_1&&(ge=t.RGB5_A1)}return(ge===t.R16F||ge===t.R32F||ge===t.RG16F||ge===t.RG32F||ge===t.RGBA16F||ge===t.RGBA32F)&&e.get("EXT_color_buffer_float"),ge}function S(Z,F){let ue;return Z?F===null||F===Nc||F===Tp?ue=t.DEPTH24_STENCIL8:F===Do?ue=t.DEPTH32F_STENCIL8:F===Ep&&(ue=t.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):F===null||F===Nc||F===Tp?ue=t.DEPTH_COMPONENT24:F===Do?ue=t.DEPTH_COMPONENT32F:F===Ep&&(ue=t.DEPTH_COMPONENT16),ue}function w(Z,F){return g(Z)===!0||Z.isFramebufferTexture&&Z.minFilter!==Xr&&Z.minFilter!==Ir?Math.log2(Math.max(F.width,F.height))+1:Z.mipmaps!==void 0&&Z.mipmaps.length>0?Z.mipmaps.length:Z.isCompressedTexture&&Array.isArray(Z.image)?F.mipmaps.length:1}function E(Z){const F=Z.target;F.removeEventListener("dispose",E),A(F),F.isVideoTexture&&u.delete(F)}function T(Z){const F=Z.target;F.removeEventListener("dispose",T),C(F)}function A(Z){const F=r.get(Z);if(F.__webglInit===void 0)return;const ue=Z.source,me=f.get(ue);if(me){const be=me[F.__cacheKey];be.usedTimes--,be.usedTimes===0&&M(Z),Object.keys(me).length===0&&f.delete(ue)}r.remove(Z)}function M(Z){const F=r.get(Z);t.deleteTexture(F.__webglTexture);const ue=Z.source,me=f.get(ue);delete me[F.__cacheKey],a.memory.textures--}function C(Z){const F=r.get(Z);if(Z.depthTexture&&(Z.depthTexture.dispose(),r.remove(Z.depthTexture)),Z.isWebGLCubeRenderTarget)for(let me=0;me<6;me++){if(Array.isArray(F.__webglFramebuffer[me]))for(let be=0;be=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+Z+" texture units while this GPU supports only "+i.maxTextures),P+=1,Z}function k(Z){const F=[];return F.push(Z.wrapS),F.push(Z.wrapT),F.push(Z.wrapR||0),F.push(Z.magFilter),F.push(Z.minFilter),F.push(Z.anisotropy),F.push(Z.internalFormat),F.push(Z.format),F.push(Z.type),F.push(Z.generateMipmaps),F.push(Z.premultiplyAlpha),F.push(Z.flipY),F.push(Z.unpackAlignment),F.push(Z.colorSpace),F.join()}function U(Z,F){const ue=r.get(Z);if(Z.isVideoTexture&&Ye(Z),Z.isRenderTargetTexture===!1&&Z.version>0&&ue.__version!==Z.version){const me=Z.image;if(me===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(me.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{ee(ue,Z,F);return}}n.bindTexture(t.TEXTURE_2D,ue.__webglTexture,t.TEXTURE0+F)}function O(Z,F){const ue=r.get(Z);if(Z.version>0&&ue.__version!==Z.version){ee(ue,Z,F);return}n.bindTexture(t.TEXTURE_2D_ARRAY,ue.__webglTexture,t.TEXTURE0+F)}function X(Z,F){const ue=r.get(Z);if(Z.version>0&&ue.__version!==Z.version){ee(ue,Z,F);return}n.bindTexture(t.TEXTURE_3D,ue.__webglTexture,t.TEXTURE0+F)}function L(Z,F){const ue=r.get(Z);if(Z.version>0&&ue.__version!==Z.version){J(ue,Z,F);return}n.bindTexture(t.TEXTURE_CUBE_MAP,ue.__webglTexture,t.TEXTURE0+F)}const j={[ca]:t.REPEAT,[Ji]:t.CLAMP_TO_EDGE,[Py]:t.MIRRORED_REPEAT},K={[Xr]:t.NEAREST,[M4]:t.NEAREST_MIPMAP_NEAREST,[Ch]:t.NEAREST_MIPMAP_LINEAR,[Ir]:t.LINEAR,[$v]:t.LINEAR_MIPMAP_NEAREST,[Io]:t.LINEAR_MIPMAP_LINEAR},te={[NQ]:t.NEVER,[jQ]:t.ALWAYS,[OQ]:t.LESS,[L4]:t.LEQUAL,[IQ]:t.EQUAL,[kQ]:t.GEQUAL,[DQ]:t.GREATER,[LQ]:t.NOTEQUAL};function H(Z,F){if(F.type===Do&&e.has("OES_texture_float_linear")===!1&&(F.magFilter===Ir||F.magFilter===$v||F.magFilter===Ch||F.magFilter===Io||F.minFilter===Ir||F.minFilter===$v||F.minFilter===Ch||F.minFilter===Io)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),t.texParameteri(Z,t.TEXTURE_WRAP_S,j[F.wrapS]),t.texParameteri(Z,t.TEXTURE_WRAP_T,j[F.wrapT]),(Z===t.TEXTURE_3D||Z===t.TEXTURE_2D_ARRAY)&&t.texParameteri(Z,t.TEXTURE_WRAP_R,j[F.wrapR]),t.texParameteri(Z,t.TEXTURE_MAG_FILTER,K[F.magFilter]),t.texParameteri(Z,t.TEXTURE_MIN_FILTER,K[F.minFilter]),F.compareFunction&&(t.texParameteri(Z,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(Z,t.TEXTURE_COMPARE_FUNC,te[F.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(F.magFilter===Xr||F.minFilter!==Ch&&F.minFilter!==Io||F.type===Do&&e.has("OES_texture_float_linear")===!1)return;if(F.anisotropy>1||r.get(F).__currentAnisotropy){const ue=e.get("EXT_texture_filter_anisotropic");t.texParameterf(Z,ue.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(F.anisotropy,i.getMaxAnisotropy())),r.get(F).__currentAnisotropy=F.anisotropy}}}function q(Z,F){let ue=!1;Z.__webglInit===void 0&&(Z.__webglInit=!0,F.addEventListener("dispose",E));const me=F.source;let be=f.get(me);be===void 0&&(be={},f.set(me,be));const ge=k(F);if(ge!==Z.__cacheKey){be[ge]===void 0&&(be[ge]={texture:t.createTexture(),usedTimes:0},a.memory.textures++,ue=!0),be[ge].usedTimes++;const rt=be[Z.__cacheKey];rt!==void 0&&(be[Z.__cacheKey].usedTimes--,rt.usedTimes===0&&M(F)),Z.__cacheKey=ge,Z.__webglTexture=be[ge].texture}return ue}function $(Z,F,ue){return Math.floor(Math.floor(Z/ue)/F)}function Y(Z,F,ue,me){const ge=Z.updateRanges;if(ge.length===0)n.texSubImage2D(t.TEXTURE_2D,0,0,0,F.width,F.height,ue,me,F.data);else{ge.sort((Ee,Be)=>Ee.start-Be.start);let rt=0;for(let Ee=1;Ee0){re&&ke&&n.texStorage2D(t.TEXTURE_2D,Ge,ot,_t[0].width,_t[0].height);for(let Te=0,_e=_t.length;Te<_e;Te++)Le=_t[Te],re?Me&&n.texSubImage2D(t.TEXTURE_2D,Te,0,0,Le.width,Le.height,Be,ht,Le.data):n.texImage2D(t.TEXTURE_2D,Te,ot,Le.width,Le.height,0,Be,ht,Le.data);F.generateMipmaps=!1}else re?(ke&&n.texStorage2D(t.TEXTURE_2D,Ge,ot,Ee.width,Ee.height),Me&&Y(F,Ee,Be,ht)):n.texImage2D(t.TEXTURE_2D,0,ot,Ee.width,Ee.height,0,Be,ht,Ee.data);else if(F.isCompressedTexture)if(F.isCompressedArrayTexture){re&&ke&&n.texStorage3D(t.TEXTURE_2D_ARRAY,Ge,ot,_t[0].width,_t[0].height,Ee.depth);for(let Te=0,_e=_t.length;Te<_e;Te++)if(Le=_t[Te],F.format!==Zi)if(Be!==null)if(re){if(Me)if(F.layerUpdates.size>0){const Se=OO(Le.width,Le.height,F.format,F.type);for(const je of F.layerUpdates){const vt=Le.data.subarray(je*Se/Le.data.BYTES_PER_ELEMENT,(je+1)*Se/Le.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,Te,0,0,je,Le.width,Le.height,1,Be,vt)}F.clearLayerUpdates()}else n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,Te,0,0,0,Le.width,Le.height,Ee.depth,Be,Le.data)}else n.compressedTexImage3D(t.TEXTURE_2D_ARRAY,Te,ot,Le.width,Le.height,Ee.depth,0,Le.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else re?Me&&n.texSubImage3D(t.TEXTURE_2D_ARRAY,Te,0,0,0,Le.width,Le.height,Ee.depth,Be,ht,Le.data):n.texImage3D(t.TEXTURE_2D_ARRAY,Te,ot,Le.width,Le.height,Ee.depth,0,Be,ht,Le.data)}else{re&&ke&&n.texStorage2D(t.TEXTURE_2D,Ge,ot,_t[0].width,_t[0].height);for(let Te=0,_e=_t.length;Te<_e;Te++)Le=_t[Te],F.format!==Zi?Be!==null?re?Me&&n.compressedTexSubImage2D(t.TEXTURE_2D,Te,0,0,Le.width,Le.height,Be,Le.data):n.compressedTexImage2D(t.TEXTURE_2D,Te,ot,Le.width,Le.height,0,Le.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):re?Me&&n.texSubImage2D(t.TEXTURE_2D,Te,0,0,Le.width,Le.height,Be,ht,Le.data):n.texImage2D(t.TEXTURE_2D,Te,ot,Le.width,Le.height,0,Be,ht,Le.data)}else if(F.isDataArrayTexture)if(re){if(ke&&n.texStorage3D(t.TEXTURE_2D_ARRAY,Ge,ot,Ee.width,Ee.height,Ee.depth),Me)if(F.layerUpdates.size>0){const Te=OO(Ee.width,Ee.height,F.format,F.type);for(const _e of F.layerUpdates){const Se=Ee.data.subarray(_e*Te/Ee.data.BYTES_PER_ELEMENT,(_e+1)*Te/Ee.data.BYTES_PER_ELEMENT);n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,_e,Ee.width,Ee.height,1,Be,ht,Se)}F.clearLayerUpdates()}else n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,0,Ee.width,Ee.height,Ee.depth,Be,ht,Ee.data)}else n.texImage3D(t.TEXTURE_2D_ARRAY,0,ot,Ee.width,Ee.height,Ee.depth,0,Be,ht,Ee.data);else if(F.isData3DTexture)re?(ke&&n.texStorage3D(t.TEXTURE_3D,Ge,ot,Ee.width,Ee.height,Ee.depth),Me&&n.texSubImage3D(t.TEXTURE_3D,0,0,0,0,Ee.width,Ee.height,Ee.depth,Be,ht,Ee.data)):n.texImage3D(t.TEXTURE_3D,0,ot,Ee.width,Ee.height,Ee.depth,0,Be,ht,Ee.data);else if(F.isFramebufferTexture){if(ke)if(re)n.texStorage2D(t.TEXTURE_2D,Ge,ot,Ee.width,Ee.height);else{let Te=Ee.width,_e=Ee.height;for(let Se=0;Se>=1,_e>>=1}}else if(_t.length>0){if(re&&ke){const Te=Ft(_t[0]);n.texStorage2D(t.TEXTURE_2D,Ge,ot,Te.width,Te.height)}for(let Te=0,_e=_t.length;Te<_e;Te++)Le=_t[Te],re?Me&&n.texSubImage2D(t.TEXTURE_2D,Te,0,0,Be,ht,Le):n.texImage2D(t.TEXTURE_2D,Te,ot,Be,ht,Le);F.generateMipmaps=!1}else if(re){if(ke){const Te=Ft(Ee);n.texStorage2D(t.TEXTURE_2D,Ge,ot,Te.width,Te.height)}Me&&n.texSubImage2D(t.TEXTURE_2D,0,0,0,Be,ht,Ee)}else n.texImage2D(t.TEXTURE_2D,0,ot,Be,ht,Ee);g(F)&&m(me),rt.__version=ge.version,F.onUpdate&&F.onUpdate(F)}Z.__version=F.version}function J(Z,F,ue){if(F.image.length!==6)return;const me=q(Z,F),be=F.source;n.bindTexture(t.TEXTURE_CUBE_MAP,Z.__webglTexture,t.TEXTURE0+ue);const ge=r.get(be);if(be.version!==ge.__version||me===!0){n.activeTexture(t.TEXTURE0+ue);const rt=Dt.getPrimaries(Dt.workingColorSpace),Ie=F.colorSpace===Ds?null:Dt.getPrimaries(F.colorSpace),Ze=F.colorSpace===Ds||rt===Ie?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,F.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,F.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,F.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ze);const tt=F.isCompressedTexture||F.image[0].isCompressedTexture,Ee=F.image[0]&&F.image[0].isDataTexture,Be=[];for(let _e=0;_e<6;_e++)!tt&&!Ee?Be[_e]=v(F.image[_e],!0,i.maxCubemapSize):Be[_e]=Ee?F.image[_e].image:F.image[_e],Be[_e]=it(F,Be[_e]);const ht=Be[0],ot=o.convert(F.format,F.colorSpace),Le=o.convert(F.type),_t=b(F.internalFormat,ot,Le,F.colorSpace),re=F.isVideoTexture!==!0,ke=ge.__version===void 0||me===!0,Me=be.dataReady;let Ge=w(F,ht);H(t.TEXTURE_CUBE_MAP,F);let Te;if(tt){re&&ke&&n.texStorage2D(t.TEXTURE_CUBE_MAP,Ge,_t,ht.width,ht.height);for(let _e=0;_e<6;_e++){Te=Be[_e].mipmaps;for(let Se=0;Se0&&Ge++;const _e=Ft(Be[0]);n.texStorage2D(t.TEXTURE_CUBE_MAP,Ge,_t,_e.width,_e.height)}for(let _e=0;_e<6;_e++)if(Ee){re?Me&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+_e,0,0,0,Be[_e].width,Be[_e].height,ot,Le,Be[_e].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+_e,0,_t,Be[_e].width,Be[_e].height,0,ot,Le,Be[_e].data);for(let Se=0;Se>ge),ht=Math.max(1,F.height>>ge);be===t.TEXTURE_3D||be===t.TEXTURE_2D_ARRAY?n.texImage3D(be,ge,Ze,Be,ht,F.depth,0,rt,Ie,null):n.texImage2D(be,ge,Ze,Be,ht,0,rt,Ie,null)}n.bindFramebuffer(t.FRAMEBUFFER,Z),ct(F)?s.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,me,be,Ee.__webglTexture,0,Re(F)):(be===t.TEXTURE_2D||be>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&be<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,me,be,Ee.__webglTexture,ge),n.bindFramebuffer(t.FRAMEBUFFER,null)}function ae(Z,F,ue){if(t.bindRenderbuffer(t.RENDERBUFFER,Z),F.depthBuffer){const me=F.depthTexture,be=me&&me.isDepthTexture?me.type:null,ge=S(F.stencilBuffer,be),rt=F.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,Ie=Re(F);ct(F)?s.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,Ie,ge,F.width,F.height):ue?t.renderbufferStorageMultisample(t.RENDERBUFFER,Ie,ge,F.width,F.height):t.renderbufferStorage(t.RENDERBUFFER,ge,F.width,F.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,rt,t.RENDERBUFFER,Z)}else{const me=F.textures;for(let be=0;be{delete F.__boundDepthTexture,delete F.__depthDisposeCallback,me.removeEventListener("dispose",be)};me.addEventListener("dispose",be),F.__depthDisposeCallback=be}F.__boundDepthTexture=me}if(Z.depthTexture&&!F.__autoAllocateDepthBuffer){if(ue)throw new Error("target.depthTexture not supported in Cube render targets");const me=Z.texture.mipmaps;me&&me.length>0?fe(F.__webglFramebuffer[0],Z):fe(F.__webglFramebuffer,Z)}else if(ue){F.__webglDepthbuffer=[];for(let me=0;me<6;me++)if(n.bindFramebuffer(t.FRAMEBUFFER,F.__webglFramebuffer[me]),F.__webglDepthbuffer[me]===void 0)F.__webglDepthbuffer[me]=t.createRenderbuffer(),ae(F.__webglDepthbuffer[me],Z,!1);else{const be=Z.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,ge=F.__webglDepthbuffer[me];t.bindRenderbuffer(t.RENDERBUFFER,ge),t.framebufferRenderbuffer(t.FRAMEBUFFER,be,t.RENDERBUFFER,ge)}}else{const me=Z.texture.mipmaps;if(me&&me.length>0?n.bindFramebuffer(t.FRAMEBUFFER,F.__webglFramebuffer[0]):n.bindFramebuffer(t.FRAMEBUFFER,F.__webglFramebuffer),F.__webglDepthbuffer===void 0)F.__webglDepthbuffer=t.createRenderbuffer(),ae(F.__webglDepthbuffer,Z,!1);else{const be=Z.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,ge=F.__webglDepthbuffer;t.bindRenderbuffer(t.RENDERBUFFER,ge),t.framebufferRenderbuffer(t.FRAMEBUFFER,be,t.RENDERBUFFER,ge)}}n.bindFramebuffer(t.FRAMEBUFFER,null)}function le(Z,F,ue){const me=r.get(Z);F!==void 0&&ce(me.__webglFramebuffer,Z,Z.texture,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,0),ue!==void 0&&we(Z)}function ie(Z){const F=Z.texture,ue=r.get(Z),me=r.get(F);Z.addEventListener("dispose",T);const be=Z.textures,ge=Z.isWebGLCubeRenderTarget===!0,rt=be.length>1;if(rt||(me.__webglTexture===void 0&&(me.__webglTexture=t.createTexture()),me.__version=F.version,a.memory.textures++),ge){ue.__webglFramebuffer=[];for(let Ie=0;Ie<6;Ie++)if(F.mipmaps&&F.mipmaps.length>0){ue.__webglFramebuffer[Ie]=[];for(let Ze=0;Ze0){ue.__webglFramebuffer=[];for(let Ie=0;Ie0&&ct(Z)===!1){ue.__webglMultisampledFramebuffer=t.createFramebuffer(),ue.__webglColorRenderbuffer=[],n.bindFramebuffer(t.FRAMEBUFFER,ue.__webglMultisampledFramebuffer);for(let Ie=0;Ie0)for(let Ze=0;Ze0)for(let Ze=0;Ze0){if(ct(Z)===!1){const F=Z.textures,ue=Z.width,me=Z.height;let be=t.COLOR_BUFFER_BIT;const ge=Z.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,rt=r.get(Z),Ie=F.length>1;if(Ie)for(let tt=0;tt0?n.bindFramebuffer(t.DRAW_FRAMEBUFFER,rt.__webglFramebuffer[0]):n.bindFramebuffer(t.DRAW_FRAMEBUFFER,rt.__webglFramebuffer);for(let tt=0;tt0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&F.__useRenderToTexture!==!1}function Ye(Z){const F=a.render.frame;u.get(Z)!==F&&(u.set(Z,F),Z.update())}function it(Z,F){const ue=Z.colorSpace,me=Z.format,be=Z.type;return Z.isCompressedTexture===!0||Z.isVideoTexture===!0||ue!==Kr&&ue!==Ds&&(Dt.getTransfer(ue)===an?(me!==Zi||be!==_a)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",ue)),F}function Ft(Z){return typeof HTMLImageElement<"u"&&Z instanceof HTMLImageElement?(c.width=Z.naturalWidth||Z.width,c.height=Z.naturalHeight||Z.height):typeof VideoFrame<"u"&&Z instanceof VideoFrame?(c.width=Z.displayWidth,c.height=Z.displayHeight):(c.width=Z.width,c.height=Z.height),c}this.allocateTextureUnit=D,this.resetTextureUnits=R,this.setTexture2D=U,this.setTexture2DArray=O,this.setTexture3D=X,this.setTextureCube=L,this.rebindTextures=le,this.setupRenderTarget=ie,this.updateRenderTargetMipmap=W,this.updateMultisampleRenderTarget=st,this.setupDepthRenderbuffer=we,this.setupFrameBufferTexture=ce,this.useMultisampledRTT=ct}function $oe(t,e){function n(r,i=Ds){let o;const a=Dt.getTransfer(i);if(r===_a)return t.UNSIGNED_BYTE;if(r===GA)return t.UNSIGNED_SHORT_4_4_4_4;if(r===WA)return t.UNSIGNED_SHORT_5_5_5_1;if(r===P4)return t.UNSIGNED_INT_5_9_9_9_REV;if(r===A4)return t.BYTE;if(r===C4)return t.SHORT;if(r===Ep)return t.UNSIGNED_SHORT;if(r===VA)return t.INT;if(r===Nc)return t.UNSIGNED_INT;if(r===Do)return t.FLOAT;if(r===Om)return t.HALF_FLOAT;if(r===R4)return t.ALPHA;if(r===N4)return t.RGB;if(r===Zi)return t.RGBA;if(r===Mp)return t.DEPTH_COMPONENT;if(r===Ap)return t.DEPTH_STENCIL;if(r===XA)return t.RED;if(r===qA)return t.RED_INTEGER;if(r===O4)return t.RG;if(r===KA)return t.RG_INTEGER;if(r===YA)return t.RGBA_INTEGER;if(r===zv||r===Hv||r===Vv||r===Gv)if(a===an)if(o=e.get("WEBGL_compressed_texture_s3tc_srgb"),o!==null){if(r===zv)return o.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(r===Hv)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(r===Vv)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(r===Gv)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(o=e.get("WEBGL_compressed_texture_s3tc"),o!==null){if(r===zv)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(r===Hv)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(r===Vv)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(r===Gv)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(r===$E||r===zE||r===HE||r===VE)if(o=e.get("WEBGL_compressed_texture_pvrtc"),o!==null){if(r===$E)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(r===zE)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(r===HE)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(r===VE)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(r===GE||r===WE||r===XE)if(o=e.get("WEBGL_compressed_texture_etc"),o!==null){if(r===GE||r===WE)return a===an?o.COMPRESSED_SRGB8_ETC2:o.COMPRESSED_RGB8_ETC2;if(r===XE)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:o.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(r===qE||r===KE||r===YE||r===JE||r===ZE||r===QE||r===e1||r===t1||r===n1||r===r1||r===i1||r===o1||r===a1||r===s1)if(o=e.get("WEBGL_compressed_texture_astc"),o!==null){if(r===qE)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:o.COMPRESSED_RGBA_ASTC_4x4_KHR;if(r===KE)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:o.COMPRESSED_RGBA_ASTC_5x4_KHR;if(r===YE)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:o.COMPRESSED_RGBA_ASTC_5x5_KHR;if(r===JE)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:o.COMPRESSED_RGBA_ASTC_6x5_KHR;if(r===ZE)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:o.COMPRESSED_RGBA_ASTC_6x6_KHR;if(r===QE)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:o.COMPRESSED_RGBA_ASTC_8x5_KHR;if(r===e1)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:o.COMPRESSED_RGBA_ASTC_8x6_KHR;if(r===t1)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:o.COMPRESSED_RGBA_ASTC_8x8_KHR;if(r===n1)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:o.COMPRESSED_RGBA_ASTC_10x5_KHR;if(r===r1)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:o.COMPRESSED_RGBA_ASTC_10x6_KHR;if(r===i1)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:o.COMPRESSED_RGBA_ASTC_10x8_KHR;if(r===o1)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:o.COMPRESSED_RGBA_ASTC_10x10_KHR;if(r===a1)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:o.COMPRESSED_RGBA_ASTC_12x10_KHR;if(r===s1)return a===an?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:o.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(r===Wv||r===l1||r===c1)if(o=e.get("EXT_texture_compression_bptc"),o!==null){if(r===Wv)return a===an?o.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:o.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(r===l1)return o.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(r===c1)return o.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(r===I4||r===u1||r===d1||r===f1)if(o=e.get("EXT_texture_compression_rgtc"),o!==null){if(r===Wv)return o.COMPRESSED_RED_RGTC1_EXT;if(r===u1)return o.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(r===d1)return o.COMPRESSED_RED_GREEN_RGTC2_EXT;if(r===f1)return o.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return r===Tp?t.UNSIGNED_INT_24_8:t[r]!==void 0?t[r]:null}return{convert:n}}const zoe=` void main() { gl_Position = vec4( position, 1.0 ); -}`,$oe=` +}`,Hoe=` uniform sampler2DArray depthColor; uniform float depthWidth; uniform float depthHeight; @@ -4175,33 +4180,33 @@ void main() { } -}`;class zoe{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,n,r){if(this.texture===null){const i=new lr,o=e.properties.get(i);o.__webglTexture=n.texture,(n.depthNear!==r.depthNear||n.depthFar!==r.depthFar)&&(this.depthNear=n.depthNear,this.depthFar=n.depthFar),this.texture=i}}getMesh(e){if(this.texture!==null&&this.mesh===null){const n=e.cameras[0].viewport,r=new hl({vertexShader:Boe,fragmentShader:$oe,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new Tn(new Im(20,20),r)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class Hoe extends Vc{constructor(e,n){super();const r=this;let i=null,o=1,a=null,s="local-floor",l=1,c=null,u=null,d=null,f=null,p=null,y=null;const v=new zoe,g=n.getContextAttributes();let m=null,x=null;const b=[],S=[],w=new xt;let E=null;const T=new gr;T.viewport=new Yt;const A=new gr;A.viewport=new Yt;const M=[T,A],C=new ete;let P=null,R=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(q){let ee=b[q];return ee===void 0&&(ee=new fw,b[q]=ee),ee.getTargetRaySpace()},this.getControllerGrip=function(q){let ee=b[q];return ee===void 0&&(ee=new fw,b[q]=ee),ee.getGripSpace()},this.getHand=function(q){let ee=b[q];return ee===void 0&&(ee=new fw,b[q]=ee),ee.getHandSpace()};function D(q){const ee=S.indexOf(q.inputSource);if(ee===-1)return;const te=b[ee];te!==void 0&&(te.update(q.inputSource,q.frame,c||a),te.dispatchEvent({type:q.type,data:q.inputSource}))}function k(){i.removeEventListener("select",D),i.removeEventListener("selectstart",D),i.removeEventListener("selectend",D),i.removeEventListener("squeeze",D),i.removeEventListener("squeezestart",D),i.removeEventListener("squeezeend",D),i.removeEventListener("end",k),i.removeEventListener("inputsourceschange",U);for(let q=0;q=0&&(S[Q]=null,b[Q].disconnect(te))}for(let ee=0;ee=S.length){S.push(te),Q=ae;break}else if(S[ae]===null){S[ae]=te,Q=ae;break}if(Q===-1)break}const ce=b[Q];ce&&ce.connect(te)}}const O=new ne,W=new ne;function L(q,ee,te){O.setFromMatrixPosition(ee.matrixWorld),W.setFromMatrixPosition(te.matrixWorld);const Q=O.distanceTo(W),ce=ee.projectionMatrix.elements,ae=te.projectionMatrix.elements,fe=ce[14]/(ce[10]-1),we=ce[14]/(ce[10]+1),le=(ce[9]+1)/ce[5],ie=(ce[9]-1)/ce[5],G=(ce[8]-1)/ce[0],Ve=(ae[8]+1)/ae[0],Ne=fe*G,st=fe*Ve,Re=Q/(-G+Ve),ct=Re*-G;if(ee.matrixWorld.decompose(q.position,q.quaternion,q.scale),q.translateX(ct),q.translateZ(Re),q.matrixWorld.compose(q.position,q.quaternion,q.scale),q.matrixWorldInverse.copy(q.matrixWorld).invert(),ce[10]===-1)q.projectionMatrix.copy(ee.projectionMatrix),q.projectionMatrixInverse.copy(ee.projectionMatrixInverse);else{const Ye=fe+Re,it=we+Re,Ft=Ne-ct,J=st+(Q-ct),B=le*we/it*Ye,ue=ie*we/it*Ye;q.projectionMatrix.makePerspective(Ft,J,B,ue,Ye,it),q.projectionMatrixInverse.copy(q.projectionMatrix).invert()}}function j(q,ee){ee===null?q.matrixWorld.copy(q.matrix):q.matrixWorld.multiplyMatrices(ee.matrixWorld,q.matrix),q.matrixWorldInverse.copy(q.matrixWorld).invert()}this.updateCamera=function(q){if(i===null)return;let ee=q.near,te=q.far;v.texture!==null&&(v.depthNear>0&&(ee=v.depthNear),v.depthFar>0&&(te=v.depthFar)),C.near=A.near=T.near=ee,C.far=A.far=T.far=te,(P!==C.near||R!==C.far)&&(i.updateRenderState({depthNear:C.near,depthFar:C.far}),P=C.near,R=C.far),T.layers.mask=q.layers.mask|2,A.layers.mask=q.layers.mask|4,C.layers.mask=T.layers.mask|A.layers.mask;const Q=q.parent,ce=C.cameras;j(C,Q);for(let ae=0;ae0&&(g.alphaTest.value=m.alphaTest);const x=e.get(m),b=x.envMap,S=x.envMapRotation;b&&(g.envMap.value=b,Ul.copy(S),Ul.x*=-1,Ul.y*=-1,Ul.z*=-1,b.isCubeTexture&&b.isRenderTargetTexture===!1&&(Ul.y*=-1,Ul.z*=-1),g.envMapRotation.value.setFromMatrix4(Voe.makeRotationFromEuler(Ul)),g.flipEnvMap.value=b.isCubeTexture&&b.isRenderTargetTexture===!1?-1:1,g.reflectivity.value=m.reflectivity,g.ior.value=m.ior,g.refractionRatio.value=m.refractionRatio),m.lightMap&&(g.lightMap.value=m.lightMap,g.lightMapIntensity.value=m.lightMapIntensity,n(m.lightMap,g.lightMapTransform)),m.aoMap&&(g.aoMap.value=m.aoMap,g.aoMapIntensity.value=m.aoMapIntensity,n(m.aoMap,g.aoMapTransform))}function a(g,m){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,m.map&&(g.map.value=m.map,n(m.map,g.mapTransform))}function s(g,m){g.dashSize.value=m.dashSize,g.totalSize.value=m.dashSize+m.gapSize,g.scale.value=m.scale}function l(g,m,x,b){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,g.size.value=m.size*x,g.scale.value=b*.5,m.map&&(g.map.value=m.map,n(m.map,g.uvTransform)),m.alphaMap&&(g.alphaMap.value=m.alphaMap,n(m.alphaMap,g.alphaMapTransform)),m.alphaTest>0&&(g.alphaTest.value=m.alphaTest)}function c(g,m){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,g.rotation.value=m.rotation,m.map&&(g.map.value=m.map,n(m.map,g.mapTransform)),m.alphaMap&&(g.alphaMap.value=m.alphaMap,n(m.alphaMap,g.alphaMapTransform)),m.alphaTest>0&&(g.alphaTest.value=m.alphaTest)}function u(g,m){g.specular.value.copy(m.specular),g.shininess.value=Math.max(m.shininess,1e-4)}function d(g,m){m.gradientMap&&(g.gradientMap.value=m.gradientMap)}function f(g,m){g.metalness.value=m.metalness,m.metalnessMap&&(g.metalnessMap.value=m.metalnessMap,n(m.metalnessMap,g.metalnessMapTransform)),g.roughness.value=m.roughness,m.roughnessMap&&(g.roughnessMap.value=m.roughnessMap,n(m.roughnessMap,g.roughnessMapTransform)),m.envMap&&(g.envMapIntensity.value=m.envMapIntensity)}function p(g,m,x){g.ior.value=m.ior,m.sheen>0&&(g.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),g.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(g.sheenColorMap.value=m.sheenColorMap,n(m.sheenColorMap,g.sheenColorMapTransform)),m.sheenRoughnessMap&&(g.sheenRoughnessMap.value=m.sheenRoughnessMap,n(m.sheenRoughnessMap,g.sheenRoughnessMapTransform))),m.clearcoat>0&&(g.clearcoat.value=m.clearcoat,g.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(g.clearcoatMap.value=m.clearcoatMap,n(m.clearcoatMap,g.clearcoatMapTransform)),m.clearcoatRoughnessMap&&(g.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap,n(m.clearcoatRoughnessMap,g.clearcoatRoughnessMapTransform)),m.clearcoatNormalMap&&(g.clearcoatNormalMap.value=m.clearcoatNormalMap,n(m.clearcoatNormalMap,g.clearcoatNormalMapTransform),g.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),m.side===ui&&g.clearcoatNormalScale.value.negate())),m.dispersion>0&&(g.dispersion.value=m.dispersion),m.iridescence>0&&(g.iridescence.value=m.iridescence,g.iridescenceIOR.value=m.iridescenceIOR,g.iridescenceThicknessMinimum.value=m.iridescenceThicknessRange[0],g.iridescenceThicknessMaximum.value=m.iridescenceThicknessRange[1],m.iridescenceMap&&(g.iridescenceMap.value=m.iridescenceMap,n(m.iridescenceMap,g.iridescenceMapTransform)),m.iridescenceThicknessMap&&(g.iridescenceThicknessMap.value=m.iridescenceThicknessMap,n(m.iridescenceThicknessMap,g.iridescenceThicknessMapTransform))),m.transmission>0&&(g.transmission.value=m.transmission,g.transmissionSamplerMap.value=x.texture,g.transmissionSamplerSize.value.set(x.width,x.height),m.transmissionMap&&(g.transmissionMap.value=m.transmissionMap,n(m.transmissionMap,g.transmissionMapTransform)),g.thickness.value=m.thickness,m.thicknessMap&&(g.thicknessMap.value=m.thicknessMap,n(m.thicknessMap,g.thicknessMapTransform)),g.attenuationDistance.value=m.attenuationDistance,g.attenuationColor.value.copy(m.attenuationColor)),m.anisotropy>0&&(g.anisotropyVector.value.set(m.anisotropy*Math.cos(m.anisotropyRotation),m.anisotropy*Math.sin(m.anisotropyRotation)),m.anisotropyMap&&(g.anisotropyMap.value=m.anisotropyMap,n(m.anisotropyMap,g.anisotropyMapTransform))),g.specularIntensity.value=m.specularIntensity,g.specularColor.value.copy(m.specularColor),m.specularColorMap&&(g.specularColorMap.value=m.specularColorMap,n(m.specularColorMap,g.specularColorMapTransform)),m.specularIntensityMap&&(g.specularIntensityMap.value=m.specularIntensityMap,n(m.specularIntensityMap,g.specularIntensityMapTransform))}function y(g,m){m.matcap&&(g.matcap.value=m.matcap)}function v(g,m){const x=e.get(m).light;g.referencePosition.value.setFromMatrixPosition(x.matrixWorld),g.nearDistance.value=x.shadow.camera.near,g.farDistance.value=x.shadow.camera.far}return{refreshFogUniforms:r,refreshMaterialUniforms:i}}function Woe(t,e,n,r){let i={},o={},a=[];const s=t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS);function l(x,b){const S=b.program;r.uniformBlockBinding(x,S)}function c(x,b){let S=i[x.id];S===void 0&&(y(x),S=u(x),i[x.id]=S,x.addEventListener("dispose",g));const w=b.program;r.updateUBOMapping(x,w);const E=e.render.frame;o[x.id]!==E&&(f(x),o[x.id]=E)}function u(x){const b=d();x.__bindingPointIndex=b;const S=t.createBuffer(),w=x.__size,E=x.usage;return t.bindBuffer(t.UNIFORM_BUFFER,S),t.bufferData(t.UNIFORM_BUFFER,w,E),t.bindBuffer(t.UNIFORM_BUFFER,null),t.bindBufferBase(t.UNIFORM_BUFFER,b,S),S}function d(){for(let x=0;x0&&(S+=w-E),x.__size=S,x.__cache={},this}function v(x){const b={boundary:0,storage:0};return typeof x=="number"||typeof x=="boolean"?(b.boundary=4,b.storage=4):x.isVector2?(b.boundary=8,b.storage=8):x.isVector3||x.isColor?(b.boundary=16,b.storage=12):x.isVector4?(b.boundary=16,b.storage=16):x.isMatrix3?(b.boundary=48,b.storage=48):x.isMatrix4?(b.boundary=64,b.storage=64):x.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",x),b}function g(x){const b=x.target;b.removeEventListener("dispose",g);const S=a.indexOf(b.__bindingPointIndex);a.splice(S,1),t.deleteBuffer(i[b.id]),delete i[b.id],delete o[b.id]}function m(){for(const x in i)t.deleteBuffer(i[x]);a=[],i={},o={}}return{bind:l,update:c,dispose:m}}class Xoe{constructor(e={}){const{canvas:n=ZQ(),context:r=null,depth:i=!0,stencil:o=!1,alpha:a=!1,antialias:s=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:d=!1,reverseDepthBuffer:f=!1}=e;this.isWebGLRenderer=!0;let p;if(r!==null){if(typeof WebGLRenderingContext<"u"&&r instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");p=r.getContextAttributes().alpha}else p=a;const y=new Uint32Array(4),v=new Int32Array(4);let g=null,m=null;const x=[],b=[];this.domElement=n,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=nl,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const S=this;let w=!1;this._outputColorSpace=Zt;let E=0,T=0,A=null,M=-1,C=null;const P=new Yt,R=new Yt;let D=null;const k=new ft(0);let U=0,O=n.width,W=n.height,L=1,j=null,X=null;const K=new Yt(0,0,O,W),F=new Yt(0,0,O,W);let Y=!1;const q=new nC;let ee=!1,te=!1;const Q=new gt,ce=new gt,ae=new ne,fe=new Yt,we={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let le=!1;function ie(){return A===null?L:1}let G=r;function Ve(z,oe){return n.getContext(z,oe)}try{const z={alpha:!0,depth:i,stencil:o,antialias:s,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:d};if("setAttribute"in n&&n.setAttribute("data-engine",`three.js r${zA}`),n.addEventListener("webglcontextlost",Ge,!1),n.addEventListener("webglcontextrestored",Te,!1),n.addEventListener("webglcontextcreationerror",_e,!1),G===null){const oe="webgl2";if(G=Ve(oe,z),G===null)throw Ve(oe)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(z){throw console.error("THREE.WebGLRenderer: "+z.message),z}let Ne,st,Re,ct,Ye,it,Ft,J,B,ue,me,be,ge,rt,Ie,Je,tt,Ee,Be,ht,ot,Le,_t,re;function ke(){Ne=new rie(G),Ne.init(),Le=new Foe(G,Ne),st=new Yre(G,Ne,e,Le),Re=new joe(G,Ne),st.reverseDepthBuffer&&f&&Re.buffers.depth.setReversed(!0),ct=new aie(G),Ye=new Eoe,it=new Uoe(G,Ne,Re,Ye,st,Le,ct),Ft=new Zre(S),J=new nie(S),B=new fte(G),_t=new qre(G,B),ue=new iie(G,B,ct,_t),me=new lie(G,ue,B,ct),Be=new sie(G,st,it),Je=new Jre(Ye),be=new Soe(S,Ft,J,Ne,st,_t,Je),ge=new Goe(S,Ye),rt=new Moe,Ie=new Ooe(Ne),Ee=new Xre(S,Ft,J,Re,me,p,l),tt=new Loe(S,me,st),re=new Woe(G,ct,st,Re),ht=new Kre(G,Ne,ct),ot=new oie(G,Ne,ct),ct.programs=be.programs,S.capabilities=st,S.extensions=Ne,S.properties=Ye,S.renderLists=rt,S.shadowMap=tt,S.state=Re,S.info=ct}ke();const Me=new Hoe(S,G);this.xr=Me,this.getContext=function(){return G},this.getContextAttributes=function(){return G.getContextAttributes()},this.forceContextLoss=function(){const z=Ne.get("WEBGL_lose_context");z&&z.loseContext()},this.forceContextRestore=function(){const z=Ne.get("WEBGL_lose_context");z&&z.restoreContext()},this.getPixelRatio=function(){return L},this.setPixelRatio=function(z){z!==void 0&&(L=z,this.setSize(O,W,!1))},this.getSize=function(z){return z.set(O,W)},this.setSize=function(z,oe,de=!0){if(Me.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}O=z,W=oe,n.width=Math.floor(z*L),n.height=Math.floor(oe*L),de===!0&&(n.style.width=z+"px",n.style.height=oe+"px"),this.setViewport(0,0,z,oe)},this.getDrawingBufferSize=function(z){return z.set(O*L,W*L).floor()},this.setDrawingBufferSize=function(z,oe,de){O=z,W=oe,L=de,n.width=Math.floor(z*de),n.height=Math.floor(oe*de),this.setViewport(0,0,z,oe)},this.getCurrentViewport=function(z){return z.copy(P)},this.getViewport=function(z){return z.copy(K)},this.setViewport=function(z,oe,de,he){z.isVector4?K.set(z.x,z.y,z.z,z.w):K.set(z,oe,de,he),Re.viewport(P.copy(K).multiplyScalar(L).round())},this.getScissor=function(z){return z.copy(F)},this.setScissor=function(z,oe,de,he){z.isVector4?F.set(z.x,z.y,z.z,z.w):F.set(z,oe,de,he),Re.scissor(R.copy(F).multiplyScalar(L).round())},this.getScissorTest=function(){return Y},this.setScissorTest=function(z){Re.setScissorTest(Y=z)},this.setOpaqueSort=function(z){j=z},this.setTransparentSort=function(z){X=z},this.getClearColor=function(z){return z.copy(Ee.getClearColor())},this.setClearColor=function(){Ee.setClearColor(...arguments)},this.getClearAlpha=function(){return Ee.getClearAlpha()},this.setClearAlpha=function(){Ee.setClearAlpha(...arguments)},this.clear=function(z=!0,oe=!0,de=!0){let he=0;if(z){let se=!1;if(A!==null){const Pe=A.texture.format;se=Pe===KA||Pe===qA||Pe===XA}if(se){const Pe=A.texture.type,Ue=Pe===_a||Pe===Nc||Pe===Ep||Pe===Tp||Pe===VA||Pe===GA,Ze=Ee.getClearColor(),We=Ee.getClearAlpha(),wt=Ze.r,St=Ze.g,ut=Ze.b;Ue?(y[0]=wt,y[1]=St,y[2]=ut,y[3]=We,G.clearBufferuiv(G.COLOR,0,y)):(v[0]=wt,v[1]=St,v[2]=ut,v[3]=We,G.clearBufferiv(G.COLOR,0,v))}else he|=G.COLOR_BUFFER_BIT}oe&&(he|=G.DEPTH_BUFFER_BIT),de&&(he|=G.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),G.clear(he)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){n.removeEventListener("webglcontextlost",Ge,!1),n.removeEventListener("webglcontextrestored",Te,!1),n.removeEventListener("webglcontextcreationerror",_e,!1),Ee.dispose(),rt.dispose(),Ie.dispose(),Ye.dispose(),Ft.dispose(),J.dispose(),me.dispose(),_t.dispose(),re.dispose(),be.dispose(),Me.dispose(),Me.removeEventListener("sessionstart",Ui),Me.removeEventListener("sessionend",_r),nr.stop()};function Ge(z){z.preventDefault(),w=!0}function Te(){w=!1;const z=ct.autoReset,oe=tt.enabled,de=tt.autoUpdate,he=tt.needsUpdate,se=tt.type;ke(),ct.autoReset=z,tt.enabled=oe,tt.autoUpdate=de,tt.needsUpdate=he,tt.type=se}function _e(z){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",z.statusMessage)}function Se(z){const oe=z.target;oe.removeEventListener("dispose",Se),je(oe)}function je(z){vt(z),Ye.remove(z)}function vt(z){const oe=Ye.get(z).programs;oe!==void 0&&(oe.forEach(function(de){be.releaseProgram(de)}),z.isShaderMaterial&&be.releaseShaderCache(z))}this.renderBufferDirect=function(z,oe,de,he,se,Pe){oe===null&&(oe=we);const Ue=se.isMesh&&se.matrixWorld.determinant()<0,Ze=Gb(z,oe,de,he,se);Re.setMaterial(he,Ue);let We=de.index,wt=1;if(he.wireframe===!0){if(We=ue.getWireframeAttribute(de),We===void 0)return;wt=2}const St=de.drawRange,ut=de.attributes.position;let At=St.start*wt,Kt=(St.start+St.count)*wt;Pe!==null&&(At=Math.max(At,Pe.start*wt),Kt=Math.min(Kt,(Pe.start+Pe.count)*wt)),We!==null?(At=Math.max(At,0),Kt=Math.min(Kt,We.count)):ut!=null&&(At=Math.max(At,0),Kt=Math.min(Kt,ut.count));const hn=Kt-At;if(hn<0||hn===1/0)return;_t.setup(se,he,Ze,de,We);let Sn,Bt=ht;if(We!==null&&(Sn=B.get(We),Bt=ot,Bt.setIndex(Sn)),se.isMesh)he.wireframe===!0?(Re.setLineWidth(he.wireframeLinewidth*ie()),Bt.setMode(G.LINES)):Bt.setMode(G.TRIANGLES);else if(se.isLine){let mt=he.linewidth;mt===void 0&&(mt=1),Re.setLineWidth(mt*ie()),se.isLineSegments?Bt.setMode(G.LINES):se.isLineLoop?Bt.setMode(G.LINE_LOOP):Bt.setMode(G.LINE_STRIP)}else se.isPoints?Bt.setMode(G.POINTS):se.isSprite&&Bt.setMode(G.TRIANGLES);if(se.isBatchedMesh)if(se._multiDrawInstances!==null)ld("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),Bt.renderMultiDrawInstances(se._multiDrawStarts,se._multiDrawCounts,se._multiDrawCount,se._multiDrawInstances);else if(Ne.get("WEBGL_multi_draw"))Bt.renderMultiDraw(se._multiDrawStarts,se._multiDrawCounts,se._multiDrawCount);else{const mt=se._multiDrawStarts,Vn=se._multiDrawCounts,Vt=se._multiDrawCount,Qr=We?B.get(We).bytesPerElement:1,pn=Ye.get(he).currentProgram.getUniforms();for(let fr=0;fr{function Pe(){if(he.forEach(function(Ue){Ye.get(Ue).currentProgram.isReady()&&he.delete(Ue)}),he.size===0){se(z);return}setTimeout(Pe,10)}Ne.get("KHR_parallel_shader_compile")!==null?Pe():setTimeout(Pe,10)})};let fn=null;function jn(z){fn&&fn(z)}function Ui(){nr.stop()}function _r(){nr.start()}const nr=new Q4;nr.setAnimationLoop(jn),typeof self<"u"&&nr.setContext(self),this.setAnimationLoop=function(z){fn=z,Me.setAnimationLoop(z),z===null?nr.stop():nr.start()},Me.addEventListener("sessionstart",Ui),Me.addEventListener("sessionend",_r),this.render=function(z,oe){if(oe!==void 0&&oe.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(w===!0)return;if(z.matrixWorldAutoUpdate===!0&&z.updateMatrixWorld(),oe.parent===null&&oe.matrixWorldAutoUpdate===!0&&oe.updateMatrixWorld(),Me.enabled===!0&&Me.isPresenting===!0&&(Me.cameraAutoUpdate===!0&&Me.updateCamera(oe),oe=Me.getCamera()),z.isScene===!0&&z.onBeforeRender(S,z,oe,A),m=Ie.get(z,b.length),m.init(oe),b.push(m),ce.multiplyMatrices(oe.projectionMatrix,oe.matrixWorldInverse),q.setFromProjectionMatrix(ce),te=this.localClippingEnabled,ee=Je.init(this.clippingPlanes,te),g=rt.get(z,x.length),g.init(),x.push(g),Me.enabled===!0&&Me.isPresenting===!0){const Pe=S.xr.getDepthSensingMesh();Pe!==null&&$f(Pe,oe,-1/0,S.sortObjects)}$f(z,oe,0,S.sortObjects),g.finish(),S.sortObjects===!0&&g.sort(j,X),le=Me.enabled===!1||Me.isPresenting===!1||Me.hasDepthSensing()===!1,le&&Ee.addToRenderList(g,z),this.info.render.frame++,ee===!0&&Je.beginShadows();const de=m.state.shadowsArray;tt.render(de,z,oe),ee===!0&&Je.endShadows(),this.info.autoReset===!0&&this.info.reset();const he=g.opaque,se=g.transmissive;if(m.setupLights(),oe.isArrayCamera){const Pe=oe.cameras;if(se.length>0)for(let Ue=0,Ze=Pe.length;Ue0&&zf(he,se,z,oe),le&&Ee.render(z),qm(g,z,oe);A!==null&&T===0&&(it.updateMultisampleRenderTarget(A),it.updateRenderTargetMipmap(A)),z.isScene===!0&&z.onAfterRender(S,z,oe),_t.resetDefaultState(),M=-1,C=null,b.pop(),b.length>0?(m=b[b.length-1],ee===!0&&Je.setGlobalState(S.clippingPlanes,m.state.camera)):m=null,x.pop(),x.length>0?g=x[x.length-1]:g=null};function $f(z,oe,de,he){if(z.visible===!1)return;if(z.layers.test(oe.layers)){if(z.isGroup)de=z.renderOrder;else if(z.isLOD)z.autoUpdate===!0&&z.update(oe);else if(z.isLight)m.pushLight(z),z.castShadow&&m.pushShadow(z);else if(z.isSprite){if(!z.frustumCulled||q.intersectsSprite(z)){he&&fe.setFromMatrixPosition(z.matrixWorld).applyMatrix4(ce);const Ue=me.update(z),Ze=z.material;Ze.visible&&g.push(z,Ue,Ze,de,fe.z,null)}}else if((z.isMesh||z.isLine||z.isPoints)&&(!z.frustumCulled||q.intersectsObject(z))){const Ue=me.update(z),Ze=z.material;if(he&&(z.boundingSphere!==void 0?(z.boundingSphere===null&&z.computeBoundingSphere(),fe.copy(z.boundingSphere.center)):(Ue.boundingSphere===null&&Ue.computeBoundingSphere(),fe.copy(Ue.boundingSphere.center)),fe.applyMatrix4(z.matrixWorld).applyMatrix4(ce)),Array.isArray(Ze)){const We=Ue.groups;for(let wt=0,St=We.length;wt0&&Zc(se,oe,de),Pe.length>0&&Zc(Pe,oe,de),Ue.length>0&&Zc(Ue,oe,de),Re.buffers.depth.setTest(!0),Re.buffers.depth.setMask(!0),Re.buffers.color.setMask(!0),Re.setPolygonOffset(!1)}function zf(z,oe,de,he){if((de.isScene===!0?de.overrideMaterial:null)!==null)return;m.state.transmissionRenderTarget[he.id]===void 0&&(m.state.transmissionRenderTarget[he.id]=new Oc(1,1,{generateMipmaps:!0,type:Ne.has("EXT_color_buffer_half_float")||Ne.has("EXT_color_buffer_float")?Om:_a,minFilter:Oo,samples:4,stencilBuffer:o,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Dt.workingColorSpace}));const Pe=m.state.transmissionRenderTarget[he.id],Ue=he.viewport||P;Pe.setSize(Ue.z*S.transmissionResolutionScale,Ue.w*S.transmissionResolutionScale);const Ze=S.getRenderTarget();S.setRenderTarget(Pe),S.getClearColor(k),U=S.getClearAlpha(),U<1&&S.setClearColor(16777215,.5),S.clear(),le&&Ee.render(de);const We=S.toneMapping;S.toneMapping=nl;const wt=he.viewport;if(he.viewport!==void 0&&(he.viewport=void 0),m.setupLightsView(he),ee===!0&&Je.setGlobalState(S.clippingPlanes,he),Zc(z,de,he),it.updateMultisampleRenderTarget(Pe),it.updateRenderTargetMipmap(Pe),Ne.has("WEBGL_multisampled_render_to_texture")===!1){let St=!1;for(let ut=0,At=oe.length;ut0),ut=!!de.morphAttributes.position,At=!!de.morphAttributes.normal,Kt=!!de.morphAttributes.color;let hn=nl;he.toneMapped&&(A===null||A.isXRRenderTarget===!0)&&(hn=S.toneMapping);const Sn=de.morphAttributes.position||de.morphAttributes.normal||de.morphAttributes.color,Bt=Sn!==void 0?Sn.length:0,mt=Ye.get(he),Vn=m.state.lights;if(ee===!0&&(te===!0||z!==C)){const Un=z===C&&he.id===M;Je.setState(he,z,Un)}let Vt=!1;he.version===mt.__version?(mt.needsLights&&mt.lightsStateVersion!==Vn.state.version||mt.outputColorSpace!==Ze||se.isBatchedMesh&&mt.batching===!1||!se.isBatchedMesh&&mt.batching===!0||se.isBatchedMesh&&mt.batchingColor===!0&&se.colorTexture===null||se.isBatchedMesh&&mt.batchingColor===!1&&se.colorTexture!==null||se.isInstancedMesh&&mt.instancing===!1||!se.isInstancedMesh&&mt.instancing===!0||se.isSkinnedMesh&&mt.skinning===!1||!se.isSkinnedMesh&&mt.skinning===!0||se.isInstancedMesh&&mt.instancingColor===!0&&se.instanceColor===null||se.isInstancedMesh&&mt.instancingColor===!1&&se.instanceColor!==null||se.isInstancedMesh&&mt.instancingMorph===!0&&se.morphTexture===null||se.isInstancedMesh&&mt.instancingMorph===!1&&se.morphTexture!==null||mt.envMap!==We||he.fog===!0&&mt.fog!==Pe||mt.numClippingPlanes!==void 0&&(mt.numClippingPlanes!==Je.numPlanes||mt.numIntersection!==Je.numIntersection)||mt.vertexAlphas!==wt||mt.vertexTangents!==St||mt.morphTargets!==ut||mt.morphNormals!==At||mt.morphColors!==Kt||mt.toneMapping!==hn||mt.morphTargetsCount!==Bt)&&(Vt=!0):(Vt=!0,mt.__version=he.version);let Qr=mt.currentProgram;Vt===!0&&(Qr=Qc(he,oe,se));let pn=!1,fr=!1,Ol=!1;const cn=Qr.getUniforms(),Lr=mt.uniforms;if(Re.useProgram(Qr.program)&&(pn=!0,fr=!0,Ol=!0),he.id!==M&&(M=he.id,fr=!0),pn||C!==z){Re.buffers.depth.getReversed()?(Q.copy(z.projectionMatrix),eee(Q),tee(Q),cn.setValue(G,"projectionMatrix",Q)):cn.setValue(G,"projectionMatrix",z.projectionMatrix),cn.setValue(G,"viewMatrix",z.matrixWorldInverse);const Gn=cn.map.cameraPosition;Gn!==void 0&&Gn.setValue(G,ae.setFromMatrixPosition(z.matrixWorld)),st.logarithmicDepthBuffer&&cn.setValue(G,"logDepthBufFC",2/(Math.log(z.far+1)/Math.LN2)),(he.isMeshPhongMaterial||he.isMeshToonMaterial||he.isMeshLambertMaterial||he.isMeshBasicMaterial||he.isMeshStandardMaterial||he.isShaderMaterial)&&cn.setValue(G,"isOrthographic",z.isOrthographicCamera===!0),C!==z&&(C=z,fr=!0,Ol=!0)}if(se.isSkinnedMesh){cn.setOptional(G,se,"bindMatrix"),cn.setOptional(G,se,"bindMatrixInverse");const Un=se.skeleton;Un&&(Un.boneTexture===null&&Un.computeBoneTexture(),cn.setValue(G,"boneTexture",Un.boneTexture,it))}se.isBatchedMesh&&(cn.setOptional(G,se,"batchingTexture"),cn.setValue(G,"batchingTexture",se._matricesTexture,it),cn.setOptional(G,se,"batchingIdTexture"),cn.setValue(G,"batchingIdTexture",se._indirectTexture,it),cn.setOptional(G,se,"batchingColorTexture"),se._colorsTexture!==null&&cn.setValue(G,"batchingColorTexture",se._colorsTexture,it));const wr=de.morphAttributes;if((wr.position!==void 0||wr.normal!==void 0||wr.color!==void 0)&&Be.update(se,de,Qr),(fr||mt.receiveShadow!==se.receiveShadow)&&(mt.receiveShadow=se.receiveShadow,cn.setValue(G,"receiveShadow",se.receiveShadow)),he.isMeshGouraudMaterial&&he.envMap!==null&&(Lr.envMap.value=We,Lr.flipEnvMap.value=We.isCubeTexture&&We.isRenderTargetTexture===!1?-1:1),he.isMeshStandardMaterial&&he.envMap===null&&oe.environment!==null&&(Lr.envMapIntensity.value=oe.environmentIntensity),fr&&(cn.setValue(G,"toneMappingExposure",S.toneMappingExposure),mt.needsLights&&Wb(Lr,Ol),Pe&&he.fog===!0&&ge.refreshFogUniforms(Lr,Pe),ge.refreshMaterialUniforms(Lr,he,L,W,m.state.transmissionRenderTarget[z.id]),qv.upload(G,Km(mt),Lr,it)),he.isShaderMaterial&&he.uniformsNeedUpdate===!0&&(qv.upload(G,Km(mt),Lr,it),he.uniformsNeedUpdate=!1),he.isSpriteMaterial&&cn.setValue(G,"center",se.center),cn.setValue(G,"modelViewMatrix",se.modelViewMatrix),cn.setValue(G,"normalMatrix",se.normalMatrix),cn.setValue(G,"modelMatrix",se.matrixWorld),he.isShaderMaterial||he.isRawShaderMaterial){const Un=he.uniformsGroups;for(let Gn=0,eu=Un.length;Gn0&&it.useMultisampledRTT(z)===!1?se=Ye.get(z).__webglMultisampledFramebuffer:Array.isArray(St)?se=St[de]:se=St,P.copy(z.viewport),R.copy(z.scissor),D=z.scissorTest}else P.copy(K).multiplyScalar(L).floor(),R.copy(F).multiplyScalar(L).floor(),D=Y;if(de!==0&&(se=qb),Re.bindFramebuffer(G.FRAMEBUFFER,se)&&he&&Re.drawBuffers(z,se),Re.viewport(P),Re.scissor(R),Re.setScissorTest(D),Pe){const We=Ye.get(z.texture);G.framebufferTexture2D(G.FRAMEBUFFER,G.COLOR_ATTACHMENT0,G.TEXTURE_CUBE_MAP_POSITIVE_X+oe,We.__webglTexture,de)}else if(Ue){const We=Ye.get(z.texture),wt=oe;G.framebufferTextureLayer(G.FRAMEBUFFER,G.COLOR_ATTACHMENT0,We.__webglTexture,de,wt)}else if(z!==null&&de!==0){const We=Ye.get(z.texture);G.framebufferTexture2D(G.FRAMEBUFFER,G.COLOR_ATTACHMENT0,G.TEXTURE_2D,We.__webglTexture,de)}M=-1},this.readRenderTargetPixels=function(z,oe,de,he,se,Pe,Ue,Ze=0){if(!(z&&z.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let We=Ye.get(z).__webglFramebuffer;if(z.isWebGLCubeRenderTarget&&Ue!==void 0&&(We=We[Ue]),We){Re.bindFramebuffer(G.FRAMEBUFFER,We);try{const wt=z.textures[Ze],St=wt.format,ut=wt.type;if(!st.textureFormatReadable(St)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!st.textureTypeReadable(ut)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}oe>=0&&oe<=z.width-he&&de>=0&&de<=z.height-se&&(z.textures.length>1&&G.readBuffer(G.COLOR_ATTACHMENT0+Ze),G.readPixels(oe,de,he,se,Le.convert(St),Le.convert(ut),Pe))}finally{const wt=A!==null?Ye.get(A).__webglFramebuffer:null;Re.bindFramebuffer(G.FRAMEBUFFER,wt)}}},this.readRenderTargetPixelsAsync=async function(z,oe,de,he,se,Pe,Ue,Ze=0){if(!(z&&z.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let We=Ye.get(z).__webglFramebuffer;if(z.isWebGLCubeRenderTarget&&Ue!==void 0&&(We=We[Ue]),We)if(oe>=0&&oe<=z.width-he&&de>=0&&de<=z.height-se){Re.bindFramebuffer(G.FRAMEBUFFER,We);const wt=z.textures[Ze],St=wt.format,ut=wt.type;if(!st.textureFormatReadable(St))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!st.textureTypeReadable(ut))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const At=G.createBuffer();G.bindBuffer(G.PIXEL_PACK_BUFFER,At),G.bufferData(G.PIXEL_PACK_BUFFER,Pe.byteLength,G.STREAM_READ),z.textures.length>1&&G.readBuffer(G.COLOR_ATTACHMENT0+Ze),G.readPixels(oe,de,he,se,Le.convert(St),Le.convert(ut),0);const Kt=A!==null?Ye.get(A).__webglFramebuffer:null;Re.bindFramebuffer(G.FRAMEBUFFER,Kt);const hn=G.fenceSync(G.SYNC_GPU_COMMANDS_COMPLETE,0);return G.flush(),await QQ(G,hn,4),G.bindBuffer(G.PIXEL_PACK_BUFFER,At),G.getBufferSubData(G.PIXEL_PACK_BUFFER,0,Pe),G.deleteBuffer(At),G.deleteSync(hn),Pe}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(z,oe=null,de=0){const he=Math.pow(2,-de),se=Math.floor(z.image.width*he),Pe=Math.floor(z.image.height*he),Ue=oe!==null?oe.x:0,Ze=oe!==null?oe.y:0;it.setTexture2D(z,0),G.copyTexSubImage2D(G.TEXTURE_2D,de,0,0,Ue,Ze,se,Pe),Re.unbindTexture()};const Kb=G.createFramebuffer(),Yb=G.createFramebuffer();this.copyTextureToTexture=function(z,oe,de=null,he=null,se=0,Pe=null){Pe===null&&(se!==0?(ld("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),Pe=se,se=0):Pe=0);let Ue,Ze,We,wt,St,ut,At,Kt,hn;const Sn=z.isCompressedTexture?z.mipmaps[Pe]:z.image;if(de!==null)Ue=de.max.x-de.min.x,Ze=de.max.y-de.min.y,We=de.isBox3?de.max.z-de.min.z:1,wt=de.min.x,St=de.min.y,ut=de.isBox3?de.min.z:0;else{const wr=Math.pow(2,-se);Ue=Math.floor(Sn.width*wr),Ze=Math.floor(Sn.height*wr),z.isDataArrayTexture?We=Sn.depth:z.isData3DTexture?We=Math.floor(Sn.depth*wr):We=1,wt=0,St=0,ut=0}he!==null?(At=he.x,Kt=he.y,hn=he.z):(At=0,Kt=0,hn=0);const Bt=Le.convert(oe.format),mt=Le.convert(oe.type);let Vn;oe.isData3DTexture?(it.setTexture3D(oe,0),Vn=G.TEXTURE_3D):oe.isDataArrayTexture||oe.isCompressedArrayTexture?(it.setTexture2DArray(oe,0),Vn=G.TEXTURE_2D_ARRAY):(it.setTexture2D(oe,0),Vn=G.TEXTURE_2D),G.pixelStorei(G.UNPACK_FLIP_Y_WEBGL,oe.flipY),G.pixelStorei(G.UNPACK_PREMULTIPLY_ALPHA_WEBGL,oe.premultiplyAlpha),G.pixelStorei(G.UNPACK_ALIGNMENT,oe.unpackAlignment);const Vt=G.getParameter(G.UNPACK_ROW_LENGTH),Qr=G.getParameter(G.UNPACK_IMAGE_HEIGHT),pn=G.getParameter(G.UNPACK_SKIP_PIXELS),fr=G.getParameter(G.UNPACK_SKIP_ROWS),Ol=G.getParameter(G.UNPACK_SKIP_IMAGES);G.pixelStorei(G.UNPACK_ROW_LENGTH,Sn.width),G.pixelStorei(G.UNPACK_IMAGE_HEIGHT,Sn.height),G.pixelStorei(G.UNPACK_SKIP_PIXELS,wt),G.pixelStorei(G.UNPACK_SKIP_ROWS,St),G.pixelStorei(G.UNPACK_SKIP_IMAGES,ut);const cn=z.isDataArrayTexture||z.isData3DTexture,Lr=oe.isDataArrayTexture||oe.isData3DTexture;if(z.isDepthTexture){const wr=Ye.get(z),Un=Ye.get(oe),Gn=Ye.get(wr.__renderTarget),eu=Ye.get(Un.__renderTarget);Re.bindFramebuffer(G.READ_FRAMEBUFFER,Gn.__webglFramebuffer),Re.bindFramebuffer(G.DRAW_FRAMEBUFFER,eu.__webglFramebuffer);for(let Ma=0;MaMath.PI&&(r-=ti),i<-Math.PI?i+=ti:i>Math.PI&&(i-=ti),r<=i?this._spherical.theta=Math.max(r,Math.min(i,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(r+i)/2?Math.max(r,this._spherical.theta):Math.min(i,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let o=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const a=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),o=a!=this._spherical.radius}if(Wn.setFromSpherical(this._spherical),Wn.applyQuaternion(this._quatInverse),n.copy(this.target).add(Wn),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let a=null;if(this.object.isPerspectiveCamera){const s=Wn.length();a=this._clampDistance(s*this._scale);const l=s-a;this.object.position.addScaledVector(this._dollyDirection,l),this.object.updateMatrixWorld(),o=!!l}else if(this.object.isOrthographicCamera){const s=new ne(this._mouse.x,this._mouse.y,0);s.unproject(this.object);const l=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),o=l!==this.object.zoom;const c=new ne(this._mouse.x,this._mouse.y,0);c.unproject(this.object),this.object.position.sub(c).add(s),this.object.updateMatrixWorld(),a=Wn.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;a!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(a).add(this.object.position):(tv.origin.copy(this.object.position),tv.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(tv.direction))Mw||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Mw||this._lastTargetPosition.distanceToSquared(this.target)>Mw?(this.dispatchEvent(n2),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(e){return e!==null?ti/60*this.autoRotateSpeed*e:ti/60/60*this.autoRotateSpeed}_getZoomScale(e){const n=Math.abs(e*.01);return Math.pow(.95,this.zoomSpeed*n)}_rotateLeft(e){this._sphericalDelta.theta-=e}_rotateUp(e){this._sphericalDelta.phi-=e}_panLeft(e,n){Wn.setFromMatrixColumn(n,0),Wn.multiplyScalar(-e),this._panOffset.add(Wn)}_panUp(e,n){this.screenSpacePanning===!0?Wn.setFromMatrixColumn(n,1):(Wn.setFromMatrixColumn(n,0),Wn.crossVectors(this.object.up,Wn)),Wn.multiplyScalar(e),this._panOffset.add(Wn)}_pan(e,n){const r=this.domElement;if(this.object.isPerspectiveCamera){const i=this.object.position;Wn.copy(i).sub(this.target);let o=Wn.length();o*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*e*o/r.clientHeight,this.object.matrix),this._panUp(2*n*o/r.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(e*(this.object.right-this.object.left)/this.object.zoom/r.clientWidth,this.object.matrix),this._panUp(n*(this.object.top-this.object.bottom)/this.object.zoom/r.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(e,n){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const r=this.domElement.getBoundingClientRect(),i=e-r.left,o=n-r.top,a=r.width,s=r.height;this._mouse.x=i/a*2-1,this._mouse.y=-(o/s)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(e){return Math.max(this.minDistance,Math.min(this.maxDistance,e))}_handleMouseDownRotate(e){this._rotateStart.set(e.clientX,e.clientY)}_handleMouseDownDolly(e){this._updateZoomParameters(e.clientX,e.clientX),this._dollyStart.set(e.clientX,e.clientY)}_handleMouseDownPan(e){this._panStart.set(e.clientX,e.clientY)}_handleMouseMoveRotate(e){this._rotateEnd.set(e.clientX,e.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const n=this.domElement;this._rotateLeft(ti*this._rotateDelta.x/n.clientHeight),this._rotateUp(ti*this._rotateDelta.y/n.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(e){this._dollyEnd.set(e.clientX,e.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(e){this._panEnd.set(e.clientX,e.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(e){this._updateZoomParameters(e.clientX,e.clientY),e.deltaY<0?this._dollyIn(this._getZoomScale(e.deltaY)):e.deltaY>0&&this._dollyOut(this._getZoomScale(e.deltaY)),this.update()}_handleKeyDown(e){let n=!1;switch(e.code){case this.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(ti*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),n=!0;break;case this.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(-ti*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),n=!0;break;case this.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(ti*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),n=!0;break;case this.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(-ti*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),n=!0;break}n&&(e.preventDefault(),this.update())}_handleTouchStartRotate(e){if(this._pointers.length===1)this._rotateStart.set(e.pageX,e.pageY);else{const n=this._getSecondPointerPosition(e),r=.5*(e.pageX+n.x),i=.5*(e.pageY+n.y);this._rotateStart.set(r,i)}}_handleTouchStartPan(e){if(this._pointers.length===1)this._panStart.set(e.pageX,e.pageY);else{const n=this._getSecondPointerPosition(e),r=.5*(e.pageX+n.x),i=.5*(e.pageY+n.y);this._panStart.set(r,i)}}_handleTouchStartDolly(e){const n=this._getSecondPointerPosition(e),r=e.pageX-n.x,i=e.pageY-n.y,o=Math.sqrt(r*r+i*i);this._dollyStart.set(0,o)}_handleTouchStartDollyPan(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enablePan&&this._handleTouchStartPan(e)}_handleTouchStartDollyRotate(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enableRotate&&this._handleTouchStartRotate(e)}_handleTouchMoveRotate(e){if(this._pointers.length==1)this._rotateEnd.set(e.pageX,e.pageY);else{const r=this._getSecondPointerPosition(e),i=.5*(e.pageX+r.x),o=.5*(e.pageY+r.y);this._rotateEnd.set(i,o)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const n=this.domElement;this._rotateLeft(ti*this._rotateDelta.x/n.clientHeight),this._rotateUp(ti*this._rotateDelta.y/n.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(e){if(this._pointers.length===1)this._panEnd.set(e.pageX,e.pageY);else{const n=this._getSecondPointerPosition(e),r=.5*(e.pageX+n.x),i=.5*(e.pageY+n.y);this._panEnd.set(r,i)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(e){const n=this._getSecondPointerPosition(e),r=e.pageX-n.x,i=e.pageY-n.y,o=Math.sqrt(r*r+i*i);this._dollyEnd.set(0,o),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const a=(e.pageX+n.x)*.5,s=(e.pageY+n.y)*.5;this._updateZoomParameters(a,s)}_handleTouchMoveDollyPan(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enablePan&&this._handleTouchMovePan(e)}_handleTouchMoveDollyRotate(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enableRotate&&this._handleTouchMoveRotate(e)}_addPointer(e){this._pointers.push(e.pointerId)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let n=0;n>5&31)/31,y=(O>>10&31)/31)}for(let O=1;O<=3;O++){const W=R+O*12,L=P*3*3+(O-1)*3;A[L]=u.getFloat32(W,!0),A[L+1]=u.getFloat32(W+4,!0),A[L+2]=u.getFloat32(W+8,!0),M[L]=D,M[L+1]=k,M[L+2]=U,v&&(C.setRGB(f,p,y,Zt),g[L]=C.r,g[L+1]=C.g,g[L+2]=C.b)}}return T.setAttribute("position",new cr(A,3)),T.setAttribute("normal",new cr(M,3)),v&&(T.setAttribute("color",new cr(g,3)),T.hasColors=!0,T.alpha=S),T}function o(c){const u=new br,d=/solid([\s\S]*?)endsolid/g,f=/facet([\s\S]*?)endfacet/g,p=/solid\s(.+)/;let y=0;const v=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,g=new RegExp("vertex"+v+v+v,"g"),m=new RegExp("normal"+v+v+v,"g"),x=[],b=[],S=[],w=new ne;let E,T=0,A=0,M=0;for(;(E=d.exec(c))!==null;){A=M;const C=E[0],P=(E=p.exec(C))!==null?E[1]:"";for(S.push(P);(E=f.exec(C))!==null;){let k=0,U=0;const O=E[0];for(;(E=m.exec(O))!==null;)w.x=parseFloat(E[1]),w.y=parseFloat(E[2]),w.z=parseFloat(E[3]),U++;for(;(E=g.exec(O))!==null;)x.push(parseFloat(E[1]),parseFloat(E[2]),parseFloat(E[3])),b.push(w.x,w.y,w.z),k++,M++;U!==1&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+y),k!==3&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+y),y++}const R=A,D=M-A;u.userData.groupNames=S,u.addGroup(R,D,T),T++}return u.setAttribute("position",new Qt(x,3)),u.setAttribute("normal",new Qt(b,3)),u}function a(c){return typeof c!="string"?new TextDecoder().decode(c):c}function s(c){if(typeof c=="string"){const u=new Uint8Array(c.length);for(let d=0;d256||O.colormap_size!==24||O.colormap_type!==1)throw new Error("THREE.TGALoader: Invalid type colormap data for indexed type.");break;case p:case y:case g:case m:if(O.colormap_type)throw new Error("THREE.TGALoader: Invalid type colormap data for colormap type.");break;case d:throw new Error("THREE.TGALoader: No data.");default:throw new Error("THREE.TGALoader: Invalid type "+O.image_type)}if(O.width<=0||O.height<=0)throw new Error("THREE.TGALoader: Invalid image size.");if(O.pixel_size!==8&&O.pixel_size!==16&&O.pixel_size!==24&&O.pixel_size!==32)throw new Error("THREE.TGALoader: Invalid pixel size "+O.pixel_size)}function r(O,W,L,j,X){let K,F;const Y=L.pixel_size>>3,q=L.width*L.height*Y;if(W&&(F=X.subarray(j,j+=L.colormap_length*(L.colormap_size>>3))),O){K=new Uint8Array(q);let ee,te,Q,ce=0;const ae=new Uint8Array(Y);for(;ce>7,O[(te+ce*Q)*4+1]=(q&992)>>2,O[(te+ce*Q)*4+2]=(q&31)<<3,O[(te+ce*Q)*4+3]=q&32768?0:255;return O}function a(O,W,L,j,X,K,F,Y){let q=0,ee,te;const Q=C.width;for(te=W;te!==j;te+=L)for(ee=X;ee!==F;ee+=K,q+=3)O[(ee+Q*te)*4+3]=255,O[(ee+Q*te)*4+2]=Y[q+0],O[(ee+Q*te)*4+1]=Y[q+1],O[(ee+Q*te)*4+0]=Y[q+2];return O}function s(O,W,L,j,X,K,F,Y){let q=0,ee,te;const Q=C.width;for(te=W;te!==j;te+=L)for(ee=X;ee!==F;ee+=K,q+=4)O[(ee+Q*te)*4+2]=Y[q+0],O[(ee+Q*te)*4+1]=Y[q+1],O[(ee+Q*te)*4+0]=Y[q+2],O[(ee+Q*te)*4+3]=Y[q+3];return O}function l(O,W,L,j,X,K,F,Y){let q,ee=0,te,Q;const ce=C.width;for(Q=W;Q!==j;Q+=L)for(te=X;te!==F;te+=K,ee++)q=Y[ee],O[(te+ce*Q)*4+0]=q,O[(te+ce*Q)*4+1]=q,O[(te+ce*Q)*4+2]=q,O[(te+ce*Q)*4+3]=255;return O}function c(O,W,L,j,X,K,F,Y){let q=0,ee,te;const Q=C.width;for(te=W;te!==j;te+=L)for(ee=X;ee!==F;ee+=K,q+=2)O[(ee+Q*te)*4+0]=Y[q+0],O[(ee+Q*te)*4+1]=Y[q+0],O[(ee+Q*te)*4+2]=Y[q+0],O[(ee+Q*te)*4+3]=Y[q+1];return O}function u(O,W,L,j,X){let K,F,Y,q,ee,te;switch((C.flags&x)>>b){default:case E:K=0,Y=1,ee=W,F=0,q=1,te=L;break;case S:K=0,Y=1,ee=W,F=L-1,q=-1,te=-1;break;case T:K=W-1,Y=-1,ee=-1,F=0,q=1,te=L;break;case w:K=W-1,Y=-1,ee=-1,F=L-1,q=-1,te=-1;break}if(D)switch(C.pixel_size){case 8:l(O,F,q,te,K,Y,ee,j);break;case 16:c(O,F,q,te,K,Y,ee,j);break;default:throw new Error("THREE.TGALoader: Format not supported.")}else switch(C.pixel_size){case 8:i(O,F,q,te,K,Y,ee,j,X);break;case 16:o(O,F,q,te,K,Y,ee,j);break;case 24:a(O,F,q,te,K,Y,ee,j);break;case 32:s(O,F,q,te,K,Y,ee,j);break;default:throw new Error("THREE.TGALoader: Format not supported.")}return O}const d=0,f=1,p=2,y=3,v=9,g=10,m=11,x=48,b=4,S=0,w=1,E=2,T=3;if(e.length<19)throw new Error("THREE.TGALoader: Not enough data to contain header.");let A=0;const M=new Uint8Array(e),C={id_length:M[A++],colormap_type:M[A++],image_type:M[A++],colormap_index:M[A++]|M[A++]<<8,colormap_length:M[A++]|M[A++]<<8,colormap_size:M[A++],origin:[M[A++]|M[A++]<<8,M[A++]|M[A++]<<8],width:M[A++]|M[A++]<<8,height:M[A++]|M[A++]<<8,pixel_size:M[A++],flags:M[A++]};if(n(C),C.id_length+A>e.length)throw new Error("THREE.TGALoader: No data.");A+=C.id_length;let P=!1,R=!1,D=!1;switch(C.image_type){case v:P=!0,R=!0;break;case f:R=!0;break;case g:P=!0;break;case p:break;case m:P=!0,D=!0;break;case y:D=!0;break}const k=new Uint8Array(C.width*C.height*4),U=r(P,R,C,A,M);return u(k,C.width,C.height,U.pixel_data,U.palettes),{data:k,width:C.width,height:C.height,flipY:!0,generateMipmaps:!0,minFilter:Oo}}}class a$ extends Vo{load(e,n,r,i){const o=this,a=o.path===""?mc.extractUrlBase(e):o.path,s=new Mf(o.manager);s.setPath(o.path),s.setRequestHeader(o.requestHeader),s.setWithCredentials(o.withCredentials),s.load(e,function(l){try{n(o.parse(l,a))}catch(c){i?i(c):console.error(c),o.manager.itemError(e)}},r,i)}parse(e,n){function r(I,N){const H=[],$=I.childNodes;for(let V=0,pe=$.length;V0&&N.push(new pl($+".position",V,pe)),ye.length>0&&N.push(new Ic($+".quaternion",V,ye)),Xe.length>0&&N.push(new pl($+".scale",V,Xe)),N}function P(I,N,H){let $,V=!0,pe,ye;for(pe=0,ye=I.length;pe=0;){const $=I[N];if($.value[H]!==null)return $;N--}return null}function k(I,N,H){for(;N>>0)+2);switch(H=H.toLowerCase(),H){case"tga":N=wr;break;default:N=Lr}return N}function be(I){const N=B(I.url),H=N.profile.technique;let $;switch(H.type){case"phong":case"blinn":$=new Fo;break;case"lambert":$=new Lee;break;default:$=new ua;break}$.name=I.name||"";function V(De,$e=null){const lt=N.profile.samplers[De.id];let Ae=null;if(lt!==void 0){const at=N.profile.surfaces[lt.source];Ae=ce(at.init_from)}else console.warn("THREE.ColladaLoader: Undefined sampler. Access image directly (see #12530)."),Ae=ce(De.id);if(Ae!==null){const at=me(Ae);if(at!==void 0){const Qe=at.load(Ae),yt=De.extra;if(yt!==void 0&&yt.technique!==void 0&&c(yt.technique)===!1){const dt=yt.technique;Qe.wrapS=dt.wrapU?ca:Ji,Qe.wrapT=dt.wrapV?ca:Ji,Qe.offset.set(dt.offsetU||0,dt.offsetV||0),Qe.repeat.set(dt.repeatU||1,dt.repeatV||1)}else Qe.wrapS=ca,Qe.wrapT=ca;return $e!==null&&(Qe.colorSpace=$e),Qe}else return console.warn("THREE.ColladaLoader: Loader for texture %s not found.",Ae),null}else return console.warn("THREE.ColladaLoader: Couldn't create texture with ID:",De.id),null}const pe=H.parameters;for(const De in pe){const $e=pe[De];switch(De){case"diffuse":$e.color&&$.color.fromArray($e.color),$e.texture&&($.map=V($e.texture,Zt));break;case"specular":$e.color&&$.specular&&$.specular.fromArray($e.color),$e.texture&&($.specularMap=V($e.texture));break;case"bump":$e.texture&&($.normalMap=V($e.texture));break;case"ambient":$e.texture&&($.lightMap=V($e.texture,Zt));break;case"shininess":$e.float&&$.shininess&&($.shininess=$e.float);break;case"emission":$e.color&&$.emissive&&$.emissive.fromArray($e.color),$e.texture&&($.emissiveMap=V($e.texture,Zt));break}}Dt.colorSpaceToWorking($.color,Zt),$.specular&&Dt.colorSpaceToWorking($.specular,Zt),$.emissive&&Dt.colorSpaceToWorking($.emissive,Zt);let ye=pe.transparent,Xe=pe.transparency;if(Xe===void 0&&ye&&(Xe={float:1}),ye===void 0&&Xe&&(ye={opaque:"A_ONE",data:{color:[1,1,1,1]}}),ye&&Xe)if(ye.data.texture)$.transparent=!0;else{const De=ye.data.color;switch(ye.opaque){case"A_ONE":$.opacity=De[3]*Xe.float;break;case"RGB_ZERO":$.opacity=1-De[0]*Xe.float;break;case"A_ZERO":$.opacity=1-De[3]*Xe.float;break;case"RGB_ONE":$.opacity=De[0]*Xe.float;break;default:console.warn('THREE.ColladaLoader: Invalid opaque type "%s" of transparent tag.',ye.opaque)}$.opacity<1&&($.transparent=!0)}if(H.extra!==void 0&&H.extra.technique!==void 0){const De=H.extra.technique;for(const $e in De){const lt=De[$e];switch($e){case"double_sided":$.side=lt===1?Ki:ba;break;case"bump":$.normalMap=V(lt.texture),$.normalScale=new xt(1,1);break}}}return $}function ge(I){return v(Et.materials[I],be)}function rt(I){const N={name:I.getAttribute("name")};for(let H=0,$=I.childNodes.length;H<$;H++){const V=I.childNodes[H];if(V.nodeType===1)switch(V.nodeName){case"optics":N.optics=Ie(V);break}}Et.cameras[I.getAttribute("id")]=N}function Ie(I){for(let N=0;N0?ye+De:ye;N.inputs[$e]={id:pe,offset:Xe},N.stride=Math.max(N.stride,Xe+1),ye==="TEXCOORD"&&(N.hasUV=!0);break;case"vcount":N.vcount=a(V.textContent);break;case"p":N.p=a(V.textContent);break}}return N}function _e(I){const N={};for(let H=0;H0&&N0&&Ae.setAttribute("position",new Qt(V.array,V.stride)),pe.array.length>0&&Ae.setAttribute("normal",new Qt(pe.array,pe.stride)),De.array.length>0&&Ae.setAttribute("color",new Qt(De.array,De.stride)),ye.array.length>0&&Ae.setAttribute("uv",new Qt(ye.array,ye.stride)),Xe.array.length>0&&Ae.setAttribute("uv1",new Qt(Xe.array,Xe.stride)),$e.array.length>0&&Ae.setAttribute("skinIndex",new Qt($e.array,$e.stride)),lt.array.length>0&&Ae.setAttribute("skinWeight",new Qt(lt.array,lt.stride)),$.data=Ae,$.type=I[0].type,$.materialKeys=at,$}function pt(I,N,H,$,V=!1){const pe=I.p,ye=I.stride,Xe=I.vcount;function De(Ae){let at=pe[Ae+H]*lt;const Qe=at+lt;for(;at4)for(let dt=1,An=yt-2;dt<=An;dt++){const en=Ae+ye*0,Gt=Ae+ye*dt,Wt=Ae+ye*(dt+1);De(en),De(Gt),De(Wt)}Ae+=ye*yt}}else for(let Ae=0,at=pe.length;Ae=N.limits.max&&(N.static=!0),N.middlePosition=(N.limits.min+N.limits.max)/2,N}function zf(I){const N={sid:I.getAttribute("sid"),name:I.getAttribute("name")||"",attachments:[],transforms:[]};for(let H=0;HQe.limits.max||Aer===null?null:parseFloat(r)),(!this.origPosition||!this.origQuaternion)&&(this.origPosition=this.position.clone(),this.origQuaternion=this.quaternion.clone());let n=!1;switch(this.mimicJoints.forEach(r=>{n=r.updateFromMimickedJoint(...e)||n}),this.jointType){case"fixed":return n;case"continuous":case"revolute":{let r=e[0];return r==null||r===this.jointValue[0]?n:(!this.ignoreLimits&&this.jointType==="revolute"&&(r=Math.min(this.limit.upper,r),r=Math.max(this.limit.lower,r)),this.quaternion.setFromAxisAngle(this.axis,r).premultiply(this.origQuaternion),this.jointValue[0]!==r?(this.jointValue[0]=r,this.matrixWorldNeedsUpdate=!0,!0):n)}case"prismatic":{let r=e[0];return r==null||r===this.jointValue[0]?n:(this.ignoreLimits||(r=Math.min(this.limit.upper,r),r=Math.max(this.limit.lower,r)),this.position.copy(this.origPosition),o2.copy(this.axis).applyEuler(this.rotation),this.position.addScaledVector(o2,r),this.jointValue[0]!==r?(this.jointValue[0]=r,this.matrixWorldNeedsUpdate=!0,!0):n)}case"floating":return this.jointValue.every((r,i)=>e[i]===r||e[i]===null)?n:(this.jointValue[0]=e[0]!==null?e[0]:this.jointValue[0],this.jointValue[1]=e[1]!==null?e[1]:this.jointValue[1],this.jointValue[2]=e[2]!==null?e[2]:this.jointValue[2],this.jointValue[3]=e[3]!==null?e[3]:this.jointValue[3],this.jointValue[4]=e[4]!==null?e[4]:this.jointValue[4],this.jointValue[5]=e[5]!==null?e[5]:this.jointValue[5],Ts.compose(this.origPosition,this.origQuaternion,iv),rv.setFromEuler(lae.set(this.jointValue[3],this.jointValue[4],this.jointValue[5],"XYZ")),ov.set(this.jointValue[0],this.jointValue[1],this.jointValue[2]),nv.compose(ov,rv,iv),Ts.premultiply(nv),this.position.setFromMatrixPosition(Ts),this.rotation.setFromRotationMatrix(Ts),this.matrixWorldNeedsUpdate=!0,!0);case"planar":return this.jointValue.every((r,i)=>e[i]===r||e[i]===null)?n:(this.jointValue[0]=e[0]!==null?e[0]:this.jointValue[0],this.jointValue[1]=e[1]!==null?e[1]:this.jointValue[1],this.jointValue[2]=e[2]!==null?e[2]:this.jointValue[2],Ts.compose(this.origPosition,this.origQuaternion,iv),rv.setFromAxisAngle(this.axis,this.jointValue[2]),ov.set(this.jointValue[0],this.jointValue[1],0),nv.compose(ov,rv,iv),Ts.premultiply(nv),this.position.setFromMatrixPosition(Ts),this.rotation.setFromRotationMatrix(Ts),this.matrixWorldNeedsUpdate=!0,!0)}return n}}class a2 extends l${constructor(...e){super(...e),this.type="URDFMimicJoint",this.mimicJoint=null,this.offset=0,this.multiplier=1}updateFromMimickedJoint(...e){const n=e.map(r=>r*this.multiplier+this.offset);return super.setJointValue(...n)}copy(e,n){return super.copy(e,n),this.mimicJoint=e.mimicJoint,this.offset=e.offset,this.multiplier=e.multiplier,this}}class dae extends s${constructor(...e){super(...e),this.isURDFRobot=!0,this.urdfNode=null,this.urdfRobotNode=null,this.robotName=null,this.links=null,this.joints=null,this.colliders=null,this.visual=null,this.frames=null}copy(e,n){super.copy(e,n),this.urdfRobotNode=e.urdfRobotNode,this.robotName=e.robotName,this.links={},this.joints={},this.colliders={},this.visual={},this.traverse(r=>{r.isURDFJoint&&r.urdfName in e.joints&&(this.joints[r.urdfName]=r),r.isURDFLink&&r.urdfName in e.links&&(this.links[r.urdfName]=r),r.isURDFCollider&&r.urdfName in e.colliders&&(this.colliders[r.urdfName]=r),r.isURDFVisual&&r.urdfName in e.visual&&(this.visual[r.urdfName]=r)});for(const r in this.joints)this.joints[r].mimicJoints=this.joints[r].mimicJoints.map(i=>this.joints[i.name]);return this.frames={...this.colliders,...this.visual,...this.links,...this.joints},this}getFrame(e){return this.frames[e]}setJointValue(e,...n){const r=this.joints[e];return r?r.setJointValue(...n):!1}setJointValues(e){let n=!1;for(const r in e){const i=e[r];Array.isArray(i)?n=this.setJointValue(r,...i)||n:n=this.setJointValue(r,i)||n}return n}}const Aw=new Ii,s2=new pi;function _u(t){return t?t.trim().split(/\s+/g).map(e=>parseFloat(e)):[0,0,0]}function l2(t,e,n=!1){n||t.rotation.set(0,0,0),s2.set(e[0],e[1],e[2],"ZYX"),Aw.setFromEuler(s2),Aw.multiply(t.quaternion),t.quaternion.copy(Aw)}class fae{constructor(e){this.manager=e||q4,this.loadMeshCb=this.defaultMeshLoader.bind(this),this.parseVisual=!0,this.parseCollision=!1,this.packages="",this.workingPath="",this.fetchOptions={}}loadAsync(e){return new Promise((n,r)=>{this.load(e,n,null,r)})}load(e,n,r,i){const o=this.manager,a=mc.extractUrlBase(e),s=this.manager.resolveURL(e);o.itemStart(s),fetch(s,this.fetchOptions).then(l=>{if(l.ok)return r&&r(null),l.text();throw new Error(`URDFLoader: Failed to load url '${s}' with error code ${l.status} : ${l.statusText}.`)}).then(l=>{const c=this.parse(l,this.workingPath||a);n(c),o.itemEnd(s)}).catch(l=>{i?i(l):console.error("URDFLoader: Error loading file.",l),o.itemError(s),o.itemEnd(s)})}parse(e,n=this.workingPath){const r=this.packages,i=this.loadMeshCb,o=this.parseVisual,a=this.parseCollision,s=this.manager,l={},c={},u={};function d(x){if(!/^package:\/\//.test(x))return n?n+x:x;const[b,S]=x.replace(/^package:\/\//,"").split(/\/(.+)/);if(typeof r=="string")return r.endsWith(b)?r+"/"+S:r+"/"+b+"/"+S;if(r instanceof Function)return r(b)+"/"+S;if(typeof r=="object")return b in r?r[b]+"/"+S:(console.error(`URDFLoader : ${b} not found in provided package list.`),null)}function f(x){let b;x instanceof Document?b=[...x.children]:x instanceof Element?b=[x]:b=[...new DOMParser().parseFromString(x,"text/xml").children];const S=b.filter(w=>w.nodeName==="robot").pop();return p(S)}function p(x){const b=[...x.children],S=b.filter(P=>P.nodeName.toLowerCase()==="link"),w=b.filter(P=>P.nodeName.toLowerCase()==="joint"),E=b.filter(P=>P.nodeName.toLowerCase()==="material"),T=new dae;T.robotName=x.getAttribute("name"),T.urdfRobotNode=x,E.forEach(P=>{const R=P.getAttribute("name");u[R]=g(P)});const A={},M={};S.forEach(P=>{const R=P.getAttribute("name"),D=x.querySelector(`child[link="${R}"]`)===null;l[R]=v(P,A,M,D?T:null)}),w.forEach(P=>{const R=P.getAttribute("name");c[R]=y(P)}),T.joints=c,T.links=l,T.colliders=M,T.visual=A;const C=Object.values(c);return C.forEach(P=>{P instanceof a2&&c[P.mimicJoint].mimicJoints.push(P)}),C.forEach(P=>{const R=new Set,D=k=>{if(R.has(k))throw new Error("URDFLoader: Detected an infinite loop of mimic joints.");R.add(k),k.mimicJoints.forEach(U=>{D(U)})};D(P)}),T.frames={...M,...A,...l,...c},T}function y(x){const b=[...x.children],S=x.getAttribute("type");let w;const E=b.find(R=>R.nodeName.toLowerCase()==="mimic");E?(w=new a2,w.mimicJoint=E.getAttribute("joint"),w.multiplier=parseFloat(E.getAttribute("multiplier")||1),w.offset=parseFloat(E.getAttribute("offset")||0)):w=new l$,w.urdfNode=x,w.name=x.getAttribute("name"),w.urdfName=w.name,w.jointType=S;let T=null,A=null,M=[0,0,0],C=[0,0,0];b.forEach(R=>{const D=R.nodeName.toLowerCase();D==="origin"?(M=_u(R.getAttribute("xyz")),C=_u(R.getAttribute("rpy"))):D==="child"?A=l[R.getAttribute("link")]:D==="parent"?T=l[R.getAttribute("link")]:D==="limit"&&(w.limit.lower=parseFloat(R.getAttribute("lower")||w.limit.lower),w.limit.upper=parseFloat(R.getAttribute("upper")||w.limit.upper))}),T.add(w),w.add(A),l2(w,C),w.position.set(M[0],M[1],M[2]);const P=b.filter(R=>R.nodeName.toLowerCase()==="axis")[0];if(P){const R=P.getAttribute("xyz").split(/\s+/g).map(D=>parseFloat(D));w.axis=new ne(R[0],R[1],R[2]),w.axis.normalize()}return w}function v(x,b,S,w=null){w===null&&(w=new s$);const E=[...x.children];return w.name=x.getAttribute("name"),w.urdfName=w.name,w.urdfNode=x,o&&E.filter(A=>A.nodeName.toLowerCase()==="visual").forEach(A=>{const M=m(A,u);if(w.add(M),A.hasAttribute("name")){const C=A.getAttribute("name");M.name=C,M.urdfName=C,b[C]=M}}),a&&E.filter(A=>A.nodeName.toLowerCase()==="collision").forEach(A=>{const M=m(A);if(w.add(M),A.hasAttribute("name")){const C=A.getAttribute("name");M.name=C,M.urdfName=C,S[C]=M}}),w}function g(x){const b=[...x.children],S=new Fo;return S.name=x.getAttribute("name")||"",b.forEach(w=>{const E=w.nodeName.toLowerCase();if(E==="color"){const T=w.getAttribute("rgba").split(/\s/g).map(A=>parseFloat(A));S.color.setRGB(T[0],T[1],T[2]),S.opacity=T[3],S.transparent=T[3]<1,S.depthWrite=!S.transparent}else if(E==="texture"){const T=w.getAttribute("filename");if(T){const A=new aC(s),M=d(T);S.map=A.load(M),S.map.colorSpace=Zt}}}),S}function m(x,b={}){const S=x.nodeName.toLowerCase()==="collision",w=[...x.children];let E=null;const T=w.filter(M=>M.nodeName.toLowerCase()==="material")[0];if(T){const M=T.getAttribute("name");M&&M in b?E=b[M]:E=g(T)}else E=new Fo;const A=S?new cae:new uae;return A.urdfNode=x,w.forEach(M=>{const C=M.nodeName.toLowerCase();if(C==="geometry"){const P=M.children[0].nodeName.toLowerCase();if(P==="mesh"){const R=M.children[0].getAttribute("filename"),D=d(R);if(D!==null){const k=M.children[0].getAttribute("scale");if(k){const U=_u(k);A.scale.set(U[0],U[1],U[2])}i(D,s,(U,O)=>{O?console.error("URDFLoader: Error loading mesh.",O):U&&(U instanceof Tn&&(U.material=E),U.position.set(0,0,0),U.quaternion.identity(),A.add(U))})}}else if(P==="box"){const R=new Tn;R.geometry=new Gc(1,1,1),R.material=E;const D=_u(M.children[0].getAttribute("size"));R.scale.set(D[0],D[1],D[2]),A.add(R)}else if(P==="sphere"){const R=new Tn;R.geometry=new iC(1,30,30),R.material=E;const D=parseFloat(M.children[0].getAttribute("radius"))||0;R.scale.set(D,D,D),A.add(R)}else if(P==="cylinder"){const R=new Tn;R.geometry=new rC(1,1,1,30),R.material=E;const D=parseFloat(M.children[0].getAttribute("radius"))||0,k=parseFloat(M.children[0].getAttribute("length"))||0;R.scale.set(D,k,D),R.rotation.set(Math.PI/2,0,0),A.add(R)}}else if(C==="origin"){const P=_u(M.getAttribute("xyz")),R=_u(M.getAttribute("rpy"));A.position.set(P[0],P[1],P[2]),A.rotation.set(0,0,0),l2(A,R)}}),A}return f(e)}defaultMeshLoader(e,n,r){/\.stl$/i.test(e)?new o$(n).load(e,o=>{const a=new Tn(o,new Fo);r(a)}):/\.dae$/i.test(e)?new a$(n).load(e,o=>r(o.scene)):console.warn(`URDFLoader: Could not load model at ${e}. -No loader available`)}}const hae=new xt,pae=()=>{};class mae extends HTMLElement{static get observedAttributes(){return["package","urdf","up","display-shadow","ambient-color","ignore-limits","show-collision"]}get package(){return this.getAttribute("package")||""}set package(e){this.setAttribute("package",e)}get urdf(){return this.getAttribute("urdf")||""}set urdf(e){this.setAttribute("urdf",e)}get ignoreLimits(){return this.hasAttribute("ignore-limits")||!1}set ignoreLimits(e){e?this.setAttribute("ignore-limits",e):this.removeAttribute("ignore-limits")}get up(){return this.getAttribute("up")||"+Z"}set up(e){this.setAttribute("up",e)}get displayShadow(){return this.hasAttribute("display-shadow")||!1}set displayShadow(e){e?this.setAttribute("display-shadow",""):this.removeAttribute("display-shadow")}get ambientColor(){return this.getAttribute("ambient-color")||"#8ea0a8"}set ambientColor(e){e?this.setAttribute("ambient-color",e):this.removeAttribute("ambient-color")}get autoRedraw(){return this.hasAttribute("auto-redraw")||!1}set autoRedraw(e){e?this.setAttribute("auto-redraw",!0):this.removeAttribute("auto-redraw")}get noAutoRecenter(){return this.hasAttribute("no-auto-recenter")||!1}set noAutoRecenter(e){e?this.setAttribute("no-auto-recenter",!0):this.removeAttribute("no-auto-recenter")}get showCollision(){return this.hasAttribute("show-collision")||!1}set showCollision(e){e?this.setAttribute("show-collision",!0):this.removeAttribute("show-collision")}get jointValues(){const e={};if(this.robot)for(const n in this.robot.joints){const r=this.robot.joints[n];e[n]=r.jointValue.length===1?r.angle:[...r.jointValue]}return e}set jointValues(e){this.setJointValues(e)}get angles(){return this.jointValues}set angles(e){this.jointValues=e}constructor(){super(),this._requestId=0,this._dirty=!1,this._loadScheduled=!1,this.robot=null,this.loadMeshFunc=null,this.urlModifierFunc=null;const e=new z4,n=new Kee(this.ambientColor,"#000");n.groundColor.lerp(n.color,.5*Math.PI),n.intensity=.5,n.position.set(0,1,0),e.add(n);const r=new zx(16777215,Math.PI);r.position.set(4,10,1),r.shadow.mapSize.width=2048,r.shadow.mapSize.height=2048,r.shadow.normalBias=.001,r.castShadow=!0,e.add(r),e.add(r.target);const i=new Xoe({antialias:!0,alpha:!0});i.setClearColor(16777215),i.setClearAlpha(0),i.shadowMap.enabled=!0,i.shadowMap.type=w4,i.outputColorSpace=Zt;const o=new gr(75,1,.1,1e3);o.position.z=-10;const a=new vn;e.add(a);const s=new Tn(new Im(40,40),new Dee({side:Ki,transparent:!0,opacity:.25}));s.rotation.x=-Math.PI/2,s.position.y=-.5,s.receiveShadow=!0,s.scale.set(10,10,10),e.add(s);const l=new Koe(o,i.domElement);l.rotateSpeed=2,l.zoomSpeed=5,l.panSpeed=2,l.enableZoom=!0,l.enableDamping=!1,l.maxDistance=50,l.minDistance=.25,l.addEventListener("change",()=>this.recenter()),this.scene=e,this.world=a,this.renderer=i,this.camera=o,this.controls=l,this.plane=s,this.directionalLight=r,this.ambientLight=n,this._setUp(this.up),this._collisionMaterial=new Fo({transparent:!0,opacity:.35,shininess:2.5,premultipliedAlpha:!0,color:16760376,polygonOffset:!0,polygonOffsetFactor:-1,polygonOffsetUnits:-1});const c=()=>{this.parentNode&&(this.updateSize(),(this._dirty||this.autoRedraw)&&(this.noAutoRecenter||this._updateEnvironment(),this.renderer.render(e,o),this._dirty=!1),this.controls.update()),this._renderLoopId=requestAnimationFrame(c)};c()}connectedCallback(){if(!this.constructor._styletag){const e=document.createElement("style");e.innerHTML=` +}`;class Voe{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,n,r){if(this.texture===null){const i=new lr,o=e.properties.get(i);o.__webglTexture=n.texture,(n.depthNear!==r.depthNear||n.depthFar!==r.depthFar)&&(this.depthNear=n.depthNear,this.depthFar=n.depthFar),this.texture=i}}getMesh(e){if(this.texture!==null&&this.mesh===null){const n=e.cameras[0].viewport,r=new hl({vertexShader:zoe,fragmentShader:Hoe,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new Tn(new Im(20,20),r)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class Goe extends Vc{constructor(e,n){super();const r=this;let i=null,o=1,a=null,s="local-floor",l=1,c=null,u=null,d=null,f=null,p=null,y=null;const v=new Voe,g=n.getContextAttributes();let m=null,x=null;const b=[],S=[],w=new xt;let E=null;const T=new gr;T.viewport=new Yt;const A=new gr;A.viewport=new Yt;const M=[T,A],C=new nte;let P=null,R=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function($){let Y=b[$];return Y===void 0&&(Y=new fw,b[$]=Y),Y.getTargetRaySpace()},this.getControllerGrip=function($){let Y=b[$];return Y===void 0&&(Y=new fw,b[$]=Y),Y.getGripSpace()},this.getHand=function($){let Y=b[$];return Y===void 0&&(Y=new fw,b[$]=Y),Y.getHandSpace()};function D($){const Y=S.indexOf($.inputSource);if(Y===-1)return;const ee=b[Y];ee!==void 0&&(ee.update($.inputSource,$.frame,c||a),ee.dispatchEvent({type:$.type,data:$.inputSource}))}function k(){i.removeEventListener("select",D),i.removeEventListener("selectstart",D),i.removeEventListener("selectend",D),i.removeEventListener("squeeze",D),i.removeEventListener("squeezestart",D),i.removeEventListener("squeezeend",D),i.removeEventListener("end",k),i.removeEventListener("inputsourceschange",U);for(let $=0;$=0&&(S[J]=null,b[J].disconnect(ee))}for(let Y=0;Y<$.added.length;Y++){const ee=$.added[Y];let J=S.indexOf(ee);if(J===-1){for(let ae=0;ae=S.length){S.push(ee),J=ae;break}else if(S[ae]===null){S[ae]=ee,J=ae;break}if(J===-1)break}const ce=b[J];ce&&ce.connect(ee)}}const O=new ne,X=new ne;function L($,Y,ee){O.setFromMatrixPosition(Y.matrixWorld),X.setFromMatrixPosition(ee.matrixWorld);const J=O.distanceTo(X),ce=Y.projectionMatrix.elements,ae=ee.projectionMatrix.elements,fe=ce[14]/(ce[10]-1),we=ce[14]/(ce[10]+1),le=(ce[9]+1)/ce[5],ie=(ce[9]-1)/ce[5],W=(ce[8]-1)/ce[0],Ve=(ae[8]+1)/ae[0],Ne=fe*W,st=fe*Ve,Re=J/(-W+Ve),ct=Re*-W;if(Y.matrixWorld.decompose($.position,$.quaternion,$.scale),$.translateX(ct),$.translateZ(Re),$.matrixWorld.compose($.position,$.quaternion,$.scale),$.matrixWorldInverse.copy($.matrixWorld).invert(),ce[10]===-1)$.projectionMatrix.copy(Y.projectionMatrix),$.projectionMatrixInverse.copy(Y.projectionMatrixInverse);else{const Ye=fe+Re,it=we+Re,Ft=Ne-ct,Z=st+(J-ct),F=le*we/it*Ye,ue=ie*we/it*Ye;$.projectionMatrix.makePerspective(Ft,Z,F,ue,Ye,it),$.projectionMatrixInverse.copy($.projectionMatrix).invert()}}function j($,Y){Y===null?$.matrixWorld.copy($.matrix):$.matrixWorld.multiplyMatrices(Y.matrixWorld,$.matrix),$.matrixWorldInverse.copy($.matrixWorld).invert()}this.updateCamera=function($){if(i===null)return;let Y=$.near,ee=$.far;v.texture!==null&&(v.depthNear>0&&(Y=v.depthNear),v.depthFar>0&&(ee=v.depthFar)),C.near=A.near=T.near=Y,C.far=A.far=T.far=ee,(P!==C.near||R!==C.far)&&(i.updateRenderState({depthNear:C.near,depthFar:C.far}),P=C.near,R=C.far),T.layers.mask=$.layers.mask|2,A.layers.mask=$.layers.mask|4,C.layers.mask=T.layers.mask|A.layers.mask;const J=$.parent,ce=C.cameras;j(C,J);for(let ae=0;ae0&&(g.alphaTest.value=m.alphaTest);const x=e.get(m),b=x.envMap,S=x.envMapRotation;b&&(g.envMap.value=b,Ul.copy(S),Ul.x*=-1,Ul.y*=-1,Ul.z*=-1,b.isCubeTexture&&b.isRenderTargetTexture===!1&&(Ul.y*=-1,Ul.z*=-1),g.envMapRotation.value.setFromMatrix4(Woe.makeRotationFromEuler(Ul)),g.flipEnvMap.value=b.isCubeTexture&&b.isRenderTargetTexture===!1?-1:1,g.reflectivity.value=m.reflectivity,g.ior.value=m.ior,g.refractionRatio.value=m.refractionRatio),m.lightMap&&(g.lightMap.value=m.lightMap,g.lightMapIntensity.value=m.lightMapIntensity,n(m.lightMap,g.lightMapTransform)),m.aoMap&&(g.aoMap.value=m.aoMap,g.aoMapIntensity.value=m.aoMapIntensity,n(m.aoMap,g.aoMapTransform))}function a(g,m){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,m.map&&(g.map.value=m.map,n(m.map,g.mapTransform))}function s(g,m){g.dashSize.value=m.dashSize,g.totalSize.value=m.dashSize+m.gapSize,g.scale.value=m.scale}function l(g,m,x,b){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,g.size.value=m.size*x,g.scale.value=b*.5,m.map&&(g.map.value=m.map,n(m.map,g.uvTransform)),m.alphaMap&&(g.alphaMap.value=m.alphaMap,n(m.alphaMap,g.alphaMapTransform)),m.alphaTest>0&&(g.alphaTest.value=m.alphaTest)}function c(g,m){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,g.rotation.value=m.rotation,m.map&&(g.map.value=m.map,n(m.map,g.mapTransform)),m.alphaMap&&(g.alphaMap.value=m.alphaMap,n(m.alphaMap,g.alphaMapTransform)),m.alphaTest>0&&(g.alphaTest.value=m.alphaTest)}function u(g,m){g.specular.value.copy(m.specular),g.shininess.value=Math.max(m.shininess,1e-4)}function d(g,m){m.gradientMap&&(g.gradientMap.value=m.gradientMap)}function f(g,m){g.metalness.value=m.metalness,m.metalnessMap&&(g.metalnessMap.value=m.metalnessMap,n(m.metalnessMap,g.metalnessMapTransform)),g.roughness.value=m.roughness,m.roughnessMap&&(g.roughnessMap.value=m.roughnessMap,n(m.roughnessMap,g.roughnessMapTransform)),m.envMap&&(g.envMapIntensity.value=m.envMapIntensity)}function p(g,m,x){g.ior.value=m.ior,m.sheen>0&&(g.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),g.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(g.sheenColorMap.value=m.sheenColorMap,n(m.sheenColorMap,g.sheenColorMapTransform)),m.sheenRoughnessMap&&(g.sheenRoughnessMap.value=m.sheenRoughnessMap,n(m.sheenRoughnessMap,g.sheenRoughnessMapTransform))),m.clearcoat>0&&(g.clearcoat.value=m.clearcoat,g.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(g.clearcoatMap.value=m.clearcoatMap,n(m.clearcoatMap,g.clearcoatMapTransform)),m.clearcoatRoughnessMap&&(g.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap,n(m.clearcoatRoughnessMap,g.clearcoatRoughnessMapTransform)),m.clearcoatNormalMap&&(g.clearcoatNormalMap.value=m.clearcoatNormalMap,n(m.clearcoatNormalMap,g.clearcoatNormalMapTransform),g.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),m.side===ui&&g.clearcoatNormalScale.value.negate())),m.dispersion>0&&(g.dispersion.value=m.dispersion),m.iridescence>0&&(g.iridescence.value=m.iridescence,g.iridescenceIOR.value=m.iridescenceIOR,g.iridescenceThicknessMinimum.value=m.iridescenceThicknessRange[0],g.iridescenceThicknessMaximum.value=m.iridescenceThicknessRange[1],m.iridescenceMap&&(g.iridescenceMap.value=m.iridescenceMap,n(m.iridescenceMap,g.iridescenceMapTransform)),m.iridescenceThicknessMap&&(g.iridescenceThicknessMap.value=m.iridescenceThicknessMap,n(m.iridescenceThicknessMap,g.iridescenceThicknessMapTransform))),m.transmission>0&&(g.transmission.value=m.transmission,g.transmissionSamplerMap.value=x.texture,g.transmissionSamplerSize.value.set(x.width,x.height),m.transmissionMap&&(g.transmissionMap.value=m.transmissionMap,n(m.transmissionMap,g.transmissionMapTransform)),g.thickness.value=m.thickness,m.thicknessMap&&(g.thicknessMap.value=m.thicknessMap,n(m.thicknessMap,g.thicknessMapTransform)),g.attenuationDistance.value=m.attenuationDistance,g.attenuationColor.value.copy(m.attenuationColor)),m.anisotropy>0&&(g.anisotropyVector.value.set(m.anisotropy*Math.cos(m.anisotropyRotation),m.anisotropy*Math.sin(m.anisotropyRotation)),m.anisotropyMap&&(g.anisotropyMap.value=m.anisotropyMap,n(m.anisotropyMap,g.anisotropyMapTransform))),g.specularIntensity.value=m.specularIntensity,g.specularColor.value.copy(m.specularColor),m.specularColorMap&&(g.specularColorMap.value=m.specularColorMap,n(m.specularColorMap,g.specularColorMapTransform)),m.specularIntensityMap&&(g.specularIntensityMap.value=m.specularIntensityMap,n(m.specularIntensityMap,g.specularIntensityMapTransform))}function y(g,m){m.matcap&&(g.matcap.value=m.matcap)}function v(g,m){const x=e.get(m).light;g.referencePosition.value.setFromMatrixPosition(x.matrixWorld),g.nearDistance.value=x.shadow.camera.near,g.farDistance.value=x.shadow.camera.far}return{refreshFogUniforms:r,refreshMaterialUniforms:i}}function qoe(t,e,n,r){let i={},o={},a=[];const s=t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS);function l(x,b){const S=b.program;r.uniformBlockBinding(x,S)}function c(x,b){let S=i[x.id];S===void 0&&(y(x),S=u(x),i[x.id]=S,x.addEventListener("dispose",g));const w=b.program;r.updateUBOMapping(x,w);const E=e.render.frame;o[x.id]!==E&&(f(x),o[x.id]=E)}function u(x){const b=d();x.__bindingPointIndex=b;const S=t.createBuffer(),w=x.__size,E=x.usage;return t.bindBuffer(t.UNIFORM_BUFFER,S),t.bufferData(t.UNIFORM_BUFFER,w,E),t.bindBuffer(t.UNIFORM_BUFFER,null),t.bindBufferBase(t.UNIFORM_BUFFER,b,S),S}function d(){for(let x=0;x0&&(S+=w-E),x.__size=S,x.__cache={},this}function v(x){const b={boundary:0,storage:0};return typeof x=="number"||typeof x=="boolean"?(b.boundary=4,b.storage=4):x.isVector2?(b.boundary=8,b.storage=8):x.isVector3||x.isColor?(b.boundary=16,b.storage=12):x.isVector4?(b.boundary=16,b.storage=16):x.isMatrix3?(b.boundary=48,b.storage=48):x.isMatrix4?(b.boundary=64,b.storage=64):x.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",x),b}function g(x){const b=x.target;b.removeEventListener("dispose",g);const S=a.indexOf(b.__bindingPointIndex);a.splice(S,1),t.deleteBuffer(i[b.id]),delete i[b.id],delete o[b.id]}function m(){for(const x in i)t.deleteBuffer(i[x]);a=[],i={},o={}}return{bind:l,update:c,dispose:m}}class Koe{constructor(e={}){const{canvas:n=eee(),context:r=null,depth:i=!0,stencil:o=!1,alpha:a=!1,antialias:s=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:d=!1,reverseDepthBuffer:f=!1}=e;this.isWebGLRenderer=!0;let p;if(r!==null){if(typeof WebGLRenderingContext<"u"&&r instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");p=r.getContextAttributes().alpha}else p=a;const y=new Uint32Array(4),v=new Int32Array(4);let g=null,m=null;const x=[],b=[];this.domElement=n,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=nl,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const S=this;let w=!1;this._outputColorSpace=Zt;let E=0,T=0,A=null,M=-1,C=null;const P=new Yt,R=new Yt;let D=null;const k=new ft(0);let U=0,O=n.width,X=n.height,L=1,j=null,K=null;const te=new Yt(0,0,O,X),H=new Yt(0,0,O,X);let q=!1;const $=new rC;let Y=!1,ee=!1;const J=new gt,ce=new gt,ae=new ne,fe=new Yt,we={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let le=!1;function ie(){return A===null?L:1}let W=r;function Ve(z,oe){return n.getContext(z,oe)}try{const z={alpha:!0,depth:i,stencil:o,antialias:s,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:d};if("setAttribute"in n&&n.setAttribute("data-engine",`three.js r${HA}`),n.addEventListener("webglcontextlost",Ge,!1),n.addEventListener("webglcontextrestored",Te,!1),n.addEventListener("webglcontextcreationerror",_e,!1),W===null){const oe="webgl2";if(W=Ve(oe,z),W===null)throw Ve(oe)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(z){throw console.error("THREE.WebGLRenderer: "+z.message),z}let Ne,st,Re,ct,Ye,it,Ft,Z,F,ue,me,be,ge,rt,Ie,Ze,tt,Ee,Be,ht,ot,Le,_t,re;function ke(){Ne=new oie(W),Ne.init(),Le=new $oe(W,Ne),st=new Zre(W,Ne,e,Le),Re=new Foe(W,Ne),st.reverseDepthBuffer&&f&&Re.buffers.depth.setReversed(!0),ct=new lie(W),Ye=new Moe,it=new Boe(W,Ne,Re,Ye,st,Le,ct),Ft=new eie(S),Z=new iie(S),F=new pte(W),_t=new Yre(W,F),ue=new aie(W,F,ct,_t),me=new uie(W,ue,F,ct),Be=new cie(W,st,it),Ze=new Qre(Ye),be=new Toe(S,Ft,Z,Ne,st,_t,Ze),ge=new Xoe(S,Ye),rt=new Coe,Ie=new Doe(Ne),Ee=new Kre(S,Ft,Z,Re,me,p,l),tt=new joe(S,me,st),re=new qoe(W,ct,st,Re),ht=new Jre(W,Ne,ct),ot=new sie(W,Ne,ct),ct.programs=be.programs,S.capabilities=st,S.extensions=Ne,S.properties=Ye,S.renderLists=rt,S.shadowMap=tt,S.state=Re,S.info=ct}ke();const Me=new Goe(S,W);this.xr=Me,this.getContext=function(){return W},this.getContextAttributes=function(){return W.getContextAttributes()},this.forceContextLoss=function(){const z=Ne.get("WEBGL_lose_context");z&&z.loseContext()},this.forceContextRestore=function(){const z=Ne.get("WEBGL_lose_context");z&&z.restoreContext()},this.getPixelRatio=function(){return L},this.setPixelRatio=function(z){z!==void 0&&(L=z,this.setSize(O,X,!1))},this.getSize=function(z){return z.set(O,X)},this.setSize=function(z,oe,de=!0){if(Me.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}O=z,X=oe,n.width=Math.floor(z*L),n.height=Math.floor(oe*L),de===!0&&(n.style.width=z+"px",n.style.height=oe+"px"),this.setViewport(0,0,z,oe)},this.getDrawingBufferSize=function(z){return z.set(O*L,X*L).floor()},this.setDrawingBufferSize=function(z,oe,de){O=z,X=oe,L=de,n.width=Math.floor(z*de),n.height=Math.floor(oe*de),this.setViewport(0,0,z,oe)},this.getCurrentViewport=function(z){return z.copy(P)},this.getViewport=function(z){return z.copy(te)},this.setViewport=function(z,oe,de,he){z.isVector4?te.set(z.x,z.y,z.z,z.w):te.set(z,oe,de,he),Re.viewport(P.copy(te).multiplyScalar(L).round())},this.getScissor=function(z){return z.copy(H)},this.setScissor=function(z,oe,de,he){z.isVector4?H.set(z.x,z.y,z.z,z.w):H.set(z,oe,de,he),Re.scissor(R.copy(H).multiplyScalar(L).round())},this.getScissorTest=function(){return q},this.setScissorTest=function(z){Re.setScissorTest(q=z)},this.setOpaqueSort=function(z){j=z},this.setTransparentSort=function(z){K=z},this.getClearColor=function(z){return z.copy(Ee.getClearColor())},this.setClearColor=function(){Ee.setClearColor(...arguments)},this.getClearAlpha=function(){return Ee.getClearAlpha()},this.setClearAlpha=function(){Ee.setClearAlpha(...arguments)},this.clear=function(z=!0,oe=!0,de=!0){let he=0;if(z){let se=!1;if(A!==null){const Pe=A.texture.format;se=Pe===YA||Pe===KA||Pe===qA}if(se){const Pe=A.texture.type,Ue=Pe===_a||Pe===Nc||Pe===Ep||Pe===Tp||Pe===GA||Pe===WA,Qe=Ee.getClearColor(),We=Ee.getClearAlpha(),wt=Qe.r,St=Qe.g,ut=Qe.b;Ue?(y[0]=wt,y[1]=St,y[2]=ut,y[3]=We,W.clearBufferuiv(W.COLOR,0,y)):(v[0]=wt,v[1]=St,v[2]=ut,v[3]=We,W.clearBufferiv(W.COLOR,0,v))}else he|=W.COLOR_BUFFER_BIT}oe&&(he|=W.DEPTH_BUFFER_BIT),de&&(he|=W.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),W.clear(he)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){n.removeEventListener("webglcontextlost",Ge,!1),n.removeEventListener("webglcontextrestored",Te,!1),n.removeEventListener("webglcontextcreationerror",_e,!1),Ee.dispose(),rt.dispose(),Ie.dispose(),Ye.dispose(),Ft.dispose(),Z.dispose(),me.dispose(),_t.dispose(),re.dispose(),be.dispose(),Me.dispose(),Me.removeEventListener("sessionstart",Ui),Me.removeEventListener("sessionend",wr),nr.stop()};function Ge(z){z.preventDefault(),w=!0}function Te(){w=!1;const z=ct.autoReset,oe=tt.enabled,de=tt.autoUpdate,he=tt.needsUpdate,se=tt.type;ke(),ct.autoReset=z,tt.enabled=oe,tt.autoUpdate=de,tt.needsUpdate=he,tt.type=se}function _e(z){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",z.statusMessage)}function Se(z){const oe=z.target;oe.removeEventListener("dispose",Se),je(oe)}function je(z){vt(z),Ye.remove(z)}function vt(z){const oe=Ye.get(z).programs;oe!==void 0&&(oe.forEach(function(de){be.releaseProgram(de)}),z.isShaderMaterial&&be.releaseShaderCache(z))}this.renderBufferDirect=function(z,oe,de,he,se,Pe){oe===null&&(oe=we);const Ue=se.isMesh&&se.matrixWorld.determinant()<0,Qe=Gb(z,oe,de,he,se);Re.setMaterial(he,Ue);let We=de.index,wt=1;if(he.wireframe===!0){if(We=ue.getWireframeAttribute(de),We===void 0)return;wt=2}const St=de.drawRange,ut=de.attributes.position;let At=St.start*wt,Kt=(St.start+St.count)*wt;Pe!==null&&(At=Math.max(At,Pe.start*wt),Kt=Math.min(Kt,(Pe.start+Pe.count)*wt)),We!==null?(At=Math.max(At,0),Kt=Math.min(Kt,We.count)):ut!=null&&(At=Math.max(At,0),Kt=Math.min(Kt,ut.count));const hn=Kt-At;if(hn<0||hn===1/0)return;_t.setup(se,he,Qe,de,We);let Sn,Bt=ht;if(We!==null&&(Sn=F.get(We),Bt=ot,Bt.setIndex(Sn)),se.isMesh)he.wireframe===!0?(Re.setLineWidth(he.wireframeLinewidth*ie()),Bt.setMode(W.LINES)):Bt.setMode(W.TRIANGLES);else if(se.isLine){let mt=he.linewidth;mt===void 0&&(mt=1),Re.setLineWidth(mt*ie()),se.isLineSegments?Bt.setMode(W.LINES):se.isLineLoop?Bt.setMode(W.LINE_LOOP):Bt.setMode(W.LINE_STRIP)}else se.isPoints?Bt.setMode(W.POINTS):se.isSprite&&Bt.setMode(W.TRIANGLES);if(se.isBatchedMesh)if(se._multiDrawInstances!==null)ld("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),Bt.renderMultiDrawInstances(se._multiDrawStarts,se._multiDrawCounts,se._multiDrawCount,se._multiDrawInstances);else if(Ne.get("WEBGL_multi_draw"))Bt.renderMultiDraw(se._multiDrawStarts,se._multiDrawCounts,se._multiDrawCount);else{const mt=se._multiDrawStarts,Vn=se._multiDrawCounts,Vt=se._multiDrawCount,Qr=We?F.get(We).bytesPerElement:1,pn=Ye.get(he).currentProgram.getUniforms();for(let fr=0;fr{function Pe(){if(he.forEach(function(Ue){Ye.get(Ue).currentProgram.isReady()&&he.delete(Ue)}),he.size===0){se(z);return}setTimeout(Pe,10)}Ne.get("KHR_parallel_shader_compile")!==null?Pe():setTimeout(Pe,10)})};let fn=null;function jn(z){fn&&fn(z)}function Ui(){nr.stop()}function wr(){nr.start()}const nr=new t$;nr.setAnimationLoop(jn),typeof self<"u"&&nr.setContext(self),this.setAnimationLoop=function(z){fn=z,Me.setAnimationLoop(z),z===null?nr.stop():nr.start()},Me.addEventListener("sessionstart",Ui),Me.addEventListener("sessionend",wr),this.render=function(z,oe){if(oe!==void 0&&oe.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(w===!0)return;if(z.matrixWorldAutoUpdate===!0&&z.updateMatrixWorld(),oe.parent===null&&oe.matrixWorldAutoUpdate===!0&&oe.updateMatrixWorld(),Me.enabled===!0&&Me.isPresenting===!0&&(Me.cameraAutoUpdate===!0&&Me.updateCamera(oe),oe=Me.getCamera()),z.isScene===!0&&z.onBeforeRender(S,z,oe,A),m=Ie.get(z,b.length),m.init(oe),b.push(m),ce.multiplyMatrices(oe.projectionMatrix,oe.matrixWorldInverse),$.setFromProjectionMatrix(ce),ee=this.localClippingEnabled,Y=Ze.init(this.clippingPlanes,ee),g=rt.get(z,x.length),g.init(),x.push(g),Me.enabled===!0&&Me.isPresenting===!0){const Pe=S.xr.getDepthSensingMesh();Pe!==null&&$f(Pe,oe,-1/0,S.sortObjects)}$f(z,oe,0,S.sortObjects),g.finish(),S.sortObjects===!0&&g.sort(j,K),le=Me.enabled===!1||Me.isPresenting===!1||Me.hasDepthSensing()===!1,le&&Ee.addToRenderList(g,z),this.info.render.frame++,Y===!0&&Ze.beginShadows();const de=m.state.shadowsArray;tt.render(de,z,oe),Y===!0&&Ze.endShadows(),this.info.autoReset===!0&&this.info.reset();const he=g.opaque,se=g.transmissive;if(m.setupLights(),oe.isArrayCamera){const Pe=oe.cameras;if(se.length>0)for(let Ue=0,Qe=Pe.length;Ue0&&zf(he,se,z,oe),le&&Ee.render(z),qm(g,z,oe);A!==null&&T===0&&(it.updateMultisampleRenderTarget(A),it.updateRenderTargetMipmap(A)),z.isScene===!0&&z.onAfterRender(S,z,oe),_t.resetDefaultState(),M=-1,C=null,b.pop(),b.length>0?(m=b[b.length-1],Y===!0&&Ze.setGlobalState(S.clippingPlanes,m.state.camera)):m=null,x.pop(),x.length>0?g=x[x.length-1]:g=null};function $f(z,oe,de,he){if(z.visible===!1)return;if(z.layers.test(oe.layers)){if(z.isGroup)de=z.renderOrder;else if(z.isLOD)z.autoUpdate===!0&&z.update(oe);else if(z.isLight)m.pushLight(z),z.castShadow&&m.pushShadow(z);else if(z.isSprite){if(!z.frustumCulled||$.intersectsSprite(z)){he&&fe.setFromMatrixPosition(z.matrixWorld).applyMatrix4(ce);const Ue=me.update(z),Qe=z.material;Qe.visible&&g.push(z,Ue,Qe,de,fe.z,null)}}else if((z.isMesh||z.isLine||z.isPoints)&&(!z.frustumCulled||$.intersectsObject(z))){const Ue=me.update(z),Qe=z.material;if(he&&(z.boundingSphere!==void 0?(z.boundingSphere===null&&z.computeBoundingSphere(),fe.copy(z.boundingSphere.center)):(Ue.boundingSphere===null&&Ue.computeBoundingSphere(),fe.copy(Ue.boundingSphere.center)),fe.applyMatrix4(z.matrixWorld).applyMatrix4(ce)),Array.isArray(Qe)){const We=Ue.groups;for(let wt=0,St=We.length;wt0&&Zc(se,oe,de),Pe.length>0&&Zc(Pe,oe,de),Ue.length>0&&Zc(Ue,oe,de),Re.buffers.depth.setTest(!0),Re.buffers.depth.setMask(!0),Re.buffers.color.setMask(!0),Re.setPolygonOffset(!1)}function zf(z,oe,de,he){if((de.isScene===!0?de.overrideMaterial:null)!==null)return;m.state.transmissionRenderTarget[he.id]===void 0&&(m.state.transmissionRenderTarget[he.id]=new Oc(1,1,{generateMipmaps:!0,type:Ne.has("EXT_color_buffer_half_float")||Ne.has("EXT_color_buffer_float")?Om:_a,minFilter:Io,samples:4,stencilBuffer:o,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Dt.workingColorSpace}));const Pe=m.state.transmissionRenderTarget[he.id],Ue=he.viewport||P;Pe.setSize(Ue.z*S.transmissionResolutionScale,Ue.w*S.transmissionResolutionScale);const Qe=S.getRenderTarget();S.setRenderTarget(Pe),S.getClearColor(k),U=S.getClearAlpha(),U<1&&S.setClearColor(16777215,.5),S.clear(),le&&Ee.render(de);const We=S.toneMapping;S.toneMapping=nl;const wt=he.viewport;if(he.viewport!==void 0&&(he.viewport=void 0),m.setupLightsView(he),Y===!0&&Ze.setGlobalState(S.clippingPlanes,he),Zc(z,de,he),it.updateMultisampleRenderTarget(Pe),it.updateRenderTargetMipmap(Pe),Ne.has("WEBGL_multisampled_render_to_texture")===!1){let St=!1;for(let ut=0,At=oe.length;ut0),ut=!!de.morphAttributes.position,At=!!de.morphAttributes.normal,Kt=!!de.morphAttributes.color;let hn=nl;he.toneMapped&&(A===null||A.isXRRenderTarget===!0)&&(hn=S.toneMapping);const Sn=de.morphAttributes.position||de.morphAttributes.normal||de.morphAttributes.color,Bt=Sn!==void 0?Sn.length:0,mt=Ye.get(he),Vn=m.state.lights;if(Y===!0&&(ee===!0||z!==C)){const Un=z===C&&he.id===M;Ze.setState(he,z,Un)}let Vt=!1;he.version===mt.__version?(mt.needsLights&&mt.lightsStateVersion!==Vn.state.version||mt.outputColorSpace!==Qe||se.isBatchedMesh&&mt.batching===!1||!se.isBatchedMesh&&mt.batching===!0||se.isBatchedMesh&&mt.batchingColor===!0&&se.colorTexture===null||se.isBatchedMesh&&mt.batchingColor===!1&&se.colorTexture!==null||se.isInstancedMesh&&mt.instancing===!1||!se.isInstancedMesh&&mt.instancing===!0||se.isSkinnedMesh&&mt.skinning===!1||!se.isSkinnedMesh&&mt.skinning===!0||se.isInstancedMesh&&mt.instancingColor===!0&&se.instanceColor===null||se.isInstancedMesh&&mt.instancingColor===!1&&se.instanceColor!==null||se.isInstancedMesh&&mt.instancingMorph===!0&&se.morphTexture===null||se.isInstancedMesh&&mt.instancingMorph===!1&&se.morphTexture!==null||mt.envMap!==We||he.fog===!0&&mt.fog!==Pe||mt.numClippingPlanes!==void 0&&(mt.numClippingPlanes!==Ze.numPlanes||mt.numIntersection!==Ze.numIntersection)||mt.vertexAlphas!==wt||mt.vertexTangents!==St||mt.morphTargets!==ut||mt.morphNormals!==At||mt.morphColors!==Kt||mt.toneMapping!==hn||mt.morphTargetsCount!==Bt)&&(Vt=!0):(Vt=!0,mt.__version=he.version);let Qr=mt.currentProgram;Vt===!0&&(Qr=Qc(he,oe,se));let pn=!1,fr=!1,Ol=!1;const cn=Qr.getUniforms(),Lr=mt.uniforms;if(Re.useProgram(Qr.program)&&(pn=!0,fr=!0,Ol=!0),he.id!==M&&(M=he.id,fr=!0),pn||C!==z){Re.buffers.depth.getReversed()?(J.copy(z.projectionMatrix),nee(J),ree(J),cn.setValue(W,"projectionMatrix",J)):cn.setValue(W,"projectionMatrix",z.projectionMatrix),cn.setValue(W,"viewMatrix",z.matrixWorldInverse);const Gn=cn.map.cameraPosition;Gn!==void 0&&Gn.setValue(W,ae.setFromMatrixPosition(z.matrixWorld)),st.logarithmicDepthBuffer&&cn.setValue(W,"logDepthBufFC",2/(Math.log(z.far+1)/Math.LN2)),(he.isMeshPhongMaterial||he.isMeshToonMaterial||he.isMeshLambertMaterial||he.isMeshBasicMaterial||he.isMeshStandardMaterial||he.isShaderMaterial)&&cn.setValue(W,"isOrthographic",z.isOrthographicCamera===!0),C!==z&&(C=z,fr=!0,Ol=!0)}if(se.isSkinnedMesh){cn.setOptional(W,se,"bindMatrix"),cn.setOptional(W,se,"bindMatrixInverse");const Un=se.skeleton;Un&&(Un.boneTexture===null&&Un.computeBoneTexture(),cn.setValue(W,"boneTexture",Un.boneTexture,it))}se.isBatchedMesh&&(cn.setOptional(W,se,"batchingTexture"),cn.setValue(W,"batchingTexture",se._matricesTexture,it),cn.setOptional(W,se,"batchingIdTexture"),cn.setValue(W,"batchingIdTexture",se._indirectTexture,it),cn.setOptional(W,se,"batchingColorTexture"),se._colorsTexture!==null&&cn.setValue(W,"batchingColorTexture",se._colorsTexture,it));const Sr=de.morphAttributes;if((Sr.position!==void 0||Sr.normal!==void 0||Sr.color!==void 0)&&Be.update(se,de,Qr),(fr||mt.receiveShadow!==se.receiveShadow)&&(mt.receiveShadow=se.receiveShadow,cn.setValue(W,"receiveShadow",se.receiveShadow)),he.isMeshGouraudMaterial&&he.envMap!==null&&(Lr.envMap.value=We,Lr.flipEnvMap.value=We.isCubeTexture&&We.isRenderTargetTexture===!1?-1:1),he.isMeshStandardMaterial&&he.envMap===null&&oe.environment!==null&&(Lr.envMapIntensity.value=oe.environmentIntensity),fr&&(cn.setValue(W,"toneMappingExposure",S.toneMappingExposure),mt.needsLights&&Wb(Lr,Ol),Pe&&he.fog===!0&&ge.refreshFogUniforms(Lr,Pe),ge.refreshMaterialUniforms(Lr,he,L,X,m.state.transmissionRenderTarget[z.id]),qv.upload(W,Km(mt),Lr,it)),he.isShaderMaterial&&he.uniformsNeedUpdate===!0&&(qv.upload(W,Km(mt),Lr,it),he.uniformsNeedUpdate=!1),he.isSpriteMaterial&&cn.setValue(W,"center",se.center),cn.setValue(W,"modelViewMatrix",se.modelViewMatrix),cn.setValue(W,"normalMatrix",se.normalMatrix),cn.setValue(W,"modelMatrix",se.matrixWorld),he.isShaderMaterial||he.isRawShaderMaterial){const Un=he.uniformsGroups;for(let Gn=0,eu=Un.length;Gn0&&it.useMultisampledRTT(z)===!1?se=Ye.get(z).__webglMultisampledFramebuffer:Array.isArray(St)?se=St[de]:se=St,P.copy(z.viewport),R.copy(z.scissor),D=z.scissorTest}else P.copy(te).multiplyScalar(L).floor(),R.copy(H).multiplyScalar(L).floor(),D=q;if(de!==0&&(se=qb),Re.bindFramebuffer(W.FRAMEBUFFER,se)&&he&&Re.drawBuffers(z,se),Re.viewport(P),Re.scissor(R),Re.setScissorTest(D),Pe){const We=Ye.get(z.texture);W.framebufferTexture2D(W.FRAMEBUFFER,W.COLOR_ATTACHMENT0,W.TEXTURE_CUBE_MAP_POSITIVE_X+oe,We.__webglTexture,de)}else if(Ue){const We=Ye.get(z.texture),wt=oe;W.framebufferTextureLayer(W.FRAMEBUFFER,W.COLOR_ATTACHMENT0,We.__webglTexture,de,wt)}else if(z!==null&&de!==0){const We=Ye.get(z.texture);W.framebufferTexture2D(W.FRAMEBUFFER,W.COLOR_ATTACHMENT0,W.TEXTURE_2D,We.__webglTexture,de)}M=-1},this.readRenderTargetPixels=function(z,oe,de,he,se,Pe,Ue,Qe=0){if(!(z&&z.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let We=Ye.get(z).__webglFramebuffer;if(z.isWebGLCubeRenderTarget&&Ue!==void 0&&(We=We[Ue]),We){Re.bindFramebuffer(W.FRAMEBUFFER,We);try{const wt=z.textures[Qe],St=wt.format,ut=wt.type;if(!st.textureFormatReadable(St)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!st.textureTypeReadable(ut)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}oe>=0&&oe<=z.width-he&&de>=0&&de<=z.height-se&&(z.textures.length>1&&W.readBuffer(W.COLOR_ATTACHMENT0+Qe),W.readPixels(oe,de,he,se,Le.convert(St),Le.convert(ut),Pe))}finally{const wt=A!==null?Ye.get(A).__webglFramebuffer:null;Re.bindFramebuffer(W.FRAMEBUFFER,wt)}}},this.readRenderTargetPixelsAsync=async function(z,oe,de,he,se,Pe,Ue,Qe=0){if(!(z&&z.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let We=Ye.get(z).__webglFramebuffer;if(z.isWebGLCubeRenderTarget&&Ue!==void 0&&(We=We[Ue]),We)if(oe>=0&&oe<=z.width-he&&de>=0&&de<=z.height-se){Re.bindFramebuffer(W.FRAMEBUFFER,We);const wt=z.textures[Qe],St=wt.format,ut=wt.type;if(!st.textureFormatReadable(St))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!st.textureTypeReadable(ut))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const At=W.createBuffer();W.bindBuffer(W.PIXEL_PACK_BUFFER,At),W.bufferData(W.PIXEL_PACK_BUFFER,Pe.byteLength,W.STREAM_READ),z.textures.length>1&&W.readBuffer(W.COLOR_ATTACHMENT0+Qe),W.readPixels(oe,de,he,se,Le.convert(St),Le.convert(ut),0);const Kt=A!==null?Ye.get(A).__webglFramebuffer:null;Re.bindFramebuffer(W.FRAMEBUFFER,Kt);const hn=W.fenceSync(W.SYNC_GPU_COMMANDS_COMPLETE,0);return W.flush(),await tee(W,hn,4),W.bindBuffer(W.PIXEL_PACK_BUFFER,At),W.getBufferSubData(W.PIXEL_PACK_BUFFER,0,Pe),W.deleteBuffer(At),W.deleteSync(hn),Pe}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(z,oe=null,de=0){const he=Math.pow(2,-de),se=Math.floor(z.image.width*he),Pe=Math.floor(z.image.height*he),Ue=oe!==null?oe.x:0,Qe=oe!==null?oe.y:0;it.setTexture2D(z,0),W.copyTexSubImage2D(W.TEXTURE_2D,de,0,0,Ue,Qe,se,Pe),Re.unbindTexture()};const Kb=W.createFramebuffer(),Yb=W.createFramebuffer();this.copyTextureToTexture=function(z,oe,de=null,he=null,se=0,Pe=null){Pe===null&&(se!==0?(ld("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),Pe=se,se=0):Pe=0);let Ue,Qe,We,wt,St,ut,At,Kt,hn;const Sn=z.isCompressedTexture?z.mipmaps[Pe]:z.image;if(de!==null)Ue=de.max.x-de.min.x,Qe=de.max.y-de.min.y,We=de.isBox3?de.max.z-de.min.z:1,wt=de.min.x,St=de.min.y,ut=de.isBox3?de.min.z:0;else{const Sr=Math.pow(2,-se);Ue=Math.floor(Sn.width*Sr),Qe=Math.floor(Sn.height*Sr),z.isDataArrayTexture?We=Sn.depth:z.isData3DTexture?We=Math.floor(Sn.depth*Sr):We=1,wt=0,St=0,ut=0}he!==null?(At=he.x,Kt=he.y,hn=he.z):(At=0,Kt=0,hn=0);const Bt=Le.convert(oe.format),mt=Le.convert(oe.type);let Vn;oe.isData3DTexture?(it.setTexture3D(oe,0),Vn=W.TEXTURE_3D):oe.isDataArrayTexture||oe.isCompressedArrayTexture?(it.setTexture2DArray(oe,0),Vn=W.TEXTURE_2D_ARRAY):(it.setTexture2D(oe,0),Vn=W.TEXTURE_2D),W.pixelStorei(W.UNPACK_FLIP_Y_WEBGL,oe.flipY),W.pixelStorei(W.UNPACK_PREMULTIPLY_ALPHA_WEBGL,oe.premultiplyAlpha),W.pixelStorei(W.UNPACK_ALIGNMENT,oe.unpackAlignment);const Vt=W.getParameter(W.UNPACK_ROW_LENGTH),Qr=W.getParameter(W.UNPACK_IMAGE_HEIGHT),pn=W.getParameter(W.UNPACK_SKIP_PIXELS),fr=W.getParameter(W.UNPACK_SKIP_ROWS),Ol=W.getParameter(W.UNPACK_SKIP_IMAGES);W.pixelStorei(W.UNPACK_ROW_LENGTH,Sn.width),W.pixelStorei(W.UNPACK_IMAGE_HEIGHT,Sn.height),W.pixelStorei(W.UNPACK_SKIP_PIXELS,wt),W.pixelStorei(W.UNPACK_SKIP_ROWS,St),W.pixelStorei(W.UNPACK_SKIP_IMAGES,ut);const cn=z.isDataArrayTexture||z.isData3DTexture,Lr=oe.isDataArrayTexture||oe.isData3DTexture;if(z.isDepthTexture){const Sr=Ye.get(z),Un=Ye.get(oe),Gn=Ye.get(Sr.__renderTarget),eu=Ye.get(Un.__renderTarget);Re.bindFramebuffer(W.READ_FRAMEBUFFER,Gn.__webglFramebuffer),Re.bindFramebuffer(W.DRAW_FRAMEBUFFER,eu.__webglFramebuffer);for(let Ma=0;MaMath.PI&&(r-=ti),i<-Math.PI?i+=ti:i>Math.PI&&(i-=ti),r<=i?this._spherical.theta=Math.max(r,Math.min(i,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(r+i)/2?Math.max(r,this._spherical.theta):Math.min(i,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let o=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const a=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),o=a!=this._spherical.radius}if(Wn.setFromSpherical(this._spherical),Wn.applyQuaternion(this._quatInverse),n.copy(this.target).add(Wn),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let a=null;if(this.object.isPerspectiveCamera){const s=Wn.length();a=this._clampDistance(s*this._scale);const l=s-a;this.object.position.addScaledVector(this._dollyDirection,l),this.object.updateMatrixWorld(),o=!!l}else if(this.object.isOrthographicCamera){const s=new ne(this._mouse.x,this._mouse.y,0);s.unproject(this.object);const l=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),o=l!==this.object.zoom;const c=new ne(this._mouse.x,this._mouse.y,0);c.unproject(this.object),this.object.position.sub(c).add(s),this.object.updateMatrixWorld(),a=Wn.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;a!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(a).add(this.object.position):(tv.origin.copy(this.object.position),tv.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(tv.direction))Mw||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Mw||this._lastTargetPosition.distanceToSquared(this.target)>Mw?(this.dispatchEvent(r2),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(e){return e!==null?ti/60*this.autoRotateSpeed*e:ti/60/60*this.autoRotateSpeed}_getZoomScale(e){const n=Math.abs(e*.01);return Math.pow(.95,this.zoomSpeed*n)}_rotateLeft(e){this._sphericalDelta.theta-=e}_rotateUp(e){this._sphericalDelta.phi-=e}_panLeft(e,n){Wn.setFromMatrixColumn(n,0),Wn.multiplyScalar(-e),this._panOffset.add(Wn)}_panUp(e,n){this.screenSpacePanning===!0?Wn.setFromMatrixColumn(n,1):(Wn.setFromMatrixColumn(n,0),Wn.crossVectors(this.object.up,Wn)),Wn.multiplyScalar(e),this._panOffset.add(Wn)}_pan(e,n){const r=this.domElement;if(this.object.isPerspectiveCamera){const i=this.object.position;Wn.copy(i).sub(this.target);let o=Wn.length();o*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*e*o/r.clientHeight,this.object.matrix),this._panUp(2*n*o/r.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(e*(this.object.right-this.object.left)/this.object.zoom/r.clientWidth,this.object.matrix),this._panUp(n*(this.object.top-this.object.bottom)/this.object.zoom/r.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(e,n){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const r=this.domElement.getBoundingClientRect(),i=e-r.left,o=n-r.top,a=r.width,s=r.height;this._mouse.x=i/a*2-1,this._mouse.y=-(o/s)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(e){return Math.max(this.minDistance,Math.min(this.maxDistance,e))}_handleMouseDownRotate(e){this._rotateStart.set(e.clientX,e.clientY)}_handleMouseDownDolly(e){this._updateZoomParameters(e.clientX,e.clientX),this._dollyStart.set(e.clientX,e.clientY)}_handleMouseDownPan(e){this._panStart.set(e.clientX,e.clientY)}_handleMouseMoveRotate(e){this._rotateEnd.set(e.clientX,e.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const n=this.domElement;this._rotateLeft(ti*this._rotateDelta.x/n.clientHeight),this._rotateUp(ti*this._rotateDelta.y/n.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(e){this._dollyEnd.set(e.clientX,e.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(e){this._panEnd.set(e.clientX,e.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(e){this._updateZoomParameters(e.clientX,e.clientY),e.deltaY<0?this._dollyIn(this._getZoomScale(e.deltaY)):e.deltaY>0&&this._dollyOut(this._getZoomScale(e.deltaY)),this.update()}_handleKeyDown(e){let n=!1;switch(e.code){case this.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(ti*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),n=!0;break;case this.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(-ti*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),n=!0;break;case this.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(ti*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),n=!0;break;case this.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(-ti*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),n=!0;break}n&&(e.preventDefault(),this.update())}_handleTouchStartRotate(e){if(this._pointers.length===1)this._rotateStart.set(e.pageX,e.pageY);else{const n=this._getSecondPointerPosition(e),r=.5*(e.pageX+n.x),i=.5*(e.pageY+n.y);this._rotateStart.set(r,i)}}_handleTouchStartPan(e){if(this._pointers.length===1)this._panStart.set(e.pageX,e.pageY);else{const n=this._getSecondPointerPosition(e),r=.5*(e.pageX+n.x),i=.5*(e.pageY+n.y);this._panStart.set(r,i)}}_handleTouchStartDolly(e){const n=this._getSecondPointerPosition(e),r=e.pageX-n.x,i=e.pageY-n.y,o=Math.sqrt(r*r+i*i);this._dollyStart.set(0,o)}_handleTouchStartDollyPan(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enablePan&&this._handleTouchStartPan(e)}_handleTouchStartDollyRotate(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enableRotate&&this._handleTouchStartRotate(e)}_handleTouchMoveRotate(e){if(this._pointers.length==1)this._rotateEnd.set(e.pageX,e.pageY);else{const r=this._getSecondPointerPosition(e),i=.5*(e.pageX+r.x),o=.5*(e.pageY+r.y);this._rotateEnd.set(i,o)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const n=this.domElement;this._rotateLeft(ti*this._rotateDelta.x/n.clientHeight),this._rotateUp(ti*this._rotateDelta.y/n.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(e){if(this._pointers.length===1)this._panEnd.set(e.pageX,e.pageY);else{const n=this._getSecondPointerPosition(e),r=.5*(e.pageX+n.x),i=.5*(e.pageY+n.y);this._panEnd.set(r,i)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(e){const n=this._getSecondPointerPosition(e),r=e.pageX-n.x,i=e.pageY-n.y,o=Math.sqrt(r*r+i*i);this._dollyEnd.set(0,o),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const a=(e.pageX+n.x)*.5,s=(e.pageY+n.y)*.5;this._updateZoomParameters(a,s)}_handleTouchMoveDollyPan(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enablePan&&this._handleTouchMovePan(e)}_handleTouchMoveDollyRotate(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enableRotate&&this._handleTouchMoveRotate(e)}_addPointer(e){this._pointers.push(e.pointerId)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let n=0;n>5&31)/31,y=(O>>10&31)/31)}for(let O=1;O<=3;O++){const X=R+O*12,L=P*3*3+(O-1)*3;A[L]=u.getFloat32(X,!0),A[L+1]=u.getFloat32(X+4,!0),A[L+2]=u.getFloat32(X+8,!0),M[L]=D,M[L+1]=k,M[L+2]=U,v&&(C.setRGB(f,p,y,Zt),g[L]=C.r,g[L+1]=C.g,g[L+2]=C.b)}}return T.setAttribute("position",new cr(A,3)),T.setAttribute("normal",new cr(M,3)),v&&(T.setAttribute("color",new cr(g,3)),T.hasColors=!0,T.alpha=S),T}function o(c){const u=new br,d=/solid([\s\S]*?)endsolid/g,f=/facet([\s\S]*?)endfacet/g,p=/solid\s(.+)/;let y=0;const v=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,g=new RegExp("vertex"+v+v+v,"g"),m=new RegExp("normal"+v+v+v,"g"),x=[],b=[],S=[],w=new ne;let E,T=0,A=0,M=0;for(;(E=d.exec(c))!==null;){A=M;const C=E[0],P=(E=p.exec(C))!==null?E[1]:"";for(S.push(P);(E=f.exec(C))!==null;){let k=0,U=0;const O=E[0];for(;(E=m.exec(O))!==null;)w.x=parseFloat(E[1]),w.y=parseFloat(E[2]),w.z=parseFloat(E[3]),U++;for(;(E=g.exec(O))!==null;)x.push(parseFloat(E[1]),parseFloat(E[2]),parseFloat(E[3])),b.push(w.x,w.y,w.z),k++,M++;U!==1&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+y),k!==3&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+y),y++}const R=A,D=M-A;u.userData.groupNames=S,u.addGroup(R,D,T),T++}return u.setAttribute("position",new Qt(x,3)),u.setAttribute("normal",new Qt(b,3)),u}function a(c){return typeof c!="string"?new TextDecoder().decode(c):c}function s(c){if(typeof c=="string"){const u=new Uint8Array(c.length);for(let d=0;d256||O.colormap_size!==24||O.colormap_type!==1)throw new Error("THREE.TGALoader: Invalid type colormap data for indexed type.");break;case p:case y:case g:case m:if(O.colormap_type)throw new Error("THREE.TGALoader: Invalid type colormap data for colormap type.");break;case d:throw new Error("THREE.TGALoader: No data.");default:throw new Error("THREE.TGALoader: Invalid type "+O.image_type)}if(O.width<=0||O.height<=0)throw new Error("THREE.TGALoader: Invalid image size.");if(O.pixel_size!==8&&O.pixel_size!==16&&O.pixel_size!==24&&O.pixel_size!==32)throw new Error("THREE.TGALoader: Invalid pixel size "+O.pixel_size)}function r(O,X,L,j,K){let te,H;const q=L.pixel_size>>3,$=L.width*L.height*q;if(X&&(H=K.subarray(j,j+=L.colormap_length*(L.colormap_size>>3))),O){te=new Uint8Array($);let Y,ee,J,ce=0;const ae=new Uint8Array(q);for(;ce<$;)if(Y=K[j++],ee=(Y&127)+1,Y&128){for(J=0;J>7,O[(ee+ce*J)*4+1]=($&992)>>2,O[(ee+ce*J)*4+2]=($&31)<<3,O[(ee+ce*J)*4+3]=$&32768?0:255;return O}function a(O,X,L,j,K,te,H,q){let $=0,Y,ee;const J=C.width;for(ee=X;ee!==j;ee+=L)for(Y=K;Y!==H;Y+=te,$+=3)O[(Y+J*ee)*4+3]=255,O[(Y+J*ee)*4+2]=q[$+0],O[(Y+J*ee)*4+1]=q[$+1],O[(Y+J*ee)*4+0]=q[$+2];return O}function s(O,X,L,j,K,te,H,q){let $=0,Y,ee;const J=C.width;for(ee=X;ee!==j;ee+=L)for(Y=K;Y!==H;Y+=te,$+=4)O[(Y+J*ee)*4+2]=q[$+0],O[(Y+J*ee)*4+1]=q[$+1],O[(Y+J*ee)*4+0]=q[$+2],O[(Y+J*ee)*4+3]=q[$+3];return O}function l(O,X,L,j,K,te,H,q){let $,Y=0,ee,J;const ce=C.width;for(J=X;J!==j;J+=L)for(ee=K;ee!==H;ee+=te,Y++)$=q[Y],O[(ee+ce*J)*4+0]=$,O[(ee+ce*J)*4+1]=$,O[(ee+ce*J)*4+2]=$,O[(ee+ce*J)*4+3]=255;return O}function c(O,X,L,j,K,te,H,q){let $=0,Y,ee;const J=C.width;for(ee=X;ee!==j;ee+=L)for(Y=K;Y!==H;Y+=te,$+=2)O[(Y+J*ee)*4+0]=q[$+0],O[(Y+J*ee)*4+1]=q[$+0],O[(Y+J*ee)*4+2]=q[$+0],O[(Y+J*ee)*4+3]=q[$+1];return O}function u(O,X,L,j,K){let te,H,q,$,Y,ee;switch((C.flags&x)>>b){default:case E:te=0,q=1,Y=X,H=0,$=1,ee=L;break;case S:te=0,q=1,Y=X,H=L-1,$=-1,ee=-1;break;case T:te=X-1,q=-1,Y=-1,H=0,$=1,ee=L;break;case w:te=X-1,q=-1,Y=-1,H=L-1,$=-1,ee=-1;break}if(D)switch(C.pixel_size){case 8:l(O,H,$,ee,te,q,Y,j);break;case 16:c(O,H,$,ee,te,q,Y,j);break;default:throw new Error("THREE.TGALoader: Format not supported.")}else switch(C.pixel_size){case 8:i(O,H,$,ee,te,q,Y,j,K);break;case 16:o(O,H,$,ee,te,q,Y,j);break;case 24:a(O,H,$,ee,te,q,Y,j);break;case 32:s(O,H,$,ee,te,q,Y,j);break;default:throw new Error("THREE.TGALoader: Format not supported.")}return O}const d=0,f=1,p=2,y=3,v=9,g=10,m=11,x=48,b=4,S=0,w=1,E=2,T=3;if(e.length<19)throw new Error("THREE.TGALoader: Not enough data to contain header.");let A=0;const M=new Uint8Array(e),C={id_length:M[A++],colormap_type:M[A++],image_type:M[A++],colormap_index:M[A++]|M[A++]<<8,colormap_length:M[A++]|M[A++]<<8,colormap_size:M[A++],origin:[M[A++]|M[A++]<<8,M[A++]|M[A++]<<8],width:M[A++]|M[A++]<<8,height:M[A++]|M[A++]<<8,pixel_size:M[A++],flags:M[A++]};if(n(C),C.id_length+A>e.length)throw new Error("THREE.TGALoader: No data.");A+=C.id_length;let P=!1,R=!1,D=!1;switch(C.image_type){case v:P=!0,R=!0;break;case f:R=!0;break;case g:P=!0;break;case p:break;case m:P=!0,D=!0;break;case y:D=!0;break}const k=new Uint8Array(C.width*C.height*4),U=r(P,R,C,A,M);return u(k,C.width,C.height,U.pixel_data,U.palettes),{data:k,width:C.width,height:C.height,flipY:!0,generateMipmaps:!0,minFilter:Io}}}class l$ extends Go{load(e,n,r,i){const o=this,a=o.path===""?mc.extractUrlBase(e):o.path,s=new Mf(o.manager);s.setPath(o.path),s.setRequestHeader(o.requestHeader),s.setWithCredentials(o.withCredentials),s.load(e,function(l){try{n(o.parse(l,a))}catch(c){i?i(c):console.error(c),o.manager.itemError(e)}},r,i)}parse(e,n){function r(I,N){const V=[],B=I.childNodes;for(let G=0,pe=B.length;G0&&N.push(new pl(B+".position",G,pe)),ye.length>0&&N.push(new Ic(B+".quaternion",G,ye)),Xe.length>0&&N.push(new pl(B+".scale",G,Xe)),N}function P(I,N,V){let B,G=!0,pe,ye;for(pe=0,ye=I.length;pe=0;){const B=I[N];if(B.value[V]!==null)return B;N--}return null}function k(I,N,V){for(;N>>0)+2);switch(V=V.toLowerCase(),V){case"tga":N=Sr;break;default:N=Lr}return N}function be(I){const N=F(I.url),V=N.profile.technique;let B;switch(V.type){case"phong":case"blinn":B=new Bo;break;case"lambert":B=new jee;break;default:B=new ua;break}B.name=I.name||"";function G(De,$e=null){const lt=N.profile.samplers[De.id];let Ae=null;if(lt!==void 0){const at=N.profile.surfaces[lt.source];Ae=ce(at.init_from)}else console.warn("THREE.ColladaLoader: Undefined sampler. Access image directly (see #12530)."),Ae=ce(De.id);if(Ae!==null){const at=me(Ae);if(at!==void 0){const et=at.load(Ae),yt=De.extra;if(yt!==void 0&&yt.technique!==void 0&&c(yt.technique)===!1){const dt=yt.technique;et.wrapS=dt.wrapU?ca:Ji,et.wrapT=dt.wrapV?ca:Ji,et.offset.set(dt.offsetU||0,dt.offsetV||0),et.repeat.set(dt.repeatU||1,dt.repeatV||1)}else et.wrapS=ca,et.wrapT=ca;return $e!==null&&(et.colorSpace=$e),et}else return console.warn("THREE.ColladaLoader: Loader for texture %s not found.",Ae),null}else return console.warn("THREE.ColladaLoader: Couldn't create texture with ID:",De.id),null}const pe=V.parameters;for(const De in pe){const $e=pe[De];switch(De){case"diffuse":$e.color&&B.color.fromArray($e.color),$e.texture&&(B.map=G($e.texture,Zt));break;case"specular":$e.color&&B.specular&&B.specular.fromArray($e.color),$e.texture&&(B.specularMap=G($e.texture));break;case"bump":$e.texture&&(B.normalMap=G($e.texture));break;case"ambient":$e.texture&&(B.lightMap=G($e.texture,Zt));break;case"shininess":$e.float&&B.shininess&&(B.shininess=$e.float);break;case"emission":$e.color&&B.emissive&&B.emissive.fromArray($e.color),$e.texture&&(B.emissiveMap=G($e.texture,Zt));break}}Dt.colorSpaceToWorking(B.color,Zt),B.specular&&Dt.colorSpaceToWorking(B.specular,Zt),B.emissive&&Dt.colorSpaceToWorking(B.emissive,Zt);let ye=pe.transparent,Xe=pe.transparency;if(Xe===void 0&&ye&&(Xe={float:1}),ye===void 0&&Xe&&(ye={opaque:"A_ONE",data:{color:[1,1,1,1]}}),ye&&Xe)if(ye.data.texture)B.transparent=!0;else{const De=ye.data.color;switch(ye.opaque){case"A_ONE":B.opacity=De[3]*Xe.float;break;case"RGB_ZERO":B.opacity=1-De[0]*Xe.float;break;case"A_ZERO":B.opacity=1-De[3]*Xe.float;break;case"RGB_ONE":B.opacity=De[0]*Xe.float;break;default:console.warn('THREE.ColladaLoader: Invalid opaque type "%s" of transparent tag.',ye.opaque)}B.opacity<1&&(B.transparent=!0)}if(V.extra!==void 0&&V.extra.technique!==void 0){const De=V.extra.technique;for(const $e in De){const lt=De[$e];switch($e){case"double_sided":B.side=lt===1?Ki:ba;break;case"bump":B.normalMap=G(lt.texture),B.normalScale=new xt(1,1);break}}}return B}function ge(I){return v(Et.materials[I],be)}function rt(I){const N={name:I.getAttribute("name")};for(let V=0,B=I.childNodes.length;V0?ye+De:ye;N.inputs[$e]={id:pe,offset:Xe},N.stride=Math.max(N.stride,Xe+1),ye==="TEXCOORD"&&(N.hasUV=!0);break;case"vcount":N.vcount=a(G.textContent);break;case"p":N.p=a(G.textContent);break}}return N}function _e(I){const N={};for(let V=0;V0&&N0&&Ae.setAttribute("position",new Qt(G.array,G.stride)),pe.array.length>0&&Ae.setAttribute("normal",new Qt(pe.array,pe.stride)),De.array.length>0&&Ae.setAttribute("color",new Qt(De.array,De.stride)),ye.array.length>0&&Ae.setAttribute("uv",new Qt(ye.array,ye.stride)),Xe.array.length>0&&Ae.setAttribute("uv1",new Qt(Xe.array,Xe.stride)),$e.array.length>0&&Ae.setAttribute("skinIndex",new Qt($e.array,$e.stride)),lt.array.length>0&&Ae.setAttribute("skinWeight",new Qt(lt.array,lt.stride)),B.data=Ae,B.type=I[0].type,B.materialKeys=at,B}function pt(I,N,V,B,G=!1){const pe=I.p,ye=I.stride,Xe=I.vcount;function De(Ae){let at=pe[Ae+V]*lt;const et=at+lt;for(;at4)for(let dt=1,An=yt-2;dt<=An;dt++){const en=Ae+ye*0,Gt=Ae+ye*dt,Wt=Ae+ye*(dt+1);De(en),De(Gt),De(Wt)}Ae+=ye*yt}}else for(let Ae=0,at=pe.length;Ae=N.limits.max&&(N.static=!0),N.middlePosition=(N.limits.min+N.limits.max)/2,N}function zf(I){const N={sid:I.getAttribute("sid"),name:I.getAttribute("name")||"",attachments:[],transforms:[]};for(let V=0;Vet.limits.max||Aer===null?null:parseFloat(r)),(!this.origPosition||!this.origQuaternion)&&(this.origPosition=this.position.clone(),this.origQuaternion=this.quaternion.clone());let n=!1;switch(this.mimicJoints.forEach(r=>{n=r.updateFromMimickedJoint(...e)||n}),this.jointType){case"fixed":return n;case"continuous":case"revolute":{let r=e[0];return r==null||r===this.jointValue[0]?n:(!this.ignoreLimits&&this.jointType==="revolute"&&(r=Math.min(this.limit.upper,r),r=Math.max(this.limit.lower,r)),this.quaternion.setFromAxisAngle(this.axis,r).premultiply(this.origQuaternion),this.jointValue[0]!==r?(this.jointValue[0]=r,this.matrixWorldNeedsUpdate=!0,!0):n)}case"prismatic":{let r=e[0];return r==null||r===this.jointValue[0]?n:(this.ignoreLimits||(r=Math.min(this.limit.upper,r),r=Math.max(this.limit.lower,r)),this.position.copy(this.origPosition),a2.copy(this.axis).applyEuler(this.rotation),this.position.addScaledVector(a2,r),this.jointValue[0]!==r?(this.jointValue[0]=r,this.matrixWorldNeedsUpdate=!0,!0):n)}case"floating":return this.jointValue.every((r,i)=>e[i]===r||e[i]===null)?n:(this.jointValue[0]=e[0]!==null?e[0]:this.jointValue[0],this.jointValue[1]=e[1]!==null?e[1]:this.jointValue[1],this.jointValue[2]=e[2]!==null?e[2]:this.jointValue[2],this.jointValue[3]=e[3]!==null?e[3]:this.jointValue[3],this.jointValue[4]=e[4]!==null?e[4]:this.jointValue[4],this.jointValue[5]=e[5]!==null?e[5]:this.jointValue[5],Ts.compose(this.origPosition,this.origQuaternion,iv),rv.setFromEuler(uae.set(this.jointValue[3],this.jointValue[4],this.jointValue[5],"XYZ")),ov.set(this.jointValue[0],this.jointValue[1],this.jointValue[2]),nv.compose(ov,rv,iv),Ts.premultiply(nv),this.position.setFromMatrixPosition(Ts),this.rotation.setFromRotationMatrix(Ts),this.matrixWorldNeedsUpdate=!0,!0);case"planar":return this.jointValue.every((r,i)=>e[i]===r||e[i]===null)?n:(this.jointValue[0]=e[0]!==null?e[0]:this.jointValue[0],this.jointValue[1]=e[1]!==null?e[1]:this.jointValue[1],this.jointValue[2]=e[2]!==null?e[2]:this.jointValue[2],Ts.compose(this.origPosition,this.origQuaternion,iv),rv.setFromAxisAngle(this.axis,this.jointValue[2]),ov.set(this.jointValue[0],this.jointValue[1],0),nv.compose(ov,rv,iv),Ts.premultiply(nv),this.position.setFromMatrixPosition(Ts),this.rotation.setFromRotationMatrix(Ts),this.matrixWorldNeedsUpdate=!0,!0)}return n}}class s2 extends u${constructor(...e){super(...e),this.type="URDFMimicJoint",this.mimicJoint=null,this.offset=0,this.multiplier=1}updateFromMimickedJoint(...e){const n=e.map(r=>r*this.multiplier+this.offset);return super.setJointValue(...n)}copy(e,n){return super.copy(e,n),this.mimicJoint=e.mimicJoint,this.offset=e.offset,this.multiplier=e.multiplier,this}}class hae extends c${constructor(...e){super(...e),this.isURDFRobot=!0,this.urdfNode=null,this.urdfRobotNode=null,this.robotName=null,this.links=null,this.joints=null,this.colliders=null,this.visual=null,this.frames=null}copy(e,n){super.copy(e,n),this.urdfRobotNode=e.urdfRobotNode,this.robotName=e.robotName,this.links={},this.joints={},this.colliders={},this.visual={},this.traverse(r=>{r.isURDFJoint&&r.urdfName in e.joints&&(this.joints[r.urdfName]=r),r.isURDFLink&&r.urdfName in e.links&&(this.links[r.urdfName]=r),r.isURDFCollider&&r.urdfName in e.colliders&&(this.colliders[r.urdfName]=r),r.isURDFVisual&&r.urdfName in e.visual&&(this.visual[r.urdfName]=r)});for(const r in this.joints)this.joints[r].mimicJoints=this.joints[r].mimicJoints.map(i=>this.joints[i.name]);return this.frames={...this.colliders,...this.visual,...this.links,...this.joints},this}getFrame(e){return this.frames[e]}setJointValue(e,...n){const r=this.joints[e];return r?r.setJointValue(...n):!1}setJointValues(e){let n=!1;for(const r in e){const i=e[r];Array.isArray(i)?n=this.setJointValue(r,...i)||n:n=this.setJointValue(r,i)||n}return n}}const Aw=new Ii,l2=new pi;function _u(t){return t?t.trim().split(/\s+/g).map(e=>parseFloat(e)):[0,0,0]}function c2(t,e,n=!1){n||t.rotation.set(0,0,0),l2.set(e[0],e[1],e[2],"ZYX"),Aw.setFromEuler(l2),Aw.multiply(t.quaternion),t.quaternion.copy(Aw)}class pae{constructor(e){this.manager=e||Y4,this.loadMeshCb=this.defaultMeshLoader.bind(this),this.parseVisual=!0,this.parseCollision=!1,this.packages="",this.workingPath="",this.fetchOptions={}}loadAsync(e){return new Promise((n,r)=>{this.load(e,n,null,r)})}load(e,n,r,i){const o=this.manager,a=mc.extractUrlBase(e),s=this.manager.resolveURL(e);o.itemStart(s),fetch(s,this.fetchOptions).then(l=>{if(l.ok)return r&&r(null),l.text();throw new Error(`URDFLoader: Failed to load url '${s}' with error code ${l.status} : ${l.statusText}.`)}).then(l=>{const c=this.parse(l,this.workingPath||a);n(c),o.itemEnd(s)}).catch(l=>{i?i(l):console.error("URDFLoader: Error loading file.",l),o.itemError(s),o.itemEnd(s)})}parse(e,n=this.workingPath){const r=this.packages,i=this.loadMeshCb,o=this.parseVisual,a=this.parseCollision,s=this.manager,l={},c={},u={};function d(x){if(!/^package:\/\//.test(x))return n?n+x:x;const[b,S]=x.replace(/^package:\/\//,"").split(/\/(.+)/);if(typeof r=="string")return r.endsWith(b)?r+"/"+S:r+"/"+b+"/"+S;if(r instanceof Function)return r(b)+"/"+S;if(typeof r=="object")return b in r?r[b]+"/"+S:(console.error(`URDFLoader : ${b} not found in provided package list.`),null)}function f(x){let b;x instanceof Document?b=[...x.children]:x instanceof Element?b=[x]:b=[...new DOMParser().parseFromString(x,"text/xml").children];const S=b.filter(w=>w.nodeName==="robot").pop();return p(S)}function p(x){const b=[...x.children],S=b.filter(P=>P.nodeName.toLowerCase()==="link"),w=b.filter(P=>P.nodeName.toLowerCase()==="joint"),E=b.filter(P=>P.nodeName.toLowerCase()==="material"),T=new hae;T.robotName=x.getAttribute("name"),T.urdfRobotNode=x,E.forEach(P=>{const R=P.getAttribute("name");u[R]=g(P)});const A={},M={};S.forEach(P=>{const R=P.getAttribute("name"),D=x.querySelector(`child[link="${R}"]`)===null;l[R]=v(P,A,M,D?T:null)}),w.forEach(P=>{const R=P.getAttribute("name");c[R]=y(P)}),T.joints=c,T.links=l,T.colliders=M,T.visual=A;const C=Object.values(c);return C.forEach(P=>{P instanceof s2&&c[P.mimicJoint].mimicJoints.push(P)}),C.forEach(P=>{const R=new Set,D=k=>{if(R.has(k))throw new Error("URDFLoader: Detected an infinite loop of mimic joints.");R.add(k),k.mimicJoints.forEach(U=>{D(U)})};D(P)}),T.frames={...M,...A,...l,...c},T}function y(x){const b=[...x.children],S=x.getAttribute("type");let w;const E=b.find(R=>R.nodeName.toLowerCase()==="mimic");E?(w=new s2,w.mimicJoint=E.getAttribute("joint"),w.multiplier=parseFloat(E.getAttribute("multiplier")||1),w.offset=parseFloat(E.getAttribute("offset")||0)):w=new u$,w.urdfNode=x,w.name=x.getAttribute("name"),w.urdfName=w.name,w.jointType=S;let T=null,A=null,M=[0,0,0],C=[0,0,0];b.forEach(R=>{const D=R.nodeName.toLowerCase();D==="origin"?(M=_u(R.getAttribute("xyz")),C=_u(R.getAttribute("rpy"))):D==="child"?A=l[R.getAttribute("link")]:D==="parent"?T=l[R.getAttribute("link")]:D==="limit"&&(w.limit.lower=parseFloat(R.getAttribute("lower")||w.limit.lower),w.limit.upper=parseFloat(R.getAttribute("upper")||w.limit.upper))}),T.add(w),w.add(A),c2(w,C),w.position.set(M[0],M[1],M[2]);const P=b.filter(R=>R.nodeName.toLowerCase()==="axis")[0];if(P){const R=P.getAttribute("xyz").split(/\s+/g).map(D=>parseFloat(D));w.axis=new ne(R[0],R[1],R[2]),w.axis.normalize()}return w}function v(x,b,S,w=null){w===null&&(w=new c$);const E=[...x.children];return w.name=x.getAttribute("name"),w.urdfName=w.name,w.urdfNode=x,o&&E.filter(A=>A.nodeName.toLowerCase()==="visual").forEach(A=>{const M=m(A,u);if(w.add(M),A.hasAttribute("name")){const C=A.getAttribute("name");M.name=C,M.urdfName=C,b[C]=M}}),a&&E.filter(A=>A.nodeName.toLowerCase()==="collision").forEach(A=>{const M=m(A);if(w.add(M),A.hasAttribute("name")){const C=A.getAttribute("name");M.name=C,M.urdfName=C,S[C]=M}}),w}function g(x){const b=[...x.children],S=new Bo;return S.name=x.getAttribute("name")||"",b.forEach(w=>{const E=w.nodeName.toLowerCase();if(E==="color"){const T=w.getAttribute("rgba").split(/\s/g).map(A=>parseFloat(A));S.color.setRGB(T[0],T[1],T[2]),S.opacity=T[3],S.transparent=T[3]<1,S.depthWrite=!S.transparent}else if(E==="texture"){const T=w.getAttribute("filename");if(T){const A=new sC(s),M=d(T);S.map=A.load(M),S.map.colorSpace=Zt}}}),S}function m(x,b={}){const S=x.nodeName.toLowerCase()==="collision",w=[...x.children];let E=null;const T=w.filter(M=>M.nodeName.toLowerCase()==="material")[0];if(T){const M=T.getAttribute("name");M&&M in b?E=b[M]:E=g(T)}else E=new Bo;const A=S?new dae:new fae;return A.urdfNode=x,w.forEach(M=>{const C=M.nodeName.toLowerCase();if(C==="geometry"){const P=M.children[0].nodeName.toLowerCase();if(P==="mesh"){const R=M.children[0].getAttribute("filename"),D=d(R);if(D!==null){const k=M.children[0].getAttribute("scale");if(k){const U=_u(k);A.scale.set(U[0],U[1],U[2])}i(D,s,(U,O)=>{O?console.error("URDFLoader: Error loading mesh.",O):U&&(U instanceof Tn&&(U.material=E),U.position.set(0,0,0),U.quaternion.identity(),A.add(U))})}}else if(P==="box"){const R=new Tn;R.geometry=new Gc(1,1,1),R.material=E;const D=_u(M.children[0].getAttribute("size"));R.scale.set(D[0],D[1],D[2]),A.add(R)}else if(P==="sphere"){const R=new Tn;R.geometry=new oC(1,30,30),R.material=E;const D=parseFloat(M.children[0].getAttribute("radius"))||0;R.scale.set(D,D,D),A.add(R)}else if(P==="cylinder"){const R=new Tn;R.geometry=new iC(1,1,1,30),R.material=E;const D=parseFloat(M.children[0].getAttribute("radius"))||0,k=parseFloat(M.children[0].getAttribute("length"))||0;R.scale.set(D,k,D),R.rotation.set(Math.PI/2,0,0),A.add(R)}}else if(C==="origin"){const P=_u(M.getAttribute("xyz")),R=_u(M.getAttribute("rpy"));A.position.set(P[0],P[1],P[2]),A.rotation.set(0,0,0),c2(A,R)}}),A}return f(e)}defaultMeshLoader(e,n,r){/\.stl$/i.test(e)?new s$(n).load(e,o=>{const a=new Tn(o,new Bo);r(a)}):/\.dae$/i.test(e)?new l$(n).load(e,o=>r(o.scene)):console.warn(`URDFLoader: Could not load model at ${e}. +No loader available`)}}const mae=new xt,gae=()=>{};class vae extends HTMLElement{static get observedAttributes(){return["package","urdf","up","display-shadow","ambient-color","ignore-limits","show-collision"]}get package(){return this.getAttribute("package")||""}set package(e){this.setAttribute("package",e)}get urdf(){return this.getAttribute("urdf")||""}set urdf(e){this.setAttribute("urdf",e)}get ignoreLimits(){return this.hasAttribute("ignore-limits")||!1}set ignoreLimits(e){e?this.setAttribute("ignore-limits",e):this.removeAttribute("ignore-limits")}get up(){return this.getAttribute("up")||"+Z"}set up(e){this.setAttribute("up",e)}get displayShadow(){return this.hasAttribute("display-shadow")||!1}set displayShadow(e){e?this.setAttribute("display-shadow",""):this.removeAttribute("display-shadow")}get ambientColor(){return this.getAttribute("ambient-color")||"#8ea0a8"}set ambientColor(e){e?this.setAttribute("ambient-color",e):this.removeAttribute("ambient-color")}get autoRedraw(){return this.hasAttribute("auto-redraw")||!1}set autoRedraw(e){e?this.setAttribute("auto-redraw",!0):this.removeAttribute("auto-redraw")}get noAutoRecenter(){return this.hasAttribute("no-auto-recenter")||!1}set noAutoRecenter(e){e?this.setAttribute("no-auto-recenter",!0):this.removeAttribute("no-auto-recenter")}get showCollision(){return this.hasAttribute("show-collision")||!1}set showCollision(e){e?this.setAttribute("show-collision",!0):this.removeAttribute("show-collision")}get jointValues(){const e={};if(this.robot)for(const n in this.robot.joints){const r=this.robot.joints[n];e[n]=r.jointValue.length===1?r.angle:[...r.jointValue]}return e}set jointValues(e){this.setJointValues(e)}get angles(){return this.jointValues}set angles(e){this.jointValues=e}constructor(){super(),this._requestId=0,this._dirty=!1,this._loadScheduled=!1,this.robot=null,this.loadMeshFunc=null,this.urlModifierFunc=null;const e=new V4,n=new Jee(this.ambientColor,"#000");n.groundColor.lerp(n.color,.5*Math.PI),n.intensity=.5,n.position.set(0,1,0),e.add(n);const r=new zx(16777215,Math.PI);r.position.set(4,10,1),r.shadow.mapSize.width=2048,r.shadow.mapSize.height=2048,r.shadow.normalBias=.001,r.castShadow=!0,e.add(r),e.add(r.target);const i=new Koe({antialias:!0,alpha:!0});i.setClearColor(16777215),i.setClearAlpha(0),i.shadowMap.enabled=!0,i.shadowMap.type=E4,i.outputColorSpace=Zt;const o=new gr(75,1,.1,1e3);o.position.z=-10;const a=new vn;e.add(a);const s=new Tn(new Im(40,40),new kee({side:Ki,transparent:!0,opacity:.25}));s.rotation.x=-Math.PI/2,s.position.y=-.5,s.receiveShadow=!0,s.scale.set(10,10,10),e.add(s);const l=new Joe(o,i.domElement);l.rotateSpeed=2,l.zoomSpeed=5,l.panSpeed=2,l.enableZoom=!0,l.enableDamping=!1,l.maxDistance=50,l.minDistance=.25,l.addEventListener("change",()=>this.recenter()),this.scene=e,this.world=a,this.renderer=i,this.camera=o,this.controls=l,this.plane=s,this.directionalLight=r,this.ambientLight=n,this._setUp(this.up),this._collisionMaterial=new Bo({transparent:!0,opacity:.35,shininess:2.5,premultipliedAlpha:!0,color:16760376,polygonOffset:!0,polygonOffsetFactor:-1,polygonOffsetUnits:-1});const c=()=>{this.parentNode&&(this.updateSize(),(this._dirty||this.autoRedraw)&&(this.noAutoRecenter||this._updateEnvironment(),this.renderer.render(e,o),this._dirty=!1),this.controls.update()),this._renderLoopId=requestAnimationFrame(c)};c()}connectedCallback(){if(!this.constructor._styletag){const e=document.createElement("style");e.innerHTML=` ${this.tagName} { display: block; } ${this.tagName} canvas { width: 100%; height: 100%; } - `,document.head.appendChild(e),this.constructor._styletag=e}this.childElementCount===0&&this.appendChild(this.renderer.domElement),this.updateSize(),requestAnimationFrame(()=>this.updateSize())}disconnectedCallback(){cancelAnimationFrame(this._renderLoopId)}attributeChangedCallback(e,n,r){switch(this._updateCollisionVisibility(),this.noAutoRecenter||this.recenter(),e){case"package":case"urdf":{this._scheduleLoad();break}case"up":{this._setUp(this.up);break}case"ambient-color":{this.ambientLight.color.set(this.ambientColor),this.ambientLight.groundColor.set("#000").lerp(this.ambientLight.color,.5);break}case"ignore-limits":{this._setIgnoreLimits(this.ignoreLimits,!0);break}}}updateSize(){const e=this.renderer,n=this.clientWidth,r=this.clientHeight,i=e.getSize(hae);(i.width!==n||i.height!==r)&&this.recenter(),e.setPixelRatio(window.devicePixelRatio),e.setSize(n,r,!1),this.camera.aspect=n/r,this.camera.updateProjectionMatrix()}redraw(){this._dirty=!0}recenter(){this._updateEnvironment(),this.redraw()}setJointValue(e,...n){this.robot&&this.robot.joints[e]&&this.robot.joints[e].setJointValue(...n)&&(this.redraw(),this.dispatchEvent(new CustomEvent("angle-change",{bubbles:!0,cancelable:!0,detail:e})))}setJointValues(e){for(const n in e)this.setJointValue(n,e[n])}_updateEnvironment(){const e=this.robot;if(!e)return;this.world.updateMatrixWorld();const n=new Wo;n.makeEmpty(),e.traverse(o=>{o.isURDFVisual&&n.expandByObject(o)});const r=n.getCenter(new ne);this.controls.target.y=r.y,this.plane.position.y=n.min.y-.001;const i=this.directionalLight;if(i.castShadow=this.displayShadow,this.displayShadow){const a=n.getBoundingSphere(new Xo).radius,s=i.shadow.camera;s.left=s.bottom=-a,s.right=s.top=a;const l=i.position.clone().sub(i.target.position);i.target.position.copy(r),i.position.copy(r).add(l),s.updateProjectionMatrix()}}_scheduleLoad(){this._prevload!==`${this.package}|${this.urdf}`&&(this._prevload=`${this.package}|${this.urdf}`,!this._loadScheduled&&(this._loadScheduled=!0,this.robot&&(this.robot.traverse(e=>e.dispose&&e.dispose()),this.robot.parent.remove(this.robot),this.robot=null),requestAnimationFrame(()=>{this._loadUrdf(this.package,this.urdf),this._loadScheduled=!1})))}_loadUrdf(e,n){if(this.dispatchEvent(new CustomEvent("urdf-change",{bubbles:!0,cancelable:!0,composed:!0})),n){this._requestId++;const r=this._requestId,i=l=>{l.traverse(c=>{if(c.isMesh&&(c.castShadow=!0,c.receiveShadow=!0,c.material)){const u=(Array.isArray(c.material)?c.material:[c.material]).map(d=>(d instanceof ua&&(d=new Fo),d.map&&(d.map.colorSpace=Zt),d));c.material=u.length===1?u[0]:u}})};e.includes(":")&&e.split(":")[1].substring(0,2)!=="//"&&(e=e.split(",").reduce((l,c)=>{const u=c.split(/:/).filter(p=>!!p),d=u.shift().trim(),f=u.join(":").trim();return l[d]=f,l},{}));let o=null;const a=new X4;a.onLoad=()=>{if(this._requestId!==r){o.traverse(l=>l.dispose&&l.dispose());return}this.robot=o,this.world.add(o),i(o),this._setIgnoreLimits(this.ignoreLimits),this._updateCollisionVisibility(),this.dispatchEvent(new CustomEvent("urdf-processed",{bubbles:!0,cancelable:!0,composed:!0})),this.dispatchEvent(new CustomEvent("geometry-loaded",{bubbles:!0,cancelable:!0,composed:!0})),this.recenter()},this.urlModifierFunc&&a.setURLModifier(this.urlModifierFunc);const s=new fae(a);s.packages=e,s.loadMeshCb=this.loadMeshFunc,s.fetchOptions={mode:"cors",credentials:"same-origin"},s.parseCollision=!0,s.load(n,l=>o=l)}}_updateCollisionVisibility(){const e=this.showCollision,n=this._collisionMaterial,r=this.robot;if(r===null)return;const i=[];r.traverse(o=>{o.isURDFCollider&&(o.visible=e,i.push(o))}),i.forEach(o=>{o.traverse(a=>{a.isMesh&&(a.raycast=pae,a.material=n,a.castShadow=!1)})})}_setUp(e){e||(e="+Z"),e=e.toUpperCase();const n=e.replace(/[^-+]/g,"")[0]||"+",r=e.replace(/[^XYZ]/gi,"")[0]||"Z",i=Math.PI,o=i/2;r==="X"&&this.world.rotation.set(0,0,n==="+"?o:-o),r==="Z"&&this.world.rotation.set(n==="+"?-o:o,0,0),r==="Y"&&this.world.rotation.set(n==="+"?0:i,0,0)}_setIgnoreLimits(e,n=!1){this.robot&&Object.values(this.robot.joints).forEach(r=>{r.ignoreLimits=e,r.setJointValue(...r.jointValue)}),n&&this.dispatchEvent(new CustomEvent("ignore-limits-change",{bubbles:!0,cancelable:!0,composed:!0}))}}function gae(t){return t.isURDFJoint&&t.jointType!=="fixed"}function vae(t){let e=t;for(;e;){if(gae(e))return e;e=e.parent}return e}const Cw=new ne,Pw=new ne,Gu=new ne,ri=new ne,c2=new ne,Rh=new ne,Nh=new ne,Ao=new $a;class yae{constructor(e){this.enabled=!0,this.scene=e,this.raycaster=new Z4,this.initialGrabPoint=new ne,this.hitDistance=-1,this.hovered=null,this.manipulating=null}update(){const{raycaster:e,hovered:n,manipulating:r,scene:i}=this;if(r)return;let o=null;const a=e.intersectObject(i,!0);if(a.length!==0){const s=a[0];this.hitDistance=s.distance,o=vae(s.object),this.initialGrabPoint.copy(s.point)}o!==n&&(n&&this.onUnhover(n),this.hovered=o,o&&this.onHover(o))}updateJoint(e,n){e.setJointValue(n)}onDragStart(e){}onDragEnd(e){}onHover(e){}onUnhover(e){}getRevoluteDelta(e,n,r){return ri.copy(e.axis).transformDirection(e.matrixWorld).normalize(),Gu.set(0,0,0).applyMatrix4(e.matrixWorld),Ao.setFromNormalAndCoplanarPoint(ri,Gu),Ao.projectPoint(n,Rh),Ao.projectPoint(r,Nh),Rh.sub(Gu),Nh.sub(Gu),ri.crossVectors(Rh,Nh),Math.sign(ri.dot(Ao.normal))*Nh.angleTo(Rh)}getPrismaticDelta(e,n,r){return ri.subVectors(r,n),Ao.normal.copy(e.axis).transformDirection(e.parent.matrixWorld).normalize(),ri.dot(Ao.normal)}moveRay(e){const{raycaster:n,hitDistance:r,manipulating:i}=this,{ray:o}=n;if(i){o.at(r,Cw),e.at(r,Pw);let a=0;i.jointType==="revolute"||i.jointType==="continuous"?a=this.getRevoluteDelta(i,Cw,Pw):i.jointType==="prismatic"&&(a=this.getPrismaticDelta(i,Cw,Pw)),a&&this.updateJoint(i,i.angle+a)}this.raycaster.ray.copy(e),this.update()}setGrabbed(e){const{hovered:n,manipulating:r}=this;if(e){if(r!==null||n===null)return;this.manipulating=n,this.onDragStart(n)}else{if(this.manipulating===null)return;this.onDragEnd(this.manipulating),this.manipulating=null,this.update()}}}class xae extends yae{constructor(e,n,r){super(e),this.camera=n,this.domElement=r;const i=new Z4,o=new xt;function a(s){const l=r.getBoundingClientRect();o.x=(s.clientX-l.left)/l.width*2-1,o.y=-((s.clientY-l.top)/l.height)*2+1}this._mouseDown=s=>{a(s),i.setFromCamera(o,this.camera),this.moveRay(i.ray),this.setGrabbed(!0)},this._mouseMove=s=>{a(s),i.setFromCamera(o,this.camera),this.moveRay(i.ray)},this._mouseUp=s=>{a(s),i.setFromCamera(o,this.camera),this.moveRay(i.ray),this.setGrabbed(!1)},r.addEventListener("mousedown",this._mouseDown),r.addEventListener("mousemove",this._mouseMove),r.addEventListener("mouseup",this._mouseUp)}getRevoluteDelta(e,n,r){const{camera:i,initialGrabPoint:o}=this;return ri.copy(e.axis).transformDirection(e.matrixWorld).normalize(),Gu.set(0,0,0).applyMatrix4(e.matrixWorld),Ao.setFromNormalAndCoplanarPoint(ri,Gu),ri.copy(i.position).sub(o).normalize(),Math.abs(ri.dot(Ao.normal))>.3?super.getRevoluteDelta(e,n,r):(ri.set(0,1,0).transformDirection(i.matrixWorld),Ao.projectPoint(n,Rh),Ao.projectPoint(r,Nh),ri.set(0,0,-1).transformDirection(i.matrixWorld),ri.cross(Ao.normal),c2.subVectors(r,n),ri.dot(c2))}dispose(){const{domElement:e}=this;e.removeEventListener("mousedown",this._mouseDown),e.removeEventListener("mousemove",this._mouseMove),e.removeEventListener("mouseup",this._mouseUp)}}class bae extends mae{static get observedAttributes(){return["highlight-color",...super.observedAttributes]}get disableDragging(){return this.hasAttribute("disable-dragging")}set disableDragging(e){e?this.setAttribute("disable-dragging",!!e):this.removeAttribute("disable-dragging")}get highlightColor(){return this.getAttribute("highlight-color")||"#FFFFFF"}set highlightColor(e){e?this.setAttribute("highlight-color",e):this.removeAttribute("highlight-color")}constructor(...e){super(...e),this.highlightMaterial=new Fo({shininess:10,color:this.highlightColor,emissive:this.highlightColor,emissiveIntensity:.25});const n=a=>a.isURDFJoint&&a.jointType!=="fixed",r=(a,s)=>{const l=c=>{if(c.type==="Mesh"&&(s?(c.material=c.__origMaterial,delete c.__origMaterial):(c.__origMaterial=c.material,c.material=this.highlightMaterial)),c===a||!n(c))for(let u=0;u{this.dispatchEvent(new CustomEvent("manipulate-start",{bubbles:!0,cancelable:!0,detail:a.name})),this.controls.enabled=!1,this.redraw()},o.onDragEnd=a=>{this.dispatchEvent(new CustomEvent("manipulate-end",{bubbles:!0,cancelable:!0,detail:a.name})),this.controls.enabled=!0,this.redraw()},o.updateJoint=(a,s)=>{this.setJointValue(a.name,s)},o.onHover=a=>{r(a,!1),this.dispatchEvent(new CustomEvent("joint-mouseover",{bubbles:!0,cancelable:!0,detail:a.name})),this.redraw()},o.onUnhover=a=>{r(a,!0),this.dispatchEvent(new CustomEvent("joint-mouseout",{bubbles:!0,cancelable:!0,detail:a.name})),this.redraw()},this.dragControls=o}disconnectedCallback(){super.disconnectedCallback(),this.dragControls.dispose()}attributeChangedCallback(e,n,r){switch(super.attributeChangedCallback(e,n,r),e){case"highlight-color":this.highlightMaterial.color.set(this.highlightColor),this.highlightMaterial.emissive.set(this.highlightColor);break}}}const u2=1e3,_ae=3e4,wae=({viewerRef:t,enabled:e=!0,websocketUrl:n})=>{const{wsBaseUrl:r}=Dn(),i=n||`${r}/ws/joint-data`,o=_.useRef(null),a=_.useRef(null),s=_.useRef(u2),l=_.useRef(!1),[c,u]=_.useState(!1),d=_.useCallback(f=>{const p=t.current;!p||typeof p.setJointValue!="function"||Object.entries(f).forEach(([y,v])=>{try{p.setJointValue(y,v)}catch(g){console.warn(`Failed to set joint ${y}:`,g)}})},[t]);return _.useEffect(()=>{if(!e)return;l.current=!1;const f=()=>{if(l.current)return;let y;try{y=new WebSocket(i)}catch(v){console.error("Failed to create WebSocket:",v),p();return}o.current=y,y.onopen=()=>{u(!0),s.current=u2,a.current&&(clearTimeout(a.current),a.current=null)},y.onmessage=v=>{try{const g=JSON.parse(v.data);g.type==="joint_update"&&g.joints&&d(g.joints)}catch(g){console.error("Error parsing WebSocket message:",g)}},y.onclose=v=>{u(!1),o.current=null,!l.current&&v.code!==1e3&&p()},y.onerror=()=>{u(!1)}},p=()=>{if(a.current)return;const y=s.current;s.current=Math.min(y*2,_ae),a.current=setTimeout(()=>{a.current=null,f()},y)};return f(),()=>{l.current=!0,a.current&&(clearTimeout(a.current),a.current=null),o.current&&(o.current.close(1e3),o.current=null),u(!1)}},[e,i,d]),{isConnected:c}};var d2=["light","dark"],Sae="(prefers-color-scheme: dark)";_.createContext(void 0);_.memo(({forcedTheme:t,storageKey:e,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:o,value:a,attrs:s,nonce:l})=>{let c=o==="system",u=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${s.map(y=>`'${y}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,d=i?d2.includes(o)&&o?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${o}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",f=(y,v=!1,g=!0)=>{let m=a?a[y]:y,x=v?y+"|| ''":`'${m}'`,b="";return i&&g&&!v&&d2.includes(y)&&(b+=`d.style.colorScheme = '${y}';`),n==="class"?v||m?b+=`c.add(${x})`:b+="null":m&&(b+=`d[s](n,${x})`),b},p=t?`!function(){${u}${f(t)}}()`:r?`!function(){try{${u}var e=localStorage.getItem('${e}');if('system'===e||(!e&&${c})){var t='${Sae}',m=window.matchMedia(t);if(m.media!==t||m.matches){${f("dark")}}else{${f("light")}}}else if(e){${a?`var x=${JSON.stringify(a)};`:""}${f(a?"x[e]":"e",!0)}}${c?"":"else{"+f(o,!1,!1)+"}"}${d}}catch(e){}}()`:`!function(){try{${u}var e=localStorage.getItem('${e}');if(e){${a?`var x=${JSON.stringify(a)};`:""}${f(a?"x[e]":"e",!0)}}else{${f(o,!1,!1)};}${d}}catch(t){}}();`;return _.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:p}})});function f2(t,e){if(e===TQ)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),t;if(e===h1||e===O4){let n=t.getIndex();if(n===null){const a=[],s=t.getAttribute("position");if(s!==void 0){for(let l=0;l=2.0 are supported."));return}const c=new rse(o,{path:n||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u=0&&s[d]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+d+'".')}}c.setExtensions(a),c.setPlugins(s),c.parse(r,i)}parseAsync(e,n){const r=this;return new Promise(function(i,o){r.parse(e,n,i,o)})}}function Tae(){let t={};return{get:function(e){return t[e]},add:function(e,n){t[e]=n},remove:function(e){delete t[e]},removeAll:function(){t={}}}}const Lt={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class Mae{constructor(e){this.parser=e,this.name=Lt.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,n=this.parser.json.nodes||[];for(let r=0,i=n.length;r=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return n.loadTextureImage(e,o.source,a)}}class Bae{constructor(e){this.parser=e,this.name=Lt.EXT_TEXTURE_WEBP}loadTexture(e){const n=this.name,r=this.parser,i=r.json,o=i.textures[e];if(!o.extensions||!o.extensions[n])return null;const a=o.extensions[n],s=i.images[a.source];let l=r.textureLoader;if(s.uri){const c=r.options.manager.getHandler(s.uri);c!==null&&(l=c)}return r.loadTextureImage(e,a.source,l)}}class $ae{constructor(e){this.parser=e,this.name=Lt.EXT_TEXTURE_AVIF}loadTexture(e){const n=this.name,r=this.parser,i=r.json,o=i.textures[e];if(!o.extensions||!o.extensions[n])return null;const a=o.extensions[n],s=i.images[a.source];let l=r.textureLoader;if(s.uri){const c=r.options.manager.getHandler(s.uri);c!==null&&(l=c)}return r.loadTextureImage(e,a.source,l)}}class zae{constructor(e){this.name=Lt.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const n=this.parser.json,r=n.bufferViews[e];if(r.extensions&&r.extensions[this.name]){const i=r.extensions[this.name],o=this.parser.getDependency("buffer",i.buffer),a=this.parser.options.meshoptDecoder;if(!a||!a.supported){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return o.then(function(s){const l=i.byteOffset||0,c=i.byteLength||0,u=i.count,d=i.byteStride,f=new Uint8Array(s,l,c);return a.decodeGltfBufferAsync?a.decodeGltfBufferAsync(u,d,f,i.mode,i.filter).then(function(p){return p.buffer}):a.ready.then(function(){const p=new ArrayBuffer(u*d);return a.decodeGltfBuffer(new Uint8Array(p),u,d,f,i.mode,i.filter),p})})}else return null}}class Hae{constructor(e){this.name=Lt.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const n=this.parser.json,r=n.nodes[e];if(!r.extensions||!r.extensions[this.name]||r.mesh===void 0)return null;const i=n.meshes[r.mesh];for(const c of i.primitives)if(c.mode!==Vi.TRIANGLES&&c.mode!==Vi.TRIANGLE_STRIP&&c.mode!==Vi.TRIANGLE_FAN&&c.mode!==void 0)return null;const a=r.extensions[this.name].attributes,s=[],l={};for(const c in a)s.push(this.parser.getDependency("accessor",a[c]).then(u=>(l[c]=u,l[c])));return s.length<1?null:(s.push(this.parser.createNodeMesh(e)),Promise.all(s).then(c=>{const u=c.pop(),d=u.isGroup?u.children:[u],f=c[0].count,p=[];for(const y of d){const v=new gt,g=new ne,m=new Ii,x=new ne(1,1,1),b=new Ree(y.geometry,y.material,f);for(let S=0;S0||t.search(/^data\:image\/jpeg/)===0?"image/jpeg":t.search(/\.webp($|\?)/i)>0||t.search(/^data\:image\/webp/)===0?"image/webp":t.search(/\.ktx2($|\?)/i)>0||t.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const nse=new gt;class rse{constructor(e={},n={}){this.json=e,this.extensions={},this.plugins={},this.options=n,this.cache=new Tae,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let r=!1,i=-1,o=!1,a=-1;if(typeof navigator<"u"){const s=navigator.userAgent;r=/^((?!chrome|android).)*safari/i.test(s)===!0;const l=s.match(/Version\/(\d+)/);i=r&&l?parseInt(l[1],10):-1,o=s.indexOf("Firefox")>-1,a=o?s.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||r&&i<17||o&&a<98?this.textureLoader=new aC(this.options.manager):this.textureLoader=new Qee(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Mf(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,n){const r=this,i=this.json,o=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(a){return a._markDefs&&a._markDefs()}),Promise.all(this._invokeAll(function(a){return a.beforeRoot&&a.beforeRoot()})).then(function(){return Promise.all([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])}).then(function(a){const s={scene:a[0][i.scene||0],scenes:a[0],animations:a[1],cameras:a[2],asset:i.asset,parser:r,userData:{}};return Fl(o,s,i),Fa(s,i),Promise.all(r._invokeAll(function(l){return l.afterRoot&&l.afterRoot(s)})).then(function(){for(const l of s.scenes)l.updateMatrixWorld();e(s)})}).catch(n)}_markDefs(){const e=this.json.nodes||[],n=this.json.skins||[],r=this.json.meshes||[];for(let i=0,o=n.length;i{const l=this.associations.get(a);l!=null&&this.associations.set(s,l);for(const[c,u]of a.children.entries())o(u,s.children[c])};return o(r,i),i.name+="_instance_"+e.uses[n]++,i}_invokeOne(e){const n=Object.values(this.plugins);n.push(this);for(let r=0;r=2&&g.setY(M,E[T*l+1]),l>=3&&g.setZ(M,E[T*l+2]),l>=4&&g.setW(M,E[T*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}g.normalized=y}return g})}loadTexture(e){const n=this.json,r=this.options,o=n.textures[e].source,a=n.images[o];let s=this.textureLoader;if(a.uri){const l=r.manager.getHandler(a.uri);l!==null&&(s=l)}return this.loadTextureImage(e,o,s)}loadTextureImage(e,n,r){const i=this,o=this.json,a=o.textures[e],s=o.images[n],l=(s.uri||s.bufferView)+":"+a.sampler;if(this.textureCache[l])return this.textureCache[l];const c=this.loadImageSource(n,r).then(function(u){u.flipY=!1,u.name=a.name||s.name||"",u.name===""&&typeof s.uri=="string"&&s.uri.startsWith("data:image/")===!1&&(u.name=s.uri);const f=(o.samplers||{})[a.sampler]||{};return u.magFilter=p2[f.magFilter]||Or,u.minFilter=p2[f.minFilter]||Oo,u.wrapS=m2[f.wrapS]||ca,u.wrapT=m2[f.wrapT]||ca,u.generateMipmaps=!u.isCompressedTexture&&u.minFilter!==Xr&&u.minFilter!==Or,i.associations.set(u,{textures:e}),u}).catch(function(){return null});return this.textureCache[l]=c,c}loadImageSource(e,n){const r=this,i=this.json,o=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(d=>d.clone());const a=i.images[e],s=self.URL||self.webkitURL;let l=a.uri||"",c=!1;if(a.bufferView!==void 0)l=r.getDependency("bufferView",a.bufferView).then(function(d){c=!0;const f=new Blob([d],{type:a.mimeType});return l=s.createObjectURL(f),l});else if(a.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const u=Promise.resolve(l).then(function(d){return new Promise(function(f,p){let y=f;n.isImageBitmapLoader===!0&&(y=function(v){const g=new lr(v);g.needsUpdate=!0,f(g)}),n.load(mc.resolveURL(d,o.path),y,void 0,p)})}).then(function(d){return c===!0&&s.revokeObjectURL(l),Fa(d,a),d.userData.mimeType=a.mimeType||tse(a.uri),d}).catch(function(d){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),d});return this.sourceCache[e]=u,u}assignTexture(e,n,r,i){const o=this;return this.getDependency("texture",r.index).then(function(a){if(!a)return null;if(r.texCoord!==void 0&&r.texCoord>0&&(a=a.clone(),a.channel=r.texCoord),o.extensions[Lt.KHR_TEXTURE_TRANSFORM]){const s=r.extensions!==void 0?r.extensions[Lt.KHR_TEXTURE_TRANSFORM]:void 0;if(s){const l=o.associations.get(a);a=o.extensions[Lt.KHR_TEXTURE_TRANSFORM].extendTexture(a,s),o.associations.set(a,l)}}return i!==void 0&&(a.colorSpace=i),e[n]=a,a})}assignFinalMaterial(e){const n=e.geometry;let r=e.material;const i=n.attributes.tangent===void 0,o=n.attributes.color!==void 0,a=n.attributes.normal===void 0;if(e.isPoints){const s="PointsMaterial:"+r.uuid;let l=this.cache.get(s);l||(l=new Hu,qr.prototype.copy.call(l,r),l.color.copy(r.color),l.map=r.map,l.sizeAttenuation=!1,this.cache.add(s,l)),r=l}else if(e.isLine){const s="LineBasicMaterial:"+r.uuid;let l=this.cache.get(s);l||(l=new pc,qr.prototype.copy.call(l,r),l.color.copy(r.color),l.map=r.map,this.cache.add(s,l)),r=l}if(i||o||a){let s="ClonedMaterial:"+r.uuid+":";i&&(s+="derivative-tangents:"),o&&(s+="vertex-colors:"),a&&(s+="flat-shading:");let l=this.cache.get(s);l||(l=r.clone(),o&&(l.vertexColors=!0),a&&(l.flatShading=!0),i&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(s,l),this.associations.set(l,this.associations.get(r))),r=l}e.material=r}getMaterialType(){return oC}loadMaterial(e){const n=this,r=this.json,i=this.extensions,o=r.materials[e];let a;const s={},l=o.extensions||{},c=[];if(l[Lt.KHR_MATERIALS_UNLIT]){const d=i[Lt.KHR_MATERIALS_UNLIT];a=d.getMaterialType(),c.push(d.extendParams(s,o,n))}else{const d=o.pbrMetallicRoughness||{};if(s.color=new ft(1,1,1),s.opacity=1,Array.isArray(d.baseColorFactor)){const f=d.baseColorFactor;s.color.setRGB(f[0],f[1],f[2],Kr),s.opacity=f[3]}d.baseColorTexture!==void 0&&c.push(n.assignTexture(s,"map",d.baseColorTexture,Zt)),s.metalness=d.metallicFactor!==void 0?d.metallicFactor:1,s.roughness=d.roughnessFactor!==void 0?d.roughnessFactor:1,d.metallicRoughnessTexture!==void 0&&(c.push(n.assignTexture(s,"metalnessMap",d.metallicRoughnessTexture)),c.push(n.assignTexture(s,"roughnessMap",d.metallicRoughnessTexture))),a=this._invokeOne(function(f){return f.getMaterialType&&f.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(f){return f.extendMaterialParams&&f.extendMaterialParams(e,s)})))}o.doubleSided===!0&&(s.side=Ki);const u=o.alphaMode||Nw.OPAQUE;if(u===Nw.BLEND?(s.transparent=!0,s.depthWrite=!1):(s.transparent=!1,u===Nw.MASK&&(s.alphaTest=o.alphaCutoff!==void 0?o.alphaCutoff:.5)),o.normalTexture!==void 0&&a!==ua&&(c.push(n.assignTexture(s,"normalMap",o.normalTexture)),s.normalScale=new xt(1,1),o.normalTexture.scale!==void 0)){const d=o.normalTexture.scale;s.normalScale.set(d,d)}if(o.occlusionTexture!==void 0&&a!==ua&&(c.push(n.assignTexture(s,"aoMap",o.occlusionTexture)),o.occlusionTexture.strength!==void 0&&(s.aoMapIntensity=o.occlusionTexture.strength)),o.emissiveFactor!==void 0&&a!==ua){const d=o.emissiveFactor;s.emissive=new ft().setRGB(d[0],d[1],d[2],Kr)}return o.emissiveTexture!==void 0&&a!==ua&&c.push(n.assignTexture(s,"emissiveMap",o.emissiveTexture,Zt)),Promise.all(c).then(function(){const d=new a(s);return o.name&&(d.name=o.name),Fa(d,o),n.associations.set(d,{materials:e}),o.extensions&&Fl(i,d,o),d})}createUniqueName(e){const n=nn.sanitizeNodeName(e||"");return n in this.nodeNamesUsed?n+"_"+ ++this.nodeNamesUsed[n]:(this.nodeNamesUsed[n]=0,n)}loadGeometries(e){const n=this,r=this.extensions,i=this.primitiveCache;function o(s){return r[Lt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(s,n).then(function(l){return g2(l,s,n)})}const a=[];for(let s=0,l=e.length;s0&&Qae(m,o),m.name=n.createUniqueName(o.name||"mesh_"+e),Fa(m,o),g.extensions&&Fl(i,m,g),n.assignFinalMaterial(m),d.push(m)}for(let p=0,y=d.length;p1?u=new da:c.length===1?u=c[0]:u=new vn,u!==c[0])for(let d=0,f=c.length;d1){const d=i.associations.get(u);i.associations.set(u,{...d})}return i.associations.get(u).nodes=e,u}),this.nodeCache[e]}loadScene(e){const n=this.extensions,r=this.json.scenes[e],i=this,o=new da;r.name&&(o.name=i.createUniqueName(r.name)),Fa(o,r),r.extensions&&Fl(n,o,r);const a=r.nodes||[],s=[];for(let l=0,c=a.length;l{const d=new Map;for(const[f,p]of i.associations)(f instanceof qr||f instanceof lr)&&d.set(f,p);return u.traverse(f=>{const p=i.associations.get(f);p!=null&&d.set(f,p)}),d};return i.associations=c(o),o})}_createAnimationTracks(e,n,r,i,o){const a=[],s=e.name?e.name:e.uuid,l=[];Ms[o.path]===Ms.weights?e.traverse(function(f){f.morphTargetInfluences&&l.push(f.name?f.name:f.uuid)}):l.push(s);let c;switch(Ms[o.path]){case Ms.weights:c=zd;break;case Ms.rotation:c=Ic;break;case Ms.translation:case Ms.scale:c=pl;break;default:switch(r.itemSize){case 1:c=zd;break;case 2:case 3:default:c=pl;break}break}const u=i.interpolation!==void 0?Yae[i.interpolation]:Pp,d=this._getArrayFromAccessor(r);for(let f=0,p=l.length;f0?o[o.length-1]:"",smooth:a!==void 0?a.smooth:this.smooth,groupStart:a!==void 0?a.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(l){const c={index:typeof l=="number"?l:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return c.clone=this.clone.bind(c),c}};return this.materials.push(s),s},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(i){const o=this.currentMaterial();if(o&&o.groupEnd===-1&&(o.groupEnd=this.geometry.vertices.length/3,o.groupCount=o.groupEnd-o.groupStart,o.inherited=!1),i&&this.materials.length>1)for(let a=this.materials.length-1;a>=0;a--)this.materials[a].groupCount<=0&&this.materials.splice(a,1);return i&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),o}},r&&r.name&&typeof r.clone=="function"){const i=r.clone(0);i.inherited=!0,this.object.materials.push(i)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(e,n){const r=parseInt(e,10);return(r>=0?r-1:r+n/3)*3},parseNormalIndex:function(e,n){const r=parseInt(e,10);return(r>=0?r-1:r+n/3)*3},parseUVIndex:function(e,n){const r=parseInt(e,10);return(r>=0?r-1:r+n/2)*2},addVertex:function(e,n,r){const i=this.vertices,o=this.object.geometry.vertices;o.push(i[e+0],i[e+1],i[e+2]),o.push(i[n+0],i[n+1],i[n+2]),o.push(i[r+0],i[r+1],i[r+2])},addVertexPoint:function(e){const n=this.vertices;this.object.geometry.vertices.push(n[e+0],n[e+1],n[e+2])},addVertexLine:function(e){const n=this.vertices;this.object.geometry.vertices.push(n[e+0],n[e+1],n[e+2])},addNormal:function(e,n,r){const i=this.normals,o=this.object.geometry.normals;o.push(i[e+0],i[e+1],i[e+2]),o.push(i[n+0],i[n+1],i[n+2]),o.push(i[r+0],i[r+1],i[r+2])},addFaceNormal:function(e,n,r){const i=this.vertices,o=this.object.geometry.normals;y2.fromArray(i,e),Iw.fromArray(i,n),x2.fromArray(i,r),Bi.subVectors(x2,Iw),b2.subVectors(y2,Iw),Bi.cross(b2),Bi.normalize(),o.push(Bi.x,Bi.y,Bi.z),o.push(Bi.x,Bi.y,Bi.z),o.push(Bi.x,Bi.y,Bi.z)},addColor:function(e,n,r){const i=this.colors,o=this.object.geometry.colors;i[e]!==void 0&&o.push(i[e+0],i[e+1],i[e+2]),i[n]!==void 0&&o.push(i[n+0],i[n+1],i[n+2]),i[r]!==void 0&&o.push(i[r+0],i[r+1],i[r+2])},addUV:function(e,n,r){const i=this.uvs,o=this.object.geometry.uvs;o.push(i[e+0],i[e+1]),o.push(i[n+0],i[n+1]),o.push(i[r+0],i[r+1])},addDefaultUV:function(){const e=this.object.geometry.uvs;e.push(0,0),e.push(0,0),e.push(0,0)},addUVLine:function(e){const n=this.uvs;this.object.geometry.uvs.push(n[e+0],n[e+1])},addFace:function(e,n,r,i,o,a,s,l,c){const u=this.vertices.length;let d=this.parseVertexIndex(e,u),f=this.parseVertexIndex(n,u),p=this.parseVertexIndex(r,u);if(this.addVertex(d,f,p),this.addColor(d,f,p),s!==void 0&&s!==""){const y=this.normals.length;d=this.parseNormalIndex(s,y),f=this.parseNormalIndex(l,y),p=this.parseNormalIndex(c,y),this.addNormal(d,f,p)}else this.addFaceNormal(d,f,p);if(i!==void 0&&i!==""){const y=this.uvs.length;d=this.parseUVIndex(i,y),f=this.parseUVIndex(o,y),p=this.parseUVIndex(a,y),this.addUV(d,f,p),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(e){this.object.geometry.type="Points";const n=this.vertices.length;for(let r=0,i=e.length;rthis.updateSize())}disconnectedCallback(){cancelAnimationFrame(this._renderLoopId)}attributeChangedCallback(e,n,r){switch(this._updateCollisionVisibility(),this.noAutoRecenter||this.recenter(),e){case"package":case"urdf":{this._scheduleLoad();break}case"up":{this._setUp(this.up);break}case"ambient-color":{this.ambientLight.color.set(this.ambientColor),this.ambientLight.groundColor.set("#000").lerp(this.ambientLight.color,.5);break}case"ignore-limits":{this._setIgnoreLimits(this.ignoreLimits,!0);break}}}updateSize(){const e=this.renderer,n=this.clientWidth,r=this.clientHeight,i=e.getSize(mae);(i.width!==n||i.height!==r)&&this.recenter(),e.setPixelRatio(window.devicePixelRatio),e.setSize(n,r,!1),this.camera.aspect=n/r,this.camera.updateProjectionMatrix()}redraw(){this._dirty=!0}recenter(){this._updateEnvironment(),this.redraw()}setJointValue(e,...n){this.robot&&this.robot.joints[e]&&this.robot.joints[e].setJointValue(...n)&&(this.redraw(),this.dispatchEvent(new CustomEvent("angle-change",{bubbles:!0,cancelable:!0,detail:e})))}setJointValues(e){for(const n in e)this.setJointValue(n,e[n])}_updateEnvironment(){const e=this.robot;if(!e)return;this.world.updateMatrixWorld();const n=new Xo;n.makeEmpty(),e.traverse(o=>{o.isURDFVisual&&n.expandByObject(o)});const r=n.getCenter(new ne);this.controls.target.y=r.y,this.plane.position.y=n.min.y-.001;const i=this.directionalLight;if(i.castShadow=this.displayShadow,this.displayShadow){const a=n.getBoundingSphere(new qo).radius,s=i.shadow.camera;s.left=s.bottom=-a,s.right=s.top=a;const l=i.position.clone().sub(i.target.position);i.target.position.copy(r),i.position.copy(r).add(l),s.updateProjectionMatrix()}}_scheduleLoad(){this._prevload!==`${this.package}|${this.urdf}`&&(this._prevload=`${this.package}|${this.urdf}`,!this._loadScheduled&&(this._loadScheduled=!0,this.robot&&(this.robot.traverse(e=>e.dispose&&e.dispose()),this.robot.parent.remove(this.robot),this.robot=null),requestAnimationFrame(()=>{this._loadUrdf(this.package,this.urdf),this._loadScheduled=!1})))}_loadUrdf(e,n){if(this.dispatchEvent(new CustomEvent("urdf-change",{bubbles:!0,cancelable:!0,composed:!0})),n){this._requestId++;const r=this._requestId,i=l=>{l.traverse(c=>{if(c.isMesh&&(c.castShadow=!0,c.receiveShadow=!0,c.material)){const u=(Array.isArray(c.material)?c.material:[c.material]).map(d=>(d instanceof ua&&(d=new Bo),d.map&&(d.map.colorSpace=Zt),d));c.material=u.length===1?u[0]:u}})};e.includes(":")&&e.split(":")[1].substring(0,2)!=="//"&&(e=e.split(",").reduce((l,c)=>{const u=c.split(/:/).filter(p=>!!p),d=u.shift().trim(),f=u.join(":").trim();return l[d]=f,l},{}));let o=null;const a=new K4;a.onLoad=()=>{if(this._requestId!==r){o.traverse(l=>l.dispose&&l.dispose());return}this.robot=o,this.world.add(o),i(o),this._setIgnoreLimits(this.ignoreLimits),this._updateCollisionVisibility(),this.dispatchEvent(new CustomEvent("urdf-processed",{bubbles:!0,cancelable:!0,composed:!0})),this.dispatchEvent(new CustomEvent("geometry-loaded",{bubbles:!0,cancelable:!0,composed:!0})),this.recenter()},this.urlModifierFunc&&a.setURLModifier(this.urlModifierFunc);const s=new pae(a);s.packages=e,s.loadMeshCb=this.loadMeshFunc,s.fetchOptions={mode:"cors",credentials:"same-origin"},s.parseCollision=!0,s.load(n,l=>o=l)}}_updateCollisionVisibility(){const e=this.showCollision,n=this._collisionMaterial,r=this.robot;if(r===null)return;const i=[];r.traverse(o=>{o.isURDFCollider&&(o.visible=e,i.push(o))}),i.forEach(o=>{o.traverse(a=>{a.isMesh&&(a.raycast=gae,a.material=n,a.castShadow=!1)})})}_setUp(e){e||(e="+Z"),e=e.toUpperCase();const n=e.replace(/[^-+]/g,"")[0]||"+",r=e.replace(/[^XYZ]/gi,"")[0]||"Z",i=Math.PI,o=i/2;r==="X"&&this.world.rotation.set(0,0,n==="+"?o:-o),r==="Z"&&this.world.rotation.set(n==="+"?-o:o,0,0),r==="Y"&&this.world.rotation.set(n==="+"?0:i,0,0)}_setIgnoreLimits(e,n=!1){this.robot&&Object.values(this.robot.joints).forEach(r=>{r.ignoreLimits=e,r.setJointValue(...r.jointValue)}),n&&this.dispatchEvent(new CustomEvent("ignore-limits-change",{bubbles:!0,cancelable:!0,composed:!0}))}}function yae(t){return t.isURDFJoint&&t.jointType!=="fixed"}function xae(t){let e=t;for(;e;){if(yae(e))return e;e=e.parent}return e}const Cw=new ne,Pw=new ne,Gu=new ne,ri=new ne,u2=new ne,Rh=new ne,Nh=new ne,Co=new $a;class bae{constructor(e){this.enabled=!0,this.scene=e,this.raycaster=new e$,this.initialGrabPoint=new ne,this.hitDistance=-1,this.hovered=null,this.manipulating=null}update(){const{raycaster:e,hovered:n,manipulating:r,scene:i}=this;if(r)return;let o=null;const a=e.intersectObject(i,!0);if(a.length!==0){const s=a[0];this.hitDistance=s.distance,o=xae(s.object),this.initialGrabPoint.copy(s.point)}o!==n&&(n&&this.onUnhover(n),this.hovered=o,o&&this.onHover(o))}updateJoint(e,n){e.setJointValue(n)}onDragStart(e){}onDragEnd(e){}onHover(e){}onUnhover(e){}getRevoluteDelta(e,n,r){return ri.copy(e.axis).transformDirection(e.matrixWorld).normalize(),Gu.set(0,0,0).applyMatrix4(e.matrixWorld),Co.setFromNormalAndCoplanarPoint(ri,Gu),Co.projectPoint(n,Rh),Co.projectPoint(r,Nh),Rh.sub(Gu),Nh.sub(Gu),ri.crossVectors(Rh,Nh),Math.sign(ri.dot(Co.normal))*Nh.angleTo(Rh)}getPrismaticDelta(e,n,r){return ri.subVectors(r,n),Co.normal.copy(e.axis).transformDirection(e.parent.matrixWorld).normalize(),ri.dot(Co.normal)}moveRay(e){const{raycaster:n,hitDistance:r,manipulating:i}=this,{ray:o}=n;if(i){o.at(r,Cw),e.at(r,Pw);let a=0;i.jointType==="revolute"||i.jointType==="continuous"?a=this.getRevoluteDelta(i,Cw,Pw):i.jointType==="prismatic"&&(a=this.getPrismaticDelta(i,Cw,Pw)),a&&this.updateJoint(i,i.angle+a)}this.raycaster.ray.copy(e),this.update()}setGrabbed(e){const{hovered:n,manipulating:r}=this;if(e){if(r!==null||n===null)return;this.manipulating=n,this.onDragStart(n)}else{if(this.manipulating===null)return;this.onDragEnd(this.manipulating),this.manipulating=null,this.update()}}}class _ae extends bae{constructor(e,n,r){super(e),this.camera=n,this.domElement=r;const i=new e$,o=new xt;function a(s){const l=r.getBoundingClientRect();o.x=(s.clientX-l.left)/l.width*2-1,o.y=-((s.clientY-l.top)/l.height)*2+1}this._mouseDown=s=>{a(s),i.setFromCamera(o,this.camera),this.moveRay(i.ray),this.setGrabbed(!0)},this._mouseMove=s=>{a(s),i.setFromCamera(o,this.camera),this.moveRay(i.ray)},this._mouseUp=s=>{a(s),i.setFromCamera(o,this.camera),this.moveRay(i.ray),this.setGrabbed(!1)},r.addEventListener("mousedown",this._mouseDown),r.addEventListener("mousemove",this._mouseMove),r.addEventListener("mouseup",this._mouseUp)}getRevoluteDelta(e,n,r){const{camera:i,initialGrabPoint:o}=this;return ri.copy(e.axis).transformDirection(e.matrixWorld).normalize(),Gu.set(0,0,0).applyMatrix4(e.matrixWorld),Co.setFromNormalAndCoplanarPoint(ri,Gu),ri.copy(i.position).sub(o).normalize(),Math.abs(ri.dot(Co.normal))>.3?super.getRevoluteDelta(e,n,r):(ri.set(0,1,0).transformDirection(i.matrixWorld),Co.projectPoint(n,Rh),Co.projectPoint(r,Nh),ri.set(0,0,-1).transformDirection(i.matrixWorld),ri.cross(Co.normal),u2.subVectors(r,n),ri.dot(u2))}dispose(){const{domElement:e}=this;e.removeEventListener("mousedown",this._mouseDown),e.removeEventListener("mousemove",this._mouseMove),e.removeEventListener("mouseup",this._mouseUp)}}class wae extends vae{static get observedAttributes(){return["highlight-color",...super.observedAttributes]}get disableDragging(){return this.hasAttribute("disable-dragging")}set disableDragging(e){e?this.setAttribute("disable-dragging",!!e):this.removeAttribute("disable-dragging")}get highlightColor(){return this.getAttribute("highlight-color")||"#FFFFFF"}set highlightColor(e){e?this.setAttribute("highlight-color",e):this.removeAttribute("highlight-color")}constructor(...e){super(...e),this.highlightMaterial=new Bo({shininess:10,color:this.highlightColor,emissive:this.highlightColor,emissiveIntensity:.25});const n=a=>a.isURDFJoint&&a.jointType!=="fixed",r=(a,s)=>{const l=c=>{if(c.type==="Mesh"&&(s?(c.material=c.__origMaterial,delete c.__origMaterial):(c.__origMaterial=c.material,c.material=this.highlightMaterial)),c===a||!n(c))for(let u=0;u{this.dispatchEvent(new CustomEvent("manipulate-start",{bubbles:!0,cancelable:!0,detail:a.name})),this.controls.enabled=!1,this.redraw()},o.onDragEnd=a=>{this.dispatchEvent(new CustomEvent("manipulate-end",{bubbles:!0,cancelable:!0,detail:a.name})),this.controls.enabled=!0,this.redraw()},o.updateJoint=(a,s)=>{this.setJointValue(a.name,s)},o.onHover=a=>{r(a,!1),this.dispatchEvent(new CustomEvent("joint-mouseover",{bubbles:!0,cancelable:!0,detail:a.name})),this.redraw()},o.onUnhover=a=>{r(a,!0),this.dispatchEvent(new CustomEvent("joint-mouseout",{bubbles:!0,cancelable:!0,detail:a.name})),this.redraw()},this.dragControls=o}disconnectedCallback(){super.disconnectedCallback(),this.dragControls.dispose()}attributeChangedCallback(e,n,r){switch(super.attributeChangedCallback(e,n,r),e){case"highlight-color":this.highlightMaterial.color.set(this.highlightColor),this.highlightMaterial.emissive.set(this.highlightColor);break}}}const d2=1e3,Sae=3e4,Eae=({viewerRef:t,enabled:e=!0,websocketUrl:n})=>{const{wsBaseUrl:r}=Dn(),i=n||`${r}/ws/joint-data`,o=_.useRef(null),a=_.useRef(null),s=_.useRef(d2),l=_.useRef(!1),[c,u]=_.useState(!1),d=_.useCallback(f=>{const p=t.current;!p||typeof p.setJointValue!="function"||Object.entries(f).forEach(([y,v])=>{try{p.setJointValue(y,v)}catch(g){console.warn(`Failed to set joint ${y}:`,g)}})},[t]);return _.useEffect(()=>{if(!e)return;l.current=!1;const f=()=>{if(l.current)return;let y;try{y=new WebSocket(i)}catch(v){console.error("Failed to create WebSocket:",v),p();return}o.current=y,y.onopen=()=>{u(!0),s.current=d2,a.current&&(clearTimeout(a.current),a.current=null)},y.onmessage=v=>{try{const g=JSON.parse(v.data);g.type==="joint_update"&&g.joints&&d(g.joints)}catch(g){console.error("Error parsing WebSocket message:",g)}},y.onclose=v=>{u(!1),o.current=null,!l.current&&v.code!==1e3&&p()},y.onerror=()=>{u(!1)}},p=()=>{if(a.current)return;const y=s.current;s.current=Math.min(y*2,Sae),a.current=setTimeout(()=>{a.current=null,f()},y)};return f(),()=>{l.current=!0,a.current&&(clearTimeout(a.current),a.current=null),o.current&&(o.current.close(1e3),o.current=null),u(!1)}},[e,i,d]),{isConnected:c}};var f2=["light","dark"],Tae="(prefers-color-scheme: dark)";_.createContext(void 0);_.memo(({forcedTheme:t,storageKey:e,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:o,value:a,attrs:s,nonce:l})=>{let c=o==="system",u=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${s.map(y=>`'${y}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,d=i?f2.includes(o)&&o?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${o}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",f=(y,v=!1,g=!0)=>{let m=a?a[y]:y,x=v?y+"|| ''":`'${m}'`,b="";return i&&g&&!v&&f2.includes(y)&&(b+=`d.style.colorScheme = '${y}';`),n==="class"?v||m?b+=`c.add(${x})`:b+="null":m&&(b+=`d[s](n,${x})`),b},p=t?`!function(){${u}${f(t)}}()`:r?`!function(){try{${u}var e=localStorage.getItem('${e}');if('system'===e||(!e&&${c})){var t='${Tae}',m=window.matchMedia(t);if(m.media!==t||m.matches){${f("dark")}}else{${f("light")}}}else if(e){${a?`var x=${JSON.stringify(a)};`:""}${f(a?"x[e]":"e",!0)}}${c?"":"else{"+f(o,!1,!1)+"}"}${d}}catch(e){}}()`:`!function(){try{${u}var e=localStorage.getItem('${e}');if(e){${a?`var x=${JSON.stringify(a)};`:""}${f(a?"x[e]":"e",!0)}}else{${f(o,!1,!1)};}${d}}catch(t){}}();`;return _.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:p}})});function h2(t,e){if(e===AQ)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),t;if(e===h1||e===D4){let n=t.getIndex();if(n===null){const a=[],s=t.getAttribute("position");if(s!==void 0){for(let l=0;l=2.0 are supported."));return}const c=new ose(o,{path:n||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u=0&&s[d]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+d+'".')}}c.setExtensions(a),c.setPlugins(s),c.parse(r,i)}parseAsync(e,n){const r=this;return new Promise(function(i,o){r.parse(e,n,i,o)})}}function Aae(){let t={};return{get:function(e){return t[e]},add:function(e,n){t[e]=n},remove:function(e){delete t[e]},removeAll:function(){t={}}}}const Lt={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class Cae{constructor(e){this.parser=e,this.name=Lt.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,n=this.parser.json.nodes||[];for(let r=0,i=n.length;r=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return n.loadTextureImage(e,o.source,a)}}class zae{constructor(e){this.parser=e,this.name=Lt.EXT_TEXTURE_WEBP}loadTexture(e){const n=this.name,r=this.parser,i=r.json,o=i.textures[e];if(!o.extensions||!o.extensions[n])return null;const a=o.extensions[n],s=i.images[a.source];let l=r.textureLoader;if(s.uri){const c=r.options.manager.getHandler(s.uri);c!==null&&(l=c)}return r.loadTextureImage(e,a.source,l)}}class Hae{constructor(e){this.parser=e,this.name=Lt.EXT_TEXTURE_AVIF}loadTexture(e){const n=this.name,r=this.parser,i=r.json,o=i.textures[e];if(!o.extensions||!o.extensions[n])return null;const a=o.extensions[n],s=i.images[a.source];let l=r.textureLoader;if(s.uri){const c=r.options.manager.getHandler(s.uri);c!==null&&(l=c)}return r.loadTextureImage(e,a.source,l)}}class Vae{constructor(e){this.name=Lt.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const n=this.parser.json,r=n.bufferViews[e];if(r.extensions&&r.extensions[this.name]){const i=r.extensions[this.name],o=this.parser.getDependency("buffer",i.buffer),a=this.parser.options.meshoptDecoder;if(!a||!a.supported){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return o.then(function(s){const l=i.byteOffset||0,c=i.byteLength||0,u=i.count,d=i.byteStride,f=new Uint8Array(s,l,c);return a.decodeGltfBufferAsync?a.decodeGltfBufferAsync(u,d,f,i.mode,i.filter).then(function(p){return p.buffer}):a.ready.then(function(){const p=new ArrayBuffer(u*d);return a.decodeGltfBuffer(new Uint8Array(p),u,d,f,i.mode,i.filter),p})})}else return null}}class Gae{constructor(e){this.name=Lt.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const n=this.parser.json,r=n.nodes[e];if(!r.extensions||!r.extensions[this.name]||r.mesh===void 0)return null;const i=n.meshes[r.mesh];for(const c of i.primitives)if(c.mode!==Vi.TRIANGLES&&c.mode!==Vi.TRIANGLE_STRIP&&c.mode!==Vi.TRIANGLE_FAN&&c.mode!==void 0)return null;const a=r.extensions[this.name].attributes,s=[],l={};for(const c in a)s.push(this.parser.getDependency("accessor",a[c]).then(u=>(l[c]=u,l[c])));return s.length<1?null:(s.push(this.parser.createNodeMesh(e)),Promise.all(s).then(c=>{const u=c.pop(),d=u.isGroup?u.children:[u],f=c[0].count,p=[];for(const y of d){const v=new gt,g=new ne,m=new Ii,x=new ne(1,1,1),b=new Oee(y.geometry,y.material,f);for(let S=0;S0||t.search(/^data\:image\/jpeg/)===0?"image/jpeg":t.search(/\.webp($|\?)/i)>0||t.search(/^data\:image\/webp/)===0?"image/webp":t.search(/\.ktx2($|\?)/i)>0||t.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const ise=new gt;class ose{constructor(e={},n={}){this.json=e,this.extensions={},this.plugins={},this.options=n,this.cache=new Aae,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let r=!1,i=-1,o=!1,a=-1;if(typeof navigator<"u"){const s=navigator.userAgent;r=/^((?!chrome|android).)*safari/i.test(s)===!0;const l=s.match(/Version\/(\d+)/);i=r&&l?parseInt(l[1],10):-1,o=s.indexOf("Firefox")>-1,a=o?s.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||r&&i<17||o&&a<98?this.textureLoader=new sC(this.options.manager):this.textureLoader=new tte(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Mf(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,n){const r=this,i=this.json,o=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(a){return a._markDefs&&a._markDefs()}),Promise.all(this._invokeAll(function(a){return a.beforeRoot&&a.beforeRoot()})).then(function(){return Promise.all([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])}).then(function(a){const s={scene:a[0][i.scene||0],scenes:a[0],animations:a[1],cameras:a[2],asset:i.asset,parser:r,userData:{}};return Fl(o,s,i),Fa(s,i),Promise.all(r._invokeAll(function(l){return l.afterRoot&&l.afterRoot(s)})).then(function(){for(const l of s.scenes)l.updateMatrixWorld();e(s)})}).catch(n)}_markDefs(){const e=this.json.nodes||[],n=this.json.skins||[],r=this.json.meshes||[];for(let i=0,o=n.length;i{const l=this.associations.get(a);l!=null&&this.associations.set(s,l);for(const[c,u]of a.children.entries())o(u,s.children[c])};return o(r,i),i.name+="_instance_"+e.uses[n]++,i}_invokeOne(e){const n=Object.values(this.plugins);n.push(this);for(let r=0;r=2&&g.setY(M,E[T*l+1]),l>=3&&g.setZ(M,E[T*l+2]),l>=4&&g.setW(M,E[T*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}g.normalized=y}return g})}loadTexture(e){const n=this.json,r=this.options,o=n.textures[e].source,a=n.images[o];let s=this.textureLoader;if(a.uri){const l=r.manager.getHandler(a.uri);l!==null&&(s=l)}return this.loadTextureImage(e,o,s)}loadTextureImage(e,n,r){const i=this,o=this.json,a=o.textures[e],s=o.images[n],l=(s.uri||s.bufferView)+":"+a.sampler;if(this.textureCache[l])return this.textureCache[l];const c=this.loadImageSource(n,r).then(function(u){u.flipY=!1,u.name=a.name||s.name||"",u.name===""&&typeof s.uri=="string"&&s.uri.startsWith("data:image/")===!1&&(u.name=s.uri);const f=(o.samplers||{})[a.sampler]||{};return u.magFilter=m2[f.magFilter]||Ir,u.minFilter=m2[f.minFilter]||Io,u.wrapS=g2[f.wrapS]||ca,u.wrapT=g2[f.wrapT]||ca,u.generateMipmaps=!u.isCompressedTexture&&u.minFilter!==Xr&&u.minFilter!==Ir,i.associations.set(u,{textures:e}),u}).catch(function(){return null});return this.textureCache[l]=c,c}loadImageSource(e,n){const r=this,i=this.json,o=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(d=>d.clone());const a=i.images[e],s=self.URL||self.webkitURL;let l=a.uri||"",c=!1;if(a.bufferView!==void 0)l=r.getDependency("bufferView",a.bufferView).then(function(d){c=!0;const f=new Blob([d],{type:a.mimeType});return l=s.createObjectURL(f),l});else if(a.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const u=Promise.resolve(l).then(function(d){return new Promise(function(f,p){let y=f;n.isImageBitmapLoader===!0&&(y=function(v){const g=new lr(v);g.needsUpdate=!0,f(g)}),n.load(mc.resolveURL(d,o.path),y,void 0,p)})}).then(function(d){return c===!0&&s.revokeObjectURL(l),Fa(d,a),d.userData.mimeType=a.mimeType||rse(a.uri),d}).catch(function(d){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),d});return this.sourceCache[e]=u,u}assignTexture(e,n,r,i){const o=this;return this.getDependency("texture",r.index).then(function(a){if(!a)return null;if(r.texCoord!==void 0&&r.texCoord>0&&(a=a.clone(),a.channel=r.texCoord),o.extensions[Lt.KHR_TEXTURE_TRANSFORM]){const s=r.extensions!==void 0?r.extensions[Lt.KHR_TEXTURE_TRANSFORM]:void 0;if(s){const l=o.associations.get(a);a=o.extensions[Lt.KHR_TEXTURE_TRANSFORM].extendTexture(a,s),o.associations.set(a,l)}}return i!==void 0&&(a.colorSpace=i),e[n]=a,a})}assignFinalMaterial(e){const n=e.geometry;let r=e.material;const i=n.attributes.tangent===void 0,o=n.attributes.color!==void 0,a=n.attributes.normal===void 0;if(e.isPoints){const s="PointsMaterial:"+r.uuid;let l=this.cache.get(s);l||(l=new Hu,qr.prototype.copy.call(l,r),l.color.copy(r.color),l.map=r.map,l.sizeAttenuation=!1,this.cache.add(s,l)),r=l}else if(e.isLine){const s="LineBasicMaterial:"+r.uuid;let l=this.cache.get(s);l||(l=new pc,qr.prototype.copy.call(l,r),l.color.copy(r.color),l.map=r.map,this.cache.add(s,l)),r=l}if(i||o||a){let s="ClonedMaterial:"+r.uuid+":";i&&(s+="derivative-tangents:"),o&&(s+="vertex-colors:"),a&&(s+="flat-shading:");let l=this.cache.get(s);l||(l=r.clone(),o&&(l.vertexColors=!0),a&&(l.flatShading=!0),i&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(s,l),this.associations.set(l,this.associations.get(r))),r=l}e.material=r}getMaterialType(){return aC}loadMaterial(e){const n=this,r=this.json,i=this.extensions,o=r.materials[e];let a;const s={},l=o.extensions||{},c=[];if(l[Lt.KHR_MATERIALS_UNLIT]){const d=i[Lt.KHR_MATERIALS_UNLIT];a=d.getMaterialType(),c.push(d.extendParams(s,o,n))}else{const d=o.pbrMetallicRoughness||{};if(s.color=new ft(1,1,1),s.opacity=1,Array.isArray(d.baseColorFactor)){const f=d.baseColorFactor;s.color.setRGB(f[0],f[1],f[2],Kr),s.opacity=f[3]}d.baseColorTexture!==void 0&&c.push(n.assignTexture(s,"map",d.baseColorTexture,Zt)),s.metalness=d.metallicFactor!==void 0?d.metallicFactor:1,s.roughness=d.roughnessFactor!==void 0?d.roughnessFactor:1,d.metallicRoughnessTexture!==void 0&&(c.push(n.assignTexture(s,"metalnessMap",d.metallicRoughnessTexture)),c.push(n.assignTexture(s,"roughnessMap",d.metallicRoughnessTexture))),a=this._invokeOne(function(f){return f.getMaterialType&&f.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(f){return f.extendMaterialParams&&f.extendMaterialParams(e,s)})))}o.doubleSided===!0&&(s.side=Ki);const u=o.alphaMode||Nw.OPAQUE;if(u===Nw.BLEND?(s.transparent=!0,s.depthWrite=!1):(s.transparent=!1,u===Nw.MASK&&(s.alphaTest=o.alphaCutoff!==void 0?o.alphaCutoff:.5)),o.normalTexture!==void 0&&a!==ua&&(c.push(n.assignTexture(s,"normalMap",o.normalTexture)),s.normalScale=new xt(1,1),o.normalTexture.scale!==void 0)){const d=o.normalTexture.scale;s.normalScale.set(d,d)}if(o.occlusionTexture!==void 0&&a!==ua&&(c.push(n.assignTexture(s,"aoMap",o.occlusionTexture)),o.occlusionTexture.strength!==void 0&&(s.aoMapIntensity=o.occlusionTexture.strength)),o.emissiveFactor!==void 0&&a!==ua){const d=o.emissiveFactor;s.emissive=new ft().setRGB(d[0],d[1],d[2],Kr)}return o.emissiveTexture!==void 0&&a!==ua&&c.push(n.assignTexture(s,"emissiveMap",o.emissiveTexture,Zt)),Promise.all(c).then(function(){const d=new a(s);return o.name&&(d.name=o.name),Fa(d,o),n.associations.set(d,{materials:e}),o.extensions&&Fl(i,d,o),d})}createUniqueName(e){const n=nn.sanitizeNodeName(e||"");return n in this.nodeNamesUsed?n+"_"+ ++this.nodeNamesUsed[n]:(this.nodeNamesUsed[n]=0,n)}loadGeometries(e){const n=this,r=this.extensions,i=this.primitiveCache;function o(s){return r[Lt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(s,n).then(function(l){return v2(l,s,n)})}const a=[];for(let s=0,l=e.length;s0&&tse(m,o),m.name=n.createUniqueName(o.name||"mesh_"+e),Fa(m,o),g.extensions&&Fl(i,m,g),n.assignFinalMaterial(m),d.push(m)}for(let p=0,y=d.length;p1?u=new da:c.length===1?u=c[0]:u=new vn,u!==c[0])for(let d=0,f=c.length;d1){const d=i.associations.get(u);i.associations.set(u,{...d})}return i.associations.get(u).nodes=e,u}),this.nodeCache[e]}loadScene(e){const n=this.extensions,r=this.json.scenes[e],i=this,o=new da;r.name&&(o.name=i.createUniqueName(r.name)),Fa(o,r),r.extensions&&Fl(n,o,r);const a=r.nodes||[],s=[];for(let l=0,c=a.length;l{const d=new Map;for(const[f,p]of i.associations)(f instanceof qr||f instanceof lr)&&d.set(f,p);return u.traverse(f=>{const p=i.associations.get(f);p!=null&&d.set(f,p)}),d};return i.associations=c(o),o})}_createAnimationTracks(e,n,r,i,o){const a=[],s=e.name?e.name:e.uuid,l=[];Ms[o.path]===Ms.weights?e.traverse(function(f){f.morphTargetInfluences&&l.push(f.name?f.name:f.uuid)}):l.push(s);let c;switch(Ms[o.path]){case Ms.weights:c=zd;break;case Ms.rotation:c=Ic;break;case Ms.translation:case Ms.scale:c=pl;break;default:switch(r.itemSize){case 1:c=zd;break;case 2:case 3:default:c=pl;break}break}const u=i.interpolation!==void 0?Zae[i.interpolation]:Pp,d=this._getArrayFromAccessor(r);for(let f=0,p=l.length;f0?o[o.length-1]:"",smooth:a!==void 0?a.smooth:this.smooth,groupStart:a!==void 0?a.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(l){const c={index:typeof l=="number"?l:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return c.clone=this.clone.bind(c),c}};return this.materials.push(s),s},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(i){const o=this.currentMaterial();if(o&&o.groupEnd===-1&&(o.groupEnd=this.geometry.vertices.length/3,o.groupCount=o.groupEnd-o.groupStart,o.inherited=!1),i&&this.materials.length>1)for(let a=this.materials.length-1;a>=0;a--)this.materials[a].groupCount<=0&&this.materials.splice(a,1);return i&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),o}},r&&r.name&&typeof r.clone=="function"){const i=r.clone(0);i.inherited=!0,this.object.materials.push(i)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(e,n){const r=parseInt(e,10);return(r>=0?r-1:r+n/3)*3},parseNormalIndex:function(e,n){const r=parseInt(e,10);return(r>=0?r-1:r+n/3)*3},parseUVIndex:function(e,n){const r=parseInt(e,10);return(r>=0?r-1:r+n/2)*2},addVertex:function(e,n,r){const i=this.vertices,o=this.object.geometry.vertices;o.push(i[e+0],i[e+1],i[e+2]),o.push(i[n+0],i[n+1],i[n+2]),o.push(i[r+0],i[r+1],i[r+2])},addVertexPoint:function(e){const n=this.vertices;this.object.geometry.vertices.push(n[e+0],n[e+1],n[e+2])},addVertexLine:function(e){const n=this.vertices;this.object.geometry.vertices.push(n[e+0],n[e+1],n[e+2])},addNormal:function(e,n,r){const i=this.normals,o=this.object.geometry.normals;o.push(i[e+0],i[e+1],i[e+2]),o.push(i[n+0],i[n+1],i[n+2]),o.push(i[r+0],i[r+1],i[r+2])},addFaceNormal:function(e,n,r){const i=this.vertices,o=this.object.geometry.normals;x2.fromArray(i,e),Iw.fromArray(i,n),b2.fromArray(i,r),Bi.subVectors(b2,Iw),_2.subVectors(x2,Iw),Bi.cross(_2),Bi.normalize(),o.push(Bi.x,Bi.y,Bi.z),o.push(Bi.x,Bi.y,Bi.z),o.push(Bi.x,Bi.y,Bi.z)},addColor:function(e,n,r){const i=this.colors,o=this.object.geometry.colors;i[e]!==void 0&&o.push(i[e+0],i[e+1],i[e+2]),i[n]!==void 0&&o.push(i[n+0],i[n+1],i[n+2]),i[r]!==void 0&&o.push(i[r+0],i[r+1],i[r+2])},addUV:function(e,n,r){const i=this.uvs,o=this.object.geometry.uvs;o.push(i[e+0],i[e+1]),o.push(i[n+0],i[n+1]),o.push(i[r+0],i[r+1])},addDefaultUV:function(){const e=this.object.geometry.uvs;e.push(0,0),e.push(0,0),e.push(0,0)},addUVLine:function(e){const n=this.uvs;this.object.geometry.uvs.push(n[e+0],n[e+1])},addFace:function(e,n,r,i,o,a,s,l,c){const u=this.vertices.length;let d=this.parseVertexIndex(e,u),f=this.parseVertexIndex(n,u),p=this.parseVertexIndex(r,u);if(this.addVertex(d,f,p),this.addColor(d,f,p),s!==void 0&&s!==""){const y=this.normals.length;d=this.parseNormalIndex(s,y),f=this.parseNormalIndex(l,y),p=this.parseNormalIndex(c,y),this.addNormal(d,f,p)}else this.addFaceNormal(d,f,p);if(i!==void 0&&i!==""){const y=this.uvs.length;d=this.parseUVIndex(i,y),f=this.parseUVIndex(o,y),p=this.parseUVIndex(a,y),this.addUV(d,f,p),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(e){this.object.geometry.type="Points";const n=this.vertices.length;for(let r=0,i=e.length;r=7?(av.setRGB(parseFloat(d[4]),parseFloat(d[5]),parseFloat(d[6]),Zt),n.colors.push(av.r,av.g,av.b)):n.colors.push(void 0,void 0,void 0);break;case"vn":n.normals.push(parseFloat(d[1]),parseFloat(d[2]),parseFloat(d[3]));break;case"vt":n.uvs.push(parseFloat(d[1]),parseFloat(d[2]));break}}else if(u==="f"){const f=c.slice(1).trim().split(v2),p=[];for(let v=0,g=f.length;v0){const x=m.split("/");p.push(x)}}const y=p[0];for(let v=1,g=p.length-1;v1){const f=i[1].trim().toLowerCase();n.object.smooth=f!=="0"&&f!=="off"}else n.object.smooth=!0;const d=n.object.currentMaterial();d&&(d.smooth=n.object.smooth)}else{if(c==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+c+'"')}}n.finalize();const o=new da;if(o.materialLibraries=[].concat(n.materialLibraries),!(n.objects.length===1&&n.objects[0].geometry.vertices.length===0)===!0)for(let s=0,l=n.objects.length;s0&&v.setAttribute("normal",new Qt(u.normals,3)),u.colors.length>0&&(y=!0,v.setAttribute("color",new Qt(u.colors,3))),u.hasUVIndices===!0&&v.setAttribute("uv",new Qt(u.uvs,2));const g=[];for(let x=0,b=d.length;x1){for(let x=0,b=d.length;x0){const s=new Hu({size:1,sizeAttenuation:!1}),l=new br;l.setAttribute("position",new Qt(n.vertices,3)),n.colors.length>0&&n.colors[0]!==void 0&&(l.setAttribute("color",new Qt(n.colors,3)),s.vertexColors=!0);const c=new Xv(l,s);o.add(c)}return o}}const dse=(t,e,n)=>{var i;let r=(i=t.split(/\./g).pop())==null?void 0:i.toLowerCase();if(t.startsWith("blob:")&&t.includes("#.")){const o=t.split("#.").pop();o&&(r=o.toLowerCase())}if(!r){console.error(`Could not determine file extension for: ${t}`),n(null,new Error(`Unsupported file format: ${t}`));return}switch(r){case"gltf":case"glb":new Eae(e).load(t,o=>n(o.scene),void 0,o=>n(null,o));break;case"obj":new use(e).load(t,o=>n(o),()=>{},o=>n(null,o));break;case"dae":new a$(e).load(t,o=>n(o.scene),void 0,o=>n(null,o));break;case"stl":new o$(e).load(t,o=>{const a=new Fo,s=new Tn(o,a);n(s)},o=>{},o=>{console.error(`โŒ STL loading failed: ${t}`,o);const a=new Gc(.05,.05,.05),s=new Fo({color:16739125,transparent:!0,opacity:.7}),l=new Tn(a,s);n(l)});break;default:n(null,new Error(`Unsupported file format: ${r}`))}};function fse(t,e){t.innerHTML="";const n=document.createElement("urdf-viewer");n.classList.add("w-full","h-full"),t.appendChild(n),n.setAttribute("up","Z"),gse(n,"#2c2b3a"),n.setAttribute("highlight-color","#df6dd4"),n.setAttribute("auto-redraw","true");const r=new J4(14079702,1);n.scene.add(r);const i=new zx(16777215,.8);return i.position.set(5,30,5),i.castShadow=!0,n.scene.add(i),n}function hse(t,e){"loadMeshFunc"in t&&(t.loadMeshFunc=(n,r,i)=>{const o=e?e(n):n;try{dse(o,r,(a,s)=>{s?(console.warn(`Error loading mesh ${o}:`,s),i(null)):i(a)})}catch(a){console.error(`Exception loading mesh ${o}:`,a),i(null,a)}})}function pse(t,e){const n=i=>{e(i.detail)},r=()=>{e(null)};return t.addEventListener("joint-mouseover",n),t.addEventListener("joint-mouseout",r),()=>{t.removeEventListener("joint-mouseover",n),t.removeEventListener("joint-mouseout",r)}}function mse(t,e,n,r,i=[]){const o=e.startsWith("blob:")&&!e.includes("#.")?e+"#.urdf":e;t.setAttribute("urdf",o),t.setAttribute("package",n);const a=()=>{if(i.length>0){const s=i[0];s&&(r(s),Ur.info("Trying alternative model...",{description:`First model failed to load. Trying ${s.split("/").pop()||"alternative model"}`,duration:2e3}))}};return t.addEventListener("error",a),()=>{t.removeEventListener("error",a)}}function gse(t,e){const n=t.parentElement;n&&(n.style.backgroundColor=e)}typeof window<"u"&&!customElements.get("urdf-viewer")&&customElements.define("urdf-viewer",bae);const vse=()=>{const t=_.useRef(null),[e,n]=_.useState(null),{registerUrdfProcessor:r,alternativeUrdfModels:i,isDefaultModel:o}=lU(),a=_.useRef(null),s=_.useRef(null),l=_.useRef(!1),{isConnected:c}=wae({viewerRef:s,enabled:o}),[u,d]=_.useState(null),[f,p]=_.useState(null),y=_.useRef(""),v=_.useMemo(()=>({loadUrdf:m=>{d(m)},setUrlModifierFunc:m=>{p(()=>m)},getPackage:()=>y.current}),[]);_.useEffect(()=>{r(v)},[r,v]);const g=_.useCallback(m=>m.startsWith("package://so_arm_description/meshes/")?m.replace("package://so_arm_description/meshes/","/so-101-urdf/meshes/"):m.includes("so_arm_description/meshes/")?m.replace(/.*so_arm_description\/meshes\//,"/so-101-urdf/meshes/"):m.includes("/so-101-urdf/so_arm_description/meshes/")?m.replace("/so-101-urdf/so_arm_description/meshes/","/so-101-urdf/meshes/"):m.endsWith(".stl")&&!m.startsWith("/")&&!m.startsWith("http")?`/so-101-urdf/meshes/${m}`:m,[]);return _.useEffect(()=>{if(!t.current)return;const m=fse(t.current);s.current=m,hse(m,o?g:f);const b=o?"/so-101-urdf/urdf/so101_new_calib.urdf":u||"";o&&(y.current="/");let S=()=>{};b&&(S=mse(m,b,y.current,d,i));const w=pse(m,n),E=M=>{if(!(!M||!M.robot))try{const C=new Wo().setFromObject(M.robot),P=new ne;C.getCenter(P);const R=new ne;C.getSize(R);const D=Math.max(R.x,R.y,R.z);M.camera.position.copy(P);const k=new ne;M.up==="+Z"||M.up==="Z"||M.up==="+Y"||M.up,k.set(1,1,1),k.normalize().multiplyScalar(D*1.3),M.camera.position.add(k),M.controls.target.copy(P),M.controls.update(),M.redraw()}catch(C){console.error("[RobotViewer] Error fitting robot to view:",C)}},T=()=>{E(m)},A=()=>{l.current=!0,"setJointValue"in m&&a.current&&(a.current(),a.current=null),T()};return m.addEventListener("urdf-processed",A),()=>{a.current&&(a.current(),a.current=null),l.current=!1,w(),S(),m.removeEventListener("urdf-processed",A)}},[o,u,f,g,i]),h.jsxs("div",{className:He("w-full h-full transition-all duration-300 ease-in-out relative","bg-gradient-to-br from-gray-900 to-gray-800"),children:[h.jsx("div",{ref:t,className:"w-full h-full"}),e&&h.jsxs("div",{className:"absolute bottom-4 right-4 bg-black/70 text-white px-3 py-2 rounded-md text-sm font-mono z-10",children:["Joint: ",e]}),o&&h.jsx("div",{className:"absolute top-4 right-4 z-10",children:h.jsxs("div",{className:`flex items-center gap-2 px-3 py-2 rounded-md text-sm font-mono ${c?"bg-green-900/70 text-green-300":"bg-red-900/70 text-red-300"}`,children:[h.jsx("div",{className:`w-2 h-2 rounded-full ${c?"bg-green-400":"bg-red-400"}`}),c?"Live Robot Data":"Disconnected"]})})]})},yse=_.memo(vse),Gx=({className:t,iconOnly:e=!1})=>h.jsxs("div",{className:He("flex items-center gap-2",t),children:[h.jsx("img",{src:"/lovable-uploads/5e648747-34b7-4d8f-93fd-4dbd00aeeefc.png",alt:"LeLab Logo",className:"h-8 w-8"}),!e&&h.jsx("span",{className:"font-bold text-white text-2xl",children:"LeLab"})]}),xse=({onGoBack:t,className:e})=>h.jsx("div",{className:He("w-full p-2 sm:p-4 space-y-4 lg:space-y-0 lg:space-x-4 flex flex-col lg:flex-row",e),children:h.jsxs("div",{className:"bg-gray-900 rounded-lg p-4 flex-1 flex flex-col",children:[h.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[h.jsx(et,{variant:"ghost",size:"icon",onClick:t,className:"text-gray-400 hover:text-white hover:bg-gray-800 flex-shrink-0",children:h.jsx(ll,{className:"h-5 w-5"})}),h.jsx(Gx,{iconOnly:!0}),h.jsx("div",{className:"w-px h-6 bg-gray-700"}),h.jsx("h2",{className:"text-xl font-medium text-gray-200",children:"Teleoperation"})]}),h.jsx("div",{className:"flex-1 bg-black rounded border border-gray-800 min-h-[50vh] lg:min-h-0",children:h.jsx(yse,{})})]})}),bse=()=>{const t=ji(),{toast:e}=Dr(),{baseUrl:n,fetchWithHeaders:r}=Dn(),i=async()=>{try{const o=await r(`${n}/stop-teleoperation`,{method:"POST"});if(o.ok){const a=await o.json();a.message,e({title:"Teleoperation Stopped",description:a.message||"Robot teleoperation has been stopped successfully."})}else{const a=await o.text();console.warn("โš ๏ธ Failed to stop teleoperation:",o.status,a),e({title:"Warning",description:`Failed to stop teleoperation properly. Status: ${o.status}`,variant:"destructive"})}}catch(o){console.error("โŒ Error stopping teleoperation:",o),e({title:"Error",description:"Failed to communicate with the robot server.",variant:"destructive"})}finally{t("/")}};return h.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center p-2 sm:p-4",children:h.jsx("div",{className:"w-full h-[95vh] flex",children:h.jsx(xse,{onGoBack:i,className:"lg:w-full"})})})},_se=Em("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function w1({className:t,variant:e,...n}){return h.jsx("div",{className:He(_se({variant:e}),t),...n})}var wse="Separator",_2="horizontal",Sse=["horizontal","vertical"],d$=_.forwardRef((t,e)=>{const{decorative:n,orientation:r=_2,...i}=t,o=Ese(r)?r:_2,s=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return h.jsx(nt.div,{"data-orientation":o,...s,...i,ref:e})});d$.displayName=wse;function Ese(t){return Sse.includes(t)}var f$=d$;const Jl=_.forwardRef(({className:t,orientation:e="horizontal",decorative:n=!0,...r},i)=>h.jsx(f$,{ref:i,decorative:n,orientation:e,className:He("shrink-0 bg-border",e==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...r}));Jl.displayName=f$.displayName;const Tse=({onClick:t,robotType:e,className:n=""})=>h.jsxs(et,{type:"button",onClick:t,variant:"outline",size:"sm",className:` +`);let i=[];for(let s=0,l=r.length;s=7?(av.setRGB(parseFloat(d[4]),parseFloat(d[5]),parseFloat(d[6]),Zt),n.colors.push(av.r,av.g,av.b)):n.colors.push(void 0,void 0,void 0);break;case"vn":n.normals.push(parseFloat(d[1]),parseFloat(d[2]),parseFloat(d[3]));break;case"vt":n.uvs.push(parseFloat(d[1]),parseFloat(d[2]));break}}else if(u==="f"){const f=c.slice(1).trim().split(y2),p=[];for(let v=0,g=f.length;v0){const x=m.split("/");p.push(x)}}const y=p[0];for(let v=1,g=p.length-1;v1){const f=i[1].trim().toLowerCase();n.object.smooth=f!=="0"&&f!=="off"}else n.object.smooth=!0;const d=n.object.currentMaterial();d&&(d.smooth=n.object.smooth)}else{if(c==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+c+'"')}}n.finalize();const o=new da;if(o.materialLibraries=[].concat(n.materialLibraries),!(n.objects.length===1&&n.objects[0].geometry.vertices.length===0)===!0)for(let s=0,l=n.objects.length;s0&&v.setAttribute("normal",new Qt(u.normals,3)),u.colors.length>0&&(y=!0,v.setAttribute("color",new Qt(u.colors,3))),u.hasUVIndices===!0&&v.setAttribute("uv",new Qt(u.uvs,2));const g=[];for(let x=0,b=d.length;x1){for(let x=0,b=d.length;x0){const s=new Hu({size:1,sizeAttenuation:!1}),l=new br;l.setAttribute("position",new Qt(n.vertices,3)),n.colors.length>0&&n.colors[0]!==void 0&&(l.setAttribute("color",new Qt(n.colors,3)),s.vertexColors=!0);const c=new Xv(l,s);o.add(c)}return o}}const hse=(t,e,n)=>{var i;let r=(i=t.split(/\./g).pop())==null?void 0:i.toLowerCase();if(t.startsWith("blob:")&&t.includes("#.")){const o=t.split("#.").pop();o&&(r=o.toLowerCase())}if(!r){console.error(`Could not determine file extension for: ${t}`),n(null,new Error(`Unsupported file format: ${t}`));return}switch(r){case"gltf":case"glb":new Mae(e).load(t,o=>n(o.scene),void 0,o=>n(null,o));break;case"obj":new fse(e).load(t,o=>n(o),()=>{},o=>n(null,o));break;case"dae":new l$(e).load(t,o=>n(o.scene),void 0,o=>n(null,o));break;case"stl":new s$(e).load(t,o=>{const a=new Bo,s=new Tn(o,a);n(s)},o=>{},o=>{console.error(`โŒ STL loading failed: ${t}`,o);const a=new Gc(.05,.05,.05),s=new Bo({color:16739125,transparent:!0,opacity:.7}),l=new Tn(a,s);n(l)});break;default:n(null,new Error(`Unsupported file format: ${r}`))}};function pse(t,e){t.innerHTML="";const n=document.createElement("urdf-viewer");n.classList.add("w-full","h-full"),t.appendChild(n),n.setAttribute("up","Z"),yse(n,"#2c2b3a"),n.setAttribute("highlight-color","#df6dd4"),n.setAttribute("auto-redraw","true");const r=new Q4(14079702,1);n.scene.add(r);const i=new zx(16777215,.8);return i.position.set(5,30,5),i.castShadow=!0,n.scene.add(i),n}function mse(t,e){"loadMeshFunc"in t&&(t.loadMeshFunc=(n,r,i)=>{const o=e?e(n):n;try{hse(o,r,(a,s)=>{s?(console.warn(`Error loading mesh ${o}:`,s),i(null)):i(a)})}catch(a){console.error(`Exception loading mesh ${o}:`,a),i(null,a)}})}function gse(t,e){const n=i=>{e(i.detail)},r=()=>{e(null)};return t.addEventListener("joint-mouseover",n),t.addEventListener("joint-mouseout",r),()=>{t.removeEventListener("joint-mouseover",n),t.removeEventListener("joint-mouseout",r)}}function vse(t,e,n,r,i=[]){const o=e.startsWith("blob:")&&!e.includes("#.")?e+"#.urdf":e;t.setAttribute("urdf",o),t.setAttribute("package",n);const a=()=>{if(i.length>0){const s=i[0];s&&(r(s),Ur.info("Trying alternative model...",{description:`First model failed to load. Trying ${s.split("/").pop()||"alternative model"}`,duration:2e3}))}};return t.addEventListener("error",a),()=>{t.removeEventListener("error",a)}}function yse(t,e){const n=t.parentElement;n&&(n.style.backgroundColor=e)}typeof window<"u"&&!customElements.get("urdf-viewer")&&customElements.define("urdf-viewer",wae);const xse=()=>{const t=_.useRef(null),[e,n]=_.useState(null),{registerUrdfProcessor:r,alternativeUrdfModels:i,isDefaultModel:o}=uU(),a=_.useRef(null),s=_.useRef(null),l=_.useRef(!1),{isConnected:c}=Eae({viewerRef:s,enabled:o}),[u,d]=_.useState(null),[f,p]=_.useState(null),y=_.useRef(""),v=_.useMemo(()=>({loadUrdf:m=>{d(m)},setUrlModifierFunc:m=>{p(()=>m)},getPackage:()=>y.current}),[]);_.useEffect(()=>{r(v)},[r,v]);const g=_.useCallback(m=>m.startsWith("package://so_arm_description/meshes/")?m.replace("package://so_arm_description/meshes/","/so-101-urdf/meshes/"):m.includes("so_arm_description/meshes/")?m.replace(/.*so_arm_description\/meshes\//,"/so-101-urdf/meshes/"):m.includes("/so-101-urdf/so_arm_description/meshes/")?m.replace("/so-101-urdf/so_arm_description/meshes/","/so-101-urdf/meshes/"):m.endsWith(".stl")&&!m.startsWith("/")&&!m.startsWith("http")?`/so-101-urdf/meshes/${m}`:m,[]);return _.useEffect(()=>{if(!t.current)return;const m=pse(t.current);s.current=m,mse(m,o?g:f);const b=o?"/so-101-urdf/urdf/so101_new_calib.urdf":u||"";o&&(y.current="/");let S=()=>{};b&&(S=vse(m,b,y.current,d,i));const w=gse(m,n),E=M=>{if(!(!M||!M.robot))try{const C=new Xo().setFromObject(M.robot),P=new ne;C.getCenter(P);const R=new ne;C.getSize(R);const D=Math.max(R.x,R.y,R.z);M.camera.position.copy(P);const k=new ne;M.up==="+Z"||M.up==="Z"||M.up==="+Y"||M.up,k.set(1,1,1),k.normalize().multiplyScalar(D*1.3),M.camera.position.add(k),M.controls.target.copy(P),M.controls.update(),M.redraw()}catch(C){console.error("[RobotViewer] Error fitting robot to view:",C)}},T=()=>{E(m)},A=()=>{l.current=!0,"setJointValue"in m&&a.current&&(a.current(),a.current=null),T()};return m.addEventListener("urdf-processed",A),()=>{a.current&&(a.current(),a.current=null),l.current=!1,w(),S(),m.removeEventListener("urdf-processed",A)}},[o,u,f,g,i]),h.jsxs("div",{className:He("w-full h-full transition-all duration-300 ease-in-out relative","bg-gradient-to-br from-gray-900 to-gray-800"),children:[h.jsx("div",{ref:t,className:"w-full h-full"}),e&&h.jsxs("div",{className:"absolute bottom-4 right-4 bg-black/70 text-white px-3 py-2 rounded-md text-sm font-mono z-10",children:["Joint: ",e]}),o&&h.jsx("div",{className:"absolute top-4 right-4 z-10",children:h.jsxs("div",{className:`flex items-center gap-2 px-3 py-2 rounded-md text-sm font-mono ${c?"bg-green-900/70 text-green-300":"bg-red-900/70 text-red-300"}`,children:[h.jsx("div",{className:`w-2 h-2 rounded-full ${c?"bg-green-400":"bg-red-400"}`}),c?"Live Robot Data":"Disconnected"]})})]})},bse=_.memo(xse),Gx=({className:t,iconOnly:e=!1})=>h.jsxs("div",{className:He("flex items-center gap-2",t),children:[h.jsx("img",{src:"/lovable-uploads/5e648747-34b7-4d8f-93fd-4dbd00aeeefc.png",alt:"LeLab Logo",className:"h-8 w-8"}),!e&&h.jsx("span",{className:"font-bold text-white text-2xl",children:"LeLab"})]}),_se=({onGoBack:t,className:e})=>h.jsx("div",{className:He("w-full p-2 sm:p-4 space-y-4 lg:space-y-0 lg:space-x-4 flex flex-col lg:flex-row",e),children:h.jsxs("div",{className:"bg-gray-900 rounded-lg p-4 flex-1 flex flex-col",children:[h.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[h.jsx(Je,{variant:"ghost",size:"icon",onClick:t,className:"text-gray-400 hover:text-white hover:bg-gray-800 flex-shrink-0",children:h.jsx(ll,{className:"h-5 w-5"})}),h.jsx(Gx,{iconOnly:!0}),h.jsx("div",{className:"w-px h-6 bg-gray-700"}),h.jsx("h2",{className:"text-xl font-medium text-gray-200",children:"Teleoperation"})]}),h.jsx("div",{className:"flex-1 bg-black rounded border border-gray-800 min-h-[50vh] lg:min-h-0",children:h.jsx(bse,{})})]})}),wse=()=>{const t=ji(),{toast:e}=_r(),{baseUrl:n,fetchWithHeaders:r}=Dn(),i=_.useRef(!1),o=_.useCallback(async()=>{if(!i.current){i.current=!0;try{const l=await(await r(`${n}/stop-teleoperation`,{method:"POST"})).json();l!=null&&l.success&&e({title:"Teleoperation stopped",description:"The arm was disconnected cleanly."})}catch{}}},[n,r,e]);_.useEffect(()=>{const s=()=>{try{sessionStorage.setItem("lelab:teleop-stopped","1")}catch{}fetch(`${n}/stop-teleoperation`,{method:"POST",keepalive:!0}).catch(()=>{})};return window.addEventListener("pagehide",s),()=>{window.removeEventListener("pagehide",s),o()}},[n,o]);const a=async()=>{await o(),t("/")};return h.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center p-2 sm:p-4",children:h.jsx("div",{className:"w-full h-[95vh] flex",children:h.jsx(_se,{onGoBack:a,className:"lg:w-full"})})})},Sse=Em("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function w1({className:t,variant:e,...n}){return h.jsx("div",{className:He(Sse({variant:e}),t),...n})}var Ese="Separator",w2="horizontal",Tse=["horizontal","vertical"],h$=_.forwardRef((t,e)=>{const{decorative:n,orientation:r=w2,...i}=t,o=Mse(r)?r:w2,s=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return h.jsx(nt.div,{"data-orientation":o,...s,...i,ref:e})});h$.displayName=Ese;function Mse(t){return Tse.includes(t)}var p$=h$;const Jl=_.forwardRef(({className:t,orientation:e="horizontal",decorative:n=!0,...r},i)=>h.jsx(p$,{ref:i,decorative:n,orientation:e,className:He("shrink-0 bg-border",e==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...r}));Jl.displayName=p$.displayName;var Wx="Switch",[Ase,IDe]=mi(Wx),[Cse,Pse]=Ase(Wx),m$=_.forwardRef((t,e)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:o,required:a,disabled:s,value:l="on",onCheckedChange:c,form:u,...d}=t,[f,p]=_.useState(null),y=Ot(e,b=>p(b)),v=_.useRef(!1),g=f?u||!!f.closest("form"):!0,[m,x]=zo({prop:i,defaultProp:o??!1,onChange:c,caller:Wx});return h.jsxs(Cse,{scope:n,checked:m,disabled:s,children:[h.jsx(nt.button,{type:"button",role:"switch","aria-checked":m,"aria-required":a,"data-state":x$(m),"data-disabled":s?"":void 0,disabled:s,value:l,...d,ref:y,onClick:Oe(t.onClick,b=>{x(S=>!S),g&&(v.current=b.isPropagationStopped(),v.current||b.stopPropagation())})}),g&&h.jsx(y$,{control:f,bubbles:!v.current,name:r,value:l,checked:m,required:a,disabled:s,form:u,style:{transform:"translateX(-100%)"}})]})});m$.displayName=Wx;var g$="SwitchThumb",v$=_.forwardRef((t,e)=>{const{__scopeSwitch:n,...r}=t,i=Pse(g$,n);return h.jsx(nt.span,{"data-state":x$(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:e})});v$.displayName=g$;var Rse="SwitchBubbleInput",y$=_.forwardRef(({__scopeSwitch:t,control:e,checked:n,bubbles:r=!0,...i},o)=>{const a=_.useRef(null),s=Ot(a,o),l=NA(n),c=TA(e);return _.useEffect(()=>{const u=a.current;if(!u)return;const d=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(d,"checked").set;if(l!==n&&p){const y=new Event("click",{bubbles:r});p.call(u,n),u.dispatchEvent(y)}},[l,n,r]),h.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...i.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});y$.displayName=Rse;function x$(t){return t?"checked":"unchecked"}var b$=m$,Nse=v$;const bo=_.forwardRef(({className:t,...e},n)=>h.jsx(b$,{className:He("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",t),...e,ref:n,children:h.jsx(Nse,{className:He("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));bo.displayName=b$.displayName;const Ose=({onClick:t,robotType:e,className:n=""})=>h.jsxs(Je,{type:"button",onClick:t,variant:"outline",size:"sm",className:` h-8 px-2 border-gray-600 hover:border-blue-500 text-gray-400 hover:text-blue-400 bg-gray-800 hover:bg-gray-700 transition-all duration-200 ${n} - `,title:`Find ${e||"robot"} port automatically`,children:[h.jsx(oA,{className:"w-3 h-3 mr-1"}),"Find"]}),Mse=2e3,Ase=({open:t,onOpenChange:e,robotType:n,onPortDetected:r})=>{const[i,o]=_.useState("detecting"),[a,s]=_.useState(""),[l,c]=_.useState(""),u=_.useRef(!1),d=_.useRef(null),f=_.useRef(null),{toast:p}=Dr(),{baseUrl:y,fetchWithHeaders:v}=Dn(),g=async()=>{try{d.current=new AbortController;const E=await(await v(`${y}/start-port-detection`,{method:"POST",body:JSON.stringify({robot_type:n}),signal:d.current.signal})).json();if(u.current)return;if(E.status!=="success")throw new Error(E.message||"Failed to start port detection");const T=E.data.ports_before;for(;!u.current;){d.current=new AbortController;const M=await(await v(`${y}/detect-port-after-disconnect`,{method:"POST",body:JSON.stringify({ports_before:T}),signal:d.current.signal})).json();if(u.current)return;if(M.status==="success"){if(s(M.port),await m(M.port),u.current)return;o("success"),p({title:"Port Detected Successfully",description:`${n} port detected: ${M.port}`}),f.current=window.setTimeout(()=>{u.current||(r(M.port),e(!1))},Mse);return}const C=typeof M.message=="string"?M.message:"";if(!C.includes("Timed out"))throw new Error(C||"Failed to detect port")}}catch(w){if(u.current||w instanceof DOMException&&w.name==="AbortError")return;console.error("Port detection failed:",w),c(w instanceof Error?w.message:"Unknown error"),o("error")}},m=async w=>{try{await v(`${y}/save-robot-port`,{method:"POST",body:JSON.stringify({robot_type:n,port:w})})}catch(E){console.error("Error saving port:",E)}};_.useEffect(()=>{if(t)return u.current=!1,o("detecting"),c(""),s(""),g(),()=>{var w;u.current=!0,(w=d.current)==null||w.abort(),f.current!==null&&(window.clearTimeout(f.current),f.current=null)}},[t]);const x=()=>{e(!1)},b=()=>{var w;u.current=!1,(w=d.current)==null||w.abort(),o("detecting"),c(""),s(""),g()},S=()=>{switch(i){case"detecting":return h.jsxs("div",{className:"space-y-6 text-center",children:[h.jsx(fi,{className:"w-16 h-16 text-blue-500 mx-auto animate-spin"}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs("h3",{className:"text-lg font-semibold text-white",children:["Unplug the ",n," arm"]}),h.jsxs("p",{className:"text-gray-400",children:["Disconnect the ",n," robot arm from USB. The port will be detected automatically."]})]}),h.jsx("div",{className:"flex justify-center",children:h.jsx(et,{onClick:x,variant:"outline",className:"border-gray-500 hover:border-gray-200 text-gray-300 hover:text-white px-8 py-2",children:"Cancel"})})]});case"success":return h.jsxs("div",{className:"space-y-6 text-center",children:[h.jsx(qi,{className:"w-16 h-16 text-green-500 mx-auto"}),h.jsxs("div",{className:"space-y-2",children:[h.jsx("h3",{className:"text-lg font-semibold text-white",children:"Port Detected"}),h.jsx("p",{className:"text-xl font-mono text-green-400 bg-gray-800 px-4 py-2 rounded inline-block",children:a})]})]});case"error":return h.jsxs("div",{className:"space-y-6 text-center",children:[h.jsx(td,{className:"w-16 h-16 text-red-500 mx-auto"}),h.jsxs("div",{className:"space-y-2",children:[h.jsx("h3",{className:"text-lg font-semibold text-white",children:"Detection Failed"}),h.jsx("div",{className:"bg-red-900/20 border border-red-800 rounded-lg p-3",children:h.jsx("p",{className:"text-red-400 text-sm",children:l})})]}),h.jsxs("div",{className:"flex gap-4 justify-center",children:[h.jsx(et,{onClick:b,className:"bg-blue-500 hover:bg-blue-600 text-white px-8 py-2",children:"Try Again"}),h.jsx(et,{onClick:x,variant:"outline",className:"border-gray-500 hover:border-gray-200 text-gray-300 hover:text-white px-8 py-2",children:"Cancel"})]})]});default:return null}};return h.jsx(Hc,{open:t,onOpenChange:e,children:h.jsxs(bl,{className:"bg-gray-900 border-gray-800 text-white sm:max-w-[500px] p-8",children:[h.jsxs(_l,{children:[h.jsx(wl,{className:"text-white text-center text-xl font-bold",children:"Port Detection"}),h.jsxs(Sl,{className:"text-gray-400 text-center",children:["Detect the USB port for your ",n," arm"]})]}),h.jsx("div",{className:"py-4",children:S()})]})})},Cse={shoulder_pan:2400,shoulder_lift:2300,elbow_flex:2150,wrist_flex:2250,wrist_roll:3700,gripper:1150},Pse={shoulder_pan:2400,shoulder_lift:2300,elbow_flex:2150,wrist_flex:2250,wrist_roll:3700,gripper:1400},Rse={teleop:Cse,robot:Pse},Nse=.98;function w2(t,e,n){var i;if(!t)return!1;const r=(i=Rse[t])==null?void 0:i[e];return r?n>=r*Nse:!1}const S2="Motor discontinuity detected",Ose=()=>{var X;const t=ji(),n=((X=yl().state)==null?void 0:X.robot_name)??null,{toast:r}=Dr(),{baseUrl:i,fetchWithHeaders:o}=Dn();_.useRef(null);const a=_.useRef(null),[s,l]=_.useState("teleop"),[c,u]=_.useState(""),[d,f]=_.useState(null),[p,y]=_.useState([]),v=_.useRef(null),g=_.useCallback(async()=>{if(!n)return null;try{const K=await o(`${i}/robots/${encodeURIComponent(n)}`);if(!K.ok)return null;const Y=(await K.json()).robot??null;return f(Y),Y}catch(K){return console.error("Failed to load robot record:",K),null}},[n,i,o]);_.useEffect(()=>{if(!n)return;let K=!1;return(async()=>{const F=await g();if(!F||K)return;const Y=F.leader_config?F.follower_config?"teleop":"robot":"teleop";l(Y),u(Y==="teleop"?F.leader_port||"":F.follower_port||""),y(F.cameras??[])})(),()=>{K=!0}},[n,g]);const m=K=>{y(K),n&&(v.current&&clearTimeout(v.current),v.current=setTimeout(async()=>{try{await o(`${i}/robots/${encodeURIComponent(n)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cameras:K})})}catch(F){console.error("Failed to save cameras to robot record:",F)}},500))};_.useEffect(()=>()=>{v.current&&clearTimeout(v.current)},[]);const[x,b]=_.useState(!1),[S,w]=_.useState("leader"),[E,T]=_.useState({calibration_active:!1,status:"idle",device_type:null,error:null,message:"",step:0,total_steps:1,current_positions:null,recorded_ranges:null}),[A,M]=_.useState(!1),C=_.useRef(!1);_.useEffect(()=>{C.current=E.calibration_active},[E.calibration_active]),_.useEffect(()=>()=>{C.current&&o(`${i}/stop-calibration`,{method:"POST"}).catch(K=>console.error("Failed to stop calibration on unmount:",K))},[i,o]);const P=async()=>{try{const K=await o(`${i}/calibration-status`);if(K.ok){const F=await K.json();T(F),!F.calibration_active&&(F.status==="completed"||F.status==="error"||F.status==="idle")&&M(!1)}}catch(K){console.error("Error polling status:",K)}},R=async()=>{if(!n){r({title:"No robot selected",description:"Open Calibration from a robot's gear icon on the Landing page.",variant:"destructive"});return}if(!c){r({title:"Missing port",description:"Set the device's serial port before starting.",variant:"destructive"});return}const K={device_type:s,port:c,config_file:n,robot_name:n};C.current=!0;try{const Y=await(await o(`${i}/start-calibration`,{method:"POST",body:JSON.stringify(K)})).json();Y.success?(r({title:"Calibration Started",description:`Calibration started for ${s}`}),M(!0)):(C.current=!1,r({title:"Calibration Failed",description:Y.message||"Failed to start calibration",variant:"destructive"}))}catch(F){C.current=!1,console.error("Error starting calibration:",F),r({title:"Error",description:"Failed to start calibration",variant:"destructive"})}},D=async()=>{try{const F=await(await o(`${i}/stop-calibration`,{method:"POST"})).json();F.success?r({title:"Calibration Stopped",description:"Calibration has been stopped"}):r({title:"Error",description:F.message||"Failed to stop calibration",variant:"destructive"})}catch(K){console.error("Error stopping calibration:",K),r({title:"Error",description:"Failed to stop calibration",variant:"destructive"})}},k=async()=>{if(E.calibration_active)try{const F=await(await o(`${i}/complete-calibration-step`,{method:"POST"})).json();F.success?r({title:"Step Completed",description:F.message}):r({title:"Step Failed",description:F.message||"Could not complete step",variant:"destructive"})}catch(K){console.error("Error completing step:",K),r({title:"Error",description:"Could not complete calibration step",variant:"destructive"})}};_.useEffect(()=>{var K,F;E.status==="error"&&((K=E.error)!=null&&K.startsWith(S2))&&((F=a.current)==null||F.scrollIntoView({behavior:"smooth",block:"center"}))},[E.status,E.error]),_.useEffect(()=>{if(!A)return;P();const K=setInterval(()=>{P()},200);return()=>clearInterval(K)},[A]),_.useEffect(()=>{(async()=>{if(s&&!n)try{const q=await(await o(`${i}/robot-port/${s==="robot"?"follower":"leader"}`)).json();if(q.status==="success"){const ee=q.saved_port||q.default_port;ee&&u(ee)}}catch(F){console.error("Error loading default port:",F)}})()},[s,n,i,o]);const U=K=>{l(K),d&&u(K==="teleop"?d.leader_port||"":d.follower_port||"")};_.useEffect(()=>{E.status==="completed"&&(async()=>{const K=await g();if(!K)return;const F=K.leader_config?K.follower_config?"teleop":"robot":"teleop";l(F),u(F==="teleop"?K.leader_port||"":K.follower_port||"")})()},[E.status,g]);const O=()=>{w(s==="robot"?"follower":"leader"),b(!0)},W=K=>{u(K)},j=(()=>{switch(E.status){case"idle":return{color:"bg-slate-500",icon:h.jsx(Mh,{className:"w-4 h-4"}),text:"Idle"};case"connecting":return{color:"bg-yellow-500",icon:h.jsx(fi,{className:"w-4 h-4 animate-spin"}),text:"Connecting"};case"recording":return{color:"bg-purple-500",icon:h.jsx($u,{className:"w-4 h-4"}),text:"Recording Ranges"};case"completed":return{color:"bg-green-500",icon:h.jsx(qi,{className:"w-4 h-4"}),text:"Completed"};case"error":return{color:"bg-red-500",icon:h.jsx(nd,{className:"w-4 h-4"}),text:"Error"};case"stopping":return{color:"bg-orange-500",icon:h.jsx(Od,{className:"w-4 h-4"}),text:"Stopping"};default:return{color:"bg-slate-500",icon:h.jsx(Mh,{className:"w-4 h-4"}),text:"Unknown"}}})();return h.jsxs("div",{className:"min-h-screen bg-slate-900 text-white p-4",children:[h.jsxs("div",{className:"max-w-4xl mx-auto",children:[h.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[h.jsx(et,{variant:"ghost",size:"icon",onClick:()=>t(-1),className:"text-slate-400 hover:text-white hover:bg-slate-800",children:h.jsx(ll,{className:"w-5 h-5"})}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx(Gx,{iconOnly:!0}),h.jsx("h1",{className:"text-3xl font-bold",children:n?`Calibrate "${n}"`:"Device Calibration"})]})]}),!n&&h.jsxs(Mi,{className:"mb-6 bg-amber-900/40 border-amber-700 text-amber-100",children:[h.jsx(td,{className:"h-4 w-4"}),h.jsx(Ai,{children:"Open Calibration from a robot's gear icon on the Landing page. Each robot has its own calibration; running this page directly is not supported."})]}),h.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[h.jsxs(Gr,{className:"bg-slate-800/60 border-slate-700 backdrop-blur-sm",children:[h.jsx(jo,{children:h.jsxs(ga,{className:"flex items-center gap-2 text-slate-200",children:[h.jsx(Mh,{className:"w-5 h-5 text-blue-400"}),"Configuration"]})}),h.jsxs(Wr,{className:"space-y-6",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(Tt,{htmlFor:"deviceType",className:"text-sm font-medium text-slate-300",children:"Device Type *"}),h.jsxs(Ga,{value:s,onValueChange:U,children:[h.jsx(sa,{className:"bg-slate-700 border-slate-600 text-white rounded-md",children:h.jsx(Wa,{placeholder:"Select device type"})}),h.jsxs(la,{className:"bg-slate-800 border-slate-700 text-white",children:[h.jsx($n,{value:"teleop",className:"hover:bg-slate-700",children:"Teleoperator (Leader)"}),h.jsx($n,{value:"robot",className:"hover:bg-slate-700",children:"Robot (Follower)"})]})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(Tt,{htmlFor:"port",className:"text-sm font-medium text-slate-300",children:"Port *"}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx(hi,{id:"port",value:c,onChange:K=>u(K.target.value),placeholder:"/dev/tty.usbmodem...",className:"bg-slate-700 border-slate-600 text-white rounded-md flex-1"}),h.jsx(Tse,{onClick:O,robotType:s==="robot"?"follower":"leader",className:"border-slate-600 hover:border-blue-500 text-slate-400 hover:text-blue-400 bg-slate-700 hover:bg-slate-600"})]})]}),h.jsx(Jl,{className:"bg-slate-700"}),h.jsx("div",{className:"flex flex-col gap-3",children:E.calibration_active?h.jsxs(et,{onClick:D,variant:"destructive",className:"w-full rounded-full py-6 text-lg",children:[h.jsx(Od,{className:"w-5 h-5 mr-2"}),"Cancel Calibration"]}):h.jsxs(et,{onClick:R,className:"w-full bg-blue-600 hover:bg-blue-700 text-white rounded-full py-6 text-lg",disabled:!n||!s||!c,children:[h.jsx(Tc,{className:"w-5 h-5 mr-2"}),"Start Calibration"]})}),d&&h.jsxs("div",{className:"space-y-2 pt-2",children:[h.jsx("div",{className:"text-sm font-medium text-slate-300",children:"Robot calibration"}),h.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[d.leader_config?h.jsx(qi,{className:"w-4 h-4 text-green-400"}):h.jsx(fE,{className:"w-4 h-4 text-slate-500"}),h.jsx("span",{className:d.leader_config?"text-slate-200":"text-slate-400",children:"Leader (Teleoperator)"})]}),h.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[d.follower_config?h.jsx(qi,{className:"w-4 h-4 text-green-400"}):h.jsx(fE,{className:"w-4 h-4 text-slate-500"}),h.jsx("span",{className:d.follower_config?"text-slate-200":"text-slate-400",children:"Follower (Robot)"})]})]})]})]}),h.jsxs(Gr,{className:"bg-slate-800/60 border-slate-700 backdrop-blur-sm",children:[h.jsx(jo,{children:h.jsxs(ga,{className:"flex items-center gap-2 text-slate-200",children:[h.jsx($u,{className:"w-5 h-5 text-teal-400"}),"Status"]})}),h.jsxs(Wr,{className:"space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between p-3 bg-slate-900/50 rounded-md",children:[h.jsx("span",{className:"text-slate-300",children:"Status:"}),h.jsxs(w1,{className:`${j.color} text-white rounded-md`,children:[j.icon,h.jsx("span",{className:"ml-2",children:j.text})]})]}),E.status==="recording"&&E.recorded_ranges&&h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx($u,{className:"w-4 h-4 text-purple-400"}),h.jsx("span",{className:"text-sm font-medium text-slate-300",children:"Live Position Data"})]}),h.jsx("div",{className:"bg-slate-800 rounded-lg p-4 border border-slate-700",children:h.jsx("div",{className:"space-y-3",children:Object.entries(E.recorded_ranges).map(([K,F])=>{const Y=F.max-F.min,q=F.current-F.min,ee=Y>0?q/Y*100:50,te=w2(E.device_type,K,Y);return h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-white font-semibold text-sm",children:K}),te&&h.jsx(qi,{className:"w-4 h-4 text-green-400","aria-label":"Range complete"})]}),h.jsx("span",{className:"text-slate-300 text-xs font-mono",children:F.current})]}),h.jsxs("div",{className:"relative",children:[h.jsx("div",{className:"w-full bg-slate-700 rounded-full h-3",children:h.jsx("div",{className:"bg-slate-600 h-3 rounded-full relative",style:{width:"100%"},children:h.jsx("div",{className:`absolute top-0 w-1 h-3 rounded-full transition-all duration-100 ${te?"bg-green-400":"bg-yellow-400"}`,style:{left:`${Math.max(0,Math.min(100,ee))}%`,transform:"translateX(-50%)"}})})}),h.jsxs("div",{className:"flex justify-between text-xs text-slate-400 mt-1",children:[h.jsx("span",{children:F.min}),h.jsx("span",{children:F.max})]})]})]},K)})})})]}),E.status==="connecting"&&h.jsxs(Mi,{className:"bg-yellow-900/50 border-yellow-700 text-yellow-200",children:[h.jsx(td,{className:"h-4 w-4"}),h.jsx(Ai,{children:"Connecting to the device. Please ensure it's connected."})]}),E.status==="recording"&&(()=>{const K=E.recorded_ranges??{},F=Object.entries(K),Y=F.length>0&&F.every(([q,ee])=>w2(E.device_type,q,ee.max-ee.min));return h.jsxs("div",{className:"space-y-3",children:[h.jsx("div",{className:"flex justify-center",children:h.jsxs(et,{onClick:k,disabled:!E.calibration_active,className:`px-8 py-3 rounded-full transition-colors ${Y?"bg-green-600 hover:bg-green-700":"bg-orange-500 hover:bg-orange-600"}`,children:[Y?h.jsx(qi,{className:"w-4 h-4 mr-2"}):h.jsx(td,{className:"w-4 h-4 mr-2"}),"Save Calibration"]})}),h.jsxs(Mi,{className:"bg-purple-900/50 border-purple-700 text-purple-200",children:[h.jsx($u,{className:"h-4 w-4"}),h.jsxs(Ai,{children:[h.jsx("strong",{children:"Important:"})," Move EACH joint through its full range. A check appears next to each joint once its range is wide enough."]})]})]})})(),E.status==="completed"&&h.jsxs(Mi,{className:"bg-green-900/50 border-green-700 text-green-200",children:[h.jsx(qi,{className:"h-4 w-4"}),h.jsx(Ai,{children:"Calibration completed successfully!"})]}),E.status==="error"&&E.error&&(E.error.startsWith(S2)?h.jsxs(Mi,{className:"bg-red-900/50 border-red-700 text-red-200",children:[h.jsx(nd,{className:"h-4 w-4"}),h.jsxs(Ai,{children:[h.jsx("div",{className:"font-semibold text-base mb-1",children:"Motor discontinuity detected"}),h.jsx("div",{children:"Make sure to start the calibration with the robot in a middle position โ€” all joints in the middle of their ranges. See the calibration demo below for the correct starting pose."})]})]}):h.jsxs(Mi,{className:"bg-red-900/50 border-red-700 text-red-200",children:[h.jsx(nd,{className:"h-4 w-4"}),h.jsxs(Ai,{children:[h.jsx("strong",{children:"Error:"})," ",E.error]})]})),h.jsxs("div",{ref:a,className:"bg-slate-900/50 p-4 rounded-lg border border-slate-700",children:[h.jsx("h4",{className:"font-semibold mb-3 text-slate-200",children:"Calibration Demo:"}),h.jsx("div",{className:"relative rounded-lg overflow-hidden bg-slate-800",children:h.jsxs("video",{className:"w-full h-auto rounded-md",controls:!0,preload:"auto",muted:!0,children:[h.jsx("source",{src:"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/lerobot/calibrate_so101_2.mp4",type:"video/mp4"}),h.jsxs("p",{className:"text-slate-400 text-sm text-center py-4",children:["Your browser does not support the video tag.",h.jsx("br",{}),h.jsx("a",{href:"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/lerobot/calibrate_so101_2.mp4",className:"text-blue-400 hover:text-blue-300 underline",target:"_blank",rel:"noopener noreferrer",children:"Click here to view the calibration video"})]})]})})]})]})]})]}),n&&h.jsxs(Gr,{className:"bg-slate-800/60 border-slate-700 backdrop-blur-sm mt-6",children:[h.jsx(jo,{children:h.jsxs(ga,{className:"flex items-center gap-2 text-slate-200",children:[h.jsx(Mh,{className:"w-5 h-5 text-blue-400"}),"Attached cameras"]})}),h.jsx(Wr,{children:h.jsx(g4,{cameras:p,onCamerasChange:m})})]})]}),h.jsx(Ase,{open:x,onOpenChange:b,robotType:S,onPortDetected:W})]})};var Dw="rovingFocusGroup.onEntryFocus",Ise={bubbles:!1,cancelable:!0},km="RovingFocusGroup",[S1,h$,Dse]=rx(km),[Lse,p$]=mi(km,[Dse]),[kse,jse]=Lse(km),m$=_.forwardRef((t,e)=>h.jsx(S1.Provider,{scope:t.__scopeRovingFocusGroup,children:h.jsx(S1.Slot,{scope:t.__scopeRovingFocusGroup,children:h.jsx(Use,{...t,ref:e})})}));m$.displayName=km;var Use=_.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=t,f=_.useRef(null),p=Ot(e,f),y=jA(o),[v,g]=$o({prop:a,defaultProp:s??null,onChange:l,caller:km}),[m,x]=_.useState(!1),b=di(c),S=h$(n),w=_.useRef(!1),[E,T]=_.useState(0);return _.useEffect(()=>{const A=f.current;if(A)return A.addEventListener(Dw,b),()=>A.removeEventListener(Dw,b)},[b]),h.jsx(kse,{scope:n,orientation:r,dir:y,loop:i,currentTabStopId:v,onItemFocus:_.useCallback(A=>g(A),[g]),onItemShiftTab:_.useCallback(()=>x(!0),[]),onFocusableItemAdd:_.useCallback(()=>T(A=>A+1),[]),onFocusableItemRemove:_.useCallback(()=>T(A=>A-1),[]),children:h.jsx(nt.div,{tabIndex:m||E===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:"none",...t.style},onMouseDown:Oe(t.onMouseDown,()=>{w.current=!0}),onFocus:Oe(t.onFocus,A=>{const M=!w.current;if(A.target===A.currentTarget&&M&&!m){const C=new CustomEvent(Dw,Ise);if(A.currentTarget.dispatchEvent(C),!C.defaultPrevented){const P=S().filter(O=>O.focusable),R=P.find(O=>O.active),D=P.find(O=>O.id===v),U=[R,D,...P].filter(Boolean).map(O=>O.ref.current);y$(U,u)}}w.current=!1}),onBlur:Oe(t.onBlur,()=>x(!1))})})}),g$="RovingFocusGroupItem",v$=_.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,children:a,...s}=t,l=sr(),c=o||l,u=jse(g$,n),d=u.currentTabStopId===c,f=h$(n),{onFocusableItemAdd:p,onFocusableItemRemove:y,currentTabStopId:v}=u;return _.useEffect(()=>{if(r)return p(),()=>y()},[r,p,y]),h.jsx(S1.ItemSlot,{scope:n,id:c,focusable:r,active:i,children:h.jsx(nt.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:e,onMouseDown:Oe(t.onMouseDown,g=>{r?u.onItemFocus(c):g.preventDefault()}),onFocus:Oe(t.onFocus,()=>u.onItemFocus(c)),onKeyDown:Oe(t.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){u.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const m=$se(g,u.orientation,u.dir);if(m!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let b=f().filter(S=>S.focusable).map(S=>S.ref.current);if(m==="last")b.reverse();else if(m==="prev"||m==="next"){m==="prev"&&b.reverse();const S=b.indexOf(g.currentTarget);b=u.loop?zse(b,S+1):b.slice(S+1)}setTimeout(()=>y$(b))}}),children:typeof a=="function"?a({isCurrentTabStop:d,hasTabStop:v!=null}):a})})});v$.displayName=g$;var Fse={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Bse(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function $se(t,e,n){const r=Bse(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Fse[r]}function y$(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function zse(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var Hse=m$,Vse=v$,E1=["Enter"," "],Gse=["ArrowDown","PageUp","Home"],x$=["ArrowUp","PageDown","End"],Wse=[...Gse,...x$],Xse={ltr:[...E1,"ArrowRight"],rtl:[...E1,"ArrowLeft"]},qse={ltr:["ArrowLeft"],rtl:["ArrowRight"]},jm="Menu",[Np,Kse,Yse]=rx(jm),[Wc,b$]=mi(jm,[Yse,El,p$]),Wx=El(),_$=p$(),[Jse,Xc]=Wc(jm),[Zse,Um]=Wc(jm),w$=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:i,onOpenChange:o,modal:a=!0}=t,s=Wx(e),[l,c]=_.useState(null),u=_.useRef(!1),d=di(o),f=jA(i);return _.useEffect(()=>{const p=()=>{u.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>u.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),h.jsx(gx,{...s,children:h.jsx(Jse,{scope:e,open:n,onOpenChange:d,content:l,onContentChange:c,children:h.jsx(Zse,{scope:e,onClose:_.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:a,children:r})})})};w$.displayName=jm;var Qse="MenuAnchor",fC=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,i=Wx(n);return h.jsx(Cm,{...i,...r,ref:e})});fC.displayName=Qse;var hC="MenuPortal",[ele,S$]=Wc(hC,{forceMount:void 0}),E$=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:i}=t,o=Xc(hC,e);return h.jsx(ele,{scope:e,forceMount:n,children:h.jsx(gi,{present:n||o.open,children:h.jsx(vf,{asChild:!0,container:i,children:r})})})};E$.displayName=hC;var to="MenuContent",[tle,pC]=Wc(to),T$=_.forwardRef((t,e)=>{const n=S$(to,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,o=Xc(to,t.__scopeMenu),a=Um(to,t.__scopeMenu);return h.jsx(Np.Provider,{scope:t.__scopeMenu,children:h.jsx(gi,{present:r||o.open,children:h.jsx(Np.Slot,{scope:t.__scopeMenu,children:a.modal?h.jsx(nle,{...i,ref:e}):h.jsx(rle,{...i,ref:e})})})})}),nle=_.forwardRef((t,e)=>{const n=Xc(to,t.__scopeMenu),r=_.useRef(null),i=Ot(e,r);return _.useEffect(()=>{const o=r.current;if(o)return cx(o)},[]),h.jsx(mC,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Oe(t.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),rle=_.forwardRef((t,e)=>{const n=Xc(to,t.__scopeMenu);return h.jsx(mC,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),ile=sl("MenuContent.ScrollLock"),mC=_.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:y,...v}=t,g=Xc(to,n),m=Um(to,n),x=Wx(n),b=_$(n),S=Kse(n),[w,E]=_.useState(null),T=_.useRef(null),A=Ot(e,T,g.onContentChange),M=_.useRef(0),C=_.useRef(""),P=_.useRef(0),R=_.useRef(null),D=_.useRef("right"),k=_.useRef(0),U=y?Mm:_.Fragment,O=y?{as:ile,allowPinchZoom:!0}:void 0,W=j=>{var Q,ce;const X=C.current+j,K=S().filter(ae=>!ae.disabled),F=document.activeElement,Y=(Q=K.find(ae=>ae.ref.current===F))==null?void 0:Q.textValue,q=K.map(ae=>ae.textValue),ee=gle(q,X,Y),te=(ce=K.find(ae=>ae.textValue===ee))==null?void 0:ce.ref.current;(function ae(fe){C.current=fe,window.clearTimeout(M.current),fe!==""&&(M.current=window.setTimeout(()=>ae(""),1e3))})(X),te&&setTimeout(()=>te.focus())};_.useEffect(()=>()=>window.clearTimeout(M.current),[]),sx();const L=_.useCallback(j=>{var K,F;return D.current===((K=R.current)==null?void 0:K.side)&&yle(j,(F=R.current)==null?void 0:F.area)},[]);return h.jsx(tle,{scope:n,searchRef:C,onItemEnter:_.useCallback(j=>{L(j)&&j.preventDefault()},[L]),onItemLeave:_.useCallback(j=>{var X;L(j)||((X=T.current)==null||X.focus(),E(null))},[L]),onTriggerLeave:_.useCallback(j=>{L(j)&&j.preventDefault()},[L]),pointerGraceTimerRef:P,onPointerGraceIntentChange:_.useCallback(j=>{R.current=j},[]),children:h.jsx(U,{...O,children:h.jsx(Tm,{asChild:!0,trapped:i,onMountAutoFocus:Oe(o,j=>{var X;j.preventDefault(),(X=T.current)==null||X.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:h.jsx(zc,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:h.jsx(Hse,{asChild:!0,...b,dir:m.dir,orientation:"vertical",loop:r,currentTabStopId:w,onCurrentTabStopIdChange:E,onEntryFocus:Oe(l,j=>{m.isUsingKeyboardRef.current||j.preventDefault()}),preventScrollOnEntryFocus:!0,children:h.jsx(vx,{role:"menu","aria-orientation":"vertical","data-state":$$(g.open),"data-radix-menu-content":"",dir:m.dir,...x,...v,ref:A,style:{outline:"none",...v.style},onKeyDown:Oe(v.onKeyDown,j=>{const K=j.target.closest("[data-radix-menu-content]")===j.currentTarget,F=j.ctrlKey||j.altKey||j.metaKey,Y=j.key.length===1;K&&(j.key==="Tab"&&j.preventDefault(),!F&&Y&&W(j.key));const q=T.current;if(j.target!==q||!Wse.includes(j.key))return;j.preventDefault();const te=S().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);x$.includes(j.key)&&te.reverse(),ple(te)}),onBlur:Oe(t.onBlur,j=>{j.currentTarget.contains(j.target)||(window.clearTimeout(M.current),C.current="")}),onPointerMove:Oe(t.onPointerMove,Op(j=>{const X=j.target,K=k.current!==j.clientX;if(j.currentTarget.contains(X)&&K){const F=j.clientX>k.current?"right":"left";D.current=F,k.current=j.clientX}}))})})})})})})});T$.displayName=to;var ole="MenuGroup",gC=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return h.jsx(nt.div,{role:"group",...r,ref:e})});gC.displayName=ole;var ale="MenuLabel",M$=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return h.jsx(nt.div,{...r,ref:e})});M$.displayName=ale;var Ly="MenuItem",E2="menu.itemSelect",Xx=_.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...i}=t,o=_.useRef(null),a=Um(Ly,t.__scopeMenu),s=pC(Ly,t.__scopeMenu),l=Ot(e,o),c=_.useRef(!1),u=()=>{const d=o.current;if(!n&&d){const f=new CustomEvent(E2,{bubbles:!0,cancelable:!0});d.addEventListener(E2,p=>r==null?void 0:r(p),{once:!0}),JM(d,f),f.defaultPrevented?c.current=!1:a.onClose()}};return h.jsx(A$,{...i,ref:l,disabled:n,onClick:Oe(t.onClick,u),onPointerDown:d=>{var f;(f=t.onPointerDown)==null||f.call(t,d),c.current=!0},onPointerUp:Oe(t.onPointerUp,d=>{var f;c.current||(f=d.currentTarget)==null||f.click()}),onKeyDown:Oe(t.onKeyDown,d=>{const f=s.searchRef.current!=="";n||f&&d.key===" "||E1.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});Xx.displayName=Ly;var A$=_.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=t,a=pC(Ly,n),s=_$(n),l=_.useRef(null),c=Ot(e,l),[u,d]=_.useState(!1),[f,p]=_.useState("");return _.useEffect(()=>{const y=l.current;y&&p((y.textContent??"").trim())},[o.children]),h.jsx(Np.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:h.jsx(Vse,{asChild:!0,...s,focusable:!r,children:h.jsx(nt.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:c,onPointerMove:Oe(t.onPointerMove,Op(y=>{r?a.onItemLeave(y):(a.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Oe(t.onPointerLeave,Op(y=>a.onItemLeave(y))),onFocus:Oe(t.onFocus,()=>d(!0)),onBlur:Oe(t.onBlur,()=>d(!1))})})})}),sle="MenuCheckboxItem",C$=_.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...i}=t;return h.jsx(I$,{scope:t.__scopeMenu,checked:n,children:h.jsx(Xx,{role:"menuitemcheckbox","aria-checked":ky(n)?"mixed":n,...i,ref:e,"data-state":yC(n),onSelect:Oe(i.onSelect,()=>r==null?void 0:r(ky(n)?!0:!n),{checkForDefaultPrevented:!1})})})});C$.displayName=sle;var P$="MenuRadioGroup",[lle,cle]=Wc(P$,{value:void 0,onValueChange:()=>{}}),R$=_.forwardRef((t,e)=>{const{value:n,onValueChange:r,...i}=t,o=di(r);return h.jsx(lle,{scope:t.__scopeMenu,value:n,onValueChange:o,children:h.jsx(gC,{...i,ref:e})})});R$.displayName=P$;var N$="MenuRadioItem",O$=_.forwardRef((t,e)=>{const{value:n,...r}=t,i=cle(N$,t.__scopeMenu),o=n===i.value;return h.jsx(I$,{scope:t.__scopeMenu,checked:o,children:h.jsx(Xx,{role:"menuitemradio","aria-checked":o,...r,ref:e,"data-state":yC(o),onSelect:Oe(r.onSelect,()=>{var a;return(a=i.onValueChange)==null?void 0:a.call(i,n)},{checkForDefaultPrevented:!1})})})});O$.displayName=N$;var vC="MenuItemIndicator",[I$,ule]=Wc(vC,{checked:!1}),D$=_.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...i}=t,o=ule(vC,n);return h.jsx(gi,{present:r||ky(o.checked)||o.checked===!0,children:h.jsx(nt.span,{...i,ref:e,"data-state":yC(o.checked)})})});D$.displayName=vC;var dle="MenuSeparator",L$=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return h.jsx(nt.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});L$.displayName=dle;var fle="MenuArrow",k$=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,i=Wx(n);return h.jsx(yx,{...i,...r,ref:e})});k$.displayName=fle;var hle="MenuSub",[RDe,j$]=Wc(hle),Oh="MenuSubTrigger",U$=_.forwardRef((t,e)=>{const n=Xc(Oh,t.__scopeMenu),r=Um(Oh,t.__scopeMenu),i=j$(Oh,t.__scopeMenu),o=pC(Oh,t.__scopeMenu),a=_.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:l}=o,c={__scopeMenu:t.__scopeMenu},u=_.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return _.useEffect(()=>u,[u]),_.useEffect(()=>{const d=s.current;return()=>{window.clearTimeout(d),l(null)}},[s,l]),h.jsx(fC,{asChild:!0,...c,children:h.jsx(A$,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":$$(n.open),...t,ref:is(e,i.onTriggerChange),onClick:d=>{var f;(f=t.onClick)==null||f.call(t,d),!(t.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Oe(t.onPointerMove,Op(d=>{o.onItemEnter(d),!d.defaultPrevented&&!t.disabled&&!n.open&&!a.current&&(o.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:Oe(t.onPointerLeave,Op(d=>{var p,y;u();const f=(p=n.content)==null?void 0:p.getBoundingClientRect();if(f){const v=(y=n.content)==null?void 0:y.dataset.side,g=v==="right",m=g?-5:5,x=f[g?"left":"right"],b=f[g?"right":"left"];o.onPointerGraceIntentChange({area:[{x:d.clientX+m,y:d.clientY},{x,y:f.top},{x:b,y:f.top},{x:b,y:f.bottom},{x,y:f.bottom}],side:v}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(d),d.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Oe(t.onKeyDown,d=>{var p;const f=o.searchRef.current!=="";t.disabled||f&&d.key===" "||Xse[r.dir].includes(d.key)&&(n.onOpenChange(!0),(p=n.content)==null||p.focus(),d.preventDefault())})})})});U$.displayName=Oh;var F$="MenuSubContent",B$=_.forwardRef((t,e)=>{const n=S$(to,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,o=Xc(to,t.__scopeMenu),a=Um(to,t.__scopeMenu),s=j$(F$,t.__scopeMenu),l=_.useRef(null),c=Ot(e,l);return h.jsx(Np.Provider,{scope:t.__scopeMenu,children:h.jsx(gi,{present:r||o.open,children:h.jsx(Np.Slot,{scope:t.__scopeMenu,children:h.jsx(mC,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:c,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var d;a.isUsingKeyboardRef.current&&((d=l.current)==null||d.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:Oe(t.onFocusOutside,u=>{u.target!==s.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Oe(t.onEscapeKeyDown,u=>{a.onClose(),u.preventDefault()}),onKeyDown:Oe(t.onKeyDown,u=>{var p;const d=u.currentTarget.contains(u.target),f=qse[a.dir].includes(u.key);d&&f&&(o.onOpenChange(!1),(p=s.trigger)==null||p.focus(),u.preventDefault())})})})})})});B$.displayName=F$;function $$(t){return t?"open":"closed"}function ky(t){return t==="indeterminate"}function yC(t){return ky(t)?"indeterminate":t?"checked":"unchecked"}function ple(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function mle(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function gle(t,e,n){const i=e.length>1&&Array.from(e).every(c=>c===e[0])?e[0]:e,o=n?t.indexOf(n):-1;let a=mle(t,Math.max(o,0));i.length===1&&(a=a.filter(c=>c!==n));const l=a.find(c=>c.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function vle(t,e){const{x:n,y:r}=t;let i=!1;for(let o=0,a=e.length-1;or!=f>r&&n<(d-c)*(r-u)/(f-u)+c&&(i=!i)}return i}function yle(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return vle(n,e)}function Op(t){return e=>e.pointerType==="mouse"?t(e):void 0}var xle=w$,ble=fC,_le=E$,wle=T$,Sle=gC,Ele=M$,Tle=Xx,Mle=C$,Ale=R$,Cle=O$,Ple=D$,Rle=L$,Nle=k$,Ole=U$,Ile=B$,qx="DropdownMenu",[Dle,NDe]=mi(qx,[b$]),Zr=b$(),[Lle,z$]=Dle(qx),H$=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:i,defaultOpen:o,onOpenChange:a,modal:s=!0}=t,l=Zr(e),c=_.useRef(null),[u,d]=$o({prop:i,defaultProp:o??!1,onChange:a,caller:qx});return h.jsx(Lle,{scope:e,triggerId:sr(),triggerRef:c,contentId:sr(),open:u,onOpenChange:d,onOpenToggle:_.useCallback(()=>d(f=>!f),[d]),modal:s,children:h.jsx(xle,{...l,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};H$.displayName=qx;var V$="DropdownMenuTrigger",G$=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=t,o=z$(V$,n),a=Zr(n);return h.jsx(ble,{asChild:!0,...a,children:h.jsx(nt.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:is(e,o.triggerRef),onPointerDown:Oe(t.onPointerDown,s=>{!r&&s.button===0&&s.ctrlKey===!1&&(o.onOpenToggle(),o.open||s.preventDefault())}),onKeyDown:Oe(t.onKeyDown,s=>{r||(["Enter"," "].includes(s.key)&&o.onOpenToggle(),s.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})})});G$.displayName=V$;var kle="DropdownMenuPortal",W$=t=>{const{__scopeDropdownMenu:e,...n}=t,r=Zr(e);return h.jsx(_le,{...r,...n})};W$.displayName=kle;var X$="DropdownMenuContent",q$=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=z$(X$,n),o=Zr(n),a=_.useRef(!1);return h.jsx(wle,{id:i.contentId,"aria-labelledby":i.triggerId,...o,...r,ref:e,onCloseAutoFocus:Oe(t.onCloseAutoFocus,s=>{var l;a.current||(l=i.triggerRef.current)==null||l.focus(),a.current=!1,s.preventDefault()}),onInteractOutside:Oe(t.onInteractOutside,s=>{const l=s.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;(!i.modal||u)&&(a.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});q$.displayName=X$;var jle="DropdownMenuGroup",Ule=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(Sle,{...i,...r,ref:e})});Ule.displayName=jle;var Fle="DropdownMenuLabel",K$=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(Ele,{...i,...r,ref:e})});K$.displayName=Fle;var Ble="DropdownMenuItem",Y$=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(Tle,{...i,...r,ref:e})});Y$.displayName=Ble;var $le="DropdownMenuCheckboxItem",J$=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(Mle,{...i,...r,ref:e})});J$.displayName=$le;var zle="DropdownMenuRadioGroup",Hle=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(Ale,{...i,...r,ref:e})});Hle.displayName=zle;var Vle="DropdownMenuRadioItem",Z$=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(Cle,{...i,...r,ref:e})});Z$.displayName=Vle;var Gle="DropdownMenuItemIndicator",Q$=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(Ple,{...i,...r,ref:e})});Q$.displayName=Gle;var Wle="DropdownMenuSeparator",ez=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(Rle,{...i,...r,ref:e})});ez.displayName=Wle;var Xle="DropdownMenuArrow",qle=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(Nle,{...i,...r,ref:e})});qle.displayName=Xle;var Kle="DropdownMenuSubTrigger",tz=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(Ole,{...i,...r,ref:e})});tz.displayName=Kle;var Yle="DropdownMenuSubContent",nz=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(Ile,{...i,...r,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});nz.displayName=Yle;var Jle=H$,Zle=G$,Qle=W$,rz=q$,iz=K$,oz=Y$,az=J$,sz=Z$,lz=Q$,cz=ez,uz=tz,dz=nz;const ece=Jle,tce=Zle,nce=_.forwardRef(({className:t,inset:e,children:n,...r},i)=>h.jsxs(uz,{ref:i,className:He("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",e&&"pl-8",t),...r,children:[n,h.jsx(bp,{className:"ml-auto h-4 w-4"})]}));nce.displayName=uz.displayName;const rce=_.forwardRef(({className:t,...e},n)=>h.jsx(dz,{ref:n,className:He("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...e}));rce.displayName=dz.displayName;const fz=_.forwardRef(({className:t,sideOffset:e=4,...n},r)=>h.jsx(Qle,{children:h.jsx(rz,{ref:r,sideOffset:e,className:He("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n})}));fz.displayName=rz.displayName;const T1=_.forwardRef(({className:t,inset:e,...n},r)=>h.jsx(oz,{ref:r,className:He("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e&&"pl-8",t),...n}));T1.displayName=oz.displayName;const ice=_.forwardRef(({className:t,children:e,checked:n,...r},i)=>h.jsxs(az,{ref:i,className:He("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:n,...r,children:[h.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:h.jsx(lz,{children:h.jsx(xl,{className:"h-4 w-4"})})}),e]}));ice.displayName=az.displayName;const oce=_.forwardRef(({className:t,children:e,...n},r)=>h.jsxs(sz,{ref:r,className:He("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[h.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:h.jsx(lz,{children:h.jsx(fE,{className:"h-2 w-2 fill-current"})})}),e]}));oce.displayName=sz.displayName;const ace=_.forwardRef(({className:t,inset:e,...n},r)=>h.jsx(iz,{ref:r,className:He("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...n}));ace.displayName=iz.displayName;const sce=_.forwardRef(({className:t,...e},n)=>h.jsx(cz,{ref:n,className:He("-mx-1 my-1 h-px bg-muted",t),...e}));sce.displayName=cz.displayName;const hz="lelab.recording.muted";let Lw=null;const lce=()=>(Lw||(Lw=new AudioContext),Lw),pz=()=>localStorage.getItem(hz)==="1",cce=t=>{localStorage.setItem(hz,t?"1":"0")},gc=(t,e,n=0)=>{if(pz())return;const r=lce(),i=r.createOscillator(),o=r.createGain();i.frequency.value=t,i.type="sine",o.gain.value=0,i.connect(o),o.connect(r.destination);const a=r.currentTime+n/1e3,s=a+e/1e3;o.gain.setValueAtTime(0,a),o.gain.linearRampToValueAtTime(.2,a+.01),o.gain.setValueAtTime(.2,s-.02),o.gain.linearRampToValueAtTime(0,s),i.start(a),i.stop(s)},uce=()=>{gc(660,80,0),gc(880,80,90)},dce=()=>{gc(660,80,0),gc(440,80,90)},fce=()=>{gc(880,70,0),gc(880,70,1e3),gc(880,70,2e3)};var mz="AlertDialog",[hce,ODe]=mi(mz,[sF]),fs=sF(),gz=t=>{const{__scopeAlertDialog:e,...n}=t,r=fs(e);return h.jsx(fA,{...r,...n,modal:!0})};gz.displayName=mz;var pce="AlertDialogTrigger",mce=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=fs(n);return h.jsx(eK,{...i,...r,ref:e})});mce.displayName=pce;var gce="AlertDialogPortal",vz=t=>{const{__scopeAlertDialog:e,...n}=t,r=fs(e);return h.jsx(hA,{...r,...n})};vz.displayName=gce;var vce="AlertDialogOverlay",yz=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=fs(n);return h.jsx(dx,{...i,...r,ref:e})});yz.displayName=vce;var dd="AlertDialogContent",[yce,xce]=hce(dd),bce=uU("AlertDialogContent"),xz=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,children:r,...i}=t,o=fs(n),a=_.useRef(null),s=Ot(e,a),l=_.useRef(null);return h.jsx(Yq,{contentName:dd,titleName:bz,docsSlug:"alert-dialog",children:h.jsx(yce,{scope:n,cancelRef:l,children:h.jsxs(fx,{role:"alertdialog",...o,...i,ref:s,onOpenAutoFocus:Oe(i.onOpenAutoFocus,c=>{var u;c.preventDefault(),(u=l.current)==null||u.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[h.jsx(bce,{children:r}),h.jsx(wce,{contentRef:a})]})})})});xz.displayName=dd;var bz="AlertDialogTitle",_z=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=fs(n);return h.jsx(pA,{...i,...r,ref:e})});_z.displayName=bz;var wz="AlertDialogDescription",Sz=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=fs(n);return h.jsx(mA,{...i,...r,ref:e})});Sz.displayName=wz;var _ce="AlertDialogAction",Ez=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=fs(n);return h.jsx(gA,{...i,...r,ref:e})});Ez.displayName=_ce;var Tz="AlertDialogCancel",Mz=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,{cancelRef:i}=xce(Tz,n),o=fs(n),a=Ot(e,i);return h.jsx(gA,{...o,...r,ref:a})});Mz.displayName=Tz;var wce=({contentRef:t})=>{const e=`\`${dd}\` requires a description for the component to be accessible for screen reader users. + `,title:`Find ${e||"robot"} port automatically`,children:[h.jsx(aA,{className:"w-3 h-3 mr-1"}),"Find"]}),Ise=2e3,Dse=({open:t,onOpenChange:e,robotType:n,onPortDetected:r})=>{const[i,o]=_.useState("detecting"),[a,s]=_.useState(""),[l,c]=_.useState(""),u=_.useRef(!1),d=_.useRef(null),f=_.useRef(null),{toast:p}=_r(),{baseUrl:y,fetchWithHeaders:v}=Dn(),g=async()=>{try{d.current=new AbortController;const E=await(await v(`${y}/start-port-detection`,{method:"POST",body:JSON.stringify({robot_type:n}),signal:d.current.signal})).json();if(u.current)return;if(E.status!=="success")throw new Error(E.message||"Failed to start port detection");const T=E.data.ports_before;for(;!u.current;){d.current=new AbortController;const M=await(await v(`${y}/detect-port-after-disconnect`,{method:"POST",body:JSON.stringify({ports_before:T}),signal:d.current.signal})).json();if(u.current)return;if(M.status==="success"){if(s(M.port),await m(M.port),u.current)return;o("success"),p({title:"Port Detected Successfully",description:`${n} port detected: ${M.port}`}),f.current=window.setTimeout(()=>{u.current||(r(M.port),e(!1))},Ise);return}const C=typeof M.message=="string"?M.message:"";if(!C.includes("Timed out"))throw new Error(C||"Failed to detect port")}}catch(w){if(u.current||w instanceof DOMException&&w.name==="AbortError")return;console.error("Port detection failed:",w),c(w instanceof Error?w.message:"Unknown error"),o("error")}},m=async w=>{try{await v(`${y}/save-robot-port`,{method:"POST",body:JSON.stringify({robot_type:n,port:w})})}catch(E){console.error("Error saving port:",E)}};_.useEffect(()=>{if(t)return u.current=!1,o("detecting"),c(""),s(""),g(),()=>{var w;u.current=!0,(w=d.current)==null||w.abort(),f.current!==null&&(window.clearTimeout(f.current),f.current=null)}},[t]);const x=()=>{e(!1)},b=()=>{var w;u.current=!1,(w=d.current)==null||w.abort(),o("detecting"),c(""),s(""),g()},S=()=>{switch(i){case"detecting":return h.jsxs("div",{className:"space-y-6 text-center",children:[h.jsx(fi,{className:"w-16 h-16 text-blue-500 mx-auto animate-spin"}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs("h3",{className:"text-lg font-semibold text-white",children:["Unplug the ",n," arm"]}),h.jsxs("p",{className:"text-gray-400",children:["Disconnect the ",n," robot arm from USB. The port will be detected automatically."]})]}),h.jsx("div",{className:"flex justify-center",children:h.jsx(Je,{onClick:x,variant:"outline",className:"border-gray-500 hover:border-gray-200 text-gray-300 hover:text-white px-8 py-2",children:"Cancel"})})]});case"success":return h.jsxs("div",{className:"space-y-6 text-center",children:[h.jsx(qi,{className:"w-16 h-16 text-green-500 mx-auto"}),h.jsxs("div",{className:"space-y-2",children:[h.jsx("h3",{className:"text-lg font-semibold text-white",children:"Port Detected"}),h.jsx("p",{className:"text-xl font-mono text-green-400 bg-gray-800 px-4 py-2 rounded inline-block",children:a})]})]});case"error":return h.jsxs("div",{className:"space-y-6 text-center",children:[h.jsx(td,{className:"w-16 h-16 text-red-500 mx-auto"}),h.jsxs("div",{className:"space-y-2",children:[h.jsx("h3",{className:"text-lg font-semibold text-white",children:"Detection Failed"}),h.jsx("div",{className:"bg-red-900/20 border border-red-800 rounded-lg p-3",children:h.jsx("p",{className:"text-red-400 text-sm",children:l})})]}),h.jsxs("div",{className:"flex gap-4 justify-center",children:[h.jsx(Je,{onClick:b,className:"bg-blue-500 hover:bg-blue-600 text-white px-8 py-2",children:"Try Again"}),h.jsx(Je,{onClick:x,variant:"outline",className:"border-gray-500 hover:border-gray-200 text-gray-300 hover:text-white px-8 py-2",children:"Cancel"})]})]});default:return null}};return h.jsx(Hc,{open:t,onOpenChange:e,children:h.jsxs(bl,{className:"bg-gray-900 border-gray-800 text-white sm:max-w-[500px] p-8",children:[h.jsxs(_l,{children:[h.jsx(wl,{className:"text-white text-center text-xl font-bold",children:"Port Detection"}),h.jsxs(Sl,{className:"text-gray-400 text-center",children:["Detect the USB port for your ",n," arm"]})]}),h.jsx("div",{className:"py-4",children:S()})]})})},Lse={shoulder_pan:2400,shoulder_lift:2300,elbow_flex:2150,wrist_flex:2250,wrist_roll:3700,gripper:1150},kse={shoulder_pan:2400,shoulder_lift:2300,elbow_flex:2150,wrist_flex:2250,wrist_roll:3700,gripper:1400},jse={teleop:Lse,robot:kse},Use=.98;function S2(t,e,n){var i;if(!t)return!1;const r=(i=jse[t])==null?void 0:i[e];return r?n>=r*Use:!1}const E2="Motor discontinuity detected",Fse=()=>{var H;const t=ji(),n=((H=yl().state)==null?void 0:H.robot_name)??null,{toast:r}=_r(),{baseUrl:i,fetchWithHeaders:o}=Dn();_.useRef(null);const a=_.useRef(null),[s,l]=_.useState("teleop"),[c,u]=_.useState(""),[d,f]=_.useState(null),[p,y]=_.useState([]),[v,g]=_.useState(!1),m=_.useRef(null),x=_.useCallback(async()=>{if(!n)return null;try{const q=await o(`${i}/robots/${encodeURIComponent(n)}`);if(!q.ok)return null;const Y=(await q.json()).robot??null;return f(Y),Y}catch(q){return console.error("Failed to load robot record:",q),null}},[n,i,o]);_.useEffect(()=>{if(!n)return;let q=!1;return(async()=>{const $=await x();if(!$||q)return;const Y=$.leader_config?$.follower_config?"teleop":"robot":"teleop";l(Y),u(Y==="teleop"?$.leader_port||"":$.follower_port||""),y($.cameras??[])})(),()=>{q=!0}},[n,x]);const b=q=>{y(q),n&&(m.current&&clearTimeout(m.current),m.current=setTimeout(async()=>{try{await o(`${i}/robots/${encodeURIComponent(n)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cameras:q})})}catch($){console.error("Failed to save cameras to robot record:",$)}},500))};_.useEffect(()=>()=>{m.current&&clearTimeout(m.current)},[]);const[S,w]=_.useState(!1),[E,T]=_.useState("leader"),[A,M]=_.useState({calibration_active:!1,status:"idle",device_type:null,error:null,message:"",step:0,total_steps:1,current_positions:null,recorded_ranges:null}),[C,P]=_.useState(!1),R=_.useRef(!1);_.useEffect(()=>{R.current=A.calibration_active},[A.calibration_active]),_.useEffect(()=>()=>{R.current&&o(`${i}/stop-calibration`,{method:"POST"}).catch(q=>console.error("Failed to stop calibration on unmount:",q))},[i,o]);const D=async()=>{try{const q=await o(`${i}/calibration-status`);if(q.ok){const $=await q.json();M($),!$.calibration_active&&($.status==="completed"||$.status==="error"||$.status==="idle")&&P(!1)}}catch(q){console.error("Error polling status:",q)}},k=async()=>{if(!n){r({title:"No robot selected",description:"Open Calibration from a robot's gear icon on the Landing page.",variant:"destructive"});return}if(!c){r({title:"Missing port",description:"Set the device's serial port before starting.",variant:"destructive"});return}const q={device_type:s,port:c,config_file:n,robot_name:n};R.current=!0;try{const Y=await(await o(`${i}/start-calibration`,{method:"POST",body:JSON.stringify(q)})).json();Y.success?(r({title:"Calibration Started",description:`Calibration started for ${s}`}),P(!0)):(R.current=!1,r({title:"Calibration Failed",description:Y.message||"Failed to start calibration",variant:"destructive"}))}catch($){R.current=!1,console.error("Error starting calibration:",$),r({title:"Error",description:"Failed to start calibration",variant:"destructive"})}},U=async()=>{try{const $=await(await o(`${i}/stop-calibration`,{method:"POST"})).json();$.success?r({title:"Calibration Stopped",description:"Calibration has been stopped"}):r({title:"Error",description:$.message||"Failed to stop calibration",variant:"destructive"})}catch(q){console.error("Error stopping calibration:",q),r({title:"Error",description:"Failed to stop calibration",variant:"destructive"})}},O=async()=>{if(A.calibration_active)try{const $=await(await o(`${i}/complete-calibration-step`,{method:"POST"})).json();$.success?r({title:"Step Completed",description:$.message}):r({title:"Step Failed",description:$.message||"Could not complete step",variant:"destructive"})}catch(q){console.error("Error completing step:",q),r({title:"Error",description:"Could not complete calibration step",variant:"destructive"})}};_.useEffect(()=>{var q,$;A.status==="error"&&((q=A.error)!=null&&q.startsWith(E2))&&(($=a.current)==null||$.scrollIntoView({behavior:"smooth",block:"center"}))},[A.status,A.error]),_.useEffect(()=>{if(!C)return;D();const q=setInterval(()=>{D()},200);return()=>clearInterval(q)},[C]),_.useEffect(()=>{(async()=>{if(s&&!n)try{const ee=await(await o(`${i}/robot-port/${s==="robot"?"follower":"leader"}`)).json();if(ee.status==="success"){const J=ee.saved_port||ee.default_port;J&&u(J)}}catch($){console.error("Error loading default port:",$)}})()},[s,n,i,o]);const X=q=>{l(q),d&&u(q==="teleop"?d.leader_port||"":d.follower_port||"")};_.useEffect(()=>{A.status==="completed"&&(async()=>{const q=await x();if(!q)return;const $=q.leader_config?q.follower_config?"teleop":"robot":"teleop";l($),u($==="teleop"?q.leader_port||"":q.follower_port||"")})()},[A.status,x]);const L=()=>{T(s==="robot"?"follower":"leader"),w(!0)},j=q=>{u(q)},te=(()=>{switch(A.status){case"idle":return{color:"bg-slate-500",icon:h.jsx(Mh,{className:"w-4 h-4"}),text:"Idle"};case"connecting":return{color:"bg-yellow-500",icon:h.jsx(fi,{className:"w-4 h-4 animate-spin"}),text:"Connecting"};case"recording":return{color:"bg-purple-500",icon:h.jsx($u,{className:"w-4 h-4"}),text:"Recording Ranges"};case"completed":return{color:"bg-green-500",icon:h.jsx(qi,{className:"w-4 h-4"}),text:"Completed"};case"error":return{color:"bg-red-500",icon:h.jsx(nd,{className:"w-4 h-4"}),text:"Error"};case"stopping":return{color:"bg-orange-500",icon:h.jsx(Od,{className:"w-4 h-4"}),text:"Stopping"};default:return{color:"bg-slate-500",icon:h.jsx(Mh,{className:"w-4 h-4"}),text:"Unknown"}}})();return h.jsxs("div",{className:"min-h-screen bg-slate-900 text-white p-4",children:[h.jsxs("div",{className:"max-w-4xl mx-auto",children:[h.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[h.jsx(Je,{variant:"ghost",size:"icon",onClick:()=>t(-1),className:"text-slate-400 hover:text-white hover:bg-slate-800",children:h.jsx(ll,{className:"w-5 h-5"})}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx(Gx,{iconOnly:!0}),h.jsx("h1",{className:"text-3xl font-bold",children:n?`Calibrate "${n}"`:"Device Calibration"})]})]}),!n&&h.jsxs(Mi,{className:"mb-6 bg-amber-900/40 border-amber-700 text-amber-100",children:[h.jsx(td,{className:"h-4 w-4"}),h.jsx(Ai,{children:"Open Calibration from a robot's gear icon on the Landing page. Each robot has its own calibration; running this page directly is not supported."})]}),h.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[h.jsxs(Gr,{className:"bg-slate-800/60 border-slate-700 backdrop-blur-sm",children:[h.jsx(Uo,{children:h.jsxs(ga,{className:"flex items-center gap-2 text-slate-200",children:[h.jsx(Mh,{className:"w-5 h-5 text-blue-400"}),"Configuration"]})}),h.jsxs(Wr,{className:"space-y-6",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(Tt,{htmlFor:"deviceType",className:"text-sm font-medium text-slate-300",children:"Device Type *"}),h.jsxs(Ga,{value:s,onValueChange:X,children:[h.jsx(sa,{className:"bg-slate-700 border-slate-600 text-white rounded-md",children:h.jsx(Wa,{placeholder:"Select device type"})}),h.jsxs(la,{className:"bg-slate-800 border-slate-700 text-white",children:[h.jsx($n,{value:"teleop",className:"hover:bg-slate-700",children:"Teleoperator (Leader)"}),h.jsx($n,{value:"robot",className:"hover:bg-slate-700",children:"Robot (Follower)"})]})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(Tt,{htmlFor:"port",className:"text-sm font-medium text-slate-300",children:"Port *"}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx(hi,{id:"port",value:c,onChange:q=>u(q.target.value),placeholder:"/dev/tty.usbmodem...",className:"bg-slate-700 border-slate-600 text-white rounded-md flex-1"}),h.jsx(Ose,{onClick:L,robotType:s==="robot"?"follower":"leader",className:"border-slate-600 hover:border-blue-500 text-slate-400 hover:text-blue-400 bg-slate-700 hover:bg-slate-600"})]})]}),h.jsx(Jl,{className:"bg-slate-700"}),h.jsx("div",{className:"flex flex-col gap-3",children:A.calibration_active?h.jsxs(Je,{onClick:U,variant:"destructive",className:"w-full rounded-full py-6 text-lg",children:[h.jsx(Od,{className:"w-5 h-5 mr-2"}),"Cancel Calibration"]}):h.jsxs(Je,{onClick:k,className:"w-full bg-blue-600 hover:bg-blue-700 text-white rounded-full py-6 text-lg",disabled:!n||!s||!c,children:[h.jsx(Tc,{className:"w-5 h-5 mr-2"}),"Start Calibration"]})}),d&&h.jsxs("div",{className:"space-y-2 pt-2",children:[h.jsx("div",{className:"text-sm font-medium text-slate-300",children:"Robot calibration"}),h.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[d.leader_config?h.jsx(qi,{className:"w-4 h-4 text-green-400"}):h.jsx(fE,{className:"w-4 h-4 text-slate-500"}),h.jsx("span",{className:d.leader_config?"text-slate-200":"text-slate-400",children:"Leader (Teleoperator)"})]}),h.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[d.follower_config?h.jsx(qi,{className:"w-4 h-4 text-green-400"}):h.jsx(fE,{className:"w-4 h-4 text-slate-500"}),h.jsx("span",{className:d.follower_config?"text-slate-200":"text-slate-400",children:"Follower (Robot)"})]})]})]})]}),h.jsxs(Gr,{className:"bg-slate-800/60 border-slate-700 backdrop-blur-sm",children:[h.jsx(Uo,{children:h.jsxs(ga,{className:"flex items-center gap-2 text-slate-200",children:[h.jsx($u,{className:"w-5 h-5 text-teal-400"}),"Status"]})}),h.jsxs(Wr,{className:"space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between p-3 bg-slate-900/50 rounded-md",children:[h.jsx("span",{className:"text-slate-300",children:"Status:"}),h.jsxs(w1,{className:`${te.color} text-white rounded-md`,children:[te.icon,h.jsx("span",{className:"ml-2",children:te.text})]})]}),A.status==="recording"&&A.recorded_ranges&&h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx($u,{className:"w-4 h-4 text-purple-400"}),h.jsx("span",{className:"text-sm font-medium text-slate-300",children:"Live Position Data"})]}),h.jsx("div",{className:"bg-slate-800 rounded-lg p-4 border border-slate-700",children:h.jsx("div",{className:"space-y-3",children:Object.entries(A.recorded_ranges).map(([q,$])=>{const Y=$.max-$.min,ee=$.current-$.min,J=Y>0?ee/Y*100:50,ce=S2(A.device_type,q,Y);return h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-white font-semibold text-sm",children:q}),ce&&h.jsx(qi,{className:"w-4 h-4 text-green-400","aria-label":"Range complete"})]}),h.jsx("span",{className:"text-slate-300 text-xs font-mono",children:$.current})]}),h.jsxs("div",{className:"relative",children:[h.jsx("div",{className:"w-full bg-slate-700 rounded-full h-3",children:h.jsx("div",{className:"bg-slate-600 h-3 rounded-full relative",style:{width:"100%"},children:h.jsx("div",{className:`absolute top-0 w-1 h-3 rounded-full transition-all duration-100 ${ce?"bg-green-400":"bg-yellow-400"}`,style:{left:`${Math.max(0,Math.min(100,J))}%`,transform:"translateX(-50%)"}})})}),h.jsxs("div",{className:"flex justify-between text-xs text-slate-400 mt-1",children:[h.jsx("span",{children:$.min}),h.jsx("span",{children:$.max})]})]})]},q)})})})]}),A.status==="connecting"&&h.jsxs(Mi,{className:"bg-yellow-900/50 border-yellow-700 text-yellow-200",children:[h.jsx(td,{className:"h-4 w-4"}),h.jsx(Ai,{children:"Connecting to the device. Please ensure it's connected."})]}),A.status==="recording"&&(()=>{const q=A.recorded_ranges??{},$=Object.entries(q),Y=$.length>0&&$.every(([ee,J])=>S2(A.device_type,ee,J.max-J.min));return h.jsxs("div",{className:"space-y-3",children:[h.jsx("div",{className:"flex justify-center",children:h.jsxs(Je,{onClick:O,disabled:!A.calibration_active,className:`px-8 py-3 rounded-full transition-colors ${Y?"bg-green-600 hover:bg-green-700":"bg-orange-500 hover:bg-orange-600"}`,children:[Y?h.jsx(qi,{className:"w-4 h-4 mr-2"}):h.jsx(td,{className:"w-4 h-4 mr-2"}),"Save Calibration"]})}),h.jsxs(Mi,{className:"bg-purple-900/50 border-purple-700 text-purple-200",children:[h.jsx($u,{className:"h-4 w-4"}),h.jsxs(Ai,{children:[h.jsx("strong",{children:"Important:"})," Move EACH joint through its full range. A check appears next to each joint once its range is wide enough."]})]})]})})(),A.status==="completed"&&h.jsxs(Mi,{className:"bg-green-900/50 border-green-700 text-green-200",children:[h.jsx(qi,{className:"h-4 w-4"}),h.jsx(Ai,{children:"Calibration completed successfully!"})]}),A.status==="error"&&A.error&&(A.error.startsWith(E2)?h.jsxs(Mi,{className:"bg-red-900/50 border-red-700 text-red-200",children:[h.jsx(nd,{className:"h-4 w-4"}),h.jsxs(Ai,{children:[h.jsx("div",{className:"font-semibold text-base mb-1",children:"Motor discontinuity detected"}),h.jsx("div",{children:"Make sure to start the calibration with the robot in a middle position โ€” all joints in the middle of their ranges. See the calibration demo below for the correct starting pose."})]})]}):h.jsxs(Mi,{className:"bg-red-900/50 border-red-700 text-red-200",children:[h.jsx(nd,{className:"h-4 w-4"}),h.jsxs(Ai,{children:[h.jsx("strong",{children:"Error:"})," ",A.error]})]})),h.jsxs("div",{ref:a,className:"bg-slate-900/50 p-4 rounded-lg border border-slate-700",children:[h.jsx("h4",{className:"font-semibold mb-3 text-slate-200",children:"Calibration Demo:"}),h.jsx("div",{className:"relative rounded-lg overflow-hidden bg-slate-800",children:h.jsxs("video",{className:"w-full h-auto rounded-md",controls:!0,preload:"auto",muted:!0,children:[h.jsx("source",{src:"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/lerobot/calibrate_so101_2.mp4",type:"video/mp4"}),h.jsxs("p",{className:"text-slate-400 text-sm text-center py-4",children:["Your browser does not support the video tag.",h.jsx("br",{}),h.jsx("a",{href:"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/lerobot/calibrate_so101_2.mp4",className:"text-blue-400 hover:text-blue-300 underline",target:"_blank",rel:"noopener noreferrer",children:"Click here to view the calibration video"})]})]})})]})]})]})]}),n&&h.jsxs(Gr,{className:"bg-slate-800/60 border-slate-700 backdrop-blur-sm mt-6",children:[h.jsxs(Uo,{className:"flex-row items-center justify-between space-y-0",children:[h.jsxs(ga,{className:"flex items-center gap-2 text-slate-200",children:[h.jsx(Mh,{className:"w-5 h-5 text-blue-400"}),"Attached cameras"]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Tt,{htmlFor:"cameras-toggle",className:"text-sm text-slate-400 cursor-pointer",children:v?"On":"Off"}),h.jsx(bo,{id:"cameras-toggle",checked:v,onCheckedChange:g,className:"data-[state=checked]:bg-green-500","aria-label":"Turn cameras on or off"})]})]}),h.jsx(Wr,{children:v?h.jsx(y4,{cameras:p,onCamerasChange:b}):h.jsxs("div",{className:"rounded-lg border border-slate-700 bg-slate-900/40 p-6 text-center space-y-3",children:[h.jsx(UU,{className:"w-10 h-10 mx-auto text-slate-500"}),h.jsxs("div",{className:"space-y-1",children:[h.jsx("p",{className:"text-slate-200 font-medium",children:"Cameras are off"}),h.jsx("p",{className:"text-sm text-slate-400 max-w-md mx-auto",children:"Turn cameras on to scan for connected devices and preview them. The browser may briefly open a camera to read device labels, and configured cameras stay active while previews are visible; your browser will ask for camera permission. Nothing is recorded."}),p.length>0&&h.jsxs("p",{className:"text-xs text-slate-500 pt-1",children:[p.length," camera",p.length===1?"":"s"," saved to this robot."]})]}),h.jsxs("p",{className:"flex items-center justify-center gap-1.5 text-xs text-slate-500",children:[h.jsx(aX,{className:"w-3.5 h-3.5"}),"You'll be asked to grant camera access."]})]})})]})]}),h.jsx(Dse,{open:S,onOpenChange:w,robotType:E,onPortDetected:j})]})};var Dw="rovingFocusGroup.onEntryFocus",Bse={bubbles:!1,cancelable:!0},km="RovingFocusGroup",[S1,_$,$se]=rx(km),[zse,w$]=mi(km,[$se]),[Hse,Vse]=zse(km),S$=_.forwardRef((t,e)=>h.jsx(S1.Provider,{scope:t.__scopeRovingFocusGroup,children:h.jsx(S1.Slot,{scope:t.__scopeRovingFocusGroup,children:h.jsx(Gse,{...t,ref:e})})}));S$.displayName=km;var Gse=_.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=t,f=_.useRef(null),p=Ot(e,f),y=UA(o),[v,g]=zo({prop:a,defaultProp:s??null,onChange:l,caller:km}),[m,x]=_.useState(!1),b=di(c),S=_$(n),w=_.useRef(!1),[E,T]=_.useState(0);return _.useEffect(()=>{const A=f.current;if(A)return A.addEventListener(Dw,b),()=>A.removeEventListener(Dw,b)},[b]),h.jsx(Hse,{scope:n,orientation:r,dir:y,loop:i,currentTabStopId:v,onItemFocus:_.useCallback(A=>g(A),[g]),onItemShiftTab:_.useCallback(()=>x(!0),[]),onFocusableItemAdd:_.useCallback(()=>T(A=>A+1),[]),onFocusableItemRemove:_.useCallback(()=>T(A=>A-1),[]),children:h.jsx(nt.div,{tabIndex:m||E===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:"none",...t.style},onMouseDown:Oe(t.onMouseDown,()=>{w.current=!0}),onFocus:Oe(t.onFocus,A=>{const M=!w.current;if(A.target===A.currentTarget&&M&&!m){const C=new CustomEvent(Dw,Bse);if(A.currentTarget.dispatchEvent(C),!C.defaultPrevented){const P=S().filter(O=>O.focusable),R=P.find(O=>O.active),D=P.find(O=>O.id===v),U=[R,D,...P].filter(Boolean).map(O=>O.ref.current);M$(U,u)}}w.current=!1}),onBlur:Oe(t.onBlur,()=>x(!1))})})}),E$="RovingFocusGroupItem",T$=_.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,children:a,...s}=t,l=sr(),c=o||l,u=Vse(E$,n),d=u.currentTabStopId===c,f=_$(n),{onFocusableItemAdd:p,onFocusableItemRemove:y,currentTabStopId:v}=u;return _.useEffect(()=>{if(r)return p(),()=>y()},[r,p,y]),h.jsx(S1.ItemSlot,{scope:n,id:c,focusable:r,active:i,children:h.jsx(nt.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:e,onMouseDown:Oe(t.onMouseDown,g=>{r?u.onItemFocus(c):g.preventDefault()}),onFocus:Oe(t.onFocus,()=>u.onItemFocus(c)),onKeyDown:Oe(t.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){u.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const m=qse(g,u.orientation,u.dir);if(m!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let b=f().filter(S=>S.focusable).map(S=>S.ref.current);if(m==="last")b.reverse();else if(m==="prev"||m==="next"){m==="prev"&&b.reverse();const S=b.indexOf(g.currentTarget);b=u.loop?Kse(b,S+1):b.slice(S+1)}setTimeout(()=>M$(b))}}),children:typeof a=="function"?a({isCurrentTabStop:d,hasTabStop:v!=null}):a})})});T$.displayName=E$;var Wse={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Xse(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function qse(t,e,n){const r=Xse(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Wse[r]}function M$(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function Kse(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var Yse=S$,Jse=T$,E1=["Enter"," "],Zse=["ArrowDown","PageUp","Home"],A$=["ArrowUp","PageDown","End"],Qse=[...Zse,...A$],ele={ltr:[...E1,"ArrowRight"],rtl:[...E1,"ArrowLeft"]},tle={ltr:["ArrowLeft"],rtl:["ArrowRight"]},jm="Menu",[Np,nle,rle]=rx(jm),[Wc,C$]=mi(jm,[rle,El,w$]),Xx=El(),P$=w$(),[ile,Xc]=Wc(jm),[ole,Um]=Wc(jm),R$=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:i,onOpenChange:o,modal:a=!0}=t,s=Xx(e),[l,c]=_.useState(null),u=_.useRef(!1),d=di(o),f=UA(i);return _.useEffect(()=>{const p=()=>{u.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>u.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),h.jsx(gx,{...s,children:h.jsx(ile,{scope:e,open:n,onOpenChange:d,content:l,onContentChange:c,children:h.jsx(ole,{scope:e,onClose:_.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:a,children:r})})})};R$.displayName=jm;var ale="MenuAnchor",hC=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,i=Xx(n);return h.jsx(Cm,{...i,...r,ref:e})});hC.displayName=ale;var pC="MenuPortal",[sle,N$]=Wc(pC,{forceMount:void 0}),O$=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:i}=t,o=Xc(pC,e);return h.jsx(sle,{scope:e,forceMount:n,children:h.jsx(gi,{present:n||o.open,children:h.jsx(vf,{asChild:!0,container:i,children:r})})})};O$.displayName=pC;var to="MenuContent",[lle,mC]=Wc(to),I$=_.forwardRef((t,e)=>{const n=N$(to,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,o=Xc(to,t.__scopeMenu),a=Um(to,t.__scopeMenu);return h.jsx(Np.Provider,{scope:t.__scopeMenu,children:h.jsx(gi,{present:r||o.open,children:h.jsx(Np.Slot,{scope:t.__scopeMenu,children:a.modal?h.jsx(cle,{...i,ref:e}):h.jsx(ule,{...i,ref:e})})})})}),cle=_.forwardRef((t,e)=>{const n=Xc(to,t.__scopeMenu),r=_.useRef(null),i=Ot(e,r);return _.useEffect(()=>{const o=r.current;if(o)return cx(o)},[]),h.jsx(gC,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Oe(t.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),ule=_.forwardRef((t,e)=>{const n=Xc(to,t.__scopeMenu);return h.jsx(gC,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),dle=sl("MenuContent.ScrollLock"),gC=_.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:y,...v}=t,g=Xc(to,n),m=Um(to,n),x=Xx(n),b=P$(n),S=nle(n),[w,E]=_.useState(null),T=_.useRef(null),A=Ot(e,T,g.onContentChange),M=_.useRef(0),C=_.useRef(""),P=_.useRef(0),R=_.useRef(null),D=_.useRef("right"),k=_.useRef(0),U=y?Mm:_.Fragment,O=y?{as:dle,allowPinchZoom:!0}:void 0,X=j=>{var J,ce;const K=C.current+j,te=S().filter(ae=>!ae.disabled),H=document.activeElement,q=(J=te.find(ae=>ae.ref.current===H))==null?void 0:J.textValue,$=te.map(ae=>ae.textValue),Y=Sle($,K,q),ee=(ce=te.find(ae=>ae.textValue===Y))==null?void 0:ce.ref.current;(function ae(fe){C.current=fe,window.clearTimeout(M.current),fe!==""&&(M.current=window.setTimeout(()=>ae(""),1e3))})(K),ee&&setTimeout(()=>ee.focus())};_.useEffect(()=>()=>window.clearTimeout(M.current),[]),sx();const L=_.useCallback(j=>{var te,H;return D.current===((te=R.current)==null?void 0:te.side)&&Tle(j,(H=R.current)==null?void 0:H.area)},[]);return h.jsx(lle,{scope:n,searchRef:C,onItemEnter:_.useCallback(j=>{L(j)&&j.preventDefault()},[L]),onItemLeave:_.useCallback(j=>{var K;L(j)||((K=T.current)==null||K.focus(),E(null))},[L]),onTriggerLeave:_.useCallback(j=>{L(j)&&j.preventDefault()},[L]),pointerGraceTimerRef:P,onPointerGraceIntentChange:_.useCallback(j=>{R.current=j},[]),children:h.jsx(U,{...O,children:h.jsx(Tm,{asChild:!0,trapped:i,onMountAutoFocus:Oe(o,j=>{var K;j.preventDefault(),(K=T.current)==null||K.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:h.jsx(zc,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:h.jsx(Yse,{asChild:!0,...b,dir:m.dir,orientation:"vertical",loop:r,currentTabStopId:w,onCurrentTabStopIdChange:E,onEntryFocus:Oe(l,j=>{m.isUsingKeyboardRef.current||j.preventDefault()}),preventScrollOnEntryFocus:!0,children:h.jsx(vx,{role:"menu","aria-orientation":"vertical","data-state":K$(g.open),"data-radix-menu-content":"",dir:m.dir,...x,...v,ref:A,style:{outline:"none",...v.style},onKeyDown:Oe(v.onKeyDown,j=>{const te=j.target.closest("[data-radix-menu-content]")===j.currentTarget,H=j.ctrlKey||j.altKey||j.metaKey,q=j.key.length===1;te&&(j.key==="Tab"&&j.preventDefault(),!H&&q&&X(j.key));const $=T.current;if(j.target!==$||!Qse.includes(j.key))return;j.preventDefault();const ee=S().filter(J=>!J.disabled).map(J=>J.ref.current);A$.includes(j.key)&&ee.reverse(),_le(ee)}),onBlur:Oe(t.onBlur,j=>{j.currentTarget.contains(j.target)||(window.clearTimeout(M.current),C.current="")}),onPointerMove:Oe(t.onPointerMove,Op(j=>{const K=j.target,te=k.current!==j.clientX;if(j.currentTarget.contains(K)&&te){const H=j.clientX>k.current?"right":"left";D.current=H,k.current=j.clientX}}))})})})})})})});I$.displayName=to;var fle="MenuGroup",vC=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return h.jsx(nt.div,{role:"group",...r,ref:e})});vC.displayName=fle;var hle="MenuLabel",D$=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return h.jsx(nt.div,{...r,ref:e})});D$.displayName=hle;var Ly="MenuItem",T2="menu.itemSelect",qx=_.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...i}=t,o=_.useRef(null),a=Um(Ly,t.__scopeMenu),s=mC(Ly,t.__scopeMenu),l=Ot(e,o),c=_.useRef(!1),u=()=>{const d=o.current;if(!n&&d){const f=new CustomEvent(T2,{bubbles:!0,cancelable:!0});d.addEventListener(T2,p=>r==null?void 0:r(p),{once:!0}),JM(d,f),f.defaultPrevented?c.current=!1:a.onClose()}};return h.jsx(L$,{...i,ref:l,disabled:n,onClick:Oe(t.onClick,u),onPointerDown:d=>{var f;(f=t.onPointerDown)==null||f.call(t,d),c.current=!0},onPointerUp:Oe(t.onPointerUp,d=>{var f;c.current||(f=d.currentTarget)==null||f.click()}),onKeyDown:Oe(t.onKeyDown,d=>{const f=s.searchRef.current!=="";n||f&&d.key===" "||E1.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});qx.displayName=Ly;var L$=_.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=t,a=mC(Ly,n),s=P$(n),l=_.useRef(null),c=Ot(e,l),[u,d]=_.useState(!1),[f,p]=_.useState("");return _.useEffect(()=>{const y=l.current;y&&p((y.textContent??"").trim())},[o.children]),h.jsx(Np.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:h.jsx(Jse,{asChild:!0,...s,focusable:!r,children:h.jsx(nt.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:c,onPointerMove:Oe(t.onPointerMove,Op(y=>{r?a.onItemLeave(y):(a.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Oe(t.onPointerLeave,Op(y=>a.onItemLeave(y))),onFocus:Oe(t.onFocus,()=>d(!0)),onBlur:Oe(t.onBlur,()=>d(!1))})})})}),ple="MenuCheckboxItem",k$=_.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...i}=t;return h.jsx($$,{scope:t.__scopeMenu,checked:n,children:h.jsx(qx,{role:"menuitemcheckbox","aria-checked":ky(n)?"mixed":n,...i,ref:e,"data-state":xC(n),onSelect:Oe(i.onSelect,()=>r==null?void 0:r(ky(n)?!0:!n),{checkForDefaultPrevented:!1})})})});k$.displayName=ple;var j$="MenuRadioGroup",[mle,gle]=Wc(j$,{value:void 0,onValueChange:()=>{}}),U$=_.forwardRef((t,e)=>{const{value:n,onValueChange:r,...i}=t,o=di(r);return h.jsx(mle,{scope:t.__scopeMenu,value:n,onValueChange:o,children:h.jsx(vC,{...i,ref:e})})});U$.displayName=j$;var F$="MenuRadioItem",B$=_.forwardRef((t,e)=>{const{value:n,...r}=t,i=gle(F$,t.__scopeMenu),o=n===i.value;return h.jsx($$,{scope:t.__scopeMenu,checked:o,children:h.jsx(qx,{role:"menuitemradio","aria-checked":o,...r,ref:e,"data-state":xC(o),onSelect:Oe(r.onSelect,()=>{var a;return(a=i.onValueChange)==null?void 0:a.call(i,n)},{checkForDefaultPrevented:!1})})})});B$.displayName=F$;var yC="MenuItemIndicator",[$$,vle]=Wc(yC,{checked:!1}),z$=_.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...i}=t,o=vle(yC,n);return h.jsx(gi,{present:r||ky(o.checked)||o.checked===!0,children:h.jsx(nt.span,{...i,ref:e,"data-state":xC(o.checked)})})});z$.displayName=yC;var yle="MenuSeparator",H$=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return h.jsx(nt.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});H$.displayName=yle;var xle="MenuArrow",V$=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,i=Xx(n);return h.jsx(yx,{...i,...r,ref:e})});V$.displayName=xle;var ble="MenuSub",[DDe,G$]=Wc(ble),Oh="MenuSubTrigger",W$=_.forwardRef((t,e)=>{const n=Xc(Oh,t.__scopeMenu),r=Um(Oh,t.__scopeMenu),i=G$(Oh,t.__scopeMenu),o=mC(Oh,t.__scopeMenu),a=_.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:l}=o,c={__scopeMenu:t.__scopeMenu},u=_.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return _.useEffect(()=>u,[u]),_.useEffect(()=>{const d=s.current;return()=>{window.clearTimeout(d),l(null)}},[s,l]),h.jsx(hC,{asChild:!0,...c,children:h.jsx(L$,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":K$(n.open),...t,ref:is(e,i.onTriggerChange),onClick:d=>{var f;(f=t.onClick)==null||f.call(t,d),!(t.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Oe(t.onPointerMove,Op(d=>{o.onItemEnter(d),!d.defaultPrevented&&!t.disabled&&!n.open&&!a.current&&(o.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:Oe(t.onPointerLeave,Op(d=>{var p,y;u();const f=(p=n.content)==null?void 0:p.getBoundingClientRect();if(f){const v=(y=n.content)==null?void 0:y.dataset.side,g=v==="right",m=g?-5:5,x=f[g?"left":"right"],b=f[g?"right":"left"];o.onPointerGraceIntentChange({area:[{x:d.clientX+m,y:d.clientY},{x,y:f.top},{x:b,y:f.top},{x:b,y:f.bottom},{x,y:f.bottom}],side:v}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(d),d.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Oe(t.onKeyDown,d=>{var p;const f=o.searchRef.current!=="";t.disabled||f&&d.key===" "||ele[r.dir].includes(d.key)&&(n.onOpenChange(!0),(p=n.content)==null||p.focus(),d.preventDefault())})})})});W$.displayName=Oh;var X$="MenuSubContent",q$=_.forwardRef((t,e)=>{const n=N$(to,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,o=Xc(to,t.__scopeMenu),a=Um(to,t.__scopeMenu),s=G$(X$,t.__scopeMenu),l=_.useRef(null),c=Ot(e,l);return h.jsx(Np.Provider,{scope:t.__scopeMenu,children:h.jsx(gi,{present:r||o.open,children:h.jsx(Np.Slot,{scope:t.__scopeMenu,children:h.jsx(gC,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:c,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var d;a.isUsingKeyboardRef.current&&((d=l.current)==null||d.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:Oe(t.onFocusOutside,u=>{u.target!==s.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Oe(t.onEscapeKeyDown,u=>{a.onClose(),u.preventDefault()}),onKeyDown:Oe(t.onKeyDown,u=>{var p;const d=u.currentTarget.contains(u.target),f=tle[a.dir].includes(u.key);d&&f&&(o.onOpenChange(!1),(p=s.trigger)==null||p.focus(),u.preventDefault())})})})})})});q$.displayName=X$;function K$(t){return t?"open":"closed"}function ky(t){return t==="indeterminate"}function xC(t){return ky(t)?"indeterminate":t?"checked":"unchecked"}function _le(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function wle(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function Sle(t,e,n){const i=e.length>1&&Array.from(e).every(c=>c===e[0])?e[0]:e,o=n?t.indexOf(n):-1;let a=wle(t,Math.max(o,0));i.length===1&&(a=a.filter(c=>c!==n));const l=a.find(c=>c.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function Ele(t,e){const{x:n,y:r}=t;let i=!1;for(let o=0,a=e.length-1;or!=f>r&&n<(d-c)*(r-u)/(f-u)+c&&(i=!i)}return i}function Tle(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return Ele(n,e)}function Op(t){return e=>e.pointerType==="mouse"?t(e):void 0}var Mle=R$,Ale=hC,Cle=O$,Ple=I$,Rle=vC,Nle=D$,Ole=qx,Ile=k$,Dle=U$,Lle=B$,kle=z$,jle=H$,Ule=V$,Fle=W$,Ble=q$,Kx="DropdownMenu",[$le,LDe]=mi(Kx,[C$]),Zr=C$(),[zle,Y$]=$le(Kx),J$=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:i,defaultOpen:o,onOpenChange:a,modal:s=!0}=t,l=Zr(e),c=_.useRef(null),[u,d]=zo({prop:i,defaultProp:o??!1,onChange:a,caller:Kx});return h.jsx(zle,{scope:e,triggerId:sr(),triggerRef:c,contentId:sr(),open:u,onOpenChange:d,onOpenToggle:_.useCallback(()=>d(f=>!f),[d]),modal:s,children:h.jsx(Mle,{...l,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};J$.displayName=Kx;var Z$="DropdownMenuTrigger",Q$=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=t,o=Y$(Z$,n),a=Zr(n);return h.jsx(Ale,{asChild:!0,...a,children:h.jsx(nt.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:is(e,o.triggerRef),onPointerDown:Oe(t.onPointerDown,s=>{!r&&s.button===0&&s.ctrlKey===!1&&(o.onOpenToggle(),o.open||s.preventDefault())}),onKeyDown:Oe(t.onKeyDown,s=>{r||(["Enter"," "].includes(s.key)&&o.onOpenToggle(),s.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})})});Q$.displayName=Z$;var Hle="DropdownMenuPortal",ez=t=>{const{__scopeDropdownMenu:e,...n}=t,r=Zr(e);return h.jsx(Cle,{...r,...n})};ez.displayName=Hle;var tz="DropdownMenuContent",nz=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Y$(tz,n),o=Zr(n),a=_.useRef(!1);return h.jsx(Ple,{id:i.contentId,"aria-labelledby":i.triggerId,...o,...r,ref:e,onCloseAutoFocus:Oe(t.onCloseAutoFocus,s=>{var l;a.current||(l=i.triggerRef.current)==null||l.focus(),a.current=!1,s.preventDefault()}),onInteractOutside:Oe(t.onInteractOutside,s=>{const l=s.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;(!i.modal||u)&&(a.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});nz.displayName=tz;var Vle="DropdownMenuGroup",Gle=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(Rle,{...i,...r,ref:e})});Gle.displayName=Vle;var Wle="DropdownMenuLabel",rz=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(Nle,{...i,...r,ref:e})});rz.displayName=Wle;var Xle="DropdownMenuItem",iz=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(Ole,{...i,...r,ref:e})});iz.displayName=Xle;var qle="DropdownMenuCheckboxItem",oz=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(Ile,{...i,...r,ref:e})});oz.displayName=qle;var Kle="DropdownMenuRadioGroup",Yle=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(Dle,{...i,...r,ref:e})});Yle.displayName=Kle;var Jle="DropdownMenuRadioItem",az=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(Lle,{...i,...r,ref:e})});az.displayName=Jle;var Zle="DropdownMenuItemIndicator",sz=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(kle,{...i,...r,ref:e})});sz.displayName=Zle;var Qle="DropdownMenuSeparator",lz=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(jle,{...i,...r,ref:e})});lz.displayName=Qle;var ece="DropdownMenuArrow",tce=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(Ule,{...i,...r,ref:e})});tce.displayName=ece;var nce="DropdownMenuSubTrigger",cz=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(Fle,{...i,...r,ref:e})});cz.displayName=nce;var rce="DropdownMenuSubContent",uz=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Zr(n);return h.jsx(Ble,{...i,...r,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});uz.displayName=rce;var ice=J$,oce=Q$,ace=ez,dz=nz,fz=rz,hz=iz,pz=oz,mz=az,gz=sz,vz=lz,yz=cz,xz=uz;const sce=ice,lce=oce,cce=_.forwardRef(({className:t,inset:e,children:n,...r},i)=>h.jsxs(yz,{ref:i,className:He("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",e&&"pl-8",t),...r,children:[n,h.jsx(bp,{className:"ml-auto h-4 w-4"})]}));cce.displayName=yz.displayName;const uce=_.forwardRef(({className:t,...e},n)=>h.jsx(xz,{ref:n,className:He("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...e}));uce.displayName=xz.displayName;const bz=_.forwardRef(({className:t,sideOffset:e=4,...n},r)=>h.jsx(ace,{children:h.jsx(dz,{ref:r,sideOffset:e,className:He("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n})}));bz.displayName=dz.displayName;const T1=_.forwardRef(({className:t,inset:e,...n},r)=>h.jsx(hz,{ref:r,className:He("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e&&"pl-8",t),...n}));T1.displayName=hz.displayName;const dce=_.forwardRef(({className:t,children:e,checked:n,...r},i)=>h.jsxs(pz,{ref:i,className:He("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:n,...r,children:[h.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:h.jsx(gz,{children:h.jsx(xl,{className:"h-4 w-4"})})}),e]}));dce.displayName=pz.displayName;const fce=_.forwardRef(({className:t,children:e,...n},r)=>h.jsxs(mz,{ref:r,className:He("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[h.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:h.jsx(gz,{children:h.jsx(fE,{className:"h-2 w-2 fill-current"})})}),e]}));fce.displayName=mz.displayName;const hce=_.forwardRef(({className:t,inset:e,...n},r)=>h.jsx(fz,{ref:r,className:He("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...n}));hce.displayName=fz.displayName;const pce=_.forwardRef(({className:t,...e},n)=>h.jsx(vz,{ref:n,className:He("-mx-1 my-1 h-px bg-muted",t),...e}));pce.displayName=vz.displayName;const _z="lelab.recording.muted";let Lw=null;const mce=()=>(Lw||(Lw=new AudioContext),Lw),wz=()=>localStorage.getItem(_z)==="1",gce=t=>{localStorage.setItem(_z,t?"1":"0")},gc=(t,e,n=0)=>{if(wz())return;const r=mce(),i=r.createOscillator(),o=r.createGain();i.frequency.value=t,i.type="sine",o.gain.value=0,i.connect(o),o.connect(r.destination);const a=r.currentTime+n/1e3,s=a+e/1e3;o.gain.setValueAtTime(0,a),o.gain.linearRampToValueAtTime(.2,a+.01),o.gain.setValueAtTime(.2,s-.02),o.gain.linearRampToValueAtTime(0,s),i.start(a),i.stop(s)},vce=()=>{gc(660,80,0),gc(880,80,90)},yce=()=>{gc(660,80,0),gc(440,80,90)},xce=()=>{gc(880,70,0),gc(880,70,1e3),gc(880,70,2e3)};var Sz="AlertDialog",[bce,kDe]=mi(Sz,[cF]),fs=cF(),Ez=t=>{const{__scopeAlertDialog:e,...n}=t,r=fs(e);return h.jsx(hA,{...r,...n,modal:!0})};Ez.displayName=Sz;var _ce="AlertDialogTrigger",wce=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=fs(n);return h.jsx(nK,{...i,...r,ref:e})});wce.displayName=_ce;var Sce="AlertDialogPortal",Tz=t=>{const{__scopeAlertDialog:e,...n}=t,r=fs(e);return h.jsx(pA,{...r,...n})};Tz.displayName=Sce;var Ece="AlertDialogOverlay",Mz=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=fs(n);return h.jsx(dx,{...i,...r,ref:e})});Mz.displayName=Ece;var dd="AlertDialogContent",[Tce,Mce]=bce(dd),Ace=fU("AlertDialogContent"),Az=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,children:r,...i}=t,o=fs(n),a=_.useRef(null),s=Ot(e,a),l=_.useRef(null);return h.jsx(Zq,{contentName:dd,titleName:Cz,docsSlug:"alert-dialog",children:h.jsx(Tce,{scope:n,cancelRef:l,children:h.jsxs(fx,{role:"alertdialog",...o,...i,ref:s,onOpenAutoFocus:Oe(i.onOpenAutoFocus,c=>{var u;c.preventDefault(),(u=l.current)==null||u.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[h.jsx(Ace,{children:r}),h.jsx(Pce,{contentRef:a})]})})})});Az.displayName=dd;var Cz="AlertDialogTitle",Pz=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=fs(n);return h.jsx(mA,{...i,...r,ref:e})});Pz.displayName=Cz;var Rz="AlertDialogDescription",Nz=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=fs(n);return h.jsx(gA,{...i,...r,ref:e})});Nz.displayName=Rz;var Cce="AlertDialogAction",Oz=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,i=fs(n);return h.jsx(vA,{...i,...r,ref:e})});Oz.displayName=Cce;var Iz="AlertDialogCancel",Dz=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,{cancelRef:i}=Mce(Iz,n),o=fs(n),a=Ot(e,i);return h.jsx(vA,{...o,...r,ref:a})});Dz.displayName=Iz;var Pce=({contentRef:t})=>{const e=`\`${dd}\` requires a description for the component to be accessible for screen reader users. -You can add a description to the \`${dd}\` by passing a \`${wz}\` component as a child, which also benefits sighted users by adding visible context to the dialog. +You can add a description to the \`${dd}\` by passing a \`${Rz}\` component as a child, which also benefits sighted users by adding visible context to the dialog. Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${dd}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. -For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return _.useEffect(()=>{var r;document.getElementById((r=t.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(e)},[e,t]),null},Sce=gz,Ece=vz,Az=yz,Cz=xz,Pz=Ez,Rz=Mz,Nz=_z,Oz=Sz;const xC=Sce,Tce=Ece,Iz=_.forwardRef(({className:t,...e},n)=>h.jsx(Az,{className:He("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e,ref:n}));Iz.displayName=Az.displayName;const Kx=_.forwardRef(({className:t,...e},n)=>h.jsxs(Tce,{children:[h.jsx(Iz,{}),h.jsx(Cz,{ref:n,className:He("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...e})]}));Kx.displayName=Cz.displayName;const Yx=({className:t,...e})=>h.jsx("div",{className:He("flex flex-col space-y-2 text-center sm:text-left",t),...e});Yx.displayName="AlertDialogHeader";const Jx=({className:t,...e})=>h.jsx("div",{className:He("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});Jx.displayName="AlertDialogFooter";const Zx=_.forwardRef(({className:t,...e},n)=>h.jsx(Nz,{ref:n,className:He("text-lg font-semibold",t),...e}));Zx.displayName=Nz.displayName;const Qx=_.forwardRef(({className:t,...e},n)=>h.jsx(Oz,{ref:n,className:He("text-sm text-muted-foreground",t),...e}));Qx.displayName=Oz.displayName;const eb=_.forwardRef(({className:t,...e},n)=>h.jsx(Pz,{ref:n,className:He(lA(),t),...e}));eb.displayName=Pz.displayName;const tb=_.forwardRef(({className:t,...e},n)=>h.jsx(Rz,{ref:n,className:He(lA({variant:"outline"}),"mt-2 sm:mt-0",t),...e}));tb.displayName=Rz.displayName;const Mce=()=>{var le;const t=yl(),e=ji(),{toast:n}=Dr(),{baseUrl:r,wsBaseUrl:i,fetchWithHeaders:o}=Dn(),a=(le=t.state)==null?void 0:le.recordingConfig,[s,l]=_.useState(null),[c,u]=_.useState(!1),[d,f]=_.useState(null),[p,y]=_.useState(!1),[v,g]=_.useState(()=>pz()),m=_.useRef(null),[x,b]=_.useState(0),S=_.useRef({phase:null,episode:null,tick:0}),w=_.useRef(!1),E=_.useRef(!1),T=_.useCallback(()=>{g(ie=>{const G=!ie;return cce(G),G})},[]);_.useEffect(()=>{a||(n({title:"No Configuration",description:"Please start recording from the main page.",variant:"destructive"}),e("/"))},[a,e,n]),_.useEffect(()=>{a&&!E.current&&(E.current=!0,P())},[a]);const A=_.useRef(d);A.current=d;const M=_.useRef(x);M.current=x,_.useEffect(()=>{if(!c)return;const ie=async()=>{try{const Ve=await o(`${r}/recording-status`);if(!Ve.ok)return;const Ne=await Ve.json();l(Ne);const st=A.current;st&&Ne.current_phase===st&&f(null);const Re=Ne.current_phase,ct=m.current;ct!==Re&&(Re==="recording"&&ct!==null?uce():Re==="resetting"&&dce(),m.current=Re,S.current={phase:null,episode:null,tick:0});const Ye=Ne.phase_elapsed_seconds||0,it=Ne.phase_time_limit_s||0,Ft=it>3&&Ye>=it-3,J=Ne.current_episode??null,B=M.current,ue=S.current;if(Ft&&st===null&&(ue.phase!==Re||ue.episode!==J||ue.tick!==B)&&(fce(),S.current={phase:Re,episode:J,tick:B}),!Ne.recording_active&&Ne.session_ended&&Ne.current_phase==="error"){w.current||(w.current=!0,u(!1),n({title:"Recording failed",description:Ne.error||Ne.message||"Check the robot connection and try again.",variant:"destructive"}));return}if(!Ne.recording_active&&Ne.session_ended){const me={dataset_repo_id:Ne.dataset_repo_id||a.dataset_repo_id,single_task:a.single_task,num_episodes:a.num_episodes,saved_episodes:Ne.saved_episodes||0,session_elapsed_seconds:Ne.session_elapsed_seconds||0};e("/upload",{state:{datasetInfo:me}})}}catch(Ve){console.error("Error polling recording status:",Ve)}};ie();const G=setInterval(ie,1e3);return()=>clearInterval(G)},[c,a,e,r,o]);const C=ie=>{const G=Math.floor(ie/60),Ve=ie%60;return`${G.toString().padStart(2,"0")}:${Ve.toString().padStart(2,"0")}`},P=async()=>{try{const ie=await o(`${r}/start-recording`,{method:"POST",body:JSON.stringify(a)}),G=await ie.json();ie.ok?(w.current=!1,u(!0),n({title:"Recording Started",description:`Started recording ${a.num_episodes} episodes`})):(n({title:"Error Starting Recording",description:G.message||"Failed to start recording session.",variant:"destructive"}),e("/"))}catch{n({title:"Connection Error",description:"Could not connect to the backend server.",variant:"destructive"}),e("/")}},R=_.useCallback(async()=>{if(!(s!=null&&s.available_controls.exit_early)||d!==null)return;const ie=s.current_phase,G=ie==="recording"?"resetting":ie==="resetting"?"recording":null;if(G){f(G);try{const Ve=await o(`${r}/recording-exit-early`,{method:"POST"});if(!Ve.ok){const Ne=await Ve.json();f(null),n({title:"Error",description:Ne.message,variant:"destructive"})}}catch{f(null),n({title:"Connection Error",description:"Could not connect to the backend server.",variant:"destructive"})}}},[s,d,r,o,n]),D=_.useCallback(async()=>{if(s!=null&&s.available_controls.rerecord_episode)try{const ie=await o(`${r}/recording-rerecord-episode`,{method:"POST"}),G=await ie.json();ie.ok?(b(Ve=>Ve+1),n({title:"Re-recording Episode",description:`Episode ${s.current_episode} will be re-recorded.`})):n({title:"Error",description:G.message,variant:"destructive"})}catch{n({title:"Connection Error",description:"Could not connect to the backend server.",variant:"destructive"})}},[s,r,o,n]),k=_.useCallback(async()=>{if(s!=null&&s.available_controls.stop_recording)try{await o(`${r}/stop-recording`,{method:"POST"}),n({title:"Stopping recording",description:"Finalizing datasetโ€ฆ"})}catch{n({title:"Error",description:"Failed to stop recording.",variant:"destructive"})}},[s,r,o,n]),U=_.useCallback(()=>{s!=null&&s.available_controls.stop_recording&&y(!0)},[s]),O=_.useCallback(async()=>{y(!1),await k()},[k]),W=_.useRef({handleExitEarly:R,handleRerecordEpisode:D,requestStopRecording:U,showStopConfirm:p});_.useEffect(()=>{W.current={handleExitEarly:R,handleRerecordEpisode:D,requestStopRecording:U,showStopConfirm:p}});const L=c&&s!==null;if(_.useEffect(()=>{if(!L)return;const ie=G=>{const Ve=G.target;if(!(Ve&&(Ve.tagName==="INPUT"||Ve.tagName==="TEXTAREA"||Ve.isContentEditable))){if(G.key===" "||G.code==="Space"||G.key==="ArrowRight")G.preventDefault(),W.current.handleExitEarly();else if(G.key==="ArrowLeft")G.preventDefault(),W.current.handleRerecordEpisode();else if(G.key==="Escape"){if(W.current.showStopConfirm)return;W.current.requestStopRecording()}}};return window.addEventListener("keydown",ie),()=>window.removeEventListener("keydown",ie)},[L]),!a)return h.jsx("div",{className:"min-h-screen bg-black text-white flex items-center justify-center",children:h.jsxs("div",{className:"text-center",children:[h.jsx("p",{className:"text-lg",children:"No recording configuration found."}),h.jsx(et,{onClick:()=>e("/"),className:"mt-4",children:"Return to Home"})]})});if(!s)return h.jsx("div",{className:"min-h-screen bg-black text-white flex items-center justify-center",children:h.jsxs("div",{className:"text-center",children:[h.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-red-500 mx-auto mb-4"}),h.jsx("p",{className:"text-lg",children:"Connecting to recording session..."})]})});const j=s.current_phase,X=d??j,K=s.current_episode??1,F=s.total_episodes??a.num_episodes,Y=d?0:s.phase_elapsed_seconds||0,q=X==="recording"?a.episode_time_s:X==="resetting"?a.reset_time_s:s.phase_time_limit_s||0,ee=s.session_elapsed_seconds||0,te=()=>X==="recording"?`RECORDING EPISODE ${K}`:X==="resetting"?"RESET โ€” GET READY":X==="preparing"?"PREPARING SESSION":X==="stopping"?"STOPPING RECORDING":X==="error"?"RECORDING ERROR":"SESSION COMPLETE",Q=X==="recording"?{dot:"bg-red-500",pill:"bg-red-500/15 text-red-300",timer:"text-green-400",bar:"bg-green-500",button:"bg-green-500 hover:bg-green-600"}:X==="resetting"?{dot:"bg-orange-500",pill:"bg-orange-500/15 text-orange-300",timer:"text-orange-400",bar:"bg-orange-500",button:"bg-orange-500 hover:bg-orange-600"}:{dot:"bg-gray-500",pill:"bg-gray-500/15 text-gray-300",timer:"text-gray-400",bar:"bg-gray-500",button:"bg-gray-500"},ce=X==="recording"?"End Episode":X==="resetting"?"Start Next Episode":X==="stopping"?"Stopping...":X==="error"?"Recording failed":"Advance",ae=X==="recording"?oX:Tc,fe=s.available_controls.exit_early&&d===null&&(X==="recording"||X==="resetting"),we=q>0?Math.min(Y/q*100,100):0;return h.jsxs("div",{className:"min-h-screen bg-black text-white p-8",children:[h.jsxs("div",{className:"max-w-2xl mx-auto",children:[h.jsx("div",{className:"mb-8",children:h.jsxs(et,{onClick:()=>e("/"),variant:"outline",className:"border-gray-500 hover:border-gray-200 text-gray-300 hover:text-white",children:[h.jsx(ll,{className:"w-4 h-4 mr-2"}),"Back to Home"]})}),h.jsxs("div",{className:"bg-gray-900 rounded-lg border border-gray-700 p-8",children:[h.jsxs("div",{className:"flex justify-end items-center gap-4 mb-6 text-sm text-gray-400",children:[h.jsxs("span",{"aria-label":`Episode ${K} of ${F}`,children:["Episode ",h.jsx("span",{className:"text-white font-semibold",children:K})," / ",F]}),h.jsx("span",{className:"font-mono","aria-label":`Total session time ${C(ee)}`,children:C(ee)}),h.jsx(et,{variant:"ghost",size:"icon",onClick:T,"aria-label":v?"Unmute":"Mute",className:"h-8 w-8 text-gray-400 hover:text-white hover:bg-gray-800",children:v?h.jsx(lX,{className:"w-5 h-5"}):h.jsx(sX,{className:"w-5 h-5"})}),h.jsxs(ece,{children:[h.jsx(tce,{asChild:!0,children:h.jsx(et,{variant:"ghost",size:"icon",className:"h-8 w-8 text-gray-400 hover:text-white hover:bg-gray-800","aria-label":"More actions",children:h.jsx(Y7,{className:"w-5 h-5"})})}),h.jsxs(fz,{align:"end",onCloseAutoFocus:ie=>ie.preventDefault(),className:"bg-gray-900 border-gray-700 text-white",children:[h.jsxs(T1,{onClick:D,disabled:!s.available_controls.rerecord_episode,className:"focus:bg-gray-800 focus:text-white",children:[h.jsx(iX,{className:"w-4 h-4 mr-2"}),"Re-record episode"]}),h.jsxs(T1,{onClick:U,disabled:!s.available_controls.stop_recording,className:"text-red-400 focus:bg-gray-800 focus:text-red-300",children:[h.jsx(Od,{className:"w-4 h-4 mr-2"}),"Stop recording"]})]})]})]}),h.jsx("div",{className:"text-center mb-6",children:h.jsxs("div",{role:"status","aria-live":"polite",className:`inline-flex items-center gap-2 px-3 py-1 rounded-full text-xs font-bold tracking-widest ${Q.pill}`,children:[h.jsx("span",{className:`w-2 h-2 rounded-full ${Q.dot} ${X!=="completed"?"animate-pulse":""}`}),te()]})}),h.jsxs("div",{className:"text-center mb-4",children:[h.jsx("div",{className:`text-7xl font-mono font-bold leading-none ${Q.timer}`,children:C(Y)}),h.jsxs("div",{className:"text-sm text-gray-500 mt-2",children:["/ ",C(q)]})]}),h.jsx("div",{className:"w-full bg-gray-800 rounded-full h-1.5 mb-8",children:h.jsx("div",{className:`h-1.5 rounded-full transition-all duration-500 ${Q.bar}`,style:{width:`${we}%`}})}),h.jsxs(et,{onClick:R,disabled:!fe,className:`w-full text-white font-semibold py-6 text-lg disabled:opacity-50 ${Q.button}`,children:[h.jsx(ae,{className:"w-5 h-5 mr-2"}),ce,(X==="recording"||X==="resetting")&&h.jsx("span",{className:"ml-3 px-2 py-0.5 rounded text-xs font-mono bg-black/30 text-white/70",children:"SPACE / โ†’"})]}),X==="completed"&&h.jsx("p",{className:"text-center text-sm text-gray-400 mt-6",children:"Recording complete โ€” redirecting to uploadโ€ฆ"})]})]}),h.jsx(xC,{open:p,onOpenChange:y,children:h.jsxs(Kx,{className:"bg-gray-900 border-gray-700 text-white",children:[h.jsxs(Yx,{children:[h.jsx(Zx,{children:"Stop recording?"}),h.jsx(Qx,{className:"text-gray-400",children:"Saved episodes are kept. The session will end and you'll be taken to the upload page."})]}),h.jsxs(Jx,{children:[h.jsx(tb,{className:"bg-gray-800 border-gray-700 text-white hover:bg-gray-700",children:"Keep recording"}),h.jsx(eb,{onClick:O,className:"bg-red-500 hover:bg-red-600 text-white",children:"Stop"})]})]})})]})},Ace=[{value:"act",label:"ACT (Action Chunking Transformer)"},{value:"diffusion",label:"Diffusion Policy"},{value:"pi0",label:"PI0"},{value:"pi05",label:"PI0.5"},{value:"pi0_fast",label:"PI0 Fast"},{value:"smolvla",label:"SmolVLA"},{value:"vqbet",label:"VQ-BeT"}],Ih=new Set(["pi0","pi05"]),M1=new Set(["pi0_fast"]),A1=new Set(["smolvla"]);function Dz(t){return{dtype:Ih.has(t)||M1.has(t),gradientCheckpointing:Ih.has(t)||M1.has(t),freezeVisionEncoder:Ih.has(t)||A1.has(t),trainExpertOnly:Ih.has(t)||A1.has(t)}}const sv={policy_dtype:void 0,policy_gradient_checkpointing:void 0,policy_freeze_vision_encoder:void 0,policy_train_expert_only:void 0};function Cce(t,e){return Ih.has(t)?{...sv,batch_size:Math.min(e.batch_size||1,1),policy_use_amp:!0,policy_dtype:"bfloat16",policy_gradient_checkpointing:!0,policy_freeze_vision_encoder:!0,policy_train_expert_only:!0}:M1.has(t)?{...sv,batch_size:Math.min(e.batch_size||1,1),policy_use_amp:!0,policy_dtype:"bfloat16",policy_gradient_checkpointing:!0}:A1.has(t)?{...sv,batch_size:Math.min(e.batch_size||1,1),policy_use_amp:!0,policy_freeze_vision_encoder:!0,policy_train_expert_only:!0}:{...sv,policy_use_amp:!1}}const kw=()=>{const t=ji();return h.jsx("div",{className:"flex items-center justify-between mb-8",children:h.jsxs("div",{className:"flex items-center gap-4 text-3xl",children:[h.jsx(et,{variant:"ghost",size:"icon",onClick:()=>t("/"),className:"text-slate-400 hover:bg-slate-800 hover:text-white rounded-lg",children:h.jsx(ll,{className:"w-5 h-5"})}),h.jsx(Gx,{}),h.jsx("h1",{className:"font-bold text-white text-2xl",children:"Training"})]})})};var nb="Switch",[Pce,IDe]=mi(nb),[Rce,Nce]=Pce(nb),Lz=_.forwardRef((t,e)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:o,required:a,disabled:s,value:l="on",onCheckedChange:c,form:u,...d}=t,[f,p]=_.useState(null),y=Ot(e,b=>p(b)),v=_.useRef(!1),g=f?u||!!f.closest("form"):!0,[m,x]=$o({prop:i,defaultProp:o??!1,onChange:c,caller:nb});return h.jsxs(Rce,{scope:n,checked:m,disabled:s,children:[h.jsx(nt.button,{type:"button",role:"switch","aria-checked":m,"aria-required":a,"data-state":Fz(m),"data-disabled":s?"":void 0,disabled:s,value:l,...d,ref:y,onClick:Oe(t.onClick,b=>{x(S=>!S),g&&(v.current=b.isPropagationStopped(),v.current||b.stopPropagation())})}),g&&h.jsx(Uz,{control:f,bubbles:!v.current,name:r,value:l,checked:m,required:a,disabled:s,form:u,style:{transform:"translateX(-100%)"}})]})});Lz.displayName=nb;var kz="SwitchThumb",jz=_.forwardRef((t,e)=>{const{__scopeSwitch:n,...r}=t,i=Nce(kz,n);return h.jsx(nt.span,{"data-state":Fz(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:e})});jz.displayName=kz;var Oce="SwitchBubbleInput",Uz=_.forwardRef(({__scopeSwitch:t,control:e,checked:n,bubbles:r=!0,...i},o)=>{const a=_.useRef(null),s=Ot(a,o),l=RA(n),c=EA(e);return _.useEffect(()=>{const u=a.current;if(!u)return;const d=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(d,"checked").set;if(l!==n&&p){const y=new Event("click",{bubbles:r});p.call(u,n),u.dispatchEvent(y)}},[l,n,r]),h.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...i.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Uz.displayName=Oce;function Fz(t){return t?"checked":"unchecked"}var Bz=Lz,Ice=jz;const Zo=_.forwardRef(({className:t,...e},n)=>h.jsx(Bz,{className:He("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",t),...e,ref:n,children:h.jsx(Ice,{className:He("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));Zo.displayName=Bz.displayName;const T2=/^[\w.\-]+\/[\w.\-]+$/,Dce=({datasets:t,loading:e,value:n,onChange:r})=>{const[i,o]=Z.useState(!1),[a,s]=Z.useState(!1),[l,c]=Z.useState(""),u=()=>{const y=l.trim();T2.test(y)&&(r(y),s(!1))},d=t.filter(y=>y.source==="local"||y.source==="both"),f=t.filter(y=>y.source==="hub"),p=y=>h.jsxs(kd,{value:y.repo_id,onSelect:()=>{r(y.repo_id),o(!1)},className:"text-white aria-selected:bg-gray-700",children:[h.jsx(xl,{className:He("mr-2 h-4 w-4",n===y.repo_id?"opacity-100":"opacity-0")}),h.jsx("span",{className:"flex-1 truncate",children:y.repo_id}),y.source==="both"&&h.jsx("span",{className:"text-xs text-gray-400 mr-2",children:"on Hub"}),y.private&&h.jsx("span",{className:"text-xs text-amber-400",children:"private"})]},y.repo_id);return a?h.jsxs("div",{className:"flex gap-2",children:[h.jsx(hi,{autoFocus:!0,value:l,onChange:y=>c(y.target.value),onKeyDown:y=>{y.key==="Enter"&&u()},placeholder:"org/dataset-name",className:"bg-gray-800 border-gray-600 text-white"}),h.jsx(et,{onClick:u,disabled:!T2.test(l.trim()),children:"Use"}),h.jsx(et,{variant:"ghost",onClick:()=>s(!1),children:"Cancel"})]}):h.jsxs(Sx,{open:i,onOpenChange:o,children:[h.jsx(Ex,{asChild:!0,children:h.jsxs(et,{variant:"outline",role:"combobox","aria-expanded":i,className:"w-full justify-between bg-gray-800 border-gray-600 text-white hover:bg-gray-700",children:[n??(e?"Loading datasetsโ€ฆ":"Select a datasetโ€ฆ"),h.jsx(tA,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),h.jsx(Rm,{className:"w-[--radix-popover-trigger-width] p-0 bg-gray-800 border-gray-700",align:"start",children:h.jsxs(Mx,{className:"bg-gray-800 text-white",children:[h.jsx(Ax,{placeholder:"Search datasetsโ€ฆ",className:"text-white"}),h.jsxs(Cx,{children:[h.jsx(Px,{children:e?"Loadingโ€ฆ":"No datasets."}),d.length>0&&h.jsx(Qs,{heading:"Local",children:d.map(p)}),f.length>0&&h.jsx(Qs,{heading:"Hugging Face",children:f.map(p)}),h.jsx(Qs,{children:h.jsxs(kd,{onSelect:()=>{s(!0),o(!1)},className:"text-purple-300 aria-selected:bg-gray-700",children:[h.jsx(rX,{className:"mr-2 h-4 w-4"}),"Use custom repo IDโ€ฆ"]})})]})]})})]})},Lce=1500;function $z(t,e=!0){const{baseUrl:n,fetchWithHeaders:r}=Dn(),[i,o]=_.useState("idle"),[a,s]=_.useState(null),[l,c]=_.useState([]),u=_.useRef(null);_.useEffect(()=>{if(!e)return;let p=!1;return r(`${n}/${t}/install-status`).then(y=>y.json()).then(y=>{p||(o(y.state),s(y.error),y.logs.length>0&&c(y.logs))}).catch(()=>{}),()=>{p=!0}},[e,n,r,t]),_.useEffect(()=>{if(i!=="installing")return;const p=setInterval(async()=>{try{const y=await r(`${n}/${t}/install-status`);if(!y.ok)return;const v=await y.json();v.logs&&v.logs.length>0&&c(g=>[...g,...v.logs]),v.state!=="installing"&&(o(v.state),s(v.error))}catch{}},Lce);return()=>clearInterval(p)},[i,n,r,t]),_.useEffect(()=>{u.current&&(u.current.scrollTop=u.current.scrollHeight)},[l]);const d=_.useCallback(async()=>{o("installing"),s(null),c([]);try{const p=await r(`${n}/${t}/install`,{method:"POST"}),y=await p.json();if(!y.started&&p.ok)return;p.ok||(o("error"),s(y.message||`Install request failed (${p.status})`))}catch(p){o("error"),s(`Install request failed: ${p instanceof Error?p.message:String(p)}`)}},[n,r,t]),f=_.useCallback(()=>{o("idle"),s(null),c([])},[]);return{state:i,error:a,logs:l,logBoxRef:u,handleInstall:d,handleRetry:f}}function zz(t,e){switch(t){case"done":return"Install Complete";case"error":return"Install Failed";case"installing":return"Installingโ€ฆ";default:return e}}function Hz({state:t}){return t==="done"?h.jsx(nA,{className:"w-6 h-6 text-green-400"}):t==="error"?h.jsx(nd,{className:"w-6 h-6 text-red-400"}):t==="installing"?h.jsx(fi,{className:"w-6 h-6 text-sky-400 animate-spin"}):h.jsx(oa,{className:"w-6 h-6 text-amber-400"})}const Vz=({state:t,error:e,logs:n,logBoxRef:r,onInstall:i,onRetry:o,installHint:a,packageName:s,idleDescription:l,doneDescription:c})=>{const{toast:u}=Dr(),d=async()=>{try{await navigator.clipboard.writeText(a),u({title:"Copied",description:a})}catch{u({title:"Copy failed",description:"Select the command and copy manually.",variant:"destructive"})}};return h.jsxs(h.Fragment,{children:[t==="idle"&&h.jsxs(h.Fragment,{children:[h.jsx("p",{className:"text-slate-300",children:l}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("code",{className:"flex-1 bg-slate-900 border border-slate-700 rounded-lg px-3 py-2 text-sm text-slate-200 font-mono",children:a}),h.jsx(et,{variant:"ghost",size:"icon",onClick:d,className:"text-slate-400 hover:text-white","aria-label":"Copy install command",children:h.jsx(rA,{className:"w-4 h-4"})})]}),h.jsx(et,{onClick:i,className:"bg-green-500 hover:bg-green-600 text-white font-semibold",children:"Install Now"})]}),t==="installing"&&h.jsxs("p",{className:"text-slate-300",children:["Installing"," ",h.jsx("code",{className:"px-1 py-0.5 rounded bg-slate-900 text-sky-300",children:s}),". This usually takes about 10 seconds."]}),t==="done"&&h.jsx("div",{className:"space-y-3 text-slate-300",children:c}),t==="error"&&h.jsxs(h.Fragment,{children:[h.jsx("p",{className:"text-red-300",children:e||"Install failed."}),h.jsx(et,{onClick:o,className:"bg-slate-700 hover:bg-slate-600 text-white",children:"Try again"})]}),t==="error"&&n.length>0&&h.jsx("div",{ref:r,className:"bg-slate-900 rounded-lg p-3 h-48 overflow-y-auto font-mono text-xs border border-slate-700 text-slate-300 whitespace-pre-wrap break-words",children:n.map((f,p)=>h.jsx("div",{children:f.message},p))})]})},Gz=({purpose:t})=>h.jsxs(h.Fragment,{children:[h.jsxs("p",{children:["Install complete. Restart"," ",h.jsx("code",{className:"px-1 py-0.5 rounded bg-slate-900 text-sky-300",children:"lelab"})," ","to enable ",t,":"]}),h.jsxs("ol",{className:"list-decimal list-inside space-y-2 pl-1",children:[h.jsxs("li",{children:["Press"," ",h.jsx("kbd",{className:"px-1.5 py-0.5 rounded bg-slate-900 border border-slate-600 text-xs font-mono text-slate-200",children:"Ctrl+C"})," ","in the terminal running"," ",h.jsx("code",{className:"px-1 py-0.5 rounded bg-slate-900 text-sky-300",children:"lelab"}),"."]}),h.jsxs("li",{children:["Run"," ",h.jsx("code",{className:"px-1 py-0.5 rounded bg-slate-900 text-sky-300",children:"lelab"})," ","again."]})]})]}),kce=({open:t,onOpenChange:e,installHint:n})=>{const r=$z("system/wandb-extra",t);return h.jsx(Hc,{open:t,onOpenChange:e,children:h.jsxs(bl,{className:"bg-slate-800 border-slate-700 text-white max-w-2xl",children:[h.jsxs(_l,{children:[h.jsxs(wl,{className:"flex items-center gap-3 text-white",children:[h.jsx(Hz,{state:r.state}),zz(r.state,"Weights & Biases Not Installed")]}),h.jsx(Sl,{className:"sr-only",children:"Install the wandb package to enable W&B logging."})]}),h.jsx("div",{className:"space-y-4",children:h.jsx(Vz,{state:r.state,error:r.error,logs:r.logs,logBoxRef:r.logBoxRef,onInstall:r.handleInstall,onRetry:r.handleRetry,installHint:n,packageName:"wandb",idleTitle:"Weights & Biases Not Installed",idleDescription:h.jsxs(h.Fragment,{children:["Enabling W&B logging requires the"," ",h.jsx("code",{className:"px-1 py-0.5 rounded bg-slate-900 text-sky-300",children:"wandb"})," ","package, which isn't installed in this environment. Install it to log this run to W&B."]}),doneDescription:h.jsx(Gz,{purpose:"W&B logging"})})})]})})},jce=({config:t,updateConfig:e,datasets:n,datasetsLoading:r})=>{const{baseUrl:i,fetchWithHeaders:o}=Dn(),[a,s]=_.useState(!1),[l,c]=_.useState("pip install wandb"),u=t.target.runner==="seeed_cloud"||t.target.runner==="external",d=async f=>{if(!f){e("wandb_enable",!1);return}try{const y=await(await o(`${i}/system/wandb-extra`)).json();y.available?e("wandb_enable",!0):(c(y.install_hint),s(!0))}catch{e("wandb_enable",!0)}};return h.jsxs(Gr,{className:"bg-slate-800/50 border-slate-700 rounded-xl",children:[h.jsx(jo,{children:h.jsx(ga,{className:"text-white",children:"Run Configuration"})}),h.jsxs(Wr,{className:"space-y-6",children:[h.jsxs("div",{children:[h.jsx(Tt,{className:"text-slate-300",children:"Dataset Repository ID *"}),h.jsx("div",{className:"mt-1",children:h.jsx(Dce,{datasets:n,loading:r,value:t.dataset_repo_id||null,onChange:f=>{f&&e("dataset_repo_id",f)}})}),h.jsx("p",{className:"text-xs text-slate-500 mt-1",children:u?"LeLab dataset repository ID; Seeed Cloud also accepts an archive URL or SEEED_CLOUD_DATASET_URL override":"HuggingFace Hub dataset repository ID"})]}),h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"policy_type",className:"text-slate-300",children:"Policy"}),h.jsxs(Ga,{value:t.policy_type,onValueChange:f=>e("policy_type",f),children:[h.jsx(sa,{id:"policy_type",className:"bg-slate-900 border-slate-600 text-white rounded-lg",children:h.jsx(Wa,{})}),h.jsx(la,{className:"bg-slate-800 border-slate-600 text-white",children:Ace.map(f=>h.jsx($n,{value:f.value,children:f.label},f.value))})]})]}),h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"steps",className:"text-slate-300",children:"Training Steps"}),h.jsx(mr,{id:"steps",value:t.steps,onChange:f=>{f!==void 0&&e("steps",f)},className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]}),h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"batch_size",className:"text-slate-300",children:"Batch Size"}),h.jsx(mr,{id:"batch_size",value:t.batch_size,onChange:f=>{f!==void 0&&e("batch_size",f)},className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]}),h.jsxs("div",{className:"flex items-center space-x-3 pt-6",children:[h.jsx(Zo,{id:"wandb_enable",checked:t.wandb_enable,onCheckedChange:d,className:"data-[state=checked]:bg-green-500"}),h.jsx(Tt,{htmlFor:"wandb_enable",className:"text-slate-300",children:"Enable Weights & Biases"})]})]}),h.jsx(kce,{open:a,onOpenChange:s,installHint:l}),t.wandb_enable&&h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"wandb_project",className:"text-slate-300",children:"W&B Project Name"}),h.jsx(hi,{id:"wandb_project",value:t.wandb_project||"",onChange:f=>e("wandb_project",f.target.value||void 0),placeholder:"my-robotics-project",className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]})]})]})},wu=({children:t})=>h.jsx("h4",{className:"text-xs font-semibold text-slate-400 uppercase tracking-wider",children:t}),Uce=({config:t,updateConfig:e})=>{const[n,r]=_.useState(!1),i=Dz(t.policy_type);return h.jsxs(Gr,{className:"bg-slate-800/50 border-slate-700 rounded-xl",children:[h.jsxs(jo,{role:"button",tabIndex:0,"aria-expanded":n,onClick:()=>r(o=>!o),onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),r(a=>!a))},className:"cursor-pointer select-none flex flex-row items-center justify-between",children:[h.jsx("span",{className:"text-white font-semibold",children:"Advanced"}),h.jsxs("span",{className:"flex items-center gap-1 text-slate-400 text-sm",children:[n?h.jsx(hc,{className:"w-4 h-4"}):h.jsx(bp,{className:"w-4 h-4"}),n?"Hide":"Show"]})]}),n&&h.jsxs(Wr,{className:"space-y-8",children:[h.jsxs("section",{className:"space-y-4",children:[h.jsx(wu,{children:"Policy"}),h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"policy_device",className:"text-slate-300",children:"Device"}),h.jsxs(Ga,{value:t.policy_device||"cuda",onValueChange:o=>e("policy_device",o),children:[h.jsx(sa,{id:"policy_device",className:"bg-slate-900 border-slate-600 text-white rounded-lg",children:h.jsx(Wa,{})}),h.jsxs(la,{className:"bg-slate-800 border-slate-600 text-white",children:[h.jsx($n,{value:"cuda",children:"CUDA (GPU)"}),h.jsx($n,{value:"cpu",children:"CPU"}),h.jsx($n,{value:"mps",children:"MPS (Apple Silicon)"})]})]})]}),h.jsxs("div",{className:"flex items-center space-x-3 pt-6",children:[h.jsx(Zo,{id:"policy_use_amp",checked:t.policy_use_amp,onCheckedChange:o=>e("policy_use_amp",o)}),h.jsx(Tt,{htmlFor:"policy_use_amp",className:"text-slate-300",children:"Use Automatic Mixed Precision"})]}),i.dtype&&h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"policy_dtype",className:"text-slate-300",children:"Policy dtype"}),h.jsxs(Ga,{value:t.policy_dtype||"default",onValueChange:o=>e("policy_dtype",o==="default"?void 0:o),children:[h.jsx(sa,{id:"policy_dtype",className:"bg-slate-900 border-slate-600 text-white rounded-lg",children:h.jsx(Wa,{})}),h.jsxs(la,{className:"bg-slate-800 border-slate-600 text-white",children:[h.jsx($n,{value:"default",children:"Policy default"}),h.jsx($n,{value:"bfloat16",children:"bfloat16"}),h.jsx($n,{value:"float32",children:"float32"})]})]})]}),i.gradientCheckpointing&&h.jsxs("div",{className:"flex items-center space-x-3 pt-6",children:[h.jsx(Zo,{id:"policy_gradient_checkpointing",checked:!!t.policy_gradient_checkpointing,onCheckedChange:o=>e("policy_gradient_checkpointing",o)}),h.jsx(Tt,{htmlFor:"policy_gradient_checkpointing",className:"text-slate-300",children:"Gradient checkpointing"})]}),i.freezeVisionEncoder&&h.jsxs("div",{className:"flex items-center space-x-3 pt-6",children:[h.jsx(Zo,{id:"policy_freeze_vision_encoder",checked:!!t.policy_freeze_vision_encoder,onCheckedChange:o=>e("policy_freeze_vision_encoder",o)}),h.jsx(Tt,{htmlFor:"policy_freeze_vision_encoder",className:"text-slate-300",children:"Freeze vision encoder"})]}),i.trainExpertOnly&&h.jsxs("div",{className:"flex items-center space-x-3 pt-6",children:[h.jsx(Zo,{id:"policy_train_expert_only",checked:!!t.policy_train_expert_only,onCheckedChange:o=>e("policy_train_expert_only",o)}),h.jsx(Tt,{htmlFor:"policy_train_expert_only",className:"text-slate-300",children:"Train expert only"})]})]})]}),h.jsx(Jl,{className:"bg-slate-700"}),h.jsxs("section",{className:"space-y-4",children:[h.jsx(wu,{children:"Training"}),h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"seed",className:"text-slate-300",children:"Random Seed"}),h.jsx(mr,{id:"seed",value:t.seed,onChange:o=>e("seed",o),className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]}),h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"num_workers",className:"text-slate-300",children:"Number of Workers"}),h.jsx(mr,{id:"num_workers",value:t.num_workers,onChange:o=>{o!==void 0&&e("num_workers",o)},className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]})]})]}),h.jsx(Jl,{className:"bg-slate-700"}),h.jsxs("section",{className:"space-y-4",children:[h.jsx(wu,{children:"Optimizer"}),h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"optimizer_type",className:"text-slate-300",children:"Optimizer"}),h.jsxs(Ga,{value:t.optimizer_type||"adam",onValueChange:o=>e("optimizer_type",o),children:[h.jsx(sa,{id:"optimizer_type",className:"bg-slate-900 border-slate-600 text-white rounded-lg",children:h.jsx(Wa,{})}),h.jsxs(la,{className:"bg-slate-800 border-slate-600 text-white",children:[h.jsx($n,{value:"adam",children:"Adam"}),h.jsx($n,{value:"adamw",children:"AdamW"}),h.jsx($n,{value:"sgd",children:"SGD"}),h.jsx($n,{value:"multi_adam",children:"Multi Adam"})]})]})]}),h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"optimizer_lr",className:"text-slate-300",children:"Learning Rate"}),h.jsx(mr,{id:"optimizer_lr",integer:!1,step:"0.0001",value:t.optimizer_lr,onChange:o=>e("optimizer_lr",o),placeholder:"Use policy default",className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]}),h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"optimizer_weight_decay",className:"text-slate-300",children:"Weight Decay"}),h.jsx(mr,{id:"optimizer_weight_decay",integer:!1,step:"0.0001",value:t.optimizer_weight_decay,onChange:o=>e("optimizer_weight_decay",o),placeholder:"Use policy default",className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]}),h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"optimizer_grad_clip_norm",className:"text-slate-300",children:"Gradient Clipping"}),h.jsx(mr,{id:"optimizer_grad_clip_norm",integer:!1,step:"0.0001",value:t.optimizer_grad_clip_norm,onChange:o=>e("optimizer_grad_clip_norm",o),placeholder:"Use policy default",className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]})]})]}),h.jsx(Jl,{className:"bg-slate-700"}),h.jsxs("section",{className:"space-y-4",children:[h.jsx(wu,{children:"Logging & Checkpointing"}),h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"log_freq",className:"text-slate-300",children:"Log Frequency"}),h.jsx(mr,{id:"log_freq",value:t.log_freq,onChange:o=>{o!==void 0&&e("log_freq",o)},className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]}),h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"save_freq",className:"text-slate-300",children:"Save Frequency"}),h.jsx(mr,{id:"save_freq",value:t.save_freq,onChange:o=>{o!==void 0&&e("save_freq",o)},className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]})]}),h.jsxs("div",{className:"flex items-center space-x-3",children:[h.jsx(Zo,{id:"save_checkpoint",checked:t.save_checkpoint,onCheckedChange:o=>e("save_checkpoint",o)}),h.jsx(Tt,{htmlFor:"save_checkpoint",className:"text-slate-300",children:"Save Checkpoints"})]}),h.jsxs("div",{className:"flex items-center space-x-3",children:[h.jsx(Zo,{id:"resume",checked:t.resume,onCheckedChange:o=>e("resume",o)}),h.jsx(Tt,{htmlFor:"resume",className:"text-slate-300",children:"Resume from Checkpoint"})]})]}),t.wandb_enable&&h.jsxs(h.Fragment,{children:[h.jsx(Jl,{className:"bg-slate-700"}),h.jsxs("section",{className:"space-y-4",children:[h.jsx(wu,{children:"Weights & Biases"}),h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"wandb_entity",className:"text-slate-300",children:"W&B Entity (optional)"}),h.jsx(hi,{id:"wandb_entity",value:t.wandb_entity||"",onChange:o=>e("wandb_entity",o.target.value||void 0),placeholder:"your-username",className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]}),h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"wandb_notes",className:"text-slate-300",children:"W&B Notes (optional)"}),h.jsx(hi,{id:"wandb_notes",value:t.wandb_notes||"",onChange:o=>e("wandb_notes",o.target.value||void 0),placeholder:"Training run notes...",className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]}),h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"wandb_mode",className:"text-slate-300",children:"W&B Mode"}),h.jsxs(Ga,{value:t.wandb_mode||"online",onValueChange:o=>e("wandb_mode",o),children:[h.jsx(sa,{id:"wandb_mode",className:"bg-slate-900 border-slate-600 text-white rounded-lg",children:h.jsx(Wa,{})}),h.jsxs(la,{className:"bg-slate-800 border-slate-600 text-white",children:[h.jsx($n,{value:"online",children:"Online"}),h.jsx($n,{value:"offline",children:"Offline"}),h.jsx($n,{value:"disabled",children:"Disabled"})]})]})]}),h.jsxs("div",{className:"flex items-center space-x-3",children:[h.jsx(Zo,{id:"wandb_disable_artifact",checked:t.wandb_disable_artifact,onCheckedChange:o=>e("wandb_disable_artifact",o)}),h.jsx(Tt,{htmlFor:"wandb_disable_artifact",className:"text-slate-300",children:"Disable Artifacts"})]})]})]}),!t.wandb_enable&&h.jsx(Jl,{className:"bg-slate-700"}),h.jsxs("section",{className:"space-y-4",children:[h.jsx(wu,{children:"Misc"}),h.jsxs("div",{className:"flex items-center space-x-3",children:[h.jsx(Zo,{id:"use_policy_training_preset",checked:t.use_policy_training_preset,onCheckedChange:o=>e("use_policy_training_preset",o)}),h.jsx(Tt,{htmlFor:"use_policy_training_preset",className:"text-slate-300",children:"Use Policy Training Preset"})]})]})]})]})},Fce=(t,e)=>`$${(e==="minute"?t*60:t).toFixed(2)}/hr`,Bce=t=>{const e=t.accelerator;if(!e)return{manufacturer:"",model:t.cpu||t.pretty_name||t.name};if(typeof e=="string")return{manufacturer:/nvidia/i.test(e)?"":"Nvidia",model:e};const n=String(e.quantity??"").trim(),r=n&&n!=="1"?`${n}x `:"";return{manufacturer:e.manufacturer||"",model:`${r}${e.model||t.pretty_name||t.name}`}},$ce=t=>{const{manufacturer:e,model:n}=Bce(t);return[e,n].filter(Boolean).join(" ")},dh=(t,e)=>`${t} ${$ce(e)} - ${Fce(e.unit_cost_usd,e.unit_label)}`,M2=t=>{const e=[t.cpu,t.ram].filter(Boolean);return e.length>0?e.join(" ยท "):t.pretty_name},Bl="seeed_cloud",zce=({config:t,updateConfig:e,authenticated:n,flavors:r,providers:i,loading:o,seeedConnecting:a,onConnectSeeedCloud:s})=>{const l=t.target,[c,u]=_.useState(!1),[d,f]=_.useState(!0),[p,y]=_.useState({[Bl]:!0}),v=_.useMemo(()=>i??[],[i]),g=_.useMemo(()=>r??[],[r]),m=v.find(A=>A.id===Bl),x=v.map(A=>({...A,open:p[A.id]??A.id===Bl,label:A.id===Bl?"Seeed Cloud":A.display_name})),b=_.useMemo(()=>{if(l.runner==="local")return"Local - your machine";if(l.runner==="hf_cloud"){const C=g.find(P=>P.name===l.flavor);return C?dh("HF",C):"Hugging Face"}if(l.runner==="seeed_cloud"){const C=m==null?void 0:m.flavors.find(P=>P.name===l.flavor);return C?dh("Seeed",C):"Seeed Cloud"}const A=v.find(C=>C.id===l.provider),M=A==null?void 0:A.flavors.find(C=>C.name===l.flavor);return M?dh((A==null?void 0:A.display_name)??"External",M):(A==null?void 0:A.display_name)??"External"},[g,v,m,l]),S=A=>{if(A==="local")e("target",{runner:"local"});else if(A.startsWith("hf:")){const M=A.slice(3);e("target",{runner:"hf_cloud",flavor:M})}else if(A.startsWith("seeed:")){const M=A.slice(6);e("target",{runner:"seeed_cloud",flavor:M})}else if(A.startsWith("external:")){const[,M,C]=A.split(":");e("target",{runner:"external",provider:M,flavor:C})}u(!1)},w=l.runner==="local"?"local":l.runner==="hf_cloud"?`hf:${l.flavor??""}`:l.runner==="seeed_cloud"?`seeed:${l.flavor??""}`:`external:${l.provider}:${l.flavor??""}`,E=(A,M,C,P)=>h.jsxs("button",{type:"button",disabled:P,onClick:()=>S(A),className:He("flex min-h-10 w-full items-center gap-3 rounded-md px-3 py-2 text-left text-sm transition-colors","hover:bg-slate-700/80 focus:bg-slate-700/80 focus:outline-none",P&&"cursor-not-allowed opacity-45 hover:bg-transparent"),children:[h.jsx(xl,{className:He("h-4 w-4 shrink-0 text-emerald-300",w===A?"opacity-100":"opacity-0")}),h.jsxs("span",{className:"min-w-0 flex-1",children:[h.jsx("span",{className:"block truncate text-slate-100",children:M}),C?h.jsx("span",{className:"block truncate text-xs text-slate-500",children:C}):null]})]},A),T=(A,M)=>{y(C=>({...C,[A]:M}))};return h.jsxs(Gr,{className:"bg-slate-800/50 border-slate-700 rounded-xl",children:[h.jsx(jo,{children:h.jsx(ga,{className:"text-white",children:"Compute target"})}),h.jsx(Wr,{className:"space-y-3",children:h.jsxs("div",{children:[h.jsx(Tt,{className:"text-slate-300",children:"Run training on"}),h.jsxs(Sx,{open:c,onOpenChange:u,children:[h.jsx(Ex,{asChild:!0,children:h.jsxs(et,{type:"button",variant:"outline",className:"mt-1 flex h-11 w-full justify-between border-slate-600 bg-slate-900 px-3 text-left text-white hover:bg-slate-900 hover:text-white",children:[h.jsx("span",{className:"min-w-0 flex-1 truncate",children:o?"Loading...":b}),h.jsx(hc,{className:"ml-3 h-4 w-4 shrink-0 text-slate-400"})]})}),h.jsx(Rm,{align:"start",className:"w-[min(560px,calc(100vw-2rem))] border-slate-700 bg-slate-800 p-2 text-white shadow-xl",children:h.jsxs("div",{className:"max-h-[440px] overflow-y-auto pr-1",children:[E("local","Local - your machine","Free",!1),h.jsxs(Ty,{open:d,onOpenChange:f,children:[h.jsxs(My,{className:"mt-1 flex h-10 w-full items-center gap-2 rounded-md px-3 text-left text-sm text-slate-200 hover:bg-slate-700/70",children:[d?h.jsx(hc,{className:"h-4 w-4 text-slate-400"}):h.jsx(bp,{className:"h-4 w-4 text-slate-400"}),h.jsx("span",{className:"font-medium",children:"Hugging Face"}),h.jsx(w1,{variant:"outline",className:"ml-auto border-slate-600 text-slate-300",children:n?`${g.length} flavors`:"Login required"})]}),h.jsx(Ay,{className:"ml-3 border-l border-slate-700 pl-2",children:n&&g.length>0?g.map(A=>E(`hf:${A.name}`,dh("HF",A),M2(A),!1)):h.jsx("div",{className:"px-8 py-3 text-xs text-slate-500",children:n?"No HF hardware flavors available.":"Log in to HF to unlock official flavors."})})]}),x.map(A=>h.jsxs(Ty,{open:A.open,onOpenChange:M=>T(A.id,M),children:[h.jsxs(My,{className:"mt-1 flex h-10 w-full items-center gap-2 rounded-md px-3 text-left text-sm text-slate-200 hover:bg-slate-700/70",children:[A.open?h.jsx(hc,{className:"h-4 w-4 text-slate-400"}):h.jsx(bp,{className:"h-4 w-4 text-slate-400"}),h.jsx("span",{className:"font-medium",children:A.label}),h.jsx(w1,{variant:"outline",className:He("ml-auto border-slate-600 text-slate-300",A.authenticated&&"border-emerald-500/50 text-emerald-200"),children:A.authenticated?`Connected ยท ${A.flavors.length} flavors`:"Connect required"})]}),h.jsxs(Ay,{className:"ml-3 border-l border-slate-700 pl-2",children:[!A.authenticated&&A.id===Bl?h.jsxs("div",{className:"flex items-center justify-between gap-3 px-3 py-2",children:[h.jsx("span",{className:"text-xs text-slate-500",children:"Connect to unlock Seeed Cloud flavors."}),h.jsxs(et,{type:"button",size:"sm",variant:"outline",disabled:a,onClick:s,className:"h-8 shrink-0 border-amber-400/60 bg-slate-900 text-amber-100 hover:bg-amber-500/20",children:[a?h.jsx(fi,{className:"mr-2 h-4 w-4 animate-spin"}):h.jsx(tX,{className:"mr-2 h-4 w-4"}),"Connect"]})]}):null,A.flavors.length>0?A.flavors.map(M=>{const C=A.id===Bl?"Seeed":A.display_name,P=A.id===Bl?`seeed:${M.name}`:`external:${A.id}:${M.name}`;return E(P,dh(C,M),M2(M),!A.authenticated)}):h.jsx("div",{className:"px-8 py-3 text-xs text-slate-500",children:"No flavors available."})]})]},A.id))]})})]}),h.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Cost shown is per running hour. Final policy uploads to your HF account when training completes."})]})})]})},Hce=({config:t,updateConfig:e,datasets:n,datasetsLoading:r,authenticated:i,flavors:o,providers:a,hardwareLoading:s,seeedConnecting:l,onConnectSeeedCloud:c})=>h.jsxs("div",{className:"max-w-3xl mx-auto space-y-6",children:[h.jsx(zce,{config:t,updateConfig:e,authenticated:i,flavors:o,providers:a,loading:s,seeedConnecting:l,onConnectSeeedCloud:c}),h.jsx(jce,{config:t,updateConfig:e,datasets:n,datasetsLoading:r}),h.jsx(Uce,{config:t,updateConfig:e})]});var Vce=Array.isArray,yi=Vce,Gce=typeof Qm=="object"&&Qm&&Qm.Object===Object&&Qm,Wz=Gce,Wce=Wz,Xce=typeof self=="object"&&self&&self.Object===Object&&self,qce=Wce||Xce||Function("return this")(),Ta=qce,Kce=Ta,Yce=Kce.Symbol,Fm=Yce,A2=Fm,Xz=Object.prototype,Jce=Xz.hasOwnProperty,Zce=Xz.toString,fh=A2?A2.toStringTag:void 0;function Qce(t){var e=Jce.call(t,fh),n=t[fh];try{t[fh]=void 0;var r=!0}catch{}var i=Zce.call(t);return r&&(e?t[fh]=n:delete t[fh]),i}var eue=Qce,tue=Object.prototype,nue=tue.toString;function rue(t){return nue.call(t)}var iue=rue,C2=Fm,oue=eue,aue=iue,sue="[object Null]",lue="[object Undefined]",P2=C2?C2.toStringTag:void 0;function cue(t){return t==null?t===void 0?lue:sue:P2&&P2 in Object(t)?oue(t):aue(t)}var hs=cue;function uue(t){return t!=null&&typeof t=="object"}var ps=uue,due=hs,fue=ps,hue="[object Symbol]";function pue(t){return typeof t=="symbol"||fue(t)&&due(t)==hue}var Cf=pue,mue=yi,gue=Cf,vue=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,yue=/^\w*$/;function xue(t,e){if(mue(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||gue(t)?!0:yue.test(t)||!vue.test(t)||e!=null&&t in Object(e)}var bC=xue;function bue(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Cl=bue;const Pf=dn(Cl);var _ue=hs,wue=Cl,Sue="[object AsyncFunction]",Eue="[object Function]",Tue="[object GeneratorFunction]",Mue="[object Proxy]";function Aue(t){if(!wue(t))return!1;var e=_ue(t);return e==Eue||e==Tue||e==Sue||e==Mue}var _C=Aue;const jt=dn(_C);var Cue=Ta,Pue=Cue["__core-js_shared__"],Rue=Pue,jw=Rue,R2=function(){var t=/[^.]+$/.exec(jw&&jw.keys&&jw.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Nue(t){return!!R2&&R2 in t}var Oue=Nue,Iue=Function.prototype,Due=Iue.toString;function Lue(t){if(t!=null){try{return Due.call(t)}catch{}try{return t+""}catch{}}return""}var qz=Lue,kue=_C,jue=Oue,Uue=Cl,Fue=qz,Bue=/[\\^$.*+?()[\]{}|]/g,$ue=/^\[object .+?Constructor\]$/,zue=Function.prototype,Hue=Object.prototype,Vue=zue.toString,Gue=Hue.hasOwnProperty,Wue=RegExp("^"+Vue.call(Gue).replace(Bue,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Xue(t){if(!Uue(t)||jue(t))return!1;var e=kue(t)?Wue:$ue;return e.test(Fue(t))}var que=Xue;function Kue(t,e){return t==null?void 0:t[e]}var Yue=Kue,Jue=que,Zue=Yue;function Que(t,e){var n=Zue(t,e);return Jue(n)?n:void 0}var qc=Que,ede=qc,tde=ede(Object,"create"),rb=tde,N2=rb;function nde(){this.__data__=N2?N2(null):{},this.size=0}var rde=nde;function ide(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var ode=ide,ade=rb,sde="__lodash_hash_undefined__",lde=Object.prototype,cde=lde.hasOwnProperty;function ude(t){var e=this.__data__;if(ade){var n=e[t];return n===sde?void 0:n}return cde.call(e,t)?e[t]:void 0}var dde=ude,fde=rb,hde=Object.prototype,pde=hde.hasOwnProperty;function mde(t){var e=this.__data__;return fde?e[t]!==void 0:pde.call(e,t)}var gde=mde,vde=rb,yde="__lodash_hash_undefined__";function xde(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=vde&&e===void 0?yde:e,this}var bde=xde,_de=rde,wde=ode,Sde=dde,Ede=gde,Tde=bde;function Rf(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e-1}var zde=$de,Hde=ib;function Vde(t,e){var n=this.__data__,r=Hde(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var Gde=Vde,Wde=Cde,Xde=kde,qde=Fde,Kde=zde,Yde=Gde;function Nf(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e{var r;document.getElementById((r=t.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(e)},[e,t]),null},Rce=Ez,Nce=Tz,Lz=Mz,kz=Az,jz=Oz,Uz=Dz,Fz=Pz,Bz=Nz;const bC=Rce,Oce=Nce,$z=_.forwardRef(({className:t,...e},n)=>h.jsx(Lz,{className:He("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e,ref:n}));$z.displayName=Lz.displayName;const Yx=_.forwardRef(({className:t,...e},n)=>h.jsxs(Oce,{children:[h.jsx($z,{}),h.jsx(kz,{ref:n,className:He("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...e})]}));Yx.displayName=kz.displayName;const Jx=({className:t,...e})=>h.jsx("div",{className:He("flex flex-col space-y-2 text-center sm:text-left",t),...e});Jx.displayName="AlertDialogHeader";const Zx=({className:t,...e})=>h.jsx("div",{className:He("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});Zx.displayName="AlertDialogFooter";const Qx=_.forwardRef(({className:t,...e},n)=>h.jsx(Fz,{ref:n,className:He("text-lg font-semibold",t),...e}));Qx.displayName=Fz.displayName;const eb=_.forwardRef(({className:t,...e},n)=>h.jsx(Bz,{ref:n,className:He("text-sm text-muted-foreground",t),...e}));eb.displayName=Bz.displayName;const tb=_.forwardRef(({className:t,...e},n)=>h.jsx(jz,{ref:n,className:He(cA(),t),...e}));tb.displayName=jz.displayName;const nb=_.forwardRef(({className:t,...e},n)=>h.jsx(Uz,{ref:n,className:He(cA({variant:"outline"}),"mt-2 sm:mt-0",t),...e}));nb.displayName=Uz.displayName;const Ice=()=>{var le;const t=yl(),e=ji(),{toast:n}=_r(),{baseUrl:r,wsBaseUrl:i,fetchWithHeaders:o}=Dn(),a=(le=t.state)==null?void 0:le.recordingConfig,[s,l]=_.useState(null),[c,u]=_.useState(!1),[d,f]=_.useState(null),[p,y]=_.useState(!1),[v,g]=_.useState(()=>wz()),m=_.useRef(null),[x,b]=_.useState(0),S=_.useRef({phase:null,episode:null,tick:0}),w=_.useRef(!1),E=_.useRef(!1),T=_.useCallback(()=>{g(ie=>{const W=!ie;return gce(W),W})},[]);_.useEffect(()=>{a||(n({title:"No Configuration",description:"Please start recording from the main page.",variant:"destructive"}),e("/"))},[a,e,n]),_.useEffect(()=>{a&&!E.current&&(E.current=!0,P())},[a]);const A=_.useRef(d);A.current=d;const M=_.useRef(x);M.current=x,_.useEffect(()=>{if(!c)return;const ie=async()=>{try{const Ve=await o(`${r}/recording-status`);if(!Ve.ok)return;const Ne=await Ve.json();l(Ne);const st=A.current;st&&Ne.current_phase===st&&f(null);const Re=Ne.current_phase,ct=m.current;ct!==Re&&(Re==="recording"&&ct!==null?vce():Re==="resetting"&&yce(),m.current=Re,S.current={phase:null,episode:null,tick:0});const Ye=Ne.phase_elapsed_seconds||0,it=Ne.phase_time_limit_s||0,Ft=it>3&&Ye>=it-3,Z=Ne.current_episode??null,F=M.current,ue=S.current;if(Ft&&st===null&&(ue.phase!==Re||ue.episode!==Z||ue.tick!==F)&&(xce(),S.current={phase:Re,episode:Z,tick:F}),!Ne.recording_active&&Ne.session_ended&&Ne.current_phase==="error"){w.current||(w.current=!0,u(!1),n({title:"Recording failed",description:Ne.error||Ne.message||"Check the robot connection and try again.",variant:"destructive"}));return}if(!Ne.recording_active&&Ne.session_ended){const me={dataset_repo_id:Ne.dataset_repo_id||a.dataset_repo_id,single_task:a.single_task,num_episodes:a.num_episodes,saved_episodes:Ne.saved_episodes||0,session_elapsed_seconds:Ne.session_elapsed_seconds||0};e("/upload",{state:{datasetInfo:me}})}}catch(Ve){console.error("Error polling recording status:",Ve)}};ie();const W=setInterval(ie,1e3);return()=>clearInterval(W)},[c,a,e,r,o]);const C=ie=>{const W=Math.floor(ie/60),Ve=ie%60;return`${W.toString().padStart(2,"0")}:${Ve.toString().padStart(2,"0")}`},P=async()=>{try{const ie=await o(`${r}/start-recording`,{method:"POST",body:JSON.stringify(a)}),W=await ie.json();ie.ok?(w.current=!1,u(!0),n({title:"Recording Started",description:`Started recording ${a.num_episodes} episodes`})):(n({title:"Error Starting Recording",description:W.message||"Failed to start recording session.",variant:"destructive"}),e("/"))}catch{n({title:"Connection Error",description:"Could not connect to the backend server.",variant:"destructive"}),e("/")}},R=_.useCallback(async()=>{if(!(s!=null&&s.available_controls.exit_early)||d!==null)return;const ie=s.current_phase,W=ie==="recording"?"resetting":ie==="resetting"?"recording":null;if(W){f(W);try{const Ve=await o(`${r}/recording-exit-early`,{method:"POST"});if(!Ve.ok){const Ne=await Ve.json();f(null),n({title:"Error",description:Ne.message,variant:"destructive"})}}catch{f(null),n({title:"Connection Error",description:"Could not connect to the backend server.",variant:"destructive"})}}},[s,d,r,o,n]),D=_.useCallback(async()=>{if(s!=null&&s.available_controls.rerecord_episode)try{const ie=await o(`${r}/recording-rerecord-episode`,{method:"POST"}),W=await ie.json();ie.ok?(b(Ve=>Ve+1),n({title:"Re-recording Episode",description:`Episode ${s.current_episode} will be re-recorded.`})):n({title:"Error",description:W.message,variant:"destructive"})}catch{n({title:"Connection Error",description:"Could not connect to the backend server.",variant:"destructive"})}},[s,r,o,n]),k=_.useCallback(async()=>{if(s!=null&&s.available_controls.stop_recording)try{await o(`${r}/stop-recording`,{method:"POST"}),n({title:"Stopping recording",description:"Finalizing datasetโ€ฆ"})}catch{n({title:"Error",description:"Failed to stop recording.",variant:"destructive"})}},[s,r,o,n]),U=_.useCallback(()=>{s!=null&&s.available_controls.stop_recording&&y(!0)},[s]),O=_.useCallback(async()=>{y(!1),await k()},[k]),X=_.useRef({handleExitEarly:R,handleRerecordEpisode:D,requestStopRecording:U,showStopConfirm:p});_.useEffect(()=>{X.current={handleExitEarly:R,handleRerecordEpisode:D,requestStopRecording:U,showStopConfirm:p}});const L=c&&s!==null;if(_.useEffect(()=>{if(!L)return;const ie=W=>{const Ve=W.target;if(!(Ve&&(Ve.tagName==="INPUT"||Ve.tagName==="TEXTAREA"||Ve.isContentEditable))){if(W.key===" "||W.code==="Space"||W.key==="ArrowRight")W.preventDefault(),X.current.handleExitEarly();else if(W.key==="ArrowLeft")W.preventDefault(),X.current.handleRerecordEpisode();else if(W.key==="Escape"){if(X.current.showStopConfirm)return;X.current.requestStopRecording()}}};return window.addEventListener("keydown",ie),()=>window.removeEventListener("keydown",ie)},[L]),!a)return h.jsx("div",{className:"min-h-screen bg-black text-white flex items-center justify-center",children:h.jsxs("div",{className:"text-center",children:[h.jsx("p",{className:"text-lg",children:"No recording configuration found."}),h.jsx(Je,{onClick:()=>e("/"),className:"mt-4",children:"Return to Home"})]})});if(!s)return h.jsx("div",{className:"min-h-screen bg-black text-white flex items-center justify-center",children:h.jsxs("div",{className:"text-center",children:[h.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-red-500 mx-auto mb-4"}),h.jsx("p",{className:"text-lg",children:"Connecting to recording session..."})]})});const j=s.current_phase,K=d??j,te=s.current_episode??1,H=s.total_episodes??a.num_episodes,q=d?0:s.phase_elapsed_seconds||0,$=K==="recording"?a.episode_time_s:K==="resetting"?a.reset_time_s:s.phase_time_limit_s||0,Y=s.session_elapsed_seconds||0,ee=()=>K==="recording"?`RECORDING EPISODE ${te}`:K==="resetting"?"RESET โ€” GET READY":K==="preparing"?"PREPARING SESSION":K==="stopping"?"STOPPING RECORDING":K==="error"?"RECORDING ERROR":"SESSION COMPLETE",J=K==="recording"?{dot:"bg-red-500",pill:"bg-red-500/15 text-red-300",timer:"text-green-400",bar:"bg-green-500",button:"bg-green-500 hover:bg-green-600"}:K==="resetting"?{dot:"bg-orange-500",pill:"bg-orange-500/15 text-orange-300",timer:"text-orange-400",bar:"bg-orange-500",button:"bg-orange-500 hover:bg-orange-600"}:{dot:"bg-gray-500",pill:"bg-gray-500/15 text-gray-300",timer:"text-gray-400",bar:"bg-gray-500",button:"bg-gray-500"},ce=K==="recording"?"End Episode":K==="resetting"?"Start Next Episode":K==="stopping"?"Stopping...":K==="error"?"Recording failed":"Advance",ae=K==="recording"?sX:Tc,fe=s.available_controls.exit_early&&d===null&&(K==="recording"||K==="resetting"),we=$>0?Math.min(q/$*100,100):0;return h.jsxs("div",{className:"min-h-screen bg-black text-white p-8",children:[h.jsxs("div",{className:"max-w-2xl mx-auto",children:[h.jsx("div",{className:"mb-8",children:h.jsxs(Je,{onClick:()=>e("/"),variant:"outline",className:"border-gray-500 hover:border-gray-200 text-gray-300 hover:text-white",children:[h.jsx(ll,{className:"w-4 h-4 mr-2"}),"Back to Home"]})}),h.jsxs("div",{className:"bg-gray-900 rounded-lg border border-gray-700 p-8",children:[h.jsxs("div",{className:"flex justify-end items-center gap-4 mb-6 text-sm text-gray-400",children:[h.jsxs("span",{"aria-label":`Episode ${te} of ${H}`,children:["Episode ",h.jsx("span",{className:"text-white font-semibold",children:te})," / ",H]}),h.jsx("span",{className:"font-mono","aria-label":`Total session time ${C(Y)}`,children:C(Y)}),h.jsx(Je,{variant:"ghost",size:"icon",onClick:T,"aria-label":v?"Unmute":"Mute",className:"h-8 w-8 text-gray-400 hover:text-white hover:bg-gray-800",children:v?h.jsx(uX,{className:"w-5 h-5"}):h.jsx(cX,{className:"w-5 h-5"})}),h.jsxs(sce,{children:[h.jsx(lce,{asChild:!0,children:h.jsx(Je,{variant:"ghost",size:"icon",className:"h-8 w-8 text-gray-400 hover:text-white hover:bg-gray-800","aria-label":"More actions",children:h.jsx(J9,{className:"w-5 h-5"})})}),h.jsxs(bz,{align:"end",onCloseAutoFocus:ie=>ie.preventDefault(),className:"bg-gray-900 border-gray-700 text-white",children:[h.jsxs(T1,{onClick:D,disabled:!s.available_controls.rerecord_episode,className:"focus:bg-gray-800 focus:text-white",children:[h.jsx(oX,{className:"w-4 h-4 mr-2"}),"Re-record episode"]}),h.jsxs(T1,{onClick:U,disabled:!s.available_controls.stop_recording,className:"text-red-400 focus:bg-gray-800 focus:text-red-300",children:[h.jsx(Od,{className:"w-4 h-4 mr-2"}),"Stop recording"]})]})]})]}),h.jsx("div",{className:"text-center mb-6",children:h.jsxs("div",{role:"status","aria-live":"polite",className:`inline-flex items-center gap-2 px-3 py-1 rounded-full text-xs font-bold tracking-widest ${J.pill}`,children:[h.jsx("span",{className:`w-2 h-2 rounded-full ${J.dot} ${K!=="completed"?"animate-pulse":""}`}),ee()]})}),h.jsxs("div",{className:"text-center mb-4",children:[h.jsx("div",{className:`text-7xl font-mono font-bold leading-none ${J.timer}`,children:C(q)}),h.jsxs("div",{className:"text-sm text-gray-500 mt-2",children:["/ ",C($)]})]}),h.jsx("div",{className:"w-full bg-gray-800 rounded-full h-1.5 mb-8",children:h.jsx("div",{className:`h-1.5 rounded-full transition-all duration-500 ${J.bar}`,style:{width:`${we}%`}})}),h.jsxs(Je,{onClick:R,disabled:!fe,className:`w-full text-white font-semibold py-6 text-lg disabled:opacity-50 ${J.button}`,children:[h.jsx(ae,{className:"w-5 h-5 mr-2"}),ce,(K==="recording"||K==="resetting")&&h.jsx("span",{className:"ml-3 px-2 py-0.5 rounded text-xs font-mono bg-black/30 text-white/70",children:"SPACE / โ†’"})]}),K==="completed"&&h.jsx("p",{className:"text-center text-sm text-gray-400 mt-6",children:"Recording complete โ€” redirecting to uploadโ€ฆ"})]})]}),h.jsx(bC,{open:p,onOpenChange:y,children:h.jsxs(Yx,{className:"bg-gray-900 border-gray-700 text-white",children:[h.jsxs(Jx,{children:[h.jsx(Qx,{children:"Stop recording?"}),h.jsx(eb,{className:"text-gray-400",children:"Saved episodes are kept. The session will end and you'll be taken to the upload page."})]}),h.jsxs(Zx,{children:[h.jsx(nb,{className:"bg-gray-800 border-gray-700 text-white hover:bg-gray-700",children:"Keep recording"}),h.jsx(tb,{onClick:O,className:"bg-red-500 hover:bg-red-600 text-white",children:"Stop"})]})]})})]})},Dce=[{value:"act",label:"ACT (Action Chunking Transformer)"},{value:"diffusion",label:"Diffusion Policy"},{value:"pi0",label:"PI0"},{value:"pi05",label:"PI0.5"},{value:"pi0_fast",label:"PI0 Fast"},{value:"smolvla",label:"SmolVLA"},{value:"vqbet",label:"VQ-BeT"}],Ih=new Set(["pi0","pi05"]),M1=new Set(["pi0_fast"]),A1=new Set(["smolvla"]);function zz(t){return{dtype:Ih.has(t)||M1.has(t),gradientCheckpointing:Ih.has(t)||M1.has(t),freezeVisionEncoder:Ih.has(t)||A1.has(t),trainExpertOnly:Ih.has(t)||A1.has(t)}}const sv={policy_dtype:void 0,policy_gradient_checkpointing:void 0,policy_freeze_vision_encoder:void 0,policy_train_expert_only:void 0};function Lce(t,e){return Ih.has(t)?{...sv,batch_size:Math.min(e.batch_size||1,1),policy_use_amp:!0,policy_dtype:"bfloat16",policy_gradient_checkpointing:!0,policy_freeze_vision_encoder:!0,policy_train_expert_only:!0}:M1.has(t)?{...sv,batch_size:Math.min(e.batch_size||1,1),policy_use_amp:!0,policy_dtype:"bfloat16",policy_gradient_checkpointing:!0}:A1.has(t)?{...sv,batch_size:Math.min(e.batch_size||1,1),policy_use_amp:!0,policy_freeze_vision_encoder:!0,policy_train_expert_only:!0}:{...sv,policy_use_amp:!1}}const kw=()=>{const t=ji();return h.jsx("div",{className:"flex items-center justify-between mb-8",children:h.jsxs("div",{className:"flex items-center gap-4 text-3xl",children:[h.jsx(Je,{variant:"ghost",size:"icon",onClick:()=>t("/"),className:"text-slate-400 hover:bg-slate-800 hover:text-white rounded-lg",children:h.jsx(ll,{className:"w-5 h-5"})}),h.jsx(Gx,{}),h.jsx("h1",{className:"font-bold text-white text-2xl",children:"Training"})]})})},M2=/^[\w.\-]+\/[\w.\-]+$/,kce=({datasets:t,loading:e,value:n,onChange:r})=>{const[i,o]=Q.useState(!1),[a,s]=Q.useState(!1),[l,c]=Q.useState(""),u=()=>{const y=l.trim();M2.test(y)&&(r(y),s(!1))},d=t.filter(y=>y.source==="local"||y.source==="both"),f=t.filter(y=>y.source==="hub"),p=y=>h.jsxs(kd,{value:y.repo_id,onSelect:()=>{r(y.repo_id),o(!1)},className:"text-white aria-selected:bg-gray-700",children:[h.jsx(xl,{className:He("mr-2 h-4 w-4",n===y.repo_id?"opacity-100":"opacity-0")}),h.jsx("span",{className:"flex-1 truncate",children:y.repo_id}),y.source==="both"&&h.jsx("span",{className:"text-xs text-gray-400 mr-2",children:"on Hub"}),y.private&&h.jsx("span",{className:"text-xs text-amber-400",children:"private"})]},y.repo_id);return a?h.jsxs("div",{className:"flex gap-2",children:[h.jsx(hi,{autoFocus:!0,value:l,onChange:y=>c(y.target.value),onKeyDown:y=>{y.key==="Enter"&&u()},placeholder:"org/dataset-name",className:"bg-gray-800 border-gray-600 text-white"}),h.jsx(Je,{onClick:u,disabled:!M2.test(l.trim()),children:"Use"}),h.jsx(Je,{variant:"ghost",onClick:()=>s(!1),children:"Cancel"})]}):h.jsxs(Sx,{open:i,onOpenChange:o,children:[h.jsx(Ex,{asChild:!0,children:h.jsxs(Je,{variant:"outline",role:"combobox","aria-expanded":i,className:"w-full justify-between bg-gray-800 border-gray-600 text-white hover:bg-gray-700",children:[n??(e?"Loading datasetsโ€ฆ":"Select a datasetโ€ฆ"),h.jsx(tA,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),h.jsx(Rm,{className:"w-[--radix-popover-trigger-width] p-0 bg-gray-800 border-gray-700",align:"start",children:h.jsxs(Mx,{className:"bg-gray-800 text-white",children:[h.jsx(Ax,{placeholder:"Search datasetsโ€ฆ",className:"text-white"}),h.jsxs(Cx,{children:[h.jsx(Px,{children:e?"Loadingโ€ฆ":"No datasets."}),d.length>0&&h.jsx(Qs,{heading:"Local",children:d.map(p)}),f.length>0&&h.jsx(Qs,{heading:"Hugging Face",children:f.map(p)}),h.jsx(Qs,{children:h.jsxs(kd,{onSelect:()=>{s(!0),o(!1)},className:"text-purple-300 aria-selected:bg-gray-700",children:[h.jsx(iX,{className:"mr-2 h-4 w-4"}),"Use custom repo IDโ€ฆ"]})})]})]})})]})},jce=1500;function Hz(t,e=!0){const{baseUrl:n,fetchWithHeaders:r}=Dn(),[i,o]=_.useState("idle"),[a,s]=_.useState(null),[l,c]=_.useState([]),u=_.useRef(null);_.useEffect(()=>{if(!e)return;let p=!1;return r(`${n}/${t}/install-status`).then(y=>y.json()).then(y=>{p||(o(y.state),s(y.error),y.logs.length>0&&c(y.logs))}).catch(()=>{}),()=>{p=!0}},[e,n,r,t]),_.useEffect(()=>{if(i!=="installing")return;const p=setInterval(async()=>{try{const y=await r(`${n}/${t}/install-status`);if(!y.ok)return;const v=await y.json();v.logs&&v.logs.length>0&&c(g=>[...g,...v.logs]),v.state!=="installing"&&(o(v.state),s(v.error))}catch{}},jce);return()=>clearInterval(p)},[i,n,r,t]),_.useEffect(()=>{u.current&&(u.current.scrollTop=u.current.scrollHeight)},[l]);const d=_.useCallback(async()=>{o("installing"),s(null),c([]);try{const p=await r(`${n}/${t}/install`,{method:"POST"}),y=await p.json();if(!y.started&&p.ok)return;p.ok||(o("error"),s(y.message||`Install request failed (${p.status})`))}catch(p){o("error"),s(`Install request failed: ${p instanceof Error?p.message:String(p)}`)}},[n,r,t]),f=_.useCallback(()=>{o("idle"),s(null),c([])},[]);return{state:i,error:a,logs:l,logBoxRef:u,handleInstall:d,handleRetry:f}}function Vz(t,e){switch(t){case"done":return"Install Complete";case"error":return"Install Failed";case"installing":return"Installingโ€ฆ";default:return e}}function Gz({state:t}){return t==="done"?h.jsx(nA,{className:"w-6 h-6 text-green-400"}):t==="error"?h.jsx(nd,{className:"w-6 h-6 text-red-400"}):t==="installing"?h.jsx(fi,{className:"w-6 h-6 text-sky-400 animate-spin"}):h.jsx(oa,{className:"w-6 h-6 text-amber-400"})}const Wz=({state:t,error:e,logs:n,logBoxRef:r,onInstall:i,onRetry:o,installHint:a,packageName:s,idleDescription:l,doneDescription:c})=>{const{toast:u}=_r(),d=async()=>{try{await navigator.clipboard.writeText(a),u({title:"Copied",description:a})}catch{u({title:"Copy failed",description:"Select the command and copy manually.",variant:"destructive"})}};return h.jsxs(h.Fragment,{children:[t==="idle"&&h.jsxs(h.Fragment,{children:[h.jsx("p",{className:"text-slate-300",children:l}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("code",{className:"flex-1 bg-slate-900 border border-slate-700 rounded-lg px-3 py-2 text-sm text-slate-200 font-mono",children:a}),h.jsx(Je,{variant:"ghost",size:"icon",onClick:d,className:"text-slate-400 hover:text-white","aria-label":"Copy install command",children:h.jsx(rA,{className:"w-4 h-4"})})]}),h.jsx(Je,{onClick:i,className:"bg-green-500 hover:bg-green-600 text-white font-semibold",children:"Install Now"})]}),t==="installing"&&h.jsxs("p",{className:"text-slate-300",children:["Installing"," ",h.jsx("code",{className:"px-1 py-0.5 rounded bg-slate-900 text-sky-300",children:s}),". This usually takes about 10 seconds."]}),t==="done"&&h.jsx("div",{className:"space-y-3 text-slate-300",children:c}),t==="error"&&h.jsxs(h.Fragment,{children:[h.jsx("p",{className:"text-red-300",children:e||"Install failed."}),h.jsx(Je,{onClick:o,className:"bg-slate-700 hover:bg-slate-600 text-white",children:"Try again"})]}),t==="error"&&n.length>0&&h.jsx("div",{ref:r,className:"bg-slate-900 rounded-lg p-3 h-48 overflow-y-auto font-mono text-xs border border-slate-700 text-slate-300 whitespace-pre-wrap break-words",children:n.map((f,p)=>h.jsx("div",{children:f.message},p))})]})},Xz=({purpose:t})=>h.jsxs(h.Fragment,{children:[h.jsxs("p",{children:["Install complete. Restart"," ",h.jsx("code",{className:"px-1 py-0.5 rounded bg-slate-900 text-sky-300",children:"lelab"})," ","to enable ",t,":"]}),h.jsxs("ol",{className:"list-decimal list-inside space-y-2 pl-1",children:[h.jsxs("li",{children:["Press"," ",h.jsx("kbd",{className:"px-1.5 py-0.5 rounded bg-slate-900 border border-slate-600 text-xs font-mono text-slate-200",children:"Ctrl+C"})," ","in the terminal running"," ",h.jsx("code",{className:"px-1 py-0.5 rounded bg-slate-900 text-sky-300",children:"lelab"}),"."]}),h.jsxs("li",{children:["Run"," ",h.jsx("code",{className:"px-1 py-0.5 rounded bg-slate-900 text-sky-300",children:"lelab"})," ","again."]})]})]}),Uce=({open:t,onOpenChange:e,installHint:n})=>{const r=Hz("system/wandb-extra",t);return h.jsx(Hc,{open:t,onOpenChange:e,children:h.jsxs(bl,{className:"bg-slate-800 border-slate-700 text-white max-w-2xl",children:[h.jsxs(_l,{children:[h.jsxs(wl,{className:"flex items-center gap-3 text-white",children:[h.jsx(Gz,{state:r.state}),Vz(r.state,"Weights & Biases Not Installed")]}),h.jsx(Sl,{className:"sr-only",children:"Install the wandb package to enable W&B logging."})]}),h.jsx("div",{className:"space-y-4",children:h.jsx(Wz,{state:r.state,error:r.error,logs:r.logs,logBoxRef:r.logBoxRef,onInstall:r.handleInstall,onRetry:r.handleRetry,installHint:n,packageName:"wandb",idleTitle:"Weights & Biases Not Installed",idleDescription:h.jsxs(h.Fragment,{children:["Enabling W&B logging requires the"," ",h.jsx("code",{className:"px-1 py-0.5 rounded bg-slate-900 text-sky-300",children:"wandb"})," ","package, which isn't installed in this environment. Install it to log this run to W&B."]}),doneDescription:h.jsx(Xz,{purpose:"W&B logging"})})})]})})},Fce=({config:t,updateConfig:e,datasets:n,datasetsLoading:r})=>{const{baseUrl:i,fetchWithHeaders:o}=Dn(),[a,s]=_.useState(!1),[l,c]=_.useState("pip install wandb"),u=t.target.runner==="seeed_cloud"||t.target.runner==="external",d=async f=>{if(!f){e("wandb_enable",!1);return}try{const y=await(await o(`${i}/system/wandb-extra`)).json();y.available?e("wandb_enable",!0):(c(y.install_hint),s(!0))}catch{e("wandb_enable",!0)}};return h.jsxs(Gr,{className:"bg-slate-800/50 border-slate-700 rounded-xl",children:[h.jsx(Uo,{children:h.jsx(ga,{className:"text-white",children:"Run Configuration"})}),h.jsxs(Wr,{className:"space-y-6",children:[h.jsxs("div",{children:[h.jsx(Tt,{className:"text-slate-300",children:"Dataset Repository ID *"}),h.jsx("div",{className:"mt-1",children:h.jsx(kce,{datasets:n,loading:r,value:t.dataset_repo_id||null,onChange:f=>{f&&e("dataset_repo_id",f)}})}),h.jsx("p",{className:"text-xs text-slate-500 mt-1",children:u?"LeLab dataset repository ID; Seeed Cloud also accepts an archive URL or SEEED_CLOUD_DATASET_URL override":"HuggingFace Hub dataset repository ID"})]}),h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"policy_type",className:"text-slate-300",children:"Policy"}),h.jsxs(Ga,{value:t.policy_type,onValueChange:f=>e("policy_type",f),children:[h.jsx(sa,{id:"policy_type",className:"bg-slate-900 border-slate-600 text-white rounded-lg",children:h.jsx(Wa,{})}),h.jsx(la,{className:"bg-slate-800 border-slate-600 text-white",children:Dce.map(f=>h.jsx($n,{value:f.value,children:f.label},f.value))})]})]}),h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"steps",className:"text-slate-300",children:"Training Steps"}),h.jsx(mr,{id:"steps",value:t.steps,onChange:f=>{f!==void 0&&e("steps",f)},className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]}),h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"batch_size",className:"text-slate-300",children:"Batch Size"}),h.jsx(mr,{id:"batch_size",value:t.batch_size,onChange:f=>{f!==void 0&&e("batch_size",f)},className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]}),h.jsxs("div",{className:"flex items-center space-x-3 pt-6",children:[h.jsx(bo,{id:"wandb_enable",checked:t.wandb_enable,onCheckedChange:d,className:"data-[state=checked]:bg-green-500"}),h.jsx(Tt,{htmlFor:"wandb_enable",className:"text-slate-300",children:"Enable Weights & Biases"})]})]}),h.jsx(Uce,{open:a,onOpenChange:s,installHint:l}),t.wandb_enable&&h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"wandb_project",className:"text-slate-300",children:"W&B Project Name"}),h.jsx(hi,{id:"wandb_project",value:t.wandb_project||"",onChange:f=>e("wandb_project",f.target.value||void 0),placeholder:"my-robotics-project",className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]})]})]})},wu=({children:t})=>h.jsx("h4",{className:"text-xs font-semibold text-slate-400 uppercase tracking-wider",children:t}),Bce=({config:t,updateConfig:e})=>{const[n,r]=_.useState(!1),i=zz(t.policy_type);return h.jsxs(Gr,{className:"bg-slate-800/50 border-slate-700 rounded-xl",children:[h.jsxs(Uo,{role:"button",tabIndex:0,"aria-expanded":n,onClick:()=>r(o=>!o),onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),r(a=>!a))},className:"cursor-pointer select-none flex flex-row items-center justify-between",children:[h.jsx("span",{className:"text-white font-semibold",children:"Advanced"}),h.jsxs("span",{className:"flex items-center gap-1 text-slate-400 text-sm",children:[n?h.jsx(hc,{className:"w-4 h-4"}):h.jsx(bp,{className:"w-4 h-4"}),n?"Hide":"Show"]})]}),n&&h.jsxs(Wr,{className:"space-y-8",children:[h.jsxs("section",{className:"space-y-4",children:[h.jsx(wu,{children:"Policy"}),h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"policy_device",className:"text-slate-300",children:"Device"}),h.jsxs(Ga,{value:t.policy_device||"cuda",onValueChange:o=>e("policy_device",o),children:[h.jsx(sa,{id:"policy_device",className:"bg-slate-900 border-slate-600 text-white rounded-lg",children:h.jsx(Wa,{})}),h.jsxs(la,{className:"bg-slate-800 border-slate-600 text-white",children:[h.jsx($n,{value:"cuda",children:"CUDA (GPU)"}),h.jsx($n,{value:"cpu",children:"CPU"}),h.jsx($n,{value:"mps",children:"MPS (Apple Silicon)"})]})]})]}),h.jsxs("div",{className:"flex items-center space-x-3 pt-6",children:[h.jsx(bo,{id:"policy_use_amp",checked:t.policy_use_amp,onCheckedChange:o=>e("policy_use_amp",o)}),h.jsx(Tt,{htmlFor:"policy_use_amp",className:"text-slate-300",children:"Use Automatic Mixed Precision"})]}),i.dtype&&h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"policy_dtype",className:"text-slate-300",children:"Policy dtype"}),h.jsxs(Ga,{value:t.policy_dtype||"default",onValueChange:o=>e("policy_dtype",o==="default"?void 0:o),children:[h.jsx(sa,{id:"policy_dtype",className:"bg-slate-900 border-slate-600 text-white rounded-lg",children:h.jsx(Wa,{})}),h.jsxs(la,{className:"bg-slate-800 border-slate-600 text-white",children:[h.jsx($n,{value:"default",children:"Policy default"}),h.jsx($n,{value:"bfloat16",children:"bfloat16"}),h.jsx($n,{value:"float32",children:"float32"})]})]})]}),i.gradientCheckpointing&&h.jsxs("div",{className:"flex items-center space-x-3 pt-6",children:[h.jsx(bo,{id:"policy_gradient_checkpointing",checked:!!t.policy_gradient_checkpointing,onCheckedChange:o=>e("policy_gradient_checkpointing",o)}),h.jsx(Tt,{htmlFor:"policy_gradient_checkpointing",className:"text-slate-300",children:"Gradient checkpointing"})]}),i.freezeVisionEncoder&&h.jsxs("div",{className:"flex items-center space-x-3 pt-6",children:[h.jsx(bo,{id:"policy_freeze_vision_encoder",checked:!!t.policy_freeze_vision_encoder,onCheckedChange:o=>e("policy_freeze_vision_encoder",o)}),h.jsx(Tt,{htmlFor:"policy_freeze_vision_encoder",className:"text-slate-300",children:"Freeze vision encoder"})]}),i.trainExpertOnly&&h.jsxs("div",{className:"flex items-center space-x-3 pt-6",children:[h.jsx(bo,{id:"policy_train_expert_only",checked:!!t.policy_train_expert_only,onCheckedChange:o=>e("policy_train_expert_only",o)}),h.jsx(Tt,{htmlFor:"policy_train_expert_only",className:"text-slate-300",children:"Train expert only"})]})]})]}),h.jsx(Jl,{className:"bg-slate-700"}),h.jsxs("section",{className:"space-y-4",children:[h.jsx(wu,{children:"Training"}),h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"seed",className:"text-slate-300",children:"Random Seed"}),h.jsx(mr,{id:"seed",value:t.seed,onChange:o=>e("seed",o),className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]}),h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"num_workers",className:"text-slate-300",children:"Number of Workers"}),h.jsx(mr,{id:"num_workers",value:t.num_workers,onChange:o=>{o!==void 0&&e("num_workers",o)},className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]})]})]}),h.jsx(Jl,{className:"bg-slate-700"}),h.jsxs("section",{className:"space-y-4",children:[h.jsx(wu,{children:"Optimizer"}),h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"optimizer_type",className:"text-slate-300",children:"Optimizer"}),h.jsxs(Ga,{value:t.optimizer_type||"adam",onValueChange:o=>e("optimizer_type",o),children:[h.jsx(sa,{id:"optimizer_type",className:"bg-slate-900 border-slate-600 text-white rounded-lg",children:h.jsx(Wa,{})}),h.jsxs(la,{className:"bg-slate-800 border-slate-600 text-white",children:[h.jsx($n,{value:"adam",children:"Adam"}),h.jsx($n,{value:"adamw",children:"AdamW"}),h.jsx($n,{value:"sgd",children:"SGD"}),h.jsx($n,{value:"multi_adam",children:"Multi Adam"})]})]})]}),h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"optimizer_lr",className:"text-slate-300",children:"Learning Rate"}),h.jsx(mr,{id:"optimizer_lr",integer:!1,step:"0.0001",value:t.optimizer_lr,onChange:o=>e("optimizer_lr",o),placeholder:"Use policy default",className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]}),h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"optimizer_weight_decay",className:"text-slate-300",children:"Weight Decay"}),h.jsx(mr,{id:"optimizer_weight_decay",integer:!1,step:"0.0001",value:t.optimizer_weight_decay,onChange:o=>e("optimizer_weight_decay",o),placeholder:"Use policy default",className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]}),h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"optimizer_grad_clip_norm",className:"text-slate-300",children:"Gradient Clipping"}),h.jsx(mr,{id:"optimizer_grad_clip_norm",integer:!1,step:"0.0001",value:t.optimizer_grad_clip_norm,onChange:o=>e("optimizer_grad_clip_norm",o),placeholder:"Use policy default",className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]})]})]}),h.jsx(Jl,{className:"bg-slate-700"}),h.jsxs("section",{className:"space-y-4",children:[h.jsx(wu,{children:"Logging & Checkpointing"}),h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"log_freq",className:"text-slate-300",children:"Log Frequency"}),h.jsx(mr,{id:"log_freq",value:t.log_freq,onChange:o=>{o!==void 0&&e("log_freq",o)},className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]}),h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"save_freq",className:"text-slate-300",children:"Save Frequency"}),h.jsx(mr,{id:"save_freq",value:t.save_freq,onChange:o=>{o!==void 0&&e("save_freq",o)},className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]})]}),h.jsxs("div",{className:"flex items-center space-x-3",children:[h.jsx(bo,{id:"save_checkpoint",checked:t.save_checkpoint,onCheckedChange:o=>e("save_checkpoint",o)}),h.jsx(Tt,{htmlFor:"save_checkpoint",className:"text-slate-300",children:"Save Checkpoints"})]}),h.jsxs("div",{className:"flex items-center space-x-3",children:[h.jsx(bo,{id:"resume",checked:t.resume,onCheckedChange:o=>e("resume",o)}),h.jsx(Tt,{htmlFor:"resume",className:"text-slate-300",children:"Resume from Checkpoint"})]})]}),t.wandb_enable&&h.jsxs(h.Fragment,{children:[h.jsx(Jl,{className:"bg-slate-700"}),h.jsxs("section",{className:"space-y-4",children:[h.jsx(wu,{children:"Weights & Biases"}),h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"wandb_entity",className:"text-slate-300",children:"W&B Entity (optional)"}),h.jsx(hi,{id:"wandb_entity",value:t.wandb_entity||"",onChange:o=>e("wandb_entity",o.target.value||void 0),placeholder:"your-username",className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]}),h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"wandb_notes",className:"text-slate-300",children:"W&B Notes (optional)"}),h.jsx(hi,{id:"wandb_notes",value:t.wandb_notes||"",onChange:o=>e("wandb_notes",o.target.value||void 0),placeholder:"Training run notes...",className:"bg-slate-900 border-slate-600 text-white rounded-lg"})]}),h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"wandb_mode",className:"text-slate-300",children:"W&B Mode"}),h.jsxs(Ga,{value:t.wandb_mode||"online",onValueChange:o=>e("wandb_mode",o),children:[h.jsx(sa,{id:"wandb_mode",className:"bg-slate-900 border-slate-600 text-white rounded-lg",children:h.jsx(Wa,{})}),h.jsxs(la,{className:"bg-slate-800 border-slate-600 text-white",children:[h.jsx($n,{value:"online",children:"Online"}),h.jsx($n,{value:"offline",children:"Offline"}),h.jsx($n,{value:"disabled",children:"Disabled"})]})]})]}),h.jsxs("div",{className:"flex items-center space-x-3",children:[h.jsx(bo,{id:"wandb_disable_artifact",checked:t.wandb_disable_artifact,onCheckedChange:o=>e("wandb_disable_artifact",o)}),h.jsx(Tt,{htmlFor:"wandb_disable_artifact",className:"text-slate-300",children:"Disable Artifacts"})]})]})]}),!t.wandb_enable&&h.jsx(Jl,{className:"bg-slate-700"}),h.jsxs("section",{className:"space-y-4",children:[h.jsx(wu,{children:"Misc"}),h.jsxs("div",{className:"flex items-center space-x-3",children:[h.jsx(bo,{id:"use_policy_training_preset",checked:t.use_policy_training_preset,onCheckedChange:o=>e("use_policy_training_preset",o)}),h.jsx(Tt,{htmlFor:"use_policy_training_preset",className:"text-slate-300",children:"Use Policy Training Preset"})]})]})]})]})},$ce=(t,e)=>`$${(e==="minute"?t*60:t).toFixed(2)}/hr`,zce=t=>{const e=t.accelerator;if(!e)return{manufacturer:"",model:t.cpu||t.pretty_name||t.name};if(typeof e=="string")return{manufacturer:/nvidia/i.test(e)?"":"Nvidia",model:e};const n=String(e.quantity??"").trim(),r=n&&n!=="1"?`${n}x `:"";return{manufacturer:e.manufacturer||"",model:`${r}${e.model||t.pretty_name||t.name}`}},Hce=t=>{const{manufacturer:e,model:n}=zce(t);return[e,n].filter(Boolean).join(" ")},dh=(t,e)=>`${t} ${Hce(e)} - ${$ce(e.unit_cost_usd,e.unit_label)}`,A2=t=>{const e=[t.cpu,t.ram].filter(Boolean);return e.length>0?e.join(" ยท "):t.pretty_name},Bl="seeed_cloud",Vce=({config:t,updateConfig:e,authenticated:n,flavors:r,providers:i,loading:o,seeedConnecting:a,onConnectSeeedCloud:s})=>{const l=t.target,[c,u]=_.useState(!1),[d,f]=_.useState(!0),[p,y]=_.useState({[Bl]:!0}),v=_.useMemo(()=>i??[],[i]),g=_.useMemo(()=>r??[],[r]),m=v.find(A=>A.id===Bl),x=v.map(A=>({...A,open:p[A.id]??A.id===Bl,label:A.id===Bl?"Seeed Cloud":A.display_name})),b=_.useMemo(()=>{if(l.runner==="local")return"Local - your machine";if(l.runner==="hf_cloud"){const C=g.find(P=>P.name===l.flavor);return C?dh("HF",C):"Hugging Face"}if(l.runner==="seeed_cloud"){const C=m==null?void 0:m.flavors.find(P=>P.name===l.flavor);return C?dh("Seeed",C):"Seeed Cloud"}const A=v.find(C=>C.id===l.provider),M=A==null?void 0:A.flavors.find(C=>C.name===l.flavor);return M?dh((A==null?void 0:A.display_name)??"External",M):(A==null?void 0:A.display_name)??"External"},[g,v,m,l]),S=A=>{if(A==="local")e("target",{runner:"local"});else if(A.startsWith("hf:")){const M=A.slice(3);e("target",{runner:"hf_cloud",flavor:M})}else if(A.startsWith("seeed:")){const M=A.slice(6);e("target",{runner:"seeed_cloud",flavor:M})}else if(A.startsWith("external:")){const[,M,C]=A.split(":");e("target",{runner:"external",provider:M,flavor:C})}u(!1)},w=l.runner==="local"?"local":l.runner==="hf_cloud"?`hf:${l.flavor??""}`:l.runner==="seeed_cloud"?`seeed:${l.flavor??""}`:`external:${l.provider}:${l.flavor??""}`,E=(A,M,C,P)=>h.jsxs("button",{type:"button",disabled:P,onClick:()=>S(A),className:He("flex min-h-10 w-full items-center gap-3 rounded-md px-3 py-2 text-left text-sm transition-colors","hover:bg-slate-700/80 focus:bg-slate-700/80 focus:outline-none",P&&"cursor-not-allowed opacity-45 hover:bg-transparent"),children:[h.jsx(xl,{className:He("h-4 w-4 shrink-0 text-emerald-300",w===A?"opacity-100":"opacity-0")}),h.jsxs("span",{className:"min-w-0 flex-1",children:[h.jsx("span",{className:"block truncate text-slate-100",children:M}),C?h.jsx("span",{className:"block truncate text-xs text-slate-500",children:C}):null]})]},A),T=(A,M)=>{y(C=>({...C,[A]:M}))};return h.jsxs(Gr,{className:"bg-slate-800/50 border-slate-700 rounded-xl",children:[h.jsx(Uo,{children:h.jsx(ga,{className:"text-white",children:"Compute target"})}),h.jsx(Wr,{className:"space-y-3",children:h.jsxs("div",{children:[h.jsx(Tt,{className:"text-slate-300",children:"Run training on"}),h.jsxs(Sx,{open:c,onOpenChange:u,children:[h.jsx(Ex,{asChild:!0,children:h.jsxs(Je,{type:"button",variant:"outline",className:"mt-1 flex h-11 w-full justify-between border-slate-600 bg-slate-900 px-3 text-left text-white hover:bg-slate-900 hover:text-white",children:[h.jsx("span",{className:"min-w-0 flex-1 truncate",children:o?"Loading...":b}),h.jsx(hc,{className:"ml-3 h-4 w-4 shrink-0 text-slate-400"})]})}),h.jsx(Rm,{align:"start",className:"w-[min(560px,calc(100vw-2rem))] border-slate-700 bg-slate-800 p-2 text-white shadow-xl",children:h.jsxs("div",{className:"max-h-[440px] overflow-y-auto pr-1",children:[E("local","Local - your machine","Free",!1),h.jsxs(Ty,{open:d,onOpenChange:f,children:[h.jsxs(My,{className:"mt-1 flex h-10 w-full items-center gap-2 rounded-md px-3 text-left text-sm text-slate-200 hover:bg-slate-700/70",children:[d?h.jsx(hc,{className:"h-4 w-4 text-slate-400"}):h.jsx(bp,{className:"h-4 w-4 text-slate-400"}),h.jsx("span",{className:"font-medium",children:"Hugging Face"}),h.jsx(w1,{variant:"outline",className:"ml-auto border-slate-600 text-slate-300",children:n?`${g.length} flavors`:"Login required"})]}),h.jsx(Ay,{className:"ml-3 border-l border-slate-700 pl-2",children:n&&g.length>0?g.map(A=>E(`hf:${A.name}`,dh("HF",A),A2(A),!1)):h.jsx("div",{className:"px-8 py-3 text-xs text-slate-500",children:n?"No HF hardware flavors available.":"Log in to HF to unlock official flavors."})})]}),x.map(A=>h.jsxs(Ty,{open:A.open,onOpenChange:M=>T(A.id,M),children:[h.jsxs(My,{className:"mt-1 flex h-10 w-full items-center gap-2 rounded-md px-3 text-left text-sm text-slate-200 hover:bg-slate-700/70",children:[A.open?h.jsx(hc,{className:"h-4 w-4 text-slate-400"}):h.jsx(bp,{className:"h-4 w-4 text-slate-400"}),h.jsx("span",{className:"font-medium",children:A.label}),h.jsx(w1,{variant:"outline",className:He("ml-auto border-slate-600 text-slate-300",A.authenticated&&"border-emerald-500/50 text-emerald-200"),children:A.authenticated?`Connected ยท ${A.flavors.length} flavors`:"Connect required"})]}),h.jsxs(Ay,{className:"ml-3 border-l border-slate-700 pl-2",children:[!A.authenticated&&A.id===Bl?h.jsxs("div",{className:"flex items-center justify-between gap-3 px-3 py-2",children:[h.jsx("span",{className:"text-xs text-slate-500",children:"Connect to unlock Seeed Cloud flavors."}),h.jsxs(Je,{type:"button",size:"sm",variant:"outline",disabled:a,onClick:s,className:"h-8 shrink-0 border-amber-400/60 bg-slate-900 text-amber-100 hover:bg-amber-500/20",children:[a?h.jsx(fi,{className:"mr-2 h-4 w-4 animate-spin"}):h.jsx(nX,{className:"mr-2 h-4 w-4"}),"Connect"]})]}):null,A.flavors.length>0?A.flavors.map(M=>{const C=A.id===Bl?"Seeed":A.display_name,P=A.id===Bl?`seeed:${M.name}`:`external:${A.id}:${M.name}`;return E(P,dh(C,M),A2(M),!A.authenticated)}):h.jsx("div",{className:"px-8 py-3 text-xs text-slate-500",children:"No flavors available."})]})]},A.id))]})})]}),h.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Cost shown is per running hour. Final policy uploads to your HF account when training completes."})]})})]})},Gce=({config:t,updateConfig:e,datasets:n,datasetsLoading:r,authenticated:i,flavors:o,providers:a,hardwareLoading:s,seeedConnecting:l,onConnectSeeedCloud:c})=>h.jsxs("div",{className:"max-w-3xl mx-auto space-y-6",children:[h.jsx(Vce,{config:t,updateConfig:e,authenticated:i,flavors:o,providers:a,loading:s,seeedConnecting:l,onConnectSeeedCloud:c}),h.jsx(Fce,{config:t,updateConfig:e,datasets:n,datasetsLoading:r}),h.jsx(Bce,{config:t,updateConfig:e})]});var Wce=Array.isArray,yi=Wce,Xce=typeof Qm=="object"&&Qm&&Qm.Object===Object&&Qm,qz=Xce,qce=qz,Kce=typeof self=="object"&&self&&self.Object===Object&&self,Yce=qce||Kce||Function("return this")(),Ta=Yce,Jce=Ta,Zce=Jce.Symbol,Fm=Zce,C2=Fm,Kz=Object.prototype,Qce=Kz.hasOwnProperty,eue=Kz.toString,fh=C2?C2.toStringTag:void 0;function tue(t){var e=Qce.call(t,fh),n=t[fh];try{t[fh]=void 0;var r=!0}catch{}var i=eue.call(t);return r&&(e?t[fh]=n:delete t[fh]),i}var nue=tue,rue=Object.prototype,iue=rue.toString;function oue(t){return iue.call(t)}var aue=oue,P2=Fm,sue=nue,lue=aue,cue="[object Null]",uue="[object Undefined]",R2=P2?P2.toStringTag:void 0;function due(t){return t==null?t===void 0?uue:cue:R2&&R2 in Object(t)?sue(t):lue(t)}var hs=due;function fue(t){return t!=null&&typeof t=="object"}var ps=fue,hue=hs,pue=ps,mue="[object Symbol]";function gue(t){return typeof t=="symbol"||pue(t)&&hue(t)==mue}var Cf=gue,vue=yi,yue=Cf,xue=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,bue=/^\w*$/;function _ue(t,e){if(vue(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||yue(t)?!0:bue.test(t)||!xue.test(t)||e!=null&&t in Object(e)}var _C=_ue;function wue(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Cl=wue;const Pf=dn(Cl);var Sue=hs,Eue=Cl,Tue="[object AsyncFunction]",Mue="[object Function]",Aue="[object GeneratorFunction]",Cue="[object Proxy]";function Pue(t){if(!Eue(t))return!1;var e=Sue(t);return e==Mue||e==Aue||e==Tue||e==Cue}var wC=Pue;const jt=dn(wC);var Rue=Ta,Nue=Rue["__core-js_shared__"],Oue=Nue,jw=Oue,N2=function(){var t=/[^.]+$/.exec(jw&&jw.keys&&jw.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Iue(t){return!!N2&&N2 in t}var Due=Iue,Lue=Function.prototype,kue=Lue.toString;function jue(t){if(t!=null){try{return kue.call(t)}catch{}try{return t+""}catch{}}return""}var Yz=jue,Uue=wC,Fue=Due,Bue=Cl,$ue=Yz,zue=/[\\^$.*+?()[\]{}|]/g,Hue=/^\[object .+?Constructor\]$/,Vue=Function.prototype,Gue=Object.prototype,Wue=Vue.toString,Xue=Gue.hasOwnProperty,que=RegExp("^"+Wue.call(Xue).replace(zue,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Kue(t){if(!Bue(t)||Fue(t))return!1;var e=Uue(t)?que:Hue;return e.test($ue(t))}var Yue=Kue;function Jue(t,e){return t==null?void 0:t[e]}var Zue=Jue,Que=Yue,ede=Zue;function tde(t,e){var n=ede(t,e);return Que(n)?n:void 0}var qc=tde,nde=qc,rde=nde(Object,"create"),rb=rde,O2=rb;function ide(){this.__data__=O2?O2(null):{},this.size=0}var ode=ide;function ade(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var sde=ade,lde=rb,cde="__lodash_hash_undefined__",ude=Object.prototype,dde=ude.hasOwnProperty;function fde(t){var e=this.__data__;if(lde){var n=e[t];return n===cde?void 0:n}return dde.call(e,t)?e[t]:void 0}var hde=fde,pde=rb,mde=Object.prototype,gde=mde.hasOwnProperty;function vde(t){var e=this.__data__;return pde?e[t]!==void 0:gde.call(e,t)}var yde=vde,xde=rb,bde="__lodash_hash_undefined__";function _de(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=xde&&e===void 0?bde:e,this}var wde=_de,Sde=ode,Ede=sde,Tde=hde,Mde=yde,Ade=wde;function Rf(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e-1}var Vde=Hde,Gde=ib;function Wde(t,e){var n=this.__data__,r=Gde(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var Xde=Wde,qde=Rde,Kde=Ude,Yde=$de,Jde=Vde,Zde=Xde;function Nf(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e0?1:-1},tc=function(e){return Dc(e)&&e.indexOf("%")===e.length-1},ze=function(e){return ghe(e)&&!Bm(e)},Yn=function(e){return ze(e)||Dc(e)},bhe=0,$m=function(e){var n=++bhe;return"".concat(e||"").concat(n)},Lc=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!ze(e)&&!Dc(e))return r;var o;if(tc(e)){var a=e.indexOf("%");o=n*parseFloat(e.slice(0,a))/100}else o=+e;return Bm(o)&&(o=r),i&&o>n&&(o=n),o},Cu=function(e){if(!e)return null;var n=Object.keys(e);return n&&n.length?e[n[0]]:null},_he=function(e){if(!Array.isArray(e))return!1;for(var n=e.length,r={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Che(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function P1(t){"@babel/helpers - typeof";return P1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},P1(t)}var U2={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Za=function(e){return typeof e=="string"?e:e?e.displayName||e.name||"Component":""},F2=null,Fw=null,NC=function t(e){if(e===F2&&Array.isArray(Fw))return Fw;var n=[];return _.Children.forEach(e,function(r){Ut(r)||(dhe.isFragment(r)?n=n.concat(t(r.props.children)):n.push(r))}),Fw=n,F2=e,n};function ro(t,e){var n=[],r=[];return Array.isArray(e)?r=e.map(function(i){return Za(i)}):r=[Za(e)],NC(t).forEach(function(i){var o=no(i,"type.displayName")||no(i,"type.name");r.indexOf(o)!==-1&&n.push(i)}),n}function Ei(t,e){var n=ro(t,e);return n&&n[0]}var B2=function(e){if(!e||!e.props)return!1;var n=e.props,r=n.width,i=n.height;return!(!ze(r)||r<=0||!ze(i)||i<=0)},Phe=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],Rhe=function(e){return e&&e.type&&Dc(e.type)&&Phe.indexOf(e.type)>=0},Nhe=function(e){return e&&P1(e)==="object"&&"clipDot"in e},Ohe=function(e,n,r,i){var o,a=(o=Uw==null?void 0:Uw[i])!==null&&o!==void 0?o:[];return n.startsWith("data-")||!jt(e)&&(i&&a.includes(n)||Ehe.includes(n))||r&&RC.includes(n)},$t=function(e,n,r){if(!e||typeof e=="function"||typeof e=="boolean")return null;var i=e;if(_.isValidElement(e)&&(i=e.props),!Pf(i))return null;var o={};return Object.keys(i).forEach(function(a){var s;Ohe((s=i)===null||s===void 0?void 0:s[a],a,n,r)&&(o[a]=i[a])}),o},R1=function t(e,n){if(e===n)return!0;var r=_.Children.count(e);if(r!==_.Children.count(n))return!1;if(r===0)return!0;if(r===1)return $2(Array.isArray(e)?e[0]:e,Array.isArray(n)?n[0]:n);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function jhe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function O1(t){var e=t.children,n=t.width,r=t.height,i=t.viewBox,o=t.className,a=t.style,s=t.title,l=t.desc,c=khe(t,Lhe),u=i||{width:n,height:r,x:0,y:0},d=zt("recharts-surface",o);return Z.createElement("svg",N1({},$t(c,!0,"svg"),{className:d,width:n,height:r,style:a,viewBox:"".concat(u.x," ").concat(u.y," ").concat(u.width," ").concat(u.height)}),Z.createElement("title",null,s),Z.createElement("desc",null,l),e)}var Uhe=["children","className"];function I1(){return I1=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Bhe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}var kn=Z.forwardRef(function(t,e){var n=t.children,r=t.className,i=Fhe(t,Uhe),o=zt("recharts-layer",r);return Z.createElement("g",I1({className:o},$t(i,!0),{ref:e}),n)}),vc=function(e,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;oi?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(i);++r=r?t:Hhe(t,e,n)}var Ghe=Vhe,Whe="\\ud800-\\udfff",Xhe="\\u0300-\\u036f",qhe="\\ufe20-\\ufe2f",Khe="\\u20d0-\\u20ff",Yhe=Xhe+qhe+Khe,Jhe="\\ufe0e\\ufe0f",Zhe="\\u200d",Qhe=RegExp("["+Zhe+Whe+Yhe+Jhe+"]");function epe(t){return Qhe.test(t)}var i5=epe;function tpe(t){return t.split("")}var npe=tpe,o5="\\ud800-\\udfff",rpe="\\u0300-\\u036f",ipe="\\ufe20-\\ufe2f",ope="\\u20d0-\\u20ff",ape=rpe+ipe+ope,spe="\\ufe0e\\ufe0f",lpe="["+o5+"]",D1="["+ape+"]",L1="\\ud83c[\\udffb-\\udfff]",cpe="(?:"+D1+"|"+L1+")",a5="[^"+o5+"]",s5="(?:\\ud83c[\\udde6-\\uddff]){2}",l5="[\\ud800-\\udbff][\\udc00-\\udfff]",upe="\\u200d",c5=cpe+"?",u5="["+spe+"]?",dpe="(?:"+upe+"(?:"+[a5,s5,l5].join("|")+")"+u5+c5+")*",fpe=u5+c5+dpe,hpe="(?:"+[a5+D1+"?",D1,s5,l5,lpe].join("|")+")",ppe=RegExp(L1+"(?="+L1+")|"+hpe+fpe,"g");function mpe(t){return t.match(ppe)||[]}var gpe=mpe,vpe=npe,ype=i5,xpe=gpe;function bpe(t){return ype(t)?xpe(t):vpe(t)}var _pe=bpe,wpe=Ghe,Spe=i5,Epe=_pe,Tpe=Zz;function Mpe(t){return function(e){e=Tpe(e);var n=Spe(e)?Epe(e):void 0,r=n?n[0]:e.charAt(0),i=n?wpe(n,1).join(""):e.slice(1);return r[t]()+i}}var Ape=Mpe,Cpe=Ape,Ppe=Cpe("toUpperCase"),Rpe=Ppe;const yb=dn(Rpe);function mn(t){return function(){return t}}const d5=Math.cos,By=Math.sin,Ko=Math.sqrt,$y=Math.PI,xb=2*$y,k1=Math.PI,j1=2*k1,Gl=1e-6,Npe=j1-Gl;function f5(t){this._+=t[0];for(let e=1,n=t.length;e=0))throw new Error(`invalid digits: ${t}`);if(e>15)return f5;const n=10**e;return function(r){this._+=r[0];for(let i=1,o=r.length;iGl)if(!(Math.abs(d*l-c*u)>Gl)||!o)this._append`L${this._x1=e},${this._y1=n}`;else{let p=r-a,y=i-s,v=l*l+c*c,g=p*p+y*y,m=Math.sqrt(v),x=Math.sqrt(f),b=o*Math.tan((k1-Math.acos((v+f-g)/(2*m*x)))/2),S=b/x,w=b/m;Math.abs(S-1)>Gl&&this._append`L${e+S*u},${n+S*d}`,this._append`A${o},${o},0,0,${+(d*p>u*y)},${this._x1=e+w*l},${this._y1=n+w*c}`}}arc(e,n,r,i,o,a){if(e=+e,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(i),l=r*Math.sin(i),c=e+s,u=n+l,d=1^a,f=a?i-o:o-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>Gl||Math.abs(this._y1-u)>Gl)&&this._append`L${c},${u}`,r&&(f<0&&(f=f%j1+j1),f>Npe?this._append`A${r},${r},0,1,${d},${e-s},${n-l}A${r},${r},0,1,${d},${this._x1=c},${this._y1=u}`:f>Gl&&this._append`A${r},${r},0,${+(f>=k1)},${d},${this._x1=e+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(e,n,r,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function OC(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(n==null)e=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);e=r}return t},()=>new Ipe(e)}function IC(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function h5(t){this._context=t}h5.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function bb(t){return new h5(t)}function p5(t){return t[0]}function m5(t){return t[1]}function g5(t,e){var n=mn(!0),r=null,i=bb,o=null,a=OC(s);t=typeof t=="function"?t:t===void 0?p5:mn(t),e=typeof e=="function"?e:e===void 0?m5:mn(e);function s(l){var c,u=(l=IC(l)).length,d,f=!1,p;for(r==null&&(o=i(p=a())),c=0;c<=u;++c)!(c=p;--y)s.point(b[y],S[y]);s.lineEnd(),s.areaEnd()}m&&(b[f]=+t(g,f,d),S[f]=+e(g,f,d),s.point(r?+r(g,f,d):b[f],n?+n(g,f,d):S[f]))}if(x)return s=null,x+""||null}function u(){return g5().defined(i).curve(a).context(o)}return c.x=function(d){return arguments.length?(t=typeof d=="function"?d:mn(+d),r=null,c):t},c.x0=function(d){return arguments.length?(t=typeof d=="function"?d:mn(+d),c):t},c.x1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:mn(+d),c):r},c.y=function(d){return arguments.length?(e=typeof d=="function"?d:mn(+d),n=null,c):e},c.y0=function(d){return arguments.length?(e=typeof d=="function"?d:mn(+d),c):e},c.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:mn(+d),c):n},c.lineX0=c.lineY0=function(){return u().x(t).y(e)},c.lineY1=function(){return u().x(t).y(n)},c.lineX1=function(){return u().x(r).y(e)},c.defined=function(d){return arguments.length?(i=typeof d=="function"?d:mn(!!d),c):i},c.curve=function(d){return arguments.length?(a=d,o!=null&&(s=a(o)),c):a},c.context=function(d){return arguments.length?(d==null?o=s=null:s=a(o=d),c):o},c}class v5{constructor(e,n){this._context=e,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,n){switch(e=+e,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,n):this._context.moveTo(e,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,n,e,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,e,this._y0,e,n);break}}this._x0=e,this._y0=n}}function Dpe(t){return new v5(t,!0)}function Lpe(t){return new v5(t,!1)}const DC={draw(t,e){const n=Ko(e/$y);t.moveTo(n,0),t.arc(0,0,n,0,xb)}},kpe={draw(t,e){const n=Ko(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},y5=Ko(1/3),jpe=y5*2,Upe={draw(t,e){const n=Ko(e/jpe),r=n*y5;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},Fpe={draw(t,e){const n=Ko(e),r=-n/2;t.rect(r,r,n,n)}},Bpe=.8908130915292852,x5=By($y/10)/By(7*$y/10),$pe=By(xb/10)*x5,zpe=-d5(xb/10)*x5,Hpe={draw(t,e){const n=Ko(e*Bpe),r=$pe*n,i=zpe*n;t.moveTo(0,-n),t.lineTo(r,i);for(let o=1;o<5;++o){const a=xb*o/5,s=d5(a),l=By(a);t.lineTo(l*n,-s*n),t.lineTo(s*r-l*i,l*r+s*i)}t.closePath()}},Bw=Ko(3),Vpe={draw(t,e){const n=-Ko(e/(Bw*3));t.moveTo(0,n*2),t.lineTo(-Bw*n,-n),t.lineTo(Bw*n,-n),t.closePath()}},$i=-.5,zi=Ko(3)/2,U1=1/Ko(12),Gpe=(U1/2+1)*3,Wpe={draw(t,e){const n=Ko(e/Gpe),r=n/2,i=n*U1,o=r,a=n*U1+n,s=-o,l=a;t.moveTo(r,i),t.lineTo(o,a),t.lineTo(s,l),t.lineTo($i*r-zi*i,zi*r+$i*i),t.lineTo($i*o-zi*a,zi*o+$i*a),t.lineTo($i*s-zi*l,zi*s+$i*l),t.lineTo($i*r+zi*i,$i*i-zi*r),t.lineTo($i*o+zi*a,$i*a-zi*o),t.lineTo($i*s+zi*l,$i*l-zi*s),t.closePath()}};function Xpe(t,e){let n=null,r=OC(i);t=typeof t=="function"?t:mn(t||DC),e=typeof e=="function"?e:mn(e===void 0?64:+e);function i(){let o;if(n||(n=o=r()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),o)return n=null,o+""||null}return i.type=function(o){return arguments.length?(t=typeof o=="function"?o:mn(o),i):t},i.size=function(o){return arguments.length?(e=typeof o=="function"?o:mn(+o),i):e},i.context=function(o){return arguments.length?(n=o??null,i):n},i}function zy(){}function Hy(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function b5(t){this._context=t}b5.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Hy(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Hy(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function qpe(t){return new b5(t)}function _5(t){this._context=t}_5.prototype={areaStart:zy,areaEnd:zy,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:Hy(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Kpe(t){return new _5(t)}function w5(t){this._context=t}w5.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Hy(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Ype(t){return new w5(t)}function S5(t){this._context=t}S5.prototype={areaStart:zy,areaEnd:zy,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function Jpe(t){return new S5(t)}function H2(t){return t<0?-1:1}function V2(t,e,n){var r=t._x1-t._x0,i=e-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(n-t._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(H2(o)+H2(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function G2(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function $w(t,e,n){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,s=(o-r)/3;t._context.bezierCurveTo(r+s,i+s*e,o-s,a-s*n,o,a)}function Vy(t){this._context=t}Vy.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:$w(this,this._t0,G2(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,$w(this,G2(this,n=V2(this,t,e)),n);break;default:$w(this,this._t0,n=V2(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function E5(t){this._context=new T5(t)}(E5.prototype=Object.create(Vy.prototype)).point=function(t,e){Vy.prototype.point.call(this,e,t)};function T5(t){this._context=t}T5.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,o){this._context.bezierCurveTo(e,t,r,n,o,i)}};function Zpe(t){return new Vy(t)}function Qpe(t){return new E5(t)}function M5(t){this._context=t}M5.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),n===2)this._context.lineTo(t[1],e[1]);else for(var r=W2(t),i=W2(e),o=0,a=1;a=0;--e)i[e]=(a[e]-i[e+1])/o[e];for(o[n-1]=(t[n]+i[n-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}break}}this._x=t,this._y=e}};function tme(t){return new _b(t,.5)}function nme(t){return new _b(t,0)}function rme(t){return new _b(t,1)}function Hd(t,e){if((a=t.length)>1)for(var n=1,r,i,o=t[e[0]],a,s=o.length;n=0;)n[e]=e;return n}function ime(t,e){return t[e]}function ome(t){const e=[];return e.key=t,e}function ame(){var t=mn([]),e=F1,n=Hd,r=ime;function i(o){var a=Array.from(t.apply(this,arguments),ome),s,l=a.length,c=-1,u;for(const d of o)for(s=0,++c;s0){for(var n,r,i=0,o=t[0].length,a;i0){for(var n=0,r=t[e[0]],i,o=r.length;n0)||!((o=(i=t[e[0]]).length)>0))){for(var n=0,r=1,i,o,a;r=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function mme(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}var A5={symbolCircle:DC,symbolCross:kpe,symbolDiamond:Upe,symbolSquare:Fpe,symbolStar:Hpe,symbolTriangle:Vpe,symbolWye:Wpe},gme=Math.PI/180,vme=function(e){var n="symbol".concat(yb(e));return A5[n]||DC},yme=function(e,n,r){if(n==="area")return e;switch(r){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var i=18*gme;return 1.25*e*e*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},xme=function(e,n){A5["symbol".concat(yb(e))]=n},LC=function(e){var n=e.type,r=n===void 0?"circle":n,i=e.size,o=i===void 0?64:i,a=e.sizeType,s=a===void 0?"area":a,l=pme(e,ume),c=q2(q2({},l),{},{type:r,size:o,sizeType:s}),u=function(){var g=vme(r),m=Xpe().type(g).size(yme(o,s,r));return m()},d=c.className,f=c.cx,p=c.cy,y=$t(c,!0);return f===+f&&p===+p&&o===+o?Z.createElement("path",B1({},y,{className:zt("recharts-symbols",d),transform:"translate(".concat(f,", ").concat(p,")"),d:u()})):null};LC.registerSymbol=xme;function Vd(t){"@babel/helpers - typeof";return Vd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vd(t)}function $1(){return $1=Object.assign?Object.assign.bind():function(t){for(var e=1;e0?1:-1},tc=function(e){return Dc(e)&&e.indexOf("%")===e.length-1},ze=function(e){return yhe(e)&&!Bm(e)},Yn=function(e){return ze(e)||Dc(e)},whe=0,$m=function(e){var n=++whe;return"".concat(e||"").concat(n)},Lc=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!ze(e)&&!Dc(e))return r;var o;if(tc(e)){var a=e.indexOf("%");o=n*parseFloat(e.slice(0,a))/100}else o=+e;return Bm(o)&&(o=r),i&&o>n&&(o=n),o},Cu=function(e){if(!e)return null;var n=Object.keys(e);return n&&n.length?e[n[0]]:null},She=function(e){if(!Array.isArray(e))return!1;for(var n=e.length,r={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Rhe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function P1(t){"@babel/helpers - typeof";return P1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},P1(t)}var F2={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Za=function(e){return typeof e=="string"?e:e?e.displayName||e.name||"Component":""},B2=null,Fw=null,OC=function t(e){if(e===B2&&Array.isArray(Fw))return Fw;var n=[];return _.Children.forEach(e,function(r){Ut(r)||(hhe.isFragment(r)?n=n.concat(t(r.props.children)):n.push(r))}),Fw=n,B2=e,n};function ro(t,e){var n=[],r=[];return Array.isArray(e)?r=e.map(function(i){return Za(i)}):r=[Za(e)],OC(t).forEach(function(i){var o=no(i,"type.displayName")||no(i,"type.name");r.indexOf(o)!==-1&&n.push(i)}),n}function Ei(t,e){var n=ro(t,e);return n&&n[0]}var $2=function(e){if(!e||!e.props)return!1;var n=e.props,r=n.width,i=n.height;return!(!ze(r)||r<=0||!ze(i)||i<=0)},Nhe=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],Ohe=function(e){return e&&e.type&&Dc(e.type)&&Nhe.indexOf(e.type)>=0},Ihe=function(e){return e&&P1(e)==="object"&&"clipDot"in e},Dhe=function(e,n,r,i){var o,a=(o=Uw==null?void 0:Uw[i])!==null&&o!==void 0?o:[];return n.startsWith("data-")||!jt(e)&&(i&&a.includes(n)||Mhe.includes(n))||r&&NC.includes(n)},$t=function(e,n,r){if(!e||typeof e=="function"||typeof e=="boolean")return null;var i=e;if(_.isValidElement(e)&&(i=e.props),!Pf(i))return null;var o={};return Object.keys(i).forEach(function(a){var s;Dhe((s=i)===null||s===void 0?void 0:s[a],a,n,r)&&(o[a]=i[a])}),o},R1=function t(e,n){if(e===n)return!0;var r=_.Children.count(e);if(r!==_.Children.count(n))return!1;if(r===0)return!0;if(r===1)return z2(Array.isArray(e)?e[0]:e,Array.isArray(n)?n[0]:n);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Fhe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function O1(t){var e=t.children,n=t.width,r=t.height,i=t.viewBox,o=t.className,a=t.style,s=t.title,l=t.desc,c=Uhe(t,jhe),u=i||{width:n,height:r,x:0,y:0},d=zt("recharts-surface",o);return Q.createElement("svg",N1({},$t(c,!0,"svg"),{className:d,width:n,height:r,style:a,viewBox:"".concat(u.x," ").concat(u.y," ").concat(u.width," ").concat(u.height)}),Q.createElement("title",null,s),Q.createElement("desc",null,l),e)}var Bhe=["children","className"];function I1(){return I1=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function zhe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}var kn=Q.forwardRef(function(t,e){var n=t.children,r=t.className,i=$he(t,Bhe),o=zt("recharts-layer",r);return Q.createElement("g",I1({className:o},$t(i,!0),{ref:e}),n)}),vc=function(e,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;oi?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(i);++r=r?t:Ghe(t,e,n)}var Xhe=Whe,qhe="\\ud800-\\udfff",Khe="\\u0300-\\u036f",Yhe="\\ufe20-\\ufe2f",Jhe="\\u20d0-\\u20ff",Zhe=Khe+Yhe+Jhe,Qhe="\\ufe0e\\ufe0f",epe="\\u200d",tpe=RegExp("["+epe+qhe+Zhe+Qhe+"]");function npe(t){return tpe.test(t)}var a5=npe;function rpe(t){return t.split("")}var ipe=rpe,s5="\\ud800-\\udfff",ope="\\u0300-\\u036f",ape="\\ufe20-\\ufe2f",spe="\\u20d0-\\u20ff",lpe=ope+ape+spe,cpe="\\ufe0e\\ufe0f",upe="["+s5+"]",D1="["+lpe+"]",L1="\\ud83c[\\udffb-\\udfff]",dpe="(?:"+D1+"|"+L1+")",l5="[^"+s5+"]",c5="(?:\\ud83c[\\udde6-\\uddff]){2}",u5="[\\ud800-\\udbff][\\udc00-\\udfff]",fpe="\\u200d",d5=dpe+"?",f5="["+cpe+"]?",hpe="(?:"+fpe+"(?:"+[l5,c5,u5].join("|")+")"+f5+d5+")*",ppe=f5+d5+hpe,mpe="(?:"+[l5+D1+"?",D1,c5,u5,upe].join("|")+")",gpe=RegExp(L1+"(?="+L1+")|"+mpe+ppe,"g");function vpe(t){return t.match(gpe)||[]}var ype=vpe,xpe=ipe,bpe=a5,_pe=ype;function wpe(t){return bpe(t)?_pe(t):xpe(t)}var Spe=wpe,Epe=Xhe,Tpe=a5,Mpe=Spe,Ape=e5;function Cpe(t){return function(e){e=Ape(e);var n=Tpe(e)?Mpe(e):void 0,r=n?n[0]:e.charAt(0),i=n?Epe(n,1).join(""):e.slice(1);return r[t]()+i}}var Ppe=Cpe,Rpe=Ppe,Npe=Rpe("toUpperCase"),Ope=Npe;const yb=dn(Ope);function mn(t){return function(){return t}}const h5=Math.cos,By=Math.sin,Yo=Math.sqrt,$y=Math.PI,xb=2*$y,k1=Math.PI,j1=2*k1,Gl=1e-6,Ipe=j1-Gl;function p5(t){this._+=t[0];for(let e=1,n=t.length;e=0))throw new Error(`invalid digits: ${t}`);if(e>15)return p5;const n=10**e;return function(r){this._+=r[0];for(let i=1,o=r.length;iGl)if(!(Math.abs(d*l-c*u)>Gl)||!o)this._append`L${this._x1=e},${this._y1=n}`;else{let p=r-a,y=i-s,v=l*l+c*c,g=p*p+y*y,m=Math.sqrt(v),x=Math.sqrt(f),b=o*Math.tan((k1-Math.acos((v+f-g)/(2*m*x)))/2),S=b/x,w=b/m;Math.abs(S-1)>Gl&&this._append`L${e+S*u},${n+S*d}`,this._append`A${o},${o},0,0,${+(d*p>u*y)},${this._x1=e+w*l},${this._y1=n+w*c}`}}arc(e,n,r,i,o,a){if(e=+e,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(i),l=r*Math.sin(i),c=e+s,u=n+l,d=1^a,f=a?i-o:o-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>Gl||Math.abs(this._y1-u)>Gl)&&this._append`L${c},${u}`,r&&(f<0&&(f=f%j1+j1),f>Ipe?this._append`A${r},${r},0,1,${d},${e-s},${n-l}A${r},${r},0,1,${d},${this._x1=c},${this._y1=u}`:f>Gl&&this._append`A${r},${r},0,${+(f>=k1)},${d},${this._x1=e+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(e,n,r,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function IC(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(n==null)e=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);e=r}return t},()=>new Lpe(e)}function DC(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function m5(t){this._context=t}m5.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function bb(t){return new m5(t)}function g5(t){return t[0]}function v5(t){return t[1]}function y5(t,e){var n=mn(!0),r=null,i=bb,o=null,a=IC(s);t=typeof t=="function"?t:t===void 0?g5:mn(t),e=typeof e=="function"?e:e===void 0?v5:mn(e);function s(l){var c,u=(l=DC(l)).length,d,f=!1,p;for(r==null&&(o=i(p=a())),c=0;c<=u;++c)!(c=p;--y)s.point(b[y],S[y]);s.lineEnd(),s.areaEnd()}m&&(b[f]=+t(g,f,d),S[f]=+e(g,f,d),s.point(r?+r(g,f,d):b[f],n?+n(g,f,d):S[f]))}if(x)return s=null,x+""||null}function u(){return y5().defined(i).curve(a).context(o)}return c.x=function(d){return arguments.length?(t=typeof d=="function"?d:mn(+d),r=null,c):t},c.x0=function(d){return arguments.length?(t=typeof d=="function"?d:mn(+d),c):t},c.x1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:mn(+d),c):r},c.y=function(d){return arguments.length?(e=typeof d=="function"?d:mn(+d),n=null,c):e},c.y0=function(d){return arguments.length?(e=typeof d=="function"?d:mn(+d),c):e},c.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:mn(+d),c):n},c.lineX0=c.lineY0=function(){return u().x(t).y(e)},c.lineY1=function(){return u().x(t).y(n)},c.lineX1=function(){return u().x(r).y(e)},c.defined=function(d){return arguments.length?(i=typeof d=="function"?d:mn(!!d),c):i},c.curve=function(d){return arguments.length?(a=d,o!=null&&(s=a(o)),c):a},c.context=function(d){return arguments.length?(d==null?o=s=null:s=a(o=d),c):o},c}class x5{constructor(e,n){this._context=e,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,n){switch(e=+e,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,n):this._context.moveTo(e,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,n,e,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,e,this._y0,e,n);break}}this._x0=e,this._y0=n}}function kpe(t){return new x5(t,!0)}function jpe(t){return new x5(t,!1)}const LC={draw(t,e){const n=Yo(e/$y);t.moveTo(n,0),t.arc(0,0,n,0,xb)}},Upe={draw(t,e){const n=Yo(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},b5=Yo(1/3),Fpe=b5*2,Bpe={draw(t,e){const n=Yo(e/Fpe),r=n*b5;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},$pe={draw(t,e){const n=Yo(e),r=-n/2;t.rect(r,r,n,n)}},zpe=.8908130915292852,_5=By($y/10)/By(7*$y/10),Hpe=By(xb/10)*_5,Vpe=-h5(xb/10)*_5,Gpe={draw(t,e){const n=Yo(e*zpe),r=Hpe*n,i=Vpe*n;t.moveTo(0,-n),t.lineTo(r,i);for(let o=1;o<5;++o){const a=xb*o/5,s=h5(a),l=By(a);t.lineTo(l*n,-s*n),t.lineTo(s*r-l*i,l*r+s*i)}t.closePath()}},Bw=Yo(3),Wpe={draw(t,e){const n=-Yo(e/(Bw*3));t.moveTo(0,n*2),t.lineTo(-Bw*n,-n),t.lineTo(Bw*n,-n),t.closePath()}},$i=-.5,zi=Yo(3)/2,U1=1/Yo(12),Xpe=(U1/2+1)*3,qpe={draw(t,e){const n=Yo(e/Xpe),r=n/2,i=n*U1,o=r,a=n*U1+n,s=-o,l=a;t.moveTo(r,i),t.lineTo(o,a),t.lineTo(s,l),t.lineTo($i*r-zi*i,zi*r+$i*i),t.lineTo($i*o-zi*a,zi*o+$i*a),t.lineTo($i*s-zi*l,zi*s+$i*l),t.lineTo($i*r+zi*i,$i*i-zi*r),t.lineTo($i*o+zi*a,$i*a-zi*o),t.lineTo($i*s+zi*l,$i*l-zi*s),t.closePath()}};function Kpe(t,e){let n=null,r=IC(i);t=typeof t=="function"?t:mn(t||LC),e=typeof e=="function"?e:mn(e===void 0?64:+e);function i(){let o;if(n||(n=o=r()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),o)return n=null,o+""||null}return i.type=function(o){return arguments.length?(t=typeof o=="function"?o:mn(o),i):t},i.size=function(o){return arguments.length?(e=typeof o=="function"?o:mn(+o),i):e},i.context=function(o){return arguments.length?(n=o??null,i):n},i}function zy(){}function Hy(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function w5(t){this._context=t}w5.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Hy(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Hy(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Ype(t){return new w5(t)}function S5(t){this._context=t}S5.prototype={areaStart:zy,areaEnd:zy,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:Hy(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Jpe(t){return new S5(t)}function E5(t){this._context=t}E5.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Hy(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Zpe(t){return new E5(t)}function T5(t){this._context=t}T5.prototype={areaStart:zy,areaEnd:zy,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function Qpe(t){return new T5(t)}function V2(t){return t<0?-1:1}function G2(t,e,n){var r=t._x1-t._x0,i=e-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(n-t._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(V2(o)+V2(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function W2(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function $w(t,e,n){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,s=(o-r)/3;t._context.bezierCurveTo(r+s,i+s*e,o-s,a-s*n,o,a)}function Vy(t){this._context=t}Vy.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:$w(this,this._t0,W2(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,$w(this,W2(this,n=G2(this,t,e)),n);break;default:$w(this,this._t0,n=G2(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function M5(t){this._context=new A5(t)}(M5.prototype=Object.create(Vy.prototype)).point=function(t,e){Vy.prototype.point.call(this,e,t)};function A5(t){this._context=t}A5.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,o){this._context.bezierCurveTo(e,t,r,n,o,i)}};function eme(t){return new Vy(t)}function tme(t){return new M5(t)}function C5(t){this._context=t}C5.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),n===2)this._context.lineTo(t[1],e[1]);else for(var r=X2(t),i=X2(e),o=0,a=1;a=0;--e)i[e]=(a[e]-i[e+1])/o[e];for(o[n-1]=(t[n]+i[n-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}break}}this._x=t,this._y=e}};function rme(t){return new _b(t,.5)}function ime(t){return new _b(t,0)}function ome(t){return new _b(t,1)}function Hd(t,e){if((a=t.length)>1)for(var n=1,r,i,o=t[e[0]],a,s=o.length;n=0;)n[e]=e;return n}function ame(t,e){return t[e]}function sme(t){const e=[];return e.key=t,e}function lme(){var t=mn([]),e=F1,n=Hd,r=ame;function i(o){var a=Array.from(t.apply(this,arguments),sme),s,l=a.length,c=-1,u;for(const d of o)for(s=0,++c;s0){for(var n,r,i=0,o=t[0].length,a;i0){for(var n=0,r=t[e[0]],i,o=r.length;n0)||!((o=(i=t[e[0]]).length)>0))){for(var n=0,r=1,i,o,a;r=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function vme(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}var P5={symbolCircle:LC,symbolCross:Upe,symbolDiamond:Bpe,symbolSquare:$pe,symbolStar:Gpe,symbolTriangle:Wpe,symbolWye:qpe},yme=Math.PI/180,xme=function(e){var n="symbol".concat(yb(e));return P5[n]||LC},bme=function(e,n,r){if(n==="area")return e;switch(r){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var i=18*yme;return 1.25*e*e*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},_me=function(e,n){P5["symbol".concat(yb(e))]=n},kC=function(e){var n=e.type,r=n===void 0?"circle":n,i=e.size,o=i===void 0?64:i,a=e.sizeType,s=a===void 0?"area":a,l=gme(e,fme),c=K2(K2({},l),{},{type:r,size:o,sizeType:s}),u=function(){var g=xme(r),m=Kpe().type(g).size(bme(o,s,r));return m()},d=c.className,f=c.cx,p=c.cy,y=$t(c,!0);return f===+f&&p===+p&&o===+o?Q.createElement("path",B1({},y,{className:zt("recharts-symbols",d),transform:"translate(".concat(f,", ").concat(p,")"),d:u()})):null};kC.registerSymbol=_me;function Vd(t){"@babel/helpers - typeof";return Vd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vd(t)}function $1(){return $1=Object.assign?Object.assign.bind():function(t){for(var e=1;e`);var x=p.inactive?c:p.color;return Z.createElement("li",$1({className:g,style:d,key:"legend-item-".concat(y)},Fy(r.props,p,y)),Z.createElement(O1,{width:a,height:a,viewBox:u,style:f},r.renderIcon(p)),Z.createElement("span",{className:"recharts-legend-item-text",style:{color:x}},v?v(m,p,y):m))})}},{key:"render",value:function(){var r=this.props,i=r.payload,o=r.layout,a=r.align;if(!i||!i.length)return null;var s={padding:0,margin:0,textAlign:o==="horizontal"?a:"left"};return Z.createElement("ul",{className:"recharts-default-legend",style:s},this.renderItems())}}])}(_.PureComponent);Dp(kC,"displayName","Legend");Dp(kC,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Pme=ob;function Rme(){this.__data__=new Pme,this.size=0}var Nme=Rme;function Ome(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}var Ime=Ome;function Dme(t){return this.__data__.get(t)}var Lme=Dme;function kme(t){return this.__data__.has(t)}var jme=kme,Ume=ob,Fme=SC,Bme=EC,$me=200;function zme(t,e){var n=this.__data__;if(n instanceof Ume){var r=n.__data__;if(!Fme||r.length<$me-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Bme(r)}return n.set(t,e),this.size=n.size,this}var Hme=zme,Vme=ob,Gme=Nme,Wme=Ime,Xme=Lme,qme=jme,Kme=Hme;function If(t){var e=this.__data__=new Vme(t);this.size=e.size}If.prototype.clear=Gme;If.prototype.delete=Wme;If.prototype.get=Xme;If.prototype.has=qme;If.prototype.set=Kme;var R5=If,Yme="__lodash_hash_undefined__";function Jme(t){return this.__data__.set(t,Yme),this}var Zme=Jme;function Qme(t){return this.__data__.has(t)}var ege=Qme,tge=EC,nge=Zme,rge=ege;function Wy(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new tge;++es))return!1;var c=o.get(t),u=o.get(e);if(c&&u)return c==e&&u==t;var d=-1,f=!0,p=n&uge?new age:void 0;for(o.set(t,e),o.set(e,t);++d-1&&t%1==0&&t-1&&t%1==0&&t<=pve}var BC=mve,gve=hs,vve=BC,yve=ps,xve="[object Arguments]",bve="[object Array]",_ve="[object Boolean]",wve="[object Date]",Sve="[object Error]",Eve="[object Function]",Tve="[object Map]",Mve="[object Number]",Ave="[object Object]",Cve="[object RegExp]",Pve="[object Set]",Rve="[object String]",Nve="[object WeakMap]",Ove="[object ArrayBuffer]",Ive="[object DataView]",Dve="[object Float32Array]",Lve="[object Float64Array]",kve="[object Int8Array]",jve="[object Int16Array]",Uve="[object Int32Array]",Fve="[object Uint8Array]",Bve="[object Uint8ClampedArray]",$ve="[object Uint16Array]",zve="[object Uint32Array]",bn={};bn[Dve]=bn[Lve]=bn[kve]=bn[jve]=bn[Uve]=bn[Fve]=bn[Bve]=bn[$ve]=bn[zve]=!0;bn[xve]=bn[bve]=bn[Ove]=bn[_ve]=bn[Ive]=bn[wve]=bn[Sve]=bn[Eve]=bn[Tve]=bn[Mve]=bn[Ave]=bn[Cve]=bn[Pve]=bn[Rve]=bn[Nve]=!1;function Hve(t){return yve(t)&&vve(t.length)&&!!bn[gve(t)]}var Vve=Hve;function Gve(t){return function(e){return t(e)}}var U5=Gve,qy={exports:{}};qy.exports;(function(t,e){var n=Wz,r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,o=i&&i.exports===r,a=o&&n.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||a&&a.binding&&a.binding("util")}catch{}}();t.exports=s})(qy,qy.exports);var Wve=qy.exports,Xve=Vve,qve=U5,tI=Wve,nI=tI&&tI.isTypedArray,Kve=nI?qve(nI):Xve,F5=Kve,Yve=Qge,Jve=UC,Zve=yi,Qve=j5,eye=FC,tye=F5,nye=Object.prototype,rye=nye.hasOwnProperty;function iye(t,e){var n=Zve(t),r=!n&&Jve(t),i=!n&&!r&&Qve(t),o=!n&&!r&&!i&&tye(t),a=n||r||i||o,s=a?Yve(t.length,String):[],l=s.length;for(var c in t)(e||rye.call(t,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||eye(c,l)))&&s.push(c);return s}var oye=iye,aye=Object.prototype;function sye(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||aye;return t===n}var lye=sye;function cye(t,e){return function(n){return t(e(n))}}var B5=cye,uye=B5,dye=uye(Object.keys,Object),fye=dye,hye=lye,pye=fye,mye=Object.prototype,gye=mye.hasOwnProperty;function vye(t){if(!hye(t))return pye(t);var e=[];for(var n in Object(t))gye.call(t,n)&&n!="constructor"&&e.push(n);return e}var yye=vye,xye=_C,bye=BC;function _ye(t){return t!=null&&bye(t.length)&&!xye(t)}var wb=_ye,wye=oye,Sye=yye,Eye=wb;function Tye(t){return Eye(t)?wye(t):Sye(t)}var $C=Tye,Mye=$ge,Aye=Jge,Cye=$C;function Pye(t){return Mye(t,Cye,Aye)}var Rye=Pye,rI=Rye,Nye=1,Oye=Object.prototype,Iye=Oye.hasOwnProperty;function Dye(t,e,n,r,i,o){var a=n&Nye,s=rI(t),l=s.length,c=rI(e),u=c.length;if(l!=u&&!a)return!1;for(var d=l;d--;){var f=s[d];if(!(a?f in e:Iye.call(e,f)))return!1}var p=o.get(t),y=o.get(e);if(p&&y)return p==e&&y==t;var v=!0;o.set(t,e),o.set(e,t);for(var g=a;++d-1}var Ixe=Oxe;function Dxe(t,e,n){for(var r=-1,i=t==null?0:t.length;++r=Kxe){var c=e?null:Xxe(t);if(c)return qxe(c);a=!1,i=Wxe,l=new Hxe}else l=e?[]:s;e:for(;++r=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function dbe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function fbe(t){return t.value}function hbe(t,e){if(Z.isValidElement(t))return Z.cloneElement(t,e);if(typeof t=="function")return Z.createElement(t,e);e.ref;var n=ube(e,nbe);return Z.createElement(kC,n)}var xI=1,hd=function(t){function e(){var n;rbe(this,e);for(var r=arguments.length,i=new Array(r),o=0;oxI||Math.abs(i.height-this.lastBoundingBox.height)>xI)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,r&&r(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?La({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var i=this.props,o=i.layout,a=i.align,s=i.verticalAlign,l=i.margin,c=i.chartWidth,u=i.chartHeight,d,f;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(a==="center"&&o==="vertical"){var p=this.getBBoxSnapshot();d={left:((c||0)-p.width)/2}}else d=a==="right"?{right:l&&l.right||0}:{left:l&&l.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(s==="middle"){var y=this.getBBoxSnapshot();f={top:((u||0)-y.height)/2}}else f=s==="bottom"?{bottom:l&&l.bottom||0}:{top:l&&l.top||0};return La(La({},d),f)}},{key:"render",value:function(){var r=this,i=this.props,o=i.content,a=i.width,s=i.height,l=i.wrapperStyle,c=i.payloadUniqBy,u=i.payload,d=La(La({position:"absolute",width:a||"auto",height:s||"auto"},this.getDefaultPosition(l)),l);return Z.createElement("div",{className:"recharts-legend-wrapper",style:d,ref:function(p){r.wrapperNode=p}},hbe(o,La(La({},this.props),{},{payload:W5(u,c,fbe)})))}}],[{key:"getWithHeight",value:function(r,i){var o=La(La({},this.defaultProps),r.props),a=o.layout;return a==="vertical"&&ze(r.props.height)?{height:r.props.height}:a==="horizontal"?{width:r.props.width||i}:null}}])}(_.PureComponent);Sb(hd,"displayName","Legend");Sb(hd,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var bI=Fm,pbe=UC,mbe=yi,_I=bI?bI.isConcatSpreadable:void 0;function gbe(t){return mbe(t)||pbe(t)||!!(_I&&t&&t[_I])}var vbe=gbe,ybe=L5,xbe=vbe;function K5(t,e,n,r,i){var o=-1,a=t.length;for(n||(n=xbe),i||(i=[]);++o0&&n(s)?e>1?K5(s,e-1,n,r,i):ybe(i,s):r||(i[i.length]=s)}return i}var Y5=K5;function bbe(t){return function(e,n,r){for(var i=-1,o=Object(e),a=r(e),s=a.length;s--;){var l=a[t?s:++i];if(n(o[l],l,o)===!1)break}return e}}var _be=bbe,wbe=_be,Sbe=wbe(),Ebe=Sbe,Tbe=Ebe,Mbe=$C;function Abe(t,e){return t&&Tbe(t,e,Mbe)}var J5=Abe,Cbe=wb;function Pbe(t,e){return function(n,r){if(n==null)return n;if(!Cbe(n))return t(n,r);for(var i=n.length,o=e?i:-1,a=Object(n);(e?o--:++oe||o&&a&&l&&!s&&!c||r&&a&&l||!n&&l||!i)return 1;if(!r&&!o&&!c&&t=s)return l;var c=n[r];return l*(c=="desc"?-1:1)}}return t.index-e.index}var Hbe=zbe,Gw=MC,Vbe=AC,Gbe=kf,Wbe=Z5,Xbe=Ube,qbe=U5,Kbe=Hbe,Ybe=Lf,Jbe=yi;function Zbe(t,e,n){e.length?e=Gw(e,function(o){return Jbe(o)?function(a){return Vbe(a,o.length===1?o[0]:o)}:o}):e=[Ybe];var r=-1;e=Gw(e,qbe(Gbe));var i=Wbe(t,function(o,a,s){var l=Gw(e,function(c){return c(o)});return{criteria:l,index:++r,value:o}});return Xbe(i,function(o,a){return Kbe(o,a,n)})}var Qbe=Zbe;function e_e(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var t_e=e_e,n_e=t_e,SI=Math.max;function r_e(t,e,n){return e=SI(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=SI(r.length-e,0),a=Array(o);++i0){if(++e>=h_e)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var v_e=g_e,y_e=f_e,x_e=v_e,b_e=x_e(y_e),__e=b_e,w_e=Lf,S_e=i_e,E_e=__e;function T_e(t,e){return E_e(S_e(t,e,w_e),t+"")}var M_e=T_e,A_e=wC,C_e=wb,P_e=FC,R_e=Cl;function N_e(t,e,n){if(!R_e(n))return!1;var r=typeof e;return(r=="number"?C_e(n)&&P_e(e,n.length):r=="string"&&e in n)?A_e(n[e],t):!1}var Eb=N_e,O_e=Y5,I_e=Qbe,D_e=M_e,TI=Eb,L_e=D_e(function(t,e){if(t==null)return[];var n=e.length;return n>1&&TI(t,e[0],e[1])?e=[]:n>2&&TI(e[0],e[1],e[2])&&(e=[e[0]]),I_e(t,O_e(e,1),[])}),k_e=L_e;const VC=dn(k_e);function Lp(t){"@babel/helpers - typeof";return Lp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Lp(t)}function K1(){return K1=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=e.x),"".concat(hh,"-left"),ze(n)&&e&&ze(e.x)&&n=e.y),"".concat(hh,"-top"),ze(r)&&e&&ze(e.y)&&rv?Math.max(u,l[r]):Math.max(d,l[r])}function J_e(t){var e=t.translateX,n=t.translateY,r=t.useTranslate3d;return{transform:r?"translate3d(".concat(e,"px, ").concat(n,"px, 0)"):"translate(".concat(e,"px, ").concat(n,"px)")}}function Z_e(t){var e=t.allowEscapeViewBox,n=t.coordinate,r=t.offsetTopLeft,i=t.position,o=t.reverseDirection,a=t.tooltipBox,s=t.useTranslate3d,l=t.viewBox,c,u,d;return a.height>0&&a.width>0&&n?(u=CI({allowEscapeViewBox:e,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:a.width,viewBox:l,viewBoxDimension:l.width}),d=CI({allowEscapeViewBox:e,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:a.height,viewBox:l,viewBoxDimension:l.height}),c=J_e({translateX:u,translateY:d,useTranslate3d:s})):c=K_e,{cssProperties:c,cssClasses:Y_e({translateX:u,translateY:d,coordinate:n})}}function Wd(t){"@babel/helpers - typeof";return Wd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Wd(t)}function PI(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 RI(t){for(var e=1;eNI||Math.abs(r.height-this.state.lastBoundingBox.height)>NI)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,i=this.props,o=i.active,a=i.allowEscapeViewBox,s=i.animationDuration,l=i.animationEasing,c=i.children,u=i.coordinate,d=i.hasPayload,f=i.isAnimationActive,p=i.offset,y=i.position,v=i.reverseDirection,g=i.useTranslate3d,m=i.viewBox,x=i.wrapperStyle,b=Z_e({allowEscapeViewBox:a,coordinate:u,offsetTopLeft:p,position:y,reverseDirection:v,tooltipBox:this.state.lastBoundingBox,useTranslate3d:g,viewBox:m}),S=b.cssClasses,w=b.cssProperties,E=RI(RI({transition:f&&o?"transform ".concat(s,"ms ").concat(l):void 0},w),{},{pointerEvents:"none",visibility:!this.state.dismissed&&o&&d?"visible":"hidden",position:"absolute",top:0,left:0},x);return Z.createElement("div",{tabIndex:-1,className:S,style:E,ref:function(A){r.wrapperNode=A}},c)}}])}(_.PureComponent),lwe=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},jf={isSsr:lwe()};function Xd(t){"@babel/helpers - typeof";return Xd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xd(t)}function OI(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 II(t){for(var e=1;e0;return Z.createElement(swe,{allowEscapeViewBox:a,animationDuration:s,animationEasing:l,isAnimationActive:f,active:o,coordinate:u,hasPayload:E,offset:p,position:g,reverseDirection:m,useTranslate3d:x,viewBox:b,wrapperStyle:S},ywe(c,II(II({},this.props),{},{payload:w})))}}])}(_.PureComponent);GC(So,"displayName","Tooltip");GC(So,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!jf.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var xwe=Ta,bwe=function(){return xwe.Date.now()},_we=bwe,wwe=/\s/;function Swe(t){for(var e=t.length;e--&&wwe.test(t.charAt(e)););return e}var Ewe=Swe,Twe=Ewe,Mwe=/^\s+/;function Awe(t){return t&&t.slice(0,Twe(t)+1).replace(Mwe,"")}var Cwe=Awe,Pwe=Cwe,DI=Cl,Rwe=Cf,LI=NaN,Nwe=/^[-+]0x[0-9a-f]+$/i,Owe=/^0b[01]+$/i,Iwe=/^0o[0-7]+$/i,Dwe=parseInt;function Lwe(t){if(typeof t=="number")return t;if(Rwe(t))return LI;if(DI(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=DI(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=Pwe(t);var n=Owe.test(t);return n||Iwe.test(t)?Dwe(t.slice(2),n?2:8):Nwe.test(t)?LI:+t}var iH=Lwe,kwe=Cl,Xw=_we,kI=iH,jwe="Expected a function",Uwe=Math.max,Fwe=Math.min;function Bwe(t,e,n){var r,i,o,a,s,l,c=0,u=!1,d=!1,f=!0;if(typeof t!="function")throw new TypeError(jwe);e=kI(e)||0,kwe(n)&&(u=!!n.leading,d="maxWait"in n,o=d?Uwe(kI(n.maxWait)||0,e):o,f="trailing"in n?!!n.trailing:f);function p(E){var T=r,A=i;return r=i=void 0,c=E,a=t.apply(A,T),a}function y(E){return c=E,s=setTimeout(m,e),u?p(E):a}function v(E){var T=E-l,A=E-c,M=e-T;return d?Fwe(M,o-A):M}function g(E){var T=E-l,A=E-c;return l===void 0||T>=e||T<0||d&&A>=o}function m(){var E=Xw();if(g(E))return x(E);s=setTimeout(m,v(E))}function x(E){return s=void 0,f&&r?p(E):(r=i=void 0,a)}function b(){s!==void 0&&clearTimeout(s),c=0,r=l=i=s=void 0}function S(){return s===void 0?a:x(Xw())}function w(){var E=Xw(),T=g(E);if(r=arguments,i=this,l=E,T){if(s===void 0)return y(l);if(d)return clearTimeout(s),s=setTimeout(m,e),p(l)}return s===void 0&&(s=setTimeout(m,e)),a}return w.cancel=b,w.flush=S,w}var $we=Bwe,zwe=$we,Hwe=Cl,Vwe="Expected a function";function Gwe(t,e,n){var r=!0,i=!0;if(typeof t!="function")throw new TypeError(Vwe);return Hwe(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),zwe(t,e,{leading:r,maxWait:e,trailing:i})}var Wwe=Gwe;const oH=dn(Wwe);function jp(t){"@babel/helpers - typeof";return jp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jp(t)}function jI(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 dv(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&(D=oH(D,v,{trailing:!0,leading:!1}));var k=new ResizeObserver(D),U=w.current.getBoundingClientRect(),O=U.width,W=U.height;return P(O,W),k.observe(w.current),function(){k.disconnect()}},[P,v]);var R=_.useMemo(function(){var D=M.containerWidth,k=M.containerHeight;if(D<0||k<0)return null;vc(tc(a)||tc(l),`The width(%s) and height(%s) are both fixed numbers, + A`).concat(a,",").concat(a,",0,1,1,").concat(s,",").concat(o),className:"recharts-legend-icon"});if(r.type==="rect")return Q.createElement("path",{stroke:"none",fill:l,d:"M0,".concat(Hi/8,"h").concat(Hi,"v").concat(Hi*3/4,"h").concat(-Hi,"z"),className:"recharts-legend-icon"});if(Q.isValidElement(r.legendIcon)){var c=wme({},r);return delete c.legendIcon,Q.cloneElement(r.legendIcon,c)}return Q.createElement(kC,{fill:l,cx:o,cy:o,size:Hi,sizeType:"diameter",type:r.type})}},{key:"renderItems",value:function(){var r=this,i=this.props,o=i.payload,a=i.iconSize,s=i.layout,l=i.formatter,c=i.inactiveColor,u={x:0,y:0,width:Hi,height:Hi},d={display:s==="horizontal"?"inline-block":"block",marginRight:10},f={display:"inline-block",verticalAlign:"middle",marginRight:4};return o.map(function(p,y){var v=p.formatter||l,g=zt(Dp(Dp({"recharts-legend-item":!0},"legend-item-".concat(y),!0),"inactive",p.inactive));if(p.type==="none")return null;var m=jt(p.value)?null:p.value;vc(!jt(p.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: `);var x=p.inactive?c:p.color;return Q.createElement("li",$1({className:g,style:d,key:"legend-item-".concat(y)},Fy(r.props,p,y)),Q.createElement(O1,{width:a,height:a,viewBox:u,style:f},r.renderIcon(p)),Q.createElement("span",{className:"recharts-legend-item-text",style:{color:x}},v?v(m,p,y):m))})}},{key:"render",value:function(){var r=this.props,i=r.payload,o=r.layout,a=r.align;if(!i||!i.length)return null;var s={padding:0,margin:0,textAlign:o==="horizontal"?a:"left"};return Q.createElement("ul",{className:"recharts-default-legend",style:s},this.renderItems())}}])}(_.PureComponent);Dp(jC,"displayName","Legend");Dp(jC,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Nme=ob;function Ome(){this.__data__=new Nme,this.size=0}var Ime=Ome;function Dme(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}var Lme=Dme;function kme(t){return this.__data__.get(t)}var jme=kme;function Ume(t){return this.__data__.has(t)}var Fme=Ume,Bme=ob,$me=EC,zme=TC,Hme=200;function Vme(t,e){var n=this.__data__;if(n instanceof Bme){var r=n.__data__;if(!$me||r.lengths))return!1;var c=o.get(t),u=o.get(e);if(c&&u)return c==e&&u==t;var d=-1,f=!0,p=n&fge?new lge:void 0;for(o.set(t,e),o.set(e,t);++d-1&&t%1==0&&t-1&&t%1==0&&t<=gve}var $C=vve,yve=hs,xve=$C,bve=ps,_ve="[object Arguments]",wve="[object Array]",Sve="[object Boolean]",Eve="[object Date]",Tve="[object Error]",Mve="[object Function]",Ave="[object Map]",Cve="[object Number]",Pve="[object Object]",Rve="[object RegExp]",Nve="[object Set]",Ove="[object String]",Ive="[object WeakMap]",Dve="[object ArrayBuffer]",Lve="[object DataView]",kve="[object Float32Array]",jve="[object Float64Array]",Uve="[object Int8Array]",Fve="[object Int16Array]",Bve="[object Int32Array]",$ve="[object Uint8Array]",zve="[object Uint8ClampedArray]",Hve="[object Uint16Array]",Vve="[object Uint32Array]",bn={};bn[kve]=bn[jve]=bn[Uve]=bn[Fve]=bn[Bve]=bn[$ve]=bn[zve]=bn[Hve]=bn[Vve]=!0;bn[_ve]=bn[wve]=bn[Dve]=bn[Sve]=bn[Lve]=bn[Eve]=bn[Tve]=bn[Mve]=bn[Ave]=bn[Cve]=bn[Pve]=bn[Rve]=bn[Nve]=bn[Ove]=bn[Ive]=!1;function Gve(t){return bve(t)&&xve(t.length)&&!!bn[yve(t)]}var Wve=Gve;function Xve(t){return function(e){return t(e)}}var B5=Xve,qy={exports:{}};qy.exports;(function(t,e){var n=qz,r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,o=i&&i.exports===r,a=o&&n.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||a&&a.binding&&a.binding("util")}catch{}}();t.exports=s})(qy,qy.exports);var qve=qy.exports,Kve=Wve,Yve=B5,nI=qve,rI=nI&&nI.isTypedArray,Jve=rI?Yve(rI):Kve,$5=Jve,Zve=tve,Qve=FC,eye=yi,tye=F5,nye=BC,rye=$5,iye=Object.prototype,oye=iye.hasOwnProperty;function aye(t,e){var n=eye(t),r=!n&&Qve(t),i=!n&&!r&&tye(t),o=!n&&!r&&!i&&rye(t),a=n||r||i||o,s=a?Zve(t.length,String):[],l=s.length;for(var c in t)(e||oye.call(t,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||nye(c,l)))&&s.push(c);return s}var sye=aye,lye=Object.prototype;function cye(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||lye;return t===n}var uye=cye;function dye(t,e){return function(n){return t(e(n))}}var z5=dye,fye=z5,hye=fye(Object.keys,Object),pye=hye,mye=uye,gye=pye,vye=Object.prototype,yye=vye.hasOwnProperty;function xye(t){if(!mye(t))return gye(t);var e=[];for(var n in Object(t))yye.call(t,n)&&n!="constructor"&&e.push(n);return e}var bye=xye,_ye=wC,wye=$C;function Sye(t){return t!=null&&wye(t.length)&&!_ye(t)}var wb=Sye,Eye=sye,Tye=bye,Mye=wb;function Aye(t){return Mye(t)?Eye(t):Tye(t)}var zC=Aye,Cye=Hge,Pye=Qge,Rye=zC;function Nye(t){return Cye(t,Rye,Pye)}var Oye=Nye,iI=Oye,Iye=1,Dye=Object.prototype,Lye=Dye.hasOwnProperty;function kye(t,e,n,r,i,o){var a=n&Iye,s=iI(t),l=s.length,c=iI(e),u=c.length;if(l!=u&&!a)return!1;for(var d=l;d--;){var f=s[d];if(!(a?f in e:Lye.call(e,f)))return!1}var p=o.get(t),y=o.get(e);if(p&&y)return p==e&&y==t;var v=!0;o.set(t,e),o.set(e,t);for(var g=a;++d-1}var Lxe=Dxe;function kxe(t,e,n){for(var r=-1,i=t==null?0:t.length;++r=Jxe){var c=e?null:Kxe(t);if(c)return Yxe(c);a=!1,i=qxe,l=new Gxe}else l=e?[]:s;e:for(;++r=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function hbe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function pbe(t){return t.value}function mbe(t,e){if(Q.isValidElement(t))return Q.cloneElement(t,e);if(typeof t=="function")return Q.createElement(t,e);e.ref;var n=fbe(e,ibe);return Q.createElement(jC,n)}var bI=1,hd=function(t){function e(){var n;obe(this,e);for(var r=arguments.length,i=new Array(r),o=0;obI||Math.abs(i.height-this.lastBoundingBox.height)>bI)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,r&&r(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?La({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var i=this.props,o=i.layout,a=i.align,s=i.verticalAlign,l=i.margin,c=i.chartWidth,u=i.chartHeight,d,f;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(a==="center"&&o==="vertical"){var p=this.getBBoxSnapshot();d={left:((c||0)-p.width)/2}}else d=a==="right"?{right:l&&l.right||0}:{left:l&&l.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(s==="middle"){var y=this.getBBoxSnapshot();f={top:((u||0)-y.height)/2}}else f=s==="bottom"?{bottom:l&&l.bottom||0}:{top:l&&l.top||0};return La(La({},d),f)}},{key:"render",value:function(){var r=this,i=this.props,o=i.content,a=i.width,s=i.height,l=i.wrapperStyle,c=i.payloadUniqBy,u=i.payload,d=La(La({position:"absolute",width:a||"auto",height:s||"auto"},this.getDefaultPosition(l)),l);return Q.createElement("div",{className:"recharts-legend-wrapper",style:d,ref:function(p){r.wrapperNode=p}},mbe(o,La(La({},this.props),{},{payload:q5(u,c,pbe)})))}}],[{key:"getWithHeight",value:function(r,i){var o=La(La({},this.defaultProps),r.props),a=o.layout;return a==="vertical"&&ze(r.props.height)?{height:r.props.height}:a==="horizontal"?{width:r.props.width||i}:null}}])}(_.PureComponent);Sb(hd,"displayName","Legend");Sb(hd,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var _I=Fm,gbe=FC,vbe=yi,wI=_I?_I.isConcatSpreadable:void 0;function ybe(t){return vbe(t)||gbe(t)||!!(wI&&t&&t[wI])}var xbe=ybe,bbe=j5,_be=xbe;function J5(t,e,n,r,i){var o=-1,a=t.length;for(n||(n=_be),i||(i=[]);++o0&&n(s)?e>1?J5(s,e-1,n,r,i):bbe(i,s):r||(i[i.length]=s)}return i}var Z5=J5;function wbe(t){return function(e,n,r){for(var i=-1,o=Object(e),a=r(e),s=a.length;s--;){var l=a[t?s:++i];if(n(o[l],l,o)===!1)break}return e}}var Sbe=wbe,Ebe=Sbe,Tbe=Ebe(),Mbe=Tbe,Abe=Mbe,Cbe=zC;function Pbe(t,e){return t&&Abe(t,e,Cbe)}var Q5=Pbe,Rbe=wb;function Nbe(t,e){return function(n,r){if(n==null)return n;if(!Rbe(n))return t(n,r);for(var i=n.length,o=e?i:-1,a=Object(n);(e?o--:++oe||o&&a&&l&&!s&&!c||r&&a&&l||!n&&l||!i)return 1;if(!r&&!o&&!c&&t=s)return l;var c=n[r];return l*(c=="desc"?-1:1)}}return t.index-e.index}var Gbe=Vbe,Gw=AC,Wbe=CC,Xbe=kf,qbe=eH,Kbe=Bbe,Ybe=B5,Jbe=Gbe,Zbe=Lf,Qbe=yi;function e_e(t,e,n){e.length?e=Gw(e,function(o){return Qbe(o)?function(a){return Wbe(a,o.length===1?o[0]:o)}:o}):e=[Zbe];var r=-1;e=Gw(e,Ybe(Xbe));var i=qbe(t,function(o,a,s){var l=Gw(e,function(c){return c(o)});return{criteria:l,index:++r,value:o}});return Kbe(i,function(o,a){return Jbe(o,a,n)})}var t_e=e_e;function n_e(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var r_e=n_e,i_e=r_e,EI=Math.max;function o_e(t,e,n){return e=EI(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=EI(r.length-e,0),a=Array(o);++i0){if(++e>=m_e)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var x_e=y_e,b_e=p_e,__e=x_e,w_e=__e(b_e),S_e=w_e,E_e=Lf,T_e=a_e,M_e=S_e;function A_e(t,e){return M_e(T_e(t,e,E_e),t+"")}var C_e=A_e,P_e=SC,R_e=wb,N_e=BC,O_e=Cl;function I_e(t,e,n){if(!O_e(n))return!1;var r=typeof e;return(r=="number"?R_e(n)&&N_e(e,n.length):r=="string"&&e in n)?P_e(n[e],t):!1}var Eb=I_e,D_e=Z5,L_e=t_e,k_e=C_e,MI=Eb,j_e=k_e(function(t,e){if(t==null)return[];var n=e.length;return n>1&&MI(t,e[0],e[1])?e=[]:n>2&&MI(e[0],e[1],e[2])&&(e=[e[0]]),L_e(t,D_e(e,1),[])}),U_e=j_e;const GC=dn(U_e);function Lp(t){"@babel/helpers - typeof";return Lp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Lp(t)}function K1(){return K1=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=e.x),"".concat(hh,"-left"),ze(n)&&e&&ze(e.x)&&n=e.y),"".concat(hh,"-top"),ze(r)&&e&&ze(e.y)&&rv?Math.max(u,l[r]):Math.max(d,l[r])}function Q_e(t){var e=t.translateX,n=t.translateY,r=t.useTranslate3d;return{transform:r?"translate3d(".concat(e,"px, ").concat(n,"px, 0)"):"translate(".concat(e,"px, ").concat(n,"px)")}}function ewe(t){var e=t.allowEscapeViewBox,n=t.coordinate,r=t.offsetTopLeft,i=t.position,o=t.reverseDirection,a=t.tooltipBox,s=t.useTranslate3d,l=t.viewBox,c,u,d;return a.height>0&&a.width>0&&n?(u=PI({allowEscapeViewBox:e,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:a.width,viewBox:l,viewBoxDimension:l.width}),d=PI({allowEscapeViewBox:e,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:a.height,viewBox:l,viewBoxDimension:l.height}),c=Q_e({translateX:u,translateY:d,useTranslate3d:s})):c=J_e,{cssProperties:c,cssClasses:Z_e({translateX:u,translateY:d,coordinate:n})}}function Wd(t){"@babel/helpers - typeof";return Wd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Wd(t)}function RI(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 NI(t){for(var e=1;eOI||Math.abs(r.height-this.state.lastBoundingBox.height)>OI)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,i=this.props,o=i.active,a=i.allowEscapeViewBox,s=i.animationDuration,l=i.animationEasing,c=i.children,u=i.coordinate,d=i.hasPayload,f=i.isAnimationActive,p=i.offset,y=i.position,v=i.reverseDirection,g=i.useTranslate3d,m=i.viewBox,x=i.wrapperStyle,b=ewe({allowEscapeViewBox:a,coordinate:u,offsetTopLeft:p,position:y,reverseDirection:v,tooltipBox:this.state.lastBoundingBox,useTranslate3d:g,viewBox:m}),S=b.cssClasses,w=b.cssProperties,E=NI(NI({transition:f&&o?"transform ".concat(s,"ms ").concat(l):void 0},w),{},{pointerEvents:"none",visibility:!this.state.dismissed&&o&&d?"visible":"hidden",position:"absolute",top:0,left:0},x);return Q.createElement("div",{tabIndex:-1,className:S,style:E,ref:function(A){r.wrapperNode=A}},c)}}])}(_.PureComponent),uwe=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},jf={isSsr:uwe()};function Xd(t){"@babel/helpers - typeof";return Xd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xd(t)}function II(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 DI(t){for(var e=1;e0;return Q.createElement(cwe,{allowEscapeViewBox:a,animationDuration:s,animationEasing:l,isAnimationActive:f,active:o,coordinate:u,hasPayload:E,offset:p,position:g,reverseDirection:m,useTranslate3d:x,viewBox:b,wrapperStyle:S},bwe(c,DI(DI({},this.props),{},{payload:w})))}}])}(_.PureComponent);WC(Eo,"displayName","Tooltip");WC(Eo,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!jf.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var _we=Ta,wwe=function(){return _we.Date.now()},Swe=wwe,Ewe=/\s/;function Twe(t){for(var e=t.length;e--&&Ewe.test(t.charAt(e)););return e}var Mwe=Twe,Awe=Mwe,Cwe=/^\s+/;function Pwe(t){return t&&t.slice(0,Awe(t)+1).replace(Cwe,"")}var Rwe=Pwe,Nwe=Rwe,LI=Cl,Owe=Cf,kI=NaN,Iwe=/^[-+]0x[0-9a-f]+$/i,Dwe=/^0b[01]+$/i,Lwe=/^0o[0-7]+$/i,kwe=parseInt;function jwe(t){if(typeof t=="number")return t;if(Owe(t))return kI;if(LI(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=LI(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=Nwe(t);var n=Dwe.test(t);return n||Lwe.test(t)?kwe(t.slice(2),n?2:8):Iwe.test(t)?kI:+t}var aH=jwe,Uwe=Cl,Xw=Swe,jI=aH,Fwe="Expected a function",Bwe=Math.max,$we=Math.min;function zwe(t,e,n){var r,i,o,a,s,l,c=0,u=!1,d=!1,f=!0;if(typeof t!="function")throw new TypeError(Fwe);e=jI(e)||0,Uwe(n)&&(u=!!n.leading,d="maxWait"in n,o=d?Bwe(jI(n.maxWait)||0,e):o,f="trailing"in n?!!n.trailing:f);function p(E){var T=r,A=i;return r=i=void 0,c=E,a=t.apply(A,T),a}function y(E){return c=E,s=setTimeout(m,e),u?p(E):a}function v(E){var T=E-l,A=E-c,M=e-T;return d?$we(M,o-A):M}function g(E){var T=E-l,A=E-c;return l===void 0||T>=e||T<0||d&&A>=o}function m(){var E=Xw();if(g(E))return x(E);s=setTimeout(m,v(E))}function x(E){return s=void 0,f&&r?p(E):(r=i=void 0,a)}function b(){s!==void 0&&clearTimeout(s),c=0,r=l=i=s=void 0}function S(){return s===void 0?a:x(Xw())}function w(){var E=Xw(),T=g(E);if(r=arguments,i=this,l=E,T){if(s===void 0)return y(l);if(d)return clearTimeout(s),s=setTimeout(m,e),p(l)}return s===void 0&&(s=setTimeout(m,e)),a}return w.cancel=b,w.flush=S,w}var Hwe=zwe,Vwe=Hwe,Gwe=Cl,Wwe="Expected a function";function Xwe(t,e,n){var r=!0,i=!0;if(typeof t!="function")throw new TypeError(Wwe);return Gwe(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Vwe(t,e,{leading:r,maxWait:e,trailing:i})}var qwe=Xwe;const sH=dn(qwe);function jp(t){"@babel/helpers - typeof";return jp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jp(t)}function UI(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 dv(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&(D=sH(D,v,{trailing:!0,leading:!1}));var k=new ResizeObserver(D),U=w.current.getBoundingClientRect(),O=U.width,X=U.height;return P(O,X),k.observe(w.current),function(){k.disconnect()}},[P,v]);var R=_.useMemo(function(){var D=M.containerWidth,k=M.containerHeight;if(D<0||k<0)return null;vc(tc(a)||tc(l),`The width(%s) and height(%s) are both fixed numbers, maybe you don't need to use a ResponsiveContainer.`,a,l),vc(!n||n>0,"The aspect(%s) must be greater than zero.",n);var U=tc(a)?D:a,O=tc(l)?k:l;n&&n>0&&(U?O=U/n:O&&(U=O*n),f&&O>f&&(O=f)),vc(U>0||O>0,`The width(%s) and height(%s) of chart should be greater than 0, please check the style of container, or the props width(%s) and height(%s), or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the - height and width.`,U,O,a,l,u,d,n);var W=!Array.isArray(p)&&Za(p.type).endsWith("Chart");return Z.Children.map(p,function(L){return Z.isValidElement(L)?_.cloneElement(L,dv({width:U,height:O},W?{style:dv({height:"100%",width:"100%",maxHeight:O,maxWidth:U},L.props.style)}:{})):L})},[n,p,l,f,d,u,M,a]);return Z.createElement("div",{id:g?"".concat(g):void 0,className:zt("recharts-responsive-container",m),style:dv(dv({},S),{},{width:a,height:l,minWidth:u,minHeight:d,maxHeight:f}),ref:w},R)}),aH=function(e){return null};aH.displayName="Cell";function Up(t){"@babel/helpers - typeof";return Up=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Up(t)}function BI(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 Q1(t){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||jf.isSsr)return{width:0,height:0};var r=aSe(n),i=JSON.stringify({text:e,copyStyle:r});if(Su.widthCache[i])return Su.widthCache[i];try{var o=document.getElementById($I);o||(o=document.createElement("span"),o.setAttribute("id",$I),o.setAttribute("aria-hidden","true"),document.body.appendChild(o));var a=Q1(Q1({},oSe),r);Object.assign(o.style,a),o.textContent="".concat(e);var s=o.getBoundingClientRect(),l={width:s.width,height:s.height};return Su.widthCache[i]=l,++Su.cacheCount>iSe&&(Su.cacheCount=0,Su.widthCache={}),l}catch{return{width:0,height:0}}},sSe=function(e){return{top:e.top+window.scrollY-document.documentElement.clientTop,left:e.left+window.scrollX-document.documentElement.clientLeft}};function Fp(t){"@babel/helpers - typeof";return Fp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fp(t)}function Zy(t,e){return dSe(t)||uSe(t,e)||cSe(t,e)||lSe()}function lSe(){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 cSe(t,e){if(t){if(typeof t=="string")return zI(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zI(t,e)}}function zI(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function TSe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function qI(t,e){return PSe(t)||CSe(t,e)||ASe(t,e)||MSe()}function MSe(){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 ASe(t,e){if(t){if(typeof t=="string")return KI(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return KI(t,e)}}function KI(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&arguments[0]!==void 0?arguments[0]:[];return U.reduce(function(O,W){var L=W.word,j=W.width,X=O[O.length-1];if(X&&(i==null||o||X.width+j+rW.width?O:W})};if(!u)return p;for(var v="โ€ฆ",g=function(U){var O=d.slice(0,U),W=uH({breakAll:c,style:l,children:O+v}).wordsWithComputedWidth,L=f(W),j=L.length>a||y(L).width>Number(i);return[j,L]},m=0,x=d.length-1,b=0,S;m<=x&&b<=d.length-1;){var w=Math.floor((m+x)/2),E=w-1,T=g(E),A=qI(T,2),M=A[0],C=A[1],P=g(w),R=qI(P,1),D=R[0];if(!M&&!D&&(m=w+1),M&&D&&(x=w-1),!M&&D){S=C;break}b++}return S||p},YI=function(e){var n=Ut(e)?[]:e.toString().split(cH);return[{words:n}]},NSe=function(e){var n=e.width,r=e.scaleToFit,i=e.children,o=e.style,a=e.breakAll,s=e.maxLines;if((n||r)&&!jf.isSsr){var l,c,u=uH({breakAll:a,children:i,style:o});if(u){var d=u.wordsWithComputedWidth,f=u.spaceWidth;l=d,c=f}else return YI(i);return RSe({breakAll:a,children:i,maxLines:s,style:o},l,c,n,r)}return YI(i)},JI="#808080",Qy=function(e){var n=e.x,r=n===void 0?0:n,i=e.y,o=i===void 0?0:i,a=e.lineHeight,s=a===void 0?"1em":a,l=e.capHeight,c=l===void 0?"0.71em":l,u=e.scaleToFit,d=u===void 0?!1:u,f=e.textAnchor,p=f===void 0?"start":f,y=e.verticalAnchor,v=y===void 0?"end":y,g=e.fill,m=g===void 0?JI:g,x=XI(e,SSe),b=_.useMemo(function(){return NSe({breakAll:x.breakAll,children:x.children,maxLines:x.maxLines,scaleToFit:d,style:x.style,width:x.width})},[x.breakAll,x.children,x.maxLines,d,x.style,x.width]),S=x.dx,w=x.dy,E=x.angle,T=x.className,A=x.breakAll,M=XI(x,ESe);if(!Yn(r)||!Yn(o))return null;var C=r+(ze(S)?S:0),P=o+(ze(w)?w:0),R;switch(v){case"start":R=qw("calc(".concat(c,")"));break;case"middle":R=qw("calc(".concat((b.length-1)/2," * -").concat(s," + (").concat(c," / 2))"));break;default:R=qw("calc(".concat(b.length-1," * -").concat(s,")"));break}var D=[];if(d){var k=b[0].width,U=x.width;D.push("scale(".concat((ze(U)?U/k:1)/k,")"))}return E&&D.push("rotate(".concat(E,", ").concat(C,", ").concat(P,")")),D.length&&(M.transform=D.join(" ")),Z.createElement("text",eT({},$t(M,!0),{x:C,y:P,className:zt("recharts-text",T),textAnchor:p,fill:m.includes("url")?JI:m}),b.map(function(O,W){var L=O.words.join(A?"":" ");return Z.createElement("tspan",{x:C,dy:W===0?R:s,key:"".concat(L,"-").concat(W)},L)}))};function rl(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function OSe(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function WC(t){let e,n,r;t.length!==2?(e=rl,n=(s,l)=>rl(t(s),l),r=(s,l)=>t(s)-l):(e=t===rl||t===OSe?t:ISe,n=t,r=t);function i(s,l,c=0,u=s.length){if(c>>1;n(s[d],l)<0?c=d+1:u=d}while(c>>1;n(s[d],l)<=0?c=d+1:u=d}while(cc&&r(s[d-1],l)>-r(s[d],l)?d-1:d}return{left:i,center:a,right:o}}function ISe(){return 0}function dH(t){return t===null?NaN:+t}function*DSe(t,e){for(let n of t)n!=null&&(n=+n)>=n&&(yield n)}const LSe=WC(rl),zm=LSe.right;WC(dH).center;class ZI extends Map{constructor(e,n=USe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const[r,i]of e)this.set(r,i)}get(e){return super.get(QI(this,e))}has(e){return super.has(QI(this,e))}set(e,n){return super.set(kSe(this,e),n)}delete(e){return super.delete(jSe(this,e))}}function QI({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function kSe({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function jSe({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function USe(t){return t!==null&&typeof t=="object"?t.valueOf():t}function FSe(t=rl){if(t===rl)return fH;if(typeof t!="function")throw new TypeError("compare is not a function");return(e,n)=>{const r=t(e,n);return r||r===0?r:(t(n,n)===0)-(t(e,e)===0)}}function fH(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(te?1:0)}const BSe=Math.sqrt(50),$Se=Math.sqrt(10),zSe=Math.sqrt(2);function e0(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=BSe?10:o>=$Se?5:o>=zSe?2:1;let s,l,c;return i<0?(c=Math.pow(10,-i)/a,s=Math.round(t*c),l=Math.round(e*c),s/ce&&--l,c=-c):(c=Math.pow(10,i)*a,s=Math.round(t/c),l=Math.round(e/c),s*ce&&--l),l0))return[];if(t===e)return[t];const r=e=i))return[];const s=o-i+1,l=new Array(s);if(r)if(a<0)for(let c=0;c=r)&&(n=r);return n}function tD(t,e){let n;for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function hH(t,e,n=0,r=1/0,i){if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(t.length-1,r)),!(n<=e&&e<=r))return t;for(i=i===void 0?fH:FSe(i);r>n;){if(r-n>600){const l=r-n+1,c=e-n+1,u=Math.log(l),d=.5*Math.exp(2*u/3),f=.5*Math.sqrt(u*d*(l-d)/l)*(c-l/2<0?-1:1),p=Math.max(n,Math.floor(e-c*d/l+f)),y=Math.min(r,Math.floor(e+(l-c)*d/l+f));hH(t,e,p,y,i)}const o=t[e];let a=n,s=r;for(ph(t,n,e),i(t[r],o)>0&&ph(t,n,r);a0;)--s}i(t[n],o)===0?ph(t,n,s):(++s,ph(t,s,r)),s<=e&&(n=s+1),e<=s&&(r=s-1)}return t}function ph(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function HSe(t,e,n){if(t=Float64Array.from(DSe(t)),!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return tD(t);if(e>=1)return eD(t);var r,i=(r-1)*e,o=Math.floor(i),a=eD(hH(t,o).subarray(0,o+1)),s=tD(t.subarray(o+1));return a+(s-a)*(i-o)}}function VSe(t,e,n=dH){if(!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,o=Math.floor(i),a=+n(t[o],o,t),s=+n(t[o+1],o+1,t);return a+(s-a)*(i-o)}}function GSe(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((e-t)/n))|0,o=new Array(i);++r>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?hv(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?hv(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=XSe.exec(t))?new ai(e[1],e[2],e[3],1):(e=qSe.exec(t))?new ai(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=KSe.exec(t))?hv(e[1],e[2],e[3],e[4]):(e=YSe.exec(t))?hv(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=JSe.exec(t))?lD(e[1],e[2]/100,e[3]/100,1):(e=ZSe.exec(t))?lD(e[1],e[2]/100,e[3]/100,e[4]):nD.hasOwnProperty(t)?oD(nD[t]):t==="transparent"?new ai(NaN,NaN,NaN,0):null}function oD(t){return new ai(t>>16&255,t>>8&255,t&255,1)}function hv(t,e,n,r){return r<=0&&(t=e=n=NaN),new ai(t,e,n,r)}function tEe(t){return t instanceof Hm||(t=Hp(t)),t?(t=t.rgb(),new ai(t.r,t.g,t.b,t.opacity)):new ai}function oT(t,e,n,r){return arguments.length===1?tEe(t):new ai(t,e,n,r??1)}function ai(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}qC(ai,oT,mH(Hm,{brighter(t){return t=t==null?t0:Math.pow(t0,t),new ai(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?$p:Math.pow($p,t),new ai(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new ai(yc(this.r),yc(this.g),yc(this.b),n0(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:aD,formatHex:aD,formatHex8:nEe,formatRgb:sD,toString:sD}));function aD(){return`#${nc(this.r)}${nc(this.g)}${nc(this.b)}`}function nEe(){return`#${nc(this.r)}${nc(this.g)}${nc(this.b)}${nc((isNaN(this.opacity)?1:this.opacity)*255)}`}function sD(){const t=n0(this.opacity);return`${t===1?"rgb(":"rgba("}${yc(this.r)}, ${yc(this.g)}, ${yc(this.b)}${t===1?")":`, ${t})`}`}function n0(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function yc(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function nc(t){return t=yc(t),(t<16?"0":"")+t.toString(16)}function lD(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new No(t,e,n,r)}function gH(t){if(t instanceof No)return new No(t.h,t.s,t.l,t.opacity);if(t instanceof Hm||(t=Hp(t)),!t)return new No;if(t instanceof No)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(e===o?a=(n-r)/s+(n0&&l<1?0:a,new No(a,s,l,t.opacity)}function rEe(t,e,n,r){return arguments.length===1?gH(t):new No(t,e,n,r??1)}function No(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}qC(No,rEe,mH(Hm,{brighter(t){return t=t==null?t0:Math.pow(t0,t),new No(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?$p:Math.pow($p,t),new No(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 ai(Kw(t>=240?t-240:t+120,i,r),Kw(t,i,r),Kw(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new No(cD(this.h),pv(this.s),pv(this.l),n0(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=n0(this.opacity);return`${t===1?"hsl(":"hsla("}${cD(this.h)}, ${pv(this.s)*100}%, ${pv(this.l)*100}%${t===1?")":`, ${t})`}`}}));function cD(t){return t=(t||0)%360,t<0?t+360:t}function pv(t){return Math.max(0,Math.min(1,t||0))}function Kw(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 KC=t=>()=>t;function iEe(t,e){return function(n){return t+n*e}}function oEe(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 aEe(t){return(t=+t)==1?vH:function(e,n){return n-e?oEe(e,n,t):KC(isNaN(e)?n:e)}}function vH(t,e){var n=e-t;return n?iEe(t,n):KC(isNaN(t)?e:t)}const uD=function t(e){var n=aEe(e);function r(i,o){var a=n((i=oT(i)).r,(o=oT(o)).r),s=n(i.g,o.g),l=n(i.b,o.b),c=vH(i.opacity,o.opacity);return function(u){return i.r=a(u),i.g=s(u),i.b=l(u),i.opacity=c(u),i+""}}return r.gamma=t,r}(1);function sEe(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),i;return function(o){for(i=0;in&&(o=e.slice(n,o),s[a]?s[a]+=o:s[++a]=o),(r=r[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,l.push({i:a,x:r0(r,i)})),n=Yw.lastIndex;return ne&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function yEe(t,e,n){var r=t[0],i=t[1],o=e[0],a=e[1];return i2?xEe:yEe,l=c=null,d}function d(f){return f==null||isNaN(f=+f)?o:(l||(l=s(t.map(r),e,n)))(r(a(f)))}return d.invert=function(f){return a(i((c||(c=s(e,t.map(r),r0)))(f)))},d.domain=function(f){return arguments.length?(t=Array.from(f,i0),u()):t.slice()},d.range=function(f){return arguments.length?(e=Array.from(f),u()):e.slice()},d.rangeRound=function(f){return e=Array.from(f),n=YC,u()},d.clamp=function(f){return arguments.length?(a=f?!0:Hr,u()):a!==Hr},d.interpolate=function(f){return arguments.length?(n=f,u()):n},d.unknown=function(f){return arguments.length?(o=f,d):o},function(f,p){return r=f,i=p,u()}}function JC(){return Tb()(Hr,Hr)}function bEe(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function o0(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 qd(t){return t=o0(Math.abs(t)),t?t[1]:NaN}function _Ee(t,e){return function(n,r){for(var i=n.length,o=[],a=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),o.push(n.substring(i-=s,i+s)),!((l+=s+1)>r));)s=t[a=(a+1)%t.length];return o.reverse().join(e)}}function wEe(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var SEe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Vp(t){if(!(e=SEe.exec(t)))throw new Error("invalid format: "+t);var e;return new ZC({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]})}Vp.prototype=ZC.prototype;function ZC(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+""}ZC.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 EEe(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 yH;function TEe(t,e){var n=o0(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(yH=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+o0(t,Math.max(0,e+o-1))[0]}function fD(t,e){var n=o0(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 hD={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:bEe,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)=>fD(t*100,e),r:fD,s:TEe,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function pD(t){return t}var mD=Array.prototype.map,gD=["y","z","a","f","p","n","ยต","m","","k","M","G","T","P","E","Z","Y"];function MEe(t){var e=t.grouping===void 0||t.thousands===void 0?pD:_Ee(mD.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+"",o=t.numerals===void 0?pD:wEe(mD.call(t.numerals,String)),a=t.percent===void 0?"%":t.percent+"",s=t.minus===void 0?"โˆ’":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function c(d){d=Vp(d);var f=d.fill,p=d.align,y=d.sign,v=d.symbol,g=d.zero,m=d.width,x=d.comma,b=d.precision,S=d.trim,w=d.type;w==="n"?(x=!0,w="g"):hD[w]||(b===void 0&&(b=12),S=!0,w="g"),(g||f==="0"&&p==="=")&&(g=!0,f="0",p="=");var E=v==="$"?n:v==="#"&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",T=v==="$"?r:/[%p]/.test(w)?a:"",A=hD[w],M=/[defgprs%]/.test(w);b=b===void 0?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b));function C(P){var R=E,D=T,k,U,O;if(w==="c")D=A(P)+D,P="";else{P=+P;var W=P<0||1/P<0;if(P=isNaN(P)?l:A(Math.abs(P),b),S&&(P=EEe(P)),W&&+P==0&&y!=="+"&&(W=!1),R=(W?y==="("?y:s:y==="-"||y==="("?"":y)+R,D=(w==="s"?gD[8+yH/3]:"")+D+(W&&y==="("?")":""),M){for(k=-1,U=P.length;++kO||O>57){D=(O===46?i+P.slice(k+1):P.slice(k))+D,P=P.slice(0,k);break}}}x&&!g&&(P=e(P,1/0));var L=R.length+P.length+D.length,j=L>1)+R+P+D+j.slice(L);break;default:P=j+R+P+D;break}return o(P)}return C.toString=function(){return d+""},C}function u(d,f){var p=c((d=Vp(d),d.type="f",d)),y=Math.max(-8,Math.min(8,Math.floor(qd(f)/3)))*3,v=Math.pow(10,-y),g=gD[8+y/3];return function(m){return p(v*m)+g}}return{format:c,formatPrefix:u}}var mv,QC,xH;AEe({thousands:",",grouping:[3],currency:["$",""]});function AEe(t){return mv=MEe(t),QC=mv.format,xH=mv.formatPrefix,mv}function CEe(t){return Math.max(0,-qd(Math.abs(t)))}function PEe(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(qd(e)/3)))*3-qd(Math.abs(t)))}function REe(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,qd(e)-qd(t))+1}function bH(t,e,n,r){var i=rT(t,e,n),o;switch(r=Vp(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(o=PEe(i,a))&&(r.precision=o),xH(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=REe(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=CEe(i))&&(r.precision=o-(r.type==="%")*2);break}}return QC(r)}function Pl(t){var e=t.domain;return t.ticks=function(n){var r=e();return tT(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return bH(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,o=r.length-1,a=r[i],s=r[o],l,c,u=10;for(s0;){if(c=nT(a,s,n),c===l)return r[i]=a,r[o]=s,e(r);if(c>0)a=Math.floor(a/c)*c,s=Math.ceil(s/c)*c;else if(c<0)a=Math.ceil(a*c)/c,s=Math.floor(s*c)/c;else break;l=c}return t},t}function a0(){var t=JC();return t.copy=function(){return Vm(t,a0())},lo.apply(t,arguments),Pl(t)}function _H(t){var e;function n(r){return r==null||isNaN(r=+r)?e:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(t=Array.from(r,i0),n):t.slice()},n.unknown=function(r){return arguments.length?(e=r,n):e},n.copy=function(){return _H(t).unknown(e)},t=arguments.length?Array.from(t,i0):[0,1],Pl(n)}function wH(t,e){t=t.slice();var n=0,r=t.length-1,i=t[n],o=t[r],a;return oMath.pow(t,e)}function LEe(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function xD(t){return(e,n)=>-t(-e,n)}function eP(t){const e=t(vD,yD),n=e.domain;let r=10,i,o;function a(){return i=LEe(r),o=DEe(r),n()[0]<0?(i=xD(i),o=xD(o),t(NEe,OEe)):t(vD,yD),e}return e.base=function(s){return arguments.length?(r=+s,a()):r},e.domain=function(s){return arguments.length?(n(s),a()):n()},e.ticks=s=>{const l=n();let c=l[0],u=l[l.length-1];const d=u0){for(;f<=p;++f)for(y=1;yu)break;m.push(v)}}else for(;f<=p;++f)for(y=r-1;y>=1;--y)if(v=f>0?y/o(-f):y*o(f),!(vu)break;m.push(v)}m.length*2{if(s==null&&(s=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=Vp(l)).precision==null&&(l.trim=!0),l=QC(l)),s===1/0)return l;const c=Math.max(1,r*s/e.ticks().length);return u=>{let d=u/o(Math.round(i(u)));return d*rn(wH(n(),{floor:s=>o(Math.floor(i(s))),ceil:s=>o(Math.ceil(i(s)))})),e}function SH(){const t=eP(Tb()).domain([1,10]);return t.copy=()=>Vm(t,SH()).base(t.base()),lo.apply(t,arguments),t}function bD(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function _D(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function tP(t){var e=1,n=t(bD(e),_D(e));return n.constant=function(r){return arguments.length?t(bD(e=+r),_D(e)):e},Pl(n)}function EH(){var t=tP(Tb());return t.copy=function(){return Vm(t,EH()).constant(t.constant())},lo.apply(t,arguments)}function wD(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function kEe(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function jEe(t){return t<0?-t*t:t*t}function nP(t){var e=t(Hr,Hr),n=1;function r(){return n===1?t(Hr,Hr):n===.5?t(kEe,jEe):t(wD(n),wD(1/n))}return e.exponent=function(i){return arguments.length?(n=+i,r()):n},Pl(e)}function rP(){var t=nP(Tb());return t.copy=function(){return Vm(t,rP()).exponent(t.exponent())},lo.apply(t,arguments),t}function UEe(){return rP.apply(null,arguments).exponent(.5)}function SD(t){return Math.sign(t)*t*t}function FEe(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}function TH(){var t=JC(),e=[0,1],n=!1,r;function i(o){var a=FEe(t(o));return isNaN(a)?r:n?Math.round(a):a}return i.invert=function(o){return t.invert(SD(o))},i.domain=function(o){return arguments.length?(t.domain(o),i):t.domain()},i.range=function(o){return arguments.length?(t.range((e=Array.from(o,i0)).map(SD)),i):e.slice()},i.rangeRound=function(o){return i.range(o).round(!0)},i.round=function(o){return arguments.length?(n=!!o,i):n},i.clamp=function(o){return arguments.length?(t.clamp(o),i):t.clamp()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return TH(t.domain(),e).round(n).clamp(t.clamp()).unknown(r)},lo.apply(i,arguments),Pl(i)}function MH(){var t=[],e=[],n=[],r;function i(){var a=0,s=Math.max(1,e.length);for(n=new Array(s-1);++a0?n[s-1]:t[0],s=n?[r[n-1],e]:[r[c-1],r[c]]},a.unknown=function(l){return arguments.length&&(o=l),a},a.thresholds=function(){return r.slice()},a.copy=function(){return AH().domain([t,e]).range(i).unknown(o)},lo.apply(Pl(a),arguments)}function CH(){var t=[.5],e=[0,1],n,r=1;function i(o){return o!=null&&o<=o?e[zm(t,o,0,r)]:n}return i.domain=function(o){return arguments.length?(t=Array.from(o),r=Math.min(t.length,e.length-1),i):t.slice()},i.range=function(o){return arguments.length?(e=Array.from(o),r=Math.min(t.length,e.length-1),i):e.slice()},i.invertExtent=function(o){var a=e.indexOf(o);return[t[a-1],t[a]]},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return CH().domain(t).range(e).unknown(n)},lo.apply(i,arguments)}const Jw=new Date,Zw=new Date;function tr(t,e,n,r){function i(o){return t(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(t(o=new Date(+o)),o),i.ceil=o=>(t(o=new Date(o-1)),e(o,1),t(o),o),i.round=o=>{const a=i(o),s=i.ceil(o);return o-a(e(o=new Date(+o),a==null?1:Math.floor(a)),o),i.range=(o,a,s)=>{const l=[];if(o=i.ceil(o),s=s==null?1:Math.floor(s),!(o0))return l;let c;do l.push(c=new Date(+o)),e(o,s),t(o);while(ctr(a=>{if(a>=a)for(;t(a),!o(a);)a.setTime(a-1)},(a,s)=>{if(a>=a)if(s<0)for(;++s<=0;)for(;e(a,-1),!o(a););else for(;--s>=0;)for(;e(a,1),!o(a););}),n&&(i.count=(o,a)=>(Jw.setTime(+o),Zw.setTime(+a),t(Jw),t(Zw),Math.floor(n(Jw,Zw))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?a=>r(a)%o===0:a=>i.count(0,a)%o===0):i)),i}const s0=tr(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);s0.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?tr(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):s0);s0.range;const qa=1e3,Qi=qa*60,Ka=Qi*60,ss=Ka*24,iP=ss*7,ED=ss*30,Qw=ss*365,rc=tr(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*qa)},(t,e)=>(e-t)/qa,t=>t.getUTCSeconds());rc.range;const oP=tr(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*qa)},(t,e)=>{t.setTime(+t+e*Qi)},(t,e)=>(e-t)/Qi,t=>t.getMinutes());oP.range;const aP=tr(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*Qi)},(t,e)=>(e-t)/Qi,t=>t.getUTCMinutes());aP.range;const sP=tr(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*qa-t.getMinutes()*Qi)},(t,e)=>{t.setTime(+t+e*Ka)},(t,e)=>(e-t)/Ka,t=>t.getHours());sP.range;const lP=tr(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*Ka)},(t,e)=>(e-t)/Ka,t=>t.getUTCHours());lP.range;const Gm=tr(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Qi)/ss,t=>t.getDate()-1);Gm.range;const Mb=tr(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/ss,t=>t.getUTCDate()-1);Mb.range;const PH=tr(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/ss,t=>Math.floor(t/ss));PH.range;function Kc(t){return tr(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*Qi)/iP)}const Ab=Kc(0),l0=Kc(1),BEe=Kc(2),$Ee=Kc(3),Kd=Kc(4),zEe=Kc(5),HEe=Kc(6);Ab.range;l0.range;BEe.range;$Ee.range;Kd.range;zEe.range;HEe.range;function Yc(t){return tr(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/iP)}const Cb=Yc(0),c0=Yc(1),VEe=Yc(2),GEe=Yc(3),Yd=Yc(4),WEe=Yc(5),XEe=Yc(6);Cb.range;c0.range;VEe.range;GEe.range;Yd.range;WEe.range;XEe.range;const cP=tr(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());cP.range;const uP=tr(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());uP.range;const ls=tr(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());ls.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:tr(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});ls.range;const cs=tr(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());cs.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:tr(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});cs.range;function RH(t,e,n,r,i,o){const a=[[rc,1,qa],[rc,5,5*qa],[rc,15,15*qa],[rc,30,30*qa],[o,1,Qi],[o,5,5*Qi],[o,15,15*Qi],[o,30,30*Qi],[i,1,Ka],[i,3,3*Ka],[i,6,6*Ka],[i,12,12*Ka],[r,1,ss],[r,2,2*ss],[n,1,iP],[e,1,ED],[e,3,3*ED],[t,1,Qw]];function s(c,u,d){const f=ug).right(a,f);if(p===a.length)return t.every(rT(c/Qw,u/Qw,d));if(p===0)return s0.every(Math.max(rT(c,u,d),1));const[y,v]=a[f/a[p-1][2]53)return null;"w"in le||(le.w=1),"Z"in le?(G=tS(mh(le.y,0,1)),Ve=G.getUTCDay(),G=Ve>4||Ve===0?c0.ceil(G):c0(G),G=Mb.offset(G,(le.V-1)*7),le.y=G.getUTCFullYear(),le.m=G.getUTCMonth(),le.d=G.getUTCDate()+(le.w+6)%7):(G=eS(mh(le.y,0,1)),Ve=G.getDay(),G=Ve>4||Ve===0?l0.ceil(G):l0(G),G=Gm.offset(G,(le.V-1)*7),le.y=G.getFullYear(),le.m=G.getMonth(),le.d=G.getDate()+(le.w+6)%7)}else("W"in le||"U"in le)&&("w"in le||(le.w="u"in le?le.u%7:"W"in le?1:0),Ve="Z"in le?tS(mh(le.y,0,1)).getUTCDay():eS(mh(le.y,0,1)).getDay(),le.m=0,le.d="W"in le?(le.w+6)%7+le.W*7-(Ve+5)%7:le.w+le.U*7-(Ve+6)%7);return"Z"in le?(le.H+=le.Z/100|0,le.M+=le.Z%100,tS(le)):eS(le)}}function A(ae,fe,we,le){for(var ie=0,G=fe.length,Ve=we.length,Ne,st;ie=Ve)return-1;if(Ne=fe.charCodeAt(ie++),Ne===37){if(Ne=fe.charAt(ie++),st=w[Ne in TD?fe.charAt(ie++):Ne],!st||(le=st(ae,we,le))<0)return-1}else if(Ne!=we.charCodeAt(le++))return-1}return le}function M(ae,fe,we){var le=c.exec(fe.slice(we));return le?(ae.p=u.get(le[0].toLowerCase()),we+le[0].length):-1}function C(ae,fe,we){var le=p.exec(fe.slice(we));return le?(ae.w=y.get(le[0].toLowerCase()),we+le[0].length):-1}function P(ae,fe,we){var le=d.exec(fe.slice(we));return le?(ae.w=f.get(le[0].toLowerCase()),we+le[0].length):-1}function R(ae,fe,we){var le=m.exec(fe.slice(we));return le?(ae.m=x.get(le[0].toLowerCase()),we+le[0].length):-1}function D(ae,fe,we){var le=v.exec(fe.slice(we));return le?(ae.m=g.get(le[0].toLowerCase()),we+le[0].length):-1}function k(ae,fe,we){return A(ae,e,fe,we)}function U(ae,fe,we){return A(ae,n,fe,we)}function O(ae,fe,we){return A(ae,r,fe,we)}function W(ae){return a[ae.getDay()]}function L(ae){return o[ae.getDay()]}function j(ae){return l[ae.getMonth()]}function X(ae){return s[ae.getMonth()]}function K(ae){return i[+(ae.getHours()>=12)]}function F(ae){return 1+~~(ae.getMonth()/3)}function Y(ae){return a[ae.getUTCDay()]}function q(ae){return o[ae.getUTCDay()]}function ee(ae){return l[ae.getUTCMonth()]}function te(ae){return s[ae.getUTCMonth()]}function Q(ae){return i[+(ae.getUTCHours()>=12)]}function ce(ae){return 1+~~(ae.getUTCMonth()/3)}return{format:function(ae){var fe=E(ae+="",b);return fe.toString=function(){return ae},fe},parse:function(ae){var fe=T(ae+="",!1);return fe.toString=function(){return ae},fe},utcFormat:function(ae){var fe=E(ae+="",S);return fe.toString=function(){return ae},fe},utcParse:function(ae){var fe=T(ae+="",!0);return fe.toString=function(){return ae},fe}}}var TD={"-":"",_:" ",0:"0"},dr=/^\s*\d+/,QEe=/^%/,e1e=/[\\^$*+?|[\]().{}]/g;function qt(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o[e.toLowerCase(),n]))}function n1e(t,e,n){var r=dr.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function r1e(t,e,n){var r=dr.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function i1e(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function o1e(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function a1e(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function MD(t,e,n){var r=dr.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function AD(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function s1e(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function l1e(t,e,n){var r=dr.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function c1e(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function CD(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function u1e(t,e,n){var r=dr.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function PD(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function d1e(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function f1e(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function h1e(t,e,n){var r=dr.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function p1e(t,e,n){var r=dr.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function m1e(t,e,n){var r=QEe.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function g1e(t,e,n){var r=dr.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function v1e(t,e,n){var r=dr.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function RD(t,e){return qt(t.getDate(),e,2)}function y1e(t,e){return qt(t.getHours(),e,2)}function x1e(t,e){return qt(t.getHours()%12||12,e,2)}function b1e(t,e){return qt(1+Gm.count(ls(t),t),e,3)}function NH(t,e){return qt(t.getMilliseconds(),e,3)}function _1e(t,e){return NH(t,e)+"000"}function w1e(t,e){return qt(t.getMonth()+1,e,2)}function S1e(t,e){return qt(t.getMinutes(),e,2)}function E1e(t,e){return qt(t.getSeconds(),e,2)}function T1e(t){var e=t.getDay();return e===0?7:e}function M1e(t,e){return qt(Ab.count(ls(t)-1,t),e,2)}function OH(t){var e=t.getDay();return e>=4||e===0?Kd(t):Kd.ceil(t)}function A1e(t,e){return t=OH(t),qt(Kd.count(ls(t),t)+(ls(t).getDay()===4),e,2)}function C1e(t){return t.getDay()}function P1e(t,e){return qt(l0.count(ls(t)-1,t),e,2)}function R1e(t,e){return qt(t.getFullYear()%100,e,2)}function N1e(t,e){return t=OH(t),qt(t.getFullYear()%100,e,2)}function O1e(t,e){return qt(t.getFullYear()%1e4,e,4)}function I1e(t,e){var n=t.getDay();return t=n>=4||n===0?Kd(t):Kd.ceil(t),qt(t.getFullYear()%1e4,e,4)}function D1e(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+qt(e/60|0,"0",2)+qt(e%60,"0",2)}function ND(t,e){return qt(t.getUTCDate(),e,2)}function L1e(t,e){return qt(t.getUTCHours(),e,2)}function k1e(t,e){return qt(t.getUTCHours()%12||12,e,2)}function j1e(t,e){return qt(1+Mb.count(cs(t),t),e,3)}function IH(t,e){return qt(t.getUTCMilliseconds(),e,3)}function U1e(t,e){return IH(t,e)+"000"}function F1e(t,e){return qt(t.getUTCMonth()+1,e,2)}function B1e(t,e){return qt(t.getUTCMinutes(),e,2)}function $1e(t,e){return qt(t.getUTCSeconds(),e,2)}function z1e(t){var e=t.getUTCDay();return e===0?7:e}function H1e(t,e){return qt(Cb.count(cs(t)-1,t),e,2)}function DH(t){var e=t.getUTCDay();return e>=4||e===0?Yd(t):Yd.ceil(t)}function V1e(t,e){return t=DH(t),qt(Yd.count(cs(t),t)+(cs(t).getUTCDay()===4),e,2)}function G1e(t){return t.getUTCDay()}function W1e(t,e){return qt(c0.count(cs(t)-1,t),e,2)}function X1e(t,e){return qt(t.getUTCFullYear()%100,e,2)}function q1e(t,e){return t=DH(t),qt(t.getUTCFullYear()%100,e,2)}function K1e(t,e){return qt(t.getUTCFullYear()%1e4,e,4)}function Y1e(t,e){var n=t.getUTCDay();return t=n>=4||n===0?Yd(t):Yd.ceil(t),qt(t.getUTCFullYear()%1e4,e,4)}function J1e(){return"+0000"}function OD(){return"%"}function ID(t){return+t}function DD(t){return Math.floor(+t/1e3)}var Eu,LH,kH;Z1e({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Z1e(t){return Eu=ZEe(t),LH=Eu.format,Eu.parse,kH=Eu.utcFormat,Eu.utcParse,Eu}function Q1e(t){return new Date(t)}function eTe(t){return t instanceof Date?+t:+new Date(+t)}function dP(t,e,n,r,i,o,a,s,l,c){var u=JC(),d=u.invert,f=u.domain,p=c(".%L"),y=c(":%S"),v=c("%I:%M"),g=c("%I %p"),m=c("%a %d"),x=c("%b %d"),b=c("%B"),S=c("%Y");function w(E){return(l(E)e(i/(t.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,o)=>HSe(t,o/r))},n.copy=function(){return BH(e).domain(t)},ms.apply(n,arguments)}function Rb(){var t=0,e=.5,n=1,r=1,i,o,a,s,l,c=Hr,u,d=!1,f;function p(v){return isNaN(v=+v)?f:(v=.5+((v=+u(v))-o)*(r*ve}var lTe=sTe,cTe=VH,uTe=lTe,dTe=Lf;function fTe(t){return t&&t.length?cTe(t,dTe,uTe):void 0}var hTe=fTe;const Nb=dn(hTe);function pTe(t,e){return tt.e^o.s<0?1:-1;for(r=o.d.length,i=t.d.length,e=0,n=rt.d[e]^o.s<0?1:-1;return r===i?0:r>i^o.s<0?1:-1};Ke.decimalPlaces=Ke.dp=function(){var t=this,e=t.d.length-1,n=(e-t.e)*_n;if(e=t.d[e],e)for(;e%10==0;e/=10)n--;return n<0?0:n};Ke.dividedBy=Ke.div=function(t){return Qa(this,new this.constructor(t))};Ke.dividedToIntegerBy=Ke.idiv=function(t){var e=this,n=e.constructor;return un(Qa(e,new n(t),0,1),n.precision)};Ke.equals=Ke.eq=function(t){return!this.cmp(t)};Ke.exponent=function(){return Hn(this)};Ke.greaterThan=Ke.gt=function(t){return this.cmp(t)>0};Ke.greaterThanOrEqualTo=Ke.gte=function(t){return this.cmp(t)>=0};Ke.isInteger=Ke.isint=function(){return this.e>this.d.length-2};Ke.isNegative=Ke.isneg=function(){return this.s<0};Ke.isPositive=Ke.ispos=function(){return this.s>0};Ke.isZero=function(){return this.s===0};Ke.lessThan=Ke.lt=function(t){return this.cmp(t)<0};Ke.lessThanOrEqualTo=Ke.lte=function(t){return this.cmp(t)<1};Ke.logarithm=Ke.log=function(t){var e,n=this,r=n.constructor,i=r.precision,o=i+5;if(t===void 0)t=new r(10);else if(t=new r(t),t.s<1||t.eq(Ci))throw Error(ao+"NaN");if(n.s<1)throw Error(ao+(n.s?"NaN":"-Infinity"));return n.eq(Ci)?new r(0):(Mn=!1,e=Qa(Gp(n,o),Gp(t,o),o),Mn=!0,un(e,i))};Ke.minus=Ke.sub=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?qH(e,t):WH(e,(t.s=-t.s,t))};Ke.modulo=Ke.mod=function(t){var e,n=this,r=n.constructor,i=r.precision;if(t=new r(t),!t.s)throw Error(ao+"NaN");return n.s?(Mn=!1,e=Qa(n,t,0,1).times(t),Mn=!0,n.minus(e)):un(new r(n),i)};Ke.naturalExponential=Ke.exp=function(){return XH(this)};Ke.naturalLogarithm=Ke.ln=function(){return Gp(this)};Ke.negated=Ke.neg=function(){var t=new this.constructor(this);return t.s=-t.s||0,t};Ke.plus=Ke.add=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?WH(e,t):qH(e,(t.s=-t.s,t))};Ke.precision=Ke.sd=function(t){var e,n,r,i=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(xc+t);if(e=Hn(i)+1,r=i.d.length-1,n=r*_n+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return t&&e>n?e:n};Ke.squareRoot=Ke.sqrt=function(){var t,e,n,r,i,o,a,s=this,l=s.constructor;if(s.s<1){if(!s.s)return new l(0);throw Error(ao+"NaN")}for(t=Hn(s),Mn=!1,i=Math.sqrt(+s),i==0||i==1/0?(e=fa(s.d),(e.length+t)%2==0&&(e+="0"),i=Math.sqrt(e),t=Bf((t+1)/2)-(t<0||t%2),i==1/0?e="5e"+t:(e=i.toExponential(),e=e.slice(0,e.indexOf("e")+1)+t),r=new l(e)):r=new l(i.toString()),n=l.precision,i=a=n+3;;)if(o=r,r=o.plus(Qa(s,o,a+2)).times(.5),fa(o.d).slice(0,a)===(e=fa(r.d)).slice(0,a)){if(e=e.slice(a-3,a+1),i==a&&e=="4999"){if(un(o,n+1,0),o.times(o).eq(s)){r=o;break}}else if(e!="9999")break;a+=4}return Mn=!0,un(r,n)};Ke.times=Ke.mul=function(t){var e,n,r,i,o,a,s,l,c,u=this,d=u.constructor,f=u.d,p=(t=new d(t)).d;if(!u.s||!t.s)return new d(0);for(t.s*=u.s,n=u.e+t.e,l=f.length,c=p.length,l=0;){for(e=0,i=l+r;i>r;)s=o[i]+p[r]*f[i-r-1]+e,o[i--]=s%ir|0,e=s/ir|0;o[i]=(o[i]+e)%ir|0}for(;!o[--a];)o.pop();return e?++n:o.shift(),t.d=o,t.e=n,Mn?un(t,d.precision):t};Ke.toDecimalPlaces=Ke.todp=function(t,e){var n=this,r=n.constructor;return n=new r(n),t===void 0?n:(wa(t,0,Ff),e===void 0?e=r.rounding:wa(e,0,8),un(n,t+Hn(n)+1,e))};Ke.toExponential=function(t,e){var n,r=this,i=r.constructor;return t===void 0?n=kc(r,!0):(wa(t,0,Ff),e===void 0?e=i.rounding:wa(e,0,8),r=un(new i(r),t+1,e),n=kc(r,!0,t+1)),n};Ke.toFixed=function(t,e){var n,r,i=this,o=i.constructor;return t===void 0?kc(i):(wa(t,0,Ff),e===void 0?e=o.rounding:wa(e,0,8),r=un(new o(i),t+Hn(i)+1,e),n=kc(r.abs(),!1,t+Hn(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};Ke.toInteger=Ke.toint=function(){var t=this,e=t.constructor;return un(new e(t),Hn(t)+1,e.rounding)};Ke.toNumber=function(){return+this};Ke.toPower=Ke.pow=function(t){var e,n,r,i,o,a,s=this,l=s.constructor,c=12,u=+(t=new l(t));if(!t.s)return new l(Ci);if(s=new l(s),!s.s){if(t.s<1)throw Error(ao+"Infinity");return s}if(s.eq(Ci))return s;if(r=l.precision,t.eq(Ci))return un(s,r);if(e=t.e,n=t.d.length-1,a=e>=n,o=s.s,a){if((n=u<0?-u:u)<=GH){for(i=new l(Ci),e=Math.ceil(r/_n+4),Mn=!1;n%2&&(i=i.times(s),jD(i.d,e)),n=Bf(n/2),n!==0;)s=s.times(s),jD(s.d,e);return Mn=!0,t.s<0?new l(Ci).div(i):un(i,r)}}else if(o<0)throw Error(ao+"NaN");return o=o<0&&t.d[Math.max(e,n)]&1?-1:1,s.s=1,Mn=!1,i=t.times(Gp(s,r+c)),Mn=!0,i=XH(i),i.s=o,i};Ke.toPrecision=function(t,e){var n,r,i=this,o=i.constructor;return t===void 0?(n=Hn(i),r=kc(i,n<=o.toExpNeg||n>=o.toExpPos)):(wa(t,1,Ff),e===void 0?e=o.rounding:wa(e,0,8),i=un(new o(i),t,e),n=Hn(i),r=kc(i,t<=n||n<=o.toExpNeg,t)),r};Ke.toSignificantDigits=Ke.tosd=function(t,e){var n=this,r=n.constructor;return t===void 0?(t=r.precision,e=r.rounding):(wa(t,1,Ff),e===void 0?e=r.rounding:wa(e,0,8)),un(new r(n),t,e)};Ke.toString=Ke.valueOf=Ke.val=Ke.toJSON=Ke[Symbol.for("nodejs.util.inspect.custom")]=function(){var t=this,e=Hn(t),n=t.constructor;return kc(t,e<=n.toExpNeg||e>=n.toExpPos)};function WH(t,e){var n,r,i,o,a,s,l,c,u=t.constructor,d=u.precision;if(!t.s||!e.s)return e.s||(e=new u(t)),Mn?un(e,d):e;if(l=t.d,c=e.d,a=t.e,i=e.e,l=l.slice(),o=a-i,o){for(o<0?(r=l,o=-o,s=c.length):(r=c,i=a,s=l.length),a=Math.ceil(d/_n),s=a>s?a+1:s+1,o>s&&(o=s,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(s=l.length,o=c.length,s-o<0&&(o=s,r=c,c=l,l=r),n=0;o;)n=(l[--o]=l[o]+c[o]+n)/ir|0,l[o]%=ir;for(n&&(l.unshift(n),++i),s=l.length;l[--s]==0;)l.pop();return e.d=l,e.e=i,Mn?un(e,d):e}function wa(t,e,n){if(t!==~~t||tn)throw Error(xc+t)}function fa(t){var e,n,r,i=t.length-1,o="",a=t[0];if(i>0){for(o+=a,e=1;ea?1:-1;else for(s=l=0;si[s]?1:-1;break}return l}function n(r,i,o){for(var a=0;o--;)r[o]-=a,a=r[o]1;)r.shift()}return function(r,i,o,a){var s,l,c,u,d,f,p,y,v,g,m,x,b,S,w,E,T,A,M=r.constructor,C=r.s==i.s?1:-1,P=r.d,R=i.d;if(!r.s)return new M(r);if(!i.s)throw Error(ao+"Division by zero");for(l=r.e-i.e,T=R.length,w=P.length,p=new M(C),y=p.d=[],c=0;R[c]==(P[c]||0);)++c;if(R[c]>(P[c]||0)&&--l,o==null?x=o=M.precision:a?x=o+(Hn(r)-Hn(i))+1:x=o,x<0)return new M(0);if(x=x/_n+2|0,c=0,T==1)for(u=0,R=R[0],x++;(c1&&(R=t(R,u),P=t(P,u),T=R.length,w=P.length),S=T,v=P.slice(0,T),g=v.length;g=ir/2&&++E;do u=0,s=e(R,v,T,g),s<0?(m=v[0],T!=g&&(m=m*ir+(v[1]||0)),u=m/E|0,u>1?(u>=ir&&(u=ir-1),d=t(R,u),f=d.length,g=v.length,s=e(d,v,f,g),s==1&&(u--,n(d,T16)throw Error(pP+Hn(t));if(!t.s)return new u(Ci);for(Mn=!1,s=d,a=new u(.03125);t.abs().gte(.1);)t=t.times(a),c+=5;for(r=Math.log(Xl(2,c))/Math.LN10*2+5|0,s+=r,n=i=o=new u(Ci),u.precision=s;;){if(i=un(i.times(t),s),n=n.times(++l),a=o.plus(Qa(i,n,s)),fa(a.d).slice(0,s)===fa(o.d).slice(0,s)){for(;c--;)o=un(o.times(o),s);return u.precision=d,e==null?(Mn=!0,un(o,d)):o}o=a}}function Hn(t){for(var e=t.e*_n,n=t.d[0];n>=10;n/=10)e++;return e}function nS(t,e,n){if(e>t.LN10.sd())throw Mn=!0,n&&(t.precision=n),Error(ao+"LN10 precision limit exceeded");return un(new t(t.LN10),e)}function Ns(t){for(var e="";t--;)e+="0";return e}function Gp(t,e){var n,r,i,o,a,s,l,c,u,d=1,f=10,p=t,y=p.d,v=p.constructor,g=v.precision;if(p.s<1)throw Error(ao+(p.s?"NaN":"-Infinity"));if(p.eq(Ci))return new v(0);if(e==null?(Mn=!1,c=g):c=e,p.eq(10))return e==null&&(Mn=!0),nS(v,c);if(c+=f,v.precision=c,n=fa(y),r=n.charAt(0),o=Hn(p),Math.abs(o)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)p=p.times(t),n=fa(p.d),r=n.charAt(0),d++;o=Hn(p),r>1?(p=new v("0."+n),o++):p=new v(r+"."+n.slice(1))}else return l=nS(v,c+2,g).times(o+""),p=Gp(new v(r+"."+n.slice(1)),c-f).plus(l),v.precision=g,e==null?(Mn=!0,un(p,g)):p;for(s=a=p=Qa(p.minus(Ci),p.plus(Ci),c),u=un(p.times(p),c),i=3;;){if(a=un(a.times(u),c),l=s.plus(Qa(a,new v(i),c)),fa(l.d).slice(0,c)===fa(s.d).slice(0,c))return s=s.times(2),o!==0&&(s=s.plus(nS(v,c+2,g).times(o+""))),s=Qa(s,new v(d),c),v.precision=g,e==null?(Mn=!0,un(s,g)):s;s=l,i+=2}}function kD(t,e){var n,r,i;for((n=e.indexOf("."))>-1&&(e=e.replace(".","")),(r=e.search(/e/i))>0?(n<0&&(n=r),n+=+e.slice(r+1),e=e.substring(0,r)):n<0&&(n=e.length),r=0;e.charCodeAt(r)===48;)++r;for(i=e.length;e.charCodeAt(i-1)===48;)--i;if(e=e.slice(r,i),e){if(i-=r,n=n-r-1,t.e=Bf(n/_n),t.d=[],r=(n+1)%_n,n<0&&(r+=_n),ru0||t.e<-u0))throw Error(pP+n)}else t.s=0,t.e=0,t.d=[0];return t}function un(t,e,n){var r,i,o,a,s,l,c,u,d=t.d;for(a=1,o=d[0];o>=10;o/=10)a++;if(r=e-a,r<0)r+=_n,i=e,c=d[u=0];else{if(u=Math.ceil((r+1)/_n),o=d.length,u>=o)return t;for(c=o=d[u],a=1;o>=10;o/=10)a++;r%=_n,i=r-_n+a}if(n!==void 0&&(o=Xl(10,a-i-1),s=c/o%10|0,l=e<0||d[u+1]!==void 0||c%o,l=n<4?(s||l)&&(n==0||n==(t.s<0?3:2)):s>5||s==5&&(n==4||l||n==6&&(r>0?i>0?c/Xl(10,a-i):0:d[u-1])%10&1||n==(t.s<0?8:7))),e<1||!d[0])return l?(o=Hn(t),d.length=1,e=e-o-1,d[0]=Xl(10,(_n-e%_n)%_n),t.e=Bf(-e/_n)||0):(d.length=1,d[0]=t.e=t.s=0),t;if(r==0?(d.length=u,o=1,u--):(d.length=u+1,o=Xl(10,_n-r),d[u]=i>0?(c/Xl(10,a-i)%Xl(10,i)|0)*o:0),l)for(;;)if(u==0){(d[0]+=o)==ir&&(d[0]=1,++t.e);break}else{if(d[u]+=o,d[u]!=ir)break;d[u--]=0,o=1}for(r=d.length;d[--r]===0;)d.pop();if(Mn&&(t.e>u0||t.e<-u0))throw Error(pP+Hn(t));return t}function qH(t,e){var n,r,i,o,a,s,l,c,u,d,f=t.constructor,p=f.precision;if(!t.s||!e.s)return e.s?e.s=-e.s:e=new f(t),Mn?un(e,p):e;if(l=t.d,d=e.d,r=e.e,c=t.e,l=l.slice(),a=c-r,a){for(u=a<0,u?(n=l,a=-a,s=d.length):(n=d,r=c,s=l.length),i=Math.max(Math.ceil(p/_n),s)+2,a>i&&(a=i,n.length=1),n.reverse(),i=a;i--;)n.push(0);n.reverse()}else{for(i=l.length,s=d.length,u=i0;--i)l[s++]=0;for(i=d.length;i>a;){if(l[--i]0?o=o.charAt(0)+"."+o.slice(1)+Ns(r):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+Ns(-i-1)+o,n&&(r=n-a)>0&&(o+=Ns(r))):i>=a?(o+=Ns(i+1-a),n&&(r=n-i-1)>0&&(o=o+"."+Ns(r))):((r=i+1)0&&(i+1===a&&(o+="."),o+=Ns(r))),t.s<0?"-"+o:o}function jD(t,e){if(t.length>e)return t.length=e,!0}function KH(t){var e,n,r;function i(o){var a=this;if(!(a instanceof i))return new i(o);if(a.constructor=i,o instanceof i){a.s=o.s,a.e=o.e,a.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(xc+o);if(o>0)a.s=1;else if(o<0)o=-o,a.s=-1;else{a.s=0,a.e=0,a.d=[0];return}if(o===~~o&&o<1e7){a.e=0,a.d=[o];return}return kD(a,o.toString())}else if(typeof o!="string")throw Error(xc+o);if(o.charCodeAt(0)===45?(o=o.slice(1),a.s=-1):a.s=1,kTe.test(o))kD(a,o);else throw Error(xc+o)}if(i.prototype=Ke,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=KH,i.config=i.set=jTe,t===void 0&&(t={}),t)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],e=0;e=i[e+1]&&r<=i[e+2])this[n]=r;else throw Error(xc+n+": "+r);if((r=t[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(xc+n+": "+r);return this}var mP=KH(LTe);Ci=new mP(1);const sn=mP;function UTe(t){return zTe(t)||$Te(t)||BTe(t)||FTe()}function FTe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function BTe(t,e){if(t){if(typeof t=="string")return lT(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return lT(t,e)}}function $Te(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function zTe(t){if(Array.isArray(t))return lT(t)}function lT(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=e?n.apply(void 0,i):t(e-a,UD(function(){for(var s=arguments.length,l=new Array(s),c=0;ct.length)&&(e=t.length);for(var n=0,r=new Array(e);n"u"||!(Symbol.iterator in Object(t)))){var n=[],r=!0,i=!1,o=void 0;try{for(var a=t[Symbol.iterator](),s;!(r=(s=a.next()).done)&&(n.push(s.value),!(e&&n.length===e));r=!0);}catch(l){i=!0,o=l}finally{try{!r&&a.return!=null&&a.return()}finally{if(i)throw o}}return n}}function rMe(t){if(Array.isArray(t))return t}function eV(t){var e=Wp(t,2),n=e[0],r=e[1],i=n,o=r;return n>r&&(i=r,o=n),[i,o]}function tV(t,e,n){if(t.lte(0))return new sn(0);var r=Lb.getDigitCount(t.toNumber()),i=new sn(10).pow(r),o=t.div(i),a=r!==1?.05:.1,s=new sn(Math.ceil(o.div(a).toNumber())).add(n).mul(a),l=s.mul(i);return e?l:new sn(Math.ceil(l))}function iMe(t,e,n){var r=1,i=new sn(t);if(!i.isint()&&n){var o=Math.abs(t);o<1?(r=new sn(10).pow(Lb.getDigitCount(t)-1),i=new sn(Math.floor(i.div(r).toNumber())).mul(r)):o>1&&(i=new sn(Math.floor(t)))}else t===0?i=new sn(Math.floor((e-1)/2)):n||(i=new sn(Math.floor(t)));var a=Math.floor((e-1)/2),s=WTe(GTe(function(l){return i.add(new sn(l-a).mul(r)).toNumber()}),cT);return s(0,e)}function nV(t,e,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((e-t)/(n-1)))return{step:new sn(0),tickMin:new sn(0),tickMax:new sn(0)};var o=tV(new sn(e).sub(t).div(n-1),r,i),a;t<=0&&e>=0?a=new sn(0):(a=new sn(t).add(e).div(2),a=a.sub(new sn(a).mod(o)));var s=Math.ceil(a.sub(t).div(o).toNumber()),l=Math.ceil(new sn(e).sub(a).div(o).toNumber()),c=s+l+1;return c>n?nV(t,e,n,r,i+1):(c0?l+(n-c):l,s=e>0?s:s+(n-c)),{step:o,tickMin:a.sub(new sn(s).mul(o)),tickMax:a.add(new sn(l).mul(o))})}function oMe(t){var e=Wp(t,2),n=e[0],r=e[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=Math.max(i,2),s=eV([n,r]),l=Wp(s,2),c=l[0],u=l[1];if(c===-1/0||u===1/0){var d=u===1/0?[c].concat(dT(cT(0,i-1).map(function(){return 1/0}))):[].concat(dT(cT(0,i-1).map(function(){return-1/0})),[u]);return n>r?uT(d):d}if(c===u)return iMe(c,i,o);var f=nV(c,u,a,o),p=f.step,y=f.tickMin,v=f.tickMax,g=Lb.rangeStep(y,v.add(new sn(.1).mul(p)),p);return n>r?uT(g):g}function aMe(t,e){var n=Wp(t,2),r=n[0],i=n[1],o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=eV([r,i]),s=Wp(a,2),l=s[0],c=s[1];if(l===-1/0||c===1/0)return[r,i];if(l===c)return[l];var u=Math.max(e,2),d=tV(new sn(c).sub(l).div(u-1),o,0),f=[].concat(dT(Lb.rangeStep(new sn(l),new sn(c).sub(new sn(.99).mul(d)),d)),[c]);return r>i?uT(f):f}var sMe=ZH(oMe),lMe=ZH(aMe),cMe="Invariant failed";function jc(t,e){throw new Error(cMe)}var uMe=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Jd(t){"@babel/helpers - typeof";return Jd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jd(t)}function d0(){return d0=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function vMe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function yMe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function xMe(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,a=-1,s=(n=r==null?void 0:r.length)!==null&&n!==void 0?n:0;if(s<=1)return 0;if(o&&o.axisType==="angleAxis"&&Math.abs(Math.abs(o.range[1]-o.range[0])-360)<=1e-6)for(var l=o.range,c=0;c0?i[c-1].coordinate:i[s-1].coordinate,d=i[c].coordinate,f=c>=s-1?i[0].coordinate:i[c+1].coordinate,p=void 0;if(Do(d-u)!==Do(f-d)){var y=[];if(Do(f-d)===Do(l[1]-l[0])){p=f;var v=d+l[1]-l[0];y[0]=Math.min(v,(v+u)/2),y[1]=Math.max(v,(v+u)/2)}else{p=u;var g=f+l[1]-l[0];y[0]=Math.min(d,(g+d)/2),y[1]=Math.max(d,(g+d)/2)}var m=[Math.min(d,(p+d)/2),Math.max(d,(p+d)/2)];if(e>m[0]&&e<=m[1]||e>=y[0]&&e<=y[1]){a=i[c].index;break}}else{var x=Math.min(u,f),b=Math.max(u,f);if(e>(x+d)/2&&e<=(b+d)/2){a=i[c].index;break}}}else for(var S=0;S0&&S(r[S].coordinate+r[S-1].coordinate)/2&&e<=(r[S].coordinate+r[S+1].coordinate)/2||S===s-1&&e>(r[S].coordinate+r[S-1].coordinate)/2){a=r[S].index;break}return a},gP=function(e){var n,r=e,i=r.type.displayName,o=(n=e.type)!==null&&n!==void 0&&n.defaultProps?In(In({},e.type.defaultProps),e.props):e.props,a=o.stroke,s=o.fill,l;switch(i){case"Line":l=a;break;case"Area":case"Radar":l=a&&a!=="none"?a:s;break;default:l=s;break}return l},kMe=function(e){var n=e.barSize,r=e.totalSize,i=e.stackGroups,o=i===void 0?{}:i;if(!o)return{};for(var a={},s=Object.keys(o),l=0,c=s.length;l=0});if(m&&m.length){var x=m[0].type.defaultProps,b=x!==void 0?In(In({},x),m[0].props):m[0].props,S=b.barSize,w=b[g];a[w]||(a[w]=[]);var E=Ut(S)?n:S;a[w].push({item:m[0],stackList:m.slice(1),barSize:Ut(E)?void 0:Lc(E,r,0)})}}return a},jMe=function(e){var n=e.barGap,r=e.barCategoryGap,i=e.bandSize,o=e.sizeList,a=o===void 0?[]:o,s=e.maxBarSize,l=a.length;if(l<1)return null;var c=Lc(n,i,0,!0),u,d=[];if(a[0].barSize===+a[0].barSize){var f=!1,p=i/l,y=a.reduce(function(S,w){return S+w.barSize||0},0);y+=(l-1)*c,y>=i&&(y-=(l-1)*c,c=0),y>=i&&p>0&&(f=!0,p*=.9,y=l*p);var v=(i-y)/2>>0,g={offset:v-c,size:0};u=a.reduce(function(S,w){var E={item:w.item,position:{offset:g.offset+g.size+c,size:f?p:w.barSize}},T=[].concat($D(S),[E]);return g=T[T.length-1].position,w.stackList&&w.stackList.length&&w.stackList.forEach(function(A){T.push({item:A,position:g})}),T},d)}else{var m=Lc(r,i,0,!0);i-2*m-(l-1)*c<=0&&(c=0);var x=(i-2*m-(l-1)*c)/l;x>1&&(x>>=0);var b=s===+s?Math.min(x,s):x;u=a.reduce(function(S,w,E){var T=[].concat($D(S),[{item:w.item,position:{offset:m+(x+c)*E+(x-b)/2,size:b}}]);return w.stackList&&w.stackList.length&&w.stackList.forEach(function(A){T.push({item:A,position:T[T.length-1].position})}),T},d)}return u},UMe=function(e,n,r,i){var o=r.children,a=r.width,s=r.margin,l=a-(s.left||0)-(s.right||0),c=aV({children:o,legendWidth:l});if(c){var u=i||{},d=u.width,f=u.height,p=c.align,y=c.verticalAlign,v=c.layout;if((v==="vertical"||v==="horizontal"&&y==="middle")&&p!=="center"&&ze(e[p]))return In(In({},e),{},md({},p,e[p]+(d||0)));if((v==="horizontal"||v==="vertical"&&p==="center")&&y!=="middle"&&ze(e[y]))return In(In({},e),{},md({},y,e[y]+(f||0)))}return e},FMe=function(e,n,r){return Ut(n)?!0:e==="horizontal"?n==="yAxis":e==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},sV=function(e,n,r,i,o){var a=n.props.children,s=ro(a,Wm).filter(function(c){return FMe(i,o,c.props.direction)});if(s&&s.length){var l=s.map(function(c){return c.props.dataKey});return e.reduce(function(c,u){var d=Di(u,r);if(Ut(d))return c;var f=Array.isArray(d)?[Ob(d),Nb(d)]:[d,d],p=l.reduce(function(y,v){var g=Di(u,v,0),m=f[0]-Math.abs(Array.isArray(g)?g[0]:g),x=f[1]+Math.abs(Array.isArray(g)?g[1]:g);return[Math.min(m,y[0]),Math.max(x,y[1])]},[1/0,-1/0]);return[Math.min(p[0],c[0]),Math.max(p[1],c[1])]},[1/0,-1/0])}return null},BMe=function(e,n,r,i,o){var a=n.map(function(s){return sV(e,s,r,o,i)}).filter(function(s){return!Ut(s)});return a&&a.length?a.reduce(function(s,l){return[Math.min(s[0],l[0]),Math.max(s[1],l[1])]},[1/0,-1/0]):null},lV=function(e,n,r,i,o){var a=n.map(function(l){var c=l.props.dataKey;return r==="number"&&c&&sV(e,l,c,i)||Yh(e,c,r,o)});if(r==="number")return a.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]);var s={};return a.reduce(function(l,c){for(var u=0,d=c.length;u=2?Do(s[0]-s[1])*2*c:c,n&&(e.ticks||e.niceTicks)){var u=(e.ticks||e.niceTicks).map(function(d){var f=o?o.indexOf(d):d;return{coordinate:i(f)+c,value:d,offset:c}});return u.filter(function(d){return!Bm(d.coordinate)})}return e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map(function(d,f){return{coordinate:i(d)+c,value:d,index:f,offset:c}}):i.ticks&&!r?i.ticks(e.tickCount).map(function(d){return{coordinate:i(d)+c,value:d,offset:c}}):i.domain().map(function(d,f){return{coordinate:i(d)+c,value:o?o[d]:d,index:f,offset:c}})},rS=new WeakMap,gv=function(e,n){if(typeof n!="function")return e;rS.has(e)||rS.set(e,new WeakMap);var r=rS.get(e);if(r.has(n))return r.get(n);var i=function(){e.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,i),i},$Me=function(e,n,r){var i=e.scale,o=e.type,a=e.layout,s=e.axisType;if(i==="auto")return a==="radial"&&s==="radiusAxis"?{scale:Bp(),realScaleType:"band"}:a==="radial"&&s==="angleAxis"?{scale:a0(),realScaleType:"linear"}:o==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:Kh(),realScaleType:"point"}:o==="category"?{scale:Bp(),realScaleType:"band"}:{scale:a0(),realScaleType:"linear"};if(Dc(i)){var l="scale".concat(yb(i));return{scale:(LD[l]||Kh)(),realScaleType:LD[l]?l:"point"}}return jt(i)?{scale:i}:{scale:Kh(),realScaleType:"point"}},HD=1e-4,zMe=function(e){var n=e.domain();if(!(!n||n.length<=2)){var r=n.length,i=e.range(),o=Math.min(i[0],i[1])-HD,a=Math.max(i[0],i[1])+HD,s=e(n[0]),l=e(n[r-1]);(sa||la)&&e.domain([n[0],n[r-1]])}},HMe=function(e,n){if(!e)return null;for(var r=0,i=e.length;ri)&&(o[1]=i),o[0]>i&&(o[0]=i),o[1]=0?(e[s][r][0]=o,e[s][r][1]=o+l,o=e[s][r][1]):(e[s][r][0]=a,e[s][r][1]=a+l,a=e[s][r][1])}},WMe=function(e){var n=e.length;if(!(n<=0))for(var r=0,i=e[0].length;r=0?(e[a][r][0]=o,e[a][r][1]=o+s,o=e[a][r][1]):(e[a][r][0]=0,e[a][r][1]=0)}},XMe={sign:GMe,expand:sme,none:Hd,silhouette:lme,wiggle:cme,positive:WMe},qMe=function(e,n,r){var i=n.map(function(s){return s.props.dataKey}),o=XMe[r],a=ame().keys(i).value(function(s,l){return+Di(s,l,0)}).order(F1).offset(o);return a(e)},KMe=function(e,n,r,i,o,a){if(!e)return null;var s=a?n.reverse():n,l={},c=s.reduce(function(d,f){var p,y=(p=f.type)!==null&&p!==void 0&&p.defaultProps?In(In({},f.type.defaultProps),f.props):f.props,v=y.stackId,g=y.hide;if(g)return d;var m=y[r],x=d[m]||{hasStack:!1,stackGroups:{}};if(Yn(v)){var b=x.stackGroups[v]||{numericAxisId:r,cateAxisId:i,items:[]};b.items.push(f),x.hasStack=!0,x.stackGroups[v]=b}else x.stackGroups[$m("_stackId_")]={numericAxisId:r,cateAxisId:i,items:[f]};return In(In({},d),{},md({},m,x))},l),u={};return Object.keys(c).reduce(function(d,f){var p=c[f];if(p.hasStack){var y={};p.stackGroups=Object.keys(p.stackGroups).reduce(function(v,g){var m=p.stackGroups[g];return In(In({},v),{},md({},g,{numericAxisId:r,cateAxisId:i,items:m.items,stackedData:qMe(e,m.items,o)}))},y)}return In(In({},d),{},md({},f,p))},u)},YMe=function(e,n){var r=n.realScaleType,i=n.type,o=n.tickCount,a=n.originalDomain,s=n.allowDecimals,l=r||n.scale;if(l!=="auto"&&l!=="linear")return null;if(o&&i==="number"&&a&&(a[0]==="auto"||a[1]==="auto")){var c=e.domain();if(!c.length)return null;var u=sMe(c,o,s);return e.domain([Ob(u),Nb(u)]),{niceTicks:u}}if(o&&i==="number"){var d=e.domain(),f=lMe(d,o,s);return{niceTicks:f}}return null};function VD(t){var e=t.axis,n=t.ticks,r=t.bandSize,i=t.entry,o=t.index,a=t.dataKey;if(e.type==="category"){if(!e.allowDuplicatedCategory&&e.dataKey&&!Ut(i[e.dataKey])){var s=jy(n,"value",i[e.dataKey]);if(s)return s.coordinate+r/2}return n[o]?n[o].coordinate+r/2:null}var l=Di(i,Ut(a)?e.dataKey:a);return Ut(l)?null:e.scale(l)}var GD=function(e){var n=e.axis,r=e.ticks,i=e.offset,o=e.bandSize,a=e.entry,s=e.index;if(n.type==="category")return r[s]?r[s].coordinate+i:null;var l=Di(a,n.dataKey,n.domain[s]);return Ut(l)?null:n.scale(l)-o/2+i},JMe=function(e){var n=e.numericAxis,r=n.scale.domain();if(n.type==="number"){var i=Math.min(r[0],r[1]),o=Math.max(r[0],r[1]);return i<=0&&o>=0?0:o<0?o:i}return r[0]},ZMe=function(e,n){var r,i=(r=e.type)!==null&&r!==void 0&&r.defaultProps?In(In({},e.type.defaultProps),e.props):e.props,o=i.stackId;if(Yn(o)){var a=n[o];if(a){var s=a.items.indexOf(e);return s>=0?a.stackedData[s]:null}}return null},QMe=function(e){return e.reduce(function(n,r){return[Ob(r.concat([n[0]]).filter(ze)),Nb(r.concat([n[1]]).filter(ze))]},[1/0,-1/0])},uV=function(e,n,r){return Object.keys(e).reduce(function(i,o){var a=e[o],s=a.stackedData,l=s.reduce(function(c,u){var d=QMe(u.slice(n,r+1));return[Math.min(c[0],d[0]),Math.max(c[1],d[1])]},[1/0,-1/0]);return[Math.min(l[0],i[0]),Math.max(l[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},WD=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,XD=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,mT=function(e,n,r){if(jt(e))return e(n,r);if(!Array.isArray(e))return n;var i=[];if(ze(e[0]))i[0]=r?e[0]:Math.min(e[0],n[0]);else if(WD.test(e[0])){var o=+WD.exec(e[0])[1];i[0]=n[0]-o}else jt(e[0])?i[0]=e[0](n[0]):i[0]=n[0];if(ze(e[1]))i[1]=r?e[1]:Math.max(e[1],n[1]);else if(XD.test(e[1])){var a=+XD.exec(e[1])[1];i[1]=n[1]+a}else jt(e[1])?i[1]=e[1](n[1]):i[1]=n[1];return i},h0=function(e,n,r){if(e&&e.scale&&e.scale.bandwidth){var i=e.scale.bandwidth();if(!r||i>0)return i}if(e&&n&&n.length>=2){for(var o=VC(n,function(d){return d.coordinate}),a=1/0,s=1,l=o.length;sa&&(c=2*Math.PI-c),{radius:s,angle:rAe(c),angleInRadian:c}},aAe=function(e){var n=e.startAngle,r=e.endAngle,i=Math.floor(n/360),o=Math.floor(r/360),a=Math.min(i,o);return{startAngle:n-a*360,endAngle:r-a*360}},sAe=function(e,n){var r=n.startAngle,i=n.endAngle,o=Math.floor(r/360),a=Math.floor(i/360),s=Math.min(o,a);return e+s*360},JD=function(e,n){var r=e.x,i=e.y,o=oAe({x:r,y:i},n),a=o.radius,s=o.angle,l=n.innerRadius,c=n.outerRadius;if(ac)return!1;if(a===0)return!0;var u=aAe(n),d=u.startAngle,f=u.endAngle,p=s,y;if(d<=f){for(;p>f;)p-=360;for(;p=d&&p<=f}else{for(;p>d;)p-=360;for(;p=f&&p<=d}return y?YD(YD({},n),{},{radius:a,angle:sAe(p,n)}):null};function Yp(t){"@babel/helpers - typeof";return Yp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Yp(t)}var lAe=["offset"];function cAe(t){return hAe(t)||fAe(t)||dAe(t)||uAe()}function uAe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dAe(t,e){if(t){if(typeof t=="string")return gT(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return gT(t,e)}}function fAe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function hAe(t){if(Array.isArray(t))return gT(t)}function gT(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function mAe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function ZD(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 Xn(t){for(var e=1;e=0?1:-1,b,S;i==="insideStart"?(b=p+x*a,S=v):i==="insideEnd"?(b=y-x*a,S=!v):i==="end"&&(b=y+x*a,S=v),S=m<=0?S:!S;var w=vr(c,u,g,b),E=vr(c,u,g,b+(S?1:-1)*359),T="M".concat(w.x,",").concat(w.y,` + height and width.`,U,O,a,l,u,d,n);var X=!Array.isArray(p)&&Za(p.type).endsWith("Chart");return Q.Children.map(p,function(L){return Q.isValidElement(L)?_.cloneElement(L,dv({width:U,height:O},X?{style:dv({height:"100%",width:"100%",maxHeight:O,maxWidth:U},L.props.style)}:{})):L})},[n,p,l,f,d,u,M,a]);return Q.createElement("div",{id:g?"".concat(g):void 0,className:zt("recharts-responsive-container",m),style:dv(dv({},S),{},{width:a,height:l,minWidth:u,minHeight:d,maxHeight:f}),ref:w},R)}),lH=function(e){return null};lH.displayName="Cell";function Up(t){"@babel/helpers - typeof";return Up=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Up(t)}function $I(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 Q1(t){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||jf.isSsr)return{width:0,height:0};var r=lSe(n),i=JSON.stringify({text:e,copyStyle:r});if(Su.widthCache[i])return Su.widthCache[i];try{var o=document.getElementById(zI);o||(o=document.createElement("span"),o.setAttribute("id",zI),o.setAttribute("aria-hidden","true"),document.body.appendChild(o));var a=Q1(Q1({},sSe),r);Object.assign(o.style,a),o.textContent="".concat(e);var s=o.getBoundingClientRect(),l={width:s.width,height:s.height};return Su.widthCache[i]=l,++Su.cacheCount>aSe&&(Su.cacheCount=0,Su.widthCache={}),l}catch{return{width:0,height:0}}},cSe=function(e){return{top:e.top+window.scrollY-document.documentElement.clientTop,left:e.left+window.scrollX-document.documentElement.clientLeft}};function Fp(t){"@babel/helpers - typeof";return Fp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fp(t)}function Zy(t,e){return hSe(t)||fSe(t,e)||dSe(t,e)||uSe()}function uSe(){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 dSe(t,e){if(t){if(typeof t=="string")return HI(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return HI(t,e)}}function HI(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function ASe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function KI(t,e){return NSe(t)||RSe(t,e)||PSe(t,e)||CSe()}function CSe(){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 PSe(t,e){if(t){if(typeof t=="string")return YI(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return YI(t,e)}}function YI(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&arguments[0]!==void 0?arguments[0]:[];return U.reduce(function(O,X){var L=X.word,j=X.width,K=O[O.length-1];if(K&&(i==null||o||K.width+j+rX.width?O:X})};if(!u)return p;for(var v="โ€ฆ",g=function(U){var O=d.slice(0,U),X=fH({breakAll:c,style:l,children:O+v}).wordsWithComputedWidth,L=f(X),j=L.length>a||y(L).width>Number(i);return[j,L]},m=0,x=d.length-1,b=0,S;m<=x&&b<=d.length-1;){var w=Math.floor((m+x)/2),E=w-1,T=g(E),A=KI(T,2),M=A[0],C=A[1],P=g(w),R=KI(P,1),D=R[0];if(!M&&!D&&(m=w+1),M&&D&&(x=w-1),!M&&D){S=C;break}b++}return S||p},JI=function(e){var n=Ut(e)?[]:e.toString().split(dH);return[{words:n}]},ISe=function(e){var n=e.width,r=e.scaleToFit,i=e.children,o=e.style,a=e.breakAll,s=e.maxLines;if((n||r)&&!jf.isSsr){var l,c,u=fH({breakAll:a,children:i,style:o});if(u){var d=u.wordsWithComputedWidth,f=u.spaceWidth;l=d,c=f}else return JI(i);return OSe({breakAll:a,children:i,maxLines:s,style:o},l,c,n,r)}return JI(i)},ZI="#808080",Qy=function(e){var n=e.x,r=n===void 0?0:n,i=e.y,o=i===void 0?0:i,a=e.lineHeight,s=a===void 0?"1em":a,l=e.capHeight,c=l===void 0?"0.71em":l,u=e.scaleToFit,d=u===void 0?!1:u,f=e.textAnchor,p=f===void 0?"start":f,y=e.verticalAnchor,v=y===void 0?"end":y,g=e.fill,m=g===void 0?ZI:g,x=qI(e,TSe),b=_.useMemo(function(){return ISe({breakAll:x.breakAll,children:x.children,maxLines:x.maxLines,scaleToFit:d,style:x.style,width:x.width})},[x.breakAll,x.children,x.maxLines,d,x.style,x.width]),S=x.dx,w=x.dy,E=x.angle,T=x.className,A=x.breakAll,M=qI(x,MSe);if(!Yn(r)||!Yn(o))return null;var C=r+(ze(S)?S:0),P=o+(ze(w)?w:0),R;switch(v){case"start":R=qw("calc(".concat(c,")"));break;case"middle":R=qw("calc(".concat((b.length-1)/2," * -").concat(s," + (").concat(c," / 2))"));break;default:R=qw("calc(".concat(b.length-1," * -").concat(s,")"));break}var D=[];if(d){var k=b[0].width,U=x.width;D.push("scale(".concat((ze(U)?U/k:1)/k,")"))}return E&&D.push("rotate(".concat(E,", ").concat(C,", ").concat(P,")")),D.length&&(M.transform=D.join(" ")),Q.createElement("text",eT({},$t(M,!0),{x:C,y:P,className:zt("recharts-text",T),textAnchor:p,fill:m.includes("url")?ZI:m}),b.map(function(O,X){var L=O.words.join(A?"":" ");return Q.createElement("tspan",{x:C,dy:X===0?R:s,key:"".concat(L,"-").concat(X)},L)}))};function rl(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function DSe(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function XC(t){let e,n,r;t.length!==2?(e=rl,n=(s,l)=>rl(t(s),l),r=(s,l)=>t(s)-l):(e=t===rl||t===DSe?t:LSe,n=t,r=t);function i(s,l,c=0,u=s.length){if(c>>1;n(s[d],l)<0?c=d+1:u=d}while(c>>1;n(s[d],l)<=0?c=d+1:u=d}while(cc&&r(s[d-1],l)>-r(s[d],l)?d-1:d}return{left:i,center:a,right:o}}function LSe(){return 0}function hH(t){return t===null?NaN:+t}function*kSe(t,e){for(let n of t)n!=null&&(n=+n)>=n&&(yield n)}const jSe=XC(rl),zm=jSe.right;XC(hH).center;class QI extends Map{constructor(e,n=BSe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const[r,i]of e)this.set(r,i)}get(e){return super.get(eD(this,e))}has(e){return super.has(eD(this,e))}set(e,n){return super.set(USe(this,e),n)}delete(e){return super.delete(FSe(this,e))}}function eD({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function USe({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function FSe({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function BSe(t){return t!==null&&typeof t=="object"?t.valueOf():t}function $Se(t=rl){if(t===rl)return pH;if(typeof t!="function")throw new TypeError("compare is not a function");return(e,n)=>{const r=t(e,n);return r||r===0?r:(t(n,n)===0)-(t(e,e)===0)}}function pH(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(te?1:0)}const zSe=Math.sqrt(50),HSe=Math.sqrt(10),VSe=Math.sqrt(2);function e0(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=zSe?10:o>=HSe?5:o>=VSe?2:1;let s,l,c;return i<0?(c=Math.pow(10,-i)/a,s=Math.round(t*c),l=Math.round(e*c),s/ce&&--l,c=-c):(c=Math.pow(10,i)*a,s=Math.round(t/c),l=Math.round(e/c),s*ce&&--l),l0))return[];if(t===e)return[t];const r=e=i))return[];const s=o-i+1,l=new Array(s);if(r)if(a<0)for(let c=0;c=r)&&(n=r);return n}function nD(t,e){let n;for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function mH(t,e,n=0,r=1/0,i){if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(t.length-1,r)),!(n<=e&&e<=r))return t;for(i=i===void 0?pH:$Se(i);r>n;){if(r-n>600){const l=r-n+1,c=e-n+1,u=Math.log(l),d=.5*Math.exp(2*u/3),f=.5*Math.sqrt(u*d*(l-d)/l)*(c-l/2<0?-1:1),p=Math.max(n,Math.floor(e-c*d/l+f)),y=Math.min(r,Math.floor(e+(l-c)*d/l+f));mH(t,e,p,y,i)}const o=t[e];let a=n,s=r;for(ph(t,n,e),i(t[r],o)>0&&ph(t,n,r);a0;)--s}i(t[n],o)===0?ph(t,n,s):(++s,ph(t,s,r)),s<=e&&(n=s+1),e<=s&&(r=s-1)}return t}function ph(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function GSe(t,e,n){if(t=Float64Array.from(kSe(t)),!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return nD(t);if(e>=1)return tD(t);var r,i=(r-1)*e,o=Math.floor(i),a=tD(mH(t,o).subarray(0,o+1)),s=nD(t.subarray(o+1));return a+(s-a)*(i-o)}}function WSe(t,e,n=hH){if(!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,o=Math.floor(i),a=+n(t[o],o,t),s=+n(t[o+1],o+1,t);return a+(s-a)*(i-o)}}function XSe(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((e-t)/n))|0,o=new Array(i);++r>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?hv(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?hv(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=KSe.exec(t))?new ai(e[1],e[2],e[3],1):(e=YSe.exec(t))?new ai(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=JSe.exec(t))?hv(e[1],e[2],e[3],e[4]):(e=ZSe.exec(t))?hv(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=QSe.exec(t))?cD(e[1],e[2]/100,e[3]/100,1):(e=eEe.exec(t))?cD(e[1],e[2]/100,e[3]/100,e[4]):rD.hasOwnProperty(t)?aD(rD[t]):t==="transparent"?new ai(NaN,NaN,NaN,0):null}function aD(t){return new ai(t>>16&255,t>>8&255,t&255,1)}function hv(t,e,n,r){return r<=0&&(t=e=n=NaN),new ai(t,e,n,r)}function rEe(t){return t instanceof Hm||(t=Hp(t)),t?(t=t.rgb(),new ai(t.r,t.g,t.b,t.opacity)):new ai}function oT(t,e,n,r){return arguments.length===1?rEe(t):new ai(t,e,n,r??1)}function ai(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}KC(ai,oT,vH(Hm,{brighter(t){return t=t==null?t0:Math.pow(t0,t),new ai(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?$p:Math.pow($p,t),new ai(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new ai(yc(this.r),yc(this.g),yc(this.b),n0(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:sD,formatHex:sD,formatHex8:iEe,formatRgb:lD,toString:lD}));function sD(){return`#${nc(this.r)}${nc(this.g)}${nc(this.b)}`}function iEe(){return`#${nc(this.r)}${nc(this.g)}${nc(this.b)}${nc((isNaN(this.opacity)?1:this.opacity)*255)}`}function lD(){const t=n0(this.opacity);return`${t===1?"rgb(":"rgba("}${yc(this.r)}, ${yc(this.g)}, ${yc(this.b)}${t===1?")":`, ${t})`}`}function n0(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function yc(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function nc(t){return t=yc(t),(t<16?"0":"")+t.toString(16)}function cD(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Oo(t,e,n,r)}function yH(t){if(t instanceof Oo)return new Oo(t.h,t.s,t.l,t.opacity);if(t instanceof Hm||(t=Hp(t)),!t)return new Oo;if(t instanceof Oo)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(e===o?a=(n-r)/s+(n0&&l<1?0:a,new Oo(a,s,l,t.opacity)}function oEe(t,e,n,r){return arguments.length===1?yH(t):new Oo(t,e,n,r??1)}function Oo(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}KC(Oo,oEe,vH(Hm,{brighter(t){return t=t==null?t0:Math.pow(t0,t),new Oo(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?$p:Math.pow($p,t),new Oo(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 ai(Kw(t>=240?t-240:t+120,i,r),Kw(t,i,r),Kw(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new Oo(uD(this.h),pv(this.s),pv(this.l),n0(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=n0(this.opacity);return`${t===1?"hsl(":"hsla("}${uD(this.h)}, ${pv(this.s)*100}%, ${pv(this.l)*100}%${t===1?")":`, ${t})`}`}}));function uD(t){return t=(t||0)%360,t<0?t+360:t}function pv(t){return Math.max(0,Math.min(1,t||0))}function Kw(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 YC=t=>()=>t;function aEe(t,e){return function(n){return t+n*e}}function sEe(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 lEe(t){return(t=+t)==1?xH:function(e,n){return n-e?sEe(e,n,t):YC(isNaN(e)?n:e)}}function xH(t,e){var n=e-t;return n?aEe(t,n):YC(isNaN(t)?e:t)}const dD=function t(e){var n=lEe(e);function r(i,o){var a=n((i=oT(i)).r,(o=oT(o)).r),s=n(i.g,o.g),l=n(i.b,o.b),c=xH(i.opacity,o.opacity);return function(u){return i.r=a(u),i.g=s(u),i.b=l(u),i.opacity=c(u),i+""}}return r.gamma=t,r}(1);function cEe(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),i;return function(o){for(i=0;in&&(o=e.slice(n,o),s[a]?s[a]+=o:s[++a]=o),(r=r[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,l.push({i:a,x:r0(r,i)})),n=Yw.lastIndex;return ne&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function bEe(t,e,n){var r=t[0],i=t[1],o=e[0],a=e[1];return i2?_Ee:bEe,l=c=null,d}function d(f){return f==null||isNaN(f=+f)?o:(l||(l=s(t.map(r),e,n)))(r(a(f)))}return d.invert=function(f){return a(i((c||(c=s(e,t.map(r),r0)))(f)))},d.domain=function(f){return arguments.length?(t=Array.from(f,i0),u()):t.slice()},d.range=function(f){return arguments.length?(e=Array.from(f),u()):e.slice()},d.rangeRound=function(f){return e=Array.from(f),n=JC,u()},d.clamp=function(f){return arguments.length?(a=f?!0:Hr,u()):a!==Hr},d.interpolate=function(f){return arguments.length?(n=f,u()):n},d.unknown=function(f){return arguments.length?(o=f,d):o},function(f,p){return r=f,i=p,u()}}function ZC(){return Tb()(Hr,Hr)}function wEe(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function o0(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 qd(t){return t=o0(Math.abs(t)),t?t[1]:NaN}function SEe(t,e){return function(n,r){for(var i=n.length,o=[],a=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),o.push(n.substring(i-=s,i+s)),!((l+=s+1)>r));)s=t[a=(a+1)%t.length];return o.reverse().join(e)}}function EEe(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var TEe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Vp(t){if(!(e=TEe.exec(t)))throw new Error("invalid format: "+t);var e;return new QC({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]})}Vp.prototype=QC.prototype;function QC(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+""}QC.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 MEe(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 bH;function AEe(t,e){var n=o0(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(bH=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+o0(t,Math.max(0,e+o-1))[0]}function hD(t,e){var n=o0(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 pD={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:wEe,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)=>hD(t*100,e),r:hD,s:AEe,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function mD(t){return t}var gD=Array.prototype.map,vD=["y","z","a","f","p","n","ยต","m","","k","M","G","T","P","E","Z","Y"];function CEe(t){var e=t.grouping===void 0||t.thousands===void 0?mD:SEe(gD.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+"",o=t.numerals===void 0?mD:EEe(gD.call(t.numerals,String)),a=t.percent===void 0?"%":t.percent+"",s=t.minus===void 0?"โˆ’":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function c(d){d=Vp(d);var f=d.fill,p=d.align,y=d.sign,v=d.symbol,g=d.zero,m=d.width,x=d.comma,b=d.precision,S=d.trim,w=d.type;w==="n"?(x=!0,w="g"):pD[w]||(b===void 0&&(b=12),S=!0,w="g"),(g||f==="0"&&p==="=")&&(g=!0,f="0",p="=");var E=v==="$"?n:v==="#"&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",T=v==="$"?r:/[%p]/.test(w)?a:"",A=pD[w],M=/[defgprs%]/.test(w);b=b===void 0?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b));function C(P){var R=E,D=T,k,U,O;if(w==="c")D=A(P)+D,P="";else{P=+P;var X=P<0||1/P<0;if(P=isNaN(P)?l:A(Math.abs(P),b),S&&(P=MEe(P)),X&&+P==0&&y!=="+"&&(X=!1),R=(X?y==="("?y:s:y==="-"||y==="("?"":y)+R,D=(w==="s"?vD[8+bH/3]:"")+D+(X&&y==="("?")":""),M){for(k=-1,U=P.length;++kO||O>57){D=(O===46?i+P.slice(k+1):P.slice(k))+D,P=P.slice(0,k);break}}}x&&!g&&(P=e(P,1/0));var L=R.length+P.length+D.length,j=L>1)+R+P+D+j.slice(L);break;default:P=j+R+P+D;break}return o(P)}return C.toString=function(){return d+""},C}function u(d,f){var p=c((d=Vp(d),d.type="f",d)),y=Math.max(-8,Math.min(8,Math.floor(qd(f)/3)))*3,v=Math.pow(10,-y),g=vD[8+y/3];return function(m){return p(v*m)+g}}return{format:c,formatPrefix:u}}var mv,eP,_H;PEe({thousands:",",grouping:[3],currency:["$",""]});function PEe(t){return mv=CEe(t),eP=mv.format,_H=mv.formatPrefix,mv}function REe(t){return Math.max(0,-qd(Math.abs(t)))}function NEe(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(qd(e)/3)))*3-qd(Math.abs(t)))}function OEe(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,qd(e)-qd(t))+1}function wH(t,e,n,r){var i=rT(t,e,n),o;switch(r=Vp(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(o=NEe(i,a))&&(r.precision=o),_H(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=OEe(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=REe(i))&&(r.precision=o-(r.type==="%")*2);break}}return eP(r)}function Pl(t){var e=t.domain;return t.ticks=function(n){var r=e();return tT(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return wH(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,o=r.length-1,a=r[i],s=r[o],l,c,u=10;for(s0;){if(c=nT(a,s,n),c===l)return r[i]=a,r[o]=s,e(r);if(c>0)a=Math.floor(a/c)*c,s=Math.ceil(s/c)*c;else if(c<0)a=Math.ceil(a*c)/c,s=Math.floor(s*c)/c;else break;l=c}return t},t}function a0(){var t=ZC();return t.copy=function(){return Vm(t,a0())},lo.apply(t,arguments),Pl(t)}function SH(t){var e;function n(r){return r==null||isNaN(r=+r)?e:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(t=Array.from(r,i0),n):t.slice()},n.unknown=function(r){return arguments.length?(e=r,n):e},n.copy=function(){return SH(t).unknown(e)},t=arguments.length?Array.from(t,i0):[0,1],Pl(n)}function EH(t,e){t=t.slice();var n=0,r=t.length-1,i=t[n],o=t[r],a;return oMath.pow(t,e)}function jEe(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function bD(t){return(e,n)=>-t(-e,n)}function tP(t){const e=t(yD,xD),n=e.domain;let r=10,i,o;function a(){return i=jEe(r),o=kEe(r),n()[0]<0?(i=bD(i),o=bD(o),t(IEe,DEe)):t(yD,xD),e}return e.base=function(s){return arguments.length?(r=+s,a()):r},e.domain=function(s){return arguments.length?(n(s),a()):n()},e.ticks=s=>{const l=n();let c=l[0],u=l[l.length-1];const d=u0){for(;f<=p;++f)for(y=1;yu)break;m.push(v)}}else for(;f<=p;++f)for(y=r-1;y>=1;--y)if(v=f>0?y/o(-f):y*o(f),!(vu)break;m.push(v)}m.length*2{if(s==null&&(s=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=Vp(l)).precision==null&&(l.trim=!0),l=eP(l)),s===1/0)return l;const c=Math.max(1,r*s/e.ticks().length);return u=>{let d=u/o(Math.round(i(u)));return d*rn(EH(n(),{floor:s=>o(Math.floor(i(s))),ceil:s=>o(Math.ceil(i(s)))})),e}function TH(){const t=tP(Tb()).domain([1,10]);return t.copy=()=>Vm(t,TH()).base(t.base()),lo.apply(t,arguments),t}function _D(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function wD(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function nP(t){var e=1,n=t(_D(e),wD(e));return n.constant=function(r){return arguments.length?t(_D(e=+r),wD(e)):e},Pl(n)}function MH(){var t=nP(Tb());return t.copy=function(){return Vm(t,MH()).constant(t.constant())},lo.apply(t,arguments)}function SD(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function UEe(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function FEe(t){return t<0?-t*t:t*t}function rP(t){var e=t(Hr,Hr),n=1;function r(){return n===1?t(Hr,Hr):n===.5?t(UEe,FEe):t(SD(n),SD(1/n))}return e.exponent=function(i){return arguments.length?(n=+i,r()):n},Pl(e)}function iP(){var t=rP(Tb());return t.copy=function(){return Vm(t,iP()).exponent(t.exponent())},lo.apply(t,arguments),t}function BEe(){return iP.apply(null,arguments).exponent(.5)}function ED(t){return Math.sign(t)*t*t}function $Ee(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}function AH(){var t=ZC(),e=[0,1],n=!1,r;function i(o){var a=$Ee(t(o));return isNaN(a)?r:n?Math.round(a):a}return i.invert=function(o){return t.invert(ED(o))},i.domain=function(o){return arguments.length?(t.domain(o),i):t.domain()},i.range=function(o){return arguments.length?(t.range((e=Array.from(o,i0)).map(ED)),i):e.slice()},i.rangeRound=function(o){return i.range(o).round(!0)},i.round=function(o){return arguments.length?(n=!!o,i):n},i.clamp=function(o){return arguments.length?(t.clamp(o),i):t.clamp()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return AH(t.domain(),e).round(n).clamp(t.clamp()).unknown(r)},lo.apply(i,arguments),Pl(i)}function CH(){var t=[],e=[],n=[],r;function i(){var a=0,s=Math.max(1,e.length);for(n=new Array(s-1);++a0?n[s-1]:t[0],s=n?[r[n-1],e]:[r[c-1],r[c]]},a.unknown=function(l){return arguments.length&&(o=l),a},a.thresholds=function(){return r.slice()},a.copy=function(){return PH().domain([t,e]).range(i).unknown(o)},lo.apply(Pl(a),arguments)}function RH(){var t=[.5],e=[0,1],n,r=1;function i(o){return o!=null&&o<=o?e[zm(t,o,0,r)]:n}return i.domain=function(o){return arguments.length?(t=Array.from(o),r=Math.min(t.length,e.length-1),i):t.slice()},i.range=function(o){return arguments.length?(e=Array.from(o),r=Math.min(t.length,e.length-1),i):e.slice()},i.invertExtent=function(o){var a=e.indexOf(o);return[t[a-1],t[a]]},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return RH().domain(t).range(e).unknown(n)},lo.apply(i,arguments)}const Jw=new Date,Zw=new Date;function tr(t,e,n,r){function i(o){return t(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(t(o=new Date(+o)),o),i.ceil=o=>(t(o=new Date(o-1)),e(o,1),t(o),o),i.round=o=>{const a=i(o),s=i.ceil(o);return o-a(e(o=new Date(+o),a==null?1:Math.floor(a)),o),i.range=(o,a,s)=>{const l=[];if(o=i.ceil(o),s=s==null?1:Math.floor(s),!(o0))return l;let c;do l.push(c=new Date(+o)),e(o,s),t(o);while(ctr(a=>{if(a>=a)for(;t(a),!o(a);)a.setTime(a-1)},(a,s)=>{if(a>=a)if(s<0)for(;++s<=0;)for(;e(a,-1),!o(a););else for(;--s>=0;)for(;e(a,1),!o(a););}),n&&(i.count=(o,a)=>(Jw.setTime(+o),Zw.setTime(+a),t(Jw),t(Zw),Math.floor(n(Jw,Zw))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?a=>r(a)%o===0:a=>i.count(0,a)%o===0):i)),i}const s0=tr(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);s0.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?tr(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):s0);s0.range;const qa=1e3,Qi=qa*60,Ka=Qi*60,ss=Ka*24,oP=ss*7,TD=ss*30,Qw=ss*365,rc=tr(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*qa)},(t,e)=>(e-t)/qa,t=>t.getUTCSeconds());rc.range;const aP=tr(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*qa)},(t,e)=>{t.setTime(+t+e*Qi)},(t,e)=>(e-t)/Qi,t=>t.getMinutes());aP.range;const sP=tr(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*Qi)},(t,e)=>(e-t)/Qi,t=>t.getUTCMinutes());sP.range;const lP=tr(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*qa-t.getMinutes()*Qi)},(t,e)=>{t.setTime(+t+e*Ka)},(t,e)=>(e-t)/Ka,t=>t.getHours());lP.range;const cP=tr(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*Ka)},(t,e)=>(e-t)/Ka,t=>t.getUTCHours());cP.range;const Gm=tr(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Qi)/ss,t=>t.getDate()-1);Gm.range;const Mb=tr(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/ss,t=>t.getUTCDate()-1);Mb.range;const NH=tr(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/ss,t=>Math.floor(t/ss));NH.range;function Kc(t){return tr(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*Qi)/oP)}const Ab=Kc(0),l0=Kc(1),zEe=Kc(2),HEe=Kc(3),Kd=Kc(4),VEe=Kc(5),GEe=Kc(6);Ab.range;l0.range;zEe.range;HEe.range;Kd.range;VEe.range;GEe.range;function Yc(t){return tr(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/oP)}const Cb=Yc(0),c0=Yc(1),WEe=Yc(2),XEe=Yc(3),Yd=Yc(4),qEe=Yc(5),KEe=Yc(6);Cb.range;c0.range;WEe.range;XEe.range;Yd.range;qEe.range;KEe.range;const uP=tr(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());uP.range;const dP=tr(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());dP.range;const ls=tr(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());ls.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:tr(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});ls.range;const cs=tr(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());cs.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:tr(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});cs.range;function OH(t,e,n,r,i,o){const a=[[rc,1,qa],[rc,5,5*qa],[rc,15,15*qa],[rc,30,30*qa],[o,1,Qi],[o,5,5*Qi],[o,15,15*Qi],[o,30,30*Qi],[i,1,Ka],[i,3,3*Ka],[i,6,6*Ka],[i,12,12*Ka],[r,1,ss],[r,2,2*ss],[n,1,oP],[e,1,TD],[e,3,3*TD],[t,1,Qw]];function s(c,u,d){const f=ug).right(a,f);if(p===a.length)return t.every(rT(c/Qw,u/Qw,d));if(p===0)return s0.every(Math.max(rT(c,u,d),1));const[y,v]=a[f/a[p-1][2]53)return null;"w"in le||(le.w=1),"Z"in le?(W=tS(mh(le.y,0,1)),Ve=W.getUTCDay(),W=Ve>4||Ve===0?c0.ceil(W):c0(W),W=Mb.offset(W,(le.V-1)*7),le.y=W.getUTCFullYear(),le.m=W.getUTCMonth(),le.d=W.getUTCDate()+(le.w+6)%7):(W=eS(mh(le.y,0,1)),Ve=W.getDay(),W=Ve>4||Ve===0?l0.ceil(W):l0(W),W=Gm.offset(W,(le.V-1)*7),le.y=W.getFullYear(),le.m=W.getMonth(),le.d=W.getDate()+(le.w+6)%7)}else("W"in le||"U"in le)&&("w"in le||(le.w="u"in le?le.u%7:"W"in le?1:0),Ve="Z"in le?tS(mh(le.y,0,1)).getUTCDay():eS(mh(le.y,0,1)).getDay(),le.m=0,le.d="W"in le?(le.w+6)%7+le.W*7-(Ve+5)%7:le.w+le.U*7-(Ve+6)%7);return"Z"in le?(le.H+=le.Z/100|0,le.M+=le.Z%100,tS(le)):eS(le)}}function A(ae,fe,we,le){for(var ie=0,W=fe.length,Ve=we.length,Ne,st;ie=Ve)return-1;if(Ne=fe.charCodeAt(ie++),Ne===37){if(Ne=fe.charAt(ie++),st=w[Ne in MD?fe.charAt(ie++):Ne],!st||(le=st(ae,we,le))<0)return-1}else if(Ne!=we.charCodeAt(le++))return-1}return le}function M(ae,fe,we){var le=c.exec(fe.slice(we));return le?(ae.p=u.get(le[0].toLowerCase()),we+le[0].length):-1}function C(ae,fe,we){var le=p.exec(fe.slice(we));return le?(ae.w=y.get(le[0].toLowerCase()),we+le[0].length):-1}function P(ae,fe,we){var le=d.exec(fe.slice(we));return le?(ae.w=f.get(le[0].toLowerCase()),we+le[0].length):-1}function R(ae,fe,we){var le=m.exec(fe.slice(we));return le?(ae.m=x.get(le[0].toLowerCase()),we+le[0].length):-1}function D(ae,fe,we){var le=v.exec(fe.slice(we));return le?(ae.m=g.get(le[0].toLowerCase()),we+le[0].length):-1}function k(ae,fe,we){return A(ae,e,fe,we)}function U(ae,fe,we){return A(ae,n,fe,we)}function O(ae,fe,we){return A(ae,r,fe,we)}function X(ae){return a[ae.getDay()]}function L(ae){return o[ae.getDay()]}function j(ae){return l[ae.getMonth()]}function K(ae){return s[ae.getMonth()]}function te(ae){return i[+(ae.getHours()>=12)]}function H(ae){return 1+~~(ae.getMonth()/3)}function q(ae){return a[ae.getUTCDay()]}function $(ae){return o[ae.getUTCDay()]}function Y(ae){return l[ae.getUTCMonth()]}function ee(ae){return s[ae.getUTCMonth()]}function J(ae){return i[+(ae.getUTCHours()>=12)]}function ce(ae){return 1+~~(ae.getUTCMonth()/3)}return{format:function(ae){var fe=E(ae+="",b);return fe.toString=function(){return ae},fe},parse:function(ae){var fe=T(ae+="",!1);return fe.toString=function(){return ae},fe},utcFormat:function(ae){var fe=E(ae+="",S);return fe.toString=function(){return ae},fe},utcParse:function(ae){var fe=T(ae+="",!0);return fe.toString=function(){return ae},fe}}}var MD={"-":"",_:" ",0:"0"},dr=/^\s*\d+/,t1e=/^%/,n1e=/[\\^$*+?|[\]().{}]/g;function qt(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o[e.toLowerCase(),n]))}function i1e(t,e,n){var r=dr.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function o1e(t,e,n){var r=dr.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function a1e(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function s1e(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function l1e(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function AD(t,e,n){var r=dr.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function CD(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function c1e(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function u1e(t,e,n){var r=dr.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function d1e(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function PD(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function f1e(t,e,n){var r=dr.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function RD(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function h1e(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function p1e(t,e,n){var r=dr.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function m1e(t,e,n){var r=dr.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function g1e(t,e,n){var r=dr.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function v1e(t,e,n){var r=t1e.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function y1e(t,e,n){var r=dr.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function x1e(t,e,n){var r=dr.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function ND(t,e){return qt(t.getDate(),e,2)}function b1e(t,e){return qt(t.getHours(),e,2)}function _1e(t,e){return qt(t.getHours()%12||12,e,2)}function w1e(t,e){return qt(1+Gm.count(ls(t),t),e,3)}function IH(t,e){return qt(t.getMilliseconds(),e,3)}function S1e(t,e){return IH(t,e)+"000"}function E1e(t,e){return qt(t.getMonth()+1,e,2)}function T1e(t,e){return qt(t.getMinutes(),e,2)}function M1e(t,e){return qt(t.getSeconds(),e,2)}function A1e(t){var e=t.getDay();return e===0?7:e}function C1e(t,e){return qt(Ab.count(ls(t)-1,t),e,2)}function DH(t){var e=t.getDay();return e>=4||e===0?Kd(t):Kd.ceil(t)}function P1e(t,e){return t=DH(t),qt(Kd.count(ls(t),t)+(ls(t).getDay()===4),e,2)}function R1e(t){return t.getDay()}function N1e(t,e){return qt(l0.count(ls(t)-1,t),e,2)}function O1e(t,e){return qt(t.getFullYear()%100,e,2)}function I1e(t,e){return t=DH(t),qt(t.getFullYear()%100,e,2)}function D1e(t,e){return qt(t.getFullYear()%1e4,e,4)}function L1e(t,e){var n=t.getDay();return t=n>=4||n===0?Kd(t):Kd.ceil(t),qt(t.getFullYear()%1e4,e,4)}function k1e(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+qt(e/60|0,"0",2)+qt(e%60,"0",2)}function OD(t,e){return qt(t.getUTCDate(),e,2)}function j1e(t,e){return qt(t.getUTCHours(),e,2)}function U1e(t,e){return qt(t.getUTCHours()%12||12,e,2)}function F1e(t,e){return qt(1+Mb.count(cs(t),t),e,3)}function LH(t,e){return qt(t.getUTCMilliseconds(),e,3)}function B1e(t,e){return LH(t,e)+"000"}function $1e(t,e){return qt(t.getUTCMonth()+1,e,2)}function z1e(t,e){return qt(t.getUTCMinutes(),e,2)}function H1e(t,e){return qt(t.getUTCSeconds(),e,2)}function V1e(t){var e=t.getUTCDay();return e===0?7:e}function G1e(t,e){return qt(Cb.count(cs(t)-1,t),e,2)}function kH(t){var e=t.getUTCDay();return e>=4||e===0?Yd(t):Yd.ceil(t)}function W1e(t,e){return t=kH(t),qt(Yd.count(cs(t),t)+(cs(t).getUTCDay()===4),e,2)}function X1e(t){return t.getUTCDay()}function q1e(t,e){return qt(c0.count(cs(t)-1,t),e,2)}function K1e(t,e){return qt(t.getUTCFullYear()%100,e,2)}function Y1e(t,e){return t=kH(t),qt(t.getUTCFullYear()%100,e,2)}function J1e(t,e){return qt(t.getUTCFullYear()%1e4,e,4)}function Z1e(t,e){var n=t.getUTCDay();return t=n>=4||n===0?Yd(t):Yd.ceil(t),qt(t.getUTCFullYear()%1e4,e,4)}function Q1e(){return"+0000"}function ID(){return"%"}function DD(t){return+t}function LD(t){return Math.floor(+t/1e3)}var Eu,jH,UH;eTe({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function eTe(t){return Eu=e1e(t),jH=Eu.format,Eu.parse,UH=Eu.utcFormat,Eu.utcParse,Eu}function tTe(t){return new Date(t)}function nTe(t){return t instanceof Date?+t:+new Date(+t)}function fP(t,e,n,r,i,o,a,s,l,c){var u=ZC(),d=u.invert,f=u.domain,p=c(".%L"),y=c(":%S"),v=c("%I:%M"),g=c("%I %p"),m=c("%a %d"),x=c("%b %d"),b=c("%B"),S=c("%Y");function w(E){return(l(E)e(i/(t.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,o)=>GSe(t,o/r))},n.copy=function(){return zH(e).domain(t)},ms.apply(n,arguments)}function Rb(){var t=0,e=.5,n=1,r=1,i,o,a,s,l,c=Hr,u,d=!1,f;function p(v){return isNaN(v=+v)?f:(v=.5+((v=+u(v))-o)*(r*ve}var uTe=cTe,dTe=WH,fTe=uTe,hTe=Lf;function pTe(t){return t&&t.length?dTe(t,hTe,fTe):void 0}var mTe=pTe;const Nb=dn(mTe);function gTe(t,e){return tt.e^o.s<0?1:-1;for(r=o.d.length,i=t.d.length,e=0,n=rt.d[e]^o.s<0?1:-1;return r===i?0:r>i^o.s<0?1:-1};Ke.decimalPlaces=Ke.dp=function(){var t=this,e=t.d.length-1,n=(e-t.e)*_n;if(e=t.d[e],e)for(;e%10==0;e/=10)n--;return n<0?0:n};Ke.dividedBy=Ke.div=function(t){return Qa(this,new this.constructor(t))};Ke.dividedToIntegerBy=Ke.idiv=function(t){var e=this,n=e.constructor;return un(Qa(e,new n(t),0,1),n.precision)};Ke.equals=Ke.eq=function(t){return!this.cmp(t)};Ke.exponent=function(){return Hn(this)};Ke.greaterThan=Ke.gt=function(t){return this.cmp(t)>0};Ke.greaterThanOrEqualTo=Ke.gte=function(t){return this.cmp(t)>=0};Ke.isInteger=Ke.isint=function(){return this.e>this.d.length-2};Ke.isNegative=Ke.isneg=function(){return this.s<0};Ke.isPositive=Ke.ispos=function(){return this.s>0};Ke.isZero=function(){return this.s===0};Ke.lessThan=Ke.lt=function(t){return this.cmp(t)<0};Ke.lessThanOrEqualTo=Ke.lte=function(t){return this.cmp(t)<1};Ke.logarithm=Ke.log=function(t){var e,n=this,r=n.constructor,i=r.precision,o=i+5;if(t===void 0)t=new r(10);else if(t=new r(t),t.s<1||t.eq(Ci))throw Error(ao+"NaN");if(n.s<1)throw Error(ao+(n.s?"NaN":"-Infinity"));return n.eq(Ci)?new r(0):(Mn=!1,e=Qa(Gp(n,o),Gp(t,o),o),Mn=!0,un(e,i))};Ke.minus=Ke.sub=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?YH(e,t):qH(e,(t.s=-t.s,t))};Ke.modulo=Ke.mod=function(t){var e,n=this,r=n.constructor,i=r.precision;if(t=new r(t),!t.s)throw Error(ao+"NaN");return n.s?(Mn=!1,e=Qa(n,t,0,1).times(t),Mn=!0,n.minus(e)):un(new r(n),i)};Ke.naturalExponential=Ke.exp=function(){return KH(this)};Ke.naturalLogarithm=Ke.ln=function(){return Gp(this)};Ke.negated=Ke.neg=function(){var t=new this.constructor(this);return t.s=-t.s||0,t};Ke.plus=Ke.add=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?qH(e,t):YH(e,(t.s=-t.s,t))};Ke.precision=Ke.sd=function(t){var e,n,r,i=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(xc+t);if(e=Hn(i)+1,r=i.d.length-1,n=r*_n+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return t&&e>n?e:n};Ke.squareRoot=Ke.sqrt=function(){var t,e,n,r,i,o,a,s=this,l=s.constructor;if(s.s<1){if(!s.s)return new l(0);throw Error(ao+"NaN")}for(t=Hn(s),Mn=!1,i=Math.sqrt(+s),i==0||i==1/0?(e=fa(s.d),(e.length+t)%2==0&&(e+="0"),i=Math.sqrt(e),t=Bf((t+1)/2)-(t<0||t%2),i==1/0?e="5e"+t:(e=i.toExponential(),e=e.slice(0,e.indexOf("e")+1)+t),r=new l(e)):r=new l(i.toString()),n=l.precision,i=a=n+3;;)if(o=r,r=o.plus(Qa(s,o,a+2)).times(.5),fa(o.d).slice(0,a)===(e=fa(r.d)).slice(0,a)){if(e=e.slice(a-3,a+1),i==a&&e=="4999"){if(un(o,n+1,0),o.times(o).eq(s)){r=o;break}}else if(e!="9999")break;a+=4}return Mn=!0,un(r,n)};Ke.times=Ke.mul=function(t){var e,n,r,i,o,a,s,l,c,u=this,d=u.constructor,f=u.d,p=(t=new d(t)).d;if(!u.s||!t.s)return new d(0);for(t.s*=u.s,n=u.e+t.e,l=f.length,c=p.length,l=0;){for(e=0,i=l+r;i>r;)s=o[i]+p[r]*f[i-r-1]+e,o[i--]=s%ir|0,e=s/ir|0;o[i]=(o[i]+e)%ir|0}for(;!o[--a];)o.pop();return e?++n:o.shift(),t.d=o,t.e=n,Mn?un(t,d.precision):t};Ke.toDecimalPlaces=Ke.todp=function(t,e){var n=this,r=n.constructor;return n=new r(n),t===void 0?n:(wa(t,0,Ff),e===void 0?e=r.rounding:wa(e,0,8),un(n,t+Hn(n)+1,e))};Ke.toExponential=function(t,e){var n,r=this,i=r.constructor;return t===void 0?n=kc(r,!0):(wa(t,0,Ff),e===void 0?e=i.rounding:wa(e,0,8),r=un(new i(r),t+1,e),n=kc(r,!0,t+1)),n};Ke.toFixed=function(t,e){var n,r,i=this,o=i.constructor;return t===void 0?kc(i):(wa(t,0,Ff),e===void 0?e=o.rounding:wa(e,0,8),r=un(new o(i),t+Hn(i)+1,e),n=kc(r.abs(),!1,t+Hn(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};Ke.toInteger=Ke.toint=function(){var t=this,e=t.constructor;return un(new e(t),Hn(t)+1,e.rounding)};Ke.toNumber=function(){return+this};Ke.toPower=Ke.pow=function(t){var e,n,r,i,o,a,s=this,l=s.constructor,c=12,u=+(t=new l(t));if(!t.s)return new l(Ci);if(s=new l(s),!s.s){if(t.s<1)throw Error(ao+"Infinity");return s}if(s.eq(Ci))return s;if(r=l.precision,t.eq(Ci))return un(s,r);if(e=t.e,n=t.d.length-1,a=e>=n,o=s.s,a){if((n=u<0?-u:u)<=XH){for(i=new l(Ci),e=Math.ceil(r/_n+4),Mn=!1;n%2&&(i=i.times(s),UD(i.d,e)),n=Bf(n/2),n!==0;)s=s.times(s),UD(s.d,e);return Mn=!0,t.s<0?new l(Ci).div(i):un(i,r)}}else if(o<0)throw Error(ao+"NaN");return o=o<0&&t.d[Math.max(e,n)]&1?-1:1,s.s=1,Mn=!1,i=t.times(Gp(s,r+c)),Mn=!0,i=KH(i),i.s=o,i};Ke.toPrecision=function(t,e){var n,r,i=this,o=i.constructor;return t===void 0?(n=Hn(i),r=kc(i,n<=o.toExpNeg||n>=o.toExpPos)):(wa(t,1,Ff),e===void 0?e=o.rounding:wa(e,0,8),i=un(new o(i),t,e),n=Hn(i),r=kc(i,t<=n||n<=o.toExpNeg,t)),r};Ke.toSignificantDigits=Ke.tosd=function(t,e){var n=this,r=n.constructor;return t===void 0?(t=r.precision,e=r.rounding):(wa(t,1,Ff),e===void 0?e=r.rounding:wa(e,0,8)),un(new r(n),t,e)};Ke.toString=Ke.valueOf=Ke.val=Ke.toJSON=Ke[Symbol.for("nodejs.util.inspect.custom")]=function(){var t=this,e=Hn(t),n=t.constructor;return kc(t,e<=n.toExpNeg||e>=n.toExpPos)};function qH(t,e){var n,r,i,o,a,s,l,c,u=t.constructor,d=u.precision;if(!t.s||!e.s)return e.s||(e=new u(t)),Mn?un(e,d):e;if(l=t.d,c=e.d,a=t.e,i=e.e,l=l.slice(),o=a-i,o){for(o<0?(r=l,o=-o,s=c.length):(r=c,i=a,s=l.length),a=Math.ceil(d/_n),s=a>s?a+1:s+1,o>s&&(o=s,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(s=l.length,o=c.length,s-o<0&&(o=s,r=c,c=l,l=r),n=0;o;)n=(l[--o]=l[o]+c[o]+n)/ir|0,l[o]%=ir;for(n&&(l.unshift(n),++i),s=l.length;l[--s]==0;)l.pop();return e.d=l,e.e=i,Mn?un(e,d):e}function wa(t,e,n){if(t!==~~t||tn)throw Error(xc+t)}function fa(t){var e,n,r,i=t.length-1,o="",a=t[0];if(i>0){for(o+=a,e=1;ea?1:-1;else for(s=l=0;si[s]?1:-1;break}return l}function n(r,i,o){for(var a=0;o--;)r[o]-=a,a=r[o]1;)r.shift()}return function(r,i,o,a){var s,l,c,u,d,f,p,y,v,g,m,x,b,S,w,E,T,A,M=r.constructor,C=r.s==i.s?1:-1,P=r.d,R=i.d;if(!r.s)return new M(r);if(!i.s)throw Error(ao+"Division by zero");for(l=r.e-i.e,T=R.length,w=P.length,p=new M(C),y=p.d=[],c=0;R[c]==(P[c]||0);)++c;if(R[c]>(P[c]||0)&&--l,o==null?x=o=M.precision:a?x=o+(Hn(r)-Hn(i))+1:x=o,x<0)return new M(0);if(x=x/_n+2|0,c=0,T==1)for(u=0,R=R[0],x++;(c1&&(R=t(R,u),P=t(P,u),T=R.length,w=P.length),S=T,v=P.slice(0,T),g=v.length;g=ir/2&&++E;do u=0,s=e(R,v,T,g),s<0?(m=v[0],T!=g&&(m=m*ir+(v[1]||0)),u=m/E|0,u>1?(u>=ir&&(u=ir-1),d=t(R,u),f=d.length,g=v.length,s=e(d,v,f,g),s==1&&(u--,n(d,T16)throw Error(mP+Hn(t));if(!t.s)return new u(Ci);for(Mn=!1,s=d,a=new u(.03125);t.abs().gte(.1);)t=t.times(a),c+=5;for(r=Math.log(Xl(2,c))/Math.LN10*2+5|0,s+=r,n=i=o=new u(Ci),u.precision=s;;){if(i=un(i.times(t),s),n=n.times(++l),a=o.plus(Qa(i,n,s)),fa(a.d).slice(0,s)===fa(o.d).slice(0,s)){for(;c--;)o=un(o.times(o),s);return u.precision=d,e==null?(Mn=!0,un(o,d)):o}o=a}}function Hn(t){for(var e=t.e*_n,n=t.d[0];n>=10;n/=10)e++;return e}function nS(t,e,n){if(e>t.LN10.sd())throw Mn=!0,n&&(t.precision=n),Error(ao+"LN10 precision limit exceeded");return un(new t(t.LN10),e)}function Ns(t){for(var e="";t--;)e+="0";return e}function Gp(t,e){var n,r,i,o,a,s,l,c,u,d=1,f=10,p=t,y=p.d,v=p.constructor,g=v.precision;if(p.s<1)throw Error(ao+(p.s?"NaN":"-Infinity"));if(p.eq(Ci))return new v(0);if(e==null?(Mn=!1,c=g):c=e,p.eq(10))return e==null&&(Mn=!0),nS(v,c);if(c+=f,v.precision=c,n=fa(y),r=n.charAt(0),o=Hn(p),Math.abs(o)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)p=p.times(t),n=fa(p.d),r=n.charAt(0),d++;o=Hn(p),r>1?(p=new v("0."+n),o++):p=new v(r+"."+n.slice(1))}else return l=nS(v,c+2,g).times(o+""),p=Gp(new v(r+"."+n.slice(1)),c-f).plus(l),v.precision=g,e==null?(Mn=!0,un(p,g)):p;for(s=a=p=Qa(p.minus(Ci),p.plus(Ci),c),u=un(p.times(p),c),i=3;;){if(a=un(a.times(u),c),l=s.plus(Qa(a,new v(i),c)),fa(l.d).slice(0,c)===fa(s.d).slice(0,c))return s=s.times(2),o!==0&&(s=s.plus(nS(v,c+2,g).times(o+""))),s=Qa(s,new v(d),c),v.precision=g,e==null?(Mn=!0,un(s,g)):s;s=l,i+=2}}function jD(t,e){var n,r,i;for((n=e.indexOf("."))>-1&&(e=e.replace(".","")),(r=e.search(/e/i))>0?(n<0&&(n=r),n+=+e.slice(r+1),e=e.substring(0,r)):n<0&&(n=e.length),r=0;e.charCodeAt(r)===48;)++r;for(i=e.length;e.charCodeAt(i-1)===48;)--i;if(e=e.slice(r,i),e){if(i-=r,n=n-r-1,t.e=Bf(n/_n),t.d=[],r=(n+1)%_n,n<0&&(r+=_n),ru0||t.e<-u0))throw Error(mP+n)}else t.s=0,t.e=0,t.d=[0];return t}function un(t,e,n){var r,i,o,a,s,l,c,u,d=t.d;for(a=1,o=d[0];o>=10;o/=10)a++;if(r=e-a,r<0)r+=_n,i=e,c=d[u=0];else{if(u=Math.ceil((r+1)/_n),o=d.length,u>=o)return t;for(c=o=d[u],a=1;o>=10;o/=10)a++;r%=_n,i=r-_n+a}if(n!==void 0&&(o=Xl(10,a-i-1),s=c/o%10|0,l=e<0||d[u+1]!==void 0||c%o,l=n<4?(s||l)&&(n==0||n==(t.s<0?3:2)):s>5||s==5&&(n==4||l||n==6&&(r>0?i>0?c/Xl(10,a-i):0:d[u-1])%10&1||n==(t.s<0?8:7))),e<1||!d[0])return l?(o=Hn(t),d.length=1,e=e-o-1,d[0]=Xl(10,(_n-e%_n)%_n),t.e=Bf(-e/_n)||0):(d.length=1,d[0]=t.e=t.s=0),t;if(r==0?(d.length=u,o=1,u--):(d.length=u+1,o=Xl(10,_n-r),d[u]=i>0?(c/Xl(10,a-i)%Xl(10,i)|0)*o:0),l)for(;;)if(u==0){(d[0]+=o)==ir&&(d[0]=1,++t.e);break}else{if(d[u]+=o,d[u]!=ir)break;d[u--]=0,o=1}for(r=d.length;d[--r]===0;)d.pop();if(Mn&&(t.e>u0||t.e<-u0))throw Error(mP+Hn(t));return t}function YH(t,e){var n,r,i,o,a,s,l,c,u,d,f=t.constructor,p=f.precision;if(!t.s||!e.s)return e.s?e.s=-e.s:e=new f(t),Mn?un(e,p):e;if(l=t.d,d=e.d,r=e.e,c=t.e,l=l.slice(),a=c-r,a){for(u=a<0,u?(n=l,a=-a,s=d.length):(n=d,r=c,s=l.length),i=Math.max(Math.ceil(p/_n),s)+2,a>i&&(a=i,n.length=1),n.reverse(),i=a;i--;)n.push(0);n.reverse()}else{for(i=l.length,s=d.length,u=i0;--i)l[s++]=0;for(i=d.length;i>a;){if(l[--i]0?o=o.charAt(0)+"."+o.slice(1)+Ns(r):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+Ns(-i-1)+o,n&&(r=n-a)>0&&(o+=Ns(r))):i>=a?(o+=Ns(i+1-a),n&&(r=n-i-1)>0&&(o=o+"."+Ns(r))):((r=i+1)0&&(i+1===a&&(o+="."),o+=Ns(r))),t.s<0?"-"+o:o}function UD(t,e){if(t.length>e)return t.length=e,!0}function JH(t){var e,n,r;function i(o){var a=this;if(!(a instanceof i))return new i(o);if(a.constructor=i,o instanceof i){a.s=o.s,a.e=o.e,a.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(xc+o);if(o>0)a.s=1;else if(o<0)o=-o,a.s=-1;else{a.s=0,a.e=0,a.d=[0];return}if(o===~~o&&o<1e7){a.e=0,a.d=[o];return}return jD(a,o.toString())}else if(typeof o!="string")throw Error(xc+o);if(o.charCodeAt(0)===45?(o=o.slice(1),a.s=-1):a.s=1,UTe.test(o))jD(a,o);else throw Error(xc+o)}if(i.prototype=Ke,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=JH,i.config=i.set=FTe,t===void 0&&(t={}),t)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],e=0;e=i[e+1]&&r<=i[e+2])this[n]=r;else throw Error(xc+n+": "+r);if((r=t[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(xc+n+": "+r);return this}var gP=JH(jTe);Ci=new gP(1);const sn=gP;function BTe(t){return VTe(t)||HTe(t)||zTe(t)||$Te()}function $Te(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zTe(t,e){if(t){if(typeof t=="string")return lT(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return lT(t,e)}}function HTe(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function VTe(t){if(Array.isArray(t))return lT(t)}function lT(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=e?n.apply(void 0,i):t(e-a,FD(function(){for(var s=arguments.length,l=new Array(s),c=0;ct.length)&&(e=t.length);for(var n=0,r=new Array(e);n"u"||!(Symbol.iterator in Object(t)))){var n=[],r=!0,i=!1,o=void 0;try{for(var a=t[Symbol.iterator](),s;!(r=(s=a.next()).done)&&(n.push(s.value),!(e&&n.length===e));r=!0);}catch(l){i=!0,o=l}finally{try{!r&&a.return!=null&&a.return()}finally{if(i)throw o}}return n}}function oMe(t){if(Array.isArray(t))return t}function nV(t){var e=Wp(t,2),n=e[0],r=e[1],i=n,o=r;return n>r&&(i=r,o=n),[i,o]}function rV(t,e,n){if(t.lte(0))return new sn(0);var r=Lb.getDigitCount(t.toNumber()),i=new sn(10).pow(r),o=t.div(i),a=r!==1?.05:.1,s=new sn(Math.ceil(o.div(a).toNumber())).add(n).mul(a),l=s.mul(i);return e?l:new sn(Math.ceil(l))}function aMe(t,e,n){var r=1,i=new sn(t);if(!i.isint()&&n){var o=Math.abs(t);o<1?(r=new sn(10).pow(Lb.getDigitCount(t)-1),i=new sn(Math.floor(i.div(r).toNumber())).mul(r)):o>1&&(i=new sn(Math.floor(t)))}else t===0?i=new sn(Math.floor((e-1)/2)):n||(i=new sn(Math.floor(t)));var a=Math.floor((e-1)/2),s=qTe(XTe(function(l){return i.add(new sn(l-a).mul(r)).toNumber()}),cT);return s(0,e)}function iV(t,e,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((e-t)/(n-1)))return{step:new sn(0),tickMin:new sn(0),tickMax:new sn(0)};var o=rV(new sn(e).sub(t).div(n-1),r,i),a;t<=0&&e>=0?a=new sn(0):(a=new sn(t).add(e).div(2),a=a.sub(new sn(a).mod(o)));var s=Math.ceil(a.sub(t).div(o).toNumber()),l=Math.ceil(new sn(e).sub(a).div(o).toNumber()),c=s+l+1;return c>n?iV(t,e,n,r,i+1):(c0?l+(n-c):l,s=e>0?s:s+(n-c)),{step:o,tickMin:a.sub(new sn(s).mul(o)),tickMax:a.add(new sn(l).mul(o))})}function sMe(t){var e=Wp(t,2),n=e[0],r=e[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=Math.max(i,2),s=nV([n,r]),l=Wp(s,2),c=l[0],u=l[1];if(c===-1/0||u===1/0){var d=u===1/0?[c].concat(dT(cT(0,i-1).map(function(){return 1/0}))):[].concat(dT(cT(0,i-1).map(function(){return-1/0})),[u]);return n>r?uT(d):d}if(c===u)return aMe(c,i,o);var f=iV(c,u,a,o),p=f.step,y=f.tickMin,v=f.tickMax,g=Lb.rangeStep(y,v.add(new sn(.1).mul(p)),p);return n>r?uT(g):g}function lMe(t,e){var n=Wp(t,2),r=n[0],i=n[1],o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=nV([r,i]),s=Wp(a,2),l=s[0],c=s[1];if(l===-1/0||c===1/0)return[r,i];if(l===c)return[l];var u=Math.max(e,2),d=rV(new sn(c).sub(l).div(u-1),o,0),f=[].concat(dT(Lb.rangeStep(new sn(l),new sn(c).sub(new sn(.99).mul(d)),d)),[c]);return r>i?uT(f):f}var cMe=eV(sMe),uMe=eV(lMe),dMe="Invariant failed";function jc(t,e){throw new Error(dMe)}var fMe=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Jd(t){"@babel/helpers - typeof";return Jd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jd(t)}function d0(){return d0=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function xMe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function bMe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _Me(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,a=-1,s=(n=r==null?void 0:r.length)!==null&&n!==void 0?n:0;if(s<=1)return 0;if(o&&o.axisType==="angleAxis"&&Math.abs(Math.abs(o.range[1]-o.range[0])-360)<=1e-6)for(var l=o.range,c=0;c0?i[c-1].coordinate:i[s-1].coordinate,d=i[c].coordinate,f=c>=s-1?i[0].coordinate:i[c+1].coordinate,p=void 0;if(Lo(d-u)!==Lo(f-d)){var y=[];if(Lo(f-d)===Lo(l[1]-l[0])){p=f;var v=d+l[1]-l[0];y[0]=Math.min(v,(v+u)/2),y[1]=Math.max(v,(v+u)/2)}else{p=u;var g=f+l[1]-l[0];y[0]=Math.min(d,(g+d)/2),y[1]=Math.max(d,(g+d)/2)}var m=[Math.min(d,(p+d)/2),Math.max(d,(p+d)/2)];if(e>m[0]&&e<=m[1]||e>=y[0]&&e<=y[1]){a=i[c].index;break}}else{var x=Math.min(u,f),b=Math.max(u,f);if(e>(x+d)/2&&e<=(b+d)/2){a=i[c].index;break}}}else for(var S=0;S0&&S(r[S].coordinate+r[S-1].coordinate)/2&&e<=(r[S].coordinate+r[S+1].coordinate)/2||S===s-1&&e>(r[S].coordinate+r[S-1].coordinate)/2){a=r[S].index;break}return a},vP=function(e){var n,r=e,i=r.type.displayName,o=(n=e.type)!==null&&n!==void 0&&n.defaultProps?In(In({},e.type.defaultProps),e.props):e.props,a=o.stroke,s=o.fill,l;switch(i){case"Line":l=a;break;case"Area":case"Radar":l=a&&a!=="none"?a:s;break;default:l=s;break}return l},UMe=function(e){var n=e.barSize,r=e.totalSize,i=e.stackGroups,o=i===void 0?{}:i;if(!o)return{};for(var a={},s=Object.keys(o),l=0,c=s.length;l=0});if(m&&m.length){var x=m[0].type.defaultProps,b=x!==void 0?In(In({},x),m[0].props):m[0].props,S=b.barSize,w=b[g];a[w]||(a[w]=[]);var E=Ut(S)?n:S;a[w].push({item:m[0],stackList:m.slice(1),barSize:Ut(E)?void 0:Lc(E,r,0)})}}return a},FMe=function(e){var n=e.barGap,r=e.barCategoryGap,i=e.bandSize,o=e.sizeList,a=o===void 0?[]:o,s=e.maxBarSize,l=a.length;if(l<1)return null;var c=Lc(n,i,0,!0),u,d=[];if(a[0].barSize===+a[0].barSize){var f=!1,p=i/l,y=a.reduce(function(S,w){return S+w.barSize||0},0);y+=(l-1)*c,y>=i&&(y-=(l-1)*c,c=0),y>=i&&p>0&&(f=!0,p*=.9,y=l*p);var v=(i-y)/2>>0,g={offset:v-c,size:0};u=a.reduce(function(S,w){var E={item:w.item,position:{offset:g.offset+g.size+c,size:f?p:w.barSize}},T=[].concat(zD(S),[E]);return g=T[T.length-1].position,w.stackList&&w.stackList.length&&w.stackList.forEach(function(A){T.push({item:A,position:g})}),T},d)}else{var m=Lc(r,i,0,!0);i-2*m-(l-1)*c<=0&&(c=0);var x=(i-2*m-(l-1)*c)/l;x>1&&(x>>=0);var b=s===+s?Math.min(x,s):x;u=a.reduce(function(S,w,E){var T=[].concat(zD(S),[{item:w.item,position:{offset:m+(x+c)*E+(x-b)/2,size:b}}]);return w.stackList&&w.stackList.length&&w.stackList.forEach(function(A){T.push({item:A,position:T[T.length-1].position})}),T},d)}return u},BMe=function(e,n,r,i){var o=r.children,a=r.width,s=r.margin,l=a-(s.left||0)-(s.right||0),c=lV({children:o,legendWidth:l});if(c){var u=i||{},d=u.width,f=u.height,p=c.align,y=c.verticalAlign,v=c.layout;if((v==="vertical"||v==="horizontal"&&y==="middle")&&p!=="center"&&ze(e[p]))return In(In({},e),{},md({},p,e[p]+(d||0)));if((v==="horizontal"||v==="vertical"&&p==="center")&&y!=="middle"&&ze(e[y]))return In(In({},e),{},md({},y,e[y]+(f||0)))}return e},$Me=function(e,n,r){return Ut(n)?!0:e==="horizontal"?n==="yAxis":e==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},cV=function(e,n,r,i,o){var a=n.props.children,s=ro(a,Wm).filter(function(c){return $Me(i,o,c.props.direction)});if(s&&s.length){var l=s.map(function(c){return c.props.dataKey});return e.reduce(function(c,u){var d=Di(u,r);if(Ut(d))return c;var f=Array.isArray(d)?[Ob(d),Nb(d)]:[d,d],p=l.reduce(function(y,v){var g=Di(u,v,0),m=f[0]-Math.abs(Array.isArray(g)?g[0]:g),x=f[1]+Math.abs(Array.isArray(g)?g[1]:g);return[Math.min(m,y[0]),Math.max(x,y[1])]},[1/0,-1/0]);return[Math.min(p[0],c[0]),Math.max(p[1],c[1])]},[1/0,-1/0])}return null},zMe=function(e,n,r,i,o){var a=n.map(function(s){return cV(e,s,r,o,i)}).filter(function(s){return!Ut(s)});return a&&a.length?a.reduce(function(s,l){return[Math.min(s[0],l[0]),Math.max(s[1],l[1])]},[1/0,-1/0]):null},uV=function(e,n,r,i,o){var a=n.map(function(l){var c=l.props.dataKey;return r==="number"&&c&&cV(e,l,c,i)||Yh(e,c,r,o)});if(r==="number")return a.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]);var s={};return a.reduce(function(l,c){for(var u=0,d=c.length;u=2?Lo(s[0]-s[1])*2*c:c,n&&(e.ticks||e.niceTicks)){var u=(e.ticks||e.niceTicks).map(function(d){var f=o?o.indexOf(d):d;return{coordinate:i(f)+c,value:d,offset:c}});return u.filter(function(d){return!Bm(d.coordinate)})}return e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map(function(d,f){return{coordinate:i(d)+c,value:d,index:f,offset:c}}):i.ticks&&!r?i.ticks(e.tickCount).map(function(d){return{coordinate:i(d)+c,value:d,offset:c}}):i.domain().map(function(d,f){return{coordinate:i(d)+c,value:o?o[d]:d,index:f,offset:c}})},rS=new WeakMap,gv=function(e,n){if(typeof n!="function")return e;rS.has(e)||rS.set(e,new WeakMap);var r=rS.get(e);if(r.has(n))return r.get(n);var i=function(){e.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,i),i},HMe=function(e,n,r){var i=e.scale,o=e.type,a=e.layout,s=e.axisType;if(i==="auto")return a==="radial"&&s==="radiusAxis"?{scale:Bp(),realScaleType:"band"}:a==="radial"&&s==="angleAxis"?{scale:a0(),realScaleType:"linear"}:o==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:Kh(),realScaleType:"point"}:o==="category"?{scale:Bp(),realScaleType:"band"}:{scale:a0(),realScaleType:"linear"};if(Dc(i)){var l="scale".concat(yb(i));return{scale:(kD[l]||Kh)(),realScaleType:kD[l]?l:"point"}}return jt(i)?{scale:i}:{scale:Kh(),realScaleType:"point"}},VD=1e-4,VMe=function(e){var n=e.domain();if(!(!n||n.length<=2)){var r=n.length,i=e.range(),o=Math.min(i[0],i[1])-VD,a=Math.max(i[0],i[1])+VD,s=e(n[0]),l=e(n[r-1]);(sa||la)&&e.domain([n[0],n[r-1]])}},GMe=function(e,n){if(!e)return null;for(var r=0,i=e.length;ri)&&(o[1]=i),o[0]>i&&(o[0]=i),o[1]=0?(e[s][r][0]=o,e[s][r][1]=o+l,o=e[s][r][1]):(e[s][r][0]=a,e[s][r][1]=a+l,a=e[s][r][1])}},qMe=function(e){var n=e.length;if(!(n<=0))for(var r=0,i=e[0].length;r=0?(e[a][r][0]=o,e[a][r][1]=o+s,o=e[a][r][1]):(e[a][r][0]=0,e[a][r][1]=0)}},KMe={sign:XMe,expand:cme,none:Hd,silhouette:ume,wiggle:dme,positive:qMe},YMe=function(e,n,r){var i=n.map(function(s){return s.props.dataKey}),o=KMe[r],a=lme().keys(i).value(function(s,l){return+Di(s,l,0)}).order(F1).offset(o);return a(e)},JMe=function(e,n,r,i,o,a){if(!e)return null;var s=a?n.reverse():n,l={},c=s.reduce(function(d,f){var p,y=(p=f.type)!==null&&p!==void 0&&p.defaultProps?In(In({},f.type.defaultProps),f.props):f.props,v=y.stackId,g=y.hide;if(g)return d;var m=y[r],x=d[m]||{hasStack:!1,stackGroups:{}};if(Yn(v)){var b=x.stackGroups[v]||{numericAxisId:r,cateAxisId:i,items:[]};b.items.push(f),x.hasStack=!0,x.stackGroups[v]=b}else x.stackGroups[$m("_stackId_")]={numericAxisId:r,cateAxisId:i,items:[f]};return In(In({},d),{},md({},m,x))},l),u={};return Object.keys(c).reduce(function(d,f){var p=c[f];if(p.hasStack){var y={};p.stackGroups=Object.keys(p.stackGroups).reduce(function(v,g){var m=p.stackGroups[g];return In(In({},v),{},md({},g,{numericAxisId:r,cateAxisId:i,items:m.items,stackedData:YMe(e,m.items,o)}))},y)}return In(In({},d),{},md({},f,p))},u)},ZMe=function(e,n){var r=n.realScaleType,i=n.type,o=n.tickCount,a=n.originalDomain,s=n.allowDecimals,l=r||n.scale;if(l!=="auto"&&l!=="linear")return null;if(o&&i==="number"&&a&&(a[0]==="auto"||a[1]==="auto")){var c=e.domain();if(!c.length)return null;var u=cMe(c,o,s);return e.domain([Ob(u),Nb(u)]),{niceTicks:u}}if(o&&i==="number"){var d=e.domain(),f=uMe(d,o,s);return{niceTicks:f}}return null};function GD(t){var e=t.axis,n=t.ticks,r=t.bandSize,i=t.entry,o=t.index,a=t.dataKey;if(e.type==="category"){if(!e.allowDuplicatedCategory&&e.dataKey&&!Ut(i[e.dataKey])){var s=jy(n,"value",i[e.dataKey]);if(s)return s.coordinate+r/2}return n[o]?n[o].coordinate+r/2:null}var l=Di(i,Ut(a)?e.dataKey:a);return Ut(l)?null:e.scale(l)}var WD=function(e){var n=e.axis,r=e.ticks,i=e.offset,o=e.bandSize,a=e.entry,s=e.index;if(n.type==="category")return r[s]?r[s].coordinate+i:null;var l=Di(a,n.dataKey,n.domain[s]);return Ut(l)?null:n.scale(l)-o/2+i},QMe=function(e){var n=e.numericAxis,r=n.scale.domain();if(n.type==="number"){var i=Math.min(r[0],r[1]),o=Math.max(r[0],r[1]);return i<=0&&o>=0?0:o<0?o:i}return r[0]},eAe=function(e,n){var r,i=(r=e.type)!==null&&r!==void 0&&r.defaultProps?In(In({},e.type.defaultProps),e.props):e.props,o=i.stackId;if(Yn(o)){var a=n[o];if(a){var s=a.items.indexOf(e);return s>=0?a.stackedData[s]:null}}return null},tAe=function(e){return e.reduce(function(n,r){return[Ob(r.concat([n[0]]).filter(ze)),Nb(r.concat([n[1]]).filter(ze))]},[1/0,-1/0])},fV=function(e,n,r){return Object.keys(e).reduce(function(i,o){var a=e[o],s=a.stackedData,l=s.reduce(function(c,u){var d=tAe(u.slice(n,r+1));return[Math.min(c[0],d[0]),Math.max(c[1],d[1])]},[1/0,-1/0]);return[Math.min(l[0],i[0]),Math.max(l[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},XD=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,qD=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,mT=function(e,n,r){if(jt(e))return e(n,r);if(!Array.isArray(e))return n;var i=[];if(ze(e[0]))i[0]=r?e[0]:Math.min(e[0],n[0]);else if(XD.test(e[0])){var o=+XD.exec(e[0])[1];i[0]=n[0]-o}else jt(e[0])?i[0]=e[0](n[0]):i[0]=n[0];if(ze(e[1]))i[1]=r?e[1]:Math.max(e[1],n[1]);else if(qD.test(e[1])){var a=+qD.exec(e[1])[1];i[1]=n[1]+a}else jt(e[1])?i[1]=e[1](n[1]):i[1]=n[1];return i},h0=function(e,n,r){if(e&&e.scale&&e.scale.bandwidth){var i=e.scale.bandwidth();if(!r||i>0)return i}if(e&&n&&n.length>=2){for(var o=GC(n,function(d){return d.coordinate}),a=1/0,s=1,l=o.length;sa&&(c=2*Math.PI-c),{radius:s,angle:oAe(c),angleInRadian:c}},lAe=function(e){var n=e.startAngle,r=e.endAngle,i=Math.floor(n/360),o=Math.floor(r/360),a=Math.min(i,o);return{startAngle:n-a*360,endAngle:r-a*360}},cAe=function(e,n){var r=n.startAngle,i=n.endAngle,o=Math.floor(r/360),a=Math.floor(i/360),s=Math.min(o,a);return e+s*360},ZD=function(e,n){var r=e.x,i=e.y,o=sAe({x:r,y:i},n),a=o.radius,s=o.angle,l=n.innerRadius,c=n.outerRadius;if(ac)return!1;if(a===0)return!0;var u=lAe(n),d=u.startAngle,f=u.endAngle,p=s,y;if(d<=f){for(;p>f;)p-=360;for(;p=d&&p<=f}else{for(;p>d;)p-=360;for(;p=f&&p<=d}return y?JD(JD({},n),{},{radius:a,angle:cAe(p,n)}):null};function Yp(t){"@babel/helpers - typeof";return Yp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Yp(t)}var uAe=["offset"];function dAe(t){return mAe(t)||pAe(t)||hAe(t)||fAe()}function fAe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hAe(t,e){if(t){if(typeof t=="string")return gT(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return gT(t,e)}}function pAe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function mAe(t){if(Array.isArray(t))return gT(t)}function gT(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function vAe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function QD(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 Xn(t){for(var e=1;e=0?1:-1,b,S;i==="insideStart"?(b=p+x*a,S=v):i==="insideEnd"?(b=y-x*a,S=!v):i==="end"&&(b=y+x*a,S=v),S=m<=0?S:!S;var w=vr(c,u,g,b),E=vr(c,u,g,b+(S?1:-1)*359),T="M".concat(w.x,",").concat(w.y,` A`).concat(g,",").concat(g,",0,1,").concat(S?0:1,`, - `).concat(E.x,",").concat(E.y),A=Ut(e.id)?$m("recharts-radial-line-"):e.id;return Z.createElement("text",Jp({},r,{dominantBaseline:"central",className:zt("recharts-radial-bar-label",s)}),Z.createElement("defs",null,Z.createElement("path",{id:A,d:T})),Z.createElement("textPath",{xlinkHref:"#".concat(A)},n))},wAe=function(e){var n=e.viewBox,r=e.offset,i=e.position,o=n,a=o.cx,s=o.cy,l=o.innerRadius,c=o.outerRadius,u=o.startAngle,d=o.endAngle,f=(u+d)/2;if(i==="outside"){var p=vr(a,s,c+r,f),y=p.x,v=p.y;return{x:y,y:v,textAnchor:y>=a?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"end"};var g=(l+c)/2,m=vr(a,s,g,f),x=m.x,b=m.y;return{x,y:b,textAnchor:"middle",verticalAnchor:"middle"}},SAe=function(e){var n=e.viewBox,r=e.parentViewBox,i=e.offset,o=e.position,a=n,s=a.x,l=a.y,c=a.width,u=a.height,d=u>=0?1:-1,f=d*i,p=d>0?"end":"start",y=d>0?"start":"end",v=c>=0?1:-1,g=v*i,m=v>0?"end":"start",x=v>0?"start":"end";if(o==="top"){var b={x:s+c/2,y:l-d*i,textAnchor:"middle",verticalAnchor:p};return Xn(Xn({},b),r?{height:Math.max(l-r.y,0),width:c}:{})}if(o==="bottom"){var S={x:s+c/2,y:l+u+f,textAnchor:"middle",verticalAnchor:y};return Xn(Xn({},S),r?{height:Math.max(r.y+r.height-(l+u),0),width:c}:{})}if(o==="left"){var w={x:s-g,y:l+u/2,textAnchor:m,verticalAnchor:"middle"};return Xn(Xn({},w),r?{width:Math.max(w.x-r.x,0),height:u}:{})}if(o==="right"){var E={x:s+c+g,y:l+u/2,textAnchor:x,verticalAnchor:"middle"};return Xn(Xn({},E),r?{width:Math.max(r.x+r.width-E.x,0),height:u}:{})}var T=r?{width:c,height:u}:{};return o==="insideLeft"?Xn({x:s+g,y:l+u/2,textAnchor:x,verticalAnchor:"middle"},T):o==="insideRight"?Xn({x:s+c-g,y:l+u/2,textAnchor:m,verticalAnchor:"middle"},T):o==="insideTop"?Xn({x:s+c/2,y:l+f,textAnchor:"middle",verticalAnchor:y},T):o==="insideBottom"?Xn({x:s+c/2,y:l+u-f,textAnchor:"middle",verticalAnchor:p},T):o==="insideTopLeft"?Xn({x:s+g,y:l+f,textAnchor:x,verticalAnchor:y},T):o==="insideTopRight"?Xn({x:s+c-g,y:l+f,textAnchor:m,verticalAnchor:y},T):o==="insideBottomLeft"?Xn({x:s+g,y:l+u-f,textAnchor:x,verticalAnchor:p},T):o==="insideBottomRight"?Xn({x:s+c-g,y:l+u-f,textAnchor:m,verticalAnchor:p},T):Pf(o)&&(ze(o.x)||tc(o.x))&&(ze(o.y)||tc(o.y))?Xn({x:s+Lc(o.x,c),y:l+Lc(o.y,u),textAnchor:"end",verticalAnchor:"end"},T):Xn({x:s+c/2,y:l+u/2,textAnchor:"middle",verticalAnchor:"middle"},T)},EAe=function(e){return"cx"in e&&ze(e.cx)};function Nr(t){var e=t.offset,n=e===void 0?5:e,r=pAe(t,lAe),i=Xn({offset:n},r),o=i.viewBox,a=i.position,s=i.value,l=i.children,c=i.content,u=i.className,d=u===void 0?"":u,f=i.textBreakAll;if(!o||Ut(s)&&Ut(l)&&!_.isValidElement(c)&&!jt(c))return null;if(_.isValidElement(c))return _.cloneElement(c,i);var p;if(jt(c)){if(p=_.createElement(c,i),_.isValidElement(p))return p}else p=xAe(i);var y=EAe(o),v=$t(i,!0);if(y&&(a==="insideStart"||a==="insideEnd"||a==="end"))return _Ae(i,p,v);var g=y?wAe(i):SAe(i);return Z.createElement(Qy,Jp({className:zt("recharts-label",d)},v,g,{breakAll:f}),p)}Nr.displayName="Label";var fV=function(e){var n=e.cx,r=e.cy,i=e.angle,o=e.startAngle,a=e.endAngle,s=e.r,l=e.radius,c=e.innerRadius,u=e.outerRadius,d=e.x,f=e.y,p=e.top,y=e.left,v=e.width,g=e.height,m=e.clockWise,x=e.labelViewBox;if(x)return x;if(ze(v)&&ze(g)){if(ze(d)&&ze(f))return{x:d,y:f,width:v,height:g};if(ze(p)&&ze(y))return{x:p,y,width:v,height:g}}return ze(d)&&ze(f)?{x:d,y:f,width:0,height:0}:ze(n)&&ze(r)?{cx:n,cy:r,startAngle:o||i||0,endAngle:a||i||0,innerRadius:c||0,outerRadius:u||l||s||0,clockWise:m}:e.viewBox?e.viewBox:{}},TAe=function(e,n){return e?e===!0?Z.createElement(Nr,{key:"label-implicit",viewBox:n}):Yn(e)?Z.createElement(Nr,{key:"label-implicit",viewBox:n,value:e}):_.isValidElement(e)?e.type===Nr?_.cloneElement(e,{key:"label-implicit",viewBox:n}):Z.createElement(Nr,{key:"label-implicit",content:e,viewBox:n}):jt(e)?Z.createElement(Nr,{key:"label-implicit",content:e,viewBox:n}):Pf(e)?Z.createElement(Nr,Jp({viewBox:n},e,{key:"label-implicit"})):null:null},MAe=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var i=e.children,o=fV(e),a=ro(i,Nr).map(function(l,c){return _.cloneElement(l,{viewBox:n||o,key:"label-".concat(c)})});if(!r)return a;var s=TAe(e.label,n||o);return[s].concat(cAe(a))};Nr.parseViewBox=fV;Nr.renderCallByParent=MAe;function AAe(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var CAe=AAe;const PAe=dn(CAe);function Zp(t){"@babel/helpers - typeof";return Zp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zp(t)}var RAe=["valueAccessor"],NAe=["data","dataKey","clockWise","id","textBreakAll"];function OAe(t){return kAe(t)||LAe(t)||DAe(t)||IAe()}function IAe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function DAe(t,e){if(t){if(typeof t=="string")return vT(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vT(t,e)}}function LAe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function kAe(t){if(Array.isArray(t))return vT(t)}function vT(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function BAe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}var $Ae=function(e){return Array.isArray(e.value)?PAe(e.value):e.value};function il(t){var e=t.valueAccessor,n=e===void 0?$Ae:e,r=tL(t,RAe),i=r.data,o=r.dataKey,a=r.clockWise,s=r.id,l=r.textBreakAll,c=tL(r,NAe);return!i||!i.length?null:Z.createElement(kn,{className:"recharts-label-list"},i.map(function(u,d){var f=Ut(o)?n(u,d):Di(u&&u.payload,o),p=Ut(s)?{}:{id:"".concat(s,"-").concat(d)};return Z.createElement(Nr,m0({},$t(u,!0),c,p,{parentViewBox:u.parentViewBox,value:f,textBreakAll:l,viewBox:Nr.parseViewBox(Ut(a)?u:eL(eL({},u),{},{clockWise:a})),key:"label-".concat(d),index:d}))}))}il.displayName="LabelList";function zAe(t,e){return t?t===!0?Z.createElement(il,{key:"labelList-implicit",data:e}):Z.isValidElement(t)||jt(t)?Z.createElement(il,{key:"labelList-implicit",data:e,content:t}):Pf(t)?Z.createElement(il,m0({data:e},t,{key:"labelList-implicit"})):null:null}function HAe(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var r=t.children,i=ro(r,il).map(function(a,s){return _.cloneElement(a,{data:e,key:"labelList-".concat(s)})});if(!n)return i;var o=zAe(t.label,e);return[o].concat(OAe(i))}il.renderCallByParent=HAe;function Qp(t){"@babel/helpers - typeof";return Qp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qp(t)}function yT(){return yT=Object.assign?Object.assign.bind():function(t){for(var e=1;e=a?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"end"};var g=(l+c)/2,m=vr(a,s,g,f),x=m.x,b=m.y;return{x,y:b,textAnchor:"middle",verticalAnchor:"middle"}},TAe=function(e){var n=e.viewBox,r=e.parentViewBox,i=e.offset,o=e.position,a=n,s=a.x,l=a.y,c=a.width,u=a.height,d=u>=0?1:-1,f=d*i,p=d>0?"end":"start",y=d>0?"start":"end",v=c>=0?1:-1,g=v*i,m=v>0?"end":"start",x=v>0?"start":"end";if(o==="top"){var b={x:s+c/2,y:l-d*i,textAnchor:"middle",verticalAnchor:p};return Xn(Xn({},b),r?{height:Math.max(l-r.y,0),width:c}:{})}if(o==="bottom"){var S={x:s+c/2,y:l+u+f,textAnchor:"middle",verticalAnchor:y};return Xn(Xn({},S),r?{height:Math.max(r.y+r.height-(l+u),0),width:c}:{})}if(o==="left"){var w={x:s-g,y:l+u/2,textAnchor:m,verticalAnchor:"middle"};return Xn(Xn({},w),r?{width:Math.max(w.x-r.x,0),height:u}:{})}if(o==="right"){var E={x:s+c+g,y:l+u/2,textAnchor:x,verticalAnchor:"middle"};return Xn(Xn({},E),r?{width:Math.max(r.x+r.width-E.x,0),height:u}:{})}var T=r?{width:c,height:u}:{};return o==="insideLeft"?Xn({x:s+g,y:l+u/2,textAnchor:x,verticalAnchor:"middle"},T):o==="insideRight"?Xn({x:s+c-g,y:l+u/2,textAnchor:m,verticalAnchor:"middle"},T):o==="insideTop"?Xn({x:s+c/2,y:l+f,textAnchor:"middle",verticalAnchor:y},T):o==="insideBottom"?Xn({x:s+c/2,y:l+u-f,textAnchor:"middle",verticalAnchor:p},T):o==="insideTopLeft"?Xn({x:s+g,y:l+f,textAnchor:x,verticalAnchor:y},T):o==="insideTopRight"?Xn({x:s+c-g,y:l+f,textAnchor:m,verticalAnchor:y},T):o==="insideBottomLeft"?Xn({x:s+g,y:l+u-f,textAnchor:x,verticalAnchor:p},T):o==="insideBottomRight"?Xn({x:s+c-g,y:l+u-f,textAnchor:m,verticalAnchor:p},T):Pf(o)&&(ze(o.x)||tc(o.x))&&(ze(o.y)||tc(o.y))?Xn({x:s+Lc(o.x,c),y:l+Lc(o.y,u),textAnchor:"end",verticalAnchor:"end"},T):Xn({x:s+c/2,y:l+u/2,textAnchor:"middle",verticalAnchor:"middle"},T)},MAe=function(e){return"cx"in e&&ze(e.cx)};function Or(t){var e=t.offset,n=e===void 0?5:e,r=gAe(t,uAe),i=Xn({offset:n},r),o=i.viewBox,a=i.position,s=i.value,l=i.children,c=i.content,u=i.className,d=u===void 0?"":u,f=i.textBreakAll;if(!o||Ut(s)&&Ut(l)&&!_.isValidElement(c)&&!jt(c))return null;if(_.isValidElement(c))return _.cloneElement(c,i);var p;if(jt(c)){if(p=_.createElement(c,i),_.isValidElement(p))return p}else p=_Ae(i);var y=MAe(o),v=$t(i,!0);if(y&&(a==="insideStart"||a==="insideEnd"||a==="end"))return SAe(i,p,v);var g=y?EAe(i):TAe(i);return Q.createElement(Qy,Jp({className:zt("recharts-label",d)},v,g,{breakAll:f}),p)}Or.displayName="Label";var pV=function(e){var n=e.cx,r=e.cy,i=e.angle,o=e.startAngle,a=e.endAngle,s=e.r,l=e.radius,c=e.innerRadius,u=e.outerRadius,d=e.x,f=e.y,p=e.top,y=e.left,v=e.width,g=e.height,m=e.clockWise,x=e.labelViewBox;if(x)return x;if(ze(v)&&ze(g)){if(ze(d)&&ze(f))return{x:d,y:f,width:v,height:g};if(ze(p)&&ze(y))return{x:p,y,width:v,height:g}}return ze(d)&&ze(f)?{x:d,y:f,width:0,height:0}:ze(n)&&ze(r)?{cx:n,cy:r,startAngle:o||i||0,endAngle:a||i||0,innerRadius:c||0,outerRadius:u||l||s||0,clockWise:m}:e.viewBox?e.viewBox:{}},AAe=function(e,n){return e?e===!0?Q.createElement(Or,{key:"label-implicit",viewBox:n}):Yn(e)?Q.createElement(Or,{key:"label-implicit",viewBox:n,value:e}):_.isValidElement(e)?e.type===Or?_.cloneElement(e,{key:"label-implicit",viewBox:n}):Q.createElement(Or,{key:"label-implicit",content:e,viewBox:n}):jt(e)?Q.createElement(Or,{key:"label-implicit",content:e,viewBox:n}):Pf(e)?Q.createElement(Or,Jp({viewBox:n},e,{key:"label-implicit"})):null:null},CAe=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var i=e.children,o=pV(e),a=ro(i,Or).map(function(l,c){return _.cloneElement(l,{viewBox:n||o,key:"label-".concat(c)})});if(!r)return a;var s=AAe(e.label,n||o);return[s].concat(dAe(a))};Or.parseViewBox=pV;Or.renderCallByParent=CAe;function PAe(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var RAe=PAe;const NAe=dn(RAe);function Zp(t){"@babel/helpers - typeof";return Zp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zp(t)}var OAe=["valueAccessor"],IAe=["data","dataKey","clockWise","id","textBreakAll"];function DAe(t){return UAe(t)||jAe(t)||kAe(t)||LAe()}function LAe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kAe(t,e){if(t){if(typeof t=="string")return vT(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vT(t,e)}}function jAe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function UAe(t){if(Array.isArray(t))return vT(t)}function vT(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function zAe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}var HAe=function(e){return Array.isArray(e.value)?NAe(e.value):e.value};function il(t){var e=t.valueAccessor,n=e===void 0?HAe:e,r=nL(t,OAe),i=r.data,o=r.dataKey,a=r.clockWise,s=r.id,l=r.textBreakAll,c=nL(r,IAe);return!i||!i.length?null:Q.createElement(kn,{className:"recharts-label-list"},i.map(function(u,d){var f=Ut(o)?n(u,d):Di(u&&u.payload,o),p=Ut(s)?{}:{id:"".concat(s,"-").concat(d)};return Q.createElement(Or,m0({},$t(u,!0),c,p,{parentViewBox:u.parentViewBox,value:f,textBreakAll:l,viewBox:Or.parseViewBox(Ut(a)?u:tL(tL({},u),{},{clockWise:a})),key:"label-".concat(d),index:d}))}))}il.displayName="LabelList";function VAe(t,e){return t?t===!0?Q.createElement(il,{key:"labelList-implicit",data:e}):Q.isValidElement(t)||jt(t)?Q.createElement(il,{key:"labelList-implicit",data:e,content:t}):Pf(t)?Q.createElement(il,m0({data:e},t,{key:"labelList-implicit"})):null:null}function GAe(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var r=t.children,i=ro(r,il).map(function(a,s){return _.cloneElement(a,{data:e,key:"labelList-".concat(s)})});if(!n)return i;var o=VAe(t.label,e);return[o].concat(DAe(i))}il.renderCallByParent=GAe;function Qp(t){"@babel/helpers - typeof";return Qp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qp(t)}function yT(){return yT=Object.assign?Object.assign.bind():function(t){for(var e=1;e180),",").concat(+(a>c),`, `).concat(d.x,",").concat(d.y,` `);if(i>0){var p=vr(n,r,i,a),y=vr(n,r,i,c);f+="L ".concat(y.x,",").concat(y.y,` A `).concat(i,",").concat(i,`,0, `).concat(+(Math.abs(l)>180),",").concat(+(a<=c),`, - `).concat(p.x,",").concat(p.y," Z")}else f+="L ".concat(n,",").concat(r," Z");return f},qAe=function(e){var n=e.cx,r=e.cy,i=e.innerRadius,o=e.outerRadius,a=e.cornerRadius,s=e.forceCornerRadius,l=e.cornerIsExternal,c=e.startAngle,u=e.endAngle,d=Do(u-c),f=vv({cx:n,cy:r,radius:o,angle:c,sign:d,cornerRadius:a,cornerIsExternal:l}),p=f.circleTangency,y=f.lineTangency,v=f.theta,g=vv({cx:n,cy:r,radius:o,angle:u,sign:-d,cornerRadius:a,cornerIsExternal:l}),m=g.circleTangency,x=g.lineTangency,b=g.theta,S=l?Math.abs(c-u):Math.abs(c-u)-v-b;if(S<0)return s?"M ".concat(y.x,",").concat(y.y,` + `).concat(p.x,",").concat(p.y," Z")}else f+="L ".concat(n,",").concat(r," Z");return f},YAe=function(e){var n=e.cx,r=e.cy,i=e.innerRadius,o=e.outerRadius,a=e.cornerRadius,s=e.forceCornerRadius,l=e.cornerIsExternal,c=e.startAngle,u=e.endAngle,d=Lo(u-c),f=vv({cx:n,cy:r,radius:o,angle:c,sign:d,cornerRadius:a,cornerIsExternal:l}),p=f.circleTangency,y=f.lineTangency,v=f.theta,g=vv({cx:n,cy:r,radius:o,angle:u,sign:-d,cornerRadius:a,cornerIsExternal:l}),m=g.circleTangency,x=g.lineTangency,b=g.theta,S=l?Math.abs(c-u):Math.abs(c-u)-v-b;if(S<0)return s?"M ".concat(y.x,",").concat(y.y,` a`).concat(a,",").concat(a,",0,0,1,").concat(a*2,`,0 a`).concat(a,",").concat(a,",0,0,1,").concat(-a*2,`,0 - `):hV({cx:n,cy:r,innerRadius:i,outerRadius:o,startAngle:c,endAngle:u});var w="M ".concat(y.x,",").concat(y.y,` + `):mV({cx:n,cy:r,innerRadius:i,outerRadius:o,startAngle:c,endAngle:u});var w="M ".concat(y.x,",").concat(y.y,` A`).concat(a,",").concat(a,",0,0,").concat(+(d<0),",").concat(p.x,",").concat(p.y,` A`).concat(o,",").concat(o,",0,").concat(+(S>180),",").concat(+(d<0),",").concat(m.x,",").concat(m.y,` A`).concat(a,",").concat(a,",0,0,").concat(+(d<0),",").concat(x.x,",").concat(x.y,` `);if(i>0){var E=vv({cx:n,cy:r,radius:i,angle:c,sign:d,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),T=E.circleTangency,A=E.lineTangency,M=E.theta,C=vv({cx:n,cy:r,radius:i,angle:u,sign:-d,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),P=C.circleTangency,R=C.lineTangency,D=C.theta,k=l?Math.abs(c-u):Math.abs(c-u)-M-D;if(k<0&&a===0)return"".concat(w,"L").concat(n,",").concat(r,"Z");w+="L".concat(R.x,",").concat(R.y,` A`).concat(a,",").concat(a,",0,0,").concat(+(d<0),",").concat(P.x,",").concat(P.y,` A`).concat(i,",").concat(i,",0,").concat(+(k>180),",").concat(+(d>0),",").concat(T.x,",").concat(T.y,` - A`).concat(a,",").concat(a,",0,0,").concat(+(d<0),",").concat(A.x,",").concat(A.y,"Z")}else w+="L".concat(n,",").concat(r,"Z");return w},KAe={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},pV=function(e){var n=rL(rL({},KAe),e),r=n.cx,i=n.cy,o=n.innerRadius,a=n.outerRadius,s=n.cornerRadius,l=n.forceCornerRadius,c=n.cornerIsExternal,u=n.startAngle,d=n.endAngle,f=n.className;if(a0&&Math.abs(u-d)<360?g=qAe({cx:r,cy:i,innerRadius:o,outerRadius:a,cornerRadius:Math.min(v,y/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:d}):g=hV({cx:r,cy:i,innerRadius:o,outerRadius:a,startAngle:u,endAngle:d}),Z.createElement("path",yT({},$t(n,!0),{className:p,d:g,role:"img"}))};function em(t){"@babel/helpers - typeof";return em=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},em(t)}function xT(){return xT=Object.assign?Object.assign.bind():function(t){for(var e=1;e0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function pCe(t,e){return Jc(t.getTime(),e.getTime())}function mCe(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function gCe(t,e){return t===e}function dL(t,e,n){var r=t.size;if(r!==e.size)return!1;if(!r)return!0;for(var i=new Array(r),o=t.entries(),a,s,l=0;(a=o.next())&&!a.done;){for(var c=e.entries(),u=!1,d=0;(s=c.next())&&!s.done;){if(i[d]){d++;continue}var f=a.value,p=s.value;if(n.equals(f[0],p[0],l,d,t,e,n)&&n.equals(f[1],p[1],f[0],p[0],t,e,n)){u=i[d]=!0;break}d++}if(!u)return!1;l++}return!0}var vCe=Jc;function yCe(t,e,n){var r=uL(t),i=r.length;if(uL(e).length!==i)return!1;for(;i-- >0;)if(!yV(t,e,n,r[i]))return!1;return!0}function bh(t,e,n){var r=lL(t),i=r.length;if(lL(e).length!==i)return!1;for(var o,a,s;i-- >0;)if(o=r[i],!yV(t,e,n,o)||(a=cL(t,o),s=cL(e,o),(a||s)&&(!a||!s||a.configurable!==s.configurable||a.enumerable!==s.enumerable||a.writable!==s.writable)))return!1;return!0}function xCe(t,e){return Jc(t.valueOf(),e.valueOf())}function bCe(t,e){return t.source===e.source&&t.flags===e.flags}function fL(t,e,n){var r=t.size;if(r!==e.size)return!1;if(!r)return!0;for(var i=new Array(r),o=t.values(),a,s;(a=o.next())&&!a.done;){for(var l=e.values(),c=!1,u=0;(s=l.next())&&!s.done;){if(!i[u]&&n.equals(a.value,s.value,a.value,s.value,t,e,n)){c=i[u]=!0;break}u++}if(!c)return!1}return!0}function _Ce(t,e){var n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}function wCe(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function yV(t,e,n,r){return(r===fCe||r===dCe||r===uCe)&&(t.$$typeof||e.$$typeof)?!0:cCe(e,r)&&n.equals(t[r],e[r],r,r,t,e,n)}var SCe="[object Arguments]",ECe="[object Boolean]",TCe="[object Date]",MCe="[object Error]",ACe="[object Map]",CCe="[object Number]",PCe="[object Object]",RCe="[object RegExp]",NCe="[object Set]",OCe="[object String]",ICe="[object URL]",DCe=Array.isArray,hL=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,pL=Object.assign,LCe=Object.prototype.toString.call.bind(Object.prototype.toString);function kCe(t){var e=t.areArraysEqual,n=t.areDatesEqual,r=t.areErrorsEqual,i=t.areFunctionsEqual,o=t.areMapsEqual,a=t.areNumbersEqual,s=t.areObjectsEqual,l=t.arePrimitiveWrappersEqual,c=t.areRegExpsEqual,u=t.areSetsEqual,d=t.areTypedArraysEqual,f=t.areUrlsEqual;return function(y,v,g){if(y===v)return!0;if(y==null||v==null)return!1;var m=typeof y;if(m!==typeof v)return!1;if(m!=="object")return m==="number"?a(y,v,g):m==="function"?i(y,v,g):!1;var x=y.constructor;if(x!==v.constructor)return!1;if(x===Object)return s(y,v,g);if(DCe(y))return e(y,v,g);if(hL!=null&&hL(y))return d(y,v,g);if(x===Date)return n(y,v,g);if(x===RegExp)return c(y,v,g);if(x===Map)return o(y,v,g);if(x===Set)return u(y,v,g);var b=LCe(y);return b===TCe?n(y,v,g):b===RCe?c(y,v,g):b===ACe?o(y,v,g):b===NCe?u(y,v,g):b===PCe?typeof y.then!="function"&&typeof v.then!="function"&&s(y,v,g):b===ICe?f(y,v,g):b===MCe?r(y,v,g):b===SCe?s(y,v,g):b===ECe||b===CCe||b===OCe?l(y,v,g):!1}}function jCe(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,i={areArraysEqual:r?bh:hCe,areDatesEqual:pCe,areErrorsEqual:mCe,areFunctionsEqual:gCe,areMapsEqual:r?sL(dL,bh):dL,areNumbersEqual:vCe,areObjectsEqual:r?bh:yCe,arePrimitiveWrappersEqual:xCe,areRegExpsEqual:bCe,areSetsEqual:r?sL(fL,bh):fL,areTypedArraysEqual:r?bh:_Ce,areUrlsEqual:wCe};if(n&&(i=pL({},i,n(i))),e){var o=xv(i.areArraysEqual),a=xv(i.areMapsEqual),s=xv(i.areObjectsEqual),l=xv(i.areSetsEqual);i=pL({},i,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:s,areSetsEqual:l})}return i}function UCe(t){return function(e,n,r,i,o,a,s){return t(e,n,s)}}function FCe(t){var e=t.circular,n=t.comparator,r=t.createState,i=t.equals,o=t.strict;if(r)return function(l,c){var u=r(),d=u.cache,f=d===void 0?e?new WeakMap:void 0:d,p=u.meta;return n(l,c,{cache:f,equals:i,meta:p,strict:o})};if(e)return function(l,c){return n(l,c,{cache:new WeakMap,equals:i,meta:void 0,strict:o})};var a={cache:void 0,equals:i,meta:void 0,strict:o};return function(l,c){return n(l,c,a)}}var BCe=Nl();Nl({strict:!0});Nl({circular:!0});Nl({circular:!0,strict:!0});Nl({createInternalComparator:function(){return Jc}});Nl({strict:!0,createInternalComparator:function(){return Jc}});Nl({circular:!0,createInternalComparator:function(){return Jc}});Nl({circular:!0,createInternalComparator:function(){return Jc},strict:!0});function Nl(t){t===void 0&&(t={});var e=t.circular,n=e===void 0?!1:e,r=t.createInternalComparator,i=t.createState,o=t.strict,a=o===void 0?!1:o,s=jCe(t),l=kCe(s),c=r?r(l):UCe(l);return FCe({circular:n,comparator:l,createState:i,equals:c,strict:a})}function $Ce(t){typeof requestAnimationFrame<"u"&&requestAnimationFrame(t)}function mL(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function i(o){n<0&&(n=o),o-n>e?(t(o),n=-1):$Ce(i)};requestAnimationFrame(r)}function _T(t){"@babel/helpers - typeof";return _T=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_T(t)}function zCe(t){return WCe(t)||GCe(t)||VCe(t)||HCe()}function HCe(){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 VCe(t,e){if(t){if(typeof t=="string")return gL(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return gL(t,e)}}function gL(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n1?1:m<0?0:m},v=function(m){for(var x=m>1?1:m,b=x,S=0;S<8;++S){var w=d(b)-x,E=p(b);if(Math.abs(w-x)0&&arguments[0]!==void 0?arguments[0]:{},n=e.stiff,r=n===void 0?100:n,i=e.damping,o=i===void 0?8:i,a=e.dt,s=a===void 0?17:a,l=function(u,d,f){var p=-(u-d)*r,y=f*o,v=f+(p-y)*s/1e3,g=f*s/1e3+u;return Math.abs(g-d)t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function SPe(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function iS(t){return APe(t)||MPe(t)||TPe(t)||EPe()}function EPe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function TPe(t,e){if(t){if(typeof t=="string")return MT(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return MT(t,e)}}function MPe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function APe(t){if(Array.isArray(t))return MT(t)}function MT(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function y0(t){return y0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},y0(t)}var us=function(t){OPe(n,t);var e=IPe(n);function n(r,i){var o;CPe(this,n),o=e.call(this,r,i);var a=o.props,s=a.isActive,l=a.attributeName,c=a.from,u=a.to,d=a.steps,f=a.children,p=a.duration;if(o.handleStyleChange=o.handleStyleChange.bind(PT(o)),o.changeStyle=o.changeStyle.bind(PT(o)),!s||p<=0)return o.state={style:{}},typeof f=="function"&&(o.state={style:u}),CT(o);if(d&&d.length)o.state={style:d[0].style};else if(c){if(typeof f=="function")return o.state={style:c},CT(o);o.state={style:l?Dh({},l,c):c}}else o.state={style:{}};return o}return RPe(n,[{key:"componentDidMount",value:function(){var i=this.props,o=i.isActive,a=i.canBegin;this.mounted=!0,!(!o||!a)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var o=this.props,a=o.isActive,s=o.canBegin,l=o.attributeName,c=o.shouldReAnimate,u=o.to,d=o.from,f=this.state.style;if(s){if(!a){var p={style:l?Dh({},l,u):u};this.state&&f&&(l&&f[l]!==u||!l&&f!==u)&&this.setState(p);return}if(!(BCe(i.to,u)&&i.canBegin&&i.isActive)){var y=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var v=y||c?d:i.to;if(this.state&&f){var g={style:l?Dh({},l,v):v};(l&&f[l]!==v||!l&&f!==v)&&this.setState(g)}this.runAnimation(mo(mo({},this.props),{},{from:v,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var o=this,a=i.from,s=i.to,l=i.duration,c=i.easing,u=i.begin,d=i.onAnimationEnd,f=i.onAnimationStart,p=bPe(a,s,cPe(c),l,this.changeStyle),y=function(){o.stopJSAnimation=p()};this.manager.start([f,u,y,l,d])}},{key:"runStepAnimation",value:function(i){var o=this,a=i.steps,s=i.begin,l=i.onAnimationStart,c=a[0],u=c.style,d=c.duration,f=d===void 0?0:d,p=function(v,g,m){if(m===0)return v;var x=g.duration,b=g.easing,S=b===void 0?"ease":b,w=g.style,E=g.properties,T=g.onAnimationEnd,A=m>0?a[m-1]:g,M=E||Object.keys(w);if(typeof S=="function"||S==="spring")return[].concat(iS(v),[o.runJSAnimation.bind(o,{from:A.style,to:w,duration:x,easing:S}),x]);var C=xL(M,x,S),P=mo(mo(mo({},A.style),w),{},{transition:C});return[].concat(iS(v),[P,x,T]).filter(JCe)};return this.manager.start([l].concat(iS(a.reduce(p,[u,Math.max(f,s)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=XCe());var o=i.begin,a=i.duration,s=i.attributeName,l=i.to,c=i.easing,u=i.onAnimationStart,d=i.onAnimationEnd,f=i.steps,p=i.children,y=this.manager;if(this.unSubscribe=y.subscribe(this.handleStyleChange),typeof c=="function"||typeof p=="function"||c==="spring"){this.runJSAnimation(i);return}if(f.length>1){this.runStepAnimation(i);return}var v=s?Dh({},s,l):l,g=xL(Object.keys(v),a,c);y.start([u,o,mo(mo({},v),{},{transition:g}),a,d])}},{key:"render",value:function(){var i=this.props,o=i.children;i.begin;var a=i.duration;i.attributeName,i.easing;var s=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var l=wPe(i,_Pe),c=_.Children.count(o),u=this.state.style;if(typeof o=="function")return o(u);if(!s||c===0||a<=0)return o;var d=function(p){var y=p.props,v=y.style,g=v===void 0?{}:v,m=y.className,x=_.cloneElement(p,mo(mo({},l),{},{style:mo(mo({},g),u),className:m}));return x};return c===1?d(_.Children.only(o)):Z.createElement("div",null,_.Children.map(o,function(f){return d(f)}))}}]),n}(_.PureComponent);us.displayName="Animate";us.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};us.propTypes={from:Jt.oneOfType([Jt.object,Jt.string]),to:Jt.oneOfType([Jt.object,Jt.string]),attributeName:Jt.string,duration:Jt.number,begin:Jt.number,easing:Jt.oneOfType([Jt.string,Jt.func]),steps:Jt.arrayOf(Jt.shape({duration:Jt.number.isRequired,style:Jt.object.isRequired,easing:Jt.oneOfType([Jt.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Jt.func]),properties:Jt.arrayOf("string"),onAnimationEnd:Jt.func})),children:Jt.oneOfType([Jt.node,Jt.func]),isActive:Jt.bool,canBegin:Jt.bool,onAnimationEnd:Jt.func,shouldReAnimate:Jt.bool,onAnimationStart:Jt.func,onAnimationReStart:Jt.func};function rm(t){"@babel/helpers - typeof";return rm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rm(t)}function x0(){return x0=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0?1:-1,l=r>=0?1:-1,c=i>=0&&r>=0||i<0&&r<0?1:0,u;if(a>0&&o instanceof Array){for(var d=[0,0,0,0],f=0,p=4;fa?a:o[f];u="M".concat(e,",").concat(n+s*d[0]),d[0]>0&&(u+="A ".concat(d[0],",").concat(d[0],",0,0,").concat(c,",").concat(e+l*d[0],",").concat(n)),u+="L ".concat(e+r-l*d[1],",").concat(n),d[1]>0&&(u+="A ".concat(d[1],",").concat(d[1],",0,0,").concat(c,`, + A`).concat(a,",").concat(a,",0,0,").concat(+(d<0),",").concat(A.x,",").concat(A.y,"Z")}else w+="L".concat(n,",").concat(r,"Z");return w},JAe={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},gV=function(e){var n=iL(iL({},JAe),e),r=n.cx,i=n.cy,o=n.innerRadius,a=n.outerRadius,s=n.cornerRadius,l=n.forceCornerRadius,c=n.cornerIsExternal,u=n.startAngle,d=n.endAngle,f=n.className;if(a0&&Math.abs(u-d)<360?g=YAe({cx:r,cy:i,innerRadius:o,outerRadius:a,cornerRadius:Math.min(v,y/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:d}):g=mV({cx:r,cy:i,innerRadius:o,outerRadius:a,startAngle:u,endAngle:d}),Q.createElement("path",yT({},$t(n,!0),{className:p,d:g,role:"img"}))};function em(t){"@babel/helpers - typeof";return em=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},em(t)}function xT(){return xT=Object.assign?Object.assign.bind():function(t){for(var e=1;e0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function gCe(t,e){return Jc(t.getTime(),e.getTime())}function vCe(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function yCe(t,e){return t===e}function fL(t,e,n){var r=t.size;if(r!==e.size)return!1;if(!r)return!0;for(var i=new Array(r),o=t.entries(),a,s,l=0;(a=o.next())&&!a.done;){for(var c=e.entries(),u=!1,d=0;(s=c.next())&&!s.done;){if(i[d]){d++;continue}var f=a.value,p=s.value;if(n.equals(f[0],p[0],l,d,t,e,n)&&n.equals(f[1],p[1],f[0],p[0],t,e,n)){u=i[d]=!0;break}d++}if(!u)return!1;l++}return!0}var xCe=Jc;function bCe(t,e,n){var r=dL(t),i=r.length;if(dL(e).length!==i)return!1;for(;i-- >0;)if(!bV(t,e,n,r[i]))return!1;return!0}function bh(t,e,n){var r=cL(t),i=r.length;if(cL(e).length!==i)return!1;for(var o,a,s;i-- >0;)if(o=r[i],!bV(t,e,n,o)||(a=uL(t,o),s=uL(e,o),(a||s)&&(!a||!s||a.configurable!==s.configurable||a.enumerable!==s.enumerable||a.writable!==s.writable)))return!1;return!0}function _Ce(t,e){return Jc(t.valueOf(),e.valueOf())}function wCe(t,e){return t.source===e.source&&t.flags===e.flags}function hL(t,e,n){var r=t.size;if(r!==e.size)return!1;if(!r)return!0;for(var i=new Array(r),o=t.values(),a,s;(a=o.next())&&!a.done;){for(var l=e.values(),c=!1,u=0;(s=l.next())&&!s.done;){if(!i[u]&&n.equals(a.value,s.value,a.value,s.value,t,e,n)){c=i[u]=!0;break}u++}if(!c)return!1}return!0}function SCe(t,e){var n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}function ECe(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function bV(t,e,n,r){return(r===pCe||r===hCe||r===fCe)&&(t.$$typeof||e.$$typeof)?!0:dCe(e,r)&&n.equals(t[r],e[r],r,r,t,e,n)}var TCe="[object Arguments]",MCe="[object Boolean]",ACe="[object Date]",CCe="[object Error]",PCe="[object Map]",RCe="[object Number]",NCe="[object Object]",OCe="[object RegExp]",ICe="[object Set]",DCe="[object String]",LCe="[object URL]",kCe=Array.isArray,pL=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,mL=Object.assign,jCe=Object.prototype.toString.call.bind(Object.prototype.toString);function UCe(t){var e=t.areArraysEqual,n=t.areDatesEqual,r=t.areErrorsEqual,i=t.areFunctionsEqual,o=t.areMapsEqual,a=t.areNumbersEqual,s=t.areObjectsEqual,l=t.arePrimitiveWrappersEqual,c=t.areRegExpsEqual,u=t.areSetsEqual,d=t.areTypedArraysEqual,f=t.areUrlsEqual;return function(y,v,g){if(y===v)return!0;if(y==null||v==null)return!1;var m=typeof y;if(m!==typeof v)return!1;if(m!=="object")return m==="number"?a(y,v,g):m==="function"?i(y,v,g):!1;var x=y.constructor;if(x!==v.constructor)return!1;if(x===Object)return s(y,v,g);if(kCe(y))return e(y,v,g);if(pL!=null&&pL(y))return d(y,v,g);if(x===Date)return n(y,v,g);if(x===RegExp)return c(y,v,g);if(x===Map)return o(y,v,g);if(x===Set)return u(y,v,g);var b=jCe(y);return b===ACe?n(y,v,g):b===OCe?c(y,v,g):b===PCe?o(y,v,g):b===ICe?u(y,v,g):b===NCe?typeof y.then!="function"&&typeof v.then!="function"&&s(y,v,g):b===LCe?f(y,v,g):b===CCe?r(y,v,g):b===TCe?s(y,v,g):b===MCe||b===RCe||b===DCe?l(y,v,g):!1}}function FCe(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,i={areArraysEqual:r?bh:mCe,areDatesEqual:gCe,areErrorsEqual:vCe,areFunctionsEqual:yCe,areMapsEqual:r?lL(fL,bh):fL,areNumbersEqual:xCe,areObjectsEqual:r?bh:bCe,arePrimitiveWrappersEqual:_Ce,areRegExpsEqual:wCe,areSetsEqual:r?lL(hL,bh):hL,areTypedArraysEqual:r?bh:SCe,areUrlsEqual:ECe};if(n&&(i=mL({},i,n(i))),e){var o=xv(i.areArraysEqual),a=xv(i.areMapsEqual),s=xv(i.areObjectsEqual),l=xv(i.areSetsEqual);i=mL({},i,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:s,areSetsEqual:l})}return i}function BCe(t){return function(e,n,r,i,o,a,s){return t(e,n,s)}}function $Ce(t){var e=t.circular,n=t.comparator,r=t.createState,i=t.equals,o=t.strict;if(r)return function(l,c){var u=r(),d=u.cache,f=d===void 0?e?new WeakMap:void 0:d,p=u.meta;return n(l,c,{cache:f,equals:i,meta:p,strict:o})};if(e)return function(l,c){return n(l,c,{cache:new WeakMap,equals:i,meta:void 0,strict:o})};var a={cache:void 0,equals:i,meta:void 0,strict:o};return function(l,c){return n(l,c,a)}}var zCe=Nl();Nl({strict:!0});Nl({circular:!0});Nl({circular:!0,strict:!0});Nl({createInternalComparator:function(){return Jc}});Nl({strict:!0,createInternalComparator:function(){return Jc}});Nl({circular:!0,createInternalComparator:function(){return Jc}});Nl({circular:!0,createInternalComparator:function(){return Jc},strict:!0});function Nl(t){t===void 0&&(t={});var e=t.circular,n=e===void 0?!1:e,r=t.createInternalComparator,i=t.createState,o=t.strict,a=o===void 0?!1:o,s=FCe(t),l=UCe(s),c=r?r(l):BCe(l);return $Ce({circular:n,comparator:l,createState:i,equals:c,strict:a})}function HCe(t){typeof requestAnimationFrame<"u"&&requestAnimationFrame(t)}function gL(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function i(o){n<0&&(n=o),o-n>e?(t(o),n=-1):HCe(i)};requestAnimationFrame(r)}function _T(t){"@babel/helpers - typeof";return _T=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_T(t)}function VCe(t){return qCe(t)||XCe(t)||WCe(t)||GCe()}function GCe(){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 WCe(t,e){if(t){if(typeof t=="string")return vL(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vL(t,e)}}function vL(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n1?1:m<0?0:m},v=function(m){for(var x=m>1?1:m,b=x,S=0;S<8;++S){var w=d(b)-x,E=p(b);if(Math.abs(w-x)0&&arguments[0]!==void 0?arguments[0]:{},n=e.stiff,r=n===void 0?100:n,i=e.damping,o=i===void 0?8:i,a=e.dt,s=a===void 0?17:a,l=function(u,d,f){var p=-(u-d)*r,y=f*o,v=f+(p-y)*s/1e3,g=f*s/1e3+u;return Math.abs(g-d)t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function TPe(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function iS(t){return PPe(t)||CPe(t)||APe(t)||MPe()}function MPe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function APe(t,e){if(t){if(typeof t=="string")return MT(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return MT(t,e)}}function CPe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function PPe(t){if(Array.isArray(t))return MT(t)}function MT(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function y0(t){return y0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},y0(t)}var us=function(t){DPe(n,t);var e=LPe(n);function n(r,i){var o;RPe(this,n),o=e.call(this,r,i);var a=o.props,s=a.isActive,l=a.attributeName,c=a.from,u=a.to,d=a.steps,f=a.children,p=a.duration;if(o.handleStyleChange=o.handleStyleChange.bind(PT(o)),o.changeStyle=o.changeStyle.bind(PT(o)),!s||p<=0)return o.state={style:{}},typeof f=="function"&&(o.state={style:u}),CT(o);if(d&&d.length)o.state={style:d[0].style};else if(c){if(typeof f=="function")return o.state={style:c},CT(o);o.state={style:l?Dh({},l,c):c}}else o.state={style:{}};return o}return OPe(n,[{key:"componentDidMount",value:function(){var i=this.props,o=i.isActive,a=i.canBegin;this.mounted=!0,!(!o||!a)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var o=this.props,a=o.isActive,s=o.canBegin,l=o.attributeName,c=o.shouldReAnimate,u=o.to,d=o.from,f=this.state.style;if(s){if(!a){var p={style:l?Dh({},l,u):u};this.state&&f&&(l&&f[l]!==u||!l&&f!==u)&&this.setState(p);return}if(!(zCe(i.to,u)&&i.canBegin&&i.isActive)){var y=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var v=y||c?d:i.to;if(this.state&&f){var g={style:l?Dh({},l,v):v};(l&&f[l]!==v||!l&&f!==v)&&this.setState(g)}this.runAnimation(mo(mo({},this.props),{},{from:v,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var o=this,a=i.from,s=i.to,l=i.duration,c=i.easing,u=i.begin,d=i.onAnimationEnd,f=i.onAnimationStart,p=wPe(a,s,dPe(c),l,this.changeStyle),y=function(){o.stopJSAnimation=p()};this.manager.start([f,u,y,l,d])}},{key:"runStepAnimation",value:function(i){var o=this,a=i.steps,s=i.begin,l=i.onAnimationStart,c=a[0],u=c.style,d=c.duration,f=d===void 0?0:d,p=function(v,g,m){if(m===0)return v;var x=g.duration,b=g.easing,S=b===void 0?"ease":b,w=g.style,E=g.properties,T=g.onAnimationEnd,A=m>0?a[m-1]:g,M=E||Object.keys(w);if(typeof S=="function"||S==="spring")return[].concat(iS(v),[o.runJSAnimation.bind(o,{from:A.style,to:w,duration:x,easing:S}),x]);var C=bL(M,x,S),P=mo(mo(mo({},A.style),w),{},{transition:C});return[].concat(iS(v),[P,x,T]).filter(QCe)};return this.manager.start([l].concat(iS(a.reduce(p,[u,Math.max(f,s)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=KCe());var o=i.begin,a=i.duration,s=i.attributeName,l=i.to,c=i.easing,u=i.onAnimationStart,d=i.onAnimationEnd,f=i.steps,p=i.children,y=this.manager;if(this.unSubscribe=y.subscribe(this.handleStyleChange),typeof c=="function"||typeof p=="function"||c==="spring"){this.runJSAnimation(i);return}if(f.length>1){this.runStepAnimation(i);return}var v=s?Dh({},s,l):l,g=bL(Object.keys(v),a,c);y.start([u,o,mo(mo({},v),{},{transition:g}),a,d])}},{key:"render",value:function(){var i=this.props,o=i.children;i.begin;var a=i.duration;i.attributeName,i.easing;var s=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var l=EPe(i,SPe),c=_.Children.count(o),u=this.state.style;if(typeof o=="function")return o(u);if(!s||c===0||a<=0)return o;var d=function(p){var y=p.props,v=y.style,g=v===void 0?{}:v,m=y.className,x=_.cloneElement(p,mo(mo({},l),{},{style:mo(mo({},g),u),className:m}));return x};return c===1?d(_.Children.only(o)):Q.createElement("div",null,_.Children.map(o,function(f){return d(f)}))}}]),n}(_.PureComponent);us.displayName="Animate";us.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};us.propTypes={from:Jt.oneOfType([Jt.object,Jt.string]),to:Jt.oneOfType([Jt.object,Jt.string]),attributeName:Jt.string,duration:Jt.number,begin:Jt.number,easing:Jt.oneOfType([Jt.string,Jt.func]),steps:Jt.arrayOf(Jt.shape({duration:Jt.number.isRequired,style:Jt.object.isRequired,easing:Jt.oneOfType([Jt.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Jt.func]),properties:Jt.arrayOf("string"),onAnimationEnd:Jt.func})),children:Jt.oneOfType([Jt.node,Jt.func]),isActive:Jt.bool,canBegin:Jt.bool,onAnimationEnd:Jt.func,shouldReAnimate:Jt.bool,onAnimationStart:Jt.func,onAnimationReStart:Jt.func};function rm(t){"@babel/helpers - typeof";return rm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rm(t)}function x0(){return x0=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0?1:-1,l=r>=0?1:-1,c=i>=0&&r>=0||i<0&&r<0?1:0,u;if(a>0&&o instanceof Array){for(var d=[0,0,0,0],f=0,p=4;fa?a:o[f];u="M".concat(e,",").concat(n+s*d[0]),d[0]>0&&(u+="A ".concat(d[0],",").concat(d[0],",0,0,").concat(c,",").concat(e+l*d[0],",").concat(n)),u+="L ".concat(e+r-l*d[1],",").concat(n),d[1]>0&&(u+="A ".concat(d[1],",").concat(d[1],",0,0,").concat(c,`, `).concat(e+r,",").concat(n+s*d[1])),u+="L ".concat(e+r,",").concat(n+i-s*d[2]),d[2]>0&&(u+="A ".concat(d[2],",").concat(d[2],",0,0,").concat(c,`, `).concat(e+r-l*d[2],",").concat(n+i)),u+="L ".concat(e+l*d[3],",").concat(n+i),d[3]>0&&(u+="A ".concat(d[3],",").concat(d[3],",0,0,").concat(c,`, `).concat(e,",").concat(n+i-s*d[3])),u+="Z"}else if(a>0&&o===+o&&o>0){var y=Math.min(a,o);u="M ".concat(e,",").concat(n+s*y,` @@ -4263,10 +4268,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho L `).concat(e+r,",").concat(n+i-s*y,` A `).concat(y,",").concat(y,",0,0,").concat(c,",").concat(e+r-l*y,",").concat(n+i,` L `).concat(e+l*y,",").concat(n+i,` - A `).concat(y,",").concat(y,",0,0,").concat(c,",").concat(e,",").concat(n+i-s*y," Z")}else u="M ".concat(e,",").concat(n," h ").concat(r," v ").concat(i," h ").concat(-r," Z");return u},HPe=function(e,n){if(!e||!n)return!1;var r=e.x,i=e.y,o=n.x,a=n.y,s=n.width,l=n.height;if(Math.abs(s)>0&&Math.abs(l)>0){var c=Math.min(o,o+s),u=Math.max(o,o+s),d=Math.min(a,a+l),f=Math.max(a,a+l);return r>=c&&r<=u&&i>=d&&i<=f}return!1},VPe={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},vP=function(e){var n=AL(AL({},VPe),e),r=_.useRef(),i=_.useState(-1),o=LPe(i,2),a=o[0],s=o[1];_.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var S=r.current.getTotalLength();S&&s(S)}catch{}},[]);var l=n.x,c=n.y,u=n.width,d=n.height,f=n.radius,p=n.className,y=n.animationEasing,v=n.animationDuration,g=n.animationBegin,m=n.isAnimationActive,x=n.isUpdateAnimationActive;if(l!==+l||c!==+c||u!==+u||d!==+d||u===0||d===0)return null;var b=zt("recharts-rectangle",p);return x?Z.createElement(us,{canBegin:a>0,from:{width:u,height:d,x:l,y:c},to:{width:u,height:d,x:l,y:c},duration:v,animationEasing:y,isActive:x},function(S){var w=S.width,E=S.height,T=S.x,A=S.y;return Z.createElement(us,{canBegin:a>0,from:"0px ".concat(a===-1?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:v,isActive:m,easing:y},Z.createElement("path",x0({},$t(n,!0),{className:b,d:CL(T,A,w,E,f),ref:r})))}):Z.createElement("path",x0({},$t(n,!0),{className:b,d:CL(l,c,u,d,f)}))};function RT(){return RT=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function JPe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}var ZPe=function(e,n,r,i,o,a){return"M".concat(e,",").concat(o,"v").concat(i,"M").concat(a,",").concat(n,"h").concat(r)},QPe=function(e){var n=e.x,r=n===void 0?0:n,i=e.y,o=i===void 0?0:i,a=e.top,s=a===void 0?0:a,l=e.left,c=l===void 0?0:l,u=e.width,d=u===void 0?0:u,f=e.height,p=f===void 0?0:f,y=e.className,v=YPe(e,GPe),g=WPe({x:r,y:o,top:s,left:c,width:d,height:p},v);return!ze(r)||!ze(o)||!ze(d)||!ze(p)||!ze(s)||!ze(c)?null:Z.createElement("path",NT({},$t(g,!0),{className:zt("recharts-cross",y),d:ZPe(r,o,d,p,s,c)}))},eRe=B5,tRe=eRe(Object.getPrototypeOf,Object),nRe=tRe,rRe=hs,iRe=nRe,oRe=ps,aRe="[object Object]",sRe=Function.prototype,lRe=Object.prototype,TV=sRe.toString,cRe=lRe.hasOwnProperty,uRe=TV.call(Object);function dRe(t){if(!oRe(t)||rRe(t)!=aRe)return!1;var e=iRe(t);if(e===null)return!0;var n=cRe.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&TV.call(n)==uRe}var fRe=dRe;const hRe=dn(fRe);var pRe=hs,mRe=ps,gRe="[object Boolean]";function vRe(t){return t===!0||t===!1||mRe(t)&&pRe(t)==gRe}var yRe=vRe;const xRe=dn(yRe);function om(t){"@babel/helpers - typeof";return om=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},om(t)}function b0(){return b0=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n0,from:{upperWidth:0,lowerWidth:0,height:f,x:l,y:c},to:{upperWidth:u,lowerWidth:d,height:f,x:l,y:c},duration:v,animationEasing:y,isActive:m},function(b){var S=b.upperWidth,w=b.lowerWidth,E=b.height,T=b.x,A=b.y;return Z.createElement(us,{canBegin:a>0,from:"0px ".concat(a===-1?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:v,easing:y},Z.createElement("path",b0({},$t(n,!0),{className:x,d:IL(T,A,S,w,E),ref:r})))}):Z.createElement("g",null,Z.createElement("path",b0({},$t(n,!0),{className:x,d:IL(l,c,u,d,f)})))},RRe=["option","shapeType","propTransformer","activeClassName","isActive"];function am(t){"@babel/helpers - typeof";return am=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},am(t)}function NRe(t,e){if(t==null)return{};var n=ORe(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function ORe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function DL(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 _0(t){for(var e=1;e0&&r.handleDrag(i.changedTouches[0])}),wi(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=r.props,o=i.endIndex,a=i.onDragEnd,s=i.startIndex;a==null||a({endIndex:o,startIndex:s})}),r.detachDragEndListener()}),wi(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),wi(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),wi(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),wi(r,"handleSlideDragStart",function(i){var o=$L(i)?i.changedTouches[0]:i;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:o.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return vNe(e,t),hNe(e,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var i=r.startX,o=r.endX,a=this.state.scaleValues,s=this.props,l=s.gap,c=s.data,u=c.length-1,d=Math.min(i,o),f=Math.max(i,o),p=e.getIndexInRange(a,d),y=e.getIndexInRange(a,f);return{startIndex:p-p%l,endIndex:y===u?u:y-y%l}}},{key:"getTextOfTick",value:function(r){var i=this.props,o=i.data,a=i.tickFormatter,s=i.dataKey,l=Di(o[r],s,r);return jt(a)?a(l,r):l}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var i=this.state,o=i.slideMoveStartX,a=i.startX,s=i.endX,l=this.props,c=l.x,u=l.width,d=l.travellerWidth,f=l.startIndex,p=l.endIndex,y=l.onChange,v=r.pageX-o;v>0?v=Math.min(v,c+u-d-s,c+u-d-a):v<0&&(v=Math.max(v,c-a,c-s));var g=this.getIndex({startX:a+v,endX:s+v});(g.startIndex!==f||g.endIndex!==p)&&y&&y(g),this.setState({startX:a+v,endX:s+v,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,i){var o=$L(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:o.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var i=this.state,o=i.brushMoveStartX,a=i.movingTravellerId,s=i.endX,l=i.startX,c=this.state[a],u=this.props,d=u.x,f=u.width,p=u.travellerWidth,y=u.onChange,v=u.gap,g=u.data,m={startX:this.state.startX,endX:this.state.endX},x=r.pageX-o;x>0?x=Math.min(x,d+f-p-c):x<0&&(x=Math.max(x,d-c)),m[a]=c+x;var b=this.getIndex(m),S=b.startIndex,w=b.endIndex,E=function(){var A=g.length-1;return a==="startX"&&(s>l?S%v===0:w%v===0)||sl?w%v===0:S%v===0)||s>l&&w===A};this.setState(wi(wi({},a,c+x),"brushMoveStartX",r.pageX),function(){y&&E()&&y(b)})}},{key:"handleTravellerMoveKeyboard",value:function(r,i){var o=this,a=this.state,s=a.scaleValues,l=a.startX,c=a.endX,u=this.state[i],d=s.indexOf(u);if(d!==-1){var f=d+r;if(!(f===-1||f>=s.length)){var p=s[f];i==="startX"&&p>=c||i==="endX"&&p<=l||this.setState(wi({},i,p),function(){o.props.onChange(o.getIndex({startX:o.state.startX,endX:o.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,i=r.x,o=r.y,a=r.width,s=r.height,l=r.fill,c=r.stroke;return Z.createElement("rect",{stroke:c,fill:l,x:i,y:o,width:a,height:s})}},{key:"renderPanorama",value:function(){var r=this.props,i=r.x,o=r.y,a=r.width,s=r.height,l=r.data,c=r.children,u=r.padding,d=_.Children.only(c);return d?Z.cloneElement(d,{x:i,y:o,width:a,height:s,margin:u,compact:!0,data:l}):null}},{key:"renderTravellerLayer",value:function(r,i){var o,a,s=this,l=this.props,c=l.y,u=l.travellerWidth,d=l.height,f=l.traveller,p=l.ariaLabel,y=l.data,v=l.startIndex,g=l.endIndex,m=Math.max(r,this.props.x),x=aS(aS({},$t(this.props,!1)),{},{x:m,y:c,width:u,height:d}),b=p||"Min value: ".concat((o=y[v])===null||o===void 0?void 0:o.name,", Max value: ").concat((a=y[g])===null||a===void 0?void 0:a.name);return Z.createElement(kn,{tabIndex:0,role:"slider","aria-label":b,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(w){["ArrowLeft","ArrowRight"].includes(w.key)&&(w.preventDefault(),w.stopPropagation(),s.handleTravellerMoveKeyboard(w.key==="ArrowRight"?1:-1,i))},onFocus:function(){s.setState({isTravellerFocused:!0})},onBlur:function(){s.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},e.renderTraveller(f,x))}},{key:"renderSlide",value:function(r,i){var o=this.props,a=o.y,s=o.height,l=o.stroke,c=o.travellerWidth,u=Math.min(r,i)+c,d=Math.max(Math.abs(i-r)-c,0);return Z.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:l,fillOpacity:.2,x:u,y:a,width:d,height:s})}},{key:"renderText",value:function(){var r=this.props,i=r.startIndex,o=r.endIndex,a=r.y,s=r.height,l=r.travellerWidth,c=r.stroke,u=this.state,d=u.startX,f=u.endX,p=5,y={pointerEvents:"none",fill:c};return Z.createElement(kn,{className:"recharts-brush-texts"},Z.createElement(Qy,S0({textAnchor:"end",verticalAnchor:"middle",x:Math.min(d,f)-p,y:a+s/2},y),this.getTextOfTick(i)),Z.createElement(Qy,S0({textAnchor:"start",verticalAnchor:"middle",x:Math.max(d,f)+l+p,y:a+s/2},y),this.getTextOfTick(o)))}},{key:"render",value:function(){var r=this.props,i=r.data,o=r.className,a=r.children,s=r.x,l=r.y,c=r.width,u=r.height,d=r.alwaysShowText,f=this.state,p=f.startX,y=f.endX,v=f.isTextActive,g=f.isSlideMoving,m=f.isTravellerMoving,x=f.isTravellerFocused;if(!i||!i.length||!ze(s)||!ze(l)||!ze(c)||!ze(u)||c<=0||u<=0)return null;var b=zt("recharts-brush",o),S=Z.Children.count(a)===1,w=dNe("userSelect","none");return Z.createElement(kn,{className:b,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:w},this.renderBackground(),S&&this.renderPanorama(),this.renderSlide(p,y),this.renderTravellerLayer(p,"startX"),this.renderTravellerLayer(y,"endX"),(v||g||m||x||d)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var i=r.x,o=r.y,a=r.width,s=r.height,l=r.stroke,c=Math.floor(o+s/2)-1;return Z.createElement(Z.Fragment,null,Z.createElement("rect",{x:i,y:o,width:a,height:s,fill:l,stroke:"none"}),Z.createElement("line",{x1:i+1,y1:c,x2:i+a-1,y2:c,fill:"none",stroke:"#fff"}),Z.createElement("line",{x1:i+1,y1:c+2,x2:i+a-1,y2:c+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,i){var o;return Z.isValidElement(r)?o=Z.cloneElement(r,i):jt(r)?o=r(i):o=e.renderDefaultTraveller(i),o}},{key:"getDerivedStateFromProps",value:function(r,i){var o=r.data,a=r.width,s=r.x,l=r.travellerWidth,c=r.updateId,u=r.startIndex,d=r.endIndex;if(o!==i.prevData||c!==i.prevUpdateId)return aS({prevData:o,prevTravellerWidth:l,prevUpdateId:c,prevX:s,prevWidth:a},o&&o.length?xNe({data:o,width:a,x:s,travellerWidth:l,startIndex:u,endIndex:d}):{scale:null,scaleValues:null});if(i.scale&&(a!==i.prevWidth||s!==i.prevX||l!==i.prevTravellerWidth)){i.scale.range([s,s+a-l]);var f=i.scale.domain().map(function(p){return i.scale(p)});return{prevData:o,prevTravellerWidth:l,prevUpdateId:c,prevX:s,prevWidth:a,startX:i.scale(r.startIndex),endX:i.scale(r.endIndex),scaleValues:f}}return null}},{key:"getIndexInRange",value:function(r,i){for(var o=r.length,a=0,s=o-1;s-a>1;){var l=Math.floor((a+s)/2);r[l]>i?s=l:a=l}return i>=r[s]?s:a}}])}(_.PureComponent);wi(ef,"displayName","Brush");wi(ef,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var bNe=HC;function _Ne(t,e){var n;return bNe(t,function(r,i,o){return n=e(r,i,o),!n}),!!n}var wNe=_Ne,SNe=O5,ENe=kf,TNe=wNe,MNe=yi,ANe=Eb;function CNe(t,e,n){var r=MNe(t)?SNe:TNe;return n&&ANe(t,e,n)&&(e=void 0),r(t,ENe(e))}var PNe=CNe;const RNe=dn(PNe);var ya=function(e,n){var r=e.alwaysShow,i=e.ifOverflow;return r&&(i="extendDomain"),i===n},zL=Q5;function NNe(t,e,n){e=="__proto__"&&zL?zL(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var ONe=NNe,INe=ONe,DNe=J5,LNe=kf;function kNe(t,e){var n={};return e=LNe(e),DNe(t,function(r,i,o){INe(n,i,e(r,i,o))}),n}var jNe=kNe;const UNe=dn(jNe);function FNe(t,e){for(var n=-1,r=t==null?0:t.length;++n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function rOe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function iOe(t,e){var n=t.x,r=t.y,i=nOe(t,ZNe),o="".concat(n),a=parseInt(o,10),s="".concat(r),l=parseInt(s,10),c="".concat(e.height||i.height),u=parseInt(c,10),d="".concat(e.width||i.width),f=parseInt(d,10);return _h(_h(_h(_h(_h({},e),i),a?{x:a}:{}),l?{y:l}:{}),{},{height:u,width:f,name:e.name,radius:e.radius})}function VL(t){return Z.createElement(FRe,IT({shapeType:"rectangle",propTransformer:iOe,activeClassName:"recharts-active-bar"},t))}var oOe=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,i){if(typeof e=="number")return e;var o=typeof r=="number";return o?e(r,i):(o||jc(),n)}},aOe=["value","background"],PV;function tf(t){"@babel/helpers - typeof";return tf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tf(t)}function sOe(t,e){if(t==null)return{};var n=lOe(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function lOe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function T0(){return T0=Object.assign?Object.assign.bind():function(t){for(var e=1;e0&&Math.abs(U)0&&Math.abs(k)0&&(D=Math.min((q||0)-(k[ee-1]||0),D))}),Number.isFinite(D)){var U=D/R,O=v.layout==="vertical"?r.height:r.width;if(v.padding==="gap"&&(T=U*O/2),v.padding==="no-gap"){var W=Lc(e.barCategoryGap,U*O),L=U*O/2;T=L-W-(L-W)/O*W}}}i==="xAxis"?A=[r.left+(b.left||0)+(T||0),r.left+r.width-(b.right||0)-(T||0)]:i==="yAxis"?A=l==="horizontal"?[r.top+r.height-(b.bottom||0),r.top+(b.top||0)]:[r.top+(b.top||0)+(T||0),r.top+r.height-(b.bottom||0)-(T||0)]:A=v.range,w&&(A=[A[1],A[0]]);var j=$Me(v,o,f),X=j.scale,K=j.realScaleType;X.domain(m).range(A),zMe(X);var F=YMe(X,Eo(Eo({},v),{},{realScaleType:K}));i==="xAxis"?(P=g==="top"&&!S||g==="bottom"&&S,M=r.left,C=d[E]-P*v.height):i==="yAxis"&&(P=g==="left"&&!S||g==="right"&&S,M=d[E]-P*v.width,C=r.top);var Y=Eo(Eo(Eo({},v),F),{},{realScaleType:K,x:M,y:C,scale:X,width:i==="xAxis"?r.width:v.width,height:i==="yAxis"?r.height:v.height});return Y.bandSize=h0(Y,F),!v.hide&&i==="xAxis"?d[E]+=(P?-1:1)*Y.height:v.hide||(d[E]+=(P?-1:1)*Y.width),Eo(Eo({},p),{},Ub({},y,Y))},{})},IV=function(e,n){var r=e.x,i=e.y,o=n.x,a=n.y;return{x:Math.min(r,o),y:Math.min(i,a),width:Math.abs(o-r),height:Math.abs(a-i)}},bOe=function(e){var n=e.x1,r=e.y1,i=e.x2,o=e.y2;return IV({x:n,y:r},{x:i,y:o})},DV=function(){function t(e){gOe(this,t),this.scale=e}return vOe(t,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.bandAware,o=r.position;if(n!==void 0){if(o)switch(o){case"start":return this.scale(n);case"middle":{var a=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+a}case"end":{var s=this.bandwidth?this.bandwidth():0;return this.scale(n)+s}default:return this.scale(n)}if(i){var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+l}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),i=r[0],o=r[r.length-1];return i<=o?n>=i&&n<=o:n>=o&&n<=i}}],[{key:"create",value:function(n){return new t(n)}}])}();Ub(DV,"EPS",1e-4);var xP=function(e){var n=Object.keys(e).reduce(function(r,i){return Eo(Eo({},r),{},Ub({},i,DV.create(e[i])))},{});return Eo(Eo({},n),{},{apply:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=o.bandAware,s=o.position;return UNe(i,function(l,c){return n[c].apply(l,{bandAware:a,position:s})})},isInRange:function(i){return JNe(i,function(o,a){return n[a].isInRange(o)})}})};function _Oe(t){return(t%180+180)%180}var wOe=function(e){var n=e.width,r=e.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=_Oe(i),a=o*Math.PI/180,s=Math.atan(r/n),l=a>s&&at.length)&&(e=t.length);for(var n=0,r=new Array(e);nt*i)return!1;var o=n();return t*(e-t*o/2-r)>=0&&t*(e+t*o/2-i)<=0}function c2e(t,e){return JV(t,e+1)}function u2e(t,e,n,r,i){for(var o=(r||[]).slice(),a=e.start,s=e.end,l=0,c=1,u=a,d=function(){var y=r==null?void 0:r[l];if(y===void 0)return{v:JV(r,c)};var v=l,g,m=function(){return g===void 0&&(g=n(y,v)),g},x=y.coordinate,b=l===0||R0(t,x,m,u,s);b||(l=0,u=a,c+=1),b&&(u=x+t*(m()/2+i),l+=c)},f;c<=o.length;)if(f=d(),f)return f.v;return[]}function dm(t){"@babel/helpers - typeof";return dm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},dm(t)}function rk(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 Pr(t){for(var e=1;e0?p.coordinate-g*t:p.coordinate})}else o[f]=p=Pr(Pr({},p),{},{tickCoord:p.coordinate});var m=R0(t,p.tickCoord,v,s,l);m&&(l=p.tickCoord-t*(v()/2+i),o[f]=Pr(Pr({},p),{},{isShow:!0}))},u=a-1;u>=0;u--)c(u);return o}function m2e(t,e,n,r,i,o){var a=(r||[]).slice(),s=a.length,l=e.start,c=e.end;if(o){var u=r[s-1],d=n(u,s-1),f=t*(u.coordinate+t*d/2-c);a[s-1]=u=Pr(Pr({},u),{},{tickCoord:f>0?u.coordinate-f*t:u.coordinate});var p=R0(t,u.tickCoord,function(){return d},l,c);p&&(c=u.tickCoord-t*(d/2+i),a[s-1]=Pr(Pr({},u),{},{isShow:!0}))}for(var y=o?s-1:s,v=function(x){var b=a[x],S,w=function(){return S===void 0&&(S=n(b,x)),S};if(x===0){var E=t*(b.coordinate-t*w()/2-l);a[x]=b=Pr(Pr({},b),{},{tickCoord:E<0?b.coordinate-E*t:b.coordinate})}else a[x]=b=Pr(Pr({},b),{},{tickCoord:b.coordinate});var T=R0(t,b.tickCoord,w,l,c);T&&(l=b.tickCoord+t*(w()/2+i),a[x]=Pr(Pr({},b),{},{isShow:!0}))},g=0;g=2?Do(i[1].coordinate-i[0].coordinate):1,m=l2e(o,g,p);return l==="equidistantPreserveStart"?u2e(g,m,v,i,a):(l==="preserveStart"||l==="preserveStartEnd"?f=m2e(g,m,v,i,a,l==="preserveStartEnd"):f=p2e(g,m,v,i,a),f.filter(function(x){return x.isShow}))}var v2e=["viewBox"],y2e=["viewBox"],x2e=["ticks"];function af(t){"@babel/helpers - typeof";return af=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},af(t)}function Xu(){return Xu=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function b2e(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function _2e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ok(t,e){for(var n=0;n0?l(this.props):l(p)),a<=0||s<=0||!y||!y.length?null:Z.createElement(kn,{className:zt("recharts-cartesian-axis",c),ref:function(g){r.layerReference=g}},o&&this.renderAxisLine(),this.renderTicks(y,this.state.fontSize,this.state.letterSpacing),Nr.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,i,o){var a;return Z.isValidElement(r)?a=Z.cloneElement(r,i):jt(r)?a=r(i):a=Z.createElement(Qy,Xu({},i,{className:"recharts-cartesian-axis-tick-value"}),o),a}}])}(_.Component);wP(Hb,"displayName","CartesianAxis");wP(Hb,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var C2e=["type","layout","connectNulls","ref"],P2e=["key"];function sf(t){"@babel/helpers - typeof";return sf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},sf(t)}function ak(t,e){if(t==null)return{};var n=R2e(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function R2e(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function Zh(){return Zh=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);nd){p=[].concat(Tu(l.slice(0,y)),[d-v]);break}var g=p.length%2===0?[0,f]:[f];return[].concat(Tu(e.repeat(l,u)),Tu(p),g).map(function(m){return"".concat(m,"px")}).join(", ")}),To(n,"id",$m("recharts-line-")),To(n,"pathRef",function(a){n.mainCurve=a}),To(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),To(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return B2e(e,t),k2e(e,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();this.setState({totalLength:r})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();r!==this.state.totalLength&&this.setState({totalLength:r})}}},{key:"getTotalLength",value:function(){var r=this.mainCurve;try{return r&&r.getTotalLength&&r.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(r,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,a=o.points,s=o.xAxis,l=o.yAxis,c=o.layout,u=o.children,d=ro(u,Wm);if(!d)return null;var f=function(v,g){return{x:v.x,y:v.y,value:v.value,errorVal:Di(v.payload,g)}},p={clipPath:r?"url(#clipPath-".concat(i,")"):null};return Z.createElement(kn,p,d.map(function(y){return Z.cloneElement(y,{key:"bar-".concat(y.props.dataKey),data:a,xAxis:s,yAxis:l,layout:c,dataPointFormatter:f})}))}},{key:"renderDots",value:function(r,i,o){var a=this.props.isAnimationActive;if(a&&!this.state.isAnimationFinished)return null;var s=this.props,l=s.dot,c=s.points,u=s.dataKey,d=$t(this.props,!1),f=$t(l,!0),p=c.map(function(v,g){var m=_i(_i(_i({key:"dot-".concat(g),r:3},d),f),{},{index:g,cx:v.x,cy:v.y,value:v.value,dataKey:u,payload:v.payload,points:c});return e.renderDotItem(l,m)}),y={clipPath:r?"url(#clipPath-".concat(i?"":"dots-").concat(o,")"):null};return Z.createElement(kn,Zh({className:"recharts-line-dots",key:"dots"},y),p)}},{key:"renderCurveStatically",value:function(r,i,o,a){var s=this.props,l=s.type,c=s.layout,u=s.connectNulls;s.ref;var d=ak(s,C2e),f=_i(_i(_i({},$t(d,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(o,")"):null,points:r},a),{},{type:l,layout:c,connectNulls:u});return Z.createElement(bT,Zh({},f,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,i){var o=this,a=this.props,s=a.points,l=a.strokeDasharray,c=a.isAnimationActive,u=a.animationBegin,d=a.animationDuration,f=a.animationEasing,p=a.animationId,y=a.animateNewValues,v=a.width,g=a.height,m=this.state,x=m.prevPoints,b=m.totalLength;return Z.createElement(us,{begin:u,duration:d,isActive:c,easing:f,from:{t:0},to:{t:1},key:"line-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(S){var w=S.t;if(x){var E=x.length/s.length,T=s.map(function(R,D){var k=Math.floor(D*E);if(x[k]){var U=x[k],O=Co(U.x,R.x),W=Co(U.y,R.y);return _i(_i({},R),{},{x:O(w),y:W(w)})}if(y){var L=Co(v*2,R.x),j=Co(g/2,R.y);return _i(_i({},R),{},{x:L(w),y:j(w)})}return _i(_i({},R),{},{x:R.x,y:R.y})});return o.renderCurveStatically(T,r,i)}var A=Co(0,b),M=A(w),C;if(l){var P="".concat(l).split(/[,\s]+/gim).map(function(R){return parseFloat(R)});C=o.getStrokeDasharray(M,b,P)}else C=o.generateSimpleStrokeDasharray(b,M);return o.renderCurveStatically(s,r,i,{strokeDasharray:C})})}},{key:"renderCurve",value:function(r,i){var o=this.props,a=o.points,s=o.isAnimationActive,l=this.state,c=l.prevPoints,u=l.totalLength;return s&&a&&a.length&&(!c&&u>0||!Ib(c,a))?this.renderCurveWithAnimation(r,i):this.renderCurveStatically(a,r,i)}},{key:"render",value:function(){var r,i=this.props,o=i.hide,a=i.dot,s=i.points,l=i.className,c=i.xAxis,u=i.yAxis,d=i.top,f=i.left,p=i.width,y=i.height,v=i.isAnimationActive,g=i.id;if(o||!s||!s.length)return null;var m=this.state.isAnimationFinished,x=s.length===1,b=zt("recharts-line",l),S=c&&c.allowDataOverflow,w=u&&u.allowDataOverflow,E=S||w,T=Ut(g)?this.id:g,A=(r=$t(a,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},M=A.r,C=M===void 0?3:M,P=A.strokeWidth,R=P===void 0?2:P,D=Nhe(a)?a:{},k=D.clipDot,U=k===void 0?!0:k,O=C*2+R;return Z.createElement(kn,{className:b},S||w?Z.createElement("defs",null,Z.createElement("clipPath",{id:"clipPath-".concat(T)},Z.createElement("rect",{x:S?f:f-p/2,y:w?d:d-y/2,width:S?p:p*2,height:w?y:y*2})),!U&&Z.createElement("clipPath",{id:"clipPath-dots-".concat(T)},Z.createElement("rect",{x:f-O/2,y:d-O/2,width:p+O,height:y+O}))):null,!x&&this.renderCurve(E,T),this.renderErrorBar(E,T),(x||a)&&this.renderDots(E,U,T),(!v||m)&&il.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:i.curPoints}:r.points!==i.curPoints?{curPoints:r.points}:null}},{key:"repeat",value:function(r,i){for(var o=r.length%2!==0?[].concat(Tu(r),[0]):r,a=[],s=0;st.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function PIe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function RIe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function NIe(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n0?a:e&&e.length&&ze(i)&&ze(o)?e.slice(i,o+1):[]};function mG(t){return t==="number"?[0,"auto"]:void 0}var ZT=function(e,n,r,i){var o=e.graphicalItems,a=e.tooltipAxis,s=Vb(n,e);return r<0||!o||!o.length||r>=s.length?null:o.reduce(function(l,c){var u,d=(u=c.props.data)!==null&&u!==void 0?u:n;d&&e.dataStartIndex+e.dataEndIndex!==0&&e.dataEndIndex-e.dataStartIndex>=r&&(d=d.slice(e.dataStartIndex,e.dataEndIndex+1));var f;if(a.dataKey&&!a.allowDuplicatedCategory){var p=d===void 0?s:d;f=jy(p,a.dataKey,i)}else f=d&&d[r]||s[r];return f?[].concat(ff(l),[dV(c,f)]):l},[])},pk=function(e,n,r,i){var o=i||{x:e.chartX,y:e.chartY},a=HIe(o,r),s=e.orderedTooltipTicks,l=e.tooltipAxis,c=e.tooltipTicks,u=LMe(a,s,c,l);if(u>=0&&c){var d=c[u]&&c[u].value,f=ZT(e,n,u,d),p=VIe(r,s,u,o);return{activeTooltipIndex:u,activeLabel:d,activePayload:f,activeCoordinate:p}}return null},GIe=function(e,n){var r=n.axes,i=n.graphicalItems,o=n.axisType,a=n.axisIdKey,s=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=e.layout,d=e.children,f=e.stackOffset,p=cV(u,o);return r.reduce(function(y,v){var g,m=v.type.defaultProps!==void 0?ve(ve({},v.type.defaultProps),v.props):v.props,x=m.type,b=m.dataKey,S=m.allowDataOverflow,w=m.allowDuplicatedCategory,E=m.scale,T=m.ticks,A=m.includeHidden,M=m[a];if(y[M])return y;var C=Vb(e.data,{graphicalItems:i.filter(function(F){var Y,q=a in F.props?F.props[a]:(Y=F.type.defaultProps)===null||Y===void 0?void 0:Y[a];return q===M}),dataStartIndex:l,dataEndIndex:c}),P=C.length,R,D,k;vIe(m.domain,S,x)&&(R=mT(m.domain,null,S),p&&(x==="number"||E!=="auto")&&(k=Yh(C,b,"category")));var U=mG(x);if(!R||R.length===0){var O,W=(O=m.domain)!==null&&O!==void 0?O:U;if(b){if(R=Yh(C,b,x),x==="category"&&p){var L=_he(R);w&&L?(D=R,R=w0(0,P)):w||(R=qD(W,R,v).reduce(function(F,Y){return F.indexOf(Y)>=0?F:[].concat(ff(F),[Y])},[]))}else if(x==="category")w?R=R.filter(function(F){return F!==""&&!Ut(F)}):R=qD(W,R,v).reduce(function(F,Y){return F.indexOf(Y)>=0||Y===""||Ut(Y)?F:[].concat(ff(F),[Y])},[]);else if(x==="number"){var j=BMe(C,i.filter(function(F){var Y,q,ee=a in F.props?F.props[a]:(Y=F.type.defaultProps)===null||Y===void 0?void 0:Y[a],te="hide"in F.props?F.props.hide:(q=F.type.defaultProps)===null||q===void 0?void 0:q.hide;return ee===M&&(A||!te)}),b,o,u);j&&(R=j)}p&&(x==="number"||E!=="auto")&&(k=Yh(C,b,"category"))}else p?R=w0(0,P):s&&s[M]&&s[M].hasStack&&x==="number"?R=f==="expand"?[0,1]:uV(s[M].stackGroups,l,c):R=lV(C,i.filter(function(F){var Y=a in F.props?F.props[a]:F.type.defaultProps[a],q="hide"in F.props?F.props.hide:F.type.defaultProps.hide;return Y===M&&(A||!q)}),x,u,!0);if(x==="number")R=KT(d,R,M,o,T),W&&(R=mT(W,R,S));else if(x==="category"&&W){var X=W,K=R.every(function(F){return X.indexOf(F)>=0});K&&(R=X)}}return ve(ve({},y),{},bt({},M,ve(ve({},m),{},{axisType:o,domain:R,categoricalDomain:k,duplicateDomain:D,originalDomain:(g=m.domain)!==null&&g!==void 0?g:U,isCategorical:p,layout:u})))},{})},WIe=function(e,n){var r=n.graphicalItems,i=n.Axis,o=n.axisType,a=n.axisIdKey,s=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=e.layout,d=e.children,f=Vb(e.data,{graphicalItems:r,dataStartIndex:l,dataEndIndex:c}),p=f.length,y=cV(u,o),v=-1;return r.reduce(function(g,m){var x=m.type.defaultProps!==void 0?ve(ve({},m.type.defaultProps),m.props):m.props,b=x[a],S=mG("number");if(!g[b]){v++;var w;return y?w=w0(0,p):s&&s[b]&&s[b].hasStack?(w=uV(s[b].stackGroups,l,c),w=KT(d,w,b,o)):(w=mT(S,lV(f,r.filter(function(E){var T,A,M=a in E.props?E.props[a]:(T=E.type.defaultProps)===null||T===void 0?void 0:T[a],C="hide"in E.props?E.props.hide:(A=E.type.defaultProps)===null||A===void 0?void 0:A.hide;return M===b&&!C}),"number",u),i.defaultProps.allowDataOverflow),w=KT(d,w,b,o)),ve(ve({},g),{},bt({},b,ve(ve({axisType:o},i.defaultProps),{},{hide:!0,orientation:no($Ie,"".concat(o,".").concat(v%2),null),domain:w,originalDomain:S,isCategorical:y,layout:u})))}return g},{})},XIe=function(e,n){var r=n.axisType,i=r===void 0?"xAxis":r,o=n.AxisComp,a=n.graphicalItems,s=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=e.children,d="".concat(i,"Id"),f=ro(u,o),p={};return f&&f.length?p=GIe(e,{axes:f,graphicalItems:a,axisType:i,axisIdKey:d,stackGroups:s,dataStartIndex:l,dataEndIndex:c}):a&&a.length&&(p=WIe(e,{Axis:o,graphicalItems:a,axisType:i,axisIdKey:d,stackGroups:s,dataStartIndex:l,dataEndIndex:c})),p},qIe=function(e){var n=Cu(e),r=ic(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:VC(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:h0(n,r)}},mk=function(e){var n=e.children,r=e.defaultShowTooltip,i=Ei(n,ef),o=0,a=0;return e.data&&e.data.length!==0&&(a=e.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(o=i.props.startIndex),i.props.endIndex>=0&&(a=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:a,activeTooltipIndex:-1,isTooltipActive:!!r}},KIe=function(e){return!e||!e.length?!1:e.some(function(n){var r=Za(n&&n.type);return r&&r.indexOf("Bar")>=0})},gk=function(e){return e==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:e==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:e==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},YIe=function(e,n){var r=e.props,i=e.graphicalItems,o=e.xAxisMap,a=o===void 0?{}:o,s=e.yAxisMap,l=s===void 0?{}:s,c=r.width,u=r.height,d=r.children,f=r.margin||{},p=Ei(d,ef),y=Ei(d,hd),v=Object.keys(l).reduce(function(w,E){var T=l[E],A=T.orientation;return!T.mirror&&!T.hide?ve(ve({},w),{},bt({},A,w[A]+T.width)):w},{left:f.left||0,right:f.right||0}),g=Object.keys(a).reduce(function(w,E){var T=a[E],A=T.orientation;return!T.mirror&&!T.hide?ve(ve({},w),{},bt({},A,no(w,"".concat(A))+T.height)):w},{top:f.top||0,bottom:f.bottom||0}),m=ve(ve({},g),v),x=m.bottom;p&&(m.bottom+=p.props.height||ef.defaultProps.height),y&&n&&(m=UMe(m,i,r,n));var b=c-m.left-m.right,S=u-m.top-m.bottom;return ve(ve({brushBottom:x},m),{},{width:Math.max(b,0),height:Math.max(S,0)})},JIe=function(e,n){if(n==="xAxis")return e[n].width;if(n==="yAxis")return e[n].height},ZIe=function(e){var n=e.chartName,r=e.GraphicalChild,i=e.defaultTooltipEventType,o=i===void 0?"axis":i,a=e.validateTooltipEventTypes,s=a===void 0?["axis"]:a,l=e.axisComponents,c=e.legendContent,u=e.formatAxisMap,d=e.defaultProps,f=function(m,x){var b=x.graphicalItems,S=x.stackGroups,w=x.offset,E=x.updateId,T=x.dataStartIndex,A=x.dataEndIndex,M=m.barSize,C=m.layout,P=m.barGap,R=m.barCategoryGap,D=m.maxBarSize,k=gk(C),U=k.numericAxisName,O=k.cateAxisName,W=KIe(b),L=[];return b.forEach(function(j,X){var K=Vb(m.data,{graphicalItems:[j],dataStartIndex:T,dataEndIndex:A}),F=j.type.defaultProps!==void 0?ve(ve({},j.type.defaultProps),j.props):j.props,Y=F.dataKey,q=F.maxBarSize,ee=F["".concat(U,"Id")],te=F["".concat(O,"Id")],Q={},ce=l.reduce(function(it,Ft){var J=x["".concat(Ft.axisType,"Map")],B=F["".concat(Ft.axisType,"Id")];J&&J[B]||Ft.axisType==="zAxis"||jc();var ue=J[B];return ve(ve({},it),{},bt(bt({},Ft.axisType,ue),"".concat(Ft.axisType,"Ticks"),ic(ue)))},Q),ae=ce[O],fe=ce["".concat(O,"Ticks")],we=S&&S[ee]&&S[ee].hasStack&&ZMe(j,S[ee].stackGroups),le=Za(j.type).indexOf("Bar")>=0,ie=h0(ae,fe),G=[],Ve=W&&kMe({barSize:M,stackGroups:S,totalSize:JIe(ce,O)});if(le){var Ne,st,Re=Ut(q)?D:q,ct=(Ne=(st=h0(ae,fe,!0))!==null&&st!==void 0?st:Re)!==null&&Ne!==void 0?Ne:0;G=jMe({barGap:P,barCategoryGap:R,bandSize:ct!==ie?ct:ie,sizeList:Ve[te],maxBarSize:Re}),ct!==ie&&(G=G.map(function(it){return ve(ve({},it),{},{position:ve(ve({},it.position),{},{offset:it.position.offset-ct/2})})}))}var Ye=j&&j.type&&j.type.getComposedData;Ye&&L.push({props:ve(ve({},Ye(ve(ve({},ce),{},{displayedData:K,props:m,dataKey:Y,item:j,bandSize:ie,barPosition:G,offset:w,stackedData:we,layout:C,dataStartIndex:T,dataEndIndex:A}))),{},bt(bt(bt({key:j.key||"item-".concat(X)},U,ce[U]),O,ce[O]),"animationId",E)),childIndex:Dhe(j,m.children),item:j})}),L},p=function(m,x){var b=m.props,S=m.dataStartIndex,w=m.dataEndIndex,E=m.updateId;if(!B2({props:b}))return null;var T=b.children,A=b.layout,M=b.stackOffset,C=b.data,P=b.reverseStackOrder,R=gk(A),D=R.numericAxisName,k=R.cateAxisName,U=ro(T,r),O=KMe(C,U,"".concat(D,"Id"),"".concat(k,"Id"),M,P),W=l.reduce(function(F,Y){var q="".concat(Y.axisType,"Map");return ve(ve({},F),{},bt({},q,XIe(b,ve(ve({},Y),{},{graphicalItems:U,stackGroups:Y.axisType===D&&O,dataStartIndex:S,dataEndIndex:w}))))},{}),L=YIe(ve(ve({},W),{},{props:b,graphicalItems:U}),x==null?void 0:x.legendBBox);Object.keys(W).forEach(function(F){W[F]=u(b,W[F],L,F.replace("Map",""),n)});var j=W["".concat(k,"Map")],X=qIe(j),K=f(b,ve(ve({},W),{},{dataStartIndex:S,dataEndIndex:w,updateId:E,graphicalItems:U,stackGroups:O,offset:L}));return ve(ve({formattedGraphicalItems:K,graphicalItems:U,offset:L,stackGroups:O},X),W)},y=function(g){function m(x){var b,S,w;return RIe(this,m),w=IIe(this,m,[x]),bt(w,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),bt(w,"accessibilityManager",new gIe),bt(w,"handleLegendBBoxUpdate",function(E){if(E){var T=w.state,A=T.dataStartIndex,M=T.dataEndIndex,C=T.updateId;w.setState(ve({legendBBox:E},p({props:w.props,dataStartIndex:A,dataEndIndex:M,updateId:C},ve(ve({},w.state),{},{legendBBox:E}))))}}),bt(w,"handleReceiveSyncEvent",function(E,T,A){if(w.props.syncId===E){if(A===w.eventEmitterSymbol&&typeof w.props.syncMethod!="function")return;w.applySyncEvent(T)}}),bt(w,"handleBrushChange",function(E){var T=E.startIndex,A=E.endIndex;if(T!==w.state.dataStartIndex||A!==w.state.dataEndIndex){var M=w.state.updateId;w.setState(function(){return ve({dataStartIndex:T,dataEndIndex:A},p({props:w.props,dataStartIndex:T,dataEndIndex:A,updateId:M},w.state))}),w.triggerSyncEvent({dataStartIndex:T,dataEndIndex:A})}}),bt(w,"handleMouseEnter",function(E){var T=w.getMouseInfo(E);if(T){var A=ve(ve({},T),{},{isTooltipActive:!0});w.setState(A),w.triggerSyncEvent(A);var M=w.props.onMouseEnter;jt(M)&&M(A,E)}}),bt(w,"triggeredAfterMouseMove",function(E){var T=w.getMouseInfo(E),A=T?ve(ve({},T),{},{isTooltipActive:!0}):{isTooltipActive:!1};w.setState(A),w.triggerSyncEvent(A);var M=w.props.onMouseMove;jt(M)&&M(A,E)}),bt(w,"handleItemMouseEnter",function(E){w.setState(function(){return{isTooltipActive:!0,activeItem:E,activePayload:E.tooltipPayload,activeCoordinate:E.tooltipPosition||{x:E.cx,y:E.cy}}})}),bt(w,"handleItemMouseLeave",function(){w.setState(function(){return{isTooltipActive:!1}})}),bt(w,"handleMouseMove",function(E){E.persist(),w.throttleTriggeredAfterMouseMove(E)}),bt(w,"handleMouseLeave",function(E){w.throttleTriggeredAfterMouseMove.cancel();var T={isTooltipActive:!1};w.setState(T),w.triggerSyncEvent(T);var A=w.props.onMouseLeave;jt(A)&&A(T,E)}),bt(w,"handleOuterEvent",function(E){var T=Ihe(E),A=no(w.props,"".concat(T));if(T&&jt(A)){var M,C;/.*touch.*/i.test(T)?C=w.getMouseInfo(E.changedTouches[0]):C=w.getMouseInfo(E),A((M=C)!==null&&M!==void 0?M:{},E)}}),bt(w,"handleClick",function(E){var T=w.getMouseInfo(E);if(T){var A=ve(ve({},T),{},{isTooltipActive:!0});w.setState(A),w.triggerSyncEvent(A);var M=w.props.onClick;jt(M)&&M(A,E)}}),bt(w,"handleMouseDown",function(E){var T=w.props.onMouseDown;if(jt(T)){var A=w.getMouseInfo(E);T(A,E)}}),bt(w,"handleMouseUp",function(E){var T=w.props.onMouseUp;if(jt(T)){var A=w.getMouseInfo(E);T(A,E)}}),bt(w,"handleTouchMove",function(E){E.changedTouches!=null&&E.changedTouches.length>0&&w.throttleTriggeredAfterMouseMove(E.changedTouches[0])}),bt(w,"handleTouchStart",function(E){E.changedTouches!=null&&E.changedTouches.length>0&&w.handleMouseDown(E.changedTouches[0])}),bt(w,"handleTouchEnd",function(E){E.changedTouches!=null&&E.changedTouches.length>0&&w.handleMouseUp(E.changedTouches[0])}),bt(w,"handleDoubleClick",function(E){var T=w.props.onDoubleClick;if(jt(T)){var A=w.getMouseInfo(E);T(A,E)}}),bt(w,"handleContextMenu",function(E){var T=w.props.onContextMenu;if(jt(T)){var A=w.getMouseInfo(E);T(A,E)}}),bt(w,"triggerSyncEvent",function(E){w.props.syncId!==void 0&&lS.emit(cS,w.props.syncId,E,w.eventEmitterSymbol)}),bt(w,"applySyncEvent",function(E){var T=w.props,A=T.layout,M=T.syncMethod,C=w.state.updateId,P=E.dataStartIndex,R=E.dataEndIndex;if(E.dataStartIndex!==void 0||E.dataEndIndex!==void 0)w.setState(ve({dataStartIndex:P,dataEndIndex:R},p({props:w.props,dataStartIndex:P,dataEndIndex:R,updateId:C},w.state)));else if(E.activeTooltipIndex!==void 0){var D=E.chartX,k=E.chartY,U=E.activeTooltipIndex,O=w.state,W=O.offset,L=O.tooltipTicks;if(!W)return;if(typeof M=="function")U=M(L,E);else if(M==="value"){U=-1;for(var j=0;j=0){var we,le;if(D.dataKey&&!D.allowDuplicatedCategory){var ie=typeof D.dataKey=="function"?fe:"payload.".concat(D.dataKey.toString());we=jy(j,ie,U),le=X&&K&&jy(K,ie,U)}else we=j==null?void 0:j[k],le=X&&K&&K[k];if(te||ee){var G=E.props.activeIndex!==void 0?E.props.activeIndex:k;return[_.cloneElement(E,ve(ve(ve({},M.props),ce),{},{activeIndex:G})),null,null]}if(!Ut(we))return[ae].concat(ff(w.renderActivePoints({item:M,activePoint:we,basePoint:le,childIndex:k,isRange:X})))}else{var Ve,Ne=(Ve=w.getItemByXY(w.state.activeCoordinate))!==null&&Ve!==void 0?Ve:{graphicalItem:ae},st=Ne.graphicalItem,Re=st.item,ct=Re===void 0?E:Re,Ye=st.childIndex,it=ve(ve(ve({},M.props),ce),{},{activeIndex:Ye});return[_.cloneElement(ct,it),null,null]}return X?[ae,null,null]:[ae,null]}),bt(w,"renderCustomized",function(E,T,A){return _.cloneElement(E,ve(ve({key:"recharts-customized-".concat(A)},w.props),w.state))}),bt(w,"renderMap",{CartesianGrid:{handler:_v,once:!0},ReferenceArea:{handler:w.renderReferenceElement},ReferenceLine:{handler:_v},ReferenceDot:{handler:w.renderReferenceElement},XAxis:{handler:_v},YAxis:{handler:_v},Brush:{handler:w.renderBrush,once:!0},Bar:{handler:w.renderGraphicChild},Line:{handler:w.renderGraphicChild},Area:{handler:w.renderGraphicChild},Radar:{handler:w.renderGraphicChild},RadialBar:{handler:w.renderGraphicChild},Scatter:{handler:w.renderGraphicChild},Pie:{handler:w.renderGraphicChild},Funnel:{handler:w.renderGraphicChild},Tooltip:{handler:w.renderCursor,once:!0},PolarGrid:{handler:w.renderPolarGrid,once:!0},PolarAngleAxis:{handler:w.renderPolarAxis},PolarRadiusAxis:{handler:w.renderPolarAxis},Customized:{handler:w.renderCustomized}}),w.clipPathId="".concat((b=x.id)!==null&&b!==void 0?b:$m("recharts"),"-clip"),w.throttleTriggeredAfterMouseMove=oH(w.triggeredAfterMouseMove,(S=x.throttleDelay)!==null&&S!==void 0?S:1e3/60),w.state={},w}return kIe(m,g),OIe(m,[{key:"componentDidMount",value:function(){var b,S;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(b=this.props.margin.left)!==null&&b!==void 0?b:0,top:(S=this.props.margin.top)!==null&&S!==void 0?S:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var b=this.props,S=b.children,w=b.data,E=b.height,T=b.layout,A=Ei(S,So);if(A){var M=A.props.defaultIndex;if(!(typeof M!="number"||M<0||M>this.state.tooltipTicks.length-1)){var C=this.state.tooltipTicks[M]&&this.state.tooltipTicks[M].value,P=ZT(this.state,w,M,C),R=this.state.tooltipTicks[M].coordinate,D=(this.state.offset.top+E)/2,k=T==="horizontal",U=k?{x:R,y:D}:{y:R,x:D},O=this.state.formattedGraphicalItems.find(function(L){var j=L.item;return j.type.name==="Scatter"});O&&(U=ve(ve({},U),O.props.points[M].tooltipPosition),P=O.props.points[M].tooltipPayload);var W={activeTooltipIndex:M,isTooltipActive:!0,activeLabel:C,activePayload:P,activeCoordinate:U};this.setState(W),this.renderCursor(A),this.accessibilityManager.setIndex(M)}}}},{key:"getSnapshotBeforeUpdate",value:function(b,S){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==S.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==b.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==b.margin){var w,E;this.accessibilityManager.setDetails({offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(E=this.props.margin.top)!==null&&E!==void 0?E:0}})}return null}},{key:"componentDidUpdate",value:function(b){R1([Ei(b.children,So)],[Ei(this.props.children,So)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var b=Ei(this.props.children,So);if(b&&typeof b.props.shared=="boolean"){var S=b.props.shared?"axis":"item";return s.indexOf(S)>=0?S:o}return o}},{key:"getMouseInfo",value:function(b){if(!this.container)return null;var S=this.container,w=S.getBoundingClientRect(),E=sSe(w),T={chartX:Math.round(b.pageX-E.left),chartY:Math.round(b.pageY-E.top)},A=w.width/S.offsetWidth||1,M=this.inRange(T.chartX,T.chartY,A);if(!M)return null;var C=this.state,P=C.xAxisMap,R=C.yAxisMap,D=this.getTooltipEventType(),k=pk(this.state,this.props.data,this.props.layout,M);if(D!=="axis"&&P&&R){var U=Cu(P).scale,O=Cu(R).scale,W=U&&U.invert?U.invert(T.chartX):null,L=O&&O.invert?O.invert(T.chartY):null;return ve(ve({},T),{},{xValue:W,yValue:L},k)}return k?ve(ve({},T),k):null}},{key:"inRange",value:function(b,S){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,E=this.props.layout,T=b/w,A=S/w;if(E==="horizontal"||E==="vertical"){var M=this.state.offset,C=T>=M.left&&T<=M.left+M.width&&A>=M.top&&A<=M.top+M.height;return C?{x:T,y:A}:null}var P=this.state,R=P.angleAxisMap,D=P.radiusAxisMap;if(R&&D){var k=Cu(R);return JD({x:T,y:A},k)}return null}},{key:"parseEventsOfWrapper",value:function(){var b=this.props.children,S=this.getTooltipEventType(),w=Ei(b,So),E={};w&&S==="axis"&&(w.props.trigger==="click"?E={onClick:this.handleClick}:E={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var T=Uy(this.props,this.handleOuterEvent);return ve(ve({},T),E)}},{key:"addListener",value:function(){lS.on(cS,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){lS.removeListener(cS,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(b,S,w){for(var E=this.state.formattedGraphicalItems,T=0,A=E.length;T{var v,g;const[i,o]=_.useState([]),[a,s]=_.useState([]),l=_.useRef(0),{baseUrl:c,fetchWithHeaders:u}=Dn();_.useEffect(()=>{let m=!1;return yZ(c,u,t).then(x=>{var E;if(m||x.length===0)return;const b=x.filter(T=>T.loss!=null).map(T=>({step:T.step,loss:T.loss})).slice(-2e3),S=x.filter(T=>T.lr!=null).map(T=>({step:T.step,lr:T.lr})).slice(-2e3);o(b),s(S);const w=((E=x[x.length-1])==null?void 0:E.step)??0;l.current=w}).catch(()=>{}),()=>{m=!0}},[c,u,t]),_.useEffect(()=>{const m=e.current_step;if(m0&&e.current_loss!=null){const x=e.current_loss;o(b=>{const S=b[b.length-1];return S&&S.step===m?b:[...b,{step:m,loss:x}].slice(-2e3)})}if(m>0&&e.current_lr!=null){const x=e.current_lr;s(b=>{const S=b[b.length-1];return S&&S.step===m?b:[...b,{step:m,lr:x}].slice(-2e3)})}},[e.current_step,e.current_loss,e.current_lr]);const d=n(),f=e.training_active&&e.total_steps===0,p=f?"Training startingโ€ฆ":`${e.current_step.toLocaleString()} / ${e.total_steps.toLocaleString()}`,y=e.eta_seconds!=null?r(e.eta_seconds):"โ€”";return h.jsxs("div",{className:"space-y-6",children:[h.jsx(Gr,{className:"bg-slate-800/50 border-slate-700 rounded-xl",children:h.jsxs(Wr,{className:"p-6",children:[h.jsxs("div",{className:"flex items-baseline justify-between mb-3",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg bg-blue-500/20 text-blue-400",children:h.jsx($u,{className:"w-5 h-5"})}),h.jsxs("div",{children:[h.jsx("h3",{className:"text-sm text-slate-400",children:"Progress"}),h.jsx("div",{className:"text-base font-semibold text-white",children:p})]})]}),h.jsxs("div",{className:"flex items-center gap-2 text-slate-300",children:[h.jsx(hE,{className:"w-4 h-4 text-purple-400"}),h.jsxs("span",{className:"text-sm",children:["ETA ",h.jsx("span",{className:"font-semibold text-white",children:y})]})]})]}),h.jsxs("div",{className:"relative h-8 w-full overflow-hidden rounded-md bg-slate-900 border border-slate-700",children:[h.jsx("div",{className:"h-full bg-gradient-to-r from-blue-500 to-sky-400 transition-[width] duration-500",style:{width:`${d}%`}}),h.jsx("div",{className:"absolute inset-0 flex items-center justify-center font-semibold text-white text-sm tabular-nums drop-shadow",children:f?"warming upโ€ฆ":`${d.toFixed(1)}%`})]})]})}),h.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[h.jsxs(Gr,{className:"bg-slate-800/50 border-slate-700 rounded-xl",children:[h.jsx(jo,{className:"pb-2",children:h.jsxs(ga,{className:"flex items-center gap-3 text-white text-base",children:[h.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-green-500/20 text-green-400",children:h.jsx(qi,{className:"w-4 h-4"})}),h.jsxs("span",{children:["Loss"," ",h.jsxs("span",{className:"text-slate-400 text-sm font-normal",children:["(",((v=e.current_loss)==null?void 0:v.toFixed(4))??"โ€”",")"]})]})]})}),h.jsx(Wr,{className:"pt-0",children:h.jsx("div",{className:"h-48",children:i.length===0?h.jsx("div",{className:"flex h-full items-center justify-center text-slate-500 text-sm",children:"Waiting for first metric tickโ€ฆ"}):h.jsx(FI,{width:"100%",height:"100%",children:h.jsxs(vk,{data:i,margin:{top:8,right:12,left:0,bottom:0},children:[h.jsx(fm,{dataKey:"step",tick:{fill:"#94a3b8",fontSize:11},stroke:"#475569"}),h.jsx(hm,{tick:{fill:"#94a3b8",fontSize:11},stroke:"#475569",width:48}),h.jsx(So,{contentStyle:{background:"#1e293b",border:"1px solid #475569",borderRadius:8},labelStyle:{color:"#cbd5e1"},itemStyle:{color:"#34d399"},formatter:m=>m.toFixed(4)}),h.jsx(lf,{type:"monotone",dataKey:"loss",stroke:"#34d399",strokeWidth:2,dot:!1,isAnimationActive:!1})]})})})})]}),h.jsxs(Gr,{className:"bg-slate-800/50 border-slate-700 rounded-xl",children:[h.jsx(jo,{className:"pb-2",children:h.jsxs(ga,{className:"flex items-center gap-3 text-white text-base",children:[h.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-orange-500/20 text-orange-400",children:h.jsx($u,{className:"w-4 h-4"})}),h.jsxs("span",{children:["Learning Rate"," ",h.jsxs("span",{className:"text-slate-400 text-sm font-normal",children:["(",((g=e.current_lr)==null?void 0:g.toExponential(2))??"โ€”",")"]})]})]})}),h.jsx(Wr,{className:"pt-0",children:h.jsx("div",{className:"h-48",children:a.length===0?h.jsx("div",{className:"flex h-full items-center justify-center text-slate-500 text-sm",children:"Waiting for first metric tickโ€ฆ"}):h.jsx(FI,{width:"100%",height:"100%",children:h.jsxs(vk,{data:a,margin:{top:8,right:12,left:0,bottom:0},children:[h.jsx(fm,{dataKey:"step",tick:{fill:"#94a3b8",fontSize:11},stroke:"#475569"}),h.jsx(hm,{tick:{fill:"#94a3b8",fontSize:11},stroke:"#475569",width:48,tickFormatter:m=>m.toExponential(0)}),h.jsx(So,{contentStyle:{background:"#1e293b",border:"1px solid #475569",borderRadius:8},labelStyle:{color:"#cbd5e1"},itemStyle:{color:"#fb923c"},formatter:m=>m.toExponential(2)}),h.jsx(lf,{type:"monotone",dataKey:"lr",stroke:"#fb923c",strokeWidth:2,dot:!1,isAnimationActive:!1})]})})})})]})]})]})},eDe=({logs:t,logContainerRef:e})=>h.jsxs(Gr,{className:"bg-slate-800/50 border-slate-700 rounded-xl",children:[h.jsx(jo,{children:h.jsxs(ga,{className:"flex items-center gap-3 text-white",children:[h.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-slate-700",children:h.jsx(Q7,{className:"w-5 h-5 text-sky-400"})}),"Training Logs"]})}),h.jsx(Wr,{children:h.jsx("div",{ref:e,className:"bg-slate-900 rounded-lg p-4 h-96 overflow-y-auto font-mono text-sm border border-slate-700",children:t.length===0?h.jsx("div",{className:"text-slate-500 py-8",children:"No training logs yet. Start training to see output."}):t.map((n,r)=>h.jsxs("div",{className:"text-slate-300 break-words whitespace-pre-wrap",children:[h.jsx("span",{className:"text-slate-500 mr-2 select-none",children:new Date(n.timestamp*1e3).toLocaleTimeString()}),n.message]},r))})})]}),tDe=({installHint:t})=>{const e=$z("system/training-extra");return h.jsx("div",{className:"max-w-3xl mx-auto",children:h.jsxs(Gr,{className:"bg-slate-800/50 border-slate-700 rounded-xl",children:[h.jsx(jo,{children:h.jsxs(ga,{className:"flex items-center gap-3 text-white",children:[h.jsx(Hz,{state:e.state}),zz(e.state,"Training Extra Not Installed")]})}),h.jsx(Wr,{className:"space-y-4",children:h.jsx(Vz,{state:e.state,error:e.error,logs:e.logs,logBoxRef:e.logBoxRef,onInstall:e.handleInstall,onRetry:e.handleRetry,installHint:t,packageName:"accelerate",idleTitle:"Training Extra Not Installed",idleDescription:h.jsxs(h.Fragment,{children:["Training requires the"," ",h.jsx("code",{className:"px-1 py-0.5 rounded bg-slate-900 text-sky-300",children:"accelerate"})," ","package, which isn't installed in this environment. Install it to enable the Training page."]}),doneDescription:h.jsx(Gz,{purpose:"training"})})})]})})},nDe=()=>{const{auth:t,refetch:e}=xf(),{baseUrl:n,fetchWithHeaders:r}=Dn(),[i,o]=_.useState(""),[a,s]=_.useState(!1),[l,c]=_.useState(null);if(t.status==="authenticated"||t.status==="loading")return null;const u=async()=>{const d=i.trim();if(d){s(!0),c(null);try{const f=await r(`${n}/hf-auth/login`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:d})});if(!f.ok){const p=await f.json().catch(()=>({}));throw new Error(p.detail||`HTTP ${f.status}`)}o(""),await e()}catch(f){c(f instanceof Error?f.message:String(f))}finally{s(!1)}}};return h.jsx("div",{className:"bg-amber-950/40 border border-amber-700/60 rounded-lg p-4 mb-6",children:h.jsxs("div",{className:"flex items-start gap-3",children:[h.jsx(td,{className:"w-5 h-5 text-amber-400 flex-shrink-0 mt-0.5"}),h.jsxs("div",{className:"flex-1 space-y-3",children:[h.jsxs("div",{children:[h.jsx("p",{className:"text-sm text-amber-100 font-medium",children:"Hugging Face access required for cloud training"}),h.jsxs("p",{className:"text-xs text-amber-200/80 mt-1",children:["Create a token at"," ",h.jsxs("a",{href:"https://huggingface.co/settings/tokens",target:"_blank",rel:"noreferrer",className:"underline hover:text-amber-50 inline-flex items-center gap-1",children:["huggingface.co/settings/tokens",h.jsx(cl,{className:"w-3 h-3"})]})," ","with ",h.jsx("span",{className:"font-mono",children:"Write"})," access (so trained policies can upload to your account), then paste it below."]})]}),h.jsxs("form",{onSubmit:d=>{d.preventDefault(),u()},className:"flex gap-2",children:[h.jsx(hi,{type:"password",placeholder:"hf_...",value:i,onChange:d=>o(d.target.value),className:"bg-slate-900 border-slate-600 text-white placeholder:text-slate-500",disabled:a,autoComplete:"off"}),h.jsx(et,{type:"submit",disabled:a||!i.trim(),className:"bg-amber-600 hover:bg-amber-700 text-white",children:a?h.jsxs(h.Fragment,{children:[h.jsx(fi,{className:"w-4 h-4 mr-2 animate-spin"}),"Savingโ€ฆ"]}):"Save token"})]}),l&&h.jsx("p",{className:"text-xs text-red-300",children:l})]})]})})},rDe=1e3,yk=5e3;function iDe(t,e){return t?{training_active:t.state==="running",current_step:t.metrics.current_step,total_steps:t.metrics.total_steps,current_loss:t.metrics.current_loss??void 0,current_lr:t.metrics.current_lr??void 0,grad_norm:t.metrics.grad_norm??void 0,eta_seconds:t.metrics.eta_seconds??void 0,available_controls:{stop_training:t.state==="running",pause_training:!1,resume_training:!1}}:{training_active:e,current_step:0,total_steps:0,available_controls:{stop_training:!1,pause_training:!1,resume_training:!1}}}function oDe(t){const e=Dz(t.policy_type);return{target:t.target,dataset_repo_id:t.dataset_repo_id,policy_type:t.policy_type,steps:t.steps,batch_size:t.batch_size,seed:t.seed,num_workers:t.num_workers,log_freq:t.log_freq,save_freq:t.save_freq,save_checkpoint:t.save_checkpoint,resume:t.resume,wandb_enable:t.wandb_enable,wandb_project:t.wandb_project,wandb_entity:t.wandb_entity,wandb_notes:t.wandb_notes,wandb_mode:t.wandb_mode,wandb_disable_artifact:t.wandb_disable_artifact,policy_device:t.policy_device,policy_use_amp:t.policy_use_amp,policy_dtype:e.dtype?t.policy_dtype:void 0,policy_gradient_checkpointing:e.gradientCheckpointing?t.policy_gradient_checkpointing:void 0,policy_freeze_vision_encoder:e.freezeVisionEncoder?t.policy_freeze_vision_encoder:void 0,policy_train_expert_only:e.trainExpertOnly?t.policy_train_expert_only:void 0,optimizer_type:t.optimizer_type,optimizer_lr:t.optimizer_lr,optimizer_weight_decay:t.optimizer_weight_decay,optimizer_grad_clip_norm:t.optimizer_grad_clip_norm,use_policy_training_preset:t.use_policy_training_preset}}const aDe=()=>{var ee;const{baseUrl:t,fetchWithHeaders:e}=Dn(),{auth:n}=xf(),{toast:r}=Dr(),i=ji(),a=((ee=yl().state)==null?void 0:ee.datasetRepoId)??"",[s,l]=_.useState({target:{runner:"local"},dataset_repo_id:a,policy_type:"act",steps:1e4,batch_size:8,seed:1e3,num_workers:4,log_freq:250,save_freq:1e3,save_checkpoint:!0,resume:!1,wandb_enable:!1,wandb_mode:"online",wandb_disable_artifact:!1,policy_device:"cuda",policy_use_amp:!1,policy_dtype:void 0,policy_gradient_checkpointing:void 0,policy_freeze_vision_encoder:void 0,policy_train_expert_only:void 0,optimizer_type:"adam",use_policy_training_preset:!0}),[c,u]=_.useState([]),[d,f]=_.useState(!0),[p,y]=_.useState(null),[v,g]=_.useState("pip install accelerate"),[m,x]=_.useState(!1),[b,S]=_.useState(!1),[w,E]=_.useState(!1),[T,A]=_.useState([]),[M,C]=_.useState([]),[P,R]=_.useState(!0),[D,k]=_.useState("https://sensecraft-gpu.seeed.cc/lelab/connect"),[U,O]=_.useState(!1);_.useEffect(()=>{f(!0),b4(t,e).then(u).catch(()=>u([])).finally(()=>f(!1))},[t,e]),_.useEffect(()=>{e(`${t}/system/training-extra`).then(te=>te.json()).then(te=>{y(te.available),g(te.install_hint)}).catch(()=>y(!0))},[t,e]),_.useEffect(()=>{CE(t,e,200).then(te=>x(te.some(Q=>Q.runner==="local"&&Q.state==="running"))).catch(()=>x(!1))},[t,e]),_.useEffect(()=>{R(!0),PN(t,e).then(te=>{E(te.authenticated),A(te.flavors??[]),C(te.providers??[])}).catch(()=>{E(!1),A([]),C([])}).finally(()=>R(!1))},[t,e,n.status]),_.useEffect(()=>{wZ(t,e).then(te=>{const Q=te.web_url||"https://sensecraft-gpu.seeed.cc";k(`${Q.replace(/\/$/,"")}/lelab/connect`)}).catch(()=>k("https://sensecraft-gpu.seeed.cc/lelab/connect"))},[t,e]);const W=(te,Q)=>{l(ce=>{const ae={...ce,[te]:Q};return te==="policy_type"&&typeof Q=="string"?{...ae,...Cce(Q,ce)}:ae})},L=async()=>{if(!s.dataset_repo_id.trim()){r({title:"Error",description:"Dataset repository ID is required",variant:"destructive"});return}S(!0);try{const te=await xZ(t,e,oDe(s));r({title:"Training Started",description:te.name}),i(`/training/${te.id}`)}catch(te){const Q=te instanceof Error?te.message:String(te);r({title:"Error",description:Q,variant:"destructive"}),CE(t,e,200).then(ce=>x(ce.some(ae=>ae.runner==="local"&&ae.state==="running"))).catch(()=>{})}finally{S(!1)}},j=()=>{O(!0);const te=window.open(D,"lelab-seeed-cloud","width=520,height=720");if(!te){O(!1),r({title:"Seeed Cloud",description:"Browser blocked the connection window.",variant:"destructive"});return}const Q=window.setTimeout(()=>{window.removeEventListener("message",ae),O(!1)},12e4),ce=async(fe,we,le)=>{try{await SZ(t,e,{token:fe,api_url:we,web_url:le});const ie=await PN(t,e);E(ie.authenticated),A(ie.flavors??[]),C(ie.providers??[]),r({title:"Seeed Cloud connected",description:"GPU flavors are available now."})}catch(ie){const G=ie instanceof Error?ie.message:String(ie);r({title:"Seeed Cloud",description:G,variant:"destructive"})}finally{window.clearTimeout(Q),window.removeEventListener("message",ae),O(!1),te.close()}};function ae(fe){const we=new URL(D).origin;if(fe.origin!==we)return;const le=fe.data;(le==null?void 0:le.type)!=="seeed-cloud-token"||!le.token||ce(le.token,le.apiUrl,le.webUrl)}window.addEventListener("message",ae)};if(p===null)return h.jsx("div",{className:"min-h-screen bg-slate-900 text-white p-4",children:h.jsxs("div",{className:"max-w-7xl mx-auto",children:[h.jsx(kw,{}),h.jsxs("div",{className:"flex items-center justify-center py-24 text-slate-400",children:[h.jsx(fi,{className:"w-6 h-6 animate-spin mr-3"}),"Checking training environmentโ€ฆ"]})]})});if(p===!1)return h.jsx("div",{className:"min-h-screen bg-slate-900 text-white p-4",children:h.jsxs("div",{className:"max-w-7xl mx-auto",children:[h.jsx(kw,{}),h.jsx(tDe,{installHint:v})]})});const X=s.target.runner==="hf_cloud",K=(s.target.runner==="hf_cloud"||s.target.runner==="seeed_cloud"||s.target.runner==="external")&&!s.target.flavor,F=s.target.runner==="local"&&m,Y=b||!s.dataset_repo_id.trim()||F||X&&!w||K,q=F?"Another local training is already running":X&&!w?"Log in to Hugging Face to use cloud compute":K?"Select a hardware flavor":void 0;return h.jsx("div",{className:"min-h-screen bg-slate-900 text-white p-4",children:h.jsxs("div",{className:"max-w-7xl mx-auto",children:[h.jsx(kw,{}),h.jsx(nDe,{}),h.jsx(Hce,{config:s,updateConfig:W,datasets:c,datasetsLoading:d,authenticated:w,flavors:T,providers:M,hardwareLoading:P,seeedConnecting:U,onConnectSeeedCloud:j}),h.jsx("div",{className:"max-w-3xl mx-auto mt-6 flex justify-end",children:(()=>{const te=h.jsx(et,{onClick:L,disabled:Y,size:"lg",className:"bg-green-500 hover:bg-green-600 text-white font-semibold px-6",children:b?h.jsxs(h.Fragment,{children:[h.jsx(fi,{className:"w-5 h-5 mr-2 animate-spin"})," Startingโ€ฆ"]}):h.jsxs(h.Fragment,{children:[h.jsx(Tc,{className:"w-5 h-5 mr-2"})," Start Training"]})});return q?h.jsxs(Fv,{children:[h.jsx(Bv,{asChild:!0,children:h.jsx("span",{tabIndex:0,children:te})}),h.jsx(Gh,{children:q})]}):te})()})]})})},sDe=({jobId:t})=>{const{baseUrl:e,fetchWithHeaders:n}=Dn(),{toast:r}=Dr(),i=ji(),{selectedRecord:o}=$A(),[a,s]=_.useState(null),[l,c]=_.useState(null),[u,d]=_.useState([]),f=_.useRef(null),[p,y]=_.useState([]),[v,g]=_.useState(null),[m,x]=_.useState(!1);_.useEffect(()=>{let M=!1;return vZ(e,n,t).then(C=>{!M&&C.length>0&&d(C)}).catch(()=>{}),()=>{M=!0}},[e,n,t]);const b=_.useRef(a==null?void 0:a.state);b.current=a==null?void 0:a.state,_.useEffect(()=>{let M=!1;const C=()=>{FA(e,n,t).then(R=>{if(!M)if(y(R),R.length>0){const D=R[R.length-1].step;g(k=>k!=null&&R.some(U=>U.step===k)?k:D)}else g(null)}).catch(()=>{M||(y([]),g(null))})};C();const P=setInterval(()=>{M||b.current&&b.current!=="running"||C()},5e3);return()=>{M=!0,clearInterval(P)}},[e,n,t]),_.useEffect(()=>{let M=!1;const C=async()=>{try{const R=await mZ(e,n,t);if(M)return;if(s(R),R.state==="running"){const D=await gZ(e,n,t);!M&&D.length>0&&d(k=>{const U=[...k,...D];return U.length>yk?U.slice(U.length-yk):U})}}catch(R){M||c(R instanceof Error?R.message:String(R))}};C();const P=setInterval(()=>{M||b.current&&b.current!=="running"||C()},rDe);return()=>{M=!0,clearInterval(P)}},[e,n,t]),_.useEffect(()=>{f.current&&(f.current.scrollTop=f.current.scrollHeight)},[u]);const S=M=>{const C=Math.floor(M/3600),P=Math.floor(M%3600/60),R=Math.floor(M%60);return`${C.toString().padStart(2,"0")}:${P.toString().padStart(2,"0")}:${R.toString().padStart(2,"0")}`},w=()=>!a||a.metrics.total_steps===0?0:a.metrics.current_step/a.metrics.total_steps*100,E=async()=>{if(a&&window.confirm("Stop this run?"))try{const M=await v4(e,n,a.id);s(M),r({title:"Stoppingโ€ฆ"})}catch(M){r({title:"Stop failed",description:M instanceof Error?M.message:String(M),variant:"destructive"})}},T=async()=>{if(a&&window.confirm("Delete this run? This wipes the output directory."))try{await y4(e,n,a.id),r({title:"Job removed"}),i("/")}catch(M){r({title:"Delete failed",description:M instanceof Error?M.message:String(M),variant:"destructive"})}};if(l&&!a)return h.jsx("div",{className:"min-h-screen bg-slate-900 text-white p-4",children:h.jsxs("div",{className:"max-w-7xl mx-auto space-y-4",children:[h.jsxs(et,{variant:"ghost",onClick:()=>i("/"),className:"text-slate-400",children:[h.jsx(ll,{className:"w-4 h-4 mr-2"})," Back to Jobs"]}),h.jsxs("p",{className:"text-red-300",children:["Couldn't load job ",t,": ",l]})]})});if(!a)return h.jsx("div",{className:"min-h-screen bg-slate-900 text-white p-4",children:h.jsxs("div",{className:"max-w-7xl mx-auto flex items-center justify-center py-24 text-slate-400",children:[h.jsx(fi,{className:"w-6 h-6 animate-spin mr-3"})," Loading jobโ€ฆ"]})});const A=a.state==="running";return h.jsx("div",{className:"min-h-screen bg-slate-900 text-white p-4",children:h.jsxs("div",{className:"max-w-7xl mx-auto space-y-6",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs(et,{variant:"ghost",onClick:()=>i("/"),className:"text-slate-400 hover:text-white",children:[h.jsx(ll,{className:"w-4 h-4 mr-2"})," Jobs"]}),h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("h1",{className:"text-xl font-semibold text-white",children:a.name}),a.runner==="hf_cloud"?h.jsxs("span",{className:"text-xs px-2 py-0.5 rounded bg-amber-900/40 text-amber-200 border border-amber-700",children:["HF ยท ",a.hf_flavor??"cloud"]}):a.runner==="seeed_cloud"||a.runner==="external"?h.jsxs("span",{className:"text-xs px-2 py-0.5 rounded bg-emerald-900/40 text-emerald-200 border border-emerald-700",children:[a.runner==="seeed_cloud"?"Seeed":a.external_provider??"External"," ยท"," ",a.external_flavor??"GPU"]}):h.jsx("span",{className:"text-xs px-2 py-0.5 rounded bg-slate-700 text-slate-200 border border-slate-600",children:"Local"}),a.runner==="hf_cloud"&&a.hf_repo_id&&a.state==="done"&&h.jsx("a",{href:`https://huggingface.co/${a.hf_repo_id}`,target:"_blank",rel:"noreferrer",className:"text-xs text-amber-300 hover:text-amber-200 underline",children:"View on Hub โ†—"}),(a.runner==="seeed_cloud"||a.runner==="external")&&a.external_job_url&&h.jsx("a",{href:a.external_job_url,target:"_blank",rel:"noreferrer",className:"text-xs text-emerald-300 hover:text-emerald-200 underline",children:"View provider job โ†—"}),a.wandb_run_url&&h.jsx("a",{href:a.wandb_run_url,target:"_blank",rel:"noreferrer",className:"text-xs text-yellow-300 hover:text-yellow-200 underline",children:"View on W&B โ†—"})]}),h.jsxs("p",{className:"text-xs text-slate-400",children:[a.state,a.error_message?` โ€” ${a.error_message}`:""]})]})]}),A?h.jsxs(et,{onClick:E,className:"bg-red-500 hover:bg-red-600 text-white",children:[h.jsx(Od,{className:"w-4 h-4 mr-2"})," Stop"]}):h.jsxs(et,{onClick:T,variant:"ghost",className:"text-slate-400 hover:text-white",children:[h.jsx(aA,{className:"w-4 h-4 mr-2"})," Delete"]})]}),h.jsx(QIe,{jobId:t,trainingStatus:iDe(a,!1),getProgressPercentage:w,formatTime:S}),h.jsxs("div",{className:"bg-slate-800/40 border border-slate-700 rounded-lg p-4 flex items-center gap-3",children:[h.jsx("span",{className:"text-sm font-semibold text-slate-300",children:"Run inference"}),p.length===0?h.jsx("span",{className:"text-xs text-slate-500",children:"No checkpoints yet โ€” wait for the first save."}):h.jsxs(h.Fragment,{children:[h.jsx(BA,{checkpoints:p,selectedStep:v,onChange:g}),h.jsxs(et,{onClick:()=>x(!0),disabled:v==null,className:"bg-green-500 hover:bg-green-600 text-white",children:[h.jsx(Tc,{className:"w-4 h-4 mr-2"}),"Run on robot"]})]})]}),h.jsx(x4,{open:m,onOpenChange:x,robot:o,jobId:t,initialStep:v}),h.jsx(eDe,{logs:u,logContainerRef:f})]})})},xk=()=>{const{jobId:t}=_W();return t?h.jsx(sDe,{jobId:t}):h.jsx(aDe,{})},lDe=1e3;function bk(t){const e=Math.max(0,Math.floor(t)),n=Math.floor(e/60),r=e%60;return`${String(n).padStart(2,"0")}:${String(r).padStart(2,"0")}`}const cDe=()=>{const t=ji(),{baseUrl:e,fetchWithHeaders:n}=Dn(),{toast:r}=Dr(),[i,o]=_.useState(null),[a,s]=_.useState(!1),l=_.useRef(!1),c=_.useRef(!1);_.useEffect(()=>{let b=!1;const S=async()=>{try{await ON(e,n)}catch{}},w=async()=>{try{const T=await LZ(e,n);if(b)return;if(o(T),!T.inference_active&&!l.current){l.current=!0,T.exited&&r({title:"Inference finished",description:T.exit_code===0?"Run completed.":`Exit code ${T.exit_code}. See ${T.log_path}.`,variant:T.exit_code===0?"default":"destructive"}),t("/");return}T.inference_active&&T.rollout_started_at!=null&&T.duration_s!=null&&T.duration_s>0&&T.rollout_elapsed_s>T.duration_s+10&&!c.current&&(c.current=!0,r({title:"Inference seems hung",description:`Rollout past duration by ${Math.round(T.rollout_elapsed_s-T.duration_s)}s. Stopping.`,variant:"destructive"}),S())}catch(T){b||r({title:"Lost connection to backend",description:T instanceof Error?T.message:String(T),variant:"destructive"})}};w();const E=setInterval(w,lDe);return()=>{b=!0,clearInterval(E)}},[e,n,t,r]);const u=async()=>{s(!1);try{await ON(e,n)}catch(b){r({title:"Stop failed",description:b instanceof Error?b.message:String(b),variant:"destructive"})}};if(!i)return h.jsxs("div",{className:"min-h-screen bg-black text-white flex items-center justify-center",children:[h.jsx(fi,{className:"w-6 h-6 animate-spin mr-3"})," Connecting to inferenceโ€ฆ"]});const d=i.elapsed_s??0,f=i.rollout_elapsed_s??0,p=i.duration_s??0,y=i.inference_active&&i.rollout_started_at==null,v=i.inference_active&&i.rollout_started_at!=null,g=v&&p>0?Math.min(100,f/p*100):0,m=y?"SETTING UP":v?"RUNNING":"FINISHED",x=v?f:d;return h.jsxs("div",{className:"min-h-screen bg-black text-white flex flex-col p-4 sm:p-6 lg:p-8",children:[h.jsxs("div",{className:"flex items-center gap-4 mb-8",children:[h.jsx(et,{variant:"ghost",size:"icon",onClick:()=>t("/"),className:"text-slate-400 hover:bg-slate-800 hover:text-white rounded-lg",children:h.jsx(ll,{className:"w-5 h-5"})}),h.jsx(Gx,{}),h.jsx("h1",{className:"font-bold text-white text-2xl",children:"Inference"})]}),h.jsx("div",{className:"flex-1 flex items-center justify-center",children:h.jsxs("div",{className:"bg-gray-900 rounded-lg border border-gray-700 p-8 w-full max-w-xl",children:[h.jsx("div",{className:"text-center mb-6",children:h.jsxs("div",{className:`inline-flex items-center gap-2 px-3 py-1 rounded-full text-xs font-bold tracking-widest ${y?"bg-amber-500/15 text-amber-300":"bg-green-500/15 text-green-300"}`,children:[h.jsx("span",{className:`w-2 h-2 rounded-full ${y?"bg-amber-500":"bg-green-500"} animate-pulse`}),m]})}),h.jsxs("div",{className:"text-center mb-4",children:[h.jsx("div",{className:`text-7xl font-mono font-bold leading-none ${y?"text-amber-400":"text-green-400"}`,children:bk(x)}),h.jsx("div",{className:"text-sm text-gray-500 mt-2",children:y?"Loading policy & connecting hardwareโ€ฆ":`/ ${bk(p)}`})]}),h.jsx("div",{className:"w-full bg-gray-800 rounded-full h-1.5 mb-8",children:h.jsx("div",{className:`h-1.5 rounded-full transition-all duration-500 ${y?"bg-amber-500/40 animate-pulse w-full":"bg-green-500"}`,style:y?void 0:{width:`${g}%`}})}),h.jsxs("div",{className:"text-xs text-slate-500 break-all mb-6",children:["policy: ",i.policy_ref??"(unknown)"]}),h.jsxs(et,{onClick:()=>s(!0),disabled:!i.inference_active,className:"w-full bg-red-500 hover:bg-red-600 text-white font-semibold py-6 text-lg disabled:opacity-50",children:[h.jsx(Od,{className:"w-5 h-5 mr-2"}),"Stop"]})]})}),h.jsx(xC,{open:a,onOpenChange:s,children:h.jsxs(Kx,{className:"bg-gray-900 border-gray-700 text-white",children:[h.jsxs(Yx,{children:[h.jsx(Zx,{children:"Stop inference?"}),h.jsx(Qx,{className:"text-gray-400",children:"The follower will hold its current pose. You can launch another run from the job tile."})]}),h.jsxs(Jx,{children:[h.jsx(tb,{className:"bg-gray-800 border-gray-700 text-white hover:bg-gray-700",children:"Keep running"}),h.jsx(eb,{onClick:u,className:"bg-red-500 hover:bg-red-600 text-white",children:"Stop"})]})]})})]})},uDe=()=>h.jsxs("div",{className:"min-h-screen bg-black text-white flex flex-col items-center justify-center p-4",children:[h.jsx("h1",{className:"text-5xl font-bold tracking-tight",children:"Edit Dataset"}),h.jsx("p",{className:"mt-4 text-xl text-gray-400",children:"This page is under construction."})]}),dDe=()=>{var R;const t=yl(),e=ji(),{toast:n}=Dr(),{baseUrl:r,fetchWithHeaders:i}=Dn(),o=(R=t.state)==null?void 0:R.datasetInfo,[a,s]=_.useState(null),[l,c]=_.useState(!0),[u,d]=_.useState({tags:["robotics","lerobot"],private:!1}),[f,p]=_.useState(u.tags.join(", ")),[y,v]=_.useState(!1),[g,m]=_.useState(!1),[x,b]=_.useState(!1),[S,w]=_.useState(!1);Z.useEffect(()=>{(async()=>{if(!(o!=null&&o.dataset_repo_id)){n({title:"No Dataset Information",description:"Please complete a recording session first.",variant:"destructive"}),e("/");return}try{const k=await i(`${r}/dataset-info`,{method:"POST",body:JSON.stringify({dataset_repo_id:o.dataset_repo_id})}),U=await k.json();k.ok&&U.success?s({...U,saved_episodes:U.num_episodes,session_elapsed_seconds:o.session_elapsed_seconds||0,source:o.source}):(n({title:"Warning",description:"Could not load complete dataset information. Using session data.",variant:"destructive"}),s(o))}catch(k){console.error("Error loading dataset info:",k),n({title:"Warning",description:"Could not connect to backend. Using session data.",variant:"destructive"}),s(o)}finally{c(!1)}})()},[o,e,n]);const E=D=>{const k=`/spaces/lerobot/visualize_dataset?path=${encodeURIComponent(`/${D}`)}`,U=`https://huggingface.co/login?next=${encodeURIComponent(k)}`;window.open(U,"_blank","noopener,noreferrer")},T=D=>{const k=Math.floor(D/3600),U=Math.floor(D%3600/60),O=D%60;return k>0?`${k}h ${U}m ${O}s`:U>0?`${U}m ${O}s`:`${O}s`},A=async()=>{if(a){v(!0);try{const D=f.split(",").map(O=>O.trim()).filter(O=>O.length>0),k=await i(`${r}/upload-dataset`,{method:"POST",body:JSON.stringify({dataset_repo_id:a.dataset_repo_id,tags:D,private:u.private})}),U=await k.json();if(k.ok&&U.success)m(!0),n({title:"Upload Successful!",description:`Dataset ${a.dataset_repo_id} has been uploaded to HuggingFace Hub.`});else{const O="Failed to upload dataset to HuggingFace Hub.";n({title:"Upload Failed",description:U.docs_url?h.jsxs("span",{children:[U.message||O," ",h.jsx("a",{href:U.docs_url,target:"_blank",rel:"noopener noreferrer",className:"underline font-medium",children:"Open setup guide"})]}):U.message||O,variant:"destructive"})}}catch(D){console.error("Error uploading dataset:",D),n({title:"Connection Error",description:"Could not connect to the backend server.",variant:"destructive"})}finally{v(!1)}}},M=()=>{n({title:"Upload Skipped",description:"Dataset saved locally. You can upload it manually later."}),e("/")},C=async()=>{if(a){w(!0);try{const D=await i(`${r}/delete-dataset`,{method:"POST",body:JSON.stringify({dataset_repo_id:a.dataset_repo_id})}),k=await D.json();D.ok&&k.success?(n({title:"Dataset Deleted",description:`${a.dataset_repo_id} has been removed from disk.`}),e("/")):n({title:"Delete Failed",description:k.message||"Could not delete the dataset.",variant:"destructive"})}catch{n({title:"Connection Error",description:"Could not connect to the backend server.",variant:"destructive"})}finally{w(!1),b(!1)}}};if(l||!a)return h.jsx("div",{className:"min-h-screen bg-black text-white flex items-center justify-center",children:h.jsxs("div",{className:"text-center",children:[h.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-500 mx-auto mb-4"}),h.jsx("p",{className:"text-lg",children:"Loading dataset information..."})]})});const P=a.source==="both";return h.jsxs("div",{className:"min-h-screen bg-black text-white p-8",children:[h.jsxs("div",{className:"max-w-4xl mx-auto",children:[h.jsxs("div",{className:"flex items-center justify-between mb-8",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs(et,{onClick:()=>e("/"),variant:"outline",className:"border-gray-500 hover:border-gray-200 text-gray-300 hover:text-white",children:[h.jsx(ll,{className:"w-4 h-4 mr-2"}),"Back to Home"]}),h.jsx(et,{onClick:()=>b(!0),variant:"outline",size:"icon",disabled:S,"aria-label":"Delete dataset from disk",className:"border-red-500/40 text-red-400 hover:border-red-400 hover:text-red-300 hover:bg-red-500/10",children:h.jsx(aA,{className:"w-4 h-4"})})]}),h.jsxs("div",{className:"flex items-center gap-3",children:[g?h.jsx(qi,{className:"w-8 h-8 text-green-500"}):h.jsx(K7,{className:"w-8 h-8 text-blue-500"}),h.jsx("h1",{className:"text-3xl font-bold",children:g?"Upload Complete":"Dataset Upload"})]})]}),g&&h.jsxs("div",{className:"bg-green-900/20 border border-green-600 rounded-lg p-6 mb-8",children:[h.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[h.jsx(qi,{className:"w-6 h-6 text-green-500"}),h.jsx("h2",{className:"text-xl font-semibold text-green-400",children:"Successfully Uploaded!"})]}),h.jsx("p",{className:"text-gray-300 mb-4",children:"Your dataset has been uploaded to HuggingFace Hub and is now available for training and sharing."}),h.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[h.jsxs(et,{onClick:()=>{const D=`/spaces/lerobot/visualize_dataset?path=${encodeURIComponent(`/${a.dataset_repo_id}`)}`,k=u.private?`https://huggingface.co/login?next=${encodeURIComponent(D)}`:`https://huggingface.co${D}`;window.open(k,"_blank","noopener,noreferrer")},className:"bg-blue-500 hover:bg-blue-600 text-white",children:[h.jsx(cl,{className:"w-4 h-4 mr-2"}),"View on HuggingFace Hub"]}),h.jsx(et,{onClick:()=>e("/training",{state:{datasetRepoId:a.dataset_repo_id}}),className:"bg-purple-500 hover:bg-purple-600 text-white",children:"Start Training"})]})]}),!g&&h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"bg-gray-900 rounded-lg p-6 border border-gray-700 mb-8",children:[h.jsx("h2",{className:"text-xl font-semibold text-white mb-4",children:"Dataset Summary"}),h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-400",children:"Repository ID:"}),h.jsx("p",{className:"text-white font-mono text-lg",children:a.dataset_repo_id})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-400",children:"Task:"}),h.jsx("p",{className:"text-white",children:a.single_task})]})]}),h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-400",children:"Episodes Recorded:"}),h.jsx("p",{className:"text-white text-2xl font-bold text-green-400",children:a.saved_episodes||a.num_episodes}),a.total_frames&&h.jsxs("p",{className:"text-gray-400 text-sm",children:[a.total_frames," total frames"]})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-400",children:"Session Duration:"}),h.jsx("p",{className:"text-white",children:T(a.session_elapsed_seconds||0)}),a.fps&&h.jsxs("p",{className:"text-gray-400 text-sm",children:[a.fps," FPS"]})]})]})]})]}),!P&&h.jsxs("div",{className:"bg-gray-900 rounded-lg p-6 border border-gray-700 mb-8",children:[h.jsx("h2",{className:"text-xl font-semibold text-white mb-6",children:"Upload Configuration"}),h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"tags",className:"text-gray-300 mb-2 block",children:"Tags (comma-separated)"}),h.jsx(hi,{id:"tags",value:f,onChange:D=>p(D.target.value),placeholder:"robotics, lerobot, manipulation",className:"bg-gray-800 border-gray-600 text-white"}),h.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Tags help others discover your dataset on HuggingFace Hub"})]}),h.jsxs("div",{className:"flex items-center space-x-3",children:[h.jsx(IA,{id:"private",checked:u.private,onCheckedChange:D=>d({...u,private:D})}),h.jsxs("div",{className:"flex items-center gap-2",children:[u.private?h.jsx(J7,{className:"w-4 h-4 text-gray-400"}):h.jsx(Z7,{className:"w-4 h-4 text-gray-400"}),h.jsx(Tt,{htmlFor:"private",className:"text-gray-300",children:"Make dataset private"})]})]}),h.jsx("p",{className:"text-sm text-gray-500 ml-6",children:u.private?"Only you will be able to access this dataset":"Dataset will be publicly accessible on HuggingFace Hub"})]})]}),h.jsx("div",{className:"flex flex-col sm:flex-row gap-4 justify-center",children:P?h.jsxs(et,{onClick:()=>E(a.dataset_repo_id),className:"bg-blue-500 hover:bg-blue-600 text-white font-semibold py-4 px-8 text-lg",children:[h.jsx(cl,{className:"w-5 h-5 mr-2"}),"View on Hugging Face Hub"]}):h.jsxs(h.Fragment,{children:[h.jsx(et,{onClick:A,disabled:y,className:"bg-blue-500 hover:bg-blue-600 text-white font-semibold py-4 px-8 text-lg",children:y?h.jsxs(h.Fragment,{children:[h.jsx(fi,{className:"w-5 h-5 mr-2 animate-spin"}),"Uploading to Hub..."]}):h.jsxs(h.Fragment,{children:[h.jsx(jU,{className:"w-5 h-5 mr-2"}),"Upload to HuggingFace Hub"]})}),h.jsx(et,{onClick:M,disabled:y,variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-800 hover:text-white py-4 px-8 text-lg",children:"Skip Upload"})]})}),!P&&h.jsx("div",{className:"mt-8 p-4 bg-blue-900/20 border border-blue-600 rounded-lg",children:h.jsxs("div",{className:"flex items-start gap-3",children:[h.jsx(td,{className:"w-5 h-5 text-blue-400 mt-0.5"}),h.jsxs("div",{children:[h.jsx("h3",{className:"font-semibold text-blue-400 mb-2",children:"About HuggingFace Hub Upload"}),h.jsxs("ul",{className:"text-sm text-gray-300 space-y-1",children:[h.jsx("li",{children:"โ€ข Your dataset will be uploaded to HuggingFace Hub for sharing and collaboration"}),h.jsx("li",{children:"โ€ข You need to be logged in to HuggingFace CLI on the server"}),h.jsx("li",{children:"โ€ข Uploaded datasets can be used for training models and sharing with the community"}),h.jsx("li",{children:"โ€ข You can always upload manually later using the HuggingFace CLI"})]})]})]})})]})]}),h.jsx(xC,{open:x,onOpenChange:b,children:h.jsxs(Kx,{className:"bg-gray-900 border-gray-700 text-white",children:[h.jsxs(Yx,{children:[h.jsx(Zx,{children:"Delete dataset from disk?"}),h.jsxs(Qx,{className:"text-gray-400",children:["This permanently removes ",h.jsx("span",{className:"font-mono text-white",children:a.dataset_repo_id})," from your local cache. This action cannot be undone."]})]}),h.jsxs(Jx,{children:[h.jsx(tb,{className:"bg-gray-800 border-gray-700 text-white hover:bg-gray-700",children:"Keep dataset"}),h.jsx(eb,{onClick:C,disabled:S,className:"bg-red-500 hover:bg-red-600 text-white",children:S?"Deletingโ€ฆ":"Delete"})]})]})})]})},fDe=()=>{const t=yl();return _.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",t.pathname)},[t.pathname]),h.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-100",children:h.jsxs("div",{className:"text-center",children:[h.jsx("h1",{className:"text-4xl font-bold mb-4",children:"404"}),h.jsx("p",{className:"text-xl text-gray-600 mb-4",children:"Oops! Page not found"}),h.jsx("a",{href:"/",className:"text-blue-500 hover:text-blue-700 underline",children:"Return to Home"})]})})},hDe="lelab-tabs-v1",pDe=1e3,mDe=3e3,gDe=({children:t})=>{const[e,n]=_.useState(!0),r=_.useRef(new Map),i=_.useRef(""),o=_.useRef(0),a=_.useRef(null),s=_.useCallback(()=>{const c=r.current,u=Date.now()-mDe;for(const[p,y]of c)y.lastSeen{if(typeof window>"u"||typeof BroadcastChannel>"u")return;i.current=crypto.randomUUID(),o.current=Date.now();const c=new BroadcastChannel(hDe);a.current=c;const u=p=>{c.postMessage({type:p,id:i.current,openedAt:o.current})};c.onmessage=p=>{const y=p.data;if(!y||y.id===i.current)return;const v=r.current;y.type==="HEARTBEAT"?v.set(y.id,{id:y.id,openedAt:y.openedAt,lastSeen:Date.now()}):y.type==="RELEASE"?v.delete(y.id):y.type==="TAKEOVER"&&(v.set(y.id,{id:y.id,openedAt:y.openedAt,lastSeen:Date.now()}),o.current<=y.openedAt&&(o.current=y.openedAt+1)),s()},u("HEARTBEAT");const d=setInterval(()=>{u("HEARTBEAT"),s()},pDe),f=()=>u("RELEASE");return window.addEventListener("beforeunload",f),()=>{window.removeEventListener("beforeunload",f),clearInterval(d),u("RELEASE"),c.close(),a.current=null}},[s]);const l=_.useCallback(()=>{var c;o.current=0,(c=a.current)==null||c.postMessage({type:"TAKEOVER",id:i.current,openedAt:0}),s()},[s]);return h.jsxs(h.Fragment,{children:[t,!e&&h.jsx("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center bg-black/80 backdrop-blur-sm",role:"dialog","aria-modal":"true",children:h.jsxs("div",{className:"mx-4 max-w-md space-y-4 rounded-lg border bg-background p-6 text-center shadow-lg",children:[h.jsx("h2",{className:"text-lg font-semibold",children:"LeLab is already open in another tab"}),h.jsx("p",{className:"text-sm text-muted-foreground",children:"Only one tab can control the robot at a time. Switch back to the original tab, or take over here โ€” the other tab will lock."}),h.jsx(et,{onClick:l,children:"Use this tab"})]})})]})},vDe=new c9;function yDe(){return h.jsx(d9,{client:vDe,children:h.jsx(WF,{children:h.jsx(p9,{children:h.jsx(qX,{children:h.jsx(KX,{children:h.jsx(V9,{children:h.jsx(W9,{children:h.jsxs(BW,{children:[h.jsx(gDe,{children:h.jsxs(jW,{children:[h.jsx(go,{path:"/",element:h.jsx(XZ,{})}),h.jsx(go,{path:"/teleoperation",element:h.jsx(bse,{})}),h.jsx(go,{path:"/recording",element:h.jsx(Mce,{})}),h.jsx(go,{path:"/upload",element:h.jsx(dDe,{})}),h.jsx(go,{path:"/training",element:h.jsx(xk,{})}),h.jsx(go,{path:"/training/:jobId",element:h.jsx(xk,{})}),h.jsx(go,{path:"/inference",element:h.jsx(cDe,{})}),h.jsx(go,{path:"/calibration",element:h.jsx(Ose,{})}),h.jsx(go,{path:"/edit-dataset",element:h.jsx(uDe,{})}),h.jsx(go,{path:"*",element:h.jsx(fDe,{})})]})}),h.jsx(VX,{})]})})})})})})})})}z3(document.getElementById("root")).render(h.jsx(yDe,{})); + A `).concat(y,",").concat(y,",0,0,").concat(c,",").concat(e,",").concat(n+i-s*y," Z")}else u="M ".concat(e,",").concat(n," h ").concat(r," v ").concat(i," h ").concat(-r," Z");return u},GPe=function(e,n){if(!e||!n)return!1;var r=e.x,i=e.y,o=n.x,a=n.y,s=n.width,l=n.height;if(Math.abs(s)>0&&Math.abs(l)>0){var c=Math.min(o,o+s),u=Math.max(o,o+s),d=Math.min(a,a+l),f=Math.max(a,a+l);return r>=c&&r<=u&&i>=d&&i<=f}return!1},WPe={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},yP=function(e){var n=CL(CL({},WPe),e),r=_.useRef(),i=_.useState(-1),o=jPe(i,2),a=o[0],s=o[1];_.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var S=r.current.getTotalLength();S&&s(S)}catch{}},[]);var l=n.x,c=n.y,u=n.width,d=n.height,f=n.radius,p=n.className,y=n.animationEasing,v=n.animationDuration,g=n.animationBegin,m=n.isAnimationActive,x=n.isUpdateAnimationActive;if(l!==+l||c!==+c||u!==+u||d!==+d||u===0||d===0)return null;var b=zt("recharts-rectangle",p);return x?Q.createElement(us,{canBegin:a>0,from:{width:u,height:d,x:l,y:c},to:{width:u,height:d,x:l,y:c},duration:v,animationEasing:y,isActive:x},function(S){var w=S.width,E=S.height,T=S.x,A=S.y;return Q.createElement(us,{canBegin:a>0,from:"0px ".concat(a===-1?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:v,isActive:m,easing:y},Q.createElement("path",x0({},$t(n,!0),{className:b,d:PL(T,A,w,E,f),ref:r})))}):Q.createElement("path",x0({},$t(n,!0),{className:b,d:PL(l,c,u,d,f)}))};function RT(){return RT=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function QPe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}var eRe=function(e,n,r,i,o,a){return"M".concat(e,",").concat(o,"v").concat(i,"M").concat(a,",").concat(n,"h").concat(r)},tRe=function(e){var n=e.x,r=n===void 0?0:n,i=e.y,o=i===void 0?0:i,a=e.top,s=a===void 0?0:a,l=e.left,c=l===void 0?0:l,u=e.width,d=u===void 0?0:u,f=e.height,p=f===void 0?0:f,y=e.className,v=ZPe(e,XPe),g=qPe({x:r,y:o,top:s,left:c,width:d,height:p},v);return!ze(r)||!ze(o)||!ze(d)||!ze(p)||!ze(s)||!ze(c)?null:Q.createElement("path",NT({},$t(g,!0),{className:zt("recharts-cross",y),d:eRe(r,o,d,p,s,c)}))},nRe=z5,rRe=nRe(Object.getPrototypeOf,Object),iRe=rRe,oRe=hs,aRe=iRe,sRe=ps,lRe="[object Object]",cRe=Function.prototype,uRe=Object.prototype,AV=cRe.toString,dRe=uRe.hasOwnProperty,fRe=AV.call(Object);function hRe(t){if(!sRe(t)||oRe(t)!=lRe)return!1;var e=aRe(t);if(e===null)return!0;var n=dRe.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&AV.call(n)==fRe}var pRe=hRe;const mRe=dn(pRe);var gRe=hs,vRe=ps,yRe="[object Boolean]";function xRe(t){return t===!0||t===!1||vRe(t)&&gRe(t)==yRe}var bRe=xRe;const _Re=dn(bRe);function om(t){"@babel/helpers - typeof";return om=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},om(t)}function b0(){return b0=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n0,from:{upperWidth:0,lowerWidth:0,height:f,x:l,y:c},to:{upperWidth:u,lowerWidth:d,height:f,x:l,y:c},duration:v,animationEasing:y,isActive:m},function(b){var S=b.upperWidth,w=b.lowerWidth,E=b.height,T=b.x,A=b.y;return Q.createElement(us,{canBegin:a>0,from:"0px ".concat(a===-1?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:v,easing:y},Q.createElement("path",b0({},$t(n,!0),{className:x,d:DL(T,A,S,w,E),ref:r})))}):Q.createElement("g",null,Q.createElement("path",b0({},$t(n,!0),{className:x,d:DL(l,c,u,d,f)})))},ORe=["option","shapeType","propTransformer","activeClassName","isActive"];function am(t){"@babel/helpers - typeof";return am=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},am(t)}function IRe(t,e){if(t==null)return{};var n=DRe(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function DRe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function LL(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 _0(t){for(var e=1;e0&&r.handleDrag(i.changedTouches[0])}),wi(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=r.props,o=i.endIndex,a=i.onDragEnd,s=i.startIndex;a==null||a({endIndex:o,startIndex:s})}),r.detachDragEndListener()}),wi(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),wi(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),wi(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),wi(r,"handleSlideDragStart",function(i){var o=zL(i)?i.changedTouches[0]:i;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:o.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return xNe(e,t),mNe(e,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var i=r.startX,o=r.endX,a=this.state.scaleValues,s=this.props,l=s.gap,c=s.data,u=c.length-1,d=Math.min(i,o),f=Math.max(i,o),p=e.getIndexInRange(a,d),y=e.getIndexInRange(a,f);return{startIndex:p-p%l,endIndex:y===u?u:y-y%l}}},{key:"getTextOfTick",value:function(r){var i=this.props,o=i.data,a=i.tickFormatter,s=i.dataKey,l=Di(o[r],s,r);return jt(a)?a(l,r):l}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var i=this.state,o=i.slideMoveStartX,a=i.startX,s=i.endX,l=this.props,c=l.x,u=l.width,d=l.travellerWidth,f=l.startIndex,p=l.endIndex,y=l.onChange,v=r.pageX-o;v>0?v=Math.min(v,c+u-d-s,c+u-d-a):v<0&&(v=Math.max(v,c-a,c-s));var g=this.getIndex({startX:a+v,endX:s+v});(g.startIndex!==f||g.endIndex!==p)&&y&&y(g),this.setState({startX:a+v,endX:s+v,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,i){var o=zL(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:o.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var i=this.state,o=i.brushMoveStartX,a=i.movingTravellerId,s=i.endX,l=i.startX,c=this.state[a],u=this.props,d=u.x,f=u.width,p=u.travellerWidth,y=u.onChange,v=u.gap,g=u.data,m={startX:this.state.startX,endX:this.state.endX},x=r.pageX-o;x>0?x=Math.min(x,d+f-p-c):x<0&&(x=Math.max(x,d-c)),m[a]=c+x;var b=this.getIndex(m),S=b.startIndex,w=b.endIndex,E=function(){var A=g.length-1;return a==="startX"&&(s>l?S%v===0:w%v===0)||sl?w%v===0:S%v===0)||s>l&&w===A};this.setState(wi(wi({},a,c+x),"brushMoveStartX",r.pageX),function(){y&&E()&&y(b)})}},{key:"handleTravellerMoveKeyboard",value:function(r,i){var o=this,a=this.state,s=a.scaleValues,l=a.startX,c=a.endX,u=this.state[i],d=s.indexOf(u);if(d!==-1){var f=d+r;if(!(f===-1||f>=s.length)){var p=s[f];i==="startX"&&p>=c||i==="endX"&&p<=l||this.setState(wi({},i,p),function(){o.props.onChange(o.getIndex({startX:o.state.startX,endX:o.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,i=r.x,o=r.y,a=r.width,s=r.height,l=r.fill,c=r.stroke;return Q.createElement("rect",{stroke:c,fill:l,x:i,y:o,width:a,height:s})}},{key:"renderPanorama",value:function(){var r=this.props,i=r.x,o=r.y,a=r.width,s=r.height,l=r.data,c=r.children,u=r.padding,d=_.Children.only(c);return d?Q.cloneElement(d,{x:i,y:o,width:a,height:s,margin:u,compact:!0,data:l}):null}},{key:"renderTravellerLayer",value:function(r,i){var o,a,s=this,l=this.props,c=l.y,u=l.travellerWidth,d=l.height,f=l.traveller,p=l.ariaLabel,y=l.data,v=l.startIndex,g=l.endIndex,m=Math.max(r,this.props.x),x=aS(aS({},$t(this.props,!1)),{},{x:m,y:c,width:u,height:d}),b=p||"Min value: ".concat((o=y[v])===null||o===void 0?void 0:o.name,", Max value: ").concat((a=y[g])===null||a===void 0?void 0:a.name);return Q.createElement(kn,{tabIndex:0,role:"slider","aria-label":b,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(w){["ArrowLeft","ArrowRight"].includes(w.key)&&(w.preventDefault(),w.stopPropagation(),s.handleTravellerMoveKeyboard(w.key==="ArrowRight"?1:-1,i))},onFocus:function(){s.setState({isTravellerFocused:!0})},onBlur:function(){s.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},e.renderTraveller(f,x))}},{key:"renderSlide",value:function(r,i){var o=this.props,a=o.y,s=o.height,l=o.stroke,c=o.travellerWidth,u=Math.min(r,i)+c,d=Math.max(Math.abs(i-r)-c,0);return Q.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:l,fillOpacity:.2,x:u,y:a,width:d,height:s})}},{key:"renderText",value:function(){var r=this.props,i=r.startIndex,o=r.endIndex,a=r.y,s=r.height,l=r.travellerWidth,c=r.stroke,u=this.state,d=u.startX,f=u.endX,p=5,y={pointerEvents:"none",fill:c};return Q.createElement(kn,{className:"recharts-brush-texts"},Q.createElement(Qy,S0({textAnchor:"end",verticalAnchor:"middle",x:Math.min(d,f)-p,y:a+s/2},y),this.getTextOfTick(i)),Q.createElement(Qy,S0({textAnchor:"start",verticalAnchor:"middle",x:Math.max(d,f)+l+p,y:a+s/2},y),this.getTextOfTick(o)))}},{key:"render",value:function(){var r=this.props,i=r.data,o=r.className,a=r.children,s=r.x,l=r.y,c=r.width,u=r.height,d=r.alwaysShowText,f=this.state,p=f.startX,y=f.endX,v=f.isTextActive,g=f.isSlideMoving,m=f.isTravellerMoving,x=f.isTravellerFocused;if(!i||!i.length||!ze(s)||!ze(l)||!ze(c)||!ze(u)||c<=0||u<=0)return null;var b=zt("recharts-brush",o),S=Q.Children.count(a)===1,w=hNe("userSelect","none");return Q.createElement(kn,{className:b,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:w},this.renderBackground(),S&&this.renderPanorama(),this.renderSlide(p,y),this.renderTravellerLayer(p,"startX"),this.renderTravellerLayer(y,"endX"),(v||g||m||x||d)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var i=r.x,o=r.y,a=r.width,s=r.height,l=r.stroke,c=Math.floor(o+s/2)-1;return Q.createElement(Q.Fragment,null,Q.createElement("rect",{x:i,y:o,width:a,height:s,fill:l,stroke:"none"}),Q.createElement("line",{x1:i+1,y1:c,x2:i+a-1,y2:c,fill:"none",stroke:"#fff"}),Q.createElement("line",{x1:i+1,y1:c+2,x2:i+a-1,y2:c+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,i){var o;return Q.isValidElement(r)?o=Q.cloneElement(r,i):jt(r)?o=r(i):o=e.renderDefaultTraveller(i),o}},{key:"getDerivedStateFromProps",value:function(r,i){var o=r.data,a=r.width,s=r.x,l=r.travellerWidth,c=r.updateId,u=r.startIndex,d=r.endIndex;if(o!==i.prevData||c!==i.prevUpdateId)return aS({prevData:o,prevTravellerWidth:l,prevUpdateId:c,prevX:s,prevWidth:a},o&&o.length?_Ne({data:o,width:a,x:s,travellerWidth:l,startIndex:u,endIndex:d}):{scale:null,scaleValues:null});if(i.scale&&(a!==i.prevWidth||s!==i.prevX||l!==i.prevTravellerWidth)){i.scale.range([s,s+a-l]);var f=i.scale.domain().map(function(p){return i.scale(p)});return{prevData:o,prevTravellerWidth:l,prevUpdateId:c,prevX:s,prevWidth:a,startX:i.scale(r.startIndex),endX:i.scale(r.endIndex),scaleValues:f}}return null}},{key:"getIndexInRange",value:function(r,i){for(var o=r.length,a=0,s=o-1;s-a>1;){var l=Math.floor((a+s)/2);r[l]>i?s=l:a=l}return i>=r[s]?s:a}}])}(_.PureComponent);wi(ef,"displayName","Brush");wi(ef,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var wNe=VC;function SNe(t,e){var n;return wNe(t,function(r,i,o){return n=e(r,i,o),!n}),!!n}var ENe=SNe,TNe=D5,MNe=kf,ANe=ENe,CNe=yi,PNe=Eb;function RNe(t,e,n){var r=CNe(t)?TNe:ANe;return n&&PNe(t,e,n)&&(e=void 0),r(t,MNe(e))}var NNe=RNe;const ONe=dn(NNe);var ya=function(e,n){var r=e.alwaysShow,i=e.ifOverflow;return r&&(i="extendDomain"),i===n},HL=tH;function INe(t,e,n){e=="__proto__"&&HL?HL(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var DNe=INe,LNe=DNe,kNe=Q5,jNe=kf;function UNe(t,e){var n={};return e=jNe(e),kNe(t,function(r,i,o){LNe(n,i,e(r,i,o))}),n}var FNe=UNe;const BNe=dn(FNe);function $Ne(t,e){for(var n=-1,r=t==null?0:t.length;++n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function oOe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function aOe(t,e){var n=t.x,r=t.y,i=iOe(t,eOe),o="".concat(n),a=parseInt(o,10),s="".concat(r),l=parseInt(s,10),c="".concat(e.height||i.height),u=parseInt(c,10),d="".concat(e.width||i.width),f=parseInt(d,10);return _h(_h(_h(_h(_h({},e),i),a?{x:a}:{}),l?{y:l}:{}),{},{height:u,width:f,name:e.name,radius:e.radius})}function GL(t){return Q.createElement($Re,IT({shapeType:"rectangle",propTransformer:aOe,activeClassName:"recharts-active-bar"},t))}var sOe=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,i){if(typeof e=="number")return e;var o=typeof r=="number";return o?e(r,i):(o||jc(),n)}},lOe=["value","background"],NV;function tf(t){"@babel/helpers - typeof";return tf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tf(t)}function cOe(t,e){if(t==null)return{};var n=uOe(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function uOe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function T0(){return T0=Object.assign?Object.assign.bind():function(t){for(var e=1;e0&&Math.abs(U)0&&Math.abs(k)0&&(D=Math.min(($||0)-(k[Y-1]||0),D))}),Number.isFinite(D)){var U=D/R,O=v.layout==="vertical"?r.height:r.width;if(v.padding==="gap"&&(T=U*O/2),v.padding==="no-gap"){var X=Lc(e.barCategoryGap,U*O),L=U*O/2;T=L-X-(L-X)/O*X}}}i==="xAxis"?A=[r.left+(b.left||0)+(T||0),r.left+r.width-(b.right||0)-(T||0)]:i==="yAxis"?A=l==="horizontal"?[r.top+r.height-(b.bottom||0),r.top+(b.top||0)]:[r.top+(b.top||0)+(T||0),r.top+r.height-(b.bottom||0)-(T||0)]:A=v.range,w&&(A=[A[1],A[0]]);var j=HMe(v,o,f),K=j.scale,te=j.realScaleType;K.domain(m).range(A),VMe(K);var H=ZMe(K,To(To({},v),{},{realScaleType:te}));i==="xAxis"?(P=g==="top"&&!S||g==="bottom"&&S,M=r.left,C=d[E]-P*v.height):i==="yAxis"&&(P=g==="left"&&!S||g==="right"&&S,M=d[E]-P*v.width,C=r.top);var q=To(To(To({},v),H),{},{realScaleType:te,x:M,y:C,scale:K,width:i==="xAxis"?r.width:v.width,height:i==="yAxis"?r.height:v.height});return q.bandSize=h0(q,H),!v.hide&&i==="xAxis"?d[E]+=(P?-1:1)*q.height:v.hide||(d[E]+=(P?-1:1)*q.width),To(To({},p),{},Ub({},y,q))},{})},LV=function(e,n){var r=e.x,i=e.y,o=n.x,a=n.y;return{x:Math.min(r,o),y:Math.min(i,a),width:Math.abs(o-r),height:Math.abs(a-i)}},wOe=function(e){var n=e.x1,r=e.y1,i=e.x2,o=e.y2;return LV({x:n,y:r},{x:i,y:o})},kV=function(){function t(e){yOe(this,t),this.scale=e}return xOe(t,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.bandAware,o=r.position;if(n!==void 0){if(o)switch(o){case"start":return this.scale(n);case"middle":{var a=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+a}case"end":{var s=this.bandwidth?this.bandwidth():0;return this.scale(n)+s}default:return this.scale(n)}if(i){var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+l}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),i=r[0],o=r[r.length-1];return i<=o?n>=i&&n<=o:n>=o&&n<=i}}],[{key:"create",value:function(n){return new t(n)}}])}();Ub(kV,"EPS",1e-4);var bP=function(e){var n=Object.keys(e).reduce(function(r,i){return To(To({},r),{},Ub({},i,kV.create(e[i])))},{});return To(To({},n),{},{apply:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=o.bandAware,s=o.position;return BNe(i,function(l,c){return n[c].apply(l,{bandAware:a,position:s})})},isInRange:function(i){return QNe(i,function(o,a){return n[a].isInRange(o)})}})};function SOe(t){return(t%180+180)%180}var EOe=function(e){var n=e.width,r=e.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=SOe(i),a=o*Math.PI/180,s=Math.atan(r/n),l=a>s&&at.length)&&(e=t.length);for(var n=0,r=new Array(e);nt*i)return!1;var o=n();return t*(e-t*o/2-r)>=0&&t*(e+t*o/2-i)<=0}function d2e(t,e){return QV(t,e+1)}function f2e(t,e,n,r,i){for(var o=(r||[]).slice(),a=e.start,s=e.end,l=0,c=1,u=a,d=function(){var y=r==null?void 0:r[l];if(y===void 0)return{v:QV(r,c)};var v=l,g,m=function(){return g===void 0&&(g=n(y,v)),g},x=y.coordinate,b=l===0||R0(t,x,m,u,s);b||(l=0,u=a,c+=1),b&&(u=x+t*(m()/2+i),l+=c)},f;c<=o.length;)if(f=d(),f)return f.v;return[]}function dm(t){"@babel/helpers - typeof";return dm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},dm(t)}function ik(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 Rr(t){for(var e=1;e0?p.coordinate-g*t:p.coordinate})}else o[f]=p=Rr(Rr({},p),{},{tickCoord:p.coordinate});var m=R0(t,p.tickCoord,v,s,l);m&&(l=p.tickCoord-t*(v()/2+i),o[f]=Rr(Rr({},p),{},{isShow:!0}))},u=a-1;u>=0;u--)c(u);return o}function v2e(t,e,n,r,i,o){var a=(r||[]).slice(),s=a.length,l=e.start,c=e.end;if(o){var u=r[s-1],d=n(u,s-1),f=t*(u.coordinate+t*d/2-c);a[s-1]=u=Rr(Rr({},u),{},{tickCoord:f>0?u.coordinate-f*t:u.coordinate});var p=R0(t,u.tickCoord,function(){return d},l,c);p&&(c=u.tickCoord-t*(d/2+i),a[s-1]=Rr(Rr({},u),{},{isShow:!0}))}for(var y=o?s-1:s,v=function(x){var b=a[x],S,w=function(){return S===void 0&&(S=n(b,x)),S};if(x===0){var E=t*(b.coordinate-t*w()/2-l);a[x]=b=Rr(Rr({},b),{},{tickCoord:E<0?b.coordinate-E*t:b.coordinate})}else a[x]=b=Rr(Rr({},b),{},{tickCoord:b.coordinate});var T=R0(t,b.tickCoord,w,l,c);T&&(l=b.tickCoord+t*(w()/2+i),a[x]=Rr(Rr({},b),{},{isShow:!0}))},g=0;g=2?Lo(i[1].coordinate-i[0].coordinate):1,m=u2e(o,g,p);return l==="equidistantPreserveStart"?f2e(g,m,v,i,a):(l==="preserveStart"||l==="preserveStartEnd"?f=v2e(g,m,v,i,a,l==="preserveStartEnd"):f=g2e(g,m,v,i,a),f.filter(function(x){return x.isShow}))}var x2e=["viewBox"],b2e=["viewBox"],_2e=["ticks"];function af(t){"@babel/helpers - typeof";return af=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},af(t)}function Xu(){return Xu=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function w2e(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function S2e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ak(t,e){for(var n=0;n0?l(this.props):l(p)),a<=0||s<=0||!y||!y.length?null:Q.createElement(kn,{className:zt("recharts-cartesian-axis",c),ref:function(g){r.layerReference=g}},o&&this.renderAxisLine(),this.renderTicks(y,this.state.fontSize,this.state.letterSpacing),Or.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,i,o){var a;return Q.isValidElement(r)?a=Q.cloneElement(r,i):jt(r)?a=r(i):a=Q.createElement(Qy,Xu({},i,{className:"recharts-cartesian-axis-tick-value"}),o),a}}])}(_.Component);SP(Hb,"displayName","CartesianAxis");SP(Hb,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var R2e=["type","layout","connectNulls","ref"],N2e=["key"];function sf(t){"@babel/helpers - typeof";return sf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},sf(t)}function sk(t,e){if(t==null)return{};var n=O2e(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function O2e(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function Zh(){return Zh=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);nd){p=[].concat(Tu(l.slice(0,y)),[d-v]);break}var g=p.length%2===0?[0,f]:[f];return[].concat(Tu(e.repeat(l,u)),Tu(p),g).map(function(m){return"".concat(m,"px")}).join(", ")}),Mo(n,"id",$m("recharts-line-")),Mo(n,"pathRef",function(a){n.mainCurve=a}),Mo(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),Mo(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return z2e(e,t),U2e(e,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();this.setState({totalLength:r})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();r!==this.state.totalLength&&this.setState({totalLength:r})}}},{key:"getTotalLength",value:function(){var r=this.mainCurve;try{return r&&r.getTotalLength&&r.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(r,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,a=o.points,s=o.xAxis,l=o.yAxis,c=o.layout,u=o.children,d=ro(u,Wm);if(!d)return null;var f=function(v,g){return{x:v.x,y:v.y,value:v.value,errorVal:Di(v.payload,g)}},p={clipPath:r?"url(#clipPath-".concat(i,")"):null};return Q.createElement(kn,p,d.map(function(y){return Q.cloneElement(y,{key:"bar-".concat(y.props.dataKey),data:a,xAxis:s,yAxis:l,layout:c,dataPointFormatter:f})}))}},{key:"renderDots",value:function(r,i,o){var a=this.props.isAnimationActive;if(a&&!this.state.isAnimationFinished)return null;var s=this.props,l=s.dot,c=s.points,u=s.dataKey,d=$t(this.props,!1),f=$t(l,!0),p=c.map(function(v,g){var m=_i(_i(_i({key:"dot-".concat(g),r:3},d),f),{},{index:g,cx:v.x,cy:v.y,value:v.value,dataKey:u,payload:v.payload,points:c});return e.renderDotItem(l,m)}),y={clipPath:r?"url(#clipPath-".concat(i?"":"dots-").concat(o,")"):null};return Q.createElement(kn,Zh({className:"recharts-line-dots",key:"dots"},y),p)}},{key:"renderCurveStatically",value:function(r,i,o,a){var s=this.props,l=s.type,c=s.layout,u=s.connectNulls;s.ref;var d=sk(s,R2e),f=_i(_i(_i({},$t(d,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(o,")"):null,points:r},a),{},{type:l,layout:c,connectNulls:u});return Q.createElement(bT,Zh({},f,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,i){var o=this,a=this.props,s=a.points,l=a.strokeDasharray,c=a.isAnimationActive,u=a.animationBegin,d=a.animationDuration,f=a.animationEasing,p=a.animationId,y=a.animateNewValues,v=a.width,g=a.height,m=this.state,x=m.prevPoints,b=m.totalLength;return Q.createElement(us,{begin:u,duration:d,isActive:c,easing:f,from:{t:0},to:{t:1},key:"line-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(S){var w=S.t;if(x){var E=x.length/s.length,T=s.map(function(R,D){var k=Math.floor(D*E);if(x[k]){var U=x[k],O=Po(U.x,R.x),X=Po(U.y,R.y);return _i(_i({},R),{},{x:O(w),y:X(w)})}if(y){var L=Po(v*2,R.x),j=Po(g/2,R.y);return _i(_i({},R),{},{x:L(w),y:j(w)})}return _i(_i({},R),{},{x:R.x,y:R.y})});return o.renderCurveStatically(T,r,i)}var A=Po(0,b),M=A(w),C;if(l){var P="".concat(l).split(/[,\s]+/gim).map(function(R){return parseFloat(R)});C=o.getStrokeDasharray(M,b,P)}else C=o.generateSimpleStrokeDasharray(b,M);return o.renderCurveStatically(s,r,i,{strokeDasharray:C})})}},{key:"renderCurve",value:function(r,i){var o=this.props,a=o.points,s=o.isAnimationActive,l=this.state,c=l.prevPoints,u=l.totalLength;return s&&a&&a.length&&(!c&&u>0||!Ib(c,a))?this.renderCurveWithAnimation(r,i):this.renderCurveStatically(a,r,i)}},{key:"render",value:function(){var r,i=this.props,o=i.hide,a=i.dot,s=i.points,l=i.className,c=i.xAxis,u=i.yAxis,d=i.top,f=i.left,p=i.width,y=i.height,v=i.isAnimationActive,g=i.id;if(o||!s||!s.length)return null;var m=this.state.isAnimationFinished,x=s.length===1,b=zt("recharts-line",l),S=c&&c.allowDataOverflow,w=u&&u.allowDataOverflow,E=S||w,T=Ut(g)?this.id:g,A=(r=$t(a,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},M=A.r,C=M===void 0?3:M,P=A.strokeWidth,R=P===void 0?2:P,D=Ihe(a)?a:{},k=D.clipDot,U=k===void 0?!0:k,O=C*2+R;return Q.createElement(kn,{className:b},S||w?Q.createElement("defs",null,Q.createElement("clipPath",{id:"clipPath-".concat(T)},Q.createElement("rect",{x:S?f:f-p/2,y:w?d:d-y/2,width:S?p:p*2,height:w?y:y*2})),!U&&Q.createElement("clipPath",{id:"clipPath-dots-".concat(T)},Q.createElement("rect",{x:f-O/2,y:d-O/2,width:p+O,height:y+O}))):null,!x&&this.renderCurve(E,T),this.renderErrorBar(E,T),(x||a)&&this.renderDots(E,U,T),(!v||m)&&il.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:i.curPoints}:r.points!==i.curPoints?{curPoints:r.points}:null}},{key:"repeat",value:function(r,i){for(var o=r.length%2!==0?[].concat(Tu(r),[0]):r,a=[],s=0;st.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function NIe(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function OIe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function IIe(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n0?a:e&&e.length&&ze(i)&&ze(o)?e.slice(i,o+1):[]};function vG(t){return t==="number"?[0,"auto"]:void 0}var ZT=function(e,n,r,i){var o=e.graphicalItems,a=e.tooltipAxis,s=Vb(n,e);return r<0||!o||!o.length||r>=s.length?null:o.reduce(function(l,c){var u,d=(u=c.props.data)!==null&&u!==void 0?u:n;d&&e.dataStartIndex+e.dataEndIndex!==0&&e.dataEndIndex-e.dataStartIndex>=r&&(d=d.slice(e.dataStartIndex,e.dataEndIndex+1));var f;if(a.dataKey&&!a.allowDuplicatedCategory){var p=d===void 0?s:d;f=jy(p,a.dataKey,i)}else f=d&&d[r]||s[r];return f?[].concat(ff(l),[hV(c,f)]):l},[])},mk=function(e,n,r,i){var o=i||{x:e.chartX,y:e.chartY},a=GIe(o,r),s=e.orderedTooltipTicks,l=e.tooltipAxis,c=e.tooltipTicks,u=jMe(a,s,c,l);if(u>=0&&c){var d=c[u]&&c[u].value,f=ZT(e,n,u,d),p=WIe(r,s,u,o);return{activeTooltipIndex:u,activeLabel:d,activePayload:f,activeCoordinate:p}}return null},XIe=function(e,n){var r=n.axes,i=n.graphicalItems,o=n.axisType,a=n.axisIdKey,s=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=e.layout,d=e.children,f=e.stackOffset,p=dV(u,o);return r.reduce(function(y,v){var g,m=v.type.defaultProps!==void 0?ve(ve({},v.type.defaultProps),v.props):v.props,x=m.type,b=m.dataKey,S=m.allowDataOverflow,w=m.allowDuplicatedCategory,E=m.scale,T=m.ticks,A=m.includeHidden,M=m[a];if(y[M])return y;var C=Vb(e.data,{graphicalItems:i.filter(function(H){var q,$=a in H.props?H.props[a]:(q=H.type.defaultProps)===null||q===void 0?void 0:q[a];return $===M}),dataStartIndex:l,dataEndIndex:c}),P=C.length,R,D,k;xIe(m.domain,S,x)&&(R=mT(m.domain,null,S),p&&(x==="number"||E!=="auto")&&(k=Yh(C,b,"category")));var U=vG(x);if(!R||R.length===0){var O,X=(O=m.domain)!==null&&O!==void 0?O:U;if(b){if(R=Yh(C,b,x),x==="category"&&p){var L=She(R);w&&L?(D=R,R=w0(0,P)):w||(R=KD(X,R,v).reduce(function(H,q){return H.indexOf(q)>=0?H:[].concat(ff(H),[q])},[]))}else if(x==="category")w?R=R.filter(function(H){return H!==""&&!Ut(H)}):R=KD(X,R,v).reduce(function(H,q){return H.indexOf(q)>=0||q===""||Ut(q)?H:[].concat(ff(H),[q])},[]);else if(x==="number"){var j=zMe(C,i.filter(function(H){var q,$,Y=a in H.props?H.props[a]:(q=H.type.defaultProps)===null||q===void 0?void 0:q[a],ee="hide"in H.props?H.props.hide:($=H.type.defaultProps)===null||$===void 0?void 0:$.hide;return Y===M&&(A||!ee)}),b,o,u);j&&(R=j)}p&&(x==="number"||E!=="auto")&&(k=Yh(C,b,"category"))}else p?R=w0(0,P):s&&s[M]&&s[M].hasStack&&x==="number"?R=f==="expand"?[0,1]:fV(s[M].stackGroups,l,c):R=uV(C,i.filter(function(H){var q=a in H.props?H.props[a]:H.type.defaultProps[a],$="hide"in H.props?H.props.hide:H.type.defaultProps.hide;return q===M&&(A||!$)}),x,u,!0);if(x==="number")R=KT(d,R,M,o,T),X&&(R=mT(X,R,S));else if(x==="category"&&X){var K=X,te=R.every(function(H){return K.indexOf(H)>=0});te&&(R=K)}}return ve(ve({},y),{},bt({},M,ve(ve({},m),{},{axisType:o,domain:R,categoricalDomain:k,duplicateDomain:D,originalDomain:(g=m.domain)!==null&&g!==void 0?g:U,isCategorical:p,layout:u})))},{})},qIe=function(e,n){var r=n.graphicalItems,i=n.Axis,o=n.axisType,a=n.axisIdKey,s=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=e.layout,d=e.children,f=Vb(e.data,{graphicalItems:r,dataStartIndex:l,dataEndIndex:c}),p=f.length,y=dV(u,o),v=-1;return r.reduce(function(g,m){var x=m.type.defaultProps!==void 0?ve(ve({},m.type.defaultProps),m.props):m.props,b=x[a],S=vG("number");if(!g[b]){v++;var w;return y?w=w0(0,p):s&&s[b]&&s[b].hasStack?(w=fV(s[b].stackGroups,l,c),w=KT(d,w,b,o)):(w=mT(S,uV(f,r.filter(function(E){var T,A,M=a in E.props?E.props[a]:(T=E.type.defaultProps)===null||T===void 0?void 0:T[a],C="hide"in E.props?E.props.hide:(A=E.type.defaultProps)===null||A===void 0?void 0:A.hide;return M===b&&!C}),"number",u),i.defaultProps.allowDataOverflow),w=KT(d,w,b,o)),ve(ve({},g),{},bt({},b,ve(ve({axisType:o},i.defaultProps),{},{hide:!0,orientation:no(HIe,"".concat(o,".").concat(v%2),null),domain:w,originalDomain:S,isCategorical:y,layout:u})))}return g},{})},KIe=function(e,n){var r=n.axisType,i=r===void 0?"xAxis":r,o=n.AxisComp,a=n.graphicalItems,s=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=e.children,d="".concat(i,"Id"),f=ro(u,o),p={};return f&&f.length?p=XIe(e,{axes:f,graphicalItems:a,axisType:i,axisIdKey:d,stackGroups:s,dataStartIndex:l,dataEndIndex:c}):a&&a.length&&(p=qIe(e,{Axis:o,graphicalItems:a,axisType:i,axisIdKey:d,stackGroups:s,dataStartIndex:l,dataEndIndex:c})),p},YIe=function(e){var n=Cu(e),r=ic(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:GC(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:h0(n,r)}},gk=function(e){var n=e.children,r=e.defaultShowTooltip,i=Ei(n,ef),o=0,a=0;return e.data&&e.data.length!==0&&(a=e.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(o=i.props.startIndex),i.props.endIndex>=0&&(a=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:a,activeTooltipIndex:-1,isTooltipActive:!!r}},JIe=function(e){return!e||!e.length?!1:e.some(function(n){var r=Za(n&&n.type);return r&&r.indexOf("Bar")>=0})},vk=function(e){return e==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:e==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:e==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},ZIe=function(e,n){var r=e.props,i=e.graphicalItems,o=e.xAxisMap,a=o===void 0?{}:o,s=e.yAxisMap,l=s===void 0?{}:s,c=r.width,u=r.height,d=r.children,f=r.margin||{},p=Ei(d,ef),y=Ei(d,hd),v=Object.keys(l).reduce(function(w,E){var T=l[E],A=T.orientation;return!T.mirror&&!T.hide?ve(ve({},w),{},bt({},A,w[A]+T.width)):w},{left:f.left||0,right:f.right||0}),g=Object.keys(a).reduce(function(w,E){var T=a[E],A=T.orientation;return!T.mirror&&!T.hide?ve(ve({},w),{},bt({},A,no(w,"".concat(A))+T.height)):w},{top:f.top||0,bottom:f.bottom||0}),m=ve(ve({},g),v),x=m.bottom;p&&(m.bottom+=p.props.height||ef.defaultProps.height),y&&n&&(m=BMe(m,i,r,n));var b=c-m.left-m.right,S=u-m.top-m.bottom;return ve(ve({brushBottom:x},m),{},{width:Math.max(b,0),height:Math.max(S,0)})},QIe=function(e,n){if(n==="xAxis")return e[n].width;if(n==="yAxis")return e[n].height},eDe=function(e){var n=e.chartName,r=e.GraphicalChild,i=e.defaultTooltipEventType,o=i===void 0?"axis":i,a=e.validateTooltipEventTypes,s=a===void 0?["axis"]:a,l=e.axisComponents,c=e.legendContent,u=e.formatAxisMap,d=e.defaultProps,f=function(m,x){var b=x.graphicalItems,S=x.stackGroups,w=x.offset,E=x.updateId,T=x.dataStartIndex,A=x.dataEndIndex,M=m.barSize,C=m.layout,P=m.barGap,R=m.barCategoryGap,D=m.maxBarSize,k=vk(C),U=k.numericAxisName,O=k.cateAxisName,X=JIe(b),L=[];return b.forEach(function(j,K){var te=Vb(m.data,{graphicalItems:[j],dataStartIndex:T,dataEndIndex:A}),H=j.type.defaultProps!==void 0?ve(ve({},j.type.defaultProps),j.props):j.props,q=H.dataKey,$=H.maxBarSize,Y=H["".concat(U,"Id")],ee=H["".concat(O,"Id")],J={},ce=l.reduce(function(it,Ft){var Z=x["".concat(Ft.axisType,"Map")],F=H["".concat(Ft.axisType,"Id")];Z&&Z[F]||Ft.axisType==="zAxis"||jc();var ue=Z[F];return ve(ve({},it),{},bt(bt({},Ft.axisType,ue),"".concat(Ft.axisType,"Ticks"),ic(ue)))},J),ae=ce[O],fe=ce["".concat(O,"Ticks")],we=S&&S[Y]&&S[Y].hasStack&&eAe(j,S[Y].stackGroups),le=Za(j.type).indexOf("Bar")>=0,ie=h0(ae,fe),W=[],Ve=X&&UMe({barSize:M,stackGroups:S,totalSize:QIe(ce,O)});if(le){var Ne,st,Re=Ut($)?D:$,ct=(Ne=(st=h0(ae,fe,!0))!==null&&st!==void 0?st:Re)!==null&&Ne!==void 0?Ne:0;W=FMe({barGap:P,barCategoryGap:R,bandSize:ct!==ie?ct:ie,sizeList:Ve[ee],maxBarSize:Re}),ct!==ie&&(W=W.map(function(it){return ve(ve({},it),{},{position:ve(ve({},it.position),{},{offset:it.position.offset-ct/2})})}))}var Ye=j&&j.type&&j.type.getComposedData;Ye&&L.push({props:ve(ve({},Ye(ve(ve({},ce),{},{displayedData:te,props:m,dataKey:q,item:j,bandSize:ie,barPosition:W,offset:w,stackedData:we,layout:C,dataStartIndex:T,dataEndIndex:A}))),{},bt(bt(bt({key:j.key||"item-".concat(K)},U,ce[U]),O,ce[O]),"animationId",E)),childIndex:khe(j,m.children),item:j})}),L},p=function(m,x){var b=m.props,S=m.dataStartIndex,w=m.dataEndIndex,E=m.updateId;if(!$2({props:b}))return null;var T=b.children,A=b.layout,M=b.stackOffset,C=b.data,P=b.reverseStackOrder,R=vk(A),D=R.numericAxisName,k=R.cateAxisName,U=ro(T,r),O=JMe(C,U,"".concat(D,"Id"),"".concat(k,"Id"),M,P),X=l.reduce(function(H,q){var $="".concat(q.axisType,"Map");return ve(ve({},H),{},bt({},$,KIe(b,ve(ve({},q),{},{graphicalItems:U,stackGroups:q.axisType===D&&O,dataStartIndex:S,dataEndIndex:w}))))},{}),L=ZIe(ve(ve({},X),{},{props:b,graphicalItems:U}),x==null?void 0:x.legendBBox);Object.keys(X).forEach(function(H){X[H]=u(b,X[H],L,H.replace("Map",""),n)});var j=X["".concat(k,"Map")],K=YIe(j),te=f(b,ve(ve({},X),{},{dataStartIndex:S,dataEndIndex:w,updateId:E,graphicalItems:U,stackGroups:O,offset:L}));return ve(ve({formattedGraphicalItems:te,graphicalItems:U,offset:L,stackGroups:O},K),X)},y=function(g){function m(x){var b,S,w;return OIe(this,m),w=LIe(this,m,[x]),bt(w,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),bt(w,"accessibilityManager",new yIe),bt(w,"handleLegendBBoxUpdate",function(E){if(E){var T=w.state,A=T.dataStartIndex,M=T.dataEndIndex,C=T.updateId;w.setState(ve({legendBBox:E},p({props:w.props,dataStartIndex:A,dataEndIndex:M,updateId:C},ve(ve({},w.state),{},{legendBBox:E}))))}}),bt(w,"handleReceiveSyncEvent",function(E,T,A){if(w.props.syncId===E){if(A===w.eventEmitterSymbol&&typeof w.props.syncMethod!="function")return;w.applySyncEvent(T)}}),bt(w,"handleBrushChange",function(E){var T=E.startIndex,A=E.endIndex;if(T!==w.state.dataStartIndex||A!==w.state.dataEndIndex){var M=w.state.updateId;w.setState(function(){return ve({dataStartIndex:T,dataEndIndex:A},p({props:w.props,dataStartIndex:T,dataEndIndex:A,updateId:M},w.state))}),w.triggerSyncEvent({dataStartIndex:T,dataEndIndex:A})}}),bt(w,"handleMouseEnter",function(E){var T=w.getMouseInfo(E);if(T){var A=ve(ve({},T),{},{isTooltipActive:!0});w.setState(A),w.triggerSyncEvent(A);var M=w.props.onMouseEnter;jt(M)&&M(A,E)}}),bt(w,"triggeredAfterMouseMove",function(E){var T=w.getMouseInfo(E),A=T?ve(ve({},T),{},{isTooltipActive:!0}):{isTooltipActive:!1};w.setState(A),w.triggerSyncEvent(A);var M=w.props.onMouseMove;jt(M)&&M(A,E)}),bt(w,"handleItemMouseEnter",function(E){w.setState(function(){return{isTooltipActive:!0,activeItem:E,activePayload:E.tooltipPayload,activeCoordinate:E.tooltipPosition||{x:E.cx,y:E.cy}}})}),bt(w,"handleItemMouseLeave",function(){w.setState(function(){return{isTooltipActive:!1}})}),bt(w,"handleMouseMove",function(E){E.persist(),w.throttleTriggeredAfterMouseMove(E)}),bt(w,"handleMouseLeave",function(E){w.throttleTriggeredAfterMouseMove.cancel();var T={isTooltipActive:!1};w.setState(T),w.triggerSyncEvent(T);var A=w.props.onMouseLeave;jt(A)&&A(T,E)}),bt(w,"handleOuterEvent",function(E){var T=Lhe(E),A=no(w.props,"".concat(T));if(T&&jt(A)){var M,C;/.*touch.*/i.test(T)?C=w.getMouseInfo(E.changedTouches[0]):C=w.getMouseInfo(E),A((M=C)!==null&&M!==void 0?M:{},E)}}),bt(w,"handleClick",function(E){var T=w.getMouseInfo(E);if(T){var A=ve(ve({},T),{},{isTooltipActive:!0});w.setState(A),w.triggerSyncEvent(A);var M=w.props.onClick;jt(M)&&M(A,E)}}),bt(w,"handleMouseDown",function(E){var T=w.props.onMouseDown;if(jt(T)){var A=w.getMouseInfo(E);T(A,E)}}),bt(w,"handleMouseUp",function(E){var T=w.props.onMouseUp;if(jt(T)){var A=w.getMouseInfo(E);T(A,E)}}),bt(w,"handleTouchMove",function(E){E.changedTouches!=null&&E.changedTouches.length>0&&w.throttleTriggeredAfterMouseMove(E.changedTouches[0])}),bt(w,"handleTouchStart",function(E){E.changedTouches!=null&&E.changedTouches.length>0&&w.handleMouseDown(E.changedTouches[0])}),bt(w,"handleTouchEnd",function(E){E.changedTouches!=null&&E.changedTouches.length>0&&w.handleMouseUp(E.changedTouches[0])}),bt(w,"handleDoubleClick",function(E){var T=w.props.onDoubleClick;if(jt(T)){var A=w.getMouseInfo(E);T(A,E)}}),bt(w,"handleContextMenu",function(E){var T=w.props.onContextMenu;if(jt(T)){var A=w.getMouseInfo(E);T(A,E)}}),bt(w,"triggerSyncEvent",function(E){w.props.syncId!==void 0&&lS.emit(cS,w.props.syncId,E,w.eventEmitterSymbol)}),bt(w,"applySyncEvent",function(E){var T=w.props,A=T.layout,M=T.syncMethod,C=w.state.updateId,P=E.dataStartIndex,R=E.dataEndIndex;if(E.dataStartIndex!==void 0||E.dataEndIndex!==void 0)w.setState(ve({dataStartIndex:P,dataEndIndex:R},p({props:w.props,dataStartIndex:P,dataEndIndex:R,updateId:C},w.state)));else if(E.activeTooltipIndex!==void 0){var D=E.chartX,k=E.chartY,U=E.activeTooltipIndex,O=w.state,X=O.offset,L=O.tooltipTicks;if(!X)return;if(typeof M=="function")U=M(L,E);else if(M==="value"){U=-1;for(var j=0;j=0){var we,le;if(D.dataKey&&!D.allowDuplicatedCategory){var ie=typeof D.dataKey=="function"?fe:"payload.".concat(D.dataKey.toString());we=jy(j,ie,U),le=K&&te&&jy(te,ie,U)}else we=j==null?void 0:j[k],le=K&&te&&te[k];if(ee||Y){var W=E.props.activeIndex!==void 0?E.props.activeIndex:k;return[_.cloneElement(E,ve(ve(ve({},M.props),ce),{},{activeIndex:W})),null,null]}if(!Ut(we))return[ae].concat(ff(w.renderActivePoints({item:M,activePoint:we,basePoint:le,childIndex:k,isRange:K})))}else{var Ve,Ne=(Ve=w.getItemByXY(w.state.activeCoordinate))!==null&&Ve!==void 0?Ve:{graphicalItem:ae},st=Ne.graphicalItem,Re=st.item,ct=Re===void 0?E:Re,Ye=st.childIndex,it=ve(ve(ve({},M.props),ce),{},{activeIndex:Ye});return[_.cloneElement(ct,it),null,null]}return K?[ae,null,null]:[ae,null]}),bt(w,"renderCustomized",function(E,T,A){return _.cloneElement(E,ve(ve({key:"recharts-customized-".concat(A)},w.props),w.state))}),bt(w,"renderMap",{CartesianGrid:{handler:_v,once:!0},ReferenceArea:{handler:w.renderReferenceElement},ReferenceLine:{handler:_v},ReferenceDot:{handler:w.renderReferenceElement},XAxis:{handler:_v},YAxis:{handler:_v},Brush:{handler:w.renderBrush,once:!0},Bar:{handler:w.renderGraphicChild},Line:{handler:w.renderGraphicChild},Area:{handler:w.renderGraphicChild},Radar:{handler:w.renderGraphicChild},RadialBar:{handler:w.renderGraphicChild},Scatter:{handler:w.renderGraphicChild},Pie:{handler:w.renderGraphicChild},Funnel:{handler:w.renderGraphicChild},Tooltip:{handler:w.renderCursor,once:!0},PolarGrid:{handler:w.renderPolarGrid,once:!0},PolarAngleAxis:{handler:w.renderPolarAxis},PolarRadiusAxis:{handler:w.renderPolarAxis},Customized:{handler:w.renderCustomized}}),w.clipPathId="".concat((b=x.id)!==null&&b!==void 0?b:$m("recharts"),"-clip"),w.throttleTriggeredAfterMouseMove=sH(w.triggeredAfterMouseMove,(S=x.throttleDelay)!==null&&S!==void 0?S:1e3/60),w.state={},w}return UIe(m,g),DIe(m,[{key:"componentDidMount",value:function(){var b,S;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(b=this.props.margin.left)!==null&&b!==void 0?b:0,top:(S=this.props.margin.top)!==null&&S!==void 0?S:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var b=this.props,S=b.children,w=b.data,E=b.height,T=b.layout,A=Ei(S,Eo);if(A){var M=A.props.defaultIndex;if(!(typeof M!="number"||M<0||M>this.state.tooltipTicks.length-1)){var C=this.state.tooltipTicks[M]&&this.state.tooltipTicks[M].value,P=ZT(this.state,w,M,C),R=this.state.tooltipTicks[M].coordinate,D=(this.state.offset.top+E)/2,k=T==="horizontal",U=k?{x:R,y:D}:{y:R,x:D},O=this.state.formattedGraphicalItems.find(function(L){var j=L.item;return j.type.name==="Scatter"});O&&(U=ve(ve({},U),O.props.points[M].tooltipPosition),P=O.props.points[M].tooltipPayload);var X={activeTooltipIndex:M,isTooltipActive:!0,activeLabel:C,activePayload:P,activeCoordinate:U};this.setState(X),this.renderCursor(A),this.accessibilityManager.setIndex(M)}}}},{key:"getSnapshotBeforeUpdate",value:function(b,S){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==S.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==b.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==b.margin){var w,E;this.accessibilityManager.setDetails({offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(E=this.props.margin.top)!==null&&E!==void 0?E:0}})}return null}},{key:"componentDidUpdate",value:function(b){R1([Ei(b.children,Eo)],[Ei(this.props.children,Eo)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var b=Ei(this.props.children,Eo);if(b&&typeof b.props.shared=="boolean"){var S=b.props.shared?"axis":"item";return s.indexOf(S)>=0?S:o}return o}},{key:"getMouseInfo",value:function(b){if(!this.container)return null;var S=this.container,w=S.getBoundingClientRect(),E=cSe(w),T={chartX:Math.round(b.pageX-E.left),chartY:Math.round(b.pageY-E.top)},A=w.width/S.offsetWidth||1,M=this.inRange(T.chartX,T.chartY,A);if(!M)return null;var C=this.state,P=C.xAxisMap,R=C.yAxisMap,D=this.getTooltipEventType(),k=mk(this.state,this.props.data,this.props.layout,M);if(D!=="axis"&&P&&R){var U=Cu(P).scale,O=Cu(R).scale,X=U&&U.invert?U.invert(T.chartX):null,L=O&&O.invert?O.invert(T.chartY):null;return ve(ve({},T),{},{xValue:X,yValue:L},k)}return k?ve(ve({},T),k):null}},{key:"inRange",value:function(b,S){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,E=this.props.layout,T=b/w,A=S/w;if(E==="horizontal"||E==="vertical"){var M=this.state.offset,C=T>=M.left&&T<=M.left+M.width&&A>=M.top&&A<=M.top+M.height;return C?{x:T,y:A}:null}var P=this.state,R=P.angleAxisMap,D=P.radiusAxisMap;if(R&&D){var k=Cu(R);return ZD({x:T,y:A},k)}return null}},{key:"parseEventsOfWrapper",value:function(){var b=this.props.children,S=this.getTooltipEventType(),w=Ei(b,Eo),E={};w&&S==="axis"&&(w.props.trigger==="click"?E={onClick:this.handleClick}:E={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var T=Uy(this.props,this.handleOuterEvent);return ve(ve({},T),E)}},{key:"addListener",value:function(){lS.on(cS,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){lS.removeListener(cS,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(b,S,w){for(var E=this.state.formattedGraphicalItems,T=0,A=E.length;T{var v,g;const[i,o]=_.useState([]),[a,s]=_.useState([]),l=_.useRef(0),{baseUrl:c,fetchWithHeaders:u}=Dn();_.useEffect(()=>{let m=!1;return bZ(c,u,t).then(x=>{var E;if(m||x.length===0)return;const b=x.filter(T=>T.loss!=null).map(T=>({step:T.step,loss:T.loss})).slice(-2e3),S=x.filter(T=>T.lr!=null).map(T=>({step:T.step,lr:T.lr})).slice(-2e3);o(b),s(S);const w=((E=x[x.length-1])==null?void 0:E.step)??0;l.current=w}).catch(()=>{}),()=>{m=!0}},[c,u,t]),_.useEffect(()=>{const m=e.current_step;if(m0&&e.current_loss!=null){const x=e.current_loss;o(b=>{const S=b[b.length-1];return S&&S.step===m?b:[...b,{step:m,loss:x}].slice(-2e3)})}if(m>0&&e.current_lr!=null){const x=e.current_lr;s(b=>{const S=b[b.length-1];return S&&S.step===m?b:[...b,{step:m,lr:x}].slice(-2e3)})}},[e.current_step,e.current_loss,e.current_lr]);const d=n(),f=e.training_active&&e.total_steps===0,p=f?"Training startingโ€ฆ":`${e.current_step.toLocaleString()} / ${e.total_steps.toLocaleString()}`,y=e.eta_seconds!=null?r(e.eta_seconds):"โ€”";return h.jsxs("div",{className:"space-y-6",children:[h.jsx(Gr,{className:"bg-slate-800/50 border-slate-700 rounded-xl",children:h.jsxs(Wr,{className:"p-6",children:[h.jsxs("div",{className:"flex items-baseline justify-between mb-3",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg bg-blue-500/20 text-blue-400",children:h.jsx($u,{className:"w-5 h-5"})}),h.jsxs("div",{children:[h.jsx("h3",{className:"text-sm text-slate-400",children:"Progress"}),h.jsx("div",{className:"text-base font-semibold text-white",children:p})]})]}),h.jsxs("div",{className:"flex items-center gap-2 text-slate-300",children:[h.jsx(hE,{className:"w-4 h-4 text-purple-400"}),h.jsxs("span",{className:"text-sm",children:["ETA ",h.jsx("span",{className:"font-semibold text-white",children:y})]})]})]}),h.jsxs("div",{className:"relative h-8 w-full overflow-hidden rounded-md bg-slate-900 border border-slate-700",children:[h.jsx("div",{className:"h-full bg-gradient-to-r from-blue-500 to-sky-400 transition-[width] duration-500",style:{width:`${d}%`}}),h.jsx("div",{className:"absolute inset-0 flex items-center justify-center font-semibold text-white text-sm tabular-nums drop-shadow",children:f?"warming upโ€ฆ":`${d.toFixed(1)}%`})]})]})}),h.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[h.jsxs(Gr,{className:"bg-slate-800/50 border-slate-700 rounded-xl",children:[h.jsx(Uo,{className:"pb-2",children:h.jsxs(ga,{className:"flex items-center gap-3 text-white text-base",children:[h.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-green-500/20 text-green-400",children:h.jsx(qi,{className:"w-4 h-4"})}),h.jsxs("span",{children:["Loss"," ",h.jsxs("span",{className:"text-slate-400 text-sm font-normal",children:["(",((v=e.current_loss)==null?void 0:v.toFixed(4))??"โ€”",")"]})]})]})}),h.jsx(Wr,{className:"pt-0",children:h.jsx("div",{className:"h-48",children:i.length===0?h.jsx("div",{className:"flex h-full items-center justify-center text-slate-500 text-sm",children:"Waiting for first metric tickโ€ฆ"}):h.jsx(BI,{width:"100%",height:"100%",children:h.jsxs(yk,{data:i,margin:{top:8,right:12,left:0,bottom:0},children:[h.jsx(fm,{dataKey:"step",tick:{fill:"#94a3b8",fontSize:11},stroke:"#475569"}),h.jsx(hm,{tick:{fill:"#94a3b8",fontSize:11},stroke:"#475569",width:48}),h.jsx(Eo,{contentStyle:{background:"#1e293b",border:"1px solid #475569",borderRadius:8},labelStyle:{color:"#cbd5e1"},itemStyle:{color:"#34d399"},formatter:m=>m.toFixed(4)}),h.jsx(lf,{type:"monotone",dataKey:"loss",stroke:"#34d399",strokeWidth:2,dot:!1,isAnimationActive:!1})]})})})})]}),h.jsxs(Gr,{className:"bg-slate-800/50 border-slate-700 rounded-xl",children:[h.jsx(Uo,{className:"pb-2",children:h.jsxs(ga,{className:"flex items-center gap-3 text-white text-base",children:[h.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-orange-500/20 text-orange-400",children:h.jsx($u,{className:"w-4 h-4"})}),h.jsxs("span",{children:["Learning Rate"," ",h.jsxs("span",{className:"text-slate-400 text-sm font-normal",children:["(",((g=e.current_lr)==null?void 0:g.toExponential(2))??"โ€”",")"]})]})]})}),h.jsx(Wr,{className:"pt-0",children:h.jsx("div",{className:"h-48",children:a.length===0?h.jsx("div",{className:"flex h-full items-center justify-center text-slate-500 text-sm",children:"Waiting for first metric tickโ€ฆ"}):h.jsx(BI,{width:"100%",height:"100%",children:h.jsxs(yk,{data:a,margin:{top:8,right:12,left:0,bottom:0},children:[h.jsx(fm,{dataKey:"step",tick:{fill:"#94a3b8",fontSize:11},stroke:"#475569"}),h.jsx(hm,{tick:{fill:"#94a3b8",fontSize:11},stroke:"#475569",width:48,tickFormatter:m=>m.toExponential(0)}),h.jsx(Eo,{contentStyle:{background:"#1e293b",border:"1px solid #475569",borderRadius:8},labelStyle:{color:"#cbd5e1"},itemStyle:{color:"#fb923c"},formatter:m=>m.toExponential(2)}),h.jsx(lf,{type:"monotone",dataKey:"lr",stroke:"#fb923c",strokeWidth:2,dot:!1,isAnimationActive:!1})]})})})})]})]})]})},nDe=({logs:t,logContainerRef:e})=>h.jsxs(Gr,{className:"bg-slate-800/50 border-slate-700 rounded-xl",children:[h.jsx(Uo,{children:h.jsxs(ga,{className:"flex items-center gap-3 text-white",children:[h.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-slate-700",children:h.jsx(eX,{className:"w-5 h-5 text-sky-400"})}),"Training Logs"]})}),h.jsx(Wr,{children:h.jsx("div",{ref:e,className:"bg-slate-900 rounded-lg p-4 h-96 overflow-y-auto font-mono text-sm border border-slate-700",children:t.length===0?h.jsx("div",{className:"text-slate-500 py-8",children:"No training logs yet. Start training to see output."}):t.map((n,r)=>h.jsxs("div",{className:"text-slate-300 break-words whitespace-pre-wrap",children:[h.jsx("span",{className:"text-slate-500 mr-2 select-none",children:new Date(n.timestamp*1e3).toLocaleTimeString()}),n.message]},r))})})]}),rDe=({installHint:t})=>{const e=Hz("system/training-extra");return h.jsx("div",{className:"max-w-3xl mx-auto",children:h.jsxs(Gr,{className:"bg-slate-800/50 border-slate-700 rounded-xl",children:[h.jsx(Uo,{children:h.jsxs(ga,{className:"flex items-center gap-3 text-white",children:[h.jsx(Gz,{state:e.state}),Vz(e.state,"Training Extra Not Installed")]})}),h.jsx(Wr,{className:"space-y-4",children:h.jsx(Wz,{state:e.state,error:e.error,logs:e.logs,logBoxRef:e.logBoxRef,onInstall:e.handleInstall,onRetry:e.handleRetry,installHint:t,packageName:"accelerate",idleTitle:"Training Extra Not Installed",idleDescription:h.jsxs(h.Fragment,{children:["Training requires the"," ",h.jsx("code",{className:"px-1 py-0.5 rounded bg-slate-900 text-sky-300",children:"accelerate"})," ","package, which isn't installed in this environment. Install it to enable the Training page."]}),doneDescription:h.jsx(Xz,{purpose:"training"})})})]})})},iDe=()=>{const{auth:t,refetch:e}=xf(),{baseUrl:n,fetchWithHeaders:r}=Dn(),[i,o]=_.useState(""),[a,s]=_.useState(!1),[l,c]=_.useState(null);if(t.status==="authenticated"||t.status==="loading")return null;const u=async()=>{const d=i.trim();if(d){s(!0),c(null);try{const f=await r(`${n}/hf-auth/login`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:d})});if(!f.ok){const p=await f.json().catch(()=>({}));throw new Error(p.detail||`HTTP ${f.status}`)}o(""),await e()}catch(f){c(f instanceof Error?f.message:String(f))}finally{s(!1)}}};return h.jsx("div",{className:"bg-amber-950/40 border border-amber-700/60 rounded-lg p-4 mb-6",children:h.jsxs("div",{className:"flex items-start gap-3",children:[h.jsx(td,{className:"w-5 h-5 text-amber-400 flex-shrink-0 mt-0.5"}),h.jsxs("div",{className:"flex-1 space-y-3",children:[h.jsxs("div",{children:[h.jsx("p",{className:"text-sm text-amber-100 font-medium",children:"Hugging Face access required for cloud training"}),h.jsxs("p",{className:"text-xs text-amber-200/80 mt-1",children:["Create a token at"," ",h.jsxs("a",{href:"https://huggingface.co/settings/tokens",target:"_blank",rel:"noreferrer",className:"underline hover:text-amber-50 inline-flex items-center gap-1",children:["huggingface.co/settings/tokens",h.jsx(cl,{className:"w-3 h-3"})]})," ","with ",h.jsx("span",{className:"font-mono",children:"Write"})," access (so trained policies can upload to your account), then paste it below."]})]}),h.jsxs("form",{onSubmit:d=>{d.preventDefault(),u()},className:"flex gap-2",children:[h.jsx(hi,{type:"password",placeholder:"hf_...",value:i,onChange:d=>o(d.target.value),className:"bg-slate-900 border-slate-600 text-white placeholder:text-slate-500",disabled:a,autoComplete:"off"}),h.jsx(Je,{type:"submit",disabled:a||!i.trim(),className:"bg-amber-600 hover:bg-amber-700 text-white",children:a?h.jsxs(h.Fragment,{children:[h.jsx(fi,{className:"w-4 h-4 mr-2 animate-spin"}),"Savingโ€ฆ"]}):"Save token"})]}),l&&h.jsx("p",{className:"text-xs text-red-300",children:l})]})]})})},oDe=1e3,xk=5e3;function aDe(t,e){return t?{training_active:t.state==="running",current_step:t.metrics.current_step,total_steps:t.metrics.total_steps,current_loss:t.metrics.current_loss??void 0,current_lr:t.metrics.current_lr??void 0,grad_norm:t.metrics.grad_norm??void 0,eta_seconds:t.metrics.eta_seconds??void 0,available_controls:{stop_training:t.state==="running",pause_training:!1,resume_training:!1}}:{training_active:e,current_step:0,total_steps:0,available_controls:{stop_training:!1,pause_training:!1,resume_training:!1}}}function sDe(t){const e=zz(t.policy_type);return{target:t.target,dataset_repo_id:t.dataset_repo_id,policy_type:t.policy_type,steps:t.steps,batch_size:t.batch_size,seed:t.seed,num_workers:t.num_workers,log_freq:t.log_freq,save_freq:t.save_freq,save_checkpoint:t.save_checkpoint,resume:t.resume,wandb_enable:t.wandb_enable,wandb_project:t.wandb_project,wandb_entity:t.wandb_entity,wandb_notes:t.wandb_notes,wandb_mode:t.wandb_mode,wandb_disable_artifact:t.wandb_disable_artifact,policy_device:t.policy_device,policy_use_amp:t.policy_use_amp,policy_dtype:e.dtype?t.policy_dtype:void 0,policy_gradient_checkpointing:e.gradientCheckpointing?t.policy_gradient_checkpointing:void 0,policy_freeze_vision_encoder:e.freezeVisionEncoder?t.policy_freeze_vision_encoder:void 0,policy_train_expert_only:e.trainExpertOnly?t.policy_train_expert_only:void 0,optimizer_type:t.optimizer_type,optimizer_lr:t.optimizer_lr,optimizer_weight_decay:t.optimizer_weight_decay,optimizer_grad_clip_norm:t.optimizer_grad_clip_norm,use_policy_training_preset:t.use_policy_training_preset}}const lDe=()=>{var Y;const{baseUrl:t,fetchWithHeaders:e}=Dn(),{auth:n}=xf(),{toast:r}=_r(),i=ji(),a=((Y=yl().state)==null?void 0:Y.datasetRepoId)??"",[s,l]=_.useState({target:{runner:"local"},dataset_repo_id:a,policy_type:"act",steps:1e4,batch_size:8,seed:1e3,num_workers:4,log_freq:250,save_freq:1e3,save_checkpoint:!0,resume:!1,wandb_enable:!1,wandb_mode:"online",wandb_disable_artifact:!1,policy_device:"cuda",policy_use_amp:!1,policy_dtype:void 0,policy_gradient_checkpointing:void 0,policy_freeze_vision_encoder:void 0,policy_train_expert_only:void 0,optimizer_type:"adam",use_policy_training_preset:!0}),[c,u]=_.useState([]),[d,f]=_.useState(!0),[p,y]=_.useState(null),[v,g]=_.useState("pip install accelerate"),[m,x]=_.useState(!1),[b,S]=_.useState(!1),[w,E]=_.useState(!1),[T,A]=_.useState([]),[M,C]=_.useState([]),[P,R]=_.useState(!0),[D,k]=_.useState("https://sensecraft-gpu.seeed.cc/lelab/connect"),[U,O]=_.useState(!1);_.useEffect(()=>{f(!0),w4(t,e).then(u).catch(()=>u([])).finally(()=>f(!1))},[t,e]),_.useEffect(()=>{e(`${t}/system/training-extra`).then(ee=>ee.json()).then(ee=>{y(ee.available),g(ee.install_hint)}).catch(()=>y(!0))},[t,e]),_.useEffect(()=>{CE(t,e,200).then(ee=>x(ee.some(J=>J.runner==="local"&&J.state==="running"))).catch(()=>x(!1))},[t,e]),_.useEffect(()=>{R(!0),RN(t,e).then(ee=>{E(ee.authenticated),A(ee.flavors??[]),C(ee.providers??[])}).catch(()=>{E(!1),A([]),C([])}).finally(()=>R(!1))},[t,e,n.status]),_.useEffect(()=>{EZ(t,e).then(ee=>{const J=ee.web_url||"https://sensecraft-gpu.seeed.cc";k(`${J.replace(/\/$/,"")}/lelab/connect`)}).catch(()=>k("https://sensecraft-gpu.seeed.cc/lelab/connect"))},[t,e]);const X=(ee,J)=>{l(ce=>{const ae={...ce,[ee]:J};return ee==="policy_type"&&typeof J=="string"?{...ae,...Lce(J,ce)}:ae})},L=async()=>{if(!s.dataset_repo_id.trim()){r({title:"Error",description:"Dataset repository ID is required",variant:"destructive"});return}S(!0);try{const ee=await _Z(t,e,sDe(s));r({title:"Training Started",description:ee.name}),i(`/training/${ee.id}`)}catch(ee){const J=ee instanceof Error?ee.message:String(ee);r({title:"Error",description:J,variant:"destructive"}),CE(t,e,200).then(ce=>x(ce.some(ae=>ae.runner==="local"&&ae.state==="running"))).catch(()=>{})}finally{S(!1)}},j=()=>{O(!0);const ee=window.open(D,"lelab-seeed-cloud","width=520,height=720");if(!ee){O(!1),r({title:"Seeed Cloud",description:"Browser blocked the connection window.",variant:"destructive"});return}const J=window.setTimeout(()=>{window.removeEventListener("message",ae),O(!1)},12e4),ce=async(fe,we,le)=>{try{await TZ(t,e,{token:fe,api_url:we,web_url:le});const ie=await RN(t,e);E(ie.authenticated),A(ie.flavors??[]),C(ie.providers??[]),r({title:"Seeed Cloud connected",description:"GPU flavors are available now."})}catch(ie){const W=ie instanceof Error?ie.message:String(ie);r({title:"Seeed Cloud",description:W,variant:"destructive"})}finally{window.clearTimeout(J),window.removeEventListener("message",ae),O(!1),ee.close()}};function ae(fe){const we=new URL(D).origin;if(fe.origin!==we)return;const le=fe.data;(le==null?void 0:le.type)!=="seeed-cloud-token"||!le.token||ce(le.token,le.apiUrl,le.webUrl)}window.addEventListener("message",ae)};if(p===null)return h.jsx("div",{className:"min-h-screen bg-slate-900 text-white p-4",children:h.jsxs("div",{className:"max-w-7xl mx-auto",children:[h.jsx(kw,{}),h.jsxs("div",{className:"flex items-center justify-center py-24 text-slate-400",children:[h.jsx(fi,{className:"w-6 h-6 animate-spin mr-3"}),"Checking training environmentโ€ฆ"]})]})});if(p===!1)return h.jsx("div",{className:"min-h-screen bg-slate-900 text-white p-4",children:h.jsxs("div",{className:"max-w-7xl mx-auto",children:[h.jsx(kw,{}),h.jsx(rDe,{installHint:v})]})});const K=s.target.runner==="hf_cloud",te=(s.target.runner==="hf_cloud"||s.target.runner==="seeed_cloud"||s.target.runner==="external")&&!s.target.flavor,H=s.target.runner==="local"&&m,q=b||!s.dataset_repo_id.trim()||H||K&&!w||te,$=H?"Another local training is already running":K&&!w?"Log in to Hugging Face to use cloud compute":te?"Select a hardware flavor":void 0;return h.jsx("div",{className:"min-h-screen bg-slate-900 text-white p-4",children:h.jsxs("div",{className:"max-w-7xl mx-auto",children:[h.jsx(kw,{}),h.jsx(iDe,{}),h.jsx(Gce,{config:s,updateConfig:X,datasets:c,datasetsLoading:d,authenticated:w,flavors:T,providers:M,hardwareLoading:P,seeedConnecting:U,onConnectSeeedCloud:j}),h.jsx("div",{className:"max-w-3xl mx-auto mt-6 flex justify-end",children:(()=>{const ee=h.jsx(Je,{onClick:L,disabled:q,size:"lg",className:"bg-green-500 hover:bg-green-600 text-white font-semibold px-6",children:b?h.jsxs(h.Fragment,{children:[h.jsx(fi,{className:"w-5 h-5 mr-2 animate-spin"})," Startingโ€ฆ"]}):h.jsxs(h.Fragment,{children:[h.jsx(Tc,{className:"w-5 h-5 mr-2"})," Start Training"]})});return $?h.jsxs(Fv,{children:[h.jsx(Bv,{asChild:!0,children:h.jsx("span",{tabIndex:0,children:ee})}),h.jsx(Gh,{children:$})]}):ee})()})]})})},cDe=({jobId:t})=>{const{baseUrl:e,fetchWithHeaders:n}=Dn(),{toast:r}=_r(),i=ji(),{selectedRecord:o}=zA(),[a,s]=_.useState(null),[l,c]=_.useState(null),[u,d]=_.useState([]),f=_.useRef(null),[p,y]=_.useState([]),[v,g]=_.useState(null),[m,x]=_.useState(!1);_.useEffect(()=>{let M=!1;return xZ(e,n,t).then(C=>{!M&&C.length>0&&d(C)}).catch(()=>{}),()=>{M=!0}},[e,n,t]);const b=_.useRef(a==null?void 0:a.state);b.current=a==null?void 0:a.state,_.useEffect(()=>{let M=!1;const C=()=>{BA(e,n,t).then(R=>{if(!M)if(y(R),R.length>0){const D=R[R.length-1].step;g(k=>k!=null&&R.some(U=>U.step===k)?k:D)}else g(null)}).catch(()=>{M||(y([]),g(null))})};C();const P=setInterval(()=>{M||b.current&&b.current!=="running"||C()},5e3);return()=>{M=!0,clearInterval(P)}},[e,n,t]),_.useEffect(()=>{let M=!1;const C=async()=>{try{const R=await vZ(e,n,t);if(M)return;if(s(R),R.state==="running"){const D=await yZ(e,n,t);!M&&D.length>0&&d(k=>{const U=[...k,...D];return U.length>xk?U.slice(U.length-xk):U})}}catch(R){M||c(R instanceof Error?R.message:String(R))}};C();const P=setInterval(()=>{M||b.current&&b.current!=="running"||C()},oDe);return()=>{M=!0,clearInterval(P)}},[e,n,t]),_.useEffect(()=>{f.current&&(f.current.scrollTop=f.current.scrollHeight)},[u]);const S=M=>{const C=Math.floor(M/3600),P=Math.floor(M%3600/60),R=Math.floor(M%60);return`${C.toString().padStart(2,"0")}:${P.toString().padStart(2,"0")}:${R.toString().padStart(2,"0")}`},w=()=>!a||a.metrics.total_steps===0?0:a.metrics.current_step/a.metrics.total_steps*100,E=async()=>{if(a&&window.confirm("Stop this run?"))try{const M=await x4(e,n,a.id);s(M),r({title:"Stoppingโ€ฆ"})}catch(M){r({title:"Stop failed",description:M instanceof Error?M.message:String(M),variant:"destructive"})}},T=async()=>{if(a&&window.confirm("Delete this run? This wipes the output directory."))try{await b4(e,n,a.id),r({title:"Job removed"}),i("/")}catch(M){r({title:"Delete failed",description:M instanceof Error?M.message:String(M),variant:"destructive"})}};if(l&&!a)return h.jsx("div",{className:"min-h-screen bg-slate-900 text-white p-4",children:h.jsxs("div",{className:"max-w-7xl mx-auto space-y-4",children:[h.jsxs(Je,{variant:"ghost",onClick:()=>i("/"),className:"text-slate-400",children:[h.jsx(ll,{className:"w-4 h-4 mr-2"})," Back to Jobs"]}),h.jsxs("p",{className:"text-red-300",children:["Couldn't load job ",t,": ",l]})]})});if(!a)return h.jsx("div",{className:"min-h-screen bg-slate-900 text-white p-4",children:h.jsxs("div",{className:"max-w-7xl mx-auto flex items-center justify-center py-24 text-slate-400",children:[h.jsx(fi,{className:"w-6 h-6 animate-spin mr-3"})," Loading jobโ€ฆ"]})});const A=a.state==="running";return h.jsx("div",{className:"min-h-screen bg-slate-900 text-white p-4",children:h.jsxs("div",{className:"max-w-7xl mx-auto space-y-6",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs(Je,{variant:"ghost",onClick:()=>i("/"),className:"text-slate-400 hover:text-white",children:[h.jsx(ll,{className:"w-4 h-4 mr-2"})," Jobs"]}),h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("h1",{className:"text-xl font-semibold text-white",children:a.name}),a.runner==="hf_cloud"?h.jsxs("span",{className:"text-xs px-2 py-0.5 rounded bg-amber-900/40 text-amber-200 border border-amber-700",children:["HF ยท ",a.hf_flavor??"cloud"]}):a.runner==="seeed_cloud"||a.runner==="external"?h.jsxs("span",{className:"text-xs px-2 py-0.5 rounded bg-emerald-900/40 text-emerald-200 border border-emerald-700",children:[a.runner==="seeed_cloud"?"Seeed":a.external_provider??"External"," ยท"," ",a.external_flavor??"GPU"]}):h.jsx("span",{className:"text-xs px-2 py-0.5 rounded bg-slate-700 text-slate-200 border border-slate-600",children:"Local"}),a.runner==="hf_cloud"&&a.hf_repo_id&&a.state==="done"&&h.jsx("a",{href:`https://huggingface.co/${a.hf_repo_id}`,target:"_blank",rel:"noreferrer",className:"text-xs text-amber-300 hover:text-amber-200 underline",children:"View on Hub โ†—"}),(a.runner==="seeed_cloud"||a.runner==="external")&&a.external_job_url&&h.jsx("a",{href:a.external_job_url,target:"_blank",rel:"noreferrer",className:"text-xs text-emerald-300 hover:text-emerald-200 underline",children:"View provider job โ†—"}),a.wandb_run_url&&h.jsx("a",{href:a.wandb_run_url,target:"_blank",rel:"noreferrer",className:"text-xs text-yellow-300 hover:text-yellow-200 underline",children:"View on W&B โ†—"})]}),h.jsxs("p",{className:"text-xs text-slate-400",children:[a.state,a.error_message?` โ€” ${a.error_message}`:""]})]})]}),A?h.jsxs(Je,{onClick:E,className:"bg-red-500 hover:bg-red-600 text-white",children:[h.jsx(Od,{className:"w-4 h-4 mr-2"})," Stop"]}):h.jsxs(Je,{onClick:T,variant:"ghost",className:"text-slate-400 hover:text-white",children:[h.jsx(sA,{className:"w-4 h-4 mr-2"})," Delete"]})]}),h.jsx(tDe,{jobId:t,trainingStatus:aDe(a,!1),getProgressPercentage:w,formatTime:S}),h.jsxs("div",{className:"bg-slate-800/40 border border-slate-700 rounded-lg p-4 flex items-center gap-3",children:[h.jsx("span",{className:"text-sm font-semibold text-slate-300",children:"Run inference"}),p.length===0?h.jsx("span",{className:"text-xs text-slate-500",children:"No checkpoints yet โ€” wait for the first save."}):h.jsxs(h.Fragment,{children:[h.jsx($A,{checkpoints:p,selectedStep:v,onChange:g}),h.jsxs(Je,{onClick:()=>x(!0),disabled:v==null,className:"bg-green-500 hover:bg-green-600 text-white",children:[h.jsx(Tc,{className:"w-4 h-4 mr-2"}),"Run on robot"]})]})]}),h.jsx(_4,{open:m,onOpenChange:x,robot:o,jobId:t,initialStep:v}),h.jsx(nDe,{logs:u,logContainerRef:f})]})})},bk=()=>{const{jobId:t}=SW();return t?h.jsx(cDe,{jobId:t}):h.jsx(lDe,{})},uDe=1e3;function _k(t){const e=Math.max(0,Math.floor(t)),n=Math.floor(e/60),r=e%60;return`${String(n).padStart(2,"0")}:${String(r).padStart(2,"0")}`}const dDe=()=>{const t=ji(),{baseUrl:e,fetchWithHeaders:n}=Dn(),{toast:r}=_r(),[i,o]=_.useState(null),[a,s]=_.useState(!1),l=_.useRef(!1),c=_.useRef(!1);_.useEffect(()=>{let b=!1;const S=async()=>{try{await IN(e,n)}catch{}},w=async()=>{try{const T=await jZ(e,n);if(b)return;if(o(T),!T.inference_active&&!l.current){l.current=!0,T.exited&&r({title:"Inference finished",description:T.exit_code===0?"Run completed.":`Exit code ${T.exit_code}. See ${T.log_path}.`,variant:T.exit_code===0?"default":"destructive"}),t("/");return}T.inference_active&&T.rollout_started_at!=null&&T.duration_s!=null&&T.duration_s>0&&T.rollout_elapsed_s>T.duration_s+10&&!c.current&&(c.current=!0,r({title:"Inference seems hung",description:`Rollout past duration by ${Math.round(T.rollout_elapsed_s-T.duration_s)}s. Stopping.`,variant:"destructive"}),S())}catch(T){b||r({title:"Lost connection to backend",description:T instanceof Error?T.message:String(T),variant:"destructive"})}};w();const E=setInterval(w,uDe);return()=>{b=!0,clearInterval(E)}},[e,n,t,r]);const u=async()=>{s(!1);try{await IN(e,n)}catch(b){r({title:"Stop failed",description:b instanceof Error?b.message:String(b),variant:"destructive"})}};if(!i)return h.jsxs("div",{className:"min-h-screen bg-black text-white flex items-center justify-center",children:[h.jsx(fi,{className:"w-6 h-6 animate-spin mr-3"})," Connecting to inferenceโ€ฆ"]});const d=i.elapsed_s??0,f=i.rollout_elapsed_s??0,p=i.duration_s??0,y=i.inference_active&&i.rollout_started_at==null,v=i.inference_active&&i.rollout_started_at!=null,g=v&&p>0?Math.min(100,f/p*100):0,m=y?"SETTING UP":v?"RUNNING":"FINISHED",x=v?f:d;return h.jsxs("div",{className:"min-h-screen bg-black text-white flex flex-col p-4 sm:p-6 lg:p-8",children:[h.jsxs("div",{className:"flex items-center gap-4 mb-8",children:[h.jsx(Je,{variant:"ghost",size:"icon",onClick:()=>t("/"),className:"text-slate-400 hover:bg-slate-800 hover:text-white rounded-lg",children:h.jsx(ll,{className:"w-5 h-5"})}),h.jsx(Gx,{}),h.jsx("h1",{className:"font-bold text-white text-2xl",children:"Inference"})]}),h.jsx("div",{className:"flex-1 flex items-center justify-center",children:h.jsxs("div",{className:"bg-gray-900 rounded-lg border border-gray-700 p-8 w-full max-w-xl",children:[h.jsx("div",{className:"text-center mb-6",children:h.jsxs("div",{className:`inline-flex items-center gap-2 px-3 py-1 rounded-full text-xs font-bold tracking-widest ${y?"bg-amber-500/15 text-amber-300":"bg-green-500/15 text-green-300"}`,children:[h.jsx("span",{className:`w-2 h-2 rounded-full ${y?"bg-amber-500":"bg-green-500"} animate-pulse`}),m]})}),h.jsxs("div",{className:"text-center mb-4",children:[h.jsx("div",{className:`text-7xl font-mono font-bold leading-none ${y?"text-amber-400":"text-green-400"}`,children:_k(x)}),h.jsx("div",{className:"text-sm text-gray-500 mt-2",children:y?"Loading policy & connecting hardwareโ€ฆ":`/ ${_k(p)}`})]}),h.jsx("div",{className:"w-full bg-gray-800 rounded-full h-1.5 mb-8",children:h.jsx("div",{className:`h-1.5 rounded-full transition-all duration-500 ${y?"bg-amber-500/40 animate-pulse w-full":"bg-green-500"}`,style:y?void 0:{width:`${g}%`}})}),h.jsxs("div",{className:"text-xs text-slate-500 break-all mb-6",children:["policy: ",i.policy_ref??"(unknown)"]}),h.jsxs(Je,{onClick:()=>s(!0),disabled:!i.inference_active,className:"w-full bg-red-500 hover:bg-red-600 text-white font-semibold py-6 text-lg disabled:opacity-50",children:[h.jsx(Od,{className:"w-5 h-5 mr-2"}),"Stop"]})]})}),h.jsx(bC,{open:a,onOpenChange:s,children:h.jsxs(Yx,{className:"bg-gray-900 border-gray-700 text-white",children:[h.jsxs(Jx,{children:[h.jsx(Qx,{children:"Stop inference?"}),h.jsx(eb,{className:"text-gray-400",children:"The follower will hold its current pose. You can launch another run from the job tile."})]}),h.jsxs(Zx,{children:[h.jsx(nb,{className:"bg-gray-800 border-gray-700 text-white hover:bg-gray-700",children:"Keep running"}),h.jsx(tb,{onClick:u,className:"bg-red-500 hover:bg-red-600 text-white",children:"Stop"})]})]})})]})},fDe=()=>h.jsxs("div",{className:"min-h-screen bg-black text-white flex flex-col items-center justify-center p-4",children:[h.jsx("h1",{className:"text-5xl font-bold tracking-tight",children:"Edit Dataset"}),h.jsx("p",{className:"mt-4 text-xl text-gray-400",children:"This page is under construction."})]}),hDe=()=>{var R;const t=yl(),e=ji(),{toast:n}=_r(),{baseUrl:r,fetchWithHeaders:i}=Dn(),o=(R=t.state)==null?void 0:R.datasetInfo,[a,s]=_.useState(null),[l,c]=_.useState(!0),[u,d]=_.useState({tags:["robotics","lerobot"],private:!1}),[f,p]=_.useState(u.tags.join(", ")),[y,v]=_.useState(!1),[g,m]=_.useState(!1),[x,b]=_.useState(!1),[S,w]=_.useState(!1);Q.useEffect(()=>{(async()=>{if(!(o!=null&&o.dataset_repo_id)){n({title:"No Dataset Information",description:"Please complete a recording session first.",variant:"destructive"}),e("/");return}try{const k=await i(`${r}/dataset-info`,{method:"POST",body:JSON.stringify({dataset_repo_id:o.dataset_repo_id})}),U=await k.json();k.ok&&U.success?s({...U,saved_episodes:U.num_episodes,session_elapsed_seconds:o.session_elapsed_seconds||0,source:o.source}):(n({title:"Warning",description:"Could not load complete dataset information. Using session data.",variant:"destructive"}),s(o))}catch(k){console.error("Error loading dataset info:",k),n({title:"Warning",description:"Could not connect to backend. Using session data.",variant:"destructive"}),s(o)}finally{c(!1)}})()},[o,e,n]);const E=D=>{const k=`/spaces/lerobot/visualize_dataset?path=${encodeURIComponent(`/${D}`)}`,U=`https://huggingface.co/login?next=${encodeURIComponent(k)}`;window.open(U,"_blank","noopener,noreferrer")},T=D=>{const k=Math.floor(D/3600),U=Math.floor(D%3600/60),O=D%60;return k>0?`${k}h ${U}m ${O}s`:U>0?`${U}m ${O}s`:`${O}s`},A=async()=>{if(a){v(!0);try{const D=f.split(",").map(O=>O.trim()).filter(O=>O.length>0),k=await i(`${r}/upload-dataset`,{method:"POST",body:JSON.stringify({dataset_repo_id:a.dataset_repo_id,tags:D,private:u.private})}),U=await k.json();if(k.ok&&U.success)m(!0),n({title:"Upload Successful!",description:`Dataset ${a.dataset_repo_id} has been uploaded to HuggingFace Hub.`});else{const O="Failed to upload dataset to HuggingFace Hub.";n({title:"Upload Failed",description:U.docs_url?h.jsxs("span",{children:[U.message||O," ",h.jsx("a",{href:U.docs_url,target:"_blank",rel:"noopener noreferrer",className:"underline font-medium",children:"Open setup guide"})]}):U.message||O,variant:"destructive"})}}catch(D){console.error("Error uploading dataset:",D),n({title:"Connection Error",description:"Could not connect to the backend server.",variant:"destructive"})}finally{v(!1)}}},M=()=>{n({title:"Upload Skipped",description:"Dataset saved locally. You can upload it manually later."}),e("/")},C=async()=>{if(a){w(!0);try{const D=await i(`${r}/delete-dataset`,{method:"POST",body:JSON.stringify({dataset_repo_id:a.dataset_repo_id})}),k=await D.json();D.ok&&k.success?(n({title:"Dataset Deleted",description:`${a.dataset_repo_id} has been removed from disk.`}),e("/")):n({title:"Delete Failed",description:k.message||"Could not delete the dataset.",variant:"destructive"})}catch{n({title:"Connection Error",description:"Could not connect to the backend server.",variant:"destructive"})}finally{w(!1),b(!1)}}};if(l||!a)return h.jsx("div",{className:"min-h-screen bg-black text-white flex items-center justify-center",children:h.jsxs("div",{className:"text-center",children:[h.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-500 mx-auto mb-4"}),h.jsx("p",{className:"text-lg",children:"Loading dataset information..."})]})});const P=a.source==="both";return h.jsxs("div",{className:"min-h-screen bg-black text-white p-8",children:[h.jsxs("div",{className:"max-w-4xl mx-auto",children:[h.jsxs("div",{className:"flex items-center justify-between mb-8",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs(Je,{onClick:()=>e("/"),variant:"outline",className:"border-gray-500 hover:border-gray-200 text-gray-300 hover:text-white",children:[h.jsx(ll,{className:"w-4 h-4 mr-2"}),"Back to Home"]}),h.jsx(Je,{onClick:()=>b(!0),variant:"outline",size:"icon",disabled:S,"aria-label":"Delete dataset from disk",className:"border-red-500/40 text-red-400 hover:border-red-400 hover:text-red-300 hover:bg-red-500/10",children:h.jsx(sA,{className:"w-4 h-4"})})]}),h.jsxs("div",{className:"flex items-center gap-3",children:[g?h.jsx(qi,{className:"w-8 h-8 text-green-500"}):h.jsx(Y9,{className:"w-8 h-8 text-blue-500"}),h.jsx("h1",{className:"text-3xl font-bold",children:g?"Upload Complete":"Dataset Upload"})]})]}),g&&h.jsxs("div",{className:"bg-green-900/20 border border-green-600 rounded-lg p-6 mb-8",children:[h.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[h.jsx(qi,{className:"w-6 h-6 text-green-500"}),h.jsx("h2",{className:"text-xl font-semibold text-green-400",children:"Successfully Uploaded!"})]}),h.jsx("p",{className:"text-gray-300 mb-4",children:"Your dataset has been uploaded to HuggingFace Hub and is now available for training and sharing."}),h.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[h.jsxs(Je,{onClick:()=>{const D=`/spaces/lerobot/visualize_dataset?path=${encodeURIComponent(`/${a.dataset_repo_id}`)}`,k=u.private?`https://huggingface.co/login?next=${encodeURIComponent(D)}`:`https://huggingface.co${D}`;window.open(k,"_blank","noopener,noreferrer")},className:"bg-blue-500 hover:bg-blue-600 text-white",children:[h.jsx(cl,{className:"w-4 h-4 mr-2"}),"View on HuggingFace Hub"]}),h.jsx(Je,{onClick:()=>e("/training",{state:{datasetRepoId:a.dataset_repo_id}}),className:"bg-purple-500 hover:bg-purple-600 text-white",children:"Start Training"})]})]}),!g&&h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"bg-gray-900 rounded-lg p-6 border border-gray-700 mb-8",children:[h.jsx("h2",{className:"text-xl font-semibold text-white mb-4",children:"Dataset Summary"}),h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-400",children:"Repository ID:"}),h.jsx("p",{className:"text-white font-mono text-lg",children:a.dataset_repo_id})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-400",children:"Task:"}),h.jsx("p",{className:"text-white",children:a.single_task})]})]}),h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-400",children:"Episodes Recorded:"}),h.jsx("p",{className:"text-white text-2xl font-bold text-green-400",children:a.saved_episodes||a.num_episodes}),a.total_frames&&h.jsxs("p",{className:"text-gray-400 text-sm",children:[a.total_frames," total frames"]})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-gray-400",children:"Session Duration:"}),h.jsx("p",{className:"text-white",children:T(a.session_elapsed_seconds||0)}),a.fps&&h.jsxs("p",{className:"text-gray-400 text-sm",children:[a.fps," FPS"]})]})]})]})]}),!P&&h.jsxs("div",{className:"bg-gray-900 rounded-lg p-6 border border-gray-700 mb-8",children:[h.jsx("h2",{className:"text-xl font-semibold text-white mb-6",children:"Upload Configuration"}),h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{children:[h.jsx(Tt,{htmlFor:"tags",className:"text-gray-300 mb-2 block",children:"Tags (comma-separated)"}),h.jsx(hi,{id:"tags",value:f,onChange:D=>p(D.target.value),placeholder:"robotics, lerobot, manipulation",className:"bg-gray-800 border-gray-600 text-white"}),h.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Tags help others discover your dataset on HuggingFace Hub"})]}),h.jsxs("div",{className:"flex items-center space-x-3",children:[h.jsx(DA,{id:"private",checked:u.private,onCheckedChange:D=>d({...u,private:D})}),h.jsxs("div",{className:"flex items-center gap-2",children:[u.private?h.jsx(Z9,{className:"w-4 h-4 text-gray-400"}):h.jsx(Q9,{className:"w-4 h-4 text-gray-400"}),h.jsx(Tt,{htmlFor:"private",className:"text-gray-300",children:"Make dataset private"})]})]}),h.jsx("p",{className:"text-sm text-gray-500 ml-6",children:u.private?"Only you will be able to access this dataset":"Dataset will be publicly accessible on HuggingFace Hub"})]})]}),h.jsx("div",{className:"flex flex-col sm:flex-row gap-4 justify-center",children:P?h.jsxs(Je,{onClick:()=>E(a.dataset_repo_id),className:"bg-blue-500 hover:bg-blue-600 text-white font-semibold py-4 px-8 text-lg",children:[h.jsx(cl,{className:"w-5 h-5 mr-2"}),"View on Hugging Face Hub"]}):h.jsxs(h.Fragment,{children:[h.jsx(Je,{onClick:A,disabled:y,className:"bg-blue-500 hover:bg-blue-600 text-white font-semibold py-4 px-8 text-lg",children:y?h.jsxs(h.Fragment,{children:[h.jsx(fi,{className:"w-5 h-5 mr-2 animate-spin"}),"Uploading to Hub..."]}):h.jsxs(h.Fragment,{children:[h.jsx(FU,{className:"w-5 h-5 mr-2"}),"Upload to HuggingFace Hub"]})}),h.jsx(Je,{onClick:M,disabled:y,variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-800 hover:text-white py-4 px-8 text-lg",children:"Skip Upload"})]})}),!P&&h.jsx("div",{className:"mt-8 p-4 bg-blue-900/20 border border-blue-600 rounded-lg",children:h.jsxs("div",{className:"flex items-start gap-3",children:[h.jsx(td,{className:"w-5 h-5 text-blue-400 mt-0.5"}),h.jsxs("div",{children:[h.jsx("h3",{className:"font-semibold text-blue-400 mb-2",children:"About HuggingFace Hub Upload"}),h.jsxs("ul",{className:"text-sm text-gray-300 space-y-1",children:[h.jsx("li",{children:"โ€ข Your dataset will be uploaded to HuggingFace Hub for sharing and collaboration"}),h.jsx("li",{children:"โ€ข You need to be logged in to HuggingFace CLI on the server"}),h.jsx("li",{children:"โ€ข Uploaded datasets can be used for training models and sharing with the community"}),h.jsx("li",{children:"โ€ข You can always upload manually later using the HuggingFace CLI"})]})]})]})})]})]}),h.jsx(bC,{open:x,onOpenChange:b,children:h.jsxs(Yx,{className:"bg-gray-900 border-gray-700 text-white",children:[h.jsxs(Jx,{children:[h.jsx(Qx,{children:"Delete dataset from disk?"}),h.jsxs(eb,{className:"text-gray-400",children:["This permanently removes ",h.jsx("span",{className:"font-mono text-white",children:a.dataset_repo_id})," from your local cache. This action cannot be undone."]})]}),h.jsxs(Zx,{children:[h.jsx(nb,{className:"bg-gray-800 border-gray-700 text-white hover:bg-gray-700",children:"Keep dataset"}),h.jsx(tb,{onClick:C,disabled:S,className:"bg-red-500 hover:bg-red-600 text-white",children:S?"Deletingโ€ฆ":"Delete"})]})]})})]})},pDe=()=>{const t=yl();return _.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",t.pathname)},[t.pathname]),h.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-100",children:h.jsxs("div",{className:"text-center",children:[h.jsx("h1",{className:"text-4xl font-bold mb-4",children:"404"}),h.jsx("p",{className:"text-xl text-gray-600 mb-4",children:"Oops! Page not found"}),h.jsx("a",{href:"/",className:"text-blue-500 hover:text-blue-700 underline",children:"Return to Home"})]})})},mDe="lelab-tabs-v1",gDe=1e3,vDe=3e3,yDe=({children:t})=>{const[e,n]=_.useState(!0),r=_.useRef(new Map),i=_.useRef(""),o=_.useRef(0),a=_.useRef(null),s=_.useCallback(()=>{const c=r.current,u=Date.now()-vDe;for(const[p,y]of c)y.lastSeen{if(typeof window>"u"||typeof BroadcastChannel>"u")return;i.current=crypto.randomUUID(),o.current=Date.now();const c=new BroadcastChannel(mDe);a.current=c;const u=p=>{c.postMessage({type:p,id:i.current,openedAt:o.current})};c.onmessage=p=>{const y=p.data;if(!y||y.id===i.current)return;const v=r.current;y.type==="HEARTBEAT"?v.set(y.id,{id:y.id,openedAt:y.openedAt,lastSeen:Date.now()}):y.type==="RELEASE"?v.delete(y.id):y.type==="TAKEOVER"&&(v.set(y.id,{id:y.id,openedAt:y.openedAt,lastSeen:Date.now()}),o.current<=y.openedAt&&(o.current=y.openedAt+1)),s()},u("HEARTBEAT");const d=setInterval(()=>{u("HEARTBEAT"),s()},gDe),f=()=>u("RELEASE");return window.addEventListener("beforeunload",f),()=>{window.removeEventListener("beforeunload",f),clearInterval(d),u("RELEASE"),c.close(),a.current=null}},[s]);const l=_.useCallback(()=>{var c;o.current=0,(c=a.current)==null||c.postMessage({type:"TAKEOVER",id:i.current,openedAt:0}),s()},[s]);return h.jsxs(h.Fragment,{children:[t,!e&&h.jsx("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center bg-black/80 backdrop-blur-sm",role:"dialog","aria-modal":"true",children:h.jsxs("div",{className:"mx-4 max-w-md space-y-4 rounded-lg border bg-background p-6 text-center shadow-lg",children:[h.jsx("h2",{className:"text-lg font-semibold",children:"LeLab is already open in another tab"}),h.jsx("p",{className:"text-sm text-muted-foreground",children:"Only one tab can control the robot at a time. Switch back to the original tab, or take over here โ€” the other tab will lock."}),h.jsx(Je,{onClick:l,children:"Use this tab"})]})})]})},wk="lelab:teleop-stopped",xDe=()=>{const{toast:t}=_r();return _.useEffect(()=>{let e=!1;try{e=sessionStorage.getItem(wk)==="1",e&&sessionStorage.removeItem(wk)}catch{}e&&t({title:"Teleoperation stopped",description:"The arm was disconnected cleanly when you left the page."})},[t]),null},bDe=new d7;function _De(){return h.jsx(h7,{client:bDe,children:h.jsx(qF,{children:h.jsx(g7,{children:h.jsx(YX,{children:h.jsx(JX,{children:h.jsx(W7,{children:h.jsx(q7,{children:h.jsxs(zW,{children:[h.jsxs(yDe,{children:[h.jsx(xDe,{}),h.jsxs(FW,{children:[h.jsx(go,{path:"/",element:h.jsx(KZ,{})}),h.jsx(go,{path:"/teleoperation",element:h.jsx(wse,{})}),h.jsx(go,{path:"/recording",element:h.jsx(Ice,{})}),h.jsx(go,{path:"/upload",element:h.jsx(hDe,{})}),h.jsx(go,{path:"/training",element:h.jsx(bk,{})}),h.jsx(go,{path:"/training/:jobId",element:h.jsx(bk,{})}),h.jsx(go,{path:"/inference",element:h.jsx(dDe,{})}),h.jsx(go,{path:"/calibration",element:h.jsx(Fse,{})}),h.jsx(go,{path:"/edit-dataset",element:h.jsx(fDe,{})}),h.jsx(go,{path:"*",element:h.jsx(pDe,{})})]})]}),h.jsx(WX,{})]})})})})})})})})}V3(document.getElementById("root")).render(h.jsx(_De,{})); diff --git a/frontend/dist/assets/index-Ds5-5MuP.css b/frontend/dist/assets/index-Ds5-5MuP.css new file mode 100644 index 0000000..53e60fd --- /dev/null +++ b/frontend/dist/assets/index-Ds5-5MuP.css @@ -0,0 +1 @@ +*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--background: 0 0% 100%;--foreground: 222.2 84% 4.9%;--card: 0 0% 100%;--card-foreground: 222.2 84% 4.9%;--popover: 0 0% 100%;--popover-foreground: 222.2 84% 4.9%;--primary: 222.2 47.4% 11.2%;--primary-foreground: 210 40% 98%;--secondary: 210 40% 96.1%;--secondary-foreground: 222.2 47.4% 11.2%;--muted: 210 40% 96.1%;--muted-foreground: 215.4 16.3% 46.9%;--accent: 210 40% 96.1%;--accent-foreground: 222.2 47.4% 11.2%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 210 40% 98%;--border: 214.3 31.8% 91.4%;--input: 214.3 31.8% 91.4%;--ring: 222.2 84% 4.9%;--radius: .5rem;--sidebar-background: 0 0% 98%;--sidebar-foreground: 240 5.3% 26.1%;--sidebar-primary: 240 5.9% 10%;--sidebar-primary-foreground: 0 0% 98%;--sidebar-accent: 240 4.8% 95.9%;--sidebar-accent-foreground: 240 5.9% 10%;--sidebar-border: 220 13% 91%;--sidebar-ring: 217.2 91.2% 59.8%}.dark{--background: 222.2 84% 4.9%;--foreground: 210 40% 98%;--card: 222.2 84% 4.9%;--card-foreground: 210 40% 98%;--popover: 222.2 84% 4.9%;--popover-foreground: 210 40% 98%;--primary: 210 40% 98%;--primary-foreground: 222.2 47.4% 11.2%;--secondary: 217.2 32.6% 17.5%;--secondary-foreground: 210 40% 98%;--muted: 217.2 32.6% 17.5%;--muted-foreground: 215 20.2% 65.1%;--accent: 217.2 32.6% 17.5%;--accent-foreground: 210 40% 98%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 210 40% 98%;--border: 217.2 32.6% 17.5%;--input: 217.2 32.6% 17.5%;--ring: 212.7 26.8% 83.9%;--sidebar-background: 240 5.9% 10%;--sidebar-foreground: 240 4.8% 95.9%;--sidebar-primary: 224.3 76.3% 48%;--sidebar-primary-foreground: 0 0% 100%;--sidebar-accent: 240 3.7% 15.9%;--sidebar-accent-foreground: 240 4.8% 95.9%;--sidebar-border: 240 3.7% 15.9%;--sidebar-ring: 217.2 91.2% 59.8%}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground))}.container{width:100%;margin-right:auto;margin-left:auto;padding-right:2rem;padding-left:2rem}@media (min-width: 1400px){.container{max-width:1400px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{left:0;right:0}.bottom-0{bottom:0}.bottom-4{bottom:1rem}.left-2{left:.5rem}.left-2\.5{left:.625rem}.left-\[50\%\]{left:50%}.right-2{right:.5rem}.right-4{right:1rem}.top-0{top:0}.top-1\/2{top:50%}.top-2{top:.5rem}.top-4{top:1rem}.top-\[50\%\]{top:50%}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-50{z-index:50}.z-\[100\]{z-index:100}.z-\[9999\]{z-index:9999}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-6{margin-left:1.5rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.contents{display:contents}.hidden{display:none}.aspect-\[4\/3\]{aspect-ratio:4/3}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-16{height:4rem}.h-2{height:.5rem}.h-24{height:6rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-40{height:10rem}.h-48{height:12rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-64{height:16rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-96{height:24rem}.h-\[1px\]{height:1px}.h-\[95vh\]{height:95vh}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.max-h-96{max-height:24rem}.max-h-\[300px\]{max-height:300px}.max-h-\[440px\]{max-height:440px}.max-h-\[90vh\]{max-height:90vh}.max-h-screen{max-height:100vh}.min-h-10{min-height:2.5rem}.min-h-\[120px\]{min-height:120px}.min-h-\[50vh\]{min-height:50vh}.min-h-screen{min-height:100vh}.w-1{width:.25rem}.w-1\.5{width:.375rem}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-32{width:8rem}.w-4{width:1rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-56{width:14rem}.w-6{width:1.5rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-\[--radix-popover-trigger-width\]{width:var(--radix-popover-trigger-width)}.w-\[1px\]{width:1px}.w-\[320px\]{width:320px}.w-\[min\(560px\,calc\(100vw-2rem\)\)\]{width:min(560px,calc(100vw - 2rem))}.w-auto{width:auto}.w-full{width:100%}.w-px{width:1px}.min-w-0{min-width:0px}.min-w-\[110px\]{min-width:110px}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-4xl{max-width:56rem}.max-w-7xl{max-width:80rem}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-xl{max-width:36rem}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\[-50\%\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\[-50\%\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-px{gap:1px}.space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.75rem * var(--tw-space-x-reverse));margin-left:calc(.75rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.self-stretch{align-self:stretch}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.rounded-t-lg{border-top-left-radius:var(--radius);border-top-right-radius:var(--radius)}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-t{border-top-width:1px}.border-amber-400\/60{border-color:#fbbf2499}.border-amber-700{--tw-border-opacity: 1;border-color:rgb(180 83 9 / var(--tw-border-opacity, 1))}.border-amber-700\/60{border-color:#b4530999}.border-blue-500{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.border-blue-600{--tw-border-opacity: 1;border-color:rgb(37 99 235 / var(--tw-border-opacity, 1))}.border-destructive{border-color:hsl(var(--destructive))}.border-destructive\/50{border-color:hsl(var(--destructive) / .5)}.border-emerald-500\/50{border-color:#10b98180}.border-emerald-700{--tw-border-opacity: 1;border-color:rgb(4 120 87 / var(--tw-border-opacity, 1))}.border-gray-500{--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity, 1))}.border-gray-600{--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1))}.border-gray-700{--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))}.border-gray-800{--tw-border-opacity: 1;border-color:rgb(31 41 55 / var(--tw-border-opacity, 1))}.border-green-600{--tw-border-opacity: 1;border-color:rgb(22 163 74 / var(--tw-border-opacity, 1))}.border-green-700{--tw-border-opacity: 1;border-color:rgb(21 128 61 / var(--tw-border-opacity, 1))}.border-input{border-color:hsl(var(--input))}.border-primary{border-color:hsl(var(--primary))}.border-purple-700{--tw-border-opacity: 1;border-color:rgb(126 34 206 / var(--tw-border-opacity, 1))}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.border-red-500\/40{border-color:#ef444466}.border-red-700{--tw-border-opacity: 1;border-color:rgb(185 28 28 / var(--tw-border-opacity, 1))}.border-red-800{--tw-border-opacity: 1;border-color:rgb(153 27 27 / var(--tw-border-opacity, 1))}.border-slate-600{--tw-border-opacity: 1;border-color:rgb(71 85 105 / var(--tw-border-opacity, 1))}.border-slate-700{--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-yellow-700{--tw-border-opacity: 1;border-color:rgb(161 98 7 / var(--tw-border-opacity, 1))}.bg-accent{background-color:hsl(var(--accent))}.bg-amber-400{--tw-bg-opacity: 1;background-color:rgb(251 191 36 / var(--tw-bg-opacity, 1))}.bg-amber-500{--tw-bg-opacity: 1;background-color:rgb(245 158 11 / var(--tw-bg-opacity, 1))}.bg-amber-500\/15{background-color:#f59e0b26}.bg-amber-500\/40{background-color:#f59e0b66}.bg-amber-600{--tw-bg-opacity: 1;background-color:rgb(217 119 6 / var(--tw-bg-opacity, 1))}.bg-amber-900\/40{background-color:#78350f66}.bg-amber-950\/40{background-color:#451a0366}.bg-background{background-color:hsl(var(--background))}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-black\/30{background-color:#0000004d}.bg-black\/70{background-color:#000000b3}.bg-black\/80{background-color:#000c}.bg-black\/95{background-color:#000000f2}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-blue-500\/20{background-color:#3b82f633}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.bg-blue-900\/20{background-color:#1e3a8a33}.bg-border{background-color:hsl(var(--border))}.bg-card{background-color:hsl(var(--card))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-emerald-400{--tw-bg-opacity: 1;background-color:rgb(52 211 153 / var(--tw-bg-opacity, 1))}.bg-emerald-900\/40{background-color:#064e3b66}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-500{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity, 1))}.bg-gray-500\/15{background-color:#6b728026}.bg-gray-600{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.bg-gray-700{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.bg-gray-800\/50{background-color:#1f293780}.bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.bg-gray-900\/60{background-color:#11182799}.bg-gray-900\/80{background-color:#111827cc}.bg-gray-950{--tw-bg-opacity: 1;background-color:rgb(3 7 18 / var(--tw-bg-opacity, 1))}.bg-green-400{--tw-bg-opacity: 1;background-color:rgb(74 222 128 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-green-500\/15{background-color:#22c55e26}.bg-green-500\/20{background-color:#22c55e33}.bg-green-600{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity, 1))}.bg-green-900\/20{background-color:#14532d33}.bg-green-900\/50{background-color:#14532d80}.bg-green-900\/70{background-color:#14532db3}.bg-muted{background-color:hsl(var(--muted))}.bg-orange-500{--tw-bg-opacity: 1;background-color:rgb(249 115 22 / var(--tw-bg-opacity, 1))}.bg-orange-500\/15{background-color:#f9731626}.bg-orange-500\/20{background-color:#f9731633}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-primary\/10{background-color:hsl(var(--primary) / .1)}.bg-purple-500{--tw-bg-opacity: 1;background-color:rgb(168 85 247 / var(--tw-bg-opacity, 1))}.bg-purple-900\/50{background-color:#581c8780}.bg-red-400{--tw-bg-opacity: 1;background-color:rgb(248 113 113 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-500\/15{background-color:#ef444426}.bg-red-500\/30{background-color:#ef44444d}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-red-900\/20{background-color:#7f1d1d33}.bg-red-900\/40{background-color:#7f1d1d66}.bg-red-900\/50{background-color:#7f1d1d80}.bg-red-900\/70{background-color:#7f1d1db3}.bg-secondary{background-color:hsl(var(--secondary))}.bg-slate-500{--tw-bg-opacity: 1;background-color:rgb(100 116 139 / var(--tw-bg-opacity, 1))}.bg-slate-600{--tw-bg-opacity: 1;background-color:rgb(71 85 105 / var(--tw-bg-opacity, 1))}.bg-slate-700{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity, 1))}.bg-slate-800{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1))}.bg-slate-800\/40{background-color:#1e293b66}.bg-slate-800\/50{background-color:#1e293b80}.bg-slate-800\/60{background-color:#1e293b99}.bg-slate-900{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.bg-slate-900\/40{background-color:#0f172a66}.bg-slate-900\/50{background-color:#0f172a80}.bg-transparent{background-color:transparent}.bg-yellow-400{--tw-bg-opacity: 1;background-color:rgb(250 204 21 / var(--tw-bg-opacity, 1))}.bg-yellow-500{--tw-bg-opacity: 1;background-color:rgb(234 179 8 / var(--tw-bg-opacity, 1))}.bg-yellow-900\/50{background-color:#713f1280}.bg-zinc-900{--tw-bg-opacity: 1;background-color:rgb(24 24 27 / var(--tw-bg-opacity, 1))}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-blue-500{--tw-gradient-from: #3b82f6 var(--tw-gradient-from-position);--tw-gradient-to: rgb(59 130 246 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-gray-900{--tw-gradient-from: #111827 var(--tw-gradient-from-position);--tw-gradient-to: rgb(17 24 39 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-gray-800{--tw-gradient-to: #1f2937 var(--tw-gradient-to-position)}.to-sky-400{--tw-gradient-to: #38bdf8 var(--tw-gradient-to-position)}.fill-current{fill:currentColor}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-10{padding-left:2.5rem;padding-right:2.5rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-24{padding-top:6rem;padding-bottom:6rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-16{padding-bottom:4rem}.pb-2{padding-bottom:.5rem}.pl-1{padding-left:.25rem}.pl-2{padding-left:.5rem}.pl-8{padding-left:2rem}.pr-1{padding-right:.25rem}.pr-12{padding-right:3rem}.pr-2{padding-right:.5rem}.pr-8{padding-right:2rem}.pt-0{padding-top:0}.pt-1{padding-top:.25rem}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.pt-6{padding-top:1.5rem}.text-left{text-align:left}.text-center{text-align:center}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-5xl{font-size:3rem;line-height:1}.text-7xl{font-size:4.5rem;line-height:1}.text-\[10px\]{font-size:10px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-amber-100{--tw-text-opacity: 1;color:rgb(254 243 199 / var(--tw-text-opacity, 1))}.text-amber-200{--tw-text-opacity: 1;color:rgb(253 230 138 / var(--tw-text-opacity, 1))}.text-amber-200\/80{color:#fde68acc}.text-amber-300{--tw-text-opacity: 1;color:rgb(252 211 77 / var(--tw-text-opacity, 1))}.text-amber-400{--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.text-amber-400\/80{color:#fbbf24cc}.text-blue-400{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-card-foreground{color:hsl(var(--card-foreground))}.text-current{color:currentColor}.text-destructive{color:hsl(var(--destructive))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-emerald-200{--tw-text-opacity: 1;color:rgb(167 243 208 / var(--tw-text-opacity, 1))}.text-emerald-300{--tw-text-opacity: 1;color:rgb(110 231 183 / var(--tw-text-opacity, 1))}.text-foreground{color:hsl(var(--foreground))}.text-foreground\/50{color:hsl(var(--foreground) / .5)}.text-gray-200{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-green-200{--tw-text-opacity: 1;color:rgb(187 247 208 / var(--tw-text-opacity, 1))}.text-green-300{--tw-text-opacity: 1;color:rgb(134 239 172 / var(--tw-text-opacity, 1))}.text-green-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-orange-300{--tw-text-opacity: 1;color:rgb(253 186 116 / var(--tw-text-opacity, 1))}.text-orange-400{--tw-text-opacity: 1;color:rgb(251 146 60 / var(--tw-text-opacity, 1))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-purple-200{--tw-text-opacity: 1;color:rgb(233 213 255 / var(--tw-text-opacity, 1))}.text-purple-300{--tw-text-opacity: 1;color:rgb(216 180 254 / var(--tw-text-opacity, 1))}.text-purple-400{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.text-red-100{--tw-text-opacity: 1;color:rgb(254 226 226 / var(--tw-text-opacity, 1))}.text-red-200{--tw-text-opacity: 1;color:rgb(254 202 202 / var(--tw-text-opacity, 1))}.text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-sky-300{--tw-text-opacity: 1;color:rgb(125 211 252 / var(--tw-text-opacity, 1))}.text-sky-400{--tw-text-opacity: 1;color:rgb(56 189 248 / var(--tw-text-opacity, 1))}.text-slate-100{--tw-text-opacity: 1;color:rgb(241 245 249 / var(--tw-text-opacity, 1))}.text-slate-200{--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.text-slate-300{--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-teal-400{--tw-text-opacity: 1;color:rgb(45 212 191 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-white\/70{color:#ffffffb3}.text-yellow-200{--tw-text-opacity: 1;color:rgb(254 240 138 / var(--tw-text-opacity, 1))}.text-yellow-300{--tw-text-opacity: 1;color:rgb(253 224 71 / var(--tw-text-opacity, 1))}.text-zinc-500{--tw-text-opacity: 1;color:rgb(113 113 122 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.placeholder-gray-400::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}.placeholder-gray-400::placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-45{opacity:.45}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-90{opacity:.9}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-red-500\/30{--tw-shadow-color: rgb(239 68 68 / .3);--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.drop-shadow{--tw-drop-shadow: drop-shadow(0 1px 2px rgb(0 0 0 / .1)) drop-shadow(0 1px 1px rgb(0 0 0 / .06));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur{--tw-backdrop-blur: blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[width\]{transition-property:width;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-100{transition-duration:.1s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.duration-75{transition-duration:75ms}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in-0{--tw-enter-opacity: 0}.zoom-in-95{--tw-enter-scale: .95}.duration-100{animation-duration:.1s}.duration-200{animation-duration:.2s}.duration-300{animation-duration:.3s}.duration-500{animation-duration:.5s}.duration-75{animation-duration:75ms}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.running{animation-play-state:running}.\!paused{animation-play-state:paused!important}.paused{animation-play-state:paused}.\[appearance\:textfield\]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.file\:text-foreground::file-selector-button{color:hsl(var(--foreground))}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-slate-500::-moz-placeholder{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.placeholder\:text-slate-500::placeholder{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.hover\:border-blue-500:hover{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.hover\:border-gray-200:hover{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.hover\:border-gray-600:hover{--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1))}.hover\:border-red-400:hover{--tw-border-opacity: 1;border-color:rgb(248 113 113 / var(--tw-border-opacity, 1))}.hover\:border-slate-500:hover{--tw-border-opacity: 1;border-color:rgb(100 116 139 / var(--tw-border-opacity, 1))}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-amber-500\/20:hover{background-color:#f59e0b33}.hover\:bg-amber-700:hover{--tw-bg-opacity: 1;background-color:rgb(180 83 9 / var(--tw-bg-opacity, 1))}.hover\:bg-amber-900\/40:hover{background-color:#78350f66}.hover\:bg-blue-600:hover{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.hover\:bg-blue-700:hover{--tw-bg-opacity: 1;background-color:rgb(29 78 216 / var(--tw-bg-opacity, 1))}.hover\:bg-destructive\/80:hover{background-color:hsl(var(--destructive) / .8)}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-gray-500:hover{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-600:hover{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-700:hover{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-800:hover{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.hover\:bg-green-600:hover{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity, 1))}.hover\:bg-green-700:hover{--tw-bg-opacity: 1;background-color:rgb(21 128 61 / var(--tw-bg-opacity, 1))}.hover\:bg-orange-600:hover{--tw-bg-opacity: 1;background-color:rgb(234 88 12 / var(--tw-bg-opacity, 1))}.hover\:bg-primary\/80:hover{background-color:hsl(var(--primary) / .8)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-purple-600:hover{--tw-bg-opacity: 1;background-color:rgb(147 51 234 / var(--tw-bg-opacity, 1))}.hover\:bg-red-500\/10:hover{background-color:#ef44441a}.hover\:bg-red-500\/30:hover{background-color:#ef44444d}.hover\:bg-red-600:hover{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.hover\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity, 1))}.hover\:bg-red-900\/20:hover{background-color:#7f1d1d33}.hover\:bg-secondary:hover{background-color:hsl(var(--secondary))}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:bg-slate-600:hover{--tw-bg-opacity: 1;background-color:rgb(71 85 105 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-700:hover{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-700\/70:hover{background-color:#334155b3}.hover\:bg-slate-700\/80:hover{background-color:#334155cc}.hover\:bg-slate-800:hover{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1))}.hover\:bg-slate-900:hover{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.hover\:bg-transparent:hover{background-color:transparent}.hover\:bg-yellow-600:hover{--tw-bg-opacity: 1;background-color:rgb(202 138 4 / var(--tw-bg-opacity, 1))}.hover\:bg-zinc-800:hover{--tw-bg-opacity: 1;background-color:rgb(39 39 42 / var(--tw-bg-opacity, 1))}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-amber-200:hover{--tw-text-opacity: 1;color:rgb(253 230 138 / var(--tw-text-opacity, 1))}.hover\:text-amber-50:hover{--tw-text-opacity: 1;color:rgb(255 251 235 / var(--tw-text-opacity, 1))}.hover\:text-blue-300:hover{--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.hover\:text-blue-400:hover{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.hover\:text-blue-700:hover{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.hover\:text-emerald-200:hover{--tw-text-opacity: 1;color:rgb(167 243 208 / var(--tw-text-opacity, 1))}.hover\:text-foreground:hover{color:hsl(var(--foreground))}.hover\:text-gray-200:hover{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.hover\:text-red-300:hover{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.hover\:text-yellow-200:hover{--tw-text-opacity: 1;color:rgb(254 240 138 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-lg:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-red-500\/40:hover{--tw-shadow-color: rgb(239 68 68 / .4);--tw-shadow: var(--tw-shadow-colored)}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:bg-gray-800:focus{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.focus\:bg-slate-700\/80:focus{background-color:#334155cc}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:text-red-300:focus{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.focus\:text-white:focus{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.focus\:opacity-100:focus{opacity:1}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--background))}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:text-gray-500:disabled{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.disabled\:hover\:bg-transparent:hover:disabled{background-color:transparent}.group:hover .group-hover\:text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.group:hover .group-hover\:opacity-100{opacity:1}.group.destructive .group-\[\.destructive\]\:border-muted\/40{border-color:hsl(var(--muted) / .4)}.group.toaster .group-\[\.toaster\]\:border-border{border-color:hsl(var(--border))}.group.toast .group-\[\.toast\]\:bg-muted{background-color:hsl(var(--muted))}.group.toast .group-\[\.toast\]\:bg-primary{background-color:hsl(var(--primary))}.group.toaster .group-\[\.toaster\]\:bg-background{background-color:hsl(var(--background))}.group.destructive .group-\[\.destructive\]\:text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.group.toast .group-\[\.toast\]\:text-muted-foreground{color:hsl(var(--muted-foreground))}.group.toast .group-\[\.toast\]\:text-primary-foreground{color:hsl(var(--primary-foreground))}.group.toaster .group-\[\.toaster\]\:text-foreground{color:hsl(var(--foreground))}.group.toaster .group-\[\.toaster\]\:shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.group.destructive .group-\[\.destructive\]\:hover\:border-destructive\/30:hover{border-color:hsl(var(--destructive) / .3)}.group.destructive .group-\[\.destructive\]\:hover\:bg-destructive:hover{background-color:hsl(var(--destructive))}.group.destructive .group-\[\.destructive\]\:hover\:text-destructive-foreground:hover{color:hsl(var(--destructive-foreground))}.group.destructive .group-\[\.destructive\]\:hover\:text-red-50:hover{--tw-text-opacity: 1;color:rgb(254 242 242 / var(--tw-text-opacity, 1))}.group.destructive .group-\[\.destructive\]\:focus\:ring-destructive:focus{--tw-ring-color: hsl(var(--destructive))}.group.destructive .group-\[\.destructive\]\:focus\:ring-red-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(248 113 113 / var(--tw-ring-opacity, 1))}.group.destructive .group-\[\.destructive\]\:focus\:ring-offset-red-600:focus{--tw-ring-offset-color: #dc2626}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.aria-selected\:bg-gray-700[aria-selected=true]{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.data-\[disabled\=true\]\:pointer-events-none[data-disabled=true],.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=checked\]\:translate-x-5[data-state=checked]{--tw-translate-x: 1.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked],.data-\[swipe\=cancel\]\:translate-x-0[data-swipe=cancel]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=end\]\:translate-x-\[var\(--radix-toast-swipe-end-x\)\][data-swipe=end]{--tw-translate-x: var(--radix-toast-swipe-end-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=move\]\:translate-x-\[var\(--radix-toast-swipe-move-x\)\][data-swipe=move]{--tw-translate-x: var(--radix-toast-swipe-move-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=checked\]\:border-red-500[data-state=checked]{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.data-\[selected\=\'true\'\]\:bg-accent[data-selected=true]{background-color:hsl(var(--accent))}.data-\[state\=checked\]\:bg-green-500[data-state=checked]{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:hsl(var(--primary))}.data-\[state\=checked\]\:bg-red-500[data-state=checked]{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\[state\=unchecked\]\:bg-input[data-state=unchecked]{background-color:hsl(var(--input))}.data-\[selected\=true\]\:text-accent-foreground[data-selected=true]{color:hsl(var(--accent-foreground))}.data-\[state\=checked\]\:text-primary-foreground[data-state=checked]{color:hsl(var(--primary-foreground))}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\[disabled\=true\]\:opacity-50[data-disabled=true],.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[swipe\=move\]\:transition-none[data-swipe=move]{transition-property:none}.data-\[state\=open\]\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\[state\=closed\]\:animate-out[data-state=closed],.data-\[swipe\=end\]\:animate-out[data-swipe=end]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\[state\=closed\]\:fade-out-80[data-state=closed]{--tw-exit-opacity: .8}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}.data-\[state\=closed\]\:slide-out-to-left-1\/2[data-state=closed]{--tw-exit-translate-x: -50%}.data-\[state\=closed\]\:slide-out-to-right-full[data-state=closed]{--tw-exit-translate-x: 100%}.data-\[state\=closed\]\:slide-out-to-top-\[48\%\][data-state=closed]{--tw-exit-translate-y: -48%}.data-\[state\=open\]\:slide-in-from-left-1\/2[data-state=open]{--tw-enter-translate-x: -50%}.data-\[state\=open\]\:slide-in-from-top-\[48\%\][data-state=open]{--tw-enter-translate-y: -48%}.data-\[state\=open\]\:slide-in-from-top-full[data-state=open]{--tw-enter-translate-y: -100%}.group[data-state=open] .group-data-\[state\=open\]\:rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-state=open] .group-data-\[state\=open\]\:rotate-90{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@supports ((-webkit-backdrop-filter: var(--tw)) or (backdrop-filter: var(--tw))){.supports-\[backdrop-filter\]\:bg-black\/70{background-color:#000000b3}}.dark\:border-destructive:is(.dark *){border-color:hsl(var(--destructive))}@media (min-width: 640px){.sm\:bottom-0{bottom:0}.sm\:right-0{right:0}.sm\:top-auto{top:auto}.sm\:mt-0{margin-top:0}.sm\:w-60{width:15rem}.sm\:w-auto{width:auto}.sm\:max-w-\[500px\]{max-width:500px}.sm\:max-w-\[600px\]{max-width:600px}.sm\:max-w-xl{max-width:36rem}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:flex-col{flex-direction:column}.sm\:justify-end{justify-content:flex-end}.sm\:gap-4{gap:1rem}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:self-auto{align-self:auto}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:p-4{padding:1rem}.sm\:p-6{padding:1.5rem}.sm\:text-left{text-align:left}.sm\:text-center{text-align:center}.sm\:text-base{font-size:1rem;line-height:1.5rem}.sm\:text-sm{font-size:.875rem;line-height:1.25rem}.data-\[state\=open\]\:sm\:slide-in-from-bottom-full[data-state=open]{--tw-enter-translate-y: 100%}}@media (min-width: 768px){.md\:max-w-\[420px\]{max-width:420px}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:text-sm{font-size:.875rem;line-height:1.25rem}}@media (min-width: 1024px){.lg\:min-h-0{min-height:0px}.lg\:w-1\/2{width:50%}.lg\:w-full{width:100%}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-\[1\.2fr_2fr\]{grid-template-columns:1.2fr 2fr}.lg\:flex-row{flex-direction:row}.lg\:space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.lg\:space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.lg\:p-8{padding:2rem}}.\[\&\:\:-webkit-inner-spin-button\]\:m-0::-webkit-inner-spin-button{margin:0}.\[\&\:\:-webkit-inner-spin-button\]\:appearance-none::-webkit-inner-spin-button{-webkit-appearance:none;-moz-appearance:none;appearance:none}.\[\&\:\:-webkit-outer-spin-button\]\:m-0::-webkit-outer-spin-button{margin:0}.\[\&\:\:-webkit-outer-spin-button\]\:appearance-none::-webkit-outer-spin-button{-webkit-appearance:none;-moz-appearance:none;appearance:none}.\[\&\>span\]\:line-clamp-1>span{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\[\&\>svg\+div\]\:translate-y-\[-3px\]>svg+div{--tw-translate-y: -3px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\>svg\]\:absolute>svg{position:absolute}.\[\&\>svg\]\:left-4>svg{left:1rem}.\[\&\>svg\]\:top-4>svg{top:1rem}.\[\&\>svg\]\:text-destructive>svg{color:hsl(var(--destructive))}.\[\&\>svg\]\:text-foreground>svg{color:hsl(var(--foreground))}.\[\&\>svg\~\*\]\:pl-7>svg~*{padding-left:1.75rem}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-top:.375rem;padding-bottom:.375rem}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:.75rem;line-height:1rem}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{font-weight:500}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:hsl(var(--muted-foreground))}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:1.25rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:1.25rem}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:3rem}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-top:.75rem;padding-bottom:.75rem}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:1.25rem}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:1.25rem}.\[\&_p\]\:leading-relaxed p{line-height:1.625}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:size-4 svg{width:1rem;height:1rem}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0} diff --git a/frontend/dist/index.html b/frontend/dist/index.html index 5ce2e20..44455df 100644 --- a/frontend/dist/index.html +++ b/frontend/dist/index.html @@ -10,8 +10,8 @@ - - + + diff --git a/uv.lock b/uv.lock index f33199c..ea1b528 100644 --- a/uv.lock +++ b/uv.lock @@ -373,6 +373,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" }, ] +[[package]] +name = "comtypes" +version = "1.4.16" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/c6/2a/65274c13327f637ec13af8d39f2cf579d9ebe7a0e683696b5f05236d2805/comtypes-1.4.16.tar.gz", hash = "sha256:cd66d1add01265cface4df51ba1e31cd1657e04463c281c802e737e79e1ba93c", size = 260252, upload-time = "2026-03-02T23:11:42.413Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/5f/7c/0eb685107290b6221c03c46d39214a4e42a124189691cb83ae3228257f46/comtypes-1.4.16-py3-none-any.whl", hash = "sha256:e18d85179ff12955524c5a8c3bc09cb3c0d890f1da4d7123d14244c7b78f84c8", size = 296230, upload-time = "2026-03-02T23:11:41.049Z" }, +] + [[package]] name = "cuda-bindings" version = "12.9.4" @@ -1009,6 +1018,7 @@ dependencies = [ { name = "lelab-compute-seeed-cloud" }, { name = "lerobot", extra = ["core-scripts", "feetech", "training"] }, { name = "psutil" }, + { name = "pygrabber", marker = "sys_platform == 'win32'" }, { name = "uvicorn" }, { name = "websockets" }, ] @@ -1033,6 +1043,7 @@ requires-dist = [ { name = "lerobot", extras = ["core-scripts", "feetech", "training"], git = "https://github.com/huggingface/lerobot.git?rev=82dffde7fad11cba91f7916b050fbe7d7eea35ab" }, { name = "pre-commit", marker = "extra == 'dev'", specifier = ">=3.0" }, { name = "psutil", specifier = ">=5.9.0" }, + { name = "pygrabber", marker = "sys_platform == 'win32'", specifier = ">=0.2" }, { name = "pytest", marker = "extra == 'dev'", specifier = ">=7.0" }, { name = "pytest", marker = "extra == 'test'", specifier = ">=7.0" }, { name = "pytest-asyncio", marker = "extra == 'test'", specifier = ">=0.23" }, @@ -2013,6 +2024,19 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/f4/7e/a72dd26f3b0f4f2bf1dd8923c85f7ceb43172af56d63c7383eb62b332364/pygments-2.20.0-py3-none-any.whl", hash = "sha256:81a9e26dd42fd28a23a2d169d86d7ac03b46e2f8b59ed4698fb4785f946d0176", size = 1231151, upload-time = "2026-03-29T13:29:30.038Z" }, ] +[[package]] +name = "pygrabber" +version = "0.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "comtypes", marker = "sys_platform != 'linux'" }, + { name = "numpy", marker = "sys_platform != 'linux'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/d4/24/e7e5efa1d915853f3f34cedf751cbee9d88bee47a41122d495ee95452dad/pygrabber-0.2.tar.gz", hash = "sha256:e584b119d4c9b9a8f339eb34d1fe7fdd16214a2bf5a1876171145caebdb9e413", size = 18487, upload-time = "2023-10-20T07:17:14.97Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7a/51/0359e171686a7eeda5e975d7f9dfba6a67e04b33c7ddad1f7a343c171e55/pygrabber-0.2-py3-none-any.whl", hash = "sha256:5ac8bbe5f6a5dfb7c1c9c55d80ca9b9457743abd3ac8efa21cb9e302bdbf03ac", size = 24193, upload-time = "2023-10-20T07:17:13.1Z" }, +] + [[package]] name = "pynput" version = "1.8.2" From 75c89e26e3990ace3c7e73ca4a4250e1fe5b0b02 Mon Sep 17 00:00:00 2001 From: links Date: Fri, 12 Jun 2026 16:45:30 +0800 Subject: [PATCH 4/7] test(hf_auth): isolate auth status from local token --- tests/test_utils_hf_auth.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/test_utils_hf_auth.py b/tests/test_utils_hf_auth.py index 1a60f51..568cef1 100644 --- a/tests/test_utils_hf_auth.py +++ b/tests/test_utils_hf_auth.py @@ -51,8 +51,12 @@ def test_invalidate_whoami_cache_clears_cached_value() -> None: def test_handle_hf_auth_status_returns_dict() -> None: from lelab.utils import hf_auth - # handle_hf_auth_status() calls the module-level whoami() directly. - with patch("lelab.utils.hf_auth.whoami", return_value={"name": "alice", "orgs": []}): + # handle_hf_auth_status() delegates through cached_whoami(), so patch the + # shared HfApi's underlying network call and force a deterministic token. + with ( + patch("lelab.utils.hf_auth.get_token", return_value="hf_fake_token"), + patch.object(hf_auth._WHOAMI_API, "_inner_whoami", return_value={"name": "alice", "orgs": []}), + ): hf_auth.invalidate_whoami_cache() result = hf_auth.handle_hf_auth_status() assert isinstance(result, dict) From ba62f29d1e2df08fe057507ae810679b05bfb169 Mon Sep 17 00:00:00 2001 From: links Date: Fri, 12 Jun 2026 17:52:01 +0800 Subject: [PATCH 5/7] fix(seeed-cloud): separate flavor catalog from auth --- .../components/training/config/TargetCard.tsx | 4 +- frontend/src/lib/jobsApi.ts | 75 ++++++++++++++++++- frontend/src/pages/Training.tsx | 17 ++++- lelab/server.py | 37 ++++++++- tests/test_compute_providers.py | 23 ++++++ tests/test_seeed_cloud_config.py | 22 ++++++ 6 files changed, 166 insertions(+), 12 deletions(-) diff --git a/frontend/src/components/training/config/TargetCard.tsx b/frontend/src/components/training/config/TargetCard.tsx index 7376994..d0b48e0 100644 --- a/frontend/src/components/training/config/TargetCard.tsx +++ b/frontend/src/components/training/config/TargetCard.tsx @@ -250,7 +250,7 @@ const TargetCard: React.FC = ({ {!provider.authenticated && provider.id === SEEED_PROVIDER_ID ? (
- Connect to unlock Seeed Cloud flavors. + Connect to start training on Seeed Cloud.